From 7425283183cc26795bc3c655b2bc5cd6931091e2 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 19 Jun 2009 00:54:35 +0000 Subject: adding autoformat index member to dp object. --- sc/inc/dpobject.hxx | 4 ++++ sc/source/core/data/dpobject.cxx | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx index 5f3dfe9eb489..9dd014aac1f8 100644 --- a/sc/inc/dpobject.hxx +++ b/sc/inc/dpobject.hxx @@ -106,6 +106,7 @@ private: ScDPOutput* pOutput; BOOL bSettingsChanged; BOOL bAlive; // FALSE if only used to hold settings + sal_uInt16 nAutoFormatIndex; BOOL bAllowMove; long nHeaderRows; // page fields plus filter button @@ -136,6 +137,9 @@ public: void SetOutRange(const ScRange& rRange); const ScRange& GetOutRange() const { return aOutRange; } + void SetAutoFormatIndex (const sal_uInt16 nIndex); + sal_uInt16 GetAutoFormatIndex() const; + void SetSheetDesc(const ScSheetSourceDesc& rDesc); void SetImportDesc(const ScImportSourceDesc& rDesc); void SetServiceData(const ScDPServiceDesc& rDesc); diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index 12af06a773ed..4cf5d1e8a602 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -165,6 +165,7 @@ ScDPObject::ScDPObject( ScDocument* pD ) : pOutput( NULL ), bSettingsChanged( FALSE ), bAlive( FALSE ), + nAutoFormatIndex( 65535 ), bAllowMove( FALSE ), nHeaderRows( 0 ) { @@ -183,6 +184,7 @@ ScDPObject::ScDPObject(const ScDPObject& r) : pOutput( NULL ), bSettingsChanged( FALSE ), bAlive( FALSE ), + nAutoFormatIndex( r.nAutoFormatIndex ), bAllowMove( FALSE ), nHeaderRows( r.nHeaderRows ) { @@ -232,6 +234,16 @@ void ScDPObject::SetSaveData(const ScDPSaveData& rData) InvalidateData(); // re-init source from SaveData } +void ScDPObject::SetAutoFormatIndex(const sal_uInt16 nIndex) +{ + nAutoFormatIndex = nIndex; +} + +sal_uInt16 ScDPObject::GetAutoFormatIndex() const +{ + return nAutoFormatIndex; +} + void ScDPObject::SetOutRange(const ScRange& rRange) { aOutRange = rRange; -- cgit v1.2.3 From acd89bd93d510281d1e46ca1617ff8545d0e981b Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 19 Jun 2009 01:30:32 +0000 Subject: added grid layout bits. --- sc/inc/dpobject.hxx | 6 ++- sc/inc/dpoutput.hxx | 4 ++ sc/source/core/data/dpobject.cxx | 25 +++++++--- sc/source/core/data/dpoutput.cxx | 19 +++++++- sc/source/filter/excel/read.cxx | 1 + sc/source/filter/excel/xepivot.cxx | 20 ++++++++ sc/source/filter/excel/xipivot.cxx | 93 ++++++++++++++++++++++++++++++++++++++ sc/source/filter/inc/xepivot.hxx | 3 ++ sc/source/filter/inc/xipivot.hxx | 7 +++ sc/source/filter/inc/xlpivot.hxx | 25 ++++++++++ 10 files changed, 194 insertions(+), 9 deletions(-) diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx index 9dd014aac1f8..1c50c773b4df 100644 --- a/sc/inc/dpobject.hxx +++ b/sc/inc/dpobject.hxx @@ -106,9 +106,10 @@ private: ScDPOutput* pOutput; BOOL bSettingsChanged; BOOL bAlive; // FALSE if only used to hold settings - sal_uInt16 nAutoFormatIndex; + sal_uInt16 mnAutoFormatIndex; BOOL bAllowMove; long nHeaderRows; // page fields plus filter button + bool mbHeaderLayout; // TRUE : grid, FALSE : standard SC_DLLPRIVATE void CreateObjects(); @@ -140,6 +141,9 @@ public: void SetAutoFormatIndex (const sal_uInt16 nIndex); sal_uInt16 GetAutoFormatIndex() const; + void SetHeaderLayout(bool bUseGrid); + bool GetHeaderLayout() const; + void SetSheetDesc(const ScSheetSourceDesc& rDesc); void SetImportDesc(const ScImportSourceDesc& rDesc); void SetServiceData(const ScDPServiceDesc& rDesc); diff --git a/sc/inc/dpoutput.hxx b/sc/inc/dpoutput.hxx index 58001e1183a6..65108761b2ec 100644 --- a/sc/inc/dpoutput.hxx +++ b/sc/inc/dpoutput.hxx @@ -109,6 +109,7 @@ private: long nColCount; long nRowCount; long nHeaderSize; + bool mbHeaderLayout; // TRUE : grid, FALSE : standard SCCOL nTabStartCol; SCROW nTabStartRow; SCCOL nMemberStartCol; @@ -162,6 +163,9 @@ public: void GetMemberResultNames( ScStrCollection& rNames, long nDimension ); + void SetHeaderLayout(bool bUseGrid); + bool GetHeaderLayout() const; + static void GetDataDimensionNames( String& rSourceName, String& rGivenName, const com::sun::star::uno::Reference< com::sun::star::uno::XInterface>& xDim ); diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index 4cf5d1e8a602..fa58a8b3c277 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -165,9 +165,10 @@ ScDPObject::ScDPObject( ScDocument* pD ) : pOutput( NULL ), bSettingsChanged( FALSE ), bAlive( FALSE ), - nAutoFormatIndex( 65535 ), + mnAutoFormatIndex( 65535 ), bAllowMove( FALSE ), - nHeaderRows( 0 ) + nHeaderRows( 0 ), + mbHeaderLayout(false) { } @@ -184,9 +185,10 @@ ScDPObject::ScDPObject(const ScDPObject& r) : pOutput( NULL ), bSettingsChanged( FALSE ), bAlive( FALSE ), - nAutoFormatIndex( r.nAutoFormatIndex ), + mnAutoFormatIndex( r.mnAutoFormatIndex ), bAllowMove( FALSE ), - nHeaderRows( r.nHeaderRows ) + nHeaderRows( r.nHeaderRows ), + mbHeaderLayout( r.mbHeaderLayout ) { if (r.pSaveData) pSaveData = new ScDPSaveData(*r.pSaveData); @@ -236,12 +238,22 @@ void ScDPObject::SetSaveData(const ScDPSaveData& rData) void ScDPObject::SetAutoFormatIndex(const sal_uInt16 nIndex) { - nAutoFormatIndex = nIndex; + mnAutoFormatIndex = nIndex; } sal_uInt16 ScDPObject::GetAutoFormatIndex() const { - return nAutoFormatIndex; + return mnAutoFormatIndex; +} + +void ScDPObject::SetHeaderLayout (bool bUseGrid) +{ + mbHeaderLayout = bUseGrid; +} + +bool ScDPObject::GetHeaderLayout() const +{ + return mbHeaderLayout; } void ScDPObject::SetOutRange(const ScRange& rRange) @@ -350,6 +362,7 @@ void ScDPObject::CreateOutput() { BOOL bFilterButton = IsSheetData() && pSaveData && pSaveData->GetFilterButton(); pOutput = new ScDPOutput( pDoc, xSource, aOutRange.aStart, bFilterButton ); + pOutput->SetHeaderLayout ( mbHeaderLayout ); long nOldRows = nHeaderRows; nHeaderRows = pOutput->GetHeaderRows(); diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx index 63acede160c9..567dcc7991f3 100644 --- a/sc/source/core/data/dpoutput.cxx +++ b/sc/source/core/data/dpoutput.cxx @@ -376,7 +376,8 @@ ScDPOutput::ScDPOutput( ScDocument* pD, const uno::Reference* pRowAry = aData.getConstArray(); nColCount = nRowCount ? ( pRowAry[0].getLength() ) : 0; - nHeaderSize = 1; // one row for field names + + nHeaderSize = 1; + if (GetHeaderLayout() && nColFieldCount == 0) + // Insert an extra header row only when there is no column field. + nHeaderSize = 2; // calculate output positions and sizes @@ -993,6 +998,16 @@ void ScDPOutput::GetMemberResultNames( ScStrCollection& rNames, long nDimension } } +void ScDPOutput::SetHeaderLayout(bool bUseGrid) +{ + mbHeaderLayout = bUseGrid; + bSizesValid = false; +} + +bool ScDPOutput::GetHeaderLayout() const +{ + return mbHeaderLayout; +} void ScDPOutput::GetPositionData(const ScAddress& rPos, DataPilotTablePositionData& rPosData) { diff --git a/sc/source/filter/excel/read.cxx b/sc/source/filter/excel/read.cxx index a06cf041e7cf..d1ae00376cde 100644 --- a/sc/source/filter/excel/read.cxx +++ b/sc/source/filter/excel/read.cxx @@ -1143,6 +1143,7 @@ FltError ImportExcel8::Read( void ) case EXC_ID_SXDI: rPTableMgr.ReadSxdi( maStrm ); break; case EXC_ID_SXVDEX: rPTableMgr.ReadSxvdex( maStrm ); break; case EXC_ID_SXEX: rPTableMgr.ReadSxex( maStrm ); break; + case EXC_ID_SXVIEWEX9: rPTableMgr.ReadSxViewEx9( maStrm ); break; } } break; diff --git a/sc/source/filter/excel/xepivot.cxx b/sc/source/filter/excel/xepivot.cxx index 457cdd2a17e4..0b10ded5aa9e 100644 --- a/sc/source/filter/excel/xepivot.cxx +++ b/sc/source/filter/excel/xepivot.cxx @@ -1220,6 +1220,8 @@ XclExpPivotTable::XclExpPivotTable( const XclExpRoot& rRoot, const ScDPObject& r maPTInfo.maDataName = ScGlobal::GetRscString( STR_PIVOT_DATA ); maPTInfo.mnCacheIdx = mrPCache.GetCacheIndex(); + maPTAutoFormat.Init( rDPObj ); + if( const ScDPSaveData* pSaveData = rDPObj.GetSaveData() ) { // additional properties from ScDPSaveData @@ -1299,6 +1301,8 @@ void XclExpPivotTable::Save( XclExpStream& rStrm ) WriteSxli( rStrm, maPTInfo.mnDataCols, maPTInfo.mnColFields ); // SXEX WriteSxex( rStrm ); + // SX_AUTOFORMAT + WriteSxAutoformat( rStrm ); } } @@ -1439,6 +1443,8 @@ void XclExpPivotTable::Finalize() rnDataXclRow = rnXclRow1 + maPTInfo.mnColFields + 1; if( maDataFields.empty() ) ++rnDataXclRow; + if( 0 == maPTAutoFormat.mnGridLayout ) + ++rnDataXclRow; rnXclCol2 = ::std::max( rnXclCol2, rnDataXclCol ); rnXclRow2 = ::std::max( rnXclRow2, rnDataXclRow ); maPTInfo.mnDataCols = rnXclCol2 - rnDataXclCol + 1; @@ -1446,6 +1452,8 @@ void XclExpPivotTable::Finalize() // first heading maPTInfo.mnFirstHeadRow = rnXclRow1 + 1; + if( 0 == maPTAutoFormat.mnGridLayout ) + maPTInfo.mnFirstHeadRow++; } // records ---------------------------------------------------------------- @@ -1525,6 +1533,18 @@ void XclExpPivotTable::WriteSxex( XclExpStream& rStrm ) const rStrm.EndRecord(); } +void XclExpPivotTable::WriteSxAutoformat( XclExpStream& rStrm ) const +{ + // Until we sync the autoformat ids only export if using grid header layout + // That could only have been set via xls import so far. + if ( 0 == maPTAutoFormat.mnGridLayout ) + { + rStrm.StartRecord( EXC_ID_SXVIEWEX9, 17 ); + rStrm << maPTAutoFormat; + rStrm.EndRecord(); + } +} + // ============================================================================ namespace { diff --git a/sc/source/filter/excel/xipivot.cxx b/sc/source/filter/excel/xipivot.cxx index acd371f43f7d..495f73d75a68 100644 --- a/sc/source/filter/excel/xipivot.cxx +++ b/sc/source/filter/excel/xipivot.cxx @@ -1296,6 +1296,11 @@ void XclImpPivotTable::ReadSxex( XclImpStream& rStrm ) rStrm >> maPTExtInfo; } +void XclImpPivotTable::ReadSxViewEx9( XclImpStream& rStrm ) +{ + rStrm >> maPTAutoFormat; +} + // ---------------------------------------------------------------------------- void XclImpPivotTable::Convert() @@ -1363,6 +1368,7 @@ void XclImpPivotTable::Convert() pDPObj->SetSheetDesc( aDesc ); pDPObj->SetOutRange( aOutRange ); pDPObj->SetAlive( TRUE ); + pDPObj->SetHeaderLayout( maPTAutoFormat.mnGridLayout == 0 ); GetDoc().GetDPCollection()->Insert( pDPObj ); } @@ -1458,6 +1464,12 @@ void XclImpPivotTableManager::ReadSxex( XclImpStream& rStrm ) maPTables.back()->ReadSxex( rStrm ); } +void XclImpPivotTableManager::ReadSxViewEx9( XclImpStream& rStrm ) +{ + if( !maPTables.empty() ) + maPTables.back()->ReadSxViewEx9( rStrm ); +} + // ---------------------------------------------------------------------------- void XclImpPivotTableManager::ReadPivotCaches( XclImpStream& rStrm ) @@ -1474,3 +1486,84 @@ void XclImpPivotTableManager::ConvertPivotTables() // ============================================================================ +// Pivot table autoformat settings ============================================ + +/** +classic : 10 08 00 00 00 00 00 00 20 00 00 00 01 00 00 00 00 +default : 10 08 00 00 00 00 00 00 20 00 00 00 01 00 00 00 00 +report01 : 10 08 02 00 00 00 00 00 20 00 00 00 00 10 00 00 00 +report02 : 10 08 02 00 00 00 00 00 20 00 00 00 01 10 00 00 00 +report03 : 10 08 02 00 00 00 00 00 20 00 00 00 02 10 00 00 00 +report04 : 10 08 02 00 00 00 00 00 20 00 00 00 03 10 00 00 00 +report05 : 10 08 02 00 00 00 00 00 20 00 00 00 04 10 00 00 00 +report06 : 10 08 02 00 00 00 00 00 20 00 00 00 05 10 00 00 00 +report07 : 10 08 02 00 00 00 00 00 20 00 00 00 06 10 00 00 00 +report08 : 10 08 02 00 00 00 00 00 20 00 00 00 07 10 00 00 00 +report09 : 10 08 02 00 00 00 00 00 20 00 00 00 08 10 00 00 00 +report10 : 10 08 02 00 00 00 00 00 20 00 00 00 09 10 00 00 00 +table01 : 10 08 00 00 00 00 00 00 20 00 00 00 0a 10 00 00 00 +table02 : 10 08 00 00 00 00 00 00 20 00 00 00 0b 10 00 00 00 +table03 : 10 08 00 00 00 00 00 00 20 00 00 00 0c 10 00 00 00 +table04 : 10 08 00 00 00 00 00 00 20 00 00 00 0d 10 00 00 00 +table05 : 10 08 00 00 00 00 00 00 20 00 00 00 0e 10 00 00 00 +table06 : 10 08 00 00 00 00 00 00 20 00 00 00 0f 10 00 00 00 +table07 : 10 08 00 00 00 00 00 00 20 00 00 00 10 10 00 00 00 +table08 : 10 08 00 00 00 00 00 00 20 00 00 00 11 10 00 00 00 +table09 : 10 08 00 00 00 00 00 00 20 00 00 00 12 10 00 00 00 +table10 : 10 08 00 00 00 00 00 00 20 00 00 00 13 10 00 00 00 +none : 10 08 00 00 00 00 00 00 20 00 00 00 15 10 00 00 00 +**/ + +XclPTAutoFormat::XclPTAutoFormat() : + mbReport( 0 ), + mnAutoFormat( 0 ), + mnGridLayout( 0x10 ) +{ +} + +void XclPTAutoFormat::Init( const ScDPObject& rDPObj ) +{ + if( rDPObj.GetHeaderLayout() ) + { + mbReport = 0; + mnAutoFormat = 1; + mnGridLayout = 0; + } + else + { + // Report1 for now + // TODO : sync with autoformat indicies + mbReport = 2; + mnAutoFormat = 1; + mnGridLayout = 0x10; + } +} + +XclImpStream& operator>>( XclImpStream& rStrm, XclPTAutoFormat& rInfo ) +{ + rStrm.Ignore( 2 ); + rStrm >> rInfo.mbReport; /// 2 for report* fmts ? + rStrm.Ignore( 6 ); + sal_uInt8 nDummy; + return rStrm + >> rInfo.mnAutoFormat + >> rInfo.mnGridLayout + >> nDummy >> nDummy >> nDummy; +} + +XclExpStream& operator<<( XclExpStream& rStrm, const XclPTAutoFormat& rInfo ) +{ + return rStrm + << EXC_PT_AUTOFMT_HEADER + << rInfo.mbReport + << EXC_PT_AUTOFMT_ZERO + << EXC_PT_AUTOFMT_FLAGS + << rInfo.mnAutoFormat + << rInfo.mnGridLayout + << static_cast(0x00) + << static_cast(0x00) + << static_cast(0x00); +} + +// ============================================================================ + diff --git a/sc/source/filter/inc/xepivot.hxx b/sc/source/filter/inc/xepivot.hxx index 80356d41f4a8..67ef2ff6fcd8 100644 --- a/sc/source/filter/inc/xepivot.hxx +++ b/sc/source/filter/inc/xepivot.hxx @@ -412,6 +412,8 @@ private: void WriteSxli( XclExpStream& rStrm, sal_uInt16 nLineCount, sal_uInt16 nIndexCount ) const; /** Writes the SXEX records containing additional pivot table info. */ void WriteSxex( XclExpStream& rStrm ) const; + /** Writes the SX_AUTOFORMAT records with the autoformat id and header layout */ + void WriteSxAutoformat( XclExpStream& rStrm ) const; // ------------------------------------------------------------------------ private: @@ -422,6 +424,7 @@ private: const XclExpPivotCache& mrPCache; /// The pivot cache this pivot table bases on. XclPTInfo maPTInfo; /// Info about the pivot table (SXVIEW record). XclPTExtInfo maPTExtInfo; /// Extended info about the pivot table (SXEX record). + XclPTAutoFormat maPTAutoFormat; /// The selected autoformat (SXVIEWEX9) XclExpPTFieldList maFieldList; /// All fields in pivot cache order. ScfUInt16Vec maRowFields; /// Row field indexes. ScfUInt16Vec maColFields; /// Column field indexes. diff --git a/sc/source/filter/inc/xipivot.hxx b/sc/source/filter/inc/xipivot.hxx index 52b55509219b..5a98c0793740 100644 --- a/sc/source/filter/inc/xipivot.hxx +++ b/sc/source/filter/inc/xipivot.hxx @@ -350,6 +350,9 @@ public: void ReadSxdi( XclImpStream& rStrm ); /** Reads an SXEX record containing additional settings for the pivot table. */ void ReadSxex( XclImpStream& rStrm ); + /** Reads an SXVIEWEX9 record that specifies the pivot tables + * autoformat. */ + void ReadSxViewEx9( XclImpStream& rStrm ); // ------------------------------------------------------------------------ @@ -364,6 +367,7 @@ private: XclPTInfo maPTInfo; /// General info about the pivot table (SXVIEW record). XclPTExtInfo maPTExtInfo; /// Extended info about the pivot table (SXEX record). + XclPTAutoFormat maPTAutoFormat; /// The selected autoformat (SX_AUTOFORMAT) XclImpPTFieldVec maFields; /// Vector containing all fields. XclImpPTFieldRef mxCurrField; /// Current field for importing additional info. ScfStringVec maVisFieldNames; /// Vector containing all visible field names. @@ -422,6 +426,9 @@ public: void ReadSxvi( XclImpStream& rStrm ); /** Reads an SXEX record containing additional settings for a pivot table. */ void ReadSxex( XclImpStream& rStrm ); + /** Reads an SXVIEWEX9 record that specifies the pivot tables + * autoformat. */ + void ReadSxViewEx9( XclImpStream& rStrm ); // ------------------------------------------------------------------------ diff --git a/sc/source/filter/inc/xlpivot.hxx b/sc/source/filter/inc/xlpivot.hxx index 9604c7b1d17d..52251ed62294 100644 --- a/sc/source/filter/inc/xlpivot.hxx +++ b/sc/source/filter/inc/xlpivot.hxx @@ -41,6 +41,7 @@ #include #include "ftools.hxx" #include "xladdress.hxx" +#include "dpobject.hxx" class XclImpStream; class XclExpStream; @@ -73,6 +74,10 @@ const sal_uInt16 EXC_PT_MAXDATACOUNT = 256; // pivot table items const sal_uInt16 EXC_PT_MAXITEMCOUNT = 32500; +const sal_uInt16 EXC_PT_AUTOFMT_HEADER = 0x810; +const sal_uInt16 EXC_PT_AUTOFMT_ZERO = 0; +const sal_uInt32 EXC_PT_AUTOFMT_FLAGS = 0x20; + /** Data type of a pivot cache item. */ enum XclPCItemType { @@ -396,6 +401,9 @@ const double EXC_SXDBEX_CREATION_DATE = 51901.029652778; const sal_uInt16 EXC_ID_SXFDBTYPE = 0x01BB; const sal_uInt16 EXC_SXFDBTYPE_DEFAULT = 0x0000; +// (0x0810) SXVIEWEX9 --------------------------------------------------------- +const sal_uInt16 EXC_ID_SXVIEWEX9 = 0x0810; + // ============================================================================ // Pivot cache // ============================================================================ @@ -786,5 +794,22 @@ XclExpStream& operator<<( XclExpStream& rStrm, const XclPTExtInfo& rInfo ); // ============================================================================ +// Pivot table autoformat settings ============================================== + +/** Pivot table autoformat settings (SX_AUTOFORMAT record). */ +struct XclPTAutoFormat +{ + sal_uInt32 mbReport; /// 2 for report* fmts ? + sal_uInt8 mnAutoFormat; /// AutoFormat ID + sal_uInt8 mnGridLayout; /// 0 == gridlayout, 0x10 == modern + + explicit XclPTAutoFormat(); + void Init( const ScDPObject& rDPObj ); +}; + +XclImpStream& operator>>( XclImpStream& rStrm, XclPTAutoFormat& rInfo ); +XclExpStream& operator<<( XclExpStream& rStrm, const XclPTAutoFormat& rInfo ); + +// ============================================================================ #endif -- cgit v1.2.3 From 751e88e346f2160cdd27791e427f73b9fa89c82a Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 19 Jun 2009 01:41:36 +0000 Subject: #i22029# Added two new constant values to transfer additional attributes of dp members. --- offapi/com/sun/star/sheet/MemberResultFlags.idl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/offapi/com/sun/star/sheet/MemberResultFlags.idl b/offapi/com/sun/star/sheet/MemberResultFlags.idl index f2157e7724ca..a00bea878999 100644 --- a/offapi/com/sun/star/sheet/MemberResultFlags.idl +++ b/offapi/com/sun/star/sheet/MemberResultFlags.idl @@ -59,6 +59,17 @@ published constants MemberResultFlags */ const long CONTINUE = 4; + //------------------------------------------------------------------------- + + /** The element contains a grand total. + */ + const long GRANDTOTAL = 8; + + //------------------------------------------------------------------------- + + /** The element is a numeric value. + */ + const long NUMERIC = 16; }; //============================================================================= -- cgit v1.2.3 From 621ea5f0e56231a7d5063e6d12cce8aab55af37c Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 19 Jun 2009 02:29:09 +0000 Subject: #i22029# #i81335# applied & adjusted the patch from ooo-build. This enables changing the names of fields, field members and grand total names. --- sc/inc/dpgroup.hxx | 5 +- sc/inc/dpobject.hxx | 16 +- sc/inc/dpsave.hxx | 62 +++++-- sc/inc/dptabres.hxx | 5 +- sc/inc/dptabsrc.hxx | 17 +- sc/inc/unonames.hxx | 3 + sc/source/core/data/dpgroup.cxx | 4 +- sc/source/core/data/dpobject.cxx | 126 +++++++++----- sc/source/core/data/dpoutput.cxx | 41 ++++- sc/source/core/data/dpsave.cxx | 233 ++++++++++++++++++++++--- sc/source/core/data/dptabres.cxx | 86 +++++++-- sc/source/core/data/dptabsrc.cxx | 121 +++++++++++-- sc/source/filter/excel/read.cxx | 3 + sc/source/filter/excel/xepivot.cxx | 111 ++++++++++-- sc/source/filter/excel/xestring.cxx | 4 +- sc/source/filter/excel/xipivot.cxx | 124 +++++-------- sc/source/filter/excel/xlpivot.cxx | 125 ++++++++++++- sc/source/filter/inc/xepivot.hxx | 6 +- sc/source/filter/inc/xestring.hxx | 1 + sc/source/filter/inc/xipivot.hxx | 9 +- sc/source/filter/inc/xlpivot.hxx | 15 +- sc/source/filter/inc/xlstring.hxx | 1 + sc/source/ui/dbgui/pvfundlg.cxx | 22 ++- sc/source/ui/dbgui/pvlaydlg.cxx | 41 +++++ sc/source/ui/inc/pvfundlg.hxx | 11 ++ sc/source/ui/unoobj/dapiuno.cxx | 11 +- sc/source/ui/view/dbfunc3.cxx | 337 ++++++++++++++++++++++++++++-------- 27 files changed, 1219 insertions(+), 321 deletions(-) diff --git a/sc/inc/dpgroup.hxx b/sc/inc/dpgroup.hxx index 99dac0e517db..cb933f4d2a98 100644 --- a/sc/inc/dpgroup.hxx +++ b/sc/inc/dpgroup.hxx @@ -33,6 +33,7 @@ #include #include +#include #include "dptabdat.hxx" #include "scdllapi.h" @@ -182,7 +183,7 @@ class ScDPGroupTableData : public ScDPTableData { typedef ::std::hash_set< ::rtl::OUString, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > StringHashSet; - ScDPTableData* pSourceData; + ::boost::shared_ptr pSourceData; long nSourceCount; ScDPGroupDimensionVec aGroups; ScDPNumGroupDimension* pNumGroups; // array[nSourceCount] @@ -200,7 +201,7 @@ class ScDPGroupTableData : public ScDPTableData public: // takes ownership of pSource - ScDPGroupTableData( ScDPTableData* pSource, ScDocument* pDocument ); + ScDPGroupTableData( const ::boost::shared_ptr& pSource, ScDocument* pDocument ); virtual ~ScDPGroupTableData(); void AddGroupDimension( const ScDPGroupDimension& rGroup ); diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx index 1c50c773b4df..f90277769cba 100644 --- a/sc/inc/dpobject.hxx +++ b/sc/inc/dpobject.hxx @@ -38,6 +38,8 @@ #include "dpoutput.hxx" #include +#include + //------------------------------------------------------------------ namespace com { namespace sun { namespace star { namespace sheet { @@ -66,6 +68,7 @@ class ScStrCollection; class TypedScStrCollection; struct PivotField; class ScDPCacheTable; +class ScDPTableData; struct ScDPServiceDesc { @@ -101,6 +104,7 @@ private: ScSheetSourceDesc* pSheetDesc; // for sheet data ScImportSourceDesc* pImpDesc; // for database data ScDPServiceDesc* pServDesc; // for external service + ::boost::shared_ptr mpTableData; // cached data com::sun::star::uno::Reference xSource; ScDPOutput* pOutput; @@ -112,6 +116,7 @@ private: bool mbHeaderLayout; // TRUE : grid, FALSE : standard + SC_DLLPRIVATE ScDPTableData* GetTableData(); SC_DLLPRIVATE void CreateObjects(); SC_DLLPRIVATE void CreateOutput(); @@ -166,7 +171,14 @@ public: void SetTag(const String& rNew); const String& GetTag() const { return aTableTag; } - BOOL IsDimNameInUse( const String& rName ) const; + /** + * Data description cell displays the description of a data dimension if + * and only if there is only one data dimension. It's usually located at + * the upper-left corner of the table output. + */ + bool IsDataDescriptionCell(const ScAddress& rPos); + + bool IsDimNameInUse(const ::rtl::OUString& rName) const; String GetDimName( long nDim, BOOL& rIsDataLayout ); BOOL IsDuplicated( long nDim ); long GetDimCount(); @@ -230,6 +242,8 @@ public: // (button attribute must be present) void RefreshAfterLoad(); + void BuildAllDimensionMembers(); + static BOOL HasRegisteredSources(); static com::sun::star::uno::Sequence GetRegisteredSources(); static com::sun::star::uno::Reference diff --git a/sc/inc/dpsave.hxx b/sc/inc/dpsave.hxx index 44689bcf0772..9d680dfa3856 100644 --- a/sc/inc/dpsave.hxx +++ b/sc/inc/dpsave.hxx @@ -34,9 +34,11 @@ #include #include #include +#include #include "scdllapi.h" #include #include +#include namespace com { namespace sun { namespace star { namespace sheet { struct DataPilotFieldReference; @@ -46,6 +48,7 @@ namespace com { namespace sun { namespace star { namespace sheet { } } } } class ScDPDimensionSaveData; +class ScDPTableData; // -------------------------------------------------------------------- // @@ -57,6 +60,7 @@ class ScDPSaveMember { private: String aName; + ::std::auto_ptr mpLayoutName; // custom name to be displayed in the table. USHORT nVisibleMode; USHORT nShowDetailsMode; @@ -77,18 +81,23 @@ public: void SetName( const String& rNew ); // used if the source member was renamed (groups) + SC_DLLPUBLIC void SetLayoutName( const ::rtl::OUString& rName ); + SC_DLLPUBLIC const ::rtl::OUString* GetLayoutName() const; + void RemoveLayoutName(); + void WriteToSource( const com::sun::star::uno::Reference< com::sun::star::uno::XInterface>& xMember, sal_Int32 nPosition ); }; -class ScDPSaveDimension +class SC_DLLPUBLIC ScDPSaveDimension { private: String aName; - String* pLayoutName; // alternative name for layout, not used (yet) String* pSelectedPage; + ::std::auto_ptr mpLayoutName; + ::std::auto_ptr mpSubtotalName; BOOL bIsDataLayout; BOOL bDupFlag; USHORT nOrientation; @@ -127,39 +136,44 @@ public: void SetName( const String& rNew ); // used if the source dim was renamed (groups) - SC_DLLPUBLIC void SetOrientation(USHORT nNew); + void SetOrientation(USHORT nNew); void SetSubTotals(BOOL bSet); // to be removed! - SC_DLLPUBLIC void SetSubTotals(long nCount, const USHORT* pFuncs); + void SetSubTotals(long nCount, const USHORT* pFuncs); long GetSubTotalsCount() const { return nSubTotalCount; } USHORT GetSubTotalFunc(long nIndex) const { return pSubTotalFuncs[nIndex]; } - SC_DLLPUBLIC void SetShowEmpty(BOOL bSet); + void SetShowEmpty(BOOL bSet); BOOL GetShowEmpty() const { return BOOL(nShowEmptyMode); } - SC_DLLPUBLIC void SetFunction(USHORT nNew); // enum GeneralFunction + void SetFunction(USHORT nNew); // enum GeneralFunction USHORT GetFunction() const { return nFunction; } void SetUsedHierarchy(long nNew); long GetUsedHierarchy() const { return nUsedHierarchy; } - SC_DLLPUBLIC void SetLayoutName(const String* pName); - SC_DLLPUBLIC const String& GetLayoutName() const; - SC_DLLPUBLIC BOOL HasLayoutName() const; + + void SetLayoutName(const ::rtl::OUString& rName); + const ::rtl::OUString* GetLayoutName() const; + void RemoveLayoutName(); + void SetSubtotalName(const ::rtl::OUString& rName); + const ::rtl::OUString* GetSubtotalName() const; + + bool IsMemberNameInUse(const ::rtl::OUString& rName) const; const ::com::sun::star::sheet::DataPilotFieldReference* GetReferenceValue() const { return pReferenceValue; } - SC_DLLPUBLIC void SetReferenceValue(const ::com::sun::star::sheet::DataPilotFieldReference* pNew); + void SetReferenceValue(const ::com::sun::star::sheet::DataPilotFieldReference* pNew); const ::com::sun::star::sheet::DataPilotFieldSortInfo* GetSortInfo() const { return pSortInfo; } - SC_DLLPUBLIC void SetSortInfo(const ::com::sun::star::sheet::DataPilotFieldSortInfo* pNew); + void SetSortInfo(const ::com::sun::star::sheet::DataPilotFieldSortInfo* pNew); const ::com::sun::star::sheet::DataPilotFieldAutoShowInfo* GetAutoShowInfo() const { return pAutoShowInfo; } - SC_DLLPUBLIC void SetAutoShowInfo(const ::com::sun::star::sheet::DataPilotFieldAutoShowInfo* pNew); + void SetAutoShowInfo(const ::com::sun::star::sheet::DataPilotFieldAutoShowInfo* pNew); const ::com::sun::star::sheet::DataPilotFieldLayoutInfo* GetLayoutInfo() const { return pLayoutInfo; } - SC_DLLPUBLIC void SetLayoutInfo(const ::com::sun::star::sheet::DataPilotFieldLayoutInfo* pNew); + void SetLayoutInfo(const ::com::sun::star::sheet::DataPilotFieldLayoutInfo* pNew); - SC_DLLPUBLIC void SetCurrentPage( const String* pPage ); // NULL = no selection (all) - SC_DLLPUBLIC BOOL HasCurrentPage() const; - SC_DLLPUBLIC const String& GetCurrentPage() const; + void SetCurrentPage( const String* pPage ); // NULL = no selection (all) + BOOL HasCurrentPage() const; + const String& GetCurrentPage() const; USHORT GetOrientation() const { return nOrientation; } ScDPSaveMember* GetExistingMemberByName(const String& rName); - SC_DLLPUBLIC ScDPSaveMember* GetMemberByName(const String& rName); + ScDPSaveMember* GetMemberByName(const String& rName); void SetMemberPosition( const String& rName, sal_Int32 nNewPos ); @@ -180,6 +194,12 @@ private: BOOL bFilterButton; // not passed to DataPilotSource BOOL bDrillDown; // not passed to DataPilotSource + /** if true, all dimensions already have all of their member instances + * created. */ + bool mbDimensionMembersBuilt; + + ::std::auto_ptr mpGrandTotalName; + public: SC_DLLPUBLIC ScDPSaveData(); ScDPSaveData(const ScDPSaveData& r); @@ -189,21 +209,26 @@ public: BOOL operator== ( const ScDPSaveData& r ) const; + SC_DLLPUBLIC void SetGrandTotalName(const ::rtl::OUString& rName); + SC_DLLPUBLIC const ::rtl::OUString* GetGrandTotalName() const; + const List& GetDimensions() const { return aDimList; } void AddDimension(ScDPSaveDimension* pDim) { aDimList.Insert(pDim, LIST_APPEND); } ScDPSaveDimension* GetDimensionByName(const String& rName); SC_DLLPUBLIC ScDPSaveDimension* GetDataLayoutDimension(); + SC_DLLPUBLIC ScDPSaveDimension* GetExistingDataLayoutDimension() const; ScDPSaveDimension* DuplicateDimension(const String& rName); SC_DLLPUBLIC ScDPSaveDimension& DuplicateDimension(const ScDPSaveDimension& rDim); - SC_DLLPUBLIC ScDPSaveDimension* GetExistingDimensionByName(const String& rName); + SC_DLLPUBLIC ScDPSaveDimension* GetExistingDimensionByName(const String& rName) const; SC_DLLPUBLIC ScDPSaveDimension* GetNewDimensionByName(const String& rName); void RemoveDimensionByName(const String& rName); ScDPSaveDimension* GetInnermostDimension(USHORT nOrientation); + ScDPSaveDimension* GetFirstDimension(::com::sun::star::sheet::DataPilotFieldOrientation eOrientation); long GetDataDimensionCount() const; @@ -230,6 +255,7 @@ public: const ScDPDimensionSaveData* GetExistingDimensionData() const { return pDimensionData; } SC_DLLPUBLIC ScDPDimensionSaveData* GetDimensionData(); // create if not there void SetDimensionData( const ScDPDimensionSaveData* pNew ); // copied + void BuildAllDimensionMembers(ScDPTableData* pData); }; diff --git a/sc/inc/dptabres.hxx b/sc/inc/dptabres.hxx index 6dfb782b2313..670c5eb566a4 100644 --- a/sc/inc/dptabres.hxx +++ b/sc/inc/dptabres.hxx @@ -41,6 +41,7 @@ #include #include #include +#include namespace com { namespace sun { namespace star { namespace sheet { struct DataPilotFieldReference; @@ -262,7 +263,7 @@ public: long GetMeasureCount() const { return nMeasCount; } ScSubTotalFunc GetMeasureFunction(long nMeasure) const; - String GetMeasureString(long nMeasure, BOOL bForce, ScSubTotalFunc eForceFunc) const; + String GetMeasureString(long nMeasure, BOOL bForce, ScSubTotalFunc eForceFunc, bool& rbTotalResult) const; String GetMeasureDimensionName(long nMeasure) const; const ::com::sun::star::sheet::DataPilotFieldReference& GetMeasureRefVal(long nMeasure) const; USHORT GetMeasureRefOrient(long nMeasure) const; @@ -284,6 +285,8 @@ public: const ScDPItemData& rBaseData, long nBaseIndex ) const; BOOL HasCommonElement( const ScDPItemData& rFirstData, long nFirstIndex, const ScDPItemData& rSecondData, long nSecondIndex ) const; + + const ScDPSource* GetSource() const; }; diff --git a/sc/inc/dptabsrc.hxx b/sc/inc/dptabsrc.hxx index 59996d08b8aa..5538959b2dfc 100644 --- a/sc/inc/dptabsrc.hxx +++ b/sc/inc/dptabsrc.hxx @@ -33,6 +33,7 @@ #include #include +#include #include #include #include "global.hxx" // enum ScSubTotalFunc @@ -108,7 +109,7 @@ class ScDPSource : public cppu::WeakImplHelper6< com::sun::star::lang::XServiceInfo > { private: - ScDPTableData* pData; // data source + ScDPTableData* pData; // data source (ScDPObject manages its life time) ScDPDimensions* pDimensions; // api objects // settings: long nColDims[SC_DAPI_MAXFIELDS]; @@ -136,6 +137,8 @@ private: List aRowLevelList; BOOL bResultOverflow; + ::std::auto_ptr mpGrandTotalName; + void CreateRes_Impl(); void FillMemberResults(); void FillLevelList( USHORT nOrientation, List& rList ); @@ -162,11 +165,15 @@ public: ScDPTableData* GetData() { return pData; } const ScDPTableData* GetData() const { return pData; } + void SetGrandTotalName(const ::rtl::OUString& rName); + const ::rtl::OUString* GetGrandTotalName() const; + USHORT GetOrientation(long nColumn); void SetOrientation(long nColumn, USHORT nNew); long GetPosition(long nColumn); long GetDataDimensionCount(); + ScDPDimension* GetDataDimension(long nIndex); String GetDataDimName(long nIndex); BOOL IsDataLayoutDimension(long nDim); USHORT GetDataLayoutOrientation(); @@ -333,6 +340,8 @@ private: long nUsedHier; USHORT nFunction; // enum GeneralFunction String aName; // if empty, take from source + ::std::auto_ptr mpLayoutName; + ::std::auto_ptr mpSubtotalName; long nSourceDim; // >=0 if dup'ed ::com::sun::star::sheet::DataPilotFieldReference aReferenceValue; // settings for "show data as" / "displayed value" @@ -350,6 +359,9 @@ public: ScDPDimension* CreateCloneObject(); ScDPHierarchies* GetHierarchiesObject(); + SC_DLLPUBLIC const ::rtl::OUString* GetLayoutName() const; + const ::rtl::OUString* GetSubtotalName() const; + // XNamed virtual ::rtl::OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException); virtual void SAL_CALL setName( const ::rtl::OUString& aName ) @@ -736,7 +748,7 @@ private: long nLev; ScDPItemData maData; -// String aCaption; // visible name (changeable by user) + ::std::auto_ptr mpLayoutName; sal_Int32 nPosition; // manual sorting BOOL bVisible; @@ -750,6 +762,7 @@ public: BOOL IsNamedItem( const ScDPItemData& r ) const; String GetNameStr() const; void FillItemData( ScDPItemData& rData ) const; + SC_DLLPUBLIC const ::rtl::OUString* GetLayoutName() const; sal_Int32 Compare( const ScDPMember& rOther ) const; // visible order diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx index 367e7d7cfe35..bfc5aa9de831 100644 --- a/sc/inc/unonames.hxx +++ b/sc/inc/unonames.hxx @@ -558,6 +558,9 @@ #define SC_UNO_ROWFIELDCOUNT "RowFieldCount" #define SC_UNO_COLUMNFIELDCOUNT "ColumnFieldCount" #define SC_UNO_DATAFIELDCOUNT "DataFieldCount" +#define SC_UNO_LAYOUTNAME "LayoutName" +#define SC_UNO_FIELD_SUBTOTALNAME "FieldSubtotalName" +#define SC_UNO_GRANDTOTAL_NAME "GrandTotalName" // (preliminary:) #define SC_UNO_REFVALUE "ReferenceValue" diff --git a/sc/source/core/data/dpgroup.cxx b/sc/source/core/data/dpgroup.cxx index a92d1681ec0e..037a232bbd2a 100644 --- a/sc/source/core/data/dpgroup.cxx +++ b/sc/source/core/data/dpgroup.cxx @@ -70,6 +70,7 @@ using ::rtl::OUStringHash; using ::std::vector; using ::std::hash_set; using ::std::hash_map; +using ::boost::shared_ptr; #define D_TIMEFACTOR 86400.0 @@ -977,7 +978,7 @@ String lcl_GetNumGroupForValue( double fValue, const ScDPNumGroupInfo& rInfo, bo return lcl_GetNumGroupName( fGroupStart, rInfo, bHasNonInteger, cDecSeparator, pFormatter ); } -ScDPGroupTableData::ScDPGroupTableData( ScDPTableData* pSource, ScDocument* pDocument ) : +ScDPGroupTableData::ScDPGroupTableData( const shared_ptr& pSource, ScDocument* pDocument ) : ScDPTableData(pDocument), pSourceData( pSource ), pDoc( pDocument ) @@ -992,7 +993,6 @@ ScDPGroupTableData::ScDPGroupTableData( ScDPTableData* pSource, ScDocument* pDoc ScDPGroupTableData::~ScDPGroupTableData() { delete[] pNumGroups; - delete pSourceData; } void ScDPGroupTableData::AddGroupDimension( const ScDPGroupDimension& rGroup ) diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index fa58a8b3c277..cd7d58964a96 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -78,6 +78,7 @@ using namespace com::sun::star; using ::std::vector; +using ::boost::shared_ptr; using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::UNO_QUERY; @@ -162,6 +163,7 @@ ScDPObject::ScDPObject( ScDocument* pD ) : pSheetDesc( NULL ), pImpDesc( NULL ), pServDesc( NULL ), + mpTableData(static_cast(NULL)), pOutput( NULL ), bSettingsChanged( FALSE ), bAlive( FALSE ), @@ -182,6 +184,7 @@ ScDPObject::ScDPObject(const ScDPObject& r) : pSheetDesc( NULL ), pImpDesc( NULL ), pServDesc( NULL ), + mpTableData(static_cast(NULL)), pOutput( NULL ), bSettingsChanged( FALSE ), bAlive( FALSE ), @@ -349,6 +352,22 @@ void ScDPObject::SetTag(const String& rNew) aTableTag = rNew; } +bool ScDPObject::IsDataDescriptionCell(const ScAddress& rPos) +{ + if (!pSaveData) + return false; + + long nDataDimCount = pSaveData->GetDataDimensionCount(); + if (nDataDimCount != 1) + // There has to be exactly one data dimension for the description to + // appear at top-left corner. + return false; + + CreateOutput(); + ScRange aTabRange = pOutput->GetOutputRange(sheet::DataPilotOutputRangeType::TABLE); + return (rPos == aTabRange.aStart); +} + uno::Reference ScDPObject::GetSource() { CreateObjects(); @@ -390,11 +409,43 @@ void ScDPObject::CreateOutput() } } +ScDPTableData* ScDPObject::GetTableData() +{ + if (!mpTableData) + { + if ( pImpDesc ) + { + // database data + mpTableData.reset(new ScDatabaseDPData(pDoc, *pImpDesc)); + } + else + { + // cell data + if (!pSheetDesc) + { + DBG_ERROR("no source descriptor"); + pSheetDesc = new ScSheetSourceDesc; // dummy defaults + } + mpTableData.reset(new ScSheetDPData(pDoc, *pSheetDesc)); + } + + // grouping (for cell or database data) + if ( pSaveData && pSaveData->GetExistingDimensionData() ) + { + shared_ptr pGroupData(new ScDPGroupTableData(mpTableData, pDoc)); + pSaveData->GetExistingDimensionData()->WriteToData(*pGroupData); + mpTableData = pGroupData; + } + } + + return mpTableData.get(); +} + void ScDPObject::CreateObjects() { // if groups are involved, create a new source with the ScDPGroupTableData if ( bSettingsChanged && pSaveData && pSaveData->GetExistingDimensionData() ) - xSource = NULL; + InvalidateSource(); if (!xSource.is()) { @@ -412,33 +463,9 @@ void ScDPObject::CreateObjects() if ( !xSource.is() ) // database or sheet data, or error in CreateSource { DBG_ASSERT( !pServDesc, "DPSource could not be created" ); - - ScDPTableData* pData = NULL; - if ( pImpDesc ) - { - // database data - pData = new ScDatabaseDPData( pDoc, *pImpDesc ); - } - else - { - // cell data - if (!pSheetDesc) - { - DBG_ERROR("no source descriptor"); - pSheetDesc = new ScSheetSourceDesc; // dummy defaults - } - pData = new ScSheetDPData( pDoc, *pSheetDesc ); - } - - // grouping (for cell or database data) - if ( pSaveData && pSaveData->GetExistingDimensionData() ) - { - ScDPGroupTableData* pGroupData = new ScDPGroupTableData( pData, pDoc ); - pSaveData->GetExistingDimensionData()->WriteToData( *pGroupData ); - pData = pGroupData; - } - - xSource = new ScDPSource( pData ); + ScDPTableData* pData = GetTableData(); + ScDPSource* pSource = new ScDPSource( pData ); + xSource = pSource; } if (pSaveData) @@ -475,6 +502,7 @@ void ScDPObject::InvalidateData() void ScDPObject::InvalidateSource() { xSource = NULL; + mpTableData.reset(); } ScRange ScDPObject::GetNewOutputRange( BOOL& rOverflow ) @@ -556,6 +584,14 @@ void ScDPObject::RefreshAfterLoad() nHeaderRows = 0; // nothing found, no drop-down lists } +void ScDPObject::BuildAllDimensionMembers() +{ + if (!pSaveData) + return; + + pSaveData->BuildAllDimensionMembers(GetTableData()); +} + void ScDPObject::UpdateReference( UpdateRefMode eUpdateRefMode, const ScRange& rRange, SCsCOL nDx, SCsROW nDy, SCsTAB nDz ) { @@ -678,23 +714,33 @@ void ScDPObject::GetDrillDownData(const ScAddress& rPos, Sequence< Sequence rTableData = xDrillDownData->getDrillDownData(filters); } -BOOL ScDPObject::IsDimNameInUse( const String& rName ) const +bool ScDPObject::IsDimNameInUse(const OUString& rName) const { - if ( xSource.is() ) + if (!xSource.is()) + return false; + + Reference xDims = xSource->getDimensions(); + Sequence aDimNames = xDims->getElementNames(); + sal_Int32 n = aDimNames.getLength(); + for (sal_Int32 i = 0; i < n; ++i) { - uno::Reference xDimsName = xSource->getDimensions(); - if ( xDimsName.is() ) + const OUString& rDimName = aDimNames[i]; + if (rDimName.equalsIgnoreAsciiCase(rName)) + return true; + + Reference xPropSet(xDims->getByName(rDimName), UNO_QUERY); + if (!xPropSet.is()) + continue; + + Any any = xPropSet->getPropertyValue(OUString::createFromAscii(SC_UNO_LAYOUTNAME)); + OUString aLayoutName; + if (any >>= aLayoutName) { - rtl::OUString aCompare( rName ); - uno::Sequence aNames = xDimsName->getElementNames(); - long nCount = aNames.getLength(); - const rtl::OUString* pArr = aNames.getConstArray(); - for (long nPos=0; nPos aResult; - String aCaption; + String maName; /// Name is the internal field name. + String aCaption; /// Caption is the name visible in the output table. ScDPOutLevelData() { nDim = nHier = nLevel = nDimPos = -1; } @@ -444,7 +445,15 @@ ScDPOutput::ScDPOutput( ScDocument* pD, const uno::ReferencegetName()); //! Caption... + String aName = xLevNam->getName(); + OUString aCaption = aName; // Caption equals the field name by default. + Reference xPropSet(xLevel, UNO_QUERY); + if (xPropSet.is()) + { + Any any = xPropSet->getPropertyValue( + OUString::createFromAscii(SC_UNO_LAYOUTNAME)); + any >>= aCaption; + } switch ( eDimOrient ) { case sheet::DataPilotFieldOrientation_COLUMN: @@ -453,6 +462,7 @@ ScDPOutput::ScDPOutput( ScDocument* pD, const uno::ReferencegetResults(); + pColFields[nColFieldCount].maName = aName; pColFields[nColFieldCount].aCaption= aCaption; if (!lcl_MemberEmpty(pColFields[nColFieldCount].aResult)) ++nColFieldCount; @@ -463,6 +473,7 @@ ScDPOutput::ScDPOutput( ScDocument* pD, const uno::ReferencegetResults(); + pRowFields[nRowFieldCount].maName = aName; pRowFields[nRowFieldCount].aCaption= aCaption; if (!lcl_MemberEmpty(pRowFields[nRowFieldCount].aResult)) ++nRowFieldCount; @@ -473,6 +484,7 @@ ScDPOutput::ScDPOutput( ScDocument* pD, const uno::ReferencegetPropertyValue( - rtl::OUString::createFromAscii(DP_PROP_DATADESCR) ); + rtl::OUString::createFromAscii(SC_UNO_DATADESC) ); rtl::OUString aUStr; aAny >>= aUStr; aDataDescription = String( aUStr ); @@ -606,9 +618,16 @@ void ScDPOutput::HeaderCell( SCCOL nCol, SCROW nRow, SCTAB nTab, const sheet::MemberResult& rData, BOOL bColHeader, long nLevel ) { long nFlags = rData.Flags; + + rtl::OUStringBuffer aCaptionBuf; + if (!(nFlags & sheet::MemberResultFlags::NUMERIC)) + // This caption is not a number. Make sure it won't get parsed as one. + aCaptionBuf.append(sal_Unicode('\'')); + aCaptionBuf.append(rData.Caption); + if ( nFlags & sheet::MemberResultFlags::HASMEMBER ) { - pDoc->SetString( nCol, nRow, nTab, rData.Caption ); + pDoc->SetString( nCol, nRow, nTab, aCaptionBuf.makeStringAndClear() ); } else { @@ -1161,7 +1180,7 @@ bool ScDPOutput::GetDataResultPositionData(vector& for (SCCOL nColField = 0; nColField < nColFieldCount && bFilterByCol; ++nColField) { sheet::DataPilotFieldFilter filter; - filter.FieldName = pColFields[nColField].aCaption; + filter.FieldName = pColFields[nColField].maName; const uno::Sequence rSequence = pColFields[nColField].aResult; const sheet::MemberResult* pArray = rSequence.getConstArray(); @@ -1178,10 +1197,15 @@ bool ScDPOutput::GetDataResultPositionData(vector& } // row fields + bool bDataLayoutExists = (nDataFieldCount > 1); for (SCROW nRowField = 0; nRowField < nRowFieldCount && bFilterByRow; ++nRowField) { + if (bDataLayoutExists && nRowField == nRowFieldCount - 1) + // There is no sense including the data layout field for filtering. + continue; + sheet::DataPilotFieldFilter filter; - filter.FieldName = pRowFields[nRowField].aCaption; + filter.FieldName = pRowFields[nRowField].maName; const uno::Sequence rSequence = pRowFields[nRowField].aResult; const sheet::MemberResult* pArray = rSequence.getConstArray(); @@ -1213,8 +1237,7 @@ bool lcl_IsNamedDataField( const ScDPGetPivotDataField& rTarget, const String& r bool lcl_IsNamedCategoryField( const ScDPGetPivotDataField& rFilter, const ScDPOutLevelData& rField ) { - //! name from source instead of caption? - return ScGlobal::pTransliteration->isEqual( rFilter.maFieldName, rField.aCaption ); + return ScGlobal::pTransliteration->isEqual( rFilter.maFieldName, rField.maName ); } bool lcl_IsCondition( const sheet::MemberResult& rResultEntry, const ScDPGetPivotDataField& rFilter ) diff --git a/sc/source/core/data/dpsave.cxx b/sc/source/core/data/dpsave.cxx index f4180312ce0d..ba1acc97a83a 100644 --- a/sc/source/core/data/dpsave.cxx +++ b/sc/source/core/data/dpsave.cxx @@ -58,7 +58,12 @@ #include #include +#include + using namespace com::sun::star; +using ::rtl::OUString; +using ::std::hash_map; +using ::std::auto_ptr; // ----------------------------------------------------------------------- @@ -113,6 +118,7 @@ void lcl_SkipExtra( SvStream& rStream ) ScDPSaveMember::ScDPSaveMember(const String& rName) : aName( rName ), + mpLayoutName(NULL), nVisibleMode( SC_DPSAVEMODE_DONTKNOW ), nShowDetailsMode( SC_DPSAVEMODE_DONTKNOW ) { @@ -120,9 +126,12 @@ ScDPSaveMember::ScDPSaveMember(const String& rName) : ScDPSaveMember::ScDPSaveMember(const ScDPSaveMember& r) : aName( r.aName ), + mpLayoutName(NULL), nVisibleMode( r.nVisibleMode ), nShowDetailsMode( r.nShowDetailsMode ) { + if (r.mpLayoutName.get()) + mpLayoutName.reset(new OUString(*r.mpLayoutName)); } ScDPSaveMember::~ScDPSaveMember() @@ -167,6 +176,21 @@ void ScDPSaveMember::SetName( const String& rNew ) aName = rNew; } +void ScDPSaveMember::SetLayoutName( const OUString& rName ) +{ + mpLayoutName.reset(new OUString(rName)); +} + +const OUString* ScDPSaveMember::GetLayoutName() const +{ + return mpLayoutName.get(); +} + +void ScDPSaveMember::RemoveLayoutName() +{ + mpLayoutName.reset(NULL); +} + void ScDPSaveMember::WriteToSource( const uno::Reference& xMember, sal_Int32 nPosition ) { // nothing to do? @@ -187,6 +211,18 @@ void ScDPSaveMember::WriteToSource( const uno::Reference& xMemb lcl_SetBoolProperty( xMembProp, rtl::OUString::createFromAscii(DP_PROP_SHOWDETAILS), (BOOL)nShowDetailsMode ); + if (mpLayoutName.get()) + { + try + { + uno::Any any; + any <<= rtl::OUString(*mpLayoutName); + xMembProp->setPropertyValue(rtl::OUString::createFromAscii(SC_UNO_LAYOUTNAME), any); + } + catch (uno::Exception&) + { + } + } if ( nPosition >= 0 ) { try @@ -205,8 +241,9 @@ void ScDPSaveMember::WriteToSource( const uno::Reference& xMemb ScDPSaveDimension::ScDPSaveDimension(const String& rName, BOOL bDataLayout) : aName( rName ), - pLayoutName( NULL ), pSelectedPage( NULL ), + mpLayoutName(NULL), + mpSubtotalName(NULL), bIsDataLayout( bDataLayout ), bDupFlag( FALSE ), nOrientation( sheet::DataPilotFieldOrientation_HIDDEN ), @@ -225,6 +262,8 @@ ScDPSaveDimension::ScDPSaveDimension(const String& rName, BOOL bDataLayout) : ScDPSaveDimension::ScDPSaveDimension(const ScDPSaveDimension& r) : aName( r.aName ), + mpLayoutName(NULL), + mpSubtotalName(NULL), bIsDataLayout( r.bIsDataLayout ), bDupFlag( r.bDupFlag ), nOrientation( r.nOrientation ), @@ -265,14 +304,14 @@ ScDPSaveDimension::ScDPSaveDimension(const ScDPSaveDimension& r) : pLayoutInfo = new sheet::DataPilotFieldLayoutInfo( *(r.pLayoutInfo) ); else pLayoutInfo = NULL; - if (r.pLayoutName) - pLayoutName = new String( *(r.pLayoutName) ); - else - pLayoutName = NULL; if (r.pSelectedPage) pSelectedPage = new String( *(r.pSelectedPage) ); else pSelectedPage = NULL; + if (r.mpLayoutName.get()) + mpLayoutName.reset(new OUString(*r.mpLayoutName)); + if (r.mpSubtotalName.get()) + mpSubtotalName.reset(new OUString(*r.mpSubtotalName)); } ScDPSaveDimension::~ScDPSaveDimension() @@ -283,7 +322,6 @@ ScDPSaveDimension::~ScDPSaveDimension() delete pSortInfo; delete pAutoShowInfo; delete pLayoutInfo; - delete pLayoutName; delete pSelectedPage; delete [] pSubTotalFuncs; } @@ -395,25 +433,45 @@ void ScDPSaveDimension::SetUsedHierarchy(long nNew) nUsedHierarchy = nNew; } -BOOL ScDPSaveDimension::HasLayoutName() const +void ScDPSaveDimension::SetSubtotalName(const OUString& rName) { - return ( pLayoutName != NULL ); + mpSubtotalName.reset(new OUString(rName)); } -void ScDPSaveDimension::SetLayoutName(const String* pName) +const OUString* ScDPSaveDimension::GetSubtotalName() const { - delete pLayoutName; - if (pName) - pLayoutName = new String( *pName ); - else - pLayoutName = NULL; + return mpSubtotalName.get(); +} + +bool ScDPSaveDimension::IsMemberNameInUse(const OUString& rName) const +{ + MemberList::const_iterator itr = maMemberList.begin(), itrEnd = maMemberList.end(); + for (; itr != itrEnd; ++itr) + { + const ScDPSaveMember* pMem = *itr; + if (rName.equalsIgnoreAsciiCase(pMem->GetName())) + return true; + + const OUString* pLayoutName = pMem->GetLayoutName(); + if (pLayoutName && rName.equalsIgnoreAsciiCase(*pLayoutName)) + return true; + } + return false; +} + +void ScDPSaveDimension::SetLayoutName(const OUString& rName) +{ + mpLayoutName.reset(new OUString(rName)); } -const String& ScDPSaveDimension::GetLayoutName() const +const OUString* ScDPSaveDimension::GetLayoutName() const { - if (pLayoutName) - return *pLayoutName; - return aName; + return mpLayoutName.get(); +} + +void ScDPSaveDimension::RemoveLayoutName() +{ + mpLayoutName.reset(NULL); } void ScDPSaveDimension::SetReferenceValue(const sheet::DataPilotFieldReference* pNew) @@ -549,6 +607,19 @@ void ScDPSaveDimension::WriteToSource( const uno::Reference& xD { aAny <<= aFilter; xDimProp->setPropertyValue( rtl::OUString::createFromAscii(DP_PROP_FILTER), aAny ); + if (mpLayoutName.get()) + { + aAny <<= *mpLayoutName; + xDimProp->setPropertyValue(rtl::OUString::createFromAscii(SC_UNO_LAYOUTNAME), aAny); + } + + const OUString* pSubTotalName = GetSubtotalName(); + if (pSubTotalName) + { + // Custom subtotal name, with '?' being replaced by the visible field name later. + aAny <<= *pSubTotalName; + xDimProp->setPropertyValue(OUString::createFromAscii(SC_UNO_FIELD_SUBTOTALNAME), aAny); + } } catch ( beans::UnknownPropertyException& ) { @@ -691,7 +762,9 @@ ScDPSaveData::ScDPSaveData() : nIgnoreEmptyMode( SC_DPSAVEMODE_DONTKNOW ), nRepeatEmptyMode( SC_DPSAVEMODE_DONTKNOW ), bFilterButton( TRUE ), - bDrillDown( TRUE ) + bDrillDown( TRUE ), + mbDimensionMembersBuilt(false), + mpGrandTotalName(NULL) { } @@ -701,7 +774,9 @@ ScDPSaveData::ScDPSaveData(const ScDPSaveData& r) : nIgnoreEmptyMode( r.nIgnoreEmptyMode ), nRepeatEmptyMode( r.nRepeatEmptyMode ), bFilterButton( r.bFilterButton ), - bDrillDown( r.bDrillDown ) + bDrillDown( r.bDrillDown ), + mbDimensionMembersBuilt(r.mbDimensionMembersBuilt), + mpGrandTotalName(NULL) { if ( r.pDimensionData ) pDimensionData = new ScDPDimensionSaveData( *r.pDimensionData ); @@ -714,6 +789,9 @@ ScDPSaveData::ScDPSaveData(const ScDPSaveData& r) : ScDPSaveDimension* pNew = new ScDPSaveDimension( *(ScDPSaveDimension*)r.aDimList.GetObject(i) ); aDimList.Insert( pNew, LIST_APPEND ); } + + if (r.mpGrandTotalName.get()) + mpGrandTotalName.reset(new OUString(*r.mpGrandTotalName)); } ScDPSaveData& ScDPSaveData::operator= ( const ScDPSaveData& r ) @@ -732,6 +810,7 @@ ScDPSaveData& ScDPSaveData::operator= ( const ScDPSaveData& r ) nRepeatEmptyMode = r.nRepeatEmptyMode; bFilterButton = r.bFilterButton; bDrillDown = r.bDrillDown; + mbDimensionMembersBuilt = r.mbDimensionMembersBuilt; // remove old dimensions @@ -750,6 +829,9 @@ ScDPSaveData& ScDPSaveData::operator= ( const ScDPSaveData& r ) new ScDPSaveDimension( *(ScDPSaveDimension*)r.aDimList.GetObject(i) ); aDimList.Insert( pNew, LIST_APPEND ); } + + if (r.mpGrandTotalName.get()) + mpGrandTotalName.reset(new OUString(*r.mpGrandTotalName)); } return *this; } @@ -761,7 +843,8 @@ BOOL ScDPSaveData::operator== ( const ScDPSaveData& r ) const nIgnoreEmptyMode != r.nIgnoreEmptyMode || nRepeatEmptyMode != r.nRepeatEmptyMode || bFilterButton != r.bFilterButton || - bDrillDown != r.bDrillDown ) + bDrillDown != r.bDrillDown || + mbDimensionMembersBuilt != r.mbDimensionMembersBuilt) return FALSE; if ( pDimensionData || r.pDimensionData ) @@ -777,6 +860,16 @@ BOOL ScDPSaveData::operator== ( const ScDPSaveData& r ) const *(ScDPSaveDimension*)r.aDimList.GetObject(i) ) ) return FALSE; + if (mpGrandTotalName.get()) + { + if (!r.mpGrandTotalName.get()) + return false; + if (!mpGrandTotalName->equals(*r.mpGrandTotalName)) + return false; + } + else if (r.mpGrandTotalName.get()) + return false; + return TRUE; } @@ -790,6 +883,16 @@ ScDPSaveData::~ScDPSaveData() delete pDimensionData; } +void ScDPSaveData::SetGrandTotalName(const OUString& rName) +{ + mpGrandTotalName.reset(new OUString(rName)); +} + +const OUString* ScDPSaveData::GetGrandTotalName() const +{ + return mpGrandTotalName.get(); +} + ScDPSaveDimension* ScDPSaveData::GetDimensionByName(const String& rName) { long nCount = aDimList.Count(); @@ -804,7 +907,7 @@ ScDPSaveDimension* ScDPSaveData::GetDimensionByName(const String& rName) return pNew; } -ScDPSaveDimension* ScDPSaveData::GetExistingDimensionByName(const String& rName) +ScDPSaveDimension* ScDPSaveData::GetExistingDimensionByName(const String& rName) const { long nCount = aDimList.Count(); for (long i=0; iIsDataLayout() ) return pDim; } - ScDPSaveDimension* pNew = new ScDPSaveDimension( String(), TRUE ); - aDimList.Insert( pNew, LIST_APPEND ); - return pNew; + return NULL; } ScDPSaveDimension* ScDPSaveData::DuplicateDimension(const String& rName) @@ -895,6 +1007,18 @@ ScDPSaveDimension* ScDPSaveData::GetInnermostDimension(USHORT nOrientation) return pInner; // the last matching one } +ScDPSaveDimension* ScDPSaveData::GetFirstDimension(sheet::DataPilotFieldOrientation eOrientation) +{ + long nCount = aDimList.Count(); + for (long i = 0; i < nCount; ++i) + { + ScDPSaveDimension* pDim = static_cast(aDimList.GetObject(i)); + if (pDim->GetOrientation() == eOrientation && !pDim->IsDataLayout()) + return pDim; + } + return NULL; +} + long ScDPSaveData::GetDataDimensionCount() const { long nDataCount = 0; @@ -1002,6 +1126,14 @@ void ScDPSaveData::WriteToSource( const uno::ReferencesetPropertyValue(OUString::createFromAscii(SC_UNO_GRANDTOTAL_NAME), any); + } } catch(uno::Exception&) { @@ -1125,3 +1257,50 @@ void ScDPSaveData::SetDimensionData( const ScDPDimensionSaveData* pNew ) pDimensionData = NULL; } +void ScDPSaveData::BuildAllDimensionMembers(ScDPTableData* pData) +{ + if (mbDimensionMembersBuilt) + return; + + // First, build a dimension name-to-index map. + typedef hash_map NameIndexMap; + NameIndexMap aMap; + long nColCount = pData->GetColumnCount(); + for (long i = 0; i < nColCount; ++i) + aMap.insert( NameIndexMap::value_type(pData->getDimensionName(i), i)); + + NameIndexMap::const_iterator itrEnd = aMap.end(); + + sal_uInt32 n = aDimList.Count(); + for (sal_uInt32 i = 0; i < n; ++i) + { + ScDPSaveDimension* pDim = static_cast(aDimList.GetObject(i)); + const String& rDimName = pDim->GetName(); + if (!rDimName.Len()) + // empty dimension name. It must be data layout. + continue; + + NameIndexMap::const_iterator itr = aMap.find(rDimName); + if (itr == itrEnd) + // dimension name not in the data. This should never happen! + continue; + + long nDimIndex = itr->second; + const TypedScStrCollection& rMembers = pData->GetColumnEntries(nDimIndex); + sal_uInt16 nMemberCount = rMembers.GetCount(); + for (sal_uInt16 j = 0; j < nMemberCount; ++j) + { + const String& rMemName = rMembers[j]->GetString(); + if (pDim->GetExistingMemberByName(rMemName)) + // this member instance already exists. nothing to do. + continue; + + auto_ptr pNewMember(new ScDPSaveMember(rMemName)); + pNewMember->SetIsVisible(true); + pDim->AddMember(pNewMember.release()); + } + } + + mbDimensionMembersBuilt = true; +} + diff --git a/sc/source/core/data/dptabres.cxx b/sc/source/core/data/dptabres.cxx index 398d4d1c7e01..07a783bdb2b1 100644 --- a/sc/source/core/data/dptabres.cxx +++ b/sc/source/core/data/dptabres.cxx @@ -67,6 +67,7 @@ using ::std::vector; using ::std::pair; using ::std::hash_map; using ::com::sun::star::uno::Sequence; +using ::rtl::OUString; // ----------------------------------------------------------------------- @@ -825,11 +826,11 @@ USHORT ScDPResultData::GetMeasureRefOrient(long nMeasure) const return pMeasRefOrient[nMeasure]; } -String ScDPResultData::GetMeasureString(long nMeasure, BOOL bForce, ScSubTotalFunc eForceFunc) const +String ScDPResultData::GetMeasureString(long nMeasure, BOOL bForce, ScSubTotalFunc eForceFunc, bool& rbTotalResult) const { // with bForce==TRUE, return function instead of "result" for single measure // with eForceFunc != SUBTOTAL_FUNC_NONE, always use eForceFunc - + rbTotalResult = false; if ( nMeasure < 0 || ( nMeasCount == 1 && !bForce && eForceFunc == SUBTOTAL_FUNC_NONE ) ) { // for user-specified subtotal function with all measures, @@ -837,12 +838,19 @@ String ScDPResultData::GetMeasureString(long nMeasure, BOOL bForce, ScSubTotalFu if ( eForceFunc != SUBTOTAL_FUNC_NONE ) return ScGlobal::GetRscString(nFuncStrIds[eForceFunc]); + rbTotalResult = true; return ScGlobal::GetRscString(STR_TABLE_ERGEBNIS); } else { DBG_ASSERT( pMeasNames && nMeasure < nMeasCount, "bumm" ); - + ScDPDimension* pDataDim = pSource->GetDataDimension(nMeasure); + if (pDataDim) + { + const OUString* pLayoutName = pDataDim->GetLayoutName(); + if (pLayoutName) + return *pLayoutName; + } String aRet; ScSubTotalFunc eFunc = ( eForceFunc == SUBTOTAL_FUNC_NONE ) ? GetMeasureFunction(nMeasure) : eForceFunc; @@ -896,6 +904,11 @@ BOOL ScDPResultData::HasCommonElement( const ScDPItemData& rFirstData, long nFir return pSource->GetData()->HasCommonElement( rFirstData, nFirstIndex, rSecondData, nSecondIndex ); } +const ScDPSource* ScDPResultData::GetSource() const +{ + return pSource; +} + // ----------------------------------------------------------------------- @@ -1172,6 +1185,25 @@ void ScDPResultMember::ProcessData( const vector& aChildMembers, c } } +/** + * Parse subtotal string and replace all occurrences of '?' with the + * caption string. + */ +static String lcl_parseSubtotalName(const String& rSubStr, const String& rCaption) +{ + String aNewStr; + xub_StrLen n = rSubStr.Len(); + for (xub_StrLen i = 0; i < n; ++i) + { + sal_Unicode c = rSubStr.GetChar(i); + if (c == sal_Unicode('?')) + aNewStr.Append(rCaption); + else + aNewStr.Append(c); + } + return aNewStr; +} + void ScDPResultMember::FillMemberResults( uno::Sequence* pSequences, long& rPos, long nMeasure, BOOL bRoot, const String* pMemberName, @@ -1204,17 +1236,25 @@ void ScDPResultMember::FillMemberResults( uno::Sequence* pS } String aCaption = aName; + if (pMemberDesc) + { + const OUString* pLayoutName = pMemberDesc->GetLayoutName(); + if (pLayoutName) + { + aCaption = *pLayoutName; + bIsNumeric = false; // layout name is always non-numeric. + } + } + if ( pMemberCaption ) // use pMemberCaption if != NULL aCaption = *pMemberCaption; if (!aCaption.Len()) aCaption = ScGlobal::GetRscString(STR_EMPTYDATA); - if ( !bIsNumeric ) - { - // add a "'" character so a string isn't parsed as value in the output cell - //! have a separate bit in Flags (MemberResultFlags) instead? - aCaption.Insert( (sal_Unicode) '\'', 0 ); - } + if (bIsNumeric) + pArray[rPos].Flags |= sheet::MemberResultFlags::NUMERIC; + else + pArray[rPos].Flags &= ~sheet::MemberResultFlags::NUMERIC; if ( nSize && !bRoot ) // root is overwritten by first dimension { @@ -1277,9 +1317,30 @@ void ScDPResultMember::FillMemberResults( uno::Sequence* pS if (bHasChild) eForce = lcl_GetForceFunc( pParentLevel, nUserPos ); - String aSubStr = aName; //! caption? + bool bTotalResult = false; + String aSubStr = aCaption; aSubStr += ' '; - aSubStr += pResultData->GetMeasureString(nMemberMeasure, FALSE, eForce); + aSubStr += pResultData->GetMeasureString(nMemberMeasure, FALSE, eForce, bTotalResult); + + if (bTotalResult) + { + if (pMemberDesc) + { + // single data field layout. + const OUString* pSubtotalName = pParentDim->GetSubtotalName(); + if (pSubtotalName) + aSubStr = lcl_parseSubtotalName(*pSubtotalName, aCaption); + pArray[rPos].Flags &= ~sheet::MemberResultFlags::GRANDTOTAL; + } + else + { + // root member - subtotal (grand total?) for multi-data field layout. + const rtl::OUString* pGrandTotalName = pResultData->GetSource()->GetGrandTotalName(); + if (pGrandTotalName) + aSubStr = *pGrandTotalName; + pArray[rPos].Flags |= sheet::MemberResultFlags::GRANDTOTAL; + } + } pArray[rPos].Name = rtl::OUString(aName); pArray[rPos].Caption = rtl::OUString(aSubStr); @@ -2796,8 +2857,9 @@ void ScDPResultDimension::FillMemberResults( uno::Sequence* // in data layout dimension, use first member with different measures/names if ( bIsDataLayout ) { + bool bTotalResult = false; String aMbrName = pResultData->GetMeasureDimensionName( nSorted ); - String aMbrCapt = pResultData->GetMeasureString( nSorted, FALSE, SUBTOTAL_FUNC_NONE ); + String aMbrCapt = pResultData->GetMeasureString( nSorted, FALSE, SUBTOTAL_FUNC_NONE, bTotalResult ); maMemberArray[0]->FillMemberResults( pSequences, nPos, nSorted, FALSE, &aMbrName, &aMbrCapt ); } else if ( pMember->IsVisible() ) diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx index 5fa5c393df37..bc1394307f26 100644 --- a/sc/source/core/data/dptabsrc.cxx +++ b/sc/source/core/data/dptabsrc.cxx @@ -85,6 +85,7 @@ using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Any; using ::com::sun::star::sheet::DataPilotFieldAutoShowInfo; +using ::rtl::OUString; // ----------------------------------------------------------------------- @@ -141,15 +142,14 @@ ScDPSource::ScDPSource( ScDPTableData* pD ) : pRowResRoot( NULL ), pColResults( NULL ), pRowResults( NULL ), - bResultOverflow( FALSE ) + bResultOverflow( FALSE ), + mpGrandTotalName(NULL) { pData->SetEmptyFlags( bIgnoreEmptyRows, bRepeatIfEmpty ); } ScDPSource::~ScDPSource() { - delete pData; // ScDPTableData is not ref-counted - if (pDimensions) pDimensions->release(); // ref-counted @@ -163,6 +163,16 @@ ScDPSource::~ScDPSource() delete pResData; } +void ScDPSource::SetGrandTotalName(const ::rtl::OUString& rName) +{ + mpGrandTotalName.reset(new ::rtl::OUString(rName)); +} + +const ::rtl::OUString* ScDPSource::GetGrandTotalName() const +{ + return mpGrandTotalName.get(); +} + USHORT ScDPSource::GetOrientation(long nColumn) { long i; @@ -186,16 +196,21 @@ long ScDPSource::GetDataDimensionCount() return nDataDimCount; } +ScDPDimension* ScDPSource::GetDataDimension(long nIndex) +{ + if (nIndex < 0 || nIndex >= nDataDimCount) + return NULL; + + long nDimIndex = nDataDims[nIndex]; + return GetDimensionsObject()->getByIndex(nDimIndex); +} + String ScDPSource::GetDataDimName( long nIndex ) { String aRet; - if ( nIndex >= 0 && nIndex < nDataDimCount ) - { - long nDimIndex = nDataDims[nIndex]; - ScDPDimension* pDim = GetDimensionsObject()->getByIndex(nDimIndex); - if (pDim) - aRet = String( pDim->getName() ); - } + ScDPDimension* pDim = GetDataDimension(nIndex); + if (pDim) + aRet = String(pDim->getName()); return aRet; } @@ -488,7 +503,10 @@ String ScDPSource::getDataDescription() String aRet; if ( pResData->GetMeasureCount() == 1 ) - aRet = pResData->GetMeasureString( 0, TRUE, SUBTOTAL_FUNC_NONE ); + { + bool bTotalResult = false; + aRet = pResData->GetMeasureString( 0, TRUE, SUBTOTAL_FUNC_NONE, bTotalResult ); + } // empty for more than one measure @@ -1132,6 +1150,7 @@ uno::Reference SAL_CALL ScDPSource::getPropertySetInfo( throw(uno::RuntimeException) { ScUnoGuard aGuard; + using beans::PropertyAttribute::READONLY; static SfxItemPropertyMapEntry aDPSourceMap_Impl[] = { @@ -1140,6 +1159,10 @@ uno::Reference SAL_CALL ScDPSource::getPropertySetInfo( {MAP_CHAR_LEN(SC_UNO_IGNOREEM), 0, &getBooleanCppuType(), 0, 0 }, // for sheet data only {MAP_CHAR_LEN(SC_UNO_REPEATIF), 0, &getBooleanCppuType(), 0, 0 }, // for sheet data only {MAP_CHAR_LEN(SC_UNO_ROWGRAND), 0, &getBooleanCppuType(), 0, 0 }, + {MAP_CHAR_LEN(SC_UNO_ROWFIELDCOUNT), 0, &getCppuType(static_cast(0)), READONLY, 0 }, + {MAP_CHAR_LEN(SC_UNO_COLUMNFIELDCOUNT), 0, &getCppuType(static_cast(0)), READONLY, 0 }, + {MAP_CHAR_LEN(SC_UNO_DATAFIELDCOUNT), 0, &getCppuType(static_cast(0)), READONLY, 0 }, + {MAP_CHAR_LEN(SC_UNO_GRANDTOTAL_NAME), 0, &getCppuType(static_cast(0)), 0, 0 }, {0,0,0,0,0,0} }; static uno::Reference aRef = @@ -1161,6 +1184,12 @@ void SAL_CALL ScDPSource::setPropertyValue( const rtl::OUString& aPropertyName, setIgnoreEmptyRows( lcl_GetBoolFromAny( aValue ) ); else if ( aNameStr.EqualsAscii( SC_UNO_REPEATIF ) ) setRepeatIfEmpty( lcl_GetBoolFromAny( aValue ) ); + else if (aNameStr.EqualsAscii(SC_UNO_GRANDTOTAL_NAME)) + { + OUString aName; + if (aValue >>= aName) + mpGrandTotalName.reset(new OUString(aName)); + } else { DBG_ERROR("unknown property"); @@ -1190,6 +1219,11 @@ uno::Any SAL_CALL ScDPSource::getPropertyValue( const rtl::OUString& aPropertyNa aRet <<= static_cast(nColDimCount); else if ( aNameStr.EqualsAscii( SC_UNO_DATAFIELDCOUNT ) ) // read-only aRet <<= static_cast(nDataDimCount); + else if (aNameStr.EqualsAscii(SC_UNO_GRANDTOTAL_NAME)) + { + if (mpGrandTotalName.get()) + aRet <<= *mpGrandTotalName; + } else { DBG_ERROR("unknown property"); @@ -1337,6 +1371,8 @@ ScDPDimension::ScDPDimension( ScDPSource* pSrc, long nD ) : pHierarchies( NULL ), nUsedHier( 0 ), nFunction( SUBTOTAL_FUNC_SUM ), // sum is default + mpLayoutName(NULL), + mpSubtotalName(NULL), nSourceDim( -1 ), bHasSelectedPage( FALSE ), pSelectedData( NULL ) @@ -1364,6 +1400,16 @@ ScDPHierarchies* ScDPDimension::GetHierarchiesObject() return pHierarchies; } +const rtl::OUString* ScDPDimension::GetLayoutName() const +{ + return mpLayoutName.get(); +} + +const rtl::OUString* ScDPDimension::GetSubtotalName() const +{ + return mpSubtotalName.get(); +} + uno::Reference SAL_CALL ScDPDimension::getHierarchies() throw(uno::RuntimeException) { @@ -1523,6 +1569,8 @@ uno::Reference SAL_CALL ScDPDimension::getPropertySetIn {MAP_CHAR_LEN(SC_UNO_POSITION), 0, &getCppuType((sal_Int32*)0), 0, 0 }, {MAP_CHAR_LEN(SC_UNO_REFVALUE), 0, &getCppuType((sheet::DataPilotFieldReference*)0), 0, 0 }, {MAP_CHAR_LEN(SC_UNO_USEDHIER), 0, &getCppuType((sal_Int32*)0), 0, 0 }, + {MAP_CHAR_LEN(SC_UNO_LAYOUTNAME), 0, &getCppuType(static_cast(0)), 0, 0 }, + {MAP_CHAR_LEN(SC_UNO_FIELD_SUBTOTALNAME), 0, &getCppuType(static_cast(0)), 0, 0 }, {0,0,0,0,0,0} }; static uno::Reference aRef = @@ -1593,6 +1641,18 @@ void SAL_CALL ScDPDimension::setPropertyValue( const rtl::OUString& aPropertyNam } DELETEZ( pSelectedData ); // invalid after changing aSelectedPage } + else if (aNameStr.EqualsAscii(SC_UNO_LAYOUTNAME)) + { + OUString aTmpName; + if (aValue >>= aTmpName) + mpLayoutName.reset(new OUString(aTmpName)); + } + else if (aNameStr.EqualsAscii(SC_UNO_FIELD_SUBTOTALNAME)) + { + OUString aTmpName; + if (aValue >>= aTmpName) + mpSubtotalName.reset(new OUString(aTmpName)); + } else { DBG_ERROR("unknown property"); @@ -1652,6 +1712,10 @@ uno::Any SAL_CALL ScDPDimension::getPropertyValue( const rtl::OUString& aPropert else aRet <<= uno::Sequence(0); } + else if (aNameStr.EqualsAscii(SC_UNO_LAYOUTNAME)) + aRet <<= mpLayoutName.get() ? *mpLayoutName : OUString::createFromAscii(""); + else if (aNameStr.EqualsAscii(SC_UNO_FIELD_SUBTOTALNAME)) + aRet <<= mpSubtotalName.get() ? *mpSubtotalName : OUString::createFromAscii(""); else { DBG_ERROR("unknown property"); @@ -2155,7 +2219,11 @@ uno::Sequence SAL_CALL ScDPLevel::getResults() throw(uno::R return aRet; } - return pSource->GetData()->getDimensionName( nSrcDim ); // (original) dimension name + ScDPDimension* pDim = pSource->GetDimensionsObject()->getByIndex(nSrcDim); + if (!pDim) + return rtl::OUString(); + + return pDim->getName(); } void SAL_CALL ScDPLevel::setName( const ::rtl::OUString& /* rNewName */ ) throw(uno::RuntimeException) @@ -2258,6 +2326,20 @@ uno::Any SAL_CALL ScDPLevel::getPropertyValue( const rtl::OUString& aPropertyNam aRet <<= aAutoShowInfo; else if ( aNameStr.EqualsAscii( SC_UNO_LAYOUT ) ) aRet <<= aLayoutInfo; + else if (aNameStr.EqualsAscii(SC_UNO_LAYOUTNAME)) + { + // read only property + long nSrcDim = pSource->GetSourceDim(nDim); + ScDPDimension* pDim = pSource->GetDimensionsObject()->getByIndex(nSrcDim); + if (!pDim) + return aRet; + + const OUString* pLayoutName = pDim->GetLayoutName(); + if (!pLayoutName) + return aRet; + + aRet <<= *pLayoutName; + } else { DBG_ERROR("unknown property"); @@ -2550,6 +2632,7 @@ ScDPMember::ScDPMember( ScDPSource* pSrc, long nD, long nH, long nL, nHier( nH ), nLev( nL ), maData( rN, fV, bHV ), + mpLayoutName(NULL), nPosition( -1 ), bVisible( TRUE ), bShowDet( TRUE ) @@ -2610,6 +2693,11 @@ void ScDPMember::FillItemData( ScDPItemData& rData ) const rData = maData; } +const OUString* ScDPMember::GetLayoutName() const +{ + return mpLayoutName.get(); +} + String ScDPMember::GetNameStr() const { return maData.aString; @@ -2669,6 +2757,7 @@ uno::Reference SAL_CALL ScDPMember::getPropertySetInfo( {MAP_CHAR_LEN(SC_UNO_ISVISIBL), 0, &getBooleanCppuType(), 0, 0 }, {MAP_CHAR_LEN(SC_UNO_POSITION), 0, &getCppuType((sal_Int32*)0), 0, 0 }, {MAP_CHAR_LEN(SC_UNO_SHOWDETA), 0, &getBooleanCppuType(), 0, 0 }, + {MAP_CHAR_LEN(SC_UNO_LAYOUTNAME), 0, &getCppuType(static_cast(0)), 0, 0 }, {0,0,0,0,0,0} }; static uno::Reference aRef = @@ -2692,6 +2781,12 @@ void SAL_CALL ScDPMember::setPropertyValue( const rtl::OUString& aPropertyName, if (aValue >>= nInt) setPosition( nInt ); } + else if (aNameStr.EqualsAscii(SC_UNO_LAYOUTNAME)) + { + rtl::OUString aName; + if (aValue >>= aName) + mpLayoutName.reset(new rtl::OUString(aName)); + } else { DBG_ERROR("unknown property"); @@ -2711,6 +2806,8 @@ uno::Any SAL_CALL ScDPMember::getPropertyValue( const rtl::OUString& aPropertyNa lcl_SetBoolInAny( aRet, getShowDetails() ); else if ( aNameStr.EqualsAscii( SC_UNO_POSITION ) ) aRet <<= (sal_Int32) getPosition(); + else if (aNameStr.EqualsAscii(SC_UNO_LAYOUTNAME)) + aRet <<= mpLayoutName.get() ? *mpLayoutName : rtl::OUString(); else { DBG_ERROR("unknown property"); diff --git a/sc/source/filter/excel/read.cxx b/sc/source/filter/excel/read.cxx index d1ae00376cde..f87c12f8c26d 100644 --- a/sc/source/filter/excel/read.cxx +++ b/sc/source/filter/excel/read.cxx @@ -1178,6 +1178,9 @@ FltError ImportExcel8::Read( void ) eLastErr = SCWARN_IMPORT_ROW_OVERFLOW; else if( rAddrConv.IsColTruncated() ) eLastErr = SCWARN_IMPORT_COLUMN_OVERFLOW; + + if( GetBiff() == EXC_BIFF8 ) + GetPivotTableManager().MaybeRefreshPivotTables(); } return eLastErr; diff --git a/sc/source/filter/excel/xepivot.cxx b/sc/source/filter/excel/xepivot.cxx index 0b10ded5aa9e..78bc0e0b2f99 100644 --- a/sc/source/filter/excel/xepivot.cxx +++ b/sc/source/filter/excel/xepivot.cxx @@ -67,6 +67,7 @@ using ::com::sun::star::sheet::DataPilotFieldSortInfo; using ::com::sun::star::sheet::DataPilotFieldAutoShowInfo; using ::com::sun::star::sheet::DataPilotFieldLayoutInfo; using ::com::sun::star::sheet::DataPilotFieldReference; +using ::rtl::OUString; using ::rtl::OString; using ::rtl::OUString; @@ -972,6 +973,11 @@ void XclExpPTItem::SetPropertiesFromMember( const ScDPSaveMember& rSaveMem ) { ::set_flag( maItemInfo.mnFlags, EXC_SXVI_HIDDEN, !rSaveMem.GetIsVisible() ); ::set_flag( maItemInfo.mnFlags, EXC_SXVI_HIDEDETAIL, !rSaveMem.GetShowDetails() ); + + // visible name + const OUString* pVisName = rSaveMem.GetLayoutName(); + if (pVisName && !pVisName->equals(GetItemName())) + maItemInfo.SetVisName(*pVisName); } void XclExpPTItem::WriteBody( XclExpStream& rStrm ) @@ -1040,8 +1046,13 @@ void XclExpPTField::SetPropertiesFromDim( const ScDPSaveDimension& rSaveDim ) ::set_flag( maFieldExtInfo.mnFlags, EXC_SXVDEX_SHOWALL, rSaveDim.GetShowEmpty() ); // visible name - if( rSaveDim.HasLayoutName() && (rSaveDim.GetLayoutName() != GetFieldName()) ) - maFieldInfo.SetVisName( rSaveDim.GetLayoutName() ); + const OUString* pLayoutName = rSaveDim.GetLayoutName(); + if (pLayoutName && !pLayoutName->equals(GetFieldName())) + maFieldInfo.SetVisName(*pLayoutName); + + const rtl::OUString* pSubtotalName = rSaveDim.GetSubtotalName(); + if (pSubtotalName) + maFieldExtInfo.mpFieldTotalName.reset(new rtl::OUString(*pSubtotalName)); // subtotals XclPTSubtotalVec aSubtotals; @@ -1108,7 +1119,11 @@ void XclExpPTField::SetDataPropertiesFromDim( const ScDPSaveDimension& rSaveDim rDataInfo.SetApiAggFunc( eFunc ); // visible name - rDataInfo.SetVisName( lclGetDataFieldCaption( GetFieldName(), eFunc ) ); + const rtl::OUString* pVisName = rSaveDim.GetLayoutName(); + if (pVisName) + rDataInfo.SetVisName(*pVisName); + else + rDataInfo.SetVisName( lclGetDataFieldCaption( GetFieldName(), eFunc ) ); // result field reference if( const DataPilotFieldReference* pFieldRef = rSaveDim.GetReferenceValue() ) @@ -1217,10 +1232,9 @@ XclExpPivotTable::XclExpPivotTable( const XclExpRoot& rRoot, const ScDPObject& r // pivot table properties from DP object mnOutScTab = rOutScRange.aStart.Tab(); maPTInfo.maTableName = rDPObj.GetName(); - maPTInfo.maDataName = ScGlobal::GetRscString( STR_PIVOT_DATA ); maPTInfo.mnCacheIdx = mrPCache.GetCacheIndex(); - maPTAutoFormat.Init( rDPObj ); + maPTViewEx9Info.Init( rDPObj ); if( const ScDPSaveData* pSaveData = rDPObj.GetSaveData() ) { @@ -1301,8 +1315,10 @@ void XclExpPivotTable::Save( XclExpStream& rStrm ) WriteSxli( rStrm, maPTInfo.mnDataCols, maPTInfo.mnColFields ); // SXEX WriteSxex( rStrm ); - // SX_AUTOFORMAT - WriteSxAutoformat( rStrm ); + // QSISXTAG + WriteQsiSxTag( rStrm ); + // SXVIEWEX9 + WriteSxViewEx9( rStrm ); } } @@ -1336,6 +1352,15 @@ void XclExpPivotTable::SetPropertiesFromDP( const ScDPSaveData& rSaveData ) ::set_flag( maPTInfo.mnFlags, EXC_SXVIEW_COLGRAND, rSaveData.GetColumnGrand() ); ::set_flag( maPTExtInfo.mnFlags, EXC_SXEX_DRILLDOWN, rSaveData.GetDrillDown() ); mbFilterBtn = rSaveData.GetFilterButton(); + const ScDPSaveDimension* pDim = rSaveData.GetExistingDataLayoutDimension(); + if (!pDim) + return; + + const rtl::OUString* pLayoutName = pDim->GetLayoutName(); + if (pLayoutName) + maPTInfo.maDataName = *pLayoutName; + else + maPTInfo.maDataName = ScGlobal::GetRscString(STR_PIVOT_DATA); } void XclExpPivotTable::SetFieldPropertiesFromDim( const ScDPSaveDimension& rSaveDim ) @@ -1443,17 +1468,21 @@ void XclExpPivotTable::Finalize() rnDataXclRow = rnXclRow1 + maPTInfo.mnColFields + 1; if( maDataFields.empty() ) ++rnDataXclRow; - if( 0 == maPTAutoFormat.mnGridLayout ) + + bool bExtraHeaderRow = (0 == maPTViewEx9Info.mnGridLayout && maPTInfo.mnColFields == 0); + if (bExtraHeaderRow) + // Insert an extra row only when there is no column field. ++rnDataXclRow; + rnXclCol2 = ::std::max( rnXclCol2, rnDataXclCol ); rnXclRow2 = ::std::max( rnXclRow2, rnDataXclRow ); maPTInfo.mnDataCols = rnXclCol2 - rnDataXclCol + 1; maPTInfo.mnDataRows = rnXclRow2 - rnDataXclRow + 1; // first heading - maPTInfo.mnFirstHeadRow = rnXclRow1 + 1; - if( 0 == maPTAutoFormat.mnGridLayout ) - maPTInfo.mnFirstHeadRow++; + maPTInfo.mnFirstHeadRow = rnXclRow1; + if (bExtraHeaderRow) + maPTInfo.mnFirstHeadRow += 2; } // records ---------------------------------------------------------------- @@ -1533,14 +1562,68 @@ void XclExpPivotTable::WriteSxex( XclExpStream& rStrm ) const rStrm.EndRecord(); } -void XclExpPivotTable::WriteSxAutoformat( XclExpStream& rStrm ) const +void XclExpPivotTable::WriteQsiSxTag( XclExpStream& rStrm ) const +{ + rStrm.StartRecord( 0x0802, 32 ); + + sal_uInt16 nRecordType = 0x0802; + sal_uInt16 nDummyFlags = 0x0000; + sal_uInt16 nTableType = 1; // 0 = query table : 1 = pivot table + + rStrm << nRecordType << nDummyFlags << nTableType; + + // General flags + bool bEnableRefresh = true; + bool bPCacheInvalid = false; + bool bOlapPTReport = false; + + sal_uInt16 nFlags = 0x0000; + if (bEnableRefresh) nFlags |= 0x0001; + if (bPCacheInvalid) nFlags |= 0x0002; + if (bOlapPTReport) nFlags |= 0x0004; + rStrm << nFlags; + + // Feature-specific options. The value differs depending on the table + // type, but we assume the table type is always pivot table. + sal_uInt32 nOptions = 0x00000000; + bool bNoStencil = false; + bool bHideTotal = false; + bool bEmptyRows = false; + bool bEmptyCols = false; + if (bNoStencil) nOptions |= 0x00000001; + if (bHideTotal) nOptions |= 0x00000002; + if (bEmptyRows) nOptions |= 0x00000008; + if (bEmptyCols) nOptions |= 0x00000010; + rStrm << nOptions; + + enum ExcelVersion + { + Excel2000 = 0, + ExcelXP = 1, + Excel2003 = 2, + Excel2007 = 3 + }; + ExcelVersion eXclVer = Excel2000; + sal_uInt8 nOffsetBytes = 16; + rStrm << static_cast(eXclVer) // version table last refreshed + << static_cast(eXclVer) // minimum version to refresh + << nOffsetBytes + << static_cast(eXclVer); // first version created + + rStrm << XclExpString(maPTInfo.maTableName); + rStrm << static_cast(0x0001); // no idea what this is for. + + rStrm.EndRecord(); +} + +void XclExpPivotTable::WriteSxViewEx9( XclExpStream& rStrm ) const { // Until we sync the autoformat ids only export if using grid header layout // That could only have been set via xls import so far. - if ( 0 == maPTAutoFormat.mnGridLayout ) + if ( 0 == maPTViewEx9Info.mnGridLayout ) { rStrm.StartRecord( EXC_ID_SXVIEWEX9, 17 ); - rStrm << maPTAutoFormat; + rStrm << maPTViewEx9Info; rStrm.EndRecord(); } } diff --git a/sc/source/filter/excel/xestring.cxx b/sc/source/filter/excel/xestring.cxx index 9af8dbfdd851..b657e3b1f1d0 100644 --- a/sc/source/filter/excel/xestring.cxx +++ b/sc/source/filter/excel/xestring.cxx @@ -423,7 +423,8 @@ void XclExpString::WriteFormats( XclExpStream& rStrm, bool bWriteSize ) const void XclExpString::Write( XclExpStream& rStrm ) const { - WriteHeader( rStrm ); + if (!mbSkipHeader) + WriteHeader( rStrm ); WriteBuffer( rStrm ); if( IsWriteFormats() ) // only in BIFF8 included in string WriteFormats( rStrm ); @@ -589,6 +590,7 @@ void XclExpString::Init( sal_Int32 nCurrLen, XclStrFlags nFlags, sal_uInt16 nMax mbSmartFlags = bBiff8 && ::get_flag( nFlags, EXC_STR_SMARTFLAGS ); mbSkipFormats = ::get_flag( nFlags, EXC_STR_SEPARATEFORMATS ); mbWrapped = false; + mbSkipHeader = ::get_flag( nFlags, EXC_STR_NOHEADER ); mnMaxLen = nMaxLen; SetStrLen( nCurrLen ); diff --git a/sc/source/filter/excel/xipivot.cxx b/sc/source/filter/excel/xipivot.cxx index 495f73d75a68..29e20e52e64a 100644 --- a/sc/source/filter/excel/xipivot.cxx +++ b/sc/source/filter/excel/xipivot.cxx @@ -847,6 +847,11 @@ void XclImpPivotCache::ReadPivotCacheStream( XclImpStream& rStrm ) } } +bool XclImpPivotCache::IsRefreshOnLoad() const +{ + return static_cast(maPCInfo.mnFlags & 0x0004); +} + // ============================================================================ // Pivot table // ============================================================================ @@ -882,6 +887,8 @@ void XclImpPTItem::ConvertItem( ScDPSaveDimension& rSaveDim ) const ScDPSaveMember& rMember = *rSaveDim.GetMemberByName( *pItemName ); rMember.SetIsVisible( !::get_flag( maItemInfo.mnFlags, EXC_SXVI_HIDDEN ) ); rMember.SetShowDetails( !::get_flag( maItemInfo.mnFlags, EXC_SXVI_HIDEDETAIL ) ); + if (maItemInfo.HasVisName()) + rMember.SetLayoutName(*maItemInfo.GetVisName()); } } @@ -1043,7 +1050,7 @@ ScDPSaveDimension* XclImpPTField::ConvertRCPField( ScDPSaveData& rSaveData ) con // visible name if( const String* pVisName = maFieldInfo.GetVisName() ) if( pVisName->Len() > 0 ) - rSaveDim.SetLayoutName( pVisName ); + rSaveDim.SetLayoutName( *pVisName ); // subtotal function(s) XclPTSubtotalVec aSubtotalVec; @@ -1075,6 +1082,10 @@ ScDPSaveDimension* XclImpPTField::ConvertRCPField( ScDPSaveData& rSaveData ) con // grouping info pCacheField->ConvertGroupField( rSaveData, mrPTable.GetVisFieldNames() ); + // custom subtotal name + if (maFieldExtInfo.mpFieldTotalName.get()) + rSaveDim.SetSubtotalName(*maFieldExtInfo.mpFieldTotalName); + return &rSaveDim; } @@ -1099,7 +1110,7 @@ void XclImpPTField::ConvertDataFieldInfo( ScDPSaveDimension& rSaveDim, const Xcl // visible name if( const String* pVisName = rDataInfo.GetVisName() ) if( pVisName->Len() > 0 ) - rSaveDim.SetLayoutName( pVisName ); + rSaveDim.SetLayoutName( *pVisName ); // aggregation function rSaveDim.SetFunction( static_cast< USHORT >( rDataInfo.GetApiAggFunc() ) ); @@ -1134,7 +1145,8 @@ void XclImpPTField::ConvertItems( ScDPSaveDimension& rSaveDim ) const XclImpPivotTable::XclImpPivotTable( const XclImpRoot& rRoot ) : XclImpRoot( rRoot ), - maDataOrientField( *this, EXC_SXIVD_DATA ) + maDataOrientField( *this, EXC_SXIVD_DATA ), + mpDPObj(NULL) { } @@ -1298,7 +1310,7 @@ void XclImpPivotTable::ReadSxex( XclImpStream& rStrm ) void XclImpPivotTable::ReadSxViewEx9( XclImpStream& rStrm ) { - rStrm >> maPTAutoFormat; + rStrm >> maPTViewEx9Info; } // ---------------------------------------------------------------------------- @@ -1336,11 +1348,14 @@ void XclImpPivotTable::Convert() if( const XclImpPTField* pField = GetField( *aIt ) ) pField->ConvertPageField( aSaveData ); +#if 0 // Why do we do this ??? + // hidden fields for( sal_uInt16 nField = 0, nCount = GetFieldCount(); nField < nCount; ++nField ) if( const XclImpPTField* pField = GetField( nField ) ) if( (pField->GetAxes() & EXC_SXVD_AXIS_ROWCOLPAGE) == 0 ) pField->ConvertHiddenField( aSaveData ); +#endif // data fields for( aIt = maFiltDataFields.begin(), aEnd = maFiltDataFields.end(); aIt != aEnd; ++aIt ) @@ -1364,12 +1379,30 @@ void XclImpPivotTable::Convert() // create the DataPilot ScDPObject* pDPObj = new ScDPObject( GetDocPtr() ); pDPObj->SetName( maPTInfo.maTableName ); + if (maPTInfo.maDataName.Len() > 0) + aSaveData.GetDataLayoutDimension()->SetLayoutName(maPTInfo.maDataName); + + if (maPTViewEx9Info.maGrandTotalName.Len() > 0) + aSaveData.SetGrandTotalName(maPTViewEx9Info.maGrandTotalName); + pDPObj->SetSaveData( aSaveData ); pDPObj->SetSheetDesc( aDesc ); pDPObj->SetOutRange( aOutRange ); pDPObj->SetAlive( TRUE ); - pDPObj->SetHeaderLayout( maPTAutoFormat.mnGridLayout == 0 ); + pDPObj->SetHeaderLayout( maPTViewEx9Info.mnGridLayout == 0 ); + GetDoc().GetDPCollection()->Insert( pDPObj ); + mpDPObj = pDPObj; +} + +void XclImpPivotTable::MaybeRefresh() +{ + if (mpDPObj && mxPCache->IsRefreshOnLoad()) + { + // 'refresh table on load' flag is set. Refresh the table now. Some + // Excel files contain partial table output when this flag is set. + mpDPObj->Output(); + } } // ============================================================================ @@ -1484,85 +1517,10 @@ void XclImpPivotTableManager::ConvertPivotTables() (*aIt)->Convert(); } -// ============================================================================ - -// Pivot table autoformat settings ============================================ - -/** -classic : 10 08 00 00 00 00 00 00 20 00 00 00 01 00 00 00 00 -default : 10 08 00 00 00 00 00 00 20 00 00 00 01 00 00 00 00 -report01 : 10 08 02 00 00 00 00 00 20 00 00 00 00 10 00 00 00 -report02 : 10 08 02 00 00 00 00 00 20 00 00 00 01 10 00 00 00 -report03 : 10 08 02 00 00 00 00 00 20 00 00 00 02 10 00 00 00 -report04 : 10 08 02 00 00 00 00 00 20 00 00 00 03 10 00 00 00 -report05 : 10 08 02 00 00 00 00 00 20 00 00 00 04 10 00 00 00 -report06 : 10 08 02 00 00 00 00 00 20 00 00 00 05 10 00 00 00 -report07 : 10 08 02 00 00 00 00 00 20 00 00 00 06 10 00 00 00 -report08 : 10 08 02 00 00 00 00 00 20 00 00 00 07 10 00 00 00 -report09 : 10 08 02 00 00 00 00 00 20 00 00 00 08 10 00 00 00 -report10 : 10 08 02 00 00 00 00 00 20 00 00 00 09 10 00 00 00 -table01 : 10 08 00 00 00 00 00 00 20 00 00 00 0a 10 00 00 00 -table02 : 10 08 00 00 00 00 00 00 20 00 00 00 0b 10 00 00 00 -table03 : 10 08 00 00 00 00 00 00 20 00 00 00 0c 10 00 00 00 -table04 : 10 08 00 00 00 00 00 00 20 00 00 00 0d 10 00 00 00 -table05 : 10 08 00 00 00 00 00 00 20 00 00 00 0e 10 00 00 00 -table06 : 10 08 00 00 00 00 00 00 20 00 00 00 0f 10 00 00 00 -table07 : 10 08 00 00 00 00 00 00 20 00 00 00 10 10 00 00 00 -table08 : 10 08 00 00 00 00 00 00 20 00 00 00 11 10 00 00 00 -table09 : 10 08 00 00 00 00 00 00 20 00 00 00 12 10 00 00 00 -table10 : 10 08 00 00 00 00 00 00 20 00 00 00 13 10 00 00 00 -none : 10 08 00 00 00 00 00 00 20 00 00 00 15 10 00 00 00 -**/ - -XclPTAutoFormat::XclPTAutoFormat() : - mbReport( 0 ), - mnAutoFormat( 0 ), - mnGridLayout( 0x10 ) -{ -} - -void XclPTAutoFormat::Init( const ScDPObject& rDPObj ) -{ - if( rDPObj.GetHeaderLayout() ) - { - mbReport = 0; - mnAutoFormat = 1; - mnGridLayout = 0; - } - else - { - // Report1 for now - // TODO : sync with autoformat indicies - mbReport = 2; - mnAutoFormat = 1; - mnGridLayout = 0x10; - } -} - -XclImpStream& operator>>( XclImpStream& rStrm, XclPTAutoFormat& rInfo ) -{ - rStrm.Ignore( 2 ); - rStrm >> rInfo.mbReport; /// 2 for report* fmts ? - rStrm.Ignore( 6 ); - sal_uInt8 nDummy; - return rStrm - >> rInfo.mnAutoFormat - >> rInfo.mnGridLayout - >> nDummy >> nDummy >> nDummy; -} - -XclExpStream& operator<<( XclExpStream& rStrm, const XclPTAutoFormat& rInfo ) +void XclImpPivotTableManager::MaybeRefreshPivotTables() { - return rStrm - << EXC_PT_AUTOFMT_HEADER - << rInfo.mbReport - << EXC_PT_AUTOFMT_ZERO - << EXC_PT_AUTOFMT_FLAGS - << rInfo.mnAutoFormat - << rInfo.mnGridLayout - << static_cast(0x00) - << static_cast(0x00) - << static_cast(0x00); + for( XclImpPivotTableVec::iterator aIt = maPTables.begin(), aEnd = maPTables.end(); aIt != aEnd; ++aIt ) + (*aIt)->MaybeRefresh(); } // ============================================================================ diff --git a/sc/source/filter/excel/xlpivot.cxx b/sc/source/filter/excel/xlpivot.cxx index d36950b2494d..8f5d026379d9 100644 --- a/sc/source/filter/excel/xlpivot.cxx +++ b/sc/source/filter/excel/xlpivot.cxx @@ -31,6 +31,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sc.hxx" #include "dpgroup.hxx" +#include "dpsave.hxx" #include "xestream.hxx" #include "xistream.hxx" #include "xestring.hxx" @@ -581,7 +582,9 @@ XclExpStream& operator<<( XclExpStream& rStrm, const XclPTFieldInfo& rInfo ) XclPTFieldExtInfo::XclPTFieldExtInfo() : mnFlags( EXC_SXVDEX_DEFAULTFLAGS ), mnSortField( EXC_SXVDEX_SORT_OWN ), - mnShowField( EXC_SXVDEX_SHOW_NONE ) + mnShowField( EXC_SXVDEX_SHOW_NONE ), + mnNumFmt(0), + mpFieldTotalName(NULL) { } @@ -639,10 +642,19 @@ void XclPTFieldExtInfo::SetApiLayoutMode( sal_Int32 nLayoutMode ) XclImpStream& operator>>( XclImpStream& rStrm, XclPTFieldExtInfo& rInfo ) { - return rStrm - >> rInfo.mnFlags - >> rInfo.mnSortField - >> rInfo.mnShowField; + sal_uInt8 nNameLen = 0; + rStrm >> rInfo.mnFlags + >> rInfo.mnSortField + >> rInfo.mnShowField + >> rInfo.mnNumFmt + >> nNameLen; + + rStrm.Ignore(10); + if (nNameLen != 0xFF) + // Custom field total name is used. Pick it up. + rInfo.mpFieldTotalName.reset(new rtl::OUString(rStrm.ReadUniString(nNameLen, 0))); + + return rStrm; } XclExpStream& operator<<( XclExpStream& rStrm, const XclPTFieldExtInfo& rInfo ) @@ -650,9 +662,23 @@ XclExpStream& operator<<( XclExpStream& rStrm, const XclPTFieldExtInfo& rInfo ) rStrm << rInfo.mnFlags << rInfo.mnSortField << rInfo.mnShowField - << EXC_SXVDEX_FORMAT_NONE - << sal_uInt16( 0xFFFF ); // unknown - rStrm.WriteZeroBytes( 8 ); // unknown + << EXC_SXVDEX_FORMAT_NONE; + + if (rInfo.mpFieldTotalName.get() && rInfo.mpFieldTotalName->getLength() > 0) + { + rtl::OUString aFinalName = *rInfo.mpFieldTotalName; + if (aFinalName.getLength() >= 254) + aFinalName = aFinalName.copy(0, 254); + sal_uInt8 nNameLen = static_cast(aFinalName.getLength()); + rStrm << nNameLen; + rStrm.WriteZeroBytes(10); + rStrm << XclExpString(aFinalName, EXC_STR_NOHEADER); + } + else + { + rStrm << sal_uInt16(0xFFFF); + rStrm.WriteZeroBytes(8); + } return rStrm; } @@ -923,3 +949,86 @@ XclExpStream& operator<<( XclExpStream& rStrm, const XclPTExtInfo& rInfo ) // ============================================================================ +// Pivot table autoformat settings ============================================ + +/** +classic : 10 08 00 00 00 00 00 00 20 00 00 00 01 00 00 00 00 +default : 10 08 00 00 00 00 00 00 20 00 00 00 01 00 00 00 00 +report01 : 10 08 02 00 00 00 00 00 20 00 00 00 00 10 00 00 00 +report02 : 10 08 02 00 00 00 00 00 20 00 00 00 01 10 00 00 00 +report03 : 10 08 02 00 00 00 00 00 20 00 00 00 02 10 00 00 00 +report04 : 10 08 02 00 00 00 00 00 20 00 00 00 03 10 00 00 00 +report05 : 10 08 02 00 00 00 00 00 20 00 00 00 04 10 00 00 00 +report06 : 10 08 02 00 00 00 00 00 20 00 00 00 05 10 00 00 00 +report07 : 10 08 02 00 00 00 00 00 20 00 00 00 06 10 00 00 00 +report08 : 10 08 02 00 00 00 00 00 20 00 00 00 07 10 00 00 00 +report09 : 10 08 02 00 00 00 00 00 20 00 00 00 08 10 00 00 00 +report10 : 10 08 02 00 00 00 00 00 20 00 00 00 09 10 00 00 00 +table01 : 10 08 00 00 00 00 00 00 20 00 00 00 0a 10 00 00 00 +table02 : 10 08 00 00 00 00 00 00 20 00 00 00 0b 10 00 00 00 +table03 : 10 08 00 00 00 00 00 00 20 00 00 00 0c 10 00 00 00 +table04 : 10 08 00 00 00 00 00 00 20 00 00 00 0d 10 00 00 00 +table05 : 10 08 00 00 00 00 00 00 20 00 00 00 0e 10 00 00 00 +table06 : 10 08 00 00 00 00 00 00 20 00 00 00 0f 10 00 00 00 +table07 : 10 08 00 00 00 00 00 00 20 00 00 00 10 10 00 00 00 +table08 : 10 08 00 00 00 00 00 00 20 00 00 00 11 10 00 00 00 +table09 : 10 08 00 00 00 00 00 00 20 00 00 00 12 10 00 00 00 +table10 : 10 08 00 00 00 00 00 00 20 00 00 00 13 10 00 00 00 +none : 10 08 00 00 00 00 00 00 20 00 00 00 15 10 00 00 00 +**/ + +XclPTViewEx9Info::XclPTViewEx9Info() : + mbReport( 0 ), + mnAutoFormat( 0 ), + mnGridLayout( 0x10 ) +{ +} + +void XclPTViewEx9Info::Init( const ScDPObject& rDPObj ) +{ + if( rDPObj.GetHeaderLayout() ) + { + mbReport = 0; + mnAutoFormat = 1; + mnGridLayout = 0; + } + else + { + // Report1 for now + // TODO : sync with autoformat indicies + mbReport = 2; + mnAutoFormat = 1; + mnGridLayout = 0x10; + } + + const ScDPSaveData* pData = rDPObj.GetSaveData(); + if (pData) + { + const rtl::OUString* pGrandTotal = pData->GetGrandTotalName(); + if (pGrandTotal) + maGrandTotalName = *pGrandTotal; + } +} + +XclImpStream& operator>>( XclImpStream& rStrm, XclPTViewEx9Info& rInfo ) +{ + rStrm.Ignore( 2 ); + rStrm >> rInfo.mbReport; /// 2 for report* fmts ? + rStrm.Ignore( 6 ); + rStrm >> rInfo.mnAutoFormat >> rInfo.mnGridLayout; + rInfo.maGrandTotalName = rStrm.ReadUniString(); + return rStrm; +} + +XclExpStream& operator<<( XclExpStream& rStrm, const XclPTViewEx9Info& rInfo ) +{ + return rStrm + << EXC_PT_AUTOFMT_HEADER + << rInfo.mbReport + << EXC_PT_AUTOFMT_ZERO + << EXC_PT_AUTOFMT_FLAGS + << rInfo.mnAutoFormat + << rInfo.mnGridLayout + << XclExpString(rInfo.maGrandTotalName, EXC_STR_DEFAULT, EXC_PT_MAXSTRLEN); +} + diff --git a/sc/source/filter/inc/xepivot.hxx b/sc/source/filter/inc/xepivot.hxx index 67ef2ff6fcd8..e9d2403c29f2 100644 --- a/sc/source/filter/inc/xepivot.hxx +++ b/sc/source/filter/inc/xepivot.hxx @@ -412,8 +412,10 @@ private: void WriteSxli( XclExpStream& rStrm, sal_uInt16 nLineCount, sal_uInt16 nIndexCount ) const; /** Writes the SXEX records containing additional pivot table info. */ void WriteSxex( XclExpStream& rStrm ) const; + + void WriteQsiSxTag( XclExpStream& rStrm ) const; /** Writes the SX_AUTOFORMAT records with the autoformat id and header layout */ - void WriteSxAutoformat( XclExpStream& rStrm ) const; + void WriteSxViewEx9( XclExpStream& rStrm ) const; // ------------------------------------------------------------------------ private: @@ -424,7 +426,7 @@ private: const XclExpPivotCache& mrPCache; /// The pivot cache this pivot table bases on. XclPTInfo maPTInfo; /// Info about the pivot table (SXVIEW record). XclPTExtInfo maPTExtInfo; /// Extended info about the pivot table (SXEX record). - XclPTAutoFormat maPTAutoFormat; /// The selected autoformat (SXVIEWEX9) + XclPTViewEx9Info maPTViewEx9Info; /// The selected autoformat (SXVIEWEX9) XclExpPTFieldList maFieldList; /// All fields in pivot cache order. ScfUInt16Vec maRowFields; /// Row field indexes. ScfUInt16Vec maColFields; /// Column field indexes. diff --git a/sc/source/filter/inc/xestring.hxx b/sc/source/filter/inc/xestring.hxx index 69a1a7af09fb..5fe5e4fb813f 100644 --- a/sc/source/filter/inc/xestring.hxx +++ b/sc/source/filter/inc/xestring.hxx @@ -323,6 +323,7 @@ private: bool mbSmartFlags; /// true = omit flags on empty string; false = always write flags. bool mbSkipFormats; /// true = skip formats on export; false = write complete formatted string. bool mbWrapped; /// true = text contains several paragraphs. + bool mbSkipHeader; /// ture = skip length and flags when writing string bytes. }; inline bool operator==( const XclExpString& rLeft, const XclExpString& rRight ) diff --git a/sc/source/filter/inc/xipivot.hxx b/sc/source/filter/inc/xipivot.hxx index 5a98c0793740..15227b8fb1a3 100644 --- a/sc/source/filter/inc/xipivot.hxx +++ b/sc/source/filter/inc/xipivot.hxx @@ -186,6 +186,8 @@ public: /** Reads the entire pivot cache stream. Uses decrypter from passed stream. */ void ReadPivotCacheStream( XclImpStream& rStrm ); + bool IsRefreshOnLoad() const; + private: typedef ::std::vector< XclImpPCFieldRef > XclImpPCFieldVec; @@ -359,6 +361,8 @@ public: /** Inserts the pivot table into the Calc document. */ void Convert(); + void MaybeRefresh(); + // ------------------------------------------------------------------------ private: typedef ::std::vector< XclImpPTFieldRef > XclImpPTFieldVec; @@ -367,7 +371,7 @@ private: XclPTInfo maPTInfo; /// General info about the pivot table (SXVIEW record). XclPTExtInfo maPTExtInfo; /// Extended info about the pivot table (SXEX record). - XclPTAutoFormat maPTAutoFormat; /// The selected autoformat (SX_AUTOFORMAT) + XclPTViewEx9Info maPTViewEx9Info; /// (SXVIEWEX9 record) XclImpPTFieldVec maFields; /// Vector containing all fields. XclImpPTFieldRef mxCurrField; /// Current field for importing additional info. ScfStringVec maVisFieldNames; /// Vector containing all visible field names. @@ -378,6 +382,7 @@ private: ScfUInt16Vec maFiltDataFields; /// Filtered data field indexes. XclImpPTField maDataOrientField; /// Special data field orientation field. ScRange maOutScRange; /// Output range in the Calc document. + ScDPObject* mpDPObj; }; typedef ScfRef< XclImpPivotTable > XclImpPivotTableRef; @@ -437,6 +442,8 @@ public: /** Inserts all pivot tables into the Calc document. */ void ConvertPivotTables(); + void MaybeRefreshPivotTables(); + private: typedef ::std::vector< XclImpPivotCacheRef > XclImpPivotCacheVec; typedef ::std::vector< XclImpPivotTableRef > XclImpPivotTableVec; diff --git a/sc/source/filter/inc/xlpivot.hxx b/sc/source/filter/inc/xlpivot.hxx index 52251ed62294..3ea464e7b919 100644 --- a/sc/source/filter/inc/xlpivot.hxx +++ b/sc/source/filter/inc/xlpivot.hxx @@ -43,6 +43,8 @@ #include "xladdress.hxx" #include "dpobject.hxx" +#include + class XclImpStream; class XclExpStream; @@ -671,6 +673,8 @@ struct XclPTFieldExtInfo sal_uInt32 mnFlags; /// Several flags and number of items for AutoShow. sal_uInt16 mnSortField; /// Index to data field sorting bases on. sal_uInt16 mnShowField; /// Index to data field AutoShow bases on. + sal_uInt16 mnNumFmt; + ::std::auto_ptr mpFieldTotalName; explicit XclPTFieldExtInfo(); @@ -796,19 +800,20 @@ XclExpStream& operator<<( XclExpStream& rStrm, const XclPTExtInfo& rInfo ); // Pivot table autoformat settings ============================================== -/** Pivot table autoformat settings (SX_AUTOFORMAT record). */ -struct XclPTAutoFormat +/** Pivot table autoformat settings (SXVIEWEX9 record). */ +struct XclPTViewEx9Info { sal_uInt32 mbReport; /// 2 for report* fmts ? sal_uInt8 mnAutoFormat; /// AutoFormat ID sal_uInt8 mnGridLayout; /// 0 == gridlayout, 0x10 == modern + String maGrandTotalName; - explicit XclPTAutoFormat(); + explicit XclPTViewEx9Info(); void Init( const ScDPObject& rDPObj ); }; -XclImpStream& operator>>( XclImpStream& rStrm, XclPTAutoFormat& rInfo ); -XclExpStream& operator<<( XclExpStream& rStrm, const XclPTAutoFormat& rInfo ); +XclImpStream& operator>>( XclImpStream& rStrm, XclPTViewEx9Info& rInfo ); +XclExpStream& operator<<( XclExpStream& rStrm, const XclPTViewEx9Info& rInfo ); // ============================================================================ #endif diff --git a/sc/source/filter/inc/xlstring.hxx b/sc/source/filter/inc/xlstring.hxx index 0970fafd1ed6..32ee23f83d85 100644 --- a/sc/source/filter/inc/xlstring.hxx +++ b/sc/source/filter/inc/xlstring.hxx @@ -43,6 +43,7 @@ const XclStrFlags EXC_STR_FORCEUNICODE = 0x0001; /// Always use UCS-2 cha const XclStrFlags EXC_STR_8BITLENGTH = 0x0002; /// 8-bit string length field (default: 16-bit). const XclStrFlags EXC_STR_SMARTFLAGS = 0x0004; /// Omit flags on empty string (default: read/write always). BIFF8 only. const XclStrFlags EXC_STR_SEPARATEFORMATS = 0x0008; /// Import: Keep old formats when reading unformatted string (default: clear formats); Export: Write unformatted string. +const XclStrFlags EXC_STR_NOHEADER = 0x0010; /// Export: Don't write the length and flag fields. // ---------------------------------------------------------------------------- diff --git a/sc/source/ui/dbgui/pvfundlg.cxx b/sc/source/ui/dbgui/pvfundlg.cxx index d44791ff6972..dac8ee1e5e04 100644 --- a/sc/source/ui/dbgui/pvfundlg.cxx +++ b/sc/source/ui/dbgui/pvfundlg.cxx @@ -705,7 +705,9 @@ ScDPShowDetailDlg::ScDPShowDetailDlg( Window* pParent, ScDPObject& rDPObj, USHOR maLbDims ( this, ScResId( LB_DIMS ) ), maBtnOk ( this, ScResId( BTN_OK ) ), maBtnCancel ( this, ScResId( BTN_CANCEL ) ), - maBtnHelp ( this, ScResId( BTN_HELP ) ) + maBtnHelp ( this, ScResId( BTN_HELP ) ), + + mrDPObj(rDPObj) { FreeResource(); @@ -719,7 +721,13 @@ ScDPShowDetailDlg::ScDPShowDetailDlg( Window* pParent, ScDPObject& rDPObj, USHOR { const ScDPSaveDimension* pDimension = pSaveData ? pSaveData->GetExistingDimensionByName(aName) : 0; if ( !pDimension || (pDimension->GetOrientation() != nOrient) ) + { + const OUString* pLayoutName = pDimension->GetLayoutName(); + if (pLayoutName) + aName = *pLayoutName; maLbDims.InsertEntry( aName ); + maNameIndexMap.insert(DimNameIndexMap::value_type(aName, nDim)); + } } } if( maLbDims.GetEntryCount() ) @@ -735,7 +743,17 @@ short ScDPShowDetailDlg::Execute() String ScDPShowDetailDlg::GetDimensionName() const { - return maLbDims.GetSelectEntry(); + // Look up the internal dimension name which may be different from the + // displayed field name. + String aSelectedName = maLbDims.GetSelectEntry(); + DimNameIndexMap::const_iterator itr = maNameIndexMap.find(aSelectedName); + if (itr == maNameIndexMap.end()) + // This should never happen! + return aSelectedName; + + long nDim = itr->second; + BOOL bIsDataLayout = false; + return mrDPObj.GetDimName(nDim, bIsDataLayout); } IMPL_LINK( ScDPShowDetailDlg, DblClickHdl, ListBox*, pLBox ) diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx index 7b03e067a865..c23068b82200 100644 --- a/sc/source/ui/dbgui/pvlaydlg.cxx +++ b/sc/source/ui/dbgui/pvlaydlg.cxx @@ -63,6 +63,7 @@ #include "sc.hrc" //CHINA001 #include "scabstdlg.hxx" //CHINA001 using namespace com::sun::star; +using ::rtl::OUString; //---------------------------------------------------------------------------- @@ -1491,6 +1492,8 @@ IMPL_LINK( ScDPLayoutDlg, OkHdl, OKButton *, EMPTYARG ) nPageCount, nColCount, nRowCount, nDataCount ); if ( bFit ) { + ScDPSaveData* pOldSaveData = xDlgDPObject->GetSaveData(); + ScRange aOutRange( aAdrDest ); // bToNewTable is passed separately ScDPSaveData aSaveData; @@ -1522,6 +1525,22 @@ IMPL_LINK( ScDPLayoutDlg, OkHdl, OKButton *, EMPTYARG ) pDim->SetSortInfo( &aIt->maSortInfo ); pDim->SetLayoutInfo( &aIt->maLayoutInfo ); pDim->SetAutoShowInfo( &aIt->maShowInfo ); + ScDPSaveDimension* pOldDim = NULL; + if (pOldSaveData) + { + // Transfer the existing layout names to new dimension instance. + pOldDim = pOldSaveData->GetExistingDimensionByName(aIt->maName); + if (pOldDim) + { + const OUString* pLayoutName = pOldDim->GetLayoutName(); + if (pLayoutName) + pDim->SetLayoutName(*pLayoutName); + + const OUString* pSubtotalName = pOldDim->GetSubtotalName(); + if (pSubtotalName) + pDim->SetSubtotalName(*pSubtotalName); + } + } bool bManualSort = ( aIt->maSortInfo.Mode == sheet::DataPilotFieldSortMode::MANUAL ); @@ -1542,11 +1561,33 @@ IMPL_LINK( ScDPLayoutDlg, OkHdl, OKButton *, EMPTYARG ) ScDPSaveMember* pMember = pDim->GetMemberByName( *pItem ); pMember->SetIsVisible( bIsVisible ); pMember->SetShowDetails( bShowDetails ); + if (pOldDim) + { + // Transfer the existing layout name. + ScDPSaveMember* pOldMember = pOldDim->GetMemberByName(*pItem); + if (pOldMember) + { + const OUString* pLayoutName = pOldMember->GetLayoutName(); + if (pLayoutName) + pMember->SetLayoutName(*pLayoutName); + } + } } } } } } + ScDPSaveDimension* pDim = aSaveData.GetDataLayoutDimension(); + if (pDim && pOldSaveData) + { + ScDPSaveDimension* pOldDim = pOldSaveData->GetDataLayoutDimension(); + if (pOldDim) + { + const OUString* pLayoutName = pOldDim->GetLayoutName(); + if (pLayoutName) + pDim->SetLayoutName(*pLayoutName); + } + } USHORT nWhichPivot = SC_MOD()->GetPool().GetWhich( SID_PIVOT_TABLE ); ScPivotItem aOutItem( nWhichPivot, &aSaveData, &aOutRange, bToNewTable ); diff --git a/sc/source/ui/inc/pvfundlg.hxx b/sc/source/ui/inc/pvfundlg.hxx index eeeb9c4094c4..6b9aa62c37a3 100644 --- a/sc/source/ui/inc/pvfundlg.hxx +++ b/sc/source/ui/inc/pvfundlg.hxx @@ -55,6 +55,8 @@ #include #include "pivot.hxx" +#include + // ============================================================================ typedef sfx::ListBoxWrapper< sal_Int32 > ScDPListBoxWrapper; @@ -217,6 +219,11 @@ public: virtual short Execute(); + /** + * @return String internal name of the selected field. Note that this may + * be different from the name displayed in the dialog if the field + * has a layout name. + */ String GetDimensionName() const; private: @@ -228,6 +235,10 @@ private: OKButton maBtnOk; CancelButton maBtnCancel; HelpButton maBtnHelp; + + typedef ::std::hash_map DimNameIndexMap; + DimNameIndexMap maNameIndexMap; + ScDPObject& mrDPObj; }; // ============================================================================ diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx index c68baf36ba2b..c52921f7c5de 100644 --- a/sc/source/ui/unoobj/dapiuno.cxx +++ b/sc/source/ui/unoobj/dapiuno.cxx @@ -1626,8 +1626,13 @@ OUString SAL_CALL ScDataPilotFieldObj::getName() throw(RuntimeException) if( pDim->IsDataLayout() ) aName = OUString( RTL_CONSTASCII_USTRINGPARAM( SC_DATALAYOUT_NAME ) ); else - aName = pDim->GetLayoutName(); - } + { + const rtl::OUString* pLayoutName = pDim->GetLayoutName(); + if (pLayoutName) + aName = *pLayoutName; + else + aName = pDim->GetName(); + } } return aName; } @@ -1639,7 +1644,7 @@ void SAL_CALL ScDataPilotFieldObj::setName( const OUString& rName ) throw(Runtim if( pDim && !pDim->IsDataLayout() ) { String aName( rName ); - pDim->SetLayoutName( &aName ); + pDim->SetLayoutName(aName); SetDPObject( pDPObj ); } } diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx index 8dcb47c927a2..41a5e9d0e050 100644 --- a/sc/source/ui/view/dbfunc3.cxx +++ b/sc/source/ui/view/dbfunc3.cxx @@ -91,6 +91,10 @@ using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::UNO_QUERY; using ::com::sun::star::beans::XPropertySet; +using ::com::sun::star::container::XNameAccess; +using ::com::sun::star::sheet::XDimensionsSupplier; +using ::rtl::OUString; +using ::rtl::OUStringBuffer; using ::std::auto_ptr; // STATIC DATA ----------------------------------------------------------- @@ -1351,123 +1355,304 @@ void ScDBFunc::UngroupDataPilot() } } +OUString lcl_replaceMemberNameInSubtotal(const OUString& rSubtotal, const OUString& rMemberName) +{ + sal_Int32 n = rSubtotal.getLength(); + const sal_Unicode* p = rSubtotal.getStr(); + OUStringBuffer aBuf, aWordBuf; + for (sal_Int32 i = 0; i < n; ++i) + { + sal_Unicode c = p[i]; + if (c == sal_Unicode(' ')) + { + OUString aWord = aWordBuf.makeStringAndClear(); + if (aWord.equals(rMemberName)) + aBuf.append(sal_Unicode('?')); + else + aBuf.append(aWord); + aBuf.append(c); + } + else + aWordBuf.append(c); + } + + if (aWordBuf.getLength() > 0) + { + OUString aWord = aWordBuf.makeStringAndClear(); + if (aWord.equals(rMemberName)) + aBuf.append(sal_Unicode('?')); + else + aBuf.append(aWord); + } + + return aBuf.makeStringAndClear(); +} + void ScDBFunc::DataPilotInput( const ScAddress& rPos, const String& rString ) { + using namespace ::com::sun::star::sheet; + String aNewName( rString ); ScDocument* pDoc = GetViewData()->GetDocument(); ScDPObject* pDPObj = pDoc->GetDPAtCursor( rPos.Col(), rPos.Row(), rPos.Tab() ); - if ( pDPObj ) + if (!pDPObj) + return; + + String aOldText; + pDoc->GetString( rPos.Col(), rPos.Row(), rPos.Tab(), aOldText ); + + if ( aOldText == rString ) { - String aOldText; - pDoc->GetString( rPos.Col(), rPos.Row(), rPos.Tab(), aOldText ); + // nothing to do: silently exit + return; + } - if ( aOldText == rString ) + USHORT nErrorId = 0; + + pDPObj->BuildAllDimensionMembers(); + ScDPSaveData aData( *pDPObj->GetSaveData() ); + BOOL bChange = FALSE; + + USHORT nOrient = DataPilotFieldOrientation_HIDDEN; + long nField = pDPObj->GetHeaderDim( rPos, nOrient ); + if ( nField >= 0 ) + { + // changing a field title + if ( aData.GetExistingDimensionData() ) { - // nothing to do: silently exit - return; - } + // only group dimensions can be renamed - USHORT nErrorId = 0; + ScDPDimensionSaveData* pDimData = aData.GetDimensionData(); + ScDPSaveGroupDimension* pGroupDim = pDimData->GetNamedGroupDimAcc( aOldText ); + if ( pGroupDim ) + { + // valid name: not empty, no existing dimension (group or other) + if ( rString.Len() && !pDPObj->IsDimNameInUse(rString) ) + { + pGroupDim->Rename( aNewName ); - ScDPSaveData aData( *pDPObj->GetSaveData() ); - BOOL bChange = FALSE; + // also rename in SaveData to preserve the field settings + ScDPSaveDimension* pSaveDim = aData.GetDimensionByName( aOldText ); + pSaveDim->SetName( aNewName ); - USHORT nOrient = sheet::DataPilotFieldOrientation_HIDDEN; - long nField = pDPObj->GetHeaderDim( rPos, nOrient ); - if ( nField >= 0 ) + bChange = TRUE; + } + else + nErrorId = STR_INVALIDNAME; + } + } + else if (nOrient == DataPilotFieldOrientation_COLUMN || nOrient == DataPilotFieldOrientation_ROW) + { + BOOL bDataLayout = false; + String aDimName = pDPObj->GetDimName(nField, bDataLayout); + ScDPSaveDimension* pDim = bDataLayout ? aData.GetDataLayoutDimension() : aData.GetDimensionByName(aDimName); + if (pDim) + { + if (rString.Len()) + { + if (rString.EqualsIgnoreCaseAscii(aDimName)) + { + pDim->RemoveLayoutName(); + bChange = true; + } + else if (!pDPObj->IsDimNameInUse(rString)) + { + pDim->SetLayoutName(rString); + bChange = true; + } + else + nErrorId = STR_INVALIDNAME; + } + else + nErrorId = STR_INVALIDNAME; + } + } + } + else if (pDPObj->IsDataDescriptionCell(rPos)) + { + // There is only one data dimension. + ScDPSaveDimension* pDim = aData.GetFirstDimension(sheet::DataPilotFieldOrientation_DATA); + if (pDim) { - // changing a field title + if (rString.Len()) + { + if (rString.EqualsIgnoreCaseAscii(pDim->GetName())) + { + pDim->RemoveLayoutName(); + bChange = true; + } + else if (!pDPObj->IsDimNameInUse(rString)) + { + pDim->SetLayoutName(rString); + bChange = true; + } + else + nErrorId = STR_INVALIDNAME; + } + else + nErrorId = STR_INVALIDNAME; + } + } + else + { + // This is not a field header. + sheet::DataPilotTableHeaderData aPosData; + pDPObj->GetHeaderPositionData(rPos, aPosData); - if ( aData.GetExistingDimensionData() ) + if ( (aPosData.Flags & MemberResultFlags::HASMEMBER) && aOldText.Len() ) + { + if ( aData.GetExistingDimensionData() && !(aPosData.Flags & MemberResultFlags::SUBTOTAL)) { - // only group dimensions can be renamed + BOOL bIsDataLayout; + String aDimName = pDPObj->GetDimName( aPosData.Dimension, bIsDataLayout ); ScDPDimensionSaveData* pDimData = aData.GetDimensionData(); - ScDPSaveGroupDimension* pGroupDim = pDimData->GetNamedGroupDimAcc( aOldText ); + ScDPSaveGroupDimension* pGroupDim = pDimData->GetNamedGroupDimAcc( aDimName ); if ( pGroupDim ) { - // valid name: not empty, no existing dimension (group or other) - if ( aNewName.Len() && !pDPObj->IsDimNameInUse( aNewName ) ) + // valid name: not empty, no existing group in this dimension + //! ignore case? + if ( aNewName.Len() && !pGroupDim->GetNamedGroup( aNewName ) ) { - pGroupDim->Rename( aNewName ); + ScDPSaveGroupItem* pGroup = pGroupDim->GetNamedGroupAcc( aOldText ); + if ( pGroup ) + pGroup->Rename( aNewName ); // rename the existing group + else + { + // create a new group to replace the automatic group + ScDPSaveGroupItem aGroup( aNewName ); + aGroup.AddElement( aOldText ); + pGroupDim->AddGroupItem( aGroup ); + } - // also rename in SaveData to preserve the field settings - ScDPSaveDimension* pSaveDim = aData.GetDimensionByName( aOldText ); - pSaveDim->SetName( aNewName ); + // in both cases also adjust savedata, to preserve member settings (show details) + ScDPSaveDimension* pSaveDim = aData.GetDimensionByName( aDimName ); + ScDPSaveMember* pSaveMember = pSaveDim->GetExistingMemberByName( aOldText ); + if ( pSaveMember ) + pSaveMember->SetName( aNewName ); bChange = TRUE; } else nErrorId = STR_INVALIDNAME; - } + } } - } - else - { - // renaming a group (item)? - // allow only on the item name itself - not on empty cells, not on subtotals - - sheet::DataPilotTableHeaderData aPosData; - pDPObj->GetHeaderPositionData(rPos, aPosData); - if ( ( aPosData.Flags & sheet::MemberResultFlags::HASMEMBER ) && - ! ( aPosData.Flags & sheet::MemberResultFlags::SUBTOTAL ) && - aOldText.Len() ) + else if ((aPosData.Flags & MemberResultFlags::GRANDTOTAL)) { - if ( aData.GetExistingDimensionData() ) + aData.SetGrandTotalName(rString); + bChange = true; + } + else if (aPosData.Dimension >= 0 && aPosData.MemberName.getLength() > 0) + { + BOOL bDataLayout = false; + String aDimName = pDPObj->GetDimName(static_cast(aPosData.Dimension), bDataLayout); + if (bDataLayout) { - BOOL bIsDataLayout; - String aDimName = pDPObj->GetDimName( aPosData.Dimension, bIsDataLayout ); + // data dimension + do + { + if ((aPosData.Flags & MemberResultFlags::SUBTOTAL)) + break; + + ScDPSaveDimension* pDim = aData.GetDimensionByName(aPosData.MemberName); + if (!pDim) + break; - ScDPDimensionSaveData* pDimData = aData.GetDimensionData(); - ScDPSaveGroupDimension* pGroupDim = pDimData->GetNamedGroupDimAcc( aDimName ); - if ( pGroupDim ) + if (!rString.Len()) + { + nErrorId = STR_INVALIDNAME; + break; + } + + if (aPosData.MemberName.equalsIgnoreAsciiCase(rString)) + { + pDim->RemoveLayoutName(); + bChange = true; + } + else if (!pDPObj->IsDimNameInUse(rString)) + { + pDim->SetLayoutName(rString); + bChange = true; + } + else + nErrorId = STR_INVALIDNAME; + } + while (false); + } + else + { + // field member + do { - // valid name: not empty, no existing group in this dimension - //! ignore case? - if ( aNewName.Len() && !pGroupDim->GetNamedGroup( aNewName ) ) + ScDPSaveDimension* pDim = aData.GetDimensionByName(aDimName); + if (!pDim) + break; + + ScDPSaveMember* pMem = pDim->GetExistingMemberByName(aPosData.MemberName); + if (!pMem) + break; + + if ((aPosData.Flags & MemberResultFlags::SUBTOTAL)) { - ScDPSaveGroupItem* pGroup = pGroupDim->GetNamedGroupAcc( aOldText ); - if ( pGroup ) - pGroup->Rename( aNewName ); // rename the existing group + // Change subtotal only when the table has one data dimension. + if (aData.GetDataDimensionCount() > 1) + break; + + const OUString* pLayoutName = pMem->GetLayoutName(); + String aMemberName; + if (pLayoutName) + aMemberName = *pLayoutName; else - { - // create a new group to replace the automatic group - ScDPSaveGroupItem aGroup( aNewName ); - aGroup.AddElement( aOldText ); - pGroupDim->AddGroupItem( aGroup ); - } + aMemberName = aPosData.MemberName; - // in both cases also adjust savedata, to preserve member settings (show details) - ScDPSaveDimension* pSaveDim = aData.GetDimensionByName( aDimName ); - ScDPSaveMember* pSaveMember = pSaveDim->GetExistingMemberByName( aOldText ); - if ( pSaveMember ) - pSaveMember->SetName( aNewName ); - - bChange = TRUE; + String aNew = lcl_replaceMemberNameInSubtotal(rString, aMemberName); + pDim->SetSubtotalName(aNew); + bChange = true; } else - nErrorId = STR_INVALIDNAME; + { + // Check to make sure the member name isn't + // already used. + if (rString.Len()) + { + if (rString.EqualsIgnoreCaseAscii(pMem->GetName())) + { + pMem->RemoveLayoutName(); + bChange = true; + } + else if (!pDim->IsMemberNameInUse(rString)) + { + pMem->SetLayoutName(rString); + bChange = true; + } + else + nErrorId = STR_INVALIDNAME; + } + else + nErrorId = STR_INVALIDNAME; + } } + while (false); } } } + } - if ( bChange ) - { - // apply changes - ScDBDocFunc aFunc( *GetViewData()->GetDocShell() ); - ScDPObject* pNewObj = new ScDPObject( *pDPObj ); - pNewObj->SetSaveData( aData ); - aFunc.DataPilotUpdate( pDPObj, pNewObj, TRUE, FALSE ); - delete pNewObj; - } - else - { - if ( !nErrorId ) - nErrorId = STR_ERR_DATAPILOT_INPUT; - ErrorMessage( nErrorId ); - } + if ( bChange ) + { + // apply changes + ScDBDocFunc aFunc( *GetViewData()->GetDocShell() ); + ScDPObject* pNewObj = new ScDPObject( *pDPObj ); + pNewObj->SetSaveData( aData ); + aFunc.DataPilotUpdate( pDPObj, pNewObj, TRUE, FALSE ); + delete pNewObj; + } + else + { + if ( !nErrorId ) + nErrorId = STR_ERR_DATAPILOT_INPUT; + ErrorMessage( nErrorId ); } } -- cgit v1.2.3 From 596c166299cdec53864bb1f8a2f5506a410a8392 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 19 Jun 2009 02:53:11 +0000 Subject: Added new xml token for storing grand totals. --- xmloff/inc/xmloff/xmltoken.hxx | 1 + xmloff/source/core/xmltoken.cxx | 1 + 2 files changed, 2 insertions(+) diff --git a/xmloff/inc/xmloff/xmltoken.hxx b/xmloff/inc/xmloff/xmltoken.hxx index 120a6be84e7a..49dde992bad0 100644 --- a/xmloff/inc/xmloff/xmltoken.hxx +++ b/xmloff/inc/xmloff/xmltoken.hxx @@ -514,6 +514,7 @@ namespace xmloff { namespace token { XML_DATA_LABEL_SYMBOL, XML_DATA_LABEL_TEXT, XML_DATA_PILOT_FIELD, + XML_DATA_PILOT_GRAND_TOTAL, XML_DATA_PILOT_LEVEL, XML_DATA_PILOT_MEMBER, XML_DATA_PILOT_MEMBERS, diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx index 52359e15da3e..badadd466b63 100644 --- a/xmloff/source/core/xmltoken.cxx +++ b/xmloff/source/core/xmltoken.cxx @@ -522,6 +522,7 @@ namespace xmloff { namespace token { TOKEN( "data-label-symbol", XML_DATA_LABEL_SYMBOL ), TOKEN( "data-label-text", XML_DATA_LABEL_TEXT ), TOKEN( "data-pilot-field", XML_DATA_PILOT_FIELD ), + TOKEN( "data-pilot-grand-total", XML_DATA_PILOT_GRAND_TOTAL ), TOKEN( "data-pilot-level", XML_DATA_PILOT_LEVEL ), TOKEN( "data-pilot-member", XML_DATA_PILOT_MEMBER ), TOKEN( "data-pilot-members", XML_DATA_PILOT_MEMBERS ), -- cgit v1.2.3 From 01414574680d3090b3b6631f2956469e023fb0bb Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 19 Jun 2009 02:56:29 +0000 Subject: Store custom display names with ods documents. Note that this relies on proposed file format change that is not yet officially in the ODF spec. --- sc/source/core/data/dptabres.cxx | 14 ++- sc/source/filter/excel/xepivot.cxx | 30 ++++- sc/source/filter/excel/xipivot.cxx | 28 ++++- sc/source/filter/xml/XMLExportDataPilot.cxx | 39 +++++- sc/source/filter/xml/XMLExportDataPilot.hxx | 3 + sc/source/filter/xml/xmldpimp.cxx | 181 +++++++++++++++++++++++++--- sc/source/filter/xml/xmldpimp.hxx | 41 +++++++ sc/source/filter/xml/xmlimprt.cxx | 23 ++++ sc/source/filter/xml/xmlimprt.hxx | 15 ++- sc/source/ui/view/dbfunc3.cxx | 14 ++- 10 files changed, 360 insertions(+), 28 deletions(-) diff --git a/sc/source/core/data/dptabres.cxx b/sc/source/core/data/dptabres.cxx index 07a783bdb2b1..e548db56d7ff 100644 --- a/sc/source/core/data/dptabres.cxx +++ b/sc/source/core/data/dptabres.cxx @@ -1186,20 +1186,28 @@ void ScDPResultMember::ProcessData( const vector& aChildMembers, c } /** - * Parse subtotal string and replace all occurrences of '?' with the - * caption string. + * Parse subtotal string and replace all occurrences of '?' with the caption + * string. Do ensure that escaped characters are not translated. */ static String lcl_parseSubtotalName(const String& rSubStr, const String& rCaption) { String aNewStr; xub_StrLen n = rSubStr.Len(); + bool bEscaped = false; for (xub_StrLen i = 0; i < n; ++i) { sal_Unicode c = rSubStr.GetChar(i); - if (c == sal_Unicode('?')) + if (!bEscaped && c == sal_Unicode('\\')) + { + bEscaped = true; + continue; + } + + if (!bEscaped && c == sal_Unicode('?')) aNewStr.Append(rCaption); else aNewStr.Append(c); + bEscaped = false; } return aNewStr; } diff --git a/sc/source/filter/excel/xepivot.cxx b/sc/source/filter/excel/xepivot.cxx index 78bc0e0b2f99..80af288cce99 100644 --- a/sc/source/filter/excel/xepivot.cxx +++ b/sc/source/filter/excel/xepivot.cxx @@ -1035,6 +1035,31 @@ sal_uInt16 XclExpPTField::GetItemIndex( const String& rName, sal_uInt16 nDefault // fill data -------------------------------------------------------------- +/** + * Calc's subtotal names are escaped with backslashes ('\'), while Excel's + * are not escaped at all. + */ +static OUString lcl_convertCalcSubtotalName(const OUString& rName) +{ + OUStringBuffer aBuf; + const sal_Unicode* p = rName.getStr(); + sal_Int32 n = rName.getLength(); + bool bEscaped = false; + for (sal_Int32 i = 0; i < n; ++i) + { + const sal_Unicode c = p[i]; + if (!bEscaped && c == sal_Unicode('\\')) + { + bEscaped = true; + continue; + } + + aBuf.append(c); + bEscaped = false; + } + return aBuf.makeStringAndClear(); +} + void XclExpPTField::SetPropertiesFromDim( const ScDPSaveDimension& rSaveDim ) { // orientation @@ -1052,7 +1077,10 @@ void XclExpPTField::SetPropertiesFromDim( const ScDPSaveDimension& rSaveDim ) const rtl::OUString* pSubtotalName = rSaveDim.GetSubtotalName(); if (pSubtotalName) - maFieldExtInfo.mpFieldTotalName.reset(new rtl::OUString(*pSubtotalName)); + { + OUString aSubName = lcl_convertCalcSubtotalName(*pSubtotalName); + maFieldExtInfo.mpFieldTotalName.reset(new rtl::OUString(aSubName)); + } // subtotals XclPTSubtotalVec aSubtotals; diff --git a/sc/source/filter/excel/xipivot.cxx b/sc/source/filter/excel/xipivot.cxx index 29e20e52e64a..e6bf8ea01a2f 100644 --- a/sc/source/filter/excel/xipivot.cxx +++ b/sc/source/filter/excel/xipivot.cxx @@ -61,6 +61,7 @@ #include "xltable.hxx" using ::rtl::OUString; +using ::rtl::OUStringBuffer; using ::com::sun::star::sheet::DataPilotFieldOrientation; using ::com::sun::star::sheet::DataPilotFieldOrientation_DATA; using ::com::sun::star::sheet::DataPilotFieldSortInfo; @@ -1029,6 +1030,28 @@ void XclImpPTField::ConvertDataField( ScDPSaveData& rSaveData ) const // private -------------------------------------------------------------------- +/** + * Convert Excel-encoded subtotal name to a Calc-encoded one. + */ +static OUString lcl_convertExcelSubtotalName(const OUString& rName) +{ + OUStringBuffer aBuf; + const sal_Unicode* p = rName.getStr(); + sal_Int32 n = rName.getLength(); + for (sal_Int32 i = 0; i < n; ++i) + { + const sal_Unicode c = p[i]; + if (c == sal_Unicode('\\')) + { + aBuf.append(c); + aBuf.append(c); + } + else + aBuf.append(c); + } + return aBuf.makeStringAndClear(); +} + ScDPSaveDimension* XclImpPTField::ConvertRCPField( ScDPSaveData& rSaveData ) const { const String& rFieldName = GetFieldName(); @@ -1084,7 +1107,10 @@ ScDPSaveDimension* XclImpPTField::ConvertRCPField( ScDPSaveData& rSaveData ) con // custom subtotal name if (maFieldExtInfo.mpFieldTotalName.get()) - rSaveDim.SetSubtotalName(*maFieldExtInfo.mpFieldTotalName); + { + OUString aSubName = lcl_convertExcelSubtotalName(*maFieldExtInfo.mpFieldTotalName); + rSaveDim.SetSubtotalName(aSubName); + } return &rSaveDim; } diff --git a/sc/source/filter/xml/XMLExportDataPilot.cxx b/sc/source/filter/xml/XMLExportDataPilot.cxx index 32cf92e08d1a..318606ca3c49 100644 --- a/sc/source/filter/xml/XMLExportDataPilot.cxx +++ b/sc/source/filter/xml/XMLExportDataPilot.cxx @@ -68,6 +68,7 @@ using namespace com::sun::star; using namespace xmloff::token; +using ::rtl::OUString; ScXMLExportDataPilot::ScXMLExportDataPilot(ScXMLExport& rTempExport) : rExport(rTempExport), @@ -448,7 +449,10 @@ void ScXMLExportDataPilot::WriteLayoutInfo(ScDPSaveDimension* pDim) void ScXMLExportDataPilot::WriteSubTotals(ScDPSaveDimension* pDim) { + using sheet::GeneralFunction; + sal_Int32 nSubTotalCount = pDim->GetSubTotalsCount(); + const OUString* pLayoutName = pDim->GetSubtotalName(); if (nSubTotalCount > 0) { SvXMLElementExport aElemSTs(rExport, XML_NAMESPACE_TABLE, XML_DATA_PILOT_SUBTOTALS, sal_True, sal_True); @@ -456,8 +460,11 @@ void ScXMLExportDataPilot::WriteSubTotals(ScDPSaveDimension* pDim) for (sal_Int32 nSubTotal = 0; nSubTotal < nSubTotalCount; nSubTotal++) { rtl::OUString sFunction; - ScXMLConverter::GetStringFromFunction( sFunction, (sheet::GeneralFunction)pDim->GetSubTotalFunc(nSubTotal) ); + GeneralFunction nFunc = static_cast(pDim->GetSubTotalFunc(nSubTotal)); + ScXMLConverter::GetStringFromFunction( sFunction, nFunc); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_FUNCTION, sFunction); + if (pLayoutName && nFunc == sheet::GeneralFunction_AUTO) + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DISPLAY_NAME, *pLayoutName); SvXMLElementExport aElemST(rExport, XML_NAMESPACE_TABLE, XML_DATA_PILOT_SUBTOTAL, sal_True, sal_True); } } @@ -473,6 +480,9 @@ void ScXMLExportDataPilot::WriteMembers(ScDPSaveDimension* pDim) for (ScDPSaveDimension::MemberList::const_iterator i=rMembers.begin(); i != rMembers.end() ; i++) { rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_NAME, rtl::OUString((*i)->GetName())); + const OUString* pLayoutName = (*i)->GetLayoutName(); + if (pLayoutName) + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DISPLAY_NAME, *pLayoutName); rtl::OUStringBuffer sBuffer; SvXMLUnitConverter::convertBool(sBuffer, (*i)->GetIsVisible()); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DISPLAY, sBuffer.makeStringAndClear()); @@ -670,6 +680,10 @@ void ScXMLExportDataPilot::WriteGroupDimElements(ScDPSaveDimension* pDim, const void ScXMLExportDataPilot::WriteDimension(ScDPSaveDimension* pDim, const ScDPDimensionSaveData* pDimData) { rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_SOURCE_FIELD_NAME, rtl::OUString(pDim->GetName())); + const OUString* pLayoutName = pDim->GetLayoutName(); + if (pLayoutName) + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DISPLAY_NAME, *pLayoutName); + if (pDim->IsDataLayout()) rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_IS_DATA_LAYOUT_FIELD, XML_TRUE); rtl::OUString sValueStr; @@ -707,6 +721,15 @@ void ScXMLExportDataPilot::WriteDimensions(ScDPSaveData* pDPSave) } } +void ScXMLExportDataPilot::WriteGrandTotal(::xmloff::token::XMLTokenEnum eOrient, bool bVisible, const OUString* pGrandTotal) +{ + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DISPLAY, bVisible ? XML_TRUE : XML_FALSE); + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_ORIENTATION, eOrient); + if (pGrandTotal) + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DISPLAY_NAME, *pGrandTotal); + SvXMLElementExport aElemGrandTotal(rExport, XML_NAMESPACE_TABLE, XML_DATA_PILOT_GRAND_TOTAL, sal_True, sal_True); +} + void ScXMLExportDataPilot::WriteDataPilots(const uno::Reference & /* xSpreadDoc */) { pDoc = rExport.GetDocument(); @@ -775,6 +798,20 @@ void ScXMLExportDataPilot::WriteDataPilots(const uno::Reference GetDrillDown()) rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DRILL_DOWN_ON_DOUBLE_CLICK, XML_FALSE); SvXMLElementExport aElemDP(rExport, XML_NAMESPACE_TABLE, XML_DATA_PILOT_TABLE, sal_True, sal_True); + + // grand total elements. + + const OUString* pGrandTotalName = pDPSave->GetGrandTotalName(); + if (bRowGrand && bColumnGrand) + { + WriteGrandTotal(XML_BOTH, true, pGrandTotalName); + } + else + { + WriteGrandTotal(XML_ROW, bRowGrand, pGrandTotalName); + WriteGrandTotal(XML_COLUMN, bColumnGrand, pGrandTotalName); + } + rExport.CheckAttrList(); if ((*pDPs)[i]->IsSheetData()) { diff --git a/sc/source/filter/xml/XMLExportDataPilot.hxx b/sc/source/filter/xml/XMLExportDataPilot.hxx index fb78a59d616b..8bf884ab2fd6 100644 --- a/sc/source/filter/xml/XMLExportDataPilot.hxx +++ b/sc/source/filter/xml/XMLExportDataPilot.hxx @@ -34,6 +34,7 @@ #include #include #include "global.hxx" +#include "xmloff/xmltoken.hxx" class ScXMLExport; class ScDocument; @@ -69,6 +70,8 @@ class ScXMLExportDataPilot void WriteDimension(ScDPSaveDimension* pDim, const ScDPDimensionSaveData* pDimData); void WriteDimensions(ScDPSaveData* pDPSave); + void WriteGrandTotal(::xmloff::token::XMLTokenEnum eOrient, bool bVisible, const ::rtl::OUString* pGrandTotal); + public: ScXMLExportDataPilot(ScXMLExport& rExport); ~ScXMLExportDataPilot(); diff --git a/sc/source/filter/xml/xmldpimp.cxx b/sc/source/filter/xml/xmldpimp.cxx index 428e369a94dc..9cdca232c25a 100644 --- a/sc/source/filter/xml/xmldpimp.cxx +++ b/sc/source/filter/xml/xmldpimp.cxx @@ -65,6 +65,8 @@ using namespace com::sun::star; using namespace xmloff::token; +using ::com::sun::star::uno::Reference; +using ::com::sun::star::xml::sax::XAttributeList; using ::rtl::OUString; //------------------------------------------------------------------ @@ -113,6 +115,9 @@ void ScXMLDataPilotTablesContext::EndElement() { } +ScXMLDataPilotTableContext::GrandTotalItem::GrandTotalItem() : + mbVisible(false) {} + ScXMLDataPilotTableContext::ScXMLDataPilotTableContext( ScXMLImport& rImport, USHORT nPrfx, const ::rtl::OUString& rLName, @@ -159,6 +164,19 @@ ScXMLDataPilotTableContext::ScXMLDataPilotTableContext( ScXMLImport& rImport, case XML_TOK_DATA_PILOT_TABLE_ATTR_GRAND_TOTAL : { sGrandTotal = sValue; + if (IsXMLToken(sValue, XML_BOTH)) + { + maRowGrandTotal.mbVisible = true; + maColGrandTotal.mbVisible = true; + } + else if (IsXMLToken(sValue, XML_ROW)) + { + maRowGrandTotal.mbVisible = true; + } + else if (IsXMLToken(sValue, XML_COLUMN)) + { + maColGrandTotal.mbVisible = true; + } } break; case XML_TOK_DATA_PILOT_TABLE_ATTR_IGNORE_EMPTY_ROWS : @@ -238,6 +256,11 @@ SvXMLImportContext *ScXMLDataPilotTableContext::CreateChildContext( USHORT nPref nSourceType = SERVICE; } break; + case XML_TOK_DATA_PILOT_TABLE_ELEM_GRAND_TOTAL: + { + pContext = new ScXMLDataPilotGrandTotalContext(GetScImport(), nPrefix, rLName, xAttrList, this); + } + break; case XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_CELL_RANGE : { pContext = new ScXMLSourceCellRangeContext(GetScImport(), nPrefix, rLName, xAttrList, this); @@ -362,26 +385,15 @@ void ScXMLDataPilotTableContext::EndElement() } break; } - if (IsXMLToken(sGrandTotal, XML_BOTH)) - { - pDPSave->SetRowGrand(sal_True); - pDPSave->SetColumnGrand(sal_True); - } - else if (IsXMLToken(sGrandTotal, XML_ROW)) - { - pDPSave->SetRowGrand(sal_True); - pDPSave->SetColumnGrand(sal_False); - } - else if (IsXMLToken(sGrandTotal, XML_COLUMN)) - { - pDPSave->SetRowGrand(sal_False); - pDPSave->SetColumnGrand(sal_True); - } - else - { - pDPSave->SetRowGrand(sal_False); - pDPSave->SetColumnGrand(sal_False); - } + + pDPSave->SetRowGrand(maRowGrandTotal.mbVisible); + pDPSave->SetColumnGrand(maColGrandTotal.mbVisible); + if (maRowGrandTotal.maDisplayName.getLength()) + // TODO: Right now, we only support one grand total name for both + // column and row totals. Take the value from the row total for + // now. + pDPSave->SetGrandTotalName(maRowGrandTotal.maDisplayName); + pDPSave->SetIgnoreEmptyRows(bIgnoreEmptyRows); pDPSave->SetRepeatIfEmpty(bIdentifyCategories); pDPSave->SetFilterButton(bShowFilter); @@ -399,6 +411,30 @@ void ScXMLDataPilotTableContext::EndElement() } } +void ScXMLDataPilotTableContext::SetGrandTotal( + XMLTokenEnum eOrientation, bool bVisible, const OUString& rDisplayName) +{ + switch (eOrientation) + { + case XML_BOTH: + maRowGrandTotal.mbVisible = bVisible; + maRowGrandTotal.maDisplayName = rDisplayName; + maColGrandTotal.mbVisible = bVisible; + maColGrandTotal.maDisplayName = rDisplayName; + break; + case XML_ROW: + maRowGrandTotal.mbVisible = bVisible; + maRowGrandTotal.maDisplayName = rDisplayName; + break; + case XML_COLUMN: + maColGrandTotal.mbVisible = bVisible; + maColGrandTotal.maDisplayName = rDisplayName; + break; + default: + ; + } +} + ScXMLDPSourceSQLContext::ScXMLDPSourceSQLContext( ScXMLImport& rImport, USHORT nPrfx, const ::rtl::OUString& rLName, @@ -643,6 +679,80 @@ void ScXMLSourceServiceContext::EndElement() { } +ScXMLImport& ScXMLDataPilotGrandTotalContext::GetScImport() +{ + return static_cast(GetImport()); +} + +ScXMLDataPilotGrandTotalContext::ScXMLDataPilotGrandTotalContext( + ScXMLImport& rImport, USHORT nPrefix, const OUString& rLName, const Reference& xAttrList, + ScXMLDataPilotTableContext* pTableContext ) : + SvXMLImportContext( rImport, nPrefix, rLName ), + mpTableContext(pTableContext), + meOrientation(NONE), + mbVisible(false) +{ + sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; + const SvXMLTokenMap& rAttrTokenMap = GetScImport().GetDataPilotGrandTotalAttrTokenMap(); + for (sal_Int16 i = 0; i < nAttrCount; ++i) + { + const OUString& rAttrName = xAttrList->getNameByIndex(i); + const OUString& rAttrValue = xAttrList->getValueByIndex(i); + + OUString aLocalName; + USHORT nLocalPrefix = GetScImport().GetNamespaceMap().GetKeyByAttrName(rAttrName, &aLocalName); + switch (rAttrTokenMap.Get(nLocalPrefix, aLocalName)) + { + case XML_TOK_DATA_PILOT_GRAND_TOTAL_ATTR_DISPLAY: + mbVisible = IsXMLToken(rAttrValue, XML_TRUE); + break; + case XML_TOK_DATA_PILOT_GRAND_TOTAL_ATTR_ORIENTATION: + if (IsXMLToken(rAttrValue, XML_BOTH)) + meOrientation = BOTH; + else if (IsXMLToken(rAttrValue, XML_ROW)) + meOrientation = ROW; + else if (IsXMLToken(rAttrValue, XML_COLUMN)) + meOrientation = COLUMN; + break; + case XML_TOK_DATA_PILOT_GRAND_TOTAL_ATTR_DISPLAY_NAME: + maDisplayName = rAttrValue; + break; + default: + ; + } + } +} + +ScXMLDataPilotGrandTotalContext::~ScXMLDataPilotGrandTotalContext() +{ +} + +SvXMLImportContext* ScXMLDataPilotGrandTotalContext::CreateChildContext( + USHORT /*nPrefix*/, const ::rtl::OUString& /*rLocalName*/, const Reference& /*xAttrList*/ ) +{ + return NULL; +} + +void ScXMLDataPilotGrandTotalContext::EndElement() +{ + XMLTokenEnum eOrient = XML_NONE; + switch (meOrientation) + { + case BOTH: + eOrient = XML_BOTH; + break; + case ROW: + eOrient = XML_ROW; + break; + case COLUMN: + eOrient = XML_COLUMN; + break; + default: + ; + } + mpTableContext->SetGrandTotal(eOrient, mbVisible, maDisplayName); +} + ScXMLSourceCellRangeContext::ScXMLSourceCellRangeContext( ScXMLImport& rImport, USHORT nPrfx, const ::rtl::OUString& rLName, @@ -727,6 +837,7 @@ ScXMLDataPilotFieldContext::ScXMLDataPilotFieldContext( ScXMLImport& rImport, { sal_Bool bHasName(sal_False); sal_Bool bDataLayout(sal_False); + OUString aDisplayName; sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; const SvXMLTokenMap& rAttrTokenMap = GetScImport().GetDataPilotFieldAttrTokenMap(); for( sal_Int16 i=0; i < nAttrCount; ++i ) @@ -745,6 +856,11 @@ ScXMLDataPilotFieldContext::ScXMLDataPilotFieldContext( ScXMLImport& rImport, bHasName = sal_True; } break; + case XML_TOK_DATA_PILOT_FIELD_ATTR_DISPLAY_NAME: + { + aDisplayName = sValue; + } + break; case XML_TOK_DATA_PILOT_FIELD_ATTR_IS_DATA_LAYOUT_FIELD : { bDataLayout = IsXMLToken(sValue, XML_TRUE); @@ -774,7 +890,11 @@ ScXMLDataPilotFieldContext::ScXMLDataPilotFieldContext( ScXMLImport& rImport, } } if (bHasName) + { pDim = new ScDPSaveDimension(String(sName), bDataLayout); + if (aDisplayName.getLength()) + pDim->SetLayoutName(aDisplayName); + } } ScXMLDataPilotFieldContext::~ScXMLDataPilotFieldContext() @@ -875,6 +995,12 @@ void ScXMLDataPilotFieldContext::EndElement() } } +void ScXMLDataPilotFieldContext::SetSubTotalName(const OUString& rName) +{ + if (pDim) + pDim->SetSubtotalName(rName); +} + ScXMLDataPilotFieldReferenceContext::ScXMLDataPilotFieldReferenceContext( ScXMLImport& rImport, USHORT nPrfx, const ::rtl::OUString& rLName, const uno::Reference& xAttrList, @@ -1199,6 +1325,8 @@ SvXMLImportContext *ScXMLDataPilotSubTotalsContext::CreateChildContext( USHORT n void ScXMLDataPilotSubTotalsContext::EndElement() { pDataPilotField->SetSubTotals(pFunctions, nFunctionCount); + if (maDisplayName.getLength()) + pDataPilotField->SetSubTotalName(maDisplayName); } void ScXMLDataPilotSubTotalsContext::AddFunction(sal_Int16 nFunction) @@ -1221,6 +1349,11 @@ void ScXMLDataPilotSubTotalsContext::AddFunction(sal_Int16 nFunction) } } +void ScXMLDataPilotSubTotalsContext::SetDisplayName(const OUString& rName) +{ + maDisplayName = rName; +} + ScXMLDataPilotSubTotalContext::ScXMLDataPilotSubTotalContext( ScXMLImport& rImport, USHORT nPrfx, const ::rtl::OUString& rLName, @@ -1247,6 +1380,8 @@ ScXMLDataPilotSubTotalContext::ScXMLDataPilotSubTotalContext( ScXMLImport& rImpo pDataPilotSubTotals->AddFunction( sal::static_int_cast( ScXMLConverter::GetFunctionFromString( sValue ) ) ); } + case XML_TOK_DATA_PILOT_SUBTOTAL_ATTR_DISPLAY_NAME: + pDataPilotSubTotals->SetDisplayName(sValue); break; } } @@ -1344,6 +1479,10 @@ ScXMLDataPilotMemberContext::ScXMLDataPilotMemberContext( ScXMLImport& rImport, bHasName = sal_True; } break; + case XML_TOK_DATA_PILOT_MEMBER_ATTR_DISPLAY_NAME: + { + maDisplayName = sValue; + } case XML_TOK_DATA_PILOT_MEMBER_ATTR_DISPLAY : { bDisplay = IsXMLToken(sValue, XML_TRUE); @@ -1380,6 +1519,8 @@ void ScXMLDataPilotMemberContext::EndElement() if (bHasName) // #i53407# don't check sName, empty name is allowed { ScDPSaveMember* pMember = new ScDPSaveMember(String(sName)); + if (maDisplayName.getLength()) + pMember->SetLayoutName(maDisplayName); pMember->SetIsVisible(bDisplay); pMember->SetShowDetails(bDisplayDetails); pDataPilotField->AddMember(pMember); diff --git a/sc/source/filter/xml/xmldpimp.hxx b/sc/source/filter/xml/xmldpimp.hxx index 874fe27654ba..fee4e36c02e5 100644 --- a/sc/source/filter/xml/xmldpimp.hxx +++ b/sc/source/filter/xml/xmldpimp.hxx @@ -79,10 +79,18 @@ public: class ScXMLDataPilotTableContext : public SvXMLImportContext { + struct GrandTotalItem + { + ::rtl::OUString maDisplayName; + bool mbVisible; + GrandTotalItem(); + }; ScDocument* pDoc; ScDPObject* pDPObject; ScDPSaveData* pDPSave; ScDPDimensionSaveData* pDPDimSaveData; + GrandTotalItem maRowGrandTotal; + GrandTotalItem maColGrandTotal; rtl::OUString sDataPilotTableName; rtl::OUString sApplicationData; rtl::OUString sGrandTotal; @@ -131,6 +139,7 @@ public: virtual void EndElement(); + void SetGrandTotal(::xmloff::token::XMLTokenEnum eOrientation, bool bVisible, const ::rtl::OUString& rDisplayName); void SetDatabaseName(const rtl::OUString& sValue) { sDatabaseName = sValue; } void SetSourceObject(const rtl::OUString& sValue) { sSourceObject = sValue; } void SetNative(const sal_Bool bValue) { bIsNative = bValue; } @@ -253,6 +262,34 @@ public: virtual void EndElement(); }; +class ScXMLDataPilotGrandTotalContext : public SvXMLImportContext +{ + enum Orientation { COLUMN, ROW, BOTH, NONE }; + + ScXMLImport& GetScImport(); + + ScXMLDataPilotTableContext* mpTableContext; + ::rtl::OUString maDisplayName; + Orientation meOrientation; + bool mbVisible; + +public: + ScXMLDataPilotGrandTotalContext( + ScXMLImport& rImport, USHORT nPrefix, const ::rtl::OUString& rLName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XAttributeList>& xAttrList, + ScXMLDataPilotTableContext* pTableContext ); + + virtual ~ScXMLDataPilotGrandTotalContext(); + + 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(); +}; + class ScXMLSourceCellRangeContext : public SvXMLImportContext { ScXMLDataPilotTableContext* pDataPilotTable; @@ -329,6 +366,7 @@ public: void SetShowEmpty(const sal_Bool bValue) { if (pDim) pDim->SetShowEmpty(bValue); } void SetSubTotals(const sal_uInt16* pFunctions, const sal_Int16 nCount) { if(pDim) pDim->SetSubTotals(nCount, pFunctions); } + void SetSubTotalName(const ::rtl::OUString& rName); void AddMember(ScDPSaveMember* pMember) { if (pDim) pDim->AddMember(pMember); } void SetFieldReference(const com::sun::star::sheet::DataPilotFieldReference& aRef) { if (pDim) pDim->SetReferenceValue(&aRef); } void SetAutoShowInfo(const com::sun::star::sheet::DataPilotFieldAutoShowInfo& aInfo) { if (pDim) pDim->SetAutoShowInfo(&aInfo); } @@ -453,6 +491,7 @@ class ScXMLDataPilotSubTotalsContext : public SvXMLImportContext sal_Int16 nFunctionCount; sal_uInt16* pFunctions; + ::rtl::OUString maDisplayName; const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); } ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); } @@ -476,6 +515,7 @@ public: virtual void EndElement(); void AddFunction(sal_Int16 nFunction); + void SetDisplayName(const ::rtl::OUString& rName); }; class ScXMLDataPilotSubTotalContext : public SvXMLImportContext @@ -533,6 +573,7 @@ class ScXMLDataPilotMemberContext : public SvXMLImportContext ScXMLDataPilotFieldContext* pDataPilotField; rtl::OUString sName; + rtl::OUString maDisplayName; sal_Bool bDisplay; sal_Bool bDisplayDetails; sal_Bool bHasName; diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index 873e95168088..f025a97ce5ae 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -1344,6 +1344,7 @@ const SvXMLTokenMap& ScXMLImport::GetDataPilotTableElemTokenMap() { { XML_NAMESPACE_TABLE, XML_DATABASE_SOURCE_SQL, XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_SQL }, { XML_NAMESPACE_TABLE, XML_DATABASE_SOURCE_TABLE, XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_TABLE }, + { XML_NAMESPACE_TABLE, XML_DATA_PILOT_GRAND_TOTAL, XML_TOK_DATA_PILOT_TABLE_ELEM_GRAND_TOTAL }, { XML_NAMESPACE_TABLE, XML_DATABASE_SOURCE_QUERY, XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_QUERY }, { XML_NAMESPACE_TABLE, XML_SOURCE_SERVICE, XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_SERVICE }, { XML_NAMESPACE_TABLE, XML_SOURCE_CELL_RANGE, XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_CELL_RANGE }, @@ -1377,6 +1378,24 @@ const SvXMLTokenMap& ScXMLImport::GetDataPilotTableSourceServiceAttrTokenMap() return *pDataPilotTableSourceServiceAttrTokenMap; } +const SvXMLTokenMap& ScXMLImport::GetDataPilotGrandTotalAttrTokenMap() +{ + if (!pDataPilotGrandTotalAttrTokenMap) + { + static __FAR_DATA SvXMLTokenMapEntry aDataPilotGrandTotalAttrTokenMap[] = + { + { XML_NAMESPACE_TABLE, XML_DISPLAY, XML_TOK_DATA_PILOT_GRAND_TOTAL_ATTR_DISPLAY }, + { XML_NAMESPACE_TABLE, XML_ORIENTATION, XML_TOK_DATA_PILOT_GRAND_TOTAL_ATTR_ORIENTATION }, + { XML_NAMESPACE_TABLE, XML_DISPLAY_NAME, XML_TOK_DATA_PILOT_GRAND_TOTAL_ATTR_DISPLAY_NAME }, + XML_TOKEN_MAP_END + }; + + pDataPilotGrandTotalAttrTokenMap = new SvXMLTokenMap( aDataPilotGrandTotalAttrTokenMap ); + } + + return *pDataPilotGrandTotalAttrTokenMap; +} + const SvXMLTokenMap& ScXMLImport::GetDataPilotTableSourceCellRangeAttrTokenMap() { if( !pDataPilotTableSourceCellRangeAttrTokenMap ) @@ -1416,6 +1435,7 @@ const SvXMLTokenMap& ScXMLImport::GetDataPilotFieldAttrTokenMap() static __FAR_DATA SvXMLTokenMapEntry aDataPilotFieldAttrTokenMap[] = { { XML_NAMESPACE_TABLE, XML_SOURCE_FIELD_NAME, XML_TOK_DATA_PILOT_FIELD_ATTR_SOURCE_FIELD_NAME }, + { XML_NAMESPACE_TABLE, XML_DISPLAY_NAME, XML_TOK_DATA_PILOT_FIELD_ATTR_DISPLAY_NAME }, { XML_NAMESPACE_TABLE, XML_IS_DATA_LAYOUT_FIELD, XML_TOK_DATA_PILOT_FIELD_ATTR_IS_DATA_LAYOUT_FIELD }, { XML_NAMESPACE_TABLE, XML_FUNCTION, XML_TOK_DATA_PILOT_FIELD_ATTR_FUNCTION }, { XML_NAMESPACE_TABLE, XML_ORIENTATION, XML_TOK_DATA_PILOT_FIELD_ATTR_ORIENTATION }, @@ -1507,6 +1527,7 @@ const SvXMLTokenMap& ScXMLImport::GetDataPilotSubTotalAttrTokenMap() static __FAR_DATA SvXMLTokenMapEntry aDataPilotSubTotalAttrTokenMap[] = { { XML_NAMESPACE_TABLE, XML_FUNCTION, XML_TOK_DATA_PILOT_SUBTOTAL_ATTR_FUNCTION }, + { XML_NAMESPACE_TABLE, XML_DISPLAY_NAME, XML_TOK_DATA_PILOT_SUBTOTAL_ATTR_DISPLAY_NAME }, XML_TOKEN_MAP_END }; @@ -1539,6 +1560,7 @@ const SvXMLTokenMap& ScXMLImport::GetDataPilotMemberAttrTokenMap() static __FAR_DATA SvXMLTokenMapEntry aDataPilotMemberAttrTokenMap[] = { { XML_NAMESPACE_TABLE, XML_NAME, XML_TOK_DATA_PILOT_MEMBER_ATTR_NAME }, + { XML_NAMESPACE_TABLE, XML_DISPLAY_NAME, XML_TOK_DATA_PILOT_MEMBER_ATTR_DISPLAY_NAME }, { XML_NAMESPACE_TABLE, XML_DISPLAY, XML_TOK_DATA_PILOT_MEMBER_ATTR_DISPLAY }, { XML_NAMESPACE_TABLE, XML_SHOW_DETAILS, XML_TOK_DATA_PILOT_MEMBER_ATTR_SHOW_DETAILS }, XML_TOKEN_MAP_END @@ -1674,6 +1696,7 @@ ScXMLImport::ScXMLImport( pDataPilotTableAttrTokenMap( 0 ), pDataPilotTableElemTokenMap( 0 ), pDataPilotTableSourceServiceAttrTokenMap( 0 ), + pDataPilotGrandTotalAttrTokenMap(NULL), pDataPilotTableSourceCellRangeElemTokenMap( 0 ), pDataPilotTableSourceCellRangeAttrTokenMap( 0 ), pDataPilotFieldAttrTokenMap( 0 ), diff --git a/sc/source/filter/xml/xmlimprt.hxx b/sc/source/filter/xml/xmlimprt.hxx index 052ef20c6022..ec8a9cd6640b 100644 --- a/sc/source/filter/xml/xmlimprt.hxx +++ b/sc/source/filter/xml/xmlimprt.hxx @@ -489,6 +489,7 @@ enum ScXMLDataPilotTableElemTokens { XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_SQL, XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_TABLE, + XML_TOK_DATA_PILOT_TABLE_ELEM_GRAND_TOTAL, XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_QUERY, XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_SERVICE, XML_TOK_DATA_PILOT_TABLE_ELEM_SOURCE_CELL_RANGE, @@ -504,6 +505,13 @@ enum ScXMLDataPilotTableSourceServiceAttrTokens XML_TOK_SOURCE_SERVICE_ATTR_PASSWORD }; +enum ScXMLDataPilotGrandTotalAttrTokens +{ + XML_TOK_DATA_PILOT_GRAND_TOTAL_ATTR_DISPLAY, + XML_TOK_DATA_PILOT_GRAND_TOTAL_ATTR_ORIENTATION, + XML_TOK_DATA_PILOT_GRAND_TOTAL_ATTR_DISPLAY_NAME +}; + enum ScXMLDataPilotTableSourceCellRangeElemTokens { XML_TOK_SOURCE_CELL_RANGE_ELEM_FILTER @@ -517,6 +525,7 @@ enum ScXMLDataPilotTableSourceCellRangeAttrTokens enum ScXMLDataPilotFieldAttrTokens { XML_TOK_DATA_PILOT_FIELD_ATTR_SOURCE_FIELD_NAME, + XML_TOK_DATA_PILOT_FIELD_ATTR_DISPLAY_NAME, XML_TOK_DATA_PILOT_FIELD_ATTR_IS_DATA_LAYOUT_FIELD, XML_TOK_DATA_PILOT_FIELD_ATTR_FUNCTION, XML_TOK_DATA_PILOT_FIELD_ATTR_ORIENTATION, @@ -552,7 +561,8 @@ enum ScXMLDataPilotSubTotalsElemTokens enum ScXMLDataPilotSubTotalAttrTokens { - XML_TOK_DATA_PILOT_SUBTOTAL_ATTR_FUNCTION + XML_TOK_DATA_PILOT_SUBTOTAL_ATTR_FUNCTION, + XML_TOK_DATA_PILOT_SUBTOTAL_ATTR_DISPLAY_NAME }; enum ScXMLDataPilotMembersElemTokens @@ -563,6 +573,7 @@ enum ScXMLDataPilotMembersElemTokens enum ScXMLDataPilotMemberAttrTokens { XML_TOK_DATA_PILOT_MEMBER_ATTR_NAME, + XML_TOK_DATA_PILOT_MEMBER_ATTR_DISPLAY_NAME, XML_TOK_DATA_PILOT_MEMBER_ATTR_DISPLAY, XML_TOK_DATA_PILOT_MEMBER_ATTR_SHOW_DETAILS }; @@ -719,6 +730,7 @@ class ScXMLImport: public SvXMLImport SvXMLTokenMap *pDataPilotTableAttrTokenMap; SvXMLTokenMap *pDataPilotTableElemTokenMap; SvXMLTokenMap *pDataPilotTableSourceServiceAttrTokenMap; + SvXMLTokenMap *pDataPilotGrandTotalAttrTokenMap; SvXMLTokenMap *pDataPilotTableSourceCellRangeElemTokenMap; SvXMLTokenMap *pDataPilotTableSourceCellRangeAttrTokenMap; SvXMLTokenMap *pDataPilotFieldAttrTokenMap; @@ -882,6 +894,7 @@ public: const SvXMLTokenMap& GetDataPilotTableAttrTokenMap(); const SvXMLTokenMap& GetDataPilotTableElemTokenMap(); const SvXMLTokenMap& GetDataPilotTableSourceServiceAttrTokenMap(); + const SvXMLTokenMap& GetDataPilotGrandTotalAttrTokenMap(); const SvXMLTokenMap& GetDataPilotTableSourceCellRangeElemTokenMap(); const SvXMLTokenMap& GetDataPilotTableSourceCellRangeAttrTokenMap(); const SvXMLTokenMap& GetDataPilotFieldAttrTokenMap(); diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx index 41a5e9d0e050..c71bc31a1150 100644 --- a/sc/source/ui/view/dbfunc3.cxx +++ b/sc/source/ui/view/dbfunc3.cxx @@ -1355,7 +1355,7 @@ void ScDBFunc::UngroupDataPilot() } } -OUString lcl_replaceMemberNameInSubtotal(const OUString& rSubtotal, const OUString& rMemberName) +static OUString lcl_replaceMemberNameInSubtotal(const OUString& rSubtotal, const OUString& rMemberName) { sal_Int32 n = rSubtotal.getLength(); const sal_Unicode* p = rSubtotal.getStr(); @@ -1372,6 +1372,18 @@ OUString lcl_replaceMemberNameInSubtotal(const OUString& rSubtotal, const OUStri aBuf.append(aWord); aBuf.append(c); } + else if (c == sal_Unicode('\\')) + { + // Escape a backslash character. + aWordBuf.append(c); + aWordBuf.append(c); + } + else if (c == sal_Unicode('?')) + { + // A literal '?' must be escaped with a backslash ('\'); + aWordBuf.append(sal_Unicode('\\')); + aWordBuf.append(c); + } else aWordBuf.append(c); } -- cgit v1.2.3 From b4249adba8d9ad20b16b1b0d0a9beb5aaa47ba5d Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 19 Jun 2009 15:19:28 +0000 Subject: Re-activate imports of hidden fields from xls per Daniel's input. --- sc/source/filter/excel/xipivot.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sc/source/filter/excel/xipivot.cxx b/sc/source/filter/excel/xipivot.cxx index e6bf8ea01a2f..fd7622cce7c0 100644 --- a/sc/source/filter/excel/xipivot.cxx +++ b/sc/source/filter/excel/xipivot.cxx @@ -1374,14 +1374,15 @@ void XclImpPivotTable::Convert() if( const XclImpPTField* pField = GetField( *aIt ) ) pField->ConvertPageField( aSaveData ); -#if 0 // Why do we do this ??? + // We need to import hidden fields because hidden fields may contain + // special settings for subtotals (aggregation function, filters, custom + // name etc.) and members (hidden, custom name etc.). // hidden fields for( sal_uInt16 nField = 0, nCount = GetFieldCount(); nField < nCount; ++nField ) if( const XclImpPTField* pField = GetField( nField ) ) if( (pField->GetAxes() & EXC_SXVD_AXIS_ROWCOLPAGE) == 0 ) pField->ConvertHiddenField( aSaveData ); -#endif // data fields for( aIt = maFiltDataFields.begin(), aEnd = maFiltDataFields.end(); aIt != aEnd; ++aIt ) -- cgit v1.2.3 From 81d6b090a680d432e33e4de4be9906043eed1139 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 19 Jun 2009 19:51:20 +0000 Subject: #i100619# initial commit of patches from ooo-build that implement new datapilot field popup window. --- sc/inc/attrib.hxx | 16 +- sc/inc/dpobject.hxx | 5 + sc/inc/dpoutput.hxx | 3 +- sc/inc/dpoutputgeometry.hxx | 75 +++ sc/inc/dpsave.hxx | 11 + sc/inc/dptabsrc.hxx | 1 + sc/inc/fillinfo.hxx | 2 + sc/inc/global.hxx | 2 - sc/inc/pivot.hxx | 17 +- sc/inc/sc.hrc | 2 + sc/inc/scabstdlg.hxx | 2 +- sc/inc/unonames.hxx | 1 + sc/source/core/data/documen8.cxx | 10 +- sc/source/core/data/dpobject.cxx | 63 +- sc/source/core/data/dpoutput.cxx | 44 +- sc/source/core/data/dpoutputgeometry.cxx | 211 +++++++ sc/source/core/data/dpsave.cxx | 52 +- sc/source/core/data/dptabsrc.cxx | 8 +- sc/source/core/data/fillinfo.cxx | 8 +- sc/source/core/data/global2.cxx | 49 +- sc/source/core/data/makefile.mk | 2 + sc/source/core/data/pivot2.cxx | 9 +- sc/source/filter/excel/xipivot.cxx | 74 ++- sc/source/filter/inc/xipivot.hxx | 2 + sc/source/filter/xml/xmldpimp.cxx | 83 ++- sc/source/filter/xml/xmldpimp.hxx | 26 +- sc/source/ui/cctrl/dpcontrol.cxx | 1009 ++++++++++++++++++++++++++++++ sc/source/ui/cctrl/dpcontrol.src | 49 ++ sc/source/ui/cctrl/makefile.mk | 10 +- sc/source/ui/dbgui/pvlaydlg.cxx | 35 +- sc/source/ui/docshell/dbdocfun.cxx | 4 +- sc/source/ui/inc/dbfunc.hxx | 1 + sc/source/ui/inc/dpcontrol.hrc | 40 ++ sc/source/ui/inc/dpcontrol.hxx | 289 +++++++++ sc/source/ui/inc/gridwin.hxx | 15 + sc/source/ui/inc/pvlaydlg.hxx | 2 +- sc/source/ui/undo/undodat.cxx | 4 +- sc/source/ui/view/dbfunc3.cxx | 137 ++++ sc/source/ui/view/gridwin.cxx | 2 + sc/source/ui/view/gridwin2.cxx | 202 +++++- sc/source/ui/view/gridwin4.cxx | 17 +- sc/util/makefile.mk | 1 + 42 files changed, 2449 insertions(+), 146 deletions(-) create mode 100644 sc/inc/dpoutputgeometry.hxx create mode 100644 sc/source/core/data/dpoutputgeometry.cxx create mode 100644 sc/source/ui/cctrl/dpcontrol.cxx create mode 100644 sc/source/ui/cctrl/dpcontrol.src create mode 100644 sc/source/ui/inc/dpcontrol.hrc create mode 100644 sc/source/ui/inc/dpcontrol.hxx diff --git a/sc/inc/attrib.hxx b/sc/inc/attrib.hxx index cae72cf30cf5..e7e28083dec2 100644 --- a/sc/inc/attrib.hxx +++ b/sc/inc/attrib.hxx @@ -42,13 +42,16 @@ // Flags fuer durch Merge verdeckte Zellen // und Control fuer Auto-Filter -#define SC_MF_HOR 1 -#define SC_MF_VER 2 -#define SC_MF_AUTO 4 -#define SC_MF_BUTTON 8 -#define SC_MF_SCENARIO 16 +#define SC_MF_HOR 0x0001 +#define SC_MF_VER 0x0002 +#define SC_MF_AUTO 0x0004 /// autofilter arrow +#define SC_MF_BUTTON 0x0008 /// field button for datapilot +#define SC_MF_SCENARIO 0x0010 +#define SC_MF_BUTTON_POPUP 0x0020 /// dp button with popup arrow +#define SC_MF_HIDDEN_MEMBER 0x0040 /// dp field button with presence of hidden member +#define SC_MF_DP_TABLE 0x0080 /// dp table output -#define SC_MF_ALL 31 +#define SC_MF_ALL 0x00FF class EditTextObject; @@ -103,6 +106,7 @@ public: BOOL HasAutoFilter() const { return ( GetValue() & SC_MF_AUTO ) != 0; } BOOL HasButton() const { return ( GetValue() & SC_MF_BUTTON ) != 0; } + bool HasDPTable() const { return ( GetValue() & SC_MF_DP_TABLE ) != 0; } BOOL IsScenario() const { return ( GetValue() & SC_MF_SCENARIO ) != 0; } }; diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx index f90277769cba..ea0093119f88 100644 --- a/sc/inc/dpobject.hxx +++ b/sc/inc/dpobject.hxx @@ -316,6 +316,11 @@ public: ScSimpleSharedString& GetSharedString(); + void FreeTable(ScDPObject* pDPObj); + SC_DLLPUBLIC bool InsertNewTable(ScDPObject* pDPObj); + + bool HasDPTable(SCCOL nCol, SCROW nRow, SCTAB nTab) const; + ScDPCacheCell* getCacheCellFromPool(const ScDPCacheCell& rCell); void clearCacheCellPool(); }; diff --git a/sc/inc/dpoutput.hxx b/sc/inc/dpoutput.hxx index 65108761b2ec..e3ab86423d4b 100644 --- a/sc/inc/dpoutput.hxx +++ b/sc/inc/dpoutput.hxx @@ -94,6 +94,7 @@ private: com::sun::star::uno::Sequence< com::sun::star::sheet::DataResult> > aData; BOOL bResultsError; + bool mbHasDataLayout; String aDataDescription; // Number format related parameters @@ -125,7 +126,7 @@ private: const com::sun::star::sheet::MemberResult& rData, BOOL bColHeader, long nLevel ); void FieldCell( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rCaption, - BOOL bFrame = TRUE ); + bool bInTable, bool bPopup, bool bHasHiddenMember ); void CalcSizes(); /** Query which sub-area of the table the cell is in. See diff --git a/sc/inc/dpoutputgeometry.hxx b/sc/inc/dpoutputgeometry.hxx new file mode 100644 index 000000000000..dcf98f8f4ade --- /dev/null +++ b/sc/inc/dpoutputgeometry.hxx @@ -0,0 +1,75 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: xmldpimp.cxx,v $ + * $Revision: 1.27.134.1 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_DPOUTPUTGEOMETRY_HXX +#define SC_DPOUTPUTGEOMETRY_HXX + +#include "address.hxx" +#include + +class ScAddress; + +class SC_DLLPUBLIC ScDPOutputGeometry +{ +public: + enum FieldType { Column, Row, Page, Data, None }; + + ScDPOutputGeometry(const ScRange& rOutRange, bool bShowFilter); + ~ScDPOutputGeometry(); + + /** + * @param nCount number of row fields, excluding the data layout + * field if exists. + */ + void setRowFieldCount(sal_uInt32 nCount); + void setColumnFieldCount(sal_uInt32 nCount); + void setPageFieldCount(sal_uInt32 nCount); + void setDataFieldCount(sal_uInt32 nCount); + + void getColumnFieldPositions(::std::vector& rAddrs) const; + void getRowFieldPositions(::std::vector& rAddrs) const; + void getPageFieldPositions(::std::vector& rAddrs) const; + + FieldType getFieldButtonType(const ScAddress& rPos) const; + +private: + ScDPOutputGeometry(); // disabled + +private: + ScRange maOutRange; + sal_uInt32 mnRowFields; + sal_uInt32 mnColumnFields; + sal_uInt32 mnPageFields; + sal_uInt32 mnDataFields; + + bool mbShowFilter; +}; + +#endif diff --git a/sc/inc/dpsave.hxx b/sc/inc/dpsave.hxx index 9d680dfa3856..e8a7420ffcbc 100644 --- a/sc/inc/dpsave.hxx +++ b/sc/inc/dpsave.hxx @@ -179,6 +179,10 @@ public: void WriteToSource( const com::sun::star::uno::Reference< com::sun::star::uno::XInterface>& xDim ); + + void UpdateMemberVisibility(const ::std::hash_map< ::rtl::OUString, bool, ::rtl::OUStringHash>& rData); + + bool HasInvisibleMember() const; }; @@ -256,6 +260,13 @@ public: SC_DLLPUBLIC ScDPDimensionSaveData* GetDimensionData(); // create if not there void SetDimensionData( const ScDPDimensionSaveData* pNew ); // copied void BuildAllDimensionMembers(ScDPTableData* pData); + + /** + * Check whether a dimension has one or more invisible members. + * + * @param rDimName dimension name + */ + SC_DLLPUBLIC bool HasInvisibleMember(const ::rtl::OUString& rDimName) const; }; diff --git a/sc/inc/dptabsrc.hxx b/sc/inc/dptabsrc.hxx index 5538959b2dfc..2293135f9c11 100644 --- a/sc/inc/dptabsrc.hxx +++ b/sc/inc/dptabsrc.hxx @@ -348,6 +348,7 @@ private: BOOL bHasSelectedPage; String aSelectedPage; ScDPItemData* pSelectedData; // internal, temporary, created from aSelectedPage + sal_Bool mbHasHiddenMember; public: ScDPDimension( ScDPSource* pSrc, long nD ); diff --git a/sc/inc/fillinfo.hxx b/sc/inc/fillinfo.hxx index b6d48254d06a..d0be5b0cb897 100644 --- a/sc/inc/fillinfo.hxx +++ b/sc/inc/fillinfo.hxx @@ -99,6 +99,8 @@ struct CellInfo BOOL bVOverlapped : 1; BOOL bAutoFilter : 1; BOOL bPushButton : 1; + bool bPopupButton: 1; + bool bFilterActive:1; BOOL bPrinted : 1; // bei Bedarf (Pagebreak-Modus) diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx index 45df07deaf6c..408b77c4516c 100644 --- a/sc/inc/global.hxx +++ b/sc/inc/global.hxx @@ -93,8 +93,6 @@ extern "C" { // handling code. #define OLD_PIVOT_IMPLEMENTATION 0 -//------------------------------------------------------------------------ -struct LabelData; //------------------------------------------------------------------------ // die 1000 Namen des Calc... diff --git a/sc/inc/pivot.hxx b/sc/inc/pivot.hxx index 66e87facfd9a..e2b8ef3e01fa 100644 --- a/sc/inc/pivot.hxx +++ b/sc/inc/pivot.hxx @@ -53,6 +53,7 @@ #include "address.hxx" #include +#include class SubTotal; #include "collect.hxx" @@ -80,7 +81,9 @@ class ScUserListData; class ScMultipleReadHeader; class ScMultipleWriteHeader; class ScProgress; -struct LabelData; +struct ScDPLabelData; + +typedef ::boost::shared_ptr ScDPLabelDataRef; // ----------------------------------------------------------------------- @@ -104,8 +107,7 @@ struct ScPivotParam SCCOL nCol; // Cursor Position / SCROW nRow; // bzw. Anfang des Zielbereiches SCTAB nTab; - LabelData** ppLabelArr; - SCSIZE nLabels; + ::std::vector maLabelArray; PivotField aPageArr[PIVOT_MAXPAGEFIELD]; PivotField aColArr[PIVOT_MAXFIELD]; PivotField aRowArr[PIVOT_MAXFIELD]; @@ -126,10 +128,8 @@ struct ScPivotParam ScPivotParam& operator= ( const ScPivotParam& r ); BOOL operator== ( const ScPivotParam& r ) const; void Clear (); - void ClearLabelData (); void ClearPivotArrays(); - void SetLabelData ( LabelData** ppLabArr, - SCSIZE nLab ); + void SetLabelData (const ::std::vector& r); void SetPivotArrays ( const PivotField* pPageArr, const PivotField* pColArr, const PivotField* pRowArr, @@ -366,7 +366,7 @@ public: //------------------------------------------------------------------------ -struct LabelData +struct ScDPLabelData { String maName; /// Visible name of the dimension. SCsCOL mnCol; @@ -383,7 +383,7 @@ struct LabelData ::com::sun::star::sheet::DataPilotFieldLayoutInfo maLayoutInfo; /// Layout info. ::com::sun::star::sheet::DataPilotFieldAutoShowInfo maShowInfo; /// AutoShow info. - explicit LabelData( const String& rName, short nCol, bool bIsValue ); + explicit ScDPLabelData( const String& rName, short nCol, bool bIsValue ); }; // ============================================================================ @@ -401,7 +401,6 @@ struct ScDPFuncData // ============================================================================ -typedef LabelData ScDPLabelData; typedef std::vector< ScDPLabelData > ScDPLabelDataVec; typedef std::vector< String > ScDPNameVec; diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index 35b6a403816d..13d8481fce16 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -1631,6 +1631,8 @@ #define RID_SCDLG_CONFLICTS (SC_DIALOGS_START + 145) #define RID_SCDLG_SHAREDOCUMENT (SC_DIALOGS_START + 146) +#define RID_POPUP_FILTER (SC_DIALOGS_START + 147) + #define SC_DIALOGS_END (SC_DIALOGS_START + 150) #ifndef STD_MASKCOLOR diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx index ec381ce2ef07..e894ff96b98a 100644 --- a/sc/inc/scabstdlg.hxx +++ b/sc/inc/scabstdlg.hxx @@ -235,7 +235,7 @@ class AbstractScDPSubtotalDlg : public VclAbstractDialog //add for ScDPSubtotal { public: virtual USHORT GetFuncMask() const = 0; - virtual void FillLabelData( LabelData& rLabelData ) const = 0; + virtual void FillLabelData( ScDPLabelData& rLabelData ) const = 0; }; class AbstractScDPNumGroupDlg : public VclAbstractDialog diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx index bfc5aa9de831..83307c768563 100644 --- a/sc/inc/unonames.hxx +++ b/sc/inc/unonames.hxx @@ -561,6 +561,7 @@ #define SC_UNO_LAYOUTNAME "LayoutName" #define SC_UNO_FIELD_SUBTOTALNAME "FieldSubtotalName" #define SC_UNO_GRANDTOTAL_NAME "GrandTotalName" +#define SC_UNO_HAS_HIDDEN_MEMBER "HasHiddenMember" // (preliminary:) #define SC_UNO_REFVALUE "ReferenceValue" diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx index 0d12c82dec87..0bb3f96b0ca3 100644 --- a/sc/source/core/data/documen8.cxx +++ b/sc/source/core/data/documen8.cxx @@ -95,6 +95,7 @@ #include "globstr.hrc" #include "sc.hrc" #include "charthelper.hxx" +#include "dpobject.hxx" #define GET_SCALEVALUE(set,id) ((const SfxUInt16Item&)(set.Get( id ))).GetValue() @@ -712,8 +713,13 @@ BOOL ScDocument::OnlineSpellInRange( const ScRange& rSpellRange, ScAddress& rSpe // skip everything left of rSpellPos: while ( pCell && nRow == rSpellPos.Row() && nCol < rSpellPos.Col() ) pCell = aIter.GetNext( nCol, nRow ); - while ( pCell ) + + for (; pCell; pCell = aIter.GetNext(nCol, nRow)) { + if (pDPCollection && pDPCollection->HasDPTable(nCol, nRow, nTab)) + // Don't spell check within datapilot table. + continue; + CellType eType = pCell->GetCellType(); if ( eType == CELLTYPE_STRING || eType == CELLTYPE_EDIT ) { @@ -798,8 +804,6 @@ BOOL ScDocument::OnlineSpellInRange( const ScRange& rSpellRange, ScAddress& rSpe if ( ++nCellCount >= SPELL_MAXCELLS ) // seen enough cells? break; - - pCell = aIter.GetNext( nCol, nRow ); } if ( pCell ) diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index cd7d58964a96..9f009c455743 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -535,6 +535,9 @@ void ScDPObject::Output() // aOutRange is always the range that was last output to the document aOutRange = pOutput->GetOutputRange(); + const ScAddress& s = aOutRange.aStart; + const ScAddress& e = aOutRange.aEnd; + pDoc->ApplyFlagsTab(s.Col(), s.Row(), e.Col(), e.Row(), s.Tab(), SC_MF_DP_TABLE); } const ScRange ScDPObject::GetOutputRangeByType( sal_Int32 nType ) @@ -1801,7 +1804,7 @@ BOOL ScDPObject::FillOldParam(ScPivotParam& rParam, BOOL bForFile) const return TRUE; } -void lcl_FillLabelData( LabelData& rData, const uno::Reference< beans::XPropertySet >& xDimProp ) +void lcl_FillLabelData( ScDPLabelData& rData, const uno::Reference< beans::XPropertySet >& xDimProp ) { uno::Reference xDimSupp( xDimProp, uno::UNO_QUERY ); if ( xDimProp.is() && xDimSupp.is() ) @@ -1847,6 +1850,8 @@ void lcl_FillLabelData( LabelData& rData, const uno::Reference< beans::XProperty BOOL ScDPObject::FillLabelData(ScPivotParam& rParam) { + rParam.maLabelArray.clear(); + ((ScDPObject*)this)->CreateObjects(); uno::Reference xDimsName = xSource->getDimensions(); @@ -1857,8 +1862,6 @@ BOOL ScDPObject::FillLabelData(ScPivotParam& rParam) if (!nDimCount) return FALSE; - SCSIZE nOutCount = 0; - LabelData** aLabelArr = new LabelData*[nDimCount]; for (long nDim=0; nDim < nDimCount; nDim++) { String aFieldName; @@ -1893,24 +1896,15 @@ BOOL ScDPObject::FillLabelData(ScPivotParam& rParam) SCsCOL nCol = static_cast< SCsCOL >( nDim ); //! ??? bool bIsValue = true; //! check - aLabelArr[nOutCount] = new LabelData( aFieldName, nCol, bIsValue ); - - LabelData& rLabelData = *aLabelArr[nOutCount]; - GetHierarchies( nDim, rLabelData.maHiers ); - GetMembers( nDim, rLabelData.maMembers, &rLabelData.maVisible, &rLabelData.maShowDet ); - lcl_FillLabelData( rLabelData, xDimProp ); - - ++nOutCount; + ScDPLabelDataRef pNewLabel(new ScDPLabelData(aFieldName, nCol, bIsValue)); + GetHierarchies(nDim, pNewLabel->maHiers); + GetMembers(nDim, pNewLabel->maMembers, &pNewLabel->maVisible, &pNewLabel->maShowDet); + lcl_FillLabelData(*pNewLabel, xDimProp); + rParam.maLabelArray.push_back(pNewLabel); } } } - rParam.SetLabelData( aLabelArr, nOutCount ); - - for (SCSIZE i=0; iSetAlive(TRUE); - if ( !r.Insert(pDestObj) ) + if ( !r.InsertNewTable(pDestObj) ) { DBG_ERROR("cannot insert DPObject"); DELETEZ( pDestObj ); @@ -2524,6 +2518,39 @@ ScSimpleSharedString& ScDPCollection::GetSharedString() return maSharedString; } +void ScDPCollection::FreeTable(ScDPObject* pDPObj) +{ + const ScRange& rOutRange = pDPObj->GetOutRange(); + const ScAddress& s = rOutRange.aStart; + const ScAddress& e = rOutRange.aEnd; + pDoc->RemoveFlagsTab(s.Col(), s.Row(), e.Col(), e.Row(), s.Tab(), SC_MF_DP_TABLE); + Free(pDPObj); +} + +bool ScDPCollection::InsertNewTable(ScDPObject* pDPObj) +{ + bool bSuccess = Insert(pDPObj); + if (bSuccess) + { + const ScRange& rOutRange = pDPObj->GetOutRange(); + const ScAddress& s = rOutRange.aStart; + const ScAddress& e = rOutRange.aEnd; + pDoc->ApplyFlagsTab(s.Col(), s.Row(), e.Col(), e.Row(), s.Tab(), SC_MF_DP_TABLE); + } + return bSuccess; +} + +bool ScDPCollection::HasDPTable(SCCOL nCol, SCROW nRow, SCTAB nTab) const +{ + const ScMergeFlagAttr* pMergeAttr = static_cast( + pDoc->GetAttr(nCol, nRow, nTab, ATTR_MERGE_FLAG)); + + if (!pMergeAttr) + return false; + + return pMergeAttr->HasDPTable(); +} + ScDPCacheCell* ScDPCollection::getCacheCellFromPool(const ScDPCacheCell& rCell) { ScDPCacheCell aCell(rCell); diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx index d376ed3cd396..325943f8b094 100644 --- a/sc/source/core/data/dpoutput.cxx +++ b/sc/source/core/data/dpoutput.cxx @@ -121,8 +121,13 @@ struct ScDPOutLevelData uno::Sequence aResult; String maName; /// Name is the internal field name. String aCaption; /// Caption is the name visible in the output table. + bool mbHasHiddenMember; - ScDPOutLevelData() { nDim = nHier = nLevel = nDimPos = -1; } + ScDPOutLevelData() + { + nDim = nHier = nLevel = nDimPos = -1; + mbHasHiddenMember = false; + } BOOL operator<(const ScDPOutLevelData& r) const { return nDimPos>= aCaption; } + + bool bRowFieldHasMember = false; switch ( eDimOrient ) { case sheet::DataPilotFieldOrientation_COLUMN: @@ -464,6 +474,7 @@ ScDPOutput::ScDPOutput( ScDocument* pD, const uno::ReferencegetResults(); pColFields[nColFieldCount].maName = aName; pColFields[nColFieldCount].aCaption= aCaption; + pColFields[nColFieldCount].mbHasHiddenMember = bHasHiddenMember; if (!lcl_MemberEmpty(pColFields[nColFieldCount].aResult)) ++nColFieldCount; break; @@ -475,8 +486,12 @@ ScDPOutput::ScDPOutput( ScDocument* pD, const uno::ReferencegetResults(); pRowFields[nRowFieldCount].maName = aName; pRowFields[nRowFieldCount].aCaption= aCaption; + pRowFields[nRowFieldCount].mbHasHiddenMember = bHasHiddenMember; if (!lcl_MemberEmpty(pRowFields[nRowFieldCount].aResult)) + { ++nRowFieldCount; + bRowFieldHasMember = true; + } break; case sheet::DataPilotFieldOrientation_PAGE: pPageFields[nPageFieldCount].nDim = nDim; @@ -486,6 +501,7 @@ ScDPOutput::ScDPOutput( ScDocument* pD, const uno::ReferenceSetString( nCol, nRow, nTab, rCaption ); - if (bFrame) + if (bInTable) lcl_SetFrame( pDoc,nTab, nCol,nRow, nCol,nRow, 20 ); // Button - pDoc->ApplyAttr( nCol, nRow, nTab, ScMergeFlagAttr(SC_MF_BUTTON) ); + sal_uInt16 nMergeFlag = SC_MF_BUTTON; + if (bPopup) + nMergeFlag |= SC_MF_BUTTON_POPUP; + if (bHasHiddenMember) + nMergeFlag |= SC_MF_HIDDEN_MEMBER; + pDoc->ApplyFlagsTab(nCol, nRow, nCol, nRow, nTab, nMergeFlag); lcl_SetStyleById( pDoc,nTab, nCol,nRow, nCol,nRow, STR_PIVOT_STYLE_FIELDNAME ); } @@ -673,7 +698,7 @@ void ScDPOutput::FieldCell( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rC void lcl_DoFilterButton( ScDocument* pDoc, SCCOL nCol, SCROW nRow, SCTAB nTab ) { pDoc->SetString( nCol, nRow, nTab, ScGlobal::GetRscString(STR_CELL_FILTER) ); - pDoc->ApplyAttr( nCol, nRow, nTab, ScMergeFlagAttr(SC_MF_BUTTON) ); + pDoc->ApplyFlagsTab(nCol, nRow, nCol, nRow, nTab, SC_MF_BUTTON); } void ScDPOutput::CalcSizes() @@ -799,7 +824,7 @@ void ScDPOutput::Output() SCCOL nHdrCol = aStartPos.Col(); SCROW nHdrRow = aStartPos.Row() + nField + ( bDoFilter ? 1 : 0 ); // draw without frame for consistency with filter button: - FieldCell( nHdrCol, nHdrRow, nTab, pPageFields[nField].aCaption, FALSE ); + FieldCell( nHdrCol, nHdrRow, nTab, pPageFields[nField].aCaption, false, false, pPageFields[nField].mbHasHiddenMember ); SCCOL nFldCol = nHdrCol + 1; String aPageValue; @@ -838,7 +863,7 @@ void ScDPOutput::Output() for (nField=0; nField rSequence = pColFields[nField].aResult; @@ -873,9 +898,12 @@ void ScDPOutput::Output() for (nField=0; nField rSequence = pRowFields[nField].aResult; diff --git a/sc/source/core/data/dpoutputgeometry.cxx b/sc/source/core/data/dpoutputgeometry.cxx new file mode 100644 index 000000000000..1b8fc0b8435f --- /dev/null +++ b/sc/source/core/data/dpoutputgeometry.cxx @@ -0,0 +1,211 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: xmldpimp.cxx,v $ + * $Revision: 1.27.134.1 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_sc.hxx" + + + +// INCLUDE --------------------------------------------------------------- + +#include "dpoutputgeometry.hxx" +#include "address.hxx" + +#include + +using ::std::vector; + +ScDPOutputGeometry::ScDPOutputGeometry(const ScRange& rOutRange, bool bShowFilter) : + maOutRange(rOutRange), + mnRowFields(0), + mnColumnFields(0), + mnPageFields(0), + mnDataFields(0), + mbShowFilter(bShowFilter) +{ +} + +ScDPOutputGeometry::~ScDPOutputGeometry() +{ +} + +void ScDPOutputGeometry::setRowFieldCount(sal_uInt32 nCount) +{ + mnRowFields = nCount; +} + +void ScDPOutputGeometry::setColumnFieldCount(sal_uInt32 nCount) +{ + mnColumnFields = nCount; +} + +void ScDPOutputGeometry::setPageFieldCount(sal_uInt32 nCount) +{ + mnPageFields = nCount; +} + +void ScDPOutputGeometry::setDataFieldCount(sal_uInt32 nCount) +{ + mnDataFields = nCount; +} + +void ScDPOutputGeometry::getColumnFieldPositions(vector& rAddrs) const +{ + vector aAddrs; + if (!mnColumnFields) + { + rAddrs.swap(aAddrs); + return; + } + + bool bDataLayout = mnDataFields > 1; + + SCROW nCurRow = maOutRange.aStart.Row(); + + if (mnPageFields) + { + SCROW nRowStart = maOutRange.aStart.Row() + mbShowFilter; + SCROW nRowEnd = nRowStart + static_cast(mnPageFields-1); + nCurRow = nRowEnd + 2; + } + else if (mbShowFilter) + nCurRow += 2; + + SCROW nRow = nCurRow; + SCTAB nTab = maOutRange.aStart.Tab(); + SCCOL nColStart = maOutRange.aStart.Col() + mnRowFields + bDataLayout; + SCCOL nColEnd = nColStart + static_cast(mnColumnFields-1); + + for (SCCOL nCol = nColStart; nCol <= nColEnd; ++nCol) + aAddrs.push_back(ScAddress(nCol, nRow, nTab)); + rAddrs.swap(aAddrs); +} + +void ScDPOutputGeometry::getRowFieldPositions(vector& rAddrs) const +{ + vector aAddrs; + if (!mnRowFields) + { + rAddrs.swap(aAddrs); + return; + } + + SCROW nCurRow = maOutRange.aStart.Row(); + + if (mnPageFields) + { + SCROW nRowStart = maOutRange.aStart.Row() + mbShowFilter; + SCROW nRowEnd = nRowStart + static_cast(mnPageFields-1); + nCurRow = nRowEnd + 2; + } + else if (mbShowFilter) + nCurRow += 2; + + if (mnColumnFields) + nCurRow += static_cast(mnColumnFields); + else + ++nCurRow; + + SCROW nRow = nCurRow; + SCTAB nTab = maOutRange.aStart.Tab(); + SCCOL nColStart = maOutRange.aStart.Col(); + SCCOL nColEnd = nColStart + static_cast(mnRowFields-1); + + for (SCCOL nCol = nColStart; nCol <= nColEnd; ++nCol) + aAddrs.push_back(ScAddress(nCol, nRow, nTab)); + rAddrs.swap(aAddrs); +} + +void ScDPOutputGeometry::getPageFieldPositions(vector& rAddrs) const +{ + vector aAddrs; + if (!mnPageFields) + { + rAddrs.swap(aAddrs); + return; + } + + SCTAB nTab = maOutRange.aStart.Tab(); + SCCOL nCol = maOutRange.aStart.Col(); + + SCROW nRowStart = maOutRange.aStart.Row() + mbShowFilter; + SCROW nRowEnd = nRowStart + static_cast(mnPageFields-1); + + for (SCROW nRow = nRowStart; nRow <= nRowEnd; ++nRow) + aAddrs.push_back(ScAddress(nCol, nRow, nTab)); + rAddrs.swap(aAddrs); +} + +ScDPOutputGeometry::FieldType ScDPOutputGeometry::getFieldButtonType(const ScAddress& rPos) const +{ + // We will ignore the table position for now. + + bool bExtraTitleRow = (mnColumnFields == 0); + bool bDataLayout = mnDataFields > 1; + + SCROW nCurRow = maOutRange.aStart.Row(); + + if (mnPageFields) + { + SCCOL nCol = maOutRange.aStart.Col(); + SCROW nRowStart = maOutRange.aStart.Row() + mbShowFilter; + SCROW nRowEnd = nRowStart + static_cast(mnPageFields-1); + if (rPos.Col() == nCol && nRowStart <= rPos.Row() && rPos.Row() <= nRowEnd) + return Page; + + nCurRow = nRowEnd + 2; + } + else if (mbShowFilter) + nCurRow += 2; + + if (mnColumnFields) + { + SCROW nRow = nCurRow; + SCCOL nColStart = maOutRange.aStart.Col() + mnRowFields + bDataLayout; + SCCOL nColEnd = nColStart + static_cast(mnColumnFields-1); + if (rPos.Row() == nRow && nColStart <= rPos.Col() && rPos.Col() <= nColEnd) + return Column; + + nCurRow += static_cast(mnColumnFields); + } + + if (bExtraTitleRow) + ++nCurRow; + + if (mnRowFields) + { + SCCOL nColStart = maOutRange.aStart.Col(); + SCCOL nColEnd = nColStart + static_cast(mnRowFields-1); + if (rPos.Row() == nCurRow && nColStart <= rPos.Col() && rPos.Col() <= nColEnd) + return Row; + } + + return None; +} diff --git a/sc/source/core/data/dpsave.cxx b/sc/source/core/data/dpsave.cxx index ba1acc97a83a..cc564457761f 100644 --- a/sc/source/core/data/dpsave.cxx +++ b/sc/source/core/data/dpsave.cxx @@ -62,6 +62,7 @@ using namespace com::sun::star; using ::rtl::OUString; +using ::rtl::OUStringHash; using ::std::hash_map; using ::std::auto_ptr; @@ -642,6 +643,8 @@ void ScDPSaveDimension::WriteToSource( const uno::Reference& xD nHierCount = xHiers->getCount(); } + sal_Bool bHasHiddenMember = false; + for (long nHier=0; nHier xHierarchy = ScUnoHelpFunctions::AnyToInterface( xHiers->getByIndex(nHier) ); @@ -734,12 +737,15 @@ void ScDPSaveDimension::WriteToSource( const uno::Reference& xD for (MemberList::const_iterator i=maMemberList.begin(); i != maMemberList.end() ; i++) { - rtl::OUString aMemberName = (*i)->GetName(); + ScDPSaveMember* pMember = *i; + if (!pMember->GetIsVisible()) + bHasHiddenMember = true; + rtl::OUString aMemberName = pMember->GetName(); if ( xMembers->hasByName( aMemberName ) ) { uno::Reference xMemberInt = ScUnoHelpFunctions::AnyToInterface( xMembers->getByName( aMemberName ) ); - (*i)->WriteToSource( xMemberInt, nPosition ); + pMember->WriteToSource( xMemberInt, nPosition ); if ( nPosition >= 0 ) ++nPosition; // increase if initialized @@ -751,6 +757,40 @@ void ScDPSaveDimension::WriteToSource( const uno::Reference& xD } } } + + if (xDimProp.is()) + { + uno::Any any; + any <<= bHasHiddenMember; + xDimProp->setPropertyValue( + OUString::createFromAscii(SC_UNO_HAS_HIDDEN_MEMBER), any); + } +} + +void ScDPSaveDimension::UpdateMemberVisibility(const hash_map& rData) +{ + typedef hash_map DataMap; + MemberList::iterator itrMem = maMemberList.begin(), itrMemEnd = maMemberList.end(); + for (; itrMem != itrMemEnd; ++itrMem) + { + ScDPSaveMember* pMem = *itrMem; + const String& rMemName = pMem->GetName(); + DataMap::const_iterator itr = rData.find(rMemName); + if (itr != rData.end()) + pMem->SetIsVisible(itr->second); + } +} + +bool ScDPSaveDimension::HasInvisibleMember() const +{ + MemberList::const_iterator itrMem = maMemberList.begin(), itrMemEnd = maMemberList.end(); + for (; itrMem != itrMemEnd; ++itrMem) + { + const ScDPSaveMember* pMem = *itrMem; + if (!pMem->GetIsVisible()) + return true; + } + return false; } // ----------------------------------------------------------------------- @@ -1304,3 +1344,11 @@ void ScDPSaveData::BuildAllDimensionMembers(ScDPTableData* pData) mbDimensionMembersBuilt = true; } +bool ScDPSaveData::HasInvisibleMember(const OUString& rDimName) const +{ + ScDPSaveDimension* pDim = GetExistingDimensionByName(rDimName); + if (!pDim) + return false; + + return pDim->HasInvisibleMember(); +} diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx index bc1394307f26..927035af62c9 100644 --- a/sc/source/core/data/dptabsrc.cxx +++ b/sc/source/core/data/dptabsrc.cxx @@ -1375,7 +1375,8 @@ ScDPDimension::ScDPDimension( ScDPSource* pSrc, long nD ) : mpSubtotalName(NULL), nSourceDim( -1 ), bHasSelectedPage( FALSE ), - pSelectedData( NULL ) + pSelectedData( NULL ), + mbHasHiddenMember(false) { //! hold pSource } @@ -1571,6 +1572,7 @@ uno::Reference SAL_CALL ScDPDimension::getPropertySetIn {MAP_CHAR_LEN(SC_UNO_USEDHIER), 0, &getCppuType((sal_Int32*)0), 0, 0 }, {MAP_CHAR_LEN(SC_UNO_LAYOUTNAME), 0, &getCppuType(static_cast(0)), 0, 0 }, {MAP_CHAR_LEN(SC_UNO_FIELD_SUBTOTALNAME), 0, &getCppuType(static_cast(0)), 0, 0 }, + {MAP_CHAR_LEN(SC_UNO_HAS_HIDDEN_MEMBER), 0, &getBooleanCppuType(), 0, 0 }, {0,0,0,0,0,0} }; static uno::Reference aRef = @@ -1653,6 +1655,8 @@ void SAL_CALL ScDPDimension::setPropertyValue( const rtl::OUString& aPropertyNam if (aValue >>= aTmpName) mpSubtotalName.reset(new OUString(aTmpName)); } + else if (aNameStr.EqualsAscii(SC_UNO_HAS_HIDDEN_MEMBER)) + aValue >>= mbHasHiddenMember; else { DBG_ERROR("unknown property"); @@ -1716,6 +1720,8 @@ uno::Any SAL_CALL ScDPDimension::getPropertyValue( const rtl::OUString& aPropert aRet <<= mpLayoutName.get() ? *mpLayoutName : OUString::createFromAscii(""); else if (aNameStr.EqualsAscii(SC_UNO_FIELD_SUBTOTALNAME)) aRet <<= mpSubtotalName.get() ? *mpSubtotalName : OUString::createFromAscii(""); + else if (aNameStr.EqualsAscii(SC_UNO_HAS_HIDDEN_MEMBER)) + aRet <<= mbHasHiddenMember; else { DBG_ERROR("unknown property"); diff --git a/sc/source/core/data/fillinfo.cxx b/sc/source/core/data/fillinfo.cxx index c8eba91d2cc1..ac4cb9908a3f 100644 --- a/sc/source/core/data/fillinfo.cxx +++ b/sc/source/core/data/fillinfo.cxx @@ -332,6 +332,8 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX pInfo->bVOverlapped = FALSE; pInfo->bAutoFilter = FALSE; pInfo->bPushButton = FALSE; + pInfo->bPopupButton = false; + pInfo->bFilterActive = false; pInfo->nRotateDir = SC_ROTDIR_NONE; pInfo->bPrinted = FALSE; // view-intern @@ -458,6 +460,8 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX BOOL bAutoFilter = ((nOverlap & SC_MF_AUTO) != 0); BOOL bPushButton = ((nOverlap & SC_MF_BUTTON) != 0); BOOL bScenario = ((nOverlap & SC_MF_SCENARIO) != 0); + bool bPopupButton = ((nOverlap & SC_MF_BUTTON_POPUP) != 0); + bool bFilterActive = ((nOverlap & SC_MF_HIDDEN_MEMBER) != 0); if (bMerged||bHOverlapped||bVOverlapped) bAnyMerged = TRUE; // intern @@ -498,6 +502,8 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX pInfo->bVOverlapped = bVOverlapped; pInfo->bAutoFilter = bAutoFilter; pInfo->bPushButton = bPushButton; + pInfo->bPopupButton = bPopupButton; + pInfo->bFilterActive = bFilterActive; pInfo->pLinesAttr = pLinesAttr; pInfo->mpTLBRLine = pTLBRLine; pInfo->mpBLTRLine = pBLTRLine; @@ -512,7 +518,7 @@ void ScDocument::FillInfo( ScTableInfo& rTabInfo, SCCOL nX1, SCROW nY1, SCCOL nX nCurRow >= aEmbedRange.aStart.Row() && nCurRow <= aEmbedRange.aEnd.Row(); - if (bPushButton || bScenario) + if (bScenario) { pInfo->pBackground = ScGlobal::GetButtonBrushItem(); pThisRowInfo->bEmptyBack = FALSE; diff --git a/sc/source/core/data/global2.cxx b/sc/source/core/data/global2.cxx index c352dbb550d6..a6122c274d0d 100644 --- a/sc/source/core/data/global2.cxx +++ b/sc/source/core/data/global2.cxx @@ -56,6 +56,7 @@ #include "sc.hrc" #include "globstr.hrc" +using ::std::vector; // ----------------------------------------------------------------------- @@ -817,7 +818,6 @@ bool PivotField::operator==( const PivotField& r ) const ScPivotParam::ScPivotParam() : nCol(0), nRow(0), nTab(0), - ppLabelArr( NULL ), nLabels(0), nPageCount(0), nColCount(0), nRowCount(0), nDataCount(0), bIgnoreEmptyRows(FALSE), bDetectCategories(FALSE), bMakeTotalCol(TRUE), bMakeTotalRow(TRUE) @@ -828,23 +828,22 @@ ScPivotParam::ScPivotParam() ScPivotParam::ScPivotParam( const ScPivotParam& r ) : nCol( r.nCol ), nRow( r.nRow ), nTab( r.nTab ), - ppLabelArr( NULL ), nLabels(0), nPageCount(0), nColCount(0), nRowCount(0), nDataCount(0), bIgnoreEmptyRows(r.bIgnoreEmptyRows), bDetectCategories(r.bDetectCategories), bMakeTotalCol(r.bMakeTotalCol), bMakeTotalRow(r.bMakeTotalRow) { - SetLabelData ( r.ppLabelArr, r.nLabels ); SetPivotArrays ( r.aPageArr, r.aColArr, r.aRowArr, r.aDataArr, r.nPageCount, r.nColCount, r.nRowCount, r.nDataCount ); + + SetLabelData(r.maLabelArray); } //------------------------------------------------------------------------ __EXPORT ScPivotParam::~ScPivotParam() { - ClearLabelData(); } //------------------------------------------------------------------------ @@ -856,26 +855,10 @@ void __EXPORT ScPivotParam::Clear() nTab = 0; bIgnoreEmptyRows = bDetectCategories = FALSE; bMakeTotalCol = bMakeTotalRow = TRUE; - ClearLabelData(); ClearPivotArrays(); + maLabelArray.clear(); } -//------------------------------------------------------------------------ - -void __EXPORT ScPivotParam::ClearLabelData() -{ - if ( (nLabels > 0) && ppLabelArr ) - { - for ( SCSIZE i=0; i& r) { - ClearLabelData(); - - if ( (nLab > 0) && pLabArr ) + vector aNewArray; + aNewArray.reserve(r.size()); + for (vector::const_iterator itr = r.begin(), itrEnd = r.end(); + itr != itrEnd; ++itr) { - nLabels = (nLab>MAX_LABELS) ? MAX_LABELS : nLab; - ppLabelArr = new LabelData*[nLabels]; - for ( SCSIZE i=0; ipTab[nDestTab]) - { - ScPatternAttr aPattern( pDoc->GetPool() ); - aPattern.GetItemSet().Put( ScMergeFlagAttr(SC_MF_BUTTON) ); - pDoc->pTab[nDestTab]->ApplyPatternArea(nCol1, nRow1, nCol2, nRow2, aPattern); - } + pDoc->ApplyFlagsTab(nCol1, nRow1, nCol2, nRow2, nDestTab, SC_MF_BUTTON); } void ScPivot::SetStyle(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, USHORT nId) @@ -492,7 +487,7 @@ ScDataObject* ScPivotCollection::Clone() const // ============================================================================ -LabelData::LabelData( const String& rName, short nCol, bool bIsValue ) : +ScDPLabelData::ScDPLabelData( const String& rName, short nCol, bool bIsValue ) : maName( rName ), mnCol( nCol ), mnFuncMask( PIVOT_FUNC_NONE ), diff --git a/sc/source/filter/excel/xipivot.cxx b/sc/source/filter/excel/xipivot.cxx index fd7622cce7c0..7ec0e5d2a694 100644 --- a/sc/source/filter/excel/xipivot.cxx +++ b/sc/source/filter/excel/xipivot.cxx @@ -48,7 +48,9 @@ #include "dpdimsave.hxx" #include "dpobject.hxx" #include "dpshttab.hxx" +#include "dpoutputgeometry.hxx" #include "scitems.hxx" +#include "attrib.hxx" #include "xltracer.hxx" #include "xistream.hxx" @@ -60,6 +62,8 @@ #include "excform.hxx" #include "xltable.hxx" +#include + using ::rtl::OUString; using ::rtl::OUStringBuffer; using ::com::sun::star::sheet::DataPilotFieldOrientation; @@ -68,6 +72,7 @@ using ::com::sun::star::sheet::DataPilotFieldSortInfo; using ::com::sun::star::sheet::DataPilotFieldAutoShowInfo; using ::com::sun::star::sheet::DataPilotFieldLayoutInfo; using ::com::sun::star::sheet::DataPilotFieldReference; +using ::std::vector; // ============================================================================ // Pivot cache @@ -1418,8 +1423,10 @@ void XclImpPivotTable::Convert() pDPObj->SetAlive( TRUE ); pDPObj->SetHeaderLayout( maPTViewEx9Info.mnGridLayout == 0 ); - GetDoc().GetDPCollection()->Insert( pDPObj ); + GetDoc().GetDPCollection()->InsertNewTable(pDPObj); mpDPObj = pDPObj; + + ApplyMergeFlags(aOutRange, aSaveData); } void XclImpPivotTable::MaybeRefresh() @@ -1432,6 +1439,71 @@ void XclImpPivotTable::MaybeRefresh() } } +void XclImpPivotTable::ApplyMergeFlags(const ScRange& rOutRange, const ScDPSaveData& rSaveData) +{ + // Apply merge flags for varoius datapilot controls. + + ScDPOutputGeometry aGeometry(rOutRange, false); + aGeometry.setColumnFieldCount(maPTInfo.mnColFields); + aGeometry.setPageFieldCount(maPTInfo.mnPageFields); + aGeometry.setDataFieldCount(maPTInfo.mnDataFields); + + // Excel includes data layout field in the row field count. We need to + // subtract it. + bool bDataLayout = maPTInfo.mnDataFields > 1; + aGeometry.setRowFieldCount(maPTInfo.mnRowFields - static_cast(bDataLayout)); + + ScDocument& rDoc = GetDoc(); + + vector aPageBtns; + aGeometry.getPageFieldPositions(aPageBtns); + vector::const_iterator itr = aPageBtns.begin(), itrEnd = aPageBtns.end(); + for (; itr != itrEnd; ++itr) + { + sal_uInt16 nMFlag = SC_MF_BUTTON; + String aName; + rDoc.GetString(itr->Col(), itr->Row(), itr->Tab(), aName); + if (rSaveData.HasInvisibleMember(aName)) + nMFlag |= SC_MF_HIDDEN_MEMBER; + + rDoc.ApplyFlagsTab(itr->Col(), itr->Row(), itr->Col(), itr->Row(), itr->Tab(), nMFlag); + rDoc.ApplyFlagsTab(itr->Col()+1, itr->Row(), itr->Col()+1, itr->Row(), itr->Tab(), SC_MF_AUTO); + } + + vector aColBtns; + aGeometry.getColumnFieldPositions(aColBtns); + itr = aColBtns.begin(); + itrEnd = aColBtns.end(); + for (; itr != itrEnd; ++itr) + { + sal_Int16 nMFlag = SC_MF_BUTTON | SC_MF_BUTTON_POPUP; + String aName; + rDoc.GetString(itr->Col(), itr->Row(), itr->Tab(), aName); + if (rSaveData.HasInvisibleMember(aName)) + nMFlag |= SC_MF_HIDDEN_MEMBER; + rDoc.ApplyFlagsTab(itr->Col(), itr->Row(), itr->Col(), itr->Row(), itr->Tab(), nMFlag); + } + + vector aRowBtns; + aGeometry.getRowFieldPositions(aRowBtns); + itr = aRowBtns.begin(); + itrEnd = aRowBtns.end(); + for (; itr != itrEnd; ++itr) + { + sal_Int16 nMFlag = SC_MF_BUTTON | SC_MF_BUTTON_POPUP; + String aName; + rDoc.GetString(itr->Col(), itr->Row(), itr->Tab(), aName); + if (rSaveData.HasInvisibleMember(aName)) + nMFlag |= SC_MF_HIDDEN_MEMBER; + rDoc.ApplyFlagsTab(itr->Col(), itr->Row(), itr->Col(), itr->Row(), itr->Tab(), nMFlag); + } + if (bDataLayout) + { + --itr; // move back to the last row field position. + rDoc.ApplyFlagsTab(itr->Col(), itr->Row(), itr->Col(), itr->Row(), itr->Tab(), SC_MF_BUTTON); + } +} + // ============================================================================ // ============================================================================ diff --git a/sc/source/filter/inc/xipivot.hxx b/sc/source/filter/inc/xipivot.hxx index 15227b8fb1a3..9e0e577b1756 100644 --- a/sc/source/filter/inc/xipivot.hxx +++ b/sc/source/filter/inc/xipivot.hxx @@ -363,6 +363,8 @@ public: void MaybeRefresh(); + void ApplyMergeFlags(const ScRange& rOutRange, const ScDPSaveData& rSaveData); + // ------------------------------------------------------------------------ private: typedef ::std::vector< XclImpPTFieldRef > XclImpPTFieldVec; diff --git a/sc/source/filter/xml/xmldpimp.cxx b/sc/source/filter/xml/xmldpimp.cxx index 9cdca232c25a..0a990416006e 100644 --- a/sc/source/filter/xml/xmldpimp.cxx +++ b/sc/source/filter/xml/xmldpimp.cxx @@ -48,6 +48,7 @@ #include "dpgroup.hxx" #include "dpdimsave.hxx" #include "rangeutl.hxx" +#include "dpoutputgeometry.hxx" #include #include @@ -131,6 +132,10 @@ ScXMLDataPilotTableContext::ScXMLDataPilotTableContext( ScXMLImport& rImport, sDataPilotTableName(), sApplicationData(), sGrandTotal(GetXMLToken(XML_BOTH)), + mnRowFieldCount(0), + mnColFieldCount(0), + mnPageFieldCount(0), + mnDataFieldCount(0), bIsNative(sal_True), bIgnoreEmptyRows(sal_False), bIdentifyCategories(sal_False), @@ -280,6 +285,12 @@ SvXMLImportContext *ScXMLDataPilotTableContext::CreateChildContext( USHORT nPref void ScXMLDataPilotTableContext::SetButtons() { + ScDPOutputGeometry aGeometry(aTargetRangeAddress, bShowFilter); + aGeometry.setColumnFieldCount(mnColFieldCount); + aGeometry.setRowFieldCount(mnRowFieldCount); + aGeometry.setPageFieldCount(mnPageFieldCount); + aGeometry.setDataFieldCount(mnDataFieldCount); + OUString sAddress; sal_Int32 nOffset = 0; while( nOffset >= 0 ) @@ -291,8 +302,21 @@ void ScXMLDataPilotTableContext::SetButtons() sal_Int32 nAddrOffset(0); if (pDoc && ScRangeStringConverter::GetAddressFromString( aScAddress, sAddress, pDoc, ::formula::FormulaGrammar::CONV_OOO, nAddrOffset )) { - ScMergeFlagAttr aAttr( SC_MF_BUTTON ); - pDoc->ApplyAttr( aScAddress.Col(), aScAddress.Row(), aScAddress.Tab(), aAttr ); + ScDPOutputGeometry::FieldType eType = aGeometry.getFieldButtonType(aScAddress); + + sal_Int16 nMFlag = SC_MF_BUTTON; + if (eType == ScDPOutputGeometry::Column || eType == ScDPOutputGeometry::Row) + nMFlag |= SC_MF_BUTTON_POPUP; + + // Use the cell's string value to see if this field contains a + // hidden member. Isn't there a better way? GetString() is + // quite expensive... + String aCellStr; + pDoc->GetString(aScAddress.Col(), aScAddress.Row(), aScAddress.Tab(), aCellStr); + if (maHiddenMemberFields.count(aCellStr)) + nMFlag |= SC_MF_HIDDEN_MEMBER; + + pDoc->ApplyFlagsTab(aScAddress.Col(), aScAddress.Row(), aScAddress.Col(), aScAddress.Row(), aScAddress.Tab(), nMFlag); } } } @@ -301,7 +325,7 @@ void ScXMLDataPilotTableContext::SetButtons() pDPObject->RefreshAfterLoad(); } -void ScXMLDataPilotTableContext::AddDimension(ScDPSaveDimension* pDim) +void ScXMLDataPilotTableContext::AddDimension(ScDPSaveDimension* pDim, bool bHasHiddenMember) { if (pDPSave) { @@ -311,6 +335,30 @@ void ScXMLDataPilotTableContext::AddDimension(ScDPSaveDimension* pDim) pDPSave->GetExistingDimensionByName(pDim->GetName()) ) pDim->SetDupFlag( TRUE ); + if (!pDim->IsDataLayout()) + { + switch (pDim->GetOrientation()) + { + case sheet::DataPilotFieldOrientation_ROW: + ++mnRowFieldCount; + break; + case sheet::DataPilotFieldOrientation_COLUMN: + ++mnColFieldCount; + break; + case sheet::DataPilotFieldOrientation_PAGE: + ++mnPageFieldCount; + break; + case sheet::DataPilotFieldOrientation_DATA: + ++mnDataFieldCount; + break; + case sheet::DataPilotFieldOrientation_HIDDEN: + default: + ; + } + + if (bHasHiddenMember) + maHiddenMemberFields.insert(pDim->GetName()); + } pDPSave->AddDimension(pDim); } } @@ -405,7 +453,7 @@ void ScXMLDataPilotTableContext::EndElement() { ScDPCollection* pDPCollection = pDoc->GetDPCollection(); pDPObject->SetAlive(sal_True); - pDPCollection->Insert(pDPObject); + pDPCollection->InsertNewTable(pDPObject); } SetButtons(); } @@ -833,7 +881,8 @@ ScXMLDataPilotFieldContext::ScXMLDataPilotFieldContext( ScXMLImport& rImport, bIsGroupField(sal_False), bDateValue(sal_False), bAutoStart(sal_False), - bAutoEnd(sal_False) + bAutoEnd(sal_False), + mbHasHiddenMember(false) { sal_Bool bHasName(sal_False); sal_Bool bDataLayout(sal_False); @@ -928,6 +977,22 @@ SvXMLImportContext *ScXMLDataPilotFieldContext::CreateChildContext( USHORT nPref return pContext; } +void ScXMLDataPilotFieldContext::AddMember(ScDPSaveMember* pMember) +{ + if (pDim) + pDim->AddMember(pMember); + + if (!pMember->GetIsVisible()) + // This member is hidden. + mbHasHiddenMember = true; +} + +void ScXMLDataPilotFieldContext::SetSubTotalName(const OUString& rName) +{ + if (pDim) + pDim->SetSubtotalName(rName); +} + void ScXMLDataPilotFieldContext::AddGroup(const ::std::vector& rMembers, const rtl::OUString& rName) { ScXMLDataPilotGroup aGroup; @@ -948,7 +1013,7 @@ void ScXMLDataPilotFieldContext::EndElement() String sPage(sSelectedPage); pDim->SetCurrentPage(&sPage); } - pDataPilotTable->AddDimension(pDim); + pDataPilotTable->AddDimension(pDim, mbHasHiddenMember); if (bIsGroupField) { ScDPNumGroupInfo aInfo; @@ -995,12 +1060,6 @@ void ScXMLDataPilotFieldContext::EndElement() } } -void ScXMLDataPilotFieldContext::SetSubTotalName(const OUString& rName) -{ - if (pDim) - pDim->SetSubtotalName(rName); -} - ScXMLDataPilotFieldReferenceContext::ScXMLDataPilotFieldReferenceContext( ScXMLImport& rImport, USHORT nPrfx, const ::rtl::OUString& rLName, const uno::Reference& xAttrList, diff --git a/sc/source/filter/xml/xmldpimp.hxx b/sc/source/filter/xml/xmldpimp.hxx index fee4e36c02e5..50dc7e6d9c0d 100644 --- a/sc/source/filter/xml/xmldpimp.hxx +++ b/sc/source/filter/xml/xmldpimp.hxx @@ -41,6 +41,8 @@ #include "dpobject.hxx" #include "dpsave.hxx" +#include + class ScXMLImport; class ScDPSaveNumGroupDimension; class ScDPSaveGroupDimension; @@ -79,6 +81,9 @@ public: class ScXMLDataPilotTableContext : public SvXMLImportContext { + typedef ::std::hash_set< ::rtl::OUString, ::rtl::OUStringHash > StringSet; + StringSet maHiddenMemberFields; + struct GrandTotalItem { ::rtl::OUString maDisplayName; @@ -108,6 +113,10 @@ class ScXMLDataPilotTableContext : public SvXMLImportContext ScAddress aFilterOutputPosition; ScQueryParam aSourceQueryParam; ScMySourceType nSourceType; + sal_uInt32 mnRowFieldCount; + sal_uInt32 mnColFieldCount; + sal_uInt32 mnPageFieldCount; + sal_uInt32 mnDataFieldCount; sal_Bool bIsNative; sal_Bool bIgnoreEmptyRows; sal_Bool bIdentifyCategories; @@ -156,7 +165,7 @@ public: void SetFilterSourceRange(const ScRange& aValue) { aFilterSourceRange = aValue; } // void SetFilterIsCaseSensitive(const sal_Bool bValue) { aSourceQueryParam.bCaseSens = bValue; } // void SetFilterSkipDuplicates(const sal_Bool bValue) { aSourceQueryParam.bDuplicate = !bValue; } - void AddDimension(ScDPSaveDimension* pDim); + void AddDimension(ScDPSaveDimension* pDim, bool bHasHiddenMember); void AddGroupDim(const ScDPSaveNumGroupDimension& aNumGroupDim); void AddGroupDim(const ScDPSaveGroupDimension& aGroupDim); void SetButtons(); @@ -337,12 +346,13 @@ class ScXMLDataPilotFieldContext : public SvXMLImportContext sal_Int32 nGroupPart; sal_Int16 nFunction; sal_Int16 nOrientation; - sal_Bool bShowEmpty; - sal_Bool bSelectedPage; - sal_Bool bIsGroupField; - sal_Bool bDateValue; - sal_Bool bAutoStart; - sal_Bool bAutoEnd; + sal_Bool bShowEmpty:1; + sal_Bool bSelectedPage:1; + sal_Bool bIsGroupField:1; + sal_Bool bDateValue:1; + sal_Bool bAutoStart:1; + sal_Bool bAutoEnd:1; + bool mbHasHiddenMember:1; const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); } ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); } @@ -366,8 +376,8 @@ public: void SetShowEmpty(const sal_Bool bValue) { if (pDim) pDim->SetShowEmpty(bValue); } void SetSubTotals(const sal_uInt16* pFunctions, const sal_Int16 nCount) { if(pDim) pDim->SetSubTotals(nCount, pFunctions); } + void AddMember(ScDPSaveMember* pMember); void SetSubTotalName(const ::rtl::OUString& rName); - void AddMember(ScDPSaveMember* pMember) { if (pDim) pDim->AddMember(pMember); } void SetFieldReference(const com::sun::star::sheet::DataPilotFieldReference& aRef) { if (pDim) pDim->SetReferenceValue(&aRef); } void SetAutoShowInfo(const com::sun::star::sheet::DataPilotFieldAutoShowInfo& aInfo) { if (pDim) pDim->SetAutoShowInfo(&aInfo); } void SetSortInfo(const com::sun::star::sheet::DataPilotFieldSortInfo& aInfo) { if (pDim) pDim->SetSortInfo(&aInfo); } diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx new file mode 100644 index 000000000000..d6aa21ab79bb --- /dev/null +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -0,0 +1,1009 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: document.hxx,v $ + * $Revision: 1.115.36.9 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_sc.hxx" + +// INCLUDE --------------------------------------------------------------- + +#include "dpcontrol.hxx" + +#include "vcl/outdev.hxx" +#include "vcl/settings.hxx" +#include "vcl/wintypes.hxx" +#include "vcl/decoview.hxx" + +#define MENU_NOT_SELECTED 999 + +using ::rtl::OUString; +using ::rtl::OUStringHash; +using ::std::vector; +using ::std::hash_map; + +ScDPFieldButton::ScDPFieldButton(OutputDevice* pOutDev, const StyleSettings* pStyle) : + mpOutDev(pOutDev), + mpStyle(pStyle), + mbPopupButton(false), + mbHasHiddenMember(false) +{ +} + +ScDPFieldButton::~ScDPFieldButton() +{ +} + +void ScDPFieldButton::setText(const OUString& rText) +{ + maText = rText; +} + +void ScDPFieldButton::setBoundingBox(const Point& rPos, const Size& rSize) +{ + maPos = rPos; + maSize = rSize; +} + +void ScDPFieldButton::setDrawPopupButton(bool b) +{ + mbPopupButton = b; +} + +void ScDPFieldButton::setHasHiddenMember(bool b) +{ + mbHasHiddenMember = b; +} + +void ScDPFieldButton::draw() +{ + const long nMargin = 2; + + // Background + Rectangle aRect(maPos, maSize); + mpOutDev->SetLineColor(mpStyle->GetFaceColor()); + mpOutDev->SetFillColor(mpStyle->GetFaceColor()); + mpOutDev->DrawRect(aRect); + + // Border lines + mpOutDev->SetLineColor(mpStyle->GetLightColor()); + mpOutDev->DrawLine(Point(maPos), Point(maPos.X(), maPos.Y()+maSize.Height()-1)); + mpOutDev->DrawLine(Point(maPos), Point(maPos.X()+maSize.Width()-1, maPos.Y())); + + mpOutDev->SetLineColor(mpStyle->GetShadowColor()); + mpOutDev->DrawLine(Point(maPos.X(), maPos.Y()+maSize.Height()-1), + Point(maPos.X()+maSize.Width()-1, maPos.Y()+maSize.Height()-1)); + mpOutDev->DrawLine(Point(maPos.X()+maSize.Width()-1, maPos.Y()), + Point(maPos.X()+maSize.Width()-1, maPos.Y()+maSize.Height()-1)); + + // Field name + Font aTextFont( mpStyle->GetLabelFont() ); + aTextFont.SetHeight(12); + mpOutDev->SetFont(aTextFont); + + Point aTextPos = maPos; + long nTHeight = mpOutDev->GetTextHeight(); + aTextPos.setX(maPos.getX() + nMargin); + aTextPos.setY(maPos.getY() + (maSize.Height()-nTHeight)/2); + mpOutDev->DrawText(aTextPos, maText); + + if (mbPopupButton) + drawPopupButton(); +} + +void ScDPFieldButton::getPopupBoundingBox(Point& rPos, Size& rSize) const +{ + long nW = maSize.getWidth()*0.5; + long nH = maSize.getHeight(); + if (nW > 16) + nW = 16; + if (nH > 18) + nH = 18; + + rPos.setX(maPos.getX() + maSize.getWidth() - nW); + rPos.setY(maPos.getY() + maSize.getHeight() - nH); + rSize.setWidth(nW); + rSize.setHeight(nH); +} + +bool ScDPFieldButton::isPopupButton() const +{ + return mbPopupButton; +} + +void ScDPFieldButton::drawPopupButton() +{ + Point aPos; + Size aSize; + getPopupBoundingBox(aPos, aSize); + + // border lines + mpOutDev->SetLineColor(mpStyle->GetLightColor()); + mpOutDev->DrawLine(aPos, Point(aPos.X(), aPos.Y()+aSize.Height()-1)); + mpOutDev->DrawLine(aPos, Point(aPos.X()+aSize.Width()-1, aPos.Y())); + + mpOutDev->SetLineColor(mpStyle->GetShadowColor()); + mpOutDev->DrawLine(Point(aPos.X(), aPos.Y()+aSize.Height()-1), + Point(aPos.X()+aSize.Width()-1, aPos.Y()+aSize.Height()-1)); + mpOutDev->DrawLine(Point(aPos.X()+aSize.Width()-1, aPos.Y()), + Point(aPos.X()+aSize.Width()-1, aPos.Y()+aSize.Height()-1)); + + // the arrowhead + Color aArrowColor = mbHasHiddenMember ? mpStyle->GetHighlightLinkColor() : mpStyle->GetButtonTextColor(); + mpOutDev->SetLineColor(aArrowColor); + mpOutDev->SetFillColor(aArrowColor); + Point aCenter(aPos.X() + (aSize.Width() >> 1), aPos.Y() + (aSize.Height() >> 1)); + Point aPos1, aPos2; + aPos1.X() = aCenter.X() - 4; + aPos2.X() = aCenter.X() + 4; + aPos1.Y() = aCenter.Y() - 3; + aPos2.Y() = aCenter.Y() - 3; + + do + { + ++aPos1.X(); + --aPos2.X(); + ++aPos1.Y(); + ++aPos2.Y(); + mpOutDev->DrawLine(aPos1, aPos2); + } + while (aPos1 != aPos2); + + if (mbHasHiddenMember) + { + // tiny little box to display in presence of hidden member(s). + Point aBoxPos(aPos.X() + aSize.Width() - 5, aPos.Y() + aSize.Height() - 5); + Size aBoxSize(3, 3); + mpOutDev->DrawRect(Rectangle(aBoxPos, aBoxSize)); + } +} + +// ============================================================================ + +ScMenuFloatingWindow::MenuItem::MenuItem() : + mbEnabled(true), + mpAction(static_cast(NULL)), + mpSubMenuWin(static_cast(NULL)) +{ +} + +// ---------------------------------------------------------------------------- + +ScMenuFloatingWindow::SubMenuItem::SubMenuItem(ScMenuFloatingWindow* pParent) : + mpSubMenu(NULL), + mnMenuPos(MENU_NOT_SELECTED), + mpParent(pParent) +{ + maTimer.SetTimeoutHdl( LINK(this, ScMenuFloatingWindow::SubMenuItem, TimeoutHdl) ); + maTimer.SetTimeout(mpParent->GetSettings().GetMouseSettings().GetMenuDelay()); +} + +void ScMenuFloatingWindow::SubMenuItem::reset() +{ + mpSubMenu = NULL; + mnMenuPos = MENU_NOT_SELECTED; + maTimer.Stop(); +} + +IMPL_LINK( ScMenuFloatingWindow::SubMenuItem, TimeoutHdl, void*, EMPTYARG ) +{ + mpParent->handleMenuTimeout(this); + return 0; +} + +// ---------------------------------------------------------------------------- + +ScMenuFloatingWindow::ScMenuFloatingWindow(Window* pParent) : + FloatingWindow(pParent, (WB_SYSTEMFLOATWIN|WB_SYSTEMWINDOW|WB_NOBORDER)), + maOpenTimer(this), + maCloseTimer(this), + mnSelectedMenu(MENU_NOT_SELECTED), + mnClickedMenu(MENU_NOT_SELECTED), + mpParentMenu(dynamic_cast(pParent)), + mpActiveSubMenu(NULL), + mbActionFired(false) +{ + // TODO: How do we get the right font to use here ? + const sal_uInt16 nPopupFontHeight = 12; + const StyleSettings& rStyle = GetSettings().GetStyleSettings(); + maLabelFont = rStyle.GetLabelFont(); + maLabelFont.SetHeight(nPopupFontHeight); + SetFont(maLabelFont); + + SetPopupModeEndHdl( LINK(this, ScMenuFloatingWindow, EndPopupHdl) ); +} + +ScMenuFloatingWindow::~ScMenuFloatingWindow() +{ + EndPopupMode(); +} + +void ScMenuFloatingWindow::MouseMove(const MouseEvent& rMEvt) +{ + const Point& rPos = rMEvt.GetPosPixel(); + size_t nSelectedMenu = getEnclosingMenuItem(rPos); + setSelectedMenuItem(nSelectedMenu); + + Window::MouseMove(rMEvt); +} + +void ScMenuFloatingWindow::MouseButtonDown(const MouseEvent& rMEvt) +{ + const Point& rPos = rMEvt.GetPosPixel(); + mnClickedMenu = getEnclosingMenuItem(rPos); + Window::MouseButtonDown(rMEvt); +} + +void ScMenuFloatingWindow::MouseButtonUp(const MouseEvent& rMEvt) +{ + executeMenu(mnClickedMenu); + mnClickedMenu = MENU_NOT_SELECTED; + Window::MouseButtonUp(rMEvt); +} + +void ScMenuFloatingWindow::KeyInput(const KeyEvent& rKEvt) +{ + const KeyCode& rKeyCode = rKEvt.GetKeyCode(); + bool bHandled = true; + size_t nSelectedMenu = mnSelectedMenu; + size_t nLastMenuPos = maMenuItems.size() - 1; + switch (rKeyCode.GetCode()) + { + case KEY_UP: + if (nSelectedMenu == MENU_NOT_SELECTED || nSelectedMenu == 0) + nSelectedMenu = nLastMenuPos; + else + --nSelectedMenu; + setSelectedMenuItem(nSelectedMenu, false); + break; + case KEY_DOWN: + if (nSelectedMenu == MENU_NOT_SELECTED || nSelectedMenu == nLastMenuPos) + nSelectedMenu = 0; + else + ++nSelectedMenu; + setSelectedMenuItem(nSelectedMenu, false); + break; + case KEY_LEFT: + if (mpParentMenu) + mpParentMenu->endSubMenu(); + break; + case KEY_RIGHT: + { + if (mnSelectedMenu >= maMenuItems.size() || mnSelectedMenu == MENU_NOT_SELECTED) + break; + + const MenuItem& rMenu = maMenuItems[mnSelectedMenu]; + if (!rMenu.mbEnabled || !rMenu.mpSubMenuWin) + break; + + maOpenTimer.mnMenuPos = mnSelectedMenu; + maOpenTimer.mpSubMenu = rMenu.mpSubMenuWin.get(); + launchSubMenu(true); + } + break; + case KEY_RETURN: + if (nSelectedMenu != MENU_NOT_SELECTED) + executeMenu(nSelectedMenu); + break; + default: + bHandled = false; + } + + if (!bHandled) + Window::KeyInput(rKEvt); +} + +void ScMenuFloatingWindow::Paint(const Rectangle& /*rRect*/) +{ + const StyleSettings& rStyle = GetSettings().GetStyleSettings(); + Color aBackColor = rStyle.GetMenuColor(); + Color aBorderColor = rStyle.GetShadowColor(); + + Rectangle aCtrlRect(Point(0, 0), GetOutputSizePixel()); + + // Window background + bool bNativeDrawn = true; + if (IsNativeControlSupported(CTRL_MENU_POPUP, PART_ENTIRE_CONTROL)) + { + SetClipRegion(); + bNativeDrawn = DrawNativeControl( + CTRL_MENU_POPUP, PART_ENTIRE_CONTROL, Region(aCtrlRect), CTRL_STATE_ENABLED, + ImplControlValue(), OUString()); + } + else + bNativeDrawn = false; + + if (!bNativeDrawn) + { + SetFillColor(aBackColor); + SetLineColor(aBorderColor); + DrawRect(aCtrlRect); + } + + // Menu items + SetTextColor(rStyle.GetMenuTextColor()); + drawAllMenuItems(); +} + +void ScMenuFloatingWindow::addMenuItem(const OUString& rText, bool bEnabled, Action* pAction) +{ + MenuItem aItem; + aItem.maText = rText; + aItem.mbEnabled = bEnabled; + aItem.mpAction.reset(pAction); + maMenuItems.push_back(aItem); +} + +ScMenuFloatingWindow* ScMenuFloatingWindow::addSubMenuItem(const OUString& rText, bool bEnabled) +{ + MenuItem aItem; + aItem.maText = rText; + aItem.mbEnabled = bEnabled; + aItem.mpSubMenuWin.reset(new ScMenuFloatingWindow(this)); + maMenuItems.push_back(aItem); + return aItem.mpSubMenuWin.get(); +} + +void ScMenuFloatingWindow::drawMenuItem(size_t nPos) +{ + if (nPos >= maMenuItems.size()) + return; + + Point aPos; + Size aSize; + getMenuItemPosSize(aPos, aSize, nPos); + + DecorationView aDecoView(this); + long nXOffset = 5; + long nYOffset = (aSize.Height() - maLabelFont.GetHeight())/2; + DrawCtrlText(Point(aPos.X()+nXOffset, aPos.Y() + nYOffset), maMenuItems[nPos].maText, 0, STRING_LEN, + maMenuItems[nPos].mbEnabled ? TEXT_DRAW_MNEMONIC : TEXT_DRAW_DISABLE); + + if (maMenuItems[nPos].mpSubMenuWin) + { + long nFontHeight = maLabelFont.GetHeight(); + Point aMarkerPos = aPos; + aMarkerPos.Y() += aSize.Height()/2 - nFontHeight/4 + 1; + aMarkerPos.X() += aSize.Width() - nFontHeight + nFontHeight/4; + Size aMarkerSize(nFontHeight/2, nFontHeight/2); + aDecoView.DrawSymbol(Rectangle(aMarkerPos, aMarkerSize), + SYMBOL_SPIN_RIGHT, GetTextColor(), 0); + } +} + +void ScMenuFloatingWindow::drawAllMenuItems() +{ + size_t n = maMenuItems.size(); + for (size_t i = 0; i < n; ++i) + highlightMenuItem(i, i == mnSelectedMenu); +} + +const Font& ScMenuFloatingWindow::getLabelFont() const +{ + return maLabelFont; +} + +void ScMenuFloatingWindow::executeMenu(size_t nPos) +{ + if (nPos >= maMenuItems.size()) + return; + + if (!maMenuItems[nPos].mpAction) + // no action is defined. + return; + + maMenuItems[nPos].mpAction->execute(); + mbActionFired = true; + EndPopupMode(); +} + +void ScMenuFloatingWindow::setSelectedMenuItem(size_t nPos, bool bSubMenuTimer) +{ + if (mnSelectedMenu != nPos) + { + selectMenuItem(mnSelectedMenu, false, bSubMenuTimer); + selectMenuItem(nPos, true, bSubMenuTimer); + mnSelectedMenu = nPos; + } +} + +size_t ScMenuFloatingWindow::getSelectedMenuItem() const +{ + return mnSelectedMenu; +} + +void ScMenuFloatingWindow::handleMenuTimeout(SubMenuItem* pTimer) +{ + if (pTimer == &maOpenTimer) + { + // Close any open submenu immediately. + if (maCloseTimer.mpSubMenu) + { + maCloseTimer.mpSubMenu->EndPopupMode(); + maCloseTimer.mpSubMenu = NULL; + maCloseTimer.maTimer.Stop(); + } + + launchSubMenu(false); + } + else if (pTimer == &maCloseTimer) + { + // end submenu. + if (maCloseTimer.mpSubMenu) + { + maOpenTimer.mpSubMenu = NULL; + + maCloseTimer.mpSubMenu->EndPopupMode(); + maCloseTimer.mpSubMenu = NULL; + + highlightMenuItem(maOpenTimer.mnMenuPos, false); + maOpenTimer.mnMenuPos = MENU_NOT_SELECTED; + } + } +} + +void ScMenuFloatingWindow::queueLaunchSubMenu(size_t nPos, ScMenuFloatingWindow* pMenu) +{ + if (!pMenu) + return; + + // Set the submenu on launch queue. + if (maOpenTimer.mpSubMenu) + { + if (maOpenTimer.mpSubMenu == pMenu) + { + if (pMenu == maCloseTimer.mpSubMenu) + maCloseTimer.reset(); + return; + } + + // new submenu is being requested. + queueCloseSubMenu(); + } + + maOpenTimer.mpSubMenu = pMenu; + maOpenTimer.mnMenuPos = nPos; + maOpenTimer.maTimer.Start(); +} + +void ScMenuFloatingWindow::queueCloseSubMenu() +{ + if (!maOpenTimer.mpSubMenu) + // There is no submenu to close. + return; + + // Stop any submenu on queue for opening. + maOpenTimer.maTimer.Stop(); + + maCloseTimer.mpSubMenu = maOpenTimer.mpSubMenu; + maCloseTimer.mnMenuPos = maOpenTimer.mnMenuPos; + maCloseTimer.maTimer.Start(); +} + +void ScMenuFloatingWindow::launchSubMenu(bool bSetMenuPos) +{ + Point aPos; + Size aSize; + getMenuItemPosSize(aPos, aSize, maOpenTimer.mnMenuPos); + ScMenuFloatingWindow* pSubMenu = maOpenTimer.mpSubMenu; + + if (!pSubMenu) + return; + + sal_uInt32 nOldFlags = GetPopupModeFlags(); + SetPopupModeFlags(nOldFlags | FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE); + pSubMenu->resetMenu(bSetMenuPos); + pSubMenu->StartPopupMode( + Rectangle(aPos,aSize), (FLOATWIN_POPUPMODE_RIGHT | FLOATWIN_POPUPMODE_GRABFOCUS)); + pSubMenu->AddPopupModeWindow(this); + SetPopupModeFlags(nOldFlags); +} + +void ScMenuFloatingWindow::endSubMenu() +{ + if (maOpenTimer.mpSubMenu) + { + maOpenTimer.mpSubMenu->EndPopupMode(); + maOpenTimer.mpSubMenu = NULL; + highlightMenuItem(maOpenTimer.mnMenuPos, true); + } +} + +void ScMenuFloatingWindow::notify(NotificationType eType) +{ + switch (eType) + { + case SUBMENU_FOCUSED: + // Cancel any request for ending submenu. + maCloseTimer.reset(); + if (mnSelectedMenu != maOpenTimer.mnMenuPos) + { + highlightMenuItem(maOpenTimer.mnMenuPos, true); + mnSelectedMenu = maOpenTimer.mnMenuPos; + } + break; + default: + ; + } +} + +void ScMenuFloatingWindow::resetMenu(bool bSetMenuPos) +{ + mnSelectedMenu = bSetMenuPos ? 0 : MENU_NOT_SELECTED; + resizeToFitMenuItems(); +} + +void ScMenuFloatingWindow::resizeToFitMenuItems() +{ + if (maMenuItems.empty()) + return; + + vector::const_iterator itr = maMenuItems.begin(), itrEnd = maMenuItems.end(); + long nTextWidth = 0; + for (; itr != itrEnd; ++itr) + nTextWidth = ::std::max(GetTextWidth(itr->maText), nTextWidth); + + size_t nLastPos = maMenuItems.size()-1; + Point aPos; + Size aSize; + getMenuItemPosSize(aPos, aSize, nLastPos); + aPos.X() += nTextWidth + 15; + aPos.Y() += aSize.Height() + 5; + SetOutputSizePixel(Size(aPos.X(), aPos.Y())); +} + +void ScMenuFloatingWindow::selectMenuItem(size_t nPos, bool bSelected, bool bSubMenuTimer) +{ + if (nPos >= maMenuItems.size() || nPos == MENU_NOT_SELECTED) + { + queueCloseSubMenu(); + return; + } + + if (!maMenuItems[nPos].mbEnabled) + { + queueCloseSubMenu(); + return; + } + + highlightMenuItem(nPos, bSelected); + + if (bSelected) + { + if (mpParentMenu) + mpParentMenu->notify(SUBMENU_FOCUSED); + + if (bSubMenuTimer) + { + if (maMenuItems[nPos].mpSubMenuWin) + { + ScMenuFloatingWindow* pSubMenu = maMenuItems[nPos].mpSubMenuWin.get(); + queueLaunchSubMenu(nPos, pSubMenu); + } + else + queueCloseSubMenu(); + } + } +} + +void ScMenuFloatingWindow::highlightMenuItem(size_t nPos, bool bSelected) +{ + const StyleSettings& rStyle = GetSettings().GetStyleSettings(); + Color aBackColor = rStyle.GetMenuColor(); + SetFillColor(aBackColor); + SetLineColor(aBackColor); + + Point aPos; + Size aSize; + getMenuItemPosSize(aPos, aSize, nPos); + Region aRegion(Rectangle(aPos,aSize)); + + if (IsNativeControlSupported(CTRL_MENU_POPUP, PART_ENTIRE_CONTROL)) + { + Push(PUSH_CLIPREGION); + IntersectClipRegion(Rectangle(aPos, aSize)); + Rectangle aCtrlRect(Point(0,0), GetOutputSizePixel()); + DrawNativeControl( + CTRL_MENU_POPUP, PART_ENTIRE_CONTROL, Region(aCtrlRect), CTRL_STATE_ENABLED, + ImplControlValue(), OUString()); + + Pop(); + } + + bool bNativeDrawn = true; + if (IsNativeControlSupported(CTRL_MENU_POPUP, PART_MENU_ITEM)) + { + ControlState nState = bSelected ? CTRL_STATE_SELECTED : 0; + if (maMenuItems[nPos].mbEnabled) + nState |= CTRL_STATE_ENABLED; + bNativeDrawn = DrawNativeControl( + CTRL_MENU_POPUP, PART_MENU_ITEM, aRegion, nState, ImplControlValue(), OUString()); + } + else + bNativeDrawn = false; + + if (!bNativeDrawn) + { + if (bSelected) + { + aBackColor = rStyle.GetMenuHighlightColor(); + SetFillColor(aBackColor); + SetLineColor(aBackColor); + } + DrawRect(Rectangle(aPos,aSize)); + } + + Color aTextColor = bSelected ? rStyle.GetMenuHighlightTextColor() : rStyle.GetMenuTextColor(); + SetTextColor(aTextColor); + drawMenuItem(nPos); +} + +void ScMenuFloatingWindow::getMenuItemPosSize(Point& rPos, Size& rSize, size_t nPos) const +{ + const sal_uInt16 nLeftMargin = 5; + const sal_uInt16 nTopMargin = 5; + const sal_uInt16 nMenuItemHeight = maLabelFont.GetHeight()*1.8; + + Size aWndSize = GetSizePixel(); + + Point aPos1(nLeftMargin, nTopMargin); + Size aSize1(aWndSize.Width() - nLeftMargin*2, nMenuItemHeight); + + rPos = aPos1; + rPos.Y() += aSize1.Height()*nPos; + rSize = aSize1; +} + +size_t ScMenuFloatingWindow::getEnclosingMenuItem(const Point& rPos) const +{ + size_t n = maMenuItems.size(); + for (size_t i = 0; i < n; ++i) + { + Point aPos; + Size aSize; + getMenuItemPosSize(aPos, aSize, i); + Rectangle aRect(aPos, aSize); + if (aRect.IsInside(rPos)) + return i; + } + return MENU_NOT_SELECTED; +} + +IMPL_LINK( ScMenuFloatingWindow, EndPopupHdl, void*, EMPTYARG ) +{ + if (mbActionFired && mpParentMenu) + mpParentMenu->EndPopupMode(); + + return 0; +} + +// ============================================================================ + +ScDPFieldPopupWindow::Member::Member() : + mbVisible(true) +{ +} + +// ---------------------------------------------------------------------------- + +ScDPFieldPopupWindow::CancelButton::CancelButton(ScDPFieldPopupWindow* pParent) : + ::CancelButton(pParent), mpParent(pParent) {} + +void ScDPFieldPopupWindow::CancelButton::Click() +{ + mpParent->EndPopupMode(); + ::CancelButton::Click(); +} + +// ---------------------------------------------------------------------------- + +ScDPFieldPopupWindow::ScDPFieldPopupWindow(Window* pParent) : + ScMenuFloatingWindow(pParent), + maCheck0(this, 0), + maCheck1(this, 0), + maCheck2(this, 0), + maCheck3(this, 0), + maCheck4(this, 0), + maCheck5(this, 0), + maCheck6(this, 0), + maCheck7(this, 0), + maCheck8(this, 0), + maCheck9(this, 0), + maScrollBar(this, WB_VERT), + maBtnOk(this), + maBtnCancel(this), + mpExtendedData(NULL), + mpOKAction(NULL), + mnScrollPos(0) +{ + Point aPos; + Size aSize; + getSectionPosSize(aPos, aSize, WHOLE); + SetOutputSizePixel(aSize); + Size aOutSize = GetOutputSizePixel(); + + mpCheckPtr.reserve(10); + mpCheckPtr.push_back(&maCheck0); + mpCheckPtr.push_back(&maCheck1); + mpCheckPtr.push_back(&maCheck2); + mpCheckPtr.push_back(&maCheck3); + mpCheckPtr.push_back(&maCheck4); + mpCheckPtr.push_back(&maCheck5); + mpCheckPtr.push_back(&maCheck6); + mpCheckPtr.push_back(&maCheck7); + mpCheckPtr.push_back(&maCheck8); + mpCheckPtr.push_back(&maCheck9); + + getSectionPosSize(aPos, aSize, FIRST_LISTITEM); + for (vector::iterator itr = mpCheckPtr.begin(), itrEnd = mpCheckPtr.end(); + itr != itrEnd; ++itr) + { + CheckBox* p = *itr; + p->SetPosSizePixel(aPos, aSize); + p->SetFont(getLabelFont()); + p->SetClickHdl( LINK(this, ScDPFieldPopupWindow, CheckBoxHdl) ); + aPos.Y() += aSize.Height() + 1; + } + + getSectionPosSize(aPos, aSize, BTN_OK); + maBtnOk.SetPosSizePixel(aPos, aSize); + maBtnOk.SetFont(getLabelFont()); + maBtnOk.SetClickHdl( LINK(this, ScDPFieldPopupWindow, OKButtonHdl) ); + maBtnOk.Show(); + + getSectionPosSize(aPos, aSize, BTN_CANCEL); + maBtnCancel.SetPosSizePixel(aPos, aSize); + maBtnCancel.SetFont(getLabelFont()); + maBtnCancel.Show(); + + getSectionPosSize(aPos, aSize, SCROLL_BAR_V); + maScrollBar.SetPosSizePixel(aPos, aSize); + maScrollBar.SetPageSize(mpCheckPtr.size()); + maScrollBar.SetVisibleSize(mpCheckPtr.size()); + maScrollBar.SetLineSize(1); + maScrollBar.SetScrollHdl( LINK(this, ScDPFieldPopupWindow, ScrollHdl) ); + maScrollBar.EnableDrag(true); +} + +ScDPFieldPopupWindow::~ScDPFieldPopupWindow() +{ +} + +vector& ScDPFieldPopupWindow::getMembers() +{ + return maMembers; +} + +void ScDPFieldPopupWindow::getSectionPosSize(Point& rPos, Size& rSize, SectionType eType) const +{ + const sal_uInt16 nListBoxMargin = 5; + const sal_uInt16 nTopMargin = 5; + const sal_uInt16 nMenuHeight = 60; + const sal_uInt16 nBottomBtnAreaHeight = 50; + const sal_uInt16 nInnerItemMargin = 5; + const sal_uInt16 nScrollBarWidth = 17; + const sal_uInt16 nBtnWidth = 60; + const sal_uInt16 nBtnHeight = getLabelFont().GetHeight()*2; + const sal_uInt16 nBottomMargin = 10; + const sal_uInt16 nMenuListMargin = 20; + + Size aWndSize = Size(160, 330); + + switch (eType) + { + case WHOLE: + { + rPos = Point(0, 0); + rSize = aWndSize; + } + break; + case LISTBOX_AREA: + { + rPos = Point(nListBoxMargin, nTopMargin + nMenuHeight + nMenuListMargin); + rSize = Size( + aWndSize.Width() - nListBoxMargin*2, + aWndSize.Height() - nTopMargin - nMenuHeight - nMenuListMargin - nBottomBtnAreaHeight); + } + break; + case FIRST_LISTITEM: + { + rPos = Point(nListBoxMargin + nInnerItemMargin, + nTopMargin + nMenuHeight + nMenuListMargin + nInnerItemMargin); + rSize = Size( + aWndSize.Width() - nListBoxMargin*2 - nInnerItemMargin - nScrollBarWidth - 10, + 17); + } + break; + case BTN_OK: + { + long x = (aWndSize.Width() - nBtnWidth*2)/3; + long y = aWndSize.Height() - nBottomMargin - nBtnHeight; + rPos = Point(x, y); + rSize = Size(nBtnWidth, nBtnHeight); + } + break; + case BTN_CANCEL: + { + long x = (aWndSize.Width() - nBtnWidth*2)/3*2 + nBtnWidth; + long y = aWndSize.Height() - nBottomMargin - nBtnHeight; + rPos = Point(x, y); + rSize = Size(nBtnWidth, nBtnHeight); + } + break; + case SCROLL_BAR_V: + { + long x = aWndSize.Width() - nListBoxMargin - nInnerItemMargin - nScrollBarWidth; + long y = nTopMargin + nMenuHeight + nMenuListMargin + nInnerItemMargin; + rPos = Point(x, y); + long h = aWndSize.Height() - nTopMargin - nMenuHeight - nMenuListMargin - nBottomBtnAreaHeight - nInnerItemMargin*2; + rSize = Size(nScrollBarWidth, h); + } + break; + default: + ; + } +} + +void ScDPFieldPopupWindow::resetDisplayedItems() +{ + long nScrollPos = maScrollBar.GetThumbPos(); + if (nScrollPos < 0) + return; + + mnScrollPos = static_cast(nScrollPos); + size_t nCheckCount = mpCheckPtr.size(); + for (size_t i = 0; i < nCheckCount; ++i) + { + CheckBox* p = mpCheckPtr[i]; + p->SetText(maMembers[i+mnScrollPos].maName); + TriState nNewState = maMembers[i+mnScrollPos].mbVisible ? STATE_CHECK : STATE_NOCHECK; + p->SetState(nNewState); + } +} + +IMPL_LINK( ScDPFieldPopupWindow, CheckBoxHdl, CheckBox*, pCheck ) +{ + vector::const_iterator itr, itrBeg = mpCheckPtr.begin(), itrEnd = mpCheckPtr.end(); + for (itr = itrBeg; itr != itrEnd; ++itr) + { + if (*itr == pCheck) + { + size_t nIndex = ::std::distance(itrBeg, itr); + maMembers[nIndex+mnScrollPos].mbVisible = !maMembers[nIndex+mnScrollPos].mbVisible; + } + } + return 0; +} + +IMPL_LINK( ScDPFieldPopupWindow, OKButtonHdl, OKButton*, EMPTYARG ) +{ + close(true); + return 0; +} + +IMPL_LINK( ScDPFieldPopupWindow, ScrollHdl, ScrollBar*, EMPTYARG ) +{ + resetDisplayedItems(); + return 0; +} + +void ScDPFieldPopupWindow::MouseMove(const MouseEvent& rMEvt) +{ + ScMenuFloatingWindow::MouseMove(rMEvt); + + size_t nSelectedMenu = getSelectedMenuItem(); + if (nSelectedMenu == MENU_NOT_SELECTED) + queueCloseSubMenu(); +} + +void ScDPFieldPopupWindow::Paint(const Rectangle& rRect) +{ + ScMenuFloatingWindow::Paint(rRect); + + const StyleSettings& rStyle = GetSettings().GetStyleSettings(); + Color aMemberBackColor = rStyle.GetFieldColor(); + + // Member list box background + SetFillColor(aMemberBackColor); + Point aPos; + Size aSize; + getSectionPosSize(aPos, aSize, LISTBOX_AREA); + DrawRect(Rectangle(aPos,aSize)); +} + +void ScDPFieldPopupWindow::setMemberSize(size_t n) +{ + maMembers.reserve(n); +} + +void ScDPFieldPopupWindow::addMember(const OUString& rName, bool bVisible) +{ + Member aMember; + aMember.maName = rName; + aMember.mbVisible = bVisible; + maMembers.push_back(aMember); +} + +void ScDPFieldPopupWindow::initMembers() +{ + size_t nMemCount = maMembers.size(); + size_t nCheckCount = mpCheckPtr.size(); + bool bNeedsScroll = false; + if (nMemCount > nCheckCount) + { + nMemCount = nCheckCount; + bNeedsScroll = true; + } + + for (size_t i = 0; i < nMemCount; ++i) + { + CheckBox* p = mpCheckPtr[i]; + p->SetText(maMembers[i].maName); + p->Show(); + p->SetState(maMembers[i].mbVisible ? STATE_CHECK : STATE_NOCHECK); + } + if (bNeedsScroll) + { + maScrollBar.SetRange(Range(0, maMembers.size())); + maScrollBar.Show(); + } +} + +void ScDPFieldPopupWindow::getResult(hash_map& rResult) +{ + typedef hash_map ResultMap; + ResultMap aResult; + vector::const_iterator itr = maMembers.begin(), itrEnd = maMembers.end(); + for (; itr != itrEnd; ++itr) + aResult.insert(ResultMap::value_type(itr->maName, itr->mbVisible)); + rResult.swap(aResult); +} + +void ScDPFieldPopupWindow::close(bool bOK) +{ + if (bOK && mpOKAction.get()) + mpOKAction->execute(); + + EndPopupMode(); +} + +void ScDPFieldPopupWindow::setExtendedData(ExtendedData* p) +{ + mpExtendedData.reset(p); +} + +ScDPFieldPopupWindow::ExtendedData* ScDPFieldPopupWindow::getExtendedData() +{ + return mpExtendedData.get(); +} + +void ScDPFieldPopupWindow::setOKAction(Action* p) +{ + mpOKAction.reset(p); +} + diff --git a/sc/source/ui/cctrl/dpcontrol.src b/sc/source/ui/cctrl/dpcontrol.src new file mode 100644 index 000000000000..5f7ab9a66a9f --- /dev/null +++ b/sc/source/ui/cctrl/dpcontrol.src @@ -0,0 +1,49 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: globstr.src,v $ + * $Revision: 1.74.96.1 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "dpcontrol.hrc" + +Resource RID_POPUP_FILTER +{ + String STR_MENU_SORT_ASC + { + Text [ en-US ] = "Sort Ascending" ; + }; + + String STR_MENU_SORT_DESC + { + Text [ en-US ] = "Sort Descending" ; + }; + + String STR_MENU_SORT_CUSTOM + { + Text [ en-US ] = "Custom Sort" ; + }; +}; diff --git a/sc/source/ui/cctrl/makefile.mk b/sc/source/ui/cctrl/makefile.mk index e7b96afd7b9a..541a90cc4347 100644 --- a/sc/source/ui/cctrl/makefile.mk +++ b/sc/source/ui/cctrl/makefile.mk @@ -45,22 +45,30 @@ LIBTARGET=NO # --- Files -------------------------------------------------------- EXCEPTIONSFILES= \ - $(SLO)$/tbzoomsliderctrl.obj + $(SLO)$/tbzoomsliderctrl.obj \ + $(SLO)$/dpcontrol.obj SLOFILES = \ $(SLO)$/popmenu.obj \ $(SLO)$/tbinsert.obj \ $(SLO)$/cbuttonw.obj \ + $(SLO)$/dpcontrol.obj \ $(SLO)$/editfield.obj \ $(EXCEPTIONSFILES) +SRS1NAME=$(TARGET) +SRC1FILES = \ + dpcontrol.src + LIB1TARGET=$(SLB)$/$(TARGET).lib LIB1OBJFILES= \ $(SLO)$/popmenu.obj \ $(SLO)$/tbinsert.obj \ $(SLO)$/cbuttonw.obj \ + $(SLO)$/dpcontrol.obj \ $(SLO)$/tbzoomsliderctrl.obj + # --- Tagets ------------------------------------------------------- .INCLUDE : target.mk diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx index c23068b82200..688c0d60f79e 100644 --- a/sc/source/ui/dbgui/pvlaydlg.cxx +++ b/sc/source/ui/dbgui/pvlaydlg.cxx @@ -64,6 +64,7 @@ #include "scabstdlg.hxx" //CHINA001 using namespace com::sun::star; using ::rtl::OUString; +using ::std::vector; //---------------------------------------------------------------------------- @@ -379,24 +380,23 @@ void ScDPLayoutDlg::StateChanged( StateChangedType nStateChange ) //---------------------------------------------------------------------------- -void ScDPLayoutDlg::InitWndSelect( LabelData** ppLabelArr, long nLabels ) +void ScDPLayoutDlg::InitWndSelect( const vector& rLabels ) { - if ( ppLabelArr ) + size_t nLabelCount = rLabels.size(); + if (nLabelCount > MAX_LABELS) + nLabelCount = MAX_LABELS; + size_t nLast = (nLabelCount > PAGE_SIZE) ? (PAGE_SIZE - 1) : (nLabelCount - 1); + + aLabelDataArr.clear(); + aLabelDataArr.reserve( nLabelCount ); + for ( size_t i=0; i < nLabelCount; i++ ) { - size_t nLabelCount = static_cast< size_t >( (nLabels > MAX_LABELS) ? MAX_LABELS : nLabels ); - size_t nLast = (nLabelCount > PAGE_SIZE) ? (PAGE_SIZE - 1) : (nLabelCount - 1); + aLabelDataArr.push_back(*rLabels[i]); - aLabelDataArr.clear(); - aLabelDataArr.reserve( nLabelCount ); - for ( size_t i=0; i < nLabelCount; i++ ) + if ( i <= nLast ) { - aLabelDataArr.push_back( *ppLabelArr[i] ); - - if ( i <= nLast ) - { - aWndSelect.AddField( aLabelDataArr[i].maName, i ); - aSelectArr[i].reset( new ScDPFuncData( aLabelDataArr[i].mnCol, aLabelDataArr[i].mnFuncMask ) ); - } + aWndSelect.AddField( aLabelDataArr[i].maName, i ); + aSelectArr[i].reset( new ScDPFuncData( aLabelDataArr[i].mnCol, aLabelDataArr[i].mnFuncMask ) ); } } } @@ -494,18 +494,19 @@ void ScDPLayoutDlg::InitFocus() void ScDPLayoutDlg::InitFields() { - InitWndSelect( thePivotData.ppLabelArr, static_cast(thePivotData.nLabels) ); + InitWndSelect(thePivotData.maLabelArray); InitWnd( thePivotData.aPageArr, static_cast(thePivotData.nPageCount), TYPE_PAGE ); InitWnd( thePivotData.aColArr, static_cast(thePivotData.nColCount), TYPE_COL ); InitWnd( thePivotData.aRowArr, static_cast(thePivotData.nRowCount), TYPE_ROW ); InitWnd( thePivotData.aDataArr, static_cast(thePivotData.nDataCount), TYPE_DATA ); + size_t nLabels = thePivotData.maLabelArray.size(); aSlider.SetPageSize( PAGE_SIZE ); aSlider.SetVisibleSize( PAGE_SIZE ); aSlider.SetLineSize( LINE_SIZE ); - aSlider.SetRange( Range( 0, static_cast(((thePivotData.nLabels+LINE_SIZE-1)/LINE_SIZE)*LINE_SIZE) ) ); + aSlider.SetRange( Range( 0, static_cast(((nLabels+LINE_SIZE-1)/LINE_SIZE)*LINE_SIZE) ) ); - if ( thePivotData.nLabels > PAGE_SIZE ) + if ( nLabels > PAGE_SIZE ) { aSlider.SetEndScrollHdl( LINK( this, ScDPLayoutDlg, ScrollHdl ) ); aSlider.Show(); diff --git a/sc/source/ui/docshell/dbdocfun.cxx b/sc/source/ui/docshell/dbdocfun.cxx index 1e85f3c01f3e..ebbdd6cfbae4 100644 --- a/sc/source/ui/docshell/dbdocfun.cxx +++ b/sc/source/ui/docshell/dbdocfun.cxx @@ -1233,7 +1233,7 @@ BOOL ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewOb aRange.aEnd.Col(), aRange.aEnd.Row(), nTab, SC_MF_AUTO ); - pDoc->GetDPCollection()->Free( pOldObj ); // object is deleted here + pDoc->GetDPCollection()->FreeTable( pOldObj ); // object is deleted here rDocShell.PostPaintGridAll(); //! only necessary parts rDocShell.PostPaint( aRange.aStart.Col(), aRange.aStart.Row(), nTab, @@ -1277,7 +1277,7 @@ BOOL ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, const ScDPObject* pNewOb pDestObj = new ScDPObject( *pNewObj ); pDestObj->SetAlive(TRUE); - if ( !pDoc->GetDPCollection()->Insert(pDestObj) ) + if ( !pDoc->GetDPCollection()->InsertNewTable(pDestObj) ) { DBG_ERROR("cannot insert DPObject"); DELETEZ( pDestObj ); diff --git a/sc/source/ui/inc/dbfunc.hxx b/sc/source/ui/inc/dbfunc.hxx index 82739bfdd274..afeb90df1a79 100644 --- a/sc/source/ui/inc/dbfunc.hxx +++ b/sc/source/ui/inc/dbfunc.hxx @@ -99,6 +99,7 @@ public: void UngroupDataPilot(); void DataPilotInput( const ScAddress& rPos, const String& rString ); + bool DataPilotSort( const ScAddress& rPos, bool bAscending, sal_uInt16* pUserListId = NULL ); BOOL DataPilotMove( const ScRange& rSource, const ScAddress& rDest ); BOOL HasSelectionForDrillDown( USHORT& rOrientation ); diff --git a/sc/source/ui/inc/dpcontrol.hrc b/sc/source/ui/inc/dpcontrol.hrc new file mode 100644 index 000000000000..7ec03c5134ae --- /dev/null +++ b/sc/source/ui/inc/dpcontrol.hrc @@ -0,0 +1,40 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: protectiondlg.hrc,v $ + * $Revision: 1.1.2.1 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __DPCONTROL_HRC__ +#define __DPCONTROL_HRC__ + +#include + +#define STR_MENU_SORT_ASC 1 +#define STR_MENU_SORT_DESC 2 +#define STR_MENU_SORT_CUSTOM 3 + +#endif diff --git a/sc/source/ui/inc/dpcontrol.hxx b/sc/source/ui/inc/dpcontrol.hxx new file mode 100644 index 000000000000..5c1e7a59aad2 --- /dev/null +++ b/sc/source/ui/inc/dpcontrol.hxx @@ -0,0 +1,289 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: document.hxx,v $ + * $Revision: 1.115.36.9 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_DPCONTROL_HXX +#define SC_DPCONTROL_HXX + +#include "rtl/ustring.hxx" +#include "tools/gen.hxx" +#include "vcl/floatwin.hxx" +#include "vcl/button.hxx" +#include "vcl/scrbar.hxx" +#include "vcl/timer.hxx" + +#include +#include +#include + +class OutputDevice; +class Point; +class Size; +class StyleSettings; +class Window; + +/** + * This class takes care of physically drawing field button controls inside + * data pilot tables. + */ +class ScDPFieldButton +{ +public: + ScDPFieldButton(OutputDevice* pOutDev, const StyleSettings* pStyle); + ~ScDPFieldButton(); + + void setText(const ::rtl::OUString& rText); + void setBoundingBox(const Point& rPos, const Size& rSize); + void setDrawPopupButton(bool b); + void setHasHiddenMember(bool b); + void draw(); + + void getPopupBoundingBox(Point& rPos, Size& rSize) const; + bool isPopupButton() const; + +private: + void drawPopupButton(); + +private: + Point maPos; + Size maSize; + ::rtl::OUString maText; + OutputDevice* mpOutDev; + const StyleSettings* mpStyle; + bool mbPopupButton; + bool mbHasHiddenMember; +}; + +// ============================================================================ + +class ScMenuFloatingWindow : public FloatingWindow +{ +public: + /** + * Action to perform when an event takes place. Create a sub-class of + * this to implement the desired action. + */ + class Action + { + public: + virtual void execute() = 0; + }; + + explicit ScMenuFloatingWindow(Window* pParent); + virtual ~ScMenuFloatingWindow(); + + virtual void MouseMove(const MouseEvent& rMEvt); + virtual void MouseButtonDown(const MouseEvent& rMEvt); + virtual void MouseButtonUp(const MouseEvent& rMEvt); + virtual void KeyInput(const KeyEvent& rKEvt); + virtual void Paint(const Rectangle& rRect); + + void addMenuItem(const ::rtl::OUString& rText, bool bEnabled, Action* pAction); + ScMenuFloatingWindow* addSubMenuItem(const ::rtl::OUString& rText, bool bEnabled); + +protected: + void drawMenuItem(size_t nPos); + void drawAllMenuItems(); + const Font& getLabelFont() const; + + void executeMenu(size_t nPos); + void setSelectedMenuItem(size_t nPos, bool bSubMenuTimer = true); + size_t getSelectedMenuItem() const; + void queueLaunchSubMenu(size_t nPos, ScMenuFloatingWindow* pMenu); + void queueCloseSubMenu(); + void launchSubMenu(bool bSetMenuPos); + void endSubMenu(); + +private: + struct SubMenuItem; + void handleMenuTimeout(SubMenuItem* pTimer); + + enum NotificationType { SUBMENU_FOCUSED }; + void notify(NotificationType eType); + + void resetMenu(bool bSetMenuPos); + void resizeToFitMenuItems(); + void selectMenuItem(size_t nPos, bool bSelected, bool bSubMenuTimer); + void highlightMenuItem(size_t nPos, bool bSelected); + + void getMenuItemPosSize(Point& rPos, Size& rSize, size_t nPos) const; + size_t getEnclosingMenuItem(const Point& rPos) const; + + DECL_LINK( EndPopupHdl, void* ); + +private: + struct MenuItem + { + ::rtl::OUString maText; + bool mbEnabled; + + ::boost::shared_ptr mpAction; + ::boost::shared_ptr mpSubMenuWin; + + MenuItem(); + }; + + ::std::vector maMenuItems; + + struct SubMenuItem + { + Timer maTimer; + ScMenuFloatingWindow* mpSubMenu; + size_t mnMenuPos; + + DECL_LINK( TimeoutHdl, void* ); + + SubMenuItem(ScMenuFloatingWindow* pParent); + void reset(); + + private: + ScMenuFloatingWindow* mpParent; + }; + SubMenuItem maOpenTimer; + SubMenuItem maCloseTimer; + + Font maLabelFont; + + size_t mnSelectedMenu; + size_t mnClickedMenu; + + ScMenuFloatingWindow* mpParentMenu; + ScMenuFloatingWindow* mpActiveSubMenu; + + bool mbActionFired; +}; + +// ============================================================================ + +/** + * This class implements a popup window for field button, for quick access + * of hide-item list, and possibly more stuff related to field options. + */ +class ScDPFieldPopupWindow : public ScMenuFloatingWindow +{ +public: + /** + * Extended data that the client code may need to store. Create a + * sub-class of this and store data there. + */ + struct ExtendedData {}; + + explicit ScDPFieldPopupWindow(Window* pParent); + virtual ~ScDPFieldPopupWindow(); + + virtual void MouseMove(const MouseEvent& rMEvt); + virtual void Paint(const Rectangle& rRect); + + void setMemberSize(size_t n); + void addMember(const ::rtl::OUString& rName, bool bVisible); + void initMembers(); + + void getResult(::std::hash_map< ::rtl::OUString, bool, ::rtl::OUStringHash>& rResult); + void close(bool bOK); + + /** + * Set auxiliary data that the client code might need. Note that this + * popup window class manages its life time; no explicit deletion of the + * instance is needed in the client code. + */ + void setExtendedData(ExtendedData* p); + + /** + * Get the store auxiliary data, or NULL if no such data is stored. + */ + ExtendedData* getExtendedData(); + + void setOKAction(Action* p); + +private: + struct Member + { + ::rtl::OUString maName; + bool mbVisible; + + Member(); + }; + + class CancelButton : public ::CancelButton + { + public: + CancelButton(ScDPFieldPopupWindow* pParent); + + virtual void Click(); + + private: + ScDPFieldPopupWindow* mpParent; + }; + + ::std::vector& getMembers(); + + enum SectionType { + WHOLE, // entire window + LISTBOX_AREA, // box enclosing the check box items. + FIRST_LISTITEM, // first list item at the top + BTN_OK, // OK button + BTN_CANCEL, // Cancel button + SCROLL_BAR_V, // vertical scroll bar along the right edge of the list box. + }; + void getSectionPosSize(Point& rPos, Size& rSize, SectionType eType) const; + + void resetDisplayedItems(); + + DECL_LINK( CheckBoxHdl, CheckBox* ); + DECL_LINK( OKButtonHdl, OKButton* ); + DECL_LINK( ScrollHdl, ScrollBar* ); + +private: + + CheckBox maCheck0; + CheckBox maCheck1; + CheckBox maCheck2; + CheckBox maCheck3; + CheckBox maCheck4; + CheckBox maCheck5; + CheckBox maCheck6; + CheckBox maCheck7; + CheckBox maCheck8; + CheckBox maCheck9; + + ScrollBar maScrollBar; + + OKButton maBtnOk; + CancelButton maBtnCancel; + + ::std::vector mpCheckPtr; + + ::std::vector maMembers; + ::std::auto_ptr mpExtendedData; + ::std::auto_ptr mpOKAction; + + size_t mnScrollPos; +}; + +#endif diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx index 9b31289d13d0..32ecaf26cc56 100644 --- a/sc/source/ui/inc/gridwin.hxx +++ b/sc/source/ui/inc/gridwin.hxx @@ -39,6 +39,7 @@ #include #include +#include // --------------------------------------------------------------------------- @@ -48,6 +49,7 @@ class ScViewSelectionEngine; class ScPivot; #endif class ScDPObject; +class ScDPFieldPopupWindow; class ScOutputData; class ScFilterListBox; class AutoFilterPopup; @@ -159,6 +161,7 @@ private: ScFilterListBox* pFilterBox; FloatingWindow* pFilterFloat; + ::std::auto_ptr mpDPFieldPopup; USHORT nCursorHideCount; @@ -245,6 +248,16 @@ private: void DPMouseButtonUp( const MouseEvent& rMEvt ); void DPTestMouse( const MouseEvent& rMEvt, BOOL bMove ); + /** + * Check if the mouse click is on a field popup button. + * + * @return bool true if the field popup menu has been launched and no + * further mouse event handling is necessary, false otherwise. + */ + bool DPTestFieldPopupArrow(const MouseEvent& rMEvt, const ScAddress& rPos, ScDPObject* pDPObj); + void DPLaunchFieldPopupMenu( + const Point& rSrcPos, const Size& rSrcSize, const ScAddress& rPos, ScDPObject* pDPObj); + void RFMouseMove( const MouseEvent& rMEvt, BOOL bUp ); void PagebreakMove( const MouseEvent& rMEvt, BOOL bUp ); @@ -409,6 +422,8 @@ public: void CheckNeedsRepaint(); + void UpdateDPFromFieldPopupMenu(); + // #114409# void CursorChanged(); void DrawLayerCreated(); diff --git a/sc/source/ui/inc/pvlaydlg.hxx b/sc/source/ui/inc/pvlaydlg.hxx index b7a71aebc1fe..c77364d3761f 100644 --- a/sc/source/ui/inc/pvlaydlg.hxx +++ b/sc/source/ui/inc/pvlaydlg.hxx @@ -193,7 +193,7 @@ private: private: ScDPFieldWindow& GetFieldWindow ( ScDPFieldType eType ); void Init (); - void InitWndSelect ( LabelData** ppLabelArr, long nLabels ); + void InitWndSelect ( const ::std::vector& rLabels ); void InitWnd ( PivotField* pArr, long nCount, ScDPFieldType eType ); void InitFocus (); void InitFields (); diff --git a/sc/source/ui/undo/undodat.cxx b/sc/source/ui/undo/undodat.cxx index f16409b37239..ffc750a7ceb8 100644 --- a/sc/source/ui/undo/undodat.cxx +++ b/sc/source/ui/undo/undodat.cxx @@ -1876,7 +1876,7 @@ void __EXPORT ScUndoDataPilot::Undo() else { // delete inserted object - pDoc->GetDPCollection()->Free(pDocObj); + pDoc->GetDPCollection()->FreeTable(pDocObj); } } } @@ -1886,7 +1886,7 @@ void __EXPORT ScUndoDataPilot::Undo() ScDPObject* pDestObj = new ScDPObject( *pOldDPObject ); pDestObj->SetAlive(TRUE); - if ( !pDoc->GetDPCollection()->Insert(pDestObj) ) + if ( !pDoc->GetDPCollection()->InsertNewTable(pDestObj) ) { DBG_ERROR("cannot insert DPObject"); DELETEZ( pDestObj ); diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx index c71bc31a1150..e0d6693b39ef 100644 --- a/sc/source/ui/view/dbfunc3.cxx +++ b/sc/source/ui/view/dbfunc3.cxx @@ -81,9 +81,13 @@ #include "patattr.hxx" #include "unonames.hxx" #include "cell.hxx" +#include "userlist.hxx" #include +#include #include +#include +#include using namespace com::sun::star; using ::com::sun::star::uno::Any; @@ -94,8 +98,13 @@ using ::com::sun::star::beans::XPropertySet; using ::com::sun::star::container::XNameAccess; using ::com::sun::star::sheet::XDimensionsSupplier; using ::rtl::OUString; +using ::rtl::OUStringHash; using ::rtl::OUStringBuffer; using ::std::auto_ptr; +using ::std::list; +using ::std::vector; +using ::std::hash_map; +using ::std::hash_set; // STATIC DATA ----------------------------------------------------------- @@ -1681,6 +1690,134 @@ void lcl_MoveToEnd( ScDPSaveDimension& rDim, const String& rItemName ) // puts it to the end of the list even if it was in the list before. } +bool ScDBFunc::DataPilotSort( const ScAddress& rPos, bool bAscending, sal_uInt16* pUserListId ) +{ + ScDocument* pDoc = GetViewData()->GetDocument(); + ScDPObject* pDPObj = pDoc->GetDPAtCursor(rPos.Col(), rPos.Row(), rPos.Tab()); + if (!pDPObj) + return false; + + // We need to run this to get all members later. + pDPObj->BuildAllDimensionMembers(); + + USHORT nOrientation; + long nDimIndex = pDPObj->GetHeaderDim(rPos, nOrientation); + if (nDimIndex < 0) + // Invalid dimension index. Bail out. + return false; + + BOOL bDataLayout; + ScDPSaveData* pSaveData = pDPObj->GetSaveData(); + if (!pSaveData) + return false; + + ScDPSaveData aNewSaveData(*pSaveData); + String aDimName = pDPObj->GetDimName(nDimIndex, bDataLayout); + ScDPSaveDimension* pSaveDim = aNewSaveData.GetDimensionByName(aDimName); + if (!pSaveDim) + return false; + + typedef ScDPSaveDimension::MemberList MemList; + const MemList& rDimMembers = pSaveDim->GetMembers(); + list aMembers; + hash_set aMemberSet; + size_t nMemberCount = 0; + for (MemList::const_iterator itr = rDimMembers.begin(), itrEnd = rDimMembers.end(); + itr != itrEnd; ++itr) + { + ScDPSaveMember* pMem = *itr; + aMembers.push_back(pMem->GetName()); + aMemberSet.insert(pMem->GetName()); + ++nMemberCount; + } + + // Sort the member list in ascending order. + aMembers.sort(); + + // Collect and rank those custom sort strings that also exist in the member name list. + + typedef hash_map UserSortMap; + UserSortMap aSubStrs; + sal_uInt16 nSubCount = 0; + if (pUserListId) + { + ScUserList* pUserList = ScGlobal::GetUserList(); + if (!pUserList) + return false; + + { + sal_uInt16 n = pUserList->GetCount(); + if (!n || *pUserListId >= n) + return false; + } + + ScUserListData* pData = static_cast((*pUserList)[*pUserListId]); + if (pData) + { + sal_uInt16 n = pData->GetSubCount(); + for (sal_uInt16 i = 0; i < n; ++i) + { + OUString aSub = pData->GetSubStr(i); + if (!aMemberSet.count(aSub)) + // This string doesn't exist in the member name set. Don't add this. + continue; + + aSubStrs.insert(UserSortMap::value_type(aSub, nSubCount++)); + } + } + } + + // Rank all members. + + vector aRankedNames(nMemberCount); + sal_uInt16 nCurStrId = 0; + for (list::const_iterator itr = aMembers.begin(), itrEnd = aMembers.end(); + itr != itrEnd; ++itr) + { + OUString aName = *itr; + sal_uInt16 nRank = 0; + UserSortMap::const_iterator itrSub = aSubStrs.find(aName); + if (itrSub == aSubStrs.end()) + nRank = nSubCount + nCurStrId++; + else + nRank = itrSub->second; + + if (!bAscending) + nRank = nMemberCount - nRank - 1; + + aRankedNames[nRank] = aName; + } + + // Re-order ScDPSaveMember instances with the new ranks. + + for (vector::const_iterator itr = aRankedNames.begin(), itrEnd = aRankedNames.end(); + itr != itrEnd; ++itr) + { + const ScDPSaveMember* pOldMem = pSaveDim->GetExistingMemberByName(*itr); + if (!pOldMem) + // All members are supposed to be present. + continue; + + ScDPSaveMember* pNewMem = new ScDPSaveMember(*pOldMem); + pSaveDim->AddMember(pNewMem); + } + + // Set the sorting mode to manual for now. We may introduce a new sorting + // mode later on. + + sheet::DataPilotFieldSortInfo aSortInfo; + aSortInfo.Mode = sheet::DataPilotFieldSortMode::MANUAL; + pSaveDim->SetSortInfo(&aSortInfo); + + // Update the datapilot with the newly sorted field members. + + auto_ptr pNewObj(new ScDPObject(*pDPObj)); + pNewObj->SetSaveData(aNewSaveData); + ScDBDocFunc aFunc(*GetViewData()->GetDocShell()); + + return aFunc.DataPilotUpdate(pDPObj, pNewObj.get(), true, false); +} + BOOL ScDBFunc::DataPilotMove( const ScRange& rSource, const ScAddress& rDest ) { BOOL bRet = FALSE; diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 5591a2a496be..8949d2bd29a9 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -119,6 +119,7 @@ #include "drwlayer.hxx" #include "attrib.hxx" #include "validat.hxx" +#include "dpcontrol.hxx" // #114409# #include // FRound @@ -370,6 +371,7 @@ ScGridWindow::ScGridWindow( Window* pParent, ScViewData* pData, ScSplitPos eWhic pNoteMarker( NULL ), pFilterBox( NULL ), pFilterFloat( NULL ), + mpDPFieldPopup(NULL), nCursorHideCount( 0 ), bMarking( FALSE ), nButtonDown( 0 ), diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx index 92743ef65524..1cfb5bdf71c0 100644 --- a/sc/source/ui/view/gridwin2.cxx +++ b/sc/source/ui/view/gridwin2.cxx @@ -55,11 +55,23 @@ #include "dpoutput.hxx" // ScDPPositionData #include "dpshttab.hxx" #include "dbdocfun.hxx" +#include "dpcontrol.hxx" +#include "dpcontrol.hrc" +#include "strload.hxx" +#include "userlist.hxx" #include #include "scabstdlg.hxx" //CHINA001 -using namespace com::sun::star; +#include +#include + +using namespace com::sun::star; +using ::std::vector; +using ::std::auto_ptr; +using ::std::hash_map; +using ::rtl::OUString; +using ::rtl::OUStringHash; // STATIC DATA ----------------------------------------------------------- @@ -199,6 +211,15 @@ void ScGridWindow::DoPushButton( SCCOL nCol, SCROW nRow, const MouseEvent& rMEvt bDPMouse = TRUE; nDPField = nField; pDragDPObj = pDPObj; + + if (DPTestFieldPopupArrow(rMEvt, aPos, pDPObj)) + { + // field name pop up menu has been launched. Don't activate + // field move. + bDPMouse = false; + return; + } + DPTestMouse( rMEvt, TRUE ); StartTracking(); } @@ -726,6 +747,185 @@ void ScGridWindow::DPTestMouse( const MouseEvent& rMEvt, BOOL bMove ) pViewData->GetView()->ResetTimer(); } +bool ScGridWindow::DPTestFieldPopupArrow(const MouseEvent& rMEvt, const ScAddress& rPos, ScDPObject* pDPObj) +{ + // Get the geometry of the cell. + Point aSrcPos = pViewData->GetScrPos(rPos.Col(), rPos.Row(), eWhich); + long nSizeX, nSizeY; + pViewData->GetMergeSizePixel(rPos.Col(), rPos.Row(), nSizeX, nSizeY); + Size aSrcSize(nSizeX-1, nSizeY-1); + + // Check if the mouse cursor is clicking on the popup arrow box. + ScDPFieldButton aBtn(this, &GetSettings().GetStyleSettings()); + aBtn.setBoundingBox(aSrcPos, aSrcSize); + Point aPopupPos; + Size aPopupSize; + aBtn.getPopupBoundingBox(aPopupPos, aPopupSize); + Rectangle aRec(aPopupPos, aPopupSize); + if (aRec.IsInside(rMEvt.GetPosPixel())) + { + // Mouse cursor inside the popup arrow box. Launch the field menu. + DPLaunchFieldPopupMenu(OutputToScreenPixel(aSrcPos), aSrcSize, rPos, pDPObj); + return true; + } + + return false; +} + +namespace { + +struct DPFieldPopupData : public ScDPFieldPopupWindow::ExtendedData +{ + ScPivotParam maDPParam; + ScDPObject* mpDPObj; + long mnDim; +}; + +class DPFieldPopupOKAction : public ScMenuFloatingWindow::Action +{ +public: + explicit DPFieldPopupOKAction(ScGridWindow* p) : + mpGridWindow(p) {} + + virtual void execute() + { + mpGridWindow->UpdateDPFromFieldPopupMenu(); + } +private: + ScGridWindow* mpGridWindow; +}; + +class PopupSortAction : public ScMenuFloatingWindow::Action +{ +public: + enum SortType { ASCENDING, DESCENDING, CUSTOM }; + + explicit PopupSortAction(const ScAddress& rPos, SortType eType, sal_uInt16 nUserListIndex, ScTabViewShell* pViewShell) : + maPos(rPos), meType(eType), mnUserListIndex(nUserListIndex), mpViewShell(pViewShell) {} + + virtual void execute() + { + switch (meType) + { + case ASCENDING: + mpViewShell->DataPilotSort(maPos, true); + break; + case DESCENDING: + mpViewShell->DataPilotSort(maPos, false); + break; + case CUSTOM: + mpViewShell->DataPilotSort(maPos, true, &mnUserListIndex); + break; + default: + ; + } + } + +private: + ScAddress maPos; + SortType meType; + sal_uInt16 mnUserListIndex; + ScTabViewShell* mpViewShell; +}; + +} + +void ScGridWindow::DPLaunchFieldPopupMenu( + const Point& rSrcPos, const Size& rSrcSize, const ScAddress& rPos, ScDPObject* pDPObj) +{ + // We need to get the list of field members. + auto_ptr pDPData(new DPFieldPopupData); + pDPObj->FillLabelData(pDPData->maDPParam); + pDPData->mpDPObj = pDPObj; + + USHORT nOrient; + pDPData->mnDim = pDPObj->GetHeaderDim(rPos, nOrient); + + if (pDPData->maDPParam.maLabelArray.size() <= static_cast(pDPData->mnDim)) + // out-of-bound dimension ID. This should never happen! + return; + + const ScDPLabelData& rLabelData = *pDPData->maDPParam.maLabelArray[pDPData->mnDim]; + + mpDPFieldPopup.reset(new ScDPFieldPopupWindow(this)); + mpDPFieldPopup->setExtendedData(pDPData.release()); + mpDPFieldPopup->setOKAction(new DPFieldPopupOKAction(this)); + { + sal_Int32 n = rLabelData.maMembers.getLength(); + mpDPFieldPopup->setMemberSize(n); + for (sal_Int32 i = 0; i < n; ++i) + mpDPFieldPopup->addMember(rLabelData.maMembers[i], rLabelData.maVisible[i]); + mpDPFieldPopup->initMembers(); + } + + vector aUserSortNames; + ScUserList* pUserList = ScGlobal::GetUserList(); + if (pUserList) + { + sal_uInt16 n = pUserList->GetCount(); + aUserSortNames.reserve(n); + for (sal_uInt16 i = 0; i < n; ++i) + { + ScUserListData* pData = static_cast((*pUserList)[i]); + aUserSortNames.push_back(pData->GetString()); + } + } + + // Populate the menus. + ScTabViewShell* pViewShell = pViewData->GetViewShell(); + mpDPFieldPopup->addMenuItem( + ScRscStrLoader(RID_POPUP_FILTER, STR_MENU_SORT_ASC).GetString(), true, + new PopupSortAction(rPos, PopupSortAction::ASCENDING, 0, pViewShell)); + mpDPFieldPopup->addMenuItem( + ScRscStrLoader(RID_POPUP_FILTER, STR_MENU_SORT_DESC).GetString(), true, + new PopupSortAction(rPos, PopupSortAction::DESCENDING, 0, pViewShell)); + ScMenuFloatingWindow* pSubMenu = mpDPFieldPopup->addSubMenuItem( + ScRscStrLoader(RID_POPUP_FILTER, STR_MENU_SORT_CUSTOM).GetString(), !aUserSortNames.empty()); + + if (pSubMenu && !aUserSortNames.empty()) + { + size_t n = aUserSortNames.size(); + for (size_t i = 0; i < n; ++i) + { + pSubMenu->addMenuItem( + aUserSortNames[i], true, + new PopupSortAction(rPos, PopupSortAction::CUSTOM, i, pViewShell)); + } + } + + mpDPFieldPopup->SetPopupModeEndHdl( LINK(this, ScGridWindow, PopupModeEndHdl) ); + Rectangle aCellRect(rSrcPos, rSrcSize); + mpDPFieldPopup->StartPopupMode(aCellRect, (FLOATWIN_POPUPMODE_DOWN | FLOATWIN_POPUPMODE_GRABFOCUS)); +} + +void ScGridWindow::UpdateDPFromFieldPopupMenu() +{ + if (!mpDPFieldPopup.get()) + return; + + DPFieldPopupData* pDPData = static_cast(mpDPFieldPopup->getExtendedData()); + if (!pDPData) + return; + + ScDPObject* pDPObj = pDPData->mpDPObj; + ScDPObject aNewDPObj(*pDPObj); + aNewDPObj.BuildAllDimensionMembers(); + ScDPSaveData* pSaveData = aNewDPObj.GetSaveData(); + + BOOL bIsDataLayout; + String aDimName = pDPObj->GetDimName(pDPData->mnDim, bIsDataLayout); + ScDPSaveDimension* pDim = pSaveData->GetDimensionByName(aDimName); + if (!pDim) + return; + + hash_map aResult; + mpDPFieldPopup->getResult(aResult); + pDim->UpdateMemberVisibility(aResult); + + ScDBDocFunc aFunc(*pViewData->GetDocShell()); + aFunc.DataPilotUpdate(pDPObj, &aNewDPObj, true, false); +} + void ScGridWindow::DPMouseMove( const MouseEvent& rMEvt ) { DPTestMouse( rMEvt, TRUE ); diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index b90e5d3e802e..e6466e7ba3b1 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -73,6 +73,7 @@ #include "editutil.hxx" #include "inputopt.hxx" #include "fillinfo.hxx" +#include "dpcontrol.hxx" #include "sc.hrc" #include @@ -1203,6 +1204,8 @@ void ScGridWindow::DrawButtons( SCCOL nX1, SCROW /*nY1*/, SCCOL nX2, SCROW /*nY2 { aComboButton.SetOutputDevice( pContentDev ); + ScDPFieldButton aDPFieldBtn(pContentDev, &GetSettings().GetStyleSettings()); + SCCOL nCol; SCROW nRow; SCSIZE nArrY; @@ -1318,13 +1321,13 @@ void ScGridWindow::DrawButtons( SCCOL nX1, SCROW /*nY1*/, SCCOL nX2, SCROW /*nY2 nPosX -= nSizeX - 2; } - pContentDev->SetLineColor( GetSettings().GetStyleSettings().GetLightColor() ); - pContentDev->DrawLine( Point(nPosX,nPosY), Point(nPosX,nPosY+nSizeY-1) ); - pContentDev->DrawLine( Point(nPosX,nPosY), Point(nPosX+nSizeX-1,nPosY) ); - pContentDev->SetLineColor( GetSettings().GetStyleSettings().GetDarkShadowColor() ); - pContentDev->DrawLine( Point(nPosX,nPosY+nSizeY-1), Point(nPosX+nSizeX-1,nPosY+nSizeY-1) ); - pContentDev->DrawLine( Point(nPosX+nSizeX-1,nPosY), Point(nPosX+nSizeX-1,nPosY+nSizeY-1) ); - pContentDev->SetLineColor( COL_BLACK ); + String aStr; + pDoc->GetString(nCol, nRow, nTab, aStr); + aDPFieldBtn.setText(aStr); + aDPFieldBtn.setBoundingBox(Point(nPosX,nPosY), Size(nSizeX-1, nSizeY-1)); + aDPFieldBtn.setDrawPopupButton(pInfo->bPopupButton); + aDPFieldBtn.setHasHiddenMember(pInfo->bFilterActive); + aDPFieldBtn.draw(); } } } diff --git a/sc/util/makefile.mk b/sc/util/makefile.mk index fe2bf6bc636d..0a47fee22e1a 100644 --- a/sc/util/makefile.mk +++ b/sc/util/makefile.mk @@ -58,6 +58,7 @@ RESLIB1LIST=\ $(SRS)$/formdlgs.srs \ $(SRS)$/pagedlg.srs \ $(SRS)$/navipi.srs \ + $(SRS)$/cctrl.srs \ $(SOLARCOMMONRESDIR)$/sfx.srs RESLIB1NAME=sc -- cgit v1.2.3 From 44d83b68fd07342fdad4003ce4007e26669979f4 Mon Sep 17 00:00:00 2001 From: thb Date: Mon, 29 Jun 2009 15:15:41 +0200 Subject: #103174# Code from the ecntablet and eraser CWS; optionally improves user paint interactions in slideshow --- sd/source/ui/slideshow/makefile.mk | 4 + sd/source/ui/slideshow/slideshow.hrc | 22 +- sd/source/ui/slideshow/slideshow.src | 110 +++++++ sd/source/ui/slideshow/slideshowimpl.cxx | 335 +++++++++++++++++++-- sd/source/ui/slideshow/slideshowimpl.hxx | 9 +- slideshow/source/engine/eventmultiplexer.cxx | 29 +- slideshow/source/engine/shapes/shapeimporter.cxx | 113 ++++++- slideshow/source/engine/slide/slideimpl.cxx | 81 ++++- slideshow/source/engine/slide/userpaintoverlay.cxx | 282 ++++++++++++++--- slideshow/source/engine/slide/userpaintoverlay.hxx | 20 +- slideshow/source/engine/slideshowimpl.cxx | 291 +++++++++++++++++- slideshow/source/engine/tools.cxx | 31 +- slideshow/source/inc/eventmultiplexer.hxx | 25 ++ slideshow/source/inc/shapeimporter.hxx | 22 +- slideshow/source/inc/slide.hxx | 47 +-- slideshow/source/inc/tools.hxx | 3 + slideshow/source/inc/userpainteventhandler.hxx | 3 + 17 files changed, 1293 insertions(+), 134 deletions(-) diff --git a/sd/source/ui/slideshow/makefile.mk b/sd/source/ui/slideshow/makefile.mk index e157ba99d3bc..b9b3cc9ee84f 100644 --- a/sd/source/ui/slideshow/makefile.mk +++ b/sd/source/ui/slideshow/makefile.mk @@ -43,6 +43,10 @@ AUTOSEG=true .INCLUDE : settings.mk .INCLUDE : $(PRJ)$/util$/makefile.pmk +.IF "$(ENABLE_PRESENTER_EXTRA_UI)"="YES" +CDEFS+= -DENABLE_PRESENTER_EXTRA_UI +.ENDIF + # --- Files -------------------------------------------------------- diff --git a/sd/source/ui/slideshow/slideshow.hrc b/sd/source/ui/slideshow/slideshow.hrc index 8a9799321738..11a5f9807bb1 100644 --- a/sd/source/ui/slideshow/slideshow.hrc +++ b/sd/source/ui/slideshow/slideshow.hrc @@ -27,7 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - #ifndef SD_SLIDESHOW_HRC_ #define SD_SLIDESHOW_HRC_ @@ -38,8 +37,23 @@ #define CM_SCREEN_BLACK 5 #define CM_SCREEN_WHITE 6 #define CM_ENDSHOW 7 -#define CM_FIRST_SLIDE 8 -#define CM_LAST_SLIDE 9 -#define CM_SLIDES 10 +#define CM_ERASE_INK 8 +#define CM_ERASE_ALLINK 9 +#define CM_ERASE_INK_PEN 10 +#define CM_ERASE_INK_PEN_VERY_THIN 11 +#define CM_ERASE_INK_PEN_THIN 12 +#define CM_ERASE_INK_PEN_NORMAL 13 +#define CM_ERASE_INK_PEN_THICK 14 +#define CM_ERASE_INK_PEN_VERY_THICK 15 +#define CM_COLOR_PEN 16 +#define CM_WIDTH_PEN 17 +#define CM_WIDTH_PEN_VERY_THIN 18 +#define CM_WIDTH_PEN_THIN 19 +#define CM_WIDTH_PEN_NORMAL 20 +#define CM_WIDTH_PEN_THICK 21 +#define CM_WIDTH_PEN_VERY_THICK 22 +#define CM_FIRST_SLIDE 23 +#define CM_LAST_SLIDE 24 +#define CM_SLIDES 25 #endif diff --git a/sd/source/ui/slideshow/slideshow.src b/sd/source/ui/slideshow/slideshow.src index ec57d3e84897..7d5a05c463bd 100644 --- a/sd/source/ui/slideshow/slideshow.src +++ b/sd/source/ui/slideshow/slideshow.src @@ -75,6 +75,56 @@ Menu RID_SLIDESHOW_CONTEXTMENU Separator = TRUE; }; MenuItem + { + Identifier = CM_WIDTH_PEN; + Text [ en-US ] = "~Pen Width" ; + + SubMenu = Menu + { + ItemList = + { + MenuItem + { + Identifier = CM_WIDTH_PEN_VERY_THIN; + Text [ en-US ] = "~Very thin"; + }; + MenuItem + { + Identifier = CM_WIDTH_PEN_THIN; + Text [ en-US ] = "~Thin"; + }; + MenuItem + { + Identifier = CM_WIDTH_PEN_NORMAL; + Text [ en-US ] = "~Normal"; + }; + MenuItem + { + Identifier = CM_WIDTH_PEN_THICK; + Text [ en-US ] = "~Thick"; + }; + MenuItem + { + Identifier = CM_WIDTH_PEN_VERY_THICK; + Text [ en-US ] = "~Very Thick"; + }; + }; + }; + }; + MenuItem + { + Separator = TRUE; + }; + MenuItem + { + Identifier = CM_COLOR_PEN ; + Text [ en-US ] = "~Change Color" ; + }; + MenuItem + { + Separator = TRUE; + }; + MenuItem { Identifier = CM_SCREEN; Text [ en-US ] = "~Screen" ; @@ -101,6 +151,66 @@ Menu RID_SLIDESHOW_CONTEXTMENU Separator = TRUE; }; MenuItem + { + Identifier = CM_ERASE_ALLINK ; + Text [ en-US ] = "~Erase All Ink" ; + }; + MenuItem + { + Identifier = CM_ERASE_INK ; + Text [ en-US ] = "~Erase Ink Mode ON/OFF" ; + }; + MenuItem + { + Separator = TRUE; + }; + MenuItem + { + Identifier = CM_ERASE_ALLINK ; + Text [ en-US ] = "~Erase All Ink" ; + }; + MenuItem + { + Identifier = CM_ERASE_INK_PEN; + Text [ en-US ] = "~Eraser Size" ; + + SubMenu = Menu + { + ItemList = + { + MenuItem + { + Identifier = CM_ERASE_INK_PEN_VERY_THIN; + Text [ en-US ] = "~Very thin"; + }; + MenuItem + { + Identifier = CM_ERASE_INK_PEN_THIN; + Text [ en-US ] = "~Thin"; + }; + MenuItem + { + Identifier = CM_ERASE_INK_PEN_NORMAL; + Text [ en-US ] = "~Normal"; + }; + MenuItem + { + Identifier = CM_ERASE_INK_PEN_THICK; + Text [ en-US ] = "~Thick"; + }; + MenuItem + { + Identifier = CM_ERASE_INK_PEN_VERY_THICK; + Text [ en-US ] = "~Very Thick"; + }; + }; + }; + }; + MenuItem + { + Separator = TRUE; + }; + MenuItem { Identifier = CM_ENDSHOW ; Text [ en-US ] = "~End Show" ; diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index c0b4857f3f6b..e56c93f72b13 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -34,6 +34,7 @@ #include +#include "com/sun/star/frame/XComponentLoader.hpp" #include #include #include @@ -86,6 +87,7 @@ #include "canvas/elapsedtime.hxx" #include "canvas/prioritybooster.hxx" #include "avmedia/mediawindow.hxx" +#include "svtools/colrdlg.hxx" #include #include @@ -169,7 +171,7 @@ public: bool nextSlide(); bool previousSlide(); - void displayCurrentSlide( const Reference< XSlideShow >& xShow ); + void displayCurrentSlide( const Reference< XSlideShow >& xShow, const Reference< XDrawPagesSupplier>& xDrawPages); sal_Int32 getNextSlideIndex() const; sal_Int32 getPreviousSlideIndex() const; @@ -466,7 +468,7 @@ bool AnimationSlideController::previousSlide() return jumpToSlideIndex( getPreviousSlideIndex() ); } -void AnimationSlideController::displayCurrentSlide( const Reference< XSlideShow >& xShow ) +void AnimationSlideController::displayCurrentSlide( const Reference< XSlideShow >& xShow, const Reference< XDrawPagesSupplier>& xDrawPages ) { const sal_Int32 nCurrentSlideNumber = getCurrentSlideNumber(); @@ -488,7 +490,7 @@ void AnimationSlideController::displayCurrentSlide( const Reference< XSlideShow } if( getSlideAPI( nCurrentSlideNumber, xSlide, xAnimNode ) ) - xShow->displaySlide( xSlide, xAnimNode, aProperties ); + xShow->displaySlide( xSlide, xDrawPages, xAnimNode, aProperties ); } } @@ -523,7 +525,11 @@ SlideshowImpl::SlideshowImpl( const Reference< XPresentation2 >& xPresentation, , mbInputFreeze(false) , mbActive(sal_False) , maPresSettings( pDoc->getPresentationSettings() ) -, mnUserPaintColor( 0x0000FF00L ) +, mnUserPaintColor( 0x00000000L ) +, mdUserPaintStrokeWidth ( 4.0 ) +, mbEraseAllInk(false) +, mbEraseInk(false) +, mnEraseInkSize(100.0) , mnEntryCounter(0) , mnLastSlideNumber(-1) , msOnClick( RTL_CONSTASCII_USTRINGPARAM("OnClick") ) @@ -1087,7 +1093,7 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings ) aProperties.push_back( beans::PropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("UserPaintColor") ), - -1, Any( static_cast(0x0000FF00L) ), + -1, Any( static_cast(0x00000000L) ), beans::PropertyState_DIRECT_VALUE ) ); } @@ -1394,7 +1400,8 @@ void SlideshowImpl::displayCurrentSlide() if( mpSlideController.get() && mxShow.is() ) { - mpSlideController->displayCurrentSlide( mxShow ); + Reference< XDrawPagesSupplier > xDrawPages( mpDoc->getUnoModel(), UNO_QUERY_THROW ); + mpSlideController->displayCurrentSlide( mxShow, xDrawPages ); registerShapeEvents(mpSlideController->getCurrentSlideNumber()); update(); @@ -1411,6 +1418,12 @@ void SlideshowImpl::displayCurrentSlide() void SlideshowImpl::endPresentation() { + if( maPresSettings.mbMouseAsPen) + { + Reference< XMultiServiceFactory > xDocFactory(mpDoc->getUnoModel(), UNO_QUERY ); + if( xDocFactory.is() ) + mxShow->registerUserPaintPolygons(xDocFactory); + } if( !mnEndShowEvent ) mnEndShowEvent = Application::PostUserEvent( LINK(this, SlideshowImpl, endPresentationHdl) ); } @@ -2112,6 +2125,12 @@ IMPL_LINK( SlideshowImpl, ContextMenuHdl, void*, EMPTYARG ) PopupMenu* pMenu = new PopupMenu( SdResId( RID_SLIDESHOW_CONTEXTMENU ) ); +#ifdef ENABLE_PRESENTER_EXTRA_UI + //adding button to contextual menu for erasing functionnalities for UserPaintOverlay + pMenu->EnableItem( CM_ERASE_ALLINK, (maPresSettings.mbMouseAsPen)); + pMenu->EnableItem( CM_COLOR_PEN, (maPresSettings.mbMouseAsPen)); +#endif + const ShowWindowMode eMode = mpShowWindow->GetShowWindowMode(); pMenu->EnableItem( CM_NEXT_SLIDE, ( mpSlideController->getNextSlideIndex() != -1 ) ); pMenu->EnableItem( CM_PREV_SLIDE, ( mpSlideController->getPreviousSlideIndex() != -1 ) || (eMode == SHOWWINDOWMODE_END) || (eMode == SHOWWINDOWMODE_PAUSE) || (eMode == SHOWWINDOWMODE_BLANK) ); @@ -2179,6 +2198,100 @@ IMPL_LINK( SlideshowImpl, ContextMenuHdl, void*, EMPTYARG ) } } + PopupMenu* pWidthMenu = pMenu->GetPopupMenu( CM_WIDTH_PEN); + + // populate color width list + if( pWidthMenu ) + { + if(! maPresSettings.mbMouseAsPen) + { + pMenu->EnableItem( CM_WIDTH_PEN, FALSE ); + } + else + { + sal_Int32 nIterator; + double nWidth; + + nWidth = 4.0; + for( nIterator = 1; nIterator < 6; nIterator++) + { + switch(nIterator) + { + case 1: + nWidth = 4.0; + break; + case 2: + nWidth = 100.0; + break; + case 3: + nWidth = 150.0; + break; + case 4: + nWidth = 200.0; + break; + case 5: + nWidth = 400.0; + break; + default: + break; + } + + pWidthMenu->EnableItem( (USHORT)(CM_WIDTH_PEN + nIterator), TRUE); + if( nWidth == mdUserPaintStrokeWidth) + pWidthMenu->CheckItem( (USHORT)(CM_WIDTH_PEN + nIterator) ); + + } + } + } + +#ifdef ENABLE_PRESENTER_EXTRA_UI + PopupMenu* pEraseWidthMenu = pMenu->GetPopupMenu( CM_ERASE_INK_PEN); + + // populate eraser width list + if( pEraseWidthMenu ) + { + if(! maPresSettings.mbMouseAsPen) + { + pMenu->EnableItem( CM_ERASE_INK_PEN, FALSE ); + } + else + { + sal_Int32 nEIterator; + double nEWidth; + + nEWidth = 100.0; + for( nEIterator = 1; nEIterator < 6; nEIterator++) + { + switch(nEIterator) + { + case 1: + nEWidth = 100.0; + break; + case 2: + nEWidth = 200.0; + break; + case 3: + nEWidth = 300.0; + break; + case 4: + nEWidth = 400.0; + break; + case 5: + nEWidth = 500.0; + break; + default: + break; + } + + pEraseWidthMenu->EnableItem( (USHORT)(CM_ERASE_INK_PEN + nEIterator), TRUE); + if( nEWidth == mnEraseInkSize) + pEraseWidthMenu->CheckItem( (USHORT)(CM_ERASE_INK_PEN + nEIterator) ); + + } + } + } +#endif + pMenu->SetSelectHdl( LINK( this, SlideshowImpl, ContextMenuSelectHdl ) ); pMenu->Execute( mpShowWindow, maPopupMousePos ); delete pMenu; @@ -2241,32 +2354,134 @@ IMPL_LINK( SlideshowImpl, ContextMenuSelectHdl, Menu *, pMenu ) } } break; + case CM_COLOR_PEN: + if( maPresSettings.mbMouseAsPen ) + { + //Open a color picker based on SvColorDialog + ::Color aColor( mnUserPaintColor ); + SvColorDialog aColorDlg( mpShowWindow); + aColorDlg.SetColor( aColor ); - case CM_ENDSHOW: - // in case the user cancels the presentation, switch to current slide - // in edit mode - if( mpSlideController.get() && (ANIMATIONMODE_SHOW == meAnimationMode) ) - { - if( mpSlideController->getCurrentSlideNumber() != -1 ) + if (aColorDlg.Execute() ) + { + aColor = aColorDlg.GetColor(); + mnUserPaintColor = aColor.GetColor(); + setPenColor(mnUserPaintColor); + } + mbWasPaused = false; + } + break; + + case CM_WIDTH_PEN_VERY_THIN: + if( maPresSettings.mbMouseAsPen ) { - mnRestoreSlide = mpSlideController->getCurrentSlideNumber(); + setPenWidth(4.0); + mbWasPaused = false; } - } - endPresentation(); - break; - default: - sal_Int32 nPageNumber = nMenuId - CM_SLIDES; - const ShowWindowMode eMode = mpShowWindow->GetShowWindowMode(); - if( (eMode == SHOWWINDOWMODE_END) || (eMode == SHOWWINDOWMODE_PAUSE) || (eMode == SHOWWINDOWMODE_BLANK) ) - { - mpShowWindow->RestartShow( nPageNumber ); - } - else if( nPageNumber != mpSlideController->getCurrentSlideNumber() ) - { - displaySlideNumber( nPageNumber ); - } - mbWasPaused = false; - break; + break; + + case CM_WIDTH_PEN_THIN: + if( maPresSettings.mbMouseAsPen ) + { + setPenWidth(100.0); + mbWasPaused = false; + } + break; + + case CM_WIDTH_PEN_NORMAL: + if( maPresSettings.mbMouseAsPen ) + { + setPenWidth(150.0); + mbWasPaused = false; + } + break; + + case CM_WIDTH_PEN_THICK: + if( maPresSettings.mbMouseAsPen ) + { + setPenWidth(200.0); + mbWasPaused = false; + } + break; + + case CM_WIDTH_PEN_VERY_THICK: + if( maPresSettings.mbMouseAsPen ) + { + setPenWidth(400.0); + mbWasPaused = false; + } + break; + case CM_ERASE_ALLINK: + if( maPresSettings.mbMouseAsPen ) + { + setEraseAllInk(true); + mbWasPaused = false; + } + break; + case CM_ERASE_INK_PEN_VERY_THIN: + if( maPresSettings.mbMouseAsPen ) + { + setEraseInk(100.0); + mbWasPaused = false; + } + break; + + case CM_ERASE_INK_PEN_THIN: + if( maPresSettings.mbMouseAsPen ) + { + setEraseInk(200.0); + mbWasPaused = false; + } + break; + + case CM_ERASE_INK_PEN_NORMAL: + if( maPresSettings.mbMouseAsPen ) + { + setEraseInk(300.0); + mbWasPaused = false; + } + break; + + case CM_ERASE_INK_PEN_THICK: + if( maPresSettings.mbMouseAsPen ) + { + setEraseInk(400.0); + mbWasPaused = false; + } + break; + case CM_ERASE_INK_PEN_VERY_THICK: + if( maPresSettings.mbMouseAsPen ) + { + setEraseInk(500.0); + mbWasPaused = false; + } + break; + + case CM_ENDSHOW: + // in case the user cancels the presentation, switch to current slide + // in edit mode + if( mpSlideController.get() && (ANIMATIONMODE_SHOW == meAnimationMode) ) + { + if( mpSlideController->getCurrentSlideNumber() != -1 ) + { + mnRestoreSlide = mpSlideController->getCurrentSlideNumber(); + } + } + endPresentation(); + break; + default: + sal_Int32 nPageNumber = nMenuId - CM_SLIDES; + const ShowWindowMode eMode = mpShowWindow->GetShowWindowMode(); + if( (eMode == SHOWWINDOWMODE_END) || (eMode == SHOWWINDOWMODE_PAUSE) || (eMode == SHOWWINDOWMODE_BLANK) ) + { + mpShowWindow->RestartShow( nPageNumber ); + } + else if( nPageNumber != mpSlideController->getCurrentSlideNumber() ) + { + displaySlideNumber( nPageNumber ); + } + mbWasPaused = false; + break; } } @@ -2859,6 +3074,33 @@ void SAL_CALL SlideshowImpl::setUsePen( sal_Bool bMouseAsPen ) throw (RuntimeExc aPenProp.Value = aValue; mxShow->setProperty( aPenProp ); + //for StrokeWidth : + Any aValueWidth; + if( maPresSettings.mbMouseAsPen ) + aValueWidth <<= mdUserPaintStrokeWidth; + + beans::PropertyValue aPenPropWidth; + aPenPropWidth.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "UserPaintStrokeWidth" )); + aPenPropWidth.Value = aValueWidth; + + mxShow->setProperty( aPenPropWidth ); + + //for EraseAllInk : + Any aValueEraseAllInk; + if( maPresSettings.mbMouseAsPen ) + aValueEraseAllInk <<= mbEraseAllInk; + beans::PropertyValue aPenPropEraseAllInk; + aPenPropEraseAllInk.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EraseAllInk" )); + aPenPropEraseAllInk.Value = aValueEraseAllInk; + mxShow->setProperty( aPenPropEraseAllInk ); + //for EraseInk : + Any aValueEraseInk; + if( maPresSettings.mbMouseAsPen ) + aValueEraseInk <<= mnEraseInkSize; + beans::PropertyValue aPenPropEraseInk; + aPenPropEraseInk.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EraseInk" )); + aPenPropEraseInk.Value = aValueEraseInk; + mxShow->setProperty( aPenPropEraseInk ); } catch( Exception& e ) { @@ -2872,6 +3114,23 @@ void SAL_CALL SlideshowImpl::setUsePen( sal_Bool bMouseAsPen ) throw (RuntimeExc } } +// -------------------------------------------------------------------- +double SAL_CALL SlideshowImpl::getPenWidth() throw (RuntimeException) +{ + ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + return mdUserPaintStrokeWidth; +} + + +// -------------------------------------------------------------------- + +void SAL_CALL SlideshowImpl::setPenWidth( double dStrokeWidth ) throw (RuntimeException) +{ + ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + mdUserPaintStrokeWidth = dStrokeWidth; + if( maPresSettings.mbMouseAsPen ) + setUsePen( sal_True ); // update color and width +} // -------------------------------------------------------------------- sal_Int32 SAL_CALL SlideshowImpl::getPenColor() throw (RuntimeException) @@ -2890,6 +3149,24 @@ void SAL_CALL SlideshowImpl::setPenColor( sal_Int32 nColor ) throw (RuntimeExcep setUsePen( sal_True ); // update color } +// -------------------------------------------------------------------- + +void SAL_CALL SlideshowImpl::setEraseAllInk( bool bEraseAllInk ) throw (RuntimeException) +{ + ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + mbEraseAllInk=bEraseAllInk; + if( maPresSettings.mbMouseAsPen ) + setUsePen( sal_True ); // update erase all ink bool +} + + +void SAL_CALL SlideshowImpl::setEraseInk( double nEraseInkSize ) throw (RuntimeException) +{ + ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + mnEraseInkSize=nEraseInkSize; + if( maPresSettings.mbMouseAsPen ) + setUsePen( sal_True ); // update erase ink size +} // -------------------------------------------------------------------- // XSlideShowController Methods // -------------------------------------------------------------------- diff --git a/sd/source/ui/slideshow/slideshowimpl.hxx b/sd/source/ui/slideshow/slideshowimpl.hxx index b9d5506ff2f3..b492288b3f0c 100644 --- a/sd/source/ui/slideshow/slideshowimpl.hxx +++ b/sd/source/ui/slideshow/slideshowimpl.hxx @@ -200,8 +200,12 @@ public: virtual void SAL_CALL setMouseVisible( ::sal_Bool _mousevisible ) throw (css::uno::RuntimeException); virtual ::sal_Bool SAL_CALL getUsePen() throw (css::uno::RuntimeException); virtual void SAL_CALL setUsePen( ::sal_Bool _usepen ) throw (css::uno::RuntimeException); + virtual double SAL_CALL getPenWidth() throw (css::uno::RuntimeException); + virtual void SAL_CALL setPenWidth( double dStrokeWidth ) throw (css::uno::RuntimeException); virtual ::sal_Int32 SAL_CALL getPenColor() throw (css::uno::RuntimeException); virtual void SAL_CALL setPenColor( ::sal_Int32 _pencolor ) throw (css::uno::RuntimeException); + virtual void SAL_CALL setEraseAllInk( bool bEraseAllInk ) throw (css::uno::RuntimeException); + virtual void SAL_CALL setEraseInk( double nEraseInkSize ) throw (css::uno::RuntimeException); virtual ::sal_Bool SAL_CALL isRunning( ) throw (css::uno::RuntimeException); virtual ::sal_Int32 SAL_CALL getSlideCount( ) throw (css::uno::RuntimeException); virtual css::uno::Reference< css::drawing::XDrawPage > SAL_CALL getSlideByIndex( ::sal_Int32 Index ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException); @@ -380,7 +384,10 @@ private: PresentationSettings maPresSettings; sal_Int32 mnUserPaintColor; - + double mdUserPaintStrokeWidth; + bool mbEraseAllInk; + bool mbEraseInk; + double mnEraseInkSize; /// used in updateHdl to prevent recursive calls sal_Int32 mnEntryCounter; diff --git a/slideshow/source/engine/eventmultiplexer.cxx b/slideshow/source/engine/eventmultiplexer.cxx index 181a787301b7..31cd7cf286c4 100644 --- a/slideshow/source/engine/eventmultiplexer.cxx +++ b/slideshow/source/engine/eventmultiplexer.cxx @@ -262,8 +262,7 @@ struct EventMultiplexerImpl std::vector > ImplShapeCursorHandlers; typedef ThreadUnsafeListenerContainer< PrioritizedHandlerEntry, - std::vector< - PrioritizedHandlerEntry > > ImplHyperLinkHandlers; + std::vector > > ImplHyperLinkHandlers; template void forEachView( XSlideShowViewFunc pViewMethod ); @@ -1065,12 +1064,38 @@ bool EventMultiplexer::notifyUserPaintColor( RGBColor const& rUserColor ) boost::cref(rUserColor))); } +bool EventMultiplexer::notifyUserPaintStrokeWidth( double rUserStrokeWidth ) +{ + return mpImpl->maUserPaintEventHandlers.applyAll( + boost::bind(&UserPaintEventHandler::widthChanged, + _1, + rUserStrokeWidth)); +} + bool EventMultiplexer::notifyUserPaintDisabled() { return mpImpl->maUserPaintEventHandlers.applyAll( boost::mem_fn(&UserPaintEventHandler::disable)); } +//adding erasing all ink features with UserPaintOverlay +bool EventMultiplexer::notifyEraseAllInk( bool const& rEraseAllInk ) +{ + return mpImpl->maUserPaintEventHandlers.applyAll( + boost::bind(&UserPaintEventHandler::eraseAllInkChanged, + _1, + boost::cref(rEraseAllInk))); +} + +//adding erasing features with UserPaintOverlay +bool EventMultiplexer::notifyEraseInk( double rEraseInkSize ) +{ + return mpImpl->maUserPaintEventHandlers.applyAll( + boost::bind(&UserPaintEventHandler::eraseInkChanged, + _1, + boost::cref(rEraseInkSize))); +} + bool EventMultiplexer::notifyNextEffect() { return mpImpl->notifyNextEffect(); diff --git a/slideshow/source/engine/shapes/shapeimporter.cxx b/slideshow/source/engine/shapes/shapeimporter.cxx index 61f4d30fe2fc..54436c7330ed 100644 --- a/slideshow/source/engine/shapes/shapeimporter.cxx +++ b/slideshow/source/engine/shapes/shapeimporter.cxx @@ -39,9 +39,22 @@ #include #include #include +#include +#include +#include +#include #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "drawshapesubsetting.hxx" #include "drawshape.hxx" @@ -52,11 +65,13 @@ #include "slideshowexceptions.hxx" #include "gdimtftools.hxx" #include "tools.hxx" +#include "slideshowcontext.hxx" #include #include using namespace com::sun::star; +using namespace ::comphelper; namespace slideshow { namespace internal { @@ -436,7 +451,8 @@ ShapeSharedPtr ShapeImporter::createShape( bool ShapeImporter::isSkip( uno::Reference const& xPropSet, - rtl::OUString const& shapeType ) const + rtl::OUString const& shapeType, + uno::Reference< drawing::XLayer> const& xLayer ) { // skip empty presentation objects: bool bEmpty = false; @@ -448,6 +464,26 @@ bool ShapeImporter::isSkip( return true; } + //skip shapes which corresponds to annotations + if(xLayer.is()) + { + rtl::OUString layerName; + uno::Reference xPropLayerSet( + xLayer, uno::UNO_QUERY ); + const uno::Any& a(xPropLayerSet->getPropertyValue(rtl::OUString::createFromAscii("Name")) ); + bool const bRet = (a >>= layerName); + if(bRet) + { + if( layerName.equals(rtl::OUString::createFromAscii("DrawnInSlideshow"))) + { + //Transform shapes into PolyPolygons + importPolygons(xPropSet); + + return true; + } + } + } + // don't export presentation placeholders on masterpage // they can be non empty when user edits the default texts if(mbConvertingMasterPage) @@ -465,6 +501,46 @@ bool ShapeImporter::isSkip( return false; } + +void ShapeImporter::importPolygons(uno::Reference const& xPropSet) { + + drawing::PointSequenceSequence aRetval; + sal_Int32 nLineColor=0; + double fLineWidth; + getPropertyValue( aRetval, xPropSet, OUSTR("PolyPolygon") ); + getPropertyValue( nLineColor, xPropSet, OUSTR("LineColor") ); + getPropertyValue( fLineWidth, xPropSet, OUSTR("LineWidth") ); + + drawing::PointSequence* pOuterSequence = aRetval.getArray(); + awt::Point* pInnerSequence = pOuterSequence->getArray(); + + ::basegfx::B2DPolygon aPoly; + basegfx::B2DPoint aPoint; + for( sal_Int32 nCurrPoly=0; nCurrPolygetLength(); ++nCurrPoly ) + { + aPoint.setX((*pInnerSequence).X); + aPoint.setY((*pInnerSequence).Y); + aPoly.append( aPoint ); + *pInnerSequence++; + } + UnoViewVector::const_iterator aIter=(mrContext.mrViewContainer).begin(); + UnoViewVector::const_iterator aEnd=(mrContext.mrViewContainer).end(); + while(aIter != aEnd) + { + ::cppcanvas::PolyPolygonSharedPtr pPolyPoly( + ::cppcanvas::BaseGfxFactory::getInstance().createPolyPolygon( (*aIter)->getCanvas(), + aPoly ) ); + if( pPolyPoly ) + { + pPolyPoly->setRGBALineColor( unoColor2RGBColor( nLineColor ).getIntegerColor() ); + pPolyPoly->setStrokeWidth(fLineWidth); + pPolyPoly->draw(); + maPolygons.push_back(pPolyPoly); + } + aIter++; + } +} + ShapeSharedPtr ShapeImporter::importBackgroundShape() // throw (ShapeLoadFailedException) { if( maShapesStack.empty() ) @@ -506,10 +582,23 @@ ShapeSharedPtr ShapeImporter::importShape() // throw (ShapeLoadFailedException) throw ShapeLoadFailedException(); } - rtl::OUString const shapeType( xCurrShape->getShapeType() ); + //Retrieve the layer for the current shape + uno::Reference< drawing::XLayer > xDrawnInSlideshow; + + uno::Reference< drawing::XLayerSupplier > xLayerSupplier(mxPagesSupplier, uno::UNO_QUERY); + if(xLayerSupplier.is()) + { + uno::Reference< container::XNameAccess > xNameAccess = xLayerSupplier->getLayerManager(); + + uno::Reference< drawing::XLayerManager > xLayerManager(xNameAccess, uno::UNO_QUERY); + + xDrawnInSlideshow = xLayerManager->getLayerForShape(xCurrShape); + } + + rtl::OUString const shapeType( xCurrShape->getShapeType()); // is this shape presentation-invisible? - if( !isSkip(xPropSet, shapeType) ) + if( !isSkip(xPropSet, shapeType, xDrawnInSlideshow) ) { bIsGroupShape = shapeType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( @@ -549,13 +638,21 @@ bool ShapeImporter::isImportDone() const return maShapesStack.empty(); } -ShapeImporter::ShapeImporter( uno::Reference const& xPage, - uno::Reference const& xActualPage, - const SlideShowContext& rContext, - sal_Int32 nOrdNumStart, - bool bConvertingMasterPage ) : +PolyPolygonVector ShapeImporter::getPolygons() +{ + return maPolygons; +} + +ShapeImporter::ShapeImporter( uno::Reference const& xPage, + uno::Reference const& xActualPage, + uno::Reference const& xPagesSupplier, + const SlideShowContext& rContext, + sal_Int32 nOrdNumStart, + bool bConvertingMasterPage ) : mxPage( xActualPage ), + mxPagesSupplier( xPagesSupplier ), mrContext( rContext ), + maPolygons(), maShapesStack(), mnAscendingPrio( nOrdNumStart ), mbConvertingMasterPage( bConvertingMasterPage ) diff --git a/slideshow/source/engine/slide/slideimpl.cxx b/slideshow/source/engine/slide/slideimpl.cxx index 84b6ad7b4305..e895f98fa94a 100644 --- a/slideshow/source/engine/slide/slideimpl.cxx +++ b/slideshow/source/engine/slide/slideimpl.cxx @@ -82,7 +82,6 @@ #include #include - using namespace ::com::sun::star; // ----------------------------------------------------------------------------- @@ -101,6 +100,7 @@ class SlideImpl : public Slide, { public: SlideImpl( const uno::Reference& xDrawPage, + const uno::Reference& xDrawPages, const uno::Reference& xRootNode, EventQueue& rEventQueue, EventMultiplexer& rEventMultiplexer, @@ -112,7 +112,9 @@ public: const uno::Reference& xContext, const ShapeEventListenerMap& rShapeListenerMap, const ShapeCursorMap& rShapeCursorMap, + const PolyPolygonVector& rPolyPolygonVector, RGBColor const& rUserPaintColor, + double dUserPaintStrokeWidth, bool bUserPaintEnabled, bool bIntrinsicAnimationsAllowed, bool bDisableAnimationZOrder ); @@ -136,6 +138,9 @@ public: virtual basegfx::B2ISize getSlideSize() const; virtual uno::Reference getXDrawPage() const; virtual uno::Reference getXAnimationNode() const; + virtual PolyPolygonVector getPolygons(); + virtual void drawPolygons() const; + virtual bool isPaintOverlayActive() const; // TODO(F2): Rework SlideBitmap to no longer be based on XBitmap, // but on canvas-independent basegfx bitmaps @@ -201,6 +206,8 @@ private: /// End GIF and other intrinsic shape animations void startIntrinsicAnimations(); + /// Add Polygons to the member maPolygons + void addPolygons(PolyPolygonVector aPolygons); // Types // ===== @@ -230,6 +237,7 @@ private: /// The page model object uno::Reference< drawing::XDrawPage > mxDrawPage; + uno::Reference< drawing::XDrawPagesSupplier > mxDrawPagesSupplier; uno::Reference< animations::XAnimationNode > mxRootNode; LayerManagerSharedPtr mpLayerManager; @@ -244,8 +252,10 @@ private: /// Handles the animation and event generation for us SlideAnimations maAnimations; + PolyPolygonVector maPolygons; RGBColor maUserPaintColor; + double mdUserPaintStrokeWidth; UserPaintOverlaySharedPtr mpPaintOverlay; /// Bitmaps with slide content at various states @@ -287,6 +297,9 @@ private: /// When true, show() was called. Slide hidden oherwise. bool mbActive; + + ///When true, enablePaintOverlay was called and mbUserPaintOverlay = true + bool mbPaintOverlayActive; }; @@ -335,6 +348,7 @@ private: SlideImpl::SlideImpl( const uno::Reference< drawing::XDrawPage >& xDrawPage, + const uno::Reference& xDrawPages, const uno::Reference< animations::XAnimationNode >& xRootNode, EventQueue& rEventQueue, EventMultiplexer& rEventMultiplexer, @@ -346,11 +360,14 @@ SlideImpl::SlideImpl( const uno::Reference< drawing::XDrawPage >& xDra const uno::Reference< uno::XComponentContext >& xComponentContext, const ShapeEventListenerMap& rShapeListenerMap, const ShapeCursorMap& rShapeCursorMap, + const PolyPolygonVector& rPolyPolygonVector, RGBColor const& aUserPaintColor, + double dUserPaintStrokeWidth, bool bUserPaintEnabled, bool bIntrinsicAnimationsAllowed, bool bDisableAnimationZOrder ) : mxDrawPage( xDrawPage ), + mxDrawPagesSupplier( xDrawPages ), mxRootNode( xRootNode ), mpLayerManager( new LayerManager( rViewContainer, @@ -375,7 +392,9 @@ SlideImpl::SlideImpl( const uno::Reference< drawing::XDrawPage >& xDra mrCursorManager( rCursorManager ), maAnimations( maContext, getSlideSizeImpl() ), + maPolygons(rPolyPolygonVector), maUserPaintColor(aUserPaintColor), + mdUserPaintStrokeWidth(dUserPaintStrokeWidth), mpPaintOverlay(), maSlideBitmaps(), meAnimationState( CONSTRUCTING_STATE ), @@ -387,7 +406,8 @@ SlideImpl::SlideImpl( const uno::Reference< drawing::XDrawPage >& xDra mbShowLoaded( false ), mbHaveAnimations( false ), mbMainSequenceFound( false ), - mbActive( false ) + mbActive( false ), + mbPaintOverlayActive( false ) { // clone already existing views for slide bitmaps std::for_each( rViewContainer.begin(), @@ -436,6 +456,7 @@ void SlideImpl::dispose() mpShapeManager.reset(); mxRootNode.clear(); mxDrawPage.clear(); + mxDrawPagesSupplier.clear(); } bool SlideImpl::prefetch() @@ -583,6 +604,12 @@ uno::Reference SlideImpl::getXAnimationNode() const return mxRootNode; } +PolyPolygonVector SlideImpl::getPolygons() +{ + if(mbPaintOverlayActive) + maPolygons = mpPaintOverlay->getPolygons(); + return maPolygons; +} SlideBitmapSharedPtr SlideImpl::getCurrentSlideBitmap( const UnoViewSharedPtr& rView ) const { @@ -862,14 +889,47 @@ bool SlideImpl::implPrefetchShow() void SlideImpl::enablePaintOverlay() { if( mbUserPaintOverlayEnabled ) + { mpPaintOverlay = UserPaintOverlay::create( maUserPaintColor, - 2.0, - maContext ); + mdUserPaintStrokeWidth, + maContext, + maPolygons ); + mbPaintOverlayActive = true; + } +} + +void SlideImpl::drawPolygons() const +{ + if( mbUserPaintOverlayEnabled ) + mpPaintOverlay->drawPolygons(); +} + +void SlideImpl::addPolygons(PolyPolygonVector aPolygons) +{ + if(!aPolygons.empty()) + { + for( PolyPolygonVector::iterator aIter=aPolygons.begin(), + aEnd=aPolygons.end(); + aIter!=aEnd; + ++aIter ) + { + maPolygons.push_back(*aIter); + } + } +} + +bool SlideImpl::isPaintOverlayActive() const +{ + return mbPaintOverlayActive; } void SlideImpl::disablePaintOverlay() { + if(mbPaintOverlayActive) + maPolygons = mpPaintOverlay->getPolygons(); + mpPaintOverlay.reset(); + mbPaintOverlayActive = false; } ::basegfx::B2DRectangle SlideImpl::getSlideRect() const @@ -1073,6 +1133,7 @@ bool SlideImpl::loadShapes() // ------------------------------------------------------------------------- ShapeImporter aMPShapesFunctor( xMasterPage, mxDrawPage, + mxDrawPagesSupplier, maContext, 0, /* shape num starts at 0 */ true ); @@ -1087,6 +1148,7 @@ bool SlideImpl::loadShapes() if( rShape ) mpLayerManager->addShape( rShape ); } + addPolygons(aMPShapesFunctor.getPolygons()); nCurrCount = xMasterPageShapes->getCount() + 1; } @@ -1121,6 +1183,7 @@ bool SlideImpl::loadShapes() ShapeImporter aShapesFunctor( mxDrawPage, mxDrawPage, + mxDrawPagesSupplier, maContext, nCurrCount, false ); @@ -1132,6 +1195,7 @@ bool SlideImpl::loadShapes() if( rShape ) mpLayerManager->addShape( rShape ); } + addPolygons(aShapesFunctor.getPolygons()); } catch( uno::RuntimeException& ) { @@ -1176,6 +1240,7 @@ basegfx::B2ISize SlideImpl::getSlideSizeImpl() const SlideSharedPtr createSlide( const uno::Reference< drawing::XDrawPage >& xDrawPage, + const uno::Reference& xDrawPages, const uno::Reference< animations::XAnimationNode >& xRootNode, EventQueue& rEventQueue, EventMultiplexer& rEventMultiplexer, @@ -1187,18 +1252,20 @@ SlideSharedPtr createSlide( const uno::Reference< drawing::XDrawPage >& const uno::Reference< uno::XComponentContext >& xComponentContext, const ShapeEventListenerMap& rShapeListenerMap, const ShapeCursorMap& rShapeCursorMap, + const PolyPolygonVector& rPolyPolygonVector, RGBColor const& rUserPaintColor, + double dUserPaintStrokeWidth, bool bUserPaintEnabled, bool bIntrinsicAnimationsAllowed, bool bDisableAnimationZOrder ) { - boost::shared_ptr pRet( new SlideImpl( xDrawPage, xRootNode, rEventQueue, + boost::shared_ptr pRet( new SlideImpl( xDrawPage, xDrawPages, xRootNode, rEventQueue, rEventMultiplexer, rScreenUpdater, rActivitiesQueue, rUserEventQueue, rCursorManager, rViewContainer, xComponentContext, rShapeListenerMap, - rShapeCursorMap, rUserPaintColor, - bUserPaintEnabled, + rShapeCursorMap, rPolyPolygonVector, rUserPaintColor, + dUserPaintStrokeWidth, bUserPaintEnabled, bIntrinsicAnimationsAllowed, bDisableAnimationZOrder )); diff --git a/slideshow/source/engine/slide/userpaintoverlay.cxx b/slideshow/source/engine/slide/userpaintoverlay.cxx index 5cdfbddc1193..d9854f67b6fe 100644 --- a/slideshow/source/engine/slide/userpaintoverlay.cxx +++ b/slideshow/source/engine/slide/userpaintoverlay.cxx @@ -54,7 +54,8 @@ #include #include - +#include "slide.hxx" +#include "cursormanager.hxx" using namespace ::com::sun::star; @@ -63,29 +64,40 @@ namespace slideshow namespace internal { class PaintOverlayHandler : public MouseEventHandler, - public ViewEventHandler + public ViewEventHandler, + public UserPaintEventHandler { public: - PaintOverlayHandler( const RGBColor& rStrokeColor, - double nStrokeWidth, - ActivitiesQueue& rActivitiesQueue, - ScreenUpdater& rScreenUpdater, - const UnoViewContainer& rViews ) : + PaintOverlayHandler( const RGBColor& rStrokeColor, + double nStrokeWidth, + ActivitiesQueue& rActivitiesQueue, + ScreenUpdater& rScreenUpdater, + const UnoViewContainer& rViews, + Slide& rSlide, + const PolyPolygonVector& rPolygons ) : mrActivitiesQueue( rActivitiesQueue ), mrScreenUpdater( rScreenUpdater ), maViews(), + maPolygons( rPolygons ), maStrokeColor( rStrokeColor ), mnStrokeWidth( nStrokeWidth ), maLastPoint(), maLastMouseDownPos(), mbIsLastPointValid( false ), - mbIsLastMouseDownPosValid( false ) + mbIsLastMouseDownPosValid( false ), + //handle the "remove all ink from slide" mode of erasing + mbIsEraseAllModeActivated( false ), + //handle the "remove stroke by stroke" mode of erasing + mbIsEraseModeActivated( false ), + mrSlide(rSlide), + mnSize(100.0) { std::for_each( rViews.begin(), rViews.end(), boost::bind( &PaintOverlayHandler::viewAdded, this, _1 )); + drawPolygons(); } virtual void dispose() @@ -118,9 +130,103 @@ namespace slideshow // polygon and repaint here. } + bool colorChanged( RGBColor const& rUserColor ) + { + maStrokeColor = rUserColor; + return true; + } + + bool widthChanged( double nUserStrokeWidth ) + { + mnStrokeWidth = nUserStrokeWidth; + return true; + } + + bool eraseAllInkChanged( bool const& rEraseAllInk ) + { + mbIsEraseAllModeActivated= rEraseAllInk; + // if the erase all mode is activated it will remove all ink from slide, + // therefor destroy all the polygons stored + if(mbIsEraseAllModeActivated) + { + // must get access to the instance to erase all polygon + for( UnoViewVector::iterator aIter=maViews.begin(), aEnd=maViews.end(); + aIter!=aEnd; + ++aIter ) + { + // fully clear view content to background color + (*aIter)->getCanvas()->clear(); + + //get via SlideImpl instance the bitmap of the slide unmodified to redraw it + SlideBitmapSharedPtr pBitmap( mrSlide.getCurrentSlideBitmap( (*aIter) ) ); + ::cppcanvas::CanvasSharedPtr pCanvas( (*aIter)->getCanvas() ); + + const ::basegfx::B2DHomMatrix aViewTransform( (*aIter)->getTransformation() ); + const ::basegfx::B2DPoint aOutPosPixel( aViewTransform * ::basegfx::B2DPoint() ); + + // setup a canvas with device coordinate space, the slide + // bitmap already has the correct dimension. + ::cppcanvas::CanvasSharedPtr pDevicePixelCanvas( pCanvas->clone() ); + + pDevicePixelCanvas->setTransformation( ::basegfx::B2DHomMatrix() ); + + // render at given output position + pBitmap->move( aOutPosPixel ); + + // clear clip (might have been changed, e.g. from comb + // transition) + pBitmap->clip( ::basegfx::B2DPolyPolygon() ); + pBitmap->draw( pDevicePixelCanvas ); + + mrScreenUpdater.notifyUpdate(*aIter,true); + } + } + mbIsEraseAllModeActivated=false; + return true; + } + + bool eraseInkChanged( double rEraseInkSize ) + { + if(mbIsEraseModeActivated) + mbIsEraseModeActivated=false; + else + mbIsEraseModeActivated=true; + return true; + } + + bool disable() + { + return true; + } + + //Draw all registered polygons. + void drawPolygons() + { + for( PolyPolygonVector::iterator aIter=maPolygons.begin(), aEnd=maPolygons.end(); + aIter!=aEnd; + ++aIter ) + { + (*aIter)->draw(); + } + // screen update necessary to show painting + mrScreenUpdater.notifyUpdate(); + } + + //Retrieve all registered polygons. + PolyPolygonVector getPolygons() + { + return maPolygons; + } + // MouseEventHandler methods virtual bool handleMousePressed( const awt::MouseEvent& e ) { + if (e.Buttons == awt::MouseButton::RIGHT) + { + mbIsLastPointValid = false; + return false; + } + if (e.Buttons != awt::MouseButton::LEFT) return false; @@ -135,6 +241,12 @@ namespace slideshow virtual bool handleMouseReleased( const awt::MouseEvent& e ) { + if (e.Buttons == awt::MouseButton::RIGHT) + { + mbIsLastPointValid = false; + return false; + } + if (e.Buttons != awt::MouseButton::LEFT) return false; @@ -180,42 +292,108 @@ namespace slideshow virtual bool handleMouseDragged( const awt::MouseEvent& e ) { - if( !mbIsLastPointValid ) - { - mbIsLastPointValid = true; - maLastPoint.setX( e.X ); - maLastPoint.setY( e.Y ); - } - else + if(mbIsEraseModeActivated) { + //define the last point as an object + //we suppose that there's no way this point could be valid ::basegfx::B2DPolygon aPoly; + + maLastPoint.setX( e.X-mnSize ); + maLastPoint.setY( e.Y-mnSize ); + aPoly.append( maLastPoint ); - maLastPoint.setX( e.X ); - maLastPoint.setY( e.Y ); + maLastPoint.setX( e.X-mnSize ); + maLastPoint.setY( e.Y+mnSize ); aPoly.append( maLastPoint ); + maLastPoint.setX( e.X+mnSize ); + maLastPoint.setY( e.Y+mnSize ); - // paint to all views + aPoly.append( maLastPoint ); + maLastPoint.setX( e.X+mnSize ); + maLastPoint.setY( e.Y-mnSize ); + + aPoly.append( maLastPoint ); + maLastPoint.setX( e.X-mnSize ); + maLastPoint.setY( e.Y-mnSize ); + + aPoly.append( maLastPoint ); + + //now we have defined a Polygon that is closed + + //The point is to redraw the LastPoint the way it was originally on the bitmap, + //of the slide for( UnoViewVector::iterator aIter=maViews.begin(), aEnd=maViews.end(); - aIter!=aEnd; - ++aIter ) + aIter!=aEnd; + ++aIter ) { - ::cppcanvas::PolyPolygonSharedPtr pPolyPoly( - ::cppcanvas::BaseGfxFactory::getInstance().createPolyPolygon( (*aIter)->getCanvas(), - aPoly ) ); - if( pPolyPoly ) - { - pPolyPoly->setRGBALineColor( maStrokeColor.getIntegerColor() ); - pPolyPoly->draw(); - } + //get via SlideImpl instance the bitmap of the slide unmodified to redraw it + SlideBitmapSharedPtr pBitmap( mrSlide.getCurrentSlideBitmap( (*aIter) ) ); + ::cppcanvas::CanvasSharedPtr pCanvas( (*aIter)->getCanvas() ); + + ::basegfx::B2DHomMatrix aViewTransform( (*aIter)->getTransformation() ); + const ::basegfx::B2DPoint aOutPosPixel( aViewTransform * ::basegfx::B2DPoint() ); + + // setup a canvas with device coordinate space, the slide + // bitmap already has the correct dimension. + ::cppcanvas::CanvasSharedPtr pDevicePixelCanvas( pCanvas->clone() ); + + pDevicePixelCanvas->setTransformation( ::basegfx::B2DHomMatrix() ); + + // render at given output position + pBitmap->move( aOutPosPixel ); + + ::basegfx::B2DPolyPolygon aPolyPoly=::basegfx::B2DPolyPolygon(aPoly); + aViewTransform.translate(-aOutPosPixel.getX(), -aOutPosPixel.getY()); + aPolyPoly.transform(aViewTransform); + // set clip so that we just redraw a part of the canvas + pBitmap->clip(aPolyPoly); + pBitmap->draw( pDevicePixelCanvas ); + + mrScreenUpdater.notifyUpdate(*aIter,true); } - // screen update necessary to show painting - mrScreenUpdater.notifyUpdate(); } + else + { + if( !mbIsLastPointValid ) + { + mbIsLastPointValid = true; + maLastPoint.setX( e.X ); + maLastPoint.setY( e.Y ); + } + else + { + ::basegfx::B2DPolygon aPoly; + aPoly.append( maLastPoint ); + + maLastPoint.setX( e.X ); + maLastPoint.setY( e.Y ); + + aPoly.append( maLastPoint ); + + // paint to all views + for( UnoViewVector::iterator aIter=maViews.begin(), aEnd=maViews.end(); + aIter!=aEnd; + ++aIter ) + { + ::cppcanvas::PolyPolygonSharedPtr pPolyPoly( + ::cppcanvas::BaseGfxFactory::getInstance().createPolyPolygon( (*aIter)->getCanvas(), + aPoly ) ); + + if( pPolyPoly ) + { + pPolyPoly->setRGBALineColor( maStrokeColor.getIntegerColor() ); + pPolyPoly->draw(); + } + } + // screen update necessary to show painting + mrScreenUpdater.notifyUpdate(); + } + } // mouse events captured return true; } @@ -226,42 +404,67 @@ namespace slideshow return false; // did not handle the event } + + private: ActivitiesQueue& mrActivitiesQueue; ScreenUpdater& mrScreenUpdater; UnoViewVector maViews; + PolyPolygonVector maPolygons; RGBColor maStrokeColor; double mnStrokeWidth; basegfx::B2DPoint maLastPoint; basegfx::B2DPoint maLastMouseDownPos; bool mbIsLastPointValid; bool mbIsLastMouseDownPosValid; + // added bool for erasing purpose : + bool mbIsEraseAllModeActivated; + bool mbIsEraseModeActivated; + Slide& mrSlide; + double mnSize; }; - UserPaintOverlaySharedPtr UserPaintOverlay::create( const RGBColor& rStrokeColor, - double nStrokeWidth, - const SlideShowContext& rContext ) + UserPaintOverlaySharedPtr UserPaintOverlay::create( const RGBColor& rStrokeColor, + double nStrokeWidth, + const SlideShowContext& rContext, + const PolyPolygonVector& rPolygons ) { UserPaintOverlaySharedPtr pRet( new UserPaintOverlay( rStrokeColor, nStrokeWidth, - rContext )); + rContext, + rPolygons )); return pRet; } - UserPaintOverlay::UserPaintOverlay( const RGBColor& rStrokeColor, - double nStrokeWidth, - const SlideShowContext& rContext ) : + UserPaintOverlay::UserPaintOverlay( const RGBColor& rStrokeColor, + double nStrokeWidth, + const SlideShowContext& rContext, + const PolyPolygonVector& rPolygons ) : mpHandler( new PaintOverlayHandler( rStrokeColor, nStrokeWidth, rContext.mrActivitiesQueue, rContext.mrScreenUpdater, - rContext.mrViewContainer )), + rContext.mrViewContainer, + //adding a link to Slide + dynamic_cast(rContext.mrCursorManager), + rPolygons )), mrMultiplexer( rContext.mrEventMultiplexer ) { mrMultiplexer.addClickHandler( mpHandler, 3.0 ); mrMultiplexer.addMouseMoveHandler( mpHandler, 3.0 ); mrMultiplexer.addViewHandler( mpHandler ); + mrMultiplexer.addUserPaintHandler(mpHandler); + } + + PolyPolygonVector UserPaintOverlay::getPolygons() + { + return mpHandler->getPolygons(); + } + + void UserPaintOverlay::drawPolygons() + { + mpHandler->drawPolygons(); } UserPaintOverlay::~UserPaintOverlay() @@ -273,7 +476,8 @@ namespace slideshow mrMultiplexer.removeViewHandler( mpHandler ); mpHandler->dispose(); } - catch (uno::Exception &) { + catch (uno::Exception &) + { OSL_ENSURE( false, rtl::OUStringToOString( comphelper::anyToString( cppu::getCaughtException() ), diff --git a/slideshow/source/engine/slide/userpaintoverlay.hxx b/slideshow/source/engine/slide/userpaintoverlay.hxx index 34a171f1740c..bc85ff649adb 100644 --- a/slideshow/source/engine/slide/userpaintoverlay.hxx +++ b/slideshow/source/engine/slide/userpaintoverlay.hxx @@ -38,7 +38,7 @@ #include #include - +#include /* Definition of UserPaintOverlay class */ @@ -51,7 +51,7 @@ namespace slideshow class PaintOverlayHandler; typedef ::boost::shared_ptr< class UserPaintOverlay > UserPaintOverlaySharedPtr; - + typedef ::std::vector< ::cppcanvas::PolyPolygonSharedPtr> PolyPolygonVector; /** Slide overlay, which can be painted into by the user. This class registers itself at the EventMultiplexer, @@ -69,15 +69,19 @@ namespace slideshow @param nStrokeWidth Width of the stroked path */ - static UserPaintOverlaySharedPtr create( const RGBColor& rStrokeColor, - double nStrokeWidth, - const SlideShowContext& rContext ); + static UserPaintOverlaySharedPtr create( const RGBColor& rStrokeColor, + double nStrokeWidth, + const SlideShowContext& rContext, + const PolyPolygonVector& rPolygons ); ~UserPaintOverlay(); + PolyPolygonVector getPolygons(); + void drawPolygons(); private: - UserPaintOverlay( const RGBColor& rStrokeColor, - double nStrokeWidth, - const SlideShowContext& rContext ); + UserPaintOverlay( const RGBColor& rStrokeColor, + double nStrokeWidth, + const SlideShowContext& rContext, + const PolyPolygonVector& rPolygons ); ::boost::shared_ptr mpHandler; EventMultiplexer& mrMultiplexer; diff --git a/slideshow/source/engine/slideshowimpl.cxx b/slideshow/source/engine/slideshowimpl.cxx index ac0f256324d7..ad63f4d80d17 100644 --- a/slideshow/source/engine/slideshowimpl.cxx +++ b/slideshow/source/engine/slideshowimpl.cxx @@ -47,6 +47,7 @@ #include #include #include +#include #include #include @@ -62,6 +63,7 @@ #include #include +#include "rtl/ref.hxx" #include #include @@ -73,6 +75,16 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "com/sun/star/uno/Reference.hxx" #include #include "unoviewcontainer.hxx" @@ -101,6 +113,7 @@ #include #include #include +#include #include #include @@ -144,6 +157,13 @@ namespace { typedef cppu::WeakComponentImplHelper1 SlideShowImplBase; +typedef ::std::vector< ::cppcanvas::PolyPolygonSharedPtr> PolyPolygonVector; + +/// Maps XDrawPage for annotations persistence +typedef ::std::map< ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XDrawPage>, + PolyPolygonVector> PolygonMap; + class SlideShowImpl : private cppu::BaseMutex, public CursorManager, public SlideShowImplBase @@ -223,9 +243,11 @@ private: throw (uno::RuntimeException); virtual void SAL_CALL displaySlide( uno::Reference const& xSlide, + uno::Reference const& xDrawPages, uno::Reference const& xRootNode, uno::Sequence const& rProperties ) throw (uno::RuntimeException); + virtual void SAL_CALL registerUserPaintPolygons( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xDocFactory ) throw (::com::sun::star::uno::RuntimeException); virtual sal_Bool SAL_CALL setProperty( beans::PropertyValue const& rProperty ) throw (uno::RuntimeException); virtual sal_Bool SAL_CALL addView( @@ -278,9 +300,13 @@ private: /// Stop currently running show. void stopShow(); + ///Find a polygons vector in maPolygons (map) + PolygonMap::iterator findPolygons( uno::Reference const& xDrawPage); + /// Creates a new slide. SlideSharedPtr makeSlide( uno::Reference const& xDrawPage, + uno::Reference const& xDrawPages, uno::Reference const& xRootNode ); /// Checks whether the given slide/animation node matches mpPrefetchSlide @@ -333,8 +359,19 @@ private: /// map of sal_Int16 values, specifying the mouse cursor for every shape ShapeCursorMap maShapeCursors; + //map of vector of Polygons, containing polygons drawn on each slide. + PolygonMap maPolygons; + boost::optional maUserPaintColor; + boost::optional maUserPaintStrokeWidth; + + //changed for the eraser project + boost::optional maEraseAllInk; + + boost::optional maEraseInk; + //end changed + boost::shared_ptr mpPresTimer; ScreenUpdater maScreenUpdater; EventQueue maEventQueue; @@ -363,6 +400,8 @@ private: SlideSharedPtr mpPrefetchSlide; /// slide to be prefetched: best candidate for upcoming slide uno::Reference mxPrefetchSlide; + /// save the XDrawPagesSupplier to retieve polygons + uno::Reference mxDrawPagesSupplier; /// slide animation to be prefetched: uno::Reference mxPrefetchAnimationNode; @@ -447,6 +486,7 @@ SlideShowImpl::SlideShowImpl( maShapeEventListeners(), maShapeCursors(), maUserPaintColor(), + maUserPaintStrokeWidth(4.0), mpPresTimer( new canvas::tools::ElapsedTime ), maScreenUpdater(maViewContainer), maEventQueue( mpPresTimer ), @@ -466,6 +506,7 @@ SlideShowImpl::SlideShowImpl( mpCurrentSlide(), mpPrefetchSlide(), mxPrefetchSlide(), + mxDrawPagesSupplier(), mxPrefetchAnimationNode(), mnCurrentCursor(awt::SystemPointer::ARROW), mbWaitState(false), @@ -756,14 +797,38 @@ ActivitySharedPtr SlideShowImpl::createSlideTransition( true )); } +PolygonMap::iterator SlideShowImpl::findPolygons( uno::Reference const& xDrawPage) +{ + // TODO(P2) : Optimze research in the map. + bool bFound = false; + PolygonMap::iterator aIter=maPolygons.begin(); + + + while(aIter!=maPolygons.end() && !bFound) + { + if(aIter->first == xDrawPage) + bFound = true; + else + aIter++; + } + + return aIter; +} + SlideSharedPtr SlideShowImpl::makeSlide( - uno::Reference const& xDrawPage, - uno::Reference const& xRootNode ) + uno::Reference const& xDrawPage, + uno::Reference const& xDrawPages, + uno::Reference const& xRootNode ) { - if (! xDrawPage.is()) + if( !xDrawPage.is() ) return SlideSharedPtr(); + //Retrieve polygons for the current slide + PolygonMap::iterator aIter; + aIter = findPolygons(xDrawPage); + const SlideSharedPtr pSlide( createSlide(xDrawPage, + xDrawPages, xRootNode, maEventQueue, maEventMultiplexer, @@ -775,7 +840,9 @@ SlideSharedPtr SlideShowImpl::makeSlide( mxComponentContext, maShapeEventListeners, maShapeCursors, + (aIter != maPolygons.end()) ? aIter->second : PolyPolygonVector(), maUserPaintColor ? *maUserPaintColor : RGBColor(), + *maUserPaintStrokeWidth, !!maUserPaintColor, mbImageAnimationsAllowed, mbDisableAnimationZOrder) ); @@ -817,7 +884,14 @@ void SlideShowImpl::stopShow() // Force-end running animation // =========================== if (mpCurrentSlide) + { mpCurrentSlide->hide(); + //Register polygons in the map + if(findPolygons(mpCurrentSlide->getXDrawPage()) != maPolygons.end()) + maPolygons.erase(mpCurrentSlide->getXDrawPage()); + + maPolygons.insert(make_pair(mpCurrentSlide->getXDrawPage(),mpCurrentSlide->getPolygons())); + } // clear all queues maEventQueue.clear(); @@ -869,6 +943,7 @@ struct SlideShowImpl::PrefetchPropertiesFunc void SlideShowImpl::displaySlide( uno::Reference const& xSlide, + uno::Reference const& xDrawPages, uno::Reference const& xRootNode, uno::Sequence const& rProperties ) throw (uno::RuntimeException) @@ -881,6 +956,8 @@ void SlideShowImpl::displaySlide( // precondition: must only be called from the main thread! DBG_TESTSOLARMUTEX(); + mxDrawPagesSupplier = xDrawPages; + stopShow(); // MUST call that: results in // maUserEventQueue.clear(). What's more, // stopShow()'s currSlide->hide() call is @@ -914,7 +991,7 @@ void SlideShowImpl::displaySlide( } else { - mpCurrentSlide = makeSlide( xSlide, xRootNode ); + mpCurrentSlide = makeSlide( xSlide, xDrawPages, xRootNode ); } OSL_ASSERT( mpCurrentSlide ); @@ -1133,6 +1210,129 @@ sal_Bool SlideShowImpl::removeView( return true; } +void SlideShowImpl::registerUserPaintPolygons( const uno::Reference< lang::XMultiServiceFactory >& xDocFactory ) throw (uno::RuntimeException) +{ + //Retrieve Polygons if user ends presentation by context menu + if (mpCurrentSlide) + { + if(findPolygons(mpCurrentSlide->getXDrawPage()) != maPolygons.end()) + maPolygons.erase(mpCurrentSlide->getXDrawPage()); + + maPolygons.insert(make_pair(mpCurrentSlide->getXDrawPage(),mpCurrentSlide->getPolygons())); + } + + //Creating the layer for shapes + // query for the XLayerManager + uno::Reference< drawing::XLayerSupplier > xLayerSupplier(xDocFactory, uno::UNO_QUERY); + uno::Reference< container::XNameAccess > xNameAccess = xLayerSupplier->getLayerManager(); + + uno::Reference< drawing::XLayerManager > xLayerManager(xNameAccess, uno::UNO_QUERY); + // create a layer and set its properties + uno::Reference< drawing::XLayer > xDrawnInSlideshow = xLayerManager->insertNewByIndex(xLayerManager->getCount()); + uno::Reference< beans::XPropertySet > xLayerPropSet(xDrawnInSlideshow, uno::UNO_QUERY); + + //Layer Name which enables to catch annotations + rtl::OUString layerName = rtl::OUString::createFromAscii("DrawnInSlideshow"); + uno::Any aPropLayer; + + aPropLayer <<= layerName; + xLayerPropSet->setPropertyValue(rtl::OUString::createFromAscii("Name"), aPropLayer); + + aPropLayer <<= true; + xLayerPropSet->setPropertyValue(rtl::OUString::createFromAscii("IsVisible"), aPropLayer); + + aPropLayer <<= false; + xLayerPropSet->setPropertyValue(rtl::OUString::createFromAscii("IsLocked"), aPropLayer); + + PolygonMap::iterator aIter=maPolygons.begin(); + + PolyPolygonVector aPolygons; + ::cppcanvas::PolyPolygonSharedPtr pPolyPoly; + ::basegfx::B2DPolyPolygon b2DPolyPoly; + + //Register polygons for each slide + while(aIter!=maPolygons.end()) + { + aPolygons = aIter->second; + //Get shapes for the slide + ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > Shapes(aIter->first, ::com::sun::star::uno::UNO_QUERY); + //Retrieve polygons for one slide + for( PolyPolygonVector::iterator aIterPoly=aPolygons.begin(), + aEnd=aPolygons.end(); + aIterPoly!=aEnd; ++aIterPoly ) + { + pPolyPoly = (*aIterPoly); + b2DPolyPoly = ::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(pPolyPoly->getUNOPolyPolygon()); + + //Normally there is only one polygon + for(sal_uInt32 i=0; i< b2DPolyPoly.count();i++) + { + const ::basegfx::B2DPolygon& aPoly = b2DPolyPoly.getB2DPolygon(i); + sal_uInt32 nPoints = aPoly.count(); + + if( nPoints > 1) + { + //create the PolyLineShape + uno::Reference< uno::XInterface > polyshape(xDocFactory->createInstance( + rtl::OUString::createFromAscii("com.sun.star.drawing.PolyLineShape") ) ); + uno::Reference< drawing::XShape > rPolyShape(polyshape, uno::UNO_QUERY); + + //Add the shape to the slide + Shapes->add(rPolyShape); + + //Retrieve shape properties + uno::Reference< beans::XPropertySet > aXPropSet = uno::Reference< beans::XPropertySet >( rPolyShape, uno::UNO_QUERY ); + //Construct a sequence of points sequence + drawing::PointSequenceSequence aRetval; + //Create only one sequence for one polygon + aRetval.realloc( 1 ); + // Retrieve the sequence of points from aRetval + drawing::PointSequence* pOuterSequence = aRetval.getArray(); + // Create 2 points in this sequence + pOuterSequence->realloc(nPoints); + // Get these points which are in an array + awt::Point* pInnerSequence = pOuterSequence->getArray(); + for( sal_uInt32 n = 0; n < nPoints; n++ ) + { + //Create a point from the polygon + *pInnerSequence++ = awt::Point( aPoly.getB2DPoint(n).getX(), aPoly.getB2DPoint(n).getY()); + } + + //Fill the properties + //Give the built PointSequenceSequence. + uno::Any aParam; + aParam <<= aRetval; + aXPropSet->setPropertyValue( rtl::OUString::createFromAscii("PolyPolygon"), aParam ); + + //LineStyle : SOLID by default + uno::Any aAny; + drawing::LineStyle eLS; + eLS = drawing::LineStyle_SOLID; + aAny <<= eLS; + aXPropSet->setPropertyValue( rtl::OUString::createFromAscii("LineStyle"), aAny ); + + //LineColor + sal_uInt32 nLineColor; + nLineColor = pPolyPoly->getRGBALineColor(); + //Transform polygon color from RRGGBBAA to AARRGGBB + aAny <<= RGBAColor2UnoColor(nLineColor); + aXPropSet->setPropertyValue( rtl::OUString::createFromAscii("LineColor"), aAny ); + + //LineWidth + double fLineWidth; + fLineWidth = pPolyPoly->getStrokeWidth(); + aAny <<= (sal_Int32)fLineWidth; + aXPropSet->setPropertyValue( rtl::OUString::createFromAscii("LineWidth"), aAny ); + + // make polygons special + xLayerManager->attachShapeToLayer(rPolyShape, xDrawnInSlideshow); + } + } + } + ++aIter; + } +} + sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty ) throw (uno::RuntimeException) { @@ -1183,6 +1383,82 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty ) return true; } + //adding support for erasing features in UserPaintOverlay + if (rProperty.Name.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("EraseAllInk") )) + { + bool nEraseAllInk(false); + if (rProperty.Value >>= nEraseAllInk) + { + OSL_ENSURE( mbMouseVisible, + "setProperty(): User paint overrides invisible mouse" ); + + // enable user paint + maEraseAllInk.reset( nEraseAllInk ); + maEventMultiplexer.notifyEraseAllInk( *maEraseAllInk ); + } + else + { + // disable user paint + maEraseAllInk.reset(); + maEventMultiplexer.notifyUserPaintDisabled(); + } + + if( mnCurrentCursor == awt::SystemPointer::ARROW ) + resetCursor(); + + return true; + } + + if (rProperty.Name.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("EraseInk") )) + { + double nEraseInk(0.0); + if (rProperty.Value >>= nEraseInk) + { + OSL_ENSURE( mbMouseVisible, + "setProperty(): User paint overrides invisible mouse" ); + + // enable user paint + maEraseInk.reset( nEraseInk ); + maEventMultiplexer.notifyEraseInk( *maEraseInk ); + } + else + { + // disable user paint + maEraseInk.reset(); + maEventMultiplexer.notifyUserPaintDisabled(); + } + + if( mnCurrentCursor == awt::SystemPointer::ARROW ) + resetCursor(); + + return true; + } + + // new Property for pen's width + if (rProperty.Name.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("UserPaintStrokeWidth") )) + { + double nWidth(4.0); + if (rProperty.Value >>= nWidth) + { + OSL_ENSURE( mbMouseVisible,"setProperty(): User paint overrides invisible mouse" ); + // enable user paint stroke width + maUserPaintStrokeWidth.reset( nWidth ); + maEventMultiplexer.notifyUserPaintStrokeWidth( *maUserPaintStrokeWidth ); + } + else + { + // disable user paint stroke width + maUserPaintStrokeWidth.reset(); + maEventMultiplexer.notifyUserPaintDisabled(); + } + if( mnCurrentCursor == awt::SystemPointer::ARROW ) + resetCursor(); + return true; + } + if (rProperty.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("AdvanceOnClick") )) { @@ -1654,6 +1930,9 @@ void SlideShowImpl::notifySlideAnimationsEnded() { osl::MutexGuard const guard( m_aMutex ); + //Draw polygons above animations + mpCurrentSlide->drawPolygons(); + OSL_ENSURE( !isDisposed(), "### already disposed!" ); // This struct will receive the (interruptable) event, @@ -1738,7 +2017,7 @@ void SlideShowImpl::notifySlideAnimationsEnded() if (! matches( mpPrefetchSlide, mxPrefetchSlide, mxPrefetchAnimationNode )) { - mpPrefetchSlide = makeSlide( mxPrefetchSlide, + mpPrefetchSlide = makeSlide( mxPrefetchSlide, mxDrawPagesSupplier, mxPrefetchAnimationNode ); } if (mpPrefetchSlide) @@ -1832,6 +2111,8 @@ bool SlideShowImpl::handleAnimationEvent( const AnimationNodeSharedPtr& rNode ) boost::bind( &animations::XAnimationListener::endEvent, _1, boost::cref(xNode) )); + if(mpCurrentSlide->isPaintOverlayActive()) + mpCurrentSlide->drawPolygons(); break; default: break; diff --git a/slideshow/source/engine/tools.cxx b/slideshow/source/engine/tools.cxx index b2c179647db3..be3a39849040 100644 --- a/slideshow/source/engine/tools.cxx +++ b/slideshow/source/engine/tools.cxx @@ -163,10 +163,10 @@ namespace slideshow // ========================= /// extract unary double value from Any - bool extractValue( double& o_rValue, - const uno::Any& rSourceAny, - const ShapeSharedPtr& rShape, - const ::basegfx::B2DVector& rSlideBounds ) + bool extractValue( double& o_rValue, + const uno::Any& rSourceAny, + const ShapeSharedPtr& rShape, + const ::basegfx::B2DVector& rSlideBounds ) { // try to extract numeric value (double, or smaller POD, like float or int) if( (rSourceAny >>= o_rValue) ) @@ -637,8 +637,8 @@ namespace slideshow aTransform ); } - ::basegfx::B2DRange getShapeUpdateArea( const ::basegfx::B2DRange& rUnitBounds, - const ::basegfx::B2DRange& rShapeBounds ) + ::basegfx::B2DRange getShapeUpdateArea( const ::basegfx::B2DRange& rUnitBounds, + const ::basegfx::B2DRange& rShapeBounds ) { return ::basegfx::B2DRectangle( lerp( rShapeBounds.getMinX(), @@ -710,6 +710,17 @@ namespace slideshow static_cast< sal_uInt8 >( nColor >> 24U ) ) ); } + sal_Int32 RGBAColor2UnoColor( ::cppcanvas::Color::IntSRGBA aColor ) + { + return ::cppcanvas::makeColorARGB( + // convert from IntSRGBA color to API color + // (0xRRGGBBAA -> 0xAARRGGBB) + static_cast< sal_uInt8 >(0), + ::cppcanvas::getRed(aColor), + ::cppcanvas::getGreen(aColor), + ::cppcanvas::getBlue(aColor)); + } + void fillRect( const ::cppcanvas::CanvasSharedPtr& rCanvas, const ::basegfx::B2DRectangle& rRect, ::cppcanvas::Color::IntSRGBA aFillColor ) @@ -806,12 +817,12 @@ namespace slideshow // determine transformed page bounds const basegfx::B2DRange aRect( 0,0, - rSlideSize.getX(), - rSlideSize.getY() ); + rSlideSize.getX(), + rSlideSize.getY() ); basegfx::B2DRange aTmpRect; canvas::tools::calcTransformedRectBounds( aTmpRect, - aRect, - pView->getTransformation() ); + aRect, + pView->getTransformation() ); // #i42440# Returned slide size is one pixel too small, as // rendering happens one pixel to the right and below the diff --git a/slideshow/source/inc/eventmultiplexer.hxx b/slideshow/source/inc/eventmultiplexer.hxx index 303ae4dda898..01722ee0b527 100644 --- a/slideshow/source/inc/eventmultiplexer.hxx +++ b/slideshow/source/inc/eventmultiplexer.hxx @@ -486,6 +486,31 @@ public: */ bool notifyUserPaintColor( RGBColor const& rUserColor ); + /** Notify a new user paint width + + Sending this notification also implies that user paint is + enabled. . + + @return true, if this event was processed by + anybody. If false is returned, no handler processed + this event (and probably, nothing will happen at all) + */ + bool notifyUserPaintStrokeWidth( double rUserStrokeWidth ); + + + /** Notify a new user paint erase all ink mode + + Sending this notification also implies that user paint is + enabled. User paint denotes the feature to draw colored lines + on top of the slide content. + + @return true, if this event was processed by + anybody. If false is returned, no handler processed + this event (and probably, nothing will happen at all) + */ + bool notifyEraseAllInk( bool const& rEraseAllInk ); + bool notifyEraseInk( double rEraseInkSize ); + /** Notify that user paint is disabled User paint denotes the feature to draw colored lines on top of diff --git a/slideshow/source/inc/shapeimporter.hxx b/slideshow/source/inc/shapeimporter.hxx index d5e95ac45568..e86db9c7a864 100644 --- a/slideshow/source/inc/shapeimporter.hxx +++ b/slideshow/source/inc/shapeimporter.hxx @@ -33,6 +33,9 @@ #include #include #include +#include +#include "unoviewcontainer.hxx" +#include "unoview.hxx" #include "shape.hxx" @@ -43,6 +46,10 @@ namespace internal { struct SlideShowContext; +typedef ::std::vector< ::cppcanvas::PolyPolygonSharedPtr> PolyPolygonVector; +typedef ::boost::shared_ptr< UnoView > UnoViewSharedPtr; +typedef ::std::vector< UnoViewSharedPtr > UnoViewVector; + /** This class imports all shapes from a given XShapes object */ class ShapeImporter @@ -75,6 +82,8 @@ public: ::com::sun::star::drawing::XDrawPage >& xPage, const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& xActualPage, + const ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XDrawPagesSupplier>& xPagesSupplier, const SlideShowContext& rContext, sal_Int32 nOrdNumStart, bool bConvertingMasterPage ); @@ -95,11 +104,13 @@ public: importShape() call. */ bool isImportDone() const; - + PolyPolygonVector getPolygons(); private: bool isSkip( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> const& xPropSet, - ::rtl::OUString const& shapeType ) const; + ::rtl::OUString const& shapeType, + ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XLayer> const& xLayer); ShapeSharedPtr createShape( ::com::sun::star::uno::Reference< @@ -108,6 +119,8 @@ private: ::com::sun::star::beans::XPropertySet> const& xPropSet, ::rtl::OUString const& shapeType ) const; + void importPolygons(::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > const& xPropSet) ; + struct XShapesEntry { ShapeSharedPtr const mpGroupShape; @@ -130,10 +143,11 @@ private: ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage> mxPage; + ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XDrawPagesSupplier> mxPagesSupplier; const SlideShowContext& mrContext; - + PolyPolygonVector maPolygons; XShapesStack maShapesStack; - double mnAscendingPrio; bool mbConvertingMasterPage; }; diff --git a/slideshow/source/inc/slide.hxx b/slideshow/source/inc/slide.hxx index 90cc7cf6d1b1..9a467c164a96 100644 --- a/slideshow/source/inc/slide.hxx +++ b/slideshow/source/inc/slide.hxx @@ -42,6 +42,7 @@ namespace com { namespace sun { namespace star { namespace drawing { class XDrawPage; + class XDrawPagesSupplier; } namespace uno { class XComponentContext; @@ -63,7 +64,7 @@ namespace slideshow { class RGBColor; class ScreenUpdater; - + typedef ::std::vector< ::cppcanvas::PolyPolygonSharedPtr> PolyPolygonVector; class Slide { public: @@ -117,6 +118,14 @@ namespace slideshow virtual ::com::sun::star::uno::Reference< ::com::sun::star::animations::XAnimationNode > getXAnimationNode() const = 0; + ///Gets the slide Polygons + virtual PolyPolygonVector getPolygons() = 0; + + ///Draw the slide Polygons + virtual void drawPolygons() const = 0; + + ///Check if slide is already active + virtual bool isPaintOverlayActive() const = 0; // Slide bitmaps // ------------------------------------------------------------------- @@ -183,24 +192,28 @@ namespace slideshow UserEeventQueue */ SlideSharedPtr createSlide( const ::com::sun::star::uno::Reference< - ::com::sun::star::drawing::XDrawPage >& xDrawPage, + ::com::sun::star::drawing::XDrawPage >& xDrawPage, + const ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XDrawPagesSupplier >& xDrawPages, const ::com::sun::star::uno::Reference< - ::com::sun::star::animations::XAnimationNode >& xRootNode, - EventQueue& rEventQueue, - EventMultiplexer& rEventMultiplexer, - ScreenUpdater& rScreenUpdater, - ActivitiesQueue& rActivitiesQueue, - UserEventQueue& rUserEventQueue, - CursorManager& rCursorManager, - const UnoViewContainer& rViewContainer, + ::com::sun::star::animations::XAnimationNode >& xRootNode, + EventQueue& rEventQueue, + EventMultiplexer& rEventMultiplexer, + ScreenUpdater& rScreenUpdater, + ActivitiesQueue& rActivitiesQueue, + UserEventQueue& rUserEventQueue, + CursorManager& rCursorManager, + const UnoViewContainer& rViewContainer, const ::com::sun::star::uno::Reference< - ::com::sun::star::uno::XComponentContext >& xContext, - const ShapeEventListenerMap& rShapeListenerMap, - const ShapeCursorMap& rShapeCursorMap, - RGBColor const& aUserPaintColor, - bool bUserPaintEnabled, - bool bIntrinsicAnimationsAllowed, - bool bDisableAnimationZOrder ); + ::com::sun::star::uno::XComponentContext >& xContext, + const ShapeEventListenerMap& rShapeListenerMap, + const ShapeCursorMap& rShapeCursorMap, + const PolyPolygonVector& rPolyPolygonVector, + RGBColor const& aUserPaintColor, + double dUserPaintStrokeWidth, + bool bUserPaintEnabled, + bool bIntrinsicAnimationsAllowed, + bool bDisableAnimationZOrder ); } } diff --git a/slideshow/source/inc/tools.hxx b/slideshow/source/inc/tools.hxx index bb10864419cb..71d2aae74fc1 100644 --- a/slideshow/source/inc/tools.hxx +++ b/slideshow/source/inc/tools.hxx @@ -289,6 +289,9 @@ namespace slideshow /** Convert a plain UNO API 32 bit int to RGBColor */ RGBColor unoColor2RGBColor( sal_Int32 ); + /** Convert an IntSRGBA to plain UNO API 32 bit int + */ + sal_Int32 RGBAColor2UnoColor( cppcanvas::Color::IntSRGBA ); /** Fill a plain rectangle on the given canvas with the given color */ diff --git a/slideshow/source/inc/userpainteventhandler.hxx b/slideshow/source/inc/userpainteventhandler.hxx index c688af984197..1a9ab5fbb64a 100644 --- a/slideshow/source/inc/userpainteventhandler.hxx +++ b/slideshow/source/inc/userpainteventhandler.hxx @@ -53,6 +53,9 @@ namespace slideshow virtual ~UserPaintEventHandler() {} virtual bool colorChanged( RGBColor const& rUserColor ) = 0; + virtual bool widthChanged( double nUserStrokeWidth ) = 0; + virtual bool eraseAllInkChanged(bool const& rEraseAllInk) =0; + virtual bool eraseInkChanged(double rEraseInkSize) =0; virtual bool disable() = 0; }; -- cgit v1.2.3 From a0587039eb5d0517b8687d1e8cbecdaea311caf7 Mon Sep 17 00:00:00 2001 From: thb Date: Mon, 29 Jun 2009 15:15:41 +0200 Subject: #103174# Code from the ecntablet and eraser CWS; optionally improves user paint interactions in slideshow --- configure.in | 14 ++++++++++++++ set_soenv.in | 1 + solenv/bin/build.pl | 0 solenv/bin/gccinstlib.pl | 0 4 files changed, 15 insertions(+) mode change 100644 => 100755 solenv/bin/build.pl mode change 100644 => 100755 solenv/bin/gccinstlib.pl diff --git a/configure.in b/configure.in index 94d57c0245df..0d5be46cba58 100644 --- a/configure.in +++ b/configure.in @@ -376,6 +376,10 @@ AC_ARG_WITH(beanshell-jar, [ --with-beanshell-jar=JARFILE Specify path to jarfile manually ], [ BSH_JAR="$withval" ]) +AC_ARG_ENABLE(presenter-extra-ui, +[ --enable-presenter-extra-ui enables extra functionality during slideshow, + e.g. selecting pen color, erasing drawings etc. +],,enable_presenter_extra_ui=no) AC_ARG_ENABLE(minimizer, [ --enable-minimizer enables the build of the Presentation Minimizer extension ],,) @@ -5379,6 +5383,16 @@ fi AC_SUBST(ENABLE_OPENGL) +AC_MSG_CHECKING([whether to build extra presenter ui]) +if test -n "$enable_presenter_extra_ui" -a "$enable_presenter_extra_ui" != "no"; then + AC_MSG_RESULT([yes]) + ENABLE_PRESENTER_EXTRA_UI=YES +else + AC_MSG_RESULT([no]) + ENABLE_PRESENTER_EXTRA_UI=NO +fi +AC_SUBST(ENABLE_PRESENTER_EXTRA_UI) + AC_MSG_CHECKING([whether to build the Presentation Minimizer extension]) if test -n "$enable_minimizer" -a "$enable_minimizer" != "no"; then AC_MSG_RESULT([yes]) diff --git a/set_soenv.in b/set_soenv.in index 3219c4493c50..c2ba9d361579 100644 --- a/set_soenv.in +++ b/set_soenv.in @@ -1661,6 +1661,7 @@ ToFile( "ENABLE_STATIC_GTK", "@ENABLE_STATIC_GTK@", "e" ); ToFile( "ENABLE_CAIRO", "@ENABLE_CAIRO@", "e" ); ToFile( "ENABLE_OPENGL", "@ENABLE_OPENGL@", "e" ); ToFile( "ENABLE_PDFIMPORT", "@ENABLE_PDFIMPORT@", "e" ); +ToFile( "ENABLE_PRESENTER_EXTRA_UI","@ENABLE_PRESENTER_EXTRA_UI@","e" ); ToFile( "ENABLE_MINIMIZER", "@ENABLE_MINIMIZER@","e" ); ToFile( "ENABLE_PRESENTER_SCREEN","@ENABLE_PRESENTER_SCREEN@","e" ); ToFile( "ENABLE_REPORTBUILDER","@ENABLE_REPORTBUILDER@","e" ); diff --git a/solenv/bin/build.pl b/solenv/bin/build.pl old mode 100644 new mode 100755 diff --git a/solenv/bin/gccinstlib.pl b/solenv/bin/gccinstlib.pl old mode 100644 new mode 100755 -- cgit v1.2.3 From 51df7ffd3ff8107524ab2b238196a3ff91e7ad77 Mon Sep 17 00:00:00 2001 From: thb Date: Mon, 29 Jun 2009 15:15:41 +0200 Subject: #103174# Code from the ecntablet and eraser CWS; optionally improves user paint interactions in slideshow --- cppcanvas/inc/cppcanvas/color.hxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cppcanvas/inc/cppcanvas/color.hxx b/cppcanvas/inc/cppcanvas/color.hxx index 7441f6f2937a..e1cb30900e5e 100644 --- a/cppcanvas/inc/cppcanvas/color.hxx +++ b/cppcanvas/inc/cppcanvas/color.hxx @@ -83,6 +83,11 @@ namespace cppcanvas return (nRed << 24U)|(nGreen << 16U)|(nBlue << 8U)|(nAlpha); } + inline sal_Int32 makeColorARGB( sal_uInt8 nAlpha, sal_uInt8 nRed, sal_uInt8 nGreen, sal_uInt8 nBlue) + { + return (nAlpha << 24U)|(nRed << 16U)|(nGreen << 8U)|(nBlue); + } + } #endif /* _CPPCANVAS_COLOR_HXX */ -- cgit v1.2.3 From 3faab003ceeebd990b543252c015defe66e74679 Mon Sep 17 00:00:00 2001 From: thb Date: Mon, 29 Jun 2009 15:15:41 +0200 Subject: #103174# Code from the ecntablet and eraser CWS; optionally improves user paint interactions in slideshow --- offapi/com/sun/star/presentation/XSlideShow.idl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/offapi/com/sun/star/presentation/XSlideShow.idl b/offapi/com/sun/star/presentation/XSlideShow.idl index 3d7f928249c9..0d6065f1b0ed 100644 --- a/offapi/com/sun/star/presentation/XSlideShow.idl +++ b/offapi/com/sun/star/presentation/XSlideShow.idl @@ -46,9 +46,15 @@ #ifndef __com_sun_star_animations_XAnimationNode_idl__ #include #endif +#endif +#ifndef __com_sun_star_lang_XMultiServiceFactory_idl__ +#include #ifndef __com_sun_star_drawing_XDrawPage_idl__ #include #endif +#ifndef __com_sun_star_drawing_XDrawPagesSupplier_idl__ +#include +#endif #ifndef __com_sun_star_drawing_XShape_idl__ #include #endif @@ -150,6 +156,7 @@ interface XSlideShow : ::com::sun::star::uno::XInterface */ void displaySlide( [in] ::com::sun::star::drawing::XDrawPage xSlide, + [in] ::com::sun::star::drawing::XDrawPagesSupplier xDrawPages, [in] ::com::sun::star::animations::XAnimationNode aAnimationNode, [in] sequence< ::com::sun::star::beans::PropertyValue > aProperties ); @@ -176,6 +183,14 @@ interface XSlideShow : ::com::sun::star::uno::XInterface */ ::com::sun::star::drawing::XDrawPage getCurrentSlide(); + /** Register drawn polygons in presentation mode + + @param xDocFactory + + */ + + void registerUserPaintPolygons([in] ::com::sun::star::lang::XMultiServiceFactory xDocFactory); + /** Change a property of the slideshow.

@param aShowProperty -- cgit v1.2.3 From 54e4becdc5eee38a4ef85f8bab8d6258c54e2faf Mon Sep 17 00:00:00 2001 From: thb Date: Thu, 2 Jul 2009 16:36:09 +0200 Subject: Better wording, better menu, and better code; kudos to ericb for the patch --- sd/source/ui/slideshow/slideshow.src | 55 +++++++++++++++----------------- sd/source/ui/slideshow/slideshowimpl.cxx | 18 ++++------- 2 files changed, 31 insertions(+), 42 deletions(-) diff --git a/sd/source/ui/slideshow/slideshow.src b/sd/source/ui/slideshow/slideshow.src index 7d5a05c463bd..07df291e428f 100644 --- a/sd/source/ui/slideshow/slideshow.src +++ b/sd/source/ui/slideshow/slideshow.src @@ -118,35 +118,13 @@ Menu RID_SLIDESHOW_CONTEXTMENU MenuItem { Identifier = CM_COLOR_PEN ; - Text [ en-US ] = "~Change Color" ; + Text [ en-US ] = "~Change Pen Color" ; }; MenuItem { Separator = TRUE; }; MenuItem - { - Identifier = CM_SCREEN; - Text [ en-US ] = "~Screen" ; - - SubMenu = Menu - { - ItemList = - { - MenuItem - { - Identifier = CM_SCREEN_BLACK; - Text [ en-US ] = "~Black"; - }; - MenuItem - { - Identifier = CM_SCREEN_WHITE; - Text [ en-US ] = "~White"; - }; - }; - }; - }; - MenuItem { Separator = TRUE; }; @@ -165,11 +143,6 @@ Menu RID_SLIDESHOW_CONTEXTMENU Separator = TRUE; }; MenuItem - { - Identifier = CM_ERASE_ALLINK ; - Text [ en-US ] = "~Erase All Ink" ; - }; - MenuItem { Identifier = CM_ERASE_INK_PEN; Text [ en-US ] = "~Eraser Size" ; @@ -206,14 +179,36 @@ Menu RID_SLIDESHOW_CONTEXTMENU }; }; }; + MenuItem + { + Separator = TRUE; + }; MenuItem { - Separator = TRUE; + Identifier = CM_SCREEN; + Text [ en-US ] = "~Screen" ; + + SubMenu = Menu + { + ItemList = + { + MenuItem + { + Identifier = CM_SCREEN_BLACK; + Text [ en-US ] = "~Black"; + }; + MenuItem + { + Identifier = CM_SCREEN_WHITE; + Text [ en-US ] = "~White"; + }; + }; + }; }; MenuItem { Identifier = CM_ENDSHOW ; Text [ en-US ] = "~End Show" ; - }; + }; }; }; diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index e56c93f72b13..c7966d805c01 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -2354,8 +2354,10 @@ IMPL_LINK( SlideshowImpl, ContextMenuSelectHdl, Menu *, pMenu ) } } break; + + if( maPresSettings.mbMouseAsPen ) + { case CM_COLOR_PEN: - if( maPresSettings.mbMouseAsPen ) { //Open a color picker based on SvColorDialog ::Color aColor( mnUserPaintColor ); @@ -2373,7 +2375,6 @@ IMPL_LINK( SlideshowImpl, ContextMenuSelectHdl, Menu *, pMenu ) break; case CM_WIDTH_PEN_VERY_THIN: - if( maPresSettings.mbMouseAsPen ) { setPenWidth(4.0); mbWasPaused = false; @@ -2381,7 +2382,6 @@ IMPL_LINK( SlideshowImpl, ContextMenuSelectHdl, Menu *, pMenu ) break; case CM_WIDTH_PEN_THIN: - if( maPresSettings.mbMouseAsPen ) { setPenWidth(100.0); mbWasPaused = false; @@ -2389,7 +2389,6 @@ IMPL_LINK( SlideshowImpl, ContextMenuSelectHdl, Menu *, pMenu ) break; case CM_WIDTH_PEN_NORMAL: - if( maPresSettings.mbMouseAsPen ) { setPenWidth(150.0); mbWasPaused = false; @@ -2397,7 +2396,6 @@ IMPL_LINK( SlideshowImpl, ContextMenuSelectHdl, Menu *, pMenu ) break; case CM_WIDTH_PEN_THICK: - if( maPresSettings.mbMouseAsPen ) { setPenWidth(200.0); mbWasPaused = false; @@ -2405,21 +2403,19 @@ IMPL_LINK( SlideshowImpl, ContextMenuSelectHdl, Menu *, pMenu ) break; case CM_WIDTH_PEN_VERY_THICK: - if( maPresSettings.mbMouseAsPen ) { setPenWidth(400.0); mbWasPaused = false; } break; +#ifdef ENABLE_PRESENTER_EXTRA_UI case CM_ERASE_ALLINK: - if( maPresSettings.mbMouseAsPen ) { setEraseAllInk(true); mbWasPaused = false; } break; case CM_ERASE_INK_PEN_VERY_THIN: - if( maPresSettings.mbMouseAsPen ) { setEraseInk(100.0); mbWasPaused = false; @@ -2427,7 +2423,6 @@ IMPL_LINK( SlideshowImpl, ContextMenuSelectHdl, Menu *, pMenu ) break; case CM_ERASE_INK_PEN_THIN: - if( maPresSettings.mbMouseAsPen ) { setEraseInk(200.0); mbWasPaused = false; @@ -2435,7 +2430,6 @@ IMPL_LINK( SlideshowImpl, ContextMenuSelectHdl, Menu *, pMenu ) break; case CM_ERASE_INK_PEN_NORMAL: - if( maPresSettings.mbMouseAsPen ) { setEraseInk(300.0); mbWasPaused = false; @@ -2443,19 +2437,19 @@ IMPL_LINK( SlideshowImpl, ContextMenuSelectHdl, Menu *, pMenu ) break; case CM_ERASE_INK_PEN_THICK: - if( maPresSettings.mbMouseAsPen ) { setEraseInk(400.0); mbWasPaused = false; } break; case CM_ERASE_INK_PEN_VERY_THICK: - if( maPresSettings.mbMouseAsPen ) { setEraseInk(500.0); mbWasPaused = false; } break; +#endif + } case CM_ENDSHOW: // in case the user cancels the presentation, switch to current slide -- cgit v1.2.3 From f926cbe9c3ddd0524f10c43978c719bf1e5870e4 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Mon, 13 Jul 2009 14:12:14 +0000 Subject: #i103512# fixed a crasher bug. --- sc/inc/dpoutputgeometry.hxx | 4 +++- sc/source/core/data/dpoutputgeometry.cxx | 39 ++++++++++++++++++-------------- sc/source/filter/excel/xipivot.cxx | 38 +++++++++++++++++++++---------- 3 files changed, 51 insertions(+), 30 deletions(-) diff --git a/sc/inc/dpoutputgeometry.hxx b/sc/inc/dpoutputgeometry.hxx index dcf98f8f4ade..8183d94e2305 100644 --- a/sc/inc/dpoutputgeometry.hxx +++ b/sc/inc/dpoutputgeometry.hxx @@ -57,6 +57,8 @@ public: void getRowFieldPositions(::std::vector& rAddrs) const; void getPageFieldPositions(::std::vector& rAddrs) const; + SCROW getRowFieldHeaderRow() const; + FieldType getFieldButtonType(const ScAddress& rPos) const; private: @@ -64,7 +66,7 @@ private: private: ScRange maOutRange; - sal_uInt32 mnRowFields; + sal_uInt32 mnRowFields; /// number of row fields (data layout field NOT included!) sal_uInt32 mnColumnFields; sal_uInt32 mnPageFields; sal_uInt32 mnDataFields; diff --git a/sc/source/core/data/dpoutputgeometry.cxx b/sc/source/core/data/dpoutputgeometry.cxx index 1b8fc0b8435f..86b7d8f0bd15 100644 --- a/sc/source/core/data/dpoutputgeometry.cxx +++ b/sc/source/core/data/dpoutputgeometry.cxx @@ -117,23 +117,7 @@ void ScDPOutputGeometry::getRowFieldPositions(vector& rAddrs) const return; } - SCROW nCurRow = maOutRange.aStart.Row(); - - if (mnPageFields) - { - SCROW nRowStart = maOutRange.aStart.Row() + mbShowFilter; - SCROW nRowEnd = nRowStart + static_cast(mnPageFields-1); - nCurRow = nRowEnd + 2; - } - else if (mbShowFilter) - nCurRow += 2; - - if (mnColumnFields) - nCurRow += static_cast(mnColumnFields); - else - ++nCurRow; - - SCROW nRow = nCurRow; + SCROW nRow = getRowFieldHeaderRow(); SCTAB nTab = maOutRange.aStart.Tab(); SCCOL nColStart = maOutRange.aStart.Col(); SCCOL nColEnd = nColStart + static_cast(mnRowFields-1); @@ -163,6 +147,27 @@ void ScDPOutputGeometry::getPageFieldPositions(vector& rAddrs) const rAddrs.swap(aAddrs); } +SCROW ScDPOutputGeometry::getRowFieldHeaderRow() const +{ + SCROW nCurRow = maOutRange.aStart.Row(); + + if (mnPageFields) + { + SCROW nRowStart = maOutRange.aStart.Row() + mbShowFilter; + SCROW nRowEnd = nRowStart + static_cast(mnPageFields-1); + nCurRow = nRowEnd + 2; + } + else if (mbShowFilter) + nCurRow += 2; + + if (mnColumnFields) + nCurRow += static_cast(mnColumnFields); + else if (mnRowFields) + ++nCurRow; + + return nCurRow; +} + ScDPOutputGeometry::FieldType ScDPOutputGeometry::getFieldButtonType(const ScAddress& rPos) const { // We will ignore the table position for now. diff --git a/sc/source/filter/excel/xipivot.cxx b/sc/source/filter/excel/xipivot.cxx index 7ec0e5d2a694..fdc7246151ca 100644 --- a/sc/source/filter/excel/xipivot.cxx +++ b/sc/source/filter/excel/xipivot.cxx @@ -1486,21 +1486,35 @@ void XclImpPivotTable::ApplyMergeFlags(const ScRange& rOutRange, const ScDPSaveD vector aRowBtns; aGeometry.getRowFieldPositions(aRowBtns); - itr = aRowBtns.begin(); - itrEnd = aRowBtns.end(); - for (; itr != itrEnd; ++itr) + if (aRowBtns.empty()) { - sal_Int16 nMFlag = SC_MF_BUTTON | SC_MF_BUTTON_POPUP; - String aName; - rDoc.GetString(itr->Col(), itr->Row(), itr->Tab(), aName); - if (rSaveData.HasInvisibleMember(aName)) - nMFlag |= SC_MF_HIDDEN_MEMBER; - rDoc.ApplyFlagsTab(itr->Col(), itr->Row(), itr->Col(), itr->Row(), itr->Tab(), nMFlag); + if (bDataLayout) + { + // No row fields, but the data layout button exists. + SCROW nRow = aGeometry.getRowFieldHeaderRow(); + SCCOL nCol = rOutRange.aStart.Col(); + SCTAB nTab = rOutRange.aStart.Tab(); + rDoc.ApplyFlagsTab(nCol, nRow, nCol, nRow, nTab, SC_MF_BUTTON); + } } - if (bDataLayout) + else { - --itr; // move back to the last row field position. - rDoc.ApplyFlagsTab(itr->Col(), itr->Row(), itr->Col(), itr->Row(), itr->Tab(), SC_MF_BUTTON); + itr = aRowBtns.begin(); + itrEnd = aRowBtns.end(); + for (; itr != itrEnd; ++itr) + { + sal_Int16 nMFlag = SC_MF_BUTTON | SC_MF_BUTTON_POPUP; + String aName; + rDoc.GetString(itr->Col(), itr->Row(), itr->Tab(), aName); + if (rSaveData.HasInvisibleMember(aName)) + nMFlag |= SC_MF_HIDDEN_MEMBER; + rDoc.ApplyFlagsTab(itr->Col(), itr->Row(), itr->Col(), itr->Row(), itr->Tab(), nMFlag); + } + if (bDataLayout) + { + --itr; // move back to the last row field position. + rDoc.ApplyFlagsTab(itr->Col(), itr->Row(), itr->Col(), itr->Row(), itr->Tab(), SC_MF_BUTTON); + } } } -- cgit v1.2.3 From 34310d90da930c12be486d88cc3a478fa650ba57 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 30 Jul 2009 00:40:07 +0000 Subject: Draw borders around the list member box. --- sc/source/ui/cctrl/dpcontrol.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index d6aa21ab79bb..b483f2bde957 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -927,9 +927,11 @@ void ScDPFieldPopupWindow::Paint(const Rectangle& rRect) const StyleSettings& rStyle = GetSettings().GetStyleSettings(); Color aMemberBackColor = rStyle.GetFieldColor(); + Color aBorderColor = rStyle.GetShadowColor(); // Member list box background SetFillColor(aMemberBackColor); + SetLineColor(aBorderColor); Point aPos; Size aSize; getSectionPosSize(aPos, aSize, LISTBOX_AREA); -- cgit v1.2.3 From e55664992c9182d89988ca1253693c012c806930 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 30 Jul 2009 03:18:29 +0000 Subject: Ctrl-D to launch the dp field popup window, the same way it launches the page field window. --- sc/source/ui/inc/gridwin.hxx | 8 +++++--- sc/source/ui/view/gridwin.cxx | 18 +++++++++++++++++- sc/source/ui/view/gridwin2.cxx | 37 +++++++++++++++++++++++++++++-------- sc/source/ui/view/tabview.cxx | 30 +++++++++++++++++++++--------- 4 files changed, 72 insertions(+), 21 deletions(-) diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx index 32ecaf26cc56..c5908d380a45 100644 --- a/sc/source/ui/inc/gridwin.hxx +++ b/sc/source/ui/inc/gridwin.hxx @@ -37,7 +37,7 @@ #include "viewdata.hxx" #include "cbutton.hxx" #include - +#include #include #include @@ -380,9 +380,11 @@ public: void DoAutoFilterMenue( SCCOL nCol, SCROW nRow, BOOL bDataSelect ); void DoScenarioMenue( const ScRange& rScenRange ); - void DoPageFieldMenue( SCCOL nCol, SCROW nRow ); - BOOL HasPageFieldData( SCCOL nCol, SCROW nRow ) const; + void LaunchPageFieldMenu( SCCOL nCol, SCROW nRow ); + void LaunchDPFieldMenu( SCCOL nCol, SCROW nRow ); + + ::com::sun::star::sheet::DataPilotFieldOrientation GetDPFieldOrientation( SCCOL nCol, SCROW nRow ) const; void DrawButtons( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScTableInfo& rTabInfo, OutputDevice* pContentDev ); diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 8949d2bd29a9..bc175d7b65d0 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -513,7 +513,7 @@ void ScGridWindow::ExecPageFieldSelect( SCCOL nCol, SCROW nRow, BOOL bHasSelecti } } -void ScGridWindow::DoPageFieldMenue( SCCOL nCol, SCROW nRow ) +void ScGridWindow::LaunchPageFieldMenu( SCCOL nCol, SCROW nRow ) { //! merge position/size handling with DoAutoFilterMenue @@ -664,6 +664,22 @@ void ScGridWindow::DoPageFieldMenue( SCCOL nCol, SCROW nRow ) CaptureMouse(); } +void ScGridWindow::LaunchDPFieldMenu( SCCOL nCol, SCROW nRow ) +{ + SCTAB nTab = pViewData->GetTabNo(); + ScDPObject* pDPObj = pViewData->GetDocument()->GetDPAtCursor(nCol, nRow, nTab); + if (!pDPObj) + return; + + // Get the geometry of the cell. + Point aSrcPos = pViewData->GetScrPos(nCol, nRow, eWhich); + long nSizeX, nSizeY; + pViewData->GetMergeSizePixel(nCol, nRow, nSizeX, nSizeY); + Size aSrcSize(nSizeX-1, nSizeY-1); + + DPLaunchFieldPopupMenu(OutputToScreenPixel(aSrcPos), aSrcSize, ScAddress(nCol, nRow, nTab), pDPObj); +} + void ScGridWindow::DoScenarioMenue( const ScRange& rScenRange ) { delete pFilterBox; diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx index 1cfb5bdf71c0..a0791391e9d3 100644 --- a/sc/source/ui/view/gridwin2.cxx +++ b/sc/source/ui/view/gridwin2.cxx @@ -67,6 +67,7 @@ #include using namespace com::sun::star; +using ::com::sun::star::sheet::DataPilotFieldOrientation; using ::std::vector; using ::std::auto_ptr; using ::std::hash_map; @@ -77,33 +78,53 @@ using ::rtl::OUStringHash; // ----------------------------------------------------------------------- -BOOL ScGridWindow::HasPageFieldData( SCCOL nCol, SCROW nRow ) const +DataPilotFieldOrientation ScGridWindow::GetDPFieldOrientation( SCCOL nCol, SCROW nRow ) const { + using namespace ::com::sun::star::sheet; + ScDocument* pDoc = pViewData->GetDocument(); SCTAB nTab = pViewData->GetTabNo(); ScDPObject* pDPObj = pDoc->GetDPAtCursor(nCol, nRow, nTab); - if ( pDPObj && nCol > 0 ) + if (!pDPObj) + return DataPilotFieldOrientation_HIDDEN; + + USHORT nOrient = DataPilotFieldOrientation_HIDDEN; + + // Check for page field first. + if (nCol > 0) { // look for the dimension header left of the drop-down arrow - USHORT nOrient = sheet::DataPilotFieldOrientation_HIDDEN; long nField = pDPObj->GetHeaderDim( ScAddress( nCol-1, nRow, nTab ), nOrient ); - if ( nField >= 0 && nOrient == sheet::DataPilotFieldOrientation_PAGE ) + if ( nField >= 0 && nOrient == DataPilotFieldOrientation_PAGE ) { BOOL bIsDataLayout = FALSE; String aFieldName = pDPObj->GetDimName( nField, bIsDataLayout ); if ( aFieldName.Len() && !bIsDataLayout ) - return TRUE; + return DataPilotFieldOrientation_PAGE; } } - return FALSE; + + nOrient = sheet::DataPilotFieldOrientation_HIDDEN; + + // Now, check for row/column field. + long nField = pDPObj->GetHeaderDim(ScAddress(nCol, nRow, nTab), nOrient); + if (nField >= 0 && (nOrient == DataPilotFieldOrientation_COLUMN || nOrient == DataPilotFieldOrientation_ROW) ) + { + BOOL bIsDataLayout = FALSE; + String aFieldName = pDPObj->GetDimName(nField, bIsDataLayout); + if (aFieldName.Len() && !bIsDataLayout) + return static_cast(nOrient); + } + + return DataPilotFieldOrientation_HIDDEN; } // private method for mouse button handling BOOL ScGridWindow::DoPageFieldSelection( SCCOL nCol, SCROW nRow ) { - if ( HasPageFieldData( nCol, nRow ) ) + if (GetDPFieldOrientation( nCol, nRow ) == sheet::DataPilotFieldOrientation_PAGE) { - DoPageFieldMenue( nCol, nRow ); + LaunchPageFieldMenu( nCol, nRow ); return TRUE; } return FALSE; diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index c51c81c36dd8..4590f9988d69 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -200,6 +200,8 @@ #include "AccessibilityHints.hxx" #include "appoptio.hxx" +#include + #include #include @@ -212,6 +214,8 @@ // fuer Rad-Maus #define SC_DELTA_ZOOM 10 +using namespace ::com::sun::star; + // STATIC DATA ----------------------------------------------------------- @@ -2477,7 +2481,7 @@ sal_Bool ScTabView::HasPageFieldDataAtCursor() const SCCOL nCol = aViewData.GetCurX(); SCROW nRow = aViewData.GetCurY(); if (pWin) - return pWin->HasPageFieldData( nCol, nRow ); + return pWin->GetDPFieldOrientation( nCol, nRow ) == sheet::DataPilotFieldOrientation_PAGE; return sal_False; } @@ -2487,15 +2491,23 @@ void ScTabView::StartDataSelect() ScGridWindow* pWin = pGridWin[aViewData.GetActivePart()]; SCCOL nCol = aViewData.GetCurX(); SCROW nRow = aViewData.GetCurY(); - if (pWin) - { - // #i36598# If the cursor is on a page field's data cell, - // no meaningful input is possible anyway, so this function - // can be used to select a page field entry. - if ( pWin->HasPageFieldData( nCol, nRow ) ) - pWin->DoPageFieldMenue( nCol, nRow ); - else + if (!pWin) + return; + + switch (pWin->GetDPFieldOrientation(nCol, nRow)) + { + case sheet::DataPilotFieldOrientation_PAGE: + // #i36598# If the cursor is on a page field's data cell, + // no meaningful input is possible anyway, so this function + // can be used to select a page field entry. + pWin->LaunchPageFieldMenu( nCol, nRow ); + break; + case sheet::DataPilotFieldOrientation_COLUMN: + case sheet::DataPilotFieldOrientation_ROW: + pWin->LaunchDPFieldMenu( nCol, nRow ); + break; + default: pWin->DoAutoFilterMenue( nCol, nRow, TRUE ); } } -- cgit v1.2.3 From 58a98fbb38dc78eba9768cebfc1e6215fbe97306 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 30 Jul 2009 21:07:52 +0000 Subject: Used SvxCheckListBox to implement the check list box instead of rolling my own. --- sc/source/ui/cctrl/dpcontrol.cxx | 130 +++++++++------------------------------ sc/source/ui/inc/dpcontrol.hxx | 23 ++----- 2 files changed, 32 insertions(+), 121 deletions(-) diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index b483f2bde957..185671b3af97 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -724,17 +724,7 @@ void ScDPFieldPopupWindow::CancelButton::Click() ScDPFieldPopupWindow::ScDPFieldPopupWindow(Window* pParent) : ScMenuFloatingWindow(pParent), - maCheck0(this, 0), - maCheck1(this, 0), - maCheck2(this, 0), - maCheck3(this, 0), - maCheck4(this, 0), - maCheck5(this, 0), - maCheck6(this, 0), - maCheck7(this, 0), - maCheck8(this, 0), - maCheck9(this, 0), - maScrollBar(this, WB_VERT), + maChecks(this, 0), maBtnOk(this), maBtnCancel(this), mpExtendedData(NULL), @@ -747,29 +737,6 @@ ScDPFieldPopupWindow::ScDPFieldPopupWindow(Window* pParent) : SetOutputSizePixel(aSize); Size aOutSize = GetOutputSizePixel(); - mpCheckPtr.reserve(10); - mpCheckPtr.push_back(&maCheck0); - mpCheckPtr.push_back(&maCheck1); - mpCheckPtr.push_back(&maCheck2); - mpCheckPtr.push_back(&maCheck3); - mpCheckPtr.push_back(&maCheck4); - mpCheckPtr.push_back(&maCheck5); - mpCheckPtr.push_back(&maCheck6); - mpCheckPtr.push_back(&maCheck7); - mpCheckPtr.push_back(&maCheck8); - mpCheckPtr.push_back(&maCheck9); - - getSectionPosSize(aPos, aSize, FIRST_LISTITEM); - for (vector::iterator itr = mpCheckPtr.begin(), itrEnd = mpCheckPtr.end(); - itr != itrEnd; ++itr) - { - CheckBox* p = *itr; - p->SetPosSizePixel(aPos, aSize); - p->SetFont(getLabelFont()); - p->SetClickHdl( LINK(this, ScDPFieldPopupWindow, CheckBoxHdl) ); - aPos.Y() += aSize.Height() + 1; - } - getSectionPosSize(aPos, aSize, BTN_OK); maBtnOk.SetPosSizePixel(aPos, aSize); maBtnOk.SetFont(getLabelFont()); @@ -781,13 +748,10 @@ ScDPFieldPopupWindow::ScDPFieldPopupWindow(Window* pParent) : maBtnCancel.SetFont(getLabelFont()); maBtnCancel.Show(); - getSectionPosSize(aPos, aSize, SCROLL_BAR_V); - maScrollBar.SetPosSizePixel(aPos, aSize); - maScrollBar.SetPageSize(mpCheckPtr.size()); - maScrollBar.SetVisibleSize(mpCheckPtr.size()); - maScrollBar.SetLineSize(1); - maScrollBar.SetScrollHdl( LINK(this, ScDPFieldPopupWindow, ScrollHdl) ); - maScrollBar.EnableDrag(true); + getSectionPosSize(aPos, aSize, LISTBOX_AREA_INNER); + maChecks.SetPosSizePixel(aPos, aSize); + maChecks.SetFont(getLabelFont()); + maChecks.Show(); } ScDPFieldPopupWindow::~ScDPFieldPopupWindow() @@ -802,6 +766,7 @@ vector& ScDPFieldPopupWindow::getMembers() void ScDPFieldPopupWindow::getSectionPosSize(Point& rPos, Size& rSize, SectionType eType) const { const sal_uInt16 nListBoxMargin = 5; + const sal_uInt16 nListBoxInnerPadding = 5; const sal_uInt16 nTopMargin = 5; const sal_uInt16 nMenuHeight = 60; const sal_uInt16 nBottomBtnAreaHeight = 50; @@ -822,7 +787,7 @@ void ScDPFieldPopupWindow::getSectionPosSize(Point& rPos, Size& rSize, SectionTy rSize = aWndSize; } break; - case LISTBOX_AREA: + case LISTBOX_AREA_OUTER: { rPos = Point(nListBoxMargin, nTopMargin + nMenuHeight + nMenuListMargin); rSize = Size( @@ -830,6 +795,15 @@ void ScDPFieldPopupWindow::getSectionPosSize(Point& rPos, Size& rSize, SectionTy aWndSize.Height() - nTopMargin - nMenuHeight - nMenuListMargin - nBottomBtnAreaHeight); } break; + case LISTBOX_AREA_INNER: + { + rPos = Point(nListBoxMargin + nListBoxInnerPadding, + nTopMargin + nMenuHeight + nMenuListMargin + nListBoxInnerPadding); + rSize = Size( + aWndSize.Width() - nListBoxMargin*2 - nListBoxInnerPadding*2, + aWndSize.Height() - nTopMargin - nMenuHeight - nMenuListMargin - nBottomBtnAreaHeight - nListBoxInnerPadding*2); + } + break; case FIRST_LISTITEM: { rPos = Point(nListBoxMargin + nInnerItemMargin, @@ -869,49 +843,12 @@ void ScDPFieldPopupWindow::getSectionPosSize(Point& rPos, Size& rSize, SectionTy } } -void ScDPFieldPopupWindow::resetDisplayedItems() -{ - long nScrollPos = maScrollBar.GetThumbPos(); - if (nScrollPos < 0) - return; - - mnScrollPos = static_cast(nScrollPos); - size_t nCheckCount = mpCheckPtr.size(); - for (size_t i = 0; i < nCheckCount; ++i) - { - CheckBox* p = mpCheckPtr[i]; - p->SetText(maMembers[i+mnScrollPos].maName); - TriState nNewState = maMembers[i+mnScrollPos].mbVisible ? STATE_CHECK : STATE_NOCHECK; - p->SetState(nNewState); - } -} - -IMPL_LINK( ScDPFieldPopupWindow, CheckBoxHdl, CheckBox*, pCheck ) -{ - vector::const_iterator itr, itrBeg = mpCheckPtr.begin(), itrEnd = mpCheckPtr.end(); - for (itr = itrBeg; itr != itrEnd; ++itr) - { - if (*itr == pCheck) - { - size_t nIndex = ::std::distance(itrBeg, itr); - maMembers[nIndex+mnScrollPos].mbVisible = !maMembers[nIndex+mnScrollPos].mbVisible; - } - } - return 0; -} - IMPL_LINK( ScDPFieldPopupWindow, OKButtonHdl, OKButton*, EMPTYARG ) { close(true); return 0; } -IMPL_LINK( ScDPFieldPopupWindow, ScrollHdl, ScrollBar*, EMPTYARG ) -{ - resetDisplayedItems(); - return 0; -} - void ScDPFieldPopupWindow::MouseMove(const MouseEvent& rMEvt) { ScMenuFloatingWindow::MouseMove(rMEvt); @@ -929,12 +866,13 @@ void ScDPFieldPopupWindow::Paint(const Rectangle& rRect) Color aMemberBackColor = rStyle.GetFieldColor(); Color aBorderColor = rStyle.GetShadowColor(); + Point aPos; + Size aSize; + getSectionPosSize(aPos, aSize, LISTBOX_AREA_OUTER); + // Member list box background SetFillColor(aMemberBackColor); SetLineColor(aBorderColor); - Point aPos; - Size aSize; - getSectionPosSize(aPos, aSize, LISTBOX_AREA); DrawRect(Rectangle(aPos,aSize)); } @@ -954,25 +892,10 @@ void ScDPFieldPopupWindow::addMember(const OUString& rName, bool bVisible) void ScDPFieldPopupWindow::initMembers() { size_t nMemCount = maMembers.size(); - size_t nCheckCount = mpCheckPtr.size(); - bool bNeedsScroll = false; - if (nMemCount > nCheckCount) - { - nMemCount = nCheckCount; - bNeedsScroll = true; - } - for (size_t i = 0; i < nMemCount; ++i) { - CheckBox* p = mpCheckPtr[i]; - p->SetText(maMembers[i].maName); - p->Show(); - p->SetState(maMembers[i].mbVisible ? STATE_CHECK : STATE_NOCHECK); - } - if (bNeedsScroll) - { - maScrollBar.SetRange(Range(0, maMembers.size())); - maScrollBar.Show(); + maChecks.InsertEntry(maMembers[i].maName); + maChecks.CheckEntryPos(i, maMembers[i].mbVisible); } } @@ -980,9 +903,12 @@ void ScDPFieldPopupWindow::getResult(hash_map& rRe { typedef hash_map ResultMap; ResultMap aResult; - vector::const_iterator itr = maMembers.begin(), itrEnd = maMembers.end(); - for (; itr != itrEnd; ++itr) - aResult.insert(ResultMap::value_type(itr->maName, itr->mbVisible)); + size_t n = maMembers.size(); + for (size_t i = 0; i < n; ++i) + { + bool bState = maChecks.IsChecked(i); + aResult.insert(ResultMap::value_type(maMembers[i].maName, bState)); + } rResult.swap(aResult); } diff --git a/sc/source/ui/inc/dpcontrol.hxx b/sc/source/ui/inc/dpcontrol.hxx index 5c1e7a59aad2..e360f4f5acf2 100644 --- a/sc/source/ui/inc/dpcontrol.hxx +++ b/sc/source/ui/inc/dpcontrol.hxx @@ -37,6 +37,7 @@ #include "vcl/button.hxx" #include "vcl/scrbar.hxx" #include "vcl/timer.hxx" +#include "svx/checklbx.hxx" #include #include @@ -245,7 +246,8 @@ private: enum SectionType { WHOLE, // entire window - LISTBOX_AREA, // box enclosing the check box items. + LISTBOX_AREA_OUTER, // box enclosing the check box items. + LISTBOX_AREA_INNER, // box enclosing the check box items. FIRST_LISTITEM, // first list item at the top BTN_OK, // OK button BTN_CANCEL, // Cancel button @@ -253,32 +255,15 @@ private: }; void getSectionPosSize(Point& rPos, Size& rSize, SectionType eType) const; - void resetDisplayedItems(); - - DECL_LINK( CheckBoxHdl, CheckBox* ); DECL_LINK( OKButtonHdl, OKButton* ); DECL_LINK( ScrollHdl, ScrollBar* ); private: - - CheckBox maCheck0; - CheckBox maCheck1; - CheckBox maCheck2; - CheckBox maCheck3; - CheckBox maCheck4; - CheckBox maCheck5; - CheckBox maCheck6; - CheckBox maCheck7; - CheckBox maCheck8; - CheckBox maCheck9; - - ScrollBar maScrollBar; + SvxCheckListBox maChecks; OKButton maBtnOk; CancelButton maBtnCancel; - ::std::vector mpCheckPtr; - ::std::vector maMembers; ::std::auto_ptr mpExtendedData; ::std::auto_ptr mpOKAction; -- cgit v1.2.3 From 4c1e7fbbd53c669ae6f274a24a7ac73c7107ceaf Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 30 Jul 2009 21:11:57 +0000 Subject: Removed unused code after the switch to SvxCheckListBox. --- sc/source/ui/cctrl/dpcontrol.cxx | 20 -------------------- sc/source/ui/inc/dpcontrol.hxx | 2 -- 2 files changed, 22 deletions(-) diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index 185671b3af97..945fd0b1e358 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -770,8 +770,6 @@ void ScDPFieldPopupWindow::getSectionPosSize(Point& rPos, Size& rSize, SectionTy const sal_uInt16 nTopMargin = 5; const sal_uInt16 nMenuHeight = 60; const sal_uInt16 nBottomBtnAreaHeight = 50; - const sal_uInt16 nInnerItemMargin = 5; - const sal_uInt16 nScrollBarWidth = 17; const sal_uInt16 nBtnWidth = 60; const sal_uInt16 nBtnHeight = getLabelFont().GetHeight()*2; const sal_uInt16 nBottomMargin = 10; @@ -804,15 +802,6 @@ void ScDPFieldPopupWindow::getSectionPosSize(Point& rPos, Size& rSize, SectionTy aWndSize.Height() - nTopMargin - nMenuHeight - nMenuListMargin - nBottomBtnAreaHeight - nListBoxInnerPadding*2); } break; - case FIRST_LISTITEM: - { - rPos = Point(nListBoxMargin + nInnerItemMargin, - nTopMargin + nMenuHeight + nMenuListMargin + nInnerItemMargin); - rSize = Size( - aWndSize.Width() - nListBoxMargin*2 - nInnerItemMargin - nScrollBarWidth - 10, - 17); - } - break; case BTN_OK: { long x = (aWndSize.Width() - nBtnWidth*2)/3; @@ -829,15 +818,6 @@ void ScDPFieldPopupWindow::getSectionPosSize(Point& rPos, Size& rSize, SectionTy rSize = Size(nBtnWidth, nBtnHeight); } break; - case SCROLL_BAR_V: - { - long x = aWndSize.Width() - nListBoxMargin - nInnerItemMargin - nScrollBarWidth; - long y = nTopMargin + nMenuHeight + nMenuListMargin + nInnerItemMargin; - rPos = Point(x, y); - long h = aWndSize.Height() - nTopMargin - nMenuHeight - nMenuListMargin - nBottomBtnAreaHeight - nInnerItemMargin*2; - rSize = Size(nScrollBarWidth, h); - } - break; default: ; } diff --git a/sc/source/ui/inc/dpcontrol.hxx b/sc/source/ui/inc/dpcontrol.hxx index e360f4f5acf2..a79373579ff1 100644 --- a/sc/source/ui/inc/dpcontrol.hxx +++ b/sc/source/ui/inc/dpcontrol.hxx @@ -248,10 +248,8 @@ private: WHOLE, // entire window LISTBOX_AREA_OUTER, // box enclosing the check box items. LISTBOX_AREA_INNER, // box enclosing the check box items. - FIRST_LISTITEM, // first list item at the top BTN_OK, // OK button BTN_CANCEL, // Cancel button - SCROLL_BAR_V, // vertical scroll bar along the right edge of the list box. }; void getSectionPosSize(Point& rPos, Size& rSize, SectionType eType) const; -- cgit v1.2.3 From e5fb7fa24c796e7e608e6aa392ef8fb1900a4ee7 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 30 Jul 2009 23:10:58 +0000 Subject: removed unused method. --- sc/source/ui/cctrl/dpcontrol.cxx | 5 ----- sc/source/ui/inc/dpcontrol.hxx | 2 -- 2 files changed, 7 deletions(-) diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index 945fd0b1e358..9365a923dc44 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -758,11 +758,6 @@ ScDPFieldPopupWindow::~ScDPFieldPopupWindow() { } -vector& ScDPFieldPopupWindow::getMembers() -{ - return maMembers; -} - void ScDPFieldPopupWindow::getSectionPosSize(Point& rPos, Size& rSize, SectionType eType) const { const sal_uInt16 nListBoxMargin = 5; diff --git a/sc/source/ui/inc/dpcontrol.hxx b/sc/source/ui/inc/dpcontrol.hxx index a79373579ff1..03064a835d4a 100644 --- a/sc/source/ui/inc/dpcontrol.hxx +++ b/sc/source/ui/inc/dpcontrol.hxx @@ -242,8 +242,6 @@ private: ScDPFieldPopupWindow* mpParent; }; - ::std::vector& getMembers(); - enum SectionType { WHOLE, // entire window LISTBOX_AREA_OUTER, // box enclosing the check box items. -- cgit v1.2.3 From 69e8adefda15685dc09b7af00fd6743c1937c4c7 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 31 Jul 2009 02:57:58 +0000 Subject: Implemented "toggle all" check box per IBM's spec. --- sc/source/ui/cctrl/dpcontrol.cxx | 138 +++++++++++++++++++++++++++++++++++---- sc/source/ui/cctrl/dpcontrol.src | 5 ++ sc/source/ui/inc/dpcontrol.hrc | 1 + sc/source/ui/inc/dpcontrol.hxx | 17 +++-- 4 files changed, 142 insertions(+), 19 deletions(-) diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index 9365a923dc44..18cc9089e108 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -34,11 +34,13 @@ // INCLUDE --------------------------------------------------------------- #include "dpcontrol.hxx" +#include "dpcontrol.hrc" #include "vcl/outdev.hxx" #include "vcl/settings.hxx" #include "vcl/wintypes.hxx" #include "vcl/decoview.hxx" +#include "strload.hxx" #define MENU_NOT_SELECTED 999 @@ -725,12 +727,15 @@ void ScDPFieldPopupWindow::CancelButton::Click() ScDPFieldPopupWindow::ScDPFieldPopupWindow(Window* pParent) : ScMenuFloatingWindow(pParent), maChecks(this, 0), + maChkToggleAll(this, 0), maBtnOk(this), maBtnCancel(this), mpExtendedData(NULL), mpOKAction(NULL), - mnScrollPos(0) + mePrevToggleAllState(STATE_DONTKNOW) { + const StyleSettings& rStyle = GetSettings().GetStyleSettings(); + Point aPos; Size aSize; getSectionPosSize(aPos, aSize, WHOLE); @@ -751,7 +756,16 @@ ScDPFieldPopupWindow::ScDPFieldPopupWindow(Window* pParent) : getSectionPosSize(aPos, aSize, LISTBOX_AREA_INNER); maChecks.SetPosSizePixel(aPos, aSize); maChecks.SetFont(getLabelFont()); + maChecks.SetCheckButtonHdl( LINK(this, ScDPFieldPopupWindow, CheckHdl) ); maChecks.Show(); + + getSectionPosSize(aPos, aSize, CHECK_TOGGLE_ALL); + maChkToggleAll.SetPosSizePixel(aPos, aSize); + maChkToggleAll.SetFont(getLabelFont()); + maChkToggleAll.SetText(ScRscStrLoader(RID_POPUP_FILTER, STR_BTN_TOGGLE_ALL).GetString()); + maChkToggleAll.SetControlBackground(rStyle.GetMenuColor()); + maChkToggleAll.SetClickHdl( LINK(this, ScDPFieldPopupWindow, TriStateHdl) ); + maChkToggleAll.Show(); } ScDPFieldPopupWindow::~ScDPFieldPopupWindow() @@ -760,18 +774,28 @@ ScDPFieldPopupWindow::~ScDPFieldPopupWindow() void ScDPFieldPopupWindow::getSectionPosSize(Point& rPos, Size& rSize, SectionType eType) const { - const sal_uInt16 nListBoxMargin = 5; + // constant parameters. + const sal_uInt16 nListBoxMargin = 5; // horizontal distance from the side of the dialog to the listbox border. const sal_uInt16 nListBoxInnerPadding = 5; const sal_uInt16 nTopMargin = 5; const sal_uInt16 nMenuHeight = 60; - const sal_uInt16 nBottomBtnAreaHeight = 50; + const sal_uInt16 nSingleItemBtnAreaHeight = 30; // height of the middle area below the list box where the single-action buttons are. + const sal_uInt16 nBottomBtnAreaHeight = 50; // height of the bottom area where the OK and Cancel buttons are. const sal_uInt16 nBtnWidth = 60; - const sal_uInt16 nBtnHeight = getLabelFont().GetHeight()*2; + const sal_uInt16 nLabelHeight = getLabelFont().GetHeight(); + const sal_uInt16 nBtnHeight = nLabelHeight*2; const sal_uInt16 nBottomMargin = 10; const sal_uInt16 nMenuListMargin = 20; Size aWndSize = Size(160, 330); + // parameters calculated from constants. + const sal_uInt16 nListBoxWidth = aWndSize.Width() - nListBoxMargin*2; + const sal_uInt16 nListBoxHeight = aWndSize.Height() - nTopMargin - nMenuHeight - + nMenuListMargin - nSingleItemBtnAreaHeight - nBottomBtnAreaHeight; + + const sal_uInt16 nSingleBtnAreaY = nTopMargin + nMenuHeight + nListBoxHeight + nMenuListMargin - 1; + switch (eType) { case WHOLE: @@ -783,18 +807,33 @@ void ScDPFieldPopupWindow::getSectionPosSize(Point& rPos, Size& rSize, SectionTy case LISTBOX_AREA_OUTER: { rPos = Point(nListBoxMargin, nTopMargin + nMenuHeight + nMenuListMargin); - rSize = Size( - aWndSize.Width() - nListBoxMargin*2, - aWndSize.Height() - nTopMargin - nMenuHeight - nMenuListMargin - nBottomBtnAreaHeight); + rSize = Size(nListBoxWidth, nListBoxHeight); } break; case LISTBOX_AREA_INNER: { - rPos = Point(nListBoxMargin + nListBoxInnerPadding, - nTopMargin + nMenuHeight + nMenuListMargin + nListBoxInnerPadding); - rSize = Size( - aWndSize.Width() - nListBoxMargin*2 - nListBoxInnerPadding*2, - aWndSize.Height() - nTopMargin - nMenuHeight - nMenuListMargin - nBottomBtnAreaHeight - nListBoxInnerPadding*2); + rPos = Point(nListBoxMargin, nTopMargin + nMenuHeight + nMenuListMargin); + rPos.X() += nListBoxInnerPadding; + rPos.Y() += nListBoxInnerPadding; + + rSize = Size(nListBoxWidth, nListBoxHeight); + rSize.Width() -= nListBoxInnerPadding*2; + rSize.Height() -= nListBoxInnerPadding*2; + } + break; + case SINGLE_BTN_AREA: + { + rPos = Point(nListBoxMargin, nSingleBtnAreaY); + rSize = Size(nListBoxWidth, nSingleItemBtnAreaHeight); + } + break; + case CHECK_TOGGLE_ALL: + { + long h = nLabelHeight*3/2; // check box height is heuristically 150% of the text height. + rPos = Point(nListBoxMargin, nSingleBtnAreaY); + rPos.X() += 5; + rPos.Y() += (nSingleItemBtnAreaHeight - h)/2; + rSize = Size(70, h); } break; case BTN_OK: @@ -818,12 +857,58 @@ void ScDPFieldPopupWindow::getSectionPosSize(Point& rPos, Size& rSize, SectionTy } } +void ScDPFieldPopupWindow::setAllMemberState(bool bSet) +{ + size_t n = maMembers.size(); + for (size_t i = 0; i < n; ++i) + maChecks.CheckEntryPos(i, bSet); +} + IMPL_LINK( ScDPFieldPopupWindow, OKButtonHdl, OKButton*, EMPTYARG ) { close(true); return 0; } +IMPL_LINK( ScDPFieldPopupWindow, TriStateHdl, TriStateBox*, EMPTYARG ) +{ + switch (mePrevToggleAllState) + { + case STATE_NOCHECK: + maChkToggleAll.SetState(STATE_CHECK); + setAllMemberState(true); + break; + case STATE_CHECK: + maChkToggleAll.SetState(STATE_NOCHECK); + setAllMemberState(false); + break; + case STATE_DONTKNOW: + default: + maChkToggleAll.SetState(STATE_CHECK); + setAllMemberState(true); + break; + } + + mePrevToggleAllState = maChkToggleAll.GetState(); + return 0; +} + +IMPL_LINK( ScDPFieldPopupWindow, CheckHdl, SvTreeListBox*, EMPTYARG ) +{ + size_t nNumChecked = maChecks.GetCheckedEntryCount(); + if (nNumChecked == maMembers.size()) + // all members visible + maChkToggleAll.SetState(STATE_CHECK); + else if (nNumChecked == 0) + // no members visible + maChkToggleAll.SetState(STATE_NOCHECK); + else + maChkToggleAll.SetState(STATE_DONTKNOW); + + mePrevToggleAllState = maChkToggleAll.GetState(); + return 0; +} + void ScDPFieldPopupWindow::MouseMove(const MouseEvent& rMEvt) { ScMenuFloatingWindow::MouseMove(rMEvt); @@ -849,6 +934,11 @@ void ScDPFieldPopupWindow::Paint(const Rectangle& rRect) SetFillColor(aMemberBackColor); SetLineColor(aBorderColor); DrawRect(Rectangle(aPos,aSize)); + + // Single-action button box + getSectionPosSize(aPos, aSize, SINGLE_BTN_AREA); + SetFillColor(rStyle.GetMenuColor()); + DrawRect(Rectangle(aPos,aSize)); } void ScDPFieldPopupWindow::setMemberSize(size_t n) @@ -866,11 +956,31 @@ void ScDPFieldPopupWindow::addMember(const OUString& rName, bool bVisible) void ScDPFieldPopupWindow::initMembers() { - size_t nMemCount = maMembers.size(); - for (size_t i = 0; i < nMemCount; ++i) + size_t n = maMembers.size(); + size_t nVisMemCount = 0; + for (size_t i = 0; i < n; ++i) { maChecks.InsertEntry(maMembers[i].maName); maChecks.CheckEntryPos(i, maMembers[i].mbVisible); + if (maMembers[i].mbVisible) + ++nVisMemCount; + } + if (nVisMemCount == n) + { + // all members visible + maChkToggleAll.SetState(STATE_CHECK); + mePrevToggleAllState = STATE_CHECK; + } + else if (nVisMemCount == 0) + { + // no members visible + maChkToggleAll.SetState(STATE_NOCHECK); + mePrevToggleAllState = STATE_NOCHECK; + } + else + { + maChkToggleAll.SetState(STATE_DONTKNOW); + mePrevToggleAllState = STATE_DONTKNOW; } } diff --git a/sc/source/ui/cctrl/dpcontrol.src b/sc/source/ui/cctrl/dpcontrol.src index 5f7ab9a66a9f..4c1bda0b2724 100644 --- a/sc/source/ui/cctrl/dpcontrol.src +++ b/sc/source/ui/cctrl/dpcontrol.src @@ -46,4 +46,9 @@ Resource RID_POPUP_FILTER { Text [ en-US ] = "Custom Sort" ; }; + + String STR_BTN_TOGGLE_ALL + { + Text [ en-US ] = "All" ; + }; }; diff --git a/sc/source/ui/inc/dpcontrol.hrc b/sc/source/ui/inc/dpcontrol.hrc index 7ec03c5134ae..e792dc4a9ace 100644 --- a/sc/source/ui/inc/dpcontrol.hrc +++ b/sc/source/ui/inc/dpcontrol.hrc @@ -36,5 +36,6 @@ #define STR_MENU_SORT_ASC 1 #define STR_MENU_SORT_DESC 2 #define STR_MENU_SORT_CUSTOM 3 +#define STR_BTN_TOGGLE_ALL 4 #endif diff --git a/sc/source/ui/inc/dpcontrol.hxx b/sc/source/ui/inc/dpcontrol.hxx index 03064a835d4a..0a97f7e1046a 100644 --- a/sc/source/ui/inc/dpcontrol.hxx +++ b/sc/source/ui/inc/dpcontrol.hxx @@ -243,20 +243,27 @@ private: }; enum SectionType { - WHOLE, // entire window + WHOLE, // entire window LISTBOX_AREA_OUTER, // box enclosing the check box items. LISTBOX_AREA_INNER, // box enclosing the check box items. - BTN_OK, // OK button - BTN_CANCEL, // Cancel button + SINGLE_BTN_AREA, // box enclosing the single-action buttons. + CHECK_TOGGLE_ALL, // check box for toggling all items. + BTN_OK, // OK button + BTN_CANCEL, // Cancel button }; void getSectionPosSize(Point& rPos, Size& rSize, SectionType eType) const; + void setAllMemberState(bool bSet); + DECL_LINK( OKButtonHdl, OKButton* ); - DECL_LINK( ScrollHdl, ScrollBar* ); + DECL_LINK( TriStateHdl, TriStateBox* ); + DECL_LINK( CheckHdl, SvTreeListBox* ); private: SvxCheckListBox maChecks; + TriStateBox maChkToggleAll; + OKButton maBtnOk; CancelButton maBtnCancel; @@ -264,7 +271,7 @@ private: ::std::auto_ptr mpExtendedData; ::std::auto_ptr mpOKAction; - size_t mnScrollPos; + TriState mePrevToggleAllState; }; #endif -- cgit v1.2.3 From 0bb56f1f94084cc1a7ad2d4c1976a032a1e37c6c Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 31 Jul 2009 04:55:32 +0000 Subject: Added two placeholder images for the single-select buttons in the popup window. --- default_images/sc/res/popup_select_current.png | Bin 0 -> 734 bytes default_images/sc/res/popup_unselect_current.png | Bin 0 -> 730 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 default_images/sc/res/popup_select_current.png create mode 100644 default_images/sc/res/popup_unselect_current.png diff --git a/default_images/sc/res/popup_select_current.png b/default_images/sc/res/popup_select_current.png new file mode 100644 index 000000000000..cc222c152a6d Binary files /dev/null and b/default_images/sc/res/popup_select_current.png differ diff --git a/default_images/sc/res/popup_unselect_current.png b/default_images/sc/res/popup_unselect_current.png new file mode 100644 index 000000000000..f407148a48c7 Binary files /dev/null and b/default_images/sc/res/popup_unselect_current.png differ -- cgit v1.2.3 From 8dca6ccdde0d337c113217562c3a9f594ddbc155 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 31 Jul 2009 04:56:38 +0000 Subject: Implemented single-select buttons. It's fully functional. --- sc/inc/sc.hrc | 2 ++ sc/source/ui/cctrl/dpcontrol.cxx | 52 ++++++++++++++++++++++++++++++++++++---- sc/source/ui/cctrl/dpcontrol.src | 18 ++++++++++++++ sc/source/ui/inc/dpcontrol.hxx | 7 +++++- 4 files changed, 74 insertions(+), 5 deletions(-) diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index 13d8481fce16..b005f7c61c1d 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -1444,6 +1444,8 @@ #define RID_IMG_H_DROP_URL (BMP_START + 5) #define RID_IMG_H_DROP_LINK (BMP_START + 6) #define RID_IMG_H_DROP_COPY (BMP_START + 7) +#define RID_IMG_SELECT_CURRENT (BMP_START + 8) +#define RID_IMG_UNSELECT_CURRENT (BMP_START + 9) #define RID_SCPTR_PIVOTCOL (BMP_START + 81) #define RID_SCPTR_PIVOTROW (BMP_START + 82) diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index 18cc9089e108..848d0c60250c 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -728,6 +728,8 @@ ScDPFieldPopupWindow::ScDPFieldPopupWindow(Window* pParent) : ScMenuFloatingWindow(pParent), maChecks(this, 0), maChkToggleAll(this, 0), + maBtnSelectSingle (this, 0), + maBtnUnselectSingle(this, 0), maBtnOk(this), maBtnCancel(this), mpExtendedData(NULL), @@ -745,7 +747,7 @@ ScDPFieldPopupWindow::ScDPFieldPopupWindow(Window* pParent) : getSectionPosSize(aPos, aSize, BTN_OK); maBtnOk.SetPosSizePixel(aPos, aSize); maBtnOk.SetFont(getLabelFont()); - maBtnOk.SetClickHdl( LINK(this, ScDPFieldPopupWindow, OKButtonHdl) ); + maBtnOk.SetClickHdl( LINK(this, ScDPFieldPopupWindow, ButtonHdl) ); maBtnOk.Show(); getSectionPosSize(aPos, aSize, BTN_CANCEL); @@ -766,6 +768,18 @@ ScDPFieldPopupWindow::ScDPFieldPopupWindow(Window* pParent) : maChkToggleAll.SetControlBackground(rStyle.GetMenuColor()); maChkToggleAll.SetClickHdl( LINK(this, ScDPFieldPopupWindow, TriStateHdl) ); maChkToggleAll.Show(); + + getSectionPosSize(aPos, aSize, BTN_SINGLE_SELECT); + maBtnSelectSingle.SetPosSizePixel(aPos, aSize); + maBtnSelectSingle.SetModeImage(Image(ScResId(RID_IMG_SELECT_CURRENT)), BMP_COLOR_NORMAL); + maBtnSelectSingle.SetClickHdl( LINK(this, ScDPFieldPopupWindow, ButtonHdl) ); + maBtnSelectSingle.Show(); + + getSectionPosSize(aPos, aSize, BTN_SINGLE_UNSELECT); + maBtnUnselectSingle.SetPosSizePixel(aPos, aSize); + maBtnUnselectSingle.SetModeImage(Image(ScResId(RID_IMG_UNSELECT_CURRENT)), BMP_COLOR_NORMAL); + maBtnUnselectSingle.SetClickHdl( LINK(this, ScDPFieldPopupWindow, ButtonHdl) ); + maBtnUnselectSingle.Show(); } ScDPFieldPopupWindow::~ScDPFieldPopupWindow() @@ -779,7 +793,7 @@ void ScDPFieldPopupWindow::getSectionPosSize(Point& rPos, Size& rSize, SectionTy const sal_uInt16 nListBoxInnerPadding = 5; const sal_uInt16 nTopMargin = 5; const sal_uInt16 nMenuHeight = 60; - const sal_uInt16 nSingleItemBtnAreaHeight = 30; // height of the middle area below the list box where the single-action buttons are. + const sal_uInt16 nSingleItemBtnAreaHeight = 32; // height of the middle area below the list box where the single-action buttons are. const sal_uInt16 nBottomBtnAreaHeight = 50; // height of the bottom area where the OK and Cancel buttons are. const sal_uInt16 nBtnWidth = 60; const sal_uInt16 nLabelHeight = getLabelFont().GetHeight(); @@ -836,6 +850,24 @@ void ScDPFieldPopupWindow::getSectionPosSize(Point& rPos, Size& rSize, SectionTy rSize = Size(70, h); } break; + case BTN_SINGLE_SELECT: + { + long h = 26; + rPos = Point(nListBoxMargin, nSingleBtnAreaY); + rPos.X() += 75; + rPos.Y() += (nSingleItemBtnAreaHeight - h)/2; + rSize = Size(h, h); + } + break; + case BTN_SINGLE_UNSELECT: + { + long h = 26; + rPos = Point(nListBoxMargin, nSingleBtnAreaY); + rPos.X() += 75 + h + 10; + rPos.Y() += (nSingleItemBtnAreaHeight - h)/2; + rSize = Size(h, h); + } + break; case BTN_OK: { long x = (aWndSize.Width() - nBtnWidth*2)/3; @@ -864,9 +896,21 @@ void ScDPFieldPopupWindow::setAllMemberState(bool bSet) maChecks.CheckEntryPos(i, bSet); } -IMPL_LINK( ScDPFieldPopupWindow, OKButtonHdl, OKButton*, EMPTYARG ) +void ScDPFieldPopupWindow::selectCurrentMemberOnly(bool bSet) +{ + setAllMemberState(!bSet); + sal_uInt16 nSelected = maChecks.GetSelectEntryPos(); + maChecks.CheckEntryPos(nSelected, bSet); +} + +IMPL_LINK( ScDPFieldPopupWindow, ButtonHdl, Button*, pBtn ) { - close(true); + if (pBtn == &maBtnOk) + close(true); + else if (pBtn == &maBtnSelectSingle) + selectCurrentMemberOnly(true); + else if (pBtn == &maBtnUnselectSingle) + selectCurrentMemberOnly(false); return 0; } diff --git a/sc/source/ui/cctrl/dpcontrol.src b/sc/source/ui/cctrl/dpcontrol.src index 4c1bda0b2724..31252a88b281 100644 --- a/sc/source/ui/cctrl/dpcontrol.src +++ b/sc/source/ui/cctrl/dpcontrol.src @@ -52,3 +52,21 @@ Resource RID_POPUP_FILTER Text [ en-US ] = "All" ; }; }; + +Image RID_IMG_SELECT_CURRENT +{ + ImageBitmap = Bitmap + { + File = "popup_select_current.png"; + }; + MaskColor = STD_MASKCOLOR; +}; + +Image RID_IMG_UNSELECT_CURRENT +{ + ImageBitmap = Bitmap + { + File = "popup_unselect_current.png"; + }; + MaskColor = STD_MASKCOLOR; +}; diff --git a/sc/source/ui/inc/dpcontrol.hxx b/sc/source/ui/inc/dpcontrol.hxx index 0a97f7e1046a..5f990038a112 100644 --- a/sc/source/ui/inc/dpcontrol.hxx +++ b/sc/source/ui/inc/dpcontrol.hxx @@ -248,14 +248,17 @@ private: LISTBOX_AREA_INNER, // box enclosing the check box items. SINGLE_BTN_AREA, // box enclosing the single-action buttons. CHECK_TOGGLE_ALL, // check box for toggling all items. + BTN_SINGLE_SELECT, + BTN_SINGLE_UNSELECT, BTN_OK, // OK button BTN_CANCEL, // Cancel button }; void getSectionPosSize(Point& rPos, Size& rSize, SectionType eType) const; void setAllMemberState(bool bSet); + void selectCurrentMemberOnly(bool bSet); - DECL_LINK( OKButtonHdl, OKButton* ); + DECL_LINK( ButtonHdl, Button* ); DECL_LINK( TriStateHdl, TriStateBox* ); DECL_LINK( CheckHdl, SvTreeListBox* ); @@ -263,6 +266,8 @@ private: SvxCheckListBox maChecks; TriStateBox maChkToggleAll; + ImageButton maBtnSelectSingle; + ImageButton maBtnUnselectSingle; OKButton maBtnOk; CancelButton maBtnCancel; -- cgit v1.2.3 From 10607279f3091b644156ed82f651fc9d3ce8372d Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 31 Jul 2009 05:09:14 +0000 Subject: Quick help strings for the single-selection buttons per spec from IBM. --- sc/source/ui/cctrl/dpcontrol.cxx | 2 ++ sc/source/ui/cctrl/dpcontrol.src | 10 ++++++++++ sc/source/ui/inc/dpcontrol.hrc | 10 ++++++---- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index 848d0c60250c..bc36abb7d182 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -771,12 +771,14 @@ ScDPFieldPopupWindow::ScDPFieldPopupWindow(Window* pParent) : getSectionPosSize(aPos, aSize, BTN_SINGLE_SELECT); maBtnSelectSingle.SetPosSizePixel(aPos, aSize); + maBtnSelectSingle.SetQuickHelpText(ScRscStrLoader(RID_POPUP_FILTER, STR_BTN_SELECT_CURRENT).GetString()); maBtnSelectSingle.SetModeImage(Image(ScResId(RID_IMG_SELECT_CURRENT)), BMP_COLOR_NORMAL); maBtnSelectSingle.SetClickHdl( LINK(this, ScDPFieldPopupWindow, ButtonHdl) ); maBtnSelectSingle.Show(); getSectionPosSize(aPos, aSize, BTN_SINGLE_UNSELECT); maBtnUnselectSingle.SetPosSizePixel(aPos, aSize); + maBtnUnselectSingle.SetQuickHelpText(ScRscStrLoader(RID_POPUP_FILTER, STR_BTN_UNSELECT_CURRENT).GetString()); maBtnUnselectSingle.SetModeImage(Image(ScResId(RID_IMG_UNSELECT_CURRENT)), BMP_COLOR_NORMAL); maBtnUnselectSingle.SetClickHdl( LINK(this, ScDPFieldPopupWindow, ButtonHdl) ); maBtnUnselectSingle.Show(); diff --git a/sc/source/ui/cctrl/dpcontrol.src b/sc/source/ui/cctrl/dpcontrol.src index 31252a88b281..31cbb62085e5 100644 --- a/sc/source/ui/cctrl/dpcontrol.src +++ b/sc/source/ui/cctrl/dpcontrol.src @@ -51,6 +51,16 @@ Resource RID_POPUP_FILTER { Text [ en-US ] = "All" ; }; + + String STR_BTN_SELECT_CURRENT + { + Text [ en-US ] = "Show only the current item." ; + }; + + String STR_BTN_UNSELECT_CURRENT + { + Text [ en-US ] = "Hide only the current item." ; + }; }; Image RID_IMG_SELECT_CURRENT diff --git a/sc/source/ui/inc/dpcontrol.hrc b/sc/source/ui/inc/dpcontrol.hrc index e792dc4a9ace..2275b601c17a 100644 --- a/sc/source/ui/inc/dpcontrol.hrc +++ b/sc/source/ui/inc/dpcontrol.hrc @@ -33,9 +33,11 @@ #include -#define STR_MENU_SORT_ASC 1 -#define STR_MENU_SORT_DESC 2 -#define STR_MENU_SORT_CUSTOM 3 -#define STR_BTN_TOGGLE_ALL 4 +#define STR_MENU_SORT_ASC 1 +#define STR_MENU_SORT_DESC 2 +#define STR_MENU_SORT_CUSTOM 3 +#define STR_BTN_TOGGLE_ALL 4 +#define STR_BTN_SELECT_CURRENT 5 +#define STR_BTN_UNSELECT_CURRENT 6 #endif -- cgit v1.2.3 From fef2f67ef7f3d49cc5b9bab8b2f21e2004cdfb16 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 31 Jul 2009 05:14:59 +0000 Subject: Don't forget to update the toggle-all check box after each single selection. --- sc/source/ui/cctrl/dpcontrol.cxx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index bc36abb7d182..2edfc2a91e05 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -910,9 +910,15 @@ IMPL_LINK( ScDPFieldPopupWindow, ButtonHdl, Button*, pBtn ) if (pBtn == &maBtnOk) close(true); else if (pBtn == &maBtnSelectSingle) + { selectCurrentMemberOnly(true); + CheckHdl(&maChecks); + } else if (pBtn == &maBtnUnselectSingle) + { selectCurrentMemberOnly(false); + CheckHdl(&maChecks); + } return 0; } @@ -939,8 +945,11 @@ IMPL_LINK( ScDPFieldPopupWindow, TriStateHdl, TriStateBox*, EMPTYARG ) return 0; } -IMPL_LINK( ScDPFieldPopupWindow, CheckHdl, SvTreeListBox*, EMPTYARG ) +IMPL_LINK( ScDPFieldPopupWindow, CheckHdl, SvTreeListBox*, pChecks ) { + if (pChecks != &maChecks) + return 0; + size_t nNumChecked = maChecks.GetCheckedEntryCount(); if (nNumChecked == maMembers.size()) // all members visible -- cgit v1.2.3 From 140a7e79d697b679c5c2a3b5ffe00c91f8cb9585 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 31 Jul 2009 15:36:49 +0000 Subject: We append an extra title row only for xls import, not for ods import. --- sc/inc/dpoutputgeometry.hxx | 5 ++++- sc/source/core/data/dpoutputgeometry.cxx | 5 +++-- sc/source/filter/excel/xipivot.cxx | 2 +- sc/source/filter/xml/xmldpimp.cxx | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/sc/inc/dpoutputgeometry.hxx b/sc/inc/dpoutputgeometry.hxx index 8183d94e2305..b665c9cc88b4 100644 --- a/sc/inc/dpoutputgeometry.hxx +++ b/sc/inc/dpoutputgeometry.hxx @@ -40,8 +40,9 @@ class SC_DLLPUBLIC ScDPOutputGeometry { public: enum FieldType { Column, Row, Page, Data, None }; + enum ImportType { ODF, XLS }; - ScDPOutputGeometry(const ScRange& rOutRange, bool bShowFilter); + ScDPOutputGeometry(const ScRange& rOutRange, bool bShowFilter, ImportType eImportType); ~ScDPOutputGeometry(); /** @@ -71,6 +72,8 @@ private: sal_uInt32 mnPageFields; sal_uInt32 mnDataFields; + ImportType meImportType; + bool mbShowFilter; }; diff --git a/sc/source/core/data/dpoutputgeometry.cxx b/sc/source/core/data/dpoutputgeometry.cxx index 86b7d8f0bd15..20c071976ebe 100644 --- a/sc/source/core/data/dpoutputgeometry.cxx +++ b/sc/source/core/data/dpoutputgeometry.cxx @@ -42,12 +42,13 @@ using ::std::vector; -ScDPOutputGeometry::ScDPOutputGeometry(const ScRange& rOutRange, bool bShowFilter) : +ScDPOutputGeometry::ScDPOutputGeometry(const ScRange& rOutRange, bool bShowFilter, ImportType eImportType) : maOutRange(rOutRange), mnRowFields(0), mnColumnFields(0), mnPageFields(0), mnDataFields(0), + meImportType(eImportType), mbShowFilter(bShowFilter) { } @@ -172,7 +173,7 @@ ScDPOutputGeometry::FieldType ScDPOutputGeometry::getFieldButtonType(const ScAdd { // We will ignore the table position for now. - bool bExtraTitleRow = (mnColumnFields == 0); + bool bExtraTitleRow = (mnColumnFields == 0 && meImportType == ScDPOutputGeometry::XLS); bool bDataLayout = mnDataFields > 1; SCROW nCurRow = maOutRange.aStart.Row(); diff --git a/sc/source/filter/excel/xipivot.cxx b/sc/source/filter/excel/xipivot.cxx index fdc7246151ca..24ebce414c6a 100644 --- a/sc/source/filter/excel/xipivot.cxx +++ b/sc/source/filter/excel/xipivot.cxx @@ -1443,7 +1443,7 @@ void XclImpPivotTable::ApplyMergeFlags(const ScRange& rOutRange, const ScDPSaveD { // Apply merge flags for varoius datapilot controls. - ScDPOutputGeometry aGeometry(rOutRange, false); + ScDPOutputGeometry aGeometry(rOutRange, false, ScDPOutputGeometry::XLS); aGeometry.setColumnFieldCount(maPTInfo.mnColFields); aGeometry.setPageFieldCount(maPTInfo.mnPageFields); aGeometry.setDataFieldCount(maPTInfo.mnDataFields); diff --git a/sc/source/filter/xml/xmldpimp.cxx b/sc/source/filter/xml/xmldpimp.cxx index 0a990416006e..572bcbb817e3 100644 --- a/sc/source/filter/xml/xmldpimp.cxx +++ b/sc/source/filter/xml/xmldpimp.cxx @@ -285,7 +285,7 @@ SvXMLImportContext *ScXMLDataPilotTableContext::CreateChildContext( USHORT nPref void ScXMLDataPilotTableContext::SetButtons() { - ScDPOutputGeometry aGeometry(aTargetRangeAddress, bShowFilter); + ScDPOutputGeometry aGeometry(aTargetRangeAddress, bShowFilter, ScDPOutputGeometry::ODF); aGeometry.setColumnFieldCount(mnColFieldCount); aGeometry.setRowFieldCount(mnRowFieldCount); aGeometry.setPageFieldCount(mnPageFieldCount); -- cgit v1.2.3 From e4228cc6472975a438aaa428a3562bd727c4a83f Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 31 Jul 2009 18:40:28 +0000 Subject: Handle optional property values of DataPilotSource more gracefully. We need to allow the data provider to not support those optional properties. --- sc/inc/miscuno.hxx | 14 +++++ sc/source/core/data/dpsave.cxx | 112 +++++++++------------------------------- sc/source/ui/unoobj/miscuno.cxx | 17 ++++++ 3 files changed, 54 insertions(+), 89 deletions(-) diff --git a/sc/inc/miscuno.hxx b/sc/inc/miscuno.hxx index 1486d3ce480b..7f6bd4774faf 100644 --- a/sc/inc/miscuno.hxx +++ b/sc/inc/miscuno.hxx @@ -291,6 +291,20 @@ public: static sal_Int32 GetInt32FromAny( const com::sun::star::uno::Any& aAny ); static sal_Int32 GetEnumFromAny( const com::sun::star::uno::Any& aAny ); static void SetBoolInAny( com::sun::star::uno::Any& rAny, sal_Bool bValue ); + + static void SetOptionalPropertyValue( + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& rPropSet, + const sal_Char* pPropName, const ::com::sun::star::uno::Any& rVal ); + + template + static void SetOptionalPropertyValue( + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& rPropSet, + const sal_Char* pPropName, const ValueType& rVal ) + { + ::com::sun::star::uno::Any any; + any <<= rVal; + SetOptionalPropertyValue(rPropSet, pPropName, any); + } }; diff --git a/sc/source/core/data/dpsave.cxx b/sc/source/core/data/dpsave.cxx index cc564457761f..7ab7a13c7fc1 100644 --- a/sc/source/core/data/dpsave.cxx +++ b/sc/source/core/data/dpsave.cxx @@ -61,6 +61,8 @@ #include using namespace com::sun::star; +using ::com::sun::star::uno::Reference; +using ::com::sun::star::uno::Any; using ::rtl::OUString; using ::rtl::OUStringHash; using ::std::hash_map; @@ -213,28 +215,10 @@ void ScDPSaveMember::WriteToSource( const uno::Reference& xMemb rtl::OUString::createFromAscii(DP_PROP_SHOWDETAILS), (BOOL)nShowDetailsMode ); if (mpLayoutName.get()) - { - try - { - uno::Any any; - any <<= rtl::OUString(*mpLayoutName); - xMembProp->setPropertyValue(rtl::OUString::createFromAscii(SC_UNO_LAYOUTNAME), any); - } - catch (uno::Exception&) - { - } - } + ScUnoHelpFunctions::SetOptionalPropertyValue(xMembProp, SC_UNO_LAYOUTNAME, *mpLayoutName); + if ( nPosition >= 0 ) - { - try - { - xMembProp->setPropertyValue( rtl::OUString::createFromAscii(DP_PROP_POSITION), uno::Any(nPosition) ); - } - catch ( uno::Exception& ) - { - // position is optional - exception must be ignored - } - } + ScUnoHelpFunctions::SetOptionalPropertyValue(xMembProp, DP_PROP_POSITION, nPosition); } } @@ -604,28 +588,15 @@ void ScDPSaveDimension::WriteToSource( const uno::Reference& xD aFilter = uno::Sequence( &aField, 1 ); } // else keep empty sequence - try - { - aAny <<= aFilter; - xDimProp->setPropertyValue( rtl::OUString::createFromAscii(DP_PROP_FILTER), aAny ); - if (mpLayoutName.get()) - { - aAny <<= *mpLayoutName; - xDimProp->setPropertyValue(rtl::OUString::createFromAscii(SC_UNO_LAYOUTNAME), aAny); - } - const OUString* pSubTotalName = GetSubtotalName(); - if (pSubTotalName) - { - // Custom subtotal name, with '?' being replaced by the visible field name later. - aAny <<= *pSubTotalName; - xDimProp->setPropertyValue(OUString::createFromAscii(SC_UNO_FIELD_SUBTOTALNAME), aAny); - } - } - catch ( beans::UnknownPropertyException& ) - { - // recent addition - allow source to not handle it (no error) - } + ScUnoHelpFunctions::SetOptionalPropertyValue(xDimProp, DP_PROP_FILTER, aFilter); + if (mpLayoutName.get()) + ScUnoHelpFunctions::SetOptionalPropertyValue(xDimProp, SC_UNO_LAYOUTNAME, *mpLayoutName); + + const OUString* pSubTotalName = GetSubtotalName(); + if (pSubTotalName) + // Custom subtotal name, with '?' being replaced by the visible field name later. + ScUnoHelpFunctions::SetOptionalPropertyValue(xDimProp, SC_UNO_FIELD_SUBTOTALNAME, *pSubTotalName); } // Level loop outside of maMemberList loop @@ -684,41 +655,13 @@ void ScDPSaveDimension::WriteToSource( const uno::Reference& xD rtl::OUString::createFromAscii(DP_PROP_SHOWEMPTY), (BOOL)nShowEmptyMode ); if ( pSortInfo ) - { - aAny <<= *pSortInfo; - try - { - xLevProp->setPropertyValue( rtl::OUString::createFromAscii(SC_UNO_SORTING), aAny ); - } - catch ( beans::UnknownPropertyException& ) - { - // recent addition - allow source to not handle it (no error) - } - } + ScUnoHelpFunctions::SetOptionalPropertyValue(xLevProp, SC_UNO_SORTING, *pSortInfo); + if ( pAutoShowInfo ) - { - aAny <<= *pAutoShowInfo; - try - { - xLevProp->setPropertyValue( rtl::OUString::createFromAscii(SC_UNO_AUTOSHOW), aAny ); - } - catch ( beans::UnknownPropertyException& ) - { - // recent addition - allow source to not handle it (no error) - } - } + ScUnoHelpFunctions::SetOptionalPropertyValue(xLevProp, SC_UNO_AUTOSHOW, *pAutoShowInfo); + if ( pLayoutInfo ) - { - aAny <<= *pLayoutInfo; - try - { - xLevProp->setPropertyValue( rtl::OUString::createFromAscii(SC_UNO_LAYOUT), aAny ); - } - catch ( beans::UnknownPropertyException& ) - { - // recent addition - allow source to not handle it (no error) - } - } + ScUnoHelpFunctions::SetOptionalPropertyValue(xLevProp, SC_UNO_LAYOUT, *pLayoutInfo); // exceptions are caught at ScDPSaveData::WriteToSource } @@ -759,12 +702,7 @@ void ScDPSaveDimension::WriteToSource( const uno::Reference& xD } if (xDimProp.is()) - { - uno::Any any; - any <<= bHasHiddenMember; - xDimProp->setPropertyValue( - OUString::createFromAscii(SC_UNO_HAS_HIDDEN_MEMBER), any); - } + ScUnoHelpFunctions::SetOptionalPropertyValue(xDimProp, SC_UNO_HAS_HIDDEN_MEMBER, bHasHiddenMember); } void ScDPSaveDimension::UpdateMemberVisibility(const hash_map& rData) @@ -1166,19 +1104,15 @@ void ScDPSaveData::WriteToSource( const uno::ReferencesetPropertyValue(OUString::createFromAscii(SC_UNO_GRANDTOTAL_NAME), any); - } } catch(uno::Exception&) { // no error } + + const OUString* pGrandTotalName = GetGrandTotalName(); + if (pGrandTotalName) + ScUnoHelpFunctions::SetOptionalPropertyValue(xSourceProp, SC_UNO_GRANDTOTAL_NAME, *pGrandTotalName); } // exceptions in the other calls are errors diff --git a/sc/source/ui/unoobj/miscuno.cxx b/sc/source/ui/unoobj/miscuno.cxx index 3d41da907016..090073e259ae 100644 --- a/sc/source/ui/unoobj/miscuno.cxx +++ b/sc/source/ui/unoobj/miscuno.cxx @@ -39,6 +39,9 @@ #include "unoguard.hxx" using namespace com::sun::star; +using ::com::sun::star::uno::Reference; +using ::com::sun::star::uno::Any; +using ::rtl::OUString; //------------------------------------------------------------------------ @@ -180,6 +183,20 @@ void ScUnoHelpFunctions::SetBoolInAny( uno::Any& rAny, sal_Bool bValue ) rAny.setValue( &bValue, getBooleanCppuType() ); } +// static +void ScUnoHelpFunctions::SetOptionalPropertyValue( + Reference& rPropSet, const sal_Char* pPropName, const Any& rVal ) +{ + try + { + rPropSet->setPropertyValue(OUString::createFromAscii(pPropName), rVal); + } + catch (const beans::UnknownPropertyException&) + { + // ignored - not supported. + } +} + //------------------------------------------------------------------------ ScIndexEnumeration::ScIndexEnumeration(const uno::Reference& rInd, -- cgit v1.2.3 From 05b32c409e8984e3e24ee2a20d4bc21683f0b600 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 31 Jul 2009 19:21:20 +0000 Subject: Draw black border around the popup arrow. It looks better this way. --- sc/source/ui/cctrl/dpcontrol.cxx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index 2edfc2a91e05..726c6dd660bd 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -144,16 +144,21 @@ void ScDPFieldButton::drawPopupButton() Size aSize; getPopupBoundingBox(aPos, aSize); + // outer black border + mpOutDev->SetLineColor(COL_BLACK); + mpOutDev->SetFillColor(); + mpOutDev->DrawRect(Rectangle(aPos, aSize)); + // border lines mpOutDev->SetLineColor(mpStyle->GetLightColor()); - mpOutDev->DrawLine(aPos, Point(aPos.X(), aPos.Y()+aSize.Height()-1)); - mpOutDev->DrawLine(aPos, Point(aPos.X()+aSize.Width()-1, aPos.Y())); + mpOutDev->DrawLine(Point(aPos.X()+1, aPos.Y()+1), Point(aPos.X()+1, aPos.Y()+aSize.Height()-2)); + mpOutDev->DrawLine(Point(aPos.X()+1, aPos.Y()+1), Point(aPos.X()+aSize.Width()-2, aPos.Y()+1)); mpOutDev->SetLineColor(mpStyle->GetShadowColor()); - mpOutDev->DrawLine(Point(aPos.X(), aPos.Y()+aSize.Height()-1), - Point(aPos.X()+aSize.Width()-1, aPos.Y()+aSize.Height()-1)); - mpOutDev->DrawLine(Point(aPos.X()+aSize.Width()-1, aPos.Y()), - Point(aPos.X()+aSize.Width()-1, aPos.Y()+aSize.Height()-1)); + mpOutDev->DrawLine(Point(aPos.X()+1, aPos.Y()+aSize.Height()-2), + Point(aPos.X()+aSize.Width()-2, aPos.Y()+aSize.Height()-2)); + mpOutDev->DrawLine(Point(aPos.X()+aSize.Width()-2, aPos.Y()+1), + Point(aPos.X()+aSize.Width()-2, aPos.Y()+aSize.Height()-2)); // the arrowhead Color aArrowColor = mbHasHiddenMember ? mpStyle->GetHighlightLinkColor() : mpStyle->GetButtonTextColor(); -- cgit v1.2.3 From ba3f18f4ab3a93264fd67ce956dfad96e74249f5 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 31 Jul 2009 19:47:48 +0000 Subject: Draw the autofilter arrow button the same way as the field popup button. This will temporarily break autofilter's push animation and mouse pointer hit analysis. Also made the popup button a little wider. --- sc/source/ui/cctrl/dpcontrol.cxx | 71 ++++++++++++++++++++++------------------ sc/source/ui/inc/dpcontrol.hxx | 2 ++ sc/source/ui/view/gridwin4.cxx | 24 +++++++------- 3 files changed, 54 insertions(+), 43 deletions(-) diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index 726c6dd660bd..db05af97b8df 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -52,6 +52,7 @@ using ::std::hash_map; ScDPFieldButton::ScDPFieldButton(OutputDevice* pOutDev, const StyleSettings* pStyle) : mpOutDev(pOutDev), mpStyle(pStyle), + mbBaseButton(true), mbPopupButton(false), mbHasHiddenMember(false) { @@ -72,6 +73,11 @@ void ScDPFieldButton::setBoundingBox(const Point& rPos, const Size& rSize) maSize = rSize; } +void ScDPFieldButton::setDrawBaseButton(bool b) +{ + mbBaseButton = b; +} + void ScDPFieldButton::setDrawPopupButton(bool b) { mbPopupButton = b; @@ -86,33 +92,36 @@ void ScDPFieldButton::draw() { const long nMargin = 2; - // Background - Rectangle aRect(maPos, maSize); - mpOutDev->SetLineColor(mpStyle->GetFaceColor()); - mpOutDev->SetFillColor(mpStyle->GetFaceColor()); - mpOutDev->DrawRect(aRect); - - // Border lines - mpOutDev->SetLineColor(mpStyle->GetLightColor()); - mpOutDev->DrawLine(Point(maPos), Point(maPos.X(), maPos.Y()+maSize.Height()-1)); - mpOutDev->DrawLine(Point(maPos), Point(maPos.X()+maSize.Width()-1, maPos.Y())); - - mpOutDev->SetLineColor(mpStyle->GetShadowColor()); - mpOutDev->DrawLine(Point(maPos.X(), maPos.Y()+maSize.Height()-1), - Point(maPos.X()+maSize.Width()-1, maPos.Y()+maSize.Height()-1)); - mpOutDev->DrawLine(Point(maPos.X()+maSize.Width()-1, maPos.Y()), - Point(maPos.X()+maSize.Width()-1, maPos.Y()+maSize.Height()-1)); - - // Field name - Font aTextFont( mpStyle->GetLabelFont() ); - aTextFont.SetHeight(12); - mpOutDev->SetFont(aTextFont); - - Point aTextPos = maPos; - long nTHeight = mpOutDev->GetTextHeight(); - aTextPos.setX(maPos.getX() + nMargin); - aTextPos.setY(maPos.getY() + (maSize.Height()-nTHeight)/2); - mpOutDev->DrawText(aTextPos, maText); + if (mbBaseButton) + { + // Background + Rectangle aRect(maPos, maSize); + mpOutDev->SetLineColor(mpStyle->GetFaceColor()); + mpOutDev->SetFillColor(mpStyle->GetFaceColor()); + mpOutDev->DrawRect(aRect); + + // Border lines + mpOutDev->SetLineColor(mpStyle->GetLightColor()); + mpOutDev->DrawLine(Point(maPos), Point(maPos.X(), maPos.Y()+maSize.Height()-1)); + mpOutDev->DrawLine(Point(maPos), Point(maPos.X()+maSize.Width()-1, maPos.Y())); + + mpOutDev->SetLineColor(mpStyle->GetShadowColor()); + mpOutDev->DrawLine(Point(maPos.X(), maPos.Y()+maSize.Height()-1), + Point(maPos.X()+maSize.Width()-1, maPos.Y()+maSize.Height()-1)); + mpOutDev->DrawLine(Point(maPos.X()+maSize.Width()-1, maPos.Y()), + Point(maPos.X()+maSize.Width()-1, maPos.Y()+maSize.Height()-1)); + + // Field name + Font aTextFont( mpStyle->GetLabelFont() ); + aTextFont.SetHeight(12); + mpOutDev->SetFont(aTextFont); + + Point aTextPos = maPos; + long nTHeight = mpOutDev->GetTextHeight(); + aTextPos.setX(maPos.getX() + nMargin); + aTextPos.setY(maPos.getY() + (maSize.Height()-nTHeight)/2); + mpOutDev->DrawText(aTextPos, maText); + } if (mbPopupButton) drawPopupButton(); @@ -122,8 +131,8 @@ void ScDPFieldButton::getPopupBoundingBox(Point& rPos, Size& rSize) const { long nW = maSize.getWidth()*0.5; long nH = maSize.getHeight(); - if (nW > 16) - nW = 16; + if (nW > 18) + nW = 18; if (nH > 18) nH = 18; @@ -144,9 +153,9 @@ void ScDPFieldButton::drawPopupButton() Size aSize; getPopupBoundingBox(aPos, aSize); - // outer black border + // Background & outer black border mpOutDev->SetLineColor(COL_BLACK); - mpOutDev->SetFillColor(); + mpOutDev->SetFillColor(mpStyle->GetFaceColor()); mpOutDev->DrawRect(Rectangle(aPos, aSize)); // border lines diff --git a/sc/source/ui/inc/dpcontrol.hxx b/sc/source/ui/inc/dpcontrol.hxx index 5f990038a112..9bd78d8ab598 100644 --- a/sc/source/ui/inc/dpcontrol.hxx +++ b/sc/source/ui/inc/dpcontrol.hxx @@ -61,6 +61,7 @@ public: void setText(const ::rtl::OUString& rText); void setBoundingBox(const Point& rPos, const Size& rSize); + void setDrawBaseButton(bool b); void setDrawPopupButton(bool b); void setHasHiddenMember(bool b); void draw(); @@ -77,6 +78,7 @@ private: ::rtl::OUString maText; OutputDevice* mpOutDev; const StyleSettings* mpStyle; + bool mbBaseButton; bool mbPopupButton; bool mbHasHiddenMember; }; diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index e6466e7ba3b1..12e93f977945 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -1204,7 +1204,7 @@ void ScGridWindow::DrawButtons( SCCOL nX1, SCROW /*nY1*/, SCCOL nX2, SCROW /*nY2 { aComboButton.SetOutputDevice( pContentDev ); - ScDPFieldButton aDPFieldBtn(pContentDev, &GetSettings().GetStyleSettings()); + ScDPFieldButton aCellBtn(pContentDev, &GetSettings().GetStyleSettings()); SCCOL nCol; SCROW nRow; @@ -1287,14 +1287,13 @@ void ScGridWindow::DrawButtons( SCCOL nX1, SCROW /*nY1*/, SCCOL nX2, SCROW /*nY2 bool bArrowState = bSimpleQuery && bColumnFound; long nSizeX; long nSizeY; - pViewData->GetMergeSizePixel( nCol, nRow, nSizeX, nSizeY ); - aComboButton.SetOptSizePixel(); - DrawComboButton( pViewData->GetScrPos( nCol, nRow, eWhich ), - nSizeX, nSizeY, bArrowState ); + Point aScrPos = pViewData->GetScrPos( nCol, nRow, eWhich ); - aComboButton.SetPosPixel( aOldPos ); // alten Zustand - aComboButton.SetSizePixel( aOldSize ); // fuer MouseUp/Down + aCellBtn.setBoundingBox(aScrPos, Size(nSizeX-1, nSizeY-1)); + aCellBtn.setDrawBaseButton(false); + aCellBtn.setDrawPopupButton(true); + aCellBtn.draw(); } } } @@ -1323,11 +1322,12 @@ void ScGridWindow::DrawButtons( SCCOL nX1, SCROW /*nY1*/, SCCOL nX2, SCROW /*nY2 String aStr; pDoc->GetString(nCol, nRow, nTab, aStr); - aDPFieldBtn.setText(aStr); - aDPFieldBtn.setBoundingBox(Point(nPosX,nPosY), Size(nSizeX-1, nSizeY-1)); - aDPFieldBtn.setDrawPopupButton(pInfo->bPopupButton); - aDPFieldBtn.setHasHiddenMember(pInfo->bFilterActive); - aDPFieldBtn.draw(); + aCellBtn.setText(aStr); + aCellBtn.setBoundingBox(Point(nPosX, nPosY), Size(nSizeX-1, nSizeY-1)); + aCellBtn.setDrawBaseButton(true); + aCellBtn.setDrawPopupButton(pInfo->bPopupButton); + aCellBtn.setHasHiddenMember(pInfo->bFilterActive); + aCellBtn.draw(); } } } -- cgit v1.2.3 From 3989ce308969f2eb5ae0e147518fb2a711868c65 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 31 Jul 2009 23:21:18 +0000 Subject: Extracted the autofilter hit handling code into its own method. --- sc/source/ui/inc/gridwin.hxx | 1 + sc/source/ui/view/gridwin.cxx | 46 +----------------------------------------- sc/source/ui/view/gridwin2.cxx | 39 +++++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 45 deletions(-) diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx index c5908d380a45..e38c2a4f422c 100644 --- a/sc/source/ui/inc/gridwin.hxx +++ b/sc/source/ui/inc/gridwin.hxx @@ -236,6 +236,7 @@ private: BOOL TestMouse( const MouseEvent& rMEvt, BOOL bAction ); BOOL DoPageFieldSelection( SCCOL nCol, SCROW nRow ); + bool DoAutoFilterButton( SCCOL nCol, SCROW nRow, const MouseEvent& rMEvt ); void DoPushButton( SCCOL nCol, SCROW nRow, const MouseEvent& rMEvt ); #if OLD_PIVOT_IMPLEMENTATION void PivotMouseMove( const MouseEvent& rMEvt ); diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index bc175d7b65d0..79529194b668 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -1634,52 +1634,8 @@ void ScGridWindow::HandleMouseButtonDown( const MouseEvent& rMEvt ) pDoc->GetAttr( nPosX, nPosY, nTab, ATTR_MERGE_FLAG ); if (pAttr->HasAutoFilter()) { - Point aScrPos = pViewData->GetScrPos(nPosX,nPosY,eWhich); - long nSizeX; - long nSizeY; - Point aDiffPix = aPos; - - aDiffPix -= aScrPos; - BOOL bLayoutRTL = pDoc->IsLayoutRTL( nTab ); - if ( bLayoutRTL ) - aDiffPix.X() = -aDiffPix.X(); - - pViewData->GetMergeSizePixel( nPosX, nPosY, nSizeX, nSizeY ); - - // Breite des Buttons ist nicht von der Zellhoehe abhaengig - Size aButSize = aComboButton.GetSizePixel(); - long nButWidth = Min( aButSize.Width(), nSizeX ); - long nButHeight = Min( aButSize.Height(), nSizeY ); - - if ( aDiffPix.X() >= nSizeX - nButWidth && - aDiffPix.Y() >= nSizeY - nButHeight ) - { - if ( DoPageFieldSelection( nPosX, nPosY ) ) - return; - - BOOL bFilterActive = IsAutoFilterActive( nPosX, nPosY, - pViewData->GetTabNo() ); - - aComboButton.SetOptSizePixel(); - DrawComboButton( aScrPos, nSizeX, nSizeY, bFilterActive, TRUE ); - -#if 0 - if ( bWasFilterBox - && (SCsCOL)nOldColFBox == nPosX - && (SCsROW)nOldRowFBox == nPosY ) - { - // Verhindern, dass an gleicher Stelle eine - // FilterBox geoeffnet wird, wenn diese gerade - // geloescht wurde - - nMouseStatus = SC_GM_FILTER; // fuer ButtonDraw im MouseButtonUp(); - return; - } -#endif - DoAutoFilterMenue( nPosX, nPosY, FALSE ); - + if (DoAutoFilterButton(nPosX, nPosY, rMEvt)) return; - } } if (pAttr->HasButton()) { diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx index a0791391e9d3..8db035d6df55 100644 --- a/sc/source/ui/view/gridwin2.cxx +++ b/sc/source/ui/view/gridwin2.cxx @@ -130,6 +130,45 @@ BOOL ScGridWindow::DoPageFieldSelection( SCCOL nCol, SCROW nRow ) return FALSE; } +bool ScGridWindow::DoAutoFilterButton( SCCOL nCol, SCROW nRow, const MouseEvent& rMEvt ) +{ + ScDocument* pDoc = pViewData->GetDocument(); + SCTAB nTab = pViewData->GetTabNo(); + Point aScrPos = pViewData->GetScrPos(nCol, nRow, eWhich); + Point aDiffPix = rMEvt.GetPosPixel(); + + aDiffPix -= aScrPos; + BOOL bLayoutRTL = pDoc->IsLayoutRTL( nTab ); + if ( bLayoutRTL ) + aDiffPix.X() = -aDiffPix.X(); + + long nSizeX, nSizeY; + pViewData->GetMergeSizePixel( nCol, nRow, nSizeX, nSizeY ); + + // Breite des Buttons ist nicht von der Zellhoehe abhaengig + Size aButSize = aComboButton.GetSizePixel(); + long nButWidth = Min( aButSize.Width(), nSizeX ); + long nButHeight = Min( aButSize.Height(), nSizeY ); + + if ( aDiffPix.X() >= nSizeX - nButWidth && + aDiffPix.Y() >= nSizeY - nButHeight ) + { + if ( DoPageFieldSelection( nCol, nRow ) ) + return true; + + BOOL bFilterActive = IsAutoFilterActive( nCol, nRow, + pViewData->GetTabNo() ); + + aComboButton.SetOptSizePixel(); + DrawComboButton( aScrPos, nSizeX, nSizeY, bFilterActive, TRUE ); + DoAutoFilterMenue(nCol, nRow, false); + + return true; + } + + return false; +} + void ScGridWindow::DoPushButton( SCCOL nCol, SCROW nRow, const MouseEvent& rMEvt ) { ScDocument* pDoc = pViewData->GetDocument(); -- cgit v1.2.3 From 41eedbe32033a7d11c1027a5561f46453324d105 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Sat, 1 Aug 2009 01:27:21 +0000 Subject: Button pressing animation for autofilter buttons. --- sc/source/ui/cctrl/dpcontrol.cxx | 46 +++++++++++++++++++++++++++++++--------- sc/source/ui/inc/dpcontrol.hxx | 2 ++ sc/source/ui/inc/gridwin.hxx | 2 ++ sc/source/ui/view/gridwin.cxx | 28 +++++++++++++++++------- sc/source/ui/view/gridwin2.cxx | 42 +++++++++++++++++++----------------- sc/source/ui/view/gridwin4.cxx | 1 + 6 files changed, 84 insertions(+), 37 deletions(-) diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index db05af97b8df..2239a4c96a2c 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -54,7 +54,8 @@ ScDPFieldButton::ScDPFieldButton(OutputDevice* pOutDev, const StyleSettings* pSt mpStyle(pStyle), mbBaseButton(true), mbPopupButton(false), - mbHasHiddenMember(false) + mbHasHiddenMember(false), + mbPopupPressed(false) { } @@ -88,9 +89,16 @@ void ScDPFieldButton::setHasHiddenMember(bool b) mbHasHiddenMember = b; } +void ScDPFieldButton::setPopupPressed(bool b) +{ + mbPopupPressed = b; +} + void ScDPFieldButton::draw() { const long nMargin = 2; + bool bOldMapEnablaed = mpOutDev->IsMapModeEnabled(); + mpOutDev->EnableMapMode(false); if (mbBaseButton) { @@ -125,6 +133,8 @@ void ScDPFieldButton::draw() if (mbPopupButton) drawPopupButton(); + + mpOutDev->EnableMapMode(bOldMapEnablaed); } void ScDPFieldButton::getPopupBoundingBox(Point& rPos, Size& rSize) const @@ -158,16 +168,19 @@ void ScDPFieldButton::drawPopupButton() mpOutDev->SetFillColor(mpStyle->GetFaceColor()); mpOutDev->DrawRect(Rectangle(aPos, aSize)); - // border lines - mpOutDev->SetLineColor(mpStyle->GetLightColor()); - mpOutDev->DrawLine(Point(aPos.X()+1, aPos.Y()+1), Point(aPos.X()+1, aPos.Y()+aSize.Height()-2)); - mpOutDev->DrawLine(Point(aPos.X()+1, aPos.Y()+1), Point(aPos.X()+aSize.Width()-2, aPos.Y()+1)); + if (!mbPopupPressed) + { + // border lines + mpOutDev->SetLineColor(mpStyle->GetLightColor()); + mpOutDev->DrawLine(Point(aPos.X()+1, aPos.Y()+1), Point(aPos.X()+1, aPos.Y()+aSize.Height()-2)); + mpOutDev->DrawLine(Point(aPos.X()+1, aPos.Y()+1), Point(aPos.X()+aSize.Width()-2, aPos.Y()+1)); - mpOutDev->SetLineColor(mpStyle->GetShadowColor()); - mpOutDev->DrawLine(Point(aPos.X()+1, aPos.Y()+aSize.Height()-2), - Point(aPos.X()+aSize.Width()-2, aPos.Y()+aSize.Height()-2)); - mpOutDev->DrawLine(Point(aPos.X()+aSize.Width()-2, aPos.Y()+1), - Point(aPos.X()+aSize.Width()-2, aPos.Y()+aSize.Height()-2)); + mpOutDev->SetLineColor(mpStyle->GetShadowColor()); + mpOutDev->DrawLine(Point(aPos.X()+1, aPos.Y()+aSize.Height()-2), + Point(aPos.X()+aSize.Width()-2, aPos.Y()+aSize.Height()-2)); + mpOutDev->DrawLine(Point(aPos.X()+aSize.Width()-2, aPos.Y()+1), + Point(aPos.X()+aSize.Width()-2, aPos.Y()+aSize.Height()-2)); + } // the arrowhead Color aArrowColor = mbHasHiddenMember ? mpStyle->GetHighlightLinkColor() : mpStyle->GetButtonTextColor(); @@ -180,6 +193,14 @@ void ScDPFieldButton::drawPopupButton() aPos1.Y() = aCenter.Y() - 3; aPos2.Y() = aCenter.Y() - 3; + if (mbPopupPressed) + { + aPos1.X() += 1; + aPos2.X() += 1; + aPos1.Y() += 1; + aPos2.Y() += 1; + } + do { ++aPos1.X(); @@ -194,6 +215,11 @@ void ScDPFieldButton::drawPopupButton() { // tiny little box to display in presence of hidden member(s). Point aBoxPos(aPos.X() + aSize.Width() - 5, aPos.Y() + aSize.Height() - 5); + if (mbPopupPressed) + { + aBoxPos.X() += 1; + aBoxPos.Y() += 1; + } Size aBoxSize(3, 3); mpOutDev->DrawRect(Rectangle(aBoxPos, aBoxSize)); } diff --git a/sc/source/ui/inc/dpcontrol.hxx b/sc/source/ui/inc/dpcontrol.hxx index 9bd78d8ab598..367dfe059600 100644 --- a/sc/source/ui/inc/dpcontrol.hxx +++ b/sc/source/ui/inc/dpcontrol.hxx @@ -64,6 +64,7 @@ public: void setDrawBaseButton(bool b); void setDrawPopupButton(bool b); void setHasHiddenMember(bool b); + void setPopupPressed(bool b); void draw(); void getPopupBoundingBox(Point& rPos, Size& rSize) const; @@ -81,6 +82,7 @@ private: bool mbBaseButton; bool mbPopupButton; bool mbHasHiddenMember; + bool mbPopupPressed; }; // ============================================================================ diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx index e38c2a4f422c..4408c5f9b602 100644 --- a/sc/source/ui/inc/gridwin.hxx +++ b/sc/source/ui/inc/gridwin.hxx @@ -50,6 +50,7 @@ class ScPivot; #endif class ScDPObject; class ScDPFieldPopupWindow; +class ScDPFieldButton; class ScOutputData; class ScFilterListBox; class AutoFilterPopup; @@ -162,6 +163,7 @@ private: ScFilterListBox* pFilterBox; FloatingWindow* pFilterFloat; ::std::auto_ptr mpDPFieldPopup; + ::std::auto_ptr mpFilterButton; USHORT nCursorHideCount; diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 79529194b668..8522ab27739b 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -372,6 +372,7 @@ ScGridWindow::ScGridWindow( Window* pParent, ScViewData* pData, ScSplitPos eWhic pFilterBox( NULL ), pFilterFloat( NULL ), mpDPFieldPopup(NULL), + mpFilterButton(NULL), nCursorHideCount( 0 ), bMarking( FALSE ), nButtonDown( 0 ), @@ -1765,11 +1766,17 @@ void __EXPORT ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt ) { if ( pFilterBox && pFilterBox->GetMode() == SC_FILTERBOX_FILTER ) { - BOOL bFilterActive = IsAutoFilterActive( pFilterBox->GetCol(), pFilterBox->GetRow(), - pViewData->GetTabNo() ); - HideCursor(); - aComboButton.Draw( bFilterActive ); - ShowCursor(); + if (mpFilterButton.get()) + { + bool bFilterActive = IsAutoFilterActive( + pFilterBox->GetCol(), pFilterBox->GetRow(), pViewData->GetTabNo() ); + + mpFilterButton->setHasHiddenMember(bFilterActive); + mpFilterButton->setPopupPressed(false); + HideCursor(); + mpFilterButton->draw(); + ShowCursor(); + } } nMouseStatus = SC_GM_NONE; ReleaseMouse(); @@ -2179,9 +2186,14 @@ void __EXPORT ScGridWindow::MouseMove( const MouseEvent& rMEvt ) nMouseStatus = SC_GM_NONE; if ( pFilterBox->GetMode() == SC_FILTERBOX_FILTER ) { - HideCursor(); - aComboButton.Draw( FALSE ); - ShowCursor(); + if (mpFilterButton.get()) + { + mpFilterButton->setHasHiddenMember(false); + mpFilterButton->setPopupPressed(false); + HideCursor(); + mpFilterButton->draw(); + ShowCursor(); + } } ReleaseMouse(); pFilterBox->MouseButtonDown( MouseEvent( aRelPos, 1, MOUSE_SIMPLECLICK, MOUSE_LEFT ) ); diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx index 8db035d6df55..40bb30f7c0e7 100644 --- a/sc/source/ui/view/gridwin2.cxx +++ b/sc/source/ui/view/gridwin2.cxx @@ -134,8 +134,8 @@ bool ScGridWindow::DoAutoFilterButton( SCCOL nCol, SCROW nRow, const MouseEvent& { ScDocument* pDoc = pViewData->GetDocument(); SCTAB nTab = pViewData->GetTabNo(); - Point aScrPos = pViewData->GetScrPos(nCol, nRow, eWhich); - Point aDiffPix = rMEvt.GetPosPixel(); + Point aScrPos = pViewData->GetScrPos(nCol, nRow, eWhich); + Point aDiffPix = rMEvt.GetPosPixel(); aDiffPix -= aScrPos; BOOL bLayoutRTL = pDoc->IsLayoutRTL( nTab ); @@ -144,25 +144,29 @@ bool ScGridWindow::DoAutoFilterButton( SCCOL nCol, SCROW nRow, const MouseEvent& long nSizeX, nSizeY; pViewData->GetMergeSizePixel( nCol, nRow, nSizeX, nSizeY ); + Size aScrSize(nSizeX-1, nSizeY-1); - // Breite des Buttons ist nicht von der Zellhoehe abhaengig - Size aButSize = aComboButton.GetSizePixel(); - long nButWidth = Min( aButSize.Width(), nSizeX ); - long nButHeight = Min( aButSize.Height(), nSizeY ); - - if ( aDiffPix.X() >= nSizeX - nButWidth && - aDiffPix.Y() >= nSizeY - nButHeight ) + // Check if the mouse cursor is clicking on the popup arrow box. + mpFilterButton.reset(new ScDPFieldButton(this, &GetSettings().GetStyleSettings())); + mpFilterButton->setBoundingBox(aScrPos, aScrSize); + Point aPopupPos; + Size aPopupSize; + mpFilterButton->getPopupBoundingBox(aPopupPos, aPopupSize); + Rectangle aRec(aPopupPos, aPopupSize); + if (aRec.IsInside(rMEvt.GetPosPixel())) { if ( DoPageFieldSelection( nCol, nRow ) ) return true; - BOOL bFilterActive = IsAutoFilterActive( nCol, nRow, - pViewData->GetTabNo() ); - - aComboButton.SetOptSizePixel(); - DrawComboButton( aScrPos, nSizeX, nSizeY, bFilterActive, TRUE ); + bool bFilterActive = IsAutoFilterActive(nCol, nRow, nTab); + mpFilterButton->setHasHiddenMember(bFilterActive); + mpFilterButton->setDrawBaseButton(false); + mpFilterButton->setDrawPopupButton(true); + mpFilterButton->setPopupPressed(true); + HideCursor(); + mpFilterButton->draw(); + ShowCursor(); DoAutoFilterMenue(nCol, nRow, false); - return true; } @@ -810,14 +814,14 @@ void ScGridWindow::DPTestMouse( const MouseEvent& rMEvt, BOOL bMove ) bool ScGridWindow::DPTestFieldPopupArrow(const MouseEvent& rMEvt, const ScAddress& rPos, ScDPObject* pDPObj) { // Get the geometry of the cell. - Point aSrcPos = pViewData->GetScrPos(rPos.Col(), rPos.Row(), eWhich); + Point aScrPos = pViewData->GetScrPos(rPos.Col(), rPos.Row(), eWhich); long nSizeX, nSizeY; pViewData->GetMergeSizePixel(rPos.Col(), rPos.Row(), nSizeX, nSizeY); - Size aSrcSize(nSizeX-1, nSizeY-1); + Size aScrSize(nSizeX-1, nSizeY-1); // Check if the mouse cursor is clicking on the popup arrow box. ScDPFieldButton aBtn(this, &GetSettings().GetStyleSettings()); - aBtn.setBoundingBox(aSrcPos, aSrcSize); + aBtn.setBoundingBox(aScrPos, aScrSize); Point aPopupPos; Size aPopupSize; aBtn.getPopupBoundingBox(aPopupPos, aPopupSize); @@ -825,7 +829,7 @@ bool ScGridWindow::DPTestFieldPopupArrow(const MouseEvent& rMEvt, const ScAddres if (aRec.IsInside(rMEvt.GetPosPixel())) { // Mouse cursor inside the popup arrow box. Launch the field menu. - DPLaunchFieldPopupMenu(OutputToScreenPixel(aSrcPos), aSrcSize, rPos, pDPObj); + DPLaunchFieldPopupMenu(OutputToScreenPixel(aScrPos), aScrSize, rPos, pDPObj); return true; } diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 12e93f977945..7c20b7ca35a4 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -1293,6 +1293,7 @@ void ScGridWindow::DrawButtons( SCCOL nX1, SCROW /*nY1*/, SCCOL nX2, SCROW /*nY2 aCellBtn.setBoundingBox(aScrPos, Size(nSizeX-1, nSizeY-1)); aCellBtn.setDrawBaseButton(false); aCellBtn.setDrawPopupButton(true); + aCellBtn.setHasHiddenMember(bArrowState); aCellBtn.draw(); } } -- cgit v1.2.3 From 73cabf9a263d8ca4e8ef9a84ae9cd04d1df1aaab Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Sat, 1 Aug 2009 03:09:27 +0000 Subject: dismiss the popup window when the sheet is scrolled etc. --- sc/source/ui/view/gridwin.cxx | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 8522ab27739b..f12a8c9f8a57 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -452,14 +452,26 @@ void __EXPORT ScGridWindow::Resize( const Size& ) void ScGridWindow::ClickExtern() { - // #i81298# don't delete the filter box when called from its select handler - // (possible through row header size update) - // #i84277# when initializing the filter box, a Basic error can deactivate the view - if ( pFilterBox && ( pFilterBox->IsInSelect() || pFilterBox->IsInInit() ) ) - return; + do + { + // #i81298# don't delete the filter box when called from its select handler + // (possible through row header size update) + // #i84277# when initializing the filter box, a Basic error can deactivate the view + if ( pFilterBox && ( pFilterBox->IsInSelect() || pFilterBox->IsInInit() ) ) + { + break; + } - DELETEZ(pFilterBox); - DELETEZ(pFilterFloat); + DELETEZ(pFilterBox); + DELETEZ(pFilterFloat); + } + while (false); + + if (mpDPFieldPopup.get()) + { + mpDPFieldPopup->close(false); + mpDPFieldPopup.reset(); + } } IMPL_LINK( ScGridWindow, PopupModeEndHdl, FloatingWindow*, EMPTYARG ) -- cgit v1.2.3 From a1f35730b44c135dbb0883e2df1ee1a817a815a2 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Mon, 3 Aug 2009 19:44:11 +0000 Subject: Fixed text zooming issue where the text was not scaling properly per current zoom level. --- sc/source/ui/cctrl/dpcontrol.cxx | 20 ++++++++++++++++---- sc/source/ui/inc/dpcontrol.hxx | 5 ++++- sc/source/ui/view/gridwin2.cxx | 2 +- sc/source/ui/view/gridwin4.cxx | 2 +- 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index 2239a4c96a2c..ca90e6624caa 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -48,8 +48,9 @@ using ::rtl::OUString; using ::rtl::OUStringHash; using ::std::vector; using ::std::hash_map; +using ::std::auto_ptr; -ScDPFieldButton::ScDPFieldButton(OutputDevice* pOutDev, const StyleSettings* pStyle) : +ScDPFieldButton::ScDPFieldButton(OutputDevice* pOutDev, const StyleSettings* pStyle, const Fraction* pZoomX, const Fraction* pZoomY) : mpOutDev(pOutDev), mpStyle(pStyle), mbBaseButton(true), @@ -57,6 +58,15 @@ ScDPFieldButton::ScDPFieldButton(OutputDevice* pOutDev, const StyleSettings* pSt mbHasHiddenMember(false), mbPopupPressed(false) { + if (pZoomX) + maZoomX = *pZoomX; + else + maZoomX = Fraction(1, 1); + + if (pZoomY) + maZoomY = *pZoomY; + else + maZoomY = Fraction(1, 1); } ScDPFieldButton::~ScDPFieldButton() @@ -119,13 +129,15 @@ void ScDPFieldButton::draw() mpOutDev->DrawLine(Point(maPos.X()+maSize.Width()-1, maPos.Y()), Point(maPos.X()+maSize.Width()-1, maPos.Y()+maSize.Height()-1)); - // Field name + // Field name. Font aTextFont( mpStyle->GetLabelFont() ); - aTextFont.SetHeight(12); + double fFontHeight = 12.0; + fFontHeight *= static_cast(maZoomY.GetNumerator()) / static_cast(maZoomY.GetDenominator()); + aTextFont.SetHeight(fFontHeight); mpOutDev->SetFont(aTextFont); Point aTextPos = maPos; - long nTHeight = mpOutDev->GetTextHeight(); + long nTHeight = static_cast(fFontHeight); aTextPos.setX(maPos.getX() + nMargin); aTextPos.setY(maPos.getY() + (maSize.Height()-nTHeight)/2); mpOutDev->DrawText(aTextPos, maText); diff --git a/sc/source/ui/inc/dpcontrol.hxx b/sc/source/ui/inc/dpcontrol.hxx index 367dfe059600..74223e329f32 100644 --- a/sc/source/ui/inc/dpcontrol.hxx +++ b/sc/source/ui/inc/dpcontrol.hxx @@ -33,6 +33,7 @@ #include "rtl/ustring.hxx" #include "tools/gen.hxx" +#include "tools/fract.hxx" #include "vcl/floatwin.hxx" #include "vcl/button.hxx" #include "vcl/scrbar.hxx" @@ -56,7 +57,7 @@ class Window; class ScDPFieldButton { public: - ScDPFieldButton(OutputDevice* pOutDev, const StyleSettings* pStyle); + ScDPFieldButton(OutputDevice* pOutDev, const StyleSettings* pStyle, const Fraction* pZoomX = NULL, const Fraction* pZoomY = NULL); ~ScDPFieldButton(); void setText(const ::rtl::OUString& rText); @@ -77,6 +78,8 @@ private: Point maPos; Size maSize; ::rtl::OUString maText; + Fraction maZoomX; + Fraction maZoomY; OutputDevice* mpOutDev; const StyleSettings* mpStyle; bool mbBaseButton; diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx index 40bb30f7c0e7..11d1458359c7 100644 --- a/sc/source/ui/view/gridwin2.cxx +++ b/sc/source/ui/view/gridwin2.cxx @@ -147,7 +147,7 @@ bool ScGridWindow::DoAutoFilterButton( SCCOL nCol, SCROW nRow, const MouseEvent& Size aScrSize(nSizeX-1, nSizeY-1); // Check if the mouse cursor is clicking on the popup arrow box. - mpFilterButton.reset(new ScDPFieldButton(this, &GetSettings().GetStyleSettings())); + mpFilterButton.reset(new ScDPFieldButton(this, &GetSettings().GetStyleSettings(), &pViewData->GetZoomX(), &pViewData->GetZoomY())); mpFilterButton->setBoundingBox(aScrPos, aScrSize); Point aPopupPos; Size aPopupSize; diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 7c20b7ca35a4..594f97b473f8 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -1204,7 +1204,7 @@ void ScGridWindow::DrawButtons( SCCOL nX1, SCROW /*nY1*/, SCCOL nX2, SCROW /*nY2 { aComboButton.SetOutputDevice( pContentDev ); - ScDPFieldButton aCellBtn(pContentDev, &GetSettings().GetStyleSettings()); + ScDPFieldButton aCellBtn(pContentDev, &GetSettings().GetStyleSettings(), &pViewData->GetZoomX(), &pViewData->GetZoomY()); SCCOL nCol; SCROW nRow; -- cgit v1.2.3 From 78b7cf3e05df965564fdebac18c4f80acd594119 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Mon, 3 Aug 2009 19:56:25 +0000 Subject: Fixed naming inconsistency: Src -> Scr --- sc/source/ui/inc/gridwin.hxx | 2 +- sc/source/ui/view/gridwin.cxx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx index 4408c5f9b602..c5b08861333e 100644 --- a/sc/source/ui/inc/gridwin.hxx +++ b/sc/source/ui/inc/gridwin.hxx @@ -259,7 +259,7 @@ private: */ bool DPTestFieldPopupArrow(const MouseEvent& rMEvt, const ScAddress& rPos, ScDPObject* pDPObj); void DPLaunchFieldPopupMenu( - const Point& rSrcPos, const Size& rSrcSize, const ScAddress& rPos, ScDPObject* pDPObj); + const Point& rScrPos, const Size& rScrSize, const ScAddress& rPos, ScDPObject* pDPObj); void RFMouseMove( const MouseEvent& rMEvt, BOOL bUp ); diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index f12a8c9f8a57..9fbcfbb4fdb0 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -685,12 +685,12 @@ void ScGridWindow::LaunchDPFieldMenu( SCCOL nCol, SCROW nRow ) return; // Get the geometry of the cell. - Point aSrcPos = pViewData->GetScrPos(nCol, nRow, eWhich); + Point aScrPos = pViewData->GetScrPos(nCol, nRow, eWhich); long nSizeX, nSizeY; pViewData->GetMergeSizePixel(nCol, nRow, nSizeX, nSizeY); - Size aSrcSize(nSizeX-1, nSizeY-1); + Size aScrSize(nSizeX-1, nSizeY-1); - DPLaunchFieldPopupMenu(OutputToScreenPixel(aSrcPos), aSrcSize, ScAddress(nCol, nRow, nTab), pDPObj); + DPLaunchFieldPopupMenu(OutputToScreenPixel(aScrPos), aScrSize, ScAddress(nCol, nRow, nTab), pDPObj); } void ScGridWindow::DoScenarioMenue( const ScRange& rScenRange ) -- cgit v1.2.3 From 8802d45ff2523326cef7bf62cee92cd3809ada86 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Mon, 3 Aug 2009 20:27:28 +0000 Subject: Launch the popup window right-aligned with the cell if the cell is wider than the width of the popup. --- sc/source/ui/cctrl/dpcontrol.cxx | 22 +++++++++++++--------- sc/source/ui/inc/dpcontrol.hxx | 3 +++ sc/source/ui/view/gridwin2.cxx | 12 ++++++++++-- 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index ca90e6624caa..0060a9341ec3 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -786,6 +786,7 @@ ScDPFieldPopupWindow::ScDPFieldPopupWindow(Window* pParent) : maBtnCancel(this), mpExtendedData(NULL), mpOKAction(NULL), + maWndSize(160, 330), mePrevToggleAllState(STATE_DONTKNOW) { const StyleSettings& rStyle = GetSettings().GetStyleSettings(); @@ -855,11 +856,9 @@ void ScDPFieldPopupWindow::getSectionPosSize(Point& rPos, Size& rSize, SectionTy const sal_uInt16 nBottomMargin = 10; const sal_uInt16 nMenuListMargin = 20; - Size aWndSize = Size(160, 330); - // parameters calculated from constants. - const sal_uInt16 nListBoxWidth = aWndSize.Width() - nListBoxMargin*2; - const sal_uInt16 nListBoxHeight = aWndSize.Height() - nTopMargin - nMenuHeight - + const sal_uInt16 nListBoxWidth = maWndSize.Width() - nListBoxMargin*2; + const sal_uInt16 nListBoxHeight = maWndSize.Height() - nTopMargin - nMenuHeight - nMenuListMargin - nSingleItemBtnAreaHeight - nBottomBtnAreaHeight; const sal_uInt16 nSingleBtnAreaY = nTopMargin + nMenuHeight + nListBoxHeight + nMenuListMargin - 1; @@ -869,7 +868,7 @@ void ScDPFieldPopupWindow::getSectionPosSize(Point& rPos, Size& rSize, SectionTy case WHOLE: { rPos = Point(0, 0); - rSize = aWndSize; + rSize = maWndSize; } break; case LISTBOX_AREA_OUTER: @@ -924,16 +923,16 @@ void ScDPFieldPopupWindow::getSectionPosSize(Point& rPos, Size& rSize, SectionTy break; case BTN_OK: { - long x = (aWndSize.Width() - nBtnWidth*2)/3; - long y = aWndSize.Height() - nBottomMargin - nBtnHeight; + long x = (maWndSize.Width() - nBtnWidth*2)/3; + long y = maWndSize.Height() - nBottomMargin - nBtnHeight; rPos = Point(x, y); rSize = Size(nBtnWidth, nBtnHeight); } break; case BTN_CANCEL: { - long x = (aWndSize.Width() - nBtnWidth*2)/3*2 + nBtnWidth; - long y = aWndSize.Height() - nBottomMargin - nBtnHeight; + long x = (maWndSize.Width() - nBtnWidth*2)/3*2 + nBtnWidth; + long y = maWndSize.Height() - nBottomMargin - nBtnHeight; rPos = Point(x, y); rSize = Size(nBtnWidth, nBtnHeight); } @@ -1091,6 +1090,11 @@ void ScDPFieldPopupWindow::initMembers() } } +const Size& ScDPFieldPopupWindow::getWindowSize() const +{ + return maWndSize; +} + void ScDPFieldPopupWindow::getResult(hash_map& rResult) { typedef hash_map ResultMap; diff --git a/sc/source/ui/inc/dpcontrol.hxx b/sc/source/ui/inc/dpcontrol.hxx index 74223e329f32..0074add2be25 100644 --- a/sc/source/ui/inc/dpcontrol.hxx +++ b/sc/source/ui/inc/dpcontrol.hxx @@ -212,6 +212,8 @@ public: void addMember(const ::rtl::OUString& rName, bool bVisible); void initMembers(); + const Size& getWindowSize() const; + void getResult(::std::hash_map< ::rtl::OUString, bool, ::rtl::OUStringHash>& rResult); void close(bool bOK); @@ -283,6 +285,7 @@ private: ::std::auto_ptr mpExtendedData; ::std::auto_ptr mpOKAction; + const Size maWndSize; /// hard-coded window size. TriState mePrevToggleAllState; }; diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx index 11d1458359c7..8bafb474bff3 100644 --- a/sc/source/ui/view/gridwin2.cxx +++ b/sc/source/ui/view/gridwin2.cxx @@ -895,7 +895,7 @@ private: } void ScGridWindow::DPLaunchFieldPopupMenu( - const Point& rSrcPos, const Size& rSrcSize, const ScAddress& rPos, ScDPObject* pDPObj) + const Point& rScrPos, const Size& rScrSize, const ScAddress& rPos, ScDPObject* pDPObj) { // We need to get the list of field members. auto_ptr pDPData(new DPFieldPopupData); @@ -957,8 +957,16 @@ void ScGridWindow::DPLaunchFieldPopupMenu( } } + Rectangle aCellRect(rScrPos, rScrSize); + const Size& rPopupSize = mpDPFieldPopup->getWindowSize(); + if (rScrSize.getWidth() > rPopupSize.getWidth()) + { + // If the cell width is larger than the popup window width, launch it + // right-aligned with the cell. + long nXOffset = rScrSize.getWidth() - rPopupSize.getWidth(); + aCellRect.SetPos(Point(rScrPos.X() + nXOffset, rScrPos.Y())); + } mpDPFieldPopup->SetPopupModeEndHdl( LINK(this, ScGridWindow, PopupModeEndHdl) ); - Rectangle aCellRect(rSrcPos, rSrcSize); mpDPFieldPopup->StartPopupMode(aCellRect, (FLOATWIN_POPUPMODE_DOWN | FLOATWIN_POPUPMODE_GRABFOCUS)); } -- cgit v1.2.3 From 00937e3a0c28ae5461de8ca3cfbdf93cf06f1cbc Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Tue, 4 Aug 2009 17:57:44 +0000 Subject: A little better image set for the single-action buttons, based on the corresponding screenshot in IBM's spec. --- default_images/sc/res/popup_select_current.png | Bin 734 -> 373 bytes default_images/sc/res/popup_unselect_current.png | Bin 730 -> 324 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/default_images/sc/res/popup_select_current.png b/default_images/sc/res/popup_select_current.png index cc222c152a6d..18f981535e61 100644 Binary files a/default_images/sc/res/popup_select_current.png and b/default_images/sc/res/popup_select_current.png differ diff --git a/default_images/sc/res/popup_unselect_current.png b/default_images/sc/res/popup_unselect_current.png index f407148a48c7..fe49d83d8f84 100644 Binary files a/default_images/sc/res/popup_unselect_current.png and b/default_images/sc/res/popup_unselect_current.png differ -- cgit v1.2.3 From b3b4d3b4b58c7346bf7bc22d415960c7eaab1d6b Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 20 Aug 2009 04:25:53 +0000 Subject: A little hack to get border floating window to be recognized by accessibility framework. I'll come back to clean this up later. --- vcl/unx/gtk/a11y/atkwindow.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/vcl/unx/gtk/a11y/atkwindow.cxx b/vcl/unx/gtk/a11y/atkwindow.cxx index 5961556e85d7..4d1fa6c016e6 100644 --- a/vcl/unx/gtk/a11y/atkwindow.cxx +++ b/vcl/unx/gtk/a11y/atkwindow.cxx @@ -108,6 +108,13 @@ init_from_window( AtkObject *accessible, Window *pWindow ) pChild->SetAccessibleRole( AccessibleRole::LABEL ); accessible->name = g_strdup( rtl::OUStringToOString( pChild->GetText(), RTL_TEXTENCODING_UTF8 ).getStr() ); } + else if (WINDOW_FLOATINGWINDOW == pChild->GetType()) + { + // TODO: This is a hack. Figure out a way to do this a little cleaner. + role = ATK_ROLE_WINDOW; + pChild->SetAccessibleRole( AccessibleRole::WINDOW ); + accessible->name = g_strdup( rtl::OUStringToOString( pChild->GetText(), RTL_TEXTENCODING_UTF8 ).getStr() ); + } } break; } -- cgit v1.2.3 From 9c22409f2648758e69a9de4ae49c2ba9bab24a3b Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 20 Aug 2009 04:28:30 +0000 Subject: My first cut on implementing accessibility for the new datapilot field popup window. This is still work-in-progress, with lots of debug statements everywhere. --- sc/inc/AccessibleFilterMenu.hxx | 191 ++++++++ sc/inc/AccessibleFilterMenuItem.hxx | 111 +++++ sc/inc/AccessibleFilterTopWindow.hxx | 80 ++++ .../ui/Accessibility/AccessibleContextBase.cxx | 5 + .../ui/Accessibility/AccessibleFilterMenu.cxx | 532 +++++++++++++++++++++ .../ui/Accessibility/AccessibleFilterMenuItem.cxx | 309 ++++++++++++ .../ui/Accessibility/AccessibleFilterTopWindow.cxx | 98 ++++ sc/source/ui/Accessibility/makefile.mk | 6 + sc/source/ui/cctrl/dpcontrol.cxx | 229 ++++++++- sc/source/ui/inc/AccessibleContextBase.hxx | 2 + sc/source/ui/inc/dpcontrol.hxx | 49 +- sc/source/ui/view/gridwin2.cxx | 3 +- 12 files changed, 1591 insertions(+), 24 deletions(-) create mode 100644 sc/inc/AccessibleFilterMenu.hxx create mode 100644 sc/inc/AccessibleFilterMenuItem.hxx create mode 100644 sc/inc/AccessibleFilterTopWindow.hxx create mode 100644 sc/source/ui/Accessibility/AccessibleFilterMenu.cxx create mode 100644 sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx create mode 100644 sc/source/ui/Accessibility/AccessibleFilterTopWindow.cxx diff --git a/sc/inc/AccessibleFilterMenu.hxx b/sc/inc/AccessibleFilterMenu.hxx new file mode 100644 index 000000000000..1489f3bbdca1 --- /dev/null +++ b/sc/inc/AccessibleFilterMenu.hxx @@ -0,0 +1,191 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: AccessibleDataPilotControl.hxx,v $ + * $Revision: 1.6 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_ACCESSIBLEFILTERMENU_HXX +#define SC_ACCESSIBLEFILTERMENU_HXX + +#include "AccessibleContextBase.hxx" +#include "cppuhelper/implbase2.hxx" + +#include +#include +#include +#include +#include + +#include +#include + +namespace com { namespace sun { namespace star { + namespace accessibility { + struct AccessibleEventObject; + } +}}} + +class ScDocument; +class ScMenuFloatingWindow; + +typedef ::cppu::ImplHelper2< + ::com::sun::star::accessibility::XAccessibleStateSet, + ::com::sun::star::accessibility::XAccessibleSelection > ScAccessibleFilterMenu_BASE; + +class ScAccessibleFilterMenu : + public ScAccessibleContextBase, + public ScAccessibleFilterMenu_BASE +{ +public: + struct MenuItem + { + ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible > mxAccessible; + bool mbSelected; + + MenuItem(); + }; + + ScAccessibleFilterMenu( + const ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible>& rxParent, + ScMenuFloatingWindow* pWin, const ::rtl::OUString& rName, ScDocument* pDoc); + virtual ~ScAccessibleFilterMenu(); + + // XAccessibleComponent + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > + SAL_CALL getAccessibleAtPoint( const ::com::sun::star::awt::Point& rPoint ) + throw (::com::sun::star::uno::RuntimeException); + + virtual sal_Bool SAL_CALL isVisible() + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL grabFocus() + throw (::com::sun::star::uno::RuntimeException); + + virtual sal_Int32 SAL_CALL getForeground() + throw (::com::sun::star::uno::RuntimeException); + + virtual sal_Int32 SAL_CALL getBackground() + throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleContext + + virtual ::rtl::OUString SAL_CALL getAccessibleName() + throw (::com::sun::star::uno::RuntimeException); + + virtual sal_Int32 SAL_CALL getAccessibleChildCount() + throw (::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL + getAccessibleChild(sal_Int32 nIndex) + throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IndexOutOfBoundsException); + + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL + getAccessibleStateSet() + throw (::com::sun::star::uno::RuntimeException); + + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleEventBroadcaster + + virtual void SAL_CALL + addEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleEventListener>& xListener) + throw (com::sun::star::uno::RuntimeException); + + // Remove an existing event listener. + virtual void SAL_CALL + removeEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleEventListener>& xListener) + throw (com::sun::star::uno::RuntimeException); + + // XAccessibleStateSet + + virtual ::sal_Bool SAL_CALL isEmpty() throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL contains(sal_Int16 nState) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL containsAll(const ::com::sun::star::uno::Sequence< ::sal_Int16 >& aStateSet) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence SAL_CALL getStates() throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleSelection + + virtual void SAL_CALL selectAccessibleChild( ::sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL isAccessibleChildSelected( ::sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL clearAccessibleSelection( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL selectAllAccessibleChildren( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL + getSelectedAccessibleChild(sal_Int32 nChildIndex) + throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL deselectAccessibleChild( ::sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + + // XInterface + + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( + ::com::sun::star::uno::Type const & rType ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL acquire() throw (); + virtual void SAL_CALL release() throw (); + + // XTypeProvider + + virtual ::com::sun::star::uno::Sequence SAL_CALL getImplementationId() + throw (::com::sun::star::uno::RuntimeException); + + // non-UNO methods + + void selectMenuItem(size_t nIndex, bool bSelect); + void appendMenuItem(const ::rtl::OUString& rName, bool bEnabled, size_t nMenuPos); + + void setEnabled(bool bEnabled); + +private: + bool isFocused(); + bool isSelected(); + + void updateStates(); + +private: + ::std::vector maMenuItems; + ::std::set maStates; + + ScMenuFloatingWindow* mpWindow; + ScDocument* mpDoc; + + bool mbEnabled:1; + bool mbSelected:1; +}; + +#endif diff --git a/sc/inc/AccessibleFilterMenuItem.hxx b/sc/inc/AccessibleFilterMenuItem.hxx new file mode 100644 index 000000000000..740cfd4e30c9 --- /dev/null +++ b/sc/inc/AccessibleFilterMenuItem.hxx @@ -0,0 +1,111 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: AccessibleDataPilotControl.hxx,v $ + * $Revision: 1.6 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_ACCESSIBLEFILTERMENUITEM_HXX +#define SC_ACCESSIBLEFILTERMENUITEM_HXX + +#include "AccessibleContextBase.hxx" +#include "cppuhelper/implbase2.hxx" + +#include +#include + +class ScMenuFloatingWindow; + +typedef ::cppu::ImplHelper2< + ::com::sun::star::accessibility::XAccessibleAction, + ::com::sun::star::accessibility::XAccessibleStateSet > ScAccessibleFilterMenuItem_BASE; + +class ScAccessibleFilterMenuItem : + public ScAccessibleContextBase, + public ScAccessibleFilterMenuItem_BASE +{ +public: + explicit ScAccessibleFilterMenuItem( + const ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible>& rxParent, ScMenuFloatingWindow* pWin, const ::rtl::OUString& rName, size_t nMenuPos); + + virtual ~ScAccessibleFilterMenuItem(); + + // XAccessibleContext + + virtual sal_Int32 SAL_CALL getAccessibleChildCount() + throw (::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL + getAccessibleChild(sal_Int32 nIndex) + throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IndexOutOfBoundsException); + + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleStateSet> SAL_CALL + getAccessibleStateSet() + throw (::com::sun::star::uno::RuntimeException); + + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleStateSet + + virtual ::sal_Bool SAL_CALL isEmpty() throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL contains(sal_Int16 nState) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL containsAll(const ::com::sun::star::uno::Sequence< ::sal_Int16 >& aStateSet) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence SAL_CALL getStates() throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleAction + + virtual ::sal_Int32 SAL_CALL getAccessibleActionCount( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL doAccessibleAction( ::sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getAccessibleActionDescription( ::sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding( ::sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( + ::com::sun::star::uno::Type const & rType ) + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL acquire() throw (); + virtual void SAL_CALL release() throw (); + + // Non-UNO Methods + + void select(); + void unselect(); + bool isSelected() const; + + void setEnabled(bool bEnabled); + +private: + ScMenuFloatingWindow* mpWindow; + ::rtl::OUString maName; + size_t mnMenuPos; + bool mbSelected:1; + bool mbEnabled:1; +}; + +#endif diff --git a/sc/inc/AccessibleFilterTopWindow.hxx b/sc/inc/AccessibleFilterTopWindow.hxx new file mode 100644 index 000000000000..7b7ad0c880f0 --- /dev/null +++ b/sc/inc/AccessibleFilterTopWindow.hxx @@ -0,0 +1,80 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: AccessibleDataPilotControl.hxx,v $ + * $Revision: 1.6 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_ACCESSIBLEFILTERTOPWINDOW_HXX +#define SC_ACCESSIBLEFILTERTOPWINDOW_HXX + +#include "AccessibleContextBase.hxx" +#include "cppuhelper/implbase1.hxx" + +class ScDPFieldPopupWindow; +class ScDocument; + +class ScAccessibleFilterTopWindow : public ScAccessibleContextBase +{ +public: + ScAccessibleFilterTopWindow( + const ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible>& rxParent, + ScDPFieldPopupWindow* pWin, const ::rtl::OUString& rName, ScDocument* pDoc); + virtual ~ScAccessibleFilterTopWindow(); + + // XAccessibleContext + + virtual sal_Int32 SAL_CALL getAccessibleChildCount() + throw (::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL + getAccessibleChild(sal_Int32 nIndex) + throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IndexOutOfBoundsException); + + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw (::com::sun::star::uno::RuntimeException); + + // Non-UNO Methods + + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > + getAccessibleChildMenu(); + + void setAccessibleChildListBox( + const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rAccessible); + +private: + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > + mxAccessibleMenu; + + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > + mxAccessibleListBox; + + ScDPFieldPopupWindow* mpWindow; + ScDocument* mpDoc; +}; + +#endif diff --git a/sc/source/ui/Accessibility/AccessibleContextBase.cxx b/sc/source/ui/Accessibility/AccessibleContextBase.cxx index 8774ef74f86d..16d80402abac 100644 --- a/sc/source/ui/Accessibility/AccessibleContextBase.cxx +++ b/sc/source/ui/Accessibility/AccessibleContextBase.cxx @@ -628,3 +628,8 @@ void ScAccessibleContextBase::IsObjectValid() const if (rBHelper.bDisposed || rBHelper.bInDispose) throw lang::DisposedException(); } + +void ScAccessibleContextBase::SetRole(sal_Int16 nRole) +{ + maRole = nRole; +} diff --git a/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx b/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx new file mode 100644 index 000000000000..2ab7722807da --- /dev/null +++ b/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx @@ -0,0 +1,532 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: AccessibleDataPilotControl.hxx,v $ + * $Revision: 1.6 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove + +#include "precompiled_sc.hxx" +#include "AccessibleFilterMenu.hxx" +#include "AccessibleFilterMenuItem.hxx" +#include "unoguard.hxx" +#include "global.hxx" +#include "document.hxx" +#include "docpool.hxx" + +#include "tools/gen.hxx" +#include "svx/unoedsrc.hxx" +#include "svx/editdata.hxx" +#include "svx/outliner.hxx" +#include "svtools/itemset.hxx" +#include "vcl/unohelp.hxx" +#include "dpcontrol.hxx" + +#include + +#include +#include +#include +#include +#include + +using namespace ::com::sun::star; +using namespace ::com::sun::star::accessibility; +using namespace ::com::sun::star::accessibility::AccessibleStateType; + +using ::com::sun::star::uno::Any; +using ::com::sun::star::uno::Reference; +using ::com::sun::star::uno::Sequence; +using ::com::sun::star::uno::UNO_QUERY; +using ::com::sun::star::lang::IndexOutOfBoundsException; +using ::com::sun::star::lang::IllegalArgumentException; +using ::com::sun::star::uno::RuntimeException; +using ::rtl::OUString; +using ::std::for_each; +using ::std::vector; +using ::std::set; + +#include +#include +#include + +namespace { + +class StackPrinter +{ +public: + explicit StackPrinter(const char* msg) : + msMsg(msg) + { + fprintf(stdout, "%s: --begin\n", msMsg.c_str()); + mfStartTime = getTime(); + } + + ~StackPrinter() + { + double fEndTime = getTime(); + fprintf(stdout, "%s: --end (duration: %g sec)\n", msMsg.c_str(), (fEndTime-mfStartTime)); + } + + void printTime(int line) const + { + double fEndTime = getTime(); + fprintf(stdout, "%s: --(%d) (duration: %g sec)\n", msMsg.c_str(), line, (fEndTime-mfStartTime)); + } + +private: + double getTime() const + { + timeval tv; + gettimeofday(&tv, NULL); + return tv.tv_sec + tv.tv_usec / 1000000.0; + } + + ::std::string msMsg; + double mfStartTime; +}; + +} + +// ============================================================================ + +namespace { + +class SelectMenuItem : public ::std::unary_function +{ +public: + explicit SelectMenuItem(bool bSelect) : mbSelect(bSelect) {} + + void operator() (ScAccessibleFilterMenu::MenuItem& rItem) const + { + rItem.mbSelected = mbSelect; + ScAccessibleFilterMenuItem* p = static_cast(rItem.mxAccessible.get()); + if (mbSelect) + p->select(); + else + p->unselect(); + } +private: + bool mbSelect; +}; + +class AddRemoveEventListener : public ::std::unary_function +{ +public: + explicit AddRemoveEventListener(const Reference& rListener, bool bAdd) : + mxListener(rListener), mbAdd(bAdd) {} + + void operator() (ScAccessibleFilterMenu::MenuItem& rItem) const + { + if (!rItem.mxAccessible.is()) + return; + + Reference xBc(rItem.mxAccessible, UNO_QUERY); + if (xBc.is()) + { + if (mbAdd) + xBc->addEventListener(mxListener); + else + xBc->removeEventListener(mxListener); + } + } +private: + Reference mxListener; + bool mbAdd; +}; + +class CountSelectedMenuItem : public ::std::unary_function +{ +public: + explicit CountSelectedMenuItem() : mnCount(0) {} + + CountSelectedMenuItem(const CountSelectedMenuItem& r) : + mnCount(r.mnCount) {} + + void operator() (ScAccessibleFilterMenu::MenuItem& rItem) + { +// if (rItem.mbSelected) +// ++mnCount; +// + ScAccessibleFilterMenuItem* p = static_cast(rItem.mxAccessible.get()); +// fprintf(stdout, "CountSelectedMenuItem::(): name = '%s' selected = %d\n", +// rtl::OUStringToOString(p->getAccessibleName(), RTL_TEXTENCODING_UTF8).getStr(), p->isSelected()); + if (p->isSelected()) + ++mnCount; + } + + size_t getCount() const { return mnCount; } + +private: + size_t mnCount; +}; + +} + +// ============================================================================ + +ScAccessibleFilterMenu::MenuItem::MenuItem() : + mbSelected(false) +{ +} + +// ============================================================================ + +ScAccessibleFilterMenu::ScAccessibleFilterMenu(const Reference& rxParent, ScMenuFloatingWindow* pWin, const OUString& rName, ScDocument* pDoc) : + ScAccessibleContextBase(rxParent, AccessibleRole::MENU), + mpWindow(pWin), + mpDoc(pDoc), + mbEnabled(true), + mbSelected(false) +{ + fprintf(stdout, "ScAccessibleFilterMenu::ScAccessibleFilterMenu: ctor (%p)\n", this); + SetName(rName); +// SetDescription(OUString::createFromAscii("parent filter menu description")); +} + +ScAccessibleFilterMenu::~ScAccessibleFilterMenu() +{ + fprintf(stdout, "ScAccessibleFilterMenu::~ScAccessibleFilterMenu: dtor (%p)\n", this); +} + +// XAccessibleComponent + +Reference ScAccessibleFilterMenu::getAccessibleAtPoint( const ::com::sun::star::awt::Point& rPoint ) + throw (RuntimeException) +{ + fprintf(stdout, "ScAccessibleFilterMenu::getAccessibleAtPoint: point = (%ld,%ld)\n", rPoint.X, rPoint.Y); + return this; +} + +sal_Bool ScAccessibleFilterMenu::isVisible() throw (RuntimeException) +{ + fprintf(stdout, "ScAccessibleFilterMenu::isVisible: called\n"); + return true; +} + +void ScAccessibleFilterMenu::grabFocus() + throw (RuntimeException) +{ + fprintf(stdout, "ScAccessibleFilterMenu::grabFocus: called\n"); +} + +sal_Int32 ScAccessibleFilterMenu::getForeground() + throw (RuntimeException) +{ + fprintf(stdout, "ScAccessibleFilterMenu::getForeground: called\n"); + return 0; +} + +sal_Int32 ScAccessibleFilterMenu::getBackground() + throw (RuntimeException) +{ + fprintf(stdout, "ScAccessibleFilterMenu::getBackground: called\n"); + return 0; +} + +// XAccessibleContext + +OUString ScAccessibleFilterMenu::getAccessibleName() throw (RuntimeException) +{ + return ScAccessibleContextBase::getAccessibleName(); +} + +sal_Int32 ScAccessibleFilterMenu::getAccessibleChildCount() + throw (RuntimeException) +{ + return maMenuItems.size(); +} + +Reference ScAccessibleFilterMenu::getAccessibleChild(sal_Int32 nIndex) + throw (RuntimeException, IndexOutOfBoundsException) +{ + if (maMenuItems.size() <= nIndex) + throw IndexOutOfBoundsException(); + + return maMenuItems[nIndex].mxAccessible; +} + +Reference ScAccessibleFilterMenu::getAccessibleStateSet() + throw (RuntimeException) +{ + updateStates(); + return this; +} + +OUString ScAccessibleFilterMenu::getImplementationName() + throw (RuntimeException) +{ + return OUString::createFromAscii("ScAccessibleFilterMenu - implementation name"); +} + +// XAccessibleEventBroadcaster + +void ScAccessibleFilterMenu::addEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleEventListener>& xListener) + throw (com::sun::star::uno::RuntimeException) +{ + ScAccessibleContextBase::addEventListener(xListener); + for_each(maMenuItems.begin(), maMenuItems.end(), AddRemoveEventListener(xListener, true)); +} + +void ScAccessibleFilterMenu::removeEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleEventListener>& xListener) + throw (com::sun::star::uno::RuntimeException) +{ + ScAccessibleContextBase::removeEventListener(xListener); + for_each(maMenuItems.begin(), maMenuItems.end(), AddRemoveEventListener(xListener, false)); +} + +// XAccessibleStateSet + +sal_Bool ScAccessibleFilterMenu::isEmpty() throw (RuntimeException) +{ + updateStates(); + return maStates.empty(); +} + +sal_Bool ScAccessibleFilterMenu::contains(sal_Int16 nState) throw (RuntimeException) +{ + updateStates(); + return maStates.count(nState) > 0; +} + +sal_Bool ScAccessibleFilterMenu::containsAll(const Sequence& aStateSet) + throw (RuntimeException) +{ + updateStates(); + sal_Int32 n = aStateSet.getLength(); + for (sal_Int32 i = 0; i < n; ++i) + { + if (!maStates.count(aStateSet[i])) + // This state is not set. + return false; + } + // All specified states are set. + return true; +} + +Sequence ScAccessibleFilterMenu::getStates() throw (RuntimeException) +{ + StackPrinter __stack_printer__("ScAccessibleFilterMenu::getStates"); + updateStates(); + Sequence aSeq(0); + set::const_iterator itr = maStates.begin(), itrEnd = maStates.end(); + for (size_t i = 0; itr != itrEnd; ++itr, ++i) + { + aSeq.realloc(i+1); + aSeq[i] = *itr; + } + if (maStates.count(FOCUSED)) + fprintf(stdout, "ScAccessibleFilterMenu::getStates: focused\n"); + else + fprintf(stdout, "ScAccessibleFilterMenu::getStates: not focused\n"); + return aSeq; +} + +// XAccessibleSelection + +void ScAccessibleFilterMenu::selectAccessibleChild(sal_Int32 nChildIndex) + throw (IndexOutOfBoundsException, RuntimeException) +{ + StackPrinter __stack_printer__("********** ScAccessibleFilterMenu::selectAccessibleChild **********"); + fprintf(stdout, "ScAccessibleFilterMenu::selectAccessibleChild: index = %ld\n", nChildIndex); + if (nChildIndex >= maMenuItems.size()) + throw IndexOutOfBoundsException(); + + maMenuItems[nChildIndex].mbSelected = true; + mpWindow->setSelectedMenuItem(nChildIndex, false, false); +} + +sal_Bool ScAccessibleFilterMenu::isAccessibleChildSelected(sal_Int32 nChildIndex) + throw (IndexOutOfBoundsException, RuntimeException) +{ + fprintf(stdout, "ScAccessibleFilterMenu::isAccessibleChildSelected: index = %ld\n", nChildIndex); + if (nChildIndex >= maMenuItems.size()) + throw IndexOutOfBoundsException(); + + return maMenuItems[nChildIndex].mbSelected; +} + +void ScAccessibleFilterMenu::clearAccessibleSelection() throw (RuntimeException) +{ + fprintf(stdout, "ScAccessibleFilterMenu::clearAccessibleSelection: called\n"); + for_each(maMenuItems.begin(), maMenuItems.end(), SelectMenuItem(false)); + mpWindow->clearSelectedMenuItem(false); +} + +void ScAccessibleFilterMenu::selectAllAccessibleChildren() throw (RuntimeException) +{ + // not suported - this is a menu, you can't select all menu items. + +// fprintf(stdout, "ScAccessibleFilterMenu::selectAllAccessibleChildren: called\n"); +// for_each(maMenuItems.begin(), maMenuItems.end(), SelectMenuItem(true)); +} + +sal_Int32 ScAccessibleFilterMenu::getSelectedAccessibleChildCount() throw (RuntimeException) +{ + sal_Int32 n = for_each(maMenuItems.begin(), maMenuItems.end(), CountSelectedMenuItem()).getCount(); + fprintf(stdout, "ScAccessibleFilterMenu::getSelectedAccessibleChildCount: count = %ld\n", n); + return n; +} + +Reference ScAccessibleFilterMenu::getSelectedAccessibleChild(sal_Int32 nChildIndex) + throw (IndexOutOfBoundsException, RuntimeException) +{ + fprintf(stdout, "ScAccessibleFilterMenu::getSelectedAccessibleChild: index = %ld\n", nChildIndex); + if (static_cast(nChildIndex) >= maMenuItems.size()) + throw IndexOutOfBoundsException(); + + return maMenuItems[nChildIndex].mxAccessible; +} + +void ScAccessibleFilterMenu::deselectAccessibleChild(sal_Int32 nChildIndex) throw (IndexOutOfBoundsException, RuntimeException) +{ + fprintf(stdout, "ScAccessibleFilterMenu::deselectAccessibleChild: index = %ld\n", nChildIndex); + if (static_cast(nChildIndex) >= maMenuItems.size()) + throw IndexOutOfBoundsException(); + + maMenuItems[nChildIndex].mbSelected = false; + ScAccessibleFilterMenuItem* p = static_cast( + maMenuItems[nChildIndex].mxAccessible.get()); + p->unselect(); + + mpWindow->selectMenuItem(nChildIndex, false, false, false); +} + +// XInterface + +uno::Any SAL_CALL ScAccessibleFilterMenu::queryInterface( uno::Type const & rType ) + throw (RuntimeException) +{ + Any any = ScAccessibleContextBase::queryInterface(rType); + if (any.hasValue()) + return any; + + return ScAccessibleFilterMenu_BASE::queryInterface(rType); +} + +void SAL_CALL ScAccessibleFilterMenu::acquire() throw () +{ + ScAccessibleContextBase::acquire(); +} + +void SAL_CALL ScAccessibleFilterMenu::release() throw () +{ + ScAccessibleContextBase::release(); +} + +// XTypeProvider + +Sequence ScAccessibleFilterMenu::getImplementationId() + throw (RuntimeException) +{ + Sequence aId(16); + return aId; +} + +void ScAccessibleFilterMenu::selectMenuItem(size_t nIndex, bool bSelect) +{ + StackPrinter __stack_printer__("ScAccessibleFilterMenu::selectMenuItem"); + fprintf(stdout, "ScAccessibleFilterMenu::selectMenuItem: index = %d select = %d\n", nIndex, bSelect); + if (maMenuItems.size() <= nIndex) + return; + + AccessibleEventObject aEvent; + aEvent.EventId = AccessibleEventId::SELECTION_CHANGED; + CommitChange(aEvent); + + maMenuItems[nIndex].mbSelected = bSelect; + ScAccessibleFilterMenuItem* p = static_cast( + maMenuItems[nIndex].mxAccessible.get()); + if (bSelect) + p->select(); + else + p->unselect(); + + isSelected(); +// aEvent.EventId = AccessibleEventId::STATE_CHANGED; +// CommitChange(aEvent); +} + +void ScAccessibleFilterMenu::appendMenuItem(const OUString& rName, bool bEnabled, size_t nMenuPos) +{ + // Check weather this menu item is a sub menu or a regular menu item. + ScMenuFloatingWindow* pSubMenu = mpWindow->getSubMenuWindow(nMenuPos); + MenuItem aItem; + if (pSubMenu) + { + aItem.mxAccessible = pSubMenu->CreateAccessible(); + ScAccessibleFilterMenu* p = static_cast( + aItem.mxAccessible.get()); + p->setEnabled(bEnabled); + } + else + { + aItem.mxAccessible.set(new ScAccessibleFilterMenuItem(this, mpWindow, rName, nMenuPos)); + ScAccessibleFilterMenuItem* p = static_cast( + aItem.mxAccessible.get()); + p->setEnabled(bEnabled); + } + maMenuItems.push_back(aItem); +} + +void ScAccessibleFilterMenu::setEnabled(bool bEnabled) +{ + mbEnabled = bEnabled; +} + +bool ScAccessibleFilterMenu::isFocused() +{ + return true; +// return isSelected(); +} + +bool ScAccessibleFilterMenu::isSelected() +{ + // Check to see if any of the child menu items is selected. + size_t nSelectCount = for_each(maMenuItems.begin(), maMenuItems.end(), CountSelectedMenuItem()).getCount(); +// fprintf(stdout, "ScAccessibleFilterMenu::isSelected: selected count = %d\n", nSelectCount); + return nSelectCount == 0; +} + +void ScAccessibleFilterMenu::updateStates() +{ + maStates.clear(); + maStates.insert(ENABLED); + maStates.insert(FOCUSABLE); + maStates.insert(SELECTABLE); + maStates.insert(SENSITIVE); + maStates.insert(OPAQUE); + + if (isFocused()) + maStates.insert(FOCUSED); + if (isSelected()) + maStates.insert(SELECTED); +} diff --git a/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx b/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx new file mode 100644 index 000000000000..2e151b67b600 --- /dev/null +++ b/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx @@ -0,0 +1,309 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: AccessibleDataPilotControl.hxx,v $ + * $Revision: 1.6 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove + +#include "precompiled_sc.hxx" +#include "AccessibleFilterMenuItem.hxx" +#include "dpcontrol.hxx" + +#include +#include +#include +#include +#include +#include +#include + +#include + +using namespace ::com::sun::star; +using namespace ::com::sun::star::accessibility; + +using ::com::sun::star::uno::Any; +using ::com::sun::star::uno::Reference; +using ::com::sun::star::uno::Sequence; +using ::com::sun::star::uno::UNO_QUERY; +using ::com::sun::star::lang::IndexOutOfBoundsException; +using ::com::sun::star::uno::RuntimeException; +using ::rtl::OUString; +using ::std::vector; + +#include +#include +#include + +namespace { + +class StackPrinter +{ +public: + explicit StackPrinter(const char* msg) : + msMsg(msg) + { + fprintf(stdout, "%s: --begin\n", msMsg.c_str()); + mfStartTime = getTime(); + } + + ~StackPrinter() + { + double fEndTime = getTime(); + fprintf(stdout, "%s: --end (duration: %g sec)\n", msMsg.c_str(), (fEndTime-mfStartTime)); + } + + void printTime(int line) const + { + double fEndTime = getTime(); + fprintf(stdout, "%s: --(%d) (duration: %g sec)\n", msMsg.c_str(), line, (fEndTime-mfStartTime)); + } + +private: + double getTime() const + { + timeval tv; + gettimeofday(&tv, NULL); + return tv.tv_sec + tv.tv_usec / 1000000.0; + } + + ::std::string msMsg; + double mfStartTime; +}; + +} + +ScAccessibleFilterMenuItem::ScAccessibleFilterMenuItem( + const Reference& rxParent, ScMenuFloatingWindow* pWin, const OUString& rName, size_t nMenuPos) : + ScAccessibleContextBase(rxParent, AccessibleRole::MENU_ITEM), + mpWindow(pWin), + maName(rName), + mnMenuPos(nMenuPos), + mbSelected(false), + mbEnabled(true) +{ + SetName(rName); +} + +ScAccessibleFilterMenuItem::~ScAccessibleFilterMenuItem() +{ +} + +sal_Int32 ScAccessibleFilterMenuItem::getAccessibleChildCount() + throw (RuntimeException) +{ + return 0; +} + +Reference ScAccessibleFilterMenuItem::getAccessibleChild(sal_Int32 nIndex) + throw (RuntimeException, IndexOutOfBoundsException) +{ + throw IndexOutOfBoundsException(); + return Reference(); +} + +Reference ScAccessibleFilterMenuItem::getAccessibleStateSet() + throw (RuntimeException) +{ + fprintf(stdout, "ScAccessibleFilterMenuItem::getAccessibleStateSet: called\n"); + return this; +} + +OUString ScAccessibleFilterMenuItem::getImplementationName() + throw (RuntimeException) +{ + return OUString::createFromAscii("ScAccessibleFilterMenuItem - implementation name"); +} + +// XAccessibleStateSet + +sal_Bool ScAccessibleFilterMenuItem::isEmpty() throw (RuntimeException) +{ + fprintf(stdout, "ScAccessibleFilterMenuItem::isEmpty: called\n"); + return (mbEnabled || mbSelected); +} + +sal_Bool ScAccessibleFilterMenuItem::contains(sal_Int16 nState) throw (RuntimeException) +{ + using namespace ::com::sun::star::accessibility::AccessibleStateType; + fprintf(stdout, "ScAccessibleFilterMenuItem::contains: state = %d\n", nState); + if (mbEnabled) + { + switch (nState) + { + case ENABLED: + case FOCUSABLE: + case SELECTABLE: + case SENSITIVE: + return true; + } + } + + if (mbSelected) + { + switch (nState) + { + case FOCUSED: + case SELECTED: + return true; + } + } + return false; +} + +sal_Bool ScAccessibleFilterMenuItem::containsAll(const Sequence& aStateSet) + throw (RuntimeException) +{ + using namespace ::com::sun::star::accessibility::AccessibleStateType; + fprintf(stdout, "ScAccessibleFilterMenuItem::containsAll: called\n"); + sal_Int32 n = aStateSet.getLength(); + for (sal_Int32 i = 0; i < n; ++i) + { + sal_Int16 nState = aStateSet[i]; + if (mbEnabled) + { + switch (nState) + { + case ENABLED: + case FOCUSABLE: + case SELECTABLE: + case SENSITIVE: + continue; + } + } + if (mbSelected) + { + switch (nState) + { + case FOCUSED: + case SELECTED: + continue; + } + } + return false; + } + return true; +} + +Sequence ScAccessibleFilterMenuItem::getStates() throw (RuntimeException) +{ + fprintf(stdout, "ScAccessibleFilterMenuItem::getStates: name = '%s' enabled = %d selected = %d\n", + rtl::OUStringToOString(getAccessibleName(), RTL_TEXTENCODING_UTF8).getStr(), + mbEnabled, mbSelected); + using namespace ::com::sun::star::accessibility::AccessibleStateType; + vector aStates; + if (mbEnabled) + { + aStates.push_back(ENABLED); + aStates.push_back(FOCUSABLE); + aStates.push_back(SELECTABLE); + aStates.push_back(SENSITIVE); + } + + if (mbSelected) + { + aStates.push_back(FOCUSED); + aStates.push_back(SELECTED); + } + + size_t n = aStates.size(); + Sequence aSeq(aStates.size()); + for (size_t i = 0; i < n; ++i) + aSeq[i] = aStates[i]; + + return aSeq; +} + +// XAccessibleAction + +sal_Int32 ScAccessibleFilterMenuItem::getAccessibleActionCount() throw (RuntimeException) +{ + return 1; +} + +sal_Bool ScAccessibleFilterMenuItem::doAccessibleAction(sal_Int32 nIndex) + throw (IndexOutOfBoundsException, RuntimeException) +{ + fprintf(stdout, "ScAccessibleFilterMenuItem::doAccessibleAction: called\n"); + return false; +} + +OUString ScAccessibleFilterMenuItem::getAccessibleActionDescription(sal_Int32 nIndex) + throw (IndexOutOfBoundsException, RuntimeException) +{ + return OUString::createFromAscii("Add some action here..."); +} + +Reference ScAccessibleFilterMenuItem::getAccessibleActionKeyBinding( + sal_Int32 nIndex) throw (IndexOutOfBoundsException, RuntimeException) +{ + return Reference(); +} + +Any SAL_CALL ScAccessibleFilterMenuItem::queryInterface( uno::Type const & rType ) + throw (RuntimeException) +{ + Any any = ScAccessibleContextBase::queryInterface(rType); + if (any.hasValue()) + return any; + + return ScAccessibleFilterMenuItem_BASE::queryInterface(rType); +} + +void SAL_CALL ScAccessibleFilterMenuItem::acquire() throw () +{ + ScAccessibleContextBase::acquire(); +} + +void SAL_CALL ScAccessibleFilterMenuItem::release() throw () +{ + ScAccessibleContextBase::release(); +} + +void ScAccessibleFilterMenuItem::select() +{ + mbSelected = true; + CommitFocusGained(); +} + +void ScAccessibleFilterMenuItem::unselect() +{ + mbSelected = false; + CommitFocusLost(); +} + +bool ScAccessibleFilterMenuItem::isSelected() const +{ + return mbSelected; +} + +void ScAccessibleFilterMenuItem::setEnabled(bool bEnabled) +{ + mbEnabled = bEnabled; +} + diff --git a/sc/source/ui/Accessibility/AccessibleFilterTopWindow.cxx b/sc/source/ui/Accessibility/AccessibleFilterTopWindow.cxx new file mode 100644 index 000000000000..f0256b0abe9f --- /dev/null +++ b/sc/source/ui/Accessibility/AccessibleFilterTopWindow.cxx @@ -0,0 +1,98 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: AccessibleDataPilotControl.hxx,v $ + * $Revision: 1.6 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove + +#include "precompiled_sc.hxx" +#include "AccessibleFilterTopWindow.hxx" +#include "AccessibleFilterMenu.hxx" +#include "dpcontrol.hxx" + +#include + +using namespace ::com::sun::star; +using namespace ::com::sun::star::accessibility; +using ::com::sun::star::lang::IndexOutOfBoundsException; +using ::com::sun::star::uno::Reference; +using ::com::sun::star::uno::RuntimeException; +using ::rtl::OUString; + +ScAccessibleFilterTopWindow::ScAccessibleFilterTopWindow( + const Reference& rxParent, ScDPFieldPopupWindow* pWin, const OUString& rName, ScDocument* pDoc) : + ScAccessibleContextBase(rxParent, AccessibleRole::PANEL), + mpWindow(pWin), + mpDoc(pDoc) +{ + SetName(rName); +} + +ScAccessibleFilterTopWindow::~ScAccessibleFilterTopWindow() +{ +} + +// XAccessibleContext + +sal_Int32 ScAccessibleFilterTopWindow::getAccessibleChildCount() throw (RuntimeException) +{ + return 2; +} + +Reference ScAccessibleFilterTopWindow::getAccessibleChild( + sal_Int32 nIndex) throw (RuntimeException, IndexOutOfBoundsException) +{ + if (nIndex >= 2) + throw IndexOutOfBoundsException(); + + if (nIndex == 0) + return getAccessibleChildMenu(); + + if (nIndex == 1) + return mxAccessibleListBox; + + return Reference(); +} + +OUString ScAccessibleFilterTopWindow::getImplementationName() throw (RuntimeException) +{ + return OUString::createFromAscii("ScAccessibleFilterTopWindow"); +} + +Reference ScAccessibleFilterTopWindow::getAccessibleChildMenu() +{ + if (!mxAccessibleMenu.is()) + mxAccessibleMenu.set(new ScAccessibleFilterMenu(this, mpWindow, getAccessibleName(), mpDoc)); + return mxAccessibleMenu; +} + +void ScAccessibleFilterTopWindow::setAccessibleChildListBox(const Reference& rAccessible) +{ + mxAccessibleListBox = rAccessible; +} + diff --git a/sc/source/ui/Accessibility/makefile.mk b/sc/source/ui/Accessibility/makefile.mk index dfa5ac94b63f..0bde79f1f159 100644 --- a/sc/source/ui/Accessibility/makefile.mk +++ b/sc/source/ui/Accessibility/makefile.mk @@ -53,6 +53,9 @@ SLOFILES = \ $(SLO)$/AccessibleDocumentBase.obj \ $(SLO)$/AccessibleCellBase.obj \ $(SLO)$/AccessibleDocumentPagePreview.obj \ + $(SLO)$/AccessibleFilterMenu.obj \ + $(SLO)$/AccessibleFilterMenuItem.obj \ + $(SLO)$/AccessibleFilterTopWindow.obj \ $(SLO)$/AccessiblePreviewTable.obj \ $(SLO)$/AccessiblePreviewCell.obj \ $(SLO)$/AccessiblePreviewHeaderCell.obj \ @@ -73,6 +76,9 @@ EXCEPTIONSFILES= \ $(SLO)$/AccessibleDocumentBase.obj \ $(SLO)$/AccessibleCellBase.obj \ $(SLO)$/AccessibleDocumentPagePreview.obj \ + $(SLO)$/AccessibleFilterMenu.obj \ + $(SLO)$/AccessibleFilterMenuItem.obj \ + $(SLO)$/AccessibleFilterTopWindow.obj \ $(SLO)$/AccessiblePreviewTable.obj \ $(SLO)$/AccessiblePreviewCell.obj \ $(SLO)$/AccessiblePreviewHeaderCell.obj \ diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index 0060a9341ec3..df8658eb1f6b 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -41,14 +41,86 @@ #include "vcl/wintypes.hxx" #include "vcl/decoview.hxx" #include "strload.hxx" +#include "global.hxx" + +#include "AccessibleFilterMenu.hxx" +#include "AccessibleFilterTopWindow.hxx" + +#include #define MENU_NOT_SELECTED 999 +using ::com::sun::star::uno::Reference; +using ::com::sun::star::accessibility::XAccessible; using ::rtl::OUString; using ::rtl::OUStringHash; using ::std::vector; using ::std::hash_map; using ::std::auto_ptr; +//using ::std::for_each; + + +#include +#include +#include + +namespace { + +class StackPrinter +{ +public: + explicit StackPrinter(const char* msg) : + msMsg(msg) + { + fprintf(stdout, "%s: --begin\n", msMsg.c_str()); + mfStartTime = getTime(); + } + + ~StackPrinter() + { + double fEndTime = getTime(); + fprintf(stdout, "%s: --end (duration: %g sec)\n", msMsg.c_str(), (fEndTime-mfStartTime)); + } + + void printTime(int line) const + { + double fEndTime = getTime(); + fprintf(stdout, "%s: --(%d) (duration: %g sec)\n", msMsg.c_str(), line, (fEndTime-mfStartTime)); + } + +private: + double getTime() const + { + timeval tv; + gettimeofday(&tv, NULL); + return tv.tv_sec + tv.tv_usec / 1000000.0; + } + + ::std::string msMsg; + double mfStartTime; +}; + +} + +//namespace { +// +//class AppendAccessibleMenuItems : public ::std::unary_function +//{ +//public: +// explicit AppendAccessibleMenuItems(ScAccessibleFilterMenu* pAccMenu) : +// mnPos(0), mpAccMenu(pAccMenu) {} +// +// void operator() (const ScMenuFloatingWindow::MenuItem& rItem) +// { +// mpAccMenu->appendMenuItem(rItem.maText, rItem.mbEnabled, mnPos++); +// } +// +//private: +// size_t mnPos; +// ScAccessibleFilterMenu* mpAccMenu; +//}; +// +//} ScDPFieldButton::ScDPFieldButton(OutputDevice* pOutDev, const StyleSettings* pStyle, const Fraction* pZoomX, const Fraction* pZoomY) : mpOutDev(pOutDev), @@ -272,16 +344,19 @@ IMPL_LINK( ScMenuFloatingWindow::SubMenuItem, TimeoutHdl, void*, EMPTYARG ) // ---------------------------------------------------------------------------- -ScMenuFloatingWindow::ScMenuFloatingWindow(Window* pParent) : +ScMenuFloatingWindow::ScMenuFloatingWindow(Window* pParent, ScDocument* pDoc) : FloatingWindow(pParent, (WB_SYSTEMFLOATWIN|WB_SYSTEMWINDOW|WB_NOBORDER)), maOpenTimer(this), maCloseTimer(this), + maName(OUString::createFromAscii("ScMenuFloatingWindow")), mnSelectedMenu(MENU_NOT_SELECTED), mnClickedMenu(MENU_NOT_SELECTED), + mpDoc(pDoc), mpParentMenu(dynamic_cast(pParent)), mpActiveSubMenu(NULL), mbActionFired(false) { + fprintf(stdout, "***** ScMenuFloatingWindow::ScMenuFloatingWindow: ctor (%p) parent = %p\n", this, pParent); // TODO: How do we get the right font to use here ? const sal_uInt16 nPopupFontHeight = 12; const StyleSettings& rStyle = GetSettings().GetStyleSettings(); @@ -289,6 +364,7 @@ ScMenuFloatingWindow::ScMenuFloatingWindow(Window* pParent) : maLabelFont.SetHeight(nPopupFontHeight); SetFont(maLabelFont); + SetText(OUString::createFromAscii("ScMenuFloatingWindow")); SetPopupModeEndHdl( LINK(this, ScMenuFloatingWindow, EndPopupHdl) ); } @@ -404,6 +480,30 @@ void ScMenuFloatingWindow::Paint(const Rectangle& /*rRect*/) drawAllMenuItems(); } +Reference ScMenuFloatingWindow::CreateAccessible() +{ + if (!mxAccessible.is()) + { + StackPrinter __stack_printer__("ScMenuFloatingWindow::CreateAccessible (create new)"); + Reference xAccParent = mpParentMenu ? + mpParentMenu->GetAccessible() : GetAccessibleParentWindow()->GetAccessible(); + + mxAccessible.set(new ScAccessibleFilterMenu(xAccParent, this, maName, getDoc())); + ScAccessibleFilterMenu* p = static_cast( + mxAccessible.get()); + +// for_each(maMenuItems.begin(), maMenuItems.end(), AppendAccessibleMenuItems(p)); + vector::const_iterator itr, itrBeg = maMenuItems.begin(), itrEnd = maMenuItems.end(); + for (itr = itrBeg; itr != itrEnd; ++itr) + { + size_t nPos = ::std::distance(itrBeg, itr); + p->appendMenuItem(itr->maText, itr->mbEnabled, nPos); + } + } + + return mxAccessible; +} + void ScMenuFloatingWindow::addMenuItem(const OUString& rText, bool bEnabled, Action* pAction) { MenuItem aItem; @@ -418,7 +518,8 @@ ScMenuFloatingWindow* ScMenuFloatingWindow::addSubMenuItem(const OUString& rText MenuItem aItem; aItem.maText = rText; aItem.mbEnabled = bEnabled; - aItem.mpSubMenuWin.reset(new ScMenuFloatingWindow(this)); + aItem.mpSubMenuWin.reset(new ScMenuFloatingWindow(this, mpDoc)); + aItem.mpSubMenuWin->setName(rText); maMenuItems.push_back(aItem); return aItem.mpSubMenuWin.get(); } @@ -430,7 +531,7 @@ void ScMenuFloatingWindow::drawMenuItem(size_t nPos) Point aPos; Size aSize; - getMenuItemPosSize(aPos, aSize, nPos); + getMenuItemPosSize(nPos, aPos, aSize); DecorationView aDecoView(this); long nXOffset = 5; @@ -476,17 +577,19 @@ void ScMenuFloatingWindow::executeMenu(size_t nPos) EndPopupMode(); } -void ScMenuFloatingWindow::setSelectedMenuItem(size_t nPos, bool bSubMenuTimer) +void ScMenuFloatingWindow::setSelectedMenuItem(size_t nPos, bool bSubMenuTimer, bool bNotifyAccessible) { + StackPrinter __stack_printer__("******************** ScMenuFloatingWindow::setSelectedMenuItem ********************"); + fprintf(stdout, "ScMenuFloatingWindow::setSelectedMenuItem: pos = %d\n", nPos); if (mnSelectedMenu != nPos) { - selectMenuItem(mnSelectedMenu, false, bSubMenuTimer); - selectMenuItem(nPos, true, bSubMenuTimer); + selectMenuItem(mnSelectedMenu, false, bSubMenuTimer, bNotifyAccessible); + selectMenuItem(nPos, true, bSubMenuTimer, bNotifyAccessible); mnSelectedMenu = nPos; } } -size_t ScMenuFloatingWindow::getSelectedMenuItem() const +size_t ScMenuFloatingWindow::getSelectedMenuPos() const { return mnSelectedMenu; } @@ -563,7 +666,7 @@ void ScMenuFloatingWindow::launchSubMenu(bool bSetMenuPos) { Point aPos; Size aSize; - getMenuItemPosSize(aPos, aSize, maOpenTimer.mnMenuPos); + getMenuItemPosSize(maOpenTimer.mnMenuPos, aPos, aSize); ScMenuFloatingWindow* pSubMenu = maOpenTimer.mpSubMenu; if (!pSubMenu) @@ -588,6 +691,21 @@ void ScMenuFloatingWindow::endSubMenu() } } +void ScMenuFloatingWindow::fillMenuItemsToAccessible(ScAccessibleFilterMenu* pAccMenu) const +{ + vector::const_iterator itr, itrBeg = maMenuItems.begin(), itrEnd = maMenuItems.end(); + for (itr = itrBeg; itr != itrEnd; ++itr) + { + size_t nPos = ::std::distance(itrBeg, itr); + pAccMenu->appendMenuItem(itr->maText, itr->mbEnabled, nPos); + } +} + +ScDocument* ScMenuFloatingWindow::getDoc() +{ + return mpDoc; +} + void ScMenuFloatingWindow::notify(NotificationType eType) { switch (eType) @@ -608,8 +726,9 @@ void ScMenuFloatingWindow::notify(NotificationType eType) void ScMenuFloatingWindow::resetMenu(bool bSetMenuPos) { - mnSelectedMenu = bSetMenuPos ? 0 : MENU_NOT_SELECTED; resizeToFitMenuItems(); + if (bSetMenuPos) + setSelectedMenuItem(0, false, true); } void ScMenuFloatingWindow::resizeToFitMenuItems() @@ -625,14 +744,15 @@ void ScMenuFloatingWindow::resizeToFitMenuItems() size_t nLastPos = maMenuItems.size()-1; Point aPos; Size aSize; - getMenuItemPosSize(aPos, aSize, nLastPos); + getMenuItemPosSize(nLastPos, aPos, aSize); aPos.X() += nTextWidth + 15; aPos.Y() += aSize.Height() + 5; SetOutputSizePixel(Size(aPos.X(), aPos.Y())); } -void ScMenuFloatingWindow::selectMenuItem(size_t nPos, bool bSelected, bool bSubMenuTimer) +void ScMenuFloatingWindow::selectMenuItem(size_t nPos, bool bSelected, bool bSubMenuTimer, bool bNotifyAccessible) { + fprintf(stdout, "ScMenuFloatingWindow::selectMenuItem: pos = %d selected = %d\n", nPos, bSelected); if (nPos >= maMenuItems.size() || nPos == MENU_NOT_SELECTED) { queueCloseSubMenu(); @@ -663,6 +783,64 @@ void ScMenuFloatingWindow::selectMenuItem(size_t nPos, bool bSelected, bool bSub queueCloseSubMenu(); } } + + if (bNotifyAccessible && mxAccessible.is()) + { + ScAccessibleFilterMenu* p = static_cast(mxAccessible.get()); + p->selectMenuItem(nPos, bSelected); + } +} + +void ScMenuFloatingWindow::clearSelectedMenuItem(bool bNotifyAccessible) +{ + selectMenuItem(mnSelectedMenu, false, false, bNotifyAccessible); + + if (bNotifyAccessible && mxAccessible.is()) + { + ScAccessibleFilterMenu* p = static_cast(mxAccessible.get()); + p->selectMenuItem(mnSelectedMenu, false); + } + + mnSelectedMenu = MENU_NOT_SELECTED; +} + +ScMenuFloatingWindow* ScMenuFloatingWindow::getSubMenuWindow(size_t nPos) const +{ + if (maMenuItems.size() <= nPos) + return NULL; + + return maMenuItems[nPos].mpSubMenuWin.get(); +} + +size_t ScMenuFloatingWindow::getMenuItemCount() const +{ + return maMenuItems.size(); +} + +OUString ScMenuFloatingWindow::getMenuItemName(size_t nPos) const +{ + if (maMenuItems.size() <= nPos) + return ScGlobal::GetEmptyString(); + + return maMenuItems[nPos].maText; +} + +bool ScMenuFloatingWindow::isMenuItemEnabled(size_t nPos) const +{ + if (maMenuItems.size() <= nPos) + return false; + + return maMenuItems[nPos].mbEnabled; +} + +void ScMenuFloatingWindow::setName(const OUString& rName) +{ + maName = rName; +} + +const OUString& ScMenuFloatingWindow::getName() const +{ + return maName; } void ScMenuFloatingWindow::highlightMenuItem(size_t nPos, bool bSelected) @@ -674,7 +852,7 @@ void ScMenuFloatingWindow::highlightMenuItem(size_t nPos, bool bSelected) Point aPos; Size aSize; - getMenuItemPosSize(aPos, aSize, nPos); + getMenuItemPosSize(nPos, aPos, aSize); Region aRegion(Rectangle(aPos,aSize)); if (IsNativeControlSupported(CTRL_MENU_POPUP, PART_ENTIRE_CONTROL)) @@ -717,7 +895,7 @@ void ScMenuFloatingWindow::highlightMenuItem(size_t nPos, bool bSelected) drawMenuItem(nPos); } -void ScMenuFloatingWindow::getMenuItemPosSize(Point& rPos, Size& rSize, size_t nPos) const +void ScMenuFloatingWindow::getMenuItemPosSize(size_t nPos, Point& rPos, Size& rSize) const { const sal_uInt16 nLeftMargin = 5; const sal_uInt16 nTopMargin = 5; @@ -740,7 +918,7 @@ size_t ScMenuFloatingWindow::getEnclosingMenuItem(const Point& rPos) const { Point aPos; Size aSize; - getMenuItemPosSize(aPos, aSize, i); + getMenuItemPosSize(i, aPos, aSize); Rectangle aRect(aPos, aSize); if (aRect.IsInside(rPos)) return i; @@ -776,8 +954,8 @@ void ScDPFieldPopupWindow::CancelButton::Click() // ---------------------------------------------------------------------------- -ScDPFieldPopupWindow::ScDPFieldPopupWindow(Window* pParent) : - ScMenuFloatingWindow(pParent), +ScDPFieldPopupWindow::ScDPFieldPopupWindow(Window* pParent, ScDocument* pDoc) : + ScMenuFloatingWindow(pParent, pDoc), maChecks(this, 0), maChkToggleAll(this, 0), maBtnSelectSingle (this, 0), @@ -1019,7 +1197,7 @@ void ScDPFieldPopupWindow::MouseMove(const MouseEvent& rMEvt) { ScMenuFloatingWindow::MouseMove(rMEvt); - size_t nSelectedMenu = getSelectedMenuItem(); + size_t nSelectedMenu = getSelectedMenuPos(); if (nSelectedMenu == MENU_NOT_SELECTED) queueCloseSubMenu(); } @@ -1047,6 +1225,23 @@ void ScDPFieldPopupWindow::Paint(const Rectangle& rRect) DrawRect(Rectangle(aPos,aSize)); } +Reference ScDPFieldPopupWindow::CreateAccessible() +{ + if (!mxAccessible.is()) + { + mxAccessible.set(new ScAccessibleFilterTopWindow( + GetAccessibleParentWindow()->GetAccessible(), this, getName(), getDoc())); + ScAccessibleFilterTopWindow* pAccTop = static_cast(mxAccessible.get()); + Reference xAccMenu = pAccTop->getAccessibleChildMenu(); + ScAccessibleFilterMenu* pAccMenu = static_cast(xAccMenu.get()); + fillMenuItemsToAccessible(pAccMenu); + + pAccTop->setAccessibleChildListBox(maChecks.CreateAccessible()); + } + + return mxAccessible; +} + void ScDPFieldPopupWindow::setMemberSize(size_t n) { maMembers.reserve(n); diff --git a/sc/source/ui/inc/AccessibleContextBase.hxx b/sc/source/ui/inc/AccessibleContextBase.hxx index 8d312a0d13d9..c1ff5afcf52f 100644 --- a/sc/source/ui/inc/AccessibleContextBase.hxx +++ b/sc/source/ui/inc/AccessibleContextBase.hxx @@ -319,6 +319,8 @@ protected: /// Use this method to set initial Description without notification void SetDescription(const rtl::OUString& rDesc) { msDescription = rDesc; } + void SetRole(sal_Int16 nRole); + /// Reference to the parent object. ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> mxParent; diff --git a/sc/source/ui/inc/dpcontrol.hxx b/sc/source/ui/inc/dpcontrol.hxx index 0074add2be25..72a7dc7a6970 100644 --- a/sc/source/ui/inc/dpcontrol.hxx +++ b/sc/source/ui/inc/dpcontrol.hxx @@ -44,11 +44,21 @@ #include #include +namespace com { namespace sun { namespace star { + + namespace accessibility { + class XAccessible; + } + +}}} + class OutputDevice; class Point; class Size; class StyleSettings; class Window; +class ScDocument; +class ScAccessibleFilterMenu; /** * This class takes care of physically drawing field button controls inside @@ -103,7 +113,7 @@ public: virtual void execute() = 0; }; - explicit ScMenuFloatingWindow(Window* pParent); + explicit ScMenuFloatingWindow(Window* pParent, ScDocument* pDoc); virtual ~ScMenuFloatingWindow(); virtual void MouseMove(const MouseEvent& rMEvt); @@ -111,23 +121,42 @@ public: virtual void MouseButtonUp(const MouseEvent& rMEvt); virtual void KeyInput(const KeyEvent& rKEvt); virtual void Paint(const Rectangle& rRect); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible(); void addMenuItem(const ::rtl::OUString& rText, bool bEnabled, Action* pAction); ScMenuFloatingWindow* addSubMenuItem(const ::rtl::OUString& rText, bool bEnabled); + void setSelectedMenuItem(size_t nPos, bool bSubMenuTimer = true, bool bNotifyAccessible = true); + void selectMenuItem(size_t nPos, bool bSelected, bool bSubMenuTimer, bool bNotifyAccessible); + void clearSelectedMenuItem(bool bNotifyAccessible); + ScMenuFloatingWindow* getSubMenuWindow(size_t nPos) const; + size_t getMenuItemCount() const; + ::rtl::OUString getMenuItemName(size_t nPos) const; + bool isMenuItemEnabled(size_t nPos) const; + + void setName(const ::rtl::OUString& rName); + const ::rtl::OUString& getName() const; protected: + void drawMenuItem(size_t nPos); void drawAllMenuItems(); const Font& getLabelFont() const; void executeMenu(size_t nPos); - void setSelectedMenuItem(size_t nPos, bool bSubMenuTimer = true); - size_t getSelectedMenuItem() const; + size_t getSelectedMenuPos() const; void queueLaunchSubMenu(size_t nPos, ScMenuFloatingWindow* pMenu); void queueCloseSubMenu(); void launchSubMenu(bool bSetMenuPos); void endSubMenu(); + void fillMenuItemsToAccessible(ScAccessibleFilterMenu* pAccMenu) const; + + ScDocument* getDoc(); + +protected: + ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible > mxAccessible; + private: struct SubMenuItem; void handleMenuTimeout(SubMenuItem* pTimer); @@ -137,15 +166,15 @@ private: void resetMenu(bool bSetMenuPos); void resizeToFitMenuItems(); - void selectMenuItem(size_t nPos, bool bSelected, bool bSubMenuTimer); void highlightMenuItem(size_t nPos, bool bSelected); - void getMenuItemPosSize(Point& rPos, Size& rSize, size_t nPos) const; + void getMenuItemPosSize(size_t nPos, Point& rPos, Size& rSize) const; size_t getEnclosingMenuItem(const Point& rPos) const; DECL_LINK( EndPopupHdl, void* ); private: + struct MenuItem { ::rtl::OUString maText; @@ -178,9 +207,16 @@ private: Font maLabelFont; + // Name of this menu window, taken from the menu item of the parent window + // that launches it (if this is a sub menu). If this is a top-level menu + // window, then this name can be anything. + ::rtl::OUString maName; + size_t mnSelectedMenu; size_t mnClickedMenu; + ScDocument* mpDoc; + ScMenuFloatingWindow* mpParentMenu; ScMenuFloatingWindow* mpActiveSubMenu; @@ -202,11 +238,12 @@ public: */ struct ExtendedData {}; - explicit ScDPFieldPopupWindow(Window* pParent); + explicit ScDPFieldPopupWindow(Window* pParent, ScDocument* pDoc); virtual ~ScDPFieldPopupWindow(); virtual void MouseMove(const MouseEvent& rMEvt); virtual void Paint(const Rectangle& rRect); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible(); void setMemberSize(size_t n); void addMember(const ::rtl::OUString& rName, bool bVisible); diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx index 8bafb474bff3..5a01a642ac24 100644 --- a/sc/source/ui/view/gridwin2.cxx +++ b/sc/source/ui/view/gridwin2.cxx @@ -911,7 +911,8 @@ void ScGridWindow::DPLaunchFieldPopupMenu( const ScDPLabelData& rLabelData = *pDPData->maDPParam.maLabelArray[pDPData->mnDim]; - mpDPFieldPopup.reset(new ScDPFieldPopupWindow(this)); + mpDPFieldPopup.reset(new ScDPFieldPopupWindow(this, pViewData->GetDocument())); + mpDPFieldPopup->setName(OUString::createFromAscii("DataPilot field member popup")); mpDPFieldPopup->setExtendedData(pDPData.release()); mpDPFieldPopup->setOKAction(new DPFieldPopupOKAction(this)); { -- cgit v1.2.3 From b30732a7e8691804e9b0a0f4d10dd1e9054983fc Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 20 Aug 2009 13:52:04 +0000 Subject: When creating an accessible object for a border window, create one from the child window instance unless it's a menu popup. --- accessibility/source/helper/acc_factory.cxx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/accessibility/source/helper/acc_factory.cxx b/accessibility/source/helper/acc_factory.cxx index 5c8b742db53c..ba36bef7f065 100644 --- a/accessibility/source/helper/acc_factory.cxx +++ b/accessibility/source/helper/acc_factory.cxx @@ -376,7 +376,18 @@ inline bool hasFloatingChild(Window *pWindow) } else if ( nType == WINDOW_BORDERWINDOW && hasFloatingChild( pWindow ) ) { - xContext = new FloatingWindowAccessible( _pXWindow ); + // TODO: better way to handle this? + Window* pChild = pWindow->GetAccessibleChildWindow(0); + if ( pChild->IsMenuFloatingWindow() ) + // Menu popup window handles accessibility differently. + xContext = new FloatingWindowAccessible( _pXWindow ); + else + { + // Get the accessible context from the child window. + Reference xAccessible = pChild->CreateAccessible(); + if (xAccessible.is()) + xContext = xAccessible->getAccessibleContext(); + } } else if ( nType == WINDOW_HELPTEXTWINDOW ) { -- cgit v1.2.3 From fb89c0d1df93909faeaa080359e77b1f35eed572 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 20 Aug 2009 17:36:00 +0000 Subject: Added accessible objects for the remainder of the standard widgets. --- sc/inc/AccessibleFilterTopWindow.hxx | 30 +++++++++-- .../ui/Accessibility/AccessibleFilterTopWindow.cxx | 59 +++++++++++++++++----- sc/source/ui/cctrl/dpcontrol.cxx | 13 ++++- 3 files changed, 85 insertions(+), 17 deletions(-) diff --git a/sc/inc/AccessibleFilterTopWindow.hxx b/sc/inc/AccessibleFilterTopWindow.hxx index 7b7ad0c880f0..f492c498b29a 100644 --- a/sc/inc/AccessibleFilterTopWindow.hxx +++ b/sc/inc/AccessibleFilterTopWindow.hxx @@ -63,15 +63,37 @@ public: ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > getAccessibleChildMenu(); - void setAccessibleChildListBox( - const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rAccessible); + enum ChildControlType { + LISTBOX, TOGGLE_ALL, SINGLE_ON_BTN, SINGLE_OFF_BTN, OK_BTN, CANCEL_BTN + }; + void setAccessibleChild( + const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rAccessible, + ChildControlType eType); private: + /** The top menu part */ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > - mxAccessibleMenu; + mxAccMenu; + /** check list box for field member visibility */ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > - mxAccessibleListBox; + mxAccListBox; + + /** check box for toggling all field member's visibility. */ + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > + mxAccToggleAll; + + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > + mxAccSingleOnBtn; + + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > + mxAccSingleOffBtn; + + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > + mxAccOkBtn; + + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > + mxAccCancelBtn; ScDPFieldPopupWindow* mpWindow; ScDocument* mpDoc; diff --git a/sc/source/ui/Accessibility/AccessibleFilterTopWindow.cxx b/sc/source/ui/Accessibility/AccessibleFilterTopWindow.cxx index f0256b0abe9f..3e8ab00427b0 100644 --- a/sc/source/ui/Accessibility/AccessibleFilterTopWindow.cxx +++ b/sc/source/ui/Accessibility/AccessibleFilterTopWindow.cxx @@ -61,20 +61,34 @@ ScAccessibleFilterTopWindow::~ScAccessibleFilterTopWindow() sal_Int32 ScAccessibleFilterTopWindow::getAccessibleChildCount() throw (RuntimeException) { - return 2; + return 7; } Reference ScAccessibleFilterTopWindow::getAccessibleChild( sal_Int32 nIndex) throw (RuntimeException, IndexOutOfBoundsException) { - if (nIndex >= 2) + if (nIndex >= 7) throw IndexOutOfBoundsException(); - if (nIndex == 0) - return getAccessibleChildMenu(); - - if (nIndex == 1) - return mxAccessibleListBox; + switch (nIndex) + { + case 0: + return getAccessibleChildMenu(); + case 1: + return mxAccListBox; + case 2: + return mxAccToggleAll; + case 3: + return mxAccSingleOnBtn; + case 4: + return mxAccSingleOffBtn; + case 5: + return mxAccOkBtn; + case 6: + return mxAccCancelBtn; + default: + ; + } return Reference(); } @@ -86,13 +100,34 @@ OUString ScAccessibleFilterTopWindow::getImplementationName() throw (RuntimeExce Reference ScAccessibleFilterTopWindow::getAccessibleChildMenu() { - if (!mxAccessibleMenu.is()) - mxAccessibleMenu.set(new ScAccessibleFilterMenu(this, mpWindow, getAccessibleName(), mpDoc)); - return mxAccessibleMenu; + if (!mxAccMenu.is()) + mxAccMenu.set(new ScAccessibleFilterMenu(this, mpWindow, getAccessibleName(), mpDoc)); + return mxAccMenu; } -void ScAccessibleFilterTopWindow::setAccessibleChildListBox(const Reference& rAccessible) +void ScAccessibleFilterTopWindow::setAccessibleChild( + const Reference& rAccessible, ChildControlType eType) { - mxAccessibleListBox = rAccessible; + switch (eType) + { + case LISTBOX: + mxAccListBox = rAccessible; + break; + case TOGGLE_ALL: + mxAccToggleAll = rAccessible; + break; + case SINGLE_ON_BTN: + mxAccSingleOnBtn = rAccessible; + break; + case SINGLE_OFF_BTN: + mxAccSingleOffBtn = rAccessible; + break; + case OK_BTN: + mxAccOkBtn = rAccessible; + break; + case CANCEL_BTN: + mxAccCancelBtn = rAccessible; + break; + } } diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index df8658eb1f6b..66915b3878e7 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -1236,7 +1236,18 @@ Reference ScDPFieldPopupWindow::CreateAccessible() ScAccessibleFilterMenu* pAccMenu = static_cast(xAccMenu.get()); fillMenuItemsToAccessible(pAccMenu); - pAccTop->setAccessibleChildListBox(maChecks.CreateAccessible()); + pAccTop->setAccessibleChild( + maChecks.CreateAccessible(), ScAccessibleFilterTopWindow::LISTBOX); + pAccTop->setAccessibleChild( + maChkToggleAll.CreateAccessible(), ScAccessibleFilterTopWindow::TOGGLE_ALL); + pAccTop->setAccessibleChild( + maBtnSelectSingle.CreateAccessible(), ScAccessibleFilterTopWindow::SINGLE_ON_BTN); + pAccTop->setAccessibleChild( + maBtnUnselectSingle.CreateAccessible(), ScAccessibleFilterTopWindow::SINGLE_OFF_BTN); + pAccTop->setAccessibleChild( + maBtnOk.CreateAccessible(), ScAccessibleFilterTopWindow::OK_BTN); + pAccTop->setAccessibleChild( + maBtnCancel.CreateAccessible(), ScAccessibleFilterTopWindow::CANCEL_BTN); } return mxAccessible; -- cgit v1.2.3 From 088db7968bc05f8929da3767d04ee66aa59309da Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 20 Aug 2009 19:15:44 +0000 Subject: Some code fragment for debugging accessible state set changes. --- vcl/unx/gtk/a11y/atkwrapper.cxx | 54 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/vcl/unx/gtk/a11y/atkwrapper.cxx b/vcl/unx/gtk/a11y/atkwrapper.cxx index 927b8548a77a..27c10f8377b1 100644 --- a/vcl/unx/gtk/a11y/atkwrapper.cxx +++ b/vcl/unx/gtk/a11y/atkwrapper.cxx @@ -514,6 +514,60 @@ wrapper_ref_relation_set( AtkObject *atk_obj ) /*****************************************************************************/ +#if 0 +struct { + sal_Int16 value; + const sal_Char* name; +} aStateTypeTable[] = { + { accessibility::AccessibleStateType::INVALID, "INVALID" }, + { accessibility::AccessibleStateType::ACTIVE, "ACTIVE" }, + { accessibility::AccessibleStateType::ARMED, "ARMED" }, + { accessibility::AccessibleStateType::BUSY, "BUSY" }, + { accessibility::AccessibleStateType::CHECKED, "CHECKED" }, + { accessibility::AccessibleStateType::DEFUNC, "DEFUNC" }, + { accessibility::AccessibleStateType::EDITABLE, "EDITABLE" }, + { accessibility::AccessibleStateType::ENABLED, "ENABLED" }, + { accessibility::AccessibleStateType::EXPANDABLE, "EXPANDABLE" }, + { accessibility::AccessibleStateType::EXPANDED, "EXPANDED" }, + { accessibility::AccessibleStateType::FOCUSABLE, "FOCUSABLE" }, + { accessibility::AccessibleStateType::FOCUSED, "FOCUSED" }, + { accessibility::AccessibleStateType::HORIZONTAL, "HORIZONTAL" }, + { accessibility::AccessibleStateType::ICONIFIED, "ICONIFIED" }, + { accessibility::AccessibleStateType::INDETERMINATE, "INDETERMINATE" }, + { accessibility::AccessibleStateType::MANAGES_DESCENDANTS, "MANAGES_DESCENDANTS" }, + { accessibility::AccessibleStateType::MODAL, "MODAL" }, + { accessibility::AccessibleStateType::MULTI_LINE, "MULTI_LINE" }, + { accessibility::AccessibleStateType::MULTI_SELECTABLE, "MULTI_SELECTABLE" }, + { accessibility::AccessibleStateType::OPAQUE, "OPAQUE" }, + { accessibility::AccessibleStateType::PRESSED, "PRESSED" }, + { accessibility::AccessibleStateType::RESIZABLE, "RESIZABLE" }, + { accessibility::AccessibleStateType::SELECTABLE, "SELECTABLE" }, + { accessibility::AccessibleStateType::SELECTED, "SELECTED" }, + { accessibility::AccessibleStateType::SENSITIVE, "SENSITIVE" }, + { accessibility::AccessibleStateType::SHOWING, "SHOWING" }, + { accessibility::AccessibleStateType::SINGLE_LINE, "SINGLE_LINE" }, + { accessibility::AccessibleStateType::STALE, "STALE" }, + { accessibility::AccessibleStateType::TRANSIENT, "TRANSIENT" }, + { accessibility::AccessibleStateType::VERTICAL, "VERTICAL" }, + { accessibility::AccessibleStateType::VISIBLE, "VISIBLE" } +}; + +static void printStates(const uno::Sequence& rStates) +{ + sal_Int32 n = rStates.getLength(); + size_t nTypes = sizeof(aStateTypeTable)/sizeof(aStateTypeTable[0]); + for (sal_Int32 i = 0; i < n; ++i) + { + for (size_t j = 0; j < nTypes; ++j) + { + if (aStateTypeTable[j].value == rStates[i]) + printf("%s ", aStateTypeTable[j].name); + } + } + printf("\n"); +} +#endif + static AtkStateSet * wrapper_ref_state_set( AtkObject *atk_obj ) { -- cgit v1.2.3 From ca67662bc28f7a63906e59d8e7c6d6850883eef4 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 20 Aug 2009 19:17:56 +0000 Subject: Add a new data member to FloatingWindow, and use it to see if the window instance is used as a pop-up menu. If yes, and it it's a top-level menu, assign an appropriate accessible role. --- vcl/inc/vcl/floatwin.hxx | 3 +++ vcl/source/window/floatwin.cxx | 14 +++++++++++++- vcl/unx/gtk/a11y/atkwindow.cxx | 14 +++++++++----- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/vcl/inc/vcl/floatwin.hxx b/vcl/inc/vcl/floatwin.hxx index 8dcba41e2a8e..d46fc42f2263 100644 --- a/vcl/inc/vcl/floatwin.hxx +++ b/vcl/inc/vcl/floatwin.hxx @@ -157,6 +157,9 @@ public: const Link& GetPopupModeEndHdl() const { return maPopupModeEndHdl; } BOOL GrabsFocus() const { return mbGrabFocus; } + + sal_uInt16 GetMenuStackLevel() const; + void SetMenuStackLevel( sal_uInt16 nLevel ); }; #endif // _SV_FLOATWIN_HXX diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx index 7bcb90bbb8fc..45084a763ddd 100644 --- a/vcl/source/window/floatwin.cxx +++ b/vcl/source/window/floatwin.cxx @@ -48,6 +48,7 @@ #include #include +#include // ======================================================================= @@ -59,9 +60,11 @@ public: ToolBox* mpBox; Rectangle maItemEdgeClipRect; // used to clip the common edge between a toolbar item and the border of this window + sal_uInt16 mnMenuStackLevel; // in case it is used as a menu popup, store its stack level. 0 = top-level menu. }; -FloatingWindow::ImplData::ImplData() +FloatingWindow::ImplData::ImplData() : + mnMenuStackLevel( ::std::numeric_limits::max() ) { mpBox = NULL; } @@ -873,3 +876,12 @@ void FloatingWindow::RemovePopupModeWindow( Window* pWindow ) mpFirstPopupModeWin = NULL; } +sal_uInt16 FloatingWindow::GetMenuStackLevel() const +{ + return mpImplData->mnMenuStackLevel; +} + +void FloatingWindow::SetMenuStackLevel( sal_uInt16 nLevel ) +{ + mpImplData->mnMenuStackLevel = nLevel; +} diff --git a/vcl/unx/gtk/a11y/atkwindow.cxx b/vcl/unx/gtk/a11y/atkwindow.cxx index 4d1fa6c016e6..4a64a4959977 100644 --- a/vcl/unx/gtk/a11y/atkwindow.cxx +++ b/vcl/unx/gtk/a11y/atkwindow.cxx @@ -33,6 +33,7 @@ #include #include +#include "vcl/floatwin.hxx" #include "atkwindow.hxx" #include "atkwrapper.hxx" @@ -108,12 +109,15 @@ init_from_window( AtkObject *accessible, Window *pWindow ) pChild->SetAccessibleRole( AccessibleRole::LABEL ); accessible->name = g_strdup( rtl::OUStringToOString( pChild->GetText(), RTL_TEXTENCODING_UTF8 ).getStr() ); } - else if (WINDOW_FLOATINGWINDOW == pChild->GetType()) + else if ( pWindow->GetType() == WINDOW_BORDERWINDOW && pChild->GetType() == WINDOW_FLOATINGWINDOW ) { - // TODO: This is a hack. Figure out a way to do this a little cleaner. - role = ATK_ROLE_WINDOW; - pChild->SetAccessibleRole( AccessibleRole::WINDOW ); - accessible->name = g_strdup( rtl::OUStringToOString( pChild->GetText(), RTL_TEXTENCODING_UTF8 ).getStr() ); + sal_uInt16 nStackLevel = static_cast(pChild)->GetMenuStackLevel(); + if (nStackLevel == 0) + { + role = ATK_ROLE_POPUP_MENU; + pChild->SetAccessibleRole( AccessibleRole::POPUP_MENU ); + accessible->name = g_strdup( rtl::OUStringToOString( pChild->GetText(), RTL_TEXTENCODING_UTF8 ).getStr() ); + } } } break; -- cgit v1.2.3 From 87ca2cf990cf2eec07fc11914d63c63668b35d23 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 20 Aug 2009 19:55:14 +0000 Subject: Check if the FloatingWindow instance is used as a popup menu, and if yes, instantiate the accessible object from it, instead of its parent border window instance. --- vcl/inc/vcl/floatwin.hxx | 1 + vcl/source/window/floatwin.cxx | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/vcl/inc/vcl/floatwin.hxx b/vcl/inc/vcl/floatwin.hxx index d46fc42f2263..351c31df1c1b 100644 --- a/vcl/inc/vcl/floatwin.hxx +++ b/vcl/inc/vcl/floatwin.hxx @@ -160,6 +160,7 @@ public: sal_uInt16 GetMenuStackLevel() const; void SetMenuStackLevel( sal_uInt16 nLevel ); + bool IsPopupMenu() const; }; #endif // _SV_FLOATWIN_HXX diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx index 45084a763ddd..b29b74e63f78 100644 --- a/vcl/source/window/floatwin.cxx +++ b/vcl/source/window/floatwin.cxx @@ -885,3 +885,8 @@ void FloatingWindow::SetMenuStackLevel( sal_uInt16 nLevel ) { mpImplData->mnMenuStackLevel = nLevel; } + +bool FloatingWindow::IsPopupMenu() const +{ + return mpImplData->mnMenuStackLevel != ::std::numeric_limits::max(); +} -- cgit v1.2.3 From edd0ebc6c47352de490041bb05cd5875738ba902 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 20 Aug 2009 19:55:14 +0000 Subject: Check if the FloatingWindow instance is used as a popup menu, and if yes, instantiate the accessible object from it, instead of its parent border window instance. --- accessibility/source/helper/acc_factory.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/accessibility/source/helper/acc_factory.cxx b/accessibility/source/helper/acc_factory.cxx index ba36bef7f065..643e55f4d5c5 100644 --- a/accessibility/source/helper/acc_factory.cxx +++ b/accessibility/source/helper/acc_factory.cxx @@ -72,6 +72,7 @@ #include #include #include +#include "vcl/floatwin.hxx" #include @@ -376,18 +377,17 @@ inline bool hasFloatingChild(Window *pWindow) } else if ( nType == WINDOW_BORDERWINDOW && hasFloatingChild( pWindow ) ) { - // TODO: better way to handle this? - Window* pChild = pWindow->GetAccessibleChildWindow(0); - if ( pChild->IsMenuFloatingWindow() ) - // Menu popup window handles accessibility differently. - xContext = new FloatingWindowAccessible( _pXWindow ); - else + FloatingWindow* pChild = static_cast( + pWindow->GetAccessibleChildWindow(0)); + if ( pChild->IsPopupMenu() ) { // Get the accessible context from the child window. Reference xAccessible = pChild->CreateAccessible(); if (xAccessible.is()) xContext = xAccessible->getAccessibleContext(); } + else + xContext = new FloatingWindowAccessible( _pXWindow ); } else if ( nType == WINDOW_HELPTEXTWINDOW ) { -- cgit v1.2.3 From 4a08bf44d06f9e075ae578b062c01673eb7edf97 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 20 Aug 2009 20:23:05 +0000 Subject: removed all my printf statements. --- sc/inc/AccessibleFilterTopWindow.hxx | 3 +- .../ui/Accessibility/AccessibleFilterMenu.cxx | 80 +--------------------- .../ui/Accessibility/AccessibleFilterMenuItem.cxx | 50 -------------- sc/source/ui/cctrl/dpcontrol.cxx | 76 ++------------------ sc/source/ui/inc/dpcontrol.hxx | 2 +- 5 files changed, 9 insertions(+), 202 deletions(-) diff --git a/sc/inc/AccessibleFilterTopWindow.hxx b/sc/inc/AccessibleFilterTopWindow.hxx index f492c498b29a..801d84d0c5fb 100644 --- a/sc/inc/AccessibleFilterTopWindow.hxx +++ b/sc/inc/AccessibleFilterTopWindow.hxx @@ -67,7 +67,8 @@ public: LISTBOX, TOGGLE_ALL, SINGLE_ON_BTN, SINGLE_OFF_BTN, OK_BTN, CANCEL_BTN }; void setAccessibleChild( - const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rAccessible, + const ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible >& rAccessible, ChildControlType eType); private: diff --git a/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx b/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx index 2ab7722807da..bbc3ab91e450 100644 --- a/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx +++ b/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx @@ -70,48 +70,6 @@ using ::std::for_each; using ::std::vector; using ::std::set; -#include -#include -#include - -namespace { - -class StackPrinter -{ -public: - explicit StackPrinter(const char* msg) : - msMsg(msg) - { - fprintf(stdout, "%s: --begin\n", msMsg.c_str()); - mfStartTime = getTime(); - } - - ~StackPrinter() - { - double fEndTime = getTime(); - fprintf(stdout, "%s: --end (duration: %g sec)\n", msMsg.c_str(), (fEndTime-mfStartTime)); - } - - void printTime(int line) const - { - double fEndTime = getTime(); - fprintf(stdout, "%s: --(%d) (duration: %g sec)\n", msMsg.c_str(), line, (fEndTime-mfStartTime)); - } - -private: - double getTime() const - { - timeval tv; - gettimeofday(&tv, NULL); - return tv.tv_sec + tv.tv_usec / 1000000.0; - } - - ::std::string msMsg; - double mfStartTime; -}; - -} - // ============================================================================ namespace { @@ -169,12 +127,7 @@ public: void operator() (ScAccessibleFilterMenu::MenuItem& rItem) { -// if (rItem.mbSelected) -// ++mnCount; -// ScAccessibleFilterMenuItem* p = static_cast(rItem.mxAccessible.get()); -// fprintf(stdout, "CountSelectedMenuItem::(): name = '%s' selected = %d\n", -// rtl::OUStringToOString(p->getAccessibleName(), RTL_TEXTENCODING_UTF8).getStr(), p->isSelected()); if (p->isSelected()) ++mnCount; } @@ -203,14 +156,11 @@ ScAccessibleFilterMenu::ScAccessibleFilterMenu(const Reference& rxP mbEnabled(true), mbSelected(false) { - fprintf(stdout, "ScAccessibleFilterMenu::ScAccessibleFilterMenu: ctor (%p)\n", this); SetName(rName); -// SetDescription(OUString::createFromAscii("parent filter menu description")); } ScAccessibleFilterMenu::~ScAccessibleFilterMenu() { - fprintf(stdout, "ScAccessibleFilterMenu::~ScAccessibleFilterMenu: dtor (%p)\n", this); } // XAccessibleComponent @@ -218,33 +168,28 @@ ScAccessibleFilterMenu::~ScAccessibleFilterMenu() Reference ScAccessibleFilterMenu::getAccessibleAtPoint( const ::com::sun::star::awt::Point& rPoint ) throw (RuntimeException) { - fprintf(stdout, "ScAccessibleFilterMenu::getAccessibleAtPoint: point = (%ld,%ld)\n", rPoint.X, rPoint.Y); return this; } sal_Bool ScAccessibleFilterMenu::isVisible() throw (RuntimeException) { - fprintf(stdout, "ScAccessibleFilterMenu::isVisible: called\n"); return true; } void ScAccessibleFilterMenu::grabFocus() throw (RuntimeException) { - fprintf(stdout, "ScAccessibleFilterMenu::grabFocus: called\n"); } sal_Int32 ScAccessibleFilterMenu::getForeground() throw (RuntimeException) { - fprintf(stdout, "ScAccessibleFilterMenu::getForeground: called\n"); return 0; } sal_Int32 ScAccessibleFilterMenu::getBackground() throw (RuntimeException) { - fprintf(stdout, "ScAccessibleFilterMenu::getBackground: called\n"); return 0; } @@ -280,7 +225,7 @@ Reference ScAccessibleFilterMenu::getAccessibleStateSet() OUString ScAccessibleFilterMenu::getImplementationName() throw (RuntimeException) { - return OUString::createFromAscii("ScAccessibleFilterMenu - implementation name"); + return OUString::createFromAscii("ScAccessibleFilterMenu name"); } // XAccessibleEventBroadcaster @@ -334,7 +279,6 @@ sal_Bool ScAccessibleFilterMenu::containsAll(const Sequence& aStateSe Sequence ScAccessibleFilterMenu::getStates() throw (RuntimeException) { - StackPrinter __stack_printer__("ScAccessibleFilterMenu::getStates"); updateStates(); Sequence aSeq(0); set::const_iterator itr = maStates.begin(), itrEnd = maStates.end(); @@ -343,10 +287,6 @@ Sequence ScAccessibleFilterMenu::getStates() throw (RuntimeException) aSeq.realloc(i+1); aSeq[i] = *itr; } - if (maStates.count(FOCUSED)) - fprintf(stdout, "ScAccessibleFilterMenu::getStates: focused\n"); - else - fprintf(stdout, "ScAccessibleFilterMenu::getStates: not focused\n"); return aSeq; } @@ -355,8 +295,6 @@ Sequence ScAccessibleFilterMenu::getStates() throw (RuntimeException) void ScAccessibleFilterMenu::selectAccessibleChild(sal_Int32 nChildIndex) throw (IndexOutOfBoundsException, RuntimeException) { - StackPrinter __stack_printer__("********** ScAccessibleFilterMenu::selectAccessibleChild **********"); - fprintf(stdout, "ScAccessibleFilterMenu::selectAccessibleChild: index = %ld\n", nChildIndex); if (nChildIndex >= maMenuItems.size()) throw IndexOutOfBoundsException(); @@ -367,7 +305,6 @@ void ScAccessibleFilterMenu::selectAccessibleChild(sal_Int32 nChildIndex) sal_Bool ScAccessibleFilterMenu::isAccessibleChildSelected(sal_Int32 nChildIndex) throw (IndexOutOfBoundsException, RuntimeException) { - fprintf(stdout, "ScAccessibleFilterMenu::isAccessibleChildSelected: index = %ld\n", nChildIndex); if (nChildIndex >= maMenuItems.size()) throw IndexOutOfBoundsException(); @@ -376,7 +313,6 @@ sal_Bool ScAccessibleFilterMenu::isAccessibleChildSelected(sal_Int32 nChildIndex void ScAccessibleFilterMenu::clearAccessibleSelection() throw (RuntimeException) { - fprintf(stdout, "ScAccessibleFilterMenu::clearAccessibleSelection: called\n"); for_each(maMenuItems.begin(), maMenuItems.end(), SelectMenuItem(false)); mpWindow->clearSelectedMenuItem(false); } @@ -384,22 +320,17 @@ void ScAccessibleFilterMenu::clearAccessibleSelection() throw (RuntimeException) void ScAccessibleFilterMenu::selectAllAccessibleChildren() throw (RuntimeException) { // not suported - this is a menu, you can't select all menu items. - -// fprintf(stdout, "ScAccessibleFilterMenu::selectAllAccessibleChildren: called\n"); -// for_each(maMenuItems.begin(), maMenuItems.end(), SelectMenuItem(true)); } sal_Int32 ScAccessibleFilterMenu::getSelectedAccessibleChildCount() throw (RuntimeException) { sal_Int32 n = for_each(maMenuItems.begin(), maMenuItems.end(), CountSelectedMenuItem()).getCount(); - fprintf(stdout, "ScAccessibleFilterMenu::getSelectedAccessibleChildCount: count = %ld\n", n); return n; } Reference ScAccessibleFilterMenu::getSelectedAccessibleChild(sal_Int32 nChildIndex) throw (IndexOutOfBoundsException, RuntimeException) { - fprintf(stdout, "ScAccessibleFilterMenu::getSelectedAccessibleChild: index = %ld\n", nChildIndex); if (static_cast(nChildIndex) >= maMenuItems.size()) throw IndexOutOfBoundsException(); @@ -408,7 +339,6 @@ Reference ScAccessibleFilterMenu::getSelectedAccessibleChild(sal_In void ScAccessibleFilterMenu::deselectAccessibleChild(sal_Int32 nChildIndex) throw (IndexOutOfBoundsException, RuntimeException) { - fprintf(stdout, "ScAccessibleFilterMenu::deselectAccessibleChild: index = %ld\n", nChildIndex); if (static_cast(nChildIndex) >= maMenuItems.size()) throw IndexOutOfBoundsException(); @@ -453,8 +383,6 @@ Sequence ScAccessibleFilterMenu::getImplementationId() void ScAccessibleFilterMenu::selectMenuItem(size_t nIndex, bool bSelect) { - StackPrinter __stack_printer__("ScAccessibleFilterMenu::selectMenuItem"); - fprintf(stdout, "ScAccessibleFilterMenu::selectMenuItem: index = %d select = %d\n", nIndex, bSelect); if (maMenuItems.size() <= nIndex) return; @@ -471,8 +399,6 @@ void ScAccessibleFilterMenu::selectMenuItem(size_t nIndex, bool bSelect) p->unselect(); isSelected(); -// aEvent.EventId = AccessibleEventId::STATE_CHANGED; -// CommitChange(aEvent); } void ScAccessibleFilterMenu::appendMenuItem(const OUString& rName, bool bEnabled, size_t nMenuPos) @@ -504,15 +430,13 @@ void ScAccessibleFilterMenu::setEnabled(bool bEnabled) bool ScAccessibleFilterMenu::isFocused() { - return true; -// return isSelected(); + return isSelected(); } bool ScAccessibleFilterMenu::isSelected() { // Check to see if any of the child menu items is selected. size_t nSelectCount = for_each(maMenuItems.begin(), maMenuItems.end(), CountSelectedMenuItem()).getCount(); -// fprintf(stdout, "ScAccessibleFilterMenu::isSelected: selected count = %d\n", nSelectCount); return nSelectCount == 0; } diff --git a/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx b/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx index 2e151b67b600..45197df153ef 100644 --- a/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx +++ b/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx @@ -56,48 +56,6 @@ using ::com::sun::star::uno::RuntimeException; using ::rtl::OUString; using ::std::vector; -#include -#include -#include - -namespace { - -class StackPrinter -{ -public: - explicit StackPrinter(const char* msg) : - msMsg(msg) - { - fprintf(stdout, "%s: --begin\n", msMsg.c_str()); - mfStartTime = getTime(); - } - - ~StackPrinter() - { - double fEndTime = getTime(); - fprintf(stdout, "%s: --end (duration: %g sec)\n", msMsg.c_str(), (fEndTime-mfStartTime)); - } - - void printTime(int line) const - { - double fEndTime = getTime(); - fprintf(stdout, "%s: --(%d) (duration: %g sec)\n", msMsg.c_str(), line, (fEndTime-mfStartTime)); - } - -private: - double getTime() const - { - timeval tv; - gettimeofday(&tv, NULL); - return tv.tv_sec + tv.tv_usec / 1000000.0; - } - - ::std::string msMsg; - double mfStartTime; -}; - -} - ScAccessibleFilterMenuItem::ScAccessibleFilterMenuItem( const Reference& rxParent, ScMenuFloatingWindow* pWin, const OUString& rName, size_t nMenuPos) : ScAccessibleContextBase(rxParent, AccessibleRole::MENU_ITEM), @@ -130,7 +88,6 @@ Reference ScAccessibleFilterMenuItem::getAccessibleChild(sal_Int32 Reference ScAccessibleFilterMenuItem::getAccessibleStateSet() throw (RuntimeException) { - fprintf(stdout, "ScAccessibleFilterMenuItem::getAccessibleStateSet: called\n"); return this; } @@ -144,14 +101,12 @@ OUString ScAccessibleFilterMenuItem::getImplementationName() sal_Bool ScAccessibleFilterMenuItem::isEmpty() throw (RuntimeException) { - fprintf(stdout, "ScAccessibleFilterMenuItem::isEmpty: called\n"); return (mbEnabled || mbSelected); } sal_Bool ScAccessibleFilterMenuItem::contains(sal_Int16 nState) throw (RuntimeException) { using namespace ::com::sun::star::accessibility::AccessibleStateType; - fprintf(stdout, "ScAccessibleFilterMenuItem::contains: state = %d\n", nState); if (mbEnabled) { switch (nState) @@ -180,7 +135,6 @@ sal_Bool ScAccessibleFilterMenuItem::containsAll(const Sequence& aSta throw (RuntimeException) { using namespace ::com::sun::star::accessibility::AccessibleStateType; - fprintf(stdout, "ScAccessibleFilterMenuItem::containsAll: called\n"); sal_Int32 n = aStateSet.getLength(); for (sal_Int32 i = 0; i < n; ++i) { @@ -212,9 +166,6 @@ sal_Bool ScAccessibleFilterMenuItem::containsAll(const Sequence& aSta Sequence ScAccessibleFilterMenuItem::getStates() throw (RuntimeException) { - fprintf(stdout, "ScAccessibleFilterMenuItem::getStates: name = '%s' enabled = %d selected = %d\n", - rtl::OUStringToOString(getAccessibleName(), RTL_TEXTENCODING_UTF8).getStr(), - mbEnabled, mbSelected); using namespace ::com::sun::star::accessibility::AccessibleStateType; vector aStates; if (mbEnabled) @@ -249,7 +200,6 @@ sal_Int32 ScAccessibleFilterMenuItem::getAccessibleActionCount() throw (RuntimeE sal_Bool ScAccessibleFilterMenuItem::doAccessibleAction(sal_Int32 nIndex) throw (IndexOutOfBoundsException, RuntimeException) { - fprintf(stdout, "ScAccessibleFilterMenuItem::doAccessibleAction: called\n"); return false; } diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index 66915b3878e7..685ead25b47e 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -57,70 +57,6 @@ using ::rtl::OUStringHash; using ::std::vector; using ::std::hash_map; using ::std::auto_ptr; -//using ::std::for_each; - - -#include -#include -#include - -namespace { - -class StackPrinter -{ -public: - explicit StackPrinter(const char* msg) : - msMsg(msg) - { - fprintf(stdout, "%s: --begin\n", msMsg.c_str()); - mfStartTime = getTime(); - } - - ~StackPrinter() - { - double fEndTime = getTime(); - fprintf(stdout, "%s: --end (duration: %g sec)\n", msMsg.c_str(), (fEndTime-mfStartTime)); - } - - void printTime(int line) const - { - double fEndTime = getTime(); - fprintf(stdout, "%s: --(%d) (duration: %g sec)\n", msMsg.c_str(), line, (fEndTime-mfStartTime)); - } - -private: - double getTime() const - { - timeval tv; - gettimeofday(&tv, NULL); - return tv.tv_sec + tv.tv_usec / 1000000.0; - } - - ::std::string msMsg; - double mfStartTime; -}; - -} - -//namespace { -// -//class AppendAccessibleMenuItems : public ::std::unary_function -//{ -//public: -// explicit AppendAccessibleMenuItems(ScAccessibleFilterMenu* pAccMenu) : -// mnPos(0), mpAccMenu(pAccMenu) {} -// -// void operator() (const ScMenuFloatingWindow::MenuItem& rItem) -// { -// mpAccMenu->appendMenuItem(rItem.maText, rItem.mbEnabled, mnPos++); -// } -// -//private: -// size_t mnPos; -// ScAccessibleFilterMenu* mpAccMenu; -//}; -// -//} ScDPFieldButton::ScDPFieldButton(OutputDevice* pOutDev, const StyleSettings* pStyle, const Fraction* pZoomX, const Fraction* pZoomY) : mpOutDev(pOutDev), @@ -344,7 +280,7 @@ IMPL_LINK( ScMenuFloatingWindow::SubMenuItem, TimeoutHdl, void*, EMPTYARG ) // ---------------------------------------------------------------------------- -ScMenuFloatingWindow::ScMenuFloatingWindow(Window* pParent, ScDocument* pDoc) : +ScMenuFloatingWindow::ScMenuFloatingWindow(Window* pParent, ScDocument* pDoc, USHORT nMenuStackLevel) : FloatingWindow(pParent, (WB_SYSTEMFLOATWIN|WB_SYSTEMWINDOW|WB_NOBORDER)), maOpenTimer(this), maCloseTimer(this), @@ -356,7 +292,8 @@ ScMenuFloatingWindow::ScMenuFloatingWindow(Window* pParent, ScDocument* pDoc) : mpActiveSubMenu(NULL), mbActionFired(false) { - fprintf(stdout, "***** ScMenuFloatingWindow::ScMenuFloatingWindow: ctor (%p) parent = %p\n", this, pParent); + SetMenuStackLevel(nMenuStackLevel); + // TODO: How do we get the right font to use here ? const sal_uInt16 nPopupFontHeight = 12; const StyleSettings& rStyle = GetSettings().GetStyleSettings(); @@ -484,7 +421,6 @@ Reference ScMenuFloatingWindow::CreateAccessible() { if (!mxAccessible.is()) { - StackPrinter __stack_printer__("ScMenuFloatingWindow::CreateAccessible (create new)"); Reference xAccParent = mpParentMenu ? mpParentMenu->GetAccessible() : GetAccessibleParentWindow()->GetAccessible(); @@ -492,7 +428,6 @@ Reference ScMenuFloatingWindow::CreateAccessible() ScAccessibleFilterMenu* p = static_cast( mxAccessible.get()); -// for_each(maMenuItems.begin(), maMenuItems.end(), AppendAccessibleMenuItems(p)); vector::const_iterator itr, itrBeg = maMenuItems.begin(), itrEnd = maMenuItems.end(); for (itr = itrBeg; itr != itrEnd; ++itr) { @@ -518,7 +453,7 @@ ScMenuFloatingWindow* ScMenuFloatingWindow::addSubMenuItem(const OUString& rText MenuItem aItem; aItem.maText = rText; aItem.mbEnabled = bEnabled; - aItem.mpSubMenuWin.reset(new ScMenuFloatingWindow(this, mpDoc)); + aItem.mpSubMenuWin.reset(new ScMenuFloatingWindow(this, mpDoc, GetMenuStackLevel()+1)); aItem.mpSubMenuWin->setName(rText); maMenuItems.push_back(aItem); return aItem.mpSubMenuWin.get(); @@ -579,8 +514,6 @@ void ScMenuFloatingWindow::executeMenu(size_t nPos) void ScMenuFloatingWindow::setSelectedMenuItem(size_t nPos, bool bSubMenuTimer, bool bNotifyAccessible) { - StackPrinter __stack_printer__("******************** ScMenuFloatingWindow::setSelectedMenuItem ********************"); - fprintf(stdout, "ScMenuFloatingWindow::setSelectedMenuItem: pos = %d\n", nPos); if (mnSelectedMenu != nPos) { selectMenuItem(mnSelectedMenu, false, bSubMenuTimer, bNotifyAccessible); @@ -752,7 +685,6 @@ void ScMenuFloatingWindow::resizeToFitMenuItems() void ScMenuFloatingWindow::selectMenuItem(size_t nPos, bool bSelected, bool bSubMenuTimer, bool bNotifyAccessible) { - fprintf(stdout, "ScMenuFloatingWindow::selectMenuItem: pos = %d selected = %d\n", nPos, bSelected); if (nPos >= maMenuItems.size() || nPos == MENU_NOT_SELECTED) { queueCloseSubMenu(); diff --git a/sc/source/ui/inc/dpcontrol.hxx b/sc/source/ui/inc/dpcontrol.hxx index 72a7dc7a6970..0071be51fc9d 100644 --- a/sc/source/ui/inc/dpcontrol.hxx +++ b/sc/source/ui/inc/dpcontrol.hxx @@ -113,7 +113,7 @@ public: virtual void execute() = 0; }; - explicit ScMenuFloatingWindow(Window* pParent, ScDocument* pDoc); + explicit ScMenuFloatingWindow(Window* pParent, ScDocument* pDoc, USHORT nMenuStackLevel = 0); virtual ~ScMenuFloatingWindow(); virtual void MouseMove(const MouseEvent& rMEvt); -- cgit v1.2.3 From e50abfc572a020718f9460d7f836b2c514b377d0 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 21 Aug 2009 00:12:46 +0000 Subject: Let's not duplicate menu's selected state with the accessible object; we can easily query the Window instance for that. This also fixed a crasher when accessing menus from accerciser. --- sc/inc/AccessibleFilterMenu.hxx | 6 +- sc/inc/AccessibleFilterMenuItem.hxx | 2 - .../ui/Accessibility/AccessibleFilterMenu.cxx | 105 ++++++++++++--------- .../ui/Accessibility/AccessibleFilterMenuItem.cxx | 24 ++--- .../ui/Accessibility/AccessibleFilterTopWindow.cxx | 4 +- sc/source/ui/cctrl/dpcontrol.cxx | 34 +++---- sc/source/ui/inc/dpcontrol.hxx | 7 +- 7 files changed, 88 insertions(+), 94 deletions(-) diff --git a/sc/inc/AccessibleFilterMenu.hxx b/sc/inc/AccessibleFilterMenu.hxx index 1489f3bbdca1..9579e5213cb0 100644 --- a/sc/inc/AccessibleFilterMenu.hxx +++ b/sc/inc/AccessibleFilterMenu.hxx @@ -73,7 +73,7 @@ public: ScAccessibleFilterMenu( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible>& rxParent, - ScMenuFloatingWindow* pWin, const ::rtl::OUString& rName, ScDocument* pDoc); + ScMenuFloatingWindow* pWin, const ::rtl::OUString& rName, size_t nMenuPos, ScDocument* pDoc); virtual ~ScAccessibleFilterMenu(); // XAccessibleComponent @@ -166,9 +166,8 @@ public: // non-UNO methods - void selectMenuItem(size_t nIndex, bool bSelect); void appendMenuItem(const ::rtl::OUString& rName, bool bEnabled, size_t nMenuPos); - + void setMenuPos(size_t nMenuPos); void setEnabled(bool bEnabled); private: @@ -181,6 +180,7 @@ private: ::std::vector maMenuItems; ::std::set maStates; + size_t mnMenuPos; ScMenuFloatingWindow* mpWindow; ScDocument* mpDoc; diff --git a/sc/inc/AccessibleFilterMenuItem.hxx b/sc/inc/AccessibleFilterMenuItem.hxx index 740cfd4e30c9..2dc6f954114a 100644 --- a/sc/inc/AccessibleFilterMenuItem.hxx +++ b/sc/inc/AccessibleFilterMenuItem.hxx @@ -94,8 +94,6 @@ public: // Non-UNO Methods - void select(); - void unselect(); bool isSelected() const; void setEnabled(bool bEnabled); diff --git a/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx b/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx index bbc3ab91e450..3b2317b89515 100644 --- a/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx +++ b/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx @@ -70,28 +70,53 @@ using ::std::for_each; using ::std::vector; using ::std::set; -// ============================================================================ + +#include +#include +#include namespace { -class SelectMenuItem : public ::std::unary_function +class StackPrinter { public: - explicit SelectMenuItem(bool bSelect) : mbSelect(bSelect) {} + explicit StackPrinter(const char* msg) : + msMsg(msg) + { + fprintf(stdout, "%s: --begin\n", msMsg.c_str()); + mfStartTime = getTime(); + } - void operator() (ScAccessibleFilterMenu::MenuItem& rItem) const + ~StackPrinter() { - rItem.mbSelected = mbSelect; - ScAccessibleFilterMenuItem* p = static_cast(rItem.mxAccessible.get()); - if (mbSelect) - p->select(); - else - p->unselect(); + double fEndTime = getTime(); + fprintf(stdout, "%s: --end (duration: %g sec)\n", msMsg.c_str(), (fEndTime-mfStartTime)); + } + + void printTime(int line) const + { + double fEndTime = getTime(); + fprintf(stdout, "%s: --(%d) (duration: %g sec)\n", msMsg.c_str(), line, (fEndTime-mfStartTime)); } + private: - bool mbSelect; + double getTime() const + { + timeval tv; + gettimeofday(&tv, NULL); + return tv.tv_sec + tv.tv_usec / 1000000.0; + } + + ::std::string msMsg; + double mfStartTime; }; +} + +// ============================================================================ + +namespace { + class AddRemoveEventListener : public ::std::unary_function { public: @@ -143,29 +168,33 @@ private: // ============================================================================ ScAccessibleFilterMenu::MenuItem::MenuItem() : + mxAccessible(NULL), mbSelected(false) { } // ============================================================================ -ScAccessibleFilterMenu::ScAccessibleFilterMenu(const Reference& rxParent, ScMenuFloatingWindow* pWin, const OUString& rName, ScDocument* pDoc) : +ScAccessibleFilterMenu::ScAccessibleFilterMenu(const Reference& rxParent, ScMenuFloatingWindow* pWin, const OUString& rName, size_t nMenuPos, ScDocument* pDoc) : ScAccessibleContextBase(rxParent, AccessibleRole::MENU), + mnMenuPos(nMenuPos), mpWindow(pWin), mpDoc(pDoc), mbEnabled(true), mbSelected(false) { + fprintf(stdout, "ScAccessibleFilterMenu::ScAccessibleFilterMenu: ctor (%p)\n", this); SetName(rName); } ScAccessibleFilterMenu::~ScAccessibleFilterMenu() { + fprintf(stdout, "ScAccessibleFilterMenu::~ScAccessibleFilterMenu: dtor (%p)\n", this); } // XAccessibleComponent -Reference ScAccessibleFilterMenu::getAccessibleAtPoint( const ::com::sun::star::awt::Point& rPoint ) +Reference ScAccessibleFilterMenu::getAccessibleAtPoint( const ::com::sun::star::awt::Point& /*rPoint*/ ) throw (RuntimeException) { return this; @@ -209,7 +238,7 @@ sal_Int32 ScAccessibleFilterMenu::getAccessibleChildCount() Reference ScAccessibleFilterMenu::getAccessibleChild(sal_Int32 nIndex) throw (RuntimeException, IndexOutOfBoundsException) { - if (maMenuItems.size() <= nIndex) + if (maMenuItems.size() <= static_cast(nIndex)) throw IndexOutOfBoundsException(); return maMenuItems[nIndex].mxAccessible; @@ -295,17 +324,17 @@ Sequence ScAccessibleFilterMenu::getStates() throw (RuntimeException) void ScAccessibleFilterMenu::selectAccessibleChild(sal_Int32 nChildIndex) throw (IndexOutOfBoundsException, RuntimeException) { - if (nChildIndex >= maMenuItems.size()) + if (static_cast(nChildIndex) >= maMenuItems.size()) throw IndexOutOfBoundsException(); maMenuItems[nChildIndex].mbSelected = true; - mpWindow->setSelectedMenuItem(nChildIndex, false, false); + mpWindow->setSelectedMenuItem(nChildIndex, false); } sal_Bool ScAccessibleFilterMenu::isAccessibleChildSelected(sal_Int32 nChildIndex) throw (IndexOutOfBoundsException, RuntimeException) { - if (nChildIndex >= maMenuItems.size()) + if (static_cast(nChildIndex) >= maMenuItems.size()) throw IndexOutOfBoundsException(); return maMenuItems[nChildIndex].mbSelected; @@ -313,8 +342,7 @@ sal_Bool ScAccessibleFilterMenu::isAccessibleChildSelected(sal_Int32 nChildIndex void ScAccessibleFilterMenu::clearAccessibleSelection() throw (RuntimeException) { - for_each(maMenuItems.begin(), maMenuItems.end(), SelectMenuItem(false)); - mpWindow->clearSelectedMenuItem(false); + mpWindow->clearSelectedMenuItem(); } void ScAccessibleFilterMenu::selectAllAccessibleChildren() throw (RuntimeException) @@ -342,12 +370,7 @@ void ScAccessibleFilterMenu::deselectAccessibleChild(sal_Int32 nChildIndex) thro if (static_cast(nChildIndex) >= maMenuItems.size()) throw IndexOutOfBoundsException(); - maMenuItems[nChildIndex].mbSelected = false; - ScAccessibleFilterMenuItem* p = static_cast( - maMenuItems[nChildIndex].mxAccessible.get()); - p->unselect(); - - mpWindow->selectMenuItem(nChildIndex, false, false, false); + mpWindow->selectMenuItem(nChildIndex, false, false); } // XInterface @@ -381,28 +404,9 @@ Sequence ScAccessibleFilterMenu::getImplementationId() return aId; } -void ScAccessibleFilterMenu::selectMenuItem(size_t nIndex, bool bSelect) -{ - if (maMenuItems.size() <= nIndex) - return; - - AccessibleEventObject aEvent; - aEvent.EventId = AccessibleEventId::SELECTION_CHANGED; - CommitChange(aEvent); - - maMenuItems[nIndex].mbSelected = bSelect; - ScAccessibleFilterMenuItem* p = static_cast( - maMenuItems[nIndex].mxAccessible.get()); - if (bSelect) - p->select(); - else - p->unselect(); - - isSelected(); -} - void ScAccessibleFilterMenu::appendMenuItem(const OUString& rName, bool bEnabled, size_t nMenuPos) { +// StackPrinter __stack_printer__("ScAccessibleFilterMenu::appendMenuItem"); // Check weather this menu item is a sub menu or a regular menu item. ScMenuFloatingWindow* pSubMenu = mpWindow->getSubMenuWindow(nMenuPos); MenuItem aItem; @@ -412,6 +416,7 @@ void ScAccessibleFilterMenu::appendMenuItem(const OUString& rName, bool bEnabled ScAccessibleFilterMenu* p = static_cast( aItem.mxAccessible.get()); p->setEnabled(bEnabled); + p->setMenuPos(nMenuPos); } else { @@ -423,6 +428,11 @@ void ScAccessibleFilterMenu::appendMenuItem(const OUString& rName, bool bEnabled maMenuItems.push_back(aItem); } +void ScAccessibleFilterMenu::setMenuPos(size_t nMenuPos) +{ + mnMenuPos = nMenuPos; +} + void ScAccessibleFilterMenu::setEnabled(bool bEnabled) { mbEnabled = bEnabled; @@ -436,8 +446,9 @@ bool ScAccessibleFilterMenu::isFocused() bool ScAccessibleFilterMenu::isSelected() { // Check to see if any of the child menu items is selected. - size_t nSelectCount = for_each(maMenuItems.begin(), maMenuItems.end(), CountSelectedMenuItem()).getCount(); - return nSelectCount == 0; +// size_t nSelectCount = for_each(maMenuItems.begin(), maMenuItems.end(), CountSelectedMenuItem()).getCount(); +// return nSelectCount == 0; + return mpWindow->isMenuItemSelected(mnMenuPos); } void ScAccessibleFilterMenu::updateStates() diff --git a/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx b/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx index 45197df153ef..414169854dc6 100644 --- a/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx +++ b/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx @@ -65,11 +65,13 @@ ScAccessibleFilterMenuItem::ScAccessibleFilterMenuItem( mbSelected(false), mbEnabled(true) { + fprintf(stdout, "ScAccessibleFilterMenuItem::ScAccessibleFilterMenuItem: ctor (%p)\n", this); SetName(rName); } ScAccessibleFilterMenuItem::~ScAccessibleFilterMenuItem() { + fprintf(stdout, "ScAccessibleFilterMenuItem::~ScAccessibleFilterMenuItem: dtor (%p)\n", this); } sal_Int32 ScAccessibleFilterMenuItem::getAccessibleChildCount() @@ -78,7 +80,7 @@ sal_Int32 ScAccessibleFilterMenuItem::getAccessibleChildCount() return 0; } -Reference ScAccessibleFilterMenuItem::getAccessibleChild(sal_Int32 nIndex) +Reference ScAccessibleFilterMenuItem::getAccessibleChild(sal_Int32 /*nIndex*/) throw (RuntimeException, IndexOutOfBoundsException) { throw IndexOutOfBoundsException(); @@ -197,20 +199,20 @@ sal_Int32 ScAccessibleFilterMenuItem::getAccessibleActionCount() throw (RuntimeE return 1; } -sal_Bool ScAccessibleFilterMenuItem::doAccessibleAction(sal_Int32 nIndex) +sal_Bool ScAccessibleFilterMenuItem::doAccessibleAction(sal_Int32 /*nIndex*/) throw (IndexOutOfBoundsException, RuntimeException) { return false; } -OUString ScAccessibleFilterMenuItem::getAccessibleActionDescription(sal_Int32 nIndex) +OUString ScAccessibleFilterMenuItem::getAccessibleActionDescription(sal_Int32 /*nIndex*/) throw (IndexOutOfBoundsException, RuntimeException) { return OUString::createFromAscii("Add some action here..."); } Reference ScAccessibleFilterMenuItem::getAccessibleActionKeyBinding( - sal_Int32 nIndex) throw (IndexOutOfBoundsException, RuntimeException) + sal_Int32 /*nIndex*/) throw (IndexOutOfBoundsException, RuntimeException) { return Reference(); } @@ -235,21 +237,9 @@ void SAL_CALL ScAccessibleFilterMenuItem::release() throw () ScAccessibleContextBase::release(); } -void ScAccessibleFilterMenuItem::select() -{ - mbSelected = true; - CommitFocusGained(); -} - -void ScAccessibleFilterMenuItem::unselect() -{ - mbSelected = false; - CommitFocusLost(); -} - bool ScAccessibleFilterMenuItem::isSelected() const { - return mbSelected; + return mpWindow->isMenuItemSelected(mnMenuPos); } void ScAccessibleFilterMenuItem::setEnabled(bool bEnabled) diff --git a/sc/source/ui/Accessibility/AccessibleFilterTopWindow.cxx b/sc/source/ui/Accessibility/AccessibleFilterTopWindow.cxx index 3e8ab00427b0..02fafd87e138 100644 --- a/sc/source/ui/Accessibility/AccessibleFilterTopWindow.cxx +++ b/sc/source/ui/Accessibility/AccessibleFilterTopWindow.cxx @@ -50,11 +50,13 @@ ScAccessibleFilterTopWindow::ScAccessibleFilterTopWindow( mpWindow(pWin), mpDoc(pDoc) { + fprintf(stdout, "ScAccessibleFilterTopWindow::ScAccessibleFilterTopWindow: ctor (%p)\n", this); SetName(rName); } ScAccessibleFilterTopWindow::~ScAccessibleFilterTopWindow() { + fprintf(stdout, "ScAccessibleFilterTopWindow::~ScAccessibleFilterTopWindow: dtor (%p)\n", this); } // XAccessibleContext @@ -101,7 +103,7 @@ OUString ScAccessibleFilterTopWindow::getImplementationName() throw (RuntimeExce Reference ScAccessibleFilterTopWindow::getAccessibleChildMenu() { if (!mxAccMenu.is()) - mxAccMenu.set(new ScAccessibleFilterMenu(this, mpWindow, getAccessibleName(), mpDoc)); + mxAccMenu.set(new ScAccessibleFilterMenu(this, mpWindow, getAccessibleName(), 999, mpDoc)); return mxAccMenu; } diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index 685ead25b47e..541d573f4e23 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -424,7 +424,7 @@ Reference ScMenuFloatingWindow::CreateAccessible() Reference xAccParent = mpParentMenu ? mpParentMenu->GetAccessible() : GetAccessibleParentWindow()->GetAccessible(); - mxAccessible.set(new ScAccessibleFilterMenu(xAccParent, this, maName, getDoc())); + mxAccessible.set(new ScAccessibleFilterMenu(xAccParent, this, maName, 999, getDoc())); ScAccessibleFilterMenu* p = static_cast( mxAccessible.get()); @@ -512,12 +512,12 @@ void ScMenuFloatingWindow::executeMenu(size_t nPos) EndPopupMode(); } -void ScMenuFloatingWindow::setSelectedMenuItem(size_t nPos, bool bSubMenuTimer, bool bNotifyAccessible) +void ScMenuFloatingWindow::setSelectedMenuItem(size_t nPos, bool bSubMenuTimer) { if (mnSelectedMenu != nPos) { - selectMenuItem(mnSelectedMenu, false, bSubMenuTimer, bNotifyAccessible); - selectMenuItem(nPos, true, bSubMenuTimer, bNotifyAccessible); + selectMenuItem(mnSelectedMenu, false, bSubMenuTimer); + selectMenuItem(nPos, true, bSubMenuTimer); mnSelectedMenu = nPos; } } @@ -661,7 +661,7 @@ void ScMenuFloatingWindow::resetMenu(bool bSetMenuPos) { resizeToFitMenuItems(); if (bSetMenuPos) - setSelectedMenuItem(0, false, true); + setSelectedMenuItem(0, false); } void ScMenuFloatingWindow::resizeToFitMenuItems() @@ -683,7 +683,7 @@ void ScMenuFloatingWindow::resizeToFitMenuItems() SetOutputSizePixel(Size(aPos.X(), aPos.Y())); } -void ScMenuFloatingWindow::selectMenuItem(size_t nPos, bool bSelected, bool bSubMenuTimer, bool bNotifyAccessible) +void ScMenuFloatingWindow::selectMenuItem(size_t nPos, bool bSelected, bool bSubMenuTimer) { if (nPos >= maMenuItems.size() || nPos == MENU_NOT_SELECTED) { @@ -715,24 +715,11 @@ void ScMenuFloatingWindow::selectMenuItem(size_t nPos, bool bSelected, bool bSub queueCloseSubMenu(); } } - - if (bNotifyAccessible && mxAccessible.is()) - { - ScAccessibleFilterMenu* p = static_cast(mxAccessible.get()); - p->selectMenuItem(nPos, bSelected); - } } -void ScMenuFloatingWindow::clearSelectedMenuItem(bool bNotifyAccessible) +void ScMenuFloatingWindow::clearSelectedMenuItem() { - selectMenuItem(mnSelectedMenu, false, false, bNotifyAccessible); - - if (bNotifyAccessible && mxAccessible.is()) - { - ScAccessibleFilterMenu* p = static_cast(mxAccessible.get()); - p->selectMenuItem(mnSelectedMenu, false); - } - + selectMenuItem(mnSelectedMenu, false, false); mnSelectedMenu = MENU_NOT_SELECTED; } @@ -765,6 +752,11 @@ bool ScMenuFloatingWindow::isMenuItemEnabled(size_t nPos) const return maMenuItems[nPos].mbEnabled; } +bool ScMenuFloatingWindow::isMenuItemSelected(size_t nPos) const +{ + return nPos == mnSelectedMenu; +} + void ScMenuFloatingWindow::setName(const OUString& rName) { maName = rName; diff --git a/sc/source/ui/inc/dpcontrol.hxx b/sc/source/ui/inc/dpcontrol.hxx index 0071be51fc9d..1e980a778434 100644 --- a/sc/source/ui/inc/dpcontrol.hxx +++ b/sc/source/ui/inc/dpcontrol.hxx @@ -125,13 +125,14 @@ public: void addMenuItem(const ::rtl::OUString& rText, bool bEnabled, Action* pAction); ScMenuFloatingWindow* addSubMenuItem(const ::rtl::OUString& rText, bool bEnabled); - void setSelectedMenuItem(size_t nPos, bool bSubMenuTimer = true, bool bNotifyAccessible = true); - void selectMenuItem(size_t nPos, bool bSelected, bool bSubMenuTimer, bool bNotifyAccessible); - void clearSelectedMenuItem(bool bNotifyAccessible); + void setSelectedMenuItem(size_t nPos, bool bSubMenuTimer = true); + void selectMenuItem(size_t nPos, bool bSelected, bool bSubMenuTimer); + void clearSelectedMenuItem(); ScMenuFloatingWindow* getSubMenuWindow(size_t nPos) const; size_t getMenuItemCount() const; ::rtl::OUString getMenuItemName(size_t nPos) const; bool isMenuItemEnabled(size_t nPos) const; + bool isMenuItemSelected(size_t nPos) const; void setName(const ::rtl::OUString& rName); const ::rtl::OUString& getName() const; -- cgit v1.2.3 From 26d3db0ac1f3ba939716388cb881ae65ba4cb9e6 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 21 Aug 2009 00:23:14 +0000 Subject: removed debug statements & more dynamic type checking (this will be replaced later). --- sc/inc/AccessibleFilterMenu.hxx | 2 +- .../ui/Accessibility/AccessibleFilterMenu.cxx | 60 +++++----------------- 2 files changed, 14 insertions(+), 48 deletions(-) diff --git a/sc/inc/AccessibleFilterMenu.hxx b/sc/inc/AccessibleFilterMenu.hxx index 9579e5213cb0..cec3b1b8b8e9 100644 --- a/sc/inc/AccessibleFilterMenu.hxx +++ b/sc/inc/AccessibleFilterMenu.hxx @@ -169,10 +169,10 @@ public: void appendMenuItem(const ::rtl::OUString& rName, bool bEnabled, size_t nMenuPos); void setMenuPos(size_t nMenuPos); void setEnabled(bool bEnabled); + bool isSelected(); private: bool isFocused(); - bool isSelected(); void updateStates(); diff --git a/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx b/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx index 3b2317b89515..4f4dd494da18 100644 --- a/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx +++ b/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx @@ -70,49 +70,6 @@ using ::std::for_each; using ::std::vector; using ::std::set; - -#include -#include -#include - -namespace { - -class StackPrinter -{ -public: - explicit StackPrinter(const char* msg) : - msMsg(msg) - { - fprintf(stdout, "%s: --begin\n", msMsg.c_str()); - mfStartTime = getTime(); - } - - ~StackPrinter() - { - double fEndTime = getTime(); - fprintf(stdout, "%s: --end (duration: %g sec)\n", msMsg.c_str(), (fEndTime-mfStartTime)); - } - - void printTime(int line) const - { - double fEndTime = getTime(); - fprintf(stdout, "%s: --(%d) (duration: %g sec)\n", msMsg.c_str(), line, (fEndTime-mfStartTime)); - } - -private: - double getTime() const - { - timeval tv; - gettimeofday(&tv, NULL); - return tv.tv_sec + tv.tv_usec / 1000000.0; - } - - ::std::string msMsg; - double mfStartTime; -}; - -} - // ============================================================================ namespace { @@ -152,9 +109,19 @@ public: void operator() (ScAccessibleFilterMenu::MenuItem& rItem) { - ScAccessibleFilterMenuItem* p = static_cast(rItem.mxAccessible.get()); - if (p->isSelected()) - ++mnCount; + { + ScAccessibleFilterMenuItem* p = dynamic_cast( + rItem.mxAccessible.get()); + if (p && p->isSelected()) + ++mnCount; + } + + { + ScAccessibleFilterMenu* p = dynamic_cast( + rItem.mxAccessible.get()); + if (p && p->isSelected()) + ++mnCount; + } } size_t getCount() const { return mnCount; } @@ -406,7 +373,6 @@ Sequence ScAccessibleFilterMenu::getImplementationId() void ScAccessibleFilterMenu::appendMenuItem(const OUString& rName, bool bEnabled, size_t nMenuPos) { -// StackPrinter __stack_printer__("ScAccessibleFilterMenu::appendMenuItem"); // Check weather this menu item is a sub menu or a regular menu item. ScMenuFloatingWindow* pSubMenu = mpWindow->getSubMenuWindow(nMenuPos); MenuItem aItem; -- cgit v1.2.3 From 656fd381e17fa494a678ce2b1306251d649eab3d Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 21 Aug 2009 00:35:37 +0000 Subject: Broke long method declarations into several lines. --- sc/inc/AccessibleFilterMenu.hxx | 37 ++++++++++++++++++++++++++---------- sc/inc/AccessibleFilterMenuItem.hxx | 38 ++++++++++++++++++++++++++++--------- 2 files changed, 56 insertions(+), 19 deletions(-) diff --git a/sc/inc/AccessibleFilterMenu.hxx b/sc/inc/AccessibleFilterMenu.hxx index cec3b1b8b8e9..12faa7e848e3 100644 --- a/sc/inc/AccessibleFilterMenu.hxx +++ b/sc/inc/AccessibleFilterMenu.hxx @@ -131,24 +131,41 @@ public: // XAccessibleStateSet - virtual ::sal_Bool SAL_CALL isEmpty() throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Bool SAL_CALL contains(sal_Int16 nState) throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Bool SAL_CALL containsAll(const ::com::sun::star::uno::Sequence< ::sal_Int16 >& aStateSet) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence SAL_CALL getStates() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL isEmpty() throw (::com::sun::star::uno::RuntimeException); + + virtual sal_Bool SAL_CALL contains(sal_Int16 nState) + throw (::com::sun::star::uno::RuntimeException); + + virtual sal_Bool SAL_CALL containsAll( + const ::com::sun::star::uno::Sequence& aStateSet) + throw (::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Sequence SAL_CALL getStates() + throw (::com::sun::star::uno::RuntimeException); // XAccessibleSelection - virtual void SAL_CALL selectAccessibleChild( ::sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); - virtual ::sal_Bool SAL_CALL isAccessibleChildSelected( ::sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL clearAccessibleSelection( ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL selectAllAccessibleChildren( ) throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL selectAccessibleChild(sal_Int32 nChildIndex) + throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + + virtual sal_Bool SAL_CALL isAccessibleChildSelected(sal_Int32 nChildIndex) + throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL clearAccessibleSelection() + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL selectAllAccessibleChildren() + throw (::com::sun::star::uno::RuntimeException); + + virtual ::sal_Int32 SAL_CALL getSelectedAccessibleChildCount() + throw (::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild(sal_Int32 nChildIndex) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL deselectAccessibleChild( ::sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL deselectAccessibleChild(sal_Int32 nChildIndex) + throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); // XInterface diff --git a/sc/inc/AccessibleFilterMenuItem.hxx b/sc/inc/AccessibleFilterMenuItem.hxx index 2dc6f954114a..d4434da5f937 100644 --- a/sc/inc/AccessibleFilterMenuItem.hxx +++ b/sc/inc/AccessibleFilterMenuItem.hxx @@ -59,7 +59,8 @@ public: virtual sal_Int32 SAL_CALL getAccessibleChildCount() throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> SAL_CALL + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int32 nIndex) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IndexOutOfBoundsException); @@ -73,17 +74,36 @@ public: // XAccessibleStateSet - virtual ::sal_Bool SAL_CALL isEmpty() throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Bool SAL_CALL contains(sal_Int16 nState) throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Bool SAL_CALL containsAll(const ::com::sun::star::uno::Sequence< ::sal_Int16 >& aStateSet) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence SAL_CALL getStates() throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL isEmpty() + throw (::com::sun::star::uno::RuntimeException); + + virtual ::sal_Bool SAL_CALL contains(sal_Int16 nState) + throw (::com::sun::star::uno::RuntimeException); + + virtual ::sal_Bool SAL_CALL containsAll( + const ::com::sun::star::uno::Sequence& aStateSet) + throw (::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Sequence SAL_CALL getStates() + throw (::com::sun::star::uno::RuntimeException); // XAccessibleAction - virtual ::sal_Int32 SAL_CALL getAccessibleActionCount( ) throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Bool SAL_CALL doAccessibleAction( ::sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); - virtual ::rtl::OUString SAL_CALL getAccessibleActionDescription( ::sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding( ::sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::sal_Int32 SAL_CALL getAccessibleActionCount() + throw (::com::sun::star::uno::RuntimeException); + + virtual ::sal_Bool SAL_CALL doAccessibleAction(sal_Int32 nIndex) + throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + + virtual ::rtl::OUString SAL_CALL getAccessibleActionDescription(sal_Int32 nIndex) + throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::accessibility::XAccessibleKeyBinding > SAL_CALL + getAccessibleActionKeyBinding(sal_Int32 nIndex) + throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + + // XInterface virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( ::com::sun::star::uno::Type const & rType ) -- cgit v1.2.3 From 4d56fc68ec3803dc6d009acaacd975f83384d5f8 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 21 Aug 2009 01:19:38 +0000 Subject: renamed structs. --- sc/source/ui/cctrl/dpcontrol.cxx | 24 ++++++++++++------------ sc/source/ui/inc/dpcontrol.hxx | 28 +++++++++++++++++++--------- 2 files changed, 31 insertions(+), 21 deletions(-) diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index 541d573f4e23..17f75371a306 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -247,7 +247,7 @@ void ScDPFieldButton::drawPopupButton() // ============================================================================ -ScMenuFloatingWindow::MenuItem::MenuItem() : +ScMenuFloatingWindow::MenuItemData::MenuItemData() : mbEnabled(true), mpAction(static_cast(NULL)), mpSubMenuWin(static_cast(NULL)) @@ -256,23 +256,23 @@ ScMenuFloatingWindow::MenuItem::MenuItem() : // ---------------------------------------------------------------------------- -ScMenuFloatingWindow::SubMenuItem::SubMenuItem(ScMenuFloatingWindow* pParent) : +ScMenuFloatingWindow::SubMenuItemData::SubMenuItemData(ScMenuFloatingWindow* pParent) : mpSubMenu(NULL), mnMenuPos(MENU_NOT_SELECTED), mpParent(pParent) { - maTimer.SetTimeoutHdl( LINK(this, ScMenuFloatingWindow::SubMenuItem, TimeoutHdl) ); + maTimer.SetTimeoutHdl( LINK(this, ScMenuFloatingWindow::SubMenuItemData, TimeoutHdl) ); maTimer.SetTimeout(mpParent->GetSettings().GetMouseSettings().GetMenuDelay()); } -void ScMenuFloatingWindow::SubMenuItem::reset() +void ScMenuFloatingWindow::SubMenuItemData::reset() { mpSubMenu = NULL; mnMenuPos = MENU_NOT_SELECTED; maTimer.Stop(); } -IMPL_LINK( ScMenuFloatingWindow::SubMenuItem, TimeoutHdl, void*, EMPTYARG ) +IMPL_LINK( ScMenuFloatingWindow::SubMenuItemData, TimeoutHdl, void*, EMPTYARG ) { mpParent->handleMenuTimeout(this); return 0; @@ -364,7 +364,7 @@ void ScMenuFloatingWindow::KeyInput(const KeyEvent& rKEvt) if (mnSelectedMenu >= maMenuItems.size() || mnSelectedMenu == MENU_NOT_SELECTED) break; - const MenuItem& rMenu = maMenuItems[mnSelectedMenu]; + const MenuItemData& rMenu = maMenuItems[mnSelectedMenu]; if (!rMenu.mbEnabled || !rMenu.mpSubMenuWin) break; @@ -428,7 +428,7 @@ Reference ScMenuFloatingWindow::CreateAccessible() ScAccessibleFilterMenu* p = static_cast( mxAccessible.get()); - vector::const_iterator itr, itrBeg = maMenuItems.begin(), itrEnd = maMenuItems.end(); + vector::const_iterator itr, itrBeg = maMenuItems.begin(), itrEnd = maMenuItems.end(); for (itr = itrBeg; itr != itrEnd; ++itr) { size_t nPos = ::std::distance(itrBeg, itr); @@ -441,7 +441,7 @@ Reference ScMenuFloatingWindow::CreateAccessible() void ScMenuFloatingWindow::addMenuItem(const OUString& rText, bool bEnabled, Action* pAction) { - MenuItem aItem; + MenuItemData aItem; aItem.maText = rText; aItem.mbEnabled = bEnabled; aItem.mpAction.reset(pAction); @@ -450,7 +450,7 @@ void ScMenuFloatingWindow::addMenuItem(const OUString& rText, bool bEnabled, Act ScMenuFloatingWindow* ScMenuFloatingWindow::addSubMenuItem(const OUString& rText, bool bEnabled) { - MenuItem aItem; + MenuItemData aItem; aItem.maText = rText; aItem.mbEnabled = bEnabled; aItem.mpSubMenuWin.reset(new ScMenuFloatingWindow(this, mpDoc, GetMenuStackLevel()+1)); @@ -527,7 +527,7 @@ size_t ScMenuFloatingWindow::getSelectedMenuPos() const return mnSelectedMenu; } -void ScMenuFloatingWindow::handleMenuTimeout(SubMenuItem* pTimer) +void ScMenuFloatingWindow::handleMenuTimeout(SubMenuItemData* pTimer) { if (pTimer == &maOpenTimer) { @@ -626,7 +626,7 @@ void ScMenuFloatingWindow::endSubMenu() void ScMenuFloatingWindow::fillMenuItemsToAccessible(ScAccessibleFilterMenu* pAccMenu) const { - vector::const_iterator itr, itrBeg = maMenuItems.begin(), itrEnd = maMenuItems.end(); + vector::const_iterator itr, itrBeg = maMenuItems.begin(), itrEnd = maMenuItems.end(); for (itr = itrBeg; itr != itrEnd; ++itr) { size_t nPos = ::std::distance(itrBeg, itr); @@ -669,7 +669,7 @@ void ScMenuFloatingWindow::resizeToFitMenuItems() if (maMenuItems.empty()) return; - vector::const_iterator itr = maMenuItems.begin(), itrEnd = maMenuItems.end(); + vector::const_iterator itr = maMenuItems.begin(), itrEnd = maMenuItems.end(); long nTextWidth = 0; for (; itr != itrEnd; ++itr) nTextWidth = ::std::max(GetTextWidth(itr->maText), nTextWidth); diff --git a/sc/source/ui/inc/dpcontrol.hxx b/sc/source/ui/inc/dpcontrol.hxx index 1e980a778434..bc131ae1c113 100644 --- a/sc/source/ui/inc/dpcontrol.hxx +++ b/sc/source/ui/inc/dpcontrol.hxx @@ -113,6 +113,16 @@ public: virtual void execute() = 0; }; + class MenuItem : public Window + { + public: + explicit MenuItem(Window* pParent); + + private: + bool mbSelected:1; + bool mbEnabled:1; + }; + explicit ScMenuFloatingWindow(Window* pParent, ScDocument* pDoc, USHORT nMenuStackLevel = 0); virtual ~ScMenuFloatingWindow(); @@ -159,8 +169,8 @@ protected: ::com::sun::star::accessibility::XAccessible > mxAccessible; private: - struct SubMenuItem; - void handleMenuTimeout(SubMenuItem* pTimer); + struct SubMenuItemData; + void handleMenuTimeout(SubMenuItemData* pTimer); enum NotificationType { SUBMENU_FOCUSED }; void notify(NotificationType eType); @@ -176,7 +186,7 @@ private: private: - struct MenuItem + struct MenuItemData { ::rtl::OUString maText; bool mbEnabled; @@ -184,12 +194,12 @@ private: ::boost::shared_ptr mpAction; ::boost::shared_ptr mpSubMenuWin; - MenuItem(); + MenuItemData(); }; - ::std::vector maMenuItems; + ::std::vector maMenuItems; - struct SubMenuItem + struct SubMenuItemData { Timer maTimer; ScMenuFloatingWindow* mpSubMenu; @@ -197,14 +207,14 @@ private: DECL_LINK( TimeoutHdl, void* ); - SubMenuItem(ScMenuFloatingWindow* pParent); + SubMenuItemData(ScMenuFloatingWindow* pParent); void reset(); private: ScMenuFloatingWindow* mpParent; }; - SubMenuItem maOpenTimer; - SubMenuItem maCloseTimer; + SubMenuItemData maOpenTimer; + SubMenuItemData maCloseTimer; Font maLabelFont; -- cgit v1.2.3 From 703de85908f24676c44a58b27644601edd4e357b Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 21 Aug 2009 04:29:45 +0000 Subject: remove the MenuItem class declaration - it was a wrong idea. --- sc/source/ui/inc/dpcontrol.hxx | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/sc/source/ui/inc/dpcontrol.hxx b/sc/source/ui/inc/dpcontrol.hxx index bc131ae1c113..1c57089bf073 100644 --- a/sc/source/ui/inc/dpcontrol.hxx +++ b/sc/source/ui/inc/dpcontrol.hxx @@ -113,16 +113,6 @@ public: virtual void execute() = 0; }; - class MenuItem : public Window - { - public: - explicit MenuItem(Window* pParent); - - private: - bool mbSelected:1; - bool mbEnabled:1; - }; - explicit ScMenuFloatingWindow(Window* pParent, ScDocument* pDoc, USHORT nMenuStackLevel = 0); virtual ~ScMenuFloatingWindow(); -- cgit v1.2.3 From 4ac8aba5a707967c29fc19edeaf8aedc70b63097 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 21 Aug 2009 18:34:11 +0000 Subject: Ensure correct menu hierarchy when selecting an arbitrary menu item from the accessible object. --- .../ui/Accessibility/AccessibleFilterMenu.cxx | 2 +- sc/source/ui/cctrl/dpcontrol.cxx | 178 +++++++++++++++++---- sc/source/ui/inc/dpcontrol.hxx | 27 +++- 3 files changed, 166 insertions(+), 41 deletions(-) diff --git a/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx b/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx index 4f4dd494da18..c9342c4ec1c1 100644 --- a/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx +++ b/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx @@ -295,7 +295,7 @@ void ScAccessibleFilterMenu::selectAccessibleChild(sal_Int32 nChildIndex) throw IndexOutOfBoundsException(); maMenuItems[nChildIndex].mbSelected = true; - mpWindow->setSelectedMenuItem(nChildIndex, false); + mpWindow->setSelectedMenuItem(nChildIndex, false, true); } sal_Bool ScAccessibleFilterMenu::isAccessibleChildSelected(sal_Int32 nChildIndex) diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index 17f75371a306..10cec6fff069 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -58,6 +58,49 @@ using ::std::vector; using ::std::hash_map; using ::std::auto_ptr; + +#include +#include +#include + +namespace { + +class StackPrinter +{ +public: + explicit StackPrinter(const char* msg) : + msMsg(msg) + { + fprintf(stdout, "%s: --begin\n", msMsg.c_str()); + mfStartTime = getTime(); + } + + ~StackPrinter() + { + double fEndTime = getTime(); + fprintf(stdout, "%s: --end (duration: %g sec)\n", msMsg.c_str(), (fEndTime-mfStartTime)); + } + + void printTime(int line) const + { + double fEndTime = getTime(); + fprintf(stdout, "%s: --(%d) (duration: %g sec)\n", msMsg.c_str(), line, (fEndTime-mfStartTime)); + } + +private: + double getTime() const + { + timeval tv; + gettimeofday(&tv, NULL); + return tv.tv_sec + tv.tv_usec / 1000000.0; + } + + ::std::string msMsg; + double mfStartTime; +}; + +} + ScDPFieldButton::ScDPFieldButton(OutputDevice* pOutDev, const StyleSettings* pStyle, const Fraction* pZoomX, const Fraction* pZoomY) : mpOutDev(pOutDev), mpStyle(pStyle), @@ -314,7 +357,7 @@ void ScMenuFloatingWindow::MouseMove(const MouseEvent& rMEvt) { const Point& rPos = rMEvt.GetPosPixel(); size_t nSelectedMenu = getEnclosingMenuItem(rPos); - setSelectedMenuItem(nSelectedMenu); + setSelectedMenuItem(nSelectedMenu, true, false); Window::MouseMove(rMEvt); } @@ -346,14 +389,14 @@ void ScMenuFloatingWindow::KeyInput(const KeyEvent& rKEvt) nSelectedMenu = nLastMenuPos; else --nSelectedMenu; - setSelectedMenuItem(nSelectedMenu, false); + setSelectedMenuItem(nSelectedMenu, false, false); break; case KEY_DOWN: if (nSelectedMenu == MENU_NOT_SELECTED || nSelectedMenu == nLastMenuPos) nSelectedMenu = 0; else ++nSelectedMenu; - setSelectedMenuItem(nSelectedMenu, false); + setSelectedMenuItem(nSelectedMenu, false, false); break; case KEY_LEFT: if (mpParentMenu) @@ -512,14 +555,35 @@ void ScMenuFloatingWindow::executeMenu(size_t nPos) EndPopupMode(); } -void ScMenuFloatingWindow::setSelectedMenuItem(size_t nPos, bool bSubMenuTimer) +void ScMenuFloatingWindow::setSelectedMenuItem(size_t nPos, bool bSubMenuTimer, bool bEnsureSubMenu) { - if (mnSelectedMenu != nPos) + StackPrinter __stack_printer__("ScMenuFloatingWindow::setSelectedMenuItem"); + if (mnSelectedMenu == nPos) + // nothing to do. + return; + + if (bEnsureSubMenu) { - selectMenuItem(mnSelectedMenu, false, bSubMenuTimer); - selectMenuItem(nPos, true, bSubMenuTimer); - mnSelectedMenu = nPos; + fprintf(stdout, "ScMenuFloatingWindow::setSelectedMenuItem: (ensuring...) selected menu = %d\n", mnSelectedMenu); + // Dismiss any child popup menu windows. + if (mnSelectedMenu < maMenuItems.size() && + maMenuItems[mnSelectedMenu].mpSubMenuWin && + maMenuItems[mnSelectedMenu].mpSubMenuWin->IsVisible()) + { + maMenuItems[mnSelectedMenu].mpSubMenuWin->ensureSubMenuNotVisible(); + } + + // The popup is not visible, yet a menu item is selected. The request + // most likely comes from the accessible object. Make sure this + // window, as well as all its parent windows are visible. + if (!IsVisible() && mpParentMenu) + mpParentMenu->ensureSubMenuVisible(this); } + + selectMenuItem(mnSelectedMenu, false, bSubMenuTimer); + selectMenuItem(nPos, true, bSubMenuTimer); + mnSelectedMenu = nPos; + fprintf(stdout, "ScMenuFloatingWindow::setSelectedMenuItem: selected menu = %d\n", mnSelectedMenu); } size_t ScMenuFloatingWindow::getSelectedMenuPos() const @@ -607,10 +671,12 @@ void ScMenuFloatingWindow::launchSubMenu(bool bSetMenuPos) sal_uInt32 nOldFlags = GetPopupModeFlags(); SetPopupModeFlags(nOldFlags | FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE); - pSubMenu->resetMenu(bSetMenuPos); + pSubMenu->resizeToFitMenuItems(); // set the size before launching the popup to get it positioned correctly. pSubMenu->StartPopupMode( Rectangle(aPos,aSize), (FLOATWIN_POPUPMODE_RIGHT | FLOATWIN_POPUPMODE_GRABFOCUS)); pSubMenu->AddPopupModeWindow(this); + if (bSetMenuPos) + pSubMenu->setSelectedMenuItem(0, false, false); // select menu item after the popup becomes fully visible. SetPopupModeFlags(nOldFlags); } @@ -639,31 +705,6 @@ ScDocument* ScMenuFloatingWindow::getDoc() return mpDoc; } -void ScMenuFloatingWindow::notify(NotificationType eType) -{ - switch (eType) - { - case SUBMENU_FOCUSED: - // Cancel any request for ending submenu. - maCloseTimer.reset(); - if (mnSelectedMenu != maOpenTimer.mnMenuPos) - { - highlightMenuItem(maOpenTimer.mnMenuPos, true); - mnSelectedMenu = maOpenTimer.mnMenuPos; - } - break; - default: - ; - } -} - -void ScMenuFloatingWindow::resetMenu(bool bSetMenuPos) -{ - resizeToFitMenuItems(); - if (bSetMenuPos) - setSelectedMenuItem(0, false); -} - void ScMenuFloatingWindow::resizeToFitMenuItems() { if (maMenuItems.empty()) @@ -702,7 +743,7 @@ void ScMenuFloatingWindow::selectMenuItem(size_t nPos, bool bSelected, bool bSub if (bSelected) { if (mpParentMenu) - mpParentMenu->notify(SUBMENU_FOCUSED); + mpParentMenu->setSubMenuFocused(this); if (bSubMenuTimer) { @@ -721,6 +762,7 @@ void ScMenuFloatingWindow::clearSelectedMenuItem() { selectMenuItem(mnSelectedMenu, false, false); mnSelectedMenu = MENU_NOT_SELECTED; + fprintf(stdout, "ScMenuFloatingWindow::clearSelectedMenuItem: here\n"); } ScMenuFloatingWindow* ScMenuFloatingWindow::getSubMenuWindow(size_t nPos) const @@ -769,6 +811,9 @@ const OUString& ScMenuFloatingWindow::getName() const void ScMenuFloatingWindow::highlightMenuItem(size_t nPos, bool bSelected) { + if (nPos == MENU_NOT_SELECTED) + return; + const StyleSettings& rStyle = GetSettings().GetStyleSettings(); Color aBackColor = rStyle.GetMenuColor(); SetFillColor(aBackColor); @@ -850,6 +895,69 @@ size_t ScMenuFloatingWindow::getEnclosingMenuItem(const Point& rPos) const return MENU_NOT_SELECTED; } +size_t ScMenuFloatingWindow::getSubMenuPos(ScMenuFloatingWindow* pSubMenu) +{ + size_t n = maMenuItems.size(); + for (size_t i = 0; i < n; ++i) + { + if (maMenuItems[i].mpSubMenuWin.get() == pSubMenu) + return i; + } + return MENU_NOT_SELECTED; +} + +void ScMenuFloatingWindow::setSubMenuFocused(ScMenuFloatingWindow* pSubMenu) +{ + maCloseTimer.reset(); + size_t nMenuPos = getSubMenuPos(pSubMenu); + if (mnSelectedMenu != nMenuPos) + { + highlightMenuItem(nMenuPos, true); + mnSelectedMenu = nMenuPos; + } +} + +void ScMenuFloatingWindow::ensureSubMenuVisible(ScMenuFloatingWindow* pSubMenu) +{ + StackPrinter __stack_printer__("ScMenuFloatingWindow::ensureSubMenuVisible"); + if (mpParentMenu) + mpParentMenu->ensureSubMenuVisible(this); + + if (pSubMenu->IsVisible()) + return; + + // Find the menu position of the submenu. + size_t nMenuPos = getSubMenuPos(pSubMenu); + if (nMenuPos != MENU_NOT_SELECTED) + { + setSelectedMenuItem(nMenuPos, false, false); + + Point aPos; + Size aSize; + getMenuItemPosSize(nMenuPos, aPos, aSize); + + sal_uInt32 nOldFlags = GetPopupModeFlags(); + SetPopupModeFlags(nOldFlags | FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE); + pSubMenu->resizeToFitMenuItems(); // set the size before launching the popup to get it positioned correctly. + pSubMenu->StartPopupMode( + Rectangle(aPos,aSize), (FLOATWIN_POPUPMODE_RIGHT | FLOATWIN_POPUPMODE_GRABFOCUS)); + pSubMenu->AddPopupModeWindow(this); + SetPopupModeFlags(nOldFlags); + } +} + +void ScMenuFloatingWindow::ensureSubMenuNotVisible() +{ + if (mnSelectedMenu <= maMenuItems.size() && + maMenuItems[mnSelectedMenu].mpSubMenuWin && + maMenuItems[mnSelectedMenu].mpSubMenuWin->IsVisible()) + { + maMenuItems[mnSelectedMenu].mpSubMenuWin->ensureSubMenuNotVisible(); + } + + EndPopupMode(); +} + IMPL_LINK( ScMenuFloatingWindow, EndPopupHdl, void*, EMPTYARG ) { if (mbActionFired && mpParentMenu) diff --git a/sc/source/ui/inc/dpcontrol.hxx b/sc/source/ui/inc/dpcontrol.hxx index 1c57089bf073..29a39547b88c 100644 --- a/sc/source/ui/inc/dpcontrol.hxx +++ b/sc/source/ui/inc/dpcontrol.hxx @@ -125,7 +125,7 @@ public: void addMenuItem(const ::rtl::OUString& rText, bool bEnabled, Action* pAction); ScMenuFloatingWindow* addSubMenuItem(const ::rtl::OUString& rText, bool bEnabled); - void setSelectedMenuItem(size_t nPos, bool bSubMenuTimer = true); + void setSelectedMenuItem(size_t nPos, bool bSubMenuTimer, bool bEnsureSubMenu); void selectMenuItem(size_t nPos, bool bSelected, bool bSubMenuTimer); void clearSelectedMenuItem(); ScMenuFloatingWindow* getSubMenuWindow(size_t nPos) const; @@ -162,15 +162,32 @@ private: struct SubMenuItemData; void handleMenuTimeout(SubMenuItemData* pTimer); - enum NotificationType { SUBMENU_FOCUSED }; - void notify(NotificationType eType); - - void resetMenu(bool bSetMenuPos); void resizeToFitMenuItems(); void highlightMenuItem(size_t nPos, bool bSelected); void getMenuItemPosSize(size_t nPos, Point& rPos, Size& rSize) const; size_t getEnclosingMenuItem(const Point& rPos) const; + size_t getSubMenuPos(ScMenuFloatingWindow* pSubMenu); + + /** + * Make sure that the specified submenu is permanently up, the submenu + * close timer is not active, and the correct menu item associated with + * the submenu is highlighted. + */ + void setSubMenuFocused(ScMenuFloatingWindow* pSubMenu); + + /** + * When a menu item of an invisible submenu is selected, we need to make + * sure that all its parent menu(s) are visible, with the right menu item + * highlighted in each of the parents. Calling this method ensures it. + */ + void ensureSubMenuVisible(ScMenuFloatingWindow* pSubMenu); + + /** + * Dismiss any visible child submenus when a menu item of a parent menu is + * selected. + */ + void ensureSubMenuNotVisible(); DECL_LINK( EndPopupHdl, void* ); -- cgit v1.2.3 From 2a2abd3243d8c46612970595a6e6836d7e4e7f0a Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 21 Aug 2009 18:35:29 +0000 Subject: forgot to remove debug statements. --- .../ui/Accessibility/AccessibleFilterMenu.cxx | 2 - sc/source/ui/cctrl/dpcontrol.cxx | 48 ---------------------- 2 files changed, 50 deletions(-) diff --git a/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx b/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx index c9342c4ec1c1..9df813886dc5 100644 --- a/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx +++ b/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx @@ -150,13 +150,11 @@ ScAccessibleFilterMenu::ScAccessibleFilterMenu(const Reference& rxP mbEnabled(true), mbSelected(false) { - fprintf(stdout, "ScAccessibleFilterMenu::ScAccessibleFilterMenu: ctor (%p)\n", this); SetName(rName); } ScAccessibleFilterMenu::~ScAccessibleFilterMenu() { - fprintf(stdout, "ScAccessibleFilterMenu::~ScAccessibleFilterMenu: dtor (%p)\n", this); } // XAccessibleComponent diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index 10cec6fff069..3d51baf73a96 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -58,49 +58,6 @@ using ::std::vector; using ::std::hash_map; using ::std::auto_ptr; - -#include -#include -#include - -namespace { - -class StackPrinter -{ -public: - explicit StackPrinter(const char* msg) : - msMsg(msg) - { - fprintf(stdout, "%s: --begin\n", msMsg.c_str()); - mfStartTime = getTime(); - } - - ~StackPrinter() - { - double fEndTime = getTime(); - fprintf(stdout, "%s: --end (duration: %g sec)\n", msMsg.c_str(), (fEndTime-mfStartTime)); - } - - void printTime(int line) const - { - double fEndTime = getTime(); - fprintf(stdout, "%s: --(%d) (duration: %g sec)\n", msMsg.c_str(), line, (fEndTime-mfStartTime)); - } - -private: - double getTime() const - { - timeval tv; - gettimeofday(&tv, NULL); - return tv.tv_sec + tv.tv_usec / 1000000.0; - } - - ::std::string msMsg; - double mfStartTime; -}; - -} - ScDPFieldButton::ScDPFieldButton(OutputDevice* pOutDev, const StyleSettings* pStyle, const Fraction* pZoomX, const Fraction* pZoomY) : mpOutDev(pOutDev), mpStyle(pStyle), @@ -557,14 +514,12 @@ void ScMenuFloatingWindow::executeMenu(size_t nPos) void ScMenuFloatingWindow::setSelectedMenuItem(size_t nPos, bool bSubMenuTimer, bool bEnsureSubMenu) { - StackPrinter __stack_printer__("ScMenuFloatingWindow::setSelectedMenuItem"); if (mnSelectedMenu == nPos) // nothing to do. return; if (bEnsureSubMenu) { - fprintf(stdout, "ScMenuFloatingWindow::setSelectedMenuItem: (ensuring...) selected menu = %d\n", mnSelectedMenu); // Dismiss any child popup menu windows. if (mnSelectedMenu < maMenuItems.size() && maMenuItems[mnSelectedMenu].mpSubMenuWin && @@ -583,7 +538,6 @@ void ScMenuFloatingWindow::setSelectedMenuItem(size_t nPos, bool bSubMenuTimer, selectMenuItem(mnSelectedMenu, false, bSubMenuTimer); selectMenuItem(nPos, true, bSubMenuTimer); mnSelectedMenu = nPos; - fprintf(stdout, "ScMenuFloatingWindow::setSelectedMenuItem: selected menu = %d\n", mnSelectedMenu); } size_t ScMenuFloatingWindow::getSelectedMenuPos() const @@ -762,7 +716,6 @@ void ScMenuFloatingWindow::clearSelectedMenuItem() { selectMenuItem(mnSelectedMenu, false, false); mnSelectedMenu = MENU_NOT_SELECTED; - fprintf(stdout, "ScMenuFloatingWindow::clearSelectedMenuItem: here\n"); } ScMenuFloatingWindow* ScMenuFloatingWindow::getSubMenuWindow(size_t nPos) const @@ -919,7 +872,6 @@ void ScMenuFloatingWindow::setSubMenuFocused(ScMenuFloatingWindow* pSubMenu) void ScMenuFloatingWindow::ensureSubMenuVisible(ScMenuFloatingWindow* pSubMenu) { - StackPrinter __stack_printer__("ScMenuFloatingWindow::ensureSubMenuVisible"); if (mpParentMenu) mpParentMenu->ensureSubMenuVisible(this); -- cgit v1.2.3 From b6391fb9131b4f345e048cb7c5d7967bd62752a0 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 21 Aug 2009 18:40:05 +0000 Subject: more debug statements removed. --- sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx | 2 -- 1 file changed, 2 deletions(-) diff --git a/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx b/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx index 414169854dc6..86bf18551d14 100644 --- a/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx +++ b/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx @@ -65,13 +65,11 @@ ScAccessibleFilterMenuItem::ScAccessibleFilterMenuItem( mbSelected(false), mbEnabled(true) { - fprintf(stdout, "ScAccessibleFilterMenuItem::ScAccessibleFilterMenuItem: ctor (%p)\n", this); SetName(rName); } ScAccessibleFilterMenuItem::~ScAccessibleFilterMenuItem() { - fprintf(stdout, "ScAccessibleFilterMenuItem::~ScAccessibleFilterMenuItem: dtor (%p)\n", this); } sal_Int32 ScAccessibleFilterMenuItem::getAccessibleChildCount() -- cgit v1.2.3 From ed33032301907f6888b49cacb61ec10f78dee9ae Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 21 Aug 2009 19:03:06 +0000 Subject: Supported execution of menu items from the accessible object. --- sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx | 5 +++-- sc/source/ui/cctrl/dpcontrol.cxx | 6 +++--- sc/source/ui/inc/dpcontrol.hxx | 3 ++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx b/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx index 86bf18551d14..42c16e6154f4 100644 --- a/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx +++ b/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx @@ -200,13 +200,14 @@ sal_Int32 ScAccessibleFilterMenuItem::getAccessibleActionCount() throw (RuntimeE sal_Bool ScAccessibleFilterMenuItem::doAccessibleAction(sal_Int32 /*nIndex*/) throw (IndexOutOfBoundsException, RuntimeException) { - return false; + mpWindow->executeMenuItem(mnMenuPos); + return true; } OUString ScAccessibleFilterMenuItem::getAccessibleActionDescription(sal_Int32 /*nIndex*/) throw (IndexOutOfBoundsException, RuntimeException) { - return OUString::createFromAscii("Add some action here..."); + return OUString::createFromAscii("click"); } Reference ScAccessibleFilterMenuItem::getAccessibleActionKeyBinding( diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index 3d51baf73a96..bcf01317d3de 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -328,7 +328,7 @@ void ScMenuFloatingWindow::MouseButtonDown(const MouseEvent& rMEvt) void ScMenuFloatingWindow::MouseButtonUp(const MouseEvent& rMEvt) { - executeMenu(mnClickedMenu); + executeMenuItem(mnClickedMenu); mnClickedMenu = MENU_NOT_SELECTED; Window::MouseButtonUp(rMEvt); } @@ -375,7 +375,7 @@ void ScMenuFloatingWindow::KeyInput(const KeyEvent& rKEvt) break; case KEY_RETURN: if (nSelectedMenu != MENU_NOT_SELECTED) - executeMenu(nSelectedMenu); + executeMenuItem(nSelectedMenu); break; default: bHandled = false; @@ -498,7 +498,7 @@ const Font& ScMenuFloatingWindow::getLabelFont() const return maLabelFont; } -void ScMenuFloatingWindow::executeMenu(size_t nPos) +void ScMenuFloatingWindow::executeMenuItem(size_t nPos) { if (nPos >= maMenuItems.size()) return; diff --git a/sc/source/ui/inc/dpcontrol.hxx b/sc/source/ui/inc/dpcontrol.hxx index 29a39547b88c..e4fe0e6378ca 100644 --- a/sc/source/ui/inc/dpcontrol.hxx +++ b/sc/source/ui/inc/dpcontrol.hxx @@ -137,13 +137,14 @@ public: void setName(const ::rtl::OUString& rName); const ::rtl::OUString& getName() const; + void executeMenuItem(size_t nPos); + protected: void drawMenuItem(size_t nPos); void drawAllMenuItems(); const Font& getLabelFont() const; - void executeMenu(size_t nPos); size_t getSelectedMenuPos() const; void queueLaunchSubMenu(size_t nPos, ScMenuFloatingWindow* pMenu); void queueCloseSubMenu(); -- cgit v1.2.3 From 9dffba7f4b3e7bb139993ab7e94b6c20965ef9ab Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 21 Aug 2009 19:17:39 +0000 Subject: When a menu action is fired via accessible object, we need to make sure that all the popup windows get dismissed. --- sc/source/ui/cctrl/dpcontrol.cxx | 15 ++++++--------- sc/source/ui/inc/dpcontrol.hxx | 8 +++++--- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index bcf01317d3de..cd7aca9acc2f 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -289,8 +289,7 @@ ScMenuFloatingWindow::ScMenuFloatingWindow(Window* pParent, ScDocument* pDoc, US mnClickedMenu(MENU_NOT_SELECTED), mpDoc(pDoc), mpParentMenu(dynamic_cast(pParent)), - mpActiveSubMenu(NULL), - mbActionFired(false) + mpActiveSubMenu(NULL) { SetMenuStackLevel(nMenuStackLevel); @@ -508,8 +507,7 @@ void ScMenuFloatingWindow::executeMenuItem(size_t nPos) return; maMenuItems[nPos].mpAction->execute(); - mbActionFired = true; - EndPopupMode(); + terminateAllPopupMenus(); } void ScMenuFloatingWindow::setSelectedMenuItem(size_t nPos, bool bSubMenuTimer, bool bEnsureSubMenu) @@ -910,12 +908,11 @@ void ScMenuFloatingWindow::ensureSubMenuNotVisible() EndPopupMode(); } -IMPL_LINK( ScMenuFloatingWindow, EndPopupHdl, void*, EMPTYARG ) +void ScMenuFloatingWindow::terminateAllPopupMenus() { - if (mbActionFired && mpParentMenu) - mpParentMenu->EndPopupMode(); - - return 0; + EndPopupMode(); + if (mpParentMenu) + mpParentMenu->terminateAllPopupMenus(); } // ============================================================================ diff --git a/sc/source/ui/inc/dpcontrol.hxx b/sc/source/ui/inc/dpcontrol.hxx index e4fe0e6378ca..55afc0470c64 100644 --- a/sc/source/ui/inc/dpcontrol.hxx +++ b/sc/source/ui/inc/dpcontrol.hxx @@ -190,7 +190,11 @@ private: */ void ensureSubMenuNotVisible(); - DECL_LINK( EndPopupHdl, void* ); + /** + * Dismiss all visible popup menus and set focus back to the application + * window. This method is called e.g. when a menu action is fired. + */ + void terminateAllPopupMenus(); private: @@ -238,8 +242,6 @@ private: ScMenuFloatingWindow* mpParentMenu; ScMenuFloatingWindow* mpActiveSubMenu; - - bool mbActionFired; }; // ============================================================================ -- cgit v1.2.3 From 514d004f7422f4103d8574b7339c22345a5e6c7c Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 21 Aug 2009 20:19:55 +0000 Subject: fixed a build breakage. --- sc/source/ui/cctrl/dpcontrol.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index cd7aca9acc2f..ab3123718d40 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -301,7 +301,6 @@ ScMenuFloatingWindow::ScMenuFloatingWindow(Window* pParent, ScDocument* pDoc, US SetFont(maLabelFont); SetText(OUString::createFromAscii("ScMenuFloatingWindow")); - SetPopupModeEndHdl( LINK(this, ScMenuFloatingWindow, EndPopupHdl) ); } ScMenuFloatingWindow::~ScMenuFloatingWindow() -- cgit v1.2.3 From aa18040a8e2db3b1c51e6de4ea34f73efa96a447 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Sat, 22 Aug 2009 03:13:19 +0000 Subject: code cleanup. --- sc/inc/AccessibleFilterMenu.hxx | 14 +--- .../ui/Accessibility/AccessibleFilterMenu.cxx | 86 +++++----------------- sc/source/ui/cctrl/dpcontrol.cxx | 10 ++- sc/source/ui/inc/dpcontrol.hxx | 3 +- 4 files changed, 30 insertions(+), 83 deletions(-) diff --git a/sc/inc/AccessibleFilterMenu.hxx b/sc/inc/AccessibleFilterMenu.hxx index 12faa7e848e3..c5049045d672 100644 --- a/sc/inc/AccessibleFilterMenu.hxx +++ b/sc/inc/AccessibleFilterMenu.hxx @@ -61,16 +61,7 @@ class ScAccessibleFilterMenu : public ScAccessibleFilterMenu_BASE { public: - struct MenuItem - { - ::com::sun::star::uno::Reference< - ::com::sun::star::accessibility::XAccessible > mxAccessible; - bool mbSelected; - - MenuItem(); - }; - - ScAccessibleFilterMenu( + explicit ScAccessibleFilterMenu( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible>& rxParent, ScMenuFloatingWindow* pWin, const ::rtl::OUString& rName, size_t nMenuPos, ScDocument* pDoc); @@ -194,7 +185,7 @@ private: void updateStates(); private: - ::std::vector maMenuItems; + ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > > maMenuItems; ::std::set maStates; size_t mnMenuPos; @@ -202,7 +193,6 @@ private: ScDocument* mpDoc; bool mbEnabled:1; - bool mbSelected:1; }; #endif diff --git a/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx b/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx index 9df813886dc5..5a1253181a8f 100644 --- a/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx +++ b/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx @@ -74,18 +74,18 @@ using ::std::set; namespace { -class AddRemoveEventListener : public ::std::unary_function +class AddRemoveEventListener : public ::std::unary_function > { public: explicit AddRemoveEventListener(const Reference& rListener, bool bAdd) : mxListener(rListener), mbAdd(bAdd) {} - void operator() (ScAccessibleFilterMenu::MenuItem& rItem) const + void operator() (const Reference& xAccessible) const { - if (!rItem.mxAccessible.is()) + if (!xAccessible.is()) return; - Reference xBc(rItem.mxAccessible, UNO_QUERY); + Reference xBc(xAccessible, UNO_QUERY); if (xBc.is()) { if (mbAdd) @@ -99,45 +99,6 @@ private: bool mbAdd; }; -class CountSelectedMenuItem : public ::std::unary_function -{ -public: - explicit CountSelectedMenuItem() : mnCount(0) {} - - CountSelectedMenuItem(const CountSelectedMenuItem& r) : - mnCount(r.mnCount) {} - - void operator() (ScAccessibleFilterMenu::MenuItem& rItem) - { - { - ScAccessibleFilterMenuItem* p = dynamic_cast( - rItem.mxAccessible.get()); - if (p && p->isSelected()) - ++mnCount; - } - - { - ScAccessibleFilterMenu* p = dynamic_cast( - rItem.mxAccessible.get()); - if (p && p->isSelected()) - ++mnCount; - } - } - - size_t getCount() const { return mnCount; } - -private: - size_t mnCount; -}; - -} - -// ============================================================================ - -ScAccessibleFilterMenu::MenuItem::MenuItem() : - mxAccessible(NULL), - mbSelected(false) -{ } // ============================================================================ @@ -147,8 +108,7 @@ ScAccessibleFilterMenu::ScAccessibleFilterMenu(const Reference& rxP mnMenuPos(nMenuPos), mpWindow(pWin), mpDoc(pDoc), - mbEnabled(true), - mbSelected(false) + mbEnabled(true) { SetName(rName); } @@ -167,7 +127,7 @@ Reference ScAccessibleFilterMenu::getAccessibleAtPoint( const ::com sal_Bool ScAccessibleFilterMenu::isVisible() throw (RuntimeException) { - return true; + return mpWindow->IsVisible(); } void ScAccessibleFilterMenu::grabFocus() @@ -206,7 +166,7 @@ Reference ScAccessibleFilterMenu::getAccessibleChild(sal_Int32 nInd if (maMenuItems.size() <= static_cast(nIndex)) throw IndexOutOfBoundsException(); - return maMenuItems[nIndex].mxAccessible; + return maMenuItems[nIndex]; } Reference ScAccessibleFilterMenu::getAccessibleStateSet() @@ -219,7 +179,7 @@ Reference ScAccessibleFilterMenu::getAccessibleStateSet() OUString ScAccessibleFilterMenu::getImplementationName() throw (RuntimeException) { - return OUString::createFromAscii("ScAccessibleFilterMenu name"); + return OUString::createFromAscii("ScAccessibleFilterMenu"); } // XAccessibleEventBroadcaster @@ -246,20 +206,17 @@ void ScAccessibleFilterMenu::removeEventListener( sal_Bool ScAccessibleFilterMenu::isEmpty() throw (RuntimeException) { - updateStates(); return maStates.empty(); } sal_Bool ScAccessibleFilterMenu::contains(sal_Int16 nState) throw (RuntimeException) { - updateStates(); return maStates.count(nState) > 0; } sal_Bool ScAccessibleFilterMenu::containsAll(const Sequence& aStateSet) throw (RuntimeException) { - updateStates(); sal_Int32 n = aStateSet.getLength(); for (sal_Int32 i = 0; i < n; ++i) { @@ -292,7 +249,6 @@ void ScAccessibleFilterMenu::selectAccessibleChild(sal_Int32 nChildIndex) if (static_cast(nChildIndex) >= maMenuItems.size()) throw IndexOutOfBoundsException(); - maMenuItems[nChildIndex].mbSelected = true; mpWindow->setSelectedMenuItem(nChildIndex, false, true); } @@ -302,7 +258,7 @@ sal_Bool ScAccessibleFilterMenu::isAccessibleChildSelected(sal_Int32 nChildIndex if (static_cast(nChildIndex) >= maMenuItems.size()) throw IndexOutOfBoundsException(); - return maMenuItems[nChildIndex].mbSelected; + return mpWindow->isMenuItemSelected(static_cast(nChildIndex)); } void ScAccessibleFilterMenu::clearAccessibleSelection() throw (RuntimeException) @@ -317,8 +273,8 @@ void ScAccessibleFilterMenu::selectAllAccessibleChildren() throw (RuntimeExcepti sal_Int32 ScAccessibleFilterMenu::getSelectedAccessibleChildCount() throw (RuntimeException) { - sal_Int32 n = for_each(maMenuItems.begin(), maMenuItems.end(), CountSelectedMenuItem()).getCount(); - return n; + // Since this is a menu, either one menu item is selected, or none at all. + return mpWindow->getSelectedMenuItem() == ScMenuFloatingWindow::MENU_NOT_SELECTED ? 0 : 1; } Reference ScAccessibleFilterMenu::getSelectedAccessibleChild(sal_Int32 nChildIndex) @@ -327,7 +283,7 @@ Reference ScAccessibleFilterMenu::getSelectedAccessibleChild(sal_In if (static_cast(nChildIndex) >= maMenuItems.size()) throw IndexOutOfBoundsException(); - return maMenuItems[nChildIndex].mxAccessible; + return maMenuItems[nChildIndex]; } void ScAccessibleFilterMenu::deselectAccessibleChild(sal_Int32 nChildIndex) throw (IndexOutOfBoundsException, RuntimeException) @@ -373,23 +329,23 @@ void ScAccessibleFilterMenu::appendMenuItem(const OUString& rName, bool bEnabled { // Check weather this menu item is a sub menu or a regular menu item. ScMenuFloatingWindow* pSubMenu = mpWindow->getSubMenuWindow(nMenuPos); - MenuItem aItem; + Reference xAccessible; if (pSubMenu) { - aItem.mxAccessible = pSubMenu->CreateAccessible(); - ScAccessibleFilterMenu* p = static_cast( - aItem.mxAccessible.get()); + xAccessible = pSubMenu->CreateAccessible(); + ScAccessibleFilterMenu* p = + static_cast(xAccessible.get()); p->setEnabled(bEnabled); p->setMenuPos(nMenuPos); } else { - aItem.mxAccessible.set(new ScAccessibleFilterMenuItem(this, mpWindow, rName, nMenuPos)); - ScAccessibleFilterMenuItem* p = static_cast( - aItem.mxAccessible.get()); + xAccessible.set(new ScAccessibleFilterMenuItem(this, mpWindow, rName, nMenuPos)); + ScAccessibleFilterMenuItem* p = + static_cast(xAccessible.get()); p->setEnabled(bEnabled); } - maMenuItems.push_back(aItem); + maMenuItems.push_back(xAccessible); } void ScAccessibleFilterMenu::setMenuPos(size_t nMenuPos) @@ -410,8 +366,6 @@ bool ScAccessibleFilterMenu::isFocused() bool ScAccessibleFilterMenu::isSelected() { // Check to see if any of the child menu items is selected. -// size_t nSelectCount = for_each(maMenuItems.begin(), maMenuItems.end(), CountSelectedMenuItem()).getCount(); -// return nSelectCount == 0; return mpWindow->isMenuItemSelected(mnMenuPos); } diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index ab3123718d40..ce45f0c1b504 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -48,8 +48,6 @@ #include -#define MENU_NOT_SELECTED 999 - using ::com::sun::star::uno::Reference; using ::com::sun::star::accessibility::XAccessible; using ::rtl::OUString; @@ -280,6 +278,8 @@ IMPL_LINK( ScMenuFloatingWindow::SubMenuItemData, TimeoutHdl, void*, EMPTYARG ) // ---------------------------------------------------------------------------- +size_t ScMenuFloatingWindow::MENU_NOT_SELECTED = 999; + ScMenuFloatingWindow::ScMenuFloatingWindow(Window* pParent, ScDocument* pDoc, USHORT nMenuStackLevel) : FloatingWindow(pParent, (WB_SYSTEMFLOATWIN|WB_SYSTEMWINDOW|WB_NOBORDER)), maOpenTimer(this), @@ -537,7 +537,7 @@ void ScMenuFloatingWindow::setSelectedMenuItem(size_t nPos, bool bSubMenuTimer, mnSelectedMenu = nPos; } -size_t ScMenuFloatingWindow::getSelectedMenuPos() const +size_t ScMenuFloatingWindow::getSelectedMenuItem() const { return mnSelectedMenu; } @@ -1177,7 +1177,7 @@ void ScDPFieldPopupWindow::MouseMove(const MouseEvent& rMEvt) { ScMenuFloatingWindow::MouseMove(rMEvt); - size_t nSelectedMenu = getSelectedMenuPos(); + size_t nSelectedMenu = getSelectedMenuItem(); if (nSelectedMenu == MENU_NOT_SELECTED) queueCloseSubMenu(); } @@ -1240,6 +1240,8 @@ void ScDPFieldPopupWindow::setMemberSize(size_t n) void ScDPFieldPopupWindow::addMember(const OUString& rName, bool bVisible) { + fprintf(stdout, "ScDPFieldPopupWindow::addMember: name = '%s' visible = %d\n", + rtl::OUStringToOString(rName, RTL_TEXTENCODING_UTF8).getStr(), bVisible); Member aMember; aMember.maName = rName; aMember.mbVisible = bVisible; diff --git a/sc/source/ui/inc/dpcontrol.hxx b/sc/source/ui/inc/dpcontrol.hxx index 55afc0470c64..dbbbcb55ed49 100644 --- a/sc/source/ui/inc/dpcontrol.hxx +++ b/sc/source/ui/inc/dpcontrol.hxx @@ -103,6 +103,7 @@ private: class ScMenuFloatingWindow : public FloatingWindow { public: + static size_t MENU_NOT_SELECTED; /** * Action to perform when an event takes place. Create a sub-class of * this to implement the desired action. @@ -133,6 +134,7 @@ public: ::rtl::OUString getMenuItemName(size_t nPos) const; bool isMenuItemEnabled(size_t nPos) const; bool isMenuItemSelected(size_t nPos) const; + size_t getSelectedMenuItem() const; void setName(const ::rtl::OUString& rName); const ::rtl::OUString& getName() const; @@ -145,7 +147,6 @@ protected: void drawAllMenuItems(); const Font& getLabelFont() const; - size_t getSelectedMenuPos() const; void queueLaunchSubMenu(size_t nPos, ScMenuFloatingWindow* pMenu); void queueCloseSubMenu(); void launchSubMenu(bool bSetMenuPos); -- cgit v1.2.3 From 914141b32155e25a2d87ac00908bfb376ac30344 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Sat, 22 Aug 2009 03:40:29 +0000 Subject: More code cleanup & wrote a separate XAccessibleStateSet implementation that can be shared across classes. --- sc/inc/AccessibleFilterMenuItem.hxx | 3 +- sc/inc/AccessibleGlobal.hxx | 69 +++++++++++++++ .../ui/Accessibility/AccessibleFilterMenuItem.cxx | 9 +- sc/source/ui/Accessibility/AccessibleGlobal.cxx | 98 ++++++++++++++++++++++ sc/source/ui/Accessibility/makefile.mk | 2 + 5 files changed, 174 insertions(+), 7 deletions(-) create mode 100644 sc/inc/AccessibleGlobal.hxx create mode 100644 sc/source/ui/Accessibility/AccessibleGlobal.cxx diff --git a/sc/inc/AccessibleFilterMenuItem.hxx b/sc/inc/AccessibleFilterMenuItem.hxx index d4434da5f937..3f7f58d3a818 100644 --- a/sc/inc/AccessibleFilterMenuItem.hxx +++ b/sc/inc/AccessibleFilterMenuItem.hxx @@ -122,8 +122,7 @@ private: ScMenuFloatingWindow* mpWindow; ::rtl::OUString maName; size_t mnMenuPos; - bool mbSelected:1; - bool mbEnabled:1; + bool mbEnabled; }; #endif diff --git a/sc/inc/AccessibleGlobal.hxx b/sc/inc/AccessibleGlobal.hxx new file mode 100644 index 000000000000..83f5e0d2222c --- /dev/null +++ b/sc/inc/AccessibleGlobal.hxx @@ -0,0 +1,69 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: AccessibleDataPilotControl.hxx,v $ + * $Revision: 1.6 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SC_ACCESSIBLEGLOBAL_HXX +#define SC_ACCESSIBLEGLOBAL_HXX + +#include +#include "cppuhelper/implbase1.hxx" + +#include + +class ScAccessibleStateSet : public ::cppu::WeakImplHelper1< ::com::sun::star::accessibility::XAccessibleStateSet > +{ +public: + ScAccessibleStateSet(); + virtual ~ScAccessibleStateSet(); + + // XAccessibleStateSet + + virtual ::sal_Bool SAL_CALL isEmpty() + throw (::com::sun::star::uno::RuntimeException); + + virtual ::sal_Bool SAL_CALL contains(sal_Int16 nState) + throw (::com::sun::star::uno::RuntimeException); + + virtual ::sal_Bool SAL_CALL containsAll( + const ::com::sun::star::uno::Sequence& aStateSet) + throw (::com::sun::star::uno::RuntimeException); + + virtual ::com::sun::star::uno::Sequence SAL_CALL getStates() + throw (::com::sun::star::uno::RuntimeException); + + // Non-UNO Methods + + void insert(sal_Int16 nState); + void clear(); + +private: + ::std::set maStates; +}; + +#endif diff --git a/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx b/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx index 42c16e6154f4..662e5303df48 100644 --- a/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx +++ b/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx @@ -62,7 +62,6 @@ ScAccessibleFilterMenuItem::ScAccessibleFilterMenuItem( mpWindow(pWin), maName(rName), mnMenuPos(nMenuPos), - mbSelected(false), mbEnabled(true) { SetName(rName); @@ -101,7 +100,7 @@ OUString ScAccessibleFilterMenuItem::getImplementationName() sal_Bool ScAccessibleFilterMenuItem::isEmpty() throw (RuntimeException) { - return (mbEnabled || mbSelected); + return false; } sal_Bool ScAccessibleFilterMenuItem::contains(sal_Int16 nState) throw (RuntimeException) @@ -119,7 +118,7 @@ sal_Bool ScAccessibleFilterMenuItem::contains(sal_Int16 nState) throw (RuntimeEx } } - if (mbSelected) + if (isSelected()) { switch (nState) { @@ -150,7 +149,7 @@ sal_Bool ScAccessibleFilterMenuItem::containsAll(const Sequence& aSta continue; } } - if (mbSelected) + if (isSelected()) { switch (nState) { @@ -176,7 +175,7 @@ Sequence ScAccessibleFilterMenuItem::getStates() throw (RuntimeExcept aStates.push_back(SENSITIVE); } - if (mbSelected) + if (isSelected()) { aStates.push_back(FOCUSED); aStates.push_back(SELECTED); diff --git a/sc/source/ui/Accessibility/AccessibleGlobal.cxx b/sc/source/ui/Accessibility/AccessibleGlobal.cxx new file mode 100644 index 000000000000..6ac7190a132b --- /dev/null +++ b/sc/source/ui/Accessibility/AccessibleGlobal.cxx @@ -0,0 +1,98 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: AccessibleDataPilotControl.hxx,v $ + * $Revision: 1.6 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove + +#include "precompiled_sc.hxx" +#include "AccessibleGlobal.hxx" + +using ::com::sun::star::uno::RuntimeException; +using ::com::sun::star::uno::Reference; +using ::com::sun::star::uno::Sequence; +using ::std::set; + +ScAccessibleStateSet::ScAccessibleStateSet() +{ +} + +ScAccessibleStateSet::~ScAccessibleStateSet() +{ +} + +// XAccessibleStateSet + +sal_Bool SAL_CALL ScAccessibleStateSet::isEmpty() throw (RuntimeException) +{ + return maStates.empty(); +} + +sal_Bool SAL_CALL ScAccessibleStateSet::contains(sal_Int16 nState) + throw (RuntimeException) +{ + return maStates.count(nState) != 0; +} + +sal_Bool SAL_CALL ScAccessibleStateSet::containsAll( + const Sequence& aStateSet) throw (RuntimeException) +{ + sal_Int32 n = aStateSet.getLength(); + for (sal_Int32 i = 0; i < n; ++i) + { + if (!maStates.count(aStateSet[i])) + // This state is not set. + return false; + } + // All specified states are set. + return true; +} + +Sequence SAL_CALL ScAccessibleStateSet::getStates() + throw (RuntimeException) +{ + Sequence aSeq(0); + set::const_iterator itr = maStates.begin(), itrEnd = maStates.end(); + for (size_t i = 0; itr != itrEnd; ++itr, ++i) + { + aSeq.realloc(i+1); + aSeq[i] = *itr; + } + return aSeq; +} + +void ScAccessibleStateSet::insert(sal_Int16 nState) +{ + maStates.insert(nState); +} + +void ScAccessibleStateSet::clear() +{ + maStates.clear(); +} + diff --git a/sc/source/ui/Accessibility/makefile.mk b/sc/source/ui/Accessibility/makefile.mk index 0bde79f1f159..1ef6db37e0c1 100644 --- a/sc/source/ui/Accessibility/makefile.mk +++ b/sc/source/ui/Accessibility/makefile.mk @@ -47,6 +47,7 @@ SLOFILES = \ $(SLO)$/AccessibleContextBase.obj \ $(SLO)$/AccessibleTableBase.obj \ $(SLO)$/AccessibleDocument.obj \ + $(SLO)$/AccessibleGlobal.obj \ $(SLO)$/AccessibleSpreadsheet.obj \ $(SLO)$/AccessibleCell.obj \ $(SLO)$/AccessibilityHints.obj \ @@ -71,6 +72,7 @@ EXCEPTIONSFILES= \ $(SLO)$/AccessibleContextBase.obj \ $(SLO)$/AccessibleTableBase.obj \ $(SLO)$/AccessibleDocument.obj \ + $(SLO)$/AccessibleGlobal.obj \ $(SLO)$/AccessibleSpreadsheet.obj \ $(SLO)$/AccessibleCell.obj \ $(SLO)$/AccessibleDocumentBase.obj \ -- cgit v1.2.3 From f379d876d1a4894bd9767640c2329ba44f0e4820 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Sat, 22 Aug 2009 04:02:38 +0000 Subject: Use ScAccessibleStateSet to share state set implementation. --- sc/inc/AccessibleFilterMenu.hxx | 26 +---- sc/inc/AccessibleFilterMenuItem.hxx | 31 ++--- sc/inc/AccessibleGlobal.hxx | 3 + .../ui/Accessibility/AccessibleFilterMenu.cxx | 76 ++++--------- .../ui/Accessibility/AccessibleFilterMenuItem.cxx | 126 ++++++--------------- 5 files changed, 73 insertions(+), 189 deletions(-) diff --git a/sc/inc/AccessibleFilterMenu.hxx b/sc/inc/AccessibleFilterMenu.hxx index c5049045d672..93cfe1a78b21 100644 --- a/sc/inc/AccessibleFilterMenu.hxx +++ b/sc/inc/AccessibleFilterMenu.hxx @@ -32,10 +32,9 @@ #define SC_ACCESSIBLEFILTERMENU_HXX #include "AccessibleContextBase.hxx" -#include "cppuhelper/implbase2.hxx" +#include "cppuhelper/implbase1.hxx" #include -#include #include #include #include @@ -52,8 +51,7 @@ namespace com { namespace sun { namespace star { class ScDocument; class ScMenuFloatingWindow; -typedef ::cppu::ImplHelper2< - ::com::sun::star::accessibility::XAccessibleStateSet, +typedef ::cppu::ImplHelper1< ::com::sun::star::accessibility::XAccessibleSelection > ScAccessibleFilterMenu_BASE; class ScAccessibleFilterMenu : @@ -120,20 +118,6 @@ public: ::com::sun::star::accessibility::XAccessibleEventListener>& xListener) throw (com::sun::star::uno::RuntimeException); - // XAccessibleStateSet - - virtual sal_Bool SAL_CALL isEmpty() throw (::com::sun::star::uno::RuntimeException); - - virtual sal_Bool SAL_CALL contains(sal_Int16 nState) - throw (::com::sun::star::uno::RuntimeException); - - virtual sal_Bool SAL_CALL containsAll( - const ::com::sun::star::uno::Sequence& aStateSet) - throw (::com::sun::star::uno::RuntimeException); - - virtual ::com::sun::star::uno::Sequence SAL_CALL getStates() - throw (::com::sun::star::uno::RuntimeException); - // XAccessibleSelection virtual void SAL_CALL selectAccessibleChild(sal_Int32 nChildIndex) @@ -177,16 +161,16 @@ public: void appendMenuItem(const ::rtl::OUString& rName, bool bEnabled, size_t nMenuPos); void setMenuPos(size_t nMenuPos); void setEnabled(bool bEnabled); - bool isSelected(); private: - bool isFocused(); + bool isSelected() const; + bool isFocused() const; void updateStates(); private: ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > > maMenuItems; - ::std::set maStates; + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > mxStateSet; size_t mnMenuPos; ScMenuFloatingWindow* mpWindow; diff --git a/sc/inc/AccessibleFilterMenuItem.hxx b/sc/inc/AccessibleFilterMenuItem.hxx index 3f7f58d3a818..10d471f4b245 100644 --- a/sc/inc/AccessibleFilterMenuItem.hxx +++ b/sc/inc/AccessibleFilterMenuItem.hxx @@ -32,16 +32,14 @@ #define SC_ACCESSIBLEFILTERMENUITEM_HXX #include "AccessibleContextBase.hxx" -#include "cppuhelper/implbase2.hxx" +#include "cppuhelper/implbase1.hxx" #include -#include class ScMenuFloatingWindow; -typedef ::cppu::ImplHelper2< - ::com::sun::star::accessibility::XAccessibleAction, - ::com::sun::star::accessibility::XAccessibleStateSet > ScAccessibleFilterMenuItem_BASE; +typedef ::cppu::ImplHelper1< + ::com::sun::star::accessibility::XAccessibleAction > ScAccessibleFilterMenuItem_BASE; class ScAccessibleFilterMenuItem : public ScAccessibleContextBase, @@ -72,21 +70,6 @@ public: virtual ::rtl::OUString SAL_CALL getImplementationName() throw (::com::sun::star::uno::RuntimeException); - // XAccessibleStateSet - - virtual ::sal_Bool SAL_CALL isEmpty() - throw (::com::sun::star::uno::RuntimeException); - - virtual ::sal_Bool SAL_CALL contains(sal_Int16 nState) - throw (::com::sun::star::uno::RuntimeException); - - virtual ::sal_Bool SAL_CALL containsAll( - const ::com::sun::star::uno::Sequence& aStateSet) - throw (::com::sun::star::uno::RuntimeException); - - virtual ::com::sun::star::uno::Sequence SAL_CALL getStates() - throw (::com::sun::star::uno::RuntimeException); - // XAccessibleAction virtual ::sal_Int32 SAL_CALL getAccessibleActionCount() @@ -114,11 +97,17 @@ public: // Non-UNO Methods - bool isSelected() const; void setEnabled(bool bEnabled); private: + bool isSelected() const; + bool isFocused() const; + void updateStateSet(); + +private: + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > mxStateSet; + ScMenuFloatingWindow* mpWindow; ::rtl::OUString maName; size_t mnMenuPos; diff --git a/sc/inc/AccessibleGlobal.hxx b/sc/inc/AccessibleGlobal.hxx index 83f5e0d2222c..9f17c2eaacae 100644 --- a/sc/inc/AccessibleGlobal.hxx +++ b/sc/inc/AccessibleGlobal.hxx @@ -36,6 +36,9 @@ #include +/** + * Generic XAccessibleStateSet implementation. + */ class ScAccessibleStateSet : public ::cppu::WeakImplHelper1< ::com::sun::star::accessibility::XAccessibleStateSet > { public: diff --git a/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx b/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx index 5a1253181a8f..ad50425db56e 100644 --- a/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx +++ b/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx @@ -31,6 +31,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sc.hxx" +#include "AccessibleGlobal.hxx" #include "AccessibleFilterMenu.hxx" #include "AccessibleFilterMenuItem.hxx" #include "unoguard.hxx" @@ -173,7 +174,7 @@ Reference ScAccessibleFilterMenu::getAccessibleStateSet() throw (RuntimeException) { updateStates(); - return this; + return mxStateSet; } OUString ScAccessibleFilterMenu::getImplementationName() @@ -202,45 +203,6 @@ void ScAccessibleFilterMenu::removeEventListener( for_each(maMenuItems.begin(), maMenuItems.end(), AddRemoveEventListener(xListener, false)); } -// XAccessibleStateSet - -sal_Bool ScAccessibleFilterMenu::isEmpty() throw (RuntimeException) -{ - return maStates.empty(); -} - -sal_Bool ScAccessibleFilterMenu::contains(sal_Int16 nState) throw (RuntimeException) -{ - return maStates.count(nState) > 0; -} - -sal_Bool ScAccessibleFilterMenu::containsAll(const Sequence& aStateSet) - throw (RuntimeException) -{ - sal_Int32 n = aStateSet.getLength(); - for (sal_Int32 i = 0; i < n; ++i) - { - if (!maStates.count(aStateSet[i])) - // This state is not set. - return false; - } - // All specified states are set. - return true; -} - -Sequence ScAccessibleFilterMenu::getStates() throw (RuntimeException) -{ - updateStates(); - Sequence aSeq(0); - set::const_iterator itr = maStates.begin(), itrEnd = maStates.end(); - for (size_t i = 0; itr != itrEnd; ++itr, ++i) - { - aSeq.realloc(i+1); - aSeq[i] = *itr; - } - return aSeq; -} - // XAccessibleSelection void ScAccessibleFilterMenu::selectAccessibleChild(sal_Int32 nChildIndex) @@ -358,28 +320,36 @@ void ScAccessibleFilterMenu::setEnabled(bool bEnabled) mbEnabled = bEnabled; } -bool ScAccessibleFilterMenu::isFocused() +bool ScAccessibleFilterMenu::isSelected() const { - return isSelected(); + // Check to see if any of the child menu items is selected. + return mpWindow->isMenuItemSelected(mnMenuPos); } -bool ScAccessibleFilterMenu::isSelected() +bool ScAccessibleFilterMenu::isFocused() const { - // Check to see if any of the child menu items is selected. - return mpWindow->isMenuItemSelected(mnMenuPos); + return isSelected(); } void ScAccessibleFilterMenu::updateStates() { - maStates.clear(); - maStates.insert(ENABLED); - maStates.insert(FOCUSABLE); - maStates.insert(SELECTABLE); - maStates.insert(SENSITIVE); - maStates.insert(OPAQUE); + if (!mxStateSet.is()) + mxStateSet.set(new ScAccessibleStateSet); + + ScAccessibleStateSet* p = static_cast( + mxStateSet.get()); + + p->clear(); + + p->insert(ENABLED); + p->insert(FOCUSABLE); + p->insert(SELECTABLE); + p->insert(SENSITIVE); + p->insert(OPAQUE); if (isFocused()) - maStates.insert(FOCUSED); + p->insert(FOCUSED); + if (isSelected()) - maStates.insert(SELECTED); + p->insert(SELECTED); } diff --git a/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx b/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx index 662e5303df48..76822ccb3820 100644 --- a/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx +++ b/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx @@ -31,6 +31,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sc.hxx" +#include "AccessibleGlobal.hxx" #include "AccessibleFilterMenuItem.hxx" #include "dpcontrol.hxx" @@ -46,6 +47,7 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::accessibility; +using namespace ::com::sun::star::accessibility::AccessibleStateType; using ::com::sun::star::uno::Any; using ::com::sun::star::uno::Reference; @@ -87,7 +89,8 @@ Reference ScAccessibleFilterMenuItem::getAccessibleChild(sal_Int32 Reference ScAccessibleFilterMenuItem::getAccessibleStateSet() throw (RuntimeException) { - return this; + updateStateSet(); + return mxStateSet; } OUString ScAccessibleFilterMenuItem::getImplementationName() @@ -96,99 +99,6 @@ OUString ScAccessibleFilterMenuItem::getImplementationName() return OUString::createFromAscii("ScAccessibleFilterMenuItem - implementation name"); } -// XAccessibleStateSet - -sal_Bool ScAccessibleFilterMenuItem::isEmpty() throw (RuntimeException) -{ - return false; -} - -sal_Bool ScAccessibleFilterMenuItem::contains(sal_Int16 nState) throw (RuntimeException) -{ - using namespace ::com::sun::star::accessibility::AccessibleStateType; - if (mbEnabled) - { - switch (nState) - { - case ENABLED: - case FOCUSABLE: - case SELECTABLE: - case SENSITIVE: - return true; - } - } - - if (isSelected()) - { - switch (nState) - { - case FOCUSED: - case SELECTED: - return true; - } - } - return false; -} - -sal_Bool ScAccessibleFilterMenuItem::containsAll(const Sequence& aStateSet) - throw (RuntimeException) -{ - using namespace ::com::sun::star::accessibility::AccessibleStateType; - sal_Int32 n = aStateSet.getLength(); - for (sal_Int32 i = 0; i < n; ++i) - { - sal_Int16 nState = aStateSet[i]; - if (mbEnabled) - { - switch (nState) - { - case ENABLED: - case FOCUSABLE: - case SELECTABLE: - case SENSITIVE: - continue; - } - } - if (isSelected()) - { - switch (nState) - { - case FOCUSED: - case SELECTED: - continue; - } - } - return false; - } - return true; -} - -Sequence ScAccessibleFilterMenuItem::getStates() throw (RuntimeException) -{ - using namespace ::com::sun::star::accessibility::AccessibleStateType; - vector aStates; - if (mbEnabled) - { - aStates.push_back(ENABLED); - aStates.push_back(FOCUSABLE); - aStates.push_back(SELECTABLE); - aStates.push_back(SENSITIVE); - } - - if (isSelected()) - { - aStates.push_back(FOCUSED); - aStates.push_back(SELECTED); - } - - size_t n = aStates.size(); - Sequence aSeq(aStates.size()); - for (size_t i = 0; i < n; ++i) - aSeq[i] = aStates[i]; - - return aSeq; -} - // XAccessibleAction sal_Int32 ScAccessibleFilterMenuItem::getAccessibleActionCount() throw (RuntimeException) @@ -240,8 +150,36 @@ bool ScAccessibleFilterMenuItem::isSelected() const return mpWindow->isMenuItemSelected(mnMenuPos); } +bool ScAccessibleFilterMenuItem::isFocused() const +{ + return isSelected(); +} + void ScAccessibleFilterMenuItem::setEnabled(bool bEnabled) { mbEnabled = bEnabled; } +void ScAccessibleFilterMenuItem::updateStateSet() +{ + if (!mxStateSet.is()) + mxStateSet.set(new ScAccessibleStateSet); + + ScAccessibleStateSet* p = static_cast( + mxStateSet.get()); + + p->clear(); + + p->insert(ENABLED); + p->insert(FOCUSABLE); + p->insert(SELECTABLE); + p->insert(SENSITIVE); + p->insert(OPAQUE); + + if (isFocused()) + p->insert(FOCUSED); + + if (isSelected()) + p->insert(SELECTED); +} + -- cgit v1.2.3 From fd7c4e6b7c51ccb702bb7b383ad14d573ebb3a48 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Sat, 22 Aug 2009 04:04:35 +0000 Subject: forgot to remove debug statement. --- sc/source/ui/cctrl/dpcontrol.cxx | 2 -- 1 file changed, 2 deletions(-) diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index ce45f0c1b504..ca3d5d3d93ae 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -1240,8 +1240,6 @@ void ScDPFieldPopupWindow::setMemberSize(size_t n) void ScDPFieldPopupWindow::addMember(const OUString& rName, bool bVisible) { - fprintf(stdout, "ScDPFieldPopupWindow::addMember: name = '%s' visible = %d\n", - rtl::OUStringToOString(rName, RTL_TEXTENCODING_UTF8).getStr(), bVisible); Member aMember; aMember.maName = rName; aMember.mbVisible = bVisible; -- cgit v1.2.3 From 6f8305a93490ec9868510b62f522c7545ef73a5b Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Sat, 22 Aug 2009 04:15:31 +0000 Subject: more cleanup --- sc/inc/AccessibleFilterMenu.hxx | 1 - sc/source/ui/Accessibility/AccessibleFilterMenu.cxx | 3 --- sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx | 5 +---- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/sc/inc/AccessibleFilterMenu.hxx b/sc/inc/AccessibleFilterMenu.hxx index 93cfe1a78b21..f295950f1c82 100644 --- a/sc/inc/AccessibleFilterMenu.hxx +++ b/sc/inc/AccessibleFilterMenu.hxx @@ -40,7 +40,6 @@ #include #include -#include namespace com { namespace sun { namespace star { namespace accessibility { diff --git a/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx b/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx index ad50425db56e..5e576128ba87 100644 --- a/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx +++ b/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx @@ -47,8 +47,6 @@ #include "vcl/unohelp.hxx" #include "dpcontrol.hxx" -#include - #include #include #include @@ -69,7 +67,6 @@ using ::com::sun::star::uno::RuntimeException; using ::rtl::OUString; using ::std::for_each; using ::std::vector; -using ::std::set; // ============================================================================ diff --git a/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx b/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx index 76822ccb3820..1918a1c01e35 100644 --- a/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx +++ b/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx @@ -43,8 +43,6 @@ #include #include -#include - using namespace ::com::sun::star; using namespace ::com::sun::star::accessibility; using namespace ::com::sun::star::accessibility::AccessibleStateType; @@ -56,7 +54,6 @@ using ::com::sun::star::uno::UNO_QUERY; using ::com::sun::star::lang::IndexOutOfBoundsException; using ::com::sun::star::uno::RuntimeException; using ::rtl::OUString; -using ::std::vector; ScAccessibleFilterMenuItem::ScAccessibleFilterMenuItem( const Reference& rxParent, ScMenuFloatingWindow* pWin, const OUString& rName, size_t nMenuPos) : @@ -96,7 +93,7 @@ Reference ScAccessibleFilterMenuItem::getAccessibleStateSet OUString ScAccessibleFilterMenuItem::getImplementationName() throw (RuntimeException) { - return OUString::createFromAscii("ScAccessibleFilterMenuItem - implementation name"); + return OUString::createFromAscii("ScAccessibleFilterMenuItem"); } // XAccessibleAction -- cgit v1.2.3 -- cgit v1.2.3 -- cgit v1.2.3 -- cgit v1.2.3 From fddbd3634adb04995106aff39334c1ddf55013bc Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Tue, 25 Aug 2009 15:36:57 +0000 Subject: Reorganized accessible menu implementation so that the toplevel window is treated as menu. It's cleaner and less complicated this way. --- sc/inc/AccessibleFilterMenu.hxx | 10 +++++ sc/inc/AccessibleFilterMenuItem.hxx | 9 +++- sc/inc/AccessibleFilterTopWindow.hxx | 5 ++- .../ui/Accessibility/AccessibleFilterMenu.cxx | 52 +++++++++++++++++++++- .../ui/Accessibility/AccessibleFilterMenuItem.cxx | 27 +++++++++++ .../ui/Accessibility/AccessibleFilterTopWindow.cxx | 28 ++++++------ sc/source/ui/cctrl/dpcontrol.cxx | 9 ++-- sc/source/ui/inc/dpcontrol.hxx | 3 +- 8 files changed, 122 insertions(+), 21 deletions(-) diff --git a/sc/inc/AccessibleFilterMenu.hxx b/sc/inc/AccessibleFilterMenu.hxx index f295950f1c82..54194a2d4acf 100644 --- a/sc/inc/AccessibleFilterMenu.hxx +++ b/sc/inc/AccessibleFilterMenu.hxx @@ -161,6 +161,16 @@ public: void setMenuPos(size_t nMenuPos); void setEnabled(bool bEnabled); +protected: + + sal_Int32 getMenuItemCount() const; + + virtual Rectangle GetBoundingBoxOnScreen() const + throw (::com::sun::star::uno::RuntimeException); + + virtual Rectangle GetBoundingBox() const + throw (::com::sun::star::uno::RuntimeException); + private: bool isSelected() const; bool isFocused() const; diff --git a/sc/inc/AccessibleFilterMenuItem.hxx b/sc/inc/AccessibleFilterMenuItem.hxx index 10d471f4b245..f5ad0fd5d74b 100644 --- a/sc/inc/AccessibleFilterMenuItem.hxx +++ b/sc/inc/AccessibleFilterMenuItem.hxx @@ -97,9 +97,16 @@ public: // Non-UNO Methods - void setEnabled(bool bEnabled); +protected: + + virtual Rectangle GetBoundingBoxOnScreen() const + throw (::com::sun::star::uno::RuntimeException); + + virtual Rectangle GetBoundingBox() const + throw (::com::sun::star::uno::RuntimeException); + private: bool isSelected() const; bool isFocused() const; diff --git a/sc/inc/AccessibleFilterTopWindow.hxx b/sc/inc/AccessibleFilterTopWindow.hxx index 801d84d0c5fb..e901949286a1 100644 --- a/sc/inc/AccessibleFilterTopWindow.hxx +++ b/sc/inc/AccessibleFilterTopWindow.hxx @@ -31,13 +31,14 @@ #ifndef SC_ACCESSIBLEFILTERTOPWINDOW_HXX #define SC_ACCESSIBLEFILTERTOPWINDOW_HXX -#include "AccessibleContextBase.hxx" +//#include "AccessibleContextBase.hxx" +#include "AccessibleFilterMenu.hxx" #include "cppuhelper/implbase1.hxx" class ScDPFieldPopupWindow; class ScDocument; -class ScAccessibleFilterTopWindow : public ScAccessibleContextBase +class ScAccessibleFilterTopWindow : public ScAccessibleFilterMenu { public: ScAccessibleFilterTopWindow( diff --git a/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx b/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx index 5e576128ba87..14824b920c85 100644 --- a/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx +++ b/sc/source/ui/Accessibility/AccessibleFilterMenu.cxx @@ -155,7 +155,7 @@ OUString ScAccessibleFilterMenu::getAccessibleName() throw (RuntimeException) sal_Int32 ScAccessibleFilterMenu::getAccessibleChildCount() throw (RuntimeException) { - return maMenuItems.size(); + return getMenuItemCount(); } Reference ScAccessibleFilterMenu::getAccessibleChild(sal_Int32 nIndex) @@ -284,6 +284,51 @@ Sequence ScAccessibleFilterMenu::getImplementationId() return aId; } +Rectangle ScAccessibleFilterMenu::GetBoundingBoxOnScreen() const + throw (RuntimeException) +{ + if (mnMenuPos == ScMenuFloatingWindow::MENU_NOT_SELECTED) + return Rectangle(); + + // Menu object's bounding box is the bounding box of the menu item that + // launches the menu, which belongs to the parent window. + ScMenuFloatingWindow* pParentWin = mpWindow->getParentMenuWindow(); + if (!pParentWin) + return Rectangle(); + + if (!pParentWin->IsVisible()) + return Rectangle(); + + Point aPos = pParentWin->OutputToAbsoluteScreenPixel(Point(0,0)); + Point aMenuPos; + Size aMenuSize; + pParentWin->getMenuItemPosSize(mnMenuPos, aMenuPos, aMenuSize); + Rectangle aRect(aPos + aMenuPos, aMenuSize); + return aRect; +} + +Rectangle ScAccessibleFilterMenu::GetBoundingBox() const + throw (RuntimeException) +{ + if (mnMenuPos == ScMenuFloatingWindow::MENU_NOT_SELECTED) + return Rectangle(); + + // Menu object's bounding box is the bounding box of the menu item that + // launches the menu, which belongs to the parent window. + ScMenuFloatingWindow* pParentWin = mpWindow->getParentMenuWindow(); + if (!pParentWin) + return Rectangle(); + + if (!pParentWin->IsVisible()) + return Rectangle(); + + Point aMenuPos; + Size aMenuSize; + pParentWin->getMenuItemPosSize(mnMenuPos, aMenuPos, aMenuSize); + Rectangle aRect(aMenuPos, aMenuSize); + return aRect; +} + void ScAccessibleFilterMenu::appendMenuItem(const OUString& rName, bool bEnabled, size_t nMenuPos) { // Check weather this menu item is a sub menu or a regular menu item. @@ -317,6 +362,11 @@ void ScAccessibleFilterMenu::setEnabled(bool bEnabled) mbEnabled = bEnabled; } +sal_Int32 ScAccessibleFilterMenu::getMenuItemCount() const +{ + return maMenuItems.size(); +} + bool ScAccessibleFilterMenu::isSelected() const { // Check to see if any of the child menu items is selected. diff --git a/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx b/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx index 1918a1c01e35..0ab5fa270688 100644 --- a/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx +++ b/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx @@ -157,6 +157,33 @@ void ScAccessibleFilterMenuItem::setEnabled(bool bEnabled) mbEnabled = bEnabled; } +Rectangle ScAccessibleFilterMenuItem::GetBoundingBoxOnScreen() const + throw (RuntimeException) +{ + if (!mpWindow->IsVisible()) + return Rectangle(); + + Point aPos = mpWindow->OutputToAbsoluteScreenPixel(Point(0,0)); + Point aMenuPos; + Size aMenuSize; + mpWindow->getMenuItemPosSize(mnMenuPos, aMenuPos, aMenuSize); + Rectangle aRect(aPos + aMenuPos, aMenuSize); + return aRect; +} + +Rectangle ScAccessibleFilterMenuItem::GetBoundingBox() const + throw (RuntimeException) +{ + if (!mpWindow->IsVisible()) + return Rectangle(); + + Point aMenuPos; + Size aMenuSize; + mpWindow->getMenuItemPosSize(mnMenuPos, aMenuPos, aMenuSize); + Rectangle aRect(aMenuPos, aMenuSize); + return aRect; +} + void ScAccessibleFilterMenuItem::updateStateSet() { if (!mxStateSet.is()) diff --git a/sc/source/ui/Accessibility/AccessibleFilterTopWindow.cxx b/sc/source/ui/Accessibility/AccessibleFilterTopWindow.cxx index 02fafd87e138..832cb37dd096 100644 --- a/sc/source/ui/Accessibility/AccessibleFilterTopWindow.cxx +++ b/sc/source/ui/Accessibility/AccessibleFilterTopWindow.cxx @@ -46,47 +46,49 @@ using ::rtl::OUString; ScAccessibleFilterTopWindow::ScAccessibleFilterTopWindow( const Reference& rxParent, ScDPFieldPopupWindow* pWin, const OUString& rName, ScDocument* pDoc) : - ScAccessibleContextBase(rxParent, AccessibleRole::PANEL), + ScAccessibleFilterMenu(rxParent, pWin, rName, ScMenuFloatingWindow::MENU_NOT_SELECTED, pDoc), mpWindow(pWin), mpDoc(pDoc) { - fprintf(stdout, "ScAccessibleFilterTopWindow::ScAccessibleFilterTopWindow: ctor (%p)\n", this); SetName(rName); } ScAccessibleFilterTopWindow::~ScAccessibleFilterTopWindow() { - fprintf(stdout, "ScAccessibleFilterTopWindow::~ScAccessibleFilterTopWindow: dtor (%p)\n", this); } // XAccessibleContext sal_Int32 ScAccessibleFilterTopWindow::getAccessibleChildCount() throw (RuntimeException) { - return 7; + sal_Int32 nMenuCount = getMenuItemCount(); + return nMenuCount + 6; } Reference ScAccessibleFilterTopWindow::getAccessibleChild( sal_Int32 nIndex) throw (RuntimeException, IndexOutOfBoundsException) { - if (nIndex >= 7) + if (nIndex >= getAccessibleChildCount()) throw IndexOutOfBoundsException(); + sal_Int32 nMenuCount = getMenuItemCount(); + if (nIndex < nMenuCount) + return ScAccessibleFilterMenu::getAccessibleChild(nIndex); + + nIndex -= nMenuCount; switch (nIndex) { case 0: - return getAccessibleChildMenu(); - case 1: return mxAccListBox; - case 2: + case 1: return mxAccToggleAll; - case 3: + case 2: return mxAccSingleOnBtn; - case 4: + case 3: return mxAccSingleOffBtn; - case 5: + case 4: return mxAccOkBtn; - case 6: + case 5: return mxAccCancelBtn; default: ; @@ -103,7 +105,7 @@ OUString ScAccessibleFilterTopWindow::getImplementationName() throw (RuntimeExce Reference ScAccessibleFilterTopWindow::getAccessibleChildMenu() { if (!mxAccMenu.is()) - mxAccMenu.set(new ScAccessibleFilterMenu(this, mpWindow, getAccessibleName(), 999, mpDoc)); + mxAccMenu.set(new ScAccessibleFilterMenu(this, mpWindow, getAccessibleName(), ScMenuFloatingWindow::MENU_NOT_SELECTED, mpDoc)); return mxAccMenu; } diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index ca3d5d3d93ae..c46a83e4f8b8 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -830,6 +830,11 @@ void ScMenuFloatingWindow::getMenuItemPosSize(size_t nPos, Point& rPos, Size& rS rSize = aSize1; } +ScMenuFloatingWindow* ScMenuFloatingWindow::getParentMenuWindow() const +{ + return mpParentMenu; +} + size_t ScMenuFloatingWindow::getEnclosingMenuItem(const Point& rPos) const { size_t n = maMenuItems.size(); @@ -1212,9 +1217,7 @@ Reference ScDPFieldPopupWindow::CreateAccessible() mxAccessible.set(new ScAccessibleFilterTopWindow( GetAccessibleParentWindow()->GetAccessible(), this, getName(), getDoc())); ScAccessibleFilterTopWindow* pAccTop = static_cast(mxAccessible.get()); - Reference xAccMenu = pAccTop->getAccessibleChildMenu(); - ScAccessibleFilterMenu* pAccMenu = static_cast(xAccMenu.get()); - fillMenuItemsToAccessible(pAccMenu); + fillMenuItemsToAccessible(pAccTop); pAccTop->setAccessibleChild( maChecks.CreateAccessible(), ScAccessibleFilterTopWindow::LISTBOX); diff --git a/sc/source/ui/inc/dpcontrol.hxx b/sc/source/ui/inc/dpcontrol.hxx index dbbbcb55ed49..77fae133ce81 100644 --- a/sc/source/ui/inc/dpcontrol.hxx +++ b/sc/source/ui/inc/dpcontrol.hxx @@ -140,6 +140,8 @@ public: const ::rtl::OUString& getName() const; void executeMenuItem(size_t nPos); + void getMenuItemPosSize(size_t nPos, Point& rPos, Size& rSize) const; + ScMenuFloatingWindow* getParentMenuWindow() const; protected: @@ -167,7 +169,6 @@ private: void resizeToFitMenuItems(); void highlightMenuItem(size_t nPos, bool bSelected); - void getMenuItemPosSize(size_t nPos, Point& rPos, Size& rSize) const; size_t getEnclosingMenuItem(const Point& rPos) const; size_t getSubMenuPos(ScMenuFloatingWindow* pSubMenu); -- cgit v1.2.3 From 1d6010c7862a730a67b3a015a3484d07fe96320a Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 26 Aug 2009 00:41:08 +0000 Subject: added a new vcl event type that carries accessible object so that it can be used from the new menu popup window. --- vcl/inc/vcl/vclevent.hxx | 18 ++++++++++++++++++ vcl/inc/vcl/window.hxx | 2 +- vcl/source/app/vclevent.cxx | 14 ++++++++++++++ vcl/source/window/window.cxx | 5 +++++ vcl/unx/gtk/a11y/atkutil.cxx | 11 ++++++++++- vcl/unx/gtk/a11y/atkwindow.cxx | 26 ++++++++++++++++++++++++-- 6 files changed, 72 insertions(+), 4 deletions(-) diff --git a/vcl/inc/vcl/vclevent.hxx b/vcl/inc/vcl/vclevent.hxx index 88ad880e26ab..c6412d94c852 100644 --- a/vcl/inc/vcl/vclevent.hxx +++ b/vcl/inc/vcl/vclevent.hxx @@ -35,11 +35,19 @@ #include #include +#include + #include class Window; class Menu; +namespace com { namespace sun { namespace star { + namespace accessibility { + class XAccessible; + } +}}} + #define VCLEVENT_OBJECT_DYING 1 // VclWindowEvent: @@ -235,6 +243,16 @@ public: USHORT GetItemPos() const { return mnPos; } }; +class VCL_DLLPUBLIC VclAccessibleEvent: public VclSimpleEvent +{ +public: + VclAccessibleEvent( ULONG n, const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxAccessible ); + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > GetAccessible() const; + +private: + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > mxAccessible; +}; + class VCL_DLLPUBLIC VclEventListeners : public std::list { public: diff --git a/vcl/inc/vcl/window.hxx b/vcl/inc/vcl/window.hxx index 3f05383d4f80..75ccd5f0acd4 100644 --- a/vcl/inc/vcl/window.hxx +++ b/vcl/inc/vcl/window.hxx @@ -582,7 +582,7 @@ protected: void ImplCallEventListeners( ULONG nEvent, void* pData = NULL ); void CallEventListeners( ULONG nEvent, void* pData = NULL ); - + void FireVclEvent( VclSimpleEvent* pEvent ); // FIXME: this is a hack to workaround missing layout functionality SAL_DLLPRIVATE void ImplAdjustNWFSizes(); diff --git a/vcl/source/app/vclevent.cxx b/vcl/source/app/vclevent.cxx index 8ebc65c8a3f6..721dd9fd0419 100644 --- a/vcl/source/app/vclevent.cxx +++ b/vcl/source/app/vclevent.cxx @@ -34,10 +34,24 @@ #include "vcl/vclevent.hxx" #include "vcl/svdata.hxx" +#include + +using ::com::sun::star::uno::Reference; +using ::com::sun::star::accessibility::XAccessible; + TYPEINIT0(VclSimpleEvent); TYPEINIT1(VclWindowEvent, VclSimpleEvent); TYPEINIT1(VclMenuEvent, VclSimpleEvent); +VclAccessibleEvent::VclAccessibleEvent( ULONG n, const Reference& rxAccessible ) : + VclSimpleEvent(n), + mxAccessible(rxAccessible) {} + +Reference VclAccessibleEvent::GetAccessible() const +{ + return mxAccessible; +} + void VclEventListeners::Call( VclSimpleEvent* pEvent ) const { // Copy the list, because this can be destroyed when calling a Link... diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 279775d712e4..30ba250d2c1a 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -5367,6 +5367,11 @@ void Window::CallEventListeners( ULONG nEvent, void* pData ) } } +void Window::FireVclEvent( VclSimpleEvent* pEvent ) +{ + ImplGetSVData()->mpApp->ImplCallEventListeners(pEvent); +} + // ----------------------------------------------------------------------- void Window::AddEventListener( const Link& rEventListener ) diff --git a/vcl/unx/gtk/a11y/atkutil.cxx b/vcl/unx/gtk/a11y/atkutil.cxx index 91f4b3280448..1daf1e4ec845 100644 --- a/vcl/unx/gtk/a11y/atkutil.cxx +++ b/vcl/unx/gtk/a11y/atkutil.cxx @@ -628,7 +628,16 @@ long WindowEventHandler(void *, ::VclSimpleEvent const * pEvent) static_cast< ::VclWindowEvent const * >(pEvent)->GetWindow()); */ case VCLEVENT_MENU_HIGHLIGHT: - handle_menu_highlighted(static_cast< ::VclMenuEvent const * >(pEvent)); + if (const VclMenuEvent* pMenuEvent = dynamic_cast(pEvent)) + { + handle_menu_highlighted(pMenuEvent); + } + else if (const VclAccessibleEvent* pAccEvent = dynamic_cast(pEvent)) + { + uno::Reference< accessibility::XAccessible > xAccessible = pAccEvent->GetAccessible(); + if (xAccessible.is()) + atk_wrapper_focus_tracker_notify_when_idle(xAccessible); + } break; case VCLEVENT_TOOLBOX_HIGHLIGHT: diff --git a/vcl/unx/gtk/a11y/atkwindow.cxx b/vcl/unx/gtk/a11y/atkwindow.cxx index 4a64a4959977..83f4c1035916 100644 --- a/vcl/unx/gtk/a11y/atkwindow.cxx +++ b/vcl/unx/gtk/a11y/atkwindow.cxx @@ -114,6 +114,7 @@ init_from_window( AtkObject *accessible, Window *pWindow ) sal_uInt16 nStackLevel = static_cast(pChild)->GetMenuStackLevel(); if (nStackLevel == 0) { + // This is a top-level menu popup. Register it. role = ATK_ROLE_POPUP_MENU; pChild->SetAccessibleRole( AccessibleRole::POPUP_MENU ); accessible->name = g_strdup( rtl::OUStringToOString( pChild->GetText(), RTL_TEXTENCODING_UTF8 ).getStr() ); @@ -147,6 +148,19 @@ ooo_window_wrapper_real_focus_gtk (GtkWidget *, GdkEventFocus *) /*****************************************************************************/ +static bool +isChildPopupMenu(Window* pWindow) +{ + Window* pChild = pWindow->GetAccessibleChildWindow(0); + if (!pChild) + return false; + + if (WINDOW_FLOATINGWINDOW != pChild->GetType()) + return false; + + return static_cast(pChild)->IsPopupMenu(); +} + static void ooo_window_wrapper_real_initialize(AtkObject *obj, gpointer data) { @@ -168,8 +182,16 @@ ooo_window_wrapper_real_initialize(AtkObject *obj, gpointer data) */ if( WINDOW_BORDERWINDOW == pWindow->GetType() ) { - ooo_wrapper_registry_add( xAccessible, obj ); - g_object_set_data( G_OBJECT(obj), "ooo:atk-wrapper-key", xAccessible.get() ); + if ( isChildPopupMenu(pWindow) ) + { + AtkObject *child = atk_object_wrapper_new( xAccessible, obj ); + ooo_wrapper_registry_add( xAccessible, child ); + } + else + { + ooo_wrapper_registry_add( xAccessible, obj ); + g_object_set_data( G_OBJECT(obj), "ooo:atk-wrapper-key", xAccessible.get() ); + } } else { -- cgit v1.2.3 From 4848dbac7b540e2a0d64521e19765a261f7e7305 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 26 Aug 2009 00:48:56 +0000 Subject: Fire a menu highlight event on menu item selection change, to get the accessibility to work correctly. --- sc/source/ui/cctrl/dpcontrol.cxx | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index c46a83e4f8b8..e17ff0cd1dab 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -47,9 +47,11 @@ #include "AccessibleFilterTopWindow.hxx" #include +#include using ::com::sun::star::uno::Reference; using ::com::sun::star::accessibility::XAccessible; +using ::com::sun::star::accessibility::XAccessibleContext; using ::rtl::OUString; using ::rtl::OUStringHash; using ::std::vector; @@ -706,6 +708,26 @@ void ScMenuFloatingWindow::selectMenuItem(size_t nPos, bool bSelected, bool bSub else queueCloseSubMenu(); } + + if (mxAccessible.is()) + { + // Fire a menu highlight event since the accessibility framework + // needs this to track focus on menu items. + do + { + Reference xAccCxt = mxAccessible->getAccessibleContext(); + if (!xAccCxt.is()) + break; + + Reference xAccMenu = xAccCxt->getAccessibleChild(nPos); + if (!xAccMenu.is()) + break; + + VclAccessibleEvent aEvent(VCLEVENT_MENU_HIGHLIGHT, xAccMenu); + FireVclEvent(&aEvent); + } + while (false); + } } } -- cgit v1.2.3 From 443f0efd5acca6afe87f75d9f9f75844596622ac Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 26 Aug 2009 02:47:23 +0000 Subject: clear selected menu item when the popup ends. --- sc/source/ui/cctrl/dpcontrol.cxx | 49 ++++++++++++++++++++++++---------------- sc/source/ui/inc/dpcontrol.hxx | 8 +++++++ 2 files changed, 37 insertions(+), 20 deletions(-) diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index e17ff0cd1dab..8b4c1ba6812e 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -303,6 +303,7 @@ ScMenuFloatingWindow::ScMenuFloatingWindow(Window* pParent, ScDocument* pDoc, US SetFont(maLabelFont); SetText(OUString::createFromAscii("ScMenuFloatingWindow")); + SetPopupModeEndHdl( LINK(this, ScMenuFloatingWindow, PopupEndHdl) ); } ScMenuFloatingWindow::~ScMenuFloatingWindow() @@ -537,6 +538,8 @@ void ScMenuFloatingWindow::setSelectedMenuItem(size_t nPos, bool bSubMenuTimer, selectMenuItem(mnSelectedMenu, false, bSubMenuTimer); selectMenuItem(nPos, true, bSubMenuTimer); mnSelectedMenu = nPos; + + fireMenuHighlightedEvent(); } size_t ScMenuFloatingWindow::getSelectedMenuItem() const @@ -708,26 +711,6 @@ void ScMenuFloatingWindow::selectMenuItem(size_t nPos, bool bSelected, bool bSub else queueCloseSubMenu(); } - - if (mxAccessible.is()) - { - // Fire a menu highlight event since the accessibility framework - // needs this to track focus on menu items. - do - { - Reference xAccCxt = mxAccessible->getAccessibleContext(); - if (!xAccCxt.is()) - break; - - Reference xAccMenu = xAccCxt->getAccessibleChild(nPos); - if (!xAccMenu.is()) - break; - - VclAccessibleEvent aEvent(VCLEVENT_MENU_HIGHLIGHT, xAccMenu); - FireVclEvent(&aEvent); - } - while (false); - } } } @@ -883,6 +866,26 @@ size_t ScMenuFloatingWindow::getSubMenuPos(ScMenuFloatingWindow* pSubMenu) return MENU_NOT_SELECTED; } +void ScMenuFloatingWindow::fireMenuHighlightedEvent() +{ + if (mnSelectedMenu == MENU_NOT_SELECTED) + return; + + if (!mxAccessible.is()) + return; + + Reference xAccCxt = mxAccessible->getAccessibleContext(); + if (!xAccCxt.is()) + return; + + Reference xAccMenu = xAccCxt->getAccessibleChild(mnSelectedMenu); + if (!xAccMenu.is()) + return; + + VclAccessibleEvent aEvent(VCLEVENT_MENU_HIGHLIGHT, xAccMenu); + FireVclEvent(&aEvent); +} + void ScMenuFloatingWindow::setSubMenuFocused(ScMenuFloatingWindow* pSubMenu) { maCloseTimer.reset(); @@ -941,6 +944,12 @@ void ScMenuFloatingWindow::terminateAllPopupMenus() mpParentMenu->terminateAllPopupMenus(); } +IMPL_LINK( ScMenuFloatingWindow, PopupEndHdl, void*, EMPTYARG ) +{ + clearSelectedMenuItem(); + return 0; +} + // ============================================================================ ScDPFieldPopupWindow::Member::Member() : diff --git a/sc/source/ui/inc/dpcontrol.hxx b/sc/source/ui/inc/dpcontrol.hxx index 77fae133ce81..d8300ad25030 100644 --- a/sc/source/ui/inc/dpcontrol.hxx +++ b/sc/source/ui/inc/dpcontrol.hxx @@ -172,6 +172,12 @@ private: size_t getEnclosingMenuItem(const Point& rPos) const; size_t getSubMenuPos(ScMenuFloatingWindow* pSubMenu); + /** + * Fire a menu highlight event since the accessibility framework needs + * this to track focus on menu items. + */ + void fireMenuHighlightedEvent(); + /** * Make sure that the specified submenu is permanently up, the submenu * close timer is not active, and the correct menu item associated with @@ -198,6 +204,8 @@ private: */ void terminateAllPopupMenus(); + DECL_LINK( PopupEndHdl, void* ); + private: struct MenuItemData -- cgit v1.2.3 From b4049f44bf9bb5c004d238063cf8ef56951553ce Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 26 Aug 2009 03:04:42 +0000 Subject: changed endSubMenu() to not rely on the open timer data to dismiss the sub menu. --- sc/source/ui/cctrl/dpcontrol.cxx | 17 +++++++++++------ sc/source/ui/inc/dpcontrol.hxx | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index 8b4c1ba6812e..f4fbd02266fc 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -358,7 +358,7 @@ void ScMenuFloatingWindow::KeyInput(const KeyEvent& rKEvt) break; case KEY_LEFT: if (mpParentMenu) - mpParentMenu->endSubMenu(); + mpParentMenu->endSubMenu(this); break; case KEY_RIGHT: { @@ -636,14 +636,19 @@ void ScMenuFloatingWindow::launchSubMenu(bool bSetMenuPos) SetPopupModeFlags(nOldFlags); } -void ScMenuFloatingWindow::endSubMenu() +void ScMenuFloatingWindow::endSubMenu(ScMenuFloatingWindow* pSubMenu) { + if (!pSubMenu) + return; + + pSubMenu->EndPopupMode(); + + size_t nMenuPos = getSubMenuPos(pSubMenu); + if (nMenuPos != MENU_NOT_SELECTED) + highlightMenuItem(nMenuPos, true); + if (maOpenTimer.mpSubMenu) - { - maOpenTimer.mpSubMenu->EndPopupMode(); maOpenTimer.mpSubMenu = NULL; - highlightMenuItem(maOpenTimer.mnMenuPos, true); - } } void ScMenuFloatingWindow::fillMenuItemsToAccessible(ScAccessibleFilterMenu* pAccMenu) const diff --git a/sc/source/ui/inc/dpcontrol.hxx b/sc/source/ui/inc/dpcontrol.hxx index d8300ad25030..4123d75ca4cd 100644 --- a/sc/source/ui/inc/dpcontrol.hxx +++ b/sc/source/ui/inc/dpcontrol.hxx @@ -152,7 +152,7 @@ protected: void queueLaunchSubMenu(size_t nPos, ScMenuFloatingWindow* pMenu); void queueCloseSubMenu(); void launchSubMenu(bool bSetMenuPos); - void endSubMenu(); + void endSubMenu(ScMenuFloatingWindow* pSubMenu); void fillMenuItemsToAccessible(ScAccessibleFilterMenu* pAccMenu) const; -- cgit v1.2.3 From b0838ee5af5000192b5784ca1da504be1db0b7cf Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 26 Aug 2009 03:14:06 +0000 Subject: read the highlighted menu of the parent popup when the child popup gets dismissed. --- sc/source/ui/cctrl/dpcontrol.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index f4fbd02266fc..7423ea4278fb 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -642,13 +642,15 @@ void ScMenuFloatingWindow::endSubMenu(ScMenuFloatingWindow* pSubMenu) return; pSubMenu->EndPopupMode(); + maOpenTimer.reset(); size_t nMenuPos = getSubMenuPos(pSubMenu); if (nMenuPos != MENU_NOT_SELECTED) + { highlightMenuItem(nMenuPos, true); - - if (maOpenTimer.mpSubMenu) - maOpenTimer.mpSubMenu = NULL; + mnSelectedMenu = nMenuPos; + fireMenuHighlightedEvent(); + } } void ScMenuFloatingWindow::fillMenuItemsToAccessible(ScAccessibleFilterMenu* pAccMenu) const -- cgit v1.2.3 From 5e8d3e43d3e4689d91d2f94d826146c076f907e6 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 26 Aug 2009 19:07:14 +0000 Subject: TAB key to cycle through controls. --- sc/source/ui/cctrl/dpcontrol.cxx | 57 ++++++++++++++++++++++++++++++++++++++++ sc/source/ui/inc/dpcontrol.hxx | 6 +++++ 2 files changed, 63 insertions(+) diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index 7423ea4278fb..4c9dee6b4af1 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -985,11 +985,21 @@ ScDPFieldPopupWindow::ScDPFieldPopupWindow(Window* pParent, ScDocument* pDoc) : maBtnUnselectSingle(this, 0), maBtnOk(this), maBtnCancel(this), + mnCurTabStop(0), mpExtendedData(NULL), mpOKAction(NULL), maWndSize(160, 330), mePrevToggleAllState(STATE_DONTKNOW) { + maTabStopCtrls.reserve(7); + maTabStopCtrls.push_back(this); + maTabStopCtrls.push_back(&maChecks); + maTabStopCtrls.push_back(&maChkToggleAll); + maTabStopCtrls.push_back(&maBtnSelectSingle); + maTabStopCtrls.push_back(&maBtnUnselectSingle); + maTabStopCtrls.push_back(&maBtnOk); + maTabStopCtrls.push_back(&maBtnCancel); + const StyleSettings& rStyle = GetSettings().GetStyleSettings(); Point aPos; @@ -1157,6 +1167,28 @@ void ScDPFieldPopupWindow::selectCurrentMemberOnly(bool bSet) maChecks.CheckEntryPos(nSelected, bSet); } +void ScDPFieldPopupWindow::cycleFocus(bool bReverse) +{ + maTabStopCtrls[mnCurTabStop]->LoseFocus(); + if (mnCurTabStop == 0) + clearSelectedMenuItem(); + + if (bReverse) + { + if (mnCurTabStop > 0) + --mnCurTabStop; + else + mnCurTabStop = maTabStopCtrls.size() - 1; + } + else + { + ++mnCurTabStop; + if (mnCurTabStop >= maTabStopCtrls.size()) + mnCurTabStop = 0; + } + maTabStopCtrls[mnCurTabStop]->GetFocus(); +} + IMPL_LINK( ScDPFieldPopupWindow, ButtonHdl, Button*, pBtn ) { if (pBtn == &maBtnOk) @@ -1225,6 +1257,26 @@ void ScDPFieldPopupWindow::MouseMove(const MouseEvent& rMEvt) queueCloseSubMenu(); } +long ScDPFieldPopupWindow::Notify(NotifyEvent& rNEvt) +{ + switch (rNEvt.GetType()) + { + case EVENT_KEYUP: + { + const KeyEvent* pKeyEvent = rNEvt.GetKeyEvent(); + const KeyCode& rCode = pKeyEvent->GetKeyCode(); + bool bShift = rCode.IsShift(); + if (rCode.GetCode() == KEY_TAB) + { + cycleFocus(bShift); + return true; + } + } + break; + } + return ScMenuFloatingWindow::Notify(rNEvt); +} + void ScDPFieldPopupWindow::Paint(const Rectangle& rRect) { ScMenuFloatingWindow::Paint(rRect); @@ -1248,6 +1300,11 @@ void ScDPFieldPopupWindow::Paint(const Rectangle& rRect) DrawRect(Rectangle(aPos,aSize)); } +Window* ScDPFieldPopupWindow::GetPreferredKeyInputWindow() +{ + return maTabStopCtrls[mnCurTabStop]; +} + Reference ScDPFieldPopupWindow::CreateAccessible() { if (!mxAccessible.is()) diff --git a/sc/source/ui/inc/dpcontrol.hxx b/sc/source/ui/inc/dpcontrol.hxx index 4123d75ca4cd..ffab5f887238 100644 --- a/sc/source/ui/inc/dpcontrol.hxx +++ b/sc/source/ui/inc/dpcontrol.hxx @@ -273,7 +273,9 @@ public: virtual ~ScDPFieldPopupWindow(); virtual void MouseMove(const MouseEvent& rMEvt); + virtual long Notify(NotifyEvent& rNEvt); virtual void Paint(const Rectangle& rRect); + virtual Window* GetPreferredKeyInputWindow(); virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible(); void setMemberSize(size_t n); @@ -334,6 +336,7 @@ private: void setAllMemberState(bool bSet); void selectCurrentMemberOnly(bool bSet); + void cycleFocus(bool bReverse = false); DECL_LINK( ButtonHdl, Button* ); DECL_LINK( TriStateHdl, TriStateBox* ); @@ -349,6 +352,9 @@ private: OKButton maBtnOk; CancelButton maBtnCancel; + ::std::vector maTabStopCtrls; + size_t mnCurTabStop; + ::std::vector maMembers; ::std::auto_ptr mpExtendedData; ::std::auto_ptr mpOKAction; -- cgit v1.2.3 From 22aa57f666acce83cf8227eb54ee386ae3be8445 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 26 Aug 2009 22:54:20 +0000 Subject: added the concept of "fake focus" to simulate focus inside floating windows. I need this because floating windows don't get system focus, but focus handling is needed for tab stops. --- vcl/inc/vcl/window.h | 3 ++- vcl/inc/vcl/window.hxx | 7 +++++++ vcl/source/window/window.cxx | 24 +++++++++++++++++++++--- 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/vcl/inc/vcl/window.h b/vcl/inc/vcl/window.h index d745f3dcf081..e18bc42b4b27 100644 --- a/vcl/inc/vcl/window.h +++ b/vcl/inc/vcl/window.h @@ -358,7 +358,8 @@ public: mbToolbarFloatingWindow:1, mbCallHandlersDuringInputDisabled:1, mbDisableAccessibleLabelForRelation:1, - mbDisableAccessibleLabeledByRelation:1; + mbDisableAccessibleLabeledByRelation:1, + mbFakeFocusSet:1; ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxDNDListenerContainer; }; diff --git a/vcl/inc/vcl/window.hxx b/vcl/inc/vcl/window.hxx index 75ccd5f0acd4..8c42ebd5dd21 100644 --- a/vcl/inc/vcl/window.hxx +++ b/vcl/inc/vcl/window.hxx @@ -899,6 +899,13 @@ public: USHORT GetGetFocusFlags() const; void GrabFocusToDocument(); + /** + * Set this when you need to act as if the window has focus even if it + * doesn't. This is necessary for implementing tab stops inside floating + * windows, but floating windows don't get focus from the system. + */ + void SetFakeFocus( bool bFocus ); + BOOL IsCompoundControl() const; BOOL HasCompoundControlFocus() const; diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 30ba250d2c1a..e4285482e3b7 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -690,6 +690,7 @@ void Window::ImplInitWindowData( WindowType nType ) mpWindowImpl->mbCallHandlersDuringInputDisabled = FALSE; // TRUE: call event handlers even if input is disabled mpWindowImpl->mbDisableAccessibleLabelForRelation = FALSE; // TRUE: do not set LabelFor relation on accessible objects mpWindowImpl->mbDisableAccessibleLabeledByRelation = FALSE; // TRUE: do not set LabeledBy relation on accessible objects + mpWindowImpl->mbFakeFocusSet = FALSE; // TRUE: pretend as if the window has focus. mbEnableRTL = Application::GetSettings().GetLayoutRTL(); // TRUE: this outdev will be mirrored if RTL window layout (UI mirroring) is globally active } @@ -3901,6 +3902,20 @@ void Window::ImplCallFocusChangeActivate( Window* pNewOverlapWindow, } } +static bool IsWindowFocused(const WindowImpl& rWinImpl) +{ + if (rWinImpl.mpSysObj) + return true; + + if (rWinImpl.mpFrameData->mbHasFocus) + return true; + + if (rWinImpl.mbFakeFocusSet) + return true; + + return false; +} + // ----------------------------------------------------------------------- void Window::ImplGrabFocus( USHORT nFlags ) { @@ -3972,9 +3987,7 @@ void Window::ImplGrabFocus( USHORT nFlags ) pFrame = pFrame->mpWindowImpl->mpFrameData->mpNextFrame; } - BOOL bHasFocus = TRUE; - if ( !mpWindowImpl->mpSysObj && !mpWindowImpl->mpFrameData->mbHasFocus ) - bHasFocus = FALSE; + bool bHasFocus = IsWindowFocused(*mpWindowImpl); BOOL bMustNotGrabFocus = FALSE; // #100242#, check parent hierarchy if some floater prohibits grab focus @@ -7738,6 +7751,11 @@ void Window::GrabFocusToDocument() } } +void Window::SetFakeFocus( bool bFocus ) +{ + ImplGetWindowImpl()->mbFakeFocusSet = bFocus; +} + // ----------------------------------------------------------------------- BOOL Window::HasChildPathFocus( BOOL bSystemWindow ) const -- cgit v1.2.3 From 984236d8b16fbb1c2728a7f4f2d25146865c6dee Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 26 Aug 2009 22:59:36 +0000 Subject: Use the new "fake focus" flag of Window to simulate focus state, in order to implement tab stops inside floating windows. --- sc/source/ui/cctrl/dpcontrol.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index 4c9dee6b4af1..32fd88421a84 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -1169,6 +1169,7 @@ void ScDPFieldPopupWindow::selectCurrentMemberOnly(bool bSet) void ScDPFieldPopupWindow::cycleFocus(bool bReverse) { + maTabStopCtrls[mnCurTabStop]->SetFakeFocus(false); maTabStopCtrls[mnCurTabStop]->LoseFocus(); if (mnCurTabStop == 0) clearSelectedMenuItem(); @@ -1186,7 +1187,8 @@ void ScDPFieldPopupWindow::cycleFocus(bool bReverse) if (mnCurTabStop >= maTabStopCtrls.size()) mnCurTabStop = 0; } - maTabStopCtrls[mnCurTabStop]->GetFocus(); + maTabStopCtrls[mnCurTabStop]->SetFakeFocus(true); + maTabStopCtrls[mnCurTabStop]->GrabFocus(); } IMPL_LINK( ScDPFieldPopupWindow, ButtonHdl, Button*, pBtn ) -- cgit v1.2.3 From 2e77984f087afde2ba0ca0edc5987a6f52d1095e Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 27 Aug 2009 02:35:27 +0000 Subject: Added a new child class of FloatingWindow to separate popup menu specific stuff to it. Let's leave the existing FloatingWindow alone. --- vcl/inc/vcl/floatwin.hxx | 4 -- vcl/inc/vcl/popupmenuwindow.hxx | 50 +++++++++++++++++++++ vcl/prj/d.lst | 1 + vcl/source/window/floatwin.cxx | 19 +------- vcl/source/window/makefile.mk | 1 + vcl/source/window/popupmenuwindow.cxx | 82 +++++++++++++++++++++++++++++++++++ vcl/unx/gtk/a11y/atkwindow.cxx | 12 +++-- 7 files changed, 143 insertions(+), 26 deletions(-) create mode 100644 vcl/inc/vcl/popupmenuwindow.hxx create mode 100644 vcl/source/window/popupmenuwindow.cxx diff --git a/vcl/inc/vcl/floatwin.hxx b/vcl/inc/vcl/floatwin.hxx index 351c31df1c1b..8dcba41e2a8e 100644 --- a/vcl/inc/vcl/floatwin.hxx +++ b/vcl/inc/vcl/floatwin.hxx @@ -157,10 +157,6 @@ public: const Link& GetPopupModeEndHdl() const { return maPopupModeEndHdl; } BOOL GrabsFocus() const { return mbGrabFocus; } - - sal_uInt16 GetMenuStackLevel() const; - void SetMenuStackLevel( sal_uInt16 nLevel ); - bool IsPopupMenu() const; }; #endif // _SV_FLOATWIN_HXX diff --git a/vcl/inc/vcl/popupmenuwindow.hxx b/vcl/inc/vcl/popupmenuwindow.hxx new file mode 100644 index 000000000000..af8d1f804598 --- /dev/null +++ b/vcl/inc/vcl/popupmenuwindow.hxx @@ -0,0 +1,50 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: floatwin.hxx,v $ + * $Revision: 1.3 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __POPUPMENUWINDOW_HXX__ +#define __POPUPMENUWINDOW_HXX__ + +#include "vcl/floatwin.hxx" + +class VCL_DLLPUBLIC PopupMenuFloatingWindow : public FloatingWindow +{ +private: + struct ImplData; + ImplData* mpImplData; +public: + PopupMenuFloatingWindow( Window* pParent, WinBits nStyle = (WB_SYSTEMFLOATWIN|WB_SYSTEMWINDOW|WB_NOBORDER) ); + ~PopupMenuFloatingWindow(); + + sal_uInt16 GetMenuStackLevel() const; + void SetMenuStackLevel( sal_uInt16 nLevel ); + bool IsPopupMenu() const; +}; + +#endif diff --git a/vcl/prj/d.lst b/vcl/prj/d.lst index d9c14f46b8d1..7ac2c74c96e8 100644 --- a/vcl/prj/d.lst +++ b/vcl/prj/d.lst @@ -84,6 +84,7 @@ mkdir: %_DEST%\inc%_EXT%\vcl\plug\vcl ..\inc\vcl\octree.hxx %_DEST%\inc%_EXT%\vcl\octree.hxx ..\inc\vcl\outdev.hxx %_DEST%\inc%_EXT%\vcl\outdev.hxx ..\inc\vcl\pointr.hxx %_DEST%\inc%_EXT%\vcl\pointr.hxx +..\inc\vcl\popupmenuwindow.hxx %_DEST%\inc%_EXT%\vcl\popupmenuwindow.hxx ..\inc\vcl\print.hxx %_DEST%\inc%_EXT%\vcl\print.hxx ..\inc\vcl\prndlg.hxx %_DEST%\inc%_EXT%\vcl\prndlg.hxx ..\inc\vcl\prntypes.hxx %_DEST%\inc%_EXT%\vcl\prntypes.hxx diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx index b29b74e63f78..7bcb90bbb8fc 100644 --- a/vcl/source/window/floatwin.cxx +++ b/vcl/source/window/floatwin.cxx @@ -48,7 +48,6 @@ #include #include -#include // ======================================================================= @@ -60,11 +59,9 @@ public: ToolBox* mpBox; Rectangle maItemEdgeClipRect; // used to clip the common edge between a toolbar item and the border of this window - sal_uInt16 mnMenuStackLevel; // in case it is used as a menu popup, store its stack level. 0 = top-level menu. }; -FloatingWindow::ImplData::ImplData() : - mnMenuStackLevel( ::std::numeric_limits::max() ) +FloatingWindow::ImplData::ImplData() { mpBox = NULL; } @@ -876,17 +873,3 @@ void FloatingWindow::RemovePopupModeWindow( Window* pWindow ) mpFirstPopupModeWin = NULL; } -sal_uInt16 FloatingWindow::GetMenuStackLevel() const -{ - return mpImplData->mnMenuStackLevel; -} - -void FloatingWindow::SetMenuStackLevel( sal_uInt16 nLevel ) -{ - mpImplData->mnMenuStackLevel = nLevel; -} - -bool FloatingWindow::IsPopupMenu() const -{ - return mpImplData->mnMenuStackLevel != ::std::numeric_limits::max(); -} diff --git a/vcl/source/window/makefile.mk b/vcl/source/window/makefile.mk index cdd4aef73bb0..a518ce124b74 100644 --- a/vcl/source/window/makefile.mk +++ b/vcl/source/window/makefile.mk @@ -69,6 +69,7 @@ SLOFILES= \ $(SLO)$/mnemonic.obj \ $(SLO)$/mnemonicengine.obj \ $(SLO)$/msgbox.obj \ + $(SLO)$/popupmenuwindow.obj \ $(SLO)$/scrwnd.obj \ $(SLO)$/seleng.obj \ $(SLO)$/split.obj \ diff --git a/vcl/source/window/popupmenuwindow.cxx b/vcl/source/window/popupmenuwindow.cxx new file mode 100644 index 000000000000..29d60a7cc02d --- /dev/null +++ b/vcl/source/window/popupmenuwindow.cxx @@ -0,0 +1,82 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: floatwin.hxx,v $ + * $Revision: 1.3 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_vcl.hxx" + +#include "vcl/popupmenuwindow.hxx" + +#include + +struct PopupMenuFloatingWindow::ImplData +{ + sal_uInt16 mnMenuStackLevel; // Store the stack level of a popup menu. 0 = top-level menu. + + ImplData(); + ~ImplData(); +}; + +PopupMenuFloatingWindow::ImplData::ImplData() : + mnMenuStackLevel( ::std::numeric_limits::max() ) +{ +} + +PopupMenuFloatingWindow::ImplData::~ImplData() +{ +} + +// ============================================================================ + +PopupMenuFloatingWindow::PopupMenuFloatingWindow( Window* pParent, WinBits nStyle ) : + FloatingWindow(pParent, nStyle), + mpImplData(new ImplData) +{ +} + +PopupMenuFloatingWindow::~PopupMenuFloatingWindow() +{ + delete mpImplData; +} + +sal_uInt16 PopupMenuFloatingWindow::GetMenuStackLevel() const +{ + return mpImplData->mnMenuStackLevel; +} + +void PopupMenuFloatingWindow::SetMenuStackLevel( sal_uInt16 nLevel ) +{ + mpImplData->mnMenuStackLevel = nLevel; +} + +bool PopupMenuFloatingWindow::IsPopupMenu() const +{ + return mpImplData->mnMenuStackLevel != ::std::numeric_limits::max(); +} + diff --git a/vcl/unx/gtk/a11y/atkwindow.cxx b/vcl/unx/gtk/a11y/atkwindow.cxx index 83f4c1035916..1bda4eea774e 100644 --- a/vcl/unx/gtk/a11y/atkwindow.cxx +++ b/vcl/unx/gtk/a11y/atkwindow.cxx @@ -33,7 +33,7 @@ #include #include -#include "vcl/floatwin.hxx" +#include "vcl/popupmenuwindow.hxx" #include "atkwindow.hxx" #include "atkwrapper.hxx" @@ -111,8 +111,8 @@ init_from_window( AtkObject *accessible, Window *pWindow ) } else if ( pWindow->GetType() == WINDOW_BORDERWINDOW && pChild->GetType() == WINDOW_FLOATINGWINDOW ) { - sal_uInt16 nStackLevel = static_cast(pChild)->GetMenuStackLevel(); - if (nStackLevel == 0) + PopupMenuFloatingWindow* p = dynamic_cast(pChild); + if (p && p->IsPopupMenu() && p->GetMenuStackLevel() == 0) { // This is a top-level menu popup. Register it. role = ATK_ROLE_POPUP_MENU; @@ -158,7 +158,11 @@ isChildPopupMenu(Window* pWindow) if (WINDOW_FLOATINGWINDOW != pChild->GetType()) return false; - return static_cast(pChild)->IsPopupMenu(); + PopupMenuFloatingWindow* p = dynamic_cast(pChild); + if (!p) + return false; + + return p->IsPopupMenu(); } static void -- cgit v1.2.3 From 2d16f08b453f2b2a4a32f902caae616318a19701 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 27 Aug 2009 02:36:18 +0000 Subject: Use the new PopupMenuFloatingWindow instead of FloatingWindow for popup menu specific stuff. --- sc/source/ui/cctrl/dpcontrol.cxx | 2 +- sc/source/ui/inc/dpcontrol.hxx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index 32fd88421a84..ee58c3dca601 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -283,7 +283,7 @@ IMPL_LINK( ScMenuFloatingWindow::SubMenuItemData, TimeoutHdl, void*, EMPTYARG ) size_t ScMenuFloatingWindow::MENU_NOT_SELECTED = 999; ScMenuFloatingWindow::ScMenuFloatingWindow(Window* pParent, ScDocument* pDoc, USHORT nMenuStackLevel) : - FloatingWindow(pParent, (WB_SYSTEMFLOATWIN|WB_SYSTEMWINDOW|WB_NOBORDER)), + PopupMenuFloatingWindow(pParent), maOpenTimer(this), maCloseTimer(this), maName(OUString::createFromAscii("ScMenuFloatingWindow")), diff --git a/sc/source/ui/inc/dpcontrol.hxx b/sc/source/ui/inc/dpcontrol.hxx index ffab5f887238..1b99f6a38842 100644 --- a/sc/source/ui/inc/dpcontrol.hxx +++ b/sc/source/ui/inc/dpcontrol.hxx @@ -34,7 +34,7 @@ #include "rtl/ustring.hxx" #include "tools/gen.hxx" #include "tools/fract.hxx" -#include "vcl/floatwin.hxx" +#include "vcl/popupmenuwindow.hxx" #include "vcl/button.hxx" #include "vcl/scrbar.hxx" #include "vcl/timer.hxx" @@ -100,7 +100,7 @@ private: // ============================================================================ -class ScMenuFloatingWindow : public FloatingWindow +class ScMenuFloatingWindow : public PopupMenuFloatingWindow { public: static size_t MENU_NOT_SELECTED; -- cgit v1.2.3 From 80434c86f9a52c5118b5590f6df3b95d732f1c9e Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 27 Aug 2009 02:36:18 +0000 Subject: Use the new PopupMenuFloatingWindow instead of FloatingWindow for popup menu specific stuff. --- accessibility/source/helper/acc_factory.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/accessibility/source/helper/acc_factory.cxx b/accessibility/source/helper/acc_factory.cxx index 643e55f4d5c5..bdb3787df6ad 100644 --- a/accessibility/source/helper/acc_factory.cxx +++ b/accessibility/source/helper/acc_factory.cxx @@ -72,7 +72,7 @@ #include #include #include -#include "vcl/floatwin.hxx" +#include "vcl/popupmenuwindow.hxx" #include @@ -377,9 +377,9 @@ inline bool hasFloatingChild(Window *pWindow) } else if ( nType == WINDOW_BORDERWINDOW && hasFloatingChild( pWindow ) ) { - FloatingWindow* pChild = static_cast( + PopupMenuFloatingWindow* pChild = dynamic_cast( pWindow->GetAccessibleChildWindow(0)); - if ( pChild->IsPopupMenu() ) + if ( pChild && pChild->IsPopupMenu() ) { // Get the accessible context from the child window. Reference xAccessible = pChild->CreateAccessible(); -- cgit v1.2.3 From 12f0af840124fa0f7acd088eafeb8e6d40c7c860 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Fri, 28 Aug 2009 04:13:17 +0000 Subject: fixed a build breakage. --- sc/source/filter/excel/xipivot.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sc/source/filter/excel/xipivot.cxx b/sc/source/filter/excel/xipivot.cxx index 24ebce414c6a..b77df97a0448 100644 --- a/sc/source/filter/excel/xipivot.cxx +++ b/sc/source/filter/excel/xipivot.cxx @@ -1435,7 +1435,7 @@ void XclImpPivotTable::MaybeRefresh() { // 'refresh table on load' flag is set. Refresh the table now. Some // Excel files contain partial table output when this flag is set. - mpDPObj->Output(); + mpDPObj->Output(maOutScRange.aStart); } } -- cgit v1.2.3 From 07d2c1eaebb1afc679438b15f0a26dd120e4c18e Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Tue, 1 Sep 2009 00:42:43 +0000 Subject: When assigning a display name to subtotal output, we should allow it only when the subtotal type of 'Automatic'. --- sc/source/ui/view/dbfunc3.cxx | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx index 307ccfc877bc..141d7e377f4e 100644 --- a/sc/source/ui/view/dbfunc3.cxx +++ b/sc/source/ui/view/dbfunc3.cxx @@ -44,19 +44,17 @@ #include #include #include +#include +#include +#include +#include #include #include -#include - -#include #include +#include #include -#include -#include -#include #include -#include -#include +#include #include "global.hxx" #include "globstr.hrc" @@ -1620,6 +1618,13 @@ void ScDBFunc::DataPilotInput( const ScAddress& rPos, const String& rString ) if (aData.GetDataDimensionCount() > 1) break; + // display name for subtotal is allowed only if the subtotal type is 'Automatic'. + if (pDim->GetSubTotalsCount() != 1) + break; + + if (pDim->GetSubTotalFunc(0) != sheet::GeneralFunction_AUTO) + break; + const OUString* pLayoutName = pMem->GetLayoutName(); String aMemberName; if (pLayoutName) -- cgit v1.2.3 From e862adfa2e024d63ad86c6ad043b7d073598bf69 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 2 Sep 2009 03:53:11 +0000 Subject: Initial work toward showing the display names (aka layout names) for field and field members when appropriate. Refactored ScDPLabelData quite a bit. I'm not entirely done with this yet. --- sc/inc/dpobject.hxx | 13 ++--- sc/inc/miscuno.hxx | 3 ++ sc/inc/pivot.hxx | 16 ++++-- sc/source/core/data/dpobject.cxx | 110 ++++++++++++++++++--------------------- sc/source/core/data/pivot2.cxx | 6 +++ sc/source/ui/dbgui/pvfundlg.cxx | 41 +++++++++++---- sc/source/ui/dbgui/pvlaydlg.cxx | 42 +++++++-------- sc/source/ui/unoobj/dapiuno.cxx | 2 +- sc/source/ui/unoobj/miscuno.cxx | 20 +++++++ sc/source/ui/view/dbfunc3.cxx | 2 +- sc/source/ui/view/gridwin2.cxx | 42 +++++++++++++-- 11 files changed, 186 insertions(+), 111 deletions(-) diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx index f86cafdf81fd..a2e8c3f9e7e2 100644 --- a/sc/inc/dpobject.hxx +++ b/sc/inc/dpobject.hxx @@ -36,6 +36,7 @@ #include "address.hxx" #include "collect.hxx" #include "dpoutput.hxx" +#include "pivot.hxx" #include #include @@ -212,16 +213,10 @@ public: sal_Int32 GetUsedHierarchy( sal_Int32 nDim ); BOOL GetMembersNA( sal_Int32 nDim, com::sun::star::uno::Reference< com::sun::star::container::XNameAccess >& xMembers ); - BOOL GetMembers( sal_Int32 nDim, - com::sun::star::uno::Sequence< rtl::OUString >& rMembers, - com::sun::star::uno::Sequence< sal_Bool >* pVisible = 0, - com::sun::star::uno::Sequence< sal_Bool >* pShowDet = 0 ); - BOOL GetMembersNA( sal_Int32 nDim, sal_Int32 nHier, com::sun::star::uno::Reference< com::sun::star::container::XNameAccess >& xMembers ); - BOOL GetMembers( sal_Int32 nDim, sal_Int32 nHier, - com::sun::star::uno::Sequence< rtl::OUString >& rMembers, - com::sun::star::uno::Sequence< sal_Bool >* pVisible = 0, - com::sun::star::uno::Sequence< sal_Bool >* pShowDet = 0 ); + + bool GetMemberNames( sal_Int32 nDim, ::com::sun::star::uno::Sequence< ::rtl::OUString >& rNames ); + bool GetMembers( sal_Int32 nDim, sal_Int32 nHier, ::std::vector& rMembers ); void UpdateReference( UpdateRefMode eUpdateRefMode, const ScRange& r, SCsCOL nDx, SCsROW nDy, SCsTAB nDz ); diff --git a/sc/inc/miscuno.hxx b/sc/inc/miscuno.hxx index 7f6bd4774faf..df60b2822cb8 100644 --- a/sc/inc/miscuno.hxx +++ b/sc/inc/miscuno.hxx @@ -285,6 +285,9 @@ public: static sal_Int32 GetEnumProperty( const com::sun::star::uno::Reference< com::sun::star::beans::XPropertySet>& xProp, const ::rtl::OUString& rName, long nDefault ); + static ::rtl::OUString GetStringProperty( + const com::sun::star::uno::Reference& xProp, + const ::rtl::OUString& rName, const ::rtl::OUString& rDefault ); static sal_Bool GetBoolFromAny( const com::sun::star::uno::Any& aAny ); static sal_Int16 GetInt16FromAny( const com::sun::star::uno::Any& aAny ); diff --git a/sc/inc/pivot.hxx b/sc/inc/pivot.hxx index e2b8ef3e01fa..6e3088eeb1e9 100644 --- a/sc/inc/pivot.hxx +++ b/sc/inc/pivot.hxx @@ -368,17 +368,25 @@ public: struct ScDPLabelData { - String maName; /// Visible name of the dimension. + String maName; /// Original name of the dimension. + ::rtl::OUString maLayoutName; /// Layout name (display name) SCsCOL mnCol; USHORT mnFuncMask; /// Page/Column/Row subtotal function. sal_Int32 mnUsedHier; /// Used hierarchy. bool mbShowAll; /// true = Show all (also empty) results. bool mbIsValue; /// true = Sum or count in data field. + struct Member + { + ::rtl::OUString maName; + ::rtl::OUString maLayoutName; + bool mbVisible; + bool mbShowDetails; + + Member(); + }; + ::std::vector maMembers; ::com::sun::star::uno::Sequence< ::rtl::OUString > maHiers; /// Hierarchies. - ::com::sun::star::uno::Sequence< ::rtl::OUString > maMembers; /// Members. - ::com::sun::star::uno::Sequence< sal_Bool > maVisible; /// Visibility of members. - ::com::sun::star::uno::Sequence< sal_Bool > maShowDet; /// Show details of members. ::com::sun::star::sheet::DataPilotFieldSortInfo maSortInfo; /// Sorting info. ::com::sun::star::sheet::DataPilotFieldLayoutInfo maLayoutInfo; /// Layout info. ::com::sun::star::sheet::DataPilotFieldAutoShowInfo maShowInfo; /// AutoShow info. diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index bd11044c80b9..67c8c21d31c7 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -75,6 +75,7 @@ #include // IsNumberFormat #include +#include using namespace com::sun::star; using ::std::vector; @@ -597,6 +598,51 @@ void ScDPObject::BuildAllDimensionMembers() pSaveData->BuildAllDimensionMembers(GetTableData()); } +bool ScDPObject::GetMemberNames( sal_Int32 nDim, Sequence& rNames ) +{ + vector aMembers; + GetMembers(nDim, GetUsedHierarchy(nDim), aMembers); + size_t n = aMembers.size(); + rNames.realloc(n); + for (size_t i = 0; i < n; ++i) + rNames[i] = aMembers[i].maName; +} + +bool ScDPObject::GetMembers( sal_Int32 nDim, sal_Int32 nHier, vector& rMembers ) +{ + Reference< container::XNameAccess > xMembersNA; + if (!GetMembersNA( nDim, nHier, xMembersNA )) + return false; + + Reference xMembersIA( new ScNameToIndexAccess(xMembersNA) ); + sal_Int32 nCount = xMembersIA->getCount(); + vector aMembers; + aMembers.reserve(nCount); + + for (sal_Int32 i = 0; i < nCount; ++i) + { + Reference xMember(xMembersIA->getByIndex(i), UNO_QUERY); + ScDPLabelData::Member aMem; + + if (xMember.is()) + aMem.maName = xMember->getName(); + + Reference xMemProp(xMember, UNO_QUERY); + if (xMemProp.is()) + { + aMem.mbVisible = ScUnoHelpFunctions::GetBoolProperty(xMemProp, OUString::createFromAscii(SC_UNO_ISVISIBL)); + aMem.mbShowDetails = ScUnoHelpFunctions::GetBoolProperty(xMemProp, OUString::createFromAscii(SC_UNO_SHOWDETA)); + + aMem.maLayoutName = ScUnoHelpFunctions::GetStringProperty( + xMemProp, OUString::createFromAscii(SC_UNO_LAYOUTNAME), OUString()); + } + + aMembers.push_back(aMem); + } + rMembers.swap(aMembers); + return true; +} + void ScDPObject::UpdateReference( UpdateRefMode eUpdateRefMode, const ScRange& rRange, SCsCOL nDx, SCsROW nDy, SCsTAB nDz ) { @@ -1867,6 +1913,7 @@ BOOL ScDPObject::FillLabelData(ScPivotParam& rParam) for (long nDim=0; nDim < nDimCount; nDim++) { String aFieldName; + OUString aLayoutName; uno::Reference xIntDim = ScUnoHelpFunctions::AnyToInterface( xDims->getByIndex(nDim) ); uno::Reference xDimName( xIntDim, uno::UNO_QUERY ); @@ -1888,6 +1935,9 @@ BOOL ScDPObject::FillLabelData(ScPivotParam& rParam) uno::Reference xIntOrig; if ( (aOrigAny >>= xIntOrig) && xIntOrig.is() ) bDuplicated = TRUE; + + aOrigAny = xDimProp->getPropertyValue(OUString::createFromAscii(SC_UNO_LAYOUTNAME)); + aOrigAny >>= aLayoutName; } catch(uno::Exception&) { @@ -1899,8 +1949,9 @@ BOOL ScDPObject::FillLabelData(ScPivotParam& rParam) bool bIsValue = true; //! check ScDPLabelDataRef pNewLabel(new ScDPLabelData(aFieldName, nCol, bIsValue)); + pNewLabel->maLayoutName = aLayoutName; GetHierarchies(nDim, pNewLabel->maHiers); - GetMembers(nDim, pNewLabel->maMembers, &pNewLabel->maVisible, &pNewLabel->maShowDet); + GetMembers(nDim, GetUsedHierarchy(nDim), pNewLabel->maMembers); lcl_FillLabelData(*pNewLabel, xDimProp); rParam.maLabelArray.push_back(pNewLabel); } @@ -1955,14 +2006,6 @@ BOOL ScDPObject::GetMembersNA( sal_Int32 nDim, uno::Reference< container::XNameA return GetMembersNA( nDim, GetUsedHierarchy( nDim ), xMembers ); } -BOOL ScDPObject::GetMembers( sal_Int32 nDim, - uno::Sequence< rtl::OUString >& rMembers, - uno::Sequence< sal_Bool >* pVisible, - uno::Sequence< sal_Bool >* pShowDet ) -{ - return GetMembers( nDim, GetUsedHierarchy( nDim ), rMembers, pVisible, pShowDet ); -} - BOOL ScDPObject::GetMembersNA( sal_Int32 nDim, sal_Int32 nHier, uno::Reference< container::XNameAccess >& xMembers ) { BOOL bRet = FALSE; @@ -1998,55 +2041,6 @@ BOOL ScDPObject::GetMembersNA( sal_Int32 nDim, sal_Int32 nHier, uno::Reference< return bRet; } -BOOL ScDPObject::GetMembers( sal_Int32 nDim, sal_Int32 nHier, - uno::Sequence< rtl::OUString >& rMembers, - uno::Sequence< sal_Bool >* pVisible, - uno::Sequence< sal_Bool >* pShowDet ) -{ - BOOL bRet = FALSE; - uno::Reference< container::XNameAccess > xMembersNA; - if( GetMembersNA( nDim, nHier, xMembersNA ) ) - { - uno::Reference< container::XIndexAccess > xMembersIA( new ScNameToIndexAccess( xMembersNA ) ); - sal_Int32 nCount = xMembersIA->getCount(); - rMembers.realloc( nCount ); - if( pVisible ) - pVisible->realloc( nCount ); - if( pShowDet ) - pShowDet->realloc( nCount ); - - rtl::OUString* pAry = rMembers.getArray(); - for( sal_Int32 nItem = 0; nItem < nCount; ++nItem ) - { - uno::Reference< container::XNamed > xMember( xMembersIA->getByIndex( nItem ), uno::UNO_QUERY ); - if( xMember.is() ) - pAry[ nItem ] = xMember->getName(); - if( pVisible || pShowDet ) - { - uno::Reference< beans::XPropertySet > xMemProp( xMember, uno::UNO_QUERY ); - if( pVisible ) - { - sal_Bool bVis = sal_True; - if( xMemProp.is() ) - bVis = ScUnoHelpFunctions::GetBoolProperty( xMemProp, - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNO_ISVISIBL ) ) ); - (*pVisible)[ nItem ] = bVis; - } - if( pShowDet ) - { - sal_Bool bShow = sal_True; - if( xMemProp.is() ) - bShow = ScUnoHelpFunctions::GetBoolProperty( xMemProp, - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNO_SHOWDETA ) ) ); - (*pShowDet)[ nItem ] = bShow; - } - } - } - bRet = TRUE; - } - return bRet; -} - //------------------------------------------------------------------------ // convert old pivot tables into new datapilot tables diff --git a/sc/source/core/data/pivot2.cxx b/sc/source/core/data/pivot2.cxx index e96bb25c011d..e0e517bb0178 100644 --- a/sc/source/core/data/pivot2.cxx +++ b/sc/source/core/data/pivot2.cxx @@ -487,6 +487,12 @@ ScDataObject* ScPivotCollection::Clone() const // ============================================================================ +ScDPLabelData::Member::Member() : + mbVisible(true), + mbShowDetails(true) +{ +} + ScDPLabelData::ScDPLabelData( const String& rName, short nCol, bool bIsValue ) : maName( rName ), mnCol( nCol ), diff --git a/sc/source/ui/dbgui/pvfundlg.cxx b/sc/source/ui/dbgui/pvfundlg.cxx index dac8ee1e5e04..284e7bdf15f6 100644 --- a/sc/source/ui/dbgui/pvfundlg.cxx +++ b/sc/source/ui/dbgui/pvfundlg.cxx @@ -48,12 +48,15 @@ #include "pvfundlg.hrc" #include "globstr.hrc" +#include + // ============================================================================ using namespace ::com::sun::star::sheet; using ::rtl::OUString; using ::com::sun::star::uno::Sequence; +using ::std::vector; // ============================================================================ @@ -86,6 +89,26 @@ bool lclFillListBox( ListBoxType& rLBox, const Sequence< OUString >& rStrings, U return bEmpty; } +template< typename ListBoxType > +bool lclFillListBox( ListBoxType& rLBox, const vector& rMembers, USHORT nEmptyPos = LISTBOX_APPEND ) +{ + bool bEmpty = false; + vector::const_iterator itr = rMembers.begin(), itrEnd = rMembers.end(); + for (; itr != itrEnd; ++itr) + { + if (itr->maLayoutName.getLength()) + rLBox.InsertEntry(itr->maLayoutName); + else if (itr->maName.getLength()) + rLBox.InsertEntry(itr->maName); + else + { + rLBox.InsertEntry(ScGlobal::GetRscString(STR_EMPTYDATA), nEmptyPos); + bEmpty = true; + } + } + return bEmpty; +} + /** Searches for a listbox entry, starts search at specified position. */ USHORT lclFindListBoxEntry( const ListBox& rLBox, const String& rEntry, USHORT nStartPos ) { @@ -253,7 +276,10 @@ void ScDPFunctionDlg::Init( const ScDPLabelData& rLabelData, const ScDPFuncData& maLbFunc.SetSelection( nFuncMask ); // field name - maFtName.SetText( rLabelData.maName ); + if (rLabelData.maLayoutName.getLength()) + maFtName.SetText(rLabelData.maLayoutName); + else + maFtName.SetText(rLabelData.maName); // "More button" controls maBtnMore.AddWindow( &maFlDisplay ); @@ -414,8 +440,6 @@ void ScDPSubtotalDlg::FillLabelData( ScDPLabelData& rLabelData ) const rLabelData.mnUsedHier = maLabelData.mnUsedHier; rLabelData.mbShowAll = maCbShowAll.IsChecked(); rLabelData.maMembers = maLabelData.maMembers; - rLabelData.maVisible = maLabelData.maVisible; - rLabelData.maShowDet = maLabelData.maShowDet; rLabelData.maSortInfo = maLabelData.maSortInfo; rLabelData.maLayoutInfo = maLabelData.maLayoutInfo; rLabelData.maShowInfo = maLabelData.maShowInfo; @@ -547,9 +571,8 @@ void ScDPSubtotalOptDlg::FillLabelData( ScDPLabelData& rLabelData ) const rLabelData.maMembers = maLabelData.maMembers; ULONG nVisCount = maLbHide.GetEntryCount(); - rLabelData.maVisible.realloc( nVisCount ); for( USHORT nPos = 0; nPos < nVisCount; ++nPos ) - rLabelData.maVisible[ nPos ] = !maLbHide.IsChecked( nPos ); + rLabelData.maMembers[nPos].mbVisible = !maLbHide.IsChecked(nPos); // *** HIERARCHY *** @@ -656,8 +679,9 @@ void ScDPSubtotalOptDlg::InitHideListBox() { maLbHide.Clear(); lclFillListBox( maLbHide, maLabelData.maMembers ); - for( sal_Int32 nVisIdx = 0, nVisSize = maLabelData.maVisible.getLength(); nVisIdx < nVisSize; ++nVisIdx ) - maLbHide.CheckEntryPos( static_cast< USHORT >( nVisIdx ), !maLabelData.maVisible[ nVisIdx ] ); + size_t n = maLabelData.maMembers.size(); + for (size_t i = 0; i < n; ++i) + maLbHide.CheckEntryPos(static_cast(i), !maLabelData.maMembers[i].mbVisible); bool bEnable = maLbHide.GetEntryCount() > 0; maFlHide.Enable( bEnable ); maLbHide.Enable( bEnable ); @@ -690,8 +714,7 @@ IMPL_LINK( ScDPSubtotalOptDlg, SelectHdl, ListBox*, pLBox ) { if( pLBox == &maLbHierarchy ) { - mrDPObj.GetMembers( maLabelData.mnCol, maLbHierarchy.GetSelectEntryPos(), - maLabelData.maMembers, &maLabelData.maVisible, &maLabelData.maShowDet ); + mrDPObj.GetMembers(maLabelData.mnCol, maLbHierarchy.GetSelectEntryPos(), maLabelData.maMembers); InitHideListBox(); } return 0; diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx index 688c0d60f79e..d1959bbf79d1 100644 --- a/sc/source/ui/dbgui/pvlaydlg.cxx +++ b/sc/source/ui/dbgui/pvlaydlg.cxx @@ -1546,33 +1546,27 @@ IMPL_LINK( ScDPLayoutDlg, OkHdl, OKButton *, EMPTYARG ) bool bManualSort = ( aIt->maSortInfo.Mode == sheet::DataPilotFieldSortMode::MANUAL ); // visibility of members - if( const rtl::OUString* pItem = aIt->maMembers.getConstArray() ) + for (vector::const_iterator itr = aIt->maMembers.begin(), itrEnd = aIt->maMembers.end(); + itr != itrEnd; ++itr) { - sal_Int32 nIdx = 0; - sal_Int32 nVisSize = aIt->maVisible.getLength(); - sal_Int32 nShowSize = aIt->maShowDet.getLength(); - for( const rtl::OUString* pEnd = pItem + aIt->maMembers.getLength(); pItem != pEnd; ++pItem, ++nIdx ) + ScDPSaveMember* pMember = pDim->GetMemberByName(itr->maName); + + // #i40054# create/access members only if flags are not default + // (or in manual sorting mode - to keep the order) + if (bManualSort || !itr->mbVisible || !itr->mbShowDetails) + { + pMember->SetIsVisible(itr->mbVisible); + pMember->SetShowDetails(itr->mbShowDetails); + } + if (pOldDim) { - // #i40054# create/access members only if flags are not default - // (or in manual sorting mode - to keep the order) - bool bIsVisible = (nIdx >= nVisSize) || aIt->maVisible[ nIdx ]; - bool bShowDetails = (nIdx >= nShowSize) || aIt->maShowDet[ nIdx ]; - if( bManualSort || !bIsVisible || !bShowDetails ) + // Transfer the existing layout name. + ScDPSaveMember* pOldMember = pOldDim->GetMemberByName(itr->maName); + if (pOldMember) { - ScDPSaveMember* pMember = pDim->GetMemberByName( *pItem ); - pMember->SetIsVisible( bIsVisible ); - pMember->SetShowDetails( bShowDetails ); - if (pOldDim) - { - // Transfer the existing layout name. - ScDPSaveMember* pOldMember = pOldDim->GetMemberByName(*pItem); - if (pOldMember) - { - const OUString* pLayoutName = pOldMember->GetLayoutName(); - if (pLayoutName) - pMember->SetLayoutName(*pLayoutName); - } - } + const OUString* pLayoutName = pOldMember->GetLayoutName(); + if (pLayoutName) + pMember->SetLayoutName(*pLayoutName); } } } diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx index c52921f7c5de..efc498517f1b 100644 --- a/sc/source/ui/unoobj/dapiuno.cxx +++ b/sc/source/ui/unoobj/dapiuno.cxx @@ -3074,7 +3074,7 @@ Sequence SAL_CALL ScDataPilotItemsObj::getElementNames() ScUnoGuard aGuard; Sequence< OUString > aSeq; if( ScDPObject* pDPObj = GetDPObject() ) - pDPObj->GetMembers( lcl_GetObjectIndex( pDPObj, maFieldId ), aSeq ); + pDPObj->GetMemberNames( lcl_GetObjectIndex( pDPObj, maFieldId ), aSeq ); return aSeq; } diff --git a/sc/source/ui/unoobj/miscuno.cxx b/sc/source/ui/unoobj/miscuno.cxx index 090073e259ae..ee2a64bd8c78 100644 --- a/sc/source/ui/unoobj/miscuno.cxx +++ b/sc/source/ui/unoobj/miscuno.cxx @@ -140,6 +140,26 @@ sal_Int32 ScUnoHelpFunctions::GetEnumProperty( const uno::Reference& xProp, const OUString& rName, const OUString& rDefault ) +{ + OUString aRet = rDefault; + if (!xProp.is()) + return aRet; + + try + { + Any any = xProp->getPropertyValue(rName); + any >>= aRet; + } + catch (const uno::Exception&) + { + } + + return aRet; +} + // static sal_Bool ScUnoHelpFunctions::GetBoolFromAny( const uno::Any& aAny ) { diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx index 141d7e377f4e..dcad0cbce885 100644 --- a/sc/source/ui/view/dbfunc3.cxx +++ b/sc/source/ui/view/dbfunc3.cxx @@ -1868,7 +1868,7 @@ BOOL ScDBFunc::DataPilotMove( const ScRange& rSource, const ScAddress& rDest ) // get all member names in source order uno::Sequence aMemberNames; - pDPObj->GetMembers( aDestData.Dimension, aMemberNames ); + pDPObj->GetMemberNames( aDestData.Dimension, aMemberNames ); bool bInserted = false; diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx index 5a01a642ac24..dc278f4e3def 100644 --- a/sc/source/ui/view/gridwin2.cxx +++ b/sc/source/ui/view/gridwin2.cxx @@ -916,10 +916,17 @@ void ScGridWindow::DPLaunchFieldPopupMenu( mpDPFieldPopup->setExtendedData(pDPData.release()); mpDPFieldPopup->setOKAction(new DPFieldPopupOKAction(this)); { - sal_Int32 n = rLabelData.maMembers.getLength(); + // Populate field members. + size_t n = rLabelData.maMembers.size(); mpDPFieldPopup->setMemberSize(n); - for (sal_Int32 i = 0; i < n; ++i) - mpDPFieldPopup->addMember(rLabelData.maMembers[i], rLabelData.maVisible[i]); + for (size_t i = 0; i < n; ++i) + { + const ScDPLabelData::Member& rMem = rLabelData.maMembers[i]; + if (rMem.maLayoutName.getLength()) + mpDPFieldPopup->addMember(rMem.maLayoutName, rMem.mbVisible); + else + mpDPFieldPopup->addMember(rMem.maName, rMem.mbVisible); + } mpDPFieldPopup->initMembers(); } @@ -973,6 +980,9 @@ void ScGridWindow::DPLaunchFieldPopupMenu( void ScGridWindow::UpdateDPFromFieldPopupMenu() { + typedef hash_map MemNameMapType; + typedef hash_map MemVisibilityType; + if (!mpDPFieldPopup.get()) return; @@ -991,8 +1001,30 @@ void ScGridWindow::UpdateDPFromFieldPopupMenu() if (!pDim) return; - hash_map aResult; - mpDPFieldPopup->getResult(aResult); + // Build a map of layout names to original names. + const ScDPLabelData& rLabelData = *pDPData->maDPParam.maLabelArray[pDPData->mnDim]; + MemNameMapType aMemNameMap; + for (vector::const_iterator itr = rLabelData.maMembers.begin(), itrEnd = rLabelData.maMembers.end(); + itr != itrEnd; ++itr) + aMemNameMap.insert(MemNameMapType::value_type(itr->maLayoutName, itr->maName)); + + // The raw result may contain a mixture of layout names and original names. + MemVisibilityType aRawResult; + mpDPFieldPopup->getResult(aRawResult); + + MemVisibilityType aResult; + for (MemVisibilityType::const_iterator itr = aRawResult.begin(), itrEnd = aRawResult.end(); itr != itrEnd; ++itr) + { + MemNameMapType::const_iterator itrNameMap = aMemNameMap.find(itr->first); + if (itrNameMap == aMemNameMap.end()) + // This is an original member name. Use it as-is. + aResult.insert(MemVisibilityType::value_type(itr->first, itr->second)); + else + { + // This is a layout name. Get the original member name and use it. + aResult.insert(MemVisibilityType::value_type(itrNameMap->second, itr->second)); + } + } pDim->UpdateMemberVisibility(aResult); ScDBDocFunc aFunc(*pViewData->GetDocShell()); -- cgit v1.2.3 From 9b0c9920d629acbdf8516e13ba045cfea7b1fd97 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 2 Sep 2009 04:17:43 +0000 Subject: Show display names (aka layout names) of fields in the dp layout dialog and its child dialogs. --- sc/inc/pivot.hxx | 2 +- sc/source/ui/dbgui/pvfundlg.cxx | 18 +++++++++++++++--- sc/source/ui/dbgui/pvlaydlg.cxx | 21 +++++++++++++++------ 3 files changed, 31 insertions(+), 10 deletions(-) diff --git a/sc/inc/pivot.hxx b/sc/inc/pivot.hxx index 6e3088eeb1e9..b8ca4da7762b 100644 --- a/sc/inc/pivot.hxx +++ b/sc/inc/pivot.hxx @@ -368,7 +368,7 @@ public: struct ScDPLabelData { - String maName; /// Original name of the dimension. + ::rtl::OUString maName; /// Original name of the dimension. ::rtl::OUString maLayoutName; /// Layout name (display name) SCsCOL mnCol; USHORT mnFuncMask; /// Page/Column/Row subtotal function. diff --git a/sc/source/ui/dbgui/pvfundlg.cxx b/sc/source/ui/dbgui/pvfundlg.cxx index 284e7bdf15f6..2b755769517c 100644 --- a/sc/source/ui/dbgui/pvfundlg.cxx +++ b/sc/source/ui/dbgui/pvfundlg.cxx @@ -297,7 +297,12 @@ void ScDPFunctionDlg::Init( const ScDPLabelData& rLabelData, const ScDPFuncData& // base field list box for( ScDPLabelDataVec::const_iterator aIt = mrLabelVec.begin(), aEnd = mrLabelVec.end(); aIt != aEnd; ++aIt ) - maLbBaseField.InsertEntry( aIt->maName ); + { + if (aIt->maLayoutName.getLength()) + maLbBaseField.InsertEntry( aIt->maLayoutName ); + else + maLbBaseField.InsertEntry( aIt->maName ); + } // base item list box maLbBaseItem.SetSeparatorPos( SC_BASEITEM_USER_POS - 1 ); @@ -448,7 +453,10 @@ void ScDPSubtotalDlg::FillLabelData( ScDPLabelData& rLabelData ) const void ScDPSubtotalDlg::Init( const ScDPLabelData& rLabelData, const ScDPFuncData& rFuncData ) { // field name - maFtName.SetText( rLabelData.maName ); + if (rLabelData.maLayoutName.getLength()) + maFtName.SetText( rLabelData.maLayoutName ); + else + maFtName.SetText( rLabelData.maName ); // radio buttons maRbNone.SetClickHdl( LINK( this, ScDPSubtotalDlg, RadioClickHdl ) ); @@ -586,7 +594,11 @@ void ScDPSubtotalOptDlg::Init( const ScDPNameVec& rDataFields, bool bEnableLayou sal_Int32 nSortMode = maLabelData.maSortInfo.Mode; // sort fields list box - maLbSortBy.InsertEntry( maLabelData.maName ); + if (maLabelData.maLayoutName.getLength()) + maLbSortBy.InsertEntry( maLabelData.maLayoutName ); + else + maLbSortBy.InsertEntry( maLabelData.maName ); + for( ScDPNameVec::const_iterator aIt = rDataFields.begin(), aEnd = rDataFields.end(); aIt != aEnd; ++aIt ) { maLbSortBy.InsertEntry( *aIt ); diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx index d1959bbf79d1..ea70891a8d1d 100644 --- a/sc/source/ui/dbgui/pvlaydlg.cxx +++ b/sc/source/ui/dbgui/pvlaydlg.cxx @@ -395,7 +395,10 @@ void ScDPLayoutDlg::InitWndSelect( const vector& rLabels ) if ( i <= nLast ) { - aWndSelect.AddField( aLabelDataArr[i].maName, i ); + OUString aFieldName = aLabelDataArr[i].maName; + if (aLabelDataArr[i].maLayoutName.getLength()) + aFieldName = aLabelDataArr[i].maLayoutName; + aWndSelect.AddField(aFieldName, i); aSelectArr[i].reset( new ScDPFuncData( aLabelDataArr[i].mnCol, aLabelDataArr[i].mnFuncMask ) ); } } @@ -596,7 +599,7 @@ void ScDPLayoutDlg::AddField( size_t nFromIndex, ScDPFieldType eToType, const Po if ( !bDataArr ) { - if ( toWnd->AddField( rData.maName, + if ( toWnd->AddField( rData.maLayoutName.getLength() ? rData.maLayoutName : rData.maName, DlgPos2WndPos( rAtPos, *toWnd ), nAddedAt ) ) { @@ -607,9 +610,12 @@ void ScDPLayoutDlg::AddField( size_t nFromIndex, ScDPFieldType eToType, const Po else { USHORT nMask = fData.mnFuncMask; - String aStr( GetFuncString( nMask, rData.mbIsValue ) ); + OUString aStr = GetFuncString( nMask, rData.mbIsValue ); - aStr += rData.maName; + if (rData.maLayoutName.getLength()) + aStr += rData.maLayoutName; + else + aStr += rData.maName; if ( toWnd->AddField( aStr, DlgPos2WndPos( rAtPos, *toWnd ), @@ -1217,7 +1223,7 @@ String ScDPLayoutDlg::GetLabelString( SCsCOL nCol ) ScDPLabelData* pData = GetLabelData( nCol ); DBG_ASSERT( pData, "LabelData not found" ); if (pData) - return pData->maName; + return pData->maLayoutName.getLength() ? pData->maLayoutName : pData->maName; return String(); } @@ -1756,7 +1762,10 @@ IMPL_LINK( ScDPLayoutDlg, ScrollHdl, ScrollBar *, EMPTYARG ) for ( i=0; i Date: Wed, 2 Sep 2009 19:09:26 +0000 Subject: Fixed a bug where the layout names of field members get lost when updating the table from the layout dialog. --- sc/source/core/data/dpobject.cxx | 13 ++++++++----- sc/source/core/data/dpsave.cxx | 4 ---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index 67c8c21d31c7..b09744747f23 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -601,11 +601,15 @@ void ScDPObject::BuildAllDimensionMembers() bool ScDPObject::GetMemberNames( sal_Int32 nDim, Sequence& rNames ) { vector aMembers; - GetMembers(nDim, GetUsedHierarchy(nDim), aMembers); + if (!GetMembers(nDim, GetUsedHierarchy(nDim), aMembers)) + return false; + size_t n = aMembers.size(); rNames.realloc(n); for (size_t i = 0; i < n; ++i) rNames[i] = aMembers[i].maName; + + return true; } bool ScDPObject::GetMembers( sal_Int32 nDim, sal_Int32 nHier, vector& rMembers ) @@ -1913,7 +1917,6 @@ BOOL ScDPObject::FillLabelData(ScPivotParam& rParam) for (long nDim=0; nDim < nDimCount; nDim++) { String aFieldName; - OUString aLayoutName; uno::Reference xIntDim = ScUnoHelpFunctions::AnyToInterface( xDims->getByIndex(nDim) ); uno::Reference xDimName( xIntDim, uno::UNO_QUERY ); @@ -1935,14 +1938,14 @@ BOOL ScDPObject::FillLabelData(ScPivotParam& rParam) uno::Reference xIntOrig; if ( (aOrigAny >>= xIntOrig) && xIntOrig.is() ) bDuplicated = TRUE; - - aOrigAny = xDimProp->getPropertyValue(OUString::createFromAscii(SC_UNO_LAYOUTNAME)); - aOrigAny >>= aLayoutName; } catch(uno::Exception&) { } + OUString aLayoutName = ScUnoHelpFunctions::GetStringProperty( + xDimProp, OUString::createFromAscii(SC_UNO_LAYOUTNAME), OUString()); + if ( aFieldName.Len() && !bData && !bDuplicated ) { SCsCOL nCol = static_cast< SCsCOL >( nDim ); //! ??? diff --git a/sc/source/core/data/dpsave.cxx b/sc/source/core/data/dpsave.cxx index 7ab7a13c7fc1..829a948ed5e2 100644 --- a/sc/source/core/data/dpsave.cxx +++ b/sc/source/core/data/dpsave.cxx @@ -196,10 +196,6 @@ void ScDPSaveMember::RemoveLayoutName() void ScDPSaveMember::WriteToSource( const uno::Reference& xMember, sal_Int32 nPosition ) { - // nothing to do? - if ( nVisibleMode == SC_DPSAVEMODE_DONTKNOW && nShowDetailsMode == SC_DPSAVEMODE_DONTKNOW && nPosition < 0 ) - return; - uno::Reference xMembProp( xMember, uno::UNO_QUERY ); DBG_ASSERT( xMembProp.is(), "no properties at member" ); if ( xMembProp.is() ) -- cgit v1.2.3 From 8cf3d5f0317095f6a39ec7e0bfccf2b2d2d41aa2 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 2 Sep 2009 20:13:36 +0000 Subject: added getDisplayName() to ScDPLabelData, to keep the client code a little cleaner. --- sc/inc/pivot.hxx | 14 ++++++++++++++ sc/source/core/data/pivot2.cxx | 17 +++++++++++++++++ sc/source/ui/dbgui/pvfundlg.cxx | 14 ++++---------- sc/source/ui/view/gridwin2.cxx | 5 +---- 4 files changed, 36 insertions(+), 14 deletions(-) diff --git a/sc/inc/pivot.hxx b/sc/inc/pivot.hxx index b8ca4da7762b..ad5ec926ed97 100644 --- a/sc/inc/pivot.hxx +++ b/sc/inc/pivot.hxx @@ -384,6 +384,13 @@ struct ScDPLabelData bool mbShowDetails; Member(); + + /** + * return the name that should be displayed in the dp dialogs i.e. + * when the layout name is present, use it, or else use the original + * name. + */ + ::rtl::OUString SC_DLLPUBLIC getDisplayName() const; }; ::std::vector maMembers; ::com::sun::star::uno::Sequence< ::rtl::OUString > maHiers; /// Hierarchies. @@ -392,6 +399,13 @@ struct ScDPLabelData ::com::sun::star::sheet::DataPilotFieldAutoShowInfo maShowInfo; /// AutoShow info. explicit ScDPLabelData( const String& rName, short nCol, bool bIsValue ); + + /** + * return the name that should be displayed in the dp dialogs i.e. + * when the layout name is present, use it, or else use the original + * name. + */ + ::rtl::OUString SC_DLLPUBLIC getDisplayName() const; }; // ============================================================================ diff --git a/sc/source/core/data/pivot2.cxx b/sc/source/core/data/pivot2.cxx index e0e517bb0178..1e8eb63e99ec 100644 --- a/sc/source/core/data/pivot2.cxx +++ b/sc/source/core/data/pivot2.cxx @@ -61,6 +61,7 @@ #include "stlsheet.hxx" using ::com::sun::star::sheet::DataPilotFieldReference; +using ::rtl::OUString; // STATIC DATA ----------------------------------------------------------- @@ -493,6 +494,14 @@ ScDPLabelData::Member::Member() : { } +OUString ScDPLabelData::Member::getDisplayName() const +{ + if (maLayoutName.getLength()) + return maLayoutName; + + return maName; +} + ScDPLabelData::ScDPLabelData( const String& rName, short nCol, bool bIsValue ) : maName( rName ), mnCol( nCol ), @@ -503,6 +512,14 @@ ScDPLabelData::ScDPLabelData( const String& rName, short nCol, bool bIsValue ) : { } +OUString ScDPLabelData::getDisplayName() const +{ + if (maLayoutName.getLength()) + return maLayoutName; + + return maName; +} + // ============================================================================ ScDPFuncData::ScDPFuncData( short nCol, USHORT nFuncMask ) : diff --git a/sc/source/ui/dbgui/pvfundlg.cxx b/sc/source/ui/dbgui/pvfundlg.cxx index 2b755769517c..e272be0edb7f 100644 --- a/sc/source/ui/dbgui/pvfundlg.cxx +++ b/sc/source/ui/dbgui/pvfundlg.cxx @@ -96,10 +96,9 @@ bool lclFillListBox( ListBoxType& rLBox, const vector& rM vector::const_iterator itr = rMembers.begin(), itrEnd = rMembers.end(); for (; itr != itrEnd; ++itr) { - if (itr->maLayoutName.getLength()) - rLBox.InsertEntry(itr->maLayoutName); - else if (itr->maName.getLength()) - rLBox.InsertEntry(itr->maName); + OUString aName = itr->getDisplayName(); + if (aName.getLength()) + rLBox.InsertEntry(aName); else { rLBox.InsertEntry(ScGlobal::GetRscString(STR_EMPTYDATA), nEmptyPos); @@ -297,12 +296,7 @@ void ScDPFunctionDlg::Init( const ScDPLabelData& rLabelData, const ScDPFuncData& // base field list box for( ScDPLabelDataVec::const_iterator aIt = mrLabelVec.begin(), aEnd = mrLabelVec.end(); aIt != aEnd; ++aIt ) - { - if (aIt->maLayoutName.getLength()) - maLbBaseField.InsertEntry( aIt->maLayoutName ); - else - maLbBaseField.InsertEntry( aIt->maName ); - } + maLbBaseField.InsertEntry(aIt->getDisplayName()); // base item list box maLbBaseItem.SetSeparatorPos( SC_BASEITEM_USER_POS - 1 ); diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx index dc278f4e3def..19a059bf3af1 100644 --- a/sc/source/ui/view/gridwin2.cxx +++ b/sc/source/ui/view/gridwin2.cxx @@ -922,10 +922,7 @@ void ScGridWindow::DPLaunchFieldPopupMenu( for (size_t i = 0; i < n; ++i) { const ScDPLabelData::Member& rMem = rLabelData.maMembers[i]; - if (rMem.maLayoutName.getLength()) - mpDPFieldPopup->addMember(rMem.maLayoutName, rMem.mbVisible); - else - mpDPFieldPopup->addMember(rMem.maName, rMem.mbVisible); + mpDPFieldPopup->addMember(rMem.getDisplayName(), rMem.mbVisible); } mpDPFieldPopup->initMembers(); } -- cgit v1.2.3 From fb8e51e2a5dc9d95a3465ca3041b0b27591df0a6 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 2 Sep 2009 20:21:52 +0000 Subject: More use for ScDPLabelData::getDisplayName(). --- sc/source/ui/dbgui/pvfundlg.cxx | 15 +++------------ sc/source/ui/dbgui/pvlaydlg.cxx | 19 +++++-------------- 2 files changed, 8 insertions(+), 26 deletions(-) diff --git a/sc/source/ui/dbgui/pvfundlg.cxx b/sc/source/ui/dbgui/pvfundlg.cxx index e272be0edb7f..30ee1a44d384 100644 --- a/sc/source/ui/dbgui/pvfundlg.cxx +++ b/sc/source/ui/dbgui/pvfundlg.cxx @@ -275,10 +275,7 @@ void ScDPFunctionDlg::Init( const ScDPLabelData& rLabelData, const ScDPFuncData& maLbFunc.SetSelection( nFuncMask ); // field name - if (rLabelData.maLayoutName.getLength()) - maFtName.SetText(rLabelData.maLayoutName); - else - maFtName.SetText(rLabelData.maName); + maFtName.SetText(rLabelData.getDisplayName()); // "More button" controls maBtnMore.AddWindow( &maFlDisplay ); @@ -447,10 +444,7 @@ void ScDPSubtotalDlg::FillLabelData( ScDPLabelData& rLabelData ) const void ScDPSubtotalDlg::Init( const ScDPLabelData& rLabelData, const ScDPFuncData& rFuncData ) { // field name - if (rLabelData.maLayoutName.getLength()) - maFtName.SetText( rLabelData.maLayoutName ); - else - maFtName.SetText( rLabelData.maName ); + maFtName.SetText(rLabelData.getDisplayName()); // radio buttons maRbNone.SetClickHdl( LINK( this, ScDPSubtotalDlg, RadioClickHdl ) ); @@ -588,10 +582,7 @@ void ScDPSubtotalOptDlg::Init( const ScDPNameVec& rDataFields, bool bEnableLayou sal_Int32 nSortMode = maLabelData.maSortInfo.Mode; // sort fields list box - if (maLabelData.maLayoutName.getLength()) - maLbSortBy.InsertEntry( maLabelData.maLayoutName ); - else - maLbSortBy.InsertEntry( maLabelData.maName ); + maLbSortBy.InsertEntry(maLabelData.getDisplayName()); for( ScDPNameVec::const_iterator aIt = rDataFields.begin(), aEnd = rDataFields.end(); aIt != aEnd; ++aIt ) { diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx index ea70891a8d1d..6a9bb63e3ae3 100644 --- a/sc/source/ui/dbgui/pvlaydlg.cxx +++ b/sc/source/ui/dbgui/pvlaydlg.cxx @@ -395,10 +395,7 @@ void ScDPLayoutDlg::InitWndSelect( const vector& rLabels ) if ( i <= nLast ) { - OUString aFieldName = aLabelDataArr[i].maName; - if (aLabelDataArr[i].maLayoutName.getLength()) - aFieldName = aLabelDataArr[i].maLayoutName; - aWndSelect.AddField(aFieldName, i); + aWndSelect.AddField(aLabelDataArr[i].getDisplayName(), i); aSelectArr[i].reset( new ScDPFuncData( aLabelDataArr[i].mnCol, aLabelDataArr[i].mnFuncMask ) ); } } @@ -599,7 +596,7 @@ void ScDPLayoutDlg::AddField( size_t nFromIndex, ScDPFieldType eToType, const Po if ( !bDataArr ) { - if ( toWnd->AddField( rData.maLayoutName.getLength() ? rData.maLayoutName : rData.maName, + if ( toWnd->AddField( rData.getDisplayName(), DlgPos2WndPos( rAtPos, *toWnd ), nAddedAt ) ) { @@ -612,10 +609,7 @@ void ScDPLayoutDlg::AddField( size_t nFromIndex, ScDPFieldType eToType, const Po USHORT nMask = fData.mnFuncMask; OUString aStr = GetFuncString( nMask, rData.mbIsValue ); - if (rData.maLayoutName.getLength()) - aStr += rData.maLayoutName; - else - aStr += rData.maName; + aStr += rData.getDisplayName(); if ( toWnd->AddField( aStr, DlgPos2WndPos( rAtPos, *toWnd ), @@ -1223,7 +1217,7 @@ String ScDPLayoutDlg::GetLabelString( SCsCOL nCol ) ScDPLabelData* pData = GetLabelData( nCol ); DBG_ASSERT( pData, "LabelData not found" ); if (pData) - return pData->maLayoutName.getLength() ? pData->maLayoutName : pData->maName; + return pData->getDisplayName(); return String(); } @@ -1762,10 +1756,7 @@ IMPL_LINK( ScDPLayoutDlg, ScrollHdl, ScrollBar *, EMPTYARG ) for ( i=0; i Date: Wed, 2 Sep 2009 20:46:19 +0000 Subject: Fixed a bug where field arrow buttons didn't indicate the presence of hidden members when the name of a field was a layout name. --- sc/source/filter/xml/xmldpimp.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sc/source/filter/xml/xmldpimp.cxx b/sc/source/filter/xml/xmldpimp.cxx index 572bcbb817e3..da89897269f0 100644 --- a/sc/source/filter/xml/xmldpimp.cxx +++ b/sc/source/filter/xml/xmldpimp.cxx @@ -357,7 +357,15 @@ void ScXMLDataPilotTableContext::AddDimension(ScDPSaveDimension* pDim, bool bHas } if (bHasHiddenMember) - maHiddenMemberFields.insert(pDim->GetName()); + { + // the layout name takes priority over the original name, + // since this data is used against cell values. + const OUString* pLayoutName = pDim->GetLayoutName(); + if (pLayoutName) + maHiddenMemberFields.insert(*pLayoutName); + else + maHiddenMemberFields.insert(pDim->GetName()); + } } pDPSave->AddDimension(pDim); } -- cgit v1.2.3 From 15516a01e3368a07854cabfe9cace1c841ac3795 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 3 Sep 2009 03:05:22 +0000 Subject: slight comment cleaning --- sc/inc/pivot.hxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sc/inc/pivot.hxx b/sc/inc/pivot.hxx index ad5ec926ed97..eb70f50e70f2 100644 --- a/sc/inc/pivot.hxx +++ b/sc/inc/pivot.hxx @@ -401,9 +401,8 @@ struct ScDPLabelData explicit ScDPLabelData( const String& rName, short nCol, bool bIsValue ); /** - * return the name that should be displayed in the dp dialogs i.e. - * when the layout name is present, use it, or else use the original - * name. + * return the name that should be displayed in the dp dialogs i.e. when + * the layout name is present, use it, or else use the original name. */ ::rtl::OUString SC_DLLPUBLIC getDisplayName() const; }; -- cgit v1.2.3 From cc67bdb74d77446686dc1dcb78c53e5196ce1326 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 3 Sep 2009 04:37:43 +0000 Subject: #i104742# ported some code from ooo-build to implement shrinking of db data area. --- sc/inc/document.hxx | 2 ++ sc/inc/table.hxx | 1 + sc/source/core/data/document.cxx | 26 ++++++++++++++++++++++++++ sc/source/core/data/table2.cxx | 8 ++++++++ sc/source/ui/inc/dbfunc.hxx | 2 +- sc/source/ui/view/dbfunc.cxx | 18 +++++++++++++++++- 6 files changed, 55 insertions(+), 2 deletions(-) diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index c8d3751a7aaf..ea04d92b9f10 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -874,6 +874,8 @@ public: USHORT GetErrCode( const ScAddress& ) const; + bool ShrinkToDataArea(SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow) const; + void GetDataArea( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow, BOOL bIncludeOld ); SC_DLLPUBLIC BOOL GetCellArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow ) const; diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index 8b2227d48dbb..0c6233e5fb98 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -291,6 +291,7 @@ public: } ScBaseCell* GetCell( SCCOL nCol, SCROW nRow ) const; + void GetFirstDataPos(SCCOL& rCol, SCROW& rRow) const; void GetLastDataPos(SCCOL& rCol, SCROW& rRow) const; /** Returns the pointer to a cell note object at the passed cell address. */ diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 61cf3ab94b35..9596954cf5a8 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -618,6 +618,32 @@ BOOL ScDocument::GetTableArea( SCTAB nTab, SCCOL& rEndCol, SCROW& rEndRow ) cons return FALSE; } +bool ScDocument::ShrinkToDataArea(SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow, SCCOL& rEndCol, SCROW& rEndRow) const +{ + if (!ValidTab(nTab) || !pTab[nTab]) + return false; + + SCCOL nCol1, nCol2; + SCROW nRow1, nRow2; + pTab[nTab]->GetFirstDataPos(nCol1, nRow1); + pTab[nTab]->GetLastDataPos(nCol2, nRow2); + + if (nCol1 > nCol2 || nRow1 > nRow2) + // invalid range. + return false; + + // Make sure the area only shrinks, and doesn't grow. + if (rStartCol < nCol1) + rStartCol = nCol1; + if (nCol2 < rEndCol) + rEndCol = nCol2; + if (rStartRow < nRow1) + rStartRow = nRow1; + if (nRow2 < rEndRow) + rEndRow = nRow2; + + return true; // success! +} // zusammenhaengender Bereich diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index 59858796078c..47b119805e0c 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -962,6 +962,14 @@ ScBaseCell* ScTable::GetCell( SCCOL nCol, SCROW nRow ) const return NULL; } +void ScTable::GetFirstDataPos(SCCOL& rCol, SCROW& rRow) const +{ + rCol = 0; + rRow = 0; + while (aCol[rCol].IsEmptyData() && rCol < MAXCOL) + ++rCol; + rRow = aCol[rCol].GetFirstDataPos(); +} void ScTable::GetLastDataPos(SCCOL& rCol, SCROW& rRow) const { diff --git a/sc/source/ui/inc/dbfunc.hxx b/sc/source/ui/inc/dbfunc.hxx index afeb90df1a79..875576a22889 100644 --- a/sc/source/ui/inc/dbfunc.hxx +++ b/sc/source/ui/inc/dbfunc.hxx @@ -80,7 +80,7 @@ public: void GotoDBArea( const String& rDBName ); // DB-Bereich vom Cursor - ScDBData* GetDBData( BOOL bMarkArea = TRUE, ScGetDBMode eMode = SC_DB_MAKE ); + ScDBData* GetDBData( BOOL bMarkArea = TRUE, ScGetDBMode eMode = SC_DB_MAKE, bool bShrinkToData = false ); void NotifyCloseDbNameDlg( const ScDBCollection& rNewColl, const List& rDelAreaList ); diff --git a/sc/source/ui/view/dbfunc.cxx b/sc/source/ui/view/dbfunc.cxx index 0d44603b64f8..48b6d3ba11f7 100644 --- a/sc/source/ui/view/dbfunc.cxx +++ b/sc/source/ui/view/dbfunc.cxx @@ -107,14 +107,30 @@ void ScDBFunc::GotoDBArea( const String& rDBName ) // aktuellen Datenbereich fuer Sortieren / Filtern suchen -ScDBData* ScDBFunc::GetDBData( BOOL bMark, ScGetDBMode eMode ) +ScDBData* ScDBFunc::GetDBData( BOOL bMark, ScGetDBMode eMode, bool bShrinkToData ) { ScDocShell* pDocSh = GetViewData()->GetDocShell(); ScDBData* pData = NULL; ScRange aRange; ScMarkType eMarkType = GetViewData()->GetSimpleArea(aRange); if ( eMarkType == SC_MARK_SIMPLE || eMarkType == SC_MARK_SIMPLE_FILTERED ) + { + if (bShrinkToData) + { + // Shrink the range to only include data area. + ScDocument* pDoc = pDocSh->GetDocument(); + SCCOL nCol1 = aRange.aStart.Col(), nCol2 = aRange.aEnd.Col(); + SCROW nRow1 = aRange.aStart.Row(), nRow2 = aRange.aEnd.Row(); + if (pDoc->ShrinkToDataArea(aRange.aStart.Tab(), nCol1, nRow1, nCol2, nRow2)) + { + aRange.aStart.SetCol(nCol1); + aRange.aEnd.SetCol(nCol2); + aRange.aStart.SetRow(nRow1); + aRange.aEnd.SetRow(nRow2); + } + } pData = pDocSh->GetDBData( aRange, eMode, FALSE ); + } else if ( eMode != SC_DB_OLD ) pData = pDocSh->GetDBData( ScRange( GetViewData()->GetCurX(), GetViewData()->GetCurY(), -- cgit v1.2.3 From 87435fda334e9ac833968193524b9bb0ff276c97 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 3 Sep 2009 05:17:25 +0000 Subject: #i104742# shrink selected soure data to the data area when making datapilot table from cell range. --- sc/source/ui/view/cellsh2.cxx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx index eabf33f3defc..3675cd690916 100644 --- a/sc/source/ui/view/cellsh2.cxx +++ b/sc/source/ui/view/cellsh2.cxx @@ -750,7 +750,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) { // select database range or data pTabViewShell->GetDBData( TRUE, SC_DB_OLD ); - const ScMarkData& rMark = GetViewData()->GetMarkData(); + ScMarkData& rMark = GetViewData()->GetMarkData(); if ( !rMark.IsMarked() && !rMark.IsMultiMarked() ) pTabViewShell->MarkDataArea( FALSE ); @@ -816,6 +816,19 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) ScMarkType eType = GetViewData()->GetSimpleArea(aRange); if ( (eType & SC_MARK_SIMPLE) == SC_MARK_SIMPLE ) { + // Shrink the range to the data area. + SCCOL nStartCol = aRange.aStart.Col(), nEndCol = aRange.aEnd.Col(); + SCROW nStartRow = aRange.aStart.Row(), nEndRow = aRange.aEnd.Row(); + if (pDoc->ShrinkToDataArea(aRange.aStart.Tab(), nStartCol, nStartRow, nEndCol, nEndRow)) + { + aRange.aStart.SetCol(nStartCol); + aRange.aStart.SetRow(nStartRow); + aRange.aEnd.SetCol(nEndCol); + aRange.aEnd.SetRow(nEndRow); + rMark.SetMarkArea(aRange); + pTabViewShell->MarkRange(aRange); + } + BOOL bOK = TRUE; if ( pDoc->HasSubTotalCells( aRange ) ) { -- cgit v1.2.3 -- cgit v1.2.3 From 23f300a0f3b66df0dee0bca7e26d38d60cb8b5a2 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Sat, 5 Sep 2009 02:30:47 +0000 Subject: resurrected one formerly unused method to fix build breakage. --- sc/inc/column.hxx | 2 +- sc/source/core/data/column2.cxx | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index 816a8ade4628..80b2394788d1 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -162,7 +162,7 @@ public: SCSIZE GetEmptyLinesInBlock( SCROW nStartRow, SCROW nEndRow, ScDirection eDir ) const; BOOL HasDataAt(SCROW nRow) const; BOOL HasVisibleDataAt(SCROW nRow) const; -//UNUSED2009-05 SCROW GetFirstDataPos() const; + SCROW GetFirstDataPos() const; SCROW GetLastDataPos() const; SCROW GetLastVisDataPos(BOOL bNotes) const; // ohne Broadcaster SCROW GetFirstVisDataPos(BOOL bNotes) const; diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index 01c72ab4e0c4..f7a6a3bf83c9 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -1376,13 +1376,13 @@ SCSIZE ScColumn::GetEmptyLinesInBlock( SCROW nStartRow, SCROW nEndRow, ScDirecti return nLines; } -//UNUSED2009-05 SCROW ScColumn::GetFirstDataPos() const -//UNUSED2009-05 { -//UNUSED2009-05 if (nCount) -//UNUSED2009-05 return pItems[0].nRow; -//UNUSED2009-05 else -//UNUSED2009-05 return 0; -//UNUSED2009-05 } +SCROW ScColumn::GetFirstDataPos() const +{ + if (nCount) + return pItems[0].nRow; + else + return 0; +} SCROW ScColumn::GetLastDataPos() const { -- cgit v1.2.3 From 27472f118a27c8b5b7e6396c9b219645bb0e3402 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Mon, 12 Oct 2009 13:48:51 +0000 Subject: missing usings --- sc/inc/AccessibleFilterMenu.hxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sc/inc/AccessibleFilterMenu.hxx b/sc/inc/AccessibleFilterMenu.hxx index 54194a2d4acf..76344a65ceda 100644 --- a/sc/inc/AccessibleFilterMenu.hxx +++ b/sc/inc/AccessibleFilterMenu.hxx @@ -104,6 +104,9 @@ public: // XAccessibleEventBroadcaster + using ScAccessibleContextBase::addEventListener; + using ScAccessibleContextBase::removeEventListener; + virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< -- cgit v1.2.3 From 489990ac09074893be132200c181e0ac1cbe2817 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Tue, 13 Oct 2009 08:37:49 +0000 Subject: missing virtual dtor --- vcl/inc/vcl/vclevent.hxx | 1 + vcl/source/app/vclevent.cxx | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/vcl/inc/vcl/vclevent.hxx b/vcl/inc/vcl/vclevent.hxx index e519d194c2fa..40e840a3b14c 100644 --- a/vcl/inc/vcl/vclevent.hxx +++ b/vcl/inc/vcl/vclevent.hxx @@ -201,6 +201,7 @@ private: public: VclSimpleEvent( ULONG n ) { nId = n; } + virtual ~VclSimpleEvent(); TYPEINFO(); ULONG GetId() const { return nId; } diff --git a/vcl/source/app/vclevent.cxx b/vcl/source/app/vclevent.cxx index 721dd9fd0419..4c098752c259 100644 --- a/vcl/source/app/vclevent.cxx +++ b/vcl/source/app/vclevent.cxx @@ -43,6 +43,10 @@ TYPEINIT0(VclSimpleEvent); TYPEINIT1(VclWindowEvent, VclSimpleEvent); TYPEINIT1(VclMenuEvent, VclSimpleEvent); +VclSimpleEvent::~VclSimpleEvent() +{ +} + VclAccessibleEvent::VclAccessibleEvent( ULONG n, const Reference& rxAccessible ) : VclSimpleEvent(n), mxAccessible(rxAccessible) {} -- cgit v1.2.3 From fd5ee55b7b9ca4ce23c88b66c75d04b178a21891 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Tue, 13 Oct 2009 09:38:17 +0000 Subject: missing virtual dtor --- vcl/inc/vcl/vclevent.hxx | 2 +- vcl/source/app/vclevent.cxx | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/vcl/inc/vcl/vclevent.hxx b/vcl/inc/vcl/vclevent.hxx index 40e840a3b14c..10c73dc37dda 100644 --- a/vcl/inc/vcl/vclevent.hxx +++ b/vcl/inc/vcl/vclevent.hxx @@ -201,7 +201,6 @@ private: public: VclSimpleEvent( ULONG n ) { nId = n; } - virtual ~VclSimpleEvent(); TYPEINFO(); ULONG GetId() const { return nId; } @@ -253,6 +252,7 @@ class VCL_DLLPUBLIC VclAccessibleEvent: public VclSimpleEvent { public: VclAccessibleEvent( ULONG n, const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxAccessible ); + virtual ~VclAccessibleEvent(); ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > GetAccessible() const; private: diff --git a/vcl/source/app/vclevent.cxx b/vcl/source/app/vclevent.cxx index 4c098752c259..d8e7f37caf6a 100644 --- a/vcl/source/app/vclevent.cxx +++ b/vcl/source/app/vclevent.cxx @@ -43,13 +43,15 @@ TYPEINIT0(VclSimpleEvent); TYPEINIT1(VclWindowEvent, VclSimpleEvent); TYPEINIT1(VclMenuEvent, VclSimpleEvent); -VclSimpleEvent::~VclSimpleEvent() +VclAccessibleEvent::VclAccessibleEvent( ULONG n, const Reference& rxAccessible ) : + VclSimpleEvent(n), + mxAccessible(rxAccessible) { } -VclAccessibleEvent::VclAccessibleEvent( ULONG n, const Reference& rxAccessible ) : - VclSimpleEvent(n), - mxAccessible(rxAccessible) {} +VclAccessibleEvent::~VclAccessibleEvent() +{ +} Reference VclAccessibleEvent::GetAccessible() const { -- cgit v1.2.3 From a0cf30a3798291a310c12a9fbcbc06c00d755c0c Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Tue, 13 Oct 2009 11:30:10 +0000 Subject: unx warning --- sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx b/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx index 0ab5fa270688..9f5524dcb8ce 100644 --- a/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx +++ b/sc/source/ui/Accessibility/AccessibleFilterMenuItem.cxx @@ -80,7 +80,6 @@ Reference ScAccessibleFilterMenuItem::getAccessibleChild(sal_Int32 throw (RuntimeException, IndexOutOfBoundsException) { throw IndexOutOfBoundsException(); - return Reference(); } Reference ScAccessibleFilterMenuItem::getAccessibleStateSet() -- cgit v1.2.3 From 8dc2dfea882ac43277bfabbfb3e2e9b011dee40c Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Tue, 13 Oct 2009 11:53:13 +0000 Subject: missing exceptions file --- sc/source/ui/dbgui/makefile.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/sc/source/ui/dbgui/makefile.mk b/sc/source/ui/dbgui/makefile.mk index 5d716552ca71..d6e5887c66d2 100644 --- a/sc/source/ui/dbgui/makefile.mk +++ b/sc/source/ui/dbgui/makefile.mk @@ -80,6 +80,7 @@ EXCEPTIONSFILES= \ $(SLO)$/csvsplits.obj \ $(SLO)$/csvtablebox.obj \ $(SLO)$/fieldwnd.obj \ + $(SLO)$/pvfundlg.obj \ $(SLO)$/pvlaydlg.obj \ $(SLO)$/dapidata.obj -- cgit v1.2.3 From 620d99d825221ba06276ea3c6144ffd604ee7bc0 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Tue, 13 Oct 2009 12:27:53 +0000 Subject: missing exceptions file --- sc/source/ui/view/makefile.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sc/source/ui/view/makefile.mk b/sc/source/ui/view/makefile.mk index 466ab5dc8627..55e9998881bf 100644 --- a/sc/source/ui/view/makefile.mk +++ b/sc/source/ui/view/makefile.mk @@ -157,7 +157,8 @@ EXCEPTIONSFILES= \ $(SLO)$/cellsh1.obj \ $(SLO)$/drawvie4.obj \ $(SLO)$/formatsh.obj \ - $(SLO)$/scextopt.obj \ + $(SLO)$/gridwin2.obj \ + $(SLO)$/scextopt.obj \ $(SLO)$/tabvwshb.obj \ $(SLO)$/viewdata.obj \ $(SLO)$/viewfun5.obj \ -- cgit v1.2.3 From 557814474f7c73b386fa25a189c5139ac854f616 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Wed, 14 Oct 2009 08:12:03 +0000 Subject: wntmsci12 warnings --- sc/source/core/data/dpoutputgeometry.cxx | 4 ++-- sc/source/ui/cctrl/dpcontrol.cxx | 20 ++++++++++---------- sc/source/ui/view/makefile.mk | 1 - 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/sc/source/core/data/dpoutputgeometry.cxx b/sc/source/core/data/dpoutputgeometry.cxx index 20c071976ebe..9eace100c137 100644 --- a/sc/source/core/data/dpoutputgeometry.cxx +++ b/sc/source/core/data/dpoutputgeometry.cxx @@ -101,7 +101,7 @@ void ScDPOutputGeometry::getColumnFieldPositions(vector& rAddrs) cons SCROW nRow = nCurRow; SCTAB nTab = maOutRange.aStart.Tab(); - SCCOL nColStart = maOutRange.aStart.Col() + mnRowFields + bDataLayout; + SCCOL nColStart = static_cast(maOutRange.aStart.Col() + mnRowFields + (bDataLayout ? 1 : 0)); SCCOL nColEnd = nColStart + static_cast(mnColumnFields-1); for (SCCOL nCol = nColStart; nCol <= nColEnd; ++nCol) @@ -194,7 +194,7 @@ ScDPOutputGeometry::FieldType ScDPOutputGeometry::getFieldButtonType(const ScAdd if (mnColumnFields) { SCROW nRow = nCurRow; - SCCOL nColStart = maOutRange.aStart.Col() + mnRowFields + bDataLayout; + SCCOL nColStart = static_cast(maOutRange.aStart.Col() + mnRowFields + (bDataLayout ? 1 : 0)); SCCOL nColEnd = nColStart + static_cast(mnColumnFields-1); if (rPos.Row() == nRow && nColStart <= rPos.Col() && rPos.Col() <= nColEnd) return Column; diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index ee58c3dca601..a938948e1b26 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -141,7 +141,7 @@ void ScDPFieldButton::draw() Font aTextFont( mpStyle->GetLabelFont() ); double fFontHeight = 12.0; fFontHeight *= static_cast(maZoomY.GetNumerator()) / static_cast(maZoomY.GetDenominator()); - aTextFont.SetHeight(fFontHeight); + aTextFont.SetHeight(static_cast(fFontHeight)); mpOutDev->SetFont(aTextFont); Point aTextPos = maPos; @@ -159,7 +159,7 @@ void ScDPFieldButton::draw() void ScDPFieldButton::getPopupBoundingBox(Point& rPos, Size& rSize) const { - long nW = maSize.getWidth()*0.5; + long nW = maSize.getWidth() / 2; long nH = maSize.getHeight(); if (nW > 18) nW = 18; @@ -830,7 +830,7 @@ void ScMenuFloatingWindow::getMenuItemPosSize(size_t nPos, Point& rPos, Size& rS { const sal_uInt16 nLeftMargin = 5; const sal_uInt16 nTopMargin = 5; - const sal_uInt16 nMenuItemHeight = maLabelFont.GetHeight()*1.8; + const sal_uInt16 nMenuItemHeight = static_cast< sal_uInt16 >( maLabelFont.GetHeight()*1.8 ); Size aWndSize = GetSizePixel(); @@ -1062,15 +1062,15 @@ void ScDPFieldPopupWindow::getSectionPosSize(Point& rPos, Size& rSize, SectionTy const sal_uInt16 nSingleItemBtnAreaHeight = 32; // height of the middle area below the list box where the single-action buttons are. const sal_uInt16 nBottomBtnAreaHeight = 50; // height of the bottom area where the OK and Cancel buttons are. const sal_uInt16 nBtnWidth = 60; - const sal_uInt16 nLabelHeight = getLabelFont().GetHeight(); + const sal_uInt16 nLabelHeight = static_cast< sal_uInt16 >( getLabelFont().GetHeight() ); const sal_uInt16 nBtnHeight = nLabelHeight*2; const sal_uInt16 nBottomMargin = 10; const sal_uInt16 nMenuListMargin = 20; // parameters calculated from constants. - const sal_uInt16 nListBoxWidth = maWndSize.Width() - nListBoxMargin*2; - const sal_uInt16 nListBoxHeight = maWndSize.Height() - nTopMargin - nMenuHeight - - nMenuListMargin - nSingleItemBtnAreaHeight - nBottomBtnAreaHeight; + const sal_uInt16 nListBoxWidth = static_cast< sal_uInt16 >( maWndSize.Width() - nListBoxMargin*2 ); + const sal_uInt16 nListBoxHeight = static_cast< sal_uInt16 >( maWndSize.Height() - nTopMargin - nMenuHeight - + nMenuListMargin - nSingleItemBtnAreaHeight - nBottomBtnAreaHeight ); const sal_uInt16 nSingleBtnAreaY = nTopMargin + nMenuHeight + nListBoxHeight + nMenuListMargin - 1; @@ -1157,7 +1157,7 @@ void ScDPFieldPopupWindow::setAllMemberState(bool bSet) { size_t n = maMembers.size(); for (size_t i = 0; i < n; ++i) - maChecks.CheckEntryPos(i, bSet); + maChecks.CheckEntryPos(static_cast< USHORT >( i ), bSet); } void ScDPFieldPopupWindow::selectCurrentMemberOnly(bool bSet) @@ -1353,7 +1353,7 @@ void ScDPFieldPopupWindow::initMembers() for (size_t i = 0; i < n; ++i) { maChecks.InsertEntry(maMembers[i].maName); - maChecks.CheckEntryPos(i, maMembers[i].mbVisible); + maChecks.CheckEntryPos(static_cast< USHORT >( i ), maMembers[i].mbVisible); if (maMembers[i].mbVisible) ++nVisMemCount; } @@ -1388,7 +1388,7 @@ void ScDPFieldPopupWindow::getResult(hash_map& rRe size_t n = maMembers.size(); for (size_t i = 0; i < n; ++i) { - bool bState = maChecks.IsChecked(i); + bool bState = maChecks.IsChecked(static_cast< USHORT >( i )); aResult.insert(ResultMap::value_type(maMembers[i].maName, bState)); } rResult.swap(aResult); diff --git a/sc/source/ui/view/makefile.mk b/sc/source/ui/view/makefile.mk index 55e9998881bf..aa39b4cc64a0 100644 --- a/sc/source/ui/view/makefile.mk +++ b/sc/source/ui/view/makefile.mk @@ -140,7 +140,6 @@ SLOFILES = \ $(SLO)$/dbfunc2.obj \ $(SLO)$/tabvwsh2.obj .ELSE - NOOPTFILES=\ $(SLO)$/drawview.obj \ $(SLO)$/dbfunc2.obj \ -- cgit v1.2.3 From 24046e0b2625c3ed2da1ad5955771a09fe5f2b36 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Thu, 15 Oct 2009 07:58:02 +0000 Subject: wntmsci12 warning --- sc/source/ui/view/dbfunc3.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx index dcad0cbce885..996625e0491b 100644 --- a/sc/source/ui/view/dbfunc3.cxx +++ b/sc/source/ui/view/dbfunc3.cxx @@ -1788,7 +1788,7 @@ bool ScDBFunc::DataPilotSort( const ScAddress& rPos, bool bAscending, sal_uInt16 nRank = itrSub->second; if (!bAscending) - nRank = nMemberCount - nRank - 1; + nRank = static_cast< sal_uInt16 >( nMemberCount - nRank - 1 ); aRankedNames[nRank] = aName; } -- cgit v1.2.3 From 2aaa78d388dc0eb5b2de84fc5206e7924b579cca Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Thu, 15 Oct 2009 11:25:30 +0000 Subject: wntmsci12 warning --- sc/source/ui/view/gridwin2.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx index c10fee8d9a5e..e0dd63ff090e 100644 --- a/sc/source/ui/view/gridwin2.cxx +++ b/sc/source/ui/view/gridwin2.cxx @@ -514,7 +514,7 @@ void ScGridWindow::DPLaunchFieldPopupMenu( { pSubMenu->addMenuItem( aUserSortNames[i], true, - new PopupSortAction(rPos, PopupSortAction::CUSTOM, i, pViewShell)); + new PopupSortAction(rPos, PopupSortAction::CUSTOM, static_cast(i), pViewShell)); } } -- cgit v1.2.3 -- cgit v1.2.3 From f106df419d4b45955d65b41a53c901b55a672696 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Tue, 3 Nov 2009 13:54:02 +0100 Subject: #i106577# - Added missing since tags --- offapi/com/sun/star/task/XUrlContainer.idl | 4 +++- offapi/com/sun/star/ucb/URLAuthenticationRequest.idl | 2 ++ offapi/com/sun/star/ucb/XInteractionSupplyAuthentication2.idl | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/offapi/com/sun/star/task/XUrlContainer.idl b/offapi/com/sun/star/task/XUrlContainer.idl index 93839e68fb07..9ac704c56ba0 100644 --- a/offapi/com/sun/star/task/XUrlContainer.idl +++ b/offapi/com/sun/star/task/XUrlContainer.idl @@ -46,6 +46,8 @@ module com { module sun { module star { module task { //============================================================================= /** Allows to store and retrieve URLs. URLs can be stored persistently or until end of OOo session. + + @since OOo 3.2 */ /*published*/ interface XUrlContainer : com::sun::star::uno::XInterface { @@ -63,7 +65,7 @@ module com { module sun { module star { module task { /** Lookup a URL in the container. @param Url URL to lookup. - @returns Best matched URL or empty string. + @returns Best matched URL or empty string. */ string findUrl( [in] string Url ); diff --git a/offapi/com/sun/star/ucb/URLAuthenticationRequest.idl b/offapi/com/sun/star/ucb/URLAuthenticationRequest.idl index 1b19830df81e..84d5f7d6cb7c 100644 --- a/offapi/com/sun/star/ucb/URLAuthenticationRequest.idl +++ b/offapi/com/sun/star/ucb/URLAuthenticationRequest.idl @@ -42,6 +42,8 @@ module com { module sun { module star { module ucb { //============================================================================= /** An error specifing lack of correct authentication data (e.g., to log into an account). + + @since OOo 3.2 */ /*published*/ exception URLAuthenticationRequest : AuthenticationRequest { diff --git a/offapi/com/sun/star/ucb/XInteractionSupplyAuthentication2.idl b/offapi/com/sun/star/ucb/XInteractionSupplyAuthentication2.idl index a3c4bdb3d5f3..01241f108950 100644 --- a/offapi/com/sun/star/ucb/XInteractionSupplyAuthentication2.idl +++ b/offapi/com/sun/star/ucb/XInteractionSupplyAuthentication2.idl @@ -45,6 +45,8 @@ module com { module sun { module star { module ucb {

This continuation is typically used in conjunction with AuthenticationRequest.

+ + @since OOo 3.2 */ /*published*/ interface XInteractionSupplyAuthentication2 : XInteractionSupplyAuthentication { -- cgit v1.2.3 From d7077733280b2b6d98837dfdb9654faa71ee19f6 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Tue, 3 Nov 2009 13:57:46 +0100 Subject: #106429# - unchecked read in FTPInputStream::readBytes --- ucb/source/ucp/ftp/ftpinpstr.cxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ucb/source/ucp/ftp/ftpinpstr.cxx b/ucb/source/ucp/ftp/ftpinpstr.cxx index 91b283271eb3..2f7a82baa234 100644 --- a/ucb/source/ucp/ftp/ftpinpstr.cxx +++ b/ucb/source/ucp/ftp/ftpinpstr.cxx @@ -56,8 +56,8 @@ FTPInputStream::FTPInputStream(FILE* tmpfl) : m_tmpfl(tmpfl ? tmpfl : tmpfile()) { fseek(m_tmpfl,0,SEEK_END); -// fpos_t pos; -// fgetpos(m_tmpfl,&pos); +// fpos_t pos; +// fgetpos(m_tmpfl,&pos); long pos = ftell(m_tmpfl); rewind(m_tmpfl); m_nLength = sal_Int64(pos); @@ -119,14 +119,17 @@ sal_Int32 SAL_CALL FTPInputStream::readBytes(Sequence< sal_Int8 >& aData, long bpos,epos; bpos = ftell(m_tmpfl); - fread(aData.getArray(),nBytesToRead,1,m_tmpfl); + if (fread(aData.getArray(),nBytesToRead,1,m_tmpfl) != 1) + throw IOException(); + epos = ftell(m_tmpfl); return sal_Int32(epos-bpos); } -sal_Int32 SAL_CALL FTPInputStream::readSomeBytes( Sequence< sal_Int8 >& aData,sal_Int32 nMaxBytesToRead ) +sal_Int32 SAL_CALL FTPInputStream::readSomeBytes( Sequence< sal_Int8 >& aData, + sal_Int32 nMaxBytesToRead ) throw( NotConnectedException, BufferSizeExceededException, IOException, -- cgit v1.2.3 From 347f51dbe5feff3522c9fdc1bb773a948646a344 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Tue, 3 Nov 2009 13:59:39 +0100 Subject: #106478# - memory leak in FTPURL::parse --- ucb/source/ucp/ftp/ftpurl.cxx | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/ucb/source/ucp/ftp/ftpurl.cxx b/ucb/source/ucp/ftp/ftpurl.cxx index 420b3f993f4f..a0dfbc1b6f51 100644 --- a/ucb/source/ucp/ftp/ftpurl.cxx +++ b/ucb/source/ucp/ftp/ftpurl.cxx @@ -163,19 +163,18 @@ void FTPURL::parse(const rtl::OUString& url) rtl::OString aIdent(url.getStr(), url.getLength(), RTL_TEXTENCODING_UTF8); - char *buffer = new char[1+aIdent.getLength()]; - - const char* p2 = aIdent.getStr(); rtl::OString lower = aIdent.toAsciiLowerCase(); if(lower.getLength() < 6 || strncmp("ftp://",lower.getStr(),6)) throw malformed_exception(); + char *buffer = new char[1+aIdent.getLength()]; + const char* p2 = aIdent.getStr(); p2 += 6; char ch; - char *p1 = buffer; // determine "username:password@host:port" + char *p1 = buffer; // determine "username:password@host:port" while((ch = *p2++) != '/' && ch) *p1++ = ch; *p1 = 0; @@ -393,7 +392,7 @@ namespace ftp { #define SET_DATA_CONTAINER \ - curl_easy_setopt(curl,CURLOPT_NOBODY,false); \ + curl_easy_setopt(curl,CURLOPT_NOBODY,false); \ MemoryContainer data; \ curl_easy_setopt(curl,CURLOPT_WRITEFUNCTION,memory_write); \ curl_easy_setopt(curl,CURLOPT_WRITEDATA,&data) @@ -665,8 +664,8 @@ void FTPURL::insert(bool replaceExisting,void* stream) const throw(curl_exception) { if(!replaceExisting) { -// FTPDirentry aDirentry(direntry()); -// if(aDirentry.m_nMode == INETCOREFTP_FILEMODE_UNKNOWN) +// FTPDirentry aDirentry(direntry()); +// if(aDirentry.m_nMode == INETCOREFTP_FILEMODE_UNKNOWN) // throw curl_exception(FILE_EXIST_DURING_INSERT); throw curl_exception(FILE_MIGHT_EXIST_DURING_INSERT); } // else @@ -716,8 +715,8 @@ void FTPURL::mkdir(bool ReplaceExisting) const FTPDirentry aDirentry(direntry()); if(!ReplaceExisting) { -// if(aDirentry.m_nMode != INETCOREFTP_FILEMODE_UNKNOWN) -// throw curl_exception(FOLDER_EXIST_DURING_INSERT); +// if(aDirentry.m_nMode != INETCOREFTP_FILEMODE_UNKNOWN) +// throw curl_exception(FOLDER_EXIST_DURING_INSERT); throw curl_exception(FOLDER_MIGHT_EXIST_DURING_INSERT); } else if(aDirentry.m_nMode != INETCOREFTP_FILEMODE_UNKNOWN) slist = curl_slist_append(slist,aDel.getStr()); -- cgit v1.2.3 From 73392182e5a8a37b09039cc0c510a4ba1bb9016b Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Tue, 3 Nov 2009 14:31:25 +0100 Subject: #i105553# - removed unused code. --- ucb/source/ucp/ftp/ftpcontent.cxx | 21 ++++----------------- ucb/source/ucp/ftp/ftpcontent.hxx | 8 +------- ucb/source/ucp/ftp/ftpdirp.cxx | 12 ------------ ucb/source/ucp/ftp/ftpdirp.hxx | 5 ----- ucb/source/ucp/ftp/ftpintreq.cxx | 14 -------------- ucb/source/ucp/ftp/ftpintreq.hxx | 4 ---- 6 files changed, 5 insertions(+), 59 deletions(-) diff --git a/ucb/source/ucp/ftp/ftpcontent.cxx b/ucb/source/ucp/ftp/ftpcontent.cxx index e4533d872275..63189c642e36 100644 --- a/ucb/source/ucp/ftp/ftpcontent.cxx +++ b/ucb/source/ucp/ftp/ftpcontent.cxx @@ -104,19 +104,6 @@ using namespace com::sun::star::sdbc; //========================================================================= //========================================================================= -FTPContent::FTPContent( const Reference< XMultiServiceFactory >& rxSMgr, - FTPContentProvider* pProvider, - const Reference< XContentIdentifier >& Identifier) - : ContentImplHelper(rxSMgr,pProvider,Identifier), - m_pFCP(pProvider), - m_aFTPURL(Identifier->getContentIdentifier(), - pProvider), - m_bInserted(false), - m_bTitleSet(false) -{ -} - - FTPContent::FTPContent( const Reference< XMultiServiceFactory >& rxSMgr, FTPContentProvider* pProvider, const Reference< XContentIdentifier >& Identifier, @@ -175,9 +162,9 @@ XINTERFACE_IMPL_6( FTPContent, //========================================================================= XTYPEPROVIDER_IMPL_6( FTPContent, - XTypeProvider, - XServiceInfo, - XContent, + XTypeProvider, + XServiceInfo, + XContent, XCommandProcessor, XContentCreator, XChild); @@ -697,7 +684,7 @@ sal_Int32 InsertData::read(sal_Int8 *dest,sal_Int32 nBytesRequested) sal_Int32 m = 0; if(m_xInputStream.is()) { - Sequence seq(nBytesRequested); + Sequence seq(nBytesRequested); m = m_xInputStream->readBytes(seq,nBytesRequested); rtl_copyMemory(dest,seq.getConstArray(),m); } diff --git a/ucb/source/ucp/ftp/ftpcontent.hxx b/ucb/source/ucp/ftp/ftpcontent.hxx index 3d243cff84dd..1997537d0d81 100644 --- a/ucb/source/ucp/ftp/ftpcontent.hxx +++ b/ucb/source/ucp/ftp/ftpcontent.hxx @@ -59,7 +59,7 @@ namespace ftp struct ContentProperties { - ::rtl::OUString aTitle; // Title + ::rtl::OUString aTitle; // Title ::rtl::OUString aContentType; // ContentType sal_Bool bIsDocument; // IsDocument sal_Bool bIsFolder; // IsFolder @@ -80,12 +80,6 @@ namespace ftp { public: - FTPContent( const ::com::sun::star::uno::Reference< - ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr, - FTPContentProvider* pProvider, - const ::com::sun::star::uno::Reference< - ::com::sun::star::ucb::XContentIdentifier >& Identifier); - FTPContent( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr, FTPContentProvider* pProvider, diff --git a/ucb/source/ucp/ftp/ftpdirp.cxx b/ucb/source/ucp/ftp/ftpdirp.cxx index 2b281e73319d..516ad7e84ddb 100644 --- a/ucb/source/ucp/ftp/ftpdirp.cxx +++ b/ucb/source/ucp/ftp/ftpdirp.cxx @@ -973,18 +973,6 @@ sal_Bool FTPDirectoryParser::parseUNIX ( return sal_False; } -/* - * parseUNKNOWN. - */ -sal_Bool FTPDirectoryParser::parseUNKNOWN ( - FTPDirentry &rEntry, - const sal_Char *pBuffer, - sal_uInt32 nLength) -{ - setPath (rEntry.m_aName, pBuffer,sal_Int32 (nLength)); - return sal_True; -} - /* * parseUNIX_isSizeField. */ diff --git a/ucb/source/ucp/ftp/ftpdirp.hxx b/ucb/source/ucp/ftp/ftpdirp.hxx index 4a57ee841cba..94df845d3806 100644 --- a/ucb/source/ucp/ftp/ftpdirp.hxx +++ b/ucb/source/ucp/ftp/ftpdirp.hxx @@ -146,11 +146,6 @@ namespace ftp { FTPDirentry &rEntry, const sal_Char *pBuffer ); - static sal_Bool parseUNKNOWN ( - FTPDirentry &rEntry, - const sal_Char *pBuffer, - sal_uInt32 nLength); - private: diff --git a/ucb/source/ucp/ftp/ftpintreq.cxx b/ucb/source/ucp/ftp/ftpintreq.cxx index 1844036cba9d..cb0712f19f1a 100644 --- a/ucb/source/ucp/ftp/ftpintreq.cxx +++ b/ucb/source/ucp/ftp/ftpintreq.cxx @@ -101,7 +101,6 @@ bool XInteractionApproveImpl::isSelected() const } - // XInteractionDisapproveImpl XInteractionDisapproveImpl::XInteractionDisapproveImpl() @@ -156,13 +155,6 @@ void SAL_CALL XInteractionDisapproveImpl::select() } -bool XInteractionDisapproveImpl::isSelected() const -{ - return m_bSelected; -} - - - // XInteractionRequestImpl XInteractionRequestImpl::XInteractionRequestImpl(const rtl::OUString& aName) @@ -234,12 +226,6 @@ XInteractionRequestImpl::getContinuations( ) } -bool XInteractionRequestImpl::aborted() const -{ - return p2->isSelected(); -} - - bool XInteractionRequestImpl::approved() const { return p1->isSelected(); diff --git a/ucb/source/ucp/ftp/ftpintreq.hxx b/ucb/source/ucp/ftp/ftpintreq.hxx index 3b26b2c57162..6d335f22ef83 100644 --- a/ucb/source/ucp/ftp/ftpintreq.hxx +++ b/ucb/source/ucp/ftp/ftpintreq.hxx @@ -118,8 +118,6 @@ namespace ftp { virtual void SAL_CALL select() throw (com::sun::star::uno::RuntimeException); - bool isSelected() const; - private: bool m_bSelected; @@ -166,8 +164,6 @@ namespace ftp { getContinuations( ) throw (com::sun::star::uno::RuntimeException); - bool aborted() const; - bool approved() const; private: -- cgit v1.2.3 From b1615bf6670f19a301859cdf9d478365a4ff9e40 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Tue, 3 Nov 2009 14:31:46 +0100 Subject: #i105553# - removed unused code. --- ucb/source/ucp/file/filtask.cxx | 75 +++++++---------------------------------- ucb/source/ucp/file/filtask.hxx | 24 ++----------- 2 files changed, 15 insertions(+), 84 deletions(-) diff --git a/ucb/source/ucp/file/filtask.cxx b/ucb/source/ucp/file/filtask.cxx index 57c165b0b9b0..b1b7f47fc17e 100644 --- a/ucb/source/ucp/file/filtask.cxx +++ b/ucb/source/ucp/file/filtask.cxx @@ -33,11 +33,11 @@ #include "filtask.hxx" #include "filglob.hxx" -/*********************************************************************************/ -/* */ -/* TaskHandling */ -/* */ -/*********************************************************************************/ +/******************************************************************************/ +/* */ +/* TaskHandling */ +/* */ +/******************************************************************************/ using namespace fileaccess; @@ -70,7 +70,9 @@ TaskManager::startTask( TaskMap::iterator it = m_aTaskMap.find( CommandId ); if( it != m_aTaskMap.end() ) { - throw DuplicateCommandIdentifierException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); + throw DuplicateCommandIdentifierException( + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), + uno::Reference< uno::XInterface >() ); } m_aTaskMap[ CommandId ] = TaskHandling( xCommandEnv ); } @@ -91,7 +93,8 @@ TaskManager::endTask( sal_Int32 CommandId, sal_Int32 MinorCode = it->second.getMinorErrorCode(); bool isHandled = it->second.isHandled(); - Reference< XCommandEnvironment > xComEnv = it->second.getCommandEnvironment(); + Reference< XCommandEnvironment > xComEnv + = it->second.getCommandEnvironment(); m_aTaskMap.erase( it ); @@ -122,17 +125,6 @@ TaskManager::abort( sal_Int32 CommandId ) } -bool SAL_CALL TaskManager::isAborted( sal_Int32 CommandId ) -{ - osl::MutexGuard aGuard( m_aMutex ); - TaskMap::iterator it = m_aTaskMap.find( CommandId ); - if( it == m_aTaskMap.end() || it->second.isAborted() ) - return false; - else - return true; -} - - void SAL_CALL TaskManager::clearError( sal_Int32 CommandId ) { osl::MutexGuard aGuard( m_aMutex ); @@ -178,45 +170,9 @@ TaskManager::getCommandId( void ) -uno::Reference< task::XInteractionHandler > SAL_CALL -TaskManager::getInteractionHandler( sal_Int32 CommandId ) -{ - osl::MutexGuard aGuard( m_aMutex ); - TaskMap::iterator it = m_aTaskMap.find( CommandId ); - if( it == m_aTaskMap.end() ) - return uno::Reference< task::XInteractionHandler >( 0 ); - else - return it->second.getInteractionHandler(); -} - - - -uno::Reference< XProgressHandler > SAL_CALL -TaskManager::getProgressHandler( sal_Int32 CommandId ) -{ - osl::MutexGuard aGuard( m_aMutex ); - TaskMap::iterator it = m_aTaskMap.find( CommandId ); - if( it == m_aTaskMap.end() ) - return uno::Reference< XProgressHandler >( 0 ); - else - return it->second.getProgressHandler(); -} - - -uno::Reference< XCommandEnvironment > SAL_CALL -TaskManager::getCommandEnvironment( sal_Int32 CommandId ) -{ - osl::MutexGuard aGuard( m_aMutex ); - TaskMap::iterator it = m_aTaskMap.find( CommandId ); - if( it == m_aTaskMap.end() ) - return uno::Reference< XCommandEnvironment >( 0 ); - else - return it->second.getCommandEnvironment(); -} - - -void SAL_CALL TaskManager::handleTask( sal_Int32 CommandId, - const uno::Reference< task::XInteractionRequest >& request ) +void SAL_CALL TaskManager::handleTask( + sal_Int32 CommandId, + const uno::Reference< task::XInteractionRequest >& request ) { osl::MutexGuard aGuard( m_aMutex ); TaskMap::iterator it = m_aTaskMap.find( CommandId ); @@ -229,8 +185,3 @@ void SAL_CALL TaskManager::handleTask( sal_Int32 CommandId, it->second.setHandled(); } } - - - - - diff --git a/ucb/source/ucp/file/filtask.hxx b/ucb/source/ucp/file/filtask.hxx index a507ba1bee80..a4e7bff25c82 100644 --- a/ucb/source/ucp/file/filtask.hxx +++ b/ucb/source/ucp/file/filtask.hxx @@ -40,9 +40,7 @@ #include #include #include -#ifndef _FILERROR_HXX_ #include "filerror.hxx" -#endif namespace fileaccess @@ -52,11 +50,8 @@ namespace fileaccess /* * This implementation is inherited by class fileaccess::shell. * The relevant methods in this class all have as first argument the CommandId, - * so if necessary, every method has acess to its relevant XInteractionHandler and - * XProgressHandler, simply by calling directly the method - * getInteractionHandler( CommandId ) - * and - * getProgressHandler(); + * so if necessary, every method has access to its relevant XInteractionHandler and + * XProgressHandler. */ @@ -95,11 +90,6 @@ namespace fileaccess m_bAbort = true; } - bool SAL_CALL isAborted() - { - return m_bAbort; - } - void setHandled() { m_bHandled = true; @@ -234,16 +224,6 @@ namespace fileaccess void SAL_CALL clearError( sal_Int32 ); - - com::sun::star::uno::Reference< com::sun::star::task::XInteractionHandler > SAL_CALL - getInteractionHandler( sal_Int32 CommandId ); - - com::sun::star::uno::Reference< com::sun::star::ucb::XProgressHandler > SAL_CALL - getProgressHandler( sal_Int32 CommandId ); - - com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment > SAL_CALL - getCommandEnvironment( sal_Int32 CommandId ); - }; } // end namespace TaskHandling -- cgit v1.2.3 From 089e1d5fc617f484b1309706d6d3b1347a6a30d1 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Wed, 11 Nov 2009 15:41:28 +0100 Subject: #i106820# - Added CommandEnvironment.idl --- offapi/com/sun/star/ucb/makefile.mk | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/offapi/com/sun/star/ucb/makefile.mk b/offapi/com/sun/star/ucb/makefile.mk index 19320b716634..fc6aed3640a4 100644 --- a/offapi/com/sun/star/ucb/makefile.mk +++ b/offapi/com/sun/star/ucb/makefile.mk @@ -1,7 +1,7 @@ #************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# +# # Copyright 2008 by Sun Microsystems, Inc. # # OpenOffice.org - a multi-platform office productivity suite @@ -55,8 +55,10 @@ IDLFILES=\ CachedDynamicResultSetStub.idl\ CachedDynamicResultSetStubFactory.idl\ CHAOSProgressStart.idl\ + CertificateValidationRequest.idl\ Command.idl\ CommandAbortedException.idl\ + CommandEnvironment.idl\ CommandFailedException.idl\ CommandInfo.idl\ CommandInfoChange.idl\ @@ -264,8 +266,7 @@ IDLFILES=\ XSimpleFileAccess3.idl\ XSortedDynamicResultSetFactory.idl\ XSourceInitialization.idl\ - XWebDAVCommandEnvironment.idl \ - CertificateValidationRequest.idl + XWebDAVCommandEnvironment.idl # ------------------------------------------------------------------ -- cgit v1.2.3 From 71d19002cdca4723f8dc523532c25a003fbab8b4 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Wed, 11 Nov 2009 15:42:49 +0100 Subject: #i106820# - Initial revision. --- offapi/com/sun/star/ucb/CommandEnvironment.idl | 67 ++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 offapi/com/sun/star/ucb/CommandEnvironment.idl diff --git a/offapi/com/sun/star/ucb/CommandEnvironment.idl b/offapi/com/sun/star/ucb/CommandEnvironment.idl new file mode 100644 index 000000000000..06bde886629b --- /dev/null +++ b/offapi/com/sun/star/ucb/CommandEnvironment.idl @@ -0,0 +1,67 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: SmoketestCommandEnvironment.idl,v $ + * $Revision: 1.3 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _com_sun_star_ucb_CommandEnvironment_idl_ +#define _com_sun_star_ucb_CommandEnvironment_idl_ + +#include +#include +#include + +module com { module sun { module star { module ucb { + + /* This service implements an XCommandEnvironment that can be + initialized with any implementation of + XInteractionHandler and + XProgressHandler. The respective + get methods will simply return these handlers. + + @since OOo 3.3 + */ + service CommandEnvironment : ::com::sun::star::ucb::XCommandEnvironment + { + //------------------------------------------------------------------------- + /** Constructor. + + @param InteractionHandler the interaction handler instance that will be + returned by this service' implementation of + XCommandEnvironemt::getInteractionHandler + + @param ProgressHandler the progress handler instance that will be + returned by this service' implementation of + XCommandEnvironemt::getProgressHandler + */ + create( [in] com::sun::star::task::XInteractionHandler InteractionHandler, + [in] com::sun::star::ucb::XProgressHandler ProgressHandler ); + }; + +};};};}; + +#endif -- cgit v1.2.3 From 47a69c03cbb7e7cbdd403d46151921166c7b2ce3 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Wed, 11 Nov 2009 15:44:30 +0100 Subject: #i106820# - Initial revision. --- ucb/source/core/cmdenv.cxx | 194 +++++++++++++++++++++++++++++++++++++++++++++ ucb/source/core/cmdenv.hxx | 105 ++++++++++++++++++++++++ 2 files changed, 299 insertions(+) create mode 100644 ucb/source/core/cmdenv.cxx create mode 100644 ucb/source/core/cmdenv.hxx diff --git a/ucb/source/core/cmdenv.cxx b/ucb/source/core/cmdenv.cxx new file mode 100644 index 000000000000..e9851f4dfa0f --- /dev/null +++ b/ucb/source/core/cmdenv.cxx @@ -0,0 +1,194 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: $ + * $Revision: $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_ucb.hxx" + +#include "cppuhelper/factory.hxx" +#include "com/sun/star/lang/IllegalArgumentException.hpp" + +#include "cmdenv.hxx" + +/************************************************************************** + TODO + ************************************************************************** + + *************************************************************************/ +using namespace com::sun::star; +using namespace ucb_cmdenv; + +//========================================================================= +//========================================================================= +// +// UcbCommandEnvironment Implementation. +// +//========================================================================= +//========================================================================= + +UcbCommandEnvironment::UcbCommandEnvironment( + const uno::Reference< lang::XMultiServiceFactory >& xSMgr ) +//: m_xSMgr( xSMgr ) +{ +} + +//========================================================================= +// virtual +UcbCommandEnvironment::~UcbCommandEnvironment() +{ +} + +//========================================================================= +// +// XInitialization methods. +// +//========================================================================= + +// virtual +void SAL_CALL UcbCommandEnvironment::initialize( + const uno::Sequence< uno::Any >& aArguments ) + throw( uno::Exception, + uno::RuntimeException ) +{ + if ( ( aArguments.getLength() < 2 ) || + !( aArguments[ 0 ] >>= m_xIH ) || + !( aArguments[ 1 ] >>= m_xPH )) + throw lang::IllegalArgumentException(); +} + +//========================================================================= +// +// XServiceInfo methods. +// +//========================================================================= + +// virtual +::rtl::OUString SAL_CALL UcbCommandEnvironment::getImplementationName() + throw ( uno::RuntimeException ) +{ + return getImplementationName_Static(); +} + +//========================================================================= +// virtual +sal_Bool SAL_CALL +UcbCommandEnvironment::supportsService( const ::rtl::OUString& ServiceName ) + throw ( uno::RuntimeException ) +{ + uno::Sequence< rtl::OUString > aSNL = getSupportedServiceNames(); + const rtl::OUString * pArray = aSNL.getConstArray(); + for ( sal_Int32 i = 0; i < aSNL.getLength(); i++ ) + { + if ( pArray[ i ] == ServiceName ) + return sal_True; + } + return sal_False; +} + +//========================================================================= +// virtual +uno::Sequence< ::rtl::OUString > SAL_CALL +UcbCommandEnvironment::getSupportedServiceNames() + throw ( uno::RuntimeException ) +{ + return getSupportedServiceNames_Static(); +} + +//========================================================================= +// static +rtl::OUString UcbCommandEnvironment::getImplementationName_Static() +{ + return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.comp.ucb.CommandEnvironment" ) ); +} + +//========================================================================= +// static +uno::Sequence< rtl::OUString > +UcbCommandEnvironment::getSupportedServiceNames_Static() +{ + uno::Sequence< rtl::OUString > aSNS( 1 ); + aSNS.getArray()[ 0 ] + = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.ucb.CommandEnvironment" ) ); + return aSNS; +} + +//========================================================================= +// +// XCommandInfo methods. +// +//========================================================================= + +// virtual +uno::Reference< task::XInteractionHandler > SAL_CALL +UcbCommandEnvironment::getInteractionHandler() + throw ( uno::RuntimeException ) +{ + return m_xIH; +} + +//========================================================================= +// virtual +uno::Reference< ucb::XProgressHandler > SAL_CALL +UcbCommandEnvironment::getProgressHandler() + throw ( uno::RuntimeException ) +{ + return m_xPH; +} + +//========================================================================= +// +// Service factory implementation. +// +//========================================================================= + +static uno::Reference< uno::XInterface > SAL_CALL +UcbCommandEnvironment_CreateInstance( + const uno::Reference< lang::XMultiServiceFactory> & rSMgr ) + throw( uno::Exception ) +{ + lang::XServiceInfo * pX = static_cast< lang::XServiceInfo * >( + new UcbCommandEnvironment( rSMgr ) ); + return uno::Reference< uno::XInterface >::query( pX ); +} + +//========================================================================= +// static +uno::Reference< lang::XSingleServiceFactory > +UcbCommandEnvironment::createServiceFactory( + const uno::Reference< lang::XMultiServiceFactory >& rxServiceMgr ) +{ + return uno::Reference< lang::XSingleServiceFactory >( + cppu::createOneInstanceFactory( + rxServiceMgr, + UcbCommandEnvironment::getImplementationName_Static(), + UcbCommandEnvironment_CreateInstance, + UcbCommandEnvironment::getSupportedServiceNames_Static() ) ); +} diff --git a/ucb/source/core/cmdenv.hxx b/ucb/source/core/cmdenv.hxx new file mode 100644 index 000000000000..62c550b7ca51 --- /dev/null +++ b/ucb/source/core/cmdenv.hxx @@ -0,0 +1,105 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: $ + * $Revision: $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef INCLUDED_CMDENV_HXX +#define INCLUDED_CMDENV_HXX + +#include "cppuhelper/implbase3.hxx" + +#include "com/sun/star/lang/XInitialization.hpp" +#include "com/sun/star/lang/XServiceInfo.hpp" +#include "com/sun/star/lang/XSingleServiceFactory.hpp" +#include "com/sun/star/ucb/XCommandEnvironment.hpp" + +namespace ucb_cmdenv { + +class UcbCommandEnvironment : + public cppu::WeakImplHelper3< com::sun::star::lang::XInitialization, + com::sun::star::lang::XServiceInfo, + com::sun::star::ucb::XCommandEnvironment > +{ + com::sun::star::uno::Reference< + com::sun::star::task::XInteractionHandler > m_xIH; + com::sun::star::uno::Reference< + com::sun::star::ucb::XProgressHandler > m_xPH; + +public: + UcbCommandEnvironment( + const com::sun::star::uno::Reference< + com::sun::star::lang::XMultiServiceFactory >& rXSMgr ); + virtual ~UcbCommandEnvironment(); + + // XInitialization + virtual void SAL_CALL + initialize( const com::sun::star::uno::Sequence< + com::sun::star::uno::Any >& aArguments ) + throw( com::sun::star::uno::Exception, + com::sun::star::uno::RuntimeException ); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw ( com::sun::star::uno::RuntimeException ); + + virtual sal_Bool SAL_CALL + supportsService( const ::rtl::OUString& ServiceName ) + throw ( com::sun::star::uno::RuntimeException ); + + virtual com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames() + throw ( com::sun::star::uno::RuntimeException ); + + // XCommandEnvironment + virtual com::sun::star::uno::Reference< + com::sun::star::task::XInteractionHandler > SAL_CALL + getInteractionHandler() + throw ( com::sun::star::uno::RuntimeException ); + virtual com::sun::star::uno::Reference< + com::sun::star::ucb::XProgressHandler > SAL_CALL + getProgressHandler() + throw ( com::sun::star::uno::RuntimeException ); + + // Non-UNO interfaces + static rtl::OUString + getImplementationName_Static(); + static com::sun::star::uno::Sequence< rtl::OUString > + getSupportedServiceNames_Static(); + + static com::sun::star::uno::Reference< + com::sun::star::lang::XSingleServiceFactory > + createServiceFactory( const com::sun::star::uno::Reference< + com::sun::star::lang::XMultiServiceFactory > & rxServiceMgr ); +private: + //com::sun::star::uno::Reference< + // com::sun::star::lang::XMultiServiceFactory > m_xSMgr; +}; + +} // namespace ucb_cmdenv + +#endif // INCLUDED_CMDENV_HXX -- cgit v1.2.3 From 19a645e9cd708856500063e741741bbe0da566b0 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Wed, 11 Nov 2009 15:45:48 +0100 Subject: #i106820# - New: CommandEnvironment service. --- ucb/source/core/makefile.mk | 7 ++++--- ucb/source/core/ucbserv.cxx | 24 ++++++++++++++++++++++-- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/ucb/source/core/makefile.mk b/ucb/source/core/makefile.mk index e70b5ca879ef..3f80aac74c51 100644 --- a/ucb/source/core/makefile.mk +++ b/ucb/source/core/makefile.mk @@ -1,7 +1,7 @@ #************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# +# # Copyright 2008 by Sun Microsystems, Inc. # # OpenOffice.org - a multi-platform office productivity suite @@ -48,7 +48,8 @@ SLOFILES=\ $(SLO)$/ucbstore.obj \ $(SLO)$/ucbprops.obj \ $(SLO)$/provprox.obj \ - $(SLO)$/ucbcmds.obj + $(SLO)$/ucbcmds.obj \ + $(SLO)$/cmdenv.obj LIB1TARGET=$(SLB)$/_$(TARGET).lib LIB1OBJFILES=$(SLOFILES) @@ -59,7 +60,7 @@ SHL1STDLIBS=\ $(CPPUHELPERLIB) \ $(CPPULIB) \ $(SALLIB) \ - $(UCBHELPERLIB) + $(UCBHELPERLIB) SHL1LIBS=\ $(LIB1TARGET) \ $(SLB)$/regexp.lib diff --git a/ucb/source/core/ucbserv.cxx b/ucb/source/core/ucbserv.cxx index 17630a8ef210..70e09d373d48 100644 --- a/ucb/source/core/ucbserv.cxx +++ b/ucb/source/core/ucbserv.cxx @@ -37,6 +37,7 @@ #include "ucbstore.hxx" #include "ucbprops.hxx" #include "provprox.hxx" +#include "cmdenv.hxx" using namespace rtl; using namespace com::sun::star::uno; @@ -46,7 +47,7 @@ using namespace com::sun::star::registry; //========================================================================= static sal_Bool writeInfo( void * pRegistryKey, const OUString & rImplementationName, - Sequence< OUString > const & rServiceNames ) + Sequence< OUString > const & rServiceNames ) { OUString aKeyName( OUString::createFromAscii( "/" ) ); aKeyName += rImplementationName; @@ -124,7 +125,15 @@ extern "C" sal_Bool SAL_CALL component_writeInfo( void *, void * pRegistryKey ) writeInfo( pRegistryKey, UcbContentProviderProxyFactory::getImplementationName_Static(), - UcbContentProviderProxyFactory::getSupportedServiceNames_Static() ); + UcbContentProviderProxyFactory::getSupportedServiceNames_Static() ) && + + ////////////////////////////////////////////////////////////////////// + // Command Environment. + ////////////////////////////////////////////////////////////////////// + + writeInfo( pRegistryKey, + ucb_cmdenv::UcbCommandEnvironment::getImplementationName_Static(), + ucb_cmdenv::UcbCommandEnvironment::getSupportedServiceNames_Static() ); } //========================================================================= @@ -178,6 +187,17 @@ extern "C" void * SAL_CALL component_getFactory( = UcbContentProviderProxyFactory::createServiceFactory( xSMgr ); } + ////////////////////////////////////////////////////////////////////// + // Command Environment. + ////////////////////////////////////////////////////////////////////// + + else if ( ucb_cmdenv::UcbCommandEnvironment::getImplementationName_Static(). + compareToAscii( pImplName ) == 0 ) + { + xFactory + = ucb_cmdenv::UcbCommandEnvironment::createServiceFactory( xSMgr ); + } + ////////////////////////////////////////////////////////////////////// if ( xFactory.is() ) -- cgit v1.2.3 From bf54db8b13d611c461ba2db9030f7d92e1497baf Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Thu, 12 Nov 2009 13:50:09 +0100 Subject: #i105942# --- sd/source/filter/eppt/epptso.cxx | 103 +++++++++++++++++++-------------------- 1 file changed, 50 insertions(+), 53 deletions(-) diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx index 75e5a4ba3227..6b0e12213449 100644 --- a/sd/source/filter/eppt/epptso.cxx +++ b/sd/source/filter/eppt/epptso.cxx @@ -1963,54 +1963,68 @@ void PortionObj::ImplGetPortionValues( FontCollection& rFontCollection, sal_Bool } } - if ( nScriptType != com::sun::star::i18n::ScriptType::COMPLEX ) + rtl::OUString aCharHeightName, aCharWeightName, aCharLocaleName, aCharPostureName; + switch( nScriptType ) { - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharWeight" ) ), bGetPropStateValue ) ) + case com::sun::star::i18n::ScriptType::ASIAN : { - float fFloat; - mAny >>= fFloat; - if ( fFloat >= ::com::sun::star::awt::FontWeight::SEMIBOLD ) - mnCharAttr |= 1; + aCharHeightName = String( RTL_CONSTASCII_USTRINGPARAM( "CharHeightAsian" ) ); + aCharWeightName = String( RTL_CONSTASCII_USTRINGPARAM( "CharWeightAsian" ) ); + aCharLocaleName = String( RTL_CONSTASCII_USTRINGPARAM( "CharLocaleAsian" ) ); + aCharPostureName = String( RTL_CONSTASCII_USTRINGPARAM( "CharPostureAsian" ) ); + break; + } + case com::sun::star::i18n::ScriptType::COMPLEX : + { + aCharHeightName = String( RTL_CONSTASCII_USTRINGPARAM( "CharHeightComplex" ) ); + aCharWeightName = String( RTL_CONSTASCII_USTRINGPARAM( "CharWeightComplex" ) ); + aCharLocaleName = String( RTL_CONSTASCII_USTRINGPARAM( "CharLocaleComplex" ) ); + aCharPostureName = String( RTL_CONSTASCII_USTRINGPARAM( "CharPostureComplex" ) ); + break; + } + default: + { + aCharHeightName = String( RTL_CONSTASCII_USTRINGPARAM( "CharHeight" ) ); + aCharWeightName = String( RTL_CONSTASCII_USTRINGPARAM( "CharWeight" ) ); + aCharLocaleName = String( RTL_CONSTASCII_USTRINGPARAM( "CharLocale" ) ); + aCharPostureName = String( RTL_CONSTASCII_USTRINGPARAM( "CharPosture" ) ); + break; } } - else + + mnCharHeight = 24; + if ( GetPropertyValue( mAny, mXPropSet, aCharHeightName, sal_False ) ) { - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharWeightComplex" ) ), bGetPropStateValue ) ) + float fVal; + if ( mAny >>= fVal ) { - float fFloat; - mAny >>= fFloat; - if ( fFloat >= ::com::sun::star::awt::FontWeight::SEMIBOLD ) - mnCharAttr |= 1; + mnCharHeight = (sal_uInt16)( fVal + 0.5 ); + meCharHeight = GetPropertyState( mXPropSet, aCharHeightName ); } } - - if ( ePropState == ::com::sun::star::beans::PropertyState_DIRECT_VALUE ) - mnCharAttrHard |= 1; - - if ( nScriptType != com::sun::star::i18n::ScriptType::COMPLEX ) + if ( GetPropertyValue( mAny, mXPropSet, aCharWeightName, sal_False ) ) { - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharPosture" ) ), bGetPropStateValue ) ) + float fFloat; + if ( mAny >>= fFloat ) { - ::com::sun::star::awt::FontSlant aFS; - mAny >>= aFS; - switch ( aFS ) - { - case ::com::sun::star::awt::FontSlant_OBLIQUE : - case ::com::sun::star::awt::FontSlant_ITALIC : - mnCharAttr |= 2; - break; - default: - break; - } + if ( fFloat >= ::com::sun::star::awt::FontWeight::SEMIBOLD ) + mnCharAttr |= 1; + if ( GetPropertyState( mXPropSet, aCharWeightName ) == ::com::sun::star::beans::PropertyState_DIRECT_VALUE ) + mnCharAttrHard |= 1; } } - else + if ( GetPropertyValue( mAny, mXPropSet, aCharLocaleName, sal_False ) ) + { + com::sun::star::lang::Locale eLocale; + if ( mAny >>= eLocale ) + meCharLocale = eLocale; + } + if ( GetPropertyValue( mAny, mXPropSet, aCharPostureName, sal_False ) ) { - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharPostureComplex" ) ), bGetPropStateValue ) ) + ::com::sun::star::awt::FontSlant aFS; + if ( mAny >>= aFS ) { - ::com::sun::star::awt::FontSlant aFS; - mAny >>= aFS; - switch ( aFS ) + switch( aFS ) { case ::com::sun::star::awt::FontSlant_OBLIQUE : case ::com::sun::star::awt::FontSlant_ITALIC : @@ -2019,12 +2033,11 @@ void PortionObj::ImplGetPortionValues( FontCollection& rFontCollection, sal_Bool default: break; } + if ( GetPropertyState( mXPropSet, aCharPostureName ) == ::com::sun::star::beans::PropertyState_DIRECT_VALUE ) + mnCharAttrHard |= 2; } } - if ( ePropState == ::com::sun::star::beans::PropertyState_DIRECT_VALUE ) - mnCharAttrHard |= 2; - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharUnderline" ) ), bGetPropStateValue ) ) { sal_Int16 nVal; @@ -2050,13 +2063,6 @@ void PortionObj::ImplGetPortionValues( FontCollection& rFontCollection, sal_Bool if ( ePropState == ::com::sun::star::beans::PropertyState_DIRECT_VALUE ) mnCharAttrHard |= 16; - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharLocale" ) ), bGetPropStateValue ) ) - { - com::sun::star::lang::Locale eLocale; - if ( mAny >>= eLocale ) - meCharLocale = eLocale; - } - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharRelief" ) ), bGetPropStateValue ) ) { sal_Int16 nVal; @@ -2067,15 +2073,6 @@ void PortionObj::ImplGetPortionValues( FontCollection& rFontCollection, sal_Bool if ( ePropState == ::com::sun::star::beans::PropertyState_DIRECT_VALUE ) mnCharAttrHard |= 512; - mnCharHeight = 24; - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharHeight" ) ), bGetPropStateValue ) ) - { - float fVal; - mAny >>= fVal; - mnCharHeight = (sal_uInt16)( fVal + 0.5 ); - } - meCharHeight = ePropState; - if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharColor" ) ), bGetPropStateValue ) ) { sal_uInt32 nSOColor = *( (sal_uInt32*)mAny.getValue() ); -- cgit v1.2.3 From a49981341327386314c0f74f8204a4e2971797ad Mon Sep 17 00:00:00 2001 From: hdu Date: Thu, 12 Nov 2009 14:25:57 +0100 Subject: #i105238 fix spelling of monospaced bitstream and dejavu --- officecfg/registry/data/org/openoffice/VCL.xcu | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/officecfg/registry/data/org/openoffice/VCL.xcu b/officecfg/registry/data/org/openoffice/VCL.xcu index 9d145fbcc831..741a4858afec 100644 --- a/officecfg/registry/data/org/openoffice/VCL.xcu +++ b/officecfg/registry/data/org/openoffice/VCL.xcu @@ -1471,9 +1471,9 @@ Default,Serif - + - dejavumono + dejavusansmono;couriernew;liberationmono monospace Normal @@ -2200,7 +2200,7 @@ - cumberland;cumberlandamt;liberationmono;nimbusmonol;courier;lucidatypewriter;lucidasanstypewriter;monaco;monospaced;nimbusmono;nimbusmonol + cumberland;cumberlandamt;liberationmono;dejavusansmono;nimbusmonol;courier;lucidatypewriter;lucidasanstypewriter;monaco;monospaced;nimbusmono;nimbusmonol Courier @@ -2211,7 +2211,7 @@ - cumberlandamt;couriernew;liberationmono;nimbusmonol;courier;lucidatypewriter;lucidasanstypewriter;monaco;monospaced;nimbusmono;nimbusmonol + cumberlandamt;couriernew;liberationmono;dejavusansmono;nimbusmonol;courier;lucidatypewriter;lucidasanstypewriter;monaco;monospaced;nimbusmono;nimbusmonol Courier New @@ -2234,7 +2234,7 @@ - cumberland;couriernew;liberationmono;nimbusmonol;courier;lucidatypewriter;lucidasanstypewriter;monaco;monospaced;nimbusmono;nimbusmonol + cumberland;couriernew;liberationmono;dejavusansmono;nimbusmonol;courier;lucidatypewriter;lucidasanstypewriter;monaco;monospaced;nimbusmono;nimbusmonol Courier New @@ -2321,9 +2321,9 @@ Default,Serif - + - bitstreamveramono + bitstreamverasansmono;couriernew;liberationmono monospace Normal @@ -4562,7 +4562,7 @@ - cumberland;cumberlandamt;couriernew;nimbusmonol;courier;lucidatypewriter;lucidasanstypewriter;monaco;monospaced;nimbusmono;nimbusmonol + cumberland;cumberlandamt;couriernew;dejavusansmono;nimbusmonol;courier;lucidatypewriter;lucidasanstypewriter;monaco;monospaced;nimbusmono;nimbusmonol Courier New -- cgit v1.2.3 From 99bdd887a6141883878978bad9beb35e7b326cd1 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Thu, 12 Nov 2009 15:22:00 +0100 Subject: #i106830# WebDAV locking support for UCB --- ucb/source/ucp/webdav/DAVException.hxx | 36 +- ucb/source/ucp/webdav/DAVProperties.cxx | 26 +- ucb/source/ucp/webdav/DAVResourceAccess.cxx | 170 ++++- ucb/source/ucp/webdav/DAVResourceAccess.hxx | 160 ++--- ucb/source/ucp/webdav/DAVSession.hxx | 127 ++-- ucb/source/ucp/webdav/NeonLockStore.cxx | 251 +++++++ ucb/source/ucp/webdav/NeonLockStore.hxx | 105 +++ ucb/source/ucp/webdav/NeonPropFindRequest.cxx | 88 ++- ucb/source/ucp/webdav/NeonSession.cxx | 917 +++++++++++++++++--------- ucb/source/ucp/webdav/NeonSession.hxx | 462 ++++++------- ucb/source/ucp/webdav/NeonTypes.hxx | 3 + ucb/source/ucp/webdav/NeonUri.cxx | 5 - ucb/source/ucp/webdav/makefile.mk | 54 +- ucb/source/ucp/webdav/webdavcontent.cxx | 525 ++++++++++----- ucb/source/ucp/webdav/webdavcontent.hxx | 189 +++--- ucb/source/ucp/webdav/webdavcontentcaps.cxx | 301 +++------ uui/source/iahndl.cxx | 55 ++ uui/source/ids.hrc | 4 + uui/source/ids.src | 22 + 19 files changed, 2245 insertions(+), 1255 deletions(-) create mode 100644 ucb/source/ucp/webdav/NeonLockStore.cxx create mode 100644 ucb/source/ucp/webdav/NeonLockStore.hxx diff --git a/ucb/source/ucp/webdav/DAVException.hxx b/ucb/source/ucp/webdav/DAVException.hxx index 8e87ab2f2a36..cbbd64755942 100644 --- a/ucb/source/ucp/webdav/DAVException.hxx +++ b/ucb/source/ucp/webdav/DAVException.hxx @@ -108,17 +108,37 @@ class DAVException { public: enum ExceptionCode { - DAV_HTTP_ERROR = 0, // Generic error, mData = error message - DAV_HTTP_LOOKUP, // Name lookup failed, mData = server[:port] - DAV_HTTP_AUTH, // User authentication failed on server - DAV_HTTP_AUTHPROXY, // User authentication failed on proxy - DAV_HTTP_CONNECT, // Could not connect to server, mData = server[:port] + DAV_HTTP_ERROR = 0, // Generic error, + // mData = server error message, + // mStatusCode = HTTP status code + DAV_HTTP_LOOKUP, // Name lookup failed, + // mData = server[:port] + DAV_HTTP_AUTH, // User authentication failed on server, + // mData = server[:port] + DAV_HTTP_AUTHPROXY, // User authentication failed on proxy, + // mData = proxy server[:port] + DAV_HTTP_CONNECT, // Could not connect to server, + // mData = server[:port] DAV_HTTP_TIMEOUT, // Connection timed out + // mData = server[:port] DAV_HTTP_FAILED, // The precondition failed + // mData = server[:port] DAV_HTTP_RETRY, // Retry request - DAV_HTTP_REDIRECT, // See http_redirect.h, mData = new URL - DAV_SESSION_CREATE, // session creation error, mData = server[:port] - DAV_INVALID_ARG }; // mData = file URL + // mData = server[:port] + DAV_HTTP_REDIRECT, // Request was redirected, + // mData = new URL + DAV_SESSION_CREATE, // session creation error, + // mData = server[:port] + DAV_INVALID_ARG, // invalid argument + + DAV_LOCK_EXPIRED, // DAV lock expired + + DAV_NOT_LOCKED, // not locked + + DAV_LOCKED_SELF, // locked by this OOo session + + DAV_LOCKED // locked by third party + }; private: ExceptionCode mExceptionCode; diff --git a/ucb/source/ucp/webdav/DAVProperties.cxx b/ucb/source/ucp/webdav/DAVProperties.cxx index 2f11c2ee02c0..d2d434184ace 100644 --- a/ucb/source/ucp/webdav/DAVProperties.cxx +++ b/ucb/source/ucp/webdav/DAVProperties.cxx @@ -137,6 +137,26 @@ void DAVProperties::createUCBPropName( const char * nspace, rtl::OUString aName = rtl::OStringToOUString( name, RTL_TEXTENCODING_UTF8 ); + if ( !aNameSpace.getLength() ) + { + // Some servers send XML without proper namespaces. Assume "DAV:" + // in this case, if name is a well-known dav property name. + // Although this is not 100% correct, it solves many problems. + + if ( DAVProperties::RESOURCETYPE.matchIgnoreAsciiCase( aName, 4 ) || + DAVProperties::SUPPORTEDLOCK.matchIgnoreAsciiCase( aName, 4 ) || + DAVProperties::LOCKDISCOVERY.matchIgnoreAsciiCase( aName, 4 ) || + DAVProperties::CREATIONDATE.matchIgnoreAsciiCase( aName, 4 ) || + DAVProperties::DISPLAYNAME.matchIgnoreAsciiCase( aName, 4 ) || + DAVProperties::GETCONTENTLANGUAGE.matchIgnoreAsciiCase( aName, 4 ) || + DAVProperties::GETCONTENTLENGTH.matchIgnoreAsciiCase( aName, 4 ) || + DAVProperties::GETCONTENTTYPE.matchIgnoreAsciiCase( aName, 4 ) || + DAVProperties::GETETAG.matchIgnoreAsciiCase( aName, 4 ) || + DAVProperties::GETLASTMODIFIED.matchIgnoreAsciiCase( aName, 4 ) || + DAVProperties::SOURCE.matchIgnoreAsciiCase( aName, 4 ) ) + aNameSpace = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DAV:" ) ); + } + // Note: Concatenating strings BEFORE comparing against known namespaces // is important. See RFC 2815 ( 23.4.2 Meaning of Qualified Names ). rFullName = aNameSpace; @@ -175,6 +195,8 @@ void DAVProperties::createUCBPropName( const char * nspace, // static bool DAVProperties::isUCBDeadProperty( const NeonPropName & rName ) { - return ( rtl_str_compareIgnoreAsciiCase( - rName.nspace, "http://ucb.openoffice.org/dav/props/" ) == 0 ); + return ( rName.nspace && + ( rtl_str_compareIgnoreAsciiCase( + rName.nspace, "http://ucb.openoffice.org/dav/props/" ) + == 0 ) ); } diff --git a/ucb/source/ucp/webdav/DAVResourceAccess.cxx b/ucb/source/ucp/webdav/DAVResourceAccess.cxx index 67f8e5a386f0..5095950c4c0e 100644 --- a/ucb/source/ucp/webdav/DAVResourceAccess.cxx +++ b/ucb/source/ucp/webdav/DAVResourceAccess.cxx @@ -67,6 +67,7 @@ int DAVAuthListener_Impl::authenticate( { uno::Reference< task::XInteractionHandler > xIH = m_xEnv->getInteractionHandler(); + if ( xIH.is() ) { // #102871# - Supply username and password from previous try. @@ -78,14 +79,10 @@ int DAVAuthListener_Impl::authenticate( outPassWord = m_aPrevPassword; rtl::Reference< ucbhelper::SimpleAuthenticationRequest > xRequest - = new ucbhelper::SimpleAuthenticationRequest( m_aURL, - inHostName, - inRealm, - inoutUserName, - outPassWord, - ::rtl::OUString(), - bAllowPersistentStoring, - bCanUseSystemCredentials ); + = new ucbhelper::SimpleAuthenticationRequest( + m_aURL, inHostName, inRealm, inoutUserName, + outPassWord, ::rtl::OUString(), + bAllowPersistentStoring, bCanUseSystemCredentials ); xIH->handle( xRequest.get() ); rtl::Reference< ucbhelper::InteractionContinuation > xSelection @@ -105,7 +102,8 @@ int DAVAuthListener_Impl::authenticate( sal_Bool bUseSystemCredentials = sal_False; if ( bCanUseSystemCredentials ) - bUseSystemCredentials = xSupp->getUseSystemCredentials(); + bUseSystemCredentials + = xSupp->getUseSystemCredentials(); if ( bUseSystemCredentials ) { @@ -353,6 +351,7 @@ void DAVResourceAccess::HEAD( throw( DAVException ) { initialize(); + int errorCount = 0; bool bRetry; do @@ -409,7 +408,8 @@ uno::Reference< io::XInputStream > DAVResourceAccess::GET( xStream = m_xSession->GET( getRequestURI(), DAVRequestEnvironment( getRequestURI(), - new DAVAuthListener_Impl( xEnv, m_aURL ), + new DAVAuthListener_Impl( + xEnv, m_aURL ), aHeaders, xEnv ) ); } catch ( DAVException & e ) @@ -492,7 +492,8 @@ uno::Reference< io::XInputStream > DAVResourceAccess::GET( rResource, DAVRequestEnvironment( getRequestURI(), - new DAVAuthListener_Impl( xEnv, m_aURL ), + new DAVAuthListener_Impl( + xEnv, m_aURL ), aHeaders, xEnv ) ); } catch ( DAVException & e ) @@ -552,12 +553,13 @@ void DAVResourceAccess::GET( } //========================================================================= -void DAVResourceAccess::ABORT() +void DAVResourceAccess::abort() throw( DAVException ) { initialize(); - m_xSession->ABORT(); + m_xSession->abort(); } + //========================================================================= namespace { @@ -673,7 +675,8 @@ uno::Reference< io::XInputStream > DAVResourceAccess::POST( xSeekableStream, DAVRequestEnvironment( getRequestURI(), - new DAVAuthListener_Impl( xEnv, m_aURL ), + new DAVAuthListener_Impl( + xEnv, m_aURL ), aHeaders, xEnv ) ); } catch ( DAVException & e ) @@ -696,7 +699,6 @@ uno::Reference< io::XInputStream > DAVResourceAccess::POST( } //========================================================================= - void DAVResourceAccess::POST( const rtl::OUString & rContentType, const rtl::OUString & rReferer, @@ -764,6 +766,7 @@ void DAVResourceAccess::MKCOL( throw( DAVException ) { initialize(); + int errorCount = 0; bool bRetry; do @@ -803,6 +806,7 @@ void DAVResourceAccess::COPY( throw( DAVException ) { initialize(); + int errorCount = 0; bool bRetry; do @@ -844,6 +848,7 @@ void DAVResourceAccess::MOVE( throw( DAVException ) { initialize(); + int errorCount = 0; bool bRetry; do @@ -915,23 +920,124 @@ void DAVResourceAccess::DESTROY( } //========================================================================= -void DAVResourceAccess::LOCK ( - const ucb::Lock & /*rLock*/, - const uno::Reference< ucb::XCommandEnvironment > & /*xEnv*/ ) - throw( DAVException ) +// set new lock. +void DAVResourceAccess::LOCK( + ucb::Lock & inLock, + const uno::Reference< ucb::XCommandEnvironment > & xEnv ) + throw ( DAVException ) { -// initialize(); - OSL_ENSURE( sal_False, "DAVResourceAccess::LOCK - NYI" ); + initialize(); + + int errorCount = 0; + bool bRetry; + do + { + bRetry = false; + try + { + DAVRequestHeaders aHeaders; + getUserRequestHeaders( xEnv, + getRequestURI(), + rtl::OUString::createFromAscii( "LOCK" ), + aHeaders ); + + m_xSession->LOCK( getRequestURI(), + inLock, + DAVRequestEnvironment( + getRequestURI(), + new DAVAuthListener_Impl( xEnv, m_aURL ), + aHeaders, xEnv ) ); + } + catch ( DAVException & e ) + { + errorCount++; + bRetry = handleException( e, errorCount ); + if ( !bRetry ) + throw; + } + } + while ( bRetry ); } //========================================================================= -void DAVResourceAccess::UNLOCK ( - const ucb::Lock & /*rLock*/, - const uno::Reference< ucb::XCommandEnvironment > & /*xEnv*/ ) - throw( DAVException ) +// refresh existing lock. +sal_Int64 DAVResourceAccess::LOCK( + sal_Int64 nTimeout, + const uno::Reference< ucb::XCommandEnvironment > & xEnv ) + throw ( DAVException ) +{ + initialize(); + + sal_Int64 nNewTimeout = 0; + int errorCount = 0; + bool bRetry; + do + { + bRetry = false; + try + { + DAVRequestHeaders aHeaders; + getUserRequestHeaders( xEnv, + getRequestURI(), + rtl::OUString::createFromAscii( "LOCK" ), + aHeaders ); + + nNewTimeout = m_xSession->LOCK( getRequestURI(), + nTimeout, + DAVRequestEnvironment( + getRequestURI(), + new DAVAuthListener_Impl( + xEnv, m_aURL ), + aHeaders, xEnv ) ); + } + catch ( DAVException & e ) + { + errorCount++; + bRetry = handleException( e, errorCount ); + if ( !bRetry ) + throw; + } + } + while ( bRetry ); + + return nNewTimeout; +} + +//========================================================================= +void DAVResourceAccess::UNLOCK( + const uno::Reference< ucb::XCommandEnvironment > & xEnv ) + throw ( DAVException ) { -// initialize(); - OSL_ENSURE( sal_False, "DAVResourceAccess::UNLOCK - NYI" ); + initialize(); + + int errorCount = 0; + bool bRetry; + do + { + bRetry = false; + try + { + DAVRequestHeaders aHeaders; + getUserRequestHeaders( xEnv, + getRequestURI(), + rtl::OUString::createFromAscii( "UNLOCK" ), + aHeaders ); + + m_xSession->UNLOCK( getRequestURI(), + DAVRequestEnvironment( + getRequestURI(), + new DAVAuthListener_Impl( xEnv, m_aURL ), + aHeaders, xEnv ) ); + } + catch ( DAVException & e ) + { + errorCount++; + bRetry = handleException( e, errorCount ); + if ( !bRetry ) + throw; + } + } + while ( bRetry ); } //========================================================================= @@ -1028,9 +1134,8 @@ void DAVResourceAccess::getUserRequestHeaders( "Value is not a string! Ignoring..." ); } - rRequestHeaders.push_back( DAVRequestHeader( - aRequestHeaders[ n ].Name, - aValue ) ); + rRequestHeaders.push_back( + DAVRequestHeader( aRequestHeaders[ n ].Name, aValue ) ); } } } @@ -1074,7 +1179,6 @@ void DAVResourceAccess::resetUri() } } - //========================================================================= sal_Bool DAVResourceAccess::handleException( DAVException & e, int errorCount ) throw ( DAVException ) @@ -1094,7 +1198,9 @@ sal_Bool DAVResourceAccess::handleException( DAVException & e, int errorCount ) // if we have a bad connection try again. Up to three times. case DAVException::DAV_HTTP_ERROR: // retry up to three times, if not a client-side error. - if ( ( e.getStatus() < 400 || e.getStatus() > 499 ) && errorCount < 3) + if ( e.getStatus() > 0 && + ( e.getStatus() < 400 || e.getStatus() > 499 ) && + errorCount < 3 ) { return sal_True; } diff --git a/ucb/source/ucp/webdav/DAVResourceAccess.hxx b/ucb/source/ucp/webdav/DAVResourceAccess.hxx index 2ab863dc0b24..6d8ea4fad43e 100644 --- a/ucb/source/ucp/webdav/DAVResourceAccess.hxx +++ b/ucb/source/ucp/webdav/DAVResourceAccess.hxx @@ -59,22 +59,22 @@ class DAVResourceAccess rtl::Reference< DAVSession > m_xSession; rtl::Reference< DAVSessionFactory > m_xSessionFactory; com::sun::star::uno::Reference< - com::sun::star::lang::XMultiServiceFactory > m_xSMgr; + com::sun::star::lang::XMultiServiceFactory > m_xSMgr; std::vector< NeonUri > m_aRedirectURIs; public: DAVResourceAccess() : m_xSessionFactory( 0 ) {} DAVResourceAccess( const com::sun::star::uno::Reference< - com::sun::star::lang::XMultiServiceFactory > & rSMgr, + com::sun::star::lang::XMultiServiceFactory > & rSMgr, rtl::Reference< - DAVSessionFactory > const & rSessionFactory, + DAVSessionFactory > const & rSessionFactory, const rtl::OUString & rURL ); DAVResourceAccess( const DAVResourceAccess & rOther ); DAVResourceAccess & operator=( const DAVResourceAccess & rOther ); void setURL( const rtl::OUString & rNewURL ) - throw( DAVException ); + throw ( DAVException ); void resetUri(); @@ -88,144 +88,152 @@ public: void OPTIONS( DAVCapabilities & rCapabilities, - const com::sun::star::uno::Reference< - com::sun::star::ucb::XCommandEnvironment > & xEnv ) - throw( DAVException ); + const com::sun::star::uno::Reference< + com::sun::star::ucb::XCommandEnvironment > & xEnv ) + throw ( DAVException ); // allprop & named void PROPFIND( const Depth nDepth, - const std::vector< rtl::OUString > & rPropertyNames, - std::vector< DAVResource > & rResources, - const com::sun::star::uno::Reference< - com::sun::star::ucb::XCommandEnvironment > & xEnv ) - throw( DAVException ); + const std::vector< rtl::OUString > & rPropertyNames, + std::vector< DAVResource > & rResources, + const com::sun::star::uno::Reference< + com::sun::star::ucb::XCommandEnvironment > & xEnv ) + throw ( DAVException ); // propnames void PROPFIND( const Depth nDepth, - std::vector< DAVResourceInfo > & rResInfo, - const com::sun::star::uno::Reference< - com::sun::star::ucb::XCommandEnvironment > & xEnv ) - throw( DAVException ); + std::vector< DAVResourceInfo > & rResInfo, + const com::sun::star::uno::Reference< + com::sun::star::ucb::XCommandEnvironment > & xEnv ) + throw ( DAVException ); void PROPPATCH( const std::vector< ProppatchValue > & rValues, - const com::sun::star::uno::Reference< - com::sun::star::ucb::XCommandEnvironment >& xEnv ) - throw( DAVException ); + const com::sun::star::uno::Reference< + com::sun::star::ucb::XCommandEnvironment >& xEnv ) + throw ( DAVException ); void HEAD( const std::vector< rtl::OUString > & rHeaderNames, // empty == 'all' DAVResource & rResource, const com::sun::star::uno::Reference< - com::sun::star::ucb::XCommandEnvironment >& xEnv ) - throw( DAVException ); + com::sun::star::ucb::XCommandEnvironment >& xEnv ) + throw ( DAVException ); com::sun::star::uno::Reference< com::sun::star::io::XInputStream > GET( const com::sun::star::uno::Reference< - com::sun::star::ucb::XCommandEnvironment > & xEnv ) - throw( DAVException ); + com::sun::star::ucb::XCommandEnvironment > & xEnv ) + throw ( DAVException ); void GET( com::sun::star::uno::Reference< - com::sun::star::io::XOutputStream > & rStream, + com::sun::star::io::XOutputStream > & rStream, const com::sun::star::uno::Reference< - com::sun::star::ucb::XCommandEnvironment > & xEnv ) - throw( DAVException ); + com::sun::star::ucb::XCommandEnvironment > & xEnv ) + throw ( DAVException ); com::sun::star::uno::Reference< com::sun::star::io::XInputStream > GET( const std::vector< rtl::OUString > & rHeaderNames, // empty == 'all' DAVResource & rResource, const com::sun::star::uno::Reference< - com::sun::star::ucb::XCommandEnvironment > & xEnv ) - throw( DAVException ); + com::sun::star::ucb::XCommandEnvironment > & xEnv ) + throw ( DAVException ); void GET( com::sun::star::uno::Reference< - com::sun::star::io::XOutputStream > & rStream, + com::sun::star::io::XOutputStream > & rStream, const std::vector< rtl::OUString > & rHeaderNames, // empty == 'all' DAVResource & rResource, const com::sun::star::uno::Reference< - com::sun::star::ucb::XCommandEnvironment > & xEnv ) - throw( DAVException ); + com::sun::star::ucb::XCommandEnvironment > & xEnv ) + throw ( DAVException ); void PUT( const com::sun::star::uno::Reference< - com::sun::star::io::XInputStream > & rStream, - const com::sun::star::uno::Reference< - com::sun::star::ucb::XCommandEnvironment > & xEnv ) - throw( DAVException ); + com::sun::star::io::XInputStream > & rStream, + const com::sun::star::uno::Reference< + com::sun::star::ucb::XCommandEnvironment > & xEnv ) + throw ( DAVException ); com::sun::star::uno::Reference< com::sun::star::io::XInputStream > POST( const rtl::OUString & rContentType, - const rtl::OUString & rReferer, - const com::sun::star::uno::Reference< - com::sun::star::io::XInputStream > & rInputStream, - const com::sun::star::uno::Reference< + const rtl::OUString & rReferer, + const com::sun::star::uno::Reference< + com::sun::star::io::XInputStream > & rInputStream, + const com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment >& xEnv ) throw ( DAVException ); void POST( const rtl::OUString & rContentType, - const rtl::OUString & rReferer, - const com::sun::star::uno::Reference< - com::sun::star::io::XInputStream > & rInputStream, - com::sun::star::uno::Reference< - com::sun::star::io::XOutputStream > & rOutputStream, - const com::sun::star::uno::Reference< - com::sun::star::ucb::XCommandEnvironment >& xEnv ) + const rtl::OUString & rReferer, + const com::sun::star::uno::Reference< + com::sun::star::io::XInputStream > & rInputStream, + com::sun::star::uno::Reference< + com::sun::star::io::XOutputStream > & rOutputStream, + const com::sun::star::uno::Reference< + com::sun::star::ucb::XCommandEnvironment >& xEnv ) throw ( DAVException ); void MKCOL( const com::sun::star::uno::Reference< - com::sun::star::ucb::XCommandEnvironment > & xEnv ) - throw( DAVException ); + com::sun::star::ucb::XCommandEnvironment > & xEnv ) + throw ( DAVException ); void COPY( const ::rtl::OUString & rSourcePath, - const ::rtl::OUString & rDestinationURI, - sal_Bool bOverwrite, - const com::sun::star::uno::Reference< - com::sun::star::ucb::XCommandEnvironment > & xEnv ) - throw( DAVException ); + const ::rtl::OUString & rDestinationURI, + sal_Bool bOverwrite, + const com::sun::star::uno::Reference< + com::sun::star::ucb::XCommandEnvironment > & xEnv ) + throw ( DAVException ); void MOVE( const ::rtl::OUString & rSourcePath, - const ::rtl::OUString & rDestinationURI, - sal_Bool bOverwrite, - const com::sun::star::uno::Reference< - com::sun::star::ucb::XCommandEnvironment > & xEnv ) - throw( DAVException ); + const ::rtl::OUString & rDestinationURI, + sal_Bool bOverwrite, + const com::sun::star::uno::Reference< + com::sun::star::ucb::XCommandEnvironment > & xEnv ) + throw ( DAVException ); void DESTROY( const com::sun::star::uno::Reference< - com::sun::star::ucb::XCommandEnvironment > & xEnv ) - throw( DAVException ); + com::sun::star::ucb::XCommandEnvironment > & xEnv ) + throw ( DAVException ); + // set new lock. void - LOCK( const com::sun::star::ucb::Lock & rLock, - const com::sun::star::uno::Reference< - com::sun::star::ucb::XCommandEnvironment > & xEnv ) - throw( DAVException ); + LOCK( com::sun::star::ucb::Lock & inLock, + const com::sun::star::uno::Reference< + com::sun::star::ucb::XCommandEnvironment > & xEnv ) + throw( DAVException ); + + // refresh existing lock. + sal_Int64 + LOCK( sal_Int64 nTimeout, + const com::sun::star::uno::Reference< + com::sun::star::ucb::XCommandEnvironment > & xEnv ) + throw ( DAVException ); void - UNLOCK( const com::sun::star::ucb::Lock & rLock, - const com::sun::star::uno::Reference< - com::sun::star::ucb::XCommandEnvironment > & xEnv ) - throw( DAVException ); + UNLOCK( const com::sun::star::uno::Reference< + com::sun::star::ucb::XCommandEnvironment > & xEnv ) + throw ( DAVException ); void - ABORT() - throw( DAVException ); + abort() + throw ( DAVException ); // helper - static void getUserRequestHeaders( - const com::sun::star::uno::Reference< - com::sun::star::ucb::XCommandEnvironment > & xEnv, - const rtl::OUString & rURI, - const rtl::OUString & rMethod, - DAVRequestHeaders & rRequestHeaders ); + static void + getUserRequestHeaders( + const com::sun::star::uno::Reference< + com::sun::star::ucb::XCommandEnvironment > & xEnv, + const rtl::OUString & rURI, + const rtl::OUString & rMethod, + DAVRequestHeaders & rRequestHeaders ); private: const rtl::OUString & getRequestURI() const; diff --git a/ucb/source/ucp/webdav/DAVSession.hxx b/ucb/source/ucp/webdav/DAVSession.hxx index b6de1c5b10ad..040046e13534 100644 --- a/ucb/source/ucp/webdav/DAVSession.hxx +++ b/ucb/source/ucp/webdav/DAVSession.hxx @@ -42,7 +42,9 @@ #include "DAVTypes.hxx" #include "DAVRequestEnvironment.hxx" - +namespace com { namespace sun { namespace star { namespace ucb { + class Lock; +} } } } namespace webdav_ucp { @@ -73,28 +75,28 @@ public: // DAV methods // - virtual void OPTIONS( const ::rtl::OUString & inPath, + virtual void OPTIONS( const ::rtl::OUString & inPath, DAVCapabilities & outCapabilities, const DAVRequestEnvironment & rEnv ) throw( DAVException ) = 0; // allprop & named - virtual void PROPFIND( const ::rtl::OUString & inPath, - const Depth inDepth, + virtual void PROPFIND( const ::rtl::OUString & inPath, + const Depth inDepth, const std::vector< ::rtl::OUString > & inPropertyNames, - std::vector< DAVResource > & ioResources, + std::vector< DAVResource > & ioResources, const DAVRequestEnvironment & rEnv ) throw( DAVException ) = 0; // propnames - virtual void PROPFIND( const ::rtl::OUString & inPath, - const Depth inDepth, + virtual void PROPFIND( const ::rtl::OUString & inPath, + const Depth inDepth, std::vector< DAVResourceInfo > & ioResInfo, const DAVRequestEnvironment & rEnv ) throw( DAVException ) = 0; - virtual void PROPPATCH( const ::rtl::OUString & inPath, - const std::vector< ProppatchValue > & inValues, + virtual void PROPPATCH( const ::rtl::OUString & inPath, + const std::vector< ProppatchValue > & inValues, const DAVRequestEnvironment & rEnv ) throw( DAVException ) = 0; @@ -105,87 +107,95 @@ public: throw( DAVException ) = 0; virtual com::sun::star::uno::Reference< com::sun::star::io::XInputStream > - GET( const ::rtl::OUString & inPath, - const DAVRequestEnvironment & rEnv ) + GET( const ::rtl::OUString & inPath, + const DAVRequestEnvironment & rEnv ) throw( DAVException ) = 0; - virtual void GET( const ::rtl::OUString & inPath, - com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& o, - const DAVRequestEnvironment & rEnv ) + virtual void GET( const ::rtl::OUString & inPath, + com::sun::star::uno::Reference< + com::sun::star::io::XOutputStream >& o, + const DAVRequestEnvironment & rEnv ) throw( DAVException ) = 0; virtual com::sun::star::uno::Reference< com::sun::star::io::XInputStream > - GET( const ::rtl::OUString & inPath, - const std::vector< ::rtl::OUString > & inHeaderNames, - DAVResource & ioResource, - const DAVRequestEnvironment & rEnv ) + GET( const ::rtl::OUString & inPath, + const std::vector< ::rtl::OUString > & inHeaderNames, + DAVResource & ioResource, + const DAVRequestEnvironment & rEnv ) throw( DAVException ) = 0; - virtual void GET( const ::rtl::OUString & inPath, - com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& o, - const std::vector< ::rtl::OUString > & inHeaderNames, - DAVResource & ioResource, - const DAVRequestEnvironment & rEnv ) + virtual void + GET( const ::rtl::OUString & inPath, + com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& o, + const std::vector< ::rtl::OUString > & inHeaderNames, + DAVResource & ioResource, + const DAVRequestEnvironment & rEnv ) throw( DAVException ) = 0; - virtual void PUT( const ::rtl::OUString & inPath, - const com::sun::star::uno::Reference< - com::sun::star::io::XInputStream >& s, - const DAVRequestEnvironment & rEnv ) - throw( DAVException ) = 0; - - virtual void ABORT() + virtual void PUT( const ::rtl::OUString & inPath, + const com::sun::star::uno::Reference< + com::sun::star::io::XInputStream >& s, + const DAVRequestEnvironment & rEnv ) throw( DAVException ) = 0; virtual com::sun::star::uno::Reference< com::sun::star::io::XInputStream > - POST( const rtl::OUString & inPath, - const rtl::OUString & rContentType, - const rtl::OUString & rReferer, - const com::sun::star::uno::Reference< - com::sun::star::io::XInputStream > & inInputStream, - const DAVRequestEnvironment & rEnv ) + POST( const rtl::OUString & inPath, + const rtl::OUString & rContentType, + const rtl::OUString & rReferer, + const com::sun::star::uno::Reference< + com::sun::star::io::XInputStream > & inInputStream, + const DAVRequestEnvironment & rEnv ) throw ( DAVException ) = 0; virtual void POST( const rtl::OUString & inPath, const rtl::OUString & rContentType, const rtl::OUString & rReferer, const com::sun::star::uno::Reference< - com::sun::star::io::XInputStream > & inInputStream, + com::sun::star::io::XInputStream > & inInputStream, com::sun::star::uno::Reference< - com::sun::star::io::XOutputStream > & oOutputStream, + com::sun::star::io::XOutputStream > & oOutputStream, const DAVRequestEnvironment & rEnv ) throw ( DAVException ) = 0; - virtual void MKCOL( const ::rtl::OUString & inPath, - const DAVRequestEnvironment & rEnv ) + virtual void MKCOL( const ::rtl::OUString & inPath, + const DAVRequestEnvironment & rEnv ) throw( DAVException ) = 0; - virtual void COPY( const ::rtl::OUString & inSource, - const ::rtl::OUString & inDestination, - const DAVRequestEnvironment & rEnv, - sal_Bool inOverwrite = false ) + virtual void COPY( const ::rtl::OUString & inSource, + const ::rtl::OUString & inDestination, + const DAVRequestEnvironment & rEnv, + sal_Bool inOverwrite = false ) throw( DAVException ) = 0; - virtual void MOVE( const ::rtl::OUString & inSource, - const ::rtl::OUString & inDestination, - const DAVRequestEnvironment & rEnv, - sal_Bool inOverwrite = false ) + virtual void MOVE( const ::rtl::OUString & inSource, + const ::rtl::OUString & inDestination, + const DAVRequestEnvironment & rEnv, + sal_Bool inOverwrite = false ) throw( DAVException ) = 0; - virtual void DESTROY( const ::rtl::OUString & inPath, - const DAVRequestEnvironment & rEnv ) + virtual void DESTROY( const ::rtl::OUString & inPath, + const DAVRequestEnvironment & rEnv ) throw( DAVException ) = 0; - // Note: Uncomment the following if locking support is required - /* - virtual void LOCK ( const Lock & inLock, - const DAVRequestEnvironment & rEnv ) - throw( DAVException ) = 0; + // set new lock. + virtual void LOCK( const ::rtl::OUString & inPath, + com::sun::star::ucb::Lock & inLock, + const DAVRequestEnvironment & rEnv ) + throw ( DAVException ) = 0; - virtual void UNLOCK ( const Lock & inLock, - const DAVRequestEnvironment & rEnv ) + // refresh existing lock. + virtual sal_Int64 LOCK( const ::rtl::OUString & inPath, + sal_Int64 nTimeout, + const DAVRequestEnvironment & rEnv ) + throw ( DAVException ) = 0; + + virtual void UNLOCK( const ::rtl::OUString & inPath, + const DAVRequestEnvironment & rEnv ) + throw ( DAVException ) = 0; + + virtual void abort() throw( DAVException ) = 0; - */ + protected: rtl::Reference< DAVSessionFactory > m_xFactory; @@ -210,4 +220,3 @@ private: } // namespace webdav_ucp #endif // _DAVSESSION_HXX_ - diff --git a/ucb/source/ucp/webdav/NeonLockStore.cxx b/ucb/source/ucp/webdav/NeonLockStore.cxx new file mode 100644 index 000000000000..b6246e8c3485 --- /dev/null +++ b/ucb/source/ucp/webdav/NeonLockStore.cxx @@ -0,0 +1,251 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: $ + * $Revision: $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_ucb.hxx" + +#include +#include +#include "rtl/ustring.hxx" +#include "osl/time.h" +#include "osl/thread.hxx" +#include "NeonSession.hxx" +#include "NeonLockStore.hxx" + +using namespace webdav_ucp; + +namespace webdav_ucp { + +class TickerThread : public osl::Thread +{ + bool m_bFinish; + NeonLockStore & m_rLockStore; + +public: + + TickerThread( NeonLockStore & rLockStore ) + : osl::Thread(), m_bFinish( false ), m_rLockStore( rLockStore ) {} + + void finish() { m_bFinish = true; } + +protected: + + virtual void SAL_CALL run(); +}; + +} // namespace webdav_ucp + +// ------------------------------------------------------------------- +void TickerThread::run() +{ + OSL_TRACE( "TickerThread: start." ); + + // we have to go through the loop more often to be able to finish ~quickly + const int nNth = 25; + + int nCount = nNth; + while ( !m_bFinish ) + { + if ( nCount-- <= 0 ) + { + m_rLockStore.refreshLocks(); + nCount = nNth; + } + + TimeValue aTV; + aTV.Seconds = 0; + aTV.Nanosec = 1000000000 / nNth; + wait( aTV ); + } + + OSL_TRACE( "TickerThread: stop." ); +} + +// ------------------------------------------------------------------- +NeonLockStore::NeonLockStore() + : m_pNeonLockStore( ne_lockstore_create() ), + m_pTickerThread( 0 ) +{ + OSL_TRACE( "LockStore ctor." ); + OSL_ENSURE( m_pNeonLockStore, "Unable to create neon lock store!" ); +} + +// ------------------------------------------------------------------- +NeonLockStore::~NeonLockStore() +{ + OSL_TRACE( "LockStore dtor." ); + + stopTicker(); + + // release active locks, if any (just for safety). + OSL_ENSURE( m_aLockInfoMap.size() == 0, + "NeonLockStore::~NeonLockStore - Releasing active locks!" ); + LockInfoMap::const_iterator it( m_aLockInfoMap.begin() ); + const LockInfoMap::const_iterator end( m_aLockInfoMap.end() ); + while ( it != end ) + { + NeonLock * pLock = (*it).first; + (*it).second.xSession->UNLOCK( pLock ); + + ne_lockstore_remove( m_pNeonLockStore, pLock ); + ne_lock_destroy( pLock ); + + ++it; + } + + ne_lockstore_destroy( m_pNeonLockStore ); +} + +// ------------------------------------------------------------------- +void NeonLockStore::startTicker() +{ + osl::MutexGuard aGuard( m_aMutex ); + + if ( !m_pTickerThread ) + { + m_pTickerThread = new TickerThread( *this ); + m_pTickerThread->create(); + } +} + +// ------------------------------------------------------------------- +void NeonLockStore::stopTicker() +{ + osl::MutexGuard aGuard( m_aMutex ); + + if ( m_pTickerThread ) + { + m_pTickerThread->finish(); + m_pTickerThread->join(); + delete m_pTickerThread; + m_pTickerThread = 0; + } +} + +// ------------------------------------------------------------------- +void NeonLockStore::registerSession( HttpSession * pHttpSession ) +{ + osl::MutexGuard aGuard( m_aMutex ); + + ne_lockstore_register( m_pNeonLockStore, pHttpSession ); +} + +// ------------------------------------------------------------------- +NeonLock * NeonLockStore::findByUri( rtl::OUString const & rUri ) +{ + osl::MutexGuard aGuard( m_aMutex ); + + ne_uri aUri; + ne_uri_parse( rtl::OUStringToOString( + rUri, RTL_TEXTENCODING_UTF8 ).getStr(), &aUri ); + return ne_lockstore_findbyuri( m_pNeonLockStore, &aUri ); +} + +// ------------------------------------------------------------------- +void NeonLockStore::addLock( NeonLock * pLock, + rtl::Reference< NeonSession > const & xSession, + sal_Int32 nLastChanceToSendRefreshRequest ) +{ + osl::MutexGuard aGuard( m_aMutex ); + + ne_lockstore_add( m_pNeonLockStore, pLock ); + m_aLockInfoMap[ pLock ] + = LockInfo( xSession, nLastChanceToSendRefreshRequest ); + + startTicker(); +} + +// ------------------------------------------------------------------- +void NeonLockStore::updateLock( NeonLock * pLock, + sal_Int32 nLastChanceToSendRefreshRequest ) +{ + osl::MutexGuard aGuard( m_aMutex ); + + LockInfoMap::iterator it( m_aLockInfoMap.find( pLock ) ); + OSL_ENSURE( it != m_aLockInfoMap.end(), + "NeonLockStore::updateLock: lock not found!" ); + + if ( it != m_aLockInfoMap.end() ) + { + (*it).second.nLastChanceToSendRefreshRequest + = nLastChanceToSendRefreshRequest; + } +} + +// ------------------------------------------------------------------- +void NeonLockStore::removeLock( NeonLock * pLock ) +{ + osl::MutexGuard aGuard( m_aMutex ); + + m_aLockInfoMap.erase( pLock ); + ne_lockstore_remove( m_pNeonLockStore, pLock ); + + if ( m_aLockInfoMap.size() == 0 ) + stopTicker(); +} + +// ------------------------------------------------------------------- +void NeonLockStore::refreshLocks() +{ + osl::MutexGuard aGuard( m_aMutex ); + //OSL_TRACE( "NeonLockStore::refreshLocks" ); + + LockInfoMap::iterator it( m_aLockInfoMap.begin() ); + const LockInfoMap::const_iterator end( m_aLockInfoMap.end() ); + while ( it != end ) + { + LockInfo & rInfo = (*it).second; + if ( rInfo.nLastChanceToSendRefreshRequest != -1 ) + { + // 30 seconds or less remaining until lock expires? + TimeValue t1; + osl_getSystemTime( &t1 ); + if ( rInfo.nLastChanceToSendRefreshRequest - 30 + <= sal_Int32( t1.Seconds ) ) + { + // refresh the lock. + sal_Int32 nlastChanceToSendRefreshRequest = -1; + if ( rInfo.xSession->LOCK( + (*it).first, + /* out param */ nlastChanceToSendRefreshRequest ) ) + { + rInfo.nLastChanceToSendRefreshRequest + = nlastChanceToSendRefreshRequest; + } + else + { + // refresh failed. stop auto-refresh. + rInfo.nLastChanceToSendRefreshRequest = -1; + } + } + } + ++it; + } +} diff --git a/ucb/source/ucp/webdav/NeonLockStore.hxx b/ucb/source/ucp/webdav/NeonLockStore.hxx new file mode 100644 index 000000000000..b00361d55eff --- /dev/null +++ b/ucb/source/ucp/webdav/NeonLockStore.hxx @@ -0,0 +1,105 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: $ + * $Revision: $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef INCLUDED_NEONLOCKSTORE_HXX +#define INCLUDED_NEONLOCKSTORE_HXX + +#include +#include "ne_locks.h" +#include "osl/mutex.hxx" +#include "rtl/ref.hxx" +#include "NeonTypes.hxx" + +namespace webdav_ucp +{ + +class TickerThread; +class NeonSession; + +struct ltptr +{ + bool operator()( const NeonLock * p1, const NeonLock * p2 ) const + { + return p1 < p2; + } +}; + +typedef struct _LockInfo +{ + rtl::Reference< NeonSession > xSession; + sal_Int32 nLastChanceToSendRefreshRequest; + + _LockInfo() + : nLastChanceToSendRefreshRequest( -1 ) {} + + _LockInfo( rtl::Reference< NeonSession > const & _xSession, + sal_Int32 _nLastChanceToSendRefreshRequest ) + : xSession( _xSession ), + nLastChanceToSendRefreshRequest( _nLastChanceToSendRefreshRequest ) {} + +} LockInfo; + +typedef std::map< NeonLock *, LockInfo, ltptr > LockInfoMap; + +class NeonLockStore +{ + osl::Mutex m_aMutex; + ne_lock_store * m_pNeonLockStore; + TickerThread * m_pTickerThread; + LockInfoMap m_aLockInfoMap; + +public: + NeonLockStore(); + ~NeonLockStore(); + + void registerSession( HttpSession * pHttpSession ); + + NeonLock * findByUri( rtl::OUString const & rUri ); + + void addLock( NeonLock * pLock, + rtl::Reference< NeonSession > const & xSession, + // time in seconds since Jan 1 1970 + // -1: infinite lock, no refresh + sal_Int32 nLastChanceToSendRefreshRequest ); + + void updateLock( NeonLock * pLock, + sal_Int32 nLastChanceToSendRefreshRequest ); + + void removeLock( NeonLock * pLock ); + + void refreshLocks(); + +private: + void startTicker(); + void stopTicker(); +}; + +} // namespace webdav_ucp + +#endif // INCLUDED_NEONLOCKSTORE_HXX diff --git a/ucb/source/ucp/webdav/NeonPropFindRequest.cxx b/ucb/source/ucp/webdav/NeonPropFindRequest.cxx index 6171d3fa0bfc..c69ab1d59a3a 100644 --- a/ucb/source/ucp/webdav/NeonPropFindRequest.cxx +++ b/ucb/source/ucp/webdav/NeonPropFindRequest.cxx @@ -30,14 +30,14 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_ucb.hxx" -#include + +#include "osl/diagnose.h" +#include "rtl/strbuf.hxx" #include "NeonTypes.hxx" #include "DAVException.hxx" #include "DAVProperties.hxx" #include "NeonPropFindRequest.hxx" -#ifndef _LINKSEQUENCE_HXX_ #include "LinkSequence.hxx" -#endif #include "LockSequence.hxx" #include "LockEntrySequence.hxx" #include "UCBDeadPropertyValue.hxx" @@ -48,6 +48,40 @@ using namespace com::sun::star::ucb; using namespace std; using namespace webdav_ucp; +// ------------------------------------------------------------------- +namespace +{ + // strip "DAV:" namespace from XML snippets to avoid + // parser error (undeclared namespace) later on. + rtl::OString stripDavNamespace( const rtl::OString & in ) + { + const rtl::OString inXML( in.toAsciiLowerCase() ); + + rtl::OStringBuffer buf; + sal_Int32 start = 0; + sal_Int32 end = inXML.indexOf( "dav:" ); + while ( end != -1 ) + { + if ( inXML[ end - 1 ] == '<' || + inXML[ end - 1 ] == '/' ) + { + // copy from original buffer - preserve case. + buf.append( in.copy( start, end - start ) ); + } + else + { + // copy from original buffer - preserve case. + buf.append( in.copy( start, end - start + 4 ) ); + } + start = end + 4; + end = inXML.indexOf( "dav:", start ); + } + buf.append( inXML.copy( start ) ); + + return rtl::OString( buf.makeStringAndClear() ); + } +} + // ------------------------------------------------------------------- extern "C" int NPFR_propfind_iter( void* userdata, const NeonPropName* pname, @@ -57,9 +91,9 @@ extern "C" int NPFR_propfind_iter( void* userdata, /* HTTP Response Status Classes: - - 1: Informational - Request received, continuing process + - 1: Informational - Request received, continuing process - - 2: Success - The action was successfully received, + - 2: Success - The action was successfully received, understood, and accepted - 3: Redirection - Further action must be taken in order to @@ -79,18 +113,22 @@ extern "C" int NPFR_propfind_iter( void* userdata, DAVPropertyValue thePropertyValue; thePropertyValue.IsCaseSensitive = true; + OSL_ENSURE( pname->nspace, "NPFR_propfind_iter - No namespace!" ); + DAVProperties::createUCBPropName( pname->nspace, - pname->name, - thePropertyValue.Name ); + pname->name, + thePropertyValue.Name ); bool bHasValue = false; if ( DAVProperties::isUCBDeadProperty( *pname ) ) { // DAV dead property added by WebDAV UCP? if ( UCBDeadPropertyValue::createFromXML( - value, thePropertyValue.Value ) ) + value, thePropertyValue.Value ) ) + { OSL_ENSURE( thePropertyValue.Value.hasValue(), - "NeonPropFindRequest::propfind_iter - No value!" ); + "NPFR_propfind_iter - No value!" ); bHasValue = true; + } } if ( !bHasValue ) @@ -103,12 +141,11 @@ extern "C" int NPFR_propfind_iter( void* userdata, if ( aValue.getLength() ) { aValue = aValue.toAsciiLowerCase(); - if ( - ( aValue.compareTo( - RTL_CONSTASCII_STRINGPARAM( "name, "supportedlock" ) == 0 ) { Sequence< LockEntry > aEntries; - LockEntrySequence::createFromXML( value, aEntries ); + LockEntrySequence::createFromXML( + stripDavNamespace( value ), aEntries ); thePropertyValue.Value <<= aEntries; } else if ( rtl_str_compareIgnoreAsciiCase( pname->name, "lockdiscovery" ) == 0 ) { Sequence< Lock > aLocks; - LockSequence::createFromXML( value, aLocks ); + LockSequence::createFromXML( + stripDavNamespace( value ), aLocks ); thePropertyValue.Value <<= aLocks; } else if ( rtl_str_compareIgnoreAsciiCase( pname->name, "source" ) == 0 ) { Sequence< Link > aLinks; - LinkSequence::createFromXML( value, aLinks ); + LinkSequence::createFromXML( + stripDavNamespace( value ), aLinks ); thePropertyValue.Value <<= aLinks; } else @@ -168,10 +208,10 @@ extern "C" void NPFR_propfind_results( void* userdata, #if NEON_VERSION >= 0x0260 DAVResource theResource( - OStringToOUString( uri->path, RTL_TEXTENCODING_UTF8 ) ); + OStringToOUString( uri->path, RTL_TEXTENCODING_UTF8 ) ); #else DAVResource theResource( - OStringToOUString( href, RTL_TEXTENCODING_UTF8 ) ); + OStringToOUString( href, RTL_TEXTENCODING_UTF8 ) ); #endif ne_propset_iterate( set, NPFR_propfind_iter, &theResource ); @@ -210,10 +250,10 @@ extern "C" void NPFR_propnames_results( void* userdata, // Create entry for the resource. #if NEON_VERSION >= 0x0260 DAVResourceInfo theResource( - OStringToOUString( uri->path, RTL_TEXTENCODING_UTF8 ) ); + OStringToOUString( uri->path, RTL_TEXTENCODING_UTF8 ) ); #else DAVResourceInfo theResource( - OStringToOUString( href, RTL_TEXTENCODING_UTF8 ) ); + OStringToOUString( href, RTL_TEXTENCODING_UTF8 ) ); #endif // Fill entry. @@ -247,7 +287,7 @@ NeonPropFindRequest::NeonPropFindRequest( HttpSession* inSession, { // Split fullname into namespace and name! DAVProperties::createNeonPropName( - inPropNames[ theIndex ], thePropNames[ theIndex ] ); + inPropNames[ theIndex ], thePropNames[ theIndex ] ); } thePropNames[ theIndex ].nspace = NULL; thePropNames[ theIndex ].name = NULL; @@ -288,7 +328,7 @@ NeonPropFindRequest::NeonPropFindRequest( HttpSession* inSession, NeonPropFindRequest::NeonPropFindRequest( HttpSession* inSession, const char* inPath, - const Depth inDepth, + const Depth inDepth, std::vector< DAVResourceInfo > & ioResInfo, int & nError ) { diff --git a/ucb/source/ucp/webdav/NeonSession.cxx b/ucb/source/ucp/webdav/NeonSession.cxx index b455ffebbb9b..c6cb5288099b 100644 --- a/ucb/source/ucp/webdav/NeonSession.cxx +++ b/ucb/source/ucp/webdav/NeonSession.cxx @@ -1,5 +1,4 @@ /************************************************************************* - * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright 2008 by Sun Microsystems, Inc. @@ -34,11 +33,12 @@ #include #include #include +#include "osl/diagnose.h" +#include "osl/time.h" #include #include #include #include -#include #include #include "libxml/parser.h" #include "rtl/ustrbuf.hxx" @@ -62,6 +62,7 @@ #include #include #include +#include #include using namespace com::sun::star; @@ -118,10 +119,6 @@ typedef std::hash_map > RequestDataMap; -// ------------------------------------------------------------------- -// static members! -bool NeonSession::m_bGlobalsInited = false; -osl::Mutex NeonSession::m_aGlobalMutex; // ------------------------------------------------------------------- // Helper fuction // ------------------------------------------------------------------- @@ -197,14 +194,14 @@ extern "C" void NeonSession_ResponseBlockReader(void * inUserData, const char * inBuf, size_t inLen ) { - // neon calls this function with (inLen == 0)... + // neon sometimes calls this function with (inLen == 0)... if ( inLen > 0 ) { NeonRequestContext * pCtx = static_cast< NeonRequestContext * >( inUserData ); rtl::Reference< NeonInputStream > xInputStream( - pCtx->xInputStream); + pCtx->xInputStream ); if ( xInputStream.is() ) xInputStream->AddToStream( inBuf, inLen ); @@ -327,10 +324,11 @@ extern "C" int NeonSession_NeonAuth( void * inUserData, bool bCanUseSystemCreds = false; #ifdef NE_FEATURE_SSPI - bCanUseSystemCreds = (attempt == 0) && // avoid endless loops - ne_has_support( NE_FEATURE_SSPI ) && // Windows-only feature. - ( ne_strcasecmp( inAuthProtocol, "NTLM" ) == 0 ) || - ( ne_strcasecmp( inAuthProtocol, "Negotiate" ) == 0 ); + bCanUseSystemCreds + = (attempt == 0) && // avoid endless loops + ne_has_support( NE_FEATURE_SSPI ) && // Windows-only feature. + ( ( ne_strcasecmp( inAuthProtocol, "NTLM" ) == 0 ) || + ( ne_strcasecmp( inAuthProtocol, "Negotiate" ) == 0 ) ); #endif // #i97003# (tkr): Ask XMasterPasswordHandling if we should store the @@ -342,7 +340,7 @@ extern "C" int NeonSession_NeonAuth( void * inUserData, uno::Reference< task::XMasterPasswordHandling >( theSession->getMSF()->createInstance( rtl::OUString::createFromAscii( - "com.sun.star.task.PasswordContainer" )), + "com.sun.star.task.PasswordContainer" ) ), uno::UNO_QUERY ); } catch ( uno::Exception const & ) @@ -406,7 +404,7 @@ namespace { } return sPart; } -} +} // namespace // ------------------------------------------------------------------- extern "C" int NeonSession_CertificationNotify( void *userdata, @@ -445,7 +443,7 @@ extern "C" int NeonSession_CertificationNotify( void *userdata, pSession->getHostName(), cert_subject ) ); if ( certificateContainer != security::CertificateContainerStatus_NOCERT ) - return + return certificateContainer == security::CertificateContainerStatus_TRUSTED ? 0 : 1; @@ -476,7 +474,7 @@ extern "C" int NeonSession_CertificationNotify( void *userdata, rtl::OString sEECertB64( eeCertB64 ); - uno::Reference< com::sun::star::security::XCertificate > xEECert( + uno::Reference< security::XCertificate > xEECert( xSecurityEnv->createCertificateFromAscii( rtl::OStringToOUString( sEECertB64, RTL_TEXTENCODING_ASCII_US ) ) ); @@ -617,36 +615,41 @@ extern "C" void NeonSession_PreSendRequest( ne_request * req, } } - const DAVRequestHeaders & rHeaders - = pSession->getRequestEnvironment().m_aRequestHeaders; + const DAVRequestHeaders & rHeaders + = pSession->getRequestEnvironment().m_aRequestHeaders; - DAVRequestHeaders::const_iterator it1( rHeaders.begin() ); - const DAVRequestHeaders::const_iterator end1( rHeaders.end() ); + DAVRequestHeaders::const_iterator it1( rHeaders.begin() ); + const DAVRequestHeaders::const_iterator end1( rHeaders.end() ); - while ( it1 != end1 ) - { - rtl::OString aHeader - = rtl::OUStringToOString( (*it1).first, - RTL_TEXTENCODING_UTF8 ); - rtl::OString aValue - = rtl::OUStringToOString( (*it1).second, - RTL_TEXTENCODING_UTF8 ); - ne_buffer_concat( headers, aHeader.getStr(), ": ", - aValue.getStr(), EOL, NULL ); - - ++it1; + while ( it1 != end1 ) + { + rtl::OString aHeader + = rtl::OUStringToOString( (*it1).first, + RTL_TEXTENCODING_UTF8 ); + rtl::OString aValue + = rtl::OUStringToOString( (*it1).second, + RTL_TEXTENCODING_UTF8 ); + ne_buffer_concat( headers, aHeader.getStr(), ": ", + aValue.getStr(), EOL, NULL ); + + ++it1; + } } } -} // namespace +// ------------------------------------------------------------------- +// static members! +bool NeonSession::m_bGlobalsInited = false; +osl::Mutex NeonSession::m_aGlobalMutex; +NeonLockStore NeonSession::m_aNeonLockStore; // ------------------------------------------------------------------- // Constructor // ------------------------------------------------------------------- NeonSession::NeonSession( - const rtl::Reference< DAVSessionFactory > & rSessionFactory, - const rtl::OUString& inUri, - const ucbhelper::InternetProxyDecider & rProxyDecider ) + const rtl::Reference< DAVSessionFactory > & rSessionFactory, + const rtl::OUString& inUri, + const ucbhelper::InternetProxyDecider & rProxyDecider ) throw ( DAVException ) : DAVSession( rSessionFactory ), m_pHttpSession( 0 ), @@ -657,8 +660,6 @@ NeonSession::NeonSession( m_aScheme = theUri.GetScheme(); m_aHostName = theUri.GetHost(); m_nPort = theUri.GetPort(); - -// Init(); } // ------------------------------------------------------------------- @@ -670,17 +671,17 @@ NeonSession::~NeonSession( ) { ne_session_destroy( m_pHttpSession ); m_pHttpSession = 0; - // Note: Uncomment the following if locking support is required - /* - if ( mNeonLockSession != NULL ) - { - ne_lock_unregister( mNeonLockSession ); - mNeonLockSession = NULL; - } - */ } + delete static_cast< RequestDataMap * >( m_pRequestData ); +} - delete static_cast(m_pRequestData); +// ------------------------------------------------------------------- +void NeonSession::Init( const DAVRequestEnvironment & rEnv ) + throw ( DAVException ) +{ + osl::Guard< osl::Mutex > theGuard( m_aMutex ); + m_aEnv = rEnv; + Init(); } // ------------------------------------------------------------------- @@ -693,7 +694,7 @@ void NeonSession::Init() if ( m_pHttpSession == 0 ) { - // Ensure that Neon sockets are initialize + // Ensure that Neon sockets are initialized // --> tkr #151111# crashed if copy and pasted pictures from the internet // ne_sock_init() was executed by two threads at the same time. @@ -705,9 +706,18 @@ void NeonSession::Init() throw DAVException( DAVException::DAV_SESSION_CREATE, NeonUri::makeConnectionEndPointString( m_aHostName, m_nPort ) ); + // #122205# - libxml2 needs to be initialized once if used by // multithreaded programs like OOo. xmlInitParser(); +#if 0 + // for more debug flags see ne_utils.h; NE_DEBUGGING must be defined + // while compiling neon in order to actually activate neon debug + // output. + ne_debug_init( stderr, + /*NE_DBG_HTTP | NE_DBG_XML | NE_DBG_XMLPARSE |*/ + NE_DBG_LOCKS | NE_DBG_FLUSH ); +#endif m_bGlobalsInited = true; } @@ -747,30 +757,29 @@ void NeonSession::Init() // to the session m_pHttpSession = ne_session_create( - rtl::OUStringToOString( m_aScheme, - RTL_TEXTENCODING_UTF8 ).getStr(), - /* theUri.GetUserInfo(), - @@@ for FTP via HTTP proxy, but not supported by Neon */ - rtl::OUStringToOString( m_aHostName, - RTL_TEXTENCODING_UTF8 ).getStr(), - m_nPort ); + rtl::OUStringToOString( m_aScheme, + RTL_TEXTENCODING_UTF8 ).getStr(), + /* theUri.GetUserInfo(), + @@@ for FTP via HTTP proxy, but not supported by Neon */ + rtl::OUStringToOString( m_aHostName, + RTL_TEXTENCODING_UTF8 ).getStr(), + m_nPort ); if ( m_pHttpSession == 0 ) throw DAVException( DAVException::DAV_SESSION_CREATE, NeonUri::makeConnectionEndPointString( m_aHostName, m_nPort ) ); - if (m_aScheme.equalsIgnoreAsciiCase( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "https" ) ) ) ) - { - - // Get all trusted certificates from key store - - + // Register the session with the lock store + m_aNeonLockStore.registerSession( m_pHttpSession ); + if ( m_aScheme.equalsIgnoreAsciiCase( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "https" ) ) ) ) + { // Set a failure callback for certificate check - ne_ssl_set_verify( m_pHttpSession, NeonSession_CertificationNotify, this); - } + ne_ssl_set_verify( + m_pHttpSession, NeonSession_CertificationNotify, this); + } // Add hooks (i.e. for adding additional headers to the request) @@ -815,27 +824,20 @@ void NeonSession::Init() if ( m_aProxyName.getLength() ) { ne_session_proxy( m_pHttpSession, - rtl::OUStringToOString( m_aProxyName, - RTL_TEXTENCODING_UTF8 ) - .getStr(), + rtl::OUStringToOString( + m_aProxyName, + RTL_TEXTENCODING_UTF8 ).getStr(), m_nProxyPort ); } - // Note: Uncomment the following if locking support is required - /* - mNeonLockSession = ne_lock_register( m_pHttpSession ); - - if ( mNeonLockSession == NULL ) - throw DAVException( DAVException::DAV_SESSION_CREATE, - theUri::makeConnectionEndPointString() ); - */ - // Register for redirects. ne_redirect_register( m_pHttpSession ); // authentication callbacks. - ne_add_server_auth( m_pHttpSession, NE_AUTH_ALL, NeonSession_NeonAuth, this ); - ne_add_proxy_auth ( m_pHttpSession, NE_AUTH_ALL, NeonSession_NeonAuth, this ); + ne_add_server_auth( + m_pHttpSession, NE_AUTH_ALL, NeonSession_NeonAuth, this ); + ne_add_proxy_auth( + m_pHttpSession, NE_AUTH_ALL, NeonSession_NeonAuth, this ); } } @@ -870,15 +872,13 @@ sal_Bool NeonSession::UsesProxy() // OPTIONS // ------------------------------------------------------------------- void NeonSession::OPTIONS( const rtl::OUString & inPath, - DAVCapabilities & outCapabilities, + DAVCapabilities & outCapabilities, const DAVRequestEnvironment & rEnv ) throw( DAVException ) { osl::Guard< osl::Mutex > theGuard( m_aMutex ); - Init(); - - m_aEnv = rEnv; + Init( rEnv ); HttpServerCapabilities servercaps; memset( &servercaps, 0, sizeof( servercaps ) ); @@ -887,7 +887,8 @@ void NeonSession::OPTIONS( const rtl::OUString & inPath, rtl::OUStringToOString( inPath, RTL_TEXTENCODING_UTF8 ), &servercaps ); - HandleError( theRetVal ); + + HandleError( theRetVal, inPath, rEnv ); outCapabilities.class1 = !!servercaps.dav_class1; outCapabilities.class2 = !!servercaps.dav_class2; @@ -897,60 +898,58 @@ void NeonSession::OPTIONS( const rtl::OUString & inPath, // ------------------------------------------------------------------- // PROPFIND - allprop & named // ------------------------------------------------------------------- -void NeonSession::PROPFIND( const rtl::OUString & inPath, - const Depth inDepth, +void NeonSession::PROPFIND( const rtl::OUString & inPath, + const Depth inDepth, const std::vector< rtl::OUString > & inPropNames, - std::vector< DAVResource > & ioResources, + std::vector< DAVResource > & ioResources, const DAVRequestEnvironment & rEnv ) throw ( DAVException ) { osl::Guard< osl::Mutex > theGuard( m_aMutex ); - Init(); - - m_aEnv = rEnv; + Init( rEnv ); int theRetVal = NE_OK; NeonPropFindRequest theRequest( m_pHttpSession, rtl::OUStringToOString( inPath, RTL_TEXTENCODING_UTF8 ), - inDepth, - inPropNames, - ioResources, - theRetVal ); - HandleError( theRetVal ); + inDepth, + inPropNames, + ioResources, + theRetVal ); + + HandleError( theRetVal, inPath, rEnv ); } // ------------------------------------------------------------------- // PROPFIND - propnames // ------------------------------------------------------------------- -void NeonSession::PROPFIND( const rtl::OUString & inPath, - const Depth inDepth, - std::vector< DAVResourceInfo >& ioResInfo, +void NeonSession::PROPFIND( const rtl::OUString & inPath, + const Depth inDepth, + std::vector< DAVResourceInfo > & ioResInfo, const DAVRequestEnvironment & rEnv ) throw( DAVException ) { osl::Guard< osl::Mutex > theGuard( m_aMutex ); - Init(); - - m_aEnv = rEnv; + Init( rEnv ); int theRetVal = NE_OK; NeonPropFindRequest theRequest( m_pHttpSession, rtl::OUStringToOString( inPath, RTL_TEXTENCODING_UTF8 ), - inDepth, - ioResInfo, - theRetVal ); - HandleError( theRetVal ); + inDepth, + ioResInfo, + theRetVal ); + + HandleError( theRetVal, inPath, rEnv ); } // ------------------------------------------------------------------- // PROPPATCH // ------------------------------------------------------------------- -void NeonSession::PROPPATCH( const rtl::OUString & inPath, - const std::vector< ProppatchValue > & inValues, +void NeonSession::PROPPATCH( const rtl::OUString & inPath, + const std::vector< ProppatchValue > & inValues, const DAVRequestEnvironment & rEnv ) throw( DAVException ) { @@ -974,9 +973,10 @@ void NeonSession::PROPPATCH( const rtl::OUString & inPath, executable w ( #ifndef WIN32 ) All dead properties are of course writable. - */ + */ int theRetVal = NE_OK; + int n; // for the "for" loop // Generate the list of properties we want to set. @@ -1000,8 +1000,8 @@ void NeonSession::PROPPATCH( const rtl::OUString & inPath, if ( DAVProperties::isUCBDeadProperty( *pName ) ) { // DAV dead property added by WebDAV UCP? - if ( !UCBDeadPropertyValue::toXML( - rValue.value, aStringValue ) ) + if ( !UCBDeadPropertyValue::toXML( rValue.value, + aStringValue ) ) { // Error! pItems[ n ].value = 0; @@ -1015,7 +1015,7 @@ void NeonSession::PROPPATCH( const rtl::OUString & inPath, // complex properties... if ( rValue.name == DAVProperties::SOURCE ) { - uno::Sequence< ::com::sun::star::ucb::Link > aLinks; + uno::Sequence< ucb::Link > aLinks; if ( rValue.value >>= aLinks ) { LinkSequence::toXML( aLinks, aStringValue ); @@ -1055,9 +1055,7 @@ void NeonSession::PROPPATCH( const rtl::OUString & inPath, { osl::Guard< osl::Mutex > theGuard( m_aMutex ); - Init(); - - m_aEnv = rEnv; + Init( rEnv ); pItems[ n ].name = 0; @@ -1076,7 +1074,7 @@ void NeonSession::PROPPATCH( const rtl::OUString & inPath, delete [] pItems; - HandleError( theRetVal ); + HandleError( theRetVal, inPath, rEnv ); } // ------------------------------------------------------------------- @@ -1090,9 +1088,7 @@ void NeonSession::HEAD( const ::rtl::OUString & inPath, { osl::Guard< osl::Mutex > theGuard( m_aMutex ); - Init(); - - m_aEnv = rEnv; + Init( rEnv ); int theRetVal = NE_OK; NeonHeadRequest theRequest( m_pHttpSession, @@ -1100,7 +1096,8 @@ void NeonSession::HEAD( const ::rtl::OUString & inPath, inHeaderNames, ioResource, theRetVal ); - HandleError( theRetVal ); + + HandleError( theRetVal, inPath, rEnv ); } // ------------------------------------------------------------------- @@ -1108,14 +1105,12 @@ void NeonSession::HEAD( const ::rtl::OUString & inPath, // ------------------------------------------------------------------- uno::Reference< io::XInputStream > NeonSession::GET( const rtl::OUString & inPath, - const DAVRequestEnvironment & rEnv ) + const DAVRequestEnvironment & rEnv ) throw ( DAVException ) { osl::Guard< osl::Mutex > theGuard( m_aMutex ); - Init(); - - m_aEnv = rEnv; + Init( rEnv ); rtl::Reference< NeonInputStream > xInputStream( new NeonInputStream ); NeonRequestContext aCtx( xInputStream ); @@ -1125,23 +1120,23 @@ NeonSession::GET( const rtl::OUString & inPath, NeonSession_ResponseBlockReader, false, &aCtx ); - HandleError( theRetVal ); + + HandleError( theRetVal, inPath, rEnv ); + return uno::Reference< io::XInputStream >( xInputStream.get() ); } // ------------------------------------------------------------------- // GET // ------------------------------------------------------------------- -void NeonSession::GET( const rtl::OUString & inPath, +void NeonSession::GET( const rtl::OUString & inPath, uno::Reference< io::XOutputStream > & ioOutputStream, const DAVRequestEnvironment & rEnv ) throw ( DAVException ) { osl::Guard< osl::Mutex > theGuard( m_aMutex ); - Init(); - - m_aEnv = rEnv; + Init( rEnv ); NeonRequestContext aCtx( ioOutputStream ); int theRetVal = GET( m_pHttpSession, @@ -1150,7 +1145,8 @@ void NeonSession::GET( const rtl::OUString & inPath, NeonSession_ResponseBlockWriter, false, &aCtx ); - HandleError( theRetVal ); + + HandleError( theRetVal, inPath, rEnv ); } // ------------------------------------------------------------------- @@ -1158,16 +1154,14 @@ void NeonSession::GET( const rtl::OUString & inPath, // ------------------------------------------------------------------- uno::Reference< io::XInputStream > NeonSession::GET( const rtl::OUString & inPath, - const std::vector< ::rtl::OUString > & inHeaderNames, - DAVResource & ioResource, - const DAVRequestEnvironment & rEnv ) + const std::vector< ::rtl::OUString > & inHeaderNames, + DAVResource & ioResource, + const DAVRequestEnvironment & rEnv ) throw ( DAVException ) { osl::Guard< osl::Mutex > theGuard( m_aMutex ); - Init(); - - m_aEnv = rEnv; + Init( rEnv ); ioResource.uri = inPath; ioResource.properties.clear(); @@ -1180,7 +1174,9 @@ NeonSession::GET( const rtl::OUString & inPath, NeonSession_ResponseBlockReader, true, &aCtx ); - HandleError( theRetVal ); + + HandleError( theRetVal, inPath, rEnv ); + return uno::Reference< io::XInputStream >( xInputStream.get() ); } @@ -1188,17 +1184,15 @@ NeonSession::GET( const rtl::OUString & inPath, // GET // ------------------------------------------------------------------- void NeonSession::GET( const rtl::OUString & inPath, - uno::Reference< io::XOutputStream > & ioOutputStream, - const std::vector< ::rtl::OUString > & inHeaderNames, - DAVResource & ioResource, - const DAVRequestEnvironment & rEnv ) + uno::Reference< io::XOutputStream > & ioOutputStream, + const std::vector< ::rtl::OUString > & inHeaderNames, + DAVResource & ioResource, + const DAVRequestEnvironment & rEnv ) throw ( DAVException ) { osl::Guard< osl::Mutex > theGuard( m_aMutex ); - Init(); - - m_aEnv = rEnv; + Init( rEnv ); ioResource.uri = inPath; ioResource.properties.clear(); @@ -1210,27 +1204,26 @@ void NeonSession::GET( const rtl::OUString & inPath, NeonSession_ResponseBlockWriter, true, &aCtx ); - HandleError( theRetVal ); + + HandleError( theRetVal, inPath, rEnv ); } // ------------------------------------------------------------------- // PUT // ------------------------------------------------------------------- -void NeonSession::PUT( const rtl::OUString & inPath, +void NeonSession::PUT( const rtl::OUString & inPath, const uno::Reference< io::XInputStream > & inInputStream, const DAVRequestEnvironment & rEnv ) throw ( DAVException ) { osl::Guard< osl::Mutex > theGuard( m_aMutex ); - Init(); - - m_aEnv = rEnv; - uno::Sequence< sal_Int8 > aDataToSend; if ( !getDataFromInputStream( inInputStream, aDataToSend, false ) ) throw DAVException( DAVException::DAV_INVALID_ARG ); + Init( rEnv ); + int theRetVal = PUT( m_pHttpSession, rtl::OUStringToOString( inPath, RTL_TEXTENCODING_UTF8 ), @@ -1238,7 +1231,7 @@ void NeonSession::PUT( const rtl::OUString & inPath, aDataToSend.getConstArray() ), aDataToSend.getLength() ); - HandleError( theRetVal ); + HandleError( theRetVal, inPath, rEnv ); } // ------------------------------------------------------------------- @@ -1246,10 +1239,10 @@ void NeonSession::PUT( const rtl::OUString & inPath, // ------------------------------------------------------------------- uno::Reference< io::XInputStream > NeonSession::POST( const rtl::OUString & inPath, - const rtl::OUString & rContentType, - const rtl::OUString & rReferer, - const uno::Reference< io::XInputStream > & inInputStream, - const DAVRequestEnvironment & rEnv ) + const rtl::OUString & rContentType, + const rtl::OUString & rReferer, + const uno::Reference< io::XInputStream > & inInputStream, + const DAVRequestEnvironment & rEnv ) throw ( DAVException ) { osl::Guard< osl::Mutex > theGuard( m_aMutex ); @@ -1258,15 +1251,13 @@ NeonSession::POST( const rtl::OUString & inPath, if ( !getDataFromInputStream( inInputStream, aDataToSend, true ) ) throw DAVException( DAVException::DAV_INVALID_ARG ); - Init(); - - m_aEnv = rEnv; + Init( rEnv ); rtl::Reference< NeonInputStream > xInputStream( new NeonInputStream ); NeonRequestContext aCtx( xInputStream ); int theRetVal = POST( m_pHttpSession, rtl::OUStringToOString( - inPath, RTL_TEXTENCODING_UTF8 ), + inPath, RTL_TEXTENCODING_UTF8 ), reinterpret_cast< const char * >( aDataToSend.getConstArray() ), NeonSession_ResponseBlockReader, @@ -1274,7 +1265,8 @@ NeonSession::POST( const rtl::OUString & inPath, rContentType, rReferer ); - HandleError( theRetVal ); + HandleError( theRetVal, inPath, rEnv ); + return uno::Reference< io::XInputStream >( xInputStream.get() ); } @@ -1295,9 +1287,7 @@ void NeonSession::POST( const rtl::OUString & inPath, if ( !getDataFromInputStream( inInputStream, aDataToSend, true ) ) throw DAVException( DAVException::DAV_INVALID_ARG ); - Init(); - - m_aEnv = rEnv; + Init( rEnv ); NeonRequestContext aCtx( oOutputStream ); int theRetVal = POST( m_pHttpSession, @@ -1310,17 +1300,7 @@ void NeonSession::POST( const rtl::OUString & inPath, rContentType, rReferer ); - HandleError( theRetVal ); -} - -// ------------------------------------------------------------------- -// ABORT -// ------------------------------------------------------------------- -void NeonSession::ABORT() - throw ( DAVException ) -{ - if (NULL !=m_pHttpSession) - ne_close_connection(m_pHttpSession); + HandleError( theRetVal, inPath, rEnv ); } // ------------------------------------------------------------------- @@ -1332,30 +1312,27 @@ void NeonSession::MKCOL( const rtl::OUString & inPath, { osl::Guard< osl::Mutex > theGuard( m_aMutex ); - Init(); - - m_aEnv = rEnv; + Init( rEnv ); int theRetVal = ne_mkcol( m_pHttpSession, rtl::OUStringToOString( - inPath, RTL_TEXTENCODING_UTF8 ) ); - HandleError( theRetVal ); + inPath, RTL_TEXTENCODING_UTF8 ) ); + + HandleError( theRetVal, inPath, rEnv ); } // ------------------------------------------------------------------- // COPY // ------------------------------------------------------------------- -void NeonSession::COPY( const rtl::OUString & inSourceURL, - const rtl::OUString & inDestinationURL, +void NeonSession::COPY( const rtl::OUString & inSourceURL, + const rtl::OUString & inDestinationURL, const DAVRequestEnvironment & rEnv, - sal_Bool inOverWrite ) + sal_Bool inOverWrite ) throw ( DAVException ) { osl::Guard< osl::Mutex > theGuard( m_aMutex ); - Init(); - - m_aEnv = rEnv; + Init( rEnv ); NeonUri theSourceUri( inSourceURL ); NeonUri theDestinationUri( inDestinationURL ); @@ -1364,12 +1341,13 @@ void NeonSession::COPY( const rtl::OUString & inSourceURL, inOverWrite ? 1 : 0, NE_DEPTH_INFINITE, rtl::OUStringToOString( - theSourceUri.GetPath(), - RTL_TEXTENCODING_UTF8 ), + theSourceUri.GetPath(), + RTL_TEXTENCODING_UTF8 ), rtl::OUStringToOString( - theDestinationUri.GetPath(), - RTL_TEXTENCODING_UTF8 ) ); - HandleError( theRetVal ); + theDestinationUri.GetPath(), + RTL_TEXTENCODING_UTF8 ) ); + + HandleError( theRetVal, inSourceURL, rEnv ); } // ------------------------------------------------------------------- @@ -1383,21 +1361,20 @@ void NeonSession::MOVE( const rtl::OUString & inSourceURL, { osl::Guard< osl::Mutex > theGuard( m_aMutex ); - Init(); - - m_aEnv = rEnv; + Init( rEnv ); NeonUri theSourceUri( inSourceURL ); NeonUri theDestinationUri( inDestinationURL ); int theRetVal = ne_move( m_pHttpSession, inOverWrite ? 1 : 0, rtl::OUStringToOString( - theSourceUri.GetPath(), - RTL_TEXTENCODING_UTF8 ), + theSourceUri.GetPath(), + RTL_TEXTENCODING_UTF8 ), rtl::OUStringToOString( - theDestinationUri.GetPath(), - RTL_TEXTENCODING_UTF8 ) ); - HandleError( theRetVal ); + theDestinationUri.GetPath(), + RTL_TEXTENCODING_UTF8 ) ); + + HandleError( theRetVal, inSourceURL, rEnv ); } // ------------------------------------------------------------------- @@ -1409,53 +1386,279 @@ void NeonSession::DESTROY( const rtl::OUString & inPath, { osl::Guard< osl::Mutex > theGuard( m_aMutex ); - Init(); - - m_aEnv = rEnv; + Init( rEnv ); int theRetVal = ne_delete( m_pHttpSession, rtl::OUStringToOString( - inPath, RTL_TEXTENCODING_UTF8 ) ); - HandleError( theRetVal ); + inPath, RTL_TEXTENCODING_UTF8 ) ); + + HandleError( theRetVal, inPath, rEnv ); } // ------------------------------------------------------------------- -// LOCK +namespace +{ + sal_Int32 lastChanceToSendRefreshRequest( TimeValue const & rStart, + int timeout ) + { + TimeValue aEnd; + osl_getSystemTime( &aEnd ); + + // Try to estimate a safe absolute time for sending the + // lock refresh request. + sal_Int32 lastChanceToSendRefreshRequest = -1; + if ( timeout != NE_TIMEOUT_INFINITE ) + { + sal_Int32 calltime = aEnd.Seconds - rStart.Seconds; + if ( calltime <= timeout ) + { + lastChanceToSendRefreshRequest + = aEnd.Seconds + timeout - calltime; + } + else + { + OSL_TRACE( "No chance to refresh lock before timeout!" ); + } + } + return lastChanceToSendRefreshRequest; + } + +} // namespace + +// ------------------------------------------------------------------- +// LOCK (set new lock) // ------------------------------------------------------------------- -// Note: Uncomment the following if locking support is required -/* -void NeonSession::LOCK( const Lock & inLock, +void NeonSession::LOCK( const ::rtl::OUString & inPath, + ucb::Lock & rLock, const DAVRequestEnvironment & rEnv ) throw ( DAVException ) { osl::Guard< osl::Mutex > theGuard( m_aMutex ); - Init(); + Init( rEnv ); - m_aEnv = rEnv; + /* Create a depth zero, exclusive write lock, with default timeout + * (allowing a server to pick a default). token, owner and uri are + * unset. */ + NeonLock * theLock = ne_lock_create(); + + // Set the lock uri + ne_uri aUri; + ne_uri_parse( rtl::OUStringToOString( makeAbsoluteURL( inPath ), + RTL_TEXTENCODING_UTF8 ).getStr(), + &aUri ); + theLock->uri = aUri; + + // Set the lock depth + switch( rLock.Depth ) + { + case ucb::LockDepth_ZERO: + theLock->depth = NE_DEPTH_ZERO; + break; + case ucb::LockDepth_ONE: + theLock->depth = NE_DEPTH_ONE; + break; + case ucb::LockDepth_INFINITY: + theLock->depth = NE_DEPTH_INFINITE; + break; + default: + throw DAVException( DAVException::DAV_INVALID_ARG ); + } + + // Set the lock scope + switch ( rLock.Scope ) + { + case ucb::LockScope_EXCLUSIVE: + theLock->scope = ne_lockscope_exclusive; + break; + case ucb::LockScope_SHARED: + theLock->scope = ne_lockscope_shared; + break; + default: + throw DAVException( DAVException::DAV_INVALID_ARG ); + break; + } + + // Set the lock timeout + theLock->timeout = (long)rLock.Timeout; + + // Set the lock owner + rtl::OUString aValue; + rLock.Owner >>= aValue; + theLock->owner = + ne_strdup( rtl::OUStringToOString( aValue, + RTL_TEXTENCODING_UTF8 ).getStr() ); + TimeValue startCall; + osl_getSystemTime( &startCall ); + + int theRetVal = ne_lock( m_pHttpSession, theLock ); + + if ( theRetVal == NE_OK ) + { + m_aNeonLockStore.addLock( theLock, + this, + lastChanceToSendRefreshRequest( + startCall, theLock->timeout ) ); + + uno::Sequence< rtl::OUString > aTokens( 1 ); + aTokens[ 0 ] = rtl::OUString::createFromAscii( theLock->token ); + rLock.LockTokens = aTokens; + + OSL_TRACE( "NeonSession::LOCK: created lock for %s. token: %s", + rtl::OUStringToOString( makeAbsoluteURL( inPath ), + RTL_TEXTENCODING_UTF8 ).getStr(), + theLock->token ); + } + else + { + ne_lock_destroy( theLock ); + + OSL_TRACE( "NeonSession::LOCK: obtaining lock for %s failed!", + rtl::OUStringToOString( makeAbsoluteURL( inPath ), + RTL_TEXTENCODING_UTF8 ).getStr() ); + } + + HandleError( theRetVal, inPath, rEnv ); +} + +// ------------------------------------------------------------------- +// LOCK (refresh existing lock) +// ------------------------------------------------------------------- +sal_Int64 NeonSession::LOCK( const ::rtl::OUString & inPath, + sal_Int64 nTimeout, + const DAVRequestEnvironment & rEnv ) + throw ( DAVException ) +{ + osl::Guard< osl::Mutex > theGuard( m_aMutex ); + + // Try to get the neon lock from lock store + NeonLock * theLock + = m_aNeonLockStore.findByUri( makeAbsoluteURL( inPath ) ); + if ( !theLock ) + throw DAVException( DAVException::DAV_NOT_LOCKED ); + + Init( rEnv ); + + // refresh existing lock. + theLock->timeout = nTimeout; - Lockit( inLock, true ); + TimeValue startCall; + osl_getSystemTime( &startCall ); + + int theRetVal = ne_lock_refresh( m_pHttpSession, theLock ); + + if ( theRetVal == NE_OK ) + { + m_aNeonLockStore.updateLock( theLock, + lastChanceToSendRefreshRequest( + startCall, theLock->timeout ) ); + } + + HandleError( theRetVal, inPath, rEnv ); + + return theLock->timeout; +} + +// ------------------------------------------------------------------- +// LOCK (refresh existing lock) +// ------------------------------------------------------------------- +bool NeonSession::LOCK( NeonLock * pLock, + sal_Int32 & rlastChanceToSendRefreshRequest ) +{ + osl::Guard< osl::Mutex > theGuard( m_aMutex ); + +#if OSL_DEBUG_LEVEL > 0 + char * p = ne_uri_unparse( &(pLock->uri) ); + OSL_TRACE( "NeonSession::LOCK: Refreshing lock for %s.", p ); + ne_free( p ); +#endif + + // refresh existing lock. + + TimeValue startCall; + osl_getSystemTime( &startCall ); + + if ( ne_lock_refresh( m_pHttpSession, pLock ) == NE_OK ) + { + rlastChanceToSendRefreshRequest + = lastChanceToSendRefreshRequest( startCall, pLock->timeout ); + + OSL_TRACE( "Lock successfully refreshed." ); + return true; + } + else + { + OSL_TRACE( "Lock not refreshed!" ); + return false; + } } -*/ // ------------------------------------------------------------------- // UNLOCK // ------------------------------------------------------------------- -// Note: Uncomment the following if locking support is required -/* -void NeonSession::UNLOCK( const Lock & inLock, +void NeonSession::UNLOCK( const ::rtl::OUString & inPath, const DAVRequestEnvironment & rEnv ) throw ( DAVException ) { osl::Guard< osl::Mutex > theGuard( m_aMutex ); - Init(); + // get the neon lock from lock store + NeonLock * theLock + = m_aNeonLockStore.findByUri( makeAbsoluteURL( inPath ) ); + if ( !theLock ) + throw DAVException( DAVException::DAV_NOT_LOCKED ); - m_aEnv = rEnv; + Init( rEnv ); + + int theRetVal = ne_unlock( m_pHttpSession, theLock ); - Lockit( inLock, false ); + if ( theRetVal == NE_OK ) + { + m_aNeonLockStore.removeLock( theLock ); + ne_lock_destroy( theLock ); + } + else + { + OSL_TRACE( "NeonSession::UNLOCK: unlocking of %s failed.", + rtl::OUStringToOString( makeAbsoluteURL( inPath ), + RTL_TEXTENCODING_UTF8 ).getStr() ); + } + + HandleError( theRetVal, inPath, rEnv ); +} + +// ------------------------------------------------------------------- +// UNLOCK +// ------------------------------------------------------------------- +bool NeonSession::UNLOCK( NeonLock * pLock ) +{ + osl::Guard< osl::Mutex > theGuard( m_aMutex ); + +#if OSL_DEBUG_LEVEL > 0 + char * p = ne_uri_unparse( &(pLock->uri) ); + OSL_TRACE( "NeonSession::UNLOCK: Unlocking %s.", p ); + ne_free( p ); +#endif + + if ( ne_unlock( m_pHttpSession, pLock ) == NE_OK ) + { + OSL_TRACE( "UNLOCK succeeded." ); + return true; + } + else + { + OSL_TRACE( "UNLOCK failed!" ); + return false; + } +} + +// ------------------------------------------------------------------- +void NeonSession::abort() + throw ( DAVException ) +{ + if ( m_pHttpSession ) + ne_close_connection( m_pHttpSession ); } -*/ // ------------------------------------------------------------------- const ucbhelper::InternetProxyServer & NeonSession::getProxySettings() const @@ -1475,11 +1678,96 @@ const ucbhelper::InternetProxyServer & NeonSession::getProxySettings() const } } +// ------------------------------------------------------------------- +namespace { + +bool containsLocktoken( const uno::Sequence< ucb::Lock > & rLocks, + const char * token ) +{ + for ( sal_Int32 n = 0; n < rLocks.getLength(); ++n ) + { + const uno::Sequence< rtl::OUString > & rTokens + = rLocks[ n ].LockTokens; + for ( sal_Int32 m = 0; m < rTokens.getLength(); ++m ) + { + if ( rTokens[ m ].equalsAscii( token ) ) + return true; + } + } + return false; +} + +} // namespace + +// ------------------------------------------------------------------- +bool NeonSession::removeExpiredLocktoken( const rtl::OUString & inURL, + const DAVRequestEnvironment & rEnv ) +{ + NeonLock * theLock = m_aNeonLockStore.findByUri( inURL ); + if ( !theLock ) + return false; + + // do a lockdiscovery to check whether this lock is still valid. + try + { + // @@@ Alternative: use ne_lock_discover() => less overhead + + std::vector< DAVResource > aResources; + std::vector< rtl::OUString > aPropNames; + aPropNames.push_back( DAVProperties::LOCKDISCOVERY ); + + PROPFIND( rEnv.m_aRequestURI, DAVZERO, aPropNames, aResources, rEnv ); + + if ( aResources.size() == 0 ) + return false; + + std::vector< DAVPropertyValue >::const_iterator it + = aResources[ 0 ].properties.begin(); + std::vector< DAVPropertyValue >::const_iterator end + = aResources[ 0 ].properties.end(); + + while ( it != end ) + { + if ( (*it).Name.equals( DAVProperties::LOCKDISCOVERY ) ) + { + uno::Sequence< ucb::Lock > aLocks; + if ( !( (*it).Value >>= aLocks ) ) + return false; + + if ( !containsLocktoken( aLocks, theLock->token ) ) + { + // expired! + + OSL_TRACE( "NeonSession::removeExpiredLocktoken: Removing " + " expired lock token for %s. token: %s", + rtl::OUStringToOString( inURL, + RTL_TEXTENCODING_UTF8 ) + .getStr(), + theLock->token ); + + m_aNeonLockStore.removeLock( theLock ); + ne_lock_destroy( theLock ); + return true; + } + // still valid. + return false; + } + ++it; + } + } + catch ( DAVException const & ) + { + } + return false; +} + // ------------------------------------------------------------------- // HandleError // Common Error Handler // ------------------------------------------------------------------- -void NeonSession::HandleError( int nError ) +void NeonSession::HandleError( int nError, + const rtl::OUString & inPath, + const DAVRequestEnvironment & rEnv ) throw ( DAVException ) { m_aEnv = DAVRequestEnvironment(); @@ -1488,60 +1776,86 @@ void NeonSession::HandleError( int nError ) switch ( nError ) { case NE_OK: - // Cleanup. return; case NE_ERROR: // Generic error { rtl::OUString aText = rtl::OUString::createFromAscii( - ne_get_error( m_pHttpSession ) ); - throw DAVException( DAVException::DAV_HTTP_ERROR, - aText, - makeStatusCode( aText ) ); - } + ne_get_error( m_pHttpSession ) ); + sal_uInt16 code = makeStatusCode( aText ); + + if ( code == SC_LOCKED ) + { + if ( m_aNeonLockStore.findByUri( + makeAbsoluteURL( inPath ) ) == 0 ) + { + // locked by 3rd party + throw DAVException( DAVException::DAV_LOCKED ); + } + else + { + // locked by ourself + throw DAVException( DAVException::DAV_LOCKED_SELF ); + } + } + + // Special handling for 400 and 412 status codes, which may indicate + // that a lock previously obtained by us has been released meanwhile + // by the server. Unfortunately, RFC is not clear at this point, + // thus server implementations behave different... + else if ( code == SC_BAD_REQUEST || code == SC_PRECONDITION_FAILED ) + { + if ( removeExpiredLocktoken( makeAbsoluteURL( inPath ), rEnv ) ) + throw DAVException( DAVException::DAV_LOCK_EXPIRED ); + } + else + { + throw DAVException( DAVException::DAV_HTTP_ERROR, aText, code ); + } + } case NE_LOOKUP: // Name lookup failed. throw DAVException( DAVException::DAV_HTTP_LOOKUP, NeonUri::makeConnectionEndPointString( - m_aHostName, m_nPort ) ); + m_aHostName, m_nPort ) ); case NE_AUTH: // User authentication failed on server throw DAVException( DAVException::DAV_HTTP_AUTH, NeonUri::makeConnectionEndPointString( - m_aHostName, m_nPort ) ); + m_aHostName, m_nPort ) ); case NE_PROXYAUTH: // User authentication failed on proxy throw DAVException( DAVException::DAV_HTTP_AUTHPROXY, NeonUri::makeConnectionEndPointString( - m_aProxyName, m_nProxyPort ) ); + m_aProxyName, m_nProxyPort ) ); case NE_CONNECT: // Could not connect to server throw DAVException( DAVException::DAV_HTTP_CONNECT, NeonUri::makeConnectionEndPointString( - m_aHostName, m_nPort ) ); + m_aHostName, m_nPort ) ); case NE_TIMEOUT: // Connection timed out throw DAVException( DAVException::DAV_HTTP_TIMEOUT, NeonUri::makeConnectionEndPointString( - m_aHostName, m_nPort ) ); + m_aHostName, m_nPort ) ); case NE_FAILED: // The precondition failed throw DAVException( DAVException::DAV_HTTP_FAILED, NeonUri::makeConnectionEndPointString( - m_aHostName, m_nPort ) ); + m_aHostName, m_nPort ) ); case NE_RETRY: // Retry request (ne_end_request ONLY) throw DAVException( DAVException::DAV_HTTP_RETRY, NeonUri::makeConnectionEndPointString( - m_aHostName, m_nPort ) ); + m_aHostName, m_nPort ) ); case NE_REDIRECT: { NeonUri aUri( ne_redirect_location( m_pHttpSession ) ); throw DAVException( - DAVException::DAV_HTTP_REDIRECT, aUri.GetURI() ); + DAVException::DAV_HTTP_REDIRECT, aUri.GetURI() ); } - default: + default: { OSL_TRACE( "NeonSession::HandleError : Unknown Neon error code!" ); throw DAVException( DAVException::DAV_HTTP_ERROR, @@ -1551,78 +1865,6 @@ void NeonSession::HandleError( int nError ) } } -// Note: Uncomment the following if locking support is required -/* -void NeonSession::Lockit( const Lock & inLock, bool inLockit ) - throw ( DAVException ) -{ - osl::Guard< osl::Mutex > theGuard( m_aMutex ); - - // Create the neon lock - NeonLock * theLock = new NeonLock; - int theRetVal; - - // Set the lock uri - NeonUri theUri( inLock.uri ); - theLock->uri = const_cast< char * > - ( rtl::OUStringToOString( - theUri.GetPath(), RTL_TEXTENCODING_UTF8 ).getStr() ); - - if ( inLockit ) - { - // Set the lock depth - switch( inLock.depth ) - { - case DAVZERO: - case DAVINFINITY: - theLock->depth = int ( inLock.depth ); - break; - default: - throw DAVException( DAVException::DAV_INVALID_ARG ); - break; - } - - // Set the lock scope - switch ( inLock.scope ) - { - case EXCLUSIVE: - theLock->scope = ne_lockscope_exclusive; - break; - case SHARED: - theLock->scope = ne_lockscope_shared; - break; - default: - throw DAVException( DAVException::DAV_INVALID_ARG ); - break; - } - - // Set the lock owner - const char * theOwner = rtl::OUStringToOString( inLock.owner, - RTL_TEXTENCODING_UTF8 ); - theLock->owner = const_cast< char * > ( theOwner ); - - // Set the lock timeout - // Note: Neon ignores the timeout - //theLock->timeout = inLock.timeout; - - theRetVal = ne_lock( m_pHttpSession, theLock ); - } - else - { - - // Set the lock token - rtl::OUString theToken = inLock.locktoken.getConstArray()[ 0 ]; - theLock->token = const_cast< char * > - ( rtl::OUStringToOString( - theToken, RTL_TEXTENCODING_UTF8 ).getStr() ); - - theRetVal = ne_unlock( m_pHttpSession, theLock ); - } - - HandleError( theRetVal ); -} -*/ - // ------------------------------------------------------------------- namespace { @@ -1699,7 +1941,8 @@ int NeonSession::GET( ne_session * sess, #if NEON_VERSION < 0x0250 if ( getheaders ) - ne_add_response_header_catcher( req, runResponseHeaderHandler, userdata ); + ne_add_response_header_catcher( + req, runResponseHeaderHandler, userdata ); #endif ne_add_response_body_reader( req, ne_accept_2xx, reader, userdata ); @@ -1708,13 +1951,12 @@ int NeonSession::GET( ne_session * sess, #if NEON_VERSION >= 0x0250 if ( getheaders ) { - while ((cursor = ne_response_header_iterate(req, cursor, &name, &value)) - != NULL) + while ( ( cursor = ne_response_header_iterate( + req, cursor, &name, &value ) ) != NULL ) { char buffer[8192]; ne_snprintf(buffer, sizeof buffer, "%s: %s", name, value); - runResponseHeaderHandler(userdata, buffer); } } @@ -1809,10 +2051,11 @@ int NeonSession::POST( ne_session * sess, // ------------------------------------------------------------------- // static -bool NeonSession::getDataFromInputStream( - const uno::Reference< io::XInputStream > & xStream, - uno::Sequence< sal_Int8 > & rData, - bool bAppendTrailingZeroByte ) +bool +NeonSession::getDataFromInputStream( + const uno::Reference< io::XInputStream > & xStream, + uno::Sequence< sal_Int8 > & rData, + bool bAppendTrailingZeroByte ) { if ( xStream.is() ) { @@ -1895,32 +2138,56 @@ bool NeonSession::getDataFromInputStream( } return false; } -// ------------------------------------------------------------------- -//static - -NeonSession::Map NeonSession::certMap; // --------------------------------------------------------------------- sal_Bool -NeonSession::isDomainMatch( rtl::OUString certHostName) +NeonSession::isDomainMatch( rtl::OUString certHostName ) { rtl::OUString hostName = getHostName(); - if (hostName.equalsIgnoreAsciiCase( certHostName )) + if (hostName.equalsIgnoreAsciiCase( certHostName ) ) return sal_True; - - - if ( 0 == certHostName.indexOf( rtl::OUString::createFromAscii( "*" ) ) && hostName.getLength() >= certHostName.getLength() ) + if ( 0 == certHostName.indexOf( rtl::OUString::createFromAscii( "*" ) ) && + hostName.getLength() >= certHostName.getLength() ) { rtl::OUString cmpStr = certHostName.copy( 1 ); - if ( hostName.matchIgnoreAsciiCase( cmpStr, hostName.getLength( ) - cmpStr.getLength()) ) + if ( hostName.matchIgnoreAsciiCase( + cmpStr, hostName.getLength() - cmpStr.getLength() ) ) return sal_True; - } - return sal_False; } - +// --------------------------------------------------------------------- +rtl::OUString NeonSession::makeAbsoluteURL( rtl::OUString const & rURL ) const +{ + try + { + // Is URL relative or already absolute? + if ( rURL[ 0 ] != sal_Unicode( '/' ) ) + { + // absolute. + return rtl::OUString( rURL ); + } + else + { + ne_uri aUri; + memset( &aUri, 0, sizeof( aUri ) ); + + ne_fill_server_uri( m_pHttpSession, &aUri ); + aUri.path + = ne_strdup( rtl::OUStringToOString( + rURL, RTL_TEXTENCODING_UTF8 ).getStr() ); + NeonUri aNeonUri( &aUri ); + ne_uri_free( &aUri ); + return aNeonUri.GetURI(); + } + } + catch ( DAVException const & ) + { + } + // error. + return rtl::OUString(); +} diff --git a/ucb/source/ucp/webdav/NeonSession.hxx b/ucb/source/ucp/webdav/NeonSession.hxx index 263169ae452a..bb6bbbb8d3c3 100644 --- a/ucb/source/ucp/webdav/NeonSession.hxx +++ b/ucb/source/ucp/webdav/NeonSession.hxx @@ -35,10 +35,9 @@ #include #include "DAVSession.hxx" #include "NeonTypes.hxx" +#include "NeonLockStore.hxx" #include -using namespace com::sun::star; - namespace ucbhelper { class ProxyDecider; } namespace webdav_ucp @@ -51,236 +50,249 @@ namespace webdav_ucp class NeonSession : public DAVSession { - private: - osl::Mutex m_aMutex; - static osl::Mutex m_aGlobalMutex; - rtl::OUString m_aScheme; - rtl::OUString m_aHostName; - rtl::OUString m_aProxyName; - sal_Int32 m_nPort; - sal_Int32 m_nProxyPort; - HttpSession * m_pHttpSession; - void * m_pRequestData; - const ucbhelper::InternetProxyDecider & m_rProxyDecider; - - // @@@ This should really be per-request data. But Neon currently - // (0.23.5) has no interface for passing per-request user data. - // Theoretically, a NeonSession instance could handle multiple requests - // at a time --currently it doesn't. Thus this is not an issue at the - // moment. - DAVRequestEnvironment m_aEnv; - - // Note: Uncomment the following if locking support is required - // NeonLockSession * mNeonLockSession; - - static bool m_bGlobalsInited; - - protected: - virtual ~NeonSession(); - - public: - NeonSession( const rtl::Reference< DAVSessionFactory > & rSessionFactory, - const rtl::OUString& inUri, - const ucbhelper::InternetProxyDecider & rProxyDecider ) - throw ( DAVException ); - - // DAVSession methods - virtual sal_Bool CanUse( const ::rtl::OUString & inUri ); - - virtual sal_Bool UsesProxy(); - - const DAVRequestEnvironment & getRequestEnvironment() const - { return m_aEnv; } - - virtual void - OPTIONS( const ::rtl::OUString & inPath, - DAVCapabilities & outCapabilities, - const DAVRequestEnvironment & rEnv ) - throw ( DAVException ); - - // allprop & named - virtual void - PROPFIND( const ::rtl::OUString & inPath, - const Depth inDepth, - const std::vector< ::rtl::OUString > & inPropNames, - std::vector< DAVResource > & ioResources, - const DAVRequestEnvironment & rEnv ) - throw ( DAVException ); - - // propnames - virtual void - PROPFIND( const ::rtl::OUString & inPath, - const Depth inDepth, - std::vector< DAVResourceInfo >& ioResInfo, - const DAVRequestEnvironment & rEnv ) - throw ( DAVException ); - - virtual void - PROPPATCH( const ::rtl::OUString & inPath, - const std::vector< ProppatchValue > & inValues, - const DAVRequestEnvironment & rEnv ) - throw( DAVException ); - - virtual void - HEAD( const ::rtl::OUString & inPath, - const std::vector< ::rtl::OUString > & inHeaderNames, - DAVResource & ioResource, - const DAVRequestEnvironment & rEnv ) - throw( DAVException ); - - virtual com::sun::star::uno::Reference< - com::sun::star::io::XInputStream > - GET( const ::rtl::OUString & inPath, - const DAVRequestEnvironment & rEnv ) - throw ( DAVException ); - - virtual void - GET( const ::rtl::OUString & inPath, - com::sun::star::uno::Reference< - com::sun::star::io::XOutputStream > & ioOutputStream, - const DAVRequestEnvironment & rEnv ) - throw ( DAVException ); - - virtual com::sun::star::uno::Reference< - com::sun::star::io::XInputStream > - GET( const ::rtl::OUString & inPath, - const std::vector< ::rtl::OUString > & inHeaderNames, - DAVResource & ioResource, +private: + osl::Mutex m_aMutex; + rtl::OUString m_aScheme; + rtl::OUString m_aHostName; + rtl::OUString m_aProxyName; + sal_Int32 m_nPort; + sal_Int32 m_nProxyPort; + HttpSession * m_pHttpSession; + void * m_pRequestData; + const ucbhelper::InternetProxyDecider & m_rProxyDecider; + + // @@@ This should really be per-request data. But Neon currently + // (0.23.5) has no interface for passing per-request user data. + // Theoretically, a NeonSession instance could handle multiple requests + // at a time --currently it doesn't. Thus this is not an issue at the + // moment. + DAVRequestEnvironment m_aEnv; + + static bool m_bGlobalsInited; + static osl::Mutex m_aGlobalMutex; + static NeonLockStore m_aNeonLockStore; + +protected: + virtual ~NeonSession(); + +public: + NeonSession( const rtl::Reference< DAVSessionFactory > & rSessionFactory, + const rtl::OUString& inUri, + const ucbhelper::InternetProxyDecider & rProxyDecider ) + throw ( DAVException ); + + // DAVSession methods + virtual sal_Bool CanUse( const ::rtl::OUString & inUri ); + + virtual sal_Bool UsesProxy(); + + const DAVRequestEnvironment & getRequestEnvironment() const + { return m_aEnv; } + + virtual void + OPTIONS( const ::rtl::OUString & inPath, + DAVCapabilities & outCapabilities, const DAVRequestEnvironment & rEnv ) - throw ( DAVException ); - - virtual void - GET( const ::rtl::OUString & inPath, - com::sun::star::uno::Reference< - com::sun::star::io::XOutputStream > & ioOutputStream, - const std::vector< ::rtl::OUString > & inHeaderNames, - DAVResource & ioResource, - const DAVRequestEnvironment & rEnv ) - throw ( DAVException ); - - virtual void - PUT( const ::rtl::OUString & inPath, - const com::sun::star::uno::Reference< - com::sun::star::io::XInputStream > & inInputStream, - const DAVRequestEnvironment & rEnv ) - throw ( DAVException ); - - virtual com::sun::star::uno::Reference< - com::sun::star::io::XInputStream > - POST( const rtl::OUString & inPath, - const rtl::OUString & rContentType, - const rtl::OUString & rReferer, - const com::sun::star::uno::Reference< - com::sun::star::io::XInputStream > & inInputStream, + throw ( DAVException ); + + // allprop & named + virtual void + PROPFIND( const ::rtl::OUString & inPath, + const Depth inDepth, + const std::vector< ::rtl::OUString > & inPropNames, + std::vector< DAVResource > & ioResources, const DAVRequestEnvironment & rEnv ) - throw ( DAVException ); + throw ( DAVException ); - virtual void - POST( const rtl::OUString & inPath, - const rtl::OUString & rContentType, - const rtl::OUString & rReferer, - const com::sun::star::uno::Reference< - com::sun::star::io::XInputStream > & inInputStream, - com::sun::star::uno::Reference< - com::sun::star::io::XOutputStream > & oOutputStream, + // propnames + virtual void + PROPFIND( const ::rtl::OUString & inPath, + const Depth inDepth, + std::vector< DAVResourceInfo >& ioResInfo, const DAVRequestEnvironment & rEnv ) - throw ( DAVException ); + throw ( DAVException ); - virtual void - MKCOL( const ::rtl::OUString & inPath, + virtual void + PROPPATCH( const ::rtl::OUString & inPath, + const std::vector< ProppatchValue > & inValues, const DAVRequestEnvironment & rEnv ) - throw ( DAVException ); - - virtual void - COPY( const ::rtl::OUString & inSourceURL, - const ::rtl::OUString & inDestinationURL, - const DAVRequestEnvironment & rEnv, - sal_Bool inOverWrite ) - throw ( DAVException ); - - virtual void - MOVE( const ::rtl::OUString & inSourceURL, - const ::rtl::OUString & inDestinationURL, - const DAVRequestEnvironment & rEnv, - sal_Bool inOverWrite ) - throw ( DAVException ); - - virtual void DESTROY( const ::rtl::OUString & inPath, - const DAVRequestEnvironment & rEnv ) - throw ( DAVException ); - - virtual void ABORT() - throw ( DAVException ); - - // Note: Uncomment the following if locking support is required - /* - virtual void LOCK (const Lock & inLock, - const DAVRequestEnvironment & rEnv ) - throw ( DAVException ); - - virtual void UNLOCK (const Lock & inLock, - const DAVRequestEnvironment & rEnv ) - throw ( DAVException ); - */ - - // helpers - const rtl::OUString & getHostName() const { return m_aHostName; } - - const ::uno::Reference< ::lang::XMultiServiceFactory > getMSF() { return m_xFactory->getServiceFactory(); } - - const void * getRequestData() const { return m_pRequestData; } - - sal_Bool isDomainMatch( rtl::OUString certHostName ); - - private: - // Initialise "Neon sockets" - void Init( void ) - throw ( DAVException ); - - void HandleError( int nError ) - throw ( DAVException ); - - const ucbhelper::InternetProxyServer & getProxySettings() const; - - // Note: Uncomment the following if locking support is required - // void Lockit( const Lock & inLock, bool inLockit ) - // throw ( DAVException ); - - // low level GET implementation, used by public GET implementations - static int GET( ne_session * sess, - const char * uri, - ne_block_reader reader, - bool getheaders, - void * userdata ); - - // Buffer-based PUT implementation. Neon only has file descriptor- - // based API. - static int PUT( ne_session * sess, - const char * uri, - const char * buffer, - size_t size ); - - // Buffer-based POST implementation. Neon only has file descriptor- - // based API. - int POST( ne_session * sess, - const char * uri, - const char * buffer, - ne_block_reader reader, - void * userdata, - const rtl::OUString & rContentType, - const rtl::OUString & rReferer ); - - // Helper: XInputStream -> Sequence< sal_Int8 > - static bool getDataFromInputStream( - const com::sun::star::uno::Reference< - com::sun::star::io::XInputStream > & xStream, - com::sun::star::uno::Sequence< sal_Int8 > & rData, - bool bAppendTrailingZeroByte ); - - typedef std::map< ::rtl::OUString, ::rtl::OUString > Map; - static Map certMap; + throw ( DAVException ); + + virtual void + HEAD( const ::rtl::OUString & inPath, + const std::vector< ::rtl::OUString > & inHeaderNames, + DAVResource & ioResource, + const DAVRequestEnvironment & rEnv ) + throw ( DAVException ); + + virtual com::sun::star::uno::Reference< com::sun::star::io::XInputStream > + GET( const ::rtl::OUString & inPath, + const DAVRequestEnvironment & rEnv ) + throw ( DAVException ); + + virtual void + GET( const ::rtl::OUString & inPath, + com::sun::star::uno::Reference< + com::sun::star::io::XOutputStream > & ioOutputStream, + const DAVRequestEnvironment & rEnv ) + throw ( DAVException ); + + virtual com::sun::star::uno::Reference< com::sun::star::io::XInputStream > + GET( const ::rtl::OUString & inPath, + const std::vector< ::rtl::OUString > & inHeaderNames, + DAVResource & ioResource, + const DAVRequestEnvironment & rEnv ) + throw ( DAVException ); + + virtual void + GET( const ::rtl::OUString & inPath, + com::sun::star::uno::Reference< + com::sun::star::io::XOutputStream > & ioOutputStream, + const std::vector< ::rtl::OUString > & inHeaderNames, + DAVResource & ioResource, + const DAVRequestEnvironment & rEnv ) + throw ( DAVException ); + + virtual void + PUT( const ::rtl::OUString & inPath, + const com::sun::star::uno::Reference< + com::sun::star::io::XInputStream > & inInputStream, + const DAVRequestEnvironment & rEnv ) + throw ( DAVException ); + + virtual com::sun::star::uno::Reference< com::sun::star::io::XInputStream > + POST( const rtl::OUString & inPath, + const rtl::OUString & rContentType, + const rtl::OUString & rReferer, + const com::sun::star::uno::Reference< + com::sun::star::io::XInputStream > & inInputStream, + const DAVRequestEnvironment & rEnv ) + throw ( DAVException ); + + virtual void + POST( const rtl::OUString & inPath, + const rtl::OUString & rContentType, + const rtl::OUString & rReferer, + const com::sun::star::uno::Reference< + com::sun::star::io::XInputStream > & inInputStream, + com::sun::star::uno::Reference< + com::sun::star::io::XOutputStream > & oOutputStream, + const DAVRequestEnvironment & rEnv ) + throw ( DAVException ); + + virtual void + MKCOL( const ::rtl::OUString & inPath, + const DAVRequestEnvironment & rEnv ) + throw ( DAVException ); + + virtual void + COPY( const ::rtl::OUString & inSourceURL, + const ::rtl::OUString & inDestinationURL, + const DAVRequestEnvironment & rEnv, + sal_Bool inOverWrite ) + throw ( DAVException ); + + virtual void + MOVE( const ::rtl::OUString & inSourceURL, + const ::rtl::OUString & inDestinationURL, + const DAVRequestEnvironment & rEnv, + sal_Bool inOverWrite ) + throw ( DAVException ); + + virtual void DESTROY( const ::rtl::OUString & inPath, + const DAVRequestEnvironment & rEnv ) + throw ( DAVException ); + + // set new lock. + virtual void LOCK( const ::rtl::OUString & inURL, + com::sun::star::ucb::Lock & inLock, + const DAVRequestEnvironment & rEnv ) + throw ( DAVException ); + + // refresh existing lock. + virtual sal_Int64 LOCK( const ::rtl::OUString & inURL, + sal_Int64 nTimeout, + const DAVRequestEnvironment & rEnv ) + throw ( DAVException ); + + virtual void UNLOCK( const ::rtl::OUString & inURL, + const DAVRequestEnvironment & rEnv ) + throw ( DAVException ); + + // helpers + virtual void abort() + throw ( DAVException ); + + const rtl::OUString & getHostName() const { return m_aHostName; } + + const ::uno::Reference< ::lang::XMultiServiceFactory > getMSF() + { return m_xFactory->getServiceFactory(); } + + const void * getRequestData() const { return m_pRequestData; } + + sal_Bool isDomainMatch( rtl::OUString certHostName ); + +private: + friend class NeonLockStore; + + void Init( void ) + throw ( DAVException ); + + void Init( const DAVRequestEnvironment & rEnv ) + throw ( DAVException ); + + // ret: true => retry request. + void HandleError( int nError, + const rtl::OUString & inPath, + const DAVRequestEnvironment & rEnv ) + throw ( DAVException ); + + const ucbhelper::InternetProxyServer & getProxySettings() const; + + bool removeExpiredLocktoken( const rtl::OUString & inURL, + const DAVRequestEnvironment & rEnv ); + + // refresh lock, called by NeonLockStore::refreshLocks + bool LOCK( NeonLock * pLock, + sal_Int32 & rlastChanceToSendRefreshRequest ); + + // unlock, called by NeonLockStore::~NeonLockStore + bool UNLOCK( NeonLock * pLock ); + + // low level GET implementation, used by public GET implementations + static int GET( ne_session * sess, + const char * uri, + ne_block_reader reader, + bool getheaders, + void * userdata ); + + // Buffer-based PUT implementation. Neon only has file descriptor- + // based API. + static int PUT( ne_session * sess, + const char * uri, + const char * buffer, + size_t size ); + + // Buffer-based POST implementation. Neon only has file descriptor- + // based API. + int POST( ne_session * sess, + const char * uri, + const char * buffer, + ne_block_reader reader, + void * userdata, + const rtl::OUString & rContentType, + const rtl::OUString & rReferer ); + + // Helper: XInputStream -> Sequence< sal_Int8 > + static bool getDataFromInputStream( + const com::sun::star::uno::Reference< + com::sun::star::io::XInputStream > & xStream, + com::sun::star::uno::Sequence< sal_Int8 > & rData, + bool bAppendTrailingZeroByte ); + + rtl::OUString makeAbsoluteURL( rtl::OUString const & rURL ) const; }; -} // namespace_ucp +} // namespace webdav_ucp #endif // _NEONSESSION_HXX_ diff --git a/ucb/source/ucp/webdav/NeonTypes.hxx b/ucb/source/ucp/webdav/NeonTypes.hxx index 2e97af4c963b..939e25d3812d 100644 --- a/ucb/source/ucp/webdav/NeonTypes.hxx +++ b/ucb/source/ucp/webdav/NeonTypes.hxx @@ -35,6 +35,7 @@ #include #include #include +#include typedef ne_session HttpSession; typedef ne_status HttpStatus; @@ -43,4 +44,6 @@ typedef ne_server_capabilities HttpServerCapabilities; typedef ne_propname NeonPropName; typedef ne_prop_result_set NeonPropFindResultSet; +typedef struct ne_lock NeonLock; + #endif // _NEONTYPES_HXX_ diff --git a/ucb/source/ucp/webdav/NeonUri.cxx b/ucb/source/ucp/webdav/NeonUri.cxx index 5c49179f6b20..97fdeb40bcc7 100644 --- a/ucb/source/ucp/webdav/NeonUri.cxx +++ b/ucb/source/ucp/webdav/NeonUri.cxx @@ -42,11 +42,6 @@ using namespace webdav_ucp; - char *scheme; - char *host, *userinfo; - unsigned int port; - char *path, *query, *fragment; - # if defined __SUNPRO_CC // FIXME: not sure whether initializing a ne_uri statically is supposed to work // the string fields of ne_uri are char*, not const char* diff --git a/ucb/source/ucp/webdav/makefile.mk b/ucb/source/ucp/webdav/makefile.mk index c8891723cd2c..1b4265a74559 100644 --- a/ucb/source/ucp/webdav/makefile.mk +++ b/ucb/source/ucp/webdav/makefile.mk @@ -87,25 +87,26 @@ CFLAGS+= $(OPENSSL_CFLAGS) # --- General ----------------------------------------------------- SLOFILES=\ - $(SLO)$/webdavservices.obj \ - $(SLO)$/webdavprovider.obj \ - $(SLO)$/webdavcontent.obj \ - $(SLO)$/webdavcontentcaps.obj \ - $(SLO)$/webdavresultset.obj \ - $(SLO)$/webdavdatasupplier.obj \ - $(SLO)$/ContentProperties.obj \ - $(SLO)$/DAVProperties.obj \ - $(SLO)$/DAVSessionFactory.obj \ - $(SLO)$/DAVResourceAccess.obj \ - $(SLO)$/NeonUri.obj \ - $(SLO)$/NeonInputStream.obj \ - $(SLO)$/NeonPropFindRequest.obj \ - $(SLO)$/NeonHeadRequest.obj \ - $(SLO)$/NeonSession.obj \ - $(SLO)$/DateTimeHelper.obj \ - $(SLO)$/LinkSequence.obj \ - $(SLO)$/LockSequence.obj \ - $(SLO)$/LockEntrySequence.obj \ + $(SLO)$/webdavservices.obj \ + $(SLO)$/webdavprovider.obj \ + $(SLO)$/webdavcontent.obj \ + $(SLO)$/webdavcontentcaps.obj \ + $(SLO)$/webdavresultset.obj \ + $(SLO)$/webdavdatasupplier.obj \ + $(SLO)$/ContentProperties.obj \ + $(SLO)$/DAVProperties.obj \ + $(SLO)$/DAVSessionFactory.obj \ + $(SLO)$/DAVResourceAccess.obj \ + $(SLO)$/NeonUri.obj \ + $(SLO)$/NeonInputStream.obj \ + $(SLO)$/NeonPropFindRequest.obj \ + $(SLO)$/NeonHeadRequest.obj \ + $(SLO)$/NeonSession.obj \ + $(SLO)$/NeonLockStore.obj \ + $(SLO)$/DateTimeHelper.obj \ + $(SLO)$/LinkSequence.obj \ + $(SLO)$/LockSequence.obj \ + $(SLO)$/LockEntrySequence.obj \ $(SLO)$/UCBDeadPropertyValue.obj LIB1TARGET=$(SLB)$/_$(TARGET).lib @@ -119,13 +120,13 @@ SHL1IMPLIB=i$(TARGET) SHL1VERSIONMAP=exports.map SHL1STDLIBS=\ - $(CPPUHELPERLIB) \ - $(CPPULIB) \ - $(SALLIB) \ - $(SALHELPERLIB) \ - $(UCBHELPERLIB) \ - $(COMPHELPERLIB) \ - $(NEON3RDLIB) \ + $(CPPUHELPERLIB) \ + $(CPPULIB) \ + $(SALLIB) \ + $(SALHELPERLIB) \ + $(UCBHELPERLIB) \ + $(COMPHELPERLIB) \ + $(NEON3RDLIB) \ $(LIBXML2LIB) @@ -165,4 +166,3 @@ DEF1NAME=$(SHL1TARGET) # --- Targets ---------------------------------------------------------- .INCLUDE: target.mk - diff --git a/ucb/source/ucp/webdav/webdavcontent.cxx b/ucb/source/ucp/webdav/webdavcontent.cxx index afe2f2d3a7a8..ae6623ff4492 100644 --- a/ucb/source/ucp/webdav/webdavcontent.cxx +++ b/ucb/source/ucp/webdav/webdavcontent.cxx @@ -54,14 +54,13 @@ #include #include #include -#ifndef _COM_SUN_STAR_UCB_INTERACTIVEBADTRANSFRERURLEXCEPTION_HPP_ #include -#endif #include +#include "com/sun/star/ucb/InteractiveLockingLockedException.hpp" +#include "com/sun/star/ucb/InteractiveLockingLockExpiredException.hpp" +#include "com/sun/star/ucb/InteractiveLockingNotLockedException.hpp" #include -#ifndef _COM_SUN_STAR_UCB_INTERACTIVENETWORKGENBERALEXCEPTION_HPP_ #include -#endif #include #include #include @@ -137,7 +136,6 @@ public: throw (uno::RuntimeException); private: - void handleAuthenticationRequest( ucb::AuthenticationRequest const&, @@ -190,52 +188,34 @@ void SAL_CALL CommandEnvironment_Impl::handle( return; uno::Sequence< uno::Reference< task::XInteractionContinuation > > - rContinuations = rIRequest->getContinuations(); + rContinuations = rIRequest->getContinuations(); - // get continuations - uno::Reference< task::XInteractionRetry > xRetry; - uno::Reference< task::XInteractionAbort > xAbort; uno::Reference< ucb::XInteractionSupplyAuthentication > - xSupplyAuthentication; - - for (sal_Int32 i = 0; i < rContinuations.getLength(); ++i) { - xRetry = uno::Reference< task::XInteractionRetry >( - rContinuations[i], uno::UNO_QUERY ); - if( xRetry.is() ) - continue; - - xAbort = uno::Reference< task::XInteractionAbort >( - rContinuations[i], uno::UNO_QUERY ); - if (xAbort.is()) - continue; + xSupplyAuthentication; + for (sal_Int32 i = 0; i < rContinuations.getLength(); ++i) + { xSupplyAuthentication = uno::Reference< ucb::XInteractionSupplyAuthentication >( rContinuations[i], uno::UNO_QUERY ); if( xSupplyAuthentication.is() ) - continue; + break; } - bool bRemember; - bool bRememberPersistent; - if (xSupplyAuthentication.is()) - { - ucb::RememberAuthentication eDefault; - uno::Sequence< ucb::RememberAuthentication > aModes( - xSupplyAuthentication->getRememberPasswordModes(eDefault)); - bRemember = eDefault != ucb::RememberAuthentication_NO; - bRememberPersistent = false; - for (sal_Int32 i = 0; i < aModes.getLength(); ++i) - if (aModes[i] == ucb::RememberAuthentication_PERSISTENT) - { - bRememberPersistent = true; - break; - } - } - else + if (!xSupplyAuthentication.is()) + return; + + ucb::RememberAuthentication eDefault; + uno::Sequence< ucb::RememberAuthentication > aModes( + xSupplyAuthentication->getRememberPasswordModes(eDefault)); + bool bRememberPersistent = false; + for (sal_Int32 i = 0; i < aModes.getLength(); ++i) { - bRemember = false; - bRememberPersistent = false; + if (aModes[i] == ucb::RememberAuthentication_PERSISTENT) + { + bRememberPersistent = true; + break; + } } uno::Reference< task::XPasswordContainer > xContainer; @@ -334,7 +314,6 @@ void SAL_CALL CommandEnvironment_Impl::handle( catch (task::NoMasterException const &) {} // user did not enter master password } - return; } //========================================================================= @@ -630,17 +609,20 @@ uno::Any SAL_CALL Content::execute( ucb::CommandAbortedException, uno::RuntimeException ) { + OSL_TRACE( "Content::execute: start %s", + rtl::OUStringToOString( aCommand.Name, + RTL_TEXTENCODING_UTF8 ).getStr() ); uno::Any aRet; if ( aCommand.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "getPropertyValues" ) ) ) { - ////////////////////////////////////////////////////////////////// - // getPropertyValues - ////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////// + // getPropertyValues + ////////////////////////////////////////////////////////////////// uno::Sequence< beans::Property > Properties; - if ( !( aCommand.Argument >>= Properties ) ) + if ( !( aCommand.Argument >>= Properties ) ) { ucbhelper::cancelCommandExecution( uno::makeAny( lang::IllegalArgumentException( @@ -652,17 +634,17 @@ uno::Any SAL_CALL Content::execute( // Unreachable } - aRet <<= getPropertyValues( Properties, Environment ); + aRet <<= getPropertyValues( Properties, Environment ); } else if ( aCommand.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "setPropertyValues" ) ) ) { - ////////////////////////////////////////////////////////////////// - // setPropertyValues - ////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////// + // setPropertyValues + ////////////////////////////////////////////////////////////////// uno::Sequence< beans::PropertyValue > aProperties; - if ( !( aCommand.Argument >>= aProperties ) ) + if ( !( aCommand.Argument >>= aProperties ) ) { ucbhelper::cancelCommandExecution( uno::makeAny( lang::IllegalArgumentException( @@ -674,7 +656,7 @@ uno::Any SAL_CALL Content::execute( // Unreachable } - if ( !aProperties.getLength() ) + if ( !aProperties.getLength() ) { ucbhelper::cancelCommandExecution( uno::makeAny( lang::IllegalArgumentException( @@ -713,8 +695,8 @@ uno::Any SAL_CALL Content::execute( RTL_CONSTASCII_STRINGPARAM( "open" ) ) ) { ////////////////////////////////////////////////////////////////// - // open - ////////////////////////////////////////////////////////////////// + // open + ////////////////////////////////////////////////////////////////// ucb::OpenCommandArgument2 aOpenCommand; if ( !( aCommand.Argument >>= aOpenCommand ) ) @@ -735,11 +717,11 @@ uno::Any SAL_CALL Content::execute( RTL_CONSTASCII_STRINGPARAM( "insert" ) ) ) { ////////////////////////////////////////////////////////////////// - // insert - ////////////////////////////////////////////////////////////////// + // insert + ////////////////////////////////////////////////////////////////// ucb::InsertCommandArgument arg; - if ( !( aCommand.Argument >>= arg ) ) + if ( !( aCommand.Argument >>= arg ) ) { ucbhelper::cancelCommandExecution( uno::makeAny( lang::IllegalArgumentException( @@ -751,23 +733,23 @@ uno::Any SAL_CALL Content::execute( // Unreachable } - insert( arg.Data, arg.ReplaceExisting, Environment ); + insert( arg.Data, arg.ReplaceExisting, Environment ); } else if ( aCommand.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "delete" ) ) ) { - ////////////////////////////////////////////////////////////////// - // delete - ////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////// + // delete + ////////////////////////////////////////////////////////////////// - sal_Bool bDeletePhysical = sal_False; - aCommand.Argument >>= bDeletePhysical; + sal_Bool bDeletePhysical = sal_False; + aCommand.Argument >>= bDeletePhysical; // KSO: Ignore parameter and destroy the content, if you don't support // putting objects into trashcan. ( Since we do not have a trash can // service yet (src603), you actually have no other choice. ) // if ( bDeletePhysical ) -// { +// { try { std::auto_ptr< DAVResourceAccess > xResAccess; @@ -823,7 +805,7 @@ uno::Any SAL_CALL Content::execute( { ////////////////////////////////////////////////////////////////// // post - ////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////// ucb::PostCommandArgument2 aArg; if ( !( aCommand.Argument >>= aArg ) ) @@ -840,20 +822,44 @@ uno::Any SAL_CALL Content::execute( post( aArg, Environment ); } + else if ( aCommand.Name.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM( "lock" ) ) && + supportsExclusiveWriteLock( Environment ) ) + { + ////////////////////////////////////////////////////////////////// + // lock + ////////////////////////////////////////////////////////////////// + + lock( Environment ); + } + else if ( aCommand.Name.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM( "unlock" ) ) && + supportsExclusiveWriteLock( Environment ) ) + { + ////////////////////////////////////////////////////////////////// + // unlock + ////////////////////////////////////////////////////////////////// + + unlock( Environment ); + } else { - ////////////////////////////////////////////////////////////////// - // Unsupported command - ////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////// + // Unsupported command + ////////////////////////////////////////////////////////////////// ucbhelper::cancelCommandExecution( uno::makeAny( ucb::UnsupportedCommandException( - rtl::OUString(), - static_cast< cppu::OWeakObject * >( this ) ) ), + aCommand.Name, + static_cast< cppu::OWeakObject * >( this ) ) ), Environment ); // Unreachable } + OSL_TRACE( "Content::execute: end %s", + rtl::OUStringToOString( aCommand.Name, + RTL_TEXTENCODING_UTF8 ).getStr() ); + return aRet; } @@ -863,19 +869,22 @@ void SAL_CALL Content::abort( sal_Int32 /*CommandId*/ ) throw( uno::RuntimeException ) { try + { + std::auto_ptr< DAVResourceAccess > xResAccess; { - std::auto_ptr< DAVResourceAccess > xResAccess; - { - osl::MutexGuard aGuard( m_aMutex ); - xResAccess.reset( - new DAVResourceAccess( *m_xResAccess.get() ) ); - } - xResAccess->ABORT(); + osl::MutexGuard aGuard( m_aMutex ); + xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) ); } - catch ( DAVException const & /*e*/ ) + xResAccess->abort(); { - // ABORT command failed! + osl::Guard< osl::Mutex > aGuard( m_aMutex ); + m_xResAccess.reset( new DAVResourceAccess( *xResAccess.get() ) ); } + } + catch ( DAVException const & ) + { + // abort failed! + } } //========================================================================= @@ -893,8 +902,8 @@ void SAL_CALL Content::addProperty( const rtl::OUString& Name, lang::IllegalArgumentException, uno::RuntimeException ) { -// if ( m_bTransient ) -// @@@ ??? +// if ( m_bTransient ) +// @@@ ??? if ( !Name.getLength() ) throw lang::IllegalArgumentException(); @@ -902,8 +911,8 @@ void SAL_CALL Content::addProperty( const rtl::OUString& Name, // Check property type. if ( !UCBDeadPropertyValue::supportsType( DefaultValue.getValueType() ) ) { - OSL_ENSURE( sal_False, "Content::addProperty - " - "Unsupported property type!" ); + OSL_ENSURE( sal_False, + "Content::addProperty - Unsupported property type!" ); throw beans::IllegalTypeException(); } @@ -950,10 +959,10 @@ void SAL_CALL Content::addProperty( const rtl::OUString& Name, // Notify propertyset info change listeners. beans::PropertySetInfoChangeEvent evt( - static_cast< cppu::OWeakObject * >( this ), - Name, - -1, // No handle available - beans::PropertySetInfoChange::PROPERTY_INSERTED ); + static_cast< cppu::OWeakObject * >( this ), + Name, + -1, // No handle available + beans::PropertySetInfoChange::PROPERTY_INSERTED ); notifyPropertySetInfoChange( evt ); } catch ( DAVException const & e ) @@ -1029,7 +1038,7 @@ void SAL_CALL Content::removeProperty( const rtl::OUString& Name ) { beans::Property aProp = getPropertySetInfo( xEnv, sal_False /* don't cache data */ ) - ->getPropertyByName( Name ); + ->getPropertyByName( Name ); if ( !( aProp.Attributes & beans::PropertyAttribute::REMOVEABLE ) ) { @@ -1039,7 +1048,7 @@ void SAL_CALL Content::removeProperty( const rtl::OUString& Name ) } catch ( beans::UnknownPropertyException const & ) { -// OSL_ENSURE( sal_False, "removeProperty - Unknown property!" ); + //OSL_ENSURE( sal_False, "removeProperty - Unknown property!" ); throw; } #endif @@ -1270,7 +1279,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( const rtl::Reference< ::ucbhelper::ContentProviderImplHelper >& rProvider, const rtl::OUString& rContentId ) { - // Note: Empty sequence means "get values of all supported properties". + // Note: Empty sequence means "get values of all supported properties". rtl::Reference< ::ucbhelper::PropertyValueSet > xRow = new ::ucbhelper::PropertyValueSet( rSMgr ); @@ -1279,10 +1288,10 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( if ( nCount ) { uno::Reference< beans::XPropertySet > xAdditionalPropSet; - sal_Bool bTriedToGetAdditonalPropSet = sal_False; + sal_Bool bTriedToGetAdditonalPropSet = sal_False; const beans::Property* pProps = rProperties.getConstArray(); - for ( sal_Int32 n = 0; n < nCount; ++n ) + for ( sal_Int32 n = 0; n < nCount; ++n ) { const beans::Property& rProp = pProps[ n ]; @@ -1338,9 +1347,9 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( // Append all local Additional Properties. uno::Reference< beans::XPropertySet > xSet( - rProvider->getAdditionalPropertySet( rContentId, sal_False ), - uno::UNO_QUERY ); - xRow->appendPropertySet( xSet ); + rProvider->getAdditionalPropertySet( rContentId, sal_False ), + uno::UNO_QUERY ); + xRow->appendPropertySet( xSet ); } return uno::Reference< sdbc::XRow >( xRow.get() ); @@ -1400,15 +1409,19 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( if ( DAV == rType ) { - // cache lookup... getResourceType may fill the props cache via PROPFIND! + // cache lookup... getResourceType may fill the props cache via + // PROPFIND! if ( m_xCachedProps.get() ) { - xCachedProps.reset( new ContentProperties( *m_xCachedProps.get() ) ); + xCachedProps.reset( + new ContentProperties( *m_xCachedProps.get() ) ); std::vector< rtl::OUString > aMissingProps; - if ( xCachedProps->containsAllNames( rProperties, aMissingProps ) ) + if ( xCachedProps->containsAllNames( + rProperties, aMissingProps ) ) { - // All properties are already in cache! No server access needed. + // All properties are already in cache! No server access + // needed. bHasAll = true; } @@ -1421,7 +1434,8 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( // Only DAV resources support PROPFIND std::vector< rtl::OUString > aPropNames; - uno::Sequence< beans::Property > aProperties( rProperties.getLength() ); + uno::Sequence< beans::Property > aProperties( + rProperties.getLength() ); if ( m_aFailedPropNames.size() > 0 ) { @@ -1474,7 +1488,8 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( { if ( xProps.get()) xProps->addProperties( - aPropNames, ContentProperties( resources[ 0 ] )); + aPropNames, + ContentProperties( resources[ 0 ] )); else xProps.reset( new ContentProperties( resources[ 0 ] ) ); @@ -1483,7 +1498,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( catch ( DAVException const & e ) { bNetworkAccessAllowed - = shouldAccessNetworkAfterException( e ); + = shouldAccessNetworkAfterException( e ); if ( !bNetworkAccessAllowed ) { @@ -1523,16 +1538,16 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( if ( xProps.get() ) xProps->addProperties( - aMissingProps, - ContentProperties( resource ) ); + aMissingProps, + ContentProperties( resource ) ); else xProps.reset ( new ContentProperties( resource ) ); if ( m_eResourceType == NON_DAV ) xProps->addProperties( aMissingProps, ContentProperties( - aEscapedTitle, - false ) ); + aEscapedTitle, + false ) ); } catch ( DAVException const & e ) { @@ -1548,15 +1563,15 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( } } } + // might trigger HTTP redirect. - // Therefore, title must be upadated here. + // Therefore, title must be updated here. NeonUri aUri( xResAccess->getURL() ); aEscapedTitle = aUri.GetPathBaseName(); if ( UNKNOWN == rType ) { - xProps.reset( - new ContentProperties( aEscapedTitle ) ); + xProps.reset( new ContentProperties( aEscapedTitle ) ); } // For DAV resources we only know the Title, for non-DAV @@ -1565,31 +1580,29 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( { //xProps.reset( // new ContentProperties( aEscapedTitle ) ); - xProps->addProperty( rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "Title" )), - uno::makeAny( aEscapedTitle), true); + xProps->addProperty( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) ), + uno::makeAny( aEscapedTitle ), + true ); } else { if ( !xProps.get() ) - xProps.reset( - new ContentProperties( aEscapedTitle, false ) ); + xProps.reset( new ContentProperties( aEscapedTitle, false ) ); else - xProps->addProperty( rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "Title" )), - uno::makeAny( aEscapedTitle), true); - - xProps->addProperty( rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "IsFolder" )), - uno::makeAny( false), true); - xProps->addProperty( rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "IsDocument" )), - uno::makeAny( true), true); + xProps->addProperty( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) ), + uno::makeAny( aEscapedTitle ), + true ); + xProps->addProperty( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsFolder" ) ), + uno::makeAny( false ), + true ); + xProps->addProperty( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsDocument" ) ), + uno::makeAny( true ), + true ); } } else @@ -1603,14 +1616,12 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( // Add BaseURI property, if requested. if ( !xProps->contains( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "BaseURI" ) ) ) ) + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "BaseURI" ) ) ) ) { - xProps->addProperty( rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "BaseURI" ) ), - uno::makeAny( - getBaseURI( xResAccess ) ), - true ); + xProps->addProperty( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "BaseURI" ) ), + uno::makeAny( getBaseURI( xResAccess ) ), + true ); } uno::Reference< sdbc::XRow > xResultRow @@ -1663,7 +1674,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( beans::PropertyChangeEvent aEvent; aEvent.Source = static_cast< cppu::OWeakObject * >( this ); - aEvent.Further = sal_False; + aEvent.Further = sal_False; // aEvent.PropertyName = aEvent.PropertyHandle = -1; // aEvent.OldValue = @@ -1724,7 +1735,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( static_cast< cppu::OWeakObject * >( this ) ); } else if ( rName.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "IsFolder" ) ) ) + RTL_CONSTASCII_STRINGPARAM( "IsFolder" ) ) ) { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( @@ -2035,7 +2046,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( aEvent.OldValue = uno::makeAny( aOldTitle ); aEvent.NewValue = uno::makeAny( aNewTitle ); - m_aEscapedTitle = NeonUri::escapeSegment( aNewTitle ); + m_aEscapedTitle = NeonUri::escapeSegment( aNewTitle ); aChanges.getArray()[ nChanged ] = aEvent; nChanged++; @@ -2043,8 +2054,8 @@ uno::Sequence< uno::Any > Content::setPropertyValues( if ( nChanged > 0 ) { - aChanges.realloc( nChanged ); - notifyPropertiesChange( aChanges ); + aChanges.realloc( nChanged ); + notifyPropertiesChange( aChanges ); } { @@ -2150,7 +2161,8 @@ uno::Any Content::open( // cache headers. if ( !m_xCachedProps.get()) - m_xCachedProps.reset( new ContentProperties( aResource ) ); + m_xCachedProps.reset( + new ContentProperties( aResource ) ); else m_xCachedProps->addProperties( aResource ); @@ -2195,9 +2207,11 @@ uno::Any Content::open( // cache headers. if ( !m_xCachedProps.get()) - m_xCachedProps.reset( new ContentProperties( aResource ) ); + m_xCachedProps.reset( + new ContentProperties( aResource ) ); else - m_xCachedProps->addProperties( aResource.properties ); + m_xCachedProps->addProperties( + aResource.properties ); m_xResAccess.reset( new DAVResourceAccess( *xResAccess.get() ) ); @@ -2407,17 +2421,17 @@ void Content::insert( { /* [RFC 2616] - HTTP - The PUT method requests that the enclosed entity be stored under the - supplied Request-URI. If the Request-URI refers to an already - existing resource, the enclosed entity SHOULD be considered as a - modified version of the one residing on the origin server. + The PUT method requests that the enclosed entity be stored under the + supplied Request-URI. If the Request-URI refers to an already + existing resource, the enclosed entity SHOULD be considered as a + modified version of the one residing on the origin server. */ /* [RFC 2518] - WebDAV - MKCOL creates a new collection resource at the location specified by - the Request-URI. If the resource identified by the Request-URI is - non-null then the MKCOL MUST fail. + MKCOL creates a new collection resource at the location specified by + the Request-URI. If the resource identified by the Request-URI is + non-null then the MKCOL MUST fail. */ // ==> Complain on PUT, continue on MKCOL. @@ -2886,6 +2900,99 @@ void Content::destroy( sal_Bool bDeletePhysical ) } } +//========================================================================= +bool Content::supportsExclusiveWriteLock( + const uno::Reference< ucb::XCommandEnvironment >& Environment ) +{ + if ( getResourceType( Environment ) == DAV ) + { + if ( m_xCachedProps.get() ) + { + uno::Sequence< ucb::LockEntry > aSupportedLocks; + if ( m_xCachedProps->getValue( DAVProperties::SUPPORTEDLOCK ) + >>= aSupportedLocks ) + { + for ( sal_Int32 n = 0; n < aSupportedLocks.getLength(); ++n ) + { + if ( aSupportedLocks[ n ].Scope + == ucb::LockScope_EXCLUSIVE && + aSupportedLocks[ n ].Type + == ucb::LockType_WRITE ) + return true; + } + } + } + } + return false; +} + +//========================================================================= +void Content::lock( + const uno::Reference< ucb::XCommandEnvironment >& Environment ) + throw( uno::Exception ) +{ + try + { + std::auto_ptr< DAVResourceAccess > xResAccess; + { + osl::Guard< osl::Mutex > aGuard( m_aMutex ); + xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) ); + } + + uno::Any aOwnerAny; + aOwnerAny + <<= rtl::OUString::createFromAscii( "http://ucb.openoffice.org" ); + + ucb::Lock aLock( + ucb::LockScope_EXCLUSIVE, + ucb::LockType_WRITE, + ucb::LockDepth_ZERO, + aOwnerAny, + 180, // lock timeout in secs + //-1, // infinite lock + uno::Sequence< ::rtl::OUString >() ); + + xResAccess->LOCK( aLock, Environment ); + + { + osl::Guard< osl::Mutex > aGuard( m_aMutex ); + m_xResAccess.reset( new DAVResourceAccess( *xResAccess.get() ) ); + } + } + catch ( DAVException const & e ) + { + cancelCommandExecution( e, Environment, sal_False ); + // Unreachable + } +} + +//========================================================================= +void Content::unlock( + const uno::Reference< ucb::XCommandEnvironment >& Environment ) + throw( uno::Exception ) +{ + try + { + std::auto_ptr< DAVResourceAccess > xResAccess; + { + osl::Guard< osl::Mutex > aGuard( m_aMutex ); + xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) ); + } + + xResAccess->UNLOCK( Environment ); + + { + osl::Guard< osl::Mutex > aGuard( m_aMutex ); + m_xResAccess.reset( new DAVResourceAccess( *xResAccess.get() ) ); + } + } + catch ( DAVException const & e ) + { + cancelCommandExecution( e, Environment, sal_False ); + // Unreachable + } +} + //========================================================================= sal_Bool Content::exchangeIdentity( const uno::Reference< ucb::XContentIdentifier >& xNewId ) @@ -2936,9 +3043,9 @@ sal_Bool Content::exchangeIdentity( 0, aOldURL.getLength(), xNewId->getContentIdentifier() ); - uno::Reference< ucb::XContentIdentifier > - xNewChildId - = new ::ucbhelper::ContentIdentifier( m_xSMgr, aNewChildURL ); + uno::Reference< ucb::XContentIdentifier > xNewChildId + = new ::ucbhelper::ContentIdentifier( + m_xSMgr, aNewChildURL ); if ( !xChild->exchangeIdentity( xNewChildId ) ) return sal_False; @@ -3010,7 +3117,6 @@ uno::Any Content::MapDAVException( const DAVException & e, sal_Bool bWrite ) aArgs ); return aException; } - default: break; } @@ -3022,14 +3128,14 @@ uno::Any Content::MapDAVException( const DAVException & e, sal_Bool bWrite ) if ( bWrite ) aException <<= ucb::InteractiveNetworkWriteException( - rtl::OUString(), + e.getData(), static_cast< cppu::OWeakObject * >( this ), task::InteractionClassification_ERROR, e.getData() ); else aException <<= ucb::InteractiveNetworkReadException( - rtl::OUString(), + e.getData(), static_cast< cppu::OWeakObject * >( this ), task::InteractionClassification_ERROR, e.getData() ); @@ -3046,12 +3152,12 @@ uno::Any Content::MapDAVException( const DAVException & e, sal_Bool bWrite ) break; // @@@ No matching InteractiveNetwork*Exception -// case DAVException::DAV_HTTP_AUTH: -// break; +// case DAVException::DAV_HTTP_AUTH: +// break; // @@@ No matching InteractiveNetwork*Exception -// case DAVException::DAV_HTTP_AUTHPROXY: -// break; +// case DAVException::DAV_HTTP_AUTHPROXY: +// break; case DAVException::DAV_HTTP_CONNECT: aException <<= @@ -3063,16 +3169,16 @@ uno::Any Content::MapDAVException( const DAVException & e, sal_Bool bWrite ) break; // @@@ No matching InteractiveNetwork*Exception -// case DAVException::DAV_HTTP_TIMEOUT: -// break; +// case DAVException::DAV_HTTP_TIMEOUT: +// break; // @@@ No matching InteractiveNetwork*Exception -// case DAVException::DAV_HTTP_REDIRECT: -// break; +// case DAVException::DAV_HTTP_REDIRECT: +// break; // @@@ No matching InteractiveNetwork*Exception -// case DAVException::DAV_SESSION_CREATE: -// break; +// case DAVException::DAV_SESSION_CREATE: +// break; case DAVException::DAV_INVALID_ARG: aException <<= @@ -3082,6 +3188,62 @@ uno::Any Content::MapDAVException( const DAVException & e, sal_Bool bWrite ) -1 ); break; + case DAVException::DAV_LOCKED: +#if 1 + aException <<= + ucb::InteractiveLockingLockedException( + rtl::OUString::createFromAscii( "Locked!" ), + static_cast< cppu::OWeakObject * >( this ), + task::InteractionClassification_ERROR, + m_xIdentifier->getContentIdentifier(), + sal_True ); +#else + { + uno::Sequence< uno::Any > aArgs( 1 ); + aArgs[ 0 ] <<= beans::PropertyValue( + rtl::OUString::createFromAscii("Uri"), -1, + uno::makeAny(m_xIdentifier->getContentIdentifier()), + beans::PropertyState_DIRECT_VALUE); + + aException <<= + ucb::InteractiveAugmentedIOException( + rtl::OUString::createFromAscii( "Locked!" ), + static_cast< cppu::OWeakObject * >( this ), + task::InteractionClassification_ERROR, + ucb::IOErrorCode_LOCKING_VIOLATION, + aArgs ); + } +#endif + break; + + case DAVException::DAV_LOCKED_SELF: + aException <<= + ucb::InteractiveLockingLockedException( + rtl::OUString::createFromAscii( "Locked (self)!" ), + static_cast< cppu::OWeakObject * >( this ), + task::InteractionClassification_ERROR, + m_xIdentifier->getContentIdentifier(), + sal_True ); + break; + + case DAVException::DAV_NOT_LOCKED: + aException <<= + ucb::InteractiveLockingNotLockedException( + rtl::OUString::createFromAscii( "Not locked!" ), + static_cast< cppu::OWeakObject * >( this ), + task::InteractionClassification_ERROR, + m_xIdentifier->getContentIdentifier() ); + break; + + case DAVException::DAV_LOCK_EXPIRED: + aException <<= + ucb::InteractiveLockingLockExpiredException( + rtl::OUString::createFromAscii( "Lock expired!" ), + static_cast< cppu::OWeakObject * >( this ), + task::InteractionClassification_ERROR, + m_xIdentifier->getContentIdentifier() ); + break; + default: aException <<= ucb::InteractiveNetworkGeneralException( @@ -3120,7 +3282,8 @@ void Content::cancelCommandExecution( } //========================================================================= -const rtl::OUString Content::getBaseURI( const std::auto_ptr< DAVResourceAccess > & rResAccess ) +const rtl::OUString +Content::getBaseURI( const std::auto_ptr< DAVResourceAccess > & rResAccess ) { osl::Guard< osl::Mutex > aGuard( m_aMutex ); @@ -3181,11 +3344,17 @@ const Content::ResourceType & Content::getResourceType( // this is a DAV resource. std::vector< DAVResource > resources; std::vector< rtl::OUString > aPropNames; - uno::Sequence< beans::Property > aProperties( 4 ); - aProperties[ 0 ].Name = rtl::OUString::createFromAscii( "IsFolder" ); - aProperties[ 1 ].Name = rtl::OUString::createFromAscii( "IsDocument" ); - aProperties[ 2 ].Name = rtl::OUString::createFromAscii( "IsReadOnly" ); - aProperties[ 3 ].Name = rtl::OUString::createFromAscii( "MediaType" ); + uno::Sequence< beans::Property > aProperties( 5 ); + aProperties[ 0 ].Name + = rtl::OUString::createFromAscii( "IsFolder" ); + aProperties[ 1 ].Name + = rtl::OUString::createFromAscii( "IsDocument" ); + aProperties[ 2 ].Name + = rtl::OUString::createFromAscii( "IsReadOnly" ); + aProperties[ 3 ].Name + = rtl::OUString::createFromAscii( "MediaType" ); + aProperties[ 4 ].Name + = DAVProperties::SUPPORTEDLOCK; ContentProperties::UCBNamesToDAVNames( aProperties, aPropNames ); @@ -3195,16 +3364,19 @@ const Content::ResourceType & Content::getResourceType( if ( resources.size() == 1 ) { - m_xCachedProps.reset( new ContentProperties( resources[ 0 ] ) ); - m_xCachedProps->containsAllNames( aProperties, m_aFailedPropNames ); + m_xCachedProps.reset( + new ContentProperties( resources[ 0 ] ) ); + m_xCachedProps->containsAllNames( + aProperties, m_aFailedPropNames ); } + eResourceType = DAV; } - catch ( DAVException const& e) + catch ( DAVException const & e ) { rResAccess->resetUri(); - if (e.getStatus() == SC_METHOD_NOT_ALLOWED) + if ( e.getStatus() == SC_METHOD_NOT_ALLOWED ) { // Status SC_METHOD_NOT_ALLOWED is a safe indicator that the // resource is NON_DAV @@ -3213,7 +3385,6 @@ const Content::ResourceType & Content::getResourceType( } } m_eResourceType = eResourceType; - } return m_eResourceType; } diff --git a/ucb/source/ucp/webdav/webdavcontent.hxx b/ucb/source/ucp/webdav/webdavcontent.hxx index 861e48bdfcee..caf6ec9677a9 100644 --- a/ucb/source/ucp/webdav/webdavcontent.hxx +++ b/ucb/source/ucp/webdav/webdavcontent.hxx @@ -88,7 +88,7 @@ class Content : public ::ucbhelper::ContentImplHelper, rtl::OUString m_aEscapedTitle; ResourceType m_eResourceType; ContentProvider* m_pProvider; // No need for a ref, base class holds object - bool m_bTransient; + bool m_bTransient; bool m_bCollection; bool m_bDidGetOrHead; std::vector< rtl::OUString > m_aFailedPropNames; @@ -96,81 +96,91 @@ class Content : public ::ucbhelper::ContentImplHelper, private: virtual com::sun::star::uno::Sequence< com::sun::star::beans::Property > getProperties( const com::sun::star::uno::Reference< - com::sun::star::ucb::XCommandEnvironment > & xEnv ); + com::sun::star::ucb::XCommandEnvironment > & xEnv ); virtual com::sun::star::uno::Sequence< com::sun::star::ucb::CommandInfo > getCommands( const com::sun::star::uno::Reference< - com::sun::star::ucb::XCommandEnvironment > & xEnv ); - virtual ::rtl::OUString getParentURL(); + com::sun::star::ucb::XCommandEnvironment > & xEnv ); + virtual ::rtl::OUString getParentURL(); - sal_Bool isFolder( const ::com::sun::star::uno::Reference< - ::com::sun::star::ucb::XCommandEnvironment >& xEnv ) + sal_Bool isFolder( const ::com::sun::star::uno::Reference< + ::com::sun::star::ucb::XCommandEnvironment >& xEnv ) throw ( ::com::sun::star::uno::Exception ); - ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow > - getPropertyValues( const ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow > + getPropertyValues( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& rProperties, - const ::com::sun::star::uno::Reference< - ::com::sun::star::ucb::XCommandEnvironment >& xEnv ) + const ::com::sun::star::uno::Reference< + ::com::sun::star::ucb::XCommandEnvironment >& xEnv ) throw ( ::com::sun::star::uno::Exception ); ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > - setPropertyValues( - const ::com::sun::star::uno::Sequence< - ::com::sun::star::beans::PropertyValue >& rValues, - const ::com::sun::star::uno::Reference< - ::com::sun::star::ucb::XCommandEnvironment >& xEnv ) + setPropertyValues( const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue >& rValues, + const ::com::sun::star::uno::Reference< + ::com::sun::star::ucb::XCommandEnvironment >& xEnv ) throw ( ::com::sun::star::uno::Exception ); typedef rtl::Reference< Content > ContentRef; - typedef std::list< ContentRef > ContentRefList; - void queryChildren( ContentRefList& rChildren); + typedef std::list< ContentRef > ContentRefList; + void queryChildren( ContentRefList& rChildren); - sal_Bool exchangeIdentity( - const ::com::sun::star::uno::Reference< - ::com::sun::star::ucb::XContentIdentifier >& xNewId ); + sal_Bool + exchangeIdentity( const ::com::sun::star::uno::Reference< + ::com::sun::star::ucb::XContentIdentifier >& xNewId ); - const rtl::OUString getBaseURI( const std::auto_ptr< DAVResourceAccess > & rResAccess ); + const rtl::OUString + getBaseURI( const std::auto_ptr< DAVResourceAccess > & rResAccess ); - const ResourceType & getResourceType( - const ::com::sun::star::uno::Reference< - ::com::sun::star::ucb::XCommandEnvironment >& xEnv ) + const ResourceType & + getResourceType( const ::com::sun::star::uno::Reference< + ::com::sun::star::ucb::XCommandEnvironment >& xEnv ) throw ( ::com::sun::star::uno::Exception ); - const ResourceType & getResourceType( - const ::com::sun::star::uno::Reference< - ::com::sun::star::ucb::XCommandEnvironment >& xEnv, - const std::auto_ptr< DAVResourceAccess > & rResAccess ) + const ResourceType & + getResourceType( const ::com::sun::star::uno::Reference< + ::com::sun::star::ucb::XCommandEnvironment >& xEnv, + const std::auto_ptr< DAVResourceAccess > & rResAccess ) throw ( ::com::sun::star::uno::Exception ); // Command "open" com::sun::star::uno::Any open( const com::sun::star::ucb::OpenCommandArgument2 & rArg, const com::sun::star::uno::Reference< - com::sun::star::ucb::XCommandEnvironment > & xEnv ) + com::sun::star::ucb::XCommandEnvironment > & xEnv ) throw( ::com::sun::star::uno::Exception ); // Command "post" void post( const com::sun::star::ucb::PostCommandArgument2 & rArg, const com::sun::star::uno::Reference< - com::sun::star::ucb::XCommandEnvironment > & xEnv ) + com::sun::star::ucb::XCommandEnvironment > & xEnv ) throw( ::com::sun::star::uno::Exception ); - // Command "insert" - void insert( const ::com::sun::star::uno::Reference< - ::com::sun::star::io::XInputStream > & xInputStream, - sal_Bool bReplaceExisting, - const com::sun::star::uno::Reference< - com::sun::star::ucb::XCommandEnvironment >& Environment ) + // Command "insert" + void insert( const ::com::sun::star::uno::Reference< + ::com::sun::star::io::XInputStream > & xInputStream, + sal_Bool bReplaceExisting, + const com::sun::star::uno::Reference< + com::sun::star::ucb::XCommandEnvironment >& Environment ) throw( ::com::sun::star::uno::Exception ); // Command "transfer" void transfer( const ::com::sun::star::ucb::TransferInfo & rArgs, const com::sun::star::uno::Reference< - com::sun::star::ucb::XCommandEnvironment >& Environment ) + com::sun::star::ucb::XCommandEnvironment >& Environment ) throw( ::com::sun::star::uno::Exception ); // Command "delete" - void destroy( sal_Bool bDeletePhysical ) + void destroy( sal_Bool bDeletePhysical ) + throw( ::com::sun::star::uno::Exception ); + + // Command "lock" + void lock( const com::sun::star::uno::Reference< + com::sun::star::ucb::XCommandEnvironment >& Environment ) + throw( ::com::sun::star::uno::Exception ); + + // Command "unlock" + void unlock( const com::sun::star::uno::Reference< + com::sun::star::ucb::XCommandEnvironment >& Environment ) throw( ::com::sun::star::uno::Exception ); ::com::sun::star::uno::Any MapDAVException( const DAVException & e, @@ -184,57 +194,62 @@ private: static bool shouldAccessNetworkAfterException( const DAVException & e ); + bool supportsExclusiveWriteLock( + const com::sun::star::uno::Reference< + com::sun::star::ucb::XCommandEnvironment >& Environment ); + public: - Content( const ::com::sun::star::uno::Reference< - ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr, - ContentProvider* pProvider, - const ::com::sun::star::uno::Reference< - ::com::sun::star::ucb::XContentIdentifier >& Identifier, + Content( const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + ContentProvider* pProvider, + const ::com::sun::star::uno::Reference< + ::com::sun::star::ucb::XContentIdentifier >& Identifier, rtl::Reference< DAVSessionFactory > const & rSessionFactory ) throw ( ::com::sun::star::ucb::ContentCreationException ); - Content( const ::com::sun::star::uno::Reference< - ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr, - ContentProvider* pProvider, - const ::com::sun::star::uno::Reference< - ::com::sun::star::ucb::XContentIdentifier >& Identifier, + Content( const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + ContentProvider* pProvider, + const ::com::sun::star::uno::Reference< + ::com::sun::star::ucb::XContentIdentifier >& Identifier, rtl::Reference< DAVSessionFactory > const & rSessionFactory, - sal_Bool isCollection ) + sal_Bool isCollection ) throw ( ::com::sun::star::ucb::ContentCreationException ); - virtual ~Content(); + virtual ~Content(); - // XInterface - XINTERFACE_DECL() + // XInterface + XINTERFACE_DECL() // XTypeProvider XTYPEPROVIDER_DECL() // XServiceInfo virtual ::rtl::OUString SAL_CALL - getImplementationName() + getImplementationName() throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL - getSupportedServiceNames() + + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException ); - // XContent - virtual rtl::OUString SAL_CALL - getContentType() + // XContent + virtual rtl::OUString SAL_CALL + getContentType() throw( com::sun::star::uno::RuntimeException ); - // XCommandProcessor - virtual com::sun::star::uno::Any SAL_CALL - execute( const com::sun::star::ucb::Command& aCommand, - sal_Int32 CommandId, - const com::sun::star::uno::Reference< - com::sun::star::ucb::XCommandEnvironment >& Environment ) + // XCommandProcessor + virtual com::sun::star::uno::Any SAL_CALL + execute( const com::sun::star::ucb::Command& aCommand, + sal_Int32 CommandId, + const com::sun::star::uno::Reference< + com::sun::star::ucb::XCommandEnvironment >& Environment ) throw( com::sun::star::uno::Exception, - com::sun::star::ucb::CommandAbortedException, - com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL - abort( sal_Int32 CommandId ) + com::sun::star::ucb::CommandAbortedException, + com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL + abort( sal_Int32 CommandId ) throw( com::sun::star::uno::RuntimeException ); - // XPropertyContainer + // XPropertyContainer virtual void SAL_CALL addProperty( const rtl::OUString& Name, sal_Int16 Attributes, @@ -250,36 +265,36 @@ public: com::sun::star::beans::NotRemoveableException, com::sun::star::uno::RuntimeException ); - ////////////////////////////////////////////////////////////////////// - // Additional interfaces - ////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////// + // Additional interfaces + ////////////////////////////////////////////////////////////////////// - // XContentCreator + // XContentCreator virtual com::sun::star::uno::Sequence< com::sun::star::ucb::ContentInfo > SAL_CALL - queryCreatableContentsInfo() + queryCreatableContentsInfo() throw( com::sun::star::uno::RuntimeException ); - virtual com::sun::star::uno::Reference< - com::sun::star::ucb::XContent > SAL_CALL - createNewContent( const com::sun::star::ucb::ContentInfo& Info ) + virtual com::sun::star::uno::Reference< + com::sun::star::ucb::XContent > SAL_CALL + createNewContent( const com::sun::star::ucb::ContentInfo& Info ) throw( com::sun::star::uno::RuntimeException ); - ////////////////////////////////////////////////////////////////////// - // Non-interface methods. - ////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////// + // Non-interface methods. + ////////////////////////////////////////////////////////////////////// DAVResourceAccess & getResourceAccess() { return *m_xResAccess; } - // Called from resultset data supplier. - static ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow > - getPropertyValues( const ::com::sun::star::uno::Reference< - ::com::sun::star::lang::XMultiServiceFactory >& rSMgr, + // Called from resultset data supplier. + static ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow > + getPropertyValues( const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XMultiServiceFactory >& rSMgr, const ::com::sun::star::uno::Sequence< - ::com::sun::star::beans::Property >& rProperties, - const ContentProperties& rData, + ::com::sun::star::beans::Property >& rProperties, + const ContentProperties& rData, const rtl::Reference< ::ucbhelper::ContentProviderImplHelper >& rProvider, - const ::rtl::OUString& rContentId ); + const ::rtl::OUString& rContentId ); }; } diff --git a/ucb/source/ucp/webdav/webdavcontentcaps.cxx b/ucb/source/ucp/webdav/webdavcontentcaps.cxx index 305d509b4e2c..cda93cfd855e 100644 --- a/ucb/source/ucp/webdav/webdavcontentcaps.cxx +++ b/ucb/source/ucp/webdav/webdavcontentcaps.cxx @@ -31,7 +31,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_ucb.hxx" /************************************************************************** - TODO + TODO ************************************************************************** *************************************************************************/ @@ -46,19 +46,13 @@ #include #include #include -#ifndef _COM_SUN_STAR_UTIL_DATETIME_HXX_ #include -#endif #include #include #include #include "webdavcontent.hxx" -#ifndef _WEBDAV_UCP_PROVIDFER_HXX #include "webdavprovider.hxx" -#endif -#ifndef _WEBDAV_SESSION_HXX #include "DAVSession.hxx" -#endif #include "ContentProperties.hxx" using namespace com::sun::star; @@ -221,17 +215,16 @@ bool ContentProvider::getProperty( m_pProps->insert( beans::Property( - DAVProperties::LOCKDISCOVERY, + DAVProperties::LOCKDISCOVERY, -1, getCppuType( static_cast< - const uno::Sequence< - com::sun::star::ucb::Lock > * >( 0 ) ), + const uno::Sequence< ucb::Lock > * >( 0 ) ), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ) ); m_pProps->insert( beans::Property( - DAVProperties::RESOURCETYPE, + DAVProperties::RESOURCETYPE, -1, getCppuType( static_cast< const rtl::OUString * >( 0 ) ), beans::PropertyAttribute::BOUND @@ -239,27 +232,25 @@ bool ContentProvider::getProperty( m_pProps->insert( beans::Property( - DAVProperties::SOURCE, + DAVProperties::SOURCE, -1, getCppuType( static_cast< - const uno::Sequence< - com::sun::star::ucb::Link > * >( 0 ) ), + const uno::Sequence< ucb::Link > * >( 0 ) ), beans::PropertyAttribute::BOUND ) ); m_pProps->insert( beans::Property( - DAVProperties::SUPPORTEDLOCK, + DAVProperties::SUPPORTEDLOCK, -1, getCppuType( static_cast< const uno::Sequence< - com::sun::star::ucb::LockEntry > * >( - 0 ) ), + ucb::LockEntry > * >( 0 ) ), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ) ); m_pProps->insert( beans::Property( - DAVProperties::EXECUTABLE, + DAVProperties::EXECUTABLE, -1, getCppuType( static_cast< const rtl::OUString * >( 0 ) ), beans::PropertyAttribute::BOUND ) ); @@ -301,7 +292,7 @@ bool ContentProvider::getProperty( // virtual uno::Sequence< beans::Property > Content::getProperties( - const uno::Reference< com::sun::star::ucb::XCommandEnvironment > & xEnv ) + const uno::Reference< ucb::XCommandEnvironment > & xEnv ) { sal_Bool bTransient; std::auto_ptr< DAVResourceAccess > xResAccess; @@ -314,7 +305,8 @@ uno::Sequence< beans::Property > Content::getProperties( bTransient = m_bTransient; xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) ); if ( m_xCachedProps.get() ) - xCachedProps.reset( new ContentProperties( *m_xCachedProps.get() ) ); + xCachedProps.reset( + new ContentProperties( *m_xCachedProps.get() ) ); xProvider.set( m_pProvider ); } @@ -525,236 +517,129 @@ uno::Sequence< beans::Property > Content::getProperties( //========================================================================= // virtual -uno::Sequence< com::sun::star::ucb::CommandInfo > Content::getCommands( - const uno::Reference< com::sun::star::ucb::XCommandEnvironment > & xEnv ) +uno::Sequence< ucb::CommandInfo > Content::getCommands( + const uno::Reference< ucb::XCommandEnvironment > & xEnv ) { osl::Guard< osl::Mutex > aGuard( m_aMutex ); - sal_Bool bFolder = sal_False; - - try - { - bFolder = isFolder( xEnv ); - } - catch ( uno::Exception const & ) - { - static com::sun::star::ucb::CommandInfo aDefaultCommandInfoTable[] = - { - /////////////////////////////////////////////////////////////// - // Just mandatory commands avail. - /////////////////////////////////////////////////////////////// - - com::sun::star::ucb::CommandInfo( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "getCommandInfo" ) ), - -1, - getCppuVoidType() - ), - com::sun::star::ucb::CommandInfo( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "getPropertySetInfo" ) ), - -1, - getCppuVoidType() - ), - com::sun::star::ucb::CommandInfo( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "getPropertyValues" ) ), - -1, - getCppuType( static_cast< - uno::Sequence< beans::Property > * >( 0 ) ) - ), - com::sun::star::ucb::CommandInfo( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "setPropertyValues" ) ), - -1, - getCppuType( static_cast< - uno::Sequence< beans::PropertyValue > * >( 0 ) ) - ) - }; - return uno::Sequence< com::sun::star::ucb::CommandInfo >( - aDefaultCommandInfoTable, 4 ); - } - - if ( bFolder ) - { - //================================================================= - // - // Folder: Supported commands - // - //================================================================= + uno::Sequence< ucb::CommandInfo > aCmdInfo( 8 ); - static com::sun::star::ucb::CommandInfo aFolderCommandInfoTable[] = - { - /////////////////////////////////////////////////////////////// - // Required commands - /////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////// + // Mandatory commands + /////////////////////////////////////////////////////////////// - com::sun::star::ucb::CommandInfo( + aCmdInfo[ 0 ] = + ucb::CommandInfo( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "getCommandInfo" ) ), -1, - getCppuVoidType() - ), - com::sun::star::ucb::CommandInfo( + getCppuVoidType() ); + aCmdInfo[ 1 ] = + ucb::CommandInfo( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "getPropertySetInfo" ) ), -1, - getCppuVoidType() - ), - com::sun::star::ucb::CommandInfo( + getCppuVoidType() ); + aCmdInfo[ 2 ] = + ucb::CommandInfo( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "getPropertyValues" ) ), -1, getCppuType( static_cast< - uno::Sequence< beans::Property > * >( 0 ) ) - ), - com::sun::star::ucb::CommandInfo( + uno::Sequence< beans::Property > * >( 0 ) ) ); + aCmdInfo[ 3 ] = + ucb::CommandInfo( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "setPropertyValues" ) ), -1, getCppuType( static_cast< - uno::Sequence< beans::PropertyValue > * >( 0 ) ) - ), + uno::Sequence< beans::PropertyValue > * >( 0 ) ) ); - /////////////////////////////////////////////////////////////// - // Optional standard commands - /////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////// + // Optional standard commands + /////////////////////////////////////////////////////////////// - com::sun::star::ucb::CommandInfo( + aCmdInfo[ 4 ] = + ucb::CommandInfo( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "delete" ) ), -1, - getCppuBooleanType() - ), - com::sun::star::ucb::CommandInfo( + getCppuBooleanType() ); + aCmdInfo[ 5 ] = + ucb::CommandInfo( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "insert" ) ), -1, getCppuType( static_cast< - com::sun::star::ucb::InsertCommandArgument * >( 0 ) ) - ), - com::sun::star::ucb::CommandInfo( + ucb::InsertCommandArgument * >( 0 ) ) ); + aCmdInfo[ 6 ] = + ucb::CommandInfo( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "open" ) ), -1, getCppuType( static_cast< - com::sun::star::ucb::OpenCommandArgument2 * >( 0 ) ) - ), - com::sun::star::ucb::CommandInfo( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "transfer" ) ), - -1, - getCppuType( static_cast< - com::sun::star::ucb::TransferInfo * >( 0 ) ) - ) + ucb::OpenCommandArgument2 * >( 0 ) ) ); - /////////////////////////////////////////////////////////////// - // New commands - /////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////// + // New commands + /////////////////////////////////////////////////////////////// - /* - com::sun::star::ucb::CommandInfo( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "COPY" ) ), - -1, - getCppuType( static_cast< const rtl::OUString * >( 0 ) ), - ), - com::sun::star::ucb::CommandInfo( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MOVE" ) ), + aCmdInfo[ 7 ] = + ucb::CommandInfo( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "post" ) ), -1, - getCppuType( static_cast< const rtl::OUString * >( 0 ) ), - ) - */ - }; + getCppuType( static_cast< + ucb::PostCommandArgument2 * >( 0 ) ) ); - return uno::Sequence< com::sun::star::ucb::CommandInfo >( - aFolderCommandInfoTable, 8 ); + sal_Bool bFolder = sal_False; + + try + { + bFolder = isFolder( xEnv ); } - else + catch ( uno::Exception const & ) { - //================================================================= - // - // Document: Supported commands - // - //================================================================= - - static com::sun::star::ucb::CommandInfo aDocumentCommandInfoTable[] = - { - /////////////////////////////////////////////////////////////// - // Required commands - /////////////////////////////////////////////////////////////// - - com::sun::star::ucb::CommandInfo( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "getCommandInfo" ) ), - -1, - getCppuVoidType() - ), - com::sun::star::ucb::CommandInfo( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "getPropertySetInfo" ) ), - -1, - getCppuVoidType() - ), - com::sun::star::ucb::CommandInfo( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "getPropertyValues" ) ), - -1, - getCppuType( static_cast< - uno::Sequence< beans::Property > * >( 0 ) ) - ), - com::sun::star::ucb::CommandInfo( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "setPropertyValues" ) ), - -1, - getCppuType( static_cast< - uno::Sequence< beans::PropertyValue > * >( 0 ) ) - ), + return aCmdInfo; + } - /////////////////////////////////////////////////////////////// - // Optional standard commands - /////////////////////////////////////////////////////////////// + sal_Bool bSupportsLocking = supportsExclusiveWriteLock( xEnv ); - com::sun::star::ucb::CommandInfo( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "delete" ) ), - -1, - getCppuBooleanType() - ), - com::sun::star::ucb::CommandInfo( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "insert" ) ), - -1, - getCppuType( static_cast< - com::sun::star::ucb::InsertCommandArgument * >( 0 ) ) - ), - com::sun::star::ucb::CommandInfo( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "open" ) ), - -1, - getCppuType( static_cast< - com::sun::star::ucb::OpenCommandArgument2 * >( 0 ) ) - ), + sal_Int32 nPos = aCmdInfo.getLength(); + sal_Int32 nMoreCmds = ( bFolder ? 1 : 0 ) + ( bSupportsLocking ? 2 : 0 ); + if ( nMoreCmds ) + aCmdInfo.realloc( nPos + nMoreCmds ); + else + return aCmdInfo; - /////////////////////////////////////////////////////////////// - // New commands - /////////////////////////////////////////////////////////////// + if ( bFolder ) + { + /////////////////////////////////////////////////////////////// + // Optional standard commands + /////////////////////////////////////////////////////////////// - com::sun::star::ucb::CommandInfo( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "post" ) ), + aCmdInfo[ nPos ] = + ucb::CommandInfo( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "transfer" ) ), -1, - getCppuType( static_cast< - com::sun::star::ucb::PostCommandArgument2 * >( 0 ) ) - ) + getCppuType( static_cast< ucb::TransferInfo * >( 0 ) ) ); + nPos++; + } + else + { + // no document-only commands at the moment. + } - /* - com::sun::star::ucb::CommandInfo( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "COPY" ) ), + if ( bSupportsLocking ) + { + aCmdInfo[ nPos ] = + ucb::CommandInfo( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "lock" ) ), -1, - getCppuType( static_cast< const rtl::OUString * >( 0 ) ), - ), - com::sun::star::ucb::CommandInfo( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MOVE" ) ), + getCppuVoidType() ); + nPos++; + aCmdInfo[ nPos ] = + ucb::CommandInfo( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "unlock" ) ), -1, - getCppuType( static_cast< const rtl::OUString * >( 0 ) ), - ) - */ - }; - - return uno::Sequence< com::sun::star::ucb::CommandInfo >( - aDocumentCommandInfoTable, 8 ); + getCppuVoidType() ); + nPos++; } + return aCmdInfo; } - diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx index 996fd24e531d..29f380b2a7a0 100644 --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -86,6 +86,9 @@ #include "com/sun/star/ucb/InteractiveAppException.hpp" #include "com/sun/star/ucb/InteractiveAugmentedIOException.hpp" #include "com/sun/star/ucb/InteractiveCHAOSException.hpp" +#include "com/sun/star/ucb/InteractiveLockingLockedException.hpp" +#include "com/sun/star/ucb/InteractiveLockingNotLockedException.hpp" +#include "com/sun/star/ucb/InteractiveLockingLockExpiredException.hpp" #include "com/sun/star/ucb/InteractiveNetworkConnectException.hpp" #include "com/sun/star/ucb/InteractiveNetworkException.hpp" #include "com/sun/star/ucb/InteractiveNetworkGeneralException.hpp" @@ -1105,6 +1108,58 @@ bool UUIInteractionHelper::handleMessageboxRequests( return true; } + star::ucb::InteractiveLockingLockedException aLLException; + if (aAnyRequest >>= aLLException) + { + ErrCode nErrorCode = aLLException.SelfOwned + ? ERRCODE_UUI_LOCKING_LOCKED_SELF : ERRCODE_UUI_LOCKING_LOCKED; + std::vector< rtl::OUString > aArguments; + aArguments.push_back( aLLException.Url ); + + handleErrorRequest( aLLException.Classification, + nErrorCode, + aArguments, + rRequest->getContinuations(), + bObtainErrorStringOnly, + bHasErrorString, + rErrorString ); + return true; + } + + star::ucb::InteractiveLockingNotLockedException aLNLException; + if (aAnyRequest >>= aLNLException) + { + ErrCode nErrorCode = ERRCODE_UUI_LOCKING_NOT_LOCKED; + std::vector< rtl::OUString > aArguments; + aArguments.push_back( aLNLException.Url ); + + handleErrorRequest( aLNLException.Classification, + nErrorCode, + aArguments, + rRequest->getContinuations(), + bObtainErrorStringOnly, + bHasErrorString, + rErrorString ); + return true; + } + + star::ucb::InteractiveLockingLockExpiredException aLLEException; + if (aAnyRequest >>= aLLEException) + { + ErrCode nErrorCode = ERRCODE_UUI_LOCKING_LOCK_EXPIRED; + std::vector< rtl::OUString > aArguments; + aArguments.push_back( aLLEException.Url ); + + handleErrorRequest( aLLEException.Classification, + nErrorCode, + aArguments, + rRequest->getContinuations(), + bObtainErrorStringOnly, + bHasErrorString, + rErrorString ); + return true; + } + return false; } diff --git a/uui/source/ids.hrc b/uui/source/ids.hrc index 08624a3dda4e..7259b8ba86e3 100644 --- a/uui/source/ids.hrc +++ b/uui/source/ids.hrc @@ -149,6 +149,10 @@ #define ERRCODE_UUI_CONFIGURATION_BACKENDMISSING_WITHRECOVER (ERRCODE_AREA_UUI + 56) #define ERRCODE_UUI_INVALID_XFORMS_SUBMISSION_DATA (ERRCODE_AREA_UUI + 57) #define ERRCODE_UUI_IO_MODULESIZEEXCEEDED (ERRCODE_AREA_UUI + 58) +#define ERRCODE_UUI_LOCKING_LOCKED (ERRCODE_AREA_UUI + 59) +#define ERRCODE_UUI_LOCKING_LOCKED_SELF (ERRCODE_AREA_UUI + 60) +#define ERRCODE_UUI_LOCKING_NOT_LOCKED (ERRCODE_AREA_UUI + 61) +#define ERRCODE_UUI_LOCKING_LOCK_EXPIRED (ERRCODE_AREA_UUI + 62) #define ERRCODE_AREA_UUI_UNKNOWNAUTH 25000 #define SSLWARN_TYPE_DOMAINMISMATCH 10 diff --git a/uui/source/ids.src b/uui/source/ids.src index fc82161bbb81..0d692a13fa71 100644 --- a/uui/source/ids.src +++ b/uui/source/ids.src @@ -1,3 +1,4 @@ + /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -351,6 +352,27 @@ Resource RID_UUI_ERRHDL Text [ en-US ] = "The form contains invalid data. Do you still want to continue?"; }; + String (ERRCODE_UUI_LOCKING_LOCKED & ERRCODE_RES_MASK) + { + Text [ en-US ] = "The file $(ARG1) is locked by another user. Currently, another write access to this file cannot be granted."; + + }; + + String (ERRCODE_UUI_LOCKING_LOCKED_SELF & ERRCODE_RES_MASK) + { + Text [ en-US ] = "The file $(ARG1) is locked by yourself. Currently, another write access to this file cannot be granted."; + }; + + String (ERRCODE_UUI_LOCKING_NOT_LOCKED & ERRCODE_RES_MASK) + { + Text [ en-US ] = "The file $(ARG1) is currently not locked by yourself."; + }; + + String (ERRCODE_UUI_LOCKING_LOCK_EXPIRED & ERRCODE_RES_MASK) + { + Text [ en-US ] = "The previously obtained lock for file $(ARG1) has expired.\nThis can happen due to problems on the server managing the file lock. It cannot be guaranteed that write operations on this file will not overwrite changes done by other users!"; + }; + STRING (ERRCODE_UUI_UNKNOWNAUTH_UNTRUSTED) { Text [ en-US ] = "Unable to verify the identity of $(ARG1) site.\n\nBefore accepting this certificate, you should examine this site's certificate carefully. Are you willing to accept this certificate for the purpose of identifying the Web site $(ARG1)?"; -- cgit v1.2.3 From 43e7e0bfd45466935c349eee3afe0bafadafadf9 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Thu, 12 Nov 2009 15:22:00 +0100 Subject: #i106830# WebDAV locking support for UCB --- neon/neon.patch | 110 ++++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 91 insertions(+), 19 deletions(-) diff --git a/neon/neon.patch b/neon/neon.patch index 569ed0f0a189..8817f54a3381 100644 --- a/neon/neon.patch +++ b/neon/neon.patch @@ -1,6 +1,6 @@ ---- misc/neon-0.28.2/src/config.h 2009-08-30 19:00:56.000000000 +0200 -+++ misc/build/neon-0.28.2/src/config.h 2009-08-11 09:48:54.000000000 +0200 -@@ -1 +1,484 @@ +--- misc/neon-0.28.2/src/config.h 2009-11-12 13:03:04.000000000 +0100 ++++ misc/build/neon-0.28.2/src/config.h 2009-11-12 12:53:41.000000000 +0100 +@@ -1 +1,488 @@ -dummy + +/* Define to specific EGD socket path */ @@ -455,6 +455,10 @@ +/* Define to `unsigned' if does not define. */ +/* #undef size_t */ + ++/* MS IIS does not send Lock-Token response header after creation of a */ ++/* new lock. This violates RFC, but... if we want to talk with this */ ++/* beast we need a workaround */ ++#define IIS_LOCK_BUG_WORKAROUND 1 + +/* Enable leak-tracking versions of ne_*alloc when NEON_MEMLEAK is enabled */ +#ifdef NEON_MEMLEAK @@ -486,8 +490,8 @@ +#else +#define HAVE_NTLM 1 +#endif ---- misc/neon-0.28.2/src/makefile.mk 2009-08-30 19:00:56.000000000 +0200 -+++ misc/build/neon-0.28.2/src/makefile.mk 2009-08-11 09:48:54.000000000 +0200 +--- misc/neon-0.28.2/src/makefile.mk 2009-11-12 13:03:04.000000000 +0100 ++++ misc/build/neon-0.28.2/src/makefile.mk 2009-11-12 11:39:52.000000000 +0100 @@ -1 +1,59 @@ -dummy +PRJ=..$/..$/..$/..$/.. @@ -550,7 +554,7 @@ + +.INCLUDE : target.mk --- misc/neon-0.28.2/src/ne_auth.c 2008-02-29 17:30:12.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_auth.c 2009-08-24 15:41:32.000000000 +0200 ++++ misc/build/neon-0.28.2/src/ne_auth.c 2009-11-12 11:39:52.000000000 +0100 @@ -77,6 +77,10 @@ #include "ne_sspi.h" #endif @@ -714,7 +718,7 @@ return ret; } --- misc/neon-0.28.2/src/ne_auth.h 2007-12-05 17:39:58.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_auth.h 2009-08-24 15:16:22.000000000 +0200 ++++ misc/build/neon-0.28.2/src/ne_auth.h 2009-11-12 11:39:52.000000000 +0100 @@ -47,8 +47,8 @@ * Hint: if you just wish to attempt authentication just once (even if * the user gets the username/password wrong), have the callback @@ -727,7 +731,7 @@ /* Set callbacks to provide credentials for server and proxy * authentication, using the default set of authentication protocols. --- misc/neon-0.28.2/src/ne_defs.h 2006-10-24 21:40:09.000000000 +0200 -+++ misc/build/neon-0.28.2/src/ne_defs.h 2009-08-11 09:48:54.000000000 +0200 ++++ misc/build/neon-0.28.2/src/ne_defs.h 2009-11-12 11:39:52.000000000 +0100 @@ -41,7 +41,7 @@ #endif @@ -737,8 +741,76 @@ #define ssize_t int #endif +--- misc/neon-0.28.2/src/ne_locks.c 2007-02-05 11:09:27.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_locks.c 2009-11-12 12:57:15.000000000 +0100 +@@ -579,6 +579,23 @@ + const char *token = ne_get_response_header(ctx->req, "Lock-Token"); + /* at the root element; retrieve the Lock-Token header, + * and bail if it wasn't given. */ ++#ifdef IIS_LOCK_BUG_WORKAROUND ++ /* MS IIS violates RFC 2518/4918. It does not send a Lock-Token response ++ header upon successful creation of a new lock. As a workaround, we ++ will try to pick the lock token from the response body (although ++ this is not 100% safe in case of multiple activelocks). */ ++ if (token == NULL) ++ NE_DEBUG(NE_DBG_LOCKS, ++ "Ignoring missing LOCK response Lock-Token header\n"); ++ ++ if (token != NULL) { ++ if (token[0] == '<') token++; ++ ctx->token = ne_strdup(token); ++ ne_shave(ctx->token, ">"); ++ NE_DEBUG(NE_DBG_LOCKS, "lk_startelm: Finding token %s\n", ++ ctx->token); ++ } ++#else + if (token == NULL) { + ne_xml_set_error(ctx->parser, + _("LOCK response missing Lock-Token header")); +@@ -590,12 +607,28 @@ + ne_shave(ctx->token, ">"); + NE_DEBUG(NE_DBG_LOCKS, "lk_startelm: Finding token %s\n", + ctx->token); ++#endif + } + + /* TODO: only accept 'prop' as root for LOCK response */ + if (!can_accept(parent, id)) + return NE_XML_DECLINE; + ++#ifdef IIS_LOCK_BUG_WORKAROUND ++ if (id == ELM_activelock && ctx->found) { ++ /* Found another activelock... */ ++ const char *token = ne_get_response_header(ctx->req, "Lock-Token"); ++ if (token == NULL) { ++ /* Response contains more than one activelock and no Lock-Token ++ * response header. We are doomed. No safe workaround for IIS ++ * lock bug possible. */ ++ ne_xml_set_error(ctx->parser, ++ _("LOCK response missing Lock-Token header and more than one activelock")); ++ return NE_XML_ABORT; ++ } ++ } ++#endif ++ + if (id == ELM_activelock && !ctx->found) { + /* a new activelock */ + ne_lock_free(&ctx->active); +@@ -621,7 +654,12 @@ + return -1; + + if (state == ELM_activelock) { ++#ifdef IIS_LOCK_BUG_WORKAROUND ++ if (ctx->active.token) { ++ ctx->token = ne_strdup(ctx->active.token); ++#else + if (ctx->active.token && strcmp(ctx->active.token, ctx->token) == 0) { ++#endif + ctx->found = 1; + } + } --- misc/neon-0.28.2/src/ne_locks.h 2006-01-02 12:43:19.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_locks.h 2009-08-11 09:48:54.000000000 +0200 ++++ misc/build/neon-0.28.2/src/ne_locks.h 2009-11-12 11:39:52.000000000 +0100 @@ -22,6 +22,10 @@ #ifndef NE_LOCKS_H #define NE_LOCKS_H @@ -750,8 +822,8 @@ #include "ne_request.h" /* for ne_session + ne_request */ #include "ne_uri.h" /* for ne_uri */ ---- misc/neon-0.28.2/src/ne_ntlm.c 2009-08-30 19:00:56.000000000 +0200 -+++ misc/build/neon-0.28.2/src/ne_ntlm.c 2009-08-11 09:48:54.000000000 +0200 +--- misc/neon-0.28.2/src/ne_ntlm.c 2009-11-12 13:03:04.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_ntlm.c 2009-11-12 11:39:52.000000000 +0100 @@ -1 +1,700 @@ -dummy +/* @@ -1454,8 +1526,8 @@ + +#endif /* HAVE_OPENSSL */ +#endif /* HAVE_NTLM */ ---- misc/neon-0.28.2/src/ne_ntlm.h 2009-08-30 19:00:56.000000000 +0200 -+++ misc/build/neon-0.28.2/src/ne_ntlm.h 2009-08-11 09:48:54.000000000 +0200 +--- misc/neon-0.28.2/src/ne_ntlm.h 2009-11-12 13:03:04.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_ntlm.h 2009-11-12 11:39:51.000000000 +0100 @@ -1 +1,44 @@ -dummy +/* @@ -1503,7 +1575,7 @@ + +#endif /* NE_NTLM_H */ --- misc/neon-0.28.2/src/ne_socket.c 2008-02-28 14:19:19.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_socket.c 2009-08-11 09:48:54.000000000 +0200 ++++ misc/build/neon-0.28.2/src/ne_socket.c 2009-11-12 11:39:52.000000000 +0100 @@ -60,6 +60,7 @@ #include #ifdef USE_GETADDRINFO @@ -1513,7 +1585,7 @@ #endif --- misc/neon-0.28.2/src/ne_sspi.c 2007-08-10 17:26:08.000000000 +0200 -+++ misc/build/neon-0.28.2/src/ne_sspi.c 2009-08-11 09:48:54.000000000 +0200 ++++ misc/build/neon-0.28.2/src/ne_sspi.c 2009-11-12 11:39:52.000000000 +0100 @@ -202,9 +202,48 @@ return -1; } @@ -1604,7 +1676,7 @@ securityStatus = initializeSecurityContext(&sspiContext->credentials, NULL, --- misc/neon-0.28.2/src/ne_sspi.h 2006-02-12 13:05:14.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_sspi.h 2009-08-11 09:48:54.000000000 +0200 ++++ misc/build/neon-0.28.2/src/ne_sspi.h 2009-11-12 11:39:51.000000000 +0100 @@ -41,7 +41,7 @@ int ne_sspi_clear_context(void *context); @@ -1615,7 +1687,7 @@ #endif /* HAVE_SSPI */ --- misc/neon-0.28.2/src/ne_uri.c 2007-12-05 12:04:47.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_uri.c 2009-08-11 09:48:54.000000000 +0200 ++++ misc/build/neon-0.28.2/src/ne_uri.c 2009-11-12 11:39:52.000000000 +0100 @@ -42,7 +42,7 @@ #include "ne_alloc.h" #include "ne_uri.h" @@ -1662,7 +1734,7 @@ /* 4x */ AT, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, /* 5x */ AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, GD, OT, GD, OT, US, --- misc/neon-0.28.2/src/ne_utils.c 2006-03-07 10:36:43.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_utils.c 2009-08-30 18:55:04.000000000 +0200 ++++ misc/build/neon-0.28.2/src/ne_utils.c 2009-11-12 11:39:52.000000000 +0100 @@ -118,6 +118,9 @@ #ifdef HAVE_GNUTLS ", GNU TLS " LIBGNUTLS_VERSION @@ -1693,7 +1765,7 @@ #endif /* NE_HAVE_* */ default: --- misc/neon-0.28.2/src/ne_utils.h 2007-07-16 08:54:57.000000000 +0200 -+++ misc/build/neon-0.28.2/src/ne_utils.h 2009-08-24 15:47:03.000000000 +0200 ++++ misc/build/neon-0.28.2/src/ne_utils.h 2009-11-12 11:39:51.000000000 +0100 @@ -54,6 +54,7 @@ #define NE_FEATURE_SOCKS (5) /* SOCKSv5 support */ #define NE_FEATURE_TS_SSL (6) /* Thread-safe SSL/TLS support */ -- cgit v1.2.3 From b4caf963700645e0cf9c1a77461929f0887708f2 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Thu, 12 Nov 2009 15:22:00 +0100 Subject: #i106830# WebDAV locking support for UCB --- offapi/com/sun/star/ucb/Content.idl | 29 ++++++++-- .../sun/star/ucb/InteractiveLockingException.idl | 61 +++++++++++++++++++++ .../ucb/InteractiveLockingLockExpiredException.idl | 56 +++++++++++++++++++ .../star/ucb/InteractiveLockingLockedException.idl | 62 ++++++++++++++++++++++ .../ucb/InteractiveLockingNotLockedException.idl | 59 ++++++++++++++++++++ offapi/com/sun/star/ucb/makefile.mk | 4 ++ 6 files changed, 267 insertions(+), 4 deletions(-) create mode 100644 offapi/com/sun/star/ucb/InteractiveLockingException.idl create mode 100644 offapi/com/sun/star/ucb/InteractiveLockingLockExpiredException.idl create mode 100644 offapi/com/sun/star/ucb/InteractiveLockingLockedException.idl create mode 100644 offapi/com/sun/star/ucb/InteractiveLockingNotLockedException.idl diff --git a/offapi/com/sun/star/ucb/Content.idl b/offapi/com/sun/star/ucb/Content.idl index 2e8f68067883..5d363f9d880a 100644 --- a/offapi/com/sun/star/ucb/Content.idl +++ b/offapi/com/sun/star/ucb/Content.idl @@ -137,7 +137,7 @@ published service Content [parameter type and name] ----------------------------------------------------------------------- - Requiered commands: + Mandatory commands: ----------------------------------------------------------------------- // This command obtains an interface which allows to query @@ -218,7 +218,7 @@ published service Content // sequence is the same as the order of result set // columns. First element of sequence will be row // number one, second will be row number two, ... - // SortingInfo : contains sort criteria, if result set shall + // SortingInfo : contains sort criteria, if result set shall // be sorted, otherwise it can be left empty. // // The exceution must be aborted by the implementation of this command @@ -236,12 +236,12 @@ published service Content // // Mode : DOCUMENT or DOCUMENT_SHARE_DENY_NONE or // DOCUMENT_SHARE_DENY_WRITE. Support for DOCUMENT - // is mandatory, all others are optional. + // is mandatory, all others are optional. // Priority : can be set, but implementation may ignore the value // Sink : a sink, where the implementation can put the // document data into. // Properties : empty ( ignored ) - // SortingInfo : empty ( ignored ) + // SortingInfo : empty ( ignored ) // // The exceution must be aborted by the implementation of this command // (by throwing a CommandAbortedException), if an @@ -366,6 +366,27 @@ published service Content transfer TransferInfo aTransferInfo + // This command obtains an exlusive write lock for the resource. The + // lock is active until command "unlock" is executed or the OOo + // session that obtained the lock ends or until the lock is released by + // a third party (e.g. a system administrator). + void + lock + void + Exceptions: InteractiveLockingLockedException + InteractiveLockingLockExpiredException + + // This command removes a lock obtained by executing the command "lock" + // from the resource. + void + unlock + void + Exceptions: InteractiveLockingNotLockedException + InteractiveLockingLockExpiredException + + // Note that InteractiveLockingLockExpiredException might + // be raised by any command that requires a previously obtained lock. + ======================================================================= Properties: ======================================================================= diff --git a/offapi/com/sun/star/ucb/InteractiveLockingException.idl b/offapi/com/sun/star/ucb/InteractiveLockingException.idl new file mode 100644 index 000000000000..8d96358566fa --- /dev/null +++ b/offapi/com/sun/star/ucb/InteractiveLockingException.idl @@ -0,0 +1,61 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: $ + * $Revision: $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef __com_sun_star_ucb_InteractiveLockingException_idl__ +#define __com_sun_star_ucb_InteractiveLockingException_idl__ + +#ifndef __com_sun_star_task_ClassifiedInteractionRequest_idl__ +#include +#endif + + +//============================================================================= + +module com { module sun { module star { module ucb { + +//============================================================================= +/** An error related to locking operations. + +

Various meaningful errors are derived from this exception.

+ + @since OOo 3.3 +*/ +/*published*/ exception InteractiveLockingException : com::sun::star::task::ClassifiedInteractionRequest +{ + //------------------------------------------------------------------------- + /** The Url of the resource this exception is related to. + */ + string Url; +}; + +//============================================================================= + +}; }; }; }; + +#endif diff --git a/offapi/com/sun/star/ucb/InteractiveLockingLockExpiredException.idl b/offapi/com/sun/star/ucb/InteractiveLockingLockExpiredException.idl new file mode 100644 index 000000000000..63ddfa58bf2f --- /dev/null +++ b/offapi/com/sun/star/ucb/InteractiveLockingLockExpiredException.idl @@ -0,0 +1,56 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: $ + * $Revision: $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef __com_sun_star_ucb_InteractiveLockingLockExpiredException_idl__ +#define __com_sun_star_ucb_InteractiveLockingLockExpiredException_idl__ + +#ifndef __com_sun_star_ucb_InteractiveLockingException_idl__ +#include +#endif + + +//============================================================================= + +module com { module sun { module star { module ucb { + +//============================================================================= +/** An error indicating that a lock that has been previously obtained by this + OOo session has expired. + + @since OOo 3.3 +*/ +/*published*/ exception InteractiveLockingLockExpiredException : com::sun::star::ucb::InteractiveLockingException +{ +}; + +//============================================================================= + +}; }; }; }; + +#endif diff --git a/offapi/com/sun/star/ucb/InteractiveLockingLockedException.idl b/offapi/com/sun/star/ucb/InteractiveLockingLockedException.idl new file mode 100644 index 000000000000..33f309ec0b81 --- /dev/null +++ b/offapi/com/sun/star/ucb/InteractiveLockingLockedException.idl @@ -0,0 +1,62 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: $ + * $Revision: $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef __com_sun_star_ucb_InteractiveLockingLockedException_idl__ +#define __com_sun_star_ucb_InteractiveLockingLockedException_idl__ + +#ifndef __com_sun_star_ucb_InteractiveLockingException_idl__ +#include +#endif + + +//============================================================================= + +module com { module sun { module star { module ucb { + +//============================================================================= +/** An error indicating that the resource is locked. + + @since OOo 3.3 +*/ +/*published*/ exception InteractiveLockingLockedException : com::sun::star::ucb::InteractiveLockingException +{ + //------------------------------------------------------------------------- + /** The owner of the lock. + + , the lock has been obtained by this OOo session. + the lock has been obtained by another principal. + */ + boolean SelfOwned; +}; + +//============================================================================= + +}; }; }; }; + +#endif diff --git a/offapi/com/sun/star/ucb/InteractiveLockingNotLockedException.idl b/offapi/com/sun/star/ucb/InteractiveLockingNotLockedException.idl new file mode 100644 index 000000000000..88d587b4cb24 --- /dev/null +++ b/offapi/com/sun/star/ucb/InteractiveLockingNotLockedException.idl @@ -0,0 +1,59 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: $ + * $Revision: $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef __com_sun_star_ucb_InteractiveLockingNotLockedException_idl__ +#define __com_sun_star_ucb_InteractiveLockingNotLockedException_idl__ + +#ifndef __com_sun_star_ucb_InteractiveLockingException_idl__ +#include +#endif + + +//============================================================================= + +module com { module sun { module star { module ucb { + +//============================================================================= +/** An error indicating that the resource is not locked. + +

This error for instance can occure when trying to unlock a resource + that is not locked. +

+ + @since OOo 3.3 +*/ +/*published*/ exception InteractiveLockingNotLockedException : com::sun::star::ucb::InteractiveLockingException +{ +}; + +//============================================================================= + +}; }; }; }; + +#endif diff --git a/offapi/com/sun/star/ucb/makefile.mk b/offapi/com/sun/star/ucb/makefile.mk index fc6aed3640a4..573453e554e5 100644 --- a/offapi/com/sun/star/ucb/makefile.mk +++ b/offapi/com/sun/star/ucb/makefile.mk @@ -124,6 +124,10 @@ IDLFILES=\ InteractiveCHAOSException.idl\ InteractiveFileIOException.idl\ InteractiveIOException.idl\ + InteractiveLockingException.idl\ + InteractiveLockingLockedException.idl\ + InteractiveLockingLockExpiredException.idl\ + InteractiveLockingNotLockedException.idl\ InteractiveNetworkConnectException.idl\ InteractiveNetworkException.idl\ InteractiveNetworkGeneralException.idl\ -- cgit v1.2.3 From f4744ab09c08782158973962061166dde402b417 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Thu, 12 Nov 2009 15:29:04 +0100 Subject: #i105553# - Disabled unused code. --- ucb/source/ucp/webdav/DAVResourceAccess.cxx | 2 ++ ucb/source/ucp/webdav/DAVResourceAccess.hxx | 2 ++ 2 files changed, 4 insertions(+) diff --git a/ucb/source/ucp/webdav/DAVResourceAccess.cxx b/ucb/source/ucp/webdav/DAVResourceAccess.cxx index 5095950c4c0e..b2c243a6fe17 100644 --- a/ucb/source/ucp/webdav/DAVResourceAccess.cxx +++ b/ucb/source/ucp/webdav/DAVResourceAccess.cxx @@ -176,6 +176,7 @@ DAVResourceAccess & DAVResourceAccess::operator=( return *this; } +#if 0 // currently not used, but please don't remove code //========================================================================= void DAVResourceAccess::OPTIONS( DAVCapabilities & rCapabilities, @@ -215,6 +216,7 @@ void DAVResourceAccess::OPTIONS( } while ( bRetry ); } +#endif //========================================================================= void DAVResourceAccess::PROPFIND( diff --git a/ucb/source/ucp/webdav/DAVResourceAccess.hxx b/ucb/source/ucp/webdav/DAVResourceAccess.hxx index 6d8ea4fad43e..b4f6eb2b5a9e 100644 --- a/ucb/source/ucp/webdav/DAVResourceAccess.hxx +++ b/ucb/source/ucp/webdav/DAVResourceAccess.hxx @@ -86,11 +86,13 @@ public: // DAV methods // +#if 0 // currently not used, but please don't remove code void OPTIONS( DAVCapabilities & rCapabilities, const com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment > & xEnv ) throw ( DAVException ); +#endif // allprop & named void -- cgit v1.2.3 From f24cbb654395faa768396995ec62398cf7d815d4 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Thu, 12 Nov 2009 16:49:55 +0100 Subject: #i106830# - cleanup. --- ucb/source/ucp/webdav/NeonLockStore.cxx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ucb/source/ucp/webdav/NeonLockStore.cxx b/ucb/source/ucp/webdav/NeonLockStore.cxx index b6246e8c3485..9d151bc2ba30 100644 --- a/ucb/source/ucp/webdav/NeonLockStore.cxx +++ b/ucb/source/ucp/webdav/NeonLockStore.cxx @@ -93,20 +93,18 @@ NeonLockStore::NeonLockStore() : m_pNeonLockStore( ne_lockstore_create() ), m_pTickerThread( 0 ) { - OSL_TRACE( "LockStore ctor." ); OSL_ENSURE( m_pNeonLockStore, "Unable to create neon lock store!" ); } // ------------------------------------------------------------------- NeonLockStore::~NeonLockStore() { - OSL_TRACE( "LockStore dtor." ); - stopTicker(); - // release active locks, if any (just for safety). + // release active locks, if any. OSL_ENSURE( m_aLockInfoMap.size() == 0, "NeonLockStore::~NeonLockStore - Releasing active locks!" ); + LockInfoMap::const_iterator it( m_aLockInfoMap.begin() ); const LockInfoMap::const_iterator end( m_aLockInfoMap.end() ); while ( it != end ) @@ -215,7 +213,6 @@ void NeonLockStore::removeLock( NeonLock * pLock ) void NeonLockStore::refreshLocks() { osl::MutexGuard aGuard( m_aMutex ); - //OSL_TRACE( "NeonLockStore::refreshLocks" ); LockInfoMap::iterator it( m_aLockInfoMap.begin() ); const LockInfoMap::const_iterator end( m_aLockInfoMap.end() ); -- cgit v1.2.3 From 14f783c6bb56bb24c9861c1d50b3a3dc9b0fe2f4 Mon Sep 17 00:00:00 2001 From: sj Date: Fri, 13 Nov 2009 15:38:23 +0100 Subject: impress181: #i76407,160798# fixed some text orientation problems for the Excel import filter --- .../sdr/contact/viewcontactofsdrobjcustomshape.cxx | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx index 5f632f60ab85..a12658304b1b 100644 --- a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx @@ -70,7 +70,7 @@ namespace sdr const GeoStat& rGeoStat(GetCustomShapeObj().GetGeoStat()); // only correct when rotation and/or shear is used - if(rGeoStat.nShearWink || rGeoStat.nDrehWink || !basegfx::fTools::equalZero(fExtraTextRotation)) + if(rGeoStat.nShearWink || rGeoStat.nDrehWink ) { // text range needs to be corrected by // aObjectRange.getCenter() - aRotObjectRange.getCenter() since it's @@ -94,11 +94,6 @@ namespace sdr aRotMatrix.rotate((36000 - rGeoStat.nDrehWink) * F_PI18000); } - if(!basegfx::fTools::equalZero(fExtraTextRotation)) - { - aRotMatrix.rotate((360.0 - fExtraTextRotation) * F_PI180); - } - aRotMatrix.translate(aObjectRange.getMinimum().getX(), aObjectRange.getMinimum().getY()); aRotObjectRange.transform(aRotMatrix); @@ -180,6 +175,16 @@ namespace sdr aTextRange.getMinY() - aObjectRange.getMinimum().getY()); } + if(!basegfx::fTools::equalZero(fExtraTextRotation)) + { + basegfx::B2DVector aTranslation( + ( aTextRange.getWidth() / 2 ) + ( aTextRange.getMinX() - aObjectRange.getMinimum().getX() ), + ( aTextRange.getHeight() / 2 ) + ( aTextRange.getMinY() - aObjectRange.getMinimum().getY() ) ); + aTextBoxMatrix.translate( -aTranslation.getX(), -aTranslation.getY() ); + aTextBoxMatrix.rotate((360.0 - fExtraTextRotation) * F_PI180); + aTextBoxMatrix.translate( aTranslation.getX(), aTranslation.getY() ); + } + if(rGeoStat.nShearWink) { aTextBoxMatrix.shearX(tan((36000 - rGeoStat.nShearWink) * F_PI18000)); @@ -190,11 +195,6 @@ namespace sdr aTextBoxMatrix.rotate((36000 - rGeoStat.nDrehWink) * F_PI18000); } - if(!basegfx::fTools::equalZero(fExtraTextRotation)) - { - aTextBoxMatrix.rotate((360.0 - fExtraTextRotation) * F_PI180); - } - // give text it's target position aTextBoxMatrix.translate(aObjectRange.getMinimum().getX(), aObjectRange.getMinimum().getY()); } -- cgit v1.2.3 From 6a2056ba29b2236108ac1099f44221f4048d1eb9 Mon Sep 17 00:00:00 2001 From: sj Date: Fri, 13 Nov 2009 15:38:23 +0100 Subject: impress181: #i76407,160798# fixed some text orientation problems for the Excel import filter --- sc/source/filter/excel/xiescher.cxx | 128 +++++++++++++++++++++++++++++------- sc/source/filter/inc/xiescher.hxx | 2 +- 2 files changed, 106 insertions(+), 24 deletions(-) diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx index 599b33f9c8aa..f7427b733d97 100644 --- a/sc/source/filter/excel/xiescher.cxx +++ b/sc/source/filter/excel/xiescher.cxx @@ -1422,38 +1422,120 @@ void XclImpTextObj::DoProcessSdrObj( SdrObject& rSdrObj ) const (with no content) while exporting to XLS, which can cause a corrupted exported document. */ - // horizontal text alignment SvxAdjust eHorAlign = SVX_ADJUST_LEFT; - switch( maTextData.maData.GetHorAlign() ) - { - case EXC_OBJ_HOR_LEFT: eHorAlign = SVX_ADJUST_LEFT; break; - case EXC_OBJ_HOR_CENTER: eHorAlign = SVX_ADJUST_CENTER; break; - case EXC_OBJ_HOR_RIGHT: eHorAlign = SVX_ADJUST_RIGHT; break; - case EXC_OBJ_HOR_JUSTIFY: eHorAlign = SVX_ADJUST_BLOCK; break; - } - rSdrObj.SetMergedItem( SvxAdjustItem( eHorAlign, EE_PARA_JUST ) ); - - // vertical text alignment SdrTextVertAdjust eVerAlign = SDRTEXTVERTADJUST_TOP; - switch( maTextData.maData.GetVerAlign() ) - { - case EXC_OBJ_VER_TOP: eVerAlign = SDRTEXTVERTADJUST_TOP; break; - case EXC_OBJ_VER_CENTER: eVerAlign = SDRTEXTVERTADJUST_CENTER; break; - case EXC_OBJ_VER_BOTTOM: eVerAlign = SDRTEXTVERTADJUST_BOTTOM; break; - case EXC_OBJ_VER_JUSTIFY: eVerAlign = SDRTEXTVERTADJUST_BLOCK; break; - } - rSdrObj.SetMergedItem( SdrTextVertAdjustItem( eVerAlign ) ); // orientation (this is only a fake, drawing does not support real text orientation) namespace csst = ::com::sun::star::text; csst::WritingMode eWriteMode = csst::WritingMode_LR_TB; switch( maTextData.maData.mnOrient ) { - case EXC_OBJ_ORIENT_NONE: eWriteMode = csst::WritingMode_LR_TB; break; - case EXC_OBJ_ORIENT_STACKED: eWriteMode = csst::WritingMode_TB_RL; break; - case EXC_OBJ_ORIENT_90CCW: eWriteMode = csst::WritingMode_TB_RL; break; - case EXC_OBJ_ORIENT_90CW: eWriteMode = csst::WritingMode_TB_RL; break; + default: + case EXC_OBJ_ORIENT_NONE: + { + eWriteMode = csst::WritingMode_LR_TB; + switch( maTextData.maData.GetHorAlign() ) + { + case EXC_OBJ_HOR_LEFT: eHorAlign = SVX_ADJUST_LEFT; break; + case EXC_OBJ_HOR_CENTER: eHorAlign = SVX_ADJUST_CENTER; break; + case EXC_OBJ_HOR_RIGHT: eHorAlign = SVX_ADJUST_RIGHT; break; + case EXC_OBJ_HOR_JUSTIFY: eHorAlign = SVX_ADJUST_BLOCK; break; + } + switch( maTextData.maData.GetVerAlign() ) + { + case EXC_OBJ_VER_TOP: eVerAlign = SDRTEXTVERTADJUST_TOP; break; + case EXC_OBJ_VER_CENTER: eVerAlign = SDRTEXTVERTADJUST_CENTER; break; + case EXC_OBJ_VER_BOTTOM: eVerAlign = SDRTEXTVERTADJUST_BOTTOM; break; + case EXC_OBJ_VER_JUSTIFY: eVerAlign = SDRTEXTVERTADJUST_BLOCK; break; + } + } + break; + + case EXC_OBJ_ORIENT_90CCW: + { + if( SdrObjCustomShape* pObjCustomShape = dynamic_cast< SdrObjCustomShape* >( &rSdrObj ) ) + { + double fAngle = 180.0; + com::sun::star::beans::PropertyValue aTextRotateAngle; + aTextRotateAngle.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "TextRotateAngle" ) ); + aTextRotateAngle.Value <<= fAngle; + SdrCustomShapeGeometryItem& rGeometryItem = (SdrCustomShapeGeometryItem&)pObjCustomShape->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ); + rGeometryItem.SetPropertyValue( aTextRotateAngle ); + } + eWriteMode = csst::WritingMode_TB_RL; + switch( maTextData.maData.GetHorAlign() ) + { + case EXC_OBJ_HOR_LEFT: eVerAlign = SDRTEXTVERTADJUST_TOP; break; + case EXC_OBJ_HOR_CENTER: eVerAlign = SDRTEXTVERTADJUST_CENTER; break; + case EXC_OBJ_HOR_RIGHT: eVerAlign = SDRTEXTVERTADJUST_BOTTOM; break; + case EXC_OBJ_HOR_JUSTIFY: eVerAlign = SDRTEXTVERTADJUST_BLOCK; break; + } + MSO_Anchor eTextAnchor = (MSO_Anchor)GetObjectManager().GetDffManager().GetPropertyValue( DFF_Prop_anchorText, mso_anchorTop ); + switch( eTextAnchor ) + { + case mso_anchorTopCentered : + case mso_anchorMiddleCentered : + case mso_anchorBottomCentered : + { + eHorAlign = SVX_ADJUST_CENTER; + } + break; + + default: + { + switch( maTextData.maData.GetVerAlign() ) + { + case EXC_OBJ_VER_TOP: eHorAlign = SVX_ADJUST_RIGHT; break; + case EXC_OBJ_VER_CENTER: eHorAlign = SVX_ADJUST_CENTER; break; + case EXC_OBJ_VER_BOTTOM: eHorAlign = SVX_ADJUST_LEFT; break; + case EXC_OBJ_VER_JUSTIFY: eHorAlign = SVX_ADJUST_BLOCK; break; + } + } + } + } + break; + + case EXC_OBJ_ORIENT_STACKED: // PASSTHROUGH INTENDED + { + // sj: STACKED is not supported, maybe it can be optimized here a bit + } + case EXC_OBJ_ORIENT_90CW: + { + eWriteMode = csst::WritingMode_TB_RL; + switch( maTextData.maData.GetHorAlign() ) + { + case EXC_OBJ_HOR_LEFT: eVerAlign = SDRTEXTVERTADJUST_BOTTOM; break; + case EXC_OBJ_HOR_CENTER: eVerAlign = SDRTEXTVERTADJUST_CENTER; break; + case EXC_OBJ_HOR_RIGHT: eVerAlign = SDRTEXTVERTADJUST_TOP; break; + case EXC_OBJ_HOR_JUSTIFY: eVerAlign = SDRTEXTVERTADJUST_BLOCK; break; + } + MSO_Anchor eTextAnchor = (MSO_Anchor)GetObjectManager().GetDffManager().GetPropertyValue( DFF_Prop_anchorText, mso_anchorTop ); + switch ( eTextAnchor ) + { + case mso_anchorTopCentered : + case mso_anchorMiddleCentered : + case mso_anchorBottomCentered : + { + eHorAlign = SVX_ADJUST_CENTER; + } + break; + + default: + { + switch( maTextData.maData.GetVerAlign() ) + { + case EXC_OBJ_VER_TOP: eHorAlign = SVX_ADJUST_LEFT; break; + case EXC_OBJ_VER_CENTER: eHorAlign = SVX_ADJUST_CENTER; break; + case EXC_OBJ_VER_BOTTOM: eHorAlign = SVX_ADJUST_RIGHT; break; + case EXC_OBJ_VER_JUSTIFY: eHorAlign = SVX_ADJUST_BLOCK; break; + } + } + } + } + break; } + rSdrObj.SetMergedItem( SvxAdjustItem( eHorAlign, EE_PARA_JUST ) ); + rSdrObj.SetMergedItem( SdrTextVertAdjustItem( eVerAlign ) ); rSdrObj.SetMergedItem( SvxWritingModeItem( eWriteMode, SDRATTR_TEXTDIRECTION ) ); } } diff --git a/sc/source/filter/inc/xiescher.hxx b/sc/source/filter/inc/xiescher.hxx index c9d2daa6bb2f..a021f7ab809e 100644 --- a/sc/source/filter/inc/xiescher.hxx +++ b/sc/source/filter/inc/xiescher.hxx @@ -979,7 +979,7 @@ class SdrObjList; /** Derived from SvxMSDffManager and SvxMSConvertOCXControls, contains core implementation of DFF stream import and OCX form control import. */ -class XclImpDffManager : protected XclImpSimpleDffManager, protected SvxMSConvertOCXControls +class XclImpDffManager : public XclImpSimpleDffManager, protected SvxMSConvertOCXControls { public: explicit XclImpDffManager( -- cgit v1.2.3 From d529dfa3b1bebe6f284cbc4d0779eb0a058074fb Mon Sep 17 00:00:00 2001 From: sj Date: Fri, 13 Nov 2009 17:19:14 +0100 Subject: impress181: #i106770# applied patch from cmc --- sd/source/filter/eppt/epptso.cxx | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx index 6b0e12213449..b234595e0b9b 100644 --- a/sd/source/filter/eppt/epptso.cxx +++ b/sd/source/filter/eppt/epptso.cxx @@ -2418,15 +2418,10 @@ void ParagraphObj::CalculateGraphicBulletSize( sal_uInt16 nFontHeight ) // from sw/source/filter/ww8/wrtw8num.cxx for default bullets to export to MS intact static void lcl_SubstituteBullet(String& rNumStr, rtl_TextEncoding& rChrSet, String& rFontName) { - StarSymbolToMSMultiFont *pConvert = 0; - FontFamily eFamily = FAMILY_DECORATIVE; - - if (!pConvert) - { - pConvert = CreateStarSymbolToMSMultiFont(); - } sal_Unicode cChar = rNumStr.GetChar(0); + StarSymbolToMSMultiFont *pConvert = CreateStarSymbolToMSMultiFont(); String sFont = pConvert->ConvertChar(cChar); + delete pConvert; if (sFont.Len()) { rNumStr = static_cast< sal_Unicode >(cChar | 0xF000); @@ -2442,7 +2437,6 @@ static void lcl_SubstituteBullet(String& rNumStr, rtl_TextEncoding& rChrSet, Str let words own font substitution kick in */ rChrSet = RTL_TEXTENCODING_UNICODE; - eFamily = FAMILY_SWISS; rFontName = ::GetFontToken(rFontName, 0); } else @@ -2455,7 +2449,6 @@ static void lcl_SubstituteBullet(String& rNumStr, rtl_TextEncoding& rChrSet, Str rFontName.AssignAscii(RTL_CONSTASCII_STRINGPARAM("Wingdings")); rNumStr = static_cast< sal_Unicode >(0x6C); } - delete pConvert; } void ParagraphObj::ImplGetNumberingLevel( PPTExBulletProvider& rBuProv, sal_Int16 nNumberingDepth, sal_Bool bIsBullet, sal_Bool bGetPropStateValue ) -- cgit v1.2.3 From 84ee5031ad683efebd6d48bebf3b4021261cca55 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Mon, 16 Nov 2009 13:34:30 +0100 Subject: make constructor public --- svx/inc/svx/sdr/contact/viewobjectcontactofunocontrol.hxx | 2 -- 1 file changed, 2 deletions(-) diff --git a/svx/inc/svx/sdr/contact/viewobjectcontactofunocontrol.hxx b/svx/inc/svx/sdr/contact/viewobjectcontactofunocontrol.hxx index c8fa03d4e88c..f94ad61ddd4d 100644 --- a/svx/inc/svx/sdr/contact/viewobjectcontactofunocontrol.hxx +++ b/svx/inc/svx/sdr/contact/viewobjectcontactofunocontrol.hxx @@ -66,7 +66,6 @@ namespace sdr { namespace contact { public: ViewObjectContactOfUnoControl( ObjectContact& _rObjectContact, ViewContactOfUnoControl& _rViewContact ); - /// determines whether an XControl already exists, and is currently visible bool isControlVisible() const; @@ -105,7 +104,6 @@ namespace sdr { namespace contact { void onControlChangedOrModified( ImplAccess ) { impl_onControlChangedOrModified(); } protected: - ViewObjectContactOfUnoControl( ObjectContact& _rObjectContact, ViewContactOfUnoControl& _rViewContact ); ~ViewObjectContactOfUnoControl(); // support for Primitive2D -- cgit v1.2.3 From 2b926e382b97914720e1974de27067b270d25ed0 Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Mon, 16 Nov 2009 15:03:54 +0100 Subject: #i82435# enable drop of image link embedded --- svx/inc/svx/numitem.hxx | 8 ++++---- svx/source/items/numitem.cxx | 10 ++++++++++ xmloff/source/draw/ximpshap.cxx | 13 ++++++++++++- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/svx/inc/svx/numitem.hxx b/svx/inc/svx/numitem.hxx index 17eb3d62630c..920028fde178 100644 --- a/svx/inc/svx/numitem.hxx +++ b/svx/inc/svx/numitem.hxx @@ -192,12 +192,12 @@ public: // <-- SvxNumberFormat(const SvxNumberFormat& rFormat); // --> OD 2008-01-09 #newlistlevelattrs# - no longer used -// SvxNumberFormat(SvStream &rStream); + //SvxNumberFormat(SvStream &rStream); // <-- virtual ~SvxNumberFormat(); // --> OD 2008-01-09 #newlistlevelattrs# - no longer used -// SvStream& Store(SvStream &rStream, FontToSubsFontConverter pConverter); + //SvStream& Store(SvStream &rStream, FontToSubsFontConverter pConverter); // <-- SvxNumberFormat& operator=( const SvxNumberFormat& ); @@ -355,8 +355,8 @@ public: virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const; // --> OD 2008-01-09 #newlistlevelattrs# - no longer used -// virtual SfxPoolItem* Create(SvStream &, USHORT) const; -// virtual SvStream& Store(SvStream &, USHORT nItemVersion ) const; + virtual SfxPoolItem* Create(SvStream &, USHORT) const; + virtual SvStream& Store(SvStream &, USHORT nItemVersion ) const; // virtual USHORT GetVersion( USHORT nFileVersion ) const; // <-- virtual int operator==( const SfxPoolItem& ) const; diff --git a/svx/source/items/numitem.cxx b/svx/source/items/numitem.cxx index 0a9b7786a476..f8dcff4b286e 100644 --- a/svx/source/items/numitem.cxx +++ b/svx/source/items/numitem.cxx @@ -1146,6 +1146,16 @@ SvxNumBulletItem::SvxNumBulletItem(SvxNumRule& rRule, USHORT _nWhich ) : { } +SfxPoolItem* SvxNumBulletItem::Create(SvStream &s, USHORT n) const +{ + return SfxPoolItem::Create(s, n ); +} + +SvStream& SvxNumBulletItem::Store(SvStream & s, USHORT v ) const +{ + return SfxPoolItem::Store( s, v ); +} + /* -----------------27.10.98 10:41------------------- * * --------------------------------------------------*/ diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index 65aad96bad86..c4c86abb7eef 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -2994,7 +2994,18 @@ void SdXMLPluginShapeContext::EndElement() else { // in case we have a media object - xProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "MediaURL" ) ), uno::makeAny( maHref ) ); + + OUString sTempRef; + + // check for package URL + if( GetImport().IsPackageURL( maHref ) ) + { + sTempRef = OUString( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.Package:" ) ); + } + + sTempRef += maHref; + + xProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "MediaURL" ) ), uno::makeAny( sTempRef ) ); for( sal_Int32 nParam = 0; nParam < maParams.getLength(); ++nParam ) { -- cgit v1.2.3 From 593892f63dc03cdf2478ed07adb807a033e2cc5a Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Mon, 16 Nov 2009 15:03:54 +0100 Subject: #i82435# enable drop of image link embedded --- sd/source/ui/view/sdview4.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx index 72534b476a73..748c23338d44 100644 --- a/sd/source/ui/view/sdview4.cxx +++ b/sd/source/ui/view/sdview4.cxx @@ -377,9 +377,10 @@ IMPL_LINK( View, DropInsertFileHdl, Timer*, EMPTYARG ) if( !pGraphicFilter->ImportGraphic( aGraphic, aURL ) ) { sal_Int8 nTempAction = ( aIter == maDropFileVector.begin() ) ? mnAction : 0; + const bool bLink = ( ( nTempAction & DND_ACTION_LINK ) != 0 ); SdrGrafObj* pGrafObj = InsertGraphic( aGraphic, nTempAction, maDropPos, NULL, NULL ); - if( pGrafObj ) + if( pGrafObj && bLink ) pGrafObj->SetGraphicLink( aCurrentDropFile, String() ); // return action from first inserted graphic -- cgit v1.2.3 From 8c97f26be6290ee6d8ca201d9db66a2a6f7902aa Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Mon, 16 Nov 2009 16:29:18 +0100 Subject: dba33d: #i106737# set the databasedataprovider when doc is loaded --- reportdesign/source/core/api/ReportDefinition.cxx | 3 +-- .../source/filter/xml/xmlImportDocumentHandler.cxx | 29 ++++++++++++++-------- .../source/filter/xml/xmlImportDocumentHandler.hxx | 1 - 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx index a79dea71193c..603f54bd3f6c 100644 --- a/reportdesign/source/core/api/ReportDefinition.cxx +++ b/reportdesign/source/core/api/ReportDefinition.cxx @@ -563,8 +563,7 @@ namespace } catch(uno::Exception& ex) { - (void)ex; - OSL_ASSERT(0); + DBG_UNHANDLED_EXCEPTION(); } } void SAL_CALL FactoryLoader::onTerminated() diff --git a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx index 4cf7c9c5abc9..930c7cb8ad12 100644 --- a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx +++ b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -59,7 +60,6 @@ using namespace ::xmloff::token; ImportDocumentHandler::ImportDocumentHandler(uno::Reference< uno::XComponentContext > const & context) : m_xContext(context) - ,m_bOnlyOnce(true) { } // ----------------------------------------------------------------------------- @@ -124,7 +124,24 @@ void SAL_CALL ImportDocumentHandler::endDocument() throw (uno::RuntimeException, m_xDelegatee->endDocument(); uno::Reference< chart2::data::XDataReceiver > xReceiver(m_xModel,uno::UNO_QUERY_THROW); if ( xReceiver.is() ) + { xReceiver->attachDataProvider(m_xDatabaseDataProvider.get()); + // this fills the chart again + uno::Sequence< beans::PropertyValue > aArgs( 4 ); + aArgs[0] = beans::PropertyValue( + ::rtl::OUString::createFromAscii("CellRangeRepresentation"), -1, + uno::makeAny( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("all")) ), beans::PropertyState_DIRECT_VALUE ); + aArgs[1] = beans::PropertyValue( + ::rtl::OUString::createFromAscii("HasCategories"), -1, + uno::makeAny( sal_True ), beans::PropertyState_DIRECT_VALUE ); + aArgs[2] = beans::PropertyValue( + ::rtl::OUString::createFromAscii("FirstCellAsLabel"), -1, + uno::makeAny( sal_True ), beans::PropertyState_DIRECT_VALUE ); + aArgs[3] = beans::PropertyValue( + ::rtl::OUString::createFromAscii("DataRowSource"), -1, + uno::makeAny( chart::ChartDataRowSource_COLUMNS ), beans::PropertyState_DIRECT_VALUE ); + xReceiver->setArguments( aArgs ); + } } void SAL_CALL ImportDocumentHandler::startElement(const ::rtl::OUString & _sName, const uno::Reference< xml::sax::XAttributeList > & _xAttrList) throw (uno::RuntimeException, xml::sax::SAXException) @@ -257,16 +274,6 @@ void SAL_CALL ImportDocumentHandler::startElement(const ::rtl::OUString & _sName } } // for(;pArgIter != pArgEnd;++pArgIter) - if ( m_bOnlyOnce ) - { - try - { - m_xDatabaseDataProvider->createDataSource(m_aArguments); - m_bOnlyOnce = false; - } - catch(uno::Exception) - {} - } // if ( m_bOnlyOnce ) SvXMLAttributeList* pList = new SvXMLAttributeList(); xNewAttribs = pList; diff --git a/reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx b/reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx index 068fac8cb5f9..69772a71674d 100644 --- a/reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx +++ b/reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx @@ -100,7 +100,6 @@ private: ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDatabaseDataProvider > m_xDatabaseDataProvider; ::std::auto_ptr m_pReportElemTokenMap; - bool m_bOnlyOnce; }; // ----------------------------------------------------------------------------- } // namespace rptxml -- cgit v1.2.3 From 87883bec42caa81704e5b64fb8a5d553326f7cc6 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Mon, 16 Nov 2009 17:05:37 +0100 Subject: dba33d: #i105554# apply patch from cmc --- reportdesign/inc/RptObject.hxx | 1 - reportdesign/inc/reportformula.hxx | 3 - .../source/core/api/ReportControlModel.cxx | 8 --- .../source/core/inc/ReportControlModel.hxx | 2 - reportdesign/source/core/misc/reportformula.cxx | 6 -- reportdesign/source/core/sdr/RptObject.cxx | 16 ----- reportdesign/source/filter/xml/xmlExport.cxx | 73 ---------------------- reportdesign/source/filter/xml/xmlExport.hxx | 2 - reportdesign/source/ui/inc/DesignView.hxx | 2 + reportdesign/source/ui/inc/ReportWindow.hxx | 1 - reportdesign/source/ui/inc/ScrollHelper.hxx | 1 - reportdesign/source/ui/inc/StartMarker.hxx | 4 -- reportdesign/source/ui/inc/ViewsWindow.hxx | 5 -- reportdesign/source/ui/report/DesignView.cxx | 2 + reportdesign/source/ui/report/ReportWindow.cxx | 5 -- reportdesign/source/ui/report/ScrollHelper.cxx | 5 -- reportdesign/source/ui/report/StartMarker.cxx | 6 -- reportdesign/source/ui/report/ViewsWindow.cxx | 27 -------- 18 files changed, 4 insertions(+), 165 deletions(-) diff --git a/reportdesign/inc/RptObject.hxx b/reportdesign/inc/RptObject.hxx index 00fe6d5a357f..5d2397fffa08 100644 --- a/reportdesign/inc/RptObject.hxx +++ b/reportdesign/inc/RptObject.hxx @@ -109,7 +109,6 @@ protected: virtual void SetSnapRectImpl(const Rectangle& _rRect) = 0; virtual SdrPage* GetImplPage() const = 0; virtual void SetObjectItemHelper(const SfxPoolItem& rItem); - sal_Bool IsInside(const Rectangle& _rRect,const Point& rPnt,USHORT nTol) const; /** called by instances of derived classes to implement their overloading of getUnoShape */ diff --git a/reportdesign/inc/reportformula.hxx b/reportdesign/inc/reportformula.hxx index 18d70930edc6..01e45f3b348a 100644 --- a/reportdesign/inc/reportformula.hxx +++ b/reportdesign/inc/reportformula.hxx @@ -64,9 +64,6 @@ namespace rptui ::rtl::OUString m_sUndecoratedContent; public: - // constructs a ReportFormula instance which is initially invalid. - ReportFormula(); - /// constructs a ReportFormula object from a string ReportFormula( const ::rtl::OUString& _rFormula ); diff --git a/reportdesign/source/core/api/ReportControlModel.cxx b/reportdesign/source/core/api/ReportControlModel.cxx index 6e0869d7e789..c0f5a90a446a 100644 --- a/reportdesign/source/core/api/ReportControlModel.cxx +++ b/reportdesign/source/core/api/ReportControlModel.cxx @@ -152,14 +152,6 @@ void OReportControlModel::checkIndex(sal_Int32 _nIndex) throw lang::IndexOutOfBoundsException(); } // ----------------------------------------------------------------------------- -void OReportControlModel::dispose() -{ - m_aFormatConditions.clear(); - lang::EventObject aDisposeEvent( m_pOwner ); - aContainerListeners.disposeAndClear( aDisposeEvent ); - m_aFormatConditions.clear(); -} -// ----------------------------------------------------------------------------- bool OReportControlModel::isInterfaceForbidden(const uno::Type& _rType) { return (_rType == ::getCppuType((const uno::Reference< beans::XPropertyState>* )0) || _rType == ::getCppuType((const uno::Reference< beans::XMultiPropertySet>* )0)); diff --git a/reportdesign/source/core/inc/ReportControlModel.hxx b/reportdesign/source/core/inc/ReportControlModel.hxx index a11dd61e8ed6..29f3a9d7ef9c 100644 --- a/reportdesign/source/core/inc/ReportControlModel.hxx +++ b/reportdesign/source/core/inc/ReportControlModel.hxx @@ -115,8 +115,6 @@ namespace reportdesign ,bPrintWhenGroupChange(sal_False) {} - void dispose(); - // XContainer void addContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); void removeContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); diff --git a/reportdesign/source/core/misc/reportformula.cxx b/reportdesign/source/core/misc/reportformula.cxx index 7bbd76f31796..23a0bb86e412 100644 --- a/reportdesign/source/core/misc/reportformula.cxx +++ b/reportdesign/source/core/misc/reportformula.cxx @@ -68,12 +68,6 @@ namespace rptui //==================================================================== //= ReportFormula //==================================================================== - //-------------------------------------------------------------------- - ReportFormula::ReportFormula() - :m_eType( Invalid ) - { - } - //-------------------------------------------------------------------- ReportFormula::ReportFormula( const ::rtl::OUString& _rFormula ) :m_eType( Invalid ) diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx index 2d9d3d225673..73fa05e81620 100644 --- a/reportdesign/source/core/sdr/RptObject.cxx +++ b/reportdesign/source/core/sdr/RptObject.cxx @@ -363,22 +363,6 @@ uno::Reference< beans::XPropertySet> OObjectBase::getAwtComponent() { return uno::Reference< beans::XPropertySet>(); } -// ----------------------------------------------------------------------------- -sal_Bool OObjectBase::IsInside(const Rectangle& _rRect,const Point& rPnt,USHORT nTol) const -{ - sal_Bool bRet = sal_False; - Rectangle aRect( _rRect ); - if ( !aRect.IsEmpty() ) - { - aRect.Left() -= nTol; - aRect.Top() -= nTol; - aRect.Right() = ( aRect.Right() == RECT_EMPTY ? _rRect.Left() + nTol : aRect.Right() + nTol ); - aRect.Bottom() = ( aRect.Bottom() == RECT_EMPTY ? _rRect.Top() + nTol : aRect.Bottom() + nTol ); - - bRet = aRect.IsInside( rPnt ); - } - return bRet; -} //---------------------------------------------------------------------------- void OObjectBase::StartListening() { diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx index b0012e731c81..588b8c4a0e61 100644 --- a/reportdesign/source/filter/xml/xmlExport.cxx +++ b/reportdesign/source/filter/xml/xmlExport.cxx @@ -172,40 +172,6 @@ namespace rptxml } //--------------------------------------------------------------------- - ::rtl::OUString lcl_implGetPropertyXMLType(const Type& _rType) - { - // possible types we can write (either because we recognize them directly or because we convert _rValue - // into one of these types) - static const ::rtl::OUString s_sTypeBoolean (RTL_CONSTASCII_USTRINGPARAM("boolean")); - static const ::rtl::OUString s_sTypeShort (RTL_CONSTASCII_USTRINGPARAM("short")); - static const ::rtl::OUString s_sTypeInteger (RTL_CONSTASCII_USTRINGPARAM("int")); - static const ::rtl::OUString s_sTypeLong (RTL_CONSTASCII_USTRINGPARAM("long")); - static const ::rtl::OUString s_sTypeDouble (RTL_CONSTASCII_USTRINGPARAM("double")); - static const ::rtl::OUString s_sTypeString (RTL_CONSTASCII_USTRINGPARAM("string")); - - // handle the type description - switch (_rType.getTypeClass()) - { - case TypeClass_STRING: - return s_sTypeString; - case TypeClass_DOUBLE: - return s_sTypeDouble; - case TypeClass_BOOLEAN: - return s_sTypeBoolean; - case TypeClass_BYTE: - case TypeClass_SHORT: - return s_sTypeShort; - case TypeClass_LONG: - return s_sTypeInteger; - case TypeClass_HYPER: - return s_sTypeLong; - case TypeClass_ENUM: - return s_sTypeInteger; - - default: - return s_sTypeDouble; - } - } class OSpecialHanldeXMLExportPropertyMapper : public SvXMLExportPropertyMapper { @@ -1486,45 +1452,6 @@ sal_uInt32 ORptExport::exportDoc(enum ::xmloff::token::XMLTokenEnum eClass) return aBuffer.makeStringAndClear(); } // ----------------------------------------------------------------------------- -::rtl::OUString ORptExport::implConvertMeasure(sal_Int32 _nValue) -{ - ::rtl::OUStringBuffer aBuffer; - GetMM100UnitConverter().convertMeasure(aBuffer, _nValue); - return aBuffer.makeStringAndClear(); -} -// ----------------------------------------------------------------------------- -::rtl::OUString ORptExport::implConvertAny(const Any& _rValue) -{ - ::rtl::OUStringBuffer aBuffer; - switch (_rValue.getValueTypeClass()) - { - case TypeClass_STRING: - { // extract the string - ::rtl::OUString sCurrentValue; - _rValue >>= sCurrentValue; - aBuffer.append(sCurrentValue); - } - break; - case TypeClass_DOUBLE: - // let the unit converter format is as string - GetMM100UnitConverter().convertDouble(aBuffer, getDouble(_rValue)); - break; - case TypeClass_BOOLEAN: - aBuffer = getBOOL(_rValue) ? ::xmloff::token::GetXMLToken(XML_TRUE) : ::xmloff::token::GetXMLToken(XML_FALSE); - break; - case TypeClass_BYTE: - case TypeClass_SHORT: - case TypeClass_LONG: - // let the unit converter format is as string - GetMM100UnitConverter().convertNumber(aBuffer, getINT32(_rValue)); - break; - default: - OSL_ENSURE(0,"ORptExport::implConvertAny: Invalid type"); - } - - return aBuffer.makeStringAndClear(); -} -// ----------------------------------------------------------------------------- UniReference < XMLPropertySetMapper > ORptExport::GetCellStylePropertyMapper() const { return m_xCellStylesPropertySetMapper; diff --git a/reportdesign/source/filter/xml/xmlExport.hxx b/reportdesign/source/filter/xml/xmlExport.hxx index 3b8e621b52ae..3bd478b60ba8 100644 --- a/reportdesign/source/filter/xml/xmlExport.hxx +++ b/reportdesign/source/filter/xml/xmlExport.hxx @@ -177,9 +177,7 @@ private: void exportGroupsExpressionAsFunction(const Reference< XGroups>& _xGroups); ::rtl::OUString convertFormula(const ::rtl::OUString& _sFormula); - ::rtl::OUString implConvertAny(const Any& _rValue); ::rtl::OUString implConvertNumber(sal_Int32 _nValue); - ::rtl::OUString implConvertMeasure(sal_Int32 _nValue); private: ORptExport(); diff --git a/reportdesign/source/ui/inc/DesignView.hxx b/reportdesign/source/ui/inc/DesignView.hxx index 683e4cb78a3d..cd42b1e85007 100644 --- a/reportdesign/source/ui/inc/DesignView.hxx +++ b/reportdesign/source/ui/inc/DesignView.hxx @@ -160,9 +160,11 @@ namespace rptui */ void alignMarkedObjects(sal_Int32 _nControlModification, bool _bAlignAtSection, bool bBoundRects = false); +#if 0 /** checks if alignment is possible in the current section */ sal_Bool isAlignPossible() const; +#endif /** All objects will be marked. */ diff --git a/reportdesign/source/ui/inc/ReportWindow.hxx b/reportdesign/source/ui/inc/ReportWindow.hxx index e406bcf7ccb9..fcf274d314e4 100644 --- a/reportdesign/source/ui/inc/ReportWindow.hxx +++ b/reportdesign/source/ui/inc/ReportWindow.hxx @@ -93,7 +93,6 @@ namespace rptui rtl::OUString GetInsertObjString() const; void setGridSnap(BOOL bOn); void setDragStripes(BOOL bOn); - BOOL isDragStripes() const; /** copies the current selection in this section */ diff --git a/reportdesign/source/ui/inc/ScrollHelper.hxx b/reportdesign/source/ui/inc/ScrollHelper.hxx index 4eaf9720abda..6098c7bbb2e1 100644 --- a/reportdesign/source/ui/inc/ScrollHelper.hxx +++ b/reportdesign/source/ui/inc/ScrollHelper.hxx @@ -106,7 +106,6 @@ namespace rptui rtl::OUString GetInsertObjString() const; void setGridSnap(BOOL bOn); void setDragStripes(BOOL bOn); - BOOL isDragStripes() const; /** copies the current selection in this section */ void Copy(); diff --git a/reportdesign/source/ui/inc/StartMarker.hxx b/reportdesign/source/ui/inc/StartMarker.hxx index d14abd076fc5..a9d532bb95dc 100644 --- a/reportdesign/source/ui/inc/StartMarker.hxx +++ b/reportdesign/source/ui/inc/StartMarker.hxx @@ -76,10 +76,6 @@ namespace rptui void setTitle(const String& _sTitle); sal_Int32 getMinHeight() const; - /** returns the offset where the horizontal ruler must start - */ - sal_Int32 getRulerOffset() const; - /** shows or hides the ruler. */ void showRuler(sal_Bool _bShow); diff --git a/reportdesign/source/ui/inc/ViewsWindow.hxx b/reportdesign/source/ui/inc/ViewsWindow.hxx index d4e0a720807a..88c557213631 100644 --- a/reportdesign/source/ui/inc/ViewsWindow.hxx +++ b/reportdesign/source/ui/inc/ViewsWindow.hxx @@ -203,8 +203,6 @@ namespace rptui */ ::boost::shared_ptr getSectionWindow(const USHORT _nPos) const; - void showView(USHORT _nPos,BOOL _bShow); - /** turns the grid on or off * * \param _bVisible @@ -212,7 +210,6 @@ namespace rptui void toggleGrid(sal_Bool _bVisible); void setGridSnap(BOOL bOn); void setDragStripes(BOOL bOn); - BOOL isDragStripes() const; /** returns the total accumulated height of all sections until _pSection is reached */ @@ -249,8 +246,6 @@ namespace rptui */ BOOL HasSelection(); - void SectionHasFocus(OReportSection* _pSection,BOOL _bHasFocus); - /** unmark all objects on the views without the given one. * * @param _pSectionView The view where the objects should not be unmarked. diff --git a/reportdesign/source/ui/report/DesignView.cxx b/reportdesign/source/ui/report/DesignView.cxx index 40264c642d52..f6ad0b90a14d 100644 --- a/reportdesign/source/ui/report/DesignView.cxx +++ b/reportdesign/source/ui/report/DesignView.cxx @@ -680,12 +680,14 @@ void ODesignView::alignMarkedObjects(sal_Int32 _nControlModification,bool _bAlig { m_aScrollWindow.alignMarkedObjects(_nControlModification, _bAlignAtSection,bBoundRects); } +#if 0 // ----------------------------------------------------------------------------- sal_Bool ODesignView::isAlignPossible() const { ::boost::shared_ptr pMarkedSection = getMarkedSection(); return pMarkedSection.get() && pMarkedSection->getReportSection().getSectionView().IsAlignPossible(); } +#endif //------------------------------------------------------------------------------ sal_Bool ODesignView::handleKeyEvent(const KeyEvent& _rEvent) { diff --git a/reportdesign/source/ui/report/ReportWindow.cxx b/reportdesign/source/ui/report/ReportWindow.cxx index 98dd0d2390a7..39f1c9505672 100644 --- a/reportdesign/source/ui/report/ReportWindow.cxx +++ b/reportdesign/source/ui/report/ReportWindow.cxx @@ -378,11 +378,6 @@ void OReportWindow::setDragStripes(BOOL bOn) m_aViewsWindow.setDragStripes(bOn); } // ----------------------------------------------------------------------------- -BOOL OReportWindow::isDragStripes() const -{ - return m_aViewsWindow.isDragStripes(); -} -// ----------------------------------------------------------------------------- sal_uInt32 OReportWindow::getMarkedObjectCount() const { return m_aViewsWindow.getMarkedObjectCount(); diff --git a/reportdesign/source/ui/report/ScrollHelper.cxx b/reportdesign/source/ui/report/ScrollHelper.cxx index 5d13f78f3755..b39824d5e8ea 100644 --- a/reportdesign/source/ui/report/ScrollHelper.cxx +++ b/reportdesign/source/ui/report/ScrollHelper.cxx @@ -393,11 +393,6 @@ void OScrollWindowHelper::setDragStripes(BOOL bOn) m_aReportWindow.setDragStripes(bOn); } // ----------------------------------------------------------------------------- -BOOL OScrollWindowHelper::isDragStripes() const -{ - return m_aReportWindow.isDragStripes(); -} -// ----------------------------------------------------------------------------- sal_uInt32 OScrollWindowHelper::getMarkedObjectCount() const { return m_aReportWindow.getMarkedObjectCount(); diff --git a/reportdesign/source/ui/report/StartMarker.cxx b/reportdesign/source/ui/report/StartMarker.cxx index d87f7464a140..7c51439cd124 100644 --- a/reportdesign/source/ui/report/StartMarker.cxx +++ b/reportdesign/source/ui/report/StartMarker.cxx @@ -285,12 +285,6 @@ void OStartMarker::showRuler(sal_Bool _bShow) m_bShowRuler = _bShow; m_aVRuler.Show(!m_bCollapsed && m_bShowRuler); } -//------------------------------------------------------------------------------ -sal_Int32 OStartMarker::getRulerOffset() const -{ - return m_aVRuler.GetSizePixel().Width(); -} - //------------------------------------------------------------------------------ void OStartMarker::RequestHelp( const HelpEvent& rHEvt ) { diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx index aebf42bfaa00..999dcf79f915 100644 --- a/reportdesign/source/ui/report/ViewsWindow.cxx +++ b/reportdesign/source/ui/report/ViewsWindow.cxx @@ -337,12 +337,6 @@ void OViewsWindow::removeSection(USHORT _nPosition) Resize(); } // if ( _nPosition < m_aSections.size() ) } -//---------------------------------------------------------------------------- -void OViewsWindow::showView(USHORT _nPos,BOOL _bShow) -{ - if ( _nPos < m_aSections.size() ) - m_aSections[_nPos]->setCollapsed(_bShow); -} //------------------------------------------------------------------------------ void OViewsWindow::toggleGrid(BOOL _bVisible) { @@ -534,21 +528,6 @@ void OViewsWindow::SelectAll(const sal_uInt16 _nObjectType) ::std::compose1(::boost::bind(::boost::mem_fn(&OReportSection::SelectAll),_1,_nObjectType),TReportPairHelper())); m_bInUnmark = sal_False; } -//---------------------------------------------------------------------------- -void OViewsWindow::SectionHasFocus(OReportSection* /*_pSection*/,BOOL /*_bHasFocus*/) -{ -/* LLA!: this function does nothing! -TSectionsMap::iterator aIter = m_aSections.begin(); - TSectionsMap::iterator aEnd = m_aSections.end(); - for (USHORT i = 0 ; aIter != aEnd ; ++aIter,++i) - { - if ( (*aIter).first.get() == _pSection ) - { - - } - } -*/ -} //----------------------------------------------------------------------------- void OViewsWindow::unmarkAllObjects(OSectionView* _pSectionView) { @@ -987,12 +966,6 @@ void OViewsWindow::setDragStripes(BOOL bOn) (*aIter)->getReportSection().getSectionView().SetDragStripes(bOn); } // ----------------------------------------------------------------------------- -BOOL OViewsWindow::isDragStripes() const -{ - return !m_aSections.empty() && (*m_aSections.begin())->getReportSection().getSectionView().IsDragStripes(); -} -// ----------------------------------------------------------------------------- - USHORT OViewsWindow::getPosition(const OSectionWindow* _pSectionWindow) const { TSectionsMap::const_iterator aIter = m_aSections.begin(); -- cgit v1.2.3 From 4f53363910f5198c26f9b1094c7d1097fdc21582 Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Mon, 16 Nov 2009 17:58:26 +0100 Subject: #i95238# re enable toggle of title paragraphs in outliner view --- svx/source/outliner/outlvw.cxx | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/svx/source/outliner/outlvw.cxx b/svx/source/outliner/outlvw.cxx index a69776df14e8..e85cd96a95d8 100644 --- a/svx/source/outliner/outlvw.cxx +++ b/svx/source/outliner/outlvw.cxx @@ -357,6 +357,18 @@ BOOL __EXPORT OutlinerView::MouseButtonDown( const MouseEvent& rMEvt ) aDDStartPosRef=pEditView->GetWindow()->PixelToLogic( aDDStartPosPix,pOwner->GetRefMapMode()); return TRUE; } + + // special case for outliner view in impress, check if double click hits the page icon for toggle + if( (nPara == EE_PARA_NOT_FOUND) && (pOwner->ImplGetOutlinerMode() == OUTLINERMODE_OUTLINEVIEW) && (eTarget == MouseText) && (rMEvt.GetClicks() == 2) ) + { + ESelection aSel( pEditView->GetSelection() ); + nPara = aSel.nStartPara; + Paragraph* pPara = pOwner->pParaList->GetParagraph( nPara ); + if( (pPara && pOwner->pParaList->HasChilds(pPara)) && pPara->HasFlag(PARAFLAG_ISPAGE) ) + { + ImpToggleExpand( pPara ); + } + } return pEditView->MouseButtonDown( rMEvt ); } @@ -1644,14 +1656,14 @@ USHORT OutlinerView::GetSelectedScriptType() const return pEditView->GetSelectedScriptType(); } -String OutlinerView::GetSurroundingText() const -{ - DBG_CHKTHIS(OutlinerView,0); - return pEditView->GetSurroundingText(); -} - -Selection OutlinerView::GetSurroundingTextSelection() const -{ - DBG_CHKTHIS(OutlinerView,0); - return pEditView->GetSurroundingTextSelection(); -} +String OutlinerView::GetSurroundingText() const +{ + DBG_CHKTHIS(OutlinerView,0); + return pEditView->GetSurroundingText(); +} + +Selection OutlinerView::GetSurroundingTextSelection() const +{ + DBG_CHKTHIS(OutlinerView,0); + return pEditView->GetSurroundingTextSelection(); +} -- cgit v1.2.3 From 43b559189d10a54409bdab90c92def6b9a341b4f Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Mon, 16 Nov 2009 21:02:12 +0000 Subject: #i106583# Use the up-to-date output range when refreshing datapilot tables. --- sc/source/filter/excel/xipivot.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sc/source/filter/excel/xipivot.cxx b/sc/source/filter/excel/xipivot.cxx index b77df97a0448..0eedd6bbbd7d 100644 --- a/sc/source/filter/excel/xipivot.cxx +++ b/sc/source/filter/excel/xipivot.cxx @@ -1435,7 +1435,8 @@ void XclImpPivotTable::MaybeRefresh() { // 'refresh table on load' flag is set. Refresh the table now. Some // Excel files contain partial table output when this flag is set. - mpDPObj->Output(maOutScRange.aStart); + ScRange aOutRange = mpDPObj->GetOutRange(); + mpDPObj->Output(aOutRange.aStart); } } -- cgit v1.2.3 From 77f0f65166af5d0c899136a0f91a5b49e19fcae7 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Tue, 17 Nov 2009 12:37:36 +0100 Subject: #i10000# --- comphelper/source/property/property.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/comphelper/source/property/property.cxx b/comphelper/source/property/property.cxx index 14b3b8f9169d..17949b9889dd 100644 --- a/comphelper/source/property/property.cxx +++ b/comphelper/source/property/property.cxx @@ -67,7 +67,9 @@ namespace comphelper using ::com::sun::star::uno::cpp_queryInterface; using ::com::sun::star::uno::cpp_acquire; using ::com::sun::star::uno::cpp_release; +#if OSL_DEBUG_LEVEL > 0 using ::com::sun::star::lang::XServiceInfo; +#endif using ::com::sun::star::uno::UNO_QUERY; /** === end UNO using === **/ namespace PropertyAttribute = ::com::sun::star::beans::PropertyAttribute; -- cgit v1.2.3 From 62304c9343b1fbd247c813111ed13e3359998340 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Tue, 17 Nov 2009 18:35:42 +0000 Subject: #i106975# Added new namespace tableooo to handle extended ODF for 'table' namespace. --- xmloff/inc/xmlnmspe.hxx | 3 ++- xmloff/inc/xmloff/xmltoken.hxx | 3 +++ xmloff/source/core/xmlimp.cxx | 4 ++++ xmloff/source/core/xmltoken.cxx | 3 +++ xmloff/source/draw/sdxmlexp.cxx | 5 +++++ 5 files changed, 17 insertions(+), 1 deletion(-) diff --git a/xmloff/inc/xmlnmspe.hxx b/xmloff/inc/xmlnmspe.hxx index f90ff05c084d..795b71b1a5bb 100644 --- a/xmloff/inc/xmlnmspe.hxx +++ b/xmloff/inc/xmlnmspe.hxx @@ -89,8 +89,9 @@ const sal_uInt16 XML_NAMESPACE_##prefix##_EXT = key; \ const sal_uInt16 XML_NAMESPACE_##prefix##_EXT_IDX = key; XML_NAMESPACE_EXT( OFFICE, 37U ) +XML_NAMESPACE_EXT( TABLE, 38U ) -#define _XML_OLD_NAMESPACE_BASE 38U +#define _XML_OLD_NAMESPACE_BASE 39U // namespaces used in the technical preview (SO 5.2) XML_OLD_NAMESPACE( FO, 0U ) diff --git a/xmloff/inc/xmloff/xmltoken.hxx b/xmloff/inc/xmloff/xmltoken.hxx index f4d8016a6358..4a96de28b480 100644 --- a/xmloff/inc/xmloff/xmltoken.hxx +++ b/xmloff/inc/xmloff/xmltoken.hxx @@ -148,6 +148,9 @@ namespace xmloff { namespace token { XML_NP_OFFICE_EXT, XML_N_OFFICE_EXT, + XML_NP_TABLE_EXT, + XML_N_TABLE_EXT, + // units XML_UNIT_MM, XML_UNIT_M, diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index d4dc48ede241..997712f45a95 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -101,6 +101,7 @@ sal_Char __READONLY_DATA sXML_np__of[] = "_of"; sal_Char __READONLY_DATA sXML_np__style[] = "_style"; sal_Char __READONLY_DATA sXML_np__text[] = "_text"; sal_Char __READONLY_DATA sXML_np__table[] = "_table"; +sal_Char __READONLY_DATA sXML_np__table_ext[] = "_table_ooo"; sal_Char __READONLY_DATA sXML_np__draw[] = "_draw"; sal_Char __READONLY_DATA sXML_np__dr3d[] = "_dr3d"; sal_Char __READONLY_DATA sXML_np__fo[] = "_fo"; @@ -259,6 +260,9 @@ void SvXMLImport::_InitCtor() mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__table ) ), GetXMLToken(XML_N_TABLE), XML_NAMESPACE_TABLE ); + mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__table_ext ) ), + GetXMLToken(XML_N_TABLE_EXT), + XML_NAMESPACE_TABLE_EXT ); mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__draw ) ), GetXMLToken(XML_N_DRAW), XML_NAMESPACE_DRAW ); diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx index 61c95a9dac9f..3073ead17646 100644 --- a/xmloff/source/core/xmltoken.cxx +++ b/xmloff/source/core/xmltoken.cxx @@ -156,6 +156,9 @@ namespace xmloff { namespace token { TOKEN( "officeooo", XML_NP_OFFICE_EXT ), TOKEN( "http://openoffice.org/2009/office", XML_N_OFFICE_EXT ), + TOKEN( "tableooo", XML_NP_TABLE_EXT ), + TOKEN( "http://openoffice.org/2009/table", XML_N_TABLE_EXT ), + // units TOKEN( "mm", XML_UNIT_MM ), TOKEN( "m", XML_UNIT_M ), diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx index 1d7414d4ca23..90d807efd12c 100644 --- a/xmloff/source/draw/sdxmlexp.cxx +++ b/xmloff/source/draw/sdxmlexp.cxx @@ -650,6 +650,11 @@ void SAL_CALL SdXMLExport::setSourceDocument( const Reference< lang::XComponent GetXMLToken(XML_NP_OFFICE_EXT), GetXMLToken(XML_N_OFFICE_EXT), XML_NAMESPACE_OFFICE_EXT); + + _GetNamespaceMap().Add( + GetXMLToken(XML_NP_TABLE_EXT), + GetXMLToken(XML_N_TABLE_EXT), + XML_NAMESPACE_TABLE_EXT); } GetShapeExport()->enableLayerExport(); -- cgit v1.2.3 From 4b24821fddaf7bb3ebb2097f7227befdf9a46389 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Tue, 17 Nov 2009 19:48:16 +0000 Subject: #i106975# Put the extended namespace in the (hopefully) correct place for ods export. --- xmloff/source/core/xmlexp.cxx | 6 ++++++ xmloff/source/draw/sdxmlexp.cxx | 5 ----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index 55af99802f9d..18d4644ee872 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -322,6 +322,12 @@ void SvXMLExport::_InitCtor() mpNamespaceMap->Add( GetXMLToken(XML_NP_OOOW), GetXMLToken(XML_N_OOOW), XML_NAMESPACE_OOOW ); mpNamespaceMap->Add( GetXMLToken(XML_NP_OOOC), GetXMLToken(XML_N_OOOC), XML_NAMESPACE_OOOC ); mpNamespaceMap->Add( GetXMLToken(XML_NP_OF), GetXMLToken(XML_N_OF), XML_NAMESPACE_OF ); + + if (getDefaultVersion() == SvtSaveOptions::ODFVER_LATEST) + { + mpNamespaceMap->Add( + GetXMLToken(XML_NP_TABLE_EXT), GetXMLToken(XML_N_TABLE_EXT), XML_NAMESPACE_TABLE_EXT); + } } if( (getExportFlags() & (EXPORT_MASTERSTYLES|EXPORT_CONTENT) ) != 0 ) { diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx index 90d807efd12c..1d7414d4ca23 100644 --- a/xmloff/source/draw/sdxmlexp.cxx +++ b/xmloff/source/draw/sdxmlexp.cxx @@ -650,11 +650,6 @@ void SAL_CALL SdXMLExport::setSourceDocument( const Reference< lang::XComponent GetXMLToken(XML_NP_OFFICE_EXT), GetXMLToken(XML_N_OFFICE_EXT), XML_NAMESPACE_OFFICE_EXT); - - _GetNamespaceMap().Add( - GetXMLToken(XML_NP_TABLE_EXT), - GetXMLToken(XML_N_TABLE_EXT), - XML_NAMESPACE_TABLE_EXT); } GetShapeExport()->enableLayerExport(); -- cgit v1.2.3 From 276790cd38c56be757b86c3b10d9f3815a30fa62 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Tue, 17 Nov 2009 19:49:18 +0000 Subject: #i106975# Use tableooo namespace when exporting datapilot's display names. --- sc/source/filter/xml/XMLExportDataPilot.cxx | 8 +++---- sc/source/filter/xml/xmldpimp.cxx | 4 ++++ sc/source/filter/xml/xmlimprt.cxx | 36 ++++++++++++++++------------- sc/source/filter/xml/xmlimprt.hxx | 8 +++++-- 4 files changed, 34 insertions(+), 22 deletions(-) diff --git a/sc/source/filter/xml/XMLExportDataPilot.cxx b/sc/source/filter/xml/XMLExportDataPilot.cxx index 318606ca3c49..b779f2374569 100644 --- a/sc/source/filter/xml/XMLExportDataPilot.cxx +++ b/sc/source/filter/xml/XMLExportDataPilot.cxx @@ -464,7 +464,7 @@ void ScXMLExportDataPilot::WriteSubTotals(ScDPSaveDimension* pDim) ScXMLConverter::GetStringFromFunction( sFunction, nFunc); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_FUNCTION, sFunction); if (pLayoutName && nFunc == sheet::GeneralFunction_AUTO) - rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DISPLAY_NAME, *pLayoutName); + rExport.AddAttribute(XML_NAMESPACE_TABLE_EXT, XML_DISPLAY_NAME, *pLayoutName); SvXMLElementExport aElemST(rExport, XML_NAMESPACE_TABLE, XML_DATA_PILOT_SUBTOTAL, sal_True, sal_True); } } @@ -482,7 +482,7 @@ void ScXMLExportDataPilot::WriteMembers(ScDPSaveDimension* pDim) rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_NAME, rtl::OUString((*i)->GetName())); const OUString* pLayoutName = (*i)->GetLayoutName(); if (pLayoutName) - rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DISPLAY_NAME, *pLayoutName); + rExport.AddAttribute(XML_NAMESPACE_TABLE_EXT, XML_DISPLAY_NAME, *pLayoutName); rtl::OUStringBuffer sBuffer; SvXMLUnitConverter::convertBool(sBuffer, (*i)->GetIsVisible()); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DISPLAY, sBuffer.makeStringAndClear()); @@ -682,7 +682,7 @@ void ScXMLExportDataPilot::WriteDimension(ScDPSaveDimension* pDim, const ScDPDim rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_SOURCE_FIELD_NAME, rtl::OUString(pDim->GetName())); const OUString* pLayoutName = pDim->GetLayoutName(); if (pLayoutName) - rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DISPLAY_NAME, *pLayoutName); + rExport.AddAttribute(XML_NAMESPACE_TABLE_EXT, XML_DISPLAY_NAME, *pLayoutName); if (pDim->IsDataLayout()) rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_IS_DATA_LAYOUT_FIELD, XML_TRUE); @@ -726,7 +726,7 @@ void ScXMLExportDataPilot::WriteGrandTotal(::xmloff::token::XMLTokenEnum eOrient rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DISPLAY, bVisible ? XML_TRUE : XML_FALSE); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_ORIENTATION, eOrient); if (pGrandTotal) - rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DISPLAY_NAME, *pGrandTotal); + rExport.AddAttribute(XML_NAMESPACE_TABLE_EXT, XML_DISPLAY_NAME, *pGrandTotal); SvXMLElementExport aElemGrandTotal(rExport, XML_NAMESPACE_TABLE, XML_DATA_PILOT_GRAND_TOTAL, sal_True, sal_True); } diff --git a/sc/source/filter/xml/xmldpimp.cxx b/sc/source/filter/xml/xmldpimp.cxx index da89897269f0..6454baf08431 100644 --- a/sc/source/filter/xml/xmldpimp.cxx +++ b/sc/source/filter/xml/xmldpimp.cxx @@ -771,6 +771,7 @@ ScXMLDataPilotGrandTotalContext::ScXMLDataPilotGrandTotalContext( meOrientation = COLUMN; break; case XML_TOK_DATA_PILOT_GRAND_TOTAL_ATTR_DISPLAY_NAME: + case XML_TOK_DATA_PILOT_GRAND_TOTAL_ATTR_DISPLAY_NAME_EXT: maDisplayName = rAttrValue; break; default: @@ -914,6 +915,7 @@ ScXMLDataPilotFieldContext::ScXMLDataPilotFieldContext( ScXMLImport& rImport, } break; case XML_TOK_DATA_PILOT_FIELD_ATTR_DISPLAY_NAME: + case XML_TOK_DATA_PILOT_FIELD_ATTR_DISPLAY_NAME_EXT: { aDisplayName = sValue; } @@ -1448,6 +1450,7 @@ ScXMLDataPilotSubTotalContext::ScXMLDataPilotSubTotalContext( ScXMLImport& rImpo ScXMLConverter::GetFunctionFromString( sValue ) ) ); } case XML_TOK_DATA_PILOT_SUBTOTAL_ATTR_DISPLAY_NAME: + case XML_TOK_DATA_PILOT_SUBTOTAL_ATTR_DISPLAY_NAME_EXT: pDataPilotSubTotals->SetDisplayName(sValue); break; } @@ -1547,6 +1550,7 @@ ScXMLDataPilotMemberContext::ScXMLDataPilotMemberContext( ScXMLImport& rImport, } break; case XML_TOK_DATA_PILOT_MEMBER_ATTR_DISPLAY_NAME: + case XML_TOK_DATA_PILOT_MEMBER_ATTR_DISPLAY_NAME_EXT: { maDisplayName = sValue; } diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index cfb91dd51856..d7ca2ea75a74 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -1387,9 +1387,10 @@ const SvXMLTokenMap& ScXMLImport::GetDataPilotGrandTotalAttrTokenMap() { static __FAR_DATA SvXMLTokenMapEntry aDataPilotGrandTotalAttrTokenMap[] = { - { XML_NAMESPACE_TABLE, XML_DISPLAY, XML_TOK_DATA_PILOT_GRAND_TOTAL_ATTR_DISPLAY }, - { XML_NAMESPACE_TABLE, XML_ORIENTATION, XML_TOK_DATA_PILOT_GRAND_TOTAL_ATTR_ORIENTATION }, - { XML_NAMESPACE_TABLE, XML_DISPLAY_NAME, XML_TOK_DATA_PILOT_GRAND_TOTAL_ATTR_DISPLAY_NAME }, + { XML_NAMESPACE_TABLE, XML_DISPLAY, XML_TOK_DATA_PILOT_GRAND_TOTAL_ATTR_DISPLAY }, + { XML_NAMESPACE_TABLE, XML_ORIENTATION, XML_TOK_DATA_PILOT_GRAND_TOTAL_ATTR_ORIENTATION }, + { XML_NAMESPACE_TABLE, XML_DISPLAY_NAME, XML_TOK_DATA_PILOT_GRAND_TOTAL_ATTR_DISPLAY_NAME }, + { XML_NAMESPACE_TABLE_EXT, XML_DISPLAY_NAME, XML_TOK_DATA_PILOT_GRAND_TOTAL_ATTR_DISPLAY_NAME_EXT }, XML_TOKEN_MAP_END }; @@ -1437,13 +1438,14 @@ const SvXMLTokenMap& ScXMLImport::GetDataPilotFieldAttrTokenMap() { static __FAR_DATA SvXMLTokenMapEntry aDataPilotFieldAttrTokenMap[] = { - { XML_NAMESPACE_TABLE, XML_SOURCE_FIELD_NAME, XML_TOK_DATA_PILOT_FIELD_ATTR_SOURCE_FIELD_NAME }, - { XML_NAMESPACE_TABLE, XML_DISPLAY_NAME, XML_TOK_DATA_PILOT_FIELD_ATTR_DISPLAY_NAME }, - { XML_NAMESPACE_TABLE, XML_IS_DATA_LAYOUT_FIELD, XML_TOK_DATA_PILOT_FIELD_ATTR_IS_DATA_LAYOUT_FIELD }, - { XML_NAMESPACE_TABLE, XML_FUNCTION, XML_TOK_DATA_PILOT_FIELD_ATTR_FUNCTION }, - { XML_NAMESPACE_TABLE, XML_ORIENTATION, XML_TOK_DATA_PILOT_FIELD_ATTR_ORIENTATION }, - { XML_NAMESPACE_TABLE, XML_SELECTED_PAGE, XML_TOK_DATA_PILOT_FIELD_ATTR_SELECTED_PAGE }, - { XML_NAMESPACE_TABLE, XML_USED_HIERARCHY, XML_TOK_DATA_PILOT_FIELD_ATTR_USED_HIERARCHY }, + { XML_NAMESPACE_TABLE, XML_SOURCE_FIELD_NAME, XML_TOK_DATA_PILOT_FIELD_ATTR_SOURCE_FIELD_NAME }, + { XML_NAMESPACE_TABLE, XML_DISPLAY_NAME, XML_TOK_DATA_PILOT_FIELD_ATTR_DISPLAY_NAME }, + { XML_NAMESPACE_TABLE_EXT, XML_DISPLAY_NAME, XML_TOK_DATA_PILOT_FIELD_ATTR_DISPLAY_NAME_EXT }, + { XML_NAMESPACE_TABLE, XML_IS_DATA_LAYOUT_FIELD, XML_TOK_DATA_PILOT_FIELD_ATTR_IS_DATA_LAYOUT_FIELD }, + { XML_NAMESPACE_TABLE, XML_FUNCTION, XML_TOK_DATA_PILOT_FIELD_ATTR_FUNCTION }, + { XML_NAMESPACE_TABLE, XML_ORIENTATION, XML_TOK_DATA_PILOT_FIELD_ATTR_ORIENTATION }, + { XML_NAMESPACE_TABLE, XML_SELECTED_PAGE, XML_TOK_DATA_PILOT_FIELD_ATTR_SELECTED_PAGE }, + { XML_NAMESPACE_TABLE, XML_USED_HIERARCHY, XML_TOK_DATA_PILOT_FIELD_ATTR_USED_HIERARCHY }, XML_TOKEN_MAP_END }; @@ -1529,8 +1531,9 @@ const SvXMLTokenMap& ScXMLImport::GetDataPilotSubTotalAttrTokenMap() { static __FAR_DATA SvXMLTokenMapEntry aDataPilotSubTotalAttrTokenMap[] = { - { XML_NAMESPACE_TABLE, XML_FUNCTION, XML_TOK_DATA_PILOT_SUBTOTAL_ATTR_FUNCTION }, - { XML_NAMESPACE_TABLE, XML_DISPLAY_NAME, XML_TOK_DATA_PILOT_SUBTOTAL_ATTR_DISPLAY_NAME }, + { XML_NAMESPACE_TABLE, XML_FUNCTION, XML_TOK_DATA_PILOT_SUBTOTAL_ATTR_FUNCTION }, + { XML_NAMESPACE_TABLE, XML_DISPLAY_NAME, XML_TOK_DATA_PILOT_SUBTOTAL_ATTR_DISPLAY_NAME }, + { XML_NAMESPACE_TABLE_EXT, XML_DISPLAY_NAME, XML_TOK_DATA_PILOT_SUBTOTAL_ATTR_DISPLAY_NAME_EXT }, XML_TOKEN_MAP_END }; @@ -1562,10 +1565,11 @@ const SvXMLTokenMap& ScXMLImport::GetDataPilotMemberAttrTokenMap() { static __FAR_DATA SvXMLTokenMapEntry aDataPilotMemberAttrTokenMap[] = { - { XML_NAMESPACE_TABLE, XML_NAME, XML_TOK_DATA_PILOT_MEMBER_ATTR_NAME }, - { XML_NAMESPACE_TABLE, XML_DISPLAY_NAME, XML_TOK_DATA_PILOT_MEMBER_ATTR_DISPLAY_NAME }, - { XML_NAMESPACE_TABLE, XML_DISPLAY, XML_TOK_DATA_PILOT_MEMBER_ATTR_DISPLAY }, - { XML_NAMESPACE_TABLE, XML_SHOW_DETAILS, XML_TOK_DATA_PILOT_MEMBER_ATTR_SHOW_DETAILS }, + { XML_NAMESPACE_TABLE, XML_NAME, XML_TOK_DATA_PILOT_MEMBER_ATTR_NAME }, + { XML_NAMESPACE_TABLE, XML_DISPLAY_NAME, XML_TOK_DATA_PILOT_MEMBER_ATTR_DISPLAY_NAME }, + { XML_NAMESPACE_TABLE_EXT, XML_DISPLAY_NAME, XML_TOK_DATA_PILOT_MEMBER_ATTR_DISPLAY_NAME_EXT }, + { XML_NAMESPACE_TABLE, XML_DISPLAY, XML_TOK_DATA_PILOT_MEMBER_ATTR_DISPLAY }, + { XML_NAMESPACE_TABLE, XML_SHOW_DETAILS, XML_TOK_DATA_PILOT_MEMBER_ATTR_SHOW_DETAILS }, XML_TOKEN_MAP_END }; diff --git a/sc/source/filter/xml/xmlimprt.hxx b/sc/source/filter/xml/xmlimprt.hxx index 0fb9aead0e4f..c110c70f72e2 100644 --- a/sc/source/filter/xml/xmlimprt.hxx +++ b/sc/source/filter/xml/xmlimprt.hxx @@ -509,7 +509,8 @@ enum ScXMLDataPilotGrandTotalAttrTokens { XML_TOK_DATA_PILOT_GRAND_TOTAL_ATTR_DISPLAY, XML_TOK_DATA_PILOT_GRAND_TOTAL_ATTR_ORIENTATION, - XML_TOK_DATA_PILOT_GRAND_TOTAL_ATTR_DISPLAY_NAME + XML_TOK_DATA_PILOT_GRAND_TOTAL_ATTR_DISPLAY_NAME, + XML_TOK_DATA_PILOT_GRAND_TOTAL_ATTR_DISPLAY_NAME_EXT }; enum ScXMLDataPilotTableSourceCellRangeElemTokens @@ -526,6 +527,7 @@ enum ScXMLDataPilotFieldAttrTokens { XML_TOK_DATA_PILOT_FIELD_ATTR_SOURCE_FIELD_NAME, XML_TOK_DATA_PILOT_FIELD_ATTR_DISPLAY_NAME, + XML_TOK_DATA_PILOT_FIELD_ATTR_DISPLAY_NAME_EXT, XML_TOK_DATA_PILOT_FIELD_ATTR_IS_DATA_LAYOUT_FIELD, XML_TOK_DATA_PILOT_FIELD_ATTR_FUNCTION, XML_TOK_DATA_PILOT_FIELD_ATTR_ORIENTATION, @@ -562,7 +564,8 @@ enum ScXMLDataPilotSubTotalsElemTokens enum ScXMLDataPilotSubTotalAttrTokens { XML_TOK_DATA_PILOT_SUBTOTAL_ATTR_FUNCTION, - XML_TOK_DATA_PILOT_SUBTOTAL_ATTR_DISPLAY_NAME + XML_TOK_DATA_PILOT_SUBTOTAL_ATTR_DISPLAY_NAME, + XML_TOK_DATA_PILOT_SUBTOTAL_ATTR_DISPLAY_NAME_EXT }; enum ScXMLDataPilotMembersElemTokens @@ -574,6 +577,7 @@ enum ScXMLDataPilotMemberAttrTokens { XML_TOK_DATA_PILOT_MEMBER_ATTR_NAME, XML_TOK_DATA_PILOT_MEMBER_ATTR_DISPLAY_NAME, + XML_TOK_DATA_PILOT_MEMBER_ATTR_DISPLAY_NAME_EXT, XML_TOK_DATA_PILOT_MEMBER_ATTR_DISPLAY, XML_TOK_DATA_PILOT_MEMBER_ATTR_SHOW_DETAILS }; -- cgit v1.2.3 From 39161b01316e9368f51567e7ab4b6e2ffd195b2f Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Tue, 17 Nov 2009 21:01:24 +0000 Subject: #i106975# Don't export tableooo:display-name attributes unless the specified ODF version is 1.2 extended or later. --- sc/source/filter/xml/XMLExportDataPilot.cxx | 36 +++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/sc/source/filter/xml/XMLExportDataPilot.cxx b/sc/source/filter/xml/XMLExportDataPilot.cxx index b779f2374569..dffb6f4f7080 100644 --- a/sc/source/filter/xml/XMLExportDataPilot.cxx +++ b/sc/source/filter/xml/XMLExportDataPilot.cxx @@ -452,7 +452,11 @@ void ScXMLExportDataPilot::WriteSubTotals(ScDPSaveDimension* pDim) using sheet::GeneralFunction; sal_Int32 nSubTotalCount = pDim->GetSubTotalsCount(); - const OUString* pLayoutName = pDim->GetSubtotalName(); + const OUString* pLayoutName = NULL; + if (rExport.getDefaultVersion() == SvtSaveOptions::ODFVER_LATEST) + // Export display names only for 1.2 extended or later. + pLayoutName = pDim->GetSubtotalName(); + if (nSubTotalCount > 0) { SvXMLElementExport aElemSTs(rExport, XML_NAMESPACE_TABLE, XML_DATA_PILOT_SUBTOTALS, sal_True, sal_True); @@ -480,9 +484,15 @@ void ScXMLExportDataPilot::WriteMembers(ScDPSaveDimension* pDim) for (ScDPSaveDimension::MemberList::const_iterator i=rMembers.begin(); i != rMembers.end() ; i++) { rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_NAME, rtl::OUString((*i)->GetName())); - const OUString* pLayoutName = (*i)->GetLayoutName(); - if (pLayoutName) - rExport.AddAttribute(XML_NAMESPACE_TABLE_EXT, XML_DISPLAY_NAME, *pLayoutName); + + if (rExport.getDefaultVersion() == SvtSaveOptions::ODFVER_LATEST) + { + // Export display names only for ODF 1.2 extended or later. + const OUString* pLayoutName = (*i)->GetLayoutName(); + if (pLayoutName) + rExport.AddAttribute(XML_NAMESPACE_TABLE_EXT, XML_DISPLAY_NAME, *pLayoutName); + } + rtl::OUStringBuffer sBuffer; SvXMLUnitConverter::convertBool(sBuffer, (*i)->GetIsVisible()); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DISPLAY, sBuffer.makeStringAndClear()); @@ -680,9 +690,13 @@ void ScXMLExportDataPilot::WriteGroupDimElements(ScDPSaveDimension* pDim, const void ScXMLExportDataPilot::WriteDimension(ScDPSaveDimension* pDim, const ScDPDimensionSaveData* pDimData) { rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_SOURCE_FIELD_NAME, rtl::OUString(pDim->GetName())); - const OUString* pLayoutName = pDim->GetLayoutName(); - if (pLayoutName) - rExport.AddAttribute(XML_NAMESPACE_TABLE_EXT, XML_DISPLAY_NAME, *pLayoutName); + if (rExport.getDefaultVersion() == SvtSaveOptions::ODFVER_LATEST) + { + // Export display names only for ODF 1.2 extended or later. + const OUString* pLayoutName = pDim->GetLayoutName(); + if (pLayoutName) + rExport.AddAttribute(XML_NAMESPACE_TABLE_EXT, XML_DISPLAY_NAME, *pLayoutName); + } if (pDim->IsDataLayout()) rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_IS_DATA_LAYOUT_FIELD, XML_TRUE); @@ -725,8 +739,12 @@ void ScXMLExportDataPilot::WriteGrandTotal(::xmloff::token::XMLTokenEnum eOrient { rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DISPLAY, bVisible ? XML_TRUE : XML_FALSE); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_ORIENTATION, eOrient); - if (pGrandTotal) - rExport.AddAttribute(XML_NAMESPACE_TABLE_EXT, XML_DISPLAY_NAME, *pGrandTotal); + if (rExport.getDefaultVersion() == SvtSaveOptions::ODFVER_LATEST) + { + // Export display names only for ODF 1.2 extended or later. + if (pGrandTotal) + rExport.AddAttribute(XML_NAMESPACE_TABLE_EXT, XML_DISPLAY_NAME, *pGrandTotal); + } SvXMLElementExport aElemGrandTotal(rExport, XML_NAMESPACE_TABLE, XML_DATA_PILOT_GRAND_TOTAL, sal_True, sal_True); } -- cgit v1.2.3 From 509ebb8ba99392ccf79e9a02aa8df15e74eab8e8 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Wed, 18 Nov 2009 13:06:25 +0100 Subject: dba33d: #i97096# use column label when given --- dbaccess/source/core/api/RowSet.cxx | 18 ++++++++------- .../source/core/api/SingleSelectQueryComposer.cxx | 27 +++++++++++----------- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx index 5b71c7d8e56c..813b6556f57e 100644 --- a/dbaccess/source/core/api/RowSet.cxx +++ b/dbaccess/source/core/api/RowSet.cxx @@ -1986,15 +1986,17 @@ void ORowSet::execute_NoApprove_NoNewConn(ResettableMutexGuard& _rClearForNotifi for(sal_Int32 i=1; i <= nCount ;++i) { ::rtl::OUString sName = xMeta->getColumnName(i); + ::rtl::OUString sColumnLabel = xMeta->getColumnLabel(i); // retrieve the column number |i| Reference xColumn; { sal_Bool bReFetchName = sal_False; - if (m_xColumns->hasByName(sName)) + if (m_xColumns->hasByName(sColumnLabel)) + m_xColumns->getByName(sColumnLabel) >>= xColumn; + if (!xColumn.is() && m_xColumns->hasByName(sName)) m_xColumns->getByName(sName) >>= xColumn; - if (!xColumn.is() && m_xColumns->hasByName(xMeta->getColumnLabel(i))) - m_xColumns->getByName(xMeta->getColumnLabel(i)) >>= xColumn; + // check if column already in the list we need another if ( aAllColumns.find( xColumn ) != aAllColumns.end() ) { @@ -2035,16 +2037,16 @@ void ORowSet::execute_NoApprove_NoNewConn(ResettableMutexGuard& _rClearForNotifi aDescription, m_aCurrentRow); aColumns->get().push_back(pColumn); - if(!sName.getLength()) + if(!sColumnLabel.getLength()) { if(xColumn.is()) - xColumn->getPropertyValue(PROPERTY_NAME) >>= sName; + xColumn->getPropertyValue(PROPERTY_NAME) >>= sColumnLabel; else - sName = ::rtl::OUString::createFromAscii("Expression1"); + sColumnLabel = ::rtl::OUString::createFromAscii("Expression1"); // TODO: resource } - pColumn->setName(sName); - aNames.push_back(sName); + pColumn->setName(sColumnLabel); + aNames.push_back(sColumnLabel); m_aDataColumns.push_back(pColumn); if ( xColumn.is() ) diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx index 0c2836d5ceec..04c5e9d37faa 100644 --- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx +++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx @@ -750,9 +750,10 @@ Reference< XNameAccess > SAL_CALL OSingleSelectQueryComposer::getColumns( ) thr OSL_ENSURE( (size_t) nCount == aSelectColumns->get().size(), "OSingleSelectQueryComposer::getColumns: inconsistent column counts, this might result in wrong columns!" ); for(sal_Int32 i=1;i<=nCount;++i) { - ::rtl::OUString sName = xResultSetMeta->getColumnName(i); + ::rtl::OUString sColumnName = xResultSetMeta->getColumnName(i); + ::rtl::OUString sColumnLabel = xResultSetMeta->getColumnLabel(i); sal_Bool bFound = sal_False; - OSQLColumns::Vector::const_iterator aFind = ::connectivity::find(aSelectColumns->get().begin(),aSelectColumns->get().end(),sName,aCaseCompare); + OSQLColumns::Vector::const_iterator aFind = ::connectivity::find(aSelectColumns->get().begin(),aSelectColumns->get().end(),sColumnLabel,aCaseCompare); size_t nFoundSelectColumnPos = aFind - aSelectColumns->get().begin(); if ( aFind != aSelectColumns->get().end() ) { @@ -761,7 +762,7 @@ Reference< XNameAccess > SAL_CALL OSingleSelectQueryComposer::getColumns( ) thr // so we start after the first found do { - aFind = ::connectivity::findRealName(++aFind,aSelectColumns->get().end(),sName,aCaseCompare); + aFind = ::connectivity::findRealName(++aFind,aSelectColumns->get().end(),sColumnName,aCaseCompare); nFoundSelectColumnPos = aFind - aSelectColumns->get().begin(); } while ( ( aUsedSelectColumns.find( nFoundSelectColumnPos ) != aUsedSelectColumns.end() ) @@ -770,9 +771,9 @@ Reference< XNameAccess > SAL_CALL OSingleSelectQueryComposer::getColumns( ) thr } if ( aFind != aSelectColumns->get().end() ) { - (*aFind)->getPropertyValue(PROPERTY_NAME) >>= sName; + (*aFind)->getPropertyValue(PROPERTY_NAME) >>= sColumnName; aUsedSelectColumns.insert( nFoundSelectColumnPos ); - aNames.push_back(sName); + aNames.push_back(sColumnName); bFound = sal_True; } } @@ -781,7 +782,7 @@ Reference< XNameAccess > SAL_CALL OSingleSelectQueryComposer::getColumns( ) thr continue; OSQLColumns::Vector::const_iterator aRealFind = ::connectivity::findRealName( - aSelectColumns->get().begin(), aSelectColumns->get().end(), sName, aCaseCompare ); + aSelectColumns->get().begin(), aSelectColumns->get().end(), sColumnName, aCaseCompare ); if ( i > static_cast< sal_Int32>( aSelectColumns->get().size() ) ) { @@ -806,19 +807,19 @@ Reference< XNameAccess > SAL_CALL OSingleSelectQueryComposer::getColumns( ) thr ::rtl::OUString sRealName; xProp->getPropertyValue(PROPERTY_REALNAME) >>= sRealName; ::std::vector< ::rtl::OUString>::iterator aFindName; - if ( !sName.getLength() ) - xProp->getPropertyValue(PROPERTY_NAME) >>= sName; + if ( !sColumnName.getLength() ) + xProp->getPropertyValue(PROPERTY_NAME) >>= sColumnName; - aFindName = ::std::find_if(aNames.begin(),aNames.end(),::std::bind2nd(aCaseCompareFunctor,sName)); + aFindName = ::std::find_if(aNames.begin(),aNames.end(),::std::bind2nd(aCaseCompareFunctor,sColumnName)); sal_Int32 j = 0; while ( aFindName != aNames.end() ) { - sName += ::rtl::OUString::valueOf(++j); - aFindName = ::std::find_if(aNames.begin(),aNames.end(),::std::bind2nd(aCaseCompareFunctor,sName)); + sColumnName += ::rtl::OUString::valueOf(++j); + aFindName = ::std::find_if(aNames.begin(),aNames.end(),::std::bind2nd(aCaseCompareFunctor,sColumnName)); } - pColumn->setName(sName); + pColumn->setName(sColumnName); pColumn->setRealName(sRealName); pColumn->setTableName(::comphelper::getString(xProp->getPropertyValue(PROPERTY_TABLENAME))); @@ -828,7 +829,7 @@ Reference< XNameAccess > SAL_CALL OSingleSelectQueryComposer::getColumns( ) thr continue; aUsedSelectColumns.insert( (size_t)(i - 1) ); - aNames.push_back( sName ); + aNames.push_back( sColumnName ); } } catch(const Exception&) -- cgit v1.2.3 From e2e6b604c3288b9b0c24866903708d5161e94da0 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Wed, 18 Nov 2009 13:06:25 +0100 Subject: dba33d: #i97096# use column label when given --- connectivity/source/parse/PColumn.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/connectivity/source/parse/PColumn.cxx b/connectivity/source/parse/PColumn.cxx index d8372ca69167..e8baf187eef7 100644 --- a/connectivity/source/parse/PColumn.cxx +++ b/connectivity/source/parse/PColumn.cxx @@ -116,7 +116,7 @@ OParseColumn* OParseColumn::createColumnForResultSet( const Reference< XResultSe const Reference< XDatabaseMetaData >& _rxDBMetaData, sal_Int32 _nColumnPos ) { OParseColumn* pColumn = new OParseColumn( - _rxResMetaData->getColumnName( _nColumnPos ), + _rxResMetaData->getColumnLabel( _nColumnPos ), _rxResMetaData->getColumnTypeName( _nColumnPos ), ::rtl::OUString(), _rxResMetaData->isNullable( _nColumnPos ), @@ -135,6 +135,7 @@ OParseColumn* OParseColumn::createColumnForResultSet( const Reference< XResultSe eComplete ) ); pColumn->setIsSearchable( _rxResMetaData->isSearchable( _nColumnPos ) ); + pColumn->setRealName(_rxResMetaData->getColumnName( _nColumnPos )); return pColumn; } -- cgit v1.2.3 From 1579846c3e76ad8d5e7db1774a9bfabe027aa896 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Wed, 18 Nov 2009 13:15:51 +0100 Subject: dba33d: #i106998# check if entzry is null --- dbaccess/source/ui/app/AppDetailPageHelper.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx index 50e357b687b8..72b34a339e45 100644 --- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx +++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx @@ -658,6 +658,8 @@ void OAppDetailPageHelper::paste() // ----------------------------------------------------------------------------- bool OAppDetailPageHelper::isLeaf(SvLBoxEntry* _pEntry) const { + if ( !_pEntry ) + return false; sal_Int32 nEntryType = reinterpret_cast< sal_IntPtr >( _pEntry->GetUserData() ); if ( ( nEntryType == DatabaseObjectContainer::TABLES ) || ( nEntryType == DatabaseObjectContainer::CATALOG ) -- cgit v1.2.3 From 39968da918a65fd029a90b33fbb820a6ca92f8f4 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Wed, 18 Nov 2009 15:49:50 +0100 Subject: dba33d: #i105101# get table filter and type filter from ds when it is needed --- dbaccess/source/core/dataaccess/connection.cxx | 13 +++++++++++++ dbaccess/source/core/dataaccess/connection.hxx | 4 ++++ 2 files changed, 17 insertions(+) diff --git a/dbaccess/source/core/dataaccess/connection.cxx b/dbaccess/source/core/dataaccess/connection.cxx index 8fb40fc63b1f..043198388976 100644 --- a/dbaccess/source/core/dataaccess/connection.cxx +++ b/dbaccess/source/core/dataaccess/connection.cxx @@ -600,6 +600,17 @@ Reference< XSQLQueryComposer > OConnection::createQueryComposer(void) throw( Ru m_aComposers.push_back(WeakReferenceHelper(xComposer)); return xComposer; } +// ----------------------------------------------------------------------------- +void OConnection::impl_fillTableFilter() +{ + Reference xProp(getParent(),UNO_QUERY); + if ( xProp.is() ) + { + xProp->getPropertyValue(PROPERTY_TABLEFILTER) >>= m_aTableFilter; + xProp->getPropertyValue(PROPERTY_TABLETYPEFILTER) >>= m_aTableTypeFilter; + } +} + // ----------------------------------------------------------------------------- void OConnection::refresh(const Reference< XNameAccess >& _rToBeRefreshed) { @@ -608,6 +619,7 @@ void OConnection::refresh(const Reference< XNameAccess >& _rToBeRefreshed) { if (!m_pTables->isInitialized()) { + impl_fillTableFilter(); // check if our "master connection" can supply tables getMasterTables(); @@ -625,6 +637,7 @@ void OConnection::refresh(const Reference< XNameAccess >& _rToBeRefreshed) { if (!m_pViews->isInitialized()) { + impl_fillTableFilter(); // check if our "master connection" can supply tables Reference< XViewsSupplier > xMaster(getMasterTables(),UNO_QUERY); diff --git a/dbaccess/source/core/dataaccess/connection.hxx b/dbaccess/source/core/dataaccess/connection.hxx index e8a8a2ca9135..88e59f007a25 100644 --- a/dbaccess/source/core/dataaccess/connection.hxx +++ b/dbaccess/source/core/dataaccess/connection.hxx @@ -276,6 +276,10 @@ private: m_xConnectionTools is nol */ void impl_loadConnectionTools_throw(); + + /** reads the table filter and table type filter from the datasourfce + */ + void impl_fillTableFilter(); }; //........................................................................ -- cgit v1.2.3 From d803f1b8cfb2b15920fa03b3a64371b4664f4a31 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 18 Nov 2009 18:57:07 +0000 Subject: #i106975# data-pilot-grand-total is also new in ODF 1.2 extended. --- sc/source/filter/xml/XMLExportDataPilot.cxx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sc/source/filter/xml/XMLExportDataPilot.cxx b/sc/source/filter/xml/XMLExportDataPilot.cxx index dffb6f4f7080..d6c800853c6f 100644 --- a/sc/source/filter/xml/XMLExportDataPilot.cxx +++ b/sc/source/filter/xml/XMLExportDataPilot.cxx @@ -737,14 +737,15 @@ void ScXMLExportDataPilot::WriteDimensions(ScDPSaveData* pDPSave) void ScXMLExportDataPilot::WriteGrandTotal(::xmloff::token::XMLTokenEnum eOrient, bool bVisible, const OUString* pGrandTotal) { + if (rExport.getDefaultVersion() != SvtSaveOptions::ODFVER_LATEST) + // Export grand total only for ODF 1.2 extended or later. + return; + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DISPLAY, bVisible ? XML_TRUE : XML_FALSE); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_ORIENTATION, eOrient); - if (rExport.getDefaultVersion() == SvtSaveOptions::ODFVER_LATEST) - { - // Export display names only for ODF 1.2 extended or later. - if (pGrandTotal) - rExport.AddAttribute(XML_NAMESPACE_TABLE_EXT, XML_DISPLAY_NAME, *pGrandTotal); - } + if (pGrandTotal) + rExport.AddAttribute(XML_NAMESPACE_TABLE_EXT, XML_DISPLAY_NAME, *pGrandTotal); + SvXMLElementExport aElemGrandTotal(rExport, XML_NAMESPACE_TABLE, XML_DATA_PILOT_GRAND_TOTAL, sal_True, sal_True); } -- cgit v1.2.3 From e90a5b82b8454c8c77a0bf50285e99cf25c631bd Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 18 Nov 2009 19:35:08 +0000 Subject: #i106975# When custom grand total name is not used, write the xml data the old way. --- sc/source/filter/xml/XMLExportDataPilot.cxx | 31 +++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/sc/source/filter/xml/XMLExportDataPilot.cxx b/sc/source/filter/xml/XMLExportDataPilot.cxx index d6c800853c6f..88c710ae9f11 100644 --- a/sc/source/filter/xml/XMLExportDataPilot.cxx +++ b/sc/source/filter/xml/XMLExportDataPilot.cxx @@ -737,10 +737,6 @@ void ScXMLExportDataPilot::WriteDimensions(ScDPSaveData* pDPSave) void ScXMLExportDataPilot::WriteGrandTotal(::xmloff::token::XMLTokenEnum eOrient, bool bVisible, const OUString* pGrandTotal) { - if (rExport.getDefaultVersion() != SvtSaveOptions::ODFVER_LATEST) - // Export grand total only for ODF 1.2 extended or later. - return; - rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_DISPLAY, bVisible ? XML_TRUE : XML_FALSE); rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_ORIENTATION, eOrient); if (pGrandTotal) @@ -821,14 +817,33 @@ void ScXMLExportDataPilot::WriteDataPilots(const uno::Reference GetGrandTotalName(); - if (bRowGrand && bColumnGrand) + if (pGrandTotalName && rExport.getDefaultVersion() == SvtSaveOptions::ODFVER_LATEST) { - WriteGrandTotal(XML_BOTH, true, pGrandTotalName); + // Use the new data-pilot-grand-total element. + if (bRowGrand && bColumnGrand) + { + WriteGrandTotal(XML_BOTH, true, pGrandTotalName); + } + else + { + WriteGrandTotal(XML_ROW, bRowGrand, pGrandTotalName); + WriteGrandTotal(XML_COLUMN, bColumnGrand, pGrandTotalName); + } } else { - WriteGrandTotal(XML_ROW, bRowGrand, pGrandTotalName); - WriteGrandTotal(XML_COLUMN, bColumnGrand, pGrandTotalName); + // custom grand total not present, or it's not ODF 1.2 extended. + // Write it the old way. + if (bRowGrand && bColumnGrand) + { + // Don't write anything. Grand totals are displayed for both row and column fields by default. + } + else if (bRowGrand) + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_GRAND_TOTAL, XML_ROW); + else if (bColumnGrand) + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_GRAND_TOTAL, XML_COLUMN); + else + rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_GRAND_TOTAL, XML_NONE); } rExport.CheckAttrList(); -- cgit v1.2.3 From 48cee6fff042f05a7cd5a1bc0f8f7f93f361da15 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 18 Nov 2009 20:01:54 +0000 Subject: Actually this is wrong. --- sc/source/filter/xml/XMLExportDataPilot.cxx | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/sc/source/filter/xml/XMLExportDataPilot.cxx b/sc/source/filter/xml/XMLExportDataPilot.cxx index 88c710ae9f11..97926ee7113f 100644 --- a/sc/source/filter/xml/XMLExportDataPilot.cxx +++ b/sc/source/filter/xml/XMLExportDataPilot.cxx @@ -830,21 +830,6 @@ void ScXMLExportDataPilot::WriteDataPilots(const uno::Reference IsSheetData()) -- cgit v1.2.3 From 9794e714928d3d8336817545d5a1355645ccf7e8 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 18 Nov 2009 20:08:02 +0000 Subject: The default visibility of grand total is actually true, not false. --- sc/source/filter/xml/xmldpimp.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sc/source/filter/xml/xmldpimp.cxx b/sc/source/filter/xml/xmldpimp.cxx index 6454baf08431..08e8633978b1 100644 --- a/sc/source/filter/xml/xmldpimp.cxx +++ b/sc/source/filter/xml/xmldpimp.cxx @@ -117,7 +117,7 @@ void ScXMLDataPilotTablesContext::EndElement() } ScXMLDataPilotTableContext::GrandTotalItem::GrandTotalItem() : - mbVisible(false) {} + mbVisible(true) {} ScXMLDataPilotTableContext::ScXMLDataPilotTableContext( ScXMLImport& rImport, USHORT nPrfx, @@ -177,11 +177,18 @@ ScXMLDataPilotTableContext::ScXMLDataPilotTableContext( ScXMLImport& rImport, else if (IsXMLToken(sValue, XML_ROW)) { maRowGrandTotal.mbVisible = true; + maColGrandTotal.mbVisible = false; } else if (IsXMLToken(sValue, XML_COLUMN)) { + maRowGrandTotal.mbVisible = false; maColGrandTotal.mbVisible = true; } + else + { + maRowGrandTotal.mbVisible = false; + maColGrandTotal.mbVisible = false; + } } break; case XML_TOK_DATA_PILOT_TABLE_ATTR_IGNORE_EMPTY_ROWS : -- cgit v1.2.3 From 78155803fd8f1e7d6eb9f0af390a4a928d2fb9cd Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Thu, 19 Nov 2009 09:03:57 +0100 Subject: dba33d: #i102563# use rootURL to resolve the given URI and some refactoring --- .../java/com/sun/star/report/ImageService.java | 14 +- .../java/com/sun/star/report/InputRepository.java | 6 + .../com/sun/star/report/JobProgressIndicator.java | 1 + .../java/com/sun/star/report/OfficeToken.java | 61 +- .../java/com/sun/star/report/OutputRepository.java | 1 + .../java/com/sun/star/report/ReportEngine.java | 1 + .../star/report/ReportEngineParameterNames.java | 39 +- .../sun/star/report/ReportExecutionException.java | 105 ++- .../java/com/sun/star/report/ReportExpression.java | 10 +- .../java/com/sun/star/report/ReportJob.java | 2 + .../java/com/sun/star/report/SDBCReportData.java | 12 +- .../com/sun/star/report/SDBCReportDataFactory.java | 56 +- .../java/com/sun/star/report/SOImageService.java | 14 +- .../com/sun/star/report/StorageRepository.java | 22 +- .../report/function/metadata/AuthorFunction.java | 2 +- .../metadata/AuthorFunctionDescription.java | 2 +- .../report/function/metadata/TitleFunction.java | 2 +- .../metadata/TitleFunctionDescription.java | 2 +- .../star/report/pentaho/DefaultNameGenerator.java | 4 +- .../sun/star/report/pentaho/OfficeNamespaces.java | 1 - .../star/report/pentaho/PentahoFormulaContext.java | 1 + .../sun/star/report/pentaho/PentahoReportJob.java | 25 +- .../star/report/pentaho/SOFormulaOpCodeMapper.java | 26 +- .../sun/star/report/pentaho/SOFormulaParser.java | 81 ++- .../sun/star/report/pentaho/SOFunctionManager.java | 17 +- .../star/report/pentaho/SOReportJobFactory.java | 119 ++-- .../star/report/pentaho/StarFunctionCategory.java | 23 +- .../report/pentaho/StarFunctionDescription.java | 24 +- .../star/report/pentaho/StarReportDataFactory.java | 138 ++-- .../sun/star/report/pentaho/StarReportModule.java | 41 +- .../report/pentaho/expressions/SumExpression.java | 35 +- .../pentaho/expressions/SumExpressionMetaData.java | 73 ++- .../AbstractReportElementLayoutController.java | 2 +- .../layoutprocessor/FixedTextLayoutController.java | 54 +- .../layoutprocessor/FormatValueUtility.java | 46 +- .../FormattedTextLayoutController.java | 2 + .../layoutprocessor/ImageElementContext.java | 89 ++- .../ImageElementLayoutController.java | 29 +- .../layoutprocessor/ObjectOleLayoutController.java | 4 +- .../OfficeDetailLayoutController.java | 195 +++--- ...OfficeGroupInstanceSectionLayoutController.java | 200 +++--- .../OfficeGroupLayoutController.java | 275 ++++---- .../OfficeGroupSectionLayoutController.java | 90 ++- .../OfficePageSectionLayoutController.java | 21 +- .../OfficeRepeatingStructureLayoutController.java | 6 +- .../OfficeReportLayoutController.java | 401 ++++++------ .../OfficeTableLayoutController.java | 5 +- .../OfficeTableTemplateLayoutController.java | 3 +- .../layoutprocessor/TableCellLayoutController.java | 8 +- .../layoutprocessor/VariablesCollection.java | 78 ++- .../VariablesDeclarationLayoutController.java | 234 +++---- .../loader/InputRepositoryResourceData.java | 70 +- .../report/pentaho/loader/InputResourceKey.java | 45 +- .../sun/star/report/pentaho/model/DataStyle.java | 25 +- .../report/pentaho/model/FixedTextElement.java | 23 +- .../report/pentaho/model/FontFaceDeclsSection.java | 49 +- .../star/report/pentaho/model/FontFaceElement.java | 25 +- .../star/report/pentaho/model/FormatCondition.java | 48 +- .../report/pentaho/model/FormattedTextElement.java | 26 +- .../star/report/pentaho/model/ImageElement.java | 72 ++- .../report/pentaho/model/ObjectOleElement.java | 29 +- .../report/pentaho/model/OfficeDetailSection.java | 9 +- .../star/report/pentaho/model/OfficeDocument.java | 39 +- .../sun/star/report/pentaho/model/OfficeGroup.java | 77 ++- .../pentaho/model/OfficeGroupInstanceSection.java | 7 +- .../report/pentaho/model/OfficeMasterPage.java | 42 +- .../report/pentaho/model/OfficeMasterStyles.java | 54 +- .../star/report/pentaho/model/OfficeReport.java | 60 +- .../sun/star/report/pentaho/model/OfficeStyle.java | 166 +++-- .../star/report/pentaho/model/OfficeStyles.java | 2 +- .../pentaho/model/OfficeStylesCollection.java | 115 ++-- .../report/pentaho/model/OfficeTableSection.java | 9 +- .../sun/star/report/pentaho/model/PageLayout.java | 44 +- .../com/sun/star/report/pentaho/model/RawText.java | 11 +- .../star/report/pentaho/model/ReportElement.java | 108 ++-- .../report/pentaho/model/TableCellElement.java | 8 +- .../pentaho/model/VariablesDeclarationSection.java | 12 +- .../sun/star/report/pentaho/oasis-datastyle.css | 2 +- .../com/sun/star/report/pentaho/oasis-draw.css | 2 +- .../com/sun/star/report/pentaho/oasis-form.css | 2 +- .../com/sun/star/report/pentaho/oasis-style.css | 4 +- .../com/sun/star/report/pentaho/oasis-table.css | 14 +- .../com/sun/star/report/pentaho/oasis-text.css | 4 +- .../star/report/pentaho/output/ImageProducer.java | 26 +- .../pentaho/output/OfficeDocumentReportTarget.java | 93 ++- .../star/report/pentaho/output/OleProducer.java | 43 +- .../star/report/pentaho/output/StyleUtilities.java | 24 +- .../star/report/pentaho/output/StylesWriter.java | 528 +++++++-------- .../pentaho/output/chart/ChartRawReportTarget.java | 21 +- .../spreadsheet/SpreadsheetRawReportProcessor.java | 2 +- .../spreadsheet/SpreadsheetRawReportTarget.java | 236 ++++--- .../pentaho/output/text/MasterPageFactory.java | 13 +- .../report/pentaho/output/text/PageContext.java | 2 +- .../output/text/TextRawReportProcessor.java | 2 +- .../pentaho/output/text/TextRawReportTarget.java | 134 ++-- .../pentaho/parser/AttributeSpecification.java | 45 +- .../parser/OfficeDocumentXmlResourceFactory.java | 17 +- .../report/pentaho/parser/OfficeParserUtil.java | 1 + .../parser/OfficeStylesXmlResourceFactory.java | 26 +- .../pentaho/parser/StarStyleXmlFactoryModule.java | 39 +- .../pentaho/parser/StarXmlFactoryModule.java | 3 +- .../star/report/pentaho/parser/StyleMapper.java | 11 +- .../pentaho/parser/chart/ChartReadHandler.java | 5 +- .../pentaho/parser/draw/ObjectOleReadHandler.java | 4 +- .../parser/office/DocumentContentReadHandler.java | 1 + .../parser/office/DocumentStylesReadHandler.java | 96 ++- .../parser/office/FontFaceDeclsReadHandler.java | 103 ++- .../report/pentaho/parser/rpt-schema-v1.0-os.xsd | 720 ++++++++++----------- .../parser/rpt/FormattedTextReadHandler.java | 14 +- .../pentaho/parser/rpt/GroupReadHandler.java | 4 +- .../parser/rpt/MasterDetailReadHandler.java | 2 +- .../pentaho/parser/rpt/ReportReadHandler.java | 1 + .../pentaho/parser/style/FontFaceReadHandler.java | 21 +- .../parser/style/MasterPageReadHandler.java | 96 ++- .../parser/style/OfficeStyleReadHandler.java | 94 ++- .../parser/style/OfficeStylesReadHandler.java | 165 +++-- .../parser/style/PageLayoutReadHandler.java | 92 ++- .../parser/style/StyleDefinitionReadHandler.java | 87 ++- .../parser/stylemapper/OneOfConstantsMapper.java | 2 +- .../draw/TextAreaVerticalAlignMapper.java | 19 +- .../parser/stylemapper/fo/FontStyleMapper.java | 19 +- .../parser/stylemapper/fo/FontWeightMapper.java | 19 +- .../parser/stylemapper/fo/TextAlignMapper.java | 22 +- .../stylemapper/style/FontFamilyGenericMapper.java | 5 +- .../parser/stylemapper/style/FontFamilyMapper.java | 5 +- .../parser/stylemapper/style/FontNameMapper.java | 21 +- .../parser/stylemapper/style/FontPitchMapper.java | 15 +- .../parser/stylemapper/style/FontReliefMapper.java | 18 +- .../stylemapper/style/TextEmphasizeMapper.java | 18 +- .../style/TextUnderlineColorMapper.java | 27 +- .../style/TextUnderlineStyleMapper.java | 28 +- .../stylemapper/style/TextUnderlineWordMode.java | 15 +- .../stylemapper/style/VerticalAlignMapper.java | 21 +- .../stylemapper/table/ColumnWidthMapper.java | 22 +- .../parser/stylemapper/table/RowHeightMapper.java | 22 +- .../parser/table/TableColumnReadHandler.java | 1 + .../parser/table/TableColumnsReadHandler.java | 2 +- .../java/com/sun/star/report/pentaho/smil.css | 2 +- .../com/sun/star/report/pentaho/star-office.css | 2 +- .../com/sun/star/report/pentaho/star-report.css | 28 +- .../java/com/sun/star/report/pentaho/star-rpt.css | 2 +- .../report/pentaho/styles/LengthCalculator.java | 117 ++-- .../star/report/pentaho/styles/StyleMapper.java | 76 +-- .../star/report/pentaho/styles/StyleMapperKey.java | 4 +- .../styles/StyleMapperXmlFactoryModule.java | 3 +- .../styles/StyleMapperXmlResourceFactory.java | 25 +- .../pentaho/styles/StyleMappingReadHandler.java | 98 ++- .../report/pentaho/styles/StyleMappingRule.java | 47 +- .../sun/star/report/pentaho/styles/stylemapper.xsd | 102 +-- .../java/com/sun/star/report/pentaho/svg.css | 2 +- .../java/com/sun/star/report/pentaho/xsl-fo.css | 2 +- .../sun/star/report/util/DefaultJobProperties.java | 65 +- .../sun/star/report/util/DefaultParameterMap.java | 142 ++-- .../report/util/DefaultReportJobDefinition.java | 152 +++-- .../com/sun/star/report/util/ManifestWriter.java | 104 +-- 155 files changed, 3947 insertions(+), 4003 deletions(-) diff --git a/reportbuilder/java/com/sun/star/report/ImageService.java b/reportbuilder/java/com/sun/star/report/ImageService.java index 193b97d66d58..a407164d965a 100644 --- a/reportbuilder/java/com/sun/star/report/ImageService.java +++ b/reportbuilder/java/com/sun/star/report/ImageService.java @@ -40,23 +40,33 @@ public interface ImageService { /** + * @param image * @return the mime-type of the image as string. + * @throws ReportExecutionException */ String getMimeType(final InputStream image) throws ReportExecutionException; /** + * @param image * @return the mime-type of the image as string. + * @throws ReportExecutionException */ String getMimeType(final byte[] image) throws ReportExecutionException; /** + * @param image * @returns the dimension in 100th mm. - **/ + * + * @throws ReportExecutionException + * @return*/ Dimension getImageSize(final InputStream image) throws ReportExecutionException; /** + * @param image * @returns the dimension in 100th mm. - **/ + * + * @throws ReportExecutionException + * @return*/ Dimension getImageSize(final byte[] image) throws ReportExecutionException; } diff --git a/reportbuilder/java/com/sun/star/report/InputRepository.java b/reportbuilder/java/com/sun/star/report/InputRepository.java index 21564d5851df..88a519cb7113 100644 --- a/reportbuilder/java/com/sun/star/report/InputRepository.java +++ b/reportbuilder/java/com/sun/star/report/InputRepository.java @@ -82,4 +82,10 @@ public interface InputRepository boolean isReadable(final String name); void closeInputRepository(); + + /** returns the URL of the database document + * + * @return the URL of the database document + */ + String getRootURL(); } diff --git a/reportbuilder/java/com/sun/star/report/JobProgressIndicator.java b/reportbuilder/java/com/sun/star/report/JobProgressIndicator.java index 4cda72cacb5d..585394207568 100644 --- a/reportbuilder/java/com/sun/star/report/JobProgressIndicator.java +++ b/reportbuilder/java/com/sun/star/report/JobProgressIndicator.java @@ -53,6 +53,7 @@ public interface JobProgressIndicator * Stopped indicators must ignore that call. * * @param string the progress description + * @param text * @param maxValue the maximum value * @see JobProgressIndicator#setText(String) */ diff --git a/reportbuilder/java/com/sun/star/report/OfficeToken.java b/reportbuilder/java/com/sun/star/report/OfficeToken.java index 6685afe297da..ceddb98f077e 100644 --- a/reportbuilder/java/com/sun/star/report/OfficeToken.java +++ b/reportbuilder/java/com/sun/star/report/OfficeToken.java @@ -27,41 +27,42 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - package com.sun.star.report; /** * * @author Ocke Janssen */ -public class OfficeToken { - public static final String GRAPHIC = "graphic"; - public static final String GRAPHICS = "Graphics"; - public static final String GRAPHIC_PROPERTIES = "graphic-properties"; - public static final String PARAGRAPH = "paragraph"; - public static final String TRUE = "true"; - public static final String FALSE = "false"; - public static final String FRAME = "frame"; - public static final String STYLE_NAME = "style-name"; - public static final String BACKGROUND_COLOR = "background-color"; - public static final String COVERED_TABLE_CELL = "covered-table-cell"; - public static final String TABLE = "table"; - public static final String TABLE_COLUMN = "table-column"; - public static final String TABLE_COLUMNS = "table-columns"; +public class OfficeToken +{ + + public static final String GRAPHIC = "graphic"; + public static final String GRAPHICS = "Graphics"; + public static final String GRAPHIC_PROPERTIES = "graphic-properties"; + public static final String PARAGRAPH = "paragraph"; + public static final String TRUE = "true"; + public static final String FALSE = "false"; + public static final String FRAME = "frame"; + public static final String STYLE_NAME = "style-name"; + public static final String BACKGROUND_COLOR = "background-color"; + public static final String COVERED_TABLE_CELL = "covered-table-cell"; + public static final String TABLE = "table"; + public static final String TABLE_COLUMN = "table-column"; + public static final String TABLE_COLUMNS = "table-columns"; public static final String TABLE_HEADER_COLUMNS = "table-header-columns"; - public static final String TABLE_HEADER_ROWS = "table-header-rows"; - public static final String TABLE_ROWS = "table-rows"; - public static final String TABLE_ROW = "table-row"; - public static final String TABLE_CELL = "table-cell"; - public static final String P = "p"; - public static final String OBJECT_OLE = "object-ole"; - public static final String IMAGE = "image"; - public static final String IMAGE_DATA = "image-data"; - public static final String PRESERVE_IRI = "preserve-IRI"; - public static final String SCALE = "scale"; - public static final String NAME = "name"; - public static final String SHAPES = "shapes"; - public static final String ISOTROPIC = "isotropic"; - public static final String ANISOTROPIC = "anisotropic"; - public static final String NONE = "none"; + public static final String TABLE_HEADER_ROWS = "table-header-rows"; + public static final String TABLE_ROWS = "table-rows"; + public static final String TABLE_ROW = "table-row"; + public static final String TABLE_CELL = "table-cell"; + public static final String P = "p"; + public static final String OBJECT_OLE = "object-ole"; + public static final String IMAGE = "image"; + public static final String IMAGE_DATA = "image-data"; + public static final String PRESERVE_IRI = "preserve-IRI"; + public static final String SCALE = "scale"; + public static final String NAME = "name"; + public static final String SHAPES = "shapes"; + public static final String ISOTROPIC = "isotropic"; + public static final String ANISOTROPIC = "anisotropic"; + public static final String NONE = "none"; } diff --git a/reportbuilder/java/com/sun/star/report/OutputRepository.java b/reportbuilder/java/com/sun/star/report/OutputRepository.java index aba5deba5f51..0fd3c08f40ec 100644 --- a/reportbuilder/java/com/sun/star/report/OutputRepository.java +++ b/reportbuilder/java/com/sun/star/report/OutputRepository.java @@ -58,6 +58,7 @@ public interface OutputRepository /** allows to acces sub repositories inside this repository * * @param name describes the path to the sub repository + * @param mimeType * @return the sub repository * @throws java.io.IOException when the sub repository doesn't exist. */ diff --git a/reportbuilder/java/com/sun/star/report/ReportEngine.java b/reportbuilder/java/com/sun/star/report/ReportEngine.java index 549f5bb224c7..0e5260dff253 100644 --- a/reportbuilder/java/com/sun/star/report/ReportEngine.java +++ b/reportbuilder/java/com/sun/star/report/ReportEngine.java @@ -50,6 +50,7 @@ public interface ReportEngine /** * Open points: How to define scheduling? * + * @param definition * @return the report job definition for the job description. * @throws JobDefinitionException */ diff --git a/reportbuilder/java/com/sun/star/report/ReportEngineParameterNames.java b/reportbuilder/java/com/sun/star/report/ReportEngineParameterNames.java index 8c191a77d2a3..c8798d02436e 100644 --- a/reportbuilder/java/com/sun/star/report/ReportEngineParameterNames.java +++ b/reportbuilder/java/com/sun/star/report/ReportEngineParameterNames.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report; /** @@ -37,23 +35,24 @@ package com.sun.star.report; */ public class ReportEngineParameterNames { - public static final String CONTENT_TYPE = "content-type"; - public static final String INPUT_NAME= "input.name"; - public static final String INPUT_REPOSITORY = "input.repository"; - public static final String OUTPUT_NAME= "output.name"; - public static final String OUTPUT_REPOSITORY = "output.repository"; - public static final String INPUT_DATASOURCE_FACTORY = "input.datasource-factory"; - public static final String IMAGE_SERVICE = "ImageService"; - public static final String INPUT_REPORTJOB_FACTORY = "input.reportjob-factory"; - public static final String INPUT_MASTER_COLUMNS = "input.master-columns"; - public static final String INPUT_MASTER_VALUES = "input.master-values"; - public static final String INPUT_DETAIL_COLUMNS = "input.detail-columns"; - public static final String MIMETYPE = "output.mimetype"; - public static final String AUTHOR = "Author"; - public static final String TITLE = "Title"; - public static final String MAXROWS = "MaxRows"; - private ReportEngineParameterNames () - { - } + public static final String CONTENT_TYPE = "content-type"; + public static final String INPUT_NAME = "input.name"; + public static final String INPUT_REPOSITORY = "input.repository"; + public static final String OUTPUT_NAME = "output.name"; + public static final String OUTPUT_REPOSITORY = "output.repository"; + public static final String INPUT_DATASOURCE_FACTORY = "input.datasource-factory"; + public static final String IMAGE_SERVICE = "ImageService"; + public static final String INPUT_REPORTJOB_FACTORY = "input.reportjob-factory"; + public static final String INPUT_MASTER_COLUMNS = "input.master-columns"; + public static final String INPUT_MASTER_VALUES = "input.master-values"; + public static final String INPUT_DETAIL_COLUMNS = "input.detail-columns"; + public static final String MIMETYPE = "output.mimetype"; + public static final String AUTHOR = "Author"; + public static final String TITLE = "Title"; + public static final String MAXROWS = "MaxRows"; + + private ReportEngineParameterNames() + { + } } diff --git a/reportbuilder/java/com/sun/star/report/ReportExecutionException.java b/reportbuilder/java/com/sun/star/report/ReportExecutionException.java index 55ba51e4a61e..d9b0a77cbe09 100644 --- a/reportbuilder/java/com/sun/star/report/ReportExecutionException.java +++ b/reportbuilder/java/com/sun/star/report/ReportExecutionException.java @@ -27,64 +27,63 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report; public class ReportExecutionException extends Exception { - /** - * Constructs a new exception with null as its detail message. The cause is - * not initialized, and may subsequently be initialized by a call to {@link - * #initCause}. - */ - public ReportExecutionException () - { - } - /** - * Constructs a new exception with the specified cause and a detail message of - * (cause==null ? null : cause.toString()) (which typically contains the class - * and detail message of cause). This constructor is useful for exceptions that - * are little more than wrappers for other throwables (for example, {@link - * java.security.PrivilegedActionException}). - * - * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} - * method). (A null value is permitted, and indicates that the - * cause is nonexistent or unknown.) - * @since 1.4 - */ - public ReportExecutionException (Throwable cause) - { - super(cause); - } + /** + * Constructs a new exception with null as its detail message. The cause is + * not initialized, and may subsequently be initialized by a call to {@link + * #initCause}. + */ + public ReportExecutionException() + { + } + + /** + * Constructs a new exception with the specified cause and a detail message of + * (cause==null ? null : cause.toString()) (which typically contains the class + * and detail message of cause). This constructor is useful for exceptions that + * are little more than wrappers for other throwables (for example, {@link + * java.security.PrivilegedActionException}). + * + * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} + * method). (A null value is permitted, and indicates that the + * cause is nonexistent or unknown.) + * @since 1.4 + */ + public ReportExecutionException(Throwable cause) + { + super(cause); + } - /** - * Constructs a new exception with the specified detail message. The cause is not - * initialized, and may subsequently be initialized by a call to {@link #initCause}. - * - * @param message the detail message. The detail message is saved for later retrieval by - * the {@link #getMessage()} method. - */ - public ReportExecutionException (String message) - { - super(message); - } + /** + * Constructs a new exception with the specified detail message. The cause is not + * initialized, and may subsequently be initialized by a call to {@link #initCause}. + * + * @param message the detail message. The detail message is saved for later retrieval by + * the {@link #getMessage()} method. + */ + public ReportExecutionException(String message) + { + super(message); + } - /** - * Constructs a new exception with the specified detail message and cause.

Note that - * the detail message associated with cause is not automatically - * incorporated in this exception's detail message. - * - * @param message the detail message (which is saved for later retrieval by the {@link - * #getMessage()} method). - * @param cause the cause (which is saved for later retrieval by the {@link - * #getCause()} method). (A null value is permitted, and - * indicates that the cause is nonexistent or unknown.) - * @since 1.4 - */ - public ReportExecutionException (String message, Throwable cause) - { - super(message, cause); - } + /** + * Constructs a new exception with the specified detail message and cause.

Note that + * the detail message associated with cause is not automatically + * incorporated in this exception's detail message. + * + * @param message the detail message (which is saved for later retrieval by the {@link + * #getMessage()} method). + * @param cause the cause (which is saved for later retrieval by the {@link + * #getCause()} method). (A null value is permitted, and + * indicates that the cause is nonexistent or unknown.) + * @since 1.4 + */ + public ReportExecutionException(String message, Throwable cause) + { + super(message, cause); + } } diff --git a/reportbuilder/java/com/sun/star/report/ReportExpression.java b/reportbuilder/java/com/sun/star/report/ReportExpression.java index 5576a74205d5..f26fbd6cec8b 100644 --- a/reportbuilder/java/com/sun/star/report/ReportExpression.java +++ b/reportbuilder/java/com/sun/star/report/ReportExpression.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report; /** @@ -47,8 +45,10 @@ package com.sun.star.report; */ public interface ReportExpression { - void setParameters (Object[] parameters); - Object getParameters (); - Object getValue(DataRow row); + void setParameters(Object[] parameters); + + Object getParameters(); + + Object getValue(DataRow row); } diff --git a/reportbuilder/java/com/sun/star/report/ReportJob.java b/reportbuilder/java/com/sun/star/report/ReportJob.java index 8caf39b9bdae..6f93f5db8b0c 100644 --- a/reportbuilder/java/com/sun/star/report/ReportJob.java +++ b/reportbuilder/java/com/sun/star/report/ReportJob.java @@ -62,6 +62,8 @@ public interface ReportJob * first. If we execute at once, the user either has to deal with * threading code or wont receive any progress information in single * threaded environments. + * @throws java.io.IOException + * @throws ReportExecutionException */ void execute() throws ReportExecutionException, IOException; diff --git a/reportbuilder/java/com/sun/star/report/SDBCReportData.java b/reportbuilder/java/com/sun/star/report/SDBCReportData.java index 5107d8ebf427..610cbde2a796 100644 --- a/reportbuilder/java/com/sun/star/report/SDBCReportData.java +++ b/reportbuilder/java/com/sun/star/report/SDBCReportData.java @@ -83,7 +83,7 @@ public class SDBCReportData implements DataSource parameters = xSuppParams.getParameters(); } - final XColumnsSupplier columnsSup = (XColumnsSupplier)UnoRuntime.queryInterface(XColumnsSupplier.class, rowSet); + final XColumnsSupplier columnsSup = (XColumnsSupplier) UnoRuntime.queryInterface(XColumnsSupplier.class, rowSet); final XNameAccess columns = columnsSup.getColumns(); final String[] columnNamesList = columns.getElementNames(); final XResultSetMetaDataSupplier sup = (XResultSetMetaDataSupplier) UnoRuntime.queryInterface(XResultSetMetaDataSupplier.class, rowSet); @@ -92,7 +92,9 @@ public class SDBCReportData implements DataSource columnCount = resultSetMetaData.getColumnCount(); firstParameterIndex = columnCount + 1; if (parameters != null) + { columnCount += parameters.getCount(); + } columnTypes = new int[columnCount]; columnNames = new String[columnCount]; @@ -111,7 +113,7 @@ public class SDBCReportData implements DataSource final XPropertySet paramColumn = (XPropertySet) UnoRuntime.queryInterface( XPropertySet.class, parameters.getByIndex(i - firstParameterIndex)); columnNames[i - 1] = (String) paramColumn.getPropertyValue("Name"); - columnTypes[i - 1] = ((Integer) paramColumn.getPropertyValue("Type")).intValue(); + columnTypes[i - 1] = (Integer) paramColumn.getPropertyValue("Type"); } catch (Exception e) { @@ -151,7 +153,9 @@ public class SDBCReportData implements DataSource public boolean absolute(final int row) throws DataSourceException { if (rowSet == null) + { return false; + } try { if (row == 0) @@ -170,7 +174,9 @@ public class SDBCReportData implements DataSource public boolean next() throws DataSourceException { if (rowSet == null) + { return false; + } try { return rowSet.next(); @@ -294,7 +300,9 @@ public class SDBCReportData implements DataSource public Object getObject(final int column) throws DataSourceException { if (rowSet == null) + { return null; + } try { final boolean isParameterValue = (parameters != null) && (column >= firstParameterIndex); diff --git a/reportbuilder/java/com/sun/star/report/SDBCReportDataFactory.java b/reportbuilder/java/com/sun/star/report/SDBCReportDataFactory.java index af396d415338..5c3032e3a7f9 100644 --- a/reportbuilder/java/com/sun/star/report/SDBCReportDataFactory.java +++ b/reportbuilder/java/com/sun/star/report/SDBCReportDataFactory.java @@ -77,6 +77,7 @@ import org.apache.commons.logging.LogFactory; */ public class SDBCReportDataFactory implements DataSourceFactory { + private static final String ESCAPEPROCESSING = "EscapeProcessing"; private class RowSetProperties @@ -97,7 +98,6 @@ public class SDBCReportDataFactory implements DataSourceFactory this.maxRows = maxRows; } - public boolean equals(Object obj) { if (obj == null) @@ -143,8 +143,10 @@ public class SDBCReportDataFactory implements DataSourceFactory return hash; } } + class ParameterDefinition { + int parameterCount = 0; private ArrayList parameterIndex = new ArrayList(); } @@ -210,14 +212,14 @@ public class SDBCReportDataFactory implements DataSourceFactory final Integer maxRows = (Integer) parameters.get("MaxRows"); RowSetProperties rowSetProps = new RowSetProperties(escapeProcessing, commandType, command, filter, maxRows); - final Object[] p = createRowSet(rowSetProps,parameters); - final XRowSet rowSet = (XRowSet)p[0]; + final Object[] p = createRowSet(rowSetProps, parameters); + final XRowSet rowSet = (XRowSet) p[0]; - if (command.length() != 0 ) + if (command.length() != 0) { - final ParameterDefinition paramDef = (ParameterDefinition)p[1]; - fillParameter(parameters, rowSet,paramDef); - rowSetCreated = rowSetCreated && ( maxRows == null || maxRows.intValue() == 0); + final ParameterDefinition paramDef = (ParameterDefinition) p[1]; + fillParameter(parameters, rowSet, paramDef); + rowSetCreated = rowSetCreated && (maxRows == null || maxRows == 0); final XCompletedExecution execute = (XCompletedExecution) UnoRuntime.queryInterface(XCompletedExecution.class, rowSet); if (rowSetCreated && execute != null && paramDef.parameterCount > 0) @@ -521,7 +523,7 @@ public class SDBCReportDataFactory implements DataSourceFactory { final XPropertySet prop = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, queries.getByName(command)); final Boolean escape = (Boolean) prop.getPropertyValue(ESCAPEPROCESSING); - if (escape.booleanValue()) + if (escape) { statement = (String) prop.getPropertyValue(UNO_COMMAND); final XSingleSelectQueryComposer composer = getComposer(tools, statement, CommandType.COMMAND); @@ -533,7 +535,7 @@ public class SDBCReportDataFactory implements DataSourceFactory composer.setOrder(order); } final Boolean applyFilter = (Boolean) prop.getPropertyValue(UNO_APPLY_FILTER); - if (applyFilter.booleanValue()) + if (applyFilter) { final String filter = (String) prop.getPropertyValue(UNO_FILTER); if (filter != null && filter.length() != 0) @@ -561,7 +563,7 @@ public class SDBCReportDataFactory implements DataSourceFactory } private void fillParameter(final Map parameters, - final XRowSet rowSet,final ParameterDefinition paramDef) + final XRowSet rowSet, final ParameterDefinition paramDef) throws SQLException, UnknownPropertyException, PropertyVetoException, @@ -582,19 +584,22 @@ public class SDBCReportDataFactory implements DataSourceFactory { object = ((BigDecimal) object).toString(); } - final Integer pos = (Integer)paramDef.parameterIndex.get(i); + final Integer pos = (Integer) paramDef.parameterIndex.get(i); para.setObject(pos + 1, object); } } } - private final Object[] createRowSet(final RowSetProperties rowSetProps,final Map parameters) + private final Object[] createRowSet(final RowSetProperties rowSetProps, final Map parameters) throws Exception { final ArrayList detailColumns = (ArrayList) parameters.get(DETAIL_COLUMNS); - if (rowSetProperties.containsKey(rowSetProps) && detailColumns != null && !detailColumns.isEmpty() ) + if (rowSetProperties.containsKey(rowSetProps) && detailColumns != null && !detailColumns.isEmpty()) { - return new Object[]{ rowSetProperties.get(rowSetProps),parameterMap.get(rowSetProps)}; + return new Object[] + { + rowSetProperties.get(rowSetProps), parameterMap.get(rowSetProps) + }; } rowSetCreated = true; @@ -628,7 +633,10 @@ public class SDBCReportDataFactory implements DataSourceFactory rowSetProperties.put(rowSetProps, rowSet); parameterMap.put(rowSetProps, paramDef); - return new Object[]{rowSet,paramDef}; + return new Object[] + { + rowSet, paramDef + }; } private ParameterDefinition createParameter(final Map parameters, @@ -645,7 +653,7 @@ public class SDBCReportDataFactory implements DataSourceFactory if (composer != null) { final XPropertySet rowSetProp = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, rowSet); - if (((Boolean) rowSetProp.getPropertyValue(APPLY_FILTER)).booleanValue()) + if ((Boolean) rowSetProp.getPropertyValue(APPLY_FILTER)) { composer.setFilter((String) rowSetProp.getPropertyValue("Filter")); } @@ -660,7 +668,7 @@ public class SDBCReportDataFactory implements DataSourceFactory { final int oldParameterCount = params.getCount(); paramDef.parameterCount = oldParameterCount; - if ( detailColumns != null ) + if (detailColumns != null) { for (int i = 0; i < oldParameterCount; i++) { @@ -672,10 +680,10 @@ public class SDBCReportDataFactory implements DataSourceFactory final String name = (String) parameter.getPropertyValue("Name"); for (int j = 0; j < detailColumns.size(); j++) { - if ( name.equals(detailColumns.get(j) ) ) + if (name.equals(detailColumns.get(j))) { handledColumns.add(name); - paramDef.parameterIndex.add(Integer.valueOf(i)); + paramDef.parameterIndex.add(i); --paramDef.parameterCount; break; } @@ -691,7 +699,7 @@ public class SDBCReportDataFactory implements DataSourceFactory } } final ArrayList masterValues = (ArrayList) parameters.get(MASTER_VALUES); - if (masterValues != null && !masterValues.isEmpty() && paramDef.parameterIndex.size() != detailColumns.size() ) + if (masterValues != null && !masterValues.isEmpty() && paramDef.parameterIndex.size() != detailColumns.size()) { // Vector masterColumns = (Vector) parameters.get("master-columns"); @@ -708,7 +716,7 @@ public class SDBCReportDataFactory implements DataSourceFactory ++newParamterCounter) { final String detail = (String) it.next(); - if ( !handledColumns.contains(detail) ) + if (!handledColumns.contains(detail)) { //String master = (String) masterIt.next(); oldFilter.append(quote); @@ -720,7 +728,7 @@ public class SDBCReportDataFactory implements DataSourceFactory { oldFilter.append(" AND "); } - paramDef.parameterIndex.add(Integer.valueOf(newParamterCounter + paramDef.parameterCount - 1)); + paramDef.parameterIndex.add(newParamterCounter + paramDef.parameterCount - 1); } } @@ -728,7 +736,7 @@ public class SDBCReportDataFactory implements DataSourceFactory final String sQuery = composer.getQuery(); rowSetProp.setPropertyValue(UNO_COMMAND, sQuery); - rowSetProp.setPropertyValue(UNO_COMMAND_TYPE,Integer.valueOf(CommandType.COMMAND)); + rowSetProp.setPropertyValue(UNO_COMMAND_TYPE, Integer.valueOf(CommandType.COMMAND)); } } return paramDef; @@ -773,7 +781,7 @@ public class SDBCReportDataFactory implements DataSourceFactory { final XPropertySet prop = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, queries.getByName(command)); final Boolean escape = (Boolean) prop.getPropertyValue(ESCAPEPROCESSING); - rowSetProp.setPropertyValue( ESCAPEPROCESSING, escape); + rowSetProp.setPropertyValue(ESCAPEPROCESSING, escape); final String queryCommand = (String) prop.getPropertyValue(UNO_COMMAND); statement = "SELECT * FROM (" + queryCommand + ")"; } diff --git a/reportbuilder/java/com/sun/star/report/SOImageService.java b/reportbuilder/java/com/sun/star/report/SOImageService.java index 83413fe91deb..075981414957 100644 --- a/reportbuilder/java/com/sun/star/report/SOImageService.java +++ b/reportbuilder/java/com/sun/star/report/SOImageService.java @@ -57,6 +57,8 @@ public class SOImageService implements ImageService /** * Creates a new instance of SOImageService + * @param xCompContext + * @throws ReportExecutionException */ public SOImageService(final XComponentContext xCompContext) throws ReportExecutionException, com.sun.star.uno.Exception @@ -87,7 +89,10 @@ public class SOImageService implements ImageService final Dimension dim = new Dimension(); try { - final PropertyValue[] value = new PropertyValue[]{new PropertyValue()}; + final PropertyValue[] value = new PropertyValue[] + { + new PropertyValue() + }; // value[0] = new PropertyValue(); value[0].Name = "InputStream"; value[0].Value = image; @@ -106,7 +111,7 @@ public class SOImageService implements ImageService { imageSize = (Size) xImage.getPropertyValue("SizePixel"); final int dpi = java.awt.Toolkit.getDefaultToolkit().getScreenResolution(); - final double fac = 2540 / (double)dpi; + final double fac = 2540 / (double) dpi; dim.setSize(imageSize.Width * fac, imageSize.Height * fac); } } @@ -135,7 +140,10 @@ public class SOImageService implements ImageService { try { - final PropertyValue[] value = new PropertyValue[]{new PropertyValue()}; + final PropertyValue[] value = new PropertyValue[] + { + new PropertyValue() + }; value[0].Name = "InputStream"; value[0].Value = image; diff --git a/reportbuilder/java/com/sun/star/report/StorageRepository.java b/reportbuilder/java/com/sun/star/report/StorageRepository.java index da0c7fe9e123..b25d481ddc98 100644 --- a/reportbuilder/java/com/sun/star/report/StorageRepository.java +++ b/reportbuilder/java/com/sun/star/report/StorageRepository.java @@ -55,26 +55,31 @@ import org.apache.commons.logging.LogFactory; */ public class StorageRepository implements InputRepository, OutputRepository { + private static final Log LOGGER = LogFactory.getLog(SDBCReportDataFactory.class); private static final String REPORT_PROCESSING_FAILED = "ReportProcessing failed"; private XStorage input; private XStorage output; + private final String rootURL; /** * * @param input * @param output + * @param rootURL * @throws java.io.IOException */ - public StorageRepository(final XStorage input, final XStorage output) + public StorageRepository(final XStorage input, final XStorage output, final String rootURL) { this.input = input; this.output = output; + this.rootURL = rootURL; } - public StorageRepository(final XStorage storage, final boolean isOutput) + public StorageRepository(final XStorage storage, final boolean isOutput, final String rootURL) { + this.rootURL = rootURL; if (isOutput) { this.output = storage; @@ -150,7 +155,7 @@ public class StorageRepository implements InputRepository, OutputRepository } catch (NoSuchElementException e) { - // We expect this exception, no need to log it. + // We expect this exception, no need to log it. } return false; } @@ -204,7 +209,7 @@ public class StorageRepository implements InputRepository, OutputRepository throw new IOException(); } final XStorage storage = (XStorage) UnoRuntime.queryInterface(XStorage.class, input.openStorageElement(temp, ElementModes.READ)); - return new StorageRepository(storage, false); + return new StorageRepository(storage, false, rootURL); } catch (NoSuchElementException ex) { @@ -254,7 +259,7 @@ public class StorageRepository implements InputRepository, OutputRepository final XPropertySet prop = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, storage); prop.setPropertyValue("MediaType", mimeType); } - return new StorageRepository(storage, true); + return new StorageRepository(storage, true, rootURL); } catch (UnknownPropertyException ex) { @@ -333,8 +338,13 @@ public class StorageRepository implements InputRepository, OutputRepository } catch (NoSuchElementException ex) { - // We expect this exception, no need to log it. + // We expect this exception, no need to log it. } return false; } + + public String getRootURL() + { + return rootURL; + } } diff --git a/reportbuilder/java/com/sun/star/report/function/metadata/AuthorFunction.java b/reportbuilder/java/com/sun/star/report/function/metadata/AuthorFunction.java index 87cb540b4a94..1bbf417a4b8e 100644 --- a/reportbuilder/java/com/sun/star/report/function/metadata/AuthorFunction.java +++ b/reportbuilder/java/com/sun/star/report/function/metadata/AuthorFunction.java @@ -50,7 +50,7 @@ public class AuthorFunction implements Function return "AUTHOR"; } - public TypeValuePair evaluate(final FormulaContext context,final ParameterCallback parameters) + public TypeValuePair evaluate(final FormulaContext context, final ParameterCallback parameters) throws EvaluationException { if (parameters.getParameterCount() != 0) diff --git a/reportbuilder/java/com/sun/star/report/function/metadata/AuthorFunctionDescription.java b/reportbuilder/java/com/sun/star/report/function/metadata/AuthorFunctionDescription.java index 475ce31ab9a1..3413239388e8 100644 --- a/reportbuilder/java/com/sun/star/report/function/metadata/AuthorFunctionDescription.java +++ b/reportbuilder/java/com/sun/star/report/function/metadata/AuthorFunctionDescription.java @@ -43,7 +43,7 @@ public class AuthorFunctionDescription extends AbstractFunctionDescription public AuthorFunctionDescription() { - super("AUTHOR","com.sun.star.report.function.metadata.Author-Function"); + super("AUTHOR", "com.sun.star.report.function.metadata.Author-Function"); } public FunctionCategory getCategory() diff --git a/reportbuilder/java/com/sun/star/report/function/metadata/TitleFunction.java b/reportbuilder/java/com/sun/star/report/function/metadata/TitleFunction.java index be342dc27706..928bbaa0f0ec 100644 --- a/reportbuilder/java/com/sun/star/report/function/metadata/TitleFunction.java +++ b/reportbuilder/java/com/sun/star/report/function/metadata/TitleFunction.java @@ -54,7 +54,7 @@ public class TitleFunction implements Function return "TITLE"; } - public TypeValuePair evaluate(final FormulaContext context,final ParameterCallback parameters) + public TypeValuePair evaluate(final FormulaContext context, final ParameterCallback parameters) throws EvaluationException { if (parameters.getParameterCount() != 0) diff --git a/reportbuilder/java/com/sun/star/report/function/metadata/TitleFunctionDescription.java b/reportbuilder/java/com/sun/star/report/function/metadata/TitleFunctionDescription.java index a8dadc17a00d..83e9c5de464f 100644 --- a/reportbuilder/java/com/sun/star/report/function/metadata/TitleFunctionDescription.java +++ b/reportbuilder/java/com/sun/star/report/function/metadata/TitleFunctionDescription.java @@ -43,7 +43,7 @@ public class TitleFunctionDescription extends AbstractFunctionDescription public TitleFunctionDescription() { - super("TITLE","com.sun.star.report.function.metadata.Title-Function"); + super("TITLE", "com.sun.star.report.function.metadata.Title-Function"); } public FunctionCategory getCategory() diff --git a/reportbuilder/java/com/sun/star/report/pentaho/DefaultNameGenerator.java b/reportbuilder/java/com/sun/star/report/pentaho/DefaultNameGenerator.java index 0f2c858d1c96..d73b1c222512 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/DefaultNameGenerator.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/DefaultNameGenerator.java @@ -65,7 +65,9 @@ public class DefaultNameGenerator * * @param namePrefix a user defined name for that resource. * @param mimeType the mime type of the resource to be stored in the repository. + * @param isStream * @return the generated, fully qualified name. + * @throws java.io.IOException */ private String generateName(final String namePrefix, final String mimeType, final boolean isStream) throws IOException @@ -112,7 +114,7 @@ public class DefaultNameGenerator { throw new IOException(); } - firstFileName.delete(0,firstFileName.length() ); + firstFileName.delete(0, firstFileName.length()); firstFileName.append(name); firstFileName.append(counter); if (suffix != null) diff --git a/reportbuilder/java/com/sun/star/report/pentaho/OfficeNamespaces.java b/reportbuilder/java/com/sun/star/report/pentaho/OfficeNamespaces.java index 15e364c40e8d..84fac5773588 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/OfficeNamespaces.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/OfficeNamespaces.java @@ -62,7 +62,6 @@ public class OfficeNamespaces public static final String XSI_NS = "http://www.w3.org/2001/XMLSchema-instance"; public static final String OOREPORT_NS = "http://openoffice.org/2005/report"; public static final String CONFIG = "urn:oasis:names:tc:opendocument:xmlns:config:1.0"; - /** * @deprecated */ diff --git a/reportbuilder/java/com/sun/star/report/pentaho/PentahoFormulaContext.java b/reportbuilder/java/com/sun/star/report/pentaho/PentahoFormulaContext.java index 46d541679741..846053cd6bc4 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/PentahoFormulaContext.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/PentahoFormulaContext.java @@ -44,6 +44,7 @@ import org.pentaho.reporting.libraries.base.config.Configuration; */ public class PentahoFormulaContext implements FormulaContext { + final private FormulaContext backend; final private Configuration config; diff --git a/reportbuilder/java/com/sun/star/report/pentaho/PentahoReportJob.java b/reportbuilder/java/com/sun/star/report/pentaho/PentahoReportJob.java index e3b5b268ea43..fbfa211e112c 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/PentahoReportJob.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/PentahoReportJob.java @@ -30,7 +30,7 @@ package com.sun.star.report.pentaho; import java.io.IOException; -import java.util.ArrayList; +import java.lang.Integer;import java.util.ArrayList; import com.sun.star.report.DataSourceFactory; import com.sun.star.report.InputRepository; @@ -79,6 +79,7 @@ import org.pentaho.reporting.libraries.resourceloader.ResourceManager; */ public class PentahoReportJob implements ReportJob { + private static final Log LOGGER = LogFactory.getLog(PentahoReportJob.class); private boolean finished; private final List listeners; @@ -93,7 +94,6 @@ public class PentahoReportJob implements ReportJob private final ReportJobDefinition definition; private final List masterValues; private final List detailColumns; - private final Integer maxRows; public ReportJobDefinition getDefinition() { @@ -145,7 +145,7 @@ public class PentahoReportJob implements ReportJob this.masterValues = (ArrayList) jobProperties.getProperty(ReportEngineParameterNames.INPUT_MASTER_VALUES); this.detailColumns = (ArrayList) jobProperties.getProperty(ReportEngineParameterNames.INPUT_DETAIL_COLUMNS); - this.maxRows = (Integer) jobProperties.getProperty(ReportEngineParameterNames.MAXROWS); + Integer maxRows=(Integer) jobProperties.getProperty(ReportEngineParameterNames.MAXROWS); this.resourceManager = new ResourceManager(); this.resourceManager.registerDefaults(); @@ -197,7 +197,7 @@ public class PentahoReportJob implements ReportJob */ public void interrupt() { - // hey, not yet .. + // hey, not yet .. } /** @@ -240,14 +240,18 @@ public class PentahoReportJob implements ReportJob { final OfficeGroup group = (OfficeGroup) node; final FormulaExpression exp = (FormulaExpression) group.getGroupingExpression(); - if ( exp == null ) + if (exp == null) + { continue; + } try { final String expression = exp.getFormulaExpression(); - if ( expression == null) + if (expression == null) + { continue; + } final FormulaFunction function = (FormulaFunction) parser.parse(expression); final LValue[] parameters = function.getChildValues(); if (parameters.length > 0) @@ -261,7 +265,7 @@ public class PentahoReportJob implements ReportJob if (reportExp.getName().equals(name)) { - final LValue val = (LValue) parser.parse(reportExp.getFormulaExpression()); + final LValue val = parser.parse(reportExp.getFormulaExpression()); if (val instanceof FormulaFunction) { final FormulaFunction reportFunction = (FormulaFunction) val; @@ -308,6 +312,7 @@ public class PentahoReportJob implements ReportJob job.getConfiguration().setConfigProperty(ReportEngineParameterNames.AUTHOR, (String) jobProperties.getProperty(ReportEngineParameterNames.AUTHOR)); job.getConfiguration().setConfigProperty(ReportEngineParameterNames.TITLE, (String) jobProperties.getProperty(ReportEngineParameterNames.TITLE)); } + /** * Although we might want to run the job as soon as it has been created, sometimes it is * wiser to let the user add some listeners first. If we execute at once, the user @@ -344,7 +349,7 @@ public class PentahoReportJob implements ReportJob final String escapeProcessing = (String) officeReport.getAttribute(OfficeNamespaces.OOREPORT_NS, SDBCReportDataFactory.ESCAPE_PROCESSING); report.setQuery(command); parameters.put(SDBCReportDataFactory.COMMAND_TYPE, commandType); - parameters.put(SDBCReportDataFactory.ESCAPE_PROCESSING,Boolean.valueOf(!("false".equals(escapeProcessing)))); + parameters.put(SDBCReportDataFactory.ESCAPE_PROCESSING, !("false".equals(escapeProcessing))); final String filter = (String) officeReport.getAttribute(OfficeNamespaces.OOREPORT_NS, "filter"); parameters.put(SDBCReportDataFactory.UNO_FILTER, filter); @@ -361,8 +366,10 @@ public class PentahoReportJob implements ReportJob catch (final Exception e) { String message = e.getMessage(); - if ( message.length() == 0 ) + if (message.length() == 0) + { message = "Failed to process the report"; + } throw new ReportExecutionException(message, e); } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/SOFormulaOpCodeMapper.java b/reportbuilder/java/com/sun/star/report/pentaho/SOFormulaOpCodeMapper.java index 30c9711dce05..7a25d05c593f 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/SOFormulaOpCodeMapper.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/SOFormulaOpCodeMapper.java @@ -55,7 +55,6 @@ public final class SOFormulaOpCodeMapper extends WeakBase this.parser = parser; } - // com.sun.star.sheet.XFormulaOpCodeMapper: public int getOpCodeExternal() { @@ -69,13 +68,15 @@ public final class SOFormulaOpCodeMapper extends WeakBase public com.sun.star.sheet.FormulaToken[] getMappings(String[] Names, int Language) throws com.sun.star.lang.IllegalArgumentException { - if ( Language != FormulaLanguage.ODFF ) + if (Language != FormulaLanguage.ODFF) + { throw new IllegalArgumentException(); + } final ArrayList token = new ArrayList(); final Map parserNames = parser.getNames(); for (int i = 0; i < Names.length; i++) { - if ( parserNames.containsKey(Names[i]) ) + if (parserNames.containsKey(Names[i])) { token.add(((FormulaOpCodeMapEntry) parserNames.get(Names[i])).Token); } @@ -86,36 +87,38 @@ public final class SOFormulaOpCodeMapper extends WeakBase public com.sun.star.sheet.FormulaOpCodeMapEntry[] getAvailableMappings(int Language, int Groups) throws com.sun.star.lang.IllegalArgumentException { - if ( Language != FormulaLanguage.ODFF ) + if (Language != FormulaLanguage.ODFF) + { throw new IllegalArgumentException(); + } final ArrayList token = new ArrayList(); - if ( Groups == FormulaMapGroup.SPECIAL ) + if (Groups == FormulaMapGroup.SPECIAL) { return (com.sun.star.sheet.FormulaOpCodeMapEntry[]) parser.getSpecialOpCodes().toArray(new FormulaOpCodeMapEntry[parser.getSpecialOpCodes().size()]); } else { - if ( (Groups & FormulaMapGroup.ARRAY_SEPARATORS) != 0 ) + if ((Groups & FormulaMapGroup.ARRAY_SEPARATORS) != 0) { token.addAll(parser.getGroup(SOFormulaParser.ARRAY_SEPARATORS).values()); } - if ( (Groups & FormulaMapGroup.SEPARATORS) != 0 ) + if ((Groups & FormulaMapGroup.SEPARATORS) != 0) { token.addAll(parser.getGroup(SOFormulaParser.SEPARATORS).values()); } - if ( (Groups & FormulaMapGroup.ARRAY_SEPARATORS) != 0 ) + if ((Groups & FormulaMapGroup.ARRAY_SEPARATORS) != 0) { token.addAll(parser.getGroup(SOFormulaParser.ARRAY_SEPARATORS).values()); } - if ( (Groups & FormulaMapGroup.UNARY_OPERATORS) != 0 ) + if ((Groups & FormulaMapGroup.UNARY_OPERATORS) != 0) { token.addAll(parser.getGroup(SOFormulaParser.UNARY_OPERATORS).values()); } - if ( (Groups & FormulaMapGroup.BINARY_OPERATORS) != 0 ) + if ((Groups & FormulaMapGroup.BINARY_OPERATORS) != 0) { token.addAll(parser.getGroup(SOFormulaParser.BINARY_OPERATORS).values()); } - if ( (Groups & FormulaMapGroup.FUNCTIONS) != 0 ) + if ((Groups & FormulaMapGroup.FUNCTIONS) != 0) { token.addAll(parser.getGroup(SOFormulaParser.FUNCTIONS).values()); } @@ -142,6 +145,7 @@ public final class SOFormulaOpCodeMapper extends WeakBase /** * This method is a simple helper function to used in the static component initialisation functions as well as * in getSupportedServiceNames. + * @return */ public static String[] getServiceNames() { diff --git a/reportbuilder/java/com/sun/star/report/pentaho/SOFormulaParser.java b/reportbuilder/java/com/sun/star/report/pentaho/SOFormulaParser.java index 321acb017728..4ef8a43f954a 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/SOFormulaParser.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/SOFormulaParser.java @@ -75,7 +75,6 @@ public final class SOFormulaParser extends ComponentBase private final PropertySetMixin m_prophlp; private static final String __serviceName = "com.sun.star.report.meta.FormulaParser"; private static final String OPERATORS = "org.pentaho.reporting.libraries.formula.operators."; - // attributes final private List m_OpCodeMap = new ArrayList(); private XFormulaOpCodeMapper formulaOpCodeMapper = null; @@ -119,7 +118,7 @@ public final class SOFormulaParser extends ComponentBase for (int i = 0; i < names.length; i++) { final String token = names[i]; - if ( token != null && token.length() > 0 && token.charAt(0) == '"' ) + if (token != null && token.length() > 0 && token.charAt(0) == '"') { names[i] = token.substring(1, token.length() - 1); } @@ -138,8 +137,9 @@ public final class SOFormulaParser extends ComponentBase parserAllOpCodes.put(opCode.Token.OpCode, opCode); specialOpCodes.add(opCode); } - // addOpCodes(names, opCodes,SPECIAL,false); - } catch ( Exception ex ) + // addOpCodes(names, opCodes,SPECIAL,false); + } + catch (Exception ex) { ex.printStackTrace(); } @@ -150,21 +150,24 @@ public final class SOFormulaParser extends ComponentBase // of the PropertySetMixin helper for further information. // Ensure that your attributes are initialized correctly! m_prophlp = new PropertySetMixin(m_xContext, this, - new Type(com.sun.star.report.meta.XFormulaParser.class), null); + new Type(com.sun.star.report.meta.XFormulaParser.class), null); } - ; // com.sun.star.sheet.XFormulaParser: public com.sun.star.sheet.FormulaToken[] parseFormula(String aFormula, com.sun.star.table.CellAddress aReferencePos) { final ArrayList tokens = new ArrayList(); - if ( !"=".equals(aFormula) ) + if (!"=".equals(aFormula)) { String formula; - if ( aFormula.charAt(0) == '=' ) + if (aFormula.charAt(0) == '=') + { formula = aFormula.substring(1); + } else + { formula = aFormula; + } final ArrayList images = new ArrayList(); try { @@ -176,16 +179,20 @@ public final class SOFormulaParser extends ComponentBase final FormulaToken formulaToken; images.add(token.image); final String upper = token.image.toUpperCase(); - if ( parserNames.containsKey(upper) ) + if (parserNames.containsKey(upper)) { - if ( "(".equals(token.image)) + if ("(".equals(token.image)) + { brackets++; - else if ( ")".equals(token.image)) + } + else if (")".equals(token.image)) + { --brackets; + } final FormulaOpCodeMapEntry opCode = (FormulaOpCodeMapEntry) parserNames.get(upper); formulaToken = opCode.Token; } - else if ( token.kind == GeneratedFormulaParserConstants.WHITESPACE ) + else if (token.kind == GeneratedFormulaParserConstants.WHITESPACE) { final FormulaOpCodeMapEntry opCode = (FormulaOpCodeMapEntry) specialOpCodes.get(FormulaMapGroupSpecialOffset.SPACES); formulaToken = opCode.Token; @@ -200,10 +207,10 @@ public final class SOFormulaParser extends ComponentBase tokens.add(formulaToken); token = tokenParser.getNextToken(); } - if ( brackets > 0 ) + if (brackets > 0) { final FormulaOpCodeMapEntry opCode = (FormulaOpCodeMapEntry) parserNames.get(")"); - while ( brackets-- != 0 ) + while (brackets-- != 0) { formula = formula.concat(")"); images.add(")"); @@ -213,15 +220,18 @@ public final class SOFormulaParser extends ComponentBase } parser.parse(formula); - } catch ( ParseException ex ) + } + catch (ParseException ex) { boolean found = false; // error occured so all token must be bad for (int i = 0; i < tokens.size(); i++) { - if ( !found && ex.currentToken != null && images.get(i).equals(ex.currentToken.image) ) + if (!found && ex.currentToken != null && images.get(i).equals(ex.currentToken.image)) + { found = true; - if ( found ) + } + if (found) { final FormulaToken dest = new FormulaToken(); dest.OpCode = ((FormulaOpCodeMapEntry) specialOpCodes.get(FormulaMapGroupSpecialOffset.BAD)).Token.OpCode; @@ -230,9 +240,11 @@ public final class SOFormulaParser extends ComponentBase tokens.add(i, dest); } } - } catch ( java.lang.Exception e ) + } + catch (java.lang.Exception e) { - } catch ( TokenMgrError e ) + } + catch (TokenMgrError e) { } } @@ -245,17 +257,21 @@ public final class SOFormulaParser extends ComponentBase for (int i = 0; i < aTokens.length; i++) { final FormulaToken formulaToken = aTokens[i]; - if ( formulaToken.OpCode == opCodePush.Token.OpCode && !formulaToken.Data.equals(Any.VOID) ) + if (formulaToken.OpCode == opCodePush.Token.OpCode && !formulaToken.Data.equals(Any.VOID)) { ret.append(formulaToken.Data); } - else if ( parserAllOpCodes.containsKey(formulaToken.OpCode) ) + else if (parserAllOpCodes.containsKey(formulaToken.OpCode)) { final FormulaOpCodeMapEntry opCode = (FormulaOpCodeMapEntry) parserAllOpCodes.get(formulaToken.OpCode); - if ( opCode.Name.length() > 0 ) + if (opCode.Name.length() > 0) + { ret.append(opCode.Name); - else if ( !formulaToken.Data.equals(Any.VOID) ) + } + else if (!formulaToken.Data.equals(Any.VOID)) + { ret.append(formulaToken.Data); + } } } return ret.toString(); @@ -330,6 +346,7 @@ public final class SOFormulaParser extends ComponentBase /** * This method is a simple helper function to used in the static component initialisation functions as well as * in getSupportedServiceNames. + * @return */ public static String[] getServiceNames() { @@ -341,7 +358,7 @@ public final class SOFormulaParser extends ComponentBase public XFormulaOpCodeMapper getFormulaOpCodeMapper() { - if ( formulaOpCodeMapper == null ) + if (formulaOpCodeMapper == null) { formulaOpCodeMapper = new SOFormulaOpCodeMapper(this); } @@ -364,15 +381,17 @@ public final class SOFormulaParser extends ComponentBase for (; i < opCodes.length; i++) { opCode = opCodes[i]; - if ( names[j].equals(opCode.Name) ) + if (names[j].equals(opCode.Name)) { break; } } - if ( i >= opCodes.length ) + if (i >= opCodes.length) { - if ( !add ) + if (!add) + { continue; + } final FormulaToken token = new FormulaToken(ownTokenCounter++, Any.VOID); opCode = new FormulaOpCodeMapEntry(names[j], token); } @@ -400,22 +419,22 @@ public final class SOFormulaParser extends ComponentBase while (iter.hasNext()) { final String configKey = (String) iter.next(); - if ( configKey.endsWith(".class") == false ) + if (!configKey.endsWith(".class")) { continue; } final String operatorClass = configuration.getConfigProperty(configKey); - if ( operatorClass == null ) + if (operatorClass == null) { continue; } - if ( operatorClass.length() == 0 ) + if (operatorClass.length() == 0) { continue; } final String tokenKey = configKey.substring(0, configKey.length() - ".class".length()) + ".token"; final String token = configuration.getConfigProperty(tokenKey); - if ( token == null ) + if (token == null) { continue; } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/SOFunctionManager.java b/reportbuilder/java/com/sun/star/report/pentaho/SOFunctionManager.java index 333441f8b2b5..3b890b940c6f 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/SOFunctionManager.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/SOFunctionManager.java @@ -85,6 +85,7 @@ public final class SOFunctionManager extends ComponentBase implements XFunctionM /** * This method is a simple helper function to used in the static component initialisation functions as well as * in getSupportedServiceNames. + * @return */ public static String[] getServiceNames() { @@ -140,27 +141,33 @@ public final class SOFunctionManager extends ComponentBase implements XFunctionM // com.sun.star.report.meta.XFunctionManager: public com.sun.star.report.meta.XFunctionCategory getCategory(int position) throws com.sun.star.lang.IndexOutOfBoundsException, com.sun.star.lang.WrappedTargetException { - if ( position >= categories.length ) + if (position >= categories.length) + { throw new com.sun.star.lang.IndexOutOfBoundsException(); - return new StarFunctionCategory(defaultContext,m_xContext, functionRegistry, position, categories[position]); + } + return new StarFunctionCategory(defaultContext, m_xContext, functionRegistry, position, categories[position]); } public XFunctionDescription getFunctionByName(String arg0) throws NoSuchElementException { final FunctionDescription func = functionRegistry.getMetaData(arg0); - if ( func == null ) + if (func == null) + { throw new NoSuchElementException(); + } int i = 0; for (; i < categories.length; i++) { - if ( categories[i] == func.getCategory() ) + if (categories[i] == func.getCategory()) + { break; + } } try { return new StarFunctionDescription(defaultContext, m_xContext, getCategory(i), func); } - catch ( Exception ex ) + catch (Exception ex) { } return null; diff --git a/reportbuilder/java/com/sun/star/report/pentaho/SOReportJobFactory.java b/reportbuilder/java/com/sun/star/report/pentaho/SOReportJobFactory.java index 1acf2c846bcb..b1f886d664c5 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/SOReportJobFactory.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/SOReportJobFactory.java @@ -35,7 +35,9 @@ import com.sun.star.beans.UnknownPropertyException; import com.sun.star.beans.PropertyVetoException; import com.sun.star.beans.XPropertyChangeListener; import com.sun.star.beans.XVetoableChangeListener; +import com.sun.star.container.XChild; import com.sun.star.embed.XStorage; +import com.sun.star.frame.XModel; import com.sun.star.lang.IllegalArgumentException; import com.sun.star.lang.XInitialization; import com.sun.star.lang.XServiceInfo; @@ -60,6 +62,7 @@ import com.sun.star.report.SOImageService; import com.sun.star.report.StorageRepository; import com.sun.star.report.XReportDefinition; import com.sun.star.report.pentaho.SOReportJobFactory._SOReportJobFactory; +import com.sun.star.sdb.XDocumentDataSource; import com.sun.star.sdbc.XConnection; import com.sun.star.sdbc.XRowSet; import com.sun.star.task.XJob; @@ -92,7 +95,7 @@ public class SOReportJobFactory * The service name, that must be used to get an instance of this service. */ private static final String __serviceName = - "com.sun.star.report.pentaho.SOReportJobFactory"; + "com.sun.star.report.pentaho.SOReportJobFactory"; private final PropertySetMixin m_prophlp; /** * The initial component contextr, that gives access to the service manager, supported singletons, ... It's @@ -106,8 +109,8 @@ public class SOReportJobFactory { m_cmpCtx = xCompContext; m_prophlp = new PropertySetMixin(m_cmpCtx, this, - new Type(XJob.class), - null); // no optionals + new Type(XJob.class), + null); // no optionals } /** @@ -117,7 +120,7 @@ public class SOReportJobFactory * @throws Exception Every exception will not be handled, but will be passed to the caller. */ public void initialize(final Object[] object) - throws com.sun.star.uno.Exception + throws com.sun.star.uno.Exception { /* The component describes what arguments its expected and in which * order!At this point you can read the objects and can intialize @@ -138,13 +141,14 @@ public class SOReportJobFactory /** * This method is a simple helper function to used in the static component initialisation functions as well as * in getSupportedServiceNames. + * @return */ public static String[] getServiceNames() { return new String[] - { - __serviceName - }; + { + __serviceName + }; } /** @@ -177,20 +181,20 @@ public class SOReportJobFactory final XRegistryKey xRegistryRootKey = simpleReg.getRootKey(); // read locale final XRegistryKey locale = xRegistryRootKey.openKey(value); - if ( locale != null ) + if (locale != null) { final String newLocale = locale.getStringValue(); - if ( newLocale != null ) + if (newLocale != null) { currentLocale = newLocale.replace('-', '_'); } } } - catch ( InvalidValueException ex ) + catch (InvalidValueException ex) { Logger.getLogger(SOReportJobFactory.class.getName()).log(Level.SEVERE, null, ex); } - catch ( InvalidRegistryException ex ) + catch (InvalidRegistryException ex) { Logger.getLogger(SOReportJobFactory.class.getName()).log(Level.SEVERE, null, ex); } @@ -199,32 +203,34 @@ public class SOReportJobFactory } public Object execute(final NamedValue[] namedValue) - throws com.sun.star.lang.IllegalArgumentException, com.sun.star.uno.Exception + throws com.sun.star.lang.IllegalArgumentException, com.sun.star.uno.Exception { final ClassLoader cl = java.lang.Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); try { final XSimpleRegistry simpleReg = (XSimpleRegistry) UnoRuntime.queryInterface(XSimpleRegistry.class, - m_cmpCtx.getServiceManager().createInstanceWithContext("com.sun.star.configuration.ConfigurationRegistry", m_cmpCtx)); + m_cmpCtx.getServiceManager().createInstanceWithContext("com.sun.star.configuration.ConfigurationRegistry", m_cmpCtx)); - String currentLocale = getLocaleFromRegistry(simpleReg,"org.openoffice.Setup","L10N/ooSetupSystemLocale"); - if ( currentLocale == null || "".equals(currentLocale) ) + String currentLocale = getLocaleFromRegistry(simpleReg, "org.openoffice.Setup", "L10N/ooSetupSystemLocale"); + if (currentLocale == null || "".equals(currentLocale)) { - currentLocale = getLocaleFromRegistry(simpleReg,"org.openoffice.Office.Linguistic","General/DefaultLocale"); + currentLocale = getLocaleFromRegistry(simpleReg, "org.openoffice.Office.Linguistic", "General/DefaultLocale"); } - if ( currentLocale != null && !"".equals(currentLocale) ) + if (currentLocale != null && !"".equals(currentLocale)) + { System.setProperty("org.pentaho.reporting.libraries.formula.locale", currentLocale); + } final ReportJob job = createReportJob(namedValue); job.execute(); } - catch ( java.lang.Exception e ) + catch (java.lang.Exception e) { LOGGER.error("ReportProcessing failed", e); throw new com.sun.star.lang.WrappedTargetException(e.getMessage(), this, null); } - catch ( java.lang.IncompatibleClassChangeError e2 ) + catch (java.lang.IncompatibleClassChangeError e2) { LOGGER.error("Detected an IncompatibleClassChangeError"); throw new com.sun.star.lang.WrappedTargetException("caught a " + e2.getClass().getName(), this, new com.sun.star.uno.Exception(e2.getLocalizedMessage())); @@ -244,55 +250,55 @@ public class SOReportJobFactory String title = null; Integer maxRows = null; - for ( int i = 0; i < namedValue.length; ++i ) + for (int i = 0; i < namedValue.length; ++i) { final NamedValue aProps = namedValue[i]; - if ( "ActiveConnection".equalsIgnoreCase(aProps.Name) ) + if ("ActiveConnection".equalsIgnoreCase(aProps.Name)) { activeConnection = (XConnection) UnoRuntime.queryInterface(XConnection.class, aProps.Value); } - else if ( "ReportDefinition".equalsIgnoreCase(aProps.Name) ) + else if ("ReportDefinition".equalsIgnoreCase(aProps.Name)) { report = (XReportDefinition) UnoRuntime.queryInterface(XReportDefinition.class, aProps.Value); } - else if ( "InputStorage".equalsIgnoreCase(aProps.Name) ) + else if ("InputStorage".equalsIgnoreCase(aProps.Name)) { input = (XStorage) UnoRuntime.queryInterface(XStorage.class, aProps.Value); } - else if ( "OutputStorage".equalsIgnoreCase(aProps.Name) ) + else if ("OutputStorage".equalsIgnoreCase(aProps.Name)) { output = (XStorage) UnoRuntime.queryInterface(XStorage.class, aProps.Value); } - else if ( "RowSet".equalsIgnoreCase(aProps.Name) ) + else if ("RowSet".equalsIgnoreCase(aProps.Name)) { rowSet = (XRowSet) UnoRuntime.queryInterface(XRowSet.class, aProps.Value); } - else if ( "mimetype".equalsIgnoreCase(aProps.Name) ) + else if ("mimetype".equalsIgnoreCase(aProps.Name)) { mimetype = (String) aProps.Value; } - else if ( "MaxRows".equalsIgnoreCase(aProps.Name) ) + else if ("MaxRows".equalsIgnoreCase(aProps.Name)) { maxRows = (Integer) aProps.Value; } - else if ( ReportEngineParameterNames.AUTHOR.equalsIgnoreCase(aProps.Name) ) + else if (ReportEngineParameterNames.AUTHOR.equalsIgnoreCase(aProps.Name)) { author = (String) aProps.Value; } - else if ( ReportEngineParameterNames.TITLE.equalsIgnoreCase(aProps.Name) ) + else if (ReportEngineParameterNames.TITLE.equalsIgnoreCase(aProps.Name)) { title = (String) aProps.Value; } } - if ( input == null || output == null ) + if (input == null || output == null) { throw new com.sun.star.lang.IllegalArgumentException(); } - if ( rowSet == null ) + if (rowSet == null) { - if ( report == null || activeConnection == null ) + if (report == null || activeConnection == null) { throw new com.sun.star.lang.IllegalArgumentException(); } @@ -301,19 +307,22 @@ public class SOReportJobFactory else { final XPropertySet set = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, rowSet); - if ( set == null ) + if (set == null) { throw new com.sun.star.lang.IllegalArgumentException(); } activeConnection = (XConnection) UnoRuntime.queryInterface(XConnection.class, set.getPropertyValue("ActiveConnection")); } - if ( mimetype == null ) + if (mimetype == null) { mimetype = PentahoReportEngineMetaData.OPENDOCUMENT_TEXT; } + final XChild child = UnoRuntime.queryInterface(XChild.class, activeConnection); + final XDocumentDataSource docSource = UnoRuntime.queryInterface(XDocumentDataSource.class, child.getParent()); + final XModel model = UnoRuntime.queryInterface(XModel.class, docSource.getDatabaseDocument()); final DataSourceFactory dataFactory = new SDBCReportDataFactory(m_cmpCtx, activeConnection); - final StorageRepository storageRepository = new StorageRepository(input, output); + final StorageRepository storageRepository = new StorageRepository(input, output, model.getURL()); final String inputName = "content.xml"; final String outputName = "content.xml"; @@ -330,11 +339,11 @@ public class SOReportJobFactory procParms.setProperty(ReportEngineParameterNames.IMAGE_SERVICE, new SOImageService(m_cmpCtx)); procParms.setProperty(ReportEngineParameterNames.INPUT_REPORTJOB_FACTORY, this); procParms.setProperty(ReportEngineParameterNames.MAXROWS, maxRows); - if ( author != null ) + if (author != null) { procParms.setProperty(ReportEngineParameterNames.AUTHOR, author); } - if ( title != null ) + if (title != null) { procParms.setProperty(ReportEngineParameterNames.TITLE, title); } @@ -349,38 +358,38 @@ public class SOReportJobFactory } public void setPropertyValue(final String aPropertyName, final Object aValue) - throws UnknownPropertyException, PropertyVetoException, com.sun.star.lang.IllegalArgumentException, - WrappedTargetException + throws UnknownPropertyException, PropertyVetoException, com.sun.star.lang.IllegalArgumentException, + WrappedTargetException { m_prophlp.setPropertyValue(aPropertyName, aValue); } public Object getPropertyValue(final String aPropertyName) - throws UnknownPropertyException, WrappedTargetException + throws UnknownPropertyException, WrappedTargetException { return m_prophlp.getPropertyValue(aPropertyName); } public void addPropertyChangeListener(final String aPropertyName, final XPropertyChangeListener xListener) - throws UnknownPropertyException, WrappedTargetException + throws UnknownPropertyException, WrappedTargetException { m_prophlp.addPropertyChangeListener(aPropertyName, xListener); } public void removePropertyChangeListener(final String aPropertyName, final XPropertyChangeListener xListener) - throws UnknownPropertyException, WrappedTargetException + throws UnknownPropertyException, WrappedTargetException { m_prophlp.removePropertyChangeListener(aPropertyName, xListener); } public void addVetoableChangeListener(final String aPropertyName, final XVetoableChangeListener xListener) - throws UnknownPropertyException, WrappedTargetException + throws UnknownPropertyException, WrappedTargetException { m_prophlp.addVetoableChangeListener(aPropertyName, xListener); } public void removeVetoableChangeListener(final String aPropertyName, final XVetoableChangeListener xListener) - throws UnknownPropertyException, WrappedTargetException + throws UnknownPropertyException, WrappedTargetException { m_prophlp.removeVetoableChangeListener(aPropertyName, xListener); } @@ -400,20 +409,20 @@ public class SOReportJobFactory try { - if ( sImplName.equals(_SOReportJobFactory.class.getName()) ) + if (sImplName.equals(_SOReportJobFactory.class.getName())) { xFactory = Factory.createComponentFactory(_SOReportJobFactory.class, _SOReportJobFactory.getServiceNames()); } - else if ( sImplName.equals(SOFunctionManager.class.getName()) ) + else if (sImplName.equals(SOFunctionManager.class.getName())) { xFactory = Factory.createComponentFactory(SOFunctionManager.class, SOFunctionManager.getServiceNames()); } - else if ( sImplName.equals(SOFormulaParser.class.getName()) ) + else if (sImplName.equals(SOFormulaParser.class.getName())) { xFactory = Factory.createComponentFactory(SOFormulaParser.class, SOFormulaParser.getServiceNames()); } } - catch ( java.lang.IncompatibleClassChangeError e2 ) + catch (java.lang.IncompatibleClassChangeError e2) { } @@ -431,13 +440,11 @@ public class SOReportJobFactory public static boolean __writeRegistryServiceInfo(final XRegistryKey regKey) { return Factory.writeRegistryServiceInfo(SOFunctionManager.class.getName(), - SOFunctionManager.getServiceNames(), - regKey) && - Factory.writeRegistryServiceInfo(_SOReportJobFactory.class.getName(), - _SOReportJobFactory.getServiceNames(), - regKey) && - Factory.writeRegistryServiceInfo(SOFormulaParser.class.getName(), - SOFormulaParser.getServiceNames(), - regKey); + SOFunctionManager.getServiceNames(), + regKey) && Factory.writeRegistryServiceInfo(_SOReportJobFactory.class.getName(), + _SOReportJobFactory.getServiceNames(), + regKey) && Factory.writeRegistryServiceInfo(SOFormulaParser.class.getName(), + SOFormulaParser.getServiceNames(), + regKey); } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/StarFunctionCategory.java b/reportbuilder/java/com/sun/star/report/pentaho/StarFunctionCategory.java index 19b041715acf..2c8b9d9f8786 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/StarFunctionCategory.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/StarFunctionCategory.java @@ -41,10 +41,10 @@ import org.pentaho.reporting.libraries.formula.DefaultFormulaContext; import org.pentaho.reporting.libraries.formula.function.FunctionCategory; import org.pentaho.reporting.libraries.formula.function.FunctionRegistry; - public final class StarFunctionCategory extends WeakBase - implements com.sun.star.report.meta.XFunctionCategory + implements com.sun.star.report.meta.XFunctionCategory { + private final XComponentContext m_xContext; private final PropertySetMixin m_prophlp; // attributes @@ -55,7 +55,7 @@ public final class StarFunctionCategory extends WeakBase private final DefaultFormulaContext defaultContext; private final Locale defaultLocale; - public StarFunctionCategory( DefaultFormulaContext defaultContext,final XComponentContext context,final FunctionRegistry functionRegistry,final int _number,final FunctionCategory category ) + public StarFunctionCategory(DefaultFormulaContext defaultContext, final XComponentContext context, final FunctionRegistry functionRegistry, final int _number, final FunctionCategory category) { this.defaultContext = defaultContext; m_xContext = context; @@ -68,7 +68,7 @@ public final class StarFunctionCategory extends WeakBase category.getDisplayName(defaultContext.getLocalizationContext().getLocale()); locale = defaultContext.getLocalizationContext().getLocale(); } - catch(MissingResourceException e) + catch (MissingResourceException e) { locale = Locale.ENGLISH; } @@ -80,8 +80,8 @@ public final class StarFunctionCategory extends WeakBase // of the PropertySetMixin helper for further information. // Ensure that your attributes are initialized correctly! m_prophlp = new PropertySetMixin(m_xContext, this, - new Type(com.sun.star.report.meta.XFunctionCategory.class), null); - }; + new Type(com.sun.star.report.meta.XFunctionCategory.class), null); + } // com.sun.star.beans.XPropertySet: public com.sun.star.beans.XPropertySetInfo getPropertySetInfo() @@ -89,7 +89,7 @@ public final class StarFunctionCategory extends WeakBase return m_prophlp.getPropertySetInfo(); } - public void setPropertyValue(String aPropertyName, Object aValue) throws com.sun.star.beans.UnknownPropertyException, com.sun.star.beans.PropertyVetoException, com.sun.star.lang.IllegalArgumentException,com.sun.star.lang.WrappedTargetException + public void setPropertyValue(String aPropertyName, Object aValue) throws com.sun.star.beans.UnknownPropertyException, com.sun.star.beans.PropertyVetoException, com.sun.star.lang.IllegalArgumentException, com.sun.star.lang.WrappedTargetException { m_prophlp.setPropertyValue(aPropertyName, aValue); } @@ -117,7 +117,7 @@ public final class StarFunctionCategory extends WeakBase public void removeVetoableChangeListener(String aPropertyName, com.sun.star.beans.XVetoableChangeListener xListener) throws com.sun.star.beans.UnknownPropertyException, com.sun.star.lang.WrappedTargetException { m_prophlp.removeVetoableChangeListener(aPropertyName, xListener); - } + } // com.sun.star.container.XElementAccess: public com.sun.star.uno.Type getElementType() @@ -154,9 +154,10 @@ public final class StarFunctionCategory extends WeakBase public com.sun.star.report.meta.XFunctionDescription getFunction(int position) throws com.sun.star.lang.IndexOutOfBoundsException, com.sun.star.lang.WrappedTargetException { - if ( position >= functions.length ) + if (position >= functions.length) + { throw new IndexOutOfBoundsException(); - return new StarFunctionDescription(defaultContext,m_xContext,this,functionRegistry.getMetaData(functions[position])); + } + return new StarFunctionDescription(defaultContext, m_xContext, this, functionRegistry.getMetaData(functions[position])); } - } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/StarFunctionDescription.java b/reportbuilder/java/com/sun/star/report/pentaho/StarFunctionDescription.java index df19a3f06174..da84dc57746f 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/StarFunctionDescription.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/StarFunctionDescription.java @@ -63,7 +63,8 @@ public final class StarFunctionDescription extends WeakBase { functionDescription.getDisplayName(defaultContext.getLocalizationContext().getLocale()); locale = defaultContext.getLocalizationContext().getLocale(); - } catch ( MissingResourceException e ) + } + catch (MissingResourceException e) { locale = Locale.ENGLISH; } @@ -75,9 +76,8 @@ public final class StarFunctionDescription extends WeakBase // of the PropertySetMixin helper for further information. // Ensure that your attributes are initialized correctly! m_prophlp = new PropertySetMixin(m_xContext, this, - new Type(com.sun.star.report.meta.XFunctionDescription.class), null); + new Type(com.sun.star.report.meta.XFunctionDescription.class), null); } - ; // com.sun.star.beans.XPropertySet: public com.sun.star.beans.XPropertySetInfo getPropertySetInfo() @@ -139,8 +139,10 @@ public final class StarFunctionDescription extends WeakBase for (int i = 0; i < count; i++) { signature.append(functionDescription.getParameterDisplayName(i, defaultLocale)); - if ( i != (count - 1) ) + if (i != (count - 1)) + { signature.append(';'); + } } signature.append(')'); return signature.toString(); @@ -150,7 +152,7 @@ public final class StarFunctionDescription extends WeakBase { int count = functionDescription.getParameterCount(); final boolean infinite = functionDescription.isInfiniteParameterCount(); - if ( infinite ) + if (infinite) { count = 30; } @@ -170,18 +172,24 @@ public final class StarFunctionDescription extends WeakBase { final boolean infinite = functionDescription.isInfiniteParameterCount(); final int count = functionDescription.getParameterCount(); - if ( !infinite && arguments.length > count ) + if (!infinite && arguments.length > count) + { throw new com.sun.star.lang.IllegalArgumentException(); + } final StringBuffer formula = new StringBuffer(getName()); formula.append('('); for (int i = 0; i < arguments.length; ++i) { - if ( arguments[i].length() == 0 ) + if (arguments[i].length() == 0) + { break; + } formula.append(arguments[i]); - if ( i < (arguments.length - 1) && arguments[i+1].length() != 0 ) + if (i < (arguments.length - 1) && arguments[i + 1].length() != 0) + { formula.append(';'); + } } formula.append(')'); return formula.toString(); diff --git a/reportbuilder/java/com/sun/star/report/pentaho/StarReportDataFactory.java b/reportbuilder/java/com/sun/star/report/pentaho/StarReportDataFactory.java index 2a3600213d6c..07359dc33452 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/StarReportDataFactory.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/StarReportDataFactory.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho; import java.util.HashMap; @@ -42,85 +40,87 @@ import com.sun.star.report.DataSourceFactory; public class StarReportDataFactory implements ReportDataFactory, Cloneable { - private final DataSourceFactory backend; - public StarReportDataFactory (DataSourceFactory backend) - { - this.backend = backend; - } + private final DataSourceFactory backend; - /** - * Queries a datasource. The string 'query' defines the name of the query. The - * Parameterset given here may contain more data than actually needed. - *

- * The dataset may change between two calls, do not assume anything! - * - * @param query - * @param parameters - * @return - */ - public ReportData queryData (final String query, final DataSet parameters) - throws ReportDataFactoryException - { - try + public StarReportDataFactory(DataSourceFactory backend) { - final HashMap map = new HashMap(); - final int count = parameters.getColumnCount(); - for (int i = 0; i < count; i++) - { - final Object o = parameters.get(i); - map.put (parameters.getColumnName(i), o); - } - return new StarReportData(backend.queryData(query, map)); + this.backend = backend; } - catch(DataSourceException dse) + + /** + * Queries a datasource. The string 'query' defines the name of the query. The + * Parameterset given here may contain more data than actually needed. + *

+ * The dataset may change between two calls, do not assume anything! + * + * @param query + * @param parameters + * @return + */ + public ReportData queryData(final String query, final DataSet parameters) + throws ReportDataFactoryException { - String message = dse.getMessage(); - if ( message.length() == 0 ) - message = "Failed to create report data wrapper"; - throw new ReportDataFactoryException(message,dse); + try + { + final HashMap map = new HashMap(); + final int count = parameters.getColumnCount(); + for (int i = 0; i < count; i++) + { + final Object o = parameters.get(i); + map.put(parameters.getColumnName(i), o); + } + return new StarReportData(backend.queryData(query, map)); + } + catch (DataSourceException dse) + { + String message = dse.getMessage(); + if (message.length() == 0) + { + message = "Failed to create report data wrapper"; + } + throw new ReportDataFactoryException(message, dse); + } + catch (org.jfree.report.DataSourceException e) + { + String message = e.getMessage(); + if (message.length() == 0) + { + message = "Failed to query data"; + } + throw new ReportDataFactoryException(message); + } } - catch (org.jfree.report.DataSourceException e) + + public void open() { - String message = e.getMessage(); - if ( message.length() == 0 ) - message = "Failed to query data"; - throw new ReportDataFactoryException(message); } - } - - public void open() - { - - } - public void close() - { - - } - - - /** - * Derives a freshly initialized report data factory, which is independend of - * the original data factory. Opening or Closing one data factory must not - * affect the other factories. - * - * @return - */ - public ReportDataFactory derive() - { - try + public void close() { - return (ReportDataFactory) clone(); } - catch (CloneNotSupportedException e) + + /** + * Derives a freshly initialized report data factory, which is independend of + * the original data factory. Opening or Closing one data factory must not + * affect the other factories. + * + * @return + */ + public ReportDataFactory derive() { - throw new IllegalStateException("Clone failed?"); + try + { + return (ReportDataFactory) clone(); + } + catch (CloneNotSupportedException e) + { + throw new IllegalStateException("Clone failed?"); + } } - } - public Object clone () throws CloneNotSupportedException - { - return super.clone(); - } + public Object clone() throws CloneNotSupportedException + { + return super.clone(); + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/StarReportModule.java b/reportbuilder/java/com/sun/star/report/pentaho/StarReportModule.java index e39de6fb2f00..6558e30db9f4 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/StarReportModule.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/StarReportModule.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho; import org.pentaho.reporting.libraries.base.boot.AbstractModule; @@ -37,26 +35,25 @@ import org.pentaho.reporting.libraries.base.boot.SubSystem; public class StarReportModule extends AbstractModule { - public StarReportModule () - throws ModuleInitializeException - { - loadModuleInfo(); - } - - /** - * Initializes the module. Use this method to perform all initial setup operations. This - * method is called only once in a modules lifetime. If the initializing cannot be - * completed, throw a ModuleInitializeException to indicate the error,. The module will - * not be available to the system. - * - * @param subSystem the subSystem. - * @throws org.jfree.base.modules.ModuleInitializeException - * if an error ocurred while initializing the module. - */ - public void initialize (final SubSystem subSystem) - throws ModuleInitializeException - { + public StarReportModule() + throws ModuleInitializeException + { + loadModuleInfo(); + } - } + /** + * Initializes the module. Use this method to perform all initial setup operations. This + * method is called only once in a modules lifetime. If the initializing cannot be + * completed, throw a ModuleInitializeException to indicate the error,. The module will + * not be available to the system. + * + * @param subSystem the subSystem. + * @throws org.jfree.base.modules.ModuleInitializeException + * if an error ocurred while initializing the module. + */ + public void initialize(final SubSystem subSystem) + throws ModuleInitializeException + { + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/expressions/SumExpression.java b/reportbuilder/java/com/sun/star/report/pentaho/expressions/SumExpression.java index e1259d168b44..2e4f9f396088 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/expressions/SumExpression.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/expressions/SumExpression.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.expressions; import com.sun.star.report.ReportExpression; @@ -36,25 +34,26 @@ import com.sun.star.report.DataRow; public class SumExpression implements ReportExpression { - private Object[] parameters; - public SumExpression () - { - } + private Object[] parameters; + + public SumExpression() + { + } - public Object getParameters () - { - return parameters; - } + public Object getParameters() + { + return parameters; + } - public Object getValue (final DataRow row) - { + public Object getValue(final DataRow row) + { - return null; - } + return null; + } - public void setParameters (final Object[] parameters) - { - this.parameters = parameters; - } + public void setParameters(final Object[] parameters) + { + this.parameters = parameters; + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/expressions/SumExpressionMetaData.java b/reportbuilder/java/com/sun/star/report/pentaho/expressions/SumExpressionMetaData.java index 8e2d395c8493..b29b4ebb7ddb 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/expressions/SumExpressionMetaData.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/expressions/SumExpressionMetaData.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.expressions; import java.util.Locale; @@ -37,45 +35,46 @@ import com.sun.star.report.ReportExpressionMetaData; public class SumExpressionMetaData implements ReportExpressionMetaData { - public String getDescription (final Locale l) - { - // todo implement me - return null; - } - public String getDisplayName (final Locale l) - { - // todo implement me - return null; - } + public String getDescription(final Locale l) + { + // todo implement me + return null; + } + + public String getDisplayName(final Locale l) + { + // todo implement me + return null; + } - public String getName () - { - // todo implement me - return null; - } + public String getName() + { + // todo implement me + return null; + } - public int getParameterCount () - { - // todo implement me - return 0; - } + public int getParameterCount() + { + // todo implement me + return 0; + } - public String getParameterDescription (final int param,final Locale locale) - { - // todo implement me - return null; - } + public String getParameterDescription(final int param, final Locale locale) + { + // todo implement me + return null; + } - public String getParameterDisplayName (final int param,final Locale locale) - { - // todo implement me - return null; - } + public String getParameterDisplayName(final int param, final Locale locale) + { + // todo implement me + return null; + } - public String getParameterName (final int param) - { - // todo implement me - return null; - } + public String getParameterName(final int param) + { + // todo implement me + return null; + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/AbstractReportElementLayoutController.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/AbstractReportElementLayoutController.java index 3f7245bf12c9..622699aa89d6 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/AbstractReportElementLayoutController.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/AbstractReportElementLayoutController.java @@ -242,7 +242,7 @@ public abstract class AbstractReportElementLayoutController } catch (DataSourceException e) { - // ignore .. assume that the reference has not changed. + // ignore .. assume that the reference has not changed. } } final LValue[] childValues = lValue.getChildValues(); diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FixedTextLayoutController.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FixedTextLayoutController.java index 9ced56ef7ac4..7a96eabbb6b5 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FixedTextLayoutController.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FixedTextLayoutController.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.layoutprocessor; import org.jfree.report.flow.layoutprocessor.LayoutController; @@ -55,37 +53,35 @@ import com.sun.star.report.pentaho.model.FixedTextElement; * @since 05.03.2007 */ public class FixedTextLayoutController - extends AbstractReportElementLayoutController + extends AbstractReportElementLayoutController { - public FixedTextLayoutController() - { - } - + public FixedTextLayoutController() + { + } - protected boolean isValueChanged() - { - final FlowController controller = getFlowController(); - final GlobalMasterRow masterRow = controller.getMasterRow(); - final ReportDataRow reportDataRow = masterRow.getReportDataRow(); - return reportDataRow.getCursor() == 0; - } + protected boolean isValueChanged() + { + final FlowController controller = getFlowController(); + final GlobalMasterRow masterRow = controller.getMasterRow(); + final ReportDataRow reportDataRow = masterRow.getReportDataRow(); + return reportDataRow.getCursor() == 0; + } - protected LayoutController delegateContentGeneration - (final ReportTarget target) - throws ReportProcessingException, ReportDataFactoryException, - DataSourceException - { - final FixedTextElement fte = (FixedTextElement) getNode(); - final Section content = fte.getContent(); + protected LayoutController delegateContentGeneration(final ReportTarget target) + throws ReportProcessingException, ReportDataFactoryException, + DataSourceException + { + final FixedTextElement fte = (FixedTextElement) getNode(); + final Section content = fte.getContent(); - final FlowController flowController = getFlowController(); - final ReportContext reportContext = flowController.getReportContext(); - final LayoutControllerFactory layoutControllerFactory = - reportContext.getLayoutControllerFactory(); + final FlowController flowController = getFlowController(); + final ReportContext reportContext = flowController.getReportContext(); + final LayoutControllerFactory layoutControllerFactory = + reportContext.getLayoutControllerFactory(); - final FixedTextLayoutController flc = (FixedTextLayoutController) clone(); - flc.setState(AbstractReportElementLayoutController.FINISHED); - return layoutControllerFactory.create(flowController, content, flc); - } + final FixedTextLayoutController flc = (FixedTextLayoutController) clone(); + flc.setState(AbstractReportElementLayoutController.FINISHED); + return layoutControllerFactory.create(flowController, content, flc); + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java index 8515b4997d53..405fe4a2815b 100755 --- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormatValueUtility.java @@ -27,7 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - package com.sun.star.report.pentaho.layoutprocessor; import java.text.SimpleDateFormat; @@ -54,10 +53,11 @@ import org.pentaho.reporting.libraries.formula.util.HSSFDateUtil; */ public class FormatValueUtility { + private static final String BOOLEAN_VALUE = "boolean-value"; private static final String STRING_VALUE = "string-value"; - public static final String VALUE_TYPE = "value-type"; + private static final String VALUE = "value"; private static SimpleDateFormat dateFormat; private static SimpleDateFormat timeFormat; @@ -74,7 +74,7 @@ public class FormatValueUtility ret = formatTime((Time) value); variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "time-value", ret); } - else if (value instanceof java.sql.Date ) + else if (value instanceof java.sql.Date) { variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE_TYPE, "date"); ret = formatDate((Date) value); @@ -83,67 +83,67 @@ public class FormatValueUtility else if (value instanceof Date) { variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE_TYPE, "float"); - ret = HSSFDateUtil.getExcelDate((Date)value,false,2).toString(); - variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "value", ret); + ret = HSSFDateUtil.getExcelDate((Date) value, false, 2).toString(); + variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE, ret); } else if (value instanceof Number) { variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE_TYPE, "float"); - variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "value", String.valueOf(value)); + variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE, String.valueOf(value)); } else if (value instanceof Boolean) { variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE_TYPE, "boolean"); if (Boolean.TRUE.equals(value)) { - variableSection.setAttribute(OfficeNamespaces.OFFICE_NS,BOOLEAN_VALUE, OfficeToken.TRUE); + variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, BOOLEAN_VALUE, OfficeToken.TRUE); } else { - variableSection.setAttribute(OfficeNamespaces.OFFICE_NS,BOOLEAN_VALUE, OfficeToken.FALSE); + variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, BOOLEAN_VALUE, OfficeToken.FALSE); } } else if (value != null) { variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE_TYPE, "string"); - variableSection.setAttribute(OfficeNamespaces.OFFICE_NS,STRING_VALUE, String.valueOf(value)); + variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, STRING_VALUE, String.valueOf(value)); } else { variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE_TYPE, "string"); - variableSection.setAttribute(OfficeNamespaces.OFFICE_NS,STRING_VALUE, ""); + variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, STRING_VALUE, ""); } return ret; } - public static void applyValueForCell(final Object value, final AttributeMap variableSection,final String valueType) + public static void applyValueForCell(final Object value, final AttributeMap variableSection, final String valueType) { if (value instanceof Time) { variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "time-value", formatTime((Time) value)); } - else if (value instanceof java.sql.Date ) + else if (value instanceof java.sql.Date) { variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "date-value", formatDate((Date) value)); } else if (value instanceof Date) { variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE_TYPE, "float"); - variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "value", HSSFDateUtil.getExcelDate((Date)value,false,2).toString()); + variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE, HSSFDateUtil.getExcelDate((Date) value, false, 2).toString()); } else if (value instanceof Number) { - variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "value", String.valueOf(value)); + variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE, String.valueOf(value)); } else if (value instanceof Boolean) { if (Boolean.TRUE.equals(value)) { - variableSection.setAttribute(OfficeNamespaces.OFFICE_NS,BOOLEAN_VALUE, OfficeToken.TRUE); + variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, BOOLEAN_VALUE, OfficeToken.TRUE); } else { - variableSection.setAttribute(OfficeNamespaces.OFFICE_NS,BOOLEAN_VALUE, OfficeToken.FALSE); + variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, BOOLEAN_VALUE, OfficeToken.FALSE); } } else if (value != null) @@ -151,25 +151,24 @@ public class FormatValueUtility try { final Float number = Float.valueOf(String.valueOf(value)); - applyValueForCell(number,variableSection,valueType); + applyValueForCell(number, variableSection, valueType); return; } - catch(NumberFormatException e) + catch (NumberFormatException e) { - } - if ( !"string".equals(valueType)) + if (!"string".equals(valueType)) { - variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, "value", String.valueOf(value)); + variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, VALUE, String.valueOf(value)); } else { - variableSection.setAttribute(OfficeNamespaces.OFFICE_NS,STRING_VALUE, String.valueOf(value)); + variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, STRING_VALUE, String.valueOf(value)); } } else { - variableSection.setAttribute(OfficeNamespaces.OFFICE_NS,STRING_VALUE, ""); + variableSection.setAttribute(OfficeNamespaces.OFFICE_NS, STRING_VALUE, ""); } } @@ -181,6 +180,7 @@ public class FormatValueUtility } return dateFormat.format(date); } + private static synchronized String formatTime(final Date date) { if (timeFormat == null) diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormattedTextLayoutController.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormattedTextLayoutController.java index c5c69d24716b..e33171840430 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormattedTextLayoutController.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormattedTextLayoutController.java @@ -59,7 +59,9 @@ import org.jfree.layouting.util.AttributeMap; public class FormattedTextLayoutController extends AbstractReportElementLayoutController { + private static final Log LOGGER = LogFactory.getLog(FormattedTextLayoutController.class); + public FormattedTextLayoutController() { } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/ImageElementContext.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/ImageElementContext.java index 4f5ffbdcf35e..7b9624ed6e4a 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/ImageElementContext.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/ImageElementContext.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.layoutprocessor; /** @@ -39,56 +37,57 @@ package com.sun.star.report.pentaho.layoutprocessor; */ public class ImageElementContext { - private final int colSpan; - private final int rowSpan; - private String[] rowStyles; - private String[] colStyles; - public ImageElementContext(final int colSpan, final int rowSpan) - { - this.colSpan = colSpan; - this.rowSpan = rowSpan; - this.colStyles = new String[colSpan]; - this.rowStyles = new String[rowSpan]; - } + private final int colSpan; + private final int rowSpan; + private String[] rowStyles; + private String[] colStyles; + + public ImageElementContext(final int colSpan, final int rowSpan) + { + this.colSpan = colSpan; + this.rowSpan = rowSpan; + this.colStyles = new String[colSpan]; + this.rowStyles = new String[rowSpan]; + } - public int getColSpan() - { - return colSpan; - } + public int getColSpan() + { + return colSpan; + } - public int getRowSpan() - { - return rowSpan; - } + public int getRowSpan() + { + return rowSpan; + } - public String[] getRowStyles() - { - return rowStyles; - } + public String[] getRowStyles() + { + return rowStyles; + } - public String[] getColStyles() - { - return colStyles; - } + public String[] getColStyles() + { + return colStyles; + } - public void setRowStyle (final int pos, final String styleName) - { - rowStyles[pos] = styleName; - } + public void setRowStyle(final int pos, final String styleName) + { + rowStyles[pos] = styleName; + } - public void setColStyle (final int pos, final String styleName) - { - colStyles[pos] = styleName; - } + public void setColStyle(final int pos, final String styleName) + { + colStyles[pos] = styleName; + } - public String getRowStyle (final int pos) - { - return rowStyles[pos]; - } + public String getRowStyle(final int pos) + { + return rowStyles[pos]; + } - public String getColStyle (final int pos) - { - return colStyles[pos]; - } + public String getColStyle(final int pos) + { + return colStyles[pos]; + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/ImageElementLayoutController.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/ImageElementLayoutController.java index 68d1fc6351c4..81e17b73e276 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/ImageElementLayoutController.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/ImageElementLayoutController.java @@ -67,6 +67,7 @@ import org.pentaho.reporting.libraries.base.util.ObjectUtilities; public class ImageElementLayoutController extends AbstractReportElementLayoutController { + private static final Log LOGGER = LogFactory.getLog(ImageElementLayoutController.class); private ImageElementContext context; @@ -184,7 +185,7 @@ public class ImageElementLayoutController return null; } - addRowStyles(context, table,rowPos,rowSpan); + addRowStyles(context, table, rowPos, rowSpan); this.context = context; } return this.context; @@ -198,9 +199,8 @@ public class ImageElementLayoutController final Node[] nodes = tableRow.getNodeArray(); final String namespace = tableCell.getNamespace(); final String type = tableCell.getType(); - for (int i = 0; i < nodes.length; i++) + for (final Node node : nodes) { - final Node node = nodes[i]; if (!(node instanceof Element)) { continue; @@ -211,8 +211,7 @@ public class ImageElementLayoutController (ObjectUtilities.equal(child.getNamespace(), namespace) == false || ObjectUtilities.equal(child.getType(), type) == false)) */ - if (!ObjectUtilities.equal(child.getNamespace(), namespace) || - (!ObjectUtilities.equal(child.getType(), type) && (secondType == null || !ObjectUtilities.equal(child.getType(), secondType)))) + if (!ObjectUtilities.equal(child.getNamespace(), namespace) || (!ObjectUtilities.equal(child.getType(), type) && (secondType == null || !ObjectUtilities.equal(child.getType(), secondType)))) { continue; } @@ -254,11 +253,7 @@ public class ImageElementLayoutController final FlowController controller = getFlowController(); final GlobalMasterRow masterRow = controller.getMasterRow(); final ReportDataRow reportDataRow = masterRow.getReportDataRow(); - if (reportDataRow.getCursor() == 0) - { - return true; - } - return false; + return reportDataRow.getCursor() == 0; } try @@ -277,12 +272,11 @@ public class ImageElementLayoutController { final Node[] columnDefs = columns.getNodeArray(); int columnCounter = 0; - for (int i = 0; i < columnDefs.length; i++) + for (Node columnDef : columnDefs) { - final Element column = (Element) columnDefs[i]; + final Element column = (Element) columnDef; - if (!ObjectUtilities.equal(column.getNamespace(), OfficeNamespaces.TABLE_NS) || - !ObjectUtilities.equal(column.getType(), OfficeToken.TABLE_COLUMN)) + if (!ObjectUtilities.equal(column.getNamespace(), OfficeNamespaces.TABLE_NS) || !ObjectUtilities.equal(column.getType(), OfficeToken.TABLE_COLUMN)) { continue; } @@ -306,12 +300,11 @@ public class ImageElementLayoutController { final Node[] rows = table.getNodeArray(); int rowCounter = 0; - for (int i = 0; i < rows.length; i++) + for (Node row1 : rows) { - final Element row = (Element) rows[i]; + final Element row = (Element) row1; - if (!ObjectUtilities.equal(row.getNamespace(), OfficeNamespaces.TABLE_NS) || - !ObjectUtilities.equal(row.getType(), OfficeToken.TABLE_ROW)) + if (!ObjectUtilities.equal(row.getNamespace(), OfficeNamespaces.TABLE_NS) || !ObjectUtilities.equal(row.getType(), OfficeToken.TABLE_ROW)) { continue; } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/ObjectOleLayoutController.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/ObjectOleLayoutController.java index 54f4fd0b1acb..b0de84bda31e 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/ObjectOleLayoutController.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/ObjectOleLayoutController.java @@ -75,7 +75,7 @@ public class ObjectOleLayoutController extends AbstractReportElementLayoutContro } catch (DataSourceException e) { - // ignore .. assume that the reference has not changed. + // ignore .. assume that the reference has not changed. } } return false; @@ -108,7 +108,7 @@ public class ObjectOleLayoutController extends AbstractReportElementLayoutContro } catch (DataSourceException e) { - // ignore .. assume that the reference has not changed. + // ignore .. assume that the reference has not changed. } } ole.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, SDBCReportDataFactory.MASTER_COLUMNS, masterfields); diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeDetailLayoutController.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeDetailLayoutController.java index 9060ed64981d..9358e62a8590 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeDetailLayoutController.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeDetailLayoutController.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.layoutprocessor; import com.sun.star.report.pentaho.model.VariablesDeclarationSection; @@ -51,114 +49,113 @@ import org.jfree.report.flow.layoutprocessor.SectionLayoutController; */ public class OfficeDetailLayoutController extends SectionLayoutController { - public static final int STATE_PROCESS_VARIABLES = 2; - public static final int STATE_PROCESS_NORMAL_FLOW = 3; - - private boolean waitForJoin; - private int state; - public OfficeDetailLayoutController() - { - } + public static final int STATE_PROCESS_VARIABLES = 2; + public static final int STATE_PROCESS_NORMAL_FLOW = 3; + private boolean waitForJoin; + private int state; - /** - * Initializes the layout controller. This method is called exactly once. It - * is the creators responsibility to call this method. - *

- * Calling initialize after the first advance must result in a - * IllegalStateException. - * - * @param node the currently processed object or layout node. - * @param flowController the current flow controller. - * @param parent the parent layout controller that was responsible for - * instantiating this controller. - * @throws org.jfree.report.DataSourceException - * if there was a problem reading data from the datasource. - * @throws org.jfree.report.ReportProcessingException - * if there was a general problem during the report processing. - * @throws org.jfree.report.ReportDataFactoryException - * if a query failed. - */ - public void initialize(final Object node, - final FlowController flowController, - final LayoutController parent) - throws DataSourceException, ReportDataFactoryException, - ReportProcessingException - { - super.initialize(node, flowController, parent); - state = OfficeDetailLayoutController.STATE_PROCESS_VARIABLES; - } - - /** - * This method is called for each newly instantiated layout controller. The returned layout controller instance should - * have a processing state of either 'OPEN' or 'FINISHING' depending on whether there is any content or any child - * nodes to process. - * - * @param target the report target that receives generated events. - * @return the new layout controller instance representing the new state. - * @throws org.jfree.report.DataSourceException - * if there was a problem reading data from the datasource. - * @throws org.jfree.report.ReportProcessingException - * if there was a general problem during the report processing. - * @throws org.jfree.report.ReportDataFactoryException - * if a query failed. - */ - protected LayoutController startElement(final ReportTarget target) - throws DataSourceException, ReportProcessingException, ReportDataFactoryException - { - final FlowController fc = getFlowController(); - final GlobalMasterRow masterRow = fc.getMasterRow(); - final ReportDataRow reportDataRow = masterRow.getReportDataRow(); - final ReportData reportData = reportDataRow.getReportData(); - if (!reportData.isReadable()) + public OfficeDetailLayoutController() { - reportData.isReadable(); - // If this report has no data, then do not print the detail section. The detail section - // is the only section that behaves this way, and for now this is only done in the OO-implementation - final SectionLayoutController derived = (SectionLayoutController) clone(); - derived.setProcessingState(ElementLayoutController.FINISHED); - derived.setFlowController(fc); - return derived; } - if (state == OfficeDetailLayoutController.STATE_PROCESS_VARIABLES) + /** + * Initializes the layout controller. This method is called exactly once. It + * is the creators responsibility to call this method. + *

+ * Calling initialize after the first advance must result in a + * IllegalStateException. + * + * @param node the currently processed object or layout node. + * @param flowController the current flow controller. + * @param parent the parent layout controller that was responsible for + * instantiating this controller. + * @throws org.jfree.report.DataSourceException + * if there was a problem reading data from the datasource. + * @throws org.jfree.report.ReportProcessingException + * if there was a general problem during the report processing. + * @throws org.jfree.report.ReportDataFactoryException + * if a query failed. + */ + public void initialize(final Object node, + final FlowController flowController, + final LayoutController parent) + throws DataSourceException, ReportDataFactoryException, + ReportProcessingException { - final VariablesDeclarationSection variables = new VariablesDeclarationSection(); - final OfficeDetailLayoutController controller = (OfficeDetailLayoutController) clone(); - controller.state = OfficeDetailLayoutController.STATE_PROCESS_NORMAL_FLOW; - controller.waitForJoin = true; - return processChild(controller, variables, fc); + super.initialize(node, flowController, parent); + state = OfficeDetailLayoutController.STATE_PROCESS_VARIABLES; } - return super.startElement(target); - } + /** + * This method is called for each newly instantiated layout controller. The returned layout controller instance should + * have a processing state of either 'OPEN' or 'FINISHING' depending on whether there is any content or any child + * nodes to process. + * + * @param target the report target that receives generated events. + * @return the new layout controller instance representing the new state. + * @throws org.jfree.report.DataSourceException + * if there was a problem reading data from the datasource. + * @throws org.jfree.report.ReportProcessingException + * if there was a general problem during the report processing. + * @throws org.jfree.report.ReportDataFactoryException + * if a query failed. + */ + protected LayoutController startElement(final ReportTarget target) + throws DataSourceException, ReportProcessingException, ReportDataFactoryException + { + final FlowController fc = getFlowController(); + final GlobalMasterRow masterRow = fc.getMasterRow(); + final ReportDataRow reportDataRow = masterRow.getReportDataRow(); + final ReportData reportData = reportDataRow.getReportData(); + if (!reportData.isReadable()) + { + reportData.isReadable(); + // If this report has no data, then do not print the detail section. The detail section + // is the only section that behaves this way, and for now this is only done in the OO-implementation + final SectionLayoutController derived = (SectionLayoutController) clone(); + derived.setProcessingState(ElementLayoutController.FINISHED); + derived.setFlowController(fc); + return derived; + } - protected void resetSectionForRepeat() - { - super.resetSectionForRepeat(); - state = STATE_PROCESS_VARIABLES; - } + if (state == OfficeDetailLayoutController.STATE_PROCESS_VARIABLES) + { + final VariablesDeclarationSection variables = new VariablesDeclarationSection(); + final OfficeDetailLayoutController controller = (OfficeDetailLayoutController) clone(); + controller.state = OfficeDetailLayoutController.STATE_PROCESS_NORMAL_FLOW; + controller.waitForJoin = true; + return processChild(controller, variables, fc); + } - /** - * Joins with a delegated process flow. This is generally called from a child - * flow and should *not* (I mean it!) be called from outside. If you do, - * you'll suffer. - * - * @param flowController the flow controller of the parent. - * @return the joined layout controller that incorperates all changes from the - * delegate. - */ - public LayoutController join(final FlowController flowController) - { - if (waitForJoin) + return super.startElement(target); + } + + protected void resetSectionForRepeat() { - final OfficeDetailLayoutController derived = (OfficeDetailLayoutController) clone(); - derived.setProcessingState(ElementLayoutController.NOT_STARTED); - derived.setFlowController(flowController); - derived.waitForJoin = false; - return derived; + super.resetSectionForRepeat(); + state = STATE_PROCESS_VARIABLES; } - return super.join(flowController); - } + /** + * Joins with a delegated process flow. This is generally called from a child + * flow and should *not* (I mean it!) be called from outside. If you do, + * you'll suffer. + * + * @param flowController the flow controller of the parent. + * @return the joined layout controller that incorperates all changes from the + * delegate. + */ + public LayoutController join(final FlowController flowController) + { + if (waitForJoin) + { + final OfficeDetailLayoutController derived = (OfficeDetailLayoutController) clone(); + derived.setProcessingState(ElementLayoutController.NOT_STARTED); + derived.setFlowController(flowController); + derived.waitForJoin = false; + return derived; + } + return super.join(flowController); + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeGroupInstanceSectionLayoutController.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeGroupInstanceSectionLayoutController.java index d61f03eb319e..047e46f2e07a 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeGroupInstanceSectionLayoutController.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeGroupInstanceSectionLayoutController.java @@ -26,135 +26,127 @@ import org.jfree.report.JFreeReportInfo; */ public class OfficeGroupInstanceSectionLayoutController extends SectionLayoutController { - public static final int STATE_PROCESS_VARIABLES = 2; - public static final int STATE_PROCESS_NORMAL_FLOW = 3; - private int state; - private boolean waitForJoin; - public OfficeGroupInstanceSectionLayoutController() - { - } + public static final int STATE_PROCESS_VARIABLES = 2; + public static final int STATE_PROCESS_NORMAL_FLOW = 3; + private int state; + private boolean waitForJoin; - public void initialize(final Object node, final FlowController flowController, final LayoutController parent) - throws DataSourceException, ReportDataFactoryException, ReportProcessingException - { - super.initialize(node, flowController, parent); - state = STATE_PROCESS_VARIABLES; - } - - protected LayoutController processContent(final ReportTarget target) - throws DataSourceException, ReportProcessingException, ReportDataFactoryException - { - if (state == OfficeGroupInstanceSectionLayoutController.STATE_PROCESS_VARIABLES) + public OfficeGroupInstanceSectionLayoutController() { - // todo: Fill the variables section with something sensible .. - final VariablesDeclarationSection variables = new VariablesDeclarationSection(); - final OfficeGroupInstanceSectionLayoutController controller = - (OfficeGroupInstanceSectionLayoutController) clone(); - controller.state = - OfficeGroupLayoutController.STATE_PROCESS_NORMAL_FLOW; - controller.waitForJoin = true; - return processChild(controller, variables, getFlowController()); } - return super.processContent(target); - } - // isDisplayable is private in version 0.9.1, so until the upgrade we keep this copy of the method - // todo: Delete it unce the sun-cvs contains version 0.9.2. - protected LayoutController processChild(final SectionLayoutController derived, - final Node node, - final FlowController flowController) - throws DataSourceException, ReportProcessingException, - ReportDataFactoryException - { - final ReportContext reportContext = flowController.getReportContext(); - final LayoutControllerFactory layoutControllerFactory = reportContext.getLayoutControllerFactory(); - if (isDisplayable(node)) + public void initialize(final Object node, final FlowController flowController, final LayoutController parent) + throws DataSourceException, ReportDataFactoryException, ReportProcessingException { - derived.setProcessingState(ElementLayoutController.WAITING_FOR_JOIN); - return layoutControllerFactory.create(flowController, node, derived); + super.initialize(node, flowController, parent); + state = STATE_PROCESS_VARIABLES; } - else + + protected LayoutController processContent(final ReportTarget target) + throws DataSourceException, ReportProcessingException, ReportDataFactoryException { - derived.setProcessingState(ElementLayoutController.WAITING_FOR_JOIN); - final LayoutController childLc = layoutControllerFactory.create(flowController, node, derived); - return LayoutControllerUtil.skipInvisibleElement(childLc); + if (state == OfficeGroupInstanceSectionLayoutController.STATE_PROCESS_VARIABLES) + { + // todo: Fill the variables section with something sensible .. + final VariablesDeclarationSection variables = new VariablesDeclarationSection(); + final OfficeGroupInstanceSectionLayoutController controller = + (OfficeGroupInstanceSectionLayoutController) clone(); + controller.state = + OfficeGroupLayoutController.STATE_PROCESS_NORMAL_FLOW; + controller.waitForJoin = true; + return processChild(controller, variables, getFlowController()); + } + return super.processContent(target); } - } - protected boolean isDisplayable(final Node node) throws DataSourceException - { - if (! (node instanceof OfficeGroupSection) ) + // isDisplayable is private in version 0.9.1, so until the upgrade we keep this copy of the method + // todo: Delete it unce the sun-cvs contains version 0.9.2. + protected LayoutController processChild(final SectionLayoutController derived, + final Node node, + final FlowController flowController) + throws DataSourceException, ReportProcessingException, + ReportDataFactoryException { - return _isDisplayable(node); + final ReportContext reportContext = flowController.getReportContext(); + final LayoutControllerFactory layoutControllerFactory = reportContext.getLayoutControllerFactory(); + if (isDisplayable(node)) + { + derived.setProcessingState(ElementLayoutController.WAITING_FOR_JOIN); + return layoutControllerFactory.create(flowController, node, derived); + } + else + { + derived.setProcessingState(ElementLayoutController.WAITING_FOR_JOIN); + final LayoutController childLc = layoutControllerFactory.create(flowController, node, derived); + return LayoutControllerUtil.skipInvisibleElement(childLc); + } } - final OfficeGroupSection section = (OfficeGroupSection) node; - if (section.isRepeatSection()) + protected boolean isDisplayable(final Node node) throws DataSourceException { - return false; + if (!(node instanceof OfficeGroupSection)) + { + return _isDisplayable(node); + } + + final OfficeGroupSection section = (OfficeGroupSection) node; + return !section.isRepeatSection() && _isDisplayable(node); } - return _isDisplayable(node); - } - protected boolean _isDisplayable(final Node node) - throws DataSourceException - { - // temp method until the pending upgrade to 0.9.2. Later we just call super.isDisplayable(..) instead. - if (!node.isEnabled()) + protected boolean _isDisplayable(final Node node) + throws DataSourceException { - return false; + // temp method until the pending upgrade to 0.9.2. Later we just call super.isDisplayable(..) instead. + if (!node.isEnabled()) + { + return false; + } + + final Expression expression = node.getDisplayCondition(); + if (expression == null) + { + return true; + } + + final Object result = LayoutControllerUtil.evaluateExpression(getFlowController(), node, expression); + return Boolean.TRUE.equals(result); } - final Expression expression = node.getDisplayCondition(); - if (expression == null) + protected void resetSectionForRepeat() { - return true; + super.resetSectionForRepeat(); + state = STATE_PROCESS_VARIABLES; } - final Object result = LayoutControllerUtil.evaluateExpression(getFlowController(), node, expression); - if (Boolean.TRUE.equals(result)) + /** + * Joins with a delegated process flow. This is generally called from a child + * flow and should *not* (I mean it!) be called from outside. If you do, + * you'll suffer. + * + * @param flowController the flow controller of the parent. + * @return the joined layout controller that incorperates all changes from the + * delegate. + */ + public LayoutController join(final FlowController flowController) { - return true; + if (waitForJoin) + { + final OfficeGroupInstanceSectionLayoutController derived = (OfficeGroupInstanceSectionLayoutController) clone(); + derived.setProcessingState(ElementLayoutController.OPENED); + derived.setFlowController(flowController); + derived.waitForJoin = false; + return derived; + } + return super.join(flowController); } - return false; - } - - protected void resetSectionForRepeat() - { - super.resetSectionForRepeat(); - state = STATE_PROCESS_VARIABLES; - } - /** - * Joins with a delegated process flow. This is generally called from a child - * flow and should *not* (I mean it!) be called from outside. If you do, - * you'll suffer. - * - * @param flowController the flow controller of the parent. - * @return the joined layout controller that incorperates all changes from the - * delegate. - */ - public LayoutController join(final FlowController flowController) - { - if (waitForJoin) + protected AttributeMap computeAttributes(final FlowController fc, final Element element, final ReportTarget target) + throws DataSourceException { - final OfficeGroupInstanceSectionLayoutController derived = (OfficeGroupInstanceSectionLayoutController) clone(); - derived.setProcessingState(ElementLayoutController.OPENED); - derived.setFlowController(flowController); - derived.waitForJoin = false; - return derived; + final AttributeMap map = new AttributeMap(super.computeAttributes(fc, element, target)); + map.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, "iteration-count", getIterationCount()); + map.makeReadOnly(); + return map; } - return super.join(flowController); - } - - protected AttributeMap computeAttributes(final FlowController fc, final Element element, final ReportTarget target) - throws DataSourceException - { - final AttributeMap map = new AttributeMap( super.computeAttributes(fc, element, target) ); - map.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, "iteration-count", Integer.valueOf(getIterationCount())); - map.makeReadOnly(); - return map; - } - } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeGroupLayoutController.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeGroupLayoutController.java index 25e12d17edab..12604e931238 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeGroupLayoutController.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeGroupLayoutController.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.layoutprocessor; import com.sun.star.report.pentaho.model.OfficeGroup; @@ -52,158 +50,157 @@ import org.jfree.report.structure.Element; * @since 15.03.2007 */ public class OfficeGroupLayoutController extends SectionLayoutController - implements OfficeRepeatingStructureLayoutController + implements OfficeRepeatingStructureLayoutController { - public static final int STATE_PROCESS_REPEATING_HEADER = 0; - public static final int STATE_PROCESS_REPEATING_FOOTER = 1; - public static final int STATE_PROCESS_NORMAL_FLOW = 3; - private boolean waitForJoin; - private int state; - private VariablesCollection variablesCollection; - private boolean repeatHeader; - private boolean repeatFooter; - - public OfficeGroupLayoutController() - { - } - - - /** - * Initializes the layout controller. This method is called exactly once. It - * is the creators responsibility to call this method. - *

- * Calling initialize after the first advance must result in a - * IllegalStateException. - * - * @param node the currently processed object or layout node. - * @param flowController the current flow controller. - * @param parent the parent layout controller that was responsible for - * instantiating this controller. - * @throws org.jfree.report.DataSourceException - * if there was a problem reading data from the datasource. - * @throws org.jfree.report.ReportProcessingException - * if there was a general problem during the report processing. - * @throws org.jfree.report.ReportDataFactoryException - * if a query failed. - */ - public void initialize(final Object node, - final FlowController flowController, - final LayoutController parent) - throws DataSourceException, ReportDataFactoryException, - ReportProcessingException - { - super.initialize(node, flowController, parent); - state = OfficeGroupLayoutController.STATE_PROCESS_REPEATING_HEADER; - variablesCollection = new VariablesCollection(computeVariablesPrefix()); - - - final OfficeGroup group = (OfficeGroup) getElement(); - final OfficeGroupSection header = group.getHeader(); - repeatHeader = (header != null && header.isRepeatSection()); - - final OfficeGroupSection footer = group.getFooter(); - repeatFooter = (footer != null && footer.isRepeatSection()); - } - - - protected LayoutController processContent(final ReportTarget target) - throws DataSourceException, ReportProcessingException, - ReportDataFactoryException - { - if (state == OfficeGroupLayoutController.STATE_PROCESS_REPEATING_HEADER) + + public static final int STATE_PROCESS_REPEATING_HEADER = 0; + public static final int STATE_PROCESS_REPEATING_FOOTER = 1; + public static final int STATE_PROCESS_NORMAL_FLOW = 3; + private boolean waitForJoin; + private int state; + private VariablesCollection variablesCollection; + private boolean repeatHeader; + private boolean repeatFooter; + + public OfficeGroupLayoutController() + { + } + + /** + * Initializes the layout controller. This method is called exactly once. It + * is the creators responsibility to call this method. + *

+ * Calling initialize after the first advance must result in a + * IllegalStateException. + * + * @param node the currently processed object or layout node. + * @param flowController the current flow controller. + * @param parent the parent layout controller that was responsible for + * instantiating this controller. + * @throws org.jfree.report.DataSourceException + * if there was a problem reading data from the datasource. + * @throws org.jfree.report.ReportProcessingException + * if there was a general problem during the report processing. + * @throws org.jfree.report.ReportDataFactoryException + * if a query failed. + */ + public void initialize(final Object node, + final FlowController flowController, + final LayoutController parent) + throws DataSourceException, ReportDataFactoryException, + ReportProcessingException { + super.initialize(node, flowController, parent); + state = OfficeGroupLayoutController.STATE_PROCESS_REPEATING_HEADER; + variablesCollection = new VariablesCollection(computeVariablesPrefix()); - final OfficeGroupLayoutController controller = - (OfficeGroupLayoutController) clone(); - controller.state = - OfficeGroupLayoutController.STATE_PROCESS_REPEATING_FOOTER; - if (!repeatHeader) - { - return controller; - } + final OfficeGroup group = (OfficeGroup) getElement(); + final OfficeGroupSection header = group.getHeader(); + repeatHeader = (header != null && header.isRepeatSection()); - final OfficeGroup group = (OfficeGroup) getElement(); - final OfficeGroupSection header = group.getHeader(); - controller.waitForJoin = true; - return processChild(controller, header, getFlowController()); + final OfficeGroupSection footer = group.getFooter(); + repeatFooter = (footer != null && footer.isRepeatSection()); } - if (state == OfficeGroupLayoutController.STATE_PROCESS_REPEATING_FOOTER) + protected LayoutController processContent(final ReportTarget target) + throws DataSourceException, ReportProcessingException, + ReportDataFactoryException { + if (state == OfficeGroupLayoutController.STATE_PROCESS_REPEATING_HEADER) + { + + final OfficeGroupLayoutController controller = + (OfficeGroupLayoutController) clone(); + controller.state = + OfficeGroupLayoutController.STATE_PROCESS_REPEATING_FOOTER; + + if (!repeatHeader) + { + return controller; + } + + final OfficeGroup group = (OfficeGroup) getElement(); + final OfficeGroupSection header = group.getHeader(); + controller.waitForJoin = true; + return processChild(controller, header, getFlowController()); + } + + if (state == OfficeGroupLayoutController.STATE_PROCESS_REPEATING_FOOTER) + { + + final OfficeGroupLayoutController controller = + (OfficeGroupLayoutController) clone(); + controller.state = OfficeGroupLayoutController.STATE_PROCESS_NORMAL_FLOW; + + if (!repeatFooter) + { + return controller; + } + + final OfficeGroup group = (OfficeGroup) getElement(); + final OfficeGroupSection footer = group.getFooter(); + controller.waitForJoin = true; + return processChild(controller, footer, getFlowController()); + } + + return super.processContent(target); + } - final OfficeGroupLayoutController controller = - (OfficeGroupLayoutController) clone(); - controller.state = OfficeGroupLayoutController.STATE_PROCESS_NORMAL_FLOW; + /** + * Joins with a delegated process flow. This is generally called from a child + * flow and should *not* (I mean it!) be called from outside. If you do, + * you'll suffer. + * + * @param flowController the flow controller of the parent. + * @return the joined layout controller that incorperates all changes from the + * delegate. + */ + public LayoutController join(final FlowController flowController) + { + if (waitForJoin) + { + final OfficeGroupLayoutController derived = (OfficeGroupLayoutController) clone(); + derived.setProcessingState(ElementLayoutController.OPENED); + derived.setFlowController(flowController); + derived.waitForJoin = false; + return derived; + } + return super.join(flowController); + } - if (!repeatFooter) - { - return controller; - } + public boolean isNormalFlowProcessing() + { + return state == OfficeGroupLayoutController.STATE_PROCESS_NORMAL_FLOW; + } - final OfficeGroup group = (OfficeGroup) getElement(); - final OfficeGroupSection footer = group.getFooter(); - controller.waitForJoin = true; - return processChild(controller, footer, getFlowController()); + private String computeVariablesPrefix() + { + int count = 0; + LayoutController lc = this; + while (lc != null) + { + if (lc instanceof OfficeGroupLayoutController) + { + count++; + } + lc = lc.getParent(); + } + return "auto_group_" + count + "_"; } - return super.processContent(target); - } - - /** - * Joins with a delegated process flow. This is generally called from a child - * flow and should *not* (I mean it!) be called from outside. If you do, - * you'll suffer. - * - * @param flowController the flow controller of the parent. - * @return the joined layout controller that incorperates all changes from the - * delegate. - */ - public LayoutController join(final FlowController flowController) - { - if (waitForJoin) + public VariablesCollection getVariablesCollection() { - final OfficeGroupLayoutController derived = (OfficeGroupLayoutController) clone(); - derived.setProcessingState(ElementLayoutController.OPENED); - derived.setFlowController(flowController); - derived.waitForJoin = false; - return derived; + return variablesCollection; } - return super.join(flowController); - } - - public boolean isNormalFlowProcessing () - { - return state == OfficeGroupLayoutController.STATE_PROCESS_NORMAL_FLOW; - } - - private String computeVariablesPrefix() - { - int count = 0; - LayoutController lc = this; - while (lc != null) + + protected AttributeMap computeAttributes(final FlowController fc, final Element element, final ReportTarget target) + throws DataSourceException { - if (lc instanceof OfficeGroupLayoutController) - { - count++; - } - lc = lc.getParent(); + final AttributeMap map = new AttributeMap(super.computeAttributes(fc, element, target)); + final String value = String.valueOf(repeatHeader || repeatFooter); + map.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, "repeating-header-or-footer", value); + map.makeReadOnly(); + return map; } - return "auto_group_" + count + "_"; - } - - public VariablesCollection getVariablesCollection() - { - return variablesCollection; - } - - protected AttributeMap computeAttributes(final FlowController fc, final Element element, final ReportTarget target) - throws DataSourceException - { - final AttributeMap map = new AttributeMap( super.computeAttributes(fc, element, target) ); - final String value = String.valueOf(repeatHeader || repeatFooter); - map.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, "repeating-header-or-footer", value); - map.makeReadOnly(); - return map; - } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeGroupSectionLayoutController.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeGroupSectionLayoutController.java index 496ccd841e46..4eb40749e3fe 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeGroupSectionLayoutController.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeGroupSectionLayoutController.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.layoutprocessor; import org.jfree.report.flow.layoutprocessor.SectionLayoutController; @@ -58,58 +56,56 @@ import org.jfree.report.JFreeReportInfo; public class OfficeGroupSectionLayoutController extends SectionLayoutController { - public OfficeGroupSectionLayoutController() - { - } - - protected LayoutController startElement(final ReportTarget target) - throws DataSourceException, ReportProcessingException, ReportDataFactoryException - { - final OfficeGroupSection section = (OfficeGroupSection) getElement(); - if (!section.isRepeatSection()) + public OfficeGroupSectionLayoutController() { - return super.startElement(target); } - final LayoutController controller = getParent(); - if (!(controller instanceof OfficeGroupLayoutController)) + protected LayoutController startElement(final ReportTarget target) + throws DataSourceException, ReportProcessingException, ReportDataFactoryException { - return super.startElement(target); - } - final OfficeGroupLayoutController oglc = (OfficeGroupLayoutController) controller; - if (!oglc.isNormalFlowProcessing()) - { - return super.startElement(target); - } + final OfficeGroupSection section = (OfficeGroupSection) getElement(); + if (!section.isRepeatSection()) + { + return super.startElement(target); + } - // Skip the processing if the section is a repeating header or footer and we are processing the normal flow .. - final ElementLayoutController clone = (ElementLayoutController) this.clone(); - clone.setProcessingState(ElementLayoutController.FINISHED); - return clone; - } + final LayoutController controller = getParent(); + if (!(controller instanceof OfficeGroupLayoutController)) + { + return super.startElement(target); + } + final OfficeGroupLayoutController oglc = (OfficeGroupLayoutController) controller; + if (!oglc.isNormalFlowProcessing()) + { + return super.startElement(target); + } - protected AttributeMap computeAttributes(final FlowController fc, - final Element element, - final ReportTarget target) - throws DataSourceException - { - final AttributeMap attrs = super.computeAttributes(fc, element, target); - final LayoutController controller = getParent(); - if (!(controller instanceof OfficeGroupLayoutController)) - { - return attrs; - } - final OfficeGroupLayoutController oglc = (OfficeGroupLayoutController) controller; - if (oglc.isNormalFlowProcessing()) - { - return attrs; + // Skip the processing if the section is a repeating header or footer and we are processing the normal flow .. + final ElementLayoutController clone = (ElementLayoutController) this.clone(); + clone.setProcessingState(ElementLayoutController.FINISHED); + return clone; } - final AttributeMap retval = new AttributeMap(attrs); - retval.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, "repeated-section", OfficeToken.TRUE); - retval.makeReadOnly(); - return retval; - } - + protected AttributeMap computeAttributes(final FlowController fc, + final Element element, + final ReportTarget target) + throws DataSourceException + { + final AttributeMap attrs = super.computeAttributes(fc, element, target); + final LayoutController controller = getParent(); + if (!(controller instanceof OfficeGroupLayoutController)) + { + return attrs; + } + final OfficeGroupLayoutController oglc = (OfficeGroupLayoutController) controller; + if (oglc.isNormalFlowProcessing()) + { + return attrs; + } + final AttributeMap retval = new AttributeMap(attrs); + retval.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, "repeated-section", OfficeToken.TRUE); + retval.makeReadOnly(); + return retval; + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficePageSectionLayoutController.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficePageSectionLayoutController.java index 9189cb06f9a5..b98db5f34479 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficePageSectionLayoutController.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficePageSectionLayoutController.java @@ -15,15 +15,16 @@ import org.jfree.report.JFreeReportInfo; */ public class OfficePageSectionLayoutController extends SectionLayoutController { - public OfficePageSectionLayoutController() - { - } - protected AttributeMap computeAttributes(final FlowController flowController, final Element element, final ReportTarget reportTarget) throws DataSourceException - { - final AttributeMap map = new AttributeMap( super.computeAttributes(flowController, element, reportTarget)); - map.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, "role", "spreadsheet-section"); - map.makeReadOnly(); - return map; - } + public OfficePageSectionLayoutController() + { + } + + protected AttributeMap computeAttributes(final FlowController flowController, final Element element, final ReportTarget reportTarget) throws DataSourceException + { + final AttributeMap map = new AttributeMap(super.computeAttributes(flowController, element, reportTarget)); + map.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, "role", "spreadsheet-section"); + map.makeReadOnly(); + return map; + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeRepeatingStructureLayoutController.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeRepeatingStructureLayoutController.java index 47a1daa1b7fa..1ccf6b634bcf 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeRepeatingStructureLayoutController.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeRepeatingStructureLayoutController.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.layoutprocessor; import org.jfree.report.flow.layoutprocessor.LayoutController; @@ -41,8 +39,8 @@ import org.jfree.report.flow.layoutprocessor.LayoutController; */ public interface OfficeRepeatingStructureLayoutController extends LayoutController { - public boolean isNormalFlowProcessing(); - public VariablesCollection getVariablesCollection(); + public boolean isNormalFlowProcessing(); + public VariablesCollection getVariablesCollection(); } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeReportLayoutController.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeReportLayoutController.java index 20816814e11c..5baffc4c346b 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeReportLayoutController.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeReportLayoutController.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.layoutprocessor; import com.sun.star.report.pentaho.model.OfficeReport; @@ -51,227 +49,224 @@ import org.jfree.report.structure.Node; * @since 06.03.2007 */ public class OfficeReportLayoutController extends ElementLayoutController - implements OfficeRepeatingStructureLayoutController + implements OfficeRepeatingStructureLayoutController { - private static final int STATE_NOT_STARTED = 0; - private static final int STATE_TEMPLATES = 1; - private static final int STATE_PAGE_HEADER_DONE = 2; - private static final int STATE_PAGE_FOOTER_DONE = 3; - private static final int STATE_SPREADSHEET_PAGE_HEADER_DONE = 4; - private static final int STATE_SPREADSHEET_PAGE_FOOTER_DONE = 5; - private static final int STATE_COLUMN_HEADER_DONE = 6; - private static final int STATE_COLUMN_FOOTER_DONE = 7; - private static final int STATE_INITIAL_VARIABLES_DONE = 8; - private static final int STATE_REPORT_HEADER_DONE = 9; - private static final int STATE_REPORT_BODY_DONE = 10; - private static final int STATE_REPORT_FOOTER_VARIABLES = 11; - private static final int STATE_REPORT_FOOTER_DONE = 12; - private int state; - private VariablesCollection variablesCollection; + private static final int STATE_NOT_STARTED = 0; + private static final int STATE_TEMPLATES = 1; + private static final int STATE_PAGE_HEADER_DONE = 2; + private static final int STATE_PAGE_FOOTER_DONE = 3; + private static final int STATE_SPREADSHEET_PAGE_HEADER_DONE = 4; + private static final int STATE_SPREADSHEET_PAGE_FOOTER_DONE = 5; + private static final int STATE_COLUMN_HEADER_DONE = 6; + private static final int STATE_COLUMN_FOOTER_DONE = 7; + private static final int STATE_INITIAL_VARIABLES_DONE = 8; + private static final int STATE_REPORT_HEADER_DONE = 9; + private static final int STATE_REPORT_BODY_DONE = 10; + private static final int STATE_REPORT_FOOTER_VARIABLES = 11; + private static final int STATE_REPORT_FOOTER_DONE = 12; + private int state; + private VariablesCollection variablesCollection; - public OfficeReportLayoutController() - { - } + public OfficeReportLayoutController() + { + } + /** + * Initializes the layout controller. This method is called exactly once. It + * is the creators responsibility to call this method. + *

+ * Calling initialize after the first advance must result in a + * IllegalStateException. + * + * @param node the currently processed object or layout node. + * @param flowController the current flow controller. + * @param parent the parent layout controller that was responsible for + * instantiating this controller. + * @throws org.jfree.report.DataSourceException + * if there was a problem reading data from the datasource. + * @throws org.jfree.report.ReportProcessingException + * if there was a general problem during the report processing. + * @throws org.jfree.report.ReportDataFactoryException + * if a query failed. + */ + public void initialize(final Object node, final FlowController flowController, + final LayoutController parent) + throws DataSourceException, ReportDataFactoryException, + ReportProcessingException + { + super.initialize(node, flowController, parent); + variablesCollection = new VariablesCollection("auto_report_"); + } - /** - * Initializes the layout controller. This method is called exactly once. It - * is the creators responsibility to call this method. - *

- * Calling initialize after the first advance must result in a - * IllegalStateException. - * - * @param node the currently processed object or layout node. - * @param flowController the current flow controller. - * @param parent the parent layout controller that was responsible for - * instantiating this controller. - * @throws org.jfree.report.DataSourceException - * if there was a problem reading data from the datasource. - * @throws org.jfree.report.ReportProcessingException - * if there was a general problem during the report processing. - * @throws org.jfree.report.ReportDataFactoryException - * if a query failed. - */ - public void initialize(final Object node, final FlowController flowController, - final LayoutController parent) - throws DataSourceException, ReportDataFactoryException, - ReportProcessingException - { - super.initialize(node, flowController, parent); - variablesCollection = new VariablesCollection("auto_report_"); - } + /** + * Processes any content in this element. This method is called when the + * processing state is 'OPENED'. The returned layout controller will retain + * the 'OPENED' state as long as there is more content available. Once all + * content has been processed, the returned layout controller should carry a + * 'FINISHED' state. + * + * @param target the report target that receives generated events. + * @return the new layout controller instance representing the new state. + * + * @throws org.jfree.report.DataSourceException + * if there was a problem reading data from the datasource. + * @throws org.jfree.report.ReportProcessingException + * if there was a general problem during the report processing. + * @throws org.jfree.report.ReportDataFactoryException + * if a query failed. + */ + protected LayoutController processContent(final ReportTarget target) + throws DataSourceException, ReportProcessingException, + ReportDataFactoryException + { + final OfficeReport or = (OfficeReport) getElement(); - /** - * Processes any content in this element. This method is called when the - * processing state is 'OPENED'. The returned layout controller will retain - * the 'OPENED' state as long as there is more content available. Once all - * content has been processed, the returned layout controller should carry a - * 'FINISHED' state. - * - * @param target the report target that receives generated events. - * @return the new layout controller instance representing the new state. - * - * @throws org.jfree.report.DataSourceException - * if there was a problem reading data from the datasource. - * @throws org.jfree.report.ReportProcessingException - * if there was a general problem during the report processing. - * @throws org.jfree.report.ReportDataFactoryException - * if a query failed. - */ - protected LayoutController processContent(final ReportTarget target) - throws DataSourceException, ReportProcessingException, - ReportDataFactoryException - { - final OfficeReport or = (OfficeReport) getElement(); + switch (state) + { + case OfficeReportLayoutController.STATE_NOT_STARTED: + { + return delegateToTemplates(OfficeReportLayoutController.STATE_TEMPLATES); + } + case OfficeReportLayoutController.STATE_TEMPLATES: + { + return delegateSection(or.getPageHeader(), + OfficeReportLayoutController.STATE_PAGE_HEADER_DONE); + } + case OfficeReportLayoutController.STATE_PAGE_HEADER_DONE: + { + return delegateSpreadsheetSection(or.getPageHeader(), + OfficeReportLayoutController.STATE_SPREADSHEET_PAGE_HEADER_DONE); + } + case OfficeReportLayoutController.STATE_SPREADSHEET_PAGE_HEADER_DONE: + { + return delegateSection(or.getPageFooter(), + OfficeReportLayoutController.STATE_PAGE_FOOTER_DONE); + } + case OfficeReportLayoutController.STATE_PAGE_FOOTER_DONE: + { + return delegateSection(or.getColumnHeader(), + OfficeReportLayoutController.STATE_COLUMN_HEADER_DONE); + } + case OfficeReportLayoutController.STATE_COLUMN_HEADER_DONE: + { + return delegateSection(or.getColumnFooter(), + OfficeReportLayoutController.STATE_COLUMN_FOOTER_DONE); + } + case OfficeReportLayoutController.STATE_COLUMN_FOOTER_DONE: + { + return delegateSection(new VariablesDeclarationSection(), + OfficeReportLayoutController.STATE_INITIAL_VARIABLES_DONE); + } + case OfficeReportLayoutController.STATE_INITIAL_VARIABLES_DONE: + { + return delegateSection(or.getReportHeader(), + OfficeReportLayoutController.STATE_REPORT_HEADER_DONE); + } + case OfficeReportLayoutController.STATE_REPORT_HEADER_DONE: + { + return delegateSection(or.getBodySection(), + OfficeReportLayoutController.STATE_REPORT_BODY_DONE); + } + case OfficeReportLayoutController.STATE_REPORT_BODY_DONE: + { + return delegateSection(new VariablesDeclarationSection(), + OfficeReportLayoutController.STATE_REPORT_FOOTER_VARIABLES); + } + case OfficeReportLayoutController.STATE_REPORT_FOOTER_VARIABLES: + { + return delegateSection(or.getReportFooter(), + OfficeReportLayoutController.STATE_REPORT_FOOTER_DONE); + } + case OfficeReportLayoutController.STATE_REPORT_FOOTER_DONE: + { + return delegateSpreadsheetSection(or.getPageFooter(), + OfficeReportLayoutController.STATE_SPREADSHEET_PAGE_FOOTER_DONE); + } + case OfficeReportLayoutController.STATE_SPREADSHEET_PAGE_FOOTER_DONE: + { + final OfficeReportLayoutController olc = (OfficeReportLayoutController) clone(); + olc.setProcessingState(ElementLayoutController.FINISHING); + return olc; + } + default: + { + throw new IllegalStateException("Invalid processing state encountered."); + } + } + } - switch (state) + private LayoutController delegateSpreadsheetSection(final Node node, final int nextState) + throws DataSourceException, ReportProcessingException, ReportDataFactoryException { - case OfficeReportLayoutController.STATE_NOT_STARTED: - { - return delegateToTemplates(OfficeReportLayoutController.STATE_TEMPLATES); - } - case OfficeReportLayoutController.STATE_TEMPLATES: - { - return delegateSection(or.getPageHeader(), - OfficeReportLayoutController.STATE_PAGE_HEADER_DONE); - } - case OfficeReportLayoutController.STATE_PAGE_HEADER_DONE: - { - return delegateSpreadsheetSection(or.getPageHeader(), - OfficeReportLayoutController.STATE_SPREADSHEET_PAGE_HEADER_DONE); - } - case OfficeReportLayoutController.STATE_SPREADSHEET_PAGE_HEADER_DONE: - { - return delegateSection(or.getPageFooter(), - OfficeReportLayoutController.STATE_PAGE_FOOTER_DONE); - } - case OfficeReportLayoutController.STATE_PAGE_FOOTER_DONE: - { - return delegateSection(or.getColumnHeader(), - OfficeReportLayoutController.STATE_COLUMN_HEADER_DONE); - } - case OfficeReportLayoutController.STATE_COLUMN_HEADER_DONE: - { - return delegateSection(or.getColumnFooter(), - OfficeReportLayoutController.STATE_COLUMN_FOOTER_DONE); - } - case OfficeReportLayoutController.STATE_COLUMN_FOOTER_DONE: - { - return delegateSection(new VariablesDeclarationSection(), - OfficeReportLayoutController.STATE_INITIAL_VARIABLES_DONE); - } - case OfficeReportLayoutController.STATE_INITIAL_VARIABLES_DONE: - { - return delegateSection(or.getReportHeader(), - OfficeReportLayoutController.STATE_REPORT_HEADER_DONE); - } - case OfficeReportLayoutController.STATE_REPORT_HEADER_DONE: - { - return delegateSection(or.getBodySection(), - OfficeReportLayoutController.STATE_REPORT_BODY_DONE); - } - case OfficeReportLayoutController.STATE_REPORT_BODY_DONE: - { - return delegateSection(new VariablesDeclarationSection(), - OfficeReportLayoutController.STATE_REPORT_FOOTER_VARIABLES); - } - case OfficeReportLayoutController.STATE_REPORT_FOOTER_VARIABLES: - { - return delegateSection(or.getReportFooter(), - OfficeReportLayoutController.STATE_REPORT_FOOTER_DONE); - } - case OfficeReportLayoutController.STATE_REPORT_FOOTER_DONE: - { - return delegateSpreadsheetSection(or.getPageFooter(), - OfficeReportLayoutController.STATE_SPREADSHEET_PAGE_FOOTER_DONE); - } - case OfficeReportLayoutController.STATE_SPREADSHEET_PAGE_FOOTER_DONE: - { final OfficeReportLayoutController olc = (OfficeReportLayoutController) clone(); - olc.setProcessingState(ElementLayoutController.FINISHING); - return olc; - } - default: - { - throw new IllegalStateException("Invalid processing state encountered."); - } - } - } + olc.state = nextState; - private LayoutController delegateSpreadsheetSection(final Node node, final int nextState) - throws DataSourceException, ReportProcessingException, ReportDataFactoryException - { - final OfficeReportLayoutController olc = (OfficeReportLayoutController) clone(); - olc.state = nextState; + if (node == null) + { + return olc; + } - if (node == null) - { - return olc; + final OfficePageSectionLayoutController templateLc = new OfficePageSectionLayoutController(); + templateLc.initialize(node, getFlowController(), olc); + return templateLc; } - final OfficePageSectionLayoutController templateLc = new OfficePageSectionLayoutController(); - templateLc.initialize(node, getFlowController(), olc); - return templateLc; - } - - private LayoutController delegateToTemplates(final int nextState) - throws ReportProcessingException, ReportDataFactoryException, - DataSourceException - { - final OfficeReportLayoutController olc = (OfficeReportLayoutController) clone(); - olc.state = nextState; - - final OfficeTableTemplateLayoutController templateLc = new OfficeTableTemplateLayoutController(); - templateLc.initialize(getElement(), getFlowController(), olc); - return templateLc; + private LayoutController delegateToTemplates(final int nextState) + throws ReportProcessingException, ReportDataFactoryException, + DataSourceException + { + final OfficeReportLayoutController olc = (OfficeReportLayoutController) clone(); + olc.state = nextState; - } + final OfficeTableTemplateLayoutController templateLc = new OfficeTableTemplateLayoutController(); + templateLc.initialize(getElement(), getFlowController(), olc); + return templateLc; - private LayoutController delegateSection(final Node n, final int nextState) - throws ReportProcessingException, ReportDataFactoryException, - DataSourceException - { - final OfficeReportLayoutController olc = (OfficeReportLayoutController) clone(); - olc.state = nextState; - if (n == null) - { - return olc; } - final FlowController flowController = getFlowController(); - final ReportContext reportContext = flowController.getReportContext(); - final LayoutControllerFactory layoutControllerFactory = - reportContext.getLayoutControllerFactory(); - return layoutControllerFactory.create(flowController, n, olc); + private LayoutController delegateSection(final Node n, final int nextState) + throws ReportProcessingException, ReportDataFactoryException, + DataSourceException + { + final OfficeReportLayoutController olc = (OfficeReportLayoutController) clone(); + olc.state = nextState; + if (n == null) + { + return olc; + } - } + final FlowController flowController = getFlowController(); + final ReportContext reportContext = flowController.getReportContext(); + final LayoutControllerFactory layoutControllerFactory = + reportContext.getLayoutControllerFactory(); + return layoutControllerFactory.create(flowController, n, olc); + } - /** - * Joins with a delegated process flow. This is generally called from a child - * flow and should *not* (I mean it!) be called from outside. If you do, - * you'll suffer. - * - * @param flowController the flow controller of the parent. - * @return the joined layout controller that incorperates all changes from the - * delegate. - */ - public LayoutController join(final FlowController flowController) - { - final OfficeReportLayoutController derived = (OfficeReportLayoutController) clone(); - derived.setFlowController(flowController); - return derived; - } + /** + * Joins with a delegated process flow. This is generally called from a child + * flow and should *not* (I mean it!) be called from outside. If you do, + * you'll suffer. + * + * @param flowController the flow controller of the parent. + * @return the joined layout controller that incorperates all changes from the + * delegate. + */ + public LayoutController join(final FlowController flowController) + { + final OfficeReportLayoutController derived = (OfficeReportLayoutController) clone(); + derived.setFlowController(flowController); + return derived; + } - public boolean isNormalFlowProcessing() - { - return state != OfficeReportLayoutController.STATE_PAGE_HEADER_DONE && - state != OfficeReportLayoutController.STATE_PAGE_FOOTER_DONE; - } + public boolean isNormalFlowProcessing() + { + return state != OfficeReportLayoutController.STATE_PAGE_HEADER_DONE && state != OfficeReportLayoutController.STATE_PAGE_FOOTER_DONE; + } - public VariablesCollection getVariablesCollection() - { - return variablesCollection; - } + public VariablesCollection getVariablesCollection() + { + return variablesCollection; + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeTableLayoutController.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeTableLayoutController.java index d83ebb63957d..f8c9a1111a8d 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeTableLayoutController.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeTableLayoutController.java @@ -57,7 +57,7 @@ public class OfficeTableLayoutController extends SectionLayoutController protected AttributeMap computeAttributes(final FlowController fc, final Element element, final ReportTarget target) throws DataSourceException { - final AttributeMap attributeMap = new AttributeMap( super.computeAttributes(fc, element, target) ); + final AttributeMap attributeMap = new AttributeMap(super.computeAttributes(fc, element, target)); final Section s = (Section) element; int rowCount = 0; final Node[] nodeArray = s.getNodeArray(); @@ -67,8 +67,7 @@ public class OfficeTableLayoutController extends SectionLayoutController if (node instanceof Element) { final Element child = (Element) node; - if (OfficeNamespaces.TABLE_NS.equals(child.getNamespace()) && - OfficeToken.TABLE_ROW.equals(child.getType())) + if (OfficeNamespaces.TABLE_NS.equals(child.getNamespace()) && OfficeToken.TABLE_ROW.equals(child.getType())) { rowCount += 1; } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeTableTemplateLayoutController.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeTableTemplateLayoutController.java index f3a7f776db5c..738ccb4f07f4 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeTableTemplateLayoutController.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/OfficeTableTemplateLayoutController.java @@ -175,8 +175,7 @@ public class OfficeTableTemplateLayoutController extends SectionLayoutController if (node instanceof Element) { final Element element = (Element) node; - if (OfficeNamespaces.TABLE_NS.equals(element.getNamespace()) && - "table".equals(element.getType())) + if (OfficeNamespaces.TABLE_NS.equals(element.getNamespace()) && "table".equals(element.getType())) { tables.add(element); } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/TableCellLayoutController.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/TableCellLayoutController.java index 44117380e176..27d3f47c9fc0 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/TableCellLayoutController.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/TableCellLayoutController.java @@ -78,12 +78,12 @@ public class TableCellLayoutController extends SectionLayoutController final DataFlags value = computeValue(); if (value != null) { - FormatValueUtility.applyValueForCell(value.getValue(), attributeMap,valueType); + FormatValueUtility.applyValueForCell(value.getValue(), attributeMap, valueType); } } catch (Exception e) { - // ignore .. + // ignore .. } attributeMap.makeReadOnly(); return attributeMap; @@ -152,7 +152,7 @@ public class TableCellLayoutController extends SectionLayoutController } catch (DataSourceException e) { - // ignore silently .. + // ignore silently .. } } @@ -172,7 +172,7 @@ public class TableCellLayoutController extends SectionLayoutController } catch (DataSourceException e) { - // ignore silently .. + // ignore silently .. } } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/VariablesCollection.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/VariablesCollection.java index ee9bfd442bca..ca8687541545 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/VariablesCollection.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/VariablesCollection.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.layoutprocessor; import java.util.ArrayList; @@ -50,54 +48,52 @@ import java.util.List; */ public class VariablesCollection { - private VariablesCollection parent; - private String namePrefix; - private List variables; - public VariablesCollection(final String namePrefix) - { - this(namePrefix, null); - } + private VariablesCollection parent; + private String namePrefix; + private List variables; - public VariablesCollection(final String namePrefix, final VariablesCollection parent) - { - if (namePrefix == null) + public VariablesCollection(final String namePrefix) { - throw new NullPointerException("NamePrefix cannot be null"); + this(namePrefix, null); } - this.namePrefix = namePrefix; - this.parent = parent; - this.variables = new ArrayList(); - } - - public VariablesCollection getParent() - { - return parent; - } + public VariablesCollection(final String namePrefix, final VariablesCollection parent) + { + if (namePrefix == null) + { + throw new NullPointerException("NamePrefix cannot be null"); + } - public String getNamePrefix() - { - return namePrefix; - } + this.namePrefix = namePrefix; + this.parent = parent; + this.variables = new ArrayList(); + } - public String addVariable (final FormattedTextElement element) - { - variables.add(element); - final int size = variables.size(); - return namePrefix + size; - } + public VariablesCollection getParent() + { + return parent; + } - public FormattedTextElement[] getVariables () - { - return (FormattedTextElement[]) - variables.toArray(new FormattedTextElement[variables.size()]); - } + public String getNamePrefix() + { + return namePrefix; + } - public int getVariablesCount () - { - return variables.size(); - } + public String addVariable(final FormattedTextElement element) + { + variables.add(element); + final int size = variables.size(); + return namePrefix + size; + } + public FormattedTextElement[] getVariables() + { + return (FormattedTextElement[]) variables.toArray(new FormattedTextElement[variables.size()]); + } + public int getVariablesCount() + { + return variables.size(); + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/VariablesDeclarationLayoutController.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/VariablesDeclarationLayoutController.java index 55f4f2999aab..e59a699109f4 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/VariablesDeclarationLayoutController.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/VariablesDeclarationLayoutController.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.layoutprocessor; import com.sun.star.report.pentaho.OfficeNamespaces; @@ -56,137 +54,139 @@ import java.text.SimpleDateFormat; * @since 20.03.2007 */ public class VariablesDeclarationLayoutController - extends AbstractLayoutController + extends AbstractLayoutController { - private boolean processed; - public VariablesDeclarationLayoutController() - { - } + private boolean processed; - private OfficeRepeatingStructureLayoutController getRepeatingParent() - { - LayoutController parent = getParent(); - while (parent != null) + public VariablesDeclarationLayoutController() { - if (parent instanceof OfficeRepeatingStructureLayoutController) - { - return (OfficeRepeatingStructureLayoutController) parent; - } - parent = parent.getParent(); } - return null; - } - - /** - * Advances the processing position. - * - * @param target the report target that receives generated events. - * @return the new layout controller instance representing the new state. - * - * @throws org.jfree.report.DataSourceException - * if there was a problem reading data from the datasource. - * @throws org.jfree.report.ReportProcessingException - * if there was a general problem during the report processing. - * @throws org.jfree.report.ReportDataFactoryException - * if a query failed. - */ - public LayoutController advance(final ReportTarget target) - throws DataSourceException, ReportDataFactoryException, - ReportProcessingException - { - if (processed) + + private OfficeRepeatingStructureLayoutController getRepeatingParent() { - throw new IllegalStateException("Already processed."); + LayoutController parent = getParent(); + while (parent != null) + { + if (parent instanceof OfficeRepeatingStructureLayoutController) + { + return (OfficeRepeatingStructureLayoutController) parent; + } + parent = parent.getParent(); + } + return null; } - final VariablesDeclarationLayoutController vlc = - (VariablesDeclarationLayoutController) clone(); - vlc.processed = true; - - final OfficeRepeatingStructureLayoutController orslc = getRepeatingParent(); - if (orslc == null) + /** + * Advances the processing position. + * + * @param target the report target that receives generated events. + * @return the new layout controller instance representing the new state. + * + * @throws org.jfree.report.DataSourceException + * if there was a problem reading data from the datasource. + * @throws org.jfree.report.ReportProcessingException + * if there was a general problem during the report processing. + * @throws org.jfree.report.ReportDataFactoryException + * if a query failed. + */ + public LayoutController advance(final ReportTarget target) + throws DataSourceException, ReportDataFactoryException, + ReportProcessingException { - // There is no repeating parent. What the heck are we doing here .. - return vlc; + if (processed) + { + throw new IllegalStateException("Already processed."); + } + + final VariablesDeclarationLayoutController vlc = + (VariablesDeclarationLayoutController) clone(); + vlc.processed = true; + + final OfficeRepeatingStructureLayoutController orslc = getRepeatingParent(); + if (orslc == null) + { + // There is no repeating parent. What the heck are we doing here .. + return vlc; + } + + final VariablesCollection collection = orslc.getVariablesCollection(); + if (collection.getVariablesCount() == 0) + { + // no processing necessary, as the header or footer contain no variables at all .. + return vlc; + } + + + final Element node = (Element) getNode(); + final AttributeMap vdSection = node.getAttributeMap(); + target.startElement(vdSection); + + final FormattedTextElement[] variables = collection.getVariables(); + for (int i = 0; i < variables.length; i++) + { + final FormattedTextElement variable = variables[i]; + final String varName = collection.getNamePrefix() + (i + 1); + final AttributeMap map = generateVariableSetSection(variable); + map.setAttribute(OfficeNamespaces.TEXT_NS, "name", varName); + target.startElement(map); + target.endElement(map); + + } + target.endElement(vdSection); + return vlc; } - final VariablesCollection collection = orslc.getVariablesCollection(); - if (collection.getVariablesCount() == 0) + private AttributeMap generateVariableSetSection(final FormattedTextElement variable) + throws DataSourceException { - // no processing necessary, as the header or footer contain no variables at all .. - return vlc; + final AttributeMap variableSection = new AttributeMap(); + variableSection.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, Element.NAMESPACE_ATTRIBUTE, OfficeNamespaces.TEXT_NS); + variableSection.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, Element.TYPE_ATTRIBUTE, "variable-set"); + variableSection.setAttribute(OfficeNamespaces.TEXT_NS, "display", "none"); + + final FormulaExpression valueExpression = variable.getValueExpression(); + final Object value = LayoutControllerUtil.evaluateExpression(getFlowController(), variable, valueExpression); + String formula = FormatValueUtility.applyValueForVariable(value, variableSection); + if (formula == null) + { + formula = "" + value; + } + if (value instanceof java.sql.Date) + { + final Date date = (Date) value; + final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy;MM;dd"); + formula = "Date(" + dateFormat.format(date) + ")"; + } + variableSection.setAttribute(OfficeNamespaces.TEXT_NS, "formula", "ooow:" + formula); + + return variableSection; } - - final Element node = (Element) getNode(); - final AttributeMap vdSection = node.getAttributeMap(); - target.startElement(vdSection); - - final FormattedTextElement[] variables = collection.getVariables(); - for (int i = 0; i < variables.length; i++) + /** + * Checks, whether the layout controller would be advanceable. If this method + * returns true, it is generally safe to call the 'advance()' method. + * + * @return true, if the layout controller is advanceable, false otherwise. + */ + public boolean isAdvanceable() { - final FormattedTextElement variable = variables[i]; - final String varName = collection.getNamePrefix() + (i + 1); - final AttributeMap map = generateVariableSetSection(variable); - map.setAttribute(OfficeNamespaces.TEXT_NS, "name", varName); - target.startElement(map); - target.endElement(map); - + return !processed; } - target.endElement(vdSection); - return vlc; - } - - private AttributeMap generateVariableSetSection(final FormattedTextElement variable) - throws DataSourceException - { - final AttributeMap variableSection = new AttributeMap(); - variableSection.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, Element.NAMESPACE_ATTRIBUTE, OfficeNamespaces.TEXT_NS); - variableSection.setAttribute(JFreeReportInfo.REPORT_NAMESPACE, Element.TYPE_ATTRIBUTE, "variable-set"); - variableSection.setAttribute(OfficeNamespaces.TEXT_NS, "display", "none"); - - final FormulaExpression valueExpression = variable.getValueExpression(); - final Object value = LayoutControllerUtil.evaluateExpression(getFlowController(), variable, valueExpression); - String formula = FormatValueUtility.applyValueForVariable(value, variableSection); - if ( formula == null ) - formula = "" + value; - if (value instanceof java.sql.Date) + + /** + * Joins with a delegated process flow. This is generally called from a child + * flow and should *not* (I mean it!) be called from outside. If you do, + * you'll suffer. + * + * @param flowController the flow controller of the parent. + * @return the joined layout controller that incorperates all changes from the + * delegate. + */ + public LayoutController join(final FlowController flowController) + throws DataSourceException, ReportDataFactoryException, + ReportProcessingException { - final Date date = (Date)value; - final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy;MM;dd"); - formula = "Date(" + dateFormat.format(date) + ")"; + throw new UnsupportedOperationException("Join is not supported in this layout controller"); } - variableSection.setAttribute(OfficeNamespaces.TEXT_NS, "formula", "ooow:" + formula); - - return variableSection; - } - - /** - * Checks, whether the layout controller would be advanceable. If this method - * returns true, it is generally safe to call the 'advance()' method. - * - * @return true, if the layout controller is advanceable, false otherwise. - */ - public boolean isAdvanceable() - { - return !processed; - } - - /** - * Joins with a delegated process flow. This is generally called from a child - * flow and should *not* (I mean it!) be called from outside. If you do, - * you'll suffer. - * - * @param flowController the flow controller of the parent. - * @return the joined layout controller that incorperates all changes from the - * delegate. - */ - public LayoutController join(final FlowController flowController) - throws DataSourceException, ReportDataFactoryException, - ReportProcessingException - { - throw new UnsupportedOperationException - ("Join is not supported in this layout controller"); - } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/loader/InputRepositoryResourceData.java b/reportbuilder/java/com/sun/star/report/pentaho/loader/InputRepositoryResourceData.java index 14a437f4bb57..798f11d18194 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/loader/InputRepositoryResourceData.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/loader/InputRepositoryResourceData.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.loader; import java.io.IOException; @@ -42,47 +40,47 @@ import org.pentaho.reporting.libraries.resourceloader.loader.AbstractResourceDat public class InputRepositoryResourceData extends AbstractResourceData { - private final InputRepository inputRepository; - private final ResourceKey key; - private final String resourceIdentifer; - public InputRepositoryResourceData (final ResourceKey key, - final InputRepository repository) - { - this.key = key; - this.inputRepository = repository; - final InputResourceKey rkey = (InputResourceKey) key.getIdentifier(); - final String identifier = rkey.getPath(); - this.resourceIdentifer = identifier.substring("sun:oo://".length()); - } + private final InputRepository inputRepository; + private final ResourceKey key; + private final String resourceIdentifer; - public Object getAttribute (final String key) - { - // we dont support attributes here .. - return null; - } + public InputRepositoryResourceData(final ResourceKey key, + final InputRepository repository) + { + this.key = key; + this.inputRepository = repository; + final InputResourceKey rkey = (InputResourceKey) key.getIdentifier(); + final String identifier = rkey.getPath(); + this.resourceIdentifer = identifier.substring("sun:oo://".length()); + } - public ResourceKey getKey () - { - return key; - } + public Object getAttribute(final String key) + { + // we dont support attributes here .. + return null; + } - public InputStream getResourceAsStream (final ResourceManager caller) - throws ResourceLoadingException - { - try + public ResourceKey getKey() { - return inputRepository.createInputStream(resourceIdentifer); + return key; } - catch (IOException e) + + public InputStream getResourceAsStream(final ResourceManager caller) + throws ResourceLoadingException { - throw new ResourceLoadingException - ("Failed to create input stream for " + resourceIdentifer, e); + try + { + return inputRepository.createInputStream(resourceIdentifer); + } + catch (IOException e) + { + throw new ResourceLoadingException("Failed to create input stream for " + resourceIdentifer, e); + } } - } - public long getVersion (final ResourceManager caller) - { - return inputRepository.getVersion(resourceIdentifer); - } + public long getVersion(final ResourceManager caller) + { + return inputRepository.getVersion(resourceIdentifer); + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/loader/InputResourceKey.java b/reportbuilder/java/com/sun/star/report/pentaho/loader/InputResourceKey.java index a4f2f1ca4553..4fd3787dd676 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/loader/InputResourceKey.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/loader/InputResourceKey.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.loader; import java.io.Serializable; @@ -40,32 +38,29 @@ import java.io.Serializable; */ public class InputResourceKey implements Serializable { - private static final long serialVersionUID = 2819901838705793075L; - private final Object inputRepositoryId; - private final String path; + private static final long serialVersionUID = 2819901838705793075L; + private final Object inputRepositoryId; + private final String path; - public InputResourceKey(final Object inputRepositoryId, final String path) - { - this.inputRepositoryId = inputRepositoryId; - this.path = path; - } + public InputResourceKey(final Object inputRepositoryId, final String path) + { + this.inputRepositoryId = inputRepositoryId; + this.path = path; + } - public Object getInputRepositoryId() - { - return inputRepositoryId; - } + public Object getInputRepositoryId() + { + return inputRepositoryId; + } - public String getPath() - { - return path; - } + public String getPath() + { + return path; + } - public String toString() - { - return "InputResourceKey{" + - "inputRepositoryId=" + inputRepositoryId + - ", path='" + path + '\'' + - '}'; - } + public String toString() + { + return "InputResourceKey{" + "inputRepositoryId=" + inputRepositoryId + ", path='" + path + '\'' + '}'; + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/model/DataStyle.java b/reportbuilder/java/com/sun/star/report/pentaho/model/DataStyle.java index efef723425da..37ffed4ecd8d 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/model/DataStyle.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/model/DataStyle.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.model; import org.jfree.report.structure.Section; @@ -42,19 +40,18 @@ import com.sun.star.report.pentaho.OfficeNamespaces; */ public class DataStyle extends Section { - public DataStyle() - { - } - - public String getStyleName() - { - return (String) getAttribute(OfficeNamespaces.STYLE_NS, "name"); - } - public void setStyleName(final String name) - { - setAttribute(OfficeNamespaces.STYLE_NS, "name", name); - } + public DataStyle() + { + } + public String getStyleName() + { + return (String) getAttribute(OfficeNamespaces.STYLE_NS, "name"); + } + public void setStyleName(final String name) + { + setAttribute(OfficeNamespaces.STYLE_NS, "name", name); + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/model/FixedTextElement.java b/reportbuilder/java/com/sun/star/report/pentaho/model/FixedTextElement.java index 7632ee1fd650..c216f6aad214 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/model/FixedTextElement.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/model/FixedTextElement.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.model; import org.jfree.report.structure.Section; @@ -41,16 +39,17 @@ import org.jfree.report.structure.Section; */ public class FixedTextElement extends ReportElement { - private final Section content; - public FixedTextElement() - { - content = new Section(); - content.setVirtual(true); - } + private final Section content; + + public FixedTextElement() + { + content = new Section(); + content.setVirtual(true); + } - public Section getContent() - { - return content; - } + public Section getContent() + { + return content; + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/model/FontFaceDeclsSection.java b/reportbuilder/java/com/sun/star/report/pentaho/model/FontFaceDeclsSection.java index 9b509b0b0157..96e9eed7c2fe 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/model/FontFaceDeclsSection.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/model/FontFaceDeclsSection.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.model; import java.util.HashMap; @@ -45,34 +43,33 @@ import org.jfree.report.structure.Element; */ public class FontFaceDeclsSection extends Element { - private final Map fontFaces; - public FontFaceDeclsSection() - { - fontFaces = new HashMap(); - setType("font-face-decls"); - setNamespace(OfficeNamespaces.OFFICE_NS); - } + private final Map fontFaces; - public void addFontFace(final FontFaceElement style) - { - fontFaces.put (style.getStyleName(), style); - } + public FontFaceDeclsSection() + { + fontFaces = new HashMap(); + setType("font-face-decls"); + setNamespace(OfficeNamespaces.OFFICE_NS); + } - public FontFaceElement getFontFace (final String name) - { - return (FontFaceElement) fontFaces.get(name); - } + public void addFontFace(final FontFaceElement style) + { + fontFaces.put(style.getStyleName(), style); + } - public FontFaceElement[] getAllFontFaces() - { - return (FontFaceElement[]) fontFaces.values().toArray - (new FontFaceElement[fontFaces.size()]); - } + public FontFaceElement getFontFace(final String name) + { + return (FontFaceElement) fontFaces.get(name); + } + public FontFaceElement[] getAllFontFaces() + { + return (FontFaceElement[]) fontFaces.values().toArray(new FontFaceElement[fontFaces.size()]); + } - public boolean containsFont(final String fontName) - { - return fontFaces.containsKey(fontName); - } + public boolean containsFont(final String fontName) + { + return fontFaces.containsKey(fontName); + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/model/FontFaceElement.java b/reportbuilder/java/com/sun/star/report/pentaho/model/FontFaceElement.java index 48abe9e1f088..46516557f97a 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/model/FontFaceElement.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/model/FontFaceElement.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.model; import org.jfree.report.structure.Section; @@ -42,19 +40,18 @@ import com.sun.star.report.pentaho.OfficeNamespaces; */ public class FontFaceElement extends Section { - public FontFaceElement() - { - } - - public String getStyleName() - { - return (String) getAttribute(OfficeNamespaces.STYLE_NS, "name"); - } - public void setStyleName(final String name) - { - setAttribute(OfficeNamespaces.STYLE_NS, "name", name); - } + public FontFaceElement() + { + } + public String getStyleName() + { + return (String) getAttribute(OfficeNamespaces.STYLE_NS, "name"); + } + public void setStyleName(final String name) + { + setAttribute(OfficeNamespaces.STYLE_NS, "name", name); + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/model/FormatCondition.java b/reportbuilder/java/com/sun/star/report/pentaho/model/FormatCondition.java index 43e84abc4651..2f4d459229d6 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/model/FormatCondition.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/model/FormatCondition.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.model; import org.jfree.report.expressions.FormulaExpression; @@ -41,32 +39,32 @@ import org.jfree.report.expressions.FormulaExpression; */ public class FormatCondition { - private final FormulaExpression formula; - private final String styleName; - private final boolean enabled; - public FormatCondition(final FormulaExpression formula, - final String styleName, - final boolean enabled) - { - this.formula = formula; - this.styleName = styleName; - this.enabled = enabled; - } + private final FormulaExpression formula; + private final String styleName; + private final boolean enabled; + public FormatCondition(final FormulaExpression formula, + final String styleName, + final boolean enabled) + { + this.formula = formula; + this.styleName = styleName; + this.enabled = enabled; + } - public FormulaExpression getFormula() - { - return formula; - } + public FormulaExpression getFormula() + { + return formula; + } - public String getStyleName() - { - return styleName; - } + public String getStyleName() + { + return styleName; + } - public boolean isEnabled() - { - return enabled; - } + public boolean isEnabled() + { + return enabled; + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/model/FormattedTextElement.java b/reportbuilder/java/com/sun/star/report/pentaho/model/FormattedTextElement.java index f902cae1a346..3852cdabb86a 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/model/FormattedTextElement.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/model/FormattedTextElement.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.model; import org.jfree.report.expressions.FormulaExpression; @@ -44,20 +42,20 @@ import org.jfree.report.expressions.FormulaExpression; */ public class FormattedTextElement extends ReportElement { - private FormulaExpression valueExpression; - public FormattedTextElement() - { - } + private FormulaExpression valueExpression; + public FormattedTextElement() + { + } - public FormulaExpression getValueExpression() - { - return valueExpression; - } + public FormulaExpression getValueExpression() + { + return valueExpression; + } - public void setValueExpression(final FormulaExpression valueExpression) - { - this.valueExpression = valueExpression; - } + public void setValueExpression(final FormulaExpression valueExpression) + { + this.valueExpression = valueExpression; + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/model/ImageElement.java b/reportbuilder/java/com/sun/star/report/pentaho/model/ImageElement.java index 195c569a3028..f7832a9618c7 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/model/ImageElement.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/model/ImageElement.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.model; import org.jfree.report.expressions.FormulaExpression; @@ -43,45 +41,49 @@ import com.sun.star.report.OfficeToken; */ public class ImageElement extends ReportElement { - private FormulaExpression formula; - public ImageElement() - { - } + private FormulaExpression formula; - public FormulaExpression getFormula() - { - return formula; - } + public ImageElement() + { + } - public void setFormula(final FormulaExpression formula) - { - this.formula = formula; - } + public FormulaExpression getFormula() + { + return formula; + } + public void setFormula(final FormulaExpression formula) + { + this.formula = formula; + } - public String getScaleMode() - { - String val = (String)getAttribute(OfficeNamespaces.OOREPORT_NS, OfficeToken.SCALE); - if ( OfficeToken.TRUE.equals(val) ) - val = OfficeToken.ANISOTROPIC; - else if ( OfficeToken.FALSE.equals(val) || val == null ) - val = OfficeToken.NONE; - return val; - } + public String getScaleMode() + { + String val = (String) getAttribute(OfficeNamespaces.OOREPORT_NS, OfficeToken.SCALE); + if (OfficeToken.TRUE.equals(val)) + { + val = OfficeToken.ANISOTROPIC; + } + else if (OfficeToken.FALSE.equals(val) || val == null) + { + val = OfficeToken.NONE; + } + return val; + } - public boolean isPreserveIRI() - { - return OfficeToken.TRUE.equals(getAttribute(OfficeNamespaces.OOREPORT_NS, OfficeToken.PRESERVE_IRI)); - } + public boolean isPreserveIRI() + { + return OfficeToken.TRUE.equals(getAttribute(OfficeNamespaces.OOREPORT_NS, OfficeToken.PRESERVE_IRI)); + } - public void setPreserveIRI(final boolean preserveIRI) - { - setAttribute(OfficeNamespaces.OOREPORT_NS, OfficeToken.PRESERVE_IRI, String.valueOf(preserveIRI)); - } + public void setPreserveIRI(final boolean preserveIRI) + { + setAttribute(OfficeNamespaces.OOREPORT_NS, OfficeToken.PRESERVE_IRI, String.valueOf(preserveIRI)); + } - public String getImageData() - { - return (String) getAttribute(OfficeNamespaces.FORM_NS, OfficeToken.IMAGE_DATA); - } + public String getImageData() + { + return (String) getAttribute(OfficeNamespaces.FORM_NS, OfficeToken.IMAGE_DATA); + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/model/ObjectOleElement.java b/reportbuilder/java/com/sun/star/report/pentaho/model/ObjectOleElement.java index c31c3ae8497a..2950e1c8d2ff 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/model/ObjectOleElement.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/model/ObjectOleElement.java @@ -36,22 +36,26 @@ import java.util.List; * * @author Ocke Janssen */ -public class ObjectOleElement extends ReportElement{ +public class ObjectOleElement extends ReportElement +{ private String url; private final List masterfields; private final List detailfields; private String classid; - public String getClassid() { + public String getClassid() + { return classid; } - public List getDetailfields() { + public List getDetailfields() + { return detailfields; } - public List getMasterfields() { + public List getMasterfields() + { return masterfields; } @@ -61,22 +65,27 @@ public class ObjectOleElement extends ReportElement{ detailfields = new ArrayList(); } - public String getUrl() { + public String getUrl() + { return url; } - public void setClassId(final String classid) { + public void setClassId(final String classid) + { this.classid = classid; } - public void setUrl(final String _url ){ + + public void setUrl(final String _url) + { url = _url; } - public void addMasterDetailFields(final String master,final String detail){ - if ( master != null ){ + public void addMasterDetailFields(final String master, final String detail) + { + if (master != null) + { masterfields.add(master); detailfields.add(detail == null ? master : detail); } } - } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeDetailSection.java b/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeDetailSection.java index d66c17c29132..a31f66a805b6 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeDetailSection.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeDetailSection.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.model; import org.jfree.report.structure.DetailSection; @@ -41,7 +39,8 @@ import org.jfree.report.structure.DetailSection; */ public class OfficeDetailSection extends DetailSection { - public OfficeDetailSection() - { - } + + public OfficeDetailSection() + { + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeDocument.java b/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeDocument.java index 02727c2b9d2a..41cc7aaa68d4 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeDocument.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeDocument.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.model; import com.sun.star.report.JobProperties; @@ -43,32 +41,35 @@ import org.jfree.report.JFreeReport; */ public class OfficeDocument extends JFreeReport { - private OfficeStylesCollection stylesCollection; - private JobProperties jobProperties; - public JobProperties getJobProperties() { + private OfficeStylesCollection stylesCollection; + private JobProperties jobProperties; + + public JobProperties getJobProperties() + { return jobProperties; } - public void setJobProperties(final JobProperties jobProperties) { + public void setJobProperties(final JobProperties jobProperties) + { this.jobProperties = jobProperties; } - public OfficeDocument() - { - } + public OfficeDocument() + { + } - public OfficeStylesCollection getStylesCollection() - { - return stylesCollection; - } + public OfficeStylesCollection getStylesCollection() + { + return stylesCollection; + } - public void setStylesCollection(final OfficeStylesCollection stylesCollection) - { - if (stylesCollection == null) + public void setStylesCollection(final OfficeStylesCollection stylesCollection) { - throw new NullPointerException(); + if (stylesCollection == null) + { + throw new NullPointerException(); + } + this.stylesCollection = stylesCollection; } - this.stylesCollection = stylesCollection; - } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeGroup.java b/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeGroup.java index 2717eadea602..eca3f20fe0ef 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeGroup.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeGroup.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.model; import com.sun.star.report.pentaho.OfficeNamespaces; @@ -46,54 +44,53 @@ import org.jfree.report.structure.Section; */ public class OfficeGroup extends Section { - public OfficeGroup() - { - } - public boolean isStartNewColumn () - { - return OfficeToken.TRUE.equals - (getAttribute(OfficeNamespaces.OOREPORT_NS, "start-new-column")); - } + public OfficeGroup() + { + } - public boolean isResetPageNumber () - { - return OfficeToken.TRUE.equals - (getAttribute(OfficeNamespaces.OOREPORT_NS, "reset-page-number")); - } + public boolean isStartNewColumn() + { + return OfficeToken.TRUE.equals(getAttribute(OfficeNamespaces.OOREPORT_NS, "start-new-column")); + } - public OfficeGroupSection getHeader() - { - final OfficeGroupInstanceSection instanceSection = - (OfficeGroupInstanceSection) findFirstChild(JFreeReportInfo.REPORT_NAMESPACE, "group-instance"); - if (instanceSection == null) + public boolean isResetPageNumber() { - return null; + return OfficeToken.TRUE.equals(getAttribute(OfficeNamespaces.OOREPORT_NS, "reset-page-number")); } - return (OfficeGroupSection) instanceSection.findFirstChild - (OfficeNamespaces.OOREPORT_NS, "group-header"); - } + public OfficeGroupSection getHeader() + { + final OfficeGroupInstanceSection instanceSection = + (OfficeGroupInstanceSection) findFirstChild(JFreeReportInfo.REPORT_NAMESPACE, "group-instance"); + if (instanceSection == null) + { + return null; + } + return (OfficeGroupSection) instanceSection.findFirstChild(OfficeNamespaces.OOREPORT_NS, "group-header"); - public OfficeGroupSection getFooter() - { - final OfficeGroupInstanceSection instanceSection = - (OfficeGroupInstanceSection) findFirstChild(JFreeReportInfo.REPORT_NAMESPACE, "group-instance"); - if (instanceSection == null) + } + + public OfficeGroupSection getFooter() { - return null; + final OfficeGroupInstanceSection instanceSection = + (OfficeGroupInstanceSection) findFirstChild(JFreeReportInfo.REPORT_NAMESPACE, "group-instance"); + if (instanceSection == null) + { + return null; + } + return (OfficeGroupSection) instanceSection.findFirstChild(OfficeNamespaces.OOREPORT_NS, "group-footer"); + } - return (OfficeGroupSection) instanceSection.findFirstChild - (OfficeNamespaces.OOREPORT_NS, "group-footer"); - } - public Expression getGroupingExpression(){ - final OfficeGroupInstanceSection instanceSection = - (OfficeGroupInstanceSection) findFirstChild(JFreeReportInfo.REPORT_NAMESPACE, "group-instance"); - if (instanceSection == null) + public Expression getGroupingExpression() { - return null; + final OfficeGroupInstanceSection instanceSection = + (OfficeGroupInstanceSection) findFirstChild(JFreeReportInfo.REPORT_NAMESPACE, "group-instance"); + if (instanceSection == null) + { + return null; + } + return instanceSection.getGroupingExpression(); } - return instanceSection.getGroupingExpression(); - } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeGroupInstanceSection.java b/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeGroupInstanceSection.java index 26ec1d8f9c6d..478cc1b73f6d 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeGroupInstanceSection.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeGroupInstanceSection.java @@ -9,7 +9,8 @@ import org.jfree.report.structure.Group; */ public class OfficeGroupInstanceSection extends Group { - public OfficeGroupInstanceSection() - { - } + + public OfficeGroupInstanceSection() + { + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeMasterPage.java b/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeMasterPage.java index 6dca280618cc..209f0866271a 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeMasterPage.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeMasterPage.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.model; import org.jfree.report.structure.Section; @@ -44,29 +42,27 @@ import com.sun.star.report.pentaho.OfficeNamespaces; public class OfficeMasterPage extends Section { - public OfficeMasterPage() - { - } - - public String getStyleName() - { - return (String) getAttribute(OfficeNamespaces.STYLE_NS, "name"); - } - - public void setStyleName(final String name) - { - setAttribute(OfficeNamespaces.STYLE_NS, "name", name); - } + public OfficeMasterPage() + { + } - public String getPageLayout() - { - return (String) getAttribute(OfficeNamespaces.STYLE_NS, "page-layout-name"); - } + public String getStyleName() + { + return (String) getAttribute(OfficeNamespaces.STYLE_NS, "name"); + } - public void setPageLayout(final String name) - { - setAttribute(OfficeNamespaces.STYLE_NS, "page-layout-name", name); - } + public void setStyleName(final String name) + { + setAttribute(OfficeNamespaces.STYLE_NS, "name", name); + } + public String getPageLayout() + { + return (String) getAttribute(OfficeNamespaces.STYLE_NS, "page-layout-name"); + } + public void setPageLayout(final String name) + { + setAttribute(OfficeNamespaces.STYLE_NS, "page-layout-name", name); + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeMasterStyles.java b/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeMasterStyles.java index fed1f04db958..866a604c3f9f 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeMasterStyles.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeMasterStyles.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.model; import java.util.HashMap; @@ -51,37 +49,37 @@ import org.jfree.report.structure.Section; */ public class OfficeMasterStyles extends Element { - private final Map masterPages; - private final Section otherNodes; - public OfficeMasterStyles() - { - masterPages = new HashMap(); - otherNodes = new Section(); - } + private final Map masterPages; + private final Section otherNodes; - public void addMasterPage (final OfficeMasterPage masterPage) - { - if (masterPage == null) + public OfficeMasterStyles() { - throw new NullPointerException(); + masterPages = new HashMap(); + otherNodes = new Section(); } - this.masterPages.put(masterPage.getStyleName(), masterPage); - } - public OfficeMasterPage getMasterPage (final String name) - { - return (OfficeMasterPage) masterPages.get (name); - } + public void addMasterPage(final OfficeMasterPage masterPage) + { + if (masterPage == null) + { + throw new NullPointerException(); + } + this.masterPages.put(masterPage.getStyleName(), masterPage); + } - public OfficeMasterPage[] getAllMasterPages() - { - return (OfficeMasterPage[]) masterPages.values().toArray - (new OfficeMasterPage[masterPages.size()]); - } + public OfficeMasterPage getMasterPage(final String name) + { + return (OfficeMasterPage) masterPages.get(name); + } - public Section getOtherNodes() - { - return otherNodes; - } + public OfficeMasterPage[] getAllMasterPages() + { + return (OfficeMasterPage[]) masterPages.values().toArray(new OfficeMasterPage[masterPages.size()]); + } + + public Section getOtherNodes() + { + return otherNodes; + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeReport.java b/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeReport.java index 74afacbc4026..5804396b36be 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeReport.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeReport.java @@ -42,7 +42,8 @@ import org.jfree.report.structure.Node; * @author Thomas Morgner * @since 02.03.2007 */ -public class OfficeReport extends Element { +public class OfficeReport extends Element +{ private Node pageHeader; private Node pageFooter; @@ -54,78 +55,97 @@ public class OfficeReport extends Element { private Node preBodySection; private Node postBodySection; - public Node getPostBodySection() { + public Node getPostBodySection() + { return postBodySection; } - public void setPostBodySection(final Node postBodySection) { + public void setPostBodySection(final Node postBodySection) + { this.postBodySection = postBodySection; } - public Node getPreBodySection() { + public Node getPreBodySection() + { return preBodySection; } - public void setPreBodySection(final Node preBodySection) { + public void setPreBodySection(final Node preBodySection) + { this.preBodySection = preBodySection; } - public OfficeReport() { + public OfficeReport() + { } - public Node getPageHeader() { + public Node getPageHeader() + { return pageHeader; } - public void setPageHeader(final Node pageHeader) { + public void setPageHeader(final Node pageHeader) + { this.pageHeader = pageHeader; } - public Node getPageFooter() { + public Node getPageFooter() + { return pageFooter; } - public void setPageFooter(final Node pageFooter) { + public void setPageFooter(final Node pageFooter) + { this.pageFooter = pageFooter; } - public Node getColumnHeader() { + public Node getColumnHeader() + { return columnHeader; } - public void setColumnHeader(final Node columnHeader) { + public void setColumnHeader(final Node columnHeader) + { this.columnHeader = columnHeader; } - public Node getColumnFooter() { + public Node getColumnFooter() + { return columnFooter; } - public void setColumnFooter(final Node columnFooter) { + public void setColumnFooter(final Node columnFooter) + { this.columnFooter = columnFooter; } - public Node getReportHeader() { + public Node getReportHeader() + { return reportHeader; } - public void setReportHeader(final Node reportHeader) { + public void setReportHeader(final Node reportHeader) + { this.reportHeader = reportHeader; } - public Node getReportFooter() { + public Node getReportFooter() + { return reportFooter; } - public void setReportFooter(final Node reportFooter) { + public void setReportFooter(final Node reportFooter) + { this.reportFooter = reportFooter; } - public Node getBodySection() { + public Node getBodySection() + { return bodySection; } - public void setBodySection(final Node bodySection) { + public void setBodySection(final Node bodySection) + { this.bodySection = bodySection; } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeStyle.java b/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeStyle.java index 5f6bef8f1492..acb4b88359d0 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeStyle.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeStyle.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.model; import com.sun.star.report.OfficeToken; @@ -44,91 +42,91 @@ import org.jfree.report.structure.Section; */ public class OfficeStyle extends Section { - public OfficeStyle() - { - setNamespace(OfficeNamespaces.STYLE_NS); - setType("style"); - } - - public String getStyleName() - { - return (String) getAttribute(OfficeNamespaces.STYLE_NS, "name"); - } - - public void setStyleName(final String name) - { - setAttribute(OfficeNamespaces.STYLE_NS, "name", name); - } - - /** - * A parent style name must be a common style (it cannot be an automatic - * style) and has to exist. If no parent style is given, an implementation - * specific default style is used. - * - * @return - */ - public String getStyleParent() - { - return (String) getAttribute(OfficeNamespaces.STYLE_NS, "parent-style-name"); - } - - public void setStyleParent(final String parentName) - { - setAttribute(OfficeNamespaces.STYLE_NS, "parent-style-name", parentName); - } - - public String getStyleFamily() - { - return (String) getAttribute(OfficeNamespaces.STYLE_NS, "family"); - } - - public void setStyleFamily(final String family) - { - setAttribute(OfficeNamespaces.STYLE_NS, "family", family); - } + + public OfficeStyle() + { + setNamespace(OfficeNamespaces.STYLE_NS); + setType("style"); + } + + public String getStyleName() + { + return (String) getAttribute(OfficeNamespaces.STYLE_NS, "name"); + } + + public void setStyleName(final String name) + { + setAttribute(OfficeNamespaces.STYLE_NS, "name", name); + } + + /** + * A parent style name must be a common style (it cannot be an automatic + * style) and has to exist. If no parent style is given, an implementation + * specific default style is used. + * + * @return + */ + public String getStyleParent() + { + return (String) getAttribute(OfficeNamespaces.STYLE_NS, "parent-style-name"); + } + + public void setStyleParent(final String parentName) + { + setAttribute(OfficeNamespaces.STYLE_NS, "parent-style-name", parentName); + } + + public String getStyleFamily() + { + return (String) getAttribute(OfficeNamespaces.STYLE_NS, "family"); + } + + public void setStyleFamily(final String family) + { + setAttribute(OfficeNamespaces.STYLE_NS, "family", family); + } // public String getMasterPageName() // { // return (String) getAttribute(OfficeNamespaces.STYLE_NS, "master-page-name"); // } - - public Element getParagraphProperties () - { - return findFirstChild(OfficeNamespaces.STYLE_NS, "paragraph-properties"); - } - - public Element getTextProperties () - { - return findFirstChild(OfficeNamespaces.STYLE_NS, "text-properties"); - } - - public Element getTableRowProperties () - { - return findFirstChild(OfficeNamespaces.STYLE_NS, "table-row-properties"); - } - - public Element getTableProperties () - { - return findFirstChild(OfficeNamespaces.STYLE_NS, "table-properties"); - } - - public Element getTableColumnProperties () - { - return findFirstChild(OfficeNamespaces.STYLE_NS, "table-column-properties"); - } - - public Element getSectionProperties () - { - return findFirstChild(OfficeNamespaces.STYLE_NS, "section-properties"); - } - - public Element getTableCellProperties () - { - return findFirstChild(OfficeNamespaces.STYLE_NS, "table-cell-properties"); - } - - public Element getGraphicProperties () - { - return findFirstChild(OfficeNamespaces.STYLE_NS, OfficeToken.GRAPHIC_PROPERTIES); - } + public Element getParagraphProperties() + { + return findFirstChild(OfficeNamespaces.STYLE_NS, "paragraph-properties"); + } + + public Element getTextProperties() + { + return findFirstChild(OfficeNamespaces.STYLE_NS, "text-properties"); + } + + public Element getTableRowProperties() + { + return findFirstChild(OfficeNamespaces.STYLE_NS, "table-row-properties"); + } + + public Element getTableProperties() + { + return findFirstChild(OfficeNamespaces.STYLE_NS, "table-properties"); + } + + public Element getTableColumnProperties() + { + return findFirstChild(OfficeNamespaces.STYLE_NS, "table-column-properties"); + } + + public Element getSectionProperties() + { + return findFirstChild(OfficeNamespaces.STYLE_NS, "section-properties"); + } + + public Element getTableCellProperties() + { + return findFirstChild(OfficeNamespaces.STYLE_NS, "table-cell-properties"); + } + + public Element getGraphicProperties() + { + return findFirstChild(OfficeNamespaces.STYLE_NS, OfficeToken.GRAPHIC_PROPERTIES); + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeStyles.java b/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeStyles.java index 29f2a923dae3..aa08f75e38a4 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeStyles.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeStyles.java @@ -91,7 +91,7 @@ public class OfficeStyles extends Element final StyleKey styleKey = (StyleKey) obj; - if (!family.equals(styleKey.family) || ( name != null ? !name.equals(styleKey.name) : styleKey.name != null) ) + if (!family.equals(styleKey.family) || (name != null ? !name.equals(styleKey.name) : styleKey.name != null)) { return false; } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeStylesCollection.java b/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeStylesCollection.java index 58e6d4639add..a4a4d4b544ab 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeStylesCollection.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeStylesCollection.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.model; import com.sun.star.report.pentaho.OfficeNamespaces; @@ -54,73 +52,74 @@ import org.jfree.report.structure.Element; */ public class OfficeStylesCollection extends Element { - // Font-face declarations are copied as is. We simply merge them by adding - // them all in one set. This may result in duplicate entries, but as the - // fileformat does not forbid that, it therefore must be ok. - private final FontFaceDeclsSection fontFaceDecls; - private final OfficeStyles automaticStyles; - private final OfficeStyles commonStyles; - private final OfficeMasterStyles masterStyles; + // Font-face declarations are copied as is. We simply merge them by adding + // them all in one set. This may result in duplicate entries, but as the + // fileformat does not forbid that, it therefore must be ok. - public OfficeStylesCollection() - { - fontFaceDecls = new FontFaceDeclsSection(); + private final FontFaceDeclsSection fontFaceDecls; + private final OfficeStyles automaticStyles; + private final OfficeStyles commonStyles; + private final OfficeMasterStyles masterStyles; - automaticStyles = new OfficeStyles(); - automaticStyles.setType("automatic-styles"); - automaticStyles.setNamespace(OfficeNamespaces.OFFICE_NS); + public OfficeStylesCollection() + { + fontFaceDecls = new FontFaceDeclsSection(); - commonStyles = new OfficeStyles(); - commonStyles.setType("styles"); - commonStyles.setNamespace(OfficeNamespaces.OFFICE_NS); + automaticStyles = new OfficeStyles(); + automaticStyles.setType("automatic-styles"); + automaticStyles.setNamespace(OfficeNamespaces.OFFICE_NS); - masterStyles = new OfficeMasterStyles(); - masterStyles.setType("master-styles"); - masterStyles.setNamespace(OfficeNamespaces.OFFICE_NS); - } + commonStyles = new OfficeStyles(); + commonStyles.setType("styles"); + commonStyles.setNamespace(OfficeNamespaces.OFFICE_NS); - public OfficeStyle getStyle(final String family, final String name) - { - final OfficeStyle commonStyle = commonStyles.getStyle(family, name); - if (commonStyle != null) - { - return commonStyle; + masterStyles = new OfficeMasterStyles(); + masterStyles.setType("master-styles"); + masterStyles.setNamespace(OfficeNamespaces.OFFICE_NS); } - final OfficeStyle autoStyle = automaticStyles.getStyle(family, name); - if (autoStyle != null) + + public OfficeStyle getStyle(final String family, final String name) { - return autoStyle; - } + final OfficeStyle commonStyle = commonStyles.getStyle(family, name); + if (commonStyle != null) + { + return commonStyle; + } + final OfficeStyle autoStyle = automaticStyles.getStyle(family, name); + if (autoStyle != null) + { + return autoStyle; + } - // And later: Autogenerate one of the default styles. - // However, at this moment, we dont have a clue about the default styles - // at all. Maybe we should add them to make this implementation more robust - // against invalid documents. - return null; - } + // And later: Autogenerate one of the default styles. + // However, at this moment, we dont have a clue about the default styles + // at all. Maybe we should add them to make this implementation more robust + // against invalid documents. + return null; + } - public boolean containsStyle (final String family, final String name) - { - return (getStyle(family, name) != null); - } + public boolean containsStyle(final String family, final String name) + { + return (getStyle(family, name) != null); + } - public OfficeStyles getAutomaticStyles() - { - return automaticStyles; - } + public OfficeStyles getAutomaticStyles() + { + return automaticStyles; + } - public OfficeStyles getCommonStyles() - { - return commonStyles; - } + public OfficeStyles getCommonStyles() + { + return commonStyles; + } - public OfficeMasterStyles getMasterStyles() - { - return masterStyles; - } + public OfficeMasterStyles getMasterStyles() + { + return masterStyles; + } - public FontFaceDeclsSection getFontFaceDecls() - { - return fontFaceDecls; - } + public FontFaceDeclsSection getFontFaceDecls() + { + return fontFaceDecls; + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeTableSection.java b/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeTableSection.java index 96d6a4dd7e9e..bf77ebcd1253 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeTableSection.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/model/OfficeTableSection.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.model; import org.jfree.report.structure.Section; @@ -40,7 +38,8 @@ import org.jfree.report.structure.Section; */ public class OfficeTableSection extends Section { - public OfficeTableSection() - { - } + + public OfficeTableSection() + { + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/model/PageLayout.java b/reportbuilder/java/com/sun/star/report/pentaho/model/PageLayout.java index 29b916778ab7..9499d0557f29 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/model/PageLayout.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/model/PageLayout.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.model; import org.jfree.report.structure.Section; @@ -44,29 +42,29 @@ import com.sun.star.report.pentaho.OfficeNamespaces; public class PageLayout extends Section { - public PageLayout() - { - setNamespace(OfficeNamespaces.STYLE_NS); - setType("page-layout"); - } + public PageLayout() + { + setNamespace(OfficeNamespaces.STYLE_NS); + setType("page-layout"); + } - public String getStyleName() - { - return (String) getAttribute(OfficeNamespaces.STYLE_NS, "name"); - } + public String getStyleName() + { + return (String) getAttribute(OfficeNamespaces.STYLE_NS, "name"); + } - public void setStyleName(final String name) - { - setAttribute(OfficeNamespaces.STYLE_NS, "name", name); - } + public void setStyleName(final String name) + { + setAttribute(OfficeNamespaces.STYLE_NS, "name", name); + } - public Section getHeaderStyle () - { - return (Section) findFirstChild(OfficeNamespaces.STYLE_NS, "header-style"); - } + public Section getHeaderStyle() + { + return (Section) findFirstChild(OfficeNamespaces.STYLE_NS, "header-style"); + } - public Section getFooterStyle () - { - return (Section) findFirstChild(OfficeNamespaces.STYLE_NS, "footer-style"); - } + public Section getFooterStyle() + { + return (Section) findFirstChild(OfficeNamespaces.STYLE_NS, "footer-style"); + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/model/RawText.java b/reportbuilder/java/com/sun/star/report/pentaho/model/RawText.java index 679dd30fdff3..8dd1dcf7430d 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/model/RawText.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/model/RawText.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.model; import org.jfree.report.structure.StaticText; @@ -43,8 +41,9 @@ import org.jfree.report.structure.StaticText; */ public class RawText extends StaticText { - public RawText(final String text) - { - super(text); - } + + public RawText(final String text) + { + super(text); + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/model/ReportElement.java b/reportbuilder/java/com/sun/star/report/pentaho/model/ReportElement.java index df1de0154e6a..a3c9838be19d 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/model/ReportElement.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/model/ReportElement.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.model; import java.util.ArrayList; @@ -47,69 +45,67 @@ import java.util.List; */ public abstract class ReportElement extends Element { - private final List formatConditions; - protected ReportElement() - { - formatConditions = new ArrayList(); - } + private final List formatConditions; - /** - * Checks the current group and prints this element only if the current row is - * the first row for that particular group. - * - * @return true, if the element should only be printed in the first row of the - * current group, false otherwise. - */ - public boolean isPrintWhenGroupChanges() - { - return OfficeToken.TRUE.equals(getAttribute - (OfficeNamespaces.OOREPORT_NS, "print-when-group-changes")); - } + protected ReportElement() + { + formatConditions = new ArrayList(); + } - public void setPrintWhenGroupChanges(final boolean printWhenGroupChanges) - { - setAttribute(OfficeNamespaces.OOREPORT_NS, "print-when-group-changes", - String.valueOf(printWhenGroupChanges)); - } + /** + * Checks the current group and prints this element only if the current row is + * the first row for that particular group. + * + * @return true, if the element should only be printed in the first row of the + * current group, false otherwise. + */ + public boolean isPrintWhenGroupChanges() + { + return OfficeToken.TRUE.equals(getAttribute(OfficeNamespaces.OOREPORT_NS, "print-when-group-changes")); + } - /** - * Checks, whether the printed value has been changed since the last run. The - * element will only be printed, if there was at least one change. - * - * @return true, if repeated values should be printed, false if repeated - * values should be surpressed. - */ - public boolean isPrintRepeatedValues() - { - return OfficeToken.TRUE.equals(getAttribute - (OfficeNamespaces.OOREPORT_NS, "print-repeated-values")); - } + public void setPrintWhenGroupChanges(final boolean printWhenGroupChanges) + { + setAttribute(OfficeNamespaces.OOREPORT_NS, "print-when-group-changes", + String.valueOf(printWhenGroupChanges)); + } - public void setPrintRepeatedValues(final boolean printRepeatedValues) - { - setAttribute(OfficeNamespaces.OOREPORT_NS, "print-repeated-values", - String.valueOf(printRepeatedValues)); - } + /** + * Checks, whether the printed value has been changed since the last run. The + * element will only be printed, if there was at least one change. + * + * @return true, if repeated values should be printed, false if repeated + * values should be surpressed. + */ + public boolean isPrintRepeatedValues() + { + return OfficeToken.TRUE.equals(getAttribute(OfficeNamespaces.OOREPORT_NS, "print-repeated-values")); + } - public void addFormatCondition(final FormatCondition formatCondition) - { - if (formatCondition == null) + public void setPrintRepeatedValues(final boolean printRepeatedValues) { - throw new NullPointerException(); + setAttribute(OfficeNamespaces.OOREPORT_NS, "print-repeated-values", + String.valueOf(printRepeatedValues)); } - this.formatConditions.add(formatCondition); - } + public void addFormatCondition(final FormatCondition formatCondition) + { + if (formatCondition == null) + { + throw new NullPointerException(); + } + + this.formatConditions.add(formatCondition); + } - public FormatCondition[] getFormatConditions () - { - return (FormatCondition[]) this.formatConditions.toArray - (new FormatCondition[this.formatConditions.size()]); - } + public FormatCondition[] getFormatConditions() + { + return (FormatCondition[]) this.formatConditions.toArray(new FormatCondition[this.formatConditions.size()]); + } - public int getFormatConditionCount () - { - return formatConditions.size(); - } + public int getFormatConditionCount() + { + return formatConditions.size(); + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/model/TableCellElement.java b/reportbuilder/java/com/sun/star/report/pentaho/model/TableCellElement.java index 74334dc11c52..501a8dbe8131 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/model/TableCellElement.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/model/TableCellElement.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.model; import org.jfree.report.structure.Section; @@ -42,7 +40,7 @@ import org.jfree.report.structure.Section; public class TableCellElement extends Section { - public TableCellElement() - { - } + public TableCellElement() + { + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/model/VariablesDeclarationSection.java b/reportbuilder/java/com/sun/star/report/pentaho/model/VariablesDeclarationSection.java index 3dcdc302ef7a..fc03e863ff64 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/model/VariablesDeclarationSection.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/model/VariablesDeclarationSection.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.model; import org.jfree.report.JFreeReportInfo; @@ -49,9 +47,9 @@ import org.jfree.report.structure.Section; public class VariablesDeclarationSection extends Section { - public VariablesDeclarationSection() - { - setNamespace(JFreeReportInfo.REPORT_NAMESPACE); - setType("variables-section"); - } + public VariablesDeclarationSection() + { + setNamespace(JFreeReportInfo.REPORT_NAMESPACE); + setType("variables-section"); + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/oasis-datastyle.css b/reportbuilder/java/com/sun/star/report/pentaho/oasis-datastyle.css index 01fa9d16fe03..427537005d39 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/oasis-datastyle.css +++ b/reportbuilder/java/com/sun/star/report/pentaho/oasis-datastyle.css @@ -2,4 +2,4 @@ /** * All default styles for data-styles elements. - */ +*/ diff --git a/reportbuilder/java/com/sun/star/report/pentaho/oasis-draw.css b/reportbuilder/java/com/sun/star/report/pentaho/oasis-draw.css index 87fe338294e2..341f44ec550e 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/oasis-draw.css +++ b/reportbuilder/java/com/sun/star/report/pentaho/oasis-draw.css @@ -2,4 +2,4 @@ /** * All default styles for draw elements. - */ +*/ diff --git a/reportbuilder/java/com/sun/star/report/pentaho/oasis-form.css b/reportbuilder/java/com/sun/star/report/pentaho/oasis-form.css index b9f4967eaa1b..7c8c43008435 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/oasis-form.css +++ b/reportbuilder/java/com/sun/star/report/pentaho/oasis-form.css @@ -2,4 +2,4 @@ /** * All default styles for form elements. - */ +*/ diff --git a/reportbuilder/java/com/sun/star/report/pentaho/oasis-style.css b/reportbuilder/java/com/sun/star/report/pentaho/oasis-style.css index 6e5f9c8f51c5..47777f4fb7e4 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/oasis-style.css +++ b/reportbuilder/java/com/sun/star/report/pentaho/oasis-style.css @@ -3,8 +3,8 @@ /** * All default styles for style elements. (They should not be visible anyway, * but better be complete than be sorry afterwards.) - */ +*/ raw-styles { - display:none; + display:none; } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/oasis-table.css b/reportbuilder/java/com/sun/star/report/pentaho/oasis-table.css index efddd2919966..91bedcd97573 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/oasis-table.css +++ b/reportbuilder/java/com/sun/star/report/pentaho/oasis-table.css @@ -1,35 +1,35 @@ @namespace url("urn:oasis:names:tc:opendocument:xmlns:table:1.0"); table { - display: table; + display: table; } table-columns { - display: table-column-group; + display: table-column-group; } table-column { - display: table-column; + display: table-column; } table-row { - display: table-row; + display: table-row; } table-cell { - display: table-cell; + display: table-cell; } table-cell[number-cols-spanned], table-cell[number-cols-spanned], table-columns[number-cols-spanned], table-column[number-cols-spanned] { - -x-liblayout-colspan: attr(number-cols-spanned); + -x-liblayout-colspan: attr(number-cols-spanned); } table-cell[number-rows-spanned], table-cell[number-rows-spanned] { - -x-liblayout-rowspan: attr(number-rows-spanned); + -x-liblayout-rowspan: attr(number-rows-spanned); } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/oasis-text.css b/reportbuilder/java/com/sun/star/report/pentaho/oasis-text.css index c8b6acc03d94..ccc000e9c82d 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/oasis-text.css +++ b/reportbuilder/java/com/sun/star/report/pentaho/oasis-text.css @@ -2,8 +2,8 @@ /** * All default styles for form elements. - */ +*/ p { - display: block; + display: block; } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/ImageProducer.java b/reportbuilder/java/com/sun/star/report/pentaho/output/ImageProducer.java index af34c5ed5a00..ac98c9a97953 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/output/ImageProducer.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/output/ImageProducer.java @@ -71,7 +71,9 @@ import org.pentaho.reporting.libraries.base.util.WaitingImageObserver; */ public class ImageProducer { + private static final Log LOGGER = LogFactory.getLog(ImageProducer.class); + public static class OfficeImage { @@ -140,7 +142,7 @@ public class ImageProducer { if (hashCode != null) { - return hashCode.intValue(); + return hashCode; } final int length = Math.min(keyData.length, 512); @@ -150,7 +152,7 @@ public class ImageProducer final byte b = keyData[i]; hashValue = b + hashValue * 23; } - this.hashCode = Integer.valueOf(hashValue); + this.hashCode = hashValue; return hashValue; } } @@ -320,7 +322,7 @@ public class ImageProducer } catch (MalformedURLException e) { - // ignore .. but we had to try this .. + // ignore .. but we had to try this .. } final OfficeImage o = (OfficeImage) imageCache.get(source); @@ -365,6 +367,22 @@ public class ImageProducer LOGGER.warn("Failed to create image from local input-repository", e); } } + else + { + try + { + URI rootURI = new URI(inputRepository.getRootURL()); + final URI uri = rootURI.resolve(source); + return produceFromURL(uri.toURL(), preserveIRI); + } + catch (URISyntaxException ex) + { + } + catch (MalformedURLException e) + { + // ignore .. but we had to try this .. + } + } // Return the image as broken image instead .. final OfficeImage officeImage = new OfficeImage(source, null, null); @@ -381,7 +399,7 @@ public class ImageProducer { uri = new URI(urlString); } - catch ( URISyntaxException ex ) + catch (URISyntaxException ex) { Logger.getLogger(ImageProducer.class.getName()).log(Level.SEVERE, null, ex); } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/OfficeDocumentReportTarget.java b/reportbuilder/java/com/sun/star/report/pentaho/output/OfficeDocumentReportTarget.java index 42fef8d10f45..3892944eb1f2 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/output/OfficeDocumentReportTarget.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/output/OfficeDocumentReportTarget.java @@ -104,6 +104,7 @@ import org.w3c.css.sac.LexicalUnit; */ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget { + protected static final Log LOGGER = LogFactory.getLog(OfficeDocumentReportTarget.class); public static final String HORIZONTAL_POS = "horizontal-pos"; public static final String TAG_DEF_PREFIX = "com.sun.star.report.pentaho.output."; @@ -228,11 +229,7 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget public String toString() { - return "GroupContext{" + - "parent=" + parent + - ", iterationCount=" + iterationCount + - ", groupWithRepeatingSection=" + groupWithRepeatingSection + - '}'; + return "GroupContext{" + "parent=" + parent + ", iterationCount=" + iterationCount + ", groupWithRepeatingSection=" + groupWithRepeatingSection + '}'; } } private final FastStack states; @@ -301,7 +298,7 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget this.imageNames = new AttributeNameGenerator(); this.imageProducer = new ImageProducer(inputRepository, outputRepository, imageService); - this.oleProducer = new OleProducer(inputRepository, outputRepository, imageService, datasourcefactory,(Integer)reportJob.getParameters().get(ReportEngineParameterNames.MAXROWS)); + this.oleProducer = new OleProducer(inputRepository, outputRepository, imageService, datasourcefactory, (Integer) reportJob.getParameters().get(ReportEngineParameterNames.MAXROWS)); try { @@ -489,7 +486,7 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget throw new IllegalStateException(); } final Integer o = (Integer) states.peek(); - return o.intValue(); + return o; } /** @@ -507,9 +504,7 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget // todo if (DEBUG_ELEMENTS) { - LOGGER.debug("Starting " + getCurrentState() + '/' + states.size() + ' ' + - ReportTargetUtil.getNamespaceFromAttribute(attrs) + " -> " + - ReportTargetUtil.getElemenTypeFromAttribute(attrs)); + LOGGER.debug("Starting " + getCurrentState() + '/' + states.size() + ' ' + ReportTargetUtil.getNamespaceFromAttribute(attrs) + " -> " + ReportTargetUtil.getElemenTypeFromAttribute(attrs)); } try { @@ -599,8 +594,7 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget } else { - throw new IllegalStateException("Expected either 'template', 'report-body', " + - "'report-header', 'report-footer', 'variables-section', 'page-header' or 'page-footer'"); + throw new IllegalStateException("Expected either 'template', 'report-body', " + "'report-header', 'report-footer', 'variables-section', 'page-header' or 'page-footer'"); } startReportSection(attrs, currentRole); } @@ -648,20 +642,17 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget { // repeating group header/footer, but *no* variables section states.push(IntegerCache.getInteger(OfficeDocumentReportTarget.STATE_IN_SECTION)); - if (ReportTargetUtil.isElementOfType(OfficeNamespaces.OOREPORT_NS, "group-header", attrs) && - OfficeToken.TRUE.equals(attrs.getAttribute(JFreeReportInfo.REPORT_NAMESPACE, "repeated-section"))) + if (ReportTargetUtil.isElementOfType(OfficeNamespaces.OOREPORT_NS, "group-header", attrs) && OfficeToken.TRUE.equals(attrs.getAttribute(JFreeReportInfo.REPORT_NAMESPACE, "repeated-section"))) { currentRole = OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_HEADER; } - else if (ReportTargetUtil.isElementOfType(OfficeNamespaces.OOREPORT_NS, "group-footer", attrs) && - OfficeToken.TRUE.equals(attrs.getAttribute(JFreeReportInfo.REPORT_NAMESPACE, "repeated-section"))) + else if (ReportTargetUtil.isElementOfType(OfficeNamespaces.OOREPORT_NS, "group-footer", attrs) && OfficeToken.TRUE.equals(attrs.getAttribute(JFreeReportInfo.REPORT_NAMESPACE, "repeated-section"))) { currentRole = OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_FOOTER; } else { - throw new IllegalStateException("Expected either 'group-instance', " + - "'repeating group-header' or 'repeating group-footer'"); + throw new IllegalStateException("Expected either 'group-instance', " + "'repeating group-header' or 'repeating group-footer'"); } startReportSection(attrs, currentRole); } @@ -788,9 +779,7 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget private final boolean allowBuffering(final int role) { - return (role == OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_FOOTER || - role == OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_HEADER || - role == OfficeDocumentReportTarget.ROLE_TEMPLATE); + return (role == OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_FOOTER || role == OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_HEADER || role == OfficeDocumentReportTarget.ROLE_TEMPLATE); } protected void startReportSection(final AttributeMap attrs, final int role) @@ -845,12 +834,12 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget String line = br.readLine(); while (line != null) { - xmlWriter.writeTextNormalized(line, false); - line = br.readLine(); - if (line != null) - { - xmlWriter.writeTag(OfficeNamespaces.TEXT_NS, "line-break", XmlWriterSupport.CLOSE); - } + xmlWriter.writeTextNormalized(line, false); + line = br.readLine(); + if (line != null) + { + xmlWriter.writeTag(OfficeNamespaces.TEXT_NS, "line-break", XmlWriterSupport.CLOSE); + } } } catch (IOException e) @@ -989,9 +978,7 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget if (DEBUG_ELEMENTS) { - LOGGER.debug("Finished " + getCurrentState() + "/" + states.size() + " " + - ReportTargetUtil.getNamespaceFromAttribute(attrs) + ":" + - ReportTargetUtil.getElemenTypeFromAttribute(attrs)); + LOGGER.debug("Finished " + getCurrentState() + "/" + states.size() + " " + ReportTargetUtil.getNamespaceFromAttribute(attrs) + ":" + ReportTargetUtil.getElemenTypeFromAttribute(attrs)); } } @@ -1122,7 +1109,7 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget } catch (IOException ioe) { - throw new ReportProcessingException("Unable to create the buffer",ioe); + throw new ReportProcessingException("Unable to create the buffer", ioe); } } @@ -1172,17 +1159,14 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget { final Map.Entry entry = (Map.Entry) entries.next(); final String key = String.valueOf(entry.getKey()); - if (OfficeNamespaces.TABLE_NS.equals(attrNamespace) && - "name".equals(key)) + if (OfficeNamespaces.TABLE_NS.equals(attrNamespace) && "name".equals(key)) { final String tableName = String.valueOf(entry.getValue()); final String saneName = sanitizeName(tableName); attrList.setAttribute(attrNamespace, key, tableNameGenerator.generateName(saneName)); } - else if (OfficeNamespaces.DRAWING_NS.equals(attrNamespace) && - "name".equals(key) && - !"equation".equals(elementType) ) + else if (OfficeNamespaces.DRAWING_NS.equals(attrNamespace) && "name".equals(key) && !"equation".equals(elementType)) { final String objectName = String.valueOf(entry.getValue()); attrList.setAttribute(attrNamespace, key, @@ -1243,11 +1227,7 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget protected boolean isRepeatingSection() { - return (currentRole == OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_FOOTER || - currentRole == OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_HEADER || - currentRole == OfficeDocumentReportTarget.ROLE_PAGE_FOOTER || - currentRole == OfficeDocumentReportTarget.ROLE_PAGE_HEADER || - currentRole == OfficeDocumentReportTarget.ROLE_VARIABLES); + return (currentRole == OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_FOOTER || currentRole == OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_HEADER || currentRole == OfficeDocumentReportTarget.ROLE_PAGE_FOOTER || currentRole == OfficeDocumentReportTarget.ROLE_PAGE_HEADER || currentRole == OfficeDocumentReportTarget.ROLE_VARIABLES); } @@ -1309,8 +1289,8 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget final CSSNumericValue normalizedImageHeight = CSSValueResolverUtility.convertLength(height, imageAreaHeightVal.getType()); - final String scale = (String)attrs.getAttribute(JFreeReportInfo.REPORT_NAMESPACE, OfficeToken.SCALE); - if ( OfficeToken.NONE.equals(scale) && normalizedImageWidth.getValue() > 0 && normalizedImageHeight.getValue() > 0) + final String scale = (String) attrs.getAttribute(JFreeReportInfo.REPORT_NAMESPACE, OfficeToken.SCALE); + if (OfficeToken.NONE.equals(scale) && normalizedImageWidth.getValue() > 0 && normalizedImageHeight.getValue() > 0) { final double clipWidth = normalizedImageWidth.getValue() - imageAreaWidthVal.getValue(); final double clipHeight = normalizedImageHeight.getValue() - imageAreaHeightVal.getValue(); @@ -1379,24 +1359,23 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget imageAreaHeightVal = normalizedImageHeight; } } - else if ( OfficeToken.ISOTROPIC.equals(scale) ) + else if (OfficeToken.ISOTROPIC.equals(scale)) { - final double[] ret = calcPaintSize(imageAreaWidthVal,imageAreaHeightVal,normalizedImageWidth,normalizedImageHeight); + final double[] ret = calcPaintSize(imageAreaWidthVal, imageAreaHeightVal, normalizedImageWidth, normalizedImageHeight); - posX = CSSNumericValue.createValue(imageAreaWidthVal.getType(),( imageAreaWidthVal.getValue() - ret[0]) * 0.5); - posY = CSSNumericValue.createValue(imageAreaHeightVal.getType(),( imageAreaHeightVal.getValue() - ret[1]) * 0.5); + posX = CSSNumericValue.createValue(imageAreaWidthVal.getType(), (imageAreaWidthVal.getValue() - ret[0]) * 0.5); + posY = CSSNumericValue.createValue(imageAreaHeightVal.getType(), (imageAreaHeightVal.getValue() - ret[1]) * 0.5); - imageAreaWidthVal = CSSNumericValue.createValue(imageAreaWidthVal.getType(),ret[0]); - imageAreaHeightVal = CSSNumericValue.createValue(imageAreaHeightVal.getType(),ret[1]); + imageAreaWidthVal = CSSNumericValue.createValue(imageAreaWidthVal.getType(), ret[0]); + imageAreaHeightVal = CSSNumericValue.createValue(imageAreaHeightVal.getType(), ret[1]); } } - // If we do scale, then we simply use the given image-area-size as valid image size and dont - // care about the image itself .. + // If we do scale, then we simply use the given image-area-size as valid image size and dont + // care about the image itself .. } else { - LOGGER.debug("There is no image-context, so we have to rely on the image's natural bounds. " + - "This may go awfully wrong."); + LOGGER.debug("There is no image-context, so we have to rely on the image's natural bounds. " + "This may go awfully wrong."); imageAreaWidthVal = image.getWidth(); imageAreaHeightVal = image.getHeight(); } @@ -1653,19 +1632,21 @@ public abstract class OfficeDocumentReportTarget extends AbstractReportTarget throw new ReportProcessingException(FAILED, ioe); } } - static private double[] calcPaintSize( final CSSNumericValue areaWidth, final CSSNumericValue areaHeight, - final CSSNumericValue imageWidth, final CSSNumericValue imageHeight) + + static private double[] calcPaintSize(final CSSNumericValue areaWidth, final CSSNumericValue areaHeight, + final CSSNumericValue imageWidth, final CSSNumericValue imageHeight) { final double ratioX = areaWidth.getValue() / imageWidth.getValue(); final double ratioY = areaHeight.getValue() / imageHeight.getValue(); - final double ratioMin = Math.min( ratioX, ratioY ); + final double ratioMin = Math.min(ratioX, ratioY); double[] ret = new double[2]; ret[0] = imageWidth.getValue() * ratioMin; ret[1] = imageHeight.getValue() * ratioMin; return ret; } + protected void writeNullDate() throws IOException { // write NULL DATE diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/OleProducer.java b/reportbuilder/java/com/sun/star/report/pentaho/output/OleProducer.java index 36dffa290da1..66b0a0435b17 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/output/OleProducer.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/output/OleProducer.java @@ -49,7 +49,8 @@ import org.apache.commons.logging.LogFactory; * * @author Ocke Janssen */ -public class OleProducer { +public class OleProducer +{ private static final Log LOGGER = LogFactory.getLog(OleProducer.class); private final InputRepository inputRepository; @@ -59,13 +60,15 @@ public class OleProducer { private final ImageService imageService; private final Integer maxRows; - public OleProducer(final InputRepository inputRepository, - final OutputRepository outputRepository,final ImageService imageService,final DataSourceFactory dataSourceFactory,final Integer maxRows) { - if (inputRepository == null) { + final OutputRepository outputRepository, final ImageService imageService, final DataSourceFactory dataSourceFactory, final Integer maxRows) + { + if (inputRepository == null) + { throw new NullPointerException(); } - if (outputRepository == null) { + if (outputRepository == null) + { throw new NullPointerException(); } @@ -77,15 +80,18 @@ public class OleProducer { this.maxRows = maxRows; } - String produceOle(final String source,final List masterColumns,final List masterValues,final List detailColumns) { + String produceOle(final String source, final List masterColumns, final List masterValues, final List detailColumns) + { InputRepository subInputRepository = null; OutputRepository subOutputRepository = null; String output = ""; - try { + try + { subInputRepository = inputRepository.openInputRepository(source); output = nameGenerator.generateStorageName("Object", null); subOutputRepository = outputRepository.openOutputRepository(output, PentahoReportEngineMetaData.OPENDOCUMENT_CHART); - try { + try + { final PentahoReportEngine engine = new PentahoReportEngine(); final ReportJobDefinition definition = engine.createJobDefinition(); @@ -104,18 +110,27 @@ public class OleProducer { procParms.setProperty(ReportEngineParameterNames.MAXROWS, maxRows); engine.createJob(definition).execute(); - } catch (ReportExecutionException ex) { + } + catch (ReportExecutionException ex) + { LOGGER.error("ReportProcessing failed", ex); - } catch (IOException ex) { + } + catch (IOException ex) + { LOGGER.error("ReportProcessing failed", ex); } - } catch (IOException ex) { + } + catch (IOException ex) + { LOGGER.error("ReportProcessing failed", ex); - } finally { - if (subInputRepository != null) { + } finally + { + if (subInputRepository != null) + { subInputRepository.closeInputRepository(); } - if (subOutputRepository != null) { + if (subOutputRepository != null) + { subOutputRepository.closeOutputRepository(); } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/StyleUtilities.java b/reportbuilder/java/com/sun/star/report/pentaho/output/StyleUtilities.java index 948e140f76ff..4bccca1e9612 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/output/StyleUtilities.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/output/StyleUtilities.java @@ -55,6 +55,7 @@ import org.apache.commons.logging.LogFactory; */ public class StyleUtilities { + private static final Log LOGGER = LogFactory.getLog(StyleUtilities.class); private static final String STYLE = "style"; @@ -117,8 +118,7 @@ public class StyleUtilities } inheritanceTracker.add(styleName); - if (stylesCollection.containsStyle(styleFamily, styleName) || - commonCollection.getCommonStyles().containsStyle(styleFamily, styleName)) + if (stylesCollection.containsStyle(styleFamily, styleName) || commonCollection.getCommonStyles().containsStyle(styleFamily, styleName)) { // fine, there's already a copy of the stylesheet. return; @@ -193,7 +193,8 @@ public class StyleUtilities LOGGER.warn("Inconsistent styles: " + styleFamily + ":" + styleParent + " does not exist."); } return preStyle; - } catch (CloneNotSupportedException e) + } + catch (CloneNotSupportedException e) { throw new ReportProcessingException("Failed to derive a stylesheet", e); } @@ -248,7 +249,8 @@ public class StyleUtilities currentFonts.addFontFace((FontFaceElement) element.clone()); } } - } catch (CloneNotSupportedException e) + } + catch (CloneNotSupportedException e) { throw new ReportProcessingException("Failed to clone font-face element"); } @@ -264,12 +266,13 @@ public class StyleUtilities { try { - final Section styleMap = (Section) derivedStyle.findFirstChild(OfficeNamespaces.STYLE_NS,"map"); + final Section styleMap = (Section) derivedStyle.findFirstChild(OfficeNamespaces.STYLE_NS, "map"); if (styleMap != null) { performDataStyleProcessing(styleMap, stylesCollection, predefCollection, "apply-style-name"); } - } catch (Exception e) + } + catch (Exception e) { } } @@ -286,8 +289,7 @@ public class StyleUtilities if (attribute != null) { final String styleName = String.valueOf(attribute); - if (!stylesCollection.getAutomaticStyles().containsDataStyle(styleName) && - !stylesCollection.getCommonStyles().containsDataStyle(styleName)) + if (!stylesCollection.getAutomaticStyles().containsDataStyle(styleName) && !stylesCollection.getCommonStyles().containsDataStyle(styleName)) { try { @@ -313,7 +315,8 @@ public class StyleUtilities derivedStyle = null; } } - } catch (CloneNotSupportedException e) + } + catch (CloneNotSupportedException e) { throw new ReportProcessingException("Failed to copy style. This should not have happened."); } @@ -508,7 +511,8 @@ public class StyleUtilities predefCollection); } return autostyle; - } catch (CloneNotSupportedException e) + } + catch (CloneNotSupportedException e) { throw new ReportProcessingException( "Deriving the style failed. Clone error: ", e); diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/StylesWriter.java b/reportbuilder/java/com/sun/star/report/pentaho/output/StylesWriter.java index 4300d44defd3..24fb64d3b95e 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/output/StylesWriter.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/output/StylesWriter.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.output; import java.io.IOException; @@ -70,305 +68,319 @@ import org.pentaho.reporting.libraries.xmlns.writer.XmlWriterSupport; */ public class StylesWriter { - private final XmlWriter xmlWriter; - private final boolean writeOpeningTag; - - public StylesWriter(final Writer writer) - { - final DefaultTagDescription tagDescription = new DefaultTagDescription(); - tagDescription.configure (JFreeReportBoot.getInstance().getGlobalConfig(), - OfficeDocumentReportTarget.TAG_DEF_PREFIX); - - this.xmlWriter = new XmlWriter(writer, tagDescription); - this.xmlWriter.setAlwaysAddNamespace(true); - this.writeOpeningTag = true; - } - - public StylesWriter(final XmlWriter xmlWriter) - { - this.xmlWriter = xmlWriter; - this.writeOpeningTag = false; - } - - public void writeContentStyles (final OfficeStylesCollection predefined, - final OfficeStylesCollection globals) - throws IOException, ReportProcessingException - { - writeFontFaces(new OfficeStylesCollection[] { globals }); - writeAutomaticStylesSection(new OfficeStylesCollection[] { globals }); - } - - public void writeGlobalStyles (final OfficeStylesCollection predefined, - final OfficeStylesCollection globals) - throws IOException, ReportProcessingException - { - if (writeOpeningTag) - { - performWriteRootTag(); - } - writeFontFaces(new OfficeStylesCollection[] { globals }); - writeAutomaticStylesSection(new OfficeStylesCollection[] { globals }); - writeCommonStylesSection(new OfficeStylesCollection[] { globals }); - writeMasterStylesSection(new OfficeStylesCollection[] { globals }); + private final XmlWriter xmlWriter; + private final boolean writeOpeningTag; - if (writeOpeningTag) + public StylesWriter(final Writer writer) { - xmlWriter.writeCloseTag(); + final DefaultTagDescription tagDescription = new DefaultTagDescription(); + tagDescription.configure(JFreeReportBoot.getInstance().getGlobalConfig(), + OfficeDocumentReportTarget.TAG_DEF_PREFIX); + + this.xmlWriter = new XmlWriter(writer, tagDescription); + this.xmlWriter.setAlwaysAddNamespace(true); + this.writeOpeningTag = true; } - } - - private void writeMasterStylesSection(final OfficeStylesCollection[] osc) - throws IOException - { - xmlWriter.writeTag - (OfficeNamespaces.OFFICE_NS, "master-styles", XmlWriterSupport.OPEN); - for (int sci = 0; sci < osc.length; sci++) + + public StylesWriter(final XmlWriter xmlWriter) { - final OfficeStylesCollection collection = osc[sci]; - final OfficeMasterStyles officeStyles = collection.getMasterStyles(); - final OfficeMasterPage[] officeMasterPages = officeStyles.getAllMasterPages(); - for (int i = 0; i < officeMasterPages.length; i++) - { - final OfficeMasterPage masterPage = officeMasterPages[i]; - writeSection(masterPage); - } - - writeSectionChilds(officeStyles.getOtherNodes().getNodeArray()); + this.xmlWriter = xmlWriter; + this.writeOpeningTag = false; } - xmlWriter.writeCloseTag(); - } - - private void writeCommonStylesSection(final OfficeStylesCollection[] osc) - throws IOException - { - xmlWriter.writeTag - (OfficeNamespaces.OFFICE_NS, "styles", XmlWriterSupport.OPEN); - - for (int sci = 0; sci < osc.length; sci++) + public void writeContentStyles(final OfficeStylesCollection predefined, + final OfficeStylesCollection globals) + throws IOException, ReportProcessingException { - final OfficeStylesCollection collection = osc[sci]; - final OfficeStyles officeStyles = collection.getCommonStyles(); - writeStyles(officeStyles); + writeFontFaces(new OfficeStylesCollection[] + { + globals + }); + writeAutomaticStylesSection(new OfficeStylesCollection[] + { + globals + }); } - xmlWriter.writeCloseTag(); - } - - private void writeAutomaticStylesSection(final OfficeStylesCollection[] osc) - throws IOException - { - xmlWriter.writeTag - (OfficeNamespaces.OFFICE_NS, "automatic-styles", XmlWriterSupport.OPEN); - for (int sci = 0; sci < osc.length; sci++) + public void writeGlobalStyles(final OfficeStylesCollection predefined, + final OfficeStylesCollection globals) + throws IOException, ReportProcessingException { - final OfficeStylesCollection collection = osc[sci]; - final OfficeStyles officeStyles = collection.getAutomaticStyles(); - writeStyles(officeStyles); + if (writeOpeningTag) + { + performWriteRootTag(); + } + + writeFontFaces(new OfficeStylesCollection[] + { + globals + }); + writeAutomaticStylesSection(new OfficeStylesCollection[] + { + globals + }); + writeCommonStylesSection(new OfficeStylesCollection[] + { + globals + }); + writeMasterStylesSection(new OfficeStylesCollection[] + { + globals + }); + + if (writeOpeningTag) + { + xmlWriter.writeCloseTag(); + } } - xmlWriter.writeCloseTag(); - } - - private void writeFontFaces(final OfficeStylesCollection[] osc) - throws IOException - { - xmlWriter.writeTag - (OfficeNamespaces.OFFICE_NS, "font-face-decls", XmlWriterSupport.OPEN); - - final TreeMap fontFaces = new TreeMap(); - for (int sci = 0; sci < osc.length; sci++) + private void writeMasterStylesSection(final OfficeStylesCollection[] osc) + throws IOException { - final OfficeStylesCollection collection = osc[sci]; - final FontFaceDeclsSection fontFaceDecls = collection.getFontFaceDecls(); - final FontFaceElement[] fontFaceElements = fontFaceDecls.getAllFontFaces(); - for (int i = 0; i < fontFaceElements.length; i++) - { - final FontFaceElement element = fontFaceElements[i]; - fontFaces.put (element.getStyleName(), element); - } + xmlWriter.writeTag(OfficeNamespaces.OFFICE_NS, "master-styles", XmlWriterSupport.OPEN); + for (int sci = 0; sci < osc.length; sci++) + { + final OfficeStylesCollection collection = osc[sci]; + final OfficeMasterStyles officeStyles = collection.getMasterStyles(); + final OfficeMasterPage[] officeMasterPages = officeStyles.getAllMasterPages(); + for (int i = 0; i < officeMasterPages.length; i++) + { + final OfficeMasterPage masterPage = officeMasterPages[i]; + writeSection(masterPage); + } + + writeSectionChilds(officeStyles.getOtherNodes().getNodeArray()); + } + + xmlWriter.writeCloseTag(); } - final Iterator values = fontFaces.values().iterator(); - while (values.hasNext()) + private void writeCommonStylesSection(final OfficeStylesCollection[] osc) + throws IOException { - final FontFaceElement element = (FontFaceElement) values.next(); - writeElement(element); - } + xmlWriter.writeTag(OfficeNamespaces.OFFICE_NS, "styles", XmlWriterSupport.OPEN); - xmlWriter.writeCloseTag(); - } + for (int sci = 0; sci < osc.length; sci++) + { + final OfficeStylesCollection collection = osc[sci]; + final OfficeStyles officeStyles = collection.getCommonStyles(); + writeStyles(officeStyles); + } - private void writeStyles (final OfficeStyles styles) - throws IOException - { - final OfficeStyle[] allStyles = styles.getAllStyles(); - for (int i = 0; i < allStyles.length; i++) - { - final OfficeStyle style = allStyles[i]; - writeSection(style); + xmlWriter.writeCloseTag(); } - final DataStyle[] allDataStyles = styles.getAllDataStyles(); - for (int i = 0; i < allDataStyles.length; i++) + private void writeAutomaticStylesSection(final OfficeStylesCollection[] osc) + throws IOException { - final DataStyle style = allDataStyles[i]; - writeSection(style); + xmlWriter.writeTag(OfficeNamespaces.OFFICE_NS, "automatic-styles", XmlWriterSupport.OPEN); + for (int sci = 0; sci < osc.length; sci++) + { + final OfficeStylesCollection collection = osc[sci]; + final OfficeStyles officeStyles = collection.getAutomaticStyles(); + writeStyles(officeStyles); + } + + xmlWriter.writeCloseTag(); } - final PageLayout[] allPageStyles = styles.getAllPageStyles(); - for (int i = 0; i < allPageStyles.length; i++) + private void writeFontFaces(final OfficeStylesCollection[] osc) + throws IOException { - final PageLayout style = allPageStyles[i]; - writeSection(style); + xmlWriter.writeTag(OfficeNamespaces.OFFICE_NS, "font-face-decls", XmlWriterSupport.OPEN); + + final TreeMap fontFaces = new TreeMap(); + for (int sci = 0; sci < osc.length; sci++) + { + final OfficeStylesCollection collection = osc[sci]; + final FontFaceDeclsSection fontFaceDecls = collection.getFontFaceDecls(); + final FontFaceElement[] fontFaceElements = fontFaceDecls.getAllFontFaces(); + for (int i = 0; i < fontFaceElements.length; i++) + { + final FontFaceElement element = fontFaceElements[i]; + fontFaces.put(element.getStyleName(), element); + } + } + + final Iterator values = fontFaces.values().iterator(); + while (values.hasNext()) + { + final FontFaceElement element = (FontFaceElement) values.next(); + writeElement(element); + } + + xmlWriter.writeCloseTag(); } - writeSectionChilds(styles.getOtherStyles()); - } - - private void writeElement (final Element element) - throws IOException - { - final String type = element.getType(); - final String namespace = element.getNamespace(); - final AttributeList attrList = buildAttributeList(element.getAttributeMap()); - xmlWriter.writeTag(namespace, type, attrList, XmlWriterSupport.CLOSE); - } - - private void writeSection (final Section section) - throws IOException - { - final String type = section.getType(); - final String namespace = section.getNamespace(); - final AttributeList attrList = buildAttributeList(section.getAttributeMap()); - if (section.getNodeCount() == 0) + private void writeStyles(final OfficeStyles styles) + throws IOException { - xmlWriter.writeTag(namespace, type, attrList, XmlWriterSupport.CLOSE); - return; + final OfficeStyle[] allStyles = styles.getAllStyles(); + for (int i = 0; i < allStyles.length; i++) + { + final OfficeStyle style = allStyles[i]; + writeSection(style); + } + + final DataStyle[] allDataStyles = styles.getAllDataStyles(); + for (int i = 0; i < allDataStyles.length; i++) + { + final DataStyle style = allDataStyles[i]; + writeSection(style); + } + + final PageLayout[] allPageStyles = styles.getAllPageStyles(); + for (int i = 0; i < allPageStyles.length; i++) + { + final PageLayout style = allPageStyles[i]; + writeSection(style); + } + + writeSectionChilds(styles.getOtherStyles()); } - xmlWriter.writeTag(namespace, type, attrList, XmlWriterSupport.OPEN); - writeSectionChilds(section.getNodeArray()); - - xmlWriter.writeCloseTag(); - } - - private void writeSectionChilds(final Node[] nodes) - throws IOException - { - for (int i = 0; i < nodes.length; i++) + private void writeElement(final Element element) + throws IOException { - final Node node = nodes[i]; - if (node instanceof Section) - { - writeSection((Section) node); - } - else if (node instanceof Element) - { - writeElement((Element) node); - } - else if (node instanceof RawText) - { - final RawText text = (RawText) node; - xmlWriter.writeText(text.getText()); - } - else if (node instanceof StaticText) - { - final StaticText text = (StaticText) node; - xmlWriter.writeTextNormalized(text.getText(), false); - } + final String type = element.getType(); + final String namespace = element.getNamespace(); + final AttributeList attrList = buildAttributeList(element.getAttributeMap()); + xmlWriter.writeTag(namespace, type, attrList, XmlWriterSupport.CLOSE); } - } - protected AttributeList buildAttributeList(final AttributeMap attrs) - { - final AttributeList attrList = new AttributeList(); - final String[] namespaces = attrs.getNameSpaces(); - for (int i = 0; i < namespaces.length; i++) + private void writeSection(final Section section) + throws IOException { - final String attrNamespace = namespaces[i]; - if (isFilteredNamespace(attrNamespace)) - { - continue; - } - - final Map localAttributes = attrs.getAttributes(attrNamespace); - final Iterator entries = localAttributes.entrySet().iterator(); - while (entries.hasNext()) - { - final Map.Entry entry = (Map.Entry) entries.next(); - final String key = String.valueOf(entry.getKey()); - attrList.setAttribute(attrNamespace, key, String.valueOf(entry.getValue())); - } + final String type = section.getType(); + final String namespace = section.getNamespace(); + final AttributeList attrList = buildAttributeList(section.getAttributeMap()); + if (section.getNodeCount() == 0) + { + xmlWriter.writeTag(namespace, type, attrList, XmlWriterSupport.CLOSE); + return; + } + + xmlWriter.writeTag(namespace, type, attrList, XmlWriterSupport.OPEN); + writeSectionChilds(section.getNodeArray()); + + xmlWriter.writeCloseTag(); } - return attrList; - } - protected boolean isFilteredNamespace(final String namespace) - { - if (Namespaces.LIBLAYOUT_NAMESPACE.equals(namespace)) + private void writeSectionChilds(final Node[] nodes) + throws IOException { - return true; + for (int i = 0; i < nodes.length; i++) + { + final Node node = nodes[i]; + if (node instanceof Section) + { + writeSection((Section) node); + } + else if (node instanceof Element) + { + writeElement((Element) node); + } + else if (node instanceof RawText) + { + final RawText text = (RawText) node; + xmlWriter.writeText(text.getText()); + } + else if (node instanceof StaticText) + { + final StaticText text = (StaticText) node; + xmlWriter.writeTextNormalized(text.getText(), false); + } + } } - if (JFreeReportInfo.REPORT_NAMESPACE.equals(namespace)) + + protected AttributeList buildAttributeList(final AttributeMap attrs) { - return true; + final AttributeList attrList = new AttributeList(); + final String[] namespaces = attrs.getNameSpaces(); + for (int i = 0; i < namespaces.length; i++) + { + final String attrNamespace = namespaces[i]; + if (isFilteredNamespace(attrNamespace)) + { + continue; + } + + final Map localAttributes = attrs.getAttributes(attrNamespace); + final Iterator entries = localAttributes.entrySet().iterator(); + while (entries.hasNext()) + { + final Map.Entry entry = (Map.Entry) entries.next(); + final String key = String.valueOf(entry.getKey()); + attrList.setAttribute(attrNamespace, key, String.valueOf(entry.getValue())); + } + } + return attrList; } - if (JFreeReportInfo.COMPATIBILITY_NAMESPACE.equals(namespace)) + + protected boolean isFilteredNamespace(final String namespace) { - return true; + if (Namespaces.LIBLAYOUT_NAMESPACE.equals(namespace)) + { + return true; + } + if (JFreeReportInfo.REPORT_NAMESPACE.equals(namespace)) + { + return true; + } + if (JFreeReportInfo.COMPATIBILITY_NAMESPACE.equals(namespace)) + { + return true; + } + if (OfficeNamespaces.OOREPORT_NS.equals(namespace)) + { + return true; + } + return false; } - if (OfficeNamespaces.OOREPORT_NS.equals(namespace)) + + private void performWriteRootTag() + throws IOException { - return true; + final AttributeList rootAttributes = new AttributeList(); + rootAttributes.addNamespaceDeclaration("office", + OfficeNamespaces.OFFICE_NS); + rootAttributes.addNamespaceDeclaration("style", OfficeNamespaces.STYLE_NS); + rootAttributes.addNamespaceDeclaration("text", OfficeNamespaces.TEXT_NS); + rootAttributes.addNamespaceDeclaration("table", OfficeNamespaces.TABLE_NS); + rootAttributes.addNamespaceDeclaration("draw", OfficeNamespaces.DRAWING_NS); + rootAttributes.addNamespaceDeclaration("fo", OfficeNamespaces.FO_NS); + rootAttributes.addNamespaceDeclaration("xlink", OfficeNamespaces.XLINK_NS); + rootAttributes.addNamespaceDeclaration("dc", OfficeNamespaces.PURL_NS); + rootAttributes.addNamespaceDeclaration("meta", OfficeNamespaces.META_NS); + rootAttributes.addNamespaceDeclaration("number", + OfficeNamespaces.DATASTYLE_NS); + rootAttributes.addNamespaceDeclaration("svg", OfficeNamespaces.SVG_NS); + rootAttributes.addNamespaceDeclaration("chart", OfficeNamespaces.CHART_NS); + rootAttributes.addNamespaceDeclaration("dr3d", OfficeNamespaces.DR3D_NS); + rootAttributes.addNamespaceDeclaration("math", OfficeNamespaces.MATHML_NS); + rootAttributes.addNamespaceDeclaration("form", OfficeNamespaces.FORM_NS); + rootAttributes.addNamespaceDeclaration("script", + OfficeNamespaces.SCRIPT_NS); + rootAttributes.addNamespaceDeclaration("ooo", OfficeNamespaces.OO2004_NS); + rootAttributes.addNamespaceDeclaration("ooow", OfficeNamespaces.OOW2004_NS); + rootAttributes.addNamespaceDeclaration("oooc", OfficeNamespaces.OOC2004_NS); + rootAttributes.addNamespaceDeclaration("dom", + OfficeNamespaces.XML_EVENT_NS); + rootAttributes.addNamespaceDeclaration("xforms", + OfficeNamespaces.XFORMS_NS); + rootAttributes.addNamespaceDeclaration("xsd", OfficeNamespaces.XSD_NS); + rootAttributes.addNamespaceDeclaration("xsi", OfficeNamespaces.XSI_NS); + rootAttributes.setAttribute(OfficeNamespaces.OFFICE_NS, "version", "1.0"); + + this.xmlWriter.writeXmlDeclaration("UTF-8"); + this.xmlWriter.writeTag(OfficeNamespaces.OFFICE_NS, + "document-content", rootAttributes, XmlWriterSupport.OPEN); } - return false; - } - - private void performWriteRootTag() - throws IOException - { - final AttributeList rootAttributes = new AttributeList(); - rootAttributes.addNamespaceDeclaration("office", - OfficeNamespaces.OFFICE_NS); - rootAttributes.addNamespaceDeclaration("style", OfficeNamespaces.STYLE_NS); - rootAttributes.addNamespaceDeclaration("text", OfficeNamespaces.TEXT_NS); - rootAttributes.addNamespaceDeclaration("table", OfficeNamespaces.TABLE_NS); - rootAttributes.addNamespaceDeclaration("draw", OfficeNamespaces.DRAWING_NS); - rootAttributes.addNamespaceDeclaration("fo", OfficeNamespaces.FO_NS); - rootAttributes.addNamespaceDeclaration("xlink", OfficeNamespaces.XLINK_NS); - rootAttributes.addNamespaceDeclaration("dc", OfficeNamespaces.PURL_NS); - rootAttributes.addNamespaceDeclaration("meta", OfficeNamespaces.META_NS); - rootAttributes.addNamespaceDeclaration("number", - OfficeNamespaces.DATASTYLE_NS); - rootAttributes.addNamespaceDeclaration("svg", OfficeNamespaces.SVG_NS); - rootAttributes.addNamespaceDeclaration("chart", OfficeNamespaces.CHART_NS); - rootAttributes.addNamespaceDeclaration("dr3d", OfficeNamespaces.DR3D_NS); - rootAttributes.addNamespaceDeclaration("math", OfficeNamespaces.MATHML_NS); - rootAttributes.addNamespaceDeclaration("form", OfficeNamespaces.FORM_NS); - rootAttributes.addNamespaceDeclaration("script", - OfficeNamespaces.SCRIPT_NS); - rootAttributes.addNamespaceDeclaration("ooo", OfficeNamespaces.OO2004_NS); - rootAttributes.addNamespaceDeclaration("ooow", OfficeNamespaces.OOW2004_NS); - rootAttributes.addNamespaceDeclaration("oooc", OfficeNamespaces.OOC2004_NS); - rootAttributes.addNamespaceDeclaration("dom", - OfficeNamespaces.XML_EVENT_NS); - rootAttributes.addNamespaceDeclaration("xforms", - OfficeNamespaces.XFORMS_NS); - rootAttributes.addNamespaceDeclaration("xsd", OfficeNamespaces.XSD_NS); - rootAttributes.addNamespaceDeclaration("xsi", OfficeNamespaces.XSI_NS); - rootAttributes.setAttribute(OfficeNamespaces.OFFICE_NS, "version", "1.0"); - - this.xmlWriter.writeXmlDeclaration("UTF-8"); - this.xmlWriter.writeTag(OfficeNamespaces.OFFICE_NS, - "document-content", rootAttributes, XmlWriterSupport.OPEN); - } - - public void close() - throws IOException - { - xmlWriter.close(); - } + public void close() + throws IOException + { + xmlWriter.close(); + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/chart/ChartRawReportTarget.java b/reportbuilder/java/com/sun/star/report/pentaho/output/chart/ChartRawReportTarget.java index 9328be4fd031..05e70d1e49e2 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/output/chart/ChartRawReportTarget.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/output/chart/ChartRawReportTarget.java @@ -138,21 +138,19 @@ public class ChartRawReportTarget extends OfficeDocumentReportTarget } catch (IOException e) { - throw new ReportProcessingException("Failed", e); + throw new ReportProcessingException(OfficeDocumentReportTarget.FAILED, e); } } } private boolean isFiltered(final String elementType) { - return OfficeToken.TABLE_HEADER_COLUMNS.equals(elementType) || - OfficeToken.TABLE_HEADER_ROWS.equals(elementType) || - OfficeToken.TABLE_COLUMNS.equals(elementType); + return OfficeToken.TABLE_HEADER_COLUMNS.equals(elementType) || OfficeToken.TABLE_HEADER_ROWS.equals(elementType) || OfficeToken.TABLE_COLUMNS.equals(elementType); } protected void endOther(final AttributeMap attrs) throws IOException, DataSourceException, ReportProcessingException { - if ( tableRowsStarted && getCurrentRole() == ROLE_TEMPLATE) + if (tableRowsStarted && getCurrentRole() == ROLE_TEMPLATE) { return; } @@ -163,8 +161,7 @@ public class ChartRawReportTarget extends OfficeDocumentReportTarget // if this is the report namespace, write out a table definition .. if (OfficeNamespaces.TABLE_NS.equals(namespace)) { - if (OfficeToken.TABLE.equals(elementType) || - OfficeToken.TABLE_ROWS.equals(elementType)) + if (OfficeToken.TABLE.equals(elementType) || OfficeToken.TABLE_ROWS.equals(elementType)) { return; } @@ -194,7 +191,7 @@ public class ChartRawReportTarget extends OfficeDocumentReportTarget public void processContent(final DataFlags value) throws DataSourceException, ReportProcessingException { - if ( !(tableRowsStarted && getCurrentRole() == ROLE_TEMPLATE)) + if (!(tableRowsStarted && getCurrentRole() == ROLE_TEMPLATE)) { super.processContent(value); } @@ -203,7 +200,7 @@ public class ChartRawReportTarget extends OfficeDocumentReportTarget private void processElement(final AttributeMap attrs, final String namespace, final String elementType) throws IOException, ReportProcessingException { - if ( tableRowsStarted && getCurrentRole() == ROLE_TEMPLATE) + if (tableRowsStarted && getCurrentRole() == ROLE_TEMPLATE) { return; } @@ -247,9 +244,10 @@ public class ChartRawReportTarget extends OfficeDocumentReportTarget final XmlWriter xmlWriter = getXmlWriter(); xmlWriter.writeTag(namespace, elementType, attrList, XmlWriter.OPEN); ++closeTags; - // System.out.println("elementType = " + elementType); + // System.out.println("elementType = " + elementType); } // ///////////////////////////////////////////////////////////////////////// + public void processText(final String text) throws DataSourceException, ReportProcessingException { if (inFilterElements && tableCount > 1) @@ -258,6 +256,7 @@ public class ChartRawReportTarget extends OfficeDocumentReportTarget } super.processText(text); } + public void endReport(final ReportStructureRoot report) throws DataSourceException, ReportProcessingException { @@ -281,7 +280,7 @@ public class ChartRawReportTarget extends OfficeDocumentReportTarget } catch (IOException ioe) { - throw new ReportProcessingException("Failed to write settings document",ioe); + throw new ReportProcessingException("Failed to write settings document", ioe); } } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportProcessor.java b/reportbuilder/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportProcessor.java index 268450de3b08..ddc644d52ef3 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportProcessor.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportProcessor.java @@ -115,7 +115,7 @@ public class SpreadsheetRawReportProcessor extends AbstractReportProcessor if (context instanceof ReportContextImpl) { final ReportContextImpl impl = (ReportContextImpl) context; - impl.setFormulaContext(new PentahoFormulaContext(impl.getFormulaContext(),job.getConfiguration())); + impl.setFormulaContext(new PentahoFormulaContext(impl.getFormulaContext(), job.getConfiguration())); } return context; } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportTarget.java b/reportbuilder/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportTarget.java index 3be3c523662e..01e5135c3613 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportTarget.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/output/spreadsheet/SpreadsheetRawReportTarget.java @@ -130,13 +130,13 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget public int compareTo(final Object arg0) { - if ( arg0.equals(this) ) + if (arg0.equals(this)) { return 0; } - if ( arg0 instanceof ColumnBoundary ) + if (arg0 instanceof ColumnBoundary) { - if ( boundary > ((ColumnBoundary) arg0).boundary ) + if (boundary > ((ColumnBoundary) arg0).boundary) { return 1; } @@ -150,11 +150,7 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget public boolean equals(final Object obj) { - if ( obj instanceof ColumnBoundary ) - { - return ((ColumnBoundary) obj).boundary == boundary; - } - return false; + return obj instanceof ColumnBoundary && ((ColumnBoundary) obj).boundary == boundary; } public int hashCode() @@ -164,7 +160,7 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget } } private String tableBackgroundColor; // null means transparent ... - private static final ColumnBoundary[] EMPTY_COLBOUNDS = new ColumnBoundary[ 0 ]; + private static final ColumnBoundary[] EMPTY_COLBOUNDS = new ColumnBoundary[0]; private boolean elementBoundaryCollectionPass; private boolean oleHandled; private final List columnBoundaryList; @@ -181,14 +177,14 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget final private List rowHeights; public SpreadsheetRawReportTarget(final ReportJob reportJob, - final ResourceManager resourceManager, - final ResourceKey baseResource, - final InputRepository inputRepository, - final OutputRepository outputRepository, - final String target, - final ImageService imageService, - final DataSourceFactory dataSourceFactory) - throws ReportProcessingException + final ResourceManager resourceManager, + final ResourceKey baseResource, + final InputRepository inputRepository, + final OutputRepository outputRepository, + final String target, + final ImageService imageService, + final DataSourceFactory dataSourceFactory) + throws ReportProcessingException { super(reportJob, resourceManager, baseResource, inputRepository, outputRepository, target, imageService, dataSourceFactory); columnBoundaryList = new ArrayList(); @@ -201,9 +197,9 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget public void startOther(final AttributeMap attrs) throws DataSourceException, ReportProcessingException { - if ( ReportTargetUtil.isElementOfType(JFreeReportInfo.REPORT_NAMESPACE, OfficeToken.OBJECT_OLE, attrs) ) + if (ReportTargetUtil.isElementOfType(JFreeReportInfo.REPORT_NAMESPACE, OfficeToken.OBJECT_OLE, attrs)) { - if ( isElementBoundaryCollectionPass() && getCurrentRole() != ROLE_TEMPLATE ) + if (isElementBoundaryCollectionPass() && getCurrentRole() != ROLE_TEMPLATE) { ole.add(attrs); } @@ -211,24 +207,24 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget return; } final String namespace = ReportTargetUtil.getNamespaceFromAttribute(attrs); - if ( isRepeatingSection() || isFilteredNamespace(namespace) ) + if (isRepeatingSection() || isFilteredNamespace(namespace)) { return; } final String elementType = ReportTargetUtil.getElemenTypeFromAttribute(attrs); - if ( OfficeNamespaces.TEXT_NS.equals(namespace) && OfficeToken.P.equals(elementType) && !paragraphHandled ) + if (OfficeNamespaces.TEXT_NS.equals(namespace) && OfficeToken.P.equals(elementType) && !paragraphHandled) { paragraphFound = true; return; } - if ( OfficeNamespaces.DRAWING_NS.equals(namespace) && OfficeToken.FRAME.equals(elementType) ) + if (OfficeNamespaces.DRAWING_NS.equals(namespace) && OfficeToken.FRAME.equals(elementType)) { - if ( isElementBoundaryCollectionPass() && getCurrentRole() != ROLE_TEMPLATE ) + if (isElementBoundaryCollectionPass() && getCurrentRole() != ROLE_TEMPLATE) { final LengthCalculator len = new LengthCalculator(); - for ( int i = 0; i < rowHeights.size(); i++ ) + for (int i = 0; i < rowHeights.size(); i++) { len.add((CSSNumericValue) rowHeights.get(i)); // val += ((CSSNumericValue)rowHeights.get(i)).getValue(); @@ -239,7 +235,7 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget rowHeights.add(currentRowHeight); attrs.setAttribute(OfficeNamespaces.DRAWING_NS, "z-index", String.valueOf(shapes.size())); final String y = (String) attrs.getAttribute(OfficeNamespaces.SVG_NS, "y"); - if ( y != null ) + if (y != null) { len.add(parseLength(y)); final CSSNumericValue currentY = len.getResult(); @@ -249,9 +245,9 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget } return; } - if ( oleHandled ) + if (oleHandled) { - if ( isElementBoundaryCollectionPass() && getCurrentRole() != ROLE_TEMPLATE ) + if (isElementBoundaryCollectionPass() && getCurrentRole() != ROLE_TEMPLATE) { ole.add(attrs); } @@ -259,14 +255,14 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget } // if this is the report namespace, write out a table definition .. - if ( OfficeNamespaces.TABLE_NS.equals(namespace) && OfficeToken.TABLE.equals(elementType) ) + if (OfficeNamespaces.TABLE_NS.equals(namespace) && OfficeToken.TABLE.equals(elementType)) { // whenever we see a new table, we increment our tableCounter // this is used to keep tracked of the boundary conditions per table tableCounter++; } - if ( isElementBoundaryCollectionPass() ) + if (isElementBoundaryCollectionPass()) { collectBoundaryForElement(attrs); } @@ -277,19 +273,16 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget { processElement(attrs, namespace, elementType); } - catch ( IOException e ) + catch (IOException e) { - throw new ReportProcessingException("Failed", e); + throw new ReportProcessingException(OfficeDocumentReportTarget.FAILED, e); } } } protected void startReportSection(final AttributeMap attrs, final int role) throws IOException, DataSourceException, ReportProcessingException { - if ( (role == OfficeDocumentReportTarget.ROLE_SPREADSHEET_PAGE_HEADER || - role == OfficeDocumentReportTarget.ROLE_SPREADSHEET_PAGE_FOOTER ) && - (!PageSection.isPrintWithReportHeader(attrs) || - !PageSection.isPrintWithReportFooter(attrs)) ) + if ((role == OfficeDocumentReportTarget.ROLE_SPREADSHEET_PAGE_HEADER || role == OfficeDocumentReportTarget.ROLE_SPREADSHEET_PAGE_FOOTER) && (!PageSection.isPrintWithReportHeader(attrs) || !PageSection.isPrintWithReportFooter(attrs))) { startBuffering(new OfficeStylesCollection(), true); } @@ -301,10 +294,7 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget protected void endReportSection(final AttributeMap attrs, final int role) throws IOException, DataSourceException, ReportProcessingException { - if ( (role == OfficeDocumentReportTarget.ROLE_SPREADSHEET_PAGE_HEADER || - role == OfficeDocumentReportTarget.ROLE_SPREADSHEET_PAGE_FOOTER) && - (!PageSection.isPrintWithReportHeader(attrs) || - !PageSection.isPrintWithReportFooter(attrs)) ) + if ((role == OfficeDocumentReportTarget.ROLE_SPREADSHEET_PAGE_HEADER || role == OfficeDocumentReportTarget.ROLE_SPREADSHEET_PAGE_FOOTER) && (!PageSection.isPrintWithReportHeader(attrs) || !PageSection.isPrintWithReportFooter(attrs))) { finishBuffering(); } @@ -316,7 +306,7 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget private void handleParagraph() { - if ( paragraphFound ) + if (paragraphFound) { try { @@ -325,7 +315,7 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget paragraphHandled = true; paragraphFound = false; } - catch ( IOException ex ) + catch (IOException ex) { LOGGER.error("ReportProcessing failed", ex); } @@ -333,25 +323,25 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget } private void processElement(final AttributeMap attrs, final String namespace, final String elementType) - throws IOException, ReportProcessingException + throws IOException, ReportProcessingException { final XmlWriter xmlWriter = getXmlWriter(); - if ( ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE, attrs) ) + if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE, attrs)) { // a new table means we must clear our "calculated" table boundary array cache boundariesForTableArray = null; final String tableStyle = (String) attrs.getAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME); - if ( tableStyle == null ) + if (tableStyle == null) { tableBackgroundColor = null; } else { final Object raw = StyleUtilities.queryStyle(getPredefinedStylesCollection(), OfficeToken.TABLE, tableStyle, - "table-properties", OfficeNamespaces.FO_NS, OfficeToken.BACKGROUND_COLOR); - if ( raw == null || TRANSPARENT.equals(raw) ) + "table-properties", OfficeNamespaces.FO_NS, OfficeToken.BACKGROUND_COLOR); + if (raw == null || TRANSPARENT.equals(raw)) { tableBackgroundColor = null; } @@ -363,29 +353,28 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget return; } - if ( ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_COLUMN, attrs) || - ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_COLUMNS, attrs) ) + if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_COLUMN, attrs) || ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_COLUMNS, attrs)) { return; } // covered-table-cell elements may appear in the input from row or column spans. In the event that we hit a // column-span we simply ignore these elements because we are going to adjust the span to fit the uniform table. - if ( ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.COVERED_TABLE_CELL, attrs) ) + if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.COVERED_TABLE_CELL, attrs)) { - if ( columnSpanCounter > 0 ) + if (columnSpanCounter > 0) { columnSpanCounter--; } - if ( columnSpanCounter == 0 ) + if (columnSpanCounter == 0) { // if we weren't expecting a covered-table-cell, let's use it, it's probably from a row-span columnCounter++; final int span = getColumnSpanForCell(tableCounter, columnCounter, 1); // use the calculated span for the column in the uniform table to create any additional covered-table-cell // elements - for ( int i = 0; i < span; i++ ) + for (int i = 0; i < span; i++) { xmlWriter.writeTag(namespace, OfficeToken.COVERED_TABLE_CELL, null, XmlWriter.CLOSE); } @@ -393,17 +382,17 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget return; } - if ( ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_ROW, attrs) ) + if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_ROW, attrs)) { // a new row means our column counter gets reset columnCounter = 0; // Lets make sure the color of the table is ok .. - if ( tableBackgroundColor != null ) + if (tableBackgroundColor != null) { final String styleName = (String) attrs.getAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME); final OfficeStyle style = deriveStyle(OfficeToken.TABLE_ROW, styleName); Element tableRowProperties = style.getTableRowProperties(); - if ( tableRowProperties == null ) + if (tableRowProperties == null) { tableRowProperties = new Section(); tableRowProperties.setNamespace(OfficeNamespaces.STYLE_NS); @@ -414,7 +403,7 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget else { final Object oldValue = tableRowProperties.getAttribute(OfficeNamespaces.FO_NS, OfficeToken.BACKGROUND_COLOR); - if ( oldValue == null || TRANSPARENT.equals(oldValue) ) + if (oldValue == null || TRANSPARENT.equals(oldValue)) { tableRowProperties.setAttribute(OfficeNamespaces.FO_NS, OfficeToken.BACKGROUND_COLOR, tableBackgroundColor); } @@ -422,33 +411,33 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget attrs.setAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME, style.getStyleName()); } } - else if ( ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_CELL, attrs) ) + else if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_CELL, attrs)) { columnCounter++; final String styleName = (String) attrs.getAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME); - if ( styleName != null ) + if (styleName != null) { final OfficeStyle cellStyle = getPredefinedStylesCollection().getStyle(OfficeToken.TABLE_CELL, styleName); - if ( cellStyle != null ) + if (cellStyle != null) { final Section textProperties = (Section) cellStyle.getTextProperties(); - if ( textProperties != null ) + if (textProperties != null) { - for ( String i : FOPROPS ) + for (String i : FOPROPS) { textProperties.setAttribute(OfficeNamespaces.FO_NS, i, null); } textProperties.setAttribute(OfficeNamespaces.TEXT_NS, "display", null); - for ( String i : STYLEPROPS ) + for (String i : STYLEPROPS) { textProperties.setAttribute(OfficeNamespaces.STYLE_NS, i, null); } } final Section props = (Section) cellStyle.getTableCellProperties(); - if ( props != null ) + if (props != null) { final Object raw = props.getAttribute(OfficeNamespaces.FO_NS, OfficeToken.BACKGROUND_COLOR); - if ( TRANSPARENT.equals(raw) ) + if (TRANSPARENT.equals(raw)) { props.setAttribute(OfficeNamespaces.FO_NS, OfficeToken.BACKGROUND_COLOR, null); // cellStyle.removeNode(props); @@ -458,15 +447,15 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget attrs.setAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME, styleName); } - final String numColSpanStr = (String) attrs.getAttribute(namespace,NUMBERCOLUMNSSPANNED); + final String numColSpanStr = (String) attrs.getAttribute(namespace, NUMBERCOLUMNSSPANNED); int initialColumnSpan = columnSpanCounter = 1; - if ( numColSpanStr != null ) + if (numColSpanStr != null) { initialColumnSpan = Integer.parseInt(numColSpanStr); columnSpanCounter = initialColumnSpan; } final int span = getColumnSpanForCell(tableCounter, columnCounter, initialColumnSpan); - if ( initialColumnSpan > 1 ) + if (initialColumnSpan > 1) { // add the initial column span to our column counter index (subtract 1, since it is counted by default) columnCounter += initialColumnSpan - 1; @@ -486,9 +475,9 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget // } // there's no point to create number-columns-spanned attributes if we only span 1 column - if ( span > 1 ) + if (span > 1) { - attrs.setAttribute(namespace,NUMBERCOLUMNSSPANNED, "" + span); + attrs.setAttribute(namespace, NUMBERCOLUMNSSPANNED, "" + span); currentSpan = span; } // we must also generate "covered-table-cell" elements for each column spanned @@ -506,22 +495,22 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget private void collectBoundaryForElement(final AttributeMap attrs) { - if ( ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_COLUMNS, attrs) ) + if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_COLUMNS, attrs)) { // A table row resets the column counter. resetCurrentRowBoundaryMarker(); } - else if ( ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_COLUMN, attrs) ) + else if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_COLUMN, attrs)) { final String styleName = (String) attrs.getAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME); - if ( styleName == null ) + if (styleName == null) { // This should not happen, but if it does, we will ignore that cell. return; } final OfficeStyle style = getPredefinedStylesCollection().getStyle(OfficeToken.TABLE_COLUMN, styleName); - if ( style == null ) + if (style == null) { // Now this is very bad. It means that there is no style defined with the given name. return; @@ -535,7 +524,7 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget ColumnBoundary currentRowBoundary = new ColumnBoundary(getCurrentRowBoundaryMarker()); final List columnBoundaryList_ = getColumnBoundaryList(); final int idx = columnBoundaryList_.indexOf(currentRowBoundary); - if ( idx == -1 ) + if (idx == -1) { columnBoundaryList_.add(currentRowBoundary); } @@ -549,9 +538,9 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget private String getUnitsOfMeasure(final String str) { - if ( unitsOfMeasure == null || "".equals(unitsOfMeasure) ) + if (unitsOfMeasure == null || "".equals(unitsOfMeasure)) { - if ( str == null || "".equals(str) ) + if (str == null || "".equals(str)) { unitsOfMeasure = "cm"; return unitsOfMeasure; @@ -559,10 +548,10 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget // build units of measure, set it int i = str.length() - 1; - for ( ; i >= 0; i-- ) + for (; i >= 0; i--) { final char c = str.charAt(i); - if ( Character.isDigit(c) || c == '.' || c == ',' ) + if (Character.isDigit(c) || c == '.' || c == ',') { break; } @@ -574,7 +563,7 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget private void createTableShapes() throws ReportProcessingException { - if ( !shapes.isEmpty() ) + if (!shapes.isEmpty()) { try { @@ -587,7 +576,7 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget xmlWriter.writeTag(OfficeNamespaces.TABLE_NS, OfficeToken.SHAPES, null, XmlWriterSupport.OPEN); - for ( int i = 0; i < shapes.size(); i++ ) + for (int i = 0; i < shapes.size(); i++) { final AttributeMap attrs = (AttributeMap) shapes.get(i); final AttributeList attrList = buildAttributeList(attrs); @@ -599,9 +588,9 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget } xmlWriter.writeCloseTag(); } - catch ( IOException e ) + catch (IOException e) { - throw new ReportProcessingException("Failed", e); + throw new ReportProcessingException(OfficeDocumentReportTarget.FAILED, e); } } } @@ -622,11 +611,11 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget // blow away current column styles // start processing at i=1 because we added a boundary for "0" which is virtual final ColumnBoundary[] cba = getSortedColumnBoundaryArray(); - for ( int i = 1; i < cba.length; i++ ) + for (int i = 1; i < cba.length; i++) { final ColumnBoundary cb = cba[i]; float columnWidth = cb.getBoundary(); - if ( i > 1 ) + if (i > 1) { columnWidth -= cba[i - 1].getBoundary(); } @@ -644,54 +633,51 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget } xmlWriter.writeCloseTag(); } - catch ( IOException e ) + catch (IOException e) { - throw new ReportProcessingException("Failed", e); + throw new ReportProcessingException(OfficeDocumentReportTarget.FAILED, e); } } protected void endOther(final AttributeMap attrs) throws DataSourceException, ReportProcessingException { - if ( ReportTargetUtil.isElementOfType(JFreeReportInfo.REPORT_NAMESPACE, OfficeToken.OBJECT_OLE, attrs) || oleHandled ) + if (ReportTargetUtil.isElementOfType(JFreeReportInfo.REPORT_NAMESPACE, OfficeToken.OBJECT_OLE, attrs) || oleHandled) { oleHandled = false; return; } - if ( ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_ROW, attrs) && isElementBoundaryCollectionPass() && getCurrentRole() != ROLE_TEMPLATE ) + if (ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_ROW, attrs) && isElementBoundaryCollectionPass() && getCurrentRole() != ROLE_TEMPLATE) { final String styleName = (String) attrs.getAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME); rowHeights.add(computeRowHeight(styleName)); } - if ( isRepeatingSection() || isElementBoundaryCollectionPass() ) + if (isRepeatingSection() || isElementBoundaryCollectionPass()) { return; } final String namespace = ReportTargetUtil.getNamespaceFromAttribute(attrs); - if ( isFilteredNamespace(namespace) ) + if (isFilteredNamespace(namespace)) { return; } final String elementType = ReportTargetUtil.getElemenTypeFromAttribute(attrs); - if ( OfficeNamespaces.DRAWING_NS.equals(namespace) && OfficeToken.FRAME.equals(elementType) ) + if (OfficeNamespaces.DRAWING_NS.equals(namespace) && OfficeToken.FRAME.equals(elementType)) { return; } // if this is the report namespace, write out a table definition .. - if ( OfficeNamespaces.TABLE_NS.equals(namespace) && (OfficeToken.TABLE.equals(elementType) || - OfficeToken.COVERED_TABLE_CELL.equals(elementType) || - OfficeToken.TABLE_COLUMN.equals(elementType) || - OfficeToken.TABLE_COLUMNS.equals(elementType)) ) + if (OfficeNamespaces.TABLE_NS.equals(namespace) && (OfficeToken.TABLE.equals(elementType) || OfficeToken.COVERED_TABLE_CELL.equals(elementType) || OfficeToken.TABLE_COLUMN.equals(elementType) || OfficeToken.TABLE_COLUMNS.equals(elementType))) { return; } - if ( !paragraphHandled && OfficeNamespaces.TEXT_NS.equals(namespace) && OfficeToken.P.equals(elementType) ) + if (!paragraphHandled && OfficeNamespaces.TEXT_NS.equals(namespace) && OfficeToken.P.equals(elementType)) { - if ( !paragraphHandled ) + if (!paragraphHandled) { return; } @@ -706,15 +692,15 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget // 'covered-table-cell' elements we need to generate generateCoveredTableCells(attrs); } - catch ( IOException e ) + catch (IOException e) { - throw new ReportProcessingException("Failed", e); + throw new ReportProcessingException(OfficeDocumentReportTarget.FAILED, e); } } private void generateCoveredTableCells(final AttributeMap attrs) throws IOException { - if ( !ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_CELL, attrs) ) + if (!ReportTargetUtil.isElementOfType(OfficeNamespaces.TABLE_NS, OfficeToken.TABLE_CELL, attrs)) { return; } @@ -725,7 +711,7 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget // final int span = TextUtilities.parseInt((String) attribute, 0); final int span = currentSpan; currentSpan = 0; - for ( int i = 1; i < span; i++ ) + for (int i = 1; i < span; i++) { xmlWriter.writeTag(OfficeNamespaces.TABLE_NS, OfficeToken.COVERED_TABLE_CELL, null, XmlWriter.CLOSE); } @@ -739,7 +725,7 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget // ///////////////////////////////////////////////////////////////////////// public void processText(final String text) throws DataSourceException, ReportProcessingException { - if ( !(isRepeatingSection() || isElementBoundaryCollectionPass()) ) + if (!(isRepeatingSection() || isElementBoundaryCollectionPass())) { handleParagraph(); super.processText(text); @@ -748,7 +734,7 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget public void processContent(final DataFlags value) throws DataSourceException, ReportProcessingException { - if ( !(isRepeatingSection() || isElementBoundaryCollectionPass()) ) + if (!(isRepeatingSection() || isElementBoundaryCollectionPass())) { handleParagraph(); super.processContent(value); @@ -761,9 +747,9 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget } protected void startContent(final AttributeMap attrs) throws IOException, DataSourceException, - ReportProcessingException + ReportProcessingException { - if ( !isElementBoundaryCollectionPass() ) + if (!isElementBoundaryCollectionPass()) { final XmlWriter xmlWriter = getXmlWriter(); xmlWriter.writeTag(OfficeNamespaces.OFFICE_NS, getStartContent(), null, XmlWriterSupport.OPEN); @@ -788,7 +774,7 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget { final OfficeStylesCollection predefStyles = getPredefinedStylesCollection(); final OfficeStyles commonStyles = predefStyles.getAutomaticStyles(); - if ( !commonStyles.containsStyle(OfficeToken.TABLE, "Initial_Table") ) + if (!commonStyles.containsStyle(OfficeToken.TABLE, "Initial_Table")) { final String masterPageName = createMasterPage(); @@ -797,7 +783,7 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget tableStyle.setStyleName("Initial_Table"); tableStyle.setAttribute(OfficeNamespaces.STYLE_NS, "master-page-name", masterPageName); final Element tableProperties = produceFirstChild(tableStyle, OfficeNamespaces.STYLE_NS, "table-properties"); - tableProperties.setAttribute(OfficeNamespaces.FO_NS, OfficeToken.BACKGROUND_COLOR,TRANSPARENT); + tableProperties.setAttribute(OfficeNamespaces.FO_NS, OfficeToken.BACKGROUND_COLOR, TRANSPARENT); commonStyles.addStyle(tableStyle); } return "Initial_Table"; @@ -808,13 +794,13 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget final OfficeStylesCollection predefStyles = getPredefinedStylesCollection(); final MasterPageFactory masterPageFactory = new MasterPageFactory(predefStyles.getMasterStyles()); final OfficeMasterPage masterPage; - if ( !masterPageFactory.containsMasterPage("Standard", null, null) ) + if (!masterPageFactory.containsMasterPage("Standard", null, null)) { masterPage = masterPageFactory.createMasterPage("Standard", null, null); final CSSNumericValue zeroLength = CSSNumericValue.createValue(CSSNumericType.CM, 0); final String pageLayoutTemplate = masterPage.getPageLayout(); - if ( pageLayoutTemplate == null ) + if (pageLayoutTemplate == null) { // there is no pagelayout. Create one .. final String derivedLayout = masterPageFactory.createPageStyle(getGlobalStylesCollection().getAutomaticStyles(), zeroLength, zeroLength); @@ -823,8 +809,8 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget else { final String derivedLayout = masterPageFactory.derivePageStyle(pageLayoutTemplate, - getPredefinedStylesCollection().getAutomaticStyles(), - getGlobalStylesCollection().getAutomaticStyles(), zeroLength, zeroLength); + getPredefinedStylesCollection().getAutomaticStyles(), + getGlobalStylesCollection().getAutomaticStyles(), zeroLength, zeroLength); masterPage.setPageLayout(derivedLayout); } @@ -840,10 +826,10 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget } protected void endContent(final AttributeMap attrs) throws IOException, DataSourceException, - ReportProcessingException + ReportProcessingException { // todo - if ( !isElementBoundaryCollectionPass() ) + if (!isElementBoundaryCollectionPass()) { final XmlWriter xmlWriter = getXmlWriter(); xmlWriter.writeCloseTag(); @@ -871,10 +857,10 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget private ColumnBoundary[] getSortedColumnBoundaryArray() { - if ( sortedBoundaryArray == null ) + if (sortedBoundaryArray == null) { getColumnBoundaryList().add(new ColumnBoundary(0)); - sortedBoundaryArray = (ColumnBoundary[]) getColumnBoundaryList().toArray(EMPTY_COLBOUNDS); + sortedBoundaryArray = (ColumnBoundary[]) getColumnBoundaryList().toArray(new ColumnBoundary[getColumnBoundaryList().size()]); Arrays.sort(sortedBoundaryArray); } return sortedBoundaryArray; @@ -907,19 +893,19 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget private ColumnBoundary[] getBoundariesForTable(final int table) { - if ( boundariesForTableArray == null ) + if (boundariesForTableArray == null) { final List boundariesForTable = new ArrayList(); final List boundaryList = getColumnBoundaryList(); - for ( int i = 0; i < boundaryList.size(); i++ ) + for (int i = 0; i < boundaryList.size(); i++) { final ColumnBoundary b = (ColumnBoundary) boundaryList.get(i); - if ( b.isContainedByTable(table) ) + if (b.isContainedByTable(table)) { boundariesForTable.add(b); } } - boundariesForTableArray = (ColumnBoundary[]) boundariesForTable.toArray(EMPTY_COLBOUNDS); + boundariesForTableArray = (ColumnBoundary[]) boundariesForTable.toArray(new ColumnBoundary[boundariesForTable.size()]); Arrays.sort(boundariesForTableArray); } return boundariesForTableArray; @@ -935,12 +921,12 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget float cellBoundary = tableBoundaries[col - 1].getBoundary(); float cellWidth = tableBoundaries[col - 1].getBoundary(); - if ( col > 1 ) + if (col > 1) { cellWidth = cellWidth - tableBoundaries[col - 2].getBoundary(); } - if ( initialColumnSpan > 1 ) + if (initialColumnSpan > 1) { // ok we've got some additional spanning specified on the input final int index = (col - 1) + (initialColumnSpan - 1); @@ -950,21 +936,21 @@ public class SpreadsheetRawReportTarget extends OfficeDocumentReportTarget int beginBoundaryIndex = 0; int endBoundaryIndex = globalBoundaries.length - 1; - for ( int i = 0; i < globalBoundaries.length; i++ ) + for (int i = 0; i < globalBoundaries.length; i++) { // find beginning boundary - if ( globalBoundaries[i].getBoundary() <= cellBoundary - cellWidth ) + if (globalBoundaries[i].getBoundary() <= cellBoundary - cellWidth) { beginBoundaryIndex = i; } - if ( globalBoundaries[i].getBoundary() <= cellBoundary ) + if (globalBoundaries[i].getBoundary() <= cellBoundary) { endBoundaryIndex = i; } } final int span = endBoundaryIndex - beginBoundaryIndex; // span will be zero for the first column, so we adjust it to 1 - if ( span == 0 ) + if (span == 0) { return 1; } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/text/MasterPageFactory.java b/reportbuilder/java/com/sun/star/report/pentaho/output/text/MasterPageFactory.java index 0a5988a44b94..ca3047a16c16 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/output/text/MasterPageFactory.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/output/text/MasterPageFactory.java @@ -178,13 +178,9 @@ public class MasterPageFactory { return false; } - if (templateName != null ? !templateName.equals( - key.templateName) : key.templateName != null) - { - return false; - } + return !(templateName != null ? !templateName.equals( + key.templateName) : key.templateName != null); - return true; } public int hashCode() @@ -196,7 +192,6 @@ public class MasterPageFactory return result; } } - // todo: Patch the page-layout ... private static final String DEFAULT_PAGE_NAME = "Default"; private final OfficeMasterStyles predefinedStyles; @@ -265,7 +260,7 @@ public class MasterPageFactory } catch (CloneNotSupportedException cne) { - throw new IllegalStateException("Implementation error: Unable to derive page",cne); + throw new IllegalStateException("Implementation error: Unable to derive page", cne); } } @@ -403,7 +398,7 @@ public class MasterPageFactory } catch (CloneNotSupportedException e) { - throw new IllegalStateException("Clone failed.",e); + throw new IllegalStateException("Clone failed.", e); } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/text/PageContext.java b/reportbuilder/java/com/sun/star/report/pentaho/output/text/PageContext.java index 88c2742c91d5..740582c9b347 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/output/text/PageContext.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/output/text/PageContext.java @@ -75,7 +75,7 @@ public class PageContext // TODO: IS this code correct? Why not columnCount = pc.getColumnCount(); ? if (columnCount != null) { - return columnCount.intValue(); + return columnCount; } pc = pc.getParent(); } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/text/TextRawReportProcessor.java b/reportbuilder/java/com/sun/star/report/pentaho/output/text/TextRawReportProcessor.java index 16374193aec8..3b23ffb4c3df 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/output/text/TextRawReportProcessor.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/output/text/TextRawReportProcessor.java @@ -108,7 +108,7 @@ public class TextRawReportProcessor extends SinglePassReportProcessor if (context instanceof ReportContextImpl) { final ReportContextImpl impl = (ReportContextImpl) context; - impl.setFormulaContext(new PentahoFormulaContext(impl.getFormulaContext(),job.getConfiguration())); + impl.setFormulaContext(new PentahoFormulaContext(impl.getFormulaContext(), job.getConfiguration())); } return context; } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/output/text/TextRawReportTarget.java b/reportbuilder/java/com/sun/star/report/pentaho/output/text/TextRawReportTarget.java index cdbb36abc337..947087a17c11 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/output/text/TextRawReportTarget.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/output/text/TextRawReportTarget.java @@ -100,7 +100,6 @@ public class TextRawReportTarget extends OfficeDocumentReportTarget private static final int CP_SETUP = 0; private static final int CP_FIRST_TABLE = 1; private static final int CP_NEXT_TABLE = 2; - // This is the initial state of the detail-band processing. It states, that we are now waiting for a // detail-band to be printed. private static final int DETAIL_SECTION_WAIT = 0; @@ -166,11 +165,7 @@ public class TextRawReportTarget extends OfficeDocumentReportTarget private boolean isResetPageNumber() { - if (pageBreakDefinition == null) - { - return false; - } - return pageBreakDefinition.isResetPageNumber(); + return pageBreakDefinition != null && pageBreakDefinition.isResetPageNumber(); } /** @@ -198,14 +193,7 @@ public class TextRawReportTarget extends OfficeDocumentReportTarget } final boolean keepWithNext; - if (keepTogetherState == PageContext.KEEP_TOGETHER_FIRST_DETAIL) - { - keepWithNext = (detailBandProcessingState == DETAIL_SECTION_WAIT); - } - else - { - keepWithNext = false; - } + keepWithNext = keepTogetherState == PageContext.KEEP_TOGETHER_FIRST_DETAIL && (detailBandProcessingState == DETAIL_SECTION_WAIT); return keepWithNext; } @@ -213,15 +201,7 @@ public class TextRawReportTarget extends OfficeDocumentReportTarget { final Object forceNewPage = attrs.getAttribute(OfficeNamespaces.OOREPORT_NS, "force-new-page"); - if ("after-section".equals(forceNewPage)) - { - return true; - } - if ("before-after-section".equals(forceNewPage)) - { - return true; - } - return false; + return "after-section".equals(forceNewPage) || "before-after-section".equals(forceNewPage); } private boolean isSectionPagebreakBefore(final AttributeMap attrs) @@ -268,8 +248,7 @@ public class TextRawReportTarget extends OfficeDocumentReportTarget } final String masterPageName; - if (currentMasterPage == null || - !masterPageFactory.containsMasterPage(STANDARD, activePageHeader, activePageFooter)) + if (currentMasterPage == null || !masterPageFactory.containsMasterPage(STANDARD, activePageHeader, activePageFooter)) { final CSSNumericValue headerSize = context.getAllHeaderSize(); @@ -325,8 +304,7 @@ public class TextRawReportTarget extends OfficeDocumentReportTarget // report header, then this implies that we have to insert a manual // pagebreak at the end of the section. - if ((!printHeader && context.getHeader() != null) || - (!printFooter && context.getFooter() != null)) + if ((!printHeader && context.getHeader() != null) || (!printFooter && context.getFooter() != null)) { setPagebreakDefinition(new PageBreakDefinition(isResetPageNumber())); } @@ -577,15 +555,13 @@ public class TextRawReportTarget extends OfficeDocumentReportTarget } else if (isFilteredNamespace(namespace)) { - throw new IllegalStateException("This element should be hidden: " + - namespace + ", " + elementType); + throw new IllegalStateException("This element should be hidden: " + namespace + ", " + elementType); } if (isTableMergeActive() && detailBandProcessingState == DETAIL_SECTION_OTHER_PRINTED && ObjectUtilities.equal(OfficeNamespaces.TABLE_NS, namespace) && ObjectUtilities.equal(OfficeToken.TABLE_COLUMNS, elementType)) { // Skip the columns section if the tables get merged.. startBuffering(getStylesCollection(), true); - return; } else { @@ -624,8 +600,8 @@ public class TextRawReportTarget extends OfficeDocumentReportTarget final String varType = (String) attrs.getAttribute(OfficeNamespaces.OFFICE_NS, FormatValueUtility.VALUE_TYPE); final String newVarName = variablesDeclarations.produceVariable(varName, varType); attrs.setAttribute(OfficeNamespaces.TEXT_NS, NAME, newVarName); - // this one must not be written, as the DTD does not declare it. - // attrs.setAttribute(OfficeNamespaces.OFFICE_NS, FormatValueUtility.VALUE_TYPE, null); + // this one must not be written, as the DTD does not declare it. + // attrs.setAttribute(OfficeNamespaces.OFFICE_NS, FormatValueUtility.VALUE_TYPE, null); } } @@ -724,7 +700,7 @@ public class TextRawReportTarget extends OfficeDocumentReportTarget graphicProperties.setAttribute(OfficeNamespaces.STYLE_NS, "flow-with-text", "false"); graphicProperties.setAttribute(OfficeNamespaces.DRAWING_NS, "ole-draw-aspect", "1"); - // attrs.setAttribute(OfficeNamespaces.DRAWING_NS, OfficeToken.STYLE_NAME, predefAutoStyle.getStyleName()); + // attrs.setAttribute(OfficeNamespaces.DRAWING_NS, OfficeToken.STYLE_NAME, predefAutoStyle.getStyleName()); } } @@ -734,11 +710,10 @@ public class TextRawReportTarget extends OfficeDocumentReportTarget final AttributeList attrList = buildAttributeList(attrs); xmlWriter.writeTag(namespace, elementType, attrList, XmlWriterSupport.OPEN); - if ( tableLayoutConfig != TABLE_LAYOUT_VARIABLES_PARAGRAPH + if (tableLayoutConfig != TABLE_LAYOUT_VARIABLES_PARAGRAPH && variables != null && !isRepeatingSection() - && ReportTargetUtil.isElementOfType(OfficeNamespaces.TEXT_NS, OfficeToken.P, attrs) - ) + && ReportTargetUtil.isElementOfType(OfficeNamespaces.TEXT_NS, OfficeToken.P, attrs)) { //LOGGER.debug("Variables-Section in existing cell " + variables); xmlWriter.writeText(variables); @@ -785,7 +760,7 @@ public class TextRawReportTarget extends OfficeDocumentReportTarget } else { - expectedTableRowCount = trc.intValue(); + expectedTableRowCount = trc; } if (isSectionPagebreakBefore(attrs)) @@ -822,16 +797,15 @@ public class TextRawReportTarget extends OfficeDocumentReportTarget // If we have a manual pagebreak, then activate the current master-page again. masterPageName = currentMasterPage.getStyleName(); } - // But we skip this (and therefore the resulting pagebreak) if there is no manual break - // and no other condition that would force an break. + // But we skip this (and therefore the resulting pagebreak) if there is no manual break + // and no other condition that would force an break. } else if (currentRole == OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_HEADER || currentRole == OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_FOOTER) { breakDefinition = null; - // no pagebreaks .. + // no pagebreaks .. } - else if (currentMasterPage == null || - isPagebreakPending()) + else if (currentMasterPage == null || isPagebreakPending()) { // Must be the first table, as we have no master-page yet. masterPageName = createMasterPage(true, true); @@ -848,9 +822,7 @@ public class TextRawReportTarget extends OfficeDocumentReportTarget breakDefinition = null; } } - else if (isPagebreakPending() && - currentRole != OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_HEADER && - currentRole != OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_FOOTER) + else if (isPagebreakPending() && currentRole != OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_HEADER && currentRole != OfficeDocumentReportTarget.ROLE_REPEATING_GROUP_FOOTER) { // Derive an automatic style for the pagebreak. // LOGGER.debug("Manual pagebreak (within the section): " + getCurrentRole()); @@ -869,8 +841,7 @@ public class TextRawReportTarget extends OfficeDocumentReportTarget } final XmlWriter xmlWriter = getXmlWriter(); - if (detailBandProcessingState == DETAIL_SECTION_OTHER_PRINTED && - masterPageName != null) + if (detailBandProcessingState == DETAIL_SECTION_OTHER_PRINTED && masterPageName != null) { // close the last table-tag, we will open a new one xmlWriter.writeCloseTag(); @@ -903,7 +874,7 @@ public class TextRawReportTarget extends OfficeDocumentReportTarget xmlWriter.writeTag(OfficeNamespaces.TEXT_NS, OfficeToken.P, OfficeToken.STYLE_NAME, style.getStyleName(), XmlWriterSupport.OPEN); masterPageName = null; - //breakDefinition = null; + //breakDefinition = null; } else if (isColumnBreakPending()) { @@ -935,19 +906,10 @@ public class TextRawReportTarget extends OfficeDocumentReportTarget final boolean keepWithNext = isKeepTableWithNext(); final boolean localKeepTogether = OfficeToken.TRUE.equals(attrs.getAttribute(OfficeNamespaces.OOREPORT_NS, KEEP_TOGETHER)); final boolean tableMergeActive = isTableMergeActive(); - if (tableMergeActive) - { - this.sectionKeepTogether = localKeepTogether; - } - else - { - this.sectionKeepTogether = false; - - } + this.sectionKeepTogether = tableMergeActive && localKeepTogether; // Check, whether we have a reason to derive a style... - if (masterPageName != null || - (!tableMergeActive && (localKeepTogether || keepWithNext)) || isColumnBreakPending()) + if (masterPageName != null || (!tableMergeActive && (localKeepTogether || keepWithNext)) || isColumnBreakPending()) { final String styleName = (String) attrs.getAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME); final OfficeStyle style = deriveStyle("table", styleName); @@ -1009,8 +971,8 @@ public class TextRawReportTarget extends OfficeDocumentReportTarget } } attrs.setAttribute(OfficeNamespaces.TABLE_NS, OfficeToken.STYLE_NAME, style.getStyleName()); - // no need to copy the styles, this was done while deriving the - // style .. + // no need to copy the styles, this was done while deriving the + // style .. } else { @@ -1074,8 +1036,7 @@ public class TextRawReportTarget extends OfficeDocumentReportTarget private boolean isTableMergeActive() { - return getCurrentRole() == ROLE_DETAIL && - tableLayoutConfig == TABLE_LAYOUT_SINGLE_DETAIL_TABLE; + return getCurrentRole() == ROLE_DETAIL && tableLayoutConfig == TABLE_LAYOUT_SINGLE_DETAIL_TABLE; } private void openSection() @@ -1086,9 +1047,7 @@ public class TextRawReportTarget extends OfficeDocumentReportTarget // repeating sections have other ways of defining columns .. return; } - if (getCurrentRole() == ROLE_TEMPLATE || - getCurrentRole() == ROLE_SPREADSHEET_PAGE_HEADER || - getCurrentRole() == ROLE_SPREADSHEET_PAGE_FOOTER) + if (getCurrentRole() == ROLE_TEMPLATE || getCurrentRole() == ROLE_SPREADSHEET_PAGE_HEADER || getCurrentRole() == ROLE_SPREADSHEET_PAGE_FOOTER) { // the template section would break the multi-column stuff and we dont open up sections there // anyway .. @@ -1100,7 +1059,7 @@ public class TextRawReportTarget extends OfficeDocumentReportTarget if (columnCount != null && !pageContext.isSectionOpen()) { final AttributeList attrs = new AttributeList(); - attrs.setAttribute(OfficeNamespaces.TEXT_NS, OfficeToken.STYLE_NAME, generateSectionStyle(columnCount.intValue())); + attrs.setAttribute(OfficeNamespaces.TEXT_NS, OfficeToken.STYLE_NAME, generateSectionStyle(columnCount)); attrs.setAttribute(OfficeNamespaces.TEXT_NS, NAME, sectionNames.generateName("Section")); getXmlWriter().writeTag(OfficeNamespaces.TEXT_NS, "section", attrs, XmlWriterSupport.OPEN); @@ -1113,9 +1072,7 @@ public class TextRawReportTarget extends OfficeDocumentReportTarget throws IOException, DataSourceException, ReportProcessingException { sectionHeight = new LengthCalculator(); - if (role == OfficeDocumentReportTarget.ROLE_TEMPLATE || - role == OfficeDocumentReportTarget.ROLE_SPREADSHEET_PAGE_HEADER || - role == OfficeDocumentReportTarget.ROLE_SPREADSHEET_PAGE_FOOTER) + if (role == OfficeDocumentReportTarget.ROLE_TEMPLATE || role == OfficeDocumentReportTarget.ROLE_SPREADSHEET_PAGE_HEADER || role == OfficeDocumentReportTarget.ROLE_SPREADSHEET_PAGE_FOOTER) { // Start buffering with an dummy styles-collection, so that the global styles dont get polluted .. startBuffering(new OfficeStylesCollection(), true); @@ -1241,9 +1198,7 @@ public class TextRawReportTarget extends OfficeDocumentReportTarget protected void endReportSection(final AttributeMap attrs, final int role) throws IOException, DataSourceException, ReportProcessingException { - if (role == ROLE_TEMPLATE || - role == OfficeDocumentReportTarget.ROLE_SPREADSHEET_PAGE_HEADER || - role == OfficeDocumentReportTarget.ROLE_SPREADSHEET_PAGE_FOOTER) + if (role == ROLE_TEMPLATE || role == OfficeDocumentReportTarget.ROLE_SPREADSHEET_PAGE_HEADER || role == OfficeDocumentReportTarget.ROLE_SPREADSHEET_PAGE_FOOTER) { finishBuffering(); return; @@ -1369,16 +1324,13 @@ public class TextRawReportTarget extends OfficeDocumentReportTarget return; } - if (isInternalNS && (ObjectUtilities.equal(OfficeToken.IMAGE, elementType) || - ObjectUtilities.equal(OfficeToken.OBJECT_OLE, elementType))) + if (isInternalNS && (ObjectUtilities.equal(OfficeToken.IMAGE, elementType) || ObjectUtilities.equal(OfficeToken.OBJECT_OLE, elementType))) { return; } final XmlWriter xmlWriter = getXmlWriter(); - if (tableLayoutConfig != TABLE_LAYOUT_VARIABLES_PARAGRAPH && - isTableNs && ObjectUtilities.equal(OfficeToken.TABLE_CELL, elementType) && - !isRepeatingSection() ) + if (tableLayoutConfig != TABLE_LAYOUT_VARIABLES_PARAGRAPH && isTableNs && ObjectUtilities.equal(OfficeToken.TABLE_CELL, elementType) && !isRepeatingSection()) { if (variables != null) { @@ -1403,19 +1355,19 @@ public class TextRawReportTarget extends OfficeDocumentReportTarget xmlWriter.writeCloseTag(); variables = null; } - /** - // Only generate the empty paragraph, if we have to add the keep-together .. - else if (cellEmpty && expectedTableRowCount > 0 && - sectionKeepTogether && !firstCellSeen) - { - // we have no variables .. - StyleUtilities.copyStyle(OfficeToken.PARAGRAPH, - TextRawReportTarget.VARIABLES_HIDDEN_STYLE_WITH_KEEPWNEXT, getStylesCollection(), - getGlobalStylesCollection(), getPredefinedStylesCollection()); - xmlWriter.writeTag(OfficeNamespaces.TEXT_NS, OfficeToken.P, OfficeToken.STYLE_NAME, - TextRawReportTarget.VARIABLES_HIDDEN_STYLE_WITH_KEEPWNEXT, XmlWriterSupport.CLOSE); - } - */ + /** + // Only generate the empty paragraph, if we have to add the keep-together .. + else if (cellEmpty && expectedTableRowCount > 0 && + sectionKeepTogether && !firstCellSeen) + { + // we have no variables .. + StyleUtilities.copyStyle(OfficeToken.PARAGRAPH, + TextRawReportTarget.VARIABLES_HIDDEN_STYLE_WITH_KEEPWNEXT, getStylesCollection(), + getGlobalStylesCollection(), getPredefinedStylesCollection()); + xmlWriter.writeTag(OfficeNamespaces.TEXT_NS, OfficeToken.P, OfficeToken.STYLE_NAME, + TextRawReportTarget.VARIABLES_HIDDEN_STYLE_WITH_KEEPWNEXT, XmlWriterSupport.CLOSE); + } + */ } if (isTableNs && (ObjectUtilities.equal(OfficeToken.TABLE_CELL, elementType) || ObjectUtilities.equal(OfficeToken.COVERED_TABLE_CELL, elementType))) diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/AttributeSpecification.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/AttributeSpecification.java index 578fc4f98716..e4f6e121c277 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/AttributeSpecification.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/AttributeSpecification.java @@ -27,35 +27,34 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.parser; public final class AttributeSpecification { - private final String namespaceUrl; - private final String attributName; - private final String mapperImplementation; - public AttributeSpecification (String namespaceUrl, String attributName, String mapperImplementation) - { - this.namespaceUrl = namespaceUrl; - this.attributName = attributName; - this.mapperImplementation = mapperImplementation; - } + private final String namespaceUrl; + private final String attributName; + private final String mapperImplementation; + + public AttributeSpecification(String namespaceUrl, String attributName, String mapperImplementation) + { + this.namespaceUrl = namespaceUrl; + this.attributName = attributName; + this.mapperImplementation = mapperImplementation; + } - public String getAttributName () - { - return attributName; - } + public String getAttributName() + { + return attributName; + } - public String getMapperImplementation () - { - return mapperImplementation; - } + public String getMapperImplementation() + { + return mapperImplementation; + } - public String getNamespaceUrl () - { - return namespaceUrl; - } + public String getNamespaceUrl() + { + return namespaceUrl; + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/OfficeDocumentXmlResourceFactory.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/OfficeDocumentXmlResourceFactory.java index 29e316f3be4c..e3b8f7374d43 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/OfficeDocumentXmlResourceFactory.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/OfficeDocumentXmlResourceFactory.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.parser; import com.sun.star.report.pentaho.model.OfficeDocument; @@ -44,13 +42,12 @@ import org.jfree.report.modules.factories.report.base.JFreeReportXmlResourceFact public class OfficeDocumentXmlResourceFactory extends JFreeReportXmlResourceFactory { - public OfficeDocumentXmlResourceFactory() - { - } - - public Class getFactoryType() - { - return OfficeDocument.class; - } + public OfficeDocumentXmlResourceFactory() + { + } + public Class getFactoryType() + { + return OfficeDocument.class; + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/OfficeParserUtil.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/OfficeParserUtil.java index 85bbab40a1a7..266cfa529d5a 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/OfficeParserUtil.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/OfficeParserUtil.java @@ -46,6 +46,7 @@ import org.pentaho.reporting.libraries.resourceloader.ResourceManager; public class OfficeParserUtil { + private static final Log LOGGER = LogFactory.getLog(OfficeParserUtil.class); private static OfficeParserUtil instance; private static final String NAMESPACES_PREFIX = "namespaces."; diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/OfficeStylesXmlResourceFactory.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/OfficeStylesXmlResourceFactory.java index 50aaf2e0ca40..6971eb857a20 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/OfficeStylesXmlResourceFactory.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/OfficeStylesXmlResourceFactory.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.parser; import com.sun.star.report.pentaho.model.OfficeStylesCollection; @@ -46,19 +44,17 @@ import org.pentaho.reporting.libraries.xmlns.parser.AbstractXmlResourceFactory; public class OfficeStylesXmlResourceFactory extends AbstractXmlResourceFactory { - public OfficeStylesXmlResourceFactory() - { - } - - - protected Configuration getConfiguration() - { - return JFreeReportBoot.getInstance().getGlobalConfig(); - } + public OfficeStylesXmlResourceFactory() + { + } - public Class getFactoryType() - { - return OfficeStylesCollection.class; - } + protected Configuration getConfiguration() + { + return JFreeReportBoot.getInstance().getGlobalConfig(); + } + public Class getFactoryType() + { + return OfficeStylesCollection.class; + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/StarStyleXmlFactoryModule.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/StarStyleXmlFactoryModule.java index b698a73dcc8e..ff3dfc494436 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/StarStyleXmlFactoryModule.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/StarStyleXmlFactoryModule.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.parser; import com.sun.star.report.pentaho.OfficeNamespaces; @@ -39,27 +37,28 @@ import org.pentaho.reporting.libraries.xmlns.parser.XmlReadHandler; public class StarStyleXmlFactoryModule implements XmlFactoryModule { - public StarStyleXmlFactoryModule() - { - } - public XmlReadHandler createReadHandler (final XmlDocumentInfo documentInfo) - { - return new DocumentStylesReadHandler(); - } + public StarStyleXmlFactoryModule() + { + } - public int getDocumentSupport (final XmlDocumentInfo documentInfo) - { - final String rootNamespace = documentInfo.getRootElementNameSpace(); - if (OfficeNamespaces.OFFICE_NS.equals(rootNamespace) && "document-styles".equals(documentInfo.getRootElement()) ) + public XmlReadHandler createReadHandler(final XmlDocumentInfo documentInfo) { - return XmlFactoryModule.RECOGNIZED_BY_NAMESPACE; + return new DocumentStylesReadHandler(); } - return XmlFactoryModule.NOT_RECOGNIZED; - } - public String getDefaultNamespace(final XmlDocumentInfo documentInfo) - { - return null; - } + public int getDocumentSupport(final XmlDocumentInfo documentInfo) + { + final String rootNamespace = documentInfo.getRootElementNameSpace(); + if (OfficeNamespaces.OFFICE_NS.equals(rootNamespace) && "document-styles".equals(documentInfo.getRootElement())) + { + return XmlFactoryModule.RECOGNIZED_BY_NAMESPACE; + } + return XmlFactoryModule.NOT_RECOGNIZED; + } + + public String getDefaultNamespace(final XmlDocumentInfo documentInfo) + { + return null; + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/StarXmlFactoryModule.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/StarXmlFactoryModule.java index 261ee5a285ce..e69df1b60bbe 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/StarXmlFactoryModule.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/StarXmlFactoryModule.java @@ -50,8 +50,7 @@ public class StarXmlFactoryModule implements XmlFactoryModule public int getDocumentSupport(final XmlDocumentInfo documentInfo) { final String rootNamespace = documentInfo.getRootElementNameSpace(); - if (OfficeNamespaces.OFFICE_NS.equals(rootNamespace) && - ("document-content".equals(documentInfo.getRootElement()) || "document".equals(documentInfo.getRootElement()))) + if (OfficeNamespaces.OFFICE_NS.equals(rootNamespace) && ("document-content".equals(documentInfo.getRootElement()) || "document".equals(documentInfo.getRootElement()))) { return XmlFactoryModule.RECOGNIZED_BY_NAMESPACE; } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/StyleMapper.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/StyleMapper.java index f29d0b0abad5..81f92f7ebaea 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/StyleMapper.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/StyleMapper.java @@ -27,16 +27,15 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.parser; import org.jfree.layouting.input.style.CSSDeclarationRule; public interface StyleMapper { - void updateStyle (final String uri, - final String attrName, - final String attrValue, - final CSSDeclarationRule targetRule); + + void updateStyle(final String uri, + final String attrName, + final String attrValue, + final CSSDeclarationRule targetRule); } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/chart/ChartReadHandler.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/chart/ChartReadHandler.java index 5e98fe9f3622..820a8fee65e6 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/chart/ChartReadHandler.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/chart/ChartReadHandler.java @@ -30,6 +30,7 @@ package com.sun.star.report.pentaho.parser.chart; import com.sun.star.report.pentaho.OfficeNamespaces; +import java.lang.Object; import java.util.ArrayList; import com.sun.star.report.pentaho.parser.ElementReadHandler; @@ -98,9 +99,9 @@ public class ChartReadHandler extends ElementReadHandler */ protected void doneParsing() throws SAXException { - for (int i = 0; i < children.size(); i++) + for (Object aChildren : children) { - final ElementReadHandler handler = (ElementReadHandler) children.get(i); + final ElementReadHandler handler = (ElementReadHandler) aChildren; element.addNode(handler.getElement()); } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/draw/ObjectOleReadHandler.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/draw/ObjectOleReadHandler.java index 77e28ccab6ee..6630d1e73962 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/draw/ObjectOleReadHandler.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/draw/ObjectOleReadHandler.java @@ -71,8 +71,10 @@ public class ObjectOleReadHandler extends ElementReadHandler String classid = attrs.getValue(OfficeNamespaces.DRAWING_NS, "class-id"); if (classid != null) { - if ( classid.equalsIgnoreCase(RPT_CHART_CLASS_ID)) + if (classid.equalsIgnoreCase(RPT_CHART_CLASS_ID)) + { classid = OOO_CHART_CLASS_ID; + } element.setClassId(classid); } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/office/DocumentContentReadHandler.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/office/DocumentContentReadHandler.java index 9d1b4e1a9d14..64255c2ae373 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/office/DocumentContentReadHandler.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/office/DocumentContentReadHandler.java @@ -56,6 +56,7 @@ import org.xml.sax.SAXException; */ public class DocumentContentReadHandler extends AbstractXmlReadHandler { + private static final Log LOGGER = LogFactory.getLog(DocumentContentReadHandler.class); private OfficeDocument report; private FontFaceDeclsReadHandler fontFaceReadHandler; diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/office/DocumentStylesReadHandler.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/office/DocumentStylesReadHandler.java index 33591203573f..32f7c54fa08a 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/office/DocumentStylesReadHandler.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/office/DocumentStylesReadHandler.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.parser.office; import com.sun.star.report.pentaho.OfficeNamespaces; @@ -50,61 +48,59 @@ import org.xml.sax.SAXException; */ public class DocumentStylesReadHandler extends ElementReadHandler { - private final OfficeStylesCollection officeStylesCollection; - private FontFaceDeclsReadHandler fontFaceReadHandler; - - public DocumentStylesReadHandler() - { - officeStylesCollection = new OfficeStylesCollection(); - } + private final OfficeStylesCollection officeStylesCollection; + private FontFaceDeclsReadHandler fontFaceReadHandler; - /** - * Returns the handler for a child element. - * - * @param tagName the tag name. - * @param atts the attributes. - * @return the handler or null, if the tagname is invalid. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected XmlReadHandler getHandlerForChild(final String uri, - final String tagName, - final Attributes atts) - throws SAXException - { - if (!OfficeNamespaces.OFFICE_NS.equals(uri)) + public DocumentStylesReadHandler() { - return null; + officeStylesCollection = new OfficeStylesCollection(); } - if ("font-face-decls".equals(tagName)) + /** + * Returns the handler for a child element. + * + * @param tagName the tag name. + * @param atts the attributes. + * @return the handler or null, if the tagname is invalid. + * + * @throws org.xml.sax.SAXException if there is a parsing error. + */ + protected XmlReadHandler getHandlerForChild(final String uri, + final String tagName, + final Attributes atts) + throws SAXException { - if (fontFaceReadHandler == null) - { - fontFaceReadHandler = new FontFaceDeclsReadHandler - (officeStylesCollection.getFontFaceDecls()); - } - return fontFaceReadHandler; - } - else if ("automatic-styles".equals(tagName)) - { - return new OfficeStylesReadHandler(officeStylesCollection.getAutomaticStyles()); - } - else if ("styles".equals(tagName)) - { - return new OfficeStylesReadHandler(officeStylesCollection.getCommonStyles()); + if (!OfficeNamespaces.OFFICE_NS.equals(uri)) + { + return null; + } + + if ("font-face-decls".equals(tagName)) + { + if (fontFaceReadHandler == null) + { + fontFaceReadHandler = new FontFaceDeclsReadHandler(officeStylesCollection.getFontFaceDecls()); + } + return fontFaceReadHandler; + } + else if ("automatic-styles".equals(tagName)) + { + return new OfficeStylesReadHandler(officeStylesCollection.getAutomaticStyles()); + } + else if ("styles".equals(tagName)) + { + return new OfficeStylesReadHandler(officeStylesCollection.getCommonStyles()); + } + else if ("master-styles".equals(tagName)) + { + return new MasterStylesReadHandler(officeStylesCollection.getMasterStyles()); + } + return null; } - else if ("master-styles".equals(tagName)) + + public Element getElement() { - return new MasterStylesReadHandler(officeStylesCollection.getMasterStyles()); + return officeStylesCollection; } - return null; - } - - - public Element getElement() - { - return officeStylesCollection; - } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/office/FontFaceDeclsReadHandler.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/office/FontFaceDeclsReadHandler.java index c11bf6385bc9..7e40681faee3 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/office/FontFaceDeclsReadHandler.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/office/FontFaceDeclsReadHandler.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.parser.office; import java.util.ArrayList; @@ -53,67 +51,66 @@ import org.xml.sax.SAXException; */ public class FontFaceDeclsReadHandler extends ElementReadHandler { - private final FontFaceDeclsSection fontFaceDecls; - private final List fontFaceReadHandlers; - - public FontFaceDeclsReadHandler(final FontFaceDeclsSection fontFaceDecls) - { - this.fontFaceDecls = fontFaceDecls; - this.fontFaceReadHandlers = new ArrayList(); - } - public FontFaceDeclsSection getFontFaceDecls() - { - return fontFaceDecls; - } + private final FontFaceDeclsSection fontFaceDecls; + private final List fontFaceReadHandlers; - - /** - * Returns the handler for a child element. - * - * @param tagName the tag name. - * @param atts the attributes. - * @return the handler or null, if the tagname is invalid. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected XmlReadHandler getHandlerForChild(final String uri, - final String tagName, - final Attributes atts) - throws SAXException - { - if (!OfficeNamespaces.STYLE_NS.equals(uri) ) + public FontFaceDeclsReadHandler(final FontFaceDeclsSection fontFaceDecls) { - return null; + this.fontFaceDecls = fontFaceDecls; + this.fontFaceReadHandlers = new ArrayList(); } - if ("font-face".equals(tagName)) + public FontFaceDeclsSection getFontFaceDecls() { - final FontFaceReadHandler frh = new FontFaceReadHandler(); - fontFaceReadHandlers.add(frh); - return frh; + return fontFaceDecls; } - return null; - } - /** - * Done parsing. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected void doneParsing() - throws SAXException - { - for (int i = 0; i < fontFaceReadHandlers.size(); i++) + /** + * Returns the handler for a child element. + * + * @param tagName the tag name. + * @param atts the attributes. + * @return the handler or null, if the tagname is invalid. + * + * @throws org.xml.sax.SAXException if there is a parsing error. + */ + protected XmlReadHandler getHandlerForChild(final String uri, + final String tagName, + final Attributes atts) + throws SAXException { - final FontFaceReadHandler handler = (FontFaceReadHandler) fontFaceReadHandlers.get(i); - fontFaceDecls.addFontFace((FontFaceElement) handler.getElement()); + if (!OfficeNamespaces.STYLE_NS.equals(uri)) + { + return null; + } + + if ("font-face".equals(tagName)) + { + final FontFaceReadHandler frh = new FontFaceReadHandler(); + fontFaceReadHandlers.add(frh); + return frh; + } + return null; } - } - public Element getElement() - { - return fontFaceDecls; - } + /** + * Done parsing. + * + * @throws org.xml.sax.SAXException if there is a parsing error. + */ + protected void doneParsing() + throws SAXException + { + for (int i = 0; i < fontFaceReadHandlers.size(); i++) + { + final FontFaceReadHandler handler = (FontFaceReadHandler) fontFaceReadHandlers.get(i); + fontFaceDecls.addFontFace((FontFaceElement) handler.getElement()); + } + } + public Element getElement() + { + return fontFaceDecls; + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt-schema-v1.0-os.xsd b/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt-schema-v1.0-os.xsd index 88fcc020a2e6..f65b34149429 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt-schema-v1.0-os.xsd +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt-schema-v1.0-os.xsd @@ -55,364 +55,364 @@ xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/FormattedTextReadHandler.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/FormattedTextReadHandler.java index 60897b0d3c07..7f98e3f79f6a 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/FormattedTextReadHandler.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/FormattedTextReadHandler.java @@ -72,14 +72,14 @@ public class FormattedTextReadHandler extends ElementReadHandler element.setValueExpression(valueExpression); } - // * Print-Repeated-Values - // * Print-In-First-New-Section - // * Print-When-Group-Changes + // * Print-Repeated-Values + // * Print-In-First-New-Section + // * Print-When-Group-Changes - // * Print-When-Section-Overflows - // That property cannot be evaluated yet, as this would require us to - // have a clue about pagebreaking. We dont have that - not yet and never - // in the future, as pagebreaks are computed by OpenOffice instead + // * Print-When-Section-Overflows + // That property cannot be evaluated yet, as this would require us to + // have a clue about pagebreaking. We dont have that - not yet and never + // in the future, as pagebreaks are computed by OpenOffice instead } /** diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/GroupReadHandler.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/GroupReadHandler.java index 55ed4759c6be..b9c6cb42d77e 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/GroupReadHandler.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/GroupReadHandler.java @@ -79,7 +79,7 @@ public class GroupReadHandler extends ElementReadHandler super.startParsing(attrs); final String groupExpr = attrs.getValue(OfficeNamespaces.OOREPORT_NS, "group-expression"); - if ( groupExpr != null && !"".equals(groupExpr) ) + if (groupExpr != null && !"".equals(groupExpr)) { final FormulaExpression function = new FormulaExpression(); function.setFormula(groupExpr); @@ -128,7 +128,7 @@ public class GroupReadHandler extends ElementReadHandler } if ("group-footer".equals(tagName)) { - ((Element)((Section)rh.getDetail().getElement()).getNode(0)).setAttribute(JFreeReportInfo.REPORT_NAMESPACE,"has-group-footer", OfficeToken.TRUE); + ((Element) ((Section) rh.getDetail().getElement()).getNode(0)).setAttribute(JFreeReportInfo.REPORT_NAMESPACE, "has-group-footer", OfficeToken.TRUE); groupFooter = new GroupSectionReadHandler(); return groupFooter; } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/MasterDetailReadHandler.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/MasterDetailReadHandler.java index a867e2e85e4c..e9b1d8959333 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/MasterDetailReadHandler.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/MasterDetailReadHandler.java @@ -71,7 +71,7 @@ public class MasterDetailReadHandler extends ElementReadHandler if (parseMasterDetail) { final String master = attrs.getValue(OfficeNamespaces.OOREPORT_NS, "master"); - if (master != null && master.length() > 0 ) + if (master != null && master.length() > 0) { final String detail = attrs.getValue(OfficeNamespaces.OOREPORT_NS, "detail"); element.addMasterDetailFields(master, detail); diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/ReportReadHandler.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/ReportReadHandler.java index 7fa0f700dada..1d0acf709161 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/ReportReadHandler.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/rpt/ReportReadHandler.java @@ -56,6 +56,7 @@ public class ReportReadHandler extends ElementReadHandler { this.detail = detail; } + public final RootTableReadHandler getDetail() { return detail; diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/style/FontFaceReadHandler.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/style/FontFaceReadHandler.java index 2b70a87d9d03..0c7b8747c9d5 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/style/FontFaceReadHandler.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/style/FontFaceReadHandler.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.parser.style; import com.sun.star.report.pentaho.parser.ElementReadHandler; @@ -45,15 +43,16 @@ import org.jfree.report.structure.Element; */ public class FontFaceReadHandler extends ElementReadHandler { - private final FontFaceElement fontFaceElement; - public FontFaceReadHandler() - { - this.fontFaceElement = new FontFaceElement(); - } + private final FontFaceElement fontFaceElement; + + public FontFaceReadHandler() + { + this.fontFaceElement = new FontFaceElement(); + } - public Element getElement() - { - return fontFaceElement; - } + public Element getElement() + { + return fontFaceElement; + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/style/MasterPageReadHandler.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/style/MasterPageReadHandler.java index 160feadb737f..75773988cf76 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/style/MasterPageReadHandler.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/style/MasterPageReadHandler.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.parser.style; import java.util.ArrayList; @@ -49,59 +47,59 @@ import org.xml.sax.SAXException; */ public class MasterPageReadHandler extends ElementReadHandler { - private final OfficeMasterPage masterPage; - private final List otherHandlers; - public MasterPageReadHandler() - { - masterPage = new OfficeMasterPage(); - this.otherHandlers = new ArrayList(); - } + private final OfficeMasterPage masterPage; + private final List otherHandlers; - public OfficeMasterPage getMasterPage() - { - return masterPage; - } + public MasterPageReadHandler() + { + masterPage = new OfficeMasterPage(); + this.otherHandlers = new ArrayList(); + } - /** - * Returns the handler for a child element. - * - * @param tagName the tag name. - * @param atts the attributes. - * @return the handler or null, if the tagname is invalid. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected XmlReadHandler getHandlerForChild(final String uri, - final String tagName, - final Attributes atts) - throws SAXException - { - final StyleDefinitionReadHandler readHandler = - new StyleDefinitionReadHandler(); - otherHandlers.add(readHandler); - return readHandler; - } + public OfficeMasterPage getMasterPage() + { + return masterPage; + } - /** - * Done parsing. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected void doneParsing() - throws SAXException - { - for (int i = 0; i < otherHandlers.size(); i++) + /** + * Returns the handler for a child element. + * + * @param tagName the tag name. + * @param atts the attributes. + * @return the handler or null, if the tagname is invalid. + * + * @throws org.xml.sax.SAXException if there is a parsing error. + */ + protected XmlReadHandler getHandlerForChild(final String uri, + final String tagName, + final Attributes atts) + throws SAXException { - final ElementReadHandler handler = - (ElementReadHandler) otherHandlers.get(i); - masterPage.addNode(handler.getElement()); + final StyleDefinitionReadHandler readHandler = + new StyleDefinitionReadHandler(); + otherHandlers.add(readHandler); + return readHandler; } - } + /** + * Done parsing. + * + * @throws org.xml.sax.SAXException if there is a parsing error. + */ + protected void doneParsing() + throws SAXException + { + for (int i = 0; i < otherHandlers.size(); i++) + { + final ElementReadHandler handler = + (ElementReadHandler) otherHandlers.get(i); + masterPage.addNode(handler.getElement()); + } + } - public Element getElement() - { - return masterPage; - } + public Element getElement() + { + return masterPage; + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/style/OfficeStyleReadHandler.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/style/OfficeStyleReadHandler.java index a259a16ad8da..0a541495c8dd 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/style/OfficeStyleReadHandler.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/style/OfficeStyleReadHandler.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.parser.style; import java.util.ArrayList; @@ -47,60 +45,60 @@ import org.xml.sax.SAXException; */ public class OfficeStyleReadHandler extends ElementReadHandler { - private final OfficeStyle officeStyle; - private final List childs; - public OfficeStyleReadHandler() - { - this.officeStyle = new OfficeStyle(); - this.childs = new ArrayList(); - } + private final OfficeStyle officeStyle; + private final List childs; + + public OfficeStyleReadHandler() + { + this.officeStyle = new OfficeStyle(); + this.childs = new ArrayList(); + } - /** - * Returns the handler for a child element. - * - * @param tagName the tag name. - * @param atts the attributes. - * @return the handler or null, if the tagname is invalid. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected XmlReadHandler getHandlerForChild (final String uri, - final String tagName, - final Attributes atts) - throws SAXException - { + /** + * Returns the handler for a child element. + * + * @param tagName the tag name. + * @param atts the attributes. + * @return the handler or null, if the tagname is invalid. + * + * @throws org.xml.sax.SAXException if there is a parsing error. + */ + protected XmlReadHandler getHandlerForChild(final String uri, + final String tagName, + final Attributes atts) + throws SAXException + { // if (OfficeParserUtil.getInstance().isValidStyleElement(uri, tagName)) // { // } - final StyleDefinitionReadHandler readHandler = - new StyleDefinitionReadHandler(); - childs.add(readHandler); - return readHandler; - } - + final StyleDefinitionReadHandler readHandler = + new StyleDefinitionReadHandler(); + childs.add(readHandler); + return readHandler; + } - /** - * Done parsing. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected void doneParsing() throws SAXException - { - for (int i = 0; i < childs.size(); i++) + /** + * Done parsing. + * + * @throws org.xml.sax.SAXException if there is a parsing error. + */ + protected void doneParsing() throws SAXException { - final ElementReadHandler handler = (ElementReadHandler) childs.get(i); - officeStyle.addNode(handler.getElement()); + for (int i = 0; i < childs.size(); i++) + { + final ElementReadHandler handler = (ElementReadHandler) childs.get(i); + officeStyle.addNode(handler.getElement()); + } } - } - public OfficeStyle getOfficeStyle() - { - return officeStyle; - } + public OfficeStyle getOfficeStyle() + { + return officeStyle; + } - public Element getElement() - { - return officeStyle; - } + public Element getElement() + { + return officeStyle; + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/style/OfficeStylesReadHandler.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/style/OfficeStylesReadHandler.java index 687b7b02ce49..4c4a2e80d19a 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/style/OfficeStylesReadHandler.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/style/OfficeStylesReadHandler.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.parser.style; import java.util.ArrayList; @@ -45,99 +43,100 @@ import java.util.List; public class OfficeStylesReadHandler extends ElementReadHandler { - private final List textStyleChilds; - private final List dataStyleChilds; - private final List otherStyleChilds; - private final List pageLayoutChilds; - private final OfficeStyles officeStyles; - public OfficeStylesReadHandler(final OfficeStyles officeStyles) - { - this.officeStyles = officeStyles; - this.pageLayoutChilds = new ArrayList(); - this.dataStyleChilds = new ArrayList(); - this.textStyleChilds = new ArrayList(); - this.otherStyleChilds = new ArrayList(); - } + private final List textStyleChilds; + private final List dataStyleChilds; + private final List otherStyleChilds; + private final List pageLayoutChilds; + private final OfficeStyles officeStyles; - /** - * Returns the handler for a child element. - * - * @param tagName the tag name. - * @param atts the attributes. - * @return the handler or null, if the tagname is invalid. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected XmlReadHandler getHandlerForChild (final String uri, final String tagName, - final Attributes atts) - throws SAXException - { - if (OfficeNamespaces.STYLE_NS.equals(uri)) - { - if ("style".equals(tagName)) - { - final OfficeStyleReadHandler xrh = new OfficeStyleReadHandler(); - textStyleChilds.add(xrh); - return xrh; - } - else if ("page-layout".equals(tagName)) - { - final PageLayoutReadHandler prh = new PageLayoutReadHandler(); - pageLayoutChilds.add(prh); - return prh; - } - } - else if (OfficeNamespaces.DATASTYLE_NS.equals(uri)) + public OfficeStylesReadHandler(final OfficeStyles officeStyles) { - final DataStyleReadHandler xrh = new DataStyleReadHandler(false); - dataStyleChilds.add(xrh); - return xrh; + this.officeStyles = officeStyles; + this.pageLayoutChilds = new ArrayList(); + this.dataStyleChilds = new ArrayList(); + this.textStyleChilds = new ArrayList(); + this.otherStyleChilds = new ArrayList(); } - final SectionReadHandler genericReadHander = new SectionReadHandler(); - otherStyleChilds.add(genericReadHander); - return genericReadHander; - } - - /** - * Done parsing. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected void doneParsing() throws SAXException - { - for (int i = 0; i < textStyleChilds.size(); i++) + /** + * Returns the handler for a child element. + * + * @param tagName the tag name. + * @param atts the attributes. + * @return the handler or null, if the tagname is invalid. + * + * @throws org.xml.sax.SAXException if there is a parsing error. + */ + protected XmlReadHandler getHandlerForChild(final String uri, final String tagName, + final Attributes atts) + throws SAXException { - final OfficeStyleReadHandler handler = - (OfficeStyleReadHandler) textStyleChilds.get(i); - officeStyles.addStyle(handler.getOfficeStyle()); - } + if (OfficeNamespaces.STYLE_NS.equals(uri)) + { + if ("style".equals(tagName)) + { + final OfficeStyleReadHandler xrh = new OfficeStyleReadHandler(); + textStyleChilds.add(xrh); + return xrh; + } + else if ("page-layout".equals(tagName)) + { + final PageLayoutReadHandler prh = new PageLayoutReadHandler(); + pageLayoutChilds.add(prh); + return prh; + } + } + else if (OfficeNamespaces.DATASTYLE_NS.equals(uri)) + { + final DataStyleReadHandler xrh = new DataStyleReadHandler(false); + dataStyleChilds.add(xrh); + return xrh; + } - for (int i = 0; i < pageLayoutChilds.size(); i++) - { - final PageLayoutReadHandler handler = - (PageLayoutReadHandler) pageLayoutChilds.get(i); - officeStyles.addPageStyle(handler.getPageLayout()); + final SectionReadHandler genericReadHander = new SectionReadHandler(); + otherStyleChilds.add(genericReadHander); + return genericReadHander; } - for (int i = 0; i < dataStyleChilds.size(); i++) + /** + * Done parsing. + * + * @throws org.xml.sax.SAXException if there is a parsing error. + */ + protected void doneParsing() throws SAXException { - final DataStyleReadHandler handler = - (DataStyleReadHandler) dataStyleChilds.get(i); - officeStyles.addDataStyle(handler.getDataStyle()); + for (int i = 0; i < textStyleChilds.size(); i++) + { + final OfficeStyleReadHandler handler = + (OfficeStyleReadHandler) textStyleChilds.get(i); + officeStyles.addStyle(handler.getOfficeStyle()); + } + + for (int i = 0; i < pageLayoutChilds.size(); i++) + { + final PageLayoutReadHandler handler = + (PageLayoutReadHandler) pageLayoutChilds.get(i); + officeStyles.addPageStyle(handler.getPageLayout()); + } + + for (int i = 0; i < dataStyleChilds.size(); i++) + { + final DataStyleReadHandler handler = + (DataStyleReadHandler) dataStyleChilds.get(i); + officeStyles.addDataStyle(handler.getDataStyle()); + } + + for (int i = 0; i < otherStyleChilds.size(); i++) + { + final SectionReadHandler handler = + (SectionReadHandler) otherStyleChilds.get(i); + officeStyles.addOtherNode((Element) handler.getNode()); + } } - for (int i = 0; i < otherStyleChilds.size(); i++) + public Element getElement() { - final SectionReadHandler handler = - (SectionReadHandler) otherStyleChilds.get(i); - officeStyles.addOtherNode((Element) handler.getNode()); + return officeStyles; } - } - - public Element getElement() - { - return officeStyles; - } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/style/PageLayoutReadHandler.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/style/PageLayoutReadHandler.java index 46ba378a1ce5..5ee10d2b936b 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/style/PageLayoutReadHandler.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/style/PageLayoutReadHandler.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.parser.style; import java.util.ArrayList; @@ -49,57 +47,57 @@ import org.xml.sax.SAXException; */ public class PageLayoutReadHandler extends ElementReadHandler { - private final PageLayout pageLayout; - private final List childs; - public PageLayoutReadHandler() - { - this.pageLayout = new PageLayout(); - this.childs = new ArrayList(); - } + private final PageLayout pageLayout; + private final List childs; - /** - * Returns the handler for a child element. - * - * @param tagName the tag name. - * @param atts the attributes. - * @return the handler or null, if the tagname is invalid. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected XmlReadHandler getHandlerForChild (final String uri, - final String tagName, - final Attributes atts) - throws SAXException - { - final StyleDefinitionReadHandler readHandler = - new StyleDefinitionReadHandler(); - childs.add(readHandler); - return readHandler; - } + public PageLayoutReadHandler() + { + this.pageLayout = new PageLayout(); + this.childs = new ArrayList(); + } + /** + * Returns the handler for a child element. + * + * @param tagName the tag name. + * @param atts the attributes. + * @return the handler or null, if the tagname is invalid. + * + * @throws org.xml.sax.SAXException if there is a parsing error. + */ + protected XmlReadHandler getHandlerForChild(final String uri, + final String tagName, + final Attributes atts) + throws SAXException + { + final StyleDefinitionReadHandler readHandler = + new StyleDefinitionReadHandler(); + childs.add(readHandler); + return readHandler; + } - /** - * Done parsing. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected void doneParsing() throws SAXException - { - for (int i = 0; i < childs.size(); i++) + /** + * Done parsing. + * + * @throws org.xml.sax.SAXException if there is a parsing error. + */ + protected void doneParsing() throws SAXException { - final ElementReadHandler handler = (ElementReadHandler) childs.get(i); - pageLayout.addNode(handler.getElement()); + for (int i = 0; i < childs.size(); i++) + { + final ElementReadHandler handler = (ElementReadHandler) childs.get(i); + pageLayout.addNode(handler.getElement()); + } } - } - public PageLayout getPageLayout() - { - return pageLayout; - } + public PageLayout getPageLayout() + { + return pageLayout; + } - public Element getElement() - { - return pageLayout; - } + public Element getElement() + { + return pageLayout; + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/style/StyleDefinitionReadHandler.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/style/StyleDefinitionReadHandler.java index 6eb99dec3ee0..0fd0655d4e22 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/style/StyleDefinitionReadHandler.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/style/StyleDefinitionReadHandler.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.parser.style; import java.util.ArrayList; @@ -48,54 +46,53 @@ import org.xml.sax.SAXException; */ public class StyleDefinitionReadHandler extends ElementReadHandler { - private final Section rawSection; - private final List childs; - - public StyleDefinitionReadHandler() - { - this.rawSection = new Section(); - this.childs = new ArrayList(); - } - /** - * Returns the handler for a child element. - * - * @param tagName the tag name. - * @param atts the attributes. - * @return the handler or null, if the tagname is invalid. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected XmlReadHandler getHandlerForChild(final String uri, - final String tagName, - final Attributes atts) - throws SAXException - { - final StyleDefinitionReadHandler readHandler = - new StyleDefinitionReadHandler(); - childs.add(readHandler); - return readHandler; - } + private final Section rawSection; + private final List childs; + public StyleDefinitionReadHandler() + { + this.rawSection = new Section(); + this.childs = new ArrayList(); + } - /** - * Done parsing. - * - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected void doneParsing() - throws SAXException - { - for (int i = 0; i < childs.size(); i++) + /** + * Returns the handler for a child element. + * + * @param tagName the tag name. + * @param atts the attributes. + * @return the handler or null, if the tagname is invalid. + * + * @throws org.xml.sax.SAXException if there is a parsing error. + */ + protected XmlReadHandler getHandlerForChild(final String uri, + final String tagName, + final Attributes atts) + throws SAXException { - final ElementReadHandler handler = (ElementReadHandler) childs.get(i); - rawSection.addNode(handler.getElement()); + final StyleDefinitionReadHandler readHandler = + new StyleDefinitionReadHandler(); + childs.add(readHandler); + return readHandler; } - } + /** + * Done parsing. + * + * @throws org.xml.sax.SAXException if there is a parsing error. + */ + protected void doneParsing() + throws SAXException + { + for (int i = 0; i < childs.size(); i++) + { + final ElementReadHandler handler = (ElementReadHandler) childs.get(i); + rawSection.addNode(handler.getElement()); + } + } - public Element getElement() - { - return rawSection; - } + public Element getElement() + { + return rawSection; + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/OneOfConstantsMapper.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/OneOfConstantsMapper.java index 7ade32271b8f..8e385f2ba859 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/OneOfConstantsMapper.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/OneOfConstantsMapper.java @@ -49,7 +49,7 @@ public abstract class OneOfConstantsMapper implements StyleMapper this.mappings = new HashMap(); } - public void addMapping (final String value, final CSSValue target) + public void addMapping(final String value, final CSSValue target) { mappings.put(value, target); } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/draw/TextAreaVerticalAlignMapper.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/draw/TextAreaVerticalAlignMapper.java index f08255b615ee..8418815f3b7d 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/draw/TextAreaVerticalAlignMapper.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/draw/TextAreaVerticalAlignMapper.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.parser.stylemapper.draw; import com.sun.star.report.pentaho.parser.stylemapper.OneOfConstantsMapper; @@ -37,12 +35,13 @@ import org.jfree.layouting.input.style.values.CSSConstant; public class TextAreaVerticalAlignMapper extends OneOfConstantsMapper { - public TextAreaVerticalAlignMapper () - { - super (BoxStyleKeys.BOX_VERTICAL_ALIGN); - addMapping("top", new CSSConstant("top")); - addMapping("bottom", new CSSConstant("bottom")); - addMapping("middle", new CSSConstant("middle")); - addMapping("justify", new CSSConstant("justify")); - } + + public TextAreaVerticalAlignMapper() + { + super(BoxStyleKeys.BOX_VERTICAL_ALIGN); + addMapping("top", new CSSConstant("top")); + addMapping("bottom", new CSSConstant("bottom")); + addMapping("middle", new CSSConstant("middle")); + addMapping("justify", new CSSConstant("justify")); + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/fo/FontStyleMapper.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/fo/FontStyleMapper.java index 5369dc589d32..5c6111c1f55a 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/fo/FontStyleMapper.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/fo/FontStyleMapper.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.parser.stylemapper.fo; import com.sun.star.report.pentaho.parser.StyleMapper; @@ -37,13 +35,14 @@ import org.jfree.layouting.input.style.keys.font.FontStyleKeys; public class FontStyleMapper implements StyleMapper { - public FontStyleMapper () - { - } - public void updateStyle (final String uri, final String attrName, final String attrValue, - final CSSDeclarationRule targetRule) - { - targetRule.setPropertyValueAsString(FontStyleKeys.FONT_STYLE, attrValue); - } + public FontStyleMapper() + { + } + + public void updateStyle(final String uri, final String attrName, final String attrValue, + final CSSDeclarationRule targetRule) + { + targetRule.setPropertyValueAsString(FontStyleKeys.FONT_STYLE, attrValue); + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/fo/FontWeightMapper.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/fo/FontWeightMapper.java index 49571efae772..ec73596462e5 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/fo/FontWeightMapper.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/fo/FontWeightMapper.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.parser.stylemapper.fo; import com.sun.star.report.pentaho.parser.StyleMapper; @@ -37,13 +35,14 @@ import org.jfree.layouting.input.style.keys.font.FontStyleKeys; public class FontWeightMapper implements StyleMapper { - public FontWeightMapper () - { - } - public void updateStyle (final String uri, final String attrName, final String attrValue, - final CSSDeclarationRule targetRule) - { - targetRule.setPropertyValueAsString(FontStyleKeys.FONT_WEIGHT, attrValue); - } + public FontWeightMapper() + { + } + + public void updateStyle(final String uri, final String attrName, final String attrValue, + final CSSDeclarationRule targetRule) + { + targetRule.setPropertyValueAsString(FontStyleKeys.FONT_WEIGHT, attrValue); + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/fo/TextAlignMapper.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/fo/TextAlignMapper.java index 93d1ee1d57c0..b619442076b6 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/fo/TextAlignMapper.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/fo/TextAlignMapper.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.parser.stylemapper.fo; import com.sun.star.report.pentaho.parser.stylemapper.OneOfConstantsMapper; @@ -37,15 +35,15 @@ import org.jfree.layouting.input.style.keys.text.TextStyleKeys; public class TextAlignMapper extends OneOfConstantsMapper { - public TextAlignMapper () - { - super(TextStyleKeys.TEXT_ALIGN); - addMapping("start", TextAlign.START); - addMapping("end", TextAlign.END); - addMapping("left", TextAlign.LEFT); - addMapping("center", TextAlign.CENTER); - addMapping("right", TextAlign.RIGHT); - addMapping("justify", TextAlign.JUSTIFY); - } + public TextAlignMapper() + { + super(TextStyleKeys.TEXT_ALIGN); + addMapping("start", TextAlign.START); + addMapping("end", TextAlign.END); + addMapping("left", TextAlign.LEFT); + addMapping("center", TextAlign.CENTER); + addMapping("right", TextAlign.RIGHT); + addMapping("justify", TextAlign.JUSTIFY); + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontFamilyGenericMapper.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontFamilyGenericMapper.java index f218fc465a94..fce338d5688b 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontFamilyGenericMapper.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontFamilyGenericMapper.java @@ -52,7 +52,10 @@ public class FontFamilyGenericMapper implements StyleMapper { final CSSStringValue cssVal = new CSSStringValue(CSSStringType.STRING, attrValue); targetRule.setPropertyValue(FontStyleKeys.FONT_FAMILY, - new CSSValueList(new CSSValue[]{cssVal})); + new CSSValueList(new CSSValue[] + { + cssVal + })); } else { diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontFamilyMapper.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontFamilyMapper.java index 019fea3182a2..696fb557bdde 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontFamilyMapper.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontFamilyMapper.java @@ -52,7 +52,10 @@ public class FontFamilyMapper implements StyleMapper { final CSSStringValue cssVal = new CSSStringValue(CSSStringType.STRING, attrValue); targetRule.setPropertyValue(FontStyleKeys.FONT_FAMILY, - new CSSValueList(new CSSValue[]{cssVal})); + new CSSValueList(new CSSValue[] + { + cssVal + })); } else { diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontNameMapper.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontNameMapper.java index f9d238bfcb79..cc6cd926f7c7 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontNameMapper.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontNameMapper.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.parser.stylemapper.style; import com.sun.star.report.pentaho.parser.StyleMapper; @@ -39,14 +37,15 @@ import org.jfree.layouting.input.style.keys.font.FontStyleKeys; public class FontNameMapper implements StyleMapper { - public FontNameMapper () - { - } - public void updateStyle (final String uri, final String attrName, final String attrValue, - final CSSDeclarationRule targetRule) - { - targetRule.setPropertyValue(FontStyleKeys.FONT_NAME, - new CSSStringValue(CSSStringType.STRING, attrValue)); - } + public FontNameMapper() + { + } + + public void updateStyle(final String uri, final String attrName, final String attrValue, + final CSSDeclarationRule targetRule) + { + targetRule.setPropertyValue(FontStyleKeys.FONT_NAME, + new CSSStringValue(CSSStringType.STRING, attrValue)); + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontPitchMapper.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontPitchMapper.java index ae180f8fac69..79dceddb88c6 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontPitchMapper.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontPitchMapper.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.parser.stylemapper.style; import com.sun.star.report.pentaho.parser.stylemapper.OneOfConstantsMapper; @@ -37,10 +35,11 @@ import org.jfree.layouting.input.style.values.CSSConstant; public class FontPitchMapper extends OneOfConstantsMapper { - public FontPitchMapper () - { - super (FontStyleKeys.FONT_PITCH); - addMapping("variable", new CSSConstant("variable")); - addMapping("fixed", new CSSConstant("fixed")); - } + + public FontPitchMapper() + { + super(FontStyleKeys.FONT_PITCH); + addMapping("variable", new CSSConstant("variable")); + addMapping("fixed", new CSSConstant("fixed")); + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontReliefMapper.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontReliefMapper.java index 059d01981a27..a9c18a8f7dc4 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontReliefMapper.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/FontReliefMapper.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.parser.stylemapper.style; import com.sun.star.report.pentaho.parser.StyleMapper; @@ -37,14 +35,14 @@ import org.jfree.layouting.input.style.keys.font.FontStyleKeys; public class FontReliefMapper implements StyleMapper { - public FontReliefMapper () - { - } + public FontReliefMapper() + { + } - public void updateStyle (final String uri, final String attrName, final String attrValue, - final CSSDeclarationRule targetRule) - { - targetRule.setPropertyValueAsString(FontStyleKeys.FONT_EFFECT, attrValue); - } + public void updateStyle(final String uri, final String attrName, final String attrValue, + final CSSDeclarationRule targetRule) + { + targetRule.setPropertyValueAsString(FontStyleKeys.FONT_EFFECT, attrValue); + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextEmphasizeMapper.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextEmphasizeMapper.java index 961e22c5eb63..e465e7da1527 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextEmphasizeMapper.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextEmphasizeMapper.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.parser.stylemapper.style; import com.sun.star.report.pentaho.parser.StyleMapper; @@ -36,14 +34,14 @@ import org.jfree.layouting.input.style.CSSDeclarationRule; public class TextEmphasizeMapper implements StyleMapper { - public TextEmphasizeMapper () - { - } + public TextEmphasizeMapper() + { + } - public void updateStyle (final String uri, final String attrName, final String attrValue, - final CSSDeclarationRule targetRule) - { - targetRule.setPropertyValueAsString("font-emphasize", attrValue); - } + public void updateStyle(final String uri, final String attrName, final String attrValue, + final CSSDeclarationRule targetRule) + { + targetRule.setPropertyValueAsString("font-emphasize", attrValue); + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineColorMapper.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineColorMapper.java index e0b4e309a9bc..b6b3812a834e 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineColorMapper.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineColorMapper.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.parser.stylemapper.style; import com.sun.star.report.pentaho.parser.StyleMapper; @@ -39,19 +37,20 @@ import org.jfree.layouting.util.ColorUtil; public class TextUnderlineColorMapper implements StyleMapper { - public TextUnderlineColorMapper () - { - } - public void updateStyle (final String uri, - final String attrName, - final String attrValue, - final CSSDeclarationRule targetRule) - { - final CSSColorValue cv = (CSSColorValue) ColorUtil.parseColor(attrValue); - if (cv != null) + public TextUnderlineColorMapper() + { + } + + public void updateStyle(final String uri, + final String attrName, + final String attrValue, + final CSSDeclarationRule targetRule) { - targetRule.setPropertyValue(TextStyleKeys.TEXT_UNDERLINE_COLOR, cv); + final CSSColorValue cv = (CSSColorValue) ColorUtil.parseColor(attrValue); + if (cv != null) + { + targetRule.setPropertyValue(TextStyleKeys.TEXT_UNDERLINE_COLOR, cv); + } } - } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineStyleMapper.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineStyleMapper.java index 70630674abbb..fcc4e8cc6a7a 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineStyleMapper.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineStyleMapper.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.parser.stylemapper.style; import com.sun.star.report.pentaho.parser.stylemapper.OneOfConstantsMapper; @@ -37,19 +35,17 @@ import org.jfree.layouting.input.style.keys.text.TextDecorationStyle; public class TextUnderlineStyleMapper extends OneOfConstantsMapper { - public TextUnderlineStyleMapper () - { - super(TextStyleKeys.TEXT_UNDERLINE_STYLE); - addMapping("none", TextDecorationStyle.NONE); - addMapping("solid", TextDecorationStyle.SOLID); - addMapping("dotted", TextDecorationStyle.DOTTED); - addMapping("dash", TextDecorationStyle.DASHED); - addMapping("long-dash", TextDecorationStyle.LONG_DASH); - addMapping("dot-dash", TextDecorationStyle.DOT_DASH); - addMapping("dot-dot-dash", TextDecorationStyle.DOT_DOT_DASH); - addMapping("wave", TextDecorationStyle.WAVE); - } - - + public TextUnderlineStyleMapper() + { + super(TextStyleKeys.TEXT_UNDERLINE_STYLE); + addMapping("none", TextDecorationStyle.NONE); + addMapping("solid", TextDecorationStyle.SOLID); + addMapping("dotted", TextDecorationStyle.DOTTED); + addMapping("dash", TextDecorationStyle.DASHED); + addMapping("long-dash", TextDecorationStyle.LONG_DASH); + addMapping("dot-dash", TextDecorationStyle.DOT_DASH); + addMapping("dot-dot-dash", TextDecorationStyle.DOT_DOT_DASH); + addMapping("wave", TextDecorationStyle.WAVE); + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineWordMode.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineWordMode.java index 3e2d879db846..aa23d66b131f 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineWordMode.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/TextUnderlineWordMode.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.parser.stylemapper.style; import com.sun.star.report.pentaho.parser.stylemapper.OneOfConstantsMapper; @@ -37,12 +35,11 @@ import org.jfree.layouting.input.style.keys.text.TextStyleKeys; public class TextUnderlineWordMode extends OneOfConstantsMapper { - public TextUnderlineWordMode () - { - super(TextStyleKeys.TEXT_UNDERLINE_MODE); - addMapping("continuous", TextDecorationMode.CONTINUOUS); - addMapping("skip-white-space", TextDecorationMode.SKIP_WHITE_SPACE); - } - + public TextUnderlineWordMode() + { + super(TextStyleKeys.TEXT_UNDERLINE_MODE); + addMapping("continuous", TextDecorationMode.CONTINUOUS); + addMapping("skip-white-space", TextDecorationMode.SKIP_WHITE_SPACE); + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/VerticalAlignMapper.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/VerticalAlignMapper.java index ad9ea12ac6fb..9b56b1ae14be 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/VerticalAlignMapper.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/style/VerticalAlignMapper.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.parser.stylemapper.style; import com.sun.star.report.pentaho.parser.stylemapper.OneOfConstantsMapper; @@ -38,13 +36,14 @@ import org.jfree.layouting.input.style.values.CSSConstant; public class VerticalAlignMapper extends OneOfConstantsMapper { - public VerticalAlignMapper () - { - super (LineStyleKeys.VERTICAL_ALIGN); - addMapping("top", new CSSConstant("top")); - addMapping("bottom", new CSSConstant("bottom")); - addMapping("middle", new CSSConstant("middle")); - addMapping("baseline", new CSSConstant("baseline")); - addMapping("auto", CSSAutoValue.getInstance()); - } + + public VerticalAlignMapper() + { + super(LineStyleKeys.VERTICAL_ALIGN); + addMapping("top", new CSSConstant("top")); + addMapping("bottom", new CSSConstant("bottom")); + addMapping("middle", new CSSConstant("middle")); + addMapping("baseline", new CSSConstant("baseline")); + addMapping("auto", CSSAutoValue.getInstance()); + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/table/ColumnWidthMapper.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/table/ColumnWidthMapper.java index fca9edd38d33..82adc828982c 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/table/ColumnWidthMapper.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/table/ColumnWidthMapper.java @@ -27,7 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - package com.sun.star.report.pentaho.parser.stylemapper.table; import com.sun.star.report.pentaho.parser.StyleMapper; @@ -41,15 +40,16 @@ import org.jfree.layouting.input.style.keys.box.BoxStyleKeys; */ public class ColumnWidthMapper implements StyleMapper { - public ColumnWidthMapper() - { - } - public void updateStyle(final String uri, - final String attrName, - final String attrValue, - final CSSDeclarationRule targetRule) - { - targetRule.setPropertyValueAsString(BoxStyleKeys.WIDTH, attrValue); - } + public ColumnWidthMapper() + { + } + + public void updateStyle(final String uri, + final String attrName, + final String attrValue, + final CSSDeclarationRule targetRule) + { + targetRule.setPropertyValueAsString(BoxStyleKeys.WIDTH, attrValue); + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/table/RowHeightMapper.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/table/RowHeightMapper.java index c305a85a1e05..57e4dcd9c559 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/table/RowHeightMapper.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/stylemapper/table/RowHeightMapper.java @@ -27,7 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - package com.sun.star.report.pentaho.parser.stylemapper.table; import com.sun.star.report.pentaho.parser.StyleMapper; @@ -41,15 +40,16 @@ import org.jfree.layouting.input.style.keys.box.BoxStyleKeys; */ public class RowHeightMapper implements StyleMapper { - public RowHeightMapper() - { - } - public void updateStyle(final String uri, - final String attrName, - final String attrValue, - final CSSDeclarationRule targetRule) - { - targetRule.setPropertyValueAsString(BoxStyleKeys.HEIGHT, attrValue); - } + public RowHeightMapper() + { + } + + public void updateStyle(final String uri, + final String attrName, + final String attrValue, + final CSSDeclarationRule targetRule) + { + targetRule.setPropertyValueAsString(BoxStyleKeys.HEIGHT, attrValue); + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/table/TableColumnReadHandler.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/table/TableColumnReadHandler.java index 5b9e11fcbac6..172e8b475459 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/table/TableColumnReadHandler.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/table/TableColumnReadHandler.java @@ -42,6 +42,7 @@ public class TableColumnReadHandler extends ElementReadHandler { private final Section tableColumn; + public TableColumnReadHandler() { tableColumn = new Section(); diff --git a/reportbuilder/java/com/sun/star/report/pentaho/parser/table/TableColumnsReadHandler.java b/reportbuilder/java/com/sun/star/report/pentaho/parser/table/TableColumnsReadHandler.java index a0052dbc1a9e..a72a5249af4c 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/parser/table/TableColumnsReadHandler.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/parser/table/TableColumnsReadHandler.java @@ -71,7 +71,7 @@ public class TableColumnsReadHandler extends ElementReadHandler final Attributes atts) throws SAXException { - if (OfficeNamespaces.TABLE_NS.equals(uri) && OfficeToken.TABLE_COLUMN.equals(tagName) ) + if (OfficeNamespaces.TABLE_NS.equals(uri) && OfficeToken.TABLE_COLUMN.equals(tagName)) { final TableColumnReadHandler readHandler = new TableColumnReadHandler(); columns.add(readHandler); diff --git a/reportbuilder/java/com/sun/star/report/pentaho/smil.css b/reportbuilder/java/com/sun/star/report/pentaho/smil.css index b01076ff30ae..54d59ac828e2 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/smil.css +++ b/reportbuilder/java/com/sun/star/report/pentaho/smil.css @@ -2,4 +2,4 @@ /** * All default styles for formating-objects elements (if there are any). - */ +*/ diff --git a/reportbuilder/java/com/sun/star/report/pentaho/star-office.css b/reportbuilder/java/com/sun/star/report/pentaho/star-office.css index da515eb88df9..22d57ca05a18 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/star-office.css +++ b/reportbuilder/java/com/sun/star/report/pentaho/star-office.css @@ -2,4 +2,4 @@ /** * All default styles for office elements. - */ +*/ diff --git a/reportbuilder/java/com/sun/star/report/pentaho/star-report.css b/reportbuilder/java/com/sun/star/report/pentaho/star-report.css index ef4e595d8bf0..56f98506cf40 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/star-report.css +++ b/reportbuilder/java/com/sun/star/report/pentaho/star-report.css @@ -3,43 +3,43 @@ @namespace report url("http://openoffice.org/2005/report"); table|table { - display: table; + display: table; } table|table-columns { - display: table-column-group; + display: table-column-group; } table|table-column { - display: table-column; + display: table-column; } table|table-row { - display: table-row; + display: table-row; } table|table-cell { - display: table-cell; + display: table-cell; } table|table-cell[number-columns-spanned], table|table-cell[number-columns-spanned], table|table-columns[number-columns-spanned], table|table-column[number-columns-spanned] { - -x-liblayout-colspan: attr("table|number-columns-spanned"); + -x-liblayout-colspan: attr("table|number-columns-spanned"); } table|table-cell[number-rows-spanned], table|table-cell[number-rows-spanned] { - -x-liblayout-rowspan: attr("table|number-rows-spanned"); + -x-liblayout-rowspan: attr("table|number-rows-spanned"); } /** * Style definitions for star report. - */ +*/ * { - vertical-align: baseline; + vertical-align: baseline; } /** @@ -58,15 +58,15 @@ table|table-cell[number-rows-spanned] { percentage fraction - */ +*/ @format number myname { - -x-liblayout-decimal-replacement: "-"; - -x-liblayout-display-factor: 1000; - content: "'Prefix'#,##0.00'postfix'"; + -x-liblayout-decimal-replacement: "-"; + -x-liblayout-display-factor: 1000; + content: "'Prefix'#,##0.00'postfix'"; } @format scientific anothername { - /* to be filled */ + /* to be filled */ } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/star-rpt.css b/reportbuilder/java/com/sun/star/report/pentaho/star-rpt.css index 6da26872b28e..47b6aca74d00 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/star-rpt.css +++ b/reportbuilder/java/com/sun/star/report/pentaho/star-rpt.css @@ -2,4 +2,4 @@ /** * All default styles for report elements. - */ +*/ diff --git a/reportbuilder/java/com/sun/star/report/pentaho/styles/LengthCalculator.java b/reportbuilder/java/com/sun/star/report/pentaho/styles/LengthCalculator.java index 9a0a330dbc15..1e041d6bce8d 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/styles/LengthCalculator.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/styles/LengthCalculator.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.styles; import org.jfree.layouting.input.style.values.CSSNumericType; @@ -44,73 +42,72 @@ import org.jfree.layouting.input.style.values.CSSNumericValue; */ public class LengthCalculator { - // and centimeter (x10) - private double millimeter; - - // and pica (x12) and inch(x72). Px is assumed to be in 96dpi. - private double point; + // and centimeter (x10) - private double pixel; + private double millimeter; + // and pica (x12) and inch(x72). Px is assumed to be in 96dpi. + private double point; + private double pixel; - public LengthCalculator() - { - } - - public void add (final CSSNumericValue value) - { - if (value == null) + public LengthCalculator() { - return; } - final CSSNumericType numericType = value.getType(); - if (numericType == CSSNumericType.CM) - { - millimeter += value.getValue() * 10; - } - else if (numericType == CSSNumericType.MM) + public void add(final CSSNumericValue value) { - millimeter += value.getValue(); - } - else if (numericType == CSSNumericType.PT) - { - point += value.getValue(); - } - else if (numericType == CSSNumericType.PC) - { - point += 12 * value.getValue(); - } - else if (numericType == CSSNumericType.INCH) - { - point += 72 * value.getValue(); - } - else if (numericType == CSSNumericType.PX) - { - pixel += value.getValue(); - } - // LOGGER.debug ("Adding " + value + " [mm: " + millimeter + "] [pt: " + point + "] px: [" + pixel + "]"); - } + if (value == null) + { + return; + } - public CSSNumericValue getResult () - { - if (pixel == 0 && point == 0) - { - return CSSNumericValue.createValue(CSSNumericType.MM, millimeter); + final CSSNumericType numericType = value.getType(); + if (numericType == CSSNumericType.CM) + { + millimeter += value.getValue() * 10; + } + else if (numericType == CSSNumericType.MM) + { + millimeter += value.getValue(); + } + else if (numericType == CSSNumericType.PT) + { + point += value.getValue(); + } + else if (numericType == CSSNumericType.PC) + { + point += 12 * value.getValue(); + } + else if (numericType == CSSNumericType.INCH) + { + point += 72 * value.getValue(); + } + else if (numericType == CSSNumericType.PX) + { + pixel += value.getValue(); + } + // LOGGER.debug ("Adding " + value + " [mm: " + millimeter + "] [pt: " + point + "] px: [" + pixel + "]"); } - if (pixel == 0 && millimeter == 0) - { - return CSSNumericValue.createValue(CSSNumericType.PT, point); - } - if (point == 0 && millimeter == 0) + + public CSSNumericValue getResult() { - return CSSNumericValue.createValue(CSSNumericType.PX, pixel); - } - // else convert it. + if (pixel == 0 && point == 0) + { + return CSSNumericValue.createValue(CSSNumericType.MM, millimeter); + } + if (pixel == 0 && millimeter == 0) + { + return CSSNumericValue.createValue(CSSNumericType.PT, point); + } + if (point == 0 && millimeter == 0) + { + return CSSNumericValue.createValue(CSSNumericType.PX, pixel); + } + // else convert it. - double result = point; - result += (millimeter * 10 * 72 / 254); - result += pixel * 72 / 96; + double result = point; + result += (millimeter * 10 * 72 / 254); + result += pixel * 72 / 96; - return CSSNumericValue.createValue(CSSNumericType.PT, result); - } + return CSSNumericValue.createValue(CSSNumericType.PT, result); + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMapper.java b/reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMapper.java index 1424d0becad6..6cb6add68697 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMapper.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMapper.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.styles; import java.util.HashMap; @@ -54,53 +52,47 @@ import org.pentaho.reporting.libraries.resourceloader.ResourceManager; */ public class StyleMapper { - private final Map backend; - public StyleMapper() - { - this.backend = new HashMap(); - } + private final Map backend; - public void addMapping(final StyleMappingRule rule) - { - backend.put(rule.getKey(), rule); - } + public StyleMapper() + { + this.backend = new HashMap(); + } - public boolean isListOfStyles(final String elementNamespace, - final String elementTagName, - final String attributeNamespace, - final String attributeName) - { - final StyleMapperKey key = new StyleMapperKey - (elementNamespace, elementTagName, attributeNamespace, attributeName); - final StyleMappingRule rule = (StyleMappingRule) backend.get(key); - if (rule == null) + public void addMapping(final StyleMappingRule rule) { - return false; + backend.put(rule.getKey(), rule); } - return rule.isListOfValues(); - } - public String getStyleFamilyFor(final String elementNamespace, - final String elementTagName, - final String attributeNamespace, - final String attributeName) - { - final StyleMapperKey key = new StyleMapperKey - (elementNamespace, elementTagName, attributeNamespace, attributeName); - final StyleMappingRule rule = (StyleMappingRule) backend.get(key); - if (rule == null) + public boolean isListOfStyles(final String elementNamespace, + final String elementTagName, + final String attributeNamespace, + final String attributeName) { - return null; + final StyleMapperKey key = new StyleMapperKey(elementNamespace, elementTagName, attributeNamespace, attributeName); + final StyleMappingRule rule = (StyleMappingRule) backend.get(key); + return rule != null && rule.isListOfValues(); } - return rule.getFamily(); - } - public static StyleMapper loadInstance (final ResourceManager resourceManager) - throws ResourceException - { - final Resource resource = resourceManager.createDirectly - ("res://com/sun/star/report/pentaho/styles/stylemapper.xml", StyleMapper.class); - return (StyleMapper) resource.getResource(); - } + public String getStyleFamilyFor(final String elementNamespace, + final String elementTagName, + final String attributeNamespace, + final String attributeName) + { + final StyleMapperKey key = new StyleMapperKey(elementNamespace, elementTagName, attributeNamespace, attributeName); + final StyleMappingRule rule = (StyleMappingRule) backend.get(key); + if (rule == null) + { + return null; + } + return rule.getFamily(); + } + + public static StyleMapper loadInstance(final ResourceManager resourceManager) + throws ResourceException + { + final Resource resource = resourceManager.createDirectly("res://com/sun/star/report/pentaho/styles/stylemapper.xml", StyleMapper.class); + return (StyleMapper) resource.getResource(); + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMapperKey.java b/reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMapperKey.java index 64b50cba1197..496bfd23387f 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMapperKey.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMapperKey.java @@ -96,9 +96,7 @@ public final class StyleMapperKey final StyleMapperKey that = (StyleMapperKey) o; - if ((attributeName != null ? !attributeName.equals(that.attributeName) : that.attributeName != null) || - (attributeNamespace != null ? !attributeNamespace.equals(that.attributeNamespace) : that.attributeNamespace != null) || - !elementName.equals(that.elementName) || !elementNamespace.equals(that.elementNamespace)) + if ((attributeName != null ? !attributeName.equals(that.attributeName) : that.attributeName != null) || (attributeNamespace != null ? !attributeNamespace.equals(that.attributeNamespace) : that.attributeNamespace != null) || !elementName.equals(that.elementName) || !elementNamespace.equals(that.elementNamespace)) { return false; } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMapperXmlFactoryModule.java b/reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMapperXmlFactoryModule.java index 0b6319af3848..09802517e0a2 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMapperXmlFactoryModule.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMapperXmlFactoryModule.java @@ -57,8 +57,7 @@ public class StyleMapperXmlFactoryModule implements XmlFactoryModule public int getDocumentSupport(final XmlDocumentInfo documentInfo) { final String rootNamespace = documentInfo.getRootElementNameSpace(); - if (StyleMapperXmlFactoryModule.NAMESPACE.equals(rootNamespace) && - "style-mapper-definition".equals(documentInfo.getRootElement())) + if (StyleMapperXmlFactoryModule.NAMESPACE.equals(rootNamespace) && "style-mapper-definition".equals(documentInfo.getRootElement())) { return XmlFactoryModule.RECOGNIZED_BY_NAMESPACE; diff --git a/reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMapperXmlResourceFactory.java b/reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMapperXmlResourceFactory.java index 4d9646303b38..5574bf022353 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMapperXmlResourceFactory.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMapperXmlResourceFactory.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.styles; import org.pentaho.reporting.libraries.xmlns.parser.AbstractXmlResourceFactory; @@ -43,17 +41,18 @@ import org.pentaho.reporting.libraries.base.config.Configuration; */ public class StyleMapperXmlResourceFactory extends AbstractXmlResourceFactory { - public StyleMapperXmlResourceFactory() - { - } - protected Configuration getConfiguration() - { - return JFreeReportBoot.getInstance().getGlobalConfig(); - } + public StyleMapperXmlResourceFactory() + { + } + + protected Configuration getConfiguration() + { + return JFreeReportBoot.getInstance().getGlobalConfig(); + } - public Class getFactoryType() - { - return StyleMapper.class; - } + public Class getFactoryType() + { + return StyleMapper.class; + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMappingReadHandler.java b/reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMappingReadHandler.java index 21101d847e44..7db04ffc5d93 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMappingReadHandler.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMappingReadHandler.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.styles; import org.pentaho.reporting.libraries.xmlns.parser.AbstractXmlReadHandler; @@ -44,66 +42,62 @@ import org.xml.sax.SAXException; */ public class StyleMappingReadHandler extends AbstractXmlReadHandler { - private StyleMappingRule rule; - - public StyleMappingReadHandler() - { - } + private StyleMappingRule rule; - /** - * Starts parsing. - * - * @param attrs the attributes. - * @throws org.xml.sax.SAXException if there is a parsing error. - */ - protected void startParsing(final Attributes attrs) - throws SAXException - { - final String elementNamespace = attrs.getValue(getUri(), - "element-namespace"); - if (elementNamespace == null) + public StyleMappingReadHandler() { - throw new ParseException - ("Required attribute 'element-namespace' is missing", getLocator()); } - final String elementName = attrs.getValue(getUri(), "element-name"); - - if (elementName == null) + /** + * Starts parsing. + * + * @param attrs the attributes. + * @throws org.xml.sax.SAXException if there is a parsing error. + */ + protected void startParsing(final Attributes attrs) + throws SAXException { - throw new ParseException - ("Required attribute 'element-name' is missing", getLocator()); - } + final String elementNamespace = attrs.getValue(getUri(), + "element-namespace"); + if (elementNamespace == null) + { + throw new ParseException("Required attribute 'element-namespace' is missing", getLocator()); + } - final String attributeNamespace = attrs.getValue(getUri(), - "attribute-namespace"); - final String attributeName = attrs.getValue(getUri(), "attribute-name"); + final String elementName = attrs.getValue(getUri(), "element-name"); - final boolean listOfValues = - "styleNameRefs".equals(attrs.getValue(getUri(), "type")); + if (elementName == null) + { + throw new ParseException("Required attribute 'element-name' is missing", getLocator()); + } - final String family = attrs.getValue(getUri(), "style-family"); - final StyleMapperKey key = new StyleMapperKey - (elementNamespace, elementName, attributeNamespace, attributeName); - rule = new StyleMappingRule(key, family, listOfValues); - } + final String attributeNamespace = attrs.getValue(getUri(), + "attribute-namespace"); + final String attributeName = attrs.getValue(getUri(), "attribute-name"); + final boolean listOfValues = + "styleNameRefs".equals(attrs.getValue(getUri(), "type")); - public StyleMappingRule getRule() - { - return rule; - } + final String family = attrs.getValue(getUri(), "style-family"); + final StyleMapperKey key = new StyleMapperKey(elementNamespace, elementName, attributeNamespace, attributeName); + rule = new StyleMappingRule(key, family, listOfValues); + } - /** - * Returns the object for this element or null, if this element does not - * create an object. - * - * @return the object. - */ - public Object getObject() - throws SAXException - { - return rule; - } + public StyleMappingRule getRule() + { + return rule; + } + + /** + * Returns the object for this element or null, if this element does not + * create an object. + * + * @return the object. + */ + public Object getObject() + throws SAXException + { + return rule; + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMappingRule.java b/reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMappingRule.java index 742daf8ba6e5..e0fbd62a77d8 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMappingRule.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/styles/StyleMappingRule.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.pentaho.styles; /** @@ -39,32 +37,31 @@ package com.sun.star.report.pentaho.styles; */ public class StyleMappingRule { - private final StyleMapperKey key; - private final String family; - private final boolean listOfValues; - - public StyleMappingRule(final StyleMapperKey key, final String family, - final boolean listOfValues) - { - this.key = key; - this.family = family; - this.listOfValues = listOfValues; - } + private final StyleMapperKey key; + private final String family; + private final boolean listOfValues; + public StyleMappingRule(final StyleMapperKey key, final String family, + final boolean listOfValues) + { + this.key = key; + this.family = family; + this.listOfValues = listOfValues; + } - public StyleMapperKey getKey() - { - return key; - } + public StyleMapperKey getKey() + { + return key; + } - public String getFamily() - { - return family; - } + public String getFamily() + { + return family; + } - public boolean isListOfValues() - { - return listOfValues; - } + public boolean isListOfValues() + { + return listOfValues; + } } diff --git a/reportbuilder/java/com/sun/star/report/pentaho/styles/stylemapper.xsd b/reportbuilder/java/com/sun/star/report/pentaho/styles/stylemapper.xsd index 905dbc8464d6..93392a6f0ea1 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/styles/stylemapper.xsd +++ b/reportbuilder/java/com/sun/star/report/pentaho/styles/stylemapper.xsd @@ -34,62 +34,62 @@ xmlns="http://jfreereport.sourceforge.net/namespaces/engine/openoffice/stylemapper" targetNamespace="http://jfreereport.sourceforge.net/namespaces/engine/openoffice/stylemapper" attributeFormDefault="unqualified"> - - + + This schema describes the format of the stylemapper definition file. The stylemapper declares what style-families are referenced by an element. - - + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - + + + + + + + + + + + diff --git a/reportbuilder/java/com/sun/star/report/pentaho/svg.css b/reportbuilder/java/com/sun/star/report/pentaho/svg.css index f715210c7c91..ebe16e30b115 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/svg.css +++ b/reportbuilder/java/com/sun/star/report/pentaho/svg.css @@ -2,4 +2,4 @@ /** * All default styles for formating-objects elements (if there are any). - */ +*/ diff --git a/reportbuilder/java/com/sun/star/report/pentaho/xsl-fo.css b/reportbuilder/java/com/sun/star/report/pentaho/xsl-fo.css index 494ee66934e7..f030a3872481 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/xsl-fo.css +++ b/reportbuilder/java/com/sun/star/report/pentaho/xsl-fo.css @@ -2,4 +2,4 @@ /** * All default styles for formating-objects elements (if there are any). - */ +*/ diff --git a/reportbuilder/java/com/sun/star/report/util/DefaultJobProperties.java b/reportbuilder/java/com/sun/star/report/util/DefaultJobProperties.java index 9cd70b1c69f0..096882a29c02 100644 --- a/reportbuilder/java/com/sun/star/report/util/DefaultJobProperties.java +++ b/reportbuilder/java/com/sun/star/report/util/DefaultJobProperties.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.util; import java.util.HashMap; @@ -40,44 +38,45 @@ import java.util.Map; public class DefaultJobProperties implements JobProperties { - private final ReportEngineMetaData metaData; - private final Map properties; - public DefaultJobProperties (final ReportEngineMetaData metaData) - { - if (metaData == null) + private final ReportEngineMetaData metaData; + private final Map properties; + + public DefaultJobProperties(final ReportEngineMetaData metaData) { - throw new NullPointerException(); + if (metaData == null) + { + throw new NullPointerException(); + } + this.properties = new HashMap(); + this.metaData = metaData; } - this.properties = new HashMap(); - this.metaData = metaData; - } - public Object getProperty (final String key) - { - return properties.get(key); - } - - public void setProperty (final String key, final Object value) - throws JobDefinitionException - { - final Class type = metaData.getParameterType(key); - if (type == null) + public Object getProperty(final String key) { - throw new JobDefinitionException("The parameter name is not known: " + key); + return properties.get(key); } - if (!type.isInstance(value)) + + public void setProperty(final String key, final Object value) + throws JobDefinitionException { - throw new JobDefinitionException("The parameter value is not understood"); - } + final Class type = metaData.getParameterType(key); + if (type == null) + { + throw new JobDefinitionException("The parameter name is not known: " + key); + } + if (!type.isInstance(value)) + { + throw new JobDefinitionException("The parameter value is not understood"); + } - this.properties.put(key, value); - } + this.properties.put(key, value); + } - public JobProperties copy() - { - final DefaultJobProperties props = new DefaultJobProperties(metaData); - props.properties.putAll(properties); - return props; - } + public JobProperties copy() + { + final DefaultJobProperties props = new DefaultJobProperties(metaData); + props.properties.putAll(properties); + return props; + } } diff --git a/reportbuilder/java/com/sun/star/report/util/DefaultParameterMap.java b/reportbuilder/java/com/sun/star/report/util/DefaultParameterMap.java index 29ee586d5075..f6766a53f1a9 100644 --- a/reportbuilder/java/com/sun/star/report/util/DefaultParameterMap.java +++ b/reportbuilder/java/com/sun/star/report/util/DefaultParameterMap.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.util; import java.util.HashMap; @@ -38,92 +36,90 @@ import java.util.Map; public class DefaultParameterMap implements ParameterMap { - private final Map backend; - - public DefaultParameterMap () - { - backend = new HashMap(); - } - public void clear () - { - backend.clear(); - } + private final Map backend; - /** - * Retrieves the value stored for a key in this properties collection. - * - * @param key the property key. - * @return The stored value, or null if the key does not exist in this - * collection. - */ - public Object get (final String key) - { - if (key == null) + public DefaultParameterMap() { - throw new NullPointerException - ("DefaultParameterMap.get (..): Parameter 'key' must not be null"); + backend = new HashMap(); } - return backend.get(key); - } - /** - * Retrieves the value stored for a key in this properties collection, and returning the - * default value if the key was not stored in this properties collection. - * - * @param key the property key. - * @param defaultValue the default value to be returned when the key is not stored in - * this properties collection. - * @return The stored value, or the default value if the key does not exist in this - * collection. - */ - public Object get (final String key, final Object defaultValue) - { - if (key == null) + public void clear() { - throw new NullPointerException - ("DefaultParameterMap.get (..): Parameter 'key' must not be null"); + backend.clear(); } - final Object o = this.backend.get(key); - if (o == null) + + /** + * Retrieves the value stored for a key in this properties collection. + * + * @param key the property key. + * @return The stored value, or null if the key does not exist in this + * collection. + */ + public Object get(final String key) { - return defaultValue; + if (key == null) + { + throw new NullPointerException("DefaultParameterMap.get (..): Parameter 'key' must not be null"); + } + return backend.get(key); } - return o; - } - - public String[] keys () - { - return (String[]) this.backend.keySet().toArray(new String[backend.size()]); - } - /** - * Adds a property to this properties collection. If a property with the given name - * exist, the property will be replaced with the new value. If the value is null, the - * property will be removed. - * - * @param key the property key. - * @param value the property value. - */ - public void put (final String key, final Object value) - { - if (key == null) + /** + * Retrieves the value stored for a key in this properties collection, and returning the + * default value if the key was not stored in this properties collection. + * + * @param key the property key. + * @param defaultValue the default value to be returned when the key is not stored in + * this properties collection. + * @return The stored value, or the default value if the key does not exist in this + * collection. + */ + public Object get(final String key, final Object defaultValue) { - throw new NullPointerException - ("ReportProperties.put (..): Parameter 'key' must not be null"); + if (key == null) + { + throw new NullPointerException("DefaultParameterMap.get (..): Parameter 'key' must not be null"); + } + final Object o = this.backend.get(key); + if (o == null) + { + return defaultValue; + } + return o; } - if (value == null) + + public String[] keys() { - this.backend.remove(key); + return (String[]) this.backend.keySet().toArray(new String[backend.size()]); } - else + + /** + * Adds a property to this properties collection. If a property with the given name + * exist, the property will be replaced with the new value. If the value is null, the + * property will be removed. + * + * @param key the property key. + * @param value the property value. + */ + public void put(final String key, final Object value) { - this.backend.put(key, value); + if (key == null) + { + throw new NullPointerException("ReportProperties.put (..): Parameter 'key' must not be null"); + } + if (value == null) + { + this.backend.remove(key); + } + else + { + this.backend.put(key, value); + } } - } - public int size () - { - return this.backend.size(); - } + public int size() + { + return this.backend.size(); + } } diff --git a/reportbuilder/java/com/sun/star/report/util/DefaultReportJobDefinition.java b/reportbuilder/java/com/sun/star/report/util/DefaultReportJobDefinition.java index f9e7420d600a..83ea4eb0eedc 100644 --- a/reportbuilder/java/com/sun/star/report/util/DefaultReportJobDefinition.java +++ b/reportbuilder/java/com/sun/star/report/util/DefaultReportJobDefinition.java @@ -27,8 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - - package com.sun.star.report.util; import com.sun.star.report.DataSourceFactory; @@ -43,81 +41,79 @@ import com.sun.star.report.ReportJobDefinition; public class DefaultReportJobDefinition implements ReportJobDefinition { - public static final String OUTPUT_TYPE = "output-type"; - - private final DefaultParameterMap parameters; - private final DefaultJobProperties properties; - - public DefaultReportJobDefinition (final ReportEngineMetaData metaData) - { - this.parameters = new DefaultParameterMap(); - this.properties = new DefaultJobProperties(metaData); - } - - public void setDataSourceFactory (final DataSourceFactory dataSourceFactory) - throws JobDefinitionException - { - this.properties.setProperty(ReportEngineParameterNames.INPUT_DATASOURCE_FACTORY, dataSourceFactory); - } - - public DataSourceFactory getDataSourceFactory () - { - return (DataSourceFactory) this.properties.getProperty(ReportEngineParameterNames.INPUT_DATASOURCE_FACTORY); - } - - public InputRepository getInputRepository () - { - return (InputRepository) - this.properties.getProperty(ReportEngineParameterNames.INPUT_REPOSITORY); - } - - public void setInputRepository (final InputRepository inputRepository) - throws JobDefinitionException - { - this.properties.setProperty(ReportEngineParameterNames.INPUT_REPOSITORY, inputRepository); - } - - public OutputRepository getOutputRepository () - { - return (OutputRepository) - this.properties.getProperty(ReportEngineParameterNames.OUTPUT_REPOSITORY); - } - - public void setOutputRepository (final OutputRepository outputRepository) - throws JobDefinitionException - { - this.properties.setProperty(ReportEngineParameterNames.OUTPUT_REPOSITORY, outputRepository); - } - - /** - * The parameters of the root report definition. The parameters for the subreports are - * defined using mappings, it would not make sense to define them here. - * - * @return a map container for query parameters. - */ - public ParameterMap getQueryParameters () - { - return parameters; - } - - public void setReportDefinitionName (final String reportDefinitionName) - throws JobDefinitionException - { - this.properties.setProperty(ReportEngineParameterNames.INPUT_NAME, reportDefinitionName); - } - - /** - * The name under which we can load the report definition. - * - * @return the report definition's name. - */ - public String getReportDefinitionName () - { - return (String) this.properties.getProperty(ReportEngineParameterNames.INPUT_NAME); - } - public JobProperties getProcessingParameters () - { - return properties; - } + public static final String OUTPUT_TYPE = "output-type"; + private final DefaultParameterMap parameters; + private final DefaultJobProperties properties; + + public DefaultReportJobDefinition(final ReportEngineMetaData metaData) + { + this.parameters = new DefaultParameterMap(); + this.properties = new DefaultJobProperties(metaData); + } + + public void setDataSourceFactory(final DataSourceFactory dataSourceFactory) + throws JobDefinitionException + { + this.properties.setProperty(ReportEngineParameterNames.INPUT_DATASOURCE_FACTORY, dataSourceFactory); + } + + public DataSourceFactory getDataSourceFactory() + { + return (DataSourceFactory) this.properties.getProperty(ReportEngineParameterNames.INPUT_DATASOURCE_FACTORY); + } + + public InputRepository getInputRepository() + { + return (InputRepository) this.properties.getProperty(ReportEngineParameterNames.INPUT_REPOSITORY); + } + + public void setInputRepository(final InputRepository inputRepository) + throws JobDefinitionException + { + this.properties.setProperty(ReportEngineParameterNames.INPUT_REPOSITORY, inputRepository); + } + + public OutputRepository getOutputRepository() + { + return (OutputRepository) this.properties.getProperty(ReportEngineParameterNames.OUTPUT_REPOSITORY); + } + + public void setOutputRepository(final OutputRepository outputRepository) + throws JobDefinitionException + { + this.properties.setProperty(ReportEngineParameterNames.OUTPUT_REPOSITORY, outputRepository); + } + + /** + * The parameters of the root report definition. The parameters for the subreports are + * defined using mappings, it would not make sense to define them here. + * + * @return a map container for query parameters. + */ + public ParameterMap getQueryParameters() + { + return parameters; + } + + public void setReportDefinitionName(final String reportDefinitionName) + throws JobDefinitionException + { + this.properties.setProperty(ReportEngineParameterNames.INPUT_NAME, reportDefinitionName); + } + + /** + * The name under which we can load the report definition. + * + * @return the report definition's name. + */ + public String getReportDefinitionName() + { + return (String) this.properties.getProperty(ReportEngineParameterNames.INPUT_NAME); + } + + public JobProperties getProcessingParameters() + { + return properties; + } } diff --git a/reportbuilder/java/com/sun/star/report/util/ManifestWriter.java b/reportbuilder/java/com/sun/star/report/util/ManifestWriter.java index 9fab3246ae8f..c07e7ae0e262 100644 --- a/reportbuilder/java/com/sun/star/report/util/ManifestWriter.java +++ b/reportbuilder/java/com/sun/star/report/util/ManifestWriter.java @@ -27,7 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - package com.sun.star.report.util; import java.util.HashMap; @@ -52,71 +51,72 @@ import com.sun.star.report.OutputRepository; public class ManifestWriter { // need this two strings other it breaks the ooo build :-( - public static final String MANIFEST_NS = "urn:oasis:names:tc:opendocument:xmlns:manifest:1.0"; - public static final String TAG_DEF_PREFIX = "com.sun.star.report.pentaho.output."; - private final Map entries; - public ManifestWriter() - { - entries = new HashMap(); - } + public static final String MANIFEST_NS = "urn:oasis:names:tc:opendocument:xmlns:manifest:1.0"; + public static final String TAG_DEF_PREFIX = "com.sun.star.report.pentaho.output."; + private final Map entries; - public void addEntry(final String fullPath, final String mimeType) - { - if (fullPath == null) + public ManifestWriter() { - throw new NullPointerException(); + entries = new HashMap(); } - if (mimeType == null) + + public void addEntry(final String fullPath, final String mimeType) { - throw new NullPointerException(); + if (fullPath == null) + { + throw new NullPointerException(); + } + if (mimeType == null) + { + throw new NullPointerException(); + } + if ("META-INF/manifest.xml".equals(fullPath)) + { + return; + } + entries.put(fullPath, mimeType); } - if ("META-INF/manifest.xml".equals(fullPath)) + + public boolean isEmpty() { - return; + return entries.isEmpty(); } - entries.put(fullPath, mimeType); - } - - public boolean isEmpty() - { - return entries.isEmpty(); - } - public void write(final OutputRepository outputRepository) throws IOException - { - if (isEmpty()) + public void write(final OutputRepository outputRepository) throws IOException { - return; - } + if (isEmpty()) + { + return; + } - final DefaultTagDescription tagDescription = new DefaultTagDescription(); - tagDescription.configure(JFreeReportBoot.getInstance().getGlobalConfig(), - TAG_DEF_PREFIX); + final DefaultTagDescription tagDescription = new DefaultTagDescription(); + tagDescription.configure(JFreeReportBoot.getInstance().getGlobalConfig(), + TAG_DEF_PREFIX); - final OutputStream manifestOutputStream = - outputRepository.createOutputStream("META-INF/manifest.xml", "text/xml"); + final OutputStream manifestOutputStream = + outputRepository.createOutputStream("META-INF/manifest.xml", "text/xml"); - final OutputStreamWriter writer = new OutputStreamWriter(manifestOutputStream, "UTF-8"); - final XmlWriter xmlWriter = new XmlWriter(writer, tagDescription); - xmlWriter.setAlwaysAddNamespace(true); - xmlWriter.writeXmlDeclaration("UTF-8"); + final OutputStreamWriter writer = new OutputStreamWriter(manifestOutputStream, "UTF-8"); + final XmlWriter xmlWriter = new XmlWriter(writer, tagDescription); + xmlWriter.setAlwaysAddNamespace(true); + xmlWriter.writeXmlDeclaration("UTF-8"); - final AttributeList rootAttributes = new AttributeList(); - rootAttributes.addNamespaceDeclaration("manifest", MANIFEST_NS); - xmlWriter.writeTag(MANIFEST_NS, "manifest", rootAttributes, XmlWriterSupport.OPEN); + final AttributeList rootAttributes = new AttributeList(); + rootAttributes.addNamespaceDeclaration("manifest", MANIFEST_NS); + xmlWriter.writeTag(MANIFEST_NS, "manifest", rootAttributes, XmlWriterSupport.OPEN); - final Iterator iterator = entries.entrySet().iterator(); - while (iterator.hasNext()) - { - final Map.Entry entry = (Map.Entry) iterator.next(); - final AttributeList entryAttrs = new AttributeList(); - entryAttrs.setAttribute(MANIFEST_NS, "media-type", (String) entry.getValue()); - entryAttrs.setAttribute(MANIFEST_NS, "full-path", (String) entry.getKey()); - xmlWriter.writeTag(MANIFEST_NS, "file-entry", entryAttrs, XmlWriterSupport.CLOSE); - } + final Iterator iterator = entries.entrySet().iterator(); + while (iterator.hasNext()) + { + final Map.Entry entry = (Map.Entry) iterator.next(); + final AttributeList entryAttrs = new AttributeList(); + entryAttrs.setAttribute(MANIFEST_NS, "media-type", (String) entry.getValue()); + entryAttrs.setAttribute(MANIFEST_NS, "full-path", (String) entry.getKey()); + xmlWriter.writeTag(MANIFEST_NS, "file-entry", entryAttrs, XmlWriterSupport.CLOSE); + } - xmlWriter.writeCloseTag(); - xmlWriter.close(); - } + xmlWriter.writeCloseTag(); + xmlWriter.close(); + } } -- cgit v1.2.3 From bf3e97339b940da3894cbf1e286c7186bf9baff6 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 19 Nov 2009 12:36:49 +0100 Subject: vcl108: #i106742# update xpdf to 3.02pl4 --- xpdf/xpdf-3.02.patch | 272 ++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 236 insertions(+), 36 deletions(-) diff --git a/xpdf/xpdf-3.02.patch b/xpdf/xpdf-3.02.patch index 82d4ffadb701..341ad73132a2 100644 --- a/xpdf/xpdf-3.02.patch +++ b/xpdf/xpdf-3.02.patch @@ -1,16 +1,5 @@ ---- misc/xpdf-3.02/goo/GString.cc Tue Feb 27 23:05:51 2007 -+++ misc/build/xpdf-3.02/goo/GString.cc Mon Apr 7 13:16:54 2008 -@@ -528,7 +528,7 @@ - if ((neg = x < 0)) { - x = -x; - } -- x = floor(x * pow(10, prec) + 0.5); -+ x = floor(x * pow(10.0, prec) + 0.5); - i = bufSize; - started = !trim; - for (j = 0; j < prec && i > 1; ++j) { --- misc/xpdf-3.02/goo/gmem.cc 2007-02-27 23:05:51.000000000 +0100 -+++ misc/build/xpdf-3.02/goo/gmem.cc 2009-04-22 19:21:14.274507454 +0200 ++++ misc/build/xpdf-3.02/goo/gmem.cc 2009-11-10 11:43:10.374175496 +0100 @@ -55,7 +55,15 @@ void *data; unsigned long *trl, *p; @@ -79,8 +68,19 @@ if (p) { free(p); } ---- misc/xpdf-3.02/ms_make.bat Tue Feb 27 23:05:51 2007 -+++ misc/build/xpdf-3.02/ms_make.bat Mon Apr 7 13:16:54 2008 +--- misc/xpdf-3.02/goo/GString.cc 2007-02-27 23:05:51.000000000 +0100 ++++ misc/build/xpdf-3.02/goo/GString.cc 2009-11-10 11:43:10.368006116 +0100 +@@ -528,7 +528,7 @@ + if ((neg = x < 0)) { + x = -x; + } +- x = floor(x * pow(10, prec) + 0.5); ++ x = floor(x * pow(10.0, prec) + 0.5); + i = bufSize; + started = !trim; + for (j = 0; j < prec && i > 1; ++j) { +--- misc/xpdf-3.02/ms_make.bat 2007-02-27 23:05:51.000000000 +0100 ++++ misc/build/xpdf-3.02/ms_make.bat 2009-11-10 11:43:10.450112062 +0100 @@ -1,5 +1,5 @@ set CC=cl -set CFLAGS=/DWIN32 /I.. /I..\goo /I..\fofi /O2 /nologo @@ -135,8 +135,121 @@ -%CXX% %LINKFLAGS% /Fepdftoppm.exe Annot.obj Array.obj BuiltinFont.obj BuiltinFontTables.obj Catalog.obj CharCodeToUnicode.obj CMap.obj Decrypt.obj Dict.obj Error.obj FontEncodingTables.obj Function.obj Gfx.obj GfxFont.obj GfxState.obj GlobalParams.obj JArithmeticDecoder.obj JBIG2Stream.obj JPXStream.obj Lexer.obj Link.obj NameToCharCode.obj Object.obj Outline.obj OutputDev.obj Page.obj Parser.obj PDFDoc.obj PDFDocEncoding.obj PSTokenizer.obj SecurityHandler.obj SplashOutputDev.obj Stream.obj UnicodeMap.obj UnicodeTypeTable.obj XRef.obj pdftoppm.obj ..\splash\splash.lib ..\fofi\fofi.lib ..\goo\Goo.lib %FT2DIR%\freetype2.lib shell32.lib user32.lib gdi32.lib advapi32.lib - -cd .. +--- misc/xpdf-3.02/splash/SplashBitmap.cc 2007-02-27 23:05:52.000000000 +0100 ++++ misc/build/xpdf-3.02/splash/SplashBitmap.cc 2009-11-10 11:43:54.912615507 +0100 +@@ -11,6 +11,7 @@ + #endif + + #include ++#include + #include "gmem.h" + #include "SplashErrorCodes.h" + #include "SplashBitmap.h" +@@ -27,30 +28,48 @@ + mode = modeA; + switch (mode) { + case splashModeMono1: +- rowSize = (width + 7) >> 3; ++ if (width > 0) { ++ rowSize = (width + 7) >> 3; ++ } else { ++ rowSize = -1; ++ } + break; + case splashModeMono8: +- rowSize = width; ++ if (width > 0) { ++ rowSize = width; ++ } else { ++ rowSize = -1; ++ } + break; + case splashModeRGB8: + case splashModeBGR8: +- rowSize = width * 3; ++ if (width > 0 && width <= INT_MAX / 3) { ++ rowSize = width * 3; ++ } else { ++ rowSize = -1; ++ } + break; + #if SPLASH_CMYK + case splashModeCMYK8: +- rowSize = width * 4; ++ if (width > 0 && width <= INT_MAX / 4) { ++ rowSize = width * 4; ++ } else { ++ rowSize = -1; ++ } + break; + #endif + } +- rowSize += rowPad - 1; +- rowSize -= rowSize % rowPad; +- data = (SplashColorPtr)gmalloc(rowSize * height); ++ if (rowSize > 0) { ++ rowSize += rowPad - 1; ++ rowSize -= rowSize % rowPad; ++ } ++ data = (SplashColorPtr)gmallocn(height, rowSize); + if (!topDown) { + data += (height - 1) * rowSize; + rowSize = -rowSize; + } + if (alphaA) { +- alpha = (Guchar *)gmalloc(width * height); ++ alpha = (Guchar *)gmallocn(width, height); + } else { + alpha = NULL; + } +--- misc/xpdf-3.02/splash/Splash.cc 2007-02-27 23:05:52.000000000 +0100 ++++ misc/build/xpdf-3.02/splash/Splash.cc 2009-11-10 11:43:54.894089400 +0100 +@@ -12,6 +12,7 @@ + + #include + #include ++#include + #include "gmem.h" + #include "SplashErrorCodes.h" + #include "SplashMath.h" +@@ -1912,7 +1913,10 @@ + xq = w % scaledWidth; + + // allocate pixel buffer +- pixBuf = (SplashColorPtr)gmalloc((yp + 1) * w); ++ if (yp < 0 || yp > INT_MAX - 1) { ++ return splashErrBadArg; ++ } ++ pixBuf = (SplashColorPtr)gmallocn(yp + 1, w); + + // initialize the pixel pipe + pipeInit(&pipe, 0, 0, state->fillPattern, NULL, state->fillAlpha, +@@ -2208,9 +2212,12 @@ + xq = w % scaledWidth; + + // allocate pixel buffers +- colorBuf = (SplashColorPtr)gmalloc((yp + 1) * w * nComps); ++ if (yp < 0 || yp > INT_MAX - 1 || w > INT_MAX / nComps) { ++ return splashErrBadArg; ++ } ++ colorBuf = (SplashColorPtr)gmallocn(yp + 1, w * nComps); + if (srcAlpha) { +- alphaBuf = (Guchar *)gmalloc((yp + 1) * w); ++ alphaBuf = (Guchar *)gmallocn(yp + 1, w); + } else { + alphaBuf = NULL; + } +--- misc/xpdf-3.02/splash/SplashErrorCodes.h 2007-02-27 23:05:52.000000000 +0100 ++++ misc/build/xpdf-3.02/splash/SplashErrorCodes.h 2009-11-10 11:43:54.903536237 +0100 +@@ -29,4 +29,6 @@ + + #define splashErrSingularMatrix 8 // matrix is singular + ++#define splashErrBadArg 9 // bad argument ++ + #endif --- misc/xpdf-3.02/xpdf/JBIG2Stream.cc 2007-02-27 23:05:52.000000000 +0100 -+++ misc/build/xpdf-3.02/xpdf/JBIG2Stream.cc 2009-04-22 19:21:14.286412894 +0200 ++++ misc/build/xpdf-3.02/xpdf/JBIG2Stream.cc 2009-11-10 11:43:10.393213949 +0100 @@ -422,12 +422,14 @@ table[i] = table[len]; @@ -953,7 +1066,7 @@ for (x = 0; x < w; ++x) { --- misc/xpdf-3.02/xpdf/JBIG2Stream.h 2007-02-27 23:05:52.000000000 +0100 -+++ misc/build/xpdf-3.02/xpdf/JBIG2Stream.h 2009-04-22 19:21:14.293918758 +0200 ++++ misc/build/xpdf-3.02/xpdf/JBIG2Stream.h 2009-11-10 11:43:10.400610529 +0100 @@ -78,6 +78,10 @@ Guint *refSegs, Guint nRefSegs); void readGenericRegionSeg(Guint segNum, GBool imm, @@ -966,7 +1079,7 @@ int templ, GBool tpgdOn, GBool useSkip, JBIG2Bitmap *skip, --- misc/xpdf-3.02/xpdf/Makefile.in 2007-02-27 23:05:52.000000000 +0100 -+++ misc/build/xpdf-3.02/xpdf/Makefile.in 2009-04-22 19:20:56.651099700 +0200 ++++ misc/build/xpdf-3.02/xpdf/Makefile.in 2009-11-10 11:43:10.407182402 +0100 @@ -20,6 +20,8 @@ SPLASHLIBDIR = ../splash @@ -1006,9 +1119,31 @@ #------------------------------------------------------------------------ +--- misc/xpdf-3.02/xpdf/PSOutputDev.cc 2007-02-27 23:05:52.000000000 +0100 ++++ misc/build/xpdf-3.02/xpdf/PSOutputDev.cc 2009-11-10 11:43:54.879574544 +0100 +@@ -4301,7 +4301,7 @@ + width, -height, height); + + // allocate a line buffer +- lineBuf = (Guchar *)gmalloc(4 * width); ++ lineBuf = (Guchar *)gmallocn(width, 4); + + // set up to process the data stream + imgStr = new ImageStream(str, width, colorMap->getNumPixelComps(), --- misc/xpdf-3.02/xpdf/Stream.cc 2007-02-27 23:05:52.000000000 +0100 -+++ misc/build/xpdf-3.02/xpdf/Stream.cc 2009-04-22 19:20:56.661311973 +0200 -@@ -410,15 +410,13 @@ ++++ misc/build/xpdf-3.02/xpdf/Stream.cc 2009-11-10 11:43:54.863071127 +0100 +@@ -323,6 +323,10 @@ + } else { + imgLineSize = nVals; + } ++ if (width > INT_MAX / nComps) { ++ // force a call to gmallocn(-1,...), which will throw an exception ++ imgLineSize = -1; ++ } + imgLine = (Guchar *)gmallocn(imgLineSize, sizeof(Guchar)); + imgIdx = nVals; + } +@@ -410,15 +414,13 @@ ok = gFalse; nVals = width * nComps; @@ -1029,7 +1164,7 @@ return; } predLine = (Guchar *)gmalloc(rowBytes); -@@ -1245,23 +1243,26 @@ +@@ -1245,23 +1247,26 @@ columns = columnsA; if (columns < 1) { columns = 1; @@ -1064,7 +1199,7 @@ buf = EOF; } -@@ -1280,9 +1281,9 @@ +@@ -1280,9 +1285,9 @@ row = 0; nextLine2D = encoding < 0; inputBits = 0; @@ -1077,7 +1212,7 @@ buf = EOF; // skip any initial zero bits and end-of-line marker, and get the 2D -@@ -1299,211 +1300,230 @@ +@@ -1299,211 +1304,230 @@ } } @@ -1446,7 +1581,7 @@ // byte-align the row if (byteAlign) { inputBits &= ~7; -@@ -1562,14 +1582,17 @@ +@@ -1562,14 +1586,17 @@ // this if we know the stream contains end-of-line markers because // the "just plow on" technique tends to work better otherwise } else if (err && endOfLine) { @@ -1467,7 +1602,7 @@ eatBits(12); if (encoding > 0) { eatBits(1); -@@ -1577,11 +1600,11 @@ +@@ -1577,11 +1604,11 @@ } } @@ -1484,7 +1619,7 @@ } ++row; -@@ -1589,39 +1612,43 @@ +@@ -1589,39 +1616,43 @@ // get a byte if (outputBits >= 8) { @@ -1549,7 +1684,7 @@ return buf; } -@@ -1663,6 +1690,9 @@ +@@ -1663,6 +1694,9 @@ code = 0; // make gcc happy if (endOfBlock) { code = lookBits(12); @@ -1559,7 +1694,7 @@ if ((code >> 5) == 0) { p = &whiteTab1[code]; } else { -@@ -1675,6 +1705,9 @@ +@@ -1675,6 +1709,9 @@ } else { for (n = 1; n <= 9; ++n) { code = lookBits(n); @@ -1569,7 +1704,7 @@ if (n < 9) { code <<= 9 - n; } -@@ -1686,6 +1719,9 @@ +@@ -1686,6 +1723,9 @@ } for (n = 11; n <= 12; ++n) { code = lookBits(n); @@ -1579,7 +1714,7 @@ if (n < 12) { code <<= 12 - n; } -@@ -1711,9 +1747,12 @@ +@@ -1711,9 +1751,12 @@ code = 0; // make gcc happy if (endOfBlock) { code = lookBits(13); @@ -1593,7 +1728,7 @@ p = &blackTab2[(code >> 1) - 64]; } else { p = &blackTab3[code >> 7]; -@@ -1725,6 +1764,9 @@ +@@ -1725,6 +1768,9 @@ } else { for (n = 2; n <= 6; ++n) { code = lookBits(n); @@ -1603,7 +1738,7 @@ if (n < 6) { code <<= 6 - n; } -@@ -1736,6 +1778,9 @@ +@@ -1736,6 +1782,9 @@ } for (n = 7; n <= 12; ++n) { code = lookBits(n); @@ -1613,7 +1748,7 @@ if (n < 12) { code <<= 12 - n; } -@@ -1749,6 +1794,9 @@ +@@ -1749,6 +1798,9 @@ } for (n = 10; n <= 13; ++n) { code = lookBits(n); @@ -1623,7 +1758,7 @@ if (n < 13) { code <<= 13 - n; } -@@ -1963,6 +2011,12 @@ +@@ -1963,6 +2015,12 @@ // allocate a buffer for the whole image bufWidth = ((width + mcuWidth - 1) / mcuWidth) * mcuWidth; bufHeight = ((height + mcuHeight - 1) / mcuHeight) * mcuHeight; @@ -1636,7 +1771,7 @@ for (i = 0; i < numComps; ++i) { frameBuf[i] = (int *)gmallocn(bufWidth * bufHeight, sizeof(int)); memset(frameBuf[i], 0, bufWidth * bufHeight * sizeof(int)); -@@ -3038,6 +3092,11 @@ +@@ -3038,6 +3096,11 @@ } scanInfo.firstCoeff = str->getChar(); scanInfo.lastCoeff = str->getChar(); @@ -1648,8 +1783,8 @@ c = str->getChar(); scanInfo.ah = (c >> 4) & 0x0f; scanInfo.al = c & 0x0f; ---- misc/xpdf-3.02/xpdf/Stream.h Tue Feb 27 23:05:52 2007 -+++ misc/build/xpdf-3.02/xpdf/Stream.h Mon Apr 21 15:42:50 2008 +--- misc/xpdf-3.02/xpdf/Stream.h 2007-02-27 23:05:52.000000000 +0100 ++++ misc/build/xpdf-3.02/xpdf/Stream.h 2009-11-10 11:43:10.426813566 +0100 @@ -528,13 +528,15 @@ int row; // current row int inputBuf; // input buffer @@ -1670,3 +1805,68 @@ short getTwoDimCode(); short getWhiteCode(); short getBlackCode(); +--- misc/xpdf-3.02/xpdf/XRef.cc 2007-02-27 23:05:52.000000000 +0100 ++++ misc/build/xpdf-3.02/xpdf/XRef.cc 2009-11-10 11:43:54.923556696 +0100 +@@ -52,6 +52,8 @@ + // generation 0. + ObjectStream(XRef *xref, int objStrNumA); + ++ GBool isOk() { return ok; } ++ + ~ObjectStream(); + + // Return the object number of this object stream. +@@ -67,6 +69,7 @@ + int nObjects; // number of objects in the stream + Object *objs; // the objects (length = nObjects) + int *objNums; // the object numbers (length = nObjects) ++ GBool ok; + }; + + ObjectStream::ObjectStream(XRef *xref, int objStrNumA) { +@@ -80,6 +83,7 @@ + nObjects = 0; + objs = NULL; + objNums = NULL; ++ ok = gFalse; + + if (!xref->fetch(objStrNum, 0, &objStr)->isStream()) { + goto err1; +@@ -105,6 +109,13 @@ + goto err1; + } + ++ // this is an arbitrary limit to avoid integer overflow problems ++ // in the 'new Object[nObjects]' call (Acrobat apparently limits ++ // object streams to 100-200 objects) ++ if (nObjects > 1000000) { ++ error(-1, "Too many objects in an object stream"); ++ goto err1; ++ } + objs = new Object[nObjects]; + objNums = (int *)gmallocn(nObjects, sizeof(int)); + offsets = (int *)gmallocn(nObjects, sizeof(int)); +@@ -161,10 +172,10 @@ + } + + gfree(offsets); ++ ok = gTrue; + + err1: + objStr.free(); +- return; + } + + ObjectStream::~ObjectStream() { +@@ -837,6 +848,11 @@ + delete objStr; + } + objStr = new ObjectStream(this, e->offset); ++ if (!objStr->isOk()) { ++ delete objStr; ++ objStr = NULL; ++ goto err; ++ } + } + objStr->getObject(e->gen, num, obj); + break; -- cgit v1.2.3 From 63edc51ac3022da60f387d50aaf571180d38f6a8 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Thu, 19 Nov 2009 13:25:39 +0100 Subject: dba33d: #i104844# check name and do not close when name is wrong --- .../source/core/dataaccess/documentcontainer.cxx | 28 ++++++++++++++++------ dbaccess/source/core/inc/core_resource.hrc | 1 + dbaccess/source/core/resource/strings.src | 5 +++- 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/dbaccess/source/core/dataaccess/documentcontainer.cxx b/dbaccess/source/core/dataaccess/documentcontainer.cxx index 96cae44e6a3e..89dd49184519 100644 --- a/dbaccess/source/core/dataaccess/documentcontainer.cxx +++ b/dbaccess/source/core/dataaccess/documentcontainer.cxx @@ -380,9 +380,12 @@ Reference< XInterface > SAL_CALL ODocumentContainer::createInstanceWithArguments ::rtl::OUString sServiceName; if ( Reference< XNameAccess >( xObjectToCopy, UNO_QUERY ).is() ) + { if ( m_bFormsContainer ) sServiceName = SERVICE_NAME_FORM_COLLECTION; - else sServiceName = SERVICE_NAME_REPORT_COLLECTION; + else + sServiceName = SERVICE_NAME_REPORT_COLLECTION; + } else sServiceName = SERVICE_SDB_DOCUMENTDEFINITION; @@ -503,7 +506,7 @@ namespace if ( bRet ) { _rRet = _xNameContainer->getByName(_sSimpleName = sName); - while ( nIndex != -1 ) + while ( nIndex != -1 && bRet ) { sName = _sName.getToken(0,'/',nIndex); _xNameContainer.set(_rRet,UNO_QUERY); @@ -517,8 +520,10 @@ namespace } } } - else if ( nIndex == -1 ) - _sSimpleName = sName; // a content on the root content + if ( nIndex == -1 ) + _sSimpleName = sName; // a content + else + _xNameContainer.clear(); // a sub folder doesn't exist return bRet; } } @@ -610,15 +615,24 @@ sal_Bool SAL_CALL ODocumentContainer::hasByHierarchicalName( const ::rtl::OUStri // XHierarchicalNameContainer void SAL_CALL ODocumentContainer::insertByHierarchicalName( const ::rtl::OUString& _sName, const Any& _aElement ) throw (IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException) { + Reference< XContent > xContent(_aElement,UNO_QUERY); + if ( !xContent.is() ) + throw IllegalArgumentException(); + ClearableMutexGuard aGuard(m_aMutex); Any aContent; Reference< XNameContainer > xNameContainer(this); ::rtl::OUString sName; if ( lcl_queryContent(_sName,xNameContainer,aContent,sName) ) throw ElementExistException(_sName,*this); - Reference< XContent > xContent(_aElement,UNO_QUERY); - if ( !xContent.is() ) - throw IllegalArgumentException(); + + if ( !xNameContainer.is() ) + { + ::rtl::OUString sMessage( DBA_RES( RID_STR_NO_SUB_FOLDER ) ); + sal_Int32 index = sName.getLength(); + ::comphelper::string::searchAndReplaceAsciiI( sMessage, "$folder$", _sName.getToken(0,'/',index) ); + throw IllegalArgumentException( sMessage, *this, 1 ); + } xNameContainer->insertByName(sName,_aElement); } diff --git a/dbaccess/source/core/inc/core_resource.hrc b/dbaccess/source/core/inc/core_resource.hrc index c3fcb7541c68..3463ef2c960f 100644 --- a/dbaccess/source/core/inc/core_resource.hrc +++ b/dbaccess/source/core/inc/core_resource.hrc @@ -89,6 +89,7 @@ #define RID_STR_NAME_NOT_FOUND ( RID_CORE_STRINGS_START + 45 ) #define RID_STR_QUERY_DOES_NOT_EXIST ( RID_CORE_STRINGS_START + 46 ) #define RID_STR_ERROR_WHILE_SAVING ( RID_CORE_STRINGS_START + 47 ) +#define RID_STR_NO_SUB_FOLDER ( RID_CORE_STRINGS_START + 48 ) #endif // _DBA_CORE_RESOURCE_HRC_ diff --git a/dbaccess/source/core/resource/strings.src b/dbaccess/source/core/resource/strings.src index 2f65a3391dff..1480f0c95310 100644 --- a/dbaccess/source/core/resource/strings.src +++ b/dbaccess/source/core/resource/strings.src @@ -245,5 +245,8 @@ String RID_STR_ERROR_WHILE_SAVING { Text [ en-US ] = "Could not save the document:\n\n$except$:\n$message$"; }; - +String RID_STR_NO_SUB_FOLDER +{ + Text [ en-US ] = "There exists no folder named \"$folder$\"."; +}; //------------------------------------------------------------------------- -- cgit v1.2.3 From fb287ba7c5fdacfefba0dabf81211b6d1759453e Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Thu, 19 Nov 2009 13:25:39 +0100 Subject: dba33d: #i104844# check name and do not close when name is wrong --- wizards/com/sun/star/wizards/query/Finalizer.java | 16 +++++++---- .../com/sun/star/wizards/query/QueryWizard.java | 4 +++ .../sun/star/wizards/report/IReportDocument.java | 2 +- .../sun/star/wizards/report/ReportFinalizer.java | 32 ++++++++++++++-------- .../wizards/report/ReportTextImplementation.java | 2 +- .../reportbuilder/ReportBuilderImplementation.java | 29 ++++++-------------- 6 files changed, 45 insertions(+), 40 deletions(-) diff --git a/wizards/com/sun/star/wizards/query/Finalizer.java b/wizards/com/sun/star/wizards/query/Finalizer.java index 7079b1109742..0a7f0a42aec8 100644 --- a/wizards/com/sun/star/wizards/query/Finalizer.java +++ b/wizards/com/sun/star/wizards/query/Finalizer.java @@ -31,6 +31,7 @@ package com.sun.star.wizards.query; import com.sun.star.wizards.common.*; import com.sun.star.awt.XRadioButton; +import com.sun.star.awt.XTextComponent; import com.sun.star.wizards.db.*; import com.sun.star.lang.IllegalArgumentException; import com.sun.star.lang.XComponent; @@ -44,7 +45,7 @@ public class Finalizer private QueryWizard CurUnoDialog; private String resQuery; private Object m_aTxtSummary; - private Object m_aTxtTitle; + private XTextComponent m_aTxtTitle; private XRadioButton xRadioDisplayQuery; private XRadioButton xRadioModifyQuery; private QuerySummary CurDBMetaData; @@ -75,7 +76,7 @@ public class Finalizer { new Integer(8), reslblQueryTitle, new Integer(95), new Integer(27), new Integer(QueryWizard.SOSUMMARY_PAGE), new Short(curtabindex++), new Integer(52) }); - m_aTxtTitle = CurUnoDialog.insertTextField("txtQueryTitle", 0, null, new String[] + m_aTxtTitle = CurUnoDialog.insertTextField("txtQueryTitle", "changeTitle", this, new String[] { "Height", "HelpURL", "PositionX", "PositionY", "Step", "TabIndex", "Width" }, @@ -128,6 +129,11 @@ public class Finalizer }); } + public void changeTitle() + { + final String TitleName = m_aTxtTitle.getText(); + CurUnoDialog.enableFinishButton(!"".equals(TitleName)); + } /* TODO: The title textbox always has to be updated when a new Table has been selected if it is clear that the user has not made any input meanwhile */ @@ -191,11 +197,11 @@ public class Finalizer CurUnoDialog.getCurFrame()); } CurUnoDialog.xDialog.endExecute(); + CurDBMetaData.oSQLQueryComposer = null; + CurDBMetaData = null; + CurUnoDialog = null; } } - CurDBMetaData.oSQLQueryComposer = null; - CurDBMetaData = null; - CurUnoDialog = null; } catch (IllegalArgumentException e) { diff --git a/wizards/com/sun/star/wizards/query/QueryWizard.java b/wizards/com/sun/star/wizards/query/QueryWizard.java index 181c83d9134a..468540f9569a 100644 --- a/wizards/com/sun/star/wizards/query/QueryWizard.java +++ b/wizards/com/sun/star/wizards/query/QueryWizard.java @@ -299,6 +299,10 @@ public class QueryWizard extends WizardDialog if ((switchToStep(ncurStep, SOSUMMARY_PAGE)) || (ncurStep == SOSUMMARY_PAGE)) { components = CurFinalizer.finish(); + if ( components == null ) + { + setControlProperty("btnWizardFinish", "Enabled", false); + } } } diff --git a/wizards/com/sun/star/wizards/report/IReportDocument.java b/wizards/com/sun/star/wizards/report/IReportDocument.java index af8476f5c3e9..e94f93bf9d2e 100644 --- a/wizards/com/sun/star/wizards/report/IReportDocument.java +++ b/wizards/com/sun/star/wizards/report/IReportDocument.java @@ -204,7 +204,7 @@ public interface IReportDocument * @param Name * @param OpenMode */ - public void store(String Name, int OpenMode); + public void store(String Name, int OpenMode) throws com.sun.star.uno.Exception; /** * The current report is added to the DB View under the given name diff --git a/wizards/com/sun/star/wizards/report/ReportFinalizer.java b/wizards/com/sun/star/wizards/report/ReportFinalizer.java index 8c0df7c36c5c..9ffb89b768f5 100644 --- a/wizards/com/sun/star/wizards/report/ReportFinalizer.java +++ b/wizards/com/sun/star/wizards/report/ReportFinalizer.java @@ -244,8 +244,9 @@ public class ReportFinalizer public void changeReportTitle() { - String TitleName = xTitleTextBox.getText(); + final String TitleName = xTitleTextBox.getText(); CurReportDocument.liveupdate_updateReportTitle(TitleName); + CurUnoDialog.enableFinishButton(!"".equals(TitleName)); } public int getReportOpenMode() @@ -272,18 +273,25 @@ public class ReportFinalizer public boolean finish() { StoreName = getStoreName(); - if (CurReportDocument.getRecordParser().getReportDocuments().hasByHierarchicalName(StoreName)) + if (!CurReportDocument.getRecordParser().getReportDocuments().hasByHierarchicalName(StoreName)) { - String sMsgReportDocumentNameDuplicate = CurUnoDialog.m_oResource.getResText(UIConsts.RID_REPORT + 76); - String sShowMsgReportNameisDuplicate = JavaTools.replaceSubString(sMsgReportDocumentNameDuplicate, StoreName, "%REPORTNAME"); - /* int iMsg = */ CurUnoDialog.showMessageBox("ErrorBox", VclWindowPeerAttribute.OK, sShowMsgReportNameisDuplicate); - return false; - } - else - { - CurReportDocument.store(StoreName, getReportOpenMode()); - ReportWizard.bCloseDocument = false; - return true; + try + { + CurReportDocument.store(StoreName, getReportOpenMode()); + ReportWizard.bCloseDocument = false; + return true; + } + catch(Exception e) + { + CurUnoDialog.showMessageBox("ErrorBox", VclWindowPeerAttribute.OK,e.getLocalizedMessage() ); + CurUnoDialog.enableFinishButton(false); + return false; + } } + String sMsgReportDocumentNameDuplicate = CurUnoDialog.m_oResource.getResText(UIConsts.RID_REPORT + 76); + String sShowMsgReportNameisDuplicate = JavaTools.replaceSubString(sMsgReportDocumentNameDuplicate, StoreName, "%REPORTNAME"); + /* int iMsg = */ CurUnoDialog.showMessageBox("ErrorBox", VclWindowPeerAttribute.OK, sShowMsgReportNameisDuplicate); + CurUnoDialog.enableFinishButton(false); + return false; } } diff --git a/wizards/com/sun/star/wizards/report/ReportTextImplementation.java b/wizards/com/sun/star/wizards/report/ReportTextImplementation.java index 3d79c5d2d8ac..6e0091b52ef5 100644 --- a/wizards/com/sun/star/wizards/report/ReportTextImplementation.java +++ b/wizards/com/sun/star/wizards/report/ReportTextImplementation.java @@ -480,7 +480,7 @@ public class ReportTextImplementation extends ReportImplementationHelper impleme return m_aDoc.xMSFDoc; } - public void store(String _sName, int _nOpenMode) + public void store(String _sName, int _nOpenMode) throws com.sun.star.uno.Exception { getDoc().createReportForm(ReportWizard.SOREPORTFORMNAME); // int nOpenMode = getReportOpenMode(); diff --git a/wizards/com/sun/star/wizards/reportbuilder/ReportBuilderImplementation.java b/wizards/com/sun/star/wizards/reportbuilder/ReportBuilderImplementation.java index dad827841e96..2972e8153787 100644 --- a/wizards/com/sun/star/wizards/reportbuilder/ReportBuilderImplementation.java +++ b/wizards/com/sun/star/wizards/reportbuilder/ReportBuilderImplementation.java @@ -37,7 +37,7 @@ import com.sun.star.wizards.report.*; import com.sun.star.awt.XWindowPeer; import com.sun.star.beans.PropertyValue; import com.sun.star.beans.XPropertySet; -import com.sun.star.container.XNameAccess; +import com.sun.star.container.XHierarchicalNameContainer; import com.sun.star.container.XNameContainer; import com.sun.star.frame.XController; import com.sun.star.frame.XDispatch; @@ -340,7 +340,7 @@ public class ReportBuilderImplementation extends ReportImplementationHelper throw new UnsupportedOperationException("Not supported yet."); } - public void store(String Name, int OpenMode) + public void store(String Name, int OpenMode) throws com.sun.star.uno.Exception { // throw new UnsupportedOperationException("Not supported yet."); // getReportBuilderLayouter().store(Name); @@ -351,27 +351,14 @@ public class ReportBuilderImplementation extends ReportImplementationHelper return; } - try - { - final XNameAccess aNameAccess = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, m_aReportDocument); - final String[] aNames = aNameAccess.getElementNames(); - -// m_xReportDefinition.storeToStorage(m_xReportDefinition.getDocumentStorage(), m_xReportDefinition.getArgs()); - - final XCommandProcessor xProcessor = (XCommandProcessor) UnoRuntime.queryInterface(XCommandProcessor.class, m_aDocumentDefinition); - com.sun.star.ucb.Command aCommand = new com.sun.star.ucb.Command(); - aCommand.Name = "storeOwn"; + final XCommandProcessor xProcessor = UnoRuntime.queryInterface(XCommandProcessor.class, m_aDocumentDefinition); + final com.sun.star.ucb.Command aCommand = new com.sun.star.ucb.Command(); + aCommand.Name = "storeOwn"; - final Object aObj2 = xProcessor.execute(aCommand, xProcessor.createCommandIdentifier(), null); + final Object aObj2 = xProcessor.execute(aCommand, xProcessor.createCommandIdentifier(), null); - final XNameContainer aNameContainer = (XNameContainer) UnoRuntime.queryInterface(XNameContainer.class, m_aReportDocument); -// aNameContainer.insertByName(Name, m_xReportDefinition); - aNameContainer.insertByName(Name, m_aDocumentDefinition); - } - catch (Exception e) - { - int dummy = 0; - } + final XHierarchicalNameContainer aNameContainer = UnoRuntime.queryInterface(XHierarchicalNameContainer.class, m_aReportDocument); + aNameContainer.insertByHierarchicalName(Name, m_aDocumentDefinition); } public boolean liveupdate_addGroupNametoDocument(String[] GroupNames, String CurGroupTitle, Vector GroupFieldVector, ArrayList ReportPath, int iSelCount) -- cgit v1.2.3 From 084f6af01bba0fae498d879388200dfe03d48e8a Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 19 Nov 2009 17:50:06 +0000 Subject: Replaced the two new icons from the ones I "borrowed" from IBM's spec screenshot, to the original ones we created (by jimmac), to avoid potential copyright issue. --- default_images/sc/res/popup_select_current.png | Bin 373 -> 454 bytes default_images/sc/res/popup_unselect_current.png | Bin 324 -> 348 bytes 2 files changed, 0 insertions(+), 0 deletions(-) diff --git a/default_images/sc/res/popup_select_current.png b/default_images/sc/res/popup_select_current.png index 18f981535e61..475b5b183bf4 100644 Binary files a/default_images/sc/res/popup_select_current.png and b/default_images/sc/res/popup_select_current.png differ diff --git a/default_images/sc/res/popup_unselect_current.png b/default_images/sc/res/popup_unselect_current.png index fe49d83d8f84..3c764e203a02 100644 Binary files a/default_images/sc/res/popup_unselect_current.png and b/default_images/sc/res/popup_unselect_current.png differ -- cgit v1.2.3 From d7a21c71b28ff0de9e60951a53533eb3a10bfc6d Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Thu, 19 Nov 2009 21:23:53 +0100 Subject: #106830# - NTLM: do not call auth callback, if session timed out. --- neon/neon.patch | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/neon/neon.patch b/neon/neon.patch index 8817f54a3381..f6725d71edb4 100644 --- a/neon/neon.patch +++ b/neon/neon.patch @@ -1,5 +1,5 @@ ---- misc/neon-0.28.2/src/config.h 2009-11-12 13:03:04.000000000 +0100 -+++ misc/build/neon-0.28.2/src/config.h 2009-11-12 12:53:41.000000000 +0100 +--- misc/neon-0.28.2/src/config.h 2009-11-19 21:17:19.000000000 +0100 ++++ misc/build/neon-0.28.2/src/config.h 2009-11-18 09:06:10.000000000 +0100 @@ -1 +1,488 @@ -dummy + @@ -490,8 +490,8 @@ +#else +#define HAVE_NTLM 1 +#endif ---- misc/neon-0.28.2/src/makefile.mk 2009-11-12 13:03:04.000000000 +0100 -+++ misc/build/neon-0.28.2/src/makefile.mk 2009-11-12 11:39:52.000000000 +0100 +--- misc/neon-0.28.2/src/makefile.mk 2009-11-19 21:17:19.000000000 +0100 ++++ misc/build/neon-0.28.2/src/makefile.mk 2009-11-18 09:06:10.000000000 +0100 @@ -1 +1,59 @@ -dummy +PRJ=..$/..$/..$/..$/.. @@ -554,7 +554,7 @@ + +.INCLUDE : target.mk --- misc/neon-0.28.2/src/ne_auth.c 2008-02-29 17:30:12.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_auth.c 2009-11-12 11:39:52.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_auth.c 2009-11-19 21:12:52.000000000 +0100 @@ -77,6 +77,10 @@ #include "ne_sspi.h" #endif @@ -656,7 +656,7 @@ + + NE_DEBUG(NE_DBG_HTTPAUTH, "auth: NTLM challenge.\n"); + -+ if (!parms->opaque) { ++ if (!parms->opaque && (!sess->ntlm_context || (attempt > 1))) { + char password[NE_ABUFSIZ]; + + if (get_credentials(sess, errmsg, attempt, parms, password)) { @@ -718,7 +718,7 @@ return ret; } --- misc/neon-0.28.2/src/ne_auth.h 2007-12-05 17:39:58.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_auth.h 2009-11-12 11:39:52.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_auth.h 2009-11-18 09:06:10.000000000 +0100 @@ -47,8 +47,8 @@ * Hint: if you just wish to attempt authentication just once (even if * the user gets the username/password wrong), have the callback @@ -731,7 +731,7 @@ /* Set callbacks to provide credentials for server and proxy * authentication, using the default set of authentication protocols. --- misc/neon-0.28.2/src/ne_defs.h 2006-10-24 21:40:09.000000000 +0200 -+++ misc/build/neon-0.28.2/src/ne_defs.h 2009-11-12 11:39:52.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_defs.h 2009-11-18 09:06:10.000000000 +0100 @@ -41,7 +41,7 @@ #endif @@ -742,7 +742,7 @@ #endif --- misc/neon-0.28.2/src/ne_locks.c 2007-02-05 11:09:27.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_locks.c 2009-11-12 12:57:15.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_locks.c 2009-11-18 09:06:10.000000000 +0100 @@ -579,6 +579,23 @@ const char *token = ne_get_response_header(ctx->req, "Lock-Token"); /* at the root element; retrieve the Lock-Token header, @@ -810,7 +810,7 @@ } } --- misc/neon-0.28.2/src/ne_locks.h 2006-01-02 12:43:19.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_locks.h 2009-11-12 11:39:52.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_locks.h 2009-11-18 09:06:10.000000000 +0100 @@ -22,6 +22,10 @@ #ifndef NE_LOCKS_H #define NE_LOCKS_H @@ -822,9 +822,9 @@ #include "ne_request.h" /* for ne_session + ne_request */ #include "ne_uri.h" /* for ne_uri */ ---- misc/neon-0.28.2/src/ne_ntlm.c 2009-11-12 13:03:04.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_ntlm.c 2009-11-12 11:39:52.000000000 +0100 -@@ -1 +1,700 @@ +--- misc/neon-0.28.2/src/ne_ntlm.c 2009-11-19 21:17:19.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_ntlm.c 2009-11-19 21:15:00.000000000 +0100 +@@ -1 +1,703 @@ -dummy +/* + Handling of NTLM Authentication @@ -1497,6 +1497,9 @@ + if (context == NULL) { + return -1; + } else { ++ if (!responseToken && (context->state == NTLMSTATE_TYPE3)) ++ context->state = NTLMSTATE_NONE; ++ + if (context->state <= NTLMSTATE_TYPE3) { + ntlm ntlmstatus = ne_input_ntlm(context, responseToken); + @@ -1526,8 +1529,8 @@ + +#endif /* HAVE_OPENSSL */ +#endif /* HAVE_NTLM */ ---- misc/neon-0.28.2/src/ne_ntlm.h 2009-11-12 13:03:04.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_ntlm.h 2009-11-12 11:39:51.000000000 +0100 +--- misc/neon-0.28.2/src/ne_ntlm.h 2009-11-19 21:17:19.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_ntlm.h 2009-11-18 09:06:10.000000000 +0100 @@ -1 +1,44 @@ -dummy +/* @@ -1575,7 +1578,7 @@ + +#endif /* NE_NTLM_H */ --- misc/neon-0.28.2/src/ne_socket.c 2008-02-28 14:19:19.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_socket.c 2009-11-12 11:39:52.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_socket.c 2009-11-18 09:06:10.000000000 +0100 @@ -60,6 +60,7 @@ #include #ifdef USE_GETADDRINFO @@ -1585,7 +1588,7 @@ #endif --- misc/neon-0.28.2/src/ne_sspi.c 2007-08-10 17:26:08.000000000 +0200 -+++ misc/build/neon-0.28.2/src/ne_sspi.c 2009-11-12 11:39:52.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_sspi.c 2009-11-18 09:06:10.000000000 +0100 @@ -202,9 +202,48 @@ return -1; } @@ -1676,7 +1679,7 @@ securityStatus = initializeSecurityContext(&sspiContext->credentials, NULL, --- misc/neon-0.28.2/src/ne_sspi.h 2006-02-12 13:05:14.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_sspi.h 2009-11-12 11:39:51.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_sspi.h 2009-11-18 09:06:10.000000000 +0100 @@ -41,7 +41,7 @@ int ne_sspi_clear_context(void *context); @@ -1687,7 +1690,7 @@ #endif /* HAVE_SSPI */ --- misc/neon-0.28.2/src/ne_uri.c 2007-12-05 12:04:47.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_uri.c 2009-11-12 11:39:52.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_uri.c 2009-11-18 09:06:10.000000000 +0100 @@ -42,7 +42,7 @@ #include "ne_alloc.h" #include "ne_uri.h" @@ -1734,7 +1737,7 @@ /* 4x */ AT, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, /* 5x */ AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, GD, OT, GD, OT, US, --- misc/neon-0.28.2/src/ne_utils.c 2006-03-07 10:36:43.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_utils.c 2009-11-12 11:39:52.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_utils.c 2009-11-18 09:06:10.000000000 +0100 @@ -118,6 +118,9 @@ #ifdef HAVE_GNUTLS ", GNU TLS " LIBGNUTLS_VERSION @@ -1765,7 +1768,7 @@ #endif /* NE_HAVE_* */ default: --- misc/neon-0.28.2/src/ne_utils.h 2007-07-16 08:54:57.000000000 +0200 -+++ misc/build/neon-0.28.2/src/ne_utils.h 2009-11-12 11:39:51.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_utils.h 2009-11-18 09:06:10.000000000 +0100 @@ -54,6 +54,7 @@ #define NE_FEATURE_SOCKS (5) /* SOCKSv5 support */ #define NE_FEATURE_TS_SSL (6) /* Thread-safe SSL/TLS support */ -- cgit v1.2.3 From 568736b0e09dd6bd33510bcc94c370766b803682 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Thu, 19 Nov 2009 21:31:39 +0100 Subject: #106820# - published. --- offapi/com/sun/star/ucb/CommandEnvironment.idl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/offapi/com/sun/star/ucb/CommandEnvironment.idl b/offapi/com/sun/star/ucb/CommandEnvironment.idl index 06bde886629b..a1ca2aa72fc4 100644 --- a/offapi/com/sun/star/ucb/CommandEnvironment.idl +++ b/offapi/com/sun/star/ucb/CommandEnvironment.idl @@ -45,7 +45,7 @@ module com { module sun { module star { module ucb { @since OOo 3.3 */ - service CommandEnvironment : ::com::sun::star::ucb::XCommandEnvironment + published service CommandEnvironment : ::com::sun::star::ucb::XCommandEnvironment { //------------------------------------------------------------------------- /** Constructor. -- cgit v1.2.3 From c48ac4539de6401f163ee18acb518c59afec01b2 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Fri, 20 Nov 2009 00:01:29 +0100 Subject: #i106820# - fixed compiler warning. --- ucb/source/core/cmdenv.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ucb/source/core/cmdenv.cxx b/ucb/source/core/cmdenv.cxx index e9851f4dfa0f..0ac11b82a3dd 100644 --- a/ucb/source/core/cmdenv.cxx +++ b/ucb/source/core/cmdenv.cxx @@ -53,7 +53,7 @@ using namespace ucb_cmdenv; //========================================================================= UcbCommandEnvironment::UcbCommandEnvironment( - const uno::Reference< lang::XMultiServiceFactory >& xSMgr ) + const uno::Reference< lang::XMultiServiceFactory >& /*xSMgr*/ ) //: m_xSMgr( xSMgr ) { } -- cgit v1.2.3 From 72c86e14a0c71184ad3f47942315c3115928bde8 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Fri, 20 Nov 2009 11:16:56 +0100 Subject: #i106830# - Fixed Windows build breaker. --- ucb/source/ucp/webdav/DAVSession.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ucb/source/ucp/webdav/DAVSession.hxx b/ucb/source/ucp/webdav/DAVSession.hxx index 040046e13534..00b0b75e2a3c 100644 --- a/ucb/source/ucp/webdav/DAVSession.hxx +++ b/ucb/source/ucp/webdav/DAVSession.hxx @@ -43,7 +43,7 @@ #include "DAVRequestEnvironment.hxx" namespace com { namespace sun { namespace star { namespace ucb { - class Lock; + struct Lock; } } } } namespace webdav_ucp -- cgit v1.2.3 From 6e54378375d6201a12dab56d5408240faf8df195 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Fri, 20 Nov 2009 11:17:19 +0100 Subject: #i106830# - Fixed Windows build breaker. --- ucb/source/ucp/webdav/NeonSession.cxx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/ucb/source/ucp/webdav/NeonSession.cxx b/ucb/source/ucp/webdav/NeonSession.cxx index c6cb5288099b..59471c6cf0c1 100644 --- a/ucb/source/ucp/webdav/NeonSession.cxx +++ b/ucb/source/ucp/webdav/NeonSession.cxx @@ -714,9 +714,14 @@ void NeonSession::Init() // for more debug flags see ne_utils.h; NE_DEBUGGING must be defined // while compiling neon in order to actually activate neon debug // output. - ne_debug_init( stderr, - /*NE_DBG_HTTP | NE_DBG_XML | NE_DBG_XMLPARSE |*/ - NE_DBG_LOCKS | NE_DBG_FLUSH ); + ne_debug_init( stderr, NE_DBG_FLUSH + | NE_DBG_HTTP + // | NE_DBG_HTTPBODY + // | NE_DBG_HTTPAUTH + // | NE_DBG_XML + // | NE_DBG_XMLPARSE + // | NE_DBG_LOCKS + ); #endif m_bGlobalsInited = true; } @@ -1540,7 +1545,7 @@ sal_Int64 NeonSession::LOCK( const ::rtl::OUString & inPath, Init( rEnv ); // refresh existing lock. - theLock->timeout = nTimeout; + theLock->timeout = static_cast< long >( nTimeout ); TimeValue startCall; osl_getSystemTime( &startCall ); -- cgit v1.2.3 From 293d8aa9981a2f39a327e715249f80c116c7233e Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Mon, 23 Nov 2009 10:33:17 +0100 Subject: dba33d: #i107104# error in where <> having --- .../source/ui/querydesign/SelectionBrowseBox.cxx | 25 +++++++++++----------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx index 27ad175c071c..769e402d8ba7 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -1807,25 +1807,23 @@ void OSelectionBrowseBox::AddGroupBy( const OTableFieldDescRef& rInfo , sal_uInt pEntry->GetFunctionType() == rInfo->GetFunctionType() && pEntry->GetFunction() == rInfo->GetFunction()) { - /*sal_uInt32 nPos = aIter - rFields.begin(); - bAppend = _nCurrentPos > nPos && (rInfo->IsGroupBy() != pEntry->IsGroupBy()); - if ( bAppend ) + if ( pEntry->isNumericOrAggreateFunction() && rInfo->IsGroupBy() ) + { + pEntry->SetGroupBy(sal_False); aIter = rFields.end(); - else*/ + break; + } + else { - if ( pEntry->isNumericOrAggreateFunction() && rInfo->IsGroupBy() ) - { - pEntry->SetGroupBy(sal_False); - aIter = rFields.end(); - } - else + if ( !pEntry->IsGroupBy() && !pEntry->HasCriteria() ) // here we have a where condition which is no having clause { pEntry->SetGroupBy(rInfo->IsGroupBy()); if(!m_bGroupByUnRelated && pEntry->IsGroupBy()) pEntry->SetVisible(sal_True); + break; } } - break; + } } @@ -1887,13 +1885,14 @@ void OSelectionBrowseBox::AddCondition( const OTableFieldDescRef& rInfo, const S if (bCase(aField,rInfo->GetField()) && bCase(aAlias,rInfo->GetAlias()) && pEntry->GetFunctionType() == rInfo->GetFunctionType() && - pEntry->GetFunction() == rInfo->GetFunction()) + pEntry->GetFunction() == rInfo->GetFunction() && + pEntry->IsGroupBy() == rInfo->IsGroupBy() ) { if ( pEntry->isNumericOrAggreateFunction() && rInfo->IsGroupBy() ) pEntry->SetGroupBy(sal_False); else { - pEntry->SetGroupBy(rInfo->IsGroupBy()); +// pEntry->SetGroupBy(rInfo->IsGroupBy()); if(!m_bGroupByUnRelated && pEntry->IsGroupBy()) pEntry->SetVisible(sal_True); } -- cgit v1.2.3 From 78f36b84e4e181fe5d0bcb5cc8606a56df256982 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Mon, 23 Nov 2009 19:08:31 +0100 Subject: vcl108: #i106704# fix Length3 entry for Type1 fonts, also merge fix for issue 106572 --- vcl/source/gdi/pdfwriter_impl.cxx | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index e7ee18ec7705..146196e86877 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -2973,24 +2973,18 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont } nEndBinaryIndex = nIndex; - // and count forward again to the point where we have nFound '0' - // to get the corect value for nLength3 - sal_Int32 nLength3 = 0; - sal_Int32 nL3Index = nIndex; - while( nFound && nL3Index < nFontLen ) + // nLength3 is the rest of the file - excluding any section headers + sal_Int32 nLength3 = nFontLen - nIndex; + for( it = aSections.begin(); it != aSections.end(); ++it ) { - for( it = aSections.begin(); it != aSections.end() && (nL3Index < *it || nL3Index > ((*it) + 5) ); ++it ) - ; - if( it == aSections.end() ) + if( *it >= nIndex ) { - // inside the 512 '0' block there may only be whitespace - // according to T1 spec; probably it would be to simple - // if all fonts complied - if( pFontData[nL3Index] == '0' ) - nFound--; - nLength3++; + // special case: nIndex inside a section marker + if( nIndex >= *it ) + nLength3 -= (*it)+5 - nIndex; + else + nLength3 -= 5; } - nL3Index++; } // search for beginning of binary section @@ -3612,6 +3606,7 @@ sal_Int32 PDFWriterImpl::emitFontDescriptor( const ImplFontData* pFont, FontSubs break; case FontSubsetInfo::TYPE1_PFA: case FontSubsetInfo::TYPE1_PFB: + case FontSubsetInfo::ANY_TYPE1: break; default: DBG_ERROR( "unknown fonttype in PDF font descriptor" ); -- cgit v1.2.3 From b5c8e3b6159c0874a284ae6181b3b7b8c5fb0dd3 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Tue, 24 Nov 2009 11:34:17 +0100 Subject: dba33d: #i104949# show cell value when set field text nodes exits --- .../report/pentaho/layoutprocessor/FormattedTextLayoutController.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormattedTextLayoutController.java b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormattedTextLayoutController.java index e33171840430..16bc355f8b77 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormattedTextLayoutController.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/layoutprocessor/FormattedTextLayoutController.java @@ -135,9 +135,8 @@ public class FormattedTextLayoutController } else { - final DataFlags df = FormatValueUtility.computeDataFlag(element, getFlowController()); - if (df != null) + if (df != null && df.getValue() instanceof String ) { target.processContent(df); } -- cgit v1.2.3 From 9a506d302bcf497b58684e1ab9b1e4da50572469 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Tue, 24 Nov 2009 11:34:17 +0100 Subject: dba33d: #i104949# show cell value when set field text nodes exits --- sw/source/core/table/swtable.cxx | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx index 070e8eb625f9..99e8948d4afb 100644 --- a/sw/source/core/table/swtable.cxx +++ b/sw/source/core/table/swtable.cxx @@ -50,6 +50,8 @@ #include #include #include +#include +#include #include #include #include // fuer RedlineTbl() @@ -101,6 +103,8 @@ SV_IMPL_REF( SwServerObject ) #define COLFUZZY 20 +void ChgTextToNum( SwTableBox& rBox, const String& rTxt, const Color* pCol, + BOOL bChgAlign,ULONG nNdPos ); //---------------------------------- class SwTableBox_Impl @@ -2087,11 +2091,16 @@ void SwTable::SetHTMLTableLayout( SwHTMLTableLayout *p ) pHTMLLayout = p; } - void ChgTextToNum( SwTableBox& rBox, const String& rTxt, const Color* pCol, BOOL bChgAlign ) { ULONG nNdPos = rBox.IsValidNumTxtNd( TRUE ); + ChgTextToNum( rBox,rTxt,pCol,bChgAlign,nNdPos); +} +void ChgTextToNum( SwTableBox& rBox, const String& rTxt, const Color* pCol, + BOOL bChgAlign,ULONG nNdPos ) +{ + if( ULONG_MAX != nNdPos ) { SwDoc* pDoc = rBox.GetFrmFmt()->GetDoc(); @@ -2159,6 +2168,8 @@ void ChgTextToNum( SwTableBox& rBox, const String& rTxt, const Color* pCol, for( n = 0; n < rOrig.Len() && '\x9' == rOrig.GetChar( n ); ++n ) ; + for( ; n < rOrig.Len() && '\x01' == rOrig.GetChar( n ); ++n ) + ; SwIndex aIdx( pTNd, n ); for( n = rOrig.Len(); n && '\x9' == rOrig.GetChar( --n ); ) ; @@ -2637,6 +2648,14 @@ ULONG SwTableBox::IsValidNumTxtNd( BOOL bCheckAttr ) const *pAttr->GetStart() || *pAttr->GetAnyEnd() < rTxt.Len() ) { + if ( pAttr->Which() == RES_TXTATR_FIELD ) + { + const SwField* pField = pAttr->GetFld().GetFld(); + if ( pField && pField->GetTypeId() == TYP_SETFLD ) + { + continue; + } + } nPos = ULONG_MAX; break; } @@ -2691,7 +2710,7 @@ void SwTableBox::ActualiseValueBox() const String& rTxt = pSttNd->GetNodes()[ nNdPos ]->GetTxtNode()->GetTxt(); if( rTxt != sNewTxt ) - ChgTextToNum( *this, sNewTxt, pCol, FALSE ); + ChgTextToNum( *this, sNewTxt, pCol, FALSE ,nNdPos); } } } -- cgit v1.2.3 From a441a0d3f2fdf2507574502612d1565f7752a17a Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Wed, 25 Nov 2009 10:12:45 +0100 Subject: dba33d: #i104712# qurtal expression fixed --- reportdesign/source/filter/xml/xmlExport.cxx | 14 +++++++++++--- reportdesign/source/filter/xml/xmlGroup.cxx | 10 ++++++---- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx index 588b8c4a0e61..a4032b35f073 100644 --- a/reportdesign/source/filter/xml/xmlExport.cxx +++ b/reportdesign/source/filter/xml/xmlExport.cxx @@ -1587,6 +1587,7 @@ void ORptExport::exportGroupsExpressionAsFunction(const Reference< XGroups>& _xG uno::Reference< XFunction> xFunction = xFunctions->createFunction(); ::rtl::OUString sFunction,sPrefix,sPostfix; ::rtl::OUString sExpression = xGroup->getExpression(); + ::rtl::OUString sFunctionName; switch(nGroupOn) { case report::GroupOn::PREFIX_CHARACTERS: @@ -1597,8 +1598,9 @@ void ORptExport::exportGroupsExpressionAsFunction(const Reference< XGroups>& _xG sFunction = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("YEAR")); break; case report::GroupOn::QUARTAL: - sFunction = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MONTH")); - sPostfix = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/4")); + sFunction = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("INT((MONTH")); + sPostfix = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-1)/3)+1")); + sFunctionName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("QUARTAL_")) + sExpression; break; case report::GroupOn::MONTH: sFunction = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MONTH")); @@ -1626,15 +1628,21 @@ void ORptExport::exportGroupsExpressionAsFunction(const Reference< XGroups>& _xG exportFunction(xCountFunction); sExpression = sCountName; sPrefix = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" / ")) + ::rtl::OUString::valueOf(xGroup->getGroupInterval()); + sFunctionName = sFunction + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_")) + sExpression; } break; default: ; } + if ( !sFunctionName.getLength() ) + sFunctionName = sFunction + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_")) + sExpression; if ( sFunction.getLength() ) { + sal_Unicode pReplaceChars[] = { '(',')',';',',','+','-','[',']','/','*'}; + for(sal_Int32 i= 0; i < sizeof(pReplaceChars)/sizeof(pReplaceChars[0]);++i) + sFunctionName = sFunctionName.replace(pReplaceChars[i],'_'); - xFunction->setName(sFunction + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_")) + sExpression); + xFunction->setName(sFunctionName); sFunction = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("rpt:")) + sFunction; sFunction += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("([")); sFunction += sExpression; diff --git a/reportdesign/source/filter/xml/xmlGroup.cxx b/reportdesign/source/filter/xml/xmlGroup.cxx index 383cc88336ca..195b41aaa3c0 100644 --- a/reportdesign/source/filter/xml/xmlGroup.cxx +++ b/reportdesign/source/filter/xml/xmlGroup.cxx @@ -140,10 +140,12 @@ OXMLGroup::OXMLGroup( ORptFilter& _rImport nGroupOn = report::GroupOn::YEAR; else if ( sFormula ==::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("rpt:MONTH"))) { - if ( sCompleteFormula.endsWithIgnoreAsciiCaseAsciiL("\4",2) ) - nGroupOn = report::GroupOn::QUARTAL; - else - nGroupOn = report::GroupOn::MONTH; + nGroupOn = report::GroupOn::MONTH; + } + else if ( sCompleteFormula.matchAsciiL("rpt:INT((MONTH",sizeof("rpt:INT((MONTH"),0) + && sCompleteFormula.endsWithIgnoreAsciiCaseAsciiL("-1)/3)+1",sizeof("-1)/3)+1")) ) + { + nGroupOn = report::GroupOn::QUARTAL; } else if ( sFormula ==::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("rpt:WEEK"))) nGroupOn = report::GroupOn::WEEK; -- cgit v1.2.3 From 510361e19b2e8f0955795a6007c0baf8cbafc9cd Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Wed, 25 Nov 2009 10:12:45 +0100 Subject: dba33d: #i104712# qurtal expression fixed --- .../sun/star/report/pentaho/PentahoReportJob.java | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/reportbuilder/java/com/sun/star/report/pentaho/PentahoReportJob.java b/reportbuilder/java/com/sun/star/report/pentaho/PentahoReportJob.java index fbfa211e112c..23f959e05943 100644 --- a/reportbuilder/java/com/sun/star/report/pentaho/PentahoReportJob.java +++ b/reportbuilder/java/com/sun/star/report/pentaho/PentahoReportJob.java @@ -265,18 +265,22 @@ public class PentahoReportJob implements ReportJob if (reportExp.getName().equals(name)) { - final LValue val = parser.parse(reportExp.getFormulaExpression()); - if (val instanceof FormulaFunction) + LValue val = parser.parse(reportExp.getFormulaExpression()); + while( !(val instanceof ContextLookup)) { - final FormulaFunction reportFunction = (FormulaFunction) val; - - final ContextLookup context = (ContextLookup) reportFunction.getChildValues()[0]; - name = context.getName(); + if (val instanceof Term) + { + val = ((Term)val).getHeadValue(); + } + else if (val instanceof FormulaFunction) + { + final FormulaFunction reportFunction = (FormulaFunction) val; + val = reportFunction.getChildValues()[0]; + } } - else if (val instanceof Term) + if (val instanceof ContextLookup) { - final Term term = (Term) val; - final ContextLookup context = (ContextLookup) term.getHeadValue().getChildValues()[0]; + final ContextLookup context = (ContextLookup) val; name = context.getName(); } break; -- cgit v1.2.3 From 9bc02eaf9c7df1cf4408a2af37e9fe9c67acecb1 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Wed, 25 Nov 2009 13:48:21 +0100 Subject: dba33d: #i104869# use the interaction handler to delegate UI --- dbaccess/qa/complex/dbaccess/dbaccess.sce | 2 +- dbaccess/source/ui/inc/WCopyTable.hxx | 40 ++---------- dbaccess/source/ui/inc/dbu_misc.hrc | 4 +- dbaccess/source/ui/inc/dbu_resource.hrc | 4 +- dbaccess/source/ui/misc/WCPage.cxx | 17 ++--- dbaccess/source/ui/misc/WColumnSelect.cxx | 1 + dbaccess/source/ui/misc/WCopyTable.cxx | 101 +++++++++++++++++++++-------- dbaccess/source/ui/misc/WTypeSelect.cxx | 2 +- dbaccess/source/ui/misc/WizardPages.src | 10 ++- dbaccess/source/ui/uno/copytablewizard.cxx | 3 +- 10 files changed, 104 insertions(+), 80 deletions(-) diff --git a/dbaccess/qa/complex/dbaccess/dbaccess.sce b/dbaccess/qa/complex/dbaccess/dbaccess.sce index 47387e459ae9..c5fa408ff273 100644 --- a/dbaccess/qa/complex/dbaccess/dbaccess.sce +++ b/dbaccess/qa/complex/dbaccess/dbaccess.sce @@ -7,6 +7,6 @@ -o complex.dbaccess.DataSource -o complex.dbaccess.Parser -o complex.dbaccess.ApplicationController -#-o complex.dbaccess.CopyTableWizard +-o complex.dbaccess.CopyTableWizard -o complex.dbaccess.UISettings -o complex.dbaccess.Beamer diff --git a/dbaccess/source/ui/inc/WCopyTable.hxx b/dbaccess/source/ui/inc/WCopyTable.hxx index 37d0d870f538..741e6f67e590 100644 --- a/dbaccess/source/ui/inc/WCopyTable.hxx +++ b/dbaccess/source/ui/inc/WCopyTable.hxx @@ -31,55 +31,23 @@ #ifndef DBAUI_WIZ_COPYTABLEDIALOG_HXX #define DBAUI_WIZ_COPYTABLEDIALOG_HXX -#ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_ #include -#endif -#ifndef _COM_SUN_STAR_SDBC_XCONNECTION_HPP_ #include -#endif -#ifndef _COM_SUN_STAR_SDBC_XRESULTSET_HPP_ #include -#endif -#ifndef _COM_SUN_STAR_SDBC_XRESULTSETMETADATA_HPP_ #include -#endif -#ifndef _COM_SUN_STAR_SDBC_XDATABASEMETADATA_HPP_ #include -#endif -#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ #include -#endif -#ifndef _COMPHELPER_STLTYPES_HXX_ #include -#endif -#ifndef DBAUI_TYPEINFO_HXX #include "TypeInfo.hxx" -#endif -#ifndef _SV_BUTTON_HXX #include -#endif -#ifndef _SVT_WIZDLG_HXX #include -#endif -#ifndef DBAUI_DATABASEEXPORT_HXX #include "DExport.hxx" -#endif -#ifndef DBAUI_WIZ_TABBPAGE_HXX #include "WTabPage.hxx" -#endif -#ifndef DBAUI_FIELDDESCRIPTIONS_HXX #include "FieldDescriptions.hxx" -#endif -#ifndef _COM_SUN_STAR_SDBCX_XCOLUMNSSUPPLIER_HPP_ #include -#endif -#ifndef _COM_SUN_STAR_SDBCX_XKEYSSUPPLIER_HPP_ #include -#endif -#ifndef _SV_LSTBOX_HXX +#include #include -#endif - #include namespace dbaui @@ -299,6 +267,7 @@ namespace dbaui ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > m_xFormatter; ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory> m_xFactory; + ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler> m_xInteractionHandler; String m_sTypeNames; // these type names are the ones out of the resource file sal_uInt32 m_nPageCount; @@ -343,7 +312,8 @@ namespace dbaui const ICopyTableSourceObject& _rSourceObject, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xSourceConnection, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection, - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB, + const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler>& _xInteractionHandler ); // used for importing rtf/html sources @@ -445,6 +415,8 @@ namespace dbaui void showColumnTypeNotSupported(const ::rtl::OUString& _rColumnName); void removeColumnNameFromNameMap(const ::rtl::OUString& _sName); + void showError(const ::rtl::OUString& _sErrorMesage); + void showError(const ::com::sun::star::uno::Any& _aError); }; } diff --git a/dbaccess/source/ui/inc/dbu_misc.hrc b/dbaccess/source/ui/inc/dbu_misc.hrc index 0ee803edec10..6aeb5b1331ab 100644 --- a/dbaccess/source/ui/inc/dbu_misc.hrc +++ b/dbaccess/source/ui/inc/dbu_misc.hrc @@ -50,10 +50,12 @@ #define STR_FILE_DOES_NOT_EXIST RID_STR_MISC_START + 13 #define STR_WARNINGS_DURING_CONNECT RID_STR_MISC_START + 14 #define STR_NAMED_OBJECT_ALREADY_EXISTS RID_STR_MISC_START + 15 +#define STR_INVALID_TABLE_NAME RID_STR_MISC_START + 16 +#define STR_INVALID_TABLE_NAME_LENGTH RID_STR_MISC_START + 17 // please adjust checking before insert new strings -#if STR_NAMED_OBJECT_ALREADY_EXISTS > RID_STR_MISC_END +#if STR_INVALID_TABLE_NAME_LENGTH > RID_STR_MISC_END #error Resource-Id Ueberlauf in #file, #line #endif diff --git a/dbaccess/source/ui/inc/dbu_resource.hrc b/dbaccess/source/ui/inc/dbu_resource.hrc index 4686b540e936..76fc76d0abdc 100644 --- a/dbaccess/source/ui/inc/dbu_resource.hrc +++ b/dbaccess/source/ui/inc/dbu_resource.hrc @@ -182,13 +182,13 @@ // error boxes #define ERR_NOREGISTEREDDATASOURCES RID_ERRORBOX_START + 0 -#define ERROR_INVALID_TABLE_NAME_LENGTH RID_ERRORBOX_START + 1 +// free #define ERR_QRY_CRITERIA_ON_ASTERISK RID_ERRORBOX_START + 2 #define ERR_QRY_ORDERBY_ON_ASTERISK RID_ERRORBOX_START + 3 #define ERR_QRY_AMB_FIELD RID_ERRORBOX_START + 4 // FREE #define ERR_INVALID_LISTBOX_ENTRY RID_ERRORBOX_START + 6 -#define ERROR_INVALID_TABLE_NAME RID_ERRORBOX_START + 7 +// FREE #define ERR_NEED_INDEX_FIELDS RID_ERRORBOX_START + 8 #define ERR_QRY_NOSTATEMENT RID_ERRORBOX_START + 9 #define ERR_QRY_NOCRITERIA RID_ERRORBOX_START + 10 diff --git a/dbaccess/source/ui/misc/WCPage.cxx b/dbaccess/source/ui/misc/WCPage.cxx index 63a910929836..85804dec9d0c 100644 --- a/dbaccess/source/ui/misc/WCPage.cxx +++ b/dbaccess/source/ui/misc/WCPage.cxx @@ -227,7 +227,8 @@ sal_Bool OCopyTable::LeavePage() if ( !aNameCheck.isNameValid( m_edTableName.GetText(), aErrorInfo ) ) { aErrorInfo.append( SQLExceptionInfo::SQL_CONTEXT, String( ModuleRes( STR_SUGGEST_APPEND_TABLE_DATA ) ) ); - ::dbaui::showError( aErrorInfo, m_pParent, m_pParent->m_xFactory ); + m_pParent->showError(aErrorInfo.get()); + return sal_False; } @@ -245,7 +246,8 @@ sal_Bool OCopyTable::LeavePage() sal_Int32 nMaxLength = xMeta->getMaxTableNameLength(); if ( nMaxLength && sTable.getLength() > nMaxLength ) { - ErrorBox(this, ModuleRes(ERROR_INVALID_TABLE_NAME_LENGTH)).Execute(); + String sError(ModuleRes(STR_INVALID_TABLE_NAME_LENGTH)); + m_pParent->showError(sError); return sal_False; } @@ -256,8 +258,7 @@ sal_Bool OCopyTable::LeavePage() String aInfoString( ModuleRes(STR_WIZ_PKEY_ALREADY_DEFINED) ); aInfoString += String(' '); aInfoString += String(m_pParent->m_aKeyName); - InfoBox aNameInfoBox( this, aInfoString ); - aNameInfoBox.Execute(); + m_pParent->showError(aInfoString); return sal_False; } } @@ -288,7 +289,8 @@ sal_Bool OCopyTable::LeavePage() if(!m_pParent->m_sName.getLength()) { - ErrorBox(this, ModuleRes(ERROR_INVALID_TABLE_NAME)).Execute(); + String sError(ModuleRes(STR_INVALID_TABLE_NAME)); + m_pParent->showError(sError); return sal_False; } @@ -367,9 +369,8 @@ sal_Bool OCopyTable::checkAppendData() if ( !xTable.is() ) { - ErrorBox( this, ModuleRes( ERROR_INVALID_TABLE_NAME ) ).Execute(); - // TODO: shouldn't this be some kind of showError? In case of the UNO service for this wizard, - // shouldn't this even be a usage of the service's interaction handler? + String sError(ModuleRes(STR_INVALID_TABLE_NAME)); + m_pParent->showError(sError); return sal_False; } return sal_True; diff --git a/dbaccess/source/ui/misc/WColumnSelect.cxx b/dbaccess/source/ui/misc/WColumnSelect.cxx index 69d5c3bad4fd..12173965f739 100644 --- a/dbaccess/source/ui/misc/WColumnSelect.cxx +++ b/dbaccess/source/ui/misc/WColumnSelect.cxx @@ -140,6 +140,7 @@ void OWizColumnSelect::Reset() clearListBox(m_lbOrgColumnNames); clearListBox(m_lbNewColumnNames); + m_pParent->m_mNameMapping.clear(); // insert the source columns in the left listbox const ODatabaseExport::TColumnVector* pSrcColumns = m_pParent->getSrcVector(); diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx index 2b664c02f7e2..dd31e3b87cee 100644 --- a/dbaccess/source/ui/misc/WCopyTable.cxx +++ b/dbaccess/source/ui/misc/WCopyTable.cxx @@ -46,6 +46,7 @@ /** === begin UNO includes === **/ #include +#include #include #include #include @@ -62,8 +63,10 @@ #include #include +#include #include #include +#include #include #include @@ -80,9 +83,12 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::container; using namespace ::com::sun::star::util; +using namespace ::com::sun::star::sdb; using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::sdbcx; using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::task; +using namespace dbtools; namespace CopyTableOperation = ::com::sun::star::sdb::application::CopyTableOperation; @@ -566,7 +572,8 @@ namespace //------------------------------------------------------------------------ OCopyTableWizard::OCopyTableWizard( Window * pParent, const ::rtl::OUString& _rDefaultName, sal_Int16 _nOperation, const ICopyTableSourceObject& _rSourceObject, const Reference< XConnection >& _xSourceConnection, - const Reference< XConnection >& _xConnection, const Reference< XMultiServiceFactory >& _rxORB ) + const Reference< XConnection >& _xConnection, const Reference< XMultiServiceFactory >& _rxORB, + const Reference< XInteractionHandler>& _xInteractionHandler) : WizardDialog( pParent, ModuleRes(WIZ_RTFCOPYTABLE)) ,m_pbHelp( this , ModuleRes(PB_HELP)) ,m_pbCancel( this , ModuleRes(PB_CANCEL)) @@ -578,6 +585,7 @@ OCopyTableWizard::OCopyTableWizard( Window * pParent, const ::rtl::OUString& _rD ,m_rSourceObject( _rSourceObject ) ,m_xFormatter( getNumberFormatter( _xConnection, _rxORB ) ) ,m_xFactory(_rxORB) + ,m_xInteractionHandler(_xInteractionHandler) ,m_sTypeNames(ModuleRes(STR_TABLEDESIGN_DBFIELDTYPES)) ,m_nPageCount(0) ,m_bDeleteSourceColumns(sal_True) @@ -924,6 +932,7 @@ IMPL_LINK( OCopyTableWizard, ImplOKHdl, OKButton*, EMPTYARG ) OWizTypeSelect* pPage = static_cast(GetPage(3)); if ( pPage ) { + m_mNameMapping.clear(); pPage->setDisplayRow(nBreakPos); ShowPage(3); return 0; @@ -935,33 +944,37 @@ IMPL_LINK( OCopyTableWizard, ImplOKHdl, OKButton*, EMPTYARG ) { ODatabaseExport::TColumns::iterator aFind = ::std::find_if(m_vDestColumns.begin(),m_vDestColumns.end() ,::std::compose1(::std::mem_fun(&OFieldDescription::IsPrimaryKey),::std::select2nd())); - if ( aFind == m_vDestColumns.end() ) + if ( aFind == m_vDestColumns.end() && m_xInteractionHandler.is() ) { + String sTitle(ModuleRes(STR_TABLEDESIGN_NO_PRIM_KEY_HEAD)); String sMsg(ModuleRes(STR_TABLEDESIGN_NO_PRIM_KEY)); - OSQLMessageBox aBox(this, sTitle,sMsg, WB_YES_NO_CANCEL | WB_DEF_YES); - - INT16 nReturn = aBox.Execute(); - - switch(nReturn ) + SQLContext aError; + aError.Message = sMsg; + ::rtl::Reference< ::comphelper::OInteractionRequest > xRequest( new ::comphelper::OInteractionRequest( makeAny( aError ) ) ); + ::rtl::Reference< ::comphelper::OInteractionApprove > xYes = new ::comphelper::OInteractionApprove; + xRequest->addContinuation( xYes.get() ); + xRequest->addContinuation( new ::comphelper::OInteractionDisapprove ); + ::rtl::Reference< ::comphelper::OInteractionAbort > xAbort = new ::comphelper::OInteractionAbort; + xRequest->addContinuation( xAbort.get() ); + + m_xInteractionHandler->handle( xRequest.get() ); + + if ( xYes->wasSelected() ) { - case RET_YES: - { - OCopyTable* pPage = static_cast(GetPage(0)); - m_bCreatePrimaryKeyColumn = sal_True; - m_aKeyName = pPage->GetKeyName(); - if ( !m_aKeyName.getLength() ) - m_aKeyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ID" ) ); - m_aKeyName = createUniqueName( m_aKeyName ); - sal_Int32 nBreakPos2 = 0; - CheckColumns(nBreakPos2); - break; - } - case RET_CANCEL: - ShowPage(3); - return 0; - default: - ; + OCopyTable* pPage = static_cast(GetPage(0)); + m_bCreatePrimaryKeyColumn = sal_True; + m_aKeyName = pPage->GetKeyName(); + if ( !m_aKeyName.getLength() ) + m_aKeyName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ID" ) ); + m_aKeyName = createUniqueName( m_aKeyName ); + sal_Int32 nBreakPos2 = 0; + CheckColumns(nBreakPos2); + } + else if ( xAbort->wasSelected() ) + { + ShowPage(3); + return 0; } } } @@ -1601,6 +1614,22 @@ TOTypeInfoSP OCopyTableWizard::convertType(const TOTypeInfoSP& _pType,sal_Bool& if ( supportsType(DataType::CLOB,nDefaultType) ) break; break; + case DataType::BINARY: + if ( supportsType(DataType::VARBINARY,nDefaultType) ) + break; + break; + case DataType::VARBINARY: + if ( supportsType(DataType::LONGVARBINARY,nDefaultType) ) + break; + break; + case DataType::LONGVARBINARY: + if ( supportsType(DataType::BLOB,nDefaultType) ) + break; + if ( supportsType(DataType::LONGVARCHAR,nDefaultType) ) + break; + if ( supportsType(DataType::CLOB,nDefaultType) ) + break; + break; default: nDefaultType = DataType::VARCHAR; } @@ -1646,7 +1675,27 @@ void OCopyTableWizard::showColumnTypeNotSupported(const ::rtl::OUString& _rColum RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OCopyTableWizard::showColumnTypeNotSupported" ); String sMessage( ModuleRes( STR_UNKNOWN_TYPE_FOUND ) ); sMessage.SearchAndReplaceAscii("#1",_rColumnName); - - OSQLWarningBox( this, sMessage ).Execute(); + showError(sMessage); } //------------------------------------------------------------------------------- +void OCopyTableWizard::showError(const ::rtl::OUString& _sErrorMesage) +{ + SQLExceptionInfo aInfo(_sErrorMesage); + showError(aInfo.get()); +} +//------------------------------------------------------------------------------- +void OCopyTableWizard::showError(const Any& _aError) +{ + if ( _aError.hasValue() && m_xInteractionHandler.is() ) + { + try + { + ::rtl::Reference< ::comphelper::OInteractionRequest > xRequest( new ::comphelper::OInteractionRequest( _aError ) ); + m_xInteractionHandler->handle( xRequest.get() ); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + } +} \ No newline at end of file diff --git a/dbaccess/source/ui/misc/WTypeSelect.cxx b/dbaccess/source/ui/misc/WTypeSelect.cxx index ceeb058528df..a964b0e13d38 100644 --- a/dbaccess/source/ui/misc/WTypeSelect.cxx +++ b/dbaccess/source/ui/misc/WTypeSelect.cxx @@ -178,7 +178,7 @@ void OWizTypeSelectControl::CellModified(long nRow, sal_uInt16 nColId ) { String strMessage = String(ModuleRes(STR_TABLEDESIGN_DUPLICATE_NAME)); strMessage.SearchAndReplaceAscii("$column$", sNewName); - OSQLWarningBox( this, strMessage ).Execute(); + pWiz->showError(strMessage); pCurFieldDescr->SetName(sName); DisplayData(pCurFieldDescr); static_cast(GetParent())->setDuplicateName(sal_True); diff --git a/dbaccess/source/ui/misc/WizardPages.src b/dbaccess/source/ui/misc/WizardPages.src index 638feb92e54c..329f08b222d9 100644 --- a/dbaccess/source/ui/misc/WizardPages.src +++ b/dbaccess/source/ui/misc/WizardPages.src @@ -552,20 +552,18 @@ String STR_COPYTABLE_TITLE_COPY Text [ en-US ] = "Copy table" ; }; -ErrorBox ERROR_INVALID_TABLE_NAME +String STR_INVALID_TABLE_NAME { - Buttons = WB_OK; - Message [ en-US ] = "This table name is not valid in the current database."; + Text [ en-US ] = "This table name is not valid in the current database."; }; String STR_SUGGEST_APPEND_TABLE_DATA { Text [ en-US ] = "Choose the option 'Append data' on the first page to append data to an existing table."; }; -ErrorBox ERROR_INVALID_TABLE_NAME_LENGTH +String STR_INVALID_TABLE_NAME_LENGTH { - Buttons = WB_OK; - Message [ en-US ] = "Please change the table name. It is too long."; + Text [ en-US ] = "Please change the table name. It is too long."; }; Image IMG_SORTUP_H diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx index ce79281f0cac..159d447ae554 100644 --- a/dbaccess/source/ui/uno/copytablewizard.cxx +++ b/dbaccess/source/ui/uno/copytablewizard.cxx @@ -1578,7 +1578,8 @@ Dialog* CopyTableWizard::createDialog( Window* _pParent ) *m_pSourceObject, m_xSourceConnection.getTyped(), m_xDestConnection.getTyped(), - m_aContext.getLegacyServiceFactory() + m_aContext.getLegacyServiceFactory(), + m_xInteractionHandler ); impl_attributesToDialog_nothrow( *pWizard ); -- cgit v1.2.3 From 090f29ed471262e5fbaec9aa4ed3b85d0b4eb94e Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Wed, 25 Nov 2009 13:58:57 +0100 Subject: dba33d: #i106253# remove assertion --- connectivity/source/parse/sqlnode.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx index c76dd44e3d18..543f93d3b533 100644 --- a/connectivity/source/parse/sqlnode.cxx +++ b/connectivity/source/parse/sqlnode.cxx @@ -911,7 +911,6 @@ OSQLParseNode* OSQLParser::convertNode(sal_Int32 nType,OSQLParseNode*& pLiteral) } break; default: - OSL_ENSURE(0,"Not handled!"); } } return pReturn; -- cgit v1.2.3 From ca116ee69b6c238e7243002bf1650332dc098902 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 25 Nov 2009 19:23:34 +0100 Subject: vcl108: #i106547# active/inactive scrollbars --- vcl/aqua/inc/salgdi.h | 1 + vcl/aqua/source/gdi/salnativewidgets.cxx | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/vcl/aqua/inc/salgdi.h b/vcl/aqua/inc/salgdi.h index 4933dbc48586..33e4862c258c 100644 --- a/vcl/aqua/inc/salgdi.h +++ b/vcl/aqua/inc/salgdi.h @@ -359,6 +359,7 @@ private: void ApplyXorContext(); void Pattern50Fill(); UInt32 getState( ControlState nState ); + UInt32 getTrackState( ControlState nState ); }; class XorEmulation diff --git a/vcl/aqua/source/gdi/salnativewidgets.cxx b/vcl/aqua/source/gdi/salnativewidgets.cxx index 754358823a93..1536299331cb 100644 --- a/vcl/aqua/source/gdi/salnativewidgets.cxx +++ b/vcl/aqua/source/gdi/salnativewidgets.cxx @@ -450,6 +450,15 @@ UInt32 AquaSalGraphics::getState( ControlState nState ) return kThemeStateActive; } +UInt32 AquaSalGraphics::getTrackState( ControlState nState ) +{ + bool bDrawActive = mpFrame ? ([mpFrame->getWindow() isKeyWindow] ? true : false) : true; + if( (nState & CTRL_STATE_ENABLED) == 0 || ! bDrawActive ) + return kThemeTrackInactive; + + return kThemeTrackActive; +} + /* * DrawNativeControl() * @@ -767,7 +776,10 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType, aTrackInfo.attributes = kThemeTrackHorizontal; if( Application::GetSettings().GetLayoutRTL() ) aTrackInfo.attributes |= kThemeTrackRightToLeft; - aTrackInfo.enableState = (nState & CTRL_STATE_ENABLED) ? kThemeTrackActive : kThemeTrackInactive; + aTrackInfo.enableState = getTrackState( nState ); + // the intro bitmap never gets key anyway; we want to draw that enabled + if( nType == CTRL_INTROPROGRESS ) + aTrackInfo.enableState = kThemeTrackActive; aTrackInfo.filler1 = 0; aTrackInfo.trackInfo.progress.phase = static_cast(CFAbsoluteTimeGetCurrent()*10.0); @@ -799,7 +811,7 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType, aTrackDraw.attributes = kThemeTrackShowThumb; if( nPart == PART_DRAW_BACKGROUND_HORZ ) aTrackDraw.attributes |= kThemeTrackHorizontal; - aTrackDraw.enableState = kThemeTrackActive; + aTrackDraw.enableState = getTrackState( nState ); ScrollBarTrackInfo aScrollInfo; aScrollInfo.viewsize = pScrollbarVal->mnVisibleSize; -- cgit v1.2.3 From eb0f90d33200e26d128672bbb6a105e815144cfc Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Thu, 26 Nov 2009 09:07:47 +0100 Subject: dba33d: #i106526# askParameter now compress duplicate parameter names --- connectivity/source/commontools/dbtools.cxx | 53 ++++++++++++++++++----------- 1 file changed, 33 insertions(+), 20 deletions(-) diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx index bb088937c313..d5502fc0272c 100644 --- a/connectivity/source/commontools/dbtools.cxx +++ b/connectivity/source/commontools/dbtools.cxx @@ -1388,16 +1388,18 @@ namespace ::dbtools::OPropertyMap& rPropMap = OMetaConnection::getPropMap(); Reference< XPropertySetInfo > xInfo = _xTable->getPropertySetInfo(); if ( xInfo.is() - && xInfo->hasPropertyByName(rPropMap.getNameByIndex(PROPERTY_ID_CATALOGNAME)) - && xInfo->hasPropertyByName(rPropMap.getNameByIndex(PROPERTY_ID_SCHEMANAME)) && xInfo->hasPropertyByName(rPropMap.getNameByIndex(PROPERTY_ID_NAME)) ) { ::rtl::OUString aCatalog; ::rtl::OUString aSchema; ::rtl::OUString aTable; - _xTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_CATALOGNAME)) >>= _out_rCatalog; - _xTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_SCHEMANAME)) >>= _out_rSchema; + if ( xInfo->hasPropertyByName(rPropMap.getNameByIndex(PROPERTY_ID_CATALOGNAME)) + && xInfo->hasPropertyByName(rPropMap.getNameByIndex(PROPERTY_ID_SCHEMANAME)) ) + { + _xTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_CATALOGNAME)) >>= _out_rCatalog; + _xTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_SCHEMANAME)) >>= _out_rSchema; + } _xTable->getPropertyValue(rPropMap.getNameByIndex(PROPERTY_ID_NAME)) >>= _out_rName; } else @@ -1779,15 +1781,31 @@ void askForParameters(const Reference< XSingleSelectQueryComposer >& _xComposer, Reference xParamsAsIndicies = xParameters.is() ? xParameters->getParameters() : Reference(); Reference xParamsAsNames(xParamsAsIndicies, UNO_QUERY); sal_Int32 nParamCount = xParamsAsIndicies.is() ? xParamsAsIndicies->getCount() : 0; - if ( (nParamCount && _aParametersSet.empty()) || ::std::count(_aParametersSet.begin(),_aParametersSet.end(),true) != nParamCount ) + ::std::bit_vector aNewParameterSet( _aParametersSet ); + if ( nParamCount || ::std::count(aNewParameterSet.begin(),aNewParameterSet.end(),true) != nParamCount ) { + static const ::rtl::OUString PROPERTY_NAME(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)); + aNewParameterSet.resize(nParamCount ,false); + typedef ::std::map< ::rtl::OUString, ::std::vector > TParameterPositions; + TParameterPositions aParameterNames; + for(sal_Int32 i = 0; i < nParamCount; ++i) + { + Reference xParam(xParamsAsIndicies->getByIndex(i),UNO_QUERY); + ::rtl::OUString sName; + xParam->getPropertyValue(PROPERTY_NAME) >>= sName; + + TParameterPositions::iterator aFind = aParameterNames.find(sName); + if ( aFind != aParameterNames.end() ) + aNewParameterSet[i] = true; + aParameterNames[sName].push_back(i+1); + } // build an interaction request // two continuations (Ok and Cancel) OInteractionAbort* pAbort = new OInteractionAbort; OParameterContinuation* pParams = new OParameterContinuation; // the request ParametersRequest aRequest; - Reference xWrappedParameters = new OParameterWrapper(_aParametersSet,xParamsAsIndicies); + Reference xWrappedParameters = new OParameterWrapper(aNewParameterSet,xParamsAsIndicies); aRequest.Parameters = xWrappedParameters; aRequest.Connection = _xConnection; OInteractionRequest* pRequest = new OInteractionRequest(makeAny(aRequest)); @@ -1815,11 +1833,10 @@ void askForParameters(const Reference< XSingleSelectQueryComposer >& _xComposer, Reference< XPropertySet > xParamColumn(xWrappedParameters->getByIndex(i),UNO_QUERY); if (xParamColumn.is()) { -#ifdef DBG_UTIL ::rtl::OUString sName; - xParamColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_NAME)) >>= sName; + xParamColumn->getPropertyValue(PROPERTY_NAME) >>= sName; OSL_ENSURE(sName.equals(pFinalValues->Name), "::dbaui::askForParameters: inconsistent parameter names!"); -#endif + // determine the field type and ... sal_Int32 nParamType = 0; xParamColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_TYPE)) >>= nParamType; @@ -1827,21 +1844,17 @@ void askForParameters(const Reference< XSingleSelectQueryComposer >& _xComposer, sal_Int32 nScale = 0; if (hasProperty(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE), xParamColumn)) xParamColumn->getPropertyValue(OMetaConnection::getPropMap().getNameByIndex(PROPERTY_ID_SCALE)) >>= nScale; - // and set the value - ::std::bit_vector::const_iterator aIter = _aParametersSet.begin(); - ::std::bit_vector::const_iterator aEnd = _aParametersSet.end(); - sal_Int32 j = 0; - sal_Int32 nParamPos = -1; - for(; aIter != aEnd && j <= i; ++aIter) + // (the index of the parameters is one-based) + TParameterPositions::iterator aFind = aParameterNames.find(pFinalValues->Name); + ::std::vector::iterator aIterPos = aFind->second.begin(); + ::std::vector::iterator aEndPos = aFind->second.end(); + for(;aIterPos != aEndPos;++aIterPos) { - ++nParamPos; - if ( !*aIter ) + if ( _aParametersSet.empty() || !_aParametersSet[(*aIterPos)-1] ) { - ++j; + _xParameters->setObjectWithInfo(*aIterPos, pFinalValues->Value, nParamType, nScale); } } - _xParameters->setObjectWithInfo(nParamPos + 1, pFinalValues->Value, nParamType, nScale); - // (the index of the parameters is one-based) } } } -- cgit v1.2.3 From 05e8ff4c39b2a603b86e7fa587cbaa096332182d Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 26 Nov 2009 11:15:10 +0100 Subject: vcl108: #i107228# fix an uninitalized warning from valgrind (thanks cmc) --- vcl/source/window/status.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx index 4aaef6a707b1..a4c067061c30 100644 --- a/vcl/source/window/status.cxx +++ b/vcl/source/window/status.cxx @@ -156,6 +156,7 @@ void StatusBar::ImplInit( Window* pParent, WinBits nStyle ) mbProgressMode = FALSE; mbInUserDraw = FALSE; mbBottomBorder = FALSE; + mnItemsWidth = STATUSBAR_OFFSET_X; mnDX = 0; mnDY = 0; mnCalcHeight = 0; -- cgit v1.2.3 From e287e4c81d5e551c0e0fa6a760c187f350301033 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Thu, 26 Nov 2009 11:58:45 +0100 Subject: #i107081# - impl/use new PasswordContainerInteractionHandler UNO service. --- extensions/source/update/feed/updatefeed.cxx | 169 ++++----------------------- 1 file changed, 25 insertions(+), 144 deletions(-) diff --git a/extensions/source/update/feed/updatefeed.cxx b/extensions/source/update/feed/updatefeed.cxx index e7ca93eacc18..44b9732a7b5b 100644 --- a/extensions/source/update/feed/updatefeed.cxx +++ b/extensions/source/update/feed/updatefeed.cxx @@ -32,7 +32,7 @@ #include "precompiled_extensions.hxx" #include -#include +#include #include #include #include @@ -44,26 +44,16 @@ #include #include #include -#include -#include "com/sun/star/task/NoMasterException.hpp" -#include "com/sun/star/ucb/AuthenticationRequest.hpp" -#ifndef _COM_SUN_STAR_UCB_XCOMMMANDENVIRONMENT_HPP_ #include -#endif -#ifndef _COM_SUN_STAR_UCB_XWEBDAVCOMMMANDENVIRONMENT_HPP_ #include -#endif -#ifndef _COM_SUN_STAR_UCB_XCOMMMANDPROCESSOR2_HPP_ #include -#endif -#ifndef _COM_SUN_STAR_UCB_XCONTENTIDNETIFIERFACTORY_HPP_ #include -#endif #include #include "com/sun/star/ucb/XInteractionSupplyAuthentication.hpp" #include #include #include +#include #include #include @@ -302,11 +292,10 @@ void InflateInputStream::readIntoMemory() //------------------------------------------------------------------------------ class UpdateInformationProvider : - public ::cppu::WeakImplHelper5< deployment::XUpdateInformationProvider, + public ::cppu::WeakImplHelper4< deployment::XUpdateInformationProvider, ucb::XCommandEnvironment, ucb::XWebDAVCommandEnvironment, - lang::XServiceInfo, - task::XInteractionHandler > + lang::XServiceInfo > { public: static uno::Reference< uno::XInterface > createInstance(const uno::Reference& xContext); @@ -358,10 +347,6 @@ public: virtual uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames() throw (uno::RuntimeException); - // XInteractionHandler - virtual void SAL_CALL handle( const uno::Reference< task::XInteractionRequest >& rRequest ) - throw( uno::RuntimeException ); - protected: virtual ~UpdateInformationProvider(); @@ -373,8 +358,6 @@ private: void storeCommandInfo( sal_Int32 nCommandId, uno::Reference< ucb::XCommandProcessor > const & rxCommandProcessor); - bool initPasswordContainer( uno::Reference< task::XPasswordContainer > * pContainer ); - UpdateInformationProvider(const uno::Reference& xContext, const uno::Reference< ucb::XContentIdentifierFactory >& xContentIdFactory, const uno::Reference< ucb::XContentProvider >& xContentProvider, @@ -392,6 +375,7 @@ private: uno::Reference< ucb::XCommandProcessor > m_xCommandProcessor; uno::Reference< task::XInteractionHandler > m_xInteractionHandler; + uno::Reference< task::XInteractionHandler > m_xPwContainerInteractionHandler; osl::Mutex m_aMutex; osl::Condition m_bCancelled; @@ -661,33 +645,6 @@ UpdateInformationProvider::storeCommandInfo( //------------------------------------------------------------------------------ -bool UpdateInformationProvider::initPasswordContainer( uno::Reference< task::XPasswordContainer > * pContainer ) -{ - OSL_ENSURE( pContainer, "specification violation" ); - - if ( !pContainer->is() ) - { - uno::Reference xContext(m_xContext); - - if( !xContext.is() ) - throw uno::RuntimeException( UNISTRING( "UpdateInformationProvider: empty component context" ), *this ); - - uno::Reference< lang::XMultiComponentFactory > xServiceManager(xContext->getServiceManager()); - - if( !xServiceManager.is() ) - throw uno::RuntimeException( UNISTRING( "UpdateInformationProvider: unable to obtain service manager from component context" ), *this ); - - *pContainer = uno::Reference< task::XPasswordContainer >( - xServiceManager->createInstanceWithContext( UNISTRING( "com.sun.star.task.PasswordContainer" ), xContext ), - uno::UNO_QUERY); - } - - OSL_ENSURE(pContainer->is(), "unexpected situation"); - return pContainer->is(); -} - -//------------------------------------------------------------------------------ - uno::Reference< io::XInputStream > UpdateInformationProvider::load(const rtl::OUString& rURL) { @@ -974,7 +931,26 @@ UpdateInformationProvider::getInteractionHandler() if ( m_xInteractionHandler.is() ) return m_xInteractionHandler; else - return this; + { + try + { + // Supply an interaction handler that uses the password container + // service to obtain credentials without displaying a password gui. + + if ( !m_xPwContainerInteractionHandler.is() ) + m_xPwContainerInteractionHandler + = task::PasswordContainerInteractionHandler::create( + m_xContext ); + } + catch ( uno::RuntimeException const & ) + { + throw; + } + catch ( uno::Exception const & ) + { + } + return m_xPwContainerInteractionHandler; + } } //------------------------------------------------------------------------------ @@ -1024,101 +1000,6 @@ UpdateInformationProvider::supportsService( rtl::OUString const & serviceName ) return sal_False; } -//------------------------------------------------------------------------------ - -void SAL_CALL UpdateInformationProvider::handle( uno::Reference< task::XInteractionRequest > const & rRequest) - throw (uno::RuntimeException) -{ - uno::Any aAnyRequest( rRequest->getRequest() ); - ucb::AuthenticationRequest aAuthenticationRequest; - - if ( aAnyRequest >>= aAuthenticationRequest ) - { - uno::Sequence< uno::Reference< task::XInteractionContinuation > > xContinuations = rRequest->getContinuations(); - uno::Reference< task::XInteractionHandler > xIH; - uno::Reference< ucb::XInteractionSupplyAuthentication > xSupplyAuthentication; - uno::Reference< task::XPasswordContainer > xContainer; - - for ( sal_Int32 i = 0; i < xContinuations.getLength(); ++i ) - { - xSupplyAuthentication = uno::Reference< ucb::XInteractionSupplyAuthentication >( - xContinuations[i], uno::UNO_QUERY ); - if ( xSupplyAuthentication.is() ) - break; - } - - // xContainer works with userName passwdSequences pairs: - if ( xSupplyAuthentication.is() && - aAuthenticationRequest.HasUserName && - aAuthenticationRequest.HasPassword && - initPasswordContainer( &xContainer ) ) - { - xIH = getInteractionHandler(); - try - { - if ( aAuthenticationRequest.UserName.getLength() == 0 ) - { - task::UrlRecord aRec( xContainer->find( aAuthenticationRequest.ServerName, xIH ) ); - if ( aRec.UserList.getLength() != 0 ) - { - if ( xSupplyAuthentication->canSetUserName() ) - xSupplyAuthentication->setUserName( aRec.UserList[0].UserName.getStr() ); - if ( xSupplyAuthentication->canSetPassword() ) - { - OSL_ENSURE( aRec.UserList[0].Passwords.getLength() != 0, "empty password list" ); - xSupplyAuthentication->setPassword( aRec.UserList[0].Passwords[0].getStr() ); - } - if ( aRec.UserList[0].Passwords.getLength() > 1 ) - { - if ( aAuthenticationRequest.HasRealm ) - { - if ( xSupplyAuthentication->canSetRealm() ) - xSupplyAuthentication->setRealm( aRec.UserList[0].Passwords[1].getStr() ); - } - else if ( xSupplyAuthentication->canSetAccount() ) - xSupplyAuthentication->setAccount( aRec.UserList[0].Passwords[1].getStr() ); - } - xSupplyAuthentication->select(); - return; - } - } - else - { - task::UrlRecord aRec(xContainer->findForName( aAuthenticationRequest.ServerName, - aAuthenticationRequest.UserName, - xIH)); - if ( aRec.UserList.getLength() != 0 ) - { - OSL_ENSURE( aRec.UserList[0].Passwords.getLength() != 0, "empty password list" ); - if ( !aAuthenticationRequest.HasPassword || - ( aAuthenticationRequest.Password != aRec.UserList[0].Passwords[0] ) ) - { - if ( xSupplyAuthentication->canSetUserName() ) - xSupplyAuthentication->setUserName( aRec.UserList[0].UserName.getStr() ); - if ( xSupplyAuthentication->canSetPassword() ) - xSupplyAuthentication->setPassword(aRec.UserList[0].Passwords[0].getStr()); - if ( aRec.UserList[0].Passwords.getLength() > 1 ) - { - if ( aAuthenticationRequest.HasRealm ) - { - if ( xSupplyAuthentication->canSetRealm() ) - xSupplyAuthentication->setRealm(aRec.UserList[0].Passwords[1].getStr()); - } - else if ( xSupplyAuthentication->canSetAccount() ) - xSupplyAuthentication->setAccount(aRec.UserList[0].Passwords[1].getStr()); - } - xSupplyAuthentication->select(); - return; - } - } - } - } - catch (task::NoMasterException const &) - {} // user did not enter master password - } - } -} - } // anonymous namespace //------------------------------------------------------------------------------ -- cgit v1.2.3 From 7b87c2090387ec482cca1b496235d60bdf4683bd Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Thu, 26 Nov 2009 11:58:45 +0100 Subject: #i107081# - impl/use new PasswordContainerInteractionHandler UNO service. --- ucb/source/ucp/webdav/webdavcontent.cxx | 283 +++---------------- uui/source/iahndl.cxx | 286 ++++--------------- uui/source/iahndl.hxx | 17 +- uui/source/makefile.mk | 3 +- uui/source/passwordcontainer.cxx | 473 ++++++++++++++++++++++++++++++++ uui/source/passwordcontainer.hxx | 200 ++++++++++++++ uui/source/services.cxx | 74 +++-- 7 files changed, 813 insertions(+), 523 deletions(-) create mode 100644 uui/source/passwordcontainer.cxx create mode 100644 uui/source/passwordcontainer.hxx diff --git a/ucb/source/ucp/webdav/webdavcontent.cxx b/ucb/source/ucp/webdav/webdavcontent.cxx index ae6623ff4492..7adaa88585b3 100644 --- a/ucb/source/ucp/webdav/webdavcontent.cxx +++ b/ucb/source/ucp/webdav/webdavcontent.cxx @@ -36,13 +36,16 @@ ************************************************************************** *************************************************************************/ -#include +#include #include "osl/doublecheckedlocking.h" #include #include -#include "com/sun/star/task/XPasswordContainer.hpp" -#include "com/sun/star/task/NoMasterException.hpp" +#include +#include +#include +#include + #include #include #include @@ -50,7 +53,8 @@ #include #include #include -#include "com/sun/star/ucb/AuthenticationRequest.hpp" +#include +#include #include #include #include @@ -64,24 +68,22 @@ #include #include #include +#include +#include #include #include #include #include #include #include -#include -#include -#include -#include #include #include #include #include -#include -#include -#include -#include +#include +#include +#include + #include "webdavcontent.hxx" #include "webdavprovider.hxx" #include "webdavresultset.hxx" @@ -92,230 +94,6 @@ using namespace com::sun::star; using namespace webdav_ucp; -//========================================================================= -//========================================================================= -// -// CommandEnvironment_Impl Implementation. -// -//========================================================================= -//========================================================================= - -class CommandEnvironment_Impl : public cppu::OWeakObject, - public ucb::XCommandEnvironment, - public task::XInteractionHandler -{ -public: - - CommandEnvironment_Impl( - const uno::Reference< lang::XMultiServiceFactory >& xSMgr ) - : m_xSMgr( xSMgr ) - { - } - - // XInterface - XINTERFACE_DECL() - - // XCommandEnvironment - virtual uno::Reference< task::XInteractionHandler > SAL_CALL - getInteractionHandler( ) - throw (uno::RuntimeException) - { - return this; - } - - virtual uno::Reference< ucb::XProgressHandler > SAL_CALL - getProgressHandler( ) - throw (uno::RuntimeException) - { - return 0; - } - - // XInteractionHandler - virtual void SAL_CALL - handle( const uno::Reference< task::XInteractionRequest >& Request ) - throw (uno::RuntimeException); - -private: - void - handleAuthenticationRequest( - ucb::AuthenticationRequest const&, - uno::Sequence< uno::Reference< task::XInteractionContinuation > > const&) - SAL_THROW((uno::RuntimeException)) - { - } - - uno::Reference< lang::XMultiServiceFactory > m_xSMgr; -}; - -//========================================================================= -void SAL_CALL CommandEnvironment_Impl::acquire() - throw() -{ - OWeakObject::acquire(); -} - -//========================================================================= -void SAL_CALL CommandEnvironment_Impl::release() - throw() -{ - OWeakObject::release(); -} - -//========================================================================= -uno::Any SAL_CALL CommandEnvironment_Impl::queryInterface( - const uno::Type & rType ) - throw( uno::RuntimeException ) -{ - uno::Any aRet = cppu::queryInterface( - rType, - static_cast< ucb::XCommandEnvironment * >( this ), - static_cast< task::XInteractionHandler * >( this ) ); - return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType ); -} - -//========================================================================= -void SAL_CALL CommandEnvironment_Impl::handle( - const uno::Reference< task::XInteractionRequest >& rIRequest ) - throw (uno::RuntimeException) -{ - if (!rIRequest.is()) - return; - - uno::Any aAnyRequest(rIRequest->getRequest()); - - ucb::AuthenticationRequest rRequest; - if (!(aAnyRequest >>= rRequest)) - return; - - uno::Sequence< uno::Reference< task::XInteractionContinuation > > - rContinuations = rIRequest->getContinuations(); - - uno::Reference< ucb::XInteractionSupplyAuthentication > - xSupplyAuthentication; - - for (sal_Int32 i = 0; i < rContinuations.getLength(); ++i) - { - xSupplyAuthentication - = uno::Reference< ucb::XInteractionSupplyAuthentication >( - rContinuations[i], uno::UNO_QUERY ); - if( xSupplyAuthentication.is() ) - break; - } - - if (!xSupplyAuthentication.is()) - return; - - ucb::RememberAuthentication eDefault; - uno::Sequence< ucb::RememberAuthentication > aModes( - xSupplyAuthentication->getRememberPasswordModes(eDefault)); - bool bRememberPersistent = false; - for (sal_Int32 i = 0; i < aModes.getLength(); ++i) - { - if (aModes[i] == ucb::RememberAuthentication_PERSISTENT) - { - bRememberPersistent = true; - break; - } - } - - uno::Reference< task::XPasswordContainer > xContainer; - try - { - xContainer - = uno::Reference< task::XPasswordContainer >( - m_xSMgr->createInstance( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.task.PasswordContainer"))), - uno::UNO_QUERY); - } - catch (uno::Exception const &) - { - } - - // xContainer works with userName passwdSequences pairs: - if (xContainer.is() && rRequest.HasUserName && rRequest.HasPassword ) - { - try - { - if (rRequest.UserName.getLength() == 0) - { - task::UrlRecord - aRec(xContainer->find(rRequest.ServerName, this)); - if (aRec.UserList.getLength() != 0) - { - if (xSupplyAuthentication->canSetUserName()) - xSupplyAuthentication-> - setUserName(aRec.UserList[0].UserName.getStr()); - if (xSupplyAuthentication->canSetPassword()) - { - OSL_ENSURE(aRec.UserList[0].Passwords.getLength() != 0, - "empty password list"); - xSupplyAuthentication-> - setPassword(aRec.UserList[0].Passwords[0].getStr()); - } - if (aRec.UserList[0].Passwords.getLength() > 1) - { - if (rRequest.HasRealm) - { - if (xSupplyAuthentication->canSetRealm()) - xSupplyAuthentication-> - setRealm(aRec.UserList[0].Passwords[1]. - getStr()); - } - else if (xSupplyAuthentication->canSetAccount()) - xSupplyAuthentication-> - setAccount(aRec.UserList[0].Passwords[1]. - getStr()); - } - xSupplyAuthentication->select(); - return; - } - } - else - { - task::UrlRecord - aRec(xContainer->findForName(rRequest.ServerName, - rRequest.UserName, - this)); - if (aRec.UserList.getLength() != 0) - { - OSL_ENSURE(aRec.UserList[0].Passwords.getLength() != 0, - "empty password list"); - if (!rRequest.HasPassword - || rRequest.Password != aRec.UserList[0].Passwords[0]) - { - if (xSupplyAuthentication->canSetUserName()) - xSupplyAuthentication-> - setUserName(aRec.UserList[0].UserName.getStr()); - if (xSupplyAuthentication->canSetPassword()) - xSupplyAuthentication-> - setPassword(aRec.UserList[0].Passwords[0]. - getStr()); - if (aRec.UserList[0].Passwords.getLength() > 1) - { - if (rRequest.HasRealm) - { - if (xSupplyAuthentication->canSetRealm()) - xSupplyAuthentication-> - setRealm(aRec.UserList[0].Passwords[1]. - getStr()); - } - else if (xSupplyAuthentication->canSetAccount()) - xSupplyAuthentication-> - setAccount(aRec.UserList[0].Passwords[1]. - getStr()); - } - xSupplyAuthentication->select(); - return; - } - } - } - } - catch (task::NoMasterException const &) - {} // user did not enter master password - } -} - //========================================================================= //========================================================================= // @@ -425,9 +203,28 @@ uno::Any SAL_CALL Content::queryInterface( const uno::Type & rType ) { try { - return isFolder( new CommandEnvironment_Impl(m_xSMgr) ) - ? aRet - : uno::Any(); + uno::Reference< beans::XPropertySet > const xProps( + m_xSMgr, uno::UNO_QUERY_THROW ); + uno::Reference< uno::XComponentContext > xCtx; + xCtx.set( xProps->getPropertyValue( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) ) ), + uno::UNO_QUERY_THROW ); + + uno::Reference< task::XInteractionHandler > xIH( + task::PasswordContainerInteractionHandler::create( xCtx ) ); + + // Supply a command env to isFolder() that contains an interaction + // handler that uses the password container service to obtain + // credentials without displaying a password gui. + + uno::Reference< ucb::XCommandEnvironment > xCmdEnv( + ucb::CommandEnvironment::create( + xCtx, + xIH, + uno::Reference< ucb::XProgressHandler >() ) ); + + return isFolder( xCmdEnv ) ? aRet : uno::Any(); } catch ( uno::RuntimeException const & ) { @@ -609,9 +406,11 @@ uno::Any SAL_CALL Content::execute( ucb::CommandAbortedException, uno::RuntimeException ) { - OSL_TRACE( "Content::execute: start %s", + OSL_TRACE( ">>>>> Content::execute: start: command: %s, env: %s", rtl::OUStringToOString( aCommand.Name, - RTL_TEXTENCODING_UTF8 ).getStr() ); + RTL_TEXTENCODING_UTF8 ).getStr(), + Environment.is() ? "present" : "missing" ); + uno::Any aRet; if ( aCommand.Name.equalsAsciiL( @@ -856,7 +655,7 @@ uno::Any SAL_CALL Content::execute( // Unreachable } - OSL_TRACE( "Content::execute: end %s", + OSL_TRACE( "<<<<< Content::execute: end: command: %s", rtl::OUStringToOString( aCommand.Name, RTL_TEXTENCODING_UTF8 ).getStr() ); diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx index 29f380b2a7a0..e64ac960d08e 100644 --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -67,7 +67,6 @@ #include "com/sun/star/task/ErrorCodeIOException.hpp" #include "com/sun/star/task/ErrorCodeRequest.hpp" #include "com/sun/star/task/MasterPasswordRequest.hpp" -#include "com/sun/star/task/NoMasterException.hpp" #include "com/sun/star/task/DocumentMacroConfirmationRequest.hpp" #include "com/sun/star/task/DocumentMacroConfirmationRequest2.hpp" #include "com/sun/star/task/XInteractionAbort.hpp" @@ -76,8 +75,6 @@ #include "com/sun/star/task/XInteractionPassword.hpp" #include "com/sun/star/task/XInteractionRequest.hpp" #include "com/sun/star/task/XInteractionRetry.hpp" -#include "com/sun/star/task/XPasswordContainer.hpp" -#include "com/sun/star/task/XUrlContainer.hpp" #include "com/sun/star/task/XInteractionAskLater.hpp" #include "com/sun/star/ucb/AuthenticationRequest.hpp" #include "com/sun/star/ucb/URLAuthenticationRequest.hpp" @@ -141,6 +138,7 @@ #include "trylater.hxx" #include "lockfailed.hxx" #include "loginerr.hxx" +#include "passwordcontainer.hxx" #include #include @@ -1619,38 +1617,6 @@ rtl::OUString UUIInteractionHelper::getContextProperty() SAL_THROW(()) return rtl::OUString(); } -bool -UUIInteractionHelper::initPasswordContainer( - star::uno::Reference< star::task::XPasswordContainer > * pContainer, - star::uno::Reference< star::task::XUrlContainer > * pUrlContainer) - const SAL_THROW(()) -{ - OSL_ENSURE(pContainer, "specification violation"); - if (!pContainer->is() && m_xServiceFactory.is()) - try - { - *pContainer - = star::uno::Reference< star::task::XPasswordContainer >( - m_xServiceFactory-> - createInstance( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.task.PasswordContainer"))), - star::uno::UNO_QUERY); - - if ( pContainer->is() ) - { - *pUrlContainer = star::uno::Reference< star::task::XUrlContainer >( *pContainer, UNO_QUERY ); - OSL_ENSURE( pUrlContainer->is(), "Got no XUrlContainer!" ); - } - } - catch (star::uno::Exception const &) - {} - OSL_ENSURE(pContainer->is(), "unexpected situation"); - return pContainer->is() && pUrlContainer->is(); -} - - String GetContentPart( const String& _rRawString ) { // search over some parts to find a string @@ -2218,6 +2184,7 @@ UUIInteractionHelper::executeMessageBox( return aResult; } + star::uno::Reference< star::task::XInteractionHandler > UUIInteractionHelper::getInteractionHandler() const SAL_THROW((star::uno::RuntimeException)) @@ -2245,80 +2212,6 @@ UUIInteractionHelper::getInteractionHandler() const return xIH; } -namespace -{ -bool fillContinuation( - bool bUseSystemCredentials, - const star::ucb::AuthenticationRequest & rRequest, - const star::task::UrlRecord & aRec, - const star::uno::Reference< star::ucb::XInteractionSupplyAuthentication > & - xSupplyAuthentication, - const star::uno::Reference< star::ucb::XInteractionSupplyAuthentication2 > & - xSupplyAuthentication2, - bool bCanUseSystemCredentials, - bool bCheckForEqualPasswords ) -{ - if ( bUseSystemCredentials ) - { - // "use system creds" record found. - // Wants client that we use it? - if ( xSupplyAuthentication2.is() && - bCanUseSystemCredentials ) - { - xSupplyAuthentication2->setUseSystemCredentials( sal_True ); - return true; - } - return false; - } - else if (aRec.UserList.getLength() != 0) - { - if (aRec.UserList[0].Passwords.getLength() == 0) - { - // Password sequence can be empty, for instance if master - // password was not given (e.g. master pw dialog canceled) - // pw container does not throw NoMasterException in this case. - // bug??? - return false; - } - - // "user/pass" record found. - if (!bCheckForEqualPasswords || !rRequest.HasPassword - || rRequest.Password != aRec.UserList[0].Passwords[0]) // failed login attempt? - { - if (xSupplyAuthentication->canSetUserName()) - xSupplyAuthentication-> - setUserName(aRec.UserList[0].UserName.getStr()); - - if (xSupplyAuthentication->canSetPassword()) - xSupplyAuthentication-> - setPassword(aRec.UserList[0].Passwords[0].getStr()); - if (aRec.UserList[0].Passwords.getLength() > 1) - { - if (rRequest.HasRealm) - { - if (xSupplyAuthentication->canSetRealm()) - xSupplyAuthentication-> - setRealm(aRec.UserList[0].Passwords[1]. - getStr()); - } - else if (xSupplyAuthentication->canSetAccount()) - xSupplyAuthentication-> - setAccount(aRec.UserList[0].Passwords[1]. - getStr()); - } - - if ( xSupplyAuthentication2.is() && - bCanUseSystemCredentials ) - xSupplyAuthentication2->setUseSystemCredentials( sal_False ); - - return true; - } - } - return false; -} - -} - void UUIInteractionHelper::handleAuthenticationRequest( star::ucb::AuthenticationRequest const & rRequest, @@ -2328,8 +2221,6 @@ UUIInteractionHelper::handleAuthenticationRequest( const rtl::OUString & rURL) SAL_THROW((star::uno::RuntimeException)) { - star::uno::Reference< star::task::XInteractionHandler > xIH; - star::uno::Reference< star::task::XInteractionRetry > xRetry; star::uno::Reference< star::task::XInteractionAbort > xAbort; star::uno::Reference< star::ucb::XInteractionSupplyAuthentication > @@ -2339,7 +2230,25 @@ UUIInteractionHelper::handleAuthenticationRequest( getContinuations( rContinuations, 0, 0, &xRetry, &xAbort, - &xSupplyAuthentication, &xSupplyAuthentication2, 0, 0, 0 ); + &xSupplyAuthentication, &xSupplyAuthentication2, 0, 0, 0); + + star::uno::Reference< star::task::XInteractionHandler > xIH( + getInteractionHandler()); + + ////////////////////////// + // First, try to obatin credentials from password container service. + uui::PasswordContainerHelper aPwContainerHelper(m_xServiceFactory); + if (aPwContainerHelper.handleAuthenticationRequest(rRequest, + xSupplyAuthentication, + rURL, + xIH)) + { + xSupplyAuthentication->select(); + return; + } + + ////////////////////////// + // Second, try to obtain credentials from user via password dialog. bool bRemember; bool bRememberPersistent; if (xSupplyAuthentication.is()) @@ -2367,8 +2276,8 @@ UUIInteractionHelper::handleAuthenticationRequest( if (xSupplyAuthentication2.is()) { bCanUseSystemCredentials - = xSupplyAuthentication2->canUseSystemCredentials( - bDefaultUseSystemCredentials ); + = xSupplyAuthentication2->canUseSystemCredentials( + bDefaultUseSystemCredentials); } else { @@ -2376,96 +2285,6 @@ UUIInteractionHelper::handleAuthenticationRequest( bDefaultUseSystemCredentials = sal_False; } - com::sun::star::uno::Reference< com::sun::star::task::XPasswordContainer > - xContainer; - com::sun::star::uno::Reference< com::sun::star::task::XUrlContainer > - xUrlContainer; - - if ( bCanUseSystemCredentials && initPasswordContainer( &xContainer, &xUrlContainer ) ) - { - // Runtime / Persistent info avail for current auth request? - - rtl::OUString aResult = xUrlContainer->findUrl( - rURL.getLength() ? rURL : rRequest.ServerName ); - if ( aResult.getLength() > 0 ) - { - if ( fillContinuation( true, - rRequest, - star::task::UrlRecord(), - xSupplyAuthentication, - xSupplyAuthentication2, - bCanUseSystemCredentials, - false ) ) - { - xSupplyAuthentication->select(); - return; - } - } - } - - // xContainer works with userName passwdSequences pairs: - if (rRequest.HasUserName - && rRequest.HasPassword - && initPasswordContainer(&xContainer, &xUrlContainer)) - { - xIH = getInteractionHandler(); - try - { - if (rRequest.UserName.getLength() == 0) - { - star::task::UrlRecord aRec; - if ( rURL.getLength() ) - aRec = xContainer->find(rURL, xIH); - - if ( aRec.UserList.getLength() == 0 ) - { - // compat: try server name. - aRec = xContainer->find(rRequest.ServerName, xIH); - } - - if ( fillContinuation( false, - rRequest, - aRec, - xSupplyAuthentication, - xSupplyAuthentication2, - bCanUseSystemCredentials, - false ) ) - { - xSupplyAuthentication->select(); - return; - } - } - else - { - star::task::UrlRecord aRec; - if ( rURL.getLength() ) - aRec = xContainer->findForName( - rURL, rRequest.UserName, xIH); - - if ( aRec.UserList.getLength() == 0 ) - { - // compat: try server name. - aRec = xContainer->findForName( - rRequest.ServerName, rRequest.UserName, xIH); - } - - if ( fillContinuation( false, - rRequest, - aRec, - xSupplyAuthentication, - xSupplyAuthentication2, - bCanUseSystemCredentials, - true ) ) - { - xSupplyAuthentication->select(); - return; - } - } - } - catch (star::task::NoMasterException const &) - {} // user did not enter master password - } - LoginErrorInfo aInfo; aInfo.SetTitle(rRequest.ServerName); aInfo.SetServer(rRequest.ServerName); @@ -2478,7 +2297,7 @@ UUIInteractionHelper::handleAuthenticationRequest( aInfo.SetErrorText(rRequest.Diagnostic); aInfo.SetPersistentPassword(bRememberPersistent); aInfo.SetSavePassword(bRemember); - aInfo.SetCanUseSystemCredentials( bCanUseSystemCredentials ); + aInfo.SetCanUseSystemCredentials(bCanUseSystemCredentials); aInfo.SetIsUseSystemCredentials( bDefaultUseSystemCredentials ); aInfo.SetModifyAccount(rRequest.HasAccount && xSupplyAuthentication.is() @@ -2519,48 +2338,39 @@ UUIInteractionHelper::handleAuthenticationRequest( xSupplyAuthentication->select(); } + ////////////////////////// + // Third, store credentials in password container. + if ( aInfo.GetIsUseSystemCredentials() ) { if (aInfo.GetIsSavePassword()) { - if ( initPasswordContainer(&xContainer, &xUrlContainer) ) - xUrlContainer->addUrl( - rURL.getLength() ? rURL : rRequest.ServerName, - bRememberPersistent ); + aPwContainerHelper.addRecord( + rURL.getLength() ? rURL : rRequest.ServerName, + rtl::OUString(), // empty u/p -> sys creds + uno::Sequence< rtl::OUString >(), + xIH, + bRememberPersistent); } } - else if (aInfo.GetUserName().Len() != 0 // Empty user name can not be valid: - && initPasswordContainer(&xContainer, &xUrlContainer)) + // Empty user name can not be valid: + else if (aInfo.GetUserName().Len() != 0) { - try + if (aInfo.GetIsSavePassword()) { - if (aInfo.GetIsSavePassword()) - { - star::uno::Sequence< rtl::OUString > - aPassList(aInfo.GetAccount().Len() == 0 ? 1 : 2); - aPassList[0] = aInfo.GetPassword(); - if (aInfo.GetAccount().Len() != 0) - aPassList[1] = aInfo.GetAccount(); - - if (!xIH.is()) - xIH = getInteractionHandler(); - - if (bRememberPersistent) - xContainer->addPersistent( - rURL.getLength() ? rURL : rRequest.ServerName, - aInfo.GetUserName(), - aPassList, - xIH); - else - xContainer->add( - rURL.getLength() ? rURL : rRequest.ServerName, - aInfo.GetUserName(), - aPassList, - xIH); - } + star::uno::Sequence< rtl::OUString > + aPassList(aInfo.GetAccount().Len() == 0 ? 1 : 2); + aPassList[0] = aInfo.GetPassword(); + if (aInfo.GetAccount().Len() != 0) + aPassList[1] = aInfo.GetAccount(); + + aPwContainerHelper.addRecord( + rURL.getLength() ? rURL : rRequest.ServerName, + aInfo.GetUserName(), + aPassList, + xIH, + bRememberPersistent); } - catch (star::task::NoMasterException const &) - {} // user did not enter master password } break; diff --git a/uui/source/iahndl.hxx b/uui/source/iahndl.hxx index bea53e436c6d..5693a5cf149b 100644 --- a/uui/source/iahndl.hxx +++ b/uui/source/iahndl.hxx @@ -45,14 +45,12 @@ #include "com/sun/star/task/PasswordRequestMode.hpp" #include "com/sun/star/task/FutureDocumentVersionProductUpdateRequest.hpp" #include "com/sun/star/security/DocumentSignatureInformation.hpp" +#include "com/sun/star/security/XCertificate.hpp" +#include "com/sun/star/xml/crypto/XSecurityEnvironment.hpp" #include "tools/solar.h" #include "tools/errcode.hxx" #include "vcl/wintypes.hxx" #include "fltdlg.hxx" -#include -#ifndef _COM_SUN_STAR_XML_CRYPTO_XXSECURITYENVIRONMENT_HPP_ -#include -#endif class Window; class LoginErrorInfo; @@ -99,8 +97,6 @@ namespace com { namespace sun { namespace star { class XInteractionContinuation; class XInteractionHandler; class XInteractionRequest; - class XPasswordContainer; - class XUrlContainer; } namespace ucb { class AuthenticationRequest; @@ -181,15 +177,6 @@ private: rtl::OUString getContextProperty() SAL_THROW(()); - bool - initPasswordContainer(com::sun::star::uno::Reference< - com::sun::star::task::XPasswordContainer > * - pContainer, - com::sun::star::uno::Reference< - com::sun::star::task::XUrlContainer > * - pUrlContainer) - const SAL_THROW(()); - com::sun::star::uno::Reference< com::sun::star::task::XInteractionHandler > getInteractionHandler() const SAL_THROW((com::sun::star::uno::RuntimeException)); diff --git a/uui/source/makefile.mk b/uui/source/makefile.mk index 95b998ffd36d..5c70719cd91c 100644 --- a/uui/source/makefile.mk +++ b/uui/source/makefile.mk @@ -56,7 +56,8 @@ SLOFILES = \ $(SLO)$/alreadyopen.obj\ $(SLO)$/lockfailed.obj\ $(SLO)$/trylater.obj\ - $(SLO)$/newerverwarn.obj + $(SLO)$/newerverwarn.obj\ + $(SLO)$/passwordcontainer.obj SRS1NAME=$(TARGET) SRC1FILES = \ diff --git a/uui/source/passwordcontainer.cxx b/uui/source/passwordcontainer.cxx new file mode 100644 index 000000000000..4802f92af88b --- /dev/null +++ b/uui/source/passwordcontainer.cxx @@ -0,0 +1,473 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: $ + * $Revision: $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "cppuhelper/factory.hxx" + +#include "com/sun/star/lang/XMultiServiceFactory.hpp" +#include "com/sun/star/task/NoMasterException.hpp" +#include "com/sun/star/task/XInteractionHandler.hpp" +#include "com/sun/star/task/XPasswordContainer.hpp" +#include "com/sun/star/task/XUrlContainer.hpp" +#include "com/sun/star/ucb/AuthenticationRequest.hpp" +#include "com/sun/star/ucb/URLAuthenticationRequest.hpp" +#include "com/sun/star/ucb/XInteractionSupplyAuthentication.hpp" +#include "com/sun/star/ucb/XInteractionSupplyAuthentication2.hpp" + +#include "passwordcontainer.hxx" + +using namespace com::sun::star; + +namespace { + +//========================================================================= +bool fillContinuation( + bool bUseSystemCredentials, + const ucb::AuthenticationRequest & rRequest, + const task::UrlRecord & aRec, + const uno::Reference< ucb::XInteractionSupplyAuthentication > & + xSupplyAuthentication, + const uno::Reference< ucb::XInteractionSupplyAuthentication2 > & + xSupplyAuthentication2, + bool bCanUseSystemCredentials, + bool bCheckForEqualPasswords ) +{ + if ( bUseSystemCredentials ) + { + // "use system creds" record found. + // Wants client that we use it? + if ( xSupplyAuthentication2.is() && bCanUseSystemCredentials ) + { + xSupplyAuthentication2->setUseSystemCredentials( sal_True ); + return true; + } + return false; + } + else if (aRec.UserList.getLength() != 0) + { + if (aRec.UserList[0].Passwords.getLength() == 0) + { + // Password sequence can be empty, for instance if master + // password was not given (e.g. master pw dialog canceled) + // pw container does not throw NoMasterException in this case. + // bug??? + return false; + } + + // "user/pass" record found. + if (!bCheckForEqualPasswords || !rRequest.HasPassword + || rRequest.Password != aRec.UserList[0].Passwords[0]) // failed login attempt? + { + if (xSupplyAuthentication->canSetUserName()) + xSupplyAuthentication-> + setUserName(aRec.UserList[0].UserName.getStr()); + + if (xSupplyAuthentication->canSetPassword()) + xSupplyAuthentication-> + setPassword(aRec.UserList[0].Passwords[0].getStr()); + if (aRec.UserList[0].Passwords.getLength() > 1) + { + if (rRequest.HasRealm) + { + if (xSupplyAuthentication->canSetRealm()) + xSupplyAuthentication-> + setRealm(aRec.UserList[0].Passwords[1]. + getStr()); + } + else if (xSupplyAuthentication->canSetAccount()) + xSupplyAuthentication-> + setAccount(aRec.UserList[0].Passwords[1]. + getStr()); + } + + if ( xSupplyAuthentication2.is() && bCanUseSystemCredentials ) + xSupplyAuthentication2->setUseSystemCredentials( sal_False ); + + return true; + } + } + return false; +} + +} // namespace + +namespace uui { + +//========================================================================= +PasswordContainerHelper::PasswordContainerHelper( + uno::Reference< lang::XMultiServiceFactory > const & xServiceFactory ) +{ + OSL_ENSURE(xServiceFactory.is(), "no service factory given!"); + if (xServiceFactory.is()) + try + { + m_xPasswordContainer + = uno::Reference< task::XPasswordContainer >( + xServiceFactory-> + createInstance( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.task.PasswordContainer"))), + uno::UNO_QUERY); + } + catch (uno::Exception const &) + {} + OSL_ENSURE(m_xPasswordContainer.is(), + "unable to instanciate password container service"); +} + +//========================================================================= +bool PasswordContainerHelper::handleAuthenticationRequest( + ucb::AuthenticationRequest const & rRequest, + uno::Reference< ucb::XInteractionSupplyAuthentication > const & + xSupplyAuthentication, + rtl::OUString const & rURL, + uno::Reference< task::XInteractionHandler > const & xIH ) + SAL_THROW((uno::RuntimeException)) +{ + // Is continuation even a XInteractionSupplyAuthentication2, which + // is derived from XInteractionSupplyAuthentication? + uno::Reference< ucb::XInteractionSupplyAuthentication2 > + xSupplyAuthentication2(xSupplyAuthentication, uno::UNO_QUERY); + + sal_Bool bCanUseSystemCredentials = sal_False; + if (xSupplyAuthentication2.is()) + { + sal_Bool bDefaultUseSystemCredentials; + bCanUseSystemCredentials + = xSupplyAuthentication2->canUseSystemCredentials( + bDefaultUseSystemCredentials ); + } + + uno::Reference< task::XPasswordContainer > xContainer( + m_xPasswordContainer ); + uno::Reference< task::XUrlContainer > xUrlContainer( + m_xPasswordContainer, uno::UNO_QUERY ); + OSL_ENSURE( xUrlContainer.is(), "Got no XUrlContainer!" ); + + if ( !xContainer.is() || !xUrlContainer.is() ) + return false; + + if ( bCanUseSystemCredentials ) + { + // Runtime / Persistent info avail for current auth request? + + rtl::OUString aResult = xUrlContainer->findUrl( + rURL.getLength() ? rURL : rRequest.ServerName ); + if ( aResult.getLength() > 0 ) + { + if ( fillContinuation( true, + rRequest, + task::UrlRecord(), + xSupplyAuthentication, + xSupplyAuthentication2, + bCanUseSystemCredentials, + false ) ) + { + return true; + } + } + } + + // xContainer works with userName passwdSequences pairs: + if (rRequest.HasUserName && rRequest.HasPassword) + { + try + { + if (rRequest.UserName.getLength() == 0) + { + task::UrlRecord aRec; + if ( rURL.getLength() ) + aRec = xContainer->find(rURL, xIH); + + if ( aRec.UserList.getLength() == 0 ) + { + // compat: try server name. + aRec = xContainer->find(rRequest.ServerName, xIH); + } + + if ( fillContinuation( false, + rRequest, + aRec, + xSupplyAuthentication, + xSupplyAuthentication2, + bCanUseSystemCredentials, + false ) ) + { + return true; + } + } + else + { + task::UrlRecord aRec; + if ( rURL.getLength() ) + aRec = xContainer->findForName( + rURL, rRequest.UserName, xIH); + + if ( aRec.UserList.getLength() == 0 ) + { + // compat: try server name. + aRec = xContainer->findForName( + rRequest.ServerName, rRequest.UserName, xIH); + } + + if ( fillContinuation( false, + rRequest, + aRec, + xSupplyAuthentication, + xSupplyAuthentication2, + bCanUseSystemCredentials, + true ) ) + { + return true; + } + } + } + catch (task::NoMasterException const &) + {} // user did not enter master password + } + return false; +} + +//========================================================================= +bool PasswordContainerHelper::addRecord( + rtl::OUString const & rURL, + rtl::OUString const & rUsername, + uno::Sequence< rtl::OUString > const & rPasswords, + uno::Reference< task::XInteractionHandler > const & xIH, + bool bPersist ) + SAL_THROW((uno::RuntimeException)) +{ + try + { + if ( rUsername.getLength() ) + { + OSL_ENSURE( m_xPasswordContainer.is(), + "Got no XPasswordContainer!" ); + if ( !m_xPasswordContainer.is() ) + return false; + + if ( bPersist ) + m_xPasswordContainer->addPersistent( rURL, + rUsername, + rPasswords, + xIH ); + else + m_xPasswordContainer->add( rURL, + rUsername, + rPasswords, + xIH ); + } + else + { + uno::Reference< task::XUrlContainer > + xContainer( m_xPasswordContainer, uno::UNO_QUERY ); + OSL_ENSURE( xContainer.is(), "Got no XUrlContainer!" ); + if ( !xContainer.is() ) + return false; + + xContainer->addUrl( rURL, bPersist ); + } + } + catch ( task::NoMasterException const & ) + { + // user did not enter master password + return false; + } + return true; +} + +//========================================================================= +//========================================================================= +//========================================================================= + +PasswordContainerInteractionHandler::PasswordContainerInteractionHandler( + const uno::Reference< lang::XMultiServiceFactory >& xSMgr ) +: m_aPwContainerHelper( xSMgr ) +{ +} + +//========================================================================= +// virtual +PasswordContainerInteractionHandler::~PasswordContainerInteractionHandler() +{ +} + +//========================================================================= +// +// XServiceInfo methods. +// +//========================================================================= + +// virtual +::rtl::OUString SAL_CALL +PasswordContainerInteractionHandler::getImplementationName() + throw ( uno::RuntimeException ) +{ + return getImplementationName_Static(); +} + +//========================================================================= +// virtual +sal_Bool SAL_CALL +PasswordContainerInteractionHandler::supportsService( + const ::rtl::OUString& ServiceName ) + throw ( uno::RuntimeException ) +{ + uno::Sequence< rtl::OUString > aSNL = getSupportedServiceNames(); + const rtl::OUString * pArray = aSNL.getConstArray(); + for ( sal_Int32 i = 0; i < aSNL.getLength(); i++ ) + { + if ( pArray[ i ] == ServiceName ) + return sal_True; + } + return sal_False; +} + +//========================================================================= +// virtual +uno::Sequence< ::rtl::OUString > SAL_CALL +PasswordContainerInteractionHandler::getSupportedServiceNames() + throw ( uno::RuntimeException ) +{ + return getSupportedServiceNames_Static(); +} + +//========================================================================= +// static +rtl::OUString +PasswordContainerInteractionHandler::getImplementationName_Static() +{ + return rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.comp.uui.PasswordContainerInteractionHandler" ) ); +} + +//========================================================================= +// static +uno::Sequence< rtl::OUString > +PasswordContainerInteractionHandler::getSupportedServiceNames_Static() +{ + uno::Sequence< rtl::OUString > aSNS( 1 ); + aSNS.getArray()[ 0 ] + = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.task.PasswordContainerInteractionHandler" ) ); + return aSNS; +} + +//========================================================================= +// +// XInteractionHandler methods. +// +//========================================================================= + +// virtual +void SAL_CALL +PasswordContainerInteractionHandler::handle( + const uno::Reference< task::XInteractionRequest >& rRequest ) + throw ( uno::RuntimeException ) +{ + if ( !rRequest.is() ) + return; + + uno::Any aAnyRequest( rRequest->getRequest() ); + + ucb::AuthenticationRequest aAuthenticationRequest; + if ( !( aAnyRequest >>= aAuthenticationRequest ) ) + return; + + rtl::OUString aURL; + ucb::URLAuthenticationRequest aURLAuthenticationRequest; + if ( aAnyRequest >>= aURLAuthenticationRequest ) + aURL = aURLAuthenticationRequest.URL; + + uno::Sequence< uno::Reference< task::XInteractionContinuation > > + rContinuations = rRequest->getContinuations(); + + uno::Reference< ucb::XInteractionSupplyAuthentication > + xSupplyAuthentication; + + for ( sal_Int32 i = 0; i < rContinuations.getLength(); ++i ) + { + xSupplyAuthentication + = uno::Reference< ucb::XInteractionSupplyAuthentication >( + rContinuations[i], uno::UNO_QUERY ); + if( xSupplyAuthentication.is() ) + break; + } + + if ( !xSupplyAuthentication.is() ) + return; + + // Try to obatin credentials from password container. + if ( m_aPwContainerHelper. + handleAuthenticationRequest( aAuthenticationRequest, + xSupplyAuthentication, + aURL, + // @@@ FIXME: this not able to + // handle master pw request! + // master pw request is never + // solvabe without UI! + this ) ) + { + // successfully handled + xSupplyAuthentication->select(); + } +} + +//========================================================================= +// +// Service factory implementation. +// +//========================================================================= + +static uno::Reference< uno::XInterface > SAL_CALL +PasswordContainerInteractionHandler_CreateInstance( + const uno::Reference< lang::XMultiServiceFactory> & rSMgr ) + throw( uno::Exception ) +{ + lang::XServiceInfo * pX = static_cast< lang::XServiceInfo * >( + new PasswordContainerInteractionHandler( rSMgr ) ); + return uno::Reference< uno::XInterface >::query( pX ); +} + +//========================================================================= +// static +uno::Reference< lang::XSingleServiceFactory > +PasswordContainerInteractionHandler::createServiceFactory( + const uno::Reference< lang::XMultiServiceFactory >& rxServiceMgr ) +{ + return uno::Reference< lang::XSingleServiceFactory >( + cppu::createOneInstanceFactory( + rxServiceMgr, + PasswordContainerInteractionHandler::getImplementationName_Static(), + PasswordContainerInteractionHandler_CreateInstance, + PasswordContainerInteractionHandler::getSupportedServiceNames_Static() ) ); +} + +} // namespace uui diff --git a/uui/source/passwordcontainer.hxx b/uui/source/passwordcontainer.hxx new file mode 100644 index 000000000000..c08ef7016635 --- /dev/null +++ b/uui/source/passwordcontainer.hxx @@ -0,0 +1,200 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: $ + * $Revision: $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef INCLUDED_UUI_PASSWORDCONTAINER_HXX +#define INCLUDED_UUI_PASSWORDCONTAINER_HXX + +#include "cppuhelper/implbase2.hxx" + +#include "com/sun/star/lang/XServiceInfo.hpp" +#include "com/sun/star/lang/XSingleServiceFactory.hpp" +#include "com/sun/star/task/XInteractionHandler.hpp" +#include "com/sun/star/task/XPasswordContainer.hpp" + +namespace com { + namespace sun { + namespace star { + namespace lang { + class XMultiServiceFactory; + } + namespace ucb { + class AuthenticationRequest; + class XInteractionSupplyAuthentication; +} } } } + +namespace uui { + +// ============================================================================ + +/** Passwordcontainer UNO service (com.sun.star.task.PasswordContainer) helper. + */ +class PasswordContainerHelper +{ +public: + PasswordContainerHelper( + com::sun::star::uno::Reference< + com::sun::star::lang::XMultiServiceFactory > const & + xServiceFactory ); + + // ------------------------------------------------------------------------ + + /** This member function tries to handle an authentication interaction + request by looking up credentials for the given URL in the password + container service. + + In case of success the given interaction continuation + (XInteractionSupplyAuthentication) is filled with the credentials found + in the password container. + + Please note the the continuation gets not "selected" by this + implementation. "Selecting" the continuation is up to the caller (e.g. + an implementation of XInteractionHandler::handle) of this function. + + @param rRequest + The authentication request. + + @param xSupplyAuthentication + The "supply authentication" interaction continuation. + + @param rURL + The URL to lookup credentials for. + + @param xIH + The interaction handler to use, for example if a master password is + needed to access the password container. + + @return + True, if the authentication request was handled successfully. + False, otherwise. + */ + bool handleAuthenticationRequest( + com::sun::star::ucb::AuthenticationRequest const & rRequest, + com::sun::star::uno::Reference< + com::sun::star::ucb::XInteractionSupplyAuthentication > const & + xSupplyAuthentication, + rtl::OUString const & rURL, + com::sun::star::uno::Reference< + com::sun::star::task::XInteractionHandler > const & xIH ) + SAL_THROW( (com::sun::star::uno::RuntimeException) ); + + /** This member function adds credentials for the given URL to the password + container. + + @param rURL + The URL the credentials are valid for. rURL must not be empty. + + @param rUsername + The user name. + + @param rPasswords + This list of passwords. + + @param xIH + The interaction handler to use, for example if a master password is + needed to access the password container. + + @param bPersist + True, the record will get stored persistently; restored upon + password container initialization + False, the record will be stored until password container instance + gets destroyed. + + @return + True, if the record was added successfully. + False, otherwise. + + */ + bool addRecord( rtl::OUString const & rURL, + rtl::OUString const & rUsername, + com::sun::star::uno::Sequence< rtl::OUString > const & + rPasswords, + com::sun::star::uno::Reference< + com::sun::star::task::XInteractionHandler > const & xIH, + bool bPersist ) + SAL_THROW( (com::sun::star::uno::RuntimeException) ); + + // ------------------------------------------------------------------------ + +private: + com::sun::star::uno::Reference< + com::sun::star::task::XPasswordContainer > m_xPasswordContainer; +}; + +// ============================================================================ + +class PasswordContainerInteractionHandler : + public cppu::WeakImplHelper2< com::sun::star::lang::XServiceInfo, + com::sun::star::task::XInteractionHandler > +{ +public: + PasswordContainerInteractionHandler( + const com::sun::star::uno::Reference< + com::sun::star::lang::XMultiServiceFactory >& rXSMgr ); + virtual ~PasswordContainerInteractionHandler(); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw ( com::sun::star::uno::RuntimeException ); + + virtual sal_Bool SAL_CALL + supportsService( const ::rtl::OUString& ServiceName ) + throw ( com::sun::star::uno::RuntimeException ); + + virtual com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames() + throw ( com::sun::star::uno::RuntimeException ); + + // XInteractionHandler + virtual void SAL_CALL + handle( const ::com::sun::star::uno::Reference< + ::com::sun::star::task::XInteractionRequest >& Request ) + throw (::com::sun::star::uno::RuntimeException); + + // Non-UNO interfaces + static rtl::OUString + getImplementationName_Static(); + + static com::sun::star::uno::Sequence< rtl::OUString > + getSupportedServiceNames_Static(); + + static com::sun::star::uno::Reference< + com::sun::star::lang::XSingleServiceFactory > + createServiceFactory( const com::sun::star::uno::Reference< + com::sun::star::lang::XMultiServiceFactory > & rxServiceMgr ); + +private: + //com::sun::star::uno::Reference< + // com::sun::star::lang::XMultiServiceFactory > m_xSMgr; + PasswordContainerHelper m_aPwContainerHelper; +}; + +} // namespace uui + +#endif diff --git a/uui/source/services.cxx b/uui/source/services.cxx index 824c3f895b7d..92669fe0d9d1 100644 --- a/uui/source/services.cxx +++ b/uui/source/services.cxx @@ -37,6 +37,7 @@ #include "interactionhandler.hxx" #include "requeststringresolver.hxx" +#include "passwordcontainer.hxx" using namespace rtl; using namespace com::sun::star::uno; @@ -46,18 +47,18 @@ using namespace com::sun::star::registry; namespace { sal_Bool writeInfo( void * pRegistryKey, - const char * pImplementationName, + const OUString & rImplementationName, Sequence< OUString > const & rServiceNames ) { OUString aKeyName( OUString::createFromAscii( "/" ) ); - aKeyName += OUString::createFromAscii( pImplementationName ); + aKeyName += rImplementationName; aKeyName += OUString::createFromAscii( "/UNO/SERVICES" ); Reference< XRegistryKey > xKey; try { - xKey = static_cast< XRegistryKey * >( - pRegistryKey )->createKey( aKeyName ); + xKey = static_cast< XRegistryKey * >( + pRegistryKey )->createKey( aKeyName ); } catch ( InvalidRegistryException const & ) { @@ -65,21 +66,21 @@ sal_Bool writeInfo( void * pRegistryKey, if ( !xKey.is() ) { - return sal_False; + return sal_False; } sal_Bool bSuccess = sal_True; for ( sal_Int32 n = 0; n < rServiceNames.getLength(); ++n ) { - try - { - xKey->createKey( rServiceNames[ n ] ); - } - catch ( InvalidRegistryException const & ) - { - bSuccess = sal_False; - break; - } + try + { + xKey->createKey( rServiceNames[ n ] ); + } + catch ( InvalidRegistryException const & ) + { + bSuccess = sal_False; + break; + } } return bSuccess; } @@ -114,16 +115,26 @@ extern "C" sal_Bool SAL_CALL component_writeInfo(void *, void * pRegistryKey) ////////////////////////////////////////////////////////////////////// writeInfo( pRegistryKey, - UUIInteractionHandler::m_aImplementationName, - UUIInteractionHandler::getSupportedServiceNames_static() ) && + OUString::createFromAscii( + UUIInteractionHandler::m_aImplementationName ), + UUIInteractionHandler::getSupportedServiceNames_static() ) && ////////////////////////////////////////////////////////////////////// // UUI Interaction Request String Resolver. ////////////////////////////////////////////////////////////////////// writeInfo( pRegistryKey, - UUIInteractionRequestStringResolver::m_aImplementationName, - UUIInteractionRequestStringResolver::getSupportedServiceNames_static() ); + OUString::createFromAscii( + UUIInteractionRequestStringResolver::m_aImplementationName ), + UUIInteractionRequestStringResolver::getSupportedServiceNames_static() ) && + + ////////////////////////////////////////////////////////////////////// + // UUI Password Container Interaction Handler. + ////////////////////////////////////////////////////////////////////// + + writeInfo( pRegistryKey, + uui::PasswordContainerInteractionHandler::getImplementationName_Static(), + uui::PasswordContainerInteractionHandler::getSupportedServiceNames_Static() ); } //============================================================================ @@ -142,7 +153,7 @@ extern "C" void * SAL_CALL component_getFactory(sal_Char const * pImplName, void * pRet = 0; Reference< XMultiServiceFactory > xSMgr( - reinterpret_cast< XMultiServiceFactory * >( pServiceManager ) ); + reinterpret_cast< XMultiServiceFactory * >( pServiceManager ) ); Reference< XSingleServiceFactory > xFactory; ////////////////////////////////////////////////////////////////////// @@ -153,10 +164,9 @@ extern "C" void * SAL_CALL component_getFactory(sal_Char const * pImplName, UUIInteractionHandler::m_aImplementationName) == 0) { - xFactory = + xFactory = cppu::createSingleFactory( - static_cast< XMultiServiceFactory * >( - pServiceManager), + static_cast< XMultiServiceFactory * >(pServiceManager), OUString::createFromAscii( UUIInteractionHandler::m_aImplementationName), &UUIInteractionHandler::createInstance, @@ -171,22 +181,32 @@ extern "C" void * SAL_CALL component_getFactory(sal_Char const * pImplName, UUIInteractionRequestStringResolver::m_aImplementationName) == 0) { - xFactory = + xFactory = cppu::createSingleFactory( - static_cast< XMultiServiceFactory * >( - pServiceManager), + static_cast< XMultiServiceFactory * >(pServiceManager), OUString::createFromAscii( UUIInteractionRequestStringResolver::m_aImplementationName), &UUIInteractionRequestStringResolver::createInstance, UUIInteractionRequestStringResolver::getSupportedServiceNames_static()); } + ////////////////////////////////////////////////////////////////////// + // UUI Password Container Interaction Handler. + ////////////////////////////////////////////////////////////////////// + + else if ( uui::PasswordContainerInteractionHandler::getImplementationName_Static(). + compareToAscii( pImplName ) == 0 ) + { + xFactory = + uui::PasswordContainerInteractionHandler::createServiceFactory( xSMgr ); + } + ////////////////////////////////////////////////////////////////////// if ( xFactory.is() ) { - xFactory->acquire(); - pRet = xFactory.get(); + xFactory->acquire(); + pRet = xFactory.get(); } return pRet; -- cgit v1.2.3 From b9333431e5c7c43912e46487c4c2d8184bdadaf4 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Thu, 26 Nov 2009 11:58:45 +0100 Subject: #i107081# - impl/use new PasswordContainerInteractionHandler UNO service. --- .../task/PasswordContainerInteractionHandler.idl | 60 ++++++++++++++++++++++ offapi/com/sun/star/task/makefile.mk | 3 +- 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 offapi/com/sun/star/task/PasswordContainerInteractionHandler.idl diff --git a/offapi/com/sun/star/task/PasswordContainerInteractionHandler.idl b/offapi/com/sun/star/task/PasswordContainerInteractionHandler.idl new file mode 100644 index 000000000000..ded6c6c23f77 --- /dev/null +++ b/offapi/com/sun/star/task/PasswordContainerInteractionHandler.idl @@ -0,0 +1,60 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: $ + * $Revision: $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef __com_sun_star_task_PasswordContainerInteractionHandler_idl__ +#define __com_sun_star_task_PasswordContainerInteractionHandler_idl__ + +module com { module sun { module star { + module task { published interface XInteractionHandler; }; +}; }; }; + +module com { module sun { module star { module task { + +//============================================================================ +/** An interaction request handler that uses the + PasswordContainer service to + handle AuthenticationRequests. + + If the password container contains credentials matching the authentication + request, the service implementation selects the + XInteractionSupplyAuthentication + continuation, that should be supplied with the interaction request. + + If the password container does not contain credentials matching the + authentication request, the service implementation selects no continuation. + + @since OOo 3.3 + */ +published service PasswordContainerInteractionHandler + : com::sun::star::task::XInteractionHandler; + +}; }; }; }; + +#endif diff --git a/offapi/com/sun/star/task/makefile.mk b/offapi/com/sun/star/task/makefile.mk index dc54f6fd3883..d77b1d6022e7 100644 --- a/offapi/com/sun/star/task/makefile.mk +++ b/offapi/com/sun/star/task/makefile.mk @@ -1,7 +1,7 @@ #************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# +# # Copyright 2008 by Sun Microsystems, Inc. # Copyright IBM Corporation 2009. # @@ -59,6 +59,7 @@ IDLFILES=\ MasterPasswordRequest.idl\ NoMasterException.idl\ PasswordContainer.idl\ + PasswordContainerInteractionHandler.idl\ PasswordRequest.idl\ PasswordRequestMode.idl\ UnsupportedOverwriteRequest.idl\ -- cgit v1.2.3 From 8a3694e8aa6b04a4347b32daac1b22d5200ab1f4 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Thu, 26 Nov 2009 12:56:23 +0100 Subject: dba33d: #i69262# allow functions to be grouped --- dbaccess/source/ui/inc/QueryDesignView.hxx | 4 + dbaccess/source/ui/inc/TableFieldDescription.hxx | 1 + dbaccess/source/ui/querydesign/QueryDesignView.cxx | 75 +++++++--------- .../source/ui/querydesign/SelectionBrowseBox.cxx | 100 ++++++++------------- .../ui/querydesign/TableFieldDescription.cxx | 44 +++++---- 5 files changed, 104 insertions(+), 120 deletions(-) diff --git a/dbaccess/source/ui/inc/QueryDesignView.hxx b/dbaccess/source/ui/inc/QueryDesignView.hxx index 60dfb7bdec79..6a97719e0c27 100644 --- a/dbaccess/source/ui/inc/QueryDesignView.hxx +++ b/dbaccess/source/ui/inc/QueryDesignView.hxx @@ -171,6 +171,10 @@ namespace dbaui const String& _sCriteria, ::rtl::OUString& _rsErrorMessage, ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& _rxColumn) const; + + void fillFunctionInfo( const ::connectivity::OSQLParseNode* pNode + ,const ::rtl::OUString& sFunctionTerm + ,OTableFieldDescRef& aInfo); protected: // return the Rectangle where I can paint myself virtual void resizeDocumentView(Rectangle& rRect); diff --git a/dbaccess/source/ui/inc/TableFieldDescription.hxx b/dbaccess/source/ui/inc/TableFieldDescription.hxx index 80eeeff20dfa..9230bef621c3 100644 --- a/dbaccess/source/ui/inc/TableFieldDescription.hxx +++ b/dbaccess/source/ui/inc/TableFieldDescription.hxx @@ -83,6 +83,7 @@ namespace dbaui inline sal_Bool IsEmpty() const; + OTableFieldDesc& operator=( const OTableFieldDesc& _aField ); sal_Bool operator==( const OTableFieldDesc& rDesc ); sal_Bool IsVisible() const { return m_bVisible;} diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx index f7f08cd63df5..966c3e313673 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx +++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx @@ -186,11 +186,6 @@ namespace sal_Bool bHaving, bool _bAddOrOnOneLine); - void fillFunctionInfo( OQueryDesignView* _pView - ,const ::connectivity::OSQLParseNode* pNode - ,const ::rtl::OUString& sFunctionTerm - ,OTableFieldDescRef& aInfo); - //------------------------------------------------------------------------------ ::rtl::OUString quoteTableAlias(sal_Bool _bQuote, const ::rtl::OUString& _sAliasName, const ::rtl::OUString& _sQuote) { @@ -2262,35 +2257,6 @@ namespace return eErrorCode; } //------------------------------------------------------------------------------ - void fillFunctionInfo( OQueryDesignView* _pView - ,const ::connectivity::OSQLParseNode* pNode - ,const ::rtl::OUString& sFunctionTerm - ,OTableFieldDescRef& aInfo) - { - // get the type out of the funtion name - OQueryController& rController = static_cast(_pView->getController()); - sal_Int32 nDataType = DataType::DOUBLE; - ::rtl::OUString sFieldName = sFunctionTerm; - OSQLParseNode* pFunctionName = pNode->getChild(0); - if ( !SQL_ISPUNCTUATION(pFunctionName,"{") ) - { - if ( SQL_ISRULEOR2(pNode,length_exp,char_value_fct) ) - pFunctionName = pFunctionName->getChild(0); - - ::rtl::OUString sFunctionName = pFunctionName->getTokenValue(); - if ( !sFunctionName.getLength() ) - sFunctionName = ::rtl::OStringToOUString(OSQLParser::TokenIDToStr(pFunctionName->getTokenID()),RTL_TEXTENCODING_UTF8); - - nDataType = OSQLParser::getFunctionReturnType( - sFunctionName - ,&rController.getParser().getContext()); - } - aInfo->SetDataType(nDataType); - aInfo->SetFieldType(TAB_NORMAL_FIELD); - aInfo->SetField(sFieldName); - aInfo->SetTabWindow(NULL); - } - //------------------------------------------------------------------------------ SqlParseError InstallFields(OQueryDesignView* _pView, const ::connectivity::OSQLParseNode* pNode, OJoinTableView::OTableWindowMap* pTabList ) @@ -2298,7 +2264,7 @@ namespace if( pNode==0 || !SQL_ISRULE(pNode,select_statement)) return eNoSelectStatement; - ::connectivity::OSQLParseNode* pParseTree = pNode->getChild(2); + ::connectivity::OSQLParseNode* pParseTree = pNode->getChild(2); // selection sal_Bool bFirstField = sal_True; // bei der Initialisierung muß auf alle Faelle das erste Feld neu aktiviert werden SqlParseError eErrorCode = eOk; @@ -2329,9 +2295,6 @@ namespace if ( SQL_ISRULE(pColumnRef,derived_column) ) { - if ( !xConnection.is() ) - break; - ::rtl::OUString aColumnAlias(rController.getParseIterator().getColumnAlias(pColumnRef)); // kann leer sein pColumnRef = pColumnRef->getChild(0); OTableFieldDescRef aInfo = new OTableFieldDesc(); @@ -2412,7 +2375,7 @@ namespace } else { - fillFunctionInfo(_pView,pColumnRef,aColumns,aInfo); + _pView->fillFunctionInfo(pColumnRef,aColumns,aInfo); aInfo->SetFieldAlias(aColumnAlias); } @@ -2533,7 +2496,7 @@ namespace _pView->getLocale(), static_cast(_pView->getDecimalSeparator().toChar()), &rController.getParser().getContext()); - fillFunctionInfo(_pView,pArgument,sCondition,aDragLeft); + _pView->fillFunctionInfo(pArgument,sCondition,aDragLeft); aDragLeft->SetFunctionType(FKT_OTHER); aDragLeft->SetOrderDir(eOrderDir); aDragLeft->SetVisible(sal_False); @@ -2565,7 +2528,7 @@ namespace const ::connectivity::OSQLParseNode* pSelectRoot ) { SqlParseError eErrorCode = eOk; - if (!pSelectRoot->getChild(3)->getChild(2)->isLeaf()) + if (!pSelectRoot->getChild(3)->getChild(2)->isLeaf()) // opt_group_by_clause { OQueryController& rController = static_cast(_pView->getController()); ::connectivity::OSQLParseNode* pGroupBy = pSelectRoot->getChild(3)->getChild(2)->getChild(2); @@ -2600,7 +2563,7 @@ namespace &rController.getParser().getContext(), sal_True, sal_True); // quote is to true because we need quoted elements inside the function - fillFunctionInfo(_pView,pArgument,sGroupByExpression,aDragInfo); + _pView->fillFunctionInfo(pArgument,sGroupByExpression,aDragInfo); aDragInfo->SetFunctionType(FKT_OTHER); aDragInfo->SetGroupBy(sal_True); aDragInfo->SetVisible(sal_False); @@ -3324,4 +3287,32 @@ bool OQueryDesignView::initByParseIterator( ::dbtools::SQLExceptionInfo* _pError } return eErrorCode == eOk; } +//------------------------------------------------------------------------------ +void OQueryDesignView::fillFunctionInfo( const ::connectivity::OSQLParseNode* pNode + ,const ::rtl::OUString& sFunctionTerm + ,OTableFieldDescRef& aInfo) +{ + // get the type out of the funtion name + OQueryController& rController = static_cast(getController()); + sal_Int32 nDataType = DataType::DOUBLE; + ::rtl::OUString sFieldName = sFunctionTerm; + OSQLParseNode* pFunctionName = pNode->getChild(0); + if ( !SQL_ISPUNCTUATION(pFunctionName,"{") ) + { + if ( SQL_ISRULEOR2(pNode,length_exp,char_value_fct) ) + pFunctionName = pFunctionName->getChild(0); + + ::rtl::OUString sFunctionName = pFunctionName->getTokenValue(); + if ( !sFunctionName.getLength() ) + sFunctionName = ::rtl::OStringToOUString(OSQLParser::TokenIDToStr(pFunctionName->getTokenID()),RTL_TEXTENCODING_UTF8); + + nDataType = OSQLParser::getFunctionReturnType( + sFunctionName + ,&rController.getParser().getContext()); + } + aInfo->SetDataType(nDataType); + aInfo->SetFieldType(TAB_NORMAL_FIELD); + aInfo->SetField(sFieldName); + aInfo->SetTabWindow(NULL); +} // ----------------------------------------------------------------------------- diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx index 769e402d8ba7..1b468b2a69c9 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -890,78 +890,56 @@ sal_Bool OSelectionBrowseBox::saveField(const String& _sFieldName,OTableFieldDes OSL_ENSURE(0,"Unsupported function inserted!"); } - else if( SQL_ISRULEOR2(pColumnRef,position_exp,extract_exp) || - SQL_ISRULEOR2(pColumnRef,fold,char_substring_fct) || - SQL_ISRULEOR2(pColumnRef,length_exp,char_value_fct) ) - // a calculation has been found ( can be calc and function ) + else { - // append the whole text as field name // so we first clear the function field clearEntryFunctionField(_sFieldName,aSelEntry,_bListAction,nColumnId); - sal_Bool bQuote = sal_True; - sal_Int32 nDataType = DataType::DOUBLE; - OSQLParseNode* pFunctionName = pColumnRef->getChild(0); - if ( !SQL_ISPUNCTUATION(pFunctionName,"{") ) + ::rtl::OUString sFunction; + pColumnRef->parseNodeToStr( sFunction, + xConnection, + &rController.getParser().getContext(), + sal_True, + sal_True); // quote is to true because we need quoted elements inside the function + + getDesignView()->fillFunctionInfo(pColumnRef,sFunction,aSelEntry); + + if( SQL_ISRULEOR2(pColumnRef,position_exp,extract_exp) || + SQL_ISRULEOR2(pColumnRef,fold,char_substring_fct) || + SQL_ISRULEOR2(pColumnRef,length_exp,char_value_fct) ) + // a calculation has been found ( can be calc and function ) { - if ( SQL_ISRULEOR2(pColumnRef,length_exp,char_value_fct) ) - pFunctionName = pFunctionName->getChild(0); + // now parse the whole statement + sal_uInt32 nFunCount = pColumnRef->count(); + ::rtl::OUString sParameters; + for(sal_uInt32 function = 0; function < nFunCount; ++function) + pColumnRef->getChild(function)->parseNodeToStr( sParameters, xConnection, &rParser.getContext(), sal_True, sal_True ); - if ( pFunctionName ) + sOldAlias = aSelEntry->GetAlias(); + sal_Int32 nNewFunctionType = aSelEntry->GetFunctionType() | FKT_NUMERIC | FKT_OTHER; + aSelEntry->SetFunctionType(nNewFunctionType); + aSelEntry->SetField(sParameters); + } + else + { + aSelEntry->SetFieldAlias(sColumnAlias); + if ( SQL_ISRULE(pColumnRef,set_fct_spec) ) + aSelEntry->SetFunctionType(/*FKT_NUMERIC | */FKT_OTHER); + else { - ::rtl::OUString sFunctionName = pFunctionName->getTokenValue(); - if ( !sFunctionName.getLength() ) - sFunctionName = ::rtl::OStringToOUString(OSQLParser::TokenIDToStr(pFunctionName->getTokenID()),RTL_TEXTENCODING_MS_1252); - - nDataType = OSQLParser::getFunctionReturnType( - sFunctionName - ,&rController.getParser().getContext()); - aSelEntry->SetDataType(nDataType); + if ( SQL_ISRULEOR2(pColumnRef,num_value_exp,term) || SQL_ISRULE(pColumnRef,factor) ) + aSelEntry->SetDataType(DataType::DOUBLE); + else if ( SQL_ISRULE(pColumnRef,value_exp) ) + aSelEntry->SetDataType(DataType::TIMESTAMP); + else + aSelEntry->SetDataType(DataType::VARCHAR); + aSelEntry->SetFunctionType(FKT_NUMERIC | FKT_OTHER); } } - - // now parse the whole statement - sal_uInt32 nFunCount = pColumnRef->count(); - ::rtl::OUString sParameters; - for(sal_uInt32 function = 0; function < nFunCount; ++function) - pColumnRef->getChild(function)->parseNodeToStr( sParameters, xConnection, &rParser.getContext(), sal_True, bQuote ); - - ::rtl::OUString aSelectionAlias = aSelEntry->GetAlias(); aSelEntry->SetAlias(::rtl::OUString()); - - sal_Int32 nNewFunctionType = aSelEntry->GetFunctionType() | FKT_NUMERIC | FKT_OTHER; - aSelEntry->SetFunctionType(nNewFunctionType); - - - aSelEntry->SetFieldType(TAB_NORMAL_FIELD); - - aSelEntry->SetTabWindow(NULL); - - aSelEntry->SetField(sParameters); - notifyTableFieldChanged(aSelectionAlias,aSelEntry->GetAlias(),_bListAction, nColumnId); - } - else - { - clearEntryFunctionField(_sFieldName,aSelEntry,_bListAction,nColumnId); - - ::rtl::OUString aColumns; - pColumnRef->parseNodeToStr( aColumns, - xConnection, - &rController.getParser().getContext(), - sal_True, - sal_True); - // get the type out of the funtion name - sal_Int32 nDataType = DataType::DOUBLE; - aSelEntry->SetDataType(nDataType); - aSelEntry->SetField(aColumns); - aSelEntry->SetFieldType(TAB_NORMAL_FIELD); - aSelEntry->SetTabWindow(NULL); - aSelEntry->SetAlias(::rtl::OUString()); - aSelEntry->SetFieldAlias(sColumnAlias); - aSelEntry->SetFunctionType(FKT_NUMERIC | FKT_OTHER); - notifyTableFieldChanged(sOldAlias,aSelEntry->GetAlias(),_bListAction, nColumnId); } + } if ( i > 0 && InsertField(aSelEntry,BROWSER_INVALIDID,sal_True,sal_False).isEmpty() ) // may we have to append more than one field { // the field could not be isnerted @@ -2889,7 +2867,7 @@ bool OSelectionBrowseBox::HasFieldByAliasName(const ::rtl::OUString& rFieldName, { if ( (*aIter)->GetFieldAlias() == rFieldName ) { - rInfo = *aIter; + rInfo.getBody() = (*aIter).getBody(); break; } } diff --git a/dbaccess/source/ui/querydesign/TableFieldDescription.cxx b/dbaccess/source/ui/querydesign/TableFieldDescription.cxx index 0949c8f5dc11..a00bc3dbd54c 100644 --- a/dbaccess/source/ui/querydesign/TableFieldDescription.cxx +++ b/dbaccess/source/ui/querydesign/TableFieldDescription.cxx @@ -69,24 +69,10 @@ OTableFieldDesc::OTableFieldDesc() //------------------------------------------------------------------------------ OTableFieldDesc::OTableFieldDesc(const OTableFieldDesc& rRS) : ::vos::OReference() - ,m_vecCriteria( rRS.m_vecCriteria) - ,m_aTableName(rRS.GetTable()) - ,m_aAliasName(rRS.GetAlias()) // table range - ,m_aFieldName(rRS.GetField()) // column - ,m_aFieldAlias(rRS.GetFieldAlias()) // column alias - ,m_aFunctionName(rRS.GetFunction()) // Funktionsname - ,m_pTabWindow(rRS.GetTabWindow()) - ,m_eDataType(rRS.GetDataType()) - ,m_eFunctionType( rRS.GetFunctionType() ) - ,m_eFieldType(rRS.GetFieldType()) - ,m_eOrderDir(rRS.GetOrderDir()) - ,m_nIndex(rRS.GetFieldIndex()) - ,m_nColWidth(rRS.GetColWidth()) - ,m_nColumnId( rRS.m_nColumnId) - ,m_bGroupBy(rRS.IsGroupBy()) - ,m_bVisible(rRS.IsVisible()) + { DBG_CTOR(OTableFieldDesc,NULL); + *this = rRS; } //------------------------------------------------------------------------------ @@ -107,7 +93,31 @@ OTableFieldDesc::~OTableFieldDesc() { DBG_DTOR(OTableFieldDesc,NULL); } - +//------------------------------------------------------------------------------ +OTableFieldDesc& OTableFieldDesc::operator=( const OTableFieldDesc& rRS ) +{ + if (&rRS == this) + return *this; + + m_vecCriteria = rRS.m_vecCriteria; + m_aTableName = rRS.GetTable(); + m_aAliasName = rRS.GetAlias(); // table range + m_aFieldName = rRS.GetField(); // column + m_aFieldAlias = rRS.GetFieldAlias(); // column alias + m_aFunctionName = rRS.GetFunction(); // Funktionsname + m_pTabWindow = rRS.GetTabWindow(); + m_eDataType = rRS.GetDataType(); + m_eFunctionType = rRS.GetFunctionType(); + m_eFieldType = rRS.GetFieldType(); + m_eOrderDir = rRS.GetOrderDir(); + m_nIndex = rRS.GetFieldIndex(); + m_nColWidth = rRS.GetColWidth(); + m_nColumnId = rRS.m_nColumnId; + m_bGroupBy = rRS.IsGroupBy(); + m_bVisible = rRS.IsVisible(); + + return *this; +} //------------------------------------------------------------------------------ sal_Bool OTableFieldDesc::operator==( const OTableFieldDesc& rDesc ) { -- cgit v1.2.3 From 05bb4138d25b8adcec7f9b69398163986f258073 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Fri, 27 Nov 2009 10:17:16 +0100 Subject: dba33d: #i106772# check if update and refetching works otherwise set iter to end and some resource handling for error messages --- dbaccess/source/core/api/KeySet.cxx | 7 +- dbaccess/source/core/api/RowSet.cxx | 79 ++++------ dbaccess/source/core/api/RowSetBase.cxx | 48 +----- dbaccess/source/core/api/RowSetCache.cxx | 6 +- .../source/core/dataaccess/databasedocument.cxx | 3 +- dbaccess/source/core/dataaccess/datasource.cxx | 8 +- .../source/core/dataaccess/documentcontainer.cxx | 1 - .../source/core/dataaccess/documentdefinition.cxx | 3 +- dbaccess/source/core/inc/core_resource.hrc | 21 +++ dbaccess/source/core/resource/strings.src | 72 +++++++++ dbaccess/source/ext/macromigration/dbmm_global.hrc | 3 + .../source/ext/macromigration/macromigration.src | 13 ++ .../ext/macromigration/macromigrationwizard.cxx | 10 +- dbaccess/source/ui/app/AppController.cxx | 173 +++++---------------- dbaccess/source/ui/app/app.src | 8 + dbaccess/source/ui/app/dbu_app.hrc | 5 +- dbaccess/source/ui/browser/dsEntriesNoExp.cxx | 2 +- dbaccess/source/ui/inc/dbu_uno.hrc | 5 +- dbaccess/source/ui/uno/copytablewizard.cxx | 12 +- dbaccess/source/ui/uno/copytablewizard.src | 12 ++ 20 files changed, 237 insertions(+), 254 deletions(-) diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx index 845c392bc146..1e7aa0f51f97 100644 --- a/dbaccess/source/core/api/KeySet.cxx +++ b/dbaccess/source/core/api/KeySet.cxx @@ -618,8 +618,6 @@ void SAL_CALL OKeySet::updateRow(const ORowSetRow& _rInsertRow ,const ORowSetRow } m_bUpdated = xPrep->executeUpdate() > 0; - - if(m_bUpdated) { m_aKeyIter = m_aKeyMap.find(::comphelper::getINT32((_rInsertRow->get())[0].getAny())); @@ -1168,8 +1166,9 @@ void SAL_CALL OKeySet::refreshRow() throw(SQLException, RuntimeException) m_xSet = m_xStatement->executeQuery(); OSL_ENSURE(m_xSet.is(),"No resultset form statement!"); - sal_Bool bOK = m_xSet->next(); (void)bOK; - OSL_ENSURE(bOK,"No rows!"); + sal_Bool bOK = m_xSet->next(); + if ( !bOK ) + m_aKeyIter = m_aKeyMap.end(); m_xRow.set(m_xSet,UNO_QUERY); OSL_ENSURE(m_xRow.is(),"No row form statement!"); } diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx index 813b6556f57e..461929f68141 100644 --- a/dbaccess/source/core/api/RowSet.cxx +++ b/dbaccess/source/core/api/RowSet.cxx @@ -1078,19 +1078,26 @@ void SAL_CALL ORowSet::updateRow( ) throw(SQLException, RuntimeException) m_pCache->updateRow(m_aCurrentRow.operator ->()); m_aBookmark = m_pCache->getBookmark(); m_aCurrentRow = m_pCache->m_aMatrixIter; - m_aOldRow->setRow(new ORowSetValueVector(m_aCurrentRow->getBody())); + if ( m_pCache->m_aMatrixIter != m_pCache->getEnd() ) + { + m_aOldRow->setRow(new ORowSetValueVector(m_aCurrentRow->getBody())); - // notification order - // - column values - ORowSetBase::firePropertyChange(aOldValues); + // notification order + // - column values + ORowSetBase::firePropertyChange(aOldValues); - // - rowChanged - notifyAllListenersRowChanged(aGuard,aEvt); + // - rowChanged + notifyAllListenersRowChanged(aGuard,aEvt); - // - IsModified - if(!m_bModified) - fireProperty(PROPERTY_ID_ISMODIFIED,sal_False,sal_True); - OSL_ENSURE( !m_bModified, "ORowSet::updateRow: just updated, but _still_ modified?" ); + // - IsModified + if(!m_bModified) + fireProperty(PROPERTY_ID_ISMODIFIED,sal_False,sal_True); + OSL_ENSURE( !m_bModified, "ORowSet::updateRow: just updated, but _still_ modified?" ); + } + else // the update went rong + { + ::dbtools::throwSQLException( DBACORE_RESSTRING( RID_STR_UPDATE_FAILED ), SQL_INVALID_CURSOR_POSITION, *this ); + } } } // ------------------------------------------------------------------------- @@ -1102,20 +1109,15 @@ void SAL_CALL ORowSet::deleteRow( ) throw(SQLException, RuntimeException) checkCache(); if ( m_bBeforeFirst || m_bAfterLast ) - throwSQLException( "Cannot delete the before-first or after-last row.", SQL_INVALID_CURSOR_POSITION, *this ); - // TODO: resource + ::dbtools::throwSQLException( DBACORE_RESSTRING( RID_STR_NO_DELETE_BEFORE_AFTER ), SQL_INVALID_CURSOR_POSITION, *this ); if ( m_bNew ) - throwSQLException( "Cannot delete the insert-row.", SQL_INVALID_CURSOR_POSITION, *this ); - // TODO: resource + ::dbtools::throwSQLException( DBACORE_RESSTRING( RID_STR_NO_DELETE_INSERT_ROW ), SQL_INVALID_CURSOR_POSITION, *this ); if ( m_nResultSetConcurrency == ResultSetConcurrency::READ_ONLY ) - throwSQLException( "Result set is read only.", SQL_FUNCTION_SEQUENCE_ERROR, *this ); - // TODO: resource + ::dbtools::throwSQLException( DBACORE_RESSTRING( RID_STR_RESULT_IS_READONLY ), SQL_FUNCTION_SEQUENCE_ERROR, *this ); if ( ( m_pCache->m_nPrivileges & Privilege::DELETE ) != Privilege::DELETE ) - throwSQLException( "DELETE privilege not available.", SQL_FUNCTION_SEQUENCE_ERROR, *this ); - // TODO: resource + ::dbtools::throwSQLException( DBACORE_RESSTRING( RID_STR_NO_DELETE_PRIVILEGE ), SQL_FUNCTION_SEQUENCE_ERROR, *this ); if ( rowDeleted() ) - throwSQLException( "Current row already deleted.", SQL_FUNCTION_SEQUENCE_ERROR, *this ); - // TODO: resource + ::dbtools::throwSQLException( DBACORE_RESSTRING( RID_STR_ROW_ALREADY_DELETED ), SQL_FUNCTION_SEQUENCE_ERROR, *this ); // this call position the cache indirect Any aBookmarkToDelete( m_aBookmark ); @@ -1279,8 +1281,7 @@ void SAL_CALL ORowSet::moveToInsertRow( ) throw(SQLException, RuntimeException) ::osl::ResettableMutexGuard aGuard( *m_pMutex ); checkPositioningAllowed(); if ( ( m_pCache->m_nPrivileges & Privilege::INSERT ) != Privilege::INSERT ) - throwSQLException( "No insert privileges", SQL_GENERAL_ERROR, *this ); - // TODO: resource + ::dbtools::throwSQLException( DBACORE_RESSTRING( RID_STR_NO_INSERT_PRIVILEGE ), SQL_GENERAL_ERROR, *this ); if ( notifyAllListenersCursorBeforeMove( aGuard ) ) { @@ -1346,8 +1347,7 @@ void SAL_CALL ORowSet::moveToCurrentRow( ) throw(SQLException, RuntimeException // m_bModified should be true. Also, as soon as somebody calls moveToInsertRow, // our current row should not be deleted anymore. So, we should not have survived the above // check "if ( !m_pCache->m_bNew && !m_bModified )" - throwSQLException( "The current row is deleted.", SQL_FUNCTION_SEQUENCE_ERROR, *this ); - // TODO: resource + ::dbtools::throwSQLException( DBACORE_RESSTRING( RID_STR_ROW_ALREADY_DELETED ), SQL_FUNCTION_SEQUENCE_ERROR, *this ); if ( notifyAllListenersCursorBeforeMove( aGuard ) ) { @@ -1711,12 +1711,7 @@ Reference< XResultSet > ORowSet::impl_prepareAndExecute_throw() m_xStatement = m_xActiveConnection->prepareStatement( sCommandToExecute ); if ( !m_xStatement.is() ) { - SQLException aError; - aError.Context = *this; - aError.SQLState = getStandardSQLState( SQL_GENERAL_ERROR ); - aError.Message = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Internal error: no statement object provided by the database driver." ) ); - // TODO: resource - throw aError; + ::dbtools::throwSQLException( DBACORE_RESSTRING( RID_STR_INTERNAL_ERROR ), SQL_GENERAL_ERROR, *this ); } Reference< XPropertySet > xStatementProps( m_xStatement, UNO_QUERY_THROW ); @@ -2042,8 +2037,7 @@ void ORowSet::execute_NoApprove_NoNewConn(ResettableMutexGuard& _rClearForNotifi if(xColumn.is()) xColumn->getPropertyValue(PROPERTY_NAME) >>= sColumnLabel; else - sColumnLabel = ::rtl::OUString::createFromAscii("Expression1"); - // TODO: resource + sColumnLabel = DBACORE_RESSTRING( RID_STR_EXPRESSION1 ); } pColumn->setName(sColumnLabel); aNames.push_back(sColumnLabel); @@ -2457,8 +2451,7 @@ sal_Bool ORowSet::impl_buildActiveCommand_throw() m_aActiveCommand = sCommand; if ( !m_aActiveCommand.getLength() ) - throwSQLException( "No SQL command was provided.", SQL_FUNCTION_SEQUENCE_ERROR, *this ); - // TODO: resource + ::dbtools::throwSQLException( DBACORE_RESSTRING( RID_STR_NO_SQL_COMMAND ), SQL_FUNCTION_SEQUENCE_ERROR, *this ); return bDoEscapeProcessing; } @@ -2760,21 +2753,17 @@ void ORowSet::checkUpdateIterator() void ORowSet::checkUpdateConditions(sal_Int32 columnIndex) { checkCache(); - if ( columnIndex <= 0 ) - throwSQLException( "Invalid column index", SQL_INVALID_DESCRIPTOR_INDEX, *this ); - // TODO: resource + if ( columnIndex <= 0 || sal_Int32((*m_aCurrentRow)->get().size()) <= columnIndex ) + ::dbtools::throwSQLException( DBACORE_RESSTRING( RID_STR_INVALID_INDEX ), SQL_INVALID_DESCRIPTOR_INDEX, *this ); + if ( rowDeleted() ) - throwSQLException( "Current row is deleted", SQL_INVALID_CURSOR_POSITION, *this ); - // TODO: resource + ::dbtools::throwSQLException( DBACORE_RESSTRING( RID_STR_ROW_ALREADY_DELETED ), SQL_INVALID_CURSOR_POSITION, *this ); + if ( m_aCurrentRow.isNull() ) - throwSQLException( "Invalid cursor state", SQL_INVALID_CURSOR_STATE, *this ); + ::dbtools::throwSQLException( DBACORE_RESSTRING( RID_STR_INVALID_CURSOR_STATE ), SQL_INVALID_CURSOR_STATE, *this ); - if ( sal_Int32((*m_aCurrentRow)->get().size()) <= columnIndex ) - throwSQLException( "Invalid column index", SQL_INVALID_DESCRIPTOR_INDEX, *this ); - // TODO: resource if ( m_nResultSetConcurrency == ResultSetConcurrency::READ_ONLY) - throwSQLException( "Result set is not writeable", SQL_GENERAL_ERROR, *this ); - // TODO: resource + ::dbtools::throwSQLException( DBACORE_RESSTRING( RID_STR_RESULT_IS_READONLY ), SQL_GENERAL_ERROR, *this ); } // ----------------------------------------------------------------------------- void SAL_CALL ORowSet::refreshRow( ) throw(SQLException, RuntimeException) diff --git a/dbaccess/source/core/api/RowSetBase.cxx b/dbaccess/source/core/api/RowSetBase.cxx index d8449094fa85..c5811705570d 100644 --- a/dbaccess/source/core/api/RowSetBase.cxx +++ b/dbaccess/source/core/api/RowSetBase.cxx @@ -30,57 +30,25 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbaccess.hxx" -#ifndef DBACCESS_CORE_API_ROWSETBASE_HXX + #include "RowSetBase.hxx" -#endif -#ifndef DBACCESS_CORE_API_CROWSETDATACOLUMN_HXX #include "CRowSetDataColumn.hxx" -#endif -#ifndef _CONNECTIVITY_SDBCX_COLLECTION_HXX_ #include -#endif -#ifndef DBACCESS_CORE_API_ROWSETCACHE_HXX #include "RowSetCache.hxx" -#endif -#ifndef DBACCESS_SHARED_DBASTRINGS_HRC #include "dbastrings.hrc" -#endif -#ifndef _COM_SUN_STAR_LANG_DISPOSEDEXCEPTION_HPP_ +#include "core_resource.hrc" #include -#endif -#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_ #include -#endif -#ifndef _COM_SUN_STAR_SDBCX_COMPAREBOOKMARK_HPP_ #include -#endif -#ifndef _COM_SUN_STAR_SDBC_RESULTSETCONCURRENCY_HPP_ #include -#endif -#ifndef _COM_SUN_STAR_LANG_LOCALE_HPP_ #include -#endif -#ifndef _COM_SUN_STAR_UTIL_NUMBERFORMAT_HPP_ #include -#endif -#ifndef _COMPHELPER_SEQUENCE_HXX_ #include -#endif -#ifndef _COMPHELPER_EXTRACT_HXX_ #include -#endif -#ifndef _COMPHELPER_SEQSTREAM_HXX #include -#endif -#ifndef _DBHELPER_DBEXCEPTION_HXX_ #include -#endif -#ifndef _OSL_THREAD_H_ #include -#endif -#ifndef _TOOLS_DEBUG_HXX #include -#endif #include using namespace dbaccess; @@ -278,8 +246,7 @@ const ORowSetValue& ORowSetBase::impl_getValue(sal_Int32 columnIndex) if ( m_bBeforeFirst || m_bAfterLast ) { OSL_ENSURE(0,"ORowSetBase::getValue: Illegal call here (we're before first or after last)!"); - throwSQLException( "The cursor points to before the first or after the last row.", SQL_INVALID_CURSOR_POSITION, *m_pMySelf ); - // TODO: resource + ::dbtools::throwSQLException( DBACORE_RESSTRING( RID_STR_CURSOR_BEFORE_OR_AFTER ), SQL_INVALID_CURSOR_POSITION, *m_pMySelf ); } if ( impl_rowDeleted() ) @@ -421,8 +388,7 @@ Reference< ::com::sun::star::io::XInputStream > SAL_CALL ORowSetBase::getBinaryS if ( m_bBeforeFirst || m_bAfterLast ) { OSL_ENSURE(0,"ORowSetBase::getBinaryStream: Illegal call here (we're before first or after last)!"); - throwSQLException( "The cursor points to before the first or after the last row.", SQL_INVALID_CURSOR_POSITION, *m_pMySelf ); - // TODO: resource + ::dbtools::throwSQLException( DBACORE_RESSTRING( RID_STR_CURSOR_BEFORE_OR_AFTER ), SQL_INVALID_CURSOR_POSITION, *m_pMySelf ); } if ( impl_rowDeleted() ) @@ -498,12 +464,10 @@ Any SAL_CALL ORowSetBase::getBookmark( ) throw(SQLException, RuntimeException) checkCache(); if ( m_bBeforeFirst || m_bAfterLast ) - throwSQLException( "The rows before the first and after the last row don't have a bookmark.", SQL_INVALID_CURSOR_POSITION, *m_pMySelf ); - // TODO: resource + ::dbtools::throwSQLException( DBACORE_RESSTRING( RID_STR_NO_BOOKMARK_BEFORE_OR_AFTER ), SQL_INVALID_CURSOR_POSITION, *m_pMySelf ); if ( impl_rowDeleted() ) - throwSQLException( "The current row is deleted, and thus doesn't have a bookmark.", SQL_INVALID_CURSOR_POSITION, *m_pMySelf ); - // TODO: resource + ::dbtools::throwSQLException( DBACORE_RESSTRING( RID_STR_NO_BOOKMARK_DELETED ), SQL_INVALID_CURSOR_POSITION, *m_pMySelf ); OSL_ENSURE( m_aBookmark.hasValue(), "ORowSetBase::getBookmark: bookmark has no value!" ); return m_aBookmark; diff --git a/dbaccess/source/core/api/RowSetCache.cxx b/dbaccess/source/core/api/RowSetCache.cxx index 4156c32635a2..3dd4dad67441 100644 --- a/dbaccess/source/core/api/RowSetCache.cxx +++ b/dbaccess/source/core/api/RowSetCache.cxx @@ -912,7 +912,7 @@ sal_Bool ORowSetCache::moveWindow() { *m_aMatrixIter = new ORowSetValueVector(m_xMetaData->getColumnCount()); m_pCacheSet->fillValueRow(*m_aMatrixIter,m_nPosition); - // we have to read one row forward to enshure that we know when we are on last row + // we have to read one row forward to ensure that we know when we are on last row // but only when we don't know it already if ( !m_bRowCountFinal ) { @@ -1283,7 +1283,9 @@ void ORowSetCache::updateRow( ORowSetMatrix::iterator& _rUpdateRow ) // *(*m_aMatrixIter) = *(*_rUpdateRow); // refetch the whole row (*m_aMatrixIter) = NULL; - moveToBookmark(aBookmark); + + if ( !moveToBookmark(aBookmark) ) + m_aMatrixIter = m_pMatrix->end(); // moveToBookmark((*(*m_aInsertRow))[0].makeAny()); // if(m_pCacheSet->rowUpdated()) diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx index f04e39906503..6708dbfa56bb 100644 --- a/dbaccess/source/core/dataaccess/databasedocument.cxx +++ b/dbaccess/source/core/dataaccess/databasedocument.cxx @@ -1615,8 +1615,7 @@ void SAL_CALL ODatabaseDocument::loadFromStorage( const Reference< XStorage >& / DocumentGuard aGuard( *this ); throw Exception( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Embedding of database documents is not supported." ) ), - // TODO: resource + DBACORE_RESSTRING( RID_STR_NO_EMBEDDING ), *this ); } diff --git a/dbaccess/source/core/dataaccess/datasource.cxx b/dbaccess/source/core/dataaccess/datasource.cxx index 3f33bc226aa2..f7fc11a5d80a 100644 --- a/dbaccess/source/core/dataaccess/datasource.cxx +++ b/dbaccess/source/core/dataaccess/datasource.cxx @@ -68,9 +68,9 @@ #include #include #include +#include #include #include -#include #include #include #include @@ -78,6 +78,7 @@ #include #include #include +#include #include using namespace ::com::sun::star::sdbc; @@ -832,9 +833,8 @@ Reference< XConnection > ODatabaseSource::buildLowLevelConnection(const ::rtl::O ::rtl::OUString sMessage = DBACORE_RESSTRING( nExceptionMessageId ); SQLContext aContext; - aContext.Message = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "A connection for the following URL was requested: " ) ); - // TODO: resource - aContext.Message += m_pImpl->m_sConnectURL; + aContext.Message = DBACORE_RESSTRING( RID_STR_CONNECTION_REQUEST ); + ::comphelper::string::searchAndReplaceAsciiI( aContext.Message, "$name$", m_pImpl->m_sConnectURL ); throwGenericSQLException( sMessage, static_cast< XDataSource* >( this ), makeAny( aContext ) ); } diff --git a/dbaccess/source/core/dataaccess/documentcontainer.cxx b/dbaccess/source/core/dataaccess/documentcontainer.cxx index 89dd49184519..3229aa80a45e 100644 --- a/dbaccess/source/core/dataaccess/documentcontainer.cxx +++ b/dbaccess/source/core/dataaccess/documentcontainer.cxx @@ -545,7 +545,6 @@ Reference< XComponent > SAL_CALL ODocumentContainer::loadComponentFromURL( const if ( !lcl_queryContent(_sURL,xNameContainer,aContent,sName) ) { ::rtl::OUString sMessage( DBA_RES( RID_STR_NAME_NOT_FOUND ) ); - // TODO: resource ::comphelper::string::searchAndReplaceAsciiI( sMessage, "$name$", _sURL ); throw IllegalArgumentException( sMessage, *this, 1 ); } diff --git a/dbaccess/source/core/dataaccess/documentdefinition.cxx b/dbaccess/source/core/dataaccess/documentdefinition.cxx index 992fc156d386..563344f19789 100644 --- a/dbaccess/source/core/dataaccess/documentdefinition.cxx +++ b/dbaccess/source/core/dataaccess/documentdefinition.cxx @@ -1694,8 +1694,7 @@ void ODocumentDefinition::loadEmbeddedObject( const Reference< XConnection >& _x if ( !xEnumDrivers.is() || !xEnumDrivers->hasMoreElements() ) { com::sun::star::io::WrongFormatException aWFE; - aWFE.Message = ::rtl::OUString::createFromAscii("Extension not present."); - // TODO: resource + aWFE.Message = DBACORE_RESSTRING( RID_STR_MISSING_EXTENSION ); throw aWFE; } } diff --git a/dbaccess/source/core/inc/core_resource.hrc b/dbaccess/source/core/inc/core_resource.hrc index 3463ef2c960f..309a17124c42 100644 --- a/dbaccess/source/core/inc/core_resource.hrc +++ b/dbaccess/source/core/inc/core_resource.hrc @@ -91,5 +91,26 @@ #define RID_STR_ERROR_WHILE_SAVING ( RID_CORE_STRINGS_START + 47 ) #define RID_STR_NO_SUB_FOLDER ( RID_CORE_STRINGS_START + 48 ) +#define RID_STR_NO_DELETE_BEFORE_AFTER ( RID_CORE_STRINGS_START + 49 ) +#define RID_STR_NO_DELETE_INSERT_ROW ( RID_CORE_STRINGS_START + 50 ) +#define RID_STR_RESULT_IS_READONLY ( RID_CORE_STRINGS_START + 51 ) +#define RID_STR_NO_DELETE_PRIVILEGE ( RID_CORE_STRINGS_START + 52 ) +#define RID_STR_ROW_ALREADY_DELETED ( RID_CORE_STRINGS_START + 53 ) +#define RID_STR_UPDATE_FAILED ( RID_CORE_STRINGS_START + 54 ) + +#define RID_STR_INVALID_INDEX ( RID_CORE_STRINGS_START + 55 ) +#define RID_STR_NO_INSERT_PRIVILEGE ( RID_CORE_STRINGS_START + 56 ) +#define RID_STR_INTERNAL_ERROR ( RID_CORE_STRINGS_START + 57 ) +#define RID_STR_EXPRESSION1 ( RID_CORE_STRINGS_START + 58 ) +#define RID_STR_NO_SQL_COMMAND ( RID_CORE_STRINGS_START + 59 ) +#define RID_STR_INVALID_CURSOR_STATE ( RID_CORE_STRINGS_START + 60 ) +#define RID_STR_CURSOR_BEFORE_OR_AFTER ( RID_CORE_STRINGS_START + 61 ) +#define RID_STR_NO_BOOKMARK_BEFORE_OR_AFTER ( RID_CORE_STRINGS_START + 62 ) +#define RID_STR_NO_BOOKMARK_DELETED ( RID_CORE_STRINGS_START + 63 ) +#define RID_STR_NO_EMBEDDING ( RID_CORE_STRINGS_START + 64 ) +#define RID_STR_CONNECTION_REQUEST ( RID_CORE_STRINGS_START + 65 ) +#define RID_STR_MISSING_EXTENSION ( RID_CORE_STRINGS_START + 66 ) + + #endif // _DBA_CORE_RESOURCE_HRC_ diff --git a/dbaccess/source/core/resource/strings.src b/dbaccess/source/core/resource/strings.src index 1480f0c95310..5b3c64e5316b 100644 --- a/dbaccess/source/core/resource/strings.src +++ b/dbaccess/source/core/resource/strings.src @@ -249,4 +249,76 @@ String RID_STR_NO_SUB_FOLDER { Text [ en-US ] = "There exists no folder named \"$folder$\"."; }; +String RID_STR_NO_DELETE_BEFORE_AFTER +{ + Text [ en-US ] = "Cannot delete the before-first or after-last row."; +}; +String RID_STR_NO_DELETE_INSERT_ROW +{ + Text [ en-US ] = "Cannot delete the insert-row."; +}; +String RID_STR_RESULT_IS_READONLY +{ + Text [ en-US ] = "Result set is read only."; +}; +String RID_STR_NO_DELETE_PRIVILEGE +{ + Text [ en-US ] = "DELETE privilege not available."; +}; +String RID_STR_ROW_ALREADY_DELETED +{ + Text [ en-US ] = "Current row is already deleted."; +}; +String RID_STR_UPDATE_FAILED +{ + Text [ en-US ] = "Current row could be updated."; +}; //------------------------------------------------------------------------- +String RID_STR_NO_INSERT_PRIVILEGE +{ + Text [ en-US ] = "INSERT privilege not available."; +}; +String RID_STR_INTERNAL_ERROR +{ + Text [ en-US ] = "Internal error: no statement object provided by the database driver."; +}; +String RID_STR_EXPRESSION1 +{ + Text [ en-US ] = "Expression1"; +}; +String RID_STR_NO_SQL_COMMAND +{ + Text [ en-US ] = "No SQL command was provided."; +}; +String RID_STR_INVALID_INDEX +{ + Text [ en-US ] = "Invalid column index."; +}; +String RID_STR_INVALID_CURSOR_STATE +{ + Text [ en-US ] = "Invalid cursor state."; +}; +String RID_STR_CURSOR_BEFORE_OR_AFTER +{ + Text [ en-US ] = "The cursor points to before the first or after the last row."; +}; +String RID_STR_NO_BOOKMARK_BEFORE_OR_AFTER +{ + Text [ en-US ] = "The rows before the first and after the last row don't have a bookmark."; +}; +String RID_STR_NO_BOOKMARK_DELETED +{ + Text [ en-US ] = "The current row is deleted, and thus doesn't have a bookmark."; +}; +String RID_STR_NO_EMBEDDING +{ + Text [ en-US ] = "Embedding of database documents is not supported."; +}; +String RID_STR_CONNECTION_REQUEST +{ + Text [ en-US ] = "A connection for the following URL was requested \"$name$\"."; +}; +String RID_STR_MISSING_EXTENSION +{ + Text [ en-US ] = "The extension is not installed."; +}; diff --git a/dbaccess/source/ext/macromigration/dbmm_global.hrc b/dbaccess/source/ext/macromigration/dbmm_global.hrc index 3ce7577426c7..53899d7bf33c 100644 --- a/dbaccess/source/ext/macromigration/dbmm_global.hrc +++ b/dbaccess/source/ext/macromigration/dbmm_global.hrc @@ -82,5 +82,8 @@ #define STR_WARNINGS ( RID_DBMM_STRING_START + 14 ) #define STR_EXCEPTION ( RID_DBMM_STRING_START + 15 ) #define STR_LIBRARY_TYPE_AND_NAME ( RID_DBMM_STRING_START + 16 ) +#define STR_INVALID_NUMBER_ARGS ( RID_DBMM_STRING_START + 17 ) +#define STR_NO_DATABASE ( RID_DBMM_STRING_START + 18 ) +#define STR_NOT_READONLY ( RID_DBMM_STRING_START + 19 ) #endif // DBACCESS_DBMM_GLOBAL_HRC diff --git a/dbaccess/source/ext/macromigration/macromigration.src b/dbaccess/source/ext/macromigration/macromigration.src index bb49ac7ad287..fa973be93d00 100644 --- a/dbaccess/source/ext/macromigration/macromigration.src +++ b/dbaccess/source/ext/macromigration/macromigration.src @@ -441,3 +441,16 @@ ErrorBox ERR_INVALID_BACKUP_LOCATION Buttons = WB_OK; Message [ en-US ] = "You need to choose a backup location other than the document location itself."; }; + +String STR_INVALID_NUMBER_ARGS +{ + Text [ en-US ] = "Invalid number of initialization arguments. Expected 1."; +}; +String STR_NO_DATABASE +{ + Text [ en-US ] = "No database document found in the initializatin arguments."; +}; +String STR_NOT_READONLY +{ + Text [ en-US ] = "Not applicable to read-only documents."; +}; diff --git a/dbaccess/source/ext/macromigration/macromigrationwizard.cxx b/dbaccess/source/ext/macromigration/macromigrationwizard.cxx index 732fa9906119..72eef7e1583b 100644 --- a/dbaccess/source/ext/macromigration/macromigrationwizard.cxx +++ b/dbaccess/source/ext/macromigration/macromigrationwizard.cxx @@ -32,6 +32,7 @@ #include "precompiled_dbaccess.hxx" #include "dbmm_module.hxx" +#include "dbmm_global.hrc" #include "macromigrationdialog.hxx" /** === begin UNO includes === **/ @@ -210,8 +211,7 @@ namespace dbmm if ( _rArguments.getLength() != 1 ) throw IllegalArgumentException( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Invalid number of initialization arguments. Expected 1." ) ), - // TODO: resource + String(MacroMigrationResId(STR_INVALID_NUMBER_ARGS)), *this, 1 ); @@ -219,8 +219,7 @@ namespace dbmm m_xDocument.set( _rArguments[0], UNO_QUERY ); if ( !m_xDocument.is() ) throw IllegalArgumentException( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "No database document found in the initializatin arguments." ) ), - // TODO: resource + String(MacroMigrationResId(STR_NO_DATABASE)), *this, 1 ); @@ -228,8 +227,7 @@ namespace dbmm Reference< XStorable > xDocStor( m_xDocument, UNO_QUERY_THROW ); if ( xDocStor->isReadonly() ) throw IllegalArgumentException( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Not applicable to read-only documents." ) ), - // TODO: resource + String(MacroMigrationResId(STR_NOT_READONLY)), *this, 1 ); diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx index b87b7706d87f..2664436ade4c 100644 --- a/dbaccess/source/ui/app/AppController.cxx +++ b/dbaccess/source/ui/app/AppController.cxx @@ -79,160 +79,68 @@ #include #include /** === end UNO includes === **/ - -#ifndef _TOOLS_DEBUG_HXX #include -#endif -#ifndef TOOLS_DIAGNOSE_EX_H #include -#endif -#ifndef SVTOOLS_URIHELPER_HXX +#include + #include -#endif -#ifndef _COMPHELPER_TYPES_HXX_ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include #include -#endif -#ifndef _COMPHELPER_INTERACTION_HXX_ #include -#endif -#ifndef COMPHELPER_COMPONENTCONTEXT_HXX #include -#endif -#ifndef _SV_MSGBOX_HXX + #include -#endif -#ifndef _VCL_STDTEXT_HXX #include -#endif -#ifndef _FILEDLGHELPER_HXX +#include +#include +#include + +#include #include -#endif -#ifndef _CPPUHELPER_TYPEPROVIDER_HXX_ +#include +#include + #include -#endif -#ifndef _CPPUHELPER_EXC_HLP_HXX_ #include -#endif -#ifndef _CONNECTIVITY_DBTOOLS_HXX_ + #include -#endif -#ifndef DBAUI_APPVIEW_HXX +#include + +#include +#include +#include + #include "AppView.hxx" -#endif -#ifndef DBACCESS_UI_BROWSER_ID_HXX #include "browserids.hxx" -#endif -#ifndef _DBAU_REGHELPER_HXX_ #include "dbu_reghelper.hxx" -#endif -#ifndef _DBU_APP_HRC_ #include "dbu_app.hrc" -#endif -#ifndef DBACCESS_SOURCE_UI_MISC_DEFAULTOBJECTNAMECHECK_HXX #include "defaultobjectnamecheck.hxx" -#endif -#ifndef _SV_MENU_HXX -#include -#endif -#ifndef INCLUDED_SVTOOLS_PATHOPTIONS_HXX -#include -#endif -#ifndef INCLUDED_SVTOOLS_INTERNALOPTIONS_HXX -#include -#endif -#ifndef _COMPHELPER_UNO3_HXX_ -#include -#endif -#ifndef DBACCESS_DATABASE_OBJECT_VIEW_HXX #include "databaseobjectview.hxx" -#endif -#ifndef _SV_SVAPP_HXX //autogen -#include -#endif -#ifndef _SVLBOXITM_HXX -#include -#endif -#ifndef _DBAUI_LISTVIEWITEMS_HXX_ #include "listviewitems.hxx" -#endif - -#ifndef DBAUI_APPDETAILVIEW_HXX #include "AppDetailView.hxx" -#endif -#ifndef _DBAUI_LINKEDDOCUMENTS_HXX_ #include "linkeddocuments.hxx" -#endif -#ifndef _SV_LSTBOX_HXX -#include -#endif -#ifndef _DBHELPER_DBEXCEPTION_HXX_ -#include -#endif -#ifndef _DBAUI_SQLMESSAGE_HXX_ #include "sqlmessage.hxx" -#endif -#ifndef _STRING_HXX -#include -#endif -#ifndef INCLUDED_SFX_MAILMODELAPI_HXX -#include -#endif -#ifndef INCLUDED_SVTOOLS_MODULEOPTIONS_HXX -#include -#endif -#ifndef _SVTREEBOX_HXX -#include -#endif -#ifndef _TRANSFER_HXX -#include -#endif -#ifndef _CLIPLISTENER_HXX -#include -#endif -#ifndef _SVX_DBAEXCHANGE_HXX_ -#include -#endif -#ifndef SVX_DBAOBJECTEX_HXX -#include -#endif -#ifndef DBAUI_TOOLS_HXX #include "UITools.hxx" -#endif -#ifndef _DBAUI_DSNTYPES_HXX_ #include "dsntypes.hxx" -#endif -#include -#include -#ifndef _UNOTOOLS_TEMPFILE_HXX -#include -#endif -#ifndef _DBA_DBACCESS_HELPID_HRC_ #include "dbaccess_helpid.hrc" -#endif -#ifndef DBAUI_DLGSAVE_HXX #include "dlgsave.hxx" -#endif -#ifndef _SFX_DOCFILT_HACK_HXX -#include -#endif -#ifndef SFX_QUERYSAVEDOCUMENT_HXX -#include -#endif -#ifndef INCLUDED_SVTOOLS_HISTORYOPTIONS_HXX -#include -#endif -#ifndef SVTOOLS_FILENOTATION_HXX_ -#include -#endif -#ifndef _COMPHELPER_SEQUENCE_HXX_ -#include -#endif -#ifndef _VOS_MUTEX_HXX_ #include -#endif -#ifndef _DBACCESS_SLOTID_HRC_ #include "dbaccess_slotid.hrc" -#endif #include #include @@ -2955,8 +2863,7 @@ void SAL_CALL OApplicationController::removeSelectionChangeListener( const Refer case DatabaseObjectContainer::REPORTS: if ( eSelectedCategory != E_NONE ) throw IllegalArgumentException( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "You cannot select different categories." ) ), - // TODO: resource + String(ModuleRes(RID_STR_NO_DIFF_CAT)), *this, sal_Int16( pObject - aSelectedObjects.getConstArray() ) ); eSelectedCategory = ( pObject->Type == DatabaseObjectContainer::TABLES ) ? E_TABLE @@ -2969,13 +2876,9 @@ void SAL_CALL OApplicationController::removeSelectionChangeListener( const Refer default: case DatabaseObjectContainer::DATA_SOURCE: { - ::rtl::OUStringBuffer aMessage; - aMessage.appendAscii( "Unsupported object type found (" ); - aMessage.append ( sal_Int32( pObject->Type ) ); - aMessage.appendAscii( ")." ); - // TODO: resource - throw IllegalArgumentException( - aMessage.makeStringAndClear(), *this, sal_Int16( pObject - aSelectedObjects.getConstArray() ) ); + ::rtl::OUString sMessage = String(ModuleRes( RID_STR_UNSUPPORTED_OBJECT_TYPE )); + ::comphelper::string::searchAndReplaceAsciiI( sMessage, "$type$", ::rtl::OUString::valueOf(sal_Int32( pObject->Type )) ); + throw IllegalArgumentException(sMessage, *this, sal_Int16( pObject - aSelectedObjects.getConstArray() )); } } } diff --git a/dbaccess/source/ui/app/app.src b/dbaccess/source/ui/app/app.src index c913d16ebd2d..9aff7f73d992 100644 --- a/dbaccess/source/ui/app/app.src +++ b/dbaccess/source/ui/app/app.src @@ -469,3 +469,11 @@ String RID_STR_EMBEDDED_DATABASE { Text [ en-US ] = "Embedded database"; }; +String RID_STR_NO_DIFF_CAT +{ + Text [ en-US ] = "You cannot select different categories."; +}; +String RID_STR_UNSUPPORTED_OBJECT_TYPE +{ + Text [ en-US ] = "Unsupported object type found ($type$)."; +}; diff --git a/dbaccess/source/ui/app/dbu_app.hrc b/dbaccess/source/ui/app/dbu_app.hrc index 63aa923ce30f..5b4aee52304e 100644 --- a/dbaccess/source/ui/app/dbu_app.hrc +++ b/dbaccess/source/ui/app/dbu_app.hrc @@ -68,11 +68,12 @@ #define RID_STR_FORMS_HELP_TEXT_WIZARD RID_STR_APP_START + 29 #define RID_STR_REPORT_HELP_TEXT RID_STR_APP_START + 30 #define RID_STR_EMBEDDED_DATABASE RID_STR_APP_START + 31 - +#define RID_STR_NO_DIFF_CAT RID_STR_APP_START + 32 +#define RID_STR_UNSUPPORTED_OBJECT_TYPE RID_STR_APP_START + 33 // please adjust checking before insert new strings -#if RID_STR_EMBEDDED_DATABASE > RID_STR_APP_END +#if RID_STR_UNSUPPORTED_OBJECT_TYPE > RID_STR_APP_END #error Resource-Id Ueberlauf in #file, #line #endif diff --git a/dbaccess/source/ui/browser/dsEntriesNoExp.cxx b/dbaccess/source/ui/browser/dsEntriesNoExp.cxx index 16859283c9b7..51121b022e88 100644 --- a/dbaccess/source/ui/browser/dsEntriesNoExp.cxx +++ b/dbaccess/source/ui/browser/dsEntriesNoExp.cxx @@ -166,7 +166,7 @@ void SbaTableQueryBrowser::SelectionChanged() InvalidateFeature(ID_BROWSER_INSERTCONTENT); InvalidateFeature(ID_BROWSER_FORMLETTER); } // if ( !m_bShowMenu ) - InvalidateFeature(ID_BROWSER_COPY); + InvalidateFeature(ID_BROWSER_COPY); InvalidateFeature(ID_BROWSER_CUT); } //------------------------------------------------------------------------------ diff --git a/dbaccess/source/ui/inc/dbu_uno.hrc b/dbaccess/source/ui/inc/dbu_uno.hrc index acd15c94c7ef..6aec13955ac0 100644 --- a/dbaccess/source/ui/inc/dbu_uno.hrc +++ b/dbaccess/source/ui/inc/dbu_uno.hrc @@ -43,9 +43,12 @@ #define STR_CTW_UNSUPPORTED_COLUMN_TYPE ( RID_STR_UNO_START + 6 ) #define STR_CTW_ILLEGAL_PARAMETER_COUNT ( RID_STR_UNO_START + 7 ) #define STR_CTW_ERROR_DURING_INITIALIZATION ( RID_STR_UNO_START + 8 ) +#define STR_CTW_ERROR_UNSUPPORTED_SETTING ( RID_STR_UNO_START + 9 ) +#define STR_CTW_ERROR_NO_QUERY ( RID_STR_UNO_START + 10 ) +#define STR_CTW_ERROR_INVALID_INTERACTIONHANDLER ( RID_STR_UNO_START + 11 ) // please adjust when inserting new strings: -#define RID_STR_UNO_LAST_USED STR_CTW_ERROR_DURING_INITIALIZATION +#define RID_STR_UNO_LAST_USED STR_CTW_ERROR_INVALID_INTERACTIONHANDLER #if RID_STR_UNO_LAST_USED >= RID_STR_UNO_END #error too many resources in uno .... diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx index 159d447ae554..aa2b87fca329 100644 --- a/dbaccess/source/ui/uno/copytablewizard.cxx +++ b/dbaccess/source/ui/uno/copytablewizard.cxx @@ -70,6 +70,7 @@ #include #include #include +#include #include #include #include @@ -775,9 +776,8 @@ void CopyTableWizard::impl_checkForUnsupportedSettings_throw( const Reference< X if ( sUnsupportedSetting.getLength() != 0 ) { - ::rtl::OUString sMessage( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Unsupported setting in the copy source descriptor: $name$." ) ) ); - // TODO: resource - sMessage = sMessage.replaceAt( sMessage.indexOfAsciiL( "$name$", 6 ), 6, sUnsupportedSetting ); + ::rtl::OUString sMessage( String(ModuleRes( STR_CTW_ERROR_UNSUPPORTED_SETTING )) ); + ::comphelper::string::searchAndReplaceAsciiI( sMessage, "$name$", sUnsupportedSetting ); throw IllegalArgumentException( sMessage, *const_cast< CopyTableWizard* >( this ), @@ -849,8 +849,7 @@ void CopyTableWizard::impl_checkForUnsupportedSettings_throw( const Reference< X if ( _out_rCommandType == CommandType::QUERY ) // we cannot copy a query if the connection cannot provide it ... throw IllegalArgumentException( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "To copy a query, your connection must be able to provide queries." ) ), - // TODO: resource + String(ModuleRes( STR_CTW_ERROR_NO_QUERY )), *const_cast< CopyTableWizard* >( this ), 1 ); @@ -1516,8 +1515,7 @@ void SAL_CALL CopyTableWizard::initialize( const Sequence< Any >& _rArguments ) { // ->createWithInteractionHandler if ( !( _rArguments[2] >>= m_xInteractionHandler ) ) throw IllegalArgumentException( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "The given interaction handler is invalid." ) ), - // TODO: resource + String(ModuleRes( STR_CTW_ERROR_INVALID_INTERACTIONHANDLER )), *this, 3 ); diff --git a/dbaccess/source/ui/uno/copytablewizard.src b/dbaccess/source/ui/uno/copytablewizard.src index 07db51196ce2..4bb6efc839cc 100644 --- a/dbaccess/source/ui/uno/copytablewizard.src +++ b/dbaccess/source/ui/uno/copytablewizard.src @@ -69,3 +69,15 @@ String STR_CTW_ERROR_DURING_INITIALIZATION { Text [ en-US ] = "An error occurred during initialization."; }; +String STR_CTW_ERROR_UNSUPPORTED_SETTING +{ + Text [ en-US ] = "Unsupported setting in the copy source descriptor: $name$."; +}; +String STR_CTW_ERROR_NO_QUERY +{ + Text [ en-US ] = "To copy a query, your connection must be able to provide queries."; +}; +String STR_CTW_ERROR_INVALID_INTERACTIONHANDLER +{ + Text [ en-US ] = "The given interaction handler is invalid."; +}; -- cgit v1.2.3 From 4bf7a83912dce2dd3832236900e52fff62f4b085 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Fri, 27 Nov 2009 13:38:56 +0100 Subject: #i95011# - no more unneeded PROPFINDs, caused by ucb getPropertyValues command. Handling of compressed streams now completely handled by UCB. --- extensions/source/update/feed/makefile.mk | 16 +-- extensions/source/update/feed/updatefeed.cxx | 197 +-------------------------- 2 files changed, 12 insertions(+), 201 deletions(-) diff --git a/extensions/source/update/feed/makefile.mk b/extensions/source/update/feed/makefile.mk index ecb5957df9b7..30f0fdeb00a8 100644 --- a/extensions/source/update/feed/makefile.mk +++ b/extensions/source/update/feed/makefile.mk @@ -1,7 +1,7 @@ #************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# +# # Copyright 2008 by Sun Microsystems, Inc. # # OpenOffice.org - a multi-platform office productivity suite @@ -43,27 +43,21 @@ ENABLE_EXCEPTIONS=TRUE # no "lib" prefix DLLPRE = -.IF "$(SYSTEM_ZLIB)" == "YES" -CFLAGS+=-DSYSTEM_ZLIB -.ENDIF - # --- Files --- - SLOFILES=\ $(SLO)$/updatefeed.obj \ - + SHL1NOCHECK=TRUE -SHL1TARGET=$(TARGET).uno +SHL1TARGET=$(TARGET).uno SHL1OBJS=$(SLOFILES) SHL1IMPLIB=i$(SHL1TARGET) SHL1STDLIBS= \ $(CPPUHELPERLIB) \ $(CPPULIB) \ - $(SALLIB) \ - $(ZLIB3RDLIB) - + $(SALLIB) + SHL1VERSIONMAP=..$/exports.map SHL1DEF=$(MISC)$/$(SHL1TARGET).def DEF1NAME=$(SHL1TARGET) diff --git a/extensions/source/update/feed/updatefeed.cxx b/extensions/source/update/feed/updatefeed.cxx index 44b9732a7b5b..58d785d36982 100644 --- a/extensions/source/update/feed/updatefeed.cxx +++ b/extensions/source/update/feed/updatefeed.cxx @@ -64,14 +64,6 @@ #include #include -#ifndef _ZLIB_H -#ifdef SYSTEM_ZLIB -#include "zlib.h" -#else -#include "zlib/zlib.h" -#endif -#endif - namespace beans = com::sun::star::beans ; namespace container = com::sun::star::container ; namespace deployment = com::sun::star::deployment ; @@ -104,14 +96,14 @@ public: throw (io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException) { sal_Int32 n = m_xStream->readBytes(aData, nBytesToRead); - OSL_TRACE( aData.get()->elements ); + OSL_TRACE( "\n %s", aData.get()->elements ); return n; }; virtual sal_Int32 SAL_CALL readSomeBytes(uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead) throw (io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException) { sal_Int32 n = m_xStream->readSomeBytes(aData, nMaxBytesToRead); - OSL_TRACE( aData.get()->elements ); + OSL_TRACE( "\n %s", aData.get()->elements ); return n; }; virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip ) @@ -149,148 +141,6 @@ public: //------------------------------------------------------------------------------ -class InflateInputStream : public ::cppu::WeakImplHelper1< io::XInputStream > -{ - uno::Reference< io::XInputStream > m_xStream; - - uno::Sequence < sal_Int8 > m_aBuffer; - sal_Int32 m_nOffset; - bool m_bRead; - - rtl::OUString m_aContentEncoding; - - void readIntoMemory(); - -public: - InflateInputStream(const uno::Reference< io::XInputStream >& rxStream,const rtl::OUString& rContentEncoding) : - m_xStream(rxStream), m_nOffset(0), m_bRead(false), m_aContentEncoding(rContentEncoding) {}; - - virtual sal_Int32 SAL_CALL readBytes(uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead) - throw (io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException); - virtual sal_Int32 SAL_CALL readSomeBytes(uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead) - throw (io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException) - { readIntoMemory(); return readBytes(aData, nMaxBytesToRead ); }; - virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip ) - throw (io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException) - { - readIntoMemory(); - if( m_nOffset + nBytesToSkip < m_aBuffer.getLength() ) - m_nOffset += nBytesToSkip; - else - m_nOffset = m_aBuffer.getLength(); - }; - virtual sal_Int32 SAL_CALL available() - throw (io::NotConnectedException, io::IOException, uno::RuntimeException) - { readIntoMemory(); return m_aBuffer.getLength() - m_nOffset; }; - virtual void SAL_CALL closeInput( ) - throw (io::NotConnectedException, io::IOException, uno::RuntimeException) - { m_xStream->closeInput(); }; -}; - - -sal_Int32 SAL_CALL -InflateInputStream::readBytes(uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead) - throw (io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException) -{ - readIntoMemory(); - sal_Int32 nAvailable = available(); - sal_Int32 nBytesToCopy = nAvailable < nBytesToRead ? nAvailable : nBytesToRead; - if( nBytesToCopy > 0 ) - { - aData.realloc(nBytesToCopy); - rtl_copyMemory(aData.getArray(), m_aBuffer.getConstArray() + m_nOffset, nBytesToCopy); - m_nOffset += nBytesToCopy; - } - - return nBytesToCopy; -}; - -void InflateInputStream::readIntoMemory() -{ - if( !m_bRead && m_xStream.is() ) - { - const sal_Int32 nBytesRequested = 4096; - - uno::Sequence < sal_Int8 > aTempBuffer(nBytesRequested); - uno::Sequence < sal_Int8 > aCompressedBuffer; - sal_Int32 nBytesRead; - - m_bRead = true; - - do - { - nBytesRead = m_xStream->readBytes(aTempBuffer, nBytesRequested); - - if( nBytesRead > 0 ) - { - sal_Int32 nOffset = aCompressedBuffer.getLength(); - aCompressedBuffer.realloc( nOffset + nBytesRead ); - - rtl_copyMemory(aCompressedBuffer.getArray() + nOffset, aTempBuffer.getConstArray(), nBytesRead); - } - } - while( nBytesRead == nBytesRequested ); - - z_stream *pStream = new z_stream; - /* memset to 0 to set zalloc/opaque etc */ - rtl_zeroMemory (pStream, sizeof(*pStream)); - - int windowSize = 15; - int headerOffset = 0; - - if( m_aContentEncoding.equalsAscii("gzip") ) - { - sal_uInt8 magic[2]; - magic[0] = *((sal_uInt8 *) aCompressedBuffer.getConstArray()); - magic[1] = *((sal_uInt8 *) aCompressedBuffer.getConstArray() + 1); - - if( (magic[0] == 0x1f) && (magic[1] == 0x8b) ) - { - windowSize = -14; - headerOffset = 10; - } - } - - pStream->next_in = (unsigned char *) aCompressedBuffer.getConstArray(); - pStream->avail_in = aCompressedBuffer.getLength(); - - pStream->next_in += headerOffset; - pStream->avail_in -= headerOffset; - - if( Z_OK == inflateInit2(pStream, windowSize) ) - { - int result; - - do - { - sal_Int32 nOffset = m_aBuffer.getLength(); - m_aBuffer.realloc(nOffset + 4096); - - pStream->next_out = reinterpret_cast < unsigned char* > ( m_aBuffer.getArray() + nOffset ); - pStream->avail_out = 4096; - - result = ::inflate(pStream, Z_FINISH); - - if( result == Z_STREAM_END ) - break; - - } while( result == Z_BUF_ERROR ); - - inflateEnd(pStream); - m_aBuffer.realloc(pStream->total_out); - - } - - if (pStream != NULL) - { - delete pStream; - pStream = NULL; - } - } -} - -//------------------------------------------------------------------------------ - class UpdateInformationProvider : public ::cppu::WeakImplHelper4< deployment::XUpdateInformationProvider, ucb::XCommandEnvironment, @@ -486,7 +336,7 @@ UpdateInformationProvider::UpdateInformationProvider( const uno::Reference< xml::xpath::XXPathAPI >& xXPathAPI ) : m_xContext(xContext), m_xContentIdFactory(xContentIdFactory), m_xContentProvider(xContentProvider), m_xDocumentBuilder(xDocumentBuilder), - m_xXPathAPI(xXPathAPI), m_aRequestHeaderList(2) + m_xXPathAPI(xXPathAPI), m_aRequestHeaderList(1) { uno::Reference< lang::XMultiComponentFactory > xServiceManager(xContext->getServiceManager()); if( !xServiceManager.is() ) @@ -563,14 +413,11 @@ UpdateInformationProvider::UpdateInformationProvider( m_aRequestHeaderList[0].Name = UNISTRING("Accept-Language"); m_aRequestHeaderList[0].Value = getConfigurationItem( xConfigurationProvider, UNISTRING("org.openoffice.Setup/L10N"), UNISTRING("ooLocale") ); - m_aRequestHeaderList[1].Name = UNISTRING("Accept-Encoding"); - m_aRequestHeaderList[1].Value = uno::makeAny( UNISTRING("gzip,deflate") ); - if( aUserAgent.getLength() > 0 ) { - m_aRequestHeaderList.realloc(3); - m_aRequestHeaderList[2].Name = UNISTRING("User-Agent"); - m_aRequestHeaderList[2].Value = uno::makeAny(aUserAgent); + m_aRequestHeaderList.realloc(2); + m_aRequestHeaderList[1].Name = UNISTRING("User-Agent"); + m_aRequestHeaderList[1].Value = uno::makeAny(aUserAgent); } } @@ -684,43 +531,13 @@ UpdateInformationProvider::load(const rtl::OUString& rURL) throw; } - - uno::Sequence< beans::Property > aProps( 1 ); - aProps[0].Name = UNISTRING( "Content-Encoding" ); - - aCommand.Name = UNISTRING("getPropertyValues"); - aCommand.Argument = uno::makeAny( aProps ); - - sal_Bool bCompressed = sal_False; - rtl::OUString aContentEncoding; - - try - { - uno::Any aResult = xCommandProcessor->execute(aCommand, 0, - static_cast < XCommandEnvironment *> (this)); - uno::Reference< sdbc::XRow > xPropList( aResult, uno::UNO_QUERY ); - if ( xPropList.is() ) { - aContentEncoding = xPropList->getString(1); - if( aContentEncoding.equalsAscii("gzip") || aContentEncoding.equalsAscii("deflate")) - bCompressed = sal_True; - } - } - catch( const uno::Exception &e ) - { - OSL_TRACE( "Caught exception: %s\n", - rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr() ); - } - storeCommandInfo(0, uno::Reference< ucb::XCommandProcessor > ()); uno::Reference< ucb::XCommandProcessor2 > xCommandProcessor2(xCommandProcessor, uno::UNO_QUERY); if( xCommandProcessor2.is() ) xCommandProcessor2->releaseCommandIdentifier(nCommandId); - if ( bCompressed ) - return INPUT_STREAM( new InflateInputStream( aSink->getInputStream(), aContentEncoding ) ); - else - return INPUT_STREAM(aSink->getInputStream()); + return INPUT_STREAM(aSink->getInputStream()); } //------------------------------------------------------------------------------ -- cgit v1.2.3 From 86948be8f2238cac7b28e4304836185a9e4163fd Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Fri, 27 Nov 2009 13:48:22 +0100 Subject: #i107150# - new: Ability to handle compressed (gzip) responses. --- ucb/source/ucp/webdav/NeonSession.cxx | 7 ++++++- ucb/source/ucp/webdav/makefile.mk | 9 +++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ucb/source/ucp/webdav/NeonSession.cxx b/ucb/source/ucp/webdav/NeonSession.cxx index 59471c6cf0c1..bf08771ba7ce 100644 --- a/ucb/source/ucp/webdav/NeonSession.cxx +++ b/ucb/source/ucp/webdav/NeonSession.cxx @@ -40,6 +40,7 @@ #include #include #include +#include #include "libxml/parser.h" #include "rtl/ustrbuf.hxx" #include "comphelper/sequence.hxx" @@ -1949,7 +1950,8 @@ int NeonSession::GET( ne_session * sess, ne_add_response_header_catcher( req, runResponseHeaderHandler, userdata ); #endif - ne_add_response_body_reader( req, ne_accept_2xx, reader, userdata ); + ne_decompress * dc + = ne_decompress_reader( req, ne_accept_2xx, reader, userdata ); ret = ne_request_dispatch( req ); @@ -1969,6 +1971,9 @@ int NeonSession::GET( ne_session * sess, if ( ret == NE_OK && ne_get_status( req )->klass != 2 ) ret = NE_ERROR; + if ( dc != 0 ) + ne_decompress_destroy(dc); + ne_request_destroy( req ); return ret; } diff --git a/ucb/source/ucp/webdav/makefile.mk b/ucb/source/ucp/webdav/makefile.mk index 1b4265a74559..9756327c416f 100644 --- a/ucb/source/ucp/webdav/makefile.mk +++ b/ucb/source/ucp/webdav/makefile.mk @@ -1,7 +1,7 @@ #************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# +# # Copyright 2008 by Sun Microsystems, Inc. # # OpenOffice.org - a multi-platform office productivity suite @@ -127,9 +127,8 @@ SHL1STDLIBS=\ $(UCBHELPERLIB) \ $(COMPHELPERLIB) \ $(NEON3RDLIB) \ - $(LIBXML2LIB) - - + $(LIBXML2LIB) \ + $(ZLIB3RDLIB) .IF "$(GUI)"=="WNT" SHL1STDLIBS+= $(WSOCK32LIB) @@ -151,8 +150,6 @@ SHL1STDLIBS+= $(OPENSSLLIBST) .ENDIF .ENDIF # WNT - - SHL1DEF=$(MISC)$/$(SHL1TARGET).def SHL1LIBS=$(LIB1TARGET) -- cgit v1.2.3 From 7e18ce5d10a108b74695e359e3462603d015a170 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Fri, 27 Nov 2009 13:48:22 +0100 Subject: #i107150# - new: Ability to handle compressed (gzip) responses. --- neon/makefile.mk | 5 +++-- neon/neon.patch | 63 ++++++++++++++++++++++++++++---------------------------- 2 files changed, 35 insertions(+), 33 deletions(-) diff --git a/neon/makefile.mk b/neon/makefile.mk index 247e640ce8b1..f25fefd69935 100644 --- a/neon/makefile.mk +++ b/neon/makefile.mk @@ -1,7 +1,7 @@ #************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# +# # Copyright 2008 by Sun Microsystems, Inc. # # OpenOffice.org - a multi-platform office productivity suite @@ -55,8 +55,8 @@ NEON_NAME=neon-0.28.2 TARFILE_NAME=$(NEON_NAME) PATCH_FILES=neon.patch ADDITIONAL_FILES=src$/makefile.mk src$/config.h src$/ne_ntlm.h src$/ne_ntlm.c - BUILD_DIR=src + BUILD_ACTION=dmake $(MFLAGS) $(CALLMACROS) OUT2INC= \ @@ -64,6 +64,7 @@ OUT2INC= \ $(BUILD_DIR)$/ne_alloc.h \ $(BUILD_DIR)$/ne_auth.h \ $(BUILD_DIR)$/ne_basic.h \ + $(BUILD_DIR)$/ne_compress.h \ $(BUILD_DIR)$/ne_defs.h \ $(BUILD_DIR)$/ne_locks.h \ $(BUILD_DIR)$/ne_props.h \ diff --git a/neon/neon.patch b/neon/neon.patch index f6725d71edb4..59924a9a605b 100644 --- a/neon/neon.patch +++ b/neon/neon.patch @@ -1,5 +1,5 @@ ---- misc/neon-0.28.2/src/config.h 2009-11-19 21:17:19.000000000 +0100 -+++ misc/build/neon-0.28.2/src/config.h 2009-11-18 09:06:10.000000000 +0100 +--- misc/neon-0.28.2/src/config.h 2009-11-26 23:47:06.000000000 +0100 ++++ misc/build/neon-0.28.2/src/config.h 2009-11-26 23:46:21.000000000 +0100 @@ -1 +1,488 @@ -dummy + @@ -22,7 +22,7 @@ + +/* Define to 1 if you have the declaration of `h_errno', and to 0 if you + don't. */ -+#ifdef WIN32 ++#ifdef WIN32 +#define HAVE_DECL_H_ERRNO 1 +#endif + @@ -132,14 +132,14 @@ +#endif + +/* Define if OpenSSL support is enabled */ -+/* #undef HAVE_OPENSSL */ -+#define HAVE_OPENSSL ++#define HAVE_OPENSSL 1 ++ +/* Define to 1 if you have the header file. */ -+/* #undef HAVE_OPENSSL_OPENSSLV_H */ +#define HAVE_OPENSSL_OPENSSLV_H 1 ++ +/* Define to 1 if you have the header file. */ -+/* #undef HAVE_OPENSSL_SSL_H */ +#define HAVE_OPENSSL_SSL_H 1 ++ +/* Define to 1 if you have the `pipe' function. */ +#define HAVE_PIPE 1 + @@ -340,13 +340,13 @@ +/* #undef NE_HAVE_SOCKS */ + +/* Defined if SSL is supported */ -+/* #undef NE_HAVE_SSL */ +#define NE_HAVE_SSL ++ +/* Defined if TS_SSL is supported */ +/* #undef NE_HAVE_TS_SSL */ + +/* Defined if ZLIB is supported */ -+/* #undef NE_HAVE_ZLIB */ ++#define NE_HAVE_ZLIB 1 + +/* Define to be filename of an SSL CA root bundle */ +/* #undef NE_SSL_CA_BUNDLE */ @@ -475,13 +475,13 @@ + +#define HAVE_MEMCPY 1 + -+#define strncasecmp strnicmp ++#define strncasecmp strnicmp +#define inline __inline +#define WIN32_LEAN_AND_MEAN +#define NOUSER +#define NOGDI +#define NONLS -+#define NOCRYPT ++#define NOCRYPT + +#endif + @@ -490,9 +490,9 @@ +#else +#define HAVE_NTLM 1 +#endif ---- misc/neon-0.28.2/src/makefile.mk 2009-11-19 21:17:19.000000000 +0100 -+++ misc/build/neon-0.28.2/src/makefile.mk 2009-11-18 09:06:10.000000000 +0100 -@@ -1 +1,59 @@ +--- misc/neon-0.28.2/src/makefile.mk 2009-11-26 23:47:06.000000000 +0100 ++++ misc/build/neon-0.28.2/src/makefile.mk 2009-11-26 23:44:12.000000000 +0100 +@@ -1 +1,60 @@ -dummy +PRJ=..$/..$/..$/..$/.. + @@ -511,9 +511,10 @@ + +.IF "$(SYSTEM_LIBXML)" == "YES" +CFLAGS+=-DSYSTEM_LIBXML $(LIBXML_CFLAGS) ++.ELSE ++CFLAGS+=-I$(SOLARINCDIR)$/external$/zlib +.ENDIF + -+ +SLOFILES= \ + $(SLO)$/ne_207.obj \ + $(SLO)$/ne_acl.obj \ @@ -544,7 +545,7 @@ +.ENDIF + +# $(SLO)$/ne_gnutls.obj \ -+# $(SLO)$/ne_stubssl.obj ++# $(SLO)$/ne_stubssl.obj + +LIB1TARGET=$(SLB)$/$(TARGET).lib +LIB1ARCHIV=$(LB)$/lib$(TARGET).a @@ -554,7 +555,7 @@ + +.INCLUDE : target.mk --- misc/neon-0.28.2/src/ne_auth.c 2008-02-29 17:30:12.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_auth.c 2009-11-19 21:12:52.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_auth.c 2009-11-26 23:41:57.000000000 +0100 @@ -77,6 +77,10 @@ #include "ne_sspi.h" #endif @@ -718,7 +719,7 @@ return ret; } --- misc/neon-0.28.2/src/ne_auth.h 2007-12-05 17:39:58.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_auth.h 2009-11-18 09:06:10.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_auth.h 2009-11-26 23:41:57.000000000 +0100 @@ -47,8 +47,8 @@ * Hint: if you just wish to attempt authentication just once (even if * the user gets the username/password wrong), have the callback @@ -731,7 +732,7 @@ /* Set callbacks to provide credentials for server and proxy * authentication, using the default set of authentication protocols. --- misc/neon-0.28.2/src/ne_defs.h 2006-10-24 21:40:09.000000000 +0200 -+++ misc/build/neon-0.28.2/src/ne_defs.h 2009-11-18 09:06:10.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_defs.h 2009-11-26 23:41:57.000000000 +0100 @@ -41,7 +41,7 @@ #endif @@ -742,7 +743,7 @@ #endif --- misc/neon-0.28.2/src/ne_locks.c 2007-02-05 11:09:27.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_locks.c 2009-11-18 09:06:10.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_locks.c 2009-11-26 23:41:57.000000000 +0100 @@ -579,6 +579,23 @@ const char *token = ne_get_response_header(ctx->req, "Lock-Token"); /* at the root element; retrieve the Lock-Token header, @@ -810,7 +811,7 @@ } } --- misc/neon-0.28.2/src/ne_locks.h 2006-01-02 12:43:19.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_locks.h 2009-11-18 09:06:10.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_locks.h 2009-11-26 23:41:57.000000000 +0100 @@ -22,6 +22,10 @@ #ifndef NE_LOCKS_H #define NE_LOCKS_H @@ -822,8 +823,8 @@ #include "ne_request.h" /* for ne_session + ne_request */ #include "ne_uri.h" /* for ne_uri */ ---- misc/neon-0.28.2/src/ne_ntlm.c 2009-11-19 21:17:19.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_ntlm.c 2009-11-19 21:15:00.000000000 +0100 +--- misc/neon-0.28.2/src/ne_ntlm.c 2009-11-26 23:47:06.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_ntlm.c 2009-11-26 23:41:57.000000000 +0100 @@ -1 +1,703 @@ -dummy +/* @@ -1529,8 +1530,8 @@ + +#endif /* HAVE_OPENSSL */ +#endif /* HAVE_NTLM */ ---- misc/neon-0.28.2/src/ne_ntlm.h 2009-11-19 21:17:19.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_ntlm.h 2009-11-18 09:06:10.000000000 +0100 +--- misc/neon-0.28.2/src/ne_ntlm.h 2009-11-26 23:47:06.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_ntlm.h 2009-11-26 23:41:57.000000000 +0100 @@ -1 +1,44 @@ -dummy +/* @@ -1578,7 +1579,7 @@ + +#endif /* NE_NTLM_H */ --- misc/neon-0.28.2/src/ne_socket.c 2008-02-28 14:19:19.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_socket.c 2009-11-18 09:06:10.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_socket.c 2009-11-26 23:41:57.000000000 +0100 @@ -60,6 +60,7 @@ #include #ifdef USE_GETADDRINFO @@ -1588,7 +1589,7 @@ #endif --- misc/neon-0.28.2/src/ne_sspi.c 2007-08-10 17:26:08.000000000 +0200 -+++ misc/build/neon-0.28.2/src/ne_sspi.c 2009-11-18 09:06:10.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_sspi.c 2009-11-26 23:41:57.000000000 +0100 @@ -202,9 +202,48 @@ return -1; } @@ -1679,7 +1680,7 @@ securityStatus = initializeSecurityContext(&sspiContext->credentials, NULL, --- misc/neon-0.28.2/src/ne_sspi.h 2006-02-12 13:05:14.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_sspi.h 2009-11-18 09:06:10.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_sspi.h 2009-11-26 23:41:57.000000000 +0100 @@ -41,7 +41,7 @@ int ne_sspi_clear_context(void *context); @@ -1690,7 +1691,7 @@ #endif /* HAVE_SSPI */ --- misc/neon-0.28.2/src/ne_uri.c 2007-12-05 12:04:47.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_uri.c 2009-11-18 09:06:10.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_uri.c 2009-11-26 23:41:57.000000000 +0100 @@ -42,7 +42,7 @@ #include "ne_alloc.h" #include "ne_uri.h" @@ -1737,7 +1738,7 @@ /* 4x */ AT, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, /* 5x */ AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, GD, OT, GD, OT, US, --- misc/neon-0.28.2/src/ne_utils.c 2006-03-07 10:36:43.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_utils.c 2009-11-18 09:06:10.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_utils.c 2009-11-26 23:41:57.000000000 +0100 @@ -118,6 +118,9 @@ #ifdef HAVE_GNUTLS ", GNU TLS " LIBGNUTLS_VERSION @@ -1768,7 +1769,7 @@ #endif /* NE_HAVE_* */ default: --- misc/neon-0.28.2/src/ne_utils.h 2007-07-16 08:54:57.000000000 +0200 -+++ misc/build/neon-0.28.2/src/ne_utils.h 2009-11-18 09:06:10.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_utils.h 2009-11-26 23:41:57.000000000 +0100 @@ -54,6 +54,7 @@ #define NE_FEATURE_SOCKS (5) /* SOCKSv5 support */ #define NE_FEATURE_TS_SSL (6) /* Thread-safe SSL/TLS support */ -- cgit v1.2.3 From dc5c1da812d3feecd465cf81506d1bea82b7c6c8 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 27 Nov 2009 13:54:10 +0100 Subject: vcl108: #i107260# clipboard shutdown (thanks cmc) --- vcl/unx/source/dtrans/X11_dndcontext.cxx | 12 +- vcl/unx/source/dtrans/X11_dndcontext.hxx | 20 ++-- vcl/unx/source/dtrans/X11_selection.cxx | 192 +++++++++++++++++++++---------- vcl/unx/source/dtrans/X11_selection.hxx | 100 +++++++++------- vcl/unx/source/dtrans/bmp.cxx | 2 +- vcl/unx/source/dtrans/bmp.hxx | 2 + vcl/util/makefile.mk | 1 + 7 files changed, 209 insertions(+), 120 deletions(-) diff --git a/vcl/unx/source/dtrans/X11_dndcontext.cxx b/vcl/unx/source/dtrans/X11_dndcontext.cxx index 59832c27c2a7..71aebde5b7af 100644 --- a/vcl/unx/source/dtrans/X11_dndcontext.cxx +++ b/vcl/unx/source/dtrans/X11_dndcontext.cxx @@ -42,8 +42,8 @@ using namespace x11; */ DropTargetDropContext::DropTargetDropContext( - Window aDropWindow, - Time aTimestamp, + XLIB_Window aDropWindow, + XLIB_Time aTimestamp, SelectionManager& rManager ) : m_aDropWindow( aDropWindow ), m_nTimestamp( aTimestamp ), @@ -77,8 +77,8 @@ void DropTargetDropContext::dropComplete( sal_Bool success ) throw() */ DropTargetDragContext::DropTargetDragContext( - Window aDropWindow, - Time aTimestamp, + XLIB_Window aDropWindow, + XLIB_Time aTimestamp, SelectionManager& rManager ) : m_aDropWindow( aDropWindow ), m_nTimestamp( aTimestamp ), @@ -106,8 +106,8 @@ void DropTargetDragContext::rejectDrag() throw() */ DragSourceContext::DragSourceContext( - Window aDropWindow, - Time aTimestamp, + XLIB_Window aDropWindow, + XLIB_Time aTimestamp, SelectionManager& rManager ) : m_aDropWindow( aDropWindow ), m_nTimestamp( aTimestamp ), diff --git a/vcl/unx/source/dtrans/X11_dndcontext.hxx b/vcl/unx/source/dtrans/X11_dndcontext.hxx index f2ecb7b0841b..3626b86d8617 100644 --- a/vcl/unx/source/dtrans/X11_dndcontext.hxx +++ b/vcl/unx/source/dtrans/X11_dndcontext.hxx @@ -36,7 +36,9 @@ #include #include +#include "tools/prex.h" #include +#include "tools/postx.h" using namespace com::sun::star::uno; @@ -49,12 +51,12 @@ namespace x11 { ::com::sun::star::datatransfer::dnd::XDropTargetDropContext > { - Window m_aDropWindow; - Time m_nTimestamp; + XLIB_Window m_aDropWindow; + XLIB_Time m_nTimestamp; SelectionManager& m_rManager; Reference< XInterface > m_xManagerRef; public: - DropTargetDropContext( Window, Time, SelectionManager& ); + DropTargetDropContext( XLIB_Window, XLIB_Time, SelectionManager& ); virtual ~DropTargetDropContext(); // XDropTargetDropContext @@ -68,12 +70,12 @@ namespace x11 { ::com::sun::star::datatransfer::dnd::XDropTargetDragContext > { - Window m_aDropWindow; - Time m_nTimestamp; + XLIB_Window m_aDropWindow; + XLIB_Time m_nTimestamp; SelectionManager& m_rManager; Reference< XInterface > m_xManagerRef; public: - DropTargetDragContext( Window, Time, SelectionManager& ); + DropTargetDragContext( XLIB_Window, XLIB_Time, SelectionManager& ); virtual ~DropTargetDragContext(); // XDropTargetDragContext @@ -86,12 +88,12 @@ namespace x11 { ::com::sun::star::datatransfer::dnd::XDragSourceContext > { - Window m_aDropWindow; - Time m_nTimestamp; + XLIB_Window m_aDropWindow; + XLIB_Time m_nTimestamp; SelectionManager& m_rManager; Reference< XInterface > m_xManagerRef; public: - DragSourceContext( Window, Time, SelectionManager& ); + DragSourceContext( XLIB_Window, XLIB_Time, SelectionManager& ); virtual ~DragSourceContext(); // XDragSourceContext diff --git a/vcl/unx/source/dtrans/X11_selection.cxx b/vcl/unx/source/dtrans/X11_selection.cxx index c6036ae4f78e..07f2cfd5e087 100644 --- a/vcl/unx/source/dtrans/X11_selection.cxx +++ b/vcl/unx/source/dtrans/X11_selection.cxx @@ -35,11 +35,13 @@ #include #include #include +#include "tools/prex.h" #include #include #include #include #include +#include "tools/postx.h" #if defined(LINUX) || defined(NETBSD) || defined (FREEBSD) #include #else @@ -53,6 +55,8 @@ #include #include +#include "vcl/svapp.hxx" + // pointer bitmaps #include #include @@ -66,9 +70,9 @@ #include #include #include -#ifndef OSL_PROCESS_H #include -#endif + +#include #define DRAG_EVENT_MASK ButtonPressMask |\ ButtonReleaseMask |\ @@ -81,6 +85,7 @@ using namespace com::sun::star::datatransfer::dnd; using namespace com::sun::star::lang; using namespace com::sun::star::awt; using namespace com::sun::star::uno; +using namespace com::sun::star::frame; using namespace cppu; using namespace osl; using namespace rtl; @@ -280,7 +285,7 @@ SelectionManager::SelectionManager() : m_aDragRunning.reset(); } -Cursor SelectionManager::createCursor( const char* pPointerData, const char* pMaskData, int width, int height, int hotX, int hotY ) +XLIB_Cursor SelectionManager::createCursor( const char* pPointerData, const char* pMaskData, int width, int height, int hotX, int hotY ) { Pixmap aPointer; Pixmap aMask; @@ -306,7 +311,7 @@ Cursor SelectionManager::createCursor( const char* pPointerData, const char* pMa pMaskData, width, height ); - Cursor aCursor = + XLIB_Cursor aCursor = XCreatePixmapCursor( m_pDisplay, aPointer, aMask, &aBlack, &aWhite, hotX, @@ -928,7 +933,7 @@ bool SelectionManager::getPasteData( Atom selection, Atom type, Sequence< sal_In if( it == m_aSelections.end() ) return false; - Window aSelectionOwner = XGetSelectionOwner( m_pDisplay, selection ); + XLIB_Window aSelectionOwner = XGetSelectionOwner( m_pDisplay, selection ); if( aSelectionOwner == None ) return false; if( aSelectionOwner == m_aWindow ) @@ -1480,7 +1485,7 @@ static sal_Size GetTrueFormatSize(int nFormat) } bool SelectionManager::sendData( SelectionAdaptor* pAdaptor, - Window requestor, + XLIB_Window requestor, Atom target, Atom property, Atom selection ) @@ -1587,7 +1592,7 @@ bool SelectionManager::sendData( SelectionAdaptor* pAdaptor, { #if OSL_DEBUG_LEVEL > 1 fprintf( stderr, "using INCR protocol\n" ); - std::hash_map< Window, std::hash_map< Atom, IncrementalTransfer > >::const_iterator win_it = m_aIncrementals.find( requestor ); + std::hash_map< XLIB_Window, std::hash_map< Atom, IncrementalTransfer > >::const_iterator win_it = m_aIncrementals.find( requestor ); if( win_it != m_aIncrementals.end() ) { std::hash_map< Atom, IncrementalTransfer >::const_iterator inc_it = win_it->second.find( property ); @@ -1986,7 +1991,7 @@ bool SelectionManager::handleSendPropertyNotify( XPropertyEvent& rNotify ) // feed incrementals if( rNotify.state == PropertyDelete ) { - std::hash_map< Window, std::hash_map< Atom, IncrementalTransfer > >::iterator it; + std::hash_map< XLIB_Window, std::hash_map< Atom, IncrementalTransfer > >::iterator it; it = m_aIncrementals.find( rNotify.window ); if( it != m_aIncrementals.end() ) { @@ -2168,12 +2173,12 @@ bool SelectionManager::handleDropEvent( XClientMessageEvent& rMessage ) ResettableMutexGuard aGuard(m_aMutex); // handle drop related events - Window aSource = rMessage.data.l[0]; - Window aTarget = rMessage.window; + XLIB_Window aSource = rMessage.data.l[0]; + XLIB_Window aTarget = rMessage.window; bool bHandled = false; - ::std::hash_map< Window, DropTargetEntry >::iterator it = + ::std::hash_map< XLIB_Window, DropTargetEntry >::iterator it = m_aDropTargets.find( aTarget ); #if OSL_DEBUG_LEVEL > 1 @@ -2187,7 +2192,7 @@ bool SelectionManager::handleDropEvent( XClientMessageEvent& rMessage ) fprintf( stderr, "but no target found\n" ); else if( ! it->second.m_pTarget->m_bActive ) fprintf( stderr, "but target is inactive\n" ); - else if( m_aDropEnterEvent.data.l[0] != None && (Window)m_aDropEnterEvent.data.l[0] != aSource ) + else if( m_aDropEnterEvent.data.l[0] != None && (XLIB_Window)m_aDropEnterEvent.data.l[0] != aSource ) fprintf( stderr, "but source 0x%lx is unknown (expected 0x%lx or 0)\n", aSource, m_aDropEnterEvent.data.l[0] ); else fprintf( stderr, "processing.\n" ); @@ -2208,7 +2213,7 @@ bool SelectionManager::handleDropEvent( XClientMessageEvent& rMessage ) if( it != m_aDropTargets.end() && it->second.m_pTarget->m_bActive && - ( m_aDropEnterEvent.data.l[0] == None || Window(m_aDropEnterEvent.data.l[0]) == aSource ) + ( m_aDropEnterEvent.data.l[0] == None || XLIB_Window(m_aDropEnterEvent.data.l[0]) == aSource ) ) { if( rMessage.message_type == m_nXdndEnter ) @@ -2224,7 +2229,7 @@ bool SelectionManager::handleDropEvent( XClientMessageEvent& rMessage ) } else if( rMessage.message_type == m_nXdndPosition && - aSource == Window(m_aDropEnterEvent.data.l[0]) + aSource == XLIB_Window(m_aDropEnterEvent.data.l[0]) ) { bHandled = true; @@ -2232,7 +2237,7 @@ bool SelectionManager::handleDropEvent( XClientMessageEvent& rMessage ) if( ! m_bDropEnterSent ) m_nDropTimestamp = m_nDropTime; - Window aChild; + XLIB_Window aChild; XTranslateCoordinates( m_pDisplay, it->second.m_aRootWindow, it->first, @@ -2280,7 +2285,7 @@ bool SelectionManager::handleDropEvent( XClientMessageEvent& rMessage ) } else if( rMessage.message_type == m_nXdndLeave && - aSource == Window(m_aDropEnterEvent.data.l[0]) + aSource == XLIB_Window(m_aDropEnterEvent.data.l[0]) ) { bHandled = true; @@ -2298,7 +2303,7 @@ bool SelectionManager::handleDropEvent( XClientMessageEvent& rMessage ) } else if( rMessage.message_type == m_nXdndDrop && - aSource == Window(m_aDropEnterEvent.data.l[0]) + aSource == XLIB_Window(m_aDropEnterEvent.data.l[0]) ) { bHandled = true; @@ -2345,7 +2350,7 @@ bool SelectionManager::handleDropEvent( XClientMessageEvent& rMessage ) * methods for XDropTargetDropContext */ -void SelectionManager::dropComplete( sal_Bool bSuccess, Window aDropWindow, Time ) +void SelectionManager::dropComplete( sal_Bool bSuccess, XLIB_Window aDropWindow, XLIB_Time ) { ClearableMutexGuard aGuard(m_aMutex); @@ -2542,21 +2547,21 @@ bool SelectionManager::updateDragAction( int modifierState ) // ------------------------------------------------------------------------ -void SelectionManager::sendDropPosition( bool bForce, Time eventTime ) +void SelectionManager::sendDropPosition( bool bForce, XLIB_Time eventTime ) { ClearableMutexGuard aGuard(m_aMutex); if( m_bDropSent ) return; - ::std::hash_map< Window, DropTargetEntry >::const_iterator it = + ::std::hash_map< XLIB_Window, DropTargetEntry >::const_iterator it = m_aDropTargets.find( m_aDropWindow ); if( it != m_aDropTargets.end() ) { if( it->second.m_pTarget->m_bActive ) { int x, y; - Window aChild; + XLIB_Window aChild; XTranslateCoordinates( m_pDisplay, it->second.m_aRootWindow, m_aDropWindow, m_nLastDragX, m_nLastDragY, &x, &y, &aChild ); DropTargetDragEvent dtde; dtde.Source = static_cast< OWeakObject* >(it->second.m_pTarget ); @@ -2612,7 +2617,7 @@ bool SelectionManager::handleDragEvent( XEvent& rMessage ) bool bHandled = false; // for shortcut - ::std::hash_map< Window, DropTargetEntry >::const_iterator it = + ::std::hash_map< XLIB_Window, DropTargetEntry >::const_iterator it = m_aDropTargets.find( m_aDropWindow ); #if OSL_DEBUG_LEVEL > 1 switch( rMessage.type ) @@ -2635,7 +2640,7 @@ bool SelectionManager::handleDragEvent( XEvent& rMessage ) case ButtonRelease: fprintf( stderr, "handleDragEvent: ButtonRelease %d (m_nDragButton = %d)\n", rMessage.xbutton.button, m_nDragButton ); break; - case KeyPress: + case XLIB_KeyPress: fprintf( stderr, "handleDragEvent: KeyPress\n" ); break; case KeyRelease: @@ -2719,7 +2724,7 @@ bool SelectionManager::handleDragEvent( XEvent& rMessage ) bool bForce = false; int root_x = rMessage.type == MotionNotify ? rMessage.xmotion.x_root : rMessage.xcrossing.x_root; int root_y = rMessage.type == MotionNotify ? rMessage.xmotion.y_root : rMessage.xcrossing.y_root; - Window root = rMessage.type == MotionNotify ? rMessage.xmotion.root : rMessage.xcrossing.root; + XLIB_Window root = rMessage.type == MotionNotify ? rMessage.xmotion.root : rMessage.xcrossing.root; m_nDragTimestamp = rMessage.type == MotionNotify ? rMessage.xmotion.time : rMessage.xcrossing.time; aGuard.clear(); @@ -2736,7 +2741,7 @@ bool SelectionManager::handleDragEvent( XEvent& rMessage ) sendDropPosition( bForce, rMessage.type == MotionNotify ? rMessage.xmotion.time : rMessage.xcrossing.time ); } } - else if( rMessage.type == KeyPress || rMessage.type == KeyRelease ) + else if( rMessage.type == XLIB_KeyPress || rMessage.type == KeyRelease ) { bHandled = true; KeySym aKey = XKeycodeToKeysym( m_pDisplay, rMessage.xkey.keycode, 0 ); @@ -2793,7 +2798,7 @@ bool SelectionManager::handleDragEvent( XEvent& rMessage ) case XK_Control_L: nNewState = ControlMask;break; // just interested in shift and ctrl for dnd } - if( rMessage.type == KeyPress ) + if( rMessage.type == XLIB_KeyPress ) nState |= nNewState; else nState &= ~nNewState; @@ -2815,7 +2820,7 @@ bool SelectionManager::handleDragEvent( XEvent& rMessage ) { bHandled = true; int x, y; - Window aChild; + XLIB_Window aChild; XTranslateCoordinates( m_pDisplay, rMessage.xbutton.root, m_aDropWindow, rMessage.xbutton.x_root, rMessage.xbutton.y_root, &x, &y, &aChild ); DropTargetDropEvent dtde; dtde.Source = static_cast< OWeakObject* >(it->second.m_pTarget ); @@ -2865,7 +2870,7 @@ bool SelectionManager::handleDragEvent( XEvent& rMessage ) { bHandled = true; - Window aDummy; + XLIB_Window aDummy; XEvent aEvent; aEvent.type = ButtonPress; aEvent.xbutton.display = m_pDisplay; @@ -2924,7 +2929,7 @@ bool SelectionManager::handleDragEvent( XEvent& rMessage ) // ------------------------------------------------------------------------ -void SelectionManager::accept( sal_Int8 dragOperation, Window aDropWindow, Time ) +void SelectionManager::accept( sal_Int8 dragOperation, XLIB_Window aDropWindow, XLIB_Time ) { if( aDropWindow == m_aCurrentDropWindow ) { @@ -2946,7 +2951,7 @@ void SelectionManager::accept( sal_Int8 dragOperation, Window aDropWindow, Time // ------------------------------------------------------------------------ -void SelectionManager::reject( Window aDropWindow, Time ) +void SelectionManager::reject( XLIB_Window aDropWindow, XLIB_Time ) { if( aDropWindow == m_aCurrentDropWindow ) { @@ -2982,7 +2987,7 @@ sal_Bool SelectionManager::isDragImageSupported() throw() sal_Int32 SelectionManager::getDefaultCursor( sal_Int8 dragAction ) throw() { - Cursor aCursor = m_aNoneCursor; + XLIB_Cursor aCursor = m_aNoneCursor; if( dragAction & DNDConstants::ACTION_MOVE ) aCursor = m_aMoveCursor; else if( dragAction & DNDConstants::ACTION_COPY ) @@ -2994,7 +2999,7 @@ sal_Int32 SelectionManager::getDefaultCursor( sal_Int8 dragAction ) throw() // ------------------------------------------------------------------------ -int SelectionManager::getXdndVersion( Window aWindow, Window& rProxy ) +int SelectionManager::getXdndVersion( XLIB_Window aWindow, XLIB_Window& rProxy ) { Atom* pProperties = NULL; int nProperties = 0; @@ -3022,7 +3027,7 @@ int SelectionManager::getXdndVersion( Window aWindow, Window& rProxy ) if( pBytes ) { if( nType == XA_WINDOW ) - rProxy = *(Window*)pBytes; + rProxy = *(XLIB_Window*)pBytes; XFree( pBytes ); pBytes = NULL; if( rProxy != None ) @@ -3032,7 +3037,7 @@ int SelectionManager::getXdndVersion( Window aWindow, Window& rProxy ) &nType, &nFormat, &nItems, &nBytes, &pBytes ); if( pBytes ) { - if( nType == XA_WINDOW && *(Window*)pBytes != rProxy ) + if( nType == XA_WINDOW && *(XLIB_Window*)pBytes != rProxy ) rProxy = None; XFree( pBytes ); pBytes = NULL; @@ -3044,7 +3049,7 @@ int SelectionManager::getXdndVersion( Window aWindow, Window& rProxy ) break; } } - Window aAwareWindow = rProxy != None ? rProxy : aWindow; + XLIB_Window aAwareWindow = rProxy != None ? rProxy : aWindow; XGetWindowProperty( m_pDisplay, aAwareWindow, m_nXdndAware, 0, 1, False, XA_ATOM, &nType, &nFormat, &nItems, &nBytes, &pBytes ); @@ -3062,7 +3067,7 @@ int SelectionManager::getXdndVersion( Window aWindow, Window& rProxy ) // ------------------------------------------------------------------------ -void SelectionManager::updateDragWindow( int nX, int nY, Window aRoot ) +void SelectionManager::updateDragWindow( int nX, int nY, XLIB_Window aRoot ) { ResettableMutexGuard aGuard( m_aMutex ); @@ -3071,9 +3076,9 @@ void SelectionManager::updateDragWindow( int nX, int nY, Window aRoot ) m_nLastDragX = nX; m_nLastDragY = nY; - Window aParent = aRoot; - Window aChild; - Window aNewProxy = None, aNewCurrentWindow = None; + XLIB_Window aParent = aRoot; + XLIB_Window aChild; + XLIB_Window aNewProxy = None, aNewCurrentWindow = None; int nNewProtocolVersion = -1; int nWinX, nWinY; @@ -3114,7 +3119,7 @@ void SelectionManager::updateDragWindow( int nX, int nY, Window aRoot ) dsde.DropAction = nNewProtocolVersion >= 0 ? m_nUserDragAction : DNDConstants::ACTION_COPY; dsde.UserAction = nNewProtocolVersion >= 0 ? m_nUserDragAction : DNDConstants::ACTION_COPY; - ::std::hash_map< Window, DropTargetEntry >::const_iterator it; + ::std::hash_map< XLIB_Window, DropTargetEntry >::const_iterator it; if( aNewCurrentWindow != m_aDropWindow ) { #if OSL_DEBUG_LEVEL > 1 @@ -3263,11 +3268,11 @@ void SelectionManager::startDrag( // the pointer is located in. since said window should be one // of our DropTargets at the time of executeDrag we can use // them for a start - Window aRoot, aParent, aChild; + XLIB_Window aRoot, aParent, aChild; int root_x, root_y, win_x, win_y; unsigned int mask; - ::std::hash_map< Window, DropTargetEntry >::const_iterator it; + ::std::hash_map< XLIB_Window, DropTargetEntry >::const_iterator it; it = m_aDropTargets.begin(); while( it != m_aDropTargets.end() ) { @@ -3379,10 +3384,9 @@ void SelectionManager::startDrag( m_bDropSuccess = false; m_bWaitingForPrimaryConversion = false; m_nDragButton = Button1; // default to left button - if( trigger.Event.getValueTypeName().equalsAsciiL( "com.sun.star.awt.MouseEvent", 27 ) ) + com::sun::star::awt::MouseEvent aEvent; + if( trigger.Event >>= aEvent ) { - MouseEvent aEvent; - trigger.Event >>= aEvent; if( aEvent.Buttons & MouseButton::LEFT ) m_nDragButton = Button1; else if( aEvent.Buttons & MouseButton::RIGHT ) @@ -3519,10 +3523,10 @@ sal_Int32 SelectionManager::getCurrentCursor() // ------------------------------------------------------------------------ -void SelectionManager::setCursor( sal_Int32 cursor, Window aDropWindow, Time ) +void SelectionManager::setCursor( sal_Int32 cursor, XLIB_Window aDropWindow, XLIB_Time ) { MutexGuard aGuard( m_aMutex ); - if( aDropWindow == m_aDropWindow && Cursor(cursor) != m_aCurrentCursor ) + if( aDropWindow == m_aDropWindow && XLIB_Cursor(cursor) != m_aCurrentCursor ) { if( m_xDragSourceListener.is() && ! m_bDropSent ) { @@ -3535,7 +3539,7 @@ void SelectionManager::setCursor( sal_Int32 cursor, Window aDropWindow, Time ) // ------------------------------------------------------------------------ -void SelectionManager::setImage( sal_Int32, Window, Time ) +void SelectionManager::setImage( sal_Int32, XLIB_Window, XLIB_Time ) { } @@ -3668,7 +3672,7 @@ bool SelectionManager::handleXEvent( XEvent& rEvent ) case MotionNotify: case ButtonPress: case ButtonRelease: - case KeyPress: + case XLIB_KeyPress: case KeyRelease: bHandled = handleDragEvent( rEvent ); break; @@ -3734,6 +3738,14 @@ void SelectionManager::run( void* pThis ) timeval aLast; gettimeofday( &aLast, 0 ); + Reference< XMultiServiceFactory > xFact( ::comphelper::getProcessServiceFactory() ); + if( xFact.is() ) + { + Reference< XDesktop > xDesktop( xFact->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.frame.Desktop" ) ), UNO_QUERY ); + if( xDesktop.is() ) + xDesktop->addTerminateListener(This); + } + while( osl_scheduleThread(This->m_aThread) ) { This->dispatchEvent( 1000 ); @@ -3750,7 +3762,7 @@ void SelectionManager::run( void* pThis ) { if( it->first != This->m_nXdndSelection && ! it->second->m_bOwner ) { - Window aOwner = XGetSelectionOwner( This->m_pDisplay, it->first ); + XLIB_Window aOwner = XGetSelectionOwner( This->m_pDisplay, it->first ); if( aOwner != it->second->m_aLastOwner ) { it->second->m_aLastOwner = aOwner; @@ -3774,6 +3786,40 @@ void SelectionManager::run( void* pThis ) #endif } +void SelectionManager::shutdown() throw() +{ + ResettableMutexGuard aGuard(m_aMutex); + // stop dispatching + if( m_aThread ) + { + osl_terminateThread( m_aThread ); + /* + * Allow thread to finish before app exits to avoid pulling the carpet + * out from under it if pasting is occuring during shutdown + * + * a) allow it to have the Mutex and + * b) reschedule to allow it to complete callbacks to any + * Application::GetSolarMutex protected regions, etc. e.g. + * TransferableHelper::getTransferDataFlavors (via + * SelectionManager::handleSelectionRequest) which it might + * currently be trying to enter. + * + * Otherwise the thread may be left still waiting on a GlobalMutex + * when that gets destroyed, letting the thread blow up and die + * when enters the section in a now dead OOo instance. + */ + aGuard.clear(); + while (osl_isThreadRunning(m_aThread)) + Application::Yield(); + osl_joinWithThread( m_aThread ); + osl_destroyThread( m_aThread ); + m_aThread = NULL; + aGuard.reset(); + } + m_xDisplayConnection->removeEventHandler( Any(), this ); + m_xDisplayConnection.clear(); +} + // ------------------------------------------------------------------------ sal_Bool SelectionManager::handleEvent( const Any& event ) throw() @@ -3782,10 +3828,10 @@ sal_Bool SelectionManager::handleEvent( const Any& event ) throw() if( (event >>= aSeq) ) { XEvent* pEvent = (XEvent*)aSeq.getArray(); - Time nTimestamp = CurrentTime; + XLIB_Time nTimestamp = CurrentTime; if( pEvent->type == ButtonPress || pEvent->type == ButtonRelease ) nTimestamp = pEvent->xbutton.time; - else if( pEvent->type == KeyPress || pEvent->type == KeyRelease ) + else if( pEvent->type == XLIB_KeyPress || pEvent->type == KeyRelease ) nTimestamp = pEvent->xkey.time; else if( pEvent->type == MotionNotify ) nTimestamp = pEvent->xmotion.time; @@ -3806,16 +3852,38 @@ sal_Bool SelectionManager::handleEvent( const Any& event ) throw() #if OSL_DEBUG_LEVEL > 1 fprintf( stderr, "SelectionManager got downing event\n" ); #endif - MutexGuard aGuard(m_aMutex); - // stop dispatching - if( m_aThread ) - osl_terminateThread( m_aThread ); - m_xDisplayConnection->removeEventHandler( Any(), this ); - m_xDisplayConnection.clear(); + shutdown(); } return sal_True; } +void SAL_CALL SelectionManager::disposing( const ::com::sun::star::lang::EventObject& ) + throw( ::com::sun::star::uno::RuntimeException ) +{ +} + +void SAL_CALL SelectionManager::queryTermination( const ::com::sun::star::lang::EventObject& ) + throw( ::com::sun::star::frame::TerminationVetoException, ::com::sun::star::uno::RuntimeException ) +{ +} + +/* + * To be safe, shutdown needs to be called before the ~SfxApplication is called, waiting until + * the downing event can be too late if paste are requested during shutdown and ~SfxApplication + * has been called before vcl is shutdown + */ +void SAL_CALL SelectionManager::notifyTermination( const ::com::sun::star::lang::EventObject& rEvent ) + throw( ::com::sun::star::uno::RuntimeException ) +{ + Reference< XDesktop > xDesktop( rEvent.Source, UNO_QUERY ); + if( xDesktop.is() == sal_True ) + xDesktop->removeTerminateListener( this ); + #if OSL_DEBUG_LEVEL > 1 + fprintf( stderr, "SelectionManager got app termination event\n" ); + #endif + shutdown(); +} + // ------------------------------------------------------------------------ void SelectionManager::registerHandler( Atom selection, SelectionAdaptor& rAdaptor ) @@ -3846,12 +3914,12 @@ void SelectionManager::deregisterHandler( Atom selection ) // ------------------------------------------------------------------------ -void SelectionManager::registerDropTarget( Window aWindow, DropTarget* pTarget ) +void SelectionManager::registerDropTarget( XLIB_Window aWindow, DropTarget* pTarget ) { MutexGuard aGuard(m_aMutex); // sanity check - ::std::hash_map< Window, DropTargetEntry >::const_iterator it = + ::std::hash_map< XLIB_Window, DropTargetEntry >::const_iterator it = m_aDropTargets.find( aWindow ); if( it != m_aDropTargets.end() ) OSL_ASSERT( "attempt to register window as drop target twice" ); @@ -3877,7 +3945,7 @@ void SelectionManager::registerDropTarget( Window aWindow, DropTarget* pTarget ) // ------------------------------------------------------------------------ -void SelectionManager::deregisterDropTarget( Window aWindow ) +void SelectionManager::deregisterDropTarget( XLIB_Window aWindow ) { ClearableMutexGuard aGuard(m_aMutex); @@ -3885,7 +3953,7 @@ void SelectionManager::deregisterDropTarget( Window aWindow ) if( aWindow == m_aDragSourceWindow && m_aDragRunning.check() ) { // abort drag - std::hash_map< Window, DropTargetEntry >::const_iterator it = + std::hash_map< XLIB_Window, DropTargetEntry >::const_iterator it = m_aDropTargets.find( m_aDropWindow ); if( it != m_aDropTargets.end() ) { diff --git a/vcl/unx/source/dtrans/X11_selection.hxx b/vcl/unx/source/dtrans/X11_selection.hxx index dc6c41247bbd..fa6c310ef8c1 100644 --- a/vcl/unx/source/dtrans/X11_selection.hxx +++ b/vcl/unx/source/dtrans/X11_selection.hxx @@ -32,6 +32,7 @@ #define _DTRANS_X11_SELECTION_HXX_ #include +#include #include #include #include @@ -39,6 +40,7 @@ #include #include #include +#include #include #ifndef _OSL_CONDITION_HXX_ @@ -48,7 +50,9 @@ #include #include +#include "tools/prex.h" #include +#include "tools/postx.h" #define XDND_IMPLEMENTATION_NAME "com.sun.star.datatransfer.dnd.XdndSupport" #define XDND_DROPTARGET_IMPLEMENTATION_NAME "com.sun.star.datatransfer.dnd.XdndDropTarget" @@ -84,7 +88,7 @@ namespace x11 { ::osl::Mutex m_aMutex; bool m_bActive; sal_Int8 m_nDefaultActions; - Window m_aTargetWindow; + XLIB_Window m_aTargetWindow; class SelectionManager* m_pSelectionManager; Reference< ::com::sun::star::datatransfer::dnd::XDragSource > m_xSelectionManager; @@ -155,10 +159,11 @@ namespace x11 { class SelectionManager : - public ::cppu::WeakImplHelper3< + public ::cppu::WeakImplHelper4< ::com::sun::star::datatransfer::dnd::XDragSource, ::com::sun::star::lang::XInitialization, - ::com::sun::star::awt::XEventHandler + ::com::sun::star::awt::XEventHandler, + ::com::sun::star::frame::XTerminateListener >, public SelectionAdaptor { @@ -175,7 +180,7 @@ namespace x11 { { Sequence< sal_Int8 > m_aData; int m_nBufferPos; - Window m_aRequestor; + XLIB_Window m_aRequestor; Atom m_aProperty; Atom m_aTarget; int m_nFormat; @@ -209,11 +214,11 @@ namespace x11 { Atom m_aUTF8Type; bool m_bHaveCompound; bool m_bOwner; - Window m_aLastOwner; + XLIB_Window m_aLastOwner; PixmapHolder* m_pPixmap; - // m_nOrigTimestamp contains the timestamp at which the seclection - // was acquired; needed for TIMESTAMP target - Time m_nOrigTimestamp; + // m_nOrigXLIB_Timestamp contains the XLIB_Timestamp at which the seclection + // was acquired; needed for XLIB_TimeSTAMP target + XLIB_Time m_nOrigTimestamp; Selection() : m_eState( Inactive ), m_pAdaptor( NULL ), @@ -234,7 +239,7 @@ namespace x11 { struct DropTargetEntry { DropTarget* m_pTarget; - Window m_aRootWindow; + XLIB_Window m_aRootWindow; DropTargetEntry() : m_pTarget( NULL ), m_aRootWindow( None ) {} DropTargetEntry( DropTarget* pTarget ) : @@ -257,13 +262,13 @@ namespace x11 { oslThread m_aThread; oslThread m_aDragExecuteThread; ::osl::Condition m_aDragRunning; - Window m_aWindow; + XLIB_Window m_aWindow; Reference< ::com::sun::star::awt::XDisplayConnection > m_xDisplayConnection; Reference< com::sun::star::script::XInvocation > m_xBitmapConverter; sal_Int32 m_nSelectionTimeout; - Time m_nSelectionTimestamp; + XLIB_Time m_nSelectionTimestamp; // members used for Xdnd @@ -272,21 +277,21 @@ namespace x11 { // contains the XdndEnterEvent of a drop action running // with one of our targets. The data.l[0] member - // (conatining the drag source window) is set + // (conatining the drag source XLIB_Window) is set // to None while that is not the case XClientMessageEvent m_aDropEnterEvent; // set to false on XdndEnter // set to true on first XdndPosition or XdndLeave bool m_bDropEnterSent; - Window m_aCurrentDropWindow; - // time code of XdndDrop - Time m_nDropTime; + XLIB_Window m_aCurrentDropWindow; + // XLIB_Time code of XdndDrop + XLIB_Time m_nDropTime; sal_Int8 m_nLastDropAction; // XTransferable for Xdnd with foreign drag source Reference< ::com::sun::star::datatransfer::XTransferable > m_xDropTransferable; int m_nLastX, m_nLastY; - Time m_nDropTimestamp; + XLIB_Time m_nDropTimestamp; // set to true when calling drop() // if another XdndEnter is received this shows that // someone forgot to call dropComplete - we should reset @@ -296,10 +301,10 @@ namespace x11 { // drag only // None if no Dnd action is running with us as source - Window m_aDropWindow; - // either m_aDropWindow or its XdndProxy - Window m_aDropProxy; - Window m_aDragSourceWindow; + XLIB_Window m_aDropWindow; + // either m_aDropXLIB_Window or its XdndProxy + XLIB_Window m_aDropProxy; + XLIB_Window m_aDragSourceWindow; // XTransferable for Xdnd when we are drag source Reference< ::com::sun::star::datatransfer::XTransferable > m_xDragSourceTransferable; @@ -321,20 +326,20 @@ namespace x11 { bool m_bDropSent; time_t m_nDropTimeout; bool m_bWaitingForPrimaryConversion; - Time m_nDragTimestamp; + XLIB_Time m_nDragTimestamp; // drag cursors - Cursor m_aMoveCursor; - Cursor m_aCopyCursor; - Cursor m_aLinkCursor; - Cursor m_aNoneCursor; - Cursor m_aCurrentCursor; + XLIB_Cursor m_aMoveCursor; + XLIB_Cursor m_aCopyCursor; + XLIB_Cursor m_aLinkCursor; + XLIB_Cursor m_aNoneCursor; + XLIB_Cursor m_aCurrentCursor; // drag and drop int m_nCurrentProtocolVersion; - ::std::hash_map< Window, DropTargetEntry > + ::std::hash_map< XLIB_Window, DropTargetEntry > m_aDropTargets; @@ -374,7 +379,7 @@ namespace x11 { ::std::hash_map< Atom, Selection* > m_aSelections; // IncrementalTransfers in progress - std::hash_map< Window, std::hash_map< Atom, IncrementalTransfer > > + std::hash_map< XLIB_Window, std::hash_map< Atom, IncrementalTransfer > > m_aIncrementals; // do not use X11 multithreading capabilities @@ -398,12 +403,12 @@ namespace x11 { // dnd helpers void sendDragStatus( Atom nDropAction ); - void sendDropPosition( bool bForce, Time eventTime ); + void sendDropPosition( bool bForce, XLIB_Time eventXLIB_Time ); bool updateDragAction( int modifierState ); - int getXdndVersion( Window aWindow, Window& rProxy ); - Cursor createCursor( const char* pPointerData, const char* pMaskData, int width, int height, int hotX, int hotY ); - // coordinates on root window - void updateDragWindow( int nX, int nY, Window aRoot ); + int getXdndVersion( XLIB_Window aXLIB_Window, XLIB_Window& rProxy ); + XLIB_Cursor createCursor( const char* pPointerData, const char* pMaskData, int width, int height, int hotX, int hotY ); + // coordinates on root XLIB_Window + void updateDragWindow( int nX, int nY, XLIB_Window aRoot ); bool getPasteData( Atom selection, Atom type, Sequence< sal_Int8 >& rData ); // returns true if conversion was successful @@ -412,7 +417,7 @@ namespace x11 { Atom nSelection, int & rFormat, Sequence< sal_Int8 >& rData ); - bool sendData( SelectionAdaptor* pAdaptor, Window requestor, Atom target, Atom property, Atom selection ); + bool sendData( SelectionAdaptor* pAdaptor, XLIB_Window requestor, Atom target, Atom property, Atom selection ); // thread dispatch loop public: @@ -438,7 +443,7 @@ namespace x11 { static SelectionManager& get( const ::rtl::OUString& rDisplayName = ::rtl::OUString() ); Display * getDisplay() { return m_pDisplay; }; - Window getWindow() { return m_aWindow; }; + XLIB_Window getWindow() { return m_aWindow; }; void registerHandler( Atom selection, SelectionAdaptor& rAdaptor ); @@ -464,20 +469,22 @@ namespace x11 { bool getPasteData( Atom selection, const ::rtl::OUString& rType, Sequence< sal_Int8 >& rData ); // for XDropTarget to register/deregister itself - void registerDropTarget( Window aWindow, DropTarget* pTarget ); - void deregisterDropTarget( Window aWindow ); + void registerDropTarget( XLIB_Window aXLIB_Window, DropTarget* pTarget ); + void deregisterDropTarget( XLIB_Window aXLIB_Window ); // for XDropTarget{Drag|Drop}Context - void accept( sal_Int8 dragOperation, Window aDropWindow, Time aTimestamp ); - void reject( Window aDropWindow, Time aTimestamp ); - void dropComplete( sal_Bool success, Window aDropWindow, Time aTimestamp ); + void accept( sal_Int8 dragOperation, XLIB_Window aDropXLIB_Window, XLIB_Time aXLIB_Timestamp ); + void reject( XLIB_Window aDropXLIB_Window, XLIB_Time aXLIB_Timestamp ); + void dropComplete( sal_Bool success, XLIB_Window aDropXLIB_Window, XLIB_Time aXLIB_Timestamp ); // for XDragSourceContext sal_Int32 getCurrentCursor(); - void setCursor( sal_Int32 cursor, Window aDropWindow, Time aTimestamp ); - void setImage( sal_Int32 image, Window aDropWindow, Time aTimestamp ); + void setCursor( sal_Int32 cursor, XLIB_Window aDropXLIB_Window, XLIB_Time aXLIB_Timestamp ); + void setImage( sal_Int32 image, XLIB_Window aDropXLIB_Window, XLIB_Time aXLIB_Timestamp ); void transferablesFlavorsChanged(); + void shutdown() throw(); + // XInitialization virtual void SAL_CALL initialize( const Sequence< Any >& arguments ) throw( ::com::sun::star::uno::Exception ); @@ -499,6 +506,15 @@ namespace x11 { virtual void clearTransferable() throw(); virtual void fireContentsChanged() throw(); virtual Reference< XInterface > getReference() throw(); + + // XEventListener + virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw( ::com::sun::star::uno::RuntimeException ); + + // XTerminateListener + virtual void SAL_CALL queryTermination( const ::com::sun::star::lang::EventObject& aEvent ) + throw( ::com::sun::star::frame::TerminationVetoException, ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL notifyTermination( const ::com::sun::star::lang::EventObject& aEvent ) + throw( ::com::sun::star::uno::RuntimeException ); }; // ------------------------------------------------------------------------ diff --git a/vcl/unx/source/dtrans/bmp.cxx b/vcl/unx/source/dtrans/bmp.cxx index 49219bfb0e2a..f3c7d78617a6 100644 --- a/vcl/unx/source/dtrans/bmp.cxx +++ b/vcl/unx/source/dtrans/bmp.cxx @@ -356,7 +356,7 @@ sal_uInt8* x11::X11_getBmpFromPixmap( ) { // get geometry of drawable - Window aRoot; + XLIB_Window aRoot; int x,y; unsigned int w, h, bw, d; XGetGeometry( pDisplay, aDrawable, &aRoot, &x, &y, &w, &h, &bw, &d ); diff --git a/vcl/unx/source/dtrans/bmp.hxx b/vcl/unx/source/dtrans/bmp.hxx index baf04ac31d90..6331122e726d 100644 --- a/vcl/unx/source/dtrans/bmp.hxx +++ b/vcl/unx/source/dtrans/bmp.hxx @@ -31,10 +31,12 @@ #ifndef _DTRANS_BMP_HXX_ #define _DTRANS_BMP_HXX_ +#include "tools/prex.h" #include #include #include #include +#include "tools/postx.h" #include #include diff --git a/vcl/util/makefile.mk b/vcl/util/makefile.mk index 32620d9e966a..49b051b3557c 100644 --- a/vcl/util/makefile.mk +++ b/vcl/util/makefile.mk @@ -303,6 +303,7 @@ SHL2STDLIBS=\ $(VOSLIB) \ $(BASEGFXLIB) \ $(UNOTOOLSLIB) \ + $(COMPHELPERLIB) \ $(CPPUHELPERLIB) \ $(CPPULIB) \ $(SALLIB) -- cgit v1.2.3 From a1df3f062e27397b0968b89538fb3756786e46a3 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 27 Nov 2009 15:48:45 +0100 Subject: on wntmsci* platforms, do not echo to to-be-compiled C(++) file name twice, if not in verbose mode --- solenv/inc/rules.mk | 44 ++++++++++++++++++++++---------------------- solenv/inc/settings.mk | 2 ++ solenv/inc/wntmsci11.mk | 5 +++++ 3 files changed, 29 insertions(+), 22 deletions(-) diff --git a/solenv/inc/rules.mk b/solenv/inc/rules.mk index 71909c8d348b..2c00889cfc25 100644 --- a/solenv/inc/rules.mk +++ b/solenv/inc/rules.mk @@ -32,7 +32,7 @@ MKFILENAME:=RULES.MK $(OBJ)/%.obj : %.cxx - @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE) .IF "$(GUI)"=="UNX" @$(RM) $@ $(@:s/.obj/.o/) $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXOBJ) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$*.o $(CFLAGSINCXX)$(PWD)/$*.cxx @@ -56,7 +56,7 @@ $(OBJ)/%.obj : %.cxx .ENDIF # "$(nodep)"=="" $(OBJ)/%.obj : %.cpp - @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE) .IF "$(GUI)"=="UNX" @$(RM) $@ $(@:s/.obj/.o/) $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXOBJ) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$*.o $(CFLAGSINCXX)$(PWD)/$*.cpp @@ -78,7 +78,7 @@ $(OBJ)/%.obj : %.cpp .ENDIF # "$(nodep)"=="" $(OBJ)/%.obj : %.cc - @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE) .IF "$(GUI)"=="UNX" @$(RM) $@ $(@:s/.obj/.o/) $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXOBJ) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$*.o $(CFLAGSINCXX)$(PWD)/$*.cc @@ -159,7 +159,7 @@ $(SLO)/precompiled_ex.% .PHONY: .ENDIF # "$(ENABLE_PCH)"!="" $(SLO)/%.obj : %.cxx - @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE) .IF "$(ENABLE_PCH)"!="" && ( "$(PRJNAME)"!="sw" || "$(BUILD_SPECIAL)"!="TRUE" ) # just a helper var @noop $(assign used_exc_switches=$(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS))) @@ -198,7 +198,7 @@ $(SLO)/%.obj : %.cxx .ENDIF # "$(nodep)"=="" $(SLO)/%.obj : %.cpp - @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE) .IF "$(GUI)"=="UNX" .IF "$(TEST)"!="" $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXSLO) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) -E $(CFLAGSINCXX)$(PWD)/$*.cpp @@ -224,7 +224,7 @@ $(SLO)/%.obj : %.cpp .ENDIF # "$(nodep)"=="" $(SLO)/%.obj : $(MISC)/%.cxx - @echo Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(<:f) + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(COMPILE_ECHO_FILE) .IF "$(GUI)"=="UNX" .IF "$(TEST)"!="" $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXSLO) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) -E $(CFLAGSINCXX)$(MISC)/$*.cxx @@ -249,7 +249,7 @@ $(SLO)/%.obj : $(MISC)/%.cxx .ENDIF # "$(nodep)"=="" $(SLO)/%.obj : $(MISC)/%.cc - @echo Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(<:f) + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(COMPILE_ECHO_FILE) .IF "$(GUI)"=="UNX" .IF "$(TEST)"!="" $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXSLO) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) -E $(CFLAGSINCXX)$(MISC)/$*.cc @@ -266,7 +266,7 @@ $(SLO)/%.obj : $(MISC)/%.cc .ENDIF $(OBJ)/%.obj : $(MISC)/%.cxx - @echo Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(<:f) + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(COMPILE_ECHO_FILE) .IF "$(GUI)"=="UNX" .IF "$(TEST)"!="" $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXOBJ) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) -E $(CFLAGSINCXX)$(MISC)/$*.cxx @@ -291,7 +291,7 @@ $(OBJ)/%.obj : $(MISC)/%.cxx .ENDIF # "$(nodep)"=="" $(OBJ)/%.obj : %.c - @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE) .IF "$(GUI)"=="UNX" .IF "$(TEST)"!="" $(COMMAND_ECHO)$(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) -E $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$*.o $*.c @@ -321,7 +321,7 @@ $(OBJ)/%.obj : %.c .ENDIF # "$(nodep)"=="" $(OBJ)/%.obj : $(MISC)/%.c - @echo Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(<:f) + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(COMPILE_ECHO_FILE) .IF "$(GUI)"=="UNX" @$(RM) $@ $(@:s/.obj/.o/) $(COMMAND_ECHO)$(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$*.o $(MISC)/$*.c @@ -343,7 +343,7 @@ $(OBJ)/%.obj : $(MISC)/%.c .ENDIF # "$(nodep)"=="" $(SLO)/%.obj : $(MISC)/%.c - @echo Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(<:f) + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(COMPILE_ECHO_FILE) .IF "$(GUI)"=="UNX" @$(RM) $@ $(@:s/.obj/.o/) $(COMMAND_ECHO)$(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)/$*.o $(MISC)/$*.c @@ -366,7 +366,7 @@ $(SLO)/%.obj : $(MISC)/%.c .ENDIF # "$(nodep)"=="" $(SLO)/%.obj : %.c - @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE) .IF "$(GUI)"=="UNX" @$(RM) $@ $(@:s/.obj/.o/) $(COMMAND_ECHO)$(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)/$*.o $*.c @@ -389,7 +389,7 @@ $(SLO)/%.obj : %.c # Objective-C files $(OBJ)/%.obj : %.m - @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE) .IF "$(OS)"=="MACOSX" .IF "$(TEST)"!="" $(COMMAND_ECHO)$(objc) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(OBJCFLAGS) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) -E $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$*.o $*.m @@ -404,7 +404,7 @@ $(OBJ)/%.obj : %.m # Objective-C files $(OBJ)/%.obj : $(MISC)/%.m - @echo Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(<:f) + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(COMPILE_ECHO_FILE) .IF "$(OS)"=="MACOSX" @$(RM) $@ $(@:s/.obj/.o/) $(COMMAND_ECHO)$(objc) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(OBJCFLAGS) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$*.o $(MISC)/$*.m @@ -415,7 +415,7 @@ $(OBJ)/%.obj : $(MISC)/%.m # Objective-C files $(SLO)/%.obj : $(MISC)/%.m - @echo Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(<:f) + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(COMPILE_ECHO_FILE) .IF "$(OS)"=="MACOSX" @$(RM) $@ $(@:s/.obj/.o/) $(COMMAND_ECHO)$(objc) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(OBJCFLAGS) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)/$*.o $(MISC)/$*.m @@ -426,7 +426,7 @@ $(SLO)/%.obj : $(MISC)/%.m # Objective-C files $(SLO)/%.obj : %.m - @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE) .IF "$(OS)"=="MACOSX" @$(RM) $@ $(@:s/.obj/.o/) $(COMMAND_ECHO)$(objc) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(OBJCFLAGS) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)/$*.o $*.m @@ -442,7 +442,7 @@ not_existing/o_%.dpcc : %.c;@noop $(assign all_local_obj+:=$<) # Objective-C++ files $(OBJ)/%.obj : %.mm - @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE) .IF "$(OS)"=="MACOSX" .IF "$(TEST)"!="" $(COMMAND_ECHO)$(objcpp) $(CFLAGS) $(INCLUDE) $(CFLAGSCC) $(OBJCXXFLAGS) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) -E $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$*.o $*.mm @@ -461,7 +461,7 @@ $(OBJ)/%.obj : %.mm # Objective-C++ files $(OBJ)/%.obj : $(MISC)/%.mm - @echo Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(<:f) + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(COMPILE_ECHO_FILE) .IF "$(OS)"=="MACOSX" @$(RM) $@ $(@:s/.obj/.o/) $(COMMAND_ECHO)$(objcpp) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(OBJCXXFLAGS) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$*.o $(MISC)/$*.mm @@ -476,7 +476,7 @@ $(OBJ)/%.obj : $(MISC)/%.mm # Objective-C++ files $(SLO)/%.obj : $(MISC)/%.mm - @echo Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(<:f) + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(COMPILE_ECHO_FILE) .IF "$(OS)"=="MACOSX" @$(RM) $@ $(@:s/.obj/.o/) $(COMMAND_ECHO)$(objcpp) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(OBJCXXFLAGS) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)/$*.o $(MISC)/$*.mm @@ -491,7 +491,7 @@ $(SLO)/%.obj : $(MISC)/%.mm # Objective-C++ files $(SLO)/%.obj : %.mm - @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE) .IF "$(OS)"=="MACOSX" @$(RM) $@ $(@:s/.obj/.o/) $(COMMAND_ECHO)$(objcpp) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(OBJCXXFLAGS) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)/$*.o $*.mm @@ -639,7 +639,7 @@ $(MISC)/%.dpj : .ENDIF # "$(nodep)"=="" $(SLO)/%.obj : %.asm - @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE) .IF "$(COM)"=="GCC" .IF "$(ASM)"=="ml" $(COMMAND_ECHO)$(ASM) $(AFLAGS) -D$(COM) /Fo$(SLO)/$*.obj $*.asm @@ -666,7 +666,7 @@ $(SLO)/%.obj : %.asm .ENDIF $(OBJ)/%.obj : %.asm - @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE) .IF "$(COM)"=="GCC" .IF "$(ASM)"=="ml" $(COMMAND_ECHO)$(ASM) $(AFLAGS) -D$(COM) /Fo$(OBJ)/$*.obj $*.asm diff --git a/solenv/inc/settings.mk b/solenv/inc/settings.mk index 49b9d2c8e755..ca0bcf0fef55 100644 --- a/solenv/inc/settings.mk +++ b/solenv/inc/settings.mk @@ -987,6 +987,8 @@ RSC=$(AUGMENT_LIBRARY_PATH) $(FLIPCMD) $(SOLARBINDIR)/rsc ULFEX_VERBOSITY=-QQ .ENDIF .ENDIF # "$(VERBOSE)" == "TRUE" +COMPILE_ECHO_SWITCH= +COMPILE_ECHO_FILE=$(<:f) #new RSCUPDVER=$(RSCREVISION) diff --git a/solenv/inc/wntmsci11.mk b/solenv/inc/wntmsci11.mk index 3d2750fd2dc6..1bb994f1ad6f 100644 --- a/solenv/inc/wntmsci11.mk +++ b/solenv/inc/wntmsci11.mk @@ -75,6 +75,11 @@ CXX+= /NMttNoLines NOLOGO*=-nologo .ENDIF +.IF "$(VERBOSE)" != "TRUE" +COMPILE_ECHO_SWITCH=-n +COMPILE_ECHO_FILE= +.ENDIF + # Flags for COMEX == 11 # disable "warning C4675: resolved overload was found by argument-dependent -- cgit v1.2.3 From df55b382cc024eff49a38c3654d28b30d1101108 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 27 Nov 2009 16:04:42 +0100 Subject: #i10000# --- connectivity/source/parse/sqlnode.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx index 543f93d3b533..969682539074 100644 --- a/connectivity/source/parse/sqlnode.cxx +++ b/connectivity/source/parse/sqlnode.cxx @@ -911,6 +911,7 @@ OSQLParseNode* OSQLParser::convertNode(sal_Int32 nType,OSQLParseNode*& pLiteral) } break; default: + ; } } return pReturn; -- cgit v1.2.3 From 090aec9e5968016276b3124b5a7013bc8138ccca Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Mon, 30 Nov 2009 09:11:46 +0100 Subject: dba33d: #i107279# set numberformat with old one --- dbaccess/source/core/misc/dsntypes.cxx | 1 - dbaccess/source/ui/misc/DExport.cxx | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/dbaccess/source/core/misc/dsntypes.cxx b/dbaccess/source/core/misc/dsntypes.cxx index d241067fcd4d..242d5e27e54b 100644 --- a/dbaccess/source/core/misc/dsntypes.cxx +++ b/dbaccess/source/core/misc/dsntypes.cxx @@ -444,7 +444,6 @@ DATASOURCE_TYPE ODsnTypeCollection::determineType(const String& _rDsn) const return aKnowPrefixes[i].eType; } - DBG_ERROR("ODsnTypeCollection::implDetermineType : unrecognized data source type !"); return DST_UNKNOWN; } // ----------------------------------------------------------------------------- diff --git a/dbaccess/source/ui/misc/DExport.cxx b/dbaccess/source/ui/misc/DExport.cxx index f533c719160e..17e58df29af2 100644 --- a/dbaccess/source/ui/misc/DExport.cxx +++ b/dbaccess/source/ui/misc/DExport.cxx @@ -479,6 +479,7 @@ sal_Int16 ODatabaseExport::CheckString(const String& aCheckToken, sal_Int16 _nOl case NumberFormat::DATETIME: case NumberFormat::TEXT: case NumberFormat::DATE: + nNumberFormat = _nOldNumberFormat; break; case NumberFormat::ALL: nNumberFormat = NumberFormat::DATE; @@ -494,6 +495,7 @@ sal_Int16 ODatabaseExport::CheckString(const String& aCheckToken, sal_Int16 _nOl case NumberFormat::DATETIME: case NumberFormat::TEXT: case NumberFormat::TIME: + nNumberFormat = _nOldNumberFormat; break; case NumberFormat::ALL: nNumberFormat = NumberFormat::TIME; @@ -510,6 +512,7 @@ sal_Int16 ODatabaseExport::CheckString(const String& aCheckToken, sal_Int16 _nOl nNumberFormat = NumberFormat::CURRENCY; break; case NumberFormat::CURRENCY: + nNumberFormat = _nOldNumberFormat; break; case NumberFormat::ALL: nNumberFormat = NumberFormat::CURRENCY; @@ -526,6 +529,7 @@ sal_Int16 ODatabaseExport::CheckString(const String& aCheckToken, sal_Int16 _nOl switch(_nOldNumberFormat) { case NumberFormat::NUMBER: + nNumberFormat = _nOldNumberFormat; break; case NumberFormat::CURRENCY: nNumberFormat = NumberFormat::CURRENCY; @@ -549,6 +553,7 @@ sal_Int16 ODatabaseExport::CheckString(const String& aCheckToken, sal_Int16 _nOl case NumberFormat::DATETIME: case NumberFormat::TEXT: case NumberFormat::TIME: + nNumberFormat = _nOldNumberFormat; break; case NumberFormat::ALL: nNumberFormat = NumberFormat::DATETIME; -- cgit v1.2.3 From 39b35574d2b54e1e461993def9aa9c4cc53df61a Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Mon, 30 Nov 2009 14:00:54 +0100 Subject: dba33d: don't export intern props --- connectivity/source/drivers/jdbc/tools.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/connectivity/source/drivers/jdbc/tools.cxx b/connectivity/source/drivers/jdbc/tools.cxx index f77c45d66fc8..13bc83d1a56d 100644 --- a/connectivity/source/drivers/jdbc/tools.cxx +++ b/connectivity/source/drivers/jdbc/tools.cxx @@ -153,6 +153,8 @@ java_util_Properties* connectivity::createStringPropertyArray(const Sequence< Pr && pBegin->Name.compareToAscii( "SupportsTableCreation" ) && pBegin->Name.compareToAscii( "UseJava" ) && pBegin->Name.compareToAscii( "Authentication" ) + && pBegin->Name.compareToAscii( "PreferDosLikeLineEnds" ) + && pBegin->Name.compareToAscii( "PrimaryKeySupport" ) ) { ::rtl::OUString aStr; -- cgit v1.2.3 From d14913816d74d0f8105e6d46d86a6617eb2cd773 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Tue, 1 Dec 2009 07:14:41 +0100 Subject: add new line at end --- dbaccess/source/ui/misc/WCopyTable.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx index dd31e3b87cee..1cdf6156a789 100644 --- a/dbaccess/source/ui/misc/WCopyTable.cxx +++ b/dbaccess/source/ui/misc/WCopyTable.cxx @@ -1698,4 +1698,5 @@ void OCopyTableWizard::showError(const Any& _aError) DBG_UNHANDLED_EXCEPTION(); } } -} \ No newline at end of file +} + -- cgit v1.2.3 From ceadb85b48b6c6baaeb2e751fa519a53ac99ed57 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Tue, 1 Dec 2009 07:17:18 +0100 Subject: comparison between signed and unsigned integer expressions --- reportdesign/source/filter/xml/xmlExport.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx index a4032b35f073..aff63a9eb6f8 100644 --- a/reportdesign/source/filter/xml/xmlExport.cxx +++ b/reportdesign/source/filter/xml/xmlExport.cxx @@ -1639,8 +1639,8 @@ void ORptExport::exportGroupsExpressionAsFunction(const Reference< XGroups>& _xG if ( sFunction.getLength() ) { sal_Unicode pReplaceChars[] = { '(',')',';',',','+','-','[',']','/','*'}; - for(sal_Int32 i= 0; i < sizeof(pReplaceChars)/sizeof(pReplaceChars[0]);++i) - sFunctionName = sFunctionName.replace(pReplaceChars[i],'_'); + for(sal_uInt32 j= 0; j < sizeof(pReplaceChars)/sizeof(pReplaceChars[0]);++j) + sFunctionName = sFunctionName.replace(pReplaceChars[j],'_'); xFunction->setName(sFunctionName); sFunction = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("rpt:")) + sFunction; -- cgit v1.2.3 From 8e1696a1e3402f66342d590733a9afdbe4ea840b Mon Sep 17 00:00:00 2001 From: hdu Date: Tue, 1 Dec 2009 10:37:14 +0100 Subject: #i106264# prevent ushort-overflow in GSUB.cov2 --- vcl/source/fontsubset/gsub.cxx | 13 ++++++------- vcl/source/glyphs/gcach_ftyp.cxx | 13 ++++++------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/vcl/source/fontsubset/gsub.cxx b/vcl/source/fontsubset/gsub.cxx index 600c03194210..a1c3344f3e5a 100644 --- a/vcl/source/fontsubset/gsub.cxx +++ b/vcl/source/fontsubset/gsub.cxx @@ -42,6 +42,7 @@ namespace vcl { typedef sal_uInt32 ULONG; +typedef sal_uInt32 UINT32; typedef sal_uInt16 USHORT; typedef sal_uInt8 FT_Byte; @@ -280,13 +281,11 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile, return false; for( int i = nCntRange; --i >= 0; ) { - const USHORT nGlyph0 = NEXT_UShort( pCoverage ); - const USHORT nGlyph1 = NEXT_UShort( pCoverage ); - const USHORT nStartCoverageIndex = NEXT_UShort( pCoverage ); - OSL_ENSURE( aSubstVector.size() == nStartCoverageIndex, "coverage index mismatch"); - (void)nStartCoverageIndex; - for( USHORT j = nGlyph0; j <= nGlyph1; ++j ) - aSubstVector.push_back( GlyphSubst( j, 0 ) ); + const UINT32 nGlyph0 = NEXT_UShort( pCoverage ); + const UINT32 nGlyph1 = NEXT_UShort( pCoverage ); + const USHORT nCovIdx = NEXT_UShort( pCoverage ); + for( UINT32 j = nGlyph0; j <= nGlyph1; ++j ) + aSubstVector.push_back( GlyphSubst( static_cast(j + nCovIdx), 0 ) ); } } break; diff --git a/vcl/source/glyphs/gcach_ftyp.cxx b/vcl/source/glyphs/gcach_ftyp.cxx index 18857b94af8f..b724893e139c 100644 --- a/vcl/source/glyphs/gcach_ftyp.cxx +++ b/vcl/source/glyphs/gcach_ftyp.cxx @@ -2487,14 +2487,12 @@ bool FreetypeServerFont::ApplyGSUB( const ImplFontSelectData& rFSD ) pCoverage += 2; for( int i = nCntRange; --i >= 0; ) { - const USHORT nGlyph0 = GetUShort( pCoverage+0 ); - const USHORT nGlyph1 = GetUShort( pCoverage+2 ); - const USHORT nStartCoverageIndex = GetUShort( pCoverage+4 ); - DBG_ASSERT( aSubstVector.size() == nStartCoverageIndex, "coverage index mismatch"); - (void)nStartCoverageIndex; + const UINT32 nGlyph0 = GetUShort( pCoverage+0 ); + const UINT32 nGlyph1 = GetUShort( pCoverage+2 ); + const USHORT nCovIdx = GetUShort( pCoverage+4 ); pCoverage += 6; - for( USHORT j = nGlyph0; j <= nGlyph1; ++j ) - aSubstVector.push_back( GlyphSubst( j, 0 ) ); + for( UINT32 j = nGlyph0; j <= nGlyph1; ++j ) + aSubstVector.push_back( GlyphSubst( static_cast(j + nCovIdx), 0 ) ); } } break; @@ -2538,3 +2536,4 @@ bool FreetypeServerFont::ApplyGSUB( const ImplFontSelectData& rFSD ) } // ======================================================================= + -- cgit v1.2.3 From f938cca20e7f33cabfcae99447683013aa8b9868 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Tue, 1 Dec 2009 16:49:53 +0100 Subject: #i107150# - new extension update url. --- scp2/source/ooo/common_brand.scp | 46 ++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/scp2/source/ooo/common_brand.scp b/scp2/source/ooo/common_brand.scp index 8a3b0b4443f1..bef45bf348d2 100644 --- a/scp2/source/ooo/common_brand.scp +++ b/scp2/source/ooo/common_brand.scp @@ -433,7 +433,7 @@ File gid_Brand_File_Desktophelper_Txt Styles = (PACKED); Dir = gid_Brand_Dir_Program; Name = "desktophelper.txt"; - ComponentCondition = "CREATEDESKTOPLINK=1"; + ComponentCondition = "CREATEDESKTOPLINK=1"; End #endif @@ -464,17 +464,17 @@ End #ifdef WNT File gid_Brand_File_Bin_Rebaseoo - BIN_FILE_BODY; - Dir = gid_Brand_Dir_Program; - Styles = (PACKED); - Name = "rebaseoo.exe"; + BIN_FILE_BODY; + Dir = gid_Brand_Dir_Program; + Styles = (PACKED); + Name = "rebaseoo.exe"; End File gid_Brand_File_Bin_Rebasegui - BIN_FILE_BODY; - Dir = gid_Brand_Dir_Program; - Styles = (PACKED); - Name = "rebasegui.exe"; + BIN_FILE_BODY; + Dir = gid_Brand_Dir_Program; + Styles = (PACKED); + Name = "rebasegui.exe"; End #endif @@ -623,37 +623,37 @@ End #if defined UNX && ! defined MACOSX File gid_Brand_File_Share_Xdg_Calc - TXT_FILE_BODY; - Dir = gid_Brand_Dir_Share_Xdg; - Name = "calc.desktop"; + TXT_FILE_BODY; + Dir = gid_Brand_Dir_Share_Xdg; + Name = "calc.desktop"; Styles = (PACKED,SCPZIP_REPLACE); End #endif #if defined UNX && ! defined MACOSX File gid_Brand_File_Share_Xdg_Draw - TXT_FILE_BODY; - Dir = gid_Brand_Dir_Share_Xdg; - Name = "draw.desktop"; + TXT_FILE_BODY; + Dir = gid_Brand_Dir_Share_Xdg; + Name = "draw.desktop"; Styles = (PACKED,SCPZIP_REPLACE); End #endif #if defined UNX && ! defined MACOSX File gid_Brand_File_Share_Xdg_Impress - TXT_FILE_BODY; - Dir = gid_Brand_Dir_Share_Xdg; - Name = "impress.desktop"; + TXT_FILE_BODY; + Dir = gid_Brand_Dir_Share_Xdg; + Name = "impress.desktop"; Styles = (PACKED,SCPZIP_REPLACE); End #endif #if defined UNX && ! defined MACOSX File gid_Brand_File_Share_Xdg_Math - TXT_FILE_BODY; - Dir = gid_Brand_Dir_Share_Xdg; - Name = "math.desktop"; - Styles = (PACKED,SCPZIP_REPLACE); + TXT_FILE_BODY; + Dir = gid_Brand_Dir_Share_Xdg; + Name = "math.desktop"; + Styles = (PACKED,SCPZIP_REPLACE); End #endif @@ -1097,7 +1097,7 @@ ProfileItem gid_Brand_Profileitem_Version_Extensionupdateurl Section = "Version"; Order = 18; Key = "ExtensionUpdateURL"; - Value = "http://updateext.services.openoffice.org/ProductUpdateService/check.Update"; + Value = "http://updateexte.services.openoffice.org/ExtensionUpdateService/check.Update"; End ProfileItem gid_Brand_Profileitem_Fundamental_Brand_Base_Dir -- cgit v1.2.3 From ef8d59c5b909d5a9b956934ab1120f90b90a4e10 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 1 Dec 2009 17:55:30 +0100 Subject: vcl108: #i106853# work around broken file_iterator on Windows --- sdext/source/pdfimport/config/description.xml | 2 +- sdext/source/pdfimport/pdfparse/pdfparse.cxx | 30 ++++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/sdext/source/pdfimport/config/description.xml b/sdext/source/pdfimport/config/description.xml index 9feff443b421..08e2f505653a 100644 --- a/sdext/source/pdfimport/config/description.xml +++ b/sdext/source/pdfimport/config/description.xml @@ -16,7 +16,7 @@ - + diff --git a/sdext/source/pdfimport/pdfparse/pdfparse.cxx b/sdext/source/pdfimport/pdfparse/pdfparse.cxx index c9b3b1522cc5..36734cfcbc84 100644 --- a/sdext/source/pdfimport/pdfparse/pdfparse.cxx +++ b/sdext/source/pdfimport/pdfparse/pdfparse.cxx @@ -51,6 +51,7 @@ #include #include +#include // disable warnings again because someone along the line has enabled them #if defined __SUNPRO_CC @@ -573,6 +574,33 @@ PDFEntry* PDFReader::read( const char* pBuffer, unsigned int nLen ) PDFEntry* PDFReader::read( const char* pFileName ) { + #ifdef WIN32 + /* #i106583# + since converting to boost 1.39 file_iterator does not work anymore on all Windows systems + C++ stdlib istream_iterator does not allow "-" apparently + using spirit 2.0 doesn't work in our environment with the MSC + + So for the time being bite the bullet and read the whole file. + FIXME: give Spirit 2.x another try when we upgrade boost again. + */ + PDFEntry* pRet = NULL; + FILE* fp = fopen( pFileName, "rb" ); + if( fp ) + { + fseek( fp, 0, SEEK_END ); + unsigned int nLen = (unsigned int)ftell( fp ); + fseek( fp, 0, SEEK_SET ); + char* pBuf = (char*)rtl_allocateMemory( nLen ); + if( pBuf ) + { + fread( pBuf, 1, nLen, fp ); + pRet = read( pBuf, nLen ); + rtl_freeMemory( pBuf ); + } + fclose( fp ); + } + return pRet; + #else file_iterator<> file_start( pFileName ); if( ! file_start ) return NULL; @@ -629,8 +657,8 @@ PDFEntry* PDFReader::read( const char* pFileName ) } } #endif - return pRet; + #endif // WIN32 } #if defined __SUNPRO_CC -- cgit v1.2.3 From 83408633977416f4f2e612555471431bf9acf4c9 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 1 Dec 2009 18:01:53 +0100 Subject: vcl108: #i107358# fix uninitialized member (thanks cmc!) --- vcl/source/gdi/pdfwriter_impl.hxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx index 7d5ec2bf4f61..29de6d4f5971 100644 --- a/vcl/source/gdi/pdfwriter_impl.hxx +++ b/vcl/source/gdi/pdfwriter_impl.hxx @@ -679,6 +679,7 @@ private: m_aOverlineColor( COL_TRANSPARENT ), m_nAntiAlias( 1 ), m_nLayoutMode( 0 ), + m_aDigitLanguage( 0 ), m_nTransparentPercent( 0 ), m_nFlags( 0xffff ), m_nUpdateFlags( 0xffff ) @@ -693,6 +694,7 @@ private: m_aClipRegion( rState.m_aClipRegion ), m_nAntiAlias( rState.m_nAntiAlias ), m_nLayoutMode( rState.m_nLayoutMode ), + m_aDigitLanguage( rState.m_aDigitLanguage ), m_nTransparentPercent( rState.m_nTransparentPercent ), m_nFlags( rState.m_nFlags ), m_nUpdateFlags( rState.m_nUpdateFlags ) @@ -710,6 +712,7 @@ private: m_aClipRegion = rState.m_aClipRegion; m_nAntiAlias = rState.m_nAntiAlias; m_nLayoutMode = rState.m_nLayoutMode; + m_aDigitLanguage = rState.m_aDigitLanguage; m_nTransparentPercent = rState.m_nTransparentPercent; m_nFlags = rState.m_nFlags; m_nUpdateFlags = rState.m_nUpdateFlags; -- cgit v1.2.3 From cab402a8aa21c2ba6d2d66d45d44b3b2b07cedf8 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 3 Dec 2009 14:12:42 +0100 Subject: diagnostics --- unotools/source/config/confignode.cxx | 37 ++++++++++------------------------- 1 file changed, 10 insertions(+), 27 deletions(-) diff --git a/unotools/source/config/confignode.cxx b/unotools/source/config/confignode.cxx index 56d258461e95..c8134137db0c 100644 --- a/unotools/source/config/confignode.cxx +++ b/unotools/source/config/confignode.cxx @@ -468,16 +468,9 @@ namespace utl aReturn = m_xHierarchyAccess->getByHierarchicalName(_rPath); } } - catch(NoSuchElementException& e) + catch(const NoSuchElementException&) { - #if OSL_DEBUG_LEVEL > 0 - rtl::OStringBuffer aBuf( 256 ); - aBuf.append("OConfigurationNode::getNodeValue: caught a NoSuchElementException while trying to open "); - aBuf.append( rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ) ); - OSL_ENSURE(sal_False, aBuf.getStr()); - #else - (void)e; - #endif + DBG_UNHANDLED_EXCEPTION(); } return aReturn; } @@ -500,7 +493,7 @@ namespace utl } catch(Exception&) { - OSL_ENSURE(sal_False, "OConfigurationNode::cloneAsRoot: could not retrieve the node path!"); + DBG_UNHANDLED_EXCEPTION(); } } @@ -561,13 +554,9 @@ namespace utl m_xCommitter->commitChanges(); return sal_True; } - catch(WrappedTargetException&) - { - OSL_ENSURE(sal_False, "OConfigurationTreeRoot::commit: caught a WrappedTargetException!"); - } - catch(RuntimeException&) + catch(const Exception&) { - OSL_ENSURE(sal_False, "OConfigurationTreeRoot::commit: caught a RuntimeException!"); + DBG_UNHANDLED_EXCEPTION(); } return sal_False; } @@ -604,7 +593,7 @@ namespace utl } catch(const Exception&) { - OSL_ENSURE(sal_False, "OConfigurationTreeRoot::createWithProvider: unable to check the service conformance of the provider given!"); + DBG_UNHANDLED_EXCEPTION(); } } #endif @@ -648,15 +637,9 @@ namespace utl try { xComp->dispose(); } catch(Exception&) { } } } - catch(Exception& e) + catch(const Exception&) { - #if OSL_DEBUG_LEVEL > 0 - ::rtl::OString sMessage( "OConfigurationTreeRoot::createWithProvider: caught an exception while creating the access object!\nmessage:\n" ); - sMessage += ::rtl::OString( e.Message.getStr(), e.Message.getLength(), RTL_TEXTENCODING_ASCII_US ); - OSL_ENSURE( sal_False, sMessage.getStr() ); - #else - (void)e; - #endif + DBG_UNHANDLED_EXCEPTION(); } } bTryAgain = CM_PREFER_UPDATABLE == _eMode; @@ -683,9 +666,9 @@ namespace utl if (xProviderAsFac.is()) return createWithProvider(xProviderAsFac, _rPath, _nDepth, _eMode, _bLazyWrite); } - catch(Exception&) + catch(const Exception&) { - OSL_ENSURE(sal_False, "OConfigurationTreeRoot::createWithServiceFactory: error while instantiating the provider service!"); + DBG_UNHANDLED_EXCEPTION(); } } return OConfigurationTreeRoot(); -- cgit v1.2.3 From 11c7cf17c5b96e2201cfaf43f5b4aa6cf2c34906 Mon Sep 17 00:00:00 2001 From: sj Date: Thu, 3 Dec 2009 16:31:03 +0100 Subject: impress181: #i107292#: Applied patch, wmf filter is now supporting embedded EMF data from the META_ESCAPE action. --- svtools/source/filter.vcl/wmf/winmtf.cxx | 5 + svtools/source/filter.vcl/wmf/winmtf.hxx | 15 +++ svtools/source/filter.vcl/wmf/winwmf.cxx | 216 ++++++++++++++++++++++--------- svtools/source/filter.vcl/wmf/wmfwr.cxx | 80 ++++++++++++ svtools/source/filter.vcl/wmf/wmfwr.hxx | 9 ++ 5 files changed, 264 insertions(+), 61 deletions(-) diff --git a/svtools/source/filter.vcl/wmf/winmtf.cxx b/svtools/source/filter.vcl/wmf/winmtf.cxx index 6f1caae18750..3db3e6957e41 100644 --- a/svtools/source/filter.vcl/wmf/winmtf.cxx +++ b/svtools/source/filter.vcl/wmf/winmtf.cxx @@ -2195,3 +2195,8 @@ void WinMtfOutput::Pop() } } +void WinMtfOutput::AddFromGDIMetaFile( GDIMetaFile& rGDIMetaFile ) +{ + rGDIMetaFile.Play( *mpGDIMetaFile, 0xFFFFFFFF ); +} + diff --git a/svtools/source/filter.vcl/wmf/winmtf.hxx b/svtools/source/filter.vcl/wmf/winmtf.hxx index ada590a19675..f3b2482f63bc 100644 --- a/svtools/source/filter.vcl/wmf/winmtf.hxx +++ b/svtools/source/filter.vcl/wmf/winmtf.hxx @@ -672,6 +672,7 @@ class WinMtfOutput void MoveClipRegion( const Size& rSize ); void SetClipPath( const PolyPolygon& rPolyPoly, sal_Int32 nClippingMode, sal_Bool bIsMapped ); void UpdateClipRegion(); + void AddFromGDIMetaFile( GDIMetaFile& rGDIMetaFile ); WinMtfOutput( GDIMetaFile& rGDIMetaFile ); virtual ~WinMtfOutput(); @@ -734,6 +735,18 @@ private: UINT16 nUnitsPerInch; sal_uInt32 nRecSize; + // embedded EMF data + SvMemoryStream* pEMFStream; + + // total number of comment records containing EMF data + sal_uInt32 nEMFRecCount; + + // number of EMF records read + sal_uInt32 nEMFRec; + + // total size of embedded EMF data + sal_uInt32 nEMFSize; + sal_uInt32 nSkipActions; sal_uInt32 nCurrentAction; sal_uInt32 nUnicodeEscapeAction; @@ -755,6 +768,8 @@ public: WMFReader( SvStream& rStreamWMF, GDIMetaFile& rGDIMetaFile, FilterConfigItem* pConfigItem = NULL ) : WinMtf( new WinMtfOutput( rGDIMetaFile ), rStreamWMF, pConfigItem ) {}; + ~WMFReader(); + // Liesst aus dem Stream eine WMF-Datei und fuellt das GDIMetaFile void ReadWMF(); }; diff --git a/svtools/source/filter.vcl/wmf/winwmf.cxx b/svtools/source/filter.vcl/wmf/winwmf.cxx index 0930b0ece8a8..54629383a4f8 100644 --- a/svtools/source/filter.vcl/wmf/winwmf.cxx +++ b/svtools/source/filter.vcl/wmf/winwmf.cxx @@ -32,6 +32,7 @@ #include "precompiled_svtools.hxx" #include "winmtf.hxx" +#include #include #include #include @@ -831,81 +832,136 @@ void WMFReader::ReadRecordParams( USHORT nFunc ) pWMF->SetError( SVSTREAM_FILEFORMAT_ERROR ); break; } - if ( nRecSize >= 12 ) // minimal escape lenght + if ( nRecSize >= 4 ) // minimal escape lenght { - sal_uInt16 nMode, nLen, OO; - sal_uInt32 Magic, nCheck,nEsc; + sal_uInt16 nMode, nLen; *pWMF >> nMode - >> nLen - >> OO - >> Magic - >> nCheck - >> nEsc; - if ( ( nMode == W_MFCOMMENT ) && ( nLen >= 14 ) && ( OO == 0x4f4f ) && ( Magic == 0xa2c2a ) ) + >> nLen; + if ( ( nMode == W_MFCOMMENT ) && ( nLen >= 4 ) ) { - sal_uInt32 nEscLen = nLen - 14; - if ( nEscLen <= ( nRecSize * 2 ) ) + sal_uInt32 nNewMagic; // we have to read int32 for + *pWMF >> nNewMagic; // META_ESCAPE_ENHANCED_METAFILE CommentIdentifier + + if( nNewMagic == 0x2c2a4f4f && nLen >= 14 ) { + sal_uInt16 nMagic2; + *pWMF >> nMagic2; + if( nMagic2 == 0x0a ) // 2nd half of magic + { // continue with private escape + sal_uInt32 nCheck, nEsc; + *pWMF >> nCheck + >> nEsc; + + sal_uInt32 nEscLen = nLen - 14; + if ( nEscLen <= ( nRecSize * 2 ) ) + { #ifdef OSL_BIGENDIAN - sal_uInt32 nTmp = SWAPLONG( nEsc ); - sal_uInt32 nCheckSum = rtl_crc32( 0, &nTmp, 4 ); + sal_uInt32 nTmp = SWAPLONG( nEsc ); + sal_uInt32 nCheckSum = rtl_crc32( 0, &nTmp, 4 ); #else - sal_uInt32 nCheckSum = rtl_crc32( 0, &nEsc, 4 ); + sal_uInt32 nCheckSum = rtl_crc32( 0, &nEsc, 4 ); #endif - sal_Int8* pData = NULL; + sal_Int8* pData = NULL; - if ( ( static_cast< sal_uInt64 >( nEscLen ) + pWMF->Tell() ) > nMetaRecEndPos ) - { - pWMF->SetError( SVSTREAM_FILEFORMAT_ERROR ); - break; - } - if ( nEscLen > 0 ) - { - pData = new sal_Int8[ nEscLen ]; - pWMF->Read( pData, nEscLen ); - nCheckSum = rtl_crc32( nCheckSum, pData, nEscLen ); - } - if ( nCheck == nCheckSum ) - { - switch( nEsc ) - { - case PRIVATE_ESCAPE_UNICODE : - { // we will use text instead of polygons only if we have the correct font - if ( aVDev.IsFontAvailable( pOut->GetFont().GetName() ) ) + if ( ( static_cast< sal_uInt64 >( nEscLen ) + pWMF->Tell() ) > nMetaRecEndPos ) + { + pWMF->SetError( SVSTREAM_FILEFORMAT_ERROR ); + break; + } + if ( nEscLen > 0 ) + { + pData = new sal_Int8[ nEscLen ]; + pWMF->Read( pData, nEscLen ); + nCheckSum = rtl_crc32( nCheckSum, pData, nEscLen ); + } + if ( nCheck == nCheckSum ) + { + switch( nEsc ) { - Point aPt; - String aString; - sal_uInt32 i, nStringLen, nDXCount; - sal_Int32* pDXAry = NULL; - SvMemoryStream aMemoryStream( nEscLen ); - aMemoryStream.Write( pData, nEscLen ); - aMemoryStream.Seek( STREAM_SEEK_TO_BEGIN ); - aMemoryStream >> aPt.X() - >> aPt.Y() - >> nStringLen; - - if ( ( static_cast< sal_uInt64 >( nStringLen ) * sizeof( sal_Unicode ) ) < ( nEscLen - aMemoryStream.Tell() ) ) - { - sal_Unicode* pBuf = aString.AllocBuffer( (xub_StrLen)nStringLen ); - for ( i = 0; i < nStringLen; i++ ) - aMemoryStream >> pBuf[ i ]; - aMemoryStream >> nDXCount; - if ( ( static_cast< sal_uInt64 >( nDXCount ) * sizeof( sal_Int32 ) ) >= ( nEscLen - aMemoryStream.Tell() ) ) - nDXCount = 0; - if ( nDXCount ) - pDXAry = new sal_Int32[ nDXCount ]; - for ( i = 0; i < nDXCount; i++ ) - aMemoryStream >> pDXAry[ i ]; - aMemoryStream >> nSkipActions; - pOut->DrawText( aPt, aString, pDXAry ); - delete[] pDXAry; + case PRIVATE_ESCAPE_UNICODE : + { // we will use text instead of polygons only if we have the correct font + if ( aVDev.IsFontAvailable( pOut->GetFont().GetName() ) ) + { + Point aPt; + String aString; + sal_uInt32 i, nStringLen, nDXCount; + sal_Int32* pDXAry = NULL; + SvMemoryStream aMemoryStream( nEscLen ); + aMemoryStream.Write( pData, nEscLen ); + aMemoryStream.Seek( STREAM_SEEK_TO_BEGIN ); + aMemoryStream >> aPt.X() + >> aPt.Y() + >> nStringLen; + + if ( ( static_cast< sal_uInt64 >( nStringLen ) * sizeof( sal_Unicode ) ) < ( nEscLen - aMemoryStream.Tell() ) ) + { + sal_Unicode* pBuf = aString.AllocBuffer( (xub_StrLen)nStringLen ); + for ( i = 0; i < nStringLen; i++ ) + aMemoryStream >> pBuf[ i ]; + aMemoryStream >> nDXCount; + if ( ( static_cast< sal_uInt64 >( nDXCount ) * sizeof( sal_Int32 ) ) >= ( nEscLen - aMemoryStream.Tell() ) ) + nDXCount = 0; + if ( nDXCount ) + pDXAry = new sal_Int32[ nDXCount ]; + for ( i = 0; i < nDXCount; i++ ) + aMemoryStream >> pDXAry[ i ]; + aMemoryStream >> nSkipActions; + pOut->DrawText( aPt, aString, pDXAry ); + delete[] pDXAry; + } + } } + break; } } - break; + delete[] pData; + } + } + } + else if ( nNewMagic == 0x43464D57 && nLen >= 34 && ( nLen + 10 <= nRecSize * 2 )) + { + sal_uInt32 nComType, nVersion, nFlags, nComRecCount, + nCurRecSize, nRemainingSize, nEMFTotalSize; + sal_uInt16 nCheck; + + *pWMF >> nComType >> nVersion >> nCheck >> nFlags + >> nComRecCount >> nCurRecSize + >> nRemainingSize >> nEMFTotalSize; // the nRemainingSize is not mentioned in MSDN documentation + // but it seems to be required to read in data produced by OLE + + if( nComType == 0x01 && nVersion == 0x10000 && nComRecCount ) + { + if( !nEMFRec ) + { // first EMF comment + nEMFRecCount = nComRecCount; + nEMFSize = nEMFTotalSize; + pEMFStream = new SvMemoryStream( nEMFSize ); + } + else if( ( nEMFRecCount != nComRecCount ) || ( nEMFSize != nEMFTotalSize ) ) // add additional checks here + { + // total records should be the same as in previous comments + nEMFRecCount = 0xFFFFFFFF; + delete pEMFStream; + pEMFStream = NULL; + } + nEMFRec++; + + if( pEMFStream && nCurRecSize + 34 > nLen ) + { + nEMFRecCount = 0xFFFFFFFF; + delete pEMFStream; + pEMFStream = NULL; + } + + if( pEMFStream ) + { + sal_Int8* pBuf = new sal_Int8[ nCurRecSize ]; + sal_uInt32 nCount = pWMF->Read( pBuf, nCurRecSize ); + if( nCount == nCurRecSize ) + pEMFStream->Write( pBuf, nCount ); + delete[] pBuf; } } - delete[] pData; } } } @@ -1023,6 +1079,11 @@ void WMFReader::ReadWMF() nCurrentAction = 0; nUnicodeEscapeAction = 0; + pEMFStream = NULL; + nEMFRecCount = 0; + nEMFRec = 0; + nEMFSize = 0; + pOut->SetMapMode( MM_ANISOTROPIC ); pOut->SetWinOrg( Point() ); pOut->SetWinExt( Size( 1, 1 ) ); @@ -1070,6 +1131,33 @@ void WMFReader::ReadWMF() ReadRecordParams( nFunction ); else nSkipActions--; + + if( pEMFStream && nEMFRecCount == nEMFRec ) + { + GDIMetaFile aMeta; + pEMFStream->Seek( 0 ); + EnhWMFReader* pEMFReader = new EnhWMFReader ( *pEMFStream, aMeta ); + BOOL bRead = pEMFReader->ReadEnhWMF(); + delete pEMFReader; // destroy first!!! + + if( bRead ) + { + pOut->AddFromGDIMetaFile( aMeta ); + pOut->SetrclFrame( Rectangle(0, 0, aMeta.GetPrefSize().Width(), aMeta.GetPrefSize().Height() )); + // we have successfully read the embedded EMF data + // no need to process WMF data further + break; + } + else + { + // something went wrong + // continue with WMF, don't try this again + delete pEMFStream; + pEMFStream = NULL; + } + + } + nPos += nRecSize * 2; if ( nPos <= nEndPos ) pWMF->Seek( nPos ); @@ -1333,3 +1421,9 @@ sal_Bool WMFReader::GetPlaceableBound( Rectangle& rPlaceableBound, SvStream* pSt return bRet; } +WMFReader::~WMFReader() +{ + if( pEMFStream ) + delete pEMFStream; +} + diff --git a/svtools/source/filter.vcl/wmf/wmfwr.cxx b/svtools/source/filter.vcl/wmf/wmfwr.cxx index ee3a71c51f9d..f6ff58426a6a 100644 --- a/svtools/source/filter.vcl/wmf/wmfwr.cxx +++ b/svtools/source/filter.vcl/wmf/wmfwr.cxx @@ -33,6 +33,7 @@ #include #include "wmfwr.hxx" +#include "emfwr.hxx" #include #include #include @@ -1807,6 +1808,7 @@ BOOL WMFWriter::WriteWMF( const GDIMetaFile& rMTF, SvStream& rTargetStream, { WMFWriterAttrStackMember * pAt; + bEmbedEMF = TRUE; bStatus=TRUE; pConvert = 0; pVirDev = new VirtualDevice; @@ -1870,6 +1872,8 @@ BOOL WMFWriter::WriteWMF( const GDIMetaFile& rMTF, SvStream& rTargetStream, CountActionsAndBitmaps(rMTF); WriteHeader(rMTF,bPlaceable); + if( bEmbedEMF ) + WriteEmbeddedEMF( rMTF ); WMFRecord_SetWindowOrg(Point(0,0)); WMFRecord_SetWindowExt(rMTF.GetPrefSize()); WMFRecord_SetBkMode( TRUE ); @@ -1948,3 +1952,79 @@ USHORT WMFWriter::CalcSaveTargetMapMode(MapMode& rMapMode, return nDivisor; } + +// ------------------------------------------------------------------------ + +void WMFWriter::WriteEmbeddedEMF( const GDIMetaFile& rMTF ) +{ + EMFWriter aEMFWriter; + SvMemoryStream aStream; + if( aEMFWriter.WriteEMF( rMTF, aStream ) ) + { + aStream.Seek( 0 ); + sal_Size nTotalSize = aStream.GetSize(); + if( nTotalSize > SAL_MAX_UINT32 ) + return; + sal_uInt32 nRemainingSize = static_cast< sal_uInt32 >( nTotalSize ); + sal_uInt32 nRecCounts = ( (nTotalSize - 1) / 0x2000 ) + 1; + sal_uInt16 nCheckSum = 0, nWord; + + sal_uInt32 nPos = 0; + + while( nPos + 1 < nTotalSize ) + { + aStream >> nWord; + nCheckSum ^= nWord; + nPos += 2; + } + + nCheckSum = static_cast< sal_uInt16 >( nCheckSum * -1 ); + + aStream.Seek( 0 ); + while( nRemainingSize > 0 ) + { + sal_uInt32 nCurSize; + if( nRemainingSize > 0x2000 ) + { + nCurSize = 0x2000; + nRemainingSize -= 0x2000; + } + else + { + nCurSize = nRemainingSize; + nRemainingSize = 0; + } + WriteEMFRecord( aStream, + nCurSize, + nRemainingSize, + nTotalSize, + nRecCounts, + nCheckSum ); + nCheckSum = 0; + } + } +} + +// ------------------------------------------------------------------------ + +void WMFWriter::WriteEMFRecord( SvMemoryStream& rStream, sal_uInt32 nCurSize, sal_uInt32 nRemainingSize, + sal_uInt32 nTotalSize, sal_uInt32 nRecCounts, sal_uInt16 nCheckSum ) +{ + // according to http://msdn.microsoft.com/en-us/library/dd366152%28PROT.13%29.aspx + WriteRecordHeader( 0, W_META_ESCAPE ); + *pWMF << (sal_uInt16)W_MFCOMMENT // same as META_ESCAPE_ENHANCED_METAFILE + << (sal_uInt16)( nCurSize + 34 ) // we will always have a 34 byte escape header: + << (sal_uInt32) 0x43464D57 // WMFC + << (sal_uInt32) 0x00000001 // Comment type + << (sal_uInt32) 0x00010000 // version + << nCheckSum // check sum + << (sal_uInt32) 0 // flags = 0 + << nRecCounts // total number of records + << nCurSize // size of this record's data + << nRemainingSize // remaining size of data in following records, missing in MSDN documentation + << nTotalSize; // total size of EMF stream + + pWMF->Write( static_cast< const sal_Char* >( rStream.GetData() ) + rStream.Tell(), nCurSize ); + rStream.SeekRel( nCurSize ); + UpdateRecordHeader(); +} diff --git a/svtools/source/filter.vcl/wmf/wmfwr.hxx b/svtools/source/filter.vcl/wmf/wmfwr.hxx index 48986a280404..a98b496a17e2 100644 --- a/svtools/source/filter.vcl/wmf/wmfwr.hxx +++ b/svtools/source/filter.vcl/wmf/wmfwr.hxx @@ -128,6 +128,8 @@ private: ULONG nWrittenBitmaps; // Anzahl der bereits geschriebenen Bitmaps ULONG nActBitmapPercent; // Wieviel Prozent die naechste Bitmap schon geschrieben ist. + BOOL bEmbedEMF; // optionally embedd EMF data into WMF + void MayCallback(); // Berechnet anhand der obigen 5 Parameter eine Prozentzahl // und macht dann ggf. einen Callback. Setzt bStatus auf FALSE wenn User abbrechen @@ -207,6 +209,13 @@ private: void WriteHeader(const GDIMetaFile & rMTF, BOOL bPlaceable); void UpdateHeader(); + void WriteEmbeddedEMF( const GDIMetaFile& rMTF ); + void WriteEMFRecord( SvMemoryStream& rStream, sal_uInt32 nCurSize, + sal_uInt32 nRemainingSize, + sal_uInt32 nTotalSize, + sal_uInt32 nRecCounts, + sal_uInt16 nCheckSum ); + USHORT CalcSaveTargetMapMode(MapMode& rMapMode, const Size& rPrefSize); public: -- cgit v1.2.3 From a79c517a0ca64c79b3b2694b19b28b81dec2346e Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 3 Dec 2009 17:51:33 +0100 Subject: vcl108: #i106833# sort encoding to get correct subsetted font --- vcl/unx/source/printergfx/glyphset.cxx | 38 +++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/vcl/unx/source/printergfx/glyphset.cxx b/vcl/unx/source/printergfx/glyphset.cxx index 156517d98220..5adff6683267 100644 --- a/vcl/unx/source/printergfx/glyphset.cxx +++ b/vcl/unx/source/printergfx/glyphset.cxx @@ -46,6 +46,7 @@ #include #include +#include using namespace vcl; using namespace psp; @@ -785,6 +786,17 @@ GlyphSet::PSUploadEncoding(osl::File* pOutFile, PrinterGfx &rGfx) return sal_True; } +struct EncEntry +{ + sal_uChar aEnc; + long aGID; + + EncEntry() : aEnc( 0 ), aGID( 0 ) {} + + bool operator<( const EncEntry& rRight ) const + { return aEnc < rRight.aEnc; } +}; + static void CreatePSUploadableFont( TrueTypeFont* pSrcFont, FILE* pTmpFile, const char* pGlyphSetName, int nGlyphCount, /*const*/ sal_uInt16* pRequestedGlyphs, /*const*/ sal_uChar* pEncoding, @@ -796,17 +808,29 @@ static void CreatePSUploadableFont( TrueTypeFont* pSrcFont, FILE* pTmpFile, if( bAllowType42 ) nTargetMask |= FontSubsetInfo::TYPE42_FONT; + std::vector< EncEntry > aSorted( nGlyphCount, EncEntry() ); + for( int i = 0; i < nGlyphCount; i++ ) + { + aSorted[i].aEnc = pEncoding[i]; + aSorted[i].aGID = pRequestedGlyphs[i]; + } + + std::stable_sort( aSorted.begin(), aSorted.end() ); + + std::vector< sal_uChar > aEncoding( nGlyphCount ); + std::vector< long > aRequestedGlyphs( nGlyphCount ); + + for( int i = 0; i < nGlyphCount; i++ ) + { + aEncoding[i] = aSorted[i].aEnc; + aRequestedGlyphs[i] = aSorted[i].aGID; + } + FontSubsetInfo aInfo; aInfo.LoadFont( pSrcFont ); -#if 1 // TODO: remove 16bit->long conversion when input args has been changed - long aRequestedGlyphs[256]; - for( int i = 0; i < nGlyphCount; ++i ) - aRequestedGlyphs[i] = pRequestedGlyphs[i]; -#endif - aInfo.CreateFontSubset( nTargetMask, pTmpFile, pGlyphSetName, - aRequestedGlyphs, pEncoding, nGlyphCount, NULL ); + &aRequestedGlyphs[0], &aEncoding[0], nGlyphCount, NULL ); } sal_Bool -- cgit v1.2.3 From 66ad3e12c985a02c98785280b6660527f9a03dbf Mon Sep 17 00:00:00 2001 From: sj Date: Fri, 4 Dec 2009 16:59:41 +0100 Subject: impress181: #i105480#: applied patch (using HeaderExtionsion2 now, fixed EMR_EOF record, added bounding rectangle to EMR_FILLPATH and EMR_STROKEPATH, now closing pathes properly, resolution changed from pixel to 100th_mm) --- svtools/source/filter.vcl/wmf/emfwr.cxx | 103 +++++++++++++++++++++----------- svtools/source/filter.vcl/wmf/emfwr.hxx | 1 + 2 files changed, 68 insertions(+), 36 deletions(-) diff --git a/svtools/source/filter.vcl/wmf/emfwr.cxx b/svtools/source/filter.vcl/wmf/emfwr.cxx index df56afc4a250..dc193e489166 100644 --- a/svtools/source/filter.vcl/wmf/emfwr.cxx +++ b/svtools/source/filter.vcl/wmf/emfwr.cxx @@ -162,6 +162,8 @@ #define TA_RTLREADING 256 #define TA_MASK (TA_BASELINE+TA_CENTER+TA_UPDATECP+TA_RTLREADING) +#define MM_ANISOTROPIC 8 + // ------------- // - EMFWriter - // ------------- @@ -181,19 +183,37 @@ BOOL EMFWriter::WriteEMF( const GDIMetaFile& rMtf, SvStream& rOStm, FilterConfig maVDev.SetMapMode( rMtf.GetPrefMapMode() ); mpFilterConfigItem = pFilterConfigItem; + // don't work with pixel as destination map mode -> higher resolution preferrable + maDestMapMode.SetMapUnit( MAP_100TH_MM ); + const Size aMtfSizePix( maVDev.LogicToPixel( rMtf.GetPrefSize(), rMtf.GetPrefMapMode() ) ); const Size aMtfSizeLog( maVDev.LogicToLogic( rMtf.GetPrefSize(), rMtf.GetPrefMapMode(), MAP_100TH_MM ) ); // seek over header - rOStm.SeekRel( 100 ); + // use [MS-EMF 2.2.11] HeaderExtension2 Object, otherwise resulting EMF cannot be converted with GetWinMetaFileBits() + rOStm.SeekRel( 108 ); // write initial values - ImplBeginRecord( WIN_EMR_SETWINDOWORGEX ); - (*mpStm) << (INT32) 0 << (INT32) 0; + + // set 100th mm map mode in EMF + ImplBeginRecord( WIN_EMR_SETMAPMODE ); + (*mpStm) << (INT32) MM_ANISOTROPIC; + ImplEndRecord(); + + ImplBeginRecord( WIN_EMR_SETVIEWPORTEXTEX ); + (*mpStm) << (INT32) maVDev.ImplGetDPIX() << (INT32) maVDev.ImplGetDPIY(); ImplEndRecord(); ImplBeginRecord( WIN_EMR_SETWINDOWEXTEX ); - (*mpStm) << (INT32) aMtfSizePix.Width() << (INT32) aMtfSizePix.Height(); + (*mpStm) << (INT32) 2540 << (INT32) 2540; + ImplEndRecord(); + + ImplBeginRecord( WIN_EMR_SETVIEWPORTORGEX ); + (*mpStm) << (INT32) 0 << (INT32) 0; + ImplEndRecord(); + + ImplBeginRecord( WIN_EMR_SETWINDOWORGEX ); + (*mpStm) << (INT32) 0 << (INT32) 0; ImplEndRecord(); ImplWriteRasterOp( ROP_OVERPAINT ); @@ -207,7 +227,7 @@ BOOL EMFWriter::WriteEMF( const GDIMetaFile& rMtf, SvStream& rOStm, FilterConfig ImplBeginRecord( WIN_EMR_EOF ); (*mpStm)<< (sal_uInt32)0 // nPalEntries - << (sal_uInt32)0x16 // offPalEntries + << (sal_uInt32)0x10 // offPalEntries << (sal_uInt32)0x14; // nSizeLast ImplEndRecord(); @@ -215,14 +235,15 @@ BOOL EMFWriter::WriteEMF( const GDIMetaFile& rMtf, SvStream& rOStm, FilterConfig // write header const ULONG nEndPos = mpStm->Tell(); mpStm->Seek( nHeaderPos ); - (*mpStm) << (UINT32) 0x00000001 << (UINT32) 100; - (*mpStm) << (INT32) 0 << (INT32) 0 << (INT32) ( aMtfSizePix.Width() - 1 ) << (INT32) ( aMtfSizePix.Height() - 1 ); - (*mpStm) << (INT32) 0 << (INT32) 0 << (INT32) ( aMtfSizeLog.Width() - 1 ) << (INT32) ( aMtfSizeLog.Height() - 1 ); - (*mpStm) << (UINT32) 0x464d4520 << (UINT32) 0x10000 << (UINT32) ( nEndPos - nHeaderPos ); - (*mpStm) << (UINT32) mnRecordCount << (UINT16) ( mnHandleCount + 1 ) << (UINT16) 0 << (UINT32) 0 << (UINT32) 0 << (UINT32) 0; - (*mpStm) << (INT32) aMtfSizePix.Width() << (INT32) aMtfSizePix.Height(); - (*mpStm) << (INT32) ( aMtfSizeLog.Width() / 100 ) << (INT32) ( aMtfSizeLog.Height() / 100 ); - (*mpStm) << (UINT32) 0 << (UINT32) 0 << (UINT32) 0; + (*mpStm) << (UINT32) 0x00000001 << (UINT32) 108 //use [MS-EMF 2.2.11] HeaderExtension2 Object + << (INT32) 0 << (INT32) 0 << (INT32) ( aMtfSizePix.Width() - 1 ) << (INT32) ( aMtfSizePix.Height() - 1 ) + << (INT32) 0 << (INT32) 0 << (INT32) ( aMtfSizeLog.Width() - 1 ) << (INT32) ( aMtfSizeLog.Height() - 1 ) + << (UINT32) 0x464d4520 << (UINT32) 0x10000 << (UINT32) ( nEndPos - nHeaderPos ) + << (UINT32) mnRecordCount << (UINT16) ( mnHandleCount + 1 ) << (UINT16) 0 << (UINT32) 0 << (UINT32) 0 << (UINT32) 0 + << (INT32) aMtfSizePix.Width() << (INT32) aMtfSizePix.Height() + << (INT32) ( aMtfSizeLog.Width() / 100 ) << (INT32) ( aMtfSizeLog.Height() / 100 ) + << (UINT32) 0 << (UINT32) 0 << (UINT32) 0 + << (INT32) ( aMtfSizeLog.Width() * 10 ) << (INT32) ( aMtfSizeLog.Height() * 10 ); //use [MS-EMF 2.2.11] HeaderExtension2 Object mpStm->Seek( nEndPos ); delete[] mpHandlesUsed; @@ -520,35 +541,32 @@ void EMFWriter::ImplWriteRasterOp( RasterOp eRop ) void EMFWriter::ImplWriteExtent( long nExtent ) { - const Size aSize( maVDev.LogicToPixel( Size( nExtent, nExtent ) ) ); - (*mpStm) << (INT32) aSize.Width(); + nExtent = maVDev.LogicToLogic( Size( nExtent, 0 ), maVDev.GetMapMode(), maDestMapMode ).Width(); + (*mpStm) << (INT32) nExtent; } // ----------------------------------------------------------------------------- void EMFWriter::ImplWritePoint( const Point& rPoint ) { - const Point aPoint( maVDev.LogicToPixel( rPoint ) ); - - (*mpStm) << (INT32) aPoint.X() << (INT32) aPoint.Y(); + const Point aPoint( maVDev.LogicToLogic( rPoint, maVDev.GetMapMode(), maDestMapMode )); + (*mpStm) << (INT32) aPoint.X() << (INT32) aPoint.Y(); } // ----------------------------------------------------------------------------- void EMFWriter::ImplWriteSize( const Size& rSize) { - const Size aSize( maVDev.LogicToPixel( rSize ) ); - - (*mpStm) << (INT32) aSize.Width() << (INT32) aSize.Height(); + const Size aSize( maVDev.LogicToLogic( rSize, maVDev.GetMapMode(), maDestMapMode )); + (*mpStm) << (INT32) aSize.Width() << (INT32) aSize.Height(); } // ----------------------------------------------------------------------------- void EMFWriter::ImplWriteRect( const Rectangle& rRect ) { - const Rectangle aRect( maVDev.LogicToPixel( rRect ) ); - - (*mpStm) << aRect.Left() << aRect.Top() << aRect.Right() << aRect.Bottom(); + const Rectangle aRect( maVDev.LogicToLogic ( rRect, maVDev.GetMapMode(), maDestMapMode )); + (*mpStm) << aRect.Left() << aRect.Top() << aRect.Right() << aRect.Bottom(); } // ----------------------------------------------------------------------------- @@ -647,12 +665,20 @@ void EMFWriter::ImplWritePath( const PolyPolygon& rPolyPoly, sal_Bool bClosed ) const Polygon& rPoly = rPolyPoly[ i ]; while ( n < rPoly.GetSize() ) { - sal_uInt16 nBezPoints = 0; - if ( n ) + if( n == 0 ) { - while ( ( ( nBezPoints + n + 2 ) < rPoly.GetSize() ) && ( rPoly.GetFlags( nBezPoints + n ) == POLY_CONTROL ) ) - nBezPoints += 3; + ImplBeginRecord( WIN_EMR_MOVETOEX ); + ImplWritePoint( rPoly[ 0 ] ); + ImplEndRecord(); + n++; + continue; } + + sal_uInt16 nBezPoints = 0; + + while ( ( ( nBezPoints + n + 2 ) < rPoly.GetSize() ) && ( rPoly.GetFlags( nBezPoints + n ) == POLY_CONTROL ) ) + nBezPoints += 3; + if ( nBezPoints ) { ImplBeginRecord( WIN_EMR_POLYBEZIERTO ); @@ -672,22 +698,26 @@ void EMFWriter::ImplWritePath( const PolyPolygon& rPolyPoly, sal_Bool bClosed ) sal_uInt16 nPoints = 1; while( ( nPoints + n ) < rPoly.GetSize() && ( rPoly.GetFlags( nPoints + n ) != POLY_CONTROL ) ) nPoints++; - ImplBeginRecord( WIN_EMR_MOVETOEX ); - ImplWritePoint( rPoly[ n ] ); - ImplEndRecord(); + if ( nPoints > 1 ) { ImplBeginRecord( WIN_EMR_POLYLINETO ); - Polygon aNewPoly( nPoints ); - aNewPoly[ 0 ] = rPoly[ n ]; - for ( o = 1; o < nPoints; o++ ) - aNewPoly[ o ] = rPoly[ n + o ]; + Polygon aNewPoly( nPoints + 1 ); + aNewPoly[ 0 ] = rPoly[ n - 1]; + for ( o = 1; o <= nPoints; o++ ) + aNewPoly[ o ] = rPoly[ n - 1 + o ]; ImplWriteRect( aNewPoly.GetBoundRect() ); - (*mpStm) << (sal_uInt32)( nPoints - 1 ); + (*mpStm) << (sal_uInt32)( nPoints ); for( o = 1; o < aNewPoly.GetSize(); o++ ) ImplWritePoint( aNewPoly[ o ] ); ImplEndRecord(); } + else + { + ImplBeginRecord( WIN_EMR_LINETO ); + ImplWritePoint( rPoly[ n ] ); + ImplEndRecord(); + } n = n + nPoints; } if ( bClosed && ( n == rPoly.GetSize() ) ) @@ -700,6 +730,7 @@ void EMFWriter::ImplWritePath( const PolyPolygon& rPolyPoly, sal_Bool bClosed ) ImplBeginRecord( WIN_EMR_ENDPATH ); ImplEndRecord(); ImplBeginRecord( bClosed ? WIN_EMR_FILLPATH : WIN_EMR_STROKEPATH ); + ImplWriteRect( rPolyPoly.GetBoundRect() ); ImplEndRecord(); } diff --git a/svtools/source/filter.vcl/wmf/emfwr.hxx b/svtools/source/filter.vcl/wmf/emfwr.hxx index 150aa1692ade..2994a10d81f1 100644 --- a/svtools/source/filter.vcl/wmf/emfwr.hxx +++ b/svtools/source/filter.vcl/wmf/emfwr.hxx @@ -47,6 +47,7 @@ class EMFWriter private: VirtualDevice maVDev; + MapMode maDestMapMode; FilterConfigItem* mpFilterConfigItem; SvStream* mpStm; BOOL* mpHandlesUsed; -- cgit v1.2.3 From d5adb4b029ec99f46c114f238bdd5ebc5c2d768f Mon Sep 17 00:00:00 2001 From: hdu Date: Mon, 7 Dec 2009 09:43:27 +0100 Subject: #i107415# fix caching problem for big-sized graphite fonts (thanks kstribley!) --- vcl/inc/vcl/graphite_cache.hxx | 4 +++- vcl/source/glyphs/graphite_layout.cxx | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/vcl/inc/vcl/graphite_cache.hxx b/vcl/inc/vcl/graphite_cache.hxx index 5a537c5f1e48..73e3e2c9f1fe 100644 --- a/vcl/inc/vcl/graphite_cache.hxx +++ b/vcl/inc/vcl/graphite_cache.hxx @@ -58,10 +58,11 @@ public: void clear(); #ifdef GRCACHE_REUSE_VECTORS void setGlyphVectors(long nWidth, GraphiteLayout::Glyphs & vGlyphs, std::vector vCharDxs, - std::vector & vChar2Base, std::vector & vGlyph2Char) + std::vector & vChar2Base, std::vector & vGlyph2Char, float fScale) { clearVectors(); mnWidth = nWidth; + m_fontScale = fScale; mvGlyphs.insert(mvGlyphs.begin(), vGlyphs.begin(), vGlyphs.end()); mvCharDxs.insert(mvCharDxs.begin(),vCharDxs.begin(),vCharDxs.end()); mvChar2BaseGlyph.insert(mvChar2BaseGlyph.begin(),vChar2Base.begin(),vChar2Base.end()); @@ -78,6 +79,7 @@ public: const std::vector & charDxs() const { return mvCharDxs; } const std::vector & char2BaseGlyph() const { return mvChar2BaseGlyph; } const std::vector & glyph2Char() const { return mvGlyph2Char; } + float & fontScale() { return m_fontScale; } #endif private: rtl::OUString * m_rope; diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx index 86dee2749efa..c09062108dda 100644 --- a/vcl/source/glyphs/graphite_layout.cxx +++ b/vcl/source/glyphs/graphite_layout.cxx @@ -720,6 +720,7 @@ bool GraphiteLayout::LayoutGlyphs(ImplLayoutArgs& rArgs, gr::Segment * pSegment) #ifdef GRCACHE_REUSE_VECTORS // if we have an exact match, then we can reuse the glyph vectors from before if (pSegRecord && (pSegRecord->glyphs().size() > 0) && + (pSegRecord->fontScale() == mfScaling) && !(SAL_LAYOUT_FOR_FALLBACK & rArgs.mnFlags) ) { mnWidth = pSegRecord->width(); @@ -765,7 +766,8 @@ bool GraphiteLayout::LayoutGlyphs(ImplLayoutArgs& rArgs, gr::Segment * pSegment) !(SAL_LAYOUT_FOR_FALLBACK & rArgs.mnFlags)) { pSegRecord->setGlyphVectors(mnWidth, mvGlyphs, mvCharDxs, - mvChar2BaseGlyph, mvGlyph2Char); + mvChar2BaseGlyph, mvGlyph2Char, + mfScaling); } #endif #endif -- cgit v1.2.3 From 5d02e362626ba0b181a9e08bac1241ef5c2ec8a9 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Mon, 7 Dec 2009 10:31:48 +0100 Subject: i107484 - Fixed interaction continuations for FutureDocumentVersionProductUpdateRequest --- sfx2/source/doc/objstor.cxx | 50 +- uui/source/iahndl.cxx | 2183 +++++++++++++++++++++---------------------- uui/source/iahndl.hxx | 327 +++---- 3 files changed, 1246 insertions(+), 1314 deletions(-) diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 21515b2c6f3d..19873a5d7c7f 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -870,7 +870,7 @@ sal_Bool SfxObjectShell::DoLoad( SfxMedium *pMed ) ::rtl::Reference< ::comphelper::OInteractionRequest > pRequest = new ::comphelper::OInteractionRequest( makeAny( aUpdateRequest ) ); pRequest->addContinuation( new ::comphelper::OInteractionApprove ); - pRequest->addContinuation( new ::comphelper::OInteractionDisapprove ); + pRequest->addContinuation( new ::comphelper::OInteractionAbort ); typedef ::comphelper::OInteraction< XInteractionAskLater > OInteractionAskLater; OInteractionAskLater* pLater = new OInteractionAskLater; @@ -953,27 +953,27 @@ sal_uInt32 SfxObjectShell::HandleFilter( SfxMedium* pMedium, SfxObjectShell* pDo if ( !pFORequest->isAbort() ) { - SfxAllItemSet aNewParams( pDoc->GetPool() ); - TransformParameters( SID_OPENDOC, - pFORequest->getFilterOptions(), - aNewParams, - NULL ); - - SFX_ITEMSET_ARG( &aNewParams, - pFilterOptions, - SfxStringItem, - SID_FILE_FILTEROPTIONS, - sal_False ); - if ( pFilterOptions ) - pSet->Put( *pFilterOptions ); - - SFX_ITEMSET_ARG( &aNewParams, - pFilterData, - SfxUnoAnyItem, - SID_FILTER_DATA, - sal_False ); - if ( pFilterData ) - pSet->Put( *pFilterData ); + SfxAllItemSet aNewParams( pDoc->GetPool() ); + TransformParameters( SID_OPENDOC, + pFORequest->getFilterOptions(), + aNewParams, + NULL ); + + SFX_ITEMSET_ARG( &aNewParams, + pFilterOptions, + SfxStringItem, + SID_FILE_FILTEROPTIONS, + sal_False ); + if ( pFilterOptions ) + pSet->Put( *pFilterOptions ); + + SFX_ITEMSET_ARG( &aNewParams, + pFilterData, + SfxUnoAnyItem, + SID_FILTER_DATA, + sal_False ); + if ( pFilterData ) + pSet->Put( *pFilterData ); } else bAbort = TRUE; @@ -1797,8 +1797,8 @@ sal_Bool SfxObjectShell::SaveTo_Impl #define CHAR_POINTER(THE_OUSTRING) ::rtl::OUStringToOString (THE_OUSTRING, RTL_TEXTENCODING_UTF8).pData->buffer // Header for a single-valued ASCII EA data item typedef struct _EA_ASCII_header { - USHORT usAttr; /* value: EAT_ASCII */ - USHORT usLen; /* length of data */ + USHORT usAttr; /* value: EAT_ASCII */ + USHORT usLen; /* length of data */ CHAR szType[_MAX_PATH]; /* ASCII data fits in here ... */ } EA_ASCII_HEADER; char filePath[_MAX_PATH]; @@ -3424,7 +3424,7 @@ sal_Bool SfxObjectShell::SaveCompleted( const uno::Reference< embed::XStorage >& sal_Bool StoragesOfUnknownMediaTypeAreCopied_Impl( const uno::Reference< embed::XStorage >& xSource, - const uno::Reference< embed::XStorage >& xTarget ) + const uno::Reference< embed::XStorage >& xTarget ) { OSL_ENSURE( xSource.is() && xTarget.is(), "Source and/or target storages are not available!\n" ); if ( !xSource.is() || !xTarget.is() || xSource == xTarget ) diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx index e64ac960d08e..d6f414569a20 100644 --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -40,7 +40,7 @@ #include "com/sun/star/beans/XPropertyAccess.hpp" #include "com/sun/star/configuration/backend/MergeRecoveryRequest.hpp" #include "com/sun/star/configuration/backend/StratumCreationException.hpp" -#include +#include "com/sun/star/container/XHierarchicalNameAccess.hpp" #include "com/sun/star/container/XContainerQuery.hpp" #include "com/sun/star/container/XNameAccess.hpp" #include "com/sun/star/container/XNameContainer.hpp" @@ -103,12 +103,11 @@ #include "com/sun/star/ucb/XInteractionSupplyAuthentication.hpp" #include "com/sun/star/ucb/XInteractionSupplyAuthentication2.hpp" #include "com/sun/star/ucb/XInteractionSupplyName.hpp" -#include +#include "com/sun/star/ui/dialogs/XExecutableDialog.hpp" #include "com/sun/star/uno/RuntimeException.hpp" #include "com/sun/star/xforms/InvalidDataOnSubmitException.hpp" -#include -#include - +#include "com/sun/star/security/CertificateValidity.hpp" +#include "com/sun/star/lang/XInitialization.hpp" #include "vos/mutex.hxx" #include "tools/rcid.h" @@ -116,6 +115,7 @@ #include "svtools/svtools.hrc" #include "svtools/httpcook.hxx" #include "svtools/sfxecode.hxx" +#include "svtools/zforlist.hxx" #include "toolkit/helper/vclunohelper.hxx" #include "comphelper/sequenceashashmap.hxx" #include "comphelper/documentconstants.hxx" @@ -140,23 +140,7 @@ #include "loginerr.hxx" #include "passwordcontainer.hxx" -#include -#include -using namespace com::sun; - -namespace csss = ::com::sun::star::security; - -using ::com::sun::star::uno::Sequence; -using ::com::sun::star::uno::UNO_QUERY; -using ::com::sun::star::uno::Reference; -using ::com::sun::star::task::XInteractionContinuation; -using ::com::sun::star::task::XInteractionAbort; -using ::com::sun::star::task::XInteractionApprove; -using ::com::sun::star::task::XInteractionAskLater; -using ::com::sun::star::task::FutureDocumentVersionProductUpdateRequest; - - -#define CONFIG_INTERACTIONHANDLERS_KEY "/org.openoffice.ucb.InteractionHandler/InteractionHandlers" +using namespace com::sun::star; namespace { @@ -187,7 +171,8 @@ bool ErrorResource::getString(ErrCode nErrorCode, rtl::OUString * pString) const SAL_THROW(()) { OSL_ENSURE(pString, "specification violation"); - ResId aResId(static_cast< USHORT >(nErrorCode & ERRCODE_RES_MASK), *m_pResMgr); + ResId aResId(static_cast< USHORT >(nErrorCode & ERRCODE_RES_MASK), + *m_pResMgr); aResId.SetRT(RSC_STRING); if (!IsAvailableRes(aResId)) return false; @@ -197,104 +182,79 @@ bool ErrorResource::getString(ErrCode nErrorCode, rtl::OUString * pString) return true; } -void -getContinuations( - star::uno::Sequence< star::uno::Reference< - star::task::XInteractionContinuation > > const & rContinuations, - star::uno::Reference< star::task::XInteractionApprove > * pApprove, - star::uno::Reference< star::task::XInteractionDisapprove > * pDisapprove, - star::uno::Reference< star::task::XInteractionRetry > * pRetry, - star::uno::Reference< star::task::XInteractionAbort > * pAbort, - star::uno::Reference< star::ucb::XInteractionSupplyAuthentication > * - pSupplyAuthentication, - star::uno::Reference< star::ucb::XInteractionSupplyAuthentication2 > * - pSupplyAuthentication2, - star::uno::Reference< star::task::XInteractionPassword > * pPassword, - star::uno::Reference< star::ucb::XInteractionSupplyName > * - pSupplyName, - star::uno::Reference< star::ucb::XInteractionReplaceExistingData > * - pReplaceExistingData) - SAL_THROW((star::uno::RuntimeException)) +template< class t1 > +bool setContinuation( + uno::Reference< task::XInteractionContinuation > const & rContinuation, + uno::Reference< t1 > * pContinuation) +{ + if (pContinuation && !pContinuation->is()) + { + pContinuation->set(rContinuation, uno::UNO_QUERY); + if (pContinuation->is()) + return true; + } + return false; +} + +template< class t1, class t2 > +void getContinuations( + uno::Sequence< uno::Reference< + task::XInteractionContinuation > > const & rContinuations, + uno::Reference< t1 > * pContinuation1, + uno::Reference< t2 > * pContinuation2) { for (sal_Int32 i = 0; i < rContinuations.getLength(); ++i) { - if (pApprove && !pApprove->is()) - { - *pApprove - = star::uno::Reference< star::task::XInteractionApprove >( - rContinuations[i], star::uno::UNO_QUERY); - if (pApprove->is()) - continue; - } - if (pDisapprove && !pDisapprove->is()) - { - *pDisapprove - = star::uno::Reference< star::task::XInteractionDisapprove >( - rContinuations[i], star::uno::UNO_QUERY); - if (pDisapprove->is()) - continue; - } - if (pRetry && !pRetry->is()) - { - *pRetry = star::uno::Reference< star::task::XInteractionRetry >( - rContinuations[i], star::uno::UNO_QUERY); - if (pRetry->is()) - continue; - } - if (pAbort && !pAbort->is()) - { - *pAbort = star::uno::Reference< star::task::XInteractionAbort >( - rContinuations[i], star::uno::UNO_QUERY); - if (pAbort->is()) - continue; - } - if (pSupplyAuthentication && !pSupplyAuthentication->is()) - { - *pSupplyAuthentication - = star::uno::Reference< - star::ucb::XInteractionSupplyAuthentication >( - rContinuations[i], star::uno::UNO_QUERY); - if (pSupplyAuthentication->is()) - { - // is it even a supplyauthentication2, which is derived from - // supplyauthentication? - if (pSupplyAuthentication2 && !pSupplyAuthentication2->is()) - *pSupplyAuthentication2 - = star::uno::Reference< - star::ucb::XInteractionSupplyAuthentication2 >( - rContinuations[i], star::uno::UNO_QUERY); - continue; - } - } - if (pPassword && !pPassword->is()) - { - *pPassword - = star::uno::Reference< star::task::XInteractionPassword >( - rContinuations[i], star::uno::UNO_QUERY); - if (pPassword->is()) - continue; - } - if (pSupplyName && !pSupplyName->is()) - { - *pSupplyName - = star::uno::Reference< star::ucb::XInteractionSupplyName >( - rContinuations[i], star::uno::UNO_QUERY); - if (pSupplyName->is()) - continue; - } - if (pReplaceExistingData && !pReplaceExistingData->is()) - { - *pReplaceExistingData - = star::uno::Reference< - star::ucb::XInteractionReplaceExistingData >( - rContinuations[i], star::uno::UNO_QUERY); - if (pReplaceExistingData->is()) - continue; - } + if (setContinuation(rContinuations[i], pContinuation1)) + continue; + if (setContinuation(rContinuations[i], pContinuation2)) + continue; + } +} + +template< class t1, class t2, class t3 > +void getContinuations( + uno::Sequence< uno::Reference< + task::XInteractionContinuation > > const & rContinuations, + uno::Reference< t1 > * pContinuation1, + uno::Reference< t2 > * pContinuation2, + uno::Reference< t3 > * pContinuation3) +{ + for (sal_Int32 i = 0; i < rContinuations.getLength(); ++i) + { + if (setContinuation(rContinuations[i], pContinuation1)) + continue; + if (setContinuation(rContinuations[i], pContinuation2)) + continue; + if (setContinuation(rContinuations[i], pContinuation3)) + continue; + } +} + +template< class t1, class t2, class t3, class t4 > +void getContinuations( + uno::Sequence< uno::Reference< + task::XInteractionContinuation > > const & rContinuations, + uno::Reference< t1 > * pContinuation1, + uno::Reference< t2 > * pContinuation2, + uno::Reference< t3 > * pContinuation3, + uno::Reference< t4 > * pContinuation4) +{ + for (sal_Int32 i = 0; i < rContinuations.getLength(); ++i) + { + if (setContinuation(rContinuations[i], pContinuation1)) + continue; + if (setContinuation(rContinuations[i], pContinuation2)) + continue; + if (setContinuation(rContinuations[i], pContinuation3)) + continue; + if (setContinuation(rContinuations[i], pContinuation4)) + continue; } } -::rtl::OUString replaceMessageWithArguments( +::rtl::OUString +replaceMessageWithArguments( ::rtl::OUString aMessage, std::vector< rtl::OUString > const & rArguments ) { @@ -331,17 +291,15 @@ getContinuations( return aMessage; } - bool -getStringRequestArgument(star::uno::Sequence< star::uno::Any > const & - rArguments, +getStringRequestArgument(uno::Sequence< uno::Any > const & rArguments, rtl::OUString const & rKey, rtl::OUString * pValue) SAL_THROW(()) { for (sal_Int32 i = 0; i < rArguments.getLength(); ++i) { - star::beans::PropertyValue aProperty; + beans::PropertyValue aProperty; if ((rArguments[i] >>= aProperty) && aProperty.Name == rKey) { rtl::OUString aValue; @@ -357,15 +315,14 @@ getStringRequestArgument(star::uno::Sequence< star::uno::Any > const & } bool -getBoolRequestArgument(star::uno::Sequence< star::uno::Any > const & - rArguments, +getBoolRequestArgument(uno::Sequence< uno::Any > const & rArguments, rtl::OUString const & rKey, bool * pValue) SAL_THROW(()) { for (sal_Int32 i = 0; i < rArguments.getLength(); ++i) { - star::beans::PropertyValue aProperty; + beans::PropertyValue aProperty; if ((rArguments[i] >>= aProperty) && aProperty.Name == rKey) { sal_Bool bValue = sal_Bool(); @@ -381,8 +338,7 @@ getBoolRequestArgument(star::uno::Sequence< star::uno::Any > const & } bool -getResourceNameRequestArgument(star::uno::Sequence< star::uno::Any > const & - rArguments, +getResourceNameRequestArgument(uno::Sequence< uno::Any > const & rArguments, rtl::OUString * pValue) SAL_THROW(()) { @@ -403,9 +359,9 @@ getResourceNameRequestArgument(star::uno::Sequence< star::uno::Any > const & return true; } -bool isInformationalErrorMessageRequest( - star::uno::Sequence< star::uno::Reference< - star::task::XInteractionContinuation > > const & +bool +isInformationalErrorMessageRequest( + uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & rContinuations) { // Only requests with a single continuation (user has no choice, request @@ -415,13 +371,13 @@ bool isInformationalErrorMessageRequest( // user can only abort or approve, all other continuations are not // considered to be informational. - star::uno::Reference< star::task::XInteractionApprove > xApprove( - rContinuations[0], star::uno::UNO_QUERY); + uno::Reference< task::XInteractionApprove > xApprove( + rContinuations[0], uno::UNO_QUERY); if (xApprove.is()) return true; - star::uno::Reference< star::task::XInteractionAbort > xAbort( - rContinuations[0], star::uno::UNO_QUERY); + uno::Reference< task::XInteractionAbort > xAbort( + rContinuations[0], uno::UNO_QUERY); if (xAbort.is()) return true; @@ -431,9 +387,8 @@ bool isInformationalErrorMessageRequest( } /* namespace */ UUIInteractionHelper::UUIInteractionHelper( - star::uno::Reference< star::lang::XMultiServiceFactory > const & - rServiceFactory, - star::uno::Sequence< star::uno::Any > const & rArguments) + uno::Reference< lang::XMultiServiceFactory > const & rServiceFactory, + uno::Sequence< uno::Any > const & rArguments) SAL_THROW(()): m_xServiceFactory(rServiceFactory), m_aProperties(rArguments) @@ -441,8 +396,7 @@ UUIInteractionHelper::UUIInteractionHelper( } UUIInteractionHelper::UUIInteractionHelper( - star::uno::Reference< star::lang::XMultiServiceFactory > const & - rServiceFactory) + uno::Reference< lang::XMultiServiceFactory > const & rServiceFactory) SAL_THROW(()): m_xServiceFactory(rServiceFactory) { @@ -455,33 +409,34 @@ UUIInteractionHelper::~UUIInteractionHelper() class HandleData : public osl::Condition { public: HandleData( - star::uno::Reference< star::task::XInteractionRequest > const & - rRequest) + uno::Reference< task::XInteractionRequest > const & rRequest) : osl::Condition(), m_rRequest(rRequest), bHandled( false ) { } - star::uno::Reference< star::task::XInteractionRequest > m_rRequest; - bool bHandled; - star::beans::Optional< rtl::OUString > m_aResult; + uno::Reference< task::XInteractionRequest > m_rRequest; + bool bHandled; + beans::Optional< rtl::OUString > m_aResult; }; -long UUIInteractionHelper::handlerequest( - void* pHandleData,void* pInteractionHelper) +long +UUIInteractionHelper::handlerequest( + void* pHandleData, void* pInteractionHelper) { - HandleData* pHND = (HandleData*) pHandleData; - UUIInteractionHelper* pUUI = (UUIInteractionHelper*) pInteractionHelper; + HandleData* pHND + = static_cast< HandleData * >(pHandleData); + UUIInteractionHelper* pUUI + = static_cast< UUIInteractionHelper * >(pInteractionHelper); pHND->bHandled = pUUI->handle_impl(pHND->m_rRequest); pHND->set(); return 0; } - bool UUIInteractionHelper::handleRequest( - star::uno::Reference< star::task::XInteractionRequest > const & rRequest) - throw (star::uno::RuntimeException) + uno::Reference< task::XInteractionRequest > const & rRequest) + SAL_THROW((uno::RuntimeException)) { Application* pApp = 0; if( @@ -505,7 +460,8 @@ UUIInteractionHelper::handleRequest( return handle_impl(rRequest); } -long UUIInteractionHelper::getstringfromrequest( +long +UUIInteractionHelper::getstringfromrequest( void* pHandleData,void* pInteractionHelper) { HandleData* pHND = (HandleData*) pHandleData; @@ -515,25 +471,25 @@ long UUIInteractionHelper::getstringfromrequest( return 0; } -star::beans::Optional< rtl::OUString > +beans::Optional< rtl::OUString > UUIInteractionHelper::getStringFromRequest_impl( - star::uno::Reference< star::task::XInteractionRequest > const & rRequest) - throw (star::uno::RuntimeException) + uno::Reference< task::XInteractionRequest > const & rRequest) + SAL_THROW((uno::RuntimeException)) { bool bSuccess = false; rtl::OUString aMessage; handleMessageboxRequests(rRequest, true, bSuccess, aMessage); if (!bSuccess) - handleErrorHandlerRequests(rRequest, true, bSuccess, aMessage); + handleErrorHandlerRequests(rRequest, true, bSuccess, aMessage); - return star::beans::Optional< rtl::OUString >(bSuccess, aMessage); + return beans::Optional< rtl::OUString >(bSuccess, aMessage); } -star::beans::Optional< rtl::OUString > +beans::Optional< rtl::OUString > UUIInteractionHelper::getStringFromRequest( - star::uno::Reference< star::task::XInteractionRequest > const & rRequest) - throw (star::uno::RuntimeException) + uno::Reference< task::XInteractionRequest > const & rRequest) + SAL_THROW((uno::RuntimeException)) { Application* pApp = 0; if( @@ -557,20 +513,21 @@ UUIInteractionHelper::getStringFromRequest( return getStringFromRequest_impl(rRequest); } -bool UUIInteractionHelper::handleMessageboxRequests( - star::uno::Reference< star::task::XInteractionRequest > const & rRequest, +bool +UUIInteractionHelper::handleMessageboxRequests( + uno::Reference< task::XInteractionRequest > const & rRequest, bool bObtainErrorStringOnly, bool & bHasErrorString, rtl::OUString & rErrorString) { - star::uno::Any aAnyRequest(rRequest->getRequest()); + uno::Any aAnyRequest(rRequest->getRequest()); - star::script::ModuleSizeExceededRequest aModSizeException; + script::ModuleSizeExceededRequest aModSizeException; if (aAnyRequest >>= aModSizeException ) { ErrCode nErrorCode = ERRCODE_UUI_IO_MODULESIZEEXCEEDED; std::vector< rtl::OUString > aArguments; - star::uno::Sequence< rtl::OUString > sModules + uno::Sequence< rtl::OUString > sModules = aModSizeException.Names; if ( sModules.getLength() ) { @@ -584,7 +541,7 @@ bool UUIInteractionHelper::handleMessageboxRequests( } aArguments.push_back( aName ); } - handleErrorRequest( star::task::InteractionClassification_WARNING, + handleErrorRequest( task::InteractionClassification_WARNING, nErrorCode, aArguments, rRequest->getContinuations(), @@ -594,7 +551,7 @@ bool UUIInteractionHelper::handleMessageboxRequests( return true; } - star::ucb::NameClashException aNCException; + ucb::NameClashException aNCException; if (aAnyRequest >>= aNCException) { ErrCode nErrorCode = ERRCODE_UUI_IO_TARGETALREADYEXISTS; @@ -616,33 +573,30 @@ bool UUIInteractionHelper::handleMessageboxRequests( return true; } - star::ucb::UnsupportedNameClashException aUORequest; + ucb::UnsupportedNameClashException aUORequest; if (aAnyRequest >>= aUORequest) { ErrCode nErrorCode = ERRCODE_UUI_IO_UNSUPPORTEDOVERWRITE; std::vector< rtl::OUString > aArguments; - star::uno::Reference< star::task::XInteractionApprove > xApprove; - star::uno::Reference< - star::task::XInteractionDisapprove > xDisapprove; - getContinuations( - rRequest->getContinuations(), - &xApprove, &xDisapprove, 0, 0, 0, 0, 0, 0, 0); + uno::Reference< task::XInteractionApprove > xApprove; + uno::Reference< task::XInteractionDisapprove > xDisapprove; + getContinuations(rRequest->getContinuations(), &xApprove, &xDisapprove); - if( xApprove.is() && xDisapprove.is() ) + if ( xApprove.is() && xDisapprove.is() ) { - handleErrorRequest( star::task::InteractionClassification_QUERY, - nErrorCode, - aArguments, - rRequest->getContinuations(), - bObtainErrorStringOnly, - bHasErrorString, - rErrorString); + handleErrorRequest( task::InteractionClassification_QUERY, + nErrorCode, + aArguments, + rRequest->getContinuations(), + bObtainErrorStringOnly, + bHasErrorString, + rErrorString); } return true; } - star::document::BrokenPackageRequest aBrokenPackageRequest; + document::BrokenPackageRequest aBrokenPackageRequest; if (aAnyRequest >>= aBrokenPackageRequest) { std::vector< rtl::OUString > aArguments; @@ -658,18 +612,18 @@ bool UUIInteractionHelper::handleMessageboxRequests( return true; } - star::ucb::InteractiveIOException aIoException; + ucb::InteractiveIOException aIoException; if (aAnyRequest >>= aIoException) { - star::uno::Sequence< star::uno::Any > aRequestArguments; - star::ucb::InteractiveAugmentedIOException aAugmentedIoException; + uno::Sequence< uno::Any > aRequestArguments; + ucb::InteractiveAugmentedIOException aAugmentedIoException; if (aAnyRequest >>= aAugmentedIoException) aRequestArguments = aAugmentedIoException.Arguments; ErrCode nErrorCode; std::vector< rtl::OUString > aArguments; static ErrCode const - aErrorCode[star::ucb::IOErrorCode_WRONG_VERSION + 1][2] + aErrorCode[ucb::IOErrorCode_WRONG_VERSION + 1][2] = { { ERRCODE_IO_ABORT, ERRCODE_UUI_IO_ABORT }, // ABORT { ERRCODE_IO_ACCESSDENIED, ERRCODE_UUI_IO_ACCESSDENIED }, // ACCESS_DENIED @@ -740,7 +694,7 @@ bool UUIInteractionHelper::handleMessageboxRequests( ERRCODE_UUI_IO_WRONGVERSION } }; // WRONG_VERSION switch (aIoException.Code) { - case star::ucb::IOErrorCode_CANT_CREATE: + case ucb::IOErrorCode_CANT_CREATE: { rtl::OUString aArgFolder; if (getStringRequestArgument( @@ -769,7 +723,7 @@ bool UUIInteractionHelper::handleMessageboxRequests( break; } - case star::ucb::IOErrorCode_DEVICE_NOT_READY: + case ucb::IOErrorCode_DEVICE_NOT_READY: { rtl::OUString aArgUri; if (getResourceNameRequestArgument(aRequestArguments, @@ -803,7 +757,7 @@ bool UUIInteractionHelper::handleMessageboxRequests( break; } - case star::ucb::IOErrorCode_DIFFERENT_DEVICES: + case ucb::IOErrorCode_DIFFERENT_DEVICES: { rtl::OUString aArgVolume; rtl::OUString aArgOtherVolume; @@ -828,7 +782,7 @@ bool UUIInteractionHelper::handleMessageboxRequests( break; } - case star::ucb::IOErrorCode_NOT_EXISTING: + case ucb::IOErrorCode_NOT_EXISTING: { rtl::OUString aArgUri; if (getResourceNameRequestArgument(aRequestArguments, @@ -880,7 +834,7 @@ bool UUIInteractionHelper::handleMessageboxRequests( return true; } - star::ucb::InteractiveAppException aAppException; + ucb::InteractiveAppException aAppException; if (aAnyRequest >>= aAppException) { std::vector< rtl::OUString > aArguments; @@ -894,17 +848,16 @@ bool UUIInteractionHelper::handleMessageboxRequests( return true; } - star::ucb::InteractiveNetworkException aNetworkException; + ucb::InteractiveNetworkException aNetworkException; if (aAnyRequest >>= aNetworkException) { ErrCode nErrorCode; std::vector< rtl::OUString > aArguments; - star::ucb::InteractiveNetworkOffLineException aOffLineException; - star::ucb::InteractiveNetworkResolveNameException - aResolveNameException; - star::ucb::InteractiveNetworkConnectException aConnectException; - star::ucb::InteractiveNetworkReadException aReadException; - star::ucb::InteractiveNetworkWriteException aWriteException; + ucb::InteractiveNetworkOffLineException aOffLineException; + ucb::InteractiveNetworkResolveNameException aResolveNameException; + ucb::InteractiveNetworkConnectException aConnectException; + ucb::InteractiveNetworkReadException aReadException; + ucb::InteractiveNetworkWriteException aWriteException; if (aAnyRequest >>= aOffLineException) nErrorCode = ERRCODE_INET_OFFLINE; else if (aAnyRequest >>= aResolveNameException) @@ -940,7 +893,7 @@ bool UUIInteractionHelper::handleMessageboxRequests( return true; } - star::ucb::InteractiveCHAOSException aChaosException; + ucb::InteractiveCHAOSException aChaosException; if (aAnyRequest >>= aChaosException) { std::vector< rtl::OUString > aArguments; @@ -963,7 +916,7 @@ bool UUIInteractionHelper::handleMessageboxRequests( return true; } - star::ucb::InteractiveWrongMediumException aWrongMediumException; + ucb::InteractiveWrongMediumException aWrongMediumException; if (aAnyRequest >>= aWrongMediumException) { sal_Int32 nMedium = 0; @@ -980,7 +933,7 @@ bool UUIInteractionHelper::handleMessageboxRequests( return true; } - star::java::WrongJavaVersionException aWrongJavaVersionException; + java::WrongJavaVersionException aWrongJavaVersionException; if (aAnyRequest >>= aWrongJavaVersionException) { ErrCode nErrorCode; @@ -1013,7 +966,7 @@ bool UUIInteractionHelper::handleMessageboxRequests( aArguments.push_back(aWrongJavaVersionException. LowestSupportedVersion); } - handleErrorRequest(star::task::InteractionClassification_ERROR, + handleErrorRequest(task::InteractionClassification_ERROR, nErrorCode, aArguments, rRequest->getContinuations(), @@ -1023,7 +976,7 @@ bool UUIInteractionHelper::handleMessageboxRequests( return true; } - star::sync2::BadPartnershipException aBadPartnershipException; + sync2::BadPartnershipException aBadPartnershipException; if (aAnyRequest >>= aBadPartnershipException) { ErrCode nErrorCode; @@ -1035,7 +988,7 @@ bool UUIInteractionHelper::handleMessageboxRequests( nErrorCode = ERRCODE_UUI_BADPARTNERSHIP_NAME; aArguments.push_back(aBadPartnershipException.Partnership); } - handleErrorRequest(star::task::InteractionClassification_ERROR, + handleErrorRequest(task::InteractionClassification_ERROR, nErrorCode, aArguments, rRequest->getContinuations(), @@ -1045,7 +998,7 @@ bool UUIInteractionHelper::handleMessageboxRequests( return true; } - star::configuration::backend::MergeRecoveryRequest aMergeRecoveryRequest; + configuration::backend::MergeRecoveryRequest aMergeRecoveryRequest; if (aAnyRequest >>= aMergeRecoveryRequest) { ErrCode nErrorCode = aMergeRecoveryRequest.IsRemovalRequest @@ -1055,7 +1008,7 @@ bool UUIInteractionHelper::handleMessageboxRequests( std::vector< rtl::OUString > aArguments; aArguments.push_back(aMergeRecoveryRequest.ErrorLayerId); - handleErrorRequest(star::task::InteractionClassification_ERROR, + handleErrorRequest(task::InteractionClassification_ERROR, nErrorCode, aArguments, rRequest->getContinuations(), @@ -1065,7 +1018,7 @@ bool UUIInteractionHelper::handleMessageboxRequests( return true; } - star::configuration::backend::StratumCreationException + configuration::backend::StratumCreationException aStratumCreationException; if (aAnyRequest >>= aStratumCreationException) @@ -1079,7 +1032,7 @@ bool UUIInteractionHelper::handleMessageboxRequests( std::vector< rtl::OUString > aArguments; aArguments.push_back(aStratum); - handleErrorRequest(star::task::InteractionClassification_ERROR, + handleErrorRequest(task::InteractionClassification_ERROR, nErrorCode, aArguments, rRequest->getContinuations(), @@ -1089,14 +1042,14 @@ bool UUIInteractionHelper::handleMessageboxRequests( return true; } - star::xforms::InvalidDataOnSubmitException aInvalidDataOnSubmitException; + xforms::InvalidDataOnSubmitException aInvalidDataOnSubmitException; if (aAnyRequest >>= aInvalidDataOnSubmitException) { const ErrCode nErrorCode = ERRCODE_UUI_INVALID_XFORMS_SUBMISSION_DATA; std::vector< rtl::OUString > aArguments; - handleErrorRequest(star::task::InteractionClassification_QUERY, + handleErrorRequest(task::InteractionClassification_QUERY, nErrorCode, aArguments, rRequest->getContinuations(), @@ -1106,7 +1059,7 @@ bool UUIInteractionHelper::handleMessageboxRequests( return true; } - star::ucb::InteractiveLockingLockedException aLLException; + ucb::InteractiveLockingLockedException aLLException; if (aAnyRequest >>= aLLException) { ErrCode nErrorCode = aLLException.SelfOwned @@ -1124,7 +1077,7 @@ bool UUIInteractionHelper::handleMessageboxRequests( return true; } - star::ucb::InteractiveLockingNotLockedException aLNLException; + ucb::InteractiveLockingNotLockedException aLNLException; if (aAnyRequest >>= aLNLException) { ErrCode nErrorCode = ERRCODE_UUI_LOCKING_NOT_LOCKED; @@ -1141,7 +1094,7 @@ bool UUIInteractionHelper::handleMessageboxRequests( return true; } - star::ucb::InteractiveLockingLockExpiredException aLLEException; + ucb::InteractiveLockingLockExpiredException aLLEException; if (aAnyRequest >>= aLLEException) { ErrCode nErrorCode = ERRCODE_UUI_LOCKING_LOCK_EXPIRED; @@ -1161,12 +1114,13 @@ bool UUIInteractionHelper::handleMessageboxRequests( return false; } -bool UUIInteractionHelper::handleDialogRequests( - star::uno::Reference< star::task::XInteractionRequest > const & rRequest) +bool +UUIInteractionHelper::handleDialogRequests( + uno::Reference< task::XInteractionRequest > const & rRequest) { - star::uno::Any aAnyRequest(rRequest->getRequest()); + uno::Any aAnyRequest(rRequest->getRequest()); - star::ucb::URLAuthenticationRequest aURLAuthenticationRequest; + ucb::URLAuthenticationRequest aURLAuthenticationRequest; if (aAnyRequest >>= aURLAuthenticationRequest) { handleAuthenticationRequest(aURLAuthenticationRequest, @@ -1175,7 +1129,7 @@ bool UUIInteractionHelper::handleDialogRequests( return true; } - star::ucb::AuthenticationRequest aAuthenticationRequest; + ucb::AuthenticationRequest aAuthenticationRequest; if (aAnyRequest >>= aAuthenticationRequest) { handleAuthenticationRequest(aAuthenticationRequest, @@ -1184,16 +1138,16 @@ bool UUIInteractionHelper::handleDialogRequests( return true; } - star::ucb::CertificateValidationRequest aCertificateValidationRequest; + ucb::CertificateValidationRequest aCertificateValidationRequest; if (aAnyRequest >>= aCertificateValidationRequest) { handleCertificateValidationRequest(aCertificateValidationRequest, - rRequest->getContinuations()); + rRequest->getContinuations()); return true; } // @@@ Todo #i29340#: activate! -// star::ucb::NameClashResolveRequest aNameClashResolveRequest; +// ucb::NameClashResolveRequest aNameClashResolveRequest; // if (aAnyRequest >>= aNameClashResolveRequest) // { // handleNameClashResolveRequest(aNameClashResolveRequest, @@ -1201,7 +1155,7 @@ bool UUIInteractionHelper::handleDialogRequests( // return; // } - star::task::MasterPasswordRequest aMasterPasswordRequest; + task::MasterPasswordRequest aMasterPasswordRequest; if (aAnyRequest >>= aMasterPasswordRequest) { handleMasterPasswordRequest(aMasterPasswordRequest.Mode, @@ -1209,7 +1163,7 @@ bool UUIInteractionHelper::handleDialogRequests( return true; } - star::task::DocumentPasswordRequest aDocumentPasswordRequest; + task::DocumentPasswordRequest aDocumentPasswordRequest; if (aAnyRequest >>= aDocumentPasswordRequest) { handlePasswordRequest(aDocumentPasswordRequest.Mode, @@ -1218,16 +1172,16 @@ bool UUIInteractionHelper::handleDialogRequests( return true; } - star::task::DocumentMSPasswordRequest aDocumentMSPasswordRequest; + task::DocumentMSPasswordRequest aDocumentMSPasswordRequest; if (aAnyRequest >>= aDocumentMSPasswordRequest) { handleMSPasswordRequest(aDocumentMSPasswordRequest.Mode, - rRequest->getContinuations(), - aDocumentMSPasswordRequest.Name); + rRequest->getContinuations(), + aDocumentMSPasswordRequest.Name); return true; } - star::task::PasswordRequest aPasswordRequest; + task::PasswordRequest aPasswordRequest; if (aAnyRequest >>= aPasswordRequest) { handlePasswordRequest(aPasswordRequest.Mode, @@ -1235,7 +1189,7 @@ bool UUIInteractionHelper::handleDialogRequests( return true; } - star::ucb::HandleCookiesRequest aCookiesRequest; + ucb::HandleCookiesRequest aCookiesRequest; if (aAnyRequest >>= aCookiesRequest) { handleCookiesRequest(aCookiesRequest, @@ -1243,7 +1197,7 @@ bool UUIInteractionHelper::handleDialogRequests( return true; } - star::document::NoSuchFilterRequest aNoSuchFilterRequest; + document::NoSuchFilterRequest aNoSuchFilterRequest; if (aAnyRequest >>= aNoSuchFilterRequest) { handleNoSuchFilterRequest(aNoSuchFilterRequest, @@ -1251,7 +1205,7 @@ bool UUIInteractionHelper::handleDialogRequests( return true; } - star::document::AmbigousFilterRequest aAmbigousFilterRequest; + document::AmbigousFilterRequest aAmbigousFilterRequest; if (aAnyRequest >>= aAmbigousFilterRequest) { handleAmbigousFilterRequest(aAmbigousFilterRequest, @@ -1259,7 +1213,7 @@ bool UUIInteractionHelper::handleDialogRequests( return true; } - star::document::FilterOptionsRequest aFilterOptionsRequest; + document::FilterOptionsRequest aFilterOptionsRequest; if (aAnyRequest >>= aFilterOptionsRequest) { handleFilterOptionsRequest(aFilterOptionsRequest, @@ -1267,7 +1221,7 @@ bool UUIInteractionHelper::handleDialogRequests( return true; } - star::document::LockedDocumentRequest aLockedDocumentRequest; + document::LockedDocumentRequest aLockedDocumentRequest; if (aAnyRequest >>= aLockedDocumentRequest ) { handleLockedDocumentRequest( aLockedDocumentRequest.DocumentURL, @@ -1277,17 +1231,19 @@ bool UUIInteractionHelper::handleDialogRequests( return true; } - star::document::OwnLockOnDocumentRequest aOwnLockOnDocumentRequest; + document::OwnLockOnDocumentRequest aOwnLockOnDocumentRequest; if (aAnyRequest >>= aOwnLockOnDocumentRequest ) { handleLockedDocumentRequest( aOwnLockOnDocumentRequest.DocumentURL, aOwnLockOnDocumentRequest.TimeInfo, rRequest->getContinuations(), - aOwnLockOnDocumentRequest.IsStoring ? UUI_DOC_OWN_SAVE_LOCK : UUI_DOC_OWN_LOAD_LOCK ); + aOwnLockOnDocumentRequest.IsStoring + ? UUI_DOC_OWN_SAVE_LOCK + : UUI_DOC_OWN_LOAD_LOCK ); return true; } - star::document::LockedOnSavingRequest aLockedOnSavingRequest; + document::LockedOnSavingRequest aLockedOnSavingRequest; if (aAnyRequest >>= aLockedOnSavingRequest ) { handleLockedDocumentRequest( aLockedOnSavingRequest.DocumentURL, @@ -1297,43 +1253,21 @@ bool UUIInteractionHelper::handleDialogRequests( return true; } - star::document::ChangedByOthersRequest aChangedByOthersRequest; + document::ChangedByOthersRequest aChangedByOthersRequest; if (aAnyRequest >>= aChangedByOthersRequest ) { handleChangedByOthersRequest( rRequest->getContinuations() ); return true; } - star::document::LockFileIgnoreRequest aLockFileIgnoreRequest; + document::LockFileIgnoreRequest aLockFileIgnoreRequest; if (aAnyRequest >>= aLockFileIgnoreRequest ) { handleLockFileIgnoreRequest( rRequest->getContinuations() ); return true; } - return false; -} - -bool UUIInteractionHelper::handleErrorHandlerRequests( - star::uno::Reference< star::task::XInteractionRequest > const & rRequest, - bool bObtainErrorStringOnly, - bool & bHasErrorString, - rtl::OUString & rErrorString) -{ - star::uno::Any aAnyRequest(rRequest->getRequest()); - - star::task::ErrorCodeRequest aErrorCodeRequest; - if (aAnyRequest >>= aErrorCodeRequest) - { - handleGenericErrorRequest( aErrorCodeRequest.ErrCode, - rRequest->getContinuations(), - bObtainErrorStringOnly, - bHasErrorString, - rErrorString); - return true; - } - - star::task::DocumentMacroConfirmationRequest aMacroConfirmRequest; + task::DocumentMacroConfirmationRequest aMacroConfirmRequest; if (aAnyRequest >>= aMacroConfirmRequest) { handleMacroConfirmRequest( @@ -1346,7 +1280,7 @@ bool UUIInteractionHelper::handleErrorHandlerRequests( return true; } - star::task::DocumentMacroConfirmationRequest2 aMacroConfirmRequest2; + task::DocumentMacroConfirmationRequest2 aMacroConfirmRequest2; if (aAnyRequest >>= aMacroConfirmRequest2) { handleMacroConfirmRequest( @@ -1359,7 +1293,7 @@ bool UUIInteractionHelper::handleErrorHandlerRequests( return true; } - FutureDocumentVersionProductUpdateRequest aProductUpdateRequest; + task::FutureDocumentVersionProductUpdateRequest aProductUpdateRequest; if (aAnyRequest >>= aProductUpdateRequest) { handleFutureDocumentVersionUpdateRequest( @@ -1369,14 +1303,37 @@ bool UUIInteractionHelper::handleErrorHandlerRequests( return true; } - star::task::ErrorCodeIOException aErrorCodeIOException; + return false; +} + +bool +UUIInteractionHelper::handleErrorHandlerRequests( + uno::Reference< task::XInteractionRequest > const & rRequest, + bool bObtainErrorStringOnly, + bool & bHasErrorString, + rtl::OUString & rErrorString) +{ + uno::Any aAnyRequest(rRequest->getRequest()); + + task::ErrorCodeRequest aErrorCodeRequest; + if (aAnyRequest >>= aErrorCodeRequest) + { + handleGenericErrorRequest( aErrorCodeRequest.ErrCode, + rRequest->getContinuations(), + bObtainErrorStringOnly, + bHasErrorString, + rErrorString); + return true; + } + + task::ErrorCodeIOException aErrorCodeIOException; if (aAnyRequest >>= aErrorCodeIOException) { handleGenericErrorRequest( aErrorCodeIOException.ErrCode, rRequest->getContinuations(), - bObtainErrorStringOnly, - bHasErrorString, - rErrorString); + bObtainErrorStringOnly, + bHasErrorString, + rErrorString); return true; } @@ -1385,8 +1342,8 @@ bool UUIInteractionHelper::handleErrorHandlerRequests( bool UUIInteractionHelper::handle_impl( - star::uno::Reference< star::task::XInteractionRequest > const & rRequest) - throw (star::uno::RuntimeException) + uno::Reference< task::XInteractionRequest > const & rRequest) + SAL_THROW((uno::RuntimeException)) { try { @@ -1414,42 +1371,55 @@ UUIInteractionHelper::handle_impl( // Use customized InteractionHandler from configuration //////////////////////////////////////////////////////////// InteractionHandlerDataList dataList; - - GetInteractionHandlerList(dataList); - - InteractionHandlerDataList::const_iterator aEnd(dataList.end()); - for (InteractionHandlerDataList::const_iterator aIt(dataList.begin()); - aIt != aEnd; ++aIt) + getInteractionHandlerList(dataList); + + InteractionHandlerDataList::const_iterator aEnd( + dataList.end()); + for (InteractionHandlerDataList::const_iterator aIt( + dataList.begin()); + aIt != aEnd; + ++aIt) { - Reference< uno::XInterface > xIfc = - m_xServiceFactory->createInstance(aIt->ServiceName); + uno::Reference< uno::XInterface > xIfc; + try + { + xIfc = m_xServiceFactory->createInstance( + aIt->ServiceName); + } + catch ( uno::Exception const & ) + { + } - Reference< com::sun::star::lang::XInitialization > xInitialization = - Reference< com::sun::star::lang::XInitialization >( xIfc, UNO_QUERY ); + uno::Reference< lang::XInitialization > + xInitialization( xIfc, uno::UNO_QUERY ); - OSL_ENSURE( xInitialization.is(), "Custom Interactionhandler does not implement mandatory interface XInitialization!" ); + OSL_ENSURE( xInitialization.is(), + "Custom Interactionhandler does not " + "implement mandatory interface " + "XInitialization!" ); if (xInitialization.is()) { - uno::Sequence< uno::Any > propertyValues(1); - beans::PropertyValue aProperty; - - aProperty.Name = rtl::OUString::createFromAscii( "Parent" ); + uno::Sequence< uno::Any > propertyValues(1); + beans::PropertyValue aProperty; + + aProperty.Name + = rtl::OUString::createFromAscii( "Parent" ); aProperty.Value <<= getParentXWindow(); propertyValues[ 0 ] <<= aProperty; xInitialization->initialize(propertyValues); } - Reference< task::XInteractionHandler2 > - xInteractionHandler( xIfc, UNO_QUERY ); + uno::Reference< task::XInteractionHandler2 > + xIH( xIfc, uno::UNO_QUERY ); - OSL_ENSURE( xInteractionHandler.is(), - "Custom Interactionhandler does not implement " - "mandatory interface XInteractionHandler2!" ); - if (xInteractionHandler.is()) - if (xInteractionHandler->handleInteractionRequest(rRequest)) - return true; + OSL_ENSURE( xIH.is(), + "Custom Interactionhandler does not " + "implement mandatory interface " + "XInteractionHandler2!" ); + if (xIH.is() && xIH->handleInteractionRequest(rRequest)) + return true; } return false; } @@ -1458,20 +1428,24 @@ UUIInteractionHelper::handle_impl( } catch (std::bad_alloc const &) { - throw star::uno::RuntimeException( + throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")), - star::uno::Reference< star::uno::XInterface >()); + uno::Reference< uno::XInterface >()); } return true; } -void UUIInteractionHelper::GetInteractionHandlerList(InteractionHandlerDataList &rdataList) +void +UUIInteractionHelper::getInteractionHandlerList( + InteractionHandlerDataList &rdataList) { + try + { uno::Reference< lang::XMultiServiceFactory > xConfigProv( - m_xServiceFactory->createInstance( - rtl::OUString::createFromAscii( - "com.sun.star.configuration.ConfigurationProvider" ) ), - uno::UNO_QUERY ); + m_xServiceFactory->createInstance( + rtl::OUString::createFromAscii( + "com.sun.star.configuration.ConfigurationProvider" ) ), + uno::UNO_QUERY ); if ( !xConfigProv.is() ) { @@ -1481,7 +1455,8 @@ void UUIInteractionHelper::GetInteractionHandlerList(InteractionHandlerDataList } rtl::OUStringBuffer aFullPath; - aFullPath.appendAscii( CONFIG_INTERACTIONHANDLERS_KEY ); + aFullPath.appendAscii( + "/org.openoffice.ucb.InteractionHandler/InteractionHandlers" ); uno::Sequence< uno::Any > aArguments( 1 ); beans::PropertyValue aProperty; @@ -1504,8 +1479,7 @@ void UUIInteractionHelper::GetInteractionHandlerList(InteractionHandlerDataList } uno::Reference< container::XNameAccess > xNameAccess( - xInterface, uno::UNO_QUERY ); - + xInterface, uno::UNO_QUERY ); if ( !xNameAccess.is() ) { OSL_ENSURE( false, @@ -1570,28 +1544,37 @@ void UUIInteractionHelper::GetInteractionHandlerList(InteractionHandlerDataList } } } + } + catch ( uno::Exception const & ) + { + OSL_ENSURE( false, "GetInteractionHandlerList - Caught Exception!" ); + } } -Window * UUIInteractionHelper::getParentProperty() SAL_THROW(()) +Window * +UUIInteractionHelper::getParentProperty() + SAL_THROW(()) { - star::uno::Reference< star::awt::XWindow > xWindow = getParentXWindow(); + uno::Reference< awt::XWindow > xWindow = getParentXWindow(); if ( xWindow.is() ) return VCLUnoHelper::GetWindow(xWindow); return 0; } -star::uno::Reference< ::com::sun::star::awt::XWindow> UUIInteractionHelper::getParentXWindow() SAL_THROW(()) +uno::Reference< awt::XWindow> +UUIInteractionHelper::getParentXWindow() + SAL_THROW(()) { osl::MutexGuard aGuard(m_aPropertyMutex); for (sal_Int32 i = 0; i < m_aProperties.getLength(); ++i) { - star::beans::PropertyValue aProperty; + beans::PropertyValue aProperty; if ((m_aProperties[i] >>= aProperty) && aProperty. Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Parent"))) { - star::uno::Reference< star::awt::XWindow > xWindow; + uno::Reference< awt::XWindow > xWindow; aProperty.Value >>= xWindow; return xWindow; } @@ -1599,12 +1582,13 @@ star::uno::Reference< ::com::sun::star::awt::XWindow> UUIInteractionHelper::get return 0; } -rtl::OUString UUIInteractionHelper::getContextProperty() SAL_THROW(()) +rtl::OUString +UUIInteractionHelper::getContextProperty() SAL_THROW(()) { osl::MutexGuard aGuard(m_aPropertyMutex); for (sal_Int32 i = 0; i < m_aProperties.getLength(); ++i) { - star::beans::PropertyValue aProperty; + beans::PropertyValue aProperty; if ((m_aProperties[i] >>= aProperty) && aProperty. Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Context"))) @@ -1617,57 +1601,58 @@ rtl::OUString UUIInteractionHelper::getContextProperty() SAL_THROW(()) return rtl::OUString(); } -String GetContentPart( const String& _rRawString ) +String +GetContentPart( const String& _rRawString ) { - // search over some parts to find a string - //static char* aIDs[] = { "CN", "OU", "O", "E", NULL }; - static char const * aIDs[] = { "CN=", "OU=", "O=", "E=", NULL };// By CP - String sPart; - int i = 0; - while ( aIDs[i] ) - { - String sPartId = String::CreateFromAscii( aIDs[i++] ); - xub_StrLen nContStart = _rRawString.Search( sPartId ); - if ( nContStart != STRING_NOTFOUND ) - { - nContStart = nContStart + sPartId.Len(); - //++nContStart; // now it's start of content, directly after Id // delete By CP - xub_StrLen nContEnd = _rRawString.Search( sal_Unicode( ',' ), nContStart ); - sPart = String( _rRawString, nContStart, nContEnd - nContStart ); - break; - } + // search over some parts to find a string + //static char* aIDs[] = { "CN", "OU", "O", "E", NULL }; + static char const * aIDs[] = { "CN=", "OU=", "O=", "E=", NULL };// By CP + String sPart; + int i = 0; + while ( aIDs[i] ) + { + String sPartId = String::CreateFromAscii( aIDs[i++] ); + xub_StrLen nContStart = _rRawString.Search( sPartId ); + if ( nContStart != STRING_NOTFOUND ) + { + nContStart = nContStart + sPartId.Len(); + xub_StrLen nContEnd + = _rRawString.Search( sal_Unicode( ',' ), nContStart ); + sPart = String( _rRawString, nContStart, nContEnd - nContStart ); + break; } - - return sPart; + } + return sPart; } - -sal_Bool UUIInteractionHelper::executeUnknownAuthDialog( const cssu::Reference< dcss::security::XCertificate >& rXCert) - SAL_THROW((star::uno::RuntimeException)) +sal_Bool +UUIInteractionHelper::executeUnknownAuthDialog( + const uno::Reference< security::XCertificate >& rXCert) + SAL_THROW((uno::RuntimeException)) { try { vos::OGuard aGuard(Application::GetSolarMutex()); - std::auto_ptr< ResMgr > - xManager(ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); - std::auto_ptr< UnknownAuthDialog > - xDialog(new UnknownAuthDialog( getParentProperty(), - rXCert, - m_xServiceFactory, - xManager.get())); + std::auto_ptr< ResMgr > xManager( + ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); + std::auto_ptr< UnknownAuthDialog > xDialog( + new UnknownAuthDialog( getParentProperty(), + rXCert, + m_xServiceFactory, + xManager.get())); // Get correct ressource string rtl::OUString aMessage; std::vector< rtl::OUString > aArguments; - aArguments.push_back( GetContentPart( rXCert.get()->getSubjectName()) ); - //aArguments.push_back( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")) ); + aArguments.push_back( GetContentPart( rXCert->getSubjectName()) ); if (xManager.get()) { ResId aResId(RID_UUI_ERRHDL, *xManager.get()); - if (ErrorResource(aResId).getString(ERRCODE_UUI_UNKNOWNAUTH_UNTRUSTED, &aMessage)) + if (ErrorResource(aResId).getString( + ERRCODE_UUI_UNKNOWNAUTH_UNTRUSTED, &aMessage)) { aMessage = replaceMessageWithArguments( aMessage, aArguments ); xDialog->setDescriptionText( aMessage ); @@ -1678,17 +1663,15 @@ sal_Bool UUIInteractionHelper::executeUnknownAuthDialog( const cssu::Reference< } catch (std::bad_alloc const &) { - throw star::uno::RuntimeException( + throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")), - star::uno::Reference< star::uno::XInterface >()); + uno::Reference< uno::XInterface >()); } } rtl::OUString -UUIInteractionHelper::getLocalizedDatTimeStr( ::com::sun::star::util::DateTime aDateTime ) +UUIInteractionHelper::getLocalizedDatTimeStr( util::DateTime aDateTime ) { - - rtl::OUString aDateTimeStr; Date aDate; Time aTime; @@ -1697,38 +1680,44 @@ UUIInteractionHelper::getLocalizedDatTimeStr( ::com::sun::star::util::DateTime a aTime = Time( aDateTime.Hours, aDateTime.Minutes, aDateTime.Seconds ); LanguageType eUILang = Application::GetSettings().GetUILanguage(); - SvNumberFormatter *pNumberFormatter = new SvNumberFormatter( ::comphelper::getProcessServiceFactory(), eUILang ); + SvNumberFormatter *pNumberFormatter + = new SvNumberFormatter( m_xServiceFactory, eUILang ); String aTmpStr; Color* pColor = NULL; Date* pNullDate = pNumberFormatter->GetNullDate(); - sal_uInt32 nFormat = pNumberFormatter->GetStandardFormat( NUMBERFORMAT_DATE, eUILang ); + sal_uInt32 nFormat + = pNumberFormatter->GetStandardFormat( NUMBERFORMAT_DATE, eUILang ); - pNumberFormatter->GetOutputString( aDate - *pNullDate, nFormat, aTmpStr, &pColor ); + pNumberFormatter->GetOutputString( + aDate - *pNullDate, nFormat, aTmpStr, &pColor ); aDateTimeStr = aTmpStr + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ")); nFormat = pNumberFormatter->GetStandardFormat( NUMBERFORMAT_TIME, eUILang ); - pNumberFormatter->GetOutputString( aTime.GetTimeInDays(), nFormat, aTmpStr, &pColor ); + pNumberFormatter->GetOutputString( + aTime.GetTimeInDays(), nFormat, aTmpStr, &pColor ); aDateTimeStr += aTmpStr; return aDateTimeStr; } -sal_Bool UUIInteractionHelper::executeSSLWarnDialog( const cssu::Reference< dcss::security::XCertificate >& rXCert, - sal_Int32 const & failure, - const rtl::OUString & hostName ) - SAL_THROW((star::uno::RuntimeException)) +sal_Bool +UUIInteractionHelper::executeSSLWarnDialog( + const uno::Reference< security::XCertificate >& rXCert, + sal_Int32 const & failure, + const rtl::OUString & hostName ) + SAL_THROW((uno::RuntimeException)) { try { vos::OGuard aGuard(Application::GetSolarMutex()); - std::auto_ptr< ResMgr > - xManager(ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); - std::auto_ptr< SSLWarnDialog > - xDialog(new SSLWarnDialog( getParentProperty(), - rXCert, - m_xServiceFactory, - xManager.get())); + std::auto_ptr< ResMgr > xManager( + ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); + std::auto_ptr< SSLWarnDialog > xDialog( + new SSLWarnDialog( getParentProperty(), + rXCert, + m_xServiceFactory, + xManager.get())); // Get correct ressource string rtl::OUString aMessage_1; @@ -1738,51 +1727,54 @@ sal_Bool UUIInteractionHelper::executeSSLWarnDialog( const cssu::Reference< dcss { case SSLWARN_TYPE_DOMAINMISMATCH: aArguments_1.push_back( hostName ); - aArguments_1.push_back( GetContentPart( rXCert.get()->getSubjectName()) ); + aArguments_1.push_back( + GetContentPart( rXCert->getSubjectName()) ); aArguments_1.push_back( hostName ); break; case SSLWARN_TYPE_EXPIRED: - aArguments_1.push_back( GetContentPart( rXCert.get()->getSubjectName()) ); - aArguments_1.push_back( getLocalizedDatTimeStr( rXCert.get()->getNotValidAfter() ) ); - aArguments_1.push_back( getLocalizedDatTimeStr( rXCert.get()->getNotValidAfter() ) ); + aArguments_1.push_back( + GetContentPart( rXCert->getSubjectName()) ); + aArguments_1.push_back( + getLocalizedDatTimeStr( rXCert->getNotValidAfter() ) ); + aArguments_1.push_back( + getLocalizedDatTimeStr( rXCert->getNotValidAfter() ) ); break; case SSLWARN_TYPE_INVALID: break; } - - - //aArguments.push_back( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")) ); - if (xManager.get()) { ResId aResId(RID_UUI_ERRHDL, *xManager.get()); - if (ErrorResource(aResId).getString( ERRCODE_AREA_UUI_UNKNOWNAUTH + failure + DESCRIPTION_1, &aMessage_1)) + if (ErrorResource(aResId).getString( + ERRCODE_AREA_UUI_UNKNOWNAUTH + failure + DESCRIPTION_1, + &aMessage_1)) { - aMessage_1 = replaceMessageWithArguments( aMessage_1, aArguments_1 ); + aMessage_1 + = replaceMessageWithArguments( aMessage_1, aArguments_1 ); xDialog->setDescription1Text( aMessage_1 ); } rtl::OUString aTitle; - ErrorResource(aResId).getString( ERRCODE_AREA_UUI_UNKNOWNAUTH + failure + TITLE, &aTitle); + ErrorResource(aResId).getString( + ERRCODE_AREA_UUI_UNKNOWNAUTH + failure + TITLE, &aTitle); xDialog->SetText( aTitle ); } - - return static_cast (xDialog->Execute()); } catch (std::bad_alloc const &) { - throw star::uno::RuntimeException( + throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")), - star::uno::Reference< star::uno::XInterface >()); + uno::Reference< uno::XInterface >()); } } -void UUIInteractionHelper::executeLoginDialog(LoginErrorInfo & rInfo, - rtl::OUString const & rRealm) - SAL_THROW((star::uno::RuntimeException)) +void +UUIInteractionHelper::executeLoginDialog(LoginErrorInfo & rInfo, + rtl::OUString const & rRealm) + SAL_THROW((uno::RuntimeException)) { try { @@ -1810,15 +1802,15 @@ void UUIInteractionHelper::executeLoginDialog(LoginErrorInfo & rInfo, if (!bCanUseSysCreds) nFlags |= LF_NO_USESYSCREDS; - std::auto_ptr< ResMgr > - xManager(ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); - UniString aRealm(rRealm); // Forte compiler needs it spelled out... - std::auto_ptr< LoginDialog > - xDialog(new LoginDialog(getParentProperty(), - nFlags, - rInfo.GetServer(), - &aRealm, - xManager.get())); + std::auto_ptr< ResMgr > xManager( + ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); + UniString aRealm(rRealm); + std::auto_ptr< LoginDialog > xDialog( + new LoginDialog(getParentProperty(), + nFlags, + rInfo.GetServer(), + &aRealm, + xManager.get())); if (rInfo.GetErrorText().Len() != 0) xDialog->SetErrorText(rInfo.GetErrorText()); xDialog->SetName(rInfo.GetUserName()); @@ -1839,7 +1831,8 @@ void UUIInteractionHelper::executeLoginDialog(LoginErrorInfo & rInfo, } if ( bCanUseSysCreds ) - xDialog->SetUseSystemCredentials( rInfo.GetIsUseSystemCredentials() ); + xDialog->SetUseSystemCredentials( + rInfo.GetIsUseSystemCredentials() ); rInfo.SetResult(xDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL); @@ -1853,54 +1846,51 @@ void UUIInteractionHelper::executeLoginDialog(LoginErrorInfo & rInfo, } catch (std::bad_alloc const &) { - throw star::uno::RuntimeException( + throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")), - star::uno::Reference< star::uno::XInterface >()); + uno::Reference< uno::XInterface >()); } } void UUIInteractionHelper::executeMasterPasswordDialog( LoginErrorInfo & rInfo, - star::task::PasswordRequestMode nMode) - SAL_THROW((star::uno::RuntimeException)) + task::PasswordRequestMode nMode) + SAL_THROW((uno::RuntimeException)) { rtl::OString aMaster; try { vos::OGuard aGuard(Application::GetSolarMutex()); - std::auto_ptr< ResMgr > - xManager(ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); - if( nMode == star::task::PasswordRequestMode_PASSWORD_CREATE ) - { - std::auto_ptr< MasterPasswordCreateDialog > - xDialog(new MasterPasswordCreateDialog( - getParentProperty(), xManager.get())); + std::auto_ptr< ResMgr > xManager( + ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); + if( nMode == task::PasswordRequestMode_PASSWORD_CREATE ) + { + std::auto_ptr< MasterPasswordCreateDialog > xDialog( + new MasterPasswordCreateDialog( + getParentProperty(), xManager.get())); rInfo.SetResult(xDialog->Execute() - == RET_OK ? ERRCODE_BUTTON_OK - : ERRCODE_BUTTON_CANCEL); - aMaster = rtl::OUStringToOString(xDialog->GetMasterPassword(), - RTL_TEXTENCODING_UTF8); - } - else - { - std::auto_ptr< MasterPasswordDialog > - xDialog(new MasterPasswordDialog( - getParentProperty(), nMode, xManager.get())); + == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL); + aMaster = rtl::OUStringToOString( + xDialog->GetMasterPassword(), RTL_TEXTENCODING_UTF8); + } + else + { + std::auto_ptr< MasterPasswordDialog > xDialog( + new MasterPasswordDialog( + getParentProperty(), nMode, xManager.get())); rInfo.SetResult(xDialog->Execute() - == RET_OK ? ERRCODE_BUTTON_OK - : ERRCODE_BUTTON_CANCEL); - aMaster = rtl::OUStringToOString(xDialog->GetMasterPassword(), - RTL_TEXTENCODING_UTF8); - } - + == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL); + aMaster = rtl::OUStringToOString( + xDialog->GetMasterPassword(), RTL_TEXTENCODING_UTF8); + } } catch (std::bad_alloc const &) { - throw star::uno::RuntimeException( + throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")), - star::uno::Reference< star::uno::XInterface >()); + uno::Reference< uno::XInterface >()); } sal_uInt8 aKey[RTL_DIGEST_LENGTH_MD5]; @@ -1925,126 +1915,124 @@ UUIInteractionHelper::executeMasterPasswordDialog( void UUIInteractionHelper::executePasswordDialog( LoginErrorInfo & rInfo, - star::task::PasswordRequestMode nMode, + task::PasswordRequestMode nMode, ::rtl::OUString aDocName) - SAL_THROW((star::uno::RuntimeException)) + SAL_THROW((uno::RuntimeException)) { try { vos::OGuard aGuard(Application::GetSolarMutex()); - std::auto_ptr< ResMgr > - xManager(ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); - if( nMode == star::task::PasswordRequestMode_PASSWORD_CREATE ) - { - std::auto_ptr< PasswordCreateDialog > - xDialog(new PasswordCreateDialog( - getParentProperty(), xManager.get())); + std::auto_ptr< ResMgr > xManager( + ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); + if( nMode == task::PasswordRequestMode_PASSWORD_CREATE ) + { + std::auto_ptr< PasswordCreateDialog > xDialog( + new PasswordCreateDialog( getParentProperty(), xManager.get())); - rInfo.SetResult(xDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK : - ERRCODE_BUTTON_CANCEL); - rInfo.SetPassword( xDialog->GetPassword() ); - } - else - { - std::auto_ptr< PasswordDialog > - xDialog(new PasswordDialog( - getParentProperty(), nMode, xManager.get(), aDocName )); + rInfo.SetResult(xDialog->Execute() + == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL); + rInfo.SetPassword( xDialog->GetPassword() ); + } + else + { + std::auto_ptr< PasswordDialog > xDialog( + new PasswordDialog( + getParentProperty(), nMode, xManager.get(), aDocName )); - rInfo.SetResult(xDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK : - ERRCODE_BUTTON_CANCEL); - rInfo.SetPassword( xDialog->GetPassword() ); - } + rInfo.SetResult(xDialog->Execute() + == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL); + rInfo.SetPassword( xDialog->GetPassword() ); + } } catch (std::bad_alloc const &) { - throw star::uno::RuntimeException( + throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")), - star::uno::Reference< star::uno::XInterface>()); + uno::Reference< uno::XInterface>()); } } void UUIInteractionHelper::executeMSPasswordDialog( LoginErrorInfo & rInfo, - star::task::PasswordRequestMode nMode, + task::PasswordRequestMode nMode, ::rtl::OUString aDocName) - SAL_THROW((star::uno::RuntimeException)) + SAL_THROW((uno::RuntimeException)) { try { vos::OGuard aGuard(Application::GetSolarMutex()); - std::auto_ptr< ResMgr > - xManager(ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); - if( nMode == star::task::PasswordRequestMode_PASSWORD_CREATE ) - { - std::auto_ptr< PasswordCreateDialog > - xDialog(new PasswordCreateDialog( - getParentProperty(), xManager.get(), true)); + std::auto_ptr< ResMgr > xManager( + ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); + if( nMode == task::PasswordRequestMode_PASSWORD_CREATE ) + { + std::auto_ptr< PasswordCreateDialog > xDialog( + new PasswordCreateDialog( + getParentProperty(), xManager.get(), true)); - rInfo.SetResult(xDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK : - ERRCODE_BUTTON_CANCEL); - rInfo.SetPassword( xDialog->GetPassword() ); - } - else - { - std::auto_ptr< PasswordDialog > - xDialog(new PasswordDialog( - getParentProperty(), nMode, xManager.get(), aDocName )); + rInfo.SetResult(xDialog->Execute() + == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL); + rInfo.SetPassword( xDialog->GetPassword() ); + } + else + { + std::auto_ptr< PasswordDialog > xDialog( + new PasswordDialog( + getParentProperty(), nMode, xManager.get(), aDocName )); - rInfo.SetResult(xDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK : - ERRCODE_BUTTON_CANCEL); - rInfo.SetPassword( xDialog->GetPassword() ); - } + rInfo.SetResult(xDialog->Execute() + == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL); + rInfo.SetPassword( xDialog->GetPassword() ); + } } catch (std::bad_alloc const &) { - throw star::uno::RuntimeException( + throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")), - star::uno::Reference< star::uno::XInterface>()); + uno::Reference< uno::XInterface>()); } } void UUIInteractionHelper::executeCookieDialog(CntHTTPCookieRequest & rRequest) - SAL_THROW((star::uno::RuntimeException)) + SAL_THROW((uno::RuntimeException)) { try { vos::OGuard aGuard(Application::GetSolarMutex()); - std::auto_ptr< ResMgr > - xManager(ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); - std::auto_ptr< CookiesDialog > - xDialog(new CookiesDialog( - getParentProperty(), &rRequest, xManager.get())); + std::auto_ptr< ResMgr > xManager( + ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); + std::auto_ptr< CookiesDialog > xDialog( + new CookiesDialog(getParentProperty(), &rRequest, xManager.get())); xDialog->Execute(); } catch (std::bad_alloc const &) { - throw star::uno::RuntimeException( + throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")), - star::uno::Reference< star::uno::XInterface>()); + uno::Reference< uno::XInterface>()); } } -void UUIInteractionHelper::executeFilterDialog( +void +UUIInteractionHelper::executeFilterDialog( rtl::OUString const & rURL , uui::FilterNameList const & rFilters, rtl::OUString & rFilter ) - SAL_THROW((star::uno::RuntimeException)) + SAL_THROW((uno::RuntimeException)) { try { vos::OGuard aGuard(Application::GetSolarMutex()); - std::auto_ptr< ResMgr > - xManager(ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); + std::auto_ptr< ResMgr > xManager( + ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); - std::auto_ptr< uui::FilterDialog > - xDialog(new uui::FilterDialog(getParentProperty(), - xManager.get())); + std::auto_ptr< uui::FilterDialog > xDialog( + new uui::FilterDialog(getParentProperty(), xManager.get())); xDialog->SetURL(rURL); xDialog->ChangeFilters(&rFilters); @@ -2057,21 +2045,20 @@ void UUIInteractionHelper::executeFilterDialog( } catch (std::bad_alloc const &) { - throw star::uno::RuntimeException( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")), - star::uno::Reference< star::uno::XInterface >()); + throw uno::RuntimeException( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")), + uno::Reference< uno::XInterface >()); } } USHORT UUIInteractionHelper::executeErrorDialog( - star::task::InteractionClassification eClassification, + task::InteractionClassification eClassification, rtl::OUString const & rContext, rtl::OUString const & rMessage, WinBits nButtonMask) - SAL_THROW((star::uno::RuntimeException)) + SAL_THROW((uno::RuntimeException)) { - vos::OGuard aGuard(Application::GetSolarMutex()); rtl::OUStringBuffer aText(rContext); @@ -2085,46 +2072,46 @@ UUIInteractionHelper::executeErrorDialog( { switch (eClassification) { - case star::task::InteractionClassification_ERROR: - xBox.reset(new ErrorBox(getParentProperty(), - nButtonMask, + case task::InteractionClassification_ERROR: + xBox.reset(new ErrorBox(getParentProperty(), + nButtonMask, aText.makeStringAndClear())); - break; + break; - case star::task::InteractionClassification_WARNING: - xBox.reset(new WarningBox(getParentProperty(), + case task::InteractionClassification_WARNING: + xBox.reset(new WarningBox(getParentProperty(), nButtonMask, - aText.makeStringAndClear())); - break; + aText.makeStringAndClear())); + break; - case star::task::InteractionClassification_INFO: - if ((nButtonMask & 0x01F00000) == WB_DEF_OK) - //TODO! missing win bit button mask define (want to ignore - // any default button settings)... + case task::InteractionClassification_INFO: + if ((nButtonMask & 0x01F00000) == WB_DEF_OK) + //TODO! missing win bit button mask define (want to ignore + // any default button settings)... xBox.reset(new InfoBox(getParentProperty(), aText.makeStringAndClear())); - else - xBox.reset(new ErrorBox(getParentProperty(), - nButtonMask, - aText.makeStringAndClear())); + else + xBox.reset(new ErrorBox(getParentProperty(), + nButtonMask, + aText.makeStringAndClear())); break; - case star::task::InteractionClassification_QUERY: - xBox.reset(new QueryBox(getParentProperty(), - nButtonMask, - aText.makeStringAndClear())); - break; + case task::InteractionClassification_QUERY: + xBox.reset(new QueryBox(getParentProperty(), + nButtonMask, + aText.makeStringAndClear())); + break; default: - OSL_ASSERT(false); - break; - } + OSL_ASSERT(false); + break; + } } catch (std::bad_alloc const &) { - throw star::uno::RuntimeException( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")), - star::uno::Reference< star::uno::XInterface >()); + throw uno::RuntimeException( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")), + uno::Reference< uno::XInterface >()); } USHORT aResult = xBox->Execute(); @@ -2155,9 +2142,8 @@ UUIInteractionHelper::executeMessageBox( rtl::OUString const & rTitle, rtl::OUString const & rMessage, WinBits nButtonMask ) - SAL_THROW((star::uno::RuntimeException)) + SAL_THROW((uno::RuntimeException)) { - vos::OGuard aGuard(Application::GetSolarMutex()); MessBox xBox( getParentProperty(), nButtonMask, rTitle, rMessage ); @@ -2185,55 +2171,51 @@ UUIInteractionHelper::executeMessageBox( return aResult; } -star::uno::Reference< star::task::XInteractionHandler > +uno::Reference< task::XInteractionHandler > UUIInteractionHelper::getInteractionHandler() const - SAL_THROW((star::uno::RuntimeException)) + SAL_THROW((uno::RuntimeException)) { - star::uno::Reference< star::task::XInteractionHandler > xIH; + uno::Reference< task::XInteractionHandler > xIH; try { - xIH = star::uno::Reference< star::task::XInteractionHandler >( - m_xServiceFactory->createInstanceWithArguments( + xIH.set(m_xServiceFactory->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.task.InteractionHandler")), m_aProperties), - star::uno::UNO_QUERY); + uno::UNO_QUERY); } - catch (star::uno::Exception const &) + catch (uno::Exception const &) {} if (!xIH.is()) - throw star::uno::RuntimeException( + throw uno::RuntimeException( rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "unable to instanciate Interaction Handler service")), - star::uno::Reference< star::uno::XInterface >()); + RTL_CONSTASCII_USTRINGPARAM( + "unable to instanciate Interaction Handler service")), + uno::Reference< uno::XInterface >()); return xIH; } void UUIInteractionHelper::handleAuthenticationRequest( - star::ucb::AuthenticationRequest const & rRequest, - star::uno::Sequence< star::uno::Reference< - star::task::XInteractionContinuation > > const & - rContinuations, + ucb::AuthenticationRequest const & rRequest, + uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & + rContinuations, const rtl::OUString & rURL) - SAL_THROW((star::uno::RuntimeException)) + SAL_THROW((uno::RuntimeException)) { - star::uno::Reference< star::task::XInteractionRetry > xRetry; - star::uno::Reference< star::task::XInteractionAbort > xAbort; - star::uno::Reference< star::ucb::XInteractionSupplyAuthentication > + uno::Reference< task::XInteractionRetry > xRetry; + uno::Reference< task::XInteractionAbort > xAbort; + uno::Reference< ucb::XInteractionSupplyAuthentication > xSupplyAuthentication; - star::uno::Reference< star::ucb::XInteractionSupplyAuthentication2 > + uno::Reference< ucb::XInteractionSupplyAuthentication2 > xSupplyAuthentication2; - getContinuations( - rContinuations, - 0, 0, &xRetry, &xAbort, - &xSupplyAuthentication, &xSupplyAuthentication2, 0, 0, 0); + getContinuations(rContinuations, &xRetry, &xAbort, &xSupplyAuthentication); + if (xSupplyAuthentication.is()) + xSupplyAuthentication2.set(xSupplyAuthentication, uno::UNO_QUERY); - star::uno::Reference< star::task::XInteractionHandler > xIH( - getInteractionHandler()); + uno::Reference< task::XInteractionHandler > xIH(getInteractionHandler()); ////////////////////////// // First, try to obatin credentials from password container service. @@ -2253,13 +2235,13 @@ UUIInteractionHelper::handleAuthenticationRequest( bool bRememberPersistent; if (xSupplyAuthentication.is()) { - star::ucb::RememberAuthentication eDefault; - star::uno::Sequence< star::ucb::RememberAuthentication > + ucb::RememberAuthentication eDefault; + uno::Sequence< ucb::RememberAuthentication > aModes(xSupplyAuthentication->getRememberPasswordModes(eDefault)); - bRemember = eDefault != star::ucb::RememberAuthentication_NO; + bRemember = eDefault != ucb::RememberAuthentication_NO; bRememberPersistent = false; for (sal_Int32 i = 0; i < aModes.getLength(); ++i) - if (aModes[i] == star::ucb::RememberAuthentication_PERSISTENT) + if (aModes[i] == ucb::RememberAuthentication_PERSISTENT) { bRememberPersistent = true; break; @@ -2319,10 +2301,10 @@ UUIInteractionHelper::handleAuthenticationRequest( xSupplyAuthentication-> setRememberPassword( aInfo.GetIsSavePassword() ? - bRememberPersistent ? - star::ucb::RememberAuthentication_PERSISTENT : - star::ucb::RememberAuthentication_SESSION : - star::ucb::RememberAuthentication_NO); + bRememberPersistent ? + ucb::RememberAuthentication_PERSISTENT : + ucb::RememberAuthentication_SESSION : + ucb::RememberAuthentication_NO); if (rRequest.HasRealm) { if (xSupplyAuthentication->canSetRealm()) @@ -2358,7 +2340,7 @@ UUIInteractionHelper::handleAuthenticationRequest( { if (aInfo.GetIsSavePassword()) { - star::uno::Sequence< rtl::OUString > + uno::Sequence< rtl::OUString > aPassList(aInfo.GetAccount().Len() == 0 ? 1 : 2); aPassList[0] = aInfo.GetPassword(); if (aInfo.GetAccount().Len() != 0) @@ -2387,50 +2369,47 @@ UUIInteractionHelper::handleAuthenticationRequest( } sal_Bool -UUIInteractionHelper::isDomainMatch( rtl::OUString hostName, rtl::OUString certHostName) +UUIInteractionHelper::isDomainMatch( + rtl::OUString hostName, rtl::OUString certHostName) { if (hostName.equalsIgnoreAsciiCase( certHostName )) return sal_True; - - - if ( 0 == certHostName.indexOf( rtl::OUString::createFromAscii( "*" ) ) && hostName.getLength() >= certHostName.getLength() ) + if ( 0 == certHostName.indexOf( rtl::OUString::createFromAscii( "*" ) ) && + hostName.getLength() >= certHostName.getLength() ) { rtl::OUString cmpStr = certHostName.copy( 1 ); - if ( hostName.matchIgnoreAsciiCase( cmpStr, hostName.getLength( ) - cmpStr.getLength()) ) + if ( hostName.matchIgnoreAsciiCase( + cmpStr, hostName.getLength() - cmpStr.getLength()) ) return sal_True; - } return sal_False; } - void UUIInteractionHelper::handleCertificateValidationRequest( - star::ucb::CertificateValidationRequest const & rRequest, - star::uno::Sequence< star::uno::Reference< - star::task::XInteractionContinuation > > const & - rContinuations) - SAL_THROW((star::uno::RuntimeException)) + ucb::CertificateValidationRequest const & rRequest, + uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & + rContinuations) + SAL_THROW((uno::RuntimeException)) { - star::uno::Reference< star::task::XInteractionHandler > xIH = getInteractionHandler(); - - star::uno::Reference< star::task::XInteractionApprove > xApprove; - star::uno::Reference< star::task::XInteractionAbort > xAbort; + uno::Reference< task::XInteractionHandler > xIH( getInteractionHandler() ); - getContinuations( - rContinuations, &xApprove, 0, 0, &xAbort, 0, 0, 0, 0, 0); + uno::Reference< task::XInteractionApprove > xApprove; + uno::Reference< task::XInteractionAbort > xAbort; + getContinuations(rContinuations, &xApprove, &xAbort); sal_Int32 failures = rRequest.CertificateValidity; - sal_Bool trustCert = sal_True; - - if ( ((failures & csss::CertificateValidity::UNTRUSTED) == csss::CertificateValidity::UNTRUSTED ) || - ((failures & csss::CertificateValidity::ISSUER_UNTRUSTED) == csss::CertificateValidity::ISSUER_UNTRUSTED) || - ((failures & csss::CertificateValidity::ROOT_UNTRUSTED) == csss::CertificateValidity::ROOT_UNTRUSTED) ) + if ( ((failures & security::CertificateValidity::UNTRUSTED) + == security::CertificateValidity::UNTRUSTED ) || + ((failures & security::CertificateValidity::ISSUER_UNTRUSTED) + == security::CertificateValidity::ISSUER_UNTRUSTED) || + ((failures & security::CertificateValidity::ROOT_UNTRUSTED) + == security::CertificateValidity::ROOT_UNTRUSTED) ) { if ( executeUnknownAuthDialog( rRequest.Certificate ) ) trustCert = sal_True; @@ -2438,32 +2417,47 @@ UUIInteractionHelper::handleCertificateValidationRequest( trustCert = sal_False; } - if ( (!isDomainMatch( rRequest.HostName, GetContentPart( rRequest.Certificate.get()->getSubjectName()) )) && - trustCert ) + if ( (!isDomainMatch( + rRequest.HostName, + GetContentPart( + rRequest.Certificate->getSubjectName()) )) && + trustCert ) { - if ( executeSSLWarnDialog( rRequest.Certificate, SSLWARN_TYPE_DOMAINMISMATCH, rRequest.HostName ) ) + if ( executeSSLWarnDialog( rRequest.Certificate, + SSLWARN_TYPE_DOMAINMISMATCH, + rRequest.HostName ) ) trustCert = sal_True; else trustCert = sal_False; } - if ( (((failures & csss::CertificateValidity::TIME_INVALID) == csss::CertificateValidity::TIME_INVALID) || - ((failures & csss::CertificateValidity::NOT_TIME_NESTED) == csss::CertificateValidity::NOT_TIME_NESTED)) && - trustCert ) + if ( (((failures & security::CertificateValidity::TIME_INVALID) + == security::CertificateValidity::TIME_INVALID) || + ((failures & security::CertificateValidity::NOT_TIME_NESTED) + == security::CertificateValidity::NOT_TIME_NESTED)) && + trustCert ) { - if ( executeSSLWarnDialog( rRequest.Certificate, SSLWARN_TYPE_EXPIRED, rRequest.HostName ) ) + if ( executeSSLWarnDialog( rRequest.Certificate, + SSLWARN_TYPE_EXPIRED, + rRequest.HostName ) ) trustCert = sal_True; else trustCert = sal_False; } - if ( (((failures & csss::CertificateValidity::REVOKED) == csss::CertificateValidity::REVOKED) || - ((failures & csss::CertificateValidity::SIGNATURE_INVALID) == csss::CertificateValidity::SIGNATURE_INVALID) || - ((failures & csss::CertificateValidity::EXTENSION_INVALID) == csss::CertificateValidity::EXTENSION_INVALID) || - ((failures & csss::CertificateValidity::INVALID) == csss::CertificateValidity::INVALID)) && - trustCert ) + if ( (((failures & security::CertificateValidity::REVOKED) + == security::CertificateValidity::REVOKED) || + ((failures & security::CertificateValidity::SIGNATURE_INVALID) + == security::CertificateValidity::SIGNATURE_INVALID) || + ((failures & security::CertificateValidity::EXTENSION_INVALID) + == security::CertificateValidity::EXTENSION_INVALID) || + ((failures & security::CertificateValidity::INVALID) + == security::CertificateValidity::INVALID)) && + trustCert ) { - if ( executeSSLWarnDialog( rRequest.Certificate, SSLWARN_TYPE_INVALID, rRequest.HostName ) ) + if ( executeSSLWarnDialog( rRequest.Certificate, + SSLWARN_TYPE_INVALID, + rRequest.HostName ) ) trustCert = sal_True; else trustCert = sal_False; @@ -2472,27 +2466,13 @@ UUIInteractionHelper::handleCertificateValidationRequest( if ( trustCert ) { if (xApprove.is()) - xApprove->select(); - } else - { - if (xAbort.is()) - xAbort->select(); + xApprove->select(); } - - /* - - switch (executeMessageBox( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Dialog1")), rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Dummy dialog")), WB_YES_NO | WB_DEF_YES )) + else { - case ERRCODE_BUTTON_YES: - if (xApprove.is()) - xApprove->select(); - break; - default: if (xAbort.is()) xAbort->select(); - break; } - */ } namespace { @@ -2527,10 +2507,10 @@ executeSimpleNameClashResolveDialog( void UUIInteractionHelper::handleNameClashResolveRequest( - star::ucb::NameClashResolveRequest const & rRequest, - star::uno::Sequence< star::uno::Reference< - star::task::XInteractionContinuation > > const & rContinuations) - SAL_THROW((star::uno::RuntimeException)) + ucb::NameClashResolveRequest const & rRequest, + uno::Sequence< uno::Reference< + task::XInteractionContinuation > > const & rContinuations) + SAL_THROW((uno::RuntimeException)) { OSL_ENSURE( rRequest.TargetFolderURL.getLength() > 0, @@ -2540,15 +2520,11 @@ UUIInteractionHelper::handleNameClashResolveRequest( rRequest.ClashingName.getLength() > 0, "NameClashResolveRequest must not contain empty ClashingName" ); - star::uno::Reference< star::task::XInteractionAbort > - xAbort; - star::uno::Reference< star::ucb::XInteractionSupplyName > - xSupplyName; - star::uno::Reference< star::ucb::XInteractionReplaceExistingData > - xReplaceExistingData; + uno::Reference< task::XInteractionAbort > xAbort; + uno::Reference< ucb::XInteractionSupplyName > xSupplyName; + uno::Reference< ucb::XInteractionReplaceExistingData > xReplaceExistingData; getContinuations( - rContinuations, - 0, 0, 0, &xAbort, 0, 0, 0, &xSupplyName, &xReplaceExistingData); + rContinuations, &xAbort, &xSupplyName, &xReplaceExistingData); OSL_ENSURE( xAbort.is(), "NameClashResolveRequest must contain Abort continuation" ); @@ -2597,19 +2573,16 @@ UUIInteractionHelper::handleNameClashResolveRequest( void UUIInteractionHelper::handleMasterPasswordRequest( - star::task::PasswordRequestMode nMode, - star::uno::Sequence< star::uno::Reference< - star::task::XInteractionContinuation > > const & + task::PasswordRequestMode nMode, + uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & rContinuations) - SAL_THROW((star::uno::RuntimeException)) + SAL_THROW((uno::RuntimeException)) { - star::uno::Reference< star::task::XInteractionRetry > xRetry; - star::uno::Reference< star::task::XInteractionAbort > xAbort; - star::uno::Reference< star::ucb::XInteractionSupplyAuthentication > + uno::Reference< task::XInteractionRetry > xRetry; + uno::Reference< task::XInteractionAbort > xAbort; + uno::Reference< ucb::XInteractionSupplyAuthentication > xSupplyAuthentication; - getContinuations( - rContinuations, - 0, 0, &xRetry, &xAbort, &xSupplyAuthentication, 0, 0, 0, 0); + getContinuations(rContinuations, &xRetry, &xAbort, &xSupplyAuthentication); LoginErrorInfo aInfo; // in case of master password a hash code is returned @@ -2620,39 +2593,36 @@ UUIInteractionHelper::handleMasterPasswordRequest( case ERRCODE_BUTTON_OK: if (xSupplyAuthentication.is()) { - if (xSupplyAuthentication->canSetPassword()) - xSupplyAuthentication->setPassword(aInfo.GetPassword()); - xSupplyAuthentication->select(); + if (xSupplyAuthentication->canSetPassword()) + xSupplyAuthentication->setPassword(aInfo.GetPassword()); + xSupplyAuthentication->select(); } break; case ERRCODE_BUTTON_RETRY: if (xRetry.is()) - xRetry->select(); + xRetry->select(); break; default: if (xAbort.is()) - xAbort->select(); + xAbort->select(); break; } } void UUIInteractionHelper::handlePasswordRequest( - star::task::PasswordRequestMode nMode, - star::uno::Sequence< star::uno::Reference< - star::task::XInteractionContinuation > > const & + task::PasswordRequestMode nMode, + uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & rContinuations, ::rtl::OUString aDocumentName ) - SAL_THROW((star::uno::RuntimeException)) + SAL_THROW((uno::RuntimeException)) { - star::uno::Reference< star::task::XInteractionRetry > xRetry; - star::uno::Reference< star::task::XInteractionAbort > xAbort; - star::uno::Reference< star::task::XInteractionPassword > - xPassword; - getContinuations( - rContinuations, 0, 0, &xRetry, &xAbort, 0, 0, &xPassword, 0, 0); + uno::Reference< task::XInteractionRetry > xRetry; + uno::Reference< task::XInteractionAbort > xAbort; + uno::Reference< task::XInteractionPassword > xPassword; + getContinuations(rContinuations, &xRetry, &xAbort, &xPassword); LoginErrorInfo aInfo; executePasswordDialog(aInfo, nMode, aDocumentName); @@ -2662,14 +2632,14 @@ UUIInteractionHelper::handlePasswordRequest( case ERRCODE_BUTTON_OK: if (xPassword.is()) { - xPassword->setPassword(aInfo.GetPassword()); - xPassword->select(); + xPassword->setPassword(aInfo.GetPassword()); + xPassword->select(); } break; case ERRCODE_BUTTON_RETRY: if (xRetry.is()) - xRetry->select(); + xRetry->select(); break; default: @@ -2681,19 +2651,16 @@ UUIInteractionHelper::handlePasswordRequest( void UUIInteractionHelper::handleMSPasswordRequest( - star::task::PasswordRequestMode nMode, - star::uno::Sequence< star::uno::Reference< - star::task::XInteractionContinuation > > const & + task::PasswordRequestMode nMode, + uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & rContinuations, ::rtl::OUString aDocumentName ) - SAL_THROW((star::uno::RuntimeException)) + SAL_THROW((uno::RuntimeException)) { - star::uno::Reference< star::task::XInteractionRetry > xRetry; - star::uno::Reference< star::task::XInteractionAbort > xAbort; - star::uno::Reference< star::task::XInteractionPassword > - xPassword; - getContinuations( - rContinuations, 0, 0, &xRetry, &xAbort, 0, 0, &xPassword, 0, 0); + uno::Reference< task::XInteractionRetry > xRetry; + uno::Reference< task::XInteractionAbort > xAbort; + uno::Reference< task::XInteractionPassword > xPassword; + getContinuations(rContinuations, &xRetry, &xAbort, &xPassword); LoginErrorInfo aInfo; executeMSPasswordDialog(aInfo, nMode, aDocumentName); @@ -2703,14 +2670,14 @@ UUIInteractionHelper::handleMSPasswordRequest( case ERRCODE_BUTTON_OK: if (xPassword.is()) { - xPassword->setPassword(aInfo.GetPassword()); - xPassword->select(); + xPassword->setPassword(aInfo.GetPassword()); + xPassword->select(); } break; case ERRCODE_BUTTON_RETRY: if (xRetry.is()) - xRetry->select(); + xRetry->select(); break; default: @@ -2722,109 +2689,107 @@ UUIInteractionHelper::handleMSPasswordRequest( void UUIInteractionHelper::handleCookiesRequest( - star::ucb::HandleCookiesRequest const & rRequest, - star::uno::Sequence< star::uno::Reference< - star::task::XInteractionContinuation > > const & + ucb::HandleCookiesRequest const & rRequest, + uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & rContinuations) - SAL_THROW((star::uno::RuntimeException)) + SAL_THROW((uno::RuntimeException)) { CookieList aCookies; for (sal_Int32 i = 0; i < rRequest.Cookies.getLength(); ++i) { - try - { - std::auto_ptr< CntHTTPCookie > xCookie(new CntHTTPCookie); - xCookie->m_aName = UniString(rRequest.Cookies[i].Name); - xCookie->m_aValue = UniString(rRequest.Cookies[i].Value); - xCookie->m_aDomain = UniString(rRequest.Cookies[i].Domain); - xCookie->m_aPath = UniString(rRequest.Cookies[i].Path); - xCookie->m_aExpires - = DateTime(Date(rRequest.Cookies[i].Expires.Day, - rRequest.Cookies[i].Expires.Month, - rRequest.Cookies[i].Expires.Year), - Time(rRequest.Cookies[i].Expires.Hours, - rRequest.Cookies[i].Expires.Minutes, - rRequest.Cookies[i].Expires.Seconds, - rRequest.Cookies[i].Expires. - HundredthSeconds)); - xCookie->m_nFlags - = rRequest.Cookies[i].Secure ? CNTHTTP_COOKIE_FLAG_SECURE : 0; - switch (rRequest.Cookies[i].Policy) - { - case star::ucb::CookiePolicy_CONFIRM: - xCookie->m_nPolicy = CNTHTTP_COOKIE_POLICY_INTERACTIVE; - break; + try + { + std::auto_ptr< CntHTTPCookie > xCookie(new CntHTTPCookie); + xCookie->m_aName = UniString(rRequest.Cookies[i].Name); + xCookie->m_aValue = UniString(rRequest.Cookies[i].Value); + xCookie->m_aDomain = UniString(rRequest.Cookies[i].Domain); + xCookie->m_aPath = UniString(rRequest.Cookies[i].Path); + xCookie->m_aExpires + = DateTime(Date(rRequest.Cookies[i].Expires.Day, + rRequest.Cookies[i].Expires.Month, + rRequest.Cookies[i].Expires.Year), + Time(rRequest.Cookies[i].Expires.Hours, + rRequest.Cookies[i].Expires.Minutes, + rRequest.Cookies[i].Expires.Seconds, + rRequest.Cookies[i].Expires.HundredthSeconds)); + xCookie->m_nFlags + = rRequest.Cookies[i].Secure ? CNTHTTP_COOKIE_FLAG_SECURE : 0; + switch (rRequest.Cookies[i].Policy) + { + case ucb::CookiePolicy_CONFIRM: + xCookie->m_nPolicy = CNTHTTP_COOKIE_POLICY_INTERACTIVE; + break; - case star::ucb::CookiePolicy_ACCEPT: - xCookie->m_nPolicy = CNTHTTP_COOKIE_POLICY_ACCEPTED; - break; + case ucb::CookiePolicy_ACCEPT: + xCookie->m_nPolicy = CNTHTTP_COOKIE_POLICY_ACCEPTED; + break; - case star::ucb::CookiePolicy_IGNORE: - xCookie->m_nPolicy = CNTHTTP_COOKIE_POLICY_BANNED; - break; + case ucb::CookiePolicy_IGNORE: + xCookie->m_nPolicy = CNTHTTP_COOKIE_POLICY_BANNED; + break; default: - OSL_ASSERT(false); - break; + OSL_ASSERT(false); + break; + } + aCookies.Insert(xCookie.get(), LIST_APPEND); + xCookie.release(); + } + catch (std::bad_alloc const &) + { + throw uno::RuntimeException( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "out of memory")), + uno::Reference< uno::XInterface >()); } - aCookies.Insert(xCookie.get(), LIST_APPEND); - xCookie.release(); - } - catch (std::bad_alloc const &) - { - throw star::uno::RuntimeException( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "out of memory")), - star::uno::Reference< star::uno::XInterface >()); - } } CntHTTPCookieRequest aRequest(rRequest.URL, aCookies, - rRequest.Request == star::ucb::CookieRequest_RECEIVE ? - CNTHTTP_COOKIE_REQUEST_RECV : - CNTHTTP_COOKIE_REQUEST_SEND); + rRequest.Request == ucb::CookieRequest_RECEIVE + ? CNTHTTP_COOKIE_REQUEST_RECV + : CNTHTTP_COOKIE_REQUEST_SEND); executeCookieDialog(aRequest); for (sal_Int32 i = 0; i < rContinuations.getLength(); ++i) { - star::uno::Reference< star::ucb::XInteractionCookieHandling > - xCookieHandling(rContinuations[i], star::uno::UNO_QUERY); + uno::Reference< ucb::XInteractionCookieHandling > + xCookieHandling(rContinuations[i], uno::UNO_QUERY); if (xCookieHandling.is()) { switch (aRequest.m_nRet) { - case CNTHTTP_COOKIE_POLICY_INTERACTIVE: - xCookieHandling-> - setGeneralPolicy(star::ucb::CookiePolicy_CONFIRM); - break; + case CNTHTTP_COOKIE_POLICY_INTERACTIVE: + xCookieHandling-> + setGeneralPolicy(ucb::CookiePolicy_CONFIRM); + break; - case CNTHTTP_COOKIE_POLICY_ACCEPTED: - xCookieHandling-> - setGeneralPolicy(star::ucb::CookiePolicy_ACCEPT); - break; + case CNTHTTP_COOKIE_POLICY_ACCEPTED: + xCookieHandling-> + setGeneralPolicy(ucb::CookiePolicy_ACCEPT); + break; - case CNTHTTP_COOKIE_POLICY_BANNED: - xCookieHandling-> - setGeneralPolicy(star::ucb::CookiePolicy_IGNORE); - break; + case CNTHTTP_COOKIE_POLICY_BANNED: + xCookieHandling-> + setGeneralPolicy(ucb::CookiePolicy_IGNORE); + break; } for (sal_Int32 j = 0; j < rRequest.Cookies.getLength(); ++j) if (rRequest.Cookies[j].Policy - == star::ucb::CookiePolicy_CONFIRM) + == ucb::CookiePolicy_CONFIRM) switch (static_cast< CntHTTPCookie * >(aCookies. - GetObject(j))-> - m_nPolicy) + GetObject(j))-> + m_nPolicy) { - case CNTHTTP_COOKIE_POLICY_ACCEPTED: - xCookieHandling-> + case CNTHTTP_COOKIE_POLICY_ACCEPTED: + xCookieHandling-> setSpecificPolicy(rRequest.Cookies[j], true); - break; + break; - case CNTHTTP_COOKIE_POLICY_BANNED: - xCookieHandling-> - setSpecificPolicy(rRequest.Cookies[j], false); - break; + case CNTHTTP_COOKIE_POLICY_BANNED: + xCookieHandling-> + setSpecificPolicy(rRequest.Cookies[j], false); + break; } xCookieHandling->select(); break; @@ -2834,45 +2799,38 @@ UUIInteractionHelper::handleCookiesRequest( void UUIInteractionHelper::handleNoSuchFilterRequest( - star::document::NoSuchFilterRequest const & rRequest, - star::uno::Sequence< - star::uno::Reference< star::task::XInteractionContinuation > > const & + document::NoSuchFilterRequest const & rRequest, + uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & rContinuations ) - SAL_THROW((star::uno::RuntimeException)) + SAL_THROW((uno::RuntimeException)) { - star::uno::Reference< star::task::XInteractionAbort > xAbort; - star::uno::Reference< - star::document::XInteractionFilterSelect > xFilterTransport; + uno::Reference< task::XInteractionAbort > xAbort; + uno::Reference< document::XInteractionFilterSelect > xFilterTransport; + getContinuations(rContinuations, &xAbort, &xFilterTransport); - sal_Int32 nCount = rContinuations.getLength(); - for( sal_Int32 nStep=0; nStep( - rContinuations[nStep], star::uno::UNO_QUERY ); - - if( ! xFilterTransport.is() ) - xFilterTransport = star::uno::Reference< - star::document::XInteractionFilterSelect >( - rContinuations[nStep], star::uno::UNO_QUERY ); - } - - // check neccessary ressources - if they doesn't exist - abort or + // check neccessary ressources - if they don't exist - abort or // break this operation if (!xAbort.is()) return; - if (!xFilterTransport.is() || !m_xServiceFactory.is()) + if (!xFilterTransport.is()) { xAbort->select(); return; } - star::uno::Reference< star::container::XContainerQuery > - xFilterContainer( m_xServiceFactory->createInstance( - ::rtl::OUString::createFromAscii( - "com.sun.star.document.FilterFactory") ), - star::uno::UNO_QUERY ); + uno::Reference< container::XContainerQuery > xFilterContainer; + try + { + xFilterContainer.set( m_xServiceFactory->createInstance( + ::rtl::OUString::createFromAscii( + "com.sun.star.document.FilterFactory") ), + uno::UNO_QUERY ); + } + catch ( uno::Exception const & ) + { + } + if (!xFilterContainer.is()) { xAbort->select(); @@ -2894,10 +2852,10 @@ UUIInteractionHelper::handleNoSuchFilterRequest( // find his filter vry easy by his UIName ...) // - We use "_query_all" here ... but we filter graphic filters // out by using DocumentService property later! - star::uno::Reference< star::container::XEnumeration > xFilters - = xFilterContainer->createSubSetEnumerationByQuery( - ::rtl::OUString::createFromAscii( - "_query_all:sort_prop=uiname:iflags=1:eflags=143360")); + uno::Reference< container::XEnumeration > xFilters + = xFilterContainer->createSubSetEnumerationByQuery( + ::rtl::OUString::createFromAscii( + "_query_all:sort_prop=uiname:iflags=1:eflags=143360")); while (xFilters->hasMoreElements()) { try @@ -2906,26 +2864,23 @@ UUIInteractionHelper::handleNoSuchFilterRequest( uui::FilterNamePair aPair; aPair.sInternal = lProps.getUnpackedValueOrDefault( - rtl::OUString::createFromAscii("Name"), ::rtl::OUString()); + rtl::OUString::createFromAscii("Name"), ::rtl::OUString()); aPair.sUI = lProps.getUnpackedValueOrDefault( - rtl::OUString::createFromAscii("UIName"), ::rtl::OUString()); - if ( - (!aPair.sInternal.Len()) || - (!aPair.sUI.Len() ) - ) + rtl::OUString::createFromAscii("UIName"), ::rtl::OUString()); + if ( (!aPair.sInternal.Len()) || (!aPair.sUI.Len() ) ) { continue; } lNames.push_back( aPair ); } - catch(const star::uno::RuntimeException&) - { - throw; - } - catch(const star::uno::Exception&) - { - continue; - } + catch(const uno::RuntimeException&) + { + throw; + } + catch(const uno::Exception&) + { + continue; + } } // no list available for showing @@ -2955,89 +2910,78 @@ UUIInteractionHelper::handleNoSuchFilterRequest( void UUIInteractionHelper::handleAmbigousFilterRequest( - star::document::AmbigousFilterRequest const & rRequest, - star::uno::Sequence< - star::uno::Reference< - star::task::XInteractionContinuation > > const & rContinuations) - SAL_THROW((star::uno::RuntimeException)) + document::AmbigousFilterRequest const & rRequest, + uno::Sequence< + uno::Reference< + task::XInteractionContinuation > > const & rContinuations) + SAL_THROW((uno::RuntimeException)) { - star::uno::Reference< star::task::XInteractionAbort > xAbort; - star::uno::Reference< - star::document::XInteractionFilterSelect > xFilterTransport; + uno::Reference< task::XInteractionAbort > xAbort; + uno::Reference< document::XInteractionFilterSelect > xFilterTransport; + getContinuations(rContinuations, &xAbort, &xFilterTransport); - sal_Int32 nCount = rContinuations.getLength(); - for( sal_Int32 nStep=0; nStep( - rContinuations[nStep], star::uno::UNO_QUERY ); + uui::FilterNameList lNames; - if( ! xFilterTransport.is() ) - xFilterTransport = star::uno::Reference< - star::document::XInteractionFilterSelect >( - rContinuations[nStep], star::uno::UNO_QUERY ); + uno::Reference< container::XNameContainer > xFilterContainer; + try + { + xFilterContainer.set( m_xServiceFactory->createInstance( + ::rtl::OUString::createFromAscii( + "com.sun.star.document.FilterFactory") ), + uno::UNO_QUERY ); + } + catch ( uno::Exception & ) + { } - uui::FilterNameList lNames; - - if( m_xServiceFactory.is() == sal_True ) + if( xFilterContainer.is() ) { - star::uno::Reference< star::container::XNameContainer > - xFilterContainer( m_xServiceFactory->createInstance( - ::rtl::OUString::createFromAscii( - "com.sun.star.document.FilterFactory") ), - star::uno::UNO_QUERY ); - if( xFilterContainer.is() == sal_True ) - { - star::uno::Any aPackedSet ; - star::uno::Sequence< star::beans::PropertyValue > lProps ; - sal_Int32 nStep ; - uui::FilterNamePair aPair ; + uno::Any aPackedSet ; + uno::Sequence< beans::PropertyValue > lProps ; + sal_Int32 nStep ; + uui::FilterNamePair aPair ; - try - { - aPackedSet - = xFilterContainer->getByName( rRequest.SelectedFilter ); - } - catch(const ::com::sun::star::container::NoSuchElementException&) - { - aPackedSet.clear(); - } - aPackedSet >>= lProps; - for( nStep=0; nStepgetByName( rRequest.SelectedFilter ); + } + catch(const container::NoSuchElementException&) + { + aPackedSet.clear(); + } + aPackedSet >>= lProps; + for( nStep=0; nStep>= sTemp; - aPair.sUI = sTemp; - aPair.sInternal = rRequest.SelectedFilter; - lNames.push_back( aPair ); - break; - } + ::rtl::OUString sTemp; + lProps[nStep].Value >>= sTemp; + aPair.sUI = sTemp; + aPair.sInternal = rRequest.SelectedFilter; + lNames.push_back( aPair ); + break; } + } - try - { - aPackedSet - = xFilterContainer->getByName( rRequest.DetectedFilter ); - } - catch(const ::com::sun::star::container::NoSuchElementException&) - { - aPackedSet.clear(); - } - aPackedSet >>= lProps; - for( nStep=0; nStepgetByName( rRequest.DetectedFilter ); + } + catch(const container::NoSuchElementException&) + { + aPackedSet.clear(); + } + aPackedSet >>= lProps; + for( nStep=0; nStep>= sTemp; - aPair.sUI = sTemp; - aPair.sInternal = rRequest.DetectedFilter; - lNames.push_back( aPair ); - break; - } + ::rtl::OUString sTemp; + lProps[nStep].Value >>= sTemp; + aPair.sUI = sTemp; + aPair.sInternal = rRequest.DetectedFilter; + lNames.push_back( aPair ); + break; } } } @@ -3067,124 +3011,103 @@ UUIInteractionHelper::handleAmbigousFilterRequest( void UUIInteractionHelper::handleGenericErrorRequest( sal_Int32 nErrorCode, - star::uno::Sequence< star::uno::Reference< - star::task::XInteractionContinuation > > const & rContinuations, + uno::Sequence< uno::Reference< + task::XInteractionContinuation > > const & rContinuations, bool bObtainErrorStringOnly, bool & bHasErrorString, rtl::OUString & rErrorString) - SAL_THROW((star::uno::RuntimeException)) + SAL_THROW((uno::RuntimeException)) { if (bObtainErrorStringOnly) { bHasErrorString = isInformationalErrorMessageRequest(rContinuations); if (bHasErrorString) - { - String aErrorString; - ErrorHandler::GetErrorString(nErrorCode, aErrorString); - rErrorString = aErrorString; - } + { + String aErrorString; + ErrorHandler::GetErrorString(nErrorCode, aErrorString); + rErrorString = aErrorString; + } } else { - star::uno::Reference< star::task::XInteractionAbort > xAbort; - star::uno::Reference< star::task::XInteractionApprove > xApprove; - - sal_Int32 nCount = rContinuations.getLength(); - for( sal_Int32 nStep=0; nStep( - rContinuations[nStep], star::uno::UNO_QUERY ); + uno::Reference< task::XInteractionAbort > xAbort; + uno::Reference< task::XInteractionApprove > xApprove; + getContinuations(rContinuations, &xApprove, &xAbort); - if( ! xApprove.is() ) - xApprove - = star::uno::Reference< star::task::XInteractionApprove >( - rContinuations[nStep], star::uno::UNO_QUERY ); - } - - // Note: It's important to convert the transported long to the - // required unsigned long value. Otherwhise using as flag field - // can fail ... - ErrCode nError = (ErrCode)nErrorCode; - sal_Bool bWarning = !ERRCODE_TOERROR(nError); - - if ( nError == ERRCODE_SFX_BROKENSIGNATURE - || nError == ERRCODE_SFX_INCOMPLETE_ENCRYPTION ) - { - // the security warning need a special title - String aErrorString; - ErrorHandler::GetErrorString( nErrorCode, aErrorString ); + // Note: It's important to convert the transported long to the + // required unsigned long value. Otherwhise using as flag field + // can fail ... + ErrCode nError = (ErrCode)nErrorCode; + sal_Bool bWarning = !ERRCODE_TOERROR(nError); - std::auto_ptr< ResMgr > - xManager( ResMgr::CreateResMgr( CREATEVERSIONRESMGR_NAME( uui ) ) ); - ::rtl::OUString aTitle; - - try + if ( nError == ERRCODE_SFX_BROKENSIGNATURE + || nError == ERRCODE_SFX_INCOMPLETE_ENCRYPTION ) { - star::uno::Any aProductNameAny = - ::utl::ConfigManager::GetConfigManager()->GetDirectConfigProperty( - ::utl::ConfigManager::PRODUCTNAME ); - aProductNameAny >>= aTitle; - } catch( star::uno::Exception& ) - {} + // the security warning box needs a special title + String aErrorString; + ErrorHandler::GetErrorString( nErrorCode, aErrorString ); - ::rtl::OUString aErrTitle = String( ResId( nError == ERRCODE_SFX_BROKENSIGNATURE ? STR_WARNING_BROKENSIGNATURE_TITLE : STR_WARNING_INCOMPLETE_ENCRYPTION_TITLE, *xManager.get() ) ); + std::auto_ptr< ResMgr > xManager( + ResMgr::CreateResMgr( CREATEVERSIONRESMGR_NAME( uui ) ) ); + ::rtl::OUString aTitle; - if ( aTitle.getLength() && aErrTitle.getLength() ) - aTitle += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " - " ) ); - aTitle += aErrTitle; + try + { + uno::Any aProductNameAny = + ::utl::ConfigManager::GetConfigManager() + ->GetDirectConfigProperty( + ::utl::ConfigManager::PRODUCTNAME ); + aProductNameAny >>= aTitle; + } + catch( uno::Exception& ) + { + } - executeMessageBox( aTitle, aErrorString, WB_OK ); - } - else - ErrorHandler::HandleError(nErrorCode); + ::rtl::OUString aErrTitle + = String( ResId( nError == ERRCODE_SFX_BROKENSIGNATURE + ? STR_WARNING_BROKENSIGNATURE_TITLE + : STR_WARNING_INCOMPLETE_ENCRYPTION_TITLE, + *xManager.get() ) ); - if (xApprove.is() && bWarning) - xApprove->select(); - else if (xAbort.is()) - xAbort->select(); - } -} + if ( aTitle.getLength() && aErrTitle.getLength() ) + aTitle += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " - " ) ); + aTitle += aErrTitle; -namespace -{ - template< class INTERACTION_TYPE > - bool lcl_findContinuation( const Sequence< Reference< XInteractionContinuation > >& _rContinuations, - Reference< INTERACTION_TYPE >& _rContinuation ) - { - const Reference< XInteractionContinuation >* pContinuation = _rContinuations.getConstArray(); - const Reference< XInteractionContinuation >* pContinuationEnd = _rContinuations.getConstArray() + _rContinuations.getLength(); - while ( pContinuation != pContinuationEnd ) - { - if ( _rContinuation.set( *pContinuation++, UNO_QUERY ) ) - return true; + executeMessageBox( aTitle, aErrorString, WB_OK ); } - return false; + else + ErrorHandler::HandleError(nErrorCode); + + if (xApprove.is() && bWarning) + xApprove->select(); + else if (xAbort.is()) + xAbort->select(); } } void UUIInteractionHelper::handleMacroConfirmRequest( const ::rtl::OUString& aDocumentURL, - const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xZipStorage, + const uno::Reference< embed::XStorage >& xZipStorage, const ::rtl::OUString& aDocumentVersion, - const ::com::sun::star::uno::Sequence< ::com::sun::star::security::DocumentSignatureInformation > aSignInfo, - star::uno::Sequence< star::uno::Reference< - star::task::XInteractionContinuation > > const & rContinuations -) - SAL_THROW((star::uno::RuntimeException)) + const uno::Sequence< security::DocumentSignatureInformation > aSignInfo, + uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & + rContinuations ) + SAL_THROW((uno::RuntimeException)) { - Reference< XInteractionAbort > xAbort; lcl_findContinuation( rContinuations, xAbort ); - Reference< XInteractionApprove > xApprove; lcl_findContinuation( rContinuations, xApprove ); + uno::Reference< task::XInteractionAbort > xAbort; + uno::Reference< task::XInteractionApprove > xApprove; + getContinuations( rContinuations, &xApprove, &xAbort ); bool bApprove = false; - std::auto_ptr< ResMgr > pResMgr( ResMgr::CreateResMgr( CREATEVERSIONRESMGR_NAME( uui ) ) ); + std::auto_ptr< ResMgr > pResMgr( + ResMgr::CreateResMgr( CREATEVERSIONRESMGR_NAME( uui ) ) ); if ( pResMgr.get() ) { bool bShowSignatures = aSignInfo.getLength() > 0; - MacroWarning aWarning( getParentProperty(), bShowSignatures, *pResMgr.get() ); + MacroWarning aWarning( + getParentProperty(), bShowSignatures, *pResMgr.get() ); aWarning.SetDocumentURL( aDocumentURL ); if ( aSignInfo.getLength() > 1 ) @@ -3207,176 +3130,175 @@ UUIInteractionHelper::handleMacroConfirmRequest( void UUIInteractionHelper::handleFutureDocumentVersionUpdateRequest( - const FutureDocumentVersionProductUpdateRequest& _rRequest, - Sequence< Reference< XInteractionContinuation > > const & rContinuations -) - SAL_THROW((star::uno::RuntimeException)) + const task::FutureDocumentVersionProductUpdateRequest& _rRequest, + uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & + rContinuations ) + SAL_THROW((uno::RuntimeException)) { - Reference< XInteractionAbort > xAbort; lcl_findContinuation( rContinuations, xAbort ); - Reference< XInteractionApprove > xApprove; lcl_findContinuation( rContinuations, xApprove ); - Reference< XInteractionApprove > xAskLater; lcl_findContinuation( rContinuations, xAskLater ); + uno::Reference< task::XInteractionAbort > xAbort; + uno::Reference< task::XInteractionApprove > xApprove; + uno::Reference< task::XInteractionAskLater > xAskLater; + getContinuations( rContinuations, &xApprove, &xAbort, &xAskLater ); short nResult = RET_CANCEL; static bool s_bDeferredToNextSession = false; - // TODO: this static variable is somewhat hacky. Formerly (before the dialog was moved from SFX2 to the - // interaction handler implementation), this was stored in SFX_APP()'s impl structure, in member - // bODFVersionWarningLater. Of course, we do not have access to it here. - // - // A proper solution which I would envision would be: - // - There's a central implementation (this one here) of css.task.InteractionHandler - // - There's a configuration which maps UNO names to service names - // - If the handler is confronted with a request, it tries to find the name of the UNO structure describing - // the request in the said configuration. - // - If an entry is found, then - // - the respective service is instantiated - // - the component is queried for css.task.XInteractionHandler, and the request is delegated - // - if no entry is found, then the request is silenced (with calling the AbortContinuation, if possible) - // This way, the FutureDocumentVersionProductUpdateRequest could be handled in SFX (or any other - // suitable place), again, and we would only have one place where we remember the s_bDeferredToNextSession - // flag. - // - // The side effect (well, actually the more important effect) would be that we do not need to burden - // this central implementation with all interactions which are possible. Instead, separate parts of OOo - // can define/implement different requests. (for instance, everything which today is done in the - // css.sdb.InteractionHandler can then be routed through a "normal" interaction handler, where today we - // always need to tell people to instantiate the SDB-version of the handler, not the normal one.) + // TODO: this static variable is somewhat hacky. Formerly (before the dialog was moved from SFX2 to the + // interaction handler implementation), this was stored in SFX_APP()'s impl structure, in member + // bODFVersionWarningLater. Of course, we do not have access to it here. + // + // A proper solution which I would envision would be: + // - There's a central implementation (this one here) of css.task.InteractionHandler + // - There's a configuration which maps UNO names to service names + // - If the handler is confronted with a request, it tries to find the name of the UNO structure describing + // the request in the said configuration. + // - If an entry is found, then + // - the respective service is instantiated + // - the component is queried for css.task.XInteractionHandler, and the request is delegated + // - if no entry is found, then the request is silenced (with calling the AbortContinuation, if possible) + // This way, the FutureDocumentVersionProductUpdateRequest could be handled in SFX (or any other + // suitable place), again, and we would only have one place where we remember the s_bDeferredToNextSession + // flag. + // + // The side effect (well, actually the more important effect) would be that we do not need to burden + // this central implementation with all interactions which are possible. Instead, separate parts of OOo + // can define/implement different requests. (for instance, everything which today is done in the + // css.sdb.InteractionHandler can then be routed through a "normal" interaction handler, where today we + // always need to tell people to instantiate the SDB-version of the handler, not the normal one.) if ( !s_bDeferredToNextSession ) { - std::auto_ptr< ResMgr > pResMgr( ResMgr::CreateResMgr( CREATEVERSIONRESMGR_NAME( uui ) ) ); + std::auto_ptr< ResMgr > pResMgr( + ResMgr::CreateResMgr( CREATEVERSIONRESMGR_NAME( uui ) ) ); if ( pResMgr.get() ) { - ::uui::NewerVersionWarningDialog aDialog( getParentProperty(), _rRequest.DocumentODFVersion, *pResMgr.get() ); + ::uui::NewerVersionWarningDialog aDialog( + getParentProperty(), + _rRequest.DocumentODFVersion, + *pResMgr.get() ); nResult = aDialog.Execute(); } } switch ( nResult ) { - case RET_OK: if ( xApprove.is() ) xApprove->select(); break; - case RET_CANCEL: if ( xAbort.is() ) xAbort->select(); break; - case RET_ASK_LATER: if ( xAskLater.is() ) xAskLater->select(); s_bDeferredToNextSession = true; break; + case RET_OK: + if ( xApprove.is() ) + xApprove->select(); + break; + case RET_CANCEL: + if ( xAbort.is() ) + xAbort->select(); + break; + case RET_ASK_LATER: + if ( xAskLater.is() ) + xAskLater->select(); + s_bDeferredToNextSession = true; + break; default: - OSL_ENSURE( false, "UUIInteractionHelper::handleFutureDocumentVersionUpdateRequest: unexpected dialog return value!" ); + OSL_ENSURE( false, + "UUIInteractionHelper::handleFutureDocumentVersionUpdateRequest: " + "unexpected dialog return value!" ); break; } } void UUIInteractionHelper::handleFilterOptionsRequest( - star::document::FilterOptionsRequest const & rRequest, - star::uno::Sequence< star::uno::Reference< - star::task::XInteractionContinuation > > const & rContinuations) - SAL_THROW((com::sun::star::uno::RuntimeException)) + document::FilterOptionsRequest const & rRequest, + uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & + rContinuations) + SAL_THROW((uno::RuntimeException)) { - star::uno::Reference< star::task::XInteractionAbort > xAbort; - star::uno::Reference< - star::document::XInteractionFilterOptions > xFilterOptions; + uno::Reference< task::XInteractionAbort > xAbort; + uno::Reference< document::XInteractionFilterOptions > xFilterOptions; + getContinuations(rContinuations, &xAbort, &xFilterOptions); - sal_Int32 nCount = rContinuations.getLength(); - for( sal_Int32 nStep=0; nStep xFilterCFG; + try { - if( ! xAbort.is() ) - xAbort = star::uno::Reference< star::task::XInteractionAbort >( - rContinuations[nStep], star::uno::UNO_QUERY ); - - if( ! xFilterOptions.is() ) - xFilterOptions = star::uno::Reference< - star::document::XInteractionFilterOptions >( - rContinuations[nStep], star::uno::UNO_QUERY ); + xFilterCFG.set( m_xServiceFactory->createInstance( + ::rtl::OUString::createFromAscii( + "com.sun.star.document.FilterFactory" ) ), + uno::UNO_QUERY ); } - - star::uno::Reference< star::container::XNameAccess > xFilterCFG; - if( m_xServiceFactory.is() ) + catch ( uno::Exception const & ) { - xFilterCFG = star::uno::Reference< star::container::XNameAccess >( - m_xServiceFactory->createInstance( - ::rtl::OUString::createFromAscii( - "com.sun.star.document.FilterFactory" ) ), - star::uno::UNO_QUERY ); } if( xFilterCFG.is() && rRequest.rProperties.getLength() ) { - try { - ::rtl::OUString aFilterName; - sal_Int32 nPropCount = rRequest.rProperties.getLength(); - for( sal_Int32 ind = 0; ind < nPropCount; ++ind ) - { - rtl::OUString tmp = rRequest.rProperties[ind].Name; - if( rRequest.rProperties[ind].Name.equals( - ::rtl::OUString::createFromAscii("FilterName")) ) - { - rRequest.rProperties[ind].Value >>= aFilterName; - break; - } - } - - star::uno::Sequence < star::beans::PropertyValue > aProps; - if ( xFilterCFG->getByName( aFilterName ) >>= aProps ) + try { - sal_Int32 nPropertyCount = aProps.getLength(); - for( sal_Int32 nProperty=0; - nProperty < nPropertyCount; - ++nProperty ) - if( aProps[nProperty].Name.equals( - ::rtl::OUString::createFromAscii("UIComponent")) ) - { - ::rtl::OUString aServiceName; - aProps[nProperty].Value >>= aServiceName; - if( aServiceName.getLength() ) + ::rtl::OUString aFilterName; + sal_Int32 nPropCount = rRequest.rProperties.getLength(); + for( sal_Int32 ind = 0; ind < nPropCount; ++ind ) { - star::uno::Reference< - star::ui::dialogs::XExecutableDialog > - xFilterDialog( - m_xServiceFactory->createInstance( - aServiceName ), - star::uno::UNO_QUERY ); - star::uno::Reference< - star::beans::XPropertyAccess > - xFilterProperties( - xFilterDialog, - star::uno::UNO_QUERY ); - - if( xFilterDialog.is() && xFilterProperties.is() ) - { - star::uno::Reference< - star::document::XImporter > xImporter( - xFilterDialog, - star::uno::UNO_QUERY ); - if( xImporter.is() ) - xImporter->setTargetDocument( - star::uno::Reference< - star::lang::XComponent >( - rRequest.rModel, - star::uno::UNO_QUERY ) ); - - xFilterProperties->setPropertyValues( - rRequest.rProperties ); - - if( xFilterDialog->execute() ) + rtl::OUString tmp = rRequest.rProperties[ind].Name; + if( rRequest.rProperties[ind].Name.equals( + ::rtl::OUString::createFromAscii("FilterName")) ) { - xFilterOptions->setFilterOptions( - xFilterProperties - ->getPropertyValues() ); - xFilterOptions->select(); - return; - - } + rRequest.rProperties[ind].Value >>= aFilterName; + break; } } - break; + + uno::Sequence < beans::PropertyValue > aProps; + if ( xFilterCFG->getByName( aFilterName ) >>= aProps ) + { + sal_Int32 nPropertyCount = aProps.getLength(); + for( sal_Int32 nProperty=0; + nProperty < nPropertyCount; + ++nProperty ) + if( aProps[nProperty].Name.equals( + ::rtl::OUString::createFromAscii("UIComponent")) ) + { + ::rtl::OUString aServiceName; + aProps[nProperty].Value >>= aServiceName; + if( aServiceName.getLength() ) + { + uno::Reference< + ui::dialogs::XExecutableDialog > xFilterDialog( + m_xServiceFactory->createInstance( + aServiceName ), + uno::UNO_QUERY ); + uno::Reference< beans::XPropertyAccess > + xFilterProperties( xFilterDialog, + uno::UNO_QUERY ); + + if( xFilterDialog.is() && xFilterProperties.is() ) + { + uno::Reference< + document::XImporter > xImporter( + xFilterDialog, uno::UNO_QUERY ); + if( xImporter.is() ) + xImporter->setTargetDocument( + uno::Reference< lang::XComponent >( + rRequest.rModel, uno::UNO_QUERY ) ); + + xFilterProperties->setPropertyValues( + rRequest.rProperties ); + + if( xFilterDialog->execute() ) + { + xFilterOptions->setFilterOptions( + xFilterProperties->getPropertyValues() ); + xFilterOptions->select(); + return; + } + } + } + break; + } } } - } - catch( star::container::NoSuchElementException& ) - { - // the filter name is unknown - } - catch( star::uno::Exception& ) - { - } + catch( container::NoSuchElementException& ) + { + // the filter name is unknown + } + catch( uno::Exception& ) + { + } } xAbort->select(); @@ -3384,15 +3306,15 @@ UUIInteractionHelper::handleFilterOptionsRequest( void UUIInteractionHelper::handleErrorRequest( - star::task::InteractionClassification eClassification, + task::InteractionClassification eClassification, ErrCode nErrorCode, std::vector< rtl::OUString > const & rArguments, - star::uno::Sequence< star::uno::Reference< - star::task::XInteractionContinuation > > const & rContinuations, + uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & + rContinuations, bool bObtainErrorStringOnly, bool & bHasErrorString, rtl::OUString & rErrorString) - SAL_THROW((star::uno::RuntimeException)) + SAL_THROW((uno::RuntimeException)) { rtl::OUString aMessage; { @@ -3448,13 +3370,12 @@ UUIInteractionHelper::handleErrorRequest( // really useful, because a single error text may well make sense // both with only an OK button and with RETRY and CANCEL buttons. - star::uno::Reference< star::task::XInteractionApprove > xApprove; - star::uno::Reference< star::task::XInteractionDisapprove > xDisapprove; - star::uno::Reference< star::task::XInteractionRetry > xRetry; - star::uno::Reference< star::task::XInteractionAbort > xAbort; + uno::Reference< task::XInteractionApprove > xApprove; + uno::Reference< task::XInteractionDisapprove > xDisapprove; + uno::Reference< task::XInteractionRetry > xRetry; + uno::Reference< task::XInteractionAbort > xAbort; getContinuations( - rContinuations, - &xApprove, &xDisapprove, &xRetry, &xAbort, 0, 0, 0, 0, 0); + rContinuations, &xApprove, &xDisapprove, &xRetry, &xAbort); // The following mapping uses the bit mask // Approve = 8, @@ -3560,19 +3481,17 @@ UUIInteractionHelper::handleErrorRequest( void UUIInteractionHelper::handleBrokenPackageRequest( std::vector< rtl::OUString > const & rArguments, - star::uno::Sequence< star::uno::Reference< - star::task::XInteractionContinuation > > const & - rContinuations, + uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & + rContinuations, bool bObtainErrorStringOnly, bool & bHasErrorString, rtl::OUString & rErrorString) - SAL_THROW((star::uno::RuntimeException)) + SAL_THROW((uno::RuntimeException)) { - star::uno::Reference< star::task::XInteractionApprove > xApprove; - star::uno::Reference< star::task::XInteractionDisapprove > xDisapprove; - star::uno::Reference< star::task::XInteractionAbort > xAbort; - getContinuations( - rContinuations, &xApprove, &xDisapprove, 0, &xAbort, 0, 0, 0, 0, 0); + uno::Reference< task::XInteractionApprove > xApprove; + uno::Reference< task::XInteractionDisapprove > xDisapprove; + uno::Reference< task::XInteractionAbort > xAbort; + getContinuations(rContinuations, &xApprove, &xDisapprove, &xAbort); ErrCode nErrorCode; if( xApprove.is() && xDisapprove.is() ) @@ -3590,7 +3509,7 @@ UUIInteractionHelper::handleBrokenPackageRequest( { vos::OGuard aGuard(Application::GetSolarMutex()); std::auto_ptr< ResMgr > xManager( - ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); + ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); if (!xManager.get()) return; @@ -3622,10 +3541,10 @@ UUIInteractionHelper::handleBrokenPackageRequest( else return; - star::uno::Any aProductNameAny = + uno::Any aProductNameAny = ::utl::ConfigManager::GetConfigManager()->GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME ); - star::uno::Any aProductVersionAny = + uno::Any aProductVersionAny = ::utl::ConfigManager::GetConfigManager()->GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTVERSION ); ::rtl::OUString aProductName, aProductVersion; @@ -3667,17 +3586,15 @@ void UUIInteractionHelper::handleLockedDocumentRequest( const ::rtl::OUString& aDocumentURL, const ::rtl::OUString& aInfo, - star::uno::Sequence< star::uno::Reference< - star::task::XInteractionContinuation > > const & - rContinuations, + uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & + rContinuations, sal_uInt16 nMode ) - SAL_THROW((star::uno::RuntimeException)) + SAL_THROW((uno::RuntimeException)) { - star::uno::Reference< star::task::XInteractionApprove > xApprove; - star::uno::Reference< star::task::XInteractionDisapprove > xDisapprove; - star::uno::Reference< star::task::XInteractionAbort > xAbort; - getContinuations( - rContinuations, &xApprove, &xDisapprove, 0, &xAbort, 0, 0, 0, 0, 0); + uno::Reference< task::XInteractionApprove > xApprove; + uno::Reference< task::XInteractionDisapprove > xDisapprove; + uno::Reference< task::XInteractionAbort > xAbort; + getContinuations(rContinuations, &xApprove, &xDisapprove, &xAbort); if ( !xApprove.is() || !xDisapprove.is() || !xAbort.is() ) return; @@ -3686,7 +3603,7 @@ UUIInteractionHelper::handleLockedDocumentRequest( { vos::OGuard aGuard(Application::GetSolarMutex()); std::auto_ptr< ResMgr > xManager( - ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); + ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); if (!xManager.get()) return; @@ -3698,8 +3615,10 @@ UUIInteractionHelper::handleLockedDocumentRequest( if ( nMode == UUI_DOC_LOAD_LOCK ) { aArguments.push_back( aInfo.getLength() - ? aInfo - : ::rtl::OUString( String( ResId( STR_UNKNOWNUSER, *xManager.get() ) ) ) ); + ? aInfo + : ::rtl::OUString( String( + ResId( STR_UNKNOWNUSER, + *xManager.get() ) ) ) ); aMessage = String( ResId( STR_OPENLOCKED_MSG, *xManager.get() ) ); aMessage = replaceMessageWithArguments( aMessage, aArguments ); @@ -3710,23 +3629,33 @@ UUIInteractionHelper::handleLockedDocumentRequest( else if ( nMode == UUI_DOC_SAVE_LOCK ) { aArguments.push_back( aInfo.getLength() - ? aInfo - : ::rtl::OUString( String( ResId( STR_UNKNOWNUSER, *xManager.get() ) ) ) ); + ? aInfo + : ::rtl::OUString( String( + ResId( STR_UNKNOWNUSER, + *xManager.get() ) ) ) ); aMessage = String( ResId( STR_TRYLATER_MSG, *xManager.get() ) ); aMessage = replaceMessageWithArguments( aMessage, aArguments ); - std::auto_ptr< TryLaterQueryBox > xDialog(new TryLaterQueryBox( - getParentProperty(), xManager.get(), aMessage ) ); + std::auto_ptr< TryLaterQueryBox > xDialog( + new TryLaterQueryBox( + getParentProperty(), xManager.get(), aMessage ) ); nResult = xDialog->Execute(); } - else if ( nMode == UUI_DOC_OWN_LOAD_LOCK || nMode == UUI_DOC_OWN_SAVE_LOCK ) + else if ( nMode == UUI_DOC_OWN_LOAD_LOCK || + nMode == UUI_DOC_OWN_SAVE_LOCK ) { aArguments.push_back( aInfo ); - aMessage = String( ResId( nMode == UUI_DOC_OWN_SAVE_LOCK ? STR_ALREADYOPEN_SAVE_MSG : STR_ALREADYOPEN_MSG, *xManager.get() ) ); + aMessage = String( ResId( nMode == UUI_DOC_OWN_SAVE_LOCK + ? STR_ALREADYOPEN_SAVE_MSG + : STR_ALREADYOPEN_MSG, + *xManager.get() ) ); aMessage = replaceMessageWithArguments( aMessage, aArguments ); - std::auto_ptr< AlreadyOpenQueryBox > xDialog(new AlreadyOpenQueryBox( - getParentProperty(), xManager.get(), aMessage, nMode == UUI_DOC_OWN_SAVE_LOCK ) ); + std::auto_ptr< AlreadyOpenQueryBox > xDialog( + new AlreadyOpenQueryBox( getParentProperty(), + xManager.get(), + aMessage, + nMode == UUI_DOC_OWN_SAVE_LOCK ) ); nResult = xDialog->Execute(); } @@ -3739,23 +3668,21 @@ UUIInteractionHelper::handleLockedDocumentRequest( } catch (std::bad_alloc const &) { - throw star::uno::RuntimeException( + throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")), - star::uno::Reference< star::uno::XInterface >()); + uno::Reference< uno::XInterface >()); } } void UUIInteractionHelper::handleChangedByOthersRequest( - star::uno::Sequence< star::uno::Reference< - star::task::XInteractionContinuation > > const & - rContinuations ) - SAL_THROW((star::uno::RuntimeException)) + uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & + rContinuations ) + SAL_THROW((uno::RuntimeException)) { - star::uno::Reference< star::task::XInteractionApprove > xApprove; - star::uno::Reference< star::task::XInteractionAbort > xAbort; - getContinuations( - rContinuations, &xApprove, 0, 0, &xAbort, 0, 0, 0, 0, 0); + uno::Reference< task::XInteractionApprove > xApprove; + uno::Reference< task::XInteractionAbort > xAbort; + getContinuations(rContinuations, &xApprove, &xAbort); if ( !xApprove.is() || !xAbort.is() ) return; @@ -3764,12 +3691,12 @@ UUIInteractionHelper::handleChangedByOthersRequest( { vos::OGuard aGuard(Application::GetSolarMutex()); std::auto_ptr< ResMgr > xManager( - ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); + ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); if (!xManager.get()) return; - std::auto_ptr< FileChangedQueryBox > xDialog(new FileChangedQueryBox( - getParentProperty(), xManager.get() ) ); + std::auto_ptr< FileChangedQueryBox > xDialog( + new FileChangedQueryBox( getParentProperty(), xManager.get() ) ); sal_Int32 nResult = xDialog->Execute(); if ( nResult == RET_YES ) @@ -3779,23 +3706,21 @@ UUIInteractionHelper::handleChangedByOthersRequest( } catch (std::bad_alloc const &) { - throw star::uno::RuntimeException( + throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")), - star::uno::Reference< star::uno::XInterface >()); + uno::Reference< uno::XInterface >()); } } void UUIInteractionHelper::handleLockFileIgnoreRequest( - star::uno::Sequence< star::uno::Reference< - star::task::XInteractionContinuation > > const & - rContinuations ) - SAL_THROW((star::uno::RuntimeException)) + uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & + rContinuations ) + SAL_THROW((uno::RuntimeException)) { - star::uno::Reference< star::task::XInteractionApprove > xApprove; - star::uno::Reference< star::task::XInteractionAbort > xAbort; - getContinuations( - rContinuations, &xApprove, 0, 0, &xAbort, 0, 0, 0, 0, 0); + uno::Reference< task::XInteractionApprove > xApprove; + uno::Reference< task::XInteractionAbort > xAbort; + getContinuations(rContinuations, &xApprove, &xAbort); if ( !xApprove.is() || !xAbort.is() ) return; @@ -3804,12 +3729,12 @@ UUIInteractionHelper::handleLockFileIgnoreRequest( { vos::OGuard aGuard(Application::GetSolarMutex()); std::auto_ptr< ResMgr > xManager( - ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); + ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); if (!xManager.get()) return; - std::auto_ptr< LockFailedQueryBox > xDialog(new LockFailedQueryBox( - getParentProperty(), xManager.get() ) ); + std::auto_ptr< LockFailedQueryBox > xDialog( + new LockFailedQueryBox( getParentProperty(), xManager.get() ) ); sal_Int32 nResult = xDialog->Execute(); if ( nResult == RET_OK ) @@ -3819,10 +3744,8 @@ UUIInteractionHelper::handleLockFileIgnoreRequest( } catch (std::bad_alloc const &) { - throw star::uno::RuntimeException( + throw uno::RuntimeException( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")), - star::uno::Reference< star::uno::XInterface >()); + uno::Reference< uno::XInterface >()); } } - - diff --git a/uui/source/iahndl.hxx b/uui/source/iahndl.hxx index 5693a5cf149b..aba8a1fd45ad 100644 --- a/uui/source/iahndl.hxx +++ b/uui/source/iahndl.hxx @@ -31,10 +31,7 @@ #ifndef UUI_IAHNDL_HXX #define UUI_IAHNDL_HXX -#ifndef INCLUDED_VECTOR #include -#define INCLUDED_VECTOR -#endif #include "osl/mutex.hxx" #include "com/sun/star/uno/Reference.hxx" #include "com/sun/star/uno/Sequence.hxx" @@ -65,25 +62,6 @@ struct CntHTTPCookieRequest; #define UUI_DOC_SAVE_LOCK 2 #define UUI_DOC_OWN_SAVE_LOCK 3 -//============================================================================ -/** Information about a InteractionHandler - */ -struct InteractionHandlerData -{ - /** The UNO service name to use to instanciate the content provider. - */ - rtl::OUString ServiceName; - - InteractionHandlerData() {}; - InteractionHandlerData( const rtl::OUString & rService) - : ServiceName( rService ){} -}; - -typedef std::vector< InteractionHandlerData > InteractionHandlerDataList; - -namespace cssu = com::sun::star::uno; -namespace dcss = ::com::sun::star; - namespace com { namespace sun { namespace star { namespace document { class AmbigousFilterRequest; @@ -109,80 +87,102 @@ namespace com { namespace sun { namespace star { } } } } +//============================================================================ +struct InteractionHandlerData +{ + /** The UNO service name to use to instanciate the content provider. + */ + rtl::OUString ServiceName; + + InteractionHandlerData() {}; + InteractionHandlerData(const rtl::OUString & rService) + : ServiceName( rService ){} +}; + +typedef std::vector< InteractionHandlerData > InteractionHandlerDataList; + +//============================================================================ class UUIInteractionHelper { private: osl::Mutex m_aPropertyMutex; com::sun::star::uno::Reference< - com::sun::star::lang::XMultiServiceFactory > - m_xServiceFactory; + com::sun::star::lang::XMultiServiceFactory > m_xServiceFactory; com::sun::star::uno::Sequence< com::sun::star::uno::Any > m_aProperties; UUIInteractionHelper(UUIInteractionHelper &); // not implemented void operator =(UUIInteractionHelper); // not implemented public: - UUIInteractionHelper(com::sun::star::uno::Reference< - com::sun::star::lang::XMultiServiceFactory > - const & rServiceFactory, - com::sun::star::uno::Sequence< - com::sun::star::uno::Any > const & rArguments) + UUIInteractionHelper( + com::sun::star::uno::Reference< + com::sun::star::lang::XMultiServiceFactory > const & rServiceFactory, + com::sun::star::uno::Sequence< + com::sun::star::uno::Any > const & rArguments) SAL_THROW(()); - UUIInteractionHelper(com::sun::star::uno::Reference< - com::sun::star::lang::XMultiServiceFactory > - const & rServiceFactory) + UUIInteractionHelper( + com::sun::star::uno::Reference< + com::sun::star::lang::XMultiServiceFactory > const & rServiceFactory) SAL_THROW(()); ~UUIInteractionHelper() SAL_THROW(()); bool - handleRequest(com::sun::star::uno::Reference< - com::sun::star::task::XInteractionRequest > const & - rRequest) - throw (com::sun::star::uno::RuntimeException); + handleRequest( + com::sun::star::uno::Reference< + com::sun::star::task::XInteractionRequest > const & rRequest) + SAL_THROW((com::sun::star::uno::RuntimeException)); com::sun::star::beans::Optional< rtl::OUString > - getStringFromRequest(com::sun::star::uno::Reference< - com::sun::star::task::XInteractionRequest > const & - rRequest) - throw (com::sun::star::uno::RuntimeException); + getStringFromRequest( + com::sun::star::uno::Reference< + com::sun::star::task::XInteractionRequest > const & rRequest) + SAL_THROW((com::sun::star::uno::RuntimeException)); private: bool - handle_impl(com::sun::star::uno::Reference< - com::sun::star::task::XInteractionRequest > const & - rRequest) - throw (com::sun::star::uno::RuntimeException); + handle_impl( + com::sun::star::uno::Reference< + com::sun::star::task::XInteractionRequest > const & rRequest) + SAL_THROW((com::sun::star::uno::RuntimeException)); void - GetInteractionHandlerList(InteractionHandlerDataList &rdataList); + getInteractionHandlerList(InteractionHandlerDataList &rdataList); sal_Bool isDomainMatch( rtl::OUString hostName, rtl::OUString certHostName); + static long handlerequest(void* pHandleData, void* pInteractionHandler); com::sun::star::beans::Optional< rtl::OUString > - getStringFromRequest_impl(com::sun::star::uno::Reference< - com::sun::star::task::XInteractionRequest > const & - rRequest) - throw (com::sun::star::uno::RuntimeException); + getStringFromRequest_impl( + com::sun::star::uno::Reference< + com::sun::star::task::XInteractionRequest > const & rRequest) + SAL_THROW((com::sun::star::uno::RuntimeException)); static long getstringfromrequest(void* pHandleData, void* pInteractionHandler); - Window * getParentProperty() SAL_THROW(()); + Window * + getParentProperty() + SAL_THROW(()); - ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow> getParentXWindow() SAL_THROW(()); + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow> + getParentXWindow() + SAL_THROW(()); - rtl::OUString getContextProperty() SAL_THROW(()); + rtl::OUString + getContextProperty() + SAL_THROW(()); com::sun::star::uno::Reference< com::sun::star::task::XInteractionHandler > getInteractionHandler() const SAL_THROW((com::sun::star::uno::RuntimeException)); - void executeLoginDialog(LoginErrorInfo & rInfo, - rtl::OUString const & rRealm) + void + executeLoginDialog(LoginErrorInfo & rInfo, + rtl::OUString const & rRealm) SAL_THROW((com::sun::star::uno::RuntimeException)); void @@ -193,40 +193,48 @@ private: void executePasswordDialog(LoginErrorInfo & rInfo, com::sun::star::task::PasswordRequestMode nMode, - ::rtl::OUString aDocumentName) + ::rtl::OUString aDocumentName) SAL_THROW((com::sun::star::uno::RuntimeException)); void executeMSPasswordDialog(LoginErrorInfo & rInfo, - com::sun::star::task::PasswordRequestMode nMode, - ::rtl::OUString aDocumentName) + com::sun::star::task::PasswordRequestMode nMode, + ::rtl::OUString aDocumentName) SAL_THROW((com::sun::star::uno::RuntimeException)); - void executeCookieDialog(CntHTTPCookieRequest & rRequest) + void + executeCookieDialog(CntHTTPCookieRequest & rRequest) SAL_THROW((com::sun::star::uno::RuntimeException)); - void executeFilterDialog(rtl::OUString const & rURL , - uui::FilterNameList const & rFilters, - rtl::OUString & rFilter ) + void + executeFilterDialog(rtl::OUString const & rURL , + uui::FilterNameList const & rFilters, + rtl::OUString & rFilter ) SAL_THROW((com::sun::star::uno::RuntimeException)); - sal_Bool executeUnknownAuthDialog( const cssu::Reference< dcss::security::XCertificate >& rXCert ) + sal_Bool + executeUnknownAuthDialog( + const com::sun::star::uno::Reference< + com::sun::star::security::XCertificate >& rXCert ) SAL_THROW((com::sun::star::uno::RuntimeException)); - sal_Bool executeSSLWarnDialog( const cssu::Reference< dcss::security::XCertificate >& rXCert, - sal_Int32 const & failures, - const rtl::OUString & hostName) + sal_Bool + executeSSLWarnDialog( + const com::sun::star::uno::Reference< + com::sun::star::security::XCertificate >& rXCert, + sal_Int32 const & failures, + const rtl::OUString & hostName) SAL_THROW((com::sun::star::uno::RuntimeException)); rtl::OUString getLocalizedDatTimeStr( ::com::sun::star::util::DateTime aDateTime ); USHORT - executeErrorDialog(com::sun::star::task::InteractionClassification - eClassification, - rtl::OUString const & rContext, - rtl::OUString const & rMessage, - WinBits nButtonMask ) + executeErrorDialog( + com::sun::star::task::InteractionClassification eClassification, + rtl::OUString const & rContext, + rtl::OUString const & rMessage, + WinBits nButtonMask ) SAL_THROW((com::sun::star::uno::RuntimeException)); USHORT @@ -235,13 +243,33 @@ private: WinBits nButtonMask ) SAL_THROW((com::sun::star::uno::RuntimeException)); + //===================================================================== + bool handleMessageboxRequests( + ::com::sun::star::uno::Reference< + ::com::sun::star::task::XInteractionRequest > const & rRequest, + bool bObtainErrorStringOnly, + bool & bHasErrorString, + rtl::OUString & rErrorString); + + bool handleErrorHandlerRequests( + ::com::sun::star::uno::Reference< + ::com::sun::star::task::XInteractionRequest > const & rRequest, + bool bObtainErrorStringOnly, + bool & bHasErrorString, + rtl::OUString & rErrorString); + + bool handleDialogRequests( + ::com::sun::star::uno::Reference< + ::com::sun::star::task::XInteractionRequest > const & rRequest); + + //===================================================================== void handleAuthenticationRequest( com::sun::star::ucb::AuthenticationRequest const & rRequest, com::sun::star::uno::Sequence< - com::sun::star::uno::Reference< - com::sun::star::task::XInteractionContinuation > > const & - rContinuations, + com::sun::star::uno::Reference< + com::sun::star::task::XInteractionContinuation > > const & + rContinuations, rtl::OUString const & rURL) SAL_THROW((com::sun::star::uno::RuntimeException)); @@ -249,83 +277,83 @@ private: handleCertificateValidationRequest( com::sun::star::ucb::CertificateValidationRequest const & rRequest, com::sun::star::uno::Sequence< - com::sun::star::uno::Reference< - com::sun::star::task::XInteractionContinuation > > const & - rContinuations) + com::sun::star::uno::Reference< + com::sun::star::task::XInteractionContinuation > > const & + rContinuations) SAL_THROW((com::sun::star::uno::RuntimeException)); void handleNameClashResolveRequest( com::sun::star::ucb::NameClashResolveRequest const & rRequest, - com::sun::star::uno::Sequence< com::sun::star::uno::Reference< - com::sun::star::task::XInteractionContinuation > > const & - rContinuations) + com::sun::star::uno::Sequence< + com::sun::star::uno::Reference< + com::sun::star::task::XInteractionContinuation > > const & + rContinuations) SAL_THROW((com::sun::star::uno::RuntimeException)); void handleMasterPasswordRequest( com::sun::star::task::PasswordRequestMode nMode, com::sun::star::uno::Sequence< - com::sun::star::uno::Reference< - com::sun::star::task::XInteractionContinuation > > const & - rContinuations) + com::sun::star::uno::Reference< + com::sun::star::task::XInteractionContinuation > > const & + rContinuations) SAL_THROW((com::sun::star::uno::RuntimeException)); - void handlePasswordRequest( com::sun::star::task::PasswordRequestMode nMode, com::sun::star::uno::Sequence< - com::sun::star::uno::Reference< - com::sun::star::task::XInteractionContinuation > > const & - rContinuations, - ::rtl::OUString aDocumentName = ::rtl::OUString()) + com::sun::star::uno::Reference< + com::sun::star::task::XInteractionContinuation > > const & + rContinuations, + ::rtl::OUString aDocumentName = ::rtl::OUString()) SAL_THROW((com::sun::star::uno::RuntimeException)); void handleMSPasswordRequest( com::sun::star::task::PasswordRequestMode nMode, com::sun::star::uno::Sequence< - com::sun::star::uno::Reference< - com::sun::star::task::XInteractionContinuation > > const & - rContinuations, - ::rtl::OUString aDocumentName = ::rtl::OUString()) + com::sun::star::uno::Reference< + com::sun::star::task::XInteractionContinuation > > const & + rContinuations, + ::rtl::OUString aDocumentName = ::rtl::OUString()) SAL_THROW((com::sun::star::uno::RuntimeException)); void handleCookiesRequest( com::sun::star::ucb::HandleCookiesRequest const & rRequest, com::sun::star::uno::Sequence< - com::sun::star::uno::Reference< - com::sun::star::task::XInteractionContinuation > > const & - rContinuations) + com::sun::star::uno::Reference< + com::sun::star::task::XInteractionContinuation > > const & + rContinuations) SAL_THROW((com::sun::star::uno::RuntimeException)); void handleNoSuchFilterRequest( com::sun::star::document::NoSuchFilterRequest const & rRequest, com::sun::star::uno::Sequence< - com::sun::star::uno::Reference< - com::sun::star::task::XInteractionContinuation > > const & - rContinuations) + com::sun::star::uno::Reference< + com::sun::star::task::XInteractionContinuation > > const & + rContinuations) SAL_THROW((com::sun::star::uno::RuntimeException)); void handleAmbigousFilterRequest( com::sun::star::document::AmbigousFilterRequest const & rRequest, com::sun::star::uno::Sequence< - com::sun::star::uno::Reference< - com::sun::star::task::XInteractionContinuation > > const & - rContinuations) + com::sun::star::uno::Reference< + com::sun::star::task::XInteractionContinuation > > const & + rContinuations) SAL_THROW((com::sun::star::uno::RuntimeException)); void handleFilterOptionsRequest( com::sun::star::document::FilterOptionsRequest const & rRequest, com::sun::star::uno::Sequence< - com::sun::star::uno::Reference< - com::sun::star::task::XInteractionContinuation > > const & - rContinuations) + com::sun::star::uno::Reference< + com::sun::star::task::XInteractionContinuation > > const & + rContinuations) SAL_THROW((com::sun::star::uno::RuntimeException)); void @@ -334,89 +362,71 @@ private: ErrCode nErrorCode, std::vector< rtl::OUString > const & rArguments, com::sun::star::uno::Sequence< - com::sun::star::uno::Reference< - com::sun::star::task::XInteractionContinuation > > const & - rContinuations, - bool bObtainErrorStringOnly, - bool & bHasErrorString, - rtl::OUString & rErrorString) + com::sun::star::uno::Reference< + com::sun::star::task::XInteractionContinuation > > const & + rContinuations, + bool bObtainErrorStringOnly, + bool & bHasErrorString, + rtl::OUString & rErrorString) SAL_THROW((com::sun::star::uno::RuntimeException)); void handleGenericErrorRequest( - sal_Int32 nErrorCode, + sal_Int32 nErrorCode, com::sun::star::uno::Sequence< - com::sun::star::uno::Reference< - com::sun::star::task::XInteractionContinuation > > const & - rContinuations, - bool bObtainErrorStringOnly, - bool & bHasErrorString, - rtl::OUString & rErrorString) + com::sun::star::uno::Reference< + com::sun::star::task::XInteractionContinuation > > const & + rContinuations, + bool bObtainErrorStringOnly, + bool & bHasErrorString, + rtl::OUString & rErrorString) SAL_THROW((com::sun::star::uno::RuntimeException)); void handleMacroConfirmRequest( const ::rtl::OUString& aDocumentURL, - const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xZipStorage, + const ::com::sun::star::uno::Reference< + ::com::sun::star::embed::XStorage >& xZipStorage, const ::rtl::OUString& aDocumentVersion, - const ::com::sun::star::uno::Sequence< ::com::sun::star::security::DocumentSignatureInformation > aSignInfo, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::security::DocumentSignatureInformation > + aSignInfo, com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::task::XInteractionContinuation > > const & - rContinuations - ) + rContinuations) SAL_THROW((com::sun::star::uno::RuntimeException)); void handleFutureDocumentVersionUpdateRequest( - const ::com::sun::star::task::FutureDocumentVersionProductUpdateRequest& _rRequest, + const ::com::sun::star::task::FutureDocumentVersionProductUpdateRequest& + _rRequest, com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::task::XInteractionContinuation > > const & - rContinuations - ) + rContinuations) SAL_THROW((com::sun::star::uno::RuntimeException)); void handleBrokenPackageRequest( - std::vector< rtl::OUString > const & rArguments, - ::com::sun::star::uno::Sequence< - ::com::sun::star::uno::Reference< - ::com::sun::star::task::XInteractionContinuation > > const & - rContinuations, - bool bObtainErrorStringOnly, - bool & bHasErrorString, - rtl::OUString & rErrorString) + std::vector< rtl::OUString > const & rArguments, + ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Reference< + ::com::sun::star::task::XInteractionContinuation > > const & + rContinuations, + bool bObtainErrorStringOnly, + bool & bHasErrorString, + rtl::OUString & rErrorString) SAL_THROW((::com::sun::star::uno::RuntimeException)); - bool handleMessageboxRequests( - ::com::sun::star::uno::Reference< - ::com::sun::star::task::XInteractionRequest > const & - rRequest, - bool bObtainErrorStringOnly, - bool & bHasErrorString, - rtl::OUString & rErrorString); - - bool handleDialogRequests( - ::com::sun::star::uno::Reference< - ::com::sun::star::task::XInteractionRequest > const & - rRequest); - - bool handleErrorHandlerRequests( - ::com::sun::star::uno::Reference< - ::com::sun::star::task::XInteractionRequest > const & - rRequest, - bool bObtainErrorStringOnly, - bool & bHasErrorString, - rtl::OUString & rErrorString); - void handleLockedDocumentRequest( - const ::rtl::OUString& aDocumentURL, - const ::rtl::OUString& aInfo, - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< - ::com::sun::star::task::XInteractionContinuation > > const & - rContinuations, - sal_uInt16 nMode ) + const ::rtl::OUString& aDocumentURL, + const ::rtl::OUString& aInfo, + ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Reference< + ::com::sun::star::task::XInteractionContinuation > > const & + rContinuations, + sal_uInt16 nMode ) SAL_THROW((::com::sun::star::uno::RuntimeException)); void handleChangedByOthersRequest( @@ -430,7 +440,6 @@ private: ::com::sun::star::task::XInteractionContinuation > > const & rContinuations ) SAL_THROW((::com::sun::star::uno::RuntimeException)); - }; #endif // UUI_IAHNDL_HXX -- cgit v1.2.3 From 4a8daa26e866b3c84585c41b8be010c0a77a30b4 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Mon, 7 Dec 2009 11:57:35 +0100 Subject: #i106830# - Small fixes. --- ucb/source/ucp/webdav/LinkSequence.cxx | 17 ++++++------ ucb/source/ucp/webdav/LockEntrySequence.cxx | 38 +++++++++++++++++++++----- ucb/source/ucp/webdav/LockSequence.cxx | 7 ++--- ucb/source/ucp/webdav/NeonPropFindRequest.cxx | 9 ++---- ucb/source/ucp/webdav/NeonSession.cxx | 31 +++++++++++---------- ucb/source/ucp/webdav/UCBDeadPropertyValue.cxx | 11 ++++---- 6 files changed, 66 insertions(+), 47 deletions(-) diff --git a/ucb/source/ucp/webdav/LinkSequence.cxx b/ucb/source/ucp/webdav/LinkSequence.cxx index c9865cb5b8c2..fad89d375975 100644 --- a/ucb/source/ucp/webdav/LinkSequence.cxx +++ b/ucb/source/ucp/webdav/LinkSequence.cxx @@ -64,12 +64,11 @@ struct LinkSequenceParseContext extern "C" int LinkSequence_startelement_callback( void *, int parent, - const char *nspace, + const char * /*nspace*/, const char *name, const char ** ) { - if ( ( name != 0 ) && - ( ( nspace == 0 ) || ( strcmp( nspace, "" ) == 0 ) ) ) + if ( name != 0 ) { switch ( parent ) { @@ -192,7 +191,7 @@ bool LinkSequence::createFromXML( const rtl::OString & rInData, rOutData[ nCount - 1 ] = *aCtx.pLink; } - nStart = nEnd + TOKEN_LENGTH + 1; + nStart = nEnd + TOKEN_LENGTH; nEnd = rInData.indexOf( "", nStart ); } @@ -215,11 +214,11 @@ bool LinkSequence::toXML( const uno::Sequence< ucb::Link > & rInData, for ( sal_Int32 n = 0; n < nCount; ++n ) { - rOutData += aPre; - rOutData += rInData[ n ].Source; - rOutData += aMid; - rOutData += rInData[ n ].Destination; - rOutData += aEnd; + rOutData += aPre; + rOutData += rInData[ n ].Source; + rOutData += aMid; + rOutData += rInData[ n ].Destination; + rOutData += aEnd; } return true; } diff --git a/ucb/source/ucp/webdav/LockEntrySequence.cxx b/ucb/source/ucp/webdav/LockEntrySequence.cxx index 353ff6f875d7..50600e0ad0a1 100644 --- a/ucb/source/ucp/webdav/LockEntrySequence.cxx +++ b/ucb/source/ucp/webdav/LockEntrySequence.cxx @@ -64,12 +64,11 @@ struct LockEntrySequenceParseContext extern "C" int LockEntrySequence_startelement_callback( void *, int parent, - const char *nspace, + const char * /*nspace*/, const char *name, const char ** ) { - if ( ( name != 0 ) && - ( ( nspace == 0 ) || ( strcmp( nspace, "" ) == 0 ) ) ) + if ( name != 0 ) { switch ( parent ) { @@ -83,6 +82,31 @@ extern "C" int LockEntrySequence_startelement_callback( return STATE_LOCKSCOPE; else if ( strcmp( name, "locktype" ) == 0 ) return STATE_LOCKTYPE; + +#define IIS_BUGS_WORKAROUND + +#ifdef IIS_BUGS_WORKAROUND + /* IIS (6) returns XML violating RFC 4918 + for DAV:supportedlock property value. + + + + + + + + + + + Bother... + */ + else if ( strcmp( name, "exclusive" ) == 0 ) + return STATE_EXCLUSIVE; + else if ( strcmp( name, "shared" ) == 0 ) + return STATE_SHARED; + else if ( strcmp( name, "write" ) == 0 ) + return STATE_WRITE; +#endif break; case STATE_LOCKSCOPE: @@ -165,7 +189,7 @@ extern "C" int LockEntrySequence_endelement_callback( // static bool LockEntrySequence::createFromXML( const rtl::OString & rInData, uno::Sequence< - ucb::LockEntry > & rOutData ) + ucb::LockEntry > & rOutData ) { const sal_Int32 TOKEN_LENGTH = 12; // bool success = true; @@ -191,8 +215,8 @@ bool LockEntrySequence::createFromXML( const rtl::OString & rInData, &aCtx ); ne_xml_parse( parser, - rInData.getStr() + nStart, - nEnd - nStart + TOKEN_LENGTH ); + rInData.getStr() + nStart, + nEnd - nStart + TOKEN_LENGTH ); #if NEON_VERSION >= 0x0250 success = !ne_xml_failed( parser ); @@ -214,7 +238,7 @@ bool LockEntrySequence::createFromXML( const rtl::OString & rInData, rOutData[ nCount - 1 ] = *aCtx.pEntry; } - nStart = nEnd + TOKEN_LENGTH + 1; + nStart = nEnd + TOKEN_LENGTH; nEnd = rInData.indexOf( "", nStart ); } diff --git a/ucb/source/ucp/webdav/LockSequence.cxx b/ucb/source/ucp/webdav/LockSequence.cxx index f34ede38d40e..178d41f9652a 100644 --- a/ucb/source/ucp/webdav/LockSequence.cxx +++ b/ucb/source/ucp/webdav/LockSequence.cxx @@ -74,12 +74,11 @@ struct LockSequenceParseContext extern "C" int LockSequence_startelement_callback( void *, int parent, - const char *nspace, + const char */*nspace*/, const char *name, const char ** ) { - if ( ( name != 0 ) && - ( ( nspace == 0 ) || ( strcmp( nspace, "" ) == 0 ) ) ) + if ( name != 0 ) { switch ( parent ) { @@ -347,7 +346,7 @@ bool LockSequence::createFromXML( const rtl::OString & rInData, rOutData[ nCount - 1 ] = *aCtx.pLock; } - nStart = nEnd + TOKEN_LENGTH + 1; + nStart = nEnd + TOKEN_LENGTH; nEnd = rInData.indexOf( "", nStart ); } diff --git a/ucb/source/ucp/webdav/NeonPropFindRequest.cxx b/ucb/source/ucp/webdav/NeonPropFindRequest.cxx index c69ab1d59a3a..2a1703336bdf 100644 --- a/ucb/source/ucp/webdav/NeonPropFindRequest.cxx +++ b/ucb/source/ucp/webdav/NeonPropFindRequest.cxx @@ -140,12 +140,9 @@ extern "C" int NPFR_propfind_iter( void* userdata, aValue = aValue.trim(); // #107358# remove leading/trailing spaces if ( aValue.getLength() ) { - aValue = aValue.toAsciiLowerCase(); - if ( ( aValue.compareTo( - RTL_CONSTASCII_STRINGPARAM( "token ) ) { // expired! - - OSL_TRACE( "NeonSession::removeExpiredLocktoken: Removing " - " expired lock token for %s. token: %s", - rtl::OUStringToOString( inURL, - RTL_TEXTENCODING_UTF8 ) - .getStr(), - theLock->token ); - - m_aNeonLockStore.removeLock( theLock ); - ne_lock_destroy( theLock ); - return true; + break; } + // still valid. return false; } ++it; } + + // No lockdiscovery prop in propfind result / locktoken not found + // in propfind result -> not locked + OSL_TRACE( "NeonSession::removeExpiredLocktoken: Removing " + " expired lock token for %s. token: %s", + rtl::OUStringToOString( inURL, + RTL_TEXTENCODING_UTF8 ).getStr(), + theLock->token ); + + m_aNeonLockStore.removeLock( theLock ); + ne_lock_destroy( theLock ); + return true; } catch ( DAVException const & ) { @@ -1815,10 +1818,8 @@ void NeonSession::HandleError( int nError, if ( removeExpiredLocktoken( makeAbsoluteURL( inPath ), rEnv ) ) throw DAVException( DAVException::DAV_LOCK_EXPIRED ); } - else - { - throw DAVException( DAVException::DAV_HTTP_ERROR, aText, code ); - } + + throw DAVException( DAVException::DAV_HTTP_ERROR, aText, code ); } case NE_LOOKUP: // Name lookup failed. throw DAVException( DAVException::DAV_HTTP_LOOKUP, diff --git a/ucb/source/ucp/webdav/UCBDeadPropertyValue.cxx b/ucb/source/ucp/webdav/UCBDeadPropertyValue.cxx index cd03d5b76a9d..6cd6795e2ff3 100644 --- a/ucb/source/ucp/webdav/UCBDeadPropertyValue.cxx +++ b/ucb/source/ucp/webdav/UCBDeadPropertyValue.cxx @@ -93,8 +93,7 @@ extern "C" int UCBDeadPropertyValue_startelement_callback( const char *name, const char ** ) { - if ( ( name != 0 ) && - ( ( nspace == 0 ) || ( strcmp( nspace, "" ) == 0 ) ) ) + if ( name != 0 ) { switch ( parent ) { @@ -187,7 +186,7 @@ static rtl::OUString encodeValue( const rtl::OUString & rValue ) // PROPPATCH: // - Encoded property value: x<z // - UCBDeadPropertyValue::toXML result: - // stringx<z + // stringx<z // PROPFIND: // - parser replaces < by > ==> error (not well formed) @@ -361,7 +360,7 @@ bool UCBDeadPropertyValue::supportsType( const uno::Type & rType ) ////////////////////////////////////////////////////////////////////////// // static bool UCBDeadPropertyValue::createFromXML( const rtl::OString & rInData, - uno::Any & rOutData ) + uno::Any & rOutData ) { bool success = false; @@ -450,7 +449,7 @@ bool UCBDeadPropertyValue::createFromXML( const rtl::OString & rInData, ////////////////////////////////////////////////////////////////////////// // static bool UCBDeadPropertyValue::toXML( const uno::Any & rInData, - rtl::OUString & rOutData ) + rtl::OUString & rOutData ) { // the_typethe_value @@ -541,7 +540,7 @@ bool UCBDeadPropertyValue::toXML( const uno::Any & rInData, // Encode value! It must not contain XML reserved chars! aStringValue = encodeValue( aStringValue ); - rOutData = aXMLPre; + rOutData = aXMLPre; rOutData += aStringType; rOutData += aXMLMid; rOutData += aStringValue; -- cgit v1.2.3 From 26e6d1abc8e5c083bfc96d12d7b51a7baee0eabd Mon Sep 17 00:00:00 2001 From: sj Date: Mon, 7 Dec 2009 12:00:14 +0100 Subject: impress181: #i107457#: applied patch (WMF/EMF import, text background is now correctly set) --- svtools/source/filter.vcl/wmf/winmtf.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/svtools/source/filter.vcl/wmf/winmtf.cxx b/svtools/source/filter.vcl/wmf/winmtf.cxx index 3db3e6957e41..58dfdec45ee1 100644 --- a/svtools/source/filter.vcl/wmf/winmtf.cxx +++ b/svtools/source/filter.vcl/wmf/winmtf.cxx @@ -1522,9 +1522,9 @@ void WinMtfOutput::DrawText( Point& rPosition, String& rText, sal_Int32* pDXArry aTmp.SetFillColor( maBkColor ); if( mnBkMode == TRANSPARENT ) - maFont.SetTransparent( sal_True ); + aTmp.SetTransparent( sal_True ); else - maFont.SetTransparent( sal_False ); + aTmp.SetTransparent( sal_False ); if ( ( mnTextAlign & TA_BASELINE) == TA_BASELINE ) aTmp.SetAlign( ALIGN_BASELINE ); -- cgit v1.2.3 From 71c580ffdb030acf0bb40ce61a53e4af560ddf02 Mon Sep 17 00:00:00 2001 From: sj Date: Mon, 7 Dec 2009 13:49:31 +0100 Subject: #impress181: #i107492#: fixed filled background cration --- svx/source/svdraw/svdfmtf.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx index 30c3ff62531a..de08aa4ed055 100644 --- a/svx/source/svdraw/svdfmtf.cxx +++ b/svx/source/svdraw/svdfmtf.cxx @@ -710,8 +710,8 @@ void ImpSdrGDIMetaFileImport::ImportText( const Point& rPos, const XubString& rS if (!aFnt.IsTransparent()) { SfxItemSet aAttr(*pFillAttr->GetPool(),XATTR_FILL_FIRST,XATTR_FILL_LAST); - pFillAttr->Put(XFillStyleItem(XFILL_SOLID)); - pFillAttr->Put(XFillColorItem(String(), aFnt.GetFillColor())); + aAttr.Put(XFillStyleItem(XFILL_SOLID)); + aAttr.Put(XFillColorItem(String(), aFnt.GetFillColor())); pText->SetMergedItemSet(aAttr); } sal_uInt32 nWink = aFnt.GetOrientation(); -- cgit v1.2.3 From 6265bf19dd38b9c3dfd81828dc07ad579d02065d Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Mon, 7 Dec 2009 16:26:07 +0100 Subject: vcl108: #b6906380# fix desktop switch logic --- vcl/source/window/window.cxx | 3 +++ vcl/unx/gtk/window/gtkframe.cxx | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 63bf407ce49f..d2683f918931 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -4755,7 +4755,10 @@ void Window::doLazyDelete() SystemWindow* pSysWin = dynamic_cast(this); DockingWindow* pDockWin = dynamic_cast(this); if( pSysWin || ( pDockWin && pDockWin->IsFloatingMode() ) ) + { + Show( FALSE ); SetParent( ImplGetDefaultWindow() ); + } vcl::LazyDeletor::Delete( this ); } diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx index eff7319d6efc..9d401d84770d 100644 --- a/vcl/unx/gtk/window/gtkframe.cxx +++ b/vcl/unx/gtk/window/gtkframe.cxx @@ -1307,7 +1307,7 @@ void GtkSalFrame::Show( BOOL bVisible, BOOL bNoActivate ) setMinMaxSize(); // #i45160# switch to desktop where a dialog with parent will appear - if( m_pParent && m_pParent->m_nWorkArea != m_nWorkArea ) + if( m_pParent && m_pParent->m_nWorkArea != m_nWorkArea && GTK_WIDGET_MAPPED(m_pParent->m_pWindow) ) getDisplay()->getWMAdaptor()->switchToWorkArea( m_pParent->m_nWorkArea ); if( isFloatGrabWindow() && -- cgit v1.2.3 From 6c1aa68d76169c11c1f56a19ce4f12393e6bca51 Mon Sep 17 00:00:00 2001 From: sj Date: Tue, 8 Dec 2009 18:05:50 +0100 Subject: impress181: #i97966#: fixed resource problem, now the error message is notifying a read error instead of "Move background page assignment" when trying to load an encrypted PPT document --- svtools/source/misc/ehdl.cxx | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/svtools/source/misc/ehdl.cxx b/svtools/source/misc/ehdl.cxx index 6e89193f1b6b..9031c8c7fdd1 100644 --- a/svtools/source/misc/ehdl.cxx +++ b/svtools/source/misc/ehdl.cxx @@ -321,16 +321,21 @@ BOOL SfxErrorHandler::GetClassString(ULONG lClassId, String &rStr) const */ { - - ResId aId(RID_ERRHDL, *pMgr); - ErrorResource_Impl aEr(aId, (USHORT)lClassId); - if(aEr) + BOOL bRet = FALSE; + com::sun::star::lang::Locale aLocale( Application::GetSettings().GetUILocale() ); + ResMgr* pResMgr = ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(ofa), aLocale ); + if( pResMgr ) { - rStr=((ResString)aEr).GetString(); - return TRUE; + ResId aId(RID_ERRHDL, *pResMgr ); + ErrorResource_Impl aEr(aId, (USHORT)lClassId); + if(aEr) + { + rStr=((ResString)aEr).GetString(); + bRet = TRUE; + } } - else - return FALSE; + delete pResMgr; + return bRet; } //------------------------------------------------------------------------- @@ -379,10 +384,10 @@ BOOL SfxErrorHandler::GetErrorString( BOOL bRet = FALSE; rStr=String(SvtResId(RID_ERRHDL_CLASS)); - ResId *pResId = new ResId(nId, *pMgr); + ResId aResId(nId, *pMgr); { - ErrorResource_Impl aEr(*pResId, (USHORT)lErrId); + ErrorResource_Impl aEr(aResId, (USHORT)lErrId); if(aEr) { ResString aErrorString(aEr); @@ -408,7 +413,6 @@ BOOL SfxErrorHandler::GetErrorString( rStr.SearchAndReplace(String::CreateFromAscii( "$(CLASS)" ),aErrStr); } - delete pResId; return bRet; } -- cgit v1.2.3 From ad7022af48b1b91e605c86ebf1eb91ce66635385 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 8 Dec 2009 18:43:39 +0100 Subject: vcl108: #i104264# use caret width setting from system --- vcl/win/source/window/salframe.cxx | 5 +++++ 1 file changed, 5 insertions(+) mode change 100644 => 100755 vcl/win/source/window/salframe.cxx diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx old mode 100644 new mode 100755 index 53f822a1e409..77d9a702d186 --- a/vcl/win/source/window/salframe.cxx +++ b/vcl/win/source/window/salframe.cxx @@ -2977,6 +2977,11 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings ) aStyleSettings.SetCheckedColor( Color( nRed, nGreen, nBlue ) ); } + // caret width + DWORD nCaretWidth = 2; + if( SystemParametersInfo( SPI_GETCARETWIDTH, 0, &nCaretWidth, 0 ) ) + aStyleSettings.SetCursorSize( nCaretWidth ); + // High contrast HIGHCONTRAST hc; hc.cbSize = sizeof( HIGHCONTRAST ); -- cgit v1.2.3 From 0d1debd8e0179006d80f7f9ca443d21730f14dae Mon Sep 17 00:00:00 2001 From: hdu Date: Wed, 9 Dec 2009 13:19:49 +0100 Subject: #i107552# ignore SFNT fonts with broken name table (thanks cmc!) --- vcl/source/fontsubset/sft.cxx | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx index 0accc42af968..964d6a93ac3c 100644 --- a/vcl/source/fontsubset/sft.cxx +++ b/vcl/source/fontsubset/sft.cxx @@ -1094,6 +1094,14 @@ static void GetNames(TrueTypeFont *t) const sal_uInt8* table = getTable( t, O_name ); int nTableSize = getTableSize(t, O_name); + if (nTableSize < 4) + { +#if OSL_DEBUG_LEVEL > 1 + fprintf(stderr, "O_name table too small\n"); +#endif + return; + } + sal_uInt16 n = GetUInt16(table, 2, 1); int i, r; sal_Bool bPSNameOK = sal_True; @@ -1681,7 +1689,6 @@ int OpenTTFontFile( const char* fname, sal_uInt32 facenum, TrueTypeFont** ttf ) goto cleanup; } - if (((*ttf)->ptr = (sal_uInt8 *) mmap(0, (*ttf)->fsize, PROT_READ, MAP_SHARED, fd, 0)) == MAP_FAILED) { ret = SF_MEMORY; goto cleanup; @@ -2702,7 +2709,7 @@ void GetTTGlobalFontInfo(TrueTypeFont *ttf, TTGlobalFontInfo *info) } table = getTable(ttf, O_post); - if (table) { + if (table && getTableSize(ttf, O_post) >= 12+sizeof(sal_uInt32)) { info->pitch = GetUInt32(table, 12, 1); info->italicAngle = GetInt32(table, 4, 1); } @@ -2808,6 +2815,15 @@ int GetTTNameRecords(TrueTypeFont *ttf, NameRecord **nr) { const sal_uInt8* table = getTable(ttf, O_name); int nTableSize = getTableSize(ttf, O_name ); + + if (nTableSize < 6) + { +#if OSL_DEBUG_LEVEL > 1 + fprintf(stderr, "O_name table too small\n"); +#endif + return 0; + } + sal_uInt16 n = GetUInt16(table, 2, 1); int nStrBase = GetUInt16(table, 4, 1); int i; -- cgit v1.2.3 From c7cd1b3ffde4a2ea187d6d962081ff5cf94da688 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Wed, 9 Dec 2009 18:54:57 +0100 Subject: InteractionHandler refactoring, 1st wave. --- uui/source/getcontinuations.hxx | 121 ++ uui/source/iahndl-authentication.cxx | 588 ++++++ uui/source/iahndl-cookies.cxx | 212 ++ uui/source/iahndl-errorhandler.cxx | 321 +++ uui/source/iahndl-filter.cxx | 474 +++++ uui/source/iahndl-ioexceptions.cxx | 346 ++++ uui/source/iahndl-locking.cxx | 319 +++ uui/source/iahndl-ssl.cxx | 360 ++++ uui/source/iahndl.cxx | 3804 +++++++--------------------------- uui/source/iahndl.hxx | 302 +-- uui/source/makefile.mk | 29 +- 11 files changed, 3660 insertions(+), 3216 deletions(-) create mode 100644 uui/source/getcontinuations.hxx create mode 100644 uui/source/iahndl-authentication.cxx create mode 100644 uui/source/iahndl-cookies.cxx create mode 100644 uui/source/iahndl-errorhandler.cxx create mode 100644 uui/source/iahndl-filter.cxx create mode 100644 uui/source/iahndl-ioexceptions.cxx create mode 100644 uui/source/iahndl-locking.cxx create mode 100644 uui/source/iahndl-ssl.cxx diff --git a/uui/source/getcontinuations.hxx b/uui/source/getcontinuations.hxx new file mode 100644 index 000000000000..9cc39b3823aa --- /dev/null +++ b/uui/source/getcontinuations.hxx @@ -0,0 +1,121 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: iahndl.cxx,v $ + * $Revision: 1.67.22.1 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef INCLUDED_UUI_GETCONTINUATIONS_HXX +#define INCLUDED_UUI_GETCONTINUATIONS_HXX + +#include "com/sun/star/uno/Reference.hxx" +#include "com/sun/star/uno/Sequence.hxx" + +namespace com { namespace sun { namespace star { + namespace task { + class XInteractionContinuation; + } +} } } + +template< class t1 > +bool setContinuation( + com::sun::star::uno::Reference< + com::sun::star::task::XInteractionContinuation > const & rContinuation, + com::sun::star::uno::Reference< t1 > * pContinuation) +{ + if (pContinuation && !pContinuation->is()) + { + pContinuation->set(rContinuation, com::sun::star::uno::UNO_QUERY); + if (pContinuation->is()) + return true; + } + return false; +} + +template< class t1, class t2 > +void getContinuations( + com::sun::star::uno::Sequence< + com::sun::star::uno::Reference< + com::sun::star::task::XInteractionContinuation > > const & + rContinuations, + com::sun::star::uno::Reference< t1 > * pContinuation1, + com::sun::star::uno::Reference< t2 > * pContinuation2) +{ + for (sal_Int32 i = 0; i < rContinuations.getLength(); ++i) + { + if (setContinuation(rContinuations[i], pContinuation1)) + continue; + if (setContinuation(rContinuations[i], pContinuation2)) + continue; + } +} + +template< class t1, class t2, class t3 > +void getContinuations( + com::sun::star::uno::Sequence< + com::sun::star::uno::Reference< + com::sun::star::task::XInteractionContinuation > > const & + rContinuations, + com::sun::star::uno::Reference< t1 > * pContinuation1, + com::sun::star::uno::Reference< t2 > * pContinuation2, + com::sun::star::uno::Reference< t3 > * pContinuation3) +{ + for (sal_Int32 i = 0; i < rContinuations.getLength(); ++i) + { + if (setContinuation(rContinuations[i], pContinuation1)) + continue; + if (setContinuation(rContinuations[i], pContinuation2)) + continue; + if (setContinuation(rContinuations[i], pContinuation3)) + continue; + } +} + +template< class t1, class t2, class t3, class t4 > +void getContinuations( + com::sun::star::uno::Sequence< + com::sun::star::uno::Reference< + com::sun::star::task::XInteractionContinuation > > const & + rContinuations, + com::sun::star::uno::Reference< t1 > * pContinuation1, + com::sun::star::uno::Reference< t2 > * pContinuation2, + com::sun::star::uno::Reference< t3 > * pContinuation3, + com::sun::star::uno::Reference< t4 > * pContinuation4) +{ + for (sal_Int32 i = 0; i < rContinuations.getLength(); ++i) + { + if (setContinuation(rContinuations[i], pContinuation1)) + continue; + if (setContinuation(rContinuations[i], pContinuation2)) + continue; + if (setContinuation(rContinuations[i], pContinuation3)) + continue; + if (setContinuation(rContinuations[i], pContinuation4)) + continue; + } +} + +#endif /* INCLUDED_UUI_GETCONTINUATIONS_HXX */ diff --git a/uui/source/iahndl-authentication.cxx b/uui/source/iahndl-authentication.cxx new file mode 100644 index 000000000000..9154122187ea --- /dev/null +++ b/uui/source/iahndl-authentication.cxx @@ -0,0 +1,588 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: $ + * $Revision: $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "com/sun/star/task/DocumentPasswordRequest.hpp" +#include "com/sun/star/task/DocumentMSPasswordRequest.hpp" +#include "com/sun/star/task/MasterPasswordRequest.hpp" +#include "com/sun/star/task/XInteractionAbort.hpp" +#include "com/sun/star/task/XInteractionPassword.hpp" +#include "com/sun/star/task/XInteractionRetry.hpp" +#include "com/sun/star/ucb/XInteractionSupplyAuthentication2.hpp" +#include "com/sun/star/ucb/URLAuthenticationRequest.hpp" + +#include "rtl/digest.h" +#include "vos/mutex.hxx" +#include "tools/errcode.hxx" +#include "vcl/msgbox.hxx" +#include "vcl/svapp.hxx" + +#include "ids.hrc" +#include "getcontinuations.hxx" +#include "passwordcontainer.hxx" +#include "loginerr.hxx" +#include "logindlg.hxx" +#include "masterpasscrtdlg.hxx" +#include "masterpassworddlg.hxx" +#include "passcrtdlg.hxx" +#include "passworddlg.hxx" + +#include "iahndl.hxx" + +using namespace com::sun::star; + +namespace { + +void +executeLoginDialog( + Window * pParent, + LoginErrorInfo & rInfo, + rtl::OUString const & rRealm) + SAL_THROW((uno::RuntimeException)) +{ + try + { + vos::OGuard aGuard(Application::GetSolarMutex()); + + bool bAccount = (rInfo.GetFlags() & LOGINERROR_FLAG_MODIFY_ACCOUNT) + != 0; + bool bSavePassword = rInfo.GetIsPersistentPassword() + || rInfo.GetIsSavePassword(); + bool bCanUseSysCreds = rInfo.GetCanUseSystemCredentials(); + + sal_uInt16 nFlags = 0; + if (rInfo.GetPath().Len() == 0) + nFlags |= LF_NO_PATH; + if (rInfo.GetErrorText().Len() == 0) + nFlags |= LF_NO_ERRORTEXT; + if (!bAccount) + nFlags |= LF_NO_ACCOUNT; + if (!(rInfo.GetFlags() & LOGINERROR_FLAG_MODIFY_USER_NAME)) + nFlags |= LF_USERNAME_READONLY; + + if (!bSavePassword) + nFlags |= LF_NO_SAVEPASSWORD; + + if (!bCanUseSysCreds) + nFlags |= LF_NO_USESYSCREDS; + + std::auto_ptr< ResMgr > xManager( + ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); + UniString aRealm(rRealm); + std::auto_ptr< LoginDialog > xDialog( + new LoginDialog(pParent, + nFlags, + rInfo.GetServer(), + &aRealm, + xManager.get())); + if (rInfo.GetErrorText().Len() != 0) + xDialog->SetErrorText(rInfo.GetErrorText()); + xDialog->SetName(rInfo.GetUserName()); + if (bAccount) + xDialog->ClearAccount(); + else + xDialog->ClearPassword(); + xDialog->SetPassword(rInfo.GetPassword()); + + if (bSavePassword) + { + xDialog-> + SetSavePasswordText(ResId(rInfo.GetIsPersistentPassword() ? + RID_SAVE_PASSWORD : + RID_KEEP_PASSWORD, + *xManager.get())); + xDialog->SetSavePassword(rInfo.GetIsSavePassword()); + } + + if ( bCanUseSysCreds ) + xDialog->SetUseSystemCredentials( + rInfo.GetIsUseSystemCredentials() ); + + rInfo.SetResult(xDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK : + ERRCODE_BUTTON_CANCEL); + rInfo.SetUserName(xDialog->GetName()); + rInfo.SetPassword(xDialog->GetPassword()); + rInfo.SetAccount(xDialog->GetAccount()); + rInfo.SetSavePassword(xDialog->IsSavePassword()); + + if ( bCanUseSysCreds ) + rInfo.SetIsUseSystemCredentials( xDialog->IsUseSystemCredentials() ); + } + catch (std::bad_alloc const &) + { + throw uno::RuntimeException( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")), + uno::Reference< uno::XInterface >()); + } +} + +void +handleAuthenticationRequest_( + Window * pParent, + uno::Reference< task::XInteractionHandler > const & xIH, + uno::Reference< lang::XMultiServiceFactory > const & xServiceFactory, + ucb::AuthenticationRequest const & rRequest, + uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & + rContinuations, + const rtl::OUString & rURL) + SAL_THROW((uno::RuntimeException)) +{ + uno::Reference< task::XInteractionRetry > xRetry; + uno::Reference< task::XInteractionAbort > xAbort; + uno::Reference< ucb::XInteractionSupplyAuthentication > + xSupplyAuthentication; + uno::Reference< ucb::XInteractionSupplyAuthentication2 > + xSupplyAuthentication2; + getContinuations(rContinuations, &xRetry, &xAbort, &xSupplyAuthentication); + if (xSupplyAuthentication.is()) + xSupplyAuthentication2.set(xSupplyAuthentication, uno::UNO_QUERY); + + ////////////////////////// + // First, try to obatin credentials from password container service. + uui::PasswordContainerHelper aPwContainerHelper(xServiceFactory); + if (aPwContainerHelper.handleAuthenticationRequest(rRequest, + xSupplyAuthentication, + rURL, + xIH)) + { + xSupplyAuthentication->select(); + return; + } + + ////////////////////////// + // Second, try to obtain credentials from user via password dialog. + bool bRemember; + bool bRememberPersistent; + if (xSupplyAuthentication.is()) + { + ucb::RememberAuthentication eDefault; + uno::Sequence< ucb::RememberAuthentication > + aModes(xSupplyAuthentication->getRememberPasswordModes(eDefault)); + bRemember = eDefault != ucb::RememberAuthentication_NO; + bRememberPersistent = false; + for (sal_Int32 i = 0; i < aModes.getLength(); ++i) + if (aModes[i] == ucb::RememberAuthentication_PERSISTENT) + { + bRememberPersistent = true; + break; + } + } + else + { + bRemember = false; + bRememberPersistent = false; + } + + sal_Bool bCanUseSystemCredentials; + sal_Bool bDefaultUseSystemCredentials; + if (xSupplyAuthentication2.is()) + { + bCanUseSystemCredentials + = xSupplyAuthentication2->canUseSystemCredentials( + bDefaultUseSystemCredentials); + } + else + { + bCanUseSystemCredentials = sal_False; + bDefaultUseSystemCredentials = sal_False; + } + + LoginErrorInfo aInfo; + aInfo.SetTitle(rRequest.ServerName); + aInfo.SetServer(rRequest.ServerName); + if (rRequest.HasAccount) + aInfo.SetAccount(rRequest.Account); + if (rRequest.HasUserName) + aInfo.SetUserName(rRequest.UserName); + if (rRequest.HasPassword) + aInfo.SetPassword(rRequest.Password); + aInfo.SetErrorText(rRequest.Diagnostic); + aInfo.SetPersistentPassword(bRememberPersistent); + aInfo.SetSavePassword(bRemember); + aInfo.SetCanUseSystemCredentials(bCanUseSystemCredentials); + aInfo.SetIsUseSystemCredentials( bDefaultUseSystemCredentials ); + aInfo.SetModifyAccount(rRequest.HasAccount + && xSupplyAuthentication.is() + && xSupplyAuthentication->canSetAccount()); + aInfo.SetModifyUserName(rRequest.HasUserName + && xSupplyAuthentication.is() + && xSupplyAuthentication->canSetUserName()); + executeLoginDialog(pParent, + aInfo, + rRequest.HasRealm ? rRequest.Realm : rtl::OUString()); + switch (aInfo.GetResult()) + { + case ERRCODE_BUTTON_OK: + if (xSupplyAuthentication.is()) + { + if (xSupplyAuthentication->canSetUserName()) + xSupplyAuthentication->setUserName(aInfo.GetUserName()); + if (xSupplyAuthentication->canSetPassword()) + xSupplyAuthentication->setPassword(aInfo.GetPassword()); + xSupplyAuthentication-> + setRememberPassword( + aInfo.GetIsSavePassword() ? + bRememberPersistent ? + ucb::RememberAuthentication_PERSISTENT : + ucb::RememberAuthentication_SESSION : + ucb::RememberAuthentication_NO); + if (rRequest.HasRealm) + { + if (xSupplyAuthentication->canSetRealm()) + xSupplyAuthentication->setRealm(aInfo.GetAccount()); + } + else if (xSupplyAuthentication->canSetAccount()) + xSupplyAuthentication->setAccount(aInfo.GetAccount()); + + if ( xSupplyAuthentication2.is() && bCanUseSystemCredentials ) + xSupplyAuthentication2->setUseSystemCredentials( + aInfo.GetIsUseSystemCredentials() ); + + xSupplyAuthentication->select(); + } + + ////////////////////////// + // Third, store credentials in password container. + + if ( aInfo.GetIsUseSystemCredentials() ) + { + if (aInfo.GetIsSavePassword()) + { + aPwContainerHelper.addRecord( + rURL.getLength() ? rURL : rRequest.ServerName, + rtl::OUString(), // empty u/p -> sys creds + uno::Sequence< rtl::OUString >(), + xIH, + bRememberPersistent); + } + } + // Empty user name can not be valid: + else if (aInfo.GetUserName().Len() != 0) + { + if (aInfo.GetIsSavePassword()) + { + uno::Sequence< rtl::OUString > + aPassList(aInfo.GetAccount().Len() == 0 ? 1 : 2); + aPassList[0] = aInfo.GetPassword(); + if (aInfo.GetAccount().Len() != 0) + aPassList[1] = aInfo.GetAccount(); + + aPwContainerHelper.addRecord( + rURL.getLength() ? rURL : rRequest.ServerName, + aInfo.GetUserName(), + aPassList, + xIH, + bRememberPersistent); + } + } + break; + + case ERRCODE_BUTTON_RETRY: + if (xRetry.is()) + xRetry->select(); + break; + + default: + if (xAbort.is()) + xAbort->select(); + break; + } +} + +void +executeMasterPasswordDialog( + Window * pParent, + LoginErrorInfo & rInfo, + task::PasswordRequestMode nMode) + SAL_THROW((uno::RuntimeException)) +{ + rtl::OString aMaster; + try + { + vos::OGuard aGuard(Application::GetSolarMutex()); + + std::auto_ptr< ResMgr > xManager( + ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); + if( nMode == task::PasswordRequestMode_PASSWORD_CREATE ) + { + std::auto_ptr< MasterPasswordCreateDialog > xDialog( + new MasterPasswordCreateDialog(pParent, xManager.get())); + rInfo.SetResult(xDialog->Execute() + == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL); + aMaster = rtl::OUStringToOString( + xDialog->GetMasterPassword(), RTL_TEXTENCODING_UTF8); + } + else + { + std::auto_ptr< MasterPasswordDialog > xDialog( + new MasterPasswordDialog(pParent, nMode, xManager.get())); + rInfo.SetResult(xDialog->Execute() + == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL); + aMaster = rtl::OUStringToOString( + xDialog->GetMasterPassword(), RTL_TEXTENCODING_UTF8); + } + } + catch (std::bad_alloc const &) + { + throw uno::RuntimeException( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")), + uno::Reference< uno::XInterface >()); + } + + sal_uInt8 aKey[RTL_DIGEST_LENGTH_MD5]; + rtl_digest_PBKDF2(aKey, + RTL_DIGEST_LENGTH_MD5, + reinterpret_cast< sal_uInt8 const * >(aMaster.getStr()), + aMaster.getLength(), + reinterpret_cast< sal_uInt8 const * >( + "3B5509ABA6BC42D9A3A1F3DAD49E56A51"), + 32, + 1000); + + rtl::OUStringBuffer aBuffer; + for (int i = 0; i < RTL_DIGEST_LENGTH_MD5; ++i) + { + aBuffer.append(static_cast< sal_Unicode >('a' + (aKey[i] >> 4))); + aBuffer.append(static_cast< sal_Unicode >('a' + (aKey[i] & 15))); + } + rInfo.SetPassword(aBuffer.makeStringAndClear()); +} + +void +handleMasterPasswordRequest_( + Window * pParent, + task::PasswordRequestMode nMode, + uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & + rContinuations) + SAL_THROW((uno::RuntimeException)) +{ + uno::Reference< task::XInteractionRetry > xRetry; + uno::Reference< task::XInteractionAbort > xAbort; + uno::Reference< ucb::XInteractionSupplyAuthentication > + xSupplyAuthentication; + getContinuations(rContinuations, &xRetry, &xAbort, &xSupplyAuthentication); + LoginErrorInfo aInfo; + + // in case of master password a hash code is returned + executeMasterPasswordDialog(pParent, aInfo, nMode); + + switch (aInfo.GetResult()) + { + case ERRCODE_BUTTON_OK: + if (xSupplyAuthentication.is()) + { + if (xSupplyAuthentication->canSetPassword()) + xSupplyAuthentication->setPassword(aInfo.GetPassword()); + xSupplyAuthentication->select(); + } + break; + + case ERRCODE_BUTTON_RETRY: + if (xRetry.is()) + xRetry->select(); + break; + + default: + if (xAbort.is()) + xAbort->select(); + break; + } +} + +void +executePasswordDialog( + Window * pParent, + LoginErrorInfo & rInfo, + task::PasswordRequestMode nMode, + ::rtl::OUString aDocName, + bool bMSCryptoMode) + SAL_THROW((uno::RuntimeException)) +{ + try + { + vos::OGuard aGuard(Application::GetSolarMutex()); + + std::auto_ptr< ResMgr > xManager( + ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); + if( nMode == task::PasswordRequestMode_PASSWORD_CREATE ) + { + std::auto_ptr< PasswordCreateDialog > xDialog( + new PasswordCreateDialog(pParent, + xManager.get(), + bMSCryptoMode)); + + rInfo.SetResult(xDialog->Execute() + == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL); + rInfo.SetPassword( xDialog->GetPassword() ); + } + else + { + std::auto_ptr< PasswordDialog > xDialog( + new PasswordDialog(pParent, nMode, xManager.get(), aDocName)); + + rInfo.SetResult(xDialog->Execute() + == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL); + rInfo.SetPassword( xDialog->GetPassword() ); + } + } + catch (std::bad_alloc const &) + { + throw uno::RuntimeException( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")), + uno::Reference< uno::XInterface>()); + } +} + +void +handlePasswordRequest_( + Window * pParent, + task::PasswordRequestMode nMode, + uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & + rContinuations, + ::rtl::OUString aDocumentName, + bool bMSCryptoMode ) + SAL_THROW((uno::RuntimeException)) +{ + uno::Reference< task::XInteractionRetry > xRetry; + uno::Reference< task::XInteractionAbort > xAbort; + uno::Reference< task::XInteractionPassword > xPassword; + getContinuations(rContinuations, &xRetry, &xAbort, &xPassword); + LoginErrorInfo aInfo; + + executePasswordDialog(pParent, + aInfo, + nMode, + aDocumentName, + bMSCryptoMode); + + switch (aInfo.GetResult()) + { + case ERRCODE_BUTTON_OK: + if (xPassword.is()) + { + xPassword->setPassword(aInfo.GetPassword()); + xPassword->select(); + } + break; + + case ERRCODE_BUTTON_RETRY: + if (xRetry.is()) + xRetry->select(); + break; + + default: + if (xAbort.is()) + xAbort->select(); + break; + } +} + +} // namespace + +bool +UUIInteractionHelper::handleAuthenticationRequest( + uno::Reference< task::XInteractionRequest > const & rRequest) + SAL_THROW((uno::RuntimeException)) +{ + uno::Any aAnyRequest(rRequest->getRequest()); + + ucb::URLAuthenticationRequest aURLAuthenticationRequest; + if (aAnyRequest >>= aURLAuthenticationRequest) + { + handleAuthenticationRequest_(getParentProperty(), + getInteractionHandler(), + m_xServiceFactory, + aURLAuthenticationRequest, + rRequest->getContinuations(), + aURLAuthenticationRequest.URL); + return true; + } + + ucb::AuthenticationRequest aAuthenticationRequest; + if (aAnyRequest >>= aAuthenticationRequest) + { + handleAuthenticationRequest_(getParentProperty(), + getInteractionHandler(), + m_xServiceFactory, + aAuthenticationRequest, + rRequest->getContinuations(), + rtl::OUString()); + return true; + } + return false; +} + +bool +UUIInteractionHelper::handleMasterPasswordRequest( + uno::Reference< task::XInteractionRequest > const & rRequest) + SAL_THROW((uno::RuntimeException)) +{ + uno::Any aAnyRequest(rRequest->getRequest()); + + task::MasterPasswordRequest aMasterPasswordRequest; + if (aAnyRequest >>= aMasterPasswordRequest) + { + handleMasterPasswordRequest_(getParentProperty(), + aMasterPasswordRequest.Mode, + rRequest->getContinuations()); + return true; + } + return false; +} + +bool +UUIInteractionHelper::handlePasswordRequest( + uno::Reference< task::XInteractionRequest > const & rRequest) + SAL_THROW((uno::RuntimeException)) +{ + uno::Any aAnyRequest(rRequest->getRequest()); + + task::DocumentPasswordRequest aDocumentPasswordRequest; + if (aAnyRequest >>= aDocumentPasswordRequest) + { + handlePasswordRequest_(getParentProperty(), + aDocumentPasswordRequest.Mode, + rRequest->getContinuations(), + aDocumentPasswordRequest.Name, + false /* bool bMSCryptoMode */); + return true; + } + + task::DocumentMSPasswordRequest aDocumentMSPasswordRequest; + if (aAnyRequest >>= aDocumentMSPasswordRequest) + { + handlePasswordRequest_(getParentProperty(), + aDocumentMSPasswordRequest.Mode, + rRequest->getContinuations(), + aDocumentMSPasswordRequest.Name, + true /* bool bMSCryptoMode */); + return true; + } + return false; +} diff --git a/uui/source/iahndl-cookies.cxx b/uui/source/iahndl-cookies.cxx new file mode 100644 index 000000000000..89ed2779c732 --- /dev/null +++ b/uui/source/iahndl-cookies.cxx @@ -0,0 +1,212 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: $ + * $Revision: $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "com/sun/star/ucb/HandleCookiesRequest.hpp" +#include "com/sun/star/ucb/XInteractionCookieHandling.hpp" +#include "com/sun/star/task/XInteractionRequest.hpp" + +#include "vos/mutex.hxx" +#include "tools/list.hxx" +#include "svtools/httpcook.hxx" +#include "vcl/svapp.hxx" + +#include "cookiedg.hxx" + +#include "iahndl.hxx" + +using namespace com::sun::star; + +namespace { + +class CookieList: public List +{ +public: + ~CookieList() SAL_THROW(()); +}; + +CookieList::~CookieList() SAL_THROW(()) +{ + while (Count() != 0) + delete static_cast< CntHTTPCookie * >(Remove(Count() - 1)); +} + +void +executeCookieDialog(Window * pParent, CntHTTPCookieRequest & rRequest) + SAL_THROW((uno::RuntimeException)) +{ + try + { + vos::OGuard aGuard(Application::GetSolarMutex()); + + std::auto_ptr< ResMgr > xManager( + ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); + std::auto_ptr< CookiesDialog > xDialog( + new CookiesDialog(pParent, &rRequest, xManager.get())); + xDialog->Execute(); + } + catch (std::bad_alloc const &) + { + throw uno::RuntimeException( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")), + uno::Reference< uno::XInterface>()); + } +} + +void +handleCookiesRequest_( + Window * pParent, + ucb::HandleCookiesRequest const & rRequest, + uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & + rContinuations) + SAL_THROW((uno::RuntimeException)) +{ + CookieList aCookies; + for (sal_Int32 i = 0; i < rRequest.Cookies.getLength(); ++i) + { + try + { + std::auto_ptr< CntHTTPCookie > xCookie(new CntHTTPCookie); + xCookie->m_aName = UniString(rRequest.Cookies[i].Name); + xCookie->m_aValue = UniString(rRequest.Cookies[i].Value); + xCookie->m_aDomain = UniString(rRequest.Cookies[i].Domain); + xCookie->m_aPath = UniString(rRequest.Cookies[i].Path); + xCookie->m_aExpires + = DateTime(Date(rRequest.Cookies[i].Expires.Day, + rRequest.Cookies[i].Expires.Month, + rRequest.Cookies[i].Expires.Year), + Time(rRequest.Cookies[i].Expires.Hours, + rRequest.Cookies[i].Expires.Minutes, + rRequest.Cookies[i].Expires.Seconds, + rRequest.Cookies[i].Expires.HundredthSeconds)); + xCookie->m_nFlags + = rRequest.Cookies[i].Secure ? CNTHTTP_COOKIE_FLAG_SECURE : 0; + switch (rRequest.Cookies[i].Policy) + { + case ucb::CookiePolicy_CONFIRM: + xCookie->m_nPolicy = CNTHTTP_COOKIE_POLICY_INTERACTIVE; + break; + + case ucb::CookiePolicy_ACCEPT: + xCookie->m_nPolicy = CNTHTTP_COOKIE_POLICY_ACCEPTED; + break; + + case ucb::CookiePolicy_IGNORE: + xCookie->m_nPolicy = CNTHTTP_COOKIE_POLICY_BANNED; + break; + + default: + OSL_ASSERT(false); + break; + } + aCookies.Insert(xCookie.get(), LIST_APPEND); + xCookie.release(); + } + catch (std::bad_alloc const &) + { + throw uno::RuntimeException( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "out of memory")), + uno::Reference< uno::XInterface >()); + } + } + + CntHTTPCookieRequest + aRequest(rRequest.URL, + aCookies, + rRequest.Request == ucb::CookieRequest_RECEIVE + ? CNTHTTP_COOKIE_REQUEST_RECV + : CNTHTTP_COOKIE_REQUEST_SEND); + executeCookieDialog(pParent, aRequest); + for (sal_Int32 i = 0; i < rContinuations.getLength(); ++i) + { + uno::Reference< ucb::XInteractionCookieHandling > + xCookieHandling(rContinuations[i], uno::UNO_QUERY); + if (xCookieHandling.is()) + { + switch (aRequest.m_nRet) + { + case CNTHTTP_COOKIE_POLICY_INTERACTIVE: + xCookieHandling-> + setGeneralPolicy(ucb::CookiePolicy_CONFIRM); + break; + + case CNTHTTP_COOKIE_POLICY_ACCEPTED: + xCookieHandling-> + setGeneralPolicy(ucb::CookiePolicy_ACCEPT); + break; + + case CNTHTTP_COOKIE_POLICY_BANNED: + xCookieHandling-> + setGeneralPolicy(ucb::CookiePolicy_IGNORE); + break; + } + for (sal_Int32 j = 0; j < rRequest.Cookies.getLength(); ++j) + if (rRequest.Cookies[j].Policy + == ucb::CookiePolicy_CONFIRM) + switch (static_cast< CntHTTPCookie * >(aCookies. + GetObject(j))-> + m_nPolicy) + { + case CNTHTTP_COOKIE_POLICY_ACCEPTED: + xCookieHandling-> + setSpecificPolicy(rRequest.Cookies[j], true); + break; + + case CNTHTTP_COOKIE_POLICY_BANNED: + xCookieHandling-> + setSpecificPolicy(rRequest.Cookies[j], false); + break; + } + xCookieHandling->select(); + break; + } + } +} + +} // namespace + +bool +UUIInteractionHelper::handleCookiesRequest( + uno::Reference< task::XInteractionRequest > const & rRequest) + SAL_THROW((uno::RuntimeException)) +{ + uno::Any aAnyRequest(rRequest->getRequest()); + + ucb::HandleCookiesRequest aCookiesRequest; + if (aAnyRequest >>= aCookiesRequest) + { + handleCookiesRequest_(getParentProperty(), + aCookiesRequest, + rRequest->getContinuations()); + return true; + } + return false; +} + diff --git a/uui/source/iahndl-errorhandler.cxx b/uui/source/iahndl-errorhandler.cxx new file mode 100644 index 000000000000..6e385372339c --- /dev/null +++ b/uui/source/iahndl-errorhandler.cxx @@ -0,0 +1,321 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: iahndl.cxx,v $ + * $Revision: 1.67.22.1 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include + +#include "vos/mutex.hxx" +#include "vcl/svapp.hxx" +#include "vcl/msgbox.hxx" + +#include "com/sun/star/task/XInteractionAbort.hpp" +#include "com/sun/star/task/XInteractionApprove.hpp" +#include "com/sun/star/task/XInteractionDisapprove.hpp" +#include "com/sun/star/task/XInteractionRetry.hpp" + +#include "tools/errinf.hxx" // ErrorHandler, ErrorContext, ... +#include "svtools/svtools.hrc" // RID_ERRHDL + +#include "ids.hrc" +#include "getcontinuations.hxx" + +#include "iahndl.hxx" + +using namespace com::sun::star; + +namespace { + +USHORT +executeErrorDialog( + Window * pParent, + task::InteractionClassification eClassification, + rtl::OUString const & rContext, + rtl::OUString const & rMessage, + WinBits nButtonMask) + SAL_THROW((uno::RuntimeException)) +{ + vos::OGuard aGuard(Application::GetSolarMutex()); + + rtl::OUStringBuffer aText(rContext); + if (rContext.getLength() != 0 && rMessage.getLength() != 0) + aText.appendAscii(RTL_CONSTASCII_STRINGPARAM(":\n")); + //TODO! must be internationalized + aText.append(rMessage); + + std::auto_ptr< MessBox > xBox; + try + { + switch (eClassification) + { + case task::InteractionClassification_ERROR: + xBox.reset(new ErrorBox(pParent, + nButtonMask, + aText.makeStringAndClear())); + break; + + case task::InteractionClassification_WARNING: + xBox.reset(new WarningBox(pParent, + nButtonMask, + aText.makeStringAndClear())); + break; + + case task::InteractionClassification_INFO: + if ((nButtonMask & 0x01F00000) == WB_DEF_OK) + //TODO! missing win bit button mask define (want to ignore + // any default button settings)... + xBox.reset(new InfoBox(pParent, + aText.makeStringAndClear())); + else + xBox.reset(new ErrorBox(pParent, + nButtonMask, + aText.makeStringAndClear())); + break; + + case task::InteractionClassification_QUERY: + xBox.reset(new QueryBox(pParent, + nButtonMask, + aText.makeStringAndClear())); + break; + + default: + OSL_ASSERT(false); + break; + } + } + catch (std::bad_alloc const &) + { + throw uno::RuntimeException( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")), + uno::Reference< uno::XInterface >()); + } + + USHORT aResult = xBox->Execute(); + switch( aResult ) + { + case BUTTONID_OK: + aResult = ERRCODE_BUTTON_OK; + break; + case BUTTONID_CANCEL: + aResult = ERRCODE_BUTTON_CANCEL; + break; + case BUTTONID_YES: + aResult = ERRCODE_BUTTON_YES; + break; + case BUTTONID_NO: + aResult = ERRCODE_BUTTON_NO; + break; + case BUTTONID_RETRY: + aResult = ERRCODE_BUTTON_RETRY; + break; + } + + return aResult; +} + +} + +void +UUIInteractionHelper::handleErrorHandlerRequest( + task::InteractionClassification eClassification, + ErrCode nErrorCode, + std::vector< rtl::OUString > const & rArguments, + uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & + rContinuations, + bool bObtainErrorStringOnly, + bool & bHasErrorString, + rtl::OUString & rErrorString) + SAL_THROW((uno::RuntimeException)) +{ + if (bObtainErrorStringOnly) + { + bHasErrorString = isInformationalErrorMessageRequest(rContinuations); + if (!bHasErrorString) + return; + } + + rtl::OUString aMessage; + { + enum Source { SOURCE_DEFAULT, SOURCE_CNT, SOURCE_SVX, SOURCE_UUI }; + static char const * const aManager[4] + = { CREATEVERSIONRESMGR_NAME(ofa), + CREATEVERSIONRESMGR_NAME(cnt), + CREATEVERSIONRESMGR_NAME(svx), + CREATEVERSIONRESMGR_NAME(uui) }; + static USHORT const aId[4] + = { RID_ERRHDL, + RID_CHAOS_START + 12, + // cf. chaos/source/inc/cntrids.hrc, where + // #define RID_CHAOS_ERRHDL (RID_CHAOS_START + 12) + RID_SVX_START + 350, // RID_SVXERRCODE + RID_UUI_ERRHDL }; + ErrCode nErrorId = nErrorCode & ~ERRCODE_WARNING_MASK; + Source eSource = nErrorId < ERRCODE_AREA_LIB1 ? + SOURCE_DEFAULT : + nErrorId >= ERRCODE_AREA_CHAOS + && nErrorId < ERRCODE_AREA_CHAOS_END ? + SOURCE_CNT : + nErrorId >= ERRCODE_AREA_SVX + && nErrorId <= ERRCODE_AREA_SVX_END ? + SOURCE_SVX : + SOURCE_UUI; + + vos::OGuard aGuard(Application::GetSolarMutex()); + std::auto_ptr< ResMgr > xManager; + xManager.reset(ResMgr::CreateResMgr(aManager[eSource])); + if (!xManager.get()) + return; + ResId aResId(aId[eSource], *xManager.get()); + if (!ErrorResource(aResId).getString(nErrorCode, &aMessage)) + return; + } + + aMessage = replaceMessageWithArguments( aMessage, rArguments ); + + if (bObtainErrorStringOnly) + { + rErrorString = aMessage; + return; + } + else + { + //TODO! It can happen that the buttons calculated below do not match + // the error text from the resource (e.g., some text that is not a + // question, but YES and NO buttons). Some error texts have + // ExtraData that specifies a set of buttons, but that data is not + // really useful, because a single error text may well make sense + // both with only an OK button and with RETRY and CANCEL buttons. + + uno::Reference< task::XInteractionApprove > xApprove; + uno::Reference< task::XInteractionDisapprove > xDisapprove; + uno::Reference< task::XInteractionRetry > xRetry; + uno::Reference< task::XInteractionAbort > xAbort; + getContinuations( + rContinuations, &xApprove, &xDisapprove, &xRetry, &xAbort); + + // The following mapping uses the bit mask + // Approve = 8, + // Disapprove = 4, + // Retry = 2, + // Abort = 1 + // + // The mapping has five properties on which the code to select the + // correct continuation relies: + // 1 The OK button is mapped to Approve if that is available, + // otherwise to Abort if that is available, otherwise to none. + // 2 The CANCEL button is always mapped to Abort. + // 3 The RETRY button is always mapped to Retry. + // 4 The NO button is always mapped to Disapprove. + // 5 The YES button is always mapped to Approve. + // + // Because the WinBits button combinations are quite restricted, not + // every request can be served here. + // + // Finally, it seems to be better to leave default button + // determination to VCL (the favouring of CANCEL as default button + // seems to not always be what the user wants)... + WinBits const aButtonMask[16] + = { 0, + WB_OK /*| WB_DEF_OK*/, // Abort + 0, + WB_RETRY_CANCEL /*| WB_DEF_CANCEL*/, // Retry, Abort + 0, + 0, + 0, + 0, + WB_OK /*| WB_DEF_OK*/, // Approve + WB_OK_CANCEL /*| WB_DEF_CANCEL*/, // Approve, Abort + 0, + 0, + WB_YES_NO /*| WB_DEF_NO*/, // Approve, Disapprove + WB_YES_NO_CANCEL /*| WB_DEF_CANCEL*/, + // Approve, Disapprove, Abort + 0, + 0 }; + + WinBits nButtonMask = aButtonMask[(xApprove.is() ? 8 : 0) + | (xDisapprove.is() ? 4 : 0) + | (xRetry.is() ? 2 : 0) + | (xAbort.is() ? 1 : 0)]; + if (nButtonMask == 0) + return; + + //TODO! remove this backwards compatibility? + rtl::OUString aContext(getContextProperty()); + if (aContext.getLength() == 0 && nErrorCode != 0) + { + vos::OGuard aGuard(Application::GetSolarMutex()); + ErrorContext * pContext = ErrorContext::GetContext(); + if (pContext) + { + UniString aContextString; + if (pContext->GetString(nErrorCode, aContextString)) + aContext = aContextString; + } + } + + USHORT nResult = executeErrorDialog( + getParentProperty(), eClassification, aContext, aMessage, nButtonMask ); + + switch (nResult) + { + case ERRCODE_BUTTON_OK: + OSL_ENSURE(xApprove.is() || xAbort.is(), "unexpected situation"); + if (xApprove.is()) + xApprove->select(); + else if (xAbort.is()) + xAbort->select(); + break; + + case ERRCODE_BUTTON_CANCEL: + OSL_ENSURE(xAbort.is(), "unexpected situation"); + if (xAbort.is()) + xAbort->select(); + break; + + case ERRCODE_BUTTON_RETRY: + OSL_ENSURE(xRetry.is(), "unexpected situation"); + if (xRetry.is()) + xRetry->select(); + break; + + case ERRCODE_BUTTON_NO: + OSL_ENSURE(xDisapprove.is(), "unexpected situation"); + if (xDisapprove.is()) + xDisapprove->select(); + break; + + case ERRCODE_BUTTON_YES: + OSL_ENSURE(xApprove.is(), "unexpected situation"); + if (xApprove.is()) + xApprove->select(); + break; + } + + } +} diff --git a/uui/source/iahndl-filter.cxx b/uui/source/iahndl-filter.cxx new file mode 100644 index 000000000000..4c56e8566c12 --- /dev/null +++ b/uui/source/iahndl-filter.cxx @@ -0,0 +1,474 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: $ + * $Revision: $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "com/sun/star/beans/XPropertyAccess.hpp" +#include "com/sun/star/container/XContainerQuery.hpp" +#include "com/sun/star/container/XNameContainer.hpp" +#include "com/sun/star/document/AmbigousFilterRequest.hpp" +#include "com/sun/star/document/FilterOptionsRequest.hpp" +#include "com/sun/star/document/NoSuchFilterRequest.hpp" +#include "com/sun/star/document/XImporter.hpp" +#include "com/sun/star/document/XInteractionFilterOptions.hpp" +#include "com/sun/star/document/XInteractionFilterSelect.hpp" +#include "com/sun/star/lang/XMultiServiceFactory.hpp" +#include "com/sun/star/task/XInteractionAbort.hpp" +#include "com/sun/star/task/XInteractionRequest.hpp" +#include "com/sun/star/ui/dialogs/XExecutableDialog.hpp" + +#include "vos/mutex.hxx" +#include "comphelper/sequenceashashmap.hxx" +#include "vcl/svapp.hxx" + +#include "getcontinuations.hxx" +#include "fltdlg.hxx" + +#include "iahndl.hxx" + +using namespace com::sun::star; + +namespace { + +void +executeFilterDialog( + Window * pParent , + rtl::OUString const & rURL , + uui::FilterNameList const & rFilters, + rtl::OUString & rFilter ) + SAL_THROW((uno::RuntimeException)) +{ + try + { + vos::OGuard aGuard(Application::GetSolarMutex()); + + std::auto_ptr< ResMgr > xManager( + ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); + + std::auto_ptr< uui::FilterDialog > xDialog( + new uui::FilterDialog(pParent, xManager.get())); + + xDialog->SetURL(rURL); + xDialog->ChangeFilters(&rFilters); + + uui::FilterNameListPtr pSelected = rFilters.end(); + if( xDialog->AskForFilter( pSelected ) ) + { + rFilter = pSelected->sInternal; + } + } + catch (std::bad_alloc const &) + { + throw uno::RuntimeException( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")), + uno::Reference< uno::XInterface >()); + } +} + +void +handleNoSuchFilterRequest_( + Window * pParent, + uno::Reference< lang::XMultiServiceFactory > const & xServiceFactory, + document::NoSuchFilterRequest const & rRequest, + uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & + rContinuations ) + SAL_THROW((uno::RuntimeException)) +{ + uno::Reference< task::XInteractionAbort > xAbort; + uno::Reference< document::XInteractionFilterSelect > xFilterTransport; + getContinuations(rContinuations, &xAbort, &xFilterTransport); + + // check neccessary ressources - if they don't exist - abort or + // break this operation + if (!xAbort.is()) + return; + + if (!xFilterTransport.is()) + { + xAbort->select(); + return; + } + + uno::Reference< container::XContainerQuery > xFilterContainer; + try + { + xFilterContainer.set( xServiceFactory->createInstance( + ::rtl::OUString::createFromAscii( + "com.sun.star.document.FilterFactory") ), + uno::UNO_QUERY ); + } + catch ( uno::Exception const & ) + { + } + + if (!xFilterContainer.is()) + { + xAbort->select(); + return; + } + + uui::FilterNameList lNames; + + // Note: We look for all filters here which match the following criteria: + // - they are import filters as minimum (of course they can + // support export too) + // - we don't show any filter which are flaged as "don't show it + // at the UI" or "they are not installed" + // - we ignore filters, which have not set any valid + // DocumentService (e.g. our pure graphic filters) + // - we show it sorted by her UIName's + // - We don't use the order flag or prefer default filters. + // (Because this list shows all filters and the user should + // find his filter vry easy by his UIName ...) + // - We use "_query_all" here ... but we filter graphic filters + // out by using DocumentService property later! + uno::Reference< container::XEnumeration > xFilters + = xFilterContainer->createSubSetEnumerationByQuery( + ::rtl::OUString::createFromAscii( + "_query_all:sort_prop=uiname:iflags=1:eflags=143360")); + while (xFilters->hasMoreElements()) + { + try + { + ::comphelper::SequenceAsHashMap lProps(xFilters->nextElement()); + uui::FilterNamePair aPair; + + aPair.sInternal = lProps.getUnpackedValueOrDefault( + rtl::OUString::createFromAscii("Name"), ::rtl::OUString()); + aPair.sUI = lProps.getUnpackedValueOrDefault( + rtl::OUString::createFromAscii("UIName"), ::rtl::OUString()); + if ( (!aPair.sInternal.Len()) || (!aPair.sUI.Len() ) ) + { + continue; + } + lNames.push_back( aPair ); + } + catch(const uno::RuntimeException&) + { + throw; + } + catch(const uno::Exception&) + { + continue; + } + } + + // no list available for showing + // -> abort operation + if (lNames.size()<1) + { + xAbort->select(); + return; + } + + // let the user select the right filter + rtl::OUString sSelectedFilter; + executeFilterDialog( pParent, + rRequest.URL, + lNames, + sSelectedFilter ); + + // If he doesn't select anyone + // -> abort operation + if (sSelectedFilter.getLength()<1) + { + xAbort->select(); + return; + } + + // otherwhise set it for return + xFilterTransport->setFilter( sSelectedFilter ); + xFilterTransport->select(); +} + +void +handleAmbigousFilterRequest_( + Window * pParent, + uno::Reference< lang::XMultiServiceFactory > const & xServiceFactory, + document::AmbigousFilterRequest const & rRequest, + uno::Sequence< + uno::Reference< + task::XInteractionContinuation > > const & rContinuations) + SAL_THROW((uno::RuntimeException)) +{ + uno::Reference< task::XInteractionAbort > xAbort; + uno::Reference< document::XInteractionFilterSelect > xFilterTransport; + getContinuations(rContinuations, &xAbort, &xFilterTransport); + + uui::FilterNameList lNames; + + uno::Reference< container::XNameContainer > xFilterContainer; + try + { + xFilterContainer.set( xServiceFactory->createInstance( + ::rtl::OUString::createFromAscii( + "com.sun.star.document.FilterFactory") ), + uno::UNO_QUERY ); + } + catch ( uno::Exception & ) + { + } + + if( xFilterContainer.is() ) + { + uno::Any aPackedSet ; + uno::Sequence< beans::PropertyValue > lProps ; + sal_Int32 nStep ; + uui::FilterNamePair aPair ; + + try + { + aPackedSet = xFilterContainer->getByName( rRequest.SelectedFilter ); + } + catch(const container::NoSuchElementException&) + { + aPackedSet.clear(); + } + aPackedSet >>= lProps; + for( nStep=0; nStep>= sTemp; + aPair.sUI = sTemp; + aPair.sInternal = rRequest.SelectedFilter; + lNames.push_back( aPair ); + break; + } + } + + try + { + aPackedSet = xFilterContainer->getByName( rRequest.DetectedFilter ); + } + catch(const container::NoSuchElementException&) + { + aPackedSet.clear(); + } + aPackedSet >>= lProps; + for( nStep=0; nStep>= sTemp; + aPair.sUI = sTemp; + aPair.sInternal = rRequest.DetectedFilter; + lNames.push_back( aPair ); + break; + } + } + } + + if( xAbort.is() && xFilterTransport.is() ) + { + if( lNames.size() < 1 ) + { + xAbort->select(); + } + else + { + rtl::OUString sFilter; + executeFilterDialog( pParent, + rRequest.URL, + lNames, + sFilter ); + + if( sFilter.getLength() > 0 ) + { + xFilterTransport->setFilter( sFilter ); + xFilterTransport->select(); + } + else + xAbort->select(); + } + } +} + +void +handleFilterOptionsRequest_( + uno::Reference< lang::XMultiServiceFactory > const & xServiceFactory, + document::FilterOptionsRequest const & rRequest, + uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & + rContinuations) + SAL_THROW((uno::RuntimeException)) +{ + uno::Reference< task::XInteractionAbort > xAbort; + uno::Reference< document::XInteractionFilterOptions > xFilterOptions; + getContinuations(rContinuations, &xAbort, &xFilterOptions); + + uno::Reference< container::XNameAccess > xFilterCFG; + try + { + xFilterCFG.set( xServiceFactory->createInstance( + ::rtl::OUString::createFromAscii( + "com.sun.star.document.FilterFactory" ) ), + uno::UNO_QUERY ); + } + catch ( uno::Exception const & ) + { + } + + if( xFilterCFG.is() && rRequest.rProperties.getLength() ) + { + try + { + ::rtl::OUString aFilterName; + sal_Int32 nPropCount = rRequest.rProperties.getLength(); + for( sal_Int32 ind = 0; ind < nPropCount; ++ind ) + { + rtl::OUString tmp = rRequest.rProperties[ind].Name; + if( rRequest.rProperties[ind].Name.equals( + ::rtl::OUString::createFromAscii("FilterName")) ) + { + rRequest.rProperties[ind].Value >>= aFilterName; + break; + } + } + + uno::Sequence < beans::PropertyValue > aProps; + if ( xFilterCFG->getByName( aFilterName ) >>= aProps ) + { + sal_Int32 nPropertyCount = aProps.getLength(); + for( sal_Int32 nProperty=0; + nProperty < nPropertyCount; + ++nProperty ) + if( aProps[nProperty].Name.equals( + ::rtl::OUString::createFromAscii("UIComponent")) ) + { + ::rtl::OUString aServiceName; + aProps[nProperty].Value >>= aServiceName; + if( aServiceName.getLength() ) + { + uno::Reference< + ui::dialogs::XExecutableDialog > xFilterDialog( + xServiceFactory->createInstance( + aServiceName ), + uno::UNO_QUERY ); + uno::Reference< beans::XPropertyAccess > + xFilterProperties( xFilterDialog, + uno::UNO_QUERY ); + + if( xFilterDialog.is() && xFilterProperties.is() ) + { + uno::Reference< + document::XImporter > xImporter( + xFilterDialog, uno::UNO_QUERY ); + if( xImporter.is() ) + xImporter->setTargetDocument( + uno::Reference< lang::XComponent >( + rRequest.rModel, uno::UNO_QUERY ) ); + + xFilterProperties->setPropertyValues( + rRequest.rProperties ); + + if( xFilterDialog->execute() ) + { + xFilterOptions->setFilterOptions( + xFilterProperties->getPropertyValues() ); + xFilterOptions->select(); + return; + } + } + } + break; + } + } + } + catch( container::NoSuchElementException& ) + { + // the filter name is unknown + } + catch( uno::Exception& ) + { + } + } + + xAbort->select(); +} + +} // namespace + +bool +UUIInteractionHelper::handleNoSuchFilterRequest( + uno::Reference< task::XInteractionRequest > const & rRequest) + SAL_THROW((uno::RuntimeException)) +{ + uno::Any aAnyRequest(rRequest->getRequest()); + + document::NoSuchFilterRequest aNoSuchFilterRequest; + if (aAnyRequest >>= aNoSuchFilterRequest) + { + handleNoSuchFilterRequest_(getParentProperty(), + m_xServiceFactory, + aNoSuchFilterRequest, + rRequest->getContinuations()); + return true; + } + return false; +} + +bool +UUIInteractionHelper::handleAmbigousFilterRequest( + uno::Reference< task::XInteractionRequest > const & rRequest) + SAL_THROW((uno::RuntimeException)) +{ + uno::Any aAnyRequest(rRequest->getRequest()); + + document::AmbigousFilterRequest aAmbigousFilterRequest; + if (aAnyRequest >>= aAmbigousFilterRequest) + { + handleAmbigousFilterRequest_(getParentProperty(), + m_xServiceFactory, + aAmbigousFilterRequest, + rRequest->getContinuations()); + return true; + } + return false; +} + +bool +UUIInteractionHelper::handleFilterOptionsRequest( + uno::Reference< task::XInteractionRequest > const & rRequest) + SAL_THROW((uno::RuntimeException)) +{ + uno::Any aAnyRequest(rRequest->getRequest()); + + document::FilterOptionsRequest aFilterOptionsRequest; + if (aAnyRequest >>= aFilterOptionsRequest) + { + handleFilterOptionsRequest_(m_xServiceFactory, + aFilterOptionsRequest, + rRequest->getContinuations()); + return true; + } + return false; +} + + diff --git a/uui/source/iahndl-ioexceptions.cxx b/uui/source/iahndl-ioexceptions.cxx new file mode 100644 index 000000000000..b9bc7b40175a --- /dev/null +++ b/uui/source/iahndl-ioexceptions.cxx @@ -0,0 +1,346 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: iahndl.cxx,v $ + * $Revision: 1.67.22.1 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "com/sun/star/beans/PropertyValue.hpp" +#include "com/sun/star/task/XInteractionRequest.hpp" +#include "com/sun/star/ucb/InteractiveAugmentedIOException.hpp" + +#include "ids.hrc" + +#include "iahndl.hxx" + +using namespace com::sun::star; + +namespace { + +bool +getStringRequestArgument(uno::Sequence< uno::Any > const & rArguments, + rtl::OUString const & rKey, + rtl::OUString * pValue) + SAL_THROW(()) +{ + for (sal_Int32 i = 0; i < rArguments.getLength(); ++i) + { + beans::PropertyValue aProperty; + if ((rArguments[i] >>= aProperty) && aProperty.Name == rKey) + { + rtl::OUString aValue; + if (aProperty.Value >>= aValue) + { + if (pValue) + *pValue = aValue; + return true; + } + } + } + return false; +} + +bool +getBoolRequestArgument(uno::Sequence< uno::Any > const & rArguments, + rtl::OUString const & rKey, + bool * pValue) + SAL_THROW(()) +{ + for (sal_Int32 i = 0; i < rArguments.getLength(); ++i) + { + beans::PropertyValue aProperty; + if ((rArguments[i] >>= aProperty) && aProperty.Name == rKey) + { + sal_Bool bValue = sal_Bool(); + if (aProperty.Value >>= bValue) + { + if (pValue) + *pValue = bValue; + return true; + } + } + } + return false; +} + +bool +getResourceNameRequestArgument(uno::Sequence< uno::Any > const & rArguments, + rtl::OUString * pValue) + SAL_THROW(()) +{ + if (!getStringRequestArgument(rArguments, + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "Uri")), + pValue)) + return false; + // Use the resource name only for file URLs, to avoid confusion: + //TODO! work with ucp locality concept instead of hardcoded "file"? + if (pValue + && pValue->matchIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM( + "file:"))) + getStringRequestArgument(rArguments, + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "ResourceName")), + pValue); + return true; +} + +} // namespace + +bool +UUIInteractionHelper::handleInteractiveIOException( + uno::Reference< task::XInteractionRequest > const & rRequest, + bool bObtainErrorStringOnly, + bool & bHasErrorString, + rtl::OUString & rErrorString) + SAL_THROW((uno::RuntimeException)) +{ + uno::Any aAnyRequest(rRequest->getRequest()); + bHasErrorString = false; + + ucb::InteractiveIOException aIoException; + if (aAnyRequest >>= aIoException) + { + uno::Sequence< uno::Any > aRequestArguments; + ucb::InteractiveAugmentedIOException aAugmentedIoException; + if (aAnyRequest >>= aAugmentedIoException) + aRequestArguments = aAugmentedIoException.Arguments; + + ErrCode nErrorCode; + std::vector< rtl::OUString > aArguments; + static ErrCode const + aErrorCode[ucb::IOErrorCode_WRONG_VERSION + 1][2] + = { { ERRCODE_IO_ABORT, ERRCODE_UUI_IO_ABORT }, // ABORT + { ERRCODE_IO_ACCESSDENIED, ERRCODE_UUI_IO_ACCESSDENIED }, + // ACCESS_DENIED + { ERRCODE_IO_ALREADYEXISTS, + ERRCODE_UUI_IO_ALREADYEXISTS }, // ALREADY_EXISTING + { ERRCODE_IO_BADCRC, ERRCODE_UUI_IO_BADCRC }, // BAD_CRC + { ERRCODE_IO_CANTCREATE, ERRCODE_UUI_IO_CANTCREATE }, + // CANT_CREATE + { ERRCODE_IO_CANTREAD, ERRCODE_UUI_IO_CANTREAD }, + // CANT_READ + { ERRCODE_IO_CANTSEEK, ERRCODE_UUI_IO_CANTSEEK }, + // CANT_SEEK + { ERRCODE_IO_CANTTELL, ERRCODE_UUI_IO_CANTTELL }, + // CANT_TELL + { ERRCODE_IO_CANTWRITE, ERRCODE_UUI_IO_CANTWRITE }, + // CANT_WRITE + { ERRCODE_IO_CURRENTDIR, ERRCODE_UUI_IO_CURRENTDIR }, + // CURRENT_DIRECTORY + { ERRCODE_IO_DEVICENOTREADY, ERRCODE_UUI_IO_NOTREADY }, + // DEVICE_NOT_READY + { ERRCODE_IO_NOTSAMEDEVICE, + ERRCODE_UUI_IO_NOTSAMEDEVICE }, // DIFFERENT_DEVICES + { ERRCODE_IO_GENERAL, ERRCODE_UUI_IO_GENERAL }, // GENERAL + { ERRCODE_IO_INVALIDACCESS, + ERRCODE_UUI_IO_INVALIDACCESS }, // INVALID_ACCESS + { ERRCODE_IO_INVALIDCHAR, ERRCODE_UUI_IO_INVALIDCHAR }, + // INVALID_CHARACTER + { ERRCODE_IO_INVALIDDEVICE, + ERRCODE_UUI_IO_INVALIDDEVICE }, // INVALID_DEVICE + { ERRCODE_IO_INVALIDLENGTH, + ERRCODE_UUI_IO_INVALIDLENGTH }, // INVALID_LENGTH + { ERRCODE_IO_INVALIDPARAMETER, + ERRCODE_UUI_IO_INVALIDPARAMETER }, // INVALID_PARAMETER + { ERRCODE_IO_ISWILDCARD, ERRCODE_UUI_IO_ISWILDCARD }, + // IS_WILDCARD + { ERRCODE_IO_LOCKVIOLATION, + ERRCODE_UUI_IO_LOCKVIOLATION }, // LOCKING_VIOLATION + { ERRCODE_IO_MISPLACEDCHAR, + ERRCODE_UUI_IO_MISPLACEDCHAR }, // MISPLACED_CHARACTER + { ERRCODE_IO_NAMETOOLONG, ERRCODE_UUI_IO_NAMETOOLONG }, + // NAME_TOO_LONG + { ERRCODE_IO_NOTEXISTS, ERRCODE_UUI_IO_NOTEXISTS }, + // NOT_EXISTING + { ERRCODE_IO_NOTEXISTSPATH, + ERRCODE_UUI_IO_NOTEXISTSPATH }, // NOT_EXISTING_PATH + { ERRCODE_IO_NOTSUPPORTED, ERRCODE_UUI_IO_NOTSUPPORTED }, + // NOT_SUPPORTED + { ERRCODE_IO_NOTADIRECTORY, + ERRCODE_UUI_IO_NOTADIRECTORY }, // NO_DIRECTORY + { ERRCODE_IO_NOTAFILE, ERRCODE_UUI_IO_NOTAFILE }, + // NO_FILE + { ERRCODE_IO_OUTOFSPACE, ERRCODE_UUI_IO_OUTOFSPACE }, + // OUT_OF_DISK_SPACE + { ERRCODE_IO_TOOMANYOPENFILES, + ERRCODE_UUI_IO_TOOMANYOPENFILES }, + // OUT_OF_FILE_HANDLES + { ERRCODE_IO_OUTOFMEMORY, ERRCODE_UUI_IO_OUTOFMEMORY }, + // OUT_OF_MEMORY + { ERRCODE_IO_PENDING, ERRCODE_UUI_IO_PENDING }, // PENDING + { ERRCODE_IO_RECURSIVE, ERRCODE_UUI_IO_RECURSIVE }, + // RECURSIVE + { ERRCODE_IO_UNKNOWN, ERRCODE_UUI_IO_UNKNOWN }, // UNKNOWN + { ERRCODE_IO_WRITEPROTECTED, + ERRCODE_UUI_IO_WRITEPROTECTED }, // WRITE_PROTECTED + { ERRCODE_IO_WRONGFORMAT, ERRCODE_UUI_IO_WRONGFORMAT }, + // WRONG_FORMAT + { ERRCODE_IO_WRONGVERSION, + ERRCODE_UUI_IO_WRONGVERSION } }; // WRONG_VERSION + switch (aIoException.Code) + { + case ucb::IOErrorCode_CANT_CREATE: + { + rtl::OUString aArgFolder; + if (getStringRequestArgument( + aRequestArguments, + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "Folder")), + &aArgFolder)) + { + rtl::OUString aArgUri; + if (getResourceNameRequestArgument(aRequestArguments, + &aArgUri)) + { + nErrorCode = ERRCODE_UUI_IO_CANTCREATE; + aArguments.reserve(2); + aArguments.push_back(aArgUri); + aArguments.push_back(aArgFolder); + } + else + { + nErrorCode = ERRCODE_UUI_IO_CANTCREATE_NONAME; + aArguments.push_back(aArgFolder); + } + } + else + nErrorCode = aErrorCode[aIoException.Code][0]; + break; + } + + case ucb::IOErrorCode_DEVICE_NOT_READY: + { + rtl::OUString aArgUri; + if (getResourceNameRequestArgument(aRequestArguments, + &aArgUri)) + { + rtl::OUString aResourceType; + getStringRequestArgument( + aRequestArguments, + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "ResourceType")), + &aResourceType); + bool bRemovable = false; + getBoolRequestArgument(aRequestArguments, + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + "Removable")), + &bRemovable); + nErrorCode + = aResourceType.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("volume")) + ? (bRemovable + ? ERRCODE_UUI_IO_NOTREADY_VOLUME_REMOVABLE + : ERRCODE_UUI_IO_NOTREADY_VOLUME) + : (bRemovable + ? ERRCODE_UUI_IO_NOTREADY_REMOVABLE + : ERRCODE_UUI_IO_NOTREADY); + aArguments.push_back(aArgUri); + } + else + nErrorCode = aErrorCode[aIoException.Code][0]; + break; + } + + case ucb::IOErrorCode_DIFFERENT_DEVICES: + { + rtl::OUString aArgVolume; + rtl::OUString aArgOtherVolume; + if (getStringRequestArgument( + aRequestArguments, + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "Volume")), + &aArgVolume) + && getStringRequestArgument( + aRequestArguments, + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "OtherVolume")), + &aArgOtherVolume)) + { + nErrorCode = aErrorCode[aIoException.Code][1]; + aArguments.reserve(2); + aArguments.push_back(aArgVolume); + aArguments.push_back(aArgOtherVolume); + } + else + nErrorCode = aErrorCode[aIoException.Code][0]; + break; + } + + case ucb::IOErrorCode_NOT_EXISTING: + { + rtl::OUString aArgUri; + if (getResourceNameRequestArgument(aRequestArguments, + &aArgUri)) + { + rtl::OUString aResourceType; + getStringRequestArgument( + aRequestArguments, + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( + "ResourceType")), + &aResourceType); + nErrorCode + = aResourceType.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("volume")) + ? ERRCODE_UUI_IO_NOTEXISTS_VOLUME + : (aResourceType.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("folder")) + ? ERRCODE_UUI_IO_NOTEXISTS_FOLDER + : ERRCODE_UUI_IO_NOTEXISTS); + aArguments.push_back(aArgUri); + } + else + nErrorCode = aErrorCode[aIoException.Code][0]; + break; + } + + default: + { + rtl::OUString aArgUri; + if (getResourceNameRequestArgument(aRequestArguments, + &aArgUri)) + { + nErrorCode = aErrorCode[aIoException.Code][1]; + aArguments.push_back(aArgUri); + } + else + nErrorCode = aErrorCode[aIoException.Code][0]; + break; + } + } + + handleErrorHandlerRequest(aIoException.Classification, + nErrorCode, + aArguments, + rRequest->getContinuations(), + bObtainErrorStringOnly, + bHasErrorString, + rErrorString); + return true; + } + return false; +} diff --git a/uui/source/iahndl-locking.cxx b/uui/source/iahndl-locking.cxx new file mode 100644 index 000000000000..48409235d64f --- /dev/null +++ b/uui/source/iahndl-locking.cxx @@ -0,0 +1,319 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: $ + * $Revision: $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include + +#include "com/sun/star/document/ChangedByOthersRequest.hpp" +#include "com/sun/star/document/LockedDocumentRequest.hpp" +#include "com/sun/star/document/LockedOnSavingRequest.hpp" +#include "com/sun/star/document/LockFileIgnoreRequest.hpp" +#include "com/sun/star/document/OwnLockOnDocumentRequest.hpp" +#include "com/sun/star/task/XInteractionApprove.hpp" +#include "com/sun/star/task/XInteractionDisapprove.hpp" +#include "com/sun/star/task/XInteractionAbort.hpp" +#include "com/sun/star/task/XInteractionRequest.hpp" + +#include "vos/mutex.hxx" +#include "vcl/svapp.hxx" +#include "vcl/msgbox.hxx" + +#include "ids.hrc" +#include "getcontinuations.hxx" +#include "openlocked.hxx" +#include "trylater.hxx" +#include "alreadyopen.hxx" +#include "filechanged.hxx" +#include "lockfailed.hxx" + +#include "iahndl.hxx" + +#define UUI_DOC_LOAD_LOCK 0 +#define UUI_DOC_OWN_LOAD_LOCK 1 +#define UUI_DOC_SAVE_LOCK 2 +#define UUI_DOC_OWN_SAVE_LOCK 3 + +using namespace com::sun::star; + +namespace { + +void +handleLockedDocumentRequest_( + Window * pParent, + const ::rtl::OUString& aDocumentURL, + const ::rtl::OUString& aInfo, + uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & + rContinuations, + sal_uInt16 nMode ) + SAL_THROW((uno::RuntimeException)) +{ + uno::Reference< task::XInteractionApprove > xApprove; + uno::Reference< task::XInteractionDisapprove > xDisapprove; + uno::Reference< task::XInteractionAbort > xAbort; + getContinuations(rContinuations, &xApprove, &xDisapprove, &xAbort); + + if ( !xApprove.is() || !xDisapprove.is() || !xAbort.is() ) + return; + + try + { + vos::OGuard aGuard(Application::GetSolarMutex()); + std::auto_ptr< ResMgr > xManager( + ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); + if (!xManager.get()) + return; + + ::rtl::OUString aMessage; + std::vector< rtl::OUString > aArguments; + aArguments.push_back( aDocumentURL ); + + sal_Int32 nResult = RET_CANCEL; + if ( nMode == UUI_DOC_LOAD_LOCK ) + { + aArguments.push_back( aInfo.getLength() + ? aInfo + : ::rtl::OUString( String( + ResId( STR_UNKNOWNUSER, + *xManager.get() ) ) ) ); + aMessage = String( ResId( STR_OPENLOCKED_MSG, *xManager.get() ) ); + aMessage = UUIInteractionHelper::replaceMessageWithArguments( + aMessage, aArguments ); + + std::auto_ptr< OpenLockedQueryBox > xDialog(new OpenLockedQueryBox( + pParent, xManager.get(), aMessage ) ); + nResult = xDialog->Execute(); + } + else if ( nMode == UUI_DOC_SAVE_LOCK ) + { + aArguments.push_back( aInfo.getLength() + ? aInfo + : ::rtl::OUString( String( + ResId( STR_UNKNOWNUSER, + *xManager.get() ) ) ) ); + aMessage = String( ResId( STR_TRYLATER_MSG, *xManager.get() ) ); + aMessage = UUIInteractionHelper::replaceMessageWithArguments( + aMessage, aArguments ); + + std::auto_ptr< TryLaterQueryBox > xDialog( + new TryLaterQueryBox( pParent, xManager.get(), aMessage ) ); + nResult = xDialog->Execute(); + } + else if ( nMode == UUI_DOC_OWN_LOAD_LOCK || + nMode == UUI_DOC_OWN_SAVE_LOCK ) + { + aArguments.push_back( aInfo ); + aMessage = String( ResId( nMode == UUI_DOC_OWN_SAVE_LOCK + ? STR_ALREADYOPEN_SAVE_MSG + : STR_ALREADYOPEN_MSG, + *xManager.get() ) ); + aMessage = UUIInteractionHelper::replaceMessageWithArguments( + aMessage, aArguments ); + + std::auto_ptr< AlreadyOpenQueryBox > xDialog( + new AlreadyOpenQueryBox( pParent, + xManager.get(), + aMessage, + nMode == UUI_DOC_OWN_SAVE_LOCK ) ); + nResult = xDialog->Execute(); + } + + if ( nResult == RET_YES ) + xApprove->select(); + else if ( nResult == RET_NO ) + xDisapprove->select(); + else + xAbort->select(); + } + catch (std::bad_alloc const &) + { + throw uno::RuntimeException( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")), + uno::Reference< uno::XInterface >()); + } +} + +void +handleChangedByOthersRequest_( + Window * pParent, + uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & + rContinuations ) + SAL_THROW((uno::RuntimeException)) +{ + uno::Reference< task::XInteractionApprove > xApprove; + uno::Reference< task::XInteractionAbort > xAbort; + getContinuations(rContinuations, &xApprove, &xAbort); + + if ( !xApprove.is() || !xAbort.is() ) + return; + + try + { + vos::OGuard aGuard(Application::GetSolarMutex()); + std::auto_ptr< ResMgr > xManager( + ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); + if (!xManager.get()) + return; + + std::auto_ptr< FileChangedQueryBox > xDialog( + new FileChangedQueryBox( pParent, xManager.get() ) ); + sal_Int32 nResult = xDialog->Execute(); + + if ( nResult == RET_YES ) + xApprove->select(); + else + xAbort->select(); + } + catch (std::bad_alloc const &) + { + throw uno::RuntimeException( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")), + uno::Reference< uno::XInterface >()); + } +} + +void +handleLockFileIgnoreRequest_( + Window * pParent, + uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & + rContinuations ) + SAL_THROW((uno::RuntimeException)) +{ + uno::Reference< task::XInteractionApprove > xApprove; + uno::Reference< task::XInteractionAbort > xAbort; + getContinuations(rContinuations, &xApprove, &xAbort); + + if ( !xApprove.is() || !xAbort.is() ) + return; + + try + { + vos::OGuard aGuard(Application::GetSolarMutex()); + std::auto_ptr< ResMgr > xManager( + ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); + if (!xManager.get()) + return; + + std::auto_ptr< LockFailedQueryBox > xDialog( + new LockFailedQueryBox( pParent, xManager.get() ) ); + sal_Int32 nResult = xDialog->Execute(); + + if ( nResult == RET_OK ) + xApprove->select(); + else + xAbort->select(); + } + catch (std::bad_alloc const &) + { + throw uno::RuntimeException( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")), + uno::Reference< uno::XInterface >()); + } +} + +} // namespace + +bool +UUIInteractionHelper::handleLockedDocumentRequest( + uno::Reference< task::XInteractionRequest > const & rRequest) + SAL_THROW((::com::sun::star::uno::RuntimeException)) +{ + uno::Any aAnyRequest(rRequest->getRequest()); + + document::LockedDocumentRequest aLockedDocumentRequest; + if (aAnyRequest >>= aLockedDocumentRequest ) + { + handleLockedDocumentRequest_( getParentProperty(), + aLockedDocumentRequest.DocumentURL, + aLockedDocumentRequest.UserInfo, + rRequest->getContinuations(), + UUI_DOC_LOAD_LOCK ); + return true; + } + + document::OwnLockOnDocumentRequest aOwnLockOnDocumentRequest; + if (aAnyRequest >>= aOwnLockOnDocumentRequest ) + { + handleLockedDocumentRequest_( getParentProperty(), + aOwnLockOnDocumentRequest.DocumentURL, + aOwnLockOnDocumentRequest.TimeInfo, + rRequest->getContinuations(), + aOwnLockOnDocumentRequest.IsStoring + ? UUI_DOC_OWN_SAVE_LOCK + : UUI_DOC_OWN_LOAD_LOCK ); + return true; + } + + document::LockedOnSavingRequest aLockedOnSavingRequest; + if (aAnyRequest >>= aLockedOnSavingRequest ) + { + handleLockedDocumentRequest_( getParentProperty(), + aLockedOnSavingRequest.DocumentURL, + aLockedOnSavingRequest.UserInfo, + rRequest->getContinuations(), + UUI_DOC_SAVE_LOCK ); + return true; + } + return false; +} + +bool +UUIInteractionHelper::handleChangedByOthersRequest( + uno::Reference< task::XInteractionRequest > const & rRequest) + SAL_THROW((uno::RuntimeException)) +{ + uno::Any aAnyRequest(rRequest->getRequest()); + + document::ChangedByOthersRequest aChangedByOthersRequest; + if (aAnyRequest >>= aChangedByOthersRequest ) + { + handleChangedByOthersRequest_( getParentProperty(), + rRequest->getContinuations() ); + return true; + } + return false; +} + +bool +UUIInteractionHelper::handleLockFileIgnoreRequest( + uno::Reference< task::XInteractionRequest > const & rRequest) + SAL_THROW((uno::RuntimeException)) +{ + uno::Any aAnyRequest(rRequest->getRequest()); + + document::LockFileIgnoreRequest aLockFileIgnoreRequest; + if (aAnyRequest >>= aLockFileIgnoreRequest ) + { + handleLockFileIgnoreRequest_( getParentProperty(), + rRequest->getContinuations() ); + return true; + } + return false; +} + + diff --git a/uui/source/iahndl-ssl.cxx b/uui/source/iahndl-ssl.cxx new file mode 100644 index 000000000000..7788d1e0995d --- /dev/null +++ b/uui/source/iahndl-ssl.cxx @@ -0,0 +1,360 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: $ + * $Revision: $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "com/sun/star/security/CertificateValidity.hpp" +#include "com/sun/star/task/XInteractionAbort.hpp" +#include "com/sun/star/task/XInteractionApprove.hpp" +#include "com/sun/star/task/XInteractionRequest.hpp" +#include "com/sun/star/ucb/CertificateValidationRequest.hpp" + +#include "vos/mutex.hxx" +#include "tools/datetime.hxx" +#include "svtools/zforlist.hxx" +#include "vcl/svapp.hxx" + +#include "ids.hrc" +#include "getcontinuations.hxx" +#include "sslwarndlg.hxx" +#include "unknownauthdlg.hxx" + +#include "iahndl.hxx" + +#define DESCRIPTION_1 1 +#define DESCRIPTION_2 2 +#define TITLE 3 + +using namespace com::sun::star; + +namespace { + +String +getContentPart( const String& _rRawString ) +{ + // search over some parts to find a string + //static char* aIDs[] = { "CN", "OU", "O", "E", NULL }; + static char const * aIDs[] = { "CN=", "OU=", "O=", "E=", NULL };// By CP + String sPart; + int i = 0; + while ( aIDs[i] ) + { + String sPartId = String::CreateFromAscii( aIDs[i++] ); + xub_StrLen nContStart = _rRawString.Search( sPartId ); + if ( nContStart != STRING_NOTFOUND ) + { + nContStart = nContStart + sPartId.Len(); + xub_StrLen nContEnd + = _rRawString.Search( sal_Unicode( ',' ), nContStart ); + sPart = String( _rRawString, nContStart, nContEnd - nContStart ); + break; + } + } + return sPart; +} + +bool +isDomainMatch( + rtl::OUString hostName, rtl::OUString certHostName) +{ + if (hostName.equalsIgnoreAsciiCase( certHostName )) + return true; + + if ( 0 == certHostName.indexOf( rtl::OUString::createFromAscii( "*" ) ) && + hostName.getLength() >= certHostName.getLength() ) + { + rtl::OUString cmpStr = certHostName.copy( 1 ); + + if ( hostName.matchIgnoreAsciiCase( + cmpStr, hostName.getLength() - cmpStr.getLength()) ) + return true; + } + + return false; +} + +rtl::OUString +getLocalizedDatTimeStr( + uno::Reference< lang::XMultiServiceFactory > const & xServiceFactory, + util::DateTime const & rDateTime ) +{ + rtl::OUString aDateTimeStr; + Date aDate; + Time aTime; + + aDate = Date( rDateTime.Day, rDateTime.Month, rDateTime.Year ); + aTime = Time( rDateTime.Hours, rDateTime.Minutes, rDateTime.Seconds ); + + LanguageType eUILang = Application::GetSettings().GetUILanguage(); + SvNumberFormatter *pNumberFormatter + = new SvNumberFormatter( xServiceFactory, eUILang ); + String aTmpStr; + Color* pColor = NULL; + Date* pNullDate = pNumberFormatter->GetNullDate(); + sal_uInt32 nFormat + = pNumberFormatter->GetStandardFormat( NUMBERFORMAT_DATE, eUILang ); + + pNumberFormatter->GetOutputString( + aDate - *pNullDate, nFormat, aTmpStr, &pColor ); + aDateTimeStr = aTmpStr + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ")); + + nFormat = pNumberFormatter->GetStandardFormat( NUMBERFORMAT_TIME, eUILang ); + pNumberFormatter->GetOutputString( + aTime.GetTimeInDays(), nFormat, aTmpStr, &pColor ); + aDateTimeStr += aTmpStr; + + return aDateTimeStr; +} + +sal_Bool +executeUnknownAuthDialog( + Window * pParent, + uno::Reference< lang::XMultiServiceFactory > const & xServiceFactory, + const uno::Reference< security::XCertificate >& rXCert) + SAL_THROW((uno::RuntimeException)) +{ + try + { + vos::OGuard aGuard(Application::GetSolarMutex()); + + std::auto_ptr< ResMgr > xManager( + ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); + std::auto_ptr< UnknownAuthDialog > xDialog( + new UnknownAuthDialog( pParent, + rXCert, + xServiceFactory, + xManager.get())); + + // Get correct ressource string + rtl::OUString aMessage; + + std::vector< rtl::OUString > aArguments; + aArguments.push_back( getContentPart( rXCert->getSubjectName()) ); + + if (xManager.get()) + { + ResId aResId(RID_UUI_ERRHDL, *xManager.get()); + if (ErrorResource(aResId).getString( + ERRCODE_UUI_UNKNOWNAUTH_UNTRUSTED, &aMessage)) + { + aMessage = UUIInteractionHelper::replaceMessageWithArguments( + aMessage, aArguments ); + xDialog->setDescriptionText( aMessage ); + } + } + + return static_cast (xDialog->Execute()); + } + catch (std::bad_alloc const &) + { + throw uno::RuntimeException( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")), + uno::Reference< uno::XInterface >()); + } +} + +sal_Bool +executeSSLWarnDialog( + Window * pParent, + uno::Reference< lang::XMultiServiceFactory > const & xServiceFactory, + const uno::Reference< security::XCertificate >& rXCert, + sal_Int32 const & failure, + const rtl::OUString & hostName ) + SAL_THROW((uno::RuntimeException)) +{ + try + { + vos::OGuard aGuard(Application::GetSolarMutex()); + + std::auto_ptr< ResMgr > xManager( + ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); + std::auto_ptr< SSLWarnDialog > xDialog( + new SSLWarnDialog( pParent, + rXCert, + xServiceFactory, + xManager.get())); + + // Get correct ressource string + rtl::OUString aMessage_1; + std::vector< rtl::OUString > aArguments_1; + + switch( failure ) + { + case SSLWARN_TYPE_DOMAINMISMATCH: + aArguments_1.push_back( hostName ); + aArguments_1.push_back( + getContentPart( rXCert->getSubjectName()) ); + aArguments_1.push_back( hostName ); + break; + case SSLWARN_TYPE_EXPIRED: + aArguments_1.push_back( + getContentPart( rXCert->getSubjectName()) ); + aArguments_1.push_back( + getLocalizedDatTimeStr( xServiceFactory, + rXCert->getNotValidAfter() ) ); + aArguments_1.push_back( + getLocalizedDatTimeStr( xServiceFactory, + rXCert->getNotValidAfter() ) ); + break; + case SSLWARN_TYPE_INVALID: + break; + } + + if (xManager.get()) + { + ResId aResId(RID_UUI_ERRHDL, *xManager.get()); + if (ErrorResource(aResId).getString( + ERRCODE_AREA_UUI_UNKNOWNAUTH + failure + DESCRIPTION_1, + &aMessage_1)) + { + aMessage_1 = UUIInteractionHelper::replaceMessageWithArguments( + aMessage_1, aArguments_1 ); + xDialog->setDescription1Text( aMessage_1 ); + } + + rtl::OUString aTitle; + ErrorResource(aResId).getString( + ERRCODE_AREA_UUI_UNKNOWNAUTH + failure + TITLE, &aTitle); + xDialog->SetText( aTitle ); + } + + return static_cast (xDialog->Execute()); + } + catch (std::bad_alloc const &) + { + throw uno::RuntimeException( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")), + uno::Reference< uno::XInterface >()); + } +} + +void +handleCertificateValidationRequest_( + Window * pParent, + uno::Reference< lang::XMultiServiceFactory > const & xServiceFactory, + ucb::CertificateValidationRequest const & rRequest, + uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & + rContinuations) + SAL_THROW((uno::RuntimeException)) +{ + uno::Reference< task::XInteractionApprove > xApprove; + uno::Reference< task::XInteractionAbort > xAbort; + getContinuations(rContinuations, &xApprove, &xAbort); + + sal_Int32 failures = rRequest.CertificateValidity; + sal_Bool trustCert = sal_True; + + if ( ((failures & security::CertificateValidity::UNTRUSTED) + == security::CertificateValidity::UNTRUSTED ) || + ((failures & security::CertificateValidity::ISSUER_UNTRUSTED) + == security::CertificateValidity::ISSUER_UNTRUSTED) || + ((failures & security::CertificateValidity::ROOT_UNTRUSTED) + == security::CertificateValidity::ROOT_UNTRUSTED) ) + { + trustCert = executeUnknownAuthDialog( pParent, + xServiceFactory, + rRequest.Certificate ); + } + + if ( (!isDomainMatch( + rRequest.HostName, + getContentPart( + rRequest.Certificate->getSubjectName()) )) && + trustCert ) + { + trustCert = executeSSLWarnDialog( pParent, + xServiceFactory, + rRequest.Certificate, + SSLWARN_TYPE_DOMAINMISMATCH, + rRequest.HostName ); + } + + if ( (((failures & security::CertificateValidity::TIME_INVALID) + == security::CertificateValidity::TIME_INVALID) || + ((failures & security::CertificateValidity::NOT_TIME_NESTED) + == security::CertificateValidity::NOT_TIME_NESTED)) && + trustCert ) + { + trustCert = executeSSLWarnDialog( pParent, + xServiceFactory, + rRequest.Certificate, + SSLWARN_TYPE_EXPIRED, + rRequest.HostName ); + } + + if ( (((failures & security::CertificateValidity::REVOKED) + == security::CertificateValidity::REVOKED) || + ((failures & security::CertificateValidity::SIGNATURE_INVALID) + == security::CertificateValidity::SIGNATURE_INVALID) || + ((failures & security::CertificateValidity::EXTENSION_INVALID) + == security::CertificateValidity::EXTENSION_INVALID) || + ((failures & security::CertificateValidity::INVALID) + == security::CertificateValidity::INVALID)) && + trustCert ) + { + trustCert = executeSSLWarnDialog( pParent, + xServiceFactory, + rRequest.Certificate, + SSLWARN_TYPE_INVALID, + rRequest.HostName ); + } + + if ( trustCert ) + { + if (xApprove.is()) + xApprove->select(); + } + else + { + if (xAbort.is()) + xAbort->select(); + } +} + +} // namespace + +bool +UUIInteractionHelper::handleCertificateValidationRequest( + uno::Reference< task::XInteractionRequest > const & rRequest) + SAL_THROW((uno::RuntimeException)) +{ + uno::Any aAnyRequest(rRequest->getRequest()); + + ucb::CertificateValidationRequest aCertificateValidationRequest; + if (aAnyRequest >>= aCertificateValidationRequest) + { + handleCertificateValidationRequest_(getParentProperty(), + m_xServiceFactory, + aCertificateValidationRequest, + rRequest->getContinuations()); + return true; + } + + return false; +} + diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx index d6f414569a20..2cb0a5764ad0 100644 --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -28,361 +28,87 @@ * ************************************************************************/ -#include "iahndl.hxx" - #include -#include "osl/diagnose.h" -#include "osl/conditn.hxx" -#include "rtl/digest.h" -#include "rtl/ustrbuf.hxx" +#include "com/sun/star/awt/XWindow.hpp" #include "com/sun/star/beans/PropertyValue.hpp" -#include "com/sun/star/beans/XPropertyAccess.hpp" #include "com/sun/star/configuration/backend/MergeRecoveryRequest.hpp" #include "com/sun/star/configuration/backend/StratumCreationException.hpp" #include "com/sun/star/container/XHierarchicalNameAccess.hpp" -#include "com/sun/star/container/XContainerQuery.hpp" -#include "com/sun/star/container/XNameAccess.hpp" -#include "com/sun/star/container/XNameContainer.hpp" #include "com/sun/star/document/BrokenPackageRequest.hpp" -#include "com/sun/star/document/FilterOptionsRequest.hpp" -#include "com/sun/star/document/NoSuchFilterRequest.hpp" -#include "com/sun/star/document/AmbigousFilterRequest.hpp" -#include "com/sun/star/document/LockedDocumentRequest.hpp" -#include "com/sun/star/document/OwnLockOnDocumentRequest.hpp" -#include "com/sun/star/document/LockedOnSavingRequest.hpp" -#include "com/sun/star/document/ChangedByOthersRequest.hpp" -#include "com/sun/star/document/LockFileIgnoreRequest.hpp" -#include "com/sun/star/document/XImporter.hpp" -#include "com/sun/star/document/XInteractionFilterOptions.hpp" -#include "com/sun/star/document/XInteractionFilterSelect.hpp" +#include "com/sun/star/task/DocumentMacroConfirmationRequest.hpp" +#include "com/sun/star/task/DocumentMacroConfirmationRequest2.hpp" #include "com/sun/star/java/WrongJavaVersionException.hpp" +#include "com/sun/star/lang/XInitialization.hpp" #include "com/sun/star/lang/XMultiServiceFactory.hpp" #include "com/sun/star/script/ModuleSizeExceededRequest.hpp" #include "com/sun/star/sync2/BadPartnershipException.hpp" -#include "com/sun/star/task/XInteractionHandler.hpp" -#include "com/sun/star/task/XInteractionHandler2.hpp" -#include "com/sun/star/task/DocumentPasswordRequest.hpp" -#include "com/sun/star/task/DocumentMSPasswordRequest.hpp" +#include "com/sun/star/task/DocumentMacroConfirmationRequest2.hpp" #include "com/sun/star/task/ErrorCodeIOException.hpp" #include "com/sun/star/task/ErrorCodeRequest.hpp" -#include "com/sun/star/task/MasterPasswordRequest.hpp" -#include "com/sun/star/task/DocumentMacroConfirmationRequest.hpp" -#include "com/sun/star/task/DocumentMacroConfirmationRequest2.hpp" +#include "com/sun/star/task/FutureDocumentVersionProductUpdateRequest.hpp" #include "com/sun/star/task/XInteractionAbort.hpp" #include "com/sun/star/task/XInteractionApprove.hpp" +#include "com/sun/star/task/XInteractionAskLater.hpp" #include "com/sun/star/task/XInteractionDisapprove.hpp" -#include "com/sun/star/task/XInteractionPassword.hpp" +#include "com/sun/star/task/XInteractionHandler2.hpp" #include "com/sun/star/task/XInteractionRequest.hpp" #include "com/sun/star/task/XInteractionRetry.hpp" -#include "com/sun/star/task/XInteractionAskLater.hpp" -#include "com/sun/star/ucb/AuthenticationRequest.hpp" -#include "com/sun/star/ucb/URLAuthenticationRequest.hpp" -#include "com/sun/star/ucb/CertificateValidationRequest.hpp" -#include "com/sun/star/ucb/HandleCookiesRequest.hpp" #include "com/sun/star/ucb/InteractiveAppException.hpp" -#include "com/sun/star/ucb/InteractiveAugmentedIOException.hpp" #include "com/sun/star/ucb/InteractiveCHAOSException.hpp" #include "com/sun/star/ucb/InteractiveLockingLockedException.hpp" #include "com/sun/star/ucb/InteractiveLockingNotLockedException.hpp" #include "com/sun/star/ucb/InteractiveLockingLockExpiredException.hpp" #include "com/sun/star/ucb/InteractiveNetworkConnectException.hpp" -#include "com/sun/star/ucb/InteractiveNetworkException.hpp" -#include "com/sun/star/ucb/InteractiveNetworkGeneralException.hpp" #include "com/sun/star/ucb/InteractiveNetworkOffLineException.hpp" #include "com/sun/star/ucb/InteractiveNetworkReadException.hpp" #include "com/sun/star/ucb/InteractiveNetworkResolveNameException.hpp" #include "com/sun/star/ucb/InteractiveNetworkWriteException.hpp" #include "com/sun/star/ucb/InteractiveWrongMediumException.hpp" -#include "com/sun/star/ucb/IOErrorCode.hpp" #include "com/sun/star/ucb/NameClashException.hpp" #include "com/sun/star/ucb/NameClashResolveRequest.hpp" #include "com/sun/star/ucb/UnsupportedNameClashException.hpp" -#include "com/sun/star/ucb/XInteractionCookieHandling.hpp" #include "com/sun/star/ucb/XInteractionReplaceExistingData.hpp" -#include "com/sun/star/ucb/XInteractionSupplyAuthentication.hpp" -#include "com/sun/star/ucb/XInteractionSupplyAuthentication2.hpp" #include "com/sun/star/ucb/XInteractionSupplyName.hpp" -#include "com/sun/star/ui/dialogs/XExecutableDialog.hpp" -#include "com/sun/star/uno/RuntimeException.hpp" #include "com/sun/star/xforms/InvalidDataOnSubmitException.hpp" -#include "com/sun/star/security/CertificateValidity.hpp" -#include "com/sun/star/lang/XInitialization.hpp" +#include "osl/conditn.hxx" +#include "tools/rcid.h" // RSC_STRING +#include "tools/errinf.hxx" // ErrorHandler, ErrorContext, ... #include "vos/mutex.hxx" -#include "tools/rcid.h" +#include "comphelper/documentconstants.hxx" // ODFVER_012_TEXT +#include "svtools/sfxecode.hxx" // ERRCODE_SFX_* +#include "vcl/msgbox.hxx" #include "vcl/svapp.hxx" -#include "svtools/svtools.hrc" -#include "svtools/httpcook.hxx" -#include "svtools/sfxecode.hxx" -#include "svtools/zforlist.hxx" -#include "toolkit/helper/vclunohelper.hxx" -#include "comphelper/sequenceashashmap.hxx" -#include "comphelper/documentconstants.hxx" #include "unotools/configmgr.hxx" +#include "toolkit/helper/vclunohelper.hxx" #include "ids.hrc" -#include "cookiedg.hxx" + +#include "getcontinuations.hxx" #include "secmacrowarnings.hxx" -#include "masterpasscrtdlg.hxx" -#include "masterpassworddlg.hxx" -#include "logindlg.hxx" -#include "passcrtdlg.hxx" -#include "passworddlg.hxx" -#include "unknownauthdlg.hxx" -#include "sslwarndlg.hxx" -#include "openlocked.hxx" #include "newerverwarn.hxx" -#include "alreadyopen.hxx" -#include "filechanged.hxx" -#include "trylater.hxx" -#include "lockfailed.hxx" -#include "loginerr.hxx" -#include "passwordcontainer.hxx" + +#include "iahndl.hxx" using namespace com::sun::star; namespace { -class CookieList: public List -{ -public: - ~CookieList() SAL_THROW(()); -}; - -CookieList::~CookieList() SAL_THROW(()) -{ - while (Count() != 0) - delete static_cast< CntHTTPCookie * >(Remove(Count() - 1)); -} - -class ErrorResource: private Resource +class HandleData : public osl::Condition { public: - inline ErrorResource(ResId & rResId) SAL_THROW(()): Resource(rResId) {} - - inline ~ErrorResource() SAL_THROW(()) { FreeResource(); } - - bool getString(ErrCode nErrorCode, rtl::OUString * pString) const - SAL_THROW(()); -}; - -bool ErrorResource::getString(ErrCode nErrorCode, rtl::OUString * pString) - const SAL_THROW(()) -{ - OSL_ENSURE(pString, "specification violation"); - ResId aResId(static_cast< USHORT >(nErrorCode & ERRCODE_RES_MASK), - *m_pResMgr); - aResId.SetRT(RSC_STRING); - if (!IsAvailableRes(aResId)) - return false; - aResId.SetAutoRelease(false); - *pString = UniString(aResId); - m_pResMgr->PopContext(); - return true; -} - -template< class t1 > -bool setContinuation( - uno::Reference< task::XInteractionContinuation > const & rContinuation, - uno::Reference< t1 > * pContinuation) -{ - if (pContinuation && !pContinuation->is()) - { - pContinuation->set(rContinuation, uno::UNO_QUERY); - if (pContinuation->is()) - return true; - } - return false; -} - -template< class t1, class t2 > -void getContinuations( - uno::Sequence< uno::Reference< - task::XInteractionContinuation > > const & rContinuations, - uno::Reference< t1 > * pContinuation1, - uno::Reference< t2 > * pContinuation2) -{ - for (sal_Int32 i = 0; i < rContinuations.getLength(); ++i) - { - if (setContinuation(rContinuations[i], pContinuation1)) - continue; - if (setContinuation(rContinuations[i], pContinuation2)) - continue; - } -} - -template< class t1, class t2, class t3 > -void getContinuations( - uno::Sequence< uno::Reference< - task::XInteractionContinuation > > const & rContinuations, - uno::Reference< t1 > * pContinuation1, - uno::Reference< t2 > * pContinuation2, - uno::Reference< t3 > * pContinuation3) -{ - for (sal_Int32 i = 0; i < rContinuations.getLength(); ++i) - { - if (setContinuation(rContinuations[i], pContinuation1)) - continue; - if (setContinuation(rContinuations[i], pContinuation2)) - continue; - if (setContinuation(rContinuations[i], pContinuation3)) - continue; - } -} - -template< class t1, class t2, class t3, class t4 > -void getContinuations( - uno::Sequence< uno::Reference< - task::XInteractionContinuation > > const & rContinuations, - uno::Reference< t1 > * pContinuation1, - uno::Reference< t2 > * pContinuation2, - uno::Reference< t3 > * pContinuation3, - uno::Reference< t4 > * pContinuation4) -{ - for (sal_Int32 i = 0; i < rContinuations.getLength(); ++i) - { - if (setContinuation(rContinuations[i], pContinuation1)) - continue; - if (setContinuation(rContinuations[i], pContinuation2)) - continue; - if (setContinuation(rContinuations[i], pContinuation3)) - continue; - if (setContinuation(rContinuations[i], pContinuation4)) - continue; - } -} - -::rtl::OUString -replaceMessageWithArguments( - ::rtl::OUString aMessage, - std::vector< rtl::OUString > const & rArguments ) -{ - for (sal_Int32 i = 0;;) - { - i = aMessage. - indexOf(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("$(ARG")), i); - if (i == -1) - break; - if (aMessage.getLength() - i >= RTL_CONSTASCII_LENGTH("$(ARGx)") - && aMessage.getStr()[i + RTL_CONSTASCII_LENGTH("$(ARGx")] == ')') - { - sal_Unicode c - = aMessage.getStr()[i + RTL_CONSTASCII_LENGTH("$(ARG")]; - if (c >= '1' && c <= '2') - { - std::vector< rtl::OUString >::size_type nIndex - = static_cast< std::vector< rtl::OUString >::size_type >( - c - '1'); - if (nIndex < rArguments.size()) - { - aMessage - = aMessage.replaceAt(i, - RTL_CONSTASCII_LENGTH("$(ARGx)"), - rArguments[nIndex]); - i += rArguments[nIndex].getLength(); - continue; - } - } - } - ++i; - } - - return aMessage; -} - -bool -getStringRequestArgument(uno::Sequence< uno::Any > const & rArguments, - rtl::OUString const & rKey, - rtl::OUString * pValue) - SAL_THROW(()) -{ - for (sal_Int32 i = 0; i < rArguments.getLength(); ++i) - { - beans::PropertyValue aProperty; - if ((rArguments[i] >>= aProperty) && aProperty.Name == rKey) - { - rtl::OUString aValue; - if (aProperty.Value >>= aValue) - { - if (pValue) - *pValue = aValue; - return true; - } - } - } - return false; -} - -bool -getBoolRequestArgument(uno::Sequence< uno::Any > const & rArguments, - rtl::OUString const & rKey, - bool * pValue) - SAL_THROW(()) -{ - for (sal_Int32 i = 0; i < rArguments.getLength(); ++i) + HandleData( + uno::Reference< task::XInteractionRequest > const & rRequest) + : osl::Condition(), + m_rRequest(rRequest), + bHandled( false ) { - beans::PropertyValue aProperty; - if ((rArguments[i] >>= aProperty) && aProperty.Name == rKey) - { - sal_Bool bValue = sal_Bool(); - if (aProperty.Value >>= bValue) - { - if (pValue) - *pValue = bValue; - return true; - } - } } - return false; -} - -bool -getResourceNameRequestArgument(uno::Sequence< uno::Any > const & rArguments, - rtl::OUString * pValue) - SAL_THROW(()) -{ - if (!getStringRequestArgument(rArguments, - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "Uri")), - pValue)) - return false; - // Use the resource name only for file URLs, to avoid confusion: - //TODO! work with ucp locality concept instead of hardcoded "file"? - if (pValue - && pValue->matchIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM( - "file:"))) - getStringRequestArgument(rArguments, - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "ResourceName")), - pValue); - return true; -} - -bool -isInformationalErrorMessageRequest( - uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & - rContinuations) -{ - // Only requests with a single continuation (user has no choice, request - // is just informational) - if (rContinuations.getLength() != 1 ) - return false; - - // user can only abort or approve, all other continuations are not - // considered to be informational. - uno::Reference< task::XInteractionApprove > xApprove( - rContinuations[0], uno::UNO_QUERY); - if (xApprove.is()) - return true; - - uno::Reference< task::XInteractionAbort > xAbort( - rContinuations[0], uno::UNO_QUERY); - if (xAbort.is()) - return true; - - return false; -} + uno::Reference< task::XInteractionRequest > m_rRequest; + bool bHandled; + beans::Optional< rtl::OUString > m_aResult; +}; } /* namespace */ @@ -406,20 +132,6 @@ UUIInteractionHelper::~UUIInteractionHelper() { } -class HandleData : public osl::Condition { -public: - HandleData( - uno::Reference< task::XInteractionRequest > const & rRequest) - : osl::Condition(), - m_rRequest(rRequest), - bHandled( false ) - { - } - uno::Reference< task::XInteractionRequest > m_rRequest; - bool bHandled; - beans::Optional< rtl::OUString > m_aResult; -}; - long UUIInteractionHelper::handlerequest( void* pHandleData, void* pInteractionHelper) @@ -428,7 +140,10 @@ UUIInteractionHelper::handlerequest( = static_cast< HandleData * >(pHandleData); UUIInteractionHelper* pUUI = static_cast< UUIInteractionHelper * >(pInteractionHelper); - pHND->bHandled = pUUI->handle_impl(pHND->m_rRequest); + bool bDummy = false; + rtl::OUString aDummy; + pHND->bHandled + = pUUI->handleRequest_impl(pHND->m_rRequest, false, bDummy, aDummy); pHND->set(); return 0; } @@ -441,7 +156,8 @@ UUIInteractionHelper::handleRequest( Application* pApp = 0; if( // be aware,it is the same type - ((oslThreadIdentifier) Application::GetMainThreadIdentifier()) + static_cast< oslThreadIdentifier >( + Application::GetMainThreadIdentifier()) != osl_getThreadIdentifier(NULL) && (pApp = GetpApp()) @@ -457,7 +173,11 @@ UUIInteractionHelper::handleRequest( return aHD.bHandled; } else - return handle_impl(rRequest); + { + bool bDummy = false; + rtl::OUString aDummy; + return handleRequest_impl(rRequest, false, bDummy, aDummy); + } } long @@ -478,10 +198,13 @@ UUIInteractionHelper::getStringFromRequest_impl( { bool bSuccess = false; rtl::OUString aMessage; - handleMessageboxRequests(rRequest, true, bSuccess, aMessage); + handleRequest_impl(rRequest, true, bSuccess, aMessage); - if (!bSuccess) - handleErrorHandlerRequests(rRequest, true, bSuccess, aMessage); + OSL_ENSURE(bSuccess || + !isInformationalErrorMessageRequest( + rRequest->getContinuations()), + "Interaction request is a candidate for a string representation." + "Please implement!"); return beans::Optional< rtl::OUString >(bSuccess, aMessage); } @@ -494,7 +217,8 @@ UUIInteractionHelper::getStringFromRequest( Application* pApp = 0; if( // be aware,it is the same type - ((oslThreadIdentifier) Application::GetMainThreadIdentifier()) + static_cast< oslThreadIdentifier >( + Application::GetMainThreadIdentifier()) != osl_getThreadIdentifier(NULL) && (pApp = GetpApp()) @@ -513,918 +237,628 @@ UUIInteractionHelper::getStringFromRequest( return getStringFromRequest_impl(rRequest); } -bool -UUIInteractionHelper::handleMessageboxRequests( - uno::Reference< task::XInteractionRequest > const & rRequest, - bool bObtainErrorStringOnly, - bool & bHasErrorString, - rtl::OUString & rErrorString) +::rtl::OUString +UUIInteractionHelper::replaceMessageWithArguments( + ::rtl::OUString aMessage, + std::vector< rtl::OUString > const & rArguments ) { - uno::Any aAnyRequest(rRequest->getRequest()); - - script::ModuleSizeExceededRequest aModSizeException; - if (aAnyRequest >>= aModSizeException ) + for (sal_Int32 i = 0;;) { - ErrCode nErrorCode = ERRCODE_UUI_IO_MODULESIZEEXCEEDED; - std::vector< rtl::OUString > aArguments; - uno::Sequence< rtl::OUString > sModules - = aModSizeException.Names; - if ( sModules.getLength() ) + i = aMessage. + indexOf(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("$(ARG")), i); + if (i == -1) + break; + if (aMessage.getLength() - i >= RTL_CONSTASCII_LENGTH("$(ARGx)") + && aMessage.getStr()[i + RTL_CONSTASCII_LENGTH("$(ARGx")] == ')') { - rtl::OUString aName; - for ( sal_Int32 index=0; index< sModules.getLength(); ++index ) + sal_Unicode c + = aMessage.getStr()[i + RTL_CONSTASCII_LENGTH("$(ARG")]; + if (c >= '1' && c <= '2') { - if ( index ) - aName = aName + rtl::OUString( ',' ) + sModules[index]; - else - aName = sModules[index]; // 1st name + std::vector< rtl::OUString >::size_type nIndex + = static_cast< std::vector< rtl::OUString >::size_type >( + c - '1'); + if (nIndex < rArguments.size()) + { + aMessage + = aMessage.replaceAt(i, + RTL_CONSTASCII_LENGTH("$(ARGx)"), + rArguments[nIndex]); + i += rArguments[nIndex].getLength(); + continue; + } } - aArguments.push_back( aName ); } - handleErrorRequest( task::InteractionClassification_WARNING, - nErrorCode, - aArguments, - rRequest->getContinuations(), - bObtainErrorStringOnly, - bHasErrorString, - rErrorString); - return true; + ++i; } - ucb::NameClashException aNCException; - if (aAnyRequest >>= aNCException) - { - ErrCode nErrorCode = ERRCODE_UUI_IO_TARGETALREADYEXISTS; - std::vector< rtl::OUString > aArguments; + return aMessage; +} - if( aNCException.Name.getLength() ) - { - nErrorCode = ERRCODE_UUI_IO_ALREADYEXISTS; - aArguments.push_back( aNCException.Name ); - } +bool +UUIInteractionHelper::isInformationalErrorMessageRequest( + uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & + rContinuations) +{ + // Only requests with a single continuation (user has no choice, request + // is just informational) + if (rContinuations.getLength() != 1 ) + return false; - handleErrorRequest( aNCException.Classification, - nErrorCode, - aArguments, - rRequest->getContinuations(), - bObtainErrorStringOnly, - bHasErrorString, - rErrorString); + // user can only abort or approve, all other continuations are not + // considered to be informational. + uno::Reference< task::XInteractionApprove > xApprove( + rContinuations[0], uno::UNO_QUERY); + if (xApprove.is()) return true; - } - - ucb::UnsupportedNameClashException aUORequest; - if (aAnyRequest >>= aUORequest) - { - ErrCode nErrorCode = ERRCODE_UUI_IO_UNSUPPORTEDOVERWRITE; - std::vector< rtl::OUString > aArguments; - uno::Reference< task::XInteractionApprove > xApprove; - uno::Reference< task::XInteractionDisapprove > xDisapprove; - getContinuations(rRequest->getContinuations(), &xApprove, &xDisapprove); - - if ( xApprove.is() && xDisapprove.is() ) - { - handleErrorRequest( task::InteractionClassification_QUERY, - nErrorCode, - aArguments, - rRequest->getContinuations(), - bObtainErrorStringOnly, - bHasErrorString, - rErrorString); - } + uno::Reference< task::XInteractionAbort > xAbort( + rContinuations[0], uno::UNO_QUERY); + if (xAbort.is()) return true; - } - document::BrokenPackageRequest aBrokenPackageRequest; - if (aAnyRequest >>= aBrokenPackageRequest) - { - std::vector< rtl::OUString > aArguments; - - if( aBrokenPackageRequest.aName.getLength() ) - aArguments.push_back( aBrokenPackageRequest.aName ); + return false; +} - handleBrokenPackageRequest( aArguments, - rRequest->getContinuations(), - bObtainErrorStringOnly, - bHasErrorString, - rErrorString); - return true; +bool +UUIInteractionHelper::tryOtherInteractionHandler( + uno::Reference< task::XInteractionRequest > const & rRequest) + SAL_THROW((uno::RuntimeException)) +{ + InteractionHandlerDataList dataList; + getInteractionHandlerList(dataList); + + InteractionHandlerDataList::const_iterator aEnd(dataList.end()); + for (InteractionHandlerDataList::const_iterator aIt(dataList.begin()); + aIt != aEnd; + ++aIt) + { + uno::Reference< uno::XInterface > xIfc; + + try + { + xIfc = m_xServiceFactory->createInstance(aIt->ServiceName); + } + catch ( uno::RuntimeException const & ) + { + throw; + } + catch ( uno::Exception const & ) + { + } + + uno::Reference< lang::XInitialization > + xInitialization( xIfc, uno::UNO_QUERY ); + + OSL_ENSURE( xInitialization.is(), + "Custom Interactionhandler does not " + "implement mandatory interface XInitialization!" ); + if (xInitialization.is()) + { + uno::Sequence< uno::Any > propertyValues(1); + beans::PropertyValue aProperty; + + aProperty.Name = rtl::OUString::createFromAscii( "Parent" ); + aProperty.Value <<= getParentXWindow(); + propertyValues[ 0 ] <<= aProperty; + + xInitialization->initialize(propertyValues); + } + + uno::Reference< task::XInteractionHandler2 > + xIH( xIfc, uno::UNO_QUERY ); + + OSL_ENSURE( xIH.is(), + "Custom Interactionhandler does not " + "implement mandatory interface XInteractionHandler2!" ); + if (xIH.is() && xIH->handleInteractionRequest(rRequest)) + return true; } + return false; +} - ucb::InteractiveIOException aIoException; - if (aAnyRequest >>= aIoException) +bool +UUIInteractionHelper::handleRequest_impl( + uno::Reference< task::XInteractionRequest > const & rRequest, + bool bObtainErrorStringOnly, + bool & bHasErrorString, + rtl::OUString & rErrorString) + SAL_THROW((uno::RuntimeException)) +{ + try { - uno::Sequence< uno::Any > aRequestArguments; - ucb::InteractiveAugmentedIOException aAugmentedIoException; - if (aAnyRequest >>= aAugmentedIoException) - aRequestArguments = aAugmentedIoException.Arguments; - - ErrCode nErrorCode; - std::vector< rtl::OUString > aArguments; - static ErrCode const - aErrorCode[ucb::IOErrorCode_WRONG_VERSION + 1][2] - = { { ERRCODE_IO_ABORT, ERRCODE_UUI_IO_ABORT }, // ABORT - { ERRCODE_IO_ACCESSDENIED, ERRCODE_UUI_IO_ACCESSDENIED }, - // ACCESS_DENIED - { ERRCODE_IO_ALREADYEXISTS, - ERRCODE_UUI_IO_ALREADYEXISTS }, // ALREADY_EXISTING - { ERRCODE_IO_BADCRC, ERRCODE_UUI_IO_BADCRC }, // BAD_CRC - { ERRCODE_IO_CANTCREATE, ERRCODE_UUI_IO_CANTCREATE }, - // CANT_CREATE - { ERRCODE_IO_CANTREAD, ERRCODE_UUI_IO_CANTREAD }, - // CANT_READ - { ERRCODE_IO_CANTSEEK, ERRCODE_UUI_IO_CANTSEEK }, - // CANT_SEEK - { ERRCODE_IO_CANTTELL, ERRCODE_UUI_IO_CANTTELL }, - // CANT_TELL - { ERRCODE_IO_CANTWRITE, ERRCODE_UUI_IO_CANTWRITE }, - // CANT_WRITE - { ERRCODE_IO_CURRENTDIR, ERRCODE_UUI_IO_CURRENTDIR }, - // CURRENT_DIRECTORY - { ERRCODE_IO_DEVICENOTREADY, ERRCODE_UUI_IO_NOTREADY }, - // DEVICE_NOT_READY - { ERRCODE_IO_NOTSAMEDEVICE, - ERRCODE_UUI_IO_NOTSAMEDEVICE }, // DIFFERENT_DEVICES - { ERRCODE_IO_GENERAL, ERRCODE_UUI_IO_GENERAL }, // GENERAL - { ERRCODE_IO_INVALIDACCESS, - ERRCODE_UUI_IO_INVALIDACCESS }, // INVALID_ACCESS - { ERRCODE_IO_INVALIDCHAR, ERRCODE_UUI_IO_INVALIDCHAR }, - // INVALID_CHARACTER - { ERRCODE_IO_INVALIDDEVICE, - ERRCODE_UUI_IO_INVALIDDEVICE }, // INVALID_DEVICE - { ERRCODE_IO_INVALIDLENGTH, - ERRCODE_UUI_IO_INVALIDLENGTH }, // INVALID_LENGTH - { ERRCODE_IO_INVALIDPARAMETER, - ERRCODE_UUI_IO_INVALIDPARAMETER }, // INVALID_PARAMETER - { ERRCODE_IO_ISWILDCARD, ERRCODE_UUI_IO_ISWILDCARD }, - // IS_WILDCARD - { ERRCODE_IO_LOCKVIOLATION, - ERRCODE_UUI_IO_LOCKVIOLATION }, // LOCKING_VIOLATION - { ERRCODE_IO_MISPLACEDCHAR, - ERRCODE_UUI_IO_MISPLACEDCHAR }, // MISPLACED_CHARACTER - { ERRCODE_IO_NAMETOOLONG, ERRCODE_UUI_IO_NAMETOOLONG }, - // NAME_TOO_LONG - { ERRCODE_IO_NOTEXISTS, ERRCODE_UUI_IO_NOTEXISTS }, - // NOT_EXISTING - { ERRCODE_IO_NOTEXISTSPATH, - ERRCODE_UUI_IO_NOTEXISTSPATH }, // NOT_EXISTING_PATH - { ERRCODE_IO_NOTSUPPORTED, ERRCODE_UUI_IO_NOTSUPPORTED }, - // NOT_SUPPORTED - { ERRCODE_IO_NOTADIRECTORY, - ERRCODE_UUI_IO_NOTADIRECTORY }, // NO_DIRECTORY - { ERRCODE_IO_NOTAFILE, ERRCODE_UUI_IO_NOTAFILE }, - // NO_FILE - { ERRCODE_IO_OUTOFSPACE, ERRCODE_UUI_IO_OUTOFSPACE }, - // OUT_OF_DISK_SPACE - { ERRCODE_IO_TOOMANYOPENFILES, - ERRCODE_UUI_IO_TOOMANYOPENFILES }, - // OUT_OF_FILE_HANDLES - { ERRCODE_IO_OUTOFMEMORY, ERRCODE_UUI_IO_OUTOFMEMORY }, - // OUT_OF_MEMORY - { ERRCODE_IO_PENDING, ERRCODE_UUI_IO_PENDING }, // PENDING - { ERRCODE_IO_RECURSIVE, ERRCODE_UUI_IO_RECURSIVE }, - // RECURSIVE - { ERRCODE_IO_UNKNOWN, ERRCODE_UUI_IO_UNKNOWN }, // UNKNOWN - { ERRCODE_IO_WRITEPROTECTED, - ERRCODE_UUI_IO_WRITEPROTECTED }, // WRITE_PROTECTED - { ERRCODE_IO_WRONGFORMAT, ERRCODE_UUI_IO_WRONGFORMAT }, - // WRONG_FORMAT - { ERRCODE_IO_WRONGVERSION, - ERRCODE_UUI_IO_WRONGVERSION } }; // WRONG_VERSION - switch (aIoException.Code) + if (!rRequest.is()) + return false; + + uno::Any aAnyRequest(rRequest->getRequest()); + + script::ModuleSizeExceededRequest aModSizeException; + if (aAnyRequest >>= aModSizeException ) { - case ucb::IOErrorCode_CANT_CREATE: + ErrCode nErrorCode = ERRCODE_UUI_IO_MODULESIZEEXCEEDED; + std::vector< rtl::OUString > aArguments; + uno::Sequence< rtl::OUString > sModules + = aModSizeException.Names; + if ( sModules.getLength() ) { - rtl::OUString aArgFolder; - if (getStringRequestArgument( - aRequestArguments, - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "Folder")), - &aArgFolder)) + rtl::OUString aName; + for ( sal_Int32 index=0; index< sModules.getLength(); ++index ) { - rtl::OUString aArgUri; - if (getResourceNameRequestArgument(aRequestArguments, - &aArgUri)) - { - nErrorCode = ERRCODE_UUI_IO_CANTCREATE; - aArguments.reserve(2); - aArguments.push_back(aArgUri); - aArguments.push_back(aArgFolder); - } + if ( index ) + aName = aName + rtl::OUString( ',' ) + sModules[index]; else - { - nErrorCode = ERRCODE_UUI_IO_CANTCREATE_NONAME; - aArguments.push_back(aArgFolder); - } + aName = sModules[index]; // 1st name } - else - nErrorCode = aErrorCode[aIoException.Code][0]; - break; + aArguments.push_back( aName ); } + handleErrorHandlerRequest( task::InteractionClassification_WARNING, + nErrorCode, + aArguments, + rRequest->getContinuations(), + bObtainErrorStringOnly, + bHasErrorString, + rErrorString); + return true; + } + + ucb::NameClashException aNCException; + if (aAnyRequest >>= aNCException) + { + ErrCode nErrorCode = ERRCODE_UUI_IO_TARGETALREADYEXISTS; + std::vector< rtl::OUString > aArguments; - case ucb::IOErrorCode_DEVICE_NOT_READY: + if( aNCException.Name.getLength() ) { - rtl::OUString aArgUri; - if (getResourceNameRequestArgument(aRequestArguments, - &aArgUri)) - { - rtl::OUString aResourceType; - getStringRequestArgument( - aRequestArguments, - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "ResourceType")), - &aResourceType); - bool bRemovable = false; - getBoolRequestArgument(aRequestArguments, - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "Removable")), - &bRemovable); - nErrorCode - = aResourceType.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM("volume")) - ? (bRemovable - ? ERRCODE_UUI_IO_NOTREADY_VOLUME_REMOVABLE - : ERRCODE_UUI_IO_NOTREADY_VOLUME) - : (bRemovable - ? ERRCODE_UUI_IO_NOTREADY_REMOVABLE - : ERRCODE_UUI_IO_NOTREADY); - aArguments.push_back(aArgUri); - } - else - nErrorCode = aErrorCode[aIoException.Code][0]; - break; + nErrorCode = ERRCODE_UUI_IO_ALREADYEXISTS; + aArguments.push_back( aNCException.Name ); } - case ucb::IOErrorCode_DIFFERENT_DEVICES: - { - rtl::OUString aArgVolume; - rtl::OUString aArgOtherVolume; - if (getStringRequestArgument( - aRequestArguments, - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "Volume")), - &aArgVolume) - && getStringRequestArgument( - aRequestArguments, - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "OtherVolume")), - &aArgOtherVolume)) - { - nErrorCode = aErrorCode[aIoException.Code][1]; - aArguments.reserve(2); - aArguments.push_back(aArgVolume); - aArguments.push_back(aArgOtherVolume); - } - else - nErrorCode = aErrorCode[aIoException.Code][0]; - break; + handleErrorHandlerRequest( aNCException.Classification, + nErrorCode, + aArguments, + rRequest->getContinuations(), + bObtainErrorStringOnly, + bHasErrorString, + rErrorString); + return true; } - case ucb::IOErrorCode_NOT_EXISTING: - { - rtl::OUString aArgUri; - if (getResourceNameRequestArgument(aRequestArguments, - &aArgUri)) - { - rtl::OUString aResourceType; - getStringRequestArgument( - aRequestArguments, - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "ResourceType")), - &aResourceType); - nErrorCode - = aResourceType.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM("volume")) - ? ERRCODE_UUI_IO_NOTEXISTS_VOLUME - : (aResourceType.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM("folder")) - ? ERRCODE_UUI_IO_NOTEXISTS_FOLDER - : ERRCODE_UUI_IO_NOTEXISTS); - aArguments.push_back(aArgUri); - } - else - nErrorCode = aErrorCode[aIoException.Code][0]; - break; - } + ucb::UnsupportedNameClashException aUORequest; + if (aAnyRequest >>= aUORequest) + { + ErrCode nErrorCode = ERRCODE_UUI_IO_UNSUPPORTEDOVERWRITE; + std::vector< rtl::OUString > aArguments; - default: + uno::Reference< task::XInteractionApprove > xApprove; + uno::Reference< task::XInteractionDisapprove > xDisapprove; + getContinuations( + rRequest->getContinuations(), &xApprove, &xDisapprove); + + if ( xApprove.is() && xDisapprove.is() ) { - rtl::OUString aArgUri; - if (getResourceNameRequestArgument(aRequestArguments, - &aArgUri)) - { - nErrorCode = aErrorCode[aIoException.Code][1]; - aArguments.push_back(aArgUri); - } - else - nErrorCode = aErrorCode[aIoException.Code][0]; - break; + handleErrorHandlerRequest( task::InteractionClassification_QUERY, + nErrorCode, + aArguments, + rRequest->getContinuations(), + bObtainErrorStringOnly, + bHasErrorString, + rErrorString); } + return true; } - handleErrorRequest(aIoException.Classification, - nErrorCode, - aArguments, - rRequest->getContinuations(), - bObtainErrorStringOnly, - bHasErrorString, - rErrorString); - return true; - } - - ucb::InteractiveAppException aAppException; - if (aAnyRequest >>= aAppException) - { - std::vector< rtl::OUString > aArguments; - handleErrorRequest( aAppException.Classification, - aAppException.Code, - aArguments, - rRequest->getContinuations(), - bObtainErrorStringOnly, - bHasErrorString, - rErrorString); - return true; - } + if ( handleInteractiveIOException( rRequest, + bObtainErrorStringOnly, + bHasErrorString, + rErrorString ) ) + return true; - ucb::InteractiveNetworkException aNetworkException; - if (aAnyRequest >>= aNetworkException) - { - ErrCode nErrorCode; - std::vector< rtl::OUString > aArguments; - ucb::InteractiveNetworkOffLineException aOffLineException; - ucb::InteractiveNetworkResolveNameException aResolveNameException; - ucb::InteractiveNetworkConnectException aConnectException; - ucb::InteractiveNetworkReadException aReadException; - ucb::InteractiveNetworkWriteException aWriteException; - if (aAnyRequest >>= aOffLineException) - nErrorCode = ERRCODE_INET_OFFLINE; - else if (aAnyRequest >>= aResolveNameException) - { - nErrorCode = ERRCODE_INET_NAME_RESOLVE; - aArguments.push_back(aResolveNameException.Server); - } - else if (aAnyRequest >>= aConnectException) - { - nErrorCode = ERRCODE_INET_CONNECT; - aArguments.push_back(aConnectException.Server); - } - else if (aAnyRequest >>= aReadException) - { - nErrorCode = ERRCODE_INET_READ; - aArguments.push_back(aReadException.Diagnostic); + ucb::InteractiveAppException aAppException; + if (aAnyRequest >>= aAppException) + { + std::vector< rtl::OUString > aArguments; + handleErrorHandlerRequest( aAppException.Classification, + aAppException.Code, + aArguments, + rRequest->getContinuations(), + bObtainErrorStringOnly, + bHasErrorString, + rErrorString); + return true; } - else if (aAnyRequest >>= aWriteException) + + ucb::InteractiveNetworkException aNetworkException; + if (aAnyRequest >>= aNetworkException) { - nErrorCode = ERRCODE_INET_WRITE; - aArguments.push_back(aWriteException.Diagnostic); + ErrCode nErrorCode; + std::vector< rtl::OUString > aArguments; + ucb::InteractiveNetworkOffLineException aOffLineException; + ucb::InteractiveNetworkResolveNameException aResolveNameException; + ucb::InteractiveNetworkConnectException aConnectException; + ucb::InteractiveNetworkReadException aReadException; + ucb::InteractiveNetworkWriteException aWriteException; + if (aAnyRequest >>= aOffLineException) + nErrorCode = ERRCODE_INET_OFFLINE; + else if (aAnyRequest >>= aResolveNameException) + { + nErrorCode = ERRCODE_INET_NAME_RESOLVE; + aArguments.push_back(aResolveNameException.Server); + } + else if (aAnyRequest >>= aConnectException) + { + nErrorCode = ERRCODE_INET_CONNECT; + aArguments.push_back(aConnectException.Server); + } + else if (aAnyRequest >>= aReadException) + { + nErrorCode = ERRCODE_INET_READ; + aArguments.push_back(aReadException.Diagnostic); + } + else if (aAnyRequest >>= aWriteException) + { + nErrorCode = ERRCODE_INET_WRITE; + aArguments.push_back(aWriteException.Diagnostic); + } + else + nErrorCode = ERRCODE_INET_GENERAL; + + handleErrorHandlerRequest(aNetworkException.Classification, + nErrorCode, + aArguments, + rRequest->getContinuations(), + bObtainErrorStringOnly, + bHasErrorString, + rErrorString); + return true; } - else - nErrorCode = ERRCODE_INET_GENERAL; - - handleErrorRequest(aNetworkException.Classification, - nErrorCode, - aArguments, - rRequest->getContinuations(), - bObtainErrorStringOnly, - bHasErrorString, - rErrorString); - return true; - } - ucb::InteractiveCHAOSException aChaosException; - if (aAnyRequest >>= aChaosException) - { - std::vector< rtl::OUString > aArguments; - sal_Int32 nCount - = std::min< sal_Int32 >(aChaosException.Arguments.getLength(), - 2); - aArguments. - reserve( - static_cast< std::vector< rtl::OUString >::size_type >( + ucb::InteractiveCHAOSException aChaosException; + if (aAnyRequest >>= aChaosException) + { + std::vector< rtl::OUString > aArguments; + sal_Int32 nCount + = std::min< sal_Int32 >(aChaosException.Arguments.getLength(), + 2); + aArguments. + reserve(static_cast< std::vector< rtl::OUString >::size_type >( nCount)); - for (sal_Int32 i = 0; i < nCount; ++i) - aArguments.push_back(aChaosException.Arguments[i]); - handleErrorRequest(aChaosException.Classification, - aChaosException.ID, - aArguments, - rRequest->getContinuations(), - bObtainErrorStringOnly, - bHasErrorString, - rErrorString); - return true; - } + for (sal_Int32 i = 0; i < nCount; ++i) + aArguments.push_back(aChaosException.Arguments[i]); + handleErrorHandlerRequest(aChaosException.Classification, + aChaosException.ID, + aArguments, + rRequest->getContinuations(), + bObtainErrorStringOnly, + bHasErrorString, + rErrorString); + return true; + } - ucb::InteractiveWrongMediumException aWrongMediumException; - if (aAnyRequest >>= aWrongMediumException) - { - sal_Int32 nMedium = 0; - aWrongMediumException.Medium >>= nMedium; - std::vector< rtl::OUString > aArguments; - aArguments.push_back(UniString::CreateFromInt32(nMedium + 1)); - handleErrorRequest(aWrongMediumException.Classification, - ERRCODE_UUI_WRONGMEDIUM, - aArguments, - rRequest->getContinuations(), - bObtainErrorStringOnly, - bHasErrorString, - rErrorString); - return true; - } + ucb::InteractiveWrongMediumException aWrongMediumException; + if (aAnyRequest >>= aWrongMediumException) + { + sal_Int32 nMedium = 0; + aWrongMediumException.Medium >>= nMedium; + std::vector< rtl::OUString > aArguments; + aArguments.push_back(UniString::CreateFromInt32(nMedium + 1)); + handleErrorHandlerRequest(aWrongMediumException.Classification, + ERRCODE_UUI_WRONGMEDIUM, + aArguments, + rRequest->getContinuations(), + bObtainErrorStringOnly, + bHasErrorString, + rErrorString); + return true; + } - java::WrongJavaVersionException aWrongJavaVersionException; - if (aAnyRequest >>= aWrongJavaVersionException) - { - ErrCode nErrorCode; - std::vector< rtl::OUString > aArguments; - if (aWrongJavaVersionException.DetectedVersion.getLength() == 0) - if (aWrongJavaVersionException.LowestSupportedVersion. - getLength() - == 0) - nErrorCode = ERRCODE_UUI_WRONGJAVA; + java::WrongJavaVersionException aWrongJavaVersionException; + if (aAnyRequest >>= aWrongJavaVersionException) + { + ErrCode nErrorCode; + std::vector< rtl::OUString > aArguments; + if (aWrongJavaVersionException.DetectedVersion.getLength() == 0) + if (aWrongJavaVersionException.LowestSupportedVersion. + getLength() + == 0) + nErrorCode = ERRCODE_UUI_WRONGJAVA; + else + { + nErrorCode = ERRCODE_UUI_WRONGJAVA_MIN; + aArguments.push_back(aWrongJavaVersionException. + LowestSupportedVersion); + } + else if (aWrongJavaVersionException.LowestSupportedVersion. + getLength() + == 0) + { + nErrorCode = ERRCODE_UUI_WRONGJAVA_VERSION; + aArguments.push_back(aWrongJavaVersionException. + DetectedVersion); + } else { - nErrorCode = ERRCODE_UUI_WRONGJAVA_MIN; + nErrorCode = ERRCODE_UUI_WRONGJAVA_VERSION_MIN; + aArguments.reserve(2); + aArguments.push_back(aWrongJavaVersionException. + DetectedVersion); aArguments.push_back(aWrongJavaVersionException. LowestSupportedVersion); } - else if (aWrongJavaVersionException.LowestSupportedVersion. - getLength() - == 0) - { - nErrorCode = ERRCODE_UUI_WRONGJAVA_VERSION; - aArguments.push_back(aWrongJavaVersionException. - DetectedVersion); + handleErrorHandlerRequest(task::InteractionClassification_ERROR, + nErrorCode, + aArguments, + rRequest->getContinuations(), + bObtainErrorStringOnly, + bHasErrorString, + rErrorString); + return true; } - else + + sync2::BadPartnershipException aBadPartnershipException; + if (aAnyRequest >>= aBadPartnershipException) { - nErrorCode = ERRCODE_UUI_WRONGJAVA_VERSION_MIN; - aArguments.reserve(2); - aArguments.push_back(aWrongJavaVersionException. - DetectedVersion); - aArguments.push_back(aWrongJavaVersionException. - LowestSupportedVersion); + ErrCode nErrorCode; + std::vector< rtl::OUString > aArguments; + if (aBadPartnershipException.Partnership.getLength() == 0) + nErrorCode = ERRCODE_UUI_BADPARTNERSHIP; + else + { + nErrorCode = ERRCODE_UUI_BADPARTNERSHIP_NAME; + aArguments.push_back(aBadPartnershipException.Partnership); + } + handleErrorHandlerRequest(task::InteractionClassification_ERROR, + nErrorCode, + aArguments, + rRequest->getContinuations(), + bObtainErrorStringOnly, + bHasErrorString, + rErrorString); + return true; } - handleErrorRequest(task::InteractionClassification_ERROR, - nErrorCode, - aArguments, - rRequest->getContinuations(), - bObtainErrorStringOnly, - bHasErrorString, - rErrorString); - return true; - } - sync2::BadPartnershipException aBadPartnershipException; - if (aAnyRequest >>= aBadPartnershipException) - { - ErrCode nErrorCode; - std::vector< rtl::OUString > aArguments; - if (aBadPartnershipException.Partnership.getLength() == 0) - nErrorCode = ERRCODE_UUI_BADPARTNERSHIP; - else + configuration::backend::MergeRecoveryRequest aMergeRecoveryRequest; + if (aAnyRequest >>= aMergeRecoveryRequest) { - nErrorCode = ERRCODE_UUI_BADPARTNERSHIP_NAME; - aArguments.push_back(aBadPartnershipException.Partnership); + ErrCode nErrorCode = aMergeRecoveryRequest.IsRemovalRequest + ? ERRCODE_UUI_CONFIGURATION_BROKENDATA_WITHREMOVE + : ERRCODE_UUI_CONFIGURATION_BROKENDATA_NOREMOVE; + + std::vector< rtl::OUString > aArguments; + aArguments.push_back(aMergeRecoveryRequest.ErrorLayerId); + + handleErrorHandlerRequest(task::InteractionClassification_ERROR, + nErrorCode, + aArguments, + rRequest->getContinuations(), + bObtainErrorStringOnly, + bHasErrorString, + rErrorString); + return true; } - handleErrorRequest(task::InteractionClassification_ERROR, - nErrorCode, - aArguments, - rRequest->getContinuations(), - bObtainErrorStringOnly, - bHasErrorString, - rErrorString); - return true; - } - configuration::backend::MergeRecoveryRequest aMergeRecoveryRequest; - if (aAnyRequest >>= aMergeRecoveryRequest) - { - ErrCode nErrorCode = aMergeRecoveryRequest.IsRemovalRequest - ? ERRCODE_UUI_CONFIGURATION_BROKENDATA_WITHREMOVE - : ERRCODE_UUI_CONFIGURATION_BROKENDATA_NOREMOVE; - - std::vector< rtl::OUString > aArguments; - aArguments.push_back(aMergeRecoveryRequest.ErrorLayerId); - - handleErrorRequest(task::InteractionClassification_ERROR, - nErrorCode, - aArguments, - rRequest->getContinuations(), - bObtainErrorStringOnly, - bHasErrorString, - rErrorString); - return true; - } + configuration::backend::StratumCreationException + aStratumCreationException; - configuration::backend::StratumCreationException - aStratumCreationException; + if (aAnyRequest >>= aStratumCreationException) + { + const ErrCode nErrorCode = ERRCODE_UUI_CONFIGURATION_BACKENDMISSING; - if (aAnyRequest >>= aStratumCreationException) - { - const ErrCode nErrorCode = ERRCODE_UUI_CONFIGURATION_BACKENDMISSING; - - rtl::OUString aStratum = aStratumCreationException.StratumData; - if (aStratum.getLength() == 0) - aStratum = aStratumCreationException.StratumService; - - std::vector< rtl::OUString > aArguments; - aArguments.push_back(aStratum); - - handleErrorRequest(task::InteractionClassification_ERROR, - nErrorCode, - aArguments, - rRequest->getContinuations(), - bObtainErrorStringOnly, - bHasErrorString, - rErrorString); - return true; - } + rtl::OUString aStratum = aStratumCreationException.StratumData; + if (aStratum.getLength() == 0) + aStratum = aStratumCreationException.StratumService; - xforms::InvalidDataOnSubmitException aInvalidDataOnSubmitException; - if (aAnyRequest >>= aInvalidDataOnSubmitException) - { - const ErrCode nErrorCode = ERRCODE_UUI_INVALID_XFORMS_SUBMISSION_DATA; + std::vector< rtl::OUString > aArguments; + aArguments.push_back(aStratum); - std::vector< rtl::OUString > aArguments; + handleErrorHandlerRequest(task::InteractionClassification_ERROR, + nErrorCode, + aArguments, + rRequest->getContinuations(), + bObtainErrorStringOnly, + bHasErrorString, + rErrorString); + return true; + } - handleErrorRequest(task::InteractionClassification_QUERY, - nErrorCode, - aArguments, - rRequest->getContinuations(), - bObtainErrorStringOnly, - bHasErrorString, - rErrorString); - return true; - } + xforms::InvalidDataOnSubmitException aInvalidDataOnSubmitException; + if (aAnyRequest >>= aInvalidDataOnSubmitException) + { + const ErrCode nErrorCode = + ERRCODE_UUI_INVALID_XFORMS_SUBMISSION_DATA; - ucb::InteractiveLockingLockedException aLLException; - if (aAnyRequest >>= aLLException) - { - ErrCode nErrorCode = aLLException.SelfOwned - ? ERRCODE_UUI_LOCKING_LOCKED_SELF : ERRCODE_UUI_LOCKING_LOCKED; - std::vector< rtl::OUString > aArguments; - aArguments.push_back( aLLException.Url ); - - handleErrorRequest( aLLException.Classification, - nErrorCode, - aArguments, - rRequest->getContinuations(), - bObtainErrorStringOnly, - bHasErrorString, - rErrorString ); - return true; - } + std::vector< rtl::OUString > aArguments; - ucb::InteractiveLockingNotLockedException aLNLException; - if (aAnyRequest >>= aLNLException) - { - ErrCode nErrorCode = ERRCODE_UUI_LOCKING_NOT_LOCKED; - std::vector< rtl::OUString > aArguments; - aArguments.push_back( aLNLException.Url ); - - handleErrorRequest( aLNLException.Classification, - nErrorCode, - aArguments, - rRequest->getContinuations(), - bObtainErrorStringOnly, - bHasErrorString, - rErrorString ); - return true; - } + handleErrorHandlerRequest(task::InteractionClassification_QUERY, + nErrorCode, + aArguments, + rRequest->getContinuations(), + bObtainErrorStringOnly, + bHasErrorString, + rErrorString); + return true; + } - ucb::InteractiveLockingLockExpiredException aLLEException; - if (aAnyRequest >>= aLLEException) - { - ErrCode nErrorCode = ERRCODE_UUI_LOCKING_LOCK_EXPIRED; - std::vector< rtl::OUString > aArguments; - aArguments.push_back( aLLEException.Url ); - - handleErrorRequest( aLLEException.Classification, - nErrorCode, - aArguments, - rRequest->getContinuations(), - bObtainErrorStringOnly, - bHasErrorString, - rErrorString ); - return true; - } + ucb::InteractiveLockingLockedException aLLException; + if (aAnyRequest >>= aLLException) + { + ErrCode nErrorCode = aLLException.SelfOwned + ? ERRCODE_UUI_LOCKING_LOCKED_SELF : ERRCODE_UUI_LOCKING_LOCKED; + std::vector< rtl::OUString > aArguments; + aArguments.push_back( aLLException.Url ); - return false; -} + handleErrorHandlerRequest( aLLException.Classification, + nErrorCode, + aArguments, + rRequest->getContinuations(), + bObtainErrorStringOnly, + bHasErrorString, + rErrorString ); + return true; + } -bool -UUIInteractionHelper::handleDialogRequests( - uno::Reference< task::XInteractionRequest > const & rRequest) -{ - uno::Any aAnyRequest(rRequest->getRequest()); + ucb::InteractiveLockingNotLockedException aLNLException; + if (aAnyRequest >>= aLNLException) + { + ErrCode nErrorCode = ERRCODE_UUI_LOCKING_NOT_LOCKED; + std::vector< rtl::OUString > aArguments; + aArguments.push_back( aLNLException.Url ); - ucb::URLAuthenticationRequest aURLAuthenticationRequest; - if (aAnyRequest >>= aURLAuthenticationRequest) - { - handleAuthenticationRequest(aURLAuthenticationRequest, - rRequest->getContinuations(), - aURLAuthenticationRequest.URL); - return true; - } + handleErrorHandlerRequest( aLNLException.Classification, + nErrorCode, + aArguments, + rRequest->getContinuations(), + bObtainErrorStringOnly, + bHasErrorString, + rErrorString ); + return true; + } - ucb::AuthenticationRequest aAuthenticationRequest; - if (aAnyRequest >>= aAuthenticationRequest) - { - handleAuthenticationRequest(aAuthenticationRequest, - rRequest->getContinuations(), - rtl::OUString()); - return true; - } + ucb::InteractiveLockingLockExpiredException aLLEException; + if (aAnyRequest >>= aLLEException) + { + ErrCode nErrorCode = ERRCODE_UUI_LOCKING_LOCK_EXPIRED; + std::vector< rtl::OUString > aArguments; + aArguments.push_back( aLLEException.Url ); - ucb::CertificateValidationRequest aCertificateValidationRequest; - if (aAnyRequest >>= aCertificateValidationRequest) - { - handleCertificateValidationRequest(aCertificateValidationRequest, - rRequest->getContinuations()); - return true; - } + handleErrorHandlerRequest( aLLEException.Classification, + nErrorCode, + aArguments, + rRequest->getContinuations(), + bObtainErrorStringOnly, + bHasErrorString, + rErrorString ); + return true; + } -// @@@ Todo #i29340#: activate! -// ucb::NameClashResolveRequest aNameClashResolveRequest; -// if (aAnyRequest >>= aNameClashResolveRequest) -// { -// handleNameClashResolveRequest(aNameClashResolveRequest, -// rRequest->getContinuations()); -// return; -// } - - task::MasterPasswordRequest aMasterPasswordRequest; - if (aAnyRequest >>= aMasterPasswordRequest) - { - handleMasterPasswordRequest(aMasterPasswordRequest.Mode, - rRequest->getContinuations()); - return true; - } + document::BrokenPackageRequest aBrokenPackageRequest; + if (aAnyRequest >>= aBrokenPackageRequest) + { + std::vector< rtl::OUString > aArguments; - task::DocumentPasswordRequest aDocumentPasswordRequest; - if (aAnyRequest >>= aDocumentPasswordRequest) - { - handlePasswordRequest(aDocumentPasswordRequest.Mode, - rRequest->getContinuations(), - aDocumentPasswordRequest.Name); - return true; - } + if( aBrokenPackageRequest.aName.getLength() ) + aArguments.push_back( aBrokenPackageRequest.aName ); - task::DocumentMSPasswordRequest aDocumentMSPasswordRequest; - if (aAnyRequest >>= aDocumentMSPasswordRequest) - { - handleMSPasswordRequest(aDocumentMSPasswordRequest.Mode, - rRequest->getContinuations(), - aDocumentMSPasswordRequest.Name); - return true; - } + handleBrokenPackageRequest( aArguments, + rRequest->getContinuations(), + bObtainErrorStringOnly, + bHasErrorString, + rErrorString ); + return true; + } - task::PasswordRequest aPasswordRequest; - if (aAnyRequest >>= aPasswordRequest) - { - handlePasswordRequest(aPasswordRequest.Mode, - rRequest->getContinuations()); - return true; - } + task::ErrorCodeRequest aErrorCodeRequest; + if (aAnyRequest >>= aErrorCodeRequest) + { + handleGenericErrorRequest( aErrorCodeRequest.ErrCode, + rRequest->getContinuations(), + bObtainErrorStringOnly, + bHasErrorString, + rErrorString); + return true; + } - ucb::HandleCookiesRequest aCookiesRequest; - if (aAnyRequest >>= aCookiesRequest) - { - handleCookiesRequest(aCookiesRequest, - rRequest->getContinuations()); - return true; - } + task::ErrorCodeIOException aErrorCodeIOException; + if (aAnyRequest >>= aErrorCodeIOException) + { + handleGenericErrorRequest( aErrorCodeIOException.ErrCode, + rRequest->getContinuations(), + bObtainErrorStringOnly, + bHasErrorString, + rErrorString); + return true; + } - document::NoSuchFilterRequest aNoSuchFilterRequest; - if (aAnyRequest >>= aNoSuchFilterRequest) - { - handleNoSuchFilterRequest(aNoSuchFilterRequest, - rRequest->getContinuations()); - return true; - } - document::AmbigousFilterRequest aAmbigousFilterRequest; - if (aAnyRequest >>= aAmbigousFilterRequest) - { - handleAmbigousFilterRequest(aAmbigousFilterRequest, - rRequest->getContinuations()); - return true; - } + /////////////////////////////////////////////////////////////////// + // Handle requests which do not have a plain string representation. + /////////////////////////////////////////////////////////////////// + if (!bObtainErrorStringOnly) + { + if ( handleAuthenticationRequest( rRequest ) ) + return true; - document::FilterOptionsRequest aFilterOptionsRequest; - if (aAnyRequest >>= aFilterOptionsRequest) - { - handleFilterOptionsRequest(aFilterOptionsRequest, - rRequest->getContinuations()); - return true; - } + if ( handleCertificateValidationRequest( rRequest ) ) + return true; - document::LockedDocumentRequest aLockedDocumentRequest; - if (aAnyRequest >>= aLockedDocumentRequest ) - { - handleLockedDocumentRequest( aLockedDocumentRequest.DocumentURL, - aLockedDocumentRequest.UserInfo, - rRequest->getContinuations(), - UUI_DOC_LOAD_LOCK ); - return true; - } +// @@@ Todo #i29340#: activate! +// ucb::NameClashResolveRequest aNameClashResolveRequest; +// if (aAnyRequest >>= aNameClashResolveRequest) +// { +// handleNameClashResolveRequest(aNameClashResolveRequest, +// rRequest->getContinuations()); +// return true; +// } + + if ( handleMasterPasswordRequest( rRequest ) ) + return true; - document::OwnLockOnDocumentRequest aOwnLockOnDocumentRequest; - if (aAnyRequest >>= aOwnLockOnDocumentRequest ) - { - handleLockedDocumentRequest( aOwnLockOnDocumentRequest.DocumentURL, - aOwnLockOnDocumentRequest.TimeInfo, - rRequest->getContinuations(), - aOwnLockOnDocumentRequest.IsStoring - ? UUI_DOC_OWN_SAVE_LOCK - : UUI_DOC_OWN_LOAD_LOCK ); - return true; - } + if ( handlePasswordRequest( rRequest ) ) + return true; - document::LockedOnSavingRequest aLockedOnSavingRequest; - if (aAnyRequest >>= aLockedOnSavingRequest ) - { - handleLockedDocumentRequest( aLockedOnSavingRequest.DocumentURL, - aLockedOnSavingRequest.UserInfo, - rRequest->getContinuations(), - UUI_DOC_SAVE_LOCK ); - return true; - } + if ( handleCookiesRequest( rRequest ) ) + return true; - document::ChangedByOthersRequest aChangedByOthersRequest; - if (aAnyRequest >>= aChangedByOthersRequest ) - { - handleChangedByOthersRequest( rRequest->getContinuations() ); - return true; - } + if ( handleNoSuchFilterRequest( rRequest ) ) + return true; - document::LockFileIgnoreRequest aLockFileIgnoreRequest; - if (aAnyRequest >>= aLockFileIgnoreRequest ) - { - handleLockFileIgnoreRequest( rRequest->getContinuations() ); - return true; - } + if ( handleAmbigousFilterRequest( rRequest ) ) + return true; - task::DocumentMacroConfirmationRequest aMacroConfirmRequest; - if (aAnyRequest >>= aMacroConfirmRequest) - { - handleMacroConfirmRequest( - aMacroConfirmRequest.DocumentURL, - aMacroConfirmRequest.DocumentStorage, - ODFVER_012_TEXT, - aMacroConfirmRequest.DocumentSignatureInformation, - rRequest->getContinuations() - ); - return true; - } + if ( handleFilterOptionsRequest( rRequest ) ) + return true; - task::DocumentMacroConfirmationRequest2 aMacroConfirmRequest2; - if (aAnyRequest >>= aMacroConfirmRequest2) - { - handleMacroConfirmRequest( - aMacroConfirmRequest2.DocumentURL, - aMacroConfirmRequest2.DocumentZipStorage, - aMacroConfirmRequest2.DocumentVersion, - aMacroConfirmRequest2.DocumentSignatureInformation, - rRequest->getContinuations() - ); - return true; - } + if ( handleLockedDocumentRequest( rRequest ) ) + return true; - task::FutureDocumentVersionProductUpdateRequest aProductUpdateRequest; - if (aAnyRequest >>= aProductUpdateRequest) - { - handleFutureDocumentVersionUpdateRequest( - aProductUpdateRequest, - rRequest->getContinuations() - ); - return true; - } + if ( handleChangedByOthersRequest( rRequest ) ) + return true; - return false; -} + if ( handleLockFileIgnoreRequest( rRequest ) ) + return true; -bool -UUIInteractionHelper::handleErrorHandlerRequests( - uno::Reference< task::XInteractionRequest > const & rRequest, - bool bObtainErrorStringOnly, - bool & bHasErrorString, - rtl::OUString & rErrorString) -{ - uno::Any aAnyRequest(rRequest->getRequest()); - - task::ErrorCodeRequest aErrorCodeRequest; - if (aAnyRequest >>= aErrorCodeRequest) - { - handleGenericErrorRequest( aErrorCodeRequest.ErrCode, - rRequest->getContinuations(), - bObtainErrorStringOnly, - bHasErrorString, - rErrorString); - return true; - } - - task::ErrorCodeIOException aErrorCodeIOException; - if (aAnyRequest >>= aErrorCodeIOException) - { - handleGenericErrorRequest( aErrorCodeIOException.ErrCode, - rRequest->getContinuations(), - bObtainErrorStringOnly, - bHasErrorString, - rErrorString); - return true; - } - - return false; -} + task::DocumentMacroConfirmationRequest aMacroConfirmRequest; + if (aAnyRequest >>= aMacroConfirmRequest) + { + handleMacroConfirmRequest( + aMacroConfirmRequest.DocumentURL, + aMacroConfirmRequest.DocumentStorage, + ODFVER_012_TEXT, + aMacroConfirmRequest.DocumentSignatureInformation, + rRequest->getContinuations()); + return true; + } -bool -UUIInteractionHelper::handle_impl( - uno::Reference< task::XInteractionRequest > const & rRequest) - SAL_THROW((uno::RuntimeException)) -{ - try - { - if (!rRequest.is()) - return false; + task::DocumentMacroConfirmationRequest2 aMacroConfirmRequest2; + if (aAnyRequest >>= aMacroConfirmRequest2) + { + handleMacroConfirmRequest( + aMacroConfirmRequest2.DocumentURL, + aMacroConfirmRequest2.DocumentZipStorage, + aMacroConfirmRequest2.DocumentVersion, + aMacroConfirmRequest2.DocumentSignatureInformation, + rRequest->getContinuations()); + return true; + } - //////////////////////////////////////////////////////////// - // Display Messagebox - //////////////////////////////////////////////////////////// - bool bDummy = false; - rtl::OUString aDummy; - if (! handleMessageboxRequests(rRequest, false, bDummy, aDummy)) - { - //////////////////////////////////////////////////////////// - // Use ErrorHandler::HandleError - //////////////////////////////////////////////////////////// - if (!handleErrorHandlerRequests(rRequest, false, bDummy, aDummy)) + task::FutureDocumentVersionProductUpdateRequest + aProductUpdateRequest; + if (aAnyRequest >>= aProductUpdateRequest) { - //////////////////////////////////////////////////////////// - // Display Special Dialog - //////////////////////////////////////////////////////////// - if (!handleDialogRequests(rRequest)) - { - //////////////////////////////////////////////////////////// - // Use customized InteractionHandler from configuration - //////////////////////////////////////////////////////////// - InteractionHandlerDataList dataList; - getInteractionHandlerList(dataList); - - InteractionHandlerDataList::const_iterator aEnd( - dataList.end()); - for (InteractionHandlerDataList::const_iterator aIt( - dataList.begin()); - aIt != aEnd; - ++aIt) - { - uno::Reference< uno::XInterface > xIfc; - - try - { - xIfc = m_xServiceFactory->createInstance( - aIt->ServiceName); - } - catch ( uno::Exception const & ) - { - } - - uno::Reference< lang::XInitialization > - xInitialization( xIfc, uno::UNO_QUERY ); - - OSL_ENSURE( xInitialization.is(), - "Custom Interactionhandler does not " - "implement mandatory interface " - "XInitialization!" ); - if (xInitialization.is()) - { - uno::Sequence< uno::Any > propertyValues(1); - beans::PropertyValue aProperty; - - aProperty.Name - = rtl::OUString::createFromAscii( "Parent" ); - aProperty.Value <<= getParentXWindow(); - propertyValues[ 0 ] <<= aProperty; - - xInitialization->initialize(propertyValues); - } - - uno::Reference< task::XInteractionHandler2 > - xIH( xIfc, uno::UNO_QUERY ); - - OSL_ENSURE( xIH.is(), - "Custom Interactionhandler does not " - "implement mandatory interface " - "XInteractionHandler2!" ); - if (xIH.is() && xIH->handleInteractionRequest(rRequest)) - return true; - } - return false; - } + handleFutureDocumentVersionUpdateRequest( + aProductUpdateRequest, + rRequest->getContinuations()); + return true; } + + /////////////////////////////////////////////////////////////// + // Last chance: try to find and use another IH for the request. + /////////////////////////////////////////////////////////////// + if (tryOtherInteractionHandler( rRequest )) + return true; } + + // Not handled. + return false; } catch (std::bad_alloc const &) { @@ -1432,12 +866,12 @@ UUIInteractionHelper::handle_impl( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")), uno::Reference< uno::XInterface >()); } - return true; } void UUIInteractionHelper::getInteractionHandlerList( InteractionHandlerDataList &rdataList) + SAL_THROW((uno::RuntimeException)) { try { @@ -1448,11 +882,11 @@ UUIInteractionHelper::getInteractionHandlerList( uno::UNO_QUERY ); if ( !xConfigProv.is() ) - { - OSL_ENSURE( false, - "GetInteractionHandlerList - No config provider!" ); - return; - } + throw uno::RuntimeException( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + "unable to instanciate config provider service")), + uno::Reference< uno::XInterface >()); rtl::OUStringBuffer aFullPath; aFullPath.appendAscii( @@ -1472,20 +906,20 @@ UUIInteractionHelper::getInteractionHandlerList( aArguments ) ); if ( !xInterface.is() ) - { - OSL_ENSURE( false, - "GetInteractionHandlerList - No config access!" ); - return; - } + throw uno::RuntimeException( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + "unable to instanciate config access")), + uno::Reference< uno::XInterface >()); uno::Reference< container::XNameAccess > xNameAccess( xInterface, uno::UNO_QUERY ); if ( !xNameAccess.is() ) - { - OSL_ENSURE( false, - "GetInteractionHandlerList - No XNameAccess!" ); - return; - } + throw uno::RuntimeException( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + "config access does not implement XNameAccess")), + uno::Reference< uno::XInterface >()); uno::Sequence< rtl::OUString > aElems = xNameAccess->getElementNames(); const rtl::OUString* pElems = aElems.getConstArray(); @@ -1497,12 +931,11 @@ UUIInteractionHelper::getInteractionHandlerList( xHierNameAccess( xInterface, uno::UNO_QUERY ); if ( !xHierNameAccess.is() ) - { - OSL_ENSURE( false, - "GetInteractionHandlerList - " - "No XHierarchicalNameAccess!" ); - return; - } + throw uno::RuntimeException( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + "config access does not implement XHierarchicalNameAccess")), + uno::Reference< uno::XInterface >()); // Iterate over children. for ( sal_Int32 n = 0; n < nCount; ++n ) @@ -1545,6 +978,10 @@ UUIInteractionHelper::getInteractionHandlerList( } } } + catch ( uno::RuntimeException const & ) + { + throw; + } catch ( uno::Exception const & ) { OSL_ENSURE( false, "GetInteractionHandlerList - Caught Exception!" ); @@ -1583,7 +1020,8 @@ UUIInteractionHelper::getParentXWindow() } rtl::OUString -UUIInteractionHelper::getContextProperty() SAL_THROW(()) +UUIInteractionHelper::getContextProperty() + SAL_THROW(()) { osl::MutexGuard aGuard(m_aPropertyMutex); for (sal_Int32 i = 0; i < m_aProperties.getLength(); ++i) @@ -1601,924 +1039,113 @@ UUIInteractionHelper::getContextProperty() SAL_THROW(()) return rtl::OUString(); } -String -GetContentPart( const String& _rRawString ) -{ - // search over some parts to find a string - //static char* aIDs[] = { "CN", "OU", "O", "E", NULL }; - static char const * aIDs[] = { "CN=", "OU=", "O=", "E=", NULL };// By CP - String sPart; - int i = 0; - while ( aIDs[i] ) - { - String sPartId = String::CreateFromAscii( aIDs[i++] ); - xub_StrLen nContStart = _rRawString.Search( sPartId ); - if ( nContStart != STRING_NOTFOUND ) - { - nContStart = nContStart + sPartId.Len(); - xub_StrLen nContEnd - = _rRawString.Search( sal_Unicode( ',' ), nContStart ); - sPart = String( _rRawString, nContStart, nContEnd - nContStart ); - break; - } - } - return sPart; -} - -sal_Bool -UUIInteractionHelper::executeUnknownAuthDialog( - const uno::Reference< security::XCertificate >& rXCert) +uno::Reference< task::XInteractionHandler > +UUIInteractionHelper::getInteractionHandler() SAL_THROW((uno::RuntimeException)) { + uno::Reference< task::XInteractionHandler > xIH; try { - vos::OGuard aGuard(Application::GetSolarMutex()); - - std::auto_ptr< ResMgr > xManager( - ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); - std::auto_ptr< UnknownAuthDialog > xDialog( - new UnknownAuthDialog( getParentProperty(), - rXCert, - m_xServiceFactory, - xManager.get())); - - // Get correct ressource string - rtl::OUString aMessage; - - std::vector< rtl::OUString > aArguments; - aArguments.push_back( GetContentPart( rXCert->getSubjectName()) ); - - if (xManager.get()) - { - ResId aResId(RID_UUI_ERRHDL, *xManager.get()); - if (ErrorResource(aResId).getString( - ERRCODE_UUI_UNKNOWNAUTH_UNTRUSTED, &aMessage)) - { - aMessage = replaceMessageWithArguments( aMessage, aArguments ); - xDialog->setDescriptionText( aMessage ); - } - } - - return static_cast (xDialog->Execute()); + xIH.set(m_xServiceFactory->createInstanceWithArguments( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.task.InteractionHandler")), + m_aProperties), + uno::UNO_QUERY); } - catch (std::bad_alloc const &) - { + catch (uno::Exception const &) + {} + + if (!xIH.is()) throw uno::RuntimeException( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")), - uno::Reference< uno::XInterface >()); - } + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + "unable to instanciate Interaction Handler service")), + uno::Reference< uno::XInterface >()); + return xIH; } -rtl::OUString -UUIInteractionHelper::getLocalizedDatTimeStr( util::DateTime aDateTime ) -{ - rtl::OUString aDateTimeStr; - Date aDate; - Time aTime; - - aDate = Date( aDateTime.Day, aDateTime.Month, aDateTime.Year ); - aTime = Time( aDateTime.Hours, aDateTime.Minutes, aDateTime.Seconds ); - - LanguageType eUILang = Application::GetSettings().GetUILanguage(); - SvNumberFormatter *pNumberFormatter - = new SvNumberFormatter( m_xServiceFactory, eUILang ); - String aTmpStr; - Color* pColor = NULL; - Date* pNullDate = pNumberFormatter->GetNullDate(); - sal_uInt32 nFormat - = pNumberFormatter->GetStandardFormat( NUMBERFORMAT_DATE, eUILang ); - - pNumberFormatter->GetOutputString( - aDate - *pNullDate, nFormat, aTmpStr, &pColor ); - aDateTimeStr = aTmpStr + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ")); - - nFormat = pNumberFormatter->GetStandardFormat( NUMBERFORMAT_TIME, eUILang ); - pNumberFormatter->GetOutputString( - aTime.GetTimeInDays(), nFormat, aTmpStr, &pColor ); - aDateTimeStr += aTmpStr; - - return aDateTimeStr; -} +namespace { -sal_Bool -UUIInteractionHelper::executeSSLWarnDialog( - const uno::Reference< security::XCertificate >& rXCert, - sal_Int32 const & failure, - const rtl::OUString & hostName ) +USHORT +executeMessageBox( + Window * pParent, + rtl::OUString const & rTitle, + rtl::OUString const & rMessage, + WinBits nButtonMask ) SAL_THROW((uno::RuntimeException)) { - try - { - vos::OGuard aGuard(Application::GetSolarMutex()); - - std::auto_ptr< ResMgr > xManager( - ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); - std::auto_ptr< SSLWarnDialog > xDialog( - new SSLWarnDialog( getParentProperty(), - rXCert, - m_xServiceFactory, - xManager.get())); - - // Get correct ressource string - rtl::OUString aMessage_1; - std::vector< rtl::OUString > aArguments_1; - - switch( failure ) - { - case SSLWARN_TYPE_DOMAINMISMATCH: - aArguments_1.push_back( hostName ); - aArguments_1.push_back( - GetContentPart( rXCert->getSubjectName()) ); - aArguments_1.push_back( hostName ); - break; - case SSLWARN_TYPE_EXPIRED: - aArguments_1.push_back( - GetContentPart( rXCert->getSubjectName()) ); - aArguments_1.push_back( - getLocalizedDatTimeStr( rXCert->getNotValidAfter() ) ); - aArguments_1.push_back( - getLocalizedDatTimeStr( rXCert->getNotValidAfter() ) ); - break; - case SSLWARN_TYPE_INVALID: - break; - } - - if (xManager.get()) - { - ResId aResId(RID_UUI_ERRHDL, *xManager.get()); - if (ErrorResource(aResId).getString( - ERRCODE_AREA_UUI_UNKNOWNAUTH + failure + DESCRIPTION_1, - &aMessage_1)) - { - aMessage_1 - = replaceMessageWithArguments( aMessage_1, aArguments_1 ); - xDialog->setDescription1Text( aMessage_1 ); - } + vos::OGuard aGuard(Application::GetSolarMutex()); - rtl::OUString aTitle; - ErrorResource(aResId).getString( - ERRCODE_AREA_UUI_UNKNOWNAUTH + failure + TITLE, &aTitle); - xDialog->SetText( aTitle ); - } + MessBox xBox( pParent, nButtonMask, rTitle, rMessage ); - return static_cast (xDialog->Execute()); - } - catch (std::bad_alloc const &) + USHORT aResult = xBox.Execute(); + switch( aResult ) { - throw uno::RuntimeException( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")), - uno::Reference< uno::XInterface >()); + case BUTTONID_OK: + aResult = ERRCODE_BUTTON_OK; + break; + case BUTTONID_CANCEL: + aResult = ERRCODE_BUTTON_CANCEL; + break; + case BUTTONID_YES: + aResult = ERRCODE_BUTTON_YES; + break; + case BUTTONID_NO: + aResult = ERRCODE_BUTTON_NO; + break; + case BUTTONID_RETRY: + aResult = ERRCODE_BUTTON_RETRY; + break; } -} - -void -UUIInteractionHelper::executeLoginDialog(LoginErrorInfo & rInfo, - rtl::OUString const & rRealm) - SAL_THROW((uno::RuntimeException)) -{ - try - { - vos::OGuard aGuard(Application::GetSolarMutex()); - - bool bAccount = (rInfo.GetFlags() & LOGINERROR_FLAG_MODIFY_ACCOUNT) - != 0; - bool bSavePassword = rInfo.GetIsPersistentPassword() - || rInfo.GetIsSavePassword(); - bool bCanUseSysCreds = rInfo.GetCanUseSystemCredentials(); - - sal_uInt16 nFlags = 0; - if (rInfo.GetPath().Len() == 0) - nFlags |= LF_NO_PATH; - if (rInfo.GetErrorText().Len() == 0) - nFlags |= LF_NO_ERRORTEXT; - if (!bAccount) - nFlags |= LF_NO_ACCOUNT; - if (!(rInfo.GetFlags() & LOGINERROR_FLAG_MODIFY_USER_NAME)) - nFlags |= LF_USERNAME_READONLY; - - if (!bSavePassword) - nFlags |= LF_NO_SAVEPASSWORD; - - if (!bCanUseSysCreds) - nFlags |= LF_NO_USESYSCREDS; - - std::auto_ptr< ResMgr > xManager( - ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); - UniString aRealm(rRealm); - std::auto_ptr< LoginDialog > xDialog( - new LoginDialog(getParentProperty(), - nFlags, - rInfo.GetServer(), - &aRealm, - xManager.get())); - if (rInfo.GetErrorText().Len() != 0) - xDialog->SetErrorText(rInfo.GetErrorText()); - xDialog->SetName(rInfo.GetUserName()); - if (bAccount) - xDialog->ClearAccount(); - else - xDialog->ClearPassword(); - xDialog->SetPassword(rInfo.GetPassword()); - if (bSavePassword) - { - xDialog-> - SetSavePasswordText(ResId(rInfo.GetIsPersistentPassword() ? - RID_SAVE_PASSWORD : - RID_KEEP_PASSWORD, - *xManager.get())); - xDialog->SetSavePassword(rInfo.GetIsSavePassword()); - } - - if ( bCanUseSysCreds ) - xDialog->SetUseSystemCredentials( - rInfo.GetIsUseSystemCredentials() ); - - rInfo.SetResult(xDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK : - ERRCODE_BUTTON_CANCEL); - rInfo.SetUserName(xDialog->GetName()); - rInfo.SetPassword(xDialog->GetPassword()); - rInfo.SetAccount(xDialog->GetAccount()); - rInfo.SetSavePassword(xDialog->IsSavePassword()); - - if ( bCanUseSysCreds ) - rInfo.SetIsUseSystemCredentials( xDialog->IsUseSystemCredentials() ); - } - catch (std::bad_alloc const &) - { - throw uno::RuntimeException( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")), - uno::Reference< uno::XInterface >()); - } + return aResult; } -void -UUIInteractionHelper::executeMasterPasswordDialog( - LoginErrorInfo & rInfo, - task::PasswordRequestMode nMode) - SAL_THROW((uno::RuntimeException)) -{ - rtl::OString aMaster; - try - { - vos::OGuard aGuard(Application::GetSolarMutex()); - - std::auto_ptr< ResMgr > xManager( - ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); - if( nMode == task::PasswordRequestMode_PASSWORD_CREATE ) - { - std::auto_ptr< MasterPasswordCreateDialog > xDialog( - new MasterPasswordCreateDialog( - getParentProperty(), xManager.get())); - rInfo.SetResult(xDialog->Execute() - == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL); - aMaster = rtl::OUStringToOString( - xDialog->GetMasterPassword(), RTL_TEXTENCODING_UTF8); - } - else - { - std::auto_ptr< MasterPasswordDialog > xDialog( - new MasterPasswordDialog( - getParentProperty(), nMode, xManager.get())); - rInfo.SetResult(xDialog->Execute() - == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL); - aMaster = rtl::OUStringToOString( - xDialog->GetMasterPassword(), RTL_TEXTENCODING_UTF8); - } - } - catch (std::bad_alloc const &) - { - throw uno::RuntimeException( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")), - uno::Reference< uno::XInterface >()); - } +enum NameClashResolveDialogResult { ABORT, RENAME, OVERWRITE }; - sal_uInt8 aKey[RTL_DIGEST_LENGTH_MD5]; - rtl_digest_PBKDF2(aKey, - RTL_DIGEST_LENGTH_MD5, - reinterpret_cast< sal_uInt8 const * >(aMaster.getStr()), - aMaster.getLength(), - reinterpret_cast< sal_uInt8 const * >( - "3B5509ABA6BC42D9A3A1F3DAD49E56A51"), - 32, - 1000); - - rtl::OUStringBuffer aBuffer; - for (int i = 0; i < RTL_DIGEST_LENGTH_MD5; ++i) - { - aBuffer.append(static_cast< sal_Unicode >('a' + (aKey[i] >> 4))); - aBuffer.append(static_cast< sal_Unicode >('a' + (aKey[i] & 15))); - } - rInfo.SetPassword(aBuffer.makeStringAndClear()); +NameClashResolveDialogResult +executeNameClashResolveDialog( + Window * pParent, + rtl::OUString const & /*rTargetFolderURL*/, + rtl::OUString const & /*rClashingName*/, + rtl::OUString & /*rProposedNewName*/) +{ + // @@@ Todo DV: execute overwrite-rename dialog, deliver result + OSL_ENSURE( false, + "executeNameClashResolveDialog not yet implemented!" ); + return ABORT; } -void -UUIInteractionHelper::executePasswordDialog( - LoginErrorInfo & rInfo, - task::PasswordRequestMode nMode, - ::rtl::OUString aDocName) - SAL_THROW((uno::RuntimeException)) +NameClashResolveDialogResult +executeSimpleNameClashResolveDialog( + Window * pParent, + rtl::OUString const & /*rTargetFolderURL*/, + rtl::OUString const & /*rClashingName*/, + rtl::OUString & /*rProposedNewName*/) { - try - { - vos::OGuard aGuard(Application::GetSolarMutex()); - - std::auto_ptr< ResMgr > xManager( - ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); - if( nMode == task::PasswordRequestMode_PASSWORD_CREATE ) - { - std::auto_ptr< PasswordCreateDialog > xDialog( - new PasswordCreateDialog( getParentProperty(), xManager.get())); - - rInfo.SetResult(xDialog->Execute() - == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL); - rInfo.SetPassword( xDialog->GetPassword() ); - } - else - { - std::auto_ptr< PasswordDialog > xDialog( - new PasswordDialog( - getParentProperty(), nMode, xManager.get(), aDocName )); - - rInfo.SetResult(xDialog->Execute() - == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL); - rInfo.SetPassword( xDialog->GetPassword() ); - } - } - catch (std::bad_alloc const &) - { - throw uno::RuntimeException( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")), - uno::Reference< uno::XInterface>()); - } + // @@@ Todo DV: execute rename-only dialog, deliver result + OSL_ENSURE( false, + "executeSimpleNameClashResolveDialog not yet implemented!" ); + return ABORT; } +} // namespace + void -UUIInteractionHelper::executeMSPasswordDialog( - LoginErrorInfo & rInfo, - task::PasswordRequestMode nMode, - ::rtl::OUString aDocName) - SAL_THROW((uno::RuntimeException)) +UUIInteractionHelper::handleNameClashResolveRequest( + ucb::NameClashResolveRequest const & rRequest, + uno::Sequence< uno::Reference< + task::XInteractionContinuation > > const & rContinuations) + SAL_THROW((uno::RuntimeException)) { - try - { - vos::OGuard aGuard(Application::GetSolarMutex()); - - std::auto_ptr< ResMgr > xManager( - ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); - if( nMode == task::PasswordRequestMode_PASSWORD_CREATE ) - { - std::auto_ptr< PasswordCreateDialog > xDialog( - new PasswordCreateDialog( - getParentProperty(), xManager.get(), true)); + OSL_ENSURE( + rRequest.TargetFolderURL.getLength() > 0, + "NameClashResolveRequest must not contain empty TargetFolderURL" ); - rInfo.SetResult(xDialog->Execute() - == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL); - rInfo.SetPassword( xDialog->GetPassword() ); - } - else - { - std::auto_ptr< PasswordDialog > xDialog( - new PasswordDialog( - getParentProperty(), nMode, xManager.get(), aDocName )); - - rInfo.SetResult(xDialog->Execute() - == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL); - rInfo.SetPassword( xDialog->GetPassword() ); - } - } - catch (std::bad_alloc const &) - { - throw uno::RuntimeException( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")), - uno::Reference< uno::XInterface>()); - } -} - -void -UUIInteractionHelper::executeCookieDialog(CntHTTPCookieRequest & rRequest) - SAL_THROW((uno::RuntimeException)) -{ - try - { - vos::OGuard aGuard(Application::GetSolarMutex()); - - std::auto_ptr< ResMgr > xManager( - ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); - std::auto_ptr< CookiesDialog > xDialog( - new CookiesDialog(getParentProperty(), &rRequest, xManager.get())); - xDialog->Execute(); - } - catch (std::bad_alloc const &) - { - throw uno::RuntimeException( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")), - uno::Reference< uno::XInterface>()); - } -} - -void -UUIInteractionHelper::executeFilterDialog( - rtl::OUString const & rURL , - uui::FilterNameList const & rFilters, - rtl::OUString & rFilter ) - SAL_THROW((uno::RuntimeException)) -{ - try - { - vos::OGuard aGuard(Application::GetSolarMutex()); - - std::auto_ptr< ResMgr > xManager( - ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); - - std::auto_ptr< uui::FilterDialog > xDialog( - new uui::FilterDialog(getParentProperty(), xManager.get())); - - xDialog->SetURL(rURL); - xDialog->ChangeFilters(&rFilters); - - uui::FilterNameListPtr pSelected = rFilters.end(); - if( xDialog->AskForFilter( pSelected ) ) - { - rFilter = pSelected->sInternal; - } - } - catch (std::bad_alloc const &) - { - throw uno::RuntimeException( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")), - uno::Reference< uno::XInterface >()); - } -} - -USHORT -UUIInteractionHelper::executeErrorDialog( - task::InteractionClassification eClassification, - rtl::OUString const & rContext, - rtl::OUString const & rMessage, - WinBits nButtonMask) - SAL_THROW((uno::RuntimeException)) -{ - vos::OGuard aGuard(Application::GetSolarMutex()); - - rtl::OUStringBuffer aText(rContext); - if (rContext.getLength() != 0 && rMessage.getLength() != 0) - aText.appendAscii(RTL_CONSTASCII_STRINGPARAM(":\n")); - //TODO! must be internationalized - aText.append(rMessage); - - std::auto_ptr< MessBox > xBox; - try - { - switch (eClassification) - { - case task::InteractionClassification_ERROR: - xBox.reset(new ErrorBox(getParentProperty(), - nButtonMask, - aText.makeStringAndClear())); - break; - - case task::InteractionClassification_WARNING: - xBox.reset(new WarningBox(getParentProperty(), - nButtonMask, - aText.makeStringAndClear())); - break; - - case task::InteractionClassification_INFO: - if ((nButtonMask & 0x01F00000) == WB_DEF_OK) - //TODO! missing win bit button mask define (want to ignore - // any default button settings)... - xBox.reset(new InfoBox(getParentProperty(), - aText.makeStringAndClear())); - else - xBox.reset(new ErrorBox(getParentProperty(), - nButtonMask, - aText.makeStringAndClear())); - break; - - case task::InteractionClassification_QUERY: - xBox.reset(new QueryBox(getParentProperty(), - nButtonMask, - aText.makeStringAndClear())); - break; - - default: - OSL_ASSERT(false); - break; - } - } - catch (std::bad_alloc const &) - { - throw uno::RuntimeException( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")), - uno::Reference< uno::XInterface >()); - } - - USHORT aResult = xBox->Execute(); - switch( aResult ) - { - case BUTTONID_OK: - aResult = ERRCODE_BUTTON_OK; - break; - case BUTTONID_CANCEL: - aResult = ERRCODE_BUTTON_CANCEL; - break; - case BUTTONID_YES: - aResult = ERRCODE_BUTTON_YES; - break; - case BUTTONID_NO: - aResult = ERRCODE_BUTTON_NO; - break; - case BUTTONID_RETRY: - aResult = ERRCODE_BUTTON_RETRY; - break; - } - - return aResult; -} - -USHORT -UUIInteractionHelper::executeMessageBox( - rtl::OUString const & rTitle, - rtl::OUString const & rMessage, - WinBits nButtonMask ) - SAL_THROW((uno::RuntimeException)) -{ - vos::OGuard aGuard(Application::GetSolarMutex()); - - MessBox xBox( getParentProperty(), nButtonMask, rTitle, rMessage ); - - USHORT aResult = xBox.Execute(); - switch( aResult ) - { - case BUTTONID_OK: - aResult = ERRCODE_BUTTON_OK; - break; - case BUTTONID_CANCEL: - aResult = ERRCODE_BUTTON_CANCEL; - break; - case BUTTONID_YES: - aResult = ERRCODE_BUTTON_YES; - break; - case BUTTONID_NO: - aResult = ERRCODE_BUTTON_NO; - break; - case BUTTONID_RETRY: - aResult = ERRCODE_BUTTON_RETRY; - break; - } - - return aResult; -} - -uno::Reference< task::XInteractionHandler > -UUIInteractionHelper::getInteractionHandler() const - SAL_THROW((uno::RuntimeException)) -{ - uno::Reference< task::XInteractionHandler > xIH; - try - { - xIH.set(m_xServiceFactory->createInstanceWithArguments( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.task.InteractionHandler")), - m_aProperties), - uno::UNO_QUERY); - } - catch (uno::Exception const &) - {} - - if (!xIH.is()) - throw uno::RuntimeException( - rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( - "unable to instanciate Interaction Handler service")), - uno::Reference< uno::XInterface >()); - return xIH; -} - -void -UUIInteractionHelper::handleAuthenticationRequest( - ucb::AuthenticationRequest const & rRequest, - uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & - rContinuations, - const rtl::OUString & rURL) - SAL_THROW((uno::RuntimeException)) -{ - uno::Reference< task::XInteractionRetry > xRetry; - uno::Reference< task::XInteractionAbort > xAbort; - uno::Reference< ucb::XInteractionSupplyAuthentication > - xSupplyAuthentication; - uno::Reference< ucb::XInteractionSupplyAuthentication2 > - xSupplyAuthentication2; - getContinuations(rContinuations, &xRetry, &xAbort, &xSupplyAuthentication); - if (xSupplyAuthentication.is()) - xSupplyAuthentication2.set(xSupplyAuthentication, uno::UNO_QUERY); - - uno::Reference< task::XInteractionHandler > xIH(getInteractionHandler()); - - ////////////////////////// - // First, try to obatin credentials from password container service. - uui::PasswordContainerHelper aPwContainerHelper(m_xServiceFactory); - if (aPwContainerHelper.handleAuthenticationRequest(rRequest, - xSupplyAuthentication, - rURL, - xIH)) - { - xSupplyAuthentication->select(); - return; - } - - ////////////////////////// - // Second, try to obtain credentials from user via password dialog. - bool bRemember; - bool bRememberPersistent; - if (xSupplyAuthentication.is()) - { - ucb::RememberAuthentication eDefault; - uno::Sequence< ucb::RememberAuthentication > - aModes(xSupplyAuthentication->getRememberPasswordModes(eDefault)); - bRemember = eDefault != ucb::RememberAuthentication_NO; - bRememberPersistent = false; - for (sal_Int32 i = 0; i < aModes.getLength(); ++i) - if (aModes[i] == ucb::RememberAuthentication_PERSISTENT) - { - bRememberPersistent = true; - break; - } - } - else - { - bRemember = false; - bRememberPersistent = false; - } - - sal_Bool bCanUseSystemCredentials; - sal_Bool bDefaultUseSystemCredentials; - if (xSupplyAuthentication2.is()) - { - bCanUseSystemCredentials - = xSupplyAuthentication2->canUseSystemCredentials( - bDefaultUseSystemCredentials); - } - else - { - bCanUseSystemCredentials = sal_False; - bDefaultUseSystemCredentials = sal_False; - } - - LoginErrorInfo aInfo; - aInfo.SetTitle(rRequest.ServerName); - aInfo.SetServer(rRequest.ServerName); - if (rRequest.HasAccount) - aInfo.SetAccount(rRequest.Account); - if (rRequest.HasUserName) - aInfo.SetUserName(rRequest.UserName); - if (rRequest.HasPassword) - aInfo.SetPassword(rRequest.Password); - aInfo.SetErrorText(rRequest.Diagnostic); - aInfo.SetPersistentPassword(bRememberPersistent); - aInfo.SetSavePassword(bRemember); - aInfo.SetCanUseSystemCredentials(bCanUseSystemCredentials); - aInfo.SetIsUseSystemCredentials( bDefaultUseSystemCredentials ); - aInfo.SetModifyAccount(rRequest.HasAccount - && xSupplyAuthentication.is() - && xSupplyAuthentication->canSetAccount()); - aInfo.SetModifyUserName(rRequest.HasUserName - && xSupplyAuthentication.is() - && xSupplyAuthentication->canSetUserName()); - executeLoginDialog(aInfo, - rRequest.HasRealm ? rRequest.Realm : rtl::OUString()); - switch (aInfo.GetResult()) - { - case ERRCODE_BUTTON_OK: - if (xSupplyAuthentication.is()) - { - if (xSupplyAuthentication->canSetUserName()) - xSupplyAuthentication->setUserName(aInfo.GetUserName()); - if (xSupplyAuthentication->canSetPassword()) - xSupplyAuthentication->setPassword(aInfo.GetPassword()); - xSupplyAuthentication-> - setRememberPassword( - aInfo.GetIsSavePassword() ? - bRememberPersistent ? - ucb::RememberAuthentication_PERSISTENT : - ucb::RememberAuthentication_SESSION : - ucb::RememberAuthentication_NO); - if (rRequest.HasRealm) - { - if (xSupplyAuthentication->canSetRealm()) - xSupplyAuthentication->setRealm(aInfo.GetAccount()); - } - else if (xSupplyAuthentication->canSetAccount()) - xSupplyAuthentication->setAccount(aInfo.GetAccount()); - - if ( xSupplyAuthentication2.is() && bCanUseSystemCredentials ) - xSupplyAuthentication2->setUseSystemCredentials( - aInfo.GetIsUseSystemCredentials() ); - - xSupplyAuthentication->select(); - } - - ////////////////////////// - // Third, store credentials in password container. - - if ( aInfo.GetIsUseSystemCredentials() ) - { - if (aInfo.GetIsSavePassword()) - { - aPwContainerHelper.addRecord( - rURL.getLength() ? rURL : rRequest.ServerName, - rtl::OUString(), // empty u/p -> sys creds - uno::Sequence< rtl::OUString >(), - xIH, - bRememberPersistent); - } - } - // Empty user name can not be valid: - else if (aInfo.GetUserName().Len() != 0) - { - if (aInfo.GetIsSavePassword()) - { - uno::Sequence< rtl::OUString > - aPassList(aInfo.GetAccount().Len() == 0 ? 1 : 2); - aPassList[0] = aInfo.GetPassword(); - if (aInfo.GetAccount().Len() != 0) - aPassList[1] = aInfo.GetAccount(); - - aPwContainerHelper.addRecord( - rURL.getLength() ? rURL : rRequest.ServerName, - aInfo.GetUserName(), - aPassList, - xIH, - bRememberPersistent); - } - } - break; - - case ERRCODE_BUTTON_RETRY: - if (xRetry.is()) - xRetry->select(); - break; - - default: - if (xAbort.is()) - xAbort->select(); - break; - } -} - -sal_Bool -UUIInteractionHelper::isDomainMatch( - rtl::OUString hostName, rtl::OUString certHostName) -{ - if (hostName.equalsIgnoreAsciiCase( certHostName )) - return sal_True; - - if ( 0 == certHostName.indexOf( rtl::OUString::createFromAscii( "*" ) ) && - hostName.getLength() >= certHostName.getLength() ) - { - rtl::OUString cmpStr = certHostName.copy( 1 ); - - if ( hostName.matchIgnoreAsciiCase( - cmpStr, hostName.getLength() - cmpStr.getLength()) ) - return sal_True; - } - - return sal_False; -} - -void -UUIInteractionHelper::handleCertificateValidationRequest( - ucb::CertificateValidationRequest const & rRequest, - uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & - rContinuations) - SAL_THROW((uno::RuntimeException)) -{ - uno::Reference< task::XInteractionHandler > xIH( getInteractionHandler() ); - - uno::Reference< task::XInteractionApprove > xApprove; - uno::Reference< task::XInteractionAbort > xAbort; - getContinuations(rContinuations, &xApprove, &xAbort); - - sal_Int32 failures = rRequest.CertificateValidity; - sal_Bool trustCert = sal_True; - - if ( ((failures & security::CertificateValidity::UNTRUSTED) - == security::CertificateValidity::UNTRUSTED ) || - ((failures & security::CertificateValidity::ISSUER_UNTRUSTED) - == security::CertificateValidity::ISSUER_UNTRUSTED) || - ((failures & security::CertificateValidity::ROOT_UNTRUSTED) - == security::CertificateValidity::ROOT_UNTRUSTED) ) - { - if ( executeUnknownAuthDialog( rRequest.Certificate ) ) - trustCert = sal_True; - else - trustCert = sal_False; - } - - if ( (!isDomainMatch( - rRequest.HostName, - GetContentPart( - rRequest.Certificate->getSubjectName()) )) && - trustCert ) - { - if ( executeSSLWarnDialog( rRequest.Certificate, - SSLWARN_TYPE_DOMAINMISMATCH, - rRequest.HostName ) ) - trustCert = sal_True; - else - trustCert = sal_False; - } - - if ( (((failures & security::CertificateValidity::TIME_INVALID) - == security::CertificateValidity::TIME_INVALID) || - ((failures & security::CertificateValidity::NOT_TIME_NESTED) - == security::CertificateValidity::NOT_TIME_NESTED)) && - trustCert ) - { - if ( executeSSLWarnDialog( rRequest.Certificate, - SSLWARN_TYPE_EXPIRED, - rRequest.HostName ) ) - trustCert = sal_True; - else - trustCert = sal_False; - } - - if ( (((failures & security::CertificateValidity::REVOKED) - == security::CertificateValidity::REVOKED) || - ((failures & security::CertificateValidity::SIGNATURE_INVALID) - == security::CertificateValidity::SIGNATURE_INVALID) || - ((failures & security::CertificateValidity::EXTENSION_INVALID) - == security::CertificateValidity::EXTENSION_INVALID) || - ((failures & security::CertificateValidity::INVALID) - == security::CertificateValidity::INVALID)) && - trustCert ) - { - if ( executeSSLWarnDialog( rRequest.Certificate, - SSLWARN_TYPE_INVALID, - rRequest.HostName ) ) - trustCert = sal_True; - else - trustCert = sal_False; - } - - if ( trustCert ) - { - if (xApprove.is()) - xApprove->select(); - } - else - { - if (xAbort.is()) - xAbort->select(); - } -} - -namespace { - -enum NameClashResolveDialogResult { ABORT, RENAME, OVERWRITE }; - -NameClashResolveDialogResult -executeNameClashResolveDialog( - rtl::OUString const & /*rTargetFolderURL*/, - rtl::OUString const & /*rClashingName*/, - rtl::OUString & /*rProposedNewName*/) -{ - // @@@ Todo DV: execute overwrite-rename dialog, deliver result - OSL_ENSURE( false, - "executeNameClashResolveDialog not yet implemented!" ); - return ABORT; -} - -NameClashResolveDialogResult -executeSimpleNameClashResolveDialog( - rtl::OUString const & /*rTargetFolderURL*/, - rtl::OUString const & /*rClashingName*/, - rtl::OUString & /*rProposedNewName*/) -{ - // @@@ Todo DV: execute rename-only dialog, deliver result - OSL_ENSURE( false, - "executeSimpleNameClashResolveDialog not yet implemented!" ); - return ABORT; -} - -} // namespace - -void -UUIInteractionHelper::handleNameClashResolveRequest( - ucb::NameClashResolveRequest const & rRequest, - uno::Sequence< uno::Reference< - task::XInteractionContinuation > > const & rContinuations) - SAL_THROW((uno::RuntimeException)) -{ - OSL_ENSURE( - rRequest.TargetFolderURL.getLength() > 0, - "NameClashResolveRequest must not contain empty TargetFolderURL" ); - - OSL_ENSURE( - rRequest.ClashingName.getLength() > 0, - "NameClashResolveRequest must not contain empty ClashingName" ); + OSL_ENSURE( + rRequest.ClashingName.getLength() > 0, + "NameClashResolveRequest must not contain empty ClashingName" ); uno::Reference< task::XInteractionAbort > xAbort; uno::Reference< ucb::XInteractionSupplyName > xSupplyName; @@ -2529,482 +1156,47 @@ UUIInteractionHelper::handleNameClashResolveRequest( OSL_ENSURE( xAbort.is(), "NameClashResolveRequest must contain Abort continuation" ); - OSL_ENSURE( xSupplyName.is(), - "NameClashResolveRequest must contain SupplyName continuation" ); - - NameClashResolveDialogResult eResult = ABORT; - rtl::OUString aProposedNewName( rRequest.ProposedNewName ); - if ( xReplaceExistingData.is() ) - eResult = executeNameClashResolveDialog( - rRequest.TargetFolderURL, - rRequest.ClashingName, - aProposedNewName); - else - eResult = executeSimpleNameClashResolveDialog( - rRequest.TargetFolderURL, - rRequest.ClashingName, - aProposedNewName); - - switch ( eResult ) - { - case ABORT: - xAbort->select(); - break; - - case RENAME: - xSupplyName->setName( aProposedNewName ); - xSupplyName->select(); - break; - - case OVERWRITE: - OSL_ENSURE( - xReplaceExistingData.is(), - "Invalid NameClashResolveDialogResult: OVERWRITE - " - "No ReplaceExistingData continuation available!" ); - xReplaceExistingData->select(); - break; - - default: - OSL_ENSURE( false, "Unknown NameClashResolveDialogResult value. " - "Interaction Request not handled!" ); - break; - } -} - -void -UUIInteractionHelper::handleMasterPasswordRequest( - task::PasswordRequestMode nMode, - uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & - rContinuations) - SAL_THROW((uno::RuntimeException)) -{ - uno::Reference< task::XInteractionRetry > xRetry; - uno::Reference< task::XInteractionAbort > xAbort; - uno::Reference< ucb::XInteractionSupplyAuthentication > - xSupplyAuthentication; - getContinuations(rContinuations, &xRetry, &xAbort, &xSupplyAuthentication); - LoginErrorInfo aInfo; - - // in case of master password a hash code is returned - executeMasterPasswordDialog(aInfo, nMode); - - switch (aInfo.GetResult()) - { - case ERRCODE_BUTTON_OK: - if (xSupplyAuthentication.is()) - { - if (xSupplyAuthentication->canSetPassword()) - xSupplyAuthentication->setPassword(aInfo.GetPassword()); - xSupplyAuthentication->select(); - } - break; - - case ERRCODE_BUTTON_RETRY: - if (xRetry.is()) - xRetry->select(); - break; - - default: - if (xAbort.is()) - xAbort->select(); - break; - } -} - -void -UUIInteractionHelper::handlePasswordRequest( - task::PasswordRequestMode nMode, - uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & - rContinuations, - ::rtl::OUString aDocumentName ) - SAL_THROW((uno::RuntimeException)) -{ - uno::Reference< task::XInteractionRetry > xRetry; - uno::Reference< task::XInteractionAbort > xAbort; - uno::Reference< task::XInteractionPassword > xPassword; - getContinuations(rContinuations, &xRetry, &xAbort, &xPassword); - LoginErrorInfo aInfo; - - executePasswordDialog(aInfo, nMode, aDocumentName); - - switch (aInfo.GetResult()) - { - case ERRCODE_BUTTON_OK: - if (xPassword.is()) - { - xPassword->setPassword(aInfo.GetPassword()); - xPassword->select(); - } - break; - - case ERRCODE_BUTTON_RETRY: - if (xRetry.is()) - xRetry->select(); - break; - - default: - if (xAbort.is()) - xAbort->select(); - break; - } -} - -void -UUIInteractionHelper::handleMSPasswordRequest( - task::PasswordRequestMode nMode, - uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & - rContinuations, - ::rtl::OUString aDocumentName ) - SAL_THROW((uno::RuntimeException)) -{ - uno::Reference< task::XInteractionRetry > xRetry; - uno::Reference< task::XInteractionAbort > xAbort; - uno::Reference< task::XInteractionPassword > xPassword; - getContinuations(rContinuations, &xRetry, &xAbort, &xPassword); - LoginErrorInfo aInfo; - - executeMSPasswordDialog(aInfo, nMode, aDocumentName); - - switch (aInfo.GetResult()) - { - case ERRCODE_BUTTON_OK: - if (xPassword.is()) - { - xPassword->setPassword(aInfo.GetPassword()); - xPassword->select(); - } - break; - - case ERRCODE_BUTTON_RETRY: - if (xRetry.is()) - xRetry->select(); - break; - - default: - if (xAbort.is()) - xAbort->select(); - break; - } -} - -void -UUIInteractionHelper::handleCookiesRequest( - ucb::HandleCookiesRequest const & rRequest, - uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & - rContinuations) - SAL_THROW((uno::RuntimeException)) -{ - CookieList aCookies; - for (sal_Int32 i = 0; i < rRequest.Cookies.getLength(); ++i) - { - try - { - std::auto_ptr< CntHTTPCookie > xCookie(new CntHTTPCookie); - xCookie->m_aName = UniString(rRequest.Cookies[i].Name); - xCookie->m_aValue = UniString(rRequest.Cookies[i].Value); - xCookie->m_aDomain = UniString(rRequest.Cookies[i].Domain); - xCookie->m_aPath = UniString(rRequest.Cookies[i].Path); - xCookie->m_aExpires - = DateTime(Date(rRequest.Cookies[i].Expires.Day, - rRequest.Cookies[i].Expires.Month, - rRequest.Cookies[i].Expires.Year), - Time(rRequest.Cookies[i].Expires.Hours, - rRequest.Cookies[i].Expires.Minutes, - rRequest.Cookies[i].Expires.Seconds, - rRequest.Cookies[i].Expires.HundredthSeconds)); - xCookie->m_nFlags - = rRequest.Cookies[i].Secure ? CNTHTTP_COOKIE_FLAG_SECURE : 0; - switch (rRequest.Cookies[i].Policy) - { - case ucb::CookiePolicy_CONFIRM: - xCookie->m_nPolicy = CNTHTTP_COOKIE_POLICY_INTERACTIVE; - break; - - case ucb::CookiePolicy_ACCEPT: - xCookie->m_nPolicy = CNTHTTP_COOKIE_POLICY_ACCEPTED; - break; - - case ucb::CookiePolicy_IGNORE: - xCookie->m_nPolicy = CNTHTTP_COOKIE_POLICY_BANNED; - break; - - default: - OSL_ASSERT(false); - break; - } - aCookies.Insert(xCookie.get(), LIST_APPEND); - xCookie.release(); - } - catch (std::bad_alloc const &) - { - throw uno::RuntimeException( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( - "out of memory")), - uno::Reference< uno::XInterface >()); - } - } - - CntHTTPCookieRequest - aRequest(rRequest.URL, - aCookies, - rRequest.Request == ucb::CookieRequest_RECEIVE - ? CNTHTTP_COOKIE_REQUEST_RECV - : CNTHTTP_COOKIE_REQUEST_SEND); - executeCookieDialog(aRequest); - for (sal_Int32 i = 0; i < rContinuations.getLength(); ++i) - { - uno::Reference< ucb::XInteractionCookieHandling > - xCookieHandling(rContinuations[i], uno::UNO_QUERY); - if (xCookieHandling.is()) - { - switch (aRequest.m_nRet) - { - case CNTHTTP_COOKIE_POLICY_INTERACTIVE: - xCookieHandling-> - setGeneralPolicy(ucb::CookiePolicy_CONFIRM); - break; - - case CNTHTTP_COOKIE_POLICY_ACCEPTED: - xCookieHandling-> - setGeneralPolicy(ucb::CookiePolicy_ACCEPT); - break; - - case CNTHTTP_COOKIE_POLICY_BANNED: - xCookieHandling-> - setGeneralPolicy(ucb::CookiePolicy_IGNORE); - break; - } - for (sal_Int32 j = 0; j < rRequest.Cookies.getLength(); ++j) - if (rRequest.Cookies[j].Policy - == ucb::CookiePolicy_CONFIRM) - switch (static_cast< CntHTTPCookie * >(aCookies. - GetObject(j))-> - m_nPolicy) - { - case CNTHTTP_COOKIE_POLICY_ACCEPTED: - xCookieHandling-> - setSpecificPolicy(rRequest.Cookies[j], true); - break; - - case CNTHTTP_COOKIE_POLICY_BANNED: - xCookieHandling-> - setSpecificPolicy(rRequest.Cookies[j], false); - break; - } - xCookieHandling->select(); - break; - } - } -} - -void -UUIInteractionHelper::handleNoSuchFilterRequest( - document::NoSuchFilterRequest const & rRequest, - uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & - rContinuations ) - SAL_THROW((uno::RuntimeException)) -{ - uno::Reference< task::XInteractionAbort > xAbort; - uno::Reference< document::XInteractionFilterSelect > xFilterTransport; - getContinuations(rContinuations, &xAbort, &xFilterTransport); - - // check neccessary ressources - if they don't exist - abort or - // break this operation - if (!xAbort.is()) - return; - - if (!xFilterTransport.is()) - { - xAbort->select(); - return; - } - - uno::Reference< container::XContainerQuery > xFilterContainer; - try - { - xFilterContainer.set( m_xServiceFactory->createInstance( - ::rtl::OUString::createFromAscii( - "com.sun.star.document.FilterFactory") ), - uno::UNO_QUERY ); - } - catch ( uno::Exception const & ) - { - } - - if (!xFilterContainer.is()) - { - xAbort->select(); - return; - } - - uui::FilterNameList lNames; - - // Note: We look for all filters here which match the following criteria: - // - they are import filters as minimum (of course they can - // support export too) - // - we don't show any filter which are flaged as "don't show it - // at the UI" or "they are not installed" - // - we ignore filters, which have not set any valid - // DocumentService (e.g. our pure graphic filters) - // - we show it sorted by her UIName's - // - We don't use the order flag or prefer default filters. - // (Because this list shows all filters and the user should - // find his filter vry easy by his UIName ...) - // - We use "_query_all" here ... but we filter graphic filters - // out by using DocumentService property later! - uno::Reference< container::XEnumeration > xFilters - = xFilterContainer->createSubSetEnumerationByQuery( - ::rtl::OUString::createFromAscii( - "_query_all:sort_prop=uiname:iflags=1:eflags=143360")); - while (xFilters->hasMoreElements()) - { - try - { - ::comphelper::SequenceAsHashMap lProps(xFilters->nextElement()); - uui::FilterNamePair aPair; - - aPair.sInternal = lProps.getUnpackedValueOrDefault( - rtl::OUString::createFromAscii("Name"), ::rtl::OUString()); - aPair.sUI = lProps.getUnpackedValueOrDefault( - rtl::OUString::createFromAscii("UIName"), ::rtl::OUString()); - if ( (!aPair.sInternal.Len()) || (!aPair.sUI.Len() ) ) - { - continue; - } - lNames.push_back( aPair ); - } - catch(const uno::RuntimeException&) - { - throw; - } - catch(const uno::Exception&) - { - continue; - } - } - - // no list available for showing - // -> abort operation - if (lNames.size()<1) - { - xAbort->select(); - return; - } - - // let the user select the right filter - rtl::OUString sSelectedFilter; - executeFilterDialog( rRequest.URL, lNames, sSelectedFilter ); - - // If he doesn't select anyone - // -> abort operation - if (sSelectedFilter.getLength()<1) - { - xAbort->select(); - return; - } - - // otherwhise set it for return - xFilterTransport->setFilter( sSelectedFilter ); - xFilterTransport->select(); -} - -void -UUIInteractionHelper::handleAmbigousFilterRequest( - document::AmbigousFilterRequest const & rRequest, - uno::Sequence< - uno::Reference< - task::XInteractionContinuation > > const & rContinuations) - SAL_THROW((uno::RuntimeException)) -{ - uno::Reference< task::XInteractionAbort > xAbort; - uno::Reference< document::XInteractionFilterSelect > xFilterTransport; - getContinuations(rContinuations, &xAbort, &xFilterTransport); - - uui::FilterNameList lNames; - - uno::Reference< container::XNameContainer > xFilterContainer; - try - { - xFilterContainer.set( m_xServiceFactory->createInstance( - ::rtl::OUString::createFromAscii( - "com.sun.star.document.FilterFactory") ), - uno::UNO_QUERY ); - } - catch ( uno::Exception & ) - { - } - - if( xFilterContainer.is() ) - { - uno::Any aPackedSet ; - uno::Sequence< beans::PropertyValue > lProps ; - sal_Int32 nStep ; - uui::FilterNamePair aPair ; - - try - { - aPackedSet = xFilterContainer->getByName( rRequest.SelectedFilter ); - } - catch(const container::NoSuchElementException&) - { - aPackedSet.clear(); - } - aPackedSet >>= lProps; - for( nStep=0; nStep>= sTemp; - aPair.sUI = sTemp; - aPair.sInternal = rRequest.SelectedFilter; - lNames.push_back( aPair ); - break; - } - } - - try - { - aPackedSet = xFilterContainer->getByName( rRequest.DetectedFilter ); - } - catch(const container::NoSuchElementException&) - { - aPackedSet.clear(); - } - aPackedSet >>= lProps; - for( nStep=0; nStep>= sTemp; - aPair.sUI = sTemp; - aPair.sInternal = rRequest.DetectedFilter; - lNames.push_back( aPair ); - break; - } - } - } - - if( xAbort.is() && xFilterTransport.is() ) + OSL_ENSURE( xSupplyName.is(), + "NameClashResolveRequest must contain SupplyName continuation" ); + + NameClashResolveDialogResult eResult = ABORT; + rtl::OUString aProposedNewName( rRequest.ProposedNewName ); + if ( xReplaceExistingData.is() ) + eResult = executeNameClashResolveDialog( + getParentProperty(), + rRequest.TargetFolderURL, + rRequest.ClashingName, + aProposedNewName); + else + eResult = executeSimpleNameClashResolveDialog( + getParentProperty(), + rRequest.TargetFolderURL, + rRequest.ClashingName, + aProposedNewName); + + switch ( eResult ) { - if( lNames.size() < 1 ) - { - xAbort->select(); - } - else - { - rtl::OUString sFilter; - executeFilterDialog( rRequest.URL, lNames, sFilter ); + case ABORT: + xAbort->select(); + break; - if( sFilter.getLength() > 0 ) - { - xFilterTransport->setFilter( sFilter ); - xFilterTransport->select(); - } - else - xAbort->select(); - } + case RENAME: + xSupplyName->setName( aProposedNewName ); + xSupplyName->select(); + break; + + case OVERWRITE: + OSL_ENSURE( + xReplaceExistingData.is(), + "Invalid NameClashResolveDialogResult: OVERWRITE - " + "No ReplaceExistingData continuation available!" ); + xReplaceExistingData->select(); + break; + + default: + OSL_ENSURE( false, "Unknown NameClashResolveDialogResult value. " + "Interaction Request not handled!" ); + break; } } @@ -3037,7 +1229,7 @@ UUIInteractionHelper::handleGenericErrorRequest( // Note: It's important to convert the transported long to the // required unsigned long value. Otherwhise using as flag field // can fail ... - ErrCode nError = (ErrCode)nErrorCode; + ErrCode nError = static_cast< ErrCode >(nErrorCode); sal_Bool bWarning = !ERRCODE_TOERROR(nError); if ( nError == ERRCODE_SFX_BROKENSIGNATURE @@ -3073,7 +1265,8 @@ UUIInteractionHelper::handleGenericErrorRequest( aTitle += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " - " ) ); aTitle += aErrTitle; - executeMessageBox( aTitle, aErrorString, WB_OK ); + executeMessageBox( + getParentProperty(), aTitle, aErrorString, WB_OK ); } else ErrorHandler::HandleError(nErrorCode); @@ -3204,290 +1397,22 @@ UUIInteractionHelper::handleFutureDocumentVersionUpdateRequest( } void -UUIInteractionHelper::handleFilterOptionsRequest( - document::FilterOptionsRequest const & rRequest, - uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & - rContinuations) - SAL_THROW((uno::RuntimeException)) -{ - uno::Reference< task::XInteractionAbort > xAbort; - uno::Reference< document::XInteractionFilterOptions > xFilterOptions; - getContinuations(rContinuations, &xAbort, &xFilterOptions); - - uno::Reference< container::XNameAccess > xFilterCFG; - try - { - xFilterCFG.set( m_xServiceFactory->createInstance( - ::rtl::OUString::createFromAscii( - "com.sun.star.document.FilterFactory" ) ), - uno::UNO_QUERY ); - } - catch ( uno::Exception const & ) - { - } - - if( xFilterCFG.is() && rRequest.rProperties.getLength() ) - { - try - { - ::rtl::OUString aFilterName; - sal_Int32 nPropCount = rRequest.rProperties.getLength(); - for( sal_Int32 ind = 0; ind < nPropCount; ++ind ) - { - rtl::OUString tmp = rRequest.rProperties[ind].Name; - if( rRequest.rProperties[ind].Name.equals( - ::rtl::OUString::createFromAscii("FilterName")) ) - { - rRequest.rProperties[ind].Value >>= aFilterName; - break; - } - } - - uno::Sequence < beans::PropertyValue > aProps; - if ( xFilterCFG->getByName( aFilterName ) >>= aProps ) - { - sal_Int32 nPropertyCount = aProps.getLength(); - for( sal_Int32 nProperty=0; - nProperty < nPropertyCount; - ++nProperty ) - if( aProps[nProperty].Name.equals( - ::rtl::OUString::createFromAscii("UIComponent")) ) - { - ::rtl::OUString aServiceName; - aProps[nProperty].Value >>= aServiceName; - if( aServiceName.getLength() ) - { - uno::Reference< - ui::dialogs::XExecutableDialog > xFilterDialog( - m_xServiceFactory->createInstance( - aServiceName ), - uno::UNO_QUERY ); - uno::Reference< beans::XPropertyAccess > - xFilterProperties( xFilterDialog, - uno::UNO_QUERY ); - - if( xFilterDialog.is() && xFilterProperties.is() ) - { - uno::Reference< - document::XImporter > xImporter( - xFilterDialog, uno::UNO_QUERY ); - if( xImporter.is() ) - xImporter->setTargetDocument( - uno::Reference< lang::XComponent >( - rRequest.rModel, uno::UNO_QUERY ) ); - - xFilterProperties->setPropertyValues( - rRequest.rProperties ); - - if( xFilterDialog->execute() ) - { - xFilterOptions->setFilterOptions( - xFilterProperties->getPropertyValues() ); - xFilterOptions->select(); - return; - } - } - } - break; - } - } - } - catch( container::NoSuchElementException& ) - { - // the filter name is unknown - } - catch( uno::Exception& ) - { - } - } - - xAbort->select(); -} - -void -UUIInteractionHelper::handleErrorRequest( - task::InteractionClassification eClassification, - ErrCode nErrorCode, +UUIInteractionHelper::handleBrokenPackageRequest( std::vector< rtl::OUString > const & rArguments, uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & rContinuations, bool bObtainErrorStringOnly, bool & bHasErrorString, rtl::OUString & rErrorString) - SAL_THROW((uno::RuntimeException)) + SAL_THROW((uno::RuntimeException)) { - rtl::OUString aMessage; - { - enum Source { SOURCE_DEFAULT, SOURCE_CNT, SOURCE_SVX, SOURCE_UUI }; - static char const * const aManager[4] - = { CREATEVERSIONRESMGR_NAME(ofa), - CREATEVERSIONRESMGR_NAME(cnt), - CREATEVERSIONRESMGR_NAME(svx), - CREATEVERSIONRESMGR_NAME(uui) }; - static USHORT const aId[4] - = { RID_ERRHDL, - RID_CHAOS_START + 12, - // cf. chaos/source/inc/cntrids.hrc, where - // #define RID_CHAOS_ERRHDL (RID_CHAOS_START + 12) - RID_SVX_START + 350, // RID_SVXERRCODE - RID_UUI_ERRHDL }; - ErrCode nErrorId = nErrorCode & ~ERRCODE_WARNING_MASK; - Source eSource = nErrorId < ERRCODE_AREA_LIB1 ? - SOURCE_DEFAULT : - nErrorId >= ERRCODE_AREA_CHAOS - && nErrorId < ERRCODE_AREA_CHAOS_END ? - SOURCE_CNT : - nErrorId >= ERRCODE_AREA_SVX - && nErrorId <= ERRCODE_AREA_SVX_END ? - SOURCE_SVX : - SOURCE_UUI; - - vos::OGuard aGuard(Application::GetSolarMutex()); - std::auto_ptr< ResMgr > xManager; - xManager.reset(ResMgr::CreateResMgr(aManager[eSource])); - if (!xManager.get()) - return; - ResId aResId(aId[eSource], *xManager.get()); - if (!ErrorResource(aResId). getString(nErrorCode, &aMessage)) - return; - } - - aMessage = replaceMessageWithArguments( aMessage, rArguments ); - if (bObtainErrorStringOnly) { bHasErrorString = isInformationalErrorMessageRequest(rContinuations); - if (bHasErrorString) - rErrorString = aMessage; - return; - } - else - { - //TODO! It can happen that the buttons calculated below do not match - // the error text from the resource (e.g., some text that is not a - // question, but YES and NO buttons). Some error texts have - // ExtraData that specifies a set of buttons, but that data is not - // really useful, because a single error text may well make sense - // both with only an OK button and with RETRY and CANCEL buttons. - - uno::Reference< task::XInteractionApprove > xApprove; - uno::Reference< task::XInteractionDisapprove > xDisapprove; - uno::Reference< task::XInteractionRetry > xRetry; - uno::Reference< task::XInteractionAbort > xAbort; - getContinuations( - rContinuations, &xApprove, &xDisapprove, &xRetry, &xAbort); - - // The following mapping uses the bit mask - // Approve = 8, - // Disapprove = 4, - // Retry = 2, - // Abort = 1 - // - // The mapping has five properties on which the code to select the - // correct continuation relies: - // 1 The OK button is mapped to Approve if that is available, - // otherwise to Abort if that is available, otherwise to none. - // 2 The CANCEL button is always mapped to Abort. - // 3 The RETRY button is always mapped to Retry. - // 4 The NO button is always mapped to Disapprove. - // 5 The YES button is always mapped to Approve. - // - // Because the WinBits button combinations are quite restricted, not - // every request can be served here. - // - // Finally, it seems to be better to leave default button - // determination to VCL (the favouring of CANCEL as default button - // seems to not always be what the user wants)... - WinBits const aButtonMask[16] - = { 0, - WB_OK /*| WB_DEF_OK*/, // Abort - 0, - WB_RETRY_CANCEL /*| WB_DEF_CANCEL*/, // Retry, Abort - 0, - 0, - 0, - 0, - WB_OK /*| WB_DEF_OK*/, // Approve - WB_OK_CANCEL /*| WB_DEF_CANCEL*/, // Approve, Abort - 0, - 0, - WB_YES_NO /*| WB_DEF_NO*/, // Approve, Disapprove - WB_YES_NO_CANCEL /*| WB_DEF_CANCEL*/, - // Approve, Disapprove, Abort - 0, - 0 }; - - WinBits nButtonMask = aButtonMask[(xApprove.is() ? 8 : 0) - | (xDisapprove.is() ? 4 : 0) - | (xRetry.is() ? 2 : 0) - | (xAbort.is() ? 1 : 0)]; - if (nButtonMask == 0) + if (!bHasErrorString) return; - - //TODO! remove this backwards compatibility? - rtl::OUString aContext(getContextProperty()); - if (aContext.getLength() == 0 && nErrorCode != 0) - { - vos::OGuard aGuard(Application::GetSolarMutex()); - ErrorContext * pContext = ErrorContext::GetContext(); - if (pContext) - { - UniString aContextString; - if (pContext->GetString(nErrorCode, aContextString)) - aContext = aContextString; - } - } - - USHORT nResult = executeErrorDialog( - eClassification, aContext, aMessage, nButtonMask ); - switch (nResult) - { - case ERRCODE_BUTTON_OK: - OSL_ENSURE(xApprove.is() || xAbort.is(), "unexpected situation"); - if (xApprove.is()) - xApprove->select(); - else if (xAbort.is()) - xAbort->select(); - break; - - case ERRCODE_BUTTON_CANCEL: - OSL_ENSURE(xAbort.is(), "unexpected situation"); - if (xAbort.is()) - xAbort->select(); - break; - - case ERRCODE_BUTTON_RETRY: - OSL_ENSURE(xRetry.is(), "unexpected situation"); - if (xRetry.is()) - xRetry->select(); - break; - - case ERRCODE_BUTTON_NO: - OSL_ENSURE(xDisapprove.is(), "unexpected situation"); - if (xDisapprove.is()) - xDisapprove->select(); - break; - - case ERRCODE_BUTTON_YES: - OSL_ENSURE(xApprove.is(), "unexpected situation"); - if (xApprove.is()) - xApprove->select(); - break; - } - } -} -void -UUIInteractionHelper::handleBrokenPackageRequest( - std::vector< rtl::OUString > const & rArguments, - uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & - rContinuations, - bool bObtainErrorStringOnly, - bool & bHasErrorString, - rtl::OUString & rErrorString) - SAL_THROW((uno::RuntimeException)) -{ uno::Reference< task::XInteractionApprove > xApprove; uno::Reference< task::XInteractionDisapprove > xDisapprove; uno::Reference< task::XInteractionAbort > xAbort; @@ -3522,230 +1447,81 @@ UUIInteractionHelper::handleBrokenPackageRequest( if (bObtainErrorStringOnly) { - bHasErrorString = isInformationalErrorMessageRequest(rContinuations); - if (bHasErrorString) - rErrorString = aMessage; + rErrorString = aMessage; return; } - else - { - WinBits nButtonMask; - if( xApprove.is() && xDisapprove.is() ) - { - nButtonMask = WB_YES_NO | WB_DEF_YES; - } - else if ( xAbort.is() ) - { - nButtonMask = WB_OK; - } - else - return; - - uno::Any aProductNameAny = - ::utl::ConfigManager::GetConfigManager()->GetDirectConfigProperty( - ::utl::ConfigManager::PRODUCTNAME ); - uno::Any aProductVersionAny = - ::utl::ConfigManager::GetConfigManager()->GetDirectConfigProperty( - ::utl::ConfigManager::PRODUCTVERSION ); - ::rtl::OUString aProductName, aProductVersion; - if ( !( aProductNameAny >>= aProductName ) ) - aProductName - = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("StarOffice") ); - - ::rtl::OUString aTitle( aProductName ); - if( aProductVersionAny >>= aProductVersion ) - { - aTitle += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(" ") ); - aTitle += aProductVersion; - } - - switch ( executeMessageBox( aTitle, aMessage, nButtonMask )) - { - case ERRCODE_BUTTON_OK: - OSL_ENSURE( xAbort.is(), "unexpected situation" ); - if (xAbort.is()) - xAbort->select(); - break; - - case ERRCODE_BUTTON_NO: - OSL_ENSURE(xDisapprove.is(), "unexpected situation"); - if (xDisapprove.is()) - xDisapprove->select(); - break; - - case ERRCODE_BUTTON_YES: - OSL_ENSURE(xApprove.is(), "unexpected situation"); - if (xApprove.is()) - xApprove->select(); - break; - } - } -} - -void -UUIInteractionHelper::handleLockedDocumentRequest( - const ::rtl::OUString& aDocumentURL, - const ::rtl::OUString& aInfo, - uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & - rContinuations, - sal_uInt16 nMode ) - SAL_THROW((uno::RuntimeException)) -{ - uno::Reference< task::XInteractionApprove > xApprove; - uno::Reference< task::XInteractionDisapprove > xDisapprove; - uno::Reference< task::XInteractionAbort > xAbort; - getContinuations(rContinuations, &xApprove, &xDisapprove, &xAbort); - - if ( !xApprove.is() || !xDisapprove.is() || !xAbort.is() ) - return; - try + WinBits nButtonMask; + if( xApprove.is() && xDisapprove.is() ) { - vos::OGuard aGuard(Application::GetSolarMutex()); - std::auto_ptr< ResMgr > xManager( - ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); - if (!xManager.get()) - return; - - ::rtl::OUString aMessage; - std::vector< rtl::OUString > aArguments; - aArguments.push_back( aDocumentURL ); - - sal_Int32 nResult = RET_CANCEL; - if ( nMode == UUI_DOC_LOAD_LOCK ) - { - aArguments.push_back( aInfo.getLength() - ? aInfo - : ::rtl::OUString( String( - ResId( STR_UNKNOWNUSER, - *xManager.get() ) ) ) ); - aMessage = String( ResId( STR_OPENLOCKED_MSG, *xManager.get() ) ); - aMessage = replaceMessageWithArguments( aMessage, aArguments ); - - std::auto_ptr< OpenLockedQueryBox > xDialog(new OpenLockedQueryBox( - getParentProperty(), xManager.get(), aMessage ) ); - nResult = xDialog->Execute(); - } - else if ( nMode == UUI_DOC_SAVE_LOCK ) - { - aArguments.push_back( aInfo.getLength() - ? aInfo - : ::rtl::OUString( String( - ResId( STR_UNKNOWNUSER, - *xManager.get() ) ) ) ); - aMessage = String( ResId( STR_TRYLATER_MSG, *xManager.get() ) ); - aMessage = replaceMessageWithArguments( aMessage, aArguments ); - - std::auto_ptr< TryLaterQueryBox > xDialog( - new TryLaterQueryBox( - getParentProperty(), xManager.get(), aMessage ) ); - nResult = xDialog->Execute(); - } - else if ( nMode == UUI_DOC_OWN_LOAD_LOCK || - nMode == UUI_DOC_OWN_SAVE_LOCK ) - { - aArguments.push_back( aInfo ); - aMessage = String( ResId( nMode == UUI_DOC_OWN_SAVE_LOCK - ? STR_ALREADYOPEN_SAVE_MSG - : STR_ALREADYOPEN_MSG, - *xManager.get() ) ); - aMessage = replaceMessageWithArguments( aMessage, aArguments ); - - std::auto_ptr< AlreadyOpenQueryBox > xDialog( - new AlreadyOpenQueryBox( getParentProperty(), - xManager.get(), - aMessage, - nMode == UUI_DOC_OWN_SAVE_LOCK ) ); - nResult = xDialog->Execute(); - } - - if ( nResult == RET_YES ) - xApprove->select(); - else if ( nResult == RET_NO ) - xDisapprove->select(); - else - xAbort->select(); + nButtonMask = WB_YES_NO | WB_DEF_YES; } - catch (std::bad_alloc const &) + else if ( xAbort.is() ) { - throw uno::RuntimeException( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")), - uno::Reference< uno::XInterface >()); + nButtonMask = WB_OK; } -} - -void -UUIInteractionHelper::handleChangedByOthersRequest( - uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & - rContinuations ) - SAL_THROW((uno::RuntimeException)) -{ - uno::Reference< task::XInteractionApprove > xApprove; - uno::Reference< task::XInteractionAbort > xAbort; - getContinuations(rContinuations, &xApprove, &xAbort); - - if ( !xApprove.is() || !xAbort.is() ) + else return; - try - { - vos::OGuard aGuard(Application::GetSolarMutex()); - std::auto_ptr< ResMgr > xManager( - ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); - if (!xManager.get()) - return; - - std::auto_ptr< FileChangedQueryBox > xDialog( - new FileChangedQueryBox( getParentProperty(), xManager.get() ) ); - sal_Int32 nResult = xDialog->Execute(); + uno::Any aProductNameAny = + ::utl::ConfigManager::GetConfigManager()->GetDirectConfigProperty( + ::utl::ConfigManager::PRODUCTNAME ); + uno::Any aProductVersionAny = + ::utl::ConfigManager::GetConfigManager()->GetDirectConfigProperty( + ::utl::ConfigManager::PRODUCTVERSION ); + ::rtl::OUString aProductName, aProductVersion; + if ( !( aProductNameAny >>= aProductName ) ) + aProductName + = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("StarOffice") ); - if ( nResult == RET_YES ) - xApprove->select(); - else - xAbort->select(); - } - catch (std::bad_alloc const &) + ::rtl::OUString aTitle( aProductName ); + if( aProductVersionAny >>= aProductVersion ) { - throw uno::RuntimeException( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")), - uno::Reference< uno::XInterface >()); + aTitle += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(" ") ); + aTitle += aProductVersion; } -} - -void -UUIInteractionHelper::handleLockFileIgnoreRequest( - uno::Sequence< uno::Reference< task::XInteractionContinuation > > const & - rContinuations ) - SAL_THROW((uno::RuntimeException)) -{ - uno::Reference< task::XInteractionApprove > xApprove; - uno::Reference< task::XInteractionAbort > xAbort; - getContinuations(rContinuations, &xApprove, &xAbort); - - if ( !xApprove.is() || !xAbort.is() ) - return; - try + switch ( executeMessageBox( getParentProperty(), + aTitle, + aMessage, + nButtonMask )) { - vos::OGuard aGuard(Application::GetSolarMutex()); - std::auto_ptr< ResMgr > xManager( - ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(uui))); - if (!xManager.get()) - return; + case ERRCODE_BUTTON_OK: + OSL_ENSURE( xAbort.is(), "unexpected situation" ); + if (xAbort.is()) + xAbort->select(); + break; - std::auto_ptr< LockFailedQueryBox > xDialog( - new LockFailedQueryBox( getParentProperty(), xManager.get() ) ); - sal_Int32 nResult = xDialog->Execute(); + case ERRCODE_BUTTON_NO: + OSL_ENSURE(xDisapprove.is(), "unexpected situation"); + if (xDisapprove.is()) + xDisapprove->select(); + break; - if ( nResult == RET_OK ) + case ERRCODE_BUTTON_YES: + OSL_ENSURE(xApprove.is(), "unexpected situation"); + if (xApprove.is()) xApprove->select(); - else - xAbort->select(); - } - catch (std::bad_alloc const &) - { - throw uno::RuntimeException( - rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("out of memory")), - uno::Reference< uno::XInterface >()); + break; } } + +//========================================================================= +// ErrorResource Implementation +//========================================================================= + +bool +ErrorResource::getString(ErrCode nErrorCode, rtl::OUString * pString) + const SAL_THROW(()) +{ + OSL_ENSURE(pString, "specification violation"); + ResId aResId(static_cast< USHORT >(nErrorCode & ERRCODE_RES_MASK), + *m_pResMgr); + aResId.SetRT(RSC_STRING); + if (!IsAvailableRes(aResId)) + return false; + aResId.SetAutoRelease(false); + *pString = UniString(aResId); + m_pResMgr->PopContext(); + return true; +} diff --git a/uui/source/iahndl.hxx b/uui/source/iahndl.hxx index aba8a1fd45ad..c479bc95c5fc 100644 --- a/uui/source/iahndl.hxx +++ b/uui/source/iahndl.hxx @@ -32,61 +32,47 @@ #define UUI_IAHNDL_HXX #include + #include "osl/mutex.hxx" +#include "rtl/ustring.hxx" + #include "com/sun/star/uno/Reference.hxx" #include "com/sun/star/uno/Sequence.hxx" #include "com/sun/star/beans/Optional.hpp" -#include "com/sun/star/embed/XStorage.hpp" #include "com/sun/star/task/InteractionClassification.hpp" -#include "com/sun/star/task/PasswordRequestMode.hpp" -#include "com/sun/star/task/FutureDocumentVersionProductUpdateRequest.hpp" -#include "com/sun/star/security/DocumentSignatureInformation.hpp" -#include "com/sun/star/security/XCertificate.hpp" -#include "com/sun/star/xml/crypto/XSecurityEnvironment.hpp" -#include "tools/solar.h" -#include "tools/errcode.hxx" -#include "vcl/wintypes.hxx" -#include "fltdlg.hxx" - -class Window; -class LoginErrorInfo; -struct CntHTTPCookieRequest; - -#define DESCRIPTION_1 1 -#define DESCRIPTION_2 2 -#define TITLE 3 -#define UUI_DOC_LOAD_LOCK 0 -#define UUI_DOC_OWN_LOAD_LOCK 1 -#define UUI_DOC_SAVE_LOCK 2 -#define UUI_DOC_OWN_SAVE_LOCK 3 +#include "tools/solar.h" // USHORT +#include "tools/errcode.hxx" // ErrCode +#include "tools/rc.hxx" // Resource +#include "vcl/wintypes.hxx" // WinBits namespace com { namespace sun { namespace star { - namespace document { - class AmbigousFilterRequest; - class FilterOptionsRequest; - class NoSuchFilterRequest; + namespace awt { + class XWindow; + } + namespace embed { + class XStorage; } namespace lang { class XMultiServiceFactory; } + namespace security { + class DocumentSignatureInformation; + } namespace task { + class FutureDocumentVersionProductUpdateRequest; class XInteractionContinuation; class XInteractionHandler; class XInteractionRequest; } namespace ucb { - class AuthenticationRequest; - class HandleCookiesRequest; class NameClashResolveRequest; - class CertificateValidationRequest; - } - namespace uno { - class RuntimeException; } } } } +class Window; + //============================================================================ struct InteractionHandlerData { @@ -107,7 +93,7 @@ class UUIInteractionHelper private: osl::Mutex m_aPropertyMutex; com::sun::star::uno::Reference< - com::sun::star::lang::XMultiServiceFactory > m_xServiceFactory; + com::sun::star::lang::XMultiServiceFactory > m_xServiceFactory; com::sun::star::uno::Sequence< com::sun::star::uno::Any > m_aProperties; UUIInteractionHelper(UUIInteractionHelper &); // not implemented @@ -139,19 +125,22 @@ public: com::sun::star::task::XInteractionRequest > const & rRequest) SAL_THROW((com::sun::star::uno::RuntimeException)); + // Helper. + static ::rtl::OUString + replaceMessageWithArguments( + ::rtl::OUString aMessage, + std::vector< rtl::OUString > const & rArguments ); + private: bool - handle_impl( + handleRequest_impl( com::sun::star::uno::Reference< - com::sun::star::task::XInteractionRequest > const & rRequest) + com::sun::star::task::XInteractionRequest > const & rRequest, + bool bObtainErrorStringOnly, + bool & bHasErrorString, + rtl::OUString & rErrorString) SAL_THROW((com::sun::star::uno::RuntimeException)); - void - getInteractionHandlerList(InteractionHandlerDataList &rdataList); - - sal_Bool - isDomainMatch( rtl::OUString hostName, rtl::OUString certHostName); - static long handlerequest(void* pHandleData, void* pInteractionHandler); @@ -177,109 +166,47 @@ private: SAL_THROW(()); com::sun::star::uno::Reference< com::sun::star::task::XInteractionHandler > - getInteractionHandler() const + getInteractionHandler() SAL_THROW((com::sun::star::uno::RuntimeException)); - void - executeLoginDialog(LoginErrorInfo & rInfo, - rtl::OUString const & rRealm) - SAL_THROW((com::sun::star::uno::RuntimeException)); - - void - executeMasterPasswordDialog(LoginErrorInfo & rInfo, - com::sun::star::task::PasswordRequestMode nMode) - SAL_THROW((com::sun::star::uno::RuntimeException)); - - void - executePasswordDialog(LoginErrorInfo & rInfo, - com::sun::star::task::PasswordRequestMode nMode, - ::rtl::OUString aDocumentName) - SAL_THROW((com::sun::star::uno::RuntimeException)); - - void - executeMSPasswordDialog(LoginErrorInfo & rInfo, - com::sun::star::task::PasswordRequestMode nMode, - ::rtl::OUString aDocumentName) - SAL_THROW((com::sun::star::uno::RuntimeException)); - - void - executeCookieDialog(CntHTTPCookieRequest & rRequest) + bool + tryOtherInteractionHandler( + com::sun::star::uno::Reference< + com::sun::star::task::XInteractionRequest > const & rRequest) SAL_THROW((com::sun::star::uno::RuntimeException)); void - executeFilterDialog(rtl::OUString const & rURL , - uui::FilterNameList const & rFilters, - rtl::OUString & rFilter ) + getInteractionHandlerList(InteractionHandlerDataList &rdataList) SAL_THROW((com::sun::star::uno::RuntimeException)); - sal_Bool - executeUnknownAuthDialog( - const com::sun::star::uno::Reference< - com::sun::star::security::XCertificate >& rXCert ) - SAL_THROW((com::sun::star::uno::RuntimeException)); - - sal_Bool - executeSSLWarnDialog( - const com::sun::star::uno::Reference< - com::sun::star::security::XCertificate >& rXCert, - sal_Int32 const & failures, - const rtl::OUString & hostName) - SAL_THROW((com::sun::star::uno::RuntimeException)); - - rtl::OUString - getLocalizedDatTimeStr( ::com::sun::star::util::DateTime aDateTime ); - - USHORT - executeErrorDialog( - com::sun::star::task::InteractionClassification eClassification, - rtl::OUString const & rContext, - rtl::OUString const & rMessage, - WinBits nButtonMask ) - SAL_THROW((com::sun::star::uno::RuntimeException)); - - USHORT - executeMessageBox( rtl::OUString const & rTitle, - rtl::OUString const & rMessage, - WinBits nButtonMask ) - SAL_THROW((com::sun::star::uno::RuntimeException)); + static bool + isInformationalErrorMessageRequest( + com::sun::star::uno::Sequence< + com::sun::star::uno::Reference< + com::sun::star::task::XInteractionContinuation > > const & + rContinuations); //===================================================================== - bool handleMessageboxRequests( - ::com::sun::star::uno::Reference< - ::com::sun::star::task::XInteractionRequest > const & rRequest, - bool bObtainErrorStringOnly, - bool & bHasErrorString, - rtl::OUString & rErrorString); - bool handleErrorHandlerRequests( - ::com::sun::star::uno::Reference< - ::com::sun::star::task::XInteractionRequest > const & rRequest, + bool + handleInteractiveIOException( + com::sun::star::uno::Reference< + com::sun::star::task::XInteractionRequest > const & rRequest, bool bObtainErrorStringOnly, bool & bHasErrorString, - rtl::OUString & rErrorString); - - bool handleDialogRequests( - ::com::sun::star::uno::Reference< - ::com::sun::star::task::XInteractionRequest > const & rRequest); + rtl::OUString & rErrorString) + SAL_THROW((com::sun::star::uno::RuntimeException)); - //===================================================================== - void + bool handleAuthenticationRequest( - com::sun::star::ucb::AuthenticationRequest const & rRequest, - com::sun::star::uno::Sequence< - com::sun::star::uno::Reference< - com::sun::star::task::XInteractionContinuation > > const & - rContinuations, - rtl::OUString const & rURL) + com::sun::star::uno::Reference< + com::sun::star::task::XInteractionRequest > const & rRequest) SAL_THROW((com::sun::star::uno::RuntimeException)); - void + bool handleCertificateValidationRequest( - com::sun::star::ucb::CertificateValidationRequest const & rRequest, - com::sun::star::uno::Sequence< - com::sun::star::uno::Reference< - com::sun::star::task::XInteractionContinuation > > const & - rContinuations) + com::sun::star::uno::Reference< + com::sun::star::task::XInteractionRequest > const & rRequest) SAL_THROW((com::sun::star::uno::RuntimeException)); void @@ -291,73 +218,44 @@ private: rContinuations) SAL_THROW((com::sun::star::uno::RuntimeException)); - void + bool handleMasterPasswordRequest( - com::sun::star::task::PasswordRequestMode nMode, - com::sun::star::uno::Sequence< - com::sun::star::uno::Reference< - com::sun::star::task::XInteractionContinuation > > const & - rContinuations) + com::sun::star::uno::Reference< + com::sun::star::task::XInteractionRequest > const & rRequest) SAL_THROW((com::sun::star::uno::RuntimeException)); - void + bool handlePasswordRequest( - com::sun::star::task::PasswordRequestMode nMode, - com::sun::star::uno::Sequence< - com::sun::star::uno::Reference< - com::sun::star::task::XInteractionContinuation > > const & - rContinuations, - ::rtl::OUString aDocumentName = ::rtl::OUString()) - SAL_THROW((com::sun::star::uno::RuntimeException)); - - void - handleMSPasswordRequest( - com::sun::star::task::PasswordRequestMode nMode, - com::sun::star::uno::Sequence< - com::sun::star::uno::Reference< - com::sun::star::task::XInteractionContinuation > > const & - rContinuations, - ::rtl::OUString aDocumentName = ::rtl::OUString()) + com::sun::star::uno::Reference< + com::sun::star::task::XInteractionRequest > const & rRequest) SAL_THROW((com::sun::star::uno::RuntimeException)); - void + bool handleCookiesRequest( - com::sun::star::ucb::HandleCookiesRequest const & rRequest, - com::sun::star::uno::Sequence< - com::sun::star::uno::Reference< - com::sun::star::task::XInteractionContinuation > > const & - rContinuations) + com::sun::star::uno::Reference< + com::sun::star::task::XInteractionRequest > const & rRequest) SAL_THROW((com::sun::star::uno::RuntimeException)); - void + bool handleNoSuchFilterRequest( - com::sun::star::document::NoSuchFilterRequest const & rRequest, - com::sun::star::uno::Sequence< - com::sun::star::uno::Reference< - com::sun::star::task::XInteractionContinuation > > const & - rContinuations) + com::sun::star::uno::Reference< + com::sun::star::task::XInteractionRequest > const & rRequest) SAL_THROW((com::sun::star::uno::RuntimeException)); - void + bool handleAmbigousFilterRequest( - com::sun::star::document::AmbigousFilterRequest const & rRequest, - com::sun::star::uno::Sequence< - com::sun::star::uno::Reference< - com::sun::star::task::XInteractionContinuation > > const & - rContinuations) + com::sun::star::uno::Reference< + com::sun::star::task::XInteractionRequest > const & rRequest) SAL_THROW((com::sun::star::uno::RuntimeException)); - void + bool handleFilterOptionsRequest( - com::sun::star::document::FilterOptionsRequest const & rRequest, - com::sun::star::uno::Sequence< - com::sun::star::uno::Reference< - com::sun::star::task::XInteractionContinuation > > const & - rContinuations) + com::sun::star::uno::Reference< + com::sun::star::task::XInteractionRequest > const & rRequest) SAL_THROW((com::sun::star::uno::RuntimeException)); void - handleErrorRequest( + handleErrorHandlerRequest( com::sun::star::task::InteractionClassification eClassification, ErrCode nErrorCode, std::vector< rtl::OUString > const & rArguments, @@ -419,27 +317,49 @@ private: rtl::OUString & rErrorString) SAL_THROW((::com::sun::star::uno::RuntimeException)); - void handleLockedDocumentRequest( - const ::rtl::OUString& aDocumentURL, - const ::rtl::OUString& aInfo, - ::com::sun::star::uno::Sequence< - ::com::sun::star::uno::Reference< - ::com::sun::star::task::XInteractionContinuation > > const & - rContinuations, - sal_uInt16 nMode ) + bool handleLockedDocumentRequest( + com::sun::star::uno::Reference< + com::sun::star::task::XInteractionRequest > const & rRequest) SAL_THROW((::com::sun::star::uno::RuntimeException)); - void handleChangedByOthersRequest( - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< - ::com::sun::star::task::XInteractionContinuation > > const & - rContinuations ) + bool handleChangedByOthersRequest( + com::sun::star::uno::Reference< + com::sun::star::task::XInteractionRequest > const & rRequest) SAL_THROW((::com::sun::star::uno::RuntimeException)); - void handleLockFileIgnoreRequest( - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< - ::com::sun::star::task::XInteractionContinuation > > const & - rContinuations ) + bool handleLockFileIgnoreRequest( + com::sun::star::uno::Reference< + com::sun::star::task::XInteractionRequest > const & rRequest) SAL_THROW((::com::sun::star::uno::RuntimeException)); }; +class ErrorResource: private Resource +{ +public: + inline ErrorResource(ResId & rResId) SAL_THROW(()): Resource(rResId) {} + + inline ~ErrorResource() SAL_THROW(()) { FreeResource(); } + + bool getString(ErrCode nErrorCode, rtl::OUString * pString) const + SAL_THROW(()); +}; + +/* +class InteractionRequest +{ +public: + InteractionRequest( + com::sun::star::uno::Reference< + com::sun::star::task::XInteractionRequest > const & rRequest) + : m_aRequest( rRequest ) {} + + virtual bool toString( rtl::OUString & rString ) = 0; + virtual bool handle( rtl::OUString & rString ) = 0; + +private: + com::sun::star::uno::Reference< + com::sun::star::task::XInteractionRequest > m_aRequest; +}; +*/ + #endif // UUI_IAHNDL_HXX diff --git a/uui/source/makefile.mk b/uui/source/makefile.mk index 5c70719cd91c..d0d8d4e7554b 100644 --- a/uui/source/makefile.mk +++ b/uui/source/makefile.mk @@ -39,6 +39,13 @@ ENABLE_EXCEPTIONS = true SLOFILES = \ $(SLO)$/cookiedg.obj \ $(SLO)$/iahndl.obj \ + $(SLO)$/iahndl-authentication.obj \ + $(SLO)$/iahndl-ssl.obj \ + $(SLO)$/iahndl-cookies.obj \ + $(SLO)$/iahndl-filter.obj \ + $(SLO)$/iahndl-locking.obj \ + $(SLO)$/iahndl-ioexceptions.obj \ + $(SLO)$/iahndl-errorhandler.obj \ $(SLO)$/logindlg.obj \ $(SLO)$/services.obj \ $(SLO)$/masterpassworddlg.obj \ @@ -46,17 +53,17 @@ SLOFILES = \ $(SLO)$/openlocked.obj \ $(SLO)$/passworddlg.obj \ $(SLO)$/passcrtdlg.obj \ - $(SLO)$/fltdlg.obj\ - $(SLO)$/interactionhandler.obj\ - $(SLO)$/requeststringresolver.obj\ - $(SLO)$/unknownauthdlg.obj\ - $(SLO)$/sslwarndlg.obj\ - $(SLO)$/secmacrowarnings.obj\ - $(SLO)$/filechanged.obj\ - $(SLO)$/alreadyopen.obj\ - $(SLO)$/lockfailed.obj\ - $(SLO)$/trylater.obj\ - $(SLO)$/newerverwarn.obj\ + $(SLO)$/fltdlg.obj \ + $(SLO)$/interactionhandler.obj \ + $(SLO)$/requeststringresolver.obj \ + $(SLO)$/unknownauthdlg.obj \ + $(SLO)$/sslwarndlg.obj \ + $(SLO)$/secmacrowarnings.obj \ + $(SLO)$/filechanged.obj \ + $(SLO)$/alreadyopen.obj \ + $(SLO)$/lockfailed.obj \ + $(SLO)$/trylater.obj \ + $(SLO)$/newerverwarn.obj \ $(SLO)$/passwordcontainer.obj SRS1NAME=$(TARGET) -- cgit v1.2.3 From bdabdb4ac426f57388245aefc4ec856fd430c9a1 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Thu, 10 Dec 2009 09:11:35 +0100 Subject: merge --- solenv/inc/rules.mk | 62 +++++++++++------------------------------------------ 1 file changed, 13 insertions(+), 49 deletions(-) diff --git a/solenv/inc/rules.mk b/solenv/inc/rules.mk index eafb20306e96..7b8e6f2aaadd 100644 --- a/solenv/inc/rules.mk +++ b/solenv/inc/rules.mk @@ -32,7 +32,7 @@ MKFILENAME:=RULES.MK $(OBJ)/%.obj : %.cxx - @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE) + @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< .IF "$(GUI)"=="UNX" @$(RM) $@ $(@:s/.obj/.o/) $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXOBJ) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$*.o $(CFLAGSINCXX)$(PWD)/$*.cxx @@ -56,7 +56,7 @@ $(OBJ)/%.obj : %.cxx .ENDIF # "$(nodep)"=="" $(OBJ)/%.obj : %.cpp - @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE) + @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< .IF "$(GUI)"=="UNX" @$(RM) $@ $(@:s/.obj/.o/) $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXOBJ) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$*.o $(CFLAGSINCXX)$(PWD)/$*.cpp @@ -78,7 +78,7 @@ $(OBJ)/%.obj : %.cpp .ENDIF # "$(nodep)"=="" $(OBJ)/%.obj : %.cc - @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE) + @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< .IF "$(GUI)"=="UNX" @$(RM) $@ $(@:s/.obj/.o/) $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXOBJ) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$*.o $(CFLAGSINCXX)$(PWD)/$*.cc @@ -159,7 +159,7 @@ $(SLO)/precompiled_ex.% .PHONY: .ENDIF # "$(ENABLE_PCH)"!="" $(SLO)/%.obj : %.cxx - @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE) + @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< .IF "$(ENABLE_PCH)"!="" && ( "$(PRJNAME)"!="sw" || "$(BUILD_SPECIAL)"!="TRUE" ) # just a helper var @noop $(assign used_exc_switches=$(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS))) @@ -198,7 +198,7 @@ $(SLO)/%.obj : %.cxx .ENDIF # "$(nodep)"=="" $(SLO)/%.obj : %.cpp - @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE) + @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< .IF "$(GUI)"=="UNX" .IF "$(TEST)"!="" $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXSLO) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) -E $(CFLAGSINCXX)$(PWD)/$*.cpp @@ -224,11 +224,7 @@ $(SLO)/%.obj : %.cpp .ENDIF # "$(nodep)"=="" $(SLO)/%.obj : $(MISC)/%.cxx -<<<<<<< local - @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(COMPILE_ECHO_FILE) -======= @echo Compiling: $(PRJNAME)/$(INPATH)/misc/$(<:f) ->>>>>>> other .IF "$(GUI)"=="UNX" .IF "$(TEST)"!="" $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXSLO) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) -E $(CFLAGSINCXX)$(MISC)/$*.cxx @@ -253,11 +249,7 @@ $(SLO)/%.obj : $(MISC)/%.cxx .ENDIF # "$(nodep)"=="" $(SLO)/%.obj : $(MISC)/%.cc -<<<<<<< local - @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(COMPILE_ECHO_FILE) -======= @echo Compiling: $(PRJNAME)/$(INPATH)/misc/$(<:f) ->>>>>>> other .IF "$(GUI)"=="UNX" .IF "$(TEST)"!="" $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXSLO) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) -E $(CFLAGSINCXX)$(MISC)/$*.cc @@ -274,11 +266,7 @@ $(SLO)/%.obj : $(MISC)/%.cc .ENDIF $(OBJ)/%.obj : $(MISC)/%.cxx -<<<<<<< local - @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(COMPILE_ECHO_FILE) -======= @echo Compiling: $(PRJNAME)/$(INPATH)/misc/$(<:f) ->>>>>>> other .IF "$(GUI)"=="UNX" .IF "$(TEST)"!="" $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXOBJ) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) -E $(CFLAGSINCXX)$(MISC)/$*.cxx @@ -303,7 +291,7 @@ $(OBJ)/%.obj : $(MISC)/%.cxx .ENDIF # "$(nodep)"=="" $(OBJ)/%.obj : %.c - @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE) + @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< .IF "$(GUI)"=="UNX" .IF "$(TEST)"!="" $(COMMAND_ECHO)$(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) -E $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$*.o $*.c @@ -333,11 +321,7 @@ $(OBJ)/%.obj : %.c .ENDIF # "$(nodep)"=="" $(OBJ)/%.obj : $(MISC)/%.c -<<<<<<< local - @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(COMPILE_ECHO_FILE) -======= @echo Compiling: $(PRJNAME)/$(INPATH)/misc/$(<:f) ->>>>>>> other .IF "$(GUI)"=="UNX" @$(RM) $@ $(@:s/.obj/.o/) $(COMMAND_ECHO)$(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$*.o $(MISC)/$*.c @@ -359,11 +343,7 @@ $(OBJ)/%.obj : $(MISC)/%.c .ENDIF # "$(nodep)"=="" $(SLO)/%.obj : $(MISC)/%.c -<<<<<<< local - @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(COMPILE_ECHO_FILE) -======= @echo Compiling: $(PRJNAME)/$(INPATH)/misc/$(<:f) ->>>>>>> other .IF "$(GUI)"=="UNX" @$(RM) $@ $(@:s/.obj/.o/) $(COMMAND_ECHO)$(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)/$*.o $(MISC)/$*.c @@ -386,7 +366,7 @@ $(SLO)/%.obj : $(MISC)/%.c .ENDIF # "$(nodep)"=="" $(SLO)/%.obj : %.c - @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE) + @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< .IF "$(GUI)"=="UNX" @$(RM) $@ $(@:s/.obj/.o/) $(COMMAND_ECHO)$(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)/$*.o $*.c @@ -409,7 +389,7 @@ $(SLO)/%.obj : %.c # Objective-C files $(OBJ)/%.obj : %.m - @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE) + @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< .IF "$(OS)"=="MACOSX" .IF "$(TEST)"!="" $(COMMAND_ECHO)$(objc) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(OBJCFLAGS) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) -E $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$*.o $*.m @@ -424,11 +404,7 @@ $(OBJ)/%.obj : %.m # Objective-C files $(OBJ)/%.obj : $(MISC)/%.m -<<<<<<< local - @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(COMPILE_ECHO_FILE) -======= @echo Compiling: $(PRJNAME)/$(INPATH)/misc/$(<:f) ->>>>>>> other .IF "$(OS)"=="MACOSX" @$(RM) $@ $(@:s/.obj/.o/) $(COMMAND_ECHO)$(objc) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(OBJCFLAGS) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$*.o $(MISC)/$*.m @@ -439,11 +415,7 @@ $(OBJ)/%.obj : $(MISC)/%.m # Objective-C files $(SLO)/%.obj : $(MISC)/%.m -<<<<<<< local - @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(COMPILE_ECHO_FILE) -======= @echo Compiling: $(PRJNAME)/$(INPATH)/misc/$(<:f) ->>>>>>> other .IF "$(OS)"=="MACOSX" @$(RM) $@ $(@:s/.obj/.o/) $(COMMAND_ECHO)$(objc) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(OBJCFLAGS) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)/$*.o $(MISC)/$*.m @@ -454,7 +426,7 @@ $(SLO)/%.obj : $(MISC)/%.m # Objective-C files $(SLO)/%.obj : %.m - @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE) + @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< .IF "$(OS)"=="MACOSX" @$(RM) $@ $(@:s/.obj/.o/) $(COMMAND_ECHO)$(objc) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(OBJCFLAGS) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)/$*.o $*.m @@ -470,7 +442,7 @@ not_existing/o_%.dpcc : %.c;@noop $(assign all_local_obj+:=$<) # Objective-C++ files $(OBJ)/%.obj : %.mm - @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE) + @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< .IF "$(OS)"=="MACOSX" .IF "$(TEST)"!="" $(COMMAND_ECHO)$(objcpp) $(CFLAGS) $(INCLUDE) $(CFLAGSCC) $(OBJCXXFLAGS) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) -E $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$*.o $*.mm @@ -489,11 +461,7 @@ $(OBJ)/%.obj : %.mm # Objective-C++ files $(OBJ)/%.obj : $(MISC)/%.mm -<<<<<<< local - @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(COMPILE_ECHO_FILE) -======= @echo Compiling: $(PRJNAME)/$(INPATH)/misc/$(<:f) ->>>>>>> other .IF "$(OS)"=="MACOSX" @$(RM) $@ $(@:s/.obj/.o/) $(COMMAND_ECHO)$(objcpp) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(OBJCXXFLAGS) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$*.o $(MISC)/$*.mm @@ -508,11 +476,7 @@ $(OBJ)/%.obj : $(MISC)/%.mm # Objective-C++ files $(SLO)/%.obj : $(MISC)/%.mm -<<<<<<< local - @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(COMPILE_ECHO_FILE) -======= @echo Compiling: $(PRJNAME)/$(INPATH)/misc/$(<:f) ->>>>>>> other .IF "$(OS)"=="MACOSX" @$(RM) $@ $(@:s/.obj/.o/) $(COMMAND_ECHO)$(objcpp) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(OBJCXXFLAGS) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)/$*.o $(MISC)/$*.mm @@ -527,7 +491,7 @@ $(SLO)/%.obj : $(MISC)/%.mm # Objective-C++ files $(SLO)/%.obj : %.mm - @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE) + @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< .IF "$(OS)"=="MACOSX" @$(RM) $@ $(@:s/.obj/.o/) $(COMMAND_ECHO)$(objcpp) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(OBJCXXFLAGS) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)/$*.o $*.mm @@ -675,7 +639,7 @@ $(MISC)/%.dpj : .ENDIF # "$(nodep)"=="" $(SLO)/%.obj : %.asm - @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE) + @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< .IF "$(COM)"=="GCC" .IF "$(ASM)"=="ml" $(COMMAND_ECHO)$(ASM) $(AFLAGS) -D$(COM) /Fo$(SLO)/$*.obj $*.asm @@ -702,7 +666,7 @@ $(SLO)/%.obj : %.asm .ENDIF $(OBJ)/%.obj : %.asm - @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE) + @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< .IF "$(COM)"=="GCC" .IF "$(ASM)"=="ml" $(COMMAND_ECHO)$(ASM) $(AFLAGS) -D$(COM) /Fo$(OBJ)/$*.obj $*.asm -- cgit v1.2.3 From 32f70a00d38905cac16be0c496ea6dd35c34c489 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Thu, 10 Dec 2009 09:16:30 +0100 Subject: merge --- solenv/inc/rules.mk | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/solenv/inc/rules.mk b/solenv/inc/rules.mk index 7b8e6f2aaadd..880136db253b 100644 --- a/solenv/inc/rules.mk +++ b/solenv/inc/rules.mk @@ -32,7 +32,7 @@ MKFILENAME:=RULES.MK $(OBJ)/%.obj : %.cxx - @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE) .IF "$(GUI)"=="UNX" @$(RM) $@ $(@:s/.obj/.o/) $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXOBJ) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$*.o $(CFLAGSINCXX)$(PWD)/$*.cxx @@ -56,7 +56,7 @@ $(OBJ)/%.obj : %.cxx .ENDIF # "$(nodep)"=="" $(OBJ)/%.obj : %.cpp - @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE) .IF "$(GUI)"=="UNX" @$(RM) $@ $(@:s/.obj/.o/) $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXOBJ) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$*.o $(CFLAGSINCXX)$(PWD)/$*.cpp @@ -78,7 +78,7 @@ $(OBJ)/%.obj : %.cpp .ENDIF # "$(nodep)"=="" $(OBJ)/%.obj : %.cc - @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE) .IF "$(GUI)"=="UNX" @$(RM) $@ $(@:s/.obj/.o/) $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXOBJ) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$*.o $(CFLAGSINCXX)$(PWD)/$*.cc @@ -159,7 +159,7 @@ $(SLO)/precompiled_ex.% .PHONY: .ENDIF # "$(ENABLE_PCH)"!="" $(SLO)/%.obj : %.cxx - @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE) .IF "$(ENABLE_PCH)"!="" && ( "$(PRJNAME)"!="sw" || "$(BUILD_SPECIAL)"!="TRUE" ) # just a helper var @noop $(assign used_exc_switches=$(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS))) @@ -198,7 +198,7 @@ $(SLO)/%.obj : %.cxx .ENDIF # "$(nodep)"=="" $(SLO)/%.obj : %.cpp - @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE) .IF "$(GUI)"=="UNX" .IF "$(TEST)"!="" $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXSLO) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) -E $(CFLAGSINCXX)$(PWD)/$*.cpp @@ -224,7 +224,7 @@ $(SLO)/%.obj : %.cpp .ENDIF # "$(nodep)"=="" $(SLO)/%.obj : $(MISC)/%.cxx - @echo Compiling: $(PRJNAME)/$(INPATH)/misc/$(<:f) + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(COMPILE_ECHO_FILE) .IF "$(GUI)"=="UNX" .IF "$(TEST)"!="" $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXSLO) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) -E $(CFLAGSINCXX)$(MISC)/$*.cxx @@ -249,7 +249,7 @@ $(SLO)/%.obj : $(MISC)/%.cxx .ENDIF # "$(nodep)"=="" $(SLO)/%.obj : $(MISC)/%.cc - @echo Compiling: $(PRJNAME)/$(INPATH)/misc/$(<:f) + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(COMPILE_ECHO_FILE) .IF "$(GUI)"=="UNX" .IF "$(TEST)"!="" $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXSLO) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) -E $(CFLAGSINCXX)$(MISC)/$*.cc @@ -266,7 +266,7 @@ $(SLO)/%.obj : $(MISC)/%.cc .ENDIF $(OBJ)/%.obj : $(MISC)/%.cxx - @echo Compiling: $(PRJNAME)/$(INPATH)/misc/$(<:f) + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(INPATH)/misc/$(COMPILE_ECHO_FILE) .IF "$(GUI)"=="UNX" .IF "$(TEST)"!="" $(COMMAND_ECHO)$(CXX) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(CFLAGSCXXOBJ) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CDEFSMT) $(!eq,$(EXCEPTIONSFILES),$(subst,$@, $(EXCEPTIONSFILES)) $(LOCAL_EXCEPTIONS_FLAGS) $(GLOBAL_EXCEPTIONS_FLAGS)) -E $(CFLAGSINCXX)$(MISC)/$*.cxx @@ -291,7 +291,7 @@ $(OBJ)/%.obj : $(MISC)/%.cxx .ENDIF # "$(nodep)"=="" $(OBJ)/%.obj : %.c - @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE) .IF "$(GUI)"=="UNX" .IF "$(TEST)"!="" $(COMMAND_ECHO)$(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) -E $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$*.o $*.c @@ -321,7 +321,7 @@ $(OBJ)/%.obj : %.c .ENDIF # "$(nodep)"=="" $(OBJ)/%.obj : $(MISC)/%.c - @echo Compiling: $(PRJNAME)/$(INPATH)/misc/$(<:f) + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(INPATH)/misc/$(COMPILE_ECHO_FILE) .IF "$(GUI)"=="UNX" @$(RM) $@ $(@:s/.obj/.o/) $(COMMAND_ECHO)$(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$*.o $(MISC)/$*.c @@ -343,7 +343,7 @@ $(OBJ)/%.obj : $(MISC)/%.c .ENDIF # "$(nodep)"=="" $(SLO)/%.obj : $(MISC)/%.c - @echo Compiling: $(PRJNAME)/$(INPATH)/misc/$(<:f) + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(INPATH)/misc/$(COMPILE_ECHO_FILE) .IF "$(GUI)"=="UNX" @$(RM) $@ $(@:s/.obj/.o/) $(COMMAND_ECHO)$(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)/$*.o $(MISC)/$*.c @@ -366,7 +366,7 @@ $(SLO)/%.obj : $(MISC)/%.c .ENDIF # "$(nodep)"=="" $(SLO)/%.obj : %.c - @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE) .IF "$(GUI)"=="UNX" @$(RM) $@ $(@:s/.obj/.o/) $(COMMAND_ECHO)$(CC) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)/$*.o $*.c @@ -389,7 +389,7 @@ $(SLO)/%.obj : %.c # Objective-C files $(OBJ)/%.obj : %.m - @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE) .IF "$(OS)"=="MACOSX" .IF "$(TEST)"!="" $(COMMAND_ECHO)$(objc) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(OBJCFLAGS) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) -E $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$*.o $*.m @@ -404,7 +404,7 @@ $(OBJ)/%.obj : %.m # Objective-C files $(OBJ)/%.obj : $(MISC)/%.m - @echo Compiling: $(PRJNAME)/$(INPATH)/misc/$(<:f) + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(INPATH)/misc/$(COMPILE_ECHO_FILE) .IF "$(OS)"=="MACOSX" @$(RM) $@ $(@:s/.obj/.o/) $(COMMAND_ECHO)$(objc) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(OBJCFLAGS) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$*.o $(MISC)/$*.m @@ -415,7 +415,7 @@ $(OBJ)/%.obj : $(MISC)/%.m # Objective-C files $(SLO)/%.obj : $(MISC)/%.m - @echo Compiling: $(PRJNAME)/$(INPATH)/misc/$(<:f) + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(COMPILE_ECHO_FILE) .IF "$(OS)"=="MACOSX" @$(RM) $@ $(@:s/.obj/.o/) $(COMMAND_ECHO)$(objc) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(OBJCFLAGS) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)/$*.o $(MISC)/$*.m @@ -426,7 +426,7 @@ $(SLO)/%.obj : $(MISC)/%.m # Objective-C files $(SLO)/%.obj : %.m - @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE) .IF "$(OS)"=="MACOSX" @$(RM) $@ $(@:s/.obj/.o/) $(COMMAND_ECHO)$(objc) $(CFLAGS) $(INCLUDE_C) $(CFLAGSCC) $(OBJCFLAGS) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)/$*.o $*.m @@ -442,7 +442,7 @@ not_existing/o_%.dpcc : %.c;@noop $(assign all_local_obj+:=$<) # Objective-C++ files $(OBJ)/%.obj : %.mm - @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE) .IF "$(OS)"=="MACOSX" .IF "$(TEST)"!="" $(COMMAND_ECHO)$(objcpp) $(CFLAGS) $(INCLUDE) $(CFLAGSCC) $(OBJCXXFLAGS) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) -E $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$*.o $*.mm @@ -461,7 +461,7 @@ $(OBJ)/%.obj : %.mm # Objective-C++ files $(OBJ)/%.obj : $(MISC)/%.mm - @echo Compiling: $(PRJNAME)/$(INPATH)/misc/$(<:f) + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(INPATH)/misc/$(COMPILE_ECHO_FILE) .IF "$(OS)"=="MACOSX" @$(RM) $@ $(@:s/.obj/.o/) $(COMMAND_ECHO)$(objcpp) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(OBJCXXFLAGS) $(CFLAGSOBJ) $(CDEFS) $(CDEFSOBJ) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(OBJ)/$*.o $(MISC)/$*.mm @@ -476,7 +476,7 @@ $(OBJ)/%.obj : $(MISC)/%.mm # Objective-C++ files $(SLO)/%.obj : $(MISC)/%.mm - @echo Compiling: $(PRJNAME)/$(INPATH)/misc/$(<:f) + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(OUTPATH)/misc/$(COMPILE_ECHO_FILE) .IF "$(OS)"=="MACOSX" @$(RM) $@ $(@:s/.obj/.o/) $(COMMAND_ECHO)$(objcpp) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(OBJCXXFLAGS) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)/$*.o $(MISC)/$*.mm @@ -491,7 +491,7 @@ $(SLO)/%.obj : $(MISC)/%.mm # Objective-C++ files $(SLO)/%.obj : %.mm - @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE) .IF "$(OS)"=="MACOSX" @$(RM) $@ $(@:s/.obj/.o/) $(COMMAND_ECHO)$(objcpp) $(CFLAGS) $(INCLUDE) $(CFLAGSCXX) $(OBJCXXFLAGS) $(CFLAGSSLO) $(CDEFS) $(CDEFSSLO) $(CDEFSMT) $(CFLAGSAPPEND) $(CFLAGSOUTOBJ) $(SLO)/$*.o $*.mm @@ -639,7 +639,7 @@ $(MISC)/%.dpj : .ENDIF # "$(nodep)"=="" $(SLO)/%.obj : %.asm - @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE) .IF "$(COM)"=="GCC" .IF "$(ASM)"=="ml" $(COMMAND_ECHO)$(ASM) $(AFLAGS) -D$(COM) /Fo$(SLO)/$*.obj $*.asm @@ -666,7 +666,7 @@ $(SLO)/%.obj : %.asm .ENDIF $(OBJ)/%.obj : %.asm - @echo Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$< + @echo $(COMPILE_ECHO_SWITCH) Compiling: $(PRJNAME)/$(PATH_IN_MODULE)/$(COMPILE_ECHO_FILE) .IF "$(COM)"=="GCC" .IF "$(ASM)"=="ml" $(COMMAND_ECHO)$(ASM) $(AFLAGS) -D$(COM) /Fo$(OBJ)/$*.obj $*.asm -- cgit v1.2.3 From c7693e1f24803c4febdd63ccd3fe79533019f7d4 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Thu, 10 Dec 2009 11:35:53 +0100 Subject: dba33d: merge --- dbaccess/source/core/api/RowSet.cxx | 34 +-------- .../source/core/dataaccess/databasecontext.cxx | 19 ----- dbaccess/source/core/inc/core_resource.hrc | 5 +- dbaccess/source/ui/querydesign/QueryDesignView.cxx | 89 ---------------------- 4 files changed, 2 insertions(+), 145 deletions(-) diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx index fbe8eee4c500..d6bd3c2efd8b 100644 --- a/dbaccess/source/core/api/RowSet.cxx +++ b/dbaccess/source/core/api/RowSet.cxx @@ -77,6 +77,7 @@ #include #include #include +#include #include #include #include @@ -84,39 +85,6 @@ #include #include #include -<<<<<<< local -#endif -#ifndef _DBHELPER_DBEXCEPTION_HXX_ -#include -#endif -#include -#ifndef _DBA_CORE_TABLECONTAINER_HXX_ -#include "tablecontainer.hxx" -#endif -#ifndef _COM_SUN_STAR_SDB_PARAMETERSREQUEST_HPP_ -#include -#endif -#ifndef _COM_SUN_STAR_SDB_PARAMETERSREQUEST_HPP_ -#include -#endif -#ifndef _COM_SUN_STAR_SDB_XPARAMETERSSUPPLIER_HPP_ -#include -#endif -#ifndef _COM_SUN_STAR_CONTAINER_XCHILD_HPP_ -#include -#endif -#ifndef _COM_SUN_STAR_UTIL_XNUMBERFORMATSSUPPLIER_HPP_ -#include -#endif -#ifndef _COMPHELPER_INTERACTION_HXX_ -#include -#endif -#ifndef _COMPHELPER_PROPERTY_HXX_ -#include -#endif -#ifndef _UTL_CONFIGMGR_HXX_ -======= ->>>>>>> other #include using namespace utl; diff --git a/dbaccess/source/core/dataaccess/databasecontext.cxx b/dbaccess/source/core/dataaccess/databasecontext.cxx index 4cdb81d2eafa..b1c1d63fd6b6 100644 --- a/dbaccess/source/core/dataaccess/databasecontext.cxx +++ b/dbaccess/source/core/dataaccess/databasecontext.cxx @@ -546,18 +546,6 @@ void ODatabaseContext::revokeObject(const rtl::OUString& _rName) throw( Exceptio ClearableMutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(DatabaseAccessContext_Base::rBHelper.bDisposed); - ::rtl::OUString sURL; - if ( !getURLForRegisteredObject( _rName, sURL ) ) - throw NoSuchElementException( _rName, *this ); - - if ( m_aDatabaseObjects.find( _rName ) != m_aDatabaseObjects.end() ) - { - OSL_ENSURE( false, "ODatabaseContext::revokeObject: a database document register by name? This shouldn't happen anymore!" ); - // all the code should have been changed so that registration is by URL only - m_aDatasourceProperties[ sURL ] = m_aDatasourceProperties[ _rName ]; - } - -<<<<<<< local ::rtl::OUString sURL = getDatabaseLocation( _rName ); revokeDatabaseLocation( _rName ); @@ -572,13 +560,6 @@ void ODatabaseContext::revokeObject(const rtl::OUString& _rName) throw( Exceptio ObjectCacheIterator aExistent = m_aDatabaseObjects.find(sURL); if ( aExistent != m_aDatabaseObjects.end() ) m_aDatabaseObjects.erase(aExistent); -======= - OConfigurationTreeRoot aDbRegisteredNamesRoot = OConfigurationTreeRoot::createWithServiceFactory( - ::comphelper::getProcessServiceFactory(), getDbRegisteredNamesNodeName(), -1, OConfigurationTreeRoot::CM_UPDATABLE ); - if ( !aDbRegisteredNamesRoot.removeNode( _rName ) ) - throw Exception( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "An unexpected und unknown error occured." ) ), *this ); - aDbRegisteredNamesRoot.commit(); ->>>>>>> other // notify our container listeners ContainerEvent aEvent( *this, makeAny( _rName ), Any(), Any() ); diff --git a/dbaccess/source/core/inc/core_resource.hrc b/dbaccess/source/core/inc/core_resource.hrc index cdcdfbd87107..b0c4536782fe 100644 --- a/dbaccess/source/core/inc/core_resource.hrc +++ b/dbaccess/source/core/inc/core_resource.hrc @@ -88,7 +88,6 @@ #define RID_STR_NAME_NOT_FOUND ( RID_CORE_STRINGS_START + 45 ) #define RID_STR_QUERY_DOES_NOT_EXIST ( RID_CORE_STRINGS_START + 46 ) #define RID_STR_ERROR_WHILE_SAVING ( RID_CORE_STRINGS_START + 47 ) -<<<<<<< local #define RID_STR_NO_SUB_FOLDER ( RID_CORE_STRINGS_START + 48 ) #define RID_STR_NO_DELETE_BEFORE_AFTER ( RID_CORE_STRINGS_START + 49 ) @@ -111,9 +110,7 @@ #define RID_STR_CONNECTION_REQUEST ( RID_CORE_STRINGS_START + 65 ) #define RID_STR_MISSING_EXTENSION ( RID_CORE_STRINGS_START + 66 ) -======= -#define RID_NO_SUCH_DATA_SOURCE ( RID_CORE_STRINGS_START + 48 ) ->>>>>>> other +#define RID_NO_SUCH_DATA_SOURCE ( RID_CORE_STRINGS_START + 67 ) #endif // _DBA_CORE_RESOURCE_HRC_ diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx index eacf142872d5..f8f2170da555 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx +++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx @@ -325,91 +325,6 @@ namespace return eErrorCode; } -<<<<<<< local - //------------------------------------------------------------------------------ - ::rtl::OUString QuoteField( const OQueryDesignView* _pView,const ::rtl::OUString& rValue, sal_Int32 aType ) - { - ::rtl::OUString rNewValue; - switch (rValue.toChar()) - { - case '?': - if (rValue.getLength() != 1) - break; - case '\'': // ::rtl::OUString Quotierung oder Datum - //case '#': // Datumsquotierung // jetengine - case ':': // Parameter - case '[': // Parameter - return rValue; - } - - Reference< XConnection> xConnection = static_cast(_pView->getController()).getConnection(); - Reference< XDatabaseMetaData > xMetaData; - if(xConnection.is()) - xMetaData = xConnection->getMetaData(); - ::rtl::OUString aQuote; - try - { - if(xMetaData.is()) - aQuote = xMetaData->getIdentifierQuoteString(); - - switch( aType ) - { - case DataType::DATE: - case DataType::TIME: - case DataType::TIMESTAMP: - if (rValue.toChar() != '{') // nur quoten, wenn kein Access Datum - rNewValue = ::dbtools::quoteName(aQuote,rValue); - else - rNewValue = rValue; - break; - case DataType::CHAR: - case DataType::VARCHAR: - case DataType::LONGVARCHAR: - case DataType::CLOB: - rNewValue = ::dbtools::quoteName(aQuote,rValue); - break; - case DataType::DECIMAL: - case DataType::NUMERIC: - case DataType::TINYINT: - case DataType::SMALLINT: - case DataType::INTEGER: - case DataType::BIGINT: - case DataType::REAL: - case DataType::DOUBLE: - case DataType::BINARY: - case DataType::VARBINARY: - case DataType::LONGVARBINARY: - case DataType::BLOB: - rNewValue = rValue; - break; - case DataType::BIT: - case DataType::BOOLEAN: - { - if(xMetaData.is()) - { - ::comphelper::UStringMixEqual bCase(xMetaData->supportsMixedCaseQuotedIdentifiers()); - if (bCase(rValue, String(ModuleRes(STR_QUERY_TRUE)))) - rNewValue = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TRUE")); - else if (bCase(rValue, String(ModuleRes(STR_QUERY_FALSE)))) - rNewValue = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FALSE")); - else - rNewValue = rValue; - } - } - break; - default: - DBG_ERROR( "QuoteField: illegal type" ); - break; - } - } - catch(SQLException&) - { - DBG_ERROR( "QuoteField: Exception" ); - } - return rNewValue; - } -======= ->>>>>>> other // ----------------------------------------------------------------------------- /** FillDragInfo fills the field description out of the table @@ -1387,11 +1302,7 @@ namespace GetInnerJoinCriteria(_pView,pNodeTmp); // now simplify again, join are checked in ComparisonPredicate ::connectivity::OSQLParseNode::absorptions(pNodeTmp); -<<<<<<< local - pNodeTmp = pNode->getChild(1); -======= pNodeTmp = pNode->getChild(1); ->>>>>>> other // it could happen that pCondition is not more valid eErrorCode = GetORCriteria(_pView,_pSelectionBrw,pNodeTmp, rLevel); -- cgit v1.2.3 From 5005736eb6fca43acc38c0660f7beda4a0359bb7 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Thu, 10 Dec 2009 11:39:59 +0100 Subject: dba33d: merge --- wizards/com/sun/star/wizards/db/DBMetaData.java | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/wizards/com/sun/star/wizards/db/DBMetaData.java b/wizards/com/sun/star/wizards/db/DBMetaData.java index 5ac373b80ded..3cdfe9da3433 100644 --- a/wizards/com/sun/star/wizards/db/DBMetaData.java +++ b/wizards/com/sun/star/wizards/db/DBMetaData.java @@ -597,13 +597,8 @@ public class DBMetaData public void getDataSourceInterfaces() throws Exception { -<<<<<<< local - xCompleted = UnoRuntime.queryInterface( XCompletedConnection.class, m_dataSource ); - xDataSourcePropertySet = UnoRuntime.queryInterface( XPropertySet.class, m_dataSource ); -======= - xCompleted = (XCompletedConnection) UnoRuntime.queryInterface(XCompletedConnection.class, getDataSource()); - xDataSourcePropertySet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, getDataSource()); ->>>>>>> other + xCompleted = UnoRuntime.queryInterface(XCompletedConnection.class, getDataSource()); + xDataSourcePropertySet = UnoRuntime.queryInterface(XPropertySet.class, getDataSource()); bPasswordIsRequired = ((Boolean) xDataSourcePropertySet.getPropertyValue("IsPasswordRequired")).booleanValue(); } @@ -686,11 +681,7 @@ public class DBMetaData private boolean getConnection(String _DataSourceName) { setDataSourceByName(_DataSourceName, true); -<<<<<<< local - return getConnection(m_dataSource); -======= return getConnection( getDataSource() ); ->>>>>>> other } private boolean getConnection(com.sun.star.sdbc.XConnection _DBConnection) -- cgit v1.2.3 From e469ee0ef7a27b7fe74de6961bb2fca7836bf9b9 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Thu, 10 Dec 2009 11:45:59 +0100 Subject: dba33d: merge --- connectivity/source/commontools/FValue.cxx | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/connectivity/source/commontools/FValue.cxx b/connectivity/source/commontools/FValue.cxx index 36d5bd2db16c..7ea68e099dc3 100644 --- a/connectivity/source/commontools/FValue.cxx +++ b/connectivity/source/commontools/FValue.cxx @@ -1921,6 +1921,9 @@ namespace detail virtual Sequence< sal_Int8 > getBytes() const = 0; virtual Reference< XInputStream > getBinaryStream() const = 0; virtual Reference< XInputStream > getCharacterStream() const = 0; + virtual Reference< XClob > getClob() const = 0; + virtual Reference< XBlob > getBlob() const = 0; + virtual Any getObject() const = 0; virtual sal_Bool wasNull() const = 0; virtual ~IValueSource() { } @@ -1950,6 +1953,9 @@ namespace detail virtual Sequence< sal_Int8 > getBytes() const { return m_xRow->getBytes( m_nPos ); }; virtual Reference< XInputStream > getBinaryStream() const { return m_xRow->getBinaryStream( m_nPos ); }; virtual Reference< XInputStream > getCharacterStream() const { return m_xRow->getCharacterStream( m_nPos ); }; + virtual Reference< XClob > getClob() const { return m_xRow->getClob( m_nPos ); }; + virtual Reference< XBlob > getBlob() const { return m_xRow->getBlob( m_nPos ); }; + virtual Any getObject() const { return m_xRow->getObject( m_nPos ,NULL); }; virtual sal_Bool wasNull() const { return m_xRow->wasNull( ); }; private: @@ -1980,6 +1986,9 @@ namespace detail virtual Sequence< sal_Int8 > getBytes() const { return m_xColumn->getBytes(); }; virtual Reference< XInputStream > getBinaryStream() const { return m_xColumn->getBinaryStream(); }; virtual Reference< XInputStream > getCharacterStream() const { return m_xColumn->getCharacterStream(); }; + virtual Reference< XClob > getClob() const { return m_xColumn->getClob(); }; + virtual Reference< XBlob > getBlob() const { return m_xColumn->getBlob(); }; + virtual Any getObject() const { return m_xColumn->getObject(NULL); }; virtual sal_Bool wasNull() const { return m_xColumn->wasNull( ); }; private: @@ -2075,23 +2084,15 @@ void ORowSetValue::impl_fill( const sal_Int32 _nType, sal_Bool _bNullable, const (*this) = _rValueSource.getLong(); break; case DataType::CLOB: -<<<<<<< local - (*this) = ::com::sun::star::uno::makeAny(_xRow->getClob(_nPos)); -======= - (*this) = ::com::sun::star::uno::makeAny(_rValueSource.getCharacterStream()); ->>>>>>> other + (*this) = ::com::sun::star::uno::makeAny(_rValueSource.getClob()); setTypeKind(DataType::CLOB); break; case DataType::BLOB: -<<<<<<< local - (*this) = ::com::sun::star::uno::makeAny(_xRow->getBlob(_nPos)); -======= - (*this) = ::com::sun::star::uno::makeAny(_rValueSource.getBinaryStream()); ->>>>>>> other + (*this) = ::com::sun::star::uno::makeAny(_rValueSource.getBlob()); setTypeKind(DataType::BLOB); break; case DataType::OTHER: - (*this) = _xRow->getObject(_nPos,NULL); + (*this) = _rValueSource.getObject(); setTypeKind(DataType::OTHER); break; default: -- cgit v1.2.3 From fd5d46a152bd47f71ee2662700a321a4e61bc269 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Thu, 10 Dec 2009 12:05:57 +0100 Subject: dba33d: merge --- forms/source/solar/control/navtoolbar.cxx | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/forms/source/solar/control/navtoolbar.cxx b/forms/source/solar/control/navtoolbar.cxx index f599f196ee32..58f22f0c95e4 100644 --- a/forms/source/solar/control/navtoolbar.cxx +++ b/forms/source/solar/control/navtoolbar.cxx @@ -74,12 +74,6 @@ namespace frm sLabel += String::CreateFromAscii( " " ); return sLabel; } -<<<<<<< local - - static bool lcl_isHighContrast( const Color& _rColor ) - { - return _rColor.IsDark(); - } ::rtl::OUString lcl_getCommandURL( const sal_Int16 _nFormFeature ) { @@ -112,8 +106,6 @@ namespace frm OSL_ENSURE( false, "lcl_getCommandURL: unknown FormFeature!" ); return ::rtl::OUString(); } -======= ->>>>>>> other } //===================================================================== @@ -378,7 +370,7 @@ namespace frm if ( !m_pImageProvider ) return; - const bool bIsHighContrast = lcl_isHighContrast( GetBackground().GetColor() ); + const bool bIsHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); const USHORT nItemCount = m_pToolbar->GetItemCount(); @@ -427,15 +419,7 @@ namespace frm if ( _eSize != m_eImageSize ) { m_eImageSize = _eSize; -<<<<<<< local implUpdateImages(); -======= - ::std::auto_ptr< SfxImageManager > pImageManager( new SfxImageManager( NULL ) ); - pImageManager->SetImagesForceSize( *m_pToolbar, GetSettings().GetStyleSettings().GetHighContrastMode(), m_eImageSize == eLarge ); - - // parts of our layout is dependent on the size of our icons - Resize(); ->>>>>>> other } } -- cgit v1.2.3 From d19b4f2d685633d079b566d43a32528b43c4059e Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Thu, 10 Dec 2009 13:46:56 +0100 Subject: resync with DEV300_m67 --- neon/neon.patch | 61 +++++++++++++++++++++++++++------------------------------ 1 file changed, 29 insertions(+), 32 deletions(-) diff --git a/neon/neon.patch b/neon/neon.patch index 8257b64a7758..573dd5ac5ea7 100644 --- a/neon/neon.patch +++ b/neon/neon.patch @@ -1,5 +1,5 @@ ---- misc/neon-0.28.2/src/config.h 2009-11-26 23:47:06.000000000 +0100 -+++ misc/build/neon-0.28.2/src/config.h 2009-11-26 23:46:21.000000000 +0100 +--- misc/neon-0.28.2/src/config.h 2009-12-10 13:29:15.000000000 +0100 ++++ misc/build/neon-0.28.2/src/config.h 2009-12-10 13:21:58.000000000 +0100 @@ -1 +1,488 @@ -dummy + @@ -490,9 +490,9 @@ +#else +#define HAVE_NTLM 1 +#endif ---- misc/neon-0.28.2/src/makefile.mk 2009-11-26 23:47:06.000000000 +0100 -+++ misc/build/neon-0.28.2/src/makefile.mk 2009-11-26 23:44:12.000000000 +0100 -@@ -1 +1,60 @@ +--- misc/neon-0.28.2/src/makefile.mk 2009-12-10 13:29:15.000000000 +0100 ++++ misc/build/neon-0.28.2/src/makefile.mk 2009-12-10 13:21:58.000000000 +0100 +@@ -1 +1,99 @@ -dummy +PRJ=..$/..$/..$/..$/.. + @@ -594,7 +594,7 @@ +DEF1NAME=$(SHL1TARGET) +.INCLUDE : target.mk --- misc/neon-0.28.2/src/ne_auth.c 2008-02-29 17:30:12.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_auth.c 2009-11-26 23:41:57.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_auth.c 2009-12-10 13:21:58.000000000 +0100 @@ -77,6 +77,10 @@ #include "ne_sspi.h" #endif @@ -633,24 +633,21 @@ static int get_credentials(auth_session *sess, ne_buffer **errmsg, int attempt, struct auth_challenge *chall, char *pwbuf) { -- if (chall->handler->creds(chall->handler->userdata, sess->realm, -+ if (chall->handler->creds(chall->handler->userdata, chall->protocol->name, sess->realm, +- if (chall->handler->creds(chall->handler->userdata, sess->realm, ++ if (chall->handler->creds(chall->handler->userdata, chall->protocol->name, sess->realm, chall->handler->attempt++, sess->username, pwbuf) == 0) { return 0; } else { -@@ -598,9 +611,10 @@ +@@ -598,7 +611,8 @@ int ntlm = ne_strcasecmp(parms->protocol->name, "NTLM") == 0; int status; char *response = NULL; -- +- + char password[NE_ABUFSIZ]; -+ ++ NE_DEBUG(NE_DBG_HTTPAUTH, "auth: SSPI challenge.\n"); -- -+ + if (!sess->sspi_context) { - ne_uri uri = {0}; - @@ -614,8 +628,17 @@ return status; } @@ -758,7 +755,7 @@ return ret; } --- misc/neon-0.28.2/src/ne_auth.h 2007-12-05 17:39:58.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_auth.h 2009-11-26 23:41:57.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_auth.h 2009-12-10 13:21:58.000000000 +0100 @@ -47,8 +47,8 @@ * Hint: if you just wish to attempt authentication just once (even if * the user gets the username/password wrong), have the callback @@ -771,7 +768,7 @@ /* Set callbacks to provide credentials for server and proxy * authentication, using the default set of authentication protocols. --- misc/neon-0.28.2/src/ne_defs.h 2006-10-24 21:40:09.000000000 +0200 -+++ misc/build/neon-0.28.2/src/ne_defs.h 2009-11-26 23:41:57.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_defs.h 2009-12-10 13:21:58.000000000 +0100 @@ -41,7 +41,7 @@ #endif @@ -782,7 +779,7 @@ #endif --- misc/neon-0.28.2/src/ne_locks.c 2007-02-05 11:09:27.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_locks.c 2009-11-26 23:41:57.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_locks.c 2009-12-10 13:21:58.000000000 +0100 @@ -579,6 +579,23 @@ const char *token = ne_get_response_header(ctx->req, "Lock-Token"); /* at the root element; retrieve the Lock-Token header, @@ -850,7 +847,7 @@ } } --- misc/neon-0.28.2/src/ne_locks.h 2006-01-02 12:43:19.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_locks.h 2009-11-26 23:41:57.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_locks.h 2009-12-10 13:21:58.000000000 +0100 @@ -22,6 +22,10 @@ #ifndef NE_LOCKS_H #define NE_LOCKS_H @@ -862,8 +859,8 @@ #include "ne_request.h" /* for ne_session + ne_request */ #include "ne_uri.h" /* for ne_uri */ ---- misc/neon-0.28.2/src/ne_ntlm.c 2009-11-26 23:47:06.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_ntlm.c 2009-11-26 23:41:57.000000000 +0100 +--- misc/neon-0.28.2/src/ne_ntlm.c 2009-12-10 13:29:15.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_ntlm.c 2009-12-10 13:21:58.000000000 +0100 @@ -1 +1,703 @@ -dummy +/* @@ -1569,8 +1566,8 @@ + +#endif /* HAVE_OPENSSL */ +#endif /* HAVE_NTLM */ ---- misc/neon-0.28.2/src/ne_ntlm.h 2009-11-26 23:47:06.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_ntlm.h 2009-11-26 23:41:57.000000000 +0100 +--- misc/neon-0.28.2/src/ne_ntlm.h 2009-12-10 13:29:15.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_ntlm.h 2009-12-10 13:21:58.000000000 +0100 @@ -1 +1,44 @@ -dummy +/* @@ -1618,7 +1615,7 @@ + +#endif /* NE_NTLM_H */ --- misc/neon-0.28.2/src/ne_socket.c 2008-02-28 14:19:19.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_socket.c 2009-11-26 23:41:57.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_socket.c 2009-12-10 13:21:58.000000000 +0100 @@ -60,6 +60,7 @@ #include #ifdef USE_GETADDRINFO @@ -1628,17 +1625,17 @@ #endif --- misc/neon-0.28.2/src/ne_sspi.c 2007-08-10 17:26:08.000000000 +0200 -+++ misc/build/neon-0.28.2/src/ne_sspi.c 2009-11-26 23:41:57.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_sspi.c 2009-12-10 13:28:42.000000000 +0100 @@ -202,9 +202,48 @@ return -1; } -+ return 0; ++ return 0; +} + +/* + * Simplification wrapper arround AcquireCredentialsHandle as most of -+ * the parameters do not change. ++ * the parameters do not change. + */ +static int acquireCredentialsHandleForUsername(CredHandle * credentials, char *package, const char *username, const char *password) +{ @@ -1691,7 +1688,7 @@ /* Reset any existing context since we are starting over */ resetContext(sspiContext); -+ ++ + if (strlen(username) != 0) { + if (acquireCredentialsHandleForUsername + (&sspiContext->credentials, sspiContext->mechanism, username, password) != SEC_E_OK) { @@ -1719,7 +1716,7 @@ securityStatus = initializeSecurityContext(&sspiContext->credentials, NULL, --- misc/neon-0.28.2/src/ne_sspi.h 2006-02-12 13:05:14.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_sspi.h 2009-11-26 23:41:57.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_sspi.h 2009-12-10 13:21:58.000000000 +0100 @@ -41,7 +41,7 @@ int ne_sspi_clear_context(void *context); @@ -1730,7 +1727,7 @@ #endif /* HAVE_SSPI */ --- misc/neon-0.28.2/src/ne_uri.c 2007-12-05 12:04:47.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_uri.c 2009-11-26 23:41:57.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_uri.c 2009-12-10 13:21:58.000000000 +0100 @@ -42,7 +42,7 @@ #include "ne_alloc.h" #include "ne_uri.h" @@ -1777,7 +1774,7 @@ /* 4x */ AT, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, /* 5x */ AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, GD, OT, GD, OT, US, --- misc/neon-0.28.2/src/ne_utils.c 2006-03-07 10:36:43.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_utils.c 2009-11-26 23:41:57.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_utils.c 2009-12-10 13:21:58.000000000 +0100 @@ -118,6 +118,9 @@ #ifdef HAVE_GNUTLS ", GNU TLS " LIBGNUTLS_VERSION @@ -1808,7 +1805,7 @@ #endif /* NE_HAVE_* */ default: --- misc/neon-0.28.2/src/ne_utils.h 2007-07-16 08:54:57.000000000 +0200 -+++ misc/build/neon-0.28.2/src/ne_utils.h 2009-11-26 23:41:57.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_utils.h 2009-12-10 13:21:58.000000000 +0100 @@ -54,6 +54,7 @@ #define NE_FEATURE_SOCKS (5) /* SOCKSv5 support */ #define NE_FEATURE_TS_SSL (6) /* Thread-safe SSL/TLS support */ -- cgit v1.2.3 From 8656cb103d8ecc0fee29357194619e81eabe572b Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Thu, 10 Dec 2009 14:04:12 +0100 Subject: linux build breaker due to warning. --- uui/source/iahndl.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx index 2cb0a5764ad0..98acd5f1c324 100644 --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -1106,7 +1106,7 @@ enum NameClashResolveDialogResult { ABORT, RENAME, OVERWRITE }; NameClashResolveDialogResult executeNameClashResolveDialog( - Window * pParent, + Window * /*pParent*/, rtl::OUString const & /*rTargetFolderURL*/, rtl::OUString const & /*rClashingName*/, rtl::OUString & /*rProposedNewName*/) @@ -1119,7 +1119,7 @@ executeNameClashResolveDialog( NameClashResolveDialogResult executeSimpleNameClashResolveDialog( - Window * pParent, + Window * /*pParent*/, rtl::OUString const & /*rTargetFolderURL*/, rtl::OUString const & /*rClashingName*/, rtl::OUString & /*rProposedNewName*/) -- cgit v1.2.3 From 72deb84fb946c53c4cf878c6b032dfc9e5dfd467 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Thu, 10 Dec 2009 14:26:42 +0100 Subject: Linux build breaker due to warning. --- ucb/source/ucp/webdav/UCBDeadPropertyValue.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ucb/source/ucp/webdav/UCBDeadPropertyValue.cxx b/ucb/source/ucp/webdav/UCBDeadPropertyValue.cxx index 6cd6795e2ff3..532a6f745b77 100644 --- a/ucb/source/ucp/webdav/UCBDeadPropertyValue.cxx +++ b/ucb/source/ucp/webdav/UCBDeadPropertyValue.cxx @@ -89,7 +89,7 @@ const rtl::OUString UCBDeadPropertyValue::aXMLEnd extern "C" int UCBDeadPropertyValue_startelement_callback( void *, int parent, - const char *nspace, + const char * /*nspace*/, const char *name, const char ** ) { -- cgit v1.2.3 From d5a8b4a9cf542b6567ccd69a67a96ade941cfba3 Mon Sep 17 00:00:00 2001 From: sj Date: Fri, 11 Dec 2009 12:22:43 +0100 Subject: impress181: #i107614#: fixed build error, dxerr9.h has been renamed to dxerr.h in the latest DirectX SDK from August 2009 --- canvas/source/directx/dx_winstuff.hxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/canvas/source/directx/dx_winstuff.hxx b/canvas/source/directx/dx_winstuff.hxx index 1c64506c0f21..47658991e74b 100755 --- a/canvas/source/directx/dx_winstuff.hxx +++ b/canvas/source/directx/dx_winstuff.hxx @@ -89,7 +89,7 @@ #include #include - #include +// #include #i107614# removing include, it has been changed in the latest sdk fron August2009 from dxerr9.h into dxerr.h typedef IDirect3DSurface9 surface_type; @@ -97,11 +97,11 @@ #undef DrawText -#ifdef __MINGW32__ -using ::std::max; -using ::std::min; -#endif - +#ifdef __MINGW32__ +using ::std::max; +using ::std::min; +#endif + #include #ifdef min -- cgit v1.2.3 From 38e664aa26e0fab066d82668a1ba4ef3dc58d3f6 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Fri, 11 Dec 2009 13:11:14 +0100 Subject: Windows build breaker due to warning. --- ucb/source/ucp/webdav/LockSequence.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ucb/source/ucp/webdav/LockSequence.cxx b/ucb/source/ucp/webdav/LockSequence.cxx index 178d41f9652a..e55de62e5552 100644 --- a/ucb/source/ucp/webdav/LockSequence.cxx +++ b/ucb/source/ucp/webdav/LockSequence.cxx @@ -74,7 +74,7 @@ struct LockSequenceParseContext extern "C" int LockSequence_startelement_callback( void *, int parent, - const char */*nspace*/, + const char * /*nspace*/, const char *name, const char ** ) { -- cgit v1.2.3 From 4e036c5f856ee63648871c2afdb8fdf177ac9778 Mon Sep 17 00:00:00 2001 From: sj Date: Fri, 11 Dec 2009 14:31:09 +0100 Subject: impress181: #i107561#: now also exporting notes to pdf --- filter/source/pdf/impdialog.cxx | 44 +++++++++++++++++++++++++++-------------- filter/source/pdf/impdialog.hrc | 17 ++++++++-------- filter/source/pdf/impdialog.hxx | 4 +++- filter/source/pdf/impdialog.src | 11 +++++++++-- filter/source/pdf/pdffilter.cxx | 3 ++- 5 files changed, 52 insertions(+), 27 deletions(-) diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx index 46b9835eb648..6c8bd9f23ae3 100644 --- a/filter/source/pdf/impdialog.cxx +++ b/filter/source/pdf/impdialog.cxx @@ -74,7 +74,8 @@ ImpPDFTabDialog::ImpPDFTabDialog( Window* pParent, mbReduceImageResolution( sal_False ), mnMaxImageResolution( 300 ), mbUseTaggedPDF( sal_False ), - mbExportNotesBoth( sal_True ), + mbExportNotes( sal_True ), + mbExportNotesPages( sal_False ), mbUseTransitionEffects( sal_False ), mbIsSkipEmptyPages( sal_True ), mnFormsType( 0 ), @@ -178,9 +179,8 @@ ImpPDFTabDialog::ImpPDFTabDialog( Window* pParent, mbUseTaggedPDF = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "UseTaggedPDF" ) ), sal_False ); mnPDFTypeSelection = maConfigItem.ReadInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "SelectPdfVersion" ) ), 0 ); if ( mbIsPresentation ) - mbExportNotesBoth = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportNotesPages" ) ), sal_False ); - else - mbExportNotesBoth = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportNotes" ) ), sal_True ); + mbExportNotesPages = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportNotesPages" ) ), sal_False ); + mbExportNotes = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportNotes" ) ), sal_False ); mbExportBookmarks = maConfigItem.ReadBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportBookmarks" ) ), sal_True ); mnOpenBookmarkLevels = maConfigItem.ReadInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "OpenBookmarkLevels" ) ), -1 ); @@ -308,9 +308,8 @@ Sequence< PropertyValue > ImpPDFTabDialog::GetFilterData() maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "SelectPdfVersion" ) ), mnPDFTypeSelection ); if ( mbIsPresentation ) - maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportNotesPages" ) ), mbExportNotesBoth ); - else - maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportNotes" ) ), mbExportNotesBoth ); + maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportNotesPages" ) ), mbExportNotesPages ); + maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportNotes" ) ), mbExportNotes ); maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportBookmarks" ) ), mbExportBookmarks ); maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "UseTransitionEffects" ) ), mbUseTransitionEffects ); @@ -435,6 +434,7 @@ ImpPDFTabGeneralPage::ImpPDFTabGeneralPage( Window* pParent, maCbExportBookmarks( this, ResId( CB_EXPORTBOOKMARKS, *paResMgr ) ), maCbExportNotes( this, ResId( CB_EXPORTNOTES, *paResMgr ) ), + maCbExportNotesPages( this, ResId( CB_EXPORTNOTESPAGES, *paResMgr ) ), maCbExportEmptyPages( this, ResId( CB_EXPORTEMPTYPAGES, *paResMgr ) ), maCbAddStream( this, ResId( CB_ADDSTREAM, *paResMgr ) ), mbIsPresentation( sal_False ), @@ -485,9 +485,6 @@ void ImpPDFTabGeneralPage::SetFilterConfigItem( const ImpPDFTabDialog* paParent maCbExportEmptyPages.Enable( mbIsWriter ); -// SJ: Dont know if there are Notes available also for writer. -// maCbExportNotes.Enable( paParent->mbIsPresentation ); - maRbLosslessCompression.SetToggleHdl( LINK( this, ImpPDFTabGeneralPage, ToggleCompressionHdl ) ); const sal_Bool bUseLosslessCompression = paParent->mbUseLosslessCompression; if ( bUseLosslessCompression ) @@ -532,12 +529,27 @@ void ImpPDFTabGeneralPage::SetFilterConfigItem( const ImpPDFTabDialog* paParent maLbFormsFormat.SelectEntryPos( (sal_uInt16)paParent->mnFormsType ); maLbFormsFormat.Enable( paParent->mbExportFormFields ); + maCbExportBookmarks.Check( paParent->mbExportBookmarks ); + + maCbExportNotes.Check( paParent->mbExportNotes ); + if ( mbIsPresentation ) - maCbExportNotes.Check( paParent->mbExportNotesBoth ); + { + maCbExportNotesPages.Show( TRUE ); + maCbExportNotesPages.Check( paParent->mbExportNotesPages ); + } else - maCbExportNotes.Check( paParent->mbExportNotesBoth ); - - maCbExportBookmarks.Check( paParent->mbExportBookmarks ); + { + long nCheckBoxHeight = + maCbExportNotesPages.LogicToPixel( Size( 13, 13 ), MAP_APPFONT ).Height(); + + Point aPos = maCbExportEmptyPages.GetPosPixel(); + maCbExportEmptyPages.SetPosPixel( Point( aPos.X(), aPos.Y() - nCheckBoxHeight ) ); + aPos = maCbAddStream.GetPosPixel(); + maCbAddStream.SetPosPixel( Point( aPos.X(), aPos.Y() - nCheckBoxHeight ) ); + maCbExportNotesPages.Show( FALSE ); + maCbExportNotesPages.Check( FALSE ); + } maCbExportEmptyPages.Check( !paParent->mbIsSkipEmptyPages ); @@ -570,7 +582,9 @@ void ImpPDFTabGeneralPage::GetFilterConfigItem( ImpPDFTabDialog* paParent ) paParent->mnQuality = static_cast(maNfQuality.GetValue()); paParent->mbReduceImageResolution = maCbReduceImageResolution.IsChecked(); paParent->mnMaxImageResolution = maCoReduceImageResolution.GetText().ToInt32(); - paParent->mbExportNotesBoth = maCbExportNotes.IsChecked(); + paParent->mbExportNotes = maCbExportNotes.IsChecked(); + if ( mbIsPresentation ) + paParent->mbExportNotesPages = maCbExportNotesPages.IsChecked(); paParent->mbExportBookmarks = maCbExportBookmarks.IsChecked(); paParent->mbIsSkipEmptyPages = !maCbExportEmptyPages.IsChecked(); diff --git a/filter/source/pdf/impdialog.hrc b/filter/source/pdf/impdialog.hrc index 23089f1419e9..291f5f985e1a 100644 --- a/filter/source/pdf/impdialog.hrc +++ b/filter/source/pdf/impdialog.hrc @@ -79,14 +79,15 @@ #define FL_GENERAL 16 #define CB_TAGGEDPDF 17 #define CB_EXPORTNOTES 18 -#define CB_EXPORTBOOKMARKS 19 -#define CB_EXPORTFORMFIELDS 20 -#define FT_FORMSFORMAT 21 -#define LB_FORMSFORMAT 22 -#define CB_EXPORTEMPTYPAGES 23 -#define CB_ADDSTREAM 24 - -#define CB_PDFA_1B_SELECT 25 +#define CB_EXPORTNOTESPAGES 19 +#define CB_EXPORTBOOKMARKS 20 +#define CB_EXPORTFORMFIELDS 21 +#define FT_FORMSFORMAT 22 +#define LB_FORMSFORMAT 23 +#define CB_EXPORTEMPTYPAGES 24 +#define CB_ADDSTREAM 25 + +#define CB_PDFA_1B_SELECT 26 #define FL_OLD_PAGES 51 #define RB_OLD_ALL 52 diff --git a/filter/source/pdf/impdialog.hxx b/filter/source/pdf/impdialog.hxx index 7ace316ac1eb..33e7bf7d57cf 100644 --- a/filter/source/pdf/impdialog.hxx +++ b/filter/source/pdf/impdialog.hxx @@ -97,7 +97,8 @@ protected: sal_Int32 mnMaxImageResolution; sal_Bool mbUseTaggedPDF; sal_Int32 mnPDFTypeSelection; - sal_Bool mbExportNotesBoth; + sal_Bool mbExportNotes; + sal_Bool mbExportNotesPages; sal_Bool mbUseTransitionEffects; sal_Bool mbIsSkipEmptyPages; sal_Bool mbAddStream; @@ -195,6 +196,7 @@ class ImpPDFTabGeneralPage : public SfxTabPage CheckBox maCbExportBookmarks; CheckBox maCbExportNotes; + CheckBox maCbExportNotesPages; CheckBox maCbExportEmptyPages; CheckBox maCbAddStream; diff --git a/filter/source/pdf/impdialog.src b/filter/source/pdf/impdialog.src index 00abf5b5ebd4..6140f299601e 100644 --- a/filter/source/pdf/impdialog.src +++ b/filter/source/pdf/impdialog.src @@ -210,9 +210,16 @@ TabPage RID_PDF_TAB_GENER TabStop = TRUE ; Text[ en-US ] = "~Export comments"; }; - CheckBox CB_EXPORTEMPTYPAGES + CheckBox CB_EXPORTNOTESPAGES { Pos = MAP_APPFONT ( 12 , 206 ) ; + Size = MAP_APPFONT ( 158 , 10 ) ; + TabStop = TRUE ; + Text[ en-US ] = "Export ~notes pages"; + }; + CheckBox CB_EXPORTEMPTYPAGES + { + Pos = MAP_APPFONT ( 12 , 219 ) ; Size = MAP_APPFONT ( 158 , 16 ) ; TabStop = TRUE ; WordBreak = TRUE ; @@ -220,7 +227,7 @@ TabPage RID_PDF_TAB_GENER }; CheckBox CB_ADDSTREAM { - Pos = MAP_APPFONT ( 12 , 224 ) ; + Pos = MAP_APPFONT ( 12 , 237 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; TabStop = TRUE ; Text[ en-US ] = "Create ~hybrid file"; diff --git a/filter/source/pdf/pdffilter.cxx b/filter/source/pdf/pdffilter.cxx index eea108d39187..c41466918317 100644 --- a/filter/source/pdf/pdffilter.cxx +++ b/filter/source/pdf/pdffilter.cxx @@ -85,7 +85,8 @@ sal_Bool PDFFilter::implExport( const Sequence< PropertyValue >& rDescriptor ) aCfgItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "MaxImageResolution" ) ), 300 ); aCfgItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "UseTaggedPDF" ) ), sal_False ); aCfgItem.ReadInt32( String( RTL_CONSTASCII_USTRINGPARAM( "SelectPdfVersion" ) ), 0 ); - aCfgItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "ExportNotes" ) ), sal_True ); + aCfgItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "ExportNotes" ) ), sal_False ); + aCfgItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "ExportNotesPages" ) ), sal_False ); aCfgItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "UseTransitionEffects" ) ), sal_True ); aCfgItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "IsSkipEmptyPages" ) ), sal_False ); aCfgItem.ReadBool( String( RTL_CONSTASCII_USTRINGPARAM( "ExportFormFields" ) ), sal_True ); -- cgit v1.2.3 From 55c5ee94dee3182d7ba0d2961266f49db5561bb6 Mon Sep 17 00:00:00 2001 From: sj Date: Fri, 11 Dec 2009 14:31:09 +0100 Subject: impress181: #i107561#: now also exporting notes to pdf --- sd/source/ui/unoidl/unomodel.cxx | 52 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 8906059e57cf..aaa6920749c2 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -65,6 +65,7 @@ #include #include #include +#include #include #include @@ -111,6 +112,12 @@ #include #include +#include +#include +#include +#include +#include + using ::rtl::OUString; #include @@ -1604,6 +1611,44 @@ sal_Int32 ImplPDFGetBookmarkPage( const String& rBookmark, SdDrawDocument& rDoc return nPage; } +void ImplPDFExportComments( uno::Reference< drawing::XDrawPage > xPage, vcl::PDFExtOutDevData& rPDFExtOutDevData ) +{ + try + { + uno::Reference< office::XAnnotationAccess > xAnnotationAccess( xPage, uno::UNO_QUERY_THROW ); + uno::Reference< office::XAnnotationEnumeration > xAnnotationEnumeration( xAnnotationAccess->createAnnotationEnumeration() ); + + sal_Int32 nIndex = 1; + + LanguageType eLanguage = Application::GetSettings().GetLanguage(); + while( xAnnotationEnumeration->hasMoreElements() ) + { + uno::Reference< office::XAnnotation > xAnnotation( xAnnotationEnumeration->nextElement() ); + + geometry::RealPoint2D aRealPoint2D( xAnnotation->getPosition() ); + uno::Reference< text::XText > xText( xAnnotation->getTextRange() ); +// rtl::OUString sInitials( getInitials( sAuthor ) ); + util::DateTime aDateTime( xAnnotation->getDateTime() ); + + Date aDate( aDateTime.Day, aDateTime.Month, aDateTime.Year ); + Time aTime; + String aStr( SvxDateTimeField::GetFormatted( aDate, aTime, SVXDATEFORMAT_B, *(SD_MOD()->GetNumberFormatter()), eLanguage ) ); + + vcl::PDFNote aNote; + String sTitle( xAnnotation->getAuthor() ); + sTitle.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ", " ) ); + sTitle += aStr; + aNote.Title = sTitle; + aNote.Contents = xText->getString(); + rPDFExtOutDevData.CreateNote( Rectangle( Point( static_cast< long >( aRealPoint2D.X * 100 ), + static_cast< long >( aRealPoint2D.Y * 100 ) ), Size( 1000, 1000 ) ), aNote ); + } + } + catch( uno::Exception& ) + { + } +} + void ImplPDFExportShapeInteraction( uno::Reference< drawing::XShape > xShape, SdDrawDocument& rDoc, vcl::PDFExtOutDevData& rPDFExtOutDevData ) { const rtl::OUString sGroup ( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.GroupShape" ) ); @@ -1842,11 +1887,14 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r const sal_Int32 nPageNumber = nRenderer + 1; PageKind ePageKind = PK_STANDARD; sal_Bool bExportNotesPages = sal_False; + sal_Bool bExportNotes = sal_False; for( sal_Int32 nProperty = 0, nPropertyCount = rxOptions.getLength(); nProperty < nPropertyCount; ++nProperty ) { if( rxOptions[ nProperty ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "RenderDevice" ) ) ) - rxOptions[ nProperty].Value >>= xRenderDevice; + rxOptions[ nProperty ].Value >>= xRenderDevice; + else if ( rxOptions[ nProperty ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportNotes" ) ) ) + rxOptions[ nProperty ].Value >>= bExportNotes; else if ( rxOptions[ nProperty ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportNotesPages" ) ) ) { rxOptions[ nProperty].Value >>= bExportNotesPages; @@ -1942,6 +1990,8 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r uno::Reference< drawing::XDrawPage > xPage( uno::Reference< drawing::XDrawPage >::query( pPage->getUnoPage() ) ); if ( xPage.is() ) { + if ( bExportNotes ) + ImplPDFExportComments( xPage, *pPDFExtOutDevData ); uno::Reference< beans::XPropertySet > xPagePropSet( xPage, uno::UNO_QUERY ); if( xPagePropSet.is() ) { -- cgit v1.2.3 From d8c231cecb76539bd83cc6241b487d57b77bd31a Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 11 Dec 2009 15:31:41 +0100 Subject: vcl108: #i107588# remove unused code (thanks cmc) --- .../inc/accessibility/extended/AccessibleGridControl.hxx | 8 -------- .../accessibility/extended/AccessibleGridControlHeader.hxx | 6 ------ .../accessibility/extended/AccessibleGridControlTable.hxx | 7 ------- .../extended/AccessibleGridControlTableBase.hxx | 8 -------- accessibility/source/extended/AccessibleGridControl.cxx | 9 --------- .../source/extended/AccessibleGridControlHeader.cxx | 9 --------- accessibility/source/extended/AccessibleGridControlTable.cxx | 12 ------------ .../source/extended/AccessibleGridControlTableBase.cxx | 10 ---------- 8 files changed, 69 deletions(-) diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControl.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControl.hxx index 765dc115fa11..219cf03dfe88 100755 --- a/accessibility/inc/accessibility/extended/AccessibleGridControl.hxx +++ b/accessibility/inc/accessibility/extended/AccessibleGridControl.hxx @@ -64,14 +64,6 @@ protected: virtual ~AccessibleGridControl(); - /** sets the XAccessible which created the context - -

To be called only once, and only if in the ctor NULL was passed.

- */ - void setCreator( - const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxCreator - ); - /** Cleans up members. */ using AccessibleGridControlBase::disposing; virtual void SAL_CALL disposing(); diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControlHeader.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControlHeader.hxx index f164e7576247..1c1a3aee2804 100755 --- a/accessibility/inc/accessibility/extended/AccessibleGridControlHeader.hxx +++ b/accessibility/inc/accessibility/extended/AccessibleGridControlHeader.hxx @@ -197,12 +197,6 @@ protected: inline sal_Bool isRowBar() const; /** @return , if the objects is a header bar for columns. */ inline sal_Bool isColumnBar() const; - - /** @attention This method requires locked mutex's and a living object. - @throws IndexOutOfBoundsException - If the specified row/column index (depending on type) is invalid. */ - void ensureIsValidHeaderIndex( sal_Int32 nIndex ) - throw ( ::com::sun::star::lang::IndexOutOfBoundsException ); }; // inlines -------------------------------------------------------------------- diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControlTable.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControlTable.hxx index c3465c6c32fb..c71bfd5eb65f 100755 --- a/accessibility/inc/accessibility/extended/AccessibleGridControlTable.hxx +++ b/accessibility/inc/accessibility/extended/AccessibleGridControlTable.hxx @@ -211,13 +211,6 @@ protected: //// internal helper methods ------------------------------------------------ - /** Returns the specified row or column. Uses one of the parameters, - depending on object type. - @attention This method requires locked mutex's and a living object. - @return The XAccessible interface of the specified column/row. */ - ::com::sun::star::uno::Reference< - ::com::sun::star::accessibility::XAccessible > - implGetChild( sal_Int32 nRow, sal_uInt16 nColumnPos ); ///** @attention This method requires a locked mutex. // @return The XAccessibleTable interface of the specified header bar. */ ::com::sun::star::uno::Reference< diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControlTableBase.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControlTableBase.hxx index aa9eb061f147..79c294952acf 100755 --- a/accessibility/inc/accessibility/extended/AccessibleGridControlTableBase.hxx +++ b/accessibility/inc/accessibility/extended/AccessibleGridControlTableBase.hxx @@ -198,14 +198,6 @@ protected: @return The child index of the specified cell address. */ sal_Int32 implGetChildIndex( sal_Int32 nRow, sal_Int32 nColumn ) const; - /** @attention This method requires locked mutex's and a living object. - @return , if the specified row is selected. */ - sal_Bool implIsRowSelected( sal_Int32 nRow ) const; - - /** @attention This method requires locked mutex's and a living object. - @return The count of selected rows. */ - sal_Int32 implGetSelectedRowCount() const; - /** Fills a sequence with sorted indexes of completely selected rows. @attention This method requires locked mutex's and a living object. @param rSeq Out-parameter that takes the sorted row index list. */ diff --git a/accessibility/source/extended/AccessibleGridControl.cxx b/accessibility/source/extended/AccessibleGridControl.cxx index fd24a3f27aa1..4671f3284110 100755 --- a/accessibility/source/extended/AccessibleGridControl.cxx +++ b/accessibility/source/extended/AccessibleGridControl.cxx @@ -90,15 +90,6 @@ AccessibleGridControl::AccessibleGridControl( m_pImpl.reset( new AccessibleGridControl_Impl() ); m_pImpl->m_aCreator = _rxCreator; } -// ----------------------------------------------------------------------------- -void AccessibleGridControl::setCreator( const Reference< XAccessible >& _rxCreator ) -{ -#if OSL_DEBUG_LEVEL > 0 - Reference< XAccessible > xCreator = (Reference< XAccessible >)m_pImpl->m_aCreator; - DBG_ASSERT( !xCreator.is(), "accessibility/extended/AccessibleGridControl::setCreator: creator already set!" ); -#endif - m_pImpl->m_aCreator = _rxCreator; -} // ----------------------------------------------------------------------------- AccessibleGridControl::~AccessibleGridControl() diff --git a/accessibility/source/extended/AccessibleGridControlHeader.cxx b/accessibility/source/extended/AccessibleGridControlHeader.cxx index d8cc7a11d202..a5a2be4049dc 100755 --- a/accessibility/source/extended/AccessibleGridControlHeader.cxx +++ b/accessibility/source/extended/AccessibleGridControlHeader.cxx @@ -304,15 +304,6 @@ Reference< XAccessible > AccessibleGridControlHeader::implGetChild( return xChild; } -void AccessibleGridControlHeader::ensureIsValidHeaderIndex( sal_Int32 nIndex ) - throw ( lang::IndexOutOfBoundsException ) -{ - if( isRowBar() ) - ensureIsValidRow( nIndex ); - else - ensureIsValidColumn( nIndex ); -} - // ============================================================================ } // namespace accessibility diff --git a/accessibility/source/extended/AccessibleGridControlTable.cxx b/accessibility/source/extended/AccessibleGridControlTable.cxx index ba6c229e2dc5..3b51c986b8b1 100755 --- a/accessibility/source/extended/AccessibleGridControlTable.cxx +++ b/accessibility/source/extended/AccessibleGridControlTable.cxx @@ -297,7 +297,6 @@ sal_Int32 SAL_CALL AccessibleGridControlTable::getSelectedAccessibleChildCount() TCSolarGuard aSolarGuard; ::osl::MutexGuard aGuard( getOslMutex() ); ensureIsAlive(); - // return isRowBar() ? implGetSelectedRowCount() : implGetSelectedColumnCount(); return 0; } //To Do - not implemented yet @@ -309,9 +308,6 @@ AccessibleGridControlTable::getSelectedAccessibleChild( sal_Int32 nSelectedChild ::osl::MutexGuard aGuard( getOslMutex() ); ensureIsAlive(); (void)nSelectedChildIndex; - // method may throw lang::IndexOutOfBoundsException - //sal_Int32 nIndex = implGetChildIndexFromSelectedIndex( nSelectedChildIndex ); - //return implGetChild( nIndex, implToVCLColumnPos( nIndex ) ); return NULL; } //To Do - not implemented yet @@ -371,14 +367,6 @@ Rectangle AccessibleGridControlTable::implGetBoundingBoxOnScreen() return m_aTable.calcTableRect(); } // internal helper methods ---------------------------------------------------- - -Reference< XAccessible > AccessibleGridControlTable::implGetChild( - sal_Int32 nRow, sal_uInt16 nColumnPos ) -{ - (void)nRow; - (void)nColumnPos; - return NULL; -} //To Do - not implemented yet //sal_Int32 AccessibleGridControlTable::implGetChildIndexFromSelectedIndex( // sal_Int32 nSelectedChildIndex ) diff --git a/accessibility/source/extended/AccessibleGridControlTableBase.cxx b/accessibility/source/extended/AccessibleGridControlTableBase.cxx index bc266f10f323..76584bf4b965 100755 --- a/accessibility/source/extended/AccessibleGridControlTableBase.cxx +++ b/accessibility/source/extended/AccessibleGridControlTableBase.cxx @@ -263,16 +263,6 @@ sal_Int32 AccessibleGridControlTableBase::implGetChildIndex( return nRow * m_aTable.GetColumnCount() + nColumn; } -sal_Bool AccessibleGridControlTableBase::implIsRowSelected( sal_Int32 nRow ) const -{ - return m_aTable.IsRowSelected( nRow ); -} - -sal_Int32 AccessibleGridControlTableBase::implGetSelectedRowCount() const -{ - return m_aTable.GetSelectedRowCount(); -} - void AccessibleGridControlTableBase::implGetSelectedRows( Sequence< sal_Int32 >& rSeq ) { rSeq = comphelper::containerToSequence(m_aTable.GetSelectedRows()); -- cgit v1.2.3 From 5f6d2c4a5c2210efa12a8009bdaedf408197b06f Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 11 Dec 2009 15:48:06 +0100 Subject: vcl108: #i107595# fix debug compile (thanks arielch) --- vcl/unx/source/app/randrwrapper.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vcl/unx/source/app/randrwrapper.cxx b/vcl/unx/source/app/randrwrapper.cxx index 8d01b64d4680..49de00d22639 100644 --- a/vcl/unx/source/app/randrwrapper.cxx +++ b/vcl/unx/source/app/randrwrapper.cxx @@ -282,6 +282,9 @@ void RandRWrapper::releaseWrapper() #include "saldisp.hxx" #include "salframe.h" +#if OSL_DEBUG_LEVEL > 1 +#include +#endif void SalDisplay::InitRandR( XLIB_Window aRoot ) const { -- cgit v1.2.3 From 3d85ab392dcec7b54ebf8608b19d6c9d9b66fe2a Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Mon, 14 Dec 2009 14:49:26 +0100 Subject: #ii105553# - Removed unused code. --- ucb/source/ucp/file/filtask.hxx | 1 - 1 file changed, 1 deletion(-) diff --git a/ucb/source/ucp/file/filtask.hxx b/ucb/source/ucp/file/filtask.hxx index a4e7bff25c82..642c257b6ddf 100644 --- a/ucb/source/ucp/file/filtask.hxx +++ b/ucb/source/ucp/file/filtask.hxx @@ -172,7 +172,6 @@ namespace fileaccess sal_Int32 SAL_CALL getCommandId( void ); void SAL_CALL abort( sal_Int32 CommandId ); - bool SAL_CALL isAborted( sal_Int32 CommandId ); /** -- cgit v1.2.3 From 767342ac74a53042616e7d6b6925675925a859af Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Mon, 14 Dec 2009 15:49:09 +0100 Subject: vcl108: #i107648# add hotkey strings for MacOSX 10.6 --- apple_remote/AppleRemote.m | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/apple_remote/AppleRemote.m b/apple_remote/AppleRemote.m index 25a6771e7139..a65cc6440b41 100644 --- a/apple_remote/AppleRemote.m +++ b/apple_remote/AppleRemote.m @@ -42,6 +42,9 @@ const char* AppleRemoteDeviceName = "AppleIRController"; #ifndef NSAppKitVersionNumber10_4 #define NSAppKitVersionNumber10_4 824 #endif +#ifndef NSAppKitVersionNumber10_5 + #define NSAppKitVersionNumber10_5 949 +#endif @implementation AppleRemote @@ -53,6 +56,9 @@ const char* AppleRemoteDeviceName = "AppleIRController"; // TODO : avoid such magics if (floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_4) { + #ifdef DEBUG + NSLog( @"setting 10.4 cookies" ); + #endif // 10.4.x Tiger [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonPlus] forKey:@"14_12_11_6_"]; [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonMinus] forKey:@"14_13_11_6_"]; @@ -65,7 +71,10 @@ const char* AppleRemoteDeviceName = "AppleIRController"; [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonMenu_Hold] forKey:@"14_6_14_6_"]; [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonPlay_Hold] forKey:@"18_14_6_18_14_6_"]; [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteControl_Switched] forKey:@"19_"]; - } else { + } else if( floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_5 ) { + #ifdef DEBUG + NSLog( @"setting 10.5 cookies" ); + #endif // 10.5.x Leopard [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonPlus] forKey:@"31_29_28_19_18_"]; [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonMinus] forKey:@"31_30_28_19_18_"]; @@ -79,6 +88,24 @@ const char* AppleRemoteDeviceName = "AppleIRController"; [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonPlay_Hold] forKey:@"35_31_19_18_35_31_19_18_"]; [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteControl_Switched] forKey:@"19_"]; } + else + { + #ifdef DEBUG + NSLog( @"setting 10.6 cookies" ); + #endif + // 10.6.x Snow Leopard + [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonPlus] forKey:@"33_31_30_21_20_2_"]; + [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonMinus] forKey:@"33_32_30_21_20_2_"]; + [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonMenu] forKey:@"33_22_21_20_2_33_22_21_20_2_"]; + [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonPlay] forKey:@"33_23_21_20_2_33_23_21_20_2_"]; + [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonRight] forKey:@"33_24_21_20_2_33_24_21_20_2_"]; + [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonLeft] forKey:@"33_25_21_20_2_33_25_21_20_2_"]; + [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonRight_Hold] forKey:@"33_21_20_14_12_2_"]; + [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonLeft_Hold] forKey:@"33_21_20_13_12_2_"]; + [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonMenu_Hold] forKey:@"33_21_20_2_33_21_20_2_"]; + [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonPlay_Hold] forKey:@"37_33_21_20_2_37_33_21_20_2_"]; + [_cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteControl_Switched] forKey:@"19_"]; + } } - (void) sendRemoteButtonEvent: (RemoteControlEventIdentifier) event pressedDown: (BOOL) pressedDown { -- cgit v1.2.3 From 0d626cf0a51398528694069ce6e3e00fc2cbcd23 Mon Sep 17 00:00:00 2001 From: sj Date: Mon, 14 Dec 2009 16:11:45 +0100 Subject: impress181: #i63298#: fixed connector line styles, fixed line endings --- svx/source/msfilter/msdffimp.cxx | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/svx/source/msfilter/msdffimp.cxx b/svx/source/msfilter/msdffimp.cxx index c9cfde91547a..e26d258ace6e 100644 --- a/svx/source/msfilter/msdffimp.cxx +++ b/svx/source/msfilter/msdffimp.cxx @@ -5016,16 +5016,16 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r ApplyAttributes( rSt, aSet, aObjData ); pRet->SetMergedItemSet(aSet); } - else if ( aObjData.eShapeType == mso_sptLine ) - { - basegfx::B2DPolygon aPoly; - aPoly.append(basegfx::B2DPoint(aObjData.aBoundRect.Left(), aObjData.aBoundRect.Top())); - aPoly.append(basegfx::B2DPoint(aObjData.aBoundRect.Right(), aObjData.aBoundRect.Bottom())); - pRet = new SdrPathObj(OBJ_LINE, basegfx::B2DPolyPolygon(aPoly)); - pRet->SetModel( pSdrModel ); - ApplyAttributes( rSt, aSet, aObjData ); - pRet->SetMergedItemSet(aSet); - } + else if ( aObjData.eShapeType == mso_sptLine ) + { + basegfx::B2DPolygon aPoly; + aPoly.append(basegfx::B2DPoint(aObjData.aBoundRect.Left(), aObjData.aBoundRect.Top())); + aPoly.append(basegfx::B2DPoint(aObjData.aBoundRect.Right(), aObjData.aBoundRect.Bottom())); + pRet = new SdrPathObj(OBJ_LINE, basegfx::B2DPolyPolygon(aPoly)); + pRet->SetModel( pSdrModel ); + ApplyAttributes( rSt, aSet, aObjData ); + pRet->SetMergedItemSet(aSet); + } else { if ( GetCustomShapeContent( aObjData.eShapeType ) || IsProperty( DFF_Prop_pVertices ) ) @@ -5363,7 +5363,9 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r SdrObject::Free( pRet ); pRet = new SdrEdgeObj(); + ApplyAttributes( rSt, aSet, aObjData ); pRet->SetLogicRect( aObjData.aBoundRect ); + pRet->SetMergedItemSet(aSet); // Konnektoren MSO_ConnectorStyle eConnectorStyle = (MSO_ConnectorStyle)GetPropertyValue( DFF_Prop_cxstyle, mso_cxstyleStraight ); -- cgit v1.2.3 From 1c0ea39cacdd551310d1f263b652d0e0aefa68b6 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 15 Dec 2009 11:53:06 +0100 Subject: vcl108: #i100644# be prepared for empty invocation values --- vcl/unx/source/printer/ppdparser.cxx | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/vcl/unx/source/printer/ppdparser.cxx b/vcl/unx/source/printer/ppdparser.cxx index 95bc7bca41ca..705dcf8ccad7 100644 --- a/vcl/unx/source/printer/ppdparser.cxx +++ b/vcl/unx/source/printer/ppdparser.cxx @@ -806,20 +806,34 @@ void PPDParser::parse( ::std::list< ByteString >& rLines ) // read in more lines if necessary for multiline values aLine = aCurrentLine.Copy( nPos+1 ); - while( ! ( aLine.GetTokenCount( '"' ) & 1 ) && - line != rLines.end() ) - // while there is an even number of tokens; that m_eans - // an odd number of doubleqoutes + if( aLine.Len() ) { - // copy the newlines also - aLine += '\n'; - aLine += *line; - ++line; + while( ! ( aLine.GetTokenCount( '"' ) & 1 ) && + line != rLines.end() ) + // while there is an even number of tokens; that means + // an odd number of doubleqoutes + { + // copy the newlines also + aLine += '\n'; + aLine += *line; + ++line; + } } aLine = WhitespaceToSpace( aLine ); + // #i100644# handle a missing value (actually a broken PPD) + if( ! aLine.Len() ) + { + pValue->m_aValue = String(); + pValue->m_aValueTranslation = String(); + if( pValue->m_aOption.Len() && + aKey.CompareTo( "JCL", 3 ) != COMPARE_EQUAL ) + pValue->m_eType = eInvocation; + else + pValue->m_eType = eQuoted; + } // check for invocation or quoted value - if( aLine.GetChar(0) == '"' ) + else if( aLine.GetChar(0) == '"' ) { aLine.Erase( 0, 1 ); nTransPos = aLine.Search( '"' ); -- cgit v1.2.3 From 51da2ee75357b631f4970517e2bccabf12e7e561 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 15 Dec 2009 12:31:08 +0100 Subject: vcl108: #i95682# omit JobPatch entries in CUPS case as CUPS adds them itself --- vcl/inc/vcl/printerinfomanager.hxx | 2 ++ vcl/unx/source/printer/cupsmgr.cxx | 4 ++++ vcl/unx/source/printer/printerinfomanager.cxx | 1 + vcl/unx/source/printergfx/printerjob.cxx | 3 +++ 4 files changed, 10 insertions(+) diff --git a/vcl/inc/vcl/printerinfomanager.hxx b/vcl/inc/vcl/printerinfomanager.hxx index 810ad428c9db..2fb6ef1c2413 100644 --- a/vcl/inc/vcl/printerinfomanager.hxx +++ b/vcl/inc/vcl/printerinfomanager.hxx @@ -136,6 +136,7 @@ protected: Type m_eType; bool m_bUseIncludeFeature; + bool m_bUseJobPatch; rtl::OUString m_aSystemDefaultPaper; bool m_bDisableCUPS; @@ -226,6 +227,7 @@ public: virtual bool addOrRemovePossible() const; bool getUseIncludeFeature() const { return m_bUseIncludeFeature; } + bool getUseJobPatch() const { return m_bUseJobPatch; } // check whether a printer's feature string contains a subfeature bool checkFeatureToken( const rtl::OUString& rPrinterName, const char* pToken ) const; diff --git a/vcl/unx/source/printer/cupsmgr.cxx b/vcl/unx/source/printer/cupsmgr.cxx index d0c7f184fb06..4c38479f1107 100644 --- a/vcl/unx/source/printer/cupsmgr.cxx +++ b/vcl/unx/source/printer/cupsmgr.cxx @@ -533,6 +533,10 @@ void CUPSManager::initialize() pDest->options ); if( pOpt ) m_bUseIncludeFeature = true; + // do not send include JobPatch; CUPS will insert that itself + // TODO: currently unknwon which versions of CUPS insert JobPatches + // so currently it is assumed CUPS = don't insert JobPatch files + m_bUseJobPatch = false; rtl_TextEncoding aEncoding = osl_getThreadTextEncoding(); int nPrinter = m_nDests; diff --git a/vcl/unx/source/printer/printerinfomanager.cxx b/vcl/unx/source/printer/printerinfomanager.cxx index b3e5b4667a6a..afe4182cd766 100644 --- a/vcl/unx/source/printer/printerinfomanager.cxx +++ b/vcl/unx/source/printer/printerinfomanager.cxx @@ -119,6 +119,7 @@ PrinterInfoManager::PrinterInfoManager( Type eType ) : m_pQueueInfo( NULL ), m_eType( eType ), m_bUseIncludeFeature( false ), + m_bUseJobPatch( true ), m_aSystemDefaultPaper( RTL_CONSTASCII_USTRINGPARAM( "A4" ) ), m_bDisableCUPS( false ) { diff --git a/vcl/unx/source/printergfx/printerjob.cxx b/vcl/unx/source/printergfx/printerjob.cxx index 783dd5ff2b47..5a51f1d76b92 100644 --- a/vcl/unx/source/printergfx/printerjob.cxx +++ b/vcl/unx/source/printergfx/printerjob.cxx @@ -914,6 +914,9 @@ bool PrinterJob::writePageSetup( osl::File* pFile, const JobData& rJob ) void PrinterJob::writeJobPatch( osl::File* pFile, const JobData& rJobData ) { + if( ! PrinterInfoManager::get().getUseJobPatch() ) + return; + const PPDKey* pKey = NULL; if( rJobData.m_pParser ) -- cgit v1.2.3 From 3bdc311dddf19c6df2f65e5a72ca7262a6f34316 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Tue, 15 Dec 2009 13:24:14 +0100 Subject: whitespace cleanup. --- ucb/source/ucp/file/shell.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ucb/source/ucp/file/shell.cxx b/ucb/source/ucp/file/shell.cxx index f53873563c99..524d6541844f 100644 --- a/ucb/source/ucp/file/shell.cxx +++ b/ucb/source/ucp/file/shell.cxx @@ -312,7 +312,6 @@ shell::shell( const uno::Reference< lang::XMultiServiceFactory >& xMultiServiceF #endif - // ContentType uno::Any aAny; aAny <<= rtl::OUString(); @@ -1597,7 +1596,7 @@ shell::remove( sal_Int32 CommandId, nError = aDirectory.getNextItem( aItem ); while( nError == osl::FileBase::E_None ) { - nError = aItem.getFileStatus( aStatus ); + nError = aItem.getFileStatus( aStatus ); if( nError != osl::FileBase::E_None || ! aStatus.isValid( nMask ) ) { installError( CommandId, @@ -1623,7 +1622,7 @@ shell::remove( sal_Int32 CommandId, nError = aDirectory.getNextItem( aItem ); } - aDirectory.close(); + aDirectory.close(); if( ! whileSuccess ) return sal_False; // error code is installed -- cgit v1.2.3 -- cgit v1.2.3 From f07e345bc54ea130ef7447e316c66c3de636ab11 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Tue, 15 Dec 2009 13:33:40 +0100 Subject: whitespace cleanup. --- ucb/source/ucp/file/bc.cxx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ucb/source/ucp/file/bc.cxx b/ucb/source/ucp/file/bc.cxx index beb366b07ca5..d8f3d4afb461 100644 --- a/ucb/source/ucp/file/bc.cxx +++ b/ucb/source/ucp/file/bc.cxx @@ -529,9 +529,9 @@ BaseContent::getContentType() // Who am I ? Sequence< beans::Property > seq(1); seq[0] = beans::Property( rtl::OUString::createFromAscii("IsDocument"), - -1, - getCppuType( static_cast< sal_Bool* >(0) ), - 0 ); + -1, + getCppuType( static_cast< sal_Bool* >(0) ), + 0 ); Reference< sdbc::XRow > xRow = getPropertyValues( -1,seq ); sal_Bool IsDocument = xRow->getBoolean( 1 ); @@ -688,18 +688,18 @@ BaseContent::createNewContent( { Sequence< beans::Property > seq(1); seq[0] = beans::Property( rtl::OUString::createFromAscii("IsDocument"), - -1, - getCppuType( static_cast< sal_Bool* >(0) ), - 0 ); + -1, + getCppuType( static_cast< sal_Bool* >(0) ), + 0 ); Reference< sdbc::XRow > xRow = getPropertyValues( -1,seq ); IsDocument = xRow->getBoolean( 1 ); if ( xRow->wasNull() ) { IsDocument = false; -// OSL_ENSURE( false, -// "BaseContent::createNewContent - Property value was null!" ); -// return Reference< XContent >(); +// OSL_ENSURE( false, +// "BaseContent::createNewContent - Property value was null!" ); +// return Reference< XContent >(); } } catch ( sdbc::SQLException const & ) -- cgit v1.2.3 -- cgit v1.2.3 From 3ac986503f7b17de7e55500cccf56cafeb890e85 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Tue, 15 Dec 2009 13:42:22 +0100 Subject: whitespace cleanup. --- ucb/source/ucp/file/filglob.cxx | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/ucb/source/ucp/file/filglob.cxx b/ucb/source/ucp/file/filglob.cxx index 25095a4f9082..6cc103ea7f08 100644 --- a/ucb/source/ucp/file/filglob.cxx +++ b/ucb/source/ucp/file/filglob.cxx @@ -655,15 +655,15 @@ namespace fileaccess { aAny <<= excep; cancelCommandExecution( aAny,xEnv ); } -// ioErrorCode = IOErrorCode_ALREADY_EXISTING; -// cancelCommandExecution( -// ioErrorCode, -// generateErrorArguments(aUncPath), -// xEnv, -// rtl::OUString( -// RTL_CONSTASCII_USTRINGPARAM( -// "the folder exists")), -// xComProc ); +// ioErrorCode = IOErrorCode_ALREADY_EXISTING; +// cancelCommandExecution( +// ioErrorCode, +// generateErrorArguments(aUncPath), +// xEnv, +// rtl::OUString( +// RTL_CONSTASCII_USTRINGPARAM( +// "the folder exists")), +// xComProc ); } else if( errorCode == TASKHANDLING_ENSUREDIR_FOR_WRITE || errorCode == TASKHANDLING_CREATEDIRECTORY_MKDIR ) @@ -814,20 +814,20 @@ namespace fileaccess { errorCode == TASKHANDLING_TRANSFER_BY_MOVE_SOURCESTAT ) { ioErrorCode = IOErrorCode_NOT_EXISTING; - aMsg = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + aMsg = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "source file/folder does not exist")); break; } else { ioErrorCode = IOErrorCode_GENERAL; - aMsg = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + aMsg = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "a general error during transfer command")); break; } default: ioErrorCode = IOErrorCode_GENERAL; - aMsg = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + aMsg = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "a general error during transfer command")); break; } -- cgit v1.2.3 From b9a98a3a5853988afc5489eea36954fb29cf59fc Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 15 Dec 2009 18:38:02 +0100 Subject: remove a debug remnant --- vcl/unx/gtk/app/gtkinst.cxx | 5 ----- 1 file changed, 5 deletions(-) diff --git a/vcl/unx/gtk/app/gtkinst.cxx b/vcl/unx/gtk/app/gtkinst.cxx index af3a1df97a8c..92a8ff641a38 100644 --- a/vcl/unx/gtk/app/gtkinst.cxx +++ b/vcl/unx/gtk/app/gtkinst.cxx @@ -144,11 +144,6 @@ extern "C" if( ! ( pNoXInitThreads && *pNoXInitThreads ) ) XInitThreads(); - #if OSL_DEBUG_LEVEL > 1 - int nFd = open( "/home/pl93762/log.txt", O_CREAT | O_TRUNC | O_WRONLY, 0755 ); - dup2( nFd, STDERR_FILENO ); - #endif - const gchar* pVersion = gtk_check_version( 2, 2, 0 ); if( pVersion ) { -- cgit v1.2.3 From 085de48cba0c845b939b4b50fc9ae7439a030460 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 15 Dec 2009 19:29:01 +0100 Subject: vcl108: #i102696# make menubar behave more gtk like in case of gtk plugin --- vcl/source/window/menu.cxx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index c9e0c23e7f16..5b99cd084360 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -5578,6 +5578,17 @@ BOOL MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu n = pMenu->GetItemCount()-1; } + // handling gtk like (aka mbOpenMenuOnF10) + // do not highlight an item when opening a sub menu + // unless there already was a higlighted sub menu item + bool bWasHighlight = false; + if( pActivePopup ) + { + MenuFloatingWindow* pSubWindow = dynamic_cast(pActivePopup->ImplGetWindow()); + if( pSubWindow ) + bWasHighlight = (pSubWindow->GetHighlightedItem() != ITEMPOS_INVALID); + } + USHORT nLoop = n; if( nCode == KEY_HOME ) @@ -5604,7 +5615,10 @@ BOOL MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu MenuItemData* pData = (MenuItemData*)pMenu->GetItemList()->GetDataFromPos( n ); if ( ( pData->eType != MENUITEM_SEPARATOR ) && pMenu->ImplIsVisible( n ) ) { - ChangeHighlightItem( n, TRUE ); + BOOL bDoSelect = TRUE; + if( ImplGetSVData()->maNWFData.mbOpenMenuOnF10 ) + bDoSelect = bWasHighlight; + ChangeHighlightItem( n, bDoSelect ); break; } } while ( n != nLoop ); -- cgit v1.2.3 From af5c661b945658b1c0a2f61e66446d030abdbf40 Mon Sep 17 00:00:00 2001 From: ericb Date: Tue, 15 Dec 2009 23:12:19 +0100 Subject: #i97972# commit all changes since Thorsten rebase. Thanks to Nelle, Jonathan, Christian and ericb --- sd/source/ui/slideshow/makefile.mk | 5 +- sd/source/ui/slideshow/slideshow.cxx | 2 +- sd/source/ui/slideshow/slideshow.hrc | 43 +++-- sd/source/ui/slideshow/slideshow.src | 45 +++-- sd/source/ui/slideshow/slideshowimpl.cxx | 183 +++++++++++++++++---- sd/source/ui/slideshow/slideshowimpl.hxx | 20 ++- slideshow/source/engine/color.cxx | 13 ++ slideshow/source/engine/eventmultiplexer.cxx | 22 ++- slideshow/source/engine/makefile.mk | 4 + slideshow/source/engine/shapes/shapeimporter.cxx | 4 + slideshow/source/engine/slide/slideimpl.cxx | 15 +- slideshow/source/engine/slide/userpaintoverlay.cxx | 51 ++++-- slideshow/source/engine/slideshowimpl.cxx | 68 ++++++-- slideshow/source/engine/tools.cxx | 30 ++-- slideshow/source/inc/eventmultiplexer.hxx | 4 +- slideshow/source/inc/rgbcolor.hxx | 3 + slideshow/source/inc/shapeimporter.hxx | 2 +- slideshow/source/inc/userpainteventhandler.hxx | 5 +- 18 files changed, 396 insertions(+), 123 deletions(-) diff --git a/sd/source/ui/slideshow/makefile.mk b/sd/source/ui/slideshow/makefile.mk index b9b3cc9ee84f..7055d723df55 100644 --- a/sd/source/ui/slideshow/makefile.mk +++ b/sd/source/ui/slideshow/makefile.mk @@ -43,8 +43,9 @@ AUTOSEG=true .INCLUDE : settings.mk .INCLUDE : $(PRJ)$/util$/makefile.pmk -.IF "$(ENABLE_PRESENTER_EXTRA_UI)"="YES" -CDEFS+= -DENABLE_PRESENTER_EXTRA_UI +.IF "$(ENABLE_PRESENTER_EXTRA_UI)"=="YES" +RSCDEFS+=-DENABLE_PRESENTER_EXTRA_UI +ADDCDEFS+=-DENABLE_PRESENTER_EXTRA_UI .ENDIF # --- Files -------------------------------------------------------- diff --git a/sd/source/ui/slideshow/slideshow.cxx b/sd/source/ui/slideshow/slideshow.cxx index 6d5e3e31ad80..7df7e3e105f7 100644 --- a/sd/source/ui/slideshow/slideshow.cxx +++ b/sd/source/ui/slideshow/slideshow.cxx @@ -87,7 +87,7 @@ extern String getUiNameFromPageApiNameImpl( const ::rtl::OUString& rApiName ); namespace { /** This local version of the work window overloads DataChanged() so that it - can restart the slide show when a displau is added or removed. + can restart the slide show when a display is added or removed. */ class FullScreenWorkWindow : public WorkWindow { diff --git a/sd/source/ui/slideshow/slideshow.hrc b/sd/source/ui/slideshow/slideshow.hrc index 11a5f9807bb1..85b2cf0f3009 100644 --- a/sd/source/ui/slideshow/slideshow.hrc +++ b/sd/source/ui/slideshow/slideshow.hrc @@ -27,6 +27,7 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ + #ifndef SD_SLIDESHOW_HRC_ #define SD_SLIDESHOW_HRC_ @@ -37,23 +38,29 @@ #define CM_SCREEN_BLACK 5 #define CM_SCREEN_WHITE 6 #define CM_ENDSHOW 7 -#define CM_ERASE_INK 8 -#define CM_ERASE_ALLINK 9 -#define CM_ERASE_INK_PEN 10 -#define CM_ERASE_INK_PEN_VERY_THIN 11 -#define CM_ERASE_INK_PEN_THIN 12 -#define CM_ERASE_INK_PEN_NORMAL 13 -#define CM_ERASE_INK_PEN_THICK 14 -#define CM_ERASE_INK_PEN_VERY_THICK 15 -#define CM_COLOR_PEN 16 -#define CM_WIDTH_PEN 17 -#define CM_WIDTH_PEN_VERY_THIN 18 -#define CM_WIDTH_PEN_THIN 19 -#define CM_WIDTH_PEN_NORMAL 20 -#define CM_WIDTH_PEN_THICK 21 -#define CM_WIDTH_PEN_VERY_THICK 22 -#define CM_FIRST_SLIDE 23 -#define CM_LAST_SLIDE 24 -#define CM_SLIDES 25 +#define CM_FIRST_SLIDE 8 +#define CM_LAST_SLIDE 9 +#define CM_SLIDES 10 +#ifdef ENABLE_PRESENTER_EXTRA_UI +//CM for extra presenter UI +#define CM_ERASE_ALLINK 11 +#define CM_ERASE_INK 12 +#define CM_ERASE_INK_PEN 13 +#define CM_ERASE_INK_PEN_VERY_THIN 14 +#define CM_ERASE_INK_PEN_THIN 15 +#define CM_ERASE_INK_PEN_NORMAL 16 +#define CM_ERASE_INK_PEN_THICK 17 +#define CM_ERASE_INK_PEN_VERY_THICK 18 +#define CM_COLOR_PEN 19 +#define CM_WIDTH_PEN 20 +#define CM_WIDTH_PEN_VERY_THIN 21 +#define CM_WIDTH_PEN_THIN 22 +#define CM_WIDTH_PEN_NORMAL 23 +#define CM_WIDTH_PEN_THICK 24 +#define CM_WIDTH_PEN_VERY_THICK 25 +#define CM_PEN_MODE 26 +#define CM_ERASE_MODE 27 +#define CM_POINTER_OPTION 28 +#endif //ENABLE_PRESENTER_EXTRA_UI #endif diff --git a/sd/source/ui/slideshow/slideshow.src b/sd/source/ui/slideshow/slideshow.src index 07df291e428f..ee21508deb38 100644 --- a/sd/source/ui/slideshow/slideshow.src +++ b/sd/source/ui/slideshow/slideshow.src @@ -74,13 +74,27 @@ Menu RID_SLIDESHOW_CONTEXTMENU { Separator = TRUE; }; +#ifdef ENABLE_PRESENTER_EXTRA_UI MenuItem { - Identifier = CM_WIDTH_PEN; - Text [ en-US ] = "~Pen Width" ; - + Identifier = CM_PEN_MODE; + Text [ en-US ] = "~Pen Mode"; + }; + MenuItem + { + Identifier = CM_ERASE_MODE; + Text [ en-US ] = "~Eraser Mode"; + }; + MenuItem + { + Separator = TRUE; + }; + MenuItem + { + Identifier = CM_WIDTH_PEN; + Text [ en-US ] = "~Pen Width" ; SubMenu = Menu - { + { ItemList = { MenuItem @@ -115,8 +129,8 @@ Menu RID_SLIDESHOW_CONTEXTMENU { Separator = TRUE; }; - MenuItem - { + MenuItem + { Identifier = CM_COLOR_PEN ; Text [ en-US ] = "~Change Pen Color" ; }; @@ -131,23 +145,23 @@ Menu RID_SLIDESHOW_CONTEXTMENU MenuItem { Identifier = CM_ERASE_ALLINK ; - Text [ en-US ] = "~Erase All Ink" ; - }; - MenuItem - { - Identifier = CM_ERASE_INK ; - Text [ en-US ] = "~Erase Ink Mode ON/OFF" ; + Text [ en-US ] = "~Erase All Ink On Slide" ; }; + // MenuItem + // { + // Identifier = CM_ERASE_INK ; + // Text [ en-US ] = "~Erase Ink Mode ON/OFF" ; + // }; MenuItem { Separator = TRUE; }; MenuItem { - Identifier = CM_ERASE_INK_PEN; - Text [ en-US ] = "~Eraser Size" ; + Identifier = CM_ERASE_INK_PEN; + Text [ en-US ] = "~Eraser Width" ; - SubMenu = Menu + SubMenu = Menu { ItemList = { @@ -179,6 +193,7 @@ Menu RID_SLIDESHOW_CONTEXTMENU }; }; }; +#endif MenuItem { Separator = TRUE; diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index c7966d805c01..eb4a430116ff 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -468,6 +468,8 @@ bool AnimationSlideController::previousSlide() return jumpToSlideIndex( getPreviousSlideIndex() ); } + + void AnimationSlideController::displayCurrentSlide( const Reference< XSlideShow >& xShow, const Reference< XDrawPagesSupplier>& xDrawPages ) { const sal_Int32 nCurrentSlideNumber = getCurrentSlideNumber(); @@ -525,11 +527,15 @@ SlideshowImpl::SlideshowImpl( const Reference< XPresentation2 >& xPresentation, , mbInputFreeze(false) , mbActive(sal_False) , maPresSettings( pDoc->getPresentationSettings() ) -, mnUserPaintColor( 0x00000000L ) +, mnUserPaintColor( 0x00000000L ) //User paint color is Black by default +#ifdef ENABLE_PRESENTER_EXTRA_UI +, mbSwitchPenMode(true) +, mbSwitchEraserMode(false) , mdUserPaintStrokeWidth ( 4.0 ) , mbEraseAllInk(false) -, mbEraseInk(false) -, mnEraseInkSize(100.0) +//, mbEraseInk(false) +, mnEraseInkSize(100) +#endif , mnEntryCounter(0) , mnLastSlideNumber(-1) , msOnClick( RTL_CONSTASCII_USTRINGPARAM("OnClick") ) @@ -1093,6 +1099,7 @@ bool SlideshowImpl::startShow( PresentationSettingsEx* pPresSettings ) aProperties.push_back( beans::PropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM("UserPaintColor") ), + // User paint color is black by default. -1, Any( static_cast(0x00000000L) ), beans::PropertyState_DIRECT_VALUE ) ); } @@ -1418,12 +1425,14 @@ void SlideshowImpl::displayCurrentSlide() void SlideshowImpl::endPresentation() { +#ifdef ENABLE_PRESENTER_EXTRA_UI if( maPresSettings.mbMouseAsPen) { Reference< XMultiServiceFactory > xDocFactory(mpDoc->getUnoModel(), UNO_QUERY ); if( xDocFactory.is() ) mxShow->registerUserPaintPolygons(xDocFactory); } +#endif if( !mnEndShowEvent ) mnEndShowEvent = Application::PostUserEvent( LINK(this, SlideshowImpl, endPresentationHdl) ); } @@ -2128,7 +2137,12 @@ IMPL_LINK( SlideshowImpl, ContextMenuHdl, void*, EMPTYARG ) #ifdef ENABLE_PRESENTER_EXTRA_UI //adding button to contextual menu for erasing functionnalities for UserPaintOverlay pMenu->EnableItem( CM_ERASE_ALLINK, (maPresSettings.mbMouseAsPen)); - pMenu->EnableItem( CM_COLOR_PEN, (maPresSettings.mbMouseAsPen)); + // Adding button to contextual menu for changing pen color + pMenu->EnableItem( CM_COLOR_PEN, (maPresSettings.mbMouseAsPen)); + // Adding button to display if in Pen mode + pMenu->EnableItem( CM_PEN_MODE, (maPresSettings.mbMouseAsPen)); + // Adding button to displau if in Erase Mode + pMenu->EnableItem( CM_ERASE_MODE, (maPresSettings.mbMouseAsPen)); #endif const ShowWindowMode eMode = mpShowWindow->GetShowWindowMode(); @@ -2197,6 +2211,7 @@ IMPL_LINK( SlideshowImpl, ContextMenuHdl, void*, EMPTYARG ) pBlankMenu->CheckItem( ( mpShowWindow->GetBlankColor() == Color( COL_WHITE ) ) ? CM_SCREEN_WHITE : CM_SCREEN_BLACK ); } } +#ifdef ENABLE_PRESENTER_EXTRA_UI PopupMenu* pWidthMenu = pMenu->GetPopupMenu( CM_WIDTH_PEN); @@ -2244,7 +2259,7 @@ IMPL_LINK( SlideshowImpl, ContextMenuHdl, void*, EMPTYARG ) } } -#ifdef ENABLE_PRESENTER_EXTRA_UI + PopupMenu* pEraseWidthMenu = pMenu->GetPopupMenu( CM_ERASE_INK_PEN); // populate eraser width list @@ -2286,6 +2301,10 @@ IMPL_LINK( SlideshowImpl, ContextMenuHdl, void*, EMPTYARG ) pEraseWidthMenu->EnableItem( (USHORT)(CM_ERASE_INK_PEN + nEIterator), TRUE); if( nEWidth == mnEraseInkSize) pEraseWidthMenu->CheckItem( (USHORT)(CM_ERASE_INK_PEN + nEIterator) ); + if( mbSwitchPenMode ) + pMenu->CheckItem( (USHORT)(CM_PEN_MODE)); + if( mbSwitchEraserMode ) + pMenu->CheckItem( (USHORT)(CM_ERASE_MODE)); } } @@ -2354,7 +2373,7 @@ IMPL_LINK( SlideshowImpl, ContextMenuSelectHdl, Menu *, pMenu ) } } break; - +#ifdef ENABLE_PRESENTER_EXTRA_UI if( maPresSettings.mbMouseAsPen ) { case CM_COLOR_PEN: @@ -2408,48 +2427,59 @@ IMPL_LINK( SlideshowImpl, ContextMenuSelectHdl, Menu *, pMenu ) mbWasPaused = false; } break; -#ifdef ENABLE_PRESENTER_EXTRA_UI case CM_ERASE_ALLINK: { setEraseAllInk(true); mbWasPaused = false; } break; + case CM_PEN_MODE: + { + setPenMode(true); + mbWasPaused = false; + } + break; + case CM_ERASE_MODE: + { + setEraserMode(true); + mbWasPaused = false; + } + break; case CM_ERASE_INK_PEN_VERY_THIN: { - setEraseInk(100.0); + setEraseInk(100); mbWasPaused = false; } break; case CM_ERASE_INK_PEN_THIN: { - setEraseInk(200.0); + setEraseInk(200); mbWasPaused = false; } break; case CM_ERASE_INK_PEN_NORMAL: { - setEraseInk(300.0); + setEraseInk(300); mbWasPaused = false; } break; case CM_ERASE_INK_PEN_THICK: { - setEraseInk(400.0); + setEraseInk(400); mbWasPaused = false; } break; case CM_ERASE_INK_PEN_VERY_THICK: { - setEraseInk(500.0); + setEraseInk(500); mbWasPaused = false; } break; -#endif } +#endif case CM_ENDSHOW: // in case the user cancels the presentation, switch to current slide @@ -3058,16 +3088,16 @@ void SAL_CALL SlideshowImpl::setUsePen( sal_Bool bMouseAsPen ) throw (RuntimeExc maPresSettings.mbMouseAsPen = bMouseAsPen; if( mxShow.is() ) try { + // For Pencolor; Any aValue; if( maPresSettings.mbMouseAsPen ) - // todo: take color from configuration - aValue <<= mnUserPaintColor; - + // TODO: take color from configuration + aValue <<= mnUserPaintColor; beans::PropertyValue aPenProp; aPenProp.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "UserPaintColor" )); aPenProp.Value = aValue; - mxShow->setProperty( aPenProp ); +#ifdef ENABLE_PRESENTER_EXTRA_UI //for StrokeWidth : Any aValueWidth; if( maPresSettings.mbMouseAsPen ) @@ -3079,22 +3109,25 @@ void SAL_CALL SlideshowImpl::setUsePen( sal_Bool bMouseAsPen ) throw (RuntimeExc mxShow->setProperty( aPenPropWidth ); - //for EraseAllInk : - Any aValueEraseAllInk; + // for Pen Mode + Any aValueSwitchPenMode; if( maPresSettings.mbMouseAsPen ) - aValueEraseAllInk <<= mbEraseAllInk; - beans::PropertyValue aPenPropEraseAllInk; - aPenPropEraseAllInk.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EraseAllInk" )); - aPenPropEraseAllInk.Value = aValueEraseAllInk; - mxShow->setProperty( aPenPropEraseAllInk ); - //for EraseInk : - Any aValueEraseInk; - if( maPresSettings.mbMouseAsPen ) - aValueEraseInk <<= mnEraseInkSize; - beans::PropertyValue aPenPropEraseInk; - aPenPropEraseInk.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EraseInk" )); - aPenPropEraseInk.Value = aValueEraseInk; - mxShow->setProperty( aPenPropEraseInk ); + aValueSwitchPenMode <<= mbSwitchPenMode; + beans::PropertyValue aPenPropSwitchPenMode; + aPenPropSwitchPenMode.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "SwitchPenMode" )); + aPenPropSwitchPenMode.Value = aValueSwitchPenMode; + mxShow->setProperty( aPenPropSwitchPenMode ); + + //for EraseAllInk : + Any aValueEraseAllInk; + if( maPresSettings.mbMouseAsPen ) + aValueEraseAllInk <<= mbEraseAllInk; + beans::PropertyValue aPenPropEraseAllInk; + aPenPropEraseAllInk.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EraseAllInk" )); + aPenPropEraseAllInk.Value = aValueEraseAllInk; + mxShow->setProperty( aPenPropEraseAllInk ); + mbEraseAllInk = false; // sets to false so not to have it applied again +#endif } catch( Exception& e ) { @@ -3108,23 +3141,64 @@ void SAL_CALL SlideshowImpl::setUsePen( sal_Bool bMouseAsPen ) throw (RuntimeExc } } +#ifdef ENABLE_PRESENTER_EXTRA_UI +void SAL_CALL SlideshowImpl::setUseEraser( sal_Bool bMouseAsPen ) throw (RuntimeException) +{ + ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + maPresSettings.mbMouseAsPen = bMouseAsPen; + if( mxShow.is() ) try + { + + //for EraseInk : + Any aValueEraseInk; + if( maPresSettings.mbMouseAsPen ) + aValueEraseInk <<= mnEraseInkSize; + beans::PropertyValue aPenPropEraseInk; + aPenPropEraseInk.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "EraseInk" )); + aPenPropEraseInk.Value = aValueEraseInk; + mxShow->setProperty( aPenPropEraseInk ); + + // for Erase Mode + Any aValueSwitchEraserMode; + if( maPresSettings.mbMouseAsPen ) + aValueSwitchEraserMode <<= mbSwitchEraserMode; + beans::PropertyValue aPenPropSwitchEraserMode; + aPenPropSwitchEraserMode.Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "SwitchEraserMode" )); + aPenPropSwitchEraserMode.Value = aValueSwitchEraserMode; + mxShow->setProperty( aPenPropSwitchEraserMode ); + } + catch( Exception& e ) + { + static_cast(e); + DBG_ERROR( + (OString("sd::SlideshowImpl::setUseEraser(), " + "exception caught: ") + + rtl::OUStringToOString( + comphelper::anyToString( cppu::getCaughtException() ), + RTL_TEXTENCODING_UTF8 )).getStr() ); + } +} + // -------------------------------------------------------------------- + double SAL_CALL SlideshowImpl::getPenWidth() throw (RuntimeException) { ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); return mdUserPaintStrokeWidth; } - // -------------------------------------------------------------------- void SAL_CALL SlideshowImpl::setPenWidth( double dStrokeWidth ) throw (RuntimeException) { ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); mdUserPaintStrokeWidth = dStrokeWidth; + mbSwitchPenMode = true; + mbSwitchEraserMode = !mbSwitchPenMode; if( maPresSettings.mbMouseAsPen ) setUsePen( sal_True ); // update color and width } +#endif // -------------------------------------------------------------------- sal_Int32 SAL_CALL SlideshowImpl::getPenColor() throw (RuntimeException) @@ -3139,10 +3213,48 @@ void SAL_CALL SlideshowImpl::setPenColor( sal_Int32 nColor ) throw (RuntimeExcep { ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); mnUserPaintColor = nColor; +#ifdef ENABLE_PRESENTER_EXTRA_UI + mbSwitchPenMode = true; + mbSwitchEraserMode = !mbSwitchPenMode; +#endif if( maPresSettings.mbMouseAsPen ) setUsePen( sal_True ); // update color } +#ifdef ENABLE_PRESENTER_EXTRA_UI +// -------------------------------------------------------------------- + +void SAL_CALL SlideshowImpl::setPenMode( bool bSwitchPenMode ) throw (RuntimeException) +{ + ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + mbSwitchPenMode = bSwitchPenMode; + + if(mbSwitchPenMode == true){ + mbSwitchEraserMode = false; + }else{ + mbSwitchEraserMode = true; + } + if( maPresSettings.mbMouseAsPen ) + setUsePen( sal_True ); // Switch to Pen Mode + +} + +void SAL_CALL SlideshowImpl::setEraserMode(bool bSwitchEraserMode ) throw (RuntimeException) +{ + ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + mbSwitchEraserMode = bSwitchEraserMode; + if(mbSwitchEraserMode = true){ + mbSwitchPenMode = false; + }else{ + mbSwitchPenMode = true; + } + + if( maPresSettings.mbMouseAsPen ) + setUseEraser( sal_True ); // Switch to EraseMode + +} + + // -------------------------------------------------------------------- void SAL_CALL SlideshowImpl::setEraseAllInk( bool bEraseAllInk ) throw (RuntimeException) @@ -3154,13 +3266,16 @@ void SAL_CALL SlideshowImpl::setEraseAllInk( bool bEraseAllInk ) throw (RuntimeE } -void SAL_CALL SlideshowImpl::setEraseInk( double nEraseInkSize ) throw (RuntimeException) +void SAL_CALL SlideshowImpl::setEraseInk( sal_Int32 nEraseInkSize ) throw (RuntimeException) { ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); mnEraseInkSize=nEraseInkSize; + mbSwitchPenMode = false; + mbSwitchEraserMode = true; if( maPresSettings.mbMouseAsPen ) setUsePen( sal_True ); // update erase ink size } +#endif // -------------------------------------------------------------------- // XSlideShowController Methods // -------------------------------------------------------------------- diff --git a/sd/source/ui/slideshow/slideshowimpl.hxx b/sd/source/ui/slideshow/slideshowimpl.hxx index b492288b3f0c..ec90b433f9ee 100644 --- a/sd/source/ui/slideshow/slideshowimpl.hxx +++ b/sd/source/ui/slideshow/slideshowimpl.hxx @@ -200,12 +200,17 @@ public: virtual void SAL_CALL setMouseVisible( ::sal_Bool _mousevisible ) throw (css::uno::RuntimeException); virtual ::sal_Bool SAL_CALL getUsePen() throw (css::uno::RuntimeException); virtual void SAL_CALL setUsePen( ::sal_Bool _usepen ) throw (css::uno::RuntimeException); - virtual double SAL_CALL getPenWidth() throw (css::uno::RuntimeException); - virtual void SAL_CALL setPenWidth( double dStrokeWidth ) throw (css::uno::RuntimeException); virtual ::sal_Int32 SAL_CALL getPenColor() throw (css::uno::RuntimeException); virtual void SAL_CALL setPenColor( ::sal_Int32 _pencolor ) throw (css::uno::RuntimeException); +#ifdef ENABLE_PRESENTER_EXTRA_UI + virtual void SAL_CALL setUseEraser( ::sal_Bool _usepen ) throw (css::uno::RuntimeException); + virtual double SAL_CALL getPenWidth() throw (css::uno::RuntimeException); + virtual void SAL_CALL setPenWidth( double dStrokeWidth ) throw (css::uno::RuntimeException); virtual void SAL_CALL setEraseAllInk( bool bEraseAllInk ) throw (css::uno::RuntimeException); - virtual void SAL_CALL setEraseInk( double nEraseInkSize ) throw (css::uno::RuntimeException); + virtual void SAL_CALL setEraseInk( sal_Int32 nEraseInkSize ) throw (css::uno::RuntimeException); + virtual void SAL_CALL setPenMode( bool bSwitchPenMode) throw (css::uno::RuntimeException); + virtual void SAL_CALL setEraserMode( bool bSwitchEraserMode ) throw (css::uno::RuntimeException); +#endif virtual ::sal_Bool SAL_CALL isRunning( ) throw (css::uno::RuntimeException); virtual ::sal_Int32 SAL_CALL getSlideCount( ) throw (css::uno::RuntimeException); virtual css::uno::Reference< css::drawing::XDrawPage > SAL_CALL getSlideByIndex( ::sal_Int32 Index ) throw (css::lang::IndexOutOfBoundsException, css::uno::RuntimeException); @@ -384,10 +389,15 @@ private: PresentationSettings maPresSettings; sal_Int32 mnUserPaintColor; + +#ifdef ENABLE_PRESENTER_EXTRA_UI + bool mbSwitchPenMode; + bool mbSwitchEraserMode; double mdUserPaintStrokeWidth; bool mbEraseAllInk; - bool mbEraseInk; - double mnEraseInkSize; +// bool mbEraseInk; + sal_Int32 mnEraseInkSize; +#endif /// used in updateHdl to prevent recursive calls sal_Int32 mnEntryCounter; diff --git a/slideshow/source/engine/color.cxx b/slideshow/source/engine/color.cxx index a7a7088a302f..a6ffbb492066 100644 --- a/slideshow/source/engine/color.cxx +++ b/slideshow/source/engine/color.cxx @@ -268,6 +268,19 @@ namespace slideshow return RGBColor( aColor.mnRed, aColor.mnGreen, aColor.mnBlue ); } + RGBColor::RGBColor(const RGBColor& rLHS) + { + RGBColor(rLHS.getRed(), rLHS.getGreen(), rLHS.getBlue()); + } + + RGBColor& RGBColor::operator=( const RGBColor& rLHS ){ + + maRGBTriple.mnRed = rLHS.getRed(); + maRGBTriple.mnGreen = rLHS.getGreen(); + maRGBTriple.mnBlue = rLHS.getBlue(); + return *this; + } + HSLColor operator+( const HSLColor& rLHS, const HSLColor& rRHS ) { return HSLColor( rLHS.getHue() + rRHS.getHue(), diff --git a/slideshow/source/engine/eventmultiplexer.cxx b/slideshow/source/engine/eventmultiplexer.cxx index 31cd7cf286c4..6ad89b278286 100644 --- a/slideshow/source/engine/eventmultiplexer.cxx +++ b/slideshow/source/engine/eventmultiplexer.cxx @@ -1067,17 +1067,27 @@ bool EventMultiplexer::notifyUserPaintColor( RGBColor const& rUserColor ) bool EventMultiplexer::notifyUserPaintStrokeWidth( double rUserStrokeWidth ) { return mpImpl->maUserPaintEventHandlers.applyAll( - boost::bind(&UserPaintEventHandler::widthChanged, - _1, - rUserStrokeWidth)); + boost::bind(&UserPaintEventHandler::widthChanged, + _1, + rUserStrokeWidth)); } - +//NELLE a regarder de plus près bool EventMultiplexer::notifyUserPaintDisabled() { return mpImpl->maUserPaintEventHandlers.applyAll( boost::mem_fn(&UserPaintEventHandler::disable)); } +bool EventMultiplexer::notifySwitchPenMode(){ + return mpImpl->maUserPaintEventHandlers.applyAll( + boost::mem_fn(&UserPaintEventHandler::switchPenMode)); +} + +bool EventMultiplexer::notifySwitchEraserMode(){ + return mpImpl->maUserPaintEventHandlers.applyAll( + boost::mem_fn(&UserPaintEventHandler::switchEraserMode)); +} + //adding erasing all ink features with UserPaintOverlay bool EventMultiplexer::notifyEraseAllInk( bool const& rEraseAllInk ) { @@ -1088,10 +1098,10 @@ bool EventMultiplexer::notifyEraseAllInk( bool const& rEraseAllInk ) } //adding erasing features with UserPaintOverlay -bool EventMultiplexer::notifyEraseInk( double rEraseInkSize ) +bool EventMultiplexer::notifyEraseInk( sal_Int32 rEraseInkSize ) { return mpImpl->maUserPaintEventHandlers.applyAll( - boost::bind(&UserPaintEventHandler::eraseInkChanged, + boost::bind(&UserPaintEventHandler::eraseInkWidthChanged, _1, boost::cref(rEraseInkSize))); } diff --git a/slideshow/source/engine/makefile.mk b/slideshow/source/engine/makefile.mk index ba00e028b9ff..6d4b182f2323 100644 --- a/slideshow/source/engine/makefile.mk +++ b/slideshow/source/engine/makefile.mk @@ -41,6 +41,10 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk .INCLUDE : $(PRJ)$/util$/makefile.pmk +.IF "$(ENABLE_PRESENTER_EXTRA_UI)"=="YES" +CDEFS+=-DENABLE_PRESENTER_EXTRA_UI +.ENDIF + # --- Common ---------------------------------------------------------- .IF "$(OS)"=="SOLARIS" diff --git a/slideshow/source/engine/shapes/shapeimporter.cxx b/slideshow/source/engine/shapes/shapeimporter.cxx index 54436c7330ed..98bda086286a 100644 --- a/slideshow/source/engine/shapes/shapeimporter.cxx +++ b/slideshow/source/engine/shapes/shapeimporter.cxx @@ -650,7 +650,11 @@ ShapeImporter::ShapeImporter( uno::Reference const& sal_Int32 nOrdNumStart, bool bConvertingMasterPage ) : mxPage( xActualPage ), +#ifdef ENABLE_PRESENTER_EXTRA_UI mxPagesSupplier( xPagesSupplier ), +#else + mxPagesSupplier( NULL ), +#endif mrContext( rContext ), maPolygons(), maShapesStack(), diff --git a/slideshow/source/engine/slide/slideimpl.cxx b/slideshow/source/engine/slide/slideimpl.cxx index e895f98fa94a..c0302fd92909 100644 --- a/slideshow/source/engine/slide/slideimpl.cxx +++ b/slideshow/source/engine/slide/slideimpl.cxx @@ -81,6 +81,7 @@ #include #include #include +#include using namespace ::com::sun::star; @@ -367,7 +368,11 @@ SlideImpl::SlideImpl( const uno::Reference< drawing::XDrawPage >& xDra bool bIntrinsicAnimationsAllowed, bool bDisableAnimationZOrder ) : mxDrawPage( xDrawPage ), - mxDrawPagesSupplier( xDrawPages ), +#ifdef ENABLE_PRESENTER_EXTRA_UI + mxDrawPagesSupplier( xDrawPages ), +#else + mxDrawPagesSupplier( NULL ), +#endif mxRootNode( xRootNode ), mpLayerManager( new LayerManager( rViewContainer, @@ -456,7 +461,9 @@ void SlideImpl::dispose() mpShapeManager.reset(); mxRootNode.clear(); mxDrawPage.clear(); +#ifndef ENABLE_PRESENTER_EXTRA_UI mxDrawPagesSupplier.clear(); +#endif } bool SlideImpl::prefetch() @@ -906,7 +913,7 @@ void SlideImpl::drawPolygons() const void SlideImpl::addPolygons(PolyPolygonVector aPolygons) { - if(!aPolygons.empty()) + if(!aPolygons.empty()) /* FIXME : was if(aPolygons.size() != 0) */ { for( PolyPolygonVector::iterator aIter=aPolygons.begin(), aEnd=aPolygons.end(); @@ -1259,7 +1266,11 @@ SlideSharedPtr createSlide( const uno::Reference< drawing::XDrawPage >& bool bIntrinsicAnimationsAllowed, bool bDisableAnimationZOrder ) { +#ifdef ENABLE_PRESENTER_EXTRA_UI boost::shared_ptr pRet( new SlideImpl( xDrawPage, xDrawPages, xRootNode, rEventQueue, +#else + boost::shared_ptr pRet( new SlideImpl( xDrawPage, NULL, xRootNode, rEventQueue, +#endif rEventMultiplexer, rScreenUpdater, rActivitiesQueue, rUserEventQueue, rCursorManager, rViewContainer, diff --git a/slideshow/source/engine/slide/userpaintoverlay.cxx b/slideshow/source/engine/slide/userpaintoverlay.cxx index d9854f67b6fe..cfcb6a1918dc 100644 --- a/slideshow/source/engine/slide/userpaintoverlay.cxx +++ b/slideshow/source/engine/slide/userpaintoverlay.cxx @@ -65,7 +65,7 @@ namespace slideshow { class PaintOverlayHandler : public MouseEventHandler, public ViewEventHandler, - public UserPaintEventHandler + public UserPaintEventHandler { public: PaintOverlayHandler( const RGBColor& rStrokeColor, @@ -73,7 +73,7 @@ namespace slideshow ActivitiesQueue& rActivitiesQueue, ScreenUpdater& rScreenUpdater, const UnoViewContainer& rViews, - Slide& rSlide, + Slide& rSlide, const PolyPolygonVector& rPolygons ) : mrActivitiesQueue( rActivitiesQueue ), mrScreenUpdater( rScreenUpdater ), @@ -90,7 +90,7 @@ namespace slideshow //handle the "remove stroke by stroke" mode of erasing mbIsEraseModeActivated( false ), mrSlide(rSlide), - mnSize(100.0) + mnSize(100) { std::for_each( rViews.begin(), rViews.end(), @@ -132,23 +132,27 @@ namespace slideshow bool colorChanged( RGBColor const& rUserColor ) { - maStrokeColor = rUserColor; + this->maStrokeColor = rUserColor; + this->mbIsEraseModeActivated = false; return true; } bool widthChanged( double nUserStrokeWidth ) { - mnStrokeWidth = nUserStrokeWidth; + this->mnStrokeWidth = nUserStrokeWidth; + mbIsEraseModeActivated = false; return true; } bool eraseAllInkChanged( bool const& rEraseAllInk ) { - mbIsEraseAllModeActivated= rEraseAllInk; + this->mbIsEraseAllModeActivated= rEraseAllInk; // if the erase all mode is activated it will remove all ink from slide, // therefor destroy all the polygons stored if(mbIsEraseAllModeActivated) { + // The Erase Mode should be desactivated + mbIsEraseModeActivated = false; // must get access to the instance to erase all polygon for( UnoViewVector::iterator aIter=maViews.begin(), aEnd=maViews.end(); aIter!=aEnd; @@ -180,17 +184,30 @@ namespace slideshow mrScreenUpdater.notifyUpdate(*aIter,true); } + maPolygons.clear(); } - mbIsEraseAllModeActivated=false; + mbIsEraseAllModeActivated=false; + return true; + } + + bool eraseInkWidthChanged( sal_Int32 rEraseInkSize ) + { + // Change the size + this->mnSize=rEraseInkSize; + // Changed to mode Erase + this->mbIsEraseModeActivated = true; return true; } - bool eraseInkChanged( double rEraseInkSize ) + bool switchPenMode() { - if(mbIsEraseModeActivated) - mbIsEraseModeActivated=false; - else - mbIsEraseModeActivated=true; + this->mbIsEraseModeActivated = false; + return true; + } + + bool switchEraserMode() + { + this->mbIsEraseModeActivated = true; return true; } @@ -292,7 +309,7 @@ namespace slideshow virtual bool handleMouseDragged( const awt::MouseEvent& e ) { - if(mbIsEraseModeActivated) + if(mbIsEraseModeActivated) { //define the last point as an object //we suppose that there's no way this point could be valid @@ -324,7 +341,7 @@ namespace slideshow //The point is to redraw the LastPoint the way it was originally on the bitmap, //of the slide - for( UnoViewVector::iterator aIter=maViews.begin(), aEnd=maViews.end(); + for( UnoViewVector::iterator aIter=maViews.begin(), aEnd=maViews.end(); aIter!=aEnd; ++aIter ) { @@ -355,7 +372,7 @@ namespace slideshow mrScreenUpdater.notifyUpdate(*aIter,true); } - } + } else { if( !mbIsLastPointValid ) @@ -385,8 +402,10 @@ namespace slideshow if( pPolyPoly ) { + pPolyPoly->setStrokeWidth(mnStrokeWidth); pPolyPoly->setRGBALineColor( maStrokeColor.getIntegerColor() ); pPolyPoly->draw(); + maPolygons.push_back(pPolyPoly); } } @@ -421,7 +440,7 @@ namespace slideshow bool mbIsEraseAllModeActivated; bool mbIsEraseModeActivated; Slide& mrSlide; - double mnSize; + sal_Int32 mnSize; }; UserPaintOverlaySharedPtr UserPaintOverlay::create( const RGBColor& rStrokeColor, diff --git a/slideshow/source/engine/slideshowimpl.cxx b/slideshow/source/engine/slideshowimpl.cxx index ad63f4d80d17..6e12389cddbe 100644 --- a/slideshow/source/engine/slideshowimpl.cxx +++ b/slideshow/source/engine/slideshowimpl.cxx @@ -116,6 +116,7 @@ #include #include #include +#include using namespace com::sun::star; using namespace ::slideshow::internal; @@ -367,9 +368,10 @@ private: boost::optional maUserPaintStrokeWidth; //changed for the eraser project - boost::optional maEraseAllInk; - - boost::optional maEraseInk; + boost::optional maEraseAllInk; + boost::optional maSwitchPenMode; + boost::optional maSwitchEraserMode; + boost::optional maEraseInk; //end changed boost::shared_ptr mpPresTimer; @@ -956,7 +958,11 @@ void SlideShowImpl::displaySlide( // precondition: must only be called from the main thread! DBG_TESTSOLARMUTEX(); +#ifdef ENABLE_PRESENTER_EXTRA_UI mxDrawPagesSupplier = xDrawPages; +#else + mxDrawPagesSupplier = NULL; +#endif stopShow(); // MUST call that: results in // maUserEventQueue.clear(). What's more, @@ -990,9 +996,7 @@ void SlideShowImpl::displaySlide( mpCurrentSlide = mpPrefetchSlide; } else - { mpCurrentSlide = makeSlide( xSlide, xDrawPages, xRootNode ); - } OSL_ASSERT( mpCurrentSlide ); if (mpCurrentSlide) @@ -1399,21 +1403,65 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty ) } else { - // disable user paint - maEraseAllInk.reset(); - maEventMultiplexer.notifyUserPaintDisabled(); + // disable user paint + maEraseAllInk.reset(); + maEventMultiplexer.notifyUserPaintDisabled(); + } + + if( mnCurrentCursor == awt::SystemPointer::ARROW ) + resetCursor(); + + return true; + } + + if (rProperty.Name.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("SwitchPenMode") )) + { + bool nSwitchPenMode(false); + if (rProperty.Value >>= nSwitchPenMode) + { + OSL_ENSURE( mbMouseVisible, + "setProperty(): User paint overrides invisible mouse" ); + + if(nSwitchPenMode == true){ + // Switch to Pen Mode + maSwitchPenMode.reset( nSwitchPenMode ); + maEventMultiplexer.notifySwitchPenMode(); + } } if( mnCurrentCursor == awt::SystemPointer::ARROW ) resetCursor(); + return true; + } + + + if (rProperty.Name.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("SwitchEraserMode") )) + { + bool nSwitchEraserMode(false); + if (rProperty.Value >>= nSwitchEraserMode) + { + OSL_ENSURE( mbMouseVisible, + "setProperty(): User paint overrides invisible mouse" ); + if(nSwitchEraserMode == true){ + // switch to Eraser mode + maSwitchEraserMode.reset( nSwitchEraserMode ); + maEventMultiplexer.notifySwitchEraserMode(); + } + } + if( mnCurrentCursor == awt::SystemPointer::ARROW ) + resetCursor(); return true; } + + if (rProperty.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("EraseInk") )) { - double nEraseInk(0.0); + sal_Int32 nEraseInk(100); if (rProperty.Value >>= nEraseInk) { OSL_ENSURE( mbMouseVisible, @@ -1421,7 +1469,7 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty ) // enable user paint maEraseInk.reset( nEraseInk ); - maEventMultiplexer.notifyEraseInk( *maEraseInk ); + maEventMultiplexer.notifyEraseInkWidth( *maEraseInk ); } else { diff --git a/slideshow/source/engine/tools.cxx b/slideshow/source/engine/tools.cxx index be3a39849040..249375f99032 100644 --- a/slideshow/source/engine/tools.cxx +++ b/slideshow/source/engine/tools.cxx @@ -637,8 +637,8 @@ namespace slideshow aTransform ); } - ::basegfx::B2DRange getShapeUpdateArea( const ::basegfx::B2DRange& rUnitBounds, - const ::basegfx::B2DRange& rShapeBounds ) + ::basegfx::B2DRange getShapeUpdateArea( const ::basegfx::B2DRange& rUnitBounds, + const ::basegfx::B2DRange& rShapeBounds ) { return ::basegfx::B2DRectangle( lerp( rShapeBounds.getMinX(), @@ -710,15 +710,25 @@ namespace slideshow static_cast< sal_uInt8 >( nColor >> 24U ) ) ); } - sal_Int32 RGBAColor2UnoColor( ::cppcanvas::Color::IntSRGBA aColor ) + /*sal_Int32 RGBAColor2UnoColor( ::cppcanvas::Color::IntSRGBA aColor ) { - return ::cppcanvas::makeColorARGB( - // convert from IntSRGBA color to API color - // (0xRRGGBBAA -> 0xAARRGGBB) - static_cast< sal_uInt8 >(0), - ::cppcanvas::getRed(aColor), - ::cppcanvas::getGreen(aColor), - ::cppcanvas::getBlue(aColor)); + return ::cppcanvas::unMakeColor( + // convert from IntSRGBA color to API color + // (0xRRGGBBAA -> 0xAARRGGBB) + static_cast< sal_uInt8 >(0), + ::cppcanvas::getRed(aColor), + ::cppcanvas::getGreen(aColor), + ::cppcanvas::getBlue(aColor)); + }*/ + + sal_Int8 unSignedToSigned(sal_Int8 nInt) + { + if(nInt < 0 ){ + sal_Int8 nInt2 = nInt >> 1U; + return nInt2; + }else{ + return nInt; + } } void fillRect( const ::cppcanvas::CanvasSharedPtr& rCanvas, diff --git a/slideshow/source/inc/eventmultiplexer.hxx b/slideshow/source/inc/eventmultiplexer.hxx index 01722ee0b527..a1c932252d7b 100644 --- a/slideshow/source/inc/eventmultiplexer.hxx +++ b/slideshow/source/inc/eventmultiplexer.hxx @@ -509,7 +509,9 @@ public: this event (and probably, nothing will happen at all) */ bool notifyEraseAllInk( bool const& rEraseAllInk ); - bool notifyEraseInk( double rEraseInkSize ); + bool notifySwitchPenMode(); + bool notifySwitchEraserMode(); + bool notifyEraseInkWidth( sal_Int32 rEraseInkSize ); /** Notify that user paint is disabled diff --git a/slideshow/source/inc/rgbcolor.hxx b/slideshow/source/inc/rgbcolor.hxx index 1ea168ee80c3..73f14558b494 100644 --- a/slideshow/source/inc/rgbcolor.hxx +++ b/slideshow/source/inc/rgbcolor.hxx @@ -90,6 +90,9 @@ namespace slideshow */ ::cppcanvas::Color::IntSRGBA getIntegerColor() const; + RGBColor(const RGBColor& rLHS); + RGBColor& operator=( const RGBColor& rLHS); + struct RGBTriple { RGBTriple(); diff --git a/slideshow/source/inc/shapeimporter.hxx b/slideshow/source/inc/shapeimporter.hxx index e86db9c7a864..6b3ff7eb2057 100644 --- a/slideshow/source/inc/shapeimporter.hxx +++ b/slideshow/source/inc/shapeimporter.hxx @@ -82,7 +82,7 @@ public: ::com::sun::star::drawing::XDrawPage >& xPage, const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& xActualPage, - const ::com::sun::star::uno::Reference< + const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPagesSupplier>& xPagesSupplier, const SlideShowContext& rContext, sal_Int32 nOrdNumStart, diff --git a/slideshow/source/inc/userpainteventhandler.hxx b/slideshow/source/inc/userpainteventhandler.hxx index 1a9ab5fbb64a..8675ed4d5ae7 100644 --- a/slideshow/source/inc/userpainteventhandler.hxx +++ b/slideshow/source/inc/userpainteventhandler.hxx @@ -51,11 +51,12 @@ namespace slideshow { public: virtual ~UserPaintEventHandler() {} - virtual bool colorChanged( RGBColor const& rUserColor ) = 0; virtual bool widthChanged( double nUserStrokeWidth ) = 0; virtual bool eraseAllInkChanged(bool const& rEraseAllInk) =0; - virtual bool eraseInkChanged(double rEraseInkSize) =0; + virtual bool eraseInkWidthChanged(sal_Int32 rEraseInkSize) =0; + virtual bool switchEraserMode() = 0; + virtual bool switchPenMode() = 0; virtual bool disable() = 0; }; -- cgit v1.2.3 From da9da1e422133df70aceb36c70540524fde0e840 Mon Sep 17 00:00:00 2001 From: ericb Date: Wed, 16 Dec 2009 07:25:56 +0100 Subject: eraser01: #i97972# fix variable renaming --- slideshow/source/engine/eventmultiplexer.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slideshow/source/engine/eventmultiplexer.cxx b/slideshow/source/engine/eventmultiplexer.cxx index 6ad89b278286..ab36bf3d9e60 100644 --- a/slideshow/source/engine/eventmultiplexer.cxx +++ b/slideshow/source/engine/eventmultiplexer.cxx @@ -1098,7 +1098,7 @@ bool EventMultiplexer::notifyEraseAllInk( bool const& rEraseAllInk ) } //adding erasing features with UserPaintOverlay -bool EventMultiplexer::notifyEraseInk( sal_Int32 rEraseInkSize ) +bool EventMultiplexer::notifyEraseInkWidth( sal_Int32 rEraseInkSize ) { return mpImpl->maUserPaintEventHandlers.applyAll( boost::bind(&UserPaintEventHandler::eraseInkWidthChanged, -- cgit v1.2.3 From 90ca57da108d6e933c19e690ce82ef8da722523e Mon Sep 17 00:00:00 2001 From: ericb Date: Wed, 16 Dec 2009 08:20:42 +0100 Subject: eraser01: #i97972# yet some build issues due to rebase --- slideshow/source/engine/tools.cxx | 11 +++++++++++ slideshow/source/inc/userpainteventhandler.hxx | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/slideshow/source/engine/tools.cxx b/slideshow/source/engine/tools.cxx index 249375f99032..2f3a18744144 100644 --- a/slideshow/source/engine/tools.cxx +++ b/slideshow/source/engine/tools.cxx @@ -710,6 +710,17 @@ namespace slideshow static_cast< sal_uInt8 >( nColor >> 24U ) ) ); } + sal_Int32 RGBAColor2UnoColor( ::cppcanvas::Color::IntSRGBA aColor ) + { + return ::cppcanvas::makeColorARGB( + // convert from IntSRGBA color to API color + // (0xRRGGBBAA -> 0xAARRGGBB) + static_cast< sal_uInt8 >(0), + ::cppcanvas::getRed(aColor), + ::cppcanvas::getGreen(aColor), + ::cppcanvas::getBlue(aColor)); + } + /*sal_Int32 RGBAColor2UnoColor( ::cppcanvas::Color::IntSRGBA aColor ) { return ::cppcanvas::unMakeColor( diff --git a/slideshow/source/inc/userpainteventhandler.hxx b/slideshow/source/inc/userpainteventhandler.hxx index 8675ed4d5ae7..01919e0ae7e0 100644 --- a/slideshow/source/inc/userpainteventhandler.hxx +++ b/slideshow/source/inc/userpainteventhandler.hxx @@ -52,8 +52,8 @@ namespace slideshow public: virtual ~UserPaintEventHandler() {} virtual bool colorChanged( RGBColor const& rUserColor ) = 0; - virtual bool widthChanged( double nUserStrokeWidth ) = 0; - virtual bool eraseAllInkChanged(bool const& rEraseAllInk) =0; + virtual bool widthChanged( double nUserStrokeWidth ) = 0; + virtual bool eraseAllInkChanged(bool const& rEraseAllInk) =0; virtual bool eraseInkWidthChanged(sal_Int32 rEraseInkSize) =0; virtual bool switchEraserMode() = 0; virtual bool switchPenMode() = 0; -- cgit v1.2.3 -- cgit v1.2.3 From 2740353e241613fd17fcd8ce57583129490a19d2 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 16 Dec 2009 11:31:36 +0100 Subject: vcl108: #i107271# fix invalid iterator access (thanks cmc) --- vcl/unx/source/gdi/salgdi.cxx | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/vcl/unx/source/gdi/salgdi.cxx b/vcl/unx/source/gdi/salgdi.cxx index c09803dcb269..490a92d12a0f 100644 --- a/vcl/unx/source/gdi/salgdi.cxx +++ b/vcl/unx/source/gdi/salgdi.cxx @@ -1427,14 +1427,17 @@ bool X11SalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rOrigPoly // unless it splits another trapezoid that is still active bool bSplit = false; ActiveTrapSet::iterator aActiveTrapsIt = aActiveTraps.begin(); - for(; aActiveTrapsIt != aActiveTraps.end(); ++aActiveTrapsIt ) + while(aActiveTrapsIt != aActiveTraps.end()) { XTrapezoid& rLeftTrap = aTrapVector[ *aActiveTrapsIt ]; // skip until first overlap candidate // TODO: use stl::*er_bound() instead if( IsLeftOf( aTrapezoid.left, rLeftTrap.left) ) + { + ++aActiveTrapsIt; continue; + } // in the ActiveTrapSet there are still trapezoids where // a vertical overlap with new trapezoids is no longer possible @@ -1445,15 +1448,26 @@ bool X11SalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rOrigPoly { ActiveTrapSet::iterator it = aActiveTrapsIt; if( aActiveTrapsIt != aActiveTraps.begin() ) + { --aActiveTrapsIt; - aActiveTraps.erase( it ); + aActiveTraps.erase( it ); + ++aActiveTrapsIt; + } + else + { + aActiveTraps.erase( it ); + aActiveTrapsIt = aActiveTraps.begin(); + } continue; } // check if there is horizontal overlap // aTrapezoid.left==rLeftTrap.right is allowed though if( !IsLeftOf( aTrapezoid.left, rLeftTrap.right ) ) + { + ++aActiveTrapsIt; continue; + } // prepare to split the old trapezoid and keep its upper part // find the old trapezoids entry in the VerticalTrapSet and remove it -- cgit v1.2.3 -- cgit v1.2.3 From 65f7c87195a6fd843a5fe19cfc99a57193e907d7 Mon Sep 17 00:00:00 2001 From: sj Date: Wed, 16 Dec 2009 13:50:57 +0100 Subject: impress181: #i106986#: fixed fit to text --- svx/source/customshapes/EnhancedCustomShapeEngine.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx index 8ae4e34197c5..077b48f53fd4 100644 --- a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx @@ -56,6 +56,7 @@ #include "unopolyhelper.hxx" #include #include +#include // --------------------------- // - EnhancedCustomShapeEngine - @@ -360,7 +361,8 @@ com::sun::star::awt::Rectangle SAL_CALL EnhancedCustomShapeEngine::getTextBounds { com::sun::star::awt::Rectangle aTextRect; SdrObject* pSdrObjCustomShape( GetSdrObjectFromXShape( mxShape ) ); - if ( pSdrObjCustomShape && pSdrObjCustomShape->GetModel() && !pSdrObjCustomShape->GetModel()->isLocked() ) + ::com::sun::star::uno::Reference< ::com::sun::star::document::XActionLockable > xLockable( mxShape, ::com::sun::star::uno::UNO_QUERY ); + if ( pSdrObjCustomShape && pSdrObjCustomShape->GetModel() && xLockable.is() && !xLockable->isActionLocked() ) { if ( pSdrObjCustomShape ) { -- cgit v1.2.3 From 967d3ca09c737d657e3efec4121c87ef39af64fa Mon Sep 17 00:00:00 2001 From: thb Date: Wed, 16 Dec 2009 14:47:09 +0100 Subject: eraser01: #i97972# - Fixed two minor bugs * ran autoconf, to get the --enable-extra-presenter-ui option * fixed thinko when selecting eraser width (slideshow was switching to eraser mode then, but context menu stayed at pen) --- sd/source/ui/slideshow/slideshowimpl.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index eb4a430116ff..9fd9bd6694bc 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -3273,7 +3273,7 @@ void SAL_CALL SlideshowImpl::setEraseInk( sal_Int32 nEraseInkSize ) throw (Runti mbSwitchPenMode = false; mbSwitchEraserMode = true; if( maPresSettings.mbMouseAsPen ) - setUsePen( sal_True ); // update erase ink size + setUseEraser( sal_True ); // update erase ink size } #endif // -------------------------------------------------------------------- -- cgit v1.2.3 From 6cbf8975f346dc3449eeea44238121779839dc91 Mon Sep 17 00:00:00 2001 From: thb Date: Wed, 16 Dec 2009 14:47:09 +0100 Subject: eraser01: #i97972# - Fixed two minor bugs * ran autoconf, to get the --enable-extra-presenter-ui option * fixed thinko when selecting eraser width (slideshow was switching to eraser mode then, but context menu stayed at pen) --- configure | 23264 +++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 12854 insertions(+), 10410 deletions(-) diff --git a/configure b/configure index 892eeb138bb4..dff4a46f8396 100755 --- a/configure +++ b/configure @@ -1,62 +1,146 @@ #! /bin/sh # From configure.in Revision: 1.290 . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.57. +# Generated by GNU Autoconf 2.63. # -# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 -# Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## -# Be Bourne compatible +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } fi # Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + # Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var - fi -done +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE # Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false @@ -64,206 +148,450 @@ fi # Name of the executable. -as_me=`$as_basename "$0" || +as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` +# CDPATH. +$as_unset CDPATH -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh +if test "x$CONFIG_SHELL" = x; then + if (eval ":") 2>/dev/null; then + as_have_required=yes +else + as_have_required=no fi + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in + case $as_dir in /*) - if ("$as_dir/$as_base" -c ' + for as_base in sh bash ksh sh5; do + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + done;; + esac +done +IFS=$as_save_IFS + + + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test $exitcode = 0) || { (exit 1); exit 1; } + +( as_lineno_1=$LINENO as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell bug-autoconf@gnu.org about your system, + echo including any error possibly output before this message. + echo This can help us improve future autoconf versions. + echo Configuration will now proceed without shell functions. +} + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; -esac +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi -if expr a : '\(a\)' >/dev/null 2>&1; then +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' fi -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else + test -d ./-p && rmdir ./-p as_mkdir_p=false fi -as_executable_p="test -f" +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. -as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" - +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" -# CDPATH. -$as_unset CDPATH +exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` -exec 6>&1 - # # Initializations. # ac_default_prefix=/usr/local +ac_clean_files= ac_config_libobj_dir=. +LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -# This variable seems obsolete. It should probably be removed, and -# only ac_max_sed_lines should be used. -: ${ac_max_here_lines=38} - # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= @@ -274,46 +602,600 @@ PACKAGE_BUGREPORT= # Factoring default headers for most tests. ac_includes_default="\ #include -#if HAVE_SYS_TYPES_H +#ifdef HAVE_SYS_TYPES_H # include #endif -#if HAVE_SYS_STAT_H +#ifdef HAVE_SYS_STAT_H # include #endif -#if STDC_HEADERS +#ifdef STDC_HEADERS # include # include #else -# if HAVE_STDLIB_H +# ifdef HAVE_STDLIB_H # include # endif #endif -#if HAVE_STRING_H -# if !STDC_HEADERS && HAVE_MEMORY_H +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif -#if HAVE_STRINGS_H +#ifdef HAVE_STRINGS_H # include #endif -#if HAVE_INTTYPES_H +#ifdef HAVE_INTTYPES_H # include -#else -# if HAVE_STDINT_H -# include -# endif #endif -#if HAVE_UNISTD_H +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS EGREP AWK SED LOCAL_SOLENV _solenv UPD SOURCEVERSION build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os GNUTAR OSVERSION PTHREAD_CFLAGS PTHREAD_LIBS ENABLE_CRASHDUMP VC_STANDARD ENABLE_WERROR ENABLE_DEBUG PRODUCT PROFULLSWITCH PROEXT ENABLE_SYMBOLS DISABLE_STRIP ENABLE_CUPS ENABLE_FONTCONFIG WITH_BINFILTER ENABLE_DIRECTX DISABLE_ACTIVEX DISABLE_ATL ENABLE_RPATH WITH_MYSPELL_DICTS SYSTEM_DICTS DICT_SYSTEM_DIR HYPH_SYSTEM_DIR THES_SYSTEM_DIR USE_SHELL WITH_MINGWIN SHELLPATH GCC_HOME CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT COMPATH GCCVER HAVE_LD_BSYMBOLIC_FUNCTIONS ENABLE_PCH GNUMAKE _cc HAVE_LD_HASH_STYLE PERL MSPDB_PATH COMEX USE_MINGW MIDL_PATH CSC_PATH FRAME_HOME CPP CXX CXXFLAGS ac_ct_CXX CXXCPP SIZEOF_LONG WORDS_BIGENDIAN LFS_CFLAGS ENABLE_VBA VBA_EXTENSION PAM NEW_SHADOW_API PAM_LINK CRYPT_LINK GXX_INCLUDE_PATH MINGW_LIB_INCLUDE_PATH STLPORT4 STLPORT_VER USE_SYSTEM_STL HAVE_GCC_VISIBILITY_FEATURE ALLOC BUILD_VER_STRING SOLAR_JAVA JAVAINTERPRETER JAVACOMPILER JAVACISGCJ JAVADOC AWTLIB JAVAAOTCOMPILER JAVA_HOME JDK JAVAFLAGS DMAKE BUILD_DMAKE EPM DPKG PKGMK BUILD_EPM PKGFORMAT RPM GPERF MINGWCXX ac_ct_MINGWCXX MINGWSTRIP ac_ct_MINGWSTRIP BUILD_UNOWINREG BUILD_QADEVOOO SYSTEM_STDLIBS SYSTEM_ZLIB SYSTEM_JPEG SYSTEM_EXPAT PKG_CONFIG LIBWPD_CFLAGS LIBWPD_LIBS SYSTEM_LIBWPD FREETYPE_CFLAGS FREETYPE_LIBS USE_FT_EMBOLDEN LIBXSLT_CFLAGS LIBXSLT_LIBS XSLTPROC SYSTEM_LIBXSLT LIBXML_CFLAGS LIBXML_LIBS SYSTEM_LIBXML PYTHON PYTHON_VERSION PYTHON_PREFIX PYTHON_EXEC_PREFIX PYTHON_PLATFORM pythondir pkgpythondir pyexecdir pkgpyexecdir BZIP2 SYSTEM_PYTHON PYTHON_CFLAGS PYTHON_LIBS HOME SYSTEM_DB DB_VERSION DB_INCLUDES DB_JAR SYSTEM_LUCENE LUCENE_CORE_JAR LUCENE_ANALYZERS_JAR SYSTEM_HSQLDB HSQLDB_JAR SYSTEM_BSH BSH_JAR SERIALIZER_JAR SYSTEM_SAXON SAXON_JAR CURLCONFIG SYSTEM_CURL CURL_CFLAGS CURL_LIBS SYSTEM_BOOST SYSTEM_VIGRA SYSTEM_ODBC_HEADERS WITH_MOZILLA WITH_LDAP WITH_OPENLDAP MOZ_NSS_CFLAGS MOZ_NSS_LIBS NSS_LIB MOZ_NSPR_CFLAGS MOZ_NSPR_LIBS NSPR_LIB MOZILLAXPCOM_CFLAGS MOZILLAXPCOM_LIBS MOZILLA_VERSION MOZILLA_TOOLKIT MOZGTK2_CFLAGS MOZGTK2_LIBS MOZLIBREQ_CFLAGS MOZLIBREQ_LIBS BUILD_MOZAB SYSTEM_MOZILLA MOZ_FLAVOUR MOZ_INC MOZ_LIB MOZ_LIB_XPCOM MOZ_LDAP_CFLAGS SYSTEM_SANE_HEADER SYSTEM_GENBRK SYSTEM_GENCCODE SYSTEM_GENCMN SYSTEM_ICU X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS XINC XLIB XAU_LIBS DISABLE_XAW SYSTEM_XRENDER_HEADERS XRENDER_LINK XRANDR_CFLAGS XRANDR_LIBS XRANDR_DLOPEN ENABLE_RANDR DISABLE_NEON NEON_CFLAGS NEON_LIBS OPENSSL_CFLAGS OPENSSL_LIBS SYSTEM_OPENSSL SYSTEM_NEON NEON_VERSION ENABLE_AGG AGG_CFLAGS AGG_LIBS SYSTEM_AGG AGG_VERSION REDLAND_CFLAGS REDLAND_LIBS SYSTEM_REDLAND HUNSPELL_CFLAGS HUNSPELL_LIBS SYSTEM_HUNSPELL SYSTEM_HYPH HYPHEN_LIB SYSTEM_MYTHES SYSTEM_LPSOLVE PSDK_HOME WINDOWS_VISTA_PSDK DIRECTXSDK_HOME DIRECTXSDK_LIB NSIS_PATH BISON FLEX PATCH GNUCP GNUPATCH CYGWIN_PATH ML_EXE ASM_HOME ZIP UNZIP ZIP_HOME WITH_GPC ENABLE_GTK ENABLE_KDE GCONF_CFLAGS GCONF_LIBS ENABLE_GCONF GNOMEVFS_CFLAGS GNOMEVFS_LIBS ENABLE_GNOMEVFS GTK_CFLAGS GTK_LIBS DBUS_CFLAGS DBUS_LIBS GIO_CFLAGS GIO_LIBS ENABLE_GIO ENABLE_DBUS ENABLE_SYSTRAY_GTK CAIRO_CFLAGS CAIRO_LIBS ENABLE_CAIRO BUILD_PIXMAN SYSTEM_CAIRO ENABLE_OPENGL ENABLE_MINIMIZER ENABLE_PRESENTER_SCREEN POPPLER_CFLAGS POPPLER_LIBS ENABLE_PDFIMPORT SYSTEM_POPPLER ENABLE_MEDIAWIKI SYSTEM_SERVLETAPI SERVLETAPI_JAR ENABLE_REPORTBUILDER SYSTEM_JFREEREPORT SAC_JAR LIBXML_JAR FLUTE_JAR JFREEREPORT_JAR LIBBASE_JAR LIBLAYOUT_JAR LIBLOADER_JAR LIBFORMULA_JAR LIBREPOSITORY_JAR LIBFONTS_JAR LIBSERIALIZER_JAR SYSTEM_APACHE_COMMONS COMMONS_CODEC_JAR COMMONS_LANG_JAR COMMONS_HTTPCLIENT_JAR COMMONS_LOGGING_JAR MOC KDE_CFLAGS KDE_LIBS ENABLE_LOCKDOWN GOBJECT_CFLAGS GOBJECT_LIBS ENABLE_EVOAB2 ENABLE_KAB WITH_FONTOOO SYSTEM_MSPACK WITH_FONTS WITHOUT_PPDS WITHOUT_AFMS SCPDEFS USE_XINERAMA XINERAMA_LINK ANT ANT_HOME ANT_LIB WITH_LANG WITH_POOR_HELP_LOCALIZATIONS WITH_DICT INTRO_BITMAPS ABOUT_BITMAPS OOO_VENDOR UNIXWRAPPERNAME ENABLE_STATIC_GTK ENABLE_LAYOUT VERBOSE LOCAL_SOLVER BUILD_TYPE LIBOBJS LTLIBOBJS' +ac_subst_vars='LTLIBOBJS +LIBOBJS +BUILD_TYPE +LOCAL_SOLVER +VERBOSE +ENABLE_LAYOUT +ENABLE_STATIC_GTK +UNIXWRAPPERNAME +OOO_VENDOR +ABOUT_BITMAPS +INTRO_BITMAPS +WITH_DICT +WITH_POOR_HELP_LOCALIZATIONS +WITH_LANG +ANT_LIB +ANT_HOME +ANT +XINERAMA_LINK +USE_XINERAMA +SCPDEFS +WITHOUT_AFMS +WITHOUT_PPDS +WITH_FONTS +SYSTEM_MSPACK +WITH_FONTOOO +ENABLE_KAB +ENABLE_EVOAB2 +GOBJECT_LIBS +GOBJECT_CFLAGS +ENABLE_LOCKDOWN +KDE_LIBS +KDE_CFLAGS +MOC +COMMONS_LOGGING_JAR +COMMONS_HTTPCLIENT_JAR +COMMONS_LANG_JAR +COMMONS_CODEC_JAR +SYSTEM_APACHE_COMMONS +LIBSERIALIZER_JAR +LIBFONTS_JAR +LIBREPOSITORY_JAR +LIBFORMULA_JAR +LIBLOADER_JAR +LIBLAYOUT_JAR +LIBBASE_JAR +JFREEREPORT_JAR +FLUTE_JAR +LIBXML_JAR +SAC_JAR +SYSTEM_JFREEREPORT +ENABLE_REPORTBUILDER +SERVLETAPI_JAR +SYSTEM_SERVLETAPI +ENABLE_MEDIAWIKI +SYSTEM_POPPLER +ENABLE_PDFIMPORT +POPPLER_LIBS +POPPLER_CFLAGS +ENABLE_PRESENTER_SCREEN +ENABLE_MINIMIZER +ENABLE_PRESENTER_EXTRA_UI +ENABLE_OPENGL +SYSTEM_CAIRO +BUILD_PIXMAN +ENABLE_CAIRO +CAIRO_LIBS +CAIRO_CFLAGS +ENABLE_SYSTRAY_GTK +ENABLE_DBUS +ENABLE_GIO +GIO_LIBS +GIO_CFLAGS +DBUS_LIBS +DBUS_CFLAGS +GTK_LIBS +GTK_CFLAGS +ENABLE_GNOMEVFS +GNOMEVFS_LIBS +GNOMEVFS_CFLAGS +ENABLE_GCONF +GCONF_LIBS +GCONF_CFLAGS +ENABLE_KDE +ENABLE_GTK +WITH_GPC +ZIP_HOME +UNZIP +ZIP +ASM_HOME +ML_EXE +CYGWIN_PATH +GNUPATCH +GNUCP +PATCH +FLEX +BISON +NSIS_PATH +DIRECTXSDK_LIB +DIRECTXSDK_HOME +WINDOWS_VISTA_PSDK +PSDK_HOME +SYSTEM_LPSOLVE +SYSTEM_MYTHES +HYPHEN_LIB +SYSTEM_HYPH +SYSTEM_HUNSPELL +HUNSPELL_LIBS +HUNSPELL_CFLAGS +SYSTEM_REDLAND +REDLAND_LIBS +REDLAND_CFLAGS +AGG_VERSION +SYSTEM_AGG +AGG_LIBS +AGG_CFLAGS +ENABLE_AGG +NEON_VERSION +SYSTEM_NEON +SYSTEM_OPENSSL +OPENSSL_LIBS +OPENSSL_CFLAGS +NEON_LIBS +NEON_CFLAGS +DISABLE_NEON +ENABLE_RANDR +XRANDR_DLOPEN +XRANDR_LIBS +XRANDR_CFLAGS +XRENDER_LINK +SYSTEM_XRENDER_HEADERS +DISABLE_XAW +XAU_LIBS +XLIB +XINC +X_EXTRA_LIBS +X_LIBS +X_PRE_LIBS +X_CFLAGS +XMKMF +SYSTEM_ICU +SYSTEM_GENCMN +SYSTEM_GENCCODE +SYSTEM_GENBRK +SYSTEM_SANE_HEADER +MOZ_LDAP_CFLAGS +MOZ_LIB_XPCOM +MOZ_LIB +MOZ_INC +MOZ_FLAVOUR +SYSTEM_MOZILLA +BUILD_MOZAB +MOZLIBREQ_LIBS +MOZLIBREQ_CFLAGS +MOZGTK2_LIBS +MOZGTK2_CFLAGS +MOZILLA_TOOLKIT +MOZILLA_VERSION +MOZILLAXPCOM_LIBS +MOZILLAXPCOM_CFLAGS +NSPR_LIB +MOZ_NSPR_LIBS +MOZ_NSPR_CFLAGS +NSS_LIB +MOZ_NSS_LIBS +MOZ_NSS_CFLAGS +WITH_OPENLDAP +WITH_LDAP +WITH_MOZILLA +SYSTEM_ODBC_HEADERS +SYSTEM_VIGRA +SYSTEM_BOOST +CURL_LIBS +CURL_CFLAGS +SYSTEM_CURL +CURLCONFIG +SAXON_JAR +SYSTEM_SAXON +SERIALIZER_JAR +BSH_JAR +SYSTEM_BSH +HSQLDB_JAR +SYSTEM_HSQLDB +LUCENE_ANALYZERS_JAR +LUCENE_CORE_JAR +SYSTEM_LUCENE +DB_JAR +DB_INCLUDES +DB_VERSION +SYSTEM_DB +HOME +PYTHON_LIBS +PYTHON_CFLAGS +SYSTEM_PYTHON +BZIP2 +pkgpyexecdir +pyexecdir +pkgpythondir +pythondir +PYTHON_PLATFORM +PYTHON_EXEC_PREFIX +PYTHON_PREFIX +PYTHON_VERSION +PYTHON +SYSTEM_LIBXML +LIBXML_LIBS +LIBXML_CFLAGS +SYSTEM_LIBXSLT +XSLTPROC +LIBXSLT_LIBS +LIBXSLT_CFLAGS +USE_FT_EMBOLDEN +FREETYPE_LIBS +FREETYPE_CFLAGS +SYSTEM_LIBWPD +LIBWPD_LIBS +LIBWPD_CFLAGS +PKG_CONFIG +SYSTEM_EXPAT +SYSTEM_JPEG +SYSTEM_ZLIB +SYSTEM_STDLIBS +BUILD_QADEVOOO +BUILD_UNOWINREG +MINGWSTRIP +MINGWCXX +GPERF +RPM +PKGFORMAT +BUILD_EPM +PKGMK +DPKG +EPM +BUILD_DMAKE +DMAKE +JAVAFLAGS +JDK +JAVA_HOME +JAVAAOTCOMPILER +AWTLIB +JAVADOC +JAVACISGCJ +JAVACOMPILER +JAVAINTERPRETER +SOLAR_JAVA +BUILD_VER_STRING +ALLOC +HAVE_GCC_VISIBILITY_FEATURE +USE_SYSTEM_STL +STLPORT_VER +STLPORT4 +MINGW_LIB_INCLUDE_PATH +GXX_INCLUDE_PATH +CRYPT_LINK +PAM_LINK +NEW_SHADOW_API +PAM +VBA_EXTENSION +ENABLE_VBA +LFS_CFLAGS +WORDS_BIGENDIAN +SIZEOF_LONG +CXXCPP +ac_ct_CXX +CXXFLAGS +CXX +CPP +FRAME_HOME +CSC_PATH +MIDL_PATH +USE_MINGW +COMEX +MSPDB_PATH +PERL +HAVE_LD_HASH_STYLE +_cc +GNUMAKE +ENABLE_PCH +HAVE_LD_BSYMBOLIC_FUNCTIONS +GCCVER +COMPATH +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +GCC_HOME +SHELLPATH +WITH_MINGWIN +USE_SHELL +THES_SYSTEM_DIR +HYPH_SYSTEM_DIR +DICT_SYSTEM_DIR +SYSTEM_DICTS +WITH_MYSPELL_DICTS +ENABLE_RPATH +DISABLE_ATL +DISABLE_ACTIVEX +ENABLE_DIRECTX +WITH_BINFILTER +ENABLE_FONTCONFIG +ENABLE_CUPS +DISABLE_STRIP +ENABLE_SYMBOLS +PROEXT +PROFULLSWITCH +PRODUCT +ENABLE_DEBUG +ENABLE_WERROR +VC_STANDARD +ENABLE_CRASHDUMP +PTHREAD_LIBS +PTHREAD_CFLAGS +OSVERSION +GNUTAR +target_os +target_vendor +target_cpu +target +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +SOURCEVERSION +UPD +_solenv +LOCAL_SOLENV +SED +AWK +EGREP +GREP +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' ac_subst_files='' +ac_user_opts=' +enable_option_checking +with_gnu_patch +with_agg +with_gnu_cp +with_gpc +enable_ldap +with_openldap +enable_lockdown +enable_vba +with_vba_package_format +enable_pch +enable_mozilla +with_fonts +with_ppds +with_afms +enable_epm +with_epm +with_package_format +enable_odk +enable_qadevooo +enable_fontooo +enable_mathmldtd +enable_evolution2 +with_system_stdlibs +with_system_mspack +enable_cups +enable_fontconfig +enable_directx +enable_activex +enable_atl +enable_symbols +enable_strip_solver +enable_werror +enable_debug +enable_dbgutil +enable_crashdump +enable_cl_standard +enable_gtk +enable_systray +enable_cairo +with_system_cairo +enable_opengl +enable_dbus +enable_gconf +enable_gnome_vfs +enable_gio +enable_static_gtk +enable_layout +enable_build_mozilla +with_mozilla_version +with_mozilla_toolkit +enable_kde +enable_kdeab +enable_binfilter +enable_rpath +enable_pam +enable_pam_link +enable_crypt_link +enable_xrender_link +enable_randr +enable_randr_link +with_myspell_dicts +with_system_dicts +with_external_dict_dir +with_external_hyph_dir +with_external_thes_dir +with_system_libs +with_system_headers +with_system_jars +with_system_zlib +with_system_openssl +with_system_jpeg +with_system_expat +with_system_libwpd +with_system_libxml +with_system_python +with_system_icu +with_system_poppler +with_system_db +with_system_lucene +with_lucene_core_jar +with_lucene_analyzers_jar +with_system_hsqldb +with_hsqldb_jar +with_system_beanshell +with_beanshell_jar +enable_presenter_extra_ui +enable_minimizer +enable_presenter_console +enable_pdfimport +enable_wiki_publisher +with_commons_codec_jar +with_commons_lang_jar +with_commons_httpclient_jar +with_commons_logging_jar +with_servlet_api_jar +enable_report_builder +with_system_jfreereport +with_sac_jar +with_libxml_jar +with_flute_jar +with_jfreereport_jar +with_liblayout_jar +with_libloader_jar +with_libformula_jar +with_librepository_jar +with_libfonts_jar +with_libserializer_jar +with_libbase_jar +with_system_saxon +with_saxon_jar +with_system_libxslt +with_system_odbc +with_system_sane +with_system_xrender +with_system_curl +with_system_boost +with_system_vigra +enable_neon +enable_Xaw +with_system_neon +with_system_agg +with_system_hunspell +with_system_mythes +with_system_altlinuxhyph +with_system_lpsolve +with_system_mozilla +with_stlport +with_jdk_home +with_gxx_include_path +with_java +enable_gcjaot +with_ant_home +with_perl_home +with_cl_home +with_mspdb_path +with_midl_path +with_csc_path +with_nsis_path +with_frame_home +with_psdk_home +with_directx_home +with_local_solenv +with_local_solver +enable_check_only +with_lang +with_poor_help_localizations +with_dict +with_intro_bitmaps +with_about_bitmaps +with_vendor +with_unix_wrapper +with_asm_home +with_os_version +with_unzip_home +with_zip_home +with_mingwin +with_use_shell +with_build_version +enable_sgistl +with_alloc +enable_verbose +enable_largefile +with_x +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP +CXX +CXXFLAGS +CCC +CXXCPP +XMKMF' + # Initialize some variables set by options. ac_init_help= ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null @@ -336,34 +1218,48 @@ x_libraries=NONE # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' +datarootdir='${prefix}/share' +datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' ac_prev= +ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" + eval $ac_prev=\$ac_option ac_prev= continue fi - ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_option in + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; @@ -385,33 +1281,61 @@ do --config-cache | -C) cache_file=config.cache ;; - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) + -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + -disable-* | --disable-*) - ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - eval "enable_$ac_feature=no" ;; + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; -enable-* | --enable-*) - ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; esac - eval "enable_$ac_feature='$ac_optarg'" ;; + eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -438,6 +1362,12 @@ do -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; @@ -462,13 +1392,16 @@ do | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) + | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) @@ -533,6 +1466,16 @@ do | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; @@ -583,26 +1526,38 @@ do ac_init_version=: ;; -with-* | --with-*) - ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package| sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; esac - eval "with_$ac_package='$ac_optarg'" ;; + eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/-/_/g'` - eval "with_$ac_package=no" ;; + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 + { (exit 1); exit 1; }; } + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. @@ -622,7 +1577,7 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) { echo "$as_me: error: unrecognized option: $ac_option + -*) { $as_echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; @@ -631,17 +1586,16 @@ Try \`$0 --help' for more information." >&2 ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } - ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` - eval "$ac_envvar='$ac_optarg'" + eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; @@ -650,31 +1604,39 @@ done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { echo "$as_me: error: missing argument to $ac_option" >&2 + { $as_echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi -# Be sure to have absolute paths. -for ac_var in exec_prefix prefix -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* | NONE | '' ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 + { (exit 1); exit 1; }; } ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac -done +fi -# Be sure to have absolute paths. -for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir do - eval ac_val=$`echo $ac_var` + eval ac_val=\$$ac_var + # Remove trailing slashes. case $ac_val in - [\\/$]* | ?:[\\/]* ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac + { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' @@ -688,7 +1650,7 @@ target=$target_alias if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes @@ -701,86 +1663,76 @@ test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + { $as_echo "$as_me: error: working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } + + # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_confdir=`(dirname "$0") 2>/dev/null || -$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then + if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } - else - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } - fi + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. fi -(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || - { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 - { (exit 1); exit 1; }; } -srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` -ac_env_build_alias_set=${build_alias+set} -ac_env_build_alias_value=$build_alias -ac_cv_env_build_alias_set=${build_alias+set} -ac_cv_env_build_alias_value=$build_alias -ac_env_host_alias_set=${host_alias+set} -ac_env_host_alias_value=$host_alias -ac_cv_env_host_alias_set=${host_alias+set} -ac_cv_env_host_alias_value=$host_alias -ac_env_target_alias_set=${target_alias+set} -ac_env_target_alias_value=$target_alias -ac_cv_env_target_alias_set=${target_alias+set} -ac_cv_env_target_alias_value=$target_alias -ac_env_CC_set=${CC+set} -ac_env_CC_value=$CC -ac_cv_env_CC_set=${CC+set} -ac_cv_env_CC_value=$CC -ac_env_CFLAGS_set=${CFLAGS+set} -ac_env_CFLAGS_value=$CFLAGS -ac_cv_env_CFLAGS_set=${CFLAGS+set} -ac_cv_env_CFLAGS_value=$CFLAGS -ac_env_LDFLAGS_set=${LDFLAGS+set} -ac_env_LDFLAGS_value=$LDFLAGS -ac_cv_env_LDFLAGS_set=${LDFLAGS+set} -ac_cv_env_LDFLAGS_value=$LDFLAGS -ac_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_env_CPPFLAGS_value=$CPPFLAGS -ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_cv_env_CPPFLAGS_value=$CPPFLAGS -ac_env_CPP_set=${CPP+set} -ac_env_CPP_value=$CPP -ac_cv_env_CPP_set=${CPP+set} -ac_cv_env_CPP_value=$CPP -ac_env_CXX_set=${CXX+set} -ac_env_CXX_value=$CXX -ac_cv_env_CXX_set=${CXX+set} -ac_cv_env_CXX_value=$CXX -ac_env_CXXFLAGS_set=${CXXFLAGS+set} -ac_env_CXXFLAGS_value=$CXXFLAGS -ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} -ac_cv_env_CXXFLAGS_value=$CXXFLAGS -ac_env_CXXCPP_set=${CXXCPP+set} -ac_env_CXXCPP_value=$CXXCPP -ac_cv_env_CXXCPP_set=${CXXCPP+set} -ac_cv_env_CXXCPP_value=$CXXCPP +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done # # Report the --help message. @@ -809,9 +1761,6 @@ Configuration: -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] -_ACEOF - - cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] @@ -826,18 +1775,25 @@ for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data [PREFIX/share] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --infodir=DIR info documentation [PREFIX/info] - --mandir=DIR man documentation [PREFIX/man] + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF @@ -858,6 +1814,7 @@ if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-ldap Disables the use of LDAP backend via Netscape/Mozilla @@ -1000,6 +1957,9 @@ Optional Features: --disable-randr-link disable linking with libXrandr, instead dynamically open it at runtime + --enable-presenter-extra-ui enables extra functionality during slideshow, + e.g. selecting pen color, erasing drawings etc. + --enable-minimizer enables the build of the Presentation Minimizer extension --enable-presenter-console enables the build of the Presenter Console extension @@ -1418,97 +2378,101 @@ Some influential environment variables: CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory - CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have - headers in a nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + you have headers in a nonstandard directory CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor + XMKMF Path to xmkmf, Makefile generator for X Window System Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF +ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. - ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d $ac_dir || continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue ac_builddir=. -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac -# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be -# absolute. -ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` -ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` -ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` - - cd $ac_dir - # Check for guested configure; otherwise get Cygnus style configure. - if test -f $ac_srcdir/configure.gnu; then - echo - $SHELL $ac_srcdir/configure.gnu --help=recursive - elif test -f $ac_srcdir/configure; then - echo - $SHELL $ac_srcdir/configure --help=recursive - elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then - echo - $ac_configure --help + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive else - echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi - cd $ac_popdir + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } done fi -test -n "$ac_init_help" && exit 0 +test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF +configure +generated by GNU Autoconf 2.63 -Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 -Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF - exit 0 + exit fi -exec 5>config.log -cat >&5 <<_ACEOF +cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.57. Invocation command line was +generated by GNU Autoconf 2.63. Invocation command line was $ $0 $@ _ACEOF +exec 5>>config.log { cat <<_ASUNAME ## --------- ## @@ -1527,7 +2491,7 @@ uname -v = `(uname -v) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` @@ -1539,8 +2503,9 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - echo "PATH: $as_dir" + $as_echo "PATH: $as_dir" done +IFS=$as_save_IFS } >&5 @@ -1562,7 +2527,6 @@ _ACEOF ac_configure_args= ac_configure_args0= ac_configure_args1= -ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do @@ -1573,31 +2537,29 @@ do -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. + ac_must_keep_next=false # Got value, back to normal. else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac fi - ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - # Get rid of the leading space. - ac_sep=" " + ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done @@ -1608,8 +2570,8 @@ $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_ # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. -# WARNING: Be sure not to use single quotes in there, as some shells, -# such as our DU 5.0 friend, will then `close' the trap. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { @@ -1622,20 +2584,35 @@ trap 'exit_status=$? _ASBOX echo # The following way of writing the cache mishandles newlines in values, -{ +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done (set) 2>&1 | - case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" - ;; + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( *) - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} + esac | + sort +) echo cat <<\_ASBOX @@ -1646,22 +2623,28 @@ _ASBOX echo for ac_var in $ac_subst_vars do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX -## ------------- ## -## Output files. ## -## ------------- ## +## ------------------- ## +## File substitutions. ## +## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi @@ -1673,26 +2656,24 @@ _ASBOX ## ----------- ## _ASBOX echo - sed "/^$/d" confdefs.h | sort + cat confdefs.h echo fi test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" - echo "$as_me: exit $exit_status" + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" } >&5 - rm -f core core.* *.core && - rm -rf conftest* confdefs* conf$$* $ac_clean_files && + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status - ' 0 +' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo >confdefs.h +rm -f -r conftest* confdefs.h # Predefined preprocessor variables. @@ -1722,18 +2703,24 @@ _ACEOF # Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi -fi -for ac_site_file in $CONFIG_SITE; do +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + ac_site_file1=$CONFIG_SITE +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue if test -r "$ac_site_file"; then - { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -echo "$as_me: loading site script $ac_site_file" >&6;} + { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi @@ -1743,54 +2730,61 @@ if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} + { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; esac fi else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} + { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false -for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do +for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val="\$ac_cv_env_${ac_var}_value" - eval ac_new_val="\$ac_env_${ac_var}_value" + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 -echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 -echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -1800,19 +2794,15 @@ echo "$as_me: current value: $ac_new_val" >&2;} fi done if $ac_cache_corrupted; then - { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - @@ -1829,1006 +2819,1018 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$@" >config.parms -# Check whether --with-gnu-patch or --without-gnu-patch was given. +# Check whether --with-gnu-patch was given. if test "${with_gnu_patch+set}" = set; then - withval="$with_gnu_patch" + withval=$with_gnu_patch; +fi -fi; -# Check whether --with-agg or --without-agg was given. +# Check whether --with-agg was given. if test "${with_agg+set}" = set; then - withval="$with_agg" - + withval=$with_agg; else with_agg=yes -fi; +fi + -# Check whether --with-gnu-cp or --without-gnu-cp was given. +# Check whether --with-gnu-cp was given. if test "${with_gnu_cp+set}" = set; then - withval="$with_gnu_cp" + withval=$with_gnu_cp; +fi -fi; -# Check whether --with-gpc or --without-gpc was given. +# Check whether --with-gpc was given. if test "${with_gpc+set}" = set; then - withval="$with_gpc" - + withval=$with_gpc; else if test ! -e ./external/gpc/gpc.c && test ! -e ./external/gpc/gpc.h; then without_gpc=yes; fi -fi; -# Check whether --enable-ldap or --disable-ldap was given. +fi + +# Check whether --enable-ldap was given. if test "${enable_ldap+set}" = set; then - enableval="$enable_ldap" + enableval=$enable_ldap; +fi -fi; -# Check whether --with-openldap or --without-openldap was given. +# Check whether --with-openldap was given. if test "${with_openldap+set}" = set; then - withval="$with_openldap" + withval=$with_openldap; +fi -fi; -# Check whether --enable-lockdown or --disable-lockdown was given. +# Check whether --enable-lockdown was given. if test "${enable_lockdown+set}" = set; then - enableval="$enable_lockdown" + enableval=$enable_lockdown; +fi -fi; -# Check whether --enable-vba or --disable-vba was given. +# Check whether --enable-vba was given. if test "${enable_vba+set}" = set; then - enableval="$enable_vba" + enableval=$enable_vba; +fi -fi; -# Check whether --with-vba-package-format or --without-vba-package-format was given. +# Check whether --with-vba-package-format was given. if test "${with_vba_package_format+set}" = set; then - withval="$with_vba_package_format" + withval=$with_vba_package_format; +fi -fi; -# Check whether --enable-pch or --disable-pch was given. +# Check whether --enable-pch was given. if test "${enable_pch+set}" = set; then - enableval="$enable_pch" + enableval=$enable_pch; +fi -fi; -# Check whether --enable-mozilla or --disable-mozilla was given. +# Check whether --enable-mozilla was given. if test "${enable_mozilla+set}" = set; then - enableval="$enable_mozilla" - + enableval=$enable_mozilla; else enable_mozilla="yes" -fi; +fi -# Check whether --with-fonts or --without-fonts was given. + +# Check whether --with-fonts was given. if test "${with_fonts+set}" = set; then - withval="$with_fonts" + withval=$with_fonts; +fi -fi; -# Check whether --with-ppds or --without-ppds was given. +# Check whether --with-ppds was given. if test "${with_ppds+set}" = set; then - withval="$with_ppds" + withval=$with_ppds; +fi -fi; -# Check whether --with-afms or --without-afms was given. +# Check whether --with-afms was given. if test "${with_afms+set}" = set; then - withval="$with_afms" + withval=$with_afms; +fi -fi; -# Check whether --enable-epm or --disable-epm was given. +# Check whether --enable-epm was given. if test "${enable_epm+set}" = set; then - enableval="$enable_epm" - + enableval=$enable_epm; else enable_epm="yes" -fi; +fi -# Check whether --with-epm or --without-epm was given. + +# Check whether --with-epm was given. if test "${with_epm+set}" = set; then - withval="$with_epm" + withval=$with_epm; +fi -fi; -# Check whether --with-package-format or --without-package-format was given. +# Check whether --with-package-format was given. if test "${with_package_format+set}" = set; then - withval="$with_package_format" + withval=$with_package_format; +fi -fi; -# Check whether --enable-odk or --disable-odk was given. +# Check whether --enable-odk was given. if test "${enable_odk+set}" = set; then - enableval="$enable_odk" - + enableval=$enable_odk; else enable_odk="yes" -fi; -# Check whether --enable-qadevooo or --disable-qadevooo was given. -if test "${enable_qadevooo+set}" = set; then - enableval="$enable_qadevooo" +fi +# Check whether --enable-qadevooo was given. +if test "${enable_qadevooo+set}" = set; then + enableval=$enable_qadevooo; else enable_qadevooo="yes" -fi; -# Check whether --enable-fontooo or --disable-fontooo was given. -if test "${enable_fontooo+set}" = set; then - enableval="$enable_fontooo" +fi +# Check whether --enable-fontooo was given. +if test "${enable_fontooo+set}" = set; then + enableval=$enable_fontooo; else enable_fontooo="yes" -fi; -# Check whether --enable-mathmldtd or --disable-mathmldtd was given. -if test "${enable_mathmldtd+set}" = set; then - enableval="$enable_mathmldtd" +fi +# Check whether --enable-mathmldtd was given. +if test "${enable_mathmldtd+set}" = set; then + enableval=$enable_mathmldtd; else enable_mathmldtd="yes" -fi; -# Check whether --enable-evolution2 or --disable-evolution2 was given. +fi + +# Check whether --enable-evolution2 was given. if test "${enable_evolution2+set}" = set; then - enableval="$enable_evolution2" + enableval=$enable_evolution2; +fi -fi; -# Check whether --with-system-stdlibs or --without-system-stdlibs was given. +# Check whether --with-system-stdlibs was given. if test "${with_system_stdlibs+set}" = set; then - withval="$with_system_stdlibs" - + withval=$with_system_stdlibs; else checkforprelink=yes -fi; +fi -# Check whether --with-system-mspack or --without-system-mspack was given. + +# Check whether --with-system-mspack was given. if test "${with_system_mspack+set}" = set; then - withval="$with_system_mspack" + withval=$with_system_mspack; +fi -fi; -# Check whether --enable-cups or --disable-cups was given. +# Check whether --enable-cups was given. if test "${enable_cups+set}" = set; then - enableval="$enable_cups" - + enableval=$enable_cups; else enable_cups=yes -fi; -# Check whether --enable-fontconfig or --disable-fontconfig was given. -if test "${enable_fontconfig+set}" = set; then - enableval="$enable_fontconfig" +fi +# Check whether --enable-fontconfig was given. +if test "${enable_fontconfig+set}" = set; then + enableval=$enable_fontconfig; else enable_fontconfig=yes -fi; -# Check whether --enable-directx or --disable-directx was given. -if test "${enable_directx+set}" = set; then - enableval="$enable_directx" +fi +# Check whether --enable-directx was given. +if test "${enable_directx+set}" = set; then + enableval=$enable_directx; else enable_directx=yes -fi; -# Check whether --enable-activex or --disable-activex was given. +fi + +# Check whether --enable-activex was given. if test "${enable_activex+set}" = set; then - enableval="$enable_activex" + enableval=$enable_activex; +fi -fi; -# Check whether --enable-atl or --disable-atl was given. +# Check whether --enable-atl was given. if test "${enable_atl+set}" = set; then - enableval="$enable_atl" + enableval=$enable_atl; +fi -fi; -# Check whether --enable-symbols or --disable-symbols was given. +# Check whether --enable-symbols was given. if test "${enable_symbols+set}" = set; then - enableval="$enable_symbols" + enableval=$enable_symbols; +fi -fi; -# Check whether --enable-strip-solver or --disable-strip-solver was given. +# Check whether --enable-strip-solver was given. if test "${enable_strip_solver+set}" = set; then - enableval="$enable_strip_solver" + enableval=$enable_strip_solver; +fi -fi; -# Check whether --enable-werror or --disable-werror was given. +# Check whether --enable-werror was given. if test "${enable_werror+set}" = set; then - enableval="$enable_werror" + enableval=$enable_werror; +fi -fi; -# Check whether --enable-debug or --disable-debug was given. +# Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then - enableval="$enable_debug" + enableval=$enable_debug; +fi -fi; -# Check whether --enable-dbgutil or --disable-dbgutil was given. +# Check whether --enable-dbgutil was given. if test "${enable_dbgutil+set}" = set; then - enableval="$enable_dbgutil" + enableval=$enable_dbgutil; +fi -fi; -# Check whether --enable-crashdump or --disable-crashdump was given. +# Check whether --enable-crashdump was given. if test "${enable_crashdump+set}" = set; then - enableval="$enable_crashdump" - + enableval=$enable_crashdump; else enable_crashdump=no -fi; -# Check whether --enable-cl-standard or --disable-cl-standard was given. +fi + +# Check whether --enable-cl-standard was given. if test "${enable_cl_standard+set}" = set; then - enableval="$enable_cl_standard" + enableval=$enable_cl_standard; +fi -fi; -# Check whether --enable-gtk or --disable-gtk was given. +# Check whether --enable-gtk was given. if test "${enable_gtk+set}" = set; then - enableval="$enable_gtk" - + enableval=$enable_gtk; else enable_gtk=yes -fi; -# Check whether --enable-systray or --disable-systray was given. -if test "${enable_systray+set}" = set; then - enableval="$enable_systray" +fi +# Check whether --enable-systray was given. +if test "${enable_systray+set}" = set; then + enableval=$enable_systray; else enable_systray=yes -fi; -# Check whether --enable-cairo or --disable-cairo was given. -if test "${enable_cairo+set}" = set; then - enableval="$enable_cairo" +fi +# Check whether --enable-cairo was given. +if test "${enable_cairo+set}" = set; then + enableval=$enable_cairo; else enable_cairo=no -fi; +fi -# Check whether --with-system-cairo or --without-system-cairo was given. + +# Check whether --with-system-cairo was given. if test "${with_system_cairo+set}" = set; then - withval="$with_system_cairo" + withval=$with_system_cairo; +fi -fi; -# Check whether --enable-opengl or --disable-opengl was given. +# Check whether --enable-opengl was given. if test "${enable_opengl+set}" = set; then - enableval="$enable_opengl" - + enableval=$enable_opengl; else enable_opengl=no -fi; -# Check whether --enable-dbus or --disable-dbus was given. -if test "${enable_dbus+set}" = set; then - enableval="$enable_dbus" +fi +# Check whether --enable-dbus was given. +if test "${enable_dbus+set}" = set; then + enableval=$enable_dbus; else enable_dbus=no -fi; -# Check whether --enable-gconf or --disable-gconf was given. -if test "${enable_gconf+set}" = set; then - enableval="$enable_gconf" +fi +# Check whether --enable-gconf was given. +if test "${enable_gconf+set}" = set; then + enableval=$enable_gconf; else enable_gconf=yes -fi; -# Check whether --enable-gnome-vfs or --disable-gnome-vfs was given. -if test "${enable_gnome_vfs+set}" = set; then - enableval="$enable_gnome_vfs" +fi +# Check whether --enable-gnome-vfs was given. +if test "${enable_gnome_vfs+set}" = set; then + enableval=$enable_gnome_vfs; else enable_gnome_vfs=yes -fi; -# Check whether --enable-gio or --disable-gio was given. -if test "${enable_gio+set}" = set; then - enableval="$enable_gio" +fi +# Check whether --enable-gio was given. +if test "${enable_gio+set}" = set; then + enableval=$enable_gio; else enable_gio=no -fi; -# Check whether --enable-static-gtk or --disable-static-gtk was given. +fi + +# Check whether --enable-static-gtk was given. if test "${enable_static_gtk+set}" = set; then - enableval="$enable_static_gtk" + enableval=$enable_static_gtk; +fi -fi; -# Check whether --enable-layout or --disable-layout was given. +# Check whether --enable-layout was given. if test "${enable_layout+set}" = set; then - enableval="$enable_layout" + enableval=$enable_layout; +fi -fi; -# Check whether --enable-build-mozilla or --disable-build-mozilla was given. +# Check whether --enable-build-mozilla was given. if test "${enable_build_mozilla+set}" = set; then - enableval="$enable_build_mozilla" + enableval=$enable_build_mozilla; +fi -fi; -# Check whether --with-mozilla-version or --without-mozilla-version was given. +# Check whether --with-mozilla-version was given. if test "${with_mozilla_version+set}" = set; then - withval="$with_mozilla_version" + withval=$with_mozilla_version; +fi -fi; -# Check whether --with-mozilla-toolkit or --without-mozilla-toolkit was given. +# Check whether --with-mozilla-toolkit was given. if test "${with_mozilla_toolkit+set}" = set; then - withval="$with_mozilla_toolkit" + withval=$with_mozilla_toolkit; +fi -fi; -# Check whether --enable-kde or --disable-kde was given. +# Check whether --enable-kde was given. if test "${enable_kde+set}" = set; then - enableval="$enable_kde" + enableval=$enable_kde; +fi -fi; -# Check whether --enable-kdeab or --disable-kdeab was given. +# Check whether --enable-kdeab was given. if test "${enable_kdeab+set}" = set; then - enableval="$enable_kdeab" - + enableval=$enable_kdeab; else if test "$enable_kde" = "yes"; then enable_kdeab=yes; fi -fi; -# Check whether --enable-binfilter or --disable-binfilter was given. -if test "${enable_binfilter+set}" = set; then - enableval="$enable_binfilter" +fi +# Check whether --enable-binfilter was given. +if test "${enable_binfilter+set}" = set; then + enableval=$enable_binfilter; else if ! test -d ./binfilter; then enable_binfilter=no; fi -fi; -# Check whether --enable-rpath or --disable-rpath was given. +fi + +# Check whether --enable-rpath was given. if test "${enable_rpath+set}" = set; then - enableval="$enable_rpath" + enableval=$enable_rpath; +fi -fi; -# Check whether --enable-pam or --disable-pam was given. +# Check whether --enable-pam was given. if test "${enable_pam+set}" = set; then - enableval="$enable_pam" + enableval=$enable_pam; +fi -fi; -# Check whether --enable-pam-link or --disable-pam-link was given. +# Check whether --enable-pam-link was given. if test "${enable_pam_link+set}" = set; then - enableval="$enable_pam_link" + enableval=$enable_pam_link; +fi -fi; -# Check whether --enable-crypt-link or --disable-crypt-link was given. +# Check whether --enable-crypt-link was given. if test "${enable_crypt_link+set}" = set; then - enableval="$enable_crypt_link" - + enableval=$enable_crypt_link; else enable_crypt_link=yes -fi; -# Check whether --enable-xrender-link or --disable-xrender-link was given. +fi + +# Check whether --enable-xrender-link was given. if test "${enable_xrender_link+set}" = set; then - enableval="$enable_xrender_link" + enableval=$enable_xrender_link; +fi -fi; -# Check whether --enable-randr or --disable-randr was given. +# Check whether --enable-randr was given. if test "${enable_randr+set}" = set; then - enableval="$enable_randr" - + enableval=$enable_randr; else enable_randr=yes -fi; -# Check whether --enable-randr-link or --disable-randr-link was given. -if test "${enable_randr_link+set}" = set; then - enableval="$enable_randr_link" +fi +# Check whether --enable-randr-link was given. +if test "${enable_randr_link+set}" = set; then + enableval=$enable_randr_link; else enable_randr_link=yes -fi; +fi + -# Check whether --with-myspell-dicts or --without-myspell-dicts was given. +# Check whether --with-myspell-dicts was given. if test "${with_myspell_dicts+set}" = set; then - withval="$with_myspell_dicts" + withval=$with_myspell_dicts; +fi -fi; -# Check whether --with-system-dicts or --without-system-dicts was given. +# Check whether --with-system-dicts was given. if test "${with_system_dicts+set}" = set; then - withval="$with_system_dicts" + withval=$with_system_dicts; +fi -fi; -# Check whether --with-external-dict-dir or --without-external-dict-dir was given. +# Check whether --with-external-dict-dir was given. if test "${with_external_dict_dir+set}" = set; then - withval="$with_external_dict_dir" + withval=$with_external_dict_dir; +fi -fi; -# Check whether --with-external-hyph-dir or --without-external-hyph-dir was given. +# Check whether --with-external-hyph-dir was given. if test "${with_external_hyph_dir+set}" = set; then - withval="$with_external_hyph_dir" + withval=$with_external_hyph_dir; +fi -fi; -# Check whether --with-external-thes-dir or --without-external-thes-dir was given. +# Check whether --with-external-thes-dir was given. if test "${with_external_thes_dir+set}" = set; then - withval="$with_external_thes_dir" + withval=$with_external_thes_dir; +fi -fi; -# Check whether --with-system-libs or --without-system-libs was given. +# Check whether --with-system-libs was given. if test "${with_system_libs+set}" = set; then - withval="$with_system_libs" + withval=$with_system_libs; +fi -fi; -# Check whether --with-system-headers or --without-system-headers was given. +# Check whether --with-system-headers was given. if test "${with_system_headers+set}" = set; then - withval="$with_system_headers" + withval=$with_system_headers; +fi -fi; -# Check whether --with-system-jars or --without-system-jars was given. +# Check whether --with-system-jars was given. if test "${with_system_jars+set}" = set; then - withval="$with_system_jars" + withval=$with_system_jars; +fi -fi; -# Check whether --with-system-zlib or --without-system-zlib was given. +# Check whether --with-system-zlib was given. if test "${with_system_zlib+set}" = set; then - withval="$with_system_zlib" + withval=$with_system_zlib; +fi -fi; -# Check whether --with-system-openssl or --without-system-openssl was given. +# Check whether --with-system-openssl was given. if test "${with_system_openssl+set}" = set; then - withval="$with_system_openssl" + withval=$with_system_openssl; +fi -fi; -# Check whether --with-system-jpeg or --without-system-jpeg was given. +# Check whether --with-system-jpeg was given. if test "${with_system_jpeg+set}" = set; then - withval="$with_system_jpeg" + withval=$with_system_jpeg; +fi -fi; -# Check whether --with-system-expat or --without-system-expat was given. +# Check whether --with-system-expat was given. if test "${with_system_expat+set}" = set; then - withval="$with_system_expat" + withval=$with_system_expat; +fi -fi; -# Check whether --with-system-libwpd or --without-system-libwpd was given. +# Check whether --with-system-libwpd was given. if test "${with_system_libwpd+set}" = set; then - withval="$with_system_libwpd" + withval=$with_system_libwpd; +fi -fi; -# Check whether --with-system-libxml or --without-system-libxml was given. +# Check whether --with-system-libxml was given. if test "${with_system_libxml+set}" = set; then - withval="$with_system_libxml" + withval=$with_system_libxml; +fi -fi; -# Check whether --with-system-python or --without-system-python was given. +# Check whether --with-system-python was given. if test "${with_system_python+set}" = set; then - withval="$with_system_python" + withval=$with_system_python; +fi -fi; -# Check whether --with-system-icu or --without-system-icu was given. +# Check whether --with-system-icu was given. if test "${with_system_icu+set}" = set; then - withval="$with_system_icu" + withval=$with_system_icu; +fi -fi; -# Check whether --with-system-poppler or --without-system-poppler was given. +# Check whether --with-system-poppler was given. if test "${with_system_poppler+set}" = set; then - withval="$with_system_poppler" + withval=$with_system_poppler; +fi -fi; -# Check whether --with-system-db or --without-system-db was given. +# Check whether --with-system-db was given. if test "${with_system_db+set}" = set; then - withval="$with_system_db" + withval=$with_system_db; +fi -fi; -# Check whether --with-system-lucene or --without-system-lucene was given. +# Check whether --with-system-lucene was given. if test "${with_system_lucene+set}" = set; then - withval="$with_system_lucene" + withval=$with_system_lucene; +fi -fi; -# Check whether --with-lucene-core-jar or --without-lucene-core-jar was given. +# Check whether --with-lucene-core-jar was given. if test "${with_lucene_core_jar+set}" = set; then - withval="$with_lucene_core_jar" - LUCENE_CORE_JAR="$withval" + withval=$with_lucene_core_jar; LUCENE_CORE_JAR="$withval" + +fi -fi; -# Check whether --with-lucene-analyzers-jar or --without-lucene-analyzers-jar was given. +# Check whether --with-lucene-analyzers-jar was given. if test "${with_lucene_analyzers_jar+set}" = set; then - withval="$with_lucene_analyzers_jar" - LUCENE_ANALYZERS_JAR="$withval" + withval=$with_lucene_analyzers_jar; LUCENE_ANALYZERS_JAR="$withval" + +fi -fi; -# Check whether --with-system-hsqldb or --without-system-hsqldb was given. +# Check whether --with-system-hsqldb was given. if test "${with_system_hsqldb+set}" = set; then - withval="$with_system_hsqldb" + withval=$with_system_hsqldb; +fi -fi; -# Check whether --with-hsqldb-jar or --without-hsqldb-jar was given. +# Check whether --with-hsqldb-jar was given. if test "${with_hsqldb_jar+set}" = set; then - withval="$with_hsqldb_jar" - HSQLDB_JAR="$withval" + withval=$with_hsqldb_jar; HSQLDB_JAR="$withval" + +fi -fi; -# Check whether --with-system-beanshell or --without-system-beanshell was given. +# Check whether --with-system-beanshell was given. if test "${with_system_beanshell+set}" = set; then - withval="$with_system_beanshell" + withval=$with_system_beanshell; +fi -fi; -# Check whether --with-beanshell-jar or --without-beanshell-jar was given. +# Check whether --with-beanshell-jar was given. if test "${with_beanshell_jar+set}" = set; then - withval="$with_beanshell_jar" - BSH_JAR="$withval" + withval=$with_beanshell_jar; BSH_JAR="$withval" + +fi + +# Check whether --enable-presenter-extra-ui was given. +if test "${enable_presenter_extra_ui+set}" = set; then + enableval=$enable_presenter_extra_ui; +else + enable_presenter_extra_ui=no +fi -fi; -# Check whether --enable-minimizer or --disable-minimizer was given. +# Check whether --enable-minimizer was given. if test "${enable_minimizer+set}" = set; then - enableval="$enable_minimizer" + enableval=$enable_minimizer; +fi -fi; -# Check whether --enable-presenter-console or --disable-presenter-console was given. +# Check whether --enable-presenter-console was given. if test "${enable_presenter_console+set}" = set; then - enableval="$enable_presenter_console" + enableval=$enable_presenter_console; +fi -fi; -# Check whether --enable-pdfimport or --disable-pdfimport was given. +# Check whether --enable-pdfimport was given. if test "${enable_pdfimport+set}" = set; then - enableval="$enable_pdfimport" + enableval=$enable_pdfimport; +fi -fi; -# Check whether --enable-wiki-publisher or --disable-wiki-publisher was given. +# Check whether --enable-wiki-publisher was given. if test "${enable_wiki_publisher+set}" = set; then - enableval="$enable_wiki_publisher" + enableval=$enable_wiki_publisher; +fi -fi; -# Check whether --with-commons-codec-jar or --without-commons-codec-jar was given. +# Check whether --with-commons-codec-jar was given. if test "${with_commons_codec_jar+set}" = set; then - withval="$with_commons_codec_jar" - COMMONS_CODEC_JAR="$withval" + withval=$with_commons_codec_jar; COMMONS_CODEC_JAR="$withval" + +fi -fi; -# Check whether --with-commons-lang-jar or --without-commons-lang-jar was given. +# Check whether --with-commons-lang-jar was given. if test "${with_commons_lang_jar+set}" = set; then - withval="$with_commons_lang_jar" - COMMONS_LANG_JAR="$withval" + withval=$with_commons_lang_jar; COMMONS_LANG_JAR="$withval" + +fi -fi; -# Check whether --with-commons-httpclient-jar or --without-commons-httpclient-jar was given. +# Check whether --with-commons-httpclient-jar was given. if test "${with_commons_httpclient_jar+set}" = set; then - withval="$with_commons_httpclient_jar" - COMMONS_HTTPCLIENT_JAR="$withval" + withval=$with_commons_httpclient_jar; COMMONS_HTTPCLIENT_JAR="$withval" + +fi -fi; -# Check whether --with-commons-logging-jar or --without-commons-logging-jar was given. +# Check whether --with-commons-logging-jar was given. if test "${with_commons_logging_jar+set}" = set; then - withval="$with_commons_logging_jar" - COMMONS_LOGGING_JAR="$withval" + withval=$with_commons_logging_jar; COMMONS_LOGGING_JAR="$withval" + +fi -fi; -# Check whether --with-servlet-api-jar or --without-servlet-api-jar was given. +# Check whether --with-servlet-api-jar was given. if test "${with_servlet_api_jar+set}" = set; then - withval="$with_servlet_api_jar" - SERVLETAPI_JAR="$withval" + withval=$with_servlet_api_jar; SERVLETAPI_JAR="$withval" -fi; -# Check whether --enable-report-builder or --disable-report-builder was given. +fi + +# Check whether --enable-report-builder was given. if test "${enable_report_builder+set}" = set; then - enableval="$enable_report_builder" + enableval=$enable_report_builder; +fi -fi; -# Check whether --with-system-jfreereport or --without-system-jfreereport was given. +# Check whether --with-system-jfreereport was given. if test "${with_system_jfreereport+set}" = set; then - withval="$with_system_jfreereport" + withval=$with_system_jfreereport; +fi -fi; -# Check whether --with-sac-jar or --without-sac-jar was given. +# Check whether --with-sac-jar was given. if test "${with_sac_jar+set}" = set; then - withval="$with_sac_jar" - SAC_JAR="$withval" + withval=$with_sac_jar; SAC_JAR="$withval" + +fi -fi; -# Check whether --with-libxml-jar or --without-libxml-jar was given. +# Check whether --with-libxml-jar was given. if test "${with_libxml_jar+set}" = set; then - withval="$with_libxml_jar" - LIBXML_JAR="$withval" + withval=$with_libxml_jar; LIBXML_JAR="$withval" + +fi -fi; -# Check whether --with-flute-jar or --without-flute-jar was given. +# Check whether --with-flute-jar was given. if test "${with_flute_jar+set}" = set; then - withval="$with_flute_jar" - FLUTE_JAR="$withval" + withval=$with_flute_jar; FLUTE_JAR="$withval" + +fi -fi; -# Check whether --with-jfreereport-jar or --without-jfreereport-jar was given. +# Check whether --with-jfreereport-jar was given. if test "${with_jfreereport_jar+set}" = set; then - withval="$with_jfreereport_jar" - JFREEREPORT_JAR="$withval" + withval=$with_jfreereport_jar; JFREEREPORT_JAR="$withval" + +fi -fi; -# Check whether --with-liblayout-jar or --without-liblayout-jar was given. +# Check whether --with-liblayout-jar was given. if test "${with_liblayout_jar+set}" = set; then - withval="$with_liblayout_jar" - LIBLAYOUT_JAR="$withval" + withval=$with_liblayout_jar; LIBLAYOUT_JAR="$withval" + +fi -fi; -# Check whether --with-libloader-jar or --without-libloader-jar was given. +# Check whether --with-libloader-jar was given. if test "${with_libloader_jar+set}" = set; then - withval="$with_libloader_jar" - LIBLOADER_JAR="$withval" + withval=$with_libloader_jar; LIBLOADER_JAR="$withval" + +fi -fi; -# Check whether --with-libloader-jar or --without-libloader-jar was given. +# Check whether --with-libloader-jar was given. if test "${with_libloader_jar+set}" = set; then - withval="$with_libloader_jar" - LIBLOADER_JAR="$withval" + withval=$with_libloader_jar; LIBLOADER_JAR="$withval" + +fi -fi; -# Check whether --with-libformula-jar or --without-libformula-jar was given. +# Check whether --with-libformula-jar was given. if test "${with_libformula_jar+set}" = set; then - withval="$with_libformula_jar" - LIBFORMULA_JAR="$withval" + withval=$with_libformula_jar; LIBFORMULA_JAR="$withval" + +fi -fi; -# Check whether --with-librepository-jar or --without-librepository-jar was given. +# Check whether --with-librepository-jar was given. if test "${with_librepository_jar+set}" = set; then - withval="$with_librepository_jar" - LIBREPOSITORY_JAR="$withval" + withval=$with_librepository_jar; LIBREPOSITORY_JAR="$withval" + +fi -fi; -# Check whether --with-libfonts-jar or --without-libfonts-jar was given. +# Check whether --with-libfonts-jar was given. if test "${with_libfonts_jar+set}" = set; then - withval="$with_libfonts_jar" - LIBFONTS_JAR="$withval" + withval=$with_libfonts_jar; LIBFONTS_JAR="$withval" + +fi -fi; -# Check whether --with-libserializer-jar or --without-libserializer-jar was given. +# Check whether --with-libserializer-jar was given. if test "${with_libserializer_jar+set}" = set; then - withval="$with_libserializer_jar" - LIBSERIALIZER_JAR="$withval" + withval=$with_libserializer_jar; LIBSERIALIZER_JAR="$withval" + +fi -fi; -# Check whether --with-libbase-jar or --without-libbase-jar was given. +# Check whether --with-libbase-jar was given. if test "${with_libbase_jar+set}" = set; then - withval="$with_libbase_jar" - LIBBASE_JAR="$withval" + withval=$with_libbase_jar; LIBBASE_JAR="$withval" + +fi -fi; -# Check whether --with-system-saxon or --without-system-saxon was given. +# Check whether --with-system-saxon was given. if test "${with_system_saxon+set}" = set; then - withval="$with_system_saxon" + withval=$with_system_saxon; +fi -fi; -# Check whether --with-saxon-jar or --without-saxon-jar was given. +# Check whether --with-saxon-jar was given. if test "${with_saxon_jar+set}" = set; then - withval="$with_saxon_jar" - SAXON_JAR="$withval" + withval=$with_saxon_jar; SAXON_JAR="$withval" + +fi -fi; -# Check whether --with-system-libxslt or --without-system-libxslt was given. +# Check whether --with-system-libxslt was given. if test "${with_system_libxslt+set}" = set; then - withval="$with_system_libxslt" + withval=$with_system_libxslt; +fi -fi; -# Check whether --with-system-odbc or --without-system-odbc was given. +# Check whether --with-system-odbc was given. if test "${with_system_odbc+set}" = set; then - withval="$with_system_odbc" + withval=$with_system_odbc; +fi -fi; -# Check whether --with-system-sane or --without-system-sane was given. +# Check whether --with-system-sane was given. if test "${with_system_sane+set}" = set; then - withval="$with_system_sane" + withval=$with_system_sane; +fi -fi; -# Check whether --with-system-xrender or --without-system-xrender was given. +# Check whether --with-system-xrender was given. if test "${with_system_xrender+set}" = set; then - withval="$with_system_xrender" + withval=$with_system_xrender; +fi -fi; -# Check whether --with-system-curl or --without-system-curl was given. +# Check whether --with-system-curl was given. if test "${with_system_curl+set}" = set; then - withval="$with_system_curl" + withval=$with_system_curl; +fi -fi; -# Check whether --with-system-boost or --without-system-boost was given. +# Check whether --with-system-boost was given. if test "${with_system_boost+set}" = set; then - withval="$with_system_boost" + withval=$with_system_boost; +fi -fi; -# Check whether --with-system-vigra or --without-system-vigra was given. +# Check whether --with-system-vigra was given. if test "${with_system_vigra+set}" = set; then - withval="$with_system_vigra" + withval=$with_system_vigra; +fi -fi; -# Check whether --enable-neon or --disable-neon was given. +# Check whether --enable-neon was given. if test "${enable_neon+set}" = set; then - enableval="$enable_neon" + enableval=$enable_neon; +fi -fi; -# Check whether --enable-Xaw or --disable-Xaw was given. +# Check whether --enable-Xaw was given. if test "${enable_Xaw+set}" = set; then - enableval="$enable_Xaw" + enableval=$enable_Xaw; +fi -fi; -# Check whether --with-system-neon or --without-system-neon was given. +# Check whether --with-system-neon was given. if test "${with_system_neon+set}" = set; then - withval="$with_system_neon" + withval=$with_system_neon; +fi -fi; -# Check whether --with-system-agg or --without-system-agg was given. +# Check whether --with-system-agg was given. if test "${with_system_agg+set}" = set; then - withval="$with_system_agg" + withval=$with_system_agg; +fi -fi; -# Check whether --with-system-hunspell or --without-system-hunspell was given. +# Check whether --with-system-hunspell was given. if test "${with_system_hunspell+set}" = set; then - withval="$with_system_hunspell" + withval=$with_system_hunspell; +fi -fi; -# Check whether --with-system-mythes or --without-system-mythes was given. +# Check whether --with-system-mythes was given. if test "${with_system_mythes+set}" = set; then - withval="$with_system_mythes" + withval=$with_system_mythes; +fi -fi; -# Check whether --with-system-altlinuxhyph or --without-system-altlinuxhyph was given. +# Check whether --with-system-altlinuxhyph was given. if test "${with_system_altlinuxhyph+set}" = set; then - withval="$with_system_altlinuxhyph" + withval=$with_system_altlinuxhyph; +fi -fi; -# Check whether --with-system-lpsolve or --without-system-lpsolve was given. +# Check whether --with-system-lpsolve was given. if test "${with_system_lpsolve+set}" = set; then - withval="$with_system_lpsolve" + withval=$with_system_lpsolve; +fi -fi; -# Check whether --with-system-mozilla or --without-system-mozilla was given. +# Check whether --with-system-mozilla was given. if test "${with_system_mozilla+set}" = set; then - withval="$with_system_mozilla" - WITH_SYSTEM_MOZILLA=$withval + withval=$with_system_mozilla; WITH_SYSTEM_MOZILLA=$withval else WITH_SYSTEM_MOZILLA=no -fi; +fi + -# Check whether --with-stlport or --without-stlport was given. +# Check whether --with-stlport was given. if test "${with_stlport+set}" = set; then - withval="$with_stlport" - WITH_STLPORT=$withval + withval=$with_stlport; WITH_STLPORT=$withval else WITH_STLPORT=auto -fi; +fi + -# Check whether --with-jdk-home or --without-jdk-home was given. +# Check whether --with-jdk-home was given. if test "${with_jdk_home+set}" = set; then - withval="$with_jdk_home" + withval=$with_jdk_home; +fi -fi; -# Check whether --with-gxx_include_path or --without-gxx_include_path was given. +# Check whether --with-gxx_include_path was given. if test "${with_gxx_include_path+set}" = set; then - withval="$with_gxx_include_path" + withval=$with_gxx_include_path; +fi -fi; -# Check whether --with-java or --without-java was given. +# Check whether --with-java was given. if test "${with_java+set}" = set; then - withval="$with_java" - if test "$withval" = "yes"; then WITH_JAVA=java; else WITH_JAVA=$withval; fi + withval=$with_java; if test "$withval" = "yes"; then WITH_JAVA=java; else WITH_JAVA=$withval; fi else WITH_JAVA=java -fi; -# Check whether --enable-gcjaot or --disable-gcjaot was given. +fi + +# Check whether --enable-gcjaot was given. if test "${enable_gcjaot+set}" = set; then - enableval="$enable_gcjaot" + enableval=$enable_gcjaot; +fi -fi; -# Check whether --with-ant-home or --without-ant-home was given. +# Check whether --with-ant-home was given. if test "${with_ant_home+set}" = set; then - withval="$with_ant_home" + withval=$with_ant_home; +fi -fi; -# Check whether --with-perl-home or --without-perl-home was given. +# Check whether --with-perl-home was given. if test "${with_perl_home+set}" = set; then - withval="$with_perl_home" + withval=$with_perl_home; +fi -fi; -# Check whether --with-cl-home or --without-cl-home was given. +# Check whether --with-cl-home was given. if test "${with_cl_home+set}" = set; then - withval="$with_cl_home" + withval=$with_cl_home; +fi -fi; -# Check whether --with-mspdb-path or --without-mspdb-path was given. +# Check whether --with-mspdb-path was given. if test "${with_mspdb_path+set}" = set; then - withval="$with_mspdb_path" + withval=$with_mspdb_path; +fi -fi; -# Check whether --with-midl-path or --without-midl-path was given. +# Check whether --with-midl-path was given. if test "${with_midl_path+set}" = set; then - withval="$with_midl_path" + withval=$with_midl_path; +fi -fi; -# Check whether --with-csc-path or --without-csc-path was given. +# Check whether --with-csc-path was given. if test "${with_csc_path+set}" = set; then - withval="$with_csc_path" + withval=$with_csc_path; +fi -fi; -# Check whether --with-nsis-path or --without-nsis-path was given. +# Check whether --with-nsis-path was given. if test "${with_nsis_path+set}" = set; then - withval="$with_nsis_path" + withval=$with_nsis_path; +fi -fi; -# Check whether --with-frame-home or --without-frame-home was given. +# Check whether --with-frame-home was given. if test "${with_frame_home+set}" = set; then - withval="$with_frame_home" + withval=$with_frame_home; +fi -fi; -# Check whether --with-psdk-home or --without-psdk-home was given. +# Check whether --with-psdk-home was given. if test "${with_psdk_home+set}" = set; then - withval="$with_psdk_home" + withval=$with_psdk_home; +fi -fi; -# Check whether --with-directx-home or --without-directx-home was given. +# Check whether --with-directx-home was given. if test "${with_directx_home+set}" = set; then - withval="$with_directx_home" + withval=$with_directx_home; +fi -fi; -# Check whether --with-local-solenv or --without-local-solenv was given. +# Check whether --with-local-solenv was given. if test "${with_local_solenv+set}" = set; then - withval="$with_local_solenv" + withval=$with_local_solenv; +fi -fi; -# Check whether --with-local-solver or --without-local-solver was given. +# Check whether --with-local-solver was given. if test "${with_local_solver+set}" = set; then - withval="$with_local_solver" + withval=$with_local_solver; +fi -fi; -# Check whether --enable-check-only or --disable-check-only was given. +# Check whether --enable-check-only was given. if test "${enable_check_only+set}" = set; then - enableval="$enable_check_only" + enableval=$enable_check_only; +fi -fi; -# Check whether --with-lang or --without-lang was given. +# Check whether --with-lang was given. if test "${with_lang+set}" = set; then - withval="$with_lang" + withval=$with_lang; +fi -fi; -# Check whether --with-poor-help-localizations or --without-poor-help-localizations was given. +# Check whether --with-poor-help-localizations was given. if test "${with_poor_help_localizations+set}" = set; then - withval="$with_poor_help_localizations" + withval=$with_poor_help_localizations; +fi -fi; -# Check whether --with-dict or --without-dict was given. +# Check whether --with-dict was given. if test "${with_dict+set}" = set; then - withval="$with_dict" + withval=$with_dict; +fi -fi; -# Check whether --with-intro-bitmaps or --without-intro-bitmaps was given. +# Check whether --with-intro-bitmaps was given. if test "${with_intro_bitmaps+set}" = set; then - withval="$with_intro_bitmaps" + withval=$with_intro_bitmaps; +fi -fi; -# Check whether --with-about-bitmaps or --without-about-bitmaps was given. +# Check whether --with-about-bitmaps was given. if test "${with_about_bitmaps+set}" = set; then - withval="$with_about_bitmaps" + withval=$with_about_bitmaps; +fi -fi; -# Check whether --with-vendor or --without-vendor was given. +# Check whether --with-vendor was given. if test "${with_vendor+set}" = set; then - withval="$with_vendor" + withval=$with_vendor; +fi -fi; -# Check whether --with-unix-wrapper or --without-unix-wrapper was given. +# Check whether --with-unix-wrapper was given. if test "${with_unix_wrapper+set}" = set; then - withval="$with_unix_wrapper" + withval=$with_unix_wrapper; +fi -fi; -# Check whether --with-asm-home or --without-asm-home was given. +# Check whether --with-asm-home was given. if test "${with_asm_home+set}" = set; then - withval="$with_asm_home" + withval=$with_asm_home; +fi -fi; -# Check whether --with-os-version or --without-os-version was given. +# Check whether --with-os-version was given. if test "${with_os_version+set}" = set; then - withval="$with_os_version" + withval=$with_os_version; +fi -fi; -# Check whether --with-unzip-home or --without-unzip-home was given. +# Check whether --with-unzip-home was given. if test "${with_unzip_home+set}" = set; then - withval="$with_unzip_home" + withval=$with_unzip_home; +fi -fi; -# Check whether --with-zip-home or --without-zip-home was given. +# Check whether --with-zip-home was given. if test "${with_zip_home+set}" = set; then - withval="$with_zip_home" + withval=$with_zip_home; +fi -fi; -# Check whether --with-mingwin or --without-mingwin was given. +# Check whether --with-mingwin was given. if test "${with_mingwin+set}" = set; then - withval="$with_mingwin" - WITH_MINGWIN=$withval + withval=$with_mingwin; WITH_MINGWIN=$withval else WITH_MINGWIN=0 -fi; +fi -# Check whether --with-use-shell or --without-use-shell was given. + +# Check whether --with-use-shell was given. if test "${with_use_shell+set}" = set; then - withval="$with_use_shell" - with_use_shell=$withval + withval=$with_use_shell; with_use_shell=$withval else with_use_shell="tcsh" -fi; +fi -# Check whether --with-build-version or --without-build-version was given. + +# Check whether --with-build-version was given. if test "${with_build_version+set}" = set; then - withval="$with_build_version" - with_build_version=$withval -fi; -# Check whether --enable-sgistl or --disable-sgistl was given. + withval=$with_build_version; with_build_version=$withval +fi + +# Check whether --enable-sgistl was given. if test "${enable_sgistl+set}" = set; then - enableval="$enable_sgistl" + enableval=$enable_sgistl; +fi -fi; -# Check whether --with-alloc or --without-alloc was given. +# Check whether --with-alloc was given. if test "${with_alloc+set}" = set; then - withval="$with_alloc" + withval=$with_alloc; +fi -fi; -# Check whether --enable-verbose or --disable-verbose was given. +# Check whether --enable-verbose was given. if test "${enable_verbose+set}" = set; then - enableval="$enable_verbose" + enableval=$enable_verbose; +fi -fi; BUILD_TYPE="OOo" @@ -2855,29 +3857,148 @@ echo "* *" echo "********************************************************************" echo "" cat /dev/null > warn -echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -if test "${ac_cv_prog_egrep+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' +{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if test "${ac_cv_path_GREP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done +done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:$LINENO: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done +done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } + fi +else + ac_cv_path_EGREP=$EGREP fi -echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -echo "${ECHO_T}$ac_cv_prog_egrep" >&6 - EGREP=$ac_cv_prog_egrep + + fi +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AWK+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. @@ -2888,34 +4009,36 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - echo "$as_me:$LINENO: result: $AWK" >&5 -echo "${ECHO_T}$AWK" >&6 + { $as_echo "$as_me:$LINENO: result: $AWK" >&5 +$as_echo "$AWK" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$AWK" && break done # Extract the first word of "$AWK", so it can be a program name with args. set dummy $AWK; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_AWK+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $AWK in [\\/]* | ?:[\\/]*) @@ -2928,30 +4051,31 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_AWK="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi AWK=$ac_cv_path_AWK - if test -n "$AWK"; then - echo "$as_me:$LINENO: result: $AWK" >&5 -echo "${ECHO_T}$AWK" >&6 + { $as_echo "$as_me:$LINENO: result: $AWK" >&5 +$as_echo "$AWK" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + if test -z "$AWK"; then - { { echo "$as_me:$LINENO: error: install awk to run this script" >&5 -echo "$as_me: error: install awk to run this script" >&2;} + { { $as_echo "$as_me:$LINENO: error: install awk to run this script" >&5 +$as_echo "$as_me: error: install awk to run this script" >&2;} { (exit 1); exit 1; }; } fi @@ -2959,10 +4083,10 @@ for ac_prog in sed do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_SED+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $SED in [\\/]* | ?:[\\/]*) @@ -2975,46 +4099,47 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_SED="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi SED=$ac_cv_path_SED - if test -n "$SED"; then - echo "$as_me:$LINENO: result: $SED" >&5 -echo "${ECHO_T}$SED" >&6 + { $as_echo "$as_me:$LINENO: result: $SED" >&5 +$as_echo "$SED" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$SED" && break done if test -z "$SED"; then - { { echo "$as_me:$LINENO: error: install sed to run this script" >&5 -echo "$as_me: error: install sed to run this script" >&2;} + { { $as_echo "$as_me:$LINENO: error: install sed to run this script" >&5 +$as_echo "$as_me: error: install sed to run this script" >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: checking for solenv environment" >&5 -echo $ECHO_N "checking for solenv environment... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for solenv environment" >&5 +$as_echo_n "checking for solenv environment... " >&6; } if test -z "$with_local_solenv"; then LOCAL_SOLENV="DEFAULT" - echo "$as_me:$LINENO: result: default" >&5 -echo "${ECHO_T}default" >&6 + { $as_echo "$as_me:$LINENO: result: default" >&5 +$as_echo "default" >&6; } else LOCAL_SOLENV=$with_local_solenv - echo "$as_me:$LINENO: result: $with_local_solenv" >&5 -echo "${ECHO_T}$with_local_solenv" >&6 + { $as_echo "$as_me:$LINENO: result: $with_local_solenv" >&5 +$as_echo "$with_local_solenv" >&6; } fi @@ -3032,110 +4157,160 @@ if test -e $_solenv/inc/minor.mk; then SOURCEVERSION="`grep SOURCEVERSION= $_solenv/inc/minor.mk | $AWK -F"=" '{ print $2 }'`" else - { { echo "$as_me:$LINENO: error: $_solenv/inc/minor.mk missing but needed for architecture/os detecion and proper environment script generation..." >&5 -echo "$as_me: error: $_solenv/inc/minor.mk missing but needed for architecture/os detecion and proper environment script generation..." >&2;} + { { $as_echo "$as_me:$LINENO: error: $_solenv/inc/minor.mk missing but needed for architecture/os detecion and proper environment script generation..." >&5 +$as_echo "$as_me: error: $_solenv/inc/minor.mk missing but needed for architecture/os detecion and proper environment script generation..." >&2;} { (exit 1); exit 1; }; } fi ac_aux_dir= -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/install-sh; then +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break - elif test -f $ac_dir/install.sh; then + elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break - elif test -f $ac_dir/shtool; then + elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 -echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi -ac_config_guess="$SHELL $ac_aux_dir/config.guess" -ac_config_sub="$SHELL $ac_aux_dir/config.sub" -ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + # Make sure we can run config.sub. -$ac_config_sub sun4 >/dev/null 2>&1 || - { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 -echo "$as_me: error: cannot run $ac_config_sub" >&2;} +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 +$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } -echo "$as_me:$LINENO: checking build system type" >&5 -echo $ECHO_N "checking build system type... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } if test "${ac_cv_build+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - ac_cv_build_alias=$build_alias -test -z "$ac_cv_build_alias" && - ac_cv_build_alias=`$ac_config_guess` -test -z "$ac_cv_build_alias" && - { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 -echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } -ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 +$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -echo "${ECHO_T}$ac_cv_build" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 +$as_echo "$as_me: error: invalid value of canonical build" >&2;} + { (exit 1); exit 1; }; };; +esac build=$ac_cv_build -build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - - -echo "$as_me:$LINENO: checking host system type" >&5 -echo $ECHO_N "checking host system type... $ECHO_C" >&6 +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:$LINENO: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } if test "${ac_cv_host+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - ac_cv_host_alias=$host_alias -test -z "$ac_cv_host_alias" && - ac_cv_host_alias=$ac_cv_build_alias -ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 +$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } +fi fi -echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -echo "${ECHO_T}$ac_cv_host" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 +$as_echo "$as_me: error: invalid value of canonical host" >&2;} + { (exit 1); exit 1; }; };; +esac host=$ac_cv_host -host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - - -echo "$as_me:$LINENO: checking target system type" >&5 -echo $ECHO_N "checking target system type... $ECHO_C" >&6 +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:$LINENO: checking target system type" >&5 +$as_echo_n "checking target system type... " >&6; } if test "${ac_cv_target+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - ac_cv_target_alias=$target_alias -test "x$ac_cv_target_alias" = "x" && - ac_cv_target_alias=$ac_cv_host_alias -ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} + if test "x$target_alias" = x; then + ac_cv_target=$ac_cv_host +else + ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || + { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 +$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} { (exit 1); exit 1; }; } +fi fi -echo "$as_me:$LINENO: result: $ac_cv_target" >&5 -echo "${ECHO_T}$ac_cv_target" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_target" >&5 +$as_echo "$ac_cv_target" >&6; } +case $ac_cv_target in +*-*-*) ;; +*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 +$as_echo "$as_me: error: invalid value of canonical target" >&2;} + { (exit 1); exit 1; }; };; +esac target=$ac_cv_target -target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_target +shift +target_cpu=$1 +target_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +target_os=$* +IFS=$ac_save_IFS +case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac # The aliases save the names the user supplied, while $host etc. @@ -3146,20 +4321,20 @@ test -n "$target_alias" && program_prefix=${target_alias}- if test "$build" != "$host" -o "$build" != "$target" \ -o "$host" != "$target"; then - { echo "$as_me:$LINENO: WARNING: cross-compiling by any means is not supported (yet)!" >&5 -echo "$as_me: WARNING: cross-compiling by any means is not supported (yet)!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cross-compiling by any means is not supported (yet)!" >&5 +$as_echo "$as_me: WARNING: cross-compiling by any means is not supported (yet)!" >&2;} echo "cross-compiling by any means is not supported (yet)!" >> warn fi if echo "$build_os" | grep cygwin; then - echo "$as_me:$LINENO: checking Cygwin version" >&5 -echo $ECHO_N "checking Cygwin version... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking Cygwin version" >&5 +$as_echo_n "checking Cygwin version... " >&6; } CygwinVer=`uname -r` - echo "$as_me:$LINENO: result: $CygwinVer" >&5 -echo "${ECHO_T}$CygwinVer" >&6 + { $as_echo "$as_me:$LINENO: result: $CygwinVer" >&5 +$as_echo "$CygwinVer" >&6; } if test "`echo $CygwinVer | $AWK -F . '{ print $1$2 }'`" -lt "15"; then - { { echo "$as_me:$LINENO: error: You need at least Cygwin V1.5.x" >&5 -echo "$as_me: error: You need at least Cygwin V1.5.x" >&2;} + { { $as_echo "$as_me:$LINENO: error: You need at least Cygwin V1.5.x" >&5 +$as_echo "$as_me: error: You need at least Cygwin V1.5.x" >&2;} { (exit 1); exit 1; }; } fi else @@ -3177,10 +4352,10 @@ case "$build_os" in _os=SunOS # Extract the first word of "gtar", so it can be a program name with args. set dummy gtar; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_GNUTAR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $GNUTAR in [\\/]* | ?:[\\/]*) @@ -3194,54 +4369,55 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GNUTAR="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi GNUTAR=$ac_cv_path_GNUTAR - if test -n "$GNUTAR"; then - echo "$as_me:$LINENO: result: $GNUTAR" >&5 -echo "${ECHO_T}$GNUTAR" >&6 + { $as_echo "$as_me:$LINENO: result: $GNUTAR" >&5 +$as_echo "$GNUTAR" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + if test -z "$GNUTAR"; then - { { echo "$as_me:$LINENO: error: gtar (gnu tar) not found but needed. Install it (SUN Freeware package)." >&5 -echo "$as_me: error: gtar (gnu tar) not found but needed. Install it (SUN Freeware package)." >&2;} + { { $as_echo "$as_me:$LINENO: error: gtar (gnu tar) not found but needed. Install it (SUN Freeware package)." >&5 +$as_echo "$as_me: error: gtar (gnu tar) not found but needed. Install it (SUN Freeware package)." >&2;} { (exit 1); exit 1; }; } fi - echo "$as_me:$LINENO: checking the Solaris operating system release" >&5 -echo $ECHO_N "checking the Solaris operating system release... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking the Solaris operating system release" >&5 +$as_echo_n "checking the Solaris operating system release... " >&6; } _os_release=`echo $build_os | $SED -e s/solaris2\.//` if test "$_os_release" -lt "6"; then - { { echo "$as_me:$LINENO: error: use solaris >= 6 to build OpenOffice.org" >&5 -echo "$as_me: error: use solaris >= 6 to build OpenOffice.org" >&2;} + { { $as_echo "$as_me:$LINENO: error: use solaris >= 6 to build OpenOffice.org" >&5 +$as_echo "$as_me: error: use solaris >= 6 to build OpenOffice.org" >&2;} { (exit 1); exit 1; }; } else - echo "$as_me:$LINENO: result: ok ($_os_release)" >&5 -echo "${ECHO_T}ok ($_os_release)" >&6 + { $as_echo "$as_me:$LINENO: result: ok ($_os_release)" >&5 +$as_echo "ok ($_os_release)" >&6; } fi - echo "$as_me:$LINENO: checking the processor type" >&5 -echo $ECHO_N "checking the processor type... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking the processor type" >&5 +$as_echo_n "checking the processor type... " >&6; } if test "$build_cpu" = "sparc" -o "$build_cpu" = "i386"; then - echo "$as_me:$LINENO: result: ok ($build_cpu)" >&5 -echo "${ECHO_T}ok ($build_cpu)" >&6 + { $as_echo "$as_me:$LINENO: result: ok ($build_cpu)" >&5 +$as_echo "ok ($build_cpu)" >&6; } else - { { echo "$as_me:$LINENO: error: only sparc and i386 processors are supported" >&5 -echo "$as_me: error: only sparc and i386 processors are supported" >&2;} + { { $as_echo "$as_me:$LINENO: error: only sparc and i386 processors are supported" >&5 +$as_echo "$as_me: error: only sparc and i386 processors are supported" >&2;} { (exit 1); exit 1; }; } fi ;; @@ -3275,8 +4451,8 @@ echo "$as_me: error: only sparc and i386 processors are supported" >&2;} test_freetype=no _os=Darwin if test "$enable_systray" = "yes" && test "$enable_gtk" != "no"; then - { echo "$as_me:$LINENO: WARNING: Disabling gtk-quickstarter - not supported on Mac. Use --disable-systray" >&5 -echo "$as_me: WARNING: Disabling gtk-quickstarter - not supported on Mac. Use --disable-systray" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: Disabling gtk-quickstarter - not supported on Mac. Use --disable-systray" >&5 +$as_echo "$as_me: WARNING: Disabling gtk-quickstarter - not supported on Mac. Use --disable-systray" >&2;} echo "Disabling gtk-quickstarter - not supported on Mac. Use --disable-systray" >>warn enable_systray=no fi @@ -3296,17 +4472,17 @@ echo "$as_me: WARNING: Disabling gtk-quickstarter - not supported on Mac. Use -- test_cups=yes test_randr=yes test_freetype=yes - echo "$as_me:$LINENO: checking the FreeBSD operating system release" >&5 -echo $ECHO_N "checking the FreeBSD operating system release... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking the FreeBSD operating system release" >&5 +$as_echo_n "checking the FreeBSD operating system release... " >&6; } if test -n "$with_os_version"; then OSVERSION="$with_os_version" else OSVERSION=`/sbin/sysctl -n kern.osreldate` fi - echo "$as_me:$LINENO: result: found OSVERSION=$OSVERSION" >&5 -echo "${ECHO_T}found OSVERSION=$OSVERSION" >&6 - echo "$as_me:$LINENO: checking which thread library to use" >&5 -echo $ECHO_N "checking which thread library to use... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: result: found OSVERSION=$OSVERSION" >&5 +$as_echo "found OSVERSION=$OSVERSION" >&6; } + { $as_echo "$as_me:$LINENO: checking which thread library to use" >&5 +$as_echo_n "checking which thread library to use... " >&6; } if test "$OSVERSION" -lt "500016"; then PTHREAD_CFLAGS="-D_THREAD_SAFE" PTHREAD_LIBS="-pthread" @@ -3317,8 +4493,8 @@ echo $ECHO_N "checking which thread library to use... $ECHO_C" >&6 PTHREAD_CFLAGS="" PTHREAD_LIBS="-pthread" fi - echo "$as_me:$LINENO: result: $PTHREAD_LIBS" >&5 -echo "${ECHO_T}$PTHREAD_LIBS" >&6 + { $as_echo "$as_me:$LINENO: result: $PTHREAD_LIBS" >&5 +$as_echo "$PTHREAD_LIBS" >&6; } _os=FreeBSD ;; osf) @@ -3352,8 +4528,8 @@ echo "${ECHO_T}$PTHREAD_LIBS" >&6 _os=AIX ;; *) - { { echo "$as_me:$LINENO: error: $_os operating system is not suitable to build OpenOffice.org!" >&5 -echo "$as_me: error: $_os operating system is not suitable to build OpenOffice.org!" >&2;} + { { $as_echo "$as_me:$LINENO: error: $_os operating system is not suitable to build OpenOffice.org!" >&5 +$as_echo "$as_me: error: $_os operating system is not suitable to build OpenOffice.org!" >&2;} { (exit 1); exit 1; }; } ;; esac @@ -3362,27 +4538,27 @@ esac -echo "$as_me:$LINENO: checking whether to enable crashdump feature" >&5 -echo $ECHO_N "checking whether to enable crashdump feature... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to enable crashdump feature" >&5 +$as_echo_n "checking whether to enable crashdump feature... " >&6; } if test "$enable_crashdump" = "yes" -o "$enable_crashdump" = "TRUE"; then ENABLE_CRASHDUMP="TRUE" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } BUILD_TYPE="$BUILD_TYPE CRASHREP" else if test "$enable_crashdump" = "STATIC"; then ENABLE_CRASHDUMP="STATIC" - echo "$as_me:$LINENO: result: yes, STATIC" >&5 -echo "${ECHO_T}yes, STATIC" >&6 + { $as_echo "$as_me:$LINENO: result: yes, STATIC" >&5 +$as_echo "yes, STATIC" >&6; } BUILD_TYPE="$BUILD_TYPE CRASHREP" else if test "$enable_crashdump" = "" -o "$enable_crashdump" = "no"; then ENABLE_CRASHDUMP="" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } else - { { echo "$as_me:$LINENO: error: --enable-crashdump only accepts yes, no, TRUE or STATIC as parameter." >&5 -echo "$as_me: error: --enable-crashdump only accepts yes, no, TRUE or STATIC as parameter." >&2;} + { { $as_echo "$as_me:$LINENO: error: --enable-crashdump only accepts yes, no, TRUE or STATIC as parameter." >&5 +$as_echo "$as_me: error: --enable-crashdump only accepts yes, no, TRUE or STATIC as parameter." >&2;} { (exit 1); exit 1; }; } fi fi @@ -3394,89 +4570,89 @@ if test "$_os" = "WINNT"; then fi if test "$_os" = "WINNT"; then - echo "$as_me:$LINENO: checking whether to use the standard non-optimizing compiler" >&5 -echo $ECHO_N "checking whether to use the standard non-optimizing compiler... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking whether to use the standard non-optimizing compiler" >&5 +$as_echo_n "checking whether to use the standard non-optimizing compiler... " >&6; } if test "$enable_cl_standard" = "" -o "$enable_cl_standard" = "no"; then VC_STANDARD="" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } else VC_STANDARD="TRUE" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } fi fi -echo "$as_me:$LINENO: checking whether to turn warnings to errors" >&5 -echo $ECHO_N "checking whether to turn warnings to errors... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to turn warnings to errors" >&5 +$as_echo_n "checking whether to turn warnings to errors... " >&6; } if test -n "$enable_werror" && test "$enable_werror" != "no"; then ENABLE_WERROR="TRUE" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - { echo "$as_me:$LINENO: WARNING: Turning warnings to errors has no effect in modules or" >&5 -echo "$as_me: WARNING: Turning warnings to errors has no effect in modules or" >&2;} - { echo "$as_me:$LINENO: WARNING: on platforms where it has been disabled explicitely" >&5 -echo "$as_me: WARNING: on platforms where it has been disabled explicitely" >&2;} + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + { $as_echo "$as_me:$LINENO: WARNING: Turning warnings to errors has no effect in modules or" >&5 +$as_echo "$as_me: WARNING: Turning warnings to errors has no effect in modules or" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: on platforms where it has been disabled explicitely" >&5 +$as_echo "$as_me: WARNING: on platforms where it has been disabled explicitely" >&2;} echo "Turning warnings to errors has no effect in modules or on platforms where it has been disabled explicitely" >> warn else ENABLE_WERROR="FALSE" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi -echo "$as_me:$LINENO: checking whether to do a debug build" >&5 -echo $ECHO_N "checking whether to do a debug build... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to do a debug build" >&5 +$as_echo_n "checking whether to do a debug build... " >&6; } if test -n "$enable_debug" && test "$enable_debug" != "no"; then ENABLE_DEBUG="TRUE" if test -z "$enable_symbols"; then enable_symbols="yes" fi - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else ENABLE_DEBUG="FALSE" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi -echo "$as_me:$LINENO: checking whether to build with additional debug utilities" >&5 -echo $ECHO_N "checking whether to build with additional debug utilities... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to build with additional debug utilities" >&5 +$as_echo_n "checking whether to build with additional debug utilities... " >&6; } if test -n "$enable_dbgutil" && test "$enable_dbgutil" != "no"; then PROEXT="" PRODUCT="" PROFULLSWITCH="" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else PRODUCT="full" PROFULLSWITCH="product=full" PROEXT=".pro" - echo "$as_me:$LINENO: result: no, full product build" >&5 -echo "${ECHO_T}no, full product build" >&6 + { $as_echo "$as_me:$LINENO: result: no, full product build" >&5 +$as_echo "no, full product build" >&6; } fi -echo "$as_me:$LINENO: checking whether to include symbols into final build" >&5 -echo $ECHO_N "checking whether to include symbols into final build... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to include symbols into final build" >&5 +$as_echo_n "checking whether to include symbols into final build... " >&6; } if test -n "$enable_symbols" && test "$enable_symbols" != "no"; then if test "$enable_symbols" = "yes" -o "$enable_symbols" = "TRUE"; then ENABLE_SYMBOLS="TRUE" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else if test "$enable_symbols" = "SMALL" -o "$enable_symbols" = "small"; then ENABLE_SYMBOLS="SMALL" - echo "$as_me:$LINENO: result: yes, small ones" >&5 -echo "${ECHO_T}yes, small ones" >&6 + { $as_echo "$as_me:$LINENO: result: yes, small ones" >&5 +$as_echo "yes, small ones" >&6; } else if test "$enable_symbols" != "no" ; then echo enable symbols is: $enable_symbols - { { echo "$as_me:$LINENO: error: --enable-symbols only accepts yes, TRUE or SMALL as parameter." >&5 -echo "$as_me: error: --enable-symbols only accepts yes, TRUE or SMALL as parameter." >&2;} + { { $as_echo "$as_me:$LINENO: error: --enable-symbols only accepts yes, TRUE or SMALL as parameter." >&5 +$as_echo "$as_me: error: --enable-symbols only accepts yes, TRUE or SMALL as parameter." >&2;} { (exit 1); exit 1; }; } else ENABLE_SYMBOLS= @@ -3485,21 +4661,21 @@ echo "$as_me: error: --enable-symbols only accepts yes, TRUE or SMALL as paramet fi else ENABLE_SYMBOLS= - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi -echo "$as_me:$LINENO: checking whether to strip the solver or not." >&5 -echo $ECHO_N "checking whether to strip the solver or not.... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to strip the solver or not." >&5 +$as_echo_n "checking whether to strip the solver or not.... " >&6; } if test -n "$enable_strip_solver"; then if test "$enable_strip_solver" = "yes"; then DISABLE_STRIP= else if test "$enable_strip_solver" = "no"; then DISABLE_STRIP="TRUE" else - { { echo "$as_me:$LINENO: error: --disable-strip-solver only accepts yes or no as parameter." >&5 -echo "$as_me: error: --disable-strip-solver only accepts yes or no as parameter." >&2;} + { { $as_echo "$as_me:$LINENO: error: --disable-strip-solver only accepts yes or no as parameter." >&5 +$as_echo "$as_me: error: --disable-strip-solver only accepts yes or no as parameter." >&2;} { (exit 1); exit 1; }; } fi fi @@ -3512,151 +4688,151 @@ else fi -echo "$as_me:$LINENO: checking whether to enable native CUPS support" >&5 -echo $ECHO_N "checking whether to enable native CUPS support... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to enable native CUPS support" >&5 +$as_echo_n "checking whether to enable native CUPS support... " >&6; } if test "$test_cups" = "yes" -a \( "$enable_cups" = "yes" -o "$enable_cups" = "TRUE" \) ; then ENABLE_CUPS="TRUE" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else ENABLE_CUPS="" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi -echo "$as_me:$LINENO: checking whether to enable fontconfig support" >&5 -echo $ECHO_N "checking whether to enable fontconfig support... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to enable fontconfig support" >&5 +$as_echo_n "checking whether to enable fontconfig support... " >&6; } if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a \( "$enable_fontconfig" = "yes" -o "$enable_fontconfig" = "TRUE" \); then ENABLE_FONTCONFIG="TRUE" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else ENABLE_FONTCONFIG="" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi -echo "$as_me:$LINENO: checking whether to enable filters for legacy binary file formats (StarOffice 5.2)" >&5 -echo $ECHO_N "checking whether to enable filters for legacy binary file formats (StarOffice 5.2)... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to enable filters for legacy binary file formats (StarOffice 5.2)" >&5 +$as_echo_n "checking whether to enable filters for legacy binary file formats (StarOffice 5.2)... " >&6; } if test "$enable_binfilter" = "no"; then WITH_BINFILTER="NO" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } else WITH_BINFILTER="YES" BUILD_TYPE="$BUILD_TYPE BINFILTER" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } fi if test "$_os" = "WINNT"; then - echo "$as_me:$LINENO: checking whether to use DirectX" >&5 -echo $ECHO_N "checking whether to use DirectX... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking whether to use DirectX" >&5 +$as_echo_n "checking whether to use DirectX... " >&6; } if test "$enable_directx" = "yes" -o "$enable_directx" = "TRUE" -o "$enable_directx" = ""; then ENABLE_DIRECTX="TRUE" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else ENABLE_DIRECTX="" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi - echo "$as_me:$LINENO: checking whether to use ActiveX" >&5 -echo $ECHO_N "checking whether to use ActiveX... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking whether to use ActiveX" >&5 +$as_echo_n "checking whether to use ActiveX... " >&6; } if test "$enable_activex" = "yes" -o "$enable_activex" = "TRUE" -o "$enable_activex" = ""; then DISABLE_ACTIVEX="" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else DISABLE_ACTIVEX="TRUE" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi - echo "$as_me:$LINENO: checking whether to use ATL" >&5 -echo $ECHO_N "checking whether to use ATL... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking whether to use ATL" >&5 +$as_echo_n "checking whether to use ATL... " >&6; } if test "$enable_atl" = "yes" -o "$enable_atl" = "TRUE" -o "$enable_atl" = ""; then DISABLE_ATL="" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else DISABLE_ATL="TRUE" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi fi -echo "$as_me:$LINENO: checking whether to use RPATH in shared libraries" >&5 -echo $ECHO_N "checking whether to use RPATH in shared libraries... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to use RPATH in shared libraries" >&5 +$as_echo_n "checking whether to use RPATH in shared libraries... " >&6; } if test "$enable_rpath" = "no"; then ENABLE_RPATH="no" else ENABLE_RPATH="yes" fi -echo "$as_me:$LINENO: result: $ENABLE_RPATH" >&5 -echo "${ECHO_T}$ENABLE_RPATH" >&6 +{ $as_echo "$as_me:$LINENO: result: $ENABLE_RPATH" >&5 +$as_echo "$ENABLE_RPATH" >&6; } -echo "$as_me:$LINENO: checking whether to include MySpell dictionaries" >&5 -echo $ECHO_N "checking whether to include MySpell dictionaries... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to include MySpell dictionaries" >&5 +$as_echo_n "checking whether to include MySpell dictionaries... " >&6; } if test -z "$with_myspell_dicts" || test "$with_myspell_dicts" = "yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } WITH_MYSPELL_DICTS=YES BUILD_TYPE="$BUILD_TYPE DICTIONARIES" else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } WITH_MYSPELL_DICTS=NO fi if test "$WITH_MYSPELL_DICTS" = "NO"; then - echo "$as_me:$LINENO: checking whether to use dicts from external paths" >&5 -echo $ECHO_N "checking whether to use dicts from external paths... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking whether to use dicts from external paths" >&5 +$as_echo_n "checking whether to use dicts from external paths... " >&6; } if test -n "$with_system_dicts" -a "$with_system_dicts" = "yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } SYSTEM_DICTS=YES - echo "$as_me:$LINENO: checking for spelling dictionary directory" >&5 -echo $ECHO_N "checking for spelling dictionary directory... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for spelling dictionary directory" >&5 +$as_echo_n "checking for spelling dictionary directory... " >&6; } if test -n "$with_external_dict_dir"; then DICT_SYSTEM_DIR=file://$with_external_dict_dir else DICT_SYSTEM_DIR=file:///usr/share/hunspell fi - echo "$as_me:$LINENO: result: $DICT_SYSTEM_DIR" >&5 -echo "${ECHO_T}$DICT_SYSTEM_DIR" >&6 - echo "$as_me:$LINENO: checking for hyphenation patterns directory" >&5 -echo $ECHO_N "checking for hyphenation patterns directory... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: result: $DICT_SYSTEM_DIR" >&5 +$as_echo "$DICT_SYSTEM_DIR" >&6; } + { $as_echo "$as_me:$LINENO: checking for hyphenation patterns directory" >&5 +$as_echo_n "checking for hyphenation patterns directory... " >&6; } if test -n "$with_external_hyph_dir"; then HYPH_SYSTEM_DIR=file://$with_external_hyph_dir else HYPH_SYSTEM_DIR=file:///usr/share/hyphen fi - echo "$as_me:$LINENO: result: $HYPH_SYSTEM_DIR" >&5 -echo "${ECHO_T}$HYPH_SYSTEM_DIR" >&6 - echo "$as_me:$LINENO: checking for thesaurus directory" >&5 -echo $ECHO_N "checking for thesaurus directory... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: result: $HYPH_SYSTEM_DIR" >&5 +$as_echo "$HYPH_SYSTEM_DIR" >&6; } + { $as_echo "$as_me:$LINENO: checking for thesaurus directory" >&5 +$as_echo_n "checking for thesaurus directory... " >&6; } if test -n "$with_external_thes_dir"; then THES_SYSTEM_DIR=file://$with_external_thes_dir else THES_SYSTEM_DIR=file:///usr/share/mythes fi - echo "$as_me:$LINENO: result: $THES_SYSTEM_DIR" >&5 -echo "${ECHO_T}$THES_SYSTEM_DIR" >&6 + { $as_echo "$as_me:$LINENO: result: $THES_SYSTEM_DIR" >&5 +$as_echo "$THES_SYSTEM_DIR" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } SYSTEM_DICTS=NO fi fi @@ -3665,19 +4841,19 @@ fi -echo "$as_me:$LINENO: checking which shell to use" >&5 -echo $ECHO_N "checking which shell to use... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking which shell to use" >&5 +$as_echo_n "checking which shell to use... " >&6; } if test $_os = "WINNT"; then if test "$with_use_shell" != "tcsh" -a "$with_use_shell" != "bash" -a "$with_use_shell" != "4nt"; then - { { echo "$as_me:$LINENO: error: only \"tcsh\",\"bash\" or \"4nt\" are supported options" >&5 -echo "$as_me: error: only \"tcsh\",\"bash\" or \"4nt\" are supported options" >&2;} + { { $as_echo "$as_me:$LINENO: error: only \"tcsh\",\"bash\" or \"4nt\" are supported options" >&5 +$as_echo "$as_me: error: only \"tcsh\",\"bash\" or \"4nt\" are supported options" >&2;} { (exit 1); exit 1; }; } fi if test -L $AWK -o -L `which awk` -o -L `which tar` -o -L `which gunzip` ; then - { { echo "$as_me:$LINENO: error: $AWK, awk, tar or gunzip is a cygwin symlink! + { { $as_echo "$as_me:$LINENO: error: $AWK, awk, tar or gunzip is a cygwin symlink! Native windows programs cannot use cygwin symlinks. Remove the symbolic link, and copy the program to the name of the link." >&5 -echo "$as_me: error: $AWK, awk, tar or gunzip is a cygwin symlink! +$as_echo "$as_me: error: $AWK, awk, tar or gunzip is a cygwin symlink! Native windows programs cannot use cygwin symlinks. Remove the symbolic link, and copy the program to the name of the link." >&2;} { (exit 1); exit 1; }; } @@ -3700,32 +4876,32 @@ link, and copy the program to the name of the link." >&2;} fi elif test $_os = "OS2"; then if test "$with_use_shell" != "tcsh" -a "$with_use_shell" != "4nt"; then - { { echo "$as_me:$LINENO: error: only \"tcsh\" or \"4nt\" are supported options" >&5 -echo "$as_me: error: only \"tcsh\" or \"4nt\" are supported options" >&2;} + { { $as_echo "$as_me:$LINENO: error: only \"tcsh\" or \"4nt\" are supported options" >&5 +$as_echo "$as_me: error: only \"tcsh\" or \"4nt\" are supported options" >&2;} { (exit 1); exit 1; }; } fi else if test "$with_use_shell" != "tcsh" -a "$with_use_shell" != "bash"; then - { { echo "$as_me:$LINENO: error: only \"tcsh\" or \"bash\" are supported options" >&5 -echo "$as_me: error: only \"tcsh\" or \"bash\" are supported options" >&2;} + { { $as_echo "$as_me:$LINENO: error: only \"tcsh\" or \"bash\" are supported options" >&5 +$as_echo "$as_me: error: only \"tcsh\" or \"bash\" are supported options" >&2;} { (exit 1); exit 1; }; } fi fi USE_SHELL="$with_use_shell" -echo "$as_me:$LINENO: result: $USE_SHELL" >&5 -echo "${ECHO_T}$USE_SHELL" >&6 +{ $as_echo "$as_me:$LINENO: result: $USE_SHELL" >&5 +$as_echo "$USE_SHELL" >&6; } if test "$_os" = "WINNT" -a "$with_use_shell" != "4nt" ; then - echo "$as_me:$LINENO: checking for cygwin gcc/g++" >&5 -echo $ECHO_N "checking for cygwin gcc/g++... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for cygwin gcc/g++" >&5 +$as_echo_n "checking for cygwin gcc/g++... " >&6; } if which gcc > /dev/null && which g++ > /dev/null ; then - echo "$as_me:$LINENO: result: found" >&5 -echo "${ECHO_T}found" >&6 + { $as_echo "$as_me:$LINENO: result: found" >&5 +$as_echo "found" >&6; } else - { { echo "$as_me:$LINENO: error: cygwin gcc and g++ are needed, please install them." >&5 -echo "$as_me: error: cygwin gcc and g++ are needed, please install them." >&2;} + { { $as_echo "$as_me:$LINENO: error: cygwin gcc and g++ are needed, please install them." >&5 +$as_echo "$as_me: error: cygwin gcc and g++ are needed, please install them." >&2;} { (exit 1); exit 1; }; } fi fi @@ -3734,10 +4910,10 @@ fi if test "$with_use_shell" = "tcsh"; then # Extract the first word of "tcsh", so it can be a program name with args. set dummy tcsh; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_SHELLPATH+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $SHELLPATH in [\\/]* | ?:[\\/]*) @@ -3750,30 +4926,31 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_SHELLPATH="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi SHELLPATH=$ac_cv_path_SHELLPATH - if test -n "$SHELLPATH"; then - echo "$as_me:$LINENO: result: $SHELLPATH" >&5 -echo "${ECHO_T}$SHELLPATH" >&6 + { $as_echo "$as_me:$LINENO: result: $SHELLPATH" >&5 +$as_echo "$SHELLPATH" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + if test -z "$SHELLPATH"; then - { { echo "$as_me:$LINENO: error: tcsh not found in \$PATH" >&5 -echo "$as_me: error: tcsh not found in \$PATH" >&2;} + { { $as_echo "$as_me:$LINENO: error: tcsh not found in \$PATH" >&5 +$as_echo "$as_me: error: tcsh not found in \$PATH" >&2;} { (exit 1); exit 1; }; } else SHELLPATH=`echo $SHELLPATH | $SED -n "s/\/tcsh$//p"` @@ -3781,10 +4958,10 @@ echo "$as_me: error: tcsh not found in \$PATH" >&2;} elif test "$with_use_shell" = "bash"; then # Extract the first word of "bash", so it can be a program name with args. set dummy bash; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_SHELLPATH+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $SHELLPATH in [\\/]* | ?:[\\/]*) @@ -3797,50 +4974,51 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_SHELLPATH="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi SHELLPATH=$ac_cv_path_SHELLPATH - if test -n "$SHELLPATH"; then - echo "$as_me:$LINENO: result: $SHELLPATH" >&5 -echo "${ECHO_T}$SHELLPATH" >&6 + { $as_echo "$as_me:$LINENO: result: $SHELLPATH" >&5 +$as_echo "$SHELLPATH" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + if test -z "$SHELLPATH"; then - { { echo "$as_me:$LINENO: error: bash not found in \$PATH" >&5 -echo "$as_me: error: bash not found in \$PATH" >&2;} + { { $as_echo "$as_me:$LINENO: error: bash not found in \$PATH" >&5 +$as_echo "$as_me: error: bash not found in \$PATH" >&2;} { (exit 1); exit 1; }; } else SHELLPATH=`echo $SHELLPATH | $SED -n "s/\/bash$//p"` fi else - { echo "$as_me:$LINENO: WARNING: Windows/OS/2 4NT builds don't test for the shell" >&5 -echo "$as_me: WARNING: Windows/OS/2 4NT builds don't test for the shell" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: Windows/OS/2 4NT builds don't test for the shell" >&5 +$as_echo "$as_me: WARNING: Windows/OS/2 4NT builds don't test for the shell" >&2;} SHELLPATH="NO_SHELLPATH_NEEDED" fi -echo "$as_me:$LINENO: checking gcc home" >&5 -echo $ECHO_N "checking gcc home... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking gcc home" >&5 +$as_echo_n "checking gcc home... " >&6; } if test -z "$with_gcc_home"; then GCC_HOME=`which gcc | $SED -e s,/bin/gcc,,` else GCC_HOME="$with_gcc_home" fi -echo "$as_me:$LINENO: result: $GCC_HOME" >&5 -echo "${ECHO_T}$GCC_HOME" >&6 +{ $as_echo "$as_me:$LINENO: result: $GCC_HOME" >&5 +$as_echo "$GCC_HOME" >&6; } if test -n "$with_gcc_home"; then @@ -3858,10 +5036,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -3872,34 +5050,36 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -3910,38 +5090,49 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -3952,76 +5143,36 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi + fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -4033,17 +5184,18 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. @@ -4061,24 +5213,25 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -4089,38 +5242,40 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -4131,62 +5286,93 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$ac_ct_CC" && break done - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi fi fi -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH +$as_echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } # Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 +$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -4202,111 +5388,150 @@ main () } _ACEOF ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe b.out" +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -echo "$as_me:$LINENO: checking for C compiler default output" >&5 -echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 -ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 - (eval $ac_link_default) 2>&5 +{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { (ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link_default") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - # Find the output, starting from the most likely. This scheme is -# not robust to junk in `.', hence go to wildcards (a.*) only as a last -# resort. - -# Be careful to initialize this variable, since it used to be cached. -# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. -ac_cv_exeext= -# b.out is created by i960 compilers. -for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) - ;; - conftest.$ac_ext ) - # This is the source file. - ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; + # We found the default executable, but exeext='' is most + # certainly right. + break;; *.* ) - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool, - # but it would be cool to find out if it's true. Does anybody - # maintain Libtool? --akim. - export ac_cv_exeext - break;; + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; * ) - break;; + break;; esac done +test "$ac_cv_exeext" = no && ac_cv_exeext= + else - echo "$as_me: failed program was:" >&5 + ac_file='' +fi + +{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +if test -z "$ac_file"; then + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 -echo "$as_me: error: C compiler cannot create executables +$as_echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } fi ac_exeext=$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6 -# Check the compiler produces executables we can run. If not, either +# Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { echo "$as_me:$LINENO: error: cannot run C compiled programs. + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run C compiled programs. +$as_echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi fi fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +{ $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } -rm -f a.out a.exe conftest$ac_cv_exeext b.out +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -# Check the compiler produces executables we can run. If not, either +# Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6 - -echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will @@ -4315,35 +5540,35 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext - break;; + break;; * ) break;; esac done else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi rm -f conftest$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } if test "${ac_cv_objext+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -4359,42 +5584,50 @@ main () } _ACEOF rm -f conftest.o conftest.obj -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile +$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -4413,41 +5646,93 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_compiler_gnu=no + ac_compiler_gnu=no fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 -GCC=`test $ac_compiler_gnu = yes && echo yes` +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -CFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -4463,28 +5748,82 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_prog_cc_g=no + fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -4500,15 +5839,14 @@ else CFLAGS= fi fi -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then + $as_echo_n "(cached) " >&6 else - ac_cv_prog_cc_stdc=no + ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -4536,6 +5874,21 @@ static char *f (char * (*g) (char **, int), char **p, ...) va_end (v); return s; } + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; @@ -4550,168 +5903,58 @@ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; return 0; } _ACEOF -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break -else - echo "$as_me: failed program was:" >&5 + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_c89=$ac_arg +else + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.$ac_objext + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break done -rm -f conftest.$ac_ext conftest.$ac_objext +rm -f conftest.$ac_ext CC=$ac_save_CC fi - -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:$LINENO: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:$LINENO: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac -# Some people use a C++ compiler to compile C. Since we use `exit', -# in C++ we need to declare it. In case someone uses the same compiler -# for both compiling C and C++ we need to have the C++ compiler decide -# the declaration of exit, since it's the most demanding environment. -cat >conftest.$ac_ext <<_ACEOF -#ifndef __cplusplus - choke me -#endif -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - for ac_declaration in \ - ''\ - '#include ' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -continue -fi -rm -f conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h -fi - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -fi -rm -f conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -4726,10 +5969,10 @@ if test "$COMPATH" = "." ; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_COMPATH+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $COMPATH in [\\/]* | ?:[\\/]*) @@ -4742,27 +5985,28 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_COMPATH="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi COMPATH=$ac_cv_path_COMPATH - if test -n "$COMPATH"; then - echo "$as_me:$LINENO: result: $COMPATH" >&5 -echo "${ECHO_T}$COMPATH" >&6 + { $as_echo "$as_me:$LINENO: result: $COMPATH" >&5 +$as_echo "$COMPATH" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$COMPATH" && break done @@ -4771,51 +6015,50 @@ fi GCCVER=20995 if test \( "$_os" != "WINNT" -o "$WITH_MINGWIN" = "yes" \) -a "$GCC" = "yes"; then - echo "$as_me:$LINENO: checking the GNU gcc compiler version" >&5 -echo $ECHO_N "checking the GNU gcc compiler version... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking the GNU gcc compiler version" >&5 +$as_echo_n "checking the GNU gcc compiler version... " >&6; } _gcc_version=`$CC -dumpversion` _gcc_major=`echo $_gcc_version | $AWK -F. '{ print \$1 }'` _gcc_longver=`echo $_gcc_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'` GCCVER=`echo $_gcc_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'` if test "$_gcc_major" -lt "3"; then - { { echo "$as_me:$LINENO: error: found version \"$_gcc_version\", use version 3+ of the gcc compiler" >&5 -echo "$as_me: error: found version \"$_gcc_version\", use version 3+ of the gcc compiler" >&2;} + { { $as_echo "$as_me:$LINENO: error: found version \"$_gcc_version\", use version 3+ of the gcc compiler" >&5 +$as_echo "$as_me: error: found version \"$_gcc_version\", use version 3+ of the gcc compiler" >&2;} { (exit 1); exit 1; }; } else if test "$GCCVER" -eq "030203"; then if test "$ENABLE_SYMBOLS" = "SMALL"; then - { { echo "$as_me:$LINENO: error: version \"$_gcc_version\" gives internal error with small." >&5 -echo "$as_me: error: version \"$_gcc_version\" gives internal error with small." >&2;} + { { $as_echo "$as_me:$LINENO: error: version \"$_gcc_version\" gives internal error with small." >&5 +$as_echo "$as_me: error: version \"$_gcc_version\" gives internal error with small." >&2;} { (exit 1); exit 1; }; } fi fi fi - echo "$as_me:$LINENO: result: checked (gcc $_gcc_version)" >&5 -echo "${ECHO_T}checked (gcc $_gcc_version)" >&6 + { $as_echo "$as_me:$LINENO: result: checked (gcc $_gcc_version)" >&5 +$as_echo "checked (gcc $_gcc_version)" >&6; } if test "$_os" = "SunOS"; then - echo "$as_me:$LINENO: checking gcc linker" >&5 -echo $ECHO_N "checking gcc linker... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking gcc linker" >&5 +$as_echo_n "checking gcc linker... " >&6; } if $CC -Wl,--version 2>&1 |head -n 1| grep -v GNU > /dev/null;then - { { echo "$as_me:$LINENO: error: failed (not GNU ld). Use GNU ld instead of Sun ld on Solaris" >&5 -echo "$as_me: error: failed (not GNU ld). Use GNU ld instead of Sun ld on Solaris" >&2;} + { { $as_echo "$as_me:$LINENO: error: failed (not GNU ld). Use GNU ld instead of Sun ld on Solaris" >&5 +$as_echo "$as_me: error: failed (not GNU ld). Use GNU ld instead of Sun ld on Solaris" >&2;} { (exit 1); exit 1; }; } fi - echo "$as_me:$LINENO: result: ok (GNU ld)" >&5 -echo "${ECHO_T}ok (GNU ld)" >&6 + { $as_echo "$as_me:$LINENO: result: ok (GNU ld)" >&5 +$as_echo "ok (GNU ld)" >&6; } fi fi HAVE_LD_BSYMBOLIC_FUNCTIONS= if test "$GCC" = "yes"; then - echo "$as_me:$LINENO: checking for -Bsymbolic-functions linker support " >&5 -echo $ECHO_N "checking for -Bsymbolic-functions linker support ... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for -Bsymbolic-functions linker support " >&5 +$as_echo_n "checking for -Bsymbolic-functions linker support ... " >&6; } bsymbolic_functions_ldflags_save=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions -Wl,--dynamic-list-cpp-new -Wl,--dynamic-list-cpp-typeinfo" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -4835,60 +6078,73 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then HAVE_LD_BSYMBOLIC_FUNCTIONS=TRUE else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext if test "z$HAVE_LD_BSYMBOLIC_FUNCTIONS" = "zTRUE"; then - echo "$as_me:$LINENO: result: found " >&5 -echo "${ECHO_T}found " >&6 + { $as_echo "$as_me:$LINENO: result: found " >&5 +$as_echo "found " >&6; } else - echo "$as_me:$LINENO: result: not found " >&5 -echo "${ECHO_T}not found " >&6 + { $as_echo "$as_me:$LINENO: result: not found " >&5 +$as_echo "not found " >&6; } fi LDFLAGS=$bsymbolic_functions_ldflags_save fi -echo "$as_me:$LINENO: checking whether to enable pch feature" >&5 -echo $ECHO_N "checking whether to enable pch feature... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to enable pch feature" >&5 +$as_echo_n "checking whether to enable pch feature... " >&6; } if test -n "$enable_pch" && test "$enable_pch" != "no"; then if test "$_os" = "WINNT" -a "$WITH_MINGWIN" != "yes"; then ENABLE_PCH="TRUE" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } elif test "$GCC" = "yes" -a "$GCCVER" -gt "030400"; then ENABLE_PCH="TRUE" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else ENABLE_PCH="" - { echo "$as_me:$LINENO: WARNING: Precompiled header not yet supported for your platform/compiler" >&5 -echo "$as_me: WARNING: Precompiled header not yet supported for your platform/compiler" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: Precompiled header not yet supported for your platform/compiler" >&5 +$as_echo "$as_me: WARNING: Precompiled header not yet supported for your platform/compiler" >&2;} fi else ENABLE_PCH="" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi -echo "$as_me:$LINENO: checking for GNU make" >&5 -echo $ECHO_N "checking for GNU make... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for GNU make" >&5 +$as_echo_n "checking for GNU make... " >&6; } for a in "$MAKE" $GNUMAKE make gmake gnumake; do $a --version 2> /dev/null | grep GNU 2>&1 > /dev/null if test $? -eq 0; then @@ -4896,40 +6152,40 @@ for a in "$MAKE" $GNUMAKE make gmake gnumake; do break fi done -echo "$as_me:$LINENO: result: $GNUMAKE" >&5 -echo "${ECHO_T}$GNUMAKE" >&6 +{ $as_echo "$as_me:$LINENO: result: $GNUMAKE" >&5 +$as_echo "$GNUMAKE" >&6; } if test -z "$GNUMAKE"; then - { { echo "$as_me:$LINENO: error: not found. install GNU make." >&5 -echo "$as_me: error: not found. install GNU make." >&2;} + { { $as_echo "$as_me:$LINENO: error: not found. install GNU make." >&5 +$as_echo "$as_me: error: not found. install GNU make." >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: checking the GNU make version" >&5 -echo $ECHO_N "checking the GNU make version... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking the GNU make version" >&5 +$as_echo_n "checking the GNU make version... " >&6; } _make_version=`$GNUMAKE --version | grep GNU | $SED -e 's@^[^0-9]*@@' -e 's@ .*@@' -e 's@,.*@@'`; _make_longver=`echo $_make_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'` if test "$_make_longver" -ge "037901" ; then - echo "$as_me:$LINENO: result: $GNUMAKE $_make_version" >&5 -echo "${ECHO_T}$GNUMAKE $_make_version" >&6 + { $as_echo "$as_me:$LINENO: result: $GNUMAKE $_make_version" >&5 +$as_echo "$GNUMAKE $_make_version" >&6; } else if test "$_os" = "Darwin"; then if test "$_make_longver" -ge "037900" ; then - echo "$as_me:$LINENO: result: $GNUMAKE $_make_version" >&5 -echo "${ECHO_T}$GNUMAKE $_make_version" >&6 + { $as_echo "$as_me:$LINENO: result: $GNUMAKE $_make_version" >&5 +$as_echo "$GNUMAKE $_make_version" >&6; } else - { echo "$as_me:$LINENO: WARNING: failed ($GNUMAKE $_make_version need 3.79.0+)" >&5 -echo "$as_me: WARNING: failed ($GNUMAKE $_make_version need 3.79.0+)" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: failed ($GNUMAKE $_make_version need 3.79.0+)" >&5 +$as_echo "$as_me: WARNING: failed ($GNUMAKE $_make_version need 3.79.0+)" >&2;} fi else - { { echo "$as_me:$LINENO: error: failed ($GNUMAKE $_make_version need 3.79.1+)" >&5 -echo "$as_me: error: failed ($GNUMAKE $_make_version need 3.79.1+)" >&2;} + { { $as_echo "$as_me:$LINENO: error: failed ($GNUMAKE $_make_version need 3.79.1+)" >&5 +$as_echo "$as_me: error: failed ($GNUMAKE $_make_version need 3.79.1+)" >&2;} { (exit 1); exit 1; }; } fi fi -echo "$as_me:$LINENO: checking for GNU tar" >&5 -echo $ECHO_N "checking for GNU tar... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for GNU tar" >&5 +$as_echo_n "checking for GNU tar... " >&6; } for a in $GNUTAR gtar gnutar tar; do $a --version 2> /dev/null | grep GNU 2>&1 > /dev/null if test $? -eq 0; then @@ -4937,11 +6193,11 @@ for a in $GNUTAR gtar gnutar tar; do break fi done -echo "$as_me:$LINENO: result: $GNUTAR" >&5 -echo "${ECHO_T}$GNUTAR" >&6 +{ $as_echo "$as_me:$LINENO: result: $GNUTAR" >&5 +$as_echo "$GNUTAR" >&6; } if test -z "$GNUTAR"; then - { { echo "$as_me:$LINENO: error: not found. install GNU tar." >&5 -echo "$as_me: error: not found. install GNU tar." >&2;} + { { $as_echo "$as_me:$LINENO: error: not found. install GNU tar." >&5 +$as_echo "$as_me: error: not found. install GNU tar." >&2;} { (exit 1); exit 1; }; } fi @@ -4953,10 +6209,10 @@ if test "$_os" = "SunOS"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path__cc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $_cc in [\\/]* | ?:[\\/]*) @@ -4969,61 +6225,61 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path__cc="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi _cc=$ac_cv_path__cc - if test -n "$_cc"; then - echo "$as_me:$LINENO: result: $_cc" >&5 -echo "${ECHO_T}$_cc" >&6 + { $as_echo "$as_me:$LINENO: result: $_cc" >&5 +$as_echo "$_cc" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$_cc" && break done COMPATH=`echo $_cc | $SED -n "s/\/cc//p"` - echo "$as_me:$LINENO: checking the SunStudio C/C++ compiler version" >&5 -echo $ECHO_N "checking the SunStudio C/C++ compiler version... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking the SunStudio C/C++ compiler version" >&5 +$as_echo_n "checking the SunStudio C/C++ compiler version... " >&6; } _sunstudio_string=`$CC -V 2>&1 | grep '^cc' | sed -e 's/.* C //'` _sunstudio_version=`echo $_sunstudio_string | $AWK '{ print $1 }'` _sunstudio_major=`echo $_sunstudio_version | $AWK -F. '{ print $1 }'` if test "$_sunstudio_major" != "5"; then - { { echo "$as_me:$LINENO: error: found version \"$_sunstudio_version\", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler" >&5 -echo "$as_me: error: found version \"$_sunstudio_version\", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler" >&2;} + { { $as_echo "$as_me:$LINENO: error: found version \"$_sunstudio_version\", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler" >&5 +$as_echo "$as_me: error: found version \"$_sunstudio_version\", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler" >&2;} { (exit 1); exit 1; }; } else _sunstudio_minor=`echo $_sunstudio_version | $AWK -F. '{ if ($2 == 5) print "true"; else if ($2 == 7) print "true"; else if ($2 == 8) print "true"; else if ($2 == 9) print "true"; else print "false" }'` if test "$_sunstudio_minor" = "false"; then - { { echo "$as_me:$LINENO: error: found version \"$_sunstudio_version\", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler" >&5 -echo "$as_me: error: found version \"$_sunstudio_version\", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler" >&2;} + { { $as_echo "$as_me:$LINENO: error: found version \"$_sunstudio_version\", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler" >&5 +$as_echo "$as_me: error: found version \"$_sunstudio_version\", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler" >&2;} { (exit 1); exit 1; }; } else - echo "$as_me:$LINENO: result: checked" >&5 -echo "${ECHO_T}checked" >&6 + { $as_echo "$as_me:$LINENO: result: checked" >&5 +$as_echo "checked" >&6; } fi fi fi fi if test "$GCC" = "yes"; then - echo "$as_me:$LINENO: checking for --hash-style=both linker support " >&5 -echo $ECHO_N "checking for --hash-style=both linker support ... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for --hash-style=both linker support " >&5 +$as_echo_n "checking for --hash-style=both linker support ... " >&6; } hash_style_ldflags_save=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,--hash-style=both" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -5043,31 +6299,43 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then HAVE_LD_HASH_STYLE=TRUE else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -HAVE_LD_HASH_STYLE=FALSE + HAVE_LD_HASH_STYLE=FALSE fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext if test "z$HAVE_LD_HASH_STYLE" = "zTRUE"; then - echo "$as_me:$LINENO: result: found " >&5 -echo "${ECHO_T}found " >&6 + { $as_echo "$as_me:$LINENO: result: found " >&5 +$as_echo "found " >&6; } else - echo "$as_me:$LINENO: result: not found " >&5 -echo "${ECHO_T}not found " >&6 + { $as_echo "$as_me:$LINENO: result: not found " >&5 +$as_echo "not found " >&6; } fi LDFLAGS=$hash_style_ldflags_save fi @@ -5079,10 +6347,10 @@ if test "$_os" = "IRIX" -o "$_os" = "IRIX64"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path__cc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $_cc in [\\/]* | ?:[\\/]*) @@ -5095,48 +6363,49 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path__cc="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi _cc=$ac_cv_path__cc - if test -n "$_cc"; then - echo "$as_me:$LINENO: result: $_cc" >&5 -echo "${ECHO_T}$_cc" >&6 + { $as_echo "$as_me:$LINENO: result: $_cc" >&5 +$as_echo "$_cc" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$_cc" && break done COMPATH=`echo $_cc | $SED -n "s/\/cc//p"` - echo "$as_me:$LINENO: checking the SGI MIPSpro C compiler version" >&5 -echo $ECHO_N "checking the SGI MIPSpro C compiler version... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking the SGI MIPSpro C compiler version" >&5 +$as_echo_n "checking the SGI MIPSpro C compiler version... " >&6; } _mipspro_version=`$CC -version 2>&1 | $AWK '{ print $4 }'` _mipspro_major=`echo $_mipspro_version | $AWK -F. '{ print $1 }'` if test "$_mipspro_major" != "7"; then - { { echo "$as_me:$LINENO: error: found version \"$_mipspro_version\", use version 7.2+ of the SGI MIPSpro C compiler" >&5 -echo "$as_me: error: found version \"$_mipspro_version\", use version 7.2+ of the SGI MIPSpro C compiler" >&2;} + { { $as_echo "$as_me:$LINENO: error: found version \"$_mipspro_version\", use version 7.2+ of the SGI MIPSpro C compiler" >&5 +$as_echo "$as_me: error: found version \"$_mipspro_version\", use version 7.2+ of the SGI MIPSpro C compiler" >&2;} { (exit 1); exit 1; }; } else _mipspro_minor=`echo $_mipspro_version | $AWK -F. '{ if ($2 <= 1) print "false"; else print "true" }'` if test "$_mipspro_minor" = "false"; then - { { echo "$as_me:$LINENO: error: found version \"$_mipspro_version\", use version 7.2+ of the SGI MIPSpro C compiler" >&5 -echo "$as_me: error: found version \"$_mipspro_version\", use version 7.2+ of the SGI MIPSpro C compiler" >&2;} + { { $as_echo "$as_me:$LINENO: error: found version \"$_mipspro_version\", use version 7.2+ of the SGI MIPSpro C compiler" >&5 +$as_echo "$as_me: error: found version \"$_mipspro_version\", use version 7.2+ of the SGI MIPSpro C compiler" >&2;} { (exit 1); exit 1; }; } else - echo "$as_me:$LINENO: result: checked" >&5 -echo "${ECHO_T}checked" >&6 + { $as_echo "$as_me:$LINENO: result: checked" >&5 +$as_echo "checked" >&6; } fi fi fi @@ -5148,10 +6417,10 @@ if test "$_os" = "OSF1"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path__cc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $_cc in [\\/]* | ?:[\\/]*) @@ -5164,44 +6433,45 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path__cc="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi _cc=$ac_cv_path__cc - if test -n "$_cc"; then - echo "$as_me:$LINENO: result: $_cc" >&5 -echo "${ECHO_T}$_cc" >&6 + { $as_echo "$as_me:$LINENO: result: $_cc" >&5 +$as_echo "$_cc" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$_cc" && break done COMPATH=`echo $_cc | $SED -n "s/\/cc//p"` - { echo "$as_me:$LINENO: WARNING: ******* $_cc , $COMPATH" >&5 -echo "$as_me: WARNING: ******* $_cc , $COMPATH" >&2;} - echo "$as_me:$LINENO: checking the Compaq C compiler version" >&5 -echo $ECHO_N "checking the Compaq C compiler version... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: WARNING: ******* $_cc , $COMPATH" >&5 +$as_echo "$as_me: WARNING: ******* $_cc , $COMPATH" >&2;} + { $as_echo "$as_me:$LINENO: checking the Compaq C compiler version" >&5 +$as_echo_n "checking the Compaq C compiler version... " >&6; } _compaqc_version=`$CC -V 2>&1 | $AWK '{ print $3 }'` _compaqc_major=`echo $_compaqc_version | $AWK -F. '{ print $1 }'` if test "$_compaqc_major" != "T6"; then - { { echo "$as_me:$LINENO: error: found version \"$_compaqc_version\", use version 6 of the Compaq C compiler" >&5 -echo "$as_me: error: found version \"$_compaqc_version\", use version 6 of the Compaq C compiler" >&2;} + { { $as_echo "$as_me:$LINENO: error: found version \"$_compaqc_version\", use version 6 of the Compaq C compiler" >&5 +$as_echo "$as_me: error: found version \"$_compaqc_version\", use version 6 of the Compaq C compiler" >&2;} { (exit 1); exit 1; }; } else - echo "$as_me:$LINENO: result: checked" >&5 -echo "${ECHO_T}checked" >&6 + { $as_echo "$as_me:$LINENO: result: checked" >&5 +$as_echo "checked" >&6; } fi fi fi @@ -5209,10 +6479,10 @@ fi if test -z "$with_perl_home"; then # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PERL+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $PERL in [\\/]* | ?:[\\/]*) @@ -5225,27 +6495,28 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi PERL=$ac_cv_path_PERL - if test -n "$PERL"; then - echo "$as_me:$LINENO: result: $PERL" >&5 -echo "${ECHO_T}$PERL" >&6 + { $as_echo "$as_me:$LINENO: result: $PERL" >&5 +$as_echo "$PERL" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + else if test "$_os" = "WINNT"; then with_perl_home=`cygpath -u "$with_perl_home"` @@ -5254,46 +6525,46 @@ else if test -x "$_perl_path"; then PERL=$_perl_path else - { { echo "$as_me:$LINENO: error: $_perl_path not found" >&5 -echo "$as_me: error: $_perl_path not found" >&2;} + { { $as_echo "$as_me:$LINENO: error: $_perl_path not found" >&5 +$as_echo "$as_me: error: $_perl_path not found" >&2;} { (exit 1); exit 1; }; } fi fi if test "$PERL"; then - echo "$as_me:$LINENO: checking the Perl version" >&5 -echo $ECHO_N "checking the Perl version... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking the Perl version" >&5 +$as_echo_n "checking the Perl version... " >&6; } ${PERL} -e "exit($]);" _perl_version=$? if test "$_perl_version" -lt 5; then - { { echo "$as_me:$LINENO: error: found Perl version \"$_perl_version\", use version 5 of Perl" >&5 -echo "$as_me: error: found Perl version \"$_perl_version\", use version 5 of Perl" >&2;} + { { $as_echo "$as_me:$LINENO: error: found Perl version \"$_perl_version\", use version 5 of Perl" >&5 +$as_echo "$as_me: error: found Perl version \"$_perl_version\", use version 5 of Perl" >&2;} { (exit 1); exit 1; }; } fi - echo "$as_me:$LINENO: result: checked (perl $_perl_version)" >&5 -echo "${ECHO_T}checked (perl $_perl_version)" >&6 + { $as_echo "$as_me:$LINENO: result: checked (perl $_perl_version)" >&5 +$as_echo "checked (perl $_perl_version)" >&6; } else - { { echo "$as_me:$LINENO: error: Perl not found, install version 5 of Perl" >&5 -echo "$as_me: error: Perl not found, install version 5 of Perl" >&2;} + { { $as_echo "$as_me:$LINENO: error: Perl not found, install version 5 of Perl" >&5 +$as_echo "$as_me: error: Perl not found, install version 5 of Perl" >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: checking for required Perl modules" >&5 -echo $ECHO_N "checking for required Perl modules... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for required Perl modules" >&5 +$as_echo_n "checking for required Perl modules... " >&6; } if `$PERL -e 'use Archive::Zip;'`; then - echo "$as_me:$LINENO: result: all modules found" >&5 -echo "${ECHO_T}all modules found" >&6 + { $as_echo "$as_me:$LINENO: result: all modules found" >&5 +$as_echo "all modules found" >&6; } else - { { echo "$as_me:$LINENO: error: Failed to find some modules" >&5 -echo "$as_me: error: Failed to find some modules" >&2;} + { { $as_echo "$as_me:$LINENO: error: Failed to find some modules" >&5 +$as_echo "$as_me: error: Failed to find some modules" >&2;} { (exit 1); exit 1; }; } fi if test "$_os" = "WINNT"; then if test "$WITH_MINGWIN" != "yes"; then - echo "$as_me:$LINENO: checking for friendly registry keys" >&5 -echo $ECHO_N "checking for friendly registry keys... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for friendly registry keys" >&5 +$as_echo_n "checking for friendly registry keys... " >&6; } # VS.Net 2003, VS.Net 2005 if test -z "$with_cl_home"; then vctest=`./oowintool --msvc-productdir`; @@ -5303,8 +6574,8 @@ echo $ECHO_N "checking for friendly registry keys... $ECHO_C" >&6 else with_cl_home=`cygpath -u "$with_cl_home"` fi - echo "$as_me:$LINENO: result: done" >&5 -echo "${ECHO_T}done" >&6 + { $as_echo "$as_me:$LINENO: result: done" >&5 +$as_echo "done" >&6; } if test -n "$with_mspdb_path";then with_mspdb_path=`cygpath -u "$with_mspdb_path"` @@ -5325,10 +6596,10 @@ echo "${ECHO_T}done" >&6 if test -z "$MSPDB_PATH";then # Extract the first word of "mspdb80.dll", so it can be a program name with args. set dummy mspdb80.dll; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_MSPDB_PATH+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $MSPDB_PATH in [\\/]* | ?:[\\/]*) @@ -5341,33 +6612,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MSPDB_PATH="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi MSPDB_PATH=$ac_cv_path_MSPDB_PATH - if test -n "$MSPDB_PATH"; then - echo "$as_me:$LINENO: result: $MSPDB_PATH" >&5 -echo "${ECHO_T}$MSPDB_PATH" >&6 + { $as_echo "$as_me:$LINENO: result: $MSPDB_PATH" >&5 +$as_echo "$MSPDB_PATH" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + # Extract the first word of "mspdb71.dll", so it can be a program name with args. set dummy mspdb71.dll; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_MSPDB_PATH+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $MSPDB_PATH in [\\/]* | ?:[\\/]*) @@ -5380,50 +6652,51 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MSPDB_PATH="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi MSPDB_PATH=$ac_cv_path_MSPDB_PATH - if test -n "$MSPDB_PATH"; then - echo "$as_me:$LINENO: result: $MSPDB_PATH" >&5 -echo "${ECHO_T}$MSPDB_PATH" >&6 + { $as_echo "$as_me:$LINENO: result: $MSPDB_PATH" >&5 +$as_echo "$MSPDB_PATH" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + MSPDB_PATH=`dirname "$MSPDB_PATH"` fi if test -z "$MSPDB_PATH"; then - { { echo "$as_me:$LINENO: error: You need a mspdb71.dll/mspdb80.dll, make sure it's in the path or use --with-mspdb-path" >&5 -echo "$as_me: error: You need a mspdb71.dll/mspdb80.dll, make sure it's in the path or use --with-mspdb-path" >&2;} + { { $as_echo "$as_me:$LINENO: error: You need a mspdb71.dll/mspdb80.dll, make sure it's in the path or use --with-mspdb-path" >&5 +$as_echo "$as_me: error: You need a mspdb71.dll/mspdb80.dll, make sure it's in the path or use --with-mspdb-path" >&2;} { (exit 1); exit 1; }; } fi MSPDB_PATH=`cygpath -d "$MSPDB_PATH"` MSPDB_PATH=`cygpath -u "$MSPDB_PATH"` PATH="$MSPDB_PATH:$PATH" - echo "$as_me:$LINENO: checking the Microsoft C/C++ Compiler" >&5 -echo $ECHO_N "checking the Microsoft C/C++ Compiler... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking the Microsoft C/C++ Compiler" >&5 +$as_echo_n "checking the Microsoft C/C++ Compiler... " >&6; } if test -x "$with_cl_home/bin/cl.exe"; then CC="$with_cl_home/bin/cl.exe" else # Extract the first word of "cl.exe", so it can be a program name with args. set dummy cl.exe; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $CC in [\\/]* | ?:[\\/]*) @@ -5436,39 +6709,40 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CC="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi CC=$ac_cv_path_CC - if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test -e "$CC"; then # This gives us a posix path with 8.3 filename restrictions CC=`cygpath -d "$CC"` CC=`cygpath -u "$CC"` # Remove /cl.exe from CC case insensitive - echo "$as_me:$LINENO: result: found ($CC)" >&5 -echo "${ECHO_T}found ($CC)" >&6 + { $as_echo "$as_me:$LINENO: result: found ($CC)" >&5 +$as_echo "found ($CC)" >&6; } COMPATH=`echo $CC | $SED 's@/[cC][lL]\.[eE][xX][eE]@@'` export INCLUDE=`cygpath -d "$COMPATH/../Include"` - echo "$as_me:$LINENO: checking the Version of Microsoft C/C++ Compiler" >&5 -echo $ECHO_N "checking the Version of Microsoft C/C++ Compiler... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking the Version of Microsoft C/C++ Compiler" >&5 +$as_echo_n "checking the Version of Microsoft C/C++ Compiler... " >&6; } CCNUMVER=`$CC 2>&1 | $AWK "/Microsoft/ && /..\\...\\...../ { x = match( \\\$0, /..\\...\\...../ ) CCversion = substr( \\\$0, RSTART, RLENGTH) @@ -5477,44 +6751,44 @@ echo $ECHO_N "checking the Version of Microsoft C/C++ Compiler... $ECHO_C" >&6 printf (\"%04d\",vertoken[i] ) } }"` - echo "$as_me:$LINENO: result: found Compiler version $CCNUMVER." >&5 -echo "${ECHO_T}found Compiler version $CCNUMVER." >&6 + { $as_echo "$as_me:$LINENO: result: found Compiler version $CCNUMVER." >&5 +$as_echo "found Compiler version $CCNUMVER." >&6; } if test "$CCNUMVER" -ge "001500000000"; then COMEX=12 - echo "$as_me:$LINENO: result: found .NET 2008 / VS 9.0." >&5 -echo "${ECHO_T}found .NET 2008 / VS 9.0." >&6 + { $as_echo "$as_me:$LINENO: result: found .NET 2008 / VS 9.0." >&5 +$as_echo "found .NET 2008 / VS 9.0." >&6; } elif test "$CCNUMVER" -ge "001400000000"; then COMEX=11 - echo "$as_me:$LINENO: result: found .NET 2005." >&5 -echo "${ECHO_T}found .NET 2005." >&6 + { $as_echo "$as_me:$LINENO: result: found .NET 2005." >&5 +$as_echo "found .NET 2005." >&6; } elif test "$CCNUMVER" -ge "001300102240"; then COMEX=10 - echo "$as_me:$LINENO: result: found .NET 2003." >&5 -echo "${ECHO_T}found .NET 2003." >&6 + { $as_echo "$as_me:$LINENO: result: found .NET 2003." >&5 +$as_echo "found .NET 2003." >&6; } else - { { echo "$as_me:$LINENO: error: Compiler too old. Use Microsoft C/C++ .NET 2003/2005 compiler." >&5 -echo "$as_me: error: Compiler too old. Use Microsoft C/C++ .NET 2003/2005 compiler." >&2;} + { { $as_echo "$as_me:$LINENO: error: Compiler too old. Use Microsoft C/C++ .NET 2003/2005 compiler." >&5 +$as_echo "$as_me: error: Compiler too old. Use Microsoft C/C++ .NET 2003/2005 compiler." >&2;} { (exit 1); exit 1; }; } fi else - { { echo "$as_me:$LINENO: error: Microsoft C/C++ Compiler not found. Use --with-cl-home or set path to cl.exe." >&5 -echo "$as_me: error: Microsoft C/C++ Compiler not found. Use --with-cl-home or set path to cl.exe." >&2;} + { { $as_echo "$as_me:$LINENO: error: Microsoft C/C++ Compiler not found. Use --with-cl-home or set path to cl.exe." >&5 +$as_echo "$as_me: error: Microsoft C/C++ Compiler not found. Use --with-cl-home or set path to cl.exe." >&2;} { (exit 1); exit 1; }; } fi else - echo "$as_me:$LINENO: checking the Mingwin32 C++ Compiler" >&5 -echo $ECHO_N "checking the Mingwin32 C++ Compiler... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking the Mingwin32 C++ Compiler" >&5 +$as_echo_n "checking the Mingwin32 C++ Compiler... " >&6; } if test `$CC -dumpmachine | $SED -e 's/^.*-//'` = "mingw32"; then - echo "$as_me:$LINENO: result: found." >&5 -echo "${ECHO_T}found." >&6 + { $as_echo "$as_me:$LINENO: result: found." >&5 +$as_echo "found." >&6; } if $CC -dumpspecs | grep -q "mno-cygwin"; then USE_MINGW="cygwin" else USE_MINGW="pure-mingw" fi else - { { echo "$as_me:$LINENO: error: Mingwin32 C++ Compiler not found." >&5 -echo "$as_me: error: Mingwin32 C++ Compiler not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: Mingwin32 C++ Compiler not found." >&5 +$as_echo "$as_me: error: Mingwin32 C++ Compiler not found." >&2;} { (exit 1); exit 1; }; } fi fi @@ -5527,10 +6801,10 @@ if test "$_os" = "WINNT"; then if test "$WITH_MINGWIN" = "yes" || test "$COMEX" -ge "10"; then # Extract the first word of "midl.exe", so it can be a program name with args. set dummy midl.exe; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_MIDL_PATH+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $MIDL_PATH in [\\/]* | ?:[\\/]*) @@ -5543,27 +6817,28 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MIDL_PATH="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi MIDL_PATH=$ac_cv_path_MIDL_PATH - if test -n "$MIDL_PATH"; then - echo "$as_me:$LINENO: result: $MIDL_PATH" >&5 -echo "${ECHO_T}$MIDL_PATH" >&6 + { $as_echo "$as_me:$LINENO: result: $MIDL_PATH" >&5 +$as_echo "$MIDL_PATH" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + if test -n "$MIDL_PATH";then MIDL_PATH=`dirname "$MIDL_PATH"` fi @@ -5589,8 +6864,8 @@ fi fi fi if test ! -x "$MIDL_PATH/midl.exe"; then - { { echo "$as_me:$LINENO: error: midl.exe not found. Make sure it's in the path or use --with-midl-path" >&5 -echo "$as_me: error: midl.exe not found. Make sure it's in the path or use --with-midl-path" >&2;} + { { $as_echo "$as_me:$LINENO: error: midl.exe not found. Make sure it's in the path or use --with-midl-path" >&5 +$as_echo "$as_me: error: midl.exe not found. Make sure it's in the path or use --with-midl-path" >&2;} { (exit 1); exit 1; }; } fi # Convert to posix path with 8.3 filename restrictions ( No spaces ) @@ -5599,10 +6874,10 @@ echo "$as_me: error: midl.exe not found. Make sure it's in the path or use --wit # Extract the first word of "csc.exe", so it can be a program name with args. set dummy csc.exe; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_CSC_PATH+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $CSC_PATH in [\\/]* | ?:[\\/]*) @@ -5615,27 +6890,28 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CSC_PATH="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi CSC_PATH=$ac_cv_path_CSC_PATH - if test -n "$CSC_PATH"; then - echo "$as_me:$LINENO: result: $CSC_PATH" >&5 -echo "${ECHO_T}$CSC_PATH" >&6 + { $as_echo "$as_me:$LINENO: result: $CSC_PATH" >&5 +$as_echo "$CSC_PATH" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + if test -n "$CSC_PATH";then CSC_PATH=`dirname "$CSC_PATH"` fi @@ -5651,16 +6927,16 @@ fi fi fi if test ! -x "$CSC_PATH/csc.exe"; then - { { echo "$as_me:$LINENO: error: csc.exe not found. Make sure it's in the path or use --with-csc-path" >&5 -echo "$as_me: error: csc.exe not found. Make sure it's in the path or use --with-csc-path" >&2;} + { { $as_echo "$as_me:$LINENO: error: csc.exe not found. Make sure it's in the path or use --with-csc-path" >&5 +$as_echo "$as_me: error: csc.exe not found. Make sure it's in the path or use --with-csc-path" >&2;} { (exit 1); exit 1; }; } fi # Convert to posix path with 8.3 filename restrictions ( No spaces ) CSC_PATH=`cygpath -d "$CSC_PATH"` CSC_PATH=`cygpath -u "$CSC_PATH"` - echo "$as_me:$LINENO: checking .NET Framework" >&5 -echo $ECHO_N "checking .NET Framework... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking .NET Framework" >&5 +$as_echo_n "checking .NET Framework... " >&6; } if test -n "$with_frame_home"; then with_frame_home=`cygpath -u "$with_frame_home"` fi @@ -5682,12 +6958,12 @@ echo $ECHO_N "checking .NET Framework... $ECHO_C" >&6 fi fi if test ! -f "$FRAME_HOME/lib/mscoree.lib"; then - { { echo "$as_me:$LINENO: error: mscoree.lib (.NET Framework) not found. Make sure you use --with-frame-home" >&5 -echo "$as_me: error: mscoree.lib (.NET Framework) not found. Make sure you use --with-frame-home" >&2;} + { { $as_echo "$as_me:$LINENO: error: mscoree.lib (.NET Framework) not found. Make sure you use --with-frame-home" >&5 +$as_echo "$as_me: error: mscoree.lib (.NET Framework) not found. Make sure you use --with-frame-home" >&2;} { (exit 1); exit 1; }; } fi - echo "$as_me:$LINENO: result: found" >&5 -echo "${ECHO_T}found" >&6 + { $as_echo "$as_me:$LINENO: result: found" >&5 +$as_echo "found" >&6; } # Convert to posix path with 8.3 filename restrictions ( No spaces ) FRAME_HOME=`cygpath -d "$FRAME_HOME"` FRAME_HOME=`cygpath -u "$FRAME_HOME"` @@ -5703,15 +6979,15 @@ ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" @@ -5726,7 +7002,6 @@ do # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -5737,39 +7012,39 @@ cat >>conftest.$ac_ext <<_ACEOF #else # include #endif - Syntax error + Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -5777,33 +7052,34 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -5821,8 +7097,8 @@ fi else ac_cv_prog_CPP=$CPP fi -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 +{ $as_echo "$as_me:$LINENO: result: $CPP" >&5 +$as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -5833,7 +7109,6 @@ do # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -5844,39 +7119,39 @@ cat >>conftest.$ac_ext <<_ACEOF #else # include #endif - Syntax error + Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -5884,33 +7159,34 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -5919,11 +7195,13 @@ rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi ac_ext=c @@ -5933,13 +7211,12 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -5959,30 +7236,36 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_header_stdc=no + ac_cv_header_stdc=no fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -6004,7 +7287,6 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -6029,21 +7311,21 @@ if test $ac_cv_header_stdc = yes; then : else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include +#include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif @@ -6054,37 +7336,51 @@ main () int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); + || toupper (i) != TOUPPER (i)) + return 2; + return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -rf conftest.dSYM +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @@ -6096,20 +7392,24 @@ fi fi if test "$_os" != "WINNT" -o "$WITH_MINGWIN" = "yes"; then - ac_ext=cc + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test -n "$ac_tool_prefix"; then - for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. @@ -6120,38 +7420,40 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then - echo "$as_me:$LINENO: result: $CXX" >&5 -echo "${ECHO_T}$CXX" >&6 + { $as_echo "$as_me:$LINENO: result: $CXX" >&5 +$as_echo "$CXX" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX - for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. @@ -6162,60 +7464,89 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CXX="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then - echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 -echo "${ECHO_T}$ac_ct_CXX" >&6 + { $as_echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$ac_ct_CXX" && break done -test -n "$ac_ct_CXX" || ac_ct_CXX="g++" - CXX=$ac_ct_CXX + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi fi - + fi +fi # Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C++ compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 +$as_echo "$as_me:$LINENO: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if test "${ac_cv_cxx_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -6234,41 +7565,54 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_compiler_gnu=no + ac_compiler_gnu=no fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 -GXX=`test $ac_compiler_gnu = yes && echo yes` +{ $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS -CXXFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 -echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 +$as_echo_n "checking whether $CXX accepts -g... " >&6; } if test "${ac_cv_prog_cxx_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -6284,148 +7628,152 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_prog_cxx_g=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 -if test "$ac_test_CXXFLAGS" = set; then - CXXFLAGS=$ac_save_CXXFLAGS -elif test $ac_cv_prog_cxx_g = yes; then - if test "$GXX" = yes; then - CXXFLAGS="-g -O2" - else - CXXFLAGS="-g" - fi -else - if test "$GXX" = yes; then - CXXFLAGS="-O2" - else - CXXFLAGS= - fi -fi -for ac_declaration in \ - ''\ - '#include ' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" + CXXFLAGS="" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -$ac_declaration + int main () { -exit (42); + ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -continue -fi -rm -f conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_declaration + int main () { -exit (42); + ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cxx_g=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 +$as_echo "$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -ac_ext=cc +ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 -echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 +$as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" @@ -6440,7 +7788,6 @@ do # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -6451,39 +7798,39 @@ cat >>conftest.$ac_ext <<_ACEOF #else # include #endif - Syntax error + Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -6491,33 +7838,34 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -6535,8 +7883,8 @@ fi else ac_cv_prog_CXXCPP=$CXXCPP fi -echo "$as_me:$LINENO: result: $CXXCPP" >&5 -echo "${ECHO_T}$CXXCPP" >&6 +{ $as_echo "$as_me:$LINENO: result: $CXXCPP" >&5 +$as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do @@ -6547,7 +7895,6 @@ do # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -6558,39 +7905,39 @@ cat >>conftest.$ac_ext <<_ACEOF #else # include #endif - Syntax error + Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -6598,33 +7945,34 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -6633,11 +7981,13 @@ rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else - { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&5 -echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check +$as_echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi ac_ext=c @@ -6655,15 +8005,15 @@ ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" @@ -6678,7 +8028,6 @@ do # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -6689,39 +8038,39 @@ cat >>conftest.$ac_ext <<_ACEOF #else # include #endif - Syntax error + Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -6729,33 +8078,34 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -6773,8 +8123,8 @@ fi else ac_cv_prog_CPP=$CPP fi -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 +{ $as_echo "$as_me:$LINENO: result: $CPP" >&5 +$as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -6785,7 +8135,6 @@ do # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -6796,39 +8145,39 @@ cat >>conftest.$ac_ext <<_ACEOF #else # include #endif - Syntax error + Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -6836,33 +8185,34 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -6871,11 +8221,13 @@ rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi ac_ext=c @@ -6898,16 +8250,15 @@ fi for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h + inttypes.h stdint.h unistd.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -6918,31 +8269,42 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_Header=no" + eval "$as_ac_Header=no" fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -if test `eval echo '${'$as_ac_Header'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -6950,68 +8312,18 @@ fi done -echo "$as_me:$LINENO: checking for long" >&5 -echo $ECHO_N "checking for long... $ECHO_C" >&6 -if test "${ac_cv_type_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if ((long *) 0) - return 0; -if (sizeof (long)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_long=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_type_long=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 -echo "${ECHO_T}$ac_cv_type_long" >&6 - -echo "$as_me:$LINENO: checking size of long" >&5 -echo $ECHO_N "checking size of long... $ECHO_C" >&6 +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:$LINENO: checking size of long" >&5 +$as_echo_n "checking size of long... " >&6; } if test "${ac_cv_sizeof_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - if test "$ac_cv_type_long" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -7021,7 +8333,7 @@ $ac_includes_default int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) >= 0)]; test_array [0] = 0 ; @@ -7029,21 +8341,26 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -7053,7 +8370,7 @@ $ac_includes_default int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) <= $ac_mid)]; test_array [0] = 0 ; @@ -7061,37 +8378,43 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -7101,7 +8424,7 @@ $ac_includes_default int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) < 0)]; test_array [0] = 0 ; @@ -7109,21 +8432,26 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -7133,7 +8461,7 @@ $ac_includes_default int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) >= $ac_mid)]; test_array [0] = 0 ; @@ -7141,45 +8469,53 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo= ac_hi= + ac_lo= ac_hi= fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -7189,7 +8525,7 @@ $ac_includes_default int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) <= $ac_mid)]; test_array [0] = 0 ; @@ -7197,52 +8533,57 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_long=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 +'') if test "$ac_cv_type_long" = yes; then + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long), 77 +$as_echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; + { (exit 77); exit 77; }; }; } + else + ac_cv_sizeof_long=0 + fi ;; esac -else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -long longval () { return (long) (sizeof (long)); } -unsigned long ulongval () { return (long) (sizeof (long)); } +static long int longval () { return (long int) (sizeof (long)); } +static unsigned long int ulongval () { return (long int) (sizeof (long)); } #include #include int @@ -7251,61 +8592,80 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) - exit (1); - if (((long) (sizeof (long))) < 0) + return 1; + if (((long int) (sizeof (long))) < 0) { - long i = longval (); - if (i != ((long) (sizeof (long)))) - exit (1); - fprintf (f, "%ld\n", i); + long int i = longval (); + if (i != ((long int) (sizeof (long)))) + return 1; + fprintf (f, "%ld", i); } else { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (long)))) - exit (1); - fprintf (f, "%lu\n", i); + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (long)))) + return 1; + fprintf (f, "%lu", i); } - exit (ferror (f) || fclose (f) != 0); + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ + return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 +if test "$ac_cv_type_long" = yes; then + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long), 77 +$as_echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + { (exit 77); exit 77; }; }; } + else + ac_cv_sizeof_long=0 + fi fi +rm -rf conftest.dSYM +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val -else - ac_cv_sizeof_long=0 -fi fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 -echo "${ECHO_T}$ac_cv_sizeof_long" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 +$as_echo "$ac_cv_sizeof_long" >&6; } + + + cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF @@ -7313,233 +8673,434 @@ _ACEOF SIZEOF_LONG=$ac_cv_sizeof_long -echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 -echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 + + { $as_echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } if test "${ac_cv_c_bigendian+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - # See if sys/param.h defines the BYTE_ORDER macro. -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + + # Check for potential -arch flags. It is not universal unless + # there are some -arch flags. Note that *ppc* also matches + # ppc64. This check is also rather less than ideal. + case "${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}" in #( + *-arch*ppc*|*-arch*i386*|*-arch*x86_64*) ac_cv_c_bigendian=universal;; + esac +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include -#include + #include int main () { -#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN - bogus endian macros -#endif +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then # It does; now see whether it defined to BIG_ENDIAN or not. -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include -#include + #include int main () { #if BYTE_ORDER != BIG_ENDIAN - not big endian -#endif + not big endian + #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_c_bigendian=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_c_bigendian=no + ac_cv_c_bigendian=no fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -# It does not; compile a test program. -if test "$cross_compiling" = yes; then - # try to guess the endianness by grepping values into an object file - ac_cv_c_bigendian=unknown - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; -short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; -void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } -short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; -short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; -void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } +#include + int main () { - _ascii (); _ebcdic (); +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_c_bigendian=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_c_bigendian=no fi -if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then + # Try to guess by grepping values from an object file. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + +int +main () +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +$ac_includes_default int main () { - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long l; - char c[sizeof (long)]; - } u; - u.l = 1; - exit (u.c[sizeof (long) - 1] == 1); + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=no else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_bigendian=yes fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -rf conftest.dSYM +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + + fi fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 -echo "${ECHO_T}$ac_cv_c_bigendian" >&6 -case $ac_cv_c_bigendian in - yes) +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + cat >>confdefs.h <<\_ACEOF +#define WORDS_BIGENDIAN 1 +_ACEOF +;; #( + no) + ;; #( + universal) cat >>confdefs.h <<\_ACEOF -#define WORDS_BIGENDIAN 1 +#define AC_APPLE_UNIVERSAL_BUILD 1 _ACEOF - ;; - no) - ;; - *) - { { echo "$as_me:$LINENO: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&5 -echo "$as_me: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} + + ;; #( + *) + { { $as_echo "$as_me:$LINENO: error: unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" >&5 +$as_echo "$as_me: error: unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} { (exit 1); exit 1; }; } ;; -esac + esac WORDS_BIGENDIAN=$ac_cv_c_bigendian -# Check whether --enable-largefile or --disable-largefile was given. +# Check whether --enable-largefile was given. if test "${enable_largefile+set}" = set; then - enableval="$enable_largefile" + enableval=$enable_largefile; +fi -fi; if test "$enable_largefile" != no; then - echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 -echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 +$as_echo_n "checking for special C compiler options needed for large files... " >&6; } if test "${ac_cv_sys_largefile_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then ac_save_CC=$CC while :; do - # IRIX 6.2 and later do not support large files by default, - # so use the C compiler's -n32 option if that helps. - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -7562,66 +9123,80 @@ main () return 0; } _ACEOF - rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.$ac_objext - CC="$CC -n32" - rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + +rm -f core conftest.err conftest.$ac_objext + CC="$CC -n32" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_sys_largefile_CC=' -n32'; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.$ac_objext - break + +rm -f core conftest.err conftest.$ac_objext + break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi -echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 -echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 +$as_echo "$ac_cv_sys_largefile_CC" >&6; } if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi - echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 -echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } if test "${ac_cv_sys_file_offset_bits+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else while :; do - ac_cv_sys_file_offset_bits=no cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -7645,26 +9220,33 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_file_offset_bits=no; break +else + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -7689,46 +9271,55 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_sys_file_offset_bits=64; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_file_offset_bits=unknown break done fi -echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 -echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6 -if test "$ac_cv_sys_file_offset_bits" != no; then - +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 +$as_echo "$ac_cv_sys_file_offset_bits" >&6; } +case $ac_cv_sys_file_offset_bits in #( + no | unknown) ;; + *) cat >>confdefs.h <<_ACEOF #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits _ACEOF - -fi -rm -f conftest* - echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 -echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6 +;; +esac +rm -rf conftest* + if test $ac_cv_sys_file_offset_bits = unknown; then + { $as_echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 +$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } if test "${ac_cv_sys_large_files+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else while :; do - ac_cv_sys_large_files=no cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -7752,26 +9343,33 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_large_files=no; break +else + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -7796,37 +9394,48 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_sys_large_files=1; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_large_files=unknown break done fi -echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 -echo "${ECHO_T}$ac_cv_sys_large_files" >&6 -if test "$ac_cv_sys_large_files" != no; then - +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 +$as_echo "$ac_cv_sys_large_files" >&6; } +case $ac_cv_sys_large_files in #( + no | unknown) ;; + *) cat >>confdefs.h <<_ACEOF #define _LARGE_FILES $ac_cv_sys_large_files _ACEOF - -fi -rm -f conftest* +;; +esac +rm -rf conftest* + fi fi if test -n "$ac_cv_sys_file_offset_bits"; then @@ -7837,44 +9446,44 @@ if test -n "$ac_cv_sys_large_files" && test "$ac_cv_sys_large_files" != "no"; th fi -echo "$as_me:$LINENO: checking whether to disable vba feature" >&5 -echo $ECHO_N "checking whether to disable vba feature... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to disable vba feature" >&5 +$as_echo_n "checking whether to disable vba feature... " >&6; } if test -n "$enable_vba" && test "$enable_vba" = "no"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } ENABLE_VBA=NO else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } ENABLE_VBA=YES fi if test "$ENABLE_VBA" = "YES"; then - echo "$as_me:$LINENO: checking how to package the vba compatibility api" >&5 -echo $ECHO_N "checking how to package the vba compatibility api... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking how to package the vba compatibility api" >&5 +$as_echo_n "checking how to package the vba compatibility api... " >&6; } if test -n "$with_vba_package_format"; then if test "$with_vba_package_format" = "extn"; then VBA_EXTENSION=YES - echo "$as_me:$LINENO: result: uno extension" >&5 -echo "${ECHO_T}uno extension" >&6 - { echo "$as_me:$LINENO: WARNING: --with-vba-package-format=extn can cause problems" >&5 -echo "$as_me: WARNING: --with-vba-package-format=extn can cause problems" >&2;} + { $as_echo "$as_me:$LINENO: result: uno extension" >&5 +$as_echo "uno extension" >&6; } + { $as_echo "$as_me:$LINENO: WARNING: --with-vba-package-format=extn can cause problems" >&5 +$as_echo "$as_me: WARNING: --with-vba-package-format=extn can cause problems" >&2;} else if test "$with_vba_package_format" = "builtin"; then VBA_EXTENSION=NO - echo "$as_me:$LINENO: result: build into installset" >&5 -echo "${ECHO_T}build into installset" >&6 + { $as_echo "$as_me:$LINENO: result: build into installset" >&5 +$as_echo "build into installset" >&6; } else - { { echo "$as_me:$LINENO: error: unknown packaging method" >&5 -echo "$as_me: error: unknown packaging method" >&2;} + { { $as_echo "$as_me:$LINENO: error: unknown packaging method" >&5 +$as_echo "$as_me: error: unknown packaging method" >&2;} { (exit 1); exit 1; }; } fi fi else VBA_EXTENSION=NO - echo "$as_me:$LINENO: result: defaulting to build into installset" >&5 -echo "${ECHO_T}defaulting to build into installset" >&6 + { $as_echo "$as_me:$LINENO: result: defaulting to build into installset" >&5 +$as_echo "defaulting to build into installset" >&6; } fi else VBA_EXTENSION=NO @@ -7885,19 +9494,18 @@ fi if test "$test_cups" = "yes" -a "$ENABLE_CUPS" = "TRUE" ; then if test "${ac_cv_header_cups_cups_h+set}" = set; then - echo "$as_me:$LINENO: checking for cups/cups.h" >&5 -echo $ECHO_N "checking for cups/cups.h... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for cups/cups.h" >&5 +$as_echo_n "checking for cups/cups.h... " >&6; } if test "${ac_cv_header_cups_cups_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_cups_cups_h" >&5 -echo "${ECHO_T}$ac_cv_header_cups_cups_h" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_cups_cups_h" >&5 +$as_echo "$ac_cv_header_cups_cups_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking cups/cups.h usability" >&5 -echo $ECHO_N "checking cups/cups.h usability... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking cups/cups.h usability" >&5 +$as_echo_n "checking cups/cups.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -7907,33 +9515,39 @@ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking cups/cups.h presence" >&5 -echo $ECHO_N "checking cups/cups.h presence... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking cups/cups.h presence" >&5 +$as_echo_n "checking cups/cups.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -7941,83 +9555,76 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: cups/cups.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: cups/cups.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: cups/cups.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: cups/cups.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: cups/cups.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: cups/cups.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cups/cups.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: cups/cups.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: cups/cups.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: cups/cups.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: cups/cups.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: cups/cups.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: cups/cups.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: cups/cups.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: cups/cups.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: cups/cups.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cups/cups.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: cups/cups.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cups/cups.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: cups/cups.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cups/cups.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: cups/cups.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cups/cups.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: cups/cups.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: cups/cups.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: cups/cups.h: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for cups/cups.h" >&5 -echo $ECHO_N "checking for cups/cups.h... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for cups/cups.h" >&5 +$as_echo_n "checking for cups/cups.h... " >&6; } if test "${ac_cv_header_cups_cups_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_cups_cups_h=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_cups_cups_h" >&5 -echo "${ECHO_T}$ac_cv_header_cups_cups_h" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_cups_cups_h" >&5 +$as_echo "$ac_cv_header_cups_cups_h" >&6; } fi -if test $ac_cv_header_cups_cups_h = yes; then +if test "x$ac_cv_header_cups_cups_h" = x""yes; then : else - { { echo "$as_me:$LINENO: error: cups/cups.h could not be found. libcupsys2-dev or cups???-devel missing?" >&5 -echo "$as_me: error: cups/cups.h could not be found. libcupsys2-dev or cups???-devel missing?" >&2;} + { { $as_echo "$as_me:$LINENO: error: cups/cups.h could not be found. libcupsys2-dev or cups???-devel missing?" >&5 +$as_echo "$as_me: error: cups/cups.h could not be found. libcupsys2-dev or cups???-devel missing?" >&2;} { (exit 1); exit 1; }; } fi @@ -8025,26 +9632,25 @@ fi fi if test "$_os" = "Linux" -o "$_os" = "FreeBSD" -o "$_os" = "GNU"; then - echo "$as_me:$LINENO: checking whether to enable pam support" >&5 -echo $ECHO_N "checking whether to enable pam support... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking whether to enable pam support" >&5 +$as_echo_n "checking whether to enable pam support... " >&6; } if test -z "$enable_pam" || test "$enable_pam" != "no"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } PAM=YES if test "${ac_cv_header_security_pam_appl_h+set}" = set; then - echo "$as_me:$LINENO: checking for security/pam_appl.h" >&5 -echo $ECHO_N "checking for security/pam_appl.h... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for security/pam_appl.h" >&5 +$as_echo_n "checking for security/pam_appl.h... " >&6; } if test "${ac_cv_header_security_pam_appl_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_security_pam_appl_h" >&5 -echo "${ECHO_T}$ac_cv_header_security_pam_appl_h" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_security_pam_appl_h" >&5 +$as_echo "$ac_cv_header_security_pam_appl_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking security/pam_appl.h usability" >&5 -echo $ECHO_N "checking security/pam_appl.h usability... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking security/pam_appl.h usability" >&5 +$as_echo_n "checking security/pam_appl.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -8054,33 +9660,39 @@ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking security/pam_appl.h presence" >&5 -echo $ECHO_N "checking security/pam_appl.h presence... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking security/pam_appl.h presence" >&5 +$as_echo_n "checking security/pam_appl.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -8088,149 +9700,153 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: security/pam_appl.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: security/pam_appl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: security/pam_appl.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: security/pam_appl.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: security/pam_appl.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: security/pam_appl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: security/pam_appl.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: security/pam_appl.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: security/pam_appl.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: security/pam_appl.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: security/pam_appl.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: security/pam_appl.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: security/pam_appl.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: security/pam_appl.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: security/pam_appl.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: security/pam_appl.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: security/pam_appl.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: security/pam_appl.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: security/pam_appl.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: security/pam_appl.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: security/pam_appl.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: security/pam_appl.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: security/pam_appl.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: security/pam_appl.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: security/pam_appl.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: security/pam_appl.h: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for security/pam_appl.h" >&5 -echo $ECHO_N "checking for security/pam_appl.h... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for security/pam_appl.h" >&5 +$as_echo_n "checking for security/pam_appl.h... " >&6; } if test "${ac_cv_header_security_pam_appl_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_security_pam_appl_h=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_security_pam_appl_h" >&5 -echo "${ECHO_T}$ac_cv_header_security_pam_appl_h" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_security_pam_appl_h" >&5 +$as_echo "$ac_cv_header_security_pam_appl_h" >&6; } fi -if test $ac_cv_header_security_pam_appl_h = yes; then +if test "x$ac_cv_header_security_pam_appl_h" = x""yes; then : else - { { echo "$as_me:$LINENO: error: pam_appl.h could not be found. libpam-dev or pam-devel missing?" >&5 -echo "$as_me: error: pam_appl.h could not be found. libpam-dev or pam-devel missing?" >&2;} + { { $as_echo "$as_me:$LINENO: error: pam_appl.h could not be found. libpam-dev or pam-devel missing?" >&5 +$as_echo "$as_me: error: pam_appl.h could not be found. libpam-dev or pam-devel missing?" >&2;} { (exit 1); exit 1; }; } fi - echo "$as_me:$LINENO: checking whether to link to libpam" >&5 -echo $ECHO_N "checking whether to link to libpam... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking whether to link to libpam" >&5 +$as_echo_n "checking whether to link to libpam... " >&6; } if test -n "$enable_pam_link" -a "$enable_pam_link" != "no"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } PAM_LINK=YES -echo "$as_me:$LINENO: checking for pam_start in -lpam" >&5 -echo $ECHO_N "checking for pam_start in -lpam... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for pam_start in -lpam" >&5 +$as_echo_n "checking for pam_start in -lpam... " >&6; } if test "${ac_cv_lib_pam_pam_start+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpam $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char pam_start (); int main () { -pam_start (); +return pam_start (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_pam_pam_start=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_pam_pam_start=no + ac_cv_lib_pam_pam_start=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_pam_pam_start" >&5 -echo "${ECHO_T}$ac_cv_lib_pam_pam_start" >&6 -if test $ac_cv_lib_pam_pam_start = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pam_pam_start" >&5 +$as_echo "$ac_cv_lib_pam_pam_start" >&6; } +if test "x$ac_cv_lib_pam_pam_start" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBPAM 1 _ACEOF @@ -8238,19 +9854,19 @@ _ACEOF LIBS="-lpam $LIBS" else - { { echo "$as_me:$LINENO: error: libpam not found or functional" >&5 -echo "$as_me: error: libpam not found or functional" >&2;} + { { $as_echo "$as_me:$LINENO: error: libpam not found or functional" >&5 +$as_echo "$as_me: error: libpam not found or functional" >&2;} { (exit 1); exit 1; }; } fi else - echo "$as_me:$LINENO: result: no, dynamically open it" >&5 -echo "${ECHO_T}no, dynamically open it" >&6 + { $as_echo "$as_me:$LINENO: result: no, dynamically open it" >&5 +$as_echo "no, dynamically open it" >&6; } PAM_LINK=NO fi else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } PAM=NO PAM_LINK=NO @@ -8261,11 +9877,11 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu - echo "$as_me:$LINENO: checking how many arguments getspnam_r() takes" >&5 -echo $ECHO_N "checking how many arguments getspnam_r() takes... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking how many arguments getspnam_r() takes" >&5 +$as_echo_n "checking how many arguments getspnam_r() takes... " >&6; } if test "${ac_cv_func_which_getspnam_r+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else @@ -8283,7 +9899,6 @@ ac_cv_func_which_getspnam_r=unknown # assuming an implicit prototype. In which case, we're out of luck. # cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -8305,24 +9920,32 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_func_which_getspnam_r=no else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # # FIVE ARGUMENTS @@ -8331,7 +9954,6 @@ rm -f conftest.$ac_objext conftest.$ac_ext if test "$ac_cv_func_which_getspnam_r" = "unknown"; then cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -8355,24 +9977,32 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_func_which_getspnam_r=five else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi @@ -8383,7 +10013,6 @@ fi if test "$ac_cv_func_which_getspnam_r" = "unknown"; then cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -8407,24 +10036,32 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_func_which_getspnam_r=four else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi @@ -8435,29 +10072,29 @@ fi case "$ac_cv_func_which_getspnam_r" in five) - echo "$as_me:$LINENO: result: five" >&5 -echo "${ECHO_T}five" >&6 + { $as_echo "$as_me:$LINENO: result: five" >&5 +$as_echo "five" >&6; } NEW_SHADOW_API=YES ;; four) - echo "$as_me:$LINENO: result: four" >&5 -echo "${ECHO_T}four" >&6 + { $as_echo "$as_me:$LINENO: result: four" >&5 +$as_echo "four" >&6; } ;; no) - echo "$as_me:$LINENO: result: cannot find function declaration in shadow.h" >&5 -echo "${ECHO_T}cannot find function declaration in shadow.h" >&6 + { $as_echo "$as_me:$LINENO: result: cannot find function declaration in shadow.h" >&5 +$as_echo "cannot find function declaration in shadow.h" >&6; } ;; unknown) - echo "$as_me:$LINENO: result: can't tell" >&5 -echo "${ECHO_T}can't tell" >&6 + { $as_echo "$as_me:$LINENO: result: can't tell" >&5 +$as_echo "can't tell" >&6; } ;; *) - { { echo "$as_me:$LINENO: error: internal error" >&5 -echo "$as_me: error: internal error" >&2;} + { { $as_echo "$as_me:$LINENO: error: internal error" >&5 +$as_echo "$as_me: error: internal error" >&2;} { (exit 1); exit 1; }; } ;; esac @@ -8477,68 +10114,79 @@ fi if test "$_os" = "Linux"; then - echo "$as_me:$LINENO: checking whether to link to libcrypt" >&5 -echo $ECHO_N "checking whether to link to libcrypt... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking whether to link to libcrypt" >&5 +$as_echo_n "checking whether to link to libcrypt... " >&6; } if test -n "$enable_crypt_link" -a "$enable_crypt_link" != "no"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } CRYPT_LINK=YES -echo "$as_me:$LINENO: checking for crypt in -lcrypt" >&5 -echo $ECHO_N "checking for crypt in -lcrypt... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for crypt in -lcrypt" >&5 +$as_echo_n "checking for crypt in -lcrypt... " >&6; } if test "${ac_cv_lib_crypt_crypt+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypt $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char crypt (); int main () { -crypt (); +return crypt (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_crypt_crypt=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_crypt_crypt=no + ac_cv_lib_crypt_crypt=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_crypt_crypt" >&5 -echo "${ECHO_T}$ac_cv_lib_crypt_crypt" >&6 -if test $ac_cv_lib_crypt_crypt = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_crypt_crypt" >&5 +$as_echo "$ac_cv_lib_crypt_crypt" >&6; } +if test "x$ac_cv_lib_crypt_crypt" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBCRYPT 1 _ACEOF @@ -8546,14 +10194,14 @@ _ACEOF LIBS="-lcrypt $LIBS" else - { { echo "$as_me:$LINENO: error: libcrypt not found or functional" >&5 -echo "$as_me: error: libcrypt not found or functional" >&2;} + { { $as_echo "$as_me:$LINENO: error: libcrypt not found or functional" >&5 +$as_echo "$as_me: error: libcrypt not found or functional" >&2;} { (exit 1); exit 1; }; } fi else - echo "$as_me:$LINENO: result: no, dynamically open it" >&5 -echo "${ECHO_T}no, dynamically open it" >&6 + { $as_echo "$as_me:$LINENO: result: no, dynamically open it" >&5 +$as_echo "no, dynamically open it" >&6; } CRYPT_LINK=NO fi fi @@ -8572,20 +10220,24 @@ if test "$_os" = "WINNT" -a "$WITH_MINGWIN" != "yes"; then fi if test "$_os" != "WINNT" -o "$WITH_MINGWIN" = "yes"; then - ac_ext=cc + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test -n "$ac_tool_prefix"; then - for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. @@ -8596,38 +10248,40 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then - echo "$as_me:$LINENO: result: $CXX" >&5 -echo "${ECHO_T}$CXX" >&6 + { $as_echo "$as_me:$LINENO: result: $CXX" >&5 +$as_echo "$CXX" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX - for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. @@ -8638,60 +10292,89 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CXX="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then - echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 -echo "${ECHO_T}$ac_ct_CXX" >&6 + { $as_echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$ac_ct_CXX" && break done -test -n "$ac_ct_CXX" || ac_ct_CXX="g++" - CXX=$ac_ct_CXX + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi fi - + fi +fi # Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C++ compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 +$as_echo "$as_me:$LINENO: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if test "${ac_cv_cxx_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -8710,41 +10393,54 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_compiler_gnu=no + ac_compiler_gnu=no fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 -GXX=`test $ac_compiler_gnu = yes && echo yes` +{ $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS -CXXFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 -echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 +$as_echo_n "checking whether $CXX accepts -g... " >&6; } if test "${ac_cv_prog_cxx_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -8760,132 +10456,136 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_prog_cxx_g=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 -if test "$ac_test_CXXFLAGS" = set; then - CXXFLAGS=$ac_save_CXXFLAGS -elif test $ac_cv_prog_cxx_g = yes; then - if test "$GXX" = yes; then - CXXFLAGS="-g -O2" - else - CXXFLAGS="-g" - fi -else - if test "$GXX" = yes; then - CXXFLAGS="-O2" - else - CXXFLAGS= - fi -fi -for ac_declaration in \ - ''\ - '#include ' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" + CXXFLAGS="" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -$ac_declaration + int main () { -exit (42); + ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -continue -fi -rm -f conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_declaration + int main () { -exit (42); + ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cxx_g=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 +$as_echo "$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -8895,29 +10595,30 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi if test "$GXX" = "yes"; then - echo "$as_me:$LINENO: checking the GNU C++ compiler version" >&5 -echo $ECHO_N "checking the GNU C++ compiler version... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking the GNU C++ compiler version" >&5 +$as_echo_n "checking the GNU C++ compiler version... " >&6; } _gpp_version=`$CXX -dumpversion` _gpp_major=`echo $_gpp_version | $AWK -F. '{ print \$1 }'` _gpp_minor=`echo $_gpp_version | $AWK -F. '{ print \$2 }'` - echo "$as_me:$LINENO: result: checked (g++ $_gpp_version)" >&5 -echo "${ECHO_T}checked (g++ $_gpp_version)" >&6 + { $as_echo "$as_me:$LINENO: result: checked (g++ $_gpp_version)" >&5 +$as_echo "checked (g++ $_gpp_version)" >&6; } if test "$_gpp_major" = "3"; then if test "$_gpp_minor" = "4"; then - echo "$as_me:$LINENO: checking whether $CXX has the enum bug" >&5 -echo $ECHO_N "checking whether $CXX has the enum bug... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking whether $CXX has the enum bug" >&5 +$as_echo_n "checking whether $CXX has the enum bug... " >&6; } if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling +$as_echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -8947,30 +10648,44 @@ main (void) _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - { { echo "$as_me:$LINENO: error: your version of the GNU C++ compile has a bug which prevents OpenOffice.org from being compiled correctly - please check http://gcc.gnu.org/ml/gcc-patches/2004-07/msg00968.html for details." >&5 -echo "$as_me: error: your version of the GNU C++ compile has a bug which prevents OpenOffice.org from being compiled correctly - please check http://gcc.gnu.org/ml/gcc-patches/2004-07/msg00968.html for details." >&2;} + { { $as_echo "$as_me:$LINENO: error: your version of the GNU C++ compile has a bug which prevents OpenOffice.org from being compiled correctly - please check http://gcc.gnu.org/ml/gcc-patches/2004-07/msg00968.html for details." >&5 +$as_echo "$as_me: error: your version of the GNU C++ compile has a bug which prevents OpenOffice.org from being compiled correctly - please check http://gcc.gnu.org/ml/gcc-patches/2004-07/msg00968.html for details." >&2;} { (exit 1); exit 1; }; } else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 +{ $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -rf conftest.dSYM +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi fi fi @@ -8978,8 +10693,8 @@ fi # Removed the special FreeBSD treatment. The problem was that with_gxx_include_path # often contains an i386 which is expanded as a macro. Solved in stlport. if test "$GXX" = "yes"; then - echo "$as_me:$LINENO: checking for g++ include path" >&5 -echo $ECHO_N "checking for g++ include path... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for g++ include path" >&5 +$as_echo_n "checking for g++ include path... " >&6; } if test -z "$with_gxx_include_path"; then with_gxx_include_path=`echo "#include " | $CXX -E -xc++ - | $SED -n '/.*1*"\(.*\)\/cstring".*/s//\1/p' | head -n 1` if test "$with_gxx_include_path" = "/usr/libexec/(null)/include"; then @@ -8993,18 +10708,18 @@ echo $ECHO_N "checking for g++ include path... $ECHO_C" >&6 fi if test -z "$with_gxx_include_path"; then with_gxx_include_path="NO_GXX_INCLUDE" - echo "$as_me:$LINENO: result: no g++ includes" >&5 -echo "${ECHO_T}no g++ includes" >&6 + { $as_echo "$as_me:$LINENO: result: no g++ includes" >&5 +$as_echo "no g++ includes" >&6; } else - echo "$as_me:$LINENO: result: $with_gxx_include_path" >&5 -echo "${ECHO_T}$with_gxx_include_path" >&6 + { $as_echo "$as_me:$LINENO: result: $with_gxx_include_path" >&5 +$as_echo "$with_gxx_include_path" >&6; } fi GXX_INCLUDE_PATH="$with_gxx_include_path" if test "$WITH_MINGWIN" = "yes"; then - echo "$as_me:$LINENO: checking for mingwin runtime include path" >&5 -echo $ECHO_N "checking for mingwin runtime include path... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for mingwin runtime include path" >&5 +$as_echo_n "checking for mingwin runtime include path... " >&6; } cat >conftest.$ac_ext <<_ACEOF #include #include @@ -9022,11 +10737,11 @@ _ACEOF fi if test -z "$_mingw_lib_include_path"; then _mingw_lib_include_path="NO_LIB_INCLUDE" - echo "$as_me:$LINENO: result: no mingwin runtime includes" >&5 -echo "${ECHO_T}no mingwin runtime includes" >&6 + { $as_echo "$as_me:$LINENO: result: no mingwin runtime includes" >&5 +$as_echo "no mingwin runtime includes" >&6; } else - echo "$as_me:$LINENO: result: $_mingw_lib_include_path" >&5 -echo "${ECHO_T}$_mingw_lib_include_path" >&6 + { $as_echo "$as_me:$LINENO: result: $_mingw_lib_include_path" >&5 +$as_echo "$_mingw_lib_include_path" >&6; } fi MINGW_LIB_INCLUDE_PATH="$_mingw_lib_include_path" @@ -9034,66 +10749,66 @@ fi if test "$_os" = "SunOS"; then if test "$CC" = "cc"; then - echo "$as_me:$LINENO: checking SunStudio C++ Compiler" >&5 -echo $ECHO_N "checking SunStudio C++ Compiler... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking SunStudio C++ Compiler" >&5 +$as_echo_n "checking SunStudio C++ Compiler... " >&6; } if test "$CXX" != "CC"; then - { echo "$as_me:$LINENO: WARNING: SunStudio C++ was not found" >&5 -echo "$as_me: WARNING: SunStudio C++ was not found" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: SunStudio C++ was not found" >&5 +$as_echo "$as_me: WARNING: SunStudio C++ was not found" >&2;} echo "SunStudio C++ was not found" >> warn else - echo "$as_me:$LINENO: result: checked" >&5 -echo "${ECHO_T}checked" >&6 + { $as_echo "$as_me:$LINENO: result: checked" >&5 +$as_echo "checked" >&6; } fi fi fi if test "$_os" = "Darwin"; then if test "$CC" = "cc"; then - echo "$as_me:$LINENO: checking Macosx c++ Compiler" >&5 -echo $ECHO_N "checking Macosx c++ Compiler... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking Macosx c++ Compiler" >&5 +$as_echo_n "checking Macosx c++ Compiler... " >&6; } if test "$CXX" != "c++"; then - { echo "$as_me:$LINENO: WARNING: Macosx C++ was not found" >&5 -echo "$as_me: WARNING: Macosx C++ was not found" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: Macosx C++ was not found" >&5 +$as_echo "$as_me: WARNING: Macosx C++ was not found" >&2;} echo "Macosx C++ was not found" >> warn else - echo "$as_me:$LINENO: result: checked" >&5 -echo "${ECHO_T}checked" >&6 + { $as_echo "$as_me:$LINENO: result: checked" >&5 +$as_echo "checked" >&6; } fi fi fi if test "$_os" = "IRIX" -o "$_os" = "IRIX64"; then if test "$CC" = "cc"; then - echo "$as_me:$LINENO: checking SGI MIPSpro C++ Compiler" >&5 -echo $ECHO_N "checking SGI MIPSpro C++ Compiler... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking SGI MIPSpro C++ Compiler" >&5 +$as_echo_n "checking SGI MIPSpro C++ Compiler... " >&6; } if test "$CXX" != "CC"; then - { echo "$as_me:$LINENO: WARNING: SGI MIPSpro C++ was not found" >&5 -echo "$as_me: WARNING: SGI MIPSpro C++ was not found" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: SGI MIPSpro C++ was not found" >&5 +$as_echo "$as_me: WARNING: SGI MIPSpro C++ was not found" >&2;} echo "SGI MIPSpro C++ was not found" >> warn else - echo "$as_me:$LINENO: result: checked" >&5 -echo "${ECHO_T}checked" >&6 + { $as_echo "$as_me:$LINENO: result: checked" >&5 +$as_echo "checked" >&6; } fi fi fi if test "$_os" = "OSF1"; then - echo "$as_me:$LINENO: checking Compaq C++ compiler version" >&5 -echo $ECHO_N "checking Compaq C++ compiler version... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking Compaq C++ compiler version" >&5 +$as_echo_n "checking Compaq C++ compiler version... " >&6; } _compaqcxx_version=`$CXX -V 2>&1 | $AWK '{ print $3 }'` _compaqcxx_major=`echo $_compaqcxx_version | $AWK -F. '{ print $1 }'` if test "$_compaqcxx_major" != "V6"; then - { echo "$as_me:$LINENO: WARNING: found version \"$_compaqc_version\", use version 6 of the Compaq C++ compiler" >&5 -echo "$as_me: WARNING: found version \"$_compaqc_version\", use version 6 of the Compaq C++ compiler" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: found version \"$_compaqc_version\", use version 6 of the Compaq C++ compiler" >&5 +$as_echo "$as_me: WARNING: found version \"$_compaqc_version\", use version 6 of the Compaq C++ compiler" >&2;} echo "found version $_compaqc_version, use version 6 of the Compaq C++ compiler" >> warn else - echo "$as_me:$LINENO: result: checked" >&5 -echo "${ECHO_T}checked" >&6 + { $as_echo "$as_me:$LINENO: result: checked" >&5 +$as_echo "checked" >&6; } fi fi if test "$_os" = "SunOS"; then _temp=`showrev -p | $AWK -F" " '{ print $2 }'` if test "$_os_release" = "7"; then - echo "$as_me:$LINENO: checking for patch 106327-06 or greater" >&5 -echo $ECHO_N "checking for patch 106327-06 or greater... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for patch 106327-06 or greater" >&5 +$as_echo_n "checking for patch 106327-06 or greater... " >&6; } _patch=`echo $_temp | $AWK '/106327-06/ { print "found" }'` _patch="false" for i in $_temp @@ -9107,15 +10822,15 @@ echo $ECHO_N "checking for patch 106327-06 or greater... $ECHO_C" >&6 fi done if test "$_patch" = "found"; then - echo "$as_me:$LINENO: result: found" >&5 -echo "${ECHO_T}found" >&6 + { $as_echo "$as_me:$LINENO: result: found" >&5 +$as_echo "found" >&6; } else - { echo "$as_me:$LINENO: WARNING: patch 106327-06 not found, please install compiler patch 106327-06 or greater" >&5 -echo "$as_me: WARNING: patch 106327-06 not found, please install compiler patch 106327-06 or greater" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: patch 106327-06 not found, please install compiler patch 106327-06 or greater" >&5 +$as_echo "$as_me: WARNING: patch 106327-06 not found, please install compiler patch 106327-06 or greater" >&2;} echo "patch 106327-06 not found, please install compiler patch 106327-06 or greater" >> warn fi - echo "$as_me:$LINENO: checking for patch 106950-11 or greater" >&5 -echo $ECHO_N "checking for patch 106950-11 or greater... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for patch 106950-11 or greater" >&5 +$as_echo_n "checking for patch 106950-11 or greater... " >&6; } _patch=`echo $_temp | $AWK '/106950-11/ { print "found" }'` _patch="false" for i in $_temp @@ -9129,17 +10844,17 @@ echo $ECHO_N "checking for patch 106950-11 or greater... $ECHO_C" >&6 fi done if test "$_patch" = "found"; then - echo "$as_me:$LINENO: result: found" >&5 -echo "${ECHO_T}found" >&6 + { $as_echo "$as_me:$LINENO: result: found" >&5 +$as_echo "found" >&6; } else - { echo "$as_me:$LINENO: WARNING: patch 106950-11 not found, please install linker patch 106950-11 or greater" >&5 -echo "$as_me: WARNING: patch 106950-11 not found, please install linker patch 106950-11 or greater" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: patch 106950-11 not found, please install linker patch 106950-11 or greater" >&5 +$as_echo "$as_me: WARNING: patch 106950-11 not found, please install linker patch 106950-11 or greater" >&2;} echo "patch 106950-11 not found, please install linker patch 106950-11 or greater" >> warn fi else if test "$_os_release" = "6"; then - echo "$as_me:$LINENO: checking for patch 105591-09 or greater" >&5 -echo $ECHO_N "checking for patch 105591-09 or greater... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for patch 105591-09 or greater" >&5 +$as_echo_n "checking for patch 105591-09 or greater... " >&6; } _patch=`echo $_temp | $AWK '/105591-09/ { print "found" }'` _patch="false" for i in $_temp @@ -9153,15 +10868,15 @@ echo $ECHO_N "checking for patch 105591-09 or greater... $ECHO_C" >&6 fi done if test "$_patch" = "found"; then - echo "$as_me:$LINENO: result: found" >&5 -echo "${ECHO_T}found" >&6 + { $as_echo "$as_me:$LINENO: result: found" >&5 +$as_echo "found" >&6; } else - { echo "$as_me:$LINENO: WARNING: patch 105591-09 not found, please install compiler patch 105591-09 or greater" >&5 -echo "$as_me: WARNING: patch 105591-09 not found, please install compiler patch 105591-09 or greater" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: patch 105591-09 not found, please install compiler patch 105591-09 or greater" >&5 +$as_echo "$as_me: WARNING: patch 105591-09 not found, please install compiler patch 105591-09 or greater" >&2;} echo "patch 105591-09 not found, please install compiler patch 105591-09 or greater" >> warn fi - echo "$as_me:$LINENO: checking for patch 107733-08 or greater" >&5 -echo $ECHO_N "checking for patch 107733-08 or greater... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for patch 107733-08 or greater" >&5 +$as_echo_n "checking for patch 107733-08 or greater... " >&6; } _patch=`echo $_temp | $AWK '/107733-08/ { print "found" }'` _patch="false" for i in $_temp @@ -9175,11 +10890,11 @@ echo $ECHO_N "checking for patch 107733-08 or greater... $ECHO_C" >&6 fi done if test "$_patch" = "found"; then - echo "$as_me:$LINENO: result: found" >&5 -echo "${ECHO_T}found" >&6 + { $as_echo "$as_me:$LINENO: result: found" >&5 +$as_echo "found" >&6; } else - { echo "$as_me:$LINENO: WARNING: patch 107733-06 not found, please install linker patch 107733-08 or greater" >&5 -echo "$as_me: WARNING: patch 107733-06 not found, please install linker patch 107733-08 or greater" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: patch 107733-06 not found, please install linker patch 107733-08 or greater" >&5 +$as_echo "$as_me: WARNING: patch 107733-06 not found, please install linker patch 107733-08 or greater" >&2;} echo "patch 107733-06 not found, please install linker patch 107733-08 or greater" >> warn fi fi @@ -9188,25 +10903,25 @@ fi if test -n "$enable_sgistl" && "$enable_sgistl" != "no"; then if test "$_os" = "IRIX" -o "$_os" = "IRIX64"; then - echo "$as_me:$LINENO: checking for SGI STL" >&5 -echo $ECHO_N "checking for SGI STL... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for SGI STL" >&5 +$as_echo_n "checking for SGI STL... " >&6; } if test -d /usr/include/CC ; then - echo "$as_me:$LINENO: result: yes." >&5 -echo "${ECHO_T}yes." >&6 + { $as_echo "$as_me:$LINENO: result: yes." >&5 +$as_echo "yes." >&6; } else - echo "$as_me:$LINENO: result: not found." >&5 -echo "${ECHO_T}not found." >&6 + { $as_echo "$as_me:$LINENO: result: not found." >&5 +$as_echo "not found." >&6; } fi else - { { echo "$as_me:$LINENO: error: Option --enable-sgistl is only valid for IRIX" >&5 -echo "$as_me: error: Option --enable-sgistl is only valid for IRIX" >&2;} + { { $as_echo "$as_me:$LINENO: error: Option --enable-sgistl is only valid for IRIX" >&5 +$as_echo "$as_me: error: Option --enable-sgistl is only valid for IRIX" >&2;} { (exit 1); exit 1; }; } fi else - echo "$as_me:$LINENO: checking what the default STL should be" >&5 -echo $ECHO_N "checking what the default STL should be... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking what the default STL should be" >&5 +$as_echo_n "checking what the default STL should be... " >&6; } DEFAULT_TO_STLPORT="no" if test "$_os" = "Linux"; then case "$build_cpu" in @@ -9227,42 +10942,41 @@ echo $ECHO_N "checking what the default STL should be... $ECHO_C" >&6 DEFAULT_TO_STLPORT="yes" fi if test "$DEFAULT_TO_STLPORT" = "yes"; then - echo "$as_me:$LINENO: result: stlport" >&5 -echo "${ECHO_T}stlport" >&6 + { $as_echo "$as_me:$LINENO: result: stlport" >&5 +$as_echo "stlport" >&6; } else - echo "$as_me:$LINENO: result: system" >&5 -echo "${ECHO_T}system" >&6 + { $as_echo "$as_me:$LINENO: result: system" >&5 +$as_echo "system" >&6; } fi if test "$WITH_STLPORT" = "auto"; then WITH_STLPORT=$DEFAULT_TO_STLPORT fi - echo "$as_me:$LINENO: checking for STL providing headers" >&5 -echo $ECHO_N "checking for STL providing headers... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for STL providing headers" >&5 +$as_echo_n "checking for STL providing headers... " >&6; } STLPORT4="" USE_SYSTEM_STL="" if test "$WITH_STLPORT" = "yes"; then - echo "$as_me:$LINENO: result: using internal stlport." >&5 -echo "${ECHO_T}using internal stlport." >&6 + { $as_echo "$as_me:$LINENO: result: using internal stlport." >&5 +$as_echo "using internal stlport." >&6; } if test "$DEFAULT_TO_STLPORT" != "yes"; then - { echo "$as_me:$LINENO: WARNING: using stlport. Warning, breaks your ABI compatability!" >&5 -echo "$as_me: WARNING: using stlport. Warning, breaks your ABI compatability!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: using stlport. Warning, breaks your ABI compatability!" >&5 +$as_echo "$as_me: WARNING: using stlport. Warning, breaks your ABI compatability!" >&2;} echo "using stlport. Warning, breaks your ABI compatability!" >>warn fi elif test "$WITH_STLPORT" = "no"; then - echo "$as_me:$LINENO: result: using system STL" >&5 -echo "${ECHO_T}using system STL" >&6 + { $as_echo "$as_me:$LINENO: result: using system STL" >&5 +$as_echo "using system STL" >&6; } USE_SYSTEM_STL="YES" if test "$DEFAULT_TO_STLPORT" != "no"; then - { echo "$as_me:$LINENO: WARNING: using system STL. Warning, breaks your ABI compatability!" >&5 -echo "$as_me: WARNING: using system STL. Warning, breaks your ABI compatability!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: using system STL. Warning, breaks your ABI compatability!" >&5 +$as_echo "$as_me: WARNING: using system STL. Warning, breaks your ABI compatability!" >&2;} echo "using system STL. Warning, breaks your ABI compatability!" >>warn fi else STLPORT4=$WITH_STLPORT if test "$_os" != "WINNT" -o "$WITH_MINGWIN" = "yes"; then cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -9270,109 +10984,110 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $STLPORT4/stlport/hash_map _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - echo "$as_me:$LINENO: result: checked." >&5 -echo "${ECHO_T}checked." >&6 -else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + { $as_echo "$as_me:$LINENO: result: checked." >&5 +$as_echo "checked." >&6; } +else + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { { echo "$as_me:$LINENO: error: STLport headers not found." >&5 -echo "$as_me: error: STLport headers not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: STLport headers not found." >&5 +$as_echo "$as_me: error: STLport headers not found." >&2;} { (exit 1); exit 1; }; } fi + rm -f conftest.err conftest.$ac_ext else if test -f "$STLPORT4/stlport/hash_map"; then - echo "$as_me:$LINENO: result: checked." >&5 -echo "${ECHO_T}checked." >&6 + { $as_echo "$as_me:$LINENO: result: checked." >&5 +$as_echo "checked." >&6; } else - { { echo "$as_me:$LINENO: error: STLport headers not found." >&5 -echo "$as_me: error: STLport headers not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: STLport headers not found." >&5 +$as_echo "$as_me: error: STLport headers not found." >&2;} { (exit 1); exit 1; }; } fi fi if test "$_os" != "WINNT" -o "$WITH_MINGWIN" = "yes"; then - echo "$as_me:$LINENO: checking for STLport libraries" >&5 -echo $ECHO_N "checking for STLport libraries... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for STLport libraries" >&5 +$as_echo_n "checking for STLport libraries... " >&6; } if test "$_os" = "SunOS"; then if test -f "$STLPORT4/lib/libstlport_sunpro.so"; then - echo "$as_me:$LINENO: result: checked" >&5 -echo "${ECHO_T}checked" >&6 + { $as_echo "$as_me:$LINENO: result: checked" >&5 +$as_echo "checked" >&6; } elif test -f "$STLPORT4/lib/libstlport.so"; then - echo "$as_me:$LINENO: result: checked" >&5 -echo "${ECHO_T}checked" >&6 + { $as_echo "$as_me:$LINENO: result: checked" >&5 +$as_echo "checked" >&6; } STLPORT_VER=500 else - { { echo "$as_me:$LINENO: error: STLport libraries not found" >&5 -echo "$as_me: error: STLport libraries not found" >&2;} + { { $as_echo "$as_me:$LINENO: error: STLport libraries not found" >&5 +$as_echo "$as_me: error: STLport libraries not found" >&2;} { (exit 1); exit 1; }; } fi elif test "$_os" = "Darwin"; then if test -f "$STLPORT4/lib/libstlport_gcc.dylib"; then - echo "$as_me:$LINENO: result: checked" >&5 -echo "${ECHO_T}checked" >&6 + { $as_echo "$as_me:$LINENO: result: checked" >&5 +$as_echo "checked" >&6; } elif test -f "$STLPORT4/lib/libstlport.dylib"; then - echo "$as_me:$LINENO: result: checked" >&5 -echo "${ECHO_T}checked" >&6 + { $as_echo "$as_me:$LINENO: result: checked" >&5 +$as_echo "checked" >&6; } STLPORT_VER=500 else - { { echo "$as_me:$LINENO: error: STLport libraries not found" >&5 -echo "$as_me: error: STLport libraries not found" >&2;} + { { $as_echo "$as_me:$LINENO: error: STLport libraries not found" >&5 +$as_echo "$as_me: error: STLport libraries not found" >&2;} { (exit 1); exit 1; }; } fi elif test "$_os" = "IRIX" -o "$_os" = "IRIX64"; then if test -f "$STLPORT4/lib/libstlport_mipspro_41.so"; then - echo "$as_me:$LINENO: result: checked" >&5 -echo "${ECHO_T}checked" >&6 + { $as_echo "$as_me:$LINENO: result: checked" >&5 +$as_echo "checked" >&6; } else if test -f "$STLPORT4/lib/libstlport_gcc.so"; then - echo "$as_me:$LINENO: result: checked" >&5 -echo "${ECHO_T}checked" >&6 + { $as_echo "$as_me:$LINENO: result: checked" >&5 +$as_echo "checked" >&6; } elif test -f "$STLPORT4/lib/libstlport.so"; then - echo "$as_me:$LINENO: result: checked" >&5 -echo "${ECHO_T}checked" >&6 + { $as_echo "$as_me:$LINENO: result: checked" >&5 +$as_echo "checked" >&6; } STLPORT_VER=500 else - { { echo "$as_me:$LINENO: error: STLport libraries not found" >&5 -echo "$as_me: error: STLport libraries not found" >&2;} + { { $as_echo "$as_me:$LINENO: error: STLport libraries not found" >&5 +$as_echo "$as_me: error: STLport libraries not found" >&2;} { (exit 1); exit 1; }; } fi fi else if test -f "$STLPORT4/lib/libstlport_gcc.so"; then - echo "$as_me:$LINENO: result: checked" >&5 -echo "${ECHO_T}checked" >&6 + { $as_echo "$as_me:$LINENO: result: checked" >&5 +$as_echo "checked" >&6; } elif test -f "$STLPORT4/lib/libstlport.so"; then - echo "$as_me:$LINENO: result: checked" >&5 -echo "${ECHO_T}checked" >&6 + { $as_echo "$as_me:$LINENO: result: checked" >&5 +$as_echo "checked" >&6; } STLPORT_VER=500 else - { { echo "$as_me:$LINENO: error: STLport libraries not found" >&5 -echo "$as_me: error: STLport libraries not found" >&2;} + { { $as_echo "$as_me:$LINENO: error: STLport libraries not found" >&5 +$as_echo "$as_me: error: STLport libraries not found" >&2;} { (exit 1); exit 1; }; } fi fi fi if test "$DEFAULT_TO_STLPORT" != "yes"; then - { echo "$as_me:$LINENO: WARNING: using stlport. Warning, breaks your ABI compatability!" >&5 -echo "$as_me: WARNING: using stlport. Warning, breaks your ABI compatability!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: using stlport. Warning, breaks your ABI compatability!" >&5 +$as_echo "$as_me: WARNING: using stlport. Warning, breaks your ABI compatability!" >&2;} echo "using stlport. Warning, breaks your ABI compatability!" >>warn fi fi @@ -9389,12 +11104,11 @@ fi if test "$GCC" = "yes"; then - echo "$as_me:$LINENO: checking whether $CC supports -fvisibility=hidden" >&5 -echo $ECHO_N "checking whether $CC supports -fvisibility=hidden... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking whether $CC supports -fvisibility=hidden" >&5 +$as_echo_n "checking whether $CC supports -fvisibility=hidden... " >&6; } save_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -fvisibility=hidden" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -9410,38 +11124,51 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then HAVE_GCC_VISIBILITY_FEATURE=TRUE else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext CFLAGS=$save_CFLAGS if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi fi if test "$USE_SYSTEM_STL" = "YES"; then - echo "$as_me:$LINENO: checking if hash_map will be in __gnu_cxx namespace" >&5 -echo $ECHO_N "checking if hash_map will be in __gnu_cxx namespace... $ECHO_C" >&6 - ac_ext=cc + { $as_echo "$as_me:$LINENO: checking if hash_map will be in __gnu_cxx namespace" >&5 +$as_echo_n "checking if hash_map will be in __gnu_cxx namespace... " >&6; } + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -9450,7 +11177,6 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -9468,41 +11194,47 @@ hash_map t; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_cxx_have_ext_hash_map=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_cxx_have_ext_hash_map=no + ac_cv_cxx_have_ext_hash_map=no fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "$ac_cv_cxx_have_ext_hash_map" = "no"; then - { { echo "$as_me:$LINENO: error: Can't find hash_map. Try with --with-stlport" >&5 -echo "$as_me: error: Can't find hash_map. Try with --with-stlport" >&2;} + { { $as_echo "$as_me:$LINENO: error: Can't find hash_map. Try with --with-stlport" >&5 +$as_echo "$as_me: error: Can't find hash_map. Try with --with-stlport" >&2;} { (exit 1); exit 1; }; } else - echo "$as_me:$LINENO: result: $ac_cv_cxx_have_ext_hash_map" >&5 -echo "${ECHO_T}$ac_cv_cxx_have_ext_hash_map" >&6 + { $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_have_ext_hash_map" >&5 +$as_echo "$ac_cv_cxx_have_ext_hash_map" >&6; } fi if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then - echo "$as_me:$LINENO: checking if STL headers are visibility safe" >&5 -echo $ECHO_N "checking if STL headers are visibility safe... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking if STL headers are visibility safe" >&5 +$as_echo_n "checking if STL headers are visibility safe... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -9519,11 +11251,11 @@ else fi rm -f conftest* - echo "$as_me:$LINENO: result: $stlvisok" >&5 -echo "${ECHO_T}$stlvisok" >&6 + { $as_echo "$as_me:$LINENO: result: $stlvisok" >&5 +$as_echo "$stlvisok" >&6; } if test "$stlvisok" = "no"; then - { echo "$as_me:$LINENO: WARNING: Your gcc STL headers are not visibility safe. Disabling visibility" >&5 -echo "$as_me: WARNING: Your gcc STL headers are not visibility safe. Disabling visibility" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: Your gcc STL headers are not visibility safe. Disabling visibility" >&5 +$as_echo "$as_me: WARNING: Your gcc STL headers are not visibility safe. Disabling visibility" >&2;} echo "Your gcc STL headers are not visibility safe. Disabling visibility" >> warn unset HAVE_GCC_VISIBILITY_FEATURE fi @@ -9533,10 +11265,9 @@ echo "$as_me: WARNING: Your gcc STL headers are not visibility safe. Disabling v sharedlink_ldflags_save=$LDFLAGS LDFLAGS="$LDFLAGS -fvisibility-inlines-hidden -fpic -shared" - echo "$as_me:$LINENO: checking if gcc is -fvisibility-inlines-hidden safe with STL headers" >&5 -echo $ECHO_N "checking if gcc is -fvisibility-inlines-hidden safe with STL headers... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking if gcc is -fvisibility-inlines-hidden safe with STL headers" >&5 +$as_echo_n "checking if gcc is -fvisibility-inlines-hidden safe with STL headers... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -9554,31 +11285,43 @@ istringstream strm( "test" ); return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then $EGREP -q unresolvable conftest.err; if test $? -eq 0; then gccvisok=no; else gccvisok=yes; fi else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -gccvisok=no + gccvisok=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - echo "$as_me:$LINENO: result: $gccvisok" >&5 -echo "${ECHO_T}$gccvisok" >&6 + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + { $as_echo "$as_me:$LINENO: result: $gccvisok" >&5 +$as_echo "$gccvisok" >&6; } if test "$gccvisok" = "no"; then - { echo "$as_me:$LINENO: WARNING: Your gcc is not -fvisibility-inlines-hidden safe. Disabling visibility" >&5 -echo "$as_me: WARNING: Your gcc is not -fvisibility-inlines-hidden safe. Disabling visibility" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: Your gcc is not -fvisibility-inlines-hidden safe. Disabling visibility" >&5 +$as_echo "$as_me: WARNING: Your gcc is not -fvisibility-inlines-hidden safe. Disabling visibility" >&2;} echo "Your gcc is not -fvisibility-inlines-hidden safe. Disabling visibility" >> warn unset HAVE_GCC_VISIBILITY_FEATURE fi @@ -9587,8 +11330,8 @@ echo "$as_me: WARNING: Your gcc is not -fvisibility-inlines-hidden safe. Disabli fi if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then - echo "$as_me:$LINENO: checking if gcc has a visibility bug with class-level attributes (GCC bug 26905)" >&5 -echo $ECHO_N "checking if gcc has a visibility bug with class-level attributes (GCC bug 26905)... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking if gcc has a visibility bug with class-level attributes (GCC bug 26905)" >&5 +$as_echo_n "checking if gcc has a visibility bug with class-level attributes (GCC bug 26905)... " >&6; } cat >visibility.cxx <<_ACEOF #pragma GCC visibility push(hidden) struct __attribute__ ((visibility ("default"))) TestStruct { @@ -9609,11 +11352,11 @@ _ACEOF fi rm -f visibility.s - echo "$as_me:$LINENO: result: $gccvisbroken" >&5 -echo "${ECHO_T}$gccvisbroken" >&6 + { $as_echo "$as_me:$LINENO: result: $gccvisbroken" >&5 +$as_echo "$gccvisbroken" >&6; } if test "$gccvisbroken" = "yes"; then - { echo "$as_me:$LINENO: WARNING: Your gcc is not -fvisibility=hidden safe. Disabling visibility" >&5 -echo "$as_me: WARNING: Your gcc is not -fvisibility=hidden safe. Disabling visibility" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: Your gcc is not -fvisibility=hidden safe. Disabling visibility" >&5 +$as_echo "$as_me: WARNING: Your gcc is not -fvisibility=hidden safe. Disabling visibility" >&2;} echo "Your gcc is not -fvisibility=hidden safe. Disabling visibility" >> warn unset HAVE_GCC_VISIBILITY_FEATURE fi @@ -9629,11 +11372,11 @@ fi -echo "$as_me:$LINENO: checking which memory allocator to use" >&5 -echo $ECHO_N "checking which memory allocator to use... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking which memory allocator to use" >&5 +$as_echo_n "checking which memory allocator to use... " >&6; } if test "$with_alloc" = "system"; then - echo "$as_me:$LINENO: result: system" >&5 -echo "${ECHO_T}system" >&6 + { $as_echo "$as_me:$LINENO: result: system" >&5 +$as_echo "system" >&6; } ALLOC="SYS_ALLOC"; @@ -9641,82 +11384,99 @@ echo "${ECHO_T}system" >&6 for ac_func in malloc realloc calloc free do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ + #ifdef __STDC__ # include #else # include #endif -/* Override any gcc2 internal prototype to avoid an error. */ + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -9724,69 +11484,80 @@ done fi if test "$with_alloc" = "tcmalloc"; then - echo "$as_me:$LINENO: result: tcmalloc" >&5 -echo "${ECHO_T}tcmalloc" >&6 + { $as_echo "$as_me:$LINENO: result: tcmalloc" >&5 +$as_echo "tcmalloc" >&6; } if ! echo $build_cpu | grep -E 'i[3456]86' 2>/dev/null >/dev/null; then - { { echo "$as_me:$LINENO: error: tcmalloc only available/usable on ix86" >&5 -echo "$as_me: error: tcmalloc only available/usable on ix86" >&2;} + { { $as_echo "$as_me:$LINENO: error: tcmalloc only available/usable on ix86" >&5 +$as_echo "$as_me: error: tcmalloc only available/usable on ix86" >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: checking for malloc in -ltcmalloc" >&5 -echo $ECHO_N "checking for malloc in -ltcmalloc... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for malloc in -ltcmalloc" >&5 +$as_echo_n "checking for malloc in -ltcmalloc... " >&6; } if test "${ac_cv_lib_tcmalloc_malloc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ltcmalloc $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char malloc (); int main () { -malloc (); +return malloc (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_tcmalloc_malloc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_tcmalloc_malloc=no + ac_cv_lib_tcmalloc_malloc=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_tcmalloc_malloc" >&5 -echo "${ECHO_T}$ac_cv_lib_tcmalloc_malloc" >&6 -if test $ac_cv_lib_tcmalloc_malloc = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_tcmalloc_malloc" >&5 +$as_echo "$ac_cv_lib_tcmalloc_malloc" >&6; } +if test "x$ac_cv_lib_tcmalloc_malloc" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBTCMALLOC 1 _ACEOF @@ -9794,46 +11565,46 @@ _ACEOF LIBS="-ltcmalloc $LIBS" else - { { echo "$as_me:$LINENO: error: tcmalloc not found or functional. Install the Google Profiling Tools" >&5 -echo "$as_me: error: tcmalloc not found or functional. Install the Google Profiling Tools" >&2;} + { { $as_echo "$as_me:$LINENO: error: tcmalloc not found or functional. Install the Google Profiling Tools" >&5 +$as_echo "$as_me: error: tcmalloc not found or functional. Install the Google Profiling Tools" >&2;} { (exit 1); exit 1; }; } fi ALLOC="TCMALLOC"; fi if test "$with_alloc" = "internal" -o -z "$with_alloc"; then - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:$LINENO: result: internal" >&5 +$as_echo "internal" >&6; } fi -echo "$as_me:$LINENO: checking whether to add custom build version" >&5 -echo $ECHO_N "checking whether to add custom build version... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to add custom build version" >&5 +$as_echo_n "checking whether to add custom build version... " >&6; } if test "z$with_build_version" != "z"; then BUILD_VER_STRING=$with_build_version - echo "$as_me:$LINENO: result: yes, $BUILD_VER_STRING" >&5 -echo "${ECHO_T}yes, $BUILD_VER_STRING" >&6 + { $as_echo "$as_me:$LINENO: result: yes, $BUILD_VER_STRING" >&5 +$as_echo "yes, $BUILD_VER_STRING" >&6; } else BUILD_VER_STRING= - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi -echo "$as_me:$LINENO: checking whether to build with Java support" >&5 -echo $ECHO_N "checking whether to build with Java support... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to build with Java support" >&5 +$as_echo_n "checking whether to build with Java support... " >&6; } if test "$WITH_JAVA" != "no"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } SOLAR_JAVA="TRUE" else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } SOLAR_JAVA="" - { echo "$as_me:$LINENO: WARNING: building without java will mean some features will not be available" >&5 -echo "$as_me: WARNING: building without java will mean some features will not be available" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: building without java will mean some features will not be available" >&5 +$as_echo "$as_me: WARNING: building without java will mean some features will not be available" >&2;} echo "building without java will mean some features will not be available" >>warn fi @@ -9860,10 +11631,10 @@ if test "$SOLAR_JAVA" != ""; then if test -z "$with_jdk_home"; then # Extract the first word of "$WITH_JAVA", so it can be a program name with args. set dummy $WITH_JAVA; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_JAVAINTERPRETER+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $JAVAINTERPRETER in [\\/]* | ?:[\\/]*) @@ -9876,34 +11647,35 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_JAVAINTERPRETER="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi JAVAINTERPRETER=$ac_cv_path_JAVAINTERPRETER - if test -n "$JAVAINTERPRETER"; then - echo "$as_me:$LINENO: result: $JAVAINTERPRETER" >&5 -echo "${ECHO_T}$JAVAINTERPRETER" >&6 + { $as_echo "$as_me:$LINENO: result: $JAVAINTERPRETER" >&5 +$as_echo "$JAVAINTERPRETER" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + else _java_path="$with_jdk_home/bin/$WITH_JAVA" if test -x "$_java_path"; then JAVAINTERPRETER=$_java_path else - { { echo "$as_me:$LINENO: error: $_java_path not found set with_jdk_home" >&5 -echo "$as_me: error: $_java_path not found set with_jdk_home" >&2;} + { { $as_echo "$as_me:$LINENO: error: $_java_path not found set with_jdk_home" >&5 +$as_echo "$as_me: error: $_java_path not found set with_jdk_home" >&2;} { (exit 1); exit 1; }; } fi fi @@ -9918,12 +11690,12 @@ fi if test "$SOLAR_JAVA" != ""; then _gij_longver=0 - echo "$as_me:$LINENO: checking the installed JDK" >&5 -echo $ECHO_N "checking the installed JDK... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking the installed JDK" >&5 +$as_echo_n "checking the installed JDK... " >&6; } if test -n "$JAVAINTERPRETER"; then if test `$JAVAINTERPRETER -version 2>&1 | grep -c "Kaffe"` -gt 0; then - { { echo "$as_me:$LINENO: error: No valid check available. Please check the block for your desired java in configure.in" >&5 -echo "$as_me: error: No valid check available. Please check the block for your desired java in configure.in" >&2;} + { { $as_echo "$as_me:$LINENO: error: No valid check available. Please check the block for your desired java in configure.in" >&5 +$as_echo "$as_me: error: No valid check available. Please check the block for your desired java in configure.in" >&2;} { (exit 1); exit 1; }; } # dnl Kaffe specific tests # KAFFE_VER=`$JAVAINTERPRETER -version 2>&1 | $EGREP " Version:" | $SED -r "s/.* Version: ([[0-9\.]]*).*/\1/"` @@ -9944,14 +11716,14 @@ echo "$as_me: error: No valid check available. Please check the block for your d # JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*java,,p"` elif test `$JAVAINTERPRETER --version 2>&1 | grep -c "GNU libgcj"` -gt 0; then JDK=gcj - echo "$as_me:$LINENO: result: checked (gcj)" >&5 -echo "${ECHO_T}checked (gcj)" >&6 + { $as_echo "$as_me:$LINENO: result: checked (gcj)" >&5 +$as_echo "checked (gcj)" >&6; } _gij_version=`$JAVAINTERPRETER --version | grep GNU | $SED -e 's@^[^0-9]*@@' -e 's@ .*@@' -e 's@,.*@@'`; _gij_longver=`echo $_gij_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'` elif test `$JAVAINTERPRETER -version 2>&1 | awk '{ print }' | grep -c "BEA"` -gt 0; then - { { echo "$as_me:$LINENO: error: No valid check available. Please check the block for your desired java in configure.in" >&5 -echo "$as_me: error: No valid check available. Please check the block for your desired java in configure.in" >&2;} + { { $as_echo "$as_me:$LINENO: error: No valid check available. Please check the block for your desired java in configure.in" >&5 +$as_echo "$as_me: error: No valid check available. Please check the block for your desired java in configure.in" >&2;} { (exit 1); exit 1; }; } # JDK=bea # @@ -9982,18 +11754,18 @@ echo "$as_me: error: No valid check available. Please check the block for your d _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'` if test "$_jdk_ver" -lt 10600; then - { { echo "$as_me:$LINENO: error: IBM JDK is too old, you need at least 1.6" >&5 -echo "$as_me: error: IBM JDK is too old, you need at least 1.6" >&2;} + { { $as_echo "$as_me:$LINENO: error: IBM JDK is too old, you need at least 1.6" >&5 +$as_echo "$as_me: error: IBM JDK is too old, you need at least 1.6" >&2;} { (exit 1); exit 1; }; } fi - echo "$as_me:$LINENO: result: checked (IBM JDK $_jdk)" >&5 -echo "${ECHO_T}checked (IBM JDK $_jdk)" >&6 + { $as_echo "$as_me:$LINENO: result: checked (IBM JDK $_jdk)" >&5 +$as_echo "checked (IBM JDK $_jdk)" >&6; } if test "$with_jdk_home" = ""; then - { { echo "$as_me:$LINENO: error: In order to successfully build OpenOffice.org using the IBM JDK, + { { $as_echo "$as_me:$LINENO: error: In order to successfully build OpenOffice.org using the IBM JDK, you must use the \"--with-jdk-home\" configure option explicitly" >&5 -echo "$as_me: error: In order to successfully build OpenOffice.org using the IBM JDK, +$as_echo "$as_me: error: In order to successfully build OpenOffice.org using the IBM JDK, you must use the \"--with-jdk-home\" configure option explicitly" >&2;} { (exit 1); exit 1; }; } fi @@ -10007,12 +11779,12 @@ you must use the \"--with-jdk-home\" configure option explicitly" >&2;} _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'` if test "$_jdk_ver" -lt 10500; then - { { echo "$as_me:$LINENO: error: JDK is too old, you need at least 1.5" >&5 -echo "$as_me: error: JDK is too old, you need at least 1.5" >&2;} + { { $as_echo "$as_me:$LINENO: error: JDK is too old, you need at least 1.5" >&5 +$as_echo "$as_me: error: JDK is too old, you need at least 1.5" >&2;} { (exit 1); exit 1; }; } fi - echo "$as_me:$LINENO: result: checked (JDK $_jdk)" >&5 -echo "${ECHO_T}checked (JDK $_jdk)" >&6 + { $as_echo "$as_me:$LINENO: result: checked (JDK $_jdk)" >&5 +$as_echo "checked (JDK $_jdk)" >&6; } JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*java,,p"` if test "$_os" = "WINNT"; then JAVA_HOME=`echo $JAVA_HOME | $SED "s,\.[eE][xX][eE]$,,"` @@ -10022,8 +11794,8 @@ echo "${ECHO_T}checked (JDK $_jdk)" >&6 fi fi else - { { echo "$as_me:$LINENO: error: JAVA not found. You need at least jdk-1.5, or gcj-4" >&5 -echo "$as_me: error: JAVA not found. You need at least jdk-1.5, or gcj-4" >&2;} + { { $as_echo "$as_me:$LINENO: error: JAVA not found. You need at least jdk-1.5, or gcj-4" >&5 +$as_echo "$as_me: error: JAVA not found. You need at least jdk-1.5, or gcj-4" >&2;} { (exit 1); exit 1; }; } fi else @@ -10044,10 +11816,10 @@ if test "$SOLAR_JAVA" != ""; then if test -z "$with_jdk_home"; then # Extract the first word of "$javacompiler", so it can be a program name with args. set dummy $javacompiler; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_JAVACOMPILER+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $JAVACOMPILER in [\\/]* | ?:[\\/]*) @@ -10060,27 +11832,28 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_JAVACOMPILER="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi JAVACOMPILER=$ac_cv_path_JAVACOMPILER - if test -n "$JAVACOMPILER"; then - echo "$as_me:$LINENO: result: $JAVACOMPILER" >&5 -echo "${ECHO_T}$JAVACOMPILER" >&6 + { $as_echo "$as_me:$LINENO: result: $JAVACOMPILER" >&5 +$as_echo "$JAVACOMPILER" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + else _javac_path="$with_jdk_home/bin/$javacompiler" if test -x "$_javac_path"; then @@ -10088,8 +11861,8 @@ fi fi fi if test -z "$JAVACOMPILER"; then - { { echo "$as_me:$LINENO: error: $javacompiler not found set with_jdk_home" >&5 -echo "$as_me: error: $javacompiler not found set with_jdk_home" >&2;} + { { $as_echo "$as_me:$LINENO: error: $javacompiler not found set with_jdk_home" >&5 +$as_echo "$as_me: error: $javacompiler not found set with_jdk_home" >&2;} { (exit 1); exit 1; }; } fi if test "$_os" = "WINNT"; then @@ -10106,11 +11879,11 @@ echo "$as_me: error: $javacompiler not found set with_jdk_home" >&2;} fi if test `$JAVACOMPILER -version 2>&1 | grep -c "Eclipse Java Compiler"` -gt 0; then - echo "$as_me:$LINENO: checking re-checking JDK" >&5 -echo $ECHO_N "checking re-checking JDK... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking re-checking JDK" >&5 +$as_echo_n "checking re-checking JDK... " >&6; } JDK=gcj - echo "$as_me:$LINENO: result: checked (ecj)" >&5 -echo "${ECHO_T}checked (ecj)" >&6 + { $as_echo "$as_me:$LINENO: result: checked (ecj)" >&5 +$as_echo "checked (ecj)" >&6; } #TODO: what's to do here? some switch to do 1.5 compiling? JAVAFLAGS="-source 1.5 -target 1.5" _gij_longver="50000" @@ -10129,10 +11902,10 @@ if test "$SOLAR_JAVA" != ""; then if test -z "$with_jdk_home"; then # Extract the first word of "javadoc", so it can be a program name with args. set dummy javadoc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_JAVADOC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $JAVADOC in [\\/]* | ?:[\\/]*) @@ -10145,27 +11918,28 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_JAVADOC="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi JAVADOC=$ac_cv_path_JAVADOC - if test -n "$JAVADOC"; then - echo "$as_me:$LINENO: result: $JAVADOC" >&5 -echo "${ECHO_T}$JAVADOC" >&6 + { $as_echo "$as_me:$LINENO: result: $JAVADOC" >&5 +$as_echo "$JAVADOC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + else _javadoc_path="$with_jdk_home/bin/javadoc" if test "$_os" = "OS2"; then @@ -10178,10 +11952,10 @@ fi else # Extract the first word of "javadoc", so it can be a program name with args. set dummy javadoc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_JAVADOC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $JAVADOC in [\\/]* | ?:[\\/]*) @@ -10194,32 +11968,33 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_JAVADOC="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi JAVADOC=$ac_cv_path_JAVADOC - if test -n "$JAVADOC"; then - echo "$as_me:$LINENO: result: $JAVADOC" >&5 -echo "${ECHO_T}$JAVADOC" >&6 + { $as_echo "$as_me:$LINENO: result: $JAVADOC" >&5 +$as_echo "$JAVADOC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + fi fi if test -z "$JAVADOC"; then - { { echo "$as_me:$LINENO: error: $_javadoc_path not found set with_jdk_home" >&5 -echo "$as_me: error: $_javadoc_path not found set with_jdk_home" >&2;} + { { $as_echo "$as_me:$LINENO: error: $_javadoc_path not found set with_jdk_home" >&5 +$as_echo "$as_me: error: $_javadoc_path not found set with_jdk_home" >&2;} { (exit 1); exit 1; }; } fi if test "$_os" = "WINNT"; then @@ -10252,36 +12027,36 @@ class findhome } } _ACEOF - echo "$as_me:$LINENO: checking if javac works" >&5 -echo $ECHO_N "checking if javac works... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking if javac works" >&5 +$as_echo_n "checking if javac works... " >&6; } javac_cmd="$JAVACOMPILER findhome.java 1>&2" { (eval echo "$as_me:$LINENO: \"$javac_cmd\"") >&5 (eval $javac_cmd) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } if test $? = 0 && test -f ./findhome.class ; then - echo "$as_me:$LINENO: result: javac works" >&5 -echo "${ECHO_T}javac works" >&6 + { $as_echo "$as_me:$LINENO: result: javac works" >&5 +$as_echo "javac works" >&6; } else echo "configure: javac test failed" >&5 cat findhome.java >&5 - { { echo "$as_me:$LINENO: error: javac does not work - java projects will not build!" >&5 -echo "$as_me: error: javac does not work - java projects will not build!" >&2;} + { { $as_echo "$as_me:$LINENO: error: javac does not work - java projects will not build!" >&5 +$as_echo "$as_me: error: javac does not work - java projects will not build!" >&2;} { (exit 1); exit 1; }; } fi - echo "$as_me:$LINENO: checking if gij knows its java.home" >&5 -echo $ECHO_N "checking if gij knows its java.home... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking if gij knows its java.home" >&5 +$as_echo_n "checking if gij knows its java.home... " >&6; } JAVA_HOME=`$JAVAINTERPRETER findhome` if test $? = 0 && test "$JAVA_HOME" != "" ; then - echo "$as_me:$LINENO: result: $JAVA_HOME" >&5 -echo "${ECHO_T}$JAVA_HOME" >&6 + { $as_echo "$as_me:$LINENO: result: $JAVA_HOME" >&5 +$as_echo "$JAVA_HOME" >&6; } else echo "configure: java test failed" >&5 cat findhome.java >&5 - { { echo "$as_me:$LINENO: error: gij does not know its java.home - use --with-jdk-home" >&5 -echo "$as_me: error: gij does not know its java.home - use --with-jdk-home" >&2;} + { { $as_echo "$as_me:$LINENO: error: gij does not know its java.home - use --with-jdk-home" >&5 +$as_echo "$as_me: error: gij does not know its java.home - use --with-jdk-home" >&2;} { (exit 1); exit 1; }; } fi else @@ -10304,10 +12079,10 @@ echo "$as_me: error: gij does not know its java.home - use --with-jdk-home" >&2; JAVA_HOME=$(readlink $JAVACOMPILER) else # else warn - { echo "$as_me:$LINENO: WARNING: JAVA_HOME is set to /usr - this is very likely to be incorrect" >&5 -echo "$as_me: WARNING: JAVA_HOME is set to /usr - this is very likely to be incorrect" >&2;} - { echo "$as_me:$LINENO: WARNING: if this is the case, please inform the correct JAVA_HOME with --with-jdk-home" >&5 -echo "$as_me: WARNING: if this is the case, please inform the correct JAVA_HOME with --with-jdk-home" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: JAVA_HOME is set to /usr - this is very likely to be incorrect" >&5 +$as_echo "$as_me: WARNING: JAVA_HOME is set to /usr - this is very likely to be incorrect" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: if this is the case, please inform the correct JAVA_HOME with --with-jdk-home" >&5 +$as_echo "$as_me: WARNING: if this is the case, please inform the correct JAVA_HOME with --with-jdk-home" >&2;} echo "JAVA_HOME is set to /usr - this is very likely to be incorrect" >> warn echo "if this is the case, please inform the correct JAVA_HOME with --with-jdk-home" >> warn fi @@ -10329,12 +12104,12 @@ echo "$as_me: WARNING: if this is the case, please inform the correct JAVA_HOME JAVA_HOME_OK="NO" fi if test "$JAVA_HOME_OK" = "NO"; then - { echo "$as_me:$LINENO: WARNING: JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script" >&5 -echo "$as_me: WARNING: JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script" >&2;} - { echo "$as_me:$LINENO: WARNING: attempted to find JAVA_HOME automatically, but apparently it failed" >&5 -echo "$as_me: WARNING: attempted to find JAVA_HOME automatically, but apparently it failed" >&2;} - { echo "$as_me:$LINENO: WARNING: in case JAVA_HOME is incorrectly set, some projects with not be built correctly" >&5 -echo "$as_me: WARNING: in case JAVA_HOME is incorrectly set, some projects with not be built correctly" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script" >&5 +$as_echo "$as_me: WARNING: JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: attempted to find JAVA_HOME automatically, but apparently it failed" >&5 +$as_echo "$as_me: WARNING: attempted to find JAVA_HOME automatically, but apparently it failed" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: in case JAVA_HOME is incorrectly set, some projects with not be built correctly" >&5 +$as_echo "$as_me: WARNING: in case JAVA_HOME is incorrectly set, some projects with not be built correctly" >&2;} echo "JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script" >> warn echo "attempted to find JAVA_HOME automatically, but apparently it failed" >> warn echo "in case JAVA_HOME is incorrectly set, some projects with not be built correctly" >> warn @@ -10347,8 +12122,8 @@ fi AWTLIB= if test "$SOLAR_JAVA" != ""; then - echo "$as_me:$LINENO: checking for jawt lib name" >&5 -echo $ECHO_N "checking for jawt lib name... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for jawt lib name" >&5 +$as_echo_n "checking for jawt lib name... " >&6; } if test "$JDK" = "gcj"; then save_CFLAGS=$CFLAGS save_LDFLAGS=$LDFLAGS @@ -10356,19 +12131,18 @@ echo $ECHO_N "checking for jawt lib name... $ECHO_C" >&6 LDFLAGS="$LDFLAGS -L$JAVA_HOME/lib -lgcj" exec 6>/dev/null # no output if test "${ac_cv_header_jni_h+set}" = set; then - echo "$as_me:$LINENO: checking for jni.h" >&5 -echo $ECHO_N "checking for jni.h... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for jni.h" >&5 +$as_echo_n "checking for jni.h... " >&6; } if test "${ac_cv_header_jni_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_jni_h" >&5 -echo "${ECHO_T}$ac_cv_header_jni_h" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_jni_h" >&5 +$as_echo "$ac_cv_header_jni_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking jni.h usability" >&5 -echo $ECHO_N "checking jni.h usability... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking jni.h usability" >&5 +$as_echo_n "checking jni.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -10378,33 +12152,39 @@ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking jni.h presence" >&5 -echo $ECHO_N "checking jni.h presence... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking jni.h presence" >&5 +$as_echo_n "checking jni.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -10412,142 +12192,146 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: jni.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: jni.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: jni.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: jni.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: jni.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: jni.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: jni.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: jni.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: jni.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: jni.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: jni.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: jni.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: jni.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: jni.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: jni.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: jni.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: jni.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: jni.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: jni.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: jni.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: jni.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: jni.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: jni.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: jni.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: jni.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: jni.h: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for jni.h" >&5 -echo $ECHO_N "checking for jni.h... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for jni.h" >&5 +$as_echo_n "checking for jni.h... " >&6; } if test "${ac_cv_header_jni_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_jni_h=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_jni_h" >&5 -echo "${ECHO_T}$ac_cv_header_jni_h" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_jni_h" >&5 +$as_echo "$ac_cv_header_jni_h" >&6; } fi -if test $ac_cv_header_jni_h = yes; then +if test "x$ac_cv_header_jni_h" = x""yes; then : else - { { echo "$as_me:$LINENO: error: jni.h could not be found. Mismatch between gcc and libgcj or libgcj-devel missing?" >&5 -echo "$as_me: error: jni.h could not be found. Mismatch between gcc and libgcj or libgcj-devel missing?" >&2;} + { { $as_echo "$as_me:$LINENO: error: jni.h could not be found. Mismatch between gcc and libgcj or libgcj-devel missing?" >&5 +$as_echo "$as_me: error: jni.h could not be found. Mismatch between gcc and libgcj or libgcj-devel missing?" >&2;} { (exit 1); exit 1; }; } fi - echo "$as_me:$LINENO: checking for JAWT_GetAWT in -lgcjawt" >&5 -echo $ECHO_N "checking for JAWT_GetAWT in -lgcjawt... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for JAWT_GetAWT in -lgcjawt" >&5 +$as_echo_n "checking for JAWT_GetAWT in -lgcjawt... " >&6; } if test "${ac_cv_lib_gcjawt_JAWT_GetAWT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgcjawt $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char JAWT_GetAWT (); int main () { -JAWT_GetAWT (); +return JAWT_GetAWT (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_gcjawt_JAWT_GetAWT=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_gcjawt_JAWT_GetAWT=no + ac_cv_lib_gcjawt_JAWT_GetAWT=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_gcjawt_JAWT_GetAWT" >&5 -echo "${ECHO_T}$ac_cv_lib_gcjawt_JAWT_GetAWT" >&6 -if test $ac_cv_lib_gcjawt_JAWT_GetAWT = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_gcjawt_JAWT_GetAWT" >&5 +$as_echo "$ac_cv_lib_gcjawt_JAWT_GetAWT" >&6; } +if test "x$ac_cv_lib_gcjawt_JAWT_GetAWT" = x""yes; then AWTLIB="-lgcjawt -lgcj" fi @@ -10567,19 +12351,18 @@ fi export LD_LIBRARY_PATH exec 6>/dev/null # no output if test "${ac_cv_header_jni_h+set}" = set; then - echo "$as_me:$LINENO: checking for jni.h" >&5 -echo $ECHO_N "checking for jni.h... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for jni.h" >&5 +$as_echo_n "checking for jni.h... " >&6; } if test "${ac_cv_header_jni_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_jni_h" >&5 -echo "${ECHO_T}$ac_cv_header_jni_h" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_jni_h" >&5 +$as_echo "$ac_cv_header_jni_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking jni.h usability" >&5 -echo $ECHO_N "checking jni.h usability... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking jni.h usability" >&5 +$as_echo_n "checking jni.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -10589,33 +12372,39 @@ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking jni.h presence" >&5 -echo $ECHO_N "checking jni.h presence... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking jni.h presence" >&5 +$as_echo_n "checking jni.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -10623,202 +12412,217 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: jni.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: jni.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: jni.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: jni.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: jni.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: jni.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: jni.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: jni.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: jni.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: jni.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: jni.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: jni.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: jni.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: jni.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: jni.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: jni.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: jni.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: jni.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: jni.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: jni.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: jni.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: jni.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: jni.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: jni.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: jni.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: jni.h: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for jni.h" >&5 -echo $ECHO_N "checking for jni.h... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for jni.h" >&5 +$as_echo_n "checking for jni.h... " >&6; } if test "${ac_cv_header_jni_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_jni_h=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_jni_h" >&5 -echo "${ECHO_T}$ac_cv_header_jni_h" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_jni_h" >&5 +$as_echo "$ac_cv_header_jni_h" >&6; } fi -if test $ac_cv_header_jni_h = yes; then +if test "x$ac_cv_header_jni_h" = x""yes; then : else - { { echo "$as_me:$LINENO: error: jni.h could not be found." >&5 -echo "$as_me: error: jni.h could not be found." >&2;} + { { $as_echo "$as_me:$LINENO: error: jni.h could not be found." >&5 +$as_echo "$as_me: error: jni.h could not be found." >&2;} { (exit 1); exit 1; }; } fi - echo "$as_me:$LINENO: checking for JAWT_GetAWT in -ljawt" >&5 -echo $ECHO_N "checking for JAWT_GetAWT in -ljawt... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for JAWT_GetAWT in -ljawt" >&5 +$as_echo_n "checking for JAWT_GetAWT in -ljawt... " >&6; } if test "${ac_cv_lib_jawt_JAWT_GetAWT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ljawt $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char JAWT_GetAWT (); int main () { -JAWT_GetAWT (); +return JAWT_GetAWT (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_jawt_JAWT_GetAWT=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_jawt_JAWT_GetAWT=no + ac_cv_lib_jawt_JAWT_GetAWT=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_jawt_JAWT_GetAWT" >&5 -echo "${ECHO_T}$ac_cv_lib_jawt_JAWT_GetAWT" >&6 -if test $ac_cv_lib_jawt_JAWT_GetAWT = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_jawt_JAWT_GetAWT" >&5 +$as_echo "$ac_cv_lib_jawt_JAWT_GetAWT" >&6; } +if test "x$ac_cv_lib_jawt_JAWT_GetAWT" = x""yes; then AWTLIB="-ljawt" fi if test -z "$AWTLIB"; then LDFLAGS="$LDFLAGS -L$JAVA_HOME/jre/bin/xawt -ljawt" - echo "$as_me:$LINENO: checking for JAWT_GetAWT in -lmawt" >&5 -echo $ECHO_N "checking for JAWT_GetAWT in -lmawt... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for JAWT_GetAWT in -lmawt" >&5 +$as_echo_n "checking for JAWT_GetAWT in -lmawt... " >&6; } if test "${ac_cv_lib_mawt_JAWT_GetAWT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmawt $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char JAWT_GetAWT (); int main () { -JAWT_GetAWT (); +return JAWT_GetAWT (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_mawt_JAWT_GetAWT=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_mawt_JAWT_GetAWT=no + ac_cv_lib_mawt_JAWT_GetAWT=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_mawt_JAWT_GetAWT" >&5 -echo "${ECHO_T}$ac_cv_lib_mawt_JAWT_GetAWT" >&6 -if test $ac_cv_lib_mawt_JAWT_GetAWT = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_mawt_JAWT_GetAWT" >&5 +$as_echo "$ac_cv_lib_mawt_JAWT_GetAWT" >&6; } +if test "x$ac_cv_lib_mawt_JAWT_GetAWT" = x""yes; then AWTLIB="-L$JAVA_HOME/jre/bin/xawt -ljawt -lmawt" fi @@ -10831,24 +12635,24 @@ fi if test -z "$AWTLIB"; then AWTLIB=-ljawt fi - echo "$as_me:$LINENO: result: $AWTLIB" >&5 -echo "${ECHO_T}$AWTLIB" >&6 + { $as_echo "$as_me:$LINENO: result: $AWTLIB" >&5 +$as_echo "$AWTLIB" >&6; } fi if test "$SOLAR_JAVA" != ""; then - echo "$as_me:$LINENO: checking whether to enable gcj aot compilation" >&5 -echo $ECHO_N "checking whether to enable gcj aot compilation... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking whether to enable gcj aot compilation" >&5 +$as_echo_n "checking whether to enable gcj aot compilation... " >&6; } if test -n "$enable_gcjaot" && test "$enable_gcjaot" != "no"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } if test `echo $WITH_JAVA | grep -c "gij"` -eq 0; then gcjaot="gcj" else gcjaot=`echo $WITH_JAVA | $SED -e "s/gij/gcj/g"` fi - echo "$as_me:$LINENO: result: $gcjaot" >&5 -echo "${ECHO_T}$gcjaot" >&6 + { $as_echo "$as_me:$LINENO: result: $gcjaot" >&5 +$as_echo "$gcjaot" >&6; } if test -n "$with_jdk_home"; then _javac_path="$with_jdk_home/bin/$gcjaot" if test -x "$_javac_path"; then @@ -10858,10 +12662,10 @@ echo "${ECHO_T}$gcjaot" >&6 if test -z "$JAVAAOTCOMPILER"; then # Extract the first word of "$gcjaot", so it can be a program name with args. set dummy $gcjaot; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_JAVAAOTCOMPILER+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $JAVAAOTCOMPILER in [\\/]* | ?:[\\/]*) @@ -10874,35 +12678,36 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_JAVAAOTCOMPILER="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi JAVAAOTCOMPILER=$ac_cv_path_JAVAAOTCOMPILER - if test -n "$JAVAAOTCOMPILER"; then - echo "$as_me:$LINENO: result: $JAVAAOTCOMPILER" >&5 -echo "${ECHO_T}$JAVAAOTCOMPILER" >&6 + { $as_echo "$as_me:$LINENO: result: $JAVAAOTCOMPILER" >&5 +$as_echo "$JAVAAOTCOMPILER" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test -z "$JAVAAOTCOMPILER"; then - { echo "$as_me:$LINENO: WARNING: $gcjaot not found, set with_jdk_home" >&5 -echo "$as_me: WARNING: $gcjaot not found, set with_jdk_home" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $gcjaot not found, set with_jdk_home" >&5 +$as_echo "$as_me: WARNING: $gcjaot not found, set with_jdk_home" >&2;} fi else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi fi @@ -10918,10 +12723,10 @@ fi # Extract the first word of "dmake", so it can be a program name with args. set dummy dmake; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_DMAKE+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $DMAKE in [\\/]* | ?:[\\/]*) @@ -10934,34 +12739,35 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_DMAKE="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_path_DMAKE" && ac_cv_path_DMAKE="no" ;; esac fi DMAKE=$ac_cv_path_DMAKE - if test -n "$DMAKE"; then - echo "$as_me:$LINENO: result: $DMAKE" >&5 -echo "${ECHO_T}$DMAKE" >&6 + { $as_echo "$as_me:$LINENO: result: $DMAKE" >&5 +$as_echo "$DMAKE" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + if test "$DMAKE" = "no"; then BUILD_DMAKE=YES echo "dmake will be built on ./bootstrap" else - echo "$as_me:$LINENO: checking whether the found dmake is the right dmake" >&5 -echo $ECHO_N "checking whether the found dmake is the right dmake... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking whether the found dmake is the right dmake" >&5 +$as_echo_n "checking whether the found dmake is the right dmake... " >&6; } # we need to find out whether that dmake we found is "our" dmake # or the dmake from Sun's SunStudio Compiler which is something # different @@ -10970,48 +12776,48 @@ echo $ECHO_N "checking whether the found dmake is the right dmake... $ECHO_C" >& $DMAKE -V 2>/dev/null | grep 'dmake .* Version .*' >/dev/null if test $? -eq 0; then BUILD_DMAKE=NO - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - echo "$as_me:$LINENO: checking the dmake version" >&5 -echo $ECHO_N "checking the dmake version... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + { $as_echo "$as_me:$LINENO: checking the dmake version" >&5 +$as_echo_n "checking the dmake version... " >&6; } DMAKE_VERSION=`$DMAKE -V | $AWK '$3 == "Version" {print $4}'` if test "`echo $DMAKE_VERSION | cut -d'.' -f1`" -gt "4"; then - echo "$as_me:$LINENO: result: OK, >= 4.11" >&5 -echo "${ECHO_T}OK, >= 4.11" >&6 + { $as_echo "$as_me:$LINENO: result: OK, >= 4.11" >&5 +$as_echo "OK, >= 4.11" >&6; } elif test "`echo $DMAKE_VERSION | cut -d'.' -f1`" = "4" && \ test "`echo $DMAKE_VERSION | cut -d'.' -f2`" -ge "11"; then - echo "$as_me:$LINENO: result: OK, >= 4.11" >&5 -echo "${ECHO_T}OK, >= 4.11" >&6 + { $as_echo "$as_me:$LINENO: result: OK, >= 4.11" >&5 +$as_echo "OK, >= 4.11" >&6; } else - echo "$as_me:$LINENO: result: too old. >= 4.11 is needed" >&5 -echo "${ECHO_T}too old. >= 4.11 is needed" >&6 + { $as_echo "$as_me:$LINENO: result: too old. >= 4.11 is needed" >&5 +$as_echo "too old. >= 4.11 is needed" >&6; } echo "A newer dmake will be built on ./bootstrap" BUILD_DMAKE=YES fi else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } echo "dmake will be built on ./bootstrap" BUILD_DMAKE=YES fi fi -echo "$as_me:$LINENO: checking whether to enable EPM for packing" >&5 -echo $ECHO_N "checking whether to enable EPM for packing... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to enable EPM for packing" >&5 +$as_echo_n "checking whether to enable EPM for packing... " >&6; } if test "$_os" != "WINNT" -a \( "z$enable_epm" = "z" -o "$enable_epm" != "no" \) ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } if test "$_os" != "WINNT"; then if test -n "$with_epm"; then EPM=$with_epm else # Extract the first word of "epm", so it can be a program name with args. set dummy epm; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_EPM+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $EPM in [\\/]* | ?:[\\/]*) @@ -11024,28 +12830,29 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_EPM="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_path_EPM" && ac_cv_path_EPM="no" ;; esac fi EPM=$ac_cv_path_EPM - if test -n "$EPM"; then - echo "$as_me:$LINENO: result: $EPM" >&5 -echo "${ECHO_T}$EPM" >&6 + { $as_echo "$as_me:$LINENO: result: $EPM" >&5 +$as_echo "$EPM" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$EPM" = "no" || test "$EPM" = "internal"; then echo "EPM will be built." @@ -11053,44 +12860,44 @@ fi BUILD_TYPE="$BUILD_TYPE EPM" else # Gentoo has some epm which is something different... - echo "$as_me:$LINENO: checking whether the found epm is the right epm" >&5 -echo $ECHO_N "checking whether the found epm is the right epm... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking whether the found epm is the right epm" >&5 +$as_echo_n "checking whether the found epm is the right epm... " >&6; } if $EPM | grep "ESP Package Manager" >/dev/null 2>/dev/null; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - { { echo "$as_me:$LINENO: error: no. Install ESP Package Manager (www.easysw.com/epm) and/or specify the path to the right epm" >&5 -echo "$as_me: error: no. Install ESP Package Manager (www.easysw.com/epm) and/or specify the path to the right epm" >&2;} + { { $as_echo "$as_me:$LINENO: error: no. Install ESP Package Manager (www.easysw.com/epm) and/or specify the path to the right epm" >&5 +$as_echo "$as_me: error: no. Install ESP Package Manager (www.easysw.com/epm) and/or specify the path to the right epm" >&2;} { (exit 1); exit 1; }; } fi - echo "$as_me:$LINENO: checking epm version" >&5 -echo $ECHO_N "checking epm version... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking epm version" >&5 +$as_echo_n "checking epm version... " >&6; } EPM_VERSION=`$EPM | grep 'ESP Package Manager' | cut -d' ' -f4 | $SED -e s/v//` if test "`echo $EPM_VERSION | cut -d'.' -f1`" -gt "3" || \ test "`echo $EPM_VERSION | cut -d'.' -f1`" -eq "3" -a "`echo $EPM_VERSION | cut -d'.' -f2`" -ge "7"; then - echo "$as_me:$LINENO: result: OK, >= 3.7" >&5 -echo "${ECHO_T}OK, >= 3.7" >&6 + { $as_echo "$as_me:$LINENO: result: OK, >= 3.7" >&5 +$as_echo "OK, >= 3.7" >&6; } BUILD_EPM=NO if test "$_os" = "Darwin"; then - echo "$as_me:$LINENO: checking which PackageMaker EPM thinks to use" >&5 -echo $ECHO_N "checking which PackageMaker EPM thinks to use... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking which PackageMaker EPM thinks to use" >&5 +$as_echo_n "checking which PackageMaker EPM thinks to use... " >&6; } _pm=`strings $EPM | grep PackageMaker | cut -d" " -f1` if test "$_pm" = "/Developer/Applications/PackageMaker.app/Contents/MacOS/PackageMaker"; then - { { echo "$as_me:$LINENO: error: $_pm; PackageMaker expected in wrong path. Either patch your epm with the right path (/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker) or use internal patched epm (--with-epm=internal)" >&5 -echo "$as_me: error: $_pm; PackageMaker expected in wrong path. Either patch your epm with the right path (/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker) or use internal patched epm (--with-epm=internal)" >&2;} + { { $as_echo "$as_me:$LINENO: error: $_pm; PackageMaker expected in wrong path. Either patch your epm with the right path (/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker) or use internal patched epm (--with-epm=internal)" >&5 +$as_echo "$as_me: error: $_pm; PackageMaker expected in wrong path. Either patch your epm with the right path (/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker) or use internal patched epm (--with-epm=internal)" >&2;} { (exit 1); exit 1; }; } elif test "$_pm" = "/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker"; then - echo "$as_me:$LINENO: result: $_pm, ok" >&5 -echo "${ECHO_T}$_pm, ok" >&6 + { $as_echo "$as_me:$LINENO: result: $_pm, ok" >&5 +$as_echo "$_pm, ok" >&6; } else # we never should get here, but go safe - { { echo "$as_me:$LINENO: error: $_pm; PackageMaker expected in unknown path. Either patch your epm with the right path (/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker) or use internal patched epm (--with-epm=internal)" >&5 -echo "$as_me: error: $_pm; PackageMaker expected in unknown path. Either patch your epm with the right path (/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker) or use internal patched epm (--with-epm=internal)" >&2;} + { { $as_echo "$as_me:$LINENO: error: $_pm; PackageMaker expected in unknown path. Either patch your epm with the right path (/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker) or use internal patched epm (--with-epm=internal)" >&5 +$as_echo "$as_me: error: $_pm; PackageMaker expected in unknown path. Either patch your epm with the right path (/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker) or use internal patched epm (--with-epm=internal)" >&2;} { (exit 1); exit 1; }; } fi fi else - echo "$as_me:$LINENO: result: too old. epm >= 3.7 is required." >&5 -echo "${ECHO_T}too old. epm >= 3.7 is required." >&6 + { $as_echo "$as_me:$LINENO: result: too old. epm >= 3.7 is required." >&5 +$as_echo "too old. epm >= 3.7 is required." >&6; } echo "EPM will be built." BUILD_EPM=YES BUILD_TYPE="$BUILD_TYPE EPM" @@ -11099,8 +12906,8 @@ echo "${ECHO_T}too old. epm >= 3.7 is required." >&6 fi # test which package format to use - echo "$as_me:$LINENO: checking which package format to use" >&5 -echo $ECHO_N "checking which package format to use... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking which package format to use" >&5 +$as_echo_n "checking which package format to use... " >&6; } # epm supports the following formats: # aix - AIX software distribution # bsd - FreeBSD, NetBSD, or OpenBSD software distribution @@ -11148,8 +12955,8 @@ echo $ECHO_N "checking which package format to use... $ECHO_C" >&6 # we never should get here since we check the arciecture/os at the beginning, # but go sure... *) - { { echo "$as_me:$LINENO: error: unknown system" >&5 -echo "$as_me: error: unknown system" >&2;} + { { $as_echo "$as_me:$LINENO: error: unknown system" >&5 +$as_echo "$as_me: error: unknown system" >&2;} { (exit 1); exit 1; }; } esac if test -n "$with_package_format"; then @@ -11158,7 +12965,7 @@ echo "$as_me: error: unknown system" >&2;} aix | bsd | deb | inst | tardist | osx | pkg | rpm | setld | native | portable) ;; *) - { { echo "$as_me:$LINENO: error: unsupported format $i. Supported by EPM are: + { { $as_echo "$as_me:$LINENO: error: unsupported format $i. Supported by EPM are: aix - AIX software distribution bsd - FreeBSD, NetBSD, or OpenBSD software distribution depot or swinstall - HP-UX software distribution @@ -11171,7 +12978,7 @@ setld - Tru64 (setld) software distribution native - \"Native\" software distribution for the platform portable - Portable software distribution " >&5 -echo "$as_me: error: unsupported format $i. Supported by EPM are: +$as_echo "$as_me: error: unsupported format $i. Supported by EPM are: aix - AIX software distribution bsd - FreeBSD, NetBSD, or OpenBSD software distribution depot or swinstall - HP-UX software distribution @@ -11190,11 +12997,11 @@ portable - Portable software distribution done PKGFORMAT="$with_package_format" fi - echo "$as_me:$LINENO: result: $PKGFORMAT" >&5 -echo "${ECHO_T}$PKGFORMAT" >&6 + { $as_echo "$as_me:$LINENO: result: $PKGFORMAT" >&5 +$as_echo "$PKGFORMAT" >&6; } if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null; then - echo "$as_me:$LINENO: checking for rpm" >&5 -echo $ECHO_N "checking for rpm... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for rpm" >&5 +$as_echo_n "checking for rpm... " >&6; } for a in "$RPM" rpmbuild rpm; do $a --usage >/dev/null 2> /dev/null if test $? -eq 0; then @@ -11209,22 +13016,22 @@ echo $ECHO_N "checking for rpm... $ECHO_C" >&6 fi done if test -z "$RPM" ; then - { { echo "$as_me:$LINENO: error: not found" >&5 -echo "$as_me: error: not found" >&2;} + { { $as_echo "$as_me:$LINENO: error: not found" >&5 +$as_echo "$as_me: error: not found" >&2;} { (exit 1); exit 1; }; } else RPM_PATH=`which $RPM` - echo "$as_me:$LINENO: result: $RPM_PATH" >&5 -echo "${ECHO_T}$RPM_PATH" >&6 + { $as_echo "$as_me:$LINENO: result: $RPM_PATH" >&5 +$as_echo "$RPM_PATH" >&6; } fi fi if echo "$PKGFORMAT" | $EGREP deb 2>&1 >/dev/null; then # Extract the first word of "dpkg", so it can be a program name with args. set dummy dpkg; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_DPKG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $DPKG in [\\/]* | ?:[\\/]*) @@ -11237,49 +13044,50 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_DPKG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_path_DPKG" && ac_cv_path_DPKG="no" ;; esac fi DPKG=$ac_cv_path_DPKG - if test -n "$DPKG"; then - echo "$as_me:$LINENO: result: $DPKG" >&5 -echo "${ECHO_T}$DPKG" >&6 + { $as_echo "$as_me:$LINENO: result: $DPKG" >&5 +$as_echo "$DPKG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + if test "$DPKG" = "no"; then - { { echo "$as_me:$LINENO: error: dpkg needed for deb creation. Install dpkg." >&5 -echo "$as_me: error: dpkg needed for deb creation. Install dpkg." >&2;} + { { $as_echo "$as_me:$LINENO: error: dpkg needed for deb creation. Install dpkg." >&5 +$as_echo "$as_me: error: dpkg needed for deb creation. Install dpkg." >&2;} { (exit 1); exit 1; }; } fi fi if echo "PKGFORMAT" | $EGREP osx 2>&1 >/dev/null; then if test "$_os" = "Darwin"; then - echo "$as_me:$LINENO: checking for PackageMaker availability" >&5 -echo $ECHO_N "checking for PackageMaker availability... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for PackageMaker availability" >&5 +$as_echo_n "checking for PackageMaker availability... " >&6; } if ! test -x /Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker; then - { { echo "$as_me:$LINENO: error: not installed. Please install Apples Dev Tools" >&5 -echo "$as_me: error: not installed. Please install Apples Dev Tools" >&2;} + { { $as_echo "$as_me:$LINENO: error: not installed. Please install Apples Dev Tools" >&5 +$as_echo "$as_me: error: not installed. Please install Apples Dev Tools" >&2;} { (exit 1); exit 1; }; } else - echo "$as_me:$LINENO: result: ok" >&5 -echo "${ECHO_T}ok" >&6 + { $as_echo "$as_me:$LINENO: result: ok" >&5 +$as_echo "ok" >&6; } fi else - { { echo "$as_me:$LINENO: error: PackageMaker needed to build OSX packages and you are not on OSX..." >&5 -echo "$as_me: error: PackageMaker needed to build OSX packages and you are not on OSX..." >&2;} + { { $as_echo "$as_me:$LINENO: error: PackageMaker needed to build OSX packages and you are not on OSX..." >&5 +$as_echo "$as_me: error: PackageMaker needed to build OSX packages and you are not on OSX..." >&2;} { (exit 1); exit 1; }; } fi fi @@ -11287,30 +13095,30 @@ echo "$as_me: error: PackageMaker needed to build OSX packages and you are not o echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then if test "$EPM" != "no" && test "$EPM" != "internal"; then if test "`echo $EPM_VERSION | cut -d'.' -f1`" -lt "4"; then - echo "$as_me:$LINENO: checking whether epm is patched for OOos needs" >&5 -echo $ECHO_N "checking whether epm is patched for OOos needs... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking whether epm is patched for OOos needs" >&5 +$as_echo_n "checking whether epm is patched for OOos needs... " >&6; } if grep "Patched for OpenOffice.org" $EPM >/dev/null 2>/dev/null; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } if echo "$PKGFORMAT" | grep -q rpm; then _pt="rpm" - { echo "$as_me:$LINENO: WARNING: the rpms will need to be installed with --nodeps" >&5 -echo "$as_me: WARNING: the rpms will need to be installed with --nodeps" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: the rpms will need to be installed with --nodeps" >&5 +$as_echo "$as_me: WARNING: the rpms will need to be installed with --nodeps" >&2;} echo "the rpms will need to be installed with --nodeps" >> warn else _pt="pkg" fi - { echo "$as_me:$LINENO: WARNING: the ${_pt}s will not be relocateable" >&5 -echo "$as_me: WARNING: the ${_pt}s will not be relocateable" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: the ${_pt}s will not be relocateable" >&5 +$as_echo "$as_me: WARNING: the ${_pt}s will not be relocateable" >&2;} echo "the ${_pt}s will not be relocateable" >> warn - { echo "$as_me:$LINENO: WARNING: if you want to make sure installation without --nodeps and + { $as_echo "$as_me:$LINENO: WARNING: if you want to make sure installation without --nodeps and relocation will work, you need to patch your epm with the patch in epm/epm-3.7.patch or build with --with-epm=internal which will build a suitable epm" >&5 -echo "$as_me: WARNING: if you want to make sure installation without --nodeps and +$as_echo "$as_me: WARNING: if you want to make sure installation without --nodeps and relocation will work, you need to patch your epm with the patch in epm/epm-3.7.patch or build with --with-epm=internal which will build a suitable epm" >&2;} @@ -11321,10 +13129,10 @@ echo "$as_me: WARNING: if you want to make sure installation without --nodeps an if echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then # Extract the first word of "pkgmk", so it can be a program name with args. set dummy pkgmk; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKGMK+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $PKGMK in [\\/]* | ?:[\\/]*) @@ -11337,31 +13145,32 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKGMK="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_path_PKGMK" && ac_cv_path_PKGMK="no" ;; esac fi PKGMK=$ac_cv_path_PKGMK - if test -n "$PKGMK"; then - echo "$as_me:$LINENO: result: $PKGMK" >&5 -echo "${ECHO_T}$PKGMK" >&6 + { $as_echo "$as_me:$LINENO: result: $PKGMK" >&5 +$as_echo "$PKGMK" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + if test "$PKGMK" = "no"; then - { { echo "$as_me:$LINENO: error: pkgmk needed for Solaris pkg creation. Install it." >&5 -echo "$as_me: error: pkgmk needed for Solaris pkg creation. Install it." >&2;} + { { $as_echo "$as_me:$LINENO: error: pkgmk needed for Solaris pkg creation. Install it." >&5 +$as_echo "$as_me: error: pkgmk needed for Solaris pkg creation. Install it." >&2;} { (exit 1); exit 1; }; } fi fi @@ -11371,18 +13180,18 @@ echo "$as_me: error: pkgmk needed for Solaris pkg creation. Install it." >&2;} else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } EPM=NO fi # Extract the first word of "gperf", so it can be a program name with args. set dummy gperf; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_GPERF+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $GPERF in [\\/]* | ?:[\\/]*) @@ -11395,77 +13204,78 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GPERF="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi GPERF=$ac_cv_path_GPERF - if test -n "$GPERF"; then - echo "$as_me:$LINENO: result: $GPERF" >&5 -echo "${ECHO_T}$GPERF" >&6 + { $as_echo "$as_me:$LINENO: result: $GPERF" >&5 +$as_echo "$GPERF" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + if test -z "$GPERF"; then - { { echo "$as_me:$LINENO: error: gperf not found but needed. Install it." >&5 -echo "$as_me: error: gperf not found but needed. Install it." >&2;} + { { $as_echo "$as_me:$LINENO: error: gperf not found but needed. Install it." >&5 +$as_echo "$as_me: error: gperf not found but needed. Install it." >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: checking gperf version" >&5 -echo $ECHO_N "checking gperf version... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking gperf version" >&5 +$as_echo_n "checking gperf version... " >&6; } if test "`$GPERF --version | $EGREP ^GNU\ gperf | $AWK '{ print $3 }' | cut -d. -f1`" -ge "3"; then - echo "$as_me:$LINENO: result: OK" >&5 -echo "${ECHO_T}OK" >&6 + { $as_echo "$as_me:$LINENO: result: OK" >&5 +$as_echo "OK" >&6; } else - { { echo "$as_me:$LINENO: error: too old, you need at least 3.0.0" >&5 -echo "$as_me: error: too old, you need at least 3.0.0" >&2;} + { { $as_echo "$as_me:$LINENO: error: too old, you need at least 3.0.0" >&5 +$as_echo "$as_me: error: too old, you need at least 3.0.0" >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: checking whether to build the ODK" >&5 -echo $ECHO_N "checking whether to build the ODK... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to build the ODK" >&5 +$as_echo_n "checking whether to build the ODK... " >&6; } if test "z$enable_odk" = "z" -o "$enable_odk" != "no"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } if test "$WITH_JAVA" != "no"; then - echo "$as_me:$LINENO: checking for external/unowinreg/unowinreg.dll" >&5 -echo $ECHO_N "checking for external/unowinreg/unowinreg.dll... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for external/unowinreg/unowinreg.dll" >&5 +$as_echo_n "checking for external/unowinreg/unowinreg.dll... " >&6; } if ! test -f "./external/unowinreg/unowinreg.dll"; then HAVE_UNOWINREG_DLL=no else HAVE_UNOWINREG_DLL=yes fi if test "$HAVE_UNOWINREG_DLL" = "yes"; then - echo "$as_me:$LINENO: result: found" >&5 -echo "${ECHO_T}found" >&6 + { $as_echo "$as_me:$LINENO: result: found" >&5 +$as_echo "found" >&6; } BUILD_UNOWINREG=NO else if test "$_os" = "WINNT"; then - echo "$as_me:$LINENO: result: not found, will be built" >&5 -echo "${ECHO_T}not found, will be built" >&6 + { $as_echo "$as_me:$LINENO: result: not found, will be built" >&5 +$as_echo "not found, will be built" >&6; } else - { echo "$as_me:$LINENO: WARNING: not found, will be cross-built using mingw32" >&5 -echo "$as_me: WARNING: not found, will be cross-built using mingw32" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: not found, will be cross-built using mingw32" >&5 +$as_echo "$as_me: WARNING: not found, will be cross-built using mingw32" >&2;} fi BUILD_UNOWINREG=YES fi if test "$_os" != "WINNT" && test "$BUILD_UNOWINREG" = "YES"; then if test -z "$WITH_MINGWIN" || test "$WITH_MINGWIN" = "0"; then - { { echo "$as_me:$LINENO: error: for rebuilding unowinreg.dll you need the mingw32 C++ compiler. + { { $as_echo "$as_me:$LINENO: error: for rebuilding unowinreg.dll you need the mingw32 C++ compiler. Specify mingw32 g++ executable name with --with-mingwin. Or use prebuilt one from http://tools.openoffice.org/unowinreg_prebuild/680/ and put it into external/unowinreg" >&5 -echo "$as_me: error: for rebuilding unowinreg.dll you need the mingw32 C++ compiler. +$as_echo "$as_me: error: for rebuilding unowinreg.dll you need the mingw32 C++ compiler. Specify mingw32 g++ executable name with --with-mingwin. Or use prebuilt one from http://tools.openoffice.org/unowinreg_prebuild/680/ and put it into external/unowinreg" >&2;} @@ -11477,10 +13287,10 @@ echo "$as_me: error: for rebuilding unowinreg.dll you need the mingw32 C++ compi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}$WITH_MINGWIN", so it can be a program name with args. set dummy ${ac_tool_prefix}$WITH_MINGWIN; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_MINGWCXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$MINGWCXX"; then ac_cv_prog_MINGWCXX="$MINGWCXX" # Let the user override the test. @@ -11491,34 +13301,36 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_MINGWCXX="${ac_tool_prefix}$WITH_MINGWIN" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi MINGWCXX=$ac_cv_prog_MINGWCXX if test -n "$MINGWCXX"; then - echo "$as_me:$LINENO: result: $MINGWCXX" >&5 -echo "${ECHO_T}$MINGWCXX" >&6 + { $as_echo "$as_me:$LINENO: result: $MINGWCXX" >&5 +$as_echo "$MINGWCXX" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test -z "$ac_cv_prog_MINGWCXX"; then ac_ct_MINGWCXX=$MINGWCXX # Extract the first word of "$WITH_MINGWIN", so it can be a program name with args. set dummy $WITH_MINGWIN; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_MINGWCXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MINGWCXX"; then ac_cv_prog_ac_ct_MINGWCXX="$ac_ct_MINGWCXX" # Let the user override the test. @@ -11529,46 +13341,56 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_MINGWCXX="$WITH_MINGWIN" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS - test -z "$ac_cv_prog_ac_ct_MINGWCXX" && ac_cv_prog_ac_ct_MINGWCXX="false" fi fi ac_ct_MINGWCXX=$ac_cv_prog_ac_ct_MINGWCXX if test -n "$ac_ct_MINGWCXX"; then - echo "$as_me:$LINENO: result: $ac_ct_MINGWCXX" >&5 -echo "${ECHO_T}$ac_ct_MINGWCXX" >&6 + { $as_echo "$as_me:$LINENO: result: $ac_ct_MINGWCXX" >&5 +$as_echo "$ac_ct_MINGWCXX" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi - MINGWCXX=$ac_ct_MINGWCXX + if test "x$ac_ct_MINGWCXX" = x; then + MINGWCXX="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MINGWCXX=$ac_ct_MINGWCXX + fi else MINGWCXX="$ac_cv_prog_MINGWCXX" fi fi if test "$MINGWCXX" = "false"; then - { { echo "$as_me:$LINENO: error: specified MinGW32 C++ cross-compiler not found. Install it or correct name." >&5 -echo "$as_me: error: specified MinGW32 C++ cross-compiler not found. Install it or correct name." >&2;} + { { $as_echo "$as_me:$LINENO: error: specified MinGW32 C++ cross-compiler not found. Install it or correct name." >&5 +$as_echo "$as_me: error: specified MinGW32 C++ cross-compiler not found. Install it or correct name." >&2;} { (exit 1); exit 1; }; } fi - echo "$as_me:$LINENO: checking whether we are using the MinGW32 cross C++ compiler" >&5 -echo $ECHO_N "checking whether we are using the MinGW32 cross C++ compiler... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking whether we are using the MinGW32 cross C++ compiler" >&5 +$as_echo_n "checking whether we are using the MinGW32 cross C++ compiler... " >&6; } if ! echo "`$MINGWCXX -dumpmachine`" | grep -q mingw32; then - { { echo "$as_me:$LINENO: error: no" >&5 -echo "$as_me: error: no" >&2;} + { { $as_echo "$as_me:$LINENO: error: no" >&5 +$as_echo "$as_me: error: no" >&2;} { (exit 1); exit 1; }; } else - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } fi if echo "$WITH_MINGWIN" | $EGREP -q "/"; then if ! test -x "`echo $WITH_MINGWIN | $SED -e s/g++/strip/`"; then MINGSTRIP=false; else MINGWSTRIP=$(basename $(echo $WITH_MINGWIN | $SED -e s/g++/strip/)); fi @@ -11576,10 +13398,10 @@ echo "${ECHO_T}yes" >&6 if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}`echo $WITH_MINGWIN | $SED -e s/g++/strip/`", so it can be a program name with args. set dummy ${ac_tool_prefix}`echo $WITH_MINGWIN | $SED -e s/g++/strip/`; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_MINGWSTRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$MINGWSTRIP"; then ac_cv_prog_MINGWSTRIP="$MINGWSTRIP" # Let the user override the test. @@ -11590,34 +13412,36 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_MINGWSTRIP="${ac_tool_prefix}`echo $WITH_MINGWIN | $SED -e s/g++/strip/`" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi MINGWSTRIP=$ac_cv_prog_MINGWSTRIP if test -n "$MINGWSTRIP"; then - echo "$as_me:$LINENO: result: $MINGWSTRIP" >&5 -echo "${ECHO_T}$MINGWSTRIP" >&6 + { $as_echo "$as_me:$LINENO: result: $MINGWSTRIP" >&5 +$as_echo "$MINGWSTRIP" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test -z "$ac_cv_prog_MINGWSTRIP"; then ac_ct_MINGWSTRIP=$MINGWSTRIP # Extract the first word of "`echo $WITH_MINGWIN | $SED -e s/g++/strip/`", so it can be a program name with args. set dummy `echo $WITH_MINGWIN | $SED -e s/g++/strip/`; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_MINGWSTRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MINGWSTRIP"; then ac_cv_prog_ac_ct_MINGWSTRIP="$ac_ct_MINGWSTRIP" # Let the user override the test. @@ -11628,38 +13452,48 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_MINGWSTRIP="`echo $WITH_MINGWIN | $SED -e s/g++/strip/`" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS - test -z "$ac_cv_prog_ac_ct_MINGWSTRIP" && ac_cv_prog_ac_ct_MINGWSTRIP="false" fi fi ac_ct_MINGWSTRIP=$ac_cv_prog_ac_ct_MINGWSTRIP if test -n "$ac_ct_MINGWSTRIP"; then - echo "$as_me:$LINENO: result: $ac_ct_MINGWSTRIP" >&5 -echo "${ECHO_T}$ac_ct_MINGWSTRIP" >&6 + { $as_echo "$as_me:$LINENO: result: $ac_ct_MINGWSTRIP" >&5 +$as_echo "$ac_ct_MINGWSTRIP" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi - MINGWSTRIP=$ac_ct_MINGWSTRIP + if test "x$ac_ct_MINGWSTRIP" = x; then + MINGWSTRIP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MINGWSTRIP=$ac_ct_MINGWSTRIP + fi else MINGWSTRIP="$ac_cv_prog_MINGWSTRIP" fi fi if test "$MINGWSTRIP" = "false"; then - { { echo "$as_me:$LINENO: error: MinGW32 binutils needed. Install them." >&5 -echo "$as_me: error: MinGW32 binutils needed. Install them." >&2;} + { { $as_echo "$as_me:$LINENO: error: MinGW32 binutils needed. Install them." >&5 +$as_echo "$as_me: error: MinGW32 binutils needed. Install them." >&2;} { (exit 1); exit 1; }; } fi - ac_ext=cc + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -11678,15 +13512,14 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu save_LIBS=$LIBS LIBS="" -echo "$as_me:$LINENO: checking for main in -lkernel32" >&5 -echo $ECHO_N "checking for main in -lkernel32... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for main in -lkernel32" >&5 +$as_echo_n "checking for main in -lkernel32... " >&6; } if test "${ac_cv_lib_kernel32_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lkernel32 $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -11697,36 +13530,48 @@ cat >>conftest.$ac_ext <<_ACEOF int main () { -main (); +return main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_kernel32_main=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_kernel32_main=no + ac_cv_lib_kernel32_main=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_kernel32_main" >&5 -echo "${ECHO_T}$ac_cv_lib_kernel32_main" >&6 -if test $ac_cv_lib_kernel32_main = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_kernel32_main" >&5 +$as_echo "$ac_cv_lib_kernel32_main" >&6; } +if test "x$ac_cv_lib_kernel32_main" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBKERNEL32 1 _ACEOF @@ -11737,15 +13582,14 @@ fi ac_cv_lib_kernel32=ac_cv_lib_kernel32_main -echo "$as_me:$LINENO: checking for main in -ladvapi32" >&5 -echo $ECHO_N "checking for main in -ladvapi32... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for main in -ladvapi32" >&5 +$as_echo_n "checking for main in -ladvapi32... " >&6; } if test "${ac_cv_lib_advapi32_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ladvapi32 $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -11756,36 +13600,48 @@ cat >>conftest.$ac_ext <<_ACEOF int main () { -main (); +return main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_advapi32_main=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_advapi32_main=no + ac_cv_lib_advapi32_main=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_advapi32_main" >&5 -echo "${ECHO_T}$ac_cv_lib_advapi32_main" >&6 -if test $ac_cv_lib_advapi32_main = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_advapi32_main" >&5 +$as_echo "$ac_cv_lib_advapi32_main" >&6; } +if test "x$ac_cv_lib_advapi32_main" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBADVAPI32 1 _ACEOF @@ -11796,19 +13652,18 @@ fi ac_cv_lib_advapi32=ac_cv_lib_advapi32_main if test "${ac_cv_header_windows_h+set}" = set; then - echo "$as_me:$LINENO: checking for windows.h" >&5 -echo $ECHO_N "checking for windows.h... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for windows.h" >&5 +$as_echo_n "checking for windows.h... " >&6; } if test "${ac_cv_header_windows_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_windows_h" >&5 -echo "${ECHO_T}$ac_cv_header_windows_h" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_windows_h" >&5 +$as_echo "$ac_cv_header_windows_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking windows.h usability" >&5 -echo $ECHO_N "checking windows.h usability... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking windows.h usability" >&5 +$as_echo_n "checking windows.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -11818,33 +13673,39 @@ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking windows.h presence" >&5 -echo $ECHO_N "checking windows.h presence... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking windows.h presence" >&5 +$as_echo_n "checking windows.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -11852,83 +13713,76 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: windows.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: windows.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: windows.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: windows.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: windows.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: windows.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: windows.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: windows.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: windows.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: windows.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: windows.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: windows.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: windows.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: windows.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: windows.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: windows.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: windows.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: windows.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: windows.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: windows.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: windows.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: windows.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: windows.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: windows.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: windows.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: windows.h: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for windows.h" >&5 -echo $ECHO_N "checking for windows.h... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for windows.h" >&5 +$as_echo_n "checking for windows.h... " >&6; } if test "${ac_cv_header_windows_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_windows_h=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_windows_h" >&5 -echo "${ECHO_T}$ac_cv_header_windows_h" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_windows_h" >&5 +$as_echo "$ac_cv_header_windows_h" >&6; } fi -if test $ac_cv_header_windows_h = yes; then +if test "x$ac_cv_header_windows_h" = x""yes; then : else - { { echo "$as_me:$LINENO: error: windows.h missing" >&5 -echo "$as_me: error: windows.h missing" >&2;} + { { $as_echo "$as_me:$LINENO: error: windows.h missing" >&5 +$as_echo "$as_me: error: windows.h missing" >&2;} { (exit 1); exit 1; }; } fi @@ -11948,47 +13802,47 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi BUILD_TYPE="$BUILD_TYPE ODK" else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } BUILD_UNOWINREG=NO fi -echo "$as_me:$LINENO: checking whether to build qadevOOo" >&5 -echo $ECHO_N "checking whether to build qadevOOo... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to build qadevOOo" >&5 +$as_echo_n "checking whether to build qadevOOo... " >&6; } if test "z$enable_qadevooo" = "z" -o "$enable_qadevooo" != "no"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } BUILD_QADEVOOO="YES" BUILD_TYPE="$BUILD_TYPE QADEVOOO" else BUILD_QADEVOOO="NO" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test -z "$with_system_stdlibs" -a -z "$with_system_libs"; then if test -n "$checkforprelink" -a -f /etc/rpm/macros.prelink; then with_system_stdlibs=yes - { echo "$as_me:$LINENO: WARNING: prelinked libgcc_s.so.1, enabling --with-system-stdlibs, use --without-system-stdlibs to override" >&5 -echo "$as_me: WARNING: prelinked libgcc_s.so.1, enabling --with-system-stdlibs, use --without-system-stdlibs to override" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: prelinked libgcc_s.so.1, enabling --with-system-stdlibs, use --without-system-stdlibs to override" >&5 +$as_echo "$as_me: WARNING: prelinked libgcc_s.so.1, enabling --with-system-stdlibs, use --without-system-stdlibs to override" >&2;} echo "prelinked libgcc_s.so.1, enabling --with-system-stdlibs, use --without-system-stdlibs to override" >> warn fi fi -echo "$as_me:$LINENO: checking whether to provide libstdc++/libgcc_s in the installset" >&5 -echo $ECHO_N "checking whether to provide libstdc++/libgcc_s in the installset... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to provide libstdc++/libgcc_s in the installset" >&5 +$as_echo_n "checking whether to provide libstdc++/libgcc_s in the installset... " >&6; } if test -n "$with_system_stdlibs" -o -n "$with_system_libs" && \ test "$with_system_stdlibs" != "no"; then - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } SYSTEM_STDLIBS=YES else - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } SYSTEM_STDLIBS=NO fi @@ -11996,27 +13850,26 @@ fi if test "$_os" = "Darwin" && test "$with_system_zlib" != "no"; then with_system_zlib=yes fi -echo "$as_me:$LINENO: checking which zlib to use" >&5 -echo $ECHO_N "checking which zlib to use... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking which zlib to use" >&5 +$as_echo_n "checking which zlib to use... " >&6; } if test -n "$with_system_zlib" -o -n "$with_system_libs" && \ test "$with_system_zlib" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:$LINENO: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_ZLIB=YES if test "${ac_cv_header_zlib_h+set}" = set; then - echo "$as_me:$LINENO: checking for zlib.h" >&5 -echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for zlib.h" >&5 +$as_echo_n "checking for zlib.h... " >&6; } if test "${ac_cv_header_zlib_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 -echo "${ECHO_T}$ac_cv_header_zlib_h" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 +$as_echo "$ac_cv_header_zlib_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking zlib.h usability" >&5 -echo $ECHO_N "checking zlib.h usability... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking zlib.h usability" >&5 +$as_echo_n "checking zlib.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -12026,33 +13879,39 @@ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking zlib.h presence" >&5 -echo $ECHO_N "checking zlib.h presence... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking zlib.h presence" >&5 +$as_echo_n "checking zlib.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -12060,178 +13919,181 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: zlib.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: zlib.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: zlib.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: zlib.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: zlib.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: zlib.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: zlib.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: zlib.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: zlib.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: zlib.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: zlib.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: zlib.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: zlib.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: zlib.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: zlib.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: zlib.h: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for zlib.h" >&5 -echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for zlib.h" >&5 +$as_echo_n "checking for zlib.h... " >&6; } if test "${ac_cv_header_zlib_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_zlib_h=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 -echo "${ECHO_T}$ac_cv_header_zlib_h" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 +$as_echo "$ac_cv_header_zlib_h" >&6; } fi -if test $ac_cv_header_zlib_h = yes; then +if test "x$ac_cv_header_zlib_h" = x""yes; then : else - { { echo "$as_me:$LINENO: error: zlib.h not found. install zlib" >&5 -echo "$as_me: error: zlib.h not found. install zlib" >&2;} + { { $as_echo "$as_me:$LINENO: error: zlib.h not found. install zlib" >&5 +$as_echo "$as_me: error: zlib.h not found. install zlib" >&2;} { (exit 1); exit 1; }; } fi - echo "$as_me:$LINENO: checking for deflate in -lz" >&5 -echo $ECHO_N "checking for deflate in -lz... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for deflate in -lz" >&5 +$as_echo_n "checking for deflate in -lz... " >&6; } if test "${ac_cv_lib_z_deflate+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char deflate (); int main () { -deflate (); +return deflate (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_z_deflate=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_z_deflate=no + ac_cv_lib_z_deflate=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_z_deflate" >&5 -echo "${ECHO_T}$ac_cv_lib_z_deflate" >&6 -if test $ac_cv_lib_z_deflate = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_z_deflate" >&5 +$as_echo "$ac_cv_lib_z_deflate" >&6; } +if test "x$ac_cv_lib_z_deflate" = x""yes; then ZLIB=-lz else - { { echo "$as_me:$LINENO: error: zlib not found or functional" >&5 -echo "$as_me: error: zlib not found or functional" >&2;} + { { $as_echo "$as_me:$LINENO: error: zlib not found or functional" >&5 +$as_echo "$as_me: error: zlib not found or functional" >&2;} { (exit 1); exit 1; }; } fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:$LINENO: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_ZLIB=NO BUILD_TYPE="$BUILD_TYPE ZLIB" fi -echo "$as_me:$LINENO: checking which jpeg to use" >&5 -echo $ECHO_N "checking which jpeg to use... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking which jpeg to use" >&5 +$as_echo_n "checking which jpeg to use... " >&6; } if test -n "$with_system_jpeg" -o -n "$with_system_libs" && \ test "$with_system_jpeg" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:$LINENO: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_JPEG=YES if test "${ac_cv_header_jpeglib_h+set}" = set; then - echo "$as_me:$LINENO: checking for jpeglib.h" >&5 -echo $ECHO_N "checking for jpeglib.h... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for jpeglib.h" >&5 +$as_echo_n "checking for jpeglib.h... " >&6; } if test "${ac_cv_header_jpeglib_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_jpeglib_h" >&5 -echo "${ECHO_T}$ac_cv_header_jpeglib_h" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_jpeglib_h" >&5 +$as_echo "$ac_cv_header_jpeglib_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking jpeglib.h usability" >&5 -echo $ECHO_N "checking jpeglib.h usability... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking jpeglib.h usability" >&5 +$as_echo_n "checking jpeglib.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -12241,33 +14103,39 @@ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking jpeglib.h presence" >&5 -echo $ECHO_N "checking jpeglib.h presence... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking jpeglib.h presence" >&5 +$as_echo_n "checking jpeglib.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -12275,177 +14143,180 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: jpeglib.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: jpeglib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: jpeglib.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: jpeglib.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: jpeglib.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: jpeglib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: jpeglib.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: jpeglib.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: jpeglib.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: jpeglib.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: jpeglib.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: jpeglib.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: jpeglib.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: jpeglib.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: jpeglib.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: jpeglib.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: jpeglib.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: jpeglib.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: jpeglib.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: jpeglib.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: jpeglib.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: jpeglib.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: jpeglib.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: jpeglib.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: jpeglib.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: jpeglib.h: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for jpeglib.h" >&5 -echo $ECHO_N "checking for jpeglib.h... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for jpeglib.h" >&5 +$as_echo_n "checking for jpeglib.h... " >&6; } if test "${ac_cv_header_jpeglib_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_jpeglib_h=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_jpeglib_h" >&5 -echo "${ECHO_T}$ac_cv_header_jpeglib_h" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_jpeglib_h" >&5 +$as_echo "$ac_cv_header_jpeglib_h" >&6; } fi -if test $ac_cv_header_jpeglib_h = yes; then +if test "x$ac_cv_header_jpeglib_h" = x""yes; then : else - { { echo "$as_me:$LINENO: error: jpeg.h not found. install libjpeg" >&5 -echo "$as_me: error: jpeg.h not found. install libjpeg" >&2;} + { { $as_echo "$as_me:$LINENO: error: jpeg.h not found. install libjpeg" >&5 +$as_echo "$as_me: error: jpeg.h not found. install libjpeg" >&2;} { (exit 1); exit 1; }; } fi - echo "$as_me:$LINENO: checking for jpeg_resync_to_restart in -ljpeg" >&5 -echo $ECHO_N "checking for jpeg_resync_to_restart in -ljpeg... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for jpeg_resync_to_restart in -ljpeg" >&5 +$as_echo_n "checking for jpeg_resync_to_restart in -ljpeg... " >&6; } if test "${ac_cv_lib_jpeg_jpeg_resync_to_restart+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ljpeg $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char jpeg_resync_to_restart (); int main () { -jpeg_resync_to_restart (); +return jpeg_resync_to_restart (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_jpeg_jpeg_resync_to_restart=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_jpeg_jpeg_resync_to_restart=no + ac_cv_lib_jpeg_jpeg_resync_to_restart=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_jpeg_jpeg_resync_to_restart" >&5 -echo "${ECHO_T}$ac_cv_lib_jpeg_jpeg_resync_to_restart" >&6 -if test $ac_cv_lib_jpeg_jpeg_resync_to_restart = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_jpeg_jpeg_resync_to_restart" >&5 +$as_echo "$ac_cv_lib_jpeg_jpeg_resync_to_restart" >&6; } +if test "x$ac_cv_lib_jpeg_jpeg_resync_to_restart" = x""yes; then JPEG3RDLIB=-ljpeg else - echo "$as_me:$LINENO: checking jpeg library not found or fuctional" >&5 -echo $ECHO_N "checking jpeg library not found or fuctional... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking jpeg library not found or fuctional" >&5 +$as_echo_n "checking jpeg library not found or fuctional... " >&6; } fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:$LINENO: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_JPEG=NO BUILD_TYPE="$BUILD_TYPE JPEG" fi -echo "$as_me:$LINENO: checking which expat to use" >&5 -echo $ECHO_N "checking which expat to use... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking which expat to use" >&5 +$as_echo_n "checking which expat to use... " >&6; } if test -n "$with_system_expat" -o -n "$with_system_libs" && \ test "$with_system_expat" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:$LINENO: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_EXPAT=YES if test "${ac_cv_header_expat_h+set}" = set; then - echo "$as_me:$LINENO: checking for expat.h" >&5 -echo $ECHO_N "checking for expat.h... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for expat.h" >&5 +$as_echo_n "checking for expat.h... " >&6; } if test "${ac_cv_header_expat_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_expat_h" >&5 -echo "${ECHO_T}$ac_cv_header_expat_h" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_expat_h" >&5 +$as_echo "$ac_cv_header_expat_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking expat.h usability" >&5 -echo $ECHO_N "checking expat.h usability... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking expat.h usability" >&5 +$as_echo_n "checking expat.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -12455,33 +14326,39 @@ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking expat.h presence" >&5 -echo $ECHO_N "checking expat.h presence... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking expat.h presence" >&5 +$as_echo_n "checking expat.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -12489,143 +14366,147 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: expat.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: expat.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: expat.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: expat.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: expat.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: expat.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: expat.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: expat.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: expat.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: expat.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: expat.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: expat.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: expat.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: expat.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: expat.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: expat.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: expat.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: expat.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: expat.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: expat.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: expat.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: expat.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: expat.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: expat.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: expat.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: expat.h: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for expat.h" >&5 -echo $ECHO_N "checking for expat.h... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for expat.h" >&5 +$as_echo_n "checking for expat.h... " >&6; } if test "${ac_cv_header_expat_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_expat_h=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_expat_h" >&5 -echo "${ECHO_T}$ac_cv_header_expat_h" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_expat_h" >&5 +$as_echo "$ac_cv_header_expat_h" >&6; } fi -if test $ac_cv_header_expat_h = yes; then +if test "x$ac_cv_header_expat_h" = x""yes; then : else - { { echo "$as_me:$LINENO: error: expat.h not found. install expat" >&5 -echo "$as_me: error: expat.h not found. install expat" >&2;} + { { $as_echo "$as_me:$LINENO: error: expat.h not found. install expat" >&5 +$as_echo "$as_me: error: expat.h not found. install expat" >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: checking for XML_ParserCreate in -lexpat" >&5 -echo $ECHO_N "checking for XML_ParserCreate in -lexpat... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for XML_ParserCreate in -lexpat" >&5 +$as_echo_n "checking for XML_ParserCreate in -lexpat... " >&6; } if test "${ac_cv_lib_expat_XML_ParserCreate+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lexpat $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char XML_ParserCreate (); int main () { -XML_ParserCreate (); +return XML_ParserCreate (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_expat_XML_ParserCreate=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_expat_XML_ParserCreate=no + ac_cv_lib_expat_XML_ParserCreate=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_expat_XML_ParserCreate" >&5 -echo "${ECHO_T}$ac_cv_lib_expat_XML_ParserCreate" >&6 -if test $ac_cv_lib_expat_XML_ParserCreate = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_expat_XML_ParserCreate" >&5 +$as_echo "$ac_cv_lib_expat_XML_ParserCreate" >&6; } +if test "x$ac_cv_lib_expat_XML_ParserCreate" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBEXPAT 1 _ACEOF @@ -12633,24 +14514,24 @@ _ACEOF LIBS="-lexpat $LIBS" else - echo "$as_me:$LINENO: result: expat library not found or functional." >&5 -echo "${ECHO_T}expat library not found or functional." >&6 + { $as_echo "$as_me:$LINENO: result: expat library not found or functional." >&5 +$as_echo "expat library not found or functional." >&6; } fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:$LINENO: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_EXPAT=NO BUILD_TYPE="$BUILD_TYPE EXPAT" fi -echo "$as_me:$LINENO: checking which libwpd to use" >&5 -echo $ECHO_N "checking which libwpd to use... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking which libwpd to use" >&5 +$as_echo_n "checking which libwpd to use... " >&6; } if test -n "$with_system_libwpd" -o -n "$with_system_libs" && \ test "$with_system_libwpd" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:$LINENO: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_LIBWPD=YES succeeded=no @@ -12658,10 +14539,10 @@ echo "${ECHO_T}external" >&6 if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -12674,28 +14555,29 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -12706,25 +14588,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for libwpd-0.8 " >&5 -echo $ECHO_N "checking for libwpd-0.8 ... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for libwpd-0.8 " >&5 +$as_echo_n "checking for libwpd-0.8 ... " >&6; } if $PKG_CONFIG --exists "libwpd-0.8 " ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking LIBWPD_CFLAGS" >&5 -echo $ECHO_N "checking LIBWPD_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking LIBWPD_CFLAGS" >&5 +$as_echo_n "checking LIBWPD_CFLAGS... " >&6; } LIBWPD_CFLAGS=`$PKG_CONFIG --cflags "libwpd-0.8 "` - echo "$as_me:$LINENO: result: $LIBWPD_CFLAGS" >&5 -echo "${ECHO_T}$LIBWPD_CFLAGS" >&6 + { $as_echo "$as_me:$LINENO: result: $LIBWPD_CFLAGS" >&5 +$as_echo "$LIBWPD_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking LIBWPD_LIBS" >&5 -echo $ECHO_N "checking LIBWPD_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking LIBWPD_LIBS" >&5 +$as_echo_n "checking LIBWPD_LIBS... " >&6; } LIBWPD_LIBS=`$PKG_CONFIG --libs "libwpd-0.8 "` - echo "$as_me:$LINENO: result: $LIBWPD_LIBS" >&5 -echo "${ECHO_T}$LIBWPD_LIBS" >&6 + { $as_echo "$as_me:$LINENO: result: $LIBWPD_LIBS" >&5 +$as_echo "$LIBWPD_LIBS" >&6; } else LIBWPD_CFLAGS="" LIBWPD_LIBS="" @@ -12745,14 +14627,14 @@ echo "${ECHO_T}$LIBWPD_LIBS" >&6 if test $succeeded = yes; then : else - { { echo "$as_me:$LINENO: error: Library requirements (libwpd-0.8 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 -echo "$as_me: error: Library requirements (libwpd-0.8 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} + { { $as_echo "$as_me:$LINENO: error: Library requirements (libwpd-0.8 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 +$as_echo "$as_me: error: Library requirements (libwpd-0.8 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} { (exit 1); exit 1; }; } fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:$LINENO: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_LIBWPD=NO BUILD_TYPE="$BUILD_TYPE LIBWPD" fi @@ -12761,18 +14643,18 @@ fi if test "$test_freetype" = "yes"; then - echo "$as_me:$LINENO: checking whether freetype is available" >&5 -echo $ECHO_N "checking whether freetype is available... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking whether freetype is available" >&5 +$as_echo_n "checking whether freetype is available... " >&6; } succeeded=no if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -12785,28 +14667,29 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -12817,25 +14700,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for freetype2 >= 2.0 " >&5 -echo $ECHO_N "checking for freetype2 >= 2.0 ... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for freetype2 >= 2.0 " >&5 +$as_echo_n "checking for freetype2 >= 2.0 ... " >&6; } if $PKG_CONFIG --exists "freetype2 >= 2.0 " ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking FREETYPE_CFLAGS" >&5 -echo $ECHO_N "checking FREETYPE_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking FREETYPE_CFLAGS" >&5 +$as_echo_n "checking FREETYPE_CFLAGS... " >&6; } FREETYPE_CFLAGS=`$PKG_CONFIG --cflags "freetype2 >= 2.0 "` - echo "$as_me:$LINENO: result: $FREETYPE_CFLAGS" >&5 -echo "${ECHO_T}$FREETYPE_CFLAGS" >&6 + { $as_echo "$as_me:$LINENO: result: $FREETYPE_CFLAGS" >&5 +$as_echo "$FREETYPE_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking FREETYPE_LIBS" >&5 -echo $ECHO_N "checking FREETYPE_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking FREETYPE_LIBS" >&5 +$as_echo_n "checking FREETYPE_LIBS... " >&6; } FREETYPE_LIBS=`$PKG_CONFIG --libs "freetype2 >= 2.0 "` - echo "$as_me:$LINENO: result: $FREETYPE_LIBS" >&5 -echo "${ECHO_T}$FREETYPE_LIBS" >&6 + { $as_echo "$as_me:$LINENO: result: $FREETYPE_LIBS" >&5 +$as_echo "$FREETYPE_LIBS" >&6; } else FREETYPE_CFLAGS="" FREETYPE_LIBS="" @@ -12856,8 +14739,8 @@ echo "${ECHO_T}$FREETYPE_LIBS" >&6 if test $succeeded = yes; then : else - { { echo "$as_me:$LINENO: error: Library requirements (freetype2 >= 2.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 -echo "$as_me: error: Library requirements (freetype2 >= 2.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} + { { $as_echo "$as_me:$LINENO: error: Library requirements (freetype2 >= 2.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 +$as_echo "$as_me: error: Library requirements (freetype2 >= 2.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} { (exit 1); exit 1; }; } fi @@ -12871,61 +14754,72 @@ if test "$test_freetype" = "yes"; then save_LIBS="$LIBS" CPPFLAGS="$CPPFLAGS $FREETYPE_CFLAGS" LDFLAGS="$LDFLAGS $FREETYPE_LIBS" - echo "$as_me:$LINENO: checking for FT_GlyphSlot_Embolden in -lfreetype" >&5 -echo $ECHO_N "checking for FT_GlyphSlot_Embolden in -lfreetype... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for FT_GlyphSlot_Embolden in -lfreetype" >&5 +$as_echo_n "checking for FT_GlyphSlot_Embolden in -lfreetype... " >&6; } if test "${ac_cv_lib_freetype_FT_GlyphSlot_Embolden+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfreetype $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char FT_GlyphSlot_Embolden (); int main () { -FT_GlyphSlot_Embolden (); +return FT_GlyphSlot_Embolden (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_freetype_FT_GlyphSlot_Embolden=yes -else - echo "$as_me: failed program was:" >&5 + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + ac_cv_lib_freetype_FT_GlyphSlot_Embolden=yes +else + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_freetype_FT_GlyphSlot_Embolden=no + ac_cv_lib_freetype_FT_GlyphSlot_Embolden=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_freetype_FT_GlyphSlot_Embolden" >&5 -echo "${ECHO_T}$ac_cv_lib_freetype_FT_GlyphSlot_Embolden" >&6 -if test $ac_cv_lib_freetype_FT_GlyphSlot_Embolden = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_freetype_FT_GlyphSlot_Embolden" >&5 +$as_echo "$ac_cv_lib_freetype_FT_GlyphSlot_Embolden" >&6; } +if test "x$ac_cv_lib_freetype_FT_GlyphSlot_Embolden" = x""yes; then USE_FT_EMBOLDEN="YES" else USE_FT_EMBOLDEN="NO" @@ -12958,26 +14852,26 @@ if test -n "$with_system_libxml" -o -n "$with_system_libs" && \ fi fi -echo "$as_me:$LINENO: checking which libxslt to use" >&5 -echo $ECHO_N "checking which libxslt to use... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking which libxslt to use" >&5 +$as_echo_n "checking which libxslt to use... " >&6; } if test -n "$with_system_libxslt" -o -n "$with_system_libs" -o \ "$_os" = "Darwin" && \ test "$with_system_libxslt" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:$LINENO: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_LIBXSLT=YES if test "$_os" = "Darwin"; then - echo "$as_me:$LINENO: checking LIBXSLT_CFLAGS" >&5 -echo $ECHO_N "checking LIBXSLT_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking LIBXSLT_CFLAGS" >&5 +$as_echo_n "checking LIBXSLT_CFLAGS... " >&6; } LIBXSLT_CFLAGS=`xslt-config --cflags` - echo "$as_me:$LINENO: result: $LIBXSLT_CFLAGS" >&5 -echo "${ECHO_T}$LIBXSLT_CFLAGS" >&6 - echo "$as_me:$LINENO: checking LIBXSLT_LIBS" >&5 -echo $ECHO_N "checking LIBXSLT_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: result: $LIBXSLT_CFLAGS" >&5 +$as_echo "$LIBXSLT_CFLAGS" >&6; } + { $as_echo "$as_me:$LINENO: checking LIBXSLT_LIBS" >&5 +$as_echo_n "checking LIBXSLT_LIBS... " >&6; } LIBXSLT_LIBS=`xslt-config --libs` - echo "$as_me:$LINENO: result: $LIBXSLT_LIBS" >&5 -echo "${ECHO_T}$LIBXSLT_LIBS" >&6 + { $as_echo "$as_me:$LINENO: result: $LIBXSLT_LIBS" >&5 +$as_echo "$LIBXSLT_LIBS" >&6; } else @@ -12987,10 +14881,10 @@ echo "${ECHO_T}$LIBXSLT_LIBS" >&6 if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -13003,28 +14897,29 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -13035,25 +14930,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for libxslt" >&5 -echo $ECHO_N "checking for libxslt... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for libxslt" >&5 +$as_echo_n "checking for libxslt... " >&6; } if $PKG_CONFIG --exists "libxslt" ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking LIBXSLT_CFLAGS" >&5 -echo $ECHO_N "checking LIBXSLT_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking LIBXSLT_CFLAGS" >&5 +$as_echo_n "checking LIBXSLT_CFLAGS... " >&6; } LIBXSLT_CFLAGS=`$PKG_CONFIG --cflags "libxslt"` - echo "$as_me:$LINENO: result: $LIBXSLT_CFLAGS" >&5 -echo "${ECHO_T}$LIBXSLT_CFLAGS" >&6 + { $as_echo "$as_me:$LINENO: result: $LIBXSLT_CFLAGS" >&5 +$as_echo "$LIBXSLT_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking LIBXSLT_LIBS" >&5 -echo $ECHO_N "checking LIBXSLT_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking LIBXSLT_LIBS" >&5 +$as_echo_n "checking LIBXSLT_LIBS... " >&6; } LIBXSLT_LIBS=`$PKG_CONFIG --libs "libxslt"` - echo "$as_me:$LINENO: result: $LIBXSLT_LIBS" >&5 -echo "${ECHO_T}$LIBXSLT_LIBS" >&6 + { $as_echo "$as_me:$LINENO: result: $LIBXSLT_LIBS" >&5 +$as_echo "$LIBXSLT_LIBS" >&6; } else LIBXSLT_CFLAGS="" LIBXSLT_LIBS="" @@ -13074,8 +14969,8 @@ echo "${ECHO_T}$LIBXSLT_LIBS" >&6 if test $succeeded = yes; then : else - { { echo "$as_me:$LINENO: error: Library requirements (libxslt) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 -echo "$as_me: error: Library requirements (libxslt) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} + { { $as_echo "$as_me:$LINENO: error: Library requirements (libxslt) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 +$as_echo "$as_me: error: Library requirements (libxslt) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} { (exit 1); exit 1; }; } fi @@ -13084,10 +14979,10 @@ echo "$as_me: error: Library requirements (libxslt) not met; consider adjusting # Extract the first word of "xsltproc", so it can be a program name with args. set dummy xsltproc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_XSLTPROC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $XSLTPROC in [\\/]* | ?:[\\/]*) @@ -13100,36 +14995,37 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_XSLTPROC="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_path_XSLTPROC" && ac_cv_path_XSLTPROC="no" ;; esac fi XSLTPROC=$ac_cv_path_XSLTPROC - if test -n "$XSLTPROC"; then - echo "$as_me:$LINENO: result: $XSLTPROC" >&5 -echo "${ECHO_T}$XSLTPROC" >&6 + { $as_echo "$as_me:$LINENO: result: $XSLTPROC" >&5 +$as_echo "$XSLTPROC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + if test "$XSLTPROC" = "no"; then - { { echo "$as_me:$LINENO: error: xsltproc is required" >&5 -echo "$as_me: error: xsltproc is required" >&2;} + { { $as_echo "$as_me:$LINENO: error: xsltproc is required" >&5 +$as_echo "$as_me: error: xsltproc is required" >&2;} { (exit 1); exit 1; }; } fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:$LINENO: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_LIBXSLT=NO BUILD_TYPE="$BUILD_TYPE LIBXSLT" fi @@ -13138,25 +15034,25 @@ fi -echo "$as_me:$LINENO: checking which libxml to use" >&5 -echo $ECHO_N "checking which libxml to use... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking which libxml to use" >&5 +$as_echo_n "checking which libxml to use... " >&6; } if test -n "$with_system_libxml" -o -n "$with_system_libs" -o \ "$_os" = "Darwin" && \ test "$with_system_libxml" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:$LINENO: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_LIBXML=YES if test "$_os" = "Darwin"; then - echo "$as_me:$LINENO: checking LIBXML_CFLAGS" >&5 -echo $ECHO_N "checking LIBXML_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking LIBXML_CFLAGS" >&5 +$as_echo_n "checking LIBXML_CFLAGS... " >&6; } LIBXML_CFLAGS=`xml2-config --cflags` - echo "$as_me:$LINENO: result: $LIBXML_CFLAGS" >&5 -echo "${ECHO_T}$LIBXML_CFLAGS" >&6 - echo "$as_me:$LINENO: checking LIBXML_LIBS" >&5 -echo $ECHO_N "checking LIBXML_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: result: $LIBXML_CFLAGS" >&5 +$as_echo "$LIBXML_CFLAGS" >&6; } + { $as_echo "$as_me:$LINENO: checking LIBXML_LIBS" >&5 +$as_echo_n "checking LIBXML_LIBS... " >&6; } LIBXML_LIBS=`xml2-config --libs` - echo "$as_me:$LINENO: result: $LIBXML_LIBS" >&5 -echo "${ECHO_T}$LIBXML_LIBS" >&6 + { $as_echo "$as_me:$LINENO: result: $LIBXML_LIBS" >&5 +$as_echo "$LIBXML_LIBS" >&6; } else @@ -13166,10 +15062,10 @@ echo "${ECHO_T}$LIBXML_LIBS" >&6 if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -13182,28 +15078,29 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -13214,25 +15111,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for libxml-2.0 >= 2.0" >&5 -echo $ECHO_N "checking for libxml-2.0 >= 2.0... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for libxml-2.0 >= 2.0" >&5 +$as_echo_n "checking for libxml-2.0 >= 2.0... " >&6; } if $PKG_CONFIG --exists "libxml-2.0 >= 2.0" ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking LIBXML_CFLAGS" >&5 -echo $ECHO_N "checking LIBXML_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking LIBXML_CFLAGS" >&5 +$as_echo_n "checking LIBXML_CFLAGS... " >&6; } LIBXML_CFLAGS=`$PKG_CONFIG --cflags "libxml-2.0 >= 2.0"` - echo "$as_me:$LINENO: result: $LIBXML_CFLAGS" >&5 -echo "${ECHO_T}$LIBXML_CFLAGS" >&6 + { $as_echo "$as_me:$LINENO: result: $LIBXML_CFLAGS" >&5 +$as_echo "$LIBXML_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking LIBXML_LIBS" >&5 -echo $ECHO_N "checking LIBXML_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking LIBXML_LIBS" >&5 +$as_echo_n "checking LIBXML_LIBS... " >&6; } LIBXML_LIBS=`$PKG_CONFIG --libs "libxml-2.0 >= 2.0"` - echo "$as_me:$LINENO: result: $LIBXML_LIBS" >&5 -echo "${ECHO_T}$LIBXML_LIBS" >&6 + { $as_echo "$as_me:$LINENO: result: $LIBXML_LIBS" >&5 +$as_echo "$LIBXML_LIBS" >&6; } else LIBXML_CFLAGS="" LIBXML_LIBS="" @@ -13253,8 +15150,8 @@ echo "${ECHO_T}$LIBXML_LIBS" >&6 if test $succeeded = yes; then : else - { { echo "$as_me:$LINENO: error: Library requirements (libxml-2.0 >= 2.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 -echo "$as_me: error: Library requirements (libxml-2.0 >= 2.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} + { { $as_echo "$as_me:$LINENO: error: Library requirements (libxml-2.0 >= 2.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 +$as_echo "$as_me: error: Library requirements (libxml-2.0 >= 2.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} { (exit 1); exit 1; }; } fi @@ -13262,8 +15159,8 @@ echo "$as_me: error: Library requirements (libxml-2.0 >= 2.0) not met; consider BUILD_TYPE="$BUILD_TYPE LIBXMLSEC" else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:$LINENO: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_LIBXML=NO BUILD_TYPE="$BUILD_TYPE LIBXML2 LIBXMLSEC" fi @@ -13274,21 +15171,21 @@ fi if test "$_os" = "Darwin" && test "$with_system_python" != "no"; then with_system_python=yes fi -echo "$as_me:$LINENO: checking which python to use" >&5 -echo $ECHO_N "checking which python to use... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking which python to use" >&5 +$as_echo_n "checking which python to use... " >&6; } if test -n "$with_system_python" -o -n "$with_system_libs" && \ test "$with_system_python" != "no"; then SYSTEM_PYTHON=YES - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:$LINENO: result: external" >&5 +$as_echo "external" >&6; } if test -n "$PYTHON"; then # If the user set $PYTHON, use it and don't search something else. - echo "$as_me:$LINENO: checking whether $PYTHON version >= 2.2" >&5 -echo $ECHO_N "checking whether $PYTHON version >= 2.2... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking whether $PYTHON version >= 2.2" >&5 +$as_echo_n "checking whether $PYTHON version >= 2.2... " >&6; } prog="import sys, string # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. @@ -13301,11 +15198,11 @@ sys.exit(sys.hexversion < minverhex)" ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - { { echo "$as_me:$LINENO: error: too old" >&5 -echo "$as_me: error: too old" >&2;} + { { $as_echo "$as_me:$LINENO: error: too old" >&5 +$as_echo "$as_me: error: too old" >&2;} { (exit 1); exit 1; }; } fi @@ -13313,10 +15210,10 @@ fi else # Otherwise, try each interpreter until we find one that satisfies # VERSION. - echo "$as_me:$LINENO: checking for a Python interpreter with version >= 2.2" >&5 -echo $ECHO_N "checking for a Python interpreter with version >= 2.2... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for a Python interpreter with version >= 2.2" >&5 +$as_echo_n "checking for a Python interpreter with version >= 2.2... " >&6; } if test "${am_cv_pathless_PYTHON+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else for am_cv_pathless_PYTHON in python python2 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5 none; do @@ -13338,18 +15235,18 @@ fi done fi -echo "$as_me:$LINENO: result: $am_cv_pathless_PYTHON" >&5 -echo "${ECHO_T}$am_cv_pathless_PYTHON" >&6 +{ $as_echo "$as_me:$LINENO: result: $am_cv_pathless_PYTHON" >&5 +$as_echo "$am_cv_pathless_PYTHON" >&6; } # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. if test "$am_cv_pathless_PYTHON" = none; then PYTHON=: else # Extract the first word of "$am_cv_pathless_PYTHON", so it can be a program name with args. set dummy $am_cv_pathless_PYTHON; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PYTHON+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $PYTHON in [\\/]* | ?:[\\/]*) @@ -13362,48 +15259,49 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi PYTHON=$ac_cv_path_PYTHON - if test -n "$PYTHON"; then - echo "$as_me:$LINENO: result: $PYTHON" >&5 -echo "${ECHO_T}$PYTHON" >&6 + { $as_echo "$as_me:$LINENO: result: $PYTHON" >&5 +$as_echo "$PYTHON" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + fi am_display_PYTHON=$am_cv_pathless_PYTHON fi if test "$PYTHON" = :; then - { { echo "$as_me:$LINENO: error: no suitable Python interpreter found" >&5 -echo "$as_me: error: no suitable Python interpreter found" >&2;} + { { $as_echo "$as_me:$LINENO: error: no suitable Python interpreter found" >&5 +$as_echo "$as_me: error: no suitable Python interpreter found" >&2;} { (exit 1); exit 1; }; } else - echo "$as_me:$LINENO: checking for $am_display_PYTHON version" >&5 -echo $ECHO_N "checking for $am_display_PYTHON version... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for $am_display_PYTHON version" >&5 +$as_echo_n "checking for $am_display_PYTHON version... " >&6; } if test "${am_cv_python_version+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else am_cv_python_version=`$PYTHON -c "import sys; print sys.version[:3]"` fi -echo "$as_me:$LINENO: result: $am_cv_python_version" >&5 -echo "${ECHO_T}$am_cv_python_version" >&6 +{ $as_echo "$as_me:$LINENO: result: $am_cv_python_version" >&5 +$as_echo "$am_cv_python_version" >&6; } PYTHON_VERSION=$am_cv_python_version @@ -13414,30 +15312,30 @@ echo "${ECHO_T}$am_cv_python_version" >&6 - echo "$as_me:$LINENO: checking for $am_display_PYTHON platform" >&5 -echo $ECHO_N "checking for $am_display_PYTHON platform... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for $am_display_PYTHON platform" >&5 +$as_echo_n "checking for $am_display_PYTHON platform... " >&6; } if test "${am_cv_python_platform+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else am_cv_python_platform=`$PYTHON -c "import sys; print sys.platform"` fi -echo "$as_me:$LINENO: result: $am_cv_python_platform" >&5 -echo "${ECHO_T}$am_cv_python_platform" >&6 +{ $as_echo "$as_me:$LINENO: result: $am_cv_python_platform" >&5 +$as_echo "$am_cv_python_platform" >&6; } PYTHON_PLATFORM=$am_cv_python_platform - echo "$as_me:$LINENO: checking for $am_display_PYTHON script directory" >&5 -echo $ECHO_N "checking for $am_display_PYTHON script directory... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for $am_display_PYTHON script directory" >&5 +$as_echo_n "checking for $am_display_PYTHON script directory... " >&6; } if test "${am_cv_python_pythondir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else am_cv_python_pythondir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(0,0,prefix='$PYTHON_PREFIX')" 2>/dev/null || echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"` fi -echo "$as_me:$LINENO: result: $am_cv_python_pythondir" >&5 -echo "${ECHO_T}$am_cv_python_pythondir" >&6 +{ $as_echo "$as_me:$LINENO: result: $am_cv_python_pythondir" >&5 +$as_echo "$am_cv_python_pythondir" >&6; } pythondir=$am_cv_python_pythondir @@ -13445,16 +15343,16 @@ echo "${ECHO_T}$am_cv_python_pythondir" >&6 pkgpythondir=\${pythondir}/$PACKAGE - echo "$as_me:$LINENO: checking for $am_display_PYTHON extension module directory" >&5 -echo $ECHO_N "checking for $am_display_PYTHON extension module directory... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for $am_display_PYTHON extension module directory" >&5 +$as_echo_n "checking for $am_display_PYTHON extension module directory... " >&6; } if test "${am_cv_python_pyexecdir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else am_cv_python_pyexecdir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(1,0,prefix='$PYTHON_EXEC_PREFIX')" 2>/dev/null || echo "${PYTHON_EXEC_PREFIX}/lib/python${PYTHON_VERSION}/site-packages"` fi -echo "$as_me:$LINENO: result: $am_cv_python_pyexecdir" >&5 -echo "${ECHO_T}$am_cv_python_pyexecdir" >&6 +{ $as_echo "$as_me:$LINENO: result: $am_cv_python_pyexecdir" >&5 +$as_echo "$am_cv_python_pyexecdir" >&6; } pyexecdir=$am_cv_python_pyexecdir @@ -13480,19 +15378,18 @@ echo "${ECHO_T}$am_cv_python_pyexecdir" >&6 save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS" if test "${ac_cv_header_Python_h+set}" = set; then - echo "$as_me:$LINENO: checking for Python.h" >&5 -echo $ECHO_N "checking for Python.h... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for Python.h" >&5 +$as_echo_n "checking for Python.h... " >&6; } if test "${ac_cv_header_Python_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_Python_h" >&5 -echo "${ECHO_T}$ac_cv_header_Python_h" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_Python_h" >&5 +$as_echo "$ac_cv_header_Python_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking Python.h usability" >&5 -echo $ECHO_N "checking Python.h usability... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking Python.h usability" >&5 +$as_echo_n "checking Python.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -13502,33 +15399,39 @@ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking Python.h presence" >&5 -echo $ECHO_N "checking Python.h presence... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking Python.h presence" >&5 +$as_echo_n "checking Python.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -13536,83 +15439,76 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: Python.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: Python.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: Python.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: Python.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: Python.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: Python.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: Python.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: Python.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: Python.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: Python.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: Python.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: Python.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: Python.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: Python.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: Python.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: Python.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: Python.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: Python.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: Python.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: Python.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: Python.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: Python.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: Python.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: Python.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: Python.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: Python.h: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for Python.h" >&5 -echo $ECHO_N "checking for Python.h... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for Python.h" >&5 +$as_echo_n "checking for Python.h... " >&6; } if test "${ac_cv_header_Python_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_Python_h=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_Python_h" >&5 -echo "${ECHO_T}$ac_cv_header_Python_h" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_Python_h" >&5 +$as_echo "$ac_cv_header_Python_h" >&6; } fi -if test $ac_cv_header_Python_h = yes; then +if test "x$ac_cv_header_Python_h" = x""yes; then : else - { { echo "$as_me:$LINENO: error: Python headers not found" >&5 -echo "$as_me: error: Python headers not found" >&2;} + { { $as_echo "$as_me:$LINENO: error: Python headers not found" >&5 +$as_echo "$as_me: error: Python headers not found" >&2;} { (exit 1); exit 1; }; } fi @@ -13621,8 +15517,8 @@ fi else SYSTEM_PYTHON=NO BUILD_TYPE="$BUILD_TYPE PYTHON" - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:$LINENO: result: internal" >&5 +$as_echo "internal" >&6; } # Embedded python dies without Home set if test "z$HOME" = "z"; then export HOME=""; @@ -13631,10 +15527,10 @@ echo "${ECHO_T}internal" >&6 if test -z "$BZIP2"; then # Extract the first word of "bzip2", so it can be a program name with args. set dummy bzip2; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_BZIP2+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $BZIP2 in [\\/]* | ?:[\\/]*) @@ -13647,30 +15543,31 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_BZIP2="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi BZIP2=$ac_cv_path_BZIP2 - if test -n "$BZIP2"; then - echo "$as_me:$LINENO: result: $BZIP2" >&5 -echo "${ECHO_T}$BZIP2" >&6 + { $as_echo "$as_me:$LINENO: result: $BZIP2" >&5 +$as_echo "$BZIP2" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + if test -z "$BZIP2"; then - { { echo "$as_me:$LINENO: error: the internal Python module has a .tar.bz2. You need bzip2" >&5 -echo "$as_me: error: the internal Python module has a .tar.bz2. You need bzip2" >&2;} + { { $as_echo "$as_me:$LINENO: error: the internal Python module has a .tar.bz2. You need bzip2" >&5 +$as_echo "$as_me: error: the internal Python module has a .tar.bz2. You need bzip2" >&2;} { (exit 1); exit 1; }; } fi fi @@ -13681,20 +15578,19 @@ fi HOME=`echo $HOME | sed 's:\\\\:/:g'` -echo "$as_me:$LINENO: checking which db to use" >&5 -echo $ECHO_N "checking which db to use... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking which db to use" >&5 +$as_echo_n "checking which db to use... " >&6; } if test -n "$with_system_db" -o -n "$with_system_libs" && \ test "$with_system_db" != "no"; then SYSTEM_DB=YES - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 - echo "$as_me:$LINENO: checking for db.h" >&5 -echo $ECHO_N "checking for db.h... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: result: external" >&5 +$as_echo "external" >&6; } + { $as_echo "$as_me:$LINENO: checking for db.h" >&5 +$as_echo_n "checking for db.h... " >&6; } if test "${ac_cv_header_db_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -13706,40 +15602,46 @@ cat >>conftest.$ac_ext <<_ACEOF #include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_header_db_h=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_header_db_h=no + ac_cv_header_db_h=no fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_header_db_h" >&5 -echo "${ECHO_T}$ac_cv_header_db_h" >&6 -if test $ac_cv_header_db_h = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_db_h" >&5 +$as_echo "$ac_cv_header_db_h" >&6; } +if test "x$ac_cv_header_db_h" = x""yes; then DB_INCLUDES=/usr/include else CFLAGS=-I/usr/include/db4 - echo "$as_me:$LINENO: checking for db4/db.h" >&5 -echo $ECHO_N "checking for db4/db.h... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for db4/db.h" >&5 +$as_echo_n "checking for db4/db.h... " >&6; } if test "${ac_cv_header_db4_db_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -13750,33 +15652,40 @@ cat >>conftest.$ac_ext <<_ACEOF #include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_header_db4_db_h=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_header_db4_db_h=no + ac_cv_header_db4_db_h=no fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_header_db4_db_h" >&5 -echo "${ECHO_T}$ac_cv_header_db4_db_h" >&6 -if test $ac_cv_header_db4_db_h = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_db4_db_h" >&5 +$as_echo "$ac_cv_header_db4_db_h" >&6; } +if test "x$ac_cv_header_db4_db_h" = x""yes; then DB_INCLUDES=/usr/include/db4 else - { { echo "$as_me:$LINENO: error: no. install the db4 libraries" >&5 -echo "$as_me: error: no. install the db4 libraries" >&2;} + { { $as_echo "$as_me:$LINENO: error: no. install the db4 libraries" >&5 +$as_echo "$as_me: error: no. install the db4 libraries" >&2;} { (exit 1); exit 1; }; } fi @@ -13785,18 +15694,19 @@ fi fi - echo "$as_me:$LINENO: checking whether db is at least 4.1" >&5 -echo $ECHO_N "checking whether db is at least 4.1... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking whether db is at least 4.1" >&5 +$as_echo_n "checking whether db is at least 4.1... " >&6; } for v in `seq 1 7`; do if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling +$as_echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -13812,48 +15722,61 @@ int main(int argc, char **argv) { _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then DB_VERSION_MINOR=$v else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -rf conftest.dSYM +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + done if test "$DB_VERSION_MINOR" -gt "1"; then - echo "$as_me:$LINENO: result: OK" >&5 -echo "${ECHO_T}OK" >&6 + { $as_echo "$as_me:$LINENO: result: OK" >&5 +$as_echo "OK" >&6; } DB_VERSION=4.$DB_VERSION_MINOR else - { { echo "$as_me:$LINENO: error: no. you need at least db 4.1" >&5 -echo "$as_me: error: no. you need at least db 4.1" >&2;} + { { $as_echo "$as_me:$LINENO: error: no. you need at least db 4.1" >&5 +$as_echo "$as_me: error: no. you need at least db 4.1" >&2;} { (exit 1); exit 1; }; } fi # does not work :/ #AC_CHECK_LIB(db, db_create, [], # [AC_MSG_ERROR([db library not installed or functional])], []) -echo "$as_me:$LINENO: checking for main in -ldb" >&5 -echo $ECHO_N "checking for main in -ldb... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for main in -ldb" >&5 +$as_echo_n "checking for main in -ldb... " >&6; } if test "${ac_cv_lib_db_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldb $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -13864,36 +15787,48 @@ cat >>conftest.$ac_ext <<_ACEOF int main () { -main (); +return main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_db_main=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_db_main=no + ac_cv_lib_db_main=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_db_main" >&5 -echo "${ECHO_T}$ac_cv_lib_db_main" >&6 -if test $ac_cv_lib_db_main = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_db_main" >&5 +$as_echo "$ac_cv_lib_db_main" >&6; } +if test "x$ac_cv_lib_db_main" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBDB 1 _ACEOF @@ -13901,16 +15836,16 @@ _ACEOF LIBS="-ldb $LIBS" else - { { echo "$as_me:$LINENO: error: db not installed or functional" >&5 -echo "$as_me: error: db not installed or functional" >&2;} + { { $as_echo "$as_me:$LINENO: error: db not installed or functional" >&5 +$as_echo "$as_me: error: db not installed or functional" >&2;} { (exit 1); exit 1; }; } fi ac_cv_lib_db=ac_cv_lib_db_main SCPDEFS="$SCPDEFS -DSYSTEM_DB" else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:$LINENO: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_DB=NO BUILD_TYPE="$BUILD_TYPE BERKELEYDB" fi @@ -13919,22 +15854,22 @@ fi -echo "$as_me:$LINENO: checking which lucene to use" >&5 -echo $ECHO_N "checking which lucene to use... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking which lucene to use" >&5 +$as_echo_n "checking which lucene to use... " >&6; } if test -n "$with_system_lucene" -o -n "$with_system_libs" && \ test "$with_system_lucene" != "no" && test "$with_system_jars" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:$LINENO: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_LUCENE=YES if test -z $LUCENE_CORE_JAR; then - echo "$as_me:$LINENO: checking for /usr/share/java/lucene-core-2.3.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/lucene-core-2.3.jar... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for /usr/share/java/lucene-core-2.3.jar" >&5 +$as_echo_n "checking for /usr/share/java/lucene-core-2.3.jar... " >&6; } if test "${ac_cv_file__usr_share_java_lucene_core_2_3_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "/usr/share/java/lucene-core-2.3.jar"; then ac_cv_file__usr_share_java_lucene_core_2_3_jar=yes @@ -13942,20 +15877,20 @@ else ac_cv_file__usr_share_java_lucene_core_2_3_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_lucene_core_2_3_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_lucene_core_2_3_jar" >&6 -if test $ac_cv_file__usr_share_java_lucene_core_2_3_jar = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_lucene_core_2_3_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_lucene_core_2_3_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_lucene_core_2_3_jar" = x""yes; then LUCENE_CORE_JAR=/usr/share/java/lucene-core-2.3.jar else - echo "$as_me:$LINENO: checking for /usr/share/java/lucene.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/lucene.jar... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for /usr/share/java/lucene.jar" >&5 +$as_echo_n "checking for /usr/share/java/lucene.jar... " >&6; } if test "${ac_cv_file__usr_share_java_lucene_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "/usr/share/java/lucene.jar"; then ac_cv_file__usr_share_java_lucene_jar=yes @@ -13963,13 +15898,13 @@ else ac_cv_file__usr_share_java_lucene_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_lucene_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_lucene_jar" >&6 -if test $ac_cv_file__usr_share_java_lucene_jar = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_lucene_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_lucene_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_lucene_jar" = x""yes; then LUCENE_CORE_JAR=/usr/share/java/lucene.jar else - { { echo "$as_me:$LINENO: error: lucene-core.jar replacement not found" >&5 -echo "$as_me: error: lucene-core.jar replacement not found" >&2;} + { { $as_echo "$as_me:$LINENO: error: lucene-core.jar replacement not found" >&5 +$as_echo "$as_me: error: lucene-core.jar replacement not found" >&2;} { (exit 1); exit 1; }; } fi @@ -13979,15 +15914,15 @@ fi fi else - as_ac_File=`echo "ac_cv_file_$LUCENE_CORE_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $LUCENE_CORE_JAR" >&5 -echo $ECHO_N "checking for $LUCENE_CORE_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$LUCENE_CORE_JAR" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $LUCENE_CORE_JAR" >&5 +$as_echo_n "checking for $LUCENE_CORE_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "$LUCENE_CORE_JAR"; then eval "$as_ac_File=yes" @@ -13995,27 +15930,31 @@ else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then : else - { { echo "$as_me:$LINENO: error: lucene-core.jar not found." >&5 -echo "$as_me: error: lucene-core.jar not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: lucene-core.jar not found." >&5 +$as_echo "$as_me: error: lucene-core.jar not found." >&2;} { (exit 1); exit 1; }; } fi fi if test -z $LUCENE_ANALYZERS_JAR; then - echo "$as_me:$LINENO: checking for /usr/share/java/lucene-analyzers-2.3.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/lucene-analyzers-2.3.jar... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for /usr/share/java/lucene-analyzers-2.3.jar" >&5 +$as_echo_n "checking for /usr/share/java/lucene-analyzers-2.3.jar... " >&6; } if test "${ac_cv_file__usr_share_java_lucene_analyzers_2_3_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "/usr/share/java/lucene-analyzers-2.3.jar"; then ac_cv_file__usr_share_java_lucene_analyzers_2_3_jar=yes @@ -14023,20 +15962,20 @@ else ac_cv_file__usr_share_java_lucene_analyzers_2_3_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_lucene_analyzers_2_3_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_lucene_analyzers_2_3_jar" >&6 -if test $ac_cv_file__usr_share_java_lucene_analyzers_2_3_jar = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_lucene_analyzers_2_3_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_lucene_analyzers_2_3_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_lucene_analyzers_2_3_jar" = x""yes; then LUCENE_ANALYZERS_JAR=/usr/share/java/lucene-analyzers-2.3.jar else - echo "$as_me:$LINENO: checking for /usr/share/java/lucene-contrib/lucene-analyzers.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/lucene-contrib/lucene-analyzers.jar... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for /usr/share/java/lucene-contrib/lucene-analyzers.jar" >&5 +$as_echo_n "checking for /usr/share/java/lucene-contrib/lucene-analyzers.jar... " >&6; } if test "${ac_cv_file__usr_share_java_lucene_contrib_lucene_analyzers_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "/usr/share/java/lucene-contrib/lucene-analyzers.jar"; then ac_cv_file__usr_share_java_lucene_contrib_lucene_analyzers_jar=yes @@ -14044,13 +15983,13 @@ else ac_cv_file__usr_share_java_lucene_contrib_lucene_analyzers_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_lucene_contrib_lucene_analyzers_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_lucene_contrib_lucene_analyzers_jar" >&6 -if test $ac_cv_file__usr_share_java_lucene_contrib_lucene_analyzers_jar = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_lucene_contrib_lucene_analyzers_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_lucene_contrib_lucene_analyzers_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_lucene_contrib_lucene_analyzers_jar" = x""yes; then LUCENE_ANALYZERS_JAR=/usr/share/java/lucene-contrib/lucene-analyzers.jar else - { { echo "$as_me:$LINENO: error: lucene-analyzers.jar replacement not found." >&5 -echo "$as_me: error: lucene-analyzers.jar replacement not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: lucene-analyzers.jar replacement not found." >&5 +$as_echo "$as_me: error: lucene-analyzers.jar replacement not found." >&2;} { (exit 1); exit 1; }; } fi @@ -14060,15 +15999,15 @@ fi fi else - as_ac_File=`echo "ac_cv_file_$LUCENE_CORE_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $LUCENE_CORE_JAR" >&5 -echo $ECHO_N "checking for $LUCENE_CORE_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$LUCENE_CORE_JAR" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $LUCENE_CORE_JAR" >&5 +$as_echo_n "checking for $LUCENE_CORE_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "$LUCENE_CORE_JAR"; then eval "$as_ac_File=yes" @@ -14076,20 +16015,24 @@ else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then : else - { { echo "$as_me:$LINENO: error: lucene-analyzers.jar not found." >&5 -echo "$as_me: error: lucene-analyzers.jar not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: lucene-analyzers.jar not found." >&5 +$as_echo "$as_me: error: lucene-analyzers.jar not found." >&2;} { (exit 1); exit 1; }; } fi fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:$LINENO: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_LUCENE=NO BUILD_TYPE="$BUILD_TYPE LUCENE" fi @@ -14097,25 +16040,25 @@ fi -echo "$as_me:$LINENO: checking which hsqldb to use" >&5 -echo $ECHO_N "checking which hsqldb to use... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking which hsqldb to use" >&5 +$as_echo_n "checking which hsqldb to use... " >&6; } if test -n "$with_system_hsqldb" -o -n "$with_system_libs" && \ test "$with_system_hsqldb" != "no" && test "$with_system_jars" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:$LINENO: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_HSQLDB=YES if test -z $HSQLDB_JAR; then HSQLDB_JAR=/usr/share/java/hsqldb.jar fi - as_ac_File=`echo "ac_cv_file_$HSQLDB_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $HSQLDB_JAR" >&5 -echo $ECHO_N "checking for $HSQLDB_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$HSQLDB_JAR" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $HSQLDB_JAR" >&5 +$as_echo_n "checking for $HSQLDB_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "$HSQLDB_JAR"; then eval "$as_ac_File=yes" @@ -14123,18 +16066,22 @@ else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then : else - { { echo "$as_me:$LINENO: error: hsqldb.jar not found." >&5 -echo "$as_me: error: hsqldb.jar not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: hsqldb.jar not found." >&5 +$as_echo "$as_me: error: hsqldb.jar not found." >&2;} { (exit 1); exit 1; }; } fi - echo "$as_me:$LINENO: checking whether hsqldb is >= 1.8.0.9" >&5 -echo $ECHO_N "checking whether hsqldb is >= 1.8.0.9... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking whether hsqldb is >= 1.8.0.9" >&5 +$as_echo_n "checking whether hsqldb is >= 1.8.0.9... " >&6; } export HSQLDB_JAR if $PERL -e 'use Archive::Zip; my $file = "$ENV{'HSQLDB_JAR'}"; @@ -14157,41 +16104,41 @@ echo $ECHO_N "checking whether hsqldb is >= 1.8.0.9... $ECHO_C" >&6 } else { exit 1; }'; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - { { echo "$as_me:$LINENO: error: no, hsqldb >= 1.8.0.9 is needed" >&5 -echo "$as_me: error: no, hsqldb >= 1.8.0.9 is needed" >&2;} + { { $as_echo "$as_me:$LINENO: error: no, hsqldb >= 1.8.0.9 is needed" >&5 +$as_echo "$as_me: error: no, hsqldb >= 1.8.0.9 is needed" >&2;} { (exit 1); exit 1; }; } fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:$LINENO: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_HSQLDB=NO BUILD_TYPE="$BUILD_TYPE HSQLDB" fi -echo "$as_me:$LINENO: checking which beanshell to use" >&5 -echo $ECHO_N "checking which beanshell to use... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking which beanshell to use" >&5 +$as_echo_n "checking which beanshell to use... " >&6; } if test -n "$with_system_beanshell" -o -n "$with_system_libs" && \ test "$with_system_beanshell" != "no" && test "$with_system_jars" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:$LINENO: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_BSH=YES if test -z $BSH_JAR; then BSH_JAR=/usr/share/java/bsh.jar fi - as_ac_File=`echo "ac_cv_file_$BSH_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $BSH_JAR" >&5 -echo $ECHO_N "checking for $BSH_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$BSH_JAR" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $BSH_JAR" >&5 +$as_echo_n "checking for $BSH_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "$BSH_JAR"; then eval "$as_ac_File=yes" @@ -14199,19 +16146,23 @@ else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then : else - { { echo "$as_me:$LINENO: error: bsh.jar not found." >&5 -echo "$as_me: error: bsh.jar not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: bsh.jar not found." >&5 +$as_echo "$as_me: error: bsh.jar not found." >&2;} { (exit 1); exit 1; }; } fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:$LINENO: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_BSH=NO BUILD_TYPE="$BUILD_TYPE BSH" fi @@ -14219,22 +16170,22 @@ fi -echo "$as_me:$LINENO: checking which saxon to use" >&5 -echo $ECHO_N "checking which saxon to use... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking which saxon to use" >&5 +$as_echo_n "checking which saxon to use... " >&6; } if test -n "$with_system_saxon" -o -n "$with_system_libs" && \ test "$with_system_saxon" != "no" && test "$with_system_jars" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:$LINENO: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_SAXON=YES if test -z $SAXON_JAR; then - echo "$as_me:$LINENO: checking for /usr/share/java/saxon9.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/saxon9.jar... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for /usr/share/java/saxon9.jar" >&5 +$as_echo_n "checking for /usr/share/java/saxon9.jar... " >&6; } if test "${ac_cv_file__usr_share_java_saxon9_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "/usr/share/java/saxon9.jar"; then ac_cv_file__usr_share_java_saxon9_jar=yes @@ -14242,20 +16193,20 @@ else ac_cv_file__usr_share_java_saxon9_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_saxon9_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_saxon9_jar" >&6 -if test $ac_cv_file__usr_share_java_saxon9_jar = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_saxon9_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_saxon9_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_saxon9_jar" = x""yes; then SAXON_JAR=/usr/share/java/saxon9.jar else - echo "$as_me:$LINENO: checking for /usr/share/java/saxon.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/saxon.jar... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for /usr/share/java/saxon.jar" >&5 +$as_echo_n "checking for /usr/share/java/saxon.jar... " >&6; } if test "${ac_cv_file__usr_share_java_saxon_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "/usr/share/java/saxon.jar"; then ac_cv_file__usr_share_java_saxon_jar=yes @@ -14263,19 +16214,19 @@ else ac_cv_file__usr_share_java_saxon_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_saxon_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_saxon_jar" >&6 -if test $ac_cv_file__usr_share_java_saxon_jar = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_saxon_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_saxon_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_saxon_jar" = x""yes; then SAXON_JAR=/usr/share/java/saxon.jar else - echo "$as_me:$LINENO: checking for /usr/share/java/saxon9.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/saxon9.jar... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for /usr/share/java/saxon9.jar" >&5 +$as_echo_n "checking for /usr/share/java/saxon9.jar... " >&6; } if test "${ac_cv_file__usr_share_java_saxon9_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "/usr/share/java/saxon9.jar"; then ac_cv_file__usr_share_java_saxon9_jar=yes @@ -14283,13 +16234,13 @@ else ac_cv_file__usr_share_java_saxon9_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_saxon9_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_saxon9_jar" >&6 -if test $ac_cv_file__usr_share_java_saxon9_jar = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_saxon9_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_saxon9_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_saxon9_jar" = x""yes; then SAXON_JAR=/usr/share/java/saxon9.jar else - { { echo "$as_me:$LINENO: error: saxon.jar replacement not found" >&5 -echo "$as_me: error: saxon.jar replacement not found" >&2;} + { { $as_echo "$as_me:$LINENO: error: saxon.jar replacement not found" >&5 +$as_echo "$as_me: error: saxon.jar replacement not found" >&2;} { (exit 1); exit 1; }; } fi @@ -14303,15 +16254,15 @@ fi fi else - as_ac_File=`echo "ac_cv_file_$SAXON_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $SAXON_JAR" >&5 -echo $ECHO_N "checking for $SAXON_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$SAXON_JAR" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $SAXON_JAR" >&5 +$as_echo_n "checking for $SAXON_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "$SAXON_JAR"; then eval "$as_ac_File=yes" @@ -14319,27 +16270,31 @@ else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then : else - { { echo "$as_me:$LINENO: error: saxon.jar replacement not found." >&5 -echo "$as_me: error: saxon.jar replacement not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: saxon.jar replacement not found." >&5 +$as_echo "$as_me: error: saxon.jar replacement not found." >&2;} { (exit 1); exit 1; }; } fi fi if test -n "$SERIALIZER_JAR"; then - as_ac_File=`echo "ac_cv_file_$SERIALIZER_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $SERIALIZER_JAR" >&5 -echo $ECHO_N "checking for $SERIALIZER_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$SERIALIZER_JAR" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $SERIALIZER_JAR" >&5 +$as_echo_n "checking for $SERIALIZER_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "$SERIALIZER_JAR"; then eval "$as_ac_File=yes" @@ -14347,21 +16302,25 @@ else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then : else - { { echo "$as_me:$LINENO: error: serializer.jar not found." >&5 -echo "$as_me: error: serializer.jar not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: serializer.jar not found." >&5 +$as_echo "$as_me: error: serializer.jar not found." >&2;} { (exit 1); exit 1; }; } fi fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:$LINENO: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_SAXON=NO NEED_SAXON=TRUE fi @@ -14375,20 +16334,20 @@ fi if test "$_os" = "Darwin" && test "$with_system_curl" != "no"; then with_system_curl=yes fi -echo "$as_me:$LINENO: checking which curl to use" >&5 -echo $ECHO_N "checking which curl to use... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking which curl to use" >&5 +$as_echo_n "checking which curl to use... " >&6; } if test -n "$with_system_curl" -o -n "$with_system_libs" && \ test "$with_system_curl" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:$LINENO: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_CURL=YES # Extract the first word of "curl-config", so it can be a program name with args. set dummy curl-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_CURLCONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $CURLCONFIG in [\\/]* | ?:[\\/]*) @@ -14401,51 +16360,52 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CURLCONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi CURLCONFIG=$ac_cv_path_CURLCONFIG - if test -n "$CURLCONFIG"; then - echo "$as_me:$LINENO: result: $CURLCONFIG" >&5 -echo "${ECHO_T}$CURLCONFIG" >&6 + { $as_echo "$as_me:$LINENO: result: $CURLCONFIG" >&5 +$as_echo "$CURLCONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + if test -z "$CURLCONFIG"; then - { { echo "$as_me:$LINENO: error: install curl to run this script" >&5 -echo "$as_me: error: install curl to run this script" >&2;} + { { $as_echo "$as_me:$LINENO: error: install curl to run this script" >&5 +$as_echo "$as_me: error: install curl to run this script" >&2;} { (exit 1); exit 1; }; } fi # check curl version - echo "$as_me:$LINENO: checking whether curl is >= 7.9.8" >&5 -echo $ECHO_N "checking whether curl is >= 7.9.8... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking whether curl is >= 7.9.8" >&5 +$as_echo_n "checking whether curl is >= 7.9.8... " >&6; } if test "`$CURLCONFIG --version | $AWK -F' ' '{print $2}' | $AWK -F. '{ print $1 }'`" -gt "7" -a \ "`$CURLCONFIG --version | $AWK -F' ' '{print $2}' | $AWK -F. '{ print $2 }'`" -gt "9" -a \ "`$CURLCONFIG --version | $AWK -F' ' '{print $2}' | $AWK -F. '{ print $3 }'`" -gt "8"; then - { { echo "$as_me:$LINENO: error: no, you need at least curl 7.9,8" >&5 -echo "$as_me: error: no, you need at least curl 7.9,8" >&2;} + { { $as_echo "$as_me:$LINENO: error: no, you need at least curl 7.9,8" >&5 +$as_echo "$as_me: error: no, you need at least curl 7.9,8" >&2;} { (exit 1); exit 1; }; } else - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } fi CURL_LIBS=`$CURLCONFIG --libs` CURL_CFLAGS=`$CURLCONFIG --cflags` else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:$LINENO: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_CURL=NO BUILD_TYPE="$BUILD_TYPE CURL" fi @@ -14453,33 +16413,32 @@ fi -echo "$as_me:$LINENO: checking which boost to use" >&5 -echo $ECHO_N "checking which boost to use... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking which boost to use" >&5 +$as_echo_n "checking which boost to use... " >&6; } if test -n "$with_system_boost" -o -n "$with_system_headers" && \ test "$with_system_boost" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:$LINENO: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_BOOST=YES - ac_ext=cc + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test "${ac_cv_header_boost_shared_ptr_hpp+set}" = set; then - echo "$as_me:$LINENO: checking for boost/shared_ptr.hpp" >&5 -echo $ECHO_N "checking for boost/shared_ptr.hpp... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for boost/shared_ptr.hpp" >&5 +$as_echo_n "checking for boost/shared_ptr.hpp... " >&6; } if test "${ac_cv_header_boost_shared_ptr_hpp+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_boost_shared_ptr_hpp" >&5 -echo "${ECHO_T}$ac_cv_header_boost_shared_ptr_hpp" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_boost_shared_ptr_hpp" >&5 +$as_echo "$ac_cv_header_boost_shared_ptr_hpp" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking boost/shared_ptr.hpp usability" >&5 -echo $ECHO_N "checking boost/shared_ptr.hpp usability... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking boost/shared_ptr.hpp usability" >&5 +$as_echo_n "checking boost/shared_ptr.hpp usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -14489,33 +16448,39 @@ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking boost/shared_ptr.hpp presence" >&5 -echo $ECHO_N "checking boost/shared_ptr.hpp presence... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking boost/shared_ptr.hpp presence" >&5 +$as_echo_n "checking boost/shared_ptr.hpp presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -14523,101 +16488,93 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: boost/shared_ptr.hpp: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: boost/shared_ptr.hpp: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: boost/shared_ptr.hpp: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: boost/shared_ptr.hpp: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: boost/shared_ptr.hpp: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: boost/shared_ptr.hpp: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: boost/shared_ptr.hpp: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: boost/shared_ptr.hpp: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: boost/shared_ptr.hpp: present but cannot be compiled" >&5 -echo "$as_me: WARNING: boost/shared_ptr.hpp: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: boost/shared_ptr.hpp: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: boost/shared_ptr.hpp: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: boost/shared_ptr.hpp: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: boost/shared_ptr.hpp: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: boost/shared_ptr.hpp: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: boost/shared_ptr.hpp: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: boost/shared_ptr.hpp: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: boost/shared_ptr.hpp: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: boost/shared_ptr.hpp: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: boost/shared_ptr.hpp: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: boost/shared_ptr.hpp: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: boost/shared_ptr.hpp: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: boost/shared_ptr.hpp: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: boost/shared_ptr.hpp: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: boost/shared_ptr.hpp: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: boost/shared_ptr.hpp: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for boost/shared_ptr.hpp" >&5 -echo $ECHO_N "checking for boost/shared_ptr.hpp... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for boost/shared_ptr.hpp" >&5 +$as_echo_n "checking for boost/shared_ptr.hpp... " >&6; } if test "${ac_cv_header_boost_shared_ptr_hpp+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_boost_shared_ptr_hpp=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_boost_shared_ptr_hpp" >&5 -echo "${ECHO_T}$ac_cv_header_boost_shared_ptr_hpp" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_boost_shared_ptr_hpp" >&5 +$as_echo "$ac_cv_header_boost_shared_ptr_hpp" >&6; } fi -if test $ac_cv_header_boost_shared_ptr_hpp = yes; then +if test "x$ac_cv_header_boost_shared_ptr_hpp" = x""yes; then : else - { { echo "$as_me:$LINENO: error: boost/shared_ptr.hpp not found. install boost" >&5 -echo "$as_me: error: boost/shared_ptr.hpp not found. install boost" >&2;} + { { $as_echo "$as_me:$LINENO: error: boost/shared_ptr.hpp not found. install boost" >&5 +$as_echo "$as_me: error: boost/shared_ptr.hpp not found. install boost" >&2;} { (exit 1); exit 1; }; } fi if test "${ac_cv_header_boost_spirit_core_hpp+set}" = set; then - echo "$as_me:$LINENO: checking for boost/spirit/core.hpp" >&5 -echo $ECHO_N "checking for boost/spirit/core.hpp... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for boost/spirit/core.hpp" >&5 +$as_echo_n "checking for boost/spirit/core.hpp... " >&6; } if test "${ac_cv_header_boost_spirit_core_hpp+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_boost_spirit_core_hpp" >&5 -echo "${ECHO_T}$ac_cv_header_boost_spirit_core_hpp" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_boost_spirit_core_hpp" >&5 +$as_echo "$ac_cv_header_boost_spirit_core_hpp" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking boost/spirit/core.hpp usability" >&5 -echo $ECHO_N "checking boost/spirit/core.hpp usability... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking boost/spirit/core.hpp usability" >&5 +$as_echo_n "checking boost/spirit/core.hpp usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -14627,33 +16584,39 @@ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking boost/spirit/core.hpp presence" >&5 -echo $ECHO_N "checking boost/spirit/core.hpp presence... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking boost/spirit/core.hpp presence" >&5 +$as_echo_n "checking boost/spirit/core.hpp presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -14661,83 +16624,76 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: boost/spirit/core.hpp: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: boost/spirit/core.hpp: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: boost/spirit/core.hpp: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: boost/spirit/core.hpp: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: boost/spirit/core.hpp: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: boost/spirit/core.hpp: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: boost/spirit/core.hpp: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: boost/spirit/core.hpp: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: boost/spirit/core.hpp: present but cannot be compiled" >&5 -echo "$as_me: WARNING: boost/spirit/core.hpp: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: boost/spirit/core.hpp: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: boost/spirit/core.hpp: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: boost/spirit/core.hpp: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: boost/spirit/core.hpp: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: boost/spirit/core.hpp: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: boost/spirit/core.hpp: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: boost/spirit/core.hpp: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: boost/spirit/core.hpp: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: boost/spirit/core.hpp: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: boost/spirit/core.hpp: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: boost/spirit/core.hpp: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: boost/spirit/core.hpp: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: boost/spirit/core.hpp: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: boost/spirit/core.hpp: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: boost/spirit/core.hpp: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: boost/spirit/core.hpp: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for boost/spirit/core.hpp" >&5 -echo $ECHO_N "checking for boost/spirit/core.hpp... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for boost/spirit/core.hpp" >&5 +$as_echo_n "checking for boost/spirit/core.hpp... " >&6; } if test "${ac_cv_header_boost_spirit_core_hpp+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_boost_spirit_core_hpp=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_boost_spirit_core_hpp" >&5 -echo "${ECHO_T}$ac_cv_header_boost_spirit_core_hpp" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_boost_spirit_core_hpp" >&5 +$as_echo "$ac_cv_header_boost_spirit_core_hpp" >&6; } fi -if test $ac_cv_header_boost_spirit_core_hpp = yes; then +if test "x$ac_cv_header_boost_spirit_core_hpp" = x""yes; then : else - { { echo "$as_me:$LINENO: error: boost/spirit/core.hpp not found. install boost" >&5 -echo "$as_me: error: boost/spirit/core.hpp not found. install boost" >&2;} + { { $as_echo "$as_me:$LINENO: error: boost/spirit/core.hpp not found. install boost" >&5 +$as_echo "$as_me: error: boost/spirit/core.hpp not found. install boost" >&2;} { (exit 1); exit 1; }; } fi @@ -14749,40 +16705,39 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:$LINENO: result: internal" >&5 +$as_echo "internal" >&6; } BUILD_TYPE="$BUILD_TYPE BOOST" SYSTEM_BOOST=NO fi -echo "$as_me:$LINENO: checking which vigra to use" >&5 -echo $ECHO_N "checking which vigra to use... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking which vigra to use" >&5 +$as_echo_n "checking which vigra to use... " >&6; } if test -n "$with_system_vigra" -o -n "$with_system_headers" && \ test "$with_system_vigra" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:$LINENO: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_VIGRA=YES - ac_ext=cc + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test "${ac_cv_header_vigra_copyimage_hxx+set}" = set; then - echo "$as_me:$LINENO: checking for vigra/copyimage.hxx" >&5 -echo $ECHO_N "checking for vigra/copyimage.hxx... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for vigra/copyimage.hxx" >&5 +$as_echo_n "checking for vigra/copyimage.hxx... " >&6; } if test "${ac_cv_header_vigra_copyimage_hxx+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_vigra_copyimage_hxx" >&5 -echo "${ECHO_T}$ac_cv_header_vigra_copyimage_hxx" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_vigra_copyimage_hxx" >&5 +$as_echo "$ac_cv_header_vigra_copyimage_hxx" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking vigra/copyimage.hxx usability" >&5 -echo $ECHO_N "checking vigra/copyimage.hxx usability... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking vigra/copyimage.hxx usability" >&5 +$as_echo_n "checking vigra/copyimage.hxx usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -14792,33 +16747,39 @@ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking vigra/copyimage.hxx presence" >&5 -echo $ECHO_N "checking vigra/copyimage.hxx presence... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking vigra/copyimage.hxx presence" >&5 +$as_echo_n "checking vigra/copyimage.hxx presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -14826,83 +16787,76 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: vigra/copyimage.hxx: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: vigra/copyimage.hxx: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: vigra/copyimage.hxx: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: vigra/copyimage.hxx: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: vigra/copyimage.hxx: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: vigra/copyimage.hxx: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: vigra/copyimage.hxx: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: vigra/copyimage.hxx: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: vigra/copyimage.hxx: present but cannot be compiled" >&5 -echo "$as_me: WARNING: vigra/copyimage.hxx: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: vigra/copyimage.hxx: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: vigra/copyimage.hxx: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: vigra/copyimage.hxx: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: vigra/copyimage.hxx: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: vigra/copyimage.hxx: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: vigra/copyimage.hxx: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: vigra/copyimage.hxx: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: vigra/copyimage.hxx: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: vigra/copyimage.hxx: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: vigra/copyimage.hxx: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: vigra/copyimage.hxx: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: vigra/copyimage.hxx: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: vigra/copyimage.hxx: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: vigra/copyimage.hxx: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: vigra/copyimage.hxx: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: vigra/copyimage.hxx: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for vigra/copyimage.hxx" >&5 -echo $ECHO_N "checking for vigra/copyimage.hxx... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for vigra/copyimage.hxx" >&5 +$as_echo_n "checking for vigra/copyimage.hxx... " >&6; } if test "${ac_cv_header_vigra_copyimage_hxx+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_vigra_copyimage_hxx=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_vigra_copyimage_hxx" >&5 -echo "${ECHO_T}$ac_cv_header_vigra_copyimage_hxx" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_vigra_copyimage_hxx" >&5 +$as_echo "$ac_cv_header_vigra_copyimage_hxx" >&6; } fi -if test $ac_cv_header_vigra_copyimage_hxx = yes; then +if test "x$ac_cv_header_vigra_copyimage_hxx" = x""yes; then : else - { { echo "$as_me:$LINENO: error: vigra/copyimage.hxx not found. install vigra" >&5 -echo "$as_me: error: vigra/copyimage.hxx not found. install vigra" >&2;} + { { $as_echo "$as_me:$LINENO: error: vigra/copyimage.hxx not found. install vigra" >&5 +$as_echo "$as_me: error: vigra/copyimage.hxx not found. install vigra" >&2;} { (exit 1); exit 1; }; } fi @@ -14914,35 +16868,34 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:$LINENO: result: internal" >&5 +$as_echo "internal" >&6; } BUILD_TYPE="$BUILD_TYPE VIGRA" SYSTEM_VIGRA=NO fi -echo "$as_me:$LINENO: checking which odbc headers to use" >&5 -echo $ECHO_N "checking which odbc headers to use... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking which odbc headers to use" >&5 +$as_echo_n "checking which odbc headers to use... " >&6; } if test -n "$with_system_odbc_headers" -o -n "$with_system_headers" && \ test "$with_system_odbc_headers" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:$LINENO: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_ODBC_HEADERS=YES if test "${ac_cv_header_sqlext_h+set}" = set; then - echo "$as_me:$LINENO: checking for sqlext.h" >&5 -echo $ECHO_N "checking for sqlext.h... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for sqlext.h" >&5 +$as_echo_n "checking for sqlext.h... " >&6; } if test "${ac_cv_header_sqlext_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_sqlext_h" >&5 -echo "${ECHO_T}$ac_cv_header_sqlext_h" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sqlext_h" >&5 +$as_echo "$ac_cv_header_sqlext_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking sqlext.h usability" >&5 -echo $ECHO_N "checking sqlext.h usability... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking sqlext.h usability" >&5 +$as_echo_n "checking sqlext.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -14952,33 +16905,39 @@ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking sqlext.h presence" >&5 -echo $ECHO_N "checking sqlext.h presence... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking sqlext.h presence" >&5 +$as_echo_n "checking sqlext.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -14986,174 +16945,168 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: sqlext.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: sqlext.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: sqlext.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: sqlext.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: sqlext.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: sqlext.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sqlext.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: sqlext.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: sqlext.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: sqlext.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: sqlext.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: sqlext.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: sqlext.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: sqlext.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: sqlext.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: sqlext.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sqlext.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: sqlext.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sqlext.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: sqlext.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sqlext.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: sqlext.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sqlext.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: sqlext.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sqlext.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: sqlext.h: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for sqlext.h" >&5 -echo $ECHO_N "checking for sqlext.h... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for sqlext.h" >&5 +$as_echo_n "checking for sqlext.h... " >&6; } if test "${ac_cv_header_sqlext_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_sqlext_h=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_sqlext_h" >&5 -echo "${ECHO_T}$ac_cv_header_sqlext_h" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sqlext_h" >&5 +$as_echo "$ac_cv_header_sqlext_h" >&6; } fi -if test $ac_cv_header_sqlext_h = yes; then +if test "x$ac_cv_header_sqlext_h" = x""yes; then : else - { { echo "$as_me:$LINENO: error: odbc not found. install odbc" >&5 -echo "$as_me: error: odbc not found. install odbc" >&2;} + { { $as_echo "$as_me:$LINENO: error: odbc not found. install odbc" >&5 +$as_echo "$as_me: error: odbc not found. install odbc" >&2;} { (exit 1); exit 1; }; } fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:$LINENO: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_ODBC_HEADERS=NO BUILD_TYPE="$BUILD_TYPE UNIXODBC" fi -echo "$as_me:$LINENO: checking whether to enable build of Mozilla/Mozilla NSS-using components" >&5 -echo $ECHO_N "checking whether to enable build of Mozilla/Mozilla NSS-using components... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to enable build of Mozilla/Mozilla NSS-using components" >&5 +$as_echo_n "checking whether to enable build of Mozilla/Mozilla NSS-using components... " >&6; } if test "$enable_mozilla" = "no"; then - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } WITH_MOZILLA=NO else - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } WITH_MOZILLA=YES fi -echo "$as_me:$LINENO: checking whether to build Mozilla addressbook connectivity" >&5 -echo $ECHO_N "checking whether to build Mozilla addressbook connectivity... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to build Mozilla addressbook connectivity" >&5 +$as_echo_n "checking whether to build Mozilla addressbook connectivity... " >&6; } if test "$enable_mozilla" = "no"; then - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } elif test "$with_system_mozilla" = "yes"; then - echo "$as_me:$LINENO: result: no, not possible with system-mozilla" >&5 -echo "${ECHO_T}no, not possible with system-mozilla" >&6 + { $as_echo "$as_me:$LINENO: result: no, not possible with system-mozilla" >&5 +$as_echo "no, not possible with system-mozilla" >&6; } else - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } fi -echo "$as_me:$LINENO: checking whether to build XML Security support" >&5 -echo $ECHO_N "checking whether to build XML Security support... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to build XML Security support" >&5 +$as_echo_n "checking whether to build XML Security support... " >&6; } if test "$enable_mozilla" = "no"; then - echo "$as_me:$LINENO: result: no, since Mozilla (NSS) disabled but needed" >&5 -echo "${ECHO_T}no, since Mozilla (NSS) disabled but needed" >&6 + { $as_echo "$as_me:$LINENO: result: no, since Mozilla (NSS) disabled but needed" >&5 +$as_echo "no, since Mozilla (NSS) disabled but needed" >&6; } else - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } fi -echo "$as_me:$LINENO: checking whether to build LDAP configuration backend" >&5 -echo $ECHO_N "checking whether to build LDAP configuration backend... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to build LDAP configuration backend" >&5 +$as_echo_n "checking whether to build LDAP configuration backend... " >&6; } if test -z "$enable_ldap" || test "$enable_ldap" = "yes"; then if test "$enable_mozilla" = "yes" || test "$with_openldap" = "yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } WITH_LDAP=YES else - echo "$as_me:$LINENO: result: no. Either Mozilla or OpenLDAP needed" >&5 -echo "${ECHO_T}no. Either Mozilla or OpenLDAP needed" >&6 + { $as_echo "$as_me:$LINENO: result: no. Either Mozilla or OpenLDAP needed" >&5 +$as_echo "no. Either Mozilla or OpenLDAP needed" >&6; } WITH_LDAP=NO fi else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } WITH_LDAP=NO fi if test "$WITH_LDAP" = "YES"; then - echo "$as_me:$LINENO: checking which LDAP SDK to use" >&5 -echo $ECHO_N "checking which LDAP SDK to use... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking which LDAP SDK to use" >&5 +$as_echo_n "checking which LDAP SDK to use... " >&6; } if test -n "$with_openldap" && test "$with_openldap" != "no"; then - echo "$as_me:$LINENO: result: OpenLDAP" >&5 -echo "${ECHO_T}OpenLDAP" >&6 + { $as_echo "$as_me:$LINENO: result: OpenLDAP" >&5 +$as_echo "OpenLDAP" >&6; } WITH_OPENLDAP=YES for ac_header in ldap.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -15163,33 +17116,39 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -15197,147 +17156,155 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 else - eval "$as_ac_Header=$ac_header_preproc" + eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else - { { echo "$as_me:$LINENO: error: ldap.h not found. install openldap libs" >&5 -echo "$as_me: error: ldap.h not found. install openldap libs" >&2;} + { { $as_echo "$as_me:$LINENO: error: ldap.h not found. install openldap libs" >&5 +$as_echo "$as_me: error: ldap.h not found. install openldap libs" >&2;} { (exit 1); exit 1; }; } fi done -echo "$as_me:$LINENO: checking for ldap_simple_bind_s in -lldap" >&5 -echo $ECHO_N "checking for ldap_simple_bind_s in -lldap... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for ldap_simple_bind_s in -lldap" >&5 +$as_echo_n "checking for ldap_simple_bind_s in -lldap... " >&6; } if test "${ac_cv_lib_ldap_ldap_simple_bind_s+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lldap $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char ldap_simple_bind_s (); int main () { -ldap_simple_bind_s (); +return ldap_simple_bind_s (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_ldap_ldap_simple_bind_s=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_ldap_ldap_simple_bind_s=no + ac_cv_lib_ldap_ldap_simple_bind_s=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_ldap_ldap_simple_bind_s" >&5 -echo "${ECHO_T}$ac_cv_lib_ldap_ldap_simple_bind_s" >&6 -if test $ac_cv_lib_ldap_ldap_simple_bind_s = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ldap_ldap_simple_bind_s" >&5 +$as_echo "$ac_cv_lib_ldap_ldap_simple_bind_s" >&6; } +if test "x$ac_cv_lib_ldap_ldap_simple_bind_s" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBLDAP 1 _ACEOF @@ -15345,69 +17312,80 @@ _ACEOF LIBS="-lldap $LIBS" else - { { echo "$as_me:$LINENO: error: openldap lib not found or functional" >&5 -echo "$as_me: error: openldap lib not found or functional" >&2;} + { { $as_echo "$as_me:$LINENO: error: openldap lib not found or functional" >&5 +$as_echo "$as_me: error: openldap lib not found or functional" >&2;} { (exit 1); exit 1; }; } fi # rumours say that OpenLDAP doesn't have that function. I looked and # it has it. Test for it to be sure -echo "$as_me:$LINENO: checking for ldap_set_option in -lldap" >&5 -echo $ECHO_N "checking for ldap_set_option in -lldap... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for ldap_set_option in -lldap" >&5 +$as_echo_n "checking for ldap_set_option in -lldap... " >&6; } if test "${ac_cv_lib_ldap_ldap_set_option+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lldap $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char ldap_set_option (); int main () { -ldap_set_option (); +return ldap_set_option (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_ldap_ldap_set_option=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_ldap_ldap_set_option=no + ac_cv_lib_ldap_ldap_set_option=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_ldap_ldap_set_option" >&5 -echo "${ECHO_T}$ac_cv_lib_ldap_ldap_set_option" >&6 -if test $ac_cv_lib_ldap_ldap_set_option = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ldap_ldap_set_option" >&5 +$as_echo "$ac_cv_lib_ldap_ldap_set_option" >&6; } +if test "x$ac_cv_lib_ldap_ldap_set_option" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBLDAP 1 _ACEOF @@ -15415,14 +17393,14 @@ _ACEOF LIBS="-lldap $LIBS" else - { { echo "$as_me:$LINENO: error: openldap lib not found or functional" >&5 -echo "$as_me: error: openldap lib not found or functional" >&2;} + { { $as_echo "$as_me:$LINENO: error: openldap lib not found or functional" >&5 +$as_echo "$as_me: error: openldap lib not found or functional" >&2;} { (exit 1); exit 1; }; } fi else - echo "$as_me:$LINENO: result: Netscape/Mozilla" >&5 -echo "${ECHO_T}Netscape/Mozilla" >&6 + { $as_echo "$as_me:$LINENO: result: Netscape/Mozilla" >&5 +$as_echo "Netscape/Mozilla" >&6; } # TODO. Actually do a sanity check and check for # LDAP_OPT_SIZELIMIT and LDAP_X_OPT_CONNECT_TIMEOUT WITH_OPENLDAP=NO @@ -15431,14 +17409,14 @@ fi -echo "$as_me:$LINENO: checking which mozilla to use" >&5 -echo $ECHO_N "checking which mozilla to use... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking which mozilla to use" >&5 +$as_echo_n "checking which mozilla to use... " >&6; } if test -n "$with_system_mozilla" && test "$with_system_mozilla" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:$LINENO: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_MOZILLA=YES - echo "$as_me:$LINENO: checking which Mozilla flavour to use" >&5 -echo $ECHO_N "checking which Mozilla flavour to use... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking which Mozilla flavour to use" >&5 +$as_echo_n "checking which Mozilla flavour to use... " >&6; } if test -n "$with_system_mozilla" && test "$with_system_mozilla" = "libxul"; then MOZ_FLAVOUR=libxul elif test -n "$with_system_mozilla" && test "$with_system_mozilla" = "xulrunner"; then @@ -15453,8 +17431,8 @@ echo $ECHO_N "checking which Mozilla flavour to use... $ECHO_C" >&6 MOZ_FLAVOUR=libxul fi tmp=`echo $MOZ_FLAVOUR | $PERL -e 'print ucfirst();'` - echo "$as_me:$LINENO: result: $tmp" >&5 -echo "${ECHO_T}$tmp" >&6 + { $as_echo "$as_me:$LINENO: result: $tmp" >&5 +$as_echo "$tmp" >&6; } succeeded=no @@ -15462,10 +17440,10 @@ echo "${ECHO_T}$tmp" >&6 if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -15478,28 +17456,29 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -15510,25 +17489,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for nss" >&5 -echo $ECHO_N "checking for nss... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for nss" >&5 +$as_echo_n "checking for nss... " >&6; } if $PKG_CONFIG --exists "nss" ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking MOZ_NSS_CFLAGS" >&5 -echo $ECHO_N "checking MOZ_NSS_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking MOZ_NSS_CFLAGS" >&5 +$as_echo_n "checking MOZ_NSS_CFLAGS... " >&6; } MOZ_NSS_CFLAGS=`$PKG_CONFIG --cflags "nss"` - echo "$as_me:$LINENO: result: $MOZ_NSS_CFLAGS" >&5 -echo "${ECHO_T}$MOZ_NSS_CFLAGS" >&6 + { $as_echo "$as_me:$LINENO: result: $MOZ_NSS_CFLAGS" >&5 +$as_echo "$MOZ_NSS_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking MOZ_NSS_LIBS" >&5 -echo $ECHO_N "checking MOZ_NSS_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking MOZ_NSS_LIBS" >&5 +$as_echo_n "checking MOZ_NSS_LIBS... " >&6; } MOZ_NSS_LIBS=`$PKG_CONFIG --libs "nss"` - echo "$as_me:$LINENO: result: $MOZ_NSS_LIBS" >&5 -echo "${ECHO_T}$MOZ_NSS_LIBS" >&6 + { $as_echo "$as_me:$LINENO: result: $MOZ_NSS_LIBS" >&5 +$as_echo "$MOZ_NSS_LIBS" >&6; } else MOZ_NSS_CFLAGS="" MOZ_NSS_LIBS="" @@ -15559,10 +17538,10 @@ echo "${ECHO_T}$MOZ_NSS_LIBS" >&6 if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -15575,28 +17554,29 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -15607,25 +17587,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for $MOZ_FLAVOUR-nss " >&5 -echo $ECHO_N "checking for $MOZ_FLAVOUR-nss ... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for $MOZ_FLAVOUR-nss " >&5 +$as_echo_n "checking for $MOZ_FLAVOUR-nss ... " >&6; } if $PKG_CONFIG --exists "$MOZ_FLAVOUR-nss " ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking MOZ_NSS_CFLAGS" >&5 -echo $ECHO_N "checking MOZ_NSS_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking MOZ_NSS_CFLAGS" >&5 +$as_echo_n "checking MOZ_NSS_CFLAGS... " >&6; } MOZ_NSS_CFLAGS=`$PKG_CONFIG --cflags "$MOZ_FLAVOUR-nss "` - echo "$as_me:$LINENO: result: $MOZ_NSS_CFLAGS" >&5 -echo "${ECHO_T}$MOZ_NSS_CFLAGS" >&6 + { $as_echo "$as_me:$LINENO: result: $MOZ_NSS_CFLAGS" >&5 +$as_echo "$MOZ_NSS_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking MOZ_NSS_LIBS" >&5 -echo $ECHO_N "checking MOZ_NSS_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking MOZ_NSS_LIBS" >&5 +$as_echo_n "checking MOZ_NSS_LIBS... " >&6; } MOZ_NSS_LIBS=`$PKG_CONFIG --libs "$MOZ_FLAVOUR-nss "` - echo "$as_me:$LINENO: result: $MOZ_NSS_LIBS" >&5 -echo "${ECHO_T}$MOZ_NSS_LIBS" >&6 + { $as_echo "$as_me:$LINENO: result: $MOZ_NSS_LIBS" >&5 +$as_echo "$MOZ_NSS_LIBS" >&6; } else MOZ_NSS_CFLAGS="" MOZ_NSS_LIBS="" @@ -15646,8 +17626,8 @@ echo "${ECHO_T}$MOZ_NSS_LIBS" >&6 if test $succeeded = yes; then : else - { { echo "$as_me:$LINENO: error: Library requirements ($MOZ_FLAVOUR-nss ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 -echo "$as_me: error: Library requirements ($MOZ_FLAVOUR-nss ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} + { { $as_echo "$as_me:$LINENO: error: Library requirements ($MOZ_FLAVOUR-nss ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 +$as_echo "$as_me: error: Library requirements ($MOZ_FLAVOUR-nss ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} { (exit 1); exit 1; }; } fi @@ -15663,10 +17643,10 @@ echo "$as_me: error: Library requirements ($MOZ_FLAVOUR-nss ) not met; consider if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -15679,28 +17659,29 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -15711,25 +17692,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for nspr " >&5 -echo $ECHO_N "checking for nspr ... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for nspr " >&5 +$as_echo_n "checking for nspr ... " >&6; } if $PKG_CONFIG --exists "nspr " ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking MOZ_NSPR_CFLAGS" >&5 -echo $ECHO_N "checking MOZ_NSPR_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking MOZ_NSPR_CFLAGS" >&5 +$as_echo_n "checking MOZ_NSPR_CFLAGS... " >&6; } MOZ_NSPR_CFLAGS=`$PKG_CONFIG --cflags "nspr "` - echo "$as_me:$LINENO: result: $MOZ_NSPR_CFLAGS" >&5 -echo "${ECHO_T}$MOZ_NSPR_CFLAGS" >&6 + { $as_echo "$as_me:$LINENO: result: $MOZ_NSPR_CFLAGS" >&5 +$as_echo "$MOZ_NSPR_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking MOZ_NSPR_LIBS" >&5 -echo $ECHO_N "checking MOZ_NSPR_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking MOZ_NSPR_LIBS" >&5 +$as_echo_n "checking MOZ_NSPR_LIBS... " >&6; } MOZ_NSPR_LIBS=`$PKG_CONFIG --libs "nspr "` - echo "$as_me:$LINENO: result: $MOZ_NSPR_LIBS" >&5 -echo "${ECHO_T}$MOZ_NSPR_LIBS" >&6 + { $as_echo "$as_me:$LINENO: result: $MOZ_NSPR_LIBS" >&5 +$as_echo "$MOZ_NSPR_LIBS" >&6; } else MOZ_NSPR_CFLAGS="" MOZ_NSPR_LIBS="" @@ -15750,8 +17731,8 @@ echo "${ECHO_T}$MOZ_NSPR_LIBS" >&6 if test $succeeded = yes; then : else - { { echo "$as_me:$LINENO: error: Library requirements (nspr ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 -echo "$as_me: error: Library requirements (nspr ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} + { { $as_echo "$as_me:$LINENO: error: Library requirements (nspr ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 +$as_echo "$as_me: error: Library requirements (nspr ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} { (exit 1); exit 1; }; } fi @@ -15764,10 +17745,10 @@ echo "$as_me: error: Library requirements (nspr ) not met; consider adjusting th if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -15780,28 +17761,29 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -15812,25 +17794,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for $MOZ_FLAVOUR-nspr " >&5 -echo $ECHO_N "checking for $MOZ_FLAVOUR-nspr ... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for $MOZ_FLAVOUR-nspr " >&5 +$as_echo_n "checking for $MOZ_FLAVOUR-nspr ... " >&6; } if $PKG_CONFIG --exists "$MOZ_FLAVOUR-nspr " ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking MOZ_NSPR_CFLAGS" >&5 -echo $ECHO_N "checking MOZ_NSPR_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking MOZ_NSPR_CFLAGS" >&5 +$as_echo_n "checking MOZ_NSPR_CFLAGS... " >&6; } MOZ_NSPR_CFLAGS=`$PKG_CONFIG --cflags "$MOZ_FLAVOUR-nspr "` - echo "$as_me:$LINENO: result: $MOZ_NSPR_CFLAGS" >&5 -echo "${ECHO_T}$MOZ_NSPR_CFLAGS" >&6 + { $as_echo "$as_me:$LINENO: result: $MOZ_NSPR_CFLAGS" >&5 +$as_echo "$MOZ_NSPR_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking MOZ_NSPR_LIBS" >&5 -echo $ECHO_N "checking MOZ_NSPR_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking MOZ_NSPR_LIBS" >&5 +$as_echo_n "checking MOZ_NSPR_LIBS... " >&6; } MOZ_NSPR_LIBS=`$PKG_CONFIG --libs "$MOZ_FLAVOUR-nspr "` - echo "$as_me:$LINENO: result: $MOZ_NSPR_LIBS" >&5 -echo "${ECHO_T}$MOZ_NSPR_LIBS" >&6 + { $as_echo "$as_me:$LINENO: result: $MOZ_NSPR_LIBS" >&5 +$as_echo "$MOZ_NSPR_LIBS" >&6; } else MOZ_NSPR_CFLAGS="" MOZ_NSPR_LIBS="" @@ -15851,8 +17833,8 @@ echo "${ECHO_T}$MOZ_NSPR_LIBS" >&6 if test $succeeded = yes; then : else - { { echo "$as_me:$LINENO: error: Library requirements ($MOZ_FLAVOUR-nspr ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 -echo "$as_me: error: Library requirements ($MOZ_FLAVOUR-nspr ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} + { { $as_echo "$as_me:$LINENO: error: Library requirements ($MOZ_FLAVOUR-nspr ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 +$as_echo "$as_me: error: Library requirements ($MOZ_FLAVOUR-nspr ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} { (exit 1); exit 1; }; } fi @@ -15865,10 +17847,10 @@ echo "$as_me: error: Library requirements ($MOZ_FLAVOUR-nspr ) not met; consider if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -15881,28 +17863,29 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -15913,25 +17896,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for $MOZ_FLAVOUR-xpcom" >&5 -echo $ECHO_N "checking for $MOZ_FLAVOUR-xpcom... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for $MOZ_FLAVOUR-xpcom" >&5 +$as_echo_n "checking for $MOZ_FLAVOUR-xpcom... " >&6; } if $PKG_CONFIG --exists "$MOZ_FLAVOUR-xpcom" ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking MOZILLAXPCOM_CFLAGS" >&5 -echo $ECHO_N "checking MOZILLAXPCOM_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking MOZILLAXPCOM_CFLAGS" >&5 +$as_echo_n "checking MOZILLAXPCOM_CFLAGS... " >&6; } MOZILLAXPCOM_CFLAGS=`$PKG_CONFIG --cflags "$MOZ_FLAVOUR-xpcom"` - echo "$as_me:$LINENO: result: $MOZILLAXPCOM_CFLAGS" >&5 -echo "${ECHO_T}$MOZILLAXPCOM_CFLAGS" >&6 + { $as_echo "$as_me:$LINENO: result: $MOZILLAXPCOM_CFLAGS" >&5 +$as_echo "$MOZILLAXPCOM_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking MOZILLAXPCOM_LIBS" >&5 -echo $ECHO_N "checking MOZILLAXPCOM_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking MOZILLAXPCOM_LIBS" >&5 +$as_echo_n "checking MOZILLAXPCOM_LIBS... " >&6; } MOZILLAXPCOM_LIBS=`$PKG_CONFIG --libs "$MOZ_FLAVOUR-xpcom"` - echo "$as_me:$LINENO: result: $MOZILLAXPCOM_LIBS" >&5 -echo "${ECHO_T}$MOZILLAXPCOM_LIBS" >&6 + { $as_echo "$as_me:$LINENO: result: $MOZILLAXPCOM_LIBS" >&5 +$as_echo "$MOZILLAXPCOM_LIBS" >&6; } else MOZILLAXPCOM_CFLAGS="" MOZILLAXPCOM_LIBS="" @@ -15966,10 +17949,10 @@ echo "${ECHO_T}$MOZILLAXPCOM_LIBS" >&6 if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -15982,28 +17965,29 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -16014,25 +17998,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for libxul " >&5 -echo $ECHO_N "checking for libxul ... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for libxul " >&5 +$as_echo_n "checking for libxul ... " >&6; } if $PKG_CONFIG --exists "libxul " ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking MOZILLAXPCOM_CFLAGS" >&5 -echo $ECHO_N "checking MOZILLAXPCOM_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking MOZILLAXPCOM_CFLAGS" >&5 +$as_echo_n "checking MOZILLAXPCOM_CFLAGS... " >&6; } MOZILLAXPCOM_CFLAGS=`$PKG_CONFIG --cflags "libxul "` - echo "$as_me:$LINENO: result: $MOZILLAXPCOM_CFLAGS" >&5 -echo "${ECHO_T}$MOZILLAXPCOM_CFLAGS" >&6 + { $as_echo "$as_me:$LINENO: result: $MOZILLAXPCOM_CFLAGS" >&5 +$as_echo "$MOZILLAXPCOM_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking MOZILLAXPCOM_LIBS" >&5 -echo $ECHO_N "checking MOZILLAXPCOM_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking MOZILLAXPCOM_LIBS" >&5 +$as_echo_n "checking MOZILLAXPCOM_LIBS... " >&6; } MOZILLAXPCOM_LIBS=`$PKG_CONFIG --libs "libxul "` - echo "$as_me:$LINENO: result: $MOZILLAXPCOM_LIBS" >&5 -echo "${ECHO_T}$MOZILLAXPCOM_LIBS" >&6 + { $as_echo "$as_me:$LINENO: result: $MOZILLAXPCOM_LIBS" >&5 +$as_echo "$MOZILLAXPCOM_LIBS" >&6; } else MOZILLAXPCOM_CFLAGS="" MOZILLAXPCOM_LIBS="" @@ -16053,8 +18037,8 @@ echo "${ECHO_T}$MOZILLAXPCOM_LIBS" >&6 if test $succeeded = yes; then : else - { { echo "$as_me:$LINENO: error: Library requirements (libxul ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 -echo "$as_me: error: Library requirements (libxul ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} + { { $as_echo "$as_me:$LINENO: error: Library requirements (libxul ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 +$as_echo "$as_me: error: Library requirements (libxul ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} { (exit 1); exit 1; }; } fi @@ -16074,61 +18058,72 @@ echo "$as_me: error: Library requirements (libxul ) not met; consider adjusting CPPFLAGS="$CPPFLAGS $MOZ_NSS_CFLAGS" LDFLAGS="$LDFLAGS $MOZ_NSS_LIBS" -echo "$as_me:$LINENO: checking for PK11_GetCertFromPrivateKey in -lnss3" >&5 -echo $ECHO_N "checking for PK11_GetCertFromPrivateKey in -lnss3... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for PK11_GetCertFromPrivateKey in -lnss3" >&5 +$as_echo_n "checking for PK11_GetCertFromPrivateKey in -lnss3... " >&6; } if test "${ac_cv_lib_nss3_PK11_GetCertFromPrivateKey+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnss3 $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char PK11_GetCertFromPrivateKey (); int main () { -PK11_GetCertFromPrivateKey (); +return PK11_GetCertFromPrivateKey (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_nss3_PK11_GetCertFromPrivateKey=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_nss3_PK11_GetCertFromPrivateKey=no + ac_cv_lib_nss3_PK11_GetCertFromPrivateKey=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_nss3_PK11_GetCertFromPrivateKey" >&5 -echo "${ECHO_T}$ac_cv_lib_nss3_PK11_GetCertFromPrivateKey" >&6 -if test $ac_cv_lib_nss3_PK11_GetCertFromPrivateKey = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_nss3_PK11_GetCertFromPrivateKey" >&5 +$as_echo "$ac_cv_lib_nss3_PK11_GetCertFromPrivateKey" >&6; } +if test "x$ac_cv_lib_nss3_PK11_GetCertFromPrivateKey" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBNSS3 1 _ACEOF @@ -16136,10 +18131,10 @@ _ACEOF LIBS="-lnss3 $LIBS" else - { { echo "$as_me:$LINENO: error: PK11_GetCertFromPrivateKey missing but needed. + { { $as_echo "$as_me:$LINENO: error: PK11_GetCertFromPrivateKey missing but needed. See https://bugzilla.mozilla.org/show_bug.cgi?id=262274. Fixed since nss 3.9.3 (contained by e.g. mozilla >= 1.7.5)" >&5 -echo "$as_me: error: PK11_GetCertFromPrivateKey missing but needed. +$as_echo "$as_me: error: PK11_GetCertFromPrivateKey missing but needed. See https://bugzilla.mozilla.org/show_bug.cgi?id=262274. Fixed since nss 3.9.3 (contained by e.g. mozilla >= 1.7.5)" >&2;} { (exit 1); exit 1; }; } @@ -16151,17 +18146,17 @@ fi MOZ_LIB_XPCOM=$MOZILLAXPCOM_LIBS if test "$WITH_LDAP" != "NO" && test "$WITH_OPENLDAP" != "YES"; then - echo "$as_me:$LINENO: checking whether $tmp was compiled with --enable-ldap" >&5 -echo $ECHO_N "checking whether $tmp was compiled with --enable-ldap... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking whether $tmp was compiled with --enable-ldap" >&5 +$as_echo_n "checking whether $tmp was compiled with --enable-ldap... " >&6; } if test -d "$MOZ_INC/ldap"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } MOZ_LDAP_CFLAGS="-I$MOZ_INC" else - { { echo "$as_me:$LINENO: error: no. + { { $as_echo "$as_me:$LINENO: error: no. Could not find LDAP header include files in $MOZ_INC/ldap. Please recompile $tmp with --enable-ldap or use --with-openldap." >&5 -echo "$as_me: error: no. +$as_echo "$as_me: error: no. Could not find LDAP header include files in $MOZ_INC/ldap. Please recompile $tmp with --enable-ldap or use --with-openldap." >&2;} { (exit 1); exit 1; }; } @@ -16175,40 +18170,40 @@ Please recompile $tmp with --enable-ldap or use --with-openldap." >&2;} fi elif test "$enable_mozilla" = "no"; then - echo "$as_me:$LINENO: result: none" >&5 -echo "${ECHO_T}none" >&6 + { $as_echo "$as_me:$LINENO: result: none" >&5 +$as_echo "none" >&6; } WITH_MOZILLA=NO else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:$LINENO: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_MOZILLA=NO BUILD_TYPE="$BUILD_TYPE MOZ" if test -z "$with_mozilla_version"; then MOZILLA_VERSION= else - echo "$as_me:$LINENO: checking which mozilla version to build" >&5 -echo $ECHO_N "checking which mozilla version to build... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking which mozilla version to build" >&5 +$as_echo_n "checking which mozilla version to build... " >&6; } MOZILLA_VERSION=$with_mozilla_version enable_build_mozilla=1 - echo "$as_me:$LINENO: result: $MOZILLA_VERSION" >&5 -echo "${ECHO_T}$MOZILLA_VERSION" >&6 + { $as_echo "$as_me:$LINENO: result: $MOZILLA_VERSION" >&5 +$as_echo "$MOZILLA_VERSION" >&6; } fi -echo "$as_me:$LINENO: checking for toolkit mozilla should use" >&5 -echo $ECHO_N "checking for toolkit mozilla should use... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for toolkit mozilla should use" >&5 +$as_echo_n "checking for toolkit mozilla should use... " >&6; } if test -z "$with_mozilla_toolkit"; then if test "$_os" != "WINNT"; then MOZILLA_TOOLKIT=gtk2 - echo "$as_me:$LINENO: result: gtk2" >&5 -echo "${ECHO_T}gtk2" >&6 + { $as_echo "$as_me:$LINENO: result: gtk2" >&5 +$as_echo "gtk2" >&6; } fi else MOZILLA_TOOLKIT=$with_mozilla_toolkit enable_build_mozilla=1 - echo "$as_me:$LINENO: result: $MOZILLA_TOOLKIT" >&5 -echo "${ECHO_T}$MOZILLA_TOOLKIT" >&6 + { $as_echo "$as_me:$LINENO: result: $MOZILLA_TOOLKIT" >&5 +$as_echo "$MOZILLA_TOOLKIT" >&6; } fi #if test "$_os" = "Darwin" && test "$MOZILLA_TOOLKIT" != "gtk2"; then # #only gtk2 toolkit supported - xlib or cocoa nees glib1 and libIDL1 - the latter is not @@ -16225,16 +18220,16 @@ else enable_build_mozilla= fi -echo "$as_me:$LINENO: checking whether to build Mozilla" >&5 -echo $ECHO_N "checking whether to build Mozilla... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to build Mozilla" >&5 +$as_echo_n "checking whether to build Mozilla... " >&6; } if test -n "$enable_build_mozilla"; then BUILD_MOZAB="TRUE" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else BUILD_MOZAB="" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test "$BUILD_MOZAB" = "TRUE"; then @@ -16247,42 +18242,42 @@ if test "$BUILD_MOZAB" = "TRUE"; then MOZILLA_SOURCE_VERSION="mozilla-source-${MOZILLA_VERSION}" fi for e in gz bz2; do - echo "$as_me:$LINENO: checking for $MOZILLA_SOURCE_VERSION.tar.$e" >&5 -echo $ECHO_N "checking for $MOZILLA_SOURCE_VERSION.tar.$e... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for $MOZILLA_SOURCE_VERSION.tar.$e" >&5 +$as_echo_n "checking for $MOZILLA_SOURCE_VERSION.tar.$e... " >&6; } if test ! -e "./moz/download/$MOZILLA_SOURCE_VERSION.tar.$e" && test "$HAVE_MOZILLA_TARBALL" != "y"; then - echo "$as_me:$LINENO: result: not found" >&5 -echo "${ECHO_T}not found" >&6 + { $as_echo "$as_me:$LINENO: result: not found" >&5 +$as_echo "not found" >&6; } HAVE_MOZILLA_TARBALL=n else - echo "$as_me:$LINENO: result: found" >&5 -echo "${ECHO_T}found" >&6 + { $as_echo "$as_me:$LINENO: result: found" >&5 +$as_echo "found" >&6; } HAVE_MOZILLA_TARBALL=y fi done if test "$HAVE_MOZILLA_TARBALL" != "y"; then - { { echo "$as_me:$LINENO: error: Mozilla source archive not found. + { { $as_echo "$as_me:$LINENO: error: Mozilla source archive not found. Please copy $MOZILLA_SOURCE_VERSION.tar.bz2 or $MOZILLA_SOURCE_VERSION.tar.gz to moz/download/. The archives can be found here: http://ftp.mozilla.org/pub/mozilla.org/mozilla/releases/mozilla$MOZILLA_VERSION/source/" >&5 -echo "$as_me: error: Mozilla source archive not found. +$as_echo "$as_me: error: Mozilla source archive not found. Please copy $MOZILLA_SOURCE_VERSION.tar.bz2 or $MOZILLA_SOURCE_VERSION.tar.gz to moz/download/. The archives can be found here: http://ftp.mozilla.org/pub/mozilla.org/mozilla/releases/mozilla$MOZILLA_VERSION/source/" >&2;} { (exit 1); exit 1; }; } fi if test "$_os" = "WINNT"; then - echo "$as_me:$LINENO: checking for glib and libIDL binaries" >&5 -echo $ECHO_N "checking for glib and libIDL binaries... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for glib and libIDL binaries" >&5 +$as_echo_n "checking for glib and libIDL binaries... " >&6; } if test ! -e "./moz/download/vc71-glib-1.2.10-bin.zip" \ -o ! -e "./moz/download/vc71-libIDL-0.6.8-bin.zip" \ -o ! -e "./moz/download/wintools.zip" ; then -{ { echo "$as_me:$LINENO: error: One or more of the following archives is missing in moz/download/ +{ { $as_echo "$as_me:$LINENO: error: One or more of the following archives is missing in moz/download/ vc71-glib-1.2.10-bin.zip vc71-libIDL-0.6.8-bin.zip (from ftp://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/historic/vc71/) wintools.zip (from http://ftp.mozilla.org/pub/mozilla.org/mozilla/source/wintools.zip)" >&5 -echo "$as_me: error: One or more of the following archives is missing in moz/download/ +$as_echo "$as_me: error: One or more of the following archives is missing in moz/download/ vc71-glib-1.2.10-bin.zip vc71-libIDL-0.6.8-bin.zip (from ftp://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/historic/vc71/) @@ -16290,23 +18285,23 @@ echo "$as_me: error: One or more of the following archives is missing in moz/dow (from http://ftp.mozilla.org/pub/mozilla.org/mozilla/source/wintools.zip)" >&2;} { (exit 1); exit 1; }; } else - echo "$as_me:$LINENO: result: ok" >&5 -echo "${ECHO_T}ok" >&6 + { $as_echo "$as_me:$LINENO: result: ok" >&5 +$as_echo "ok" >&6; } fi elif test "$_os" = "Darwin"; then if test "$MOZILLA_TOOLKIT" = "gtk2"; then - { echo "$as_me:$LINENO: checking whether mozilla can be built..." >&5 -echo "$as_me: checking whether mozilla can be built..." >&6;} + { $as_echo "$as_me:$LINENO: checking whether mozilla can be built..." >&5 +$as_echo "$as_me: checking whether mozilla can be built..." >&6;} succeeded=no if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -16319,28 +18314,29 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -16351,25 +18347,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for gtk+-2.0 >= 2.4 libIDL-2.0 >= 0.8" >&5 -echo $ECHO_N "checking for gtk+-2.0 >= 2.4 libIDL-2.0 >= 0.8... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for gtk+-2.0 >= 2.4 libIDL-2.0 >= 0.8" >&5 +$as_echo_n "checking for gtk+-2.0 >= 2.4 libIDL-2.0 >= 0.8... " >&6; } if $PKG_CONFIG --exists "gtk+-2.0 >= 2.4 libIDL-2.0 >= 0.8" ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking MOZGTK2_CFLAGS" >&5 -echo $ECHO_N "checking MOZGTK2_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking MOZGTK2_CFLAGS" >&5 +$as_echo_n "checking MOZGTK2_CFLAGS... " >&6; } MOZGTK2_CFLAGS=`$PKG_CONFIG --cflags "gtk+-2.0 >= 2.4 libIDL-2.0 >= 0.8"` - echo "$as_me:$LINENO: result: $MOZGTK2_CFLAGS" >&5 -echo "${ECHO_T}$MOZGTK2_CFLAGS" >&6 + { $as_echo "$as_me:$LINENO: result: $MOZGTK2_CFLAGS" >&5 +$as_echo "$MOZGTK2_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking MOZGTK2_LIBS" >&5 -echo $ECHO_N "checking MOZGTK2_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking MOZGTK2_LIBS" >&5 +$as_echo_n "checking MOZGTK2_LIBS... " >&6; } MOZGTK2_LIBS=`$PKG_CONFIG --libs "gtk+-2.0 >= 2.4 libIDL-2.0 >= 0.8"` - echo "$as_me:$LINENO: result: $MOZGTK2_LIBS" >&5 -echo "${ECHO_T}$MOZGTK2_LIBS" >&6 + { $as_echo "$as_me:$LINENO: result: $MOZGTK2_LIBS" >&5 +$as_echo "$MOZGTK2_LIBS" >&6; } else MOZGTK2_CFLAGS="" MOZGTK2_LIBS="" @@ -16388,11 +18384,11 @@ echo "${ECHO_T}$MOZGTK2_LIBS" >&6 fi if test $succeeded = yes; then - { echo "$as_me:$LINENO: OK - can build mozilla" >&5 -echo "$as_me: OK - can build mozilla" >&6;} + { $as_echo "$as_me:$LINENO: OK - can build mozilla" >&5 +$as_echo "$as_me: OK - can build mozilla" >&6;} else - { { echo "$as_me:$LINENO: error: Prerequisites to build mozilla not met. Either use the precompiled mozilla binaries or install the missing packages" >&5 -echo "$as_me: error: Prerequisites to build mozilla not met. Either use the precompiled mozilla binaries or install the missing packages" >&2;} + { { $as_echo "$as_me:$LINENO: error: Prerequisites to build mozilla not met. Either use the precompiled mozilla binaries or install the missing packages" >&5 +$as_echo "$as_me: error: Prerequisites to build mozilla not met. Either use the precompiled mozilla binaries or install the missing packages" >&2;} { (exit 1); exit 1; }; } fi @@ -16403,10 +18399,10 @@ echo "$as_me: error: Prerequisites to build mozilla not met. Either use the prec if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -16419,28 +18415,29 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -16451,25 +18448,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for libIDL >= 0.6.3 libIDL <= 0.6.8" >&5 -echo $ECHO_N "checking for libIDL >= 0.6.3 libIDL <= 0.6.8... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for libIDL >= 0.6.3 libIDL <= 0.6.8" >&5 +$as_echo_n "checking for libIDL >= 0.6.3 libIDL <= 0.6.8... " >&6; } if $PKG_CONFIG --exists "libIDL >= 0.6.3 libIDL <= 0.6.8" ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking MOZLIBREQ_CFLAGS" >&5 -echo $ECHO_N "checking MOZLIBREQ_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking MOZLIBREQ_CFLAGS" >&5 +$as_echo_n "checking MOZLIBREQ_CFLAGS... " >&6; } MOZLIBREQ_CFLAGS=`$PKG_CONFIG --cflags "libIDL >= 0.6.3 libIDL <= 0.6.8"` - echo "$as_me:$LINENO: result: $MOZLIBREQ_CFLAGS" >&5 -echo "${ECHO_T}$MOZLIBREQ_CFLAGS" >&6 + { $as_echo "$as_me:$LINENO: result: $MOZLIBREQ_CFLAGS" >&5 +$as_echo "$MOZLIBREQ_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking MOZLIBREQ_LIBS" >&5 -echo $ECHO_N "checking MOZLIBREQ_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking MOZLIBREQ_LIBS" >&5 +$as_echo_n "checking MOZLIBREQ_LIBS... " >&6; } MOZLIBREQ_LIBS=`$PKG_CONFIG --libs "libIDL >= 0.6.3 libIDL <= 0.6.8"` - echo "$as_me:$LINENO: result: $MOZLIBREQ_LIBS" >&5 -echo "${ECHO_T}$MOZLIBREQ_LIBS" >&6 + { $as_echo "$as_me:$LINENO: result: $MOZLIBREQ_LIBS" >&5 +$as_echo "$MOZLIBREQ_LIBS" >&6; } else MOZLIBREQ_CFLAGS="" MOZLIBREQ_LIBS="" @@ -16494,8 +18491,8 @@ echo "${ECHO_T}$MOZLIBREQ_LIBS" >&6 fi if test -z "$MOZIDL"; then - { { echo "$as_me:$LINENO: error: libIDL 0.6.3 - 0.6.8 is needed when not using GTK2 to build mozilla." >&5 -echo "$as_me: error: libIDL 0.6.3 - 0.6.8 is needed when not using GTK2 to build mozilla." >&2;} + { { $as_echo "$as_me:$LINENO: error: libIDL 0.6.3 - 0.6.8 is needed when not using GTK2 to build mozilla." >&5 +$as_echo "$as_me: error: libIDL 0.6.3 - 0.6.8 is needed when not using GTK2 to build mozilla." >&2;} { (exit 1); exit 1; }; } fi fi @@ -16508,10 +18505,10 @@ echo "$as_me: error: libIDL 0.6.3 - 0.6.8 is needed when not using GTK2 to build if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -16524,28 +18521,29 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -16556,25 +18554,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for gtk+-2.0" >&5 -echo $ECHO_N "checking for gtk+-2.0... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for gtk+-2.0" >&5 +$as_echo_n "checking for gtk+-2.0... " >&6; } if $PKG_CONFIG --exists "gtk+-2.0" ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking MOZLIBREQ_CFLAGS" >&5 -echo $ECHO_N "checking MOZLIBREQ_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking MOZLIBREQ_CFLAGS" >&5 +$as_echo_n "checking MOZLIBREQ_CFLAGS... " >&6; } MOZLIBREQ_CFLAGS=`$PKG_CONFIG --cflags "gtk+-2.0"` - echo "$as_me:$LINENO: result: $MOZLIBREQ_CFLAGS" >&5 -echo "${ECHO_T}$MOZLIBREQ_CFLAGS" >&6 + { $as_echo "$as_me:$LINENO: result: $MOZLIBREQ_CFLAGS" >&5 +$as_echo "$MOZLIBREQ_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking MOZLIBREQ_LIBS" >&5 -echo $ECHO_N "checking MOZLIBREQ_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking MOZLIBREQ_LIBS" >&5 +$as_echo_n "checking MOZLIBREQ_LIBS... " >&6; } MOZLIBREQ_LIBS=`$PKG_CONFIG --libs "gtk+-2.0"` - echo "$as_me:$LINENO: result: $MOZLIBREQ_LIBS" >&5 -echo "${ECHO_T}$MOZLIBREQ_LIBS" >&6 + { $as_echo "$as_me:$LINENO: result: $MOZLIBREQ_LIBS" >&5 +$as_echo "$MOZLIBREQ_LIBS" >&6; } else MOZLIBREQ_CFLAGS="" MOZLIBREQ_LIBS="" @@ -16599,8 +18597,8 @@ echo "${ECHO_T}$MOZLIBREQ_LIBS" >&6 fi if test -z "$MOZGTK"; then - { { echo "$as_me:$LINENO: error: GTK2 is needed to build mozilla." >&5 -echo "$as_me: error: GTK2 is needed to build mozilla." >&2;} + { { $as_echo "$as_me:$LINENO: error: GTK2 is needed to build mozilla." >&5 +$as_echo "$as_me: error: GTK2 is needed to build mozilla." >&2;} { (exit 1); exit 1; }; } fi @@ -16609,10 +18607,10 @@ echo "$as_me: error: GTK2 is needed to build mozilla." >&2;} if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -16625,28 +18623,29 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -16657,25 +18656,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for libIDL-2.0 >= 0.8.0" >&5 -echo $ECHO_N "checking for libIDL-2.0 >= 0.8.0... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for libIDL-2.0 >= 0.8.0" >&5 +$as_echo_n "checking for libIDL-2.0 >= 0.8.0... " >&6; } if $PKG_CONFIG --exists "libIDL-2.0 >= 0.8.0" ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking MOZLIBREQ_CFLAGS" >&5 -echo $ECHO_N "checking MOZLIBREQ_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking MOZLIBREQ_CFLAGS" >&5 +$as_echo_n "checking MOZLIBREQ_CFLAGS... " >&6; } MOZLIBREQ_CFLAGS=`$PKG_CONFIG --cflags "libIDL-2.0 >= 0.8.0"` - echo "$as_me:$LINENO: result: $MOZLIBREQ_CFLAGS" >&5 -echo "${ECHO_T}$MOZLIBREQ_CFLAGS" >&6 + { $as_echo "$as_me:$LINENO: result: $MOZLIBREQ_CFLAGS" >&5 +$as_echo "$MOZLIBREQ_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking MOZLIBREQ_LIBS" >&5 -echo $ECHO_N "checking MOZLIBREQ_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking MOZLIBREQ_LIBS" >&5 +$as_echo_n "checking MOZLIBREQ_LIBS... " >&6; } MOZLIBREQ_LIBS=`$PKG_CONFIG --libs "libIDL-2.0 >= 0.8.0"` - echo "$as_me:$LINENO: result: $MOZLIBREQ_LIBS" >&5 -echo "${ECHO_T}$MOZLIBREQ_LIBS" >&6 + { $as_echo "$as_me:$LINENO: result: $MOZLIBREQ_LIBS" >&5 +$as_echo "$MOZLIBREQ_LIBS" >&6; } else MOZLIBREQ_CFLAGS="" MOZLIBREQ_LIBS="" @@ -16700,8 +18699,8 @@ echo "${ECHO_T}$MOZLIBREQ_LIBS" >&6 fi if test -z "$MOZIDL"; then - { { echo "$as_me:$LINENO: error: libIDL >= 0.8.0 is needed when using GTK2 to build mozilla." >&5 -echo "$as_me: error: libIDL >= 0.8.0 is needed when using GTK2 to build mozilla." >&2;} + { { $as_echo "$as_me:$LINENO: error: libIDL >= 0.8.0 is needed when using GTK2 to build mozilla." >&5 +$as_echo "$as_me: error: libIDL >= 0.8.0 is needed when using GTK2 to build mozilla." >&2;} { (exit 1); exit 1; }; } fi else @@ -16711,10 +18710,10 @@ echo "$as_me: error: libIDL >= 0.8.0 is needed when using GTK2 to build mozilla. if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -16727,28 +18726,29 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -16759,25 +18759,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for gtk+ >= 1.2.3" >&5 -echo $ECHO_N "checking for gtk+ >= 1.2.3... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for gtk+ >= 1.2.3" >&5 +$as_echo_n "checking for gtk+ >= 1.2.3... " >&6; } if $PKG_CONFIG --exists "gtk+ >= 1.2.3" ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking MOZLIBREQ_CFLAGS" >&5 -echo $ECHO_N "checking MOZLIBREQ_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking MOZLIBREQ_CFLAGS" >&5 +$as_echo_n "checking MOZLIBREQ_CFLAGS... " >&6; } MOZLIBREQ_CFLAGS=`$PKG_CONFIG --cflags "gtk+ >= 1.2.3"` - echo "$as_me:$LINENO: result: $MOZLIBREQ_CFLAGS" >&5 -echo "${ECHO_T}$MOZLIBREQ_CFLAGS" >&6 + { $as_echo "$as_me:$LINENO: result: $MOZLIBREQ_CFLAGS" >&5 +$as_echo "$MOZLIBREQ_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking MOZLIBREQ_LIBS" >&5 -echo $ECHO_N "checking MOZLIBREQ_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking MOZLIBREQ_LIBS" >&5 +$as_echo_n "checking MOZLIBREQ_LIBS... " >&6; } MOZLIBREQ_LIBS=`$PKG_CONFIG --libs "gtk+ >= 1.2.3"` - echo "$as_me:$LINENO: result: $MOZLIBREQ_LIBS" >&5 -echo "${ECHO_T}$MOZLIBREQ_LIBS" >&6 + { $as_echo "$as_me:$LINENO: result: $MOZLIBREQ_LIBS" >&5 +$as_echo "$MOZLIBREQ_LIBS" >&6; } else MOZLIBREQ_CFLAGS="" MOZLIBREQ_LIBS="" @@ -16802,8 +18802,8 @@ echo "${ECHO_T}$MOZLIBREQ_LIBS" >&6 fi if test -z "$MOZGTK"; then - { { echo "$as_me:$LINENO: error: gtk 1.2 is needed when not using GTK2 to build mozilla." >&5 -echo "$as_me: error: gtk 1.2 is needed when not using GTK2 to build mozilla." >&2;} + { { $as_echo "$as_me:$LINENO: error: gtk 1.2 is needed when not using GTK2 to build mozilla." >&5 +$as_echo "$as_me: error: gtk 1.2 is needed when not using GTK2 to build mozilla." >&2;} { (exit 1); exit 1; }; } fi @@ -16812,10 +18812,10 @@ echo "$as_me: error: gtk 1.2 is needed when not using GTK2 to build mozilla." >& if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -16828,28 +18828,29 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -16860,25 +18861,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for libidl >= 0.6.3 libidl <= 0.6.8" >&5 -echo $ECHO_N "checking for libidl >= 0.6.3 libidl <= 0.6.8... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for libidl >= 0.6.3 libidl <= 0.6.8" >&5 +$as_echo_n "checking for libidl >= 0.6.3 libidl <= 0.6.8... " >&6; } if $PKG_CONFIG --exists "libidl >= 0.6.3 libidl <= 0.6.8" ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking MOZLIBREQ_CFLAGS" >&5 -echo $ECHO_N "checking MOZLIBREQ_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking MOZLIBREQ_CFLAGS" >&5 +$as_echo_n "checking MOZLIBREQ_CFLAGS... " >&6; } MOZLIBREQ_CFLAGS=`$PKG_CONFIG --cflags "libidl >= 0.6.3 libidl <= 0.6.8"` - echo "$as_me:$LINENO: result: $MOZLIBREQ_CFLAGS" >&5 -echo "${ECHO_T}$MOZLIBREQ_CFLAGS" >&6 + { $as_echo "$as_me:$LINENO: result: $MOZLIBREQ_CFLAGS" >&5 +$as_echo "$MOZLIBREQ_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking MOZLIBREQ_LIBS" >&5 -echo $ECHO_N "checking MOZLIBREQ_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking MOZLIBREQ_LIBS" >&5 +$as_echo_n "checking MOZLIBREQ_LIBS... " >&6; } MOZLIBREQ_LIBS=`$PKG_CONFIG --libs "libidl >= 0.6.3 libidl <= 0.6.8"` - echo "$as_me:$LINENO: result: $MOZLIBREQ_LIBS" >&5 -echo "${ECHO_T}$MOZLIBREQ_LIBS" >&6 + { $as_echo "$as_me:$LINENO: result: $MOZLIBREQ_LIBS" >&5 +$as_echo "$MOZLIBREQ_LIBS" >&6; } else MOZLIBREQ_CFLAGS="" MOZLIBREQ_LIBS="" @@ -16903,8 +18904,8 @@ echo "${ECHO_T}$MOZLIBREQ_LIBS" >&6 fi if test -z "$MOZIDL"; then - { { echo "$as_me:$LINENO: error: libIDL 0.6.3 - 0.6.8 is needed when not using GTK2 to build mozilla." >&5 -echo "$as_me: error: libIDL 0.6.3 - 0.6.8 is needed when not using GTK2 to build mozilla." >&2;} + { { $as_echo "$as_me:$LINENO: error: libIDL 0.6.3 - 0.6.8 is needed when not using GTK2 to build mozilla." >&5 +$as_echo "$as_me: error: libIDL 0.6.3 - 0.6.8 is needed when not using GTK2 to build mozilla." >&2;} { (exit 1); exit 1; }; } fi fi @@ -16923,27 +18924,26 @@ fi -echo "$as_me:$LINENO: checking which sane header to use" >&5 -echo $ECHO_N "checking which sane header to use... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking which sane header to use" >&5 +$as_echo_n "checking which sane header to use... " >&6; } if test -n "$with_system_sane_header" -o -n "$with_system_headers" && \ test "$with_system_sane_header" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:$LINENO: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_SANE_HEADER=YES if test "${ac_cv_header_sane_sane_h+set}" = set; then - echo "$as_me:$LINENO: checking for sane/sane.h" >&5 -echo $ECHO_N "checking for sane/sane.h... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for sane/sane.h" >&5 +$as_echo_n "checking for sane/sane.h... " >&6; } if test "${ac_cv_header_sane_sane_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_sane_sane_h" >&5 -echo "${ECHO_T}$ac_cv_header_sane_sane_h" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sane_sane_h" >&5 +$as_echo "$ac_cv_header_sane_sane_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking sane/sane.h usability" >&5 -echo $ECHO_N "checking sane/sane.h usability... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking sane/sane.h usability" >&5 +$as_echo_n "checking sane/sane.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -16953,33 +18953,39 @@ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking sane/sane.h presence" >&5 -echo $ECHO_N "checking sane/sane.h presence... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking sane/sane.h presence" >&5 +$as_echo_n "checking sane/sane.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -16987,112 +18993,104 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: sane/sane.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: sane/sane.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: sane/sane.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: sane/sane.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: sane/sane.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: sane/sane.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sane/sane.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: sane/sane.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: sane/sane.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: sane/sane.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: sane/sane.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: sane/sane.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: sane/sane.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: sane/sane.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: sane/sane.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: sane/sane.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sane/sane.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: sane/sane.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sane/sane.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: sane/sane.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sane/sane.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: sane/sane.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sane/sane.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: sane/sane.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: sane/sane.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: sane/sane.h: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for sane/sane.h" >&5 -echo $ECHO_N "checking for sane/sane.h... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for sane/sane.h" >&5 +$as_echo_n "checking for sane/sane.h... " >&6; } if test "${ac_cv_header_sane_sane_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_sane_sane_h=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_sane_sane_h" >&5 -echo "${ECHO_T}$ac_cv_header_sane_sane_h" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_sane_sane_h" >&5 +$as_echo "$ac_cv_header_sane_sane_h" >&6; } fi -if test $ac_cv_header_sane_sane_h = yes; then +if test "x$ac_cv_header_sane_sane_h" = x""yes; then : else - { { echo "$as_me:$LINENO: error: sane not found. install sane" >&5 -echo "$as_me: error: sane not found. install sane" >&2;} + { { $as_echo "$as_me:$LINENO: error: sane not found. install sane" >&5 +$as_echo "$as_me: error: sane not found. install sane" >&2;} { (exit 1); exit 1; }; } fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:$LINENO: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_SANE_HEADER=NO BUILD_TYPE="$BUILD_TYPE SANE" fi -echo "$as_me:$LINENO: checking which icu to use" >&5 -echo $ECHO_N "checking which icu to use... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking which icu to use" >&5 +$as_echo_n "checking which icu to use... " >&6; } if test -n "$with_system_icu" -o -n "$with_system_libs" && \ test "$with_system_icu" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:$LINENO: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_ICU=YES - ac_ext=cc + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - echo "$as_me:$LINENO: checking for unicode/rbbi.h" >&5 -echo $ECHO_N "checking for unicode/rbbi.h... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for unicode/rbbi.h" >&5 +$as_echo_n "checking for unicode/rbbi.h... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -17100,40 +19098,41 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ unicode/rbbi.h _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - echo "$as_me:$LINENO: result: checked." >&5 -echo "${ECHO_T}checked." >&6 -else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then + { $as_echo "$as_me:$LINENO: result: checked." >&5 +$as_echo "checked." >&6; } +else + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - { { echo "$as_me:$LINENO: error: icu headers not found." >&5 -echo "$as_me: error: icu headers not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: icu headers not found." >&5 +$as_echo "$as_me: error: icu headers not found." >&2;} { (exit 1); exit 1; }; } fi + rm -f conftest.err conftest.$ac_ext # Extract the first word of "genbrk", so it can be a program name with args. set dummy genbrk; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_SYSTEM_GENBRK+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $SYSTEM_GENBRK in [\\/]* | ?:[\\/]*) @@ -17147,38 +19146,39 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_SYSTEM_GENBRK="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi SYSTEM_GENBRK=$ac_cv_path_SYSTEM_GENBRK - if test -n "$SYSTEM_GENBRK"; then - echo "$as_me:$LINENO: result: $SYSTEM_GENBRK" >&5 -echo "${ECHO_T}$SYSTEM_GENBRK" >&6 + { $as_echo "$as_me:$LINENO: result: $SYSTEM_GENBRK" >&5 +$as_echo "$SYSTEM_GENBRK" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + if test -z "$SYSTEM_GENBRK"; then - { { echo "$as_me:$LINENO: error: \\"genbrk\\" not found in \$PATH, install the icu development tool \\"genbrk\"\" >&5 -echo "$as_me: error: \\"genbrk\\" not found in \$PATH, install the icu development tool \\"genbrk\"\" >&2;} + { { $as_echo "$as_me:$LINENO: error: \\"genbrk\\" not found in \$PATH, install the icu development tool \\"genbrk\"\" >&5 +$as_echo "$as_me: error: \\"genbrk\\" not found in \$PATH, install the icu development tool \\"genbrk\"\" >&2;} { (exit 1); exit 1; }; } fi # Extract the first word of "genccode", so it can be a program name with args. set dummy genccode; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_SYSTEM_GENCCODE+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $SYSTEM_GENCCODE in [\\/]* | ?:[\\/]*) @@ -17192,38 +19192,39 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_SYSTEM_GENCCODE="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi SYSTEM_GENCCODE=$ac_cv_path_SYSTEM_GENCCODE - if test -n "$SYSTEM_GENCCODE"; then - echo "$as_me:$LINENO: result: $SYSTEM_GENCCODE" >&5 -echo "${ECHO_T}$SYSTEM_GENCCODE" >&6 + { $as_echo "$as_me:$LINENO: result: $SYSTEM_GENCCODE" >&5 +$as_echo "$SYSTEM_GENCCODE" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + if test -z "$SYSTEM_GENCCODE"; then - { { echo "$as_me:$LINENO: error: \\"genccode\\" not found in \$PATH, install the icu development tool \\"genccode\"\" >&5 -echo "$as_me: error: \\"genccode\\" not found in \$PATH, install the icu development tool \\"genccode\"\" >&2;} + { { $as_echo "$as_me:$LINENO: error: \\"genccode\\" not found in \$PATH, install the icu development tool \\"genccode\"\" >&5 +$as_echo "$as_me: error: \\"genccode\\" not found in \$PATH, install the icu development tool \\"genccode\"\" >&2;} { (exit 1); exit 1; }; } fi # Extract the first word of "gencmn", so it can be a program name with args. set dummy gencmn; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_SYSTEM_GENCMN+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $SYSTEM_GENCMN in [\\/]* | ?:[\\/]*) @@ -17237,43 +19238,45 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_SYSTEM_GENCMN="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi SYSTEM_GENCMN=$ac_cv_path_SYSTEM_GENCMN - if test -n "$SYSTEM_GENCMN"; then - echo "$as_me:$LINENO: result: $SYSTEM_GENCMN" >&5 -echo "${ECHO_T}$SYSTEM_GENCMN" >&6 + { $as_echo "$as_me:$LINENO: result: $SYSTEM_GENCMN" >&5 +$as_echo "$SYSTEM_GENCMN" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + if test -z "$SYSTEM_GENCMN"; then - { { echo "$as_me:$LINENO: error: \\"gencmn\\" not found in \$PATH, install the icu development tool \\"gencmn\"\" >&5 -echo "$as_me: error: \\"gencmn\\" not found in \$PATH, install the icu development tool \\"gencmn\"\" >&2;} + { { $as_echo "$as_me:$LINENO: error: \\"gencmn\\" not found in \$PATH, install the icu development tool \\"gencmn\"\" >&5 +$as_echo "$as_me: error: \\"gencmn\\" not found in \$PATH, install the icu development tool \\"gencmn\"\" >&2;} { (exit 1); exit 1; }; } fi - echo "$as_me:$LINENO: checking ICU version" >&5 -echo $ECHO_N "checking ICU version... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking ICU version" >&5 +$as_echo_n "checking ICU version... " >&6; } if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling +$as_echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -17291,30 +19294,44 @@ int main(int argc, char **argv) { _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - echo "$as_me:$LINENO: result: OK" >&5 -echo "${ECHO_T}OK" >&6 + { $as_echo "$as_me:$LINENO: result: OK" >&5 +$as_echo "OK" >&6; } else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: not suitable, only >= 4.0 supported currently" >&5 -echo "$as_me: error: not suitable, only >= 4.0 supported currently" >&2;} +{ { $as_echo "$as_me:$LINENO: error: not suitable, only >= 4.0 supported currently" >&5 +$as_echo "$as_me: error: not suitable, only >= 4.0 supported currently" >&2;} { (exit 1); exit 1; }; } fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -rf conftest.dSYM +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -17322,8 +19339,8 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:$LINENO: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_ICU=NO BUILD_TYPE="$BUILD_TYPE ICU" fi @@ -17335,15 +19352,15 @@ fi if test "$_os" = "Darwin"; then if test "x$with_x" = "xyes"; then - { { echo "$as_me:$LINENO: error: X11 build is no longer supported on MacOSX, please use the native aqua build" >&5 -echo "$as_me: error: X11 build is no longer supported on MacOSX, please use the native aqua build" >&2;} + { { $as_echo "$as_me:$LINENO: error: X11 build is no longer supported on MacOSX, please use the native aqua build" >&5 +$as_echo "$as_me: error: X11 build is no longer supported on MacOSX, please use the native aqua build" >&2;} { (exit 1); exit 1; }; } else - echo "$as_me:$LINENO: checking for /System/Library/Frameworks/AppKit.framework" >&5 -echo $ECHO_N "checking for /System/Library/Frameworks/AppKit.framework... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for /System/Library/Frameworks/AppKit.framework" >&5 +$as_echo_n "checking for /System/Library/Frameworks/AppKit.framework... " >&6; } if test -d "/System/Library/Frameworks/AppKit.framework/"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } x_includes="no_x_includes" x_libraries="no_x_libraries" enable_gtk=no @@ -17351,8 +19368,8 @@ echo "${ECHO_T}yes" >&6 ENABLE_CUPS="" else - { { echo "$as_me:$LINENO: error: No AppKit.framewrok found" >&5 -echo "$as_me: error: No AppKit.framewrok found" >&2;} + { { $as_echo "$as_me:$LINENO: error: No AppKit.framewrok found" >&5 +$as_echo "$as_me: error: No AppKit.framewrok found" >&2;} { (exit 1); exit 1; }; } fi fi @@ -17365,61 +19382,66 @@ elif test "$_os" = "OS2" ; then echo "Do Nothing for _os = OS2. Don't check for X11." : elif test "$_os" != "WINNT" ; then - echo "$as_me:$LINENO: checking for X" >&5 -echo $ECHO_N "checking for X... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for X" >&5 +$as_echo_n "checking for X... " >&6; } -# Check whether --with-x or --without-x was given. +# Check whether --with-x was given. if test "${with_x+set}" = set; then - withval="$with_x" + withval=$with_x; +fi -fi; # $have_x is `yes', `no', `disabled', or empty when we do not yet know. if test "x$with_x" = xno; then # The user explicitly disabled X. have_x=disabled else - if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then - # Both variables are already set. - have_x=yes - else - if test "${ac_cv_have_x+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + case $x_includes,$x_libraries in #( + *\'*) { { $as_echo "$as_me:$LINENO: error: cannot use X directory names containing '" >&5 +$as_echo "$as_me: error: cannot use X directory names containing '" >&2;} + { (exit 1); exit 1; }; };; #( + *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then + $as_echo_n "(cached) " >&6 else # One or both of the vars are not set, and there is no cached value. ac_x_includes=no ac_x_libraries=no -rm -fr conftest.dir +rm -f -r conftest.dir if mkdir conftest.dir; then cd conftest.dir - # Make sure to not put "make" in the Imakefile rules, since we grep it out. cat >Imakefile <<'_ACEOF' -acfindx: - @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"' -_ACEOF - if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then +incroot: + @echo incroot='${INCROOT}' +usrlibdir: + @echo usrlibdir='${USRLIBDIR}' +libdir: + @echo libdir='${LIBDIR}' +_ACEOF + if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then # GNU make sometimes prints "make[1]: Entering...", which would confuse us. - eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` + for ac_var in incroot usrlibdir libdir; do + eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" + done # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. - for ac_extension in a so sl; do - if test ! -f $ac_im_usrlibdir/libX11.$ac_extension && - test -f $ac_im_libdir/libX11.$ac_extension; then - ac_im_usrlibdir=$ac_im_libdir; break + for ac_extension in a so sl dylib la dll; do + if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && + test -f "$ac_im_libdir/libX11.$ac_extension"; then + ac_im_usrlibdir=$ac_im_libdir; break fi done # Screen out bogus values from the imake configuration. They are # bogus both because they are the default anyway, and because # using them would break gcc on systems where it needs fixed includes. case $ac_im_incroot in - /usr/include) ;; + /usr/include) ac_x_includes= ;; *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; esac case $ac_im_usrlibdir in - /usr/lib | /lib) ;; + /usr/lib | /usr/lib64 | /lib | /lib64) ;; *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; esac fi cd .. - rm -fr conftest.dir + rm -f -r conftest.dir fi # Standard set of common directories for X headers. @@ -17460,47 +19482,47 @@ ac_x_header_dirs=' /usr/openwin/share/include' if test "$ac_x_includes" = no; then - # Guess where to find include files, by looking for Intrinsic.h. + # Guess where to find include files, by looking for Xlib.h. # First, try using that file with no special directory specified. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then # We can compile using X headers with no special include directory. ac_x_includes= else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 for ac_dir in $ac_x_header_dirs; do - if test -r "$ac_dir/X11/Intrinsic.h"; then + if test -r "$ac_dir/X11/Xlib.h"; then ac_x_includes=$ac_dir break fi done fi + rm -f conftest.err conftest.$ac_ext fi # $ac_x_includes = no @@ -17509,84 +19531,99 @@ if test "$ac_x_libraries" = no; then # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS - LIBS="-lXt $LIBS" + LIBS="-lX11 $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include int main () { -XtMalloc (0) +XrmInitialize () ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -LIBS=$ac_save_LIBS -for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` + LIBS=$ac_save_LIBS +for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! - for ac_extension in a so sl; do - if test -r $ac_dir/libXt.$ac_extension; then + for ac_extension in a so sl dylib la dll; do + if test -r "$ac_dir/libX11.$ac_extension"; then ac_x_libraries=$ac_dir break 2 fi done done fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi # $ac_x_libraries = no -if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then - # Didn't find X anywhere. Cache the known absence of X. - ac_cv_have_x="have_x=no" -else - # Record where we found X for the cache. - ac_cv_have_x="have_x=yes \ - ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" -fi +case $ac_x_includes,$ac_x_libraries in #( + no,* | *,no | *\'*) + # Didn't find X, or a directory has "'" in its name. + ac_cv_have_x="have_x=no";; #( + *) + # Record where we found X for the cache. + ac_cv_have_x="have_x=yes\ + ac_x_includes='$ac_x_includes'\ + ac_x_libraries='$ac_x_libraries'" +esac fi - - fi +;; #( + *) have_x=yes;; + esac eval "$ac_cv_have_x" fi # $with_x != no if test "$have_x" != yes; then - echo "$as_me:$LINENO: result: $have_x" >&5 -echo "${ECHO_T}$have_x" >&6 + { $as_echo "$as_me:$LINENO: result: $have_x" >&5 +$as_echo "$have_x" >&6; } no_x=yes else # If each of the values was on the command line, it overrides each guess. test "x$x_includes" = xNONE && x_includes=$ac_x_includes test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries # Update the cache value to reflect the command line values. - ac_cv_have_x="have_x=yes \ - ac_x_includes=$x_includes ac_x_libraries=$x_libraries" - echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5 -echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6 + ac_cv_have_x="have_x=yes\ + ac_x_includes='$x_includes'\ + ac_x_libraries='$x_libraries'" + { $as_echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5 +$as_echo "libraries $x_libraries, headers $x_includes" >&6; } fi if test "$no_x" = yes; then @@ -17607,13 +19644,12 @@ else X_LIBS="$X_LIBS -L$x_libraries" # For Solaris; some versions of Sun CC require a space after -R and # others require no space. Words are not sufficient . . . . - case `(uname -sr) 2>/dev/null` in - "SunOS 5"*) - echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5 -echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6 - ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" + { $as_echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5 +$as_echo_n "checking whether -R must be followed by a space... " >&6; } + ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" + ac_xsave_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -17629,33 +19665,35 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_R_nospace=yes -else - echo "$as_me: failed program was:" >&5 + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + X_LIBS="$X_LIBS -R$x_libraries" +else + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_R_nospace=no -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - if test $ac_R_nospace = yes; then - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - X_LIBS="$X_LIBS -R$x_libraries" - else LIBS="$ac_xsave_LIBS -R $x_libraries" - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -17671,36 +19709,47 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_R_space=yes + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + X_LIBS="$X_LIBS -R $x_libraries" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_R_space=no + { $as_echo "$as_me:$LINENO: result: neither works" >&5 +$as_echo "neither works" >&6; } fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - if test $ac_R_space = yes; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - X_LIBS="$X_LIBS -R $x_libraries" - else - echo "$as_me:$LINENO: result: neither works" >&5 -echo "${ECHO_T}neither works" >&6 - fi - fi - LIBS=$ac_xsave_LIBS - esac + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + ac_c_werror_flag=$ac_xsave_c_werror_flag + LIBS=$ac_xsave_LIBS fi # Check for system-dependent libraries X programs must link with. @@ -17715,165 +19764,198 @@ echo "${ECHO_T}neither works" >&6 # the Alpha needs dnet_stub (dnet does not exist). ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char XOpenDisplay (); int main () { -XOpenDisplay (); +return XOpenDisplay (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5 -echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5 +$as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; } if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char dnet_ntoa (); int main () { -dnet_ntoa (); +return dnet_ntoa (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_dnet_dnet_ntoa=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_dnet_dnet_ntoa=no + ac_cv_lib_dnet_dnet_ntoa=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 -echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6 -if test $ac_cv_lib_dnet_dnet_ntoa = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 +$as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; } +if test "x$ac_cv_lib_dnet_dnet_ntoa" = x""yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then - echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet_stub" >&5 -echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet_stub" >&5 +$as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; } if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet_stub $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char dnet_ntoa (); int main () { -dnet_ntoa (); +return dnet_ntoa (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_dnet_stub_dnet_ntoa=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_dnet_stub_dnet_ntoa=no + ac_cv_lib_dnet_stub_dnet_ntoa=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 -echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6 -if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 +$as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } +if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = x""yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" fi fi fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS="$ac_xsave_LIBS" # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, @@ -17884,194 +19966,229 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext # on Irix 5.2, according to T.E. Dickey. # The functions gethostbyname, getservbyname, and inet_addr are # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. - echo "$as_me:$LINENO: checking for gethostbyname" >&5 -echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for gethostbyname" >&5 +$as_echo_n "checking for gethostbyname... " >&6; } if test "${ac_cv_func_gethostbyname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +/* Define gethostbyname to an innocuous variant, in case declares gethostbyname. + For example, HP-UX 11i declares gettimeofday. */ +#define gethostbyname innocuous_gethostbyname + /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gethostbyname (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ + #ifdef __STDC__ # include #else # include #endif -/* Override any gcc2 internal prototype to avoid an error. */ + +#undef gethostbyname + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char gethostbyname (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname) +#if defined __stub_gethostbyname || defined __stub___gethostbyname choke me -#else -char (*f) () = gethostbyname; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != gethostbyname; +return gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_func_gethostbyname=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_gethostbyname=no + ac_cv_func_gethostbyname=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 -echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 +$as_echo "$ac_cv_func_gethostbyname" >&6; } if test $ac_cv_func_gethostbyname = no; then - echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 -echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 +$as_echo_n "checking for gethostbyname in -lnsl... " >&6; } if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char gethostbyname (); int main () { -gethostbyname (); +return gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_nsl_gethostbyname=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_nsl_gethostbyname=no + ac_cv_lib_nsl_gethostbyname=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 -echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6 -if test $ac_cv_lib_nsl_gethostbyname = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 +$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } +if test "x$ac_cv_lib_nsl_gethostbyname" = x""yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" fi if test $ac_cv_lib_nsl_gethostbyname = no; then - echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5 -echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5 +$as_echo_n "checking for gethostbyname in -lbsd... " >&6; } if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char gethostbyname (); int main () { -gethostbyname (); +return gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_bsd_gethostbyname=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_bsd_gethostbyname=no + ac_cv_lib_bsd_gethostbyname=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5 -echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6 -if test $ac_cv_lib_bsd_gethostbyname = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5 +$as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; } +if test "x$ac_cv_lib_bsd_gethostbyname" = x""yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" fi @@ -18085,405 +20202,477 @@ fi # variants that don't use the name server (or something). -lsocket # must be given before -lnsl if both are needed. We assume that # if connect needs -lnsl, so does gethostbyname. - echo "$as_me:$LINENO: checking for connect" >&5 -echo $ECHO_N "checking for connect... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for connect" >&5 +$as_echo_n "checking for connect... " >&6; } if test "${ac_cv_func_connect+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +/* Define connect to an innocuous variant, in case declares connect. + For example, HP-UX 11i declares gettimeofday. */ +#define connect innocuous_connect + /* System header to define __stub macros and hopefully few prototypes, which can conflict with char connect (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ + #ifdef __STDC__ # include #else # include #endif -/* Override any gcc2 internal prototype to avoid an error. */ + +#undef connect + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char connect (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_connect) || defined (__stub___connect) +#if defined __stub_connect || defined __stub___connect choke me -#else -char (*f) () = connect; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != connect; +return connect (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_func_connect=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_connect=no + ac_cv_func_connect=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 -echo "${ECHO_T}$ac_cv_func_connect" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 +$as_echo "$ac_cv_func_connect" >&6; } if test $ac_cv_func_connect = no; then - echo "$as_me:$LINENO: checking for connect in -lsocket" >&5 -echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for connect in -lsocket" >&5 +$as_echo_n "checking for connect in -lsocket... " >&6; } if test "${ac_cv_lib_socket_connect+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char connect (); int main () { -connect (); +return connect (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_socket_connect=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_socket_connect=no + ac_cv_lib_socket_connect=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5 -echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6 -if test $ac_cv_lib_socket_connect = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5 +$as_echo "$ac_cv_lib_socket_connect" >&6; } +if test "x$ac_cv_lib_socket_connect" = x""yes; then X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" fi fi # Guillermo Gomez says -lposix is necessary on A/UX. - echo "$as_me:$LINENO: checking for remove" >&5 -echo $ECHO_N "checking for remove... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for remove" >&5 +$as_echo_n "checking for remove... " >&6; } if test "${ac_cv_func_remove+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +/* Define remove to an innocuous variant, in case declares remove. + For example, HP-UX 11i declares gettimeofday. */ +#define remove innocuous_remove + /* System header to define __stub macros and hopefully few prototypes, which can conflict with char remove (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ + #ifdef __STDC__ # include #else # include #endif -/* Override any gcc2 internal prototype to avoid an error. */ + +#undef remove + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char remove (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_remove) || defined (__stub___remove) +#if defined __stub_remove || defined __stub___remove choke me -#else -char (*f) () = remove; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != remove; +return remove (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_func_remove=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_remove=no + ac_cv_func_remove=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5 -echo "${ECHO_T}$ac_cv_func_remove" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5 +$as_echo "$ac_cv_func_remove" >&6; } if test $ac_cv_func_remove = no; then - echo "$as_me:$LINENO: checking for remove in -lposix" >&5 -echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for remove in -lposix" >&5 +$as_echo_n "checking for remove in -lposix... " >&6; } if test "${ac_cv_lib_posix_remove+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lposix $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char remove (); int main () { -remove (); +return remove (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_posix_remove=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_posix_remove=no + ac_cv_lib_posix_remove=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5 -echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6 -if test $ac_cv_lib_posix_remove = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5 +$as_echo "$ac_cv_lib_posix_remove" >&6; } +if test "x$ac_cv_lib_posix_remove" = x""yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" fi fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. - echo "$as_me:$LINENO: checking for shmat" >&5 -echo $ECHO_N "checking for shmat... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for shmat" >&5 +$as_echo_n "checking for shmat... " >&6; } if test "${ac_cv_func_shmat+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +/* Define shmat to an innocuous variant, in case declares shmat. + For example, HP-UX 11i declares gettimeofday. */ +#define shmat innocuous_shmat + /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shmat (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ + #ifdef __STDC__ # include #else # include #endif -/* Override any gcc2 internal prototype to avoid an error. */ + +#undef shmat + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char shmat (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_shmat) || defined (__stub___shmat) +#if defined __stub_shmat || defined __stub___shmat choke me -#else -char (*f) () = shmat; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != shmat; +return shmat (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_func_shmat=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_shmat=no + ac_cv_func_shmat=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5 -echo "${ECHO_T}$ac_cv_func_shmat" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5 +$as_echo "$ac_cv_func_shmat" >&6; } if test $ac_cv_func_shmat = no; then - echo "$as_me:$LINENO: checking for shmat in -lipc" >&5 -echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for shmat in -lipc" >&5 +$as_echo_n "checking for shmat in -lipc... " >&6; } if test "${ac_cv_lib_ipc_shmat+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lipc $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char shmat (); int main () { -shmat (); +return shmat (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_ipc_shmat=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_ipc_shmat=no + ac_cv_lib_ipc_shmat=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5 -echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6 -if test $ac_cv_lib_ipc_shmat = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5 +$as_echo "$ac_cv_lib_ipc_shmat" >&6; } +if test "x$ac_cv_lib_ipc_shmat" = x""yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" fi @@ -18499,61 +20688,72 @@ fi # These have to be linked with before -lX11, unlike the other # libraries we check for below, so use a different variable. # John Interrante, Karl Berry - echo "$as_me:$LINENO: checking for IceConnectionNumber in -lICE" >&5 -echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for IceConnectionNumber in -lICE" >&5 +$as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; } if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char IceConnectionNumber (); int main () { -IceConnectionNumber (); +return IceConnectionNumber (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_ICE_IceConnectionNumber=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_ICE_IceConnectionNumber=no + ac_cv_lib_ICE_IceConnectionNumber=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 -echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6 -if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 +$as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; } +if test "x$ac_cv_lib_ICE_IceConnectionNumber" = x""yes; then X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" fi @@ -18570,134 +20770,156 @@ fi x_libraries="default_x_libraries" fi if test -z "$x_libraries"; then - { { echo "$as_me:$LINENO: error: No X libraries found" >&5 -echo "$as_me: error: No X libraries found" >&2;} + { { $as_echo "$as_me:$LINENO: error: No X libraries found" >&5 +$as_echo "$as_me: error: No X libraries found" >&2;} { (exit 1); exit 1; }; } # Exit fi if test -z "$x_includes"; then - { { echo "$as_me:$LINENO: error: No X includes found" >&5 -echo "$as_me: error: No X includes found" >&2;} + { { $as_echo "$as_me:$LINENO: error: No X includes found" >&5 +$as_echo "$as_me: error: No X includes found" >&2;} { (exit 1); exit 1; }; } # Exit fi CFLAGS=$X_CFLAGS LDFLAGS="$X_LDFLAGS $X_LIBS" - echo "$as_me:$LINENO: checking for XOpenDisplay in -lX11" >&5 -echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for XOpenDisplay in -lX11" >&5 +$as_echo_n "checking for XOpenDisplay in -lX11... " >&6; } if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lX11 $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char XOpenDisplay (); int main () { -XOpenDisplay (); +return XOpenDisplay (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_X11_XOpenDisplay=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_X11_XOpenDisplay=no + ac_cv_lib_X11_XOpenDisplay=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_X11_XOpenDisplay" >&5 -echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6 -if test $ac_cv_lib_X11_XOpenDisplay = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_X11_XOpenDisplay" >&5 +$as_echo "$ac_cv_lib_X11_XOpenDisplay" >&6; } +if test "x$ac_cv_lib_X11_XOpenDisplay" = x""yes; then x_libs="-lX11 $X_EXTRA_LIBS" else - { { echo "$as_me:$LINENO: error: X Development libraries not found" >&5 -echo "$as_me: error: X Development libraries not found" >&2;} + { { $as_echo "$as_me:$LINENO: error: X Development libraries not found" >&5 +$as_echo "$as_me: error: X Development libraries not found" >&2;} { (exit 1); exit 1; }; } fi - echo "$as_me:$LINENO: checking for XauDisposeAuth in -lXau" >&5 -echo $ECHO_N "checking for XauDisposeAuth in -lXau... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for XauDisposeAuth in -lXau" >&5 +$as_echo_n "checking for XauDisposeAuth in -lXau... " >&6; } if test "${ac_cv_lib_Xau_XauDisposeAuth+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXau $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char XauDisposeAuth (); int main () { -XauDisposeAuth (); +return XauDisposeAuth (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_Xau_XauDisposeAuth=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_Xau_XauDisposeAuth=no + ac_cv_lib_Xau_XauDisposeAuth=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_Xau_XauDisposeAuth" >&5 -echo "${ECHO_T}$ac_cv_lib_Xau_XauDisposeAuth" >&6 -if test $ac_cv_lib_Xau_XauDisposeAuth = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xau_XauDisposeAuth" >&5 +$as_echo "$ac_cv_lib_Xau_XauDisposeAuth" >&6; } +if test "x$ac_cv_lib_Xau_XauDisposeAuth" = x""yes; then XAU_LIBS="-lXau" fi @@ -18729,23 +20951,22 @@ fi if test "$_os" != "WINNT" -a "$_os" != "OS2" -a "$_os" != "Darwin"; then - echo "$as_me:$LINENO: checking whether to use Xaw" >&5 -echo $ECHO_N "checking whether to use Xaw... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking whether to use Xaw" >&5 +$as_echo_n "checking whether to use Xaw... " >&6; } if test "$enable_Xaw" = "no"; then DISABLE_XAW=TRUE - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } for ac_header in X11/Composite.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -18756,62 +20977,74 @@ cat >>conftest.$ac_ext <<_ACEOF #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_Header=no" + eval "$as_ac_Header=no" fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -if test `eval echo '${'$as_ac_Header'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else - { { echo "$as_me:$LINENO: error: Xt include headers not found" >&5 -echo "$as_me: error: Xt include headers not found" >&2;} + { { $as_echo "$as_me:$LINENO: error: Xt include headers not found" >&5 +$as_echo "$as_me: error: Xt include headers not found" >&2;} { (exit 1); exit 1; }; } fi done else - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } for ac_header in X11/Xaw/Label.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 +fi +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -18821,33 +21054,39 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -18855,101 +21094,97 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 else - eval "$as_ac_Header=$ac_header_preproc" + eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else - { { echo "$as_me:$LINENO: error: Xaw include headers not found" >&5 -echo "$as_me: error: Xaw include headers not found" >&2;} + { { $as_echo "$as_me:$LINENO: error: Xaw include headers not found" >&5 +$as_echo "$as_me: error: Xaw include headers not found" >&2;} { (exit 1); exit 1; }; } fi done -echo "$as_me:$LINENO: checking for main in -lXaw" >&5 -echo $ECHO_N "checking for main in -lXaw... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for main in -lXaw" >&5 +$as_echo_n "checking for main in -lXaw... " >&6; } if test "${ac_cv_lib_Xaw_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXaw $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -18960,36 +21195,48 @@ cat >>conftest.$ac_ext <<_ACEOF int main () { -main (); +return main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_Xaw_main=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_Xaw_main=no + ac_cv_lib_Xaw_main=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_Xaw_main" >&5 -echo "${ECHO_T}$ac_cv_lib_Xaw_main" >&6 -if test $ac_cv_lib_Xaw_main = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xaw_main" >&5 +$as_echo "$ac_cv_lib_Xaw_main" >&6; } +if test "x$ac_cv_lib_Xaw_main" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBXAW 1 _ACEOF @@ -18997,8 +21244,8 @@ _ACEOF LIBS="-lXaw $LIBS" else - { { echo "$as_me:$LINENO: error: Xaw library not found or functional" >&5 -echo "$as_me: error: Xaw library not found or functional" >&2;} + { { $as_echo "$as_me:$LINENO: error: Xaw library not found or functional" >&5 +$as_echo "$as_me: error: Xaw library not found or functional" >&2;} { (exit 1); exit 1; }; } fi @@ -19010,19 +21257,18 @@ fi if test "$ENABLE_FONTCONFIG" = "TRUE" ; then if test "${ac_cv_header_fontconfig_fontconfig_h+set}" = set; then - echo "$as_me:$LINENO: checking for fontconfig/fontconfig.h" >&5 -echo $ECHO_N "checking for fontconfig/fontconfig.h... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for fontconfig/fontconfig.h" >&5 +$as_echo_n "checking for fontconfig/fontconfig.h... " >&6; } if test "${ac_cv_header_fontconfig_fontconfig_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_fontconfig_fontconfig_h" >&5 -echo "${ECHO_T}$ac_cv_header_fontconfig_fontconfig_h" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_fontconfig_fontconfig_h" >&5 +$as_echo "$ac_cv_header_fontconfig_fontconfig_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking fontconfig/fontconfig.h usability" >&5 -echo $ECHO_N "checking fontconfig/fontconfig.h usability... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking fontconfig/fontconfig.h usability" >&5 +$as_echo_n "checking fontconfig/fontconfig.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -19032,33 +21278,39 @@ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking fontconfig/fontconfig.h presence" >&5 -echo $ECHO_N "checking fontconfig/fontconfig.h presence... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking fontconfig/fontconfig.h presence" >&5 +$as_echo_n "checking fontconfig/fontconfig.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -19066,98 +21318,92 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: fontconfig/fontconfig.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: fontconfig/fontconfig.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: fontconfig/fontconfig.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: fontconfig/fontconfig.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: fontconfig/fontconfig.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: fontconfig/fontconfig.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: fontconfig/fontconfig.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: fontconfig/fontconfig.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: fontconfig/fontconfig.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: fontconfig/fontconfig.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: fontconfig/fontconfig.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: fontconfig/fontconfig.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: fontconfig/fontconfig.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: fontconfig/fontconfig.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: fontconfig/fontconfig.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: fontconfig/fontconfig.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: fontconfig/fontconfig.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: fontconfig/fontconfig.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: fontconfig/fontconfig.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: fontconfig/fontconfig.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: fontconfig/fontconfig.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: fontconfig/fontconfig.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: fontconfig/fontconfig.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: fontconfig/fontconfig.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: fontconfig/fontconfig.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: fontconfig/fontconfig.h: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for fontconfig/fontconfig.h" >&5 -echo $ECHO_N "checking for fontconfig/fontconfig.h... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for fontconfig/fontconfig.h" >&5 +$as_echo_n "checking for fontconfig/fontconfig.h... " >&6; } if test "${ac_cv_header_fontconfig_fontconfig_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_fontconfig_fontconfig_h=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_fontconfig_fontconfig_h" >&5 -echo "${ECHO_T}$ac_cv_header_fontconfig_fontconfig_h" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_fontconfig_fontconfig_h" >&5 +$as_echo "$ac_cv_header_fontconfig_fontconfig_h" >&6; } fi -if test $ac_cv_header_fontconfig_fontconfig_h = yes; then +if test "x$ac_cv_header_fontconfig_fontconfig_h" = x""yes; then : else - { { echo "$as_me:$LINENO: error: fontconfig/fontconfig.h could not be found. libfontconfig1-dev or fontconfig???-devel missing?" >&5 -echo "$as_me: error: fontconfig/fontconfig.h could not be found. libfontconfig1-dev or fontconfig???-devel missing?" >&2;} + { { $as_echo "$as_me:$LINENO: error: fontconfig/fontconfig.h could not be found. libfontconfig1-dev or fontconfig???-devel missing?" >&5 +$as_echo "$as_me: error: fontconfig/fontconfig.h could not be found. libfontconfig1-dev or fontconfig???-devel missing?" >&2;} { (exit 1); exit 1; }; } fi - echo "$as_me:$LINENO: checking whether fontconfig is >= 2.2.0" >&5 -echo $ECHO_N "checking whether fontconfig is >= 2.2.0... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking whether fontconfig is >= 2.2.0" >&5 +$as_echo_n "checking whether fontconfig is >= 2.2.0... " >&6; } if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling +$as_echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -19173,65 +21419,78 @@ int main(int argc, char **argv) { _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: no, fontconfig >= 2.2.0 needed" >&5 -echo "$as_me: error: no, fontconfig >= 2.2.0 needed" >&2;} +{ { $as_echo "$as_me:$LINENO: error: no, fontconfig >= 2.2.0 needed" >&5 +$as_echo "$as_me: error: no, fontconfig >= 2.2.0 needed" >&2;} { (exit 1); exit 1; }; } fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -rf conftest.dSYM +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi -echo "$as_me:$LINENO: checking whether to link to Xrender" >&5 -echo $ECHO_N "checking whether to link to Xrender... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to link to Xrender" >&5 +$as_echo_n "checking whether to link to Xrender... " >&6; } if test -n "$enable_xrender_link" -a "$enable_xrender_link" != "no"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } XRENDER_LINK=YES with_system_xrender_headers=yes else - echo "$as_me:$LINENO: result: no, dynamically open it" >&5 -echo "${ECHO_T}no, dynamically open it" >&6 + { $as_echo "$as_me:$LINENO: result: no, dynamically open it" >&5 +$as_echo "no, dynamically open it" >&6; } XRENDER_LINK=NO fi -echo "$as_me:$LINENO: checking which Xrender headers to use" >&5 -echo $ECHO_N "checking which Xrender headers to use... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking which Xrender headers to use" >&5 +$as_echo_n "checking which Xrender headers to use... " >&6; } if test -n "$with_system_xrender_headers" -o -n "$with_system_headers" && \ test "$with_system_xrender_headers" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:$LINENO: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_XRENDER_HEADERS=YES if test "${ac_cv_header_X11_extensions_Xrender_h+set}" = set; then - echo "$as_me:$LINENO: checking for X11/extensions/Xrender.h" >&5 -echo $ECHO_N "checking for X11/extensions/Xrender.h... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for X11/extensions/Xrender.h" >&5 +$as_echo_n "checking for X11/extensions/Xrender.h... " >&6; } if test "${ac_cv_header_X11_extensions_Xrender_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_Xrender_h" >&5 -echo "${ECHO_T}$ac_cv_header_X11_extensions_Xrender_h" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_Xrender_h" >&5 +$as_echo "$ac_cv_header_X11_extensions_Xrender_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking X11/extensions/Xrender.h usability" >&5 -echo $ECHO_N "checking X11/extensions/Xrender.h usability... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking X11/extensions/Xrender.h usability" >&5 +$as_echo_n "checking X11/extensions/Xrender.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -19241,33 +21500,39 @@ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking X11/extensions/Xrender.h presence" >&5 -echo $ECHO_N "checking X11/extensions/Xrender.h presence... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking X11/extensions/Xrender.h presence" >&5 +$as_echo_n "checking X11/extensions/Xrender.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -19275,150 +21540,154 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: X11/extensions/Xrender.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: X11/extensions/Xrender.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/extensions/Xrender.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: X11/extensions/Xrender.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: X11/extensions/Xrender.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: X11/extensions/Xrender.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: X11/extensions/Xrender.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: X11/extensions/Xrender.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: X11/extensions/Xrender.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: X11/extensions/Xrender.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/extensions/Xrender.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: X11/extensions/Xrender.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/extensions/Xrender.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: X11/extensions/Xrender.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: X11/extensions/Xrender.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: X11/extensions/Xrender.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: X11/extensions/Xrender.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: X11/extensions/Xrender.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: X11/extensions/Xrender.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: X11/extensions/Xrender.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: X11/extensions/Xrender.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: X11/extensions/Xrender.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: X11/extensions/Xrender.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: X11/extensions/Xrender.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: X11/extensions/Xrender.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: X11/extensions/Xrender.h: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for X11/extensions/Xrender.h" >&5 -echo $ECHO_N "checking for X11/extensions/Xrender.h... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for X11/extensions/Xrender.h" >&5 +$as_echo_n "checking for X11/extensions/Xrender.h... " >&6; } if test "${ac_cv_header_X11_extensions_Xrender_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_X11_extensions_Xrender_h=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_Xrender_h" >&5 -echo "${ECHO_T}$ac_cv_header_X11_extensions_Xrender_h" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_Xrender_h" >&5 +$as_echo "$ac_cv_header_X11_extensions_Xrender_h" >&6; } fi -if test $ac_cv_header_X11_extensions_Xrender_h = yes; then +if test "x$ac_cv_header_X11_extensions_Xrender_h" = x""yes; then : else - { { echo "$as_me:$LINENO: error: Xrender not found. install X" >&5 -echo "$as_me: error: Xrender not found. install X" >&2;} + { { $as_echo "$as_me:$LINENO: error: Xrender not found. install X" >&5 +$as_echo "$as_me: error: Xrender not found. install X" >&2;} { (exit 1); exit 1; }; } fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:$LINENO: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_XRENDER_HEADERS=NO BUILD_TYPE="$BUILD_TYPE X11_EXTENSIONS" fi if test "$XRENDER_LINK" = "YES"; then -echo "$as_me:$LINENO: checking for XRenderQueryVersion in -lXrender" >&5 -echo $ECHO_N "checking for XRenderQueryVersion in -lXrender... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for XRenderQueryVersion in -lXrender" >&5 +$as_echo_n "checking for XRenderQueryVersion in -lXrender... " >&6; } if test "${ac_cv_lib_Xrender_XRenderQueryVersion+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXrender $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char XRenderQueryVersion (); int main () { -XRenderQueryVersion (); +return XRenderQueryVersion (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_Xrender_XRenderQueryVersion=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_Xrender_XRenderQueryVersion=no + ac_cv_lib_Xrender_XRenderQueryVersion=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_Xrender_XRenderQueryVersion" >&5 -echo "${ECHO_T}$ac_cv_lib_Xrender_XRenderQueryVersion" >&6 -if test $ac_cv_lib_Xrender_XRenderQueryVersion = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xrender_XRenderQueryVersion" >&5 +$as_echo "$ac_cv_lib_Xrender_XRenderQueryVersion" >&6; } +if test "x$ac_cv_lib_Xrender_XRenderQueryVersion" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBXRENDER 1 _ACEOF @@ -19426,8 +21695,8 @@ _ACEOF LIBS="-lXrender $LIBS" else - { { echo "$as_me:$LINENO: error: libXrender not found or functional" >&5 -echo "$as_me: error: libXrender not found or functional" >&2;} + { { $as_echo "$as_me:$LINENO: error: libXrender not found or functional" >&5 +$as_echo "$as_me: error: libXrender not found or functional" >&2;} { (exit 1); exit 1; }; } fi @@ -19435,13 +21704,13 @@ fi -echo "$as_me:$LINENO: checking whether to enable RandR support" >&5 -echo $ECHO_N "checking whether to enable RandR support... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to enable RandR support" >&5 +$as_echo_n "checking whether to enable RandR support... " >&6; } if test "$test_randr" = "yes" -a \( "$enable_randr" = "yes" -o "$enable_randr" = "TRUE" \) ; then if test -z "$enable_randr_link" -o "$enable_randr_link" = "no"; then XRANDR_DLOPEN="TRUE" - echo "$as_me:$LINENO: result: resorting to dlopen libXrandr at runtime" >&5 -echo "${ECHO_T}resorting to dlopen libXrandr at runtime" >&6 + { $as_echo "$as_me:$LINENO: result: resorting to dlopen libXrandr at runtime" >&5 +$as_echo "resorting to dlopen libXrandr at runtime" >&6; } else XRANDR_DLOPEN="FALSE" @@ -19450,10 +21719,10 @@ echo "${ECHO_T}resorting to dlopen libXrandr at runtime" >&6 if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -19466,28 +21735,29 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -19498,25 +21768,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for xrandr >= 1.2" >&5 -echo $ECHO_N "checking for xrandr >= 1.2... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for xrandr >= 1.2" >&5 +$as_echo_n "checking for xrandr >= 1.2... " >&6; } if $PKG_CONFIG --exists "xrandr >= 1.2" ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking XRANDR_CFLAGS" >&5 -echo $ECHO_N "checking XRANDR_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking XRANDR_CFLAGS" >&5 +$as_echo_n "checking XRANDR_CFLAGS... " >&6; } XRANDR_CFLAGS=`$PKG_CONFIG --cflags "xrandr >= 1.2"` - echo "$as_me:$LINENO: result: $XRANDR_CFLAGS" >&5 -echo "${ECHO_T}$XRANDR_CFLAGS" >&6 + { $as_echo "$as_me:$LINENO: result: $XRANDR_CFLAGS" >&5 +$as_echo "$XRANDR_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking XRANDR_LIBS" >&5 -echo $ECHO_N "checking XRANDR_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking XRANDR_LIBS" >&5 +$as_echo_n "checking XRANDR_LIBS... " >&6; } XRANDR_LIBS=`$PKG_CONFIG --libs "xrandr >= 1.2"` - echo "$as_me:$LINENO: result: $XRANDR_LIBS" >&5 -echo "${ECHO_T}$XRANDR_LIBS" >&6 + { $as_echo "$as_me:$LINENO: result: $XRANDR_LIBS" >&5 +$as_echo "$XRANDR_LIBS" >&6; } else XRANDR_CFLAGS="" XRANDR_LIBS="" @@ -19542,19 +21812,18 @@ echo "${ECHO_T}$XRANDR_LIBS" >&6 if test "$ENABLE_RANDR" != "TRUE"; then if test "${ac_cv_header_X11_extensions_Xrandr_h+set}" = set; then - echo "$as_me:$LINENO: checking for X11/extensions/Xrandr.h" >&5 -echo $ECHO_N "checking for X11/extensions/Xrandr.h... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for X11/extensions/Xrandr.h" >&5 +$as_echo_n "checking for X11/extensions/Xrandr.h... " >&6; } if test "${ac_cv_header_X11_extensions_Xrandr_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_Xrandr_h" >&5 -echo "${ECHO_T}$ac_cv_header_X11_extensions_Xrandr_h" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_Xrandr_h" >&5 +$as_echo "$ac_cv_header_X11_extensions_Xrandr_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking X11/extensions/Xrandr.h usability" >&5 -echo $ECHO_N "checking X11/extensions/Xrandr.h usability... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking X11/extensions/Xrandr.h usability" >&5 +$as_echo_n "checking X11/extensions/Xrandr.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -19564,33 +21833,39 @@ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking X11/extensions/Xrandr.h presence" >&5 -echo $ECHO_N "checking X11/extensions/Xrandr.h presence... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking X11/extensions/Xrandr.h presence" >&5 +$as_echo_n "checking X11/extensions/Xrandr.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -19598,144 +21873,148 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: X11/extensions/Xrandr.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: X11/extensions/Xrandr.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/extensions/Xrandr.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: X11/extensions/Xrandr.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: X11/extensions/Xrandr.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: X11/extensions/Xrandr.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: X11/extensions/Xrandr.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: X11/extensions/Xrandr.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: X11/extensions/Xrandr.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: X11/extensions/Xrandr.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/extensions/Xrandr.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: X11/extensions/Xrandr.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/extensions/Xrandr.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: X11/extensions/Xrandr.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: X11/extensions/Xrandr.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: X11/extensions/Xrandr.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: X11/extensions/Xrandr.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: X11/extensions/Xrandr.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: X11/extensions/Xrandr.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: X11/extensions/Xrandr.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: X11/extensions/Xrandr.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: X11/extensions/Xrandr.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: X11/extensions/Xrandr.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: X11/extensions/Xrandr.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: X11/extensions/Xrandr.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: X11/extensions/Xrandr.h: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for X11/extensions/Xrandr.h" >&5 -echo $ECHO_N "checking for X11/extensions/Xrandr.h... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for X11/extensions/Xrandr.h" >&5 +$as_echo_n "checking for X11/extensions/Xrandr.h... " >&6; } if test "${ac_cv_header_X11_extensions_Xrandr_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_X11_extensions_Xrandr_h=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_Xrandr_h" >&5 -echo "${ECHO_T}$ac_cv_header_X11_extensions_Xrandr_h" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_Xrandr_h" >&5 +$as_echo "$ac_cv_header_X11_extensions_Xrandr_h" >&6; } fi -if test $ac_cv_header_X11_extensions_Xrandr_h = yes; then +if test "x$ac_cv_header_X11_extensions_Xrandr_h" = x""yes; then : else - { { echo "$as_me:$LINENO: error: X11/extensions/Xrandr.h could not be found. X11 dev missing?" >&5 -echo "$as_me: error: X11/extensions/Xrandr.h could not be found. X11 dev missing?" >&2;} + { { $as_echo "$as_me:$LINENO: error: X11/extensions/Xrandr.h could not be found. X11 dev missing?" >&5 +$as_echo "$as_me: error: X11/extensions/Xrandr.h could not be found. X11 dev missing?" >&2;} { (exit 1); exit 1; }; } fi XRANDR_CFLAGS=" " -echo "$as_me:$LINENO: checking for XRRQueryExtension in -lXrandr" >&5 -echo $ECHO_N "checking for XRRQueryExtension in -lXrandr... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for XRRQueryExtension in -lXrandr" >&5 +$as_echo_n "checking for XRRQueryExtension in -lXrandr... " >&6; } if test "${ac_cv_lib_Xrandr_XRRQueryExtension+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXrandr $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char XRRQueryExtension (); int main () { -XRRQueryExtension (); +return XRRQueryExtension (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_Xrandr_XRRQueryExtension=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_Xrandr_XRRQueryExtension=no + ac_cv_lib_Xrandr_XRRQueryExtension=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_Xrandr_XRRQueryExtension" >&5 -echo "${ECHO_T}$ac_cv_lib_Xrandr_XRRQueryExtension" >&6 -if test $ac_cv_lib_Xrandr_XRRQueryExtension = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xrandr_XRRQueryExtension" >&5 +$as_echo "$ac_cv_lib_Xrandr_XRRQueryExtension" >&6; } +if test "x$ac_cv_lib_Xrandr_XRRQueryExtension" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBXRANDR 1 _ACEOF @@ -19743,53 +22022,53 @@ _ACEOF LIBS="-lXrandr $LIBS" else - { { echo "$as_me:$LINENO: error: libXrandr not found or functional" >&5 -echo "$as_me: error: libXrandr not found or functional" >&2;} + { { $as_echo "$as_me:$LINENO: error: libXrandr not found or functional" >&5 +$as_echo "$as_me: error: libXrandr not found or functional" >&2;} { (exit 1); exit 1; }; } fi XRANDR_LIBS="-lXrandr " ENABLE_RANDR="TRUE" - echo "$as_me:$LINENO: result: enabling RandR support" >&5 -echo "${ECHO_T}enabling RandR support" >&6 + { $as_echo "$as_me:$LINENO: result: enabling RandR support" >&5 +$as_echo "enabling RandR support" >&6; } fi fi else ENABLE_RANDR="" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi -echo "$as_me:$LINENO: checking whether to use neon" >&5 -echo $ECHO_N "checking whether to use neon... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to use neon" >&5 +$as_echo_n "checking whether to use neon... " >&6; } if test "$enable_neon" = "no"; then - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } DISABLE_NEON=TRUE else - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -echo "$as_me:$LINENO: checking which neon to use" >&5 -echo $ECHO_N "checking which neon to use... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } +{ $as_echo "$as_me:$LINENO: checking which neon to use" >&5 +$as_echo_n "checking which neon to use... " >&6; } if test -n "$with_system_neon" -o -n "$with_system_libs" && \ test "$with_system_neon" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:$LINENO: result: external" >&5 +$as_echo "external" >&6; } succeeded=no if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -19802,28 +22081,29 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -19834,25 +22114,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for neon >= 0.24.0" >&5 -echo $ECHO_N "checking for neon >= 0.24.0... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for neon >= 0.24.0" >&5 +$as_echo_n "checking for neon >= 0.24.0... " >&6; } if $PKG_CONFIG --exists "neon >= 0.24.0" ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking NEON_CFLAGS" >&5 -echo $ECHO_N "checking NEON_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking NEON_CFLAGS" >&5 +$as_echo_n "checking NEON_CFLAGS... " >&6; } NEON_CFLAGS=`$PKG_CONFIG --cflags "neon >= 0.24.0"` - echo "$as_me:$LINENO: result: $NEON_CFLAGS" >&5 -echo "${ECHO_T}$NEON_CFLAGS" >&6 + { $as_echo "$as_me:$LINENO: result: $NEON_CFLAGS" >&5 +$as_echo "$NEON_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking NEON_LIBS" >&5 -echo $ECHO_N "checking NEON_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking NEON_LIBS" >&5 +$as_echo_n "checking NEON_LIBS... " >&6; } NEON_LIBS=`$PKG_CONFIG --libs "neon >= 0.24.0"` - echo "$as_me:$LINENO: result: $NEON_LIBS" >&5 -echo "${ECHO_T}$NEON_LIBS" >&6 + { $as_echo "$as_me:$LINENO: result: $NEON_LIBS" >&5 +$as_echo "$NEON_LIBS" >&6; } else NEON_CFLAGS="" NEON_LIBS="" @@ -19873,8 +22153,8 @@ echo "${ECHO_T}$NEON_LIBS" >&6 if test $succeeded = yes; then : else - { { echo "$as_me:$LINENO: error: you need neon >= 0.24.x for system-neon" >&5 -echo "$as_me: error: you need neon >= 0.24.x for system-neon" >&2;} + { { $as_echo "$as_me:$LINENO: error: you need neon >= 0.24.x for system-neon" >&5 +$as_echo "$as_me: error: you need neon >= 0.24.x for system-neon" >&2;} { (exit 1); exit 1; }; } fi @@ -19882,8 +22162,8 @@ echo "$as_me: error: you need neon >= 0.24.x for system-neon" >&2;} NEON_CFLAGS="$NEON_CFLAGS -DSYSTEM_NEON -DUSE_DAV_LOCKS=1" SYSTEM_NEON=YES else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:$LINENO: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_NEON=NO NEON_LIBS=-lneon NEON_CFLAGS= @@ -19892,12 +22172,12 @@ fi if test "$_os" = "Darwin" && test "$with_system_openssl" != "no"; then with_system_openssl=yes fi -echo "$as_me:$LINENO: checking which libssl to use" >&5 -echo $ECHO_N "checking which libssl to use... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking which libssl to use" >&5 +$as_echo_n "checking which libssl to use... " >&6; } if test -n "$with_system_openssl" -o -n "$with_system_libs" && \ test "$with_system_openssl" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:$LINENO: result: external" >&5 +$as_echo "external" >&6; } # Mac OS builds should get out without extra stuff is the Mac porters' # wish. And pkg-config is although Xcode ships a .pc for openssl if test "$_os" = "Darwin"; then @@ -19910,10 +22190,10 @@ echo "${ECHO_T}external" >&6 if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -19926,28 +22206,29 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -19958,25 +22239,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for openssl " >&5 -echo $ECHO_N "checking for openssl ... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for openssl " >&5 +$as_echo_n "checking for openssl ... " >&6; } if $PKG_CONFIG --exists "openssl " ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking OPENSSL_CFLAGS" >&5 -echo $ECHO_N "checking OPENSSL_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking OPENSSL_CFLAGS" >&5 +$as_echo_n "checking OPENSSL_CFLAGS... " >&6; } OPENSSL_CFLAGS=`$PKG_CONFIG --cflags "openssl "` - echo "$as_me:$LINENO: result: $OPENSSL_CFLAGS" >&5 -echo "${ECHO_T}$OPENSSL_CFLAGS" >&6 + { $as_echo "$as_me:$LINENO: result: $OPENSSL_CFLAGS" >&5 +$as_echo "$OPENSSL_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking OPENSSL_LIBS" >&5 -echo $ECHO_N "checking OPENSSL_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking OPENSSL_LIBS" >&5 +$as_echo_n "checking OPENSSL_LIBS... " >&6; } OPENSSL_LIBS=`$PKG_CONFIG --libs "openssl "` - echo "$as_me:$LINENO: result: $OPENSSL_LIBS" >&5 -echo "${ECHO_T}$OPENSSL_LIBS" >&6 + { $as_echo "$as_me:$LINENO: result: $OPENSSL_LIBS" >&5 +$as_echo "$OPENSSL_LIBS" >&6; } else OPENSSL_CFLAGS="" OPENSSL_LIBS="" @@ -19997,16 +22278,16 @@ echo "${ECHO_T}$OPENSSL_LIBS" >&6 if test $succeeded = yes; then : else - { { echo "$as_me:$LINENO: error: Library requirements (openssl ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 -echo "$as_me: error: Library requirements (openssl ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} + { { $as_echo "$as_me:$LINENO: error: Library requirements (openssl ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 +$as_echo "$as_me: error: Library requirements (openssl ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} { (exit 1); exit 1; }; } fi fi SYSTEM_OPENSSL=YES else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:$LINENO: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_OPENSSL=NO BUILD_TYPE="$BUILD_TYPE OPENSSL" fi @@ -20020,33 +22301,33 @@ fi fi -echo "$as_me:$LINENO: checking whether to enable agg" >&5 -echo $ECHO_N "checking whether to enable agg... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to enable agg" >&5 +$as_echo_n "checking whether to enable agg... " >&6; } if test "$with_agg" = "no"; then - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } else - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } ENABLE_AGG=YES - echo "$as_me:$LINENO: checking which AGG to use" >&5 -echo $ECHO_N "checking which AGG to use... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking which AGG to use" >&5 +$as_echo_n "checking which AGG to use... " >&6; } if test -n "$with_system_agg" -o -n "$with_system_libs" && \ test "$with_system_agg" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:$LINENO: result: external" >&5 +$as_echo "external" >&6; } succeeded=no if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -20059,28 +22340,29 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -20091,25 +22373,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for libagg >= 2.3" >&5 -echo $ECHO_N "checking for libagg >= 2.3... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for libagg >= 2.3" >&5 +$as_echo_n "checking for libagg >= 2.3... " >&6; } if $PKG_CONFIG --exists "libagg >= 2.3" ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking AGG_CFLAGS" >&5 -echo $ECHO_N "checking AGG_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking AGG_CFLAGS" >&5 +$as_echo_n "checking AGG_CFLAGS... " >&6; } AGG_CFLAGS=`$PKG_CONFIG --cflags "libagg >= 2.3"` - echo "$as_me:$LINENO: result: $AGG_CFLAGS" >&5 -echo "${ECHO_T}$AGG_CFLAGS" >&6 + { $as_echo "$as_me:$LINENO: result: $AGG_CFLAGS" >&5 +$as_echo "$AGG_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking AGG_LIBS" >&5 -echo $ECHO_N "checking AGG_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking AGG_LIBS" >&5 +$as_echo_n "checking AGG_LIBS... " >&6; } AGG_LIBS=`$PKG_CONFIG --libs "libagg >= 2.3"` - echo "$as_me:$LINENO: result: $AGG_LIBS" >&5 -echo "${ECHO_T}$AGG_LIBS" >&6 + { $as_echo "$as_me:$LINENO: result: $AGG_LIBS" >&5 +$as_echo "$AGG_LIBS" >&6; } else AGG_CFLAGS="" AGG_LIBS="" @@ -20130,13 +22412,13 @@ echo "${ECHO_T}$AGG_LIBS" >&6 if test $succeeded = yes; then : else - { { echo "$as_me:$LINENO: error: Library requirements (libagg >= 2.3) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 -echo "$as_me: error: Library requirements (libagg >= 2.3) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} + { { $as_echo "$as_me:$LINENO: error: Library requirements (libagg >= 2.3) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 +$as_echo "$as_me: error: Library requirements (libagg >= 2.3) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} { (exit 1); exit 1; }; } fi - echo "$as_me:$LINENO: checking agg version" >&5 -echo $ECHO_N "checking agg version... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking agg version" >&5 +$as_echo_n "checking agg version... " >&6; } # workaround; if AGG_CFLAGS is empty (broken libagg.pc in 2.3), add /usr/include/agg2 anyway # (/usr/include gets stripped from pkg-config output) if test -z "$AGG_CFLAGS" || test "$AGG_CFLAGS" = " "; then @@ -20148,23 +22430,23 @@ echo $ECHO_N "checking agg version... $ECHO_C" >&6 $PKG_CONFIG --modversion libagg | grep -q 2.4; then # 2.4's libagg.pc.in still contains 2.3 :/ if $EGREP -q "Version 2.4" `echo $AGG_INCDIR`/agg_basics.h; then - echo "$as_me:$LINENO: result: 2.4" >&5 -echo "${ECHO_T}2.4" >&6 + { $as_echo "$as_me:$LINENO: result: 2.4" >&5 +$as_echo "2.4" >&6; } AGG_VERSION=2400 else - echo "$as_me:$LINENO: result: 2.3" >&5 -echo "${ECHO_T}2.3" >&6 + { $as_echo "$as_me:$LINENO: result: 2.3" >&5 +$as_echo "2.3" >&6; } AGG_VERSION=2300 fi SYSTEM_AGG=YES else - { { echo "$as_me:$LINENO: error: only agg 2.3 and 2.4 are supported" >&5 -echo "$as_me: error: only agg 2.3 and 2.4 are supported" >&2;} + { { $as_echo "$as_me:$LINENO: error: only agg 2.3 and 2.4 are supported" >&5 +$as_echo "$as_me: error: only agg 2.3 and 2.4 are supported" >&2;} { (exit 1); exit 1; }; } fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:$LINENO: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_AGG=NO AGG_VERSION=2300 BUILD_TYPE="$BUILD_TYPE AGG" @@ -20173,12 +22455,12 @@ echo "${ECHO_T}internal" >&6 fi -echo "$as_me:$LINENO: checking which redland library to use" >&5 -echo $ECHO_N "checking which redland library to use... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking which redland library to use" >&5 +$as_echo_n "checking which redland library to use... " >&6; } if test -n "$with_system_redland" && \ test "$with_system_redland" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:$LINENO: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_REDLAND=YES succeeded=no @@ -20186,10 +22468,10 @@ echo "${ECHO_T}external" >&6 if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -20202,28 +22484,29 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -20234,25 +22517,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for redland" >&5 -echo $ECHO_N "checking for redland... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for redland" >&5 +$as_echo_n "checking for redland... " >&6; } if $PKG_CONFIG --exists "redland" ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking REDLAND_CFLAGS" >&5 -echo $ECHO_N "checking REDLAND_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking REDLAND_CFLAGS" >&5 +$as_echo_n "checking REDLAND_CFLAGS... " >&6; } REDLAND_CFLAGS=`$PKG_CONFIG --cflags "redland"` - echo "$as_me:$LINENO: result: $REDLAND_CFLAGS" >&5 -echo "${ECHO_T}$REDLAND_CFLAGS" >&6 + { $as_echo "$as_me:$LINENO: result: $REDLAND_CFLAGS" >&5 +$as_echo "$REDLAND_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking REDLAND_LIBS" >&5 -echo $ECHO_N "checking REDLAND_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking REDLAND_LIBS" >&5 +$as_echo_n "checking REDLAND_LIBS... " >&6; } REDLAND_LIBS=`$PKG_CONFIG --libs "redland"` - echo "$as_me:$LINENO: result: $REDLAND_LIBS" >&5 -echo "${ECHO_T}$REDLAND_LIBS" >&6 + { $as_echo "$as_me:$LINENO: result: $REDLAND_LIBS" >&5 +$as_echo "$REDLAND_LIBS" >&6; } else REDLAND_CFLAGS="" REDLAND_LIBS="" @@ -20273,28 +22556,28 @@ echo "${ECHO_T}$REDLAND_LIBS" >&6 if test $succeeded = yes; then : else - { { echo "$as_me:$LINENO: error: Library requirements (redland) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 -echo "$as_me: error: Library requirements (redland) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} + { { $as_echo "$as_me:$LINENO: error: Library requirements (redland) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 +$as_echo "$as_me: error: Library requirements (redland) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} { (exit 1); exit 1; }; } fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:$LINENO: result: internal" >&5 +$as_echo "internal" >&6; } BUILD_TYPE="$BUILD_TYPE REDLAND" SYSTEM_REDLAND=NO fi -echo "$as_me:$LINENO: checking which libhunspell to use" >&5 -echo $ECHO_N "checking which libhunspell to use... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking which libhunspell to use" >&5 +$as_echo_n "checking which libhunspell to use... " >&6; } if test -n "$with_system_hunspell" -o -n "$with_system_libs" && \ test "$with_system_hunspell" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:$LINENO: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_HUNSPELL=YES - ac_ext=cc + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -20306,10 +22589,10 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -20322,28 +22605,29 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -20354,25 +22638,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for hunspell" >&5 -echo $ECHO_N "checking for hunspell... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for hunspell" >&5 +$as_echo_n "checking for hunspell... " >&6; } if $PKG_CONFIG --exists "hunspell" ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking HUNSPELL_CFLAGS" >&5 -echo $ECHO_N "checking HUNSPELL_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking HUNSPELL_CFLAGS" >&5 +$as_echo_n "checking HUNSPELL_CFLAGS... " >&6; } HUNSPELL_CFLAGS=`$PKG_CONFIG --cflags "hunspell"` - echo "$as_me:$LINENO: result: $HUNSPELL_CFLAGS" >&5 -echo "${ECHO_T}$HUNSPELL_CFLAGS" >&6 + { $as_echo "$as_me:$LINENO: result: $HUNSPELL_CFLAGS" >&5 +$as_echo "$HUNSPELL_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking HUNSPELL_LIBS" >&5 -echo $ECHO_N "checking HUNSPELL_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking HUNSPELL_LIBS" >&5 +$as_echo_n "checking HUNSPELL_LIBS... " >&6; } HUNSPELL_LIBS=`$PKG_CONFIG --libs "hunspell"` - echo "$as_me:$LINENO: result: $HUNSPELL_LIBS" >&5 -echo "${ECHO_T}$HUNSPELL_LIBS" >&6 + { $as_echo "$as_me:$LINENO: result: $HUNSPELL_LIBS" >&5 +$as_echo "$HUNSPELL_LIBS" >&6; } else HUNSPELL_CFLAGS="" HUNSPELL_LIBS="" @@ -20398,19 +22682,18 @@ echo "${ECHO_T}$HUNSPELL_LIBS" >&6 if test "$HUNSPELL_PC" != "TRUE"; then if test "${ac_cv_header_hunspell_hxx+set}" = set; then - echo "$as_me:$LINENO: checking for hunspell.hxx" >&5 -echo $ECHO_N "checking for hunspell.hxx... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for hunspell.hxx" >&5 +$as_echo_n "checking for hunspell.hxx... " >&6; } if test "${ac_cv_header_hunspell_hxx+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_hunspell_hxx" >&5 -echo "${ECHO_T}$ac_cv_header_hunspell_hxx" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_hunspell_hxx" >&5 +$as_echo "$ac_cv_header_hunspell_hxx" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking hunspell.hxx usability" >&5 -echo $ECHO_N "checking hunspell.hxx usability... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking hunspell.hxx usability" >&5 +$as_echo_n "checking hunspell.hxx usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -20420,33 +22703,39 @@ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking hunspell.hxx presence" >&5 -echo $ECHO_N "checking hunspell.hxx presence... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking hunspell.hxx presence" >&5 +$as_echo_n "checking hunspell.hxx presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -20454,96 +22743,88 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: hunspell.hxx: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: hunspell.hxx: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: hunspell.hxx: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: hunspell.hxx: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: hunspell.hxx: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: hunspell.hxx: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: hunspell.hxx: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: hunspell.hxx: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: hunspell.hxx: present but cannot be compiled" >&5 -echo "$as_me: WARNING: hunspell.hxx: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: hunspell.hxx: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: hunspell.hxx: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: hunspell.hxx: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: hunspell.hxx: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: hunspell.hxx: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: hunspell.hxx: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: hunspell.hxx: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: hunspell.hxx: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: hunspell.hxx: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: hunspell.hxx: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: hunspell.hxx: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: hunspell.hxx: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: hunspell.hxx: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: hunspell.hxx: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: hunspell.hxx: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: hunspell.hxx: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for hunspell.hxx" >&5 -echo $ECHO_N "checking for hunspell.hxx... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for hunspell.hxx" >&5 +$as_echo_n "checking for hunspell.hxx... " >&6; } if test "${ac_cv_header_hunspell_hxx+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_hunspell_hxx=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_hunspell_hxx" >&5 -echo "${ECHO_T}$ac_cv_header_hunspell_hxx" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_hunspell_hxx" >&5 +$as_echo "$ac_cv_header_hunspell_hxx" >&6; } fi -if test $ac_cv_header_hunspell_hxx = yes; then +if test "x$ac_cv_header_hunspell_hxx" = x""yes; then : else if test "${ac_cv_header_hunspell_hunspell_hxx+set}" = set; then - echo "$as_me:$LINENO: checking for hunspell/hunspell.hxx" >&5 -echo $ECHO_N "checking for hunspell/hunspell.hxx... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for hunspell/hunspell.hxx" >&5 +$as_echo_n "checking for hunspell/hunspell.hxx... " >&6; } if test "${ac_cv_header_hunspell_hunspell_hxx+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_hunspell_hunspell_hxx" >&5 -echo "${ECHO_T}$ac_cv_header_hunspell_hunspell_hxx" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_hunspell_hunspell_hxx" >&5 +$as_echo "$ac_cv_header_hunspell_hunspell_hxx" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking hunspell/hunspell.hxx usability" >&5 -echo $ECHO_N "checking hunspell/hunspell.hxx usability... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking hunspell/hunspell.hxx usability" >&5 +$as_echo_n "checking hunspell/hunspell.hxx usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -20553,33 +22834,39 @@ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking hunspell/hunspell.hxx presence" >&5 -echo $ECHO_N "checking hunspell/hunspell.hxx presence... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking hunspell/hunspell.hxx presence" >&5 +$as_echo_n "checking hunspell/hunspell.hxx presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -20587,83 +22874,76 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: hunspell/hunspell.hxx: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: hunspell/hunspell.hxx: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: hunspell/hunspell.hxx: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: hunspell/hunspell.hxx: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: hunspell/hunspell.hxx: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: hunspell/hunspell.hxx: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: hunspell/hunspell.hxx: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: hunspell/hunspell.hxx: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: hunspell/hunspell.hxx: present but cannot be compiled" >&5 -echo "$as_me: WARNING: hunspell/hunspell.hxx: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: hunspell/hunspell.hxx: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: hunspell/hunspell.hxx: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: hunspell/hunspell.hxx: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: hunspell/hunspell.hxx: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: hunspell/hunspell.hxx: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: hunspell/hunspell.hxx: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: hunspell/hunspell.hxx: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: hunspell/hunspell.hxx: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: hunspell/hunspell.hxx: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: hunspell/hunspell.hxx: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: hunspell/hunspell.hxx: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: hunspell/hunspell.hxx: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: hunspell/hunspell.hxx: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: hunspell/hunspell.hxx: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: hunspell/hunspell.hxx: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: hunspell/hunspell.hxx: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for hunspell/hunspell.hxx" >&5 -echo $ECHO_N "checking for hunspell/hunspell.hxx... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for hunspell/hunspell.hxx" >&5 +$as_echo_n "checking for hunspell/hunspell.hxx... " >&6; } if test "${ac_cv_header_hunspell_hunspell_hxx+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_hunspell_hunspell_hxx=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_hunspell_hunspell_hxx" >&5 -echo "${ECHO_T}$ac_cv_header_hunspell_hunspell_hxx" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_hunspell_hunspell_hxx" >&5 +$as_echo "$ac_cv_header_hunspell_hunspell_hxx" >&6; } fi -if test $ac_cv_header_hunspell_hunspell_hxx = yes; then +if test "x$ac_cv_header_hunspell_hunspell_hxx" = x""yes; then HUNSPELL_CFLAGS=-I/usr/include/hunspell else - { { echo "$as_me:$LINENO: error: hunspell headers not found." >&5 -echo "$as_me: error: hunspell headers not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: hunspell headers not found." >&5 +$as_echo "$as_me: error: hunspell headers not found." >&2;} { (exit 1); exit 1; }; } fi @@ -20673,15 +22953,14 @@ fi -echo "$as_me:$LINENO: checking for main in -lhunspell" >&5 -echo $ECHO_N "checking for main in -lhunspell... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for main in -lhunspell" >&5 +$as_echo_n "checking for main in -lhunspell... " >&6; } if test "${ac_cv_lib_hunspell_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lhunspell $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -20692,36 +22971,48 @@ cat >>conftest.$ac_ext <<_ACEOF int main () { -main (); +return main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_hunspell_main=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_hunspell_main=no + ac_cv_lib_hunspell_main=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_hunspell_main" >&5 -echo "${ECHO_T}$ac_cv_lib_hunspell_main" >&6 -if test $ac_cv_lib_hunspell_main = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_hunspell_main" >&5 +$as_echo "$ac_cv_lib_hunspell_main" >&6; } +if test "x$ac_cv_lib_hunspell_main" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBHUNSPELL 1 _ACEOF @@ -20729,8 +23020,8 @@ _ACEOF LIBS="-lhunspell $LIBS" else - { { echo "$as_me:$LINENO: error: hunspell library not found." >&5 -echo "$as_me: error: hunspell library not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: hunspell library not found." >&5 +$as_echo "$as_me: error: hunspell library not found." >&2;} { (exit 1); exit 1; }; } fi @@ -20743,8 +23034,8 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:$LINENO: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_HUNSPELL=NO BUILD_TYPE="$BUILD_TYPE HUNSPELL" fi @@ -20752,27 +23043,26 @@ fi -echo "$as_me:$LINENO: checking which altlinuxhyph to use" >&5 -echo $ECHO_N "checking which altlinuxhyph to use... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking which altlinuxhyph to use" >&5 +$as_echo_n "checking which altlinuxhyph to use... " >&6; } if test -n "$with_system_altlinuxhyph" -o -n "$with_system_libs" && \ test "$with_system_altlinuxhyph" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:$LINENO: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_HYPH=YES if test "${ac_cv_header_hyphen_h+set}" = set; then - echo "$as_me:$LINENO: checking for hyphen.h" >&5 -echo $ECHO_N "checking for hyphen.h... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for hyphen.h" >&5 +$as_echo_n "checking for hyphen.h... " >&6; } if test "${ac_cv_header_hyphen_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_hyphen_h" >&5 -echo "${ECHO_T}$ac_cv_header_hyphen_h" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_hyphen_h" >&5 +$as_echo "$ac_cv_header_hyphen_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking hyphen.h usability" >&5 -echo $ECHO_N "checking hyphen.h usability... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking hyphen.h usability" >&5 +$as_echo_n "checking hyphen.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -20782,33 +23072,39 @@ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking hyphen.h presence" >&5 -echo $ECHO_N "checking hyphen.h presence... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking hyphen.h presence" >&5 +$as_echo_n "checking hyphen.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -20816,94 +23112,86 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: hyphen.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: hyphen.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: hyphen.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: hyphen.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: hyphen.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: hyphen.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: hyphen.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: hyphen.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: hyphen.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: hyphen.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: hyphen.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: hyphen.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: hyphen.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: hyphen.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: hyphen.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: hyphen.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: hyphen.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: hyphen.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: hyphen.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: hyphen.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: hyphen.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: hyphen.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: hyphen.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: hyphen.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: hyphen.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: hyphen.h: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for hyphen.h" >&5 -echo $ECHO_N "checking for hyphen.h... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for hyphen.h" >&5 +$as_echo_n "checking for hyphen.h... " >&6; } if test "${ac_cv_header_hyphen_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_hyphen_h=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_hyphen_h" >&5 -echo "${ECHO_T}$ac_cv_header_hyphen_h" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_hyphen_h" >&5 +$as_echo "$ac_cv_header_hyphen_h" >&6; } fi -if test $ac_cv_header_hyphen_h = yes; then +if test "x$ac_cv_header_hyphen_h" = x""yes; then : else - { { echo "$as_me:$LINENO: error: altlinuxhyph headers not found." >&5 -echo "$as_me: error: altlinuxhyph headers not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: altlinuxhyph headers not found." >&5 +$as_echo "$as_me: error: altlinuxhyph headers not found." >&2;} { (exit 1); exit 1; }; } fi - echo "$as_me:$LINENO: checking for struct _HyphenDict.cset" >&5 -echo $ECHO_N "checking for struct _HyphenDict.cset... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for struct _HyphenDict.cset" >&5 +$as_echo_n "checking for struct _HyphenDict.cset... " >&6; } if test "${ac_cv_member_struct__HyphenDict_cset+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -20922,24 +23210,29 @@ return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_member_struct__HyphenDict_cset=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -20958,256 +23251,296 @@ return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_member_struct__HyphenDict_cset=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_member_struct__HyphenDict_cset=no + ac_cv_member_struct__HyphenDict_cset=no fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_member_struct__HyphenDict_cset" >&5 -echo "${ECHO_T}$ac_cv_member_struct__HyphenDict_cset" >&6 -if test $ac_cv_member_struct__HyphenDict_cset = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_member_struct__HyphenDict_cset" >&5 +$as_echo "$ac_cv_member_struct__HyphenDict_cset" >&6; } +if test "x$ac_cv_member_struct__HyphenDict_cset" = x""yes; then : else - { { echo "$as_me:$LINENO: error: no. You are sure you have altlinuyhyph headers?" >&5 -echo "$as_me: error: no. You are sure you have altlinuyhyph headers?" >&2;} + { { $as_echo "$as_me:$LINENO: error: no. You are sure you have altlinuyhyph headers?" >&5 +$as_echo "$as_me: error: no. You are sure you have altlinuyhyph headers?" >&2;} { (exit 1); exit 1; }; } fi - echo "$as_me:$LINENO: checking for hnj_hyphen_hyphenate2 in -lhyphen" >&5 -echo $ECHO_N "checking for hnj_hyphen_hyphenate2 in -lhyphen... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for hnj_hyphen_hyphenate2 in -lhyphen" >&5 +$as_echo_n "checking for hnj_hyphen_hyphenate2 in -lhyphen... " >&6; } if test "${ac_cv_lib_hyphen_hnj_hyphen_hyphenate2+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lhyphen $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char hnj_hyphen_hyphenate2 (); int main () { -hnj_hyphen_hyphenate2 (); +return hnj_hyphen_hyphenate2 (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_hyphen_hnj_hyphen_hyphenate2=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_hyphen_hnj_hyphen_hyphenate2=no + ac_cv_lib_hyphen_hnj_hyphen_hyphenate2=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_hyphen_hnj_hyphen_hyphenate2" >&5 -echo "${ECHO_T}$ac_cv_lib_hyphen_hnj_hyphen_hyphenate2" >&6 -if test $ac_cv_lib_hyphen_hnj_hyphen_hyphenate2 = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_hyphen_hnj_hyphen_hyphenate2" >&5 +$as_echo "$ac_cv_lib_hyphen_hnj_hyphen_hyphenate2" >&6; } +if test "x$ac_cv_lib_hyphen_hnj_hyphen_hyphenate2" = x""yes; then HYPHEN_LIB=-lhyphen else - { { echo "$as_me:$LINENO: error: altlinuxhyph library not found or too old." >&5 -echo "$as_me: error: altlinuxhyph library not found or too old." >&2;} + { { $as_echo "$as_me:$LINENO: error: altlinuxhyph library not found or too old." >&5 +$as_echo "$as_me: error: altlinuxhyph library not found or too old." >&2;} { (exit 1); exit 1; }; } fi if test -z "$HYPHEN_LIB"; then - echo "$as_me:$LINENO: checking for hnj_hyphen_hyphenate2 in -lhyph" >&5 -echo $ECHO_N "checking for hnj_hyphen_hyphenate2 in -lhyph... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for hnj_hyphen_hyphenate2 in -lhyph" >&5 +$as_echo_n "checking for hnj_hyphen_hyphenate2 in -lhyph... " >&6; } if test "${ac_cv_lib_hyph_hnj_hyphen_hyphenate2+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lhyph $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char hnj_hyphen_hyphenate2 (); int main () { -hnj_hyphen_hyphenate2 (); +return hnj_hyphen_hyphenate2 (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_hyph_hnj_hyphen_hyphenate2=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_hyph_hnj_hyphen_hyphenate2=no + ac_cv_lib_hyph_hnj_hyphen_hyphenate2=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_hyph_hnj_hyphen_hyphenate2" >&5 -echo "${ECHO_T}$ac_cv_lib_hyph_hnj_hyphen_hyphenate2" >&6 -if test $ac_cv_lib_hyph_hnj_hyphen_hyphenate2 = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_hyph_hnj_hyphen_hyphenate2" >&5 +$as_echo "$ac_cv_lib_hyph_hnj_hyphen_hyphenate2" >&6; } +if test "x$ac_cv_lib_hyph_hnj_hyphen_hyphenate2" = x""yes; then HYPHEN_LIB=-lhyph else - { { echo "$as_me:$LINENO: error: altlinuxhyph library not found or too old." >&5 -echo "$as_me: error: altlinuxhyph library not found or too old." >&2;} + { { $as_echo "$as_me:$LINENO: error: altlinuxhyph library not found or too old." >&5 +$as_echo "$as_me: error: altlinuxhyph library not found or too old." >&2;} { (exit 1); exit 1; }; } fi fi if test -z "$HYPHEN_LIB"; then - echo "$as_me:$LINENO: checking for hnj_hyphen_hyphenate2 in -lhnj" >&5 -echo $ECHO_N "checking for hnj_hyphen_hyphenate2 in -lhnj... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for hnj_hyphen_hyphenate2 in -lhnj" >&5 +$as_echo_n "checking for hnj_hyphen_hyphenate2 in -lhnj... " >&6; } if test "${ac_cv_lib_hnj_hnj_hyphen_hyphenate2+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lhnj $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char hnj_hyphen_hyphenate2 (); int main () { -hnj_hyphen_hyphenate2 (); +return hnj_hyphen_hyphenate2 (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_hnj_hnj_hyphen_hyphenate2=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_hnj_hnj_hyphen_hyphenate2=no + ac_cv_lib_hnj_hnj_hyphen_hyphenate2=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_hnj_hnj_hyphen_hyphenate2" >&5 -echo "${ECHO_T}$ac_cv_lib_hnj_hnj_hyphen_hyphenate2" >&6 -if test $ac_cv_lib_hnj_hnj_hyphen_hyphenate2 = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_hnj_hnj_hyphen_hyphenate2" >&5 +$as_echo "$ac_cv_lib_hnj_hnj_hyphen_hyphenate2" >&6; } +if test "x$ac_cv_lib_hnj_hnj_hyphen_hyphenate2" = x""yes; then HYPHEN_LIB=-lhnj else - { { echo "$as_me:$LINENO: error: altlinuxhyph library not found or too old." >&5 -echo "$as_me: error: altlinuxhyph library not found or too old." >&2;} + { { $as_echo "$as_me:$LINENO: error: altlinuxhyph library not found or too old." >&5 +$as_echo "$as_me: error: altlinuxhyph library not found or too old." >&2;} { (exit 1); exit 1; }; } fi fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:$LINENO: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_HYPH=NO fi -echo "$as_me:$LINENO: checking which mythes to use" >&5 -echo $ECHO_N "checking which mythes to use... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking which mythes to use" >&5 +$as_echo_n "checking which mythes to use... " >&6; } if test -n "$with_system_mythes" && test "$with_system_mythes" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:$LINENO: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_MYTHES=YES if test "${ac_cv_header_mythes_hxx+set}" = set; then - echo "$as_me:$LINENO: checking for mythes.hxx" >&5 -echo $ECHO_N "checking for mythes.hxx... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for mythes.hxx" >&5 +$as_echo_n "checking for mythes.hxx... " >&6; } if test "${ac_cv_header_mythes_hxx+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_mythes_hxx" >&5 -echo "${ECHO_T}$ac_cv_header_mythes_hxx" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_mythes_hxx" >&5 +$as_echo "$ac_cv_header_mythes_hxx" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking mythes.hxx usability" >&5 -echo $ECHO_N "checking mythes.hxx usability... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking mythes.hxx usability" >&5 +$as_echo_n "checking mythes.hxx usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -21217,33 +23550,39 @@ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking mythes.hxx presence" >&5 -echo $ECHO_N "checking mythes.hxx presence... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking mythes.hxx presence" >&5 +$as_echo_n "checking mythes.hxx presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -21251,97 +23590,89 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: mythes.hxx: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: mythes.hxx: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: mythes.hxx: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: mythes.hxx: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: mythes.hxx: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: mythes.hxx: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mythes.hxx: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: mythes.hxx: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: mythes.hxx: present but cannot be compiled" >&5 -echo "$as_me: WARNING: mythes.hxx: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: mythes.hxx: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: mythes.hxx: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: mythes.hxx: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: mythes.hxx: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: mythes.hxx: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: mythes.hxx: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mythes.hxx: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: mythes.hxx: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mythes.hxx: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: mythes.hxx: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mythes.hxx: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: mythes.hxx: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mythes.hxx: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: mythes.hxx: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mythes.hxx: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: mythes.hxx: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for mythes.hxx" >&5 -echo $ECHO_N "checking for mythes.hxx... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for mythes.hxx" >&5 +$as_echo_n "checking for mythes.hxx... " >&6; } if test "${ac_cv_header_mythes_hxx+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_mythes_hxx=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_mythes_hxx" >&5 -echo "${ECHO_T}$ac_cv_header_mythes_hxx" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_mythes_hxx" >&5 +$as_echo "$ac_cv_header_mythes_hxx" >&6; } fi -if test $ac_cv_header_mythes_hxx = yes; then +if test "x$ac_cv_header_mythes_hxx" = x""yes; then : else - { { echo "$as_me:$LINENO: error: mythes.hxx headers not found." >&5 -echo "$as_me: error: mythes.hxx headers not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: mythes.hxx headers not found." >&5 +$as_echo "$as_me: error: mythes.hxx headers not found." >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: checking for main in -lmythes" >&5 -echo $ECHO_N "checking for main in -lmythes... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for main in -lmythes" >&5 +$as_echo_n "checking for main in -lmythes... " >&6; } if test "${ac_cv_lib_mythes_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmythes $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -21352,36 +23683,48 @@ cat >>conftest.$ac_ext <<_ACEOF int main () { -main (); +return main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_mythes_main=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_mythes_main=no + ac_cv_lib_mythes_main=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_mythes_main" >&5 -echo "${ECHO_T}$ac_cv_lib_mythes_main" >&6 -if test $ac_cv_lib_mythes_main = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_mythes_main" >&5 +$as_echo "$ac_cv_lib_mythes_main" >&6; } +if test "x$ac_cv_lib_mythes_main" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBMYTHES 1 _ACEOF @@ -21389,39 +23732,38 @@ _ACEOF LIBS="-lmythes $LIBS" else - { { echo "$as_me:$LINENO: error: mythes library not found." >&5 -echo "$as_me: error: mythes library not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: mythes library not found." >&5 +$as_echo "$as_me: error: mythes library not found." >&2;} { (exit 1); exit 1; }; } fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:$LINENO: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_MYTHES=NO fi -echo "$as_me:$LINENO: checking which lpsolve to use" >&5 -echo $ECHO_N "checking which lpsolve to use... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking which lpsolve to use" >&5 +$as_echo_n "checking which lpsolve to use... " >&6; } if test -n "$with_system_lpsolve" -o -n "$with_system_libs" && \ test "$with_system_lpsolve" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:$LINENO: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_LPSOLVE=YES if test "${ac_cv_header_lpsolve_lp_lib_h+set}" = set; then - echo "$as_me:$LINENO: checking for lpsolve/lp_lib.h" >&5 -echo $ECHO_N "checking for lpsolve/lp_lib.h... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for lpsolve/lp_lib.h" >&5 +$as_echo_n "checking for lpsolve/lp_lib.h... " >&6; } if test "${ac_cv_header_lpsolve_lp_lib_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_lpsolve_lp_lib_h" >&5 -echo "${ECHO_T}$ac_cv_header_lpsolve_lp_lib_h" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_lpsolve_lp_lib_h" >&5 +$as_echo "$ac_cv_header_lpsolve_lp_lib_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking lpsolve/lp_lib.h usability" >&5 -echo $ECHO_N "checking lpsolve/lp_lib.h usability... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking lpsolve/lp_lib.h usability" >&5 +$as_echo_n "checking lpsolve/lp_lib.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -21431,33 +23773,39 @@ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking lpsolve/lp_lib.h presence" >&5 -echo $ECHO_N "checking lpsolve/lp_lib.h presence... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking lpsolve/lp_lib.h presence" >&5 +$as_echo_n "checking lpsolve/lp_lib.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -21465,143 +23813,147 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: lpsolve/lp_lib.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: lpsolve/lp_lib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: lpsolve/lp_lib.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: lpsolve/lp_lib.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: lpsolve/lp_lib.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: lpsolve/lp_lib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: lpsolve/lp_lib.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: lpsolve/lp_lib.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: lpsolve/lp_lib.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: lpsolve/lp_lib.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: lpsolve/lp_lib.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: lpsolve/lp_lib.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: lpsolve/lp_lib.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: lpsolve/lp_lib.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: lpsolve/lp_lib.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: lpsolve/lp_lib.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: lpsolve/lp_lib.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: lpsolve/lp_lib.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: lpsolve/lp_lib.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: lpsolve/lp_lib.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: lpsolve/lp_lib.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: lpsolve/lp_lib.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: lpsolve/lp_lib.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: lpsolve/lp_lib.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: lpsolve/lp_lib.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: lpsolve/lp_lib.h: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for lpsolve/lp_lib.h" >&5 -echo $ECHO_N "checking for lpsolve/lp_lib.h... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for lpsolve/lp_lib.h" >&5 +$as_echo_n "checking for lpsolve/lp_lib.h... " >&6; } if test "${ac_cv_header_lpsolve_lp_lib_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_lpsolve_lp_lib_h=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_lpsolve_lp_lib_h" >&5 -echo "${ECHO_T}$ac_cv_header_lpsolve_lp_lib_h" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_lpsolve_lp_lib_h" >&5 +$as_echo "$ac_cv_header_lpsolve_lp_lib_h" >&6; } fi -if test $ac_cv_header_lpsolve_lp_lib_h = yes; then +if test "x$ac_cv_header_lpsolve_lp_lib_h" = x""yes; then : else - { { echo "$as_me:$LINENO: error: lpsolve headers not found." >&5 -echo "$as_me: error: lpsolve headers not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: lpsolve headers not found." >&5 +$as_echo "$as_me: error: lpsolve headers not found." >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: checking for make_lp in -llpsolve55" >&5 -echo $ECHO_N "checking for make_lp in -llpsolve55... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for make_lp in -llpsolve55" >&5 +$as_echo_n "checking for make_lp in -llpsolve55... " >&6; } if test "${ac_cv_lib_lpsolve55_make_lp+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llpsolve55 $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char make_lp (); int main () { -make_lp (); +return make_lp (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_lpsolve55_make_lp=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_lpsolve55_make_lp=no + ac_cv_lib_lpsolve55_make_lp=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_lpsolve55_make_lp" >&5 -echo "${ECHO_T}$ac_cv_lib_lpsolve55_make_lp" >&6 -if test $ac_cv_lib_lpsolve55_make_lp = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_lpsolve55_make_lp" >&5 +$as_echo "$ac_cv_lib_lpsolve55_make_lp" >&6; } +if test "x$ac_cv_lib_lpsolve55_make_lp" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBLPSOLVE55 1 _ACEOF @@ -21609,95 +23961,106 @@ _ACEOF LIBS="-llpsolve55 $LIBS" else - { { echo "$as_me:$LINENO: error: lpsolve library not found or too old." >&5 -echo "$as_me: error: lpsolve library not found or too old." >&2;} + { { $as_echo "$as_me:$LINENO: error: lpsolve library not found or too old." >&5 +$as_echo "$as_me: error: lpsolve library not found or too old." >&2;} { (exit 1); exit 1; }; } fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:$LINENO: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_LPSOLVE=NO BUILD_TYPE="$BUILD_TYPE LPSOLVE" fi if test "$_os" = "Linux"; then - echo "$as_me:$LINENO: checking whether libc is >= 2.1.1" >&5 -echo $ECHO_N "checking whether libc is >= 2.1.1... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking whether libc is >= 2.1.1" >&5 +$as_echo_n "checking whether libc is >= 2.1.1... " >&6; } exec 6>/dev/null # no output - echo "$as_me:$LINENO: checking for gnu_get_libc_version in -lc" >&5 -echo $ECHO_N "checking for gnu_get_libc_version in -lc... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for gnu_get_libc_version in -lc" >&5 +$as_echo_n "checking for gnu_get_libc_version in -lc... " >&6; } if test "${ac_cv_lib_c_gnu_get_libc_version+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char gnu_get_libc_version (); int main () { -gnu_get_libc_version (); +return gnu_get_libc_version (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_c_gnu_get_libc_version=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_c_gnu_get_libc_version=no + ac_cv_lib_c_gnu_get_libc_version=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_c_gnu_get_libc_version" >&5 -echo "${ECHO_T}$ac_cv_lib_c_gnu_get_libc_version" >&6 -if test $ac_cv_lib_c_gnu_get_libc_version = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_c_gnu_get_libc_version" >&5 +$as_echo "$ac_cv_lib_c_gnu_get_libc_version" >&6; } +if test "x$ac_cv_lib_c_gnu_get_libc_version" = x""yes; then HAVE_LIBC=yes; export HAVE_LIBC fi exec 6>&1 # output on again if test "$HAVE_LIBC"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - { { echo "$as_me:$LINENO: error: no, upgrade libc" >&5 -echo "$as_me: error: no, upgrade libc" >&2;} + { { $as_echo "$as_me:$LINENO: error: no, upgrade libc" >&5 +$as_echo "$as_me: error: no, upgrade libc" >&2;} { (exit 1); exit 1; }; } fi fi if test \( "$_os" = "WINNT" \) ; then - echo "$as_me:$LINENO: checking for PSDK files" >&5 -echo $ECHO_N "checking for PSDK files... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for PSDK files" >&5 +$as_echo_n "checking for PSDK files... " >&6; } if test -z "$with_psdk_home"; then # This first line will detect a February 2003 Microsoft Platform SDK PSDK_HOME=`./oowintool --psdk-home` @@ -21718,13 +24081,13 @@ echo $ECHO_N "checking for PSDK files... $ECHO_C" >&6 PSDK_HOME=`echo $PSDK_HOME | $SED 's/\/$//'` # Problem with current PSDK (iz 49865) if test -f "$PSDK_HOME/Lib/libcp.lib"; then - { { echo "$as_me:$LINENO: error: + { { $as_echo "$as_me:$LINENO: error: Some modules do not build correctly with MS Platform SDK - April 2005 Edition if the library ($PSDK_HOME/Lib/libcp.lib) is found. Remove/rename/backup that file and restart configure. Details about this problem can be found in issue 49856." >&5 -echo "$as_me: error: +$as_echo "$as_me: error: Some modules do not build correctly with MS Platform SDK - April 2005 Edition if the library ($PSDK_HOME/Lib/libcp.lib) is found. @@ -21746,9 +24109,9 @@ problem can be found in issue 49856." >&2;} HAVE_PSDK_LIB="no" fi if test "$HAVE_PSDK_H" = "no" -o "$HAVE_PSDK_LIB" = "no"; then - { { echo "$as_me:$LINENO: error: Some (all?) PSDK files not found, please check if all needed Platform SDKs + { { $as_echo "$as_me:$LINENO: error: Some (all?) PSDK files not found, please check if all needed Platform SDKs are installed or use --with-psdk-home ." >&5 -echo "$as_me: error: Some (all?) PSDK files not found, please check if all needed Platform SDKs +$as_echo "$as_me: error: Some (all?) PSDK files not found, please check if all needed Platform SDKs are installed or use --with-psdk-home ." >&2;} { (exit 1); exit 1; }; } fi @@ -21756,31 +24119,31 @@ are installed or use --with-psdk-home ." >&2;} -o ! -x "$PSDK_HOME/bin/msidb.exe" \ -o ! -x "$PSDK_HOME/bin/uuidgen.exe" \ -o ! -x "$PSDK_HOME/bin/msitran.exe" ; then - { { echo "$as_me:$LINENO: error: Some (all) files of the Windows Installer SDK are missing, please install." >&5 -echo "$as_me: error: Some (all) files of the Windows Installer SDK are missing, please install." >&2;} + { { $as_echo "$as_me:$LINENO: error: Some (all) files of the Windows Installer SDK are missing, please install." >&5 +$as_echo "$as_me: error: Some (all) files of the Windows Installer SDK are missing, please install." >&2;} { (exit 1); exit 1; }; } fi - echo "$as_me:$LINENO: result: SDK files found ...)" >&5 -echo "${ECHO_T}SDK files found ...)" >&6 + { $as_echo "$as_me:$LINENO: result: SDK files found ...)" >&5 +$as_echo "SDK files found ...)" >&6; } if echo $PSDK_HOME | grep "v6.1" >/dev/null 2>/dev/null; then - echo "$as_me:$LINENO: result: Found Windows SDK 6.1 ($PSDK_HOME)" >&5 -echo "${ECHO_T}Found Windows SDK 6.1 ($PSDK_HOME)" >&6 + { $as_echo "$as_me:$LINENO: result: Found Windows SDK 6.1 ($PSDK_HOME)" >&5 +$as_echo "Found Windows SDK 6.1 ($PSDK_HOME)" >&6; } WINDOWS_VISTA_PSDK=TRUE elif echo $PSDK_HOME | grep "v6.0" >/dev/null 2>/dev/null; then - echo "$as_me:$LINENO: result: Found Windows SDK 6.0 ($PSDK_HOME)" >&5 -echo "${ECHO_T}Found Windows SDK 6.0 ($PSDK_HOME)" >&6 + { $as_echo "$as_me:$LINENO: result: Found Windows SDK 6.0 ($PSDK_HOME)" >&5 +$as_echo "Found Windows SDK 6.0 ($PSDK_HOME)" >&6; } WINDOWS_VISTA_PSDK=TRUE else - echo "$as_me:$LINENO: result: Found Legacy Windows Platform SDK ($PSDK_HOME)" >&5 -echo "${ECHO_T}Found Legacy Windows Platform SDK ($PSDK_HOME)" >&6 + { $as_echo "$as_me:$LINENO: result: Found Legacy Windows Platform SDK ($PSDK_HOME)" >&5 +$as_echo "Found Legacy Windows Platform SDK ($PSDK_HOME)" >&6; } fi fi if test \( "$_os" = "WINNT" \) ; then - echo "$as_me:$LINENO: checking for DirectX SDK files" >&5 -echo $ECHO_N "checking for DirectX SDK files... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for DirectX SDK files" >&5 +$as_echo_n "checking for DirectX SDK files... " >&6; } if test -z "$with_directx_home"; then if test -n "$DXSDK_DIR"; then DIRECTXSDK_HOME=`cygpath -d "$DXSDK_DIR"` @@ -21812,17 +24175,17 @@ echo $ECHO_N "checking for DirectX SDK files... $ECHO_C" >&6 fi if test -n "$ENABLE_DIRECTX"; then if test "$HAVE_DIRECTXSDK_H" = "yes" -a "$HAVE_DIRECTXSDK_LIB" = "yes"; then - echo "$as_me:$LINENO: result: found" >&5 -echo "${ECHO_T}found" >&6 + { $as_echo "$as_me:$LINENO: result: found" >&5 +$as_echo "found" >&6; } else - { { echo "$as_me:$LINENO: error: DirectX SDK files not found, please use --with-directx-home or -disable-directx." >&5 -echo "$as_me: error: DirectX SDK files not found, please use --with-directx-home or -disable-directx." >&2;} + { { $as_echo "$as_me:$LINENO: error: DirectX SDK files not found, please use --with-directx-home or -disable-directx." >&5 +$as_echo "$as_me: error: DirectX SDK files not found, please use --with-directx-home or -disable-directx." >&2;} { (exit 1); exit 1; }; } fi else DIRECTXSDK_HOME="" - echo "$as_me:$LINENO: result: disabled" >&5 -echo "${ECHO_T}disabled" >&6 + { $as_echo "$as_me:$LINENO: result: disabled" >&5 +$as_echo "disabled" >&6; } fi fi @@ -21830,14 +24193,14 @@ fi NSIS_PATH="" if test "$_os" = "WINNT" ; then - echo "$as_me:$LINENO: checking for NSIS" >&5 -echo $ECHO_N "checking for NSIS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for NSIS" >&5 +$as_echo_n "checking for NSIS... " >&6; } # Extract the first word of "nsis.exe", so it can be a program name with args. set dummy nsis.exe; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_NSIS_PATH+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $NSIS_PATH in [\\/]* | ?:[\\/]*) @@ -21850,27 +24213,28 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_NSIS_PATH="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi NSIS_PATH=$ac_cv_path_NSIS_PATH - if test -n "$NSIS_PATH"; then - echo "$as_me:$LINENO: result: $NSIS_PATH" >&5 -echo "${ECHO_T}$NSIS_PATH" >&6 + { $as_echo "$as_me:$LINENO: result: $NSIS_PATH" >&5 +$as_echo "$NSIS_PATH" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + if test -n "$NSIS_PATH"; then NSIS_PATH=`dirname "$NSIS_PATH"` fi @@ -21885,24 +24249,24 @@ fi NSIS_PATH="$nsistest" fi if test -z "$NSIS_PATH"; then - { echo "$as_me:$LINENO: WARNING: NSIS not found, no self contained installer will be build." >&5 -echo "$as_me: WARNING: NSIS not found, no self contained installer will be build." >&2;} + { $as_echo "$as_me:$LINENO: WARNING: NSIS not found, no self contained installer will be build." >&5 +$as_echo "$as_me: WARNING: NSIS not found, no self contained installer will be build." >&2;} echo "NSIS not found, no self contained installer will be build." >> warn else NSIS_PATH=`cygpath -d "$NSIS_PATH"` NSIS_PATH=`cygpath -u "$NSIS_PATH"` - echo "$as_me:$LINENO: result: found ($NSIS_PATH)" >&5 -echo "${ECHO_T}found ($NSIS_PATH)" >&6 + { $as_echo "$as_me:$LINENO: result: found ($NSIS_PATH)" >&5 +$as_echo "found ($NSIS_PATH)" >&6; } fi fi # Extract the first word of "bison", so it can be a program name with args. set dummy bison; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_BISON+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $BISON in [\\/]* | ?:[\\/]*) @@ -21915,58 +24279,59 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_BISON="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi BISON=$ac_cv_path_BISON - if test -n "$BISON"; then - echo "$as_me:$LINENO: result: $BISON" >&5 -echo "${ECHO_T}$BISON" >&6 + { $as_echo "$as_me:$LINENO: result: $BISON" >&5 +$as_echo "$BISON" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + if test -z "$BISON"; then - { { echo "$as_me:$LINENO: error: no bison found in \$PATH, install bison" >&5 -echo "$as_me: error: no bison found in \$PATH, install bison" >&2;} + { { $as_echo "$as_me:$LINENO: error: no bison found in \$PATH, install bison" >&5 +$as_echo "$as_me: error: no bison found in \$PATH, install bison" >&2;} { (exit 1); exit 1; }; } else - echo "$as_me:$LINENO: checking the bison version" >&5 -echo $ECHO_N "checking the bison version... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking the bison version" >&5 +$as_echo_n "checking the bison version... " >&6; } _bison_version=`$BISON --version | grep GNU | $SED -e 's@^[^0-9]*@@' -e 's@ .*@@' -e 's@,.*@@'`; _bison_longver=`echo $_bison_version | $AWK -F. '{ print \$1*1000+\$2}'` # Accept newer than 1.875 or older(equal) than 1.75 if test "$_bison_longver" -ge 1875 -o "$_bison_longver" -le 1075; then if test "$_bison_version" = "1.875" ; then - { echo "$as_me:$LINENO: WARNING: suspect ($BISON $_bison_version)" >&5 -echo "$as_me: WARNING: suspect ($BISON $_bison_version)" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: suspect ($BISON $_bison_version)" >&5 +$as_echo "$as_me: WARNING: suspect ($BISON $_bison_version)" >&2;} echo "Suspect ($BISON $_bison_version) suggest upgrade" >> warn else - echo "$as_me:$LINENO: result: checked ($BISON $_bison_version)" >&5 -echo "${ECHO_T}checked ($BISON $_bison_version)" >&6 + { $as_echo "$as_me:$LINENO: result: checked ($BISON $_bison_version)" >&5 +$as_echo "checked ($BISON $_bison_version)" >&6; } fi else - { { echo "$as_me:$LINENO: error: failed ($BISON $_bison_version need 1.875+ (or 1.75 and older))" >&5 -echo "$as_me: error: failed ($BISON $_bison_version need 1.875+ (or 1.75 and older))" >&2;} + { { $as_echo "$as_me:$LINENO: error: failed ($BISON $_bison_version need 1.875+ (or 1.75 and older))" >&5 +$as_echo "$as_me: error: failed ($BISON $_bison_version need 1.875+ (or 1.75 and older))" >&2;} { (exit 1); exit 1; }; } fi fi # Extract the first word of "flex", so it can be a program name with args. set dummy flex; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_FLEX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $FLEX in [\\/]* | ?:[\\/]*) @@ -21979,38 +24344,39 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_FLEX="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi FLEX=$ac_cv_path_FLEX - if test -n "$FLEX"; then - echo "$as_me:$LINENO: result: $FLEX" >&5 -echo "${ECHO_T}$FLEX" >&6 + { $as_echo "$as_me:$LINENO: result: $FLEX" >&5 +$as_echo "$FLEX" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + if test -z "$FLEX"; then - { { echo "$as_me:$LINENO: error: no flex found in \$PATH, install flex" >&5 -echo "$as_me: error: no flex found in \$PATH, install flex" >&2;} + { { $as_echo "$as_me:$LINENO: error: no flex found in \$PATH, install flex" >&5 +$as_echo "$as_me: error: no flex found in \$PATH, install flex" >&2;} { (exit 1); exit 1; }; } fi # Extract the first word of "patch", so it can be a program name with args. set dummy patch; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PATCH+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $PATCH in [\\/]* | ?:[\\/]*) @@ -22023,30 +24389,31 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PATCH="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi PATCH=$ac_cv_path_PATCH - if test -n "$PATCH"; then - echo "$as_me:$LINENO: result: $PATCH" >&5 -echo "${ECHO_T}$PATCH" >&6 + { $as_echo "$as_me:$LINENO: result: $PATCH" >&5 +$as_echo "$PATCH" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + if test -z "$PATCH"; then - { { echo "$as_me:$LINENO: error: \\"patch\\" not found in \$PATH, install the development tool named\\"patch\"\" >&5 -echo "$as_me: error: \\"patch\\" not found in \$PATH, install the development tool named\\"patch\"\" >&2;} + { { $as_echo "$as_me:$LINENO: error: \\"patch\\" not found in \$PATH, install the development tool named\\"patch\"\" >&5 +$as_echo "$as_me: error: \\"patch\\" not found in \$PATH, install the development tool named\\"patch\"\" >&2;} { (exit 1); exit 1; }; } fi @@ -22057,20 +24424,20 @@ if test "$_os" = "SunOS" -o "$_os" = "FreeBSD" -o "$_os" = "Darwin"; then if test -x "$with_gnu_patch"; then GNUPATCH=$with_gnu_patch else - { { echo "$as_me:$LINENO: error: --with-gnu-patch did not point to an executable" >&5 -echo "$as_me: error: --with-gnu-patch did not point to an executable" >&2;} + { { $as_echo "$as_me:$LINENO: error: --with-gnu-patch did not point to an executable" >&5 +$as_echo "$as_me: error: --with-gnu-patch did not point to an executable" >&2;} { (exit 1); exit 1; }; } fi fi - echo "$as_me:$LINENO: checking whether $GNUPATCH is GNU patch" >&5 -echo $ECHO_N "checking whether $GNUPATCH is GNU patch... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking whether $GNUPATCH is GNU patch" >&5 +$as_echo_n "checking whether $GNUPATCH is GNU patch... " >&6; } if $GNUPATCH --version | grep "Free Software Foundation" >/dev/null 2>/dev/null; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - { { echo "$as_me:$LINENO: error: no, GNU patch needed. install or specify with --with-gnu-patch=/path/to/it" >&5 -echo "$as_me: error: no, GNU patch needed. install or specify with --with-gnu-patch=/path/to/it" >&2;} + { { $as_echo "$as_me:$LINENO: error: no, GNU patch needed. install or specify with --with-gnu-patch=/path/to/it" >&5 +$as_echo "$as_me: error: no, GNU patch needed. install or specify with --with-gnu-patch=/path/to/it" >&2;} { (exit 1); exit 1; }; } fi @@ -22080,10 +24447,10 @@ echo "$as_me: error: no, GNU patch needed. install or specify with --with-gnu-pa do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_GNUCP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $GNUCP in [\\/]* | ?:[\\/]*) @@ -22096,62 +24463,63 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GNUCP="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi GNUCP=$ac_cv_path_GNUCP - if test -n "$GNUCP"; then - echo "$as_me:$LINENO: result: $GNUCP" >&5 -echo "${ECHO_T}$GNUCP" >&6 + { $as_echo "$as_me:$LINENO: result: $GNUCP" >&5 +$as_echo "$GNUCP" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$GNUCP" && break done if test -z $GNUCP; then - { { echo "$as_me:$LINENO: error: Neither gnucp nor cp found. Install GNU cp and/or specify --with-gnu-cp=/path/to/it" >&5 -echo "$as_me: error: Neither gnucp nor cp found. Install GNU cp and/or specify --with-gnu-cp=/path/to/it" >&2;} + { { $as_echo "$as_me:$LINENO: error: Neither gnucp nor cp found. Install GNU cp and/or specify --with-gnu-cp=/path/to/it" >&5 +$as_echo "$as_me: error: Neither gnucp nor cp found. Install GNU cp and/or specify --with-gnu-cp=/path/to/it" >&2;} { (exit 1); exit 1; }; } fi else if test -x "$with_gnu_cp"; then GNUCP=$with_gnu_cp else - { { echo "$as_me:$LINENO: error: --with-gnu-cp did not point to an executable" >&5 -echo "$as_me: error: --with-gnu-cp did not point to an executable" >&2;} + { { $as_echo "$as_me:$LINENO: error: --with-gnu-cp did not point to an executable" >&5 +$as_echo "$as_me: error: --with-gnu-cp did not point to an executable" >&2;} { (exit 1); exit 1; }; } fi fi - echo "$as_me:$LINENO: checking whether $GNUCP is GNU cp" >&5 -echo $ECHO_N "checking whether $GNUCP is GNU cp... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking whether $GNUCP is GNU cp" >&5 +$as_echo_n "checking whether $GNUCP is GNU cp... " >&6; } if $GNUCP --version 2>/dev/null | grep "Free Software Foundation" >/dev/null 2>/dev/null; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else if $GNUCP --version 2>/dev/null | grep "GNU fileutils" >/dev/null 2>/dev/null; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else if test "$_os" = "Darwin"; then GNUCP='' - echo "$as_me:$LINENO: result: no gnucp found - using the system's cp command" >&5 -echo "${ECHO_T}no gnucp found - using the system's cp command" >&6 + { $as_echo "$as_me:$LINENO: result: no gnucp found - using the system's cp command" >&5 +$as_echo "no gnucp found - using the system's cp command" >&6; } else - { { echo "$as_me:$LINENO: error: no, GNU cp needed. install or specify with --with-gnu-cp=/path/to/it" >&5 -echo "$as_me: error: no, GNU cp needed. install or specify with --with-gnu-cp=/path/to/it" >&2;} + { { $as_echo "$as_me:$LINENO: error: no, GNU cp needed. install or specify with --with-gnu-cp=/path/to/it" >&5 +$as_echo "$as_me: error: no, GNU cp needed. install or specify with --with-gnu-cp=/path/to/it" >&2;} { (exit 1); exit 1; }; } fi fi @@ -22165,10 +24533,10 @@ if test "$_os" = "WINNT"; then CYGWIN_PATH="" # Extract the first word of "bash", so it can be a program name with args. set dummy bash; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_CYGWIN_PATH+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $CYGWIN_PATH in [\\/]* | ?:[\\/]*) @@ -22181,27 +24549,28 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CYGWIN_PATH="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi CYGWIN_PATH=$ac_cv_path_CYGWIN_PATH - if test -n "$CYGWIN_PATH"; then - echo "$as_me:$LINENO: result: $CYGWIN_PATH" >&5 -echo "${ECHO_T}$CYGWIN_PATH" >&6 + { $as_echo "$as_me:$LINENO: result: $CYGWIN_PATH" >&5 +$as_echo "$CYGWIN_PATH" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + CYGWIN_PATH=`dirname "$CYGWIN_PATH"` fi if test -z "$CYGWIN_PATH"; then @@ -22210,18 +24579,18 @@ fi if test "$_os" = "WINNT" -a "$WITH_MINGWIN" != "yes"; then - echo "$as_me:$LINENO: checking ml.exe assembler path" >&5 -echo $ECHO_N "checking ml.exe assembler path... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking ml.exe assembler path" >&5 +$as_echo_n "checking ml.exe assembler path... " >&6; } if test -n "$with_asm_home"; then with_asm_home=`cygpath -u "$with_asm_home"` fi if test ! -x "$with_asm_home/ml.exe"; then # Extract the first word of "ml.exe", so it can be a program name with args. set dummy ml.exe; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_ML_EXE+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $ML_EXE in [\\/]* | ?:[\\/]*) @@ -22234,35 +24603,36 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ML_EXE="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi ML_EXE=$ac_cv_path_ML_EXE - if test -n "$ML_EXE"; then - echo "$as_me:$LINENO: result: $ML_EXE" >&5 -echo "${ECHO_T}$ML_EXE" >&6 + { $as_echo "$as_me:$LINENO: result: $ML_EXE" >&5 +$as_echo "$ML_EXE" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + if test -z "$ML_EXE"; then if test -x "$with_cl_home/bin/ml.exe"; then with_asm_home=$with_cl_home/bin - echo "$as_me:$LINENO: result: found ($with_asm_home)" >&5 -echo "${ECHO_T}found ($with_asm_home)" >&6 + { $as_echo "$as_me:$LINENO: result: found ($with_asm_home)" >&5 +$as_echo "found ($with_asm_home)" >&6; } else - { { echo "$as_me:$LINENO: error: Configure did not find ml.exe assembler." >&5 -echo "$as_me: error: Configure did not find ml.exe assembler." >&2;} + { { $as_echo "$as_me:$LINENO: error: Configure did not find ml.exe assembler." >&5 +$as_echo "$as_me: error: Configure did not find ml.exe assembler." >&2;} { (exit 1); exit 1; }; } fi else @@ -22274,8 +24644,8 @@ else fi ASM_HOME="$with_asm_home" if test -n "$ASM_HOME"; then - echo "$as_me:$LINENO: result: $ASM_HOME" >&5 -echo "${ECHO_T}$ASM_HOME" >&6 + { $as_echo "$as_me:$LINENO: result: $ASM_HOME" >&5 +$as_echo "$ASM_HOME" >&6; } fi @@ -22292,10 +24662,10 @@ if test -n "$with_zip_home" ; then else # Extract the first word of "zip", so it can be a program name with args. set dummy zip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_ZIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $ZIP in [\\/]* | ?:[\\/]*) @@ -22308,33 +24678,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ZIP="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi ZIP=$ac_cv_path_ZIP - if test -n "$ZIP"; then - echo "$as_me:$LINENO: result: $ZIP" >&5 -echo "${ECHO_T}$ZIP" >&6 + { $as_echo "$as_me:$LINENO: result: $ZIP" >&5 +$as_echo "$ZIP" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + # Extract the first word of "unzip", so it can be a program name with args. set dummy unzip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_UNZIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $UNZIP in [\\/]* | ?:[\\/]*) @@ -22347,48 +24718,49 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_UNZIP="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi UNZIP=$ac_cv_path_UNZIP - if test -n "$UNZIP"; then - echo "$as_me:$LINENO: result: $UNZIP" >&5 -echo "${ECHO_T}$UNZIP" >&6 + { $as_echo "$as_me:$LINENO: result: $UNZIP" >&5 +$as_echo "$UNZIP" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + ZIP_HOME=`dirname "$ZIP"` fi if test -z "$ZIP" -o -z "$UNZIP"; then - { { echo "$as_me:$LINENO: error: Zip/Unzip are required to build, please install or use --with-zip-home" >&5 -echo "$as_me: error: Zip/Unzip are required to build, please install or use --with-zip-home" >&2;} + { { $as_echo "$as_me:$LINENO: error: Zip/Unzip are required to build, please install or use --with-zip-home" >&5 +$as_echo "$as_me: error: Zip/Unzip are required to build, please install or use --with-zip-home" >&2;} { (exit 1); exit 1; }; } fi if test "$_os" = "WINNT"; then if test "$with_use_shell" = "4nt" ; then if test -z "`$ZIP -h | grep -i WinNT`" ; then -{ { echo "$as_me:$LINENO: error: $ZIP found in the path is not the required native Windows Version 2.3 of Info-ZIPs zip.exe. +{ { $as_echo "$as_me:$LINENO: error: $ZIP found in the path is not the required native Windows Version 2.3 of Info-ZIPs zip.exe. Probably there is a cygwin version in the path." >&5 -echo "$as_me: error: $ZIP found in the path is not the required native Windows Version 2.3 of Info-ZIPs zip.exe. +$as_echo "$as_me: error: $ZIP found in the path is not the required native Windows Version 2.3 of Info-ZIPs zip.exe. Probably there is a cygwin version in the path." >&2;} { (exit 1); exit 1; }; } fi else if test -n "`$ZIP -h | grep -i WinNT`" ; then -{ { echo "$as_me:$LINENO: error: $ZIP found in the path is not the required cygwin version of Info-ZIPs zip.exe." >&5 -echo "$as_me: error: $ZIP found in the path is not the required cygwin version of Info-ZIPs zip.exe." >&2;} +{ { $as_echo "$as_me:$LINENO: error: $ZIP found in the path is not the required cygwin version of Info-ZIPs zip.exe." >&5 +$as_echo "$as_me: error: $ZIP found in the path is not the required cygwin version of Info-ZIPs zip.exe." >&2;} { (exit 1); exit 1; }; } fi fi @@ -22396,18 +24768,18 @@ fi if test "$_os" = "WINNT"; then - echo "$as_me:$LINENO: checking for unicows.dll" >&5 -echo $ECHO_N "checking for unicows.dll... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for unicows.dll" >&5 +$as_echo_n "checking for unicows.dll... " >&6; } if test -x ./external/unicows/unicows.dll; then - echo "$as_me:$LINENO: result: found" >&5 -echo "${ECHO_T}found" >&6 + { $as_echo "$as_me:$LINENO: result: found" >&5 +$as_echo "found" >&6; } else - { { echo "$as_me:$LINENO: error: The Microsoft Layer for Unicode (unicows.dll) is missing in external/unicows/. + { { $as_echo "$as_me:$LINENO: error: The Microsoft Layer for Unicode (unicows.dll) is missing in external/unicows/. Get it from the Microsoft site and put it into external/unicows. (Note: Microsoft seems to enjoy changing the exact location of this file. You may have to search Microsoft's website.) Last time it was seen at: ." >&5 -echo "$as_me: error: The Microsoft Layer for Unicode (unicows.dll) is missing in external/unicows/. +$as_echo "$as_me: error: The Microsoft Layer for Unicode (unicows.dll) is missing in external/unicows/. Get it from the Microsoft site and put it into external/unicows. (Note: Microsoft seems to enjoy changing the exact location of this file. You may have to search Microsoft's website.) Last time it was seen at: @@ -22417,18 +24789,18 @@ may have to search Microsoft's website.) Last time it was seen at: fi if test "$_os" = "WINNT"; then - echo "$as_me:$LINENO: checking for dbghelp.dll" >&5 -echo $ECHO_N "checking for dbghelp.dll... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for dbghelp.dll" >&5 +$as_echo_n "checking for dbghelp.dll... " >&6; } if test -x ./external/dbghelp/dbghelp.dll; then - echo "$as_me:$LINENO: result: found" >&5 -echo "${ECHO_T}found" >&6 + { $as_echo "$as_me:$LINENO: result: found" >&5 +$as_echo "found" >&6; } else - { { echo "$as_me:$LINENO: error: dbghelp.dll is missing in external/dbghelp/. + { { $as_echo "$as_me:$LINENO: error: dbghelp.dll is missing in external/dbghelp/. Get it from the Microsoft site and put it into external/dbghelp. (Note: Microsoft seems to enjoy changing the exact location of this file. You may have to search Microsoft's website.) Last time it was seen at: ." >&5 -echo "$as_me: error: dbghelp.dll is missing in external/dbghelp/. +$as_echo "$as_me: error: dbghelp.dll is missing in external/dbghelp/. Get it from the Microsoft site and put it into external/dbghelp. (Note: Microsoft seems to enjoy changing the exact location of this file. You may have to search Microsoft's website.) Last time it was seen at: @@ -22441,24 +24813,24 @@ if test "$_os" = "WINNT" -a "$WITH_MINGWIN" != "yes"; then if ./oowintool --msvc-copy-dlls ./external/msvcp ; then : else - { { echo "$as_me:$LINENO: error: oowintool failed to copy CRT" >&5 -echo "$as_me: error: oowintool failed to copy CRT" >&2;} + { { $as_echo "$as_me:$LINENO: error: oowintool failed to copy CRT" >&5 +$as_echo "$as_me: error: oowintool failed to copy CRT" >&2;} { (exit 1); exit 1; }; } fi fi if test "$_os" = "WINNT"; then - echo "$as_me:$LINENO: checking for gdiplus.dll" >&5 -echo $ECHO_N "checking for gdiplus.dll... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for gdiplus.dll" >&5 +$as_echo_n "checking for gdiplus.dll... " >&6; } if test -x ./external/gdiplus/gdiplus.dll; then - echo "$as_me:$LINENO: result: found" >&5 -echo "${ECHO_T}found" >&6 + { $as_echo "$as_me:$LINENO: result: found" >&5 +$as_echo "found" >&6; } else - { { echo "$as_me:$LINENO: error: gdiplus.dll is missing in external/gdiplus/. + { { $as_echo "$as_me:$LINENO: error: gdiplus.dll is missing in external/gdiplus/. Get it from the Microsoft site and put it into external/gdiplus. You may have to search Microsoft's website. Last time it was seen at: ." >&5 -echo "$as_me: error: gdiplus.dll is missing in external/gdiplus/. +$as_echo "$as_me: error: gdiplus.dll is missing in external/gdiplus/. Get it from the Microsoft site and put it into external/gdiplus. You may have to search Microsoft's website. Last time it was seen at: ." >&2;} @@ -22472,11 +24844,11 @@ fi if test "$_os" = "WINNT"; then if test "$WITH_MINGWIN" = "yes" || test "$COMEX" -ge "10"; then - echo "$as_me:$LINENO: checking for instmsia.exe/instmsiw.exe" >&5 -echo $ECHO_N "checking for instmsia.exe/instmsiw.exe... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for instmsia.exe/instmsiw.exe" >&5 +$as_echo_n "checking for instmsia.exe/instmsiw.exe... " >&6; } if test -x ./external/msi/instmsia.exe -a -x ./external/msi/instmsiw.exe; then - echo "$as_me:$LINENO: result: found" >&5 -echo "${ECHO_T}found" >&6 + { $as_echo "$as_me:$LINENO: result: found" >&5 +$as_echo "found" >&6; } else MSIAPATH=`/bin/find "$COMPATH/../.." -iname instmsia.exe | head -n 1` MSIWPATH=`/bin/find "$COMPATH/../.." -iname instmsiw.exe | head -n 1` @@ -22485,36 +24857,36 @@ echo "${ECHO_T}found" >&6 cp "$MSIWPATH" ./external/msi/ && chmod +x ./external/msi/instmsiw.exe && MSIWCOPY="OK" fi if test -z "$MSIACOPY" -o -z "$MSIWCOPY"; then - { { echo "$as_me:$LINENO: error: instmsia.exe and/or instmsiw.exe are/is missing in the default location. + { { $as_echo "$as_me:$LINENO: error: instmsia.exe and/or instmsiw.exe are/is missing in the default location. These programs are part of the Visual Studio installation and should be found in a directory similar to: \"c:\\Program Files\\Microsoft Visual Studio .NET 2003\\Common7\\Tools\\Deployment\\MsiRedist\\\" As the automatic detection fails please copy the files to external/msi/." >&5 -echo "$as_me: error: instmsia.exe and/or instmsiw.exe are/is missing in the default location. +$as_echo "$as_me: error: instmsia.exe and/or instmsiw.exe are/is missing in the default location. These programs are part of the Visual Studio installation and should be found in a directory similar to: \"c:\\Program Files\\Microsoft Visual Studio .NET 2003\\Common7\\Tools\\Deployment\\MsiRedist\\\" As the automatic detection fails please copy the files to external/msi/." >&2;} { (exit 1); exit 1; }; } else - echo "$as_me:$LINENO: result: found and copied" >&5 -echo "${ECHO_T}found and copied" >&6 + { $as_echo "$as_me:$LINENO: result: found and copied" >&5 +$as_echo "found and copied" >&6; } fi fi fi fi -echo "$as_me:$LINENO: checking which polygon clipping code to use" >&5 -echo $ECHO_N "checking which polygon clipping code to use... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking which polygon clipping code to use" >&5 +$as_echo_n "checking which polygon clipping code to use... " >&6; } WITH_GPC=NO if test "$with_gpc" != "no" && test "$without_gpc" != "yes"; then WITH_GPC=YES - echo "$as_me:$LINENO: result: GPC" >&5 -echo "${ECHO_T}GPC" >&6 + { $as_echo "$as_me:$LINENO: result: GPC" >&5 +$as_echo "GPC" >&6; } - echo "$as_me:$LINENO: checking for GPC files" >&5 -echo $ECHO_N "checking for GPC files... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for GPC files" >&5 +$as_echo_n "checking for GPC files... " >&6; } if test -f ./external/gpc/gpc.h; then HAVE_GPC_H="yes" else @@ -22527,25 +24899,25 @@ echo $ECHO_N "checking for GPC files... $ECHO_C" >&6 fi if test "$HAVE_GPC_H" = "yes" -a "$HAVE_GPC_C" = "yes"; then - echo "$as_me:$LINENO: result: GPC files found" >&5 -echo "${ECHO_T}GPC files found" >&6 + { $as_echo "$as_me:$LINENO: result: GPC files found" >&5 +$as_echo "GPC files found" >&6; } else - { { echo "$as_me:$LINENO: error: GPC files not found + { { $as_echo "$as_me:$LINENO: error: GPC files not found ftp://ftp.cs.man.ac.uk/pub/toby/gpc/gpc231.tar.Z and untar in external/gpc, or use basegfx' implementation using --without-gpc" >&5 -echo "$as_me: error: GPC files not found +$as_echo "$as_me: error: GPC files not found ftp://ftp.cs.man.ac.uk/pub/toby/gpc/gpc231.tar.Z and untar in external/gpc, or use basegfx' implementation using --without-gpc" >&2;} { (exit 1); exit 1; }; } fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:$LINENO: result: internal" >&5 +$as_echo "internal" >&6; } fi -echo "$as_me:$LINENO: checking which VCLplugs shall be built" >&5 -echo $ECHO_N "checking which VCLplugs shall be built... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking which VCLplugs shall be built" >&5 +$as_echo_n "checking which VCLplugs shall be built... " >&6; } ENABLE_GTK="" if test "x$enable_gtk" = "xyes"; then ENABLE_GTK="TRUE" @@ -22561,31 +24933,31 @@ fi if test -z "$R"; then - echo "$as_me:$LINENO: result: none" >&5 -echo "${ECHO_T}none" >&6 + { $as_echo "$as_me:$LINENO: result: none" >&5 +$as_echo "none" >&6; } else - echo "$as_me:$LINENO: result: $R" >&5 -echo "${ECHO_T}$R" >&6 + { $as_echo "$as_me:$LINENO: result: $R" >&5 +$as_echo "$R" >&6; } fi ENABLE_GCONF="" -echo "$as_me:$LINENO: checking whether to enable GConf support" >&5 -echo $ECHO_N "checking whether to enable GConf support... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to enable GConf support" >&5 +$as_echo_n "checking whether to enable GConf support... " >&6; } if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$_os" != "OS2" -a "$enable_gconf" = "yes"; then ENABLE_GCONF="TRUE" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=no if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -22598,28 +24970,29 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -22630,25 +25003,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for gconf-2.0 " >&5 -echo $ECHO_N "checking for gconf-2.0 ... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for gconf-2.0 " >&5 +$as_echo_n "checking for gconf-2.0 ... " >&6; } if $PKG_CONFIG --exists "gconf-2.0 " ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking GCONF_CFLAGS" >&5 -echo $ECHO_N "checking GCONF_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking GCONF_CFLAGS" >&5 +$as_echo_n "checking GCONF_CFLAGS... " >&6; } GCONF_CFLAGS=`$PKG_CONFIG --cflags "gconf-2.0 "` - echo "$as_me:$LINENO: result: $GCONF_CFLAGS" >&5 -echo "${ECHO_T}$GCONF_CFLAGS" >&6 + { $as_echo "$as_me:$LINENO: result: $GCONF_CFLAGS" >&5 +$as_echo "$GCONF_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking GCONF_LIBS" >&5 -echo $ECHO_N "checking GCONF_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking GCONF_LIBS" >&5 +$as_echo_n "checking GCONF_LIBS... " >&6; } GCONF_LIBS=`$PKG_CONFIG --libs "gconf-2.0 "` - echo "$as_me:$LINENO: result: $GCONF_LIBS" >&5 -echo "${ECHO_T}$GCONF_LIBS" >&6 + { $as_echo "$as_me:$LINENO: result: $GCONF_LIBS" >&5 +$as_echo "$GCONF_LIBS" >&6; } else GCONF_CFLAGS="" GCONF_LIBS="" @@ -22669,35 +25042,35 @@ echo "${ECHO_T}$GCONF_LIBS" >&6 if test $succeeded = yes; then : else - { { echo "$as_me:$LINENO: error: Library requirements (gconf-2.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 -echo "$as_me: error: Library requirements (gconf-2.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} + { { $as_echo "$as_me:$LINENO: error: Library requirements (gconf-2.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 +$as_echo "$as_me: error: Library requirements (gconf-2.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} { (exit 1); exit 1; }; } fi else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi ENABLE_GNOMEVFS="" -echo "$as_me:$LINENO: checking whether to enable GNOME VFS support" >&5 -echo $ECHO_N "checking whether to enable GNOME VFS support... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to enable GNOME VFS support" >&5 +$as_echo_n "checking whether to enable GNOME VFS support... " >&6; } if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gnome_vfs" = "yes"; then ENABLE_GNOMEVFS="TRUE" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=no if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -22710,28 +25083,29 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -22742,25 +25116,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for gnome-vfs-2.0 >= 2.6.0 " >&5 -echo $ECHO_N "checking for gnome-vfs-2.0 >= 2.6.0 ... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for gnome-vfs-2.0 >= 2.6.0 " >&5 +$as_echo_n "checking for gnome-vfs-2.0 >= 2.6.0 ... " >&6; } if $PKG_CONFIG --exists "gnome-vfs-2.0 >= 2.6.0 " ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking GNOMEVFS_CFLAGS" >&5 -echo $ECHO_N "checking GNOMEVFS_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking GNOMEVFS_CFLAGS" >&5 +$as_echo_n "checking GNOMEVFS_CFLAGS... " >&6; } GNOMEVFS_CFLAGS=`$PKG_CONFIG --cflags "gnome-vfs-2.0 >= 2.6.0 "` - echo "$as_me:$LINENO: result: $GNOMEVFS_CFLAGS" >&5 -echo "${ECHO_T}$GNOMEVFS_CFLAGS" >&6 + { $as_echo "$as_me:$LINENO: result: $GNOMEVFS_CFLAGS" >&5 +$as_echo "$GNOMEVFS_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking GNOMEVFS_LIBS" >&5 -echo $ECHO_N "checking GNOMEVFS_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking GNOMEVFS_LIBS" >&5 +$as_echo_n "checking GNOMEVFS_LIBS... " >&6; } GNOMEVFS_LIBS=`$PKG_CONFIG --libs "gnome-vfs-2.0 >= 2.6.0 "` - echo "$as_me:$LINENO: result: $GNOMEVFS_LIBS" >&5 -echo "${ECHO_T}$GNOMEVFS_LIBS" >&6 + { $as_echo "$as_me:$LINENO: result: $GNOMEVFS_LIBS" >&5 +$as_echo "$GNOMEVFS_LIBS" >&6; } else GNOMEVFS_CFLAGS="" GNOMEVFS_LIBS="" @@ -22781,8 +25155,8 @@ echo "${ECHO_T}$GNOMEVFS_LIBS" >&6 if test $succeeded = yes; then : else - { { echo "$as_me:$LINENO: error: Library requirements (gnome-vfs-2.0 >= 2.6.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 -echo "$as_me: error: Library requirements (gnome-vfs-2.0 >= 2.6.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} + { { $as_echo "$as_me:$LINENO: error: Library requirements (gnome-vfs-2.0 >= 2.6.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 +$as_echo "$as_me: error: Library requirements (gnome-vfs-2.0 >= 2.6.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} { (exit 1); exit 1; }; } fi @@ -22793,10 +25167,10 @@ echo "$as_me: error: Library requirements (gnome-vfs-2.0 >= 2.6.0 ) not met; con if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -22809,28 +25183,29 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -22841,25 +25216,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for gconf-2.0 " >&5 -echo $ECHO_N "checking for gconf-2.0 ... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for gconf-2.0 " >&5 +$as_echo_n "checking for gconf-2.0 ... " >&6; } if $PKG_CONFIG --exists "gconf-2.0 " ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking GCONF_CFLAGS" >&5 -echo $ECHO_N "checking GCONF_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking GCONF_CFLAGS" >&5 +$as_echo_n "checking GCONF_CFLAGS... " >&6; } GCONF_CFLAGS=`$PKG_CONFIG --cflags "gconf-2.0 "` - echo "$as_me:$LINENO: result: $GCONF_CFLAGS" >&5 -echo "${ECHO_T}$GCONF_CFLAGS" >&6 + { $as_echo "$as_me:$LINENO: result: $GCONF_CFLAGS" >&5 +$as_echo "$GCONF_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking GCONF_LIBS" >&5 -echo $ECHO_N "checking GCONF_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking GCONF_LIBS" >&5 +$as_echo_n "checking GCONF_LIBS... " >&6; } GCONF_LIBS=`$PKG_CONFIG --libs "gconf-2.0 "` - echo "$as_me:$LINENO: result: $GCONF_LIBS" >&5 -echo "${ECHO_T}$GCONF_LIBS" >&6 + { $as_echo "$as_me:$LINENO: result: $GCONF_LIBS" >&5 +$as_echo "$GCONF_LIBS" >&6; } else GCONF_CFLAGS="" GCONF_LIBS="" @@ -22880,15 +25255,15 @@ echo "${ECHO_T}$GCONF_LIBS" >&6 if test $succeeded = yes; then : else - { { echo "$as_me:$LINENO: error: Library requirements (gconf-2.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 -echo "$as_me: error: Library requirements (gconf-2.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} + { { $as_echo "$as_me:$LINENO: error: Library requirements (gconf-2.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 +$as_echo "$as_me: error: Library requirements (gconf-2.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} { (exit 1); exit 1; }; } fi fi else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -22906,10 +25281,10 @@ if test "$test_gtk" = "yes"; then if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -22922,28 +25297,29 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -22954,25 +25330,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for gtk+-2.0 >= 2.4 gdk-pixbuf-xlib-2.0 >= 2.2 " >&5 -echo $ECHO_N "checking for gtk+-2.0 >= 2.4 gdk-pixbuf-xlib-2.0 >= 2.2 ... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for gtk+-2.0 >= 2.4 gdk-pixbuf-xlib-2.0 >= 2.2 " >&5 +$as_echo_n "checking for gtk+-2.0 >= 2.4 gdk-pixbuf-xlib-2.0 >= 2.2 ... " >&6; } if $PKG_CONFIG --exists "gtk+-2.0 >= 2.4 gdk-pixbuf-xlib-2.0 >= 2.2 " ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking GTK_CFLAGS" >&5 -echo $ECHO_N "checking GTK_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking GTK_CFLAGS" >&5 +$as_echo_n "checking GTK_CFLAGS... " >&6; } GTK_CFLAGS=`$PKG_CONFIG --cflags "gtk+-2.0 >= 2.4 gdk-pixbuf-xlib-2.0 >= 2.2 "` - echo "$as_me:$LINENO: result: $GTK_CFLAGS" >&5 -echo "${ECHO_T}$GTK_CFLAGS" >&6 + { $as_echo "$as_me:$LINENO: result: $GTK_CFLAGS" >&5 +$as_echo "$GTK_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking GTK_LIBS" >&5 -echo $ECHO_N "checking GTK_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking GTK_LIBS" >&5 +$as_echo_n "checking GTK_LIBS... " >&6; } GTK_LIBS=`$PKG_CONFIG --libs "gtk+-2.0 >= 2.4 gdk-pixbuf-xlib-2.0 >= 2.2 "` - echo "$as_me:$LINENO: result: $GTK_LIBS" >&5 -echo "${ECHO_T}$GTK_LIBS" >&6 + { $as_echo "$as_me:$LINENO: result: $GTK_LIBS" >&5 +$as_echo "$GTK_LIBS" >&6; } else GTK_CFLAGS="" GTK_LIBS="" @@ -22993,8 +25369,8 @@ echo "${ECHO_T}$GTK_LIBS" >&6 if test $succeeded = yes; then : else - { { echo "$as_me:$LINENO: error: requirements to build the gtk-plugin not met. Use --disable-gtk or install the missing packages" >&5 -echo "$as_me: error: requirements to build the gtk-plugin not met. Use --disable-gtk or install the missing packages" >&2;} + { { $as_echo "$as_me:$LINENO: error: requirements to build the gtk-plugin not met. Use --disable-gtk or install the missing packages" >&5 +$as_echo "$as_me: error: requirements to build the gtk-plugin not met. Use --disable-gtk or install the missing packages" >&2;} { (exit 1); exit 1; }; } fi @@ -23005,22 +25381,22 @@ echo "$as_me: error: requirements to build the gtk-plugin not met. Use --disable BUILD_TYPE="$BUILD_TYPE SYSTRAY_GTK" fi - echo "$as_me:$LINENO: checking whether to enable DBUS support" >&5 -echo $ECHO_N "checking whether to enable DBUS support... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking whether to enable DBUS support" >&5 +$as_echo_n "checking whether to enable DBUS support... " >&6; } if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_dbus" = "yes"; then ENABLE_DBUS="TRUE" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=no if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -23033,28 +25409,29 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -23065,25 +25442,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for dbus-glib-1 >= 0.70 " >&5 -echo $ECHO_N "checking for dbus-glib-1 >= 0.70 ... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for dbus-glib-1 >= 0.70 " >&5 +$as_echo_n "checking for dbus-glib-1 >= 0.70 ... " >&6; } if $PKG_CONFIG --exists "dbus-glib-1 >= 0.70 " ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking DBUS_CFLAGS" >&5 -echo $ECHO_N "checking DBUS_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking DBUS_CFLAGS" >&5 +$as_echo_n "checking DBUS_CFLAGS... " >&6; } DBUS_CFLAGS=`$PKG_CONFIG --cflags "dbus-glib-1 >= 0.70 "` - echo "$as_me:$LINENO: result: $DBUS_CFLAGS" >&5 -echo "${ECHO_T}$DBUS_CFLAGS" >&6 + { $as_echo "$as_me:$LINENO: result: $DBUS_CFLAGS" >&5 +$as_echo "$DBUS_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking DBUS_LIBS" >&5 -echo $ECHO_N "checking DBUS_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking DBUS_LIBS" >&5 +$as_echo_n "checking DBUS_LIBS... " >&6; } DBUS_LIBS=`$PKG_CONFIG --libs "dbus-glib-1 >= 0.70 "` - echo "$as_me:$LINENO: result: $DBUS_LIBS" >&5 -echo "${ECHO_T}$DBUS_LIBS" >&6 + { $as_echo "$as_me:$LINENO: result: $DBUS_LIBS" >&5 +$as_echo "$DBUS_LIBS" >&6; } else DBUS_CFLAGS="" DBUS_LIBS="" @@ -23104,37 +25481,37 @@ echo "${ECHO_T}$DBUS_LIBS" >&6 if test $succeeded = yes; then : else - { { echo "$as_me:$LINENO: error: Library requirements (dbus-glib-1 >= 0.70 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 -echo "$as_me: error: Library requirements (dbus-glib-1 >= 0.70 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} + { { $as_echo "$as_me:$LINENO: error: Library requirements (dbus-glib-1 >= 0.70 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 +$as_echo "$as_me: error: Library requirements (dbus-glib-1 >= 0.70 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} { (exit 1); exit 1; }; } fi else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi - echo "$as_me:$LINENO: checking whether to enable GIO support" >&5 -echo $ECHO_N "checking whether to enable GIO support... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking whether to enable GIO support" >&5 +$as_echo_n "checking whether to enable GIO support... " >&6; } if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gio" = "yes"; then if test "$ENABLE_GNOMEVFS" = "TRUE" ; then - { { echo "$as_me:$LINENO: error: please use --enable-gio only together with --disable-gnome-vfs." >&5 -echo "$as_me: error: please use --enable-gio only together with --disable-gnome-vfs." >&2;} + { { $as_echo "$as_me:$LINENO: error: please use --enable-gio only together with --disable-gnome-vfs." >&5 +$as_echo "$as_me: error: please use --enable-gio only together with --disable-gnome-vfs." >&2;} { (exit 1); exit 1; }; } fi ENABLE_GIO="TRUE" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=no if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -23147,28 +25524,29 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -23179,25 +25557,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for gio-2.0 " >&5 -echo $ECHO_N "checking for gio-2.0 ... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for gio-2.0 " >&5 +$as_echo_n "checking for gio-2.0 ... " >&6; } if $PKG_CONFIG --exists "gio-2.0 " ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking GIO_CFLAGS" >&5 -echo $ECHO_N "checking GIO_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking GIO_CFLAGS" >&5 +$as_echo_n "checking GIO_CFLAGS... " >&6; } GIO_CFLAGS=`$PKG_CONFIG --cflags "gio-2.0 "` - echo "$as_me:$LINENO: result: $GIO_CFLAGS" >&5 -echo "${ECHO_T}$GIO_CFLAGS" >&6 + { $as_echo "$as_me:$LINENO: result: $GIO_CFLAGS" >&5 +$as_echo "$GIO_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking GIO_LIBS" >&5 -echo $ECHO_N "checking GIO_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking GIO_LIBS" >&5 +$as_echo_n "checking GIO_LIBS... " >&6; } GIO_LIBS=`$PKG_CONFIG --libs "gio-2.0 "` - echo "$as_me:$LINENO: result: $GIO_LIBS" >&5 -echo "${ECHO_T}$GIO_LIBS" >&6 + { $as_echo "$as_me:$LINENO: result: $GIO_LIBS" >&5 +$as_echo "$GIO_LIBS" >&6; } else GIO_CFLAGS="" GIO_LIBS="" @@ -23218,14 +25596,14 @@ echo "${ECHO_T}$GIO_LIBS" >&6 if test $succeeded = yes; then : else - { { echo "$as_me:$LINENO: error: Library requirements (gio-2.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 -echo "$as_me: error: Library requirements (gio-2.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} + { { $as_echo "$as_me:$LINENO: error: Library requirements (gio-2.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 +$as_echo "$as_me: error: Library requirements (gio-2.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} { (exit 1); exit 1; }; } fi else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi fi @@ -23244,18 +25622,18 @@ SYSTEM_CAIRO="" if test "$test_cairo" = "yes"; then - echo "$as_me:$LINENO: checking whether to use cairo" >&5 -echo $ECHO_N "checking whether to use cairo... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking whether to use cairo" >&5 +$as_echo_n "checking whether to use cairo... " >&6; } if test "x$enable_cairo" != "xno" ; then ENABLE_CAIRO="TRUE" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - echo "$as_me:$LINENO: checking which cairo to use" >&5 -echo $ECHO_N "checking which cairo to use... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + { $as_echo "$as_me:$LINENO: checking which cairo to use" >&5 +$as_echo_n "checking which cairo to use... " >&6; } if test -n "$with_system_cairo" -o -n "$with_system_libs" && \ test "$with_system_cairo" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:$LINENO: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_CAIRO=YES @@ -23264,10 +25642,10 @@ echo "${ECHO_T}external" >&6 if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -23280,28 +25658,29 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -23312,25 +25691,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for cairo >= 1.0.2 " >&5 -echo $ECHO_N "checking for cairo >= 1.0.2 ... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for cairo >= 1.0.2 " >&5 +$as_echo_n "checking for cairo >= 1.0.2 ... " >&6; } if $PKG_CONFIG --exists "cairo >= 1.0.2 " ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking CAIRO_CFLAGS" >&5 -echo $ECHO_N "checking CAIRO_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking CAIRO_CFLAGS" >&5 +$as_echo_n "checking CAIRO_CFLAGS... " >&6; } CAIRO_CFLAGS=`$PKG_CONFIG --cflags "cairo >= 1.0.2 "` - echo "$as_me:$LINENO: result: $CAIRO_CFLAGS" >&5 -echo "${ECHO_T}$CAIRO_CFLAGS" >&6 + { $as_echo "$as_me:$LINENO: result: $CAIRO_CFLAGS" >&5 +$as_echo "$CAIRO_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking CAIRO_LIBS" >&5 -echo $ECHO_N "checking CAIRO_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking CAIRO_LIBS" >&5 +$as_echo_n "checking CAIRO_LIBS... " >&6; } CAIRO_LIBS=`$PKG_CONFIG --libs "cairo >= 1.0.2 "` - echo "$as_me:$LINENO: result: $CAIRO_LIBS" >&5 -echo "${ECHO_T}$CAIRO_LIBS" >&6 + { $as_echo "$as_me:$LINENO: result: $CAIRO_LIBS" >&5 +$as_echo "$CAIRO_LIBS" >&6; } else CAIRO_CFLAGS="" CAIRO_LIBS="" @@ -23351,28 +25730,29 @@ echo "${ECHO_T}$CAIRO_LIBS" >&6 if test $succeeded = yes; then : else - { { echo "$as_me:$LINENO: error: Library requirements (cairo >= 1.0.2 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 -echo "$as_me: error: Library requirements (cairo >= 1.0.2 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} + { { $as_echo "$as_me:$LINENO: error: Library requirements (cairo >= 1.0.2 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 +$as_echo "$as_me: error: Library requirements (cairo >= 1.0.2 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} { (exit 1); exit 1; }; } fi if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$ENABLE_FONTCONFIG" != "TRUE" ; then - { { echo "$as_me:$LINENO: error: Cairo library requires fontconfig." >&5 -echo "$as_me: error: Cairo library requires fontconfig." >&2;} + { { $as_echo "$as_me:$LINENO: error: Cairo library requires fontconfig." >&5 +$as_echo "$as_me: error: Cairo library requires fontconfig." >&2;} { (exit 1); exit 1; }; } fi if test "$with_system_xrender_headers" = "yes"; then - echo "$as_me:$LINENO: checking whether Xrender.h defines PictStandardA8" >&5 -echo $ECHO_N "checking whether Xrender.h defines PictStandardA8... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking whether Xrender.h defines PictStandardA8" >&5 +$as_echo_n "checking whether Xrender.h defines PictStandardA8... " >&6; } if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling +$as_echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -23391,42 +25771,56 @@ int main(int argc, char **argv) { _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: no, X headers too old." >&5 -echo "$as_me: error: no, X headers too old." >&2;} +{ { $as_echo "$as_me:$LINENO: error: no, X headers too old." >&5 +$as_echo "$as_me: error: no, X headers too old." >&2;} { (exit 1); exit 1; }; } fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -rf conftest.dSYM +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi else BUILD_TYPE="$BUILD_TYPE CAIRO" if test "$build_cpu" != "x86_64"; then BUILD_PIXMAN=YES fi - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:$LINENO: result: internal" >&5 +$as_echo "internal" >&6; } fi else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi fi @@ -23437,27 +25831,26 @@ fi -echo "$as_me:$LINENO: checking whether to build the OpenGL Transitions component" >&5 -echo $ECHO_N "checking whether to build the OpenGL Transitions component... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to build the OpenGL Transitions component" >&5 +$as_echo_n "checking whether to build the OpenGL Transitions component... " >&6; } ENABLE_OPENGL= if test "x$enable_opengl" != "xno" ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } if test "${ac_cv_header_GL_gl_h+set}" = set; then - echo "$as_me:$LINENO: checking for GL/gl.h" >&5 -echo $ECHO_N "checking for GL/gl.h... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for GL/gl.h" >&5 +$as_echo_n "checking for GL/gl.h... " >&6; } if test "${ac_cv_header_GL_gl_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_GL_gl_h" >&5 -echo "${ECHO_T}$ac_cv_header_GL_gl_h" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_GL_gl_h" >&5 +$as_echo "$ac_cv_header_GL_gl_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking GL/gl.h usability" >&5 -echo $ECHO_N "checking GL/gl.h usability... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking GL/gl.h usability" >&5 +$as_echo_n "checking GL/gl.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -23467,33 +25860,39 @@ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking GL/gl.h presence" >&5 -echo $ECHO_N "checking GL/gl.h presence... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking GL/gl.h presence" >&5 +$as_echo_n "checking GL/gl.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -23501,97 +25900,89 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: GL/gl.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: GL/gl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: GL/gl.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: GL/gl.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: GL/gl.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: GL/gl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: GL/gl.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: GL/gl.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: GL/gl.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: GL/gl.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: GL/gl.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: GL/gl.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: GL/gl.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: GL/gl.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: GL/gl.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: GL/gl.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: GL/gl.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: GL/gl.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: GL/gl.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: GL/gl.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: GL/gl.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: GL/gl.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: GL/gl.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: GL/gl.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: GL/gl.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: GL/gl.h: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for GL/gl.h" >&5 -echo $ECHO_N "checking for GL/gl.h... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for GL/gl.h" >&5 +$as_echo_n "checking for GL/gl.h... " >&6; } if test "${ac_cv_header_GL_gl_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_GL_gl_h=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_GL_gl_h" >&5 -echo "${ECHO_T}$ac_cv_header_GL_gl_h" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_GL_gl_h" >&5 +$as_echo "$ac_cv_header_GL_gl_h" >&6; } fi -if test $ac_cv_header_GL_gl_h = yes; then +if test "x$ac_cv_header_GL_gl_h" = x""yes; then : else - { { echo "$as_me:$LINENO: error: OpenGL headers not found" >&5 -echo "$as_me: error: OpenGL headers not found" >&2;} + { { $as_echo "$as_me:$LINENO: error: OpenGL headers not found" >&5 +$as_echo "$as_me: error: OpenGL headers not found" >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: checking for main in -lGL" >&5 -echo $ECHO_N "checking for main in -lGL... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for main in -lGL" >&5 +$as_echo_n "checking for main in -lGL... " >&6; } if test "${ac_cv_lib_GL_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lGL $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -23602,36 +25993,48 @@ cat >>conftest.$ac_ext <<_ACEOF int main () { -main (); +return main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_GL_main=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_GL_main=no + ac_cv_lib_GL_main=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_GL_main" >&5 -echo "${ECHO_T}$ac_cv_lib_GL_main" >&6 -if test $ac_cv_lib_GL_main = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_GL_main" >&5 +$as_echo "$ac_cv_lib_GL_main" >&6; } +if test "x$ac_cv_lib_GL_main" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBGL 1 _ACEOF @@ -23639,21 +26042,20 @@ _ACEOF LIBS="-lGL $LIBS" else - { { echo "$as_me:$LINENO: error: libGL not installed or functional" >&5 -echo "$as_me: error: libGL not installed or functional" >&2;} + { { $as_echo "$as_me:$LINENO: error: libGL not installed or functional" >&5 +$as_echo "$as_me: error: libGL not installed or functional" >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: checking for main in -lGLU" >&5 -echo $ECHO_N "checking for main in -lGLU... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for main in -lGLU" >&5 +$as_echo_n "checking for main in -lGLU... " >&6; } if test "${ac_cv_lib_GLU_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lGLU $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -23664,36 +26066,48 @@ cat >>conftest.$ac_ext <<_ACEOF int main () { -main (); +return main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_GLU_main=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_GLU_main=no + ac_cv_lib_GLU_main=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_GLU_main" >&5 -echo "${ECHO_T}$ac_cv_lib_GLU_main" >&6 -if test $ac_cv_lib_GLU_main = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_GLU_main" >&5 +$as_echo "$ac_cv_lib_GLU_main" >&6; } +if test "x$ac_cv_lib_GLU_main" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBGLU 1 _ACEOF @@ -23701,58 +26115,71 @@ _ACEOF LIBS="-lGLU $LIBS" else - { { echo "$as_me:$LINENO: error: libGLU not installed or functional" >&5 -echo "$as_me: error: libGLU not installed or functional" >&2;} + { { $as_echo "$as_me:$LINENO: error: libGLU not installed or functional" >&5 +$as_echo "$as_me: error: libGLU not installed or functional" >&2;} { (exit 1); exit 1; }; } fi ENABLE_OPENGL=TRUE else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi -echo "$as_me:$LINENO: checking whether to build the Presentation Minimizer extension" >&5 -echo $ECHO_N "checking whether to build the Presentation Minimizer extension... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to build extra presenter ui" >&5 +$as_echo_n "checking whether to build extra presenter ui... " >&6; } +if test -n "$enable_presenter_extra_ui" -a "$enable_presenter_extra_ui" != "no"; then + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + ENABLE_PRESENTER_EXTRA_UI=YES +else + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } + ENABLE_PRESENTER_EXTRA_UI=NO +fi + + +{ $as_echo "$as_me:$LINENO: checking whether to build the Presentation Minimizer extension" >&5 +$as_echo_n "checking whether to build the Presentation Minimizer extension... " >&6; } if test -n "$enable_minimizer" -a "$enable_minimizer" != "no"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } ENABLE_MINIMIZER=YES else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } ENABLE_MINIMIZER=NO fi -echo "$as_me:$LINENO: checking whether to build the Presenter Screen extension" >&5 -echo $ECHO_N "checking whether to build the Presenter Screen extension... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to build the Presenter Screen extension" >&5 +$as_echo_n "checking whether to build the Presenter Screen extension... " >&6; } if test -n "$enable_presenter_console" -a "$enable_presenter_screen" != "no"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } ENABLE_PRESENTER_SCREEN=YES else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } ENABLE_PRESENTER_SCREEN=NO fi -echo "$as_me:$LINENO: checking whether to build the PDF Import extension" >&5 -echo $ECHO_N "checking whether to build the PDF Import extension... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to build the PDF Import extension" >&5 +$as_echo_n "checking whether to build the PDF Import extension... " >&6; } if test -n "$enable_pdfimport" -a "$enable_pdfimport" != "no"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } ENABLE_PDFIMPORT=YES - echo "$as_me:$LINENO: checking which pdf backend to use" >&5 -echo $ECHO_N "checking which pdf backend to use... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking which pdf backend to use" >&5 +$as_echo_n "checking which pdf backend to use... " >&6; } if test -n "$with_system_poppler" -o -n "$with_system_libs" && \ test "$with_system_poppler" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:$LINENO: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_POPPLER=YES succeeded=no @@ -23760,10 +26187,10 @@ echo "${ECHO_T}external" >&6 if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -23776,28 +26203,29 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -23808,25 +26236,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for poppler >= 0.8.0 " >&5 -echo $ECHO_N "checking for poppler >= 0.8.0 ... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for poppler >= 0.8.0 " >&5 +$as_echo_n "checking for poppler >= 0.8.0 ... " >&6; } if $PKG_CONFIG --exists "poppler >= 0.8.0 " ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking POPPLER_CFLAGS" >&5 -echo $ECHO_N "checking POPPLER_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking POPPLER_CFLAGS" >&5 +$as_echo_n "checking POPPLER_CFLAGS... " >&6; } POPPLER_CFLAGS=`$PKG_CONFIG --cflags "poppler >= 0.8.0 "` - echo "$as_me:$LINENO: result: $POPPLER_CFLAGS" >&5 -echo "${ECHO_T}$POPPLER_CFLAGS" >&6 + { $as_echo "$as_me:$LINENO: result: $POPPLER_CFLAGS" >&5 +$as_echo "$POPPLER_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking POPPLER_LIBS" >&5 -echo $ECHO_N "checking POPPLER_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking POPPLER_LIBS" >&5 +$as_echo_n "checking POPPLER_LIBS... " >&6; } POPPLER_LIBS=`$PKG_CONFIG --libs "poppler >= 0.8.0 "` - echo "$as_me:$LINENO: result: $POPPLER_LIBS" >&5 -echo "${ECHO_T}$POPPLER_LIBS" >&6 + { $as_echo "$as_me:$LINENO: result: $POPPLER_LIBS" >&5 +$as_echo "$POPPLER_LIBS" >&6; } else POPPLER_CFLAGS="" POPPLER_LIBS="" @@ -23847,30 +26275,30 @@ echo "${ECHO_T}$POPPLER_LIBS" >&6 if test $succeeded = yes; then : else - { { echo "$as_me:$LINENO: error: Library requirements (poppler >= 0.8.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 -echo "$as_me: error: Library requirements (poppler >= 0.8.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} + { { $as_echo "$as_me:$LINENO: error: Library requirements (poppler >= 0.8.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 +$as_echo "$as_me: error: Library requirements (poppler >= 0.8.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} { (exit 1); exit 1; }; } fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:$LINENO: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_POPPLER=NO BUILD_TYPE="$BUILD_TYPE XPDF" - echo "$as_me:$LINENO: checking for xpdf module" >&5 -echo $ECHO_N "checking for xpdf module... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for xpdf module" >&5 +$as_echo_n "checking for xpdf module... " >&6; } if test -d ./xpdf; then - echo "$as_me:$LINENO: result: OK" >&5 -echo "${ECHO_T}OK" >&6 + { $as_echo "$as_me:$LINENO: result: OK" >&5 +$as_echo "OK" >&6; } else - { { echo "$as_me:$LINENO: error: not existing. get it (did you get the -extensions tarball?)" >&5 -echo "$as_me: error: not existing. get it (did you get the -extensions tarball?)" >&2;} + { { $as_echo "$as_me:$LINENO: error: not existing. get it (did you get the -extensions tarball?)" >&5 +$as_echo "$as_me: error: not existing. get it (did you get the -extensions tarball?)" >&2;} { (exit 1); exit 1; }; } fi fi else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } ENABLE_PDFIMPORT=NO fi @@ -23879,62 +26307,62 @@ fi if test "$ENABLE_PRESENTER_SCREEN" = "YES" -o "$ENABLE_MINIMIZER" = "YES" -o "$ENABLE_PDFIMPORT" = "YES"; then - echo "$as_me:$LINENO: checking for sdext module" >&5 -echo $ECHO_N "checking for sdext module... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for sdext module" >&5 +$as_echo_n "checking for sdext module... " >&6; } if test -d ./sdext; then - echo "$as_me:$LINENO: result: OK" >&5 -echo "${ECHO_T}OK" >&6 + { $as_echo "$as_me:$LINENO: result: OK" >&5 +$as_echo "OK" >&6; } else - { { echo "$as_me:$LINENO: error: not existing. get it (did you get the -extensions tarball?)" >&5 -echo "$as_me: error: not existing. get it (did you get the -extensions tarball?)" >&2;} + { { $as_echo "$as_me:$LINENO: error: not existing. get it (did you get the -extensions tarball?)" >&5 +$as_echo "$as_me: error: not existing. get it (did you get the -extensions tarball?)" >&2;} { (exit 1); exit 1; }; } fi BUILD_TYPE="$BUILD_TYPE SDEXT" fi -echo "$as_me:$LINENO: checking whether to build the Wiki Publisher extension" >&5 -echo $ECHO_N "checking whether to build the Wiki Publisher extension... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to build the Wiki Publisher extension" >&5 +$as_echo_n "checking whether to build the Wiki Publisher extension... " >&6; } if test -n "$enable_wiki_publisher" -a "$enable_wiki_publisher" != "no" && test "$WITH_JAVA" != "no"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - echo "$as_me:$LINENO: checking for swext module" >&5 -echo $ECHO_N "checking for swext module... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + { $as_echo "$as_me:$LINENO: checking for swext module" >&5 +$as_echo_n "checking for swext module... " >&6; } if test -d ./swext; then - echo "$as_me:$LINENO: result: OK" >&5 -echo "${ECHO_T}OK" >&6 + { $as_echo "$as_me:$LINENO: result: OK" >&5 +$as_echo "OK" >&6; } else - { { echo "$as_me:$LINENO: error: not existing. get it (did you get the -extensions tarball?)" >&5 -echo "$as_me: error: not existing. get it (did you get the -extensions tarball?)" >&2;} + { { $as_echo "$as_me:$LINENO: error: not existing. get it (did you get the -extensions tarball?)" >&5 +$as_echo "$as_me: error: not existing. get it (did you get the -extensions tarball?)" >&2;} { (exit 1); exit 1; }; } fi ENABLE_MEDIAWIKI=YES BUILD_TYPE="$BUILD_TYPE SWEXT" else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } ENABLE_MEDIAWIKI=NO fi if test "$ENABLE_MEDIAWIKI" == "YES"; then - echo "$as_me:$LINENO: checking which Servlet API Jar to use" >&5 -echo $ECHO_N "checking which Servlet API Jar to use... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking which Servlet API Jar to use" >&5 +$as_echo_n "checking which Servlet API Jar to use... " >&6; } if test -n "$with_system_servlet_api"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:$LINENO: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_SERVLETAPI=YES if test -z "$SERVLETAPI_JAR"; then SERVLETAPI_JAR=/usr/share/java/servlet-api.jar fi - as_ac_File=`echo "ac_cv_file_$SERVLETAPI_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $SERVLETAPI_JAR" >&5 -echo $ECHO_N "checking for $SERVLETAPI_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$SERVLETAPI_JAR" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $SERVLETAPI_JAR" >&5 +$as_echo_n "checking for $SERVLETAPI_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "$SERVLETAPI_JAR"; then eval "$as_ac_File=yes" @@ -23942,19 +26370,23 @@ else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then : else - { { echo "$as_me:$LINENO: error: servlet-api.jar not found." >&5 -echo "$as_me: error: servlet-api.jar not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: servlet-api.jar not found." >&5 +$as_echo "$as_me: error: servlet-api.jar not found." >&2;} { (exit 1); exit 1; }; } fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:$LINENO: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_SERVLETAPI=NO BUILD_TYPE="$BUILD_TYPE TOMCAT" fi @@ -23962,40 +26394,40 @@ fi -echo "$as_me:$LINENO: checking whether to build the Report Builder extension" >&5 -echo $ECHO_N "checking whether to build the Report Builder extension... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to build the Report Builder extension" >&5 +$as_echo_n "checking whether to build the Report Builder extension... " >&6; } if test -n "$enable_report_builder" -a "$enable_report_builder" != "no" && test "$WITH_JAVA" != "no"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } ENABLE_REPORTBUILDER=YES - echo "$as_me:$LINENO: checking for reportbuilder module" >&5 -echo $ECHO_N "checking for reportbuilder module... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for reportbuilder module" >&5 +$as_echo_n "checking for reportbuilder module... " >&6; } if test -d ./reportbuilder; then - echo "$as_me:$LINENO: result: OK" >&5 -echo "${ECHO_T}OK" >&6 + { $as_echo "$as_me:$LINENO: result: OK" >&5 +$as_echo "OK" >&6; } else - { { echo "$as_me:$LINENO: error: not existing. get it (did you get the -extensions tarball?)" >&5 -echo "$as_me: error: not existing. get it (did you get the -extensions tarball?)" >&2;} + { { $as_echo "$as_me:$LINENO: error: not existing. get it (did you get the -extensions tarball?)" >&5 +$as_echo "$as_me: error: not existing. get it (did you get the -extensions tarball?)" >&2;} { (exit 1); exit 1; }; } fi - echo "$as_me:$LINENO: checking which jfreereport libs to use" >&5 -echo $ECHO_N "checking which jfreereport libs to use... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking which jfreereport libs to use" >&5 +$as_echo_n "checking which jfreereport libs to use... " >&6; } if test "$with_system_jfreereport" == "yes"; then SYSTEM_JFREEREPORT=YES - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:$LINENO: result: external" >&5 +$as_echo "external" >&6; } if test -z $SAC_JAR; then SAC_JAR=/usr/share/java/sac.jar fi - as_ac_File=`echo "ac_cv_file_$SAC_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $SAC_JAR" >&5 -echo $ECHO_N "checking for $SAC_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$SAC_JAR" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $SAC_JAR" >&5 +$as_echo_n "checking for $SAC_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "$SAC_JAR"; then eval "$as_ac_File=yes" @@ -24003,26 +26435,30 @@ else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then : else - { { echo "$as_me:$LINENO: error: sac.jar not found." >&5 -echo "$as_me: error: sac.jar not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: sac.jar not found." >&5 +$as_echo "$as_me: error: sac.jar not found." >&2;} { (exit 1); exit 1; }; } fi if test -z $LIBXML_JAR; then - echo "$as_me:$LINENO: checking for /usr/share/java/libxml-1.0.0.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/libxml-1.0.0.jar... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for /usr/share/java/libxml-1.0.0.jar" >&5 +$as_echo_n "checking for /usr/share/java/libxml-1.0.0.jar... " >&6; } if test "${ac_cv_file__usr_share_java_libxml_1_0_0_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "/usr/share/java/libxml-1.0.0.jar"; then ac_cv_file__usr_share_java_libxml_1_0_0_jar=yes @@ -24030,20 +26466,20 @@ else ac_cv_file__usr_share_java_libxml_1_0_0_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libxml_1_0_0_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_libxml_1_0_0_jar" >&6 -if test $ac_cv_file__usr_share_java_libxml_1_0_0_jar = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libxml_1_0_0_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_libxml_1_0_0_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_libxml_1_0_0_jar" = x""yes; then LIBXML_JAR=/usr/share/java/libxml-1.0.0.jar else - echo "$as_me:$LINENO: checking for /usr/share/java/libxml.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/libxml.jar... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for /usr/share/java/libxml.jar" >&5 +$as_echo_n "checking for /usr/share/java/libxml.jar... " >&6; } if test "${ac_cv_file__usr_share_java_libxml_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "/usr/share/java/libxml.jar"; then ac_cv_file__usr_share_java_libxml_jar=yes @@ -24051,13 +26487,13 @@ else ac_cv_file__usr_share_java_libxml_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libxml_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_libxml_jar" >&6 -if test $ac_cv_file__usr_share_java_libxml_jar = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libxml_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_libxml_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_libxml_jar" = x""yes; then LIBXML_JAR=/usr/share/java/libxml.jar else - { { echo "$as_me:$LINENO: error: libxml.jar replacement not found." >&5 -echo "$as_me: error: libxml.jar replacement not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: libxml.jar replacement not found." >&5 +$as_echo "$as_me: error: libxml.jar replacement not found." >&2;} { (exit 1); exit 1; }; } fi @@ -24067,15 +26503,15 @@ fi fi else - as_ac_File=`echo "ac_cv_file_$LIBXML_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $LIBXML_JAR" >&5 -echo $ECHO_N "checking for $LIBXML_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$LIBXML_JAR" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $LIBXML_JAR" >&5 +$as_echo_n "checking for $LIBXML_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "$LIBXML_JAR"; then eval "$as_ac_File=yes" @@ -24083,27 +26519,31 @@ else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then : else - { { echo "$as_me:$LINENO: error: libxml.jar not found." >&5 -echo "$as_me: error: libxml.jar not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: libxml.jar not found." >&5 +$as_echo "$as_me: error: libxml.jar not found." >&2;} { (exit 1); exit 1; }; } fi fi if test -z $FLUTE_JAR; then - echo "$as_me:$LINENO: checking for /usr/share/java/flute-1.3.0.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/flute-1.3.0.jar... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for /usr/share/java/flute-1.3.0.jar" >&5 +$as_echo_n "checking for /usr/share/java/flute-1.3.0.jar... " >&6; } if test "${ac_cv_file__usr_share_java_flute_1_3_0_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "/usr/share/java/flute-1.3.0.jar"; then ac_cv_file__usr_share_java_flute_1_3_0_jar=yes @@ -24111,20 +26551,20 @@ else ac_cv_file__usr_share_java_flute_1_3_0_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_flute_1_3_0_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_flute_1_3_0_jar" >&6 -if test $ac_cv_file__usr_share_java_flute_1_3_0_jar = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_flute_1_3_0_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_flute_1_3_0_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_flute_1_3_0_jar" = x""yes; then FLUTE_JAR=/usr/share/java/flute-1.3.0.jar else - echo "$as_me:$LINENO: checking for /usr/share/java/flute.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/flute.jar... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for /usr/share/java/flute.jar" >&5 +$as_echo_n "checking for /usr/share/java/flute.jar... " >&6; } if test "${ac_cv_file__usr_share_java_flute_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "/usr/share/java/flute.jar"; then ac_cv_file__usr_share_java_flute_jar=yes @@ -24132,13 +26572,13 @@ else ac_cv_file__usr_share_java_flute_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_flute_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_flute_jar" >&6 -if test $ac_cv_file__usr_share_java_flute_jar = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_flute_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_flute_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_flute_jar" = x""yes; then FLUTE_JAR=/usr/share/java/flute.jar else - { { echo "$as_me:$LINENO: error: flute-1.3.0.jar replacement not found." >&5 -echo "$as_me: error: flute-1.3.0.jar replacement not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: flute-1.3.0.jar replacement not found." >&5 +$as_echo "$as_me: error: flute-1.3.0.jar replacement not found." >&2;} { (exit 1); exit 1; }; } fi @@ -24148,15 +26588,15 @@ fi fi else - as_ac_File=`echo "ac_cv_file_$FLUTE_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $FLUTE_JAR" >&5 -echo $ECHO_N "checking for $FLUTE_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$FLUTE_JAR" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $FLUTE_JAR" >&5 +$as_echo_n "checking for $FLUTE_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "$FLUTE_JAR"; then eval "$as_ac_File=yes" @@ -24164,27 +26604,31 @@ else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then : else - { { echo "$as_me:$LINENO: error: flute-1.3.0.jar not found." >&5 -echo "$as_me: error: flute-1.3.0.jar not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: flute-1.3.0.jar not found." >&5 +$as_echo "$as_me: error: flute-1.3.0.jar not found." >&2;} { (exit 1); exit 1; }; } fi fi if test -z $JFREEREPORT_JAR; then - echo "$as_me:$LINENO: checking for /usr/share/java/flow-engine-0.9.2.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/flow-engine-0.9.2.jar... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for /usr/share/java/flow-engine-0.9.2.jar" >&5 +$as_echo_n "checking for /usr/share/java/flow-engine-0.9.2.jar... " >&6; } if test "${ac_cv_file__usr_share_java_flow_engine_0_9_2_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "/usr/share/java/flow-engine-0.9.2.jar"; then ac_cv_file__usr_share_java_flow_engine_0_9_2_jar=yes @@ -24192,20 +26636,20 @@ else ac_cv_file__usr_share_java_flow_engine_0_9_2_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_flow_engine_0_9_2_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_flow_engine_0_9_2_jar" >&6 -if test $ac_cv_file__usr_share_java_flow_engine_0_9_2_jar = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_flow_engine_0_9_2_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_flow_engine_0_9_2_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_flow_engine_0_9_2_jar" = x""yes; then JFREEREPORT_JAR=/usr/share/java/flow-engine-0.9.2.jar else - echo "$as_me:$LINENO: checking for /usr/share/java/flow-engine.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/flow-engine.jar... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for /usr/share/java/flow-engine.jar" >&5 +$as_echo_n "checking for /usr/share/java/flow-engine.jar... " >&6; } if test "${ac_cv_file__usr_share_java_flow_engine_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "/usr/share/java/flow-engine.jar"; then ac_cv_file__usr_share_java_flow_engine_jar=yes @@ -24213,13 +26657,13 @@ else ac_cv_file__usr_share_java_flow_engine_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_flow_engine_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_flow_engine_jar" >&6 -if test $ac_cv_file__usr_share_java_flow_engine_jar = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_flow_engine_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_flow_engine_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_flow_engine_jar" = x""yes; then JFREEREPORT_JAR=/usr/share/java/flow-engine.jar else - { { echo "$as_me:$LINENO: error: jfreereport.jar replacement not found." >&5 -echo "$as_me: error: jfreereport.jar replacement not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: jfreereport.jar replacement not found." >&5 +$as_echo "$as_me: error: jfreereport.jar replacement not found." >&2;} { (exit 1); exit 1; }; } fi @@ -24229,15 +26673,15 @@ fi fi else - as_ac_File=`echo "ac_cv_file_$JFREEREPORT_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $JFREEREPORT_JAR" >&5 -echo $ECHO_N "checking for $JFREEREPORT_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$JFREEREPORT_JAR" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $JFREEREPORT_JAR" >&5 +$as_echo_n "checking for $JFREEREPORT_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "$JFREEREPORT_JAR"; then eval "$as_ac_File=yes" @@ -24245,27 +26689,31 @@ else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then : else - { { echo "$as_me:$LINENO: error: jfreereport.jar not found." >&5 -echo "$as_me: error: jfreereport.jar not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: jfreereport.jar not found." >&5 +$as_echo "$as_me: error: jfreereport.jar not found." >&2;} { (exit 1); exit 1; }; } fi fi if test -z $LIBLAYOUT_JAR; then - echo "$as_me:$LINENO: checking for /usr/share/java/liblayout-0.2.9.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/liblayout-0.2.9.jar... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for /usr/share/java/liblayout-0.2.9.jar" >&5 +$as_echo_n "checking for /usr/share/java/liblayout-0.2.9.jar... " >&6; } if test "${ac_cv_file__usr_share_java_liblayout_0_2_9_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "/usr/share/java/liblayout-0.2.9.jar"; then ac_cv_file__usr_share_java_liblayout_0_2_9_jar=yes @@ -24273,20 +26721,20 @@ else ac_cv_file__usr_share_java_liblayout_0_2_9_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_liblayout_0_2_9_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_liblayout_0_2_9_jar" >&6 -if test $ac_cv_file__usr_share_java_liblayout_0_2_9_jar = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_liblayout_0_2_9_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_liblayout_0_2_9_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_liblayout_0_2_9_jar" = x""yes; then LIBLAYOUT_JAR=/usr/share/java/liblayout-0.2.9.jar else - echo "$as_me:$LINENO: checking for /usr/share/java/liblayout.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/liblayout.jar... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for /usr/share/java/liblayout.jar" >&5 +$as_echo_n "checking for /usr/share/java/liblayout.jar... " >&6; } if test "${ac_cv_file__usr_share_java_liblayout_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "/usr/share/java/liblayout.jar"; then ac_cv_file__usr_share_java_liblayout_jar=yes @@ -24294,13 +26742,13 @@ else ac_cv_file__usr_share_java_liblayout_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_liblayout_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_liblayout_jar" >&6 -if test $ac_cv_file__usr_share_java_liblayout_jar = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_liblayout_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_liblayout_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_liblayout_jar" = x""yes; then LIBLAYOUT_JAR=/usr/share/java/liblayout.jar else - { { echo "$as_me:$LINENO: error: liblayout.jar replacement not found." >&5 -echo "$as_me: error: liblayout.jar replacement not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: liblayout.jar replacement not found." >&5 +$as_echo "$as_me: error: liblayout.jar replacement not found." >&2;} { (exit 1); exit 1; }; } fi @@ -24310,15 +26758,15 @@ fi fi else - as_ac_File=`echo "ac_cv_file_$LIBLAYOUT_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $LIBLAYOUT_JAR" >&5 -echo $ECHO_N "checking for $LIBLAYOUT_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$LIBLAYOUT_JAR" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $LIBLAYOUT_JAR" >&5 +$as_echo_n "checking for $LIBLAYOUT_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "$LIBLAYOUT_JAR"; then eval "$as_ac_File=yes" @@ -24326,27 +26774,31 @@ else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then : else - { { echo "$as_me:$LINENO: error: liblayout.jar not found." >&5 -echo "$as_me: error: liblayout.jar not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: liblayout.jar not found." >&5 +$as_echo "$as_me: error: liblayout.jar not found." >&2;} { (exit 1); exit 1; }; } fi fi if test -z $LIBLOADER_JAR; then - echo "$as_me:$LINENO: checking for /usr/share/java/libloader-1.0.0.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/libloader-1.0.0.jar... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for /usr/share/java/libloader-1.0.0.jar" >&5 +$as_echo_n "checking for /usr/share/java/libloader-1.0.0.jar... " >&6; } if test "${ac_cv_file__usr_share_java_libloader_1_0_0_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "/usr/share/java/libloader-1.0.0.jar"; then ac_cv_file__usr_share_java_libloader_1_0_0_jar=yes @@ -24354,20 +26806,20 @@ else ac_cv_file__usr_share_java_libloader_1_0_0_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libloader_1_0_0_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_libloader_1_0_0_jar" >&6 -if test $ac_cv_file__usr_share_java_libloader_1_0_0_jar = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libloader_1_0_0_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_libloader_1_0_0_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_libloader_1_0_0_jar" = x""yes; then LIBLOADER_JAR=/usr/share/java/libloader-1.0.0.jar else - echo "$as_me:$LINENO: checking for /usr/share/java/libloader.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/libloader.jar... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for /usr/share/java/libloader.jar" >&5 +$as_echo_n "checking for /usr/share/java/libloader.jar... " >&6; } if test "${ac_cv_file__usr_share_java_libloader_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "/usr/share/java/libloader.jar"; then ac_cv_file__usr_share_java_libloader_jar=yes @@ -24375,13 +26827,13 @@ else ac_cv_file__usr_share_java_libloader_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libloader_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_libloader_jar" >&6 -if test $ac_cv_file__usr_share_java_libloader_jar = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libloader_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_libloader_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_libloader_jar" = x""yes; then LIBLOADER_JAR=/usr/share/java/libloader.jar else - { { echo "$as_me:$LINENO: error: libloader.jar replacement not found." >&5 -echo "$as_me: error: libloader.jar replacement not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: libloader.jar replacement not found." >&5 +$as_echo "$as_me: error: libloader.jar replacement not found." >&2;} { (exit 1); exit 1; }; } fi @@ -24391,15 +26843,15 @@ fi fi else - as_ac_File=`echo "ac_cv_file_$LIBLOADER_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $LIBLOADER_JAR" >&5 -echo $ECHO_N "checking for $LIBLOADER_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$LIBLOADER_JAR" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $LIBLOADER_JAR" >&5 +$as_echo_n "checking for $LIBLOADER_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "$LIBLOADER_JAR"; then eval "$as_ac_File=yes" @@ -24407,27 +26859,31 @@ else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then : else - { { echo "$as_me:$LINENO: error: libloader.jar not found." >&5 -echo "$as_me: error: libloader.jar not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: libloader.jar not found." >&5 +$as_echo "$as_me: error: libloader.jar not found." >&2;} { (exit 1); exit 1; }; } fi fi if test -z $LIBFORMULA_JAR; then - echo "$as_me:$LINENO: checking for /usr/share/java/libformula-0.2.0.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/libformula-0.2.0.jar... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for /usr/share/java/libformula-0.2.0.jar" >&5 +$as_echo_n "checking for /usr/share/java/libformula-0.2.0.jar... " >&6; } if test "${ac_cv_file__usr_share_java_libformula_0_2_0_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "/usr/share/java/libformula-0.2.0.jar"; then ac_cv_file__usr_share_java_libformula_0_2_0_jar=yes @@ -24435,20 +26891,20 @@ else ac_cv_file__usr_share_java_libformula_0_2_0_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libformula_0_2_0_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_libformula_0_2_0_jar" >&6 -if test $ac_cv_file__usr_share_java_libformula_0_2_0_jar = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libformula_0_2_0_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_libformula_0_2_0_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_libformula_0_2_0_jar" = x""yes; then LIBFORMULA_JAR=/usr/share/java/libformula-0.2.0.jar else - echo "$as_me:$LINENO: checking for /usr/share/java/libformula.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/libformula.jar... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for /usr/share/java/libformula.jar" >&5 +$as_echo_n "checking for /usr/share/java/libformula.jar... " >&6; } if test "${ac_cv_file__usr_share_java_libformula_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "/usr/share/java/libformula.jar"; then ac_cv_file__usr_share_java_libformula_jar=yes @@ -24456,13 +26912,13 @@ else ac_cv_file__usr_share_java_libformula_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libformula_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_libformula_jar" >&6 -if test $ac_cv_file__usr_share_java_libformula_jar = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libformula_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_libformula_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_libformula_jar" = x""yes; then LIBFORMULA_JAR=/usr/share/java/libformula.jar else - { { echo "$as_me:$LINENO: error: libformula.jar replacement not found." >&5 -echo "$as_me: error: libformula.jar replacement not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: libformula.jar replacement not found." >&5 +$as_echo "$as_me: error: libformula.jar replacement not found." >&2;} { (exit 1); exit 1; }; } fi @@ -24472,15 +26928,15 @@ fi fi else - as_ac_File=`echo "ac_cv_file_$LIBFORMULA_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $LIBFORMULA_JAR" >&5 -echo $ECHO_N "checking for $LIBFORMULA_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$LIBFORMULA_JAR" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $LIBFORMULA_JAR" >&5 +$as_echo_n "checking for $LIBFORMULA_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "$LIBFORMULA_JAR"; then eval "$as_ac_File=yes" @@ -24488,27 +26944,31 @@ else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then : else - { { echo "$as_me:$LINENO: error: libformula.jar not found." >&5 -echo "$as_me: error: libformula.jar not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: libformula.jar not found." >&5 +$as_echo "$as_me: error: libformula.jar not found." >&2;} { (exit 1); exit 1; }; } fi fi if test -z $LIBREPOSITORY_JAR; then - echo "$as_me:$LINENO: checking for /usr/share/java/librepository-1.0.0.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/librepository-1.0.0.jar... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for /usr/share/java/librepository-1.0.0.jar" >&5 +$as_echo_n "checking for /usr/share/java/librepository-1.0.0.jar... " >&6; } if test "${ac_cv_file__usr_share_java_librepository_1_0_0_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "/usr/share/java/librepository-1.0.0.jar"; then ac_cv_file__usr_share_java_librepository_1_0_0_jar=yes @@ -24516,20 +26976,20 @@ else ac_cv_file__usr_share_java_librepository_1_0_0_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_librepository_1_0_0_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_librepository_1_0_0_jar" >&6 -if test $ac_cv_file__usr_share_java_librepository_1_0_0_jar = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_librepository_1_0_0_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_librepository_1_0_0_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_librepository_1_0_0_jar" = x""yes; then LIBREPOSITORY_JAR=/usr/share/java/librepository-1.0.0.jar else - echo "$as_me:$LINENO: checking for /usr/share/java/librepository.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/librepository.jar... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for /usr/share/java/librepository.jar" >&5 +$as_echo_n "checking for /usr/share/java/librepository.jar... " >&6; } if test "${ac_cv_file__usr_share_java_librepository_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "/usr/share/java/librepository.jar"; then ac_cv_file__usr_share_java_librepository_jar=yes @@ -24537,13 +26997,13 @@ else ac_cv_file__usr_share_java_librepository_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_librepository_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_librepository_jar" >&6 -if test $ac_cv_file__usr_share_java_librepository_jar = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_librepository_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_librepository_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_librepository_jar" = x""yes; then LIBREPOSITORY_JAR=/usr/share/java/librepository.jar else - { { echo "$as_me:$LINENO: error: librepository.jar replacement not found." >&5 -echo "$as_me: error: librepository.jar replacement not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: librepository.jar replacement not found." >&5 +$as_echo "$as_me: error: librepository.jar replacement not found." >&2;} { (exit 1); exit 1; }; } fi @@ -24553,15 +27013,15 @@ fi fi else - as_ac_File=`echo "ac_cv_file_$LIBREPOSITORY_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $LIBREPOSITORY_JAR" >&5 -echo $ECHO_N "checking for $LIBREPOSITORY_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$LIBREPOSITORY_JAR" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $LIBREPOSITORY_JAR" >&5 +$as_echo_n "checking for $LIBREPOSITORY_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "$LIBREPOSITORY_JAR"; then eval "$as_ac_File=yes" @@ -24569,27 +27029,31 @@ else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then : else - { { echo "$as_me:$LINENO: error: librepository.jar not found." >&5 -echo "$as_me: error: librepository.jar not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: librepository.jar not found." >&5 +$as_echo "$as_me: error: librepository.jar not found." >&2;} { (exit 1); exit 1; }; } fi fi if test -z $LIBFONTS_JAR; then - echo "$as_me:$LINENO: checking for /usr/share/java/libfonts-1.0.0.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/libfonts-1.0.0.jar... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for /usr/share/java/libfonts-1.0.0.jar" >&5 +$as_echo_n "checking for /usr/share/java/libfonts-1.0.0.jar... " >&6; } if test "${ac_cv_file__usr_share_java_libfonts_1_0_0_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "/usr/share/java/libfonts-1.0.0.jar"; then ac_cv_file__usr_share_java_libfonts_1_0_0_jar=yes @@ -24597,20 +27061,20 @@ else ac_cv_file__usr_share_java_libfonts_1_0_0_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libfonts_1_0_0_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_libfonts_1_0_0_jar" >&6 -if test $ac_cv_file__usr_share_java_libfonts_1_0_0_jar = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libfonts_1_0_0_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_libfonts_1_0_0_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_libfonts_1_0_0_jar" = x""yes; then LIBFONTS_JAR=/usr/share/java/libfonts-1.0.0.jar else - echo "$as_me:$LINENO: checking for /usr/share/java/libfonts.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/libfonts.jar... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for /usr/share/java/libfonts.jar" >&5 +$as_echo_n "checking for /usr/share/java/libfonts.jar... " >&6; } if test "${ac_cv_file__usr_share_java_libfonts_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "/usr/share/java/libfonts.jar"; then ac_cv_file__usr_share_java_libfonts_jar=yes @@ -24618,13 +27082,13 @@ else ac_cv_file__usr_share_java_libfonts_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libfonts_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_libfonts_jar" >&6 -if test $ac_cv_file__usr_share_java_libfonts_jar = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libfonts_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_libfonts_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_libfonts_jar" = x""yes; then LIBFONTS_JAR=/usr/share/java/libfonts.jar else - { { echo "$as_me:$LINENO: error: libfonts.jar replacement not found." >&5 -echo "$as_me: error: libfonts.jar replacement not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: libfonts.jar replacement not found." >&5 +$as_echo "$as_me: error: libfonts.jar replacement not found." >&2;} { (exit 1); exit 1; }; } fi @@ -24634,15 +27098,15 @@ fi fi else - as_ac_File=`echo "ac_cv_file_$LIBFONTS_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $LIBFONTS_JAR" >&5 -echo $ECHO_N "checking for $LIBFONTS_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$LIBFONTS_JAR" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $LIBFONTS_JAR" >&5 +$as_echo_n "checking for $LIBFONTS_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "$LIBFONTS_JAR"; then eval "$as_ac_File=yes" @@ -24650,27 +27114,31 @@ else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then : else - { { echo "$as_me:$LINENO: error: libfonts.jar not found." >&5 -echo "$as_me: error: libfonts.jar not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: libfonts.jar not found." >&5 +$as_echo "$as_me: error: libfonts.jar not found." >&2;} { (exit 1); exit 1; }; } fi fi if test -z $LIBSERIALIZER_JAR; then - echo "$as_me:$LINENO: checking for /usr/share/java/libserializer-1.0.0.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/libserializer-1.0.0.jar... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for /usr/share/java/libserializer-1.0.0.jar" >&5 +$as_echo_n "checking for /usr/share/java/libserializer-1.0.0.jar... " >&6; } if test "${ac_cv_file__usr_share_java_libserializer_1_0_0_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "/usr/share/java/libserializer-1.0.0.jar"; then ac_cv_file__usr_share_java_libserializer_1_0_0_jar=yes @@ -24678,20 +27146,20 @@ else ac_cv_file__usr_share_java_libserializer_1_0_0_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libserializer_1_0_0_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_libserializer_1_0_0_jar" >&6 -if test $ac_cv_file__usr_share_java_libserializer_1_0_0_jar = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libserializer_1_0_0_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_libserializer_1_0_0_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_libserializer_1_0_0_jar" = x""yes; then LIBSERIALIZER_JAR=/usr/share/java/libserializer-1.0.0.jar else - echo "$as_me:$LINENO: checking for /usr/share/java/libserializer.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/libserializer.jar... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for /usr/share/java/libserializer.jar" >&5 +$as_echo_n "checking for /usr/share/java/libserializer.jar... " >&6; } if test "${ac_cv_file__usr_share_java_libserializer_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "/usr/share/java/libserializer.jar"; then ac_cv_file__usr_share_java_libserializer_jar=yes @@ -24699,13 +27167,13 @@ else ac_cv_file__usr_share_java_libserializer_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libserializer_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_libserializer_jar" >&6 -if test $ac_cv_file__usr_share_java_libserializer_jar = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libserializer_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_libserializer_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_libserializer_jar" = x""yes; then LIBSERIALIZER_JAR=/usr/share/java/libserializer.jar else - { { echo "$as_me:$LINENO: error: libserializer.jar replacement not found." >&5 -echo "$as_me: error: libserializer.jar replacement not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: libserializer.jar replacement not found." >&5 +$as_echo "$as_me: error: libserializer.jar replacement not found." >&2;} { (exit 1); exit 1; }; } fi @@ -24715,15 +27183,15 @@ fi fi else - as_ac_File=`echo "ac_cv_file_$LIBSERIALIZER_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $LIBSERIALIZER_JAR" >&5 -echo $ECHO_N "checking for $LIBSERIALIZER_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$LIBSERIALIZER_JAR" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $LIBSERIALIZER_JAR" >&5 +$as_echo_n "checking for $LIBSERIALIZER_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "$LIBSERIALIZER_JAR"; then eval "$as_ac_File=yes" @@ -24731,13 +27199,17 @@ else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then : else - { { echo "$as_me:$LINENO: error: libserializer.jar not found." >&5 -echo "$as_me: error: libserializer.jar not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: libserializer.jar not found." >&5 +$as_echo "$as_me: error: libserializer.jar not found." >&2;} { (exit 1); exit 1; }; } fi @@ -24745,14 +27217,14 @@ fi if test -z $LIBBASE_JAR; then - echo "$as_me:$LINENO: checking for /usr/share/java/libbase-1.0.0.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/libbase-1.0.0.jar... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for /usr/share/java/libbase-1.0.0.jar" >&5 +$as_echo_n "checking for /usr/share/java/libbase-1.0.0.jar... " >&6; } if test "${ac_cv_file__usr_share_java_libbase_1_0_0_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "/usr/share/java/libbase-1.0.0.jar"; then ac_cv_file__usr_share_java_libbase_1_0_0_jar=yes @@ -24760,20 +27232,20 @@ else ac_cv_file__usr_share_java_libbase_1_0_0_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libbase_1_0_0_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_libbase_1_0_0_jar" >&6 -if test $ac_cv_file__usr_share_java_libbase_1_0_0_jar = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libbase_1_0_0_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_libbase_1_0_0_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_libbase_1_0_0_jar" = x""yes; then LIBBASE_JAR=/usr/share/java/libbase-1.0.0.jar else - echo "$as_me:$LINENO: checking for /usr/share/java/libbase.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/libbase.jar... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for /usr/share/java/libbase.jar" >&5 +$as_echo_n "checking for /usr/share/java/libbase.jar... " >&6; } if test "${ac_cv_file__usr_share_java_libbase_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "/usr/share/java/libbase.jar"; then ac_cv_file__usr_share_java_libbase_jar=yes @@ -24781,13 +27253,13 @@ else ac_cv_file__usr_share_java_libbase_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libbase_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_libbase_jar" >&6 -if test $ac_cv_file__usr_share_java_libbase_jar = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libbase_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_libbase_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_libbase_jar" = x""yes; then LIBBASE_JAR=/usr/share/java/libbase.jar else - { { echo "$as_me:$LINENO: error: libbase.jar replacement not found." >&5 -echo "$as_me: error: libbase.jar replacement not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: libbase.jar replacement not found." >&5 +$as_echo "$as_me: error: libbase.jar replacement not found." >&2;} { (exit 1); exit 1; }; } fi @@ -24797,15 +27269,15 @@ fi fi else - as_ac_File=`echo "ac_cv_file_$LIBBASE_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $LIBBASE_JAR" >&5 -echo $ECHO_N "checking for $LIBBASE_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$LIBBASE_JAR" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $LIBBASE_JAR" >&5 +$as_echo_n "checking for $LIBBASE_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "$LIBBASE_JAR"; then eval "$as_ac_File=yes" @@ -24813,29 +27285,33 @@ else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then : else - { { echo "$as_me:$LINENO: error: libbase.jar not found." >&5 -echo "$as_me: error: libbase.jar not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: libbase.jar not found." >&5 +$as_echo "$as_me: error: libbase.jar not found." >&2;} { (exit 1); exit 1; }; } fi fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 - echo "$as_me:$LINENO: checking for jfreereport module" >&5 -echo $ECHO_N "checking for jfreereport module... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: result: internal" >&5 +$as_echo "internal" >&6; } + { $as_echo "$as_me:$LINENO: checking for jfreereport module" >&5 +$as_echo_n "checking for jfreereport module... " >&6; } if test -d ./jfreereport; then - echo "$as_me:$LINENO: result: OK" >&5 -echo "${ECHO_T}OK" >&6 + { $as_echo "$as_me:$LINENO: result: OK" >&5 +$as_echo "OK" >&6; } else - { { echo "$as_me:$LINENO: error: not existing. get it (did you get the -extensions tarball?)" >&5 -echo "$as_me: error: not existing. get it (did you get the -extensions tarball?)" >&2;} + { { $as_echo "$as_me:$LINENO: error: not existing. get it (did you get the -extensions tarball?)" >&5 +$as_echo "$as_me: error: not existing. get it (did you get the -extensions tarball?)" >&2;} { (exit 1); exit 1; }; } fi SYSTEM_JFREEREPORT=NO @@ -24843,8 +27319,8 @@ echo "$as_me: error: not existing. get it (did you get the -extensions tarball?) fi BUILD_TYPE="$BUILD_TYPE REPORTBUILDER" else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } ENABLE_REPORTBUILDER=NO SYSTEM_JFREEREPORT=NO fi @@ -24865,25 +27341,25 @@ fi # this has to be here because both the wiki publisher and the SRB use # commons-logging if test "$ENABLE_MEDIAWIKI" = "YES" -o "$ENABLE_REPORTBUILDER" = "YES"; then - echo "$as_me:$LINENO: checking which Apache commons-* libs to use" >&5 -echo $ECHO_N "checking which Apache commons-* libs to use... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking which Apache commons-* libs to use" >&5 +$as_echo_n "checking which Apache commons-* libs to use... " >&6; } if test "$with_system_apache_commons" = "yes"; then SYSTEM_APACHE_COMMONS=YES - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:$LINENO: result: external" >&5 +$as_echo "external" >&6; } if test "$ENABLE_MEDIAWIKI" = "YES"; then if test -z "$COMMONS_CODEC_JAR"; then COMMONS_CODEC_JAR=/usr/share/java/commons-codec-1.3.jar fi - as_ac_File=`echo "ac_cv_file_$COMMONS_CODEC_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $COMMONS_CODEC_JAR" >&5 -echo $ECHO_N "checking for $COMMONS_CODEC_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$COMMONS_CODEC_JAR" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $COMMONS_CODEC_JAR" >&5 +$as_echo_n "checking for $COMMONS_CODEC_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "$COMMONS_CODEC_JAR"; then eval "$as_ac_File=yes" @@ -24891,28 +27367,32 @@ else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then : else - { { echo "$as_me:$LINENO: error: commons-codec.jar not found." >&5 -echo "$as_me: error: commons-codec.jar not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: commons-codec.jar not found." >&5 +$as_echo "$as_me: error: commons-codec.jar not found." >&2;} { (exit 1); exit 1; }; } fi if test -z "$COMMONS_LANG_JAR"; then COMMONS_LANG_JAR=/usr/share/java/commons-lang-2.3.jar fi - as_ac_File=`echo "ac_cv_file_$COMMONS_LANG_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $COMMONS_LANG_JAR" >&5 -echo $ECHO_N "checking for $COMMONS_LANG_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$COMMONS_LANG_JAR" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $COMMONS_LANG_JAR" >&5 +$as_echo_n "checking for $COMMONS_LANG_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "$COMMONS_LANG_JAR"; then eval "$as_ac_File=yes" @@ -24920,28 +27400,32 @@ else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then : else - { { echo "$as_me:$LINENO: error: commons-lang.jar not found." >&5 -echo "$as_me: error: commons-lang.jar not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: commons-lang.jar not found." >&5 +$as_echo "$as_me: error: commons-lang.jar not found." >&2;} { (exit 1); exit 1; }; } fi if test -z "$COMMONS_HTTPCLIENT_JAR"; then COMMONS_HTTPCLIENT_JAR=/usr/share/java/commons-httpclient-3.1.jar fi - as_ac_File=`echo "ac_cv_file_$COMMONS_HTTPCLIENT_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $COMMONS_HTTPCLIENT_JAR" >&5 -echo $ECHO_N "checking for $COMMONS_HTTPCLIENT_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$COMMONS_HTTPCLIENT_JAR" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $COMMONS_HTTPCLIENT_JAR" >&5 +$as_echo_n "checking for $COMMONS_HTTPCLIENT_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "$COMMONS_HTTPCLIENT_JAR"; then eval "$as_ac_File=yes" @@ -24949,13 +27433,17 @@ else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then : else - { { echo "$as_me:$LINENO: error: commons-httpclient.jar not found." >&5 -echo "$as_me: error: commons-httpclient.jar not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: commons-httpclient.jar not found." >&5 +$as_echo "$as_me: error: commons-httpclient.jar not found." >&2;} { (exit 1); exit 1; }; } fi @@ -24964,15 +27452,15 @@ fi if test -z "$COMMONS_LOGGING_JAR"; then COMMONS_LOGGING_JAR=/usr/share/java/commons-logging-1.1.1.jar fi - as_ac_File=`echo "ac_cv_file_$COMMONS_LOGGING_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $COMMONS_LOGGING_JAR" >&5 -echo $ECHO_N "checking for $COMMONS_LOGGING_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$COMMONS_LOGGING_JAR" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $COMMONS_LOGGING_JAR" >&5 +$as_echo_n "checking for $COMMONS_LOGGING_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "$COMMONS_LOGGING_JAR"; then eval "$as_ac_File=yes" @@ -24980,21 +27468,25 @@ else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_File'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then : else - { { echo "$as_me:$LINENO: error: commons-logging.jar not found." >&5 -echo "$as_me: error: commons-logging.jar not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: commons-logging.jar not found." >&5 +$as_echo "$as_me: error: commons-logging.jar not found." >&2;} { (exit 1); exit 1; }; } fi fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:$LINENO: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_APACHE_COMMONS=NO BUILD_TYPE="$BUILD_TYPE APACHE_COMMONS TOMCAT" fi @@ -25046,8 +27538,8 @@ if test "$test_kde" = "yes" -a "$ENABLE_KDE" = "TRUE" ; then kde_test_include="ksharedptr.h" kde_test_library="libkdeui.so" - echo "$as_me:$LINENO: checking for Qt headers" >&5 -echo $ECHO_N "checking for Qt headers... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for Qt headers" >&5 +$as_echo_n "checking for Qt headers... " >&6; } qt_incdir="no" for kde_check in $qt_incdirs ; do if test -r "$kde_check/$qt_test_include" ; then @@ -25055,18 +27547,18 @@ echo $ECHO_N "checking for Qt headers... $ECHO_C" >&6 break fi done - echo "$as_me:$LINENO: result: $qt_incdir" >&5 -echo "${ECHO_T}$qt_incdir" >&6 + { $as_echo "$as_me:$LINENO: result: $qt_incdir" >&5 +$as_echo "$qt_incdir" >&6; } if test "x$qt_incdir" = "xno" ; then - { { echo "$as_me:$LINENO: error: Qt headers not found. Please specify the root of + { { $as_echo "$as_me:$LINENO: error: Qt headers not found. Please specify the root of your Qt installation by exporting QTDIR before running \"configure\"." >&5 -echo "$as_me: error: Qt headers not found. Please specify the root of +$as_echo "$as_me: error: Qt headers not found. Please specify the root of your Qt installation by exporting QTDIR before running \"configure\"." >&2;} { (exit 1); exit 1; }; } fi - echo "$as_me:$LINENO: checking for Qt libraries" >&5 -echo $ECHO_N "checking for Qt libraries... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for Qt libraries" >&5 +$as_echo_n "checking for Qt libraries... " >&6; } qt_libdir="no" for qt_check in $qt_libdirs ; do if test -r "$qt_check/$qt_test_library" ; then @@ -25074,22 +27566,22 @@ echo $ECHO_N "checking for Qt libraries... $ECHO_C" >&6 break fi done - echo "$as_me:$LINENO: result: $qt_libdir" >&5 -echo "${ECHO_T}$qt_libdir" >&6 + { $as_echo "$as_me:$LINENO: result: $qt_libdir" >&5 +$as_echo "$qt_libdir" >&6; } if test "x$qt_libdir" = "xno" ; then - { { echo "$as_me:$LINENO: error: Qt libraries not found. Please specify the root of + { { $as_echo "$as_me:$LINENO: error: Qt libraries not found. Please specify the root of your Qt installation by exporting QTDIR before running \"configure\"." >&5 -echo "$as_me: error: Qt libraries not found. Please specify the root of +$as_echo "$as_me: error: Qt libraries not found. Please specify the root of your Qt installation by exporting QTDIR before running \"configure\"." >&2;} { (exit 1); exit 1; }; } fi # Extract the first word of "moc", so it can be a program name with args. set dummy moc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_MOC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $MOC in [\\/]* | ?:[\\/]*) @@ -25103,38 +27595,39 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MOC="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_path_MOC" && ac_cv_path_MOC="no" ;; esac fi MOC=$ac_cv_path_MOC - if test -n "$MOC"; then - echo "$as_me:$LINENO: result: $MOC" >&5 -echo "${ECHO_T}$MOC" >&6 + { $as_echo "$as_me:$LINENO: result: $MOC" >&5 +$as_echo "$MOC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + if test "$MOC" = "no" ; then - { { echo "$as_me:$LINENO: error: Qt Meta Object Compiler not found. Please specify + { { $as_echo "$as_me:$LINENO: error: Qt Meta Object Compiler not found. Please specify the root of your Qt installation by exporting QTDIR before running \"configure\"." >&5 -echo "$as_me: error: Qt Meta Object Compiler not found. Please specify +$as_echo "$as_me: error: Qt Meta Object Compiler not found. Please specify the root of your Qt installation by exporting QTDIR before running \"configure\"." >&2;} { (exit 1); exit 1; }; } fi - echo "$as_me:$LINENO: checking for KDE headers" >&5 -echo $ECHO_N "checking for KDE headers... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for KDE headers" >&5 +$as_echo_n "checking for KDE headers... " >&6; } kde_incdir="no" for kde_check in $kde_incdirs ; do if test -r "$kde_check/$kde_test_include" ; then @@ -25142,18 +27635,18 @@ echo $ECHO_N "checking for KDE headers... $ECHO_C" >&6 break fi done - echo "$as_me:$LINENO: result: $kde_incdir" >&5 -echo "${ECHO_T}$kde_incdir" >&6 + { $as_echo "$as_me:$LINENO: result: $kde_incdir" >&5 +$as_echo "$kde_incdir" >&6; } if test "x$kde_incdir" = "xno" ; then - { { echo "$as_me:$LINENO: error: KDE headers not found. Please specify the root of + { { $as_echo "$as_me:$LINENO: error: KDE headers not found. Please specify the root of your KDE installation by exporting KDEDIR before running \"configure\"." >&5 -echo "$as_me: error: KDE headers not found. Please specify the root of +$as_echo "$as_me: error: KDE headers not found. Please specify the root of your KDE installation by exporting KDEDIR before running \"configure\"." >&2;} { (exit 1); exit 1; }; } fi - echo "$as_me:$LINENO: checking for KDE libraries" >&5 -echo $ECHO_N "checking for KDE libraries... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for KDE libraries" >&5 +$as_echo_n "checking for KDE libraries... " >&6; } kde_libdir="no" for kde_check in $kde_libdirs ; do if test -r "$kde_check/$kde_test_library" ; then @@ -25161,12 +27654,12 @@ echo $ECHO_N "checking for KDE libraries... $ECHO_C" >&6 break fi done - echo "$as_me:$LINENO: result: $kde_libdir" >&5 -echo "${ECHO_T}$kde_libdir" >&6 + { $as_echo "$as_me:$LINENO: result: $kde_libdir" >&5 +$as_echo "$kde_libdir" >&6; } if test "x$kde_libdir" = "xno" ; then - { { echo "$as_me:$LINENO: error: KDE libraries not found. Please specify the root of + { { $as_echo "$as_me:$LINENO: error: KDE libraries not found. Please specify the root of your KDE installation by exporting KDEDIR before running \"configure\"." >&5 -echo "$as_me: error: KDE libraries not found. Please specify the root of +$as_echo "$as_me: error: KDE libraries not found. Please specify the root of your KDE installation by exporting KDEDIR before running \"configure\"." >&2;} { (exit 1); exit 1; }; } fi @@ -25178,34 +27671,34 @@ fi -echo "$as_me:$LINENO: checking whether to enable the lockdown pieces" >&5 -echo $ECHO_N "checking whether to enable the lockdown pieces... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to enable the lockdown pieces" >&5 +$as_echo_n "checking whether to enable the lockdown pieces... " >&6; } ENABLE_LOCKDOWN="" if test -n "$enable_lockdown" && test "$enable_lockdown" != "no"; then ENABLE_LOCKDOWN=YES - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi -echo "$as_me:$LINENO: checking whether to enable evolution 2 support" >&5 -echo $ECHO_N "checking whether to enable evolution 2 support... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to enable evolution 2 support" >&5 +$as_echo_n "checking whether to enable evolution 2 support... " >&6; } if test "$enable_evolution2" = "yes" -o "$enable_evolution2" = "TRUE"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=no if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -25218,28 +27711,29 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -25250,25 +27744,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for gobject-2.0" >&5 -echo $ECHO_N "checking for gobject-2.0... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for gobject-2.0" >&5 +$as_echo_n "checking for gobject-2.0... " >&6; } if $PKG_CONFIG --exists "gobject-2.0" ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking GOBJECT_CFLAGS" >&5 -echo $ECHO_N "checking GOBJECT_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking GOBJECT_CFLAGS" >&5 +$as_echo_n "checking GOBJECT_CFLAGS... " >&6; } GOBJECT_CFLAGS=`$PKG_CONFIG --cflags "gobject-2.0"` - echo "$as_me:$LINENO: result: $GOBJECT_CFLAGS" >&5 -echo "${ECHO_T}$GOBJECT_CFLAGS" >&6 + { $as_echo "$as_me:$LINENO: result: $GOBJECT_CFLAGS" >&5 +$as_echo "$GOBJECT_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking GOBJECT_LIBS" >&5 -echo $ECHO_N "checking GOBJECT_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking GOBJECT_LIBS" >&5 +$as_echo_n "checking GOBJECT_LIBS... " >&6; } GOBJECT_LIBS=`$PKG_CONFIG --libs "gobject-2.0"` - echo "$as_me:$LINENO: result: $GOBJECT_LIBS" >&5 -echo "${ECHO_T}$GOBJECT_LIBS" >&6 + { $as_echo "$as_me:$LINENO: result: $GOBJECT_LIBS" >&5 +$as_echo "$GOBJECT_LIBS" >&6; } else GOBJECT_CFLAGS="" GOBJECT_LIBS="" @@ -25289,27 +27783,27 @@ echo "${ECHO_T}$GOBJECT_LIBS" >&6 if test $succeeded = yes; then : else - { { echo "$as_me:$LINENO: error: Library requirements (gobject-2.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 -echo "$as_me: error: Library requirements (gobject-2.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} + { { $as_echo "$as_me:$LINENO: error: Library requirements (gobject-2.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 +$as_echo "$as_me: error: Library requirements (gobject-2.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} { (exit 1); exit 1; }; } fi ENABLE_EVOAB2="TRUE" else ENABLE_EVOAB2="" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi -echo "$as_me:$LINENO: checking whether to enable KDE address book support" >&5 -echo $ECHO_N "checking whether to enable KDE address book support... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to enable KDE address book support" >&5 +$as_echo_n "checking whether to enable KDE address book support... " >&6; } if test "$enable_kdeab" = "yes" && test "$enable_kde" = "yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - ac_ext=cc + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -25317,17 +27811,18 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu save_CXXFLAGS=$CXXFLAGS CXXFLAGS="$CXXFLAGS $KDE_CFLAGS" - echo "$as_me:$LINENO: checking whether KDE is between 3.2 and 3.6" >&5 -echo $ECHO_N "checking whether KDE is between 3.2 and 3.6... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking whether KDE is between 3.2 and 3.6" >&5 +$as_echo_n "checking whether KDE is between 3.2 and 3.6... " >&6; } if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling +$as_echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -25343,30 +27838,44 @@ int main(int argc, char **argv) { _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: KDE version too old or too recent, please use another version of KDE or disable KDE address book support" >&5 -echo "$as_me: error: KDE version too old or too recent, please use another version of KDE or disable KDE address book support" >&2;} +{ { $as_echo "$as_me:$LINENO: error: KDE version too old or too recent, please use another version of KDE or disable KDE address book support" >&5 +$as_echo "$as_me: error: KDE version too old or too recent, please use another version of KDE or disable KDE address book support" >&2;} { (exit 1); exit 1; }; } fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -rf conftest.dSYM +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + CXXFLAGS=$save_CXXFLAGS ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -25376,56 +27885,55 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu ENABLE_KAB=TRUE else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } ENABLE_KAB= fi -echo "$as_me:$LINENO: checking whether to include FontOOo" >&5 -echo $ECHO_N "checking whether to include FontOOo... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to include FontOOo" >&5 +$as_echo_n "checking whether to include FontOOo... " >&6; } if test -n "$enable_fontooo"; then if test "$enable_fontooo" = "no"; then - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } WITH_FONTOOO=NO SCPDEFS="$SCPDEFS -DWITHOUT_FONTOOO" else - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } WITH_FONTOOO=YES BUILD_TYPE="$BUILD_TYPE MSFONTEXTRACT" fi else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } WITH_FONTOOO=NO SCPDEFS="$SCPDEFS -DWITHOUT_FONTOOO" fi if test "$WITH_FONTOOO" = "YES"; then - echo "$as_me:$LINENO: checking whether to use system libmspack" >&5 -echo $ECHO_N "checking whether to use system libmspack... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking whether to use system libmspack" >&5 +$as_echo_n "checking whether to use system libmspack... " >&6; } if test -n "$with_system_mspack" -o -n "$with_system_libs" && \ test "$with_system_mspack" != "no"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } SYSTEM_MSPACK=YES if test "${ac_cv_header_mspack_h+set}" = set; then - echo "$as_me:$LINENO: checking for mspack.h" >&5 -echo $ECHO_N "checking for mspack.h... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for mspack.h" >&5 +$as_echo_n "checking for mspack.h... " >&6; } if test "${ac_cv_header_mspack_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_mspack_h" >&5 -echo "${ECHO_T}$ac_cv_header_mspack_h" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_mspack_h" >&5 +$as_echo "$ac_cv_header_mspack_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking mspack.h usability" >&5 -echo $ECHO_N "checking mspack.h usability... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking mspack.h usability" >&5 +$as_echo_n "checking mspack.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -25435,33 +27943,39 @@ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking mspack.h presence" >&5 -echo $ECHO_N "checking mspack.h presence... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking mspack.h presence" >&5 +$as_echo_n "checking mspack.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -25469,143 +27983,147 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: mspack.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: mspack.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: mspack.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: mspack.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: mspack.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: mspack.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mspack.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: mspack.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: mspack.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: mspack.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: mspack.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: mspack.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: mspack.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: mspack.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: mspack.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: mspack.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mspack.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: mspack.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mspack.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: mspack.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mspack.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: mspack.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mspack.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: mspack.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: mspack.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: mspack.h: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for mspack.h" >&5 -echo $ECHO_N "checking for mspack.h... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for mspack.h" >&5 +$as_echo_n "checking for mspack.h... " >&6; } if test "${ac_cv_header_mspack_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_mspack_h=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_mspack_h" >&5 -echo "${ECHO_T}$ac_cv_header_mspack_h" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_mspack_h" >&5 +$as_echo "$ac_cv_header_mspack_h" >&6; } fi -if test $ac_cv_header_mspack_h = yes; then +if test "x$ac_cv_header_mspack_h" = x""yes; then : else - { { echo "$as_me:$LINENO: error: mspack.h not found, install libmspack" >&5 -echo "$as_me: error: mspack.h not found, install libmspack" >&2;} + { { $as_echo "$as_me:$LINENO: error: mspack.h not found, install libmspack" >&5 +$as_echo "$as_me: error: mspack.h not found, install libmspack" >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: checking for mspack_create_cab_decompressor in -lmspack" >&5 -echo $ECHO_N "checking for mspack_create_cab_decompressor in -lmspack... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for mspack_create_cab_decompressor in -lmspack" >&5 +$as_echo_n "checking for mspack_create_cab_decompressor in -lmspack... " >&6; } if test "${ac_cv_lib_mspack_mspack_create_cab_decompressor+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmspack $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char mspack_create_cab_decompressor (); int main () { -mspack_create_cab_decompressor (); +return mspack_create_cab_decompressor (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_mspack_mspack_create_cab_decompressor=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_mspack_mspack_create_cab_decompressor=no + ac_cv_lib_mspack_mspack_create_cab_decompressor=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_mspack_mspack_create_cab_decompressor" >&5 -echo "${ECHO_T}$ac_cv_lib_mspack_mspack_create_cab_decompressor" >&6 -if test $ac_cv_lib_mspack_mspack_create_cab_decompressor = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_mspack_mspack_create_cab_decompressor" >&5 +$as_echo "$ac_cv_lib_mspack_mspack_create_cab_decompressor" >&6; } +if test "x$ac_cv_lib_mspack_mspack_create_cab_decompressor" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBMSPACK 1 _ACEOF @@ -25613,73 +28131,73 @@ _ACEOF LIBS="-lmspack $LIBS" else - { { echo "$as_me:$LINENO: error: libmspack not installed or functional" >&5 -echo "$as_me: error: libmspack not installed or functional" >&2;} + { { $as_echo "$as_me:$LINENO: error: libmspack not installed or functional" >&5 +$as_echo "$as_me: error: libmspack not installed or functional" >&2;} { (exit 1); exit 1; }; } fi else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } SYSTEM_MSPACK=NO fi fi -echo "$as_me:$LINENO: checking whether to include MathMLDTD" >&5 -echo $ECHO_N "checking whether to include MathMLDTD... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to include MathMLDTD" >&5 +$as_echo_n "checking whether to include MathMLDTD... " >&6; } if test -n "$enable_mathmldtd"; then if test "$enable_mathmldtd" = "no"; then - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } SCPDEFS="$SCPDEFS -DWITHOUT_MATHMLDTD" else - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } BUILD_TYPE="$BUILD_TYPE MATHMLDTD" fi else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } SCPDEFS="$SCPDEFS -DWITHOUT_MATHMLDTD" fi -echo "$as_me:$LINENO: checking whether to include Bitstream Vera fonts" >&5 -echo $ECHO_N "checking whether to include Bitstream Vera fonts... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to include Bitstream Vera fonts" >&5 +$as_echo_n "checking whether to include Bitstream Vera fonts... " >&6; } if test "$with_fonts" != "no" ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } WITH_FONTS=YES BUILD_TYPE="$BUILD_TYPE BITSTREAM_VERA_FONTS" else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } WITH_FONTS=NO SCPDEFS="$SCPDEFS -DWITHOUT_FONTS" fi -echo "$as_me:$LINENO: checking whether to include PPDs" >&5 -echo $ECHO_N "checking whether to include PPDs... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to include PPDs" >&5 +$as_echo_n "checking whether to include PPDs... " >&6; } if test "$with_ppds" != "no"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } WITHOUT_PPDS=YES SCPDEFS="$SCPDEFS -DWITHOUT_PPDS" fi -echo "$as_me:$LINENO: checking whether to include AFMs" >&5 -echo $ECHO_N "checking whether to include AFMs... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to include AFMs" >&5 +$as_echo_n "checking whether to include AFMs... " >&6; } if test "$with_afms" != "no"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } WITHOUT_AFMS=YES SCPDEFS="$SCPDEFS -DWITHOUT_AFMS" fi @@ -25687,13 +28205,13 @@ fi -echo "$as_me:$LINENO: checking whether and how to use Xinerama" >&5 -echo $ECHO_N "checking whether and how to use Xinerama... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether and how to use Xinerama" >&5 +$as_echo_n "checking whether and how to use Xinerama... " >&6; } if test "$_os" = "Darwin"; then USE_XINERAMA=YES XINERAMA_LINK=dynamic - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } elif test "$_os" = "Linux" -o "$_os" = "FreeBSD"; then if test -e "$XLIB/libXinerama.so" -a -e "$XLIB/libXinerama.a"; then # we have both versions, let the user decide but use the dynamic one @@ -25723,22 +28241,21 @@ elif test "$_os" = "Linux" -o "$_os" = "FreeBSD"; then XINERAMA_LINK=none fi if test "$USE_XINERAMA" = "YES"; then - echo "$as_me:$LINENO: result: yes, with $XINERAMA_LINK linking" >&5 -echo "${ECHO_T}yes, with $XINERAMA_LINK linking" >&6 + { $as_echo "$as_me:$LINENO: result: yes, with $XINERAMA_LINK linking" >&5 +$as_echo "yes, with $XINERAMA_LINK linking" >&6; } if test "${ac_cv_header_X11_extensions_Xinerama_h+set}" = set; then - echo "$as_me:$LINENO: checking for X11/extensions/Xinerama.h" >&5 -echo $ECHO_N "checking for X11/extensions/Xinerama.h... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking for X11/extensions/Xinerama.h" >&5 +$as_echo_n "checking for X11/extensions/Xinerama.h... " >&6; } if test "${ac_cv_header_X11_extensions_Xinerama_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_Xinerama_h" >&5 -echo "${ECHO_T}$ac_cv_header_X11_extensions_Xinerama_h" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_Xinerama_h" >&5 +$as_echo "$ac_cv_header_X11_extensions_Xinerama_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking X11/extensions/Xinerama.h usability" >&5 -echo $ECHO_N "checking X11/extensions/Xinerama.h usability... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking X11/extensions/Xinerama.h usability" >&5 +$as_echo_n "checking X11/extensions/Xinerama.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -25748,33 +28265,39 @@ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking X11/extensions/Xinerama.h presence" >&5 -echo $ECHO_N "checking X11/extensions/Xinerama.h presence... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking X11/extensions/Xinerama.h presence" >&5 +$as_echo_n "checking X11/extensions/Xinerama.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -25782,83 +28305,76 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: X11/extensions/Xinerama.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: X11/extensions/Xinerama.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/extensions/Xinerama.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: X11/extensions/Xinerama.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: X11/extensions/Xinerama.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: X11/extensions/Xinerama.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: X11/extensions/Xinerama.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: X11/extensions/Xinerama.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: X11/extensions/Xinerama.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: X11/extensions/Xinerama.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/extensions/Xinerama.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: X11/extensions/Xinerama.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/extensions/Xinerama.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: X11/extensions/Xinerama.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: X11/extensions/Xinerama.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: X11/extensions/Xinerama.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: X11/extensions/Xinerama.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: X11/extensions/Xinerama.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: X11/extensions/Xinerama.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: X11/extensions/Xinerama.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: X11/extensions/Xinerama.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: X11/extensions/Xinerama.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: X11/extensions/Xinerama.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: X11/extensions/Xinerama.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: X11/extensions/Xinerama.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: X11/extensions/Xinerama.h: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for X11/extensions/Xinerama.h" >&5 -echo $ECHO_N "checking for X11/extensions/Xinerama.h... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for X11/extensions/Xinerama.h" >&5 +$as_echo_n "checking for X11/extensions/Xinerama.h... " >&6; } if test "${ac_cv_header_X11_extensions_Xinerama_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_header_X11_extensions_Xinerama_h=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_Xinerama_h" >&5 -echo "${ECHO_T}$ac_cv_header_X11_extensions_Xinerama_h" >&6 +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_Xinerama_h" >&5 +$as_echo "$ac_cv_header_X11_extensions_Xinerama_h" >&6; } fi -if test $ac_cv_header_X11_extensions_Xinerama_h = yes; then +if test "x$ac_cv_header_X11_extensions_Xinerama_h" = x""yes; then : else - { { echo "$as_me:$LINENO: error: Xinerama header not found." >&5 -echo "$as_me: error: Xinerama header not found." >&2;} + { { $as_echo "$as_me:$LINENO: error: Xinerama header not found." >&5 +$as_echo "$as_me: error: Xinerama header not found." >&2;} { (exit 1); exit 1; }; } fi @@ -25871,61 +28387,72 @@ fi XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -ldl" fi -echo "$as_me:$LINENO: checking for XineramaIsActive in -lXinerama" >&5 -echo $ECHO_N "checking for XineramaIsActive in -lXinerama... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for XineramaIsActive in -lXinerama" >&5 +$as_echo_n "checking for XineramaIsActive in -lXinerama... " >&6; } if test "${ac_cv_lib_Xinerama_XineramaIsActive+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXinerama $XINERAMA_EXTRA_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char XineramaIsActive (); int main () { -XineramaIsActive (); +return XineramaIsActive (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_Xinerama_XineramaIsActive=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_Xinerama_XineramaIsActive=no + ac_cv_lib_Xinerama_XineramaIsActive=no fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +rm -rf conftest.dSYM +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_Xinerama_XineramaIsActive" >&5 -echo "${ECHO_T}$ac_cv_lib_Xinerama_XineramaIsActive" >&6 -if test $ac_cv_lib_Xinerama_XineramaIsActive = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xinerama_XineramaIsActive" >&5 +$as_echo "$ac_cv_lib_Xinerama_XineramaIsActive" >&6; } +if test "x$ac_cv_lib_Xinerama_XineramaIsActive" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBXINERAMA 1 _ACEOF @@ -25933,18 +28460,18 @@ _ACEOF LIBS="-lXinerama $LIBS" else - { { echo "$as_me:$LINENO: error: Xinerama not functional?" >&5 -echo "$as_me: error: Xinerama not functional?" >&2;} + { { $as_echo "$as_me:$LINENO: error: Xinerama not functional?" >&5 +$as_echo "$as_me: error: Xinerama not functional?" >&2;} { (exit 1); exit 1; }; } fi else - echo "$as_me:$LINENO: result: no, libXinerama not found or wrong architecture." >&5 -echo "${ECHO_T}no, libXinerama not found or wrong architecture." >&6 + { $as_echo "$as_me:$LINENO: result: no, libXinerama not found or wrong architecture." >&5 +$as_echo "no, libXinerama not found or wrong architecture." >&6; } fi else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -25958,10 +28485,10 @@ if test -z "$with_ant_home"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_ANT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $ANT in [\\/]* | ?:[\\/]*) @@ -25974,27 +28501,28 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ANT="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi ANT=$ac_cv_path_ANT - if test -n "$ANT"; then - echo "$as_me:$LINENO: result: $ANT" >&5 -echo "${ECHO_T}$ANT" >&6 + { $as_echo "$as_me:$LINENO: result: $ANT" >&5 +$as_echo "$ANT" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$ANT" && break done @@ -26006,10 +28534,10 @@ else do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_ANT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $ANT in [\\/]* | ?:[\\/]*) @@ -26023,27 +28551,28 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ANT="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi ANT=$ac_cv_path_ANT - if test -n "$ANT"; then - echo "$as_me:$LINENO: result: $ANT" >&5 -echo "${ECHO_T}$ANT" >&6 + { $as_echo "$as_me:$LINENO: result: $ANT" >&5 +$as_echo "$ANT" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$ANT" && break done @@ -26052,8 +28581,8 @@ done fi if test -z "$ANT"; then - { { echo "$as_me:$LINENO: error: Ant not found - Make sure it's in the path or use --with-ant-home" >&5 -echo "$as_me: error: Ant not found - Make sure it's in the path or use --with-ant-home" >&2;} + { { $as_echo "$as_me:$LINENO: error: Ant not found - Make sure it's in the path or use --with-ant-home" >&5 +$as_echo "$as_me: error: Ant not found - Make sure it's in the path or use --with-ant-home" >&2;} { (exit 1); exit 1; }; } else # resolve relative or absolute symlink @@ -26079,8 +28608,8 @@ else fi ant_minminor1=`echo $ant_minver | cut -d"." -f2` - echo "$as_me:$LINENO: checking whether ant is >= $ant_minver" >&5 -echo $ECHO_N "checking whether ant is >= $ant_minver... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking whether ant is >= $ant_minver" >&5 +$as_echo_n "checking whether ant is >= $ant_minver... " >&6; } ant_version=`$ANT -version | $AWK '{ print $4; }'` ant_version_major=`echo $ant_version | cut -d. -f1` ant_version_minor=`echo $ant_version | cut -d. -f2` @@ -26088,18 +28617,18 @@ echo "configure: ant_version $ant_version " >&5 echo "configure: ant_version_major $ant_version_major " >&5 echo "configure: ant_version_minor $ant_version_minor " >&5 if test "$ant_version_major" -ge "2"; then - echo "$as_me:$LINENO: result: yes, $ant_version" >&5 -echo "${ECHO_T}yes, $ant_version" >&6 + { $as_echo "$as_me:$LINENO: result: yes, $ant_version" >&5 +$as_echo "yes, $ant_version" >&6; } elif test "$ant_version_major" = "1" && test "$ant_version_minor" -ge "$ant_minminor1"; then - echo "$as_me:$LINENO: result: yes, $ant_version" >&5 -echo "${ECHO_T}yes, $ant_version" >&6 + { $as_echo "$as_me:$LINENO: result: yes, $ant_version" >&5 +$as_echo "yes, $ant_version" >&6; } else - { { echo "$as_me:$LINENO: error: no, you need at least ant >= $ant_minver" >&5 -echo "$as_me: error: no, you need at least ant >= $ant_minver" >&2;} + { { $as_echo "$as_me:$LINENO: error: no, you need at least ant >= $ant_minver" >&5 +$as_echo "$as_me: error: no, you need at least ant >= $ant_minver" >&2;} { (exit 1); exit 1; }; } fi - echo "$as_me:$LINENO: checking if $ANT works" >&5 -echo $ECHO_N "checking if $ANT works... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking if $ANT works" >&5 +$as_echo_n "checking if $ANT works... " >&6; } cat > conftest.java << EOF public class conftest { int testmethod(int a, int b) { @@ -26126,11 +28655,11 @@ EOF { (eval echo "$as_me:$LINENO: \"$ant_cmd\"") >&5 (eval $ant_cmd) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } if test $? = 0 && test -f ./conftest.class ; then - echo "$as_me:$LINENO: result: Ant works" >&5 -echo "${ECHO_T}Ant works" >&6 + { $as_echo "$as_me:$LINENO: result: Ant works" >&5 +$as_echo "Ant works" >&6; } if test -z "$WITH_ANT_HOME"; then ANT_HOME=`$ANT -diagnostics | $EGREP "ant.home :" | $SED -e "s#ant.home : ##g"` if test -z "$ANT_HOME"; then @@ -26143,8 +28672,8 @@ echo "${ECHO_T}Ant works" >&6 echo "configure: Ant test failed" >&5 cat conftest.java >&5 cat conftest.xml >&5 - { echo "$as_me:$LINENO: WARNING: Ant does not work - Some Java projects will not build!" >&5 -echo "$as_me: WARNING: Ant does not work - Some Java projects will not build!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: Ant does not work - Some Java projects will not build!" >&5 +$as_echo "$as_me: WARNING: Ant does not work - Some Java projects will not build!" >&2;} ANT_HOME="" echo "Ant does not work - Some Java projects will not build!" >>warn fi @@ -26157,8 +28686,8 @@ fi if test "$ANT_HOME" != "NO_ANT_HOME"; then - echo "$as_me:$LINENO: checking Ant lib directory" >&5 -echo $ECHO_N "checking Ant lib directory... $ECHO_C" >&6 + { $as_echo "$as_me:$LINENO: checking Ant lib directory" >&5 +$as_echo_n "checking Ant lib directory... " >&6; } if test -f $ANT_HOME/lib/ant.jar; then ANT_LIB="$ANT_HOME/lib" else @@ -26174,23 +28703,23 @@ echo $ECHO_N "checking Ant lib directory... $ECHO_C" >&6 if test -f $ANT_HOME/lib/ant/ant.jar; then ANT_LIB="$ANT_HOME/lib/ant" else - { { echo "$as_me:$LINENO: error: Ant libraries not found!" >&5 -echo "$as_me: error: Ant libraries not found!" >&2;} + { { $as_echo "$as_me:$LINENO: error: Ant libraries not found!" >&5 +$as_echo "$as_me: error: Ant libraries not found!" >&2;} { (exit 1); exit 1; }; } fi fi fi fi fi - echo "$as_me:$LINENO: result: Ant lib directory found." >&5 -echo "${ECHO_T}Ant lib directory found." >&6 + { $as_echo "$as_me:$LINENO: result: Ant lib directory found." >&5 +$as_echo "Ant lib directory found." >&6; } fi fi if test "$ENABLE_MEDIAWIKI" = "YES"; then -echo "$as_me:$LINENO: checking whether ant supports mapper type=\"regexp\"" >&5 -echo $ECHO_N "checking whether ant supports mapper type=\"regexp\"... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether ant supports mapper type=\"regexp\"" >&5 +$as_echo_n "checking whether ant supports mapper type=\"regexp\"... " >&6; } rm -rf confdir mkdir confdir cat > conftest.java << EOF @@ -26225,178 +28754,178 @@ EOF { (eval echo "$as_me:$LINENO: \"$ant_cmd\"") >&5 (eval $ant_cmd) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } if test $? = 0 && test -f ./conftest.class ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } rm -rf confdir else echo "configure: Ant test failed" >&5 cat conftest.java >&5 cat conftest.xml >&5 rm -rf confdir - { { echo "$as_me:$LINENO: error: no. Did you install ant-apache-regexp?" >&5 -echo "$as_me: error: no. Did you install ant-apache-regexp?" >&2;} + { { $as_echo "$as_me:$LINENO: error: no. Did you install ant-apache-regexp?" >&5 +$as_echo "$as_me: error: no. Did you install ant-apache-regexp?" >&2;} { (exit 1); exit 1; }; } fi fi rm -f conftest* core core.* *.core -echo "$as_me:$LINENO: checking which languages to be built" >&5 -echo $ECHO_N "checking which languages to be built... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking which languages to be built" >&5 +$as_echo_n "checking which languages to be built... " >&6; } WITH_LANG="$with_lang" if test -z "$WITH_LANG"; then - echo "$as_me:$LINENO: result: en-US" >&5 -echo "${ECHO_T}en-US" >&6 + { $as_echo "$as_me:$LINENO: result: en-US" >&5 +$as_echo "en-US" >&6; } else - echo "$as_me:$LINENO: result: $WITH_LANG" >&5 -echo "${ECHO_T}$WITH_LANG" >&6 + { $as_echo "$as_me:$LINENO: result: $WITH_LANG" >&5 +$as_echo "$WITH_LANG" >&6; } fi -echo "$as_me:$LINENO: checking which languages have poor help localizations" >&5 -echo $ECHO_N "checking which languages have poor help localizations... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking which languages have poor help localizations" >&5 +$as_echo_n "checking which languages have poor help localizations... " >&6; } WITH_POOR_HELP_LOCALIZATIONS="$with_poor_help_localizations" if test -z "$WITH_POOR_HELP_LOCALIZATIONS"; then - echo "$as_me:$LINENO: result: none" >&5 -echo "${ECHO_T}none" >&6 + { $as_echo "$as_me:$LINENO: result: none" >&5 +$as_echo "none" >&6; } else - echo "$as_me:$LINENO: result: $WITH_POOR_HELP_LOCALIZATIONS" >&5 -echo "${ECHO_T}$WITH_POOR_HELP_LOCALIZATIONS" >&6 + { $as_echo "$as_me:$LINENO: result: $WITH_POOR_HELP_LOCALIZATIONS" >&5 +$as_echo "$WITH_POOR_HELP_LOCALIZATIONS" >&6; } fi -echo "$as_me:$LINENO: checking which dictionaries to include" >&5 -echo $ECHO_N "checking which dictionaries to include... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking which dictionaries to include" >&5 +$as_echo_n "checking which dictionaries to include... " >&6; } if test -z "$with_dict"; then WITH_DICT=,ALL, - echo "$as_me:$LINENO: result: ALL" >&5 -echo "${ECHO_T}ALL" >&6 + { $as_echo "$as_me:$LINENO: result: ALL" >&5 +$as_echo "ALL" >&6; } else WITH_DICT=","$with_dict"," - echo "$as_me:$LINENO: result: $with_dict" >&5 -echo "${ECHO_T}$with_dict" >&6 + { $as_echo "$as_me:$LINENO: result: $with_dict" >&5 +$as_echo "$with_dict" >&6; } fi -echo "$as_me:$LINENO: checking for additional 'intro' bitmaps" >&5 -echo $ECHO_N "checking for additional 'intro' bitmaps... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for additional 'intro' bitmaps" >&5 +$as_echo_n "checking for additional 'intro' bitmaps... " >&6; } INTRO_BITMAPS= if test -z "$with_intro_bitmaps" -o "$with_intro_bitmaps" = "no" ; then INTRO_BITMAPS= - echo "$as_me:$LINENO: result: none" >&5 -echo "${ECHO_T}none" >&6 + { $as_echo "$as_me:$LINENO: result: none" >&5 +$as_echo "none" >&6; } else for bitmap in `echo $with_intro_bitmaps | tr ',' ' '` ; do case "$bitmap" in *.bmp) ;; - *) bitmap= ; { echo "$as_me:$LINENO: WARNING: Intro bitmaps should be .bmp files!" >&5 -echo "$as_me: WARNING: Intro bitmaps should be .bmp files!" >&2;} ;; + *) bitmap= ; { $as_echo "$as_me:$LINENO: WARNING: Intro bitmaps should be .bmp files!" >&5 +$as_echo "$as_me: WARNING: Intro bitmaps should be .bmp files!" >&2;} ;; esac if test -n "$bitmap" ; then INTRO_BITMAPS="$INTRO_BITMAPS $bitmap" fi done - echo "$as_me:$LINENO: result: $INTRO_BITMAPS" >&5 -echo "${ECHO_T}$INTRO_BITMAPS" >&6 + { $as_echo "$as_me:$LINENO: result: $INTRO_BITMAPS" >&5 +$as_echo "$INTRO_BITMAPS" >&6; } fi -echo "$as_me:$LINENO: checking for additional 'about' bitmaps" >&5 -echo $ECHO_N "checking for additional 'about' bitmaps... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for additional 'about' bitmaps" >&5 +$as_echo_n "checking for additional 'about' bitmaps... " >&6; } ABOUT_BITMAPS= if test -z "$with_about_bitmaps" -o "$with_about_bitmaps" = "no" ; then ABOUT_BITMAPS= - echo "$as_me:$LINENO: result: none" >&5 -echo "${ECHO_T}none" >&6 + { $as_echo "$as_me:$LINENO: result: none" >&5 +$as_echo "none" >&6; } else for bitmap in `echo $with_about_bitmaps | tr ',' ' '` ; do case "$bitmap" in *.bmp) ;; - *) bitmap= ; { echo "$as_me:$LINENO: WARNING: About bitmaps should be .bmp files!" >&5 -echo "$as_me: WARNING: About bitmaps should be .bmp files!" >&2;} ;; + *) bitmap= ; { $as_echo "$as_me:$LINENO: WARNING: About bitmaps should be .bmp files!" >&5 +$as_echo "$as_me: WARNING: About bitmaps should be .bmp files!" >&2;} ;; esac if test -n "$bitmap" ; then ABOUT_BITMAPS="$ABOUT_BITMAPS $bitmap" fi done - echo "$as_me:$LINENO: result: $ABOUT_BITMAPS" >&5 -echo "${ECHO_T}$ABOUT_BITMAPS" >&6 + { $as_echo "$as_me:$LINENO: result: $ABOUT_BITMAPS" >&5 +$as_echo "$ABOUT_BITMAPS" >&6; } fi OOO_VENDOR= -echo "$as_me:$LINENO: checking for vendor" >&5 -echo $ECHO_N "checking for vendor... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for vendor" >&5 +$as_echo_n "checking for vendor... " >&6; } if test -z "$with_vendor" -o "$with_vendor" = "no" ; then - echo "$as_me:$LINENO: result: not set" >&5 -echo "${ECHO_T}not set" >&6 + { $as_echo "$as_me:$LINENO: result: not set" >&5 +$as_echo "not set" >&6; } else OOO_VENDOR="$with_vendor" - echo "$as_me:$LINENO: result: $OOO_VENDOR" >&5 -echo "${ECHO_T}$OOO_VENDOR" >&6 + { $as_echo "$as_me:$LINENO: result: $OOO_VENDOR" >&5 +$as_echo "$OOO_VENDOR" >&6; } fi UNIXWRAPPERNAME= -echo "$as_me:$LINENO: checking for UNIX wrapper name" >&5 -echo $ECHO_N "checking for UNIX wrapper name... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking for UNIX wrapper name" >&5 +$as_echo_n "checking for UNIX wrapper name... " >&6; } if test -z "$with_unix_wrapper" -o "$with_unix_wrapper" = "no" -o "$with_unix_wrapper" = "yes" ; then - echo "$as_me:$LINENO: result: not set" >&5 -echo "${ECHO_T}not set" >&6 + { $as_echo "$as_me:$LINENO: result: not set" >&5 +$as_echo "not set" >&6; } else UNIXWRAPPERNAME="$with_unix_wrapper" - echo "$as_me:$LINENO: result: $UNIXWRAPPERNAME" >&5 -echo "${ECHO_T}$UNIXWRAPPERNAME" >&6 + { $as_echo "$as_me:$LINENO: result: $UNIXWRAPPERNAME" >&5 +$as_echo "$UNIXWRAPPERNAME" >&6; } fi -echo "$as_me:$LINENO: checking whether to statically link to Gtk" >&5 -echo $ECHO_N "checking whether to statically link to Gtk... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to statically link to Gtk" >&5 +$as_echo_n "checking whether to statically link to Gtk... " >&6; } if test -n "$enable_static_gtk" && test "$enable_static_gtk" != "no"; then ENABLE_STATIC_GTK="TRUE" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else ENABLE_STATIC_GTK="FALSE" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi -echo "$as_me:$LINENO: checking whether to use layout dialogs" >&5 -echo $ECHO_N "checking whether to use layout dialogs... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking whether to use layout dialogs" >&5 +$as_echo_n "checking whether to use layout dialogs... " >&6; } if test -n "$enable_layout" && test "$enable_layout" != "no"; then ENABLE_LAYOUT="TRUE" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else ENABLE_LAYOUT="FALSE" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi # =================================================================== # De- or increase default verbosity of build process # =================================================================== -echo "$as_me:$LINENO: checking build verbosity" >&5 -echo $ECHO_N "checking build verbosity... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking build verbosity" >&5 +$as_echo_n "checking build verbosity... " >&6; } if test -n "$enable_verbose"; then if test "$enable_verbose" == "yes"; then VERBOSE="TRUE" - echo "$as_me:$LINENO: result: high" >&5 -echo "${ECHO_T}high" >&6 + { $as_echo "$as_me:$LINENO: result: high" >&5 +$as_echo "high" >&6; } fi if test "$enable_verbose" == "no"; then VERBOSE="FALSE" - echo "$as_me:$LINENO: result: low" >&5 -echo "${ECHO_T}low" >&6 + { $as_echo "$as_me:$LINENO: result: low" >&5 +$as_echo "low" >&6; } fi else - echo "$as_me:$LINENO: result: not set" >&5 -echo "${ECHO_T}not set" >&6 + { $as_echo "$as_me:$LINENO: result: not set" >&5 +$as_echo "not set" >&6; } fi @@ -26407,22 +28936,22 @@ echo "* *" echo "********************************************************************" if test -z "$COMPATH"; then - { { echo "$as_me:$LINENO: error: No compiler found." >&5 -echo "$as_me: error: No compiler found." >&2;} + { { $as_echo "$as_me:$LINENO: error: No compiler found." >&5 +$as_echo "$as_me: error: No compiler found." >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: checking solver path" >&5 -echo $ECHO_N "checking solver path... $ECHO_C" >&6 +{ $as_echo "$as_me:$LINENO: checking solver path" >&5 +$as_echo_n "checking solver path... " >&6; } if test -z "$with_local_solver"; then LOCAL_SOLVER="DEFAULT" - echo "$as_me:$LINENO: result: default" >&5 -echo "${ECHO_T}default" >&6 + { $as_echo "$as_me:$LINENO: result: default" >&5 +$as_echo "default" >&6; } else LOCAL_SOLVER=$with_local_solver - echo "$as_me:$LINENO: result: $with_local_solver" >&5 -echo "${ECHO_T}$with_local_solver" >&6 + { $as_echo "$as_me:$LINENO: result: $with_local_solver" >&5 +$as_echo "$with_local_solver" >&6; } fi @@ -26431,7 +28960,8 @@ fi # make sure config.guess is +x; we execute config.guess, so it has to be so; chmod +x ./config.guess - ac_config_files="$ac_config_files set_soenv Makefile" +ac_config_files="$ac_config_files set_soenv Makefile" + cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure @@ -26450,39 +28980,59 @@ _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. +# So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. -{ +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} | + esac | + sort +) | sed ' + /^ac_cv_env_/b end t clear - : clear + :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -if diff $cache_file confcache >/dev/null 2>&1; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else - echo "not updating unwritable cache $cache_file" + { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -26491,63 +29041,54 @@ test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/; -s/:*\${srcdir}:*/:/; -s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; -s/:*$//; -s/^[^=]*=[ ]*$//; -}' -fi - # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that -# take arguments), then we branch to the quote section. Otherwise, +# take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. -cat >confdef2opt.sed <<\_ACEOF +ac_script=' +:mline +/\\$/{ + N + s,\\\n,, + b mline +} t clear -: clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote -d -: quote -s,[ `~#$^&*(){}\\|;'"<>?],\\&,g -s,\[,\\&,g -s,\],\\&,g -s,\$,$$,g -p -_ACEOF -# We use echo to avoid assuming a particular line-breaking character. -# The extra dot is to prevent the shell from consuming trailing -# line-breaks from the sub-command output. A line-break within -# single-quotes doesn't work because, if this script is created in a -# platform that uses two characters for line-breaks (e.g., DOS), tr -# would break. -ac_LF_and_DOT=`echo; echo .` -DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` -rm -f confdef2opt.sed +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. - ac_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` - # 2. Add them. - ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs @@ -26555,12 +29096,14 @@ LTLIBOBJS=$ac_ltlibobjs + : ${CONFIG_STATUS=./config.status} +ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF +{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. @@ -26573,57 +29116,141 @@ ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## -# Be Bourne compatible +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } fi # Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + # Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var - fi -done +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE # Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false @@ -26631,200 +29258,168 @@ fi # Name of the executable. -as_me=`$as_basename "$0" || +as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits +# CDPATH. +$as_unset CDPATH -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi as_lineno_1=$LINENO as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 -echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || - { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 -echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; -esac +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi -if expr a : '\(a\)' >/dev/null 2>&1; then +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' fi -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else + test -d ./-p && rmdir ./-p as_mkdir_p=false fi -as_executable_p="test -f" +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. -as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - exec 6>&1 -# Open the log real soon, to keep \$[0] and so on meaningful, and to +# Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. Logging --version etc. is OK. -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX -} >&5 -cat >&5 <<_CSEOF - +# values after options handling. +ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.57. Invocation command line was +generated by GNU Autoconf 2.63. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -26832,125 +29427,107 @@ generated by GNU Autoconf 2.57. Invocation command line was CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ -_CSEOF -echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 -echo >&5 +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + _ACEOF -# Files that config.status was made for. -if test -n "$ac_config_files"; then - echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS -fi +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac -if test -n "$ac_config_headers"; then - echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS -fi -if test -n "$ac_config_links"; then - echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS -fi -if test -n "$ac_config_commands"; then - echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS -fi +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" -cat >>$CONFIG_STATUS <<\_ACEOF +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. -Usage: $0 [OPTIONS] [FILE]... +Usage: $0 [OPTION]... [FILE]... -h, --help print this help, then exit - -V, --version print version number, then exit - -q, --quiet do not print progress messages + -V, --version print version number and configuration settings, then exit + -q, --quiet, --silent + do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] + --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to ." -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.57, - with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" +configured by $0, generated by GNU Autoconf 2.63, + with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" -Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 -Free Software Foundation, Inc. +Copyright (C) 2008 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." -srcdir=$srcdir + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +AWK='$AWK' +test -n "\$AWK" || AWK=awk _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) - ac_option=`expr "x$1" : 'x\([^=]*\)='` - ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; - -*) + *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; - *) # This is not an option, so the user has probably given explicit - # arguments. - ac_option=$1 - ac_need_defaults=false;; esac case $ac_option in # Handling of the options. -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; - --version | --vers* | -V ) - echo "$ac_cs_version"; exit 0 ;; - --he | --h) - # Conflict between --help and --header - { { echo "$as_me:$LINENO: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit 0 ;; - --debug | --d* | -d ) + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2;} + -*) { $as_echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; - *) ac_config_targets="$ac_config_targets $1" ;; + *) ac_config_targets="$ac_config_targets $1" + ac_need_defaults=false ;; esac shift @@ -26964,31 +29541,47 @@ if $ac_cs_silent; then fi _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" fi _ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - - -cat >>$CONFIG_STATUS <<\_ACEOF +# Handling of arguments. for ac_config_target in $ac_config_targets do - case "$ac_config_target" in - # Handling of arguments. - "set_soenv" ) CONFIG_FILES="$CONFIG_FILES set_soenv" ;; - "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + case $ac_config_target in + "set_soenv") CONFIG_FILES="$CONFIG_FILES set_soenv" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + + *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done + # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely @@ -26998,617 +29591,464 @@ if $ac_need_defaults; then fi # Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason to put it here, and in addition, +# simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. -# Create a temporary directory, and hook for its removal unless debugging. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. $debug || { - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } - # Create a (secure) tmp directory for tmp files. { - tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { - tmp=./confstat$$-$RANDOM - (umask 077 && mkdir $tmp) + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") } || { - echo "$me: cannot create a temporary directory in ." >&2 + $as_echo "$as_me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } -_ACEOF +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then -cat >>$CONFIG_STATUS <<_ACEOF -# -# CONFIG_FILES section. -# +ac_cr=' ' +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h -if test -n "\$CONFIG_FILES"; then - # Protect against being on the right side of a sed subst in config.status. - sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; - s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF -s,@SHELL@,$SHELL,;t t -s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t -s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t -s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t -s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t -s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t -s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t -s,@exec_prefix@,$exec_prefix,;t t -s,@prefix@,$prefix,;t t -s,@program_transform_name@,$program_transform_name,;t t -s,@bindir@,$bindir,;t t -s,@sbindir@,$sbindir,;t t -s,@libexecdir@,$libexecdir,;t t -s,@datadir@,$datadir,;t t -s,@sysconfdir@,$sysconfdir,;t t -s,@sharedstatedir@,$sharedstatedir,;t t -s,@localstatedir@,$localstatedir,;t t -s,@libdir@,$libdir,;t t -s,@includedir@,$includedir,;t t -s,@oldincludedir@,$oldincludedir,;t t -s,@infodir@,$infodir,;t t -s,@mandir@,$mandir,;t t -s,@build_alias@,$build_alias,;t t -s,@host_alias@,$host_alias,;t t -s,@target_alias@,$target_alias,;t t -s,@DEFS@,$DEFS,;t t -s,@ECHO_C@,$ECHO_C,;t t -s,@ECHO_N@,$ECHO_N,;t t -s,@ECHO_T@,$ECHO_T,;t t -s,@LIBS@,$LIBS,;t t -s,@EGREP@,$EGREP,;t t -s,@AWK@,$AWK,;t t -s,@SED@,$SED,;t t -s,@LOCAL_SOLENV@,$LOCAL_SOLENV,;t t -s,@_solenv@,$_solenv,;t t -s,@UPD@,$UPD,;t t -s,@SOURCEVERSION@,$SOURCEVERSION,;t t -s,@build@,$build,;t t -s,@build_cpu@,$build_cpu,;t t -s,@build_vendor@,$build_vendor,;t t -s,@build_os@,$build_os,;t t -s,@host@,$host,;t t -s,@host_cpu@,$host_cpu,;t t -s,@host_vendor@,$host_vendor,;t t -s,@host_os@,$host_os,;t t -s,@target@,$target,;t t -s,@target_cpu@,$target_cpu,;t t -s,@target_vendor@,$target_vendor,;t t -s,@target_os@,$target_os,;t t -s,@GNUTAR@,$GNUTAR,;t t -s,@OSVERSION@,$OSVERSION,;t t -s,@PTHREAD_CFLAGS@,$PTHREAD_CFLAGS,;t t -s,@PTHREAD_LIBS@,$PTHREAD_LIBS,;t t -s,@ENABLE_CRASHDUMP@,$ENABLE_CRASHDUMP,;t t -s,@VC_STANDARD@,$VC_STANDARD,;t t -s,@ENABLE_WERROR@,$ENABLE_WERROR,;t t -s,@ENABLE_DEBUG@,$ENABLE_DEBUG,;t t -s,@PRODUCT@,$PRODUCT,;t t -s,@PROFULLSWITCH@,$PROFULLSWITCH,;t t -s,@PROEXT@,$PROEXT,;t t -s,@ENABLE_SYMBOLS@,$ENABLE_SYMBOLS,;t t -s,@DISABLE_STRIP@,$DISABLE_STRIP,;t t -s,@ENABLE_CUPS@,$ENABLE_CUPS,;t t -s,@ENABLE_FONTCONFIG@,$ENABLE_FONTCONFIG,;t t -s,@WITH_BINFILTER@,$WITH_BINFILTER,;t t -s,@ENABLE_DIRECTX@,$ENABLE_DIRECTX,;t t -s,@DISABLE_ACTIVEX@,$DISABLE_ACTIVEX,;t t -s,@DISABLE_ATL@,$DISABLE_ATL,;t t -s,@ENABLE_RPATH@,$ENABLE_RPATH,;t t -s,@WITH_MYSPELL_DICTS@,$WITH_MYSPELL_DICTS,;t t -s,@SYSTEM_DICTS@,$SYSTEM_DICTS,;t t -s,@DICT_SYSTEM_DIR@,$DICT_SYSTEM_DIR,;t t -s,@HYPH_SYSTEM_DIR@,$HYPH_SYSTEM_DIR,;t t -s,@THES_SYSTEM_DIR@,$THES_SYSTEM_DIR,;t t -s,@USE_SHELL@,$USE_SHELL,;t t -s,@WITH_MINGWIN@,$WITH_MINGWIN,;t t -s,@SHELLPATH@,$SHELLPATH,;t t -s,@GCC_HOME@,$GCC_HOME,;t t -s,@CC@,$CC,;t t -s,@CFLAGS@,$CFLAGS,;t t -s,@LDFLAGS@,$LDFLAGS,;t t -s,@CPPFLAGS@,$CPPFLAGS,;t t -s,@ac_ct_CC@,$ac_ct_CC,;t t -s,@EXEEXT@,$EXEEXT,;t t -s,@OBJEXT@,$OBJEXT,;t t -s,@COMPATH@,$COMPATH,;t t -s,@GCCVER@,$GCCVER,;t t -s,@HAVE_LD_BSYMBOLIC_FUNCTIONS@,$HAVE_LD_BSYMBOLIC_FUNCTIONS,;t t -s,@ENABLE_PCH@,$ENABLE_PCH,;t t -s,@GNUMAKE@,$GNUMAKE,;t t -s,@_cc@,$_cc,;t t -s,@HAVE_LD_HASH_STYLE@,$HAVE_LD_HASH_STYLE,;t t -s,@PERL@,$PERL,;t t -s,@MSPDB_PATH@,$MSPDB_PATH,;t t -s,@COMEX@,$COMEX,;t t -s,@USE_MINGW@,$USE_MINGW,;t t -s,@MIDL_PATH@,$MIDL_PATH,;t t -s,@CSC_PATH@,$CSC_PATH,;t t -s,@FRAME_HOME@,$FRAME_HOME,;t t -s,@CPP@,$CPP,;t t -s,@CXX@,$CXX,;t t -s,@CXXFLAGS@,$CXXFLAGS,;t t -s,@ac_ct_CXX@,$ac_ct_CXX,;t t -s,@CXXCPP@,$CXXCPP,;t t -s,@SIZEOF_LONG@,$SIZEOF_LONG,;t t -s,@WORDS_BIGENDIAN@,$WORDS_BIGENDIAN,;t t -s,@LFS_CFLAGS@,$LFS_CFLAGS,;t t -s,@ENABLE_VBA@,$ENABLE_VBA,;t t -s,@VBA_EXTENSION@,$VBA_EXTENSION,;t t -s,@PAM@,$PAM,;t t -s,@NEW_SHADOW_API@,$NEW_SHADOW_API,;t t -s,@PAM_LINK@,$PAM_LINK,;t t -s,@CRYPT_LINK@,$CRYPT_LINK,;t t -s,@GXX_INCLUDE_PATH@,$GXX_INCLUDE_PATH,;t t -s,@MINGW_LIB_INCLUDE_PATH@,$MINGW_LIB_INCLUDE_PATH,;t t -s,@STLPORT4@,$STLPORT4,;t t -s,@STLPORT_VER@,$STLPORT_VER,;t t -s,@USE_SYSTEM_STL@,$USE_SYSTEM_STL,;t t -s,@HAVE_GCC_VISIBILITY_FEATURE@,$HAVE_GCC_VISIBILITY_FEATURE,;t t -s,@ALLOC@,$ALLOC,;t t -s,@BUILD_VER_STRING@,$BUILD_VER_STRING,;t t -s,@SOLAR_JAVA@,$SOLAR_JAVA,;t t -s,@JAVAINTERPRETER@,$JAVAINTERPRETER,;t t -s,@JAVACOMPILER@,$JAVACOMPILER,;t t -s,@JAVACISGCJ@,$JAVACISGCJ,;t t -s,@JAVADOC@,$JAVADOC,;t t -s,@AWTLIB@,$AWTLIB,;t t -s,@JAVAAOTCOMPILER@,$JAVAAOTCOMPILER,;t t -s,@JAVA_HOME@,$JAVA_HOME,;t t -s,@JDK@,$JDK,;t t -s,@JAVAFLAGS@,$JAVAFLAGS,;t t -s,@DMAKE@,$DMAKE,;t t -s,@BUILD_DMAKE@,$BUILD_DMAKE,;t t -s,@EPM@,$EPM,;t t -s,@DPKG@,$DPKG,;t t -s,@PKGMK@,$PKGMK,;t t -s,@BUILD_EPM@,$BUILD_EPM,;t t -s,@PKGFORMAT@,$PKGFORMAT,;t t -s,@RPM@,$RPM,;t t -s,@GPERF@,$GPERF,;t t -s,@MINGWCXX@,$MINGWCXX,;t t -s,@ac_ct_MINGWCXX@,$ac_ct_MINGWCXX,;t t -s,@MINGWSTRIP@,$MINGWSTRIP,;t t -s,@ac_ct_MINGWSTRIP@,$ac_ct_MINGWSTRIP,;t t -s,@BUILD_UNOWINREG@,$BUILD_UNOWINREG,;t t -s,@BUILD_QADEVOOO@,$BUILD_QADEVOOO,;t t -s,@SYSTEM_STDLIBS@,$SYSTEM_STDLIBS,;t t -s,@SYSTEM_ZLIB@,$SYSTEM_ZLIB,;t t -s,@SYSTEM_JPEG@,$SYSTEM_JPEG,;t t -s,@SYSTEM_EXPAT@,$SYSTEM_EXPAT,;t t -s,@PKG_CONFIG@,$PKG_CONFIG,;t t -s,@LIBWPD_CFLAGS@,$LIBWPD_CFLAGS,;t t -s,@LIBWPD_LIBS@,$LIBWPD_LIBS,;t t -s,@SYSTEM_LIBWPD@,$SYSTEM_LIBWPD,;t t -s,@FREETYPE_CFLAGS@,$FREETYPE_CFLAGS,;t t -s,@FREETYPE_LIBS@,$FREETYPE_LIBS,;t t -s,@USE_FT_EMBOLDEN@,$USE_FT_EMBOLDEN,;t t -s,@LIBXSLT_CFLAGS@,$LIBXSLT_CFLAGS,;t t -s,@LIBXSLT_LIBS@,$LIBXSLT_LIBS,;t t -s,@XSLTPROC@,$XSLTPROC,;t t -s,@SYSTEM_LIBXSLT@,$SYSTEM_LIBXSLT,;t t -s,@LIBXML_CFLAGS@,$LIBXML_CFLAGS,;t t -s,@LIBXML_LIBS@,$LIBXML_LIBS,;t t -s,@SYSTEM_LIBXML@,$SYSTEM_LIBXML,;t t -s,@PYTHON@,$PYTHON,;t t -s,@PYTHON_VERSION@,$PYTHON_VERSION,;t t -s,@PYTHON_PREFIX@,$PYTHON_PREFIX,;t t -s,@PYTHON_EXEC_PREFIX@,$PYTHON_EXEC_PREFIX,;t t -s,@PYTHON_PLATFORM@,$PYTHON_PLATFORM,;t t -s,@pythondir@,$pythondir,;t t -s,@pkgpythondir@,$pkgpythondir,;t t -s,@pyexecdir@,$pyexecdir,;t t -s,@pkgpyexecdir@,$pkgpyexecdir,;t t -s,@BZIP2@,$BZIP2,;t t -s,@SYSTEM_PYTHON@,$SYSTEM_PYTHON,;t t -s,@PYTHON_CFLAGS@,$PYTHON_CFLAGS,;t t -s,@PYTHON_LIBS@,$PYTHON_LIBS,;t t -s,@HOME@,$HOME,;t t -s,@SYSTEM_DB@,$SYSTEM_DB,;t t -s,@DB_VERSION@,$DB_VERSION,;t t -s,@DB_INCLUDES@,$DB_INCLUDES,;t t -s,@DB_JAR@,$DB_JAR,;t t -s,@SYSTEM_LUCENE@,$SYSTEM_LUCENE,;t t -s,@LUCENE_CORE_JAR@,$LUCENE_CORE_JAR,;t t -s,@LUCENE_ANALYZERS_JAR@,$LUCENE_ANALYZERS_JAR,;t t -s,@SYSTEM_HSQLDB@,$SYSTEM_HSQLDB,;t t -s,@HSQLDB_JAR@,$HSQLDB_JAR,;t t -s,@SYSTEM_BSH@,$SYSTEM_BSH,;t t -s,@BSH_JAR@,$BSH_JAR,;t t -s,@SERIALIZER_JAR@,$SERIALIZER_JAR,;t t -s,@SYSTEM_SAXON@,$SYSTEM_SAXON,;t t -s,@SAXON_JAR@,$SAXON_JAR,;t t -s,@CURLCONFIG@,$CURLCONFIG,;t t -s,@SYSTEM_CURL@,$SYSTEM_CURL,;t t -s,@CURL_CFLAGS@,$CURL_CFLAGS,;t t -s,@CURL_LIBS@,$CURL_LIBS,;t t -s,@SYSTEM_BOOST@,$SYSTEM_BOOST,;t t -s,@SYSTEM_VIGRA@,$SYSTEM_VIGRA,;t t -s,@SYSTEM_ODBC_HEADERS@,$SYSTEM_ODBC_HEADERS,;t t -s,@WITH_MOZILLA@,$WITH_MOZILLA,;t t -s,@WITH_LDAP@,$WITH_LDAP,;t t -s,@WITH_OPENLDAP@,$WITH_OPENLDAP,;t t -s,@MOZ_NSS_CFLAGS@,$MOZ_NSS_CFLAGS,;t t -s,@MOZ_NSS_LIBS@,$MOZ_NSS_LIBS,;t t -s,@NSS_LIB@,$NSS_LIB,;t t -s,@MOZ_NSPR_CFLAGS@,$MOZ_NSPR_CFLAGS,;t t -s,@MOZ_NSPR_LIBS@,$MOZ_NSPR_LIBS,;t t -s,@NSPR_LIB@,$NSPR_LIB,;t t -s,@MOZILLAXPCOM_CFLAGS@,$MOZILLAXPCOM_CFLAGS,;t t -s,@MOZILLAXPCOM_LIBS@,$MOZILLAXPCOM_LIBS,;t t -s,@MOZILLA_VERSION@,$MOZILLA_VERSION,;t t -s,@MOZILLA_TOOLKIT@,$MOZILLA_TOOLKIT,;t t -s,@MOZGTK2_CFLAGS@,$MOZGTK2_CFLAGS,;t t -s,@MOZGTK2_LIBS@,$MOZGTK2_LIBS,;t t -s,@MOZLIBREQ_CFLAGS@,$MOZLIBREQ_CFLAGS,;t t -s,@MOZLIBREQ_LIBS@,$MOZLIBREQ_LIBS,;t t -s,@BUILD_MOZAB@,$BUILD_MOZAB,;t t -s,@SYSTEM_MOZILLA@,$SYSTEM_MOZILLA,;t t -s,@MOZ_FLAVOUR@,$MOZ_FLAVOUR,;t t -s,@MOZ_INC@,$MOZ_INC,;t t -s,@MOZ_LIB@,$MOZ_LIB,;t t -s,@MOZ_LIB_XPCOM@,$MOZ_LIB_XPCOM,;t t -s,@MOZ_LDAP_CFLAGS@,$MOZ_LDAP_CFLAGS,;t t -s,@SYSTEM_SANE_HEADER@,$SYSTEM_SANE_HEADER,;t t -s,@SYSTEM_GENBRK@,$SYSTEM_GENBRK,;t t -s,@SYSTEM_GENCCODE@,$SYSTEM_GENCCODE,;t t -s,@SYSTEM_GENCMN@,$SYSTEM_GENCMN,;t t -s,@SYSTEM_ICU@,$SYSTEM_ICU,;t t -s,@X_CFLAGS@,$X_CFLAGS,;t t -s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t -s,@X_LIBS@,$X_LIBS,;t t -s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t -s,@XINC@,$XINC,;t t -s,@XLIB@,$XLIB,;t t -s,@XAU_LIBS@,$XAU_LIBS,;t t -s,@DISABLE_XAW@,$DISABLE_XAW,;t t -s,@SYSTEM_XRENDER_HEADERS@,$SYSTEM_XRENDER_HEADERS,;t t -s,@XRENDER_LINK@,$XRENDER_LINK,;t t -s,@XRANDR_CFLAGS@,$XRANDR_CFLAGS,;t t -s,@XRANDR_LIBS@,$XRANDR_LIBS,;t t -s,@XRANDR_DLOPEN@,$XRANDR_DLOPEN,;t t -s,@ENABLE_RANDR@,$ENABLE_RANDR,;t t -s,@DISABLE_NEON@,$DISABLE_NEON,;t t -s,@NEON_CFLAGS@,$NEON_CFLAGS,;t t -s,@NEON_LIBS@,$NEON_LIBS,;t t -s,@OPENSSL_CFLAGS@,$OPENSSL_CFLAGS,;t t -s,@OPENSSL_LIBS@,$OPENSSL_LIBS,;t t -s,@SYSTEM_OPENSSL@,$SYSTEM_OPENSSL,;t t -s,@SYSTEM_NEON@,$SYSTEM_NEON,;t t -s,@NEON_VERSION@,$NEON_VERSION,;t t -s,@ENABLE_AGG@,$ENABLE_AGG,;t t -s,@AGG_CFLAGS@,$AGG_CFLAGS,;t t -s,@AGG_LIBS@,$AGG_LIBS,;t t -s,@SYSTEM_AGG@,$SYSTEM_AGG,;t t -s,@AGG_VERSION@,$AGG_VERSION,;t t -s,@REDLAND_CFLAGS@,$REDLAND_CFLAGS,;t t -s,@REDLAND_LIBS@,$REDLAND_LIBS,;t t -s,@SYSTEM_REDLAND@,$SYSTEM_REDLAND,;t t -s,@HUNSPELL_CFLAGS@,$HUNSPELL_CFLAGS,;t t -s,@HUNSPELL_LIBS@,$HUNSPELL_LIBS,;t t -s,@SYSTEM_HUNSPELL@,$SYSTEM_HUNSPELL,;t t -s,@SYSTEM_HYPH@,$SYSTEM_HYPH,;t t -s,@HYPHEN_LIB@,$HYPHEN_LIB,;t t -s,@SYSTEM_MYTHES@,$SYSTEM_MYTHES,;t t -s,@SYSTEM_LPSOLVE@,$SYSTEM_LPSOLVE,;t t -s,@PSDK_HOME@,$PSDK_HOME,;t t -s,@WINDOWS_VISTA_PSDK@,$WINDOWS_VISTA_PSDK,;t t -s,@DIRECTXSDK_HOME@,$DIRECTXSDK_HOME,;t t -s,@DIRECTXSDK_LIB@,$DIRECTXSDK_LIB,;t t -s,@NSIS_PATH@,$NSIS_PATH,;t t -s,@BISON@,$BISON,;t t -s,@FLEX@,$FLEX,;t t -s,@PATCH@,$PATCH,;t t -s,@GNUCP@,$GNUCP,;t t -s,@GNUPATCH@,$GNUPATCH,;t t -s,@CYGWIN_PATH@,$CYGWIN_PATH,;t t -s,@ML_EXE@,$ML_EXE,;t t -s,@ASM_HOME@,$ASM_HOME,;t t -s,@ZIP@,$ZIP,;t t -s,@UNZIP@,$UNZIP,;t t -s,@ZIP_HOME@,$ZIP_HOME,;t t -s,@WITH_GPC@,$WITH_GPC,;t t -s,@ENABLE_GTK@,$ENABLE_GTK,;t t -s,@ENABLE_KDE@,$ENABLE_KDE,;t t -s,@GCONF_CFLAGS@,$GCONF_CFLAGS,;t t -s,@GCONF_LIBS@,$GCONF_LIBS,;t t -s,@ENABLE_GCONF@,$ENABLE_GCONF,;t t -s,@GNOMEVFS_CFLAGS@,$GNOMEVFS_CFLAGS,;t t -s,@GNOMEVFS_LIBS@,$GNOMEVFS_LIBS,;t t -s,@ENABLE_GNOMEVFS@,$ENABLE_GNOMEVFS,;t t -s,@GTK_CFLAGS@,$GTK_CFLAGS,;t t -s,@GTK_LIBS@,$GTK_LIBS,;t t -s,@DBUS_CFLAGS@,$DBUS_CFLAGS,;t t -s,@DBUS_LIBS@,$DBUS_LIBS,;t t -s,@GIO_CFLAGS@,$GIO_CFLAGS,;t t -s,@GIO_LIBS@,$GIO_LIBS,;t t -s,@ENABLE_GIO@,$ENABLE_GIO,;t t -s,@ENABLE_DBUS@,$ENABLE_DBUS,;t t -s,@ENABLE_SYSTRAY_GTK@,$ENABLE_SYSTRAY_GTK,;t t -s,@CAIRO_CFLAGS@,$CAIRO_CFLAGS,;t t -s,@CAIRO_LIBS@,$CAIRO_LIBS,;t t -s,@ENABLE_CAIRO@,$ENABLE_CAIRO,;t t -s,@BUILD_PIXMAN@,$BUILD_PIXMAN,;t t -s,@SYSTEM_CAIRO@,$SYSTEM_CAIRO,;t t -s,@ENABLE_OPENGL@,$ENABLE_OPENGL,;t t -s,@ENABLE_MINIMIZER@,$ENABLE_MINIMIZER,;t t -s,@ENABLE_PRESENTER_SCREEN@,$ENABLE_PRESENTER_SCREEN,;t t -s,@POPPLER_CFLAGS@,$POPPLER_CFLAGS,;t t -s,@POPPLER_LIBS@,$POPPLER_LIBS,;t t -s,@ENABLE_PDFIMPORT@,$ENABLE_PDFIMPORT,;t t -s,@SYSTEM_POPPLER@,$SYSTEM_POPPLER,;t t -s,@ENABLE_MEDIAWIKI@,$ENABLE_MEDIAWIKI,;t t -s,@SYSTEM_SERVLETAPI@,$SYSTEM_SERVLETAPI,;t t -s,@SERVLETAPI_JAR@,$SERVLETAPI_JAR,;t t -s,@ENABLE_REPORTBUILDER@,$ENABLE_REPORTBUILDER,;t t -s,@SYSTEM_JFREEREPORT@,$SYSTEM_JFREEREPORT,;t t -s,@SAC_JAR@,$SAC_JAR,;t t -s,@LIBXML_JAR@,$LIBXML_JAR,;t t -s,@FLUTE_JAR@,$FLUTE_JAR,;t t -s,@JFREEREPORT_JAR@,$JFREEREPORT_JAR,;t t -s,@LIBBASE_JAR@,$LIBBASE_JAR,;t t -s,@LIBLAYOUT_JAR@,$LIBLAYOUT_JAR,;t t -s,@LIBLOADER_JAR@,$LIBLOADER_JAR,;t t -s,@LIBFORMULA_JAR@,$LIBFORMULA_JAR,;t t -s,@LIBREPOSITORY_JAR@,$LIBREPOSITORY_JAR,;t t -s,@LIBFONTS_JAR@,$LIBFONTS_JAR,;t t -s,@LIBSERIALIZER_JAR@,$LIBSERIALIZER_JAR,;t t -s,@SYSTEM_APACHE_COMMONS@,$SYSTEM_APACHE_COMMONS,;t t -s,@COMMONS_CODEC_JAR@,$COMMONS_CODEC_JAR,;t t -s,@COMMONS_LANG_JAR@,$COMMONS_LANG_JAR,;t t -s,@COMMONS_HTTPCLIENT_JAR@,$COMMONS_HTTPCLIENT_JAR,;t t -s,@COMMONS_LOGGING_JAR@,$COMMONS_LOGGING_JAR,;t t -s,@MOC@,$MOC,;t t -s,@KDE_CFLAGS@,$KDE_CFLAGS,;t t -s,@KDE_LIBS@,$KDE_LIBS,;t t -s,@ENABLE_LOCKDOWN@,$ENABLE_LOCKDOWN,;t t -s,@GOBJECT_CFLAGS@,$GOBJECT_CFLAGS,;t t -s,@GOBJECT_LIBS@,$GOBJECT_LIBS,;t t -s,@ENABLE_EVOAB2@,$ENABLE_EVOAB2,;t t -s,@ENABLE_KAB@,$ENABLE_KAB,;t t -s,@WITH_FONTOOO@,$WITH_FONTOOO,;t t -s,@SYSTEM_MSPACK@,$SYSTEM_MSPACK,;t t -s,@WITH_FONTS@,$WITH_FONTS,;t t -s,@WITHOUT_PPDS@,$WITHOUT_PPDS,;t t -s,@WITHOUT_AFMS@,$WITHOUT_AFMS,;t t -s,@SCPDEFS@,$SCPDEFS,;t t -s,@USE_XINERAMA@,$USE_XINERAMA,;t t -s,@XINERAMA_LINK@,$XINERAMA_LINK,;t t -s,@ANT@,$ANT,;t t -s,@ANT_HOME@,$ANT_HOME,;t t -s,@ANT_LIB@,$ANT_LIB,;t t -s,@WITH_LANG@,$WITH_LANG,;t t -s,@WITH_POOR_HELP_LOCALIZATIONS@,$WITH_POOR_HELP_LOCALIZATIONS,;t t -s,@WITH_DICT@,$WITH_DICT,;t t -s,@INTRO_BITMAPS@,$INTRO_BITMAPS,;t t -s,@ABOUT_BITMAPS@,$ABOUT_BITMAPS,;t t -s,@OOO_VENDOR@,$OOO_VENDOR,;t t -s,@UNIXWRAPPERNAME@,$UNIXWRAPPERNAME,;t t -s,@ENABLE_STATIC_GTK@,$ENABLE_STATIC_GTK,;t t -s,@ENABLE_LAYOUT@,$ENABLE_LAYOUT,;t t -s,@VERBOSE@,$VERBOSE,;t t -s,@LOCAL_SOLVER@,$LOCAL_SOLVER,;t t -s,@BUILD_TYPE@,$BUILD_TYPE,;t t -s,@LIBOBJS@,$LIBOBJS,;t t -s,@LTLIBOBJS@,$LTLIBOBJS,;t t -CEOF - -_ACEOF - - cat >>$CONFIG_STATUS <<\_ACEOF - # Split the substitutions into bite-sized pieces for seds with - # small command number limits, like on Digital OSF/1 and HP-UX. - ac_max_sed_lines=48 - ac_sed_frag=1 # Number of current file. - ac_beg=1 # First line for current file. - ac_end=$ac_max_sed_lines # Line after last line for current file. - ac_more_lines=: - ac_sed_cmds= - while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - else - sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - fi - if test ! -s $tmp/subs.frag; then - ac_more_lines=false - else - # The purpose of the label and of the branching condition is to - # speed up the sed processing (if there are no `@' at all, there - # is no need to browse any of the substitutions). - # These are the two extra sed commands mentioned above. - (echo ':t - /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" - else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" - fi - ac_sed_frag=`expr $ac_sed_frag + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_lines` - fi - done - if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat +echo 'BEGIN {' >"$tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } +ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi -fi # test -n "$CONFIG_FILES" +done +rm -f conf$$subs.sh +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\).*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\).*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ + || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 +$as_echo "$as_me: error: could not setup config files machinery" >&2;} + { (exit 1); exit 1; }; } +_ACEOF + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + + +eval set X " :F $CONFIG_FILES " +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 +$as_echo "$as_me: error: invalid tag $ac_tag" >&2;} + { (exit 1); exit 1; }; };; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift - # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. - ac_dir=`(dirname "$ac_file") 2>/dev/null || + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + ac_file_inputs="$ac_file_inputs '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } - ac_builddir=. -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac -# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be -# absolute. -ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` -ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` -ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + case $ac_mode in + :F) + # + # CONFIG_FILE + # - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - configure_input= - else - configure_input="$ac_file. " - fi - configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo $f;; - *) # Relative - if test -f "$f"; then - # Build tree - echo $f - elif test -f "$srcdir/$f"; then - # Source tree - echo $srcdir/$f - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF - sed "$ac_vpsub + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= + +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub $extrasub _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s,@configure_input@,$configure_input,;t t -s,@srcdir@,$ac_srcdir,;t t -s,@abs_srcdir@,$ac_abs_srcdir,;t t -s,@top_srcdir@,$ac_top_srcdir,;t t -s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t -s,@builddir@,$ac_builddir,;t t -s,@abs_builddir@,$ac_abs_builddir,;t t -s,@top_builddir@,$ac_top_builddir,;t t -s,@abs_top_builddir@,$ac_abs_top_builddir,;t t -" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out - rm -f $tmp/stdin - if test x"$ac_file" != x-; then - mv $tmp/out $ac_file - else - cat $tmp/out - rm -f $tmp/out - fi +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + esac \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } + ;; + -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF + esac + +done # for ac_tag + { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save +test $ac_write_fail = 0 || + { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. @@ -27630,6 +30070,10 @@ if test "$no_create" != yes; then # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi chmod a+x set_soenv -- cgit v1.2.3 From d30bcd05298ef4d1d07ba53f9a78941df0681b6c Mon Sep 17 00:00:00 2001 From: thb Date: Wed, 16 Dec 2009 15:02:20 +0100 Subject: eraser01: #i97972# - one more fix for erase all ink * make sd flags reflect the slideshow state after eraseAllInk was called. Fix is from Metrokid. --- sd/source/ui/slideshow/slideshowimpl.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index 9fd9bd6694bc..a736f4a88a77 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -3261,6 +3261,8 @@ void SAL_CALL SlideshowImpl::setEraseAllInk( bool bEraseAllInk ) throw (RuntimeE { ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); mbEraseAllInk=bEraseAllInk; + mbSwitchPenMode = true; + mbSwitchEraserMode = false; if( maPresSettings.mbMouseAsPen ) setUsePen( sal_True ); // update erase all ink bool } -- cgit v1.2.3 -- cgit v1.2.3 From 5df27651727b0c7899a7220f972799a99694254d Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 16 Dec 2009 17:38:59 +0100 Subject: vcl108: #i94111# support globalized PPDs --- padmin/source/prtsetup.cxx | 23 +- padmin/source/prtsetup.hxx | 2 +- vcl/inc/vcl/ppdparser.hxx | 23 +- vcl/unx/headless/svpprn.cxx | 2 +- vcl/unx/source/gdi/salprnpsp.cxx | 2 +- vcl/unx/source/printer/ppdparser.cxx | 448 ++++++++++++++++++++++++++++------- 6 files changed, 393 insertions(+), 107 deletions(-) diff --git a/padmin/source/prtsetup.cxx b/padmin/source/prtsetup.cxx index 6cf4f8b257b1..69217e2d0063 100644 --- a/padmin/source/prtsetup.cxx +++ b/padmin/source/prtsetup.cxx @@ -44,9 +44,9 @@ using namespace rtl; using namespace psp; using namespace padmin; -void RTSDialog::insertAllPPDValues( ListBox& rBox, const PPDKey* pKey ) +void RTSDialog::insertAllPPDValues( ListBox& rBox, const PPDParser* pParser, const PPDKey* pKey ) { - if( ! pKey ) + if( ! pKey || ! pParser ) return; const PPDValue* pValue = NULL; @@ -56,7 +56,7 @@ void RTSDialog::insertAllPPDValues( ListBox& rBox, const PPDKey* pKey ) for( int i = 0; i < pKey->countValues(); i++ ) { pValue = pKey->getValue( i ); - aOptionText = pValue->m_aOptionTranslation.Len() ? pValue->m_aOptionTranslation : pValue->m_aOption; + aOptionText = pParser->translateOption( pKey->getKey(), pValue->m_aOption) ; if( m_aJobData.m_aContext.checkConstraints( pKey, pValue ) ) { @@ -282,7 +282,7 @@ void RTSPaperPage::update() if( m_pParent->m_aJobData.m_pParser && (pKey = m_pParent->m_aJobData.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "Duplex" ) ) )) ) { - m_pParent->insertAllPPDValues( m_aDuplexBox, pKey ); + m_pParent->insertAllPPDValues( m_aDuplexBox, m_pParent->m_aJobData.m_pParser, pKey ); } else { @@ -294,7 +294,7 @@ void RTSPaperPage::update() if( m_pParent->m_aJobData.m_pParser && (pKey = m_pParent->m_aJobData.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "PageSize" ) ) )) ) { - m_pParent->insertAllPPDValues( m_aPaperBox, pKey ); + m_pParent->insertAllPPDValues( m_aPaperBox, m_pParent->m_aJobData.m_pParser, pKey ); } else { @@ -306,7 +306,7 @@ void RTSPaperPage::update() if( m_pParent->m_aJobData.m_pParser && (pKey = m_pParent->m_aJobData.m_pParser->getKey( String::CreateFromAscii( "InputSlot" ) )) ) { - m_pParent->insertAllPPDValues( m_aSlotBox, pKey ); + m_pParent->insertAllPPDValues( m_aSlotBox, m_pParent->m_aJobData.m_pParser, pKey ); } else { @@ -411,8 +411,8 @@ RTSDevicePage::RTSDevicePage( RTSDialog* pParent ) : ! pKey->getKey().EqualsAscii( "Duplex" ) ) { - USHORT nPos = - m_aPPDKeyBox.InsertEntry( pKey->getUITranslation().Len() ? pKey->getUITranslation() : pKey->getKey() ); + String aEntry( m_pParent->m_aJobData.m_pParser->translateKey( pKey->getKey() ) ); + USHORT nPos = m_aPPDKeyBox.InsertEntry( aEntry ); m_aPPDKeyBox.SetEntryData( nPos, (void*)pKey ); } } @@ -466,10 +466,11 @@ void RTSDevicePage::FillValueBox( const PPDKey* pKey ) for( int i = 0; i < pKey->countValues(); i++ ) { pValue = pKey->getValue( i ); - if( m_pParent->m_aJobData.m_aContext.checkConstraints( pKey, pValue ) ) + if( m_pParent->m_aJobData.m_aContext.checkConstraints( pKey, pValue ) && + m_pParent->m_aJobData.m_pParser ) { - USHORT nPos = - m_aPPDValueBox.InsertEntry( pValue->m_aOptionTranslation.Len() ? pValue->m_aOptionTranslation : pValue->m_aOption ); + String aEntry( m_pParent->m_aJobData.m_pParser->translateOption( pKey->getKey(), pValue->m_aOption ) ); + USHORT nPos = m_aPPDValueBox.InsertEntry( aEntry ); m_aPPDValueBox.SetEntryData( nPos, (void*)pValue ); } } diff --git a/padmin/source/prtsetup.hxx b/padmin/source/prtsetup.hxx index 8487daa158da..1e296fa9ed88 100644 --- a/padmin/source/prtsetup.hxx +++ b/padmin/source/prtsetup.hxx @@ -85,7 +85,7 @@ class RTSDialog : public TabDialog DECL_LINK( ClickButton, Button* ); // helper functions - void insertAllPPDValues( ListBox&, const ::psp::PPDKey* ); + void insertAllPPDValues( ListBox&, const psp::PPDParser*, const psp::PPDKey* ); public: RTSDialog( const ::psp::PrinterInfo& rJobData, const String& rPrinter, bool bAllPages, Window* pParent = NULL ); ~RTSDialog(); diff --git a/vcl/inc/vcl/ppdparser.hxx b/vcl/inc/vcl/ppdparser.hxx index ed9f91b97d99..ba5bc5004362 100644 --- a/vcl/inc/vcl/ppdparser.hxx +++ b/vcl/inc/vcl/ppdparser.hxx @@ -37,11 +37,14 @@ #include "tools/string.hxx" #include "tools/stream.hxx" +#include "com/sun/star/lang/Locale.hpp" + #define PRINTER_PPDDIR "driver" namespace psp { class PPDParser; +class PPDTranslator; enum PPDValueType { eInvocation, eQuoted, eSymbol, eString, eNo }; @@ -49,9 +52,7 @@ struct PPDValue { PPDValueType m_eType; String m_aOption; - String m_aOptionTranslation; String m_aValue; - String m_aValueTranslation; }; // ---------------------------------------------------------------------- @@ -80,7 +81,6 @@ public: private: bool m_bUIOption; - String m_aUITranslation; UIType m_eUIType; int m_nOrderDependency; SetupType m_eSetupType; @@ -102,7 +102,6 @@ public: const String& getKey() const { return m_aKey; } bool isUIKey() const { return m_bUIOption; } - const String& getUITranslation() const { return m_aUITranslation; } UIType getUIType() const { return m_eUIType; } SetupType getSetupType() const { return m_eSetupType; } int getOrderDependency() const { return m_nOrderDependency; } @@ -185,6 +184,9 @@ private: // fonts const PPDKey* m_pFontList; + // translations + PPDTranslator* m_pTranslator; + PPDParser( const String& rFile ); ~PPDParser(); @@ -193,7 +195,7 @@ private: void parseConstraint( const ByteString& rLine ); void parse( std::list< ByteString >& rLines ); - String handleTranslation( const ByteString& rString ); + String handleTranslation( const ByteString& i_rString, bool i_bIsGlobalized ); static void scanPPDDir( const String& rDir ); static void initPPDFiles(); @@ -277,6 +279,17 @@ public: String& rEncoding, String& rCharset ) const; const String& getFont( int ) const; + + + rtl::OUString translateKey( const rtl::OUString& i_rKey, + const com::sun::star::lang::Locale& i_rLocale = com::sun::star::lang::Locale() ) const; + rtl::OUString translateOption( const rtl::OUString& i_rKey, + const rtl::OUString& i_rOption, + const com::sun::star::lang::Locale& i_rLocale = com::sun::star::lang::Locale() ) const; + rtl::OUString translateValue( const rtl::OUString& i_rKey, + const rtl::OUString& i_rOption, + const rtl::OUString& i_rValue, + const com::sun::star::lang::Locale& i_rLocale = com::sun::star::lang::Locale() ) const; }; // ---------------------------------------------------------------------- diff --git a/vcl/unx/headless/svpprn.cxx b/vcl/unx/headless/svpprn.cxx index 1882b50e6ad7..a3a5c3c7a9c9 100644 --- a/vcl/unx/headless/svpprn.cxx +++ b/vcl/unx/headless/svpprn.cxx @@ -707,7 +707,7 @@ String PspSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pJobSetup, ULONG { const PPDValue* pValue = pKey->getValue( nPaperBin ); if( pValue ) - aRet = pValue->m_aOptionTranslation.Len() ? pValue->m_aOptionTranslation : pValue->m_aOption; + aRet = aData.m_pParser->translateOption( pKey->getKey(), pValue->m_aOption ); } } diff --git a/vcl/unx/source/gdi/salprnpsp.cxx b/vcl/unx/source/gdi/salprnpsp.cxx index 2cf4e3baedd3..95a88bb55126 100644 --- a/vcl/unx/source/gdi/salprnpsp.cxx +++ b/vcl/unx/source/gdi/salprnpsp.cxx @@ -810,7 +810,7 @@ String PspSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pJobSetup, ULONG { const PPDValue* pValue = pKey->getValue( nPaperBin ); if( pValue ) - aRet = pValue->m_aOptionTranslation.Len() ? pValue->m_aOptionTranslation : pValue->m_aOption; + aRet = aData.m_pParser->translateOption( pKey->getKey(), pValue->m_aOption ); } } diff --git a/vcl/unx/source/printer/ppdparser.cxx b/vcl/unx/source/printer/ppdparser.cxx index 705dcf8ccad7..a70a5ac7f6c8 100644 --- a/vcl/unx/source/printer/ppdparser.cxx +++ b/vcl/unx/source/printer/ppdparser.cxx @@ -39,6 +39,7 @@ #include "vcl/ppdparser.hxx" #include "vcl/strhelper.hxx" #include "vcl/helper.hxx" +#include "vcl/svapp.hxx" #include "cupsmgr.hxx" #include "tools/debug.hxx" #include "tools/urlobj.hxx" @@ -51,6 +52,202 @@ #include "rtl/strbuf.hxx" #include "rtl/ustrbuf.hxx" +#include "com/sun/star/lang/Locale.hpp" + +namespace psp +{ + class PPDTranslator + { + struct LocaleEqual + { + bool operator()(const com::sun::star::lang::Locale& i_rLeft, + const com::sun::star::lang::Locale& i_rRight) const + { + return i_rLeft.Language.equals( i_rRight.Language ) && + i_rLeft.Country.equals( i_rRight.Country ) && + i_rLeft.Variant.equals( i_rRight.Variant ); + } + }; + + struct LocaleHash + { + size_t operator()(const com::sun::star::lang::Locale& rLocale) const + { return + (size_t)rLocale.Language.hashCode() + ^ (size_t)rLocale.Country.hashCode() + ^ (size_t)rLocale.Variant.hashCode() + ; + } + }; + + typedef std::hash_map< com::sun::star::lang::Locale, rtl::OUString, LocaleHash, LocaleEqual > translation_map; + typedef std::hash_map< rtl::OUString, translation_map, rtl::OUStringHash > key_translation_map; + + key_translation_map m_aTranslations; + public: + PPDTranslator() {} + ~PPDTranslator() {} + + + void insertValue( + const rtl::OUString& i_rKey, + const rtl::OUString& i_rOption, + const rtl::OUString& i_rValue, + const rtl::OUString& i_rTranslation, + const com::sun::star::lang::Locale& i_rLocale = com::sun::star::lang::Locale() + ); + + void insertOption( const rtl::OUString& i_rKey, + const rtl::OUString& i_rOption, + const rtl::OUString& i_rTranslation, + const com::sun::star::lang::Locale& i_rLocale = com::sun::star::lang::Locale() ) + { + insertValue( i_rKey, i_rOption, rtl::OUString(), i_rTranslation, i_rLocale ); + } + + void insertKey( const rtl::OUString& i_rKey, + const rtl::OUString& i_rTranslation, + const com::sun::star::lang::Locale& i_rLocale = com::sun::star::lang::Locale() ) + { + insertValue( i_rKey, rtl::OUString(), rtl::OUString(), i_rTranslation, i_rLocale ); + } + + rtl::OUString translateValue( + const rtl::OUString& i_rKey, + const rtl::OUString& i_rOption, + const rtl::OUString& i_rValue, + const com::sun::star::lang::Locale& i_rLocale = com::sun::star::lang::Locale() + ) const; + + rtl::OUString translateOption( const rtl::OUString& i_rKey, + const rtl::OUString& i_rOption, + const com::sun::star::lang::Locale& i_rLocale = com::sun::star::lang::Locale() ) const + { + return translateValue( i_rKey, i_rOption, rtl::OUString(), i_rLocale ); + } + + rtl::OUString translateKey( const rtl::OUString& i_rKey, + const com::sun::star::lang::Locale& i_rLocale = com::sun::star::lang::Locale() ) const + { + return translateValue( i_rKey, rtl::OUString(), rtl::OUString(), i_rLocale ); + } + }; + + static com::sun::star::lang::Locale normalizeInputLocale( + const com::sun::star::lang::Locale& i_rLocale, + bool bInsertDefault = false + ) + { + com::sun::star::lang::Locale aLoc( i_rLocale ); + if( bInsertDefault && aLoc.Language.getLength() == 0 ) + { + // empty locale requested, fill in application UI locale + aLoc = Application::GetSettings().GetUILocale(); + + #if OSL_DEBUG_LEVEL > 1 + static const char* pEnvLocale = getenv( "SAL_PPDPARSER_LOCALE" ); + if( pEnvLocale && *pEnvLocale ) + { + rtl::OString aStr( pEnvLocale ); + sal_Int32 nLen = aStr.getLength(); + aLoc.Language = rtl::OStringToOUString( aStr.copy( 0, nLen > 2 ? 2 : nLen ), RTL_TEXTENCODING_MS_1252 ); + if( nLen >=5 && aStr.getStr()[2] == '_' ) + aLoc.Country = rtl::OStringToOUString( aStr.copy( 3, 2 ), RTL_TEXTENCODING_MS_1252 ); + else + aLoc.Country = rtl::OUString(); + aLoc.Variant = rtl::OUString(); + } + #endif + } + aLoc.Language = aLoc.Language.toAsciiLowerCase(); + aLoc.Country = aLoc.Country.toAsciiUpperCase(); + aLoc.Variant = aLoc.Variant.toAsciiUpperCase(); + + return aLoc; + } + + void PPDTranslator::insertValue( + const rtl::OUString& i_rKey, + const rtl::OUString& i_rOption, + const rtl::OUString& i_rValue, + const rtl::OUString& i_rTranslation, + const com::sun::star::lang::Locale& i_rLocale + ) + { + rtl::OUStringBuffer aKey( i_rKey.getLength() + i_rOption.getLength() + i_rValue.getLength() + 2 ); + aKey.append( i_rKey ); + if( i_rOption.getLength() || i_rValue.getLength() ) + { + aKey.append( sal_Unicode( ':' ) ); + aKey.append( i_rOption ); + } + if( i_rValue.getLength() ) + { + aKey.append( sal_Unicode( ':' ) ); + aKey.append( i_rValue ); + } + if( aKey.getLength() && i_rTranslation.getLength() ) + { + rtl::OUString aK( aKey.makeStringAndClear() ); + com::sun::star::lang::Locale aLoc; + aLoc.Language = i_rLocale.Language.toAsciiLowerCase(); + aLoc.Country = i_rLocale.Country.toAsciiUpperCase(); + aLoc.Variant = i_rLocale.Variant.toAsciiUpperCase(); + m_aTranslations[ aK ][ aLoc ] = i_rTranslation; + } + } + + rtl::OUString PPDTranslator::translateValue( + const rtl::OUString& i_rKey, + const rtl::OUString& i_rOption, + const rtl::OUString& i_rValue, + const com::sun::star::lang::Locale& i_rLocale + ) const + { + rtl::OUString aResult; + + rtl::OUStringBuffer aKey( i_rKey.getLength() + i_rOption.getLength() + i_rValue.getLength() + 2 ); + aKey.append( i_rKey ); + if( i_rOption.getLength() || i_rValue.getLength() ) + { + aKey.append( sal_Unicode( ':' ) ); + aKey.append( i_rOption ); + } + if( i_rValue.getLength() ) + { + aKey.append( sal_Unicode( ':' ) ); + aKey.append( i_rValue ); + } + if( aKey.getLength() ) + { + rtl::OUString aK( aKey.makeStringAndClear() ); + key_translation_map::const_iterator it = m_aTranslations.find( aK ); + if( it != m_aTranslations.end() ) + { + const translation_map& rMap( it->second ); + + com::sun::star::lang::Locale aLoc( normalizeInputLocale( i_rLocale, true ) ); + for( int nTry = 0; nTry < 4; nTry++ ) + { + translation_map::const_iterator tr = rMap.find( aLoc ); + if( tr != rMap.end() ) + { + aResult = tr->second; + break; + } + switch( nTry ) + { + case 0: aLoc.Variant = rtl::OUString();break; + case 1: aLoc.Country = rtl::OUString();break; + case 2: aLoc.Language = rtl::OUString();break; + } + } + } + } + return aResult; + } +} + using namespace psp; using namespace rtl; @@ -481,7 +678,8 @@ PPDParser::PPDParser( const String& rFile ) : m_pResolutions( NULL ), m_pDefaultDuplexType( NULL ), m_pDuplexTypes( NULL ), - m_pFontList( NULL ) + m_pFontList( NULL ), + m_pTranslator( new PPDTranslator() ) { // read in the file std::list< ByteString > aLines; @@ -648,6 +846,7 @@ PPDParser::~PPDParser() { for( PPDParser::hash_type::iterator it = m_aKeys.begin(); it != m_aKeys.end(); ++it ) delete it->second; + delete m_pTranslator; } void PPDParser::insertKey( const String& rKey, PPDKey* pKey ) @@ -687,11 +886,11 @@ static sal_uInt8 getNibble( sal_Char cChar ) return nRet; } -String PPDParser::handleTranslation( const ByteString& rString ) +String PPDParser::handleTranslation( const ByteString& i_rString, bool bIsGlobalized ) { - int nOrigLen = rString.Len(); + int nOrigLen = i_rString.Len(); OStringBuffer aTrans( nOrigLen ); - const sal_Char* pStr = rString.GetBuffer(); + const sal_Char* pStr = i_rString.GetBuffer(); const sal_Char* pEnd = pStr + nOrigLen; while( pStr < pEnd ) { @@ -710,14 +909,11 @@ String PPDParser::handleTranslation( const ByteString& rString ) else aTrans.append( *pStr++ ); } - return OStringToOUString( aTrans.makeStringAndClear(), m_aFileEncoding ); + return OStringToOUString( aTrans.makeStringAndClear(), bIsGlobalized ? RTL_TEXTENCODING_UTF8 : m_aFileEncoding ); } void PPDParser::parse( ::std::list< ByteString >& rLines ) { - PPDValue* pValue = NULL; - PPDKey* pKey = NULL; - std::list< ByteString >::iterator line = rLines.begin(); PPDParser::hash_type::const_iterator keyit; while( line != rLines.end() ) @@ -765,14 +961,25 @@ void PPDParser::parse( ::std::list< ByteString >& rLines ) } String aUniKey( aKey, RTL_TEXTENCODING_MS_1252 ); - keyit = m_aKeys.find( aUniKey ); - if( keyit == m_aKeys.end() ) + // handle CUPS extension for globalized PPDs + bool bIsGlobalizedLine = false; + com::sun::star::lang::Locale aTransLocale; + if( ( aUniKey.Len() > 3 && aUniKey.GetChar( 2 ) == '.' ) || + ( aUniKey.Len() > 5 && aUniKey.GetChar( 2 ) == '_' && aUniKey.GetChar( 5 ) == '.' ) ) { - pKey = new PPDKey( aUniKey ); - insertKey( aUniKey, pKey ); + if( aUniKey.GetChar( 2 ) == '.' ) + { + aTransLocale.Language = aUniKey.Copy( 0, 2 ); + aUniKey = aUniKey.Copy( 3 ); + } + else + { + aTransLocale.Language = aUniKey.Copy( 0, 2 ); + aTransLocale.Country = aUniKey.Copy( 3, 2 ); + aUniKey = aUniKey.Copy( 6 ); + } + bIsGlobalizedLine = true; } - else - pKey = keyit->second; String aOption; nPos = aCurrentLine.Search( ':' ); @@ -784,90 +991,125 @@ void PPDParser::parse( ::std::list< ByteString >& rLines ) if( nTransPos != STRING_NOTFOUND ) aOption.Erase( nTransPos ); } - pValue = pKey->insertValue( aOption ); - if( ! pValue ) - continue; - if( nPos == STRING_NOTFOUND ) + PPDValueType eType = eNo; + String aValue; + rtl::OUString aOptionTranslation; + rtl::OUString aValueTranslation; + if( nPos != STRING_NOTFOUND ) { - // have a single main keyword - pValue->m_eType = eNo; - if( bQuery ) - pKey->eraseValue( aOption ); - continue; - } - - // found a colon, there may be an option - ByteString aLine = aCurrentLine.Copy( 1, nPos-1 ); - aLine = WhitespaceToSpace( aLine ); - int nTransPos = aLine.Search( '/' ); - if( nTransPos != STRING_NOTFOUND ) - pValue->m_aOptionTranslation = handleTranslation( aLine.Copy( nTransPos+1 ) ); + // found a colon, there may be an option + ByteString aLine = aCurrentLine.Copy( 1, nPos-1 ); + aLine = WhitespaceToSpace( aLine ); + int nTransPos = aLine.Search( '/' ); + if( nTransPos != STRING_NOTFOUND ) + aOptionTranslation = handleTranslation( aLine.Copy( nTransPos+1 ), bIsGlobalizedLine ); - // read in more lines if necessary for multiline values - aLine = aCurrentLine.Copy( nPos+1 ); - if( aLine.Len() ) - { - while( ! ( aLine.GetTokenCount( '"' ) & 1 ) && - line != rLines.end() ) - // while there is an even number of tokens; that means - // an odd number of doubleqoutes + // read in more lines if necessary for multiline values + aLine = aCurrentLine.Copy( nPos+1 ); + if( aLine.Len() ) { - // copy the newlines also - aLine += '\n'; - aLine += *line; - ++line; + while( ! ( aLine.GetTokenCount( '"' ) & 1 ) && + line != rLines.end() ) + // while there is an even number of tokens; that means + // an odd number of doubleqoutes + { + // copy the newlines also + aLine += '\n'; + aLine += *line; + ++line; + } } - } - aLine = WhitespaceToSpace( aLine ); + aLine = WhitespaceToSpace( aLine ); - // #i100644# handle a missing value (actually a broken PPD) - if( ! aLine.Len() ) - { - pValue->m_aValue = String(); - pValue->m_aValueTranslation = String(); - if( pValue->m_aOption.Len() && - aKey.CompareTo( "JCL", 3 ) != COMPARE_EQUAL ) - pValue->m_eType = eInvocation; + // #i100644# handle a missing value (actually a broken PPD) + if( ! aLine.Len() ) + { + if( aOption.Len() && + aUniKey.CompareToAscii( "JCL", 3 ) != COMPARE_EQUAL ) + eType = eInvocation; + else + eType = eQuoted; + } + // check for invocation or quoted value + else if( aLine.GetChar(0) == '"' ) + { + aLine.Erase( 0, 1 ); + nTransPos = aLine.Search( '"' ); + aValue = String( aLine.Copy( 0, nTransPos ), RTL_TEXTENCODING_MS_1252 ); + // after the second doublequote can follow a / and a translation + aValueTranslation = handleTranslation( aLine.Copy( nTransPos+2 ), bIsGlobalizedLine ); + // check for quoted value + if( aOption.Len() && + aUniKey.CompareToAscii( "JCL", 3 ) != COMPARE_EQUAL ) + eType = eInvocation; + else + eType = eQuoted; + } + // check for symbol value + else if( aLine.GetChar(0) == '^' ) + { + aLine.Erase( 0, 1 ); + aValue = String( aLine, RTL_TEXTENCODING_MS_1252 ); + eType = eSymbol; + } else - pValue->m_eType = eQuoted; + { + // must be a string value then + // strictly this is false because string values + // can contain any whitespace which is reduced + // to one space by now + // who cares ... + nTransPos = aLine.Search( '/' ); + if( nTransPos == STRING_NOTFOUND ) + nTransPos = aLine.Len(); + aValue = String( aLine.Copy( 0, nTransPos ), RTL_TEXTENCODING_MS_1252 ); + aValueTranslation = handleTranslation( aLine.Copy( nTransPos+1 ), bIsGlobalizedLine ); + eType = eString; + } } - // check for invocation or quoted value - else if( aLine.GetChar(0) == '"' ) + + // handle globalized PPD entries + if( bIsGlobalizedLine ) { - aLine.Erase( 0, 1 ); - nTransPos = aLine.Search( '"' ); - pValue->m_aValue = String( aLine.Copy( 0, nTransPos ), RTL_TEXTENCODING_MS_1252 ); - // after the second doublequote can follow a / and a translation - pValue->m_aValueTranslation = handleTranslation( aLine.Copy( nTransPos+2 ) ); - // check for quoted value - if( pValue->m_aOption.Len() && - aKey.CompareTo( "JCL", 3 ) != COMPARE_EQUAL ) - pValue->m_eType = eInvocation; + // handle main key translations of form: + // *ll_CC.Translation MainKeyword/translated text: "" + if( aUniKey.EqualsAscii( "Translation" ) ) + { + m_pTranslator->insertKey( aOption, aOptionTranslation, aTransLocale ); + } + // handle options translations of for: + // *ll_CC.MainKeyword OptionKeyword/translated text: "" else - pValue->m_eType = eQuoted; + { + m_pTranslator->insertOption( aUniKey, aOption, aOptionTranslation, aTransLocale ); + } + continue; } - // check for symbol value - else if( aLine.GetChar(0) == '^' ) + + PPDKey* pKey = NULL; + keyit = m_aKeys.find( aUniKey ); + if( keyit == m_aKeys.end() ) { - aLine.Erase( 0, 1 ); - pValue->m_aValue = String( aLine, RTL_TEXTENCODING_MS_1252 ); - pValue->m_eType = eSymbol; + pKey = new PPDKey( aUniKey ); + insertKey( aUniKey, pKey ); } else - { - // must be a string value then - // strictly this is false because string values - // can contain any whitespace which is reduced - // to one space by now - // who cares ... - nTransPos = aLine.Search( '/' ); - if( nTransPos == STRING_NOTFOUND ) - nTransPos = aLine.Len(); - pValue->m_aValue = String( aLine.Copy( 0, nTransPos ), RTL_TEXTENCODING_MS_1252 ); - pValue->m_aValueTranslation = handleTranslation( aLine.Copy( nTransPos+1 ) ); - pValue->m_eType = eString; - } + pKey = keyit->second; + + if( eType == eNo && bQuery ) + continue; + + PPDValue* pValue = pKey->insertValue( aOption ); + if( ! pValue ) + continue; + pValue->m_eType = eType; + pValue->m_aValue = aValue; + + if( aOptionTranslation.getLength() ) + m_pTranslator->insertOption( aUniKey, aOption, aOptionTranslation, aTransLocale ); + if( aValueTranslation.getLength() ) + m_pTranslator->insertValue( aUniKey, aOption, aValue, aValueTranslation, aTransLocale ); // eventually update query and remove from option list if( bQuery && pKey->m_bQueryValue == FALSE ) @@ -893,7 +1135,7 @@ void PPDParser::parse( ::std::list< ByteString >& rLines ) keyit = m_aKeys.find( aKey ); if( keyit != m_aKeys.end() ) { - pKey = keyit->second; + PPDKey* pKey = keyit->second; const PPDValue* pDefValue = pKey->getValue( aOption ); if( pKey->m_pDefaultValue == NULL ) pKey->m_pDefaultValue = pDefValue; @@ -904,7 +1146,7 @@ void PPDParser::parse( ::std::list< ByteString >& rLines ) // do not exist otherwise // (example: DefaultResolution) // so invent that key here and have a default value - pKey = new PPDKey( aKey ); + PPDKey* pKey = new PPDKey( aKey ); PPDValue* pNewValue = pKey->insertValue( aOption ); pNewValue->m_eType = eInvocation; // or what ? insertKey( aKey, pKey ); @@ -929,7 +1171,7 @@ void PPDParser::parseOpenUI( const ByteString& rLine ) nPos = aKey.Search( '/' ); if( nPos != STRING_NOTFOUND ) { - aTranslation = handleTranslation( aKey.Copy( nPos + 1 ) ); + aTranslation = handleTranslation( aKey.Copy( nPos + 1 ), false ); aKey.Erase( nPos ); } aKey = GetCommandLineToken( 1, aKey ); @@ -947,7 +1189,7 @@ void PPDParser::parseOpenUI( const ByteString& rLine ) pKey = keyit->second; pKey->m_bUIOption = true; - pKey->m_aUITranslation = aTranslation; + m_pTranslator->insertKey( pKey->getKey(), aTranslation ); ByteString aValue = WhitespaceToSpace( rLine.GetToken( 1, ':' ) ); if( aValue.CompareIgnoreCaseToAscii( "boolean" ) == COMPARE_EQUAL ) @@ -1407,6 +1649,36 @@ const String& PPDParser::getFont( int nFont ) const return aEmptyString; } +rtl::OUString PPDParser::translateKey( const rtl::OUString& i_rKey, + const com::sun::star::lang::Locale& i_rLocale ) const +{ + rtl::OUString aResult( m_pTranslator->translateKey( i_rKey, i_rLocale ) ); + if( aResult.getLength() == 0 ) + aResult = i_rKey; + return aResult; +} + +rtl::OUString PPDParser::translateOption( const rtl::OUString& i_rKey, + const rtl::OUString& i_rOption, + const com::sun::star::lang::Locale& i_rLocale ) const +{ + rtl::OUString aResult( m_pTranslator->translateOption( i_rKey, i_rOption, i_rLocale ) ); + if( aResult.getLength() == 0 ) + aResult = i_rOption; + return aResult; +} + +rtl::OUString PPDParser::translateValue( const rtl::OUString& i_rKey, + const rtl::OUString& i_rOption, + const rtl::OUString& i_rValue, + const com::sun::star::lang::Locale& i_rLocale ) const +{ + rtl::OUString aResult( m_pTranslator->translateValue( i_rKey, i_rOption, i_rValue, i_rLocale ) ); + if( aResult.getLength() == 0 ) + aResult = i_rValue; + return aResult; +} + /* * PPDKey */ -- cgit v1.2.3 From 07a01d51fcb13156029cd2fd3c96605500773f11 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 16 Dec 2009 17:47:03 +0100 Subject: vcl108: #i107260# avoid waiting for an event that may never come --- vcl/unx/source/dtrans/X11_selection.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcl/unx/source/dtrans/X11_selection.cxx b/vcl/unx/source/dtrans/X11_selection.cxx index 07f2cfd5e087..e549d92d9c5f 100644 --- a/vcl/unx/source/dtrans/X11_selection.cxx +++ b/vcl/unx/source/dtrans/X11_selection.cxx @@ -3810,7 +3810,7 @@ void SelectionManager::shutdown() throw() */ aGuard.clear(); while (osl_isThreadRunning(m_aThread)) - Application::Yield(); + Application::Reschedule(); osl_joinWithThread( m_aThread ); osl_destroyThread( m_aThread ); m_aThread = NULL; -- cgit v1.2.3 From 8939f29a75911f10371ba1d8bc70cc88e418e5bd Mon Sep 17 00:00:00 2001 From: sj Date: Wed, 16 Dec 2009 17:55:41 +0100 Subject: impress181: #i74384# fixed max value color handling --- goodies/source/filter.vcl/ipbm/ipbm.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/goodies/source/filter.vcl/ipbm/ipbm.cxx b/goodies/source/filter.vcl/ipbm/ipbm.cxx index 227490fc9d8e..c0b0f6012116 100644 --- a/goodies/source/filter.vcl/ipbm/ipbm.cxx +++ b/goodies/source/filter.vcl/ipbm/ipbm.cxx @@ -106,7 +106,7 @@ BOOL PBMReader::ReadPBM( SvStream & rPBM, Graphic & rGraphic ) if ( ( mbStatus = ImplReadHeader() ) == FALSE ) return FALSE; - if ( mnWidth == 0 || mnHeight == 0 ) + if ( ( mnMaxVal == 0 ) || ( mnWidth == 0 ) || ( mnHeight == 0 ) ) return FALSE; // 0->PBM, 1->PGM, 2->PPM @@ -466,7 +466,9 @@ BOOL PBMReader::ImplReadBody() if ( nCount == 3 ) { nCount = 0; - mpAcc->SetPixel( nHeight, nWidth++, BitmapColor( (BYTE)nRGB[ 0 ], (BYTE)nRGB[ 1 ], (BYTE)nRGB[ 2 ] ) ); + mpAcc->SetPixel( nHeight, nWidth++, BitmapColor( static_cast< BYTE >( ( nRGB[ 0 ] * 255 ) / mnMaxVal ), + static_cast< BYTE >( ( nRGB[ 1 ] * 255 ) / mnMaxVal ), + static_cast< BYTE >( ( nRGB[ 2 ] * 255 ) / mnMaxVal ) ) ); nCount = 0; nRGB[ 0 ] = nRGB[ 1 ] = nRGB[ 2 ] = 0; if ( nWidth == mnWidth ) -- cgit v1.2.3 From 932a2e676afda577c77710bf982f512b0ef76190 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Wed, 16 Dec 2009 19:57:15 +0100 Subject: vcl108: #i26535# make Ctrl-Tab work in TabDialogs if focus is not in TabControl hierarchy --- vcl/inc/vcl/tabctrl.hxx | 4 ++++ vcl/inc/vcl/tabdlg.hxx | 3 +++ vcl/source/control/tabctrl.cxx | 12 ++++++++++-- vcl/source/window/dlgctrl.cxx | 15 +++++++++++++++ vcl/source/window/tabdlg.cxx | 18 ++++++++++++++++++ 5 files changed, 50 insertions(+), 2 deletions(-) diff --git a/vcl/inc/vcl/tabctrl.hxx b/vcl/inc/vcl/tabctrl.hxx index 30edf6227a60..7bef14b1e725 100644 --- a/vcl/inc/vcl/tabctrl.hxx +++ b/vcl/inc/vcl/tabctrl.hxx @@ -96,6 +96,10 @@ private: SAL_DLLPRIVATE void ImplFreeLayoutData(); DECL_DLLPRIVATE_LINK( ImplScrollBtnHdl, PushButton* pBtn ); +public: + // just for dialog control + SAL_DLLPRIVATE bool ImplHandleNotifyEvent( NotifyEvent& rEvt ); + protected: using Window::ImplInit; SAL_DLLPRIVATE void ImplInit( Window* pParent, WinBits nStyle ); diff --git a/vcl/inc/vcl/tabdlg.hxx b/vcl/inc/vcl/tabdlg.hxx index 5ec2bcad5225..ad79ebec4549 100644 --- a/vcl/inc/vcl/tabdlg.hxx +++ b/vcl/inc/vcl/tabdlg.hxx @@ -36,6 +36,7 @@ #include class FixedLine; +class TabControl; // ---------------------- // - TabDialog - @@ -61,6 +62,8 @@ public: virtual void Resize(); virtual void StateChanged( StateChangedType nStateChange ); + SAL_DLLPRIVATE TabControl* ImplGetFirstTabControl() const; + void AdjustLayout(); void SetViewWindow( Window* pWindow ) { mpViewWindow = pWindow; } diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index 9a34629ddf8e..e4fa804e4177 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -1601,7 +1601,7 @@ long TabControl::PreNotify( NotifyEvent& rNEvt ) // ----------------------------------------------------------------------- -long TabControl::Notify( NotifyEvent& rNEvt ) +bool TabControl::ImplHandleNotifyEvent( NotifyEvent& rNEvt ) { if ( (rNEvt.GetType() == EVENT_KEYINPUT) && (GetPageCount() > 1) ) { @@ -1629,8 +1629,16 @@ long TabControl::Notify( NotifyEvent& rNEvt ) } } } + return false; +} + + +// ----------------------------------------------------------------------- + +long TabControl::Notify( NotifyEvent& rNEvt ) +{ - return Control::Notify( rNEvt ); + return ImplHandleNotifyEvent( rNEvt ) ? TRUE : Control::Notify( rNEvt ); } // ----------------------------------------------------------------------- diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx index c6f64d74c5fc..a332c89dc9be 100644 --- a/vcl/source/window/dlgctrl.cxx +++ b/vcl/source/window/dlgctrl.cxx @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -888,6 +889,20 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput ) return TRUE; } + // if we have come here (and therefore the strange "formular" logic above + // turned up no result, then let's try to find a customer for Ctrl-TAB + if ( nKeyCode == KEY_TAB && aKeyCode.IsMod1() && ! aKeyCode.IsMod2() ) + { + TabDialog* pDlg = dynamic_cast(this); + if( pDlg ) + { + TabControl* pTabCtrl = pDlg->ImplGetFirstTabControl(); + NotifyEvent aEvt( bKeyInput ? EVENT_KEYINPUT : EVENT_KEYUP, + pTabCtrl, &rKEvt ); + return pTabCtrl->ImplHandleNotifyEvent( aEvt ); + } + } + return FALSE; } diff --git a/vcl/source/window/tabdlg.cxx b/vcl/source/window/tabdlg.cxx index 95fb404d24af..217533c8d6b7 100644 --- a/vcl/source/window/tabdlg.cxx +++ b/vcl/source/window/tabdlg.cxx @@ -276,3 +276,21 @@ void TabDialog::AdjustLayout() { ImplPosControls(); } + +// ----------------------------------------------------------------------- + +TabControl* TabDialog::ImplGetFirstTabControl() const +{ + Window* pChild = GetWindow( WINDOW_FIRSTCHILD ); + while ( pChild ) + { + if ( pChild->IsVisible() && (pChild != mpViewWindow) ) + { + if ( pChild->GetType() == WINDOW_TABCONTROL ) + return (TabControl*)pChild; + } + pChild = pChild->GetWindow( WINDOW_NEXT ); + } + return NULL; +} + -- cgit v1.2.3 From 81548de5afc835f4d91addb8d9eb6b90f708c2cb Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Thu, 17 Dec 2009 09:24:11 +0100 Subject: source files renamed to avoid object file name clashes in output tree. --- ucb/source/ucp/gvfs/content.cxx | 1799 -------------------------------- ucb/source/ucp/gvfs/content.hxx | 267 ----- ucb/source/ucp/gvfs/directory.cxx | 424 -------- ucb/source/ucp/gvfs/directory.hxx | 98 -- ucb/source/ucp/gvfs/gvfs_content.cxx | 1799 ++++++++++++++++++++++++++++++++ ucb/source/ucp/gvfs/gvfs_content.hxx | 267 +++++ ucb/source/ucp/gvfs/gvfs_directory.cxx | 424 ++++++++ ucb/source/ucp/gvfs/gvfs_directory.hxx | 98 ++ ucb/source/ucp/gvfs/gvfs_provider.cxx | 231 ++++ ucb/source/ucp/gvfs/gvfs_provider.hxx | 68 ++ ucb/source/ucp/gvfs/gvfs_stream.cxx | 346 ++++++ ucb/source/ucp/gvfs/gvfs_stream.hxx | 168 +++ ucb/source/ucp/gvfs/makefile.mk | 10 +- ucb/source/ucp/gvfs/provider.cxx | 231 ---- ucb/source/ucp/gvfs/provider.hxx | 68 -- ucb/source/ucp/gvfs/stream.cxx | 346 ------ ucb/source/ucp/gvfs/stream.hxx | 168 --- 17 files changed, 3406 insertions(+), 3406 deletions(-) delete mode 100644 ucb/source/ucp/gvfs/content.cxx delete mode 100644 ucb/source/ucp/gvfs/content.hxx delete mode 100644 ucb/source/ucp/gvfs/directory.cxx delete mode 100644 ucb/source/ucp/gvfs/directory.hxx create mode 100644 ucb/source/ucp/gvfs/gvfs_content.cxx create mode 100644 ucb/source/ucp/gvfs/gvfs_content.hxx create mode 100644 ucb/source/ucp/gvfs/gvfs_directory.cxx create mode 100644 ucb/source/ucp/gvfs/gvfs_directory.hxx create mode 100644 ucb/source/ucp/gvfs/gvfs_provider.cxx create mode 100644 ucb/source/ucp/gvfs/gvfs_provider.hxx create mode 100644 ucb/source/ucp/gvfs/gvfs_stream.cxx create mode 100644 ucb/source/ucp/gvfs/gvfs_stream.hxx delete mode 100644 ucb/source/ucp/gvfs/provider.cxx delete mode 100644 ucb/source/ucp/gvfs/provider.hxx delete mode 100644 ucb/source/ucp/gvfs/stream.cxx delete mode 100644 ucb/source/ucp/gvfs/stream.hxx diff --git a/ucb/source/ucp/gvfs/content.cxx b/ucb/source/ucp/gvfs/content.cxx deleted file mode 100644 index 743043c09fc7..000000000000 --- a/ucb/source/ucp/gvfs/content.cxx +++ /dev/null @@ -1,1799 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: content.cxx,v $ - * $Revision: 1.12 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_ucb.hxx" -#include -#include -#include - -#include "osl/time.h" -#include - -#include "osl/doublecheckedlocking.h" - -#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUES_HPP_ -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef _COM_SUN_STAR_UCB_INTERACTIVEBADTRANSFRERURLEXCEPTION_HPP_ -#include -#endif -#include -#include -#ifndef _COM_SUN_STAR_UCB_INTERACTIVENETWORKGENBERALEXCEPTION_HPP_ -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef _UCBHELPER_INTERACTIONREQUEST_HXX -#include -#endif -#include -#include - -const int TRANSFER_BUFFER_SIZE = 65536; - -/* - * NB. Name escaping is done only for URIs - * the 'Title' property is unescaped on set/get - */ -#include -#include -#include -extern "C" { // missing in the header: doh. -# include -} - -#include "content.hxx" -#include "provider.hxx" -#include "directory.hxx" -#include "stream.hxx" - -using namespace gvfs; -using namespace com::sun::star; - -#define CLEAR_INFO(info) memset((info), 0, sizeof ((info)[0])) - - -static char * -OUStringToGnome( const rtl::OUString &str ) -{ - rtl::OString aTempStr = rtl::OUStringToOString( str, RTL_TEXTENCODING_UTF8 ); - return g_strdup( (const sal_Char *) aTempStr ); -} - -static rtl::OUString -GnomeToOUString( const char *utf8_str) -{ - if (!utf8_str) - return rtl::OUString(); - else - return rtl::OUString( utf8_str, strlen( utf8_str ), RTL_TEXTENCODING_UTF8 ); -} - - -Content::Content( - const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, - ContentProvider* pProvider, - const uno::Reference< ucb::XContentIdentifier >& Identifier) - throw ( ucb::ContentCreationException ) - : ContentImplHelper( rxSMgr, pProvider, Identifier ), - m_pProvider( pProvider ), - m_bTransient( sal_False ) -{ - CLEAR_INFO (&m_info); -#ifdef DEBUG - g_warning ("New Content ('%s')", getURI()); -#endif -} - -Content::Content( - const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, - ContentProvider * pProvider, - const uno::Reference< ucb::XContentIdentifier >& Identifier, - sal_Bool IsFolder) - throw ( ucb::ContentCreationException ) - : ContentImplHelper( rxSMgr, pProvider, Identifier ), - m_pProvider( pProvider ), - m_bTransient( sal_True ) -{ - CLEAR_INFO (&m_info); - -#ifdef DEBUG - g_warning ("New Transient content ('%s') (%d)", getURI(), IsFolder); -#endif -// m_info.name = FIXME: set name ? - m_info.valid_fields = GNOME_VFS_FILE_INFO_FIELDS_TYPE; - m_info.type = IsFolder ? GNOME_VFS_FILE_TYPE_DIRECTORY : - GNOME_VFS_FILE_TYPE_REGULAR; -} - -// virtual -Content::~Content() -{ - gnome_vfs_file_info_clear( &m_info ); -} - -// -// XInterface methods. -// - -void SAL_CALL Content::acquire() - throw( ) -{ - ContentImplHelper::acquire(); -} -void SAL_CALL Content::release() - throw( ) -{ - ContentImplHelper::release(); -} -uno::Any SAL_CALL Content::queryInterface( const uno::Type & rType ) - throw ( uno::RuntimeException ) -{ - // Note: isFolder may require network activities! So call it only - // if it is really necessary!!! - uno::Any aRet = cppu::queryInterface( rType, - static_cast< ucb::XContentCreator * >( this ) ); - if ( aRet.hasValue() ) - return isFolder( uno::Reference< ucb::XCommandEnvironment >() ) - ? aRet : uno::Any(); - else - return aRet.hasValue() ? aRet : ContentImplHelper::queryInterface( rType ); -} - -// -// XTypeProvider methods. -// - -XTYPEPROVIDER_COMMON_IMPL( Content ); - -uno::Sequence< uno::Type > SAL_CALL Content::getTypes() - throw( uno::RuntimeException ) -{ - static cppu::OTypeCollection *pFolderCollection = NULL; - static cppu::OTypeCollection *pFileCollection = NULL; - - if (!pFolderCollection) { - osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); - - if (!pFolderCollection) { - static cppu::OTypeCollection aFolderCollection - (CPPU_TYPE_REF( lang::XTypeProvider ), - CPPU_TYPE_REF( lang::XServiceInfo ), - CPPU_TYPE_REF( lang::XComponent ), - CPPU_TYPE_REF( ucb::XContent ), - CPPU_TYPE_REF( ucb::XCommandProcessor ), - CPPU_TYPE_REF( beans::XPropertiesChangeNotifier ), - CPPU_TYPE_REF( ucb::XCommandInfoChangeNotifier ), - CPPU_TYPE_REF( beans::XPropertyContainer ), - CPPU_TYPE_REF( beans::XPropertySetInfoChangeNotifier ), - CPPU_TYPE_REF( container::XChild ), - CPPU_TYPE_REF( ucb::XContentCreator ) ); // !! - static cppu::OTypeCollection aFileCollection - (CPPU_TYPE_REF( lang::XTypeProvider ), - CPPU_TYPE_REF( lang::XServiceInfo ), - CPPU_TYPE_REF( lang::XComponent ), - CPPU_TYPE_REF( ucb::XContent ), - CPPU_TYPE_REF( ucb::XCommandProcessor ), - CPPU_TYPE_REF( beans::XPropertiesChangeNotifier ), - CPPU_TYPE_REF( ucb::XCommandInfoChangeNotifier ), - CPPU_TYPE_REF( beans::XPropertyContainer ), - CPPU_TYPE_REF( beans::XPropertySetInfoChangeNotifier ), - CPPU_TYPE_REF( container::XChild ) ); - - pFolderCollection = &aFolderCollection; - pFileCollection = &aFileCollection; - OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER(); - } - } - else { - OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER(); - } - - if ( isFolder( uno::Reference< ucb::XCommandEnvironment >() ) ) - return pFolderCollection->getTypes(); - else - return pFileCollection->getTypes(); -} - -// -// XServiceInfo methods. -// - -rtl::OUString SAL_CALL Content::getImplementationName() - throw( uno::RuntimeException ) -{ - return rtl::OUString::createFromAscii("com.sun.star.comp.GnomeVFSContent" ); -} - -uno::Sequence< rtl::OUString > SAL_CALL Content::getSupportedServiceNames() - throw( uno::RuntimeException ) -{ - uno::Sequence< rtl::OUString > aSNS( 1 ); - aSNS.getArray()[ 0 ] = rtl::OUString::createFromAscii( - "com.sun.star.ucb.GnomeVFSContent" ); - return aSNS; -} - -// -// XContent methods. -// - -rtl::OUString SAL_CALL Content::getContentType() - throw( uno::RuntimeException ) -{ - if ( isFolder( uno::Reference< ucb::XCommandEnvironment >() ) ) - return rtl::OUString::createFromAscii( GVFS_FOLDER_TYPE ); - else - return rtl::OUString::createFromAscii( GVFS_FILE_TYPE ); -} - -// -// XCommandProcessor methods. -// - -uno::Any Content::getBadArgExcept() -{ - return uno::makeAny( lang::IllegalArgumentException - ( rtl::OUString::createFromAscii( "Wrong argument type!" ), - static_cast< cppu::OWeakObject * >( this ), - -1 ) ); -} - -#include - -uno::Any SAL_CALL Content::execute( - const ucb::Command& aCommand, - sal_Int32 /*CommandId*/, - const uno::Reference< ucb::XCommandEnvironment >& xEnv ) - throw( uno::Exception, - ucb::CommandAbortedException, - uno::RuntimeException ) -{ - uno::Any aRet; - -#ifdef DEBUG - { - uno::Reference< task::XInteractionHandler > xIH; - - if ( xEnv.is() ) - xIH = xEnv->getInteractionHandler(); - g_warning( "Execute command: '%s' with %s interaction env", - OUStringToGnome( aCommand.Name ), - xIH.is() ? "" : "NO" ); - } -#endif - -#define COMMAND_IS(cmd,name) ( (cmd).Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( name ) ) ) - - if ( COMMAND_IS( aCommand, "getPropertyValues" ) ) { - uno::Sequence< beans::Property > Properties; - - if ( !( aCommand.Argument >>= Properties ) ) - ucbhelper::cancelCommandExecution ( getBadArgExcept (), xEnv ); - - aRet <<= getPropertyValues( Properties, xEnv ); - - } else if ( COMMAND_IS( aCommand, "setPropertyValues" ) ) { - uno::Sequence< beans::PropertyValue > aProperties; - - if ( !( aCommand.Argument >>= aProperties ) || - !aProperties.getLength() ) - ucbhelper::cancelCommandExecution ( getBadArgExcept (), xEnv ); - - aRet <<= setPropertyValues( aProperties, xEnv ); - - } else if ( COMMAND_IS( aCommand, "getPropertySetInfo" ) ) { - aRet <<= getPropertySetInfo( xEnv, sal_False ); - - } else if ( COMMAND_IS( aCommand, "getCommandInfo" ) ) { - aRet <<= getCommandInfo( xEnv, sal_False ); - - } else if ( COMMAND_IS( aCommand, "open" ) ) { - rtl::OUString str = m_xIdentifier->getContentIdentifier(); - rtl::OString stra( - str.getStr(), - str.getLength(), - RTL_TEXTENCODING_UTF8); - - ucb::OpenCommandArgument2 aOpenCommand; - if ( !( aCommand.Argument >>= aOpenCommand ) ) - ucbhelper::cancelCommandExecution ( getBadArgExcept (), xEnv ); - - sal_Bool bOpenFolder = - ( ( aOpenCommand.Mode == ucb::OpenMode::ALL ) || - ( aOpenCommand.Mode == ucb::OpenMode::FOLDERS ) || - ( aOpenCommand.Mode == ucb::OpenMode::DOCUMENTS ) ); - - if ( bOpenFolder && isFolder( xEnv ) ) { - uno::Reference< ucb::XDynamicResultSet > xSet - = new DynamicResultSet(m_xSMgr, this, aOpenCommand, xEnv ); - aRet <<= xSet; - - } else if ( aOpenCommand.Sink.is() ) { - - if ( ( aOpenCommand.Mode - == ucb::OpenMode::DOCUMENT_SHARE_DENY_NONE ) || - ( aOpenCommand.Mode - == ucb::OpenMode::DOCUMENT_SHARE_DENY_WRITE ) ) { - ucbhelper::cancelCommandExecution - ( uno::makeAny ( ucb::UnsupportedOpenModeException - ( rtl::OUString(), - static_cast< cppu::OWeakObject * >( this ), - sal_Int16( aOpenCommand.Mode ) ) ), - xEnv ); - } - if ( !feedSink( aOpenCommand.Sink, xEnv ) ) { - // Note: aOpenCommand.Sink may contain an XStream - // implementation. Support for this type of - // sink is optional... -#ifdef DEBUG - g_warning ("Failed to load data from '%s'", getURI()); -#endif - ucbhelper::cancelCommandExecution - ( uno::makeAny (ucb::UnsupportedDataSinkException - ( rtl::OUString(), - static_cast< cppu::OWeakObject * >( this ), - aOpenCommand.Sink ) ), - xEnv ); - } - } -#ifdef DEBUG - else - g_warning ("Open falling through ..."); -#endif - - } else if ( COMMAND_IS( aCommand, "insert" ) ) { - ucb::InsertCommandArgument arg; - if ( !( aCommand.Argument >>= arg ) ) - ucbhelper::cancelCommandExecution ( getBadArgExcept (), xEnv ); - - insert( arg.Data, arg.ReplaceExisting, xEnv ); - - } else if ( COMMAND_IS( aCommand, "delete" ) ) { - - sal_Bool bDeletePhysical = sal_False; - aCommand.Argument >>= bDeletePhysical; - - ::rtl::OString aURI = getOURI(); - GnomeVFSResult result = gnome_vfs_unlink ((const sal_Char *) aURI); - - if (result != GNOME_VFS_OK) - cancelCommandExecution( result, xEnv, sal_True ); - - destroy( bDeletePhysical ); - - } else if ( COMMAND_IS( aCommand, "transfer" ) && isFolder( xEnv ) ) { - ucb::TransferInfo transferArgs; - - if ( !( aCommand.Argument >>= transferArgs ) ) - ucbhelper::cancelCommandExecution( getBadArgExcept(), xEnv ); - - transfer( transferArgs, xEnv ); - - } else { // Unsuported -#ifdef DEBUG - g_warning( "Unsupported command: '%s'", - OUStringToGnome( aCommand.Name ) ); -#endif - ucbhelper::cancelCommandExecution - ( uno::makeAny( ucb::UnsupportedCommandException - ( rtl::OUString(), - static_cast< cppu::OWeakObject * >( this ) ) ), - xEnv ); - } -#undef COMMAND_IS - - return aRet; -} - -void SAL_CALL Content::abort( sal_Int32 /*CommandId*/ ) - throw( uno::RuntimeException ) -{ - // FIXME: we should use the GnomeVFSCancellation APIs here ... -} - -// -// XContentCreator methods. -// - -uno::Sequence< ucb::ContentInfo > SAL_CALL -Content::queryCreatableContentsInfo() - throw( uno::RuntimeException ) -{ - uno::Sequence< ucb::ContentInfo > seq(2); - - // Minimum set of props we really need - uno::Sequence< beans::Property > props( 1 ); - props[0] = beans::Property( - rtl::OUString::createFromAscii( "Title" ), - -1, - getCppuType( static_cast< rtl::OUString* >( 0 ) ), - beans::PropertyAttribute::MAYBEVOID | beans::PropertyAttribute::BOUND ); - - // file - seq[0].Type = rtl::OUString::createFromAscii( GVFS_FILE_TYPE ); - seq[0].Attributes = ( ucb::ContentInfoAttribute::INSERT_WITH_INPUTSTREAM | - ucb::ContentInfoAttribute::KIND_DOCUMENT ); - seq[0].Properties = props; - - // folder - seq[1].Type = rtl::OUString::createFromAscii( GVFS_FOLDER_TYPE ); - seq[1].Attributes = ucb::ContentInfoAttribute::KIND_FOLDER; - seq[1].Properties = props; - - return seq; -} - -uno::Reference< ucb::XContent > SAL_CALL -Content::createNewContent( const ucb::ContentInfo& Info ) - throw( uno::RuntimeException ) -{ - bool create_document; - const char *name; - - if ( Info.Type.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( GVFS_FILE_TYPE ) ) ) - create_document = true; - else if ( Info.Type.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( GVFS_FOLDER_TYPE ) ) ) - create_document = false; - else { -#ifdef DEBUG - g_warning( "Failed to create new content '%s'", - OUStringToGnome( Info.Type ) ); -#endif - return uno::Reference< ucb::XContent >(); - } - -#ifdef DEBUG - g_warning( "createNewContent (%d)", (int) create_document ); -#endif - - rtl::OUString aURL = getOUURI(); - - if ( ( aURL.lastIndexOf( '/' ) + 1 ) != aURL.getLength() ) - aURL += rtl::OUString::createFromAscii( "/" ); - - name = create_document ? "[New_Content]" : "[New_Collection]"; - // This looks problematic to me cf. webdav - aURL += rtl::OUString::createFromAscii( name ); - - uno::Reference< ucb::XContentIdentifier > xId - ( new ::ucbhelper::ContentIdentifier( m_xSMgr, aURL ) ); - - try { - return new ::gvfs::Content( m_xSMgr, m_pProvider, xId, !create_document ); - } catch ( ucb::ContentCreationException & ) { - return uno::Reference< ucb::XContent >(); - } -} - -rtl::OUString Content::getParentURL() -{ - rtl::OUString aParentURL; - // :// -> "" - // ://foo -> "" - // ://foo/ -> "" - // ://foo/bar -> ://foo/ - // ://foo/bar/ -> ://foo/ - // ://foo/bar/abc -> ://foo/bar/ - - rtl::OUString aURL = getOUURI(); - - sal_Int32 nPos = aURL.lastIndexOf( '/' ); - if ( nPos == ( aURL.getLength() - 1 ) ) { - // Trailing slash found. Skip. - nPos = aURL.lastIndexOf( '/', nPos ); - } - - sal_Int32 nPos1 = aURL.lastIndexOf( '/', nPos ); - if ( nPos1 != -1 ) - nPos1 = aURL.lastIndexOf( '/', nPos1 ); - - if ( nPos1 != -1 ) - aParentURL = rtl::OUString( aURL.copy( 0, nPos + 1 ) ); - -#ifdef DEBUG - g_warning ("getParentURL '%s' -> '%s'", - getURI(), (const sal_Char *) rtl::OUStringToOString - ( aParentURL, RTL_TEXTENCODING_UTF8 ) ); -#endif - - return aParentURL; -} - -static util::DateTime -getDateFromUnix (time_t t) -{ - TimeValue tv; - tv.Nanosec = 0; - tv.Seconds = t; - oslDateTime dt; - - if ( osl_getDateTimeFromTimeValue( &tv, &dt ) ) - return util::DateTime( 0, dt.Seconds, dt.Minutes, dt.Hours, - dt.Day, dt.Month, dt.Year); - else - return util::DateTime(); -} - -uno::Reference< sdbc::XRow > Content::getPropertyValues( - const uno::Sequence< beans::Property >& rProperties, - const uno::Reference< ucb::XCommandEnvironment >& xEnv ) -{ - int nProps; - GnomeVFSResult result; - uno::Sequence< beans::Property > allProperties; - - if( ( result = getInfo( xEnv ) ) != GNOME_VFS_OK ) - cancelCommandExecution( result, xEnv, sal_False ); - - const beans::Property* pProps; - - if( rProperties.getLength() ) { - nProps = rProperties.getLength(); - pProps = rProperties.getConstArray(); - } else { - allProperties = getPropertySetInfo( xEnv )->getProperties(); - nProps = allProperties.getLength(); - pProps = allProperties.getConstArray(); - } - - rtl::Reference< ::ucbhelper::PropertyValueSet > xRow - = new ::ucbhelper::PropertyValueSet( m_xSMgr ); - - osl::Guard< osl::Mutex > aGuard( m_aMutex ); - for( sal_Int32 n = 0; n < nProps; ++n ) { - const beans::Property& rProp = pProps[ n ]; - - if (rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Title" ) ) ) { - if (m_info.name && m_info.name[0] == '/') - g_warning ("Odd NFS title on item '%s' == '%s'", - getURI(), m_info.name); - xRow->appendString( rProp, GnomeToOUString( m_info.name ) ); - } - - else if (rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ContentType" ) ) ) - xRow->appendString( rProp, getContentType () ); - - else if (rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsDocument" ) ) ) { - if (m_info.valid_fields & GNOME_VFS_FILE_INFO_FIELDS_TYPE) - xRow->appendBoolean( rProp, ( m_info.type == GNOME_VFS_FILE_TYPE_REGULAR || - m_info.type == GNOME_VFS_FILE_TYPE_UNKNOWN ) ); - else - xRow->appendVoid( rProp ); - } - - else if (rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsFolder" ) ) ) { - if (m_info.valid_fields & GNOME_VFS_FILE_INFO_FIELDS_TYPE) - xRow->appendBoolean( rProp, ( m_info.type == GNOME_VFS_FILE_TYPE_DIRECTORY ) ); - else - xRow->appendVoid( rProp ); - } - - else if (rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Size" ) ) ) { - if (m_info.valid_fields & GNOME_VFS_FILE_INFO_FIELDS_SIZE) - xRow->appendLong( rProp, m_info.size ); - else - xRow->appendVoid( rProp ); - } - - else if (rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsReadOnly" ) ) ) { - if (m_info.valid_fields & GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS) { - bool read_only = true; - - if (m_info.uid == getuid () && - m_info.permissions & GNOME_VFS_PERM_USER_WRITE) - read_only = false; - else if (m_info.gid == getgid () && - m_info.permissions & GNOME_VFS_PERM_GROUP_WRITE) - read_only = false; - else if (m_info.permissions & GNOME_VFS_PERM_OTHER_WRITE) - read_only = false; - xRow->appendBoolean( rProp, read_only ); - } else - xRow->appendVoid( rProp ); - } - - else if (rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsHidden" ) ) ) - xRow->appendBoolean( rProp, ( m_info.name && m_info.name[0] == '.' ) ); - - else if (rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsVolume" ) ) || - rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsCompactDisk" ) ) ) - xRow->appendBoolean( rProp, sal_False ); - - else if (rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "DateCreated" ) ) ) { - if (m_info.valid_fields & GNOME_VFS_FILE_INFO_FIELDS_CTIME) - xRow->appendTimestamp( rProp, getDateFromUnix( m_info.ctime ) ); - else - xRow->appendVoid( rProp ); - } - - else if (rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "DateModified" ) ) ) { - if (m_info.valid_fields & GNOME_VFS_FILE_INFO_FIELDS_MTIME) - xRow->appendTimestamp( rProp, getDateFromUnix( m_info.mtime ) ); - else - xRow->appendVoid( rProp ); - } - - else if (rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "MediaType" ) ) ) { - // We do this by sniffing in gnome-vfs; rather expensively. -#ifdef DEBUG - g_warning ("FIXME: Requested mime-type - an expensive op. indeed!"); -#endif - xRow->appendVoid( rProp ); - } else { - xRow->appendVoid( rProp ); - } - } -#ifdef DEBUG - g_warning ("getPropertyValues on '%s' %d properties returned (of %d)", - getURI(), (int)xRow->getLength(), (int)nProps); -#endif - - return uno::Reference< sdbc::XRow >( xRow.get() ); -} - -static lang::IllegalAccessException -getReadOnlyException( Content *ctnt ) -{ - return lang::IllegalAccessException - ( rtl::OUString::createFromAscii( "Property is read-only!" ), - static_cast< cppu::OWeakObject * >( ctnt ) ); -} - -rtl::OUString -Content::makeNewURL( const char */*newName*/ ) -{ - rtl::OUString aNewURL = getParentURL(); - if ( aNewURL.lastIndexOf( '/' ) != ( aNewURL.getLength() - 1 ) ) - aNewURL += rtl::OUString::createFromAscii( "/" ); - - char *name = gnome_vfs_escape_string( m_info.name ); - aNewURL += GnomeToOUString( name ); - g_free( name ); - - return aNewURL; -} - -// This is slightly complicated by needing to support either 'move' or 'setname' -GnomeVFSResult -Content::doSetFileInfo( const GnomeVFSFileInfo *newInfo, - GnomeVFSSetFileInfoMask setMask, - const uno::Reference< ucb::XCommandEnvironment >& /*xEnv*/ ) -{ - GnomeVFSResult result = GNOME_VFS_OK; - - g_assert (!m_bTransient); - - ::rtl::OString aURI = getOURI(); - - osl::Guard< osl::Mutex > aGuard( m_aMutex ); - - // The simple approach: - if( setMask != GNOME_VFS_SET_FILE_INFO_NONE ) - result = gnome_vfs_set_file_info // missed a const in the API there - ( (const sal_Char *) aURI, (GnomeVFSFileInfo *)newInfo, setMask ); - - if ( result == GNOME_VFS_ERROR_NOT_SUPPORTED && - ( setMask & GNOME_VFS_SET_FILE_INFO_NAME ) ) { - // Try a move instead -#ifdef DEBUG - g_warning( "SetFileInfo not supported on '%s'", getURI() ); -#endif - - char *newURI = OUStringToGnome( makeNewURL( newInfo->name ) ); - - result = gnome_vfs_move ((const sal_Char *)aURI, newURI, FALSE); - - g_free (newURI); - } - - return result; -} - - -uno::Sequence< uno::Any > Content::setPropertyValues( - const uno::Sequence< beans::PropertyValue >& rValues, - const uno::Reference< ucb::XCommandEnvironment >& xEnv ) -{ - rtl::OUString aNewTitle; - GnomeVFSFileInfo newInfo; - int setMask = GNOME_VFS_SET_FILE_INFO_NONE; - - getInfo( xEnv ); - - osl::ClearableGuard< osl::Mutex > aGuard( m_aMutex ); - - gnome_vfs_file_info_copy( &newInfo, &m_info ); - - Authentication aAuth( xEnv ); - - int nChanged = 0, nTitlePos = 0; - uno::Sequence< uno::Any > aRet( rValues.getLength() ); - uno::Sequence< beans::PropertyChangeEvent > aChanges( rValues.getLength() ); - - beans::PropertyChangeEvent aEvent; - aEvent.Source = static_cast< cppu::OWeakObject * >( this ); - aEvent.Further = sal_False; - aEvent.PropertyHandle = -1; - // aEvent.PropertyName = fill in later ... - // aEvent.OldValue = - // aEvent.NewValue = - - int nCount = rValues.getLength(); - const beans::PropertyValue* pValues = rValues.getConstArray(); - - for ( sal_Int32 n = 0; n < nCount; ++n ) { - const beans::PropertyValue& rValue = pValues[ n ]; - -#ifdef DEBUG - g_warning( "Set prop '%s'", OUStringToGnome( rValue.Name ) ); -#endif - if ( rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ContentType" ) ) || - rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "MediaType" ) ) || - rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsDocument" ) ) || - rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsFolder" ) ) || - rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Size" ) ) ) - aRet[ n ] <<= getReadOnlyException( this ); - - else if ( rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Title" ) ) ) { - if ( rValue.Value >>= aNewTitle ) { - if ( aNewTitle.getLength() <= 0 ) - aRet[ n ] <<= lang::IllegalArgumentException - ( rtl::OUString::createFromAscii( "Empty title not allowed!" ), - static_cast< cppu::OWeakObject * >( this ), -1 ); - else { - char *newName = OUStringToGnome( aNewTitle ); - - if( !newName || !m_info.name || strcmp( newName, m_info.name ) ) { -#ifdef DEBUG - g_warning ("Set new name to '%s'", newName); -#endif - - aEvent.PropertyName = rtl::OUString::createFromAscii( "Title" ); - aEvent.OldValue = uno::makeAny( GnomeToOUString( newInfo.name ) ); - aEvent.NewValue = uno::makeAny( aNewTitle ); - aChanges.getArray()[ nChanged ] = aEvent; - nTitlePos = nChanged++; - - newInfo.name = newName; - setMask |= GNOME_VFS_SET_FILE_INFO_NAME; - } else // same name - g_free (newName); - } - } else - aRet[ n ] <<= beans::IllegalTypeException - ( rtl::OUString::createFromAscii( "Property value has wrong type!" ), - static_cast< cppu::OWeakObject * >( this ) ); - - } else if ( rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "DateCreated" ) ) || - rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "DateModified" ) ) ) { - // FIXME: should be able to set the timestamps - aRet[ n ] <<= getReadOnlyException( this ); - } else { -#ifdef DEBUG - g_warning( "Unhandled property '%s'", OUStringToGnome( rValue.Name ) ); -#endif - aRet[ n ] <<= getReadOnlyException( this ); - } - } - - GnomeVFSResult result = GNOME_VFS_OK; - - if ( !m_bTransient && - ( result = doSetFileInfo( &newInfo, - (GnomeVFSSetFileInfoMask) setMask, - xEnv ) ) != GNOME_VFS_OK ) { - for (int i = 0; i < nChanged; i++) - aRet[ i ] <<= mapVFSException( result, sal_True ); - - } - - if ( result == GNOME_VFS_OK) { - gnome_vfs_file_info_copy( &m_info, &newInfo ); - - if ( setMask & GNOME_VFS_SET_FILE_INFO_NAME ) { - uno::Reference< ucb::XContentIdentifier > xNewId - = new ::ucbhelper::ContentIdentifier( - m_xSMgr, makeNewURL( newInfo.name ) ); - - aGuard.clear(); - if (!exchangeIdentity( xNewId ) ) - aRet[ nTitlePos ] <<= uno::Exception - ( rtl::OUString::createFromAscii( "Exchange failed!" ), - static_cast< cppu::OWeakObject * >( this ) ); - } - } - - gnome_vfs_file_info_clear( &newInfo ); - - if ( nChanged > 0 ) { - aGuard.clear(); - aChanges.realloc( nChanged ); - notifyPropertiesChange( aChanges ); - } - - return aRet; -} - -void Content::queryChildren( ContentRefList& rChildren ) -{ - // Obtain a list with a snapshot of all currently instanciated contents - // from provider and extract the contents which are direct children - // of this content. - - ::ucbhelper::ContentRefList aAllContents; - m_xProvider->queryExistingContents( aAllContents ); - - rtl::OUString aURL = getOUURI(); - sal_Int32 nURLPos = aURL.lastIndexOf( '/' ); - - if ( nURLPos != ( aURL.getLength() - 1 ) ) - aURL += rtl::OUString::createFromAscii( "/" ); - - sal_Int32 nLen = aURL.getLength(); - - ::ucbhelper::ContentRefList::const_iterator it = aAllContents.begin(); - ::ucbhelper::ContentRefList::const_iterator end = aAllContents.end(); - - while ( it != end ) { - ::ucbhelper::ContentImplHelperRef xChild = (*it); - rtl::OUString aChildURL - = xChild->getIdentifier()->getContentIdentifier(); - - // Is aURL a prefix of aChildURL? - if ( ( aChildURL.getLength() > nLen ) && - ( aChildURL.compareTo( aURL, nLen ) == 0 ) ) { - sal_Int32 nPos = nLen; - nPos = aChildURL.indexOf( '/', nPos ); - - if ( ( nPos == -1 ) || - ( nPos == ( aChildURL.getLength() - 1 ) ) ) { - // No further slashes / only a final slash. It's a child! - rChildren.push_back( ::gvfs::Content::ContentRef - (static_cast< ::gvfs::Content * >(xChild.get() ) ) ); - } - } - ++it; - } -} - -void Content::insert( - const uno::Reference< io::XInputStream > &xInputStream, - sal_Bool bReplaceExisting, - const uno::Reference< ucb::XCommandEnvironment > &xEnv ) - throw( uno::Exception ) -{ - osl::ClearableGuard< osl::Mutex > aGuard( m_aMutex ); - -#ifdef DEBUG - g_warning( "Insert '%s' (%d) (0x%x:%d)", getURI(), bReplaceExisting, - m_info.valid_fields, m_info.type ); -#endif - - GnomeVFSResult result = getInfo( xEnv ); - // a racy design indeed. - if( !bReplaceExisting && !m_bTransient && - result != GNOME_VFS_ERROR_NOT_FOUND) { -#ifdef DEBUG - g_warning ("Nasty error inserting to '%s' ('%s')", - getURI(), gnome_vfs_result_to_string( result )); -#endif - cancelCommandExecution( GNOME_VFS_ERROR_FILE_EXISTS, xEnv, sal_True ); - } - - if ( m_info.valid_fields & GNOME_VFS_FILE_INFO_FIELDS_TYPE && - m_info.type == GNOME_VFS_FILE_TYPE_DIRECTORY ) { - ::rtl::OString aURI = getOURI(); - int perm; - - perm = ( GNOME_VFS_PERM_USER_ALL | - GNOME_VFS_PERM_GROUP_READ | - GNOME_VFS_PERM_OTHER_READ ); - -#ifdef DEBUG - g_warning ("Make directory"); -#endif - result = gnome_vfs_make_directory( (const sal_Char *) aURI, perm ); - - if( result != GNOME_VFS_OK ) - cancelCommandExecution( result, xEnv, sal_True ); - - return; - } - - if ( !xInputStream.is() ) { - // FIXME: slightly unclear whether to accept this and create an empty file - ucbhelper::cancelCommandExecution - ( uno::makeAny - ( ucb::MissingInputStreamException - ( rtl::OUString(), - static_cast< cppu::OWeakObject * >( this ) ) ), - xEnv ); - } - - GnomeVFSHandle *handle = NULL; - ::rtl::OString aURI = getOURI(); - - result = GNOME_VFS_OK; - if ( bReplaceExisting ) { - Authentication aAuth( xEnv ); - result = gnome_vfs_open( &handle, (const sal_Char *)aURI, - GNOME_VFS_OPEN_WRITE ); - } - - if ( result != GNOME_VFS_OK ) { - int perm; - Authentication aAuth( xEnv ); - - perm = ( ( GNOME_VFS_PERM_USER_WRITE | GNOME_VFS_PERM_USER_READ ) | - ( GNOME_VFS_PERM_GROUP_WRITE | GNOME_VFS_PERM_GROUP_READ ) ); - - result = gnome_vfs_create - ( &handle, (const sal_Char *)aURI, GNOME_VFS_OPEN_WRITE, TRUE, perm ); - } - - if( result != GNOME_VFS_OK ) - cancelCommandExecution( result, xEnv, sal_True ); - - if ( !xInputStream.is() ) { - result = gnome_vfs_close( handle ); - if (result != GNOME_VFS_OK) - cancelCommandExecution( result, xEnv, sal_True ); - - } else { // copy it over - uno::Reference < io::XOutputStream > xOutput = - new gvfs::Stream( handle, &m_info ); - - copyData( xInputStream, xOutput ); - } - - if (m_bTransient) { - m_bTransient = sal_False; - aGuard.clear(); - inserted(); - } -} - -void Content::transfer(const ucb::TransferInfo & /*rArgs*/, - const uno::Reference< ucb::XCommandEnvironment >& xEnv ) - throw( uno::Exception ) -{ - // FIXME: see gnome-vfs-xfer.h - but we need to be able to easily - // detect which are gnome-vfs owned URI types ... - ucbhelper::cancelCommandExecution - ( uno::makeAny - ( ucb::InteractiveBadTransferURLException - ( rtl::OUString::createFromAscii( "Unsupported URL scheme!" ), - static_cast< cppu::OWeakObject * >( this ) ) ), - xEnv ); -} - -void Content::destroy( sal_Bool bDeletePhysical ) - throw( uno::Exception ) -{ - // @@@ take care about bDeletePhysical -> trashcan support - rtl::OUString aURL = getOUURI(); - - uno::Reference< ucb::XContent > xThis = this; - - deleted(); - - osl::Guard< osl::Mutex > aGuard( m_aMutex ); - - // Process instanciated children... - ::gvfs::Content::ContentRefList aChildren; - queryChildren( aChildren ); - - ContentRefList::const_iterator it = aChildren.begin(); - ContentRefList::const_iterator end = aChildren.end(); - - while ( it != end ) { - (*it)->destroy( bDeletePhysical ); - ++it; - } -} - -// Used by the 'setPropertyValues' method for -// propagating the renaming of a Content. -sal_Bool Content::exchangeIdentity( - const uno::Reference< ucb::XContentIdentifier >& xNewId ) -{ - if ( !xNewId.is() ) - return sal_False; - - uno::Reference< ucb::XContent > xThis = this; - -#ifdef DEBUG - g_warning( "exchangeIdentity from '%s' to '%s'", - getURI(), OUStringToGnome( xNewId->getContentIdentifier() ) ); -#endif - - if ( m_bTransient ) { - osl::Guard< osl::Mutex > aGuard( m_aMutex ); - /* FIXME: can we not screw up an identically named - * Content pointing to ourself here ? */ - m_xIdentifier = xNewId; - return sal_False; - } - - rtl::OUString aOldURL = getOUURI(); - - // Exchange own identitity. - if ( exchange( xNewId ) ) { - - // Process instanciated children... - ContentRefList aChildren; - queryChildren( aChildren ); - - ContentRefList::const_iterator it = aChildren.begin(); - ContentRefList::const_iterator end = aChildren.end(); - - while ( it != end ) { - ContentRef xChild = (*it); - - // Create new content identifier for the child... - uno::Reference< ucb::XContentIdentifier > - xOldChildId = xChild->getIdentifier(); - rtl::OUString aOldChildURL - = xOldChildId->getContentIdentifier(); - rtl::OUString aNewChildURL - = aOldChildURL.replaceAt( - 0, - aOldURL.getLength(), - xNewId->getContentIdentifier() ); - uno::Reference< ucb::XContentIdentifier > - xNewChildId - = new ::ucbhelper::ContentIdentifier( m_xSMgr, aNewChildURL ); - - if ( !xChild->exchangeIdentity( xNewChildId ) ) - return sal_False; - - ++it; - } - return sal_True; - } - - return sal_False; -} - -GnomeVFSResult -Content::getInfo( const uno::Reference< ucb::XCommandEnvironment >& xEnv ) -{ - GnomeVFSResult result; - osl::Guard< osl::Mutex > aGuard( m_aMutex ); - - if (m_bTransient) - result = GNOME_VFS_OK; - - else if ( !m_info.valid_fields ) { - ::rtl::OString aURI = getOURI(); - Authentication aAuth( xEnv ); - result = gnome_vfs_get_file_info - ( (const sal_Char *)aURI, &m_info, GNOME_VFS_FILE_INFO_DEFAULT ); - if (result != GNOME_VFS_OK) - gnome_vfs_file_info_clear( &m_info ); - } else - result = GNOME_VFS_OK; -#ifdef DEBUG - g_warning( "getInfo on '%s' returns '%s' (%d) (0x%x)", - getURI(), gnome_vfs_result_to_string( result ), - result, m_info.valid_fields ); -#endif - return result; -} - -sal_Bool -Content::isFolder(const uno::Reference< ucb::XCommandEnvironment >& xEnv ) -{ - osl::Guard< osl::Mutex > aGuard( m_aMutex ); - getInfo( xEnv ); - return (m_info.valid_fields & GNOME_VFS_FILE_INFO_FIELDS_TYPE && - m_info.type == GNOME_VFS_FILE_TYPE_DIRECTORY); -} - -uno::Any Content::mapVFSException( const GnomeVFSResult result, sal_Bool bWrite ) -{ - uno::Any aException; - const char *gvfs_message; - rtl::OUString message; - uno::Sequence< uno::Any > aArgs( 1 ); - -#ifdef DEBUG - g_warning ("Map VFS exception '%s' (%d)", - gnome_vfs_result_to_string( result ), result ); -#endif - - if ((gvfs_message = gnome_vfs_result_to_string (result))) - message = GnomeToOUString( gvfs_message ); - - switch (result) { - case GNOME_VFS_OK: - g_error ("VFS_OK mapped to exception."); - break; - case GNOME_VFS_ERROR_EOF: - g_warning ("VFS_EOF not handled somewhere."); - break; - case GNOME_VFS_ERROR_NOT_FOUND: - aArgs[ 0 ] <<= m_xIdentifier->getContentIdentifier(); - aException <<= - ucb::InteractiveAugmentedIOException - ( rtl::OUString::createFromAscii( "Not found!" ), - static_cast< cppu::OWeakObject * >( this ), - task::InteractionClassification_ERROR, - ucb::IOErrorCode_NOT_EXISTING, - aArgs ); - break; - case GNOME_VFS_ERROR_BAD_PARAMETERS: - aException <<= - lang::IllegalArgumentException - ( rtl::OUString(), - static_cast< cppu::OWeakObject * >( this ), - -1 ); - break; - case GNOME_VFS_ERROR_GENERIC: - case GNOME_VFS_ERROR_INTERNAL: - case GNOME_VFS_ERROR_NOT_SUPPORTED: -#ifdef DEBUG - g_warning ("Internal - un-mapped error"); -#endif - aException <<= io::IOException(); - break; - case GNOME_VFS_ERROR_IO: - if ( bWrite ) - aException <<= - ucb::InteractiveNetworkWriteException - ( rtl::OUString(), - static_cast< cppu::OWeakObject * >( this ), - task::InteractionClassification_ERROR, - message ); - else - aException <<= - ucb::InteractiveNetworkReadException - ( rtl::OUString(), - static_cast< cppu::OWeakObject * >( this ), - task::InteractionClassification_ERROR, - message ); - break; - case GNOME_VFS_ERROR_HOST_NOT_FOUND: - case GNOME_VFS_ERROR_INVALID_HOST_NAME: - aException <<= - ucb::InteractiveNetworkResolveNameException - ( rtl::OUString(), - static_cast< cppu::OWeakObject * >( this ), - task::InteractionClassification_ERROR, - message ); - break; - case GNOME_VFS_ERROR_SERVICE_NOT_AVAILABLE: - case GNOME_VFS_ERROR_SERVICE_OBSOLETE: - case GNOME_VFS_ERROR_PROTOCOL_ERROR: - case GNOME_VFS_ERROR_NO_MASTER_BROWSER: - aException <<= - ucb::InteractiveNetworkConnectException - ( rtl::OUString(), - static_cast< cppu::OWeakObject * >( this ), - task::InteractionClassification_ERROR, - message ); - break; - - case GNOME_VFS_ERROR_FILE_EXISTS: - aException <<= ucb::NameClashException - ( rtl::OUString(), - static_cast< cppu::OWeakObject * >( this ), - task::InteractionClassification_ERROR, - message ); - break; - - case GNOME_VFS_ERROR_INVALID_OPEN_MODE: - aException <<= ucb::UnsupportedOpenModeException(); - break; - - case GNOME_VFS_ERROR_CORRUPTED_DATA: - case GNOME_VFS_ERROR_WRONG_FORMAT: - case GNOME_VFS_ERROR_BAD_FILE: - case GNOME_VFS_ERROR_TOO_BIG: - case GNOME_VFS_ERROR_NO_SPACE: - case GNOME_VFS_ERROR_READ_ONLY: - case GNOME_VFS_ERROR_INVALID_URI: - case GNOME_VFS_ERROR_NOT_OPEN: - case GNOME_VFS_ERROR_ACCESS_DENIED: - case GNOME_VFS_ERROR_TOO_MANY_OPEN_FILES: - case GNOME_VFS_ERROR_NOT_A_DIRECTORY: - case GNOME_VFS_ERROR_IN_PROGRESS: - case GNOME_VFS_ERROR_INTERRUPTED: - case GNOME_VFS_ERROR_LOOP: - case GNOME_VFS_ERROR_NOT_PERMITTED: - case GNOME_VFS_ERROR_IS_DIRECTORY: - case GNOME_VFS_ERROR_NO_MEMORY: - case GNOME_VFS_ERROR_HOST_HAS_NO_ADDRESS: - case GNOME_VFS_ERROR_LOGIN_FAILED: - case GNOME_VFS_ERROR_CANCELLED: - case GNOME_VFS_ERROR_DIRECTORY_BUSY: - case GNOME_VFS_ERROR_DIRECTORY_NOT_EMPTY: - case GNOME_VFS_ERROR_TOO_MANY_LINKS: - case GNOME_VFS_ERROR_READ_ONLY_FILE_SYSTEM: - case GNOME_VFS_ERROR_NOT_SAME_FILE_SYSTEM: - case GNOME_VFS_ERROR_NAME_TOO_LONG: -#ifdef DEBUG - g_warning( "FIXME: Un-mapped VFS exception '%s' (%d)", - gnome_vfs_result_to_string( result ), result ); -#endif - default: - aException <<= ucb::InteractiveNetworkGeneralException - ( rtl::OUString(), - static_cast< cppu::OWeakObject * >( this ), - task::InteractionClassification_ERROR ); - break; - } - - return aException; -} - -void Content::cancelCommandExecution( - GnomeVFSResult result, - const uno::Reference< ucb::XCommandEnvironment > & xEnv, - sal_Bool bWrite /* = sal_False */ ) - throw ( uno::Exception ) -{ - ucbhelper::cancelCommandExecution( mapVFSException( result, bWrite ), xEnv ); - // Unreachable -} - -uno::Sequence< beans::Property > Content::getProperties( - const uno::Reference< ucb::XCommandEnvironment > & /*xEnv*/ ) -{ - static const beans::Property aGenericProperties[] = { - beans::Property( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ContentType" ) ), - -1, getCppuType( static_cast< const rtl::OUString * >( 0 ) ), - beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), - beans::Property( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsDocument" ) ), - -1, getCppuBooleanType(), - beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), - beans::Property( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsFolder" ) ), - -1, getCppuBooleanType(), - beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), - beans::Property( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) ), - -1, getCppuType( static_cast< const rtl::OUString * >( 0 ) ), - beans::PropertyAttribute::BOUND ), - // Optional ... - beans::Property( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DateCreated" ) ), - -1, getCppuType( static_cast< const util::DateTime * >( 0 ) ), - beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), - beans::Property( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DateModified" ) ), - -1, getCppuType( static_cast< const util::DateTime * >( 0 ) ), - beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), -// FIXME: Too expensive for now (?) -// beans::Property( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MediaType" ) ), -// -1, getCppuType( static_cast< const rtl::OUString * >( 0 ) ), -// beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), - beans::Property( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Size" ) ), - -1, getCppuType( static_cast< const sal_Int64 * >( 0 ) ), - beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), - beans::Property( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsReadOnly" ) ), - -1, getCppuBooleanType(), - beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), - beans::Property( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsVolume" ) ), - -1, getCppuBooleanType(), - beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), - beans::Property( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsCompactDisk" ) ), - -1, getCppuBooleanType(), - beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), - beans::Property( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsHidden" ) ), - -1, getCppuBooleanType(), - beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ) - }; - - const int nProps = sizeof (aGenericProperties) / sizeof (aGenericProperties[0]); - - return uno::Sequence< beans::Property > ( aGenericProperties, nProps ); - -} - -uno::Sequence< ucb::CommandInfo > Content::getCommands( - const uno::Reference< ucb::XCommandEnvironment > & xEnv ) -{ - static ucb::CommandInfo aDocumentCommandInfoTable[] = { - // Required commands - ucb::CommandInfo - ( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "getCommandInfo" ) ), - -1, getCppuVoidType() ), - ucb::CommandInfo - ( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "getPropertySetInfo" ) ), - -1, getCppuVoidType() ), - ucb::CommandInfo - ( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "getPropertyValues" ) ), - -1, getCppuType( static_cast * >( 0 ) ) ), - ucb::CommandInfo - ( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "setPropertyValues" ) ), - -1, getCppuType( static_cast * >( 0 ) ) ), - - // Optional standard commands - ucb::CommandInfo - ( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "delete" ) ), - -1, getCppuBooleanType() ), - ucb::CommandInfo - ( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "insert" ) ), - -1, getCppuType( static_cast( 0 ) ) ), - ucb::CommandInfo - ( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "open" ) ), - -1, getCppuType( static_cast( 0 ) ) ), - - // Folder only - ucb::CommandInfo - ( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "transfer" ) ), - -1, getCppuType( static_cast( 0 ) ) ) - }; - int num = 7; - - if ( isFolder( xEnv ) ) - num += 1; - - return uno::Sequence< ucb::CommandInfo >(aDocumentCommandInfoTable, num ); -} - -rtl::OUString -Content::getOUURI () -{ - osl::Guard< osl::Mutex > aGuard( m_aMutex ); - return m_xIdentifier->getContentIdentifier(); -} - -rtl::OString -Content::getOURI () -{ - return rtl::OUStringToOString( getOUURI(), RTL_TEXTENCODING_UTF8 ); -} - -char * -Content::getURI () -{ - return OUStringToGnome( getOUURI() ); -} - -void -Content::copyData( uno::Reference< io::XInputStream > xIn, - uno::Reference< io::XOutputStream > xOut ) -{ - uno::Sequence< sal_Int8 > theData( TRANSFER_BUFFER_SIZE ); - - g_return_if_fail( xIn.is() && xOut.is() ); - - while ( xIn->readBytes( theData, TRANSFER_BUFFER_SIZE ) > 0 ) - xOut->writeBytes( theData ); - - xOut->closeOutput(); -} - -// Inherits an authentication context -uno::Reference< io::XInputStream > -Content::createTempStream( - const uno::Reference< ucb::XCommandEnvironment >& xEnv ) - throw( uno::Exception ) -{ - GnomeVFSResult result; - GnomeVFSHandle *handle = NULL; - ::rtl::OString aURI = getOURI(); - - osl::Guard< osl::Mutex > aGuard( m_aMutex ); - // Something badly wrong happened - can't seek => stream to a temporary file - const rtl::OUString sServiceName ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.io.TempFile" ) ); - uno::Reference < io::XOutputStream > xTempOut = - uno::Reference < io::XOutputStream > - ( m_xSMgr->createInstance( sServiceName ), uno::UNO_QUERY ); - - if ( !xTempOut.is() ) - cancelCommandExecution( GNOME_VFS_ERROR_IO, xEnv ); - - result = gnome_vfs_open - ( &handle, (const sal_Char *)aURI, GNOME_VFS_OPEN_READ ); - if (result != GNOME_VFS_OK) - cancelCommandExecution( result, xEnv ); - - uno::Reference < io::XInputStream > pStream = new ::gvfs::Stream( handle, &m_info ); - copyData( pStream, xTempOut ); - - return uno::Reference < io::XInputStream > ( xTempOut, uno::UNO_QUERY ); -} - -uno::Reference< io::XInputStream > -Content::createInputStream( - const uno::Reference< ucb::XCommandEnvironment >& xEnv ) - throw( uno::Exception ) -{ - GnomeVFSHandle *handle = NULL; - GnomeVFSResult result; - uno::Reference xIn; - - Authentication aAuth( xEnv ); - osl::Guard< osl::Mutex > aGuard( m_aMutex ); - - getInfo( xEnv ); - ::rtl::OString aURI = getOURI(); - - if ( !(m_info.valid_fields & GNOME_VFS_FILE_INFO_FIELDS_SIZE) ) - return createTempStream( xEnv ); - - result = gnome_vfs_open - ( &handle, (const sal_Char *)aURI, - (GnomeVFSOpenMode) (GNOME_VFS_OPEN_READ | GNOME_VFS_OPEN_RANDOM ) ); - - if (result == GNOME_VFS_ERROR_INVALID_OPEN_MODE || - result == GNOME_VFS_ERROR_NOT_SUPPORTED) - return createTempStream( xEnv ); - - if (result != GNOME_VFS_OK) - cancelCommandExecution( result, xEnv ); - - // Try a seek just to make sure it's Random access: some lie. - result = gnome_vfs_seek( handle, GNOME_VFS_SEEK_START, 0); - if (result == GNOME_VFS_ERROR_NOT_SUPPORTED) { - gnome_vfs_close( handle ); - return createTempStream( xEnv ); - } - - if (result != GNOME_VFS_OK) - cancelCommandExecution( result, xEnv ); - - if (handle != NULL) - xIn = new ::gvfs::Stream( handle, &m_info ); - - return xIn; -} - -sal_Bool -Content::feedSink( uno::Reference< uno::XInterface > aSink, - const uno::Reference< ucb::XCommandEnvironment >& xEnv ) -{ - if ( !aSink.is() ) - return sal_False; - - uno::Reference< io::XOutputStream > xOut - = uno::Reference< io::XOutputStream >(aSink, uno::UNO_QUERY ); - uno::Reference< io::XActiveDataSink > xDataSink - = uno::Reference< io::XActiveDataSink >(aSink, uno::UNO_QUERY ); - - if ( !xOut.is() && !xDataSink.is() ) - return sal_False; - - uno::Reference< io::XInputStream > xIn = createInputStream( xEnv ); - if ( !xIn.is() ) - return sal_False; - - if ( xOut.is() ) - copyData( xIn, xOut ); - - if ( xDataSink.is() ) - xDataSink->setInputStream( xIn ); - - return sal_True; -} - -extern "C" { - -#ifndef GNOME_VFS_MODULE_CALLBACK_FULL_AUTHENTICATION -# error "We require Gnome VFS 2.6.x to compile (will run fine with < 2.6)" -#endif - - static void - vfs_authentication_callback (gconstpointer in_void, - gsize in_size, - gpointer out_void, - gsize out_size, - gpointer callback_data) - { - task::XInteractionHandler *xIH; - -#ifdef DEBUG - g_warning ("Full authentication callback (%p) ...", callback_data); -#endif - - if( !( xIH = (task::XInteractionHandler *) callback_data ) ) - return; - - const GnomeVFSModuleCallbackFullAuthenticationIn *in = - (const GnomeVFSModuleCallbackFullAuthenticationIn *) in_void; - GnomeVFSModuleCallbackFullAuthenticationOut *out = - (GnomeVFSModuleCallbackFullAuthenticationOut *) out_void; - - g_return_if_fail (in != NULL && out != NULL); - g_return_if_fail (sizeof (GnomeVFSModuleCallbackFullAuthenticationIn) == in_size && - sizeof (GnomeVFSModuleCallbackFullAuthenticationOut) == out_size); - -#ifdef DEBUG -# define NNIL(x) (x?x:"") - g_warning (" InComing data 0x%x uri '%s' prot '%s' server '%s' object '%s' " - "port %d auth_t '%s' user '%s' domain '%s' " - "def user '%s', def domain '%s'", - (int) in->flags, NNIL(in->uri), NNIL(in->protocol), - NNIL(in->server), NNIL(in->object), - (int) in->port, NNIL(in->authtype), NNIL(in->username), NNIL(in->domain), - NNIL(in->default_user), NNIL(in->default_domain)); -# undef NNIL -#endif - - ucbhelper::SimpleAuthenticationRequest::EntityType - eDomain, eUserName, ePassword; - ::rtl::OUString aHostName, aDomain, aUserName, aPassword; - - aHostName = GnomeToOUString( in->server ); - - if (in->flags & GNOME_VFS_MODULE_CALLBACK_FULL_AUTHENTICATION_NEED_DOMAIN) - { - aDomain = GnomeToOUString( in->domain ); - eDomain = ucbhelper::SimpleAuthenticationRequest::ENTITY_MODIFY; - if (!aDomain.getLength()) - aDomain = GnomeToOUString( in->default_domain ); - } - else // no underlying capability to display realm otherwise - eDomain = ucbhelper::SimpleAuthenticationRequest::ENTITY_NA; - - aUserName = GnomeToOUString( in->username ); - if (!aUserName.getLength()) - aUserName = GnomeToOUString( in->default_user ); - eUserName = (in->flags & GNOME_VFS_MODULE_CALLBACK_FULL_AUTHENTICATION_NEED_USERNAME) ? - ucbhelper::SimpleAuthenticationRequest::ENTITY_MODIFY : - (aUserName.getLength() ? - ucbhelper::SimpleAuthenticationRequest::ENTITY_FIXED : - ucbhelper::SimpleAuthenticationRequest::ENTITY_NA); - - // No suggested password. - ePassword = (in->flags & GNOME_VFS_MODULE_CALLBACK_FULL_AUTHENTICATION_NEED_PASSWORD) ? - ucbhelper::SimpleAuthenticationRequest::ENTITY_MODIFY : - ucbhelper::SimpleAuthenticationRequest::ENTITY_FIXED; - - // Really, really bad things happen if we don't provide - // the same user/password as was entered last time if - // we failed to authenticate - infinite looping / flickering - // madness etc. [ nice infrastructure ! ] - static rtl::OUString aLastUserName, aLastPassword; - if (in->flags & GNOME_VFS_MODULE_CALLBACK_FULL_AUTHENTICATION_PREVIOUS_ATTEMPT_FAILED) - { - osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); - aUserName = aLastUserName; - aPassword = aLastPassword; - } - - rtl::Reference< ucbhelper::SimpleAuthenticationRequest > xRequest - = new ucbhelper::SimpleAuthenticationRequest (GnomeToOUString(in->uri), - aHostName, eDomain, aDomain, - eUserName, aUserName, - ePassword, aPassword); - - xIH->handle( xRequest.get() ); - - rtl::Reference< ucbhelper::InteractionContinuation > xSelection - = xRequest->getSelection(); - - if ( xSelection.is() ) { - // Handler handled the request. - uno::Reference< task::XInteractionAbort > xAbort(xSelection.get(), uno::UNO_QUERY ); - if ( !xAbort.is() ) { - const rtl::Reference< - ucbhelper::InteractionSupplyAuthentication > & xSupp - = xRequest->getAuthenticationSupplier(); - - aUserName = xSupp->getUserName(); - aDomain = xSupp->getRealm(); - aPassword = xSupp->getPassword(); - - { - osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); - aLastUserName = aUserName; - aLastPassword = aPassword; - } - - out->username = OUStringToGnome( aUserName ); - out->domain = OUStringToGnome( aDomain ); - out->password = OUStringToGnome( aPassword ); - out->save_password = xSupp->getRememberPasswordMode(); - -#ifdef DEBUG - g_warning ("Got valid user/domain/password '%s' '%s' '%s', %s password", - out->username, out->domain, out->password, - out->save_password ? "save" : "don't save"); -#endif - } - else - out->abort_auth = TRUE; - } - else - out->abort_auth = TRUE; - } - - static void - vfs_authentication_old_callback (gconstpointer in_void, - gsize in_size, - gpointer out_void, - gsize out_size, - gpointer callback_data) - { -#ifdef DEBUG - g_warning ("Old authentication callback (%p) [ UNTESTED ] ...", callback_data); -#endif - const GnomeVFSModuleCallbackAuthenticationIn *in = - (const GnomeVFSModuleCallbackAuthenticationIn *) in_void; - GnomeVFSModuleCallbackAuthenticationOut *out = - (GnomeVFSModuleCallbackAuthenticationOut *) out_void; - - g_return_if_fail (in != NULL && out != NULL); - g_return_if_fail (sizeof (GnomeVFSModuleCallbackAuthenticationIn) == in_size && - sizeof (GnomeVFSModuleCallbackAuthenticationOut) == out_size); - - GnomeVFSModuleCallbackFullAuthenticationIn mapped_in = { - (GnomeVFSModuleCallbackFullAuthenticationFlags) - (GNOME_VFS_MODULE_CALLBACK_FULL_AUTHENTICATION_NEED_PASSWORD | - GNOME_VFS_MODULE_CALLBACK_FULL_AUTHENTICATION_NEED_USERNAME | - GNOME_VFS_MODULE_CALLBACK_FULL_AUTHENTICATION_NEED_DOMAIN), - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - GnomeVFSModuleCallbackFullAuthenticationOut mapped_out = { 0, 0, 0, 0, 0, 0, 0, 0 }; - - // Map the old style input auth. data to the new style structure. - if (in->previous_attempt_failed) - mapped_in.flags = (GnomeVFSModuleCallbackFullAuthenticationFlags) - (mapped_in.flags | - GNOME_VFS_MODULE_CALLBACK_FULL_AUTHENTICATION_PREVIOUS_ATTEMPT_FAILED); - - GnomeVFSURI *pURI = NULL; - // Urk - parse all this from the URL ... - mapped_in.uri = in->uri; - if (in->uri) - { - pURI = gnome_vfs_uri_new( in->uri ); - mapped_in.protocol = (char *) gnome_vfs_uri_get_scheme (pURI); - mapped_in.server = (char *) gnome_vfs_uri_get_host_name (pURI); - mapped_in.port = gnome_vfs_uri_get_host_port (pURI); - mapped_in.username = (char *) gnome_vfs_uri_get_user_name (pURI); - } - mapped_in.domain = in->realm; - mapped_in.default_user = mapped_in.username; - mapped_in.default_domain = mapped_in.domain; - - vfs_authentication_callback ((gconstpointer) &mapped_in, - sizeof (mapped_in), - (gpointer) &mapped_out, - sizeof (mapped_out), - callback_data); - - if (pURI) - gnome_vfs_uri_unref (pURI); - - // Map the new style auth. out data to the old style out structure. - out->username = mapped_out.username; - out->password = mapped_out.password; - g_free (mapped_out.domain); - g_free (mapped_out.keyring); - } - - - static void - auth_destroy (gpointer data) - { - task::XInteractionHandler *xIH; - if( ( xIH = ( task::XInteractionHandler * )data ) ) - xIH->release(); - } - - // This sucks, but gnome-vfs doesn't much like - // repeated set / unsets - so we have to compensate. - GPrivate *auth_queue = NULL; - - void auth_queue_destroy( gpointer data ) - { - GList *l; - GQueue *vq = (GQueue *) data; - - for (l = vq->head; l; l = l->next) - auth_destroy (l->data); - g_queue_free (vq); - } -} - -static void -refresh_auth( GQueue *vq ) -{ - GList *l; - - gnome_vfs_module_callback_pop( GNOME_VFS_MODULE_CALLBACK_AUTHENTICATION ); - gnome_vfs_module_callback_pop( GNOME_VFS_MODULE_CALLBACK_FULL_AUTHENTICATION ); - - for (l = vq->head; l; l = l->next) { - if (l->data) { - gnome_vfs_module_callback_push - ( GNOME_VFS_MODULE_CALLBACK_AUTHENTICATION, - vfs_authentication_old_callback, l->data, NULL ); - gnome_vfs_module_callback_push - ( GNOME_VFS_MODULE_CALLBACK_FULL_AUTHENTICATION, - vfs_authentication_callback, l->data, NULL ); - break; - } - } -} - -gvfs::Authentication::Authentication( - const uno::Reference< ucb::XCommandEnvironment > & xEnv ) -{ - GQueue *vq; - uno::Reference< task::XInteractionHandler > xIH; - - if ( xEnv.is() ) - xIH = xEnv->getInteractionHandler(); - - if ( xIH.is() ) - xIH->acquire(); - - if( !(vq = (GQueue *)g_private_get( auth_queue ) ) ) { - vq = g_queue_new(); - g_private_set( auth_queue, vq ); - } - - g_queue_push_head( vq, (gpointer) xIH.get() ); - refresh_auth( vq ); -} - -gvfs::Authentication::~Authentication() -{ - GQueue *vq; - gpointer data; - - vq = (GQueue *)g_private_get( auth_queue ); - - data = g_queue_pop_head( vq ); - auth_destroy (data); - - refresh_auth( vq ); -} diff --git a/ucb/source/ucp/gvfs/content.hxx b/ucb/source/ucp/gvfs/content.hxx deleted file mode 100644 index cd6701b8c742..000000000000 --- a/ucb/source/ucp/gvfs/content.hxx +++ /dev/null @@ -1,267 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: content.hxx,v $ - * $Revision: 1.6 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _GVFS_UCP_CONTENT_HXX -#define _GVFS_UCP_CONTENT_HXX - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -namespace com { namespace sun { namespace star { namespace beans { - struct Property; - struct PropertyValue; -} } } } - -namespace com { namespace sun { namespace star { namespace io { - class XInputStream; - class XOutputStream; -} } } } - -namespace com { namespace sun { namespace star { namespace sdbc { - class XRow; -} } } } - -namespace com { namespace sun { namespace star { namespace ucb { - struct TransferInfo; -} } } } - -namespace gvfs -{ - -class ContentProvider; -class ContentProperties; - -// Random made up names - AFAICS -#define GVFS_FILE_TYPE "application/vnd.sun.staroffice.gvfs-file" -#define GVFS_FOLDER_TYPE "application/vnd.sun.staroffice.gvfs-folder" - -class Authentication -{ -public: - // Helper class to make exceptions pleasant - Authentication( const com::sun::star::uno::Reference< - com::sun::star::ucb::XCommandEnvironment > & xEnv ); - ~Authentication(); -}; - -class Content : public ::ucbhelper::ContentImplHelper, - public com::sun::star::ucb::XContentCreator -{ -//========================================================================= -// Internals -//========================================================================= -private: - typedef rtl::Reference< Content > ContentRef; - typedef std::list< ContentRef > ContentRefList; - - // Instance data - ContentProvider *m_pProvider; // No need for a ref, base class holds object - sal_Bool m_bTransient; // A non-existant (as yet) item - GnomeVFSFileInfo m_info; // cached status information - - // Internal helpers - void queryChildren ( ContentRefList& rChildren ); - ::com::sun::star::uno::Any getBadArgExcept (); - GnomeVFSResult getInfo ( const ::com::sun::star::uno::Reference< - ::com::sun::star::ucb::XCommandEnvironment >& xEnv ); - sal_Bool isFolder ( const ::com::sun::star::uno::Reference< - ::com::sun::star::ucb::XCommandEnvironment >& xEnv ); - sal_Bool exchangeIdentity( const ::com::sun::star::uno::Reference< - ::com::sun::star::ucb::XContentIdentifier >& xNewId); - GnomeVFSResult doSetFileInfo ( const GnomeVFSFileInfo *newInfo, - GnomeVFSSetFileInfoMask setMask, - const ::com::sun::star::uno::Reference< - ::com::sun::star::ucb::XCommandEnvironment >& xEnv ); - ::rtl::OUString makeNewURL ( const char *newName ); - // End Internal helpers - - // For ucbhelper - virtual ::rtl::OUString getParentURL(); - // For ucbhelper - virtual com::sun::star::uno::Sequence< com::sun::star::beans::Property > - getProperties( const com::sun::star::uno::Reference< - com::sun::star::ucb::XCommandEnvironment > & xEnv ); - // For ucbhelper - virtual com::sun::star::uno::Sequence< com::sun::star::ucb::CommandInfo > - getCommands( const com::sun::star::uno::Reference< - com::sun::star::ucb::XCommandEnvironment > & xEnv ); - -public: - // Command "getPropertyValues" - ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow > - getPropertyValues( const ::com::sun::star::uno::Sequence< - ::com::sun::star::beans::Property >& rProperties, - const ::com::sun::star::uno::Reference< - ::com::sun::star::ucb::XCommandEnvironment >& xEnv ); - -private: - // Command "setPropertyValues" - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > - setPropertyValues( const ::com::sun::star::uno::Sequence< - ::com::sun::star::beans::PropertyValue >& rValues, - const ::com::sun::star::uno::Reference< - ::com::sun::star::ucb::XCommandEnvironment >& xEnv ); - - // Command "insert" - void insert( const ::com::sun::star::uno::Reference< - ::com::sun::star::io::XInputStream > & xInputStream, - sal_Bool bReplaceExisting, - const com::sun::star::uno::Reference< - com::sun::star::ucb::XCommandEnvironment >& xEnv ) - throw( ::com::sun::star::uno::Exception ); - - // Command "transfer" - void transfer( const ::com::sun::star::ucb::TransferInfo & rArgs, - const com::sun::star::uno::Reference< - com::sun::star::ucb::XCommandEnvironment >& xEnv ) - throw( ::com::sun::star::uno::Exception ); - - // Command "delete" - void destroy( sal_Bool bDeletePhysical ) - throw( ::com::sun::star::uno::Exception ); - - // "open" helpers - void copyData( ::com::sun::star::uno::Reference< - ::com::sun::star::io::XInputStream > xIn, - ::com::sun::star::uno::Reference< - ::com::sun::star::io::XOutputStream > xOut ); - - ::com::sun::star::uno::Reference< - ::com::sun::star::io::XInputStream > - createTempStream( const ::com::sun::star::uno::Reference< - com::sun::star::ucb::XCommandEnvironment >& xEnv ) - throw( ::com::sun::star::uno::Exception ); - ::com::sun::star::uno::Reference< - ::com::sun::star::io::XInputStream > - createInputStream( const ::com::sun::star::uno::Reference< - com::sun::star::ucb::XCommandEnvironment >& xEnv ) - throw( ::com::sun::star::uno::Exception ); - sal_Bool feedSink( ::com::sun::star::uno::Reference< - ::com::sun::star::uno::XInterface> aSink, - const ::com::sun::star::uno::Reference< - com::sun::star::ucb::XCommandEnvironment >& xEnv ); - - ::com::sun::star::uno::Any mapVFSException( const GnomeVFSResult result, - sal_Bool bWrite ); - - void cancelCommandExecution(const GnomeVFSResult result, - const ::com::sun::star::uno::Reference< - com::sun::star::ucb::XCommandEnvironment > & xEnv, - sal_Bool bWrite = sal_False ) - throw( ::com::sun::star::uno::Exception ); - - -public: - // Non-interface bits - char *getURI (); - rtl::OString getOURI (); - rtl::OUString getOUURI (); - -//========================================================================= -// Externals -//========================================================================= -public: - - Content( const ::com::sun::star::uno::Reference< - ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr, - ContentProvider *pProvider, - const ::com::sun::star::uno::Reference< - ::com::sun::star::ucb::XContentIdentifier >& Identifier) - throw ( ::com::sun::star::ucb::ContentCreationException ); - Content( const ::com::sun::star::uno::Reference< - ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr, - ContentProvider *pProvider, - const ::com::sun::star::uno::Reference< - ::com::sun::star::ucb::XContentIdentifier >& Identifier, - sal_Bool isFolder) - throw ( ::com::sun::star::ucb::ContentCreationException ); - virtual ~Content(); - - // XInterface - XINTERFACE_DECL() - - // XTypeProvider - XTYPEPROVIDER_DECL() - - // XServiceInfo - virtual ::rtl::OUString SAL_CALL getImplementationName() - throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL - getSupportedServiceNames() - throw( ::com::sun::star::uno::RuntimeException ); - - // XContent - virtual rtl::OUString SAL_CALL - getContentType() - throw( com::sun::star::uno::RuntimeException ); - - // XCommandProcessor - virtual com::sun::star::uno::Any SAL_CALL - execute( const com::sun::star::ucb::Command& aCommand, - sal_Int32 CommandId, - const com::sun::star::uno::Reference< - com::sun::star::ucb::XCommandEnvironment >& xEnv ) - throw( com::sun::star::uno::Exception, - com::sun::star::ucb::CommandAbortedException, - com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL - abort( sal_Int32 CommandId ) - throw( com::sun::star::uno::RuntimeException ); - - ////////////////////////////////////////////////////////////////////// - // Additional interfaces - ////////////////////////////////////////////////////////////////////// - - // XContentCreator - virtual com::sun::star::uno::Sequence< - com::sun::star::ucb::ContentInfo > SAL_CALL - queryCreatableContentsInfo() - throw( com::sun::star::uno::RuntimeException ); - virtual com::sun::star::uno::Reference< - com::sun::star::ucb::XContent > SAL_CALL - createNewContent( const com::sun::star::ucb::ContentInfo& Info ) - throw( com::sun::star::uno::RuntimeException ); -}; - -} - -extern "C" { - extern GPrivate *auth_queue; - extern void auth_queue_destroy( gpointer data ); -} - -#endif diff --git a/ucb/source/ucp/gvfs/directory.cxx b/ucb/source/ucp/gvfs/directory.cxx deleted file mode 100644 index 19ace5ebf162..000000000000 --- a/ucb/source/ucp/gvfs/directory.cxx +++ /dev/null @@ -1,424 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: directory.cxx,v $ - * $Revision: 1.7 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_ucb.hxx" -/* - * This file pinched from webdavdatasupplier (etc.) - * cut & paste + new getData impl. & collate ResultSet code. - */ -#include -#include -#include -#include -#include - -#include "directory.hxx" - -#include -#include - -using namespace com::sun::star; -using namespace gvfs; - -// DynamicResultSet Implementation. - -DynamicResultSet::DynamicResultSet( - const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, - const rtl::Reference< Content >& rxContent, - const ucb::OpenCommandArgument2& rCommand, - const uno::Reference< ucb::XCommandEnvironment >& rxEnv ) - : ResultSetImplHelper( rxSMgr, rCommand ), - m_xContent( rxContent ), - m_xEnv( rxEnv ) -{ -} -void DynamicResultSet::initStatic() -{ - m_xResultSet1 - = new ::ucbhelper::ResultSet( m_xSMgr, - m_aCommand.Properties, - new DataSupplier( m_xSMgr, - m_xContent, - m_aCommand.Mode ), - m_xEnv ); -} -void DynamicResultSet::initDynamic() -{ - initStatic(); - m_xResultSet2 = m_xResultSet1; -} - -//========================================================================= - - -// DataSupplier Implementation. - - - -struct ResultListEntry -{ - rtl::OUString aId; - uno::Reference< ucb::XContentIdentifier > xId; - uno::Reference< ucb::XContent > xContent; - uno::Reference< sdbc::XRow > xRow; - GnomeVFSFileInfo aInfo; - - ResultListEntry( const GnomeVFSFileInfo *fileInfo) - { - gnome_vfs_file_info_copy (&aInfo, fileInfo); - } - - ~ResultListEntry() - { - gnome_vfs_file_info_clear (&aInfo); - } -}; - -//========================================================================= -// -// ResultList. -// -//========================================================================= - -typedef std::vector< ResultListEntry* > ResultList; - -//========================================================================= -// -// struct DataSupplier_Impl. -// -//========================================================================= - -struct gvfs::DataSupplier_Impl -{ - osl::Mutex m_aMutex; - ResultList m_aResults; - rtl::Reference< Content > m_xContent; - uno::Reference< lang::XMultiServiceFactory > m_xSMgr; - sal_Int32 m_nOpenMode; - sal_Bool m_bCountFinal; - - DataSupplier_Impl( - const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, - const rtl::Reference< Content >& rContent, - sal_Int32 nOpenMode ) - : m_xContent( rContent ), m_xSMgr( rxSMgr ), - m_nOpenMode( nOpenMode ), m_bCountFinal( sal_False ) {} - ~DataSupplier_Impl() - { - ResultList::const_iterator it = m_aResults.begin(); - ResultList::const_iterator end = m_aResults.end(); - - while ( it != end ) - { - delete (*it); - it++; - } - } -}; - -DataSupplier::DataSupplier( - const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, - const rtl::Reference< Content >& rContent, - sal_Int32 nOpenMode ) -: m_pImpl( new DataSupplier_Impl( rxSMgr, rContent, nOpenMode ) ) -{ -} - -//========================================================================= -// virtual -DataSupplier::~DataSupplier() -{ - delete m_pImpl; -} - -// virtual -rtl::OUString DataSupplier::queryContentIdentifierString( sal_uInt32 nIndex ) -{ - osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex ); - - if ( nIndex < m_pImpl->m_aResults.size() ) { - rtl::OUString aId = m_pImpl->m_aResults[ nIndex ]->aId; - if ( aId.getLength() ) // cached - return aId; - } - - if ( getResult( nIndex ) ) { - rtl::OUString aId = m_pImpl->m_xContent->getOUURI(); - - char *escaped_name; - escaped_name = gnome_vfs_escape_string( m_pImpl->m_aResults[ nIndex ]->aInfo.name ); - - if ( ( aId.lastIndexOf( '/' ) + 1 ) != aId.getLength() ) - aId += rtl::OUString::createFromAscii( "/" ); - - aId += rtl::OUString::createFromAscii( escaped_name ); - - g_free( escaped_name ); - - m_pImpl->m_aResults[ nIndex ]->aId = aId; - return aId; - } - - return rtl::OUString(); -} - -// virtual -uno::Reference< ucb::XContentIdentifier > -DataSupplier::queryContentIdentifier( sal_uInt32 nIndex ) -{ - osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex ); - - if ( nIndex < m_pImpl->m_aResults.size() ) { - uno::Reference< ucb::XContentIdentifier > xId - = m_pImpl->m_aResults[ nIndex ]->xId; - if ( xId.is() ) // Already cached. - return xId; - } - - rtl::OUString aId = queryContentIdentifierString( nIndex ); - if ( aId.getLength() ) { - uno::Reference< ucb::XContentIdentifier > xId - = new ::ucbhelper::ContentIdentifier( aId ); - m_pImpl->m_aResults[ nIndex ]->xId = xId; - return xId; - } - - return uno::Reference< ucb::XContentIdentifier >(); -} - -// virtual -uno::Reference< ucb::XContent > -DataSupplier::queryContent( sal_uInt32 nIndex ) -{ - osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex ); - - if ( nIndex < m_pImpl->m_aResults.size() ) { - uno::Reference< ucb::XContent > xContent - = m_pImpl->m_aResults[ nIndex ]->xContent; - if ( xContent.is() ) // Already cached. - return xContent; - } - - uno::Reference< ucb::XContentIdentifier > xId - = queryContentIdentifier( nIndex ); - if ( xId.is() ) { - try - { - // FIXME: - // It would be really nice to propagate this information - // to the Content, but we can't then register it with the - // ContentProvider, and the ucbhelper hinders here. - uno::Reference< ucb::XContent > xContent - = m_pImpl->m_xContent->getProvider()->queryContent( xId ); - m_pImpl->m_aResults[ nIndex ]->xContent = xContent; - return xContent; - - } - catch ( ucb::IllegalIdentifierException& ) { - } - } - return uno::Reference< ucb::XContent >(); -} - -// virtual -sal_Bool DataSupplier::getResult( sal_uInt32 nIndex ) -{ - osl::ClearableGuard< osl::Mutex > aGuard( m_pImpl->m_aMutex ); - - if ( m_pImpl->m_aResults.size() > nIndex ) // Result already present. - return sal_True; - - if ( getData() && m_pImpl->m_aResults.size() > nIndex ) - return sal_True; - - return sal_False; -} - -// virtual -sal_uInt32 DataSupplier::totalCount() -{ - getData(); - - osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex ); - - return m_pImpl->m_aResults.size(); -} - -// virtual -sal_uInt32 DataSupplier::currentCount() -{ - osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex ); - return m_pImpl->m_aResults.size(); -} - -// virtual -sal_Bool DataSupplier::isCountFinal() -{ - osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex ); - return m_pImpl->m_bCountFinal; -} - -// virtual -uno::Reference< sdbc::XRow > DataSupplier::queryPropertyValues( sal_uInt32 nIndex ) -{ - osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex ); - - if ( nIndex < m_pImpl->m_aResults.size() ) { - uno::Reference< sdbc::XRow > xRow = m_pImpl->m_aResults[ nIndex ]->xRow; - if ( xRow.is() ) // Already cached. - return xRow; - } - - if ( getResult( nIndex ) ) { - // Inefficient - but we can't create xContent's sensibly - // nor can we do the property code sensibly cleanly staticaly. - Content *pContent = static_cast< ::gvfs::Content * >(queryContent( nIndex ).get()); - - uno::Reference< sdbc::XRow > xRow = - pContent->getPropertyValues( getResultSet()->getProperties(), - getResultSet()->getEnvironment() ); - - m_pImpl->m_aResults[ nIndex ]->xRow = xRow; - - return xRow; - } - - return uno::Reference< sdbc::XRow >(); -} - -// virtual -void DataSupplier::releasePropertyValues( sal_uInt32 nIndex ) -{ - osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex ); - - if ( nIndex < m_pImpl->m_aResults.size() ) - m_pImpl->m_aResults[ nIndex ]->xRow = uno::Reference< sdbc::XRow >(); -} - -// virtual -void DataSupplier::close() -{ -} - -// virtual -void DataSupplier::validate() - throw( ucb::ResultSetException ) -{ -} - -sal_Bool DataSupplier::getData() -{ - osl::ClearableGuard< osl::Mutex > aGuard( m_pImpl->m_aMutex ); - - if ( !m_pImpl->m_bCountFinal ) { - GnomeVFSResult result; - GnomeVFSDirectoryHandle *dirHandle = NULL; - - { - Authentication aAuth( getResultSet()->getEnvironment() ); - char *uri = m_pImpl->m_xContent->getURI(); - result = gnome_vfs_directory_open - ( &dirHandle, uri, GNOME_VFS_FILE_INFO_DEFAULT ); - - if (result != GNOME_VFS_OK) { -#ifdef DEBUG - g_warning ("Failed open of '%s' with '%s'", - uri, gnome_vfs_result_to_string( result )); -#endif - g_free( uri ); - return sal_False; - } - - g_free( uri ); - } - - - GnomeVFSFileInfo fileInfo; - fileInfo.name = 0; - while ((result = gnome_vfs_directory_read_next (dirHandle, &fileInfo)) == GNOME_VFS_OK) { - if( fileInfo.name && fileInfo.name[0] == '.' && - ( fileInfo.name[1] == '\0' || - ( fileInfo.name[1] == '.' && fileInfo.name[2] == '\0' ) ) ) - continue; - - switch ( m_pImpl->m_nOpenMode ) { - case ucb::OpenMode::FOLDERS: - if ( !(fileInfo.valid_fields & GNOME_VFS_FILE_INFO_FIELDS_TYPE) || - fileInfo.type != GNOME_VFS_FILE_TYPE_DIRECTORY ) - continue; - break; - - case ucb::OpenMode::DOCUMENTS: - if ( !(fileInfo.valid_fields & GNOME_VFS_FILE_INFO_FIELDS_TYPE) || - fileInfo.type != GNOME_VFS_FILE_TYPE_REGULAR ) - continue; - break; - - case ucb::OpenMode::ALL: - default: - break; - } - - m_pImpl->m_aResults.push_back( new ResultListEntry( &fileInfo ) ); - } -#ifdef DEBUG - g_warning ("Got %d directory entries", result); -#endif - - m_pImpl->m_bCountFinal = sal_True; - - // Callback possible, because listeners may be informed! - aGuard.clear(); - getResultSet()->rowCountFinal(); - - if (result != GNOME_VFS_ERROR_EOF) { -#ifdef DEBUG - g_warning( "Failed read_next '%s'", - gnome_vfs_result_to_string( result ) ); -#endif - return sal_False; - } - - result = gnome_vfs_directory_close (dirHandle); - if (result != GNOME_VFS_OK) { -#ifdef DEBUG - g_warning( "Failed close '%s'", - gnome_vfs_result_to_string( result ) ); -#endif - return sal_False; - } - } - - return sal_True; -} - - - diff --git a/ucb/source/ucp/gvfs/directory.hxx b/ucb/source/ucp/gvfs/directory.hxx deleted file mode 100644 index b3513c2d6048..000000000000 --- a/ucb/source/ucp/gvfs/directory.hxx +++ /dev/null @@ -1,98 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: directory.hxx,v $ - * $Revision: 1.7 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _GVFS_UCP_RESULTSET_HXX -#define _GVFS_UCP_RESULTSET_HXX - -#include -#include -#include -#include "content.hxx" - -namespace gvfs { - -class DynamicResultSet : public ::ucbhelper::ResultSetImplHelper -{ - rtl::Reference< Content > m_xContent; - com::sun::star::uno::Reference< - com::sun::star::ucb::XCommandEnvironment > m_xEnv; - -private: - virtual void initStatic(); - virtual void initDynamic(); - -public: - DynamicResultSet( const com::sun::star::uno::Reference< - com::sun::star::lang::XMultiServiceFactory >& rxSMgr, - const rtl::Reference< Content >& rxContent, - const com::sun::star::ucb::OpenCommandArgument2& rCommand, - const com::sun::star::uno::Reference< - com::sun::star::ucb::XCommandEnvironment >& rxEnv ); -}; - - -struct DataSupplier_Impl; -class DataSupplier : public ucbhelper::ResultSetDataSupplier -{ -private: - gvfs::DataSupplier_Impl *m_pImpl; - sal_Bool getData(); - -public: - DataSupplier( const com::sun::star::uno::Reference< - com::sun::star::lang::XMultiServiceFactory >& rxSMgr, - const rtl::Reference< Content >& rContent, - sal_Int32 nOpenMode); - - virtual ~DataSupplier(); - - virtual rtl::OUString queryContentIdentifierString( sal_uInt32 nIndex ); - virtual com::sun::star::uno::Reference< - com::sun::star::ucb::XContentIdentifier > - queryContentIdentifier( sal_uInt32 nIndex ); - virtual com::sun::star::uno::Reference< com::sun::star::ucb::XContent > - queryContent( sal_uInt32 nIndex ); - - virtual sal_Bool getResult( sal_uInt32 nIndex ); - - virtual sal_uInt32 totalCount(); - virtual sal_uInt32 currentCount(); - virtual sal_Bool isCountFinal(); - - virtual com::sun::star::uno::Reference< com::sun::star::sdbc::XRow > - queryPropertyValues( sal_uInt32 nIndex ); - virtual void releasePropertyValues( sal_uInt32 nIndex ); - virtual void close(); - virtual void validate() - throw( com::sun::star::ucb::ResultSetException ); -}; - -} - -#endif diff --git a/ucb/source/ucp/gvfs/gvfs_content.cxx b/ucb/source/ucp/gvfs/gvfs_content.cxx new file mode 100644 index 000000000000..743043c09fc7 --- /dev/null +++ b/ucb/source/ucp/gvfs/gvfs_content.cxx @@ -0,0 +1,1799 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: content.cxx,v $ + * $Revision: 1.12 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_ucb.hxx" +#include +#include +#include + +#include "osl/time.h" +#include + +#include "osl/doublecheckedlocking.h" + +#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUES_HPP_ +#include +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#ifndef _COM_SUN_STAR_UCB_INTERACTIVEBADTRANSFRERURLEXCEPTION_HPP_ +#include +#endif +#include +#include +#ifndef _COM_SUN_STAR_UCB_INTERACTIVENETWORKGENBERALEXCEPTION_HPP_ +#include +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifndef _UCBHELPER_INTERACTIONREQUEST_HXX +#include +#endif +#include +#include + +const int TRANSFER_BUFFER_SIZE = 65536; + +/* + * NB. Name escaping is done only for URIs + * the 'Title' property is unescaped on set/get + */ +#include +#include +#include +extern "C" { // missing in the header: doh. +# include +} + +#include "content.hxx" +#include "provider.hxx" +#include "directory.hxx" +#include "stream.hxx" + +using namespace gvfs; +using namespace com::sun::star; + +#define CLEAR_INFO(info) memset((info), 0, sizeof ((info)[0])) + + +static char * +OUStringToGnome( const rtl::OUString &str ) +{ + rtl::OString aTempStr = rtl::OUStringToOString( str, RTL_TEXTENCODING_UTF8 ); + return g_strdup( (const sal_Char *) aTempStr ); +} + +static rtl::OUString +GnomeToOUString( const char *utf8_str) +{ + if (!utf8_str) + return rtl::OUString(); + else + return rtl::OUString( utf8_str, strlen( utf8_str ), RTL_TEXTENCODING_UTF8 ); +} + + +Content::Content( + const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, + ContentProvider* pProvider, + const uno::Reference< ucb::XContentIdentifier >& Identifier) + throw ( ucb::ContentCreationException ) + : ContentImplHelper( rxSMgr, pProvider, Identifier ), + m_pProvider( pProvider ), + m_bTransient( sal_False ) +{ + CLEAR_INFO (&m_info); +#ifdef DEBUG + g_warning ("New Content ('%s')", getURI()); +#endif +} + +Content::Content( + const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, + ContentProvider * pProvider, + const uno::Reference< ucb::XContentIdentifier >& Identifier, + sal_Bool IsFolder) + throw ( ucb::ContentCreationException ) + : ContentImplHelper( rxSMgr, pProvider, Identifier ), + m_pProvider( pProvider ), + m_bTransient( sal_True ) +{ + CLEAR_INFO (&m_info); + +#ifdef DEBUG + g_warning ("New Transient content ('%s') (%d)", getURI(), IsFolder); +#endif +// m_info.name = FIXME: set name ? + m_info.valid_fields = GNOME_VFS_FILE_INFO_FIELDS_TYPE; + m_info.type = IsFolder ? GNOME_VFS_FILE_TYPE_DIRECTORY : + GNOME_VFS_FILE_TYPE_REGULAR; +} + +// virtual +Content::~Content() +{ + gnome_vfs_file_info_clear( &m_info ); +} + +// +// XInterface methods. +// + +void SAL_CALL Content::acquire() + throw( ) +{ + ContentImplHelper::acquire(); +} +void SAL_CALL Content::release() + throw( ) +{ + ContentImplHelper::release(); +} +uno::Any SAL_CALL Content::queryInterface( const uno::Type & rType ) + throw ( uno::RuntimeException ) +{ + // Note: isFolder may require network activities! So call it only + // if it is really necessary!!! + uno::Any aRet = cppu::queryInterface( rType, + static_cast< ucb::XContentCreator * >( this ) ); + if ( aRet.hasValue() ) + return isFolder( uno::Reference< ucb::XCommandEnvironment >() ) + ? aRet : uno::Any(); + else + return aRet.hasValue() ? aRet : ContentImplHelper::queryInterface( rType ); +} + +// +// XTypeProvider methods. +// + +XTYPEPROVIDER_COMMON_IMPL( Content ); + +uno::Sequence< uno::Type > SAL_CALL Content::getTypes() + throw( uno::RuntimeException ) +{ + static cppu::OTypeCollection *pFolderCollection = NULL; + static cppu::OTypeCollection *pFileCollection = NULL; + + if (!pFolderCollection) { + osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); + + if (!pFolderCollection) { + static cppu::OTypeCollection aFolderCollection + (CPPU_TYPE_REF( lang::XTypeProvider ), + CPPU_TYPE_REF( lang::XServiceInfo ), + CPPU_TYPE_REF( lang::XComponent ), + CPPU_TYPE_REF( ucb::XContent ), + CPPU_TYPE_REF( ucb::XCommandProcessor ), + CPPU_TYPE_REF( beans::XPropertiesChangeNotifier ), + CPPU_TYPE_REF( ucb::XCommandInfoChangeNotifier ), + CPPU_TYPE_REF( beans::XPropertyContainer ), + CPPU_TYPE_REF( beans::XPropertySetInfoChangeNotifier ), + CPPU_TYPE_REF( container::XChild ), + CPPU_TYPE_REF( ucb::XContentCreator ) ); // !! + static cppu::OTypeCollection aFileCollection + (CPPU_TYPE_REF( lang::XTypeProvider ), + CPPU_TYPE_REF( lang::XServiceInfo ), + CPPU_TYPE_REF( lang::XComponent ), + CPPU_TYPE_REF( ucb::XContent ), + CPPU_TYPE_REF( ucb::XCommandProcessor ), + CPPU_TYPE_REF( beans::XPropertiesChangeNotifier ), + CPPU_TYPE_REF( ucb::XCommandInfoChangeNotifier ), + CPPU_TYPE_REF( beans::XPropertyContainer ), + CPPU_TYPE_REF( beans::XPropertySetInfoChangeNotifier ), + CPPU_TYPE_REF( container::XChild ) ); + + pFolderCollection = &aFolderCollection; + pFileCollection = &aFileCollection; + OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER(); + } + } + else { + OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER(); + } + + if ( isFolder( uno::Reference< ucb::XCommandEnvironment >() ) ) + return pFolderCollection->getTypes(); + else + return pFileCollection->getTypes(); +} + +// +// XServiceInfo methods. +// + +rtl::OUString SAL_CALL Content::getImplementationName() + throw( uno::RuntimeException ) +{ + return rtl::OUString::createFromAscii("com.sun.star.comp.GnomeVFSContent" ); +} + +uno::Sequence< rtl::OUString > SAL_CALL Content::getSupportedServiceNames() + throw( uno::RuntimeException ) +{ + uno::Sequence< rtl::OUString > aSNS( 1 ); + aSNS.getArray()[ 0 ] = rtl::OUString::createFromAscii( + "com.sun.star.ucb.GnomeVFSContent" ); + return aSNS; +} + +// +// XContent methods. +// + +rtl::OUString SAL_CALL Content::getContentType() + throw( uno::RuntimeException ) +{ + if ( isFolder( uno::Reference< ucb::XCommandEnvironment >() ) ) + return rtl::OUString::createFromAscii( GVFS_FOLDER_TYPE ); + else + return rtl::OUString::createFromAscii( GVFS_FILE_TYPE ); +} + +// +// XCommandProcessor methods. +// + +uno::Any Content::getBadArgExcept() +{ + return uno::makeAny( lang::IllegalArgumentException + ( rtl::OUString::createFromAscii( "Wrong argument type!" ), + static_cast< cppu::OWeakObject * >( this ), + -1 ) ); +} + +#include + +uno::Any SAL_CALL Content::execute( + const ucb::Command& aCommand, + sal_Int32 /*CommandId*/, + const uno::Reference< ucb::XCommandEnvironment >& xEnv ) + throw( uno::Exception, + ucb::CommandAbortedException, + uno::RuntimeException ) +{ + uno::Any aRet; + +#ifdef DEBUG + { + uno::Reference< task::XInteractionHandler > xIH; + + if ( xEnv.is() ) + xIH = xEnv->getInteractionHandler(); + g_warning( "Execute command: '%s' with %s interaction env", + OUStringToGnome( aCommand.Name ), + xIH.is() ? "" : "NO" ); + } +#endif + +#define COMMAND_IS(cmd,name) ( (cmd).Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( name ) ) ) + + if ( COMMAND_IS( aCommand, "getPropertyValues" ) ) { + uno::Sequence< beans::Property > Properties; + + if ( !( aCommand.Argument >>= Properties ) ) + ucbhelper::cancelCommandExecution ( getBadArgExcept (), xEnv ); + + aRet <<= getPropertyValues( Properties, xEnv ); + + } else if ( COMMAND_IS( aCommand, "setPropertyValues" ) ) { + uno::Sequence< beans::PropertyValue > aProperties; + + if ( !( aCommand.Argument >>= aProperties ) || + !aProperties.getLength() ) + ucbhelper::cancelCommandExecution ( getBadArgExcept (), xEnv ); + + aRet <<= setPropertyValues( aProperties, xEnv ); + + } else if ( COMMAND_IS( aCommand, "getPropertySetInfo" ) ) { + aRet <<= getPropertySetInfo( xEnv, sal_False ); + + } else if ( COMMAND_IS( aCommand, "getCommandInfo" ) ) { + aRet <<= getCommandInfo( xEnv, sal_False ); + + } else if ( COMMAND_IS( aCommand, "open" ) ) { + rtl::OUString str = m_xIdentifier->getContentIdentifier(); + rtl::OString stra( + str.getStr(), + str.getLength(), + RTL_TEXTENCODING_UTF8); + + ucb::OpenCommandArgument2 aOpenCommand; + if ( !( aCommand.Argument >>= aOpenCommand ) ) + ucbhelper::cancelCommandExecution ( getBadArgExcept (), xEnv ); + + sal_Bool bOpenFolder = + ( ( aOpenCommand.Mode == ucb::OpenMode::ALL ) || + ( aOpenCommand.Mode == ucb::OpenMode::FOLDERS ) || + ( aOpenCommand.Mode == ucb::OpenMode::DOCUMENTS ) ); + + if ( bOpenFolder && isFolder( xEnv ) ) { + uno::Reference< ucb::XDynamicResultSet > xSet + = new DynamicResultSet(m_xSMgr, this, aOpenCommand, xEnv ); + aRet <<= xSet; + + } else if ( aOpenCommand.Sink.is() ) { + + if ( ( aOpenCommand.Mode + == ucb::OpenMode::DOCUMENT_SHARE_DENY_NONE ) || + ( aOpenCommand.Mode + == ucb::OpenMode::DOCUMENT_SHARE_DENY_WRITE ) ) { + ucbhelper::cancelCommandExecution + ( uno::makeAny ( ucb::UnsupportedOpenModeException + ( rtl::OUString(), + static_cast< cppu::OWeakObject * >( this ), + sal_Int16( aOpenCommand.Mode ) ) ), + xEnv ); + } + if ( !feedSink( aOpenCommand.Sink, xEnv ) ) { + // Note: aOpenCommand.Sink may contain an XStream + // implementation. Support for this type of + // sink is optional... +#ifdef DEBUG + g_warning ("Failed to load data from '%s'", getURI()); +#endif + ucbhelper::cancelCommandExecution + ( uno::makeAny (ucb::UnsupportedDataSinkException + ( rtl::OUString(), + static_cast< cppu::OWeakObject * >( this ), + aOpenCommand.Sink ) ), + xEnv ); + } + } +#ifdef DEBUG + else + g_warning ("Open falling through ..."); +#endif + + } else if ( COMMAND_IS( aCommand, "insert" ) ) { + ucb::InsertCommandArgument arg; + if ( !( aCommand.Argument >>= arg ) ) + ucbhelper::cancelCommandExecution ( getBadArgExcept (), xEnv ); + + insert( arg.Data, arg.ReplaceExisting, xEnv ); + + } else if ( COMMAND_IS( aCommand, "delete" ) ) { + + sal_Bool bDeletePhysical = sal_False; + aCommand.Argument >>= bDeletePhysical; + + ::rtl::OString aURI = getOURI(); + GnomeVFSResult result = gnome_vfs_unlink ((const sal_Char *) aURI); + + if (result != GNOME_VFS_OK) + cancelCommandExecution( result, xEnv, sal_True ); + + destroy( bDeletePhysical ); + + } else if ( COMMAND_IS( aCommand, "transfer" ) && isFolder( xEnv ) ) { + ucb::TransferInfo transferArgs; + + if ( !( aCommand.Argument >>= transferArgs ) ) + ucbhelper::cancelCommandExecution( getBadArgExcept(), xEnv ); + + transfer( transferArgs, xEnv ); + + } else { // Unsuported +#ifdef DEBUG + g_warning( "Unsupported command: '%s'", + OUStringToGnome( aCommand.Name ) ); +#endif + ucbhelper::cancelCommandExecution + ( uno::makeAny( ucb::UnsupportedCommandException + ( rtl::OUString(), + static_cast< cppu::OWeakObject * >( this ) ) ), + xEnv ); + } +#undef COMMAND_IS + + return aRet; +} + +void SAL_CALL Content::abort( sal_Int32 /*CommandId*/ ) + throw( uno::RuntimeException ) +{ + // FIXME: we should use the GnomeVFSCancellation APIs here ... +} + +// +// XContentCreator methods. +// + +uno::Sequence< ucb::ContentInfo > SAL_CALL +Content::queryCreatableContentsInfo() + throw( uno::RuntimeException ) +{ + uno::Sequence< ucb::ContentInfo > seq(2); + + // Minimum set of props we really need + uno::Sequence< beans::Property > props( 1 ); + props[0] = beans::Property( + rtl::OUString::createFromAscii( "Title" ), + -1, + getCppuType( static_cast< rtl::OUString* >( 0 ) ), + beans::PropertyAttribute::MAYBEVOID | beans::PropertyAttribute::BOUND ); + + // file + seq[0].Type = rtl::OUString::createFromAscii( GVFS_FILE_TYPE ); + seq[0].Attributes = ( ucb::ContentInfoAttribute::INSERT_WITH_INPUTSTREAM | + ucb::ContentInfoAttribute::KIND_DOCUMENT ); + seq[0].Properties = props; + + // folder + seq[1].Type = rtl::OUString::createFromAscii( GVFS_FOLDER_TYPE ); + seq[1].Attributes = ucb::ContentInfoAttribute::KIND_FOLDER; + seq[1].Properties = props; + + return seq; +} + +uno::Reference< ucb::XContent > SAL_CALL +Content::createNewContent( const ucb::ContentInfo& Info ) + throw( uno::RuntimeException ) +{ + bool create_document; + const char *name; + + if ( Info.Type.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( GVFS_FILE_TYPE ) ) ) + create_document = true; + else if ( Info.Type.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( GVFS_FOLDER_TYPE ) ) ) + create_document = false; + else { +#ifdef DEBUG + g_warning( "Failed to create new content '%s'", + OUStringToGnome( Info.Type ) ); +#endif + return uno::Reference< ucb::XContent >(); + } + +#ifdef DEBUG + g_warning( "createNewContent (%d)", (int) create_document ); +#endif + + rtl::OUString aURL = getOUURI(); + + if ( ( aURL.lastIndexOf( '/' ) + 1 ) != aURL.getLength() ) + aURL += rtl::OUString::createFromAscii( "/" ); + + name = create_document ? "[New_Content]" : "[New_Collection]"; + // This looks problematic to me cf. webdav + aURL += rtl::OUString::createFromAscii( name ); + + uno::Reference< ucb::XContentIdentifier > xId + ( new ::ucbhelper::ContentIdentifier( m_xSMgr, aURL ) ); + + try { + return new ::gvfs::Content( m_xSMgr, m_pProvider, xId, !create_document ); + } catch ( ucb::ContentCreationException & ) { + return uno::Reference< ucb::XContent >(); + } +} + +rtl::OUString Content::getParentURL() +{ + rtl::OUString aParentURL; + // :// -> "" + // ://foo -> "" + // ://foo/ -> "" + // ://foo/bar -> ://foo/ + // ://foo/bar/ -> ://foo/ + // ://foo/bar/abc -> ://foo/bar/ + + rtl::OUString aURL = getOUURI(); + + sal_Int32 nPos = aURL.lastIndexOf( '/' ); + if ( nPos == ( aURL.getLength() - 1 ) ) { + // Trailing slash found. Skip. + nPos = aURL.lastIndexOf( '/', nPos ); + } + + sal_Int32 nPos1 = aURL.lastIndexOf( '/', nPos ); + if ( nPos1 != -1 ) + nPos1 = aURL.lastIndexOf( '/', nPos1 ); + + if ( nPos1 != -1 ) + aParentURL = rtl::OUString( aURL.copy( 0, nPos + 1 ) ); + +#ifdef DEBUG + g_warning ("getParentURL '%s' -> '%s'", + getURI(), (const sal_Char *) rtl::OUStringToOString + ( aParentURL, RTL_TEXTENCODING_UTF8 ) ); +#endif + + return aParentURL; +} + +static util::DateTime +getDateFromUnix (time_t t) +{ + TimeValue tv; + tv.Nanosec = 0; + tv.Seconds = t; + oslDateTime dt; + + if ( osl_getDateTimeFromTimeValue( &tv, &dt ) ) + return util::DateTime( 0, dt.Seconds, dt.Minutes, dt.Hours, + dt.Day, dt.Month, dt.Year); + else + return util::DateTime(); +} + +uno::Reference< sdbc::XRow > Content::getPropertyValues( + const uno::Sequence< beans::Property >& rProperties, + const uno::Reference< ucb::XCommandEnvironment >& xEnv ) +{ + int nProps; + GnomeVFSResult result; + uno::Sequence< beans::Property > allProperties; + + if( ( result = getInfo( xEnv ) ) != GNOME_VFS_OK ) + cancelCommandExecution( result, xEnv, sal_False ); + + const beans::Property* pProps; + + if( rProperties.getLength() ) { + nProps = rProperties.getLength(); + pProps = rProperties.getConstArray(); + } else { + allProperties = getPropertySetInfo( xEnv )->getProperties(); + nProps = allProperties.getLength(); + pProps = allProperties.getConstArray(); + } + + rtl::Reference< ::ucbhelper::PropertyValueSet > xRow + = new ::ucbhelper::PropertyValueSet( m_xSMgr ); + + osl::Guard< osl::Mutex > aGuard( m_aMutex ); + for( sal_Int32 n = 0; n < nProps; ++n ) { + const beans::Property& rProp = pProps[ n ]; + + if (rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Title" ) ) ) { + if (m_info.name && m_info.name[0] == '/') + g_warning ("Odd NFS title on item '%s' == '%s'", + getURI(), m_info.name); + xRow->appendString( rProp, GnomeToOUString( m_info.name ) ); + } + + else if (rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ContentType" ) ) ) + xRow->appendString( rProp, getContentType () ); + + else if (rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsDocument" ) ) ) { + if (m_info.valid_fields & GNOME_VFS_FILE_INFO_FIELDS_TYPE) + xRow->appendBoolean( rProp, ( m_info.type == GNOME_VFS_FILE_TYPE_REGULAR || + m_info.type == GNOME_VFS_FILE_TYPE_UNKNOWN ) ); + else + xRow->appendVoid( rProp ); + } + + else if (rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsFolder" ) ) ) { + if (m_info.valid_fields & GNOME_VFS_FILE_INFO_FIELDS_TYPE) + xRow->appendBoolean( rProp, ( m_info.type == GNOME_VFS_FILE_TYPE_DIRECTORY ) ); + else + xRow->appendVoid( rProp ); + } + + else if (rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Size" ) ) ) { + if (m_info.valid_fields & GNOME_VFS_FILE_INFO_FIELDS_SIZE) + xRow->appendLong( rProp, m_info.size ); + else + xRow->appendVoid( rProp ); + } + + else if (rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsReadOnly" ) ) ) { + if (m_info.valid_fields & GNOME_VFS_FILE_INFO_FIELDS_PERMISSIONS) { + bool read_only = true; + + if (m_info.uid == getuid () && + m_info.permissions & GNOME_VFS_PERM_USER_WRITE) + read_only = false; + else if (m_info.gid == getgid () && + m_info.permissions & GNOME_VFS_PERM_GROUP_WRITE) + read_only = false; + else if (m_info.permissions & GNOME_VFS_PERM_OTHER_WRITE) + read_only = false; + xRow->appendBoolean( rProp, read_only ); + } else + xRow->appendVoid( rProp ); + } + + else if (rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsHidden" ) ) ) + xRow->appendBoolean( rProp, ( m_info.name && m_info.name[0] == '.' ) ); + + else if (rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsVolume" ) ) || + rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsCompactDisk" ) ) ) + xRow->appendBoolean( rProp, sal_False ); + + else if (rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "DateCreated" ) ) ) { + if (m_info.valid_fields & GNOME_VFS_FILE_INFO_FIELDS_CTIME) + xRow->appendTimestamp( rProp, getDateFromUnix( m_info.ctime ) ); + else + xRow->appendVoid( rProp ); + } + + else if (rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "DateModified" ) ) ) { + if (m_info.valid_fields & GNOME_VFS_FILE_INFO_FIELDS_MTIME) + xRow->appendTimestamp( rProp, getDateFromUnix( m_info.mtime ) ); + else + xRow->appendVoid( rProp ); + } + + else if (rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "MediaType" ) ) ) { + // We do this by sniffing in gnome-vfs; rather expensively. +#ifdef DEBUG + g_warning ("FIXME: Requested mime-type - an expensive op. indeed!"); +#endif + xRow->appendVoid( rProp ); + } else { + xRow->appendVoid( rProp ); + } + } +#ifdef DEBUG + g_warning ("getPropertyValues on '%s' %d properties returned (of %d)", + getURI(), (int)xRow->getLength(), (int)nProps); +#endif + + return uno::Reference< sdbc::XRow >( xRow.get() ); +} + +static lang::IllegalAccessException +getReadOnlyException( Content *ctnt ) +{ + return lang::IllegalAccessException + ( rtl::OUString::createFromAscii( "Property is read-only!" ), + static_cast< cppu::OWeakObject * >( ctnt ) ); +} + +rtl::OUString +Content::makeNewURL( const char */*newName*/ ) +{ + rtl::OUString aNewURL = getParentURL(); + if ( aNewURL.lastIndexOf( '/' ) != ( aNewURL.getLength() - 1 ) ) + aNewURL += rtl::OUString::createFromAscii( "/" ); + + char *name = gnome_vfs_escape_string( m_info.name ); + aNewURL += GnomeToOUString( name ); + g_free( name ); + + return aNewURL; +} + +// This is slightly complicated by needing to support either 'move' or 'setname' +GnomeVFSResult +Content::doSetFileInfo( const GnomeVFSFileInfo *newInfo, + GnomeVFSSetFileInfoMask setMask, + const uno::Reference< ucb::XCommandEnvironment >& /*xEnv*/ ) +{ + GnomeVFSResult result = GNOME_VFS_OK; + + g_assert (!m_bTransient); + + ::rtl::OString aURI = getOURI(); + + osl::Guard< osl::Mutex > aGuard( m_aMutex ); + + // The simple approach: + if( setMask != GNOME_VFS_SET_FILE_INFO_NONE ) + result = gnome_vfs_set_file_info // missed a const in the API there + ( (const sal_Char *) aURI, (GnomeVFSFileInfo *)newInfo, setMask ); + + if ( result == GNOME_VFS_ERROR_NOT_SUPPORTED && + ( setMask & GNOME_VFS_SET_FILE_INFO_NAME ) ) { + // Try a move instead +#ifdef DEBUG + g_warning( "SetFileInfo not supported on '%s'", getURI() ); +#endif + + char *newURI = OUStringToGnome( makeNewURL( newInfo->name ) ); + + result = gnome_vfs_move ((const sal_Char *)aURI, newURI, FALSE); + + g_free (newURI); + } + + return result; +} + + +uno::Sequence< uno::Any > Content::setPropertyValues( + const uno::Sequence< beans::PropertyValue >& rValues, + const uno::Reference< ucb::XCommandEnvironment >& xEnv ) +{ + rtl::OUString aNewTitle; + GnomeVFSFileInfo newInfo; + int setMask = GNOME_VFS_SET_FILE_INFO_NONE; + + getInfo( xEnv ); + + osl::ClearableGuard< osl::Mutex > aGuard( m_aMutex ); + + gnome_vfs_file_info_copy( &newInfo, &m_info ); + + Authentication aAuth( xEnv ); + + int nChanged = 0, nTitlePos = 0; + uno::Sequence< uno::Any > aRet( rValues.getLength() ); + uno::Sequence< beans::PropertyChangeEvent > aChanges( rValues.getLength() ); + + beans::PropertyChangeEvent aEvent; + aEvent.Source = static_cast< cppu::OWeakObject * >( this ); + aEvent.Further = sal_False; + aEvent.PropertyHandle = -1; + // aEvent.PropertyName = fill in later ... + // aEvent.OldValue = + // aEvent.NewValue = + + int nCount = rValues.getLength(); + const beans::PropertyValue* pValues = rValues.getConstArray(); + + for ( sal_Int32 n = 0; n < nCount; ++n ) { + const beans::PropertyValue& rValue = pValues[ n ]; + +#ifdef DEBUG + g_warning( "Set prop '%s'", OUStringToGnome( rValue.Name ) ); +#endif + if ( rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ContentType" ) ) || + rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "MediaType" ) ) || + rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsDocument" ) ) || + rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsFolder" ) ) || + rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Size" ) ) ) + aRet[ n ] <<= getReadOnlyException( this ); + + else if ( rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Title" ) ) ) { + if ( rValue.Value >>= aNewTitle ) { + if ( aNewTitle.getLength() <= 0 ) + aRet[ n ] <<= lang::IllegalArgumentException + ( rtl::OUString::createFromAscii( "Empty title not allowed!" ), + static_cast< cppu::OWeakObject * >( this ), -1 ); + else { + char *newName = OUStringToGnome( aNewTitle ); + + if( !newName || !m_info.name || strcmp( newName, m_info.name ) ) { +#ifdef DEBUG + g_warning ("Set new name to '%s'", newName); +#endif + + aEvent.PropertyName = rtl::OUString::createFromAscii( "Title" ); + aEvent.OldValue = uno::makeAny( GnomeToOUString( newInfo.name ) ); + aEvent.NewValue = uno::makeAny( aNewTitle ); + aChanges.getArray()[ nChanged ] = aEvent; + nTitlePos = nChanged++; + + newInfo.name = newName; + setMask |= GNOME_VFS_SET_FILE_INFO_NAME; + } else // same name + g_free (newName); + } + } else + aRet[ n ] <<= beans::IllegalTypeException + ( rtl::OUString::createFromAscii( "Property value has wrong type!" ), + static_cast< cppu::OWeakObject * >( this ) ); + + } else if ( rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "DateCreated" ) ) || + rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "DateModified" ) ) ) { + // FIXME: should be able to set the timestamps + aRet[ n ] <<= getReadOnlyException( this ); + } else { +#ifdef DEBUG + g_warning( "Unhandled property '%s'", OUStringToGnome( rValue.Name ) ); +#endif + aRet[ n ] <<= getReadOnlyException( this ); + } + } + + GnomeVFSResult result = GNOME_VFS_OK; + + if ( !m_bTransient && + ( result = doSetFileInfo( &newInfo, + (GnomeVFSSetFileInfoMask) setMask, + xEnv ) ) != GNOME_VFS_OK ) { + for (int i = 0; i < nChanged; i++) + aRet[ i ] <<= mapVFSException( result, sal_True ); + + } + + if ( result == GNOME_VFS_OK) { + gnome_vfs_file_info_copy( &m_info, &newInfo ); + + if ( setMask & GNOME_VFS_SET_FILE_INFO_NAME ) { + uno::Reference< ucb::XContentIdentifier > xNewId + = new ::ucbhelper::ContentIdentifier( + m_xSMgr, makeNewURL( newInfo.name ) ); + + aGuard.clear(); + if (!exchangeIdentity( xNewId ) ) + aRet[ nTitlePos ] <<= uno::Exception + ( rtl::OUString::createFromAscii( "Exchange failed!" ), + static_cast< cppu::OWeakObject * >( this ) ); + } + } + + gnome_vfs_file_info_clear( &newInfo ); + + if ( nChanged > 0 ) { + aGuard.clear(); + aChanges.realloc( nChanged ); + notifyPropertiesChange( aChanges ); + } + + return aRet; +} + +void Content::queryChildren( ContentRefList& rChildren ) +{ + // Obtain a list with a snapshot of all currently instanciated contents + // from provider and extract the contents which are direct children + // of this content. + + ::ucbhelper::ContentRefList aAllContents; + m_xProvider->queryExistingContents( aAllContents ); + + rtl::OUString aURL = getOUURI(); + sal_Int32 nURLPos = aURL.lastIndexOf( '/' ); + + if ( nURLPos != ( aURL.getLength() - 1 ) ) + aURL += rtl::OUString::createFromAscii( "/" ); + + sal_Int32 nLen = aURL.getLength(); + + ::ucbhelper::ContentRefList::const_iterator it = aAllContents.begin(); + ::ucbhelper::ContentRefList::const_iterator end = aAllContents.end(); + + while ( it != end ) { + ::ucbhelper::ContentImplHelperRef xChild = (*it); + rtl::OUString aChildURL + = xChild->getIdentifier()->getContentIdentifier(); + + // Is aURL a prefix of aChildURL? + if ( ( aChildURL.getLength() > nLen ) && + ( aChildURL.compareTo( aURL, nLen ) == 0 ) ) { + sal_Int32 nPos = nLen; + nPos = aChildURL.indexOf( '/', nPos ); + + if ( ( nPos == -1 ) || + ( nPos == ( aChildURL.getLength() - 1 ) ) ) { + // No further slashes / only a final slash. It's a child! + rChildren.push_back( ::gvfs::Content::ContentRef + (static_cast< ::gvfs::Content * >(xChild.get() ) ) ); + } + } + ++it; + } +} + +void Content::insert( + const uno::Reference< io::XInputStream > &xInputStream, + sal_Bool bReplaceExisting, + const uno::Reference< ucb::XCommandEnvironment > &xEnv ) + throw( uno::Exception ) +{ + osl::ClearableGuard< osl::Mutex > aGuard( m_aMutex ); + +#ifdef DEBUG + g_warning( "Insert '%s' (%d) (0x%x:%d)", getURI(), bReplaceExisting, + m_info.valid_fields, m_info.type ); +#endif + + GnomeVFSResult result = getInfo( xEnv ); + // a racy design indeed. + if( !bReplaceExisting && !m_bTransient && + result != GNOME_VFS_ERROR_NOT_FOUND) { +#ifdef DEBUG + g_warning ("Nasty error inserting to '%s' ('%s')", + getURI(), gnome_vfs_result_to_string( result )); +#endif + cancelCommandExecution( GNOME_VFS_ERROR_FILE_EXISTS, xEnv, sal_True ); + } + + if ( m_info.valid_fields & GNOME_VFS_FILE_INFO_FIELDS_TYPE && + m_info.type == GNOME_VFS_FILE_TYPE_DIRECTORY ) { + ::rtl::OString aURI = getOURI(); + int perm; + + perm = ( GNOME_VFS_PERM_USER_ALL | + GNOME_VFS_PERM_GROUP_READ | + GNOME_VFS_PERM_OTHER_READ ); + +#ifdef DEBUG + g_warning ("Make directory"); +#endif + result = gnome_vfs_make_directory( (const sal_Char *) aURI, perm ); + + if( result != GNOME_VFS_OK ) + cancelCommandExecution( result, xEnv, sal_True ); + + return; + } + + if ( !xInputStream.is() ) { + // FIXME: slightly unclear whether to accept this and create an empty file + ucbhelper::cancelCommandExecution + ( uno::makeAny + ( ucb::MissingInputStreamException + ( rtl::OUString(), + static_cast< cppu::OWeakObject * >( this ) ) ), + xEnv ); + } + + GnomeVFSHandle *handle = NULL; + ::rtl::OString aURI = getOURI(); + + result = GNOME_VFS_OK; + if ( bReplaceExisting ) { + Authentication aAuth( xEnv ); + result = gnome_vfs_open( &handle, (const sal_Char *)aURI, + GNOME_VFS_OPEN_WRITE ); + } + + if ( result != GNOME_VFS_OK ) { + int perm; + Authentication aAuth( xEnv ); + + perm = ( ( GNOME_VFS_PERM_USER_WRITE | GNOME_VFS_PERM_USER_READ ) | + ( GNOME_VFS_PERM_GROUP_WRITE | GNOME_VFS_PERM_GROUP_READ ) ); + + result = gnome_vfs_create + ( &handle, (const sal_Char *)aURI, GNOME_VFS_OPEN_WRITE, TRUE, perm ); + } + + if( result != GNOME_VFS_OK ) + cancelCommandExecution( result, xEnv, sal_True ); + + if ( !xInputStream.is() ) { + result = gnome_vfs_close( handle ); + if (result != GNOME_VFS_OK) + cancelCommandExecution( result, xEnv, sal_True ); + + } else { // copy it over + uno::Reference < io::XOutputStream > xOutput = + new gvfs::Stream( handle, &m_info ); + + copyData( xInputStream, xOutput ); + } + + if (m_bTransient) { + m_bTransient = sal_False; + aGuard.clear(); + inserted(); + } +} + +void Content::transfer(const ucb::TransferInfo & /*rArgs*/, + const uno::Reference< ucb::XCommandEnvironment >& xEnv ) + throw( uno::Exception ) +{ + // FIXME: see gnome-vfs-xfer.h - but we need to be able to easily + // detect which are gnome-vfs owned URI types ... + ucbhelper::cancelCommandExecution + ( uno::makeAny + ( ucb::InteractiveBadTransferURLException + ( rtl::OUString::createFromAscii( "Unsupported URL scheme!" ), + static_cast< cppu::OWeakObject * >( this ) ) ), + xEnv ); +} + +void Content::destroy( sal_Bool bDeletePhysical ) + throw( uno::Exception ) +{ + // @@@ take care about bDeletePhysical -> trashcan support + rtl::OUString aURL = getOUURI(); + + uno::Reference< ucb::XContent > xThis = this; + + deleted(); + + osl::Guard< osl::Mutex > aGuard( m_aMutex ); + + // Process instanciated children... + ::gvfs::Content::ContentRefList aChildren; + queryChildren( aChildren ); + + ContentRefList::const_iterator it = aChildren.begin(); + ContentRefList::const_iterator end = aChildren.end(); + + while ( it != end ) { + (*it)->destroy( bDeletePhysical ); + ++it; + } +} + +// Used by the 'setPropertyValues' method for +// propagating the renaming of a Content. +sal_Bool Content::exchangeIdentity( + const uno::Reference< ucb::XContentIdentifier >& xNewId ) +{ + if ( !xNewId.is() ) + return sal_False; + + uno::Reference< ucb::XContent > xThis = this; + +#ifdef DEBUG + g_warning( "exchangeIdentity from '%s' to '%s'", + getURI(), OUStringToGnome( xNewId->getContentIdentifier() ) ); +#endif + + if ( m_bTransient ) { + osl::Guard< osl::Mutex > aGuard( m_aMutex ); + /* FIXME: can we not screw up an identically named + * Content pointing to ourself here ? */ + m_xIdentifier = xNewId; + return sal_False; + } + + rtl::OUString aOldURL = getOUURI(); + + // Exchange own identitity. + if ( exchange( xNewId ) ) { + + // Process instanciated children... + ContentRefList aChildren; + queryChildren( aChildren ); + + ContentRefList::const_iterator it = aChildren.begin(); + ContentRefList::const_iterator end = aChildren.end(); + + while ( it != end ) { + ContentRef xChild = (*it); + + // Create new content identifier for the child... + uno::Reference< ucb::XContentIdentifier > + xOldChildId = xChild->getIdentifier(); + rtl::OUString aOldChildURL + = xOldChildId->getContentIdentifier(); + rtl::OUString aNewChildURL + = aOldChildURL.replaceAt( + 0, + aOldURL.getLength(), + xNewId->getContentIdentifier() ); + uno::Reference< ucb::XContentIdentifier > + xNewChildId + = new ::ucbhelper::ContentIdentifier( m_xSMgr, aNewChildURL ); + + if ( !xChild->exchangeIdentity( xNewChildId ) ) + return sal_False; + + ++it; + } + return sal_True; + } + + return sal_False; +} + +GnomeVFSResult +Content::getInfo( const uno::Reference< ucb::XCommandEnvironment >& xEnv ) +{ + GnomeVFSResult result; + osl::Guard< osl::Mutex > aGuard( m_aMutex ); + + if (m_bTransient) + result = GNOME_VFS_OK; + + else if ( !m_info.valid_fields ) { + ::rtl::OString aURI = getOURI(); + Authentication aAuth( xEnv ); + result = gnome_vfs_get_file_info + ( (const sal_Char *)aURI, &m_info, GNOME_VFS_FILE_INFO_DEFAULT ); + if (result != GNOME_VFS_OK) + gnome_vfs_file_info_clear( &m_info ); + } else + result = GNOME_VFS_OK; +#ifdef DEBUG + g_warning( "getInfo on '%s' returns '%s' (%d) (0x%x)", + getURI(), gnome_vfs_result_to_string( result ), + result, m_info.valid_fields ); +#endif + return result; +} + +sal_Bool +Content::isFolder(const uno::Reference< ucb::XCommandEnvironment >& xEnv ) +{ + osl::Guard< osl::Mutex > aGuard( m_aMutex ); + getInfo( xEnv ); + return (m_info.valid_fields & GNOME_VFS_FILE_INFO_FIELDS_TYPE && + m_info.type == GNOME_VFS_FILE_TYPE_DIRECTORY); +} + +uno::Any Content::mapVFSException( const GnomeVFSResult result, sal_Bool bWrite ) +{ + uno::Any aException; + const char *gvfs_message; + rtl::OUString message; + uno::Sequence< uno::Any > aArgs( 1 ); + +#ifdef DEBUG + g_warning ("Map VFS exception '%s' (%d)", + gnome_vfs_result_to_string( result ), result ); +#endif + + if ((gvfs_message = gnome_vfs_result_to_string (result))) + message = GnomeToOUString( gvfs_message ); + + switch (result) { + case GNOME_VFS_OK: + g_error ("VFS_OK mapped to exception."); + break; + case GNOME_VFS_ERROR_EOF: + g_warning ("VFS_EOF not handled somewhere."); + break; + case GNOME_VFS_ERROR_NOT_FOUND: + aArgs[ 0 ] <<= m_xIdentifier->getContentIdentifier(); + aException <<= + ucb::InteractiveAugmentedIOException + ( rtl::OUString::createFromAscii( "Not found!" ), + static_cast< cppu::OWeakObject * >( this ), + task::InteractionClassification_ERROR, + ucb::IOErrorCode_NOT_EXISTING, + aArgs ); + break; + case GNOME_VFS_ERROR_BAD_PARAMETERS: + aException <<= + lang::IllegalArgumentException + ( rtl::OUString(), + static_cast< cppu::OWeakObject * >( this ), + -1 ); + break; + case GNOME_VFS_ERROR_GENERIC: + case GNOME_VFS_ERROR_INTERNAL: + case GNOME_VFS_ERROR_NOT_SUPPORTED: +#ifdef DEBUG + g_warning ("Internal - un-mapped error"); +#endif + aException <<= io::IOException(); + break; + case GNOME_VFS_ERROR_IO: + if ( bWrite ) + aException <<= + ucb::InteractiveNetworkWriteException + ( rtl::OUString(), + static_cast< cppu::OWeakObject * >( this ), + task::InteractionClassification_ERROR, + message ); + else + aException <<= + ucb::InteractiveNetworkReadException + ( rtl::OUString(), + static_cast< cppu::OWeakObject * >( this ), + task::InteractionClassification_ERROR, + message ); + break; + case GNOME_VFS_ERROR_HOST_NOT_FOUND: + case GNOME_VFS_ERROR_INVALID_HOST_NAME: + aException <<= + ucb::InteractiveNetworkResolveNameException + ( rtl::OUString(), + static_cast< cppu::OWeakObject * >( this ), + task::InteractionClassification_ERROR, + message ); + break; + case GNOME_VFS_ERROR_SERVICE_NOT_AVAILABLE: + case GNOME_VFS_ERROR_SERVICE_OBSOLETE: + case GNOME_VFS_ERROR_PROTOCOL_ERROR: + case GNOME_VFS_ERROR_NO_MASTER_BROWSER: + aException <<= + ucb::InteractiveNetworkConnectException + ( rtl::OUString(), + static_cast< cppu::OWeakObject * >( this ), + task::InteractionClassification_ERROR, + message ); + break; + + case GNOME_VFS_ERROR_FILE_EXISTS: + aException <<= ucb::NameClashException + ( rtl::OUString(), + static_cast< cppu::OWeakObject * >( this ), + task::InteractionClassification_ERROR, + message ); + break; + + case GNOME_VFS_ERROR_INVALID_OPEN_MODE: + aException <<= ucb::UnsupportedOpenModeException(); + break; + + case GNOME_VFS_ERROR_CORRUPTED_DATA: + case GNOME_VFS_ERROR_WRONG_FORMAT: + case GNOME_VFS_ERROR_BAD_FILE: + case GNOME_VFS_ERROR_TOO_BIG: + case GNOME_VFS_ERROR_NO_SPACE: + case GNOME_VFS_ERROR_READ_ONLY: + case GNOME_VFS_ERROR_INVALID_URI: + case GNOME_VFS_ERROR_NOT_OPEN: + case GNOME_VFS_ERROR_ACCESS_DENIED: + case GNOME_VFS_ERROR_TOO_MANY_OPEN_FILES: + case GNOME_VFS_ERROR_NOT_A_DIRECTORY: + case GNOME_VFS_ERROR_IN_PROGRESS: + case GNOME_VFS_ERROR_INTERRUPTED: + case GNOME_VFS_ERROR_LOOP: + case GNOME_VFS_ERROR_NOT_PERMITTED: + case GNOME_VFS_ERROR_IS_DIRECTORY: + case GNOME_VFS_ERROR_NO_MEMORY: + case GNOME_VFS_ERROR_HOST_HAS_NO_ADDRESS: + case GNOME_VFS_ERROR_LOGIN_FAILED: + case GNOME_VFS_ERROR_CANCELLED: + case GNOME_VFS_ERROR_DIRECTORY_BUSY: + case GNOME_VFS_ERROR_DIRECTORY_NOT_EMPTY: + case GNOME_VFS_ERROR_TOO_MANY_LINKS: + case GNOME_VFS_ERROR_READ_ONLY_FILE_SYSTEM: + case GNOME_VFS_ERROR_NOT_SAME_FILE_SYSTEM: + case GNOME_VFS_ERROR_NAME_TOO_LONG: +#ifdef DEBUG + g_warning( "FIXME: Un-mapped VFS exception '%s' (%d)", + gnome_vfs_result_to_string( result ), result ); +#endif + default: + aException <<= ucb::InteractiveNetworkGeneralException + ( rtl::OUString(), + static_cast< cppu::OWeakObject * >( this ), + task::InteractionClassification_ERROR ); + break; + } + + return aException; +} + +void Content::cancelCommandExecution( + GnomeVFSResult result, + const uno::Reference< ucb::XCommandEnvironment > & xEnv, + sal_Bool bWrite /* = sal_False */ ) + throw ( uno::Exception ) +{ + ucbhelper::cancelCommandExecution( mapVFSException( result, bWrite ), xEnv ); + // Unreachable +} + +uno::Sequence< beans::Property > Content::getProperties( + const uno::Reference< ucb::XCommandEnvironment > & /*xEnv*/ ) +{ + static const beans::Property aGenericProperties[] = { + beans::Property( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ContentType" ) ), + -1, getCppuType( static_cast< const rtl::OUString * >( 0 ) ), + beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), + beans::Property( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsDocument" ) ), + -1, getCppuBooleanType(), + beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), + beans::Property( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsFolder" ) ), + -1, getCppuBooleanType(), + beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), + beans::Property( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Title" ) ), + -1, getCppuType( static_cast< const rtl::OUString * >( 0 ) ), + beans::PropertyAttribute::BOUND ), + // Optional ... + beans::Property( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DateCreated" ) ), + -1, getCppuType( static_cast< const util::DateTime * >( 0 ) ), + beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), + beans::Property( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DateModified" ) ), + -1, getCppuType( static_cast< const util::DateTime * >( 0 ) ), + beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), +// FIXME: Too expensive for now (?) +// beans::Property( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MediaType" ) ), +// -1, getCppuType( static_cast< const rtl::OUString * >( 0 ) ), +// beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), + beans::Property( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Size" ) ), + -1, getCppuType( static_cast< const sal_Int64 * >( 0 ) ), + beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), + beans::Property( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsReadOnly" ) ), + -1, getCppuBooleanType(), + beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), + beans::Property( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsVolume" ) ), + -1, getCppuBooleanType(), + beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), + beans::Property( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsCompactDisk" ) ), + -1, getCppuBooleanType(), + beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), + beans::Property( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsHidden" ) ), + -1, getCppuBooleanType(), + beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ) + }; + + const int nProps = sizeof (aGenericProperties) / sizeof (aGenericProperties[0]); + + return uno::Sequence< beans::Property > ( aGenericProperties, nProps ); + +} + +uno::Sequence< ucb::CommandInfo > Content::getCommands( + const uno::Reference< ucb::XCommandEnvironment > & xEnv ) +{ + static ucb::CommandInfo aDocumentCommandInfoTable[] = { + // Required commands + ucb::CommandInfo + ( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "getCommandInfo" ) ), + -1, getCppuVoidType() ), + ucb::CommandInfo + ( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "getPropertySetInfo" ) ), + -1, getCppuVoidType() ), + ucb::CommandInfo + ( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "getPropertyValues" ) ), + -1, getCppuType( static_cast * >( 0 ) ) ), + ucb::CommandInfo + ( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "setPropertyValues" ) ), + -1, getCppuType( static_cast * >( 0 ) ) ), + + // Optional standard commands + ucb::CommandInfo + ( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "delete" ) ), + -1, getCppuBooleanType() ), + ucb::CommandInfo + ( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "insert" ) ), + -1, getCppuType( static_cast( 0 ) ) ), + ucb::CommandInfo + ( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "open" ) ), + -1, getCppuType( static_cast( 0 ) ) ), + + // Folder only + ucb::CommandInfo + ( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "transfer" ) ), + -1, getCppuType( static_cast( 0 ) ) ) + }; + int num = 7; + + if ( isFolder( xEnv ) ) + num += 1; + + return uno::Sequence< ucb::CommandInfo >(aDocumentCommandInfoTable, num ); +} + +rtl::OUString +Content::getOUURI () +{ + osl::Guard< osl::Mutex > aGuard( m_aMutex ); + return m_xIdentifier->getContentIdentifier(); +} + +rtl::OString +Content::getOURI () +{ + return rtl::OUStringToOString( getOUURI(), RTL_TEXTENCODING_UTF8 ); +} + +char * +Content::getURI () +{ + return OUStringToGnome( getOUURI() ); +} + +void +Content::copyData( uno::Reference< io::XInputStream > xIn, + uno::Reference< io::XOutputStream > xOut ) +{ + uno::Sequence< sal_Int8 > theData( TRANSFER_BUFFER_SIZE ); + + g_return_if_fail( xIn.is() && xOut.is() ); + + while ( xIn->readBytes( theData, TRANSFER_BUFFER_SIZE ) > 0 ) + xOut->writeBytes( theData ); + + xOut->closeOutput(); +} + +// Inherits an authentication context +uno::Reference< io::XInputStream > +Content::createTempStream( + const uno::Reference< ucb::XCommandEnvironment >& xEnv ) + throw( uno::Exception ) +{ + GnomeVFSResult result; + GnomeVFSHandle *handle = NULL; + ::rtl::OString aURI = getOURI(); + + osl::Guard< osl::Mutex > aGuard( m_aMutex ); + // Something badly wrong happened - can't seek => stream to a temporary file + const rtl::OUString sServiceName ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.io.TempFile" ) ); + uno::Reference < io::XOutputStream > xTempOut = + uno::Reference < io::XOutputStream > + ( m_xSMgr->createInstance( sServiceName ), uno::UNO_QUERY ); + + if ( !xTempOut.is() ) + cancelCommandExecution( GNOME_VFS_ERROR_IO, xEnv ); + + result = gnome_vfs_open + ( &handle, (const sal_Char *)aURI, GNOME_VFS_OPEN_READ ); + if (result != GNOME_VFS_OK) + cancelCommandExecution( result, xEnv ); + + uno::Reference < io::XInputStream > pStream = new ::gvfs::Stream( handle, &m_info ); + copyData( pStream, xTempOut ); + + return uno::Reference < io::XInputStream > ( xTempOut, uno::UNO_QUERY ); +} + +uno::Reference< io::XInputStream > +Content::createInputStream( + const uno::Reference< ucb::XCommandEnvironment >& xEnv ) + throw( uno::Exception ) +{ + GnomeVFSHandle *handle = NULL; + GnomeVFSResult result; + uno::Reference xIn; + + Authentication aAuth( xEnv ); + osl::Guard< osl::Mutex > aGuard( m_aMutex ); + + getInfo( xEnv ); + ::rtl::OString aURI = getOURI(); + + if ( !(m_info.valid_fields & GNOME_VFS_FILE_INFO_FIELDS_SIZE) ) + return createTempStream( xEnv ); + + result = gnome_vfs_open + ( &handle, (const sal_Char *)aURI, + (GnomeVFSOpenMode) (GNOME_VFS_OPEN_READ | GNOME_VFS_OPEN_RANDOM ) ); + + if (result == GNOME_VFS_ERROR_INVALID_OPEN_MODE || + result == GNOME_VFS_ERROR_NOT_SUPPORTED) + return createTempStream( xEnv ); + + if (result != GNOME_VFS_OK) + cancelCommandExecution( result, xEnv ); + + // Try a seek just to make sure it's Random access: some lie. + result = gnome_vfs_seek( handle, GNOME_VFS_SEEK_START, 0); + if (result == GNOME_VFS_ERROR_NOT_SUPPORTED) { + gnome_vfs_close( handle ); + return createTempStream( xEnv ); + } + + if (result != GNOME_VFS_OK) + cancelCommandExecution( result, xEnv ); + + if (handle != NULL) + xIn = new ::gvfs::Stream( handle, &m_info ); + + return xIn; +} + +sal_Bool +Content::feedSink( uno::Reference< uno::XInterface > aSink, + const uno::Reference< ucb::XCommandEnvironment >& xEnv ) +{ + if ( !aSink.is() ) + return sal_False; + + uno::Reference< io::XOutputStream > xOut + = uno::Reference< io::XOutputStream >(aSink, uno::UNO_QUERY ); + uno::Reference< io::XActiveDataSink > xDataSink + = uno::Reference< io::XActiveDataSink >(aSink, uno::UNO_QUERY ); + + if ( !xOut.is() && !xDataSink.is() ) + return sal_False; + + uno::Reference< io::XInputStream > xIn = createInputStream( xEnv ); + if ( !xIn.is() ) + return sal_False; + + if ( xOut.is() ) + copyData( xIn, xOut ); + + if ( xDataSink.is() ) + xDataSink->setInputStream( xIn ); + + return sal_True; +} + +extern "C" { + +#ifndef GNOME_VFS_MODULE_CALLBACK_FULL_AUTHENTICATION +# error "We require Gnome VFS 2.6.x to compile (will run fine with < 2.6)" +#endif + + static void + vfs_authentication_callback (gconstpointer in_void, + gsize in_size, + gpointer out_void, + gsize out_size, + gpointer callback_data) + { + task::XInteractionHandler *xIH; + +#ifdef DEBUG + g_warning ("Full authentication callback (%p) ...", callback_data); +#endif + + if( !( xIH = (task::XInteractionHandler *) callback_data ) ) + return; + + const GnomeVFSModuleCallbackFullAuthenticationIn *in = + (const GnomeVFSModuleCallbackFullAuthenticationIn *) in_void; + GnomeVFSModuleCallbackFullAuthenticationOut *out = + (GnomeVFSModuleCallbackFullAuthenticationOut *) out_void; + + g_return_if_fail (in != NULL && out != NULL); + g_return_if_fail (sizeof (GnomeVFSModuleCallbackFullAuthenticationIn) == in_size && + sizeof (GnomeVFSModuleCallbackFullAuthenticationOut) == out_size); + +#ifdef DEBUG +# define NNIL(x) (x?x:"") + g_warning (" InComing data 0x%x uri '%s' prot '%s' server '%s' object '%s' " + "port %d auth_t '%s' user '%s' domain '%s' " + "def user '%s', def domain '%s'", + (int) in->flags, NNIL(in->uri), NNIL(in->protocol), + NNIL(in->server), NNIL(in->object), + (int) in->port, NNIL(in->authtype), NNIL(in->username), NNIL(in->domain), + NNIL(in->default_user), NNIL(in->default_domain)); +# undef NNIL +#endif + + ucbhelper::SimpleAuthenticationRequest::EntityType + eDomain, eUserName, ePassword; + ::rtl::OUString aHostName, aDomain, aUserName, aPassword; + + aHostName = GnomeToOUString( in->server ); + + if (in->flags & GNOME_VFS_MODULE_CALLBACK_FULL_AUTHENTICATION_NEED_DOMAIN) + { + aDomain = GnomeToOUString( in->domain ); + eDomain = ucbhelper::SimpleAuthenticationRequest::ENTITY_MODIFY; + if (!aDomain.getLength()) + aDomain = GnomeToOUString( in->default_domain ); + } + else // no underlying capability to display realm otherwise + eDomain = ucbhelper::SimpleAuthenticationRequest::ENTITY_NA; + + aUserName = GnomeToOUString( in->username ); + if (!aUserName.getLength()) + aUserName = GnomeToOUString( in->default_user ); + eUserName = (in->flags & GNOME_VFS_MODULE_CALLBACK_FULL_AUTHENTICATION_NEED_USERNAME) ? + ucbhelper::SimpleAuthenticationRequest::ENTITY_MODIFY : + (aUserName.getLength() ? + ucbhelper::SimpleAuthenticationRequest::ENTITY_FIXED : + ucbhelper::SimpleAuthenticationRequest::ENTITY_NA); + + // No suggested password. + ePassword = (in->flags & GNOME_VFS_MODULE_CALLBACK_FULL_AUTHENTICATION_NEED_PASSWORD) ? + ucbhelper::SimpleAuthenticationRequest::ENTITY_MODIFY : + ucbhelper::SimpleAuthenticationRequest::ENTITY_FIXED; + + // Really, really bad things happen if we don't provide + // the same user/password as was entered last time if + // we failed to authenticate - infinite looping / flickering + // madness etc. [ nice infrastructure ! ] + static rtl::OUString aLastUserName, aLastPassword; + if (in->flags & GNOME_VFS_MODULE_CALLBACK_FULL_AUTHENTICATION_PREVIOUS_ATTEMPT_FAILED) + { + osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); + aUserName = aLastUserName; + aPassword = aLastPassword; + } + + rtl::Reference< ucbhelper::SimpleAuthenticationRequest > xRequest + = new ucbhelper::SimpleAuthenticationRequest (GnomeToOUString(in->uri), + aHostName, eDomain, aDomain, + eUserName, aUserName, + ePassword, aPassword); + + xIH->handle( xRequest.get() ); + + rtl::Reference< ucbhelper::InteractionContinuation > xSelection + = xRequest->getSelection(); + + if ( xSelection.is() ) { + // Handler handled the request. + uno::Reference< task::XInteractionAbort > xAbort(xSelection.get(), uno::UNO_QUERY ); + if ( !xAbort.is() ) { + const rtl::Reference< + ucbhelper::InteractionSupplyAuthentication > & xSupp + = xRequest->getAuthenticationSupplier(); + + aUserName = xSupp->getUserName(); + aDomain = xSupp->getRealm(); + aPassword = xSupp->getPassword(); + + { + osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); + aLastUserName = aUserName; + aLastPassword = aPassword; + } + + out->username = OUStringToGnome( aUserName ); + out->domain = OUStringToGnome( aDomain ); + out->password = OUStringToGnome( aPassword ); + out->save_password = xSupp->getRememberPasswordMode(); + +#ifdef DEBUG + g_warning ("Got valid user/domain/password '%s' '%s' '%s', %s password", + out->username, out->domain, out->password, + out->save_password ? "save" : "don't save"); +#endif + } + else + out->abort_auth = TRUE; + } + else + out->abort_auth = TRUE; + } + + static void + vfs_authentication_old_callback (gconstpointer in_void, + gsize in_size, + gpointer out_void, + gsize out_size, + gpointer callback_data) + { +#ifdef DEBUG + g_warning ("Old authentication callback (%p) [ UNTESTED ] ...", callback_data); +#endif + const GnomeVFSModuleCallbackAuthenticationIn *in = + (const GnomeVFSModuleCallbackAuthenticationIn *) in_void; + GnomeVFSModuleCallbackAuthenticationOut *out = + (GnomeVFSModuleCallbackAuthenticationOut *) out_void; + + g_return_if_fail (in != NULL && out != NULL); + g_return_if_fail (sizeof (GnomeVFSModuleCallbackAuthenticationIn) == in_size && + sizeof (GnomeVFSModuleCallbackAuthenticationOut) == out_size); + + GnomeVFSModuleCallbackFullAuthenticationIn mapped_in = { + (GnomeVFSModuleCallbackFullAuthenticationFlags) + (GNOME_VFS_MODULE_CALLBACK_FULL_AUTHENTICATION_NEED_PASSWORD | + GNOME_VFS_MODULE_CALLBACK_FULL_AUTHENTICATION_NEED_USERNAME | + GNOME_VFS_MODULE_CALLBACK_FULL_AUTHENTICATION_NEED_DOMAIN), + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + GnomeVFSModuleCallbackFullAuthenticationOut mapped_out = { 0, 0, 0, 0, 0, 0, 0, 0 }; + + // Map the old style input auth. data to the new style structure. + if (in->previous_attempt_failed) + mapped_in.flags = (GnomeVFSModuleCallbackFullAuthenticationFlags) + (mapped_in.flags | + GNOME_VFS_MODULE_CALLBACK_FULL_AUTHENTICATION_PREVIOUS_ATTEMPT_FAILED); + + GnomeVFSURI *pURI = NULL; + // Urk - parse all this from the URL ... + mapped_in.uri = in->uri; + if (in->uri) + { + pURI = gnome_vfs_uri_new( in->uri ); + mapped_in.protocol = (char *) gnome_vfs_uri_get_scheme (pURI); + mapped_in.server = (char *) gnome_vfs_uri_get_host_name (pURI); + mapped_in.port = gnome_vfs_uri_get_host_port (pURI); + mapped_in.username = (char *) gnome_vfs_uri_get_user_name (pURI); + } + mapped_in.domain = in->realm; + mapped_in.default_user = mapped_in.username; + mapped_in.default_domain = mapped_in.domain; + + vfs_authentication_callback ((gconstpointer) &mapped_in, + sizeof (mapped_in), + (gpointer) &mapped_out, + sizeof (mapped_out), + callback_data); + + if (pURI) + gnome_vfs_uri_unref (pURI); + + // Map the new style auth. out data to the old style out structure. + out->username = mapped_out.username; + out->password = mapped_out.password; + g_free (mapped_out.domain); + g_free (mapped_out.keyring); + } + + + static void + auth_destroy (gpointer data) + { + task::XInteractionHandler *xIH; + if( ( xIH = ( task::XInteractionHandler * )data ) ) + xIH->release(); + } + + // This sucks, but gnome-vfs doesn't much like + // repeated set / unsets - so we have to compensate. + GPrivate *auth_queue = NULL; + + void auth_queue_destroy( gpointer data ) + { + GList *l; + GQueue *vq = (GQueue *) data; + + for (l = vq->head; l; l = l->next) + auth_destroy (l->data); + g_queue_free (vq); + } +} + +static void +refresh_auth( GQueue *vq ) +{ + GList *l; + + gnome_vfs_module_callback_pop( GNOME_VFS_MODULE_CALLBACK_AUTHENTICATION ); + gnome_vfs_module_callback_pop( GNOME_VFS_MODULE_CALLBACK_FULL_AUTHENTICATION ); + + for (l = vq->head; l; l = l->next) { + if (l->data) { + gnome_vfs_module_callback_push + ( GNOME_VFS_MODULE_CALLBACK_AUTHENTICATION, + vfs_authentication_old_callback, l->data, NULL ); + gnome_vfs_module_callback_push + ( GNOME_VFS_MODULE_CALLBACK_FULL_AUTHENTICATION, + vfs_authentication_callback, l->data, NULL ); + break; + } + } +} + +gvfs::Authentication::Authentication( + const uno::Reference< ucb::XCommandEnvironment > & xEnv ) +{ + GQueue *vq; + uno::Reference< task::XInteractionHandler > xIH; + + if ( xEnv.is() ) + xIH = xEnv->getInteractionHandler(); + + if ( xIH.is() ) + xIH->acquire(); + + if( !(vq = (GQueue *)g_private_get( auth_queue ) ) ) { + vq = g_queue_new(); + g_private_set( auth_queue, vq ); + } + + g_queue_push_head( vq, (gpointer) xIH.get() ); + refresh_auth( vq ); +} + +gvfs::Authentication::~Authentication() +{ + GQueue *vq; + gpointer data; + + vq = (GQueue *)g_private_get( auth_queue ); + + data = g_queue_pop_head( vq ); + auth_destroy (data); + + refresh_auth( vq ); +} diff --git a/ucb/source/ucp/gvfs/gvfs_content.hxx b/ucb/source/ucp/gvfs/gvfs_content.hxx new file mode 100644 index 000000000000..cd6701b8c742 --- /dev/null +++ b/ucb/source/ucp/gvfs/gvfs_content.hxx @@ -0,0 +1,267 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: content.hxx,v $ + * $Revision: 1.6 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _GVFS_UCP_CONTENT_HXX +#define _GVFS_UCP_CONTENT_HXX + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +namespace com { namespace sun { namespace star { namespace beans { + struct Property; + struct PropertyValue; +} } } } + +namespace com { namespace sun { namespace star { namespace io { + class XInputStream; + class XOutputStream; +} } } } + +namespace com { namespace sun { namespace star { namespace sdbc { + class XRow; +} } } } + +namespace com { namespace sun { namespace star { namespace ucb { + struct TransferInfo; +} } } } + +namespace gvfs +{ + +class ContentProvider; +class ContentProperties; + +// Random made up names - AFAICS +#define GVFS_FILE_TYPE "application/vnd.sun.staroffice.gvfs-file" +#define GVFS_FOLDER_TYPE "application/vnd.sun.staroffice.gvfs-folder" + +class Authentication +{ +public: + // Helper class to make exceptions pleasant + Authentication( const com::sun::star::uno::Reference< + com::sun::star::ucb::XCommandEnvironment > & xEnv ); + ~Authentication(); +}; + +class Content : public ::ucbhelper::ContentImplHelper, + public com::sun::star::ucb::XContentCreator +{ +//========================================================================= +// Internals +//========================================================================= +private: + typedef rtl::Reference< Content > ContentRef; + typedef std::list< ContentRef > ContentRefList; + + // Instance data + ContentProvider *m_pProvider; // No need for a ref, base class holds object + sal_Bool m_bTransient; // A non-existant (as yet) item + GnomeVFSFileInfo m_info; // cached status information + + // Internal helpers + void queryChildren ( ContentRefList& rChildren ); + ::com::sun::star::uno::Any getBadArgExcept (); + GnomeVFSResult getInfo ( const ::com::sun::star::uno::Reference< + ::com::sun::star::ucb::XCommandEnvironment >& xEnv ); + sal_Bool isFolder ( const ::com::sun::star::uno::Reference< + ::com::sun::star::ucb::XCommandEnvironment >& xEnv ); + sal_Bool exchangeIdentity( const ::com::sun::star::uno::Reference< + ::com::sun::star::ucb::XContentIdentifier >& xNewId); + GnomeVFSResult doSetFileInfo ( const GnomeVFSFileInfo *newInfo, + GnomeVFSSetFileInfoMask setMask, + const ::com::sun::star::uno::Reference< + ::com::sun::star::ucb::XCommandEnvironment >& xEnv ); + ::rtl::OUString makeNewURL ( const char *newName ); + // End Internal helpers + + // For ucbhelper + virtual ::rtl::OUString getParentURL(); + // For ucbhelper + virtual com::sun::star::uno::Sequence< com::sun::star::beans::Property > + getProperties( const com::sun::star::uno::Reference< + com::sun::star::ucb::XCommandEnvironment > & xEnv ); + // For ucbhelper + virtual com::sun::star::uno::Sequence< com::sun::star::ucb::CommandInfo > + getCommands( const com::sun::star::uno::Reference< + com::sun::star::ucb::XCommandEnvironment > & xEnv ); + +public: + // Command "getPropertyValues" + ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow > + getPropertyValues( const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::Property >& rProperties, + const ::com::sun::star::uno::Reference< + ::com::sun::star::ucb::XCommandEnvironment >& xEnv ); + +private: + // Command "setPropertyValues" + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > + setPropertyValues( const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue >& rValues, + const ::com::sun::star::uno::Reference< + ::com::sun::star::ucb::XCommandEnvironment >& xEnv ); + + // Command "insert" + void insert( const ::com::sun::star::uno::Reference< + ::com::sun::star::io::XInputStream > & xInputStream, + sal_Bool bReplaceExisting, + const com::sun::star::uno::Reference< + com::sun::star::ucb::XCommandEnvironment >& xEnv ) + throw( ::com::sun::star::uno::Exception ); + + // Command "transfer" + void transfer( const ::com::sun::star::ucb::TransferInfo & rArgs, + const com::sun::star::uno::Reference< + com::sun::star::ucb::XCommandEnvironment >& xEnv ) + throw( ::com::sun::star::uno::Exception ); + + // Command "delete" + void destroy( sal_Bool bDeletePhysical ) + throw( ::com::sun::star::uno::Exception ); + + // "open" helpers + void copyData( ::com::sun::star::uno::Reference< + ::com::sun::star::io::XInputStream > xIn, + ::com::sun::star::uno::Reference< + ::com::sun::star::io::XOutputStream > xOut ); + + ::com::sun::star::uno::Reference< + ::com::sun::star::io::XInputStream > + createTempStream( const ::com::sun::star::uno::Reference< + com::sun::star::ucb::XCommandEnvironment >& xEnv ) + throw( ::com::sun::star::uno::Exception ); + ::com::sun::star::uno::Reference< + ::com::sun::star::io::XInputStream > + createInputStream( const ::com::sun::star::uno::Reference< + com::sun::star::ucb::XCommandEnvironment >& xEnv ) + throw( ::com::sun::star::uno::Exception ); + sal_Bool feedSink( ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XInterface> aSink, + const ::com::sun::star::uno::Reference< + com::sun::star::ucb::XCommandEnvironment >& xEnv ); + + ::com::sun::star::uno::Any mapVFSException( const GnomeVFSResult result, + sal_Bool bWrite ); + + void cancelCommandExecution(const GnomeVFSResult result, + const ::com::sun::star::uno::Reference< + com::sun::star::ucb::XCommandEnvironment > & xEnv, + sal_Bool bWrite = sal_False ) + throw( ::com::sun::star::uno::Exception ); + + +public: + // Non-interface bits + char *getURI (); + rtl::OString getOURI (); + rtl::OUString getOUURI (); + +//========================================================================= +// Externals +//========================================================================= +public: + + Content( const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + ContentProvider *pProvider, + const ::com::sun::star::uno::Reference< + ::com::sun::star::ucb::XContentIdentifier >& Identifier) + throw ( ::com::sun::star::ucb::ContentCreationException ); + Content( const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + ContentProvider *pProvider, + const ::com::sun::star::uno::Reference< + ::com::sun::star::ucb::XContentIdentifier >& Identifier, + sal_Bool isFolder) + throw ( ::com::sun::star::ucb::ContentCreationException ); + virtual ~Content(); + + // XInterface + XINTERFACE_DECL() + + // XTypeProvider + XTYPEPROVIDER_DECL() + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames() + throw( ::com::sun::star::uno::RuntimeException ); + + // XContent + virtual rtl::OUString SAL_CALL + getContentType() + throw( com::sun::star::uno::RuntimeException ); + + // XCommandProcessor + virtual com::sun::star::uno::Any SAL_CALL + execute( const com::sun::star::ucb::Command& aCommand, + sal_Int32 CommandId, + const com::sun::star::uno::Reference< + com::sun::star::ucb::XCommandEnvironment >& xEnv ) + throw( com::sun::star::uno::Exception, + com::sun::star::ucb::CommandAbortedException, + com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL + abort( sal_Int32 CommandId ) + throw( com::sun::star::uno::RuntimeException ); + + ////////////////////////////////////////////////////////////////////// + // Additional interfaces + ////////////////////////////////////////////////////////////////////// + + // XContentCreator + virtual com::sun::star::uno::Sequence< + com::sun::star::ucb::ContentInfo > SAL_CALL + queryCreatableContentsInfo() + throw( com::sun::star::uno::RuntimeException ); + virtual com::sun::star::uno::Reference< + com::sun::star::ucb::XContent > SAL_CALL + createNewContent( const com::sun::star::ucb::ContentInfo& Info ) + throw( com::sun::star::uno::RuntimeException ); +}; + +} + +extern "C" { + extern GPrivate *auth_queue; + extern void auth_queue_destroy( gpointer data ); +} + +#endif diff --git a/ucb/source/ucp/gvfs/gvfs_directory.cxx b/ucb/source/ucp/gvfs/gvfs_directory.cxx new file mode 100644 index 000000000000..19ace5ebf162 --- /dev/null +++ b/ucb/source/ucp/gvfs/gvfs_directory.cxx @@ -0,0 +1,424 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: directory.cxx,v $ + * $Revision: 1.7 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_ucb.hxx" +/* + * This file pinched from webdavdatasupplier (etc.) + * cut & paste + new getData impl. & collate ResultSet code. + */ +#include +#include +#include +#include +#include + +#include "directory.hxx" + +#include +#include + +using namespace com::sun::star; +using namespace gvfs; + +// DynamicResultSet Implementation. + +DynamicResultSet::DynamicResultSet( + const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, + const rtl::Reference< Content >& rxContent, + const ucb::OpenCommandArgument2& rCommand, + const uno::Reference< ucb::XCommandEnvironment >& rxEnv ) + : ResultSetImplHelper( rxSMgr, rCommand ), + m_xContent( rxContent ), + m_xEnv( rxEnv ) +{ +} +void DynamicResultSet::initStatic() +{ + m_xResultSet1 + = new ::ucbhelper::ResultSet( m_xSMgr, + m_aCommand.Properties, + new DataSupplier( m_xSMgr, + m_xContent, + m_aCommand.Mode ), + m_xEnv ); +} +void DynamicResultSet::initDynamic() +{ + initStatic(); + m_xResultSet2 = m_xResultSet1; +} + +//========================================================================= + + +// DataSupplier Implementation. + + + +struct ResultListEntry +{ + rtl::OUString aId; + uno::Reference< ucb::XContentIdentifier > xId; + uno::Reference< ucb::XContent > xContent; + uno::Reference< sdbc::XRow > xRow; + GnomeVFSFileInfo aInfo; + + ResultListEntry( const GnomeVFSFileInfo *fileInfo) + { + gnome_vfs_file_info_copy (&aInfo, fileInfo); + } + + ~ResultListEntry() + { + gnome_vfs_file_info_clear (&aInfo); + } +}; + +//========================================================================= +// +// ResultList. +// +//========================================================================= + +typedef std::vector< ResultListEntry* > ResultList; + +//========================================================================= +// +// struct DataSupplier_Impl. +// +//========================================================================= + +struct gvfs::DataSupplier_Impl +{ + osl::Mutex m_aMutex; + ResultList m_aResults; + rtl::Reference< Content > m_xContent; + uno::Reference< lang::XMultiServiceFactory > m_xSMgr; + sal_Int32 m_nOpenMode; + sal_Bool m_bCountFinal; + + DataSupplier_Impl( + const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, + const rtl::Reference< Content >& rContent, + sal_Int32 nOpenMode ) + : m_xContent( rContent ), m_xSMgr( rxSMgr ), + m_nOpenMode( nOpenMode ), m_bCountFinal( sal_False ) {} + ~DataSupplier_Impl() + { + ResultList::const_iterator it = m_aResults.begin(); + ResultList::const_iterator end = m_aResults.end(); + + while ( it != end ) + { + delete (*it); + it++; + } + } +}; + +DataSupplier::DataSupplier( + const uno::Reference< lang::XMultiServiceFactory >& rxSMgr, + const rtl::Reference< Content >& rContent, + sal_Int32 nOpenMode ) +: m_pImpl( new DataSupplier_Impl( rxSMgr, rContent, nOpenMode ) ) +{ +} + +//========================================================================= +// virtual +DataSupplier::~DataSupplier() +{ + delete m_pImpl; +} + +// virtual +rtl::OUString DataSupplier::queryContentIdentifierString( sal_uInt32 nIndex ) +{ + osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex ); + + if ( nIndex < m_pImpl->m_aResults.size() ) { + rtl::OUString aId = m_pImpl->m_aResults[ nIndex ]->aId; + if ( aId.getLength() ) // cached + return aId; + } + + if ( getResult( nIndex ) ) { + rtl::OUString aId = m_pImpl->m_xContent->getOUURI(); + + char *escaped_name; + escaped_name = gnome_vfs_escape_string( m_pImpl->m_aResults[ nIndex ]->aInfo.name ); + + if ( ( aId.lastIndexOf( '/' ) + 1 ) != aId.getLength() ) + aId += rtl::OUString::createFromAscii( "/" ); + + aId += rtl::OUString::createFromAscii( escaped_name ); + + g_free( escaped_name ); + + m_pImpl->m_aResults[ nIndex ]->aId = aId; + return aId; + } + + return rtl::OUString(); +} + +// virtual +uno::Reference< ucb::XContentIdentifier > +DataSupplier::queryContentIdentifier( sal_uInt32 nIndex ) +{ + osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex ); + + if ( nIndex < m_pImpl->m_aResults.size() ) { + uno::Reference< ucb::XContentIdentifier > xId + = m_pImpl->m_aResults[ nIndex ]->xId; + if ( xId.is() ) // Already cached. + return xId; + } + + rtl::OUString aId = queryContentIdentifierString( nIndex ); + if ( aId.getLength() ) { + uno::Reference< ucb::XContentIdentifier > xId + = new ::ucbhelper::ContentIdentifier( aId ); + m_pImpl->m_aResults[ nIndex ]->xId = xId; + return xId; + } + + return uno::Reference< ucb::XContentIdentifier >(); +} + +// virtual +uno::Reference< ucb::XContent > +DataSupplier::queryContent( sal_uInt32 nIndex ) +{ + osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex ); + + if ( nIndex < m_pImpl->m_aResults.size() ) { + uno::Reference< ucb::XContent > xContent + = m_pImpl->m_aResults[ nIndex ]->xContent; + if ( xContent.is() ) // Already cached. + return xContent; + } + + uno::Reference< ucb::XContentIdentifier > xId + = queryContentIdentifier( nIndex ); + if ( xId.is() ) { + try + { + // FIXME: + // It would be really nice to propagate this information + // to the Content, but we can't then register it with the + // ContentProvider, and the ucbhelper hinders here. + uno::Reference< ucb::XContent > xContent + = m_pImpl->m_xContent->getProvider()->queryContent( xId ); + m_pImpl->m_aResults[ nIndex ]->xContent = xContent; + return xContent; + + } + catch ( ucb::IllegalIdentifierException& ) { + } + } + return uno::Reference< ucb::XContent >(); +} + +// virtual +sal_Bool DataSupplier::getResult( sal_uInt32 nIndex ) +{ + osl::ClearableGuard< osl::Mutex > aGuard( m_pImpl->m_aMutex ); + + if ( m_pImpl->m_aResults.size() > nIndex ) // Result already present. + return sal_True; + + if ( getData() && m_pImpl->m_aResults.size() > nIndex ) + return sal_True; + + return sal_False; +} + +// virtual +sal_uInt32 DataSupplier::totalCount() +{ + getData(); + + osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex ); + + return m_pImpl->m_aResults.size(); +} + +// virtual +sal_uInt32 DataSupplier::currentCount() +{ + osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex ); + return m_pImpl->m_aResults.size(); +} + +// virtual +sal_Bool DataSupplier::isCountFinal() +{ + osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex ); + return m_pImpl->m_bCountFinal; +} + +// virtual +uno::Reference< sdbc::XRow > DataSupplier::queryPropertyValues( sal_uInt32 nIndex ) +{ + osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex ); + + if ( nIndex < m_pImpl->m_aResults.size() ) { + uno::Reference< sdbc::XRow > xRow = m_pImpl->m_aResults[ nIndex ]->xRow; + if ( xRow.is() ) // Already cached. + return xRow; + } + + if ( getResult( nIndex ) ) { + // Inefficient - but we can't create xContent's sensibly + // nor can we do the property code sensibly cleanly staticaly. + Content *pContent = static_cast< ::gvfs::Content * >(queryContent( nIndex ).get()); + + uno::Reference< sdbc::XRow > xRow = + pContent->getPropertyValues( getResultSet()->getProperties(), + getResultSet()->getEnvironment() ); + + m_pImpl->m_aResults[ nIndex ]->xRow = xRow; + + return xRow; + } + + return uno::Reference< sdbc::XRow >(); +} + +// virtual +void DataSupplier::releasePropertyValues( sal_uInt32 nIndex ) +{ + osl::Guard< osl::Mutex > aGuard( m_pImpl->m_aMutex ); + + if ( nIndex < m_pImpl->m_aResults.size() ) + m_pImpl->m_aResults[ nIndex ]->xRow = uno::Reference< sdbc::XRow >(); +} + +// virtual +void DataSupplier::close() +{ +} + +// virtual +void DataSupplier::validate() + throw( ucb::ResultSetException ) +{ +} + +sal_Bool DataSupplier::getData() +{ + osl::ClearableGuard< osl::Mutex > aGuard( m_pImpl->m_aMutex ); + + if ( !m_pImpl->m_bCountFinal ) { + GnomeVFSResult result; + GnomeVFSDirectoryHandle *dirHandle = NULL; + + { + Authentication aAuth( getResultSet()->getEnvironment() ); + char *uri = m_pImpl->m_xContent->getURI(); + result = gnome_vfs_directory_open + ( &dirHandle, uri, GNOME_VFS_FILE_INFO_DEFAULT ); + + if (result != GNOME_VFS_OK) { +#ifdef DEBUG + g_warning ("Failed open of '%s' with '%s'", + uri, gnome_vfs_result_to_string( result )); +#endif + g_free( uri ); + return sal_False; + } + + g_free( uri ); + } + + + GnomeVFSFileInfo fileInfo; + fileInfo.name = 0; + while ((result = gnome_vfs_directory_read_next (dirHandle, &fileInfo)) == GNOME_VFS_OK) { + if( fileInfo.name && fileInfo.name[0] == '.' && + ( fileInfo.name[1] == '\0' || + ( fileInfo.name[1] == '.' && fileInfo.name[2] == '\0' ) ) ) + continue; + + switch ( m_pImpl->m_nOpenMode ) { + case ucb::OpenMode::FOLDERS: + if ( !(fileInfo.valid_fields & GNOME_VFS_FILE_INFO_FIELDS_TYPE) || + fileInfo.type != GNOME_VFS_FILE_TYPE_DIRECTORY ) + continue; + break; + + case ucb::OpenMode::DOCUMENTS: + if ( !(fileInfo.valid_fields & GNOME_VFS_FILE_INFO_FIELDS_TYPE) || + fileInfo.type != GNOME_VFS_FILE_TYPE_REGULAR ) + continue; + break; + + case ucb::OpenMode::ALL: + default: + break; + } + + m_pImpl->m_aResults.push_back( new ResultListEntry( &fileInfo ) ); + } +#ifdef DEBUG + g_warning ("Got %d directory entries", result); +#endif + + m_pImpl->m_bCountFinal = sal_True; + + // Callback possible, because listeners may be informed! + aGuard.clear(); + getResultSet()->rowCountFinal(); + + if (result != GNOME_VFS_ERROR_EOF) { +#ifdef DEBUG + g_warning( "Failed read_next '%s'", + gnome_vfs_result_to_string( result ) ); +#endif + return sal_False; + } + + result = gnome_vfs_directory_close (dirHandle); + if (result != GNOME_VFS_OK) { +#ifdef DEBUG + g_warning( "Failed close '%s'", + gnome_vfs_result_to_string( result ) ); +#endif + return sal_False; + } + } + + return sal_True; +} + + + diff --git a/ucb/source/ucp/gvfs/gvfs_directory.hxx b/ucb/source/ucp/gvfs/gvfs_directory.hxx new file mode 100644 index 000000000000..b3513c2d6048 --- /dev/null +++ b/ucb/source/ucp/gvfs/gvfs_directory.hxx @@ -0,0 +1,98 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: directory.hxx,v $ + * $Revision: 1.7 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _GVFS_UCP_RESULTSET_HXX +#define _GVFS_UCP_RESULTSET_HXX + +#include +#include +#include +#include "content.hxx" + +namespace gvfs { + +class DynamicResultSet : public ::ucbhelper::ResultSetImplHelper +{ + rtl::Reference< Content > m_xContent; + com::sun::star::uno::Reference< + com::sun::star::ucb::XCommandEnvironment > m_xEnv; + +private: + virtual void initStatic(); + virtual void initDynamic(); + +public: + DynamicResultSet( const com::sun::star::uno::Reference< + com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + const rtl::Reference< Content >& rxContent, + const com::sun::star::ucb::OpenCommandArgument2& rCommand, + const com::sun::star::uno::Reference< + com::sun::star::ucb::XCommandEnvironment >& rxEnv ); +}; + + +struct DataSupplier_Impl; +class DataSupplier : public ucbhelper::ResultSetDataSupplier +{ +private: + gvfs::DataSupplier_Impl *m_pImpl; + sal_Bool getData(); + +public: + DataSupplier( const com::sun::star::uno::Reference< + com::sun::star::lang::XMultiServiceFactory >& rxSMgr, + const rtl::Reference< Content >& rContent, + sal_Int32 nOpenMode); + + virtual ~DataSupplier(); + + virtual rtl::OUString queryContentIdentifierString( sal_uInt32 nIndex ); + virtual com::sun::star::uno::Reference< + com::sun::star::ucb::XContentIdentifier > + queryContentIdentifier( sal_uInt32 nIndex ); + virtual com::sun::star::uno::Reference< com::sun::star::ucb::XContent > + queryContent( sal_uInt32 nIndex ); + + virtual sal_Bool getResult( sal_uInt32 nIndex ); + + virtual sal_uInt32 totalCount(); + virtual sal_uInt32 currentCount(); + virtual sal_Bool isCountFinal(); + + virtual com::sun::star::uno::Reference< com::sun::star::sdbc::XRow > + queryPropertyValues( sal_uInt32 nIndex ); + virtual void releasePropertyValues( sal_uInt32 nIndex ); + virtual void close(); + virtual void validate() + throw( com::sun::star::ucb::ResultSetException ); +}; + +} + +#endif diff --git a/ucb/source/ucp/gvfs/gvfs_provider.cxx b/ucb/source/ucp/gvfs/gvfs_provider.cxx new file mode 100644 index 000000000000..c342fe2a6f63 --- /dev/null +++ b/ucb/source/ucp/gvfs/gvfs_provider.cxx @@ -0,0 +1,231 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: provider.cxx,v $ + * $Revision: 1.9 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_ucb.hxx" + +#include +#include +#include "provider.hxx" +#include "content.hxx" + +using namespace com::sun::star; +using namespace gvfs; + +//========================================================================= +//========================================================================= +// +// ContentProvider Implementation. +// +//========================================================================= +//========================================================================= + +ContentProvider::ContentProvider( + const uno::Reference< lang::XMultiServiceFactory >& rSMgr ) +: ::ucbhelper::ContentProviderImplHelper( rSMgr ) +{ +} +// sdafas +//========================================================================= +// virtual +ContentProvider::~ContentProvider() +{ +} + +//========================================================================= +// +// XInterface methods. +// +//========================================================================= + +XINTERFACE_IMPL_3( ContentProvider, + lang::XTypeProvider, + lang::XServiceInfo, + com::sun::star::ucb::XContentProvider ); + +//========================================================================= +// +// XTypeProvider methods. +// +//========================================================================= + +XTYPEPROVIDER_IMPL_3( ContentProvider, + lang::XTypeProvider, + lang::XServiceInfo, + com::sun::star::ucb::XContentProvider ); + +//========================================================================= +// +// XServiceInfo methods. +// +//========================================================================= + +XSERVICEINFO_IMPL_1( ContentProvider, + rtl::OUString::createFromAscii( + "com.sun.star.comp.GnomeVFSContentProvider" ), + rtl::OUString::createFromAscii( + "com.sun.star.ucb.GnomeVFSContentProvider" ) ); +//========================================================================= +// +// Service factory implementation. +// +//========================================================================= + +ONE_INSTANCE_SERVICE_FACTORY_IMPL( ContentProvider ); + +//========================================================================= +// +// XContentProvider methods. +// +//========================================================================= + +uno::Reference< com::sun::star::ucb::XContent > SAL_CALL +ContentProvider::queryContent( + const uno::Reference< + com::sun::star::ucb::XContentIdentifier >& Identifier ) + throw( com::sun::star::ucb::IllegalIdentifierException, + uno::RuntimeException ) +{ +#ifdef DEBUG + g_warning ("QueryContent: '%s'", + (const sal_Char *)rtl::OUStringToOString + (Identifier->getContentIdentifier(), RTL_TEXTENCODING_UTF8)); +#endif + + osl::MutexGuard aGuard( m_aMutex ); + + // Check, if a content with given id already exists... + uno::Reference< com::sun::star::ucb::XContent > xContent + = queryExistingContent( Identifier ).get(); + if ( xContent.is() ) + return xContent; + + try + { + xContent = new ::gvfs::Content(m_xSMgr, this, Identifier ); + registerNewContent( xContent ); + } + catch ( com::sun::star::ucb::ContentCreationException const & ) + { + throw com::sun::star::ucb::IllegalIdentifierException(); + } + + if ( !xContent->getIdentifier().is() ) + throw com::sun::star::ucb::IllegalIdentifierException(); + + return xContent; +} + + +//============================ shlib entry points ============================================= + + +// cut and paste verbatim from webdav (that sucks). +static sal_Bool +writeInfo( void *pRegistryKey, + const rtl::OUString &rImplementationName, + uno::Sequence< rtl::OUString > const &rServiceNames ) +{ + rtl::OUString aKeyName( rtl::OUString::createFromAscii( "/" ) ); + aKeyName += rImplementationName; + aKeyName += rtl::OUString::createFromAscii( "/UNO/SERVICES" ); + + uno::Reference< registry::XRegistryKey > xKey; + try { + xKey = static_cast< registry::XRegistryKey * > + (pRegistryKey )->createKey( aKeyName ); + } + catch ( registry::InvalidRegistryException const & ) { + } + + if ( !xKey.is() ) + return sal_False; + + sal_Bool bSuccess = sal_True; + + for ( sal_Int32 n = 0; n < rServiceNames.getLength(); ++n ) { + try { + xKey->createKey( rServiceNames[ n ] ); + + } catch ( registry::InvalidRegistryException const & ) { + bSuccess = sal_False; + break; + } + } + return bSuccess; +} + +extern "C" void SAL_CALL +component_getImplementationEnvironment( const sal_Char **ppEnvTypeName, + uno_Environment **/*ppEnv*/ ) +{ + *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; +} + +extern "C" sal_Bool SAL_CALL +component_writeInfo( void */*pServiceManager*/, + void *pRegistryKey ) +{ + return pRegistryKey && + writeInfo( pRegistryKey, + ::gvfs::ContentProvider::getImplementationName_Static(), + ::gvfs::ContentProvider::getSupportedServiceNames_Static() ); +} +extern "C" void * SAL_CALL +component_getFactory( const sal_Char *pImplName, + void *pServiceManager, + void */*pRegistryKey*/ ) +{ + void * pRet = 0; + + { + osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); + if (!gnome_vfs_initialized ()) + gnome_vfs_init (); + if (!auth_queue) + auth_queue = g_private_new( auth_queue_destroy ); + } + + uno::Reference< lang::XMultiServiceFactory > xSMgr + (reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ) ); + uno::Reference< lang::XSingleServiceFactory > xFactory; + + if ( !::gvfs::ContentProvider::getImplementationName_Static().compareToAscii( pImplName ) ) + xFactory = ::gvfs::ContentProvider::createServiceFactory( xSMgr ); + + if ( xFactory.is() ) { + xFactory->acquire(); + pRet = xFactory.get(); + } + + return pRet; +} + + diff --git a/ucb/source/ucp/gvfs/gvfs_provider.hxx b/ucb/source/ucp/gvfs/gvfs_provider.hxx new file mode 100644 index 000000000000..8703344c33a9 --- /dev/null +++ b/ucb/source/ucp/gvfs/gvfs_provider.hxx @@ -0,0 +1,68 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: provider.hxx,v $ + * $Revision: 1.7 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _PROVIDER_HXX_ +#define _PROVIDER_HXX_ + +#include +#include +#include + +namespace gvfs { + +class ContentProvider : public ::ucbhelper::ContentProviderImplHelper +{ +public: + ContentProvider( const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XMultiServiceFactory >& rSMgr ); + virtual ~ContentProvider(); + + // XInterface + XINTERFACE_DECL() + + // XTypeProvider + XTYPEPROVIDER_DECL() + + // XServiceInfo + XSERVICEINFO_DECL() + + // XContentProvider + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::ucb::XContent > SAL_CALL + queryContent( const ::com::sun::star::uno::Reference< + ::com::sun::star::ucb::XContentIdentifier >& Identifier ) + throw( ::com::sun::star::ucb::IllegalIdentifierException, + ::com::sun::star::uno::RuntimeException ); + +}; + +} /* namespace gvfs */ + +#endif /* _PROVIDER_HXX_ */ + diff --git a/ucb/source/ucp/gvfs/gvfs_stream.cxx b/ucb/source/ucp/gvfs/gvfs_stream.cxx new file mode 100644 index 000000000000..364108746f7b --- /dev/null +++ b/ucb/source/ucp/gvfs/gvfs_stream.cxx @@ -0,0 +1,346 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: stream.cxx,v $ + * $Revision: 1.7 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_ucb.hxx" +#include "stream.hxx" +#include +#include + +#include + +using namespace cppu; +using namespace rtl; +using namespace com::sun::star::io; +using namespace com::sun::star::uno; +using namespace com::sun::star::ucb; +using namespace gvfs; + +Stream::Stream( GnomeVFSHandle *handle, + const GnomeVFSFileInfo *aInfo ) : + m_eof (sal_False), + m_bInputStreamCalled( sal_False ), + m_bOutputStreamCalled( sal_False ) +{ + m_handle = handle; + gnome_vfs_file_info_copy (&m_info, aInfo); +} + +Stream::~Stream( void ) +{ + if (m_handle) { + gnome_vfs_close (m_handle); + m_handle = NULL; + } +} + +Any Stream::queryInterface( const Type &type ) + throw( RuntimeException ) +{ + Any aRet = ::cppu::queryInterface + ( type, + static_cast< XStream * >( this ), + static_cast< XInputStream * >( this ), + static_cast< XOutputStream * >( this ), + static_cast< XSeekable * >( this ), + static_cast< XTruncate * >( this ) ); + + return aRet.hasValue() ? aRet : OWeakObject::queryInterface( type ); +} + +// ------------------------------------------------------------------- +// XStream +// ------------------------------------------------------------------- + +com::sun::star::uno::Reference< com::sun::star::io::XInputStream > SAL_CALL +Stream::getInputStream( ) + throw( com::sun::star::uno::RuntimeException ) +{ + { + osl::MutexGuard aGuard( m_aMutex ); + m_bInputStreamCalled = true; + } + return Reference< XInputStream >( this ); +} + +com::sun::star::uno::Reference< com::sun::star::io::XOutputStream > SAL_CALL +Stream::getOutputStream( ) + throw( com::sun::star::uno::RuntimeException ) +{ + { + osl::MutexGuard aGuard( m_aMutex ); + m_bOutputStreamCalled = true; + } + return Reference< XOutputStream >( this ); +} + +// ------------------------------------------------------------------- +// XInputStream +// ------------------------------------------------------------------- + +sal_Int32 SAL_CALL Stream::readBytes( + Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) + throw( NotConnectedException, + BufferSizeExceededException, + IOException, + RuntimeException ) +{ + GnomeVFSResult result; + GnomeVFSFileSize nBytesRead = 0; + + if( ! m_handle ) + throw IOException(); + + if( m_eof ) { + aData.realloc( 0 ); + return 0; + } + + try { + aData.realloc( nBytesToRead ); + } catch ( const Exception &e ) { + throw BufferSizeExceededException(); + } + + do { + result = gnome_vfs_read( m_handle, aData.getArray(), + nBytesToRead, &nBytesRead ); + } while( result == GNOME_VFS_ERROR_INTERRUPTED ); + + if (result != GNOME_VFS_OK && + result != GNOME_VFS_ERROR_EOF) + throwOnError( result ); + + if (result == GNOME_VFS_ERROR_EOF) + m_eof = sal_True; + + aData.realloc( sal::static_int_cast(nBytesRead) ); + + return sal::static_int_cast(nBytesRead); +} + +sal_Int32 SAL_CALL Stream::readSomeBytes( + Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead ) + throw( NotConnectedException, + BufferSizeExceededException, + IOException, + RuntimeException ) +{ + // Again - having 2 methods here just sucks; cf. filinpstr.cxx + // This can never be an effective non-blocking API - so why bother ? + return readBytes( aData, nMaxBytesToRead ); +} + +void SAL_CALL Stream::skipBytes( sal_Int32 nBytesToSkip ) + throw( NotConnectedException, + BufferSizeExceededException, + IOException, + RuntimeException ) +{ + GnomeVFSResult result; + + if( ! m_handle ) + throw IOException(); + + result = gnome_vfs_seek( m_handle, GNOME_VFS_SEEK_CURRENT, nBytesToSkip ); + + if ( result == GNOME_VFS_ERROR_BAD_PARAMETERS || + result == GNOME_VFS_ERROR_NOT_SUPPORTED ) + g_warning ("FIXME: just read them in ..."); + + throwOnError( result ); +} + +sal_Int32 SAL_CALL Stream::available( ) + throw( NotConnectedException, + IOException, + RuntimeException ) +{ + return 0; // cf. filinpstr.cxx +} + +void SAL_CALL Stream::closeInput( void ) + throw( NotConnectedException, + IOException, + RuntimeException ) +{ + osl::MutexGuard aGuard( m_aMutex ); + m_bInputStreamCalled = false; + + if( ! m_bOutputStreamCalled ) + closeStream(); +} + +// ------------------------------------------------------------------- +// XSeekable +// ------------------------------------------------------------------- + +void SAL_CALL Stream::seek( sal_Int64 location ) + throw( ::com::sun::star::lang::IllegalArgumentException, + IOException, + RuntimeException ) +{ + GnomeVFSResult result; + + if( ! m_handle ) + throw IOException(); + + if ( location < 0 ) + throw ::com::sun::star::lang::IllegalArgumentException(); + + m_eof = sal_False; + result = gnome_vfs_seek( m_handle, GNOME_VFS_SEEK_START, location ); + + if (result == GNOME_VFS_ERROR_EOF) + throw ::com::sun::star::lang::IllegalArgumentException(); + + throwOnError( result ); +} + +sal_Int64 SAL_CALL Stream::getPosition() + throw( IOException, + RuntimeException ) +{ + GnomeVFSFileSize nBytesIn = 0; + + if( ! m_handle ) + throw IOException(); + + throwOnError( gnome_vfs_tell( m_handle, &nBytesIn ) ); + + return nBytesIn; +} + +sal_Int64 SAL_CALL Stream::getLength() + throw( IOException, RuntimeException ) +{ + // FIXME: so this sucks; it may be stale but ... + if (m_info.valid_fields & GNOME_VFS_FILE_INFO_FIELDS_SIZE) + return m_info.size; + else { + g_warning ("FIXME: No valid length"); + return 0; + } +} + +// ------------------------------------------------------------------- +// XTruncate +// ------------------------------------------------------------------- + +void SAL_CALL Stream::truncate( void ) + throw( com::sun::star::io::IOException, + com::sun::star::uno::RuntimeException ) +{ + if( ! m_handle ) + throw IOException(); + + throwOnError( gnome_vfs_truncate_handle( m_handle, 0 ) ); +} + +// ------------------------------------------------------------------- +// XOutputStream +// ------------------------------------------------------------------- + +void SAL_CALL Stream::writeBytes( const com::sun::star::uno::Sequence< sal_Int8 >& aData ) + throw( com::sun::star::io::NotConnectedException, + com::sun::star::io::BufferSizeExceededException, + com::sun::star::io::IOException, + com::sun::star::uno::RuntimeException) +{ + GnomeVFSResult result = GNOME_VFS_OK; + GnomeVFSFileSize toWrite = aData.getLength(); + const sal_Int8 *p = aData.getConstArray(); + + if( ! m_handle ) + throw IOException(); + + while( toWrite > 0) { + GnomeVFSFileSize bytesWritten = 0; + + result = gnome_vfs_write( m_handle, p, toWrite, &bytesWritten ); + if( result == GNOME_VFS_ERROR_INTERRUPTED ) + continue; + throwOnError( result ); + g_assert( bytesWritten <= toWrite ); + toWrite -= bytesWritten; + p += bytesWritten; + } +} + +void SAL_CALL Stream::flush( void ) + throw( NotConnectedException, BufferSizeExceededException, + IOException, RuntimeException ) +{ +} + +void SAL_CALL Stream::closeOutput( void ) + throw( com::sun::star::io::NotConnectedException, + com::sun::star::io::IOException, + com::sun::star::uno::RuntimeException ) +{ + osl::MutexGuard aGuard( m_aMutex ); + m_bOutputStreamCalled = false; + + if( ! m_bInputStreamCalled ) + closeStream(); +} + +// ------------------------------------------------------------------- +// Misc. +// ------------------------------------------------------------------- + +void Stream::closeStream( void ) + throw( ::com::sun::star::io::NotConnectedException, + ::com::sun::star::io::IOException, + ::com::sun::star::uno::RuntimeException ) +{ + if (m_handle) { + gnome_vfs_close (m_handle); + m_handle = NULL; + } else + throw IOException(); +} + +void Stream::throwOnError( GnomeVFSResult result ) + throw( NotConnectedException, + BufferSizeExceededException, + IOException, + RuntimeException ) +{ + if( result != GNOME_VFS_OK ) { + ::rtl::OUString aMsg = ::rtl::OUString::createFromAscii + ( gnome_vfs_result_to_string( result ) ); + + g_warning( "Input Stream exceptional result '%s' (%d)", + gnome_vfs_result_to_string( result ), result ); + + throw IOException( aMsg, static_cast< cppu::OWeakObject * >( this ) ); + } +} diff --git a/ucb/source/ucp/gvfs/gvfs_stream.hxx b/ucb/source/ucp/gvfs/gvfs_stream.hxx new file mode 100644 index 000000000000..1d22918ce566 --- /dev/null +++ b/ucb/source/ucp/gvfs/gvfs_stream.hxx @@ -0,0 +1,168 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: stream.hxx,v $ + * $Revision: 1.5 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _GVFSSTREAM_HXX_ +#define _GVFSSTREAM_HXX_ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +namespace gvfs +{ + +class Stream : public ::com::sun::star::io::XStream, + public ::com::sun::star::io::XInputStream, + public ::com::sun::star::io::XOutputStream, + public ::com::sun::star::io::XTruncate, + public ::com::sun::star::io::XSeekable, + public ::cppu::OWeakObject +{ +private: + GnomeVFSHandle *m_handle; + GnomeVFSFileInfo m_info; + osl::Mutex m_aMutex; + sal_Bool m_eof; + sal_Bool m_bInputStreamCalled; + sal_Bool m_bOutputStreamCalled; + + void throwOnError( GnomeVFSResult result ) + throw( ::com::sun::star::io::NotConnectedException, + ::com::sun::star::io::BufferSizeExceededException, + ::com::sun::star::io::IOException, + ::com::sun::star::uno::RuntimeException ); + + void closeStream( void ) + throw( ::com::sun::star::io::NotConnectedException, + ::com::sun::star::io::IOException, + ::com::sun::star::uno::RuntimeException ); + +public: + Stream ( GnomeVFSHandle *handle, + const GnomeVFSFileInfo *aInfo ); + virtual ~Stream(); + + // XInterface + virtual com::sun::star::uno::Any SAL_CALL queryInterface(const ::com::sun::star::uno::Type & type ) + throw( ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL acquire( void ) + throw () + { OWeakObject::acquire(); } + virtual void SAL_CALL release( void ) + throw() + { OWeakObject::release(); } + + // XStream + virtual com::sun::star::uno::Reference< com::sun::star::io::XInputStream > SAL_CALL getInputStream( ) + throw( com::sun::star::uno::RuntimeException ); + + virtual com::sun::star::uno::Reference< com::sun::star::io::XOutputStream > SAL_CALL getOutputStream( ) + throw( com::sun::star::uno::RuntimeException ); + + // XInputStream + virtual sal_Int32 SAL_CALL readBytes( + ::com::sun::star::uno::Sequence< sal_Int8 > & aData, + sal_Int32 nBytesToRead ) + throw( ::com::sun::star::io::NotConnectedException, + ::com::sun::star::io::BufferSizeExceededException, + ::com::sun::star::io::IOException, + ::com::sun::star::uno::RuntimeException ); + + virtual sal_Int32 SAL_CALL readSomeBytes( + ::com::sun::star::uno::Sequence< sal_Int8 > & aData, + sal_Int32 nMaxBytesToRead ) + throw( ::com::sun::star::io::NotConnectedException, + ::com::sun::star::io::BufferSizeExceededException, + ::com::sun::star::io::IOException, + ::com::sun::star::uno::RuntimeException ); + + virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip ) + throw( ::com::sun::star::io::NotConnectedException, + ::com::sun::star::io::BufferSizeExceededException, + ::com::sun::star::io::IOException, + ::com::sun::star::uno::RuntimeException ); + + virtual sal_Int32 SAL_CALL available( void ) + throw( ::com::sun::star::io::NotConnectedException, + ::com::sun::star::io::IOException, + ::com::sun::star::uno::RuntimeException ); + + virtual void SAL_CALL closeInput( void ) + throw( ::com::sun::star::io::NotConnectedException, + ::com::sun::star::io::IOException, + ::com::sun::star::uno::RuntimeException ); + + // XSeekable + virtual void SAL_CALL seek( sal_Int64 location ) + throw( ::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::io::IOException, + ::com::sun::star::uno::RuntimeException ); + + virtual sal_Int64 SAL_CALL getPosition() + throw( ::com::sun::star::io::IOException, + ::com::sun::star::uno::RuntimeException ); + + virtual sal_Int64 SAL_CALL getLength() + throw( ::com::sun::star::io::IOException, + ::com::sun::star::uno::RuntimeException ); + + // XOutputStream + virtual void SAL_CALL writeBytes( const com::sun::star::uno::Sequence< sal_Int8 >& aData ) + throw( com::sun::star::io::NotConnectedException, + com::sun::star::io::BufferSizeExceededException, + com::sun::star::io::IOException, + com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL flush( void ) + throw( com::sun::star::io::NotConnectedException, + com::sun::star::io::BufferSizeExceededException, + com::sun::star::io::IOException, + com::sun::star::uno::RuntimeException); + + + virtual void SAL_CALL closeOutput( void ) + throw( com::sun::star::io::NotConnectedException, + com::sun::star::io::IOException, + com::sun::star::uno::RuntimeException ); + + // XTruncate + virtual void SAL_CALL truncate( void ) + throw( com::sun::star::io::IOException, + com::sun::star::uno::RuntimeException ); +}; + +} // namespace gvfs +#endif // _GVFSSTREAM_HXX_ diff --git a/ucb/source/ucp/gvfs/makefile.mk b/ucb/source/ucp/gvfs/makefile.mk index 889e3ffd415d..81eb43da9735 100644 --- a/ucb/source/ucp/gvfs/makefile.mk +++ b/ucb/source/ucp/gvfs/makefile.mk @@ -1,7 +1,7 @@ #************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# +# # Copyright 2008 by Sun Microsystems, Inc. # # OpenOffice.org - a multi-platform office productivity suite @@ -62,10 +62,10 @@ PKGCONFIG_LIBS!:=-Wl,--export-dynamic $(PKGCONFIG_LIBS:s/ -llinc//:s/ -lbonobo-a DLLPRE = SLOFILES=\ - $(SLO)$/content.obj \ - $(SLO)$/directory.obj \ - $(SLO)$/stream.obj \ - $(SLO)$/provider.obj + $(SLO)$/gvfs_content.obj \ + $(SLO)$/gvfs_directory.obj \ + $(SLO)$/gvfs_stream.obj \ + $(SLO)$/gvfs_provider.obj SHL1NOCHECK=TRUE SHL1TARGET=$(TARGET)$(UCPGVFS_MAJOR).uno diff --git a/ucb/source/ucp/gvfs/provider.cxx b/ucb/source/ucp/gvfs/provider.cxx deleted file mode 100644 index c342fe2a6f63..000000000000 --- a/ucb/source/ucp/gvfs/provider.cxx +++ /dev/null @@ -1,231 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: provider.cxx,v $ - * $Revision: 1.9 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_ucb.hxx" - -#include -#include -#include "provider.hxx" -#include "content.hxx" - -using namespace com::sun::star; -using namespace gvfs; - -//========================================================================= -//========================================================================= -// -// ContentProvider Implementation. -// -//========================================================================= -//========================================================================= - -ContentProvider::ContentProvider( - const uno::Reference< lang::XMultiServiceFactory >& rSMgr ) -: ::ucbhelper::ContentProviderImplHelper( rSMgr ) -{ -} -// sdafas -//========================================================================= -// virtual -ContentProvider::~ContentProvider() -{ -} - -//========================================================================= -// -// XInterface methods. -// -//========================================================================= - -XINTERFACE_IMPL_3( ContentProvider, - lang::XTypeProvider, - lang::XServiceInfo, - com::sun::star::ucb::XContentProvider ); - -//========================================================================= -// -// XTypeProvider methods. -// -//========================================================================= - -XTYPEPROVIDER_IMPL_3( ContentProvider, - lang::XTypeProvider, - lang::XServiceInfo, - com::sun::star::ucb::XContentProvider ); - -//========================================================================= -// -// XServiceInfo methods. -// -//========================================================================= - -XSERVICEINFO_IMPL_1( ContentProvider, - rtl::OUString::createFromAscii( - "com.sun.star.comp.GnomeVFSContentProvider" ), - rtl::OUString::createFromAscii( - "com.sun.star.ucb.GnomeVFSContentProvider" ) ); -//========================================================================= -// -// Service factory implementation. -// -//========================================================================= - -ONE_INSTANCE_SERVICE_FACTORY_IMPL( ContentProvider ); - -//========================================================================= -// -// XContentProvider methods. -// -//========================================================================= - -uno::Reference< com::sun::star::ucb::XContent > SAL_CALL -ContentProvider::queryContent( - const uno::Reference< - com::sun::star::ucb::XContentIdentifier >& Identifier ) - throw( com::sun::star::ucb::IllegalIdentifierException, - uno::RuntimeException ) -{ -#ifdef DEBUG - g_warning ("QueryContent: '%s'", - (const sal_Char *)rtl::OUStringToOString - (Identifier->getContentIdentifier(), RTL_TEXTENCODING_UTF8)); -#endif - - osl::MutexGuard aGuard( m_aMutex ); - - // Check, if a content with given id already exists... - uno::Reference< com::sun::star::ucb::XContent > xContent - = queryExistingContent( Identifier ).get(); - if ( xContent.is() ) - return xContent; - - try - { - xContent = new ::gvfs::Content(m_xSMgr, this, Identifier ); - registerNewContent( xContent ); - } - catch ( com::sun::star::ucb::ContentCreationException const & ) - { - throw com::sun::star::ucb::IllegalIdentifierException(); - } - - if ( !xContent->getIdentifier().is() ) - throw com::sun::star::ucb::IllegalIdentifierException(); - - return xContent; -} - - -//============================ shlib entry points ============================================= - - -// cut and paste verbatim from webdav (that sucks). -static sal_Bool -writeInfo( void *pRegistryKey, - const rtl::OUString &rImplementationName, - uno::Sequence< rtl::OUString > const &rServiceNames ) -{ - rtl::OUString aKeyName( rtl::OUString::createFromAscii( "/" ) ); - aKeyName += rImplementationName; - aKeyName += rtl::OUString::createFromAscii( "/UNO/SERVICES" ); - - uno::Reference< registry::XRegistryKey > xKey; - try { - xKey = static_cast< registry::XRegistryKey * > - (pRegistryKey )->createKey( aKeyName ); - } - catch ( registry::InvalidRegistryException const & ) { - } - - if ( !xKey.is() ) - return sal_False; - - sal_Bool bSuccess = sal_True; - - for ( sal_Int32 n = 0; n < rServiceNames.getLength(); ++n ) { - try { - xKey->createKey( rServiceNames[ n ] ); - - } catch ( registry::InvalidRegistryException const & ) { - bSuccess = sal_False; - break; - } - } - return bSuccess; -} - -extern "C" void SAL_CALL -component_getImplementationEnvironment( const sal_Char **ppEnvTypeName, - uno_Environment **/*ppEnv*/ ) -{ - *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; -} - -extern "C" sal_Bool SAL_CALL -component_writeInfo( void */*pServiceManager*/, - void *pRegistryKey ) -{ - return pRegistryKey && - writeInfo( pRegistryKey, - ::gvfs::ContentProvider::getImplementationName_Static(), - ::gvfs::ContentProvider::getSupportedServiceNames_Static() ); -} -extern "C" void * SAL_CALL -component_getFactory( const sal_Char *pImplName, - void *pServiceManager, - void */*pRegistryKey*/ ) -{ - void * pRet = 0; - - { - osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); - if (!gnome_vfs_initialized ()) - gnome_vfs_init (); - if (!auth_queue) - auth_queue = g_private_new( auth_queue_destroy ); - } - - uno::Reference< lang::XMultiServiceFactory > xSMgr - (reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ) ); - uno::Reference< lang::XSingleServiceFactory > xFactory; - - if ( !::gvfs::ContentProvider::getImplementationName_Static().compareToAscii( pImplName ) ) - xFactory = ::gvfs::ContentProvider::createServiceFactory( xSMgr ); - - if ( xFactory.is() ) { - xFactory->acquire(); - pRet = xFactory.get(); - } - - return pRet; -} - - diff --git a/ucb/source/ucp/gvfs/provider.hxx b/ucb/source/ucp/gvfs/provider.hxx deleted file mode 100644 index 8703344c33a9..000000000000 --- a/ucb/source/ucp/gvfs/provider.hxx +++ /dev/null @@ -1,68 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: provider.hxx,v $ - * $Revision: 1.7 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _PROVIDER_HXX_ -#define _PROVIDER_HXX_ - -#include -#include -#include - -namespace gvfs { - -class ContentProvider : public ::ucbhelper::ContentProviderImplHelper -{ -public: - ContentProvider( const ::com::sun::star::uno::Reference< - ::com::sun::star::lang::XMultiServiceFactory >& rSMgr ); - virtual ~ContentProvider(); - - // XInterface - XINTERFACE_DECL() - - // XTypeProvider - XTYPEPROVIDER_DECL() - - // XServiceInfo - XSERVICEINFO_DECL() - - // XContentProvider - virtual ::com::sun::star::uno::Reference< - ::com::sun::star::ucb::XContent > SAL_CALL - queryContent( const ::com::sun::star::uno::Reference< - ::com::sun::star::ucb::XContentIdentifier >& Identifier ) - throw( ::com::sun::star::ucb::IllegalIdentifierException, - ::com::sun::star::uno::RuntimeException ); - -}; - -} /* namespace gvfs */ - -#endif /* _PROVIDER_HXX_ */ - diff --git a/ucb/source/ucp/gvfs/stream.cxx b/ucb/source/ucp/gvfs/stream.cxx deleted file mode 100644 index 364108746f7b..000000000000 --- a/ucb/source/ucp/gvfs/stream.cxx +++ /dev/null @@ -1,346 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: stream.cxx,v $ - * $Revision: 1.7 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_ucb.hxx" -#include "stream.hxx" -#include -#include - -#include - -using namespace cppu; -using namespace rtl; -using namespace com::sun::star::io; -using namespace com::sun::star::uno; -using namespace com::sun::star::ucb; -using namespace gvfs; - -Stream::Stream( GnomeVFSHandle *handle, - const GnomeVFSFileInfo *aInfo ) : - m_eof (sal_False), - m_bInputStreamCalled( sal_False ), - m_bOutputStreamCalled( sal_False ) -{ - m_handle = handle; - gnome_vfs_file_info_copy (&m_info, aInfo); -} - -Stream::~Stream( void ) -{ - if (m_handle) { - gnome_vfs_close (m_handle); - m_handle = NULL; - } -} - -Any Stream::queryInterface( const Type &type ) - throw( RuntimeException ) -{ - Any aRet = ::cppu::queryInterface - ( type, - static_cast< XStream * >( this ), - static_cast< XInputStream * >( this ), - static_cast< XOutputStream * >( this ), - static_cast< XSeekable * >( this ), - static_cast< XTruncate * >( this ) ); - - return aRet.hasValue() ? aRet : OWeakObject::queryInterface( type ); -} - -// ------------------------------------------------------------------- -// XStream -// ------------------------------------------------------------------- - -com::sun::star::uno::Reference< com::sun::star::io::XInputStream > SAL_CALL -Stream::getInputStream( ) - throw( com::sun::star::uno::RuntimeException ) -{ - { - osl::MutexGuard aGuard( m_aMutex ); - m_bInputStreamCalled = true; - } - return Reference< XInputStream >( this ); -} - -com::sun::star::uno::Reference< com::sun::star::io::XOutputStream > SAL_CALL -Stream::getOutputStream( ) - throw( com::sun::star::uno::RuntimeException ) -{ - { - osl::MutexGuard aGuard( m_aMutex ); - m_bOutputStreamCalled = true; - } - return Reference< XOutputStream >( this ); -} - -// ------------------------------------------------------------------- -// XInputStream -// ------------------------------------------------------------------- - -sal_Int32 SAL_CALL Stream::readBytes( - Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) - throw( NotConnectedException, - BufferSizeExceededException, - IOException, - RuntimeException ) -{ - GnomeVFSResult result; - GnomeVFSFileSize nBytesRead = 0; - - if( ! m_handle ) - throw IOException(); - - if( m_eof ) { - aData.realloc( 0 ); - return 0; - } - - try { - aData.realloc( nBytesToRead ); - } catch ( const Exception &e ) { - throw BufferSizeExceededException(); - } - - do { - result = gnome_vfs_read( m_handle, aData.getArray(), - nBytesToRead, &nBytesRead ); - } while( result == GNOME_VFS_ERROR_INTERRUPTED ); - - if (result != GNOME_VFS_OK && - result != GNOME_VFS_ERROR_EOF) - throwOnError( result ); - - if (result == GNOME_VFS_ERROR_EOF) - m_eof = sal_True; - - aData.realloc( sal::static_int_cast(nBytesRead) ); - - return sal::static_int_cast(nBytesRead); -} - -sal_Int32 SAL_CALL Stream::readSomeBytes( - Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead ) - throw( NotConnectedException, - BufferSizeExceededException, - IOException, - RuntimeException ) -{ - // Again - having 2 methods here just sucks; cf. filinpstr.cxx - // This can never be an effective non-blocking API - so why bother ? - return readBytes( aData, nMaxBytesToRead ); -} - -void SAL_CALL Stream::skipBytes( sal_Int32 nBytesToSkip ) - throw( NotConnectedException, - BufferSizeExceededException, - IOException, - RuntimeException ) -{ - GnomeVFSResult result; - - if( ! m_handle ) - throw IOException(); - - result = gnome_vfs_seek( m_handle, GNOME_VFS_SEEK_CURRENT, nBytesToSkip ); - - if ( result == GNOME_VFS_ERROR_BAD_PARAMETERS || - result == GNOME_VFS_ERROR_NOT_SUPPORTED ) - g_warning ("FIXME: just read them in ..."); - - throwOnError( result ); -} - -sal_Int32 SAL_CALL Stream::available( ) - throw( NotConnectedException, - IOException, - RuntimeException ) -{ - return 0; // cf. filinpstr.cxx -} - -void SAL_CALL Stream::closeInput( void ) - throw( NotConnectedException, - IOException, - RuntimeException ) -{ - osl::MutexGuard aGuard( m_aMutex ); - m_bInputStreamCalled = false; - - if( ! m_bOutputStreamCalled ) - closeStream(); -} - -// ------------------------------------------------------------------- -// XSeekable -// ------------------------------------------------------------------- - -void SAL_CALL Stream::seek( sal_Int64 location ) - throw( ::com::sun::star::lang::IllegalArgumentException, - IOException, - RuntimeException ) -{ - GnomeVFSResult result; - - if( ! m_handle ) - throw IOException(); - - if ( location < 0 ) - throw ::com::sun::star::lang::IllegalArgumentException(); - - m_eof = sal_False; - result = gnome_vfs_seek( m_handle, GNOME_VFS_SEEK_START, location ); - - if (result == GNOME_VFS_ERROR_EOF) - throw ::com::sun::star::lang::IllegalArgumentException(); - - throwOnError( result ); -} - -sal_Int64 SAL_CALL Stream::getPosition() - throw( IOException, - RuntimeException ) -{ - GnomeVFSFileSize nBytesIn = 0; - - if( ! m_handle ) - throw IOException(); - - throwOnError( gnome_vfs_tell( m_handle, &nBytesIn ) ); - - return nBytesIn; -} - -sal_Int64 SAL_CALL Stream::getLength() - throw( IOException, RuntimeException ) -{ - // FIXME: so this sucks; it may be stale but ... - if (m_info.valid_fields & GNOME_VFS_FILE_INFO_FIELDS_SIZE) - return m_info.size; - else { - g_warning ("FIXME: No valid length"); - return 0; - } -} - -// ------------------------------------------------------------------- -// XTruncate -// ------------------------------------------------------------------- - -void SAL_CALL Stream::truncate( void ) - throw( com::sun::star::io::IOException, - com::sun::star::uno::RuntimeException ) -{ - if( ! m_handle ) - throw IOException(); - - throwOnError( gnome_vfs_truncate_handle( m_handle, 0 ) ); -} - -// ------------------------------------------------------------------- -// XOutputStream -// ------------------------------------------------------------------- - -void SAL_CALL Stream::writeBytes( const com::sun::star::uno::Sequence< sal_Int8 >& aData ) - throw( com::sun::star::io::NotConnectedException, - com::sun::star::io::BufferSizeExceededException, - com::sun::star::io::IOException, - com::sun::star::uno::RuntimeException) -{ - GnomeVFSResult result = GNOME_VFS_OK; - GnomeVFSFileSize toWrite = aData.getLength(); - const sal_Int8 *p = aData.getConstArray(); - - if( ! m_handle ) - throw IOException(); - - while( toWrite > 0) { - GnomeVFSFileSize bytesWritten = 0; - - result = gnome_vfs_write( m_handle, p, toWrite, &bytesWritten ); - if( result == GNOME_VFS_ERROR_INTERRUPTED ) - continue; - throwOnError( result ); - g_assert( bytesWritten <= toWrite ); - toWrite -= bytesWritten; - p += bytesWritten; - } -} - -void SAL_CALL Stream::flush( void ) - throw( NotConnectedException, BufferSizeExceededException, - IOException, RuntimeException ) -{ -} - -void SAL_CALL Stream::closeOutput( void ) - throw( com::sun::star::io::NotConnectedException, - com::sun::star::io::IOException, - com::sun::star::uno::RuntimeException ) -{ - osl::MutexGuard aGuard( m_aMutex ); - m_bOutputStreamCalled = false; - - if( ! m_bInputStreamCalled ) - closeStream(); -} - -// ------------------------------------------------------------------- -// Misc. -// ------------------------------------------------------------------- - -void Stream::closeStream( void ) - throw( ::com::sun::star::io::NotConnectedException, - ::com::sun::star::io::IOException, - ::com::sun::star::uno::RuntimeException ) -{ - if (m_handle) { - gnome_vfs_close (m_handle); - m_handle = NULL; - } else - throw IOException(); -} - -void Stream::throwOnError( GnomeVFSResult result ) - throw( NotConnectedException, - BufferSizeExceededException, - IOException, - RuntimeException ) -{ - if( result != GNOME_VFS_OK ) { - ::rtl::OUString aMsg = ::rtl::OUString::createFromAscii - ( gnome_vfs_result_to_string( result ) ); - - g_warning( "Input Stream exceptional result '%s' (%d)", - gnome_vfs_result_to_string( result ), result ); - - throw IOException( aMsg, static_cast< cppu::OWeakObject * >( this ) ); - } -} diff --git a/ucb/source/ucp/gvfs/stream.hxx b/ucb/source/ucp/gvfs/stream.hxx deleted file mode 100644 index 1d22918ce566..000000000000 --- a/ucb/source/ucp/gvfs/stream.hxx +++ /dev/null @@ -1,168 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: stream.hxx,v $ - * $Revision: 1.5 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _GVFSSTREAM_HXX_ -#define _GVFSSTREAM_HXX_ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -namespace gvfs -{ - -class Stream : public ::com::sun::star::io::XStream, - public ::com::sun::star::io::XInputStream, - public ::com::sun::star::io::XOutputStream, - public ::com::sun::star::io::XTruncate, - public ::com::sun::star::io::XSeekable, - public ::cppu::OWeakObject -{ -private: - GnomeVFSHandle *m_handle; - GnomeVFSFileInfo m_info; - osl::Mutex m_aMutex; - sal_Bool m_eof; - sal_Bool m_bInputStreamCalled; - sal_Bool m_bOutputStreamCalled; - - void throwOnError( GnomeVFSResult result ) - throw( ::com::sun::star::io::NotConnectedException, - ::com::sun::star::io::BufferSizeExceededException, - ::com::sun::star::io::IOException, - ::com::sun::star::uno::RuntimeException ); - - void closeStream( void ) - throw( ::com::sun::star::io::NotConnectedException, - ::com::sun::star::io::IOException, - ::com::sun::star::uno::RuntimeException ); - -public: - Stream ( GnomeVFSHandle *handle, - const GnomeVFSFileInfo *aInfo ); - virtual ~Stream(); - - // XInterface - virtual com::sun::star::uno::Any SAL_CALL queryInterface(const ::com::sun::star::uno::Type & type ) - throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL acquire( void ) - throw () - { OWeakObject::acquire(); } - virtual void SAL_CALL release( void ) - throw() - { OWeakObject::release(); } - - // XStream - virtual com::sun::star::uno::Reference< com::sun::star::io::XInputStream > SAL_CALL getInputStream( ) - throw( com::sun::star::uno::RuntimeException ); - - virtual com::sun::star::uno::Reference< com::sun::star::io::XOutputStream > SAL_CALL getOutputStream( ) - throw( com::sun::star::uno::RuntimeException ); - - // XInputStream - virtual sal_Int32 SAL_CALL readBytes( - ::com::sun::star::uno::Sequence< sal_Int8 > & aData, - sal_Int32 nBytesToRead ) - throw( ::com::sun::star::io::NotConnectedException, - ::com::sun::star::io::BufferSizeExceededException, - ::com::sun::star::io::IOException, - ::com::sun::star::uno::RuntimeException ); - - virtual sal_Int32 SAL_CALL readSomeBytes( - ::com::sun::star::uno::Sequence< sal_Int8 > & aData, - sal_Int32 nMaxBytesToRead ) - throw( ::com::sun::star::io::NotConnectedException, - ::com::sun::star::io::BufferSizeExceededException, - ::com::sun::star::io::IOException, - ::com::sun::star::uno::RuntimeException ); - - virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip ) - throw( ::com::sun::star::io::NotConnectedException, - ::com::sun::star::io::BufferSizeExceededException, - ::com::sun::star::io::IOException, - ::com::sun::star::uno::RuntimeException ); - - virtual sal_Int32 SAL_CALL available( void ) - throw( ::com::sun::star::io::NotConnectedException, - ::com::sun::star::io::IOException, - ::com::sun::star::uno::RuntimeException ); - - virtual void SAL_CALL closeInput( void ) - throw( ::com::sun::star::io::NotConnectedException, - ::com::sun::star::io::IOException, - ::com::sun::star::uno::RuntimeException ); - - // XSeekable - virtual void SAL_CALL seek( sal_Int64 location ) - throw( ::com::sun::star::lang::IllegalArgumentException, - ::com::sun::star::io::IOException, - ::com::sun::star::uno::RuntimeException ); - - virtual sal_Int64 SAL_CALL getPosition() - throw( ::com::sun::star::io::IOException, - ::com::sun::star::uno::RuntimeException ); - - virtual sal_Int64 SAL_CALL getLength() - throw( ::com::sun::star::io::IOException, - ::com::sun::star::uno::RuntimeException ); - - // XOutputStream - virtual void SAL_CALL writeBytes( const com::sun::star::uno::Sequence< sal_Int8 >& aData ) - throw( com::sun::star::io::NotConnectedException, - com::sun::star::io::BufferSizeExceededException, - com::sun::star::io::IOException, - com::sun::star::uno::RuntimeException); - - virtual void SAL_CALL flush( void ) - throw( com::sun::star::io::NotConnectedException, - com::sun::star::io::BufferSizeExceededException, - com::sun::star::io::IOException, - com::sun::star::uno::RuntimeException); - - - virtual void SAL_CALL closeOutput( void ) - throw( com::sun::star::io::NotConnectedException, - com::sun::star::io::IOException, - com::sun::star::uno::RuntimeException ); - - // XTruncate - virtual void SAL_CALL truncate( void ) - throw( com::sun::star::io::IOException, - com::sun::star::uno::RuntimeException ); -}; - -} // namespace gvfs -#endif // _GVFSSTREAM_HXX_ -- cgit v1.2.3 From e423f972931e5c31e5e2269e86268df909aa93e0 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Thu, 17 Dec 2009 09:43:51 +0100 Subject: adapted includes to renamed source file names. --- ucb/source/ucp/gvfs/gvfs_content.cxx | 46 ++++++++++++++-------------------- ucb/source/ucp/gvfs/gvfs_directory.cxx | 4 +-- ucb/source/ucp/gvfs/gvfs_directory.hxx | 8 +++--- ucb/source/ucp/gvfs/gvfs_provider.cxx | 4 +-- ucb/source/ucp/gvfs/gvfs_stream.cxx | 8 +++--- 5 files changed, 31 insertions(+), 39 deletions(-) diff --git a/ucb/source/ucp/gvfs/gvfs_content.cxx b/ucb/source/ucp/gvfs/gvfs_content.cxx index 743043c09fc7..76d35dbf5ced 100644 --- a/ucb/source/ucp/gvfs/gvfs_content.cxx +++ b/ucb/source/ucp/gvfs/gvfs_content.cxx @@ -39,9 +39,7 @@ #include "osl/doublecheckedlocking.h" -#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUES_HPP_ #include -#endif #include #include #include @@ -50,14 +48,10 @@ #include #include #include -#ifndef _COM_SUN_STAR_UCB_INTERACTIVEBADTRANSFRERURLEXCEPTION_HPP_ #include -#endif #include #include -#ifndef _COM_SUN_STAR_UCB_INTERACTIVENETWORKGENBERALEXCEPTION_HPP_ #include -#endif #include #include #include @@ -79,9 +73,7 @@ #include #include #include -#ifndef _UCBHELPER_INTERACTIONREQUEST_HXX #include -#endif #include #include @@ -98,10 +90,10 @@ extern "C" { // missing in the header: doh. # include } -#include "content.hxx" -#include "provider.hxx" -#include "directory.hxx" -#include "stream.hxx" +#include "gvfs_content.hxx" +#include "gvfs_provider.hxx" +#include "gvfs_directory.hxx" +#include "gvfs_stream.hxx" using namespace gvfs; using namespace com::sun::star; @@ -487,7 +479,7 @@ Content::createNewContent( const ucb::ContentInfo& Info ) bool create_document; const char *name; - if ( Info.Type.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( GVFS_FILE_TYPE ) ) ) + if ( Info.Type.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( GVFS_FILE_TYPE ) ) ) create_document = true; else if ( Info.Type.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( GVFS_FOLDER_TYPE ) ) ) create_document = false; @@ -515,11 +507,11 @@ Content::createNewContent( const ucb::ContentInfo& Info ) uno::Reference< ucb::XContentIdentifier > xId ( new ::ucbhelper::ContentIdentifier( m_xSMgr, aURL ) ); - try { + try { return new ::gvfs::Content( m_xSMgr, m_pProvider, xId, !create_document ); } catch ( ucb::ContentCreationException & ) { return uno::Reference< ucb::XContent >(); - } + } } rtl::OUString Content::getParentURL() @@ -757,7 +749,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( getInfo( xEnv ); - osl::ClearableGuard< osl::Mutex > aGuard( m_aMutex ); + osl::ClearableGuard< osl::Mutex > aGuard( m_aMutex ); gnome_vfs_file_info_copy( &newInfo, &m_info ); @@ -769,16 +761,16 @@ uno::Sequence< uno::Any > Content::setPropertyValues( beans::PropertyChangeEvent aEvent; aEvent.Source = static_cast< cppu::OWeakObject * >( this ); - aEvent.Further = sal_False; - aEvent.PropertyHandle = -1; - // aEvent.PropertyName = fill in later ... - // aEvent.OldValue = - // aEvent.NewValue = + aEvent.Further = sal_False; + aEvent.PropertyHandle = -1; + // aEvent.PropertyName = fill in later ... + // aEvent.OldValue = + // aEvent.NewValue = - int nCount = rValues.getLength(); + int nCount = rValues.getLength(); const beans::PropertyValue* pValues = rValues.getConstArray(); - for ( sal_Int32 n = 0; n < nCount; ++n ) { + for ( sal_Int32 n = 0; n < nCount; ++n ) { const beans::PropertyValue& rValue = pValues[ n ]; #ifdef DEBUG @@ -919,7 +911,7 @@ void Content::insert( const uno::Reference< ucb::XCommandEnvironment > &xEnv ) throw( uno::Exception ) { - osl::ClearableGuard< osl::Mutex > aGuard( m_aMutex ); + osl::ClearableGuard< osl::Mutex > aGuard( m_aMutex ); #ifdef DEBUG g_warning( "Insert '%s' (%d) (0x%x:%d)", getURI(), bReplaceExisting, @@ -1004,9 +996,9 @@ void Content::insert( } if (m_bTransient) { - m_bTransient = sal_False; + m_bTransient = sal_False; aGuard.clear(); - inserted(); + inserted(); } } @@ -1380,7 +1372,7 @@ uno::Sequence< ucb::CommandInfo > Content::getCommands( }; int num = 7; - if ( isFolder( xEnv ) ) + if ( isFolder( xEnv ) ) num += 1; return uno::Sequence< ucb::CommandInfo >(aDocumentCommandInfoTable, num ); diff --git a/ucb/source/ucp/gvfs/gvfs_directory.cxx b/ucb/source/ucp/gvfs/gvfs_directory.cxx index 19ace5ebf162..d8357a060a3e 100644 --- a/ucb/source/ucp/gvfs/gvfs_directory.cxx +++ b/ucb/source/ucp/gvfs/gvfs_directory.cxx @@ -40,7 +40,7 @@ #include #include -#include "directory.hxx" +#include "gvfs_directory.hxx" #include #include @@ -96,7 +96,7 @@ struct ResultListEntry gnome_vfs_file_info_copy (&aInfo, fileInfo); } - ~ResultListEntry() + ~ResultListEntry() { gnome_vfs_file_info_clear (&aInfo); } diff --git a/ucb/source/ucp/gvfs/gvfs_directory.hxx b/ucb/source/ucp/gvfs/gvfs_directory.hxx index b3513c2d6048..929eae9b18eb 100644 --- a/ucb/source/ucp/gvfs/gvfs_directory.hxx +++ b/ucb/source/ucp/gvfs/gvfs_directory.hxx @@ -33,7 +33,7 @@ #include #include #include -#include "content.hxx" +#include "gvfs_content.hxx" namespace gvfs { @@ -44,11 +44,11 @@ class DynamicResultSet : public ::ucbhelper::ResultSetImplHelper com::sun::star::ucb::XCommandEnvironment > m_xEnv; private: - virtual void initStatic(); - virtual void initDynamic(); + virtual void initStatic(); + virtual void initDynamic(); public: - DynamicResultSet( const com::sun::star::uno::Reference< + DynamicResultSet( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rxSMgr, const rtl::Reference< Content >& rxContent, const com::sun::star::ucb::OpenCommandArgument2& rCommand, diff --git a/ucb/source/ucp/gvfs/gvfs_provider.cxx b/ucb/source/ucp/gvfs/gvfs_provider.cxx index c342fe2a6f63..a5eca1daddd4 100644 --- a/ucb/source/ucp/gvfs/gvfs_provider.cxx +++ b/ucb/source/ucp/gvfs/gvfs_provider.cxx @@ -33,8 +33,8 @@ #include #include -#include "provider.hxx" -#include "content.hxx" +#include "gvfs_provider.hxx" +#include "gvfs_content.hxx" using namespace com::sun::star; using namespace gvfs; diff --git a/ucb/source/ucp/gvfs/gvfs_stream.cxx b/ucb/source/ucp/gvfs/gvfs_stream.cxx index 364108746f7b..007693d46a3a 100644 --- a/ucb/source/ucp/gvfs/gvfs_stream.cxx +++ b/ucb/source/ucp/gvfs/gvfs_stream.cxx @@ -30,7 +30,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_ucb.hxx" -#include "stream.hxx" +#include "gvfs_stream.hxx" #include #include @@ -187,9 +187,9 @@ sal_Int32 SAL_CALL Stream::available( ) } void SAL_CALL Stream::closeInput( void ) - throw( NotConnectedException, - IOException, - RuntimeException ) + throw( NotConnectedException, + IOException, + RuntimeException ) { osl::MutexGuard aGuard( m_aMutex ); m_bInputStreamCalled = false; -- cgit v1.2.3 From 0a67aa3e1d1ef59aba16ca7f7029cb9c51d8b531 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 17 Dec 2009 12:42:19 +0000 Subject: cmcfixes69: #i107566# make prelink and libgcc_s tests Linux-only --- configure.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 3505be436cf6..264bd2df8314 100644 --- a/configure.in +++ b/configure.in @@ -3583,7 +3583,7 @@ AC_SUBST(BUILD_QADEVOOO) dnl =================================================================== dnl Check for prelinked libgcc_s.so.1 dnl =================================================================== -if test -z "$with_system_stdlibs" -a -z "$with_system_libs"; then +if test "$_os" = "Linux" -a -z "$with_system_stdlibs" -a -z "$with_system_libs"; then if test -n "$checkforstdlibproblems"; then if test -f /etc/rpm/macros.prelink; then with_system_stdlibs=yes -- cgit v1.2.3 From 3cc45b023a837467786ad5151f630994961a238d Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Thu, 17 Dec 2009 14:14:43 +0100 Subject: whitespace cleanup. --- ucb/source/ucp/gvfs/gvfs_content.hxx | 78 ++++++++++++++++++------------------ 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/ucb/source/ucp/gvfs/gvfs_content.hxx b/ucb/source/ucp/gvfs/gvfs_content.hxx index cd6701b8c742..294d572ff175 100644 --- a/ucb/source/ucp/gvfs/gvfs_content.hxx +++ b/ucb/source/ucp/gvfs/gvfs_content.hxx @@ -82,11 +82,11 @@ class Content : public ::ucbhelper::ContentImplHelper, public com::sun::star::ucb::XContentCreator { //========================================================================= -// Internals +// Internals //========================================================================= private: typedef rtl::Reference< Content > ContentRef; - typedef std::list< ContentRef > ContentRefList; + typedef std::list< ContentRef > ContentRefList; // Instance data ContentProvider *m_pProvider; // No need for a ref, base class holds object @@ -98,7 +98,7 @@ private: ::com::sun::star::uno::Any getBadArgExcept (); GnomeVFSResult getInfo ( const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >& xEnv ); - sal_Bool isFolder ( const ::com::sun::star::uno::Reference< + sal_Bool isFolder ( const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >& xEnv ); sal_Bool exchangeIdentity( const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContentIdentifier >& xNewId); @@ -110,7 +110,7 @@ private: // End Internal helpers // For ucbhelper - virtual ::rtl::OUString getParentURL(); + virtual ::rtl::OUString getParentURL(); // For ucbhelper virtual com::sun::star::uno::Sequence< com::sun::star::beans::Property > getProperties( const com::sun::star::uno::Reference< @@ -122,8 +122,8 @@ private: public: // Command "getPropertyValues" - ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow > - getPropertyValues( const ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow > + getPropertyValues( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& rProperties, const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >& xEnv ); @@ -136,22 +136,22 @@ private: const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >& xEnv ); - // Command "insert" - void insert( const ::com::sun::star::uno::Reference< + // Command "insert" + void insert( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > & xInputStream, - sal_Bool bReplaceExisting, - const com::sun::star::uno::Reference< - com::sun::star::ucb::XCommandEnvironment >& xEnv ) + sal_Bool bReplaceExisting, + const com::sun::star::uno::Reference< + com::sun::star::ucb::XCommandEnvironment >& xEnv ) throw( ::com::sun::star::uno::Exception ); // Command "transfer" void transfer( const ::com::sun::star::ucb::TransferInfo & rArgs, const com::sun::star::uno::Reference< - com::sun::star::ucb::XCommandEnvironment >& xEnv ) + com::sun::star::ucb::XCommandEnvironment >& xEnv ) throw( ::com::sun::star::uno::Exception ); // Command "delete" - void destroy( sal_Bool bDeletePhysical ) + void destroy( sal_Bool bDeletePhysical ) throw( ::com::sun::star::uno::Exception ); // "open" helpers @@ -170,12 +170,12 @@ private: createInputStream( const ::com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment >& xEnv ) throw( ::com::sun::star::uno::Exception ); - sal_Bool feedSink( ::com::sun::star::uno::Reference< + sal_Bool feedSink( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> aSink, const ::com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment >& xEnv ); - ::com::sun::star::uno::Any mapVFSException( const GnomeVFSResult result, + ::com::sun::star::uno::Any mapVFSException( const GnomeVFSResult result, sal_Bool bWrite ); void cancelCommandExecution(const GnomeVFSResult result, @@ -192,27 +192,27 @@ public: rtl::OUString getOUURI (); //========================================================================= -// Externals +// Externals //========================================================================= public: - Content( const ::com::sun::star::uno::Reference< + Content( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr, ContentProvider *pProvider, const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContentIdentifier >& Identifier) throw ( ::com::sun::star::ucb::ContentCreationException ); - Content( const ::com::sun::star::uno::Reference< + Content( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rxSMgr, ContentProvider *pProvider, const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContentIdentifier >& Identifier, sal_Bool isFolder) throw ( ::com::sun::star::ucb::ContentCreationException ); - virtual ~Content(); + virtual ~Content(); - // XInterface - XINTERFACE_DECL() + // XInterface + XINTERFACE_DECL() // XTypeProvider XTYPEPROVIDER_DECL() @@ -220,40 +220,40 @@ public: // XServiceInfo virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL - getSupportedServiceNames() + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException ); - // XContent - virtual rtl::OUString SAL_CALL - getContentType() + // XContent + virtual rtl::OUString SAL_CALL + getContentType() throw( com::sun::star::uno::RuntimeException ); - // XCommandProcessor - virtual com::sun::star::uno::Any SAL_CALL - execute( const com::sun::star::ucb::Command& aCommand, + // XCommandProcessor + virtual com::sun::star::uno::Any SAL_CALL + execute( const com::sun::star::ucb::Command& aCommand, sal_Int32 CommandId, const com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment >& xEnv ) throw( com::sun::star::uno::Exception, com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL - abort( sal_Int32 CommandId ) + virtual void SAL_CALL + abort( sal_Int32 CommandId ) throw( com::sun::star::uno::RuntimeException ); - ////////////////////////////////////////////////////////////////////// - // Additional interfaces - ////////////////////////////////////////////////////////////////////// + ////////////////////////////////////////////////////////////////////// + // Additional interfaces + ////////////////////////////////////////////////////////////////////// - // XContentCreator + // XContentCreator virtual com::sun::star::uno::Sequence< com::sun::star::ucb::ContentInfo > SAL_CALL - queryCreatableContentsInfo() + queryCreatableContentsInfo() throw( com::sun::star::uno::RuntimeException ); - virtual com::sun::star::uno::Reference< - com::sun::star::ucb::XContent > SAL_CALL - createNewContent( const com::sun::star::ucb::ContentInfo& Info ) + virtual com::sun::star::uno::Reference< + com::sun::star::ucb::XContent > SAL_CALL + createNewContent( const com::sun::star::ucb::ContentInfo& Info ) throw( com::sun::star::uno::RuntimeException ); }; -- cgit v1.2.3 From 723b53e66635c03bc4dc4bb0d945867c91672e12 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 17 Dec 2009 13:56:08 +0000 Subject: cmcfixes69: #i106157#: workaround graphite stl/stlport issues --- vcl/inc/vcl/graphite_adaptors.hxx | 5 +++-- vcl/inc/vcl/graphite_features.hxx | 3 ++- vcl/inc/vcl/graphite_layout.hxx | 2 ++ vcl/source/glyphs/graphite_adaptors.cxx | 2 +- vcl/source/glyphs/graphite_cache.cxx | 2 ++ vcl/source/glyphs/graphite_features.cxx | 6 +++--- vcl/source/glyphs/graphite_layout.cxx | 10 ++++++---- vcl/source/glyphs/graphite_textsrc.cxx | 10 +++++----- vcl/source/glyphs/graphite_textsrc.hxx | 4 +++- vcl/util/makefile2.pmk | 7 +++++++ 10 files changed, 34 insertions(+), 17 deletions(-) diff --git a/vcl/inc/vcl/graphite_adaptors.hxx b/vcl/inc/vcl/graphite_adaptors.hxx index 41ffa00b0f8f..9a0a42c01ce0 100644 --- a/vcl/inc/vcl/graphite_adaptors.hxx +++ b/vcl/inc/vcl/graphite_adaptors.hxx @@ -58,10 +58,11 @@ #include "vcl/dllapi.h" // Libraries +#include "pregraphitestl.h" #include #include #include - +#include "postgraphitestl.h" // Module type definitions and forward declarations. // @@ -121,7 +122,7 @@ public: const grutils::GrFeatureParser * features() const { return mpFeatures; }; private: - virtual void UniqueCacheInfo(std::wstring &, bool &, bool &); + virtual void UniqueCacheInfo(sil_std::wstring &, bool &, bool &); FreetypeServerFont& mrFont; FontProperties maFontProperties; diff --git a/vcl/inc/vcl/graphite_features.hxx b/vcl/inc/vcl/graphite_features.hxx index 6cfe5dfca0fd..d3cfd99e0fe4 100644 --- a/vcl/inc/vcl/graphite_features.hxx +++ b/vcl/inc/vcl/graphite_features.hxx @@ -32,10 +32,11 @@ // Parse a string of features specified as ; separated pairs. // e.g. // 1001=1&2002=2&fav1=0 - +#include "pregraphitestl.h" #include #include #include +#include "postgraphitestl.h" namespace grutils { diff --git a/vcl/inc/vcl/graphite_layout.hxx b/vcl/inc/vcl/graphite_layout.hxx index 2ec3bc4c2391..325f67e852ce 100644 --- a/vcl/inc/vcl/graphite_layout.hxx +++ b/vcl/inc/vcl/graphite_layout.hxx @@ -43,11 +43,13 @@ #include #include // Libraries +#include "pregraphitestl.h" #include #include #include #include #include +#include "postgraphitestl.h" // Platform #include #include diff --git a/vcl/source/glyphs/graphite_adaptors.cxx b/vcl/source/glyphs/graphite_adaptors.cxx index 34e2f5f5bbe3..6c9d97e356b1 100644 --- a/vcl/source/glyphs/graphite_adaptors.cxx +++ b/vcl/source/glyphs/graphite_adaptors.cxx @@ -171,7 +171,7 @@ GraphiteFontAdaptor::~GraphiteFontAdaptor() throw() mpFeatures = NULL; } -void GraphiteFontAdaptor::UniqueCacheInfo(std::wstring & face_name_out, bool & bold_out, bool & italic_out) +void GraphiteFontAdaptor::UniqueCacheInfo(sil_std::wstring & face_name_out, bool & bold_out, bool & italic_out) { face_name_out = maFontProperties.szFaceName; bold_out = maFontProperties.fBold; diff --git a/vcl/source/glyphs/graphite_cache.cxx b/vcl/source/glyphs/graphite_cache.cxx index 8c514c611d2c..a2c245e21774 100644 --- a/vcl/source/glyphs/graphite_cache.cxx +++ b/vcl/source/glyphs/graphite_cache.cxx @@ -36,8 +36,10 @@ #include #include +#include "pregraphitestl.h" #include #include +#include "postgraphitestl.h" #include #include diff --git a/vcl/source/glyphs/graphite_features.cxx b/vcl/source/glyphs/graphite_features.cxx index dae1bfc2866e..b26397aa43e5 100644 --- a/vcl/source/glyphs/graphite_features.cxx +++ b/vcl/source/glyphs/graphite_features.cxx @@ -91,7 +91,7 @@ GrFeatureParser::GrFeatureParser(gr::Font & font, const std::string features, co gr::isocode aLang = maLang; for (size_t i = pos; i < nFeatEnd; i++) aLang.rgch[i-pos] = features[i]; - std::pair aSupported + sil_std::pair aSupported = font.getSupportedLanguages(); gr::LanguageIterator iL = aSupported.first; while (iL != aSupported.second) @@ -142,7 +142,7 @@ void GrFeatureParser::setLang(gr::Font & font, const std::string & lang) if (lang[i] == '-') break; aLang.rgch[i] = lang[i]; } - std::pair aSupported + sil_std::pair aSupported = font.getSupportedLanguages(); gr::LanguageIterator iL = aSupported.first; while (iL != aSupported.second) @@ -189,7 +189,7 @@ bool GrFeatureParser::isValid(gr::Font & font, gr::FeatureSetting & setting) { return false; } - std::pair< gr::FeatureSettingIterator, gr::FeatureSettingIterator > + sil_std::pair< gr::FeatureSettingIterator, gr::FeatureSettingIterator > validValues = font.getFeatureSettings(i); gr::FeatureSettingIterator j = validValues.first; while (j != validValues.second) diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx index 86dee2749efa..0ef8b8ec098f 100644 --- a/vcl/source/glyphs/graphite_layout.cxx +++ b/vcl/source/glyphs/graphite_layout.cxx @@ -66,11 +66,13 @@ #include // Graphite Libraries (must be after vcl headers on windows) +#include "pregraphitestl.h" #include #include #include #include #include +#include "postgraphitestl.h" #include #include @@ -105,8 +107,8 @@ FILE * grLog() namespace { - typedef std::pair glyph_range_t; - typedef std::pair glyph_set_range_t; + typedef sil_std::pair glyph_range_t; + typedef sil_std::pair glyph_set_range_t; inline long round(const float n) { return long(n + (n < 0 ? -0.5 : 0.5)); @@ -171,7 +173,7 @@ GraphiteLayout::Glyphs::fill_from(gr::Segment & rSegment, ImplLayoutArgs &rArgs, bool bRtl, long &rWidth, float fScaling, std::vector & rChar2Base, std::vector & rGlyph2Char, std::vector & rCharDxs) { // Create a glyph item for each of the glyph and append it to the base class glyph list. - typedef std::pair< gr::GlyphSetIterator, gr::GlyphSetIterator > GrGlyphSet; + typedef sil_std::pair< gr::GlyphSetIterator, gr::GlyphSetIterator > GrGlyphSet; int nChar = rArgs.mnEndCharPos - rArgs.mnMinCharPos; glyph_range_t iGlyphs = rSegment.glyphs(); int nGlyphs = iGlyphs.second - iGlyphs.first; @@ -586,7 +588,7 @@ public: sal_Int32 hashCode(const grutils::GrFeatureParser * mpFeatures) { // is this sufficient? - std::wstring aFace; + sil_std::wstring aFace; bool bBold; bool bItalic; UniqueCacheInfo(aFace, bBold, bItalic); diff --git a/vcl/source/glyphs/graphite_textsrc.cxx b/vcl/source/glyphs/graphite_textsrc.cxx index adc2ae99c4f8..cbbd386e734a 100644 --- a/vcl/source/glyphs/graphite_textsrc.cxx +++ b/vcl/source/glyphs/graphite_textsrc.cxx @@ -138,16 +138,16 @@ gr::isocode TextSourceAdaptor::getLanguage(gr::toffset) return unknown; } -std::pair TextSourceAdaptor::propertyRange(gr::toffset nCharIdx) +sil_std::pair TextSourceAdaptor::propertyRange(gr::toffset nCharIdx) { if (nCharIdx < unsigned(maLayoutArgs.mnMinCharPos)) - return std::make_pair(0, maLayoutArgs.mnMinCharPos); + return sil_std::make_pair(0, maLayoutArgs.mnMinCharPos); if (nCharIdx < mnEnd) - return std::make_pair(maLayoutArgs.mnMinCharPos, mnEnd); + return sil_std::make_pair(maLayoutArgs.mnMinCharPos, mnEnd); - return std::make_pair(mnEnd, maLayoutArgs.mnLength); + return sil_std::make_pair(mnEnd, maLayoutArgs.mnLength); } size_t TextSourceAdaptor::getFontFeatures(gr::toffset, gr::FeatureSetting * settings) @@ -159,7 +159,7 @@ size_t TextSourceAdaptor::getFontFeatures(gr::toffset, gr::FeatureSetting * sett bool TextSourceAdaptor::sameSegment(gr::toffset char_idx1, gr::toffset char_idx2) { - const std::pair + const sil_std::pair range1 = propertyRange(char_idx1), range2 = propertyRange(char_idx2); diff --git a/vcl/source/glyphs/graphite_textsrc.hxx b/vcl/source/glyphs/graphite_textsrc.hxx index 6f701988bb01..62d951c3f950 100644 --- a/vcl/source/glyphs/graphite_textsrc.hxx +++ b/vcl/source/glyphs/graphite_textsrc.hxx @@ -62,9 +62,11 @@ #include "vcl/dllapi.h" // Libraries +#include "pregraphitestl.h" #include #include #include +#include "postgraphitestl.h" // Module type definitions and forward declarations. // @@ -91,7 +93,7 @@ public: virtual float getVerticalOffset(gr::toffset ich); virtual gr::isocode getLanguage(gr::toffset ich); - virtual std::pair propertyRange(gr::toffset ich); + virtual sil_std::pair propertyRange(gr::toffset ich); virtual size_t getFontFeatures(gr::toffset ich, gr::FeatureSetting * prgfset); virtual bool sameSegment(gr::toffset ich1, gr::toffset ich2); diff --git a/vcl/util/makefile2.pmk b/vcl/util/makefile2.pmk index 63b2889bc15d..cb13e3b42743 100644 --- a/vcl/util/makefile2.pmk +++ b/vcl/util/makefile2.pmk @@ -36,3 +36,10 @@ VISIBILITY_HIDDEN=TRUE .IF "$(GUIBASE)"=="aqua" CFLAGSCXX+=$(OBJCXXFLAGS) .ENDIF # "$(GUIBASE)"=="aqua" + +#building with stlport, but graphite was not built with stlport +.IF "$(USE_SYSTEM_STL)"!="YES" +.IF "$(SYSTEM_GRAPHITE)"=="YES" +CDEFS += -DGRAPHITEADAPTSTL +.ENDIF +.ENDIF -- cgit v1.2.3 From a95d5c042b8c53ae15a441a5e43febaa04a02055 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 17 Dec 2009 13:56:08 +0000 Subject: cmcfixes69: #i106157#: workaround graphite stl/stlport issues --- configure | 26145 ++++++++++++++++++++++----------------------------------- configure.in | 6 - 2 files changed, 9925 insertions(+), 16226 deletions(-) diff --git a/configure b/configure index a386d0c426a8..7abdef2b06bf 100755 --- a/configure +++ b/configure @@ -1,82 +1,416 @@ #! /bin/sh # From configure.in Revision: 1.290 . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59. +# Generated by GNU Autoconf 2.65. +# +# +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# # -# Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac fi -DUALCASE=1; export DUALCASE # for MKS sh -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } fi -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + # We cannot yet assume a decent shell, so we have to provide a + # neutralization value for shells without unset; and this also + # works around shells that cannot unset nonexistent variables. + BASH_ENV=/dev/null + ENV=/dev/null + (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." else - $as_unset $as_var + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." fi -done + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error ERROR [LINENO LOG_FD] +# --------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with status $?, using 1 if that was 0. +as_fn_error () +{ + as_status=$?; test $as_status -eq 0 && as_status=1 + if test "$3"; then + as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + fi + $as_echo "$as_me: error: $1" >&2 + as_fn_exit $as_status +} # as_fn_error -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi -# Name of the executable. -as_me=`$as_basename "$0" || +as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` - -# PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' @@ -84,146 +418,107 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } - -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file else - as_expr=false + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null fi - -rm -f conf$$ conf$$.exe conf$$.file -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' fi -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then - as_mkdir_p=: + as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi -as_executable_p="test -f" +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -232,38 +527,25 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - +test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` -exec 6>&1 - # # Initializations. # ac_default_prefix=/usr/local +ac_clean_files= ac_config_libobj_dir=. +LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} - -# Maximum number of lines to put in a shell here document. -# This variable seems obsolete. It should probably be removed, and -# only ac_max_sed_lines should be used. -: ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME= @@ -271,50 +553,630 @@ PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= +PACKAGE_URL= # Factoring default headers for most tests. ac_includes_default="\ #include -#if HAVE_SYS_TYPES_H +#ifdef HAVE_SYS_TYPES_H # include #endif -#if HAVE_SYS_STAT_H +#ifdef HAVE_SYS_STAT_H # include #endif -#if STDC_HEADERS +#ifdef STDC_HEADERS # include # include #else -# if HAVE_STDLIB_H +# ifdef HAVE_STDLIB_H # include # endif #endif -#if HAVE_STRING_H -# if !STDC_HEADERS && HAVE_MEMORY_H +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif -#if HAVE_STRINGS_H +#ifdef HAVE_STRINGS_H # include #endif -#if HAVE_INTTYPES_H +#ifdef HAVE_INTTYPES_H # include -#else -# if HAVE_STDINT_H -# include -# endif #endif -#if HAVE_UNISTD_H +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS EGREP AWK SED LOCAL_SOLENV _solenv UPD SOURCEVERSION build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os GNUTAR OSVERSION PTHREAD_CFLAGS PTHREAD_LIBS ENABLE_CRASHDUMP VC_STANDARD ENABLE_WERROR ENABLE_DEBUG PRODUCT PROFULLSWITCH PROEXT ENABLE_SYMBOLS DISABLE_STRIP ENABLE_CUPS ENABLE_FONTCONFIG WITH_BINFILTER ENABLE_DIRECTX DISABLE_ACTIVEX DISABLE_ATL ENABLE_RPATH WITH_MYSPELL_DICTS SYSTEM_DICTS DICT_SYSTEM_DIR HYPH_SYSTEM_DIR THES_SYSTEM_DIR USE_SHELL WITH_MINGWIN SHELLPATH GCC_HOME CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT COMPATH GCCVER HAVE_LD_BSYMBOLIC_FUNCTIONS ENABLE_PCH NO_HIDS GNUMAKE _cc HAVE_LD_HASH_STYLE PERL MSPDB_PATH COMEX USE_MINGW MIDL_PATH CSC_PATH FRAME_HOME CPP CXX CXXFLAGS ac_ct_CXX CXXCPP SIZEOF_LONG WORDS_BIGENDIAN LFS_CFLAGS ENABLE_VBA VBA_EXTENSION PAM NEW_SHADOW_API PAM_LINK CRYPT_LINK GXX_INCLUDE_PATH MINGW_LIB_INCLUDE_PATH MINGW_BACKWARD_INCLUDE_PATH MINGW_CLIB_DIR MINGW_SHARED_GCCLIB MINGW_GCCLIB_EH MINGW_SHARED_GXXLIB MINGW_GCCDLL MINGW_GXXDLL EXCEPTIONS STLPORT4 STLPORT_VER USE_SYSTEM_STL USE_CCACHE CCACHE HAVE_GCC_VISIBILITY_FEATURE ALLOC BUILD_VER_STRING SOLAR_JAVA JAVAINTERPRETER JAVACOMPILER JAVACISGCJ JAVADOC AWTLIB JAVAAOTCOMPILER JAVA_HOME JDK JAVAFLAGS DMAKE BUILD_DMAKE EPM DPKG PKGMK BUILD_EPM PKGFORMAT RPM GPERF MINGWCXX ac_ct_MINGWCXX MINGWSTRIP ac_ct_MINGWSTRIP BUILD_UNOWINREG BUILD_QADEVOOO SYSTEM_STDLIBS SYSTEM_ZLIB SYSTEM_JPEG SYSTEM_EXPAT PKG_CONFIG LIBWPD_CFLAGS LIBWPD_LIBS SYSTEM_LIBWPD FREETYPE_CFLAGS FREETYPE_LIBS USE_FT_EMBOLDEN LIBXSLT_CFLAGS LIBXSLT_LIBS XSLTPROC SYSTEM_LIBXSLT LIBXML_CFLAGS LIBXML_LIBS SYSTEM_LIBXML PYTHON PYTHON_VERSION PYTHON_PREFIX PYTHON_EXEC_PREFIX PYTHON_PLATFORM pythondir pkgpythondir pyexecdir pkgpyexecdir BZIP2 SYSTEM_PYTHON PYTHON_CFLAGS PYTHON_LIBS HOME SYSTEM_DB DB_VERSION DB_INCLUDES DB_JAR SYSTEM_LUCENE LUCENE_CORE_JAR LUCENE_ANALYZERS_JAR SYSTEM_HSQLDB HSQLDB_JAR SYSTEM_BSH BSH_JAR SERIALIZER_JAR SYSTEM_SAXON SAXON_JAR CURLCONFIG SYSTEM_CURL CURL_CFLAGS CURL_LIBS SYSTEM_BOOST SYSTEM_VIGRA SYSTEM_ODBC_HEADERS WITH_MOZILLA WITH_LDAP WITH_OPENLDAP MOZ_NSS_CFLAGS MOZ_NSS_LIBS NSS_LIB MOZ_NSPR_CFLAGS MOZ_NSPR_LIBS NSPR_LIB MOZILLAXPCOM_CFLAGS MOZILLAXPCOM_LIBS MOZILLA_VERSION MOZILLA_TOOLKIT MOZGTK2_CFLAGS MOZGTK2_LIBS MOZLIBREQ_CFLAGS MOZLIBREQ_LIBS BUILD_MOZAB ENABLE_NSS_MODULE MOZILLABUILD SYSTEM_MOZILLA MOZ_FLAVOUR MOZ_INC MOZ_LIB MOZ_LIB_XPCOM MOZ_LDAP_CFLAGS SYSTEM_SANE_HEADER SYSTEM_GENBRK SYSTEM_GENCCODE SYSTEM_GENCMN SYSTEM_ICU GRAPHITE_CFLAGS GRAPHITE_LIBS ENABLE_GRAPHITE SYSTEM_GRAPHITE X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS XINC XLIB XAU_LIBS DISABLE_XAW SYSTEM_XRENDER_HEADERS XRENDER_LINK XRANDR_CFLAGS XRANDR_LIBS XRANDR_DLOPEN ENABLE_RANDR DISABLE_NEON NEON_CFLAGS NEON_LIBS SYSTEM_NEON NEON_VERSION OPENSSL_CFLAGS OPENSSL_LIBS SYSTEM_OPENSSL ENABLE_AGG AGG_CFLAGS AGG_LIBS SYSTEM_AGG AGG_VERSION REDLAND_CFLAGS REDLAND_LIBS SYSTEM_REDLAND HUNSPELL_CFLAGS HUNSPELL_LIBS SYSTEM_HUNSPELL SYSTEM_HYPH HYPHEN_LIB SYSTEM_MYTHES SYSTEM_LPSOLVE PSDK_HOME WINDOWS_VISTA_PSDK DIRECTXSDK_HOME DIRECTXSDK_LIB NSIS_PATH BISON FLEX PATCH GNUCP GNUPATCH CYGWIN_PATH ML_EXE ASM_HOME ZIP UNZIP ZIP_HOME ENABLE_GTK ENABLE_KDE ENABLE_KDE4 GCONF_CFLAGS GCONF_LIBS ENABLE_GCONF GNOMEVFS_CFLAGS GNOMEVFS_LIBS ENABLE_GNOMEVFS GTK_CFLAGS GTK_LIBS DBUS_CFLAGS DBUS_LIBS GIO_CFLAGS GIO_LIBS ENABLE_GIO ENABLE_DBUS ENABLE_SYSTRAY_GTK CAIRO_CFLAGS CAIRO_LIBS ENABLE_CAIRO BUILD_PIXMAN SYSTEM_CAIRO ENABLE_OPENGL ENABLE_MINIMIZER ENABLE_PRESENTER_SCREEN POPPLER_CFLAGS POPPLER_LIBS ENABLE_PDFIMPORT SYSTEM_POPPLER ENABLE_MEDIAWIKI SYSTEM_SERVLETAPI SERVLETAPI_JAR ENABLE_REPORTBUILDER SYSTEM_JFREEREPORT SAC_JAR LIBXML_JAR FLUTE_JAR JFREEREPORT_JAR LIBBASE_JAR LIBLAYOUT_JAR LIBLOADER_JAR LIBFORMULA_JAR LIBREPOSITORY_JAR LIBFONTS_JAR LIBSERIALIZER_JAR SYSTEM_APACHE_COMMONS COMMONS_CODEC_JAR COMMONS_LANG_JAR COMMONS_HTTPCLIENT_JAR COMMONS_LOGGING_JAR MOC KDE_CFLAGS KDE_LIBS MOC4 KDE4_CFLAGS KDE4_LIBS ENABLE_LOCKDOWN GOBJECT_CFLAGS GOBJECT_LIBS ENABLE_EVOAB2 ENABLE_KAB WITH_FONTOOO SYSTEM_MSPACK WITH_FONTS WITHOUT_PPDS WITHOUT_AFMS SCPDEFS USE_XINERAMA XINERAMA_LINK ANT ANT_HOME ANT_LIB WITH_LANG WITH_POOR_HELP_LOCALIZATIONS WITH_DICT INTRO_BITMAPS ABOUT_BITMAPS OOO_VENDOR UNIXWRAPPERNAME ENABLE_STATIC_GTK ENABLE_LAYOUT VERBOSE LOCAL_SOLVER BUILD_TYPE LIBOBJS LTLIBOBJS' +ac_subst_vars='LTLIBOBJS +LIBOBJS +BUILD_TYPE +LOCAL_SOLVER +VERBOSE +ENABLE_LAYOUT +ENABLE_STATIC_GTK +UNIXWRAPPERNAME +OOO_VENDOR +ABOUT_BITMAPS +INTRO_BITMAPS +WITH_DICT +WITH_POOR_HELP_LOCALIZATIONS +WITH_LANG +ANT_LIB +ANT_HOME +ANT +XINERAMA_LINK +USE_XINERAMA +SCPDEFS +WITHOUT_AFMS +WITHOUT_PPDS +WITH_FONTS +SYSTEM_MSPACK +WITH_FONTOOO +ENABLE_KAB +ENABLE_EVOAB2 +GOBJECT_LIBS +GOBJECT_CFLAGS +ENABLE_LOCKDOWN +KDE4_LIBS +KDE4_CFLAGS +MOC4 +KDE_LIBS +KDE_CFLAGS +MOC +COMMONS_LOGGING_JAR +COMMONS_HTTPCLIENT_JAR +COMMONS_LANG_JAR +COMMONS_CODEC_JAR +SYSTEM_APACHE_COMMONS +LIBSERIALIZER_JAR +LIBFONTS_JAR +LIBREPOSITORY_JAR +LIBFORMULA_JAR +LIBLOADER_JAR +LIBLAYOUT_JAR +LIBBASE_JAR +JFREEREPORT_JAR +FLUTE_JAR +LIBXML_JAR +SAC_JAR +SYSTEM_JFREEREPORT +ENABLE_REPORTBUILDER +SERVLETAPI_JAR +SYSTEM_SERVLETAPI +ENABLE_MEDIAWIKI +SYSTEM_POPPLER +ENABLE_PDFIMPORT +POPPLER_LIBS +POPPLER_CFLAGS +ENABLE_PRESENTER_SCREEN +ENABLE_MINIMIZER +ENABLE_OPENGL +SYSTEM_CAIRO +BUILD_PIXMAN +ENABLE_CAIRO +CAIRO_LIBS +CAIRO_CFLAGS +ENABLE_SYSTRAY_GTK +ENABLE_DBUS +ENABLE_GIO +GIO_LIBS +GIO_CFLAGS +DBUS_LIBS +DBUS_CFLAGS +GTK_LIBS +GTK_CFLAGS +ENABLE_GNOMEVFS +GNOMEVFS_LIBS +GNOMEVFS_CFLAGS +ENABLE_GCONF +GCONF_LIBS +GCONF_CFLAGS +ENABLE_KDE4 +ENABLE_KDE +ENABLE_GTK +ZIP_HOME +UNZIP +ZIP +ASM_HOME +ML_EXE +CYGWIN_PATH +GNUPATCH +GNUCP +PATCH +FLEX +BISON +NSIS_PATH +DIRECTXSDK_LIB +DIRECTXSDK_HOME +WINDOWS_VISTA_PSDK +PSDK_HOME +SYSTEM_LPSOLVE +SYSTEM_MYTHES +HYPHEN_LIB +SYSTEM_HYPH +SYSTEM_HUNSPELL +HUNSPELL_LIBS +HUNSPELL_CFLAGS +SYSTEM_REDLAND +REDLAND_LIBS +REDLAND_CFLAGS +AGG_VERSION +SYSTEM_AGG +AGG_LIBS +AGG_CFLAGS +ENABLE_AGG +SYSTEM_OPENSSL +OPENSSL_LIBS +OPENSSL_CFLAGS +NEON_VERSION +SYSTEM_NEON +NEON_LIBS +NEON_CFLAGS +DISABLE_NEON +ENABLE_RANDR +XRANDR_DLOPEN +XRANDR_LIBS +XRANDR_CFLAGS +XRENDER_LINK +SYSTEM_XRENDER_HEADERS +DISABLE_XAW +XAU_LIBS +XLIB +XINC +X_EXTRA_LIBS +X_LIBS +X_PRE_LIBS +X_CFLAGS +XMKMF +SYSTEM_GRAPHITE +ENABLE_GRAPHITE +GRAPHITE_LIBS +GRAPHITE_CFLAGS +SYSTEM_ICU +SYSTEM_GENCMN +SYSTEM_GENCCODE +SYSTEM_GENBRK +SYSTEM_SANE_HEADER +MOZ_LDAP_CFLAGS +MOZ_LIB_XPCOM +MOZ_LIB +MOZ_INC +MOZ_FLAVOUR +SYSTEM_MOZILLA +MOZILLABUILD +ENABLE_NSS_MODULE +BUILD_MOZAB +MOZLIBREQ_LIBS +MOZLIBREQ_CFLAGS +MOZGTK2_LIBS +MOZGTK2_CFLAGS +MOZILLA_TOOLKIT +MOZILLA_VERSION +MOZILLAXPCOM_LIBS +MOZILLAXPCOM_CFLAGS +NSPR_LIB +MOZ_NSPR_LIBS +MOZ_NSPR_CFLAGS +NSS_LIB +MOZ_NSS_LIBS +MOZ_NSS_CFLAGS +WITH_OPENLDAP +WITH_LDAP +WITH_MOZILLA +SYSTEM_ODBC_HEADERS +SYSTEM_VIGRA +SYSTEM_BOOST +CURL_LIBS +CURL_CFLAGS +SYSTEM_CURL +CURLCONFIG +SAXON_JAR +SYSTEM_SAXON +SERIALIZER_JAR +BSH_JAR +SYSTEM_BSH +HSQLDB_JAR +SYSTEM_HSQLDB +LUCENE_ANALYZERS_JAR +LUCENE_CORE_JAR +SYSTEM_LUCENE +DB_JAR +DB_INCLUDES +DB_VERSION +SYSTEM_DB +HOME +PYTHON_LIBS +PYTHON_CFLAGS +SYSTEM_PYTHON +BZIP2 +pkgpyexecdir +pyexecdir +pkgpythondir +pythondir +PYTHON_PLATFORM +PYTHON_EXEC_PREFIX +PYTHON_PREFIX +PYTHON_VERSION +PYTHON +SYSTEM_LIBXML +LIBXML_LIBS +LIBXML_CFLAGS +SYSTEM_LIBXSLT +XSLTPROC +LIBXSLT_LIBS +LIBXSLT_CFLAGS +USE_FT_EMBOLDEN +FREETYPE_LIBS +FREETYPE_CFLAGS +SYSTEM_LIBWPD +LIBWPD_LIBS +LIBWPD_CFLAGS +PKG_CONFIG +SYSTEM_EXPAT +SYSTEM_JPEG +SYSTEM_ZLIB +SYSTEM_STDLIBS +BUILD_QADEVOOO +BUILD_UNOWINREG +MINGWSTRIP +MINGWCXX +GPERF +RPM +PKGFORMAT +BUILD_EPM +PKGMK +DPKG +EPM +BUILD_DMAKE +DMAKE +JAVAFLAGS +JDK +JAVA_HOME +JAVAAOTCOMPILER +AWTLIB +JAVADOC +JAVACISGCJ +JAVACOMPILER +JAVAINTERPRETER +SOLAR_JAVA +BUILD_VER_STRING +ALLOC +HAVE_GCC_VISIBILITY_FEATURE +CCACHE +USE_CCACHE +USE_SYSTEM_STL +STLPORT_VER +STLPORT4 +EXCEPTIONS +MINGW_GXXDLL +MINGW_GCCDLL +MINGW_SHARED_GXXLIB +MINGW_GCCLIB_EH +MINGW_SHARED_GCCLIB +MINGW_CLIB_DIR +MINGW_BACKWARD_INCLUDE_PATH +MINGW_LIB_INCLUDE_PATH +GXX_INCLUDE_PATH +CRYPT_LINK +PAM_LINK +NEW_SHADOW_API +PAM +VBA_EXTENSION +ENABLE_VBA +LFS_CFLAGS +WORDS_BIGENDIAN +SIZEOF_LONG +CXXCPP +ac_ct_CXX +CXXFLAGS +CXX +CPP +FRAME_HOME +CSC_PATH +MIDL_PATH +USE_MINGW +COMEX +MSPDB_PATH +PERL +HAVE_LD_HASH_STYLE +_cc +GNUMAKE +NO_HIDS +ENABLE_PCH +HAVE_LD_BSYMBOLIC_FUNCTIONS +GCCVER +COMPATH +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +GCC_HOME +SHELLPATH +WITH_MINGWIN +USE_SHELL +THES_SYSTEM_DIR +HYPH_SYSTEM_DIR +DICT_SYSTEM_DIR +SYSTEM_DICTS +WITH_MYSPELL_DICTS +ENABLE_RPATH +DISABLE_ATL +DISABLE_ACTIVEX +ENABLE_DIRECTX +WITH_BINFILTER +ENABLE_FONTCONFIG +ENABLE_CUPS +DISABLE_STRIP +ENABLE_SYMBOLS +PROEXT +PROFULLSWITCH +PRODUCT +ENABLE_DEBUG +ENABLE_WERROR +VC_STANDARD +ENABLE_CRASHDUMP +PTHREAD_LIBS +PTHREAD_CFLAGS +OSVERSION +GNUTAR +target_os +target_vendor +target_cpu +target +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +SOURCEVERSION +UPD +_solenv +LOCAL_SOLENV +SED +AWK +EGREP +GREP +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' ac_subst_files='' +ac_user_opts=' +enable_option_checking +with_gnu_patch +with_agg +with_gnu_cp +enable_graphite +with_system_graphite +enable_ldap +with_openldap +enable_lockdown +enable_vba +with_vba_package_format +enable_pch +enable_hids +enable_mozilla +with_fonts +with_ppds +with_afms +enable_epm +with_epm +with_package_format +enable_odk +enable_qadevooo +enable_fontooo +enable_mathmldtd +enable_evolution2 +with_system_stdlibs +with_system_mspack +enable_cups +enable_fontconfig +enable_directx +enable_activex +enable_atl +enable_symbols +enable_strip_solver +enable_werror +enable_debug +enable_dbgutil +enable_crashdump +enable_cl_standard +enable_gtk +enable_systray +enable_cairo +with_system_cairo +enable_opengl +enable_dbus +enable_gconf +enable_gnome_vfs +enable_gio +enable_static_gtk +enable_layout +enable_build_mozilla +with_mozilla_version +with_mozilla_toolkit +enable_nss_module +enable_kde +enable_kdeab +enable_kde4 +enable_binfilter +enable_rpath +enable_pam +enable_pam_link +enable_crypt_link +enable_xrender_link +enable_randr +enable_randr_link +with_myspell_dicts +with_system_dicts +with_external_dict_dir +with_external_hyph_dir +with_external_thes_dir +with_system_libs +with_system_headers +with_system_jars +with_system_zlib +with_system_openssl +with_system_jpeg +with_system_expat +with_system_libwpd +with_system_libxml +with_system_python +with_system_icu +with_system_poppler +with_system_db +with_system_lucene +with_lucene_core_jar +with_lucene_analyzers_jar +with_system_hsqldb +with_hsqldb_jar +with_system_beanshell +with_beanshell_jar +enable_minimizer +enable_presenter_console +enable_pdfimport +enable_wiki_publisher +with_commons_codec_jar +with_commons_lang_jar +with_commons_httpclient_jar +with_commons_logging_jar +with_servlet_api_jar +enable_report_builder +with_system_jfreereport +with_sac_jar +with_libxml_jar +with_flute_jar +with_jfreereport_jar +with_liblayout_jar +with_libloader_jar +with_libformula_jar +with_librepository_jar +with_libfonts_jar +with_libserializer_jar +with_libbase_jar +with_system_saxon +with_saxon_jar +with_system_libxslt +with_system_odbc +with_system_sane +with_system_xrender +with_system_curl +with_system_boost +with_system_vigra +enable_neon +enable_Xaw +with_system_neon +with_system_agg +with_system_hunspell +with_system_mythes +with_system_altlinuxhyph +with_system_lpsolve +with_system_mozilla +with_stlport +with_jdk_home +with_gxx_include_path +with_java +enable_gcjaot +with_ant_home +with_perl_home +with_cl_home +with_mspdb_path +with_midl_path +with_csc_path +with_nsis_path +with_frame_home +with_psdk_home +with_directx_home +with_mozilla_build +with_local_solenv +with_local_solver +enable_check_only +enable_ccache_skip +with_lang +with_poor_help_localizations +with_dict +with_intro_bitmaps +with_about_bitmaps +with_vendor +with_unix_wrapper +with_asm_home +with_os_version +with_unzip_home +with_zip_home +with_mingwin +with_use_shell +with_build_version +enable_sgistl +with_alloc +enable_verbose +enable_largefile +with_x +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP +CXX +CXXFLAGS +CCC +CXXCPP +XMKMF' + # Initialize some variables set by options. ac_init_help= ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null @@ -337,34 +1199,48 @@ x_libraries=NONE # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' +datarootdir='${prefix}/share' +datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' ac_prev= +ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" + eval $ac_prev=\$ac_option ac_prev= continue fi - ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_option in + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; @@ -386,33 +1262,59 @@ do --config-cache | -C) cache_file=config.cache ;; - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) + -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + -disable-* | --disable-*) - ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - eval "enable_$ac_feature=no" ;; + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; -enable-* | --enable-*) - ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; esac - eval "enable_$ac_feature='$ac_optarg'" ;; + eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -439,6 +1341,12 @@ do -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; @@ -463,13 +1371,16 @@ do | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) + | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) @@ -534,6 +1445,16 @@ do | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; @@ -584,26 +1505,36 @@ do ac_init_version=: ;; -with-* | --with-*) - ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package| sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; esac - eval "with_$ac_package='$ac_optarg'" ;; + eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/-/_/g'` - eval "with_$ac_package=no" ;; + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. @@ -623,26 +1554,25 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) { echo "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } + -*) as_fn_error "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information." ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } - ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` - eval "$ac_envvar='$ac_optarg'" + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; @@ -651,31 +1581,36 @@ done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } + as_fn_error "missing argument to $ac_option" fi -# Be sure to have absolute paths. -for ac_var in exec_prefix prefix -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* | NONE | '' ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac -done +fi -# Be sure to have absolute paths. -for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir do - eval ac_val=$`echo $ac_var` + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. case $ac_val in - [\\/$]* | ?:[\\/]* ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac + as_fn_error "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' @@ -689,7 +1624,7 @@ target=$target_alias if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes @@ -702,86 +1637,72 @@ test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error "pwd does not report name of working directory" + + # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_confdir=`(dirname "$0") 2>/dev/null || -$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then + if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 - { (exit 1); exit 1; }; } - else - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } - fi -fi -(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || - { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 - { (exit 1); exit 1; }; } -srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` -ac_env_build_alias_set=${build_alias+set} -ac_env_build_alias_value=$build_alias -ac_cv_env_build_alias_set=${build_alias+set} -ac_cv_env_build_alias_value=$build_alias -ac_env_host_alias_set=${host_alias+set} -ac_env_host_alias_value=$host_alias -ac_cv_env_host_alias_set=${host_alias+set} -ac_cv_env_host_alias_value=$host_alias -ac_env_target_alias_set=${target_alias+set} -ac_env_target_alias_value=$target_alias -ac_cv_env_target_alias_set=${target_alias+set} -ac_cv_env_target_alias_value=$target_alias -ac_env_CC_set=${CC+set} -ac_env_CC_value=$CC -ac_cv_env_CC_set=${CC+set} -ac_cv_env_CC_value=$CC -ac_env_CFLAGS_set=${CFLAGS+set} -ac_env_CFLAGS_value=$CFLAGS -ac_cv_env_CFLAGS_set=${CFLAGS+set} -ac_cv_env_CFLAGS_value=$CFLAGS -ac_env_LDFLAGS_set=${LDFLAGS+set} -ac_env_LDFLAGS_value=$LDFLAGS -ac_cv_env_LDFLAGS_set=${LDFLAGS+set} -ac_cv_env_LDFLAGS_value=$LDFLAGS -ac_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_env_CPPFLAGS_value=$CPPFLAGS -ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_cv_env_CPPFLAGS_value=$CPPFLAGS -ac_env_CPP_set=${CPP+set} -ac_env_CPP_value=$CPP -ac_cv_env_CPP_set=${CPP+set} -ac_cv_env_CPP_value=$CPP -ac_env_CXX_set=${CXX+set} -ac_env_CXX_value=$CXX -ac_cv_env_CXX_set=${CXX+set} -ac_cv_env_CXX_value=$CXX -ac_env_CXXFLAGS_set=${CXXFLAGS+set} -ac_env_CXXFLAGS_value=$CXXFLAGS -ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} -ac_cv_env_CXXFLAGS_value=$CXXFLAGS -ac_env_CXXCPP_set=${CXXCPP+set} -ac_env_CXXCPP_value=$CXXCPP -ac_cv_env_CXXCPP_set=${CXXCPP+set} -ac_cv_env_CXXCPP_value=$CXXCPP +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done # # Report the --help message. @@ -810,14 +1731,11 @@ Configuration: -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] -_ACEOF - - cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] + [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] + [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify @@ -827,18 +1745,25 @@ for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data [PREFIX/share] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --infodir=DIR info documentation [PREFIX/info] - --mandir=DIR man documentation [PREFIX/man] + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF @@ -859,6 +1784,7 @@ if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-graphite Enables the compilation of Graphite smart font rendering @@ -1443,170 +2369,980 @@ Some influential environment variables: CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory - CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have - headers in a nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor + XMKMF Path to xmkmf, Makefile generator for X Window System Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. +Report bugs to the package provider. _ACEOF +ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. - ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d $ac_dir || continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue ac_builddir=. -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac - -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac - - cd $ac_dir - # Check for guested configure; otherwise get Cygnus style configure. - if test -f $ac_srcdir/configure.gnu; then - echo - $SHELL $ac_srcdir/configure.gnu --help=recursive - elif test -f $ac_srcdir/configure; then - echo - $SHELL $ac_srcdir/configure --help=recursive - elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then - echo - $ac_configure --help +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive else - echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi - cd $ac_popdir + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } done fi -test -n "$ac_init_help" && exit 0 +test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF +configure +generated by GNU Autoconf 2.65 -Copyright (C) 2003 Free Software Foundation, Inc. +Copyright (C) 2009 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF - exit 0 + exit fi -exec 5>config.log -cat >&5 <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. -It was created by $as_me, which was -generated by GNU Autoconf 2.59. Invocation command line was - - $ $0 $@ +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## -_ACEOF +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () { -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -hostinfo = `(hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` +} # ac_fn_c_try_compile -_ASUNAME +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - echo "PATH: $as_dir" -done + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval -} >&5 +} # ac_fn_c_try_link -cat >&5 <<_ACEOF +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval -## ----------- ## -## Core tests. ## -## ----------- ## +} # ac_fn_c_try_cpp + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_cxx_try_compile LINENO +# ---------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_compile + +# ac_fn_cxx_try_cpp LINENO +# ------------------------ +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_cpp + +# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES +# -------------------------------------------- +# Tries to find the compile-time value of EXPR in a program that includes +# INCLUDES, setting VAR accordingly. Returns whether the value could be +# computed +ac_fn_c_compute_int () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=0 ac_mid=0 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid; break +else + as_fn_arith $ac_mid + 1 && ac_lo=$as_val + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=-1 ac_mid=-1 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=$ac_mid; break +else + as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + ac_lo= ac_hi= +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid +else + as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in #(( +?*) eval "$3=\$ac_lo"; ac_retval=0 ;; +'') ac_retval=1 ;; +esac + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +static long int longval () { return $2; } +static unsigned long int ulongval () { return $2; } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (($2) < 0) + { + long int i = longval (); + if (i != ($2)) + return 1; + fprintf (f, "%ld", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ($2)) + return 1; + fprintf (f, "%lu", i); + } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + echo >>conftest.val; read $3 &5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_header_compile + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_header_mongrel + +# ac_fn_cxx_try_link LINENO +# ------------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_link + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_func + +# ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES +# --------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_cxx_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_cxx_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_cxx_check_header_mongrel + +# ac_fn_cxx_try_run LINENO +# ------------------------ +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_cxx_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_run + +# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES +# ---------------------------------------------------- +# Tries to find if the field MEMBER exists in type AGGR, after including +# INCLUDES, setting cache variable VAR accordingly. +ac_fn_c_check_member () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 +$as_echo_n "checking for $2.$3... " >&6; } +if { as_var=$4; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main () +{ +static $2 ac_aggr; +if (ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$4=yes" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main () +{ +static $2 ac_aggr; +if (sizeof ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$4=yes" +else + eval "$4=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$4 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_member +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by $as_me, which was +generated by GNU Autoconf 2.65. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## _ACEOF @@ -1619,7 +3355,6 @@ _ACEOF ac_configure_args= ac_configure_args0= ac_configure_args1= -ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do @@ -1630,13 +3365,13 @@ do -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in - 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) - ac_configure_args1="$ac_configure_args1 '$ac_arg'" + as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else @@ -1652,21 +3387,19 @@ do -* ) ac_must_keep_next=true ;; esac fi - ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - # Get rid of the leading space. - ac_sep=" " + as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done -$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } -$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. -# WARNING: Be sure not to use single quotes in there, as some shells, -# such as our DU 5.0 friend, will then `close' the trap. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { @@ -1679,20 +3412,35 @@ trap 'exit_status=$? _ASBOX echo # The following way of writing the cache mishandles newlines in values, -{ +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done (set) 2>&1 | - case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" - ;; + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( *) - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} + esac | + sort +) echo cat <<\_ASBOX @@ -1703,22 +3451,28 @@ _ASBOX echo for ac_var in $ac_subst_vars do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX -## ------------- ## -## Output files. ## -## ------------- ## +## ------------------- ## +## File substitutions. ## +## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi @@ -1730,26 +3484,26 @@ _ASBOX ## ----------- ## _ASBOX echo - sed "/^$/d" confdefs.h | sort + cat confdefs.h echo fi test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" - echo "$as_me: exit $exit_status" + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" } >&5 - rm -f core *.core && - rm -rf conftest* confdefs* conf$$* $ac_clean_files && + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status - ' 0 +' 0 for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo >confdefs.h +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. @@ -1757,112 +3511,128 @@ cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF - cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF - cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF - cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF - cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + # Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi -fi -for ac_site_file in $CONFIG_SITE; do - if test -r "$ac_site_file"; then - { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -echo "$as_me: loading site script $ac_site_file" >&6;} +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + ac_site_file1=$CONFIG_SITE +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; esac fi else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false -for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do +for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val="\$ac_cv_env_${ac_var}_value" - eval ac_new_val="\$ac_env_${ac_var}_value" + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 -echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 -echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then - { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -1871,1054 +3641,1037 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - - - - - - - - - - - - - - - echo "$@" >config.parms -# Check whether --with-gnu-patch or --without-gnu-patch was given. -if test "${with_gnu_patch+set}" = set; then - withval="$with_gnu_patch" - -fi; +# Check whether --with-gnu-patch was given. +if test "${with_gnu_patch+set}" = set; then : + withval=$with_gnu_patch; +fi -# Check whether --with-agg or --without-agg was given. -if test "${with_agg+set}" = set; then - withval="$with_agg" +# Check whether --with-agg was given. +if test "${with_agg+set}" = set; then : + withval=$with_agg; else with_agg=yes -fi; +fi -# Check whether --with-gnu-cp or --without-gnu-cp was given. -if test "${with_gnu_cp+set}" = set; then - withval="$with_gnu_cp" -fi; -# Check whether --enable-graphite or --disable-graphite was given. -if test "${enable_graphite+set}" = set; then - enableval="$enable_graphite" +# Check whether --with-gnu-cp was given. +if test "${with_gnu_cp+set}" = set; then : + withval=$with_gnu_cp; +fi -fi; +# Check whether --enable-graphite was given. +if test "${enable_graphite+set}" = set; then : + enableval=$enable_graphite; +fi -# Check whether --with-system-graphite or --without-system-graphite was given. -if test "${with_system_graphite+set}" = set; then - withval="$with_system_graphite" -fi; -# Check whether --enable-ldap or --disable-ldap was given. -if test "${enable_ldap+set}" = set; then - enableval="$enable_ldap" +# Check whether --with-system-graphite was given. +if test "${with_system_graphite+set}" = set; then : + withval=$with_system_graphite; +fi -fi; +# Check whether --enable-ldap was given. +if test "${enable_ldap+set}" = set; then : + enableval=$enable_ldap; +fi -# Check whether --with-openldap or --without-openldap was given. -if test "${with_openldap+set}" = set; then - withval="$with_openldap" -fi; -# Check whether --enable-lockdown or --disable-lockdown was given. -if test "${enable_lockdown+set}" = set; then - enableval="$enable_lockdown" +# Check whether --with-openldap was given. +if test "${with_openldap+set}" = set; then : + withval=$with_openldap; +fi -fi; -# Check whether --enable-vba or --disable-vba was given. -if test "${enable_vba+set}" = set; then - enableval="$enable_vba" +# Check whether --enable-lockdown was given. +if test "${enable_lockdown+set}" = set; then : + enableval=$enable_lockdown; +fi -fi; +# Check whether --enable-vba was given. +if test "${enable_vba+set}" = set; then : + enableval=$enable_vba; +fi -# Check whether --with-vba-package-format or --without-vba-package-format was given. -if test "${with_vba_package_format+set}" = set; then - withval="$with_vba_package_format" -fi; -# Check whether --enable-pch or --disable-pch was given. -if test "${enable_pch+set}" = set; then - enableval="$enable_pch" +# Check whether --with-vba-package-format was given. +if test "${with_vba_package_format+set}" = set; then : + withval=$with_vba_package_format; +fi -fi; -# Check whether --enable-hids or --disable-hids was given. -if test "${enable_hids+set}" = set; then - enableval="$enable_hids" +# Check whether --enable-pch was given. +if test "${enable_pch+set}" = set; then : + enableval=$enable_pch; +fi -fi; -# Check whether --enable-mozilla or --disable-mozilla was given. -if test "${enable_mozilla+set}" = set; then - enableval="$enable_mozilla" +# Check whether --enable-hids was given. +if test "${enable_hids+set}" = set; then : + enableval=$enable_hids; +fi +# Check whether --enable-mozilla was given. +if test "${enable_mozilla+set}" = set; then : + enableval=$enable_mozilla; else enable_mozilla="yes" -fi; +fi -# Check whether --with-fonts or --without-fonts was given. -if test "${with_fonts+set}" = set; then - withval="$with_fonts" -fi; +# Check whether --with-fonts was given. +if test "${with_fonts+set}" = set; then : + withval=$with_fonts; +fi -# Check whether --with-ppds or --without-ppds was given. -if test "${with_ppds+set}" = set; then - withval="$with_ppds" -fi; +# Check whether --with-ppds was given. +if test "${with_ppds+set}" = set; then : + withval=$with_ppds; +fi -# Check whether --with-afms or --without-afms was given. -if test "${with_afms+set}" = set; then - withval="$with_afms" -fi; -# Check whether --enable-epm or --disable-epm was given. -if test "${enable_epm+set}" = set; then - enableval="$enable_epm" +# Check whether --with-afms was given. +if test "${with_afms+set}" = set; then : + withval=$with_afms; +fi +# Check whether --enable-epm was given. +if test "${enable_epm+set}" = set; then : + enableval=$enable_epm; else enable_epm="yes" -fi; +fi -# Check whether --with-epm or --without-epm was given. -if test "${with_epm+set}" = set; then - withval="$with_epm" -fi; +# Check whether --with-epm was given. +if test "${with_epm+set}" = set; then : + withval=$with_epm; +fi -# Check whether --with-package-format or --without-package-format was given. -if test "${with_package_format+set}" = set; then - withval="$with_package_format" -fi; -# Check whether --enable-odk or --disable-odk was given. -if test "${enable_odk+set}" = set; then - enableval="$enable_odk" +# Check whether --with-package-format was given. +if test "${with_package_format+set}" = set; then : + withval=$with_package_format; +fi +# Check whether --enable-odk was given. +if test "${enable_odk+set}" = set; then : + enableval=$enable_odk; else enable_odk="yes" -fi; -# Check whether --enable-qadevooo or --disable-qadevooo was given. -if test "${enable_qadevooo+set}" = set; then - enableval="$enable_qadevooo" +fi +# Check whether --enable-qadevooo was given. +if test "${enable_qadevooo+set}" = set; then : + enableval=$enable_qadevooo; else enable_qadevooo="yes" -fi; -# Check whether --enable-fontooo or --disable-fontooo was given. -if test "${enable_fontooo+set}" = set; then - enableval="$enable_fontooo" +fi +# Check whether --enable-fontooo was given. +if test "${enable_fontooo+set}" = set; then : + enableval=$enable_fontooo; else enable_fontooo="yes" -fi; -# Check whether --enable-mathmldtd or --disable-mathmldtd was given. -if test "${enable_mathmldtd+set}" = set; then - enableval="$enable_mathmldtd" +fi +# Check whether --enable-mathmldtd was given. +if test "${enable_mathmldtd+set}" = set; then : + enableval=$enable_mathmldtd; else enable_mathmldtd="yes" -fi; -# Check whether --enable-evolution2 or --disable-evolution2 was given. -if test "${enable_evolution2+set}" = set; then - enableval="$enable_evolution2" +fi -fi; +# Check whether --enable-evolution2 was given. +if test "${enable_evolution2+set}" = set; then : + enableval=$enable_evolution2; +fi -# Check whether --with-system-stdlibs or --without-system-stdlibs was given. -if test "${with_system_stdlibs+set}" = set; then - withval="$with_system_stdlibs" +# Check whether --with-system-stdlibs was given. +if test "${with_system_stdlibs+set}" = set; then : + withval=$with_system_stdlibs; else checkforstdlibproblems=yes -fi; +fi -# Check whether --with-system-mspack or --without-system-mspack was given. -if test "${with_system_mspack+set}" = set; then - withval="$with_system_mspack" -fi; -# Check whether --enable-cups or --disable-cups was given. -if test "${enable_cups+set}" = set; then - enableval="$enable_cups" +# Check whether --with-system-mspack was given. +if test "${with_system_mspack+set}" = set; then : + withval=$with_system_mspack; +fi +# Check whether --enable-cups was given. +if test "${enable_cups+set}" = set; then : + enableval=$enable_cups; else enable_cups=yes -fi; -# Check whether --enable-fontconfig or --disable-fontconfig was given. -if test "${enable_fontconfig+set}" = set; then - enableval="$enable_fontconfig" +fi +# Check whether --enable-fontconfig was given. +if test "${enable_fontconfig+set}" = set; then : + enableval=$enable_fontconfig; else enable_fontconfig=yes -fi; -# Check whether --enable-directx or --disable-directx was given. -if test "${enable_directx+set}" = set; then - enableval="$enable_directx" +fi +# Check whether --enable-directx was given. +if test "${enable_directx+set}" = set; then : + enableval=$enable_directx; else enable_directx=yes -fi; -# Check whether --enable-activex or --disable-activex was given. -if test "${enable_activex+set}" = set; then - enableval="$enable_activex" +fi -fi; +# Check whether --enable-activex was given. +if test "${enable_activex+set}" = set; then : + enableval=$enable_activex; +fi -# Check whether --enable-atl or --disable-atl was given. -if test "${enable_atl+set}" = set; then - enableval="$enable_atl" -fi; +# Check whether --enable-atl was given. +if test "${enable_atl+set}" = set; then : + enableval=$enable_atl; +fi -# Check whether --enable-symbols or --disable-symbols was given. -if test "${enable_symbols+set}" = set; then - enableval="$enable_symbols" -fi; -# Check whether --enable-strip-solver or --disable-strip-solver was given. -if test "${enable_strip_solver+set}" = set; then - enableval="$enable_strip_solver" +# Check whether --enable-symbols was given. +if test "${enable_symbols+set}" = set; then : + enableval=$enable_symbols; +fi -fi; -# Check whether --enable-werror or --disable-werror was given. -if test "${enable_werror+set}" = set; then - enableval="$enable_werror" +# Check whether --enable-strip-solver was given. +if test "${enable_strip_solver+set}" = set; then : + enableval=$enable_strip_solver; +fi -fi; -# Check whether --enable-debug or --disable-debug was given. -if test "${enable_debug+set}" = set; then - enableval="$enable_debug" +# Check whether --enable-werror was given. +if test "${enable_werror+set}" = set; then : + enableval=$enable_werror; +fi -fi; -# Check whether --enable-dbgutil or --disable-dbgutil was given. -if test "${enable_dbgutil+set}" = set; then - enableval="$enable_dbgutil" +# Check whether --enable-debug was given. +if test "${enable_debug+set}" = set; then : + enableval=$enable_debug; +fi -fi; -# Check whether --enable-crashdump or --disable-crashdump was given. -if test "${enable_crashdump+set}" = set; then - enableval="$enable_crashdump" +# Check whether --enable-dbgutil was given. +if test "${enable_dbgutil+set}" = set; then : + enableval=$enable_dbgutil; +fi +# Check whether --enable-crashdump was given. +if test "${enable_crashdump+set}" = set; then : + enableval=$enable_crashdump; else enable_crashdump=no -fi; -# Check whether --enable-cl-standard or --disable-cl-standard was given. -if test "${enable_cl_standard+set}" = set; then - enableval="$enable_cl_standard" +fi -fi; -# Check whether --enable-gtk or --disable-gtk was given. -if test "${enable_gtk+set}" = set; then - enableval="$enable_gtk" +# Check whether --enable-cl-standard was given. +if test "${enable_cl_standard+set}" = set; then : + enableval=$enable_cl_standard; +fi +# Check whether --enable-gtk was given. +if test "${enable_gtk+set}" = set; then : + enableval=$enable_gtk; else enable_gtk=yes -fi; -# Check whether --enable-systray or --disable-systray was given. -if test "${enable_systray+set}" = set; then - enableval="$enable_systray" +fi +# Check whether --enable-systray was given. +if test "${enable_systray+set}" = set; then : + enableval=$enable_systray; else enable_systray=yes -fi; -# Check whether --enable-cairo or --disable-cairo was given. -if test "${enable_cairo+set}" = set; then - enableval="$enable_cairo" +fi +# Check whether --enable-cairo was given. +if test "${enable_cairo+set}" = set; then : + enableval=$enable_cairo; else enable_cairo=no -fi; +fi -# Check whether --with-system-cairo or --without-system-cairo was given. -if test "${with_system_cairo+set}" = set; then - withval="$with_system_cairo" -fi; -# Check whether --enable-opengl or --disable-opengl was given. -if test "${enable_opengl+set}" = set; then - enableval="$enable_opengl" +# Check whether --with-system-cairo was given. +if test "${with_system_cairo+set}" = set; then : + withval=$with_system_cairo; +fi +# Check whether --enable-opengl was given. +if test "${enable_opengl+set}" = set; then : + enableval=$enable_opengl; else enable_opengl=no -fi; -# Check whether --enable-dbus or --disable-dbus was given. -if test "${enable_dbus+set}" = set; then - enableval="$enable_dbus" +fi +# Check whether --enable-dbus was given. +if test "${enable_dbus+set}" = set; then : + enableval=$enable_dbus; else enable_dbus=no -fi; -# Check whether --enable-gconf or --disable-gconf was given. -if test "${enable_gconf+set}" = set; then - enableval="$enable_gconf" +fi +# Check whether --enable-gconf was given. +if test "${enable_gconf+set}" = set; then : + enableval=$enable_gconf; else enable_gconf=yes -fi; -# Check whether --enable-gnome-vfs or --disable-gnome-vfs was given. -if test "${enable_gnome_vfs+set}" = set; then - enableval="$enable_gnome_vfs" +fi +# Check whether --enable-gnome-vfs was given. +if test "${enable_gnome_vfs+set}" = set; then : + enableval=$enable_gnome_vfs; else enable_gnome_vfs=yes -fi; -# Check whether --enable-gio or --disable-gio was given. -if test "${enable_gio+set}" = set; then - enableval="$enable_gio" +fi +# Check whether --enable-gio was given. +if test "${enable_gio+set}" = set; then : + enableval=$enable_gio; else enable_gio=no -fi; -# Check whether --enable-static-gtk or --disable-static-gtk was given. -if test "${enable_static_gtk+set}" = set; then - enableval="$enable_static_gtk" +fi -fi; -# Check whether --enable-layout or --disable-layout was given. -if test "${enable_layout+set}" = set; then - enableval="$enable_layout" +# Check whether --enable-static-gtk was given. +if test "${enable_static_gtk+set}" = set; then : + enableval=$enable_static_gtk; +fi -fi; -# Check whether --enable-build-mozilla or --disable-build-mozilla was given. -if test "${enable_build_mozilla+set}" = set; then - enableval="$enable_build_mozilla" +# Check whether --enable-layout was given. +if test "${enable_layout+set}" = set; then : + enableval=$enable_layout; +fi -fi; +# Check whether --enable-build-mozilla was given. +if test "${enable_build_mozilla+set}" = set; then : + enableval=$enable_build_mozilla; +fi -# Check whether --with-mozilla-version or --without-mozilla-version was given. -if test "${with_mozilla_version+set}" = set; then - withval="$with_mozilla_version" -fi; +# Check whether --with-mozilla-version was given. +if test "${with_mozilla_version+set}" = set; then : + withval=$with_mozilla_version; +fi -# Check whether --with-mozilla-toolkit or --without-mozilla-toolkit was given. -if test "${with_mozilla_toolkit+set}" = set; then - withval="$with_mozilla_toolkit" -fi; -# Check whether --enable-nss_module or --disable-nss_module was given. -if test "${enable_nss_module+set}" = set; then - enableval="$enable_nss_module" +# Check whether --with-mozilla-toolkit was given. +if test "${with_mozilla_toolkit+set}" = set; then : + withval=$with_mozilla_toolkit; +fi +# Check whether --enable-nss_module was given. +if test "${enable_nss_module+set}" = set; then : + enableval=$enable_nss_module; else enable_nss_module=yes -fi; -# Check whether --enable-kde or --disable-kde was given. -if test "${enable_kde+set}" = set; then - enableval="$enable_kde" +fi -fi; -# Check whether --enable-kdeab or --disable-kdeab was given. -if test "${enable_kdeab+set}" = set; then - enableval="$enable_kdeab" +# Check whether --enable-kde was given. +if test "${enable_kde+set}" = set; then : + enableval=$enable_kde; +fi +# Check whether --enable-kdeab was given. +if test "${enable_kdeab+set}" = set; then : + enableval=$enable_kdeab; else if test "$enable_kde" = "yes"; then enable_kdeab=yes; fi -fi; -# Check whether --enable-kde4 or --disable-kde4 was given. -if test "${enable_kde4+set}" = set; then - enableval="$enable_kde4" +fi -fi; -# Check whether --enable-binfilter or --disable-binfilter was given. -if test "${enable_binfilter+set}" = set; then - enableval="$enable_binfilter" +# Check whether --enable-kde4 was given. +if test "${enable_kde4+set}" = set; then : + enableval=$enable_kde4; +fi +# Check whether --enable-binfilter was given. +if test "${enable_binfilter+set}" = set; then : + enableval=$enable_binfilter; else if ! test -d ./binfilter; then enable_binfilter=no; fi -fi; -# Check whether --enable-rpath or --disable-rpath was given. -if test "${enable_rpath+set}" = set; then - enableval="$enable_rpath" +fi -fi; -# Check whether --enable-pam or --disable-pam was given. -if test "${enable_pam+set}" = set; then - enableval="$enable_pam" +# Check whether --enable-rpath was given. +if test "${enable_rpath+set}" = set; then : + enableval=$enable_rpath; +fi -fi; -# Check whether --enable-pam-link or --disable-pam-link was given. -if test "${enable_pam_link+set}" = set; then - enableval="$enable_pam_link" +# Check whether --enable-pam was given. +if test "${enable_pam+set}" = set; then : + enableval=$enable_pam; +fi -fi; -# Check whether --enable-crypt-link or --disable-crypt-link was given. -if test "${enable_crypt_link+set}" = set; then - enableval="$enable_crypt_link" +# Check whether --enable-pam-link was given. +if test "${enable_pam_link+set}" = set; then : + enableval=$enable_pam_link; +fi +# Check whether --enable-crypt-link was given. +if test "${enable_crypt_link+set}" = set; then : + enableval=$enable_crypt_link; else enable_crypt_link=yes -fi; -# Check whether --enable-xrender-link or --disable-xrender-link was given. -if test "${enable_xrender_link+set}" = set; then - enableval="$enable_xrender_link" +fi -fi; -# Check whether --enable-randr or --disable-randr was given. -if test "${enable_randr+set}" = set; then - enableval="$enable_randr" +# Check whether --enable-xrender-link was given. +if test "${enable_xrender_link+set}" = set; then : + enableval=$enable_xrender_link; +fi +# Check whether --enable-randr was given. +if test "${enable_randr+set}" = set; then : + enableval=$enable_randr; else enable_randr=yes -fi; -# Check whether --enable-randr-link or --disable-randr-link was given. -if test "${enable_randr_link+set}" = set; then - enableval="$enable_randr_link" +fi +# Check whether --enable-randr-link was given. +if test "${enable_randr_link+set}" = set; then : + enableval=$enable_randr_link; else enable_randr_link=yes -fi; +fi + + +# Check whether --with-myspell-dicts was given. +if test "${with_myspell_dicts+set}" = set; then : + withval=$with_myspell_dicts; +fi + + +# Check whether --with-system-dicts was given. +if test "${with_system_dicts+set}" = set; then : + withval=$with_system_dicts; +fi + + +# Check whether --with-external-dict-dir was given. +if test "${with_external_dict_dir+set}" = set; then : + withval=$with_external_dict_dir; +fi + + +# Check whether --with-external-hyph-dir was given. +if test "${with_external_hyph_dir+set}" = set; then : + withval=$with_external_hyph_dir; +fi + + +# Check whether --with-external-thes-dir was given. +if test "${with_external_thes_dir+set}" = set; then : + withval=$with_external_thes_dir; +fi + + +# Check whether --with-system-libs was given. +if test "${with_system_libs+set}" = set; then : + withval=$with_system_libs; +fi + + +# Check whether --with-system-headers was given. +if test "${with_system_headers+set}" = set; then : + withval=$with_system_headers; +fi + + +# Check whether --with-system-jars was given. +if test "${with_system_jars+set}" = set; then : + withval=$with_system_jars; +fi + + +# Check whether --with-system-zlib was given. +if test "${with_system_zlib+set}" = set; then : + withval=$with_system_zlib; +fi + + +# Check whether --with-system-openssl was given. +if test "${with_system_openssl+set}" = set; then : + withval=$with_system_openssl; +fi + -# Check whether --with-myspell-dicts or --without-myspell-dicts was given. -if test "${with_myspell_dicts+set}" = set; then - withval="$with_myspell_dicts" +# Check whether --with-system-jpeg was given. +if test "${with_system_jpeg+set}" = set; then : + withval=$with_system_jpeg; +fi + + +# Check whether --with-system-expat was given. +if test "${with_system_expat+set}" = set; then : + withval=$with_system_expat; +fi -fi; -# Check whether --with-system-dicts or --without-system-dicts was given. -if test "${with_system_dicts+set}" = set; then - withval="$with_system_dicts" +# Check whether --with-system-libwpd was given. +if test "${with_system_libwpd+set}" = set; then : + withval=$with_system_libwpd; +fi -fi; -# Check whether --with-external-dict-dir or --without-external-dict-dir was given. -if test "${with_external_dict_dir+set}" = set; then - withval="$with_external_dict_dir" +# Check whether --with-system-libxml was given. +if test "${with_system_libxml+set}" = set; then : + withval=$with_system_libxml; +fi -fi; -# Check whether --with-external-hyph-dir or --without-external-hyph-dir was given. -if test "${with_external_hyph_dir+set}" = set; then - withval="$with_external_hyph_dir" +# Check whether --with-system-python was given. +if test "${with_system_python+set}" = set; then : + withval=$with_system_python; +fi -fi; -# Check whether --with-external-thes-dir or --without-external-thes-dir was given. -if test "${with_external_thes_dir+set}" = set; then - withval="$with_external_thes_dir" +# Check whether --with-system-icu was given. +if test "${with_system_icu+set}" = set; then : + withval=$with_system_icu; +fi -fi; -# Check whether --with-system-libs or --without-system-libs was given. -if test "${with_system_libs+set}" = set; then - withval="$with_system_libs" +# Check whether --with-system-poppler was given. +if test "${with_system_poppler+set}" = set; then : + withval=$with_system_poppler; +fi -fi; -# Check whether --with-system-headers or --without-system-headers was given. -if test "${with_system_headers+set}" = set; then - withval="$with_system_headers" +# Check whether --with-system-db was given. +if test "${with_system_db+set}" = set; then : + withval=$with_system_db; +fi -fi; -# Check whether --with-system-jars or --without-system-jars was given. -if test "${with_system_jars+set}" = set; then - withval="$with_system_jars" +# Check whether --with-system-lucene was given. +if test "${with_system_lucene+set}" = set; then : + withval=$with_system_lucene; +fi -fi; -# Check whether --with-system-zlib or --without-system-zlib was given. -if test "${with_system_zlib+set}" = set; then - withval="$with_system_zlib" +# Check whether --with-lucene-core-jar was given. +if test "${with_lucene_core_jar+set}" = set; then : + withval=$with_lucene_core_jar; LUCENE_CORE_JAR="$withval" -fi; +fi -# Check whether --with-system-openssl or --without-system-openssl was given. -if test "${with_system_openssl+set}" = set; then - withval="$with_system_openssl" -fi; +# Check whether --with-lucene-analyzers-jar was given. +if test "${with_lucene_analyzers_jar+set}" = set; then : + withval=$with_lucene_analyzers_jar; LUCENE_ANALYZERS_JAR="$withval" -# Check whether --with-system-jpeg or --without-system-jpeg was given. -if test "${with_system_jpeg+set}" = set; then - withval="$with_system_jpeg" +fi -fi; -# Check whether --with-system-expat or --without-system-expat was given. -if test "${with_system_expat+set}" = set; then - withval="$with_system_expat" +# Check whether --with-system-hsqldb was given. +if test "${with_system_hsqldb+set}" = set; then : + withval=$with_system_hsqldb; +fi -fi; -# Check whether --with-system-libwpd or --without-system-libwpd was given. -if test "${with_system_libwpd+set}" = set; then - withval="$with_system_libwpd" +# Check whether --with-hsqldb-jar was given. +if test "${with_hsqldb_jar+set}" = set; then : + withval=$with_hsqldb_jar; HSQLDB_JAR="$withval" -fi; +fi -# Check whether --with-system-libxml or --without-system-libxml was given. -if test "${with_system_libxml+set}" = set; then - withval="$with_system_libxml" -fi; +# Check whether --with-system-beanshell was given. +if test "${with_system_beanshell+set}" = set; then : + withval=$with_system_beanshell; +fi -# Check whether --with-system-python or --without-system-python was given. -if test "${with_system_python+set}" = set; then - withval="$with_system_python" -fi; +# Check whether --with-beanshell-jar was given. +if test "${with_beanshell_jar+set}" = set; then : + withval=$with_beanshell_jar; BSH_JAR="$withval" -# Check whether --with-system-icu or --without-system-icu was given. -if test "${with_system_icu+set}" = set; then - withval="$with_system_icu" +fi -fi; +# Check whether --enable-minimizer was given. +if test "${enable_minimizer+set}" = set; then : + enableval=$enable_minimizer; +fi -# Check whether --with-system-poppler or --without-system-poppler was given. -if test "${with_system_poppler+set}" = set; then - withval="$with_system_poppler" +# Check whether --enable-presenter-console was given. +if test "${enable_presenter_console+set}" = set; then : + enableval=$enable_presenter_console; +fi -fi; +# Check whether --enable-pdfimport was given. +if test "${enable_pdfimport+set}" = set; then : + enableval=$enable_pdfimport; +fi -# Check whether --with-system-db or --without-system-db was given. -if test "${with_system_db+set}" = set; then - withval="$with_system_db" +# Check whether --enable-wiki-publisher was given. +if test "${enable_wiki_publisher+set}" = set; then : + enableval=$enable_wiki_publisher; +fi -fi; -# Check whether --with-system-lucene or --without-system-lucene was given. -if test "${with_system_lucene+set}" = set; then - withval="$with_system_lucene" +# Check whether --with-commons-codec-jar was given. +if test "${with_commons_codec_jar+set}" = set; then : + withval=$with_commons_codec_jar; COMMONS_CODEC_JAR="$withval" -fi; +fi -# Check whether --with-lucene-core-jar or --without-lucene-core-jar was given. -if test "${with_lucene_core_jar+set}" = set; then - withval="$with_lucene_core_jar" - LUCENE_CORE_JAR="$withval" -fi; +# Check whether --with-commons-lang-jar was given. +if test "${with_commons_lang_jar+set}" = set; then : + withval=$with_commons_lang_jar; COMMONS_LANG_JAR="$withval" -# Check whether --with-lucene-analyzers-jar or --without-lucene-analyzers-jar was given. -if test "${with_lucene_analyzers_jar+set}" = set; then - withval="$with_lucene_analyzers_jar" - LUCENE_ANALYZERS_JAR="$withval" +fi -fi; -# Check whether --with-system-hsqldb or --without-system-hsqldb was given. -if test "${with_system_hsqldb+set}" = set; then - withval="$with_system_hsqldb" +# Check whether --with-commons-httpclient-jar was given. +if test "${with_commons_httpclient_jar+set}" = set; then : + withval=$with_commons_httpclient_jar; COMMONS_HTTPCLIENT_JAR="$withval" -fi; +fi -# Check whether --with-hsqldb-jar or --without-hsqldb-jar was given. -if test "${with_hsqldb_jar+set}" = set; then - withval="$with_hsqldb_jar" - HSQLDB_JAR="$withval" -fi; +# Check whether --with-commons-logging-jar was given. +if test "${with_commons_logging_jar+set}" = set; then : + withval=$with_commons_logging_jar; COMMONS_LOGGING_JAR="$withval" -# Check whether --with-system-beanshell or --without-system-beanshell was given. -if test "${with_system_beanshell+set}" = set; then - withval="$with_system_beanshell" +fi -fi; -# Check whether --with-beanshell-jar or --without-beanshell-jar was given. -if test "${with_beanshell_jar+set}" = set; then - withval="$with_beanshell_jar" - BSH_JAR="$withval" +# Check whether --with-servlet-api-jar was given. +if test "${with_servlet_api_jar+set}" = set; then : + withval=$with_servlet_api_jar; SERVLETAPI_JAR="$withval" -fi; -# Check whether --enable-minimizer or --disable-minimizer was given. -if test "${enable_minimizer+set}" = set; then - enableval="$enable_minimizer" +fi -fi; -# Check whether --enable-presenter-console or --disable-presenter-console was given. -if test "${enable_presenter_console+set}" = set; then - enableval="$enable_presenter_console" +# Check whether --enable-report-builder was given. +if test "${enable_report_builder+set}" = set; then : + enableval=$enable_report_builder; +fi -fi; -# Check whether --enable-pdfimport or --disable-pdfimport was given. -if test "${enable_pdfimport+set}" = set; then - enableval="$enable_pdfimport" -fi; -# Check whether --enable-wiki-publisher or --disable-wiki-publisher was given. -if test "${enable_wiki_publisher+set}" = set; then - enableval="$enable_wiki_publisher" +# Check whether --with-system-jfreereport was given. +if test "${with_system_jfreereport+set}" = set; then : + withval=$with_system_jfreereport; +fi -fi; -# Check whether --with-commons-codec-jar or --without-commons-codec-jar was given. -if test "${with_commons_codec_jar+set}" = set; then - withval="$with_commons_codec_jar" - COMMONS_CODEC_JAR="$withval" +# Check whether --with-sac-jar was given. +if test "${with_sac_jar+set}" = set; then : + withval=$with_sac_jar; SAC_JAR="$withval" -fi; +fi -# Check whether --with-commons-lang-jar or --without-commons-lang-jar was given. -if test "${with_commons_lang_jar+set}" = set; then - withval="$with_commons_lang_jar" - COMMONS_LANG_JAR="$withval" -fi; +# Check whether --with-libxml-jar was given. +if test "${with_libxml_jar+set}" = set; then : + withval=$with_libxml_jar; LIBXML_JAR="$withval" -# Check whether --with-commons-httpclient-jar or --without-commons-httpclient-jar was given. -if test "${with_commons_httpclient_jar+set}" = set; then - withval="$with_commons_httpclient_jar" - COMMONS_HTTPCLIENT_JAR="$withval" +fi -fi; -# Check whether --with-commons-logging-jar or --without-commons-logging-jar was given. -if test "${with_commons_logging_jar+set}" = set; then - withval="$with_commons_logging_jar" - COMMONS_LOGGING_JAR="$withval" +# Check whether --with-flute-jar was given. +if test "${with_flute_jar+set}" = set; then : + withval=$with_flute_jar; FLUTE_JAR="$withval" -fi; +fi -# Check whether --with-servlet-api-jar or --without-servlet-api-jar was given. -if test "${with_servlet_api_jar+set}" = set; then - withval="$with_servlet_api_jar" - SERVLETAPI_JAR="$withval" -fi; -# Check whether --enable-report-builder or --disable-report-builder was given. -if test "${enable_report_builder+set}" = set; then - enableval="$enable_report_builder" +# Check whether --with-jfreereport-jar was given. +if test "${with_jfreereport_jar+set}" = set; then : + withval=$with_jfreereport_jar; JFREEREPORT_JAR="$withval" -fi; +fi -# Check whether --with-system-jfreereport or --without-system-jfreereport was given. -if test "${with_system_jfreereport+set}" = set; then - withval="$with_system_jfreereport" -fi; +# Check whether --with-liblayout-jar was given. +if test "${with_liblayout_jar+set}" = set; then : + withval=$with_liblayout_jar; LIBLAYOUT_JAR="$withval" -# Check whether --with-sac-jar or --without-sac-jar was given. -if test "${with_sac_jar+set}" = set; then - withval="$with_sac_jar" - SAC_JAR="$withval" +fi -fi; -# Check whether --with-libxml-jar or --without-libxml-jar was given. -if test "${with_libxml_jar+set}" = set; then - withval="$with_libxml_jar" - LIBXML_JAR="$withval" +# Check whether --with-libloader-jar was given. +if test "${with_libloader_jar+set}" = set; then : + withval=$with_libloader_jar; LIBLOADER_JAR="$withval" -fi; +fi -# Check whether --with-flute-jar or --without-flute-jar was given. -if test "${with_flute_jar+set}" = set; then - withval="$with_flute_jar" - FLUTE_JAR="$withval" -fi; +# Check whether --with-libloader-jar was given. +if test "${with_libloader_jar+set}" = set; then : + withval=$with_libloader_jar; LIBLOADER_JAR="$withval" -# Check whether --with-jfreereport-jar or --without-jfreereport-jar was given. -if test "${with_jfreereport_jar+set}" = set; then - withval="$with_jfreereport_jar" - JFREEREPORT_JAR="$withval" +fi -fi; -# Check whether --with-liblayout-jar or --without-liblayout-jar was given. -if test "${with_liblayout_jar+set}" = set; then - withval="$with_liblayout_jar" - LIBLAYOUT_JAR="$withval" +# Check whether --with-libformula-jar was given. +if test "${with_libformula_jar+set}" = set; then : + withval=$with_libformula_jar; LIBFORMULA_JAR="$withval" -fi; +fi -# Check whether --with-libloader-jar or --without-libloader-jar was given. -if test "${with_libloader_jar+set}" = set; then - withval="$with_libloader_jar" - LIBLOADER_JAR="$withval" -fi; +# Check whether --with-librepository-jar was given. +if test "${with_librepository_jar+set}" = set; then : + withval=$with_librepository_jar; LIBREPOSITORY_JAR="$withval" -# Check whether --with-libloader-jar or --without-libloader-jar was given. -if test "${with_libloader_jar+set}" = set; then - withval="$with_libloader_jar" - LIBLOADER_JAR="$withval" +fi -fi; -# Check whether --with-libformula-jar or --without-libformula-jar was given. -if test "${with_libformula_jar+set}" = set; then - withval="$with_libformula_jar" - LIBFORMULA_JAR="$withval" +# Check whether --with-libfonts-jar was given. +if test "${with_libfonts_jar+set}" = set; then : + withval=$with_libfonts_jar; LIBFONTS_JAR="$withval" -fi; +fi -# Check whether --with-librepository-jar or --without-librepository-jar was given. -if test "${with_librepository_jar+set}" = set; then - withval="$with_librepository_jar" - LIBREPOSITORY_JAR="$withval" -fi; +# Check whether --with-libserializer-jar was given. +if test "${with_libserializer_jar+set}" = set; then : + withval=$with_libserializer_jar; LIBSERIALIZER_JAR="$withval" -# Check whether --with-libfonts-jar or --without-libfonts-jar was given. -if test "${with_libfonts_jar+set}" = set; then - withval="$with_libfonts_jar" - LIBFONTS_JAR="$withval" +fi -fi; -# Check whether --with-libserializer-jar or --without-libserializer-jar was given. -if test "${with_libserializer_jar+set}" = set; then - withval="$with_libserializer_jar" - LIBSERIALIZER_JAR="$withval" +# Check whether --with-libbase-jar was given. +if test "${with_libbase_jar+set}" = set; then : + withval=$with_libbase_jar; LIBBASE_JAR="$withval" -fi; +fi -# Check whether --with-libbase-jar or --without-libbase-jar was given. -if test "${with_libbase_jar+set}" = set; then - withval="$with_libbase_jar" - LIBBASE_JAR="$withval" -fi; +# Check whether --with-system-saxon was given. +if test "${with_system_saxon+set}" = set; then : + withval=$with_system_saxon; +fi -# Check whether --with-system-saxon or --without-system-saxon was given. -if test "${with_system_saxon+set}" = set; then - withval="$with_system_saxon" -fi; +# Check whether --with-saxon-jar was given. +if test "${with_saxon_jar+set}" = set; then : + withval=$with_saxon_jar; SAXON_JAR="$withval" -# Check whether --with-saxon-jar or --without-saxon-jar was given. -if test "${with_saxon_jar+set}" = set; then - withval="$with_saxon_jar" - SAXON_JAR="$withval" +fi -fi; -# Check whether --with-system-libxslt or --without-system-libxslt was given. -if test "${with_system_libxslt+set}" = set; then - withval="$with_system_libxslt" +# Check whether --with-system-libxslt was given. +if test "${with_system_libxslt+set}" = set; then : + withval=$with_system_libxslt; +fi -fi; -# Check whether --with-system-odbc or --without-system-odbc was given. -if test "${with_system_odbc+set}" = set; then - withval="$with_system_odbc" +# Check whether --with-system-odbc was given. +if test "${with_system_odbc+set}" = set; then : + withval=$with_system_odbc; +fi -fi; -# Check whether --with-system-sane or --without-system-sane was given. -if test "${with_system_sane+set}" = set; then - withval="$with_system_sane" +# Check whether --with-system-sane was given. +if test "${with_system_sane+set}" = set; then : + withval=$with_system_sane; +fi -fi; -# Check whether --with-system-xrender or --without-system-xrender was given. -if test "${with_system_xrender+set}" = set; then - withval="$with_system_xrender" +# Check whether --with-system-xrender was given. +if test "${with_system_xrender+set}" = set; then : + withval=$with_system_xrender; +fi -fi; -# Check whether --with-system-curl or --without-system-curl was given. -if test "${with_system_curl+set}" = set; then - withval="$with_system_curl" +# Check whether --with-system-curl was given. +if test "${with_system_curl+set}" = set; then : + withval=$with_system_curl; +fi -fi; -# Check whether --with-system-boost or --without-system-boost was given. -if test "${with_system_boost+set}" = set; then - withval="$with_system_boost" +# Check whether --with-system-boost was given. +if test "${with_system_boost+set}" = set; then : + withval=$with_system_boost; +fi -fi; -# Check whether --with-system-vigra or --without-system-vigra was given. -if test "${with_system_vigra+set}" = set; then - withval="$with_system_vigra" +# Check whether --with-system-vigra was given. +if test "${with_system_vigra+set}" = set; then : + withval=$with_system_vigra; +fi -fi; -# Check whether --enable-neon or --disable-neon was given. -if test "${enable_neon+set}" = set; then - enableval="$enable_neon" +# Check whether --enable-neon was given. +if test "${enable_neon+set}" = set; then : + enableval=$enable_neon; +fi -fi; -# Check whether --enable-Xaw or --disable-Xaw was given. -if test "${enable_Xaw+set}" = set; then - enableval="$enable_Xaw" +# Check whether --enable-Xaw was given. +if test "${enable_Xaw+set}" = set; then : + enableval=$enable_Xaw; +fi -fi; -# Check whether --with-system-neon or --without-system-neon was given. -if test "${with_system_neon+set}" = set; then - withval="$with_system_neon" +# Check whether --with-system-neon was given. +if test "${with_system_neon+set}" = set; then : + withval=$with_system_neon; +fi -fi; -# Check whether --with-system-agg or --without-system-agg was given. -if test "${with_system_agg+set}" = set; then - withval="$with_system_agg" +# Check whether --with-system-agg was given. +if test "${with_system_agg+set}" = set; then : + withval=$with_system_agg; +fi -fi; -# Check whether --with-system-hunspell or --without-system-hunspell was given. -if test "${with_system_hunspell+set}" = set; then - withval="$with_system_hunspell" +# Check whether --with-system-hunspell was given. +if test "${with_system_hunspell+set}" = set; then : + withval=$with_system_hunspell; +fi -fi; -# Check whether --with-system-mythes or --without-system-mythes was given. -if test "${with_system_mythes+set}" = set; then - withval="$with_system_mythes" +# Check whether --with-system-mythes was given. +if test "${with_system_mythes+set}" = set; then : + withval=$with_system_mythes; +fi -fi; -# Check whether --with-system-altlinuxhyph or --without-system-altlinuxhyph was given. -if test "${with_system_altlinuxhyph+set}" = set; then - withval="$with_system_altlinuxhyph" +# Check whether --with-system-altlinuxhyph was given. +if test "${with_system_altlinuxhyph+set}" = set; then : + withval=$with_system_altlinuxhyph; +fi -fi; -# Check whether --with-system-lpsolve or --without-system-lpsolve was given. -if test "${with_system_lpsolve+set}" = set; then - withval="$with_system_lpsolve" +# Check whether --with-system-lpsolve was given. +if test "${with_system_lpsolve+set}" = set; then : + withval=$with_system_lpsolve; +fi -fi; -# Check whether --with-system-mozilla or --without-system-mozilla was given. -if test "${with_system_mozilla+set}" = set; then - withval="$with_system_mozilla" - WITH_SYSTEM_MOZILLA=$withval +# Check whether --with-system-mozilla was given. +if test "${with_system_mozilla+set}" = set; then : + withval=$with_system_mozilla; WITH_SYSTEM_MOZILLA=$withval else WITH_SYSTEM_MOZILLA=no -fi; +fi -# Check whether --with-stlport or --without-stlport was given. -if test "${with_stlport+set}" = set; then - withval="$with_stlport" - WITH_STLPORT=$withval + +# Check whether --with-stlport was given. +if test "${with_stlport+set}" = set; then : + withval=$with_stlport; WITH_STLPORT=$withval else WITH_STLPORT=auto -fi; +fi -# Check whether --with-jdk-home or --without-jdk-home was given. -if test "${with_jdk_home+set}" = set; then - withval="$with_jdk_home" -fi; +# Check whether --with-jdk-home was given. +if test "${with_jdk_home+set}" = set; then : + withval=$with_jdk_home; +fi + -# Check whether --with-gxx_include_path or --without-gxx_include_path was given. -if test "${with_gxx_include_path+set}" = set; then - withval="$with_gxx_include_path" +# Check whether --with-gxx_include_path was given. +if test "${with_gxx_include_path+set}" = set; then : + withval=$with_gxx_include_path; +fi -fi; -# Check whether --with-java or --without-java was given. -if test "${with_java+set}" = set; then - withval="$with_java" - if test "$withval" = "yes"; then WITH_JAVA=java; else WITH_JAVA=$withval; fi +# Check whether --with-java was given. +if test "${with_java+set}" = set; then : + withval=$with_java; if test "$withval" = "yes"; then WITH_JAVA=java; else WITH_JAVA=$withval; fi else WITH_JAVA=java -fi; -# Check whether --enable-gcjaot or --disable-gcjaot was given. -if test "${enable_gcjaot+set}" = set; then - enableval="$enable_gcjaot" +fi + +# Check whether --enable-gcjaot was given. +if test "${enable_gcjaot+set}" = set; then : + enableval=$enable_gcjaot; +fi -fi; -# Check whether --with-ant-home or --without-ant-home was given. -if test "${with_ant_home+set}" = set; then - withval="$with_ant_home" +# Check whether --with-ant-home was given. +if test "${with_ant_home+set}" = set; then : + withval=$with_ant_home; +fi -fi; -# Check whether --with-perl-home or --without-perl-home was given. -if test "${with_perl_home+set}" = set; then - withval="$with_perl_home" +# Check whether --with-perl-home was given. +if test "${with_perl_home+set}" = set; then : + withval=$with_perl_home; +fi -fi; -# Check whether --with-cl-home or --without-cl-home was given. -if test "${with_cl_home+set}" = set; then - withval="$with_cl_home" +# Check whether --with-cl-home was given. +if test "${with_cl_home+set}" = set; then : + withval=$with_cl_home; +fi -fi; -# Check whether --with-mspdb-path or --without-mspdb-path was given. -if test "${with_mspdb_path+set}" = set; then - withval="$with_mspdb_path" +# Check whether --with-mspdb-path was given. +if test "${with_mspdb_path+set}" = set; then : + withval=$with_mspdb_path; +fi -fi; -# Check whether --with-midl-path or --without-midl-path was given. -if test "${with_midl_path+set}" = set; then - withval="$with_midl_path" +# Check whether --with-midl-path was given. +if test "${with_midl_path+set}" = set; then : + withval=$with_midl_path; +fi -fi; -# Check whether --with-csc-path or --without-csc-path was given. -if test "${with_csc_path+set}" = set; then - withval="$with_csc_path" +# Check whether --with-csc-path was given. +if test "${with_csc_path+set}" = set; then : + withval=$with_csc_path; +fi -fi; -# Check whether --with-nsis-path or --without-nsis-path was given. -if test "${with_nsis_path+set}" = set; then - withval="$with_nsis_path" +# Check whether --with-nsis-path was given. +if test "${with_nsis_path+set}" = set; then : + withval=$with_nsis_path; +fi -fi; -# Check whether --with-frame-home or --without-frame-home was given. -if test "${with_frame_home+set}" = set; then - withval="$with_frame_home" +# Check whether --with-frame-home was given. +if test "${with_frame_home+set}" = set; then : + withval=$with_frame_home; +fi -fi; -# Check whether --with-psdk-home or --without-psdk-home was given. -if test "${with_psdk_home+set}" = set; then - withval="$with_psdk_home" +# Check whether --with-psdk-home was given. +if test "${with_psdk_home+set}" = set; then : + withval=$with_psdk_home; +fi -fi; -# Check whether --with-directx-home or --without-directx-home was given. -if test "${with_directx_home+set}" = set; then - withval="$with_directx_home" +# Check whether --with-directx-home was given. +if test "${with_directx_home+set}" = set; then : + withval=$with_directx_home; +fi -fi; -# Check whether --with-mozilla-build or --without-mozilla-build was given. -if test "${with_mozilla_build+set}" = set; then - withval="$with_mozilla_build" - MOZILLABUILD=$withval -fi; +# Check whether --with-mozilla-build was given. +if test "${with_mozilla_build+set}" = set; then : + withval=$with_mozilla_build; MOZILLABUILD=$withval +fi -# Check whether --with-local-solenv or --without-local-solenv was given. -if test "${with_local_solenv+set}" = set; then - withval="$with_local_solenv" -fi; +# Check whether --with-local-solenv was given. +if test "${with_local_solenv+set}" = set; then : + withval=$with_local_solenv; +fi -# Check whether --with-local-solver or --without-local-solver was given. -if test "${with_local_solver+set}" = set; then - withval="$with_local_solver" -fi; -# Check whether --enable-check-only or --disable-check-only was given. -if test "${enable_check_only+set}" = set; then - enableval="$enable_check_only" +# Check whether --with-local-solver was given. +if test "${with_local_solver+set}" = set; then : + withval=$with_local_solver; +fi -fi; -# Check whether --enable-ccache-skip or --disable-ccache-skip was given. -if test "${enable_ccache_skip+set}" = set; then - enableval="$enable_ccache_skip" +# Check whether --enable-check-only was given. +if test "${enable_check_only+set}" = set; then : + enableval=$enable_check_only; +fi +# Check whether --enable-ccache-skip was given. +if test "${enable_ccache_skip+set}" = set; then : + enableval=$enable_ccache_skip; else enable_ccache_skip=auto -fi; +fi + -# Check whether --with-lang or --without-lang was given. -if test "${with_lang+set}" = set; then - withval="$with_lang" +# Check whether --with-lang was given. +if test "${with_lang+set}" = set; then : + withval=$with_lang; +fi -fi; -# Check whether --with-poor-help-localizations or --without-poor-help-localizations was given. -if test "${with_poor_help_localizations+set}" = set; then - withval="$with_poor_help_localizations" +# Check whether --with-poor-help-localizations was given. +if test "${with_poor_help_localizations+set}" = set; then : + withval=$with_poor_help_localizations; +fi -fi; -# Check whether --with-dict or --without-dict was given. -if test "${with_dict+set}" = set; then - withval="$with_dict" +# Check whether --with-dict was given. +if test "${with_dict+set}" = set; then : + withval=$with_dict; +fi -fi; -# Check whether --with-intro-bitmaps or --without-intro-bitmaps was given. -if test "${with_intro_bitmaps+set}" = set; then - withval="$with_intro_bitmaps" +# Check whether --with-intro-bitmaps was given. +if test "${with_intro_bitmaps+set}" = set; then : + withval=$with_intro_bitmaps; +fi -fi; -# Check whether --with-about-bitmaps or --without-about-bitmaps was given. -if test "${with_about_bitmaps+set}" = set; then - withval="$with_about_bitmaps" +# Check whether --with-about-bitmaps was given. +if test "${with_about_bitmaps+set}" = set; then : + withval=$with_about_bitmaps; +fi -fi; -# Check whether --with-vendor or --without-vendor was given. -if test "${with_vendor+set}" = set; then - withval="$with_vendor" +# Check whether --with-vendor was given. +if test "${with_vendor+set}" = set; then : + withval=$with_vendor; +fi -fi; -# Check whether --with-unix-wrapper or --without-unix-wrapper was given. -if test "${with_unix_wrapper+set}" = set; then - withval="$with_unix_wrapper" +# Check whether --with-unix-wrapper was given. +if test "${with_unix_wrapper+set}" = set; then : + withval=$with_unix_wrapper; +fi -fi; -# Check whether --with-asm-home or --without-asm-home was given. -if test "${with_asm_home+set}" = set; then - withval="$with_asm_home" +# Check whether --with-asm-home was given. +if test "${with_asm_home+set}" = set; then : + withval=$with_asm_home; +fi -fi; -# Check whether --with-os-version or --without-os-version was given. -if test "${with_os_version+set}" = set; then - withval="$with_os_version" +# Check whether --with-os-version was given. +if test "${with_os_version+set}" = set; then : + withval=$with_os_version; +fi -fi; -# Check whether --with-unzip-home or --without-unzip-home was given. -if test "${with_unzip_home+set}" = set; then - withval="$with_unzip_home" +# Check whether --with-unzip-home was given. +if test "${with_unzip_home+set}" = set; then : + withval=$with_unzip_home; +fi -fi; -# Check whether --with-zip-home or --without-zip-home was given. -if test "${with_zip_home+set}" = set; then - withval="$with_zip_home" +# Check whether --with-zip-home was given. +if test "${with_zip_home+set}" = set; then : + withval=$with_zip_home; +fi -fi; -# Check whether --with-mingwin or --without-mingwin was given. -if test "${with_mingwin+set}" = set; then - withval="$with_mingwin" - WITH_MINGWIN=$withval +# Check whether --with-mingwin was given. +if test "${with_mingwin+set}" = set; then : + withval=$with_mingwin; WITH_MINGWIN=$withval else WITH_MINGWIN=0 -fi; +fi -# Check whether --with-use-shell or --without-use-shell was given. -if test "${with_use_shell+set}" = set; then - withval="$with_use_shell" - with_use_shell=$withval + +# Check whether --with-use-shell was given. +if test "${with_use_shell+set}" = set; then : + withval=$with_use_shell; with_use_shell=$withval else with_use_shell="tcsh" -fi; +fi -# Check whether --with-build-version or --without-build-version was given. -if test "${with_build_version+set}" = set; then - withval="$with_build_version" - with_build_version=$withval -fi; -# Check whether --enable-sgistl or --disable-sgistl was given. -if test "${enable_sgistl+set}" = set; then - enableval="$enable_sgistl" -fi; +# Check whether --with-build-version was given. +if test "${with_build_version+set}" = set; then : + withval=$with_build_version; with_build_version=$withval +fi + +# Check whether --enable-sgistl was given. +if test "${enable_sgistl+set}" = set; then : + enableval=$enable_sgistl; +fi + -# Check whether --with-alloc or --without-alloc was given. -if test "${with_alloc+set}" = set; then - withval="$with_alloc" +# Check whether --with-alloc was given. +if test "${with_alloc+set}" = set; then : + withval=$with_alloc; +fi -fi; -# Check whether --enable-verbose or --disable-verbose was given. -if test "${enable_verbose+set}" = set; then - enableval="$enable_verbose" +# Check whether --enable-verbose was given. +if test "${enable_verbose+set}" = set; then : + enableval=$enable_verbose; +fi -fi; BUILD_TYPE="OOo" @@ -2945,29 +4698,144 @@ echo "* *" echo "********************************************************************" echo "" cat /dev/null > warn -echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -if test "${ac_cv_prog_egrep+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if test "${ac_cv_path_GREP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi fi -echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -echo "${ECHO_T}$ac_cv_prog_egrep" >&6 - EGREP=$ac_cv_prog_egrep +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_AWK+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AWK+set}" = set; then : + $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. @@ -2977,35 +4845,37 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - echo "$as_me:$LINENO: result: $AWK" >&5 -echo "${ECHO_T}$AWK" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$AWK" && break done # Extract the first word of "$AWK", so it can be a program name with args. set dummy $AWK; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_AWK+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_AWK+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $AWK in [\\/]* | ?:[\\/]*) @@ -3017,42 +4887,41 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_AWK="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS ;; esac fi AWK=$ac_cv_path_AWK - if test -n "$AWK"; then - echo "$as_me:$LINENO: result: $AWK" >&5 -echo "${ECHO_T}$AWK" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + if test -z "$AWK"; then - { { echo "$as_me:$LINENO: error: install awk to run this script" >&5 -echo "$as_me: error: install awk to run this script" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "install awk to run this script" "$LINENO" 5 fi for ac_prog in sed do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_SED+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_SED+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $SED in [\\/]* | ?:[\\/]*) @@ -3064,47 +4933,46 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_SED="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS ;; esac fi SED=$ac_cv_path_SED - if test -n "$SED"; then - echo "$as_me:$LINENO: result: $SED" >&5 -echo "${ECHO_T}$SED" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SED" >&5 +$as_echo "$SED" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$SED" && break done if test -z "$SED"; then - { { echo "$as_me:$LINENO: error: install sed to run this script" >&5 -echo "$as_me: error: install sed to run this script" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "install sed to run this script" "$LINENO" 5 fi -echo "$as_me:$LINENO: checking for solenv environment" >&5 -echo $ECHO_N "checking for solenv environment... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for solenv environment" >&5 +$as_echo_n "checking for solenv environment... " >&6; } if test -z "$with_local_solenv"; then LOCAL_SOLENV="DEFAULT" - echo "$as_me:$LINENO: result: default" >&5 -echo "${ECHO_T}default" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: default" >&5 +$as_echo "default" >&6; } else LOCAL_SOLENV=$with_local_solenv - echo "$as_me:$LINENO: result: $with_local_solenv" >&5 -echo "${ECHO_T}$with_local_solenv" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_local_solenv" >&5 +$as_echo "$with_local_solenv" >&6; } fi @@ -3122,110 +4990,134 @@ if test -e $_solenv/inc/minor.mk; then SOURCEVERSION="`grep SOURCEVERSION= $_solenv/inc/minor.mk | $AWK -F"=" '{ print $2 }'`" else - { { echo "$as_me:$LINENO: error: $_solenv/inc/minor.mk missing but needed for architecture/os detecion and proper environment script generation..." >&5 -echo "$as_me: error: $_solenv/inc/minor.mk missing but needed for architecture/os detecion and proper environment script generation..." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "$_solenv/inc/minor.mk missing but needed for architecture/os detecion and proper environment script generation..." "$LINENO" 5 fi ac_aux_dir= -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/install-sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f $ac_dir/install.sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f $ac_dir/shtool; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + for ac_t in install-sh install.sh shtool; do + if test -f "$ac_dir/$ac_t"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/$ac_t -c" + break 2 + fi + done done if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 -echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi -ac_config_guess="$SHELL $ac_aux_dir/config.guess" -ac_config_sub="$SHELL $ac_aux_dir/config.sub" -ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + # Make sure we can run config.sub. -$ac_config_sub sun4 >/dev/null 2>&1 || - { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 -echo "$as_me: error: cannot run $ac_config_sub" >&2;} - { (exit 1); exit 1; }; } - -echo "$as_me:$LINENO: checking build system type" >&5 -echo $ECHO_N "checking build system type... $ECHO_C" >&6 -if test "${ac_cv_build+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_build_alias=$build_alias -test -z "$ac_cv_build_alias" && - ac_cv_build_alias=`$ac_config_guess` -test -z "$ac_cv_build_alias" && - { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 -echo "$as_me: error: cannot guess build type; you must specify one" >&2;} - { (exit 1); exit 1; }; } -ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} - { (exit 1); exit 1; }; } - -fi -echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -echo "${ECHO_T}$ac_cv_build" >&6 +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if test "${ac_cv_build+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error "invalid value of canonical build" "$LINENO" 5;; +esac build=$ac_cv_build -build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac -echo "$as_me:$LINENO: checking host system type" >&5 -echo $ECHO_N "checking host system type... $ECHO_C" >&6 -if test "${ac_cv_host+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if test "${ac_cv_host+set}" = set; then : + $as_echo_n "(cached) " >&6 else - ac_cv_host_alias=$host_alias -test -z "$ac_cv_host_alias" && - ac_cv_host_alias=$ac_cv_build_alias -ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} - { (exit 1); exit 1; }; } + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi fi -echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -echo "${ECHO_T}$ac_cv_host" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error "invalid value of canonical host" "$LINENO" 5;; +esac host=$ac_cv_host -host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac -echo "$as_me:$LINENO: checking target system type" >&5 -echo $ECHO_N "checking target system type... $ECHO_C" >&6 -if test "${ac_cv_target+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 +$as_echo_n "checking target system type... " >&6; } +if test "${ac_cv_target+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "x$target_alias" = x; then + ac_cv_target=$ac_cv_host else - ac_cv_target_alias=$target_alias -test "x$ac_cv_target_alias" = "x" && - ac_cv_target_alias=$ac_cv_host_alias -ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} - { (exit 1); exit 1; }; } + ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || + as_fn_error "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 +fi fi -echo "$as_me:$LINENO: result: $ac_cv_target" >&5 -echo "${ECHO_T}$ac_cv_target" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 +$as_echo "$ac_cv_target" >&6; } +case $ac_cv_target in +*-*-*) ;; +*) as_fn_error "invalid value of canonical target" "$LINENO" 5;; +esac target=$ac_cv_target -target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_target +shift +target_cpu=$1 +target_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +target_os=$* +IFS=$ac_save_IFS +case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac # The aliases save the names the user supplied, while $host etc. @@ -3234,23 +5126,22 @@ test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- + if test "$build" != "$host" -o "$build" != "$target" \ -o "$host" != "$target"; then - { echo "$as_me:$LINENO: WARNING: cross-compiling by any means is not supported (yet)!" >&5 -echo "$as_me: WARNING: cross-compiling by any means is not supported (yet)!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cross-compiling by any means is not supported (yet)!" >&5 +$as_echo "$as_me: WARNING: cross-compiling by any means is not supported (yet)!" >&2;} echo "cross-compiling by any means is not supported (yet)!" >> warn fi if echo "$build_os" | grep cygwin; then - echo "$as_me:$LINENO: checking Cygwin version" >&5 -echo $ECHO_N "checking Cygwin version... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking Cygwin version" >&5 +$as_echo_n "checking Cygwin version... " >&6; } CygwinVer=`uname -r` - echo "$as_me:$LINENO: result: $CygwinVer" >&5 -echo "${ECHO_T}$CygwinVer" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CygwinVer" >&5 +$as_echo "$CygwinVer" >&6; } if test "`echo $CygwinVer | $AWK -F . '{ print $1$2 }'`" -lt "15"; then - { { echo "$as_me:$LINENO: error: You need at least Cygwin V1.5.x" >&5 -echo "$as_me: error: You need at least Cygwin V1.5.x" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "You need at least Cygwin V1.5.x" "$LINENO" 5 fi else CygwinVer="false" @@ -3267,10 +5158,10 @@ case "$build_os" in _os=SunOS # Extract the first word of "gtar", so it can be a program name with args. set dummy gtar; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_GNUTAR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_GNUTAR+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $GNUTAR in [\\/]* | ?:[\\/]*) @@ -3283,56 +5174,51 @@ for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GNUTAR="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS ;; esac fi GNUTAR=$ac_cv_path_GNUTAR - if test -n "$GNUTAR"; then - echo "$as_me:$LINENO: result: $GNUTAR" >&5 -echo "${ECHO_T}$GNUTAR" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GNUTAR" >&5 +$as_echo "$GNUTAR" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + if test -z "$GNUTAR"; then - { { echo "$as_me:$LINENO: error: gtar (gnu tar) not found but needed. Install it (SUN Freeware package)." >&5 -echo "$as_me: error: gtar (gnu tar) not found but needed. Install it (SUN Freeware package)." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "gtar (gnu tar) not found but needed. Install it (SUN Freeware package)." "$LINENO" 5 fi - echo "$as_me:$LINENO: checking the Solaris operating system release" >&5 -echo $ECHO_N "checking the Solaris operating system release... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking the Solaris operating system release" >&5 +$as_echo_n "checking the Solaris operating system release... " >&6; } _os_release=`echo $build_os | $SED -e s/solaris2\.//` if test "$_os_release" -lt "6"; then - { { echo "$as_me:$LINENO: error: use solaris >= 6 to build OpenOffice.org" >&5 -echo "$as_me: error: use solaris >= 6 to build OpenOffice.org" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "use solaris >= 6 to build OpenOffice.org" "$LINENO" 5 else - echo "$as_me:$LINENO: result: ok ($_os_release)" >&5 -echo "${ECHO_T}ok ($_os_release)" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok ($_os_release)" >&5 +$as_echo "ok ($_os_release)" >&6; } fi - echo "$as_me:$LINENO: checking the processor type" >&5 -echo $ECHO_N "checking the processor type... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking the processor type" >&5 +$as_echo_n "checking the processor type... " >&6; } if test "$build_cpu" = "sparc" -o "$build_cpu" = "i386"; then - echo "$as_me:$LINENO: result: ok ($build_cpu)" >&5 -echo "${ECHO_T}ok ($build_cpu)" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok ($build_cpu)" >&5 +$as_echo "ok ($build_cpu)" >&6; } else - { { echo "$as_me:$LINENO: error: only sparc and i386 processors are supported" >&5 -echo "$as_me: error: only sparc and i386 processors are supported" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "only sparc and i386 processors are supported" "$LINENO" 5 fi ;; linux-gnu*) @@ -3366,8 +5252,8 @@ echo "$as_me: error: only sparc and i386 processors are supported" >&2;} test_freetype=no _os=Darwin if test "$enable_systray" = "yes" && test "$enable_gtk" != "no"; then - { echo "$as_me:$LINENO: WARNING: Disabling gtk-quickstarter - not supported on Mac. Use --disable-systray" >&5 -echo "$as_me: WARNING: Disabling gtk-quickstarter - not supported on Mac. Use --disable-systray" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Disabling gtk-quickstarter - not supported on Mac. Use --disable-systray" >&5 +$as_echo "$as_me: WARNING: Disabling gtk-quickstarter - not supported on Mac. Use --disable-systray" >&2;} echo "Disabling gtk-quickstarter - not supported on Mac. Use --disable-systray" >>warn enable_systray=no fi @@ -3388,17 +5274,17 @@ echo "$as_me: WARNING: Disabling gtk-quickstarter - not supported on Mac. Use -- test_cups=yes test_randr=yes test_freetype=yes - echo "$as_me:$LINENO: checking the FreeBSD operating system release" >&5 -echo $ECHO_N "checking the FreeBSD operating system release... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking the FreeBSD operating system release" >&5 +$as_echo_n "checking the FreeBSD operating system release... " >&6; } if test -n "$with_os_version"; then OSVERSION="$with_os_version" else OSVERSION=`/sbin/sysctl -n kern.osreldate` fi - echo "$as_me:$LINENO: result: found OSVERSION=$OSVERSION" >&5 -echo "${ECHO_T}found OSVERSION=$OSVERSION" >&6 - echo "$as_me:$LINENO: checking which thread library to use" >&5 -echo $ECHO_N "checking which thread library to use... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found OSVERSION=$OSVERSION" >&5 +$as_echo "found OSVERSION=$OSVERSION" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking which thread library to use" >&5 +$as_echo_n "checking which thread library to use... " >&6; } if test "$OSVERSION" -lt "500016"; then PTHREAD_CFLAGS="-D_THREAD_SAFE" PTHREAD_LIBS="-pthread" @@ -3409,8 +5295,8 @@ echo $ECHO_N "checking which thread library to use... $ECHO_C" >&6 PTHREAD_CFLAGS="" PTHREAD_LIBS="-pthread" fi - echo "$as_me:$LINENO: result: $PTHREAD_LIBS" >&5 -echo "${ECHO_T}$PTHREAD_LIBS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_LIBS" >&5 +$as_echo "$PTHREAD_LIBS" >&6; } _os=FreeBSD ;; osf) @@ -3445,9 +5331,7 @@ echo "${ECHO_T}$PTHREAD_LIBS" >&6 _os=AIX ;; *) - { { echo "$as_me:$LINENO: error: $_os operating system is not suitable to build OpenOffice.org!" >&5 -echo "$as_me: error: $_os operating system is not suitable to build OpenOffice.org!" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "$_os operating system is not suitable to build OpenOffice.org!" "$LINENO" 5 ;; esac @@ -3455,28 +5339,26 @@ esac -echo "$as_me:$LINENO: checking whether to enable crashdump feature" >&5 -echo $ECHO_N "checking whether to enable crashdump feature... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable crashdump feature" >&5 +$as_echo_n "checking whether to enable crashdump feature... " >&6; } if test "$enable_crashdump" = "yes" -o "$enable_crashdump" = "TRUE"; then ENABLE_CRASHDUMP="TRUE" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } BUILD_TYPE="$BUILD_TYPE CRASHREP" else if test "$enable_crashdump" = "STATIC"; then ENABLE_CRASHDUMP="STATIC" - echo "$as_me:$LINENO: result: yes, STATIC" >&5 -echo "${ECHO_T}yes, STATIC" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, STATIC" >&5 +$as_echo "yes, STATIC" >&6; } BUILD_TYPE="$BUILD_TYPE CRASHREP" else if test "$enable_crashdump" = "" -o "$enable_crashdump" = "no"; then ENABLE_CRASHDUMP="" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } else - { { echo "$as_me:$LINENO: error: --enable-crashdump only accepts yes, no, TRUE or STATIC as parameter." >&5 -echo "$as_me: error: --enable-crashdump only accepts yes, no, TRUE or STATIC as parameter." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "--enable-crashdump only accepts yes, no, TRUE or STATIC as parameter." "$LINENO" 5 fi fi fi @@ -3487,90 +5369,88 @@ if test "$_os" = "WINNT"; then fi if test "$_os" = "WINNT"; then - echo "$as_me:$LINENO: checking whether to use the standard non-optimizing compiler" >&5 -echo $ECHO_N "checking whether to use the standard non-optimizing compiler... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use the standard non-optimizing compiler" >&5 +$as_echo_n "checking whether to use the standard non-optimizing compiler... " >&6; } if test "$enable_cl_standard" = "" -o "$enable_cl_standard" = "no"; then VC_STANDARD="" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } else VC_STANDARD="TRUE" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } fi fi -echo "$as_me:$LINENO: checking whether to turn warnings to errors" >&5 -echo $ECHO_N "checking whether to turn warnings to errors... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to turn warnings to errors" >&5 +$as_echo_n "checking whether to turn warnings to errors... " >&6; } if test -n "$enable_werror" && test "$enable_werror" != "no"; then ENABLE_WERROR="TRUE" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - { echo "$as_me:$LINENO: WARNING: Turning warnings to errors has no effect in modules or" >&5 -echo "$as_me: WARNING: Turning warnings to errors has no effect in modules or" >&2;} - { echo "$as_me:$LINENO: WARNING: on platforms where it has been disabled explicitely" >&5 -echo "$as_me: WARNING: on platforms where it has been disabled explicitely" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Turning warnings to errors has no effect in modules or" >&5 +$as_echo "$as_me: WARNING: Turning warnings to errors has no effect in modules or" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: on platforms where it has been disabled explicitely" >&5 +$as_echo "$as_me: WARNING: on platforms where it has been disabled explicitely" >&2;} echo "Turning warnings to errors has no effect in modules or on platforms where it has been disabled explicitely" >> warn else ENABLE_WERROR="FALSE" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -echo "$as_me:$LINENO: checking whether to do a debug build" >&5 -echo $ECHO_N "checking whether to do a debug build... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to do a debug build" >&5 +$as_echo_n "checking whether to do a debug build... " >&6; } if test -n "$enable_debug" && test "$enable_debug" != "no"; then ENABLE_DEBUG="TRUE" if test -z "$enable_symbols"; then enable_symbols="yes" fi - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else ENABLE_DEBUG="FALSE" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -echo "$as_me:$LINENO: checking whether to build with additional debug utilities" >&5 -echo $ECHO_N "checking whether to build with additional debug utilities... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with additional debug utilities" >&5 +$as_echo_n "checking whether to build with additional debug utilities... " >&6; } if test -n "$enable_dbgutil" && test "$enable_dbgutil" != "no"; then PROEXT="" PRODUCT="" PROFULLSWITCH="" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else PRODUCT="full" PROFULLSWITCH="product=full" PROEXT=".pro" - echo "$as_me:$LINENO: result: no, full product build" >&5 -echo "${ECHO_T}no, full product build" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, full product build" >&5 +$as_echo "no, full product build" >&6; } fi -echo "$as_me:$LINENO: checking whether to include symbols into final build" >&5 -echo $ECHO_N "checking whether to include symbols into final build... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include symbols into final build" >&5 +$as_echo_n "checking whether to include symbols into final build... " >&6; } if test -n "$enable_symbols" && test "$enable_symbols" != "no"; then if test "$enable_symbols" = "yes" -o "$enable_symbols" = "TRUE"; then ENABLE_SYMBOLS="TRUE" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else if test "$enable_symbols" = "SMALL" -o "$enable_symbols" = "small"; then ENABLE_SYMBOLS="SMALL" - echo "$as_me:$LINENO: result: yes, small ones" >&5 -echo "${ECHO_T}yes, small ones" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, small ones" >&5 +$as_echo "yes, small ones" >&6; } else if test "$enable_symbols" != "no" ; then echo enable symbols is: $enable_symbols - { { echo "$as_me:$LINENO: error: --enable-symbols only accepts yes, TRUE or SMALL as parameter." >&5 -echo "$as_me: error: --enable-symbols only accepts yes, TRUE or SMALL as parameter." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "--enable-symbols only accepts yes, TRUE or SMALL as parameter." "$LINENO" 5 else ENABLE_SYMBOLS= fi @@ -3578,22 +5458,20 @@ echo "$as_me: error: --enable-symbols only accepts yes, TRUE or SMALL as paramet fi else ENABLE_SYMBOLS= - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -echo "$as_me:$LINENO: checking whether to strip the solver or not." >&5 -echo $ECHO_N "checking whether to strip the solver or not.... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to strip the solver or not." >&5 +$as_echo_n "checking whether to strip the solver or not.... " >&6; } if test -n "$enable_strip_solver"; then if test "$enable_strip_solver" = "yes"; then DISABLE_STRIP= else if test "$enable_strip_solver" = "no"; then DISABLE_STRIP="TRUE" else - { { echo "$as_me:$LINENO: error: --disable-strip-solver only accepts yes or no as parameter." >&5 -echo "$as_me: error: --disable-strip-solver only accepts yes or no as parameter." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "--disable-strip-solver only accepts yes or no as parameter." "$LINENO" 5 fi fi else @@ -3605,151 +5483,151 @@ else fi -echo "$as_me:$LINENO: checking whether to enable native CUPS support" >&5 -echo $ECHO_N "checking whether to enable native CUPS support... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable native CUPS support" >&5 +$as_echo_n "checking whether to enable native CUPS support... " >&6; } if test "$test_cups" = "yes" -a \( "$enable_cups" = "yes" -o "$enable_cups" = "TRUE" \) ; then ENABLE_CUPS="TRUE" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else ENABLE_CUPS="" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -echo "$as_me:$LINENO: checking whether to enable fontconfig support" >&5 -echo $ECHO_N "checking whether to enable fontconfig support... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable fontconfig support" >&5 +$as_echo_n "checking whether to enable fontconfig support... " >&6; } if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a \( "$enable_fontconfig" = "yes" -o "$enable_fontconfig" = "TRUE" \); then ENABLE_FONTCONFIG="TRUE" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else ENABLE_FONTCONFIG="" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -echo "$as_me:$LINENO: checking whether to enable filters for legacy binary file formats (StarOffice 5.2)" >&5 -echo $ECHO_N "checking whether to enable filters for legacy binary file formats (StarOffice 5.2)... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable filters for legacy binary file formats (StarOffice 5.2)" >&5 +$as_echo_n "checking whether to enable filters for legacy binary file formats (StarOffice 5.2)... " >&6; } if test "$enable_binfilter" = "no"; then WITH_BINFILTER="NO" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } else WITH_BINFILTER="YES" BUILD_TYPE="$BUILD_TYPE BINFILTER" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } fi if test "$_os" = "WINNT"; then - echo "$as_me:$LINENO: checking whether to use DirectX" >&5 -echo $ECHO_N "checking whether to use DirectX... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use DirectX" >&5 +$as_echo_n "checking whether to use DirectX... " >&6; } if test "$enable_directx" = "yes" -o "$enable_directx" = "TRUE" -o "$enable_directx" = ""; then ENABLE_DIRECTX="TRUE" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else ENABLE_DIRECTX="" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi - echo "$as_me:$LINENO: checking whether to use ActiveX" >&5 -echo $ECHO_N "checking whether to use ActiveX... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use ActiveX" >&5 +$as_echo_n "checking whether to use ActiveX... " >&6; } if test "$enable_activex" = "yes" -o "$enable_activex" = "TRUE" -o "$enable_activex" = ""; then DISABLE_ACTIVEX="" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else DISABLE_ACTIVEX="TRUE" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi - echo "$as_me:$LINENO: checking whether to use ATL" >&5 -echo $ECHO_N "checking whether to use ATL... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use ATL" >&5 +$as_echo_n "checking whether to use ATL... " >&6; } if test "$enable_atl" = "yes" -o "$enable_atl" = "TRUE" -o "$enable_atl" = ""; then DISABLE_ATL="" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else DISABLE_ATL="TRUE" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi fi -echo "$as_me:$LINENO: checking whether to use RPATH in shared libraries" >&5 -echo $ECHO_N "checking whether to use RPATH in shared libraries... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use RPATH in shared libraries" >&5 +$as_echo_n "checking whether to use RPATH in shared libraries... " >&6; } if test "$enable_rpath" = "no"; then ENABLE_RPATH="no" else ENABLE_RPATH="yes" fi -echo "$as_me:$LINENO: result: $ENABLE_RPATH" >&5 -echo "${ECHO_T}$ENABLE_RPATH" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ENABLE_RPATH" >&5 +$as_echo "$ENABLE_RPATH" >&6; } -echo "$as_me:$LINENO: checking whether to include MySpell dictionaries" >&5 -echo $ECHO_N "checking whether to include MySpell dictionaries... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include MySpell dictionaries" >&5 +$as_echo_n "checking whether to include MySpell dictionaries... " >&6; } if test -z "$with_myspell_dicts" || test "$with_myspell_dicts" = "yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } WITH_MYSPELL_DICTS=YES BUILD_TYPE="$BUILD_TYPE DICTIONARIES" else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } WITH_MYSPELL_DICTS=NO fi if test "$WITH_MYSPELL_DICTS" = "NO"; then - echo "$as_me:$LINENO: checking whether to use dicts from external paths" >&5 -echo $ECHO_N "checking whether to use dicts from external paths... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use dicts from external paths" >&5 +$as_echo_n "checking whether to use dicts from external paths... " >&6; } if test -n "$with_system_dicts" -a "$with_system_dicts" = "yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } SYSTEM_DICTS=YES - echo "$as_me:$LINENO: checking for spelling dictionary directory" >&5 -echo $ECHO_N "checking for spelling dictionary directory... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for spelling dictionary directory" >&5 +$as_echo_n "checking for spelling dictionary directory... " >&6; } if test -n "$with_external_dict_dir"; then DICT_SYSTEM_DIR=file://$with_external_dict_dir else DICT_SYSTEM_DIR=file:///usr/share/hunspell fi - echo "$as_me:$LINENO: result: $DICT_SYSTEM_DIR" >&5 -echo "${ECHO_T}$DICT_SYSTEM_DIR" >&6 - echo "$as_me:$LINENO: checking for hyphenation patterns directory" >&5 -echo $ECHO_N "checking for hyphenation patterns directory... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DICT_SYSTEM_DIR" >&5 +$as_echo "$DICT_SYSTEM_DIR" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hyphenation patterns directory" >&5 +$as_echo_n "checking for hyphenation patterns directory... " >&6; } if test -n "$with_external_hyph_dir"; then HYPH_SYSTEM_DIR=file://$with_external_hyph_dir else HYPH_SYSTEM_DIR=file:///usr/share/hyphen fi - echo "$as_me:$LINENO: result: $HYPH_SYSTEM_DIR" >&5 -echo "${ECHO_T}$HYPH_SYSTEM_DIR" >&6 - echo "$as_me:$LINENO: checking for thesaurus directory" >&5 -echo $ECHO_N "checking for thesaurus directory... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HYPH_SYSTEM_DIR" >&5 +$as_echo "$HYPH_SYSTEM_DIR" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thesaurus directory" >&5 +$as_echo_n "checking for thesaurus directory... " >&6; } if test -n "$with_external_thes_dir"; then THES_SYSTEM_DIR=file://$with_external_thes_dir else THES_SYSTEM_DIR=file:///usr/share/mythes fi - echo "$as_me:$LINENO: result: $THES_SYSTEM_DIR" >&5 -echo "${ECHO_T}$THES_SYSTEM_DIR" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $THES_SYSTEM_DIR" >&5 +$as_echo "$THES_SYSTEM_DIR" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } SYSTEM_DICTS=NO fi fi @@ -3758,22 +5636,16 @@ fi -echo "$as_me:$LINENO: checking which shell to use" >&5 -echo $ECHO_N "checking which shell to use... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which shell to use" >&5 +$as_echo_n "checking which shell to use... " >&6; } if test $_os = "WINNT"; then if test "$with_use_shell" != "tcsh" -a "$with_use_shell" != "bash"; then - { { echo "$as_me:$LINENO: error: only \"tcsh\" or \"bash\" are supported options" >&5 -echo "$as_me: error: only \"tcsh\" or \"bash\" are supported options" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "only \"tcsh\" or \"bash\" are supported options" "$LINENO" 5 fi if test -L $AWK -o -L `which awk` -o -L `which tar` -o -L `which gunzip` ; then - { { echo "$as_me:$LINENO: error: $AWK, awk, tar or gunzip is a cygwin symlink! -Native windows programs cannot use cygwin symlinks. Remove the symbolic -link, and copy the program to the name of the link." >&5 -echo "$as_me: error: $AWK, awk, tar or gunzip is a cygwin symlink! + as_fn_error "$AWK, awk, tar or gunzip is a cygwin symlink! Native windows programs cannot use cygwin symlinks. Remove the symbolic -link, and copy the program to the name of the link." >&2;} - { (exit 1); exit 1; }; } +link, and copy the program to the name of the link." "$LINENO" 5 fi CC=`echo $CC | $SED "s/^guw.exe //"` CXX=`echo $CXX | $SED "s/^guw.exe //"` @@ -3793,33 +5665,27 @@ link, and copy the program to the name of the link." >&2;} fi elif test $_os = "OS2"; then if test "$with_use_shell" != "tcsh"; then - { { echo "$as_me:$LINENO: error: only \"tcsh\" is supported options" >&5 -echo "$as_me: error: only \"tcsh\" is supported options" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "only \"tcsh\" is supported options" "$LINENO" 5 fi else if test "$with_use_shell" != "tcsh" -a "$with_use_shell" != "bash"; then - { { echo "$as_me:$LINENO: error: only \"tcsh\" or \"bash\" are supported options" >&5 -echo "$as_me: error: only \"tcsh\" or \"bash\" are supported options" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "only \"tcsh\" or \"bash\" are supported options" "$LINENO" 5 fi fi USE_SHELL="$with_use_shell" -echo "$as_me:$LINENO: result: $USE_SHELL" >&5 -echo "${ECHO_T}$USE_SHELL" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_SHELL" >&5 +$as_echo "$USE_SHELL" >&6; } if test "$_os" = "WINNT" ; then - echo "$as_me:$LINENO: checking for cygwin gcc/g++" >&5 -echo $ECHO_N "checking for cygwin gcc/g++... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cygwin gcc/g++" >&5 +$as_echo_n "checking for cygwin gcc/g++... " >&6; } if which gcc > /dev/null && which g++ > /dev/null ; then - echo "$as_me:$LINENO: result: found" >&5 -echo "${ECHO_T}found" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 +$as_echo "found" >&6; } else - { { echo "$as_me:$LINENO: error: cygwin gcc and g++ are needed, please install them." >&5 -echo "$as_me: error: cygwin gcc and g++ are needed, please install them." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cygwin gcc and g++ are needed, please install them." "$LINENO" 5 fi fi @@ -3827,10 +5693,10 @@ fi if test "$with_use_shell" = "tcsh"; then # Extract the first word of "tcsh", so it can be a program name with args. set dummy tcsh; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_SHELLPATH+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_SHELLPATH+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $SHELLPATH in [\\/]* | ?:[\\/]*) @@ -3842,42 +5708,41 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_SHELLPATH="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS ;; esac fi SHELLPATH=$ac_cv_path_SHELLPATH - if test -n "$SHELLPATH"; then - echo "$as_me:$LINENO: result: $SHELLPATH" >&5 -echo "${ECHO_T}$SHELLPATH" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SHELLPATH" >&5 +$as_echo "$SHELLPATH" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + if test -z "$SHELLPATH"; then - { { echo "$as_me:$LINENO: error: tcsh not found in \$PATH" >&5 -echo "$as_me: error: tcsh not found in \$PATH" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "tcsh not found in \$PATH" "$LINENO" 5 else SHELLPATH=`echo $SHELLPATH | $SED -n "s/\/tcsh$//p"` fi elif test "$with_use_shell" = "bash"; then # Extract the first word of "bash", so it can be a program name with args. set dummy bash; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_SHELLPATH+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_SHELLPATH+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $SHELLPATH in [\\/]* | ?:[\\/]*) @@ -3889,51 +5754,50 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_SHELLPATH="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS ;; esac fi SHELLPATH=$ac_cv_path_SHELLPATH - if test -n "$SHELLPATH"; then - echo "$as_me:$LINENO: result: $SHELLPATH" >&5 -echo "${ECHO_T}$SHELLPATH" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SHELLPATH" >&5 +$as_echo "$SHELLPATH" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + if test -z "$SHELLPATH"; then - { { echo "$as_me:$LINENO: error: bash not found in \$PATH" >&5 -echo "$as_me: error: bash not found in \$PATH" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "bash not found in \$PATH" "$LINENO" 5 else SHELLPATH=`echo $SHELLPATH | $SED -n "s/\/bash$//p"` fi else - { echo "$as_me:$LINENO: WARNING: Windows/OS/2 4NT builds don't test for the shell" >&5 -echo "$as_me: WARNING: Windows/OS/2 4NT builds don't test for the shell" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Windows/OS/2 4NT builds don't test for the shell" >&5 +$as_echo "$as_me: WARNING: Windows/OS/2 4NT builds don't test for the shell" >&2;} SHELLPATH="NO_SHELLPATH_NEEDED" fi -echo "$as_me:$LINENO: checking gcc home" >&5 -echo $ECHO_N "checking gcc home... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking gcc home" >&5 +$as_echo_n "checking gcc home... " >&6; } if test -z "$with_gcc_home"; then GCC_HOME=`which gcc | $SED -e s,/bin/gcc,,` else GCC_HOME="$with_gcc_home" fi -echo "$as_me:$LINENO: result: $GCC_HOME" >&5 -echo "${ECHO_T}$GCC_HOME" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $GCC_HOME" >&5 +$as_echo "$GCC_HOME" >&6; } if test -n "$with_gcc_home"; then @@ -3951,10 +5815,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -3964,35 +5828,37 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -4002,39 +5868,50 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -4044,77 +5921,37 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi + fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -4125,18 +5962,19 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. @@ -4154,24 +5992,25 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -4181,39 +6020,41 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -4223,66 +6064,78 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$ac_ct_CC" && break done - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi fi fi -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "no acceptable C compiler found in \$PATH +See \`config.log' for more details." "$LINENO" 5; } # Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -4294,112 +6147,109 @@ main () } _ACEOF ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe b.out" +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 -ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 - (eval $ac_link_default) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Find the output, starting from the most likely. This scheme is -# not robust to junk in `.', hence go to wildcards (a.*) only as a last -# resort. - -# Be careful to initialize this variable, since it used to be cached. -# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. -ac_cv_exeext= -# b.out is created by i960 compilers. -for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) - ;; - conftest.$ac_ext ) - # This is the source file. + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool, - # but it would be cool to find out if it's true. Does anybody - # maintain Libtool? --akim. - export ac_cv_exeext + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. break;; * ) break;; esac done +test "$ac_cv_exeext" = no && ac_cv_exeext= + else - echo "$as_me: failed program was:" >&5 + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables -See \`config.log' for more details." >&5 -echo "$as_me: error: C compiler cannot create executables -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ as_fn_set_status 77 +as_fn_error "C compiler cannot create executables +See \`config.log' for more details." "$LINENO" 5; }; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } fi - +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6 - -# Check the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 -# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 -# If not cross compiling, check that we can run a simple program. -if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { echo "$as_me:$LINENO: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - fi - fi -fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -rm -f a.out a.exe conftest$ac_cv_exeext b.out +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -# Check the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6 - -echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with @@ -4407,38 +6257,90 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext break;; * ) break;; esac done else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." "$LINENO" 5; } fi - -rm -f conftest$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6 +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 -if test "${ac_cv_objext+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if test "${ac_cv_objext+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -4450,45 +6352,46 @@ main () } _ACEOF rm -f conftest.o conftest.obj -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot compute suffix of object files: cannot compile +See \`config.log' for more details." "$LINENO" 5; } fi - rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 -if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then : + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -4502,55 +6405,34 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_compiler_gnu=no + ac_compiler_gnu=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 -GCC=`test $ac_compiler_gnu = yes && echo yes` +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -CFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -4561,39 +6443,49 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ -ac_cv_prog_cc_g=no + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -4609,18 +6501,14 @@ else CFLAGS= fi fi -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then : + $as_echo_n "(cached) " >&6 else - ac_cv_prog_cc_stdc=no + ac_cv_prog_cc_c89=no ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -4648,12 +6536,17 @@ static char *f (char * (*g) (char **, int), char **p, ...) /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std1 is added to get + as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std1. */ + that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; @@ -4668,205 +6561,37 @@ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; return 0; } _ACEOF -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg fi -rm -f conftest.err conftest.$ac_objext +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break done -rm -f conftest.$ac_ext conftest.$ac_objext +rm -f conftest.$ac_ext CC=$ac_save_CC fi - -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac +if test "x$ac_cv_prog_cc_c89" != xno; then : -# Some people use a C++ compiler to compile C. Since we use `exit', -# in C++ we need to declare it. In case someone uses the same compiler -# for both compiling C and C++ we need to have the C++ compiler decide -# the declaration of exit, since it's the most demanding environment. -cat >conftest.$ac_ext <<_ACEOF -#ifndef __cplusplus - choke me -#endif -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - for ac_declaration in \ - '' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -#include -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -continue -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -4881,10 +6606,10 @@ if test "$COMPATH" = "." ; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_COMPATH+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_COMPATH+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $COMPATH in [\\/]* | ?:[\\/]*) @@ -4896,28 +6621,29 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_COMPATH="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS ;; esac fi COMPATH=$ac_cv_path_COMPATH - if test -n "$COMPATH"; then - echo "$as_me:$LINENO: result: $COMPATH" >&5 -echo "${ECHO_T}$COMPATH" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $COMPATH" >&5 +$as_echo "$COMPATH" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$COMPATH" && break done @@ -4926,54 +6652,44 @@ fi GCCVER=20995 if test \( "$_os" != "WINNT" -o "$WITH_MINGWIN" = "yes" \) -a "$GCC" = "yes"; then - echo "$as_me:$LINENO: checking the GNU gcc compiler version" >&5 -echo $ECHO_N "checking the GNU gcc compiler version... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking the GNU gcc compiler version" >&5 +$as_echo_n "checking the GNU gcc compiler version... " >&6; } _gcc_version=`$CC -dumpversion` _gcc_major=`echo $_gcc_version | $AWK -F. '{ print \$1 }'` _gcc_longver=`echo $_gcc_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'` GCCVER=`echo $_gcc_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'` if test "$_gcc_major" -lt "3"; then - { { echo "$as_me:$LINENO: error: found version \"$_gcc_version\", use version 3+ of the gcc compiler" >&5 -echo "$as_me: error: found version \"$_gcc_version\", use version 3+ of the gcc compiler" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "found version \"$_gcc_version\", use version 3+ of the gcc compiler" "$LINENO" 5 else if test "$GCCVER" -eq "030203"; then if test "$ENABLE_SYMBOLS" = "SMALL"; then - { { echo "$as_me:$LINENO: error: version \"$_gcc_version\" gives internal error with small." >&5 -echo "$as_me: error: version \"$_gcc_version\" gives internal error with small." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "version \"$_gcc_version\" gives internal error with small." "$LINENO" 5 fi fi fi - echo "$as_me:$LINENO: result: checked (gcc $_gcc_version)" >&5 -echo "${ECHO_T}checked (gcc $_gcc_version)" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked (gcc $_gcc_version)" >&5 +$as_echo "checked (gcc $_gcc_version)" >&6; } if test "$_os" = "SunOS"; then - echo "$as_me:$LINENO: checking gcc linker" >&5 -echo $ECHO_N "checking gcc linker... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking gcc linker" >&5 +$as_echo_n "checking gcc linker... " >&6; } if $CC -Wl,--version 2>&1 |head -n 1| grep -v GNU > /dev/null;then - { { echo "$as_me:$LINENO: error: failed (not GNU ld). Use GNU ld instead of Sun ld on Solaris" >&5 -echo "$as_me: error: failed (not GNU ld). Use GNU ld instead of Sun ld on Solaris" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "failed (not GNU ld). Use GNU ld instead of Sun ld on Solaris" "$LINENO" 5 fi - echo "$as_me:$LINENO: result: ok (GNU ld)" >&5 -echo "${ECHO_T}ok (GNU ld)" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok (GNU ld)" >&5 +$as_echo "ok (GNU ld)" >&6; } fi fi HAVE_LD_BSYMBOLIC_FUNCTIONS= if test "$GCC" = "yes"; then - echo "$as_me:$LINENO: checking for -Bsymbolic-functions linker support " >&5 -echo $ECHO_N "checking for -Bsymbolic-functions linker support ... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Bsymbolic-functions linker support " >&5 +$as_echo_n "checking for -Bsymbolic-functions linker support ... " >&6; } bsymbolic_functions_ldflags_save=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions -Wl,--dynamic-list-cpp-new -Wl,--dynamic-list-cpp-typeinfo" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -4988,85 +6704,60 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_link "$LINENO"; then : HAVE_LD_BSYMBOLIC_FUNCTIONS=TRUE -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext if test "z$HAVE_LD_BSYMBOLIC_FUNCTIONS" = "zTRUE"; then - echo "$as_me:$LINENO: result: found " >&5 -echo "${ECHO_T}found " >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found " >&5 +$as_echo "found " >&6; } else - echo "$as_me:$LINENO: result: not found " >&5 -echo "${ECHO_T}not found " >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found " >&5 +$as_echo "not found " >&6; } fi LDFLAGS=$bsymbolic_functions_ldflags_save fi -echo "$as_me:$LINENO: checking whether to enable pch feature" >&5 -echo $ECHO_N "checking whether to enable pch feature... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable pch feature" >&5 +$as_echo_n "checking whether to enable pch feature... " >&6; } if test -n "$enable_pch" && test "$enable_pch" != "no"; then if test "$_os" = "WINNT" -a "$WITH_MINGWIN" != "yes"; then ENABLE_PCH="TRUE" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } elif test "$GCC" = "yes" -a "$GCCVER" -gt "030400"; then ENABLE_PCH="TRUE" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else ENABLE_PCH="" - { echo "$as_me:$LINENO: WARNING: Precompiled header not yet supported for your platform/compiler" >&5 -echo "$as_me: WARNING: Precompiled header not yet supported for your platform/compiler" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Precompiled header not yet supported for your platform/compiler" >&5 +$as_echo "$as_me: WARNING: Precompiled header not yet supported for your platform/compiler" >&2;} fi else ENABLE_PCH="" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -echo "$as_me:$LINENO: checking whether to enable hid list feature" >&5 -echo $ECHO_N "checking whether to enable hid list feature... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable hid list feature" >&5 +$as_echo_n "checking whether to enable hid list feature... " >&6; } if test -n "$enable_hids" && test "$enable_hids" != "no"; then NO_HIDS="" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else NO_HIDS="TRUE" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -echo "$as_me:$LINENO: checking for GNU make" >&5 -echo $ECHO_N "checking for GNU make... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU make" >&5 +$as_echo_n "checking for GNU make... " >&6; } for a in "$MAKE" $GNUMAKE make gmake gnumake; do $a --version 2> /dev/null | grep GNU 2>&1 > /dev/null if test $? -eq 0; then @@ -5074,40 +6765,36 @@ for a in "$MAKE" $GNUMAKE make gmake gnumake; do break fi done -echo "$as_me:$LINENO: result: $GNUMAKE" >&5 -echo "${ECHO_T}$GNUMAKE" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $GNUMAKE" >&5 +$as_echo "$GNUMAKE" >&6; } if test -z "$GNUMAKE"; then - { { echo "$as_me:$LINENO: error: not found. install GNU make." >&5 -echo "$as_me: error: not found. install GNU make." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "not found. install GNU make." "$LINENO" 5 fi -echo "$as_me:$LINENO: checking the GNU make version" >&5 -echo $ECHO_N "checking the GNU make version... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the GNU make version" >&5 +$as_echo_n "checking the GNU make version... " >&6; } _make_version=`$GNUMAKE --version | grep GNU | $SED -e 's@^[^0-9]*@@' -e 's@ .*@@' -e 's@,.*@@'`; _make_longver=`echo $_make_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'` if test "$_make_longver" -ge "037901" ; then - echo "$as_me:$LINENO: result: $GNUMAKE $_make_version" >&5 -echo "${ECHO_T}$GNUMAKE $_make_version" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GNUMAKE $_make_version" >&5 +$as_echo "$GNUMAKE $_make_version" >&6; } else if test "$_os" = "Darwin"; then if test "$_make_longver" -ge "037900" ; then - echo "$as_me:$LINENO: result: $GNUMAKE $_make_version" >&5 -echo "${ECHO_T}$GNUMAKE $_make_version" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GNUMAKE $_make_version" >&5 +$as_echo "$GNUMAKE $_make_version" >&6; } else - { echo "$as_me:$LINENO: WARNING: failed ($GNUMAKE $_make_version need 3.79.0+)" >&5 -echo "$as_me: WARNING: failed ($GNUMAKE $_make_version need 3.79.0+)" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: failed ($GNUMAKE $_make_version need 3.79.0+)" >&5 +$as_echo "$as_me: WARNING: failed ($GNUMAKE $_make_version need 3.79.0+)" >&2;} fi else - { { echo "$as_me:$LINENO: error: failed ($GNUMAKE $_make_version need 3.79.1+)" >&5 -echo "$as_me: error: failed ($GNUMAKE $_make_version need 3.79.1+)" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "failed ($GNUMAKE $_make_version need 3.79.1+)" "$LINENO" 5 fi fi -echo "$as_me:$LINENO: checking for GNU tar" >&5 -echo $ECHO_N "checking for GNU tar... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU tar" >&5 +$as_echo_n "checking for GNU tar... " >&6; } for a in $GNUTAR gtar gnutar tar; do $a --version 2> /dev/null | grep GNU 2>&1 > /dev/null if test $? -eq 0; then @@ -5115,12 +6802,10 @@ for a in $GNUTAR gtar gnutar tar; do break fi done -echo "$as_me:$LINENO: result: $GNUTAR" >&5 -echo "${ECHO_T}$GNUTAR" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $GNUTAR" >&5 +$as_echo "$GNUTAR" >&6; } if test -z "$GNUTAR"; then - { { echo "$as_me:$LINENO: error: not found. install GNU tar." >&5 -echo "$as_me: error: not found. install GNU tar." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "not found. install GNU tar." "$LINENO" 5 fi @@ -5131,10 +6816,10 @@ if test "$_os" = "SunOS"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path__cc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path__cc+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $_cc in [\\/]* | ?:[\\/]*) @@ -5146,65 +6831,58 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path__cc="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS ;; esac fi _cc=$ac_cv_path__cc - if test -n "$_cc"; then - echo "$as_me:$LINENO: result: $_cc" >&5 -echo "${ECHO_T}$_cc" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_cc" >&5 +$as_echo "$_cc" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$_cc" && break done COMPATH=`echo $_cc | $SED -n "s/\/cc//p"` - echo "$as_me:$LINENO: checking the SunStudio C/C++ compiler version" >&5 -echo $ECHO_N "checking the SunStudio C/C++ compiler version... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking the SunStudio C/C++ compiler version" >&5 +$as_echo_n "checking the SunStudio C/C++ compiler version... " >&6; } _sunstudio_string=`$CC -V 2>&1 | grep '^cc' | sed -e 's/.* C //'` _sunstudio_version=`echo $_sunstudio_string | $AWK '{ print $1 }'` _sunstudio_major=`echo $_sunstudio_version | $AWK -F. '{ print $1 }'` if test "$_sunstudio_major" != "5"; then - { { echo "$as_me:$LINENO: error: found version \"$_sunstudio_version\", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler" >&5 -echo "$as_me: error: found version \"$_sunstudio_version\", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "found version \"$_sunstudio_version\", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler" "$LINENO" 5 else _sunstudio_minor=`echo $_sunstudio_version | $AWK -F. '{ if ($2 == 5) print "true"; else if ($2 == 7) print "true"; else if ($2 == 8) print "true"; else if ($2 == 9) print "true"; else print "false" }'` if test "$_sunstudio_minor" = "false"; then - { { echo "$as_me:$LINENO: error: found version \"$_sunstudio_version\", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler" >&5 -echo "$as_me: error: found version \"$_sunstudio_version\", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "found version \"$_sunstudio_version\", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler" "$LINENO" 5 else - echo "$as_me:$LINENO: result: checked" >&5 -echo "${ECHO_T}checked" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked" >&5 +$as_echo "checked" >&6; } fi fi fi fi if test "$GCC" = "yes"; then - echo "$as_me:$LINENO: checking for --hash-style=both linker support " >&5 -echo $ECHO_N "checking for --hash-style=both linker support ... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --hash-style=both linker support " >&5 +$as_echo_n "checking for --hash-style=both linker support ... " >&6; } hash_style_ldflags_save=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,--hash-style=both" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -5219,43 +6897,19 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_link "$LINENO"; then : HAVE_LD_HASH_STYLE=TRUE else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -HAVE_LD_HASH_STYLE=FALSE + HAVE_LD_HASH_STYLE=FALSE fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext if test "z$HAVE_LD_HASH_STYLE" = "zTRUE"; then - echo "$as_me:$LINENO: result: found " >&5 -echo "${ECHO_T}found " >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found " >&5 +$as_echo "found " >&6; } else - echo "$as_me:$LINENO: result: not found " >&5 -echo "${ECHO_T}not found " >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found " >&5 +$as_echo "not found " >&6; } fi LDFLAGS=$hash_style_ldflags_save fi @@ -5267,10 +6921,10 @@ if test "$_os" = "IRIX" -o "$_os" = "IRIX64"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path__cc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path__cc+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $_cc in [\\/]* | ?:[\\/]*) @@ -5282,49 +6936,46 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path__cc="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS ;; esac fi _cc=$ac_cv_path__cc - if test -n "$_cc"; then - echo "$as_me:$LINENO: result: $_cc" >&5 -echo "${ECHO_T}$_cc" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_cc" >&5 +$as_echo "$_cc" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$_cc" && break done COMPATH=`echo $_cc | $SED -n "s/\/cc//p"` - echo "$as_me:$LINENO: checking the SGI MIPSpro C compiler version" >&5 -echo $ECHO_N "checking the SGI MIPSpro C compiler version... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking the SGI MIPSpro C compiler version" >&5 +$as_echo_n "checking the SGI MIPSpro C compiler version... " >&6; } _mipspro_version=`$CC -version 2>&1 | $AWK '{ print $4 }'` _mipspro_major=`echo $_mipspro_version | $AWK -F. '{ print $1 }'` if test "$_mipspro_major" != "7"; then - { { echo "$as_me:$LINENO: error: found version \"$_mipspro_version\", use version 7.2+ of the SGI MIPSpro C compiler" >&5 -echo "$as_me: error: found version \"$_mipspro_version\", use version 7.2+ of the SGI MIPSpro C compiler" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "found version \"$_mipspro_version\", use version 7.2+ of the SGI MIPSpro C compiler" "$LINENO" 5 else _mipspro_minor=`echo $_mipspro_version | $AWK -F. '{ if ($2 <= 1) print "false"; else print "true" }'` if test "$_mipspro_minor" = "false"; then - { { echo "$as_me:$LINENO: error: found version \"$_mipspro_version\", use version 7.2+ of the SGI MIPSpro C compiler" >&5 -echo "$as_me: error: found version \"$_mipspro_version\", use version 7.2+ of the SGI MIPSpro C compiler" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "found version \"$_mipspro_version\", use version 7.2+ of the SGI MIPSpro C compiler" "$LINENO" 5 else - echo "$as_me:$LINENO: result: checked" >&5 -echo "${ECHO_T}checked" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked" >&5 +$as_echo "checked" >&6; } fi fi fi @@ -5336,10 +6987,10 @@ if test "$_os" = "OSF1"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path__cc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path__cc+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $_cc in [\\/]* | ?:[\\/]*) @@ -5351,45 +7002,44 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path__cc="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS ;; esac fi _cc=$ac_cv_path__cc - if test -n "$_cc"; then - echo "$as_me:$LINENO: result: $_cc" >&5 -echo "${ECHO_T}$_cc" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_cc" >&5 +$as_echo "$_cc" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$_cc" && break done COMPATH=`echo $_cc | $SED -n "s/\/cc//p"` - { echo "$as_me:$LINENO: WARNING: ******* $_cc , $COMPATH" >&5 -echo "$as_me: WARNING: ******* $_cc , $COMPATH" >&2;} - echo "$as_me:$LINENO: checking the Compaq C compiler version" >&5 -echo $ECHO_N "checking the Compaq C compiler version... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ******* $_cc , $COMPATH" >&5 +$as_echo "$as_me: WARNING: ******* $_cc , $COMPATH" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: checking the Compaq C compiler version" >&5 +$as_echo_n "checking the Compaq C compiler version... " >&6; } _compaqc_version=`$CC -V 2>&1 | $AWK '{ print $3 }'` _compaqc_major=`echo $_compaqc_version | $AWK -F. '{ print $1 }'` if test "$_compaqc_major" != "T6"; then - { { echo "$as_me:$LINENO: error: found version \"$_compaqc_version\", use version 6 of the Compaq C compiler" >&5 -echo "$as_me: error: found version \"$_compaqc_version\", use version 6 of the Compaq C compiler" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "found version \"$_compaqc_version\", use version 6 of the Compaq C compiler" "$LINENO" 5 else - echo "$as_me:$LINENO: result: checked" >&5 -echo "${ECHO_T}checked" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked" >&5 +$as_echo "checked" >&6; } fi fi fi @@ -5397,10 +7047,10 @@ fi if test -z "$with_perl_home"; then # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PERL+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PERL+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $PERL in [\\/]* | ?:[\\/]*) @@ -5412,28 +7062,29 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS ;; esac fi PERL=$ac_cv_path_PERL - if test -n "$PERL"; then - echo "$as_me:$LINENO: result: $PERL" >&5 -echo "${ECHO_T}$PERL" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 +$as_echo "$PERL" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + else if test "$_os" = "WINNT"; then with_perl_home=`cygpath -u "$with_perl_home"` @@ -5442,46 +7093,38 @@ else if test -x "$_perl_path"; then PERL=$_perl_path else - { { echo "$as_me:$LINENO: error: $_perl_path not found" >&5 -echo "$as_me: error: $_perl_path not found" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "$_perl_path not found" "$LINENO" 5 fi fi if test "$PERL"; then - echo "$as_me:$LINENO: checking the Perl version" >&5 -echo $ECHO_N "checking the Perl version... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking the Perl version" >&5 +$as_echo_n "checking the Perl version... " >&6; } ${PERL} -e "exit($]);" _perl_version=$? if test "$_perl_version" -lt 5; then - { { echo "$as_me:$LINENO: error: found Perl version \"$_perl_version\", use version 5 of Perl" >&5 -echo "$as_me: error: found Perl version \"$_perl_version\", use version 5 of Perl" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "found Perl version \"$_perl_version\", use version 5 of Perl" "$LINENO" 5 fi - echo "$as_me:$LINENO: result: checked (perl $_perl_version)" >&5 -echo "${ECHO_T}checked (perl $_perl_version)" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked (perl $_perl_version)" >&5 +$as_echo "checked (perl $_perl_version)" >&6; } else - { { echo "$as_me:$LINENO: error: Perl not found, install version 5 of Perl" >&5 -echo "$as_me: error: Perl not found, install version 5 of Perl" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Perl not found, install version 5 of Perl" "$LINENO" 5 fi -echo "$as_me:$LINENO: checking for required Perl modules" >&5 -echo $ECHO_N "checking for required Perl modules... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for required Perl modules" >&5 +$as_echo_n "checking for required Perl modules... " >&6; } if `$PERL -e 'use Archive::Zip;'`; then - echo "$as_me:$LINENO: result: all modules found" >&5 -echo "${ECHO_T}all modules found" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: all modules found" >&5 +$as_echo "all modules found" >&6; } else - { { echo "$as_me:$LINENO: error: Failed to find some modules" >&5 -echo "$as_me: error: Failed to find some modules" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Failed to find some modules" "$LINENO" 5 fi if test "$_os" = "WINNT"; then if test "$WITH_MINGWIN" != "yes"; then - echo "$as_me:$LINENO: checking for friendly registry keys" >&5 -echo $ECHO_N "checking for friendly registry keys... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for friendly registry keys" >&5 +$as_echo_n "checking for friendly registry keys... " >&6; } # VS.Net 2003, VS.Net 2005 if test -z "$with_cl_home"; then vctest=`./oowintool --msvc-productdir`; @@ -5491,8 +7134,8 @@ echo $ECHO_N "checking for friendly registry keys... $ECHO_C" >&6 else with_cl_home=`cygpath -u "$with_cl_home"` fi - echo "$as_me:$LINENO: result: done" >&5 -echo "${ECHO_T}done" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +$as_echo "done" >&6; } if test -n "$with_mspdb_path";then with_mspdb_path=`cygpath -u "$with_mspdb_path"` @@ -5513,10 +7156,10 @@ echo "${ECHO_T}done" >&6 if test -z "$MSPDB_PATH";then # Extract the first word of "mspdb80.dll", so it can be a program name with args. set dummy mspdb80.dll; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_MSPDB_PATH+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_MSPDB_PATH+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $MSPDB_PATH in [\\/]* | ?:[\\/]*) @@ -5528,34 +7171,35 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MSPDB_PATH="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS ;; esac fi MSPDB_PATH=$ac_cv_path_MSPDB_PATH - if test -n "$MSPDB_PATH"; then - echo "$as_me:$LINENO: result: $MSPDB_PATH" >&5 -echo "${ECHO_T}$MSPDB_PATH" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSPDB_PATH" >&5 +$as_echo "$MSPDB_PATH" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + # Extract the first word of "mspdb71.dll", so it can be a program name with args. set dummy mspdb71.dll; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_MSPDB_PATH+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_MSPDB_PATH+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $MSPDB_PATH in [\\/]* | ?:[\\/]*) @@ -5567,51 +7211,50 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MSPDB_PATH="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS ;; esac fi MSPDB_PATH=$ac_cv_path_MSPDB_PATH - if test -n "$MSPDB_PATH"; then - echo "$as_me:$LINENO: result: $MSPDB_PATH" >&5 -echo "${ECHO_T}$MSPDB_PATH" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSPDB_PATH" >&5 +$as_echo "$MSPDB_PATH" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + MSPDB_PATH=`dirname "$MSPDB_PATH"` fi if test -z "$MSPDB_PATH"; then - { { echo "$as_me:$LINENO: error: You need a mspdb71.dll/mspdb80.dll, make sure it's in the path or use --with-mspdb-path" >&5 -echo "$as_me: error: You need a mspdb71.dll/mspdb80.dll, make sure it's in the path or use --with-mspdb-path" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "You need a mspdb71.dll/mspdb80.dll, make sure it's in the path or use --with-mspdb-path" "$LINENO" 5 fi MSPDB_PATH=`cygpath -d "$MSPDB_PATH"` MSPDB_PATH=`cygpath -u "$MSPDB_PATH"` PATH="$MSPDB_PATH:$PATH" - echo "$as_me:$LINENO: checking the Microsoft C/C++ Compiler" >&5 -echo $ECHO_N "checking the Microsoft C/C++ Compiler... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking the Microsoft C/C++ Compiler" >&5 +$as_echo_n "checking the Microsoft C/C++ Compiler... " >&6; } if test -x "$with_cl_home/bin/cl.exe"; then CC="$with_cl_home/bin/cl.exe" else # Extract the first word of "cl.exe", so it can be a program name with args. set dummy cl.exe; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $CC in [\\/]* | ?:[\\/]*) @@ -5623,40 +7266,41 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CC="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS ;; esac fi CC=$ac_cv_path_CC - if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test -e "$CC"; then # This gives us a posix path with 8.3 filename restrictions CC=`cygpath -d "$CC"` CC=`cygpath -u "$CC"` # Remove /cl.exe from CC case insensitive - echo "$as_me:$LINENO: result: found ($CC)" >&5 -echo "${ECHO_T}found ($CC)" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found ($CC)" >&5 +$as_echo "found ($CC)" >&6; } COMPATH=`echo $CC | $SED 's@/[cC][lL]\.[eE][xX][eE]@@'` export INCLUDE=`cygpath -d "$COMPATH/../Include"` - echo "$as_me:$LINENO: checking the Version of Microsoft C/C++ Compiler" >&5 -echo $ECHO_N "checking the Version of Microsoft C/C++ Compiler... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking the Version of Microsoft C/C++ Compiler" >&5 +$as_echo_n "checking the Version of Microsoft C/C++ Compiler... " >&6; } CCNUMVER=`$CC 2>&1 | $AWK "/Microsoft/ && /..\\...\\...../ { x = match( \\\$0, /..\\...\\...../ ) CCversion = substr( \\\$0, RSTART, RLENGTH) @@ -5665,48 +7309,42 @@ echo $ECHO_N "checking the Version of Microsoft C/C++ Compiler... $ECHO_C" >&6 printf (\"%04d\",vertoken[i] ) } }"` - echo "$as_me:$LINENO: result: found Compiler version $CCNUMVER." >&5 -echo "${ECHO_T}found Compiler version $CCNUMVER." >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found Compiler version $CCNUMVER." >&5 +$as_echo "found Compiler version $CCNUMVER." >&6; } if test "$CCNUMVER" -ge "001500000000"; then COMEX=12 MSVSVER=2008 - echo "$as_me:$LINENO: result: found .NET 2008 / VS 9.0." >&5 -echo "${ECHO_T}found .NET 2008 / VS 9.0." >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found .NET 2008 / VS 9.0." >&5 +$as_echo "found .NET 2008 / VS 9.0." >&6; } elif test "$CCNUMVER" -ge "001400000000"; then COMEX=11 MSVSVER=2005 - echo "$as_me:$LINENO: result: found .NET 2005." >&5 -echo "${ECHO_T}found .NET 2005." >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found .NET 2005." >&5 +$as_echo "found .NET 2005." >&6; } elif test "$CCNUMVER" -ge "001300102240"; then COMEX=10 MSVSVER=2003 - echo "$as_me:$LINENO: result: found .NET 2003." >&5 -echo "${ECHO_T}found .NET 2003." >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found .NET 2003." >&5 +$as_echo "found .NET 2003." >&6; } else - { { echo "$as_me:$LINENO: error: Compiler too old. Use Microsoft C/C++ .NET 2003/2005 compiler." >&5 -echo "$as_me: error: Compiler too old. Use Microsoft C/C++ .NET 2003/2005 compiler." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Compiler too old. Use Microsoft C/C++ .NET 2003/2005 compiler." "$LINENO" 5 fi else - { { echo "$as_me:$LINENO: error: Microsoft C/C++ Compiler not found. Use --with-cl-home or set path to cl.exe." >&5 -echo "$as_me: error: Microsoft C/C++ Compiler not found. Use --with-cl-home or set path to cl.exe." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Microsoft C/C++ Compiler not found. Use --with-cl-home or set path to cl.exe." "$LINENO" 5 fi else - echo "$as_me:$LINENO: checking the Mingwin32 C++ Compiler" >&5 -echo $ECHO_N "checking the Mingwin32 C++ Compiler... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking the Mingwin32 C++ Compiler" >&5 +$as_echo_n "checking the Mingwin32 C++ Compiler... " >&6; } if test `$CC -dumpmachine | $SED -e 's/^.*-//'` = "mingw32"; then - echo "$as_me:$LINENO: result: found." >&5 -echo "${ECHO_T}found." >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found." >&5 +$as_echo "found." >&6; } if $CC -dumpspecs | grep -q "mno-cygwin"; then USE_MINGW="cygwin" else USE_MINGW="pure-mingw" fi else - { { echo "$as_me:$LINENO: error: Mingwin32 C++ Compiler not found." >&5 -echo "$as_me: error: Mingwin32 C++ Compiler not found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Mingwin32 C++ Compiler not found." "$LINENO" 5 fi fi fi @@ -5718,10 +7356,10 @@ if test "$_os" = "WINNT"; then if test "$WITH_MINGWIN" = "yes" || test "$COMEX" -ge "10"; then # Extract the first word of "midl.exe", so it can be a program name with args. set dummy midl.exe; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_MIDL_PATH+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_MIDL_PATH+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $MIDL_PATH in [\\/]* | ?:[\\/]*) @@ -5733,28 +7371,29 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MIDL_PATH="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS ;; esac fi MIDL_PATH=$ac_cv_path_MIDL_PATH - if test -n "$MIDL_PATH"; then - echo "$as_me:$LINENO: result: $MIDL_PATH" >&5 -echo "${ECHO_T}$MIDL_PATH" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MIDL_PATH" >&5 +$as_echo "$MIDL_PATH" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + if test -n "$MIDL_PATH";then MIDL_PATH=`dirname "$MIDL_PATH"` fi @@ -5780,9 +7419,7 @@ fi fi fi if test ! -x "$MIDL_PATH/midl.exe"; then - { { echo "$as_me:$LINENO: error: midl.exe not found. Make sure it's in the path or use --with-midl-path" >&5 -echo "$as_me: error: midl.exe not found. Make sure it's in the path or use --with-midl-path" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "midl.exe not found. Make sure it's in the path or use --with-midl-path" "$LINENO" 5 fi # Convert to posix path with 8.3 filename restrictions ( No spaces ) MIDL_PATH=`cygpath -d "$MIDL_PATH"` @@ -5790,10 +7427,10 @@ echo "$as_me: error: midl.exe not found. Make sure it's in the path or use --wit # Extract the first word of "csc.exe", so it can be a program name with args. set dummy csc.exe; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_CSC_PATH+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_CSC_PATH+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $CSC_PATH in [\\/]* | ?:[\\/]*) @@ -5805,28 +7442,29 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CSC_PATH="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS ;; esac fi CSC_PATH=$ac_cv_path_CSC_PATH - if test -n "$CSC_PATH"; then - echo "$as_me:$LINENO: result: $CSC_PATH" >&5 -echo "${ECHO_T}$CSC_PATH" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CSC_PATH" >&5 +$as_echo "$CSC_PATH" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + if test -n "$CSC_PATH";then CSC_PATH=`dirname "$CSC_PATH"` fi @@ -5842,16 +7480,14 @@ fi fi fi if test ! -x "$CSC_PATH/csc.exe"; then - { { echo "$as_me:$LINENO: error: csc.exe not found. Make sure it's in the path or use --with-csc-path" >&5 -echo "$as_me: error: csc.exe not found. Make sure it's in the path or use --with-csc-path" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "csc.exe not found. Make sure it's in the path or use --with-csc-path" "$LINENO" 5 fi # Convert to posix path with 8.3 filename restrictions ( No spaces ) CSC_PATH=`cygpath -d "$CSC_PATH"` CSC_PATH=`cygpath -u "$CSC_PATH"` - echo "$as_me:$LINENO: checking .NET Framework" >&5 -echo $ECHO_N "checking .NET Framework... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking .NET Framework" >&5 +$as_echo_n "checking .NET Framework... " >&6; } if test -n "$with_frame_home"; then with_frame_home=`cygpath -u "$with_frame_home"` fi @@ -5873,12 +7509,10 @@ echo $ECHO_N "checking .NET Framework... $ECHO_C" >&6 fi fi if test ! -f "$FRAME_HOME/lib/mscoree.lib"; then - { { echo "$as_me:$LINENO: error: mscoree.lib (.NET Framework) not found. Make sure you use --with-frame-home" >&5 -echo "$as_me: error: mscoree.lib (.NET Framework) not found. Make sure you use --with-frame-home" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "mscoree.lib (.NET Framework) not found. Make sure you use --with-frame-home" "$LINENO" 5 fi - echo "$as_me:$LINENO: result: found" >&5 -echo "${ECHO_T}found" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 +$as_echo "found" >&6; } # Convert to posix path with 8.3 filename restrictions ( No spaces ) FRAME_HOME=`cygpath -d "$FRAME_HOME"` FRAME_HOME=`cygpath -u "$FRAME_HOME"` @@ -5894,15 +7528,15 @@ ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + if test "${ac_cv_prog_CPP+set}" = set; then : + $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" @@ -5916,11 +7550,7 @@ do # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include @@ -5929,68 +7559,24 @@ cat >>conftest.$ac_ext <<_ACEOF #endif Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_c_try_cpp "$LINENO"; then : +else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then +if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - # Passes both tests. ac_preproc_ok=: break @@ -6000,7 +7586,7 @@ rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then +if $ac_preproc_ok; then : break fi @@ -6012,8 +7598,8 @@ fi else ac_cv_prog_CPP=$CPP fi -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -6023,11 +7609,7 @@ do # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include @@ -6036,68 +7618,24 @@ cat >>conftest.$ac_ext <<_ACEOF #endif Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_c_try_cpp "$LINENO"; then : +else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then +if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - # Passes both tests. ac_preproc_ok=: break @@ -6107,14 +7645,13 @@ rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : +if $ac_preproc_ok; then : + else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." "$LINENO" 5; } fi ac_ext=c @@ -6124,16 +7661,12 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 -if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then : + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -6148,51 +7681,23 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_header_stdc=no + ac_cv_header_stdc=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : + $EGREP "memchr" >/dev/null 2>&1; then : + else ac_cv_header_stdc=no fi @@ -6202,18 +7707,14 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : + $EGREP "free" >/dev/null 2>&1; then : + else ac_cv_header_stdc=no fi @@ -6223,16 +7724,13 @@ fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : : else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include +#include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) @@ -6252,61 +7750,50 @@ main () for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); + return 2; + return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_c_try_run "$LINENO"; then : -( exit $ac_status ) -ac_cv_header_stdc=no +else + ac_cv_header_stdc=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi + fi fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF +$as_echo "#define STDC_HEADERS 1" >>confdefs.h fi fi if test "$_os" != "WINNT" -o "$WITH_MINGWIN" = "yes"; then - ac_ext=cc + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test -n "$ac_tool_prefix"; then - for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CXX+set}" = set; then : + $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. @@ -6316,39 +7803,41 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then - echo "$as_me:$LINENO: result: $CXX" >&5 -echo "${ECHO_T}$CXX" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX - for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then : + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. @@ -6358,64 +7847,77 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CXX="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then - echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 -echo "${ECHO_T}$ac_ct_CXX" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$ac_ct_CXX" && break done -test -n "$ac_ct_CXX" || ac_ct_CXX="g++" - CXX=$ac_ct_CXX + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi fi - + fi +fi # Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C++ compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done -echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 -if test "${ac_cv_cxx_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } +if test "${ac_cv_cxx_compiler_gnu+set}" = set; then : + $as_echo_n "(cached) " >&6 else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -6429,55 +7931,34 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_compiler_gnu=no + ac_compiler_gnu=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 -GXX=`test $ac_compiler_gnu = yes && echo yes` +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS -CXXFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 -echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 -if test "${ac_cv_prog_cxx_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +$as_echo_n "checking whether $CXX accepts -g... " >&6; } +if test "${ac_cv_prog_cxx_g+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -6488,176 +7969,80 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_prog_cxx_g=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 -if test "$ac_test_CXXFLAGS" = set; then - CXXFLAGS=$ac_save_CXXFLAGS -elif test $ac_cv_prog_cxx_g = yes; then - if test "$GXX" = yes; then - CXXFLAGS="-g -O2" - else - CXXFLAGS="-g" - fi -else - if test "$GXX" = yes; then - CXXFLAGS="-O2" - else - CXXFLAGS= - fi -fi -for ac_declaration in \ - '' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_declaration -#include + int main () { -exit (42); + ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_cxx_try_compile "$LINENO"; then : -continue -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +else + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_declaration + int main () { -exit (42); + ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +$as_echo "$ac_cv_prog_cxx_g" >&6; } +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi fi - ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -ac_ext=cc +ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 -echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 +$as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then - if test "${ac_cv_prog_CXXCPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + if test "${ac_cv_prog_CXXCPP+set}" = set; then : + $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" @@ -6671,11 +8056,7 @@ do # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include @@ -6684,68 +8065,24 @@ cat >>conftest.$ac_ext <<_ACEOF #endif Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_cxx_try_cpp "$LINENO"; then : +else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then +if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - # Passes both tests. ac_preproc_ok=: break @@ -6755,7 +8092,7 @@ rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then +if $ac_preproc_ok; then : break fi @@ -6767,8 +8104,8 @@ fi else ac_cv_prog_CXXCPP=$CXXCPP fi -echo "$as_me:$LINENO: result: $CXXCPP" >&5 -echo "${ECHO_T}$CXXCPP" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 +$as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do @@ -6778,11 +8115,7 @@ do # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include @@ -6791,68 +8124,24 @@ cat >>conftest.$ac_ext <<_ACEOF #endif Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_cxx_try_cpp "$LINENO"; then : +else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then +if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - # Passes both tests. ac_preproc_ok=: break @@ -6862,14 +8151,13 @@ rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : +if $ac_preproc_ok; then : + else - { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details." "$LINENO" 5; } fi ac_ext=c @@ -6887,15 +8175,15 @@ ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + if test "${ac_cv_prog_CPP+set}" = set; then : + $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" @@ -6909,11 +8197,7 @@ do # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include @@ -6922,68 +8206,24 @@ cat >>conftest.$ac_ext <<_ACEOF #endif Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_c_try_cpp "$LINENO"; then : +else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then +if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - # Passes both tests. ac_preproc_ok=: break @@ -6993,7 +8233,7 @@ rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then +if $ac_preproc_ok; then : break fi @@ -7005,8 +8245,8 @@ fi else ac_cv_prog_CPP=$CPP fi -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -7016,81 +8256,33 @@ do # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : +else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then +if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - # Passes both tests. ac_preproc_ok=: break @@ -7100,14 +8292,13 @@ rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : +if $ac_preproc_ok; then : + else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." "$LINENO" 5; } fi ac_ext=c @@ -7120,70 +8311,16 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - - for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_Header=no" -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -if test `eval echo '${'$as_ac_Header'}'` = yes; then +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +eval as_val=\$$as_ac_Header + if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -7191,678 +8328,288 @@ fi done -echo "$as_me:$LINENO: checking for long" >&5 -echo $ECHO_N "checking for long... $ECHO_C" >&6 -if test "${ac_cv_type_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if ((long *) 0) - return 0; -if (sizeof (long)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_long=yes +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 +$as_echo_n "checking size of long... " >&6; } +if test "${ac_cv_sizeof_long+set}" = set; then : + $as_echo_n "(cached) " >&6 else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_type_long=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 -echo "${ECHO_T}$ac_cv_type_long" >&6 + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : -echo "$as_me:$LINENO: checking size of long" >&5 -echo $ECHO_N "checking size of long... $ECHO_C" >&6 -if test "${ac_cv_sizeof_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$ac_cv_type_long" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)]; -test_array [0] = 0 + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ as_fn_set_status 77 +as_fn_error "cannot compute sizeof (long) +See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_long=0 + fi +fi - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; -test_array [0] = 0 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 +$as_echo "$ac_cv_sizeof_long" >&6; } - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=$ac_mid; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)]; -test_array [0] = 0 - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)]; -test_array [0] = 0 - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_lo=$ac_mid; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +SIZEOF_LONG=$ac_cv_sizeof_long -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - done + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if test "${ac_cv_c_bigendian+set}" = set; then : + $as_echo_n "(cached) " >&6 else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_lo= ac_hi= -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + # Check for potential -arch flags. It is not universal unless + # there are at least two -arch flags with different values. + ac_arch= + ac_prev= + for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do + if test -n "$ac_prev"; then + case $ac_word in + i?86 | x86_64 | ppc | ppc64) + if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then + ac_arch=$ac_word + else + ac_cv_c_bigendian=universal + break + fi + ;; + esac + ac_prev= + elif test "x$ac_word" = "x-arch"; then + ac_prev=arch + fi + done fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default +#include + #include + int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; -test_array [0] = 0 +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=$ac_mid -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_lo=`expr '(' $ac_mid ')' + 1` -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in -?*) ac_cv_sizeof_long=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long), 77 -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; -esac -else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$ac_includes_default -long longval () { return (long) (sizeof (long)); } -unsigned long ulongval () { return (long) (sizeof (long)); } -#include -#include +#include + #include + int main () { - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - exit (1); - if (((long) (sizeof (long))) < 0) - { - long i = longval (); - if (i != ((long) (sizeof (long)))) - exit (1); - fprintf (f, "%ld\n", i); - } - else - { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (long)))) - exit (1); - fprintf (f, "%lu\n", i); - } - exit (ferror (f) || fclose (f) != 0); +#if BYTE_ORDER != BIG_ENDIAN + not big endian + #endif ; return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sizeof_long=`cat conftest.val` -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long), 77 -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -rm -f conftest.val +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_bigendian=yes else - ac_cv_sizeof_long=0 + ac_cv_c_bigendian=no fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 -echo "${ECHO_T}$ac_cv_sizeof_long" >&6 -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG $ac_cv_sizeof_long -_ACEOF - - -SIZEOF_LONG=$ac_cv_sizeof_long - -echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 -echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 -if test "${ac_cv_c_bigendian+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # See if sys/param.h defines the BYTE_ORDER macro. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include +#include int main () { -#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN - bogus endian macros -#endif +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - # It does; now see whether it defined to BIG_ENDIAN or not. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include +#include int main () { -#if BYTE_ORDER != BIG_ENDIAN - not big endian -#endif +#ifndef _BIG_ENDIAN + not big endian + #endif ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_c_bigendian=no + ac_cv_c_bigendian=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -# It does not; compile a test program. -if test "$cross_compiling" = yes; then - # try to guess the endianness by grepping values into an object file - ac_cv_c_bigendian=unknown - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then : + # Try to guess by grepping values from an object file. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; -short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; -void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } -short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; -short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; -void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + int main () { - _ascii (); _ebcdic (); +return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then - ac_cv_c_bigendian=yes -fi -if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi -fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +if ac_fn_c_try_compile "$LINENO"; then : + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +$ac_includes_default int main () { - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long l; - char c[sizeof (long)]; - } u; - u.l = 1; - exit (u.c[sizeof (long) - 1] == 1); + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; } _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : ac_cv_c_bigendian=no -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_c_bigendian=yes -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +else + ac_cv_c_bigendian=yes fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + + fi fi -echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 -echo "${ECHO_T}$ac_cv_c_bigendian" >&6 -case $ac_cv_c_bigendian in - yes) +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h +;; #( + no) + ;; #( + universal) -cat >>confdefs.h <<\_ACEOF -#define WORDS_BIGENDIAN 1 -_ACEOF - ;; - no) - ;; - *) - { { echo "$as_me:$LINENO: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&5 -echo "$as_me: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} - { (exit 1); exit 1; }; } ;; -esac +$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h + + ;; #( + *) + as_fn_error "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + esac WORDS_BIGENDIAN=$ac_cv_c_bigendian -# Check whether --enable-largefile or --disable-largefile was given. -if test "${enable_largefile+set}" = set; then - enableval="$enable_largefile" +# Check whether --enable-largefile was given. +if test "${enable_largefile+set}" = set; then : + enableval=$enable_largefile; +fi -fi; if test "$enable_largefile" != no; then - echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 -echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6 -if test "${ac_cv_sys_largefile_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 +$as_echo_n "checking for special C compiler options needed for large files... " >&6; } +if test "${ac_cv_sys_largefile_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then ac_save_CC=$CC while :; do - # IRIX 6.2 and later do not support large files by default, - # so use the C compiler's -n32 option if that helps. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. @@ -7881,89 +8628,34 @@ main () return 0; } _ACEOF - rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + if ac_fn_c_try_compile "$LINENO"; then : break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - fi -rm -f conftest.err conftest.$ac_objext - CC="$CC -n32" - rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +rm -f core conftest.err conftest.$ac_objext + CC="$CC -n32" + if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_largefile_CC=' -n32'; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - fi -rm -f conftest.err conftest.$ac_objext +rm -f core conftest.err conftest.$ac_objext break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi -echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 -echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 +$as_echo "$ac_cv_sys_largefile_CC" >&6; } if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi - echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 -echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6 -if test "${ac_cv_sys_file_offset_bits+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } +if test "${ac_cv_sys_file_offset_bits+set}" = set; then : + $as_echo_n "(cached) " >&6 else while :; do - ac_cv_sys_file_offset_bits=no - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. @@ -7982,40 +8674,11 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_file_offset_bits=no; break fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _FILE_OFFSET_BITS 64 #include @@ -8035,60 +8698,33 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_file_offset_bits=64; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_file_offset_bits=unknown break done fi -echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 -echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6 -if test "$ac_cv_sys_file_offset_bits" != no; then - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 +$as_echo "$ac_cv_sys_file_offset_bits" >&6; } +case $ac_cv_sys_file_offset_bits in #( + no | unknown) ;; + *) cat >>confdefs.h <<_ACEOF #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits _ACEOF - -fi -rm -f conftest* - echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 -echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6 -if test "${ac_cv_sys_large_files+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +;; +esac +rm -rf conftest* + if test $ac_cv_sys_file_offset_bits = unknown; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 +$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } +if test "${ac_cv_sys_large_files+set}" = set; then : + $as_echo_n "(cached) " >&6 else while :; do - ac_cv_sys_large_files=no - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. @@ -8107,40 +8743,11 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_large_files=no; break fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGE_FILES 1 #include @@ -8160,48 +8767,26 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_sys_large_files=1; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_large_files=unknown break done fi -echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 -echo "${ECHO_T}$ac_cv_sys_large_files" >&6 -if test "$ac_cv_sys_large_files" != no; then - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 +$as_echo "$ac_cv_sys_large_files" >&6; } +case $ac_cv_sys_large_files in #( + no | unknown) ;; + *) cat >>confdefs.h <<_ACEOF #define _LARGE_FILES $ac_cv_sys_large_files _ACEOF - -fi -rm -f conftest* +;; +esac +rm -rf conftest* + fi fi if test -n "$ac_cv_sys_file_offset_bits"; then @@ -8212,44 +8797,42 @@ if test -n "$ac_cv_sys_large_files" && test "$ac_cv_sys_large_files" != "no"; th fi -echo "$as_me:$LINENO: checking whether to disable vba feature" >&5 -echo $ECHO_N "checking whether to disable vba feature... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to disable vba feature" >&5 +$as_echo_n "checking whether to disable vba feature... " >&6; } if test -n "$enable_vba" && test "$enable_vba" = "no"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } ENABLE_VBA=NO else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } ENABLE_VBA=YES fi if test "$ENABLE_VBA" = "YES"; then - echo "$as_me:$LINENO: checking how to package the vba compatibility api" >&5 -echo $ECHO_N "checking how to package the vba compatibility api... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to package the vba compatibility api" >&5 +$as_echo_n "checking how to package the vba compatibility api... " >&6; } if test -n "$with_vba_package_format"; then if test "$with_vba_package_format" = "extn"; then VBA_EXTENSION=YES - echo "$as_me:$LINENO: result: uno extension" >&5 -echo "${ECHO_T}uno extension" >&6 - { echo "$as_me:$LINENO: WARNING: --with-vba-package-format=extn can cause problems" >&5 -echo "$as_me: WARNING: --with-vba-package-format=extn can cause problems" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: result: uno extension" >&5 +$as_echo "uno extension" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-vba-package-format=extn can cause problems" >&5 +$as_echo "$as_me: WARNING: --with-vba-package-format=extn can cause problems" >&2;} else if test "$with_vba_package_format" = "builtin"; then VBA_EXTENSION=NO - echo "$as_me:$LINENO: result: build into installset" >&5 -echo "${ECHO_T}build into installset" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: build into installset" >&5 +$as_echo "build into installset" >&6; } else - { { echo "$as_me:$LINENO: error: unknown packaging method" >&5 -echo "$as_me: error: unknown packaging method" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "unknown packaging method" "$LINENO" 5 fi fi else VBA_EXTENSION=NO - echo "$as_me:$LINENO: result: defaulting to build into installset" >&5 -echo "${ECHO_T}defaulting to build into installset" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: defaulting to build into installset" >&5 +$as_echo "defaulting to build into installset" >&6; } fi else VBA_EXTENSION=NO @@ -8259,379 +8842,74 @@ fi if test "$test_cups" = "yes" -a "$ENABLE_CUPS" = "TRUE" ; then - if test "${ac_cv_header_cups_cups_h+set}" = set; then - echo "$as_me:$LINENO: checking for cups/cups.h" >&5 -echo $ECHO_N "checking for cups/cups.h... $ECHO_C" >&6 -if test "${ac_cv_header_cups_cups_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_cups_cups_h" >&5 -echo "${ECHO_T}$ac_cv_header_cups_cups_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking cups/cups.h usability" >&5 -echo $ECHO_N "checking cups/cups.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking cups/cups.h presence" >&5 -echo $ECHO_N "checking cups/cups.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: cups/cups.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: cups/cups.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: cups/cups.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: cups/cups.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: cups/cups.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: cups/cups.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: cups/cups.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: cups/cups.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: cups/cups.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: cups/cups.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: cups/cups.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: cups/cups.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: cups/cups.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: cups/cups.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: cups/cups.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: cups/cups.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for cups/cups.h" >&5 -echo $ECHO_N "checking for cups/cups.h... $ECHO_C" >&6 -if test "${ac_cv_header_cups_cups_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_cups_cups_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_cups_cups_h" >&5 -echo "${ECHO_T}$ac_cv_header_cups_cups_h" >&6 + ac_fn_c_check_header_mongrel "$LINENO" "cups/cups.h" "ac_cv_header_cups_cups_h" "$ac_includes_default" +if test "x$ac_cv_header_cups_cups_h" = x""yes; then : -fi -if test $ac_cv_header_cups_cups_h = yes; then - : else - { { echo "$as_me:$LINENO: error: cups/cups.h could not be found. libcupsys2-dev or cups???-devel missing?" >&5 -echo "$as_me: error: cups/cups.h could not be found. libcupsys2-dev or cups???-devel missing?" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cups/cups.h could not be found. libcupsys2-dev or cups???-devel missing?" "$LINENO" 5 fi fi if test "$_os" = "Linux" -o "$_os" = "FreeBSD" -o "$_os" = "GNU"; then - echo "$as_me:$LINENO: checking whether to enable pam support" >&5 -echo $ECHO_N "checking whether to enable pam support... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable pam support" >&5 +$as_echo_n "checking whether to enable pam support... " >&6; } if test -z "$enable_pam" || test "$enable_pam" != "no"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } PAM=YES - if test "${ac_cv_header_security_pam_appl_h+set}" = set; then - echo "$as_me:$LINENO: checking for security/pam_appl.h" >&5 -echo $ECHO_N "checking for security/pam_appl.h... $ECHO_C" >&6 -if test "${ac_cv_header_security_pam_appl_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_security_pam_appl_h" >&5 -echo "${ECHO_T}$ac_cv_header_security_pam_appl_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking security/pam_appl.h usability" >&5 -echo $ECHO_N "checking security/pam_appl.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking security/pam_appl.h presence" >&5 -echo $ECHO_N "checking security/pam_appl.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: security/pam_appl.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: security/pam_appl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: security/pam_appl.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: security/pam_appl.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: security/pam_appl.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: security/pam_appl.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: security/pam_appl.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: security/pam_appl.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: security/pam_appl.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: security/pam_appl.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: security/pam_appl.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: security/pam_appl.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: security/pam_appl.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: security/pam_appl.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: security/pam_appl.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: security/pam_appl.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for security/pam_appl.h" >&5 -echo $ECHO_N "checking for security/pam_appl.h... $ECHO_C" >&6 -if test "${ac_cv_header_security_pam_appl_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_security_pam_appl_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_security_pam_appl_h" >&5 -echo "${ECHO_T}$ac_cv_header_security_pam_appl_h" >&6 + ac_fn_c_check_header_mongrel "$LINENO" "security/pam_appl.h" "ac_cv_header_security_pam_appl_h" "$ac_includes_default" +if test "x$ac_cv_header_security_pam_appl_h" = x""yes; then : -fi -if test $ac_cv_header_security_pam_appl_h = yes; then - : else - { { echo "$as_me:$LINENO: error: pam_appl.h could not be found. libpam-dev or pam-devel missing?" >&5 -echo "$as_me: error: pam_appl.h could not be found. libpam-dev or pam-devel missing?" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "pam_appl.h could not be found. libpam-dev or pam-devel missing?" "$LINENO" 5 fi - echo "$as_me:$LINENO: checking whether to link to libpam" >&5 -echo $ECHO_N "checking whether to link to libpam... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to link to libpam" >&5 +$as_echo_n "checking whether to link to libpam... " >&6; } if test -n "$enable_pam_link" -a "$enable_pam_link" != "no"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } PAM_LINK=YES - -echo "$as_me:$LINENO: checking for pam_start in -lpam" >&5 -echo $ECHO_N "checking for pam_start in -lpam... $ECHO_C" >&6 -if test "${ac_cv_lib_pam_pam_start+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pam_start in -lpam" >&5 +$as_echo_n "checking for pam_start in -lpam... " >&6; } +if test "${ac_cv_lib_pam_pam_start+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpam $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char pam_start (); int main () { -pam_start (); +return pam_start (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pam_pam_start=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_pam_pam_start=no + ac_cv_lib_pam_pam_start=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_pam_pam_start" >&5 -echo "${ECHO_T}$ac_cv_lib_pam_pam_start" >&6 -if test $ac_cv_lib_pam_pam_start = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pam_pam_start" >&5 +$as_echo "$ac_cv_lib_pam_pam_start" >&6; } +if test "x$ac_cv_lib_pam_pam_start" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBPAM 1 _ACEOF @@ -8639,19 +8917,17 @@ _ACEOF LIBS="-lpam $LIBS" else - { { echo "$as_me:$LINENO: error: libpam not found or functional" >&5 -echo "$as_me: error: libpam not found or functional" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "libpam not found or functional" "$LINENO" 5 fi else - echo "$as_me:$LINENO: result: no, dynamically open it" >&5 -echo "${ECHO_T}no, dynamically open it" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, dynamically open it" >&5 +$as_echo "no, dynamically open it" >&6; } PAM_LINK=NO fi else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } PAM=NO PAM_LINK=NO @@ -8662,11 +8938,11 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu - echo "$as_me:$LINENO: checking how many arguments getspnam_r() takes" >&5 -echo $ECHO_N "checking how many arguments getspnam_r() takes... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how many arguments getspnam_r() takes" >&5 +$as_echo_n "checking how many arguments getspnam_r() takes... " >&6; } - if test "${ac_cv_func_which_getspnam_r+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + if test "${ac_cv_func_which_getspnam_r+set}" = set; then : + $as_echo_n "(cached) " >&6 else @@ -8683,11 +8959,7 @@ ac_cv_func_which_getspnam_r=unknown # netdb.h is not declaring the function, and the compiler is thereby # assuming an implicit prototype. In which case, we're out of luck. # -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -8704,35 +8976,10 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_func_which_getspnam_r=no -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # # FIVE ARGUMENTS @@ -8740,11 +8987,7 @@ rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test "$ac_cv_func_which_getspnam_r" = "unknown"; then -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -8763,35 +9006,10 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_func_which_getspnam_r=five -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi @@ -8801,11 +9019,7 @@ fi if test "$ac_cv_func_which_getspnam_r" = "unknown"; then -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -8824,35 +9038,10 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_compile "$LINENO"; then : ac_cv_func_which_getspnam_r=four -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi @@ -8863,30 +9052,28 @@ fi case "$ac_cv_func_which_getspnam_r" in five) - echo "$as_me:$LINENO: result: five" >&5 -echo "${ECHO_T}five" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: five" >&5 +$as_echo "five" >&6; } NEW_SHADOW_API=YES ;; four) - echo "$as_me:$LINENO: result: four" >&5 -echo "${ECHO_T}four" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: four" >&5 +$as_echo "four" >&6; } ;; no) - echo "$as_me:$LINENO: result: cannot find function declaration in shadow.h" >&5 -echo "${ECHO_T}cannot find function declaration in shadow.h" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot find function declaration in shadow.h" >&5 +$as_echo "cannot find function declaration in shadow.h" >&6; } ;; unknown) - echo "$as_me:$LINENO: result: can't tell" >&5 -echo "${ECHO_T}can't tell" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: can't tell" >&5 +$as_echo "can't tell" >&6; } ;; *) - { { echo "$as_me:$LINENO: error: internal error" >&5 -echo "$as_me: error: internal error" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "internal error" "$LINENO" 5 ;; esac @@ -8905,78 +9092,49 @@ fi if test "$_os" = "Linux"; then - echo "$as_me:$LINENO: checking whether to link to libcrypt" >&5 -echo $ECHO_N "checking whether to link to libcrypt... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to link to libcrypt" >&5 +$as_echo_n "checking whether to link to libcrypt... " >&6; } if test -n "$enable_crypt_link" -a "$enable_crypt_link" != "no"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } CRYPT_LINK=YES - -echo "$as_me:$LINENO: checking for crypt in -lcrypt" >&5 -echo $ECHO_N "checking for crypt in -lcrypt... $ECHO_C" >&6 -if test "${ac_cv_lib_crypt_crypt+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for crypt in -lcrypt" >&5 +$as_echo_n "checking for crypt in -lcrypt... " >&6; } +if test "${ac_cv_lib_crypt_crypt+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypt $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char crypt (); int main () { -crypt (); +return crypt (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_crypt_crypt=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_crypt_crypt=no + ac_cv_lib_crypt_crypt=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_crypt_crypt" >&5 -echo "${ECHO_T}$ac_cv_lib_crypt_crypt" >&6 -if test $ac_cv_lib_crypt_crypt = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypt_crypt" >&5 +$as_echo "$ac_cv_lib_crypt_crypt" >&6; } +if test "x$ac_cv_lib_crypt_crypt" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBCRYPT 1 _ACEOF @@ -8984,14 +9142,12 @@ _ACEOF LIBS="-lcrypt $LIBS" else - { { echo "$as_me:$LINENO: error: libcrypt not found or functional" >&5 -echo "$as_me: error: libcrypt not found or functional" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "libcrypt not found or functional" "$LINENO" 5 fi else - echo "$as_me:$LINENO: result: no, dynamically open it" >&5 -echo "${ECHO_T}no, dynamically open it" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, dynamically open it" >&5 +$as_echo "no, dynamically open it" >&6; } CRYPT_LINK=NO fi fi @@ -9010,20 +9166,24 @@ if test "$_os" = "WINNT" -a "$WITH_MINGWIN" != "yes"; then fi if test "$_os" != "WINNT" -o "$WITH_MINGWIN" = "yes"; then - ac_ext=cc + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test -n "$ac_tool_prefix"; then - for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + if test -n "$ac_tool_prefix"; then + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CXX+set}" = set; then : + $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. @@ -9033,39 +9193,41 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then - echo "$as_me:$LINENO: result: $CXX" >&5 -echo "${ECHO_T}$CXX" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 +$as_echo "$CXX" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX - for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC + for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then : + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. @@ -9075,126 +9237,149 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CXX="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then - echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 -echo "${ECHO_T}$ac_ct_CXX" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 +$as_echo "$ac_ct_CXX" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$ac_ct_CXX" && break done -test -n "$ac_ct_CXX" || ac_ct_CXX="g++" - CXX=$ac_ct_CXX + if test "x$ac_ct_CXX" = x; then + CXX="g++" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CXX=$ac_ct_CXX + fi fi - + fi +fi # Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C++ compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 +$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } +if test "${ac_cv_cxx_compiler_gnu+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 -if test "${ac_cv_cxx_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 +$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GXX=yes +else + GXX= +fi +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 +$as_echo_n "checking whether $CXX accepts -g... " >&6; } +if test "${ac_cv_prog_cxx_g+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_save_cxx_werror_flag=$ac_cxx_werror_flag + ac_cxx_werror_flag=yes + ac_cv_prog_cxx_g=no + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + ac_cv_prog_cxx_g=yes else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + CXXFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { -#ifndef __GNUC__ - choke me -#endif ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_compiler_gnu=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_cxx_compiler_gnu=$ac_compiler_gnu +if ac_fn_cxx_try_compile "$LINENO"; then : -fi -echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 -GXX=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CXXFLAGS=${CXXFLAGS+set} -ac_save_CXXFLAGS=$CXXFLAGS -CXXFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 -echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 -if test "${ac_cv_prog_cxx_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +else + ac_cxx_werror_flag=$ac_save_cxx_werror_flag + CXXFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -9205,39 +9390,18 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_prog_cxx_g=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cxx_werror_flag=$ac_save_cxx_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 +$as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then @@ -9253,112 +9417,6 @@ else CXXFLAGS= fi fi -for ac_declaration in \ - '' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -#include -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -continue -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h -fi - ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -9368,32 +9426,27 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi if test "$GXX" = "yes"; then - echo "$as_me:$LINENO: checking the GNU C++ compiler version" >&5 -echo $ECHO_N "checking the GNU C++ compiler version... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking the GNU C++ compiler version" >&5 +$as_echo_n "checking the GNU C++ compiler version... " >&6; } _gpp_version=`$CXX -dumpversion` _gpp_major=`echo $_gpp_version | $AWK -F. '{ print \$1 }'` _gpp_minor=`echo $_gpp_version | $AWK -F. '{ print \$2 }'` - echo "$as_me:$LINENO: result: checked (g++ $_gpp_version)" >&5 -echo "${ECHO_T}checked (g++ $_gpp_version)" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked (g++ $_gpp_version)" >&5 +$as_echo "checked (g++ $_gpp_version)" >&6; } if test "$_gpp_major" = "3"; then if test "$_gpp_minor" = "4"; then - echo "$as_me:$LINENO: checking whether $CXX has the enum bug" >&5 -echo $ECHO_N "checking whether $CXX has the enum bug... $ECHO_C" >&6 -if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX has the enum bug" >&5 +$as_echo_n "checking whether $CXX has the enum bug... " >&6; } +if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot run test program while cross compiling +See \`config.log' for more details." "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ extern "C" void abort (void); @@ -9418,31 +9471,16 @@ main (void) } _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - { { echo "$as_me:$LINENO: error: your version of the GNU C++ compile has a bug which prevents OpenOffice.org from being compiled correctly - please check http://gcc.gnu.org/ml/gcc-patches/2004-07/msg00968.html for details." >&5 -echo "$as_me: error: your version of the GNU C++ compile has a bug which prevents OpenOffice.org from being compiled correctly - please check http://gcc.gnu.org/ml/gcc-patches/2004-07/msg00968.html for details." >&2;} - { (exit 1); exit 1; }; } -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 +if ac_fn_c_try_run "$LINENO"; then : + as_fn_error "your version of the GNU C++ compile has a bug which prevents OpenOffice.org from being compiled correctly - please check http://gcc.gnu.org/ml/gcc-patches/2004-07/msg00968.html for details." "$LINENO" 5 +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi + fi fi fi @@ -9450,8 +9488,8 @@ fi # Removed the special FreeBSD treatment. The problem was that with_gxx_include_path # often contains an i386 which is expanded as a macro. Solved in stlport. if test "$GXX" = "yes"; then - echo "$as_me:$LINENO: checking for g++ include path" >&5 -echo $ECHO_N "checking for g++ include path... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for g++ include path" >&5 +$as_echo_n "checking for g++ include path... " >&6; } if test -z "$with_gxx_include_path"; then with_gxx_include_path=`echo "#include " | $CXX -E -xc++ - | $SED -n '/.*1*"\(.*\)\/cstring".*/s//\1/p' | head -n 1` if test "$with_gxx_include_path" = "/usr/libexec/(null)/include"; then @@ -9469,18 +9507,18 @@ echo $ECHO_N "checking for g++ include path... $ECHO_C" >&6 fi if test -z "$with_gxx_include_path"; then with_gxx_include_path="NO_GXX_INCLUDE" - echo "$as_me:$LINENO: result: no g++ includes" >&5 -echo "${ECHO_T}no g++ includes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no g++ includes" >&5 +$as_echo "no g++ includes" >&6; } else - echo "$as_me:$LINENO: result: $with_gxx_include_path" >&5 -echo "${ECHO_T}$with_gxx_include_path" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_gxx_include_path" >&5 +$as_echo "$with_gxx_include_path" >&6; } fi GXX_INCLUDE_PATH="$with_gxx_include_path" if test "$WITH_MINGWIN" = "yes"; then - echo "$as_me:$LINENO: checking for mingwin runtime include path" >&5 -echo $ECHO_N "checking for mingwin runtime include path... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mingwin runtime include path" >&5 +$as_echo_n "checking for mingwin runtime include path... " >&6; } cat >conftest.$ac_ext <<_ACEOF #include #include @@ -9498,16 +9536,16 @@ _ACEOF fi if test -z "$_mingw_lib_include_path"; then _mingw_lib_include_path="NO_LIB_INCLUDE" - echo "$as_me:$LINENO: result: no mingwin runtime includes" >&5 -echo "${ECHO_T}no mingwin runtime includes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no mingwin runtime includes" >&5 +$as_echo "no mingwin runtime includes" >&6; } else - echo "$as_me:$LINENO: result: $_mingw_lib_include_path" >&5 -echo "${ECHO_T}$_mingw_lib_include_path" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_mingw_lib_include_path" >&5 +$as_echo "$_mingw_lib_include_path" >&6; } fi MINGW_LIB_INCLUDE_PATH="$_mingw_lib_include_path" - echo "$as_me:$LINENO: checking for mingwin c++ backward include path" >&5 -echo $ECHO_N "checking for mingwin c++ backward include path... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mingwin c++ backward include path" >&5 +$as_echo_n "checking for mingwin c++ backward include path... " >&6; } cat >conftest.$ac_ext <<_ACEOF #include _ACEOF @@ -9516,57 +9554,57 @@ _ACEOF if test -n "$_mingw_backward_include_path"; then _mingw_backward_include_path=`cygpath -d $_mingw_backward_include_path` _mingw_backward_include_path=`cygpath -u $_mingw_backward_include_path` - echo "$as_me:$LINENO: result: $_mingw_backward_include_path" >&5 -echo "${ECHO_T}$_mingw_backward_include_path" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_mingw_backward_include_path" >&5 +$as_echo "$_mingw_backward_include_path" >&6; } else _mingw_backward_include_path="NO_BACKWARD_INCLUDE" - echo "$as_me:$LINENO: result: no mingwin c++ backward includes" >&5 -echo "${ECHO_T}no mingwin c++ backward includes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no mingwin c++ backward includes" >&5 +$as_echo "no mingwin c++ backward includes" >&6; } fi MINGW_BACKWARD_INCLUDE_PATH="$_mingw_backward_include_path" mingw_crtbegin=`$CC -print-file-name=crtbegin.o` MINGW_CLIB_DIR=`dirname $mingw_crtbegin` - echo "$as_me:$LINENO: checking whether to use dynamic libgcc" >&5 -echo $ECHO_N "checking whether to use dynamic libgcc... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use dynamic libgcc" >&5 +$as_echo_n "checking whether to use dynamic libgcc... " >&6; } if test -e "$MINGW_CLIB_DIR/libgcc_s.a"; then - echo "$as_me:$LINENO: checking dynamic libgcc name" >&5 -echo $ECHO_N "checking dynamic libgcc name... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic libgcc name" >&5 +$as_echo_n "checking dynamic libgcc name... " >&6; } MINGW_GCCDLL_pattern=`nm $MINGW_CLIB_DIR/libgcc_s.a | sed -ne 's@.* _libgcc\(.*\)_dll_iname@libgcc\1.dll@p' | uniq | sed -e 's@_@?@g'` MINGW_GCCDLL=`cd $COMPATH && ls $MINGW_GCCDLL_pattern 2>/dev/null` if test -n "$MINGW_GCCDLL"; then MINGW_SHARED_GCCLIB=YES - echo "$as_me:$LINENO: result: use $MINGW_GCCDLL" >&5 -echo "${ECHO_T}use $MINGW_GCCDLL" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: use $MINGW_GCCDLL" >&5 +$as_echo "use $MINGW_GCCDLL" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi if test -e "$MINGW_CLIB_DIR/libgcc_eh.a"; then MINGW_GCCLIB_EH=YES fi - echo "$as_me:$LINENO: checking whether to use dynamic libstdc++" >&5 -echo $ECHO_N "checking whether to use dynamic libstdc++... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use dynamic libstdc++" >&5 +$as_echo_n "checking whether to use dynamic libstdc++... " >&6; } if test -e "$MINGW_CLIB_DIR/libstdc++_s.a" ; then - echo "$as_me:$LINENO: checking dynamic libstdc++ name" >&5 -echo $ECHO_N "checking dynamic libstdc++ name... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic libstdc++ name" >&5 +$as_echo_n "checking dynamic libstdc++ name... " >&6; } MINGW_GXXDLL_pattern=`nm $MINGW_CLIB_DIR/libstdc++_s.a | sed -ne 's@.* _libstdc__\(.*\)_dll_iname@libstdc++\1.dll@p' | uniq | sed -e 's@_@?@g'` MINGW_GXXDLL=`cd $COMPATH && ls $MINGW_GXXDLL_pattern 2>/dev/null` if test -n "$MINGW_GXXDLL"; then MINGW_SHARED_GXXLIB=YES - echo "$as_me:$LINENO: result: use $MINGW_GXXDLL" >&5 -echo "${ECHO_T}use $MINGW_GXXDLL" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: use $MINGW_GXXDLL" >&5 +$as_echo "use $MINGW_GXXDLL" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi MINGW_CLIB_DIR=`cygpath $MINGW_CLIB_DIR` @@ -9579,64 +9617,64 @@ fi if test "$_os" = "SunOS"; then if test "$CC" = "cc"; then - echo "$as_me:$LINENO: checking SunStudio C++ Compiler" >&5 -echo $ECHO_N "checking SunStudio C++ Compiler... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking SunStudio C++ Compiler" >&5 +$as_echo_n "checking SunStudio C++ Compiler... " >&6; } if test "$CXX" != "CC"; then - { echo "$as_me:$LINENO: WARNING: SunStudio C++ was not found" >&5 -echo "$as_me: WARNING: SunStudio C++ was not found" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: SunStudio C++ was not found" >&5 +$as_echo "$as_me: WARNING: SunStudio C++ was not found" >&2;} echo "SunStudio C++ was not found" >> warn else - echo "$as_me:$LINENO: result: checked" >&5 -echo "${ECHO_T}checked" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked" >&5 +$as_echo "checked" >&6; } fi fi fi if test "$_os" = "Darwin"; then if test "$CC" = "cc"; then - echo "$as_me:$LINENO: checking Macosx c++ Compiler" >&5 -echo $ECHO_N "checking Macosx c++ Compiler... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking Macosx c++ Compiler" >&5 +$as_echo_n "checking Macosx c++ Compiler... " >&6; } if test "$CXX" != "c++"; then - { echo "$as_me:$LINENO: WARNING: Macosx C++ was not found" >&5 -echo "$as_me: WARNING: Macosx C++ was not found" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Macosx C++ was not found" >&5 +$as_echo "$as_me: WARNING: Macosx C++ was not found" >&2;} echo "Macosx C++ was not found" >> warn else - echo "$as_me:$LINENO: result: checked" >&5 -echo "${ECHO_T}checked" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked" >&5 +$as_echo "checked" >&6; } fi fi fi if test "$_os" = "IRIX" -o "$_os" = "IRIX64"; then if test "$CC" = "cc"; then - echo "$as_me:$LINENO: checking SGI MIPSpro C++ Compiler" >&5 -echo $ECHO_N "checking SGI MIPSpro C++ Compiler... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking SGI MIPSpro C++ Compiler" >&5 +$as_echo_n "checking SGI MIPSpro C++ Compiler... " >&6; } if test "$CXX" != "CC"; then - { echo "$as_me:$LINENO: WARNING: SGI MIPSpro C++ was not found" >&5 -echo "$as_me: WARNING: SGI MIPSpro C++ was not found" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: SGI MIPSpro C++ was not found" >&5 +$as_echo "$as_me: WARNING: SGI MIPSpro C++ was not found" >&2;} echo "SGI MIPSpro C++ was not found" >> warn else - echo "$as_me:$LINENO: result: checked" >&5 -echo "${ECHO_T}checked" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked" >&5 +$as_echo "checked" >&6; } fi fi fi if test "$_os" = "OSF1"; then - echo "$as_me:$LINENO: checking Compaq C++ compiler version" >&5 -echo $ECHO_N "checking Compaq C++ compiler version... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking Compaq C++ compiler version" >&5 +$as_echo_n "checking Compaq C++ compiler version... " >&6; } _compaqcxx_version=`$CXX -V 2>&1 | $AWK '{ print $3 }'` _compaqcxx_major=`echo $_compaqcxx_version | $AWK -F. '{ print $1 }'` if test "$_compaqcxx_major" != "V6"; then - { echo "$as_me:$LINENO: WARNING: found version \"$_compaqc_version\", use version 6 of the Compaq C++ compiler" >&5 -echo "$as_me: WARNING: found version \"$_compaqc_version\", use version 6 of the Compaq C++ compiler" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: found version \"$_compaqc_version\", use version 6 of the Compaq C++ compiler" >&5 +$as_echo "$as_me: WARNING: found version \"$_compaqc_version\", use version 6 of the Compaq C++ compiler" >&2;} echo "found version $_compaqc_version, use version 6 of the Compaq C++ compiler" >> warn else - echo "$as_me:$LINENO: result: checked" >&5 -echo "${ECHO_T}checked" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked" >&5 +$as_echo "checked" >&6; } fi fi -echo "$as_me:$LINENO: checking exception type" >&5 -echo $ECHO_N "checking exception type... $ECHO_C" >&6 -ac_ext=cc +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking exception type" >&5 +$as_echo_n "checking exception type... " >&6; } +ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -9644,11 +9682,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test "$WITH_MINGWIN" = "yes"; then -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -9663,42 +9697,18 @@ _Unwind_SjLj_RaiseException() return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_cxx_try_link "$LINENO"; then : exceptions_type="sjlj" else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -exceptions_type="dwarf2" + exceptions_type="dwarf2" fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $exceptions_type" >&5 -echo "${ECHO_T}$exceptions_type" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $exceptions_type" >&5 +$as_echo "$exceptions_type" >&6; } ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -9711,8 +9721,8 @@ EXCEPTIONS="$exceptions_type" if test "$_os" = "SunOS"; then _temp=`showrev -p | $AWK -F" " '{ print $2 }'` if test "$_os_release" = "7"; then - echo "$as_me:$LINENO: checking for patch 106327-06 or greater" >&5 -echo $ECHO_N "checking for patch 106327-06 or greater... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for patch 106327-06 or greater" >&5 +$as_echo_n "checking for patch 106327-06 or greater... " >&6; } _patch=`echo $_temp | $AWK '/106327-06/ { print "found" }'` _patch="false" for i in $_temp @@ -9726,15 +9736,15 @@ echo $ECHO_N "checking for patch 106327-06 or greater... $ECHO_C" >&6 fi done if test "$_patch" = "found"; then - echo "$as_me:$LINENO: result: found" >&5 -echo "${ECHO_T}found" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 +$as_echo "found" >&6; } else - { echo "$as_me:$LINENO: WARNING: patch 106327-06 not found, please install compiler patch 106327-06 or greater" >&5 -echo "$as_me: WARNING: patch 106327-06 not found, please install compiler patch 106327-06 or greater" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: patch 106327-06 not found, please install compiler patch 106327-06 or greater" >&5 +$as_echo "$as_me: WARNING: patch 106327-06 not found, please install compiler patch 106327-06 or greater" >&2;} echo "patch 106327-06 not found, please install compiler patch 106327-06 or greater" >> warn fi - echo "$as_me:$LINENO: checking for patch 106950-11 or greater" >&5 -echo $ECHO_N "checking for patch 106950-11 or greater... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for patch 106950-11 or greater" >&5 +$as_echo_n "checking for patch 106950-11 or greater... " >&6; } _patch=`echo $_temp | $AWK '/106950-11/ { print "found" }'` _patch="false" for i in $_temp @@ -9748,17 +9758,17 @@ echo $ECHO_N "checking for patch 106950-11 or greater... $ECHO_C" >&6 fi done if test "$_patch" = "found"; then - echo "$as_me:$LINENO: result: found" >&5 -echo "${ECHO_T}found" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 +$as_echo "found" >&6; } else - { echo "$as_me:$LINENO: WARNING: patch 106950-11 not found, please install linker patch 106950-11 or greater" >&5 -echo "$as_me: WARNING: patch 106950-11 not found, please install linker patch 106950-11 or greater" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: patch 106950-11 not found, please install linker patch 106950-11 or greater" >&5 +$as_echo "$as_me: WARNING: patch 106950-11 not found, please install linker patch 106950-11 or greater" >&2;} echo "patch 106950-11 not found, please install linker patch 106950-11 or greater" >> warn fi else if test "$_os_release" = "6"; then - echo "$as_me:$LINENO: checking for patch 105591-09 or greater" >&5 -echo $ECHO_N "checking for patch 105591-09 or greater... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for patch 105591-09 or greater" >&5 +$as_echo_n "checking for patch 105591-09 or greater... " >&6; } _patch=`echo $_temp | $AWK '/105591-09/ { print "found" }'` _patch="false" for i in $_temp @@ -9772,15 +9782,15 @@ echo $ECHO_N "checking for patch 105591-09 or greater... $ECHO_C" >&6 fi done if test "$_patch" = "found"; then - echo "$as_me:$LINENO: result: found" >&5 -echo "${ECHO_T}found" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 +$as_echo "found" >&6; } else - { echo "$as_me:$LINENO: WARNING: patch 105591-09 not found, please install compiler patch 105591-09 or greater" >&5 -echo "$as_me: WARNING: patch 105591-09 not found, please install compiler patch 105591-09 or greater" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: patch 105591-09 not found, please install compiler patch 105591-09 or greater" >&5 +$as_echo "$as_me: WARNING: patch 105591-09 not found, please install compiler patch 105591-09 or greater" >&2;} echo "patch 105591-09 not found, please install compiler patch 105591-09 or greater" >> warn fi - echo "$as_me:$LINENO: checking for patch 107733-08 or greater" >&5 -echo $ECHO_N "checking for patch 107733-08 or greater... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for patch 107733-08 or greater" >&5 +$as_echo_n "checking for patch 107733-08 or greater... " >&6; } _patch=`echo $_temp | $AWK '/107733-08/ { print "found" }'` _patch="false" for i in $_temp @@ -9794,11 +9804,11 @@ echo $ECHO_N "checking for patch 107733-08 or greater... $ECHO_C" >&6 fi done if test "$_patch" = "found"; then - echo "$as_me:$LINENO: result: found" >&5 -echo "${ECHO_T}found" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 +$as_echo "found" >&6; } else - { echo "$as_me:$LINENO: WARNING: patch 107733-06 not found, please install linker patch 107733-08 or greater" >&5 -echo "$as_me: WARNING: patch 107733-06 not found, please install linker patch 107733-08 or greater" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: patch 107733-06 not found, please install linker patch 107733-08 or greater" >&5 +$as_echo "$as_me: WARNING: patch 107733-06 not found, please install linker patch 107733-08 or greater" >&2;} echo "patch 107733-06 not found, please install linker patch 107733-08 or greater" >> warn fi fi @@ -9807,25 +9817,23 @@ fi if test -n "$enable_sgistl" && "$enable_sgistl" != "no"; then if test "$_os" = "IRIX" -o "$_os" = "IRIX64"; then - echo "$as_me:$LINENO: checking for SGI STL" >&5 -echo $ECHO_N "checking for SGI STL... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SGI STL" >&5 +$as_echo_n "checking for SGI STL... " >&6; } if test -d /usr/include/CC ; then - echo "$as_me:$LINENO: result: yes." >&5 -echo "${ECHO_T}yes." >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes." >&5 +$as_echo "yes." >&6; } else - echo "$as_me:$LINENO: result: not found." >&5 -echo "${ECHO_T}not found." >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found." >&5 +$as_echo "not found." >&6; } fi else - { { echo "$as_me:$LINENO: error: Option --enable-sgistl is only valid for IRIX" >&5 -echo "$as_me: error: Option --enable-sgistl is only valid for IRIX" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Option --enable-sgistl is only valid for IRIX" "$LINENO" 5 fi else - echo "$as_me:$LINENO: checking what the default STL should be" >&5 -echo $ECHO_N "checking what the default STL should be... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking what the default STL should be" >&5 +$as_echo_n "checking what the default STL should be... " >&6; } DEFAULT_TO_STLPORT="no" if test "$_os" = "Linux"; then case "$build_cpu" in @@ -9846,152 +9854,116 @@ echo $ECHO_N "checking what the default STL should be... $ECHO_C" >&6 DEFAULT_TO_STLPORT="yes" fi if test "$DEFAULT_TO_STLPORT" = "yes"; then - echo "$as_me:$LINENO: result: stlport" >&5 -echo "${ECHO_T}stlport" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: stlport" >&5 +$as_echo "stlport" >&6; } else - echo "$as_me:$LINENO: result: system" >&5 -echo "${ECHO_T}system" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: system" >&5 +$as_echo "system" >&6; } fi if test "$WITH_STLPORT" = "auto"; then WITH_STLPORT=$DEFAULT_TO_STLPORT fi - echo "$as_me:$LINENO: checking for STL providing headers" >&5 -echo $ECHO_N "checking for STL providing headers... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for STL providing headers" >&5 +$as_echo_n "checking for STL providing headers... " >&6; } STLPORT4="" USE_SYSTEM_STL="" if test "$WITH_STLPORT" = "yes"; then - echo "$as_me:$LINENO: result: using internal stlport." >&5 -echo "${ECHO_T}using internal stlport." >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: using internal stlport." >&5 +$as_echo "using internal stlport." >&6; } if test "$DEFAULT_TO_STLPORT" != "yes"; then - { echo "$as_me:$LINENO: WARNING: using stlport. Warning, breaks your ABI compatability!" >&5 -echo "$as_me: WARNING: using stlport. Warning, breaks your ABI compatability!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using stlport. Warning, breaks your ABI compatability!" >&5 +$as_echo "$as_me: WARNING: using stlport. Warning, breaks your ABI compatability!" >&2;} echo "using stlport. Warning, breaks your ABI compatability!" >>warn fi elif test "$WITH_STLPORT" = "no"; then - echo "$as_me:$LINENO: result: using system STL" >&5 -echo "${ECHO_T}using system STL" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: using system STL" >&5 +$as_echo "using system STL" >&6; } USE_SYSTEM_STL="YES" if test "$DEFAULT_TO_STLPORT" != "no"; then - { echo "$as_me:$LINENO: WARNING: using system STL. Warning, breaks your ABI compatability!" >&5 -echo "$as_me: WARNING: using system STL. Warning, breaks your ABI compatability!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using system STL. Warning, breaks your ABI compatability!" >&5 +$as_echo "$as_me: WARNING: using system STL. Warning, breaks your ABI compatability!" >&2;} echo "using system STL. Warning, breaks your ABI compatability!" >>warn fi else STLPORT4=$WITH_STLPORT if test "$_os" != "WINNT" -o "$WITH_MINGWIN" = "yes"; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $STLPORT4/stlport/hash_map _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - echo "$as_me:$LINENO: result: checked." >&5 -echo "${ECHO_T}checked." >&6 +if ac_fn_c_try_cpp "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked." >&5 +$as_echo "checked." >&6; } else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - { { echo "$as_me:$LINENO: error: STLport headers not found." >&5 -echo "$as_me: error: STLport headers not found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "STLport headers not found." "$LINENO" 5 fi rm -f conftest.err conftest.$ac_ext else if test -f "$STLPORT4/stlport/hash_map"; then - echo "$as_me:$LINENO: result: checked." >&5 -echo "${ECHO_T}checked." >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked." >&5 +$as_echo "checked." >&6; } else - { { echo "$as_me:$LINENO: error: STLport headers not found." >&5 -echo "$as_me: error: STLport headers not found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "STLport headers not found." "$LINENO" 5 fi fi if test "$_os" != "WINNT" -o "$WITH_MINGWIN" = "yes"; then - echo "$as_me:$LINENO: checking for STLport libraries" >&5 -echo $ECHO_N "checking for STLport libraries... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for STLport libraries" >&5 +$as_echo_n "checking for STLport libraries... " >&6; } if test "$_os" = "SunOS"; then if test -f "$STLPORT4/lib/libstlport_sunpro.so"; then - echo "$as_me:$LINENO: result: checked" >&5 -echo "${ECHO_T}checked" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked" >&5 +$as_echo "checked" >&6; } elif test -f "$STLPORT4/lib/libstlport.so"; then - echo "$as_me:$LINENO: result: checked" >&5 -echo "${ECHO_T}checked" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked" >&5 +$as_echo "checked" >&6; } STLPORT_VER=500 else - { { echo "$as_me:$LINENO: error: STLport libraries not found" >&5 -echo "$as_me: error: STLport libraries not found" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "STLport libraries not found" "$LINENO" 5 fi elif test "$_os" = "Darwin"; then if test -f "$STLPORT4/lib/libstlport_gcc.dylib"; then - echo "$as_me:$LINENO: result: checked" >&5 -echo "${ECHO_T}checked" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked" >&5 +$as_echo "checked" >&6; } elif test -f "$STLPORT4/lib/libstlport.dylib"; then - echo "$as_me:$LINENO: result: checked" >&5 -echo "${ECHO_T}checked" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked" >&5 +$as_echo "checked" >&6; } STLPORT_VER=500 else - { { echo "$as_me:$LINENO: error: STLport libraries not found" >&5 -echo "$as_me: error: STLport libraries not found" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "STLport libraries not found" "$LINENO" 5 fi elif test "$_os" = "IRIX" -o "$_os" = "IRIX64"; then if test -f "$STLPORT4/lib/libstlport_mipspro_41.so"; then - echo "$as_me:$LINENO: result: checked" >&5 -echo "${ECHO_T}checked" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked" >&5 +$as_echo "checked" >&6; } else if test -f "$STLPORT4/lib/libstlport_gcc.so"; then - echo "$as_me:$LINENO: result: checked" >&5 -echo "${ECHO_T}checked" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked" >&5 +$as_echo "checked" >&6; } elif test -f "$STLPORT4/lib/libstlport.so"; then - echo "$as_me:$LINENO: result: checked" >&5 -echo "${ECHO_T}checked" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked" >&5 +$as_echo "checked" >&6; } STLPORT_VER=500 else - { { echo "$as_me:$LINENO: error: STLport libraries not found" >&5 -echo "$as_me: error: STLport libraries not found" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "STLport libraries not found" "$LINENO" 5 fi fi else if test -f "$STLPORT4/lib/libstlport_gcc.so"; then - echo "$as_me:$LINENO: result: checked" >&5 -echo "${ECHO_T}checked" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked" >&5 +$as_echo "checked" >&6; } elif test -f "$STLPORT4/lib/libstlport.so"; then - echo "$as_me:$LINENO: result: checked" >&5 -echo "${ECHO_T}checked" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked" >&5 +$as_echo "checked" >&6; } STLPORT_VER=500 else - { { echo "$as_me:$LINENO: error: STLport libraries not found" >&5 -echo "$as_me: error: STLport libraries not found" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "STLport libraries not found" "$LINENO" 5 fi fi fi if test "$DEFAULT_TO_STLPORT" != "yes"; then - { echo "$as_me:$LINENO: WARNING: using stlport. Warning, breaks your ABI compatability!" >&5 -echo "$as_me: WARNING: using stlport. Warning, breaks your ABI compatability!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using stlport. Warning, breaks your ABI compatability!" >&5 +$as_echo "$as_me: WARNING: using stlport. Warning, breaks your ABI compatability!" >&2;} echo "using stlport. Warning, breaks your ABI compatability!" >>warn fi fi @@ -10008,15 +9980,11 @@ fi if test "$GCC" = "yes"; then - echo "$as_me:$LINENO: checking whether $CC supports -fvisibility=hidden" >&5 -echo $ECHO_N "checking whether $CC supports -fvisibility=hidden... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -fvisibility=hidden" >&5 +$as_echo_n "checking whether $CC supports -fvisibility=hidden... " >&6; } save_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -fvisibility=hidden" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -10027,72 +9995,47 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_link "$LINENO"; then : HAVE_GCC_VISIBILITY_FEATURE=TRUE -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CFLAGS=$save_CFLAGS if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi fi # =================================================================== # use --ccache-skip? # =================================================================== -echo "$as_me:$LINENO: checking whether we are allowed and able to use --ccache-skip" >&5 -echo $ECHO_N "checking whether we are allowed and able to use --ccache-skip... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are allowed and able to use --ccache-skip" >&5 +$as_echo_n "checking whether we are allowed and able to use --ccache-skip... " >&6; } if test "$_os" != "Darwin" ; then - echo "$as_me:$LINENO: result: only used on Mac currently, skipping" >&5 -echo "${ECHO_T}only used on Mac currently, skipping" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: only used on Mac currently, skipping" >&5 +$as_echo "only used on Mac currently, skipping" >&6; } elif test "$enable_ccache_skip" = "no" ; then - echo "$as_me:$LINENO: result: no - diabled explicitly" >&5 -echo "${ECHO_T}no - diabled explicitly" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - diabled explicitly" >&5 +$as_echo "no - diabled explicitly" >&6; } elif test "$enable_ccache_skip" = "yes" ; then - echo "$as_me:$LINENO: result: yes - enabled explicitly, skipping checks" >&5 -echo "${ECHO_T}yes - enabled explicitly, skipping checks" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes - enabled explicitly, skipping checks" >&5 +$as_echo "yes - enabled explicitly, skipping checks" >&6; } USE_CCACHE=YES elif test "$enable_ccache_skip" = "auto" ; then # checking for ccache presence/version - echo "$as_me:$LINENO: result: probing..." >&5 -echo "${ECHO_T}probing..." >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: probing..." >&5 +$as_echo "probing..." >&6; } # Extract the first word of "ccache", so it can be a program name with args. set dummy ccache; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_CCACHE+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_CCACHE+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $CCACHE in [\\/]* | ?:[\\/]*) @@ -10104,43 +10047,44 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CCACHE="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS test -z "$ac_cv_path_CCACHE" && ac_cv_path_CCACHE="not_found" ;; esac fi CCACHE=$ac_cv_path_CCACHE - if test -n "$CCACHE"; then - echo "$as_me:$LINENO: result: $CCACHE" >&5 -echo "${ECHO_T}$CCACHE" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CCACHE" >&5 +$as_echo "$CCACHE" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + if test "$CCACHE" = "not_found" ; then - { echo "$as_me:$LINENO: not enabling --ccache-skip (ccache not found)" >&5 -echo "$as_me: not enabling --ccache-skip (ccache not found)" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: not enabling --ccache-skip (ccache not found)" >&5 +$as_echo "$as_me: not enabling --ccache-skip (ccache not found)" >&6;} else # check ccache version - echo "$as_me:$LINENO: checking whether version of ccache is suitable" >&5 -echo $ECHO_N "checking whether version of ccache is suitable... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether version of ccache is suitable" >&5 +$as_echo_n "checking whether version of ccache is suitable... " >&6; } CCACHE_VERSION=`"$CCACHE" -V | "$AWK" '/^ccache version/{print $3}'` if test "$CCACHE_VERSION" = "2.4_OOo"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - echo "$as_me:$LINENO: checking whether ccache is actually used for the build" >&5 -echo $ECHO_N "checking whether ccache is actually used for the build... $ECHO_C" >&6 - ac_ext=cc + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ccache is actually used for the build" >&5 +$as_echo_n "checking whether ccache is actually used for the build... " >&6; } + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -10148,11 +10092,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu save_CXXFLAGS=$CXXFLAGS CXXFLAGS="$CXXFLAGS --ccache-skip -O2" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -10163,44 +10103,20 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_cxx_try_compile "$LINENO"; then : use_ccache=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -use_ccache=no + use_ccache=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $use_ccache = yes ; then - echo "$as_me:$LINENO: result: yes, will enable --ccache-skip" >&5 -echo "${ECHO_T}yes, will enable --ccache-skip" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, will enable --ccache-skip" >&5 +$as_echo "yes, will enable --ccache-skip" >&6; } USE_CCACHE=YES else - echo "$as_me:$LINENO: result: no, will not enable --ccache-skip" >&5 -echo "${ECHO_T}no, will not enable --ccache-skip" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, will not enable --ccache-skip" >&5 +$as_echo "no, will not enable --ccache-skip" >&6; } fi CXXFLAGS=$save_CXXFLAGS ac_ext=c @@ -10210,33 +10126,27 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - { echo "$as_me:$LINENO: ccache version $CCACHE_VERSION not accepted. See description for --enable-ccache-skip" >&5 -echo "$as_me: ccache version $CCACHE_VERSION not accepted. See description for --enable-ccache-skip" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: ccache version $CCACHE_VERSION not accepted. See description for --enable-ccache-skip" >&5 +$as_echo "$as_me: ccache version $CCACHE_VERSION not accepted. See description for --enable-ccache-skip" >&6;} fi fi else - { { echo "$as_me:$LINENO: error: invalid option to --enable-ccache-skip. Valid values are \"auto\", \"yes\" and \"no\"" >&5 -echo "$as_me: error: invalid option to --enable-ccache-skip. Valid values are \"auto\", \"yes\" and \"no\"" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "invalid option to --enable-ccache-skip. Valid values are \"auto\", \"yes\" and \"no\"" "$LINENO" 5 fi if test "$USE_SYSTEM_STL" = "YES"; then - echo "$as_me:$LINENO: checking if hash_map will be in __gnu_cxx namespace" >&5 -echo $ECHO_N "checking if hash_map will be in __gnu_cxx namespace... $ECHO_C" >&6 - ac_ext=cc + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if hash_map will be in __gnu_cxx namespace" >&5 +$as_echo_n "checking if hash_map will be in __gnu_cxx namespace... " >&6; } + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include using namespace __gnu_cxx; @@ -10249,72 +10159,42 @@ hash_map t; return 0; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_cxx_have_ext_hash_map=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_cxx_have_ext_hash_map=no + ac_cv_cxx_have_ext_hash_map=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "$ac_cv_cxx_have_ext_hash_map" = "no"; then - { { echo "$as_me:$LINENO: error: Can't find hash_map. Try with --with-stlport" >&5 -echo "$as_me: error: Can't find hash_map. Try with --with-stlport" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Can't find hash_map. Try with --with-stlport" "$LINENO" 5 else - echo "$as_me:$LINENO: result: $ac_cv_cxx_have_ext_hash_map" >&5 -echo "${ECHO_T}$ac_cv_cxx_have_ext_hash_map" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_have_ext_hash_map" >&5 +$as_echo "$ac_cv_cxx_have_ext_hash_map" >&6; } fi if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then - echo "$as_me:$LINENO: checking if STL headers are visibility safe" >&5 -echo $ECHO_N "checking if STL headers are visibility safe... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if STL headers are visibility safe" >&5 +$as_echo_n "checking if STL headers are visibility safe... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "visibility push" >/dev/null 2>&1; then + $EGREP "visibility push" >/dev/null 2>&1; then : stlvisok=yes else stlvisok=no fi rm -f conftest* - echo "$as_me:$LINENO: result: $stlvisok" >&5 -echo "${ECHO_T}$stlvisok" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $stlvisok" >&5 +$as_echo "$stlvisok" >&6; } if test "$stlvisok" = "no"; then - { echo "$as_me:$LINENO: WARNING: Your gcc STL headers are not visibility safe. Disabling visibility" >&5 -echo "$as_me: WARNING: Your gcc STL headers are not visibility safe. Disabling visibility" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Your gcc STL headers are not visibility safe. Disabling visibility" >&5 +$as_echo "$as_me: WARNING: Your gcc STL headers are not visibility safe. Disabling visibility" >&2;} echo "Your gcc STL headers are not visibility safe. Disabling visibility" >> warn unset HAVE_GCC_VISIBILITY_FEATURE fi @@ -10324,13 +10204,9 @@ echo "$as_me: WARNING: Your gcc STL headers are not visibility safe. Disabling v sharedlink_ldflags_save=$LDFLAGS LDFLAGS="$LDFLAGS -fvisibility-inlines-hidden -fpic -shared" - echo "$as_me:$LINENO: checking if gcc is -fvisibility-inlines-hidden safe with STL headers" >&5 -echo $ECHO_N "checking if gcc is -fvisibility-inlines-hidden safe with STL headers... $ECHO_C" >&6 - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gcc is -fvisibility-inlines-hidden safe with STL headers" >&5 +$as_echo_n "checking if gcc is -fvisibility-inlines-hidden safe with STL headers... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include using namespace std; @@ -10343,43 +10219,19 @@ istringstream strm( "test" ); return 0; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_cxx_try_link "$LINENO"; then : $EGREP -q unresolvable conftest.err; if test $? -eq 0; then gccvisok=no; else gccvisok=yes; fi else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -gccvisok=no + gccvisok=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - echo "$as_me:$LINENO: result: $gccvisok" >&5 -echo "${ECHO_T}$gccvisok" >&6 +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gccvisok" >&5 +$as_echo "$gccvisok" >&6; } if test "$gccvisok" = "no"; then - { echo "$as_me:$LINENO: WARNING: Your gcc is not -fvisibility-inlines-hidden safe. Disabling visibility" >&5 -echo "$as_me: WARNING: Your gcc is not -fvisibility-inlines-hidden safe. Disabling visibility" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Your gcc is not -fvisibility-inlines-hidden safe. Disabling visibility" >&5 +$as_echo "$as_me: WARNING: Your gcc is not -fvisibility-inlines-hidden safe. Disabling visibility" >&2;} echo "Your gcc is not -fvisibility-inlines-hidden safe. Disabling visibility" >> warn unset HAVE_GCC_VISIBILITY_FEATURE fi @@ -10388,8 +10240,8 @@ echo "$as_me: WARNING: Your gcc is not -fvisibility-inlines-hidden safe. Disabli fi if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then - echo "$as_me:$LINENO: checking if gcc has a visibility bug with class-level attributes (GCC bug 26905)" >&5 -echo $ECHO_N "checking if gcc has a visibility bug with class-level attributes (GCC bug 26905)... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gcc has a visibility bug with class-level attributes (GCC bug 26905)" >&5 +$as_echo_n "checking if gcc has a visibility bug with class-level attributes (GCC bug 26905)... " >&6; } cat >visibility.cxx <<_ACEOF #pragma GCC visibility push(hidden) struct __attribute__ ((visibility ("default"))) TestStruct { @@ -10410,11 +10262,11 @@ _ACEOF fi rm -f visibility.s - echo "$as_me:$LINENO: result: $gccvisbroken" >&5 -echo "${ECHO_T}$gccvisbroken" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gccvisbroken" >&5 +$as_echo "$gccvisbroken" >&6; } if test "$gccvisbroken" = "yes"; then - { echo "$as_me:$LINENO: WARNING: Your gcc is not -fvisibility=hidden safe. Disabling visibility" >&5 -echo "$as_me: WARNING: Your gcc is not -fvisibility=hidden safe. Disabling visibility" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Your gcc is not -fvisibility=hidden safe. Disabling visibility" >&5 +$as_echo "$as_me: WARNING: Your gcc is not -fvisibility=hidden safe. Disabling visibility" >&2;} echo "Your gcc is not -fvisibility=hidden safe. Disabling visibility" >> warn unset HAVE_GCC_VISIBILITY_FEATURE fi @@ -10430,112 +10282,20 @@ fi -echo "$as_me:$LINENO: checking which memory allocator to use" >&5 -echo $ECHO_N "checking which memory allocator to use... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which memory allocator to use" >&5 +$as_echo_n "checking which memory allocator to use... " >&6; } if test "$with_alloc" = "system"; then - echo "$as_me:$LINENO: result: system" >&5 -echo "${ECHO_T}system" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: system" >&5 +$as_echo "system" >&6; } ALLOC="SYS_ALLOC"; - - - - -for ac_func in malloc realloc calloc free -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) -choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != $ac_func; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_var=no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 -if test `eval echo '${'$as_ac_var'}'` = yes; then + for ac_func in malloc realloc calloc free +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +eval as_val=\$$as_ac_var + if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -10543,79 +10303,48 @@ done fi if test "$with_alloc" = "tcmalloc"; then - echo "$as_me:$LINENO: result: tcmalloc" >&5 -echo "${ECHO_T}tcmalloc" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: tcmalloc" >&5 +$as_echo "tcmalloc" >&6; } if ! echo $build_cpu | grep -E 'i[3456]86' 2>/dev/null >/dev/null; then - { { echo "$as_me:$LINENO: error: tcmalloc only available/usable on ix86" >&5 -echo "$as_me: error: tcmalloc only available/usable on ix86" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "tcmalloc only available/usable on ix86" "$LINENO" 5 fi - -echo "$as_me:$LINENO: checking for malloc in -ltcmalloc" >&5 -echo $ECHO_N "checking for malloc in -ltcmalloc... $ECHO_C" >&6 -if test "${ac_cv_lib_tcmalloc_malloc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for malloc in -ltcmalloc" >&5 +$as_echo_n "checking for malloc in -ltcmalloc... " >&6; } +if test "${ac_cv_lib_tcmalloc_malloc+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ltcmalloc $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char malloc (); int main () { -malloc (); +return malloc (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_tcmalloc_malloc=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_tcmalloc_malloc=no + ac_cv_lib_tcmalloc_malloc=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_tcmalloc_malloc" >&5 -echo "${ECHO_T}$ac_cv_lib_tcmalloc_malloc" >&6 -if test $ac_cv_lib_tcmalloc_malloc = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tcmalloc_malloc" >&5 +$as_echo "$ac_cv_lib_tcmalloc_malloc" >&6; } +if test "x$ac_cv_lib_tcmalloc_malloc" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBTCMALLOC 1 _ACEOF @@ -10623,46 +10352,44 @@ _ACEOF LIBS="-ltcmalloc $LIBS" else - { { echo "$as_me:$LINENO: error: tcmalloc not found or functional. Install the Google Profiling Tools" >&5 -echo "$as_me: error: tcmalloc not found or functional. Install the Google Profiling Tools" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "tcmalloc not found or functional. Install the Google Profiling Tools" "$LINENO" 5 fi ALLOC="TCMALLOC"; fi if test "$with_alloc" = "internal" -o -z "$with_alloc"; then - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 +$as_echo "internal" >&6; } fi -echo "$as_me:$LINENO: checking whether to add custom build version" >&5 -echo $ECHO_N "checking whether to add custom build version... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to add custom build version" >&5 +$as_echo_n "checking whether to add custom build version... " >&6; } if test "z$with_build_version" != "z"; then BUILD_VER_STRING=$with_build_version - echo "$as_me:$LINENO: result: yes, $BUILD_VER_STRING" >&5 -echo "${ECHO_T}yes, $BUILD_VER_STRING" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, $BUILD_VER_STRING" >&5 +$as_echo "yes, $BUILD_VER_STRING" >&6; } else BUILD_VER_STRING= - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -echo "$as_me:$LINENO: checking whether to build with Java support" >&5 -echo $ECHO_N "checking whether to build with Java support... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Java support" >&5 +$as_echo_n "checking whether to build with Java support... " >&6; } if test "$WITH_JAVA" != "no"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } SOLAR_JAVA="TRUE" else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } SOLAR_JAVA="" - { echo "$as_me:$LINENO: WARNING: building without java will mean some features will not be available" >&5 -echo "$as_me: WARNING: building without java will mean some features will not be available" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: building without java will mean some features will not be available" >&5 +$as_echo "$as_me: WARNING: building without java will mean some features will not be available" >&2;} echo "building without java will mean some features will not be available" >>warn fi @@ -10689,10 +10416,10 @@ if test "$SOLAR_JAVA" != ""; then if test -z "$with_jdk_home"; then # Extract the first word of "$WITH_JAVA", so it can be a program name with args. set dummy $WITH_JAVA; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_JAVAINTERPRETER+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_JAVAINTERPRETER+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $JAVAINTERPRETER in [\\/]* | ?:[\\/]*) @@ -10704,36 +10431,35 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_JAVAINTERPRETER="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS ;; esac fi JAVAINTERPRETER=$ac_cv_path_JAVAINTERPRETER - if test -n "$JAVAINTERPRETER"; then - echo "$as_me:$LINENO: result: $JAVAINTERPRETER" >&5 -echo "${ECHO_T}$JAVAINTERPRETER" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVAINTERPRETER" >&5 +$as_echo "$JAVAINTERPRETER" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + else _java_path="$with_jdk_home/bin/$WITH_JAVA" if test -x "$_java_path"; then JAVAINTERPRETER=$_java_path else - { { echo "$as_me:$LINENO: error: $_java_path not found set with_jdk_home" >&5 -echo "$as_me: error: $_java_path not found set with_jdk_home" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "$_java_path not found set with_jdk_home" "$LINENO" 5 fi fi if test "$_os" = "WINNT"; then @@ -10747,13 +10473,11 @@ fi if test "$SOLAR_JAVA" != ""; then _gij_longver=0 - echo "$as_me:$LINENO: checking the installed JDK" >&5 -echo $ECHO_N "checking the installed JDK... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking the installed JDK" >&5 +$as_echo_n "checking the installed JDK... " >&6; } if test -n "$JAVAINTERPRETER"; then if test `$JAVAINTERPRETER -version 2>&1 | grep -c "Kaffe"` -gt 0; then - { { echo "$as_me:$LINENO: error: No valid check available. Please check the block for your desired java in configure.in" >&5 -echo "$as_me: error: No valid check available. Please check the block for your desired java in configure.in" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "No valid check available. Please check the block for your desired java in configure.in" "$LINENO" 5 # dnl Kaffe specific tests # KAFFE_VER=`$JAVAINTERPRETER -version 2>&1 | $EGREP " Version:" | $SED -r "s/.* Version: ([[0-9\.]]*).*/\1/"` # if test -z "$KAFFE_VER"; then @@ -10773,15 +10497,13 @@ echo "$as_me: error: No valid check available. Please check the block for your d # JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*java,,p"` elif test `$JAVAINTERPRETER --version 2>&1 | grep -c "GNU libgcj"` -gt 0; then JDK=gcj - echo "$as_me:$LINENO: result: checked (gcj)" >&5 -echo "${ECHO_T}checked (gcj)" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked (gcj)" >&5 +$as_echo "checked (gcj)" >&6; } _gij_version=`$JAVAINTERPRETER --version | grep GNU | $SED -e 's@^[^0-9]*@@' -e 's@ .*@@' -e 's@,.*@@'`; _gij_longver=`echo $_gij_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'` elif test `$JAVAINTERPRETER -version 2>&1 | awk '{ print }' | grep -c "BEA"` -gt 0; then - { { echo "$as_me:$LINENO: error: No valid check available. Please check the block for your desired java in configure.in" >&5 -echo "$as_me: error: No valid check available. Please check the block for your desired java in configure.in" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "No valid check available. Please check the block for your desired java in configure.in" "$LINENO" 5 # JDK=bea # # dnl BEA JDK specific tests @@ -10811,20 +10533,15 @@ echo "$as_me: error: No valid check available. Please check the block for your d _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'` if test "$_jdk_ver" -lt 10500; then - { { echo "$as_me:$LINENO: error: IBM JDK is too old, you need at least 1.5" >&5 -echo "$as_me: error: IBM JDK is too old, you need at least 1.5" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "IBM JDK is too old, you need at least 1.5" "$LINENO" 5 fi - echo "$as_me:$LINENO: result: checked (IBM JDK $_jdk)" >&5 -echo "${ECHO_T}checked (IBM JDK $_jdk)" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked (IBM JDK $_jdk)" >&5 +$as_echo "checked (IBM JDK $_jdk)" >&6; } if test "$with_jdk_home" = ""; then - { { echo "$as_me:$LINENO: error: In order to successfully build OpenOffice.org using the IBM JDK, -you must use the \"--with-jdk-home\" configure option explicitly" >&5 -echo "$as_me: error: In order to successfully build OpenOffice.org using the IBM JDK, -you must use the \"--with-jdk-home\" configure option explicitly" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "In order to successfully build OpenOffice.org using the IBM JDK, +you must use the \"--with-jdk-home\" configure option explicitly" "$LINENO" 5 fi JAVA_HOME=$with_jdk_home @@ -10836,12 +10553,10 @@ you must use the \"--with-jdk-home\" configure option explicitly" >&2;} _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'` if test "$_jdk_ver" -lt 10500; then - { { echo "$as_me:$LINENO: error: JDK is too old, you need at least 1.5" >&5 -echo "$as_me: error: JDK is too old, you need at least 1.5" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "JDK is too old, you need at least 1.5" "$LINENO" 5 fi - echo "$as_me:$LINENO: result: checked (JDK $_jdk)" >&5 -echo "${ECHO_T}checked (JDK $_jdk)" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked (JDK $_jdk)" >&5 +$as_echo "checked (JDK $_jdk)" >&6; } JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*java,,p"` if test "$_os" = "WINNT"; then JAVA_HOME=`echo $JAVA_HOME | $SED "s,\.[eE][xX][eE]$,,"` @@ -10851,9 +10566,7 @@ echo "${ECHO_T}checked (JDK $_jdk)" >&6 fi fi else - { { echo "$as_me:$LINENO: error: JAVA not found. You need at least jdk-1.5, or gcj-4" >&5 -echo "$as_me: error: JAVA not found. You need at least jdk-1.5, or gcj-4" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "JAVA not found. You need at least jdk-1.5, or gcj-4" "$LINENO" 5 fi else JAVA_HOME=NO_JAVA_HOME ; export JAVA_HOME @@ -10873,10 +10586,10 @@ if test "$SOLAR_JAVA" != ""; then if test -z "$with_jdk_home"; then # Extract the first word of "$javacompiler", so it can be a program name with args. set dummy $javacompiler; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_JAVACOMPILER+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_JAVACOMPILER+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $JAVACOMPILER in [\\/]* | ?:[\\/]*) @@ -10888,28 +10601,29 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_JAVACOMPILER="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS ;; esac fi JAVACOMPILER=$ac_cv_path_JAVACOMPILER - if test -n "$JAVACOMPILER"; then - echo "$as_me:$LINENO: result: $JAVACOMPILER" >&5 -echo "${ECHO_T}$JAVACOMPILER" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVACOMPILER" >&5 +$as_echo "$JAVACOMPILER" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + else _javac_path="$with_jdk_home/bin/$javacompiler" if test -x "$_javac_path"; then @@ -10917,9 +10631,7 @@ fi fi fi if test -z "$JAVACOMPILER"; then - { { echo "$as_me:$LINENO: error: $javacompiler not found set with_jdk_home" >&5 -echo "$as_me: error: $javacompiler not found set with_jdk_home" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "$javacompiler not found set with_jdk_home" "$LINENO" 5 fi if test "$_os" = "WINNT"; then if test x`echo "$JAVACOMPILER" | grep -i '\.exe$'` = x; then @@ -10935,11 +10647,11 @@ echo "$as_me: error: $javacompiler not found set with_jdk_home" >&2;} fi if test `$JAVACOMPILER -version 2>&1 | grep -c "Eclipse Java Compiler"` -gt 0; then - echo "$as_me:$LINENO: checking re-checking JDK" >&5 -echo $ECHO_N "checking re-checking JDK... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking re-checking JDK" >&5 +$as_echo_n "checking re-checking JDK... " >&6; } JDK=gcj - echo "$as_me:$LINENO: result: checked (ecj)" >&5 -echo "${ECHO_T}checked (ecj)" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked (ecj)" >&5 +$as_echo "checked (ecj)" >&6; } #TODO: what's to do here? some switch to do 1.5 compiling? JAVAFLAGS="-source 1.5 -target 1.5" _gij_longver="50000" @@ -10958,10 +10670,10 @@ if test "$SOLAR_JAVA" != ""; then if test -z "$with_jdk_home"; then # Extract the first word of "javadoc", so it can be a program name with args. set dummy javadoc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_JAVADOC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_JAVADOC+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $JAVADOC in [\\/]* | ?:[\\/]*) @@ -10973,28 +10685,29 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_JAVADOC="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS ;; esac fi JAVADOC=$ac_cv_path_JAVADOC - if test -n "$JAVADOC"; then - echo "$as_me:$LINENO: result: $JAVADOC" >&5 -echo "${ECHO_T}$JAVADOC" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVADOC" >&5 +$as_echo "$JAVADOC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + else _javadoc_path="$with_jdk_home/bin/javadoc" if test "$_os" = "OS2"; then @@ -11007,10 +10720,10 @@ fi else # Extract the first word of "javadoc", so it can be a program name with args. set dummy javadoc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_JAVADOC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_JAVADOC+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $JAVADOC in [\\/]* | ?:[\\/]*) @@ -11022,34 +10735,33 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_JAVADOC="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS ;; esac fi JAVADOC=$ac_cv_path_JAVADOC - if test -n "$JAVADOC"; then - echo "$as_me:$LINENO: result: $JAVADOC" >&5 -echo "${ECHO_T}$JAVADOC" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVADOC" >&5 +$as_echo "$JAVADOC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi fi if test -z "$JAVADOC"; then - { { echo "$as_me:$LINENO: error: $_javadoc_path not found set with_jdk_home" >&5 -echo "$as_me: error: $_javadoc_path not found set with_jdk_home" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "$_javadoc_path not found set with_jdk_home" "$LINENO" 5 fi if test "$_os" = "WINNT"; then if test x`echo "$JAVADOC" | grep -i '\.exe$'` = x; then @@ -11081,37 +10793,33 @@ class findhome } } _ACEOF - echo "$as_me:$LINENO: checking if javac works" >&5 -echo $ECHO_N "checking if javac works... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if javac works" >&5 +$as_echo_n "checking if javac works... " >&6; } javac_cmd="$JAVACOMPILER findhome.java 1>&2" - { (eval echo "$as_me:$LINENO: \"$javac_cmd\"") >&5 + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$javac_cmd\""; } >&5 (eval $javac_cmd) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } if test $? = 0 && test -f ./findhome.class ; then - echo "$as_me:$LINENO: result: javac works" >&5 -echo "${ECHO_T}javac works" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: javac works" >&5 +$as_echo "javac works" >&6; } else echo "configure: javac test failed" >&5 cat findhome.java >&5 - { { echo "$as_me:$LINENO: error: javac does not work - java projects will not build!" >&5 -echo "$as_me: error: javac does not work - java projects will not build!" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "javac does not work - java projects will not build!" "$LINENO" 5 fi - echo "$as_me:$LINENO: checking if gij knows its java.home" >&5 -echo $ECHO_N "checking if gij knows its java.home... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gij knows its java.home" >&5 +$as_echo_n "checking if gij knows its java.home... " >&6; } JAVA_HOME=`$JAVAINTERPRETER findhome` if test $? = 0 && test "$JAVA_HOME" != "" ; then - echo "$as_me:$LINENO: result: $JAVA_HOME" >&5 -echo "${ECHO_T}$JAVA_HOME" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVA_HOME" >&5 +$as_echo "$JAVA_HOME" >&6; } else echo "configure: java test failed" >&5 cat findhome.java >&5 - { { echo "$as_me:$LINENO: error: gij does not know its java.home - use --with-jdk-home" >&5 -echo "$as_me: error: gij does not know its java.home - use --with-jdk-home" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "gij does not know its java.home - use --with-jdk-home" "$LINENO" 5 fi else JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*$WITH_JAVA,,p"` @@ -11133,10 +10841,10 @@ echo "$as_me: error: gij does not know its java.home - use --with-jdk-home" >&2; JAVA_HOME=$(readlink $JAVACOMPILER) else # else warn - { echo "$as_me:$LINENO: WARNING: JAVA_HOME is set to /usr - this is very likely to be incorrect" >&5 -echo "$as_me: WARNING: JAVA_HOME is set to /usr - this is very likely to be incorrect" >&2;} - { echo "$as_me:$LINENO: WARNING: if this is the case, please inform the correct JAVA_HOME with --with-jdk-home" >&5 -echo "$as_me: WARNING: if this is the case, please inform the correct JAVA_HOME with --with-jdk-home" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: JAVA_HOME is set to /usr - this is very likely to be incorrect" >&5 +$as_echo "$as_me: WARNING: JAVA_HOME is set to /usr - this is very likely to be incorrect" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: if this is the case, please inform the correct JAVA_HOME with --with-jdk-home" >&5 +$as_echo "$as_me: WARNING: if this is the case, please inform the correct JAVA_HOME with --with-jdk-home" >&2;} echo "JAVA_HOME is set to /usr - this is very likely to be incorrect" >> warn echo "if this is the case, please inform the correct JAVA_HOME with --with-jdk-home" >> warn fi @@ -11158,243 +10866,77 @@ echo "$as_me: WARNING: if this is the case, please inform the correct JAVA_HOME JAVA_HOME_OK="NO" fi if test "$JAVA_HOME_OK" = "NO"; then - { echo "$as_me:$LINENO: WARNING: JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script" >&5 -echo "$as_me: WARNING: JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script" >&2;} - { echo "$as_me:$LINENO: WARNING: attempted to find JAVA_HOME automatically, but apparently it failed" >&5 -echo "$as_me: WARNING: attempted to find JAVA_HOME automatically, but apparently it failed" >&2;} - { echo "$as_me:$LINENO: WARNING: in case JAVA_HOME is incorrectly set, some projects with not be built correctly" >&5 -echo "$as_me: WARNING: in case JAVA_HOME is incorrectly set, some projects with not be built correctly" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script" >&5 +$as_echo "$as_me: WARNING: JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: attempted to find JAVA_HOME automatically, but apparently it failed" >&5 +$as_echo "$as_me: WARNING: attempted to find JAVA_HOME automatically, but apparently it failed" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: in case JAVA_HOME is incorrectly set, some projects with not be built correctly" >&5 +$as_echo "$as_me: WARNING: in case JAVA_HOME is incorrectly set, some projects with not be built correctly" >&2;} echo "JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script" >> warn - echo "attempted to find JAVA_HOME automatically, but apparently it failed" >> warn - echo "in case JAVA_HOME is incorrectly set, some projects with not be built correctly" >> warn -# if test "$JDK" == "gcj"; then -# echo "e.g. install java-1.4.2-gcj-compat-devel and use --with-jdk-home=/usr/lib/jvm/java-1.4.2-gcj" >> warn -# fi - fi - fi -fi - -AWTLIB= -if test "$SOLAR_JAVA" != ""; then - echo "$as_me:$LINENO: checking for jawt lib name" >&5 -echo $ECHO_N "checking for jawt lib name... $ECHO_C" >&6 - if test "$JDK" = "gcj"; then - save_CFLAGS=$CFLAGS - save_LDFLAGS=$LDFLAGS - CFLAGS="$CFLAGS -I$JAVA_HOME/include" - LDFLAGS="$LDFLAGS -L$JAVA_HOME/lib -lgcj" - exec 6>/dev/null # no output - if test "${ac_cv_header_jni_h+set}" = set; then - echo "$as_me:$LINENO: checking for jni.h" >&5 -echo $ECHO_N "checking for jni.h... $ECHO_C" >&6 -if test "${ac_cv_header_jni_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_jni_h" >&5 -echo "${ECHO_T}$ac_cv_header_jni_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking jni.h usability" >&5 -echo $ECHO_N "checking jni.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking jni.h presence" >&5 -echo $ECHO_N "checking jni.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: jni.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: jni.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: jni.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: jni.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: jni.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: jni.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: jni.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: jni.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: jni.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: jni.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: jni.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: jni.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: jni.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: jni.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: jni.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: jni.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for jni.h" >&5 -echo $ECHO_N "checking for jni.h... $ECHO_C" >&6 -if test "${ac_cv_header_jni_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_jni_h=$ac_header_preproc + echo "attempted to find JAVA_HOME automatically, but apparently it failed" >> warn + echo "in case JAVA_HOME is incorrectly set, some projects with not be built correctly" >> warn +# if test "$JDK" == "gcj"; then +# echo "e.g. install java-1.4.2-gcj-compat-devel and use --with-jdk-home=/usr/lib/jvm/java-1.4.2-gcj" >> warn +# fi + fi + fi fi -echo "$as_me:$LINENO: result: $ac_cv_header_jni_h" >&5 -echo "${ECHO_T}$ac_cv_header_jni_h" >&6 -fi -if test $ac_cv_header_jni_h = yes; then - : +AWTLIB= +if test "$SOLAR_JAVA" != ""; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jawt lib name" >&5 +$as_echo_n "checking for jawt lib name... " >&6; } + if test "$JDK" = "gcj"; then + save_CFLAGS=$CFLAGS + save_LDFLAGS=$LDFLAGS + CFLAGS="$CFLAGS -I$JAVA_HOME/include" + LDFLAGS="$LDFLAGS -L$JAVA_HOME/lib -lgcj" + exec 6>/dev/null # no output + ac_fn_c_check_header_mongrel "$LINENO" "jni.h" "ac_cv_header_jni_h" "$ac_includes_default" +if test "x$ac_cv_header_jni_h" = x""yes; then : + else - { { echo "$as_me:$LINENO: error: jni.h could not be found. Mismatch between gcc and libgcj or libgcj-devel missing?" >&5 -echo "$as_me: error: jni.h could not be found. Mismatch between gcc and libgcj or libgcj-devel missing?" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "jni.h could not be found. Mismatch between gcc and libgcj or libgcj-devel missing?" "$LINENO" 5 fi - echo "$as_me:$LINENO: checking for JAWT_GetAWT in -lgcjawt" >&5 -echo $ECHO_N "checking for JAWT_GetAWT in -lgcjawt... $ECHO_C" >&6 -if test "${ac_cv_lib_gcjawt_JAWT_GetAWT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JAWT_GetAWT in -lgcjawt" >&5 +$as_echo_n "checking for JAWT_GetAWT in -lgcjawt... " >&6; } +if test "${ac_cv_lib_gcjawt_JAWT_GetAWT+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgcjawt $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char JAWT_GetAWT (); int main () { -JAWT_GetAWT (); +return JAWT_GetAWT (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_gcjawt_JAWT_GetAWT=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_gcjawt_JAWT_GetAWT=no + ac_cv_lib_gcjawt_JAWT_GetAWT=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_gcjawt_JAWT_GetAWT" >&5 -echo "${ECHO_T}$ac_cv_lib_gcjawt_JAWT_GetAWT" >&6 -if test $ac_cv_lib_gcjawt_JAWT_GetAWT = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gcjawt_JAWT_GetAWT" >&5 +$as_echo "$ac_cv_lib_gcjawt_JAWT_GetAWT" >&6; } +if test "x$ac_cv_lib_gcjawt_JAWT_GetAWT" = x""yes; then : AWTLIB="-lgcjawt -lgcj" fi @@ -11413,287 +10955,93 @@ fi LD_LIBRARY_PATH=$JAVA_HOME/jre/bin:$JAVA_HOME/jre/bin/classic:$JAVA_HOME/jre/bin/xawt:$LD_LIBRARY_PATH export LD_LIBRARY_PATH exec 6>/dev/null # no output - if test "${ac_cv_header_jni_h+set}" = set; then - echo "$as_me:$LINENO: checking for jni.h" >&5 -echo $ECHO_N "checking for jni.h... $ECHO_C" >&6 -if test "${ac_cv_header_jni_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_jni_h" >&5 -echo "${ECHO_T}$ac_cv_header_jni_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking jni.h usability" >&5 -echo $ECHO_N "checking jni.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking jni.h presence" >&5 -echo $ECHO_N "checking jni.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: jni.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: jni.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: jni.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: jni.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: jni.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: jni.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: jni.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: jni.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: jni.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: jni.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: jni.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: jni.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: jni.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: jni.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: jni.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: jni.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for jni.h" >&5 -echo $ECHO_N "checking for jni.h... $ECHO_C" >&6 -if test "${ac_cv_header_jni_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_jni_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_jni_h" >&5 -echo "${ECHO_T}$ac_cv_header_jni_h" >&6 + ac_fn_c_check_header_mongrel "$LINENO" "jni.h" "ac_cv_header_jni_h" "$ac_includes_default" +if test "x$ac_cv_header_jni_h" = x""yes; then : -fi -if test $ac_cv_header_jni_h = yes; then - : else - { { echo "$as_me:$LINENO: error: jni.h could not be found." >&5 -echo "$as_me: error: jni.h could not be found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "jni.h could not be found." "$LINENO" 5 fi - echo "$as_me:$LINENO: checking for JAWT_GetAWT in -ljawt" >&5 -echo $ECHO_N "checking for JAWT_GetAWT in -ljawt... $ECHO_C" >&6 -if test "${ac_cv_lib_jawt_JAWT_GetAWT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JAWT_GetAWT in -ljawt" >&5 +$as_echo_n "checking for JAWT_GetAWT in -ljawt... " >&6; } +if test "${ac_cv_lib_jawt_JAWT_GetAWT+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ljawt $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char JAWT_GetAWT (); int main () { -JAWT_GetAWT (); +return JAWT_GetAWT (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_jawt_JAWT_GetAWT=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_jawt_JAWT_GetAWT=no + ac_cv_lib_jawt_JAWT_GetAWT=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_jawt_JAWT_GetAWT" >&5 -echo "${ECHO_T}$ac_cv_lib_jawt_JAWT_GetAWT" >&6 -if test $ac_cv_lib_jawt_JAWT_GetAWT = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jawt_JAWT_GetAWT" >&5 +$as_echo "$ac_cv_lib_jawt_JAWT_GetAWT" >&6; } +if test "x$ac_cv_lib_jawt_JAWT_GetAWT" = x""yes; then : AWTLIB="-ljawt" fi if test -z "$AWTLIB"; then LDFLAGS="$LDFLAGS -L$JAVA_HOME/jre/bin/xawt -ljawt" - echo "$as_me:$LINENO: checking for JAWT_GetAWT in -lmawt" >&5 -echo $ECHO_N "checking for JAWT_GetAWT in -lmawt... $ECHO_C" >&6 -if test "${ac_cv_lib_mawt_JAWT_GetAWT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JAWT_GetAWT in -lmawt" >&5 +$as_echo_n "checking for JAWT_GetAWT in -lmawt... " >&6; } +if test "${ac_cv_lib_mawt_JAWT_GetAWT+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmawt $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char JAWT_GetAWT (); int main () { -JAWT_GetAWT (); +return JAWT_GetAWT (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mawt_JAWT_GetAWT=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_mawt_JAWT_GetAWT=no + ac_cv_lib_mawt_JAWT_GetAWT=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_mawt_JAWT_GetAWT" >&5 -echo "${ECHO_T}$ac_cv_lib_mawt_JAWT_GetAWT" >&6 -if test $ac_cv_lib_mawt_JAWT_GetAWT = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mawt_JAWT_GetAWT" >&5 +$as_echo "$ac_cv_lib_mawt_JAWT_GetAWT" >&6; } +if test "x$ac_cv_lib_mawt_JAWT_GetAWT" = x""yes; then : AWTLIB="-L$JAVA_HOME/jre/bin/xawt -ljawt -lmawt" fi @@ -11706,24 +11054,24 @@ fi if test -z "$AWTLIB"; then AWTLIB=-ljawt fi - echo "$as_me:$LINENO: result: $AWTLIB" >&5 -echo "${ECHO_T}$AWTLIB" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWTLIB" >&5 +$as_echo "$AWTLIB" >&6; } fi if test "$SOLAR_JAVA" != ""; then - echo "$as_me:$LINENO: checking whether to enable gcj aot compilation" >&5 -echo $ECHO_N "checking whether to enable gcj aot compilation... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable gcj aot compilation" >&5 +$as_echo_n "checking whether to enable gcj aot compilation... " >&6; } if test -n "$enable_gcjaot" && test "$enable_gcjaot" != "no"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } if test `echo $WITH_JAVA | grep -c "gij"` -eq 0; then gcjaot="gcj" else gcjaot=`echo $WITH_JAVA | $SED -e "s/gij/gcj/g"` fi - echo "$as_me:$LINENO: result: $gcjaot" >&5 -echo "${ECHO_T}$gcjaot" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcjaot" >&5 +$as_echo "$gcjaot" >&6; } if test -n "$with_jdk_home"; then _javac_path="$with_jdk_home/bin/$gcjaot" if test -x "$_javac_path"; then @@ -11733,10 +11081,10 @@ echo "${ECHO_T}$gcjaot" >&6 if test -z "$JAVAAOTCOMPILER"; then # Extract the first word of "$gcjaot", so it can be a program name with args. set dummy $gcjaot; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_JAVAAOTCOMPILER+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_JAVAAOTCOMPILER+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $JAVAAOTCOMPILER in [\\/]* | ?:[\\/]*) @@ -11748,36 +11096,37 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_JAVAAOTCOMPILER="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS ;; esac fi JAVAAOTCOMPILER=$ac_cv_path_JAVAAOTCOMPILER - if test -n "$JAVAAOTCOMPILER"; then - echo "$as_me:$LINENO: result: $JAVAAOTCOMPILER" >&5 -echo "${ECHO_T}$JAVAAOTCOMPILER" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVAAOTCOMPILER" >&5 +$as_echo "$JAVAAOTCOMPILER" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test -z "$JAVAAOTCOMPILER"; then - { echo "$as_me:$LINENO: WARNING: $gcjaot not found, set with_jdk_home" >&5 -echo "$as_me: WARNING: $gcjaot not found, set with_jdk_home" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $gcjaot not found, set with_jdk_home" >&5 +$as_echo "$as_me: WARNING: $gcjaot not found, set with_jdk_home" >&2;} fi else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi fi @@ -11793,10 +11142,10 @@ fi # Extract the first word of "dmake", so it can be a program name with args. set dummy dmake; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_DMAKE+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_DMAKE+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $DMAKE in [\\/]* | ?:[\\/]*) @@ -11808,35 +11157,36 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_DMAKE="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS test -z "$ac_cv_path_DMAKE" && ac_cv_path_DMAKE="no" ;; esac fi DMAKE=$ac_cv_path_DMAKE - if test -n "$DMAKE"; then - echo "$as_me:$LINENO: result: $DMAKE" >&5 -echo "${ECHO_T}$DMAKE" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DMAKE" >&5 +$as_echo "$DMAKE" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + if test "$DMAKE" = "no"; then BUILD_DMAKE=YES echo "dmake will be built on ./bootstrap" else - echo "$as_me:$LINENO: checking whether the found dmake is the right dmake" >&5 -echo $ECHO_N "checking whether the found dmake is the right dmake... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the found dmake is the right dmake" >&5 +$as_echo_n "checking whether the found dmake is the right dmake... " >&6; } # we need to find out whether that dmake we found is "our" dmake # or the dmake from Sun's SunStudio Compiler which is something # different @@ -11845,48 +11195,48 @@ echo $ECHO_N "checking whether the found dmake is the right dmake... $ECHO_C" >& $DMAKE -V 2>/dev/null | grep 'dmake .* Version .*' >/dev/null if test $? -eq 0; then BUILD_DMAKE=NO - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - echo "$as_me:$LINENO: checking the dmake version" >&5 -echo $ECHO_N "checking the dmake version... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking the dmake version" >&5 +$as_echo_n "checking the dmake version... " >&6; } DMAKE_VERSION=`$DMAKE -V | $AWK '$3 == "Version" {print $4}'` if test "`echo $DMAKE_VERSION | cut -d'.' -f1`" -gt "4"; then - echo "$as_me:$LINENO: result: OK, >= 4.11" >&5 -echo "${ECHO_T}OK, >= 4.11" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK, >= 4.11" >&5 +$as_echo "OK, >= 4.11" >&6; } elif test "`echo $DMAKE_VERSION | cut -d'.' -f1`" = "4" && \ test "`echo $DMAKE_VERSION | cut -d'.' -f2`" -ge "11"; then - echo "$as_me:$LINENO: result: OK, >= 4.11" >&5 -echo "${ECHO_T}OK, >= 4.11" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK, >= 4.11" >&5 +$as_echo "OK, >= 4.11" >&6; } else - echo "$as_me:$LINENO: result: too old. >= 4.11 is needed" >&5 -echo "${ECHO_T}too old. >= 4.11 is needed" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: too old. >= 4.11 is needed" >&5 +$as_echo "too old. >= 4.11 is needed" >&6; } echo "A newer dmake will be built on ./bootstrap" BUILD_DMAKE=YES fi else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } echo "dmake will be built on ./bootstrap" BUILD_DMAKE=YES fi fi -echo "$as_me:$LINENO: checking whether to enable EPM for packing" >&5 -echo $ECHO_N "checking whether to enable EPM for packing... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable EPM for packing" >&5 +$as_echo_n "checking whether to enable EPM for packing... " >&6; } if test "$_os" != "WINNT" -a \( "z$enable_epm" = "z" -o "$enable_epm" != "no" \) ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } if test "$_os" != "WINNT"; then if test -n "$with_epm"; then EPM=$with_epm else # Extract the first word of "epm", so it can be a program name with args. set dummy epm; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_EPM+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_EPM+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $EPM in [\\/]* | ?:[\\/]*) @@ -11898,29 +11248,30 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_EPM="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS test -z "$ac_cv_path_EPM" && ac_cv_path_EPM="no" ;; esac fi EPM=$ac_cv_path_EPM - if test -n "$EPM"; then - echo "$as_me:$LINENO: result: $EPM" >&5 -echo "${ECHO_T}$EPM" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $EPM" >&5 +$as_echo "$EPM" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$EPM" = "no" || test "$EPM" = "internal"; then echo "EPM will be built." @@ -11928,44 +11279,38 @@ fi BUILD_TYPE="$BUILD_TYPE EPM" else # Gentoo has some epm which is something different... - echo "$as_me:$LINENO: checking whether the found epm is the right epm" >&5 -echo $ECHO_N "checking whether the found epm is the right epm... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the found epm is the right epm" >&5 +$as_echo_n "checking whether the found epm is the right epm... " >&6; } if $EPM | grep "ESP Package Manager" >/dev/null 2>/dev/null; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else - { { echo "$as_me:$LINENO: error: no. Install ESP Package Manager (www.easysw.com/epm) and/or specify the path to the right epm" >&5 -echo "$as_me: error: no. Install ESP Package Manager (www.easysw.com/epm) and/or specify the path to the right epm" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "no. Install ESP Package Manager (www.easysw.com/epm) and/or specify the path to the right epm" "$LINENO" 5 fi - echo "$as_me:$LINENO: checking epm version" >&5 -echo $ECHO_N "checking epm version... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking epm version" >&5 +$as_echo_n "checking epm version... " >&6; } EPM_VERSION=`$EPM | grep 'ESP Package Manager' | cut -d' ' -f4 | $SED -e s/v//` if test "`echo $EPM_VERSION | cut -d'.' -f1`" -gt "3" || \ test "`echo $EPM_VERSION | cut -d'.' -f1`" -eq "3" -a "`echo $EPM_VERSION | cut -d'.' -f2`" -ge "7"; then - echo "$as_me:$LINENO: result: OK, >= 3.7" >&5 -echo "${ECHO_T}OK, >= 3.7" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK, >= 3.7" >&5 +$as_echo "OK, >= 3.7" >&6; } BUILD_EPM=NO if test "$_os" = "Darwin"; then - echo "$as_me:$LINENO: checking which PackageMaker EPM thinks to use" >&5 -echo $ECHO_N "checking which PackageMaker EPM thinks to use... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking which PackageMaker EPM thinks to use" >&5 +$as_echo_n "checking which PackageMaker EPM thinks to use... " >&6; } _pm=`strings $EPM | grep PackageMaker | cut -d" " -f1` if test "$_pm" = "/Developer/Applications/PackageMaker.app/Contents/MacOS/PackageMaker"; then - { { echo "$as_me:$LINENO: error: $_pm; PackageMaker expected in wrong path. Either patch your epm with the right path (/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker) or use internal patched epm (--with-epm=internal)" >&5 -echo "$as_me: error: $_pm; PackageMaker expected in wrong path. Either patch your epm with the right path (/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker) or use internal patched epm (--with-epm=internal)" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "$_pm; PackageMaker expected in wrong path. Either patch your epm with the right path (/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker) or use internal patched epm (--with-epm=internal)" "$LINENO" 5 elif test "$_pm" = "/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker"; then - echo "$as_me:$LINENO: result: $_pm, ok" >&5 -echo "${ECHO_T}$_pm, ok" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_pm, ok" >&5 +$as_echo "$_pm, ok" >&6; } else # we never should get here, but go safe - { { echo "$as_me:$LINENO: error: $_pm; PackageMaker expected in unknown path. Either patch your epm with the right path (/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker) or use internal patched epm (--with-epm=internal)" >&5 -echo "$as_me: error: $_pm; PackageMaker expected in unknown path. Either patch your epm with the right path (/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker) or use internal patched epm (--with-epm=internal)" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "$_pm; PackageMaker expected in unknown path. Either patch your epm with the right path (/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker) or use internal patched epm (--with-epm=internal)" "$LINENO" 5 fi fi else - echo "$as_me:$LINENO: result: too old. epm >= 3.7 is required." >&5 -echo "${ECHO_T}too old. epm >= 3.7 is required." >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: too old. epm >= 3.7 is required." >&5 +$as_echo "too old. epm >= 3.7 is required." >&6; } echo "EPM will be built." BUILD_EPM=YES BUILD_TYPE="$BUILD_TYPE EPM" @@ -11974,8 +11319,8 @@ echo "${ECHO_T}too old. epm >= 3.7 is required." >&6 fi # test which package format to use - echo "$as_me:$LINENO: checking which package format to use" >&5 -echo $ECHO_N "checking which package format to use... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking which package format to use" >&5 +$as_echo_n "checking which package format to use... " >&6; } # epm supports the following formats: # aix - AIX software distribution # bsd - FreeBSD, NetBSD, or OpenBSD software distribution @@ -12023,9 +11368,7 @@ echo $ECHO_N "checking which package format to use... $ECHO_C" >&6 # we never should get here since we check the arciecture/os at the beginning, # but go sure... *) - { { echo "$as_me:$LINENO: error: unknown system" >&5 -echo "$as_me: error: unknown system" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "unknown system" "$LINENO" 5 esac if test -n "$with_package_format"; then for i in $with_package_format; do @@ -12033,20 +11376,7 @@ echo "$as_me: error: unknown system" >&2;} aix | bsd | deb | inst | tardist | osx | pkg | rpm | setld | native | portable) ;; *) - { { echo "$as_me:$LINENO: error: unsupported format $i. Supported by EPM are: -aix - AIX software distribution -bsd - FreeBSD, NetBSD, or OpenBSD software distribution -depot or swinstall - HP-UX software distribution -deb - Debian software distribution -inst or tardist - IRIX software distribution -osx - MacOS X software distribution -pkg - Solaris software distribution -rpm - RedHat software distribution -setld - Tru64 (setld) software distribution -native - \"Native\" software distribution for the platform -portable - Portable software distribution - " >&5 -echo "$as_me: error: unsupported format $i. Supported by EPM are: + as_fn_error "unsupported format $i. Supported by EPM are: aix - AIX software distribution bsd - FreeBSD, NetBSD, or OpenBSD software distribution depot or swinstall - HP-UX software distribution @@ -12058,18 +11388,17 @@ rpm - RedHat software distribution setld - Tru64 (setld) software distribution native - \"Native\" software distribution for the platform portable - Portable software distribution - " >&2;} - { (exit 1); exit 1; }; } + " "$LINENO" 5 ;; esac done PKGFORMAT="$with_package_format" fi - echo "$as_me:$LINENO: result: $PKGFORMAT" >&5 -echo "${ECHO_T}$PKGFORMAT" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGFORMAT" >&5 +$as_echo "$PKGFORMAT" >&6; } if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null; then - echo "$as_me:$LINENO: checking for rpm" >&5 -echo $ECHO_N "checking for rpm... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rpm" >&5 +$as_echo_n "checking for rpm... " >&6; } for a in "$RPM" rpmbuild rpm; do $a --usage >/dev/null 2> /dev/null if test $? -eq 0; then @@ -12084,22 +11413,20 @@ echo $ECHO_N "checking for rpm... $ECHO_C" >&6 fi done if test -z "$RPM" ; then - { { echo "$as_me:$LINENO: error: not found" >&5 -echo "$as_me: error: not found" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "not found" "$LINENO" 5 else RPM_PATH=`which $RPM` - echo "$as_me:$LINENO: result: $RPM_PATH" >&5 -echo "${ECHO_T}$RPM_PATH" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RPM_PATH" >&5 +$as_echo "$RPM_PATH" >&6; } fi fi if echo "$PKGFORMAT" | $EGREP deb 2>&1 >/dev/null; then # Extract the first word of "dpkg", so it can be a program name with args. set dummy dpkg; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_DPKG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_DPKG+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $DPKG in [\\/]* | ?:[\\/]*) @@ -12111,81 +11438,76 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_DPKG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS test -z "$ac_cv_path_DPKG" && ac_cv_path_DPKG="no" ;; esac fi DPKG=$ac_cv_path_DPKG - if test -n "$DPKG"; then - echo "$as_me:$LINENO: result: $DPKG" >&5 -echo "${ECHO_T}$DPKG" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DPKG" >&5 +$as_echo "$DPKG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + if test "$DPKG" = "no"; then - { { echo "$as_me:$LINENO: error: dpkg needed for deb creation. Install dpkg." >&5 -echo "$as_me: error: dpkg needed for deb creation. Install dpkg." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "dpkg needed for deb creation. Install dpkg." "$LINENO" 5 fi fi if echo "PKGFORMAT" | $EGREP osx 2>&1 >/dev/null; then if test "$_os" = "Darwin"; then - echo "$as_me:$LINENO: checking for PackageMaker availability" >&5 -echo $ECHO_N "checking for PackageMaker availability... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PackageMaker availability" >&5 +$as_echo_n "checking for PackageMaker availability... " >&6; } if ! test -x /Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker; then - { { echo "$as_me:$LINENO: error: not installed. Please install Apples Dev Tools" >&5 -echo "$as_me: error: not installed. Please install Apples Dev Tools" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "not installed. Please install Apples Dev Tools" "$LINENO" 5 else - echo "$as_me:$LINENO: result: ok" >&5 -echo "${ECHO_T}ok" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } fi else - { { echo "$as_me:$LINENO: error: PackageMaker needed to build OSX packages and you are not on OSX..." >&5 -echo "$as_me: error: PackageMaker needed to build OSX packages and you are not on OSX..." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "PackageMaker needed to build OSX packages and you are not on OSX..." "$LINENO" 5 fi fi if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null || \ echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then if test "$EPM" != "no" && test "$EPM" != "internal"; then if test "`echo $EPM_VERSION | cut -d'.' -f1`" -lt "4"; then - echo "$as_me:$LINENO: checking whether epm is patched for OOos needs" >&5 -echo $ECHO_N "checking whether epm is patched for OOos needs... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether epm is patched for OOos needs" >&5 +$as_echo_n "checking whether epm is patched for OOos needs... " >&6; } if grep "Patched for OpenOffice.org" $EPM >/dev/null 2>/dev/null; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } if echo "$PKGFORMAT" | grep -q rpm; then _pt="rpm" - { echo "$as_me:$LINENO: WARNING: the rpms will need to be installed with --nodeps" >&5 -echo "$as_me: WARNING: the rpms will need to be installed with --nodeps" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: the rpms will need to be installed with --nodeps" >&5 +$as_echo "$as_me: WARNING: the rpms will need to be installed with --nodeps" >&2;} echo "the rpms will need to be installed with --nodeps" >> warn else _pt="pkg" fi - { echo "$as_me:$LINENO: WARNING: the ${_pt}s will not be relocateable" >&5 -echo "$as_me: WARNING: the ${_pt}s will not be relocateable" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: the ${_pt}s will not be relocateable" >&5 +$as_echo "$as_me: WARNING: the ${_pt}s will not be relocateable" >&2;} echo "the ${_pt}s will not be relocateable" >> warn - { echo "$as_me:$LINENO: WARNING: if you want to make sure installation without --nodeps and + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: if you want to make sure installation without --nodeps and relocation will work, you need to patch your epm with the patch in epm/epm-3.7.patch or build with --with-epm=internal which will build a suitable epm" >&5 -echo "$as_me: WARNING: if you want to make sure installation without --nodeps and +$as_echo "$as_me: WARNING: if you want to make sure installation without --nodeps and relocation will work, you need to patch your epm with the patch in epm/epm-3.7.patch or build with --with-epm=internal which will build a suitable epm" >&2;} @@ -12196,10 +11518,10 @@ echo "$as_me: WARNING: if you want to make sure installation without --nodeps an if echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then # Extract the first word of "pkgmk", so it can be a program name with args. set dummy pkgmk; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PKGMK+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PKGMK+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $PKGMK in [\\/]* | ?:[\\/]*) @@ -12211,33 +11533,32 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKGMK="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS test -z "$ac_cv_path_PKGMK" && ac_cv_path_PKGMK="no" ;; esac fi PKGMK=$ac_cv_path_PKGMK - if test -n "$PKGMK"; then - echo "$as_me:$LINENO: result: $PKGMK" >&5 -echo "${ECHO_T}$PKGMK" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGMK" >&5 +$as_echo "$PKGMK" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + if test "$PKGMK" = "no"; then - { { echo "$as_me:$LINENO: error: pkgmk needed for Solaris pkg creation. Install it." >&5 -echo "$as_me: error: pkgmk needed for Solaris pkg creation. Install it." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "pkgmk needed for Solaris pkg creation. Install it." "$LINENO" 5 fi fi @@ -12246,18 +11567,18 @@ echo "$as_me: error: pkgmk needed for Solaris pkg creation. Install it." >&2;} else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } EPM=NO fi # Extract the first word of "gperf", so it can be a program name with args. set dummy gperf; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_GPERF+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_GPERF+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $GPERF in [\\/]* | ?:[\\/]*) @@ -12269,82 +11590,74 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GPERF="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS ;; esac fi GPERF=$ac_cv_path_GPERF - if test -n "$GPERF"; then - echo "$as_me:$LINENO: result: $GPERF" >&5 -echo "${ECHO_T}$GPERF" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GPERF" >&5 +$as_echo "$GPERF" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + if test -z "$GPERF"; then - { { echo "$as_me:$LINENO: error: gperf not found but needed. Install it." >&5 -echo "$as_me: error: gperf not found but needed. Install it." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "gperf not found but needed. Install it." "$LINENO" 5 fi -echo "$as_me:$LINENO: checking gperf version" >&5 -echo $ECHO_N "checking gperf version... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking gperf version" >&5 +$as_echo_n "checking gperf version... " >&6; } if test "`$GPERF --version | $EGREP ^GNU\ gperf | $AWK '{ print $3 }' | cut -d. -f1`" -ge "3"; then - echo "$as_me:$LINENO: result: OK" >&5 -echo "${ECHO_T}OK" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5 +$as_echo "OK" >&6; } else - { { echo "$as_me:$LINENO: error: too old, you need at least 3.0.0" >&5 -echo "$as_me: error: too old, you need at least 3.0.0" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "too old, you need at least 3.0.0" "$LINENO" 5 fi -echo "$as_me:$LINENO: checking whether to build the ODK" >&5 -echo $ECHO_N "checking whether to build the ODK... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build the ODK" >&5 +$as_echo_n "checking whether to build the ODK... " >&6; } if test "z$enable_odk" = "z" -o "$enable_odk" != "no"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } if test "$WITH_JAVA" != "no"; then - echo "$as_me:$LINENO: checking for external/unowinreg/unowinreg.dll" >&5 -echo $ECHO_N "checking for external/unowinreg/unowinreg.dll... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for external/unowinreg/unowinreg.dll" >&5 +$as_echo_n "checking for external/unowinreg/unowinreg.dll... " >&6; } if ! test -f "./external/unowinreg/unowinreg.dll"; then HAVE_UNOWINREG_DLL=no else HAVE_UNOWINREG_DLL=yes fi if test "$HAVE_UNOWINREG_DLL" = "yes"; then - echo "$as_me:$LINENO: result: found" >&5 -echo "${ECHO_T}found" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 +$as_echo "found" >&6; } BUILD_UNOWINREG=NO else if test "$_os" = "WINNT"; then - echo "$as_me:$LINENO: result: not found, will be built" >&5 -echo "${ECHO_T}not found, will be built" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found, will be built" >&5 +$as_echo "not found, will be built" >&6; } else - { echo "$as_me:$LINENO: WARNING: not found, will be cross-built using mingw32" >&5 -echo "$as_me: WARNING: not found, will be cross-built using mingw32" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: not found, will be cross-built using mingw32" >&5 +$as_echo "$as_me: WARNING: not found, will be cross-built using mingw32" >&2;} fi BUILD_UNOWINREG=YES fi if test "$_os" != "WINNT" && test "$BUILD_UNOWINREG" = "YES"; then if test -z "$WITH_MINGWIN" || test "$WITH_MINGWIN" = "0"; then - { { echo "$as_me:$LINENO: error: for rebuilding unowinreg.dll you need the mingw32 C++ compiler. - Specify mingw32 g++ executable name with --with-mingwin. - Or use prebuilt one from http://tools.openoffice.org/unowinreg_prebuild/680/ and - put it into external/unowinreg" >&5 -echo "$as_me: error: for rebuilding unowinreg.dll you need the mingw32 C++ compiler. + as_fn_error "for rebuilding unowinreg.dll you need the mingw32 C++ compiler. Specify mingw32 g++ executable name with --with-mingwin. Or use prebuilt one from http://tools.openoffice.org/unowinreg_prebuild/680/ and - put it into external/unowinreg" >&2;} - { (exit 1); exit 1; }; } + put it into external/unowinreg" "$LINENO" 5 fi if echo "$WITH_MINGWIN" | $EGREP -q "/"; then if ! test -x "$WITH_MINGWIN"; then MINGWCXX=false; else MINGWCXX=`basename $WITH_MINGWIN`; fi @@ -12352,10 +11665,10 @@ echo "$as_me: error: for rebuilding unowinreg.dll you need the mingw32 C++ compi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}$WITH_MINGWIN", so it can be a program name with args. set dummy ${ac_tool_prefix}$WITH_MINGWIN; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_MINGWCXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_MINGWCXX+set}" = set; then : + $as_echo_n "(cached) " >&6 else if test -n "$MINGWCXX"; then ac_cv_prog_MINGWCXX="$MINGWCXX" # Let the user override the test. @@ -12365,35 +11678,37 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_MINGWCXX="${ac_tool_prefix}$WITH_MINGWIN" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS fi fi MINGWCXX=$ac_cv_prog_MINGWCXX if test -n "$MINGWCXX"; then - echo "$as_me:$LINENO: result: $MINGWCXX" >&5 -echo "${ECHO_T}$MINGWCXX" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MINGWCXX" >&5 +$as_echo "$MINGWCXX" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test -z "$ac_cv_prog_MINGWCXX"; then ac_ct_MINGWCXX=$MINGWCXX # Extract the first word of "$WITH_MINGWIN", so it can be a program name with args. set dummy $WITH_MINGWIN; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_MINGWCXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_MINGWCXX+set}" = set; then : + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MINGWCXX"; then ac_cv_prog_ac_ct_MINGWCXX="$ac_ct_MINGWCXX" # Let the user override the test. @@ -12403,47 +11718,53 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_MINGWCXX="$WITH_MINGWIN" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS - test -z "$ac_cv_prog_ac_ct_MINGWCXX" && ac_cv_prog_ac_ct_MINGWCXX="false" fi fi ac_ct_MINGWCXX=$ac_cv_prog_ac_ct_MINGWCXX if test -n "$ac_ct_MINGWCXX"; then - echo "$as_me:$LINENO: result: $ac_ct_MINGWCXX" >&5 -echo "${ECHO_T}$ac_ct_MINGWCXX" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MINGWCXX" >&5 +$as_echo "$ac_ct_MINGWCXX" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi - MINGWCXX=$ac_ct_MINGWCXX + if test "x$ac_ct_MINGWCXX" = x; then + MINGWCXX="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MINGWCXX=$ac_ct_MINGWCXX + fi else MINGWCXX="$ac_cv_prog_MINGWCXX" fi fi if test "$MINGWCXX" = "false"; then - { { echo "$as_me:$LINENO: error: specified MinGW32 C++ cross-compiler not found. Install it or correct name." >&5 -echo "$as_me: error: specified MinGW32 C++ cross-compiler not found. Install it or correct name." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "specified MinGW32 C++ cross-compiler not found. Install it or correct name." "$LINENO" 5 fi - echo "$as_me:$LINENO: checking whether we are using the MinGW32 cross C++ compiler" >&5 -echo $ECHO_N "checking whether we are using the MinGW32 cross C++ compiler... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the MinGW32 cross C++ compiler" >&5 +$as_echo_n "checking whether we are using the MinGW32 cross C++ compiler... " >&6; } if ! echo "`$MINGWCXX -dumpmachine`" | grep -q mingw32; then - { { echo "$as_me:$LINENO: error: no" >&5 -echo "$as_me: error: no" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "no" "$LINENO" 5 else - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } fi if echo "$WITH_MINGWIN" | $EGREP -q "/"; then if ! test -x "`echo $WITH_MINGWIN | $SED -e s/g++/strip/`"; then MINGSTRIP=false; else MINGWSTRIP=$(basename $(echo $WITH_MINGWIN | $SED -e s/g++/strip/)); fi @@ -12451,10 +11772,10 @@ echo "${ECHO_T}yes" >&6 if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}`echo $WITH_MINGWIN | $SED -e s/g++/strip/`", so it can be a program name with args. set dummy ${ac_tool_prefix}`echo $WITH_MINGWIN | $SED -e s/g++/strip/`; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_MINGWSTRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_MINGWSTRIP+set}" = set; then : + $as_echo_n "(cached) " >&6 else if test -n "$MINGWSTRIP"; then ac_cv_prog_MINGWSTRIP="$MINGWSTRIP" # Let the user override the test. @@ -12464,35 +11785,37 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_MINGWSTRIP="${ac_tool_prefix}`echo $WITH_MINGWIN | $SED -e s/g++/strip/`" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS fi fi MINGWSTRIP=$ac_cv_prog_MINGWSTRIP if test -n "$MINGWSTRIP"; then - echo "$as_me:$LINENO: result: $MINGWSTRIP" >&5 -echo "${ECHO_T}$MINGWSTRIP" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MINGWSTRIP" >&5 +$as_echo "$MINGWSTRIP" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test -z "$ac_cv_prog_MINGWSTRIP"; then ac_ct_MINGWSTRIP=$MINGWSTRIP # Extract the first word of "`echo $WITH_MINGWIN | $SED -e s/g++/strip/`", so it can be a program name with args. set dummy `echo $WITH_MINGWIN | $SED -e s/g++/strip/`; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_MINGWSTRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_MINGWSTRIP+set}" = set; then : + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MINGWSTRIP"; then ac_cv_prog_ac_ct_MINGWSTRIP="$ac_ct_MINGWSTRIP" # Let the user override the test. @@ -12502,39 +11825,47 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_MINGWSTRIP="`echo $WITH_MINGWIN | $SED -e s/g++/strip/`" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS - test -z "$ac_cv_prog_ac_ct_MINGWSTRIP" && ac_cv_prog_ac_ct_MINGWSTRIP="false" fi fi ac_ct_MINGWSTRIP=$ac_cv_prog_ac_ct_MINGWSTRIP if test -n "$ac_ct_MINGWSTRIP"; then - echo "$as_me:$LINENO: result: $ac_ct_MINGWSTRIP" >&5 -echo "${ECHO_T}$ac_ct_MINGWSTRIP" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MINGWSTRIP" >&5 +$as_echo "$ac_ct_MINGWSTRIP" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi - MINGWSTRIP=$ac_ct_MINGWSTRIP + if test "x$ac_ct_MINGWSTRIP" = x; then + MINGWSTRIP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MINGWSTRIP=$ac_ct_MINGWSTRIP + fi else MINGWSTRIP="$ac_cv_prog_MINGWSTRIP" fi fi if test "$MINGWSTRIP" = "false"; then - { { echo "$as_me:$LINENO: error: MinGW32 binutils needed. Install them." >&5 -echo "$as_me: error: MinGW32 binutils needed. Install them." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "MinGW32 binutils needed. Install them." "$LINENO" 5 fi - ac_ext=cc + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -12552,66 +11883,37 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # do not make sense here (and 'd make the check fail) save_LIBS=$LIBS LIBS="" - -echo "$as_me:$LINENO: checking for main in -lkernel32" >&5 -echo $ECHO_N "checking for main in -lkernel32... $ECHO_C" >&6 -if test "${ac_cv_lib_kernel32_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lkernel32" >&5 +$as_echo_n "checking for main in -lkernel32... " >&6; } +if test "${ac_cv_lib_kernel32_main+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lkernel32 $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { -main (); +return main (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_kernel32_main=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_kernel32_main=no + ac_cv_lib_kernel32_main=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_kernel32_main" >&5 -echo "${ECHO_T}$ac_cv_lib_kernel32_main" >&6 -if test $ac_cv_lib_kernel32_main = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_kernel32_main" >&5 +$as_echo "$ac_cv_lib_kernel32_main" >&6; } +if test "x$ac_cv_lib_kernel32_main" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBKERNEL32 1 _ACEOF @@ -12621,66 +11923,37 @@ _ACEOF fi ac_cv_lib_kernel32=ac_cv_lib_kernel32_main - -echo "$as_me:$LINENO: checking for main in -ladvapi32" >&5 -echo $ECHO_N "checking for main in -ladvapi32... $ECHO_C" >&6 -if test "${ac_cv_lib_advapi32_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -ladvapi32" >&5 +$as_echo_n "checking for main in -ladvapi32... " >&6; } +if test "${ac_cv_lib_advapi32_main+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ladvapi32 $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { -main (); +return main (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_advapi32_main=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_advapi32_main=no + ac_cv_lib_advapi32_main=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_advapi32_main" >&5 -echo "${ECHO_T}$ac_cv_lib_advapi32_main" >&6 -if test $ac_cv_lib_advapi32_main = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_advapi32_main" >&5 +$as_echo "$ac_cv_lib_advapi32_main" >&6; } +if test "x$ac_cv_lib_advapi32_main" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBADVAPI32 1 _ACEOF @@ -12690,149 +11963,11 @@ _ACEOF fi ac_cv_lib_advapi32=ac_cv_lib_advapi32_main - if test "${ac_cv_header_windows_h+set}" = set; then - echo "$as_me:$LINENO: checking for windows.h" >&5 -echo $ECHO_N "checking for windows.h... $ECHO_C" >&6 -if test "${ac_cv_header_windows_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_windows_h" >&5 -echo "${ECHO_T}$ac_cv_header_windows_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking windows.h usability" >&5 -echo $ECHO_N "checking windows.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking windows.h presence" >&5 -echo $ECHO_N "checking windows.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: windows.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: windows.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: windows.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: windows.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: windows.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: windows.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: windows.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: windows.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: windows.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: windows.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: windows.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: windows.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: windows.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: windows.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: windows.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: windows.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for windows.h" >&5 -echo $ECHO_N "checking for windows.h... $ECHO_C" >&6 -if test "${ac_cv_header_windows_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_windows_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_windows_h" >&5 -echo "${ECHO_T}$ac_cv_header_windows_h" >&6 + ac_fn_cxx_check_header_mongrel "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default" +if test "x$ac_cv_header_windows_h" = x""yes; then : -fi -if test $ac_cv_header_windows_h = yes; then - : else - { { echo "$as_me:$LINENO: error: windows.h missing" >&5 -echo "$as_me: error: windows.h missing" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "windows.h missing" "$LINENO" 5 fi @@ -12851,745 +11986,244 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi BUILD_TYPE="$BUILD_TYPE ODK" else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } BUILD_UNOWINREG=NO fi -echo "$as_me:$LINENO: checking whether to build qadevOOo" >&5 -echo $ECHO_N "checking whether to build qadevOOo... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build qadevOOo" >&5 +$as_echo_n "checking whether to build qadevOOo... " >&6; } if test "z$enable_qadevooo" = "z" -o "$enable_qadevooo" != "no"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } BUILD_QADEVOOO="YES" BUILD_TYPE="$BUILD_TYPE QADEVOOO" else BUILD_QADEVOOO="NO" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -if test -z "$with_system_stdlibs" -a -z "$with_system_libs"; then +if test "$_os" = "Linux" -a -z "$with_system_stdlibs" -a -z "$with_system_libs"; then if test -n "$checkforstdlibproblems"; then if test -f /etc/rpm/macros.prelink; then with_system_stdlibs=yes - { echo "$as_me:$LINENO: WARNING: prelinked libgcc_s.so.1, enabling --with-system-stdlibs, use --without-system-stdlibs to override" >&5 -echo "$as_me: WARNING: prelinked libgcc_s.so.1, enabling --with-system-stdlibs, use --without-system-stdlibs to override" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: prelinked libgcc_s.so.1, enabling --with-system-stdlibs, use --without-system-stdlibs to override" >&5 +$as_echo "$as_me: WARNING: prelinked libgcc_s.so.1, enabling --with-system-stdlibs, use --without-system-stdlibs to override" >&2;} echo "prelinked libgcc_s.so.1, enabling --with-system-stdlibs, use --without-system-stdlibs to override" >> warn elif test "$GCC" = "yes" -a ! -e `$CC -print-file-name=libgcc_s.so.1`; then with_system_stdlibs=yes - { echo "$as_me:$LINENO: WARNING: platform doesn't have a libgcc_s.so.1, enabling --with-system-stdlibs, use --without-system-stdlibs to override" >&5 -echo "$as_me: WARNING: platform doesn't have a libgcc_s.so.1, enabling --with-system-stdlibs, use --without-system-stdlibs to override" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: platform doesn't have a libgcc_s.so.1, enabling --with-system-stdlibs, use --without-system-stdlibs to override" >&5 +$as_echo "$as_me: WARNING: platform doesn't have a libgcc_s.so.1, enabling --with-system-stdlibs, use --without-system-stdlibs to override" >&2;} echo "platform doesn't have a libgcc_s.so.1, enabling --with-system-stdlibs, use --without-system-stdlibs to override" >> warn fi fi fi -echo "$as_me:$LINENO: checking whether to provide libstdc++/libgcc_s in the installset" >&5 -echo $ECHO_N "checking whether to provide libstdc++/libgcc_s in the installset... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to provide libstdc++/libgcc_s in the installset" >&5 +$as_echo_n "checking whether to provide libstdc++/libgcc_s in the installset... " >&6; } if test -n "$with_system_stdlibs" -o -n "$with_system_libs" && \ - test "$with_system_stdlibs" != "no"; then - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - SYSTEM_STDLIBS=YES -else - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - SYSTEM_STDLIBS=NO -fi - - -if test "$_os" = "Darwin" && test "$with_system_zlib" != "no"; then - with_system_zlib=yes -fi -echo "$as_me:$LINENO: checking which zlib to use" >&5 -echo $ECHO_N "checking which zlib to use... $ECHO_C" >&6 -if test -n "$with_system_zlib" -o -n "$with_system_libs" && \ - test "$with_system_zlib" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 - SYSTEM_ZLIB=YES - if test "${ac_cv_header_zlib_h+set}" = set; then - echo "$as_me:$LINENO: checking for zlib.h" >&5 -echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6 -if test "${ac_cv_header_zlib_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 -echo "${ECHO_T}$ac_cv_header_zlib_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking zlib.h usability" >&5 -echo $ECHO_N "checking zlib.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking zlib.h presence" >&5 -echo $ECHO_N "checking zlib.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: zlib.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: zlib.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: zlib.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: zlib.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: zlib.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: zlib.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: zlib.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: zlib.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: zlib.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: zlib.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for zlib.h" >&5 -echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6 -if test "${ac_cv_header_zlib_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + test "$with_system_stdlibs" != "no"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SYSTEM_STDLIBS=YES else - ac_cv_header_zlib_h=$ac_header_preproc + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SYSTEM_STDLIBS=NO fi -echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 -echo "${ECHO_T}$ac_cv_header_zlib_h" >&6 + +if test "$_os" = "Darwin" && test "$with_system_zlib" != "no"; then + with_system_zlib=yes fi -if test $ac_cv_header_zlib_h = yes; then - : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which zlib to use" >&5 +$as_echo_n "checking which zlib to use... " >&6; } +if test -n "$with_system_zlib" -o -n "$with_system_libs" && \ + test "$with_system_zlib" != "no"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 +$as_echo "external" >&6; } + SYSTEM_ZLIB=YES + ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" +if test "x$ac_cv_header_zlib_h" = x""yes; then : + else - { { echo "$as_me:$LINENO: error: zlib.h not found. install zlib" >&5 -echo "$as_me: error: zlib.h not found. install zlib" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "zlib.h not found. install zlib" "$LINENO" 5 fi - echo "$as_me:$LINENO: checking for deflate in -lz" >&5 -echo $ECHO_N "checking for deflate in -lz... $ECHO_C" >&6 -if test "${ac_cv_lib_z_deflate+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for deflate in -lz" >&5 +$as_echo_n "checking for deflate in -lz... " >&6; } +if test "${ac_cv_lib_z_deflate+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char deflate (); int main () { -deflate (); +return deflate (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_z_deflate=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_z_deflate=no + ac_cv_lib_z_deflate=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_z_deflate" >&5 -echo "${ECHO_T}$ac_cv_lib_z_deflate" >&6 -if test $ac_cv_lib_z_deflate = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_deflate" >&5 +$as_echo "$ac_cv_lib_z_deflate" >&6; } +if test "x$ac_cv_lib_z_deflate" = x""yes; then : ZLIB=-lz else - { { echo "$as_me:$LINENO: error: zlib not found or functional" >&5 -echo "$as_me: error: zlib not found or functional" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "zlib not found or functional" "$LINENO" 5 fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_ZLIB=NO BUILD_TYPE="$BUILD_TYPE ZLIB" fi -echo "$as_me:$LINENO: checking which jpeg to use" >&5 -echo $ECHO_N "checking which jpeg to use... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which jpeg to use" >&5 +$as_echo_n "checking which jpeg to use... " >&6; } if test -n "$with_system_jpeg" -o -n "$with_system_libs" && \ test "$with_system_jpeg" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_JPEG=YES - if test "${ac_cv_header_jpeglib_h+set}" = set; then - echo "$as_me:$LINENO: checking for jpeglib.h" >&5 -echo $ECHO_N "checking for jpeglib.h... $ECHO_C" >&6 -if test "${ac_cv_header_jpeglib_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_jpeglib_h" >&5 -echo "${ECHO_T}$ac_cv_header_jpeglib_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking jpeglib.h usability" >&5 -echo $ECHO_N "checking jpeglib.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + ac_fn_c_check_header_mongrel "$LINENO" "jpeglib.h" "ac_cv_header_jpeglib_h" "$ac_includes_default" +if test "x$ac_cv_header_jpeglib_h" = x""yes; then : -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking jpeglib.h presence" >&5 -echo $ECHO_N "checking jpeglib.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: jpeglib.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: jpeglib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: jpeglib.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: jpeglib.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: jpeglib.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: jpeglib.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: jpeglib.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: jpeglib.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: jpeglib.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: jpeglib.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: jpeglib.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: jpeglib.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: jpeglib.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: jpeglib.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: jpeglib.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: jpeglib.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for jpeglib.h" >&5 -echo $ECHO_N "checking for jpeglib.h... $ECHO_C" >&6 -if test "${ac_cv_header_jpeglib_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_jpeglib_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_jpeglib_h" >&5 -echo "${ECHO_T}$ac_cv_header_jpeglib_h" >&6 - -fi -if test $ac_cv_header_jpeglib_h = yes; then - : else - { { echo "$as_me:$LINENO: error: jpeg.h not found. install libjpeg" >&5 -echo "$as_me: error: jpeg.h not found. install libjpeg" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "jpeg.h not found. install libjpeg" "$LINENO" 5 fi - echo "$as_me:$LINENO: checking for jpeg_resync_to_restart in -ljpeg" >&5 -echo $ECHO_N "checking for jpeg_resync_to_restart in -ljpeg... $ECHO_C" >&6 -if test "${ac_cv_lib_jpeg_jpeg_resync_to_restart+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jpeg_resync_to_restart in -ljpeg" >&5 +$as_echo_n "checking for jpeg_resync_to_restart in -ljpeg... " >&6; } +if test "${ac_cv_lib_jpeg_jpeg_resync_to_restart+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ljpeg $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char jpeg_resync_to_restart (); int main () { -jpeg_resync_to_restart (); +return jpeg_resync_to_restart (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_jpeg_jpeg_resync_to_restart=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_jpeg_jpeg_resync_to_restart=no + ac_cv_lib_jpeg_jpeg_resync_to_restart=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_jpeg_jpeg_resync_to_restart" >&5 -echo "${ECHO_T}$ac_cv_lib_jpeg_jpeg_resync_to_restart" >&6 -if test $ac_cv_lib_jpeg_jpeg_resync_to_restart = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_jpeg_resync_to_restart" >&5 +$as_echo "$ac_cv_lib_jpeg_jpeg_resync_to_restart" >&6; } +if test "x$ac_cv_lib_jpeg_jpeg_resync_to_restart" = x""yes; then : JPEG3RDLIB=-ljpeg else - echo "$as_me:$LINENO: checking jpeg library not found or fuctional" >&5 -echo $ECHO_N "checking jpeg library not found or fuctional... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking jpeg library not found or fuctional" >&5 +$as_echo_n "checking jpeg library not found or fuctional... " >&6; } fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_JPEG=NO BUILD_TYPE="$BUILD_TYPE JPEG" fi -echo "$as_me:$LINENO: checking which expat to use" >&5 -echo $ECHO_N "checking which expat to use... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which expat to use" >&5 +$as_echo_n "checking which expat to use... " >&6; } if test -n "$with_system_expat" -o -n "$with_system_libs" && \ test "$with_system_expat" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_EXPAT=YES - if test "${ac_cv_header_expat_h+set}" = set; then - echo "$as_me:$LINENO: checking for expat.h" >&5 -echo $ECHO_N "checking for expat.h... $ECHO_C" >&6 -if test "${ac_cv_header_expat_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_expat_h" >&5 -echo "${ECHO_T}$ac_cv_header_expat_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking expat.h usability" >&5 -echo $ECHO_N "checking expat.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking expat.h presence" >&5 -echo $ECHO_N "checking expat.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: expat.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: expat.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: expat.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: expat.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: expat.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: expat.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: expat.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: expat.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: expat.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: expat.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: expat.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: expat.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: expat.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: expat.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: expat.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: expat.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for expat.h" >&5 -echo $ECHO_N "checking for expat.h... $ECHO_C" >&6 -if test "${ac_cv_header_expat_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_expat_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_expat_h" >&5 -echo "${ECHO_T}$ac_cv_header_expat_h" >&6 + ac_fn_c_check_header_mongrel "$LINENO" "expat.h" "ac_cv_header_expat_h" "$ac_includes_default" +if test "x$ac_cv_header_expat_h" = x""yes; then : -fi -if test $ac_cv_header_expat_h = yes; then - : else - { { echo "$as_me:$LINENO: error: expat.h not found. install expat" >&5 -echo "$as_me: error: expat.h not found. install expat" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "expat.h not found. install expat" "$LINENO" 5 fi - -echo "$as_me:$LINENO: checking for XML_ParserCreate in -lexpat" >&5 -echo $ECHO_N "checking for XML_ParserCreate in -lexpat... $ECHO_C" >&6 -if test "${ac_cv_lib_expat_XML_ParserCreate+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XML_ParserCreate in -lexpat" >&5 +$as_echo_n "checking for XML_ParserCreate in -lexpat... " >&6; } +if test "${ac_cv_lib_expat_XML_ParserCreate+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lexpat $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char XML_ParserCreate (); int main () { -XML_ParserCreate (); +return XML_ParserCreate (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_expat_XML_ParserCreate=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_expat_XML_ParserCreate=no + ac_cv_lib_expat_XML_ParserCreate=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_expat_XML_ParserCreate" >&5 -echo "${ECHO_T}$ac_cv_lib_expat_XML_ParserCreate" >&6 -if test $ac_cv_lib_expat_XML_ParserCreate = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_expat_XML_ParserCreate" >&5 +$as_echo "$ac_cv_lib_expat_XML_ParserCreate" >&6; } +if test "x$ac_cv_lib_expat_XML_ParserCreate" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBEXPAT 1 _ACEOF @@ -13597,24 +12231,24 @@ _ACEOF LIBS="-lexpat $LIBS" else - echo "$as_me:$LINENO: result: expat library not found or functional." >&5 -echo "${ECHO_T}expat library not found or functional." >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: expat library not found or functional." >&5 +$as_echo "expat library not found or functional." >&6; } fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_EXPAT=NO BUILD_TYPE="$BUILD_TYPE EXPAT" fi -echo "$as_me:$LINENO: checking which libwpd to use" >&5 -echo $ECHO_N "checking which libwpd to use... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which libwpd to use" >&5 +$as_echo_n "checking which libwpd to use... " >&6; } if test -n "$with_system_libwpd" -o -n "$with_system_libs" && \ test "$with_system_libwpd" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_LIBWPD=YES succeeded=no @@ -13622,10 +12256,10 @@ echo "${ECHO_T}external" >&6 if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -13637,29 +12271,30 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -13670,25 +12305,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for libwpd-0.8 " >&5 -echo $ECHO_N "checking for libwpd-0.8 ... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libwpd-0.8 " >&5 +$as_echo_n "checking for libwpd-0.8 ... " >&6; } if $PKG_CONFIG --exists "libwpd-0.8 " ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking LIBWPD_CFLAGS" >&5 -echo $ECHO_N "checking LIBWPD_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking LIBWPD_CFLAGS" >&5 +$as_echo_n "checking LIBWPD_CFLAGS... " >&6; } LIBWPD_CFLAGS=`$PKG_CONFIG --cflags "libwpd-0.8 "` - echo "$as_me:$LINENO: result: $LIBWPD_CFLAGS" >&5 -echo "${ECHO_T}$LIBWPD_CFLAGS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBWPD_CFLAGS" >&5 +$as_echo "$LIBWPD_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking LIBWPD_LIBS" >&5 -echo $ECHO_N "checking LIBWPD_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking LIBWPD_LIBS" >&5 +$as_echo_n "checking LIBWPD_LIBS... " >&6; } LIBWPD_LIBS=`$PKG_CONFIG --libs "libwpd-0.8 "` - echo "$as_me:$LINENO: result: $LIBWPD_LIBS" >&5 -echo "${ECHO_T}$LIBWPD_LIBS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBWPD_LIBS" >&5 +$as_echo "$LIBWPD_LIBS" >&6; } else LIBWPD_CFLAGS="" LIBWPD_LIBS="" @@ -13709,14 +12344,12 @@ echo "${ECHO_T}$LIBWPD_LIBS" >&6 if test $succeeded = yes; then : else - { { echo "$as_me:$LINENO: error: Library requirements (libwpd-0.8 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 -echo "$as_me: error: Library requirements (libwpd-0.8 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Library requirements (libwpd-0.8 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." "$LINENO" 5 fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_LIBWPD=NO BUILD_TYPE="$BUILD_TYPE LIBWPD" fi @@ -13725,18 +12358,18 @@ fi if test "$test_freetype" = "yes"; then - echo "$as_me:$LINENO: checking whether freetype is available" >&5 -echo $ECHO_N "checking whether freetype is available... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether freetype is available" >&5 +$as_echo_n "checking whether freetype is available... " >&6; } succeeded=no if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -13748,29 +12381,30 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -13781,25 +12415,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for freetype2 >= 2.0 " >&5 -echo $ECHO_N "checking for freetype2 >= 2.0 ... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype2 >= 2.0 " >&5 +$as_echo_n "checking for freetype2 >= 2.0 ... " >&6; } if $PKG_CONFIG --exists "freetype2 >= 2.0 " ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking FREETYPE_CFLAGS" >&5 -echo $ECHO_N "checking FREETYPE_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking FREETYPE_CFLAGS" >&5 +$as_echo_n "checking FREETYPE_CFLAGS... " >&6; } FREETYPE_CFLAGS=`$PKG_CONFIG --cflags "freetype2 >= 2.0 "` - echo "$as_me:$LINENO: result: $FREETYPE_CFLAGS" >&5 -echo "${ECHO_T}$FREETYPE_CFLAGS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_CFLAGS" >&5 +$as_echo "$FREETYPE_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking FREETYPE_LIBS" >&5 -echo $ECHO_N "checking FREETYPE_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking FREETYPE_LIBS" >&5 +$as_echo_n "checking FREETYPE_LIBS... " >&6; } FREETYPE_LIBS=`$PKG_CONFIG --libs "freetype2 >= 2.0 "` - echo "$as_me:$LINENO: result: $FREETYPE_LIBS" >&5 -echo "${ECHO_T}$FREETYPE_LIBS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_LIBS" >&5 +$as_echo "$FREETYPE_LIBS" >&6; } else FREETYPE_CFLAGS="" FREETYPE_LIBS="" @@ -13820,9 +12454,7 @@ echo "${ECHO_T}$FREETYPE_LIBS" >&6 if test $succeeded = yes; then : else - { { echo "$as_me:$LINENO: error: Library requirements (freetype2 >= 2.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 -echo "$as_me: error: Library requirements (freetype2 >= 2.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Library requirements (freetype2 >= 2.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." "$LINENO" 5 fi fi @@ -13835,71 +12467,43 @@ if test "$test_freetype" = "yes"; then save_LIBS="$LIBS" CPPFLAGS="$CPPFLAGS $FREETYPE_CFLAGS" LDFLAGS="$LDFLAGS $FREETYPE_LIBS" - echo "$as_me:$LINENO: checking for FT_GlyphSlot_Embolden in -lfreetype" >&5 -echo $ECHO_N "checking for FT_GlyphSlot_Embolden in -lfreetype... $ECHO_C" >&6 -if test "${ac_cv_lib_freetype_FT_GlyphSlot_Embolden+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FT_GlyphSlot_Embolden in -lfreetype" >&5 +$as_echo_n "checking for FT_GlyphSlot_Embolden in -lfreetype... " >&6; } +if test "${ac_cv_lib_freetype_FT_GlyphSlot_Embolden+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfreetype $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char FT_GlyphSlot_Embolden (); int main () { -FT_GlyphSlot_Embolden (); +return FT_GlyphSlot_Embolden (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_freetype_FT_GlyphSlot_Embolden=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_freetype_FT_GlyphSlot_Embolden=no + ac_cv_lib_freetype_FT_GlyphSlot_Embolden=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_freetype_FT_GlyphSlot_Embolden" >&5 -echo "${ECHO_T}$ac_cv_lib_freetype_FT_GlyphSlot_Embolden" >&6 -if test $ac_cv_lib_freetype_FT_GlyphSlot_Embolden = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_freetype_FT_GlyphSlot_Embolden" >&5 +$as_echo "$ac_cv_lib_freetype_FT_GlyphSlot_Embolden" >&6; } +if test "x$ac_cv_lib_freetype_FT_GlyphSlot_Embolden" = x""yes; then : USE_FT_EMBOLDEN="YES" else USE_FT_EMBOLDEN="NO" @@ -13932,26 +12536,26 @@ if test -n "$with_system_libxml" -o -n "$with_system_libs" && \ fi fi -echo "$as_me:$LINENO: checking which libxslt to use" >&5 -echo $ECHO_N "checking which libxslt to use... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which libxslt to use" >&5 +$as_echo_n "checking which libxslt to use... " >&6; } if test -n "$with_system_libxslt" -o -n "$with_system_libs" -o \ "$_os" = "Darwin" && \ test "$with_system_libxslt" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_LIBXSLT=YES if test "$_os" = "Darwin"; then - echo "$as_me:$LINENO: checking LIBXSLT_CFLAGS" >&5 -echo $ECHO_N "checking LIBXSLT_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking LIBXSLT_CFLAGS" >&5 +$as_echo_n "checking LIBXSLT_CFLAGS... " >&6; } LIBXSLT_CFLAGS=`xslt-config --cflags` - echo "$as_me:$LINENO: result: $LIBXSLT_CFLAGS" >&5 -echo "${ECHO_T}$LIBXSLT_CFLAGS" >&6 - echo "$as_me:$LINENO: checking LIBXSLT_LIBS" >&5 -echo $ECHO_N "checking LIBXSLT_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBXSLT_CFLAGS" >&5 +$as_echo "$LIBXSLT_CFLAGS" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking LIBXSLT_LIBS" >&5 +$as_echo_n "checking LIBXSLT_LIBS... " >&6; } LIBXSLT_LIBS=`xslt-config --libs` - echo "$as_me:$LINENO: result: $LIBXSLT_LIBS" >&5 -echo "${ECHO_T}$LIBXSLT_LIBS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBXSLT_LIBS" >&5 +$as_echo "$LIBXSLT_LIBS" >&6; } else @@ -13961,10 +12565,10 @@ echo "${ECHO_T}$LIBXSLT_LIBS" >&6 if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -13976,29 +12580,30 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -14009,25 +12614,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for libxslt" >&5 -echo $ECHO_N "checking for libxslt... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libxslt" >&5 +$as_echo_n "checking for libxslt... " >&6; } if $PKG_CONFIG --exists "libxslt" ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking LIBXSLT_CFLAGS" >&5 -echo $ECHO_N "checking LIBXSLT_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking LIBXSLT_CFLAGS" >&5 +$as_echo_n "checking LIBXSLT_CFLAGS... " >&6; } LIBXSLT_CFLAGS=`$PKG_CONFIG --cflags "libxslt"` - echo "$as_me:$LINENO: result: $LIBXSLT_CFLAGS" >&5 -echo "${ECHO_T}$LIBXSLT_CFLAGS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBXSLT_CFLAGS" >&5 +$as_echo "$LIBXSLT_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking LIBXSLT_LIBS" >&5 -echo $ECHO_N "checking LIBXSLT_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking LIBXSLT_LIBS" >&5 +$as_echo_n "checking LIBXSLT_LIBS... " >&6; } LIBXSLT_LIBS=`$PKG_CONFIG --libs "libxslt"` - echo "$as_me:$LINENO: result: $LIBXSLT_LIBS" >&5 -echo "${ECHO_T}$LIBXSLT_LIBS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBXSLT_LIBS" >&5 +$as_echo "$LIBXSLT_LIBS" >&6; } else LIBXSLT_CFLAGS="" LIBXSLT_LIBS="" @@ -14048,9 +12653,7 @@ echo "${ECHO_T}$LIBXSLT_LIBS" >&6 if test $succeeded = yes; then : else - { { echo "$as_me:$LINENO: error: Library requirements (libxslt) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 -echo "$as_me: error: Library requirements (libxslt) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Library requirements (libxslt) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." "$LINENO" 5 fi fi @@ -14058,10 +12661,10 @@ echo "$as_me: error: Library requirements (libxslt) not met; consider adjusting # Extract the first word of "xsltproc", so it can be a program name with args. set dummy xsltproc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_XSLTPROC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_XSLTPROC+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $XSLTPROC in [\\/]* | ?:[\\/]*) @@ -14073,37 +12676,36 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_XSLTPROC="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS test -z "$ac_cv_path_XSLTPROC" && ac_cv_path_XSLTPROC="no" ;; esac fi XSLTPROC=$ac_cv_path_XSLTPROC - if test -n "$XSLTPROC"; then - echo "$as_me:$LINENO: result: $XSLTPROC" >&5 -echo "${ECHO_T}$XSLTPROC" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5 +$as_echo "$XSLTPROC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + if test "$XSLTPROC" = "no"; then - { { echo "$as_me:$LINENO: error: xsltproc is required" >&5 -echo "$as_me: error: xsltproc is required" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "xsltproc is required" "$LINENO" 5 fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_LIBXSLT=NO BUILD_TYPE="$BUILD_TYPE LIBXSLT" fi @@ -14112,25 +12714,25 @@ fi -echo "$as_me:$LINENO: checking which libxml to use" >&5 -echo $ECHO_N "checking which libxml to use... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which libxml to use" >&5 +$as_echo_n "checking which libxml to use... " >&6; } if test -n "$with_system_libxml" -o -n "$with_system_libs" -o \ "$_os" = "Darwin" && \ test "$with_system_libxml" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_LIBXML=YES if test "$_os" = "Darwin"; then - echo "$as_me:$LINENO: checking LIBXML_CFLAGS" >&5 -echo $ECHO_N "checking LIBXML_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking LIBXML_CFLAGS" >&5 +$as_echo_n "checking LIBXML_CFLAGS... " >&6; } LIBXML_CFLAGS=`xml2-config --cflags` - echo "$as_me:$LINENO: result: $LIBXML_CFLAGS" >&5 -echo "${ECHO_T}$LIBXML_CFLAGS" >&6 - echo "$as_me:$LINENO: checking LIBXML_LIBS" >&5 -echo $ECHO_N "checking LIBXML_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBXML_CFLAGS" >&5 +$as_echo "$LIBXML_CFLAGS" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking LIBXML_LIBS" >&5 +$as_echo_n "checking LIBXML_LIBS... " >&6; } LIBXML_LIBS=`xml2-config --libs` - echo "$as_me:$LINENO: result: $LIBXML_LIBS" >&5 -echo "${ECHO_T}$LIBXML_LIBS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBXML_LIBS" >&5 +$as_echo "$LIBXML_LIBS" >&6; } else @@ -14140,10 +12742,10 @@ echo "${ECHO_T}$LIBXML_LIBS" >&6 if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -14155,29 +12757,30 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -14188,25 +12791,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for libxml-2.0 >= 2.0" >&5 -echo $ECHO_N "checking for libxml-2.0 >= 2.0... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libxml-2.0 >= 2.0" >&5 +$as_echo_n "checking for libxml-2.0 >= 2.0... " >&6; } if $PKG_CONFIG --exists "libxml-2.0 >= 2.0" ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking LIBXML_CFLAGS" >&5 -echo $ECHO_N "checking LIBXML_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking LIBXML_CFLAGS" >&5 +$as_echo_n "checking LIBXML_CFLAGS... " >&6; } LIBXML_CFLAGS=`$PKG_CONFIG --cflags "libxml-2.0 >= 2.0"` - echo "$as_me:$LINENO: result: $LIBXML_CFLAGS" >&5 -echo "${ECHO_T}$LIBXML_CFLAGS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBXML_CFLAGS" >&5 +$as_echo "$LIBXML_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking LIBXML_LIBS" >&5 -echo $ECHO_N "checking LIBXML_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking LIBXML_LIBS" >&5 +$as_echo_n "checking LIBXML_LIBS... " >&6; } LIBXML_LIBS=`$PKG_CONFIG --libs "libxml-2.0 >= 2.0"` - echo "$as_me:$LINENO: result: $LIBXML_LIBS" >&5 -echo "${ECHO_T}$LIBXML_LIBS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBXML_LIBS" >&5 +$as_echo "$LIBXML_LIBS" >&6; } else LIBXML_CFLAGS="" LIBXML_LIBS="" @@ -14227,17 +12830,15 @@ echo "${ECHO_T}$LIBXML_LIBS" >&6 if test $succeeded = yes; then : else - { { echo "$as_me:$LINENO: error: Library requirements (libxml-2.0 >= 2.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 -echo "$as_me: error: Library requirements (libxml-2.0 >= 2.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Library requirements (libxml-2.0 >= 2.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." "$LINENO" 5 fi fi BUILD_TYPE="$BUILD_TYPE LIBXMLSEC" else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_LIBXML=NO BUILD_TYPE="$BUILD_TYPE LIBXML2 LIBXMLSEC" fi @@ -14248,21 +12849,21 @@ fi if test "$_os" = "Darwin" && test "$with_system_python" != "no"; then with_system_python=yes fi -echo "$as_me:$LINENO: checking which python to use" >&5 -echo $ECHO_N "checking which python to use... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which python to use" >&5 +$as_echo_n "checking which python to use... " >&6; } if test -n "$with_system_python" -o -n "$with_system_libs" && \ test "$with_system_python" != "no"; then SYSTEM_PYTHON=YES - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 +$as_echo "external" >&6; } if test -n "$PYTHON"; then # If the user set $PYTHON, use it and don't search something else. - echo "$as_me:$LINENO: checking whether $PYTHON version >= 2.2" >&5 -echo $ECHO_N "checking whether $PYTHON version >= 2.2... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON version >= 2.2" >&5 +$as_echo_n "checking whether $PYTHON version >= 2.2... " >&6; } prog="import sys, string # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. @@ -14274,23 +12875,20 @@ sys.exit(sys.hexversion < minverhex)" ($PYTHON -c "$prog") >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + (exit $ac_status); }; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else - { { echo "$as_me:$LINENO: error: too old" >&5 -echo "$as_me: error: too old" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "too old" "$LINENO" 5 fi - am_display_PYTHON=$PYTHON else # Otherwise, try each interpreter until we find one that satisfies # VERSION. - echo "$as_me:$LINENO: checking for a Python interpreter with version >= 2.2" >&5 -echo $ECHO_N "checking for a Python interpreter with version >= 2.2... $ECHO_C" >&6 -if test "${am_cv_pathless_PYTHON+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a Python interpreter with version >= 2.2" >&5 +$as_echo_n "checking for a Python interpreter with version >= 2.2... " >&6; } +if test "${am_cv_pathless_PYTHON+set}" = set; then : + $as_echo_n "(cached) " >&6 else for am_cv_pathless_PYTHON in python python2 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5 none; do @@ -14306,24 +12904,23 @@ sys.exit(sys.hexversion < minverhex)" ($am_cv_pathless_PYTHON -c "$prog") >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then + (exit $ac_status); }; then : break fi - done fi -echo "$as_me:$LINENO: result: $am_cv_pathless_PYTHON" >&5 -echo "${ECHO_T}$am_cv_pathless_PYTHON" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_pathless_PYTHON" >&5 +$as_echo "$am_cv_pathless_PYTHON" >&6; } # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. if test "$am_cv_pathless_PYTHON" = none; then PYTHON=: else # Extract the first word of "$am_cv_pathless_PYTHON", so it can be a program name with args. set dummy $am_cv_pathless_PYTHON; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PYTHON+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PYTHON+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $PYTHON in [\\/]* | ?:[\\/]*) @@ -14335,49 +12932,48 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS ;; esac fi PYTHON=$ac_cv_path_PYTHON - if test -n "$PYTHON"; then - echo "$as_me:$LINENO: result: $PYTHON" >&5 -echo "${ECHO_T}$PYTHON" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 +$as_echo "$PYTHON" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi am_display_PYTHON=$am_cv_pathless_PYTHON fi if test "$PYTHON" = :; then - { { echo "$as_me:$LINENO: error: no suitable Python interpreter found" >&5 -echo "$as_me: error: no suitable Python interpreter found" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "no suitable Python interpreter found" "$LINENO" 5 else - echo "$as_me:$LINENO: checking for $am_display_PYTHON version" >&5 -echo $ECHO_N "checking for $am_display_PYTHON version... $ECHO_C" >&6 -if test "${am_cv_python_version+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5 +$as_echo_n "checking for $am_display_PYTHON version... " >&6; } +if test "${am_cv_python_version+set}" = set; then : + $as_echo_n "(cached) " >&6 else am_cv_python_version=`$PYTHON -c "import sys; print sys.version[:3]"` fi -echo "$as_me:$LINENO: result: $am_cv_python_version" >&5 -echo "${ECHO_T}$am_cv_python_version" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_version" >&5 +$as_echo "$am_cv_python_version" >&6; } PYTHON_VERSION=$am_cv_python_version @@ -14388,30 +12984,30 @@ echo "${ECHO_T}$am_cv_python_version" >&6 - echo "$as_me:$LINENO: checking for $am_display_PYTHON platform" >&5 -echo $ECHO_N "checking for $am_display_PYTHON platform... $ECHO_C" >&6 -if test "${am_cv_python_platform+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5 +$as_echo_n "checking for $am_display_PYTHON platform... " >&6; } +if test "${am_cv_python_platform+set}" = set; then : + $as_echo_n "(cached) " >&6 else am_cv_python_platform=`$PYTHON -c "import sys; print sys.platform"` fi -echo "$as_me:$LINENO: result: $am_cv_python_platform" >&5 -echo "${ECHO_T}$am_cv_python_platform" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_platform" >&5 +$as_echo "$am_cv_python_platform" >&6; } PYTHON_PLATFORM=$am_cv_python_platform - echo "$as_me:$LINENO: checking for $am_display_PYTHON script directory" >&5 -echo $ECHO_N "checking for $am_display_PYTHON script directory... $ECHO_C" >&6 -if test "${am_cv_python_pythondir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory" >&5 +$as_echo_n "checking for $am_display_PYTHON script directory... " >&6; } +if test "${am_cv_python_pythondir+set}" = set; then : + $as_echo_n "(cached) " >&6 else am_cv_python_pythondir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(0,0,prefix='$PYTHON_PREFIX')" 2>/dev/null || echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"` fi -echo "$as_me:$LINENO: result: $am_cv_python_pythondir" >&5 -echo "${ECHO_T}$am_cv_python_pythondir" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pythondir" >&5 +$as_echo "$am_cv_python_pythondir" >&6; } pythondir=$am_cv_python_pythondir @@ -14419,16 +13015,16 @@ echo "${ECHO_T}$am_cv_python_pythondir" >&6 pkgpythondir=\${pythondir}/$PACKAGE - echo "$as_me:$LINENO: checking for $am_display_PYTHON extension module directory" >&5 -echo $ECHO_N "checking for $am_display_PYTHON extension module directory... $ECHO_C" >&6 -if test "${am_cv_python_pyexecdir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory" >&5 +$as_echo_n "checking for $am_display_PYTHON extension module directory... " >&6; } +if test "${am_cv_python_pyexecdir+set}" = set; then : + $as_echo_n "(cached) " >&6 else am_cv_python_pyexecdir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(1,0,prefix='$PYTHON_EXEC_PREFIX')" 2>/dev/null || echo "${PYTHON_EXEC_PREFIX}/lib/python${PYTHON_VERSION}/site-packages"` fi -echo "$as_me:$LINENO: result: $am_cv_python_pyexecdir" >&5 -echo "${ECHO_T}$am_cv_python_pyexecdir" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pyexecdir" >&5 +$as_echo "$am_cv_python_pyexecdir" >&6; } pyexecdir=$am_cv_python_pyexecdir @@ -14453,149 +13049,11 @@ echo "${ECHO_T}$am_cv_python_pyexecdir" >&6 save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS" - if test "${ac_cv_header_Python_h+set}" = set; then - echo "$as_me:$LINENO: checking for Python.h" >&5 -echo $ECHO_N "checking for Python.h... $ECHO_C" >&6 -if test "${ac_cv_header_Python_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_Python_h" >&5 -echo "${ECHO_T}$ac_cv_header_Python_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking Python.h usability" >&5 -echo $ECHO_N "checking Python.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking Python.h presence" >&5 -echo $ECHO_N "checking Python.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: Python.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: Python.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: Python.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: Python.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: Python.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: Python.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: Python.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: Python.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: Python.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: Python.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: Python.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: Python.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: Python.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: Python.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: Python.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: Python.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for Python.h" >&5 -echo $ECHO_N "checking for Python.h... $ECHO_C" >&6 -if test "${ac_cv_header_Python_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_Python_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_Python_h" >&5 -echo "${ECHO_T}$ac_cv_header_Python_h" >&6 + ac_fn_c_check_header_mongrel "$LINENO" "Python.h" "ac_cv_header_Python_h" "$ac_includes_default" +if test "x$ac_cv_header_Python_h" = x""yes; then : -fi -if test $ac_cv_header_Python_h = yes; then - : else - { { echo "$as_me:$LINENO: error: Python headers not found" >&5 -echo "$as_me: error: Python headers not found" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Python headers not found" "$LINENO" 5 fi @@ -14603,8 +13061,8 @@ fi else SYSTEM_PYTHON=NO BUILD_TYPE="$BUILD_TYPE PYTHON" - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 +$as_echo "internal" >&6; } # Embedded python dies without Home set if test "z$HOME" = "z"; then export HOME=""; @@ -14613,10 +13071,10 @@ echo "${ECHO_T}internal" >&6 if test -z "$BZIP2"; then # Extract the first word of "bzip2", so it can be a program name with args. set dummy bzip2; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_BZIP2+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_BZIP2+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $BZIP2 in [\\/]* | ?:[\\/]*) @@ -14628,32 +13086,31 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_BZIP2="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS ;; esac fi BZIP2=$ac_cv_path_BZIP2 - if test -n "$BZIP2"; then - echo "$as_me:$LINENO: result: $BZIP2" >&5 -echo "${ECHO_T}$BZIP2" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BZIP2" >&5 +$as_echo "$BZIP2" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + if test -z "$BZIP2"; then - { { echo "$as_me:$LINENO: error: the internal Python module has a .tar.bz2. You need bzip2" >&5 -echo "$as_me: error: the internal Python module has a .tar.bz2. You need bzip2" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "the internal Python module has a .tar.bz2. You need bzip2" "$LINENO" 5 fi fi fi @@ -14663,121 +13120,27 @@ fi HOME=`echo $HOME | sed 's:\\\\:/:g'` -echo "$as_me:$LINENO: checking which db to use" >&5 -echo $ECHO_N "checking which db to use... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which db to use" >&5 +$as_echo_n "checking which db to use... " >&6; } if test -n "$with_system_db" -o -n "$with_system_libs" && \ test "$with_system_db" != "no"; then SYSTEM_DB=YES - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 - echo "$as_me:$LINENO: checking for db.h" >&5 -echo $ECHO_N "checking for db.h... $ECHO_C" >&6 -if test "${ac_cv_header_db_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - - - -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_header_db_h=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 +$as_echo "external" >&6; } + ac_fn_c_check_header_compile "$LINENO" "db.h" "ac_cv_header_db_h" " -ac_cv_header_db_h=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_header_db_h" >&5 -echo "${ECHO_T}$ac_cv_header_db_h" >&6 -if test $ac_cv_header_db_h = yes; then +" +if test "x$ac_cv_header_db_h" = x""yes; then : DB_INCLUDES=/usr/include else CFLAGS=-I/usr/include/db4 - echo "$as_me:$LINENO: checking for db4/db.h" >&5 -echo $ECHO_N "checking for db4/db.h... $ECHO_C" >&6 -if test "${ac_cv_header_db4_db_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -+ - -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_header_db4_db_h=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_header_db4_db_h=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_header_db4_db_h" >&5 -echo "${ECHO_T}$ac_cv_header_db4_db_h" >&6 -if test $ac_cv_header_db4_db_h = yes; then + ac_fn_c_check_header_compile "$LINENO" "db4/db.h" "ac_cv_header_db4_db_h" "+ +" +if test "x$ac_cv_header_db4_db_h" = x""yes; then : DB_INCLUDES=/usr/include/db4 else - { { echo "$as_me:$LINENO: error: no. install the db4 libraries" >&5 -echo "$as_me: error: no. install the db4 libraries" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "no. install the db4 libraries" "$LINENO" 5 fi @@ -14785,21 +13148,16 @@ fi fi - echo "$as_me:$LINENO: checking whether db is at least 4.1" >&5 -echo $ECHO_N "checking whether db is at least 4.1... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether db is at least 4.1" >&5 +$as_echo_n "checking whether db is at least 4.1... " >&6; } for v in `seq 1 7`; do - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot run test program while cross compiling +See \`config.log' for more details." "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -14810,99 +13168,55 @@ int main(int argc, char **argv) { } _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_run "$LINENO"; then : DB_VERSION_MINOR=$v -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi + done if test "$DB_VERSION_MINOR" -gt "1"; then - echo "$as_me:$LINENO: result: OK" >&5 -echo "${ECHO_T}OK" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5 +$as_echo "OK" >&6; } DB_VERSION=4.$DB_VERSION_MINOR else - { { echo "$as_me:$LINENO: error: no. you need at least db 4.1" >&5 -echo "$as_me: error: no. you need at least db 4.1" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "no. you need at least db 4.1" "$LINENO" 5 fi # does not work :/ #AC_CHECK_LIB(db, db_create, [], # [AC_MSG_ERROR([db library not installed or functional])], []) - -echo "$as_me:$LINENO: checking for main in -ldb" >&5 -echo $ECHO_N "checking for main in -ldb... $ECHO_C" >&6 -if test "${ac_cv_lib_db_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -ldb" >&5 +$as_echo_n "checking for main in -ldb... " >&6; } +if test "${ac_cv_lib_db_main+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldb $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { -main (); +return main (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_db_main=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_db_main=no + ac_cv_lib_db_main=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_db_main" >&5 -echo "${ECHO_T}$ac_cv_lib_db_main" >&6 -if test $ac_cv_lib_db_main = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_db_main" >&5 +$as_echo "$ac_cv_lib_db_main" >&6; } +if test "x$ac_cv_lib_db_main" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBDB 1 _ACEOF @@ -14910,16 +13224,14 @@ _ACEOF LIBS="-ldb $LIBS" else - { { echo "$as_me:$LINENO: error: db not installed or functional" >&5 -echo "$as_me: error: db not installed or functional" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "db not installed or functional" "$LINENO" 5 fi ac_cv_lib_db=ac_cv_lib_db_main SCPDEFS="$SCPDEFS -DSYSTEM_DB" else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_DB=NO BUILD_TYPE="$BUILD_TYPE BERKELEYDB" fi @@ -14928,58 +13240,52 @@ fi -echo "$as_me:$LINENO: checking which lucene to use" >&5 -echo $ECHO_N "checking which lucene to use... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which lucene to use" >&5 +$as_echo_n "checking which lucene to use... " >&6; } if test -n "$with_system_lucene" -o -n "$with_system_libs" && \ test "$with_system_lucene" != "no" && test "$with_system_jars" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_LUCENE=YES if test -z $LUCENE_CORE_JAR; then - echo "$as_me:$LINENO: checking for /usr/share/java/lucene-core-2.3.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/lucene-core-2.3.jar... $ECHO_C" >&6 -if test "${ac_cv_file__usr_share_java_lucene_core_2_3_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/lucene-core-2.3.jar" >&5 +$as_echo_n "checking for /usr/share/java/lucene-core-2.3.jar... " >&6; } +if test "${ac_cv_file__usr_share_java_lucene_core_2_3_jar+set}" = set; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "/usr/share/java/lucene-core-2.3.jar"; then ac_cv_file__usr_share_java_lucene_core_2_3_jar=yes else ac_cv_file__usr_share_java_lucene_core_2_3_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_lucene_core_2_3_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_lucene_core_2_3_jar" >&6 -if test $ac_cv_file__usr_share_java_lucene_core_2_3_jar = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_lucene_core_2_3_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_lucene_core_2_3_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_lucene_core_2_3_jar" = x""yes; then : LUCENE_CORE_JAR=/usr/share/java/lucene-core-2.3.jar else - echo "$as_me:$LINENO: checking for /usr/share/java/lucene.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/lucene.jar... $ECHO_C" >&6 -if test "${ac_cv_file__usr_share_java_lucene_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/lucene.jar" >&5 +$as_echo_n "checking for /usr/share/java/lucene.jar... " >&6; } +if test "${ac_cv_file__usr_share_java_lucene_jar+set}" = set; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "/usr/share/java/lucene.jar"; then ac_cv_file__usr_share_java_lucene_jar=yes else ac_cv_file__usr_share_java_lucene_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_lucene_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_lucene_jar" >&6 -if test $ac_cv_file__usr_share_java_lucene_jar = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_lucene_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_lucene_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_lucene_jar" = x""yes; then : LUCENE_CORE_JAR=/usr/share/java/lucene.jar else - { { echo "$as_me:$LINENO: error: lucene-core.jar replacement not found" >&5 -echo "$as_me: error: lucene-core.jar replacement not found" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "lucene-core.jar replacement not found" "$LINENO" 5 fi @@ -14988,79 +13294,71 @@ fi fi else - as_ac_File=`echo "ac_cv_file_$LUCENE_CORE_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $LUCENE_CORE_JAR" >&5 -echo $ECHO_N "checking for $LUCENE_CORE_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$LUCENE_CORE_JAR" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LUCENE_CORE_JAR" >&5 +$as_echo_n "checking for $LUCENE_CORE_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "$LUCENE_CORE_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then - : +eval ac_res=\$$as_ac_File + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +eval as_val=\$$as_ac_File + if test "x$as_val" = x""yes; then : + else - { { echo "$as_me:$LINENO: error: lucene-core.jar not found." >&5 -echo "$as_me: error: lucene-core.jar not found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "lucene-core.jar not found." "$LINENO" 5 fi fi if test -z $LUCENE_ANALYZERS_JAR; then - echo "$as_me:$LINENO: checking for /usr/share/java/lucene-analyzers-2.3.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/lucene-analyzers-2.3.jar... $ECHO_C" >&6 -if test "${ac_cv_file__usr_share_java_lucene_analyzers_2_3_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/lucene-analyzers-2.3.jar" >&5 +$as_echo_n "checking for /usr/share/java/lucene-analyzers-2.3.jar... " >&6; } +if test "${ac_cv_file__usr_share_java_lucene_analyzers_2_3_jar+set}" = set; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "/usr/share/java/lucene-analyzers-2.3.jar"; then ac_cv_file__usr_share_java_lucene_analyzers_2_3_jar=yes else ac_cv_file__usr_share_java_lucene_analyzers_2_3_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_lucene_analyzers_2_3_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_lucene_analyzers_2_3_jar" >&6 -if test $ac_cv_file__usr_share_java_lucene_analyzers_2_3_jar = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_lucene_analyzers_2_3_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_lucene_analyzers_2_3_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_lucene_analyzers_2_3_jar" = x""yes; then : LUCENE_ANALYZERS_JAR=/usr/share/java/lucene-analyzers-2.3.jar else - echo "$as_me:$LINENO: checking for /usr/share/java/lucene-contrib/lucene-analyzers.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/lucene-contrib/lucene-analyzers.jar... $ECHO_C" >&6 -if test "${ac_cv_file__usr_share_java_lucene_contrib_lucene_analyzers_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/lucene-contrib/lucene-analyzers.jar" >&5 +$as_echo_n "checking for /usr/share/java/lucene-contrib/lucene-analyzers.jar... " >&6; } +if test "${ac_cv_file__usr_share_java_lucene_contrib_lucene_analyzers_jar+set}" = set; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "/usr/share/java/lucene-contrib/lucene-analyzers.jar"; then ac_cv_file__usr_share_java_lucene_contrib_lucene_analyzers_jar=yes else ac_cv_file__usr_share_java_lucene_contrib_lucene_analyzers_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_lucene_contrib_lucene_analyzers_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_lucene_contrib_lucene_analyzers_jar" >&6 -if test $ac_cv_file__usr_share_java_lucene_contrib_lucene_analyzers_jar = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_lucene_contrib_lucene_analyzers_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_lucene_contrib_lucene_analyzers_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_lucene_contrib_lucene_analyzers_jar" = x""yes; then : LUCENE_ANALYZERS_JAR=/usr/share/java/lucene-contrib/lucene-analyzers.jar else - { { echo "$as_me:$LINENO: error: lucene-analyzers.jar replacement not found." >&5 -echo "$as_me: error: lucene-analyzers.jar replacement not found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "lucene-analyzers.jar replacement not found." "$LINENO" 5 fi @@ -15069,36 +13367,34 @@ fi fi else - as_ac_File=`echo "ac_cv_file_$LUCENE_CORE_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $LUCENE_CORE_JAR" >&5 -echo $ECHO_N "checking for $LUCENE_CORE_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$LUCENE_CORE_JAR" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LUCENE_CORE_JAR" >&5 +$as_echo_n "checking for $LUCENE_CORE_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "$LUCENE_CORE_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then - : +eval ac_res=\$$as_ac_File + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +eval as_val=\$$as_ac_File + if test "x$as_val" = x""yes; then : + else - { { echo "$as_me:$LINENO: error: lucene-analyzers.jar not found." >&5 -echo "$as_me: error: lucene-analyzers.jar not found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "lucene-analyzers.jar not found." "$LINENO" 5 fi fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_LUCENE=NO BUILD_TYPE="$BUILD_TYPE LUCENE" fi @@ -15106,44 +13402,42 @@ fi -echo "$as_me:$LINENO: checking which hsqldb to use" >&5 -echo $ECHO_N "checking which hsqldb to use... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which hsqldb to use" >&5 +$as_echo_n "checking which hsqldb to use... " >&6; } if test -n "$with_system_hsqldb" -o -n "$with_system_libs" && \ test "$with_system_hsqldb" != "no" && test "$with_system_jars" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_HSQLDB=YES if test -z $HSQLDB_JAR; then HSQLDB_JAR=/usr/share/java/hsqldb.jar fi - as_ac_File=`echo "ac_cv_file_$HSQLDB_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $HSQLDB_JAR" >&5 -echo $ECHO_N "checking for $HSQLDB_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$HSQLDB_JAR" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $HSQLDB_JAR" >&5 +$as_echo_n "checking for $HSQLDB_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "$HSQLDB_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then - : +eval ac_res=\$$as_ac_File + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +eval as_val=\$$as_ac_File + if test "x$as_val" = x""yes; then : + else - { { echo "$as_me:$LINENO: error: hsqldb.jar not found." >&5 -echo "$as_me: error: hsqldb.jar not found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "hsqldb.jar not found." "$LINENO" 5 fi - echo "$as_me:$LINENO: checking whether hsqldb is >= 1.8.0.9" >&5 -echo $ECHO_N "checking whether hsqldb is >= 1.8.0.9... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether hsqldb is >= 1.8.0.9" >&5 +$as_echo_n "checking whether hsqldb is >= 1.8.0.9... " >&6; } export HSQLDB_JAR if $PERL -e 'use Archive::Zip; my $file = "$ENV{'HSQLDB_JAR'}"; @@ -15166,61 +13460,57 @@ echo $ECHO_N "checking whether hsqldb is >= 1.8.0.9... $ECHO_C" >&6 } else { exit 1; }'; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else - { { echo "$as_me:$LINENO: error: no, hsqldb >= 1.8.0.9 is needed" >&5 -echo "$as_me: error: no, hsqldb >= 1.8.0.9 is needed" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "no, hsqldb >= 1.8.0.9 is needed" "$LINENO" 5 fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_HSQLDB=NO BUILD_TYPE="$BUILD_TYPE HSQLDB" fi -echo "$as_me:$LINENO: checking which beanshell to use" >&5 -echo $ECHO_N "checking which beanshell to use... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which beanshell to use" >&5 +$as_echo_n "checking which beanshell to use... " >&6; } if test -n "$with_system_beanshell" -o -n "$with_system_libs" && \ test "$with_system_beanshell" != "no" && test "$with_system_jars" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_BSH=YES if test -z $BSH_JAR; then BSH_JAR=/usr/share/java/bsh.jar fi - as_ac_File=`echo "ac_cv_file_$BSH_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $BSH_JAR" >&5 -echo $ECHO_N "checking for $BSH_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$BSH_JAR" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $BSH_JAR" >&5 +$as_echo_n "checking for $BSH_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "$BSH_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then - : +eval ac_res=\$$as_ac_File + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +eval as_val=\$$as_ac_File + if test "x$as_val" = x""yes; then : + else - { { echo "$as_me:$LINENO: error: bsh.jar not found." >&5 -echo "$as_me: error: bsh.jar not found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "bsh.jar not found." "$LINENO" 5 fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_BSH=NO BUILD_TYPE="$BUILD_TYPE BSH" fi @@ -15228,78 +13518,70 @@ fi -echo "$as_me:$LINENO: checking which saxon to use" >&5 -echo $ECHO_N "checking which saxon to use... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which saxon to use" >&5 +$as_echo_n "checking which saxon to use... " >&6; } if test -n "$with_system_saxon" -o -n "$with_system_libs" && \ test "$with_system_saxon" != "no" && test "$with_system_jars" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_SAXON=YES if test -z $SAXON_JAR; then - echo "$as_me:$LINENO: checking for /usr/share/java/saxon9.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/saxon9.jar... $ECHO_C" >&6 -if test "${ac_cv_file__usr_share_java_saxon9_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/saxon9.jar" >&5 +$as_echo_n "checking for /usr/share/java/saxon9.jar... " >&6; } +if test "${ac_cv_file__usr_share_java_saxon9_jar+set}" = set; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "/usr/share/java/saxon9.jar"; then ac_cv_file__usr_share_java_saxon9_jar=yes else ac_cv_file__usr_share_java_saxon9_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_saxon9_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_saxon9_jar" >&6 -if test $ac_cv_file__usr_share_java_saxon9_jar = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_saxon9_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_saxon9_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_saxon9_jar" = x""yes; then : SAXON_JAR=/usr/share/java/saxon9.jar else - echo "$as_me:$LINENO: checking for /usr/share/java/saxon.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/saxon.jar... $ECHO_C" >&6 -if test "${ac_cv_file__usr_share_java_saxon_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/saxon.jar" >&5 +$as_echo_n "checking for /usr/share/java/saxon.jar... " >&6; } +if test "${ac_cv_file__usr_share_java_saxon_jar+set}" = set; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "/usr/share/java/saxon.jar"; then ac_cv_file__usr_share_java_saxon_jar=yes else ac_cv_file__usr_share_java_saxon_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_saxon_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_saxon_jar" >&6 -if test $ac_cv_file__usr_share_java_saxon_jar = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_saxon_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_saxon_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_saxon_jar" = x""yes; then : SAXON_JAR=/usr/share/java/saxon.jar else - echo "$as_me:$LINENO: checking for /usr/share/java/saxon9.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/saxon9.jar... $ECHO_C" >&6 -if test "${ac_cv_file__usr_share_java_saxon9_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/saxon9.jar" >&5 +$as_echo_n "checking for /usr/share/java/saxon9.jar... " >&6; } +if test "${ac_cv_file__usr_share_java_saxon9_jar+set}" = set; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "/usr/share/java/saxon9.jar"; then ac_cv_file__usr_share_java_saxon9_jar=yes else ac_cv_file__usr_share_java_saxon9_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_saxon9_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_saxon9_jar" >&6 -if test $ac_cv_file__usr_share_java_saxon9_jar = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_saxon9_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_saxon9_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_saxon9_jar" = x""yes; then : SAXON_JAR=/usr/share/java/saxon9.jar else - { { echo "$as_me:$LINENO: error: saxon.jar replacement not found" >&5 -echo "$as_me: error: saxon.jar replacement not found" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "saxon.jar replacement not found" "$LINENO" 5 fi @@ -15312,65 +13594,61 @@ fi fi else - as_ac_File=`echo "ac_cv_file_$SAXON_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $SAXON_JAR" >&5 -echo $ECHO_N "checking for $SAXON_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$SAXON_JAR" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $SAXON_JAR" >&5 +$as_echo_n "checking for $SAXON_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "$SAXON_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then - : +eval ac_res=\$$as_ac_File + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +eval as_val=\$$as_ac_File + if test "x$as_val" = x""yes; then : + else - { { echo "$as_me:$LINENO: error: saxon.jar replacement not found." >&5 -echo "$as_me: error: saxon.jar replacement not found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "saxon.jar replacement not found." "$LINENO" 5 fi fi if test -n "$SERIALIZER_JAR"; then - as_ac_File=`echo "ac_cv_file_$SERIALIZER_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $SERIALIZER_JAR" >&5 -echo $ECHO_N "checking for $SERIALIZER_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$SERIALIZER_JAR" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $SERIALIZER_JAR" >&5 +$as_echo_n "checking for $SERIALIZER_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "$SERIALIZER_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then - : +eval ac_res=\$$as_ac_File + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +eval as_val=\$$as_ac_File + if test "x$as_val" = x""yes; then : + else - { { echo "$as_me:$LINENO: error: serializer.jar not found." >&5 -echo "$as_me: error: serializer.jar not found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "serializer.jar not found." "$LINENO" 5 fi fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_SAXON=NO NEED_SAXON=TRUE fi @@ -15384,20 +13662,20 @@ fi if test "$_os" = "Darwin" && test "$with_system_curl" != "no"; then with_system_curl=yes fi -echo "$as_me:$LINENO: checking which curl to use" >&5 -echo $ECHO_N "checking which curl to use... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which curl to use" >&5 +$as_echo_n "checking which curl to use... " >&6; } if test -n "$with_system_curl" -o -n "$with_system_libs" && \ test "$with_system_curl" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_CURL=YES # Extract the first word of "curl-config", so it can be a program name with args. set dummy curl-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_CURLCONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_CURLCONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $CURLCONFIG in [\\/]* | ?:[\\/]*) @@ -15409,52 +13687,49 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CURLCONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS ;; esac fi CURLCONFIG=$ac_cv_path_CURLCONFIG - if test -n "$CURLCONFIG"; then - echo "$as_me:$LINENO: result: $CURLCONFIG" >&5 -echo "${ECHO_T}$CURLCONFIG" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CURLCONFIG" >&5 +$as_echo "$CURLCONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + if test -z "$CURLCONFIG"; then - { { echo "$as_me:$LINENO: error: install curl to run this script" >&5 -echo "$as_me: error: install curl to run this script" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "install curl to run this script" "$LINENO" 5 fi # check curl version - echo "$as_me:$LINENO: checking whether curl is >= 7.9.8" >&5 -echo $ECHO_N "checking whether curl is >= 7.9.8... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether curl is >= 7.9.8" >&5 +$as_echo_n "checking whether curl is >= 7.9.8... " >&6; } if test "`$CURLCONFIG --version | $AWK -F' ' '{print $2}' | $AWK -F. '{ print $1 }'`" -gt "7" -a \ "`$CURLCONFIG --version | $AWK -F' ' '{print $2}' | $AWK -F. '{ print $2 }'`" -gt "9" -a \ "`$CURLCONFIG --version | $AWK -F' ' '{print $2}' | $AWK -F. '{ print $3 }'`" -gt "8"; then - { { echo "$as_me:$LINENO: error: no, you need at least curl 7.9,8" >&5 -echo "$as_me: error: no, you need at least curl 7.9,8" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "no, you need at least curl 7.9,8" "$LINENO" 5 else - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } fi CURL_LIBS=`$CURLCONFIG --libs` CURL_CFLAGS=`$CURLCONFIG --cflags` else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_CURL=NO BUILD_TYPE="$BUILD_TYPE CURL" fi @@ -15462,467 +13737,49 @@ fi -echo "$as_me:$LINENO: checking which boost to use" >&5 -echo $ECHO_N "checking which boost to use... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which boost to use" >&5 +$as_echo_n "checking which boost to use... " >&6; } if test -n "$with_system_boost" -o -n "$with_system_headers" && \ test "$with_system_boost" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_BOOST=YES - ac_ext=cc + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - if test "${ac_cv_header_boost_shared_ptr_hpp+set}" = set; then - echo "$as_me:$LINENO: checking for boost/shared_ptr.hpp" >&5 -echo $ECHO_N "checking for boost/shared_ptr.hpp... $ECHO_C" >&6 -if test "${ac_cv_header_boost_shared_ptr_hpp+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_boost_shared_ptr_hpp" >&5 -echo "${ECHO_T}$ac_cv_header_boost_shared_ptr_hpp" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking boost/shared_ptr.hpp usability" >&5 -echo $ECHO_N "checking boost/shared_ptr.hpp usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking boost/shared_ptr.hpp presence" >&5 -echo $ECHO_N "checking boost/shared_ptr.hpp presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: boost/shared_ptr.hpp: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: boost/shared_ptr.hpp: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: boost/shared_ptr.hpp: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: boost/shared_ptr.hpp: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: boost/shared_ptr.hpp: present but cannot be compiled" >&5 -echo "$as_me: WARNING: boost/shared_ptr.hpp: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: boost/shared_ptr.hpp: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: boost/shared_ptr.hpp: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: boost/shared_ptr.hpp: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: boost/shared_ptr.hpp: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: boost/shared_ptr.hpp: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: boost/shared_ptr.hpp: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: boost/shared_ptr.hpp: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: boost/shared_ptr.hpp: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: boost/shared_ptr.hpp: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: boost/shared_ptr.hpp: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for boost/shared_ptr.hpp" >&5 -echo $ECHO_N "checking for boost/shared_ptr.hpp... $ECHO_C" >&6 -if test "${ac_cv_header_boost_shared_ptr_hpp+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_boost_shared_ptr_hpp=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_boost_shared_ptr_hpp" >&5 -echo "${ECHO_T}$ac_cv_header_boost_shared_ptr_hpp" >&6 - -fi -if test $ac_cv_header_boost_shared_ptr_hpp = yes; then - : -else - { { echo "$as_me:$LINENO: error: boost/shared_ptr.hpp not found. install boost" >&5 -echo "$as_me: error: boost/shared_ptr.hpp not found. install boost" >&2;} - { (exit 1); exit 1; }; } -fi - + ac_fn_cxx_check_header_mongrel "$LINENO" "boost/shared_ptr.hpp" "ac_cv_header_boost_shared_ptr_hpp" "$ac_includes_default" +if test "x$ac_cv_header_boost_shared_ptr_hpp" = x""yes; then : - if test "${ac_cv_header_boost_spirit_include_classic_core_hpp+set}" = set; then - echo "$as_me:$LINENO: checking for boost/spirit/include/classic_core.hpp" >&5 -echo $ECHO_N "checking for boost/spirit/include/classic_core.hpp... $ECHO_C" >&6 -if test "${ac_cv_header_boost_spirit_include_classic_core_hpp+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_boost_spirit_include_classic_core_hpp" >&5 -echo "${ECHO_T}$ac_cv_header_boost_spirit_include_classic_core_hpp" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking boost/spirit/include/classic_core.hpp usability" >&5 -echo $ECHO_N "checking boost/spirit/include/classic_core.hpp usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking boost/spirit/include/classic_core.hpp presence" >&5 -echo $ECHO_N "checking boost/spirit/include/classic_core.hpp presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: boost/spirit/include/classic_core.hpp: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: boost/spirit/include/classic_core.hpp: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: boost/spirit/include/classic_core.hpp: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: boost/spirit/include/classic_core.hpp: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: boost/spirit/include/classic_core.hpp: present but cannot be compiled" >&5 -echo "$as_me: WARNING: boost/spirit/include/classic_core.hpp: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: boost/spirit/include/classic_core.hpp: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: boost/spirit/include/classic_core.hpp: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: boost/spirit/include/classic_core.hpp: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: boost/spirit/include/classic_core.hpp: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: boost/spirit/include/classic_core.hpp: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: boost/spirit/include/classic_core.hpp: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: boost/spirit/include/classic_core.hpp: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: boost/spirit/include/classic_core.hpp: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: boost/spirit/include/classic_core.hpp: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: boost/spirit/include/classic_core.hpp: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for boost/spirit/include/classic_core.hpp" >&5 -echo $ECHO_N "checking for boost/spirit/include/classic_core.hpp... $ECHO_C" >&6 -if test "${ac_cv_header_boost_spirit_include_classic_core_hpp+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_boost_spirit_include_classic_core_hpp=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_boost_spirit_include_classic_core_hpp" >&5 -echo "${ECHO_T}$ac_cv_header_boost_spirit_include_classic_core_hpp" >&6 - -fi -if test $ac_cv_header_boost_spirit_include_classic_core_hpp = yes; then - : else - { { echo "$as_me:$LINENO: error: boost/spirit/include/classic_core.hpp not found. install boost >= 1.38" >&5 -echo "$as_me: error: boost/spirit/include/classic_core.hpp not found. install boost >= 1.38" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "boost/shared_ptr.hpp not found. install boost" "$LINENO" 5 fi - if test "${ac_cv_header_boost_function_hpp+set}" = set; then - echo "$as_me:$LINENO: checking for boost/function.hpp" >&5 -echo $ECHO_N "checking for boost/function.hpp... $ECHO_C" >&6 -if test "${ac_cv_header_boost_function_hpp+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_boost_function_hpp" >&5 -echo "${ECHO_T}$ac_cv_header_boost_function_hpp" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking boost/function.hpp usability" >&5 -echo $ECHO_N "checking boost/function.hpp usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + ac_fn_cxx_check_header_mongrel "$LINENO" "boost/spirit/include/classic_core.hpp" "ac_cv_header_boost_spirit_include_classic_core_hpp" "$ac_includes_default" +if test "x$ac_cv_header_boost_spirit_include_classic_core_hpp" = x""yes; then : -# Is the header present? -echo "$as_me:$LINENO: checking boost/function.hpp presence" >&5 -echo $ECHO_N "checking boost/function.hpp presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag - else - ac_cpp_err= - fi else - ac_cpp_err=yes + as_fn_error "boost/spirit/include/classic_core.hpp not found. install boost >= 1.38" "$LINENO" 5 fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: boost/function.hpp: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: boost/function.hpp: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: boost/function.hpp: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: boost/function.hpp: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: boost/function.hpp: present but cannot be compiled" >&5 -echo "$as_me: WARNING: boost/function.hpp: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: boost/function.hpp: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: boost/function.hpp: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: boost/function.hpp: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: boost/function.hpp: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: boost/function.hpp: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: boost/function.hpp: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: boost/function.hpp: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: boost/function.hpp: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: boost/function.hpp: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: boost/function.hpp: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for boost/function.hpp" >&5 -echo $ECHO_N "checking for boost/function.hpp... $ECHO_C" >&6 -if test "${ac_cv_header_boost_function_hpp+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_boost_function_hpp=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_boost_function_hpp" >&5 -echo "${ECHO_T}$ac_cv_header_boost_function_hpp" >&6 + ac_fn_cxx_check_header_mongrel "$LINENO" "boost/function.hpp" "ac_cv_header_boost_function_hpp" "$ac_includes_default" +if test "x$ac_cv_header_boost_function_hpp" = x""yes; then : -fi -if test $ac_cv_header_boost_function_hpp = yes; then - : else - { { echo "$as_me:$LINENO: error: boost/function.hpp not found. install boost" >&5 -echo "$as_me: error: boost/function.hpp not found. install boost" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "boost/function.hpp not found. install boost" "$LINENO" 5 fi save_CXXFLAGS=$CXXFLAGS CXXFLAGS="$CXXFLAGS -fno-exceptions" - echo "$as_me:$LINENO: checking whether boost/function.hpp compiles with -fno-exceptions" >&5 -echo $ECHO_N "checking whether boost/function.hpp compiles with -fno-exceptions... $ECHO_C" >&6 - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether boost/function.hpp compiles with -fno-exceptions" >&5 +$as_echo_n "checking whether boost/function.hpp compiles with -fno-exceptions... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -15934,44 +13791,18 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_cxx_boost_no_exceptons_broken=no else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_cxx_boost_no_exceptons_broken=yes + ac_cv_cxx_boost_no_exceptons_broken=yes fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "$ac_cv_cxx_boost_no_exceptons_broken" = "yes"; then - { { echo "$as_me:$LINENO: error: no, see https://bugzilla.redhat.com/show_bug.cgi?id=477131" >&5 -echo "$as_me: error: no, see https://bugzilla.redhat.com/show_bug.cgi?id=477131" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "no, see https://bugzilla.redhat.com/show_bug.cgi?id=477131" "$LINENO" 5 else - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } fi CXXFLAGS=$save_CXXFLAGS ac_ext=c @@ -15981,169 +13812,31 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 +$as_echo "internal" >&6; } BUILD_TYPE="$BUILD_TYPE BOOST" SYSTEM_BOOST=NO fi -echo "$as_me:$LINENO: checking which vigra to use" >&5 -echo $ECHO_N "checking which vigra to use... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which vigra to use" >&5 +$as_echo_n "checking which vigra to use... " >&6; } if test -n "$with_system_vigra" -o -n "$with_system_headers" && \ test "$with_system_vigra" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_VIGRA=YES - ac_ext=cc + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - if test "${ac_cv_header_vigra_copyimage_hxx+set}" = set; then - echo "$as_me:$LINENO: checking for vigra/copyimage.hxx" >&5 -echo $ECHO_N "checking for vigra/copyimage.hxx... $ECHO_C" >&6 -if test "${ac_cv_header_vigra_copyimage_hxx+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_vigra_copyimage_hxx" >&5 -echo "${ECHO_T}$ac_cv_header_vigra_copyimage_hxx" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking vigra/copyimage.hxx usability" >&5 -echo $ECHO_N "checking vigra/copyimage.hxx usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking vigra/copyimage.hxx presence" >&5 -echo $ECHO_N "checking vigra/copyimage.hxx presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: vigra/copyimage.hxx: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: vigra/copyimage.hxx: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: vigra/copyimage.hxx: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: vigra/copyimage.hxx: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: vigra/copyimage.hxx: present but cannot be compiled" >&5 -echo "$as_me: WARNING: vigra/copyimage.hxx: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: vigra/copyimage.hxx: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: vigra/copyimage.hxx: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: vigra/copyimage.hxx: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: vigra/copyimage.hxx: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: vigra/copyimage.hxx: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: vigra/copyimage.hxx: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: vigra/copyimage.hxx: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: vigra/copyimage.hxx: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: vigra/copyimage.hxx: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: vigra/copyimage.hxx: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for vigra/copyimage.hxx" >&5 -echo $ECHO_N "checking for vigra/copyimage.hxx... $ECHO_C" >&6 -if test "${ac_cv_header_vigra_copyimage_hxx+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_vigra_copyimage_hxx=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_vigra_copyimage_hxx" >&5 -echo "${ECHO_T}$ac_cv_header_vigra_copyimage_hxx" >&6 + ac_fn_cxx_check_header_mongrel "$LINENO" "vigra/copyimage.hxx" "ac_cv_header_vigra_copyimage_hxx" "$ac_includes_default" +if test "x$ac_cv_header_vigra_copyimage_hxx" = x""yes; then : -fi -if test $ac_cv_header_vigra_copyimage_hxx = yes; then - : else - { { echo "$as_me:$LINENO: error: vigra/copyimage.hxx not found. install vigra" >&5 -echo "$as_me: error: vigra/copyimage.hxx not found. install vigra" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "vigra/copyimage.hxx not found. install vigra" "$LINENO" 5 fi @@ -16154,457 +13847,150 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 +$as_echo "internal" >&6; } BUILD_TYPE="$BUILD_TYPE VIGRA" SYSTEM_VIGRA=NO fi -echo "$as_me:$LINENO: checking which odbc headers to use" >&5 -echo $ECHO_N "checking which odbc headers to use... $ECHO_C" >&6 -if test -n "$with_system_odbc_headers" -o -n "$with_system_headers" && \ - test "$with_system_odbc_headers" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 - SYSTEM_ODBC_HEADERS=YES - - if test "${ac_cv_header_sqlext_h+set}" = set; then - echo "$as_me:$LINENO: checking for sqlext.h" >&5 -echo $ECHO_N "checking for sqlext.h... $ECHO_C" >&6 -if test "${ac_cv_header_sqlext_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_sqlext_h" >&5 -echo "${ECHO_T}$ac_cv_header_sqlext_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking sqlext.h usability" >&5 -echo $ECHO_N "checking sqlext.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking sqlext.h presence" >&5 -echo $ECHO_N "checking sqlext.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: sqlext.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: sqlext.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: sqlext.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: sqlext.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: sqlext.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: sqlext.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: sqlext.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: sqlext.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: sqlext.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: sqlext.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: sqlext.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: sqlext.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: sqlext.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: sqlext.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: sqlext.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: sqlext.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for sqlext.h" >&5 -echo $ECHO_N "checking for sqlext.h... $ECHO_C" >&6 -if test "${ac_cv_header_sqlext_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_sqlext_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_sqlext_h" >&5 -echo "${ECHO_T}$ac_cv_header_sqlext_h" >&6 - -fi -if test $ac_cv_header_sqlext_h = yes; then - : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which odbc headers to use" >&5 +$as_echo_n "checking which odbc headers to use... " >&6; } +if test -n "$with_system_odbc_headers" -o -n "$with_system_headers" && \ + test "$with_system_odbc_headers" != "no"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 +$as_echo "external" >&6; } + SYSTEM_ODBC_HEADERS=YES + + ac_fn_c_check_header_mongrel "$LINENO" "sqlext.h" "ac_cv_header_sqlext_h" "$ac_includes_default" +if test "x$ac_cv_header_sqlext_h" = x""yes; then : + else - { { echo "$as_me:$LINENO: error: odbc not found. install odbc" >&5 -echo "$as_me: error: odbc not found. install odbc" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "odbc not found. install odbc" "$LINENO" 5 fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_ODBC_HEADERS=NO BUILD_TYPE="$BUILD_TYPE UNIXODBC" fi -echo "$as_me:$LINENO: checking whether to enable build of Mozilla/Mozilla NSS-using components" >&5 -echo $ECHO_N "checking whether to enable build of Mozilla/Mozilla NSS-using components... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable build of Mozilla/Mozilla NSS-using components" >&5 +$as_echo_n "checking whether to enable build of Mozilla/Mozilla NSS-using components... " >&6; } if test "$enable_mozilla" = "no"; then - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } WITH_MOZILLA=NO ENABLE_NSS_MODULE=NO else - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } WITH_MOZILLA=YES fi -echo "$as_me:$LINENO: checking whether to build Mozilla addressbook connectivity" >&5 -echo $ECHO_N "checking whether to build Mozilla addressbook connectivity... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build Mozilla addressbook connectivity" >&5 +$as_echo_n "checking whether to build Mozilla addressbook connectivity... " >&6; } if test "$enable_mozilla" = "no"; then - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } elif test "$with_system_mozilla" = "yes"; then - echo "$as_me:$LINENO: result: no, not possible with system-mozilla" >&5 -echo "${ECHO_T}no, not possible with system-mozilla" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, not possible with system-mozilla" >&5 +$as_echo "no, not possible with system-mozilla" >&6; } else - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } fi -echo "$as_me:$LINENO: checking whether to build XML Security support" >&5 -echo $ECHO_N "checking whether to build XML Security support... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build XML Security support" >&5 +$as_echo_n "checking whether to build XML Security support... " >&6; } if test "$enable_mozilla" = "no"; then - echo "$as_me:$LINENO: result: no, since Mozilla (NSS) disabled but needed" >&5 -echo "${ECHO_T}no, since Mozilla (NSS) disabled but needed" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, since Mozilla (NSS) disabled but needed" >&5 +$as_echo "no, since Mozilla (NSS) disabled but needed" >&6; } else - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } fi -echo "$as_me:$LINENO: checking whether to build LDAP configuration backend" >&5 -echo $ECHO_N "checking whether to build LDAP configuration backend... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build LDAP configuration backend" >&5 +$as_echo_n "checking whether to build LDAP configuration backend... " >&6; } if test -z "$enable_ldap" || test "$enable_ldap" = "yes"; then if test "$enable_mozilla" = "yes" || test "$with_openldap" = "yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } WITH_LDAP=YES else - echo "$as_me:$LINENO: result: no. Either Mozilla or OpenLDAP needed" >&5 -echo "${ECHO_T}no. Either Mozilla or OpenLDAP needed" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no. Either Mozilla or OpenLDAP needed" >&5 +$as_echo "no. Either Mozilla or OpenLDAP needed" >&6; } WITH_LDAP=NO fi else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } WITH_LDAP=NO fi if test "$WITH_LDAP" = "YES"; then - echo "$as_me:$LINENO: checking which LDAP SDK to use" >&5 -echo $ECHO_N "checking which LDAP SDK to use... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking which LDAP SDK to use" >&5 +$as_echo_n "checking which LDAP SDK to use... " >&6; } if test -n "$with_openldap" && test "$with_openldap" != "no"; then - echo "$as_me:$LINENO: result: OpenLDAP" >&5 -echo "${ECHO_T}OpenLDAP" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: OpenLDAP" >&5 +$as_echo "OpenLDAP" >&6; } WITH_OPENLDAP=YES - -for ac_header in ldap.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then + for ac_header in ldap.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "ldap.h" "ac_cv_header_ldap_h" "$ac_includes_default" +if test "x$ac_cv_header_ldap_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_LDAP_H 1 _ACEOF else - { { echo "$as_me:$LINENO: error: ldap.h not found. install openldap libs" >&5 -echo "$as_me: error: ldap.h not found. install openldap libs" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "ldap.h not found. install openldap libs" "$LINENO" 5 fi done - -echo "$as_me:$LINENO: checking for ldap_simple_bind_s in -lldap" >&5 -echo $ECHO_N "checking for ldap_simple_bind_s in -lldap... $ECHO_C" >&6 -if test "${ac_cv_lib_ldap_ldap_simple_bind_s+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_simple_bind_s in -lldap" >&5 +$as_echo_n "checking for ldap_simple_bind_s in -lldap... " >&6; } +if test "${ac_cv_lib_ldap_ldap_simple_bind_s+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lldap $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char ldap_simple_bind_s (); int main () { -ldap_simple_bind_s (); +return ldap_simple_bind_s (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ldap_ldap_simple_bind_s=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_ldap_ldap_simple_bind_s=no + ac_cv_lib_ldap_ldap_simple_bind_s=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_ldap_ldap_simple_bind_s" >&5 -echo "${ECHO_T}$ac_cv_lib_ldap_ldap_simple_bind_s" >&6 -if test $ac_cv_lib_ldap_ldap_simple_bind_s = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_ldap_simple_bind_s" >&5 +$as_echo "$ac_cv_lib_ldap_ldap_simple_bind_s" >&6; } +if test "x$ac_cv_lib_ldap_ldap_simple_bind_s" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBLDAP 1 _ACEOF @@ -16612,79 +13998,48 @@ _ACEOF LIBS="-lldap $LIBS" else - { { echo "$as_me:$LINENO: error: openldap lib not found or functional" >&5 -echo "$as_me: error: openldap lib not found or functional" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "openldap lib not found or functional" "$LINENO" 5 fi # rumours say that OpenLDAP doesn't have that function. I looked and # it has it. Test for it to be sure - -echo "$as_me:$LINENO: checking for ldap_set_option in -lldap" >&5 -echo $ECHO_N "checking for ldap_set_option in -lldap... $ECHO_C" >&6 -if test "${ac_cv_lib_ldap_ldap_set_option+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_set_option in -lldap" >&5 +$as_echo_n "checking for ldap_set_option in -lldap... " >&6; } +if test "${ac_cv_lib_ldap_ldap_set_option+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lldap $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char ldap_set_option (); int main () { -ldap_set_option (); +return ldap_set_option (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ldap_ldap_set_option=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_ldap_ldap_set_option=no + ac_cv_lib_ldap_ldap_set_option=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_ldap_ldap_set_option" >&5 -echo "${ECHO_T}$ac_cv_lib_ldap_ldap_set_option" >&6 -if test $ac_cv_lib_ldap_ldap_set_option = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_ldap_set_option" >&5 +$as_echo "$ac_cv_lib_ldap_ldap_set_option" >&6; } +if test "x$ac_cv_lib_ldap_ldap_set_option" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBLDAP 1 _ACEOF @@ -16692,14 +14047,12 @@ _ACEOF LIBS="-lldap $LIBS" else - { { echo "$as_me:$LINENO: error: openldap lib not found or functional" >&5 -echo "$as_me: error: openldap lib not found or functional" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "openldap lib not found or functional" "$LINENO" 5 fi else - echo "$as_me:$LINENO: result: Netscape/Mozilla" >&5 -echo "${ECHO_T}Netscape/Mozilla" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Netscape/Mozilla" >&5 +$as_echo "Netscape/Mozilla" >&6; } # TODO. Actually do a sanity check and check for # LDAP_OPT_SIZELIMIT and LDAP_X_OPT_CONNECT_TIMEOUT WITH_OPENLDAP=NO @@ -16708,16 +14061,16 @@ fi -echo "$as_me:$LINENO: checking which mozilla to use" >&5 -echo $ECHO_N "checking which mozilla to use... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which mozilla to use" >&5 +$as_echo_n "checking which mozilla to use... " >&6; } if test -n "$with_system_mozilla" && test "$with_system_mozilla" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_MOZILLA=YES ENABLE_NSS_MODULE=NO enable_nss_module=no - echo "$as_me:$LINENO: checking which Mozilla flavour to use" >&5 -echo $ECHO_N "checking which Mozilla flavour to use... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking which Mozilla flavour to use" >&5 +$as_echo_n "checking which Mozilla flavour to use... " >&6; } if test -n "$with_system_mozilla" && test "$with_system_mozilla" = "libxul"; then MOZ_FLAVOUR=libxul elif test -n "$with_system_mozilla" && test "$with_system_mozilla" = "xulrunner"; then @@ -16732,8 +14085,8 @@ echo $ECHO_N "checking which Mozilla flavour to use... $ECHO_C" >&6 MOZ_FLAVOUR=libxul fi tmp=`echo $MOZ_FLAVOUR | $PERL -e 'print ucfirst();'` - echo "$as_me:$LINENO: result: $tmp" >&5 -echo "${ECHO_T}$tmp" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tmp" >&5 +$as_echo "$tmp" >&6; } succeeded=no @@ -16741,10 +14094,10 @@ echo "${ECHO_T}$tmp" >&6 if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -16756,29 +14109,30 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -16789,25 +14143,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for nss" >&5 -echo $ECHO_N "checking for nss... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nss" >&5 +$as_echo_n "checking for nss... " >&6; } if $PKG_CONFIG --exists "nss" ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking MOZ_NSS_CFLAGS" >&5 -echo $ECHO_N "checking MOZ_NSS_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZ_NSS_CFLAGS" >&5 +$as_echo_n "checking MOZ_NSS_CFLAGS... " >&6; } MOZ_NSS_CFLAGS=`$PKG_CONFIG --cflags "nss"` - echo "$as_me:$LINENO: result: $MOZ_NSS_CFLAGS" >&5 -echo "${ECHO_T}$MOZ_NSS_CFLAGS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZ_NSS_CFLAGS" >&5 +$as_echo "$MOZ_NSS_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking MOZ_NSS_LIBS" >&5 -echo $ECHO_N "checking MOZ_NSS_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZ_NSS_LIBS" >&5 +$as_echo_n "checking MOZ_NSS_LIBS... " >&6; } MOZ_NSS_LIBS=`$PKG_CONFIG --libs "nss"` - echo "$as_me:$LINENO: result: $MOZ_NSS_LIBS" >&5 -echo "${ECHO_T}$MOZ_NSS_LIBS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZ_NSS_LIBS" >&5 +$as_echo "$MOZ_NSS_LIBS" >&6; } else MOZ_NSS_CFLAGS="" MOZ_NSS_LIBS="" @@ -16838,10 +14192,10 @@ echo "${ECHO_T}$MOZ_NSS_LIBS" >&6 if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -16853,29 +14207,30 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -16886,25 +14241,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for $MOZ_FLAVOUR-nss " >&5 -echo $ECHO_N "checking for $MOZ_FLAVOUR-nss ... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $MOZ_FLAVOUR-nss " >&5 +$as_echo_n "checking for $MOZ_FLAVOUR-nss ... " >&6; } if $PKG_CONFIG --exists "$MOZ_FLAVOUR-nss " ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking MOZ_NSS_CFLAGS" >&5 -echo $ECHO_N "checking MOZ_NSS_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZ_NSS_CFLAGS" >&5 +$as_echo_n "checking MOZ_NSS_CFLAGS... " >&6; } MOZ_NSS_CFLAGS=`$PKG_CONFIG --cflags "$MOZ_FLAVOUR-nss "` - echo "$as_me:$LINENO: result: $MOZ_NSS_CFLAGS" >&5 -echo "${ECHO_T}$MOZ_NSS_CFLAGS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZ_NSS_CFLAGS" >&5 +$as_echo "$MOZ_NSS_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking MOZ_NSS_LIBS" >&5 -echo $ECHO_N "checking MOZ_NSS_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZ_NSS_LIBS" >&5 +$as_echo_n "checking MOZ_NSS_LIBS... " >&6; } MOZ_NSS_LIBS=`$PKG_CONFIG --libs "$MOZ_FLAVOUR-nss "` - echo "$as_me:$LINENO: result: $MOZ_NSS_LIBS" >&5 -echo "${ECHO_T}$MOZ_NSS_LIBS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZ_NSS_LIBS" >&5 +$as_echo "$MOZ_NSS_LIBS" >&6; } else MOZ_NSS_CFLAGS="" MOZ_NSS_LIBS="" @@ -16925,9 +14280,7 @@ echo "${ECHO_T}$MOZ_NSS_LIBS" >&6 if test $succeeded = yes; then : else - { { echo "$as_me:$LINENO: error: Library requirements ($MOZ_FLAVOUR-nss ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 -echo "$as_me: error: Library requirements ($MOZ_FLAVOUR-nss ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Library requirements ($MOZ_FLAVOUR-nss ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." "$LINENO" 5 fi else @@ -16942,10 +14295,10 @@ echo "$as_me: error: Library requirements ($MOZ_FLAVOUR-nss ) not met; consider if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -16957,29 +14310,30 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -16990,25 +14344,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for nspr " >&5 -echo $ECHO_N "checking for nspr ... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nspr " >&5 +$as_echo_n "checking for nspr ... " >&6; } if $PKG_CONFIG --exists "nspr " ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking MOZ_NSPR_CFLAGS" >&5 -echo $ECHO_N "checking MOZ_NSPR_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZ_NSPR_CFLAGS" >&5 +$as_echo_n "checking MOZ_NSPR_CFLAGS... " >&6; } MOZ_NSPR_CFLAGS=`$PKG_CONFIG --cflags "nspr "` - echo "$as_me:$LINENO: result: $MOZ_NSPR_CFLAGS" >&5 -echo "${ECHO_T}$MOZ_NSPR_CFLAGS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZ_NSPR_CFLAGS" >&5 +$as_echo "$MOZ_NSPR_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking MOZ_NSPR_LIBS" >&5 -echo $ECHO_N "checking MOZ_NSPR_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZ_NSPR_LIBS" >&5 +$as_echo_n "checking MOZ_NSPR_LIBS... " >&6; } MOZ_NSPR_LIBS=`$PKG_CONFIG --libs "nspr "` - echo "$as_me:$LINENO: result: $MOZ_NSPR_LIBS" >&5 -echo "${ECHO_T}$MOZ_NSPR_LIBS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZ_NSPR_LIBS" >&5 +$as_echo "$MOZ_NSPR_LIBS" >&6; } else MOZ_NSPR_CFLAGS="" MOZ_NSPR_LIBS="" @@ -17029,9 +14383,7 @@ echo "${ECHO_T}$MOZ_NSPR_LIBS" >&6 if test $succeeded = yes; then : else - { { echo "$as_me:$LINENO: error: Library requirements (nspr ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 -echo "$as_me: error: Library requirements (nspr ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Library requirements (nspr ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." "$LINENO" 5 fi NSPR_LIB="-L`$PKG_CONFIG --variable=libdir nspr`" @@ -17043,10 +14395,10 @@ echo "$as_me: error: Library requirements (nspr ) not met; consider adjusting th if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -17058,29 +14410,30 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -17091,25 +14444,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for $MOZ_FLAVOUR-nspr " >&5 -echo $ECHO_N "checking for $MOZ_FLAVOUR-nspr ... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $MOZ_FLAVOUR-nspr " >&5 +$as_echo_n "checking for $MOZ_FLAVOUR-nspr ... " >&6; } if $PKG_CONFIG --exists "$MOZ_FLAVOUR-nspr " ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking MOZ_NSPR_CFLAGS" >&5 -echo $ECHO_N "checking MOZ_NSPR_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZ_NSPR_CFLAGS" >&5 +$as_echo_n "checking MOZ_NSPR_CFLAGS... " >&6; } MOZ_NSPR_CFLAGS=`$PKG_CONFIG --cflags "$MOZ_FLAVOUR-nspr "` - echo "$as_me:$LINENO: result: $MOZ_NSPR_CFLAGS" >&5 -echo "${ECHO_T}$MOZ_NSPR_CFLAGS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZ_NSPR_CFLAGS" >&5 +$as_echo "$MOZ_NSPR_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking MOZ_NSPR_LIBS" >&5 -echo $ECHO_N "checking MOZ_NSPR_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZ_NSPR_LIBS" >&5 +$as_echo_n "checking MOZ_NSPR_LIBS... " >&6; } MOZ_NSPR_LIBS=`$PKG_CONFIG --libs "$MOZ_FLAVOUR-nspr "` - echo "$as_me:$LINENO: result: $MOZ_NSPR_LIBS" >&5 -echo "${ECHO_T}$MOZ_NSPR_LIBS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZ_NSPR_LIBS" >&5 +$as_echo "$MOZ_NSPR_LIBS" >&6; } else MOZ_NSPR_CFLAGS="" MOZ_NSPR_LIBS="" @@ -17130,9 +14483,7 @@ echo "${ECHO_T}$MOZ_NSPR_LIBS" >&6 if test $succeeded = yes; then : else - { { echo "$as_me:$LINENO: error: Library requirements ($MOZ_FLAVOUR-nspr ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 -echo "$as_me: error: Library requirements ($MOZ_FLAVOUR-nspr ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Library requirements ($MOZ_FLAVOUR-nspr ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." "$LINENO" 5 fi fi @@ -17144,10 +14495,10 @@ echo "$as_me: error: Library requirements ($MOZ_FLAVOUR-nspr ) not met; consider if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -17159,29 +14510,30 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -17192,25 +14544,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for $MOZ_FLAVOUR-xpcom" >&5 -echo $ECHO_N "checking for $MOZ_FLAVOUR-xpcom... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $MOZ_FLAVOUR-xpcom" >&5 +$as_echo_n "checking for $MOZ_FLAVOUR-xpcom... " >&6; } if $PKG_CONFIG --exists "$MOZ_FLAVOUR-xpcom" ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking MOZILLAXPCOM_CFLAGS" >&5 -echo $ECHO_N "checking MOZILLAXPCOM_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZILLAXPCOM_CFLAGS" >&5 +$as_echo_n "checking MOZILLAXPCOM_CFLAGS... " >&6; } MOZILLAXPCOM_CFLAGS=`$PKG_CONFIG --cflags "$MOZ_FLAVOUR-xpcom"` - echo "$as_me:$LINENO: result: $MOZILLAXPCOM_CFLAGS" >&5 -echo "${ECHO_T}$MOZILLAXPCOM_CFLAGS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZILLAXPCOM_CFLAGS" >&5 +$as_echo "$MOZILLAXPCOM_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking MOZILLAXPCOM_LIBS" >&5 -echo $ECHO_N "checking MOZILLAXPCOM_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZILLAXPCOM_LIBS" >&5 +$as_echo_n "checking MOZILLAXPCOM_LIBS... " >&6; } MOZILLAXPCOM_LIBS=`$PKG_CONFIG --libs "$MOZ_FLAVOUR-xpcom"` - echo "$as_me:$LINENO: result: $MOZILLAXPCOM_LIBS" >&5 -echo "${ECHO_T}$MOZILLAXPCOM_LIBS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZILLAXPCOM_LIBS" >&5 +$as_echo "$MOZILLAXPCOM_LIBS" >&6; } else MOZILLAXPCOM_CFLAGS="" MOZILLAXPCOM_LIBS="" @@ -17245,10 +14597,10 @@ echo "${ECHO_T}$MOZILLAXPCOM_LIBS" >&6 if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -17260,29 +14612,30 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -17293,25 +14646,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for libxul " >&5 -echo $ECHO_N "checking for libxul ... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libxul " >&5 +$as_echo_n "checking for libxul ... " >&6; } if $PKG_CONFIG --exists "libxul " ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking MOZILLAXPCOM_CFLAGS" >&5 -echo $ECHO_N "checking MOZILLAXPCOM_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZILLAXPCOM_CFLAGS" >&5 +$as_echo_n "checking MOZILLAXPCOM_CFLAGS... " >&6; } MOZILLAXPCOM_CFLAGS=`$PKG_CONFIG --cflags "libxul "` - echo "$as_me:$LINENO: result: $MOZILLAXPCOM_CFLAGS" >&5 -echo "${ECHO_T}$MOZILLAXPCOM_CFLAGS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZILLAXPCOM_CFLAGS" >&5 +$as_echo "$MOZILLAXPCOM_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking MOZILLAXPCOM_LIBS" >&5 -echo $ECHO_N "checking MOZILLAXPCOM_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZILLAXPCOM_LIBS" >&5 +$as_echo_n "checking MOZILLAXPCOM_LIBS... " >&6; } MOZILLAXPCOM_LIBS=`$PKG_CONFIG --libs "libxul "` - echo "$as_me:$LINENO: result: $MOZILLAXPCOM_LIBS" >&5 -echo "${ECHO_T}$MOZILLAXPCOM_LIBS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZILLAXPCOM_LIBS" >&5 +$as_echo "$MOZILLAXPCOM_LIBS" >&6; } else MOZILLAXPCOM_CFLAGS="" MOZILLAXPCOM_LIBS="" @@ -17332,9 +14685,7 @@ echo "${ECHO_T}$MOZILLAXPCOM_LIBS" >&6 if test $succeeded = yes; then : else - { { echo "$as_me:$LINENO: error: Library requirements (libxul ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 -echo "$as_me: error: Library requirements (libxul ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Library requirements (libxul ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." "$LINENO" 5 fi MOZ_INC=`$PKG_CONFIG --variable=includedir libxul` @@ -17352,72 +14703,43 @@ echo "$as_me: error: Library requirements (libxul ) not met; consider adjusting save_LIBS="$LIBS" CPPFLAGS="$CPPFLAGS $MOZ_NSS_CFLAGS" LDFLAGS="$LDFLAGS $MOZ_NSS_LIBS" - -echo "$as_me:$LINENO: checking for PK11_GetCertFromPrivateKey in -lnss3" >&5 -echo $ECHO_N "checking for PK11_GetCertFromPrivateKey in -lnss3... $ECHO_C" >&6 -if test "${ac_cv_lib_nss3_PK11_GetCertFromPrivateKey+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PK11_GetCertFromPrivateKey in -lnss3" >&5 +$as_echo_n "checking for PK11_GetCertFromPrivateKey in -lnss3... " >&6; } +if test "${ac_cv_lib_nss3_PK11_GetCertFromPrivateKey+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnss3 $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char PK11_GetCertFromPrivateKey (); int main () { -PK11_GetCertFromPrivateKey (); +return PK11_GetCertFromPrivateKey (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_nss3_PK11_GetCertFromPrivateKey=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_nss3_PK11_GetCertFromPrivateKey=no + ac_cv_lib_nss3_PK11_GetCertFromPrivateKey=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_nss3_PK11_GetCertFromPrivateKey" >&5 -echo "${ECHO_T}$ac_cv_lib_nss3_PK11_GetCertFromPrivateKey" >&6 -if test $ac_cv_lib_nss3_PK11_GetCertFromPrivateKey = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nss3_PK11_GetCertFromPrivateKey" >&5 +$as_echo "$ac_cv_lib_nss3_PK11_GetCertFromPrivateKey" >&6; } +if test "x$ac_cv_lib_nss3_PK11_GetCertFromPrivateKey" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBNSS3 1 _ACEOF @@ -17425,13 +14747,9 @@ _ACEOF LIBS="-lnss3 $LIBS" else - { { echo "$as_me:$LINENO: error: PK11_GetCertFromPrivateKey missing but needed. + as_fn_error "PK11_GetCertFromPrivateKey missing but needed. See https://bugzilla.mozilla.org/show_bug.cgi?id=262274. -Fixed since nss 3.9.3 (contained by e.g. mozilla >= 1.7.5)" >&5 -echo "$as_me: error: PK11_GetCertFromPrivateKey missing but needed. -See https://bugzilla.mozilla.org/show_bug.cgi?id=262274. -Fixed since nss 3.9.3 (contained by e.g. mozilla >= 1.7.5)" >&2;} - { (exit 1); exit 1; }; } +Fixed since nss 3.9.3 (contained by e.g. mozilla >= 1.7.5)" "$LINENO" 5 fi LDFLAGS="$save_LDFLAGS" @@ -17440,20 +14758,16 @@ fi MOZ_LIB_XPCOM=$MOZILLAXPCOM_LIBS if test "$WITH_LDAP" != "NO" && test "$WITH_OPENLDAP" != "YES"; then - echo "$as_me:$LINENO: checking whether $tmp was compiled with --enable-ldap" >&5 -echo $ECHO_N "checking whether $tmp was compiled with --enable-ldap... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $tmp was compiled with --enable-ldap" >&5 +$as_echo_n "checking whether $tmp was compiled with --enable-ldap... " >&6; } if test -d "$MOZ_INC/ldap"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } MOZ_LDAP_CFLAGS="-I$MOZ_INC" else - { { echo "$as_me:$LINENO: error: no. -Could not find LDAP header include files in $MOZ_INC/ldap. -Please recompile $tmp with --enable-ldap or use --with-openldap." >&5 -echo "$as_me: error: no. + as_fn_error "no. Could not find LDAP header include files in $MOZ_INC/ldap. -Please recompile $tmp with --enable-ldap or use --with-openldap." >&2;} - { (exit 1); exit 1; }; } +Please recompile $tmp with --enable-ldap or use --with-openldap." "$LINENO" 5 fi fi @@ -17464,48 +14778,48 @@ Please recompile $tmp with --enable-ldap or use --with-openldap." >&2;} fi elif test "$enable_mozilla" = "no"; then - echo "$as_me:$LINENO: result: none" >&5 -echo "${ECHO_T}none" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } WITH_MOZILLA=NO ENABLE_NSS_MODULE=NO enable_nss_module=no else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_MOZILLA=NO BUILD_TYPE="$BUILD_TYPE MOZ" if test -z "$with_mozilla_version"; then MOZILLA_VERSION= else - echo "$as_me:$LINENO: checking which mozilla version to build" >&5 -echo $ECHO_N "checking which mozilla version to build... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking which mozilla version to build" >&5 +$as_echo_n "checking which mozilla version to build... " >&6; } MOZILLA_VERSION=$with_mozilla_version enable_build_mozilla=1 - echo "$as_me:$LINENO: result: $MOZILLA_VERSION" >&5 -echo "${ECHO_T}$MOZILLA_VERSION" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZILLA_VERSION" >&5 +$as_echo "$MOZILLA_VERSION" >&6; } fi -echo "$as_me:$LINENO: checking for toolkit mozilla should use" >&5 -echo $ECHO_N "checking for toolkit mozilla should use... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for toolkit mozilla should use" >&5 +$as_echo_n "checking for toolkit mozilla should use... " >&6; } if test -z "$with_mozilla_toolkit"; then if test "$_os" != "WINNT" ; then if test "$_os" = "Darwin" ; then MOZILLA_TOOLKIT=mac - echo "$as_me:$LINENO: result: mac" >&5 -echo "${ECHO_T}mac" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: mac" >&5 +$as_echo "mac" >&6; } else MOZILLA_TOOLKIT=gtk2 - echo "$as_me:$LINENO: result: gtk2" >&5 -echo "${ECHO_T}gtk2" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: gtk2" >&5 +$as_echo "gtk2" >&6; } fi fi else MOZILLA_TOOLKIT=$with_mozilla_toolkit enable_build_mozilla=1 - echo "$as_me:$LINENO: result: $MOZILLA_TOOLKIT" >&5 -echo "${ECHO_T}$MOZILLA_TOOLKIT" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZILLA_TOOLKIT" >&5 +$as_echo "$MOZILLA_TOOLKIT" >&6; } fi #if test "$_os" = "Darwin" && test "$MOZILLA_TOOLKIT" != "gtk2"; then # #only gtk2 toolkit supported - xlib or cocoa nees glib1 and libIDL1 - the latter is not @@ -17522,63 +14836,55 @@ else enable_build_mozilla= fi -echo "$as_me:$LINENO: checking whether to build Mozilla/SeaMonkey" >&5 -echo $ECHO_N "checking whether to build Mozilla/SeaMonkey... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build Mozilla/SeaMonkey" >&5 +$as_echo_n "checking whether to build Mozilla/SeaMonkey... " >&6; } if test -n "$enable_build_mozilla"; then BUILD_MOZAB="TRUE" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else BUILD_MOZAB="" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -echo "$as_me:$LINENO: checking whether to build provided NSS module" >&5 -echo $ECHO_N "checking whether to build provided NSS module... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build provided NSS module" >&5 +$as_echo_n "checking whether to build provided NSS module... " >&6; } if test "$enable_nss_module" != "no"; then ENABLE_NSS_MODULE="YES" BUILD_TYPE="$BUILD_TYPE NSS" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } if test "$_os" = "WINNT"; then - echo "$as_me:$LINENO: checking for Mozilla build tooling" >&5 -echo $ECHO_N "checking for Mozilla build tooling... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Mozilla build tooling" >&5 +$as_echo_n "checking for Mozilla build tooling... " >&6; } if test -z "$MOZILLABUILD" ; then -{ { echo "$as_me:$LINENO: error: Mozilla build tooling not found. +as_fn_error "Mozilla build tooling not found. Use the --with-mozilla-build option after installling the tools obtained -from http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32" >&5 -echo "$as_me: error: Mozilla build tooling not found. -Use the --with-mozilla-build option after installling the tools obtained -from http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32" >&2;} - { (exit 1); exit 1; }; } +from http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32" "$LINENO" 5 else if test \( "$WITH_MINGWIN" = "yes" \) ; then if test ! -d "$MOZILLABUILD" ; then -{ { echo "$as_me:$LINENO: error: Mozilla build tooling incomplete!" >&5 -echo "$as_me: error: Mozilla build tooling incomplete!" >&2;} - { (exit 1); exit 1; }; } +as_fn_error "Mozilla build tooling incomplete!" "$LINENO" 5 else - echo "$as_me:$LINENO: result: ok" >&5 -echo "${ECHO_T}ok" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } fi else if test ! -d "$MOZILLABUILD/moztools" \ -o ! -d "$MOZILLABUILD/msys" ; then -{ { echo "$as_me:$LINENO: error: Mozilla build tooling incomplete!" >&5 -echo "$as_me: error: Mozilla build tooling incomplete!" >&2;} - { (exit 1); exit 1; }; } +as_fn_error "Mozilla build tooling incomplete!" "$LINENO" 5 else - echo "$as_me:$LINENO: result: ok" >&5 -echo "${ECHO_T}ok" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } fi fi fi fi else ENABLE_NSS_MODULE="NO" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi if test "$BUILD_MOZAB" = "TRUE"; then @@ -17586,13 +14892,11 @@ if test "$BUILD_MOZAB" = "TRUE"; then if test "$WITH_MINGWIN" != "yes"; then # compiling with MSVC. Only supported platform here is MSVS2005 at the moment. if test "$MSVSVER" != "2005"; then - { { echo "$as_me:$LINENO: error: Building SeaMonkey is supported with Microsoft Visual Studio .NET 2005 only." >&5 -echo "$as_me: error: Building SeaMonkey is supported with Microsoft Visual Studio .NET 2005 only." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Building SeaMonkey is supported with Microsoft Visual Studio .NET 2005 only." "$LINENO" 5 fi else - { echo "$as_me:$LINENO: WARNING: Building SeaMonkey with mingwin is not tested, and likely to break." >&5 -echo "$as_me: WARNING: Building SeaMonkey with mingwin is not tested, and likely to break." >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Building SeaMonkey with mingwin is not tested, and likely to break." >&5 +$as_echo "$as_me: WARNING: Building SeaMonkey with mingwin is not tested, and likely to break." >&2;} echo "Building SeaMonkey with mingwin is not tested, and likely to break." >> warn fi fi @@ -17602,56 +14906,48 @@ echo "$as_me: WARNING: Building SeaMonkey with mingwin is not tested, and likely fi MOZILLA_SOURCE_VERSION="seamonkey-${MOZILLA_VERSION}.source" for e in gz bz2; do - echo "$as_me:$LINENO: checking for $MOZILLA_SOURCE_VERSION.tar.$e" >&5 -echo $ECHO_N "checking for $MOZILLA_SOURCE_VERSION.tar.$e... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $MOZILLA_SOURCE_VERSION.tar.$e" >&5 +$as_echo_n "checking for $MOZILLA_SOURCE_VERSION.tar.$e... " >&6; } if test ! -e "moz/download/$MOZILLA_SOURCE_VERSION.tar.$e" && test "$HAVE_MOZILLA_TARBALL" != "y"; then - echo "$as_me:$LINENO: result: not found" >&5 -echo "${ECHO_T}not found" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } HAVE_MOZILLA_TARBALL=n else - echo "$as_me:$LINENO: result: found" >&5 -echo "${ECHO_T}found" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 +$as_echo "found" >&6; } HAVE_MOZILLA_TARBALL=y fi done if test "$HAVE_MOZILLA_TARBALL" != "y"; then - { { echo "$as_me:$LINENO: error: Mozilla/SeaMonkey source archive not found. -Please copy $MOZILLA_SOURCE_VERSION.tar.bz2 or $MOZILLA_SOURCE_VERSION.tar.gz to moz/download/. -The archives can be found here: -ftp://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/$MOZILLA_VERSION/" >&5 -echo "$as_me: error: Mozilla/SeaMonkey source archive not found. + as_fn_error "Mozilla/SeaMonkey source archive not found. Please copy $MOZILLA_SOURCE_VERSION.tar.bz2 or $MOZILLA_SOURCE_VERSION.tar.gz to moz/download/. The archives can be found here: -ftp://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/$MOZILLA_VERSION/" >&2;} - { (exit 1); exit 1; }; } +ftp://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/$MOZILLA_VERSION/" "$LINENO" 5 fi if test "$_os" = "WINNT"; then - echo "$as_me:$LINENO: checking for moztools binaries" >&5 -echo $ECHO_N "checking for moztools binaries... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for moztools binaries" >&5 +$as_echo_n "checking for moztools binaries... " >&6; } if test ! -e "moz/download/vc8-moztools.zip" ; then - { { echo "$as_me:$LINENO: error: The following file is missing in moz/download: vc8-moztools.zip -(from ftp://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/historic/vc8/)" >&5 -echo "$as_me: error: The following file is missing in moz/download: vc8-moztools.zip -(from ftp://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/historic/vc8/)" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "The following file is missing in moz/download: vc8-moztools.zip +(from ftp://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/historic/vc8/)" "$LINENO" 5 else - echo "$as_me:$LINENO: result: ok" >&5 -echo "${ECHO_T}ok" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } fi elif test "$_os" = "Darwin"; then if test "$MOZILLA_TOOLKIT" = "gtk2"; then - { echo "$as_me:$LINENO: checking whether mozilla can be built..." >&5 -echo "$as_me: checking whether mozilla can be built..." >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mozilla can be built..." >&5 +$as_echo "$as_me: checking whether mozilla can be built..." >&6;} succeeded=no if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -17663,29 +14959,30 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -17696,25 +14993,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for gtk+-2.0 >= 2.4 libIDL-2.0 >= 0.8" >&5 -echo $ECHO_N "checking for gtk+-2.0 >= 2.4 libIDL-2.0 >= 0.8... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gtk+-2.0 >= 2.4 libIDL-2.0 >= 0.8" >&5 +$as_echo_n "checking for gtk+-2.0 >= 2.4 libIDL-2.0 >= 0.8... " >&6; } if $PKG_CONFIG --exists "gtk+-2.0 >= 2.4 libIDL-2.0 >= 0.8" ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking MOZGTK2_CFLAGS" >&5 -echo $ECHO_N "checking MOZGTK2_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZGTK2_CFLAGS" >&5 +$as_echo_n "checking MOZGTK2_CFLAGS... " >&6; } MOZGTK2_CFLAGS=`$PKG_CONFIG --cflags "gtk+-2.0 >= 2.4 libIDL-2.0 >= 0.8"` - echo "$as_me:$LINENO: result: $MOZGTK2_CFLAGS" >&5 -echo "${ECHO_T}$MOZGTK2_CFLAGS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZGTK2_CFLAGS" >&5 +$as_echo "$MOZGTK2_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking MOZGTK2_LIBS" >&5 -echo $ECHO_N "checking MOZGTK2_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZGTK2_LIBS" >&5 +$as_echo_n "checking MOZGTK2_LIBS... " >&6; } MOZGTK2_LIBS=`$PKG_CONFIG --libs "gtk+-2.0 >= 2.4 libIDL-2.0 >= 0.8"` - echo "$as_me:$LINENO: result: $MOZGTK2_LIBS" >&5 -echo "${ECHO_T}$MOZGTK2_LIBS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZGTK2_LIBS" >&5 +$as_echo "$MOZGTK2_LIBS" >&6; } else MOZGTK2_CFLAGS="" MOZGTK2_LIBS="" @@ -17733,12 +15030,10 @@ echo "${ECHO_T}$MOZGTK2_LIBS" >&6 fi if test $succeeded = yes; then - { echo "$as_me:$LINENO: OK - can build mozilla" >&5 -echo "$as_me: OK - can build mozilla" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: OK - can build mozilla" >&5 +$as_echo "$as_me: OK - can build mozilla" >&6;} else - { { echo "$as_me:$LINENO: error: Prerequisites to build mozilla not met. Either use the precompiled mozilla binaries or install the missing packages" >&5 -echo "$as_me: error: Prerequisites to build mozilla not met. Either use the precompiled mozilla binaries or install the missing packages" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Prerequisites to build mozilla not met. Either use the precompiled mozilla binaries or install the missing packages" "$LINENO" 5 fi else @@ -17748,10 +15043,10 @@ echo "$as_me: error: Prerequisites to build mozilla not met. Either use the prec if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -17763,29 +15058,30 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -17796,25 +15092,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for libIDL-2.0 >= 0.6.3" >&5 -echo $ECHO_N "checking for libIDL-2.0 >= 0.6.3... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libIDL-2.0 >= 0.6.3" >&5 +$as_echo_n "checking for libIDL-2.0 >= 0.6.3... " >&6; } if $PKG_CONFIG --exists "libIDL-2.0 >= 0.6.3" ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking MOZLIBREQ_CFLAGS" >&5 -echo $ECHO_N "checking MOZLIBREQ_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZLIBREQ_CFLAGS" >&5 +$as_echo_n "checking MOZLIBREQ_CFLAGS... " >&6; } MOZLIBREQ_CFLAGS=`$PKG_CONFIG --cflags "libIDL-2.0 >= 0.6.3"` - echo "$as_me:$LINENO: result: $MOZLIBREQ_CFLAGS" >&5 -echo "${ECHO_T}$MOZLIBREQ_CFLAGS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZLIBREQ_CFLAGS" >&5 +$as_echo "$MOZLIBREQ_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking MOZLIBREQ_LIBS" >&5 -echo $ECHO_N "checking MOZLIBREQ_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZLIBREQ_LIBS" >&5 +$as_echo_n "checking MOZLIBREQ_LIBS... " >&6; } MOZLIBREQ_LIBS=`$PKG_CONFIG --libs "libIDL-2.0 >= 0.6.3"` - echo "$as_me:$LINENO: result: $MOZLIBREQ_LIBS" >&5 -echo "${ECHO_T}$MOZLIBREQ_LIBS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZLIBREQ_LIBS" >&5 +$as_echo "$MOZLIBREQ_LIBS" >&6; } else MOZLIBREQ_CFLAGS="" MOZLIBREQ_LIBS="" @@ -17839,9 +15135,7 @@ echo "${ECHO_T}$MOZLIBREQ_LIBS" >&6 fi if test -z "$MOZIDL"; then - { { echo "$as_me:$LINENO: error: libIDL 0.6.3 or newer is needed to build mozilla with mac toolkit." >&5 -echo "$as_me: error: libIDL 0.6.3 or newer is needed to build mozilla with mac toolkit." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "libIDL 0.6.3 or newer is needed to build mozilla with mac toolkit." "$LINENO" 5 fi fi else @@ -17853,10 +15147,10 @@ echo "$as_me: error: libIDL 0.6.3 or newer is needed to build mozilla with mac t if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -17868,29 +15162,30 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -17901,25 +15196,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for gtk+-2.0" >&5 -echo $ECHO_N "checking for gtk+-2.0... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gtk+-2.0" >&5 +$as_echo_n "checking for gtk+-2.0... " >&6; } if $PKG_CONFIG --exists "gtk+-2.0" ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking MOZLIBREQ_CFLAGS" >&5 -echo $ECHO_N "checking MOZLIBREQ_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZLIBREQ_CFLAGS" >&5 +$as_echo_n "checking MOZLIBREQ_CFLAGS... " >&6; } MOZLIBREQ_CFLAGS=`$PKG_CONFIG --cflags "gtk+-2.0"` - echo "$as_me:$LINENO: result: $MOZLIBREQ_CFLAGS" >&5 -echo "${ECHO_T}$MOZLIBREQ_CFLAGS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZLIBREQ_CFLAGS" >&5 +$as_echo "$MOZLIBREQ_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking MOZLIBREQ_LIBS" >&5 -echo $ECHO_N "checking MOZLIBREQ_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZLIBREQ_LIBS" >&5 +$as_echo_n "checking MOZLIBREQ_LIBS... " >&6; } MOZLIBREQ_LIBS=`$PKG_CONFIG --libs "gtk+-2.0"` - echo "$as_me:$LINENO: result: $MOZLIBREQ_LIBS" >&5 -echo "${ECHO_T}$MOZLIBREQ_LIBS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZLIBREQ_LIBS" >&5 +$as_echo "$MOZLIBREQ_LIBS" >&6; } else MOZLIBREQ_CFLAGS="" MOZLIBREQ_LIBS="" @@ -17944,9 +15239,7 @@ echo "${ECHO_T}$MOZLIBREQ_LIBS" >&6 fi if test -z "$MOZGTK"; then - { { echo "$as_me:$LINENO: error: GTK2 is needed to build mozilla." >&5 -echo "$as_me: error: GTK2 is needed to build mozilla." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "GTK2 is needed to build mozilla." "$LINENO" 5 fi succeeded=no @@ -17954,10 +15247,10 @@ echo "$as_me: error: GTK2 is needed to build mozilla." >&2;} if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -17969,29 +15262,30 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -18002,25 +15296,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for libIDL-2.0 >= 0.8.0" >&5 -echo $ECHO_N "checking for libIDL-2.0 >= 0.8.0... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libIDL-2.0 >= 0.8.0" >&5 +$as_echo_n "checking for libIDL-2.0 >= 0.8.0... " >&6; } if $PKG_CONFIG --exists "libIDL-2.0 >= 0.8.0" ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking MOZLIBREQ_CFLAGS" >&5 -echo $ECHO_N "checking MOZLIBREQ_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZLIBREQ_CFLAGS" >&5 +$as_echo_n "checking MOZLIBREQ_CFLAGS... " >&6; } MOZLIBREQ_CFLAGS=`$PKG_CONFIG --cflags "libIDL-2.0 >= 0.8.0"` - echo "$as_me:$LINENO: result: $MOZLIBREQ_CFLAGS" >&5 -echo "${ECHO_T}$MOZLIBREQ_CFLAGS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZLIBREQ_CFLAGS" >&5 +$as_echo "$MOZLIBREQ_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking MOZLIBREQ_LIBS" >&5 -echo $ECHO_N "checking MOZLIBREQ_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZLIBREQ_LIBS" >&5 +$as_echo_n "checking MOZLIBREQ_LIBS... " >&6; } MOZLIBREQ_LIBS=`$PKG_CONFIG --libs "libIDL-2.0 >= 0.8.0"` - echo "$as_me:$LINENO: result: $MOZLIBREQ_LIBS" >&5 -echo "${ECHO_T}$MOZLIBREQ_LIBS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZLIBREQ_LIBS" >&5 +$as_echo "$MOZLIBREQ_LIBS" >&6; } else MOZLIBREQ_CFLAGS="" MOZLIBREQ_LIBS="" @@ -18045,9 +15339,7 @@ echo "${ECHO_T}$MOZLIBREQ_LIBS" >&6 fi if test -z "$MOZIDL"; then - { { echo "$as_me:$LINENO: error: libIDL >= 0.8.0 is needed when using GTK2 to build mozilla." >&5 -echo "$as_me: error: libIDL >= 0.8.0 is needed when using GTK2 to build mozilla." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "libIDL >= 0.8.0 is needed when using GTK2 to build mozilla." "$LINENO" 5 fi else @@ -18056,10 +15348,10 @@ echo "$as_me: error: libIDL >= 0.8.0 is needed when using GTK2 to build mozilla. if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -18071,29 +15363,30 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -18104,25 +15397,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for gtk+ >= 1.2.3" >&5 -echo $ECHO_N "checking for gtk+ >= 1.2.3... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gtk+ >= 1.2.3" >&5 +$as_echo_n "checking for gtk+ >= 1.2.3... " >&6; } if $PKG_CONFIG --exists "gtk+ >= 1.2.3" ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking MOZLIBREQ_CFLAGS" >&5 -echo $ECHO_N "checking MOZLIBREQ_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZLIBREQ_CFLAGS" >&5 +$as_echo_n "checking MOZLIBREQ_CFLAGS... " >&6; } MOZLIBREQ_CFLAGS=`$PKG_CONFIG --cflags "gtk+ >= 1.2.3"` - echo "$as_me:$LINENO: result: $MOZLIBREQ_CFLAGS" >&5 -echo "${ECHO_T}$MOZLIBREQ_CFLAGS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZLIBREQ_CFLAGS" >&5 +$as_echo "$MOZLIBREQ_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking MOZLIBREQ_LIBS" >&5 -echo $ECHO_N "checking MOZLIBREQ_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZLIBREQ_LIBS" >&5 +$as_echo_n "checking MOZLIBREQ_LIBS... " >&6; } MOZLIBREQ_LIBS=`$PKG_CONFIG --libs "gtk+ >= 1.2.3"` - echo "$as_me:$LINENO: result: $MOZLIBREQ_LIBS" >&5 -echo "${ECHO_T}$MOZLIBREQ_LIBS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZLIBREQ_LIBS" >&5 +$as_echo "$MOZLIBREQ_LIBS" >&6; } else MOZLIBREQ_CFLAGS="" MOZLIBREQ_LIBS="" @@ -18147,9 +15440,7 @@ echo "${ECHO_T}$MOZLIBREQ_LIBS" >&6 fi if test -z "$MOZGTK"; then - { { echo "$as_me:$LINENO: error: gtk 1.2 is needed when not using GTK2 to build mozilla." >&5 -echo "$as_me: error: gtk 1.2 is needed when not using GTK2 to build mozilla." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "gtk 1.2 is needed when not using GTK2 to build mozilla." "$LINENO" 5 fi succeeded=no @@ -18157,10 +15448,10 @@ echo "$as_me: error: gtk 1.2 is needed when not using GTK2 to build mozilla." >& if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -18172,29 +15463,30 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -18205,25 +15497,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for libidl >= 0.6.3 libidl <= 0.6.8" >&5 -echo $ECHO_N "checking for libidl >= 0.6.3 libidl <= 0.6.8... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libidl >= 0.6.3 libidl <= 0.6.8" >&5 +$as_echo_n "checking for libidl >= 0.6.3 libidl <= 0.6.8... " >&6; } if $PKG_CONFIG --exists "libidl >= 0.6.3 libidl <= 0.6.8" ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking MOZLIBREQ_CFLAGS" >&5 -echo $ECHO_N "checking MOZLIBREQ_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZLIBREQ_CFLAGS" >&5 +$as_echo_n "checking MOZLIBREQ_CFLAGS... " >&6; } MOZLIBREQ_CFLAGS=`$PKG_CONFIG --cflags "libidl >= 0.6.3 libidl <= 0.6.8"` - echo "$as_me:$LINENO: result: $MOZLIBREQ_CFLAGS" >&5 -echo "${ECHO_T}$MOZLIBREQ_CFLAGS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZLIBREQ_CFLAGS" >&5 +$as_echo "$MOZLIBREQ_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking MOZLIBREQ_LIBS" >&5 -echo $ECHO_N "checking MOZLIBREQ_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZLIBREQ_LIBS" >&5 +$as_echo_n "checking MOZLIBREQ_LIBS... " >&6; } MOZLIBREQ_LIBS=`$PKG_CONFIG --libs "libidl >= 0.6.3 libidl <= 0.6.8"` - echo "$as_me:$LINENO: result: $MOZLIBREQ_LIBS" >&5 -echo "${ECHO_T}$MOZLIBREQ_LIBS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZLIBREQ_LIBS" >&5 +$as_echo "$MOZLIBREQ_LIBS" >&6; } else MOZLIBREQ_CFLAGS="" MOZLIBREQ_LIBS="" @@ -18248,9 +15540,7 @@ echo "${ECHO_T}$MOZLIBREQ_LIBS" >&6 fi if test -z "$MOZIDL"; then - { { echo "$as_me:$LINENO: error: libIDL 0.6.3 - 0.6.8 is needed when not using GTK2 to build mozilla." >&5 -echo "$as_me: error: libIDL 0.6.3 - 0.6.8 is needed when not using GTK2 to build mozilla." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "libIDL 0.6.3 - 0.6.8 is needed when not using GTK2 to build mozilla." "$LINENO" 5 fi fi fi @@ -18270,225 +15560,61 @@ fi -echo "$as_me:$LINENO: checking which sane header to use" >&5 -echo $ECHO_N "checking which sane header to use... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which sane header to use" >&5 +$as_echo_n "checking which sane header to use... " >&6; } if test -n "$with_system_sane_header" -o -n "$with_system_headers" && \ test "$with_system_sane_header" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_SANE_HEADER=YES - if test "${ac_cv_header_sane_sane_h+set}" = set; then - echo "$as_me:$LINENO: checking for sane/sane.h" >&5 -echo $ECHO_N "checking for sane/sane.h... $ECHO_C" >&6 -if test "${ac_cv_header_sane_sane_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_sane_sane_h" >&5 -echo "${ECHO_T}$ac_cv_header_sane_sane_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking sane/sane.h usability" >&5 -echo $ECHO_N "checking sane/sane.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking sane/sane.h presence" >&5 -echo $ECHO_N "checking sane/sane.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: sane/sane.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: sane/sane.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: sane/sane.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: sane/sane.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: sane/sane.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: sane/sane.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: sane/sane.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: sane/sane.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: sane/sane.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: sane/sane.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: sane/sane.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: sane/sane.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: sane/sane.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: sane/sane.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: sane/sane.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: sane/sane.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for sane/sane.h" >&5 -echo $ECHO_N "checking for sane/sane.h... $ECHO_C" >&6 -if test "${ac_cv_header_sane_sane_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_sane_sane_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_sane_sane_h" >&5 -echo "${ECHO_T}$ac_cv_header_sane_sane_h" >&6 + ac_fn_c_check_header_mongrel "$LINENO" "sane/sane.h" "ac_cv_header_sane_sane_h" "$ac_includes_default" +if test "x$ac_cv_header_sane_sane_h" = x""yes; then : -fi -if test $ac_cv_header_sane_sane_h = yes; then - : else - { { echo "$as_me:$LINENO: error: sane not found. install sane" >&5 -echo "$as_me: error: sane not found. install sane" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "sane not found. install sane" "$LINENO" 5 fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_SANE_HEADER=NO BUILD_TYPE="$BUILD_TYPE SANE" fi -echo "$as_me:$LINENO: checking which icu to use" >&5 -echo $ECHO_N "checking which icu to use... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which icu to use" >&5 +$as_echo_n "checking which icu to use... " >&6; } if test -n "$with_system_icu" -o -n "$with_system_libs" && \ test "$with_system_icu" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_ICU=YES - ac_ext=cc + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - echo "$as_me:$LINENO: checking for unicode/rbbi.h" >&5 -echo $ECHO_N "checking for unicode/rbbi.h... $ECHO_C" >&6 - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unicode/rbbi.h" >&5 +$as_echo_n "checking for unicode/rbbi.h... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ unicode/rbbi.h _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - echo "$as_me:$LINENO: result: checked." >&5 -echo "${ECHO_T}checked." >&6 +if ac_fn_cxx_try_cpp "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked." >&5 +$as_echo "checked." >&6; } else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - { { echo "$as_me:$LINENO: error: icu headers not found." >&5 -echo "$as_me: error: icu headers not found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "icu headers not found." "$LINENO" 5 fi rm -f conftest.err conftest.$ac_ext # Extract the first word of "genbrk", so it can be a program name with args. set dummy genbrk; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_SYSTEM_GENBRK+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_SYSTEM_GENBRK+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $SYSTEM_GENBRK in [\\/]* | ?:[\\/]*) @@ -18501,39 +15627,38 @@ for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_SYSTEM_GENBRK="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS ;; esac fi SYSTEM_GENBRK=$ac_cv_path_SYSTEM_GENBRK - if test -n "$SYSTEM_GENBRK"; then - echo "$as_me:$LINENO: result: $SYSTEM_GENBRK" >&5 -echo "${ECHO_T}$SYSTEM_GENBRK" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SYSTEM_GENBRK" >&5 +$as_echo "$SYSTEM_GENBRK" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + if test -z "$SYSTEM_GENBRK"; then - { { echo "$as_me:$LINENO: error: \\"genbrk\\" not found in \$PATH, install the icu development tool \\"genbrk\"\" >&5 -echo "$as_me: error: \\"genbrk\\" not found in \$PATH, install the icu development tool \\"genbrk\"\" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "\\"genbrk\\" not found in \$PATH, install the icu development tool \\"genbrk\"\" "$LINENO" 5 fi # Extract the first word of "genccode", so it can be a program name with args. set dummy genccode; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_SYSTEM_GENCCODE+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_SYSTEM_GENCCODE+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $SYSTEM_GENCCODE in [\\/]* | ?:[\\/]*) @@ -18546,39 +15671,38 @@ for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_SYSTEM_GENCCODE="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS ;; esac fi SYSTEM_GENCCODE=$ac_cv_path_SYSTEM_GENCCODE - if test -n "$SYSTEM_GENCCODE"; then - echo "$as_me:$LINENO: result: $SYSTEM_GENCCODE" >&5 -echo "${ECHO_T}$SYSTEM_GENCCODE" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SYSTEM_GENCCODE" >&5 +$as_echo "$SYSTEM_GENCCODE" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + if test -z "$SYSTEM_GENCCODE"; then - { { echo "$as_me:$LINENO: error: \\"genccode\\" not found in \$PATH, install the icu development tool \\"genccode\"\" >&5 -echo "$as_me: error: \\"genccode\\" not found in \$PATH, install the icu development tool \\"genccode\"\" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "\\"genccode\\" not found in \$PATH, install the icu development tool \\"genccode\"\" "$LINENO" 5 fi # Extract the first word of "gencmn", so it can be a program name with args. set dummy gencmn; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_SYSTEM_GENCMN+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_SYSTEM_GENCMN+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $SYSTEM_GENCMN in [\\/]* | ?:[\\/]*) @@ -18591,47 +15715,41 @@ for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_SYSTEM_GENCMN="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS ;; esac fi SYSTEM_GENCMN=$ac_cv_path_SYSTEM_GENCMN - if test -n "$SYSTEM_GENCMN"; then - echo "$as_me:$LINENO: result: $SYSTEM_GENCMN" >&5 -echo "${ECHO_T}$SYSTEM_GENCMN" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SYSTEM_GENCMN" >&5 +$as_echo "$SYSTEM_GENCMN" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + if test -z "$SYSTEM_GENCMN"; then - { { echo "$as_me:$LINENO: error: \\"gencmn\\" not found in \$PATH, install the icu development tool \\"gencmn\"\" >&5 -echo "$as_me: error: \\"gencmn\\" not found in \$PATH, install the icu development tool \\"gencmn\"\" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "\\"gencmn\\" not found in \$PATH, install the icu development tool \\"gencmn\"\" "$LINENO" 5 fi - echo "$as_me:$LINENO: checking ICU version" >&5 -echo $ECHO_N "checking ICU version... $ECHO_C" >&6 - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + { $as_echo "$as_me:${as_lineno-$LINENO}: checking ICU version" >&5 +$as_echo_n "checking ICU version... " >&6; } + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot run test program while cross compiling +See \`config.log' for more details." "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -18644,31 +15762,16 @@ int main(int argc, char **argv) { } _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - echo "$as_me:$LINENO: result: OK" >&5 -echo "${ECHO_T}OK" >&6 +if ac_fn_cxx_try_run "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5 +$as_echo "OK" >&6; } else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: not suitable, only >= 4.0 supported currently" >&5 -echo "$as_me: error: not suitable, only >= 4.0 supported currently" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "not suitable, only >= 4.0 supported currently" "$LINENO" 5 fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -18676,8 +15779,8 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_ICU=NO BUILD_TYPE="$BUILD_TYPE ICU" fi @@ -18687,18 +15790,18 @@ fi -echo "$as_me:$LINENO: checking whether to enable graphite support" >&5 -echo $ECHO_N "checking whether to enable graphite support... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable graphite support" >&5 +$as_echo_n "checking whether to enable graphite support... " >&6; } if test "$_os" = "WINNT" -o "$_os" = "Linux" && test "z$enable_graphite" == "z" -o "$enable_graphite" != "no" ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } ENABLE_GRAPHITE="TRUE" - echo "$as_me:$LINENO: checking which graphite to use" >&5 -echo $ECHO_N "checking which graphite to use... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking which graphite to use" >&5 +$as_echo_n "checking which graphite to use... " >&6; } if test -n "$with_system_graphite" -o -n "$with_system_libs" && \ test "$with_system_graphite" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_GRAPHITE=YES succeeded=no @@ -18706,10 +15809,10 @@ echo "${ECHO_T}external" >&6 if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -18721,29 +15824,30 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -18754,25 +15858,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for silgraphite " >&5 -echo $ECHO_N "checking for silgraphite ... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for silgraphite " >&5 +$as_echo_n "checking for silgraphite ... " >&6; } if $PKG_CONFIG --exists "silgraphite " ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking GRAPHITE_CFLAGS" >&5 -echo $ECHO_N "checking GRAPHITE_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking GRAPHITE_CFLAGS" >&5 +$as_echo_n "checking GRAPHITE_CFLAGS... " >&6; } GRAPHITE_CFLAGS=`$PKG_CONFIG --cflags "silgraphite "` - echo "$as_me:$LINENO: result: $GRAPHITE_CFLAGS" >&5 -echo "${ECHO_T}$GRAPHITE_CFLAGS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GRAPHITE_CFLAGS" >&5 +$as_echo "$GRAPHITE_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking GRAPHITE_LIBS" >&5 -echo $ECHO_N "checking GRAPHITE_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking GRAPHITE_LIBS" >&5 +$as_echo_n "checking GRAPHITE_LIBS... " >&6; } GRAPHITE_LIBS=`$PKG_CONFIG --libs "silgraphite "` - echo "$as_me:$LINENO: result: $GRAPHITE_LIBS" >&5 -echo "${ECHO_T}$GRAPHITE_LIBS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GRAPHITE_LIBS" >&5 +$as_echo "$GRAPHITE_LIBS" >&6; } else GRAPHITE_CFLAGS="" GRAPHITE_LIBS="" @@ -18793,30 +15897,18 @@ echo "${ECHO_T}$GRAPHITE_LIBS" >&6 if test $succeeded = yes; then : else - { { echo "$as_me:$LINENO: error: Library requirements (silgraphite ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 -echo "$as_me: error: Library requirements (silgraphite ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Library requirements (silgraphite ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." "$LINENO" 5 fi - echo "$as_me:$LINENO: checking STL compatibility" >&5 -echo $ECHO_N "checking STL compatibility... $ECHO_C" >&6 - if test "$WITH_STLPORT" != "no"; then - { { echo "$as_me:$LINENO: error: to use system graphite you need to use --without-stlport" >&5 -echo "$as_me: error: to use system graphite you need to use --without-stlport" >&2;} - { (exit 1); exit 1; }; } - else - echo "$as_me:$LINENO: result: OK" >&5 -echo "${ECHO_T}OK" >&6 - fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_GRAPHITE=NO BUILD_TYPE="$BUILD_TYPE GRAPHITE" fi else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -18826,15 +15918,13 @@ fi if test "$_os" = "Darwin"; then if test "x$with_x" = "xyes"; then - { { echo "$as_me:$LINENO: error: X11 build is no longer supported on MacOSX, please use the native aqua build" >&5 -echo "$as_me: error: X11 build is no longer supported on MacOSX, please use the native aqua build" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "X11 build is no longer supported on MacOSX, please use the native aqua build" "$LINENO" 5 else - echo "$as_me:$LINENO: checking for /System/Library/Frameworks/AppKit.framework" >&5 -echo $ECHO_N "checking for /System/Library/Frameworks/AppKit.framework... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /System/Library/Frameworks/AppKit.framework" >&5 +$as_echo_n "checking for /System/Library/Frameworks/AppKit.framework... " >&6; } if test -d "/System/Library/Frameworks/AppKit.framework/"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } x_includes="no_x_includes" x_libraries="no_x_libraries" enable_gtk=no @@ -18842,9 +15932,7 @@ echo "${ECHO_T}yes" >&6 ENABLE_CUPS="" else - { { echo "$as_me:$LINENO: error: No AppKit.framewrok found" >&5 -echo "$as_me: error: No AppKit.framewrok found" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "No AppKit.framewrok found" "$LINENO" 5 fi fi fi @@ -18856,44 +15944,47 @@ elif test "$_os" = "OS2" ; then echo "Do Nothing for _os = OS2. Don't check for X11." : elif test "$_os" != "WINNT" ; then - echo "$as_me:$LINENO: checking for X" >&5 -echo $ECHO_N "checking for X... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5 +$as_echo_n "checking for X... " >&6; } -# Check whether --with-x or --without-x was given. -if test "${with_x+set}" = set; then - withval="$with_x" +# Check whether --with-x was given. +if test "${with_x+set}" = set; then : + withval=$with_x; +fi -fi; # $have_x is `yes', `no', `disabled', or empty when we do not yet know. if test "x$with_x" = xno; then # The user explicitly disabled X. have_x=disabled else - if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then - # Both variables are already set. - have_x=yes - else - if test "${ac_cv_have_x+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + case $x_includes,$x_libraries in #( + *\'*) as_fn_error "cannot use X directory names containing '" "$LINENO" 5;; #( + *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then : + $as_echo_n "(cached) " >&6 else # One or both of the vars are not set, and there is no cached value. ac_x_includes=no ac_x_libraries=no -rm -fr conftest.dir +rm -f -r conftest.dir if mkdir conftest.dir; then cd conftest.dir - # Make sure to not put "make" in the Imakefile rules, since we grep it out. cat >Imakefile <<'_ACEOF' -acfindx: - @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"' -_ACEOF - if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then +incroot: + @echo incroot='${INCROOT}' +usrlibdir: + @echo usrlibdir='${USRLIBDIR}' +libdir: + @echo libdir='${LIBDIR}' +_ACEOF + if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then # GNU make sometimes prints "make[1]: Entering...", which would confuse us. - eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` + for ac_var in incroot usrlibdir libdir; do + eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" + done # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. - for ac_extension in a so sl; do - if test ! -f $ac_im_usrlibdir/libX11.$ac_extension && - test -f $ac_im_libdir/libX11.$ac_extension; then + for ac_extension in a so sl dylib la dll; do + if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && + test -f "$ac_im_libdir/libX11.$ac_extension"; then ac_im_usrlibdir=$ac_im_libdir; break fi done @@ -18901,37 +15992,41 @@ _ACEOF # bogus both because they are the default anyway, and because # using them would break gcc on systems where it needs fixed includes. case $ac_im_incroot in - /usr/include) ;; + /usr/include) ac_x_includes= ;; *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; esac case $ac_im_usrlibdir in - /usr/lib | /lib) ;; + /usr/lib | /usr/lib64 | /lib | /lib64) ;; *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; esac fi cd .. - rm -fr conftest.dir + rm -f -r conftest.dir fi # Standard set of common directories for X headers. # Check X11 before X11Rn because it is often a symlink to the current release. ac_x_header_dirs=' /usr/X11/include +/usr/X11R7/include /usr/X11R6/include /usr/X11R5/include /usr/X11R4/include /usr/include/X11 +/usr/include/X11R7 /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 /usr/local/X11/include +/usr/local/X11R7/include /usr/local/X11R6/include /usr/local/X11R5/include /usr/local/X11R4/include /usr/local/include/X11 +/usr/local/include/X11R7 /usr/local/include/X11R6 /usr/local/include/X11R5 /usr/local/include/X11R4 @@ -18951,42 +16046,18 @@ ac_x_header_dirs=' /usr/openwin/share/include' if test "$ac_x_includes" = no; then - # Guess where to find include files, by looking for Intrinsic.h. + # Guess where to find include files, by looking for Xlib.h. # First, try using that file with no special directory specified. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include +#include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then +if ac_fn_c_try_cpp "$LINENO"; then : # We can compile using X headers with no special include directory. ac_x_includes= else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - for ac_dir in $ac_x_header_dirs; do - if test -r "$ac_dir/X11/Intrinsic.h"; then + if test -r "$ac_dir/X11/Xlib.h"; then ac_x_includes=$ac_dir break fi @@ -19000,102 +16071,76 @@ if test "$ac_x_libraries" = no; then # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS - LIBS="-lXt $LIBS" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + LIBS="-lX11 $LIBS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include +#include int main () { -XtMalloc (0) +XrmInitialize () ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_link "$LINENO"; then : LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -LIBS=$ac_save_LIBS -for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` + LIBS=$ac_save_LIBS +for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! - for ac_extension in a so sl; do - if test -r $ac_dir/libXt.$ac_extension; then + for ac_extension in a so sl dylib la dll; do + if test -r "$ac_dir/libX11.$ac_extension"; then ac_x_libraries=$ac_dir break 2 fi done done fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi # $ac_x_libraries = no -if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then - # Didn't find X anywhere. Cache the known absence of X. - ac_cv_have_x="have_x=no" -else - # Record where we found X for the cache. - ac_cv_have_x="have_x=yes \ - ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" -fi +case $ac_x_includes,$ac_x_libraries in #( + no,* | *,no | *\'*) + # Didn't find X, or a directory has "'" in its name. + ac_cv_have_x="have_x=no";; #( + *) + # Record where we found X for the cache. + ac_cv_have_x="have_x=yes\ + ac_x_includes='$ac_x_includes'\ + ac_x_libraries='$ac_x_libraries'" +esac fi - - fi +;; #( + *) have_x=yes;; + esac eval "$ac_cv_have_x" fi # $with_x != no if test "$have_x" != yes; then - echo "$as_me:$LINENO: result: $have_x" >&5 -echo "${ECHO_T}$have_x" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5 +$as_echo "$have_x" >&6; } no_x=yes else # If each of the values was on the command line, it overrides each guess. test "x$x_includes" = xNONE && x_includes=$ac_x_includes test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries # Update the cache value to reflect the command line values. - ac_cv_have_x="have_x=yes \ - ac_x_includes=$x_includes ac_x_libraries=$x_libraries" - echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5 -echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6 + ac_cv_have_x="have_x=yes\ + ac_x_includes='$x_includes'\ + ac_x_libraries='$x_libraries'" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5 +$as_echo "libraries $x_libraries, headers $x_includes" >&6; } fi if test "$no_x" = yes; then # Not all programs may use this symbol, but it does not hurt to define it. -cat >>confdefs.h <<\_ACEOF -#define X_DISPLAY_MISSING 1 -_ACEOF +$as_echo "#define X_DISPLAY_MISSING 1" >>confdefs.h X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= else @@ -19108,16 +16153,12 @@ else X_LIBS="$X_LIBS -L$x_libraries" # For Solaris; some versions of Sun CC require a space after -R and # others require no space. Words are not sufficient . . . . - case `(uname -sr) 2>/dev/null` in - "SunOS 5"*) - echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5 -echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6 - ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -R must be followed by a space" >&5 +$as_echo_n "checking whether -R must be followed by a space... " >&6; } + ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" + ac_xsave_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -19128,48 +16169,13 @@ main () return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_R_nospace=yes +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + X_LIBS="$X_LIBS -R$x_libraries" else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_R_nospace=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test $ac_R_nospace = yes; then - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - X_LIBS="$X_LIBS -R$x_libraries" - else - LIBS="$ac_xsave_LIBS -R $x_libraries" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + LIBS="$ac_xsave_LIBS -R $x_libraries" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -19179,49 +16185,22 @@ main () ; return 0; } -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_R_space=yes +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + X_LIBS="$X_LIBS -R $x_libraries" else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_R_space=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: neither works" >&5 +$as_echo "neither works" >&6; } fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - if test $ac_R_space = yes; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - X_LIBS="$X_LIBS -R $x_libraries" - else - echo "$as_me:$LINENO: result: neither works" >&5 -echo "${ECHO_T}neither works" >&6 - fi - fi - LIBS=$ac_xsave_LIBS - esac +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_c_werror_flag=$ac_xsave_c_werror_flag + LIBS=$ac_xsave_LIBS fi # Check for system-dependent libraries X programs must link with. @@ -19235,196 +16214,112 @@ echo "${ECHO_T}neither works" >&6 # libraries were built with DECnet support. And Karl Berry says # the Alpha needs dnet_stub (dnet does not exist). ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char XOpenDisplay (); int main () { -XOpenDisplay (); +return XOpenDisplay (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +if ac_fn_c_try_link "$LINENO"; then : -echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5 -echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6 -if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5 +$as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; } +if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char dnet_ntoa (); int main () { -dnet_ntoa (); +return dnet_ntoa (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dnet_dnet_ntoa=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dnet_dnet_ntoa=no + ac_cv_lib_dnet_dnet_ntoa=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 -echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6 -if test $ac_cv_lib_dnet_dnet_ntoa = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 +$as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; } +if test "x$ac_cv_lib_dnet_dnet_ntoa" = x""yes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then - echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet_stub" >&5 -echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6 -if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet_stub" >&5 +$as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; } +if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet_stub $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char dnet_ntoa (); int main () { -dnet_ntoa (); +return dnet_ntoa (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dnet_stub_dnet_ntoa=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_dnet_stub_dnet_ntoa=no + ac_cv_lib_dnet_stub_dnet_ntoa=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 -echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6 -if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 +$as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } +if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = x""yes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" fi fi fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS="$ac_xsave_LIBS" # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, @@ -19435,232 +16330,90 @@ rm -f conftest.err conftest.$ac_objext \ # on Irix 5.2, according to T.E. Dickey. # The functions gethostbyname, getservbyname, and inet_addr are # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. - echo "$as_me:$LINENO: checking for gethostbyname" >&5 -echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6 -if test "${ac_cv_func_gethostbyname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define gethostbyname to an innocuous variant, in case declares gethostbyname. - For example, HP-UX 11i declares gettimeofday. */ -#define gethostbyname innocuous_gethostbyname - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char gethostbyname (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef gethostbyname - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char gethostbyname (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname) -choke me -#else -char (*f) () = gethostbyname; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != gethostbyname; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_gethostbyname=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" +if test "x$ac_cv_func_gethostbyname" = x""yes; then : -ac_cv_func_gethostbyname=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 -echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6 if test $ac_cv_func_gethostbyname = no; then - echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 -echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6 -if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 +$as_echo_n "checking for gethostbyname in -lnsl... " >&6; } +if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char gethostbyname (); int main () { -gethostbyname (); +return gethostbyname (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_nsl_gethostbyname=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_nsl_gethostbyname=no + ac_cv_lib_nsl_gethostbyname=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 -echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6 -if test $ac_cv_lib_nsl_gethostbyname = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 +$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } +if test "x$ac_cv_lib_nsl_gethostbyname" = x""yes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" fi if test $ac_cv_lib_nsl_gethostbyname = no; then - echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5 -echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6 -if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lbsd" >&5 +$as_echo_n "checking for gethostbyname in -lbsd... " >&6; } +if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char gethostbyname (); int main () { -gethostbyname (); +return gethostbyname (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bsd_gethostbyname=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_bsd_gethostbyname=no + ac_cv_lib_bsd_gethostbyname=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5 -echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6 -if test $ac_cv_lib_bsd_gethostbyname = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5 +$as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; } +if test "x$ac_cv_lib_bsd_gethostbyname" = x""yes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" fi @@ -19674,489 +16427,147 @@ fi # variants that don't use the name server (or something). -lsocket # must be given before -lnsl if both are needed. We assume that # if connect needs -lnsl, so does gethostbyname. - echo "$as_me:$LINENO: checking for connect" >&5 -echo $ECHO_N "checking for connect... $ECHO_C" >&6 -if test "${ac_cv_func_connect+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define connect to an innocuous variant, in case declares connect. - For example, HP-UX 11i declares gettimeofday. */ -#define connect innocuous_connect - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char connect (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef connect - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char connect (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_connect) || defined (__stub___connect) -choke me -#else -char (*f) () = connect; -#endif -#ifdef __cplusplus -} -#endif + ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect" +if test "x$ac_cv_func_connect" = x""yes; then : -int -main () -{ -return f != connect; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_connect=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_connect=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 -echo "${ECHO_T}$ac_cv_func_connect" >&6 if test $ac_cv_func_connect = no; then - echo "$as_me:$LINENO: checking for connect in -lsocket" >&5 -echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6 -if test "${ac_cv_lib_socket_connect+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5 +$as_echo_n "checking for connect in -lsocket... " >&6; } +if test "${ac_cv_lib_socket_connect+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $X_EXTRA_LIBS $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char connect (); int main () { -connect (); +return connect (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_socket_connect=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_socket_connect=no + ac_cv_lib_socket_connect=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5 -echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6 -if test $ac_cv_lib_socket_connect = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5 +$as_echo "$ac_cv_lib_socket_connect" >&6; } +if test "x$ac_cv_lib_socket_connect" = x""yes; then : X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" fi fi # Guillermo Gomez says -lposix is necessary on A/UX. - echo "$as_me:$LINENO: checking for remove" >&5 -echo $ECHO_N "checking for remove... $ECHO_C" >&6 -if test "${ac_cv_func_remove+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define remove to an innocuous variant, in case declares remove. - For example, HP-UX 11i declares gettimeofday. */ -#define remove innocuous_remove - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char remove (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef remove - -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -{ -#endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char remove (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_remove) || defined (__stub___remove) -choke me -#else -char (*f) () = remove; -#endif -#ifdef __cplusplus -} -#endif - -int -main () -{ -return f != remove; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_remove=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + ac_fn_c_check_func "$LINENO" "remove" "ac_cv_func_remove" +if test "x$ac_cv_func_remove" = x""yes; then : -ac_cv_func_remove=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5 -echo "${ECHO_T}$ac_cv_func_remove" >&6 if test $ac_cv_func_remove = no; then - echo "$as_me:$LINENO: checking for remove in -lposix" >&5 -echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6 -if test "${ac_cv_lib_posix_remove+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for remove in -lposix" >&5 +$as_echo_n "checking for remove in -lposix... " >&6; } +if test "${ac_cv_lib_posix_remove+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lposix $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ -#ifdef __cplusplus -extern "C" -#endif -/* We use char because int might match the return type of a gcc2 +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -char remove (); -int -main () -{ -remove (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_posix_remove=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_posix_remove=no -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5 -echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6 -if test $ac_cv_lib_posix_remove = yes; then - X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" -fi - - fi - - # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. - echo "$as_me:$LINENO: checking for shmat" >&5 -echo $ECHO_N "checking for shmat... $ECHO_C" >&6 -if test "${ac_cv_func_shmat+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define shmat to an innocuous variant, in case declares shmat. - For example, HP-UX 11i declares gettimeofday. */ -#define shmat innocuous_shmat - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char shmat (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef shmat - -/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char shmat (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined (__stub_shmat) || defined (__stub___shmat) -choke me -#else -char (*f) () = shmat; -#endif -#ifdef __cplusplus -} -#endif - +char remove (); int main () { -return f != shmat; +return remove (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_shmat=yes +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_posix_remove=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_func_shmat=no + ac_cv_lib_posix_remove=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5 +$as_echo "$ac_cv_lib_posix_remove" >&6; } +if test "x$ac_cv_lib_posix_remove" = x""yes; then : + X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + + fi + + # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. + ac_fn_c_check_func "$LINENO" "shmat" "ac_cv_func_shmat" +if test "x$ac_cv_func_shmat" = x""yes; then : + fi -echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5 -echo "${ECHO_T}$ac_cv_func_shmat" >&6 if test $ac_cv_func_shmat = no; then - echo "$as_me:$LINENO: checking for shmat in -lipc" >&5 -echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6 -if test "${ac_cv_lib_ipc_shmat+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shmat in -lipc" >&5 +$as_echo_n "checking for shmat in -lipc... " >&6; } +if test "${ac_cv_lib_ipc_shmat+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lipc $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char shmat (); int main () { -shmat (); +return shmat (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ipc_shmat=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_ipc_shmat=no + ac_cv_lib_ipc_shmat=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5 -echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6 -if test $ac_cv_lib_ipc_shmat = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5 +$as_echo "$ac_cv_lib_ipc_shmat" >&6; } +if test "x$ac_cv_lib_ipc_shmat" = x""yes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" fi @@ -20172,71 +16583,43 @@ fi # These have to be linked with before -lX11, unlike the other # libraries we check for below, so use a different variable. # John Interrante, Karl Berry - echo "$as_me:$LINENO: checking for IceConnectionNumber in -lICE" >&5 -echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6 -if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IceConnectionNumber in -lICE" >&5 +$as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; } +if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lICE $X_EXTRA_LIBS $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char IceConnectionNumber (); int main () { -IceConnectionNumber (); +return IceConnectionNumber (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ICE_IceConnectionNumber=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_ICE_IceConnectionNumber=no + ac_cv_lib_ICE_IceConnectionNumber=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 -echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6 -if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 +$as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; } +if test "x$ac_cv_lib_ICE_IceConnectionNumber" = x""yes; then : X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" fi @@ -20253,154 +16636,92 @@ fi x_libraries="default_x_libraries" fi if test -z "$x_libraries"; then - { { echo "$as_me:$LINENO: error: No X libraries found" >&5 -echo "$as_me: error: No X libraries found" >&2;} - { (exit 1); exit 1; }; } # Exit + as_fn_error "No X libraries found" "$LINENO" 5 # Exit fi if test -z "$x_includes"; then - { { echo "$as_me:$LINENO: error: No X includes found" >&5 -echo "$as_me: error: No X includes found" >&2;} - { (exit 1); exit 1; }; } # Exit + as_fn_error "No X includes found" "$LINENO" 5 # Exit fi CFLAGS=$X_CFLAGS LDFLAGS="$X_LDFLAGS $X_LIBS" - echo "$as_me:$LINENO: checking for XOpenDisplay in -lX11" >&5 -echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6 -if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XOpenDisplay in -lX11" >&5 +$as_echo_n "checking for XOpenDisplay in -lX11... " >&6; } +if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lX11 $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char XOpenDisplay (); int main () { -XOpenDisplay (); +return XOpenDisplay (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_X11_XOpenDisplay=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_X11_XOpenDisplay=no + ac_cv_lib_X11_XOpenDisplay=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_X11_XOpenDisplay" >&5 -echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6 -if test $ac_cv_lib_X11_XOpenDisplay = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_X11_XOpenDisplay" >&5 +$as_echo "$ac_cv_lib_X11_XOpenDisplay" >&6; } +if test "x$ac_cv_lib_X11_XOpenDisplay" = x""yes; then : x_libs="-lX11 $X_EXTRA_LIBS" else - { { echo "$as_me:$LINENO: error: X Development libraries not found" >&5 -echo "$as_me: error: X Development libraries not found" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "X Development libraries not found" "$LINENO" 5 fi - echo "$as_me:$LINENO: checking for XauDisposeAuth in -lXau" >&5 -echo $ECHO_N "checking for XauDisposeAuth in -lXau... $ECHO_C" >&6 -if test "${ac_cv_lib_Xau_XauDisposeAuth+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XauDisposeAuth in -lXau" >&5 +$as_echo_n "checking for XauDisposeAuth in -lXau... " >&6; } +if test "${ac_cv_lib_Xau_XauDisposeAuth+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXau $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char XauDisposeAuth (); int main () { -XauDisposeAuth (); +return XauDisposeAuth (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xau_XauDisposeAuth=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_Xau_XauDisposeAuth=no + ac_cv_lib_Xau_XauDisposeAuth=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_Xau_XauDisposeAuth" >&5 -echo "${ECHO_T}$ac_cv_lib_Xau_XauDisposeAuth" >&6 -if test $ac_cv_lib_Xau_XauDisposeAuth = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xau_XauDisposeAuth" >&5 +$as_echo "$ac_cv_lib_Xau_XauDisposeAuth" >&6; } +if test "x$ac_cv_lib_Xau_XauDisposeAuth" = x""yes; then : XAU_LIBS="-lXau" fi @@ -20432,294 +16753,75 @@ fi if test "$_os" != "WINNT" -a "$_os" != "OS2" -a "$_os" != "Darwin"; then - echo "$as_me:$LINENO: checking whether to use Xaw" >&5 -echo $ECHO_N "checking whether to use Xaw... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use Xaw" >&5 +$as_echo_n "checking whether to use Xaw... " >&6; } if test "$enable_Xaw" = "no"; then DISABLE_XAW=TRUE - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 - -for ac_header in X11/Composite.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -eval "$as_ac_Header=no" -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -if test `eval echo '${'$as_ac_Header'}'` = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + for ac_header in X11/Composite.h +do : + ac_fn_c_check_header_compile "$LINENO" "X11/Composite.h" "ac_cv_header_X11_Composite_h" "#include +" +if test "x$ac_cv_header_X11_Composite_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_X11_COMPOSITE_H 1 _ACEOF else - { { echo "$as_me:$LINENO: error: Xt include headers not found" >&5 -echo "$as_me: error: Xt include headers not found" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Xt include headers not found" "$LINENO" 5 fi done else - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - -for ac_header in X11/Xaw/Label.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + for ac_header in X11/Xaw/Label.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "X11/Xaw/Label.h" "ac_cv_header_X11_Xaw_Label_h" "$ac_includes_default" +if test "x$ac_cv_header_X11_Xaw_Label_h" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define HAVE_X11_XAW_LABEL_H 1 _ACEOF else - { { echo "$as_me:$LINENO: error: Xaw include headers not found" >&5 -echo "$as_me: error: Xaw include headers not found" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Xaw include headers not found" "$LINENO" 5 fi done - -echo "$as_me:$LINENO: checking for main in -lXaw" >&5 -echo $ECHO_N "checking for main in -lXaw... $ECHO_C" >&6 -if test "${ac_cv_lib_Xaw_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lXaw" >&5 +$as_echo_n "checking for main in -lXaw... " >&6; } +if test "${ac_cv_lib_Xaw_main+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXaw $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { -main (); +return main (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xaw_main=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_Xaw_main=no + ac_cv_lib_Xaw_main=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_Xaw_main" >&5 -echo "${ECHO_T}$ac_cv_lib_Xaw_main" >&6 -if test $ac_cv_lib_Xaw_main = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xaw_main" >&5 +$as_echo "$ac_cv_lib_Xaw_main" >&6; } +if test "x$ac_cv_lib_Xaw_main" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBXAW 1 _ACEOF @@ -20727,9 +16829,7 @@ _ACEOF LIBS="-lXaw $LIBS" else - { { echo "$as_me:$LINENO: error: Xaw library not found or functional" >&5 -echo "$as_me: error: Xaw library not found or functional" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Xaw library not found or functional" "$LINENO" 5 fi fi @@ -20739,166 +16839,23 @@ fi if test "$ENABLE_FONTCONFIG" = "TRUE" ; then - if test "${ac_cv_header_fontconfig_fontconfig_h+set}" = set; then - echo "$as_me:$LINENO: checking for fontconfig/fontconfig.h" >&5 -echo $ECHO_N "checking for fontconfig/fontconfig.h... $ECHO_C" >&6 -if test "${ac_cv_header_fontconfig_fontconfig_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_fontconfig_fontconfig_h" >&5 -echo "${ECHO_T}$ac_cv_header_fontconfig_fontconfig_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking fontconfig/fontconfig.h usability" >&5 -echo $ECHO_N "checking fontconfig/fontconfig.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking fontconfig/fontconfig.h presence" >&5 -echo $ECHO_N "checking fontconfig/fontconfig.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + ac_fn_c_check_header_mongrel "$LINENO" "fontconfig/fontconfig.h" "ac_cv_header_fontconfig_fontconfig_h" "$ac_includes_default" +if test "x$ac_cv_header_fontconfig_fontconfig_h" = x""yes; then : - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: fontconfig/fontconfig.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: fontconfig/fontconfig.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: fontconfig/fontconfig.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: fontconfig/fontconfig.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: fontconfig/fontconfig.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: fontconfig/fontconfig.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: fontconfig/fontconfig.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: fontconfig/fontconfig.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: fontconfig/fontconfig.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: fontconfig/fontconfig.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: fontconfig/fontconfig.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: fontconfig/fontconfig.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: fontconfig/fontconfig.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: fontconfig/fontconfig.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: fontconfig/fontconfig.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: fontconfig/fontconfig.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for fontconfig/fontconfig.h" >&5 -echo $ECHO_N "checking for fontconfig/fontconfig.h... $ECHO_C" >&6 -if test "${ac_cv_header_fontconfig_fontconfig_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_fontconfig_fontconfig_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_fontconfig_fontconfig_h" >&5 -echo "${ECHO_T}$ac_cv_header_fontconfig_fontconfig_h" >&6 - -fi -if test $ac_cv_header_fontconfig_fontconfig_h = yes; then - : else - { { echo "$as_me:$LINENO: error: fontconfig/fontconfig.h could not be found. libfontconfig1-dev or fontconfig???-devel missing?" >&5 -echo "$as_me: error: fontconfig/fontconfig.h could not be found. libfontconfig1-dev or fontconfig???-devel missing?" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "fontconfig/fontconfig.h could not be found. libfontconfig1-dev or fontconfig???-devel missing?" "$LINENO" 5 fi - echo "$as_me:$LINENO: checking whether fontconfig is >= 2.2.0" >&5 -echo $ECHO_N "checking whether fontconfig is >= 2.2.0... $ECHO_C" >&6 - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fontconfig is >= 2.2.0" >&5 +$as_echo_n "checking whether fontconfig is >= 2.2.0... " >&6; } + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot run test program while cross compiling +See \`config.log' for more details." "$LINENO" 5; } else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -20909,271 +16866,89 @@ int main(int argc, char **argv) { } _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +if ac_fn_c_try_run "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: no, fontconfig >= 2.2.0 needed" >&5 -echo "$as_me: error: no, fontconfig >= 2.2.0 needed" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "no, fontconfig >= 2.2.0 needed" "$LINENO" 5 fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi + fi -echo "$as_me:$LINENO: checking whether to link to Xrender" >&5 -echo $ECHO_N "checking whether to link to Xrender... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to link to Xrender" >&5 +$as_echo_n "checking whether to link to Xrender... " >&6; } if test -n "$enable_xrender_link" -a "$enable_xrender_link" != "no"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } XRENDER_LINK=YES with_system_xrender_headers=yes else - echo "$as_me:$LINENO: result: no, dynamically open it" >&5 -echo "${ECHO_T}no, dynamically open it" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, dynamically open it" >&5 +$as_echo "no, dynamically open it" >&6; } XRENDER_LINK=NO fi -echo "$as_me:$LINENO: checking which Xrender headers to use" >&5 -echo $ECHO_N "checking which Xrender headers to use... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which Xrender headers to use" >&5 +$as_echo_n "checking which Xrender headers to use... " >&6; } if test -n "$with_system_xrender_headers" -o -n "$with_system_headers" && \ test "$with_system_xrender_headers" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_XRENDER_HEADERS=YES - if test "${ac_cv_header_X11_extensions_Xrender_h+set}" = set; then - echo "$as_me:$LINENO: checking for X11/extensions/Xrender.h" >&5 -echo $ECHO_N "checking for X11/extensions/Xrender.h... $ECHO_C" >&6 -if test "${ac_cv_header_X11_extensions_Xrender_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_Xrender_h" >&5 -echo "${ECHO_T}$ac_cv_header_X11_extensions_Xrender_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking X11/extensions/Xrender.h usability" >&5 -echo $ECHO_N "checking X11/extensions/Xrender.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking X11/extensions/Xrender.h presence" >&5 -echo $ECHO_N "checking X11/extensions/Xrender.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: X11/extensions/Xrender.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: X11/extensions/Xrender.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/extensions/Xrender.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: X11/extensions/Xrender.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: X11/extensions/Xrender.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: X11/extensions/Xrender.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/extensions/Xrender.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: X11/extensions/Xrender.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/extensions/Xrender.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: X11/extensions/Xrender.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/extensions/Xrender.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: X11/extensions/Xrender.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/extensions/Xrender.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: X11/extensions/Xrender.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/extensions/Xrender.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: X11/extensions/Xrender.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for X11/extensions/Xrender.h" >&5 -echo $ECHO_N "checking for X11/extensions/Xrender.h... $ECHO_C" >&6 -if test "${ac_cv_header_X11_extensions_Xrender_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_X11_extensions_Xrender_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_Xrender_h" >&5 -echo "${ECHO_T}$ac_cv_header_X11_extensions_Xrender_h" >&6 + ac_fn_c_check_header_mongrel "$LINENO" "X11/extensions/Xrender.h" "ac_cv_header_X11_extensions_Xrender_h" "$ac_includes_default" +if test "x$ac_cv_header_X11_extensions_Xrender_h" = x""yes; then : -fi -if test $ac_cv_header_X11_extensions_Xrender_h = yes; then - : else - { { echo "$as_me:$LINENO: error: Xrender not found. install X" >&5 -echo "$as_me: error: Xrender not found. install X" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Xrender not found. install X" "$LINENO" 5 fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_XRENDER_HEADERS=NO BUILD_TYPE="$BUILD_TYPE X11_EXTENSIONS" fi if test "$XRENDER_LINK" = "YES"; then - -echo "$as_me:$LINENO: checking for XRenderQueryVersion in -lXrender" >&5 -echo $ECHO_N "checking for XRenderQueryVersion in -lXrender... $ECHO_C" >&6 -if test "${ac_cv_lib_Xrender_XRenderQueryVersion+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XRenderQueryVersion in -lXrender" >&5 +$as_echo_n "checking for XRenderQueryVersion in -lXrender... " >&6; } +if test "${ac_cv_lib_Xrender_XRenderQueryVersion+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXrender $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char XRenderQueryVersion (); int main () { -XRenderQueryVersion (); +return XRenderQueryVersion (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xrender_XRenderQueryVersion=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_Xrender_XRenderQueryVersion=no + ac_cv_lib_Xrender_XRenderQueryVersion=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_Xrender_XRenderQueryVersion" >&5 -echo "${ECHO_T}$ac_cv_lib_Xrender_XRenderQueryVersion" >&6 -if test $ac_cv_lib_Xrender_XRenderQueryVersion = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xrender_XRenderQueryVersion" >&5 +$as_echo "$ac_cv_lib_Xrender_XRenderQueryVersion" >&6; } +if test "x$ac_cv_lib_Xrender_XRenderQueryVersion" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBXRENDER 1 _ACEOF @@ -21181,22 +16956,20 @@ _ACEOF LIBS="-lXrender $LIBS" else - { { echo "$as_me:$LINENO: error: libXrender not found or functional" >&5 -echo "$as_me: error: libXrender not found or functional" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "libXrender not found or functional" "$LINENO" 5 fi fi -echo "$as_me:$LINENO: checking whether to enable RandR support" >&5 -echo $ECHO_N "checking whether to enable RandR support... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable RandR support" >&5 +$as_echo_n "checking whether to enable RandR support... " >&6; } if test "$test_randr" = "yes" -a \( "$enable_randr" = "yes" -o "$enable_randr" = "TRUE" \) ; then if test -z "$enable_randr_link" -o "$enable_randr_link" = "no"; then XRANDR_DLOPEN="TRUE" - echo "$as_me:$LINENO: result: resorting to dlopen libXrandr at runtime" >&5 -echo "${ECHO_T}resorting to dlopen libXrandr at runtime" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: resorting to dlopen libXrandr at runtime" >&5 +$as_echo "resorting to dlopen libXrandr at runtime" >&6; } else XRANDR_DLOPEN="FALSE" @@ -21205,10 +16978,10 @@ echo "${ECHO_T}resorting to dlopen libXrandr at runtime" >&6 if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -21220,29 +16993,30 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -21253,25 +17027,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for xrandr >= 1.2" >&5 -echo $ECHO_N "checking for xrandr >= 1.2... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xrandr >= 1.2" >&5 +$as_echo_n "checking for xrandr >= 1.2... " >&6; } if $PKG_CONFIG --exists "xrandr >= 1.2" ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking XRANDR_CFLAGS" >&5 -echo $ECHO_N "checking XRANDR_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking XRANDR_CFLAGS" >&5 +$as_echo_n "checking XRANDR_CFLAGS... " >&6; } XRANDR_CFLAGS=`$PKG_CONFIG --cflags "xrandr >= 1.2"` - echo "$as_me:$LINENO: result: $XRANDR_CFLAGS" >&5 -echo "${ECHO_T}$XRANDR_CFLAGS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XRANDR_CFLAGS" >&5 +$as_echo "$XRANDR_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking XRANDR_LIBS" >&5 -echo $ECHO_N "checking XRANDR_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking XRANDR_LIBS" >&5 +$as_echo_n "checking XRANDR_LIBS... " >&6; } XRANDR_LIBS=`$PKG_CONFIG --libs "xrandr >= 1.2"` - echo "$as_me:$LINENO: result: $XRANDR_LIBS" >&5 -echo "${ECHO_T}$XRANDR_LIBS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XRANDR_LIBS" >&5 +$as_echo "$XRANDR_LIBS" >&6; } else XRANDR_CFLAGS="" XRANDR_LIBS="" @@ -21283,232 +17057,65 @@ echo "${ECHO_T}$XRANDR_LIBS" >&6 - else - echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." - echo "*** See http://www.freedesktop.org/software/pkgconfig" - fi - fi - - if test $succeeded = yes; then - ENABLE_RANDR="TRUE" - else - ENABLE_RANDR="" - fi - - if test "$ENABLE_RANDR" != "TRUE"; then - if test "${ac_cv_header_X11_extensions_Xrandr_h+set}" = set; then - echo "$as_me:$LINENO: checking for X11/extensions/Xrandr.h" >&5 -echo $ECHO_N "checking for X11/extensions/Xrandr.h... $ECHO_C" >&6 -if test "${ac_cv_header_X11_extensions_Xrandr_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_Xrandr_h" >&5 -echo "${ECHO_T}$ac_cv_header_X11_extensions_Xrandr_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking X11/extensions/Xrandr.h usability" >&5 -echo $ECHO_N "checking X11/extensions/Xrandr.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking X11/extensions/Xrandr.h presence" >&5 -echo $ECHO_N "checking X11/extensions/Xrandr.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= + else + echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." + echo "*** See http://www.freedesktop.org/software/pkgconfig" + fi fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 + if test $succeeded = yes; then + ENABLE_RANDR="TRUE" + else + ENABLE_RANDR="" + fi -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: X11/extensions/Xrandr.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: X11/extensions/Xrandr.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/extensions/Xrandr.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: X11/extensions/Xrandr.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: X11/extensions/Xrandr.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: X11/extensions/Xrandr.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/extensions/Xrandr.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: X11/extensions/Xrandr.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/extensions/Xrandr.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: X11/extensions/Xrandr.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/extensions/Xrandr.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: X11/extensions/Xrandr.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/extensions/Xrandr.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: X11/extensions/Xrandr.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/extensions/Xrandr.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: X11/extensions/Xrandr.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for X11/extensions/Xrandr.h" >&5 -echo $ECHO_N "checking for X11/extensions/Xrandr.h... $ECHO_C" >&6 -if test "${ac_cv_header_X11_extensions_Xrandr_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_X11_extensions_Xrandr_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_Xrandr_h" >&5 -echo "${ECHO_T}$ac_cv_header_X11_extensions_Xrandr_h" >&6 + if test "$ENABLE_RANDR" != "TRUE"; then + ac_fn_c_check_header_mongrel "$LINENO" "X11/extensions/Xrandr.h" "ac_cv_header_X11_extensions_Xrandr_h" "$ac_includes_default" +if test "x$ac_cv_header_X11_extensions_Xrandr_h" = x""yes; then : -fi -if test $ac_cv_header_X11_extensions_Xrandr_h = yes; then - : else - { { echo "$as_me:$LINENO: error: X11/extensions/Xrandr.h could not be found. X11 dev missing?" >&5 -echo "$as_me: error: X11/extensions/Xrandr.h could not be found. X11 dev missing?" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "X11/extensions/Xrandr.h could not be found. X11 dev missing?" "$LINENO" 5 fi XRANDR_CFLAGS=" " - -echo "$as_me:$LINENO: checking for XRRQueryExtension in -lXrandr" >&5 -echo $ECHO_N "checking for XRRQueryExtension in -lXrandr... $ECHO_C" >&6 -if test "${ac_cv_lib_Xrandr_XRRQueryExtension+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XRRQueryExtension in -lXrandr" >&5 +$as_echo_n "checking for XRRQueryExtension in -lXrandr... " >&6; } +if test "${ac_cv_lib_Xrandr_XRRQueryExtension+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXrandr $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char XRRQueryExtension (); int main () { -XRRQueryExtension (); +return XRRQueryExtension (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xrandr_XRRQueryExtension=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_Xrandr_XRRQueryExtension=no + ac_cv_lib_Xrandr_XRRQueryExtension=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_Xrandr_XRRQueryExtension" >&5 -echo "${ECHO_T}$ac_cv_lib_Xrandr_XRRQueryExtension" >&6 -if test $ac_cv_lib_Xrandr_XRRQueryExtension = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xrandr_XRRQueryExtension" >&5 +$as_echo "$ac_cv_lib_Xrandr_XRRQueryExtension" >&6; } +if test "x$ac_cv_lib_Xrandr_XRRQueryExtension" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBXRANDR 1 _ACEOF @@ -21516,53 +17123,51 @@ _ACEOF LIBS="-lXrandr $LIBS" else - { { echo "$as_me:$LINENO: error: libXrandr not found or functional" >&5 -echo "$as_me: error: libXrandr not found or functional" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "libXrandr not found or functional" "$LINENO" 5 fi XRANDR_LIBS="-lXrandr " ENABLE_RANDR="TRUE" - echo "$as_me:$LINENO: result: enabling RandR support" >&5 -echo "${ECHO_T}enabling RandR support" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabling RandR support" >&5 +$as_echo "enabling RandR support" >&6; } fi fi else ENABLE_RANDR="" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -echo "$as_me:$LINENO: checking whether to use neon" >&5 -echo $ECHO_N "checking whether to use neon... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use neon" >&5 +$as_echo_n "checking whether to use neon... " >&6; } if test "$enable_neon" = "no"; then - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } DISABLE_NEON=TRUE else - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 -echo "$as_me:$LINENO: checking which neon to use" >&5 -echo $ECHO_N "checking which neon to use... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which neon to use" >&5 +$as_echo_n "checking which neon to use... " >&6; } if test -n "$with_system_neon" -o -n "$with_system_libs" && \ test "$with_system_neon" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 +$as_echo "external" >&6; } succeeded=no if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -21574,29 +17179,30 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -21607,25 +17213,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for neon >= 0.24.0" >&5 -echo $ECHO_N "checking for neon >= 0.24.0... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for neon >= 0.24.0" >&5 +$as_echo_n "checking for neon >= 0.24.0... " >&6; } if $PKG_CONFIG --exists "neon >= 0.24.0" ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking NEON_CFLAGS" >&5 -echo $ECHO_N "checking NEON_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking NEON_CFLAGS" >&5 +$as_echo_n "checking NEON_CFLAGS... " >&6; } NEON_CFLAGS=`$PKG_CONFIG --cflags "neon >= 0.24.0"` - echo "$as_me:$LINENO: result: $NEON_CFLAGS" >&5 -echo "${ECHO_T}$NEON_CFLAGS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NEON_CFLAGS" >&5 +$as_echo "$NEON_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking NEON_LIBS" >&5 -echo $ECHO_N "checking NEON_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking NEON_LIBS" >&5 +$as_echo_n "checking NEON_LIBS... " >&6; } NEON_LIBS=`$PKG_CONFIG --libs "neon >= 0.24.0"` - echo "$as_me:$LINENO: result: $NEON_LIBS" >&5 -echo "${ECHO_T}$NEON_LIBS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NEON_LIBS" >&5 +$as_echo "$NEON_LIBS" >&6; } else NEON_CFLAGS="" NEON_LIBS="" @@ -21646,17 +17252,15 @@ echo "${ECHO_T}$NEON_LIBS" >&6 if test $succeeded = yes; then : else - { { echo "$as_me:$LINENO: error: you need neon >= 0.24.x for system-neon" >&5 -echo "$as_me: error: you need neon >= 0.24.x for system-neon" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "you need neon >= 0.24.x for system-neon" "$LINENO" 5 fi NEON_VERSION="`$PKG_CONFIG --modversion neon | $SED 's/\.//g'`" NEON_CFLAGS="$NEON_CFLAGS -DSYSTEM_NEON -DUSE_DAV_LOCKS=1" SYSTEM_NEON=YES else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_NEON=NO NEON_LIBS=-lneon NEON_CFLAGS= @@ -21671,12 +17275,12 @@ fi if test "$_os" = "Darwin" && test "$with_system_openssl" != "no"; then with_system_openssl=yes fi -echo "$as_me:$LINENO: checking which libssl to use" >&5 -echo $ECHO_N "checking which libssl to use... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which libssl to use" >&5 +$as_echo_n "checking which libssl to use... " >&6; } if test -n "$with_system_openssl" -o -n "$with_system_libs" && \ test "$with_system_openssl" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 +$as_echo "external" >&6; } # Mac OS builds should get out without extra stuff is the Mac porters' # wish. And pkg-config is although Xcode ships a .pc for openssl if test "$_os" = "Darwin"; then @@ -21689,10 +17293,10 @@ echo "${ECHO_T}external" >&6 if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -21704,29 +17308,30 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -21737,25 +17342,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for openssl " >&5 -echo $ECHO_N "checking for openssl ... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openssl " >&5 +$as_echo_n "checking for openssl ... " >&6; } if $PKG_CONFIG --exists "openssl " ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking OPENSSL_CFLAGS" >&5 -echo $ECHO_N "checking OPENSSL_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking OPENSSL_CFLAGS" >&5 +$as_echo_n "checking OPENSSL_CFLAGS... " >&6; } OPENSSL_CFLAGS=`$PKG_CONFIG --cflags "openssl "` - echo "$as_me:$LINENO: result: $OPENSSL_CFLAGS" >&5 -echo "${ECHO_T}$OPENSSL_CFLAGS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OPENSSL_CFLAGS" >&5 +$as_echo "$OPENSSL_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking OPENSSL_LIBS" >&5 -echo $ECHO_N "checking OPENSSL_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking OPENSSL_LIBS" >&5 +$as_echo_n "checking OPENSSL_LIBS... " >&6; } OPENSSL_LIBS=`$PKG_CONFIG --libs "openssl "` - echo "$as_me:$LINENO: result: $OPENSSL_LIBS" >&5 -echo "${ECHO_T}$OPENSSL_LIBS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OPENSSL_LIBS" >&5 +$as_echo "$OPENSSL_LIBS" >&6; } else OPENSSL_CFLAGS="" OPENSSL_LIBS="" @@ -21776,16 +17381,14 @@ echo "${ECHO_T}$OPENSSL_LIBS" >&6 if test $succeeded = yes; then : else - { { echo "$as_me:$LINENO: error: Library requirements (openssl ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 -echo "$as_me: error: Library requirements (openssl ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Library requirements (openssl ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." "$LINENO" 5 fi fi SYSTEM_OPENSSL=YES else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_OPENSSL=NO BUILD_TYPE="$BUILD_TYPE OPENSSL" fi @@ -21793,33 +17396,33 @@ fi -echo "$as_me:$LINENO: checking whether to enable agg" >&5 -echo $ECHO_N "checking whether to enable agg... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable agg" >&5 +$as_echo_n "checking whether to enable agg... " >&6; } if test "$with_agg" = "no"; then - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } else - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } ENABLE_AGG=YES - echo "$as_me:$LINENO: checking which AGG to use" >&5 -echo $ECHO_N "checking which AGG to use... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking which AGG to use" >&5 +$as_echo_n "checking which AGG to use... " >&6; } if test -n "$with_system_agg" -o -n "$with_system_libs" && \ test "$with_system_agg" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 +$as_echo "external" >&6; } succeeded=no if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -21831,29 +17434,30 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -21864,25 +17468,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for libagg >= 2.3" >&5 -echo $ECHO_N "checking for libagg >= 2.3... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libagg >= 2.3" >&5 +$as_echo_n "checking for libagg >= 2.3... " >&6; } if $PKG_CONFIG --exists "libagg >= 2.3" ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking AGG_CFLAGS" >&5 -echo $ECHO_N "checking AGG_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking AGG_CFLAGS" >&5 +$as_echo_n "checking AGG_CFLAGS... " >&6; } AGG_CFLAGS=`$PKG_CONFIG --cflags "libagg >= 2.3"` - echo "$as_me:$LINENO: result: $AGG_CFLAGS" >&5 -echo "${ECHO_T}$AGG_CFLAGS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AGG_CFLAGS" >&5 +$as_echo "$AGG_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking AGG_LIBS" >&5 -echo $ECHO_N "checking AGG_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking AGG_LIBS" >&5 +$as_echo_n "checking AGG_LIBS... " >&6; } AGG_LIBS=`$PKG_CONFIG --libs "libagg >= 2.3"` - echo "$as_me:$LINENO: result: $AGG_LIBS" >&5 -echo "${ECHO_T}$AGG_LIBS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AGG_LIBS" >&5 +$as_echo "$AGG_LIBS" >&6; } else AGG_CFLAGS="" AGG_LIBS="" @@ -21903,13 +17507,11 @@ echo "${ECHO_T}$AGG_LIBS" >&6 if test $succeeded = yes; then : else - { { echo "$as_me:$LINENO: error: Library requirements (libagg >= 2.3) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 -echo "$as_me: error: Library requirements (libagg >= 2.3) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Library requirements (libagg >= 2.3) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." "$LINENO" 5 fi - echo "$as_me:$LINENO: checking agg version" >&5 -echo $ECHO_N "checking agg version... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking agg version" >&5 +$as_echo_n "checking agg version... " >&6; } # workaround; if AGG_CFLAGS is empty (broken libagg.pc in 2.3), add /usr/include/agg2 anyway # (/usr/include gets stripped from pkg-config output) if test -z "$AGG_CFLAGS" || test "$AGG_CFLAGS" = " "; then @@ -21921,23 +17523,21 @@ echo $ECHO_N "checking agg version... $ECHO_C" >&6 $PKG_CONFIG --modversion libagg | grep -q 2.4; then # 2.4's libagg.pc.in still contains 2.3 :/ if $EGREP -q "Version 2.4" `echo $AGG_INCDIR`/agg_basics.h; then - echo "$as_me:$LINENO: result: 2.4" >&5 -echo "${ECHO_T}2.4" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: 2.4" >&5 +$as_echo "2.4" >&6; } AGG_VERSION=2400 else - echo "$as_me:$LINENO: result: 2.3" >&5 -echo "${ECHO_T}2.3" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: 2.3" >&5 +$as_echo "2.3" >&6; } AGG_VERSION=2300 fi SYSTEM_AGG=YES else - { { echo "$as_me:$LINENO: error: only agg 2.3 and 2.4 are supported" >&5 -echo "$as_me: error: only agg 2.3 and 2.4 are supported" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "only agg 2.3 and 2.4 are supported" "$LINENO" 5 fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_AGG=NO AGG_VERSION=2300 BUILD_TYPE="$BUILD_TYPE AGG" @@ -21946,12 +17546,12 @@ echo "${ECHO_T}internal" >&6 fi -echo "$as_me:$LINENO: checking which redland library to use" >&5 -echo $ECHO_N "checking which redland library to use... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which redland library to use" >&5 +$as_echo_n "checking which redland library to use... " >&6; } if test -n "$with_system_redland" && \ test "$with_system_redland" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_REDLAND=YES succeeded=no @@ -21959,10 +17559,10 @@ echo "${ECHO_T}external" >&6 if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -21974,29 +17574,30 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -22007,25 +17608,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for redland" >&5 -echo $ECHO_N "checking for redland... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for redland" >&5 +$as_echo_n "checking for redland... " >&6; } if $PKG_CONFIG --exists "redland" ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking REDLAND_CFLAGS" >&5 -echo $ECHO_N "checking REDLAND_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking REDLAND_CFLAGS" >&5 +$as_echo_n "checking REDLAND_CFLAGS... " >&6; } REDLAND_CFLAGS=`$PKG_CONFIG --cflags "redland"` - echo "$as_me:$LINENO: result: $REDLAND_CFLAGS" >&5 -echo "${ECHO_T}$REDLAND_CFLAGS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $REDLAND_CFLAGS" >&5 +$as_echo "$REDLAND_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking REDLAND_LIBS" >&5 -echo $ECHO_N "checking REDLAND_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking REDLAND_LIBS" >&5 +$as_echo_n "checking REDLAND_LIBS... " >&6; } REDLAND_LIBS=`$PKG_CONFIG --libs "redland"` - echo "$as_me:$LINENO: result: $REDLAND_LIBS" >&5 -echo "${ECHO_T}$REDLAND_LIBS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $REDLAND_LIBS" >&5 +$as_echo "$REDLAND_LIBS" >&6; } else REDLAND_CFLAGS="" REDLAND_LIBS="" @@ -22046,28 +17647,26 @@ echo "${ECHO_T}$REDLAND_LIBS" >&6 if test $succeeded = yes; then : else - { { echo "$as_me:$LINENO: error: Library requirements (redland) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 -echo "$as_me: error: Library requirements (redland) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Library requirements (redland) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." "$LINENO" 5 fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 +$as_echo "internal" >&6; } BUILD_TYPE="$BUILD_TYPE REDLAND" SYSTEM_REDLAND=NO fi -echo "$as_me:$LINENO: checking which libhunspell to use" >&5 -echo $ECHO_N "checking which libhunspell to use... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which libhunspell to use" >&5 +$as_echo_n "checking which libhunspell to use... " >&6; } if test -n "$with_system_hunspell" -o -n "$with_system_libs" && \ test "$with_system_hunspell" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_HUNSPELL=YES - ac_ext=cc + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -22079,10 +17678,10 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -22094,29 +17693,30 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -22127,25 +17727,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for hunspell" >&5 -echo $ECHO_N "checking for hunspell... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hunspell" >&5 +$as_echo_n "checking for hunspell... " >&6; } if $PKG_CONFIG --exists "hunspell" ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking HUNSPELL_CFLAGS" >&5 -echo $ECHO_N "checking HUNSPELL_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking HUNSPELL_CFLAGS" >&5 +$as_echo_n "checking HUNSPELL_CFLAGS... " >&6; } HUNSPELL_CFLAGS=`$PKG_CONFIG --cflags "hunspell"` - echo "$as_me:$LINENO: result: $HUNSPELL_CFLAGS" >&5 -echo "${ECHO_T}$HUNSPELL_CFLAGS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HUNSPELL_CFLAGS" >&5 +$as_echo "$HUNSPELL_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking HUNSPELL_LIBS" >&5 -echo $ECHO_N "checking HUNSPELL_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking HUNSPELL_LIBS" >&5 +$as_echo_n "checking HUNSPELL_LIBS... " >&6; } HUNSPELL_LIBS=`$PKG_CONFIG --libs "hunspell"` - echo "$as_me:$LINENO: result: $HUNSPELL_LIBS" >&5 -echo "${ECHO_T}$HUNSPELL_LIBS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HUNSPELL_LIBS" >&5 +$as_echo "$HUNSPELL_LIBS" >&6; } else HUNSPELL_CFLAGS="" HUNSPELL_LIBS="" @@ -22170,290 +17770,16 @@ echo "${ECHO_T}$HUNSPELL_LIBS" >&6 fi if test "$HUNSPELL_PC" != "TRUE"; then - if test "${ac_cv_header_hunspell_hxx+set}" = set; then - echo "$as_me:$LINENO: checking for hunspell.hxx" >&5 -echo $ECHO_N "checking for hunspell.hxx... $ECHO_C" >&6 -if test "${ac_cv_header_hunspell_hxx+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_hunspell_hxx" >&5 -echo "${ECHO_T}$ac_cv_header_hunspell_hxx" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking hunspell.hxx usability" >&5 -echo $ECHO_N "checking hunspell.hxx usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking hunspell.hxx presence" >&5 -echo $ECHO_N "checking hunspell.hxx presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: hunspell.hxx: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: hunspell.hxx: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: hunspell.hxx: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: hunspell.hxx: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: hunspell.hxx: present but cannot be compiled" >&5 -echo "$as_me: WARNING: hunspell.hxx: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: hunspell.hxx: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: hunspell.hxx: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: hunspell.hxx: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: hunspell.hxx: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: hunspell.hxx: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: hunspell.hxx: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: hunspell.hxx: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: hunspell.hxx: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: hunspell.hxx: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: hunspell.hxx: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for hunspell.hxx" >&5 -echo $ECHO_N "checking for hunspell.hxx... $ECHO_C" >&6 -if test "${ac_cv_header_hunspell_hxx+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_hunspell_hxx=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_hunspell_hxx" >&5 -echo "${ECHO_T}$ac_cv_header_hunspell_hxx" >&6 - -fi -if test $ac_cv_header_hunspell_hxx = yes; then - : -else - - if test "${ac_cv_header_hunspell_hunspell_hxx+set}" = set; then - echo "$as_me:$LINENO: checking for hunspell/hunspell.hxx" >&5 -echo $ECHO_N "checking for hunspell/hunspell.hxx... $ECHO_C" >&6 -if test "${ac_cv_header_hunspell_hunspell_hxx+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_hunspell_hunspell_hxx" >&5 -echo "${ECHO_T}$ac_cv_header_hunspell_hunspell_hxx" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking hunspell/hunspell.hxx usability" >&5 -echo $ECHO_N "checking hunspell/hunspell.hxx usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking hunspell/hunspell.hxx presence" >&5 -echo $ECHO_N "checking hunspell/hunspell.hxx presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_cxx_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 + ac_fn_cxx_check_header_mongrel "$LINENO" "hunspell.hxx" "ac_cv_header_hunspell_hxx" "$ac_includes_default" +if test "x$ac_cv_header_hunspell_hxx" = x""yes; then : -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: hunspell/hunspell.hxx: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: hunspell/hunspell.hxx: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: hunspell/hunspell.hxx: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: hunspell/hunspell.hxx: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: hunspell/hunspell.hxx: present but cannot be compiled" >&5 -echo "$as_me: WARNING: hunspell/hunspell.hxx: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: hunspell/hunspell.hxx: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: hunspell/hunspell.hxx: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: hunspell/hunspell.hxx: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: hunspell/hunspell.hxx: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: hunspell/hunspell.hxx: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: hunspell/hunspell.hxx: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: hunspell/hunspell.hxx: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: hunspell/hunspell.hxx: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: hunspell/hunspell.hxx: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: hunspell/hunspell.hxx: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for hunspell/hunspell.hxx" >&5 -echo $ECHO_N "checking for hunspell/hunspell.hxx... $ECHO_C" >&6 -if test "${ac_cv_header_hunspell_hunspell_hxx+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_header_hunspell_hunspell_hxx=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_hunspell_hunspell_hxx" >&5 -echo "${ECHO_T}$ac_cv_header_hunspell_hunspell_hxx" >&6 -fi -if test $ac_cv_header_hunspell_hunspell_hxx = yes; then + ac_fn_cxx_check_header_mongrel "$LINENO" "hunspell/hunspell.hxx" "ac_cv_header_hunspell_hunspell_hxx" "$ac_includes_default" +if test "x$ac_cv_header_hunspell_hunspell_hxx" = x""yes; then : HUNSPELL_CFLAGS=-I/usr/include/hunspell else - { { echo "$as_me:$LINENO: error: hunspell headers not found." >&5 -echo "$as_me: error: hunspell headers not found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "hunspell headers not found." "$LINENO" 5 fi @@ -22461,66 +17787,37 @@ fi fi - -echo "$as_me:$LINENO: checking for main in -lhunspell" >&5 -echo $ECHO_N "checking for main in -lhunspell... $ECHO_C" >&6 -if test "${ac_cv_lib_hunspell_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lhunspell" >&5 +$as_echo_n "checking for main in -lhunspell... " >&6; } +if test "${ac_cv_lib_hunspell_main+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lhunspell $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { -main (); +return main (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_cxx_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_hunspell_main=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_hunspell_main=no + ac_cv_lib_hunspell_main=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_hunspell_main" >&5 -echo "${ECHO_T}$ac_cv_lib_hunspell_main" >&6 -if test $ac_cv_lib_hunspell_main = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hunspell_main" >&5 +$as_echo "$ac_cv_lib_hunspell_main" >&6; } +if test "x$ac_cv_lib_hunspell_main" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBHUNSPELL 1 _ACEOF @@ -22528,9 +17825,7 @@ _ACEOF LIBS="-lhunspell $LIBS" else - { { echo "$as_me:$LINENO: error: hunspell library not found." >&5 -echo "$as_me: error: hunspell library not found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "hunspell library not found." "$LINENO" 5 fi HUNSPELL_LIBS=-lhunspell @@ -22542,719 +17837,221 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_HUNSPELL=NO BUILD_TYPE="$BUILD_TYPE HUNSPELL" fi - -echo "$as_me:$LINENO: checking which altlinuxhyph to use" >&5 -echo $ECHO_N "checking which altlinuxhyph to use... $ECHO_C" >&6 -if test -n "$with_system_altlinuxhyph" -o -n "$with_system_libs" && \ - test "$with_system_altlinuxhyph" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 - SYSTEM_HYPH=YES - if test "${ac_cv_header_hyphen_h+set}" = set; then - echo "$as_me:$LINENO: checking for hyphen.h" >&5 -echo $ECHO_N "checking for hyphen.h... $ECHO_C" >&6 -if test "${ac_cv_header_hyphen_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_hyphen_h" >&5 -echo "${ECHO_T}$ac_cv_header_hyphen_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking hyphen.h usability" >&5 -echo $ECHO_N "checking hyphen.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking hyphen.h presence" >&5 -echo $ECHO_N "checking hyphen.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: hyphen.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: hyphen.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: hyphen.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: hyphen.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: hyphen.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: hyphen.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: hyphen.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: hyphen.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: hyphen.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: hyphen.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: hyphen.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: hyphen.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: hyphen.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: hyphen.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: hyphen.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: hyphen.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for hyphen.h" >&5 -echo $ECHO_N "checking for hyphen.h... $ECHO_C" >&6 -if test "${ac_cv_header_hyphen_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_hyphen_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_hyphen_h" >&5 -echo "${ECHO_T}$ac_cv_header_hyphen_h" >&6 - -fi -if test $ac_cv_header_hyphen_h = yes; then - : -else - { { echo "$as_me:$LINENO: error: altlinuxhyph headers not found." >&5 -echo "$as_me: error: altlinuxhyph headers not found." >&2;} - { (exit 1); exit 1; }; } -fi - - - echo "$as_me:$LINENO: checking for struct _HyphenDict.cset" >&5 -echo $ECHO_N "checking for struct _HyphenDict.cset... $ECHO_C" >&6 -if test "${ac_cv_member_struct__HyphenDict_cset+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -int -main () -{ -static struct _HyphenDict ac_aggr; -if (ac_aggr.cset) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_member_struct__HyphenDict_cset=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -int -main () -{ -static struct _HyphenDict ac_aggr; -if (sizeof ac_aggr.cset) -return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_member_struct__HyphenDict_cset=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_member_struct__HyphenDict_cset=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which altlinuxhyph to use" >&5 +$as_echo_n "checking which altlinuxhyph to use... " >&6; } +if test -n "$with_system_altlinuxhyph" -o -n "$with_system_libs" && \ + test "$with_system_altlinuxhyph" != "no"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 +$as_echo "external" >&6; } + SYSTEM_HYPH=YES + ac_fn_c_check_header_mongrel "$LINENO" "hyphen.h" "ac_cv_header_hyphen_h" "$ac_includes_default" +if test "x$ac_cv_header_hyphen_h" = x""yes; then : + +else + as_fn_error "altlinuxhyph headers not found." "$LINENO" 5 fi -echo "$as_me:$LINENO: result: $ac_cv_member_struct__HyphenDict_cset" >&5 -echo "${ECHO_T}$ac_cv_member_struct__HyphenDict_cset" >&6 -if test $ac_cv_member_struct__HyphenDict_cset = yes; then - : + + + ac_fn_c_check_member "$LINENO" "struct _HyphenDict" "cset" "ac_cv_member_struct__HyphenDict_cset" "#include +" +if test "x$ac_cv_member_struct__HyphenDict_cset" = x""yes; then : + else - { { echo "$as_me:$LINENO: error: no. You are sure you have altlinuyhyph headers?" >&5 -echo "$as_me: error: no. You are sure you have altlinuyhyph headers?" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "no. You are sure you have altlinuyhyph headers?" "$LINENO" 5 fi - echo "$as_me:$LINENO: checking for hnj_hyphen_hyphenate2 in -lhyphen" >&5 -echo $ECHO_N "checking for hnj_hyphen_hyphenate2 in -lhyphen... $ECHO_C" >&6 -if test "${ac_cv_lib_hyphen_hnj_hyphen_hyphenate2+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hnj_hyphen_hyphenate2 in -lhyphen" >&5 +$as_echo_n "checking for hnj_hyphen_hyphenate2 in -lhyphen... " >&6; } +if test "${ac_cv_lib_hyphen_hnj_hyphen_hyphenate2+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lhyphen $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char hnj_hyphen_hyphenate2 (); int main () { -hnj_hyphen_hyphenate2 (); +return hnj_hyphen_hyphenate2 (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_hyphen_hnj_hyphen_hyphenate2=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_hyphen_hnj_hyphen_hyphenate2=no + ac_cv_lib_hyphen_hnj_hyphen_hyphenate2=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_hyphen_hnj_hyphen_hyphenate2" >&5 -echo "${ECHO_T}$ac_cv_lib_hyphen_hnj_hyphen_hyphenate2" >&6 -if test $ac_cv_lib_hyphen_hnj_hyphen_hyphenate2 = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hyphen_hnj_hyphen_hyphenate2" >&5 +$as_echo "$ac_cv_lib_hyphen_hnj_hyphen_hyphenate2" >&6; } +if test "x$ac_cv_lib_hyphen_hnj_hyphen_hyphenate2" = x""yes; then : HYPHEN_LIB=-lhyphen else - { { echo "$as_me:$LINENO: error: altlinuxhyph library not found or too old." >&5 -echo "$as_me: error: altlinuxhyph library not found or too old." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "altlinuxhyph library not found or too old." "$LINENO" 5 fi if test -z "$HYPHEN_LIB"; then - echo "$as_me:$LINENO: checking for hnj_hyphen_hyphenate2 in -lhyph" >&5 -echo $ECHO_N "checking for hnj_hyphen_hyphenate2 in -lhyph... $ECHO_C" >&6 -if test "${ac_cv_lib_hyph_hnj_hyphen_hyphenate2+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hnj_hyphen_hyphenate2 in -lhyph" >&5 +$as_echo_n "checking for hnj_hyphen_hyphenate2 in -lhyph... " >&6; } +if test "${ac_cv_lib_hyph_hnj_hyphen_hyphenate2+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lhyph $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char hnj_hyphen_hyphenate2 (); int main () { -hnj_hyphen_hyphenate2 (); +return hnj_hyphen_hyphenate2 (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_hyph_hnj_hyphen_hyphenate2=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_hyph_hnj_hyphen_hyphenate2=no + ac_cv_lib_hyph_hnj_hyphen_hyphenate2=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_hyph_hnj_hyphen_hyphenate2" >&5 -echo "${ECHO_T}$ac_cv_lib_hyph_hnj_hyphen_hyphenate2" >&6 -if test $ac_cv_lib_hyph_hnj_hyphen_hyphenate2 = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hyph_hnj_hyphen_hyphenate2" >&5 +$as_echo "$ac_cv_lib_hyph_hnj_hyphen_hyphenate2" >&6; } +if test "x$ac_cv_lib_hyph_hnj_hyphen_hyphenate2" = x""yes; then : HYPHEN_LIB=-lhyph else - { { echo "$as_me:$LINENO: error: altlinuxhyph library not found or too old." >&5 -echo "$as_me: error: altlinuxhyph library not found or too old." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "altlinuxhyph library not found or too old." "$LINENO" 5 fi fi if test -z "$HYPHEN_LIB"; then - echo "$as_me:$LINENO: checking for hnj_hyphen_hyphenate2 in -lhnj" >&5 -echo $ECHO_N "checking for hnj_hyphen_hyphenate2 in -lhnj... $ECHO_C" >&6 -if test "${ac_cv_lib_hnj_hnj_hyphen_hyphenate2+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hnj_hyphen_hyphenate2 in -lhnj" >&5 +$as_echo_n "checking for hnj_hyphen_hyphenate2 in -lhnj... " >&6; } +if test "${ac_cv_lib_hnj_hnj_hyphen_hyphenate2+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lhnj $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char hnj_hyphen_hyphenate2 (); int main () { -hnj_hyphen_hyphenate2 (); +return hnj_hyphen_hyphenate2 (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_hnj_hnj_hyphen_hyphenate2=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_hnj_hnj_hyphen_hyphenate2=no + ac_cv_lib_hnj_hnj_hyphen_hyphenate2=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_hnj_hnj_hyphen_hyphenate2" >&5 -echo "${ECHO_T}$ac_cv_lib_hnj_hnj_hyphen_hyphenate2" >&6 -if test $ac_cv_lib_hnj_hnj_hyphen_hyphenate2 = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hnj_hnj_hyphen_hyphenate2" >&5 +$as_echo "$ac_cv_lib_hnj_hnj_hyphen_hyphenate2" >&6; } +if test "x$ac_cv_lib_hnj_hnj_hyphen_hyphenate2" = x""yes; then : HYPHEN_LIB=-lhnj else - { { echo "$as_me:$LINENO: error: altlinuxhyph library not found or too old." >&5 -echo "$as_me: error: altlinuxhyph library not found or too old." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "altlinuxhyph library not found or too old." "$LINENO" 5 fi fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_HYPH=NO fi -echo "$as_me:$LINENO: checking which mythes to use" >&5 -echo $ECHO_N "checking which mythes to use... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which mythes to use" >&5 +$as_echo_n "checking which mythes to use... " >&6; } if test -n "$with_system_mythes" && test "$with_system_mythes" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_MYTHES=YES - if test "${ac_cv_header_mythes_hxx+set}" = set; then - echo "$as_me:$LINENO: checking for mythes.hxx" >&5 -echo $ECHO_N "checking for mythes.hxx... $ECHO_C" >&6 -if test "${ac_cv_header_mythes_hxx+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_mythes_hxx" >&5 -echo "${ECHO_T}$ac_cv_header_mythes_hxx" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking mythes.hxx usability" >&5 -echo $ECHO_N "checking mythes.hxx usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking mythes.hxx presence" >&5 -echo $ECHO_N "checking mythes.hxx presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: mythes.hxx: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: mythes.hxx: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: mythes.hxx: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: mythes.hxx: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: mythes.hxx: present but cannot be compiled" >&5 -echo "$as_me: WARNING: mythes.hxx: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: mythes.hxx: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: mythes.hxx: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: mythes.hxx: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: mythes.hxx: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: mythes.hxx: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: mythes.hxx: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: mythes.hxx: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: mythes.hxx: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: mythes.hxx: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: mythes.hxx: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for mythes.hxx" >&5 -echo $ECHO_N "checking for mythes.hxx... $ECHO_C" >&6 -if test "${ac_cv_header_mythes_hxx+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_mythes_hxx=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_mythes_hxx" >&5 -echo "${ECHO_T}$ac_cv_header_mythes_hxx" >&6 + ac_fn_c_check_header_mongrel "$LINENO" "mythes.hxx" "ac_cv_header_mythes_hxx" "$ac_includes_default" +if test "x$ac_cv_header_mythes_hxx" = x""yes; then : -fi -if test $ac_cv_header_mythes_hxx = yes; then - : else - { { echo "$as_me:$LINENO: error: mythes.hxx headers not found." >&5 -echo "$as_me: error: mythes.hxx headers not found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "mythes.hxx headers not found." "$LINENO" 5 fi - -echo "$as_me:$LINENO: checking for main in -lmythes" >&5 -echo $ECHO_N "checking for main in -lmythes... $ECHO_C" >&6 -if test "${ac_cv_lib_mythes_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lmythes" >&5 +$as_echo_n "checking for main in -lmythes... " >&6; } +if test "${ac_cv_lib_mythes_main+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmythes $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { -main (); +return main (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mythes_main=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_mythes_main=no + ac_cv_lib_mythes_main=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_mythes_main" >&5 -echo "${ECHO_T}$ac_cv_lib_mythes_main" >&6 -if test $ac_cv_lib_mythes_main = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mythes_main" >&5 +$as_echo "$ac_cv_lib_mythes_main" >&6; } +if test "x$ac_cv_lib_mythes_main" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBMYTHES 1 _ACEOF @@ -23262,237 +18059,68 @@ _ACEOF LIBS="-lmythes $LIBS" else - { { echo "$as_me:$LINENO: error: mythes library not found." >&5 -echo "$as_me: error: mythes library not found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "mythes library not found." "$LINENO" 5 fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_MYTHES=NO fi -echo "$as_me:$LINENO: checking which lpsolve to use" >&5 -echo $ECHO_N "checking which lpsolve to use... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which lpsolve to use" >&5 +$as_echo_n "checking which lpsolve to use... " >&6; } if test -n "$with_system_lpsolve" -o -n "$with_system_libs" && \ test "$with_system_lpsolve" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_LPSOLVE=YES - if test "${ac_cv_header_lpsolve_lp_lib_h+set}" = set; then - echo "$as_me:$LINENO: checking for lpsolve/lp_lib.h" >&5 -echo $ECHO_N "checking for lpsolve/lp_lib.h... $ECHO_C" >&6 -if test "${ac_cv_header_lpsolve_lp_lib_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_lpsolve_lp_lib_h" >&5 -echo "${ECHO_T}$ac_cv_header_lpsolve_lp_lib_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking lpsolve/lp_lib.h usability" >&5 -echo $ECHO_N "checking lpsolve/lp_lib.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking lpsolve/lp_lib.h presence" >&5 -echo $ECHO_N "checking lpsolve/lp_lib.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: lpsolve/lp_lib.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: lpsolve/lp_lib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: lpsolve/lp_lib.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: lpsolve/lp_lib.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: lpsolve/lp_lib.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: lpsolve/lp_lib.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: lpsolve/lp_lib.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: lpsolve/lp_lib.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: lpsolve/lp_lib.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: lpsolve/lp_lib.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: lpsolve/lp_lib.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: lpsolve/lp_lib.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: lpsolve/lp_lib.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: lpsolve/lp_lib.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: lpsolve/lp_lib.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: lpsolve/lp_lib.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for lpsolve/lp_lib.h" >&5 -echo $ECHO_N "checking for lpsolve/lp_lib.h... $ECHO_C" >&6 -if test "${ac_cv_header_lpsolve_lp_lib_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_lpsolve_lp_lib_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_lpsolve_lp_lib_h" >&5 -echo "${ECHO_T}$ac_cv_header_lpsolve_lp_lib_h" >&6 + ac_fn_c_check_header_mongrel "$LINENO" "lpsolve/lp_lib.h" "ac_cv_header_lpsolve_lp_lib_h" "$ac_includes_default" +if test "x$ac_cv_header_lpsolve_lp_lib_h" = x""yes; then : -fi -if test $ac_cv_header_lpsolve_lp_lib_h = yes; then - : else - { { echo "$as_me:$LINENO: error: lpsolve headers not found." >&5 -echo "$as_me: error: lpsolve headers not found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "lpsolve headers not found." "$LINENO" 5 fi - -echo "$as_me:$LINENO: checking for make_lp in -llpsolve55" >&5 -echo $ECHO_N "checking for make_lp in -llpsolve55... $ECHO_C" >&6 -if test "${ac_cv_lib_lpsolve55_make_lp+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for make_lp in -llpsolve55" >&5 +$as_echo_n "checking for make_lp in -llpsolve55... " >&6; } +if test "${ac_cv_lib_lpsolve55_make_lp+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llpsolve55 $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char make_lp (); int main () { -make_lp (); +return make_lp (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_lpsolve55_make_lp=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_lpsolve55_make_lp=no + ac_cv_lib_lpsolve55_make_lp=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_lpsolve55_make_lp" >&5 -echo "${ECHO_T}$ac_cv_lib_lpsolve55_make_lp" >&6 -if test $ac_cv_lib_lpsolve55_make_lp = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lpsolve55_make_lp" >&5 +$as_echo "$ac_cv_lib_lpsolve55_make_lp" >&6; } +if test "x$ac_cv_lib_lpsolve55_make_lp" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBLPSOLVE55 1 _ACEOF @@ -23500,105 +18128,73 @@ _ACEOF LIBS="-llpsolve55 $LIBS" else - { { echo "$as_me:$LINENO: error: lpsolve library not found or too old." >&5 -echo "$as_me: error: lpsolve library not found or too old." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "lpsolve library not found or too old." "$LINENO" 5 fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_LPSOLVE=NO BUILD_TYPE="$BUILD_TYPE LPSOLVE" fi if test "$_os" = "Linux"; then - echo "$as_me:$LINENO: checking whether libc is >= 2.1.1" >&5 -echo $ECHO_N "checking whether libc is >= 2.1.1... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libc is >= 2.1.1" >&5 +$as_echo_n "checking whether libc is >= 2.1.1... " >&6; } exec 6>/dev/null # no output - echo "$as_me:$LINENO: checking for gnu_get_libc_version in -lc" >&5 -echo $ECHO_N "checking for gnu_get_libc_version in -lc... $ECHO_C" >&6 -if test "${ac_cv_lib_c_gnu_get_libc_version+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gnu_get_libc_version in -lc" >&5 +$as_echo_n "checking for gnu_get_libc_version in -lc... " >&6; } +if test "${ac_cv_lib_c_gnu_get_libc_version+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char gnu_get_libc_version (); int main () { -gnu_get_libc_version (); +return gnu_get_libc_version (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_c_gnu_get_libc_version=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_c_gnu_get_libc_version=no + ac_cv_lib_c_gnu_get_libc_version=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_c_gnu_get_libc_version" >&5 -echo "${ECHO_T}$ac_cv_lib_c_gnu_get_libc_version" >&6 -if test $ac_cv_lib_c_gnu_get_libc_version = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_gnu_get_libc_version" >&5 +$as_echo "$ac_cv_lib_c_gnu_get_libc_version" >&6; } +if test "x$ac_cv_lib_c_gnu_get_libc_version" = x""yes; then : HAVE_LIBC=yes; export HAVE_LIBC fi exec 6>&1 # output on again if test "$HAVE_LIBC"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else - { { echo "$as_me:$LINENO: error: no, upgrade libc" >&5 -echo "$as_me: error: no, upgrade libc" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "no, upgrade libc" "$LINENO" 5 fi fi if test \( "$_os" = "WINNT" \) ; then - echo "$as_me:$LINENO: checking for PSDK files" >&5 -echo $ECHO_N "checking for PSDK files... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PSDK files" >&5 +$as_echo_n "checking for PSDK files... " >&6; } if test -z "$with_psdk_home"; then # This first line will detect a February 2003 Microsoft Platform SDK PSDK_HOME=`./oowintool --psdk-home` @@ -23619,19 +18215,12 @@ echo $ECHO_N "checking for PSDK files... $ECHO_C" >&6 PSDK_HOME=`echo $PSDK_HOME | $SED 's/\/$//'` # Problem with current PSDK (iz 49865) if test -f "$PSDK_HOME/Lib/libcp.lib"; then - { { echo "$as_me:$LINENO: error: + as_fn_error " Some modules do not build correctly with MS Platform SDK - April 2005 Edition if the library ($PSDK_HOME/Lib/libcp.lib) is found. Remove/rename/backup that file and restart configure. Details about this -problem can be found in issue 49856." >&5 -echo "$as_me: error: - -Some modules do not build correctly with MS Platform SDK - April 2005 -Edition if the library ($PSDK_HOME/Lib/libcp.lib) is found. -Remove/rename/backup that file and restart configure. Details about this -problem can be found in issue 49856." >&2;} - { (exit 1); exit 1; }; } +problem can be found in issue 49856." "$LINENO" 5 fi # WIndows SDK has different headers if test \( -f "$PSDK_HOME/Include/adoint.h" \) \ @@ -23647,41 +18236,36 @@ problem can be found in issue 49856." >&2;} HAVE_PSDK_LIB="no" fi if test "$HAVE_PSDK_H" = "no" -o "$HAVE_PSDK_LIB" = "no"; then - { { echo "$as_me:$LINENO: error: Some (all?) PSDK files not found, please check if all needed Platform SDKs -are installed or use --with-psdk-home ." >&5 -echo "$as_me: error: Some (all?) PSDK files not found, please check if all needed Platform SDKs -are installed or use --with-psdk-home ." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Some (all?) PSDK files not found, please check if all needed Platform SDKs +are installed or use --with-psdk-home ." "$LINENO" 5 fi if test ! -x "$PSDK_HOME/bin/msiinfo.exe" \ -o ! -x "$PSDK_HOME/bin/msidb.exe" \ -o ! -x "$PSDK_HOME/bin/uuidgen.exe" \ -o ! -x "$PSDK_HOME/bin/msitran.exe" ; then - { { echo "$as_me:$LINENO: error: Some (all) files of the Windows Installer SDK are missing, please install." >&5 -echo "$as_me: error: Some (all) files of the Windows Installer SDK are missing, please install." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Some (all) files of the Windows Installer SDK are missing, please install." "$LINENO" 5 fi - echo "$as_me:$LINENO: result: SDK files found ...)" >&5 -echo "${ECHO_T}SDK files found ...)" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: SDK files found ...)" >&5 +$as_echo "SDK files found ...)" >&6; } if echo $PSDK_HOME | grep "v6.1" >/dev/null 2>/dev/null; then - echo "$as_me:$LINENO: result: Found Windows SDK 6.1 ($PSDK_HOME)" >&5 -echo "${ECHO_T}Found Windows SDK 6.1 ($PSDK_HOME)" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Found Windows SDK 6.1 ($PSDK_HOME)" >&5 +$as_echo "Found Windows SDK 6.1 ($PSDK_HOME)" >&6; } WINDOWS_VISTA_PSDK=TRUE elif echo $PSDK_HOME | grep "v6.0" >/dev/null 2>/dev/null; then - echo "$as_me:$LINENO: result: Found Windows SDK 6.0 ($PSDK_HOME)" >&5 -echo "${ECHO_T}Found Windows SDK 6.0 ($PSDK_HOME)" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Found Windows SDK 6.0 ($PSDK_HOME)" >&5 +$as_echo "Found Windows SDK 6.0 ($PSDK_HOME)" >&6; } WINDOWS_VISTA_PSDK=TRUE else - echo "$as_me:$LINENO: result: Found Legacy Windows Platform SDK ($PSDK_HOME)" >&5 -echo "${ECHO_T}Found Legacy Windows Platform SDK ($PSDK_HOME)" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Found Legacy Windows Platform SDK ($PSDK_HOME)" >&5 +$as_echo "Found Legacy Windows Platform SDK ($PSDK_HOME)" >&6; } fi fi if test \( "$_os" = "WINNT" \) ; then - echo "$as_me:$LINENO: checking for DirectX SDK files" >&5 -echo $ECHO_N "checking for DirectX SDK files... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DirectX SDK files" >&5 +$as_echo_n "checking for DirectX SDK files... " >&6; } if test -z "$with_directx_home"; then if test -n "$DXSDK_DIR"; then DIRECTXSDK_HOME=`cygpath -d "$DXSDK_DIR"` @@ -23713,17 +18297,15 @@ echo $ECHO_N "checking for DirectX SDK files... $ECHO_C" >&6 fi if test -n "$ENABLE_DIRECTX"; then if test "$HAVE_DIRECTXSDK_H" = "yes" -a "$HAVE_DIRECTXSDK_LIB" = "yes"; then - echo "$as_me:$LINENO: result: found" >&5 -echo "${ECHO_T}found" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 +$as_echo "found" >&6; } else - { { echo "$as_me:$LINENO: error: DirectX SDK files not found, please use --with-directx-home or -disable-directx." >&5 -echo "$as_me: error: DirectX SDK files not found, please use --with-directx-home or -disable-directx." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "DirectX SDK files not found, please use --with-directx-home or -disable-directx." "$LINENO" 5 fi else DIRECTXSDK_HOME="" - echo "$as_me:$LINENO: result: disabled" >&5 -echo "${ECHO_T}disabled" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 +$as_echo "disabled" >&6; } fi fi @@ -23731,14 +18313,14 @@ fi NSIS_PATH="" if test "$_os" = "WINNT" ; then - echo "$as_me:$LINENO: checking for NSIS" >&5 -echo $ECHO_N "checking for NSIS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NSIS" >&5 +$as_echo_n "checking for NSIS... " >&6; } # Extract the first word of "nsis.exe", so it can be a program name with args. set dummy nsis.exe; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_NSIS_PATH+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_NSIS_PATH+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $NSIS_PATH in [\\/]* | ?:[\\/]*) @@ -23750,28 +18332,29 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_NSIS_PATH="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS ;; esac fi NSIS_PATH=$ac_cv_path_NSIS_PATH - if test -n "$NSIS_PATH"; then - echo "$as_me:$LINENO: result: $NSIS_PATH" >&5 -echo "${ECHO_T}$NSIS_PATH" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NSIS_PATH" >&5 +$as_echo "$NSIS_PATH" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + if test -n "$NSIS_PATH"; then NSIS_PATH=`dirname "$NSIS_PATH"` fi @@ -23786,24 +18369,24 @@ fi NSIS_PATH="$nsistest" fi if test -z "$NSIS_PATH"; then - { echo "$as_me:$LINENO: WARNING: NSIS not found, no self contained installer will be build." >&5 -echo "$as_me: WARNING: NSIS not found, no self contained installer will be build." >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: NSIS not found, no self contained installer will be build." >&5 +$as_echo "$as_me: WARNING: NSIS not found, no self contained installer will be build." >&2;} echo "NSIS not found, no self contained installer will be build." >> warn else NSIS_PATH=`cygpath -d "$NSIS_PATH"` NSIS_PATH=`cygpath -u "$NSIS_PATH"` - echo "$as_me:$LINENO: result: found ($NSIS_PATH)" >&5 -echo "${ECHO_T}found ($NSIS_PATH)" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found ($NSIS_PATH)" >&5 +$as_echo "found ($NSIS_PATH)" >&6; } fi fi # Extract the first word of "bison", so it can be a program name with args. set dummy bison; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_BISON+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_BISON+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $BISON in [\\/]* | ?:[\\/]*) @@ -23815,59 +18398,56 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_BISON="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS ;; esac fi BISON=$ac_cv_path_BISON - if test -n "$BISON"; then - echo "$as_me:$LINENO: result: $BISON" >&5 -echo "${ECHO_T}$BISON" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BISON" >&5 +$as_echo "$BISON" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + if test -z "$BISON"; then - { { echo "$as_me:$LINENO: error: no bison found in \$PATH, install bison" >&5 -echo "$as_me: error: no bison found in \$PATH, install bison" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "no bison found in \$PATH, install bison" "$LINENO" 5 else - echo "$as_me:$LINENO: checking the bison version" >&5 -echo $ECHO_N "checking the bison version... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking the bison version" >&5 +$as_echo_n "checking the bison version... " >&6; } _bison_version=`$BISON --version | grep GNU | $SED -e 's@^[^0-9]*@@' -e 's@ .*@@' -e 's@,.*@@'`; _bison_longver=`echo $_bison_version | $AWK -F. '{ print \$1*1000+\$2}'` # Accept newer than 1.875 or older(equal) than 1.75 if test "$_bison_longver" -ge 1875 -o "$_bison_longver" -le 1075; then if test "$_bison_version" = "1.875" ; then - { echo "$as_me:$LINENO: WARNING: suspect ($BISON $_bison_version)" >&5 -echo "$as_me: WARNING: suspect ($BISON $_bison_version)" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: suspect ($BISON $_bison_version)" >&5 +$as_echo "$as_me: WARNING: suspect ($BISON $_bison_version)" >&2;} echo "Suspect ($BISON $_bison_version) suggest upgrade" >> warn else - echo "$as_me:$LINENO: result: checked ($BISON $_bison_version)" >&5 -echo "${ECHO_T}checked ($BISON $_bison_version)" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked ($BISON $_bison_version)" >&5 +$as_echo "checked ($BISON $_bison_version)" >&6; } fi else - { { echo "$as_me:$LINENO: error: failed ($BISON $_bison_version need 1.875+ (or 1.75 and older))" >&5 -echo "$as_me: error: failed ($BISON $_bison_version need 1.875+ (or 1.75 and older))" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "failed ($BISON $_bison_version need 1.875+ (or 1.75 and older))" "$LINENO" 5 fi fi # Extract the first word of "flex", so it can be a program name with args. set dummy flex; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_FLEX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_FLEX+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $FLEX in [\\/]* | ?:[\\/]*) @@ -23879,39 +18459,38 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_FLEX="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS ;; esac fi FLEX=$ac_cv_path_FLEX - if test -n "$FLEX"; then - echo "$as_me:$LINENO: result: $FLEX" >&5 -echo "${ECHO_T}$FLEX" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FLEX" >&5 +$as_echo "$FLEX" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + if test -z "$FLEX"; then - { { echo "$as_me:$LINENO: error: no flex found in \$PATH, install flex" >&5 -echo "$as_me: error: no flex found in \$PATH, install flex" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "no flex found in \$PATH, install flex" "$LINENO" 5 fi # Extract the first word of "patch", so it can be a program name with args. set dummy patch; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PATCH+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PATCH+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $PATCH in [\\/]* | ?:[\\/]*) @@ -23923,32 +18502,31 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PATCH="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS ;; esac fi PATCH=$ac_cv_path_PATCH - if test -n "$PATCH"; then - echo "$as_me:$LINENO: result: $PATCH" >&5 -echo "${ECHO_T}$PATCH" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATCH" >&5 +$as_echo "$PATCH" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + if test -z "$PATCH"; then - { { echo "$as_me:$LINENO: error: \\"patch\\" not found in \$PATH, install the development tool named\\"patch\"\" >&5 -echo "$as_me: error: \\"patch\\" not found in \$PATH, install the development tool named\\"patch\"\" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "\\"patch\\" not found in \$PATH, install the development tool named\\"patch\"\" "$LINENO" 5 fi if test "$_os" = "SunOS" -o "$_os" = "FreeBSD" -o "$_os" = "Darwin"; then @@ -23958,21 +18536,17 @@ if test "$_os" = "SunOS" -o "$_os" = "FreeBSD" -o "$_os" = "Darwin"; then if test -x "$with_gnu_patch"; then GNUPATCH=$with_gnu_patch else - { { echo "$as_me:$LINENO: error: --with-gnu-patch did not point to an executable" >&5 -echo "$as_me: error: --with-gnu-patch did not point to an executable" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "--with-gnu-patch did not point to an executable" "$LINENO" 5 fi fi - echo "$as_me:$LINENO: checking whether $GNUPATCH is GNU patch" >&5 -echo $ECHO_N "checking whether $GNUPATCH is GNU patch... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $GNUPATCH is GNU patch" >&5 +$as_echo_n "checking whether $GNUPATCH is GNU patch... " >&6; } if $GNUPATCH --version | grep "Free Software Foundation" >/dev/null 2>/dev/null; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else - { { echo "$as_me:$LINENO: error: no, GNU patch needed. install or specify with --with-gnu-patch=/path/to/it" >&5 -echo "$as_me: error: no, GNU patch needed. install or specify with --with-gnu-patch=/path/to/it" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "no, GNU patch needed. install or specify with --with-gnu-patch=/path/to/it" "$LINENO" 5 fi @@ -23981,10 +18555,10 @@ echo "$as_me: error: no, GNU patch needed. install or specify with --with-gnu-pa do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_GNUCP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_GNUCP+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $GNUCP in [\\/]* | ?:[\\/]*) @@ -23996,64 +18570,59 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_GNUCP="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS ;; esac fi GNUCP=$ac_cv_path_GNUCP - if test -n "$GNUCP"; then - echo "$as_me:$LINENO: result: $GNUCP" >&5 -echo "${ECHO_T}$GNUCP" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GNUCP" >&5 +$as_echo "$GNUCP" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$GNUCP" && break done if test -z $GNUCP; then - { { echo "$as_me:$LINENO: error: Neither gnucp nor cp found. Install GNU cp and/or specify --with-gnu-cp=/path/to/it" >&5 -echo "$as_me: error: Neither gnucp nor cp found. Install GNU cp and/or specify --with-gnu-cp=/path/to/it" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Neither gnucp nor cp found. Install GNU cp and/or specify --with-gnu-cp=/path/to/it" "$LINENO" 5 fi else if test -x "$with_gnu_cp"; then GNUCP=$with_gnu_cp else - { { echo "$as_me:$LINENO: error: --with-gnu-cp did not point to an executable" >&5 -echo "$as_me: error: --with-gnu-cp did not point to an executable" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "--with-gnu-cp did not point to an executable" "$LINENO" 5 fi fi - echo "$as_me:$LINENO: checking whether $GNUCP is GNU cp" >&5 -echo $ECHO_N "checking whether $GNUCP is GNU cp... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $GNUCP is GNU cp" >&5 +$as_echo_n "checking whether $GNUCP is GNU cp... " >&6; } if $GNUCP --version 2>/dev/null | grep "Free Software Foundation" >/dev/null 2>/dev/null; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else if $GNUCP --version 2>/dev/null | grep "GNU fileutils" >/dev/null 2>/dev/null; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else if test "$_os" = "Darwin"; then GNUCP='' - echo "$as_me:$LINENO: result: no gnucp found - using the system's cp command" >&5 -echo "${ECHO_T}no gnucp found - using the system's cp command" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no gnucp found - using the system's cp command" >&5 +$as_echo "no gnucp found - using the system's cp command" >&6; } else - { { echo "$as_me:$LINENO: error: no, GNU cp needed. install or specify with --with-gnu-cp=/path/to/it" >&5 -echo "$as_me: error: no, GNU cp needed. install or specify with --with-gnu-cp=/path/to/it" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "no, GNU cp needed. install or specify with --with-gnu-cp=/path/to/it" "$LINENO" 5 fi fi fi @@ -24066,10 +18635,10 @@ if test "$_os" = "WINNT"; then CYGWIN_PATH="" # Extract the first word of "bash", so it can be a program name with args. set dummy bash; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_CYGWIN_PATH+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_CYGWIN_PATH+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $CYGWIN_PATH in [\\/]* | ?:[\\/]*) @@ -24081,28 +18650,29 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_CYGWIN_PATH="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS ;; esac fi CYGWIN_PATH=$ac_cv_path_CYGWIN_PATH - if test -n "$CYGWIN_PATH"; then - echo "$as_me:$LINENO: result: $CYGWIN_PATH" >&5 -echo "${ECHO_T}$CYGWIN_PATH" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CYGWIN_PATH" >&5 +$as_echo "$CYGWIN_PATH" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + CYGWIN_PATH=`dirname "$CYGWIN_PATH"` fi if test -z "$CYGWIN_PATH"; then @@ -24111,18 +18681,18 @@ fi if test "$_os" = "WINNT" -a "$WITH_MINGWIN" != "yes"; then - echo "$as_me:$LINENO: checking ml.exe assembler path" >&5 -echo $ECHO_N "checking ml.exe assembler path... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking ml.exe assembler path" >&5 +$as_echo_n "checking ml.exe assembler path... " >&6; } if test -n "$with_asm_home"; then with_asm_home=`cygpath -u "$with_asm_home"` fi if test ! -x "$with_asm_home/ml.exe"; then # Extract the first word of "ml.exe", so it can be a program name with args. set dummy ml.exe; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_ML_EXE+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_ML_EXE+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $ML_EXE in [\\/]* | ?:[\\/]*) @@ -24134,37 +18704,36 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ML_EXE="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS ;; esac fi ML_EXE=$ac_cv_path_ML_EXE - if test -n "$ML_EXE"; then - echo "$as_me:$LINENO: result: $ML_EXE" >&5 -echo "${ECHO_T}$ML_EXE" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ML_EXE" >&5 +$as_echo "$ML_EXE" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + if test -z "$ML_EXE"; then if test -x "$with_cl_home/bin/ml.exe"; then with_asm_home=$with_cl_home/bin - echo "$as_me:$LINENO: result: found ($with_asm_home)" >&5 -echo "${ECHO_T}found ($with_asm_home)" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found ($with_asm_home)" >&5 +$as_echo "found ($with_asm_home)" >&6; } else - { { echo "$as_me:$LINENO: error: Configure did not find ml.exe assembler." >&5 -echo "$as_me: error: Configure did not find ml.exe assembler." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Configure did not find ml.exe assembler." "$LINENO" 5 fi else with_asm_home="ASM_IN_PATH" @@ -24175,8 +18744,8 @@ else fi ASM_HOME="$with_asm_home" if test -n "$ASM_HOME"; then - echo "$as_me:$LINENO: result: $ASM_HOME" >&5 -echo "${ECHO_T}$ASM_HOME" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ASM_HOME" >&5 +$as_echo "$ASM_HOME" >&6; } fi @@ -24193,10 +18762,10 @@ if test -n "$with_zip_home" ; then else # Extract the first word of "zip", so it can be a program name with args. set dummy zip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_ZIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_ZIP+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $ZIP in [\\/]* | ?:[\\/]*) @@ -24208,34 +18777,35 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ZIP="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS ;; esac fi ZIP=$ac_cv_path_ZIP - if test -n "$ZIP"; then - echo "$as_me:$LINENO: result: $ZIP" >&5 -echo "${ECHO_T}$ZIP" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ZIP" >&5 +$as_echo "$ZIP" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + # Extract the first word of "unzip", so it can be a program name with args. set dummy unzip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_UNZIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_UNZIP+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $UNZIP in [\\/]* | ?:[\\/]*) @@ -24247,84 +18817,69 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_UNZIP="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS ;; esac fi UNZIP=$ac_cv_path_UNZIP - if test -n "$UNZIP"; then - echo "$as_me:$LINENO: result: $UNZIP" >&5 -echo "${ECHO_T}$UNZIP" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $UNZIP" >&5 +$as_echo "$UNZIP" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + ZIP_HOME=`dirname "$ZIP"` fi if test -z "$ZIP" -o -z "$UNZIP"; then - { { echo "$as_me:$LINENO: error: Zip/Unzip are required to build, please install or use --with-zip-home" >&5 -echo "$as_me: error: Zip/Unzip are required to build, please install or use --with-zip-home" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Zip/Unzip are required to build, please install or use --with-zip-home" "$LINENO" 5 fi if test "$_os" = "WINNT"; then if test -n "`$ZIP -h | grep -i WinNT`" ; then -{ { echo "$as_me:$LINENO: error: $ZIP found in the path is not the required cygwin version of Info-ZIPs zip.exe." >&5 -echo "$as_me: error: $ZIP found in the path is not the required cygwin version of Info-ZIPs zip.exe." >&2;} - { (exit 1); exit 1; }; } +as_fn_error "$ZIP found in the path is not the required cygwin version of Info-ZIPs zip.exe." "$LINENO" 5 fi fi if test "$_os" = "WINNT"; then - echo "$as_me:$LINENO: checking for unicows.dll" >&5 -echo $ECHO_N "checking for unicows.dll... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unicows.dll" >&5 +$as_echo_n "checking for unicows.dll... " >&6; } if test -x ./external/unicows/unicows.dll; then - echo "$as_me:$LINENO: result: found" >&5 -echo "${ECHO_T}found" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 +$as_echo "found" >&6; } else - { { echo "$as_me:$LINENO: error: The Microsoft Layer for Unicode (unicows.dll) is missing in external/unicows/. + as_fn_error "The Microsoft Layer for Unicode (unicows.dll) is missing in external/unicows/. Get it from the Microsoft site and put it into external/unicows. (Note: Microsoft seems to enjoy changing the exact location of this file. You may have to search Microsoft's website.) Last time it was seen at: -." >&5 -echo "$as_me: error: The Microsoft Layer for Unicode (unicows.dll) is missing in external/unicows/. -Get it from the Microsoft site and put it into external/unicows. -(Note: Microsoft seems to enjoy changing the exact location of this file. You -may have to search Microsoft's website.) Last time it was seen at: -." >&2;} - { (exit 1); exit 1; }; } +." "$LINENO" 5 fi fi if test "$_os" = "WINNT"; then - echo "$as_me:$LINENO: checking for dbghelp.dll" >&5 -echo $ECHO_N "checking for dbghelp.dll... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbghelp.dll" >&5 +$as_echo_n "checking for dbghelp.dll... " >&6; } if test -x ./external/dbghelp/dbghelp.dll; then - echo "$as_me:$LINENO: result: found" >&5 -echo "${ECHO_T}found" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 +$as_echo "found" >&6; } else - { { echo "$as_me:$LINENO: error: dbghelp.dll is missing in external/dbghelp/. -Get it from the Microsoft site and put it into external/dbghelp. -(Note: Microsoft seems to enjoy changing the exact location of this file. You -may have to search Microsoft's website.) Last time it was seen at: -." >&5 -echo "$as_me: error: dbghelp.dll is missing in external/dbghelp/. + as_fn_error "dbghelp.dll is missing in external/dbghelp/. Get it from the Microsoft site and put it into external/dbghelp. (Note: Microsoft seems to enjoy changing the exact location of this file. You may have to search Microsoft's website.) Last time it was seen at: -." >&2;} - { (exit 1); exit 1; }; } +." "$LINENO" 5 fi fi @@ -24332,28 +18887,21 @@ if test "$_os" = "WINNT" -a "$WITH_MINGWIN" != "yes"; then if ./oowintool --msvc-copy-dlls ./external/msvcp ; then : else - { { echo "$as_me:$LINENO: error: oowintool failed to copy CRT" >&5 -echo "$as_me: error: oowintool failed to copy CRT" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "oowintool failed to copy CRT" "$LINENO" 5 fi fi if test "$_os" = "WINNT"; then - echo "$as_me:$LINENO: checking for gdiplus.dll" >&5 -echo $ECHO_N "checking for gdiplus.dll... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gdiplus.dll" >&5 +$as_echo_n "checking for gdiplus.dll... " >&6; } if test -x ./external/gdiplus/gdiplus.dll; then - echo "$as_me:$LINENO: result: found" >&5 -echo "${ECHO_T}found" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 +$as_echo "found" >&6; } else - { { echo "$as_me:$LINENO: error: gdiplus.dll is missing in external/gdiplus/. -Get it from the Microsoft site and put it into external/gdiplus. -You may have to search Microsoft's website. Last time it was seen at: -." >&5 -echo "$as_me: error: gdiplus.dll is missing in external/gdiplus/. + as_fn_error "gdiplus.dll is missing in external/gdiplus/. Get it from the Microsoft site and put it into external/gdiplus. You may have to search Microsoft's website. Last time it was seen at: -." >&2;} - { (exit 1); exit 1; }; } +." "$LINENO" 5 fi fi @@ -24363,11 +18911,11 @@ fi if test "$_os" = "WINNT"; then if test "$WITH_MINGWIN" = "yes" || test "$COMEX" -ge "10"; then - echo "$as_me:$LINENO: checking for instmsia.exe/instmsiw.exe" >&5 -echo $ECHO_N "checking for instmsia.exe/instmsiw.exe... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for instmsia.exe/instmsiw.exe" >&5 +$as_echo_n "checking for instmsia.exe/instmsiw.exe... " >&6; } if test -x ./external/msi/instmsia.exe -a -x ./external/msi/instmsiw.exe; then - echo "$as_me:$LINENO: result: found" >&5 -echo "${ECHO_T}found" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 +$as_echo "found" >&6; } else MSIAPATH=`/bin/find "$COMPATH/../.." -iname instmsia.exe | head -n 1` MSIWPATH=`/bin/find "$COMPATH/../.." -iname instmsiw.exe | head -n 1` @@ -24376,27 +18924,21 @@ echo "${ECHO_T}found" >&6 cp "$MSIWPATH" ./external/msi/ && chmod +x ./external/msi/instmsiw.exe && MSIWCOPY="OK" fi if test -z "$MSIACOPY" -o -z "$MSIWCOPY"; then - { { echo "$as_me:$LINENO: error: instmsia.exe and/or instmsiw.exe are/is missing in the default location. + as_fn_error "instmsia.exe and/or instmsiw.exe are/is missing in the default location. These programs are part of the Visual Studio installation and should be found in a directory similar to: \"c:\\Program Files\\Microsoft Visual Studio .NET 2003\\Common7\\Tools\\Deployment\\MsiRedist\\\" -As the automatic detection fails please copy the files to external/msi/." >&5 -echo "$as_me: error: instmsia.exe and/or instmsiw.exe are/is missing in the default location. -These programs are part of the Visual Studio installation and should be found in a -directory similar to: -\"c:\\Program Files\\Microsoft Visual Studio .NET 2003\\Common7\\Tools\\Deployment\\MsiRedist\\\" -As the automatic detection fails please copy the files to external/msi/." >&2;} - { (exit 1); exit 1; }; } +As the automatic detection fails please copy the files to external/msi/." "$LINENO" 5 else - echo "$as_me:$LINENO: result: found and copied" >&5 -echo "${ECHO_T}found and copied" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: found and copied" >&5 +$as_echo "found and copied" >&6; } fi fi fi fi -echo "$as_me:$LINENO: checking which VCLplugs shall be built" >&5 -echo $ECHO_N "checking which VCLplugs shall be built... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which VCLplugs shall be built" >&5 +$as_echo_n "checking which VCLplugs shall be built... " >&6; } ENABLE_GTK="" if test "x$enable_gtk" = "xyes"; then ENABLE_GTK="TRUE" @@ -24419,31 +18961,31 @@ fi if test -z "$R"; then - echo "$as_me:$LINENO: result: none" >&5 -echo "${ECHO_T}none" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } else - echo "$as_me:$LINENO: result: $R" >&5 -echo "${ECHO_T}$R" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $R" >&5 +$as_echo "$R" >&6; } fi ENABLE_GCONF="" -echo "$as_me:$LINENO: checking whether to enable GConf support" >&5 -echo $ECHO_N "checking whether to enable GConf support... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable GConf support" >&5 +$as_echo_n "checking whether to enable GConf support... " >&6; } if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$_os" != "OS2" -a "$enable_gconf" = "yes"; then ENABLE_GCONF="TRUE" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=no if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -24455,29 +18997,30 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -24488,25 +19031,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for gconf-2.0 " >&5 -echo $ECHO_N "checking for gconf-2.0 ... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gconf-2.0 " >&5 +$as_echo_n "checking for gconf-2.0 ... " >&6; } if $PKG_CONFIG --exists "gconf-2.0 " ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking GCONF_CFLAGS" >&5 -echo $ECHO_N "checking GCONF_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking GCONF_CFLAGS" >&5 +$as_echo_n "checking GCONF_CFLAGS... " >&6; } GCONF_CFLAGS=`$PKG_CONFIG --cflags "gconf-2.0 "` - echo "$as_me:$LINENO: result: $GCONF_CFLAGS" >&5 -echo "${ECHO_T}$GCONF_CFLAGS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GCONF_CFLAGS" >&5 +$as_echo "$GCONF_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking GCONF_LIBS" >&5 -echo $ECHO_N "checking GCONF_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking GCONF_LIBS" >&5 +$as_echo_n "checking GCONF_LIBS... " >&6; } GCONF_LIBS=`$PKG_CONFIG --libs "gconf-2.0 "` - echo "$as_me:$LINENO: result: $GCONF_LIBS" >&5 -echo "${ECHO_T}$GCONF_LIBS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GCONF_LIBS" >&5 +$as_echo "$GCONF_LIBS" >&6; } else GCONF_CFLAGS="" GCONF_LIBS="" @@ -24527,35 +19070,33 @@ echo "${ECHO_T}$GCONF_LIBS" >&6 if test $succeeded = yes; then : else - { { echo "$as_me:$LINENO: error: Library requirements (gconf-2.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 -echo "$as_me: error: Library requirements (gconf-2.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Library requirements (gconf-2.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." "$LINENO" 5 fi else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi ENABLE_GNOMEVFS="" -echo "$as_me:$LINENO: checking whether to enable GNOME VFS support" >&5 -echo $ECHO_N "checking whether to enable GNOME VFS support... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable GNOME VFS support" >&5 +$as_echo_n "checking whether to enable GNOME VFS support... " >&6; } if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gnome_vfs" = "yes"; then ENABLE_GNOMEVFS="TRUE" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=no if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -24567,29 +19108,30 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -24600,25 +19142,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for gnome-vfs-2.0 >= 2.6.0 " >&5 -echo $ECHO_N "checking for gnome-vfs-2.0 >= 2.6.0 ... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gnome-vfs-2.0 >= 2.6.0 " >&5 +$as_echo_n "checking for gnome-vfs-2.0 >= 2.6.0 ... " >&6; } if $PKG_CONFIG --exists "gnome-vfs-2.0 >= 2.6.0 " ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking GNOMEVFS_CFLAGS" >&5 -echo $ECHO_N "checking GNOMEVFS_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking GNOMEVFS_CFLAGS" >&5 +$as_echo_n "checking GNOMEVFS_CFLAGS... " >&6; } GNOMEVFS_CFLAGS=`$PKG_CONFIG --cflags "gnome-vfs-2.0 >= 2.6.0 "` - echo "$as_me:$LINENO: result: $GNOMEVFS_CFLAGS" >&5 -echo "${ECHO_T}$GNOMEVFS_CFLAGS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GNOMEVFS_CFLAGS" >&5 +$as_echo "$GNOMEVFS_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking GNOMEVFS_LIBS" >&5 -echo $ECHO_N "checking GNOMEVFS_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking GNOMEVFS_LIBS" >&5 +$as_echo_n "checking GNOMEVFS_LIBS... " >&6; } GNOMEVFS_LIBS=`$PKG_CONFIG --libs "gnome-vfs-2.0 >= 2.6.0 "` - echo "$as_me:$LINENO: result: $GNOMEVFS_LIBS" >&5 -echo "${ECHO_T}$GNOMEVFS_LIBS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GNOMEVFS_LIBS" >&5 +$as_echo "$GNOMEVFS_LIBS" >&6; } else GNOMEVFS_CFLAGS="" GNOMEVFS_LIBS="" @@ -24639,9 +19181,7 @@ echo "${ECHO_T}$GNOMEVFS_LIBS" >&6 if test $succeeded = yes; then : else - { { echo "$as_me:$LINENO: error: Library requirements (gnome-vfs-2.0 >= 2.6.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 -echo "$as_me: error: Library requirements (gnome-vfs-2.0 >= 2.6.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Library requirements (gnome-vfs-2.0 >= 2.6.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." "$LINENO" 5 fi if test "$ENABLE_GCONF" != "TRUE"; then @@ -24651,10 +19191,10 @@ echo "$as_me: error: Library requirements (gnome-vfs-2.0 >= 2.6.0 ) not met; con if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -24666,29 +19206,30 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -24699,25 +19240,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for gconf-2.0 " >&5 -echo $ECHO_N "checking for gconf-2.0 ... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gconf-2.0 " >&5 +$as_echo_n "checking for gconf-2.0 ... " >&6; } if $PKG_CONFIG --exists "gconf-2.0 " ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking GCONF_CFLAGS" >&5 -echo $ECHO_N "checking GCONF_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking GCONF_CFLAGS" >&5 +$as_echo_n "checking GCONF_CFLAGS... " >&6; } GCONF_CFLAGS=`$PKG_CONFIG --cflags "gconf-2.0 "` - echo "$as_me:$LINENO: result: $GCONF_CFLAGS" >&5 -echo "${ECHO_T}$GCONF_CFLAGS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GCONF_CFLAGS" >&5 +$as_echo "$GCONF_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking GCONF_LIBS" >&5 -echo $ECHO_N "checking GCONF_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking GCONF_LIBS" >&5 +$as_echo_n "checking GCONF_LIBS... " >&6; } GCONF_LIBS=`$PKG_CONFIG --libs "gconf-2.0 "` - echo "$as_me:$LINENO: result: $GCONF_LIBS" >&5 -echo "${ECHO_T}$GCONF_LIBS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GCONF_LIBS" >&5 +$as_echo "$GCONF_LIBS" >&6; } else GCONF_CFLAGS="" GCONF_LIBS="" @@ -24738,15 +19279,13 @@ echo "${ECHO_T}$GCONF_LIBS" >&6 if test $succeeded = yes; then : else - { { echo "$as_me:$LINENO: error: Library requirements (gconf-2.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 -echo "$as_me: error: Library requirements (gconf-2.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Library requirements (gconf-2.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." "$LINENO" 5 fi fi else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -24764,10 +19303,10 @@ if test "$test_gtk" = "yes"; then if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -24779,29 +19318,30 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -24812,25 +19352,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for gtk+-2.0 >= 2.4 gdk-pixbuf-xlib-2.0 >= 2.2 " >&5 -echo $ECHO_N "checking for gtk+-2.0 >= 2.4 gdk-pixbuf-xlib-2.0 >= 2.2 ... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gtk+-2.0 >= 2.4 gdk-pixbuf-xlib-2.0 >= 2.2 " >&5 +$as_echo_n "checking for gtk+-2.0 >= 2.4 gdk-pixbuf-xlib-2.0 >= 2.2 ... " >&6; } if $PKG_CONFIG --exists "gtk+-2.0 >= 2.4 gdk-pixbuf-xlib-2.0 >= 2.2 " ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking GTK_CFLAGS" >&5 -echo $ECHO_N "checking GTK_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking GTK_CFLAGS" >&5 +$as_echo_n "checking GTK_CFLAGS... " >&6; } GTK_CFLAGS=`$PKG_CONFIG --cflags "gtk+-2.0 >= 2.4 gdk-pixbuf-xlib-2.0 >= 2.2 "` - echo "$as_me:$LINENO: result: $GTK_CFLAGS" >&5 -echo "${ECHO_T}$GTK_CFLAGS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTK_CFLAGS" >&5 +$as_echo "$GTK_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking GTK_LIBS" >&5 -echo $ECHO_N "checking GTK_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking GTK_LIBS" >&5 +$as_echo_n "checking GTK_LIBS... " >&6; } GTK_LIBS=`$PKG_CONFIG --libs "gtk+-2.0 >= 2.4 gdk-pixbuf-xlib-2.0 >= 2.2 "` - echo "$as_me:$LINENO: result: $GTK_LIBS" >&5 -echo "${ECHO_T}$GTK_LIBS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTK_LIBS" >&5 +$as_echo "$GTK_LIBS" >&6; } else GTK_CFLAGS="" GTK_LIBS="" @@ -24851,9 +19391,7 @@ echo "${ECHO_T}$GTK_LIBS" >&6 if test $succeeded = yes; then : else - { { echo "$as_me:$LINENO: error: requirements to build the gtk-plugin not met. Use --disable-gtk or install the missing packages" >&5 -echo "$as_me: error: requirements to build the gtk-plugin not met. Use --disable-gtk or install the missing packages" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "requirements to build the gtk-plugin not met. Use --disable-gtk or install the missing packages" "$LINENO" 5 fi BUILD_TYPE="$BUILD_TYPE GTK" @@ -24863,22 +19401,22 @@ echo "$as_me: error: requirements to build the gtk-plugin not met. Use --disable BUILD_TYPE="$BUILD_TYPE SYSTRAY_GTK" fi - echo "$as_me:$LINENO: checking whether to enable DBUS support" >&5 -echo $ECHO_N "checking whether to enable DBUS support... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable DBUS support" >&5 +$as_echo_n "checking whether to enable DBUS support... " >&6; } if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_dbus" = "yes"; then ENABLE_DBUS="TRUE" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=no if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -24890,29 +19428,30 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -24923,25 +19462,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for dbus-glib-1 >= 0.70 " >&5 -echo $ECHO_N "checking for dbus-glib-1 >= 0.70 ... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbus-glib-1 >= 0.70 " >&5 +$as_echo_n "checking for dbus-glib-1 >= 0.70 ... " >&6; } if $PKG_CONFIG --exists "dbus-glib-1 >= 0.70 " ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking DBUS_CFLAGS" >&5 -echo $ECHO_N "checking DBUS_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking DBUS_CFLAGS" >&5 +$as_echo_n "checking DBUS_CFLAGS... " >&6; } DBUS_CFLAGS=`$PKG_CONFIG --cflags "dbus-glib-1 >= 0.70 "` - echo "$as_me:$LINENO: result: $DBUS_CFLAGS" >&5 -echo "${ECHO_T}$DBUS_CFLAGS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DBUS_CFLAGS" >&5 +$as_echo "$DBUS_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking DBUS_LIBS" >&5 -echo $ECHO_N "checking DBUS_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking DBUS_LIBS" >&5 +$as_echo_n "checking DBUS_LIBS... " >&6; } DBUS_LIBS=`$PKG_CONFIG --libs "dbus-glib-1 >= 0.70 "` - echo "$as_me:$LINENO: result: $DBUS_LIBS" >&5 -echo "${ECHO_T}$DBUS_LIBS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DBUS_LIBS" >&5 +$as_echo "$DBUS_LIBS" >&6; } else DBUS_CFLAGS="" DBUS_LIBS="" @@ -24962,37 +19501,33 @@ echo "${ECHO_T}$DBUS_LIBS" >&6 if test $succeeded = yes; then : else - { { echo "$as_me:$LINENO: error: Library requirements (dbus-glib-1 >= 0.70 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 -echo "$as_me: error: Library requirements (dbus-glib-1 >= 0.70 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Library requirements (dbus-glib-1 >= 0.70 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." "$LINENO" 5 fi else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi - echo "$as_me:$LINENO: checking whether to enable GIO support" >&5 -echo $ECHO_N "checking whether to enable GIO support... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable GIO support" >&5 +$as_echo_n "checking whether to enable GIO support... " >&6; } if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gio" = "yes"; then if test "$ENABLE_GNOMEVFS" = "TRUE" ; then - { { echo "$as_me:$LINENO: error: please use --enable-gio only together with --disable-gnome-vfs." >&5 -echo "$as_me: error: please use --enable-gio only together with --disable-gnome-vfs." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "please use --enable-gio only together with --disable-gnome-vfs." "$LINENO" 5 fi ENABLE_GIO="TRUE" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=no if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -25004,29 +19539,30 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -25037,25 +19573,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for gio-2.0 " >&5 -echo $ECHO_N "checking for gio-2.0 ... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gio-2.0 " >&5 +$as_echo_n "checking for gio-2.0 ... " >&6; } if $PKG_CONFIG --exists "gio-2.0 " ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking GIO_CFLAGS" >&5 -echo $ECHO_N "checking GIO_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking GIO_CFLAGS" >&5 +$as_echo_n "checking GIO_CFLAGS... " >&6; } GIO_CFLAGS=`$PKG_CONFIG --cflags "gio-2.0 "` - echo "$as_me:$LINENO: result: $GIO_CFLAGS" >&5 -echo "${ECHO_T}$GIO_CFLAGS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GIO_CFLAGS" >&5 +$as_echo "$GIO_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking GIO_LIBS" >&5 -echo $ECHO_N "checking GIO_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking GIO_LIBS" >&5 +$as_echo_n "checking GIO_LIBS... " >&6; } GIO_LIBS=`$PKG_CONFIG --libs "gio-2.0 "` - echo "$as_me:$LINENO: result: $GIO_LIBS" >&5 -echo "${ECHO_T}$GIO_LIBS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GIO_LIBS" >&5 +$as_echo "$GIO_LIBS" >&6; } else GIO_CFLAGS="" GIO_LIBS="" @@ -25076,14 +19612,12 @@ echo "${ECHO_T}$GIO_LIBS" >&6 if test $succeeded = yes; then : else - { { echo "$as_me:$LINENO: error: Library requirements (gio-2.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 -echo "$as_me: error: Library requirements (gio-2.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Library requirements (gio-2.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." "$LINENO" 5 fi else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi fi @@ -25102,18 +19636,18 @@ SYSTEM_CAIRO="" if test "$test_cairo" = "yes"; then - echo "$as_me:$LINENO: checking whether to use cairo" >&5 -echo $ECHO_N "checking whether to use cairo... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use cairo" >&5 +$as_echo_n "checking whether to use cairo... " >&6; } if test "x$enable_cairo" != "xno" ; then ENABLE_CAIRO="TRUE" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - echo "$as_me:$LINENO: checking which cairo to use" >&5 -echo $ECHO_N "checking which cairo to use... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking which cairo to use" >&5 +$as_echo_n "checking which cairo to use... " >&6; } if test -n "$with_system_cairo" -o -n "$with_system_libs" && \ test "$with_system_cairo" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_CAIRO=YES @@ -25122,10 +19656,10 @@ echo "${ECHO_T}external" >&6 if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -25137,29 +19671,30 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -25170,25 +19705,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for cairo >= 1.0.2 " >&5 -echo $ECHO_N "checking for cairo >= 1.0.2 ... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cairo >= 1.0.2 " >&5 +$as_echo_n "checking for cairo >= 1.0.2 ... " >&6; } if $PKG_CONFIG --exists "cairo >= 1.0.2 " ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking CAIRO_CFLAGS" >&5 -echo $ECHO_N "checking CAIRO_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking CAIRO_CFLAGS" >&5 +$as_echo_n "checking CAIRO_CFLAGS... " >&6; } CAIRO_CFLAGS=`$PKG_CONFIG --cflags "cairo >= 1.0.2 "` - echo "$as_me:$LINENO: result: $CAIRO_CFLAGS" >&5 -echo "${ECHO_T}$CAIRO_CFLAGS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CAIRO_CFLAGS" >&5 +$as_echo "$CAIRO_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking CAIRO_LIBS" >&5 -echo $ECHO_N "checking CAIRO_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking CAIRO_LIBS" >&5 +$as_echo_n "checking CAIRO_LIBS... " >&6; } CAIRO_LIBS=`$PKG_CONFIG --libs "cairo >= 1.0.2 "` - echo "$as_me:$LINENO: result: $CAIRO_LIBS" >&5 -echo "${ECHO_T}$CAIRO_LIBS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CAIRO_LIBS" >&5 +$as_echo "$CAIRO_LIBS" >&6; } else CAIRO_CFLAGS="" CAIRO_LIBS="" @@ -25209,31 +19744,22 @@ echo "${ECHO_T}$CAIRO_LIBS" >&6 if test $succeeded = yes; then : else - { { echo "$as_me:$LINENO: error: Library requirements (cairo >= 1.0.2 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 -echo "$as_me: error: Library requirements (cairo >= 1.0.2 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Library requirements (cairo >= 1.0.2 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." "$LINENO" 5 fi if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$ENABLE_FONTCONFIG" != "TRUE" ; then - { { echo "$as_me:$LINENO: error: Cairo library requires fontconfig." >&5 -echo "$as_me: error: Cairo library requires fontconfig." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Cairo library requires fontconfig." "$LINENO" 5 fi if test "$with_system_xrender_headers" = "yes"; then - echo "$as_me:$LINENO: checking whether Xrender.h defines PictStandardA8" >&5 -echo $ECHO_N "checking whether Xrender.h defines PictStandardA8... $ECHO_C" >&6 - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Xrender.h defines PictStandardA8" >&5 +$as_echo_n "checking whether Xrender.h defines PictStandardA8... " >&6; } + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot run test program while cross compiling +See \`config.log' for more details." "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -25247,43 +19773,28 @@ int main(int argc, char **argv) { } _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +if ac_fn_c_try_run "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: no, X headers too old." >&5 -echo "$as_me: error: no, X headers too old." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "no, X headers too old." "$LINENO" 5 fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi + fi else BUILD_TYPE="$BUILD_TYPE CAIRO" if test "$build_cpu" != "x86_64"; then BUILD_PIXMAN=YES fi - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 +$as_echo "internal" >&6; } fi else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi fi @@ -25294,219 +19805,52 @@ fi -echo "$as_me:$LINENO: checking whether to build the OpenGL Transitions component" >&5 -echo $ECHO_N "checking whether to build the OpenGL Transitions component... $ECHO_C" >&6 -ENABLE_OPENGL= - -if test "x$enable_opengl" != "xno" ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - if test "${ac_cv_header_GL_gl_h+set}" = set; then - echo "$as_me:$LINENO: checking for GL/gl.h" >&5 -echo $ECHO_N "checking for GL/gl.h... $ECHO_C" >&6 -if test "${ac_cv_header_GL_gl_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_GL_gl_h" >&5 -echo "${ECHO_T}$ac_cv_header_GL_gl_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking GL/gl.h usability" >&5 -echo $ECHO_N "checking GL/gl.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking GL/gl.h presence" >&5 -echo $ECHO_N "checking GL/gl.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build the OpenGL Transitions component" >&5 +$as_echo_n "checking whether to build the OpenGL Transitions component... " >&6; } +ENABLE_OPENGL= -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: GL/gl.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: GL/gl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: GL/gl.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: GL/gl.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: GL/gl.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: GL/gl.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: GL/gl.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: GL/gl.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: GL/gl.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: GL/gl.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: GL/gl.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: GL/gl.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: GL/gl.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: GL/gl.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: GL/gl.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: GL/gl.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for GL/gl.h" >&5 -echo $ECHO_N "checking for GL/gl.h... $ECHO_C" >&6 -if test "${ac_cv_header_GL_gl_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_GL_gl_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_GL_gl_h" >&5 -echo "${ECHO_T}$ac_cv_header_GL_gl_h" >&6 +if test "x$enable_opengl" != "xno" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_fn_c_check_header_mongrel "$LINENO" "GL/gl.h" "ac_cv_header_GL_gl_h" "$ac_includes_default" +if test "x$ac_cv_header_GL_gl_h" = x""yes; then : -fi -if test $ac_cv_header_GL_gl_h = yes; then - : else - { { echo "$as_me:$LINENO: error: OpenGL headers not found" >&5 -echo "$as_me: error: OpenGL headers not found" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "OpenGL headers not found" "$LINENO" 5 fi - -echo "$as_me:$LINENO: checking for main in -lGL" >&5 -echo $ECHO_N "checking for main in -lGL... $ECHO_C" >&6 -if test "${ac_cv_lib_GL_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lGL" >&5 +$as_echo_n "checking for main in -lGL... " >&6; } +if test "${ac_cv_lib_GL_main+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lGL $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { -main (); +return main (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_GL_main=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_GL_main=no + ac_cv_lib_GL_main=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_GL_main" >&5 -echo "${ECHO_T}$ac_cv_lib_GL_main" >&6 -if test $ac_cv_lib_GL_main = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GL_main" >&5 +$as_echo "$ac_cv_lib_GL_main" >&6; } +if test "x$ac_cv_lib_GL_main" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBGL 1 _ACEOF @@ -25514,71 +19858,40 @@ _ACEOF LIBS="-lGL $LIBS" else - { { echo "$as_me:$LINENO: error: libGL not installed or functional" >&5 -echo "$as_me: error: libGL not installed or functional" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "libGL not installed or functional" "$LINENO" 5 fi - -echo "$as_me:$LINENO: checking for main in -lGLU" >&5 -echo $ECHO_N "checking for main in -lGLU... $ECHO_C" >&6 -if test "${ac_cv_lib_GLU_main+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lGLU" >&5 +$as_echo_n "checking for main in -lGLU... " >&6; } +if test "${ac_cv_lib_GLU_main+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lGLU $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { -main (); +return main (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_GLU_main=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_GLU_main=no + ac_cv_lib_GLU_main=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_GLU_main" >&5 -echo "${ECHO_T}$ac_cv_lib_GLU_main" >&6 -if test $ac_cv_lib_GLU_main = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GLU_main" >&5 +$as_echo "$ac_cv_lib_GLU_main" >&6; } +if test "x$ac_cv_lib_GLU_main" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBGLU 1 _ACEOF @@ -25586,58 +19899,56 @@ _ACEOF LIBS="-lGLU $LIBS" else - { { echo "$as_me:$LINENO: error: libGLU not installed or functional" >&5 -echo "$as_me: error: libGLU not installed or functional" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "libGLU not installed or functional" "$LINENO" 5 fi ENABLE_OPENGL=TRUE else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -echo "$as_me:$LINENO: checking whether to build the Presentation Minimizer extension" >&5 -echo $ECHO_N "checking whether to build the Presentation Minimizer extension... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build the Presentation Minimizer extension" >&5 +$as_echo_n "checking whether to build the Presentation Minimizer extension... " >&6; } if test -n "$enable_minimizer" -a "$enable_minimizer" != "no"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } ENABLE_MINIMIZER=YES else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } ENABLE_MINIMIZER=NO fi -echo "$as_me:$LINENO: checking whether to build the Presenter Screen extension" >&5 -echo $ECHO_N "checking whether to build the Presenter Screen extension... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build the Presenter Screen extension" >&5 +$as_echo_n "checking whether to build the Presenter Screen extension... " >&6; } if test -n "$enable_presenter_console" -a "$enable_presenter_screen" != "no"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } ENABLE_PRESENTER_SCREEN=YES else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } ENABLE_PRESENTER_SCREEN=NO fi -echo "$as_me:$LINENO: checking whether to build the PDF Import extension" >&5 -echo $ECHO_N "checking whether to build the PDF Import extension... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build the PDF Import extension" >&5 +$as_echo_n "checking whether to build the PDF Import extension... " >&6; } if test -n "$enable_pdfimport" -a "$enable_pdfimport" != "no"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } ENABLE_PDFIMPORT=YES - echo "$as_me:$LINENO: checking which pdf backend to use" >&5 -echo $ECHO_N "checking which pdf backend to use... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking which pdf backend to use" >&5 +$as_echo_n "checking which pdf backend to use... " >&6; } if test -n "$with_system_poppler" -o -n "$with_system_libs" && \ test "$with_system_poppler" != "no"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_POPPLER=YES succeeded=no @@ -25645,10 +19956,10 @@ echo "${ECHO_T}external" >&6 if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -25660,29 +19971,30 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -25693,25 +20005,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for poppler >= 0.8.0 " >&5 -echo $ECHO_N "checking for poppler >= 0.8.0 ... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for poppler >= 0.8.0 " >&5 +$as_echo_n "checking for poppler >= 0.8.0 ... " >&6; } if $PKG_CONFIG --exists "poppler >= 0.8.0 " ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking POPPLER_CFLAGS" >&5 -echo $ECHO_N "checking POPPLER_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking POPPLER_CFLAGS" >&5 +$as_echo_n "checking POPPLER_CFLAGS... " >&6; } POPPLER_CFLAGS=`$PKG_CONFIG --cflags "poppler >= 0.8.0 "` - echo "$as_me:$LINENO: result: $POPPLER_CFLAGS" >&5 -echo "${ECHO_T}$POPPLER_CFLAGS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $POPPLER_CFLAGS" >&5 +$as_echo "$POPPLER_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking POPPLER_LIBS" >&5 -echo $ECHO_N "checking POPPLER_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking POPPLER_LIBS" >&5 +$as_echo_n "checking POPPLER_LIBS... " >&6; } POPPLER_LIBS=`$PKG_CONFIG --libs "poppler >= 0.8.0 "` - echo "$as_me:$LINENO: result: $POPPLER_LIBS" >&5 -echo "${ECHO_T}$POPPLER_LIBS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $POPPLER_LIBS" >&5 +$as_echo "$POPPLER_LIBS" >&6; } else POPPLER_CFLAGS="" POPPLER_LIBS="" @@ -25732,30 +20044,26 @@ echo "${ECHO_T}$POPPLER_LIBS" >&6 if test $succeeded = yes; then : else - { { echo "$as_me:$LINENO: error: Library requirements (poppler >= 0.8.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 -echo "$as_me: error: Library requirements (poppler >= 0.8.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Library requirements (poppler >= 0.8.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." "$LINENO" 5 fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_POPPLER=NO BUILD_TYPE="$BUILD_TYPE XPDF" - echo "$as_me:$LINENO: checking for xpdf module" >&5 -echo $ECHO_N "checking for xpdf module... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xpdf module" >&5 +$as_echo_n "checking for xpdf module... " >&6; } if test -d ./xpdf; then - echo "$as_me:$LINENO: result: OK" >&5 -echo "${ECHO_T}OK" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5 +$as_echo "OK" >&6; } else - { { echo "$as_me:$LINENO: error: not existing. get it (did you get the -extensions tarball?)" >&5 -echo "$as_me: error: not existing. get it (did you get the -extensions tarball?)" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "not existing. get it (did you get the -extensions tarball?)" "$LINENO" 5 fi fi else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } ENABLE_PDFIMPORT=NO fi @@ -25764,82 +20072,76 @@ fi if test "$ENABLE_PRESENTER_SCREEN" = "YES" -o "$ENABLE_MINIMIZER" = "YES" -o "$ENABLE_PDFIMPORT" = "YES"; then - echo "$as_me:$LINENO: checking for sdext module" >&5 -echo $ECHO_N "checking for sdext module... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sdext module" >&5 +$as_echo_n "checking for sdext module... " >&6; } if test -d ./sdext; then - echo "$as_me:$LINENO: result: OK" >&5 -echo "${ECHO_T}OK" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5 +$as_echo "OK" >&6; } else - { { echo "$as_me:$LINENO: error: not existing. get it (did you get the -extensions tarball?)" >&5 -echo "$as_me: error: not existing. get it (did you get the -extensions tarball?)" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "not existing. get it (did you get the -extensions tarball?)" "$LINENO" 5 fi BUILD_TYPE="$BUILD_TYPE SDEXT" fi -echo "$as_me:$LINENO: checking whether to build the Wiki Publisher extension" >&5 -echo $ECHO_N "checking whether to build the Wiki Publisher extension... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build the Wiki Publisher extension" >&5 +$as_echo_n "checking whether to build the Wiki Publisher extension... " >&6; } if test -n "$enable_wiki_publisher" -a "$enable_wiki_publisher" != "no" && test "$WITH_JAVA" != "no"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - echo "$as_me:$LINENO: checking for swext module" >&5 -echo $ECHO_N "checking for swext module... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for swext module" >&5 +$as_echo_n "checking for swext module... " >&6; } if test -d ./swext; then - echo "$as_me:$LINENO: result: OK" >&5 -echo "${ECHO_T}OK" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5 +$as_echo "OK" >&6; } else - { { echo "$as_me:$LINENO: error: not existing. get it (did you get the -extensions tarball?)" >&5 -echo "$as_me: error: not existing. get it (did you get the -extensions tarball?)" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "not existing. get it (did you get the -extensions tarball?)" "$LINENO" 5 fi ENABLE_MEDIAWIKI=YES BUILD_TYPE="$BUILD_TYPE SWEXT" else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } ENABLE_MEDIAWIKI=NO fi if test "$ENABLE_MEDIAWIKI" == "YES"; then - echo "$as_me:$LINENO: checking which Servlet API Jar to use" >&5 -echo $ECHO_N "checking which Servlet API Jar to use... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking which Servlet API Jar to use" >&5 +$as_echo_n "checking which Servlet API Jar to use... " >&6; } if test -n "$with_system_servlet_api"; then - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 +$as_echo "external" >&6; } SYSTEM_SERVLETAPI=YES if test -z "$SERVLETAPI_JAR"; then SERVLETAPI_JAR=/usr/share/java/servlet-api.jar fi - as_ac_File=`echo "ac_cv_file_$SERVLETAPI_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $SERVLETAPI_JAR" >&5 -echo $ECHO_N "checking for $SERVLETAPI_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$SERVLETAPI_JAR" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $SERVLETAPI_JAR" >&5 +$as_echo_n "checking for $SERVLETAPI_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "$SERVLETAPI_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then - : +eval ac_res=\$$as_ac_File + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +eval as_val=\$$as_ac_File + if test "x$as_val" = x""yes; then : + else - { { echo "$as_me:$LINENO: error: servlet-api.jar not found." >&5 -echo "$as_me: error: servlet-api.jar not found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "servlet-api.jar not found." "$LINENO" 5 fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_SERVLETAPI=NO BUILD_TYPE="$BUILD_TYPE TOMCAT" fi @@ -25847,103 +20149,93 @@ fi -echo "$as_me:$LINENO: checking whether to build the Report Builder extension" >&5 -echo $ECHO_N "checking whether to build the Report Builder extension... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build the Report Builder extension" >&5 +$as_echo_n "checking whether to build the Report Builder extension... " >&6; } if test -n "$enable_report_builder" -a "$enable_report_builder" != "no" && test "$WITH_JAVA" != "no"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } ENABLE_REPORTBUILDER=YES - echo "$as_me:$LINENO: checking for reportbuilder module" >&5 -echo $ECHO_N "checking for reportbuilder module... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for reportbuilder module" >&5 +$as_echo_n "checking for reportbuilder module... " >&6; } if test -d ./reportbuilder; then - echo "$as_me:$LINENO: result: OK" >&5 -echo "${ECHO_T}OK" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5 +$as_echo "OK" >&6; } else - { { echo "$as_me:$LINENO: error: not existing. get it (did you get the -extensions tarball?)" >&5 -echo "$as_me: error: not existing. get it (did you get the -extensions tarball?)" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "not existing. get it (did you get the -extensions tarball?)" "$LINENO" 5 fi - echo "$as_me:$LINENO: checking which jfreereport libs to use" >&5 -echo $ECHO_N "checking which jfreereport libs to use... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking which jfreereport libs to use" >&5 +$as_echo_n "checking which jfreereport libs to use... " >&6; } if test "$with_system_jfreereport" == "yes"; then SYSTEM_JFREEREPORT=YES - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 +$as_echo "external" >&6; } if test -z $SAC_JAR; then SAC_JAR=/usr/share/java/sac.jar fi - as_ac_File=`echo "ac_cv_file_$SAC_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $SAC_JAR" >&5 -echo $ECHO_N "checking for $SAC_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$SAC_JAR" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $SAC_JAR" >&5 +$as_echo_n "checking for $SAC_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "$SAC_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then - : +eval ac_res=\$$as_ac_File + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +eval as_val=\$$as_ac_File + if test "x$as_val" = x""yes; then : + else - { { echo "$as_me:$LINENO: error: sac.jar not found." >&5 -echo "$as_me: error: sac.jar not found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "sac.jar not found." "$LINENO" 5 fi if test -z $LIBXML_JAR; then - echo "$as_me:$LINENO: checking for /usr/share/java/libxml-1.0.0.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/libxml-1.0.0.jar... $ECHO_C" >&6 -if test "${ac_cv_file__usr_share_java_libxml_1_0_0_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/libxml-1.0.0.jar" >&5 +$as_echo_n "checking for /usr/share/java/libxml-1.0.0.jar... " >&6; } +if test "${ac_cv_file__usr_share_java_libxml_1_0_0_jar+set}" = set; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "/usr/share/java/libxml-1.0.0.jar"; then ac_cv_file__usr_share_java_libxml_1_0_0_jar=yes else ac_cv_file__usr_share_java_libxml_1_0_0_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libxml_1_0_0_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_libxml_1_0_0_jar" >&6 -if test $ac_cv_file__usr_share_java_libxml_1_0_0_jar = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_libxml_1_0_0_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_libxml_1_0_0_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_libxml_1_0_0_jar" = x""yes; then : LIBXML_JAR=/usr/share/java/libxml-1.0.0.jar else - echo "$as_me:$LINENO: checking for /usr/share/java/libxml.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/libxml.jar... $ECHO_C" >&6 -if test "${ac_cv_file__usr_share_java_libxml_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/libxml.jar" >&5 +$as_echo_n "checking for /usr/share/java/libxml.jar... " >&6; } +if test "${ac_cv_file__usr_share_java_libxml_jar+set}" = set; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "/usr/share/java/libxml.jar"; then ac_cv_file__usr_share_java_libxml_jar=yes else ac_cv_file__usr_share_java_libxml_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libxml_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_libxml_jar" >&6 -if test $ac_cv_file__usr_share_java_libxml_jar = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_libxml_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_libxml_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_libxml_jar" = x""yes; then : LIBXML_JAR=/usr/share/java/libxml.jar else - { { echo "$as_me:$LINENO: error: libxml.jar replacement not found." >&5 -echo "$as_me: error: libxml.jar replacement not found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "libxml.jar replacement not found." "$LINENO" 5 fi @@ -25952,79 +20244,71 @@ fi fi else - as_ac_File=`echo "ac_cv_file_$LIBXML_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $LIBXML_JAR" >&5 -echo $ECHO_N "checking for $LIBXML_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$LIBXML_JAR" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LIBXML_JAR" >&5 +$as_echo_n "checking for $LIBXML_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "$LIBXML_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then - : +eval ac_res=\$$as_ac_File + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +eval as_val=\$$as_ac_File + if test "x$as_val" = x""yes; then : + else - { { echo "$as_me:$LINENO: error: libxml.jar not found." >&5 -echo "$as_me: error: libxml.jar not found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "libxml.jar not found." "$LINENO" 5 fi fi if test -z $FLUTE_JAR; then - echo "$as_me:$LINENO: checking for /usr/share/java/flute-1.3.0.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/flute-1.3.0.jar... $ECHO_C" >&6 -if test "${ac_cv_file__usr_share_java_flute_1_3_0_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/flute-1.3.0.jar" >&5 +$as_echo_n "checking for /usr/share/java/flute-1.3.0.jar... " >&6; } +if test "${ac_cv_file__usr_share_java_flute_1_3_0_jar+set}" = set; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "/usr/share/java/flute-1.3.0.jar"; then ac_cv_file__usr_share_java_flute_1_3_0_jar=yes else ac_cv_file__usr_share_java_flute_1_3_0_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_flute_1_3_0_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_flute_1_3_0_jar" >&6 -if test $ac_cv_file__usr_share_java_flute_1_3_0_jar = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_flute_1_3_0_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_flute_1_3_0_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_flute_1_3_0_jar" = x""yes; then : FLUTE_JAR=/usr/share/java/flute-1.3.0.jar else - echo "$as_me:$LINENO: checking for /usr/share/java/flute.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/flute.jar... $ECHO_C" >&6 -if test "${ac_cv_file__usr_share_java_flute_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/flute.jar" >&5 +$as_echo_n "checking for /usr/share/java/flute.jar... " >&6; } +if test "${ac_cv_file__usr_share_java_flute_jar+set}" = set; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "/usr/share/java/flute.jar"; then ac_cv_file__usr_share_java_flute_jar=yes else ac_cv_file__usr_share_java_flute_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_flute_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_flute_jar" >&6 -if test $ac_cv_file__usr_share_java_flute_jar = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_flute_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_flute_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_flute_jar" = x""yes; then : FLUTE_JAR=/usr/share/java/flute.jar else - { { echo "$as_me:$LINENO: error: flute-1.3.0.jar replacement not found." >&5 -echo "$as_me: error: flute-1.3.0.jar replacement not found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "flute-1.3.0.jar replacement not found." "$LINENO" 5 fi @@ -26033,79 +20317,71 @@ fi fi else - as_ac_File=`echo "ac_cv_file_$FLUTE_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $FLUTE_JAR" >&5 -echo $ECHO_N "checking for $FLUTE_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$FLUTE_JAR" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $FLUTE_JAR" >&5 +$as_echo_n "checking for $FLUTE_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "$FLUTE_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then - : +eval ac_res=\$$as_ac_File + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +eval as_val=\$$as_ac_File + if test "x$as_val" = x""yes; then : + else - { { echo "$as_me:$LINENO: error: flute-1.3.0.jar not found." >&5 -echo "$as_me: error: flute-1.3.0.jar not found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "flute-1.3.0.jar not found." "$LINENO" 5 fi fi if test -z $JFREEREPORT_JAR; then - echo "$as_me:$LINENO: checking for /usr/share/java/flow-engine-0.9.2.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/flow-engine-0.9.2.jar... $ECHO_C" >&6 -if test "${ac_cv_file__usr_share_java_flow_engine_0_9_2_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/flow-engine-0.9.2.jar" >&5 +$as_echo_n "checking for /usr/share/java/flow-engine-0.9.2.jar... " >&6; } +if test "${ac_cv_file__usr_share_java_flow_engine_0_9_2_jar+set}" = set; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "/usr/share/java/flow-engine-0.9.2.jar"; then ac_cv_file__usr_share_java_flow_engine_0_9_2_jar=yes else ac_cv_file__usr_share_java_flow_engine_0_9_2_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_flow_engine_0_9_2_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_flow_engine_0_9_2_jar" >&6 -if test $ac_cv_file__usr_share_java_flow_engine_0_9_2_jar = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_flow_engine_0_9_2_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_flow_engine_0_9_2_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_flow_engine_0_9_2_jar" = x""yes; then : JFREEREPORT_JAR=/usr/share/java/flow-engine-0.9.2.jar else - echo "$as_me:$LINENO: checking for /usr/share/java/flow-engine.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/flow-engine.jar... $ECHO_C" >&6 -if test "${ac_cv_file__usr_share_java_flow_engine_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/flow-engine.jar" >&5 +$as_echo_n "checking for /usr/share/java/flow-engine.jar... " >&6; } +if test "${ac_cv_file__usr_share_java_flow_engine_jar+set}" = set; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "/usr/share/java/flow-engine.jar"; then ac_cv_file__usr_share_java_flow_engine_jar=yes else ac_cv_file__usr_share_java_flow_engine_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_flow_engine_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_flow_engine_jar" >&6 -if test $ac_cv_file__usr_share_java_flow_engine_jar = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_flow_engine_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_flow_engine_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_flow_engine_jar" = x""yes; then : JFREEREPORT_JAR=/usr/share/java/flow-engine.jar else - { { echo "$as_me:$LINENO: error: jfreereport.jar replacement not found." >&5 -echo "$as_me: error: jfreereport.jar replacement not found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "jfreereport.jar replacement not found." "$LINENO" 5 fi @@ -26114,79 +20390,71 @@ fi fi else - as_ac_File=`echo "ac_cv_file_$JFREEREPORT_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $JFREEREPORT_JAR" >&5 -echo $ECHO_N "checking for $JFREEREPORT_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$JFREEREPORT_JAR" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $JFREEREPORT_JAR" >&5 +$as_echo_n "checking for $JFREEREPORT_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "$JFREEREPORT_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then - : +eval ac_res=\$$as_ac_File + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +eval as_val=\$$as_ac_File + if test "x$as_val" = x""yes; then : + else - { { echo "$as_me:$LINENO: error: jfreereport.jar not found." >&5 -echo "$as_me: error: jfreereport.jar not found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "jfreereport.jar not found." "$LINENO" 5 fi fi if test -z $LIBLAYOUT_JAR; then - echo "$as_me:$LINENO: checking for /usr/share/java/liblayout-0.2.9.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/liblayout-0.2.9.jar... $ECHO_C" >&6 -if test "${ac_cv_file__usr_share_java_liblayout_0_2_9_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/liblayout-0.2.9.jar" >&5 +$as_echo_n "checking for /usr/share/java/liblayout-0.2.9.jar... " >&6; } +if test "${ac_cv_file__usr_share_java_liblayout_0_2_9_jar+set}" = set; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "/usr/share/java/liblayout-0.2.9.jar"; then ac_cv_file__usr_share_java_liblayout_0_2_9_jar=yes else ac_cv_file__usr_share_java_liblayout_0_2_9_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_liblayout_0_2_9_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_liblayout_0_2_9_jar" >&6 -if test $ac_cv_file__usr_share_java_liblayout_0_2_9_jar = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_liblayout_0_2_9_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_liblayout_0_2_9_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_liblayout_0_2_9_jar" = x""yes; then : LIBLAYOUT_JAR=/usr/share/java/liblayout-0.2.9.jar else - echo "$as_me:$LINENO: checking for /usr/share/java/liblayout.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/liblayout.jar... $ECHO_C" >&6 -if test "${ac_cv_file__usr_share_java_liblayout_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/liblayout.jar" >&5 +$as_echo_n "checking for /usr/share/java/liblayout.jar... " >&6; } +if test "${ac_cv_file__usr_share_java_liblayout_jar+set}" = set; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "/usr/share/java/liblayout.jar"; then ac_cv_file__usr_share_java_liblayout_jar=yes else ac_cv_file__usr_share_java_liblayout_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_liblayout_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_liblayout_jar" >&6 -if test $ac_cv_file__usr_share_java_liblayout_jar = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_liblayout_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_liblayout_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_liblayout_jar" = x""yes; then : LIBLAYOUT_JAR=/usr/share/java/liblayout.jar else - { { echo "$as_me:$LINENO: error: liblayout.jar replacement not found." >&5 -echo "$as_me: error: liblayout.jar replacement not found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "liblayout.jar replacement not found." "$LINENO" 5 fi @@ -26195,79 +20463,71 @@ fi fi else - as_ac_File=`echo "ac_cv_file_$LIBLAYOUT_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $LIBLAYOUT_JAR" >&5 -echo $ECHO_N "checking for $LIBLAYOUT_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$LIBLAYOUT_JAR" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LIBLAYOUT_JAR" >&5 +$as_echo_n "checking for $LIBLAYOUT_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "$LIBLAYOUT_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then - : +eval ac_res=\$$as_ac_File + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +eval as_val=\$$as_ac_File + if test "x$as_val" = x""yes; then : + else - { { echo "$as_me:$LINENO: error: liblayout.jar not found." >&5 -echo "$as_me: error: liblayout.jar not found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "liblayout.jar not found." "$LINENO" 5 fi fi if test -z $LIBLOADER_JAR; then - echo "$as_me:$LINENO: checking for /usr/share/java/libloader-1.0.0.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/libloader-1.0.0.jar... $ECHO_C" >&6 -if test "${ac_cv_file__usr_share_java_libloader_1_0_0_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/libloader-1.0.0.jar" >&5 +$as_echo_n "checking for /usr/share/java/libloader-1.0.0.jar... " >&6; } +if test "${ac_cv_file__usr_share_java_libloader_1_0_0_jar+set}" = set; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "/usr/share/java/libloader-1.0.0.jar"; then ac_cv_file__usr_share_java_libloader_1_0_0_jar=yes else ac_cv_file__usr_share_java_libloader_1_0_0_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libloader_1_0_0_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_libloader_1_0_0_jar" >&6 -if test $ac_cv_file__usr_share_java_libloader_1_0_0_jar = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_libloader_1_0_0_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_libloader_1_0_0_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_libloader_1_0_0_jar" = x""yes; then : LIBLOADER_JAR=/usr/share/java/libloader-1.0.0.jar else - echo "$as_me:$LINENO: checking for /usr/share/java/libloader.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/libloader.jar... $ECHO_C" >&6 -if test "${ac_cv_file__usr_share_java_libloader_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/libloader.jar" >&5 +$as_echo_n "checking for /usr/share/java/libloader.jar... " >&6; } +if test "${ac_cv_file__usr_share_java_libloader_jar+set}" = set; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "/usr/share/java/libloader.jar"; then ac_cv_file__usr_share_java_libloader_jar=yes else ac_cv_file__usr_share_java_libloader_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libloader_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_libloader_jar" >&6 -if test $ac_cv_file__usr_share_java_libloader_jar = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_libloader_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_libloader_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_libloader_jar" = x""yes; then : LIBLOADER_JAR=/usr/share/java/libloader.jar else - { { echo "$as_me:$LINENO: error: libloader.jar replacement not found." >&5 -echo "$as_me: error: libloader.jar replacement not found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "libloader.jar replacement not found." "$LINENO" 5 fi @@ -26276,79 +20536,71 @@ fi fi else - as_ac_File=`echo "ac_cv_file_$LIBLOADER_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $LIBLOADER_JAR" >&5 -echo $ECHO_N "checking for $LIBLOADER_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$LIBLOADER_JAR" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LIBLOADER_JAR" >&5 +$as_echo_n "checking for $LIBLOADER_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "$LIBLOADER_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then - : +eval ac_res=\$$as_ac_File + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +eval as_val=\$$as_ac_File + if test "x$as_val" = x""yes; then : + else - { { echo "$as_me:$LINENO: error: libloader.jar not found." >&5 -echo "$as_me: error: libloader.jar not found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "libloader.jar not found." "$LINENO" 5 fi fi if test -z $LIBFORMULA_JAR; then - echo "$as_me:$LINENO: checking for /usr/share/java/libformula-0.2.0.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/libformula-0.2.0.jar... $ECHO_C" >&6 -if test "${ac_cv_file__usr_share_java_libformula_0_2_0_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/libformula-0.2.0.jar" >&5 +$as_echo_n "checking for /usr/share/java/libformula-0.2.0.jar... " >&6; } +if test "${ac_cv_file__usr_share_java_libformula_0_2_0_jar+set}" = set; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "/usr/share/java/libformula-0.2.0.jar"; then ac_cv_file__usr_share_java_libformula_0_2_0_jar=yes else ac_cv_file__usr_share_java_libformula_0_2_0_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libformula_0_2_0_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_libformula_0_2_0_jar" >&6 -if test $ac_cv_file__usr_share_java_libformula_0_2_0_jar = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_libformula_0_2_0_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_libformula_0_2_0_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_libformula_0_2_0_jar" = x""yes; then : LIBFORMULA_JAR=/usr/share/java/libformula-0.2.0.jar else - echo "$as_me:$LINENO: checking for /usr/share/java/libformula.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/libformula.jar... $ECHO_C" >&6 -if test "${ac_cv_file__usr_share_java_libformula_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/libformula.jar" >&5 +$as_echo_n "checking for /usr/share/java/libformula.jar... " >&6; } +if test "${ac_cv_file__usr_share_java_libformula_jar+set}" = set; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "/usr/share/java/libformula.jar"; then ac_cv_file__usr_share_java_libformula_jar=yes else ac_cv_file__usr_share_java_libformula_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libformula_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_libformula_jar" >&6 -if test $ac_cv_file__usr_share_java_libformula_jar = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_libformula_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_libformula_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_libformula_jar" = x""yes; then : LIBFORMULA_JAR=/usr/share/java/libformula.jar else - { { echo "$as_me:$LINENO: error: libformula.jar replacement not found." >&5 -echo "$as_me: error: libformula.jar replacement not found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "libformula.jar replacement not found." "$LINENO" 5 fi @@ -26357,79 +20609,71 @@ fi fi else - as_ac_File=`echo "ac_cv_file_$LIBFORMULA_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $LIBFORMULA_JAR" >&5 -echo $ECHO_N "checking for $LIBFORMULA_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$LIBFORMULA_JAR" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LIBFORMULA_JAR" >&5 +$as_echo_n "checking for $LIBFORMULA_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "$LIBFORMULA_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then - : +eval ac_res=\$$as_ac_File + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +eval as_val=\$$as_ac_File + if test "x$as_val" = x""yes; then : + else - { { echo "$as_me:$LINENO: error: libformula.jar not found." >&5 -echo "$as_me: error: libformula.jar not found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "libformula.jar not found." "$LINENO" 5 fi fi if test -z $LIBREPOSITORY_JAR; then - echo "$as_me:$LINENO: checking for /usr/share/java/librepository-1.0.0.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/librepository-1.0.0.jar... $ECHO_C" >&6 -if test "${ac_cv_file__usr_share_java_librepository_1_0_0_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/librepository-1.0.0.jar" >&5 +$as_echo_n "checking for /usr/share/java/librepository-1.0.0.jar... " >&6; } +if test "${ac_cv_file__usr_share_java_librepository_1_0_0_jar+set}" = set; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "/usr/share/java/librepository-1.0.0.jar"; then ac_cv_file__usr_share_java_librepository_1_0_0_jar=yes else ac_cv_file__usr_share_java_librepository_1_0_0_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_librepository_1_0_0_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_librepository_1_0_0_jar" >&6 -if test $ac_cv_file__usr_share_java_librepository_1_0_0_jar = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_librepository_1_0_0_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_librepository_1_0_0_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_librepository_1_0_0_jar" = x""yes; then : LIBREPOSITORY_JAR=/usr/share/java/librepository-1.0.0.jar else - echo "$as_me:$LINENO: checking for /usr/share/java/librepository.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/librepository.jar... $ECHO_C" >&6 -if test "${ac_cv_file__usr_share_java_librepository_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/librepository.jar" >&5 +$as_echo_n "checking for /usr/share/java/librepository.jar... " >&6; } +if test "${ac_cv_file__usr_share_java_librepository_jar+set}" = set; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "/usr/share/java/librepository.jar"; then ac_cv_file__usr_share_java_librepository_jar=yes else ac_cv_file__usr_share_java_librepository_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_librepository_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_librepository_jar" >&6 -if test $ac_cv_file__usr_share_java_librepository_jar = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_librepository_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_librepository_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_librepository_jar" = x""yes; then : LIBREPOSITORY_JAR=/usr/share/java/librepository.jar else - { { echo "$as_me:$LINENO: error: librepository.jar replacement not found." >&5 -echo "$as_me: error: librepository.jar replacement not found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "librepository.jar replacement not found." "$LINENO" 5 fi @@ -26438,79 +20682,71 @@ fi fi else - as_ac_File=`echo "ac_cv_file_$LIBREPOSITORY_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $LIBREPOSITORY_JAR" >&5 -echo $ECHO_N "checking for $LIBREPOSITORY_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$LIBREPOSITORY_JAR" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LIBREPOSITORY_JAR" >&5 +$as_echo_n "checking for $LIBREPOSITORY_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "$LIBREPOSITORY_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then - : +eval ac_res=\$$as_ac_File + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +eval as_val=\$$as_ac_File + if test "x$as_val" = x""yes; then : + else - { { echo "$as_me:$LINENO: error: librepository.jar not found." >&5 -echo "$as_me: error: librepository.jar not found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "librepository.jar not found." "$LINENO" 5 fi fi if test -z $LIBFONTS_JAR; then - echo "$as_me:$LINENO: checking for /usr/share/java/libfonts-1.0.0.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/libfonts-1.0.0.jar... $ECHO_C" >&6 -if test "${ac_cv_file__usr_share_java_libfonts_1_0_0_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/libfonts-1.0.0.jar" >&5 +$as_echo_n "checking for /usr/share/java/libfonts-1.0.0.jar... " >&6; } +if test "${ac_cv_file__usr_share_java_libfonts_1_0_0_jar+set}" = set; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "/usr/share/java/libfonts-1.0.0.jar"; then ac_cv_file__usr_share_java_libfonts_1_0_0_jar=yes else ac_cv_file__usr_share_java_libfonts_1_0_0_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libfonts_1_0_0_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_libfonts_1_0_0_jar" >&6 -if test $ac_cv_file__usr_share_java_libfonts_1_0_0_jar = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_libfonts_1_0_0_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_libfonts_1_0_0_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_libfonts_1_0_0_jar" = x""yes; then : LIBFONTS_JAR=/usr/share/java/libfonts-1.0.0.jar else - echo "$as_me:$LINENO: checking for /usr/share/java/libfonts.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/libfonts.jar... $ECHO_C" >&6 -if test "${ac_cv_file__usr_share_java_libfonts_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/libfonts.jar" >&5 +$as_echo_n "checking for /usr/share/java/libfonts.jar... " >&6; } +if test "${ac_cv_file__usr_share_java_libfonts_jar+set}" = set; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "/usr/share/java/libfonts.jar"; then ac_cv_file__usr_share_java_libfonts_jar=yes else ac_cv_file__usr_share_java_libfonts_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libfonts_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_libfonts_jar" >&6 -if test $ac_cv_file__usr_share_java_libfonts_jar = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_libfonts_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_libfonts_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_libfonts_jar" = x""yes; then : LIBFONTS_JAR=/usr/share/java/libfonts.jar else - { { echo "$as_me:$LINENO: error: libfonts.jar replacement not found." >&5 -echo "$as_me: error: libfonts.jar replacement not found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "libfonts.jar replacement not found." "$LINENO" 5 fi @@ -26519,79 +20755,71 @@ fi fi else - as_ac_File=`echo "ac_cv_file_$LIBFONTS_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $LIBFONTS_JAR" >&5 -echo $ECHO_N "checking for $LIBFONTS_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$LIBFONTS_JAR" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LIBFONTS_JAR" >&5 +$as_echo_n "checking for $LIBFONTS_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "$LIBFONTS_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then - : +eval ac_res=\$$as_ac_File + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +eval as_val=\$$as_ac_File + if test "x$as_val" = x""yes; then : + else - { { echo "$as_me:$LINENO: error: libfonts.jar not found." >&5 -echo "$as_me: error: libfonts.jar not found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "libfonts.jar not found." "$LINENO" 5 fi fi if test -z $LIBSERIALIZER_JAR; then - echo "$as_me:$LINENO: checking for /usr/share/java/libserializer-1.0.0.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/libserializer-1.0.0.jar... $ECHO_C" >&6 -if test "${ac_cv_file__usr_share_java_libserializer_1_0_0_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/libserializer-1.0.0.jar" >&5 +$as_echo_n "checking for /usr/share/java/libserializer-1.0.0.jar... " >&6; } +if test "${ac_cv_file__usr_share_java_libserializer_1_0_0_jar+set}" = set; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "/usr/share/java/libserializer-1.0.0.jar"; then ac_cv_file__usr_share_java_libserializer_1_0_0_jar=yes else ac_cv_file__usr_share_java_libserializer_1_0_0_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libserializer_1_0_0_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_libserializer_1_0_0_jar" >&6 -if test $ac_cv_file__usr_share_java_libserializer_1_0_0_jar = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_libserializer_1_0_0_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_libserializer_1_0_0_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_libserializer_1_0_0_jar" = x""yes; then : LIBSERIALIZER_JAR=/usr/share/java/libserializer-1.0.0.jar else - echo "$as_me:$LINENO: checking for /usr/share/java/libserializer.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/libserializer.jar... $ECHO_C" >&6 -if test "${ac_cv_file__usr_share_java_libserializer_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/libserializer.jar" >&5 +$as_echo_n "checking for /usr/share/java/libserializer.jar... " >&6; } +if test "${ac_cv_file__usr_share_java_libserializer_jar+set}" = set; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "/usr/share/java/libserializer.jar"; then ac_cv_file__usr_share_java_libserializer_jar=yes else ac_cv_file__usr_share_java_libserializer_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libserializer_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_libserializer_jar" >&6 -if test $ac_cv_file__usr_share_java_libserializer_jar = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_libserializer_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_libserializer_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_libserializer_jar" = x""yes; then : LIBSERIALIZER_JAR=/usr/share/java/libserializer.jar else - { { echo "$as_me:$LINENO: error: libserializer.jar replacement not found." >&5 -echo "$as_me: error: libserializer.jar replacement not found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "libserializer.jar replacement not found." "$LINENO" 5 fi @@ -26600,80 +20828,72 @@ fi fi else - as_ac_File=`echo "ac_cv_file_$LIBSERIALIZER_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $LIBSERIALIZER_JAR" >&5 -echo $ECHO_N "checking for $LIBSERIALIZER_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$LIBSERIALIZER_JAR" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LIBSERIALIZER_JAR" >&5 +$as_echo_n "checking for $LIBSERIALIZER_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "$LIBSERIALIZER_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then - : +eval ac_res=\$$as_ac_File + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +eval as_val=\$$as_ac_File + if test "x$as_val" = x""yes; then : + else - { { echo "$as_me:$LINENO: error: libserializer.jar not found." >&5 -echo "$as_me: error: libserializer.jar not found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "libserializer.jar not found." "$LINENO" 5 fi fi if test -z $LIBBASE_JAR; then - echo "$as_me:$LINENO: checking for /usr/share/java/libbase-1.0.0.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/libbase-1.0.0.jar... $ECHO_C" >&6 -if test "${ac_cv_file__usr_share_java_libbase_1_0_0_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/libbase-1.0.0.jar" >&5 +$as_echo_n "checking for /usr/share/java/libbase-1.0.0.jar... " >&6; } +if test "${ac_cv_file__usr_share_java_libbase_1_0_0_jar+set}" = set; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "/usr/share/java/libbase-1.0.0.jar"; then ac_cv_file__usr_share_java_libbase_1_0_0_jar=yes else ac_cv_file__usr_share_java_libbase_1_0_0_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libbase_1_0_0_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_libbase_1_0_0_jar" >&6 -if test $ac_cv_file__usr_share_java_libbase_1_0_0_jar = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_libbase_1_0_0_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_libbase_1_0_0_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_libbase_1_0_0_jar" = x""yes; then : LIBBASE_JAR=/usr/share/java/libbase-1.0.0.jar else - echo "$as_me:$LINENO: checking for /usr/share/java/libbase.jar" >&5 -echo $ECHO_N "checking for /usr/share/java/libbase.jar... $ECHO_C" >&6 -if test "${ac_cv_file__usr_share_java_libbase_jar+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/libbase.jar" >&5 +$as_echo_n "checking for /usr/share/java/libbase.jar... " >&6; } +if test "${ac_cv_file__usr_share_java_libbase_jar+set}" = set; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "/usr/share/java/libbase.jar"; then ac_cv_file__usr_share_java_libbase_jar=yes else ac_cv_file__usr_share_java_libbase_jar=no fi fi -echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libbase_jar" >&5 -echo "${ECHO_T}$ac_cv_file__usr_share_java_libbase_jar" >&6 -if test $ac_cv_file__usr_share_java_libbase_jar = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_libbase_jar" >&5 +$as_echo "$ac_cv_file__usr_share_java_libbase_jar" >&6; } +if test "x$ac_cv_file__usr_share_java_libbase_jar" = x""yes; then : LIBBASE_JAR=/usr/share/java/libbase.jar else - { { echo "$as_me:$LINENO: error: libbase.jar replacement not found." >&5 -echo "$as_me: error: libbase.jar replacement not found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "libbase.jar replacement not found." "$LINENO" 5 fi @@ -26682,54 +20902,50 @@ fi fi else - as_ac_File=`echo "ac_cv_file_$LIBBASE_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $LIBBASE_JAR" >&5 -echo $ECHO_N "checking for $LIBBASE_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$LIBBASE_JAR" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LIBBASE_JAR" >&5 +$as_echo_n "checking for $LIBBASE_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "$LIBBASE_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then - : +eval ac_res=\$$as_ac_File + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +eval as_val=\$$as_ac_File + if test "x$as_val" = x""yes; then : + else - { { echo "$as_me:$LINENO: error: libbase.jar not found." >&5 -echo "$as_me: error: libbase.jar not found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "libbase.jar not found." "$LINENO" 5 fi fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 - echo "$as_me:$LINENO: checking for jfreereport module" >&5 -echo $ECHO_N "checking for jfreereport module... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 +$as_echo "internal" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jfreereport module" >&5 +$as_echo_n "checking for jfreereport module... " >&6; } if test -d ./jfreereport; then - echo "$as_me:$LINENO: result: OK" >&5 -echo "${ECHO_T}OK" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5 +$as_echo "OK" >&6; } else - { { echo "$as_me:$LINENO: error: not existing. get it (did you get the -extensions tarball?)" >&5 -echo "$as_me: error: not existing. get it (did you get the -extensions tarball?)" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "not existing. get it (did you get the -extensions tarball?)" "$LINENO" 5 fi SYSTEM_JFREEREPORT=NO BUILD_TYPE="$BUILD_TYPE JFREEREPORT" fi BUILD_TYPE="$BUILD_TYPE REPORTBUILDER" else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } ENABLE_REPORTBUILDER=NO SYSTEM_JFREEREPORT=NO fi @@ -26750,98 +20966,92 @@ fi # this has to be here because both the wiki publisher and the SRB use # commons-logging if test "$ENABLE_MEDIAWIKI" = "YES" -o "$ENABLE_REPORTBUILDER" = "YES"; then - echo "$as_me:$LINENO: checking which Apache commons-* libs to use" >&5 -echo $ECHO_N "checking which Apache commons-* libs to use... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking which Apache commons-* libs to use" >&5 +$as_echo_n "checking which Apache commons-* libs to use... " >&6; } if test "$with_system_apache_commons" = "yes"; then SYSTEM_APACHE_COMMONS=YES - echo "$as_me:$LINENO: result: external" >&5 -echo "${ECHO_T}external" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 +$as_echo "external" >&6; } if test "$ENABLE_MEDIAWIKI" = "YES"; then if test -z "$COMMONS_CODEC_JAR"; then COMMONS_CODEC_JAR=/usr/share/java/commons-codec-1.3.jar fi - as_ac_File=`echo "ac_cv_file_$COMMONS_CODEC_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $COMMONS_CODEC_JAR" >&5 -echo $ECHO_N "checking for $COMMONS_CODEC_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$COMMONS_CODEC_JAR" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $COMMONS_CODEC_JAR" >&5 +$as_echo_n "checking for $COMMONS_CODEC_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "$COMMONS_CODEC_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then - : +eval ac_res=\$$as_ac_File + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +eval as_val=\$$as_ac_File + if test "x$as_val" = x""yes; then : + else - { { echo "$as_me:$LINENO: error: commons-codec.jar not found." >&5 -echo "$as_me: error: commons-codec.jar not found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "commons-codec.jar not found." "$LINENO" 5 fi if test -z "$COMMONS_LANG_JAR"; then COMMONS_LANG_JAR=/usr/share/java/commons-lang-2.3.jar fi - as_ac_File=`echo "ac_cv_file_$COMMONS_LANG_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $COMMONS_LANG_JAR" >&5 -echo $ECHO_N "checking for $COMMONS_LANG_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$COMMONS_LANG_JAR" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $COMMONS_LANG_JAR" >&5 +$as_echo_n "checking for $COMMONS_LANG_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "$COMMONS_LANG_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then - : +eval ac_res=\$$as_ac_File + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +eval as_val=\$$as_ac_File + if test "x$as_val" = x""yes; then : + else - { { echo "$as_me:$LINENO: error: commons-lang.jar not found." >&5 -echo "$as_me: error: commons-lang.jar not found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "commons-lang.jar not found." "$LINENO" 5 fi if test -z "$COMMONS_HTTPCLIENT_JAR"; then COMMONS_HTTPCLIENT_JAR=/usr/share/java/commons-httpclient-3.1.jar fi - as_ac_File=`echo "ac_cv_file_$COMMONS_HTTPCLIENT_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $COMMONS_HTTPCLIENT_JAR" >&5 -echo $ECHO_N "checking for $COMMONS_HTTPCLIENT_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$COMMONS_HTTPCLIENT_JAR" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $COMMONS_HTTPCLIENT_JAR" >&5 +$as_echo_n "checking for $COMMONS_HTTPCLIENT_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "$COMMONS_HTTPCLIENT_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then - : +eval ac_res=\$$as_ac_File + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +eval as_val=\$$as_ac_File + if test "x$as_val" = x""yes; then : + else - { { echo "$as_me:$LINENO: error: commons-httpclient.jar not found." >&5 -echo "$as_me: error: commons-httpclient.jar not found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "commons-httpclient.jar not found." "$LINENO" 5 fi fi @@ -26849,37 +21059,35 @@ fi if test -z "$COMMONS_LOGGING_JAR"; then COMMONS_LOGGING_JAR=/usr/share/java/commons-logging-1.1.1.jar fi - as_ac_File=`echo "ac_cv_file_$COMMONS_LOGGING_JAR" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $COMMONS_LOGGING_JAR" >&5 -echo $ECHO_N "checking for $COMMONS_LOGGING_JAR... $ECHO_C" >&6 -if eval "test \"\${$as_ac_File+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + as_ac_File=`$as_echo "ac_cv_file_$COMMONS_LOGGING_JAR" | $as_tr_sh` +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $COMMONS_LOGGING_JAR" >&5 +$as_echo_n "checking for $COMMONS_LOGGING_JAR... " >&6; } +if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && - { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "$COMMONS_LOGGING_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 -if test `eval echo '${'$as_ac_File'}'` = yes; then - : +eval ac_res=\$$as_ac_File + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +eval as_val=\$$as_ac_File + if test "x$as_val" = x""yes; then : + else - { { echo "$as_me:$LINENO: error: commons-logging.jar not found." >&5 -echo "$as_me: error: commons-logging.jar not found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "commons-logging.jar not found." "$LINENO" 5 fi fi else - echo "$as_me:$LINENO: result: internal" >&5 -echo "${ECHO_T}internal" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 +$as_echo "internal" >&6; } SYSTEM_APACHE_COMMONS=NO BUILD_TYPE="$BUILD_TYPE APACHE_COMMONS TOMCAT" fi @@ -26931,8 +21139,8 @@ if test "$test_kde" = "yes" -a "$ENABLE_KDE" = "TRUE" ; then kde_test_include="ksharedptr.h" kde_test_library="libkdeui.so" - echo "$as_me:$LINENO: checking for Qt headers" >&5 -echo $ECHO_N "checking for Qt headers... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Qt headers" >&5 +$as_echo_n "checking for Qt headers... " >&6; } qt_incdir="no" for kde_check in $qt_incdirs ; do if test -r "$kde_check/$qt_test_include" ; then @@ -26940,18 +21148,15 @@ echo $ECHO_N "checking for Qt headers... $ECHO_C" >&6 break fi done - echo "$as_me:$LINENO: result: $qt_incdir" >&5 -echo "${ECHO_T}$qt_incdir" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $qt_incdir" >&5 +$as_echo "$qt_incdir" >&6; } if test "x$qt_incdir" = "xno" ; then - { { echo "$as_me:$LINENO: error: Qt headers not found. Please specify the root of -your Qt installation by exporting QTDIR before running \"configure\"." >&5 -echo "$as_me: error: Qt headers not found. Please specify the root of -your Qt installation by exporting QTDIR before running \"configure\"." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Qt headers not found. Please specify the root of +your Qt installation by exporting QTDIR before running \"configure\"." "$LINENO" 5 fi - echo "$as_me:$LINENO: checking for Qt libraries" >&5 -echo $ECHO_N "checking for Qt libraries... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Qt libraries" >&5 +$as_echo_n "checking for Qt libraries... " >&6; } qt_libdir="no" for qt_check in $qt_libdirs ; do if test -r "$qt_check/$qt_test_library" ; then @@ -26959,22 +21164,19 @@ echo $ECHO_N "checking for Qt libraries... $ECHO_C" >&6 break fi done - echo "$as_me:$LINENO: result: $qt_libdir" >&5 -echo "${ECHO_T}$qt_libdir" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $qt_libdir" >&5 +$as_echo "$qt_libdir" >&6; } if test "x$qt_libdir" = "xno" ; then - { { echo "$as_me:$LINENO: error: Qt libraries not found. Please specify the root of -your Qt installation by exporting QTDIR before running \"configure\"." >&5 -echo "$as_me: error: Qt libraries not found. Please specify the root of -your Qt installation by exporting QTDIR before running \"configure\"." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Qt libraries not found. Please specify the root of +your Qt installation by exporting QTDIR before running \"configure\"." "$LINENO" 5 fi # Extract the first word of "moc", so it can be a program name with args. set dummy moc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_MOC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_MOC+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $MOC in [\\/]* | ?:[\\/]*) @@ -26987,39 +21189,37 @@ for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MOC="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS test -z "$ac_cv_path_MOC" && ac_cv_path_MOC="no" ;; esac fi MOC=$ac_cv_path_MOC - if test -n "$MOC"; then - echo "$as_me:$LINENO: result: $MOC" >&5 -echo "${ECHO_T}$MOC" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOC" >&5 +$as_echo "$MOC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + if test "$MOC" = "no" ; then - { { echo "$as_me:$LINENO: error: Qt Meta Object Compiler not found. Please specify -the root of your Qt installation by exporting QTDIR before running \"configure\"." >&5 -echo "$as_me: error: Qt Meta Object Compiler not found. Please specify -the root of your Qt installation by exporting QTDIR before running \"configure\"." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Qt Meta Object Compiler not found. Please specify +the root of your Qt installation by exporting QTDIR before running \"configure\"." "$LINENO" 5 fi - echo "$as_me:$LINENO: checking for KDE headers" >&5 -echo $ECHO_N "checking for KDE headers... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for KDE headers" >&5 +$as_echo_n "checking for KDE headers... " >&6; } kde_incdir="no" for kde_check in $kde_incdirs ; do if test -r "$kde_check/$kde_test_include" ; then @@ -27027,18 +21227,15 @@ echo $ECHO_N "checking for KDE headers... $ECHO_C" >&6 break fi done - echo "$as_me:$LINENO: result: $kde_incdir" >&5 -echo "${ECHO_T}$kde_incdir" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $kde_incdir" >&5 +$as_echo "$kde_incdir" >&6; } if test "x$kde_incdir" = "xno" ; then - { { echo "$as_me:$LINENO: error: KDE headers not found. Please specify the root of -your KDE installation by exporting KDEDIR before running \"configure\"." >&5 -echo "$as_me: error: KDE headers not found. Please specify the root of -your KDE installation by exporting KDEDIR before running \"configure\"." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "KDE headers not found. Please specify the root of +your KDE installation by exporting KDEDIR before running \"configure\"." "$LINENO" 5 fi - echo "$as_me:$LINENO: checking for KDE libraries" >&5 -echo $ECHO_N "checking for KDE libraries... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for KDE libraries" >&5 +$as_echo_n "checking for KDE libraries... " >&6; } kde_libdir="no" for kde_check in $kde_libdirs ; do if test -r "$kde_check/$kde_test_library" ; then @@ -27046,14 +21243,11 @@ echo $ECHO_N "checking for KDE libraries... $ECHO_C" >&6 break fi done - echo "$as_me:$LINENO: result: $kde_libdir" >&5 -echo "${ECHO_T}$kde_libdir" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $kde_libdir" >&5 +$as_echo "$kde_libdir" >&6; } if test "x$kde_libdir" = "xno" ; then - { { echo "$as_me:$LINENO: error: KDE libraries not found. Please specify the root of -your KDE installation by exporting KDEDIR before running \"configure\"." >&5 -echo "$as_me: error: KDE libraries not found. Please specify the root of -your KDE installation by exporting KDEDIR before running \"configure\"." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "KDE libraries not found. Please specify the root of +your KDE installation by exporting KDEDIR before running \"configure\"." "$LINENO" 5 fi KDE_CFLAGS="-I$qt_incdir -I$kde_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT" @@ -27093,8 +21287,8 @@ if test "$test_kde4" = "yes" -a "$ENABLE_KDE4" = "TRUE" ; then kde_test_include="ksharedptr.h" kde_test_library="libkdeui.so" - echo "$as_me:$LINENO: checking for Qt4 headers" >&5 -echo $ECHO_N "checking for Qt4 headers... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Qt4 headers" >&5 +$as_echo_n "checking for Qt4 headers... " >&6; } qt_header_dir="no" for inc_dir in $qt_incdirs ; do if test -r "$inc_dir/$qt_test_include" ; then @@ -27103,16 +21297,14 @@ echo $ECHO_N "checking for Qt4 headers... $ECHO_C" >&6 fi done - echo "$as_me:$LINENO: result: $qt_header_dir" >&5 -echo "${ECHO_T}$qt_header_dir" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $qt_header_dir" >&5 +$as_echo "$qt_header_dir" >&6; } if test "x$qt_header_dir" = "xno" ; then - { { echo "$as_me:$LINENO: error: Qt4 headers not found. Please specify the root of your Qt4 installation by exporting QT4DIR before running \"configure\"." >&5 -echo "$as_me: error: Qt4 headers not found. Please specify the root of your Qt4 installation by exporting QT4DIR before running \"configure\"." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Qt4 headers not found. Please specify the root of your Qt4 installation by exporting QT4DIR before running \"configure\"." "$LINENO" 5 fi - echo "$as_me:$LINENO: checking for Qt4 libraries" >&5 -echo $ECHO_N "checking for Qt4 libraries... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Qt4 libraries" >&5 +$as_echo_n "checking for Qt4 libraries... " >&6; } qt_lib_dir="no" for lib_dir in $qt_libdirs ; do if test -r "$lib_dir/$qt_test_library" ; then @@ -27121,21 +21313,19 @@ echo $ECHO_N "checking for Qt4 libraries... $ECHO_C" >&6 fi done - echo "$as_me:$LINENO: result: $qt_lib_dir" >&5 -echo "${ECHO_T}$qt_lib_dir" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $qt_lib_dir" >&5 +$as_echo "$qt_lib_dir" >&6; } if test "x$qt_lib_dir" = "xno" ; then - { { echo "$as_me:$LINENO: error: Qt4 libraries not found. Please specify the root of your Qt4 installation by exporting QT4DIR before running \"configure\"." >&5 -echo "$as_me: error: Qt4 libraries not found. Please specify the root of your Qt4 installation by exporting QT4DIR before running \"configure\"." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Qt4 libraries not found. Please specify the root of your Qt4 installation by exporting QT4DIR before running \"configure\"." "$LINENO" 5 fi # Extract the first word of "moc", so it can be a program name with args. set dummy moc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_MOC4+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_MOC4+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $MOC4 in [\\/]* | ?:[\\/]*) @@ -27148,39 +21338,37 @@ for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_MOC4="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS test -z "$ac_cv_path_MOC4" && ac_cv_path_MOC4="no" ;; esac fi MOC4=$ac_cv_path_MOC4 - if test -n "$MOC4"; then - echo "$as_me:$LINENO: result: $MOC4" >&5 -echo "${ECHO_T}$MOC4" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOC4" >&5 +$as_echo "$MOC4" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + if test "$MOC4" = "no" ; then - { { echo "$as_me:$LINENO: error: Qt Meta Object Compiler not found. Please specify -the root of your Qt installation by exporting QT4DIR before running \"configure\"." >&5 -echo "$as_me: error: Qt Meta Object Compiler not found. Please specify -the root of your Qt installation by exporting QT4DIR before running \"configure\"." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Qt Meta Object Compiler not found. Please specify +the root of your Qt installation by exporting QT4DIR before running \"configure\"." "$LINENO" 5 fi - echo "$as_me:$LINENO: checking for KDE4 headers" >&5 -echo $ECHO_N "checking for KDE4 headers... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for KDE4 headers" >&5 +$as_echo_n "checking for KDE4 headers... " >&6; } kde_incdir="no" for kde_check in $kde_incdirs ; do if test -r "$kde_check/$kde_test_include" ; then @@ -27188,16 +21376,14 @@ echo $ECHO_N "checking for KDE4 headers... $ECHO_C" >&6 break fi done - echo "$as_me:$LINENO: result: $kde_incdir" >&5 -echo "${ECHO_T}$kde_incdir" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $kde_incdir" >&5 +$as_echo "$kde_incdir" >&6; } if test "x$kde_incdir" = "xno" ; then - { { echo "$as_me:$LINENO: error: KDE4 headers not found. Please specify the root of your KDE4 installation by exporting KDE4DIR before running \"configure\"." >&5 -echo "$as_me: error: KDE4 headers not found. Please specify the root of your KDE4 installation by exporting KDE4DIR before running \"configure\"." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "KDE4 headers not found. Please specify the root of your KDE4 installation by exporting KDE4DIR before running \"configure\"." "$LINENO" 5 fi - echo "$as_me:$LINENO: checking for KDE4 libraries" >&5 -echo $ECHO_N "checking for KDE4 libraries... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for KDE4 libraries" >&5 +$as_echo_n "checking for KDE4 libraries... " >&6; } kde_libdir="no" for kde_check in $kde_libdirs ; do if test -r "$kde_check/$kde_test_library" ; then @@ -27206,12 +21392,10 @@ echo $ECHO_N "checking for KDE4 libraries... $ECHO_C" >&6 fi done - echo "$as_me:$LINENO: result: $kde_libdir" >&5 -echo "${ECHO_T}$kde_libdir" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $kde_libdir" >&5 +$as_echo "$kde_libdir" >&6; } if test "x$kde_libdir" = "xno" ; then - { { echo "$as_me:$LINENO: error: KDE4 libraries not found. Please specify the root of your KDE4 installation by exporting KDE4DIR before running \"configure\"." >&5 -echo "$as_me: error: KDE4 libraries not found. Please specify the root of your KDE4 installation by exporting KDE4DIR before running \"configure\"." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "KDE4 libraries not found. Please specify the root of your KDE4 installation by exporting KDE4DIR before running \"configure\"." "$LINENO" 5 fi KDE4_CFLAGS="`pkg-config --cflags QtCore` `pkg-config --cflags QtGui` -I$kde_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT" @@ -27221,34 +21405,34 @@ fi -echo "$as_me:$LINENO: checking whether to enable the lockdown pieces" >&5 -echo $ECHO_N "checking whether to enable the lockdown pieces... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable the lockdown pieces" >&5 +$as_echo_n "checking whether to enable the lockdown pieces... " >&6; } ENABLE_LOCKDOWN="" if test -n "$enable_lockdown" && test "$enable_lockdown" != "no"; then ENABLE_LOCKDOWN=YES - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -echo "$as_me:$LINENO: checking whether to enable evolution 2 support" >&5 -echo $ECHO_N "checking whether to enable evolution 2 support... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable evolution 2 support" >&5 +$as_echo_n "checking whether to enable evolution 2 support... " >&6; } if test "$enable_evolution2" = "yes" -o "$enable_evolution2" = "TRUE"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=no if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -27260,29 +21444,30 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG - if test -n "$PKG_CONFIG"; then - echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 -echo "${ECHO_T}$PKG_CONFIG" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi if test "$PKG_CONFIG" = "no" ; then @@ -27293,25 +21478,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - echo "$as_me:$LINENO: checking for gobject-2.0" >&5 -echo $ECHO_N "checking for gobject-2.0... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gobject-2.0" >&5 +$as_echo_n "checking for gobject-2.0... " >&6; } if $PKG_CONFIG --exists "gobject-2.0" ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } succeeded=yes - echo "$as_me:$LINENO: checking GOBJECT_CFLAGS" >&5 -echo $ECHO_N "checking GOBJECT_CFLAGS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking GOBJECT_CFLAGS" >&5 +$as_echo_n "checking GOBJECT_CFLAGS... " >&6; } GOBJECT_CFLAGS=`$PKG_CONFIG --cflags "gobject-2.0"` - echo "$as_me:$LINENO: result: $GOBJECT_CFLAGS" >&5 -echo "${ECHO_T}$GOBJECT_CFLAGS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GOBJECT_CFLAGS" >&5 +$as_echo "$GOBJECT_CFLAGS" >&6; } - echo "$as_me:$LINENO: checking GOBJECT_LIBS" >&5 -echo $ECHO_N "checking GOBJECT_LIBS... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking GOBJECT_LIBS" >&5 +$as_echo_n "checking GOBJECT_LIBS... " >&6; } GOBJECT_LIBS=`$PKG_CONFIG --libs "gobject-2.0"` - echo "$as_me:$LINENO: result: $GOBJECT_LIBS" >&5 -echo "${ECHO_T}$GOBJECT_LIBS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GOBJECT_LIBS" >&5 +$as_echo "$GOBJECT_LIBS" >&6; } else GOBJECT_CFLAGS="" GOBJECT_LIBS="" @@ -27332,27 +21517,25 @@ echo "${ECHO_T}$GOBJECT_LIBS" >&6 if test $succeeded = yes; then : else - { { echo "$as_me:$LINENO: error: Library requirements (gobject-2.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 -echo "$as_me: error: Library requirements (gobject-2.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Library requirements (gobject-2.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." "$LINENO" 5 fi ENABLE_EVOAB2="TRUE" else ENABLE_EVOAB2="" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -echo "$as_me:$LINENO: checking whether to enable KDE address book support" >&5 -echo $ECHO_N "checking whether to enable KDE address book support... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable KDE address book support" >&5 +$as_echo_n "checking whether to enable KDE address book support... " >&6; } if test "$enable_kdeab" = "yes" && test "$enable_kde" = "yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - ac_ext=cc + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -27360,20 +21543,15 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu save_CXXFLAGS=$CXXFLAGS CXXFLAGS="$CXXFLAGS $KDE_CFLAGS" - echo "$as_me:$LINENO: checking whether KDE is between 3.2 and 3.6" >&5 -echo $ECHO_N "checking whether KDE is between 3.2 and 3.6... $ECHO_C" >&6 - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether KDE is between 3.2 and 3.6" >&5 +$as_echo_n "checking whether KDE is between 3.2 and 3.6... " >&6; } + if test "$cross_compiling" = yes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot run test program while cross compiling +See \`config.log' for more details." "$LINENO" 5; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -27384,31 +21562,16 @@ int main(int argc, char **argv) { } _ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +if ac_fn_cxx_try_run "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: KDE version too old or too recent, please use another version of KDE or disable KDE address book support" >&5 -echo "$as_me: error: KDE version too old or too recent, please use another version of KDE or disable KDE address book support" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "KDE version too old or too recent, please use another version of KDE or disable KDE address book support" "$LINENO" 5 fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext fi + CXXFLAGS=$save_CXXFLAGS ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -27418,254 +21581,87 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu ENABLE_KAB=TRUE else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } ENABLE_KAB= fi -echo "$as_me:$LINENO: checking whether to include FontOOo" >&5 -echo $ECHO_N "checking whether to include FontOOo... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include FontOOo" >&5 +$as_echo_n "checking whether to include FontOOo... " >&6; } if test -n "$enable_fontooo"; then if test "$enable_fontooo" = "no"; then - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } WITH_FONTOOO=NO SCPDEFS="$SCPDEFS -DWITHOUT_FONTOOO" else - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } WITH_FONTOOO=YES BUILD_TYPE="$BUILD_TYPE MSFONTEXTRACT" fi else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } WITH_FONTOOO=NO SCPDEFS="$SCPDEFS -DWITHOUT_FONTOOO" fi if test "$WITH_FONTOOO" = "YES"; then - echo "$as_me:$LINENO: checking whether to use system libmspack" >&5 -echo $ECHO_N "checking whether to use system libmspack... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use system libmspack" >&5 +$as_echo_n "checking whether to use system libmspack... " >&6; } if test -n "$with_system_mspack" -o -n "$with_system_libs" && \ test "$with_system_mspack" != "no"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } SYSTEM_MSPACK=YES - if test "${ac_cv_header_mspack_h+set}" = set; then - echo "$as_me:$LINENO: checking for mspack.h" >&5 -echo $ECHO_N "checking for mspack.h... $ECHO_C" >&6 -if test "${ac_cv_header_mspack_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_mspack_h" >&5 -echo "${ECHO_T}$ac_cv_header_mspack_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking mspack.h usability" >&5 -echo $ECHO_N "checking mspack.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking mspack.h presence" >&5 -echo $ECHO_N "checking mspack.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + ac_fn_c_check_header_mongrel "$LINENO" "mspack.h" "ac_cv_header_mspack_h" "$ac_includes_default" +if test "x$ac_cv_header_mspack_h" = x""yes; then : - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: mspack.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: mspack.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: mspack.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: mspack.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: mspack.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: mspack.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: mspack.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: mspack.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: mspack.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: mspack.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: mspack.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: mspack.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: mspack.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: mspack.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: mspack.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: mspack.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for mspack.h" >&5 -echo $ECHO_N "checking for mspack.h... $ECHO_C" >&6 -if test "${ac_cv_header_mspack_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_mspack_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_mspack_h" >&5 -echo "${ECHO_T}$ac_cv_header_mspack_h" >&6 - -fi -if test $ac_cv_header_mspack_h = yes; then - : else - { { echo "$as_me:$LINENO: error: mspack.h not found, install libmspack" >&5 -echo "$as_me: error: mspack.h not found, install libmspack" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "mspack.h not found, install libmspack" "$LINENO" 5 fi - -echo "$as_me:$LINENO: checking for mspack_create_cab_decompressor in -lmspack" >&5 -echo $ECHO_N "checking for mspack_create_cab_decompressor in -lmspack... $ECHO_C" >&6 -if test "${ac_cv_lib_mspack_mspack_create_cab_decompressor+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mspack_create_cab_decompressor in -lmspack" >&5 +$as_echo_n "checking for mspack_create_cab_decompressor in -lmspack... " >&6; } +if test "${ac_cv_lib_mspack_mspack_create_cab_decompressor+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmspack $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char mspack_create_cab_decompressor (); int main () { -mspack_create_cab_decompressor (); +return mspack_create_cab_decompressor (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_mspack_mspack_create_cab_decompressor=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_mspack_mspack_create_cab_decompressor=no + ac_cv_lib_mspack_mspack_create_cab_decompressor=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_mspack_mspack_create_cab_decompressor" >&5 -echo "${ECHO_T}$ac_cv_lib_mspack_mspack_create_cab_decompressor" >&6 -if test $ac_cv_lib_mspack_mspack_create_cab_decompressor = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mspack_mspack_create_cab_decompressor" >&5 +$as_echo "$ac_cv_lib_mspack_mspack_create_cab_decompressor" >&6; } +if test "x$ac_cv_lib_mspack_mspack_create_cab_decompressor" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBMSPACK 1 _ACEOF @@ -27673,73 +21669,71 @@ _ACEOF LIBS="-lmspack $LIBS" else - { { echo "$as_me:$LINENO: error: libmspack not installed or functional" >&5 -echo "$as_me: error: libmspack not installed or functional" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "libmspack not installed or functional" "$LINENO" 5 fi else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } SYSTEM_MSPACK=NO fi fi -echo "$as_me:$LINENO: checking whether to include MathMLDTD" >&5 -echo $ECHO_N "checking whether to include MathMLDTD... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include MathMLDTD" >&5 +$as_echo_n "checking whether to include MathMLDTD... " >&6; } if test -n "$enable_mathmldtd"; then if test "$enable_mathmldtd" = "no"; then - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } SCPDEFS="$SCPDEFS -DWITHOUT_MATHMLDTD" else - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } BUILD_TYPE="$BUILD_TYPE MATHMLDTD" fi else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } SCPDEFS="$SCPDEFS -DWITHOUT_MATHMLDTD" fi -echo "$as_me:$LINENO: checking whether to include Bitstream Vera fonts" >&5 -echo $ECHO_N "checking whether to include Bitstream Vera fonts... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include Bitstream Vera fonts" >&5 +$as_echo_n "checking whether to include Bitstream Vera fonts... " >&6; } if test "$with_fonts" != "no" ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } WITH_FONTS=YES BUILD_TYPE="$BUILD_TYPE BITSTREAM_VERA_FONTS" else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } WITH_FONTS=NO SCPDEFS="$SCPDEFS -DWITHOUT_FONTS" fi -echo "$as_me:$LINENO: checking whether to include PPDs" >&5 -echo $ECHO_N "checking whether to include PPDs... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include PPDs" >&5 +$as_echo_n "checking whether to include PPDs... " >&6; } if test "$with_ppds" != "no"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } WITHOUT_PPDS=YES SCPDEFS="$SCPDEFS -DWITHOUT_PPDS" fi -echo "$as_me:$LINENO: checking whether to include AFMs" >&5 -echo $ECHO_N "checking whether to include AFMs... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include AFMs" >&5 +$as_echo_n "checking whether to include AFMs... " >&6; } if test "$with_afms" != "no"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } WITHOUT_AFMS=YES SCPDEFS="$SCPDEFS -DWITHOUT_AFMS" fi @@ -27747,13 +21741,13 @@ fi -echo "$as_me:$LINENO: checking whether and how to use Xinerama" >&5 -echo $ECHO_N "checking whether and how to use Xinerama... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether and how to use Xinerama" >&5 +$as_echo_n "checking whether and how to use Xinerama... " >&6; } if test "$_os" = "Darwin"; then USE_XINERAMA=YES XINERAMA_LINK=dynamic - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } elif test "$_os" = "Linux" -o "$_os" = "FreeBSD"; then if test -e "$XLIB/libXinerama.so" -a -e "$XLIB/libXinerama.a"; then # we have both versions, let the user decide but use the dynamic one @@ -27783,151 +21777,13 @@ elif test "$_os" = "Linux" -o "$_os" = "FreeBSD"; then XINERAMA_LINK=none fi if test "$USE_XINERAMA" = "YES"; then - echo "$as_me:$LINENO: result: yes, with $XINERAMA_LINK linking" >&5 -echo "${ECHO_T}yes, with $XINERAMA_LINK linking" >&6 - if test "${ac_cv_header_X11_extensions_Xinerama_h+set}" = set; then - echo "$as_me:$LINENO: checking for X11/extensions/Xinerama.h" >&5 -echo $ECHO_N "checking for X11/extensions/Xinerama.h... $ECHO_C" >&6 -if test "${ac_cv_header_X11_extensions_Xinerama_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_Xinerama_h" >&5 -echo "${ECHO_T}$ac_cv_header_X11_extensions_Xinerama_h" >&6 -else - # Is the header compilable? -echo "$as_me:$LINENO: checking X11/extensions/Xinerama.h usability" >&5 -echo $ECHO_N "checking X11/extensions/Xinerama.h usability... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking X11/extensions/Xinerama.h presence" >&5 -echo $ECHO_N "checking X11/extensions/Xinerama.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: X11/extensions/Xinerama.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: X11/extensions/Xinerama.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/extensions/Xinerama.h: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: X11/extensions/Xinerama.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: X11/extensions/Xinerama.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: X11/extensions/Xinerama.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/extensions/Xinerama.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: X11/extensions/Xinerama.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/extensions/Xinerama.h: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: X11/extensions/Xinerama.h: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/extensions/Xinerama.h: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: X11/extensions/Xinerama.h: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/extensions/Xinerama.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: X11/extensions/Xinerama.h: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: X11/extensions/Xinerama.h: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: X11/extensions/Xinerama.h: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------------ ## -## Report this to the AC_PACKAGE_NAME lists. ## -## ------------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for X11/extensions/Xinerama.h" >&5 -echo $ECHO_N "checking for X11/extensions/Xinerama.h... $ECHO_C" >&6 -if test "${ac_cv_header_X11_extensions_Xinerama_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_X11_extensions_Xinerama_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_Xinerama_h" >&5 -echo "${ECHO_T}$ac_cv_header_X11_extensions_Xinerama_h" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, with $XINERAMA_LINK linking" >&5 +$as_echo "yes, with $XINERAMA_LINK linking" >&6; } + ac_fn_c_check_header_mongrel "$LINENO" "X11/extensions/Xinerama.h" "ac_cv_header_X11_extensions_Xinerama_h" "$ac_includes_default" +if test "x$ac_cv_header_X11_extensions_Xinerama_h" = x""yes; then : -fi -if test $ac_cv_header_X11_extensions_Xinerama_h = yes; then - : else - { { echo "$as_me:$LINENO: error: Xinerama header not found." >&5 -echo "$as_me: error: Xinerama header not found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Xinerama header not found." "$LINENO" 5 fi @@ -27938,72 +21794,43 @@ fi if test "$_os" = "Linux"; then XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -ldl" fi - -echo "$as_me:$LINENO: checking for XineramaIsActive in -lXinerama" >&5 -echo $ECHO_N "checking for XineramaIsActive in -lXinerama... $ECHO_C" >&6 -if test "${ac_cv_lib_Xinerama_XineramaIsActive+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XineramaIsActive in -lXinerama" >&5 +$as_echo_n "checking for XineramaIsActive in -lXinerama... " >&6; } +if test "${ac_cv_lib_Xinerama_XineramaIsActive+set}" = set; then : + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXinerama $XINERAMA_EXTRA_LIBS $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char XineramaIsActive (); int main () { -XineramaIsActive (); +return XineramaIsActive (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then +if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xinerama_XineramaIsActive=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_lib_Xinerama_XineramaIsActive=no + ac_cv_lib_Xinerama_XineramaIsActive=no fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_Xinerama_XineramaIsActive" >&5 -echo "${ECHO_T}$ac_cv_lib_Xinerama_XineramaIsActive" >&6 -if test $ac_cv_lib_Xinerama_XineramaIsActive = yes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xinerama_XineramaIsActive" >&5 +$as_echo "$ac_cv_lib_Xinerama_XineramaIsActive" >&6; } +if test "x$ac_cv_lib_Xinerama_XineramaIsActive" = x""yes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBXINERAMA 1 _ACEOF @@ -28011,18 +21838,16 @@ _ACEOF LIBS="-lXinerama $LIBS" else - { { echo "$as_me:$LINENO: error: Xinerama not functional?" >&5 -echo "$as_me: error: Xinerama not functional?" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Xinerama not functional?" "$LINENO" 5 fi else - echo "$as_me:$LINENO: result: no, libXinerama not found or wrong architecture." >&5 -echo "${ECHO_T}no, libXinerama not found or wrong architecture." >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, libXinerama not found or wrong architecture." >&5 +$as_echo "no, libXinerama not found or wrong architecture." >&6; } fi else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi @@ -28036,10 +21861,10 @@ if test -z "$with_ant_home"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_ANT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_ANT+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $ANT in [\\/]* | ?:[\\/]*) @@ -28051,28 +21876,29 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ANT="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS ;; esac fi ANT=$ac_cv_path_ANT - if test -n "$ANT"; then - echo "$as_me:$LINENO: result: $ANT" >&5 -echo "${ECHO_T}$ANT" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ANT" >&5 +$as_echo "$ANT" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$ANT" && break done @@ -28084,10 +21910,10 @@ else do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_path_ANT+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_path_ANT+set}" = set; then : + $as_echo_n "(cached) " >&6 else case $ANT in [\\/]* | ?:[\\/]*) @@ -28100,28 +21926,29 @@ for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ANT="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done -done + done +IFS=$as_save_IFS ;; esac fi ANT=$ac_cv_path_ANT - if test -n "$ANT"; then - echo "$as_me:$LINENO: result: $ANT" >&5 -echo "${ECHO_T}$ANT" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ANT" >&5 +$as_echo "$ANT" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + test -n "$ANT" && break done @@ -28130,9 +21957,7 @@ done fi if test -z "$ANT"; then - { { echo "$as_me:$LINENO: error: Ant not found - Make sure it's in the path or use --with-ant-home" >&5 -echo "$as_me: error: Ant not found - Make sure it's in the path or use --with-ant-home" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Ant not found - Make sure it's in the path or use --with-ant-home" "$LINENO" 5 else # resolve relative or absolute symlink while test -h "$ANT"; do @@ -28157,8 +21982,8 @@ else fi ant_minminor1=`echo $ant_minver | cut -d"." -f2` - echo "$as_me:$LINENO: checking whether ant is >= $ant_minver" >&5 -echo $ECHO_N "checking whether ant is >= $ant_minver... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ant is >= $ant_minver" >&5 +$as_echo_n "checking whether ant is >= $ant_minver... " >&6; } ant_version=`$ANT -version | $AWK '{ print $4; }'` ant_version_major=`echo $ant_version | cut -d. -f1` ant_version_minor=`echo $ant_version | cut -d. -f2` @@ -28166,18 +21991,16 @@ echo "configure: ant_version $ant_version " >&5 echo "configure: ant_version_major $ant_version_major " >&5 echo "configure: ant_version_minor $ant_version_minor " >&5 if test "$ant_version_major" -ge "2"; then - echo "$as_me:$LINENO: result: yes, $ant_version" >&5 -echo "${ECHO_T}yes, $ant_version" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, $ant_version" >&5 +$as_echo "yes, $ant_version" >&6; } elif test "$ant_version_major" = "1" && test "$ant_version_minor" -ge "$ant_minminor1"; then - echo "$as_me:$LINENO: result: yes, $ant_version" >&5 -echo "${ECHO_T}yes, $ant_version" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, $ant_version" >&5 +$as_echo "yes, $ant_version" >&6; } else - { { echo "$as_me:$LINENO: error: no, you need at least ant >= $ant_minver" >&5 -echo "$as_me: error: no, you need at least ant >= $ant_minver" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "no, you need at least ant >= $ant_minver" "$LINENO" 5 fi - echo "$as_me:$LINENO: checking if $ANT works" >&5 -echo $ECHO_N "checking if $ANT works... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $ANT works" >&5 +$as_echo_n "checking if $ANT works... " >&6; } cat > conftest.java << EOF public class conftest { int testmethod(int a, int b) { @@ -28201,14 +22024,14 @@ EOF else ant_cmd="$ANT -buildfile conftest.xml 1>&2" fi - { (eval echo "$as_me:$LINENO: \"$ant_cmd\"") >&5 + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ant_cmd\""; } >&5 (eval $ant_cmd) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } if test $? = 0 && test -f ./conftest.class ; then - echo "$as_me:$LINENO: result: Ant works" >&5 -echo "${ECHO_T}Ant works" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Ant works" >&5 +$as_echo "Ant works" >&6; } if test -z "$WITH_ANT_HOME"; then ANT_HOME=`$ANT -diagnostics | $EGREP "ant.home :" | $SED -e "s#ant.home : ##g"` if test -z "$ANT_HOME"; then @@ -28221,8 +22044,8 @@ echo "${ECHO_T}Ant works" >&6 echo "configure: Ant test failed" >&5 cat conftest.java >&5 cat conftest.xml >&5 - { echo "$as_me:$LINENO: WARNING: Ant does not work - Some Java projects will not build!" >&5 -echo "$as_me: WARNING: Ant does not work - Some Java projects will not build!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ant does not work - Some Java projects will not build!" >&5 +$as_echo "$as_me: WARNING: Ant does not work - Some Java projects will not build!" >&2;} ANT_HOME="" echo "Ant does not work - Some Java projects will not build!" >>warn fi @@ -28235,8 +22058,8 @@ fi if test "$ANT_HOME" != "NO_ANT_HOME"; then - echo "$as_me:$LINENO: checking Ant lib directory" >&5 -echo $ECHO_N "checking Ant lib directory... $ECHO_C" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking Ant lib directory" >&5 +$as_echo_n "checking Ant lib directory... " >&6; } if test -f $ANT_HOME/lib/ant.jar; then ANT_LIB="$ANT_HOME/lib" else @@ -28252,23 +22075,21 @@ echo $ECHO_N "checking Ant lib directory... $ECHO_C" >&6 if test -f $ANT_HOME/lib/ant/ant.jar; then ANT_LIB="$ANT_HOME/lib/ant" else - { { echo "$as_me:$LINENO: error: Ant libraries not found!" >&5 -echo "$as_me: error: Ant libraries not found!" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "Ant libraries not found!" "$LINENO" 5 fi fi fi fi fi - echo "$as_me:$LINENO: result: Ant lib directory found." >&5 -echo "${ECHO_T}Ant lib directory found." >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Ant lib directory found." >&5 +$as_echo "Ant lib directory found." >&6; } fi fi if test "$ENABLE_MEDIAWIKI" = "YES"; then -echo "$as_me:$LINENO: checking whether ant supports mapper type=\"regexp\"" >&5 -echo $ECHO_N "checking whether ant supports mapper type=\"regexp\"... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ant supports mapper type=\"regexp\"" >&5 +$as_echo_n "checking whether ant supports mapper type=\"regexp\"... " >&6; } rm -rf confdir mkdir confdir cat > conftest.java << EOF @@ -28300,181 +22121,179 @@ EOF else ant_cmd="$ANT -buildfile conftest.xml 1>&2" fi - { (eval echo "$as_me:$LINENO: \"$ant_cmd\"") >&5 + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ant_cmd\""; } >&5 (eval $ant_cmd) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } if test $? = 0 && test -f ./conftest.class ; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } rm -rf confdir else echo "configure: Ant test failed" >&5 cat conftest.java >&5 cat conftest.xml >&5 rm -rf confdir - { { echo "$as_me:$LINENO: error: no. Did you install ant-apache-regexp?" >&5 -echo "$as_me: error: no. Did you install ant-apache-regexp?" >&2;} - { (exit 1); exit 1; }; } + as_fn_error "no. Did you install ant-apache-regexp?" "$LINENO" 5 fi fi rm -f conftest* core core.* *.core -echo "$as_me:$LINENO: checking which languages to be built" >&5 -echo $ECHO_N "checking which languages to be built... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which languages to be built" >&5 +$as_echo_n "checking which languages to be built... " >&6; } WITH_LANG="$with_lang" if test -z "$WITH_LANG"; then - echo "$as_me:$LINENO: result: en-US" >&5 -echo "${ECHO_T}en-US" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: en-US" >&5 +$as_echo "en-US" >&6; } else - echo "$as_me:$LINENO: result: $WITH_LANG" >&5 -echo "${ECHO_T}$WITH_LANG" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WITH_LANG" >&5 +$as_echo "$WITH_LANG" >&6; } fi -echo "$as_me:$LINENO: checking which languages have poor help localizations" >&5 -echo $ECHO_N "checking which languages have poor help localizations... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which languages have poor help localizations" >&5 +$as_echo_n "checking which languages have poor help localizations... " >&6; } WITH_POOR_HELP_LOCALIZATIONS="$with_poor_help_localizations" if test -z "$WITH_POOR_HELP_LOCALIZATIONS"; then - echo "$as_me:$LINENO: result: none" >&5 -echo "${ECHO_T}none" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } else - echo "$as_me:$LINENO: result: $WITH_POOR_HELP_LOCALIZATIONS" >&5 -echo "${ECHO_T}$WITH_POOR_HELP_LOCALIZATIONS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WITH_POOR_HELP_LOCALIZATIONS" >&5 +$as_echo "$WITH_POOR_HELP_LOCALIZATIONS" >&6; } fi -echo "$as_me:$LINENO: checking which dictionaries to include" >&5 -echo $ECHO_N "checking which dictionaries to include... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which dictionaries to include" >&5 +$as_echo_n "checking which dictionaries to include... " >&6; } if test -z "$with_dict"; then WITH_DICT=,ALL, - echo "$as_me:$LINENO: result: ALL" >&5 -echo "${ECHO_T}ALL" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ALL" >&5 +$as_echo "ALL" >&6; } else WITH_DICT=","$with_dict"," - echo "$as_me:$LINENO: result: $with_dict" >&5 -echo "${ECHO_T}$with_dict" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_dict" >&5 +$as_echo "$with_dict" >&6; } fi -echo "$as_me:$LINENO: checking for additional 'intro' bitmaps" >&5 -echo $ECHO_N "checking for additional 'intro' bitmaps... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for additional 'intro' bitmaps" >&5 +$as_echo_n "checking for additional 'intro' bitmaps... " >&6; } INTRO_BITMAPS= if test -z "$with_intro_bitmaps" -o "$with_intro_bitmaps" = "no" ; then INTRO_BITMAPS= - echo "$as_me:$LINENO: result: none" >&5 -echo "${ECHO_T}none" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } else for bitmap in `echo $with_intro_bitmaps | tr ',' ' '` ; do case "$bitmap" in *.bmp) ;; - *) bitmap= ; { echo "$as_me:$LINENO: WARNING: Intro bitmaps should be .bmp files!" >&5 -echo "$as_me: WARNING: Intro bitmaps should be .bmp files!" >&2;} ;; + *) bitmap= ; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Intro bitmaps should be .bmp files!" >&5 +$as_echo "$as_me: WARNING: Intro bitmaps should be .bmp files!" >&2;} ;; esac if test -n "$bitmap" ; then INTRO_BITMAPS="$INTRO_BITMAPS $bitmap" fi done - echo "$as_me:$LINENO: result: $INTRO_BITMAPS" >&5 -echo "${ECHO_T}$INTRO_BITMAPS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTRO_BITMAPS" >&5 +$as_echo "$INTRO_BITMAPS" >&6; } fi -echo "$as_me:$LINENO: checking for additional 'about' bitmaps" >&5 -echo $ECHO_N "checking for additional 'about' bitmaps... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for additional 'about' bitmaps" >&5 +$as_echo_n "checking for additional 'about' bitmaps... " >&6; } ABOUT_BITMAPS= if test -z "$with_about_bitmaps" -o "$with_about_bitmaps" = "no" ; then ABOUT_BITMAPS= - echo "$as_me:$LINENO: result: none" >&5 -echo "${ECHO_T}none" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } else for bitmap in `echo $with_about_bitmaps | tr ',' ' '` ; do case "$bitmap" in *.bmp) ;; - *) bitmap= ; { echo "$as_me:$LINENO: WARNING: About bitmaps should be .bmp files!" >&5 -echo "$as_me: WARNING: About bitmaps should be .bmp files!" >&2;} ;; + *) bitmap= ; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: About bitmaps should be .bmp files!" >&5 +$as_echo "$as_me: WARNING: About bitmaps should be .bmp files!" >&2;} ;; esac if test -n "$bitmap" ; then ABOUT_BITMAPS="$ABOUT_BITMAPS $bitmap" fi done - echo "$as_me:$LINENO: result: $ABOUT_BITMAPS" >&5 -echo "${ECHO_T}$ABOUT_BITMAPS" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ABOUT_BITMAPS" >&5 +$as_echo "$ABOUT_BITMAPS" >&6; } fi OOO_VENDOR= -echo "$as_me:$LINENO: checking for vendor" >&5 -echo $ECHO_N "checking for vendor... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for vendor" >&5 +$as_echo_n "checking for vendor... " >&6; } if test -z "$with_vendor" -o "$with_vendor" = "no" ; then - echo "$as_me:$LINENO: result: not set" >&5 -echo "${ECHO_T}not set" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not set" >&5 +$as_echo "not set" >&6; } else OOO_VENDOR="$with_vendor" - echo "$as_me:$LINENO: result: $OOO_VENDOR" >&5 -echo "${ECHO_T}$OOO_VENDOR" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OOO_VENDOR" >&5 +$as_echo "$OOO_VENDOR" >&6; } fi UNIXWRAPPERNAME= -echo "$as_me:$LINENO: checking for UNIX wrapper name" >&5 -echo $ECHO_N "checking for UNIX wrapper name... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for UNIX wrapper name" >&5 +$as_echo_n "checking for UNIX wrapper name... " >&6; } if test -z "$with_unix_wrapper" -o "$with_unix_wrapper" = "no" -o "$with_unix_wrapper" = "yes" ; then - echo "$as_me:$LINENO: result: not set" >&5 -echo "${ECHO_T}not set" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not set" >&5 +$as_echo "not set" >&6; } else UNIXWRAPPERNAME="$with_unix_wrapper" - echo "$as_me:$LINENO: result: $UNIXWRAPPERNAME" >&5 -echo "${ECHO_T}$UNIXWRAPPERNAME" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $UNIXWRAPPERNAME" >&5 +$as_echo "$UNIXWRAPPERNAME" >&6; } fi -echo "$as_me:$LINENO: checking whether to statically link to Gtk" >&5 -echo $ECHO_N "checking whether to statically link to Gtk... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to statically link to Gtk" >&5 +$as_echo_n "checking whether to statically link to Gtk... " >&6; } if test -n "$enable_static_gtk" && test "$enable_static_gtk" != "no"; then ENABLE_STATIC_GTK="TRUE" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else ENABLE_STATIC_GTK="FALSE" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -echo "$as_me:$LINENO: checking whether to use layout dialogs" >&5 -echo $ECHO_N "checking whether to use layout dialogs... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use layout dialogs" >&5 +$as_echo_n "checking whether to use layout dialogs... " >&6; } if test -n "$enable_layout" && test "$enable_layout" != "no"; then ENABLE_LAYOUT="TRUE" - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else ENABLE_LAYOUT="FALSE" - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi # =================================================================== # De- or increase default verbosity of build process # =================================================================== -echo "$as_me:$LINENO: checking build verbosity" >&5 -echo $ECHO_N "checking build verbosity... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build verbosity" >&5 +$as_echo_n "checking build verbosity... " >&6; } if test -n "$enable_verbose"; then if test "$enable_verbose" == "yes"; then VERBOSE="TRUE" - echo "$as_me:$LINENO: result: high" >&5 -echo "${ECHO_T}high" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: high" >&5 +$as_echo "high" >&6; } fi if test "$enable_verbose" == "no"; then VERBOSE="FALSE" - echo "$as_me:$LINENO: result: low" >&5 -echo "${ECHO_T}low" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: low" >&5 +$as_echo "low" >&6; } fi else - echo "$as_me:$LINENO: result: not set" >&5 -echo "${ECHO_T}not set" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not set" >&5 +$as_echo "not set" >&6; } fi @@ -28485,22 +22304,20 @@ echo "* *" echo "********************************************************************" if test -z "$COMPATH"; then - { { echo "$as_me:$LINENO: error: No compiler found." >&5 -echo "$as_me: error: No compiler found." >&2;} - { (exit 1); exit 1; }; } + as_fn_error "No compiler found." "$LINENO" 5 fi -echo "$as_me:$LINENO: checking solver path" >&5 -echo $ECHO_N "checking solver path... $ECHO_C" >&6 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking solver path" >&5 +$as_echo_n "checking solver path... " >&6; } if test -z "$with_local_solver"; then LOCAL_SOLVER="DEFAULT" - echo "$as_me:$LINENO: result: default" >&5 -echo "${ECHO_T}default" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: default" >&5 +$as_echo "default" >&6; } else LOCAL_SOLVER=$with_local_solver - echo "$as_me:$LINENO: result: $with_local_solver" >&5 -echo "${ECHO_T}$with_local_solver" >&6 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_local_solver" >&5 +$as_echo "$with_local_solver" >&6; } fi @@ -28509,7 +22326,8 @@ fi # make sure config.guess is +x; we execute config.guess, so it has to be so; chmod +x ./config.guess - ac_config_files="$ac_config_files set_soenv Makefile" +ac_config_files="$ac_config_files set_soenv Makefile" + cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure @@ -28528,39 +22346,59 @@ _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. +# So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. -{ +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; + ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} | + esac | + sort +) | sed ' + /^ac_cv_env_/b end t clear - : clear + :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -if diff $cache_file confcache >/dev/null 2>&1; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else - echo "not updating unwritable cache $cache_file" + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -28569,63 +22407,54 @@ test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/; -s/:*\${srcdir}:*/:/; -s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; -s/:*$//; -s/^[^=]*=[ ]*$//; -}' -fi - # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that -# take arguments), then we branch to the quote section. Otherwise, +# take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. -cat >confdef2opt.sed <<\_ACEOF +ac_script=' +:mline +/\\$/{ + N + s,\\\n,, + b mline +} t clear -: clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote -d -: quote -s,[ `~#$^&*(){}\\|;'"<>?],\\&,g -s,\[,\\&,g -s,\],\\&,g -s,\$,$$,g -p -_ACEOF -# We use echo to avoid assuming a particular line-breaking character. -# The extra dot is to prevent the shell from consuming trailing -# line-breaks from the sub-command output. A line-break within -# single-quotes doesn't work because, if this script is created in a -# platform that uses two characters for line-breaks (e.g., DOS), tr -# would break. -ac_LF_and_DOT=`echo; echo .` -DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` -rm -f confdef2opt.sed +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. - ac_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` - # 2. Add them. - ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs @@ -28633,12 +22462,15 @@ LTLIBOBJS=$ac_ltlibobjs + : ${CONFIG_STATUS=./config.status} +ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. @@ -28648,81 +22480,252 @@ cat >$CONFIG_STATUS <<_ACEOF debug=false ac_cs_recheck=false ac_cs_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' fi -DUALCASE=1; export DUALCASE # for MKS sh -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } fi -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error ERROR [LINENO LOG_FD] +# --------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with status $?, using 1 if that was 0. +as_fn_error () +{ + as_status=$?; test $as_status -eq 0 && as_status=1 + if test "$3"; then + as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 fi -done + $as_echo "$as_me: error: $1" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi -# Name of the executable. -as_me=`$as_basename "$0" || +as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` - -# PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' @@ -28730,148 +22733,123 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 -echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | - sed ' - N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, - t loop - s,-$,, - s,^['$as_cr_digits']*\n,, - ' >$as_me.lineno && - chmod +x $as_me.lineno || - { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 -echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno - # Exit status is that of the last command. - exit -} - - -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file else - as_expr=false + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null fi - -rm -f conf$$ conf$$.exe conf$$.file -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' fi -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + +} # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then - as_mkdir_p=: + as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi -as_executable_p="test -f" +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -28880,31 +22858,20 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - exec 6>&1 - -# Open the log real soon, to keep \$[0] and so on meaningful, and to +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. Logging --version etc. is OK. -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX -} >&5 -cat >&5 <<_CSEOF - +# values after options handling. +ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.59. Invocation command line was +generated by GNU Autoconf 2.65. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -28912,124 +22879,111 @@ generated by GNU Autoconf 2.59. Invocation command line was CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ -_CSEOF -echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 -echo >&5 +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + _ACEOF -# Files that config.status was made for. -if test -n "$ac_config_files"; then - echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS -fi +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac -if test -n "$ac_config_headers"; then - echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS -fi -if test -n "$ac_config_links"; then - echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS -fi -if test -n "$ac_config_commands"; then - echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS -fi +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" -cat >>$CONFIG_STATUS <<\_ACEOF +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. -Usage: $0 [OPTIONS] [FILE]... +Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit - -V, --version print version number, then exit - -q, --quiet do not print progress messages + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE Configuration files: $config_files -Report bugs to ." -_ACEOF +Report bugs to the package provider." -cat >>$CONFIG_STATUS <<_ACEOF +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.59, - with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" +configured by $0, generated by GNU Autoconf 2.65, + with options \\"\$ac_cs_config\\" -Copyright (C) 2003 Free Software Foundation, Inc. +Copyright (C) 2009 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." -srcdir=$srcdir + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +AWK='$AWK' +test -n "\$AWK" || AWK=awk _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) - ac_option=`expr "x$1" : 'x\([^=]*\)='` - ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; - -*) + *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; - *) # This is not an option, so the user has probably given explicit - # arguments. - ac_option=$1 - ac_need_defaults=false;; esac case $ac_option in # Handling of the options. -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; - --version | --vers* | -V ) - echo "$ac_cs_version"; exit 0 ;; - --he | --h) - # Conflict between --help and --header - { { echo "$as_me:$LINENO: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit 0 ;; - --debug | --d* | -d ) + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; } ;; + -*) as_fn_error "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; - *) ac_config_targets="$ac_config_targets $1" ;; + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; esac shift @@ -29043,31 +22997,45 @@ if $ac_cs_silent; then fi _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" fi _ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - - -cat >>$CONFIG_STATUS <<\_ACEOF +# Handling of arguments. for ac_config_target in $ac_config_targets do - case "$ac_config_target" in - # Handling of arguments. - "set_soenv" ) CONFIG_FILES="$CONFIG_FILES set_soenv" ;; - "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; + case $ac_config_target in + "set_soenv") CONFIG_FILES="$CONFIG_FILES set_soenv" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + + *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done + # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely @@ -29077,670 +23045,403 @@ if $ac_need_defaults; then fi # Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason to put it here, and in addition, +# simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. -# Create a temporary directory, and hook for its removal unless debugging. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. $debug || { - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 } - # Create a (secure) tmp directory for tmp files. { - tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { - tmp=./confstat$$-$RANDOM - (umask 077 && mkdir $tmp) -} || + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} { - echo "$me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ + || as_fn_error "could not setup config files machinery" "$LINENO" 5 _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi -# -# CONFIG_FILES section. -# +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h -if test -n "\$CONFIG_FILES"; then - # Protect against being on the right side of a sed subst in config.status. - sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; - s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF -s,@SHELL@,$SHELL,;t t -s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t -s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t -s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t -s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t -s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t -s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t -s,@exec_prefix@,$exec_prefix,;t t -s,@prefix@,$prefix,;t t -s,@program_transform_name@,$program_transform_name,;t t -s,@bindir@,$bindir,;t t -s,@sbindir@,$sbindir,;t t -s,@libexecdir@,$libexecdir,;t t -s,@datadir@,$datadir,;t t -s,@sysconfdir@,$sysconfdir,;t t -s,@sharedstatedir@,$sharedstatedir,;t t -s,@localstatedir@,$localstatedir,;t t -s,@libdir@,$libdir,;t t -s,@includedir@,$includedir,;t t -s,@oldincludedir@,$oldincludedir,;t t -s,@infodir@,$infodir,;t t -s,@mandir@,$mandir,;t t -s,@build_alias@,$build_alias,;t t -s,@host_alias@,$host_alias,;t t -s,@target_alias@,$target_alias,;t t -s,@DEFS@,$DEFS,;t t -s,@ECHO_C@,$ECHO_C,;t t -s,@ECHO_N@,$ECHO_N,;t t -s,@ECHO_T@,$ECHO_T,;t t -s,@LIBS@,$LIBS,;t t -s,@EGREP@,$EGREP,;t t -s,@AWK@,$AWK,;t t -s,@SED@,$SED,;t t -s,@LOCAL_SOLENV@,$LOCAL_SOLENV,;t t -s,@_solenv@,$_solenv,;t t -s,@UPD@,$UPD,;t t -s,@SOURCEVERSION@,$SOURCEVERSION,;t t -s,@build@,$build,;t t -s,@build_cpu@,$build_cpu,;t t -s,@build_vendor@,$build_vendor,;t t -s,@build_os@,$build_os,;t t -s,@host@,$host,;t t -s,@host_cpu@,$host_cpu,;t t -s,@host_vendor@,$host_vendor,;t t -s,@host_os@,$host_os,;t t -s,@target@,$target,;t t -s,@target_cpu@,$target_cpu,;t t -s,@target_vendor@,$target_vendor,;t t -s,@target_os@,$target_os,;t t -s,@GNUTAR@,$GNUTAR,;t t -s,@OSVERSION@,$OSVERSION,;t t -s,@PTHREAD_CFLAGS@,$PTHREAD_CFLAGS,;t t -s,@PTHREAD_LIBS@,$PTHREAD_LIBS,;t t -s,@ENABLE_CRASHDUMP@,$ENABLE_CRASHDUMP,;t t -s,@VC_STANDARD@,$VC_STANDARD,;t t -s,@ENABLE_WERROR@,$ENABLE_WERROR,;t t -s,@ENABLE_DEBUG@,$ENABLE_DEBUG,;t t -s,@PRODUCT@,$PRODUCT,;t t -s,@PROFULLSWITCH@,$PROFULLSWITCH,;t t -s,@PROEXT@,$PROEXT,;t t -s,@ENABLE_SYMBOLS@,$ENABLE_SYMBOLS,;t t -s,@DISABLE_STRIP@,$DISABLE_STRIP,;t t -s,@ENABLE_CUPS@,$ENABLE_CUPS,;t t -s,@ENABLE_FONTCONFIG@,$ENABLE_FONTCONFIG,;t t -s,@WITH_BINFILTER@,$WITH_BINFILTER,;t t -s,@ENABLE_DIRECTX@,$ENABLE_DIRECTX,;t t -s,@DISABLE_ACTIVEX@,$DISABLE_ACTIVEX,;t t -s,@DISABLE_ATL@,$DISABLE_ATL,;t t -s,@ENABLE_RPATH@,$ENABLE_RPATH,;t t -s,@WITH_MYSPELL_DICTS@,$WITH_MYSPELL_DICTS,;t t -s,@SYSTEM_DICTS@,$SYSTEM_DICTS,;t t -s,@DICT_SYSTEM_DIR@,$DICT_SYSTEM_DIR,;t t -s,@HYPH_SYSTEM_DIR@,$HYPH_SYSTEM_DIR,;t t -s,@THES_SYSTEM_DIR@,$THES_SYSTEM_DIR,;t t -s,@USE_SHELL@,$USE_SHELL,;t t -s,@WITH_MINGWIN@,$WITH_MINGWIN,;t t -s,@SHELLPATH@,$SHELLPATH,;t t -s,@GCC_HOME@,$GCC_HOME,;t t -s,@CC@,$CC,;t t -s,@CFLAGS@,$CFLAGS,;t t -s,@LDFLAGS@,$LDFLAGS,;t t -s,@CPPFLAGS@,$CPPFLAGS,;t t -s,@ac_ct_CC@,$ac_ct_CC,;t t -s,@EXEEXT@,$EXEEXT,;t t -s,@OBJEXT@,$OBJEXT,;t t -s,@COMPATH@,$COMPATH,;t t -s,@GCCVER@,$GCCVER,;t t -s,@HAVE_LD_BSYMBOLIC_FUNCTIONS@,$HAVE_LD_BSYMBOLIC_FUNCTIONS,;t t -s,@ENABLE_PCH@,$ENABLE_PCH,;t t -s,@NO_HIDS@,$NO_HIDS,;t t -s,@GNUMAKE@,$GNUMAKE,;t t -s,@_cc@,$_cc,;t t -s,@HAVE_LD_HASH_STYLE@,$HAVE_LD_HASH_STYLE,;t t -s,@PERL@,$PERL,;t t -s,@MSPDB_PATH@,$MSPDB_PATH,;t t -s,@COMEX@,$COMEX,;t t -s,@USE_MINGW@,$USE_MINGW,;t t -s,@MIDL_PATH@,$MIDL_PATH,;t t -s,@CSC_PATH@,$CSC_PATH,;t t -s,@FRAME_HOME@,$FRAME_HOME,;t t -s,@CPP@,$CPP,;t t -s,@CXX@,$CXX,;t t -s,@CXXFLAGS@,$CXXFLAGS,;t t -s,@ac_ct_CXX@,$ac_ct_CXX,;t t -s,@CXXCPP@,$CXXCPP,;t t -s,@SIZEOF_LONG@,$SIZEOF_LONG,;t t -s,@WORDS_BIGENDIAN@,$WORDS_BIGENDIAN,;t t -s,@LFS_CFLAGS@,$LFS_CFLAGS,;t t -s,@ENABLE_VBA@,$ENABLE_VBA,;t t -s,@VBA_EXTENSION@,$VBA_EXTENSION,;t t -s,@PAM@,$PAM,;t t -s,@NEW_SHADOW_API@,$NEW_SHADOW_API,;t t -s,@PAM_LINK@,$PAM_LINK,;t t -s,@CRYPT_LINK@,$CRYPT_LINK,;t t -s,@GXX_INCLUDE_PATH@,$GXX_INCLUDE_PATH,;t t -s,@MINGW_LIB_INCLUDE_PATH@,$MINGW_LIB_INCLUDE_PATH,;t t -s,@MINGW_BACKWARD_INCLUDE_PATH@,$MINGW_BACKWARD_INCLUDE_PATH,;t t -s,@MINGW_CLIB_DIR@,$MINGW_CLIB_DIR,;t t -s,@MINGW_SHARED_GCCLIB@,$MINGW_SHARED_GCCLIB,;t t -s,@MINGW_GCCLIB_EH@,$MINGW_GCCLIB_EH,;t t -s,@MINGW_SHARED_GXXLIB@,$MINGW_SHARED_GXXLIB,;t t -s,@MINGW_GCCDLL@,$MINGW_GCCDLL,;t t -s,@MINGW_GXXDLL@,$MINGW_GXXDLL,;t t -s,@EXCEPTIONS@,$EXCEPTIONS,;t t -s,@STLPORT4@,$STLPORT4,;t t -s,@STLPORT_VER@,$STLPORT_VER,;t t -s,@USE_SYSTEM_STL@,$USE_SYSTEM_STL,;t t -s,@USE_CCACHE@,$USE_CCACHE,;t t -s,@CCACHE@,$CCACHE,;t t -s,@HAVE_GCC_VISIBILITY_FEATURE@,$HAVE_GCC_VISIBILITY_FEATURE,;t t -s,@ALLOC@,$ALLOC,;t t -s,@BUILD_VER_STRING@,$BUILD_VER_STRING,;t t -s,@SOLAR_JAVA@,$SOLAR_JAVA,;t t -s,@JAVAINTERPRETER@,$JAVAINTERPRETER,;t t -s,@JAVACOMPILER@,$JAVACOMPILER,;t t -s,@JAVACISGCJ@,$JAVACISGCJ,;t t -s,@JAVADOC@,$JAVADOC,;t t -s,@AWTLIB@,$AWTLIB,;t t -s,@JAVAAOTCOMPILER@,$JAVAAOTCOMPILER,;t t -s,@JAVA_HOME@,$JAVA_HOME,;t t -s,@JDK@,$JDK,;t t -s,@JAVAFLAGS@,$JAVAFLAGS,;t t -s,@DMAKE@,$DMAKE,;t t -s,@BUILD_DMAKE@,$BUILD_DMAKE,;t t -s,@EPM@,$EPM,;t t -s,@DPKG@,$DPKG,;t t -s,@PKGMK@,$PKGMK,;t t -s,@BUILD_EPM@,$BUILD_EPM,;t t -s,@PKGFORMAT@,$PKGFORMAT,;t t -s,@RPM@,$RPM,;t t -s,@GPERF@,$GPERF,;t t -s,@MINGWCXX@,$MINGWCXX,;t t -s,@ac_ct_MINGWCXX@,$ac_ct_MINGWCXX,;t t -s,@MINGWSTRIP@,$MINGWSTRIP,;t t -s,@ac_ct_MINGWSTRIP@,$ac_ct_MINGWSTRIP,;t t -s,@BUILD_UNOWINREG@,$BUILD_UNOWINREG,;t t -s,@BUILD_QADEVOOO@,$BUILD_QADEVOOO,;t t -s,@SYSTEM_STDLIBS@,$SYSTEM_STDLIBS,;t t -s,@SYSTEM_ZLIB@,$SYSTEM_ZLIB,;t t -s,@SYSTEM_JPEG@,$SYSTEM_JPEG,;t t -s,@SYSTEM_EXPAT@,$SYSTEM_EXPAT,;t t -s,@PKG_CONFIG@,$PKG_CONFIG,;t t -s,@LIBWPD_CFLAGS@,$LIBWPD_CFLAGS,;t t -s,@LIBWPD_LIBS@,$LIBWPD_LIBS,;t t -s,@SYSTEM_LIBWPD@,$SYSTEM_LIBWPD,;t t -s,@FREETYPE_CFLAGS@,$FREETYPE_CFLAGS,;t t -s,@FREETYPE_LIBS@,$FREETYPE_LIBS,;t t -s,@USE_FT_EMBOLDEN@,$USE_FT_EMBOLDEN,;t t -s,@LIBXSLT_CFLAGS@,$LIBXSLT_CFLAGS,;t t -s,@LIBXSLT_LIBS@,$LIBXSLT_LIBS,;t t -s,@XSLTPROC@,$XSLTPROC,;t t -s,@SYSTEM_LIBXSLT@,$SYSTEM_LIBXSLT,;t t -s,@LIBXML_CFLAGS@,$LIBXML_CFLAGS,;t t -s,@LIBXML_LIBS@,$LIBXML_LIBS,;t t -s,@SYSTEM_LIBXML@,$SYSTEM_LIBXML,;t t -s,@PYTHON@,$PYTHON,;t t -s,@PYTHON_VERSION@,$PYTHON_VERSION,;t t -s,@PYTHON_PREFIX@,$PYTHON_PREFIX,;t t -s,@PYTHON_EXEC_PREFIX@,$PYTHON_EXEC_PREFIX,;t t -s,@PYTHON_PLATFORM@,$PYTHON_PLATFORM,;t t -s,@pythondir@,$pythondir,;t t -s,@pkgpythondir@,$pkgpythondir,;t t -s,@pyexecdir@,$pyexecdir,;t t -s,@pkgpyexecdir@,$pkgpyexecdir,;t t -s,@BZIP2@,$BZIP2,;t t -s,@SYSTEM_PYTHON@,$SYSTEM_PYTHON,;t t -s,@PYTHON_CFLAGS@,$PYTHON_CFLAGS,;t t -s,@PYTHON_LIBS@,$PYTHON_LIBS,;t t -s,@HOME@,$HOME,;t t -s,@SYSTEM_DB@,$SYSTEM_DB,;t t -s,@DB_VERSION@,$DB_VERSION,;t t -s,@DB_INCLUDES@,$DB_INCLUDES,;t t -s,@DB_JAR@,$DB_JAR,;t t -s,@SYSTEM_LUCENE@,$SYSTEM_LUCENE,;t t -s,@LUCENE_CORE_JAR@,$LUCENE_CORE_JAR,;t t -s,@LUCENE_ANALYZERS_JAR@,$LUCENE_ANALYZERS_JAR,;t t -s,@SYSTEM_HSQLDB@,$SYSTEM_HSQLDB,;t t -s,@HSQLDB_JAR@,$HSQLDB_JAR,;t t -s,@SYSTEM_BSH@,$SYSTEM_BSH,;t t -s,@BSH_JAR@,$BSH_JAR,;t t -s,@SERIALIZER_JAR@,$SERIALIZER_JAR,;t t -s,@SYSTEM_SAXON@,$SYSTEM_SAXON,;t t -s,@SAXON_JAR@,$SAXON_JAR,;t t -s,@CURLCONFIG@,$CURLCONFIG,;t t -s,@SYSTEM_CURL@,$SYSTEM_CURL,;t t -s,@CURL_CFLAGS@,$CURL_CFLAGS,;t t -s,@CURL_LIBS@,$CURL_LIBS,;t t -s,@SYSTEM_BOOST@,$SYSTEM_BOOST,;t t -s,@SYSTEM_VIGRA@,$SYSTEM_VIGRA,;t t -s,@SYSTEM_ODBC_HEADERS@,$SYSTEM_ODBC_HEADERS,;t t -s,@WITH_MOZILLA@,$WITH_MOZILLA,;t t -s,@WITH_LDAP@,$WITH_LDAP,;t t -s,@WITH_OPENLDAP@,$WITH_OPENLDAP,;t t -s,@MOZ_NSS_CFLAGS@,$MOZ_NSS_CFLAGS,;t t -s,@MOZ_NSS_LIBS@,$MOZ_NSS_LIBS,;t t -s,@NSS_LIB@,$NSS_LIB,;t t -s,@MOZ_NSPR_CFLAGS@,$MOZ_NSPR_CFLAGS,;t t -s,@MOZ_NSPR_LIBS@,$MOZ_NSPR_LIBS,;t t -s,@NSPR_LIB@,$NSPR_LIB,;t t -s,@MOZILLAXPCOM_CFLAGS@,$MOZILLAXPCOM_CFLAGS,;t t -s,@MOZILLAXPCOM_LIBS@,$MOZILLAXPCOM_LIBS,;t t -s,@MOZILLA_VERSION@,$MOZILLA_VERSION,;t t -s,@MOZILLA_TOOLKIT@,$MOZILLA_TOOLKIT,;t t -s,@MOZGTK2_CFLAGS@,$MOZGTK2_CFLAGS,;t t -s,@MOZGTK2_LIBS@,$MOZGTK2_LIBS,;t t -s,@MOZLIBREQ_CFLAGS@,$MOZLIBREQ_CFLAGS,;t t -s,@MOZLIBREQ_LIBS@,$MOZLIBREQ_LIBS,;t t -s,@BUILD_MOZAB@,$BUILD_MOZAB,;t t -s,@ENABLE_NSS_MODULE@,$ENABLE_NSS_MODULE,;t t -s,@MOZILLABUILD@,$MOZILLABUILD,;t t -s,@SYSTEM_MOZILLA@,$SYSTEM_MOZILLA,;t t -s,@MOZ_FLAVOUR@,$MOZ_FLAVOUR,;t t -s,@MOZ_INC@,$MOZ_INC,;t t -s,@MOZ_LIB@,$MOZ_LIB,;t t -s,@MOZ_LIB_XPCOM@,$MOZ_LIB_XPCOM,;t t -s,@MOZ_LDAP_CFLAGS@,$MOZ_LDAP_CFLAGS,;t t -s,@SYSTEM_SANE_HEADER@,$SYSTEM_SANE_HEADER,;t t -s,@SYSTEM_GENBRK@,$SYSTEM_GENBRK,;t t -s,@SYSTEM_GENCCODE@,$SYSTEM_GENCCODE,;t t -s,@SYSTEM_GENCMN@,$SYSTEM_GENCMN,;t t -s,@SYSTEM_ICU@,$SYSTEM_ICU,;t t -s,@GRAPHITE_CFLAGS@,$GRAPHITE_CFLAGS,;t t -s,@GRAPHITE_LIBS@,$GRAPHITE_LIBS,;t t -s,@ENABLE_GRAPHITE@,$ENABLE_GRAPHITE,;t t -s,@SYSTEM_GRAPHITE@,$SYSTEM_GRAPHITE,;t t -s,@X_CFLAGS@,$X_CFLAGS,;t t -s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t -s,@X_LIBS@,$X_LIBS,;t t -s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t -s,@XINC@,$XINC,;t t -s,@XLIB@,$XLIB,;t t -s,@XAU_LIBS@,$XAU_LIBS,;t t -s,@DISABLE_XAW@,$DISABLE_XAW,;t t -s,@SYSTEM_XRENDER_HEADERS@,$SYSTEM_XRENDER_HEADERS,;t t -s,@XRENDER_LINK@,$XRENDER_LINK,;t t -s,@XRANDR_CFLAGS@,$XRANDR_CFLAGS,;t t -s,@XRANDR_LIBS@,$XRANDR_LIBS,;t t -s,@XRANDR_DLOPEN@,$XRANDR_DLOPEN,;t t -s,@ENABLE_RANDR@,$ENABLE_RANDR,;t t -s,@DISABLE_NEON@,$DISABLE_NEON,;t t -s,@NEON_CFLAGS@,$NEON_CFLAGS,;t t -s,@NEON_LIBS@,$NEON_LIBS,;t t -s,@SYSTEM_NEON@,$SYSTEM_NEON,;t t -s,@NEON_VERSION@,$NEON_VERSION,;t t -s,@OPENSSL_CFLAGS@,$OPENSSL_CFLAGS,;t t -s,@OPENSSL_LIBS@,$OPENSSL_LIBS,;t t -s,@SYSTEM_OPENSSL@,$SYSTEM_OPENSSL,;t t -s,@ENABLE_AGG@,$ENABLE_AGG,;t t -s,@AGG_CFLAGS@,$AGG_CFLAGS,;t t -s,@AGG_LIBS@,$AGG_LIBS,;t t -s,@SYSTEM_AGG@,$SYSTEM_AGG,;t t -s,@AGG_VERSION@,$AGG_VERSION,;t t -s,@REDLAND_CFLAGS@,$REDLAND_CFLAGS,;t t -s,@REDLAND_LIBS@,$REDLAND_LIBS,;t t -s,@SYSTEM_REDLAND@,$SYSTEM_REDLAND,;t t -s,@HUNSPELL_CFLAGS@,$HUNSPELL_CFLAGS,;t t -s,@HUNSPELL_LIBS@,$HUNSPELL_LIBS,;t t -s,@SYSTEM_HUNSPELL@,$SYSTEM_HUNSPELL,;t t -s,@SYSTEM_HYPH@,$SYSTEM_HYPH,;t t -s,@HYPHEN_LIB@,$HYPHEN_LIB,;t t -s,@SYSTEM_MYTHES@,$SYSTEM_MYTHES,;t t -s,@SYSTEM_LPSOLVE@,$SYSTEM_LPSOLVE,;t t -s,@PSDK_HOME@,$PSDK_HOME,;t t -s,@WINDOWS_VISTA_PSDK@,$WINDOWS_VISTA_PSDK,;t t -s,@DIRECTXSDK_HOME@,$DIRECTXSDK_HOME,;t t -s,@DIRECTXSDK_LIB@,$DIRECTXSDK_LIB,;t t -s,@NSIS_PATH@,$NSIS_PATH,;t t -s,@BISON@,$BISON,;t t -s,@FLEX@,$FLEX,;t t -s,@PATCH@,$PATCH,;t t -s,@GNUCP@,$GNUCP,;t t -s,@GNUPATCH@,$GNUPATCH,;t t -s,@CYGWIN_PATH@,$CYGWIN_PATH,;t t -s,@ML_EXE@,$ML_EXE,;t t -s,@ASM_HOME@,$ASM_HOME,;t t -s,@ZIP@,$ZIP,;t t -s,@UNZIP@,$UNZIP,;t t -s,@ZIP_HOME@,$ZIP_HOME,;t t -s,@ENABLE_GTK@,$ENABLE_GTK,;t t -s,@ENABLE_KDE@,$ENABLE_KDE,;t t -s,@ENABLE_KDE4@,$ENABLE_KDE4,;t t -s,@GCONF_CFLAGS@,$GCONF_CFLAGS,;t t -s,@GCONF_LIBS@,$GCONF_LIBS,;t t -s,@ENABLE_GCONF@,$ENABLE_GCONF,;t t -s,@GNOMEVFS_CFLAGS@,$GNOMEVFS_CFLAGS,;t t -s,@GNOMEVFS_LIBS@,$GNOMEVFS_LIBS,;t t -s,@ENABLE_GNOMEVFS@,$ENABLE_GNOMEVFS,;t t -s,@GTK_CFLAGS@,$GTK_CFLAGS,;t t -s,@GTK_LIBS@,$GTK_LIBS,;t t -s,@DBUS_CFLAGS@,$DBUS_CFLAGS,;t t -s,@DBUS_LIBS@,$DBUS_LIBS,;t t -s,@GIO_CFLAGS@,$GIO_CFLAGS,;t t -s,@GIO_LIBS@,$GIO_LIBS,;t t -s,@ENABLE_GIO@,$ENABLE_GIO,;t t -s,@ENABLE_DBUS@,$ENABLE_DBUS,;t t -s,@ENABLE_SYSTRAY_GTK@,$ENABLE_SYSTRAY_GTK,;t t -s,@CAIRO_CFLAGS@,$CAIRO_CFLAGS,;t t -s,@CAIRO_LIBS@,$CAIRO_LIBS,;t t -s,@ENABLE_CAIRO@,$ENABLE_CAIRO,;t t -s,@BUILD_PIXMAN@,$BUILD_PIXMAN,;t t -s,@SYSTEM_CAIRO@,$SYSTEM_CAIRO,;t t -s,@ENABLE_OPENGL@,$ENABLE_OPENGL,;t t -s,@ENABLE_MINIMIZER@,$ENABLE_MINIMIZER,;t t -s,@ENABLE_PRESENTER_SCREEN@,$ENABLE_PRESENTER_SCREEN,;t t -s,@POPPLER_CFLAGS@,$POPPLER_CFLAGS,;t t -s,@POPPLER_LIBS@,$POPPLER_LIBS,;t t -s,@ENABLE_PDFIMPORT@,$ENABLE_PDFIMPORT,;t t -s,@SYSTEM_POPPLER@,$SYSTEM_POPPLER,;t t -s,@ENABLE_MEDIAWIKI@,$ENABLE_MEDIAWIKI,;t t -s,@SYSTEM_SERVLETAPI@,$SYSTEM_SERVLETAPI,;t t -s,@SERVLETAPI_JAR@,$SERVLETAPI_JAR,;t t -s,@ENABLE_REPORTBUILDER@,$ENABLE_REPORTBUILDER,;t t -s,@SYSTEM_JFREEREPORT@,$SYSTEM_JFREEREPORT,;t t -s,@SAC_JAR@,$SAC_JAR,;t t -s,@LIBXML_JAR@,$LIBXML_JAR,;t t -s,@FLUTE_JAR@,$FLUTE_JAR,;t t -s,@JFREEREPORT_JAR@,$JFREEREPORT_JAR,;t t -s,@LIBBASE_JAR@,$LIBBASE_JAR,;t t -s,@LIBLAYOUT_JAR@,$LIBLAYOUT_JAR,;t t -s,@LIBLOADER_JAR@,$LIBLOADER_JAR,;t t -s,@LIBFORMULA_JAR@,$LIBFORMULA_JAR,;t t -s,@LIBREPOSITORY_JAR@,$LIBREPOSITORY_JAR,;t t -s,@LIBFONTS_JAR@,$LIBFONTS_JAR,;t t -s,@LIBSERIALIZER_JAR@,$LIBSERIALIZER_JAR,;t t -s,@SYSTEM_APACHE_COMMONS@,$SYSTEM_APACHE_COMMONS,;t t -s,@COMMONS_CODEC_JAR@,$COMMONS_CODEC_JAR,;t t -s,@COMMONS_LANG_JAR@,$COMMONS_LANG_JAR,;t t -s,@COMMONS_HTTPCLIENT_JAR@,$COMMONS_HTTPCLIENT_JAR,;t t -s,@COMMONS_LOGGING_JAR@,$COMMONS_LOGGING_JAR,;t t -s,@MOC@,$MOC,;t t -s,@KDE_CFLAGS@,$KDE_CFLAGS,;t t -s,@KDE_LIBS@,$KDE_LIBS,;t t -s,@MOC4@,$MOC4,;t t -s,@KDE4_CFLAGS@,$KDE4_CFLAGS,;t t -s,@KDE4_LIBS@,$KDE4_LIBS,;t t -s,@ENABLE_LOCKDOWN@,$ENABLE_LOCKDOWN,;t t -s,@GOBJECT_CFLAGS@,$GOBJECT_CFLAGS,;t t -s,@GOBJECT_LIBS@,$GOBJECT_LIBS,;t t -s,@ENABLE_EVOAB2@,$ENABLE_EVOAB2,;t t -s,@ENABLE_KAB@,$ENABLE_KAB,;t t -s,@WITH_FONTOOO@,$WITH_FONTOOO,;t t -s,@SYSTEM_MSPACK@,$SYSTEM_MSPACK,;t t -s,@WITH_FONTS@,$WITH_FONTS,;t t -s,@WITHOUT_PPDS@,$WITHOUT_PPDS,;t t -s,@WITHOUT_AFMS@,$WITHOUT_AFMS,;t t -s,@SCPDEFS@,$SCPDEFS,;t t -s,@USE_XINERAMA@,$USE_XINERAMA,;t t -s,@XINERAMA_LINK@,$XINERAMA_LINK,;t t -s,@ANT@,$ANT,;t t -s,@ANT_HOME@,$ANT_HOME,;t t -s,@ANT_LIB@,$ANT_LIB,;t t -s,@WITH_LANG@,$WITH_LANG,;t t -s,@WITH_POOR_HELP_LOCALIZATIONS@,$WITH_POOR_HELP_LOCALIZATIONS,;t t -s,@WITH_DICT@,$WITH_DICT,;t t -s,@INTRO_BITMAPS@,$INTRO_BITMAPS,;t t -s,@ABOUT_BITMAPS@,$ABOUT_BITMAPS,;t t -s,@OOO_VENDOR@,$OOO_VENDOR,;t t -s,@UNIXWRAPPERNAME@,$UNIXWRAPPERNAME,;t t -s,@ENABLE_STATIC_GTK@,$ENABLE_STATIC_GTK,;t t -s,@ENABLE_LAYOUT@,$ENABLE_LAYOUT,;t t -s,@VERBOSE@,$VERBOSE,;t t -s,@LOCAL_SOLVER@,$LOCAL_SOLVER,;t t -s,@BUILD_TYPE@,$BUILD_TYPE,;t t -s,@LIBOBJS@,$LIBOBJS,;t t -s,@LTLIBOBJS@,$LTLIBOBJS,;t t -CEOF -_ACEOF +eval set X " :F $CONFIG_FILES " +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift - cat >>$CONFIG_STATUS <<\_ACEOF - # Split the substitutions into bite-sized pieces for seds with - # small command number limits, like on Digital OSF/1 and HP-UX. - ac_max_sed_lines=48 - ac_sed_frag=1 # Number of current file. - ac_beg=1 # First line for current file. - ac_end=$ac_max_sed_lines # Line after last line for current file. - ac_more_lines=: - ac_sed_cmds= - while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - else - sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - fi - if test ! -s $tmp/subs.frag; then - ac_more_lines=false - else - # The purpose of the label and of the branching condition is to - # speed up the sed processing (if there are no `@' at all, there - # is no need to browse any of the substitutions). - # These are the two extra sed commands mentioned above. - (echo ':t - /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" - else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" - fi - ac_sed_frag=`expr $ac_sed_frag + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_lines` + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} fi - done - if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat - fi -fi # test -n "$CONFIG_FILES" + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin" \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; esac - # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. - ac_dir=`(dirname "$ac_file") 2>/dev/null || + ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. -if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac + case $ac_mode in + :F) + # + # CONFIG_FILE + # +_ACEOF - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - configure_input= - else - configure_input="$ac_file. " - fi - configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo "$f";; - *) # Relative - if test -f "$f"; then - # Build tree - echo "$f" - elif test -f "$srcdir/$f"; then - # Source tree - echo "$srcdir/$f" - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF - sed "$ac_vpsub + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub $extrasub _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s,@configure_input@,$configure_input,;t t -s,@srcdir@,$ac_srcdir,;t t -s,@abs_srcdir@,$ac_abs_srcdir,;t t -s,@top_srcdir@,$ac_top_srcdir,;t t -s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t -s,@builddir@,$ac_builddir,;t t -s,@abs_builddir@,$ac_abs_builddir,;t t -s,@top_builddir@,$ac_top_builddir,;t t -s,@abs_top_builddir@,$ac_abs_top_builddir,;t t -" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out - rm -f $tmp/stdin - if test x"$ac_file" != x-; then - mv $tmp/out $ac_file - else - cat $tmp/out - rm -f $tmp/out - fi +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + esac \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 + ;; -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -{ (exit 0); exit 0; } + esac + +done # for ac_tag + + +as_fn_exit 0 _ACEOF -chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save +test $ac_write_fail = 0 || + as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5 + # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. @@ -29760,7 +23461,11 @@ if test "$no_create" != yes; then exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. - $ac_cs_success || { (exit 1); exit 1; } + $ac_cs_success || as_fn_exit $? +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi diff --git a/configure.in b/configure.in index 264bd2df8314..3edba2baa255 100644 --- a/configure.in +++ b/configure.in @@ -4571,12 +4571,6 @@ if test "$_os" = "WINNT" -o "$_os" = "Linux" && test "z$enable_graphite" == "z" AC_MSG_RESULT([external]) SYSTEM_GRAPHITE=YES PKG_CHECK_MODULES( GRAPHITE, silgraphite ) - AC_MSG_CHECKING([STL compatibility]) - if test "$WITH_STLPORT" != "no"; then - AC_MSG_ERROR([to use system graphite you need to use --without-stlport]) - else - AC_MSG_RESULT([OK]) - fi else AC_MSG_RESULT([internal]) SYSTEM_GRAPHITE=NO -- cgit v1.2.3 From 8bbcf854cf7248384646de2b66f06c21bea227ca Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 17 Dec 2009 13:57:53 +0000 Subject: cmcfixes69: #i106157#: workaround graphite stl/stlport issues --- vcl/inc/postgraphitestl.h | 17 +++++++++++++++++ vcl/inc/pregraphitestl.h | 29 +++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 vcl/inc/postgraphitestl.h create mode 100644 vcl/inc/pregraphitestl.h diff --git a/vcl/inc/postgraphitestl.h b/vcl/inc/postgraphitestl.h new file mode 100644 index 000000000000..8a8a0ca056ae --- /dev/null +++ b/vcl/inc/postgraphitestl.h @@ -0,0 +1,17 @@ +#ifdef std_was_redefined_as_stlport +// put things back the way they were +# define std std_was_redefined_as_stlport +# undef _STLP_DONT_REDEFINE_STD +# undef _STLP_WHOLE_NATIVE_STD +# undef _STLP_STRING +# undef _STLP_IOSTREAM +# undef _STLP_IOSFWD +# undef _STLP_IOMANIP +# undef _STLP_ALGORITHM +# undef _STLP_VECTOR +# undef _STLP_SET +# undef _STLP_MAP +// force config to be re-read +# undef _STLP_CONFIG_H +# include +#endif diff --git a/vcl/inc/pregraphitestl.h b/vcl/inc/pregraphitestl.h new file mode 100644 index 000000000000..043ae84d0b45 --- /dev/null +++ b/vcl/inc/pregraphitestl.h @@ -0,0 +1,29 @@ +#if defined(GRAPHITEADAPTSTL) && defined(std) +# define std_was_redefined_as_stlport std +# undef std +# undef _STLP_CONFIG_H +# undef _STLP_STRING +# undef _STLP_IOSTREAM +# undef _STLP_IOSFWD +# undef _STLP_IOMANIP +# undef _STLP_ALGORITHM +# undef _STLP_VECTOR +# undef _STLP_SET +# undef _STLP_MAP +# define _STLP_DONT_REDEFINE_STD 1 +# define _STLP_WHOLE_NATIVE_STD 1 +# include _STLP_NATIVE_HEADER(exception_defines.h) +# include _STLP_NATIVE_HEADER(memory) +# include _STLP_NATIVE_HEADER(exception) +# include _STLP_NATIVE_HEADER(iosfwd) +# include _STLP_NATIVE_HEADER(string) +# include _STLP_NATIVE_HEADER(streambuf) +# include _STLP_NATIVE_HEADER(ios) +# include _STLP_NATIVE_HEADER(locale) +# include _STLP_NATIVE_HEADER(stdexcept) +# include _STLP_NATIVE_HEADER(ostream) +# include _STLP_NATIVE_HEADER(istream) +# include _STLP_NATIVE_HEADER(iostream) +#endif +//sil_std resolves to the std that Graphite was built with +namespace sil_std = std; -- cgit v1.2.3 From 817095aeb6e9293b649e0af48cb4fdc39a3f2ff4 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 17 Dec 2009 17:25:17 +0100 Subject: vcl108: #i107254# add toUnicode map entries mapping from one glyph to multiple unicodes --- vcl/source/gdi/pdfwriter_impl.cxx | 272 +++++++++++++++++++++++--------------- vcl/source/gdi/pdfwriter_impl.hxx | 14 +- 2 files changed, 173 insertions(+), 113 deletions(-) diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 8cf9c4f050fd..efec952ffbe2 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -2866,10 +2866,16 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont sal_Int32 nToUnicodeStream = 0; sal_uInt8 nEncoding[256]; sal_Ucs nEncodedCodes[256]; + std::vector aUnicodes; + aUnicodes.reserve( 256 ); + sal_Int32 pUnicodesPerGlyph[256]; + sal_Int32 pEncToUnicodeIndex[256]; if( pEncoding ) { - memset( nEncodedCodes, 0, sizeof(nEncodedCodes) ); - memset( nEncoding, 0, sizeof(nEncoding) ); + rtl_zeroMemory( nEncoding, sizeof(nEncoding) ); + rtl_zeroMemory( nEncodedCodes, sizeof(nEncodedCodes) ); + rtl_zeroMemory( pUnicodesPerGlyph, sizeof(pUnicodesPerGlyph) ); + rtl_zeroMemory( pEncToUnicodeIndex, sizeof(pEncToUnicodeIndex) ); for( Ucs2SIntMap::const_iterator it = pEncoding->begin(); it != pEncoding->end(); ++it ) { if( it->second != -1 ) @@ -2877,6 +2883,9 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont sal_Int32 nCode = (sal_Int32)(it->second & 0x000000ff); nEncoding[ nCode ] = static_cast( nCode ); nEncodedCodes[ nCode ] = it->first; + pEncToUnicodeIndex[ nCode ] = static_cast(aUnicodes.size()); + aUnicodes.push_back( it->first ); + pUnicodesPerGlyph[ nCode ] = 1; } } } @@ -3299,7 +3308,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont if( nFontDescriptor ) { if( pEncoding ) - nToUnicodeStream = createToUnicodeCMap( nEncoding, nEncodedCodes, sizeof(nEncoding)/sizeof(nEncoding[0]) ); + nToUnicodeStream = createToUnicodeCMap( nEncoding, &aUnicodes[0], pUnicodesPerGlyph, pEncToUnicodeIndex, sizeof(nEncoding)/sizeof(nEncoding[0]) ); // write font object sal_Int32 nObject = createObject(); @@ -3363,12 +3372,16 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont aLine.append( " 0 obj\n" "<::iterator str_it = enc_it->m_aEncVector.begin(); str_it != enc_it->m_aEncVector.end(); ++str_it ) { String aStr( str_it->m_aUnicode ); aEncWidths[nEncoded] = pRef->GetTextWidth( aStr ); nEncodedCodes[nEncoded] = str_it->m_aUnicode; nEncoding[nEncoded] = sal::static_int_cast(nEncoded); + pEncToUnicodeIndex[nEncoded] = static_cast(aUnicodes.size()); + aUnicodes.push_back( nEncodedCodes[nEncoded] ); + pUnicodesPerGlyph[nEncoded] = 1; aLine.append( " /" ); aLine.append( str_it->m_aName ); @@ -3383,7 +3396,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont if( ! writeBuffer( aLine.getStr(), aLine.getLength() ) ) goto streamend; - nToUnicodeStream = createToUnicodeCMap( nEncoding, nEncodedCodes, nEncoded ); + nToUnicodeStream = createToUnicodeCMap( nEncoding, &aUnicodes[0], pUnicodesPerGlyph, pEncToUnicodeIndex, nEncoded ); nObject = createObject(); if( ! updateObject( nObject ) ) @@ -3448,11 +3461,15 @@ static void appendSubsetName( int nSubsetID, const OUString& rPSName, OStringBuf appendName( rPSName, rBuffer ); } -sal_Int32 PDFWriterImpl::createToUnicodeCMap( sal_uInt8* pEncoding, sal_Ucs* pUnicodes, int nGlyphs ) +sal_Int32 PDFWriterImpl::createToUnicodeCMap( sal_uInt8* pEncoding, + sal_Ucs* pUnicodes, + sal_Int32* pUnicodesPerGlyph, + sal_Int32* pEncToUnicodeIndex, + int nGlyphs ) { int nMapped = 0, n = 0; for( n = 0; n < nGlyphs; n++ ) - if( pUnicodes[n] ) + if( pUnicodes[pEncToUnicodeIndex[n]] && pUnicodesPerGlyph[n] ) nMapped++; if( nMapped == 0 ) @@ -3480,7 +3497,7 @@ sal_Int32 PDFWriterImpl::createToUnicodeCMap( sal_uInt8* pEncoding, sal_Ucs* pUn int nCount = 0; for( n = 0; n < nGlyphs; n++ ) { - if( pUnicodes[n] ) + if( pUnicodes[pEncToUnicodeIndex[n]] && pUnicodesPerGlyph[n] ) { if( (nCount % 100) == 0 ) { @@ -3492,9 +3509,13 @@ sal_Int32 PDFWriterImpl::createToUnicodeCMap( sal_uInt8* pEncoding, sal_Ucs* pUn aContents.append( '<' ); appendHex( (sal_Int8)pEncoding[n], aContents ); aContents.append( "> <" ); - // TODO: handle unicodes>U+FFFF - appendHex( (sal_Int8)(pUnicodes[n] / 256), aContents ); - appendHex( (sal_Int8)(pUnicodes[n] & 255), aContents ); + // TODO: handle unicodes>U+FFFF + sal_Int32 nIndex = pEncToUnicodeIndex[n]; + for( sal_Int32 j = 0; j < pUnicodesPerGlyph[n]; j++ ) + { + appendHex( (sal_Int8)(pUnicodes[nIndex + j] / 256), aContents ); + appendHex( (sal_Int8)(pUnicodes[nIndex + j] & 255), aContents ); + } aContents.append( ">\n" ); nCount++; } @@ -3654,14 +3675,18 @@ bool PDFWriterImpl::emitFonts() sal_Int32 pGlyphIDs[ 256 ]; sal_Int32 pWidths[ 256 ]; sal_uInt8 pEncoding[ 256 ]; - sal_Ucs pUnicodes[ 256 ]; + sal_Int32 pEncToUnicodeIndex[ 256 ]; + sal_Int32 pUnicodesPerGlyph[ 256 ]; + std::vector aUnicodes; + aUnicodes.reserve( 256 ); int nGlyphs = 1; // fill arrays and prepare encoding index map sal_Int32 nToUnicodeStream = 0; - memset( pGlyphIDs, 0, sizeof( pGlyphIDs ) ); - memset( pEncoding, 0, sizeof( pEncoding ) ); - memset( pUnicodes, 0, sizeof( pUnicodes ) ); + rtl_zeroMemory( pGlyphIDs, sizeof( pGlyphIDs ) ); + rtl_zeroMemory( pEncoding, sizeof( pEncoding ) ); + rtl_zeroMemory( pUnicodesPerGlyph, sizeof( pUnicodesPerGlyph ) ); + rtl_zeroMemory( pEncToUnicodeIndex, sizeof( pEncToUnicodeIndex ) ); for( FontEmitMapping::iterator fit = lit->m_aMapping.begin(); fit != lit->m_aMapping.end();++fit ) { sal_uInt8 nEnc = fit->second.m_nSubsetGlyphID; @@ -3671,8 +3696,11 @@ bool PDFWriterImpl::emitFonts() pGlyphIDs[ nEnc ] = fit->first; pEncoding[ nEnc ] = nEnc; - pUnicodes[ nEnc ] = fit->second.m_aUnicode; - if( pUnicodes[ nEnc ] ) + pEncToUnicodeIndex[ nEnc ] = static_cast(aUnicodes.size()); + pUnicodesPerGlyph[ nEnc ] = fit->second.m_nUnicodes; + for( sal_Int32 n = 0; n < fit->second.m_nUnicodes; n++ ) + aUnicodes.push_back( fit->second.m_aUnicodes[n] ); + if( fit->second.m_aUnicodes[0] ) nToUnicodeStream = 1; if( nGlyphs < 256 ) nGlyphs++; @@ -3693,92 +3721,92 @@ bool PDFWriterImpl::emitFonts() CHECK_RETURN( (osl_File_E_None == osl_getFilePos( aFontFile, &nLength1 ) ) ); CHECK_RETURN( (osl_File_E_None == osl_setFilePos( aFontFile, osl_Pos_Absolut, 0 ) ) ); -#if OSL_DEBUG_LEVEL > 1 + #if OSL_DEBUG_LEVEL > 1 { OStringBuffer aLine1( " PDFWriterImpl::emitFonts" ); emitComment( aLine1.getStr() ); } -#endif + #endif sal_Int32 nFontStream = createObject(); sal_Int32 nStreamLengthObject = createObject(); CHECK_RETURN( updateObject( nFontStream ) ); aLine.setLength( 0 ); aLine.append( nFontStream ); aLine.append( " 0 obj\n" - "<>\n" - "stream\n" ); - CHECK_RETURN( writeBuffer( aLine.getStr(), aLine.getLength() ) ); - CHECK_RETURN( (osl_File_E_None == osl_getFilePos( m_aFile, &nStartPos ) ) ); + #ifndef DEBUG_DISABLE_PDFCOMPRESSION + "/Filter/FlateDecode" + #endif + "/Length1 " ); - // copy font file - beginCompression(); - checkAndEnableStreamEncryption( nFontStream ); - sal_Bool bEOF = sal_False; - do + sal_uInt64 nStartPos = 0; + if( aSubsetInfo.m_nFontType == FontSubsetInfo::SFNT_TTF ) { - char buf[8192]; - sal_uInt64 nRead; - CHECK_RETURN( (osl_File_E_None == osl_readFile( aFontFile, buf, sizeof( buf ), &nRead ) ) ); - CHECK_RETURN( writeBuffer( buf, nRead ) ); - CHECK_RETURN( (osl_File_E_None == osl_isEndOfFile( aFontFile, &bEOF ) ) ); - } while( ! bEOF ); - } - else if( (aSubsetInfo.m_nFontType & FontSubsetInfo::CFF_FONT) != 0 ) - { - // TODO: implement - DBG_ERROR( "PDFWriterImpl does not support CFF-font subsets yet!" ); - } - else if( (aSubsetInfo.m_nFontType & FontSubsetInfo::TYPE1_PFB) != 0 ) // TODO: also support PFA? - { - unsigned char* pBuffer = new unsigned char[ (int)nLength1 ]; - - sal_uInt64 nBytesRead = 0; - CHECK_RETURN( (osl_File_E_None == osl_readFile( aFontFile, pBuffer, nLength1, &nBytesRead ) ) ); - DBG_ASSERT( nBytesRead==nLength1, "PDF-FontSubset read incomplete!" ); - CHECK_RETURN( (osl_File_E_None == osl_setFilePos( aFontFile, osl_Pos_Absolut, 0 ) ) ); - // get the PFB-segment lengths - ThreeInts aSegmentLengths = {0,0,0}; - getPfbSegmentLengths( pBuffer, (int)nBytesRead, aSegmentLengths ); - // the lengths below are mandatory for PDF-exported Type1 fonts - // because the PFB segment headers get stripped! WhyOhWhy. - aLine.append( (sal_Int32)aSegmentLengths[0] ); - aLine.append( "/Length2 " ); - aLine.append( (sal_Int32)aSegmentLengths[1] ); - aLine.append( "/Length3 " ); - aLine.append( (sal_Int32)aSegmentLengths[2] ); - - aLine.append( ">>\n" - "stream\n" ); - CHECK_RETURN( writeBuffer( aLine.getStr(), aLine.getLength() ) ); - CHECK_RETURN( (osl_File_E_None == osl_getFilePos( m_aFile, &nStartPos ) ) ); - - // emit PFB-sections without section headers - beginCompression(); - checkAndEnableStreamEncryption( nFontStream ); - CHECK_RETURN( writeBuffer( pBuffer+ 6, aSegmentLengths[0] ) ); - CHECK_RETURN( writeBuffer( pBuffer+12 + aSegmentLengths[0], aSegmentLengths[1] ) ); - CHECK_RETURN( writeBuffer( pBuffer+18 + aSegmentLengths[0] + aSegmentLengths[1], aSegmentLengths[2] ) ); - - delete[] pBuffer; - } - else - { - fprintf( stderr, "PDF: CreateFontSubset result in not yet supported format=%d\n",aSubsetInfo.m_nFontType); - aLine.append( "0 >>\nstream\n" ); - } + aLine.append( (sal_Int32)nLength1 ); + + aLine.append( ">>\n" + "stream\n" ); + CHECK_RETURN( writeBuffer( aLine.getStr(), aLine.getLength() ) ); + CHECK_RETURN( (osl_File_E_None == osl_getFilePos( m_aFile, &nStartPos ) ) ); + + // copy font file + beginCompression(); + checkAndEnableStreamEncryption( nFontStream ); + sal_Bool bEOF = sal_False; + do + { + char buf[8192]; + sal_uInt64 nRead; + CHECK_RETURN( (osl_File_E_None == osl_readFile( aFontFile, buf, sizeof( buf ), &nRead ) ) ); + CHECK_RETURN( writeBuffer( buf, nRead ) ); + CHECK_RETURN( (osl_File_E_None == osl_isEndOfFile( aFontFile, &bEOF ) ) ); + } while( ! bEOF ); + } + else if( (aSubsetInfo.m_nFontType & FontSubsetInfo::CFF_FONT) != 0 ) + { + // TODO: implement + DBG_ERROR( "PDFWriterImpl does not support CFF-font subsets yet!" ); + } + else if( (aSubsetInfo.m_nFontType & FontSubsetInfo::TYPE1_PFB) != 0 ) // TODO: also support PFA? + { + unsigned char* pBuffer = new unsigned char[ (int)nLength1 ]; + + sal_uInt64 nBytesRead = 0; + CHECK_RETURN( (osl_File_E_None == osl_readFile( aFontFile, pBuffer, nLength1, &nBytesRead ) ) ); + DBG_ASSERT( nBytesRead==nLength1, "PDF-FontSubset read incomplete!" ); + CHECK_RETURN( (osl_File_E_None == osl_setFilePos( aFontFile, osl_Pos_Absolut, 0 ) ) ); + // get the PFB-segment lengths + ThreeInts aSegmentLengths = {0,0,0}; + getPfbSegmentLengths( pBuffer, (int)nBytesRead, aSegmentLengths ); + // the lengths below are mandatory for PDF-exported Type1 fonts + // because the PFB segment headers get stripped! WhyOhWhy. + aLine.append( (sal_Int32)aSegmentLengths[0] ); + aLine.append( "/Length2 " ); + aLine.append( (sal_Int32)aSegmentLengths[1] ); + aLine.append( "/Length3 " ); + aLine.append( (sal_Int32)aSegmentLengths[2] ); + + aLine.append( ">>\n" + "stream\n" ); + CHECK_RETURN( writeBuffer( aLine.getStr(), aLine.getLength() ) ); + CHECK_RETURN( (osl_File_E_None == osl_getFilePos( m_aFile, &nStartPos ) ) ); + + // emit PFB-sections without section headers + beginCompression(); + checkAndEnableStreamEncryption( nFontStream ); + CHECK_RETURN( writeBuffer( pBuffer+ 6, aSegmentLengths[0] ) ); + CHECK_RETURN( writeBuffer( pBuffer+12 + aSegmentLengths[0], aSegmentLengths[1] ) ); + CHECK_RETURN( writeBuffer( pBuffer+18 + aSegmentLengths[0] + aSegmentLengths[1], aSegmentLengths[2] ) ); + + delete[] pBuffer; + } + else + { + fprintf( stderr, "PDF: CreateFontSubset result in not yet supported format=%d\n",aSubsetInfo.m_nFontType); + aLine.append( "0 >>\nstream\n" ); + } endCompression(); disableStreamEncryption(); @@ -3805,7 +3833,7 @@ bool PDFWriterImpl::emitFonts() sal_Int32 nFontDescriptor = emitFontDescriptor( it->first, aSubsetInfo, lit->m_nFontID, nFontStream ); if( nToUnicodeStream ) - nToUnicodeStream = createToUnicodeCMap( pEncoding, pUnicodes, nGlyphs ); + nToUnicodeStream = createToUnicodeCMap( pEncoding, &aUnicodes[0], pUnicodesPerGlyph, pEncToUnicodeIndex, nGlyphs ); sal_Int32 nFontObject = createObject(); CHECK_RETURN( updateObject( nFontObject ) ); @@ -3814,22 +3842,22 @@ bool PDFWriterImpl::emitFonts() aLine.append( " 0 obj\n" ); aLine.append( ((aSubsetInfo.m_nFontType & FontSubsetInfo::ANY_TYPE1) != 0) ? - "<m_nFontID, aSubsetInfo.m_aPSName, aLine ); aLine.append( "\n" - "/FirstChar 0\n" - "/LastChar " ); + "/FirstChar 0\n" + "/LastChar " ); aLine.append( (sal_Int32)(nGlyphs-1) ); aLine.append( "\n" - "/Widths[" ); + "/Widths[" ); for( int i = 0; i < nGlyphs; i++ ) { aLine.append( pWidths[ i ] ); aLine.append( ((i & 15) == 15) ? "\n" : " " ); } aLine.append( "]\n" - "/FontDescriptor " ); + "/FontDescriptor " ); aLine.append( nFontDescriptor ); aLine.append( " 0 R\n" ); if( nToUnicodeStream ) @@ -3839,7 +3867,7 @@ bool PDFWriterImpl::emitFonts() aLine.append( " 0 R\n" ); } aLine.append( ">>\n" - "endobj\n\n" ); + "endobj\n\n" ); CHECK_RETURN( writeBuffer( aLine.getStr(), aLine.getLength() ) ); aFontIDToObject[ lit->m_nFontID ] = nFontObject; @@ -3877,7 +3905,7 @@ bool PDFWriterImpl::emitFonts() OStringBuffer aFontDict( 1024 ); aFontDict.append( getFontDictObject() ); aFontDict.append( " 0 obj\n" - "<<" ); + "<<" ); int ni = 0; for( std::map< sal_Int32, sal_Int32 >::iterator mit = aFontIDToObject.begin(); mit != aFontIDToObject.end(); ++mit ) { @@ -3886,12 +3914,12 @@ bool PDFWriterImpl::emitFonts() aFontDict.append( ' ' ); aFontDict.append( mit->second ); aFontDict.append( " 0 R" ); - if( ((++ni) & 7) == 0 ) - aFontDict.append( '\n' ); + if( ((++ni) & 7) == 0 ) + aFontDict.append( '\n' ); } // emit builtin font for widget apperances / variable text for( std::map< sal_Int32, sal_Int32 >::iterator it = m_aBuiltinFontToObjectMap.begin(); - it != m_aBuiltinFontToObjectMap.end(); ++it ) + it != m_aBuiltinFontToObjectMap.end(); ++it ) { ImplPdfBuiltinFontData aData(m_aBuiltinFonts[it->first]); it->second = emitBuiltinFont( &aData, it->second ); @@ -6389,12 +6417,14 @@ void PDFWriterImpl::registerGlyphs( int nGlyphs, sal_GlyphId* pGlyphs, sal_Int32* pGlyphWidths, sal_Ucs* pUnicodes, + sal_Int32* pUnicodesPerGlyph, sal_uInt8* pMappedGlyphs, sal_Int32* pMappedFontObjects, const ImplFontData* pFallbackFonts[] ) { const ImplFontData* pDevFont = m_pReferenceDevice->mpFontEntry->maFontSelData.mpFontData; - for( int i = 0; i < nGlyphs; i++ ) + sal_Ucs* pCurUnicode = pUnicodes; + for( int i = 0; i < nGlyphs; pCurUnicode += pUnicodesPerGlyph[i] , i++ ) { const int nFontGlyphId = pGlyphs[i] & (GF_IDXMASK | GF_ISCHAR | GF_GSUB); const ImplFontData* pCurrentFont = pFallbackFonts[i] ? pFallbackFonts[i] : pDevFont; @@ -6450,7 +6480,9 @@ void PDFWriterImpl::registerGlyphs( int nGlyphs, // add new glyph to emitted font subset GlyphEmit& rNewGlyphEmit = rSubset.m_aSubsets.back().m_aMapping[ nFontGlyphId ]; rNewGlyphEmit.m_nSubsetGlyphID = nNewId; - rNewGlyphEmit.m_aUnicode = (pUnicodes ? pUnicodes[i] : 0); + rNewGlyphEmit.m_nUnicodes = pUnicodesPerGlyph[i]; + for( sal_Int32 n = 0; n < pUnicodesPerGlyph[i]; n++ ) + rNewGlyphEmit.m_aUnicodes[n] = pCurUnicode[n]; // add new glyph to font mapping Glyph& rNewGlyph = rSubset.m_aMapping[ nFontGlyphId ]; @@ -6487,7 +6519,7 @@ void PDFWriterImpl::registerGlyphs( int nGlyphs, Ucs2OStrMap::const_iterator nonenc_it; sal_Int32 nCurFontID = nFontID; - sal_Ucs cChar = pUnicodes[i]; + sal_Ucs cChar = *pCurUnicode; if( pEncoding ) { enc_it = pEncoding->find( cChar ); @@ -6549,7 +6581,7 @@ void PDFWriterImpl::registerGlyphs( int nGlyphs, pMappedGlyphs[ i ] = (sal_Int8)cChar; pMappedFontObjects[ i ] = nCurFontID; pGlyphWidths[ i ] = m_aFontCache.getGlyphWidth( pCurrentFont, - (pEncoding ? pUnicodes[i] : cChar) | GF_ISCHAR, + (pEncoding ? *pCurUnicode : cChar) | GF_ISCHAR, false, m_pReferenceDevice->mpGraphics ); } @@ -6829,7 +6861,9 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const String& rText, bool bT sal_Int32 pGlyphWidths[nMaxGlyphs]; sal_uInt8 pMappedGlyphs[nMaxGlyphs]; sal_Int32 pMappedFontObjects[nMaxGlyphs]; - sal_Ucs pUnicodes[nMaxGlyphs]; + std::vector aUnicodes; + aUnicodes.reserve( nMaxGlyphs ); + sal_Int32 pUnicodesPerGlyph[nMaxGlyphs]; int pCharPosAry[nMaxGlyphs]; sal_Int32 nAdvanceWidths[nMaxGlyphs]; const ImplFontData* pFallbackFonts[nMaxGlyphs]; @@ -6962,15 +6996,29 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const String& rText, bool bT Point aGNGlyphPos; while( (nGlyphs = rLayout.GetNextGlyphs( nTmpMaxGlyphs, pGlyphs, aGNGlyphPos, nIndex, nAdvanceWidths, pCharPosAry )) != 0 ) { + aUnicodes.clear(); for( int i = 0; i < nGlyphs; i++ ) { pFallbackFonts[i] = rLayout.GetFallbackFontData( pGlyphs[i] ); + // default case: 1 glyph is one unicode + pUnicodesPerGlyph[i] = 1; if( (pGlyphs[i] & GF_ISCHAR) ) - pUnicodes[i] = static_cast(pGlyphs[i] & GF_IDXMASK); + { + aUnicodes.push_back( static_cast(pGlyphs[i] & GF_IDXMASK) ); + } else if( pCharPosAry[i] >= nMinCharPos && pCharPosAry[i] <= nMaxCharPos ) { - pUnicodes[i] = rText.GetChar( sal::static_int_cast(pCharPosAry[i]) ); + int nChars = 1; + aUnicodes.push_back( rText.GetChar( sal::static_int_cast(pCharPosAry[i]) ) ); + pUnicodesPerGlyph[i] = 1; + // try to handle ligatures and such + if( i < nGlyphs-1 ) + { + pUnicodesPerGlyph[i] = nChars = pCharPosAry[i+1] - pCharPosAry[i]; + for( int n = 1; n < nChars; n++ ) + aUnicodes.push_back( rText.GetChar( sal::static_int_cast(pCharPosAry[i]+n) ) ); + } // #i36691# hack that is needed because currently the pGlyphs[] // argument is ignored for embeddable fonts and so the layout // engine's glyph work is ignored (i.e. char mirroring) @@ -6978,17 +7026,21 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const String& rText, bool bT // glyphid (i.e. FreeType's synthetic glyphid for a Type1 font) // back to unicode and then to embeddable font's encoding if( getReferenceDevice()->GetLayoutMode() & TEXT_LAYOUT_BIDI_RTL ) - pUnicodes[i] = static_cast(GetMirroredChar(pUnicodes[i])); + { + size_t nI = aUnicodes.size()-1; + for( int n = 0; n < nChars; n++, nI-- ) + aUnicodes[nI] = static_cast(GetMirroredChar(aUnicodes[nI])); + } } else - pUnicodes[i] = 0; + aUnicodes.push_back( 0 ); // note: in case of ctl one character may result // in multiple glyphs. The current SalLayout // implementations set -1 then to indicate that no direct // mapping is possible } - registerGlyphs( nGlyphs, pGlyphs, pGlyphWidths, pUnicodes, pMappedGlyphs, pMappedFontObjects, pFallbackFonts ); + registerGlyphs( nGlyphs, pGlyphs, pGlyphWidths, &aUnicodes[0], pUnicodesPerGlyph, pMappedGlyphs, pMappedFontObjects, pFallbackFonts ); for( int i = 0; i < nGlyphs; i++ ) { diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx index 29de6d4f5971..c8b201a7bfb8 100644 --- a/vcl/source/gdi/pdfwriter_impl.hxx +++ b/vcl/source/gdi/pdfwriter_impl.hxx @@ -272,8 +272,16 @@ public: // font subsets struct GlyphEmit { - sal_Ucs m_aUnicode; + static const int nMaxUnicodes = 8; + // performance: actually this should probably a vector; + sal_Ucs m_aUnicodes[nMaxUnicodes]; + sal_Int32 m_nUnicodes; sal_uInt8 m_nSubsetGlyphID; + + GlyphEmit() : m_nUnicodes(0), m_nSubsetGlyphID(0) + { + rtl_zeroMemory( m_aUnicodes, sizeof( m_aUnicodes ) ); + } }; typedef std::map< sal_GlyphId, GlyphEmit > FontEmitMapping; struct FontEmit @@ -856,7 +864,7 @@ i12626 void appendLiteralStringEncrypt( rtl::OStringBuffer& rInString, const sal_Int32 nInObjectNumber, rtl::OStringBuffer& rOutBuffer ); /* creates fonts and subsets that will be emitted later */ - void registerGlyphs( int nGlyphs, sal_GlyphId* pGlyphs, sal_Int32* pGlpyhWidths, sal_Ucs* pUnicodes, sal_uInt8* pMappedGlyphs, sal_Int32* pMappedFontObjects, const ImplFontData* pFallbackFonts[] ); + void registerGlyphs( int nGlyphs, sal_GlyphId* pGlyphs, sal_Int32* pGlpyhWidths, sal_Ucs* pUnicodes, sal_Int32* pUnicodesPerGlyph, sal_uInt8* pMappedGlyphs, sal_Int32* pMappedFontObjects, const ImplFontData* pFallbackFonts[] ); /* emits a text object according to the passed layout */ /* TODO: remove rText as soon as SalLayout will change so that rText is not necessary anymore */ @@ -903,7 +911,7 @@ i12626 /* writes a font descriptor and returns its object id (or 0) */ sal_Int32 emitFontDescriptor( const ImplFontData*, FontSubsetInfo&, sal_Int32 nSubsetID, sal_Int32 nStream ); /* writes a ToUnicode cmap, returns the corresponding stream object */ - sal_Int32 createToUnicodeCMap( sal_uInt8* pEncoding, sal_Ucs* pUnicodes, int nGlyphs ); + sal_Int32 createToUnicodeCMap( sal_uInt8* pEncoding, sal_Ucs* pUnicodes, sal_Int32* pUnicodesPerGlyph, sal_Int32* pEncToUnicodeIndex, int nGlyphs ); /* get resource dict object number */ sal_Int32 getResourceDictObj() -- cgit v1.2.3 From 8e0bc401af211dfd134e8a2281bd38e3c21fc7a4 Mon Sep 17 00:00:00 2001 From: Kurt Zenker Date: Thu, 17 Dec 2009 18:18:07 +0100 Subject: #158443# use module name as prefix to get an uniqe alias --- soldep/bootstrp/prj.cxx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/soldep/bootstrp/prj.cxx b/soldep/bootstrp/prj.cxx index f81e03c5a7a3..c26f50ae3f7c 100644 --- a/soldep/bootstrp/prj.cxx +++ b/soldep/bootstrp/prj.cxx @@ -1639,7 +1639,8 @@ void Star::InsertToken ( char *yytext ) pStaticDepList = 0; break; case 1: - aDirName = yytext; + aDirName = yytext; + aProjectName = aDirName.GetToken ( 0, 0x5c); break; case 2: if ( !strcmp( yytext, ":" )) @@ -1674,7 +1675,6 @@ void Star::InsertToken ( char *yytext ) } if (bPrjDep) { - aProjectName = aDirName.GetToken ( 0, 0x5c); if ( HasProject( aProjectName )) { RemovePrj(GetPrj(aProjectName)); @@ -1708,7 +1708,7 @@ void Star::InsertToken ( char *yytext ) case 5: if ( !bPrjDep ) { - aLogFileName = yytext; + aLogFileName = (ByteString(aProjectName).Append("_")).Append(yytext); } break; default: @@ -1725,7 +1725,8 @@ void Star::InsertToken ( char *yytext ) // ggfs. Dependency liste anlegen und ergaenzen if ( !pStaticDepList ) pStaticDepList = new SByteStringList; - pStaticDepList->PutString( new ByteString( aItem )); + ByteString* pStr = new ByteString ((ByteString (aProjectName).Append("_")).Append(aItem)); + pStaticDepList->PutString( pStr ); } } else @@ -1748,7 +1749,6 @@ void Star::InsertToken ( char *yytext ) bHasModes = TRUE; } - aProjectName = aDirName.GetToken ( 0, 0x5c); if ( HasProject( aProjectName )) { pPrj = GetPrj( aProjectName ); @@ -1782,7 +1782,6 @@ void Star::InsertToken ( char *yytext ) der Solar-Projekte einfuegen */ if ( i == -1 ) { - aProjectName = aDirName.GetToken ( 0, 0x5c); if ( HasProject( aProjectName )) { pPrj = GetPrj( aProjectName ); -- cgit v1.2.3 From daf7906ef7974878d7097649e4fa7669bdd6d53b Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 17 Dec 2009 18:51:23 +0100 Subject: vcl108: #i106704# fix PFA case of Length3 --- vcl/source/gdi/pdfwriter_impl.cxx | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index efec952ffbe2..cf94797db4f9 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -2971,6 +2971,28 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont if( nIndex < 1 || nIndex <= nEndAsciiIndex ) goto streamend; + + // nLength3 is the rest of the file - excluding any section headers + // nIndex now points to the first of the 512 '0' characters marking the + // fixed content portion + sal_Int32 nLength3 = nFontLen - nIndex; + for( it = aSections.begin(); it != aSections.end(); ++it ) + { + if( *it >= nIndex ) + { + // special case: nIndex inside a section marker + if( nIndex >= (*it) && (*it)+5 > nIndex ) + nLength3 -= (*it)+5 - nIndex; + else + { + if( *it < nFontLen - 6 ) + nLength3 -= 6; + else // the last section 0x8003 is only 2 bytes after all + nLength3 -= (nFontLen - *it); + } + } + } + // there may be whitespace to ignore before the 512 '0' while( pFontData[nIndex] == '\r' || pFontData[nIndex] == '\n' ) { @@ -2985,20 +3007,6 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont } nEndBinaryIndex = nIndex; - // nLength3 is the rest of the file - excluding any section headers - sal_Int32 nLength3 = nFontLen - nIndex; - for( it = aSections.begin(); it != aSections.end(); ++it ) - { - if( *it >= nIndex ) - { - // special case: nIndex inside a section marker - if( nIndex >= *it ) - nLength3 -= (*it)+5 - nIndex; - else - nLength3 -= 5; - } - } - // search for beginning of binary section nBeginBinaryIndex = nEndAsciiIndex; do -- cgit v1.2.3 From d408e96e7eaf89202a4a2f866708149cb01e8e87 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Thu, 17 Dec 2009 19:44:38 +0100 Subject: vcl108: #i106704# fix error handling, avoid memory leaks --- vcl/source/gdi/pdfwriter_impl.cxx | 955 ++++++++++++++++++-------------------- 1 file changed, 463 insertions(+), 492 deletions(-) diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index cf94797db4f9..0564be3c1c1f 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -64,6 +64,8 @@ #include "implncvt.hxx" +#include + #include "cppuhelper/implbase1.hxx" #include @@ -2847,6 +2849,10 @@ static bool getPfbSegmentLengths( const unsigned char* pFontBytes, int nByteLen, return true; } +struct FontException : public std::exception +{ +}; + // TODO: always subset instead of embedding the full font => this method becomes obsolete then std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFontData* pFont, EmbedFont& rEmbed ) { @@ -2895,559 +2901,525 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont const unsigned char* pFontData = NULL; long nFontLen = 0; sal_Int32 nLength1, nLength2; - if( (pFontData = (const unsigned char*)m_pReferenceDevice->mpGraphics->GetEmbedFontData( pFont, nEncodedCodes, pWidths, aInfo, &nFontLen )) != NULL ) - { - if( (aInfo.m_nFontType & FontSubsetInfo::ANY_TYPE1) == 0 ) - goto streamend; - // see whether it is pfb or pfa; if it is a pfb, fill ranges - // of 6 bytes that are not part of the font program - std::list< int > aSections; - std::list< int >::const_iterator it; - int nIndex = 0; - while( pFontData[nIndex] == 0x80 && nIndex < nFontLen-1 ) - { - aSections.push_back( nIndex ); - if( pFontData[nIndex+1] == 0x03 ) - break; - sal_Int32 nBytes = + try + { + if( (pFontData = (const unsigned char*)m_pReferenceDevice->mpGraphics->GetEmbedFontData( pFont, nEncodedCodes, pWidths, aInfo, &nFontLen )) != NULL ) + { + if( (aInfo.m_nFontType & FontSubsetInfo::ANY_TYPE1) == 0 ) + throw FontException(); + // see whether it is pfb or pfa; if it is a pfb, fill ranges + // of 6 bytes that are not part of the font program + std::list< int > aSections; + std::list< int >::const_iterator it; + int nIndex = 0; + while( pFontData[nIndex] == 0x80 && nIndex < nFontLen-1 ) + { + aSections.push_back( nIndex ); + if( pFontData[nIndex+1] == 0x03 ) + break; + sal_Int32 nBytes = ((sal_Int32)pFontData[nIndex+2]) | ((sal_Int32)pFontData[nIndex+3]) << 8 | ((sal_Int32)pFontData[nIndex+4]) << 16 | ((sal_Int32)pFontData[nIndex+5]) << 24; - nIndex += nBytes+6; - } - - // search for eexec - // TODO: use getPfbSegmentLengths() if possible to skip the search thingies below - nIndex = 0; - int nEndAsciiIndex; - int nBeginBinaryIndex; - int nEndBinaryIndex; - do - { - while( nIndex < nFontLen-4 && - ( pFontData[nIndex] != 'e' || - pFontData[nIndex+1] != 'e' || - pFontData[nIndex+2] != 'x' || - pFontData[nIndex+3] != 'e' || - pFontData[nIndex+4] != 'c' - ) - ) - nIndex++; - // check whether we are in a excluded section - for( it = aSections.begin(); it != aSections.end() && (nIndex < *it || nIndex > ((*it) + 5) ); ++it ) - ; - } while( it != aSections.end() && nIndex < nFontLen-4 ); - // this should end the ascii part - if( nIndex > nFontLen-5 ) - goto streamend; - - nEndAsciiIndex = nIndex+4; - // now count backwards until we can account for 512 '0' - // which is the endmarker of the (hopefully) binary data - // do not count the pfb header sections - int nFound = 0; - nIndex = nFontLen-1; - while( nIndex > 0 && nFound < 512 ) - { - for( it = aSections.begin(); it != aSections.end() && (nIndex < *it || nIndex > ((*it) + 5) ); ++it ) - ; - if( it == aSections.end() ) - { - // inside the 512 '0' block there may only be whitespace - // according to T1 spec; probably it would be to simple - // if all fonts complied - if( pFontData[nIndex] == '0' ) - nFound++; - else if( nFound > 0 && - pFontData[nIndex] != '\r' && - pFontData[nIndex] != '\t' && - pFontData[nIndex] != '\n' && - pFontData[nIndex] != ' ' ) - break; + nIndex += nBytes+6; } - nIndex--; - } - if( nIndex < 1 || nIndex <= nEndAsciiIndex ) - goto streamend; - - // nLength3 is the rest of the file - excluding any section headers - // nIndex now points to the first of the 512 '0' characters marking the - // fixed content portion - sal_Int32 nLength3 = nFontLen - nIndex; - for( it = aSections.begin(); it != aSections.end(); ++it ) - { - if( *it >= nIndex ) - { - // special case: nIndex inside a section marker - if( nIndex >= (*it) && (*it)+5 > nIndex ) - nLength3 -= (*it)+5 - nIndex; - else - { - if( *it < nFontLen - 6 ) - nLength3 -= 6; - else // the last section 0x8003 is only 2 bytes after all - nLength3 -= (nFontLen - *it); - } - } - } - - // there may be whitespace to ignore before the 512 '0' - while( pFontData[nIndex] == '\r' || pFontData[nIndex] == '\n' ) - { - nIndex--; - for( it = aSections.begin(); it != aSections.end() && (nIndex < *it || nIndex > ((*it) + 5) ); ++it ) - ; - if( it != aSections.end() ) + // search for eexec + // TODO: use getPfbSegmentLengths() if possible to skip the search thingies below + nIndex = 0; + int nEndAsciiIndex; + int nBeginBinaryIndex; + int nEndBinaryIndex; + do { - nIndex = (*it)-1; - break; // this is surely a binary boundary, in ascii case it wouldn't matter - } - } - nEndBinaryIndex = nIndex; - - // search for beginning of binary section - nBeginBinaryIndex = nEndAsciiIndex; - do - { - nBeginBinaryIndex++; - for( it = aSections.begin(); it != aSections.end() && (nBeginBinaryIndex < *it || nBeginBinaryIndex > ((*it) + 5) ); ++it ) - ; - } while( nBeginBinaryIndex < nEndBinaryIndex && - ( pFontData[nBeginBinaryIndex] == '\r' || - pFontData[nBeginBinaryIndex] == '\n' || - it != aSections.end() ) ); - - // it seems to be vital to copy the exact whitespace between binary data - // and eexec, else a invalid font results. so make nEndAsciiIndex - // always immediate in front of nBeginBinaryIndex - nEndAsciiIndex = nBeginBinaryIndex-1; - for( it = aSections.begin(); it != aSections.end() && (nEndAsciiIndex < *it || nEndAsciiIndex > ((*it)+5)); ++it ) - ; - if( it != aSections.end() ) - nEndAsciiIndex = (*it)-1; - - nLength1 = nEndAsciiIndex+1; // including the last character - for( it = aSections.begin(); it != aSections.end() && *it < nEndAsciiIndex; ++it ) - nLength1 -= 6; // decrease by pfb section size - - // if the first four bytes are all ascii hex characters, then binary data - // has to be converted to real binary data - for( nIndex = 0; nIndex < 4 && - ( ( pFontData[ nBeginBinaryIndex+nIndex ] >= '0' && pFontData[ nBeginBinaryIndex+nIndex ] <= '9' ) || - ( pFontData[ nBeginBinaryIndex+nIndex ] >= 'a' && pFontData[ nBeginBinaryIndex+nIndex ] <= 'f' ) || - ( pFontData[ nBeginBinaryIndex+nIndex ] >= 'A' && pFontData[ nBeginBinaryIndex+nIndex ] <= 'F' ) - ); ++nIndex ) - ; - bool bConvertHexData = true; - if( nIndex < 4 ) - { - bConvertHexData = false; - nLength2 = nEndBinaryIndex - nBeginBinaryIndex + 1; // include the last byte - for( it = aSections.begin(); it != aSections.end(); ++it ) - if( *it > nBeginBinaryIndex && *it < nEndBinaryIndex ) - nLength2 -= 6; - } - else - { - // count the hex ascii characters to get nLength2 - nLength2 = 0; - int nNextSectionIndex = 0; - for( it = aSections.begin(); it != aSections.end() && *it < nBeginBinaryIndex; ++it ) - ; - if( it != aSections.end() ) - nNextSectionIndex = *it; - for( nIndex = nBeginBinaryIndex; nIndex <= nEndBinaryIndex; nIndex++ ) + while( nIndex < nFontLen-4 && + ( pFontData[nIndex] != 'e' || + pFontData[nIndex+1] != 'e' || + pFontData[nIndex+2] != 'x' || + pFontData[nIndex+3] != 'e' || + pFontData[nIndex+4] != 'c' + ) + ) + nIndex++; + // check whether we are in a excluded section + for( it = aSections.begin(); it != aSections.end() && (nIndex < *it || nIndex > ((*it) + 5) ); ++it ) + ; + } while( it != aSections.end() && nIndex < nFontLen-4 ); + // this should end the ascii part + if( nIndex > nFontLen-5 ) + throw FontException(); + + nEndAsciiIndex = nIndex+4; + // now count backwards until we can account for 512 '0' + // which is the endmarker of the (hopefully) binary data + // do not count the pfb header sections + int nFound = 0; + nIndex = nFontLen-1; + while( nIndex > 0 && nFound < 512 ) { - if( nIndex == nNextSectionIndex ) + for( it = aSections.begin(); it != aSections.end() && (nIndex < *it || nIndex > ((*it) + 5) ); ++it ) + ; + if( it == aSections.end() ) { - nIndex += 6; - ++it; - nNextSectionIndex = (it == aSections.end() ? 0 : *it ); + // inside the 512 '0' block there may only be whitespace + // according to T1 spec; probably it would be to simple + // if all fonts complied + if( pFontData[nIndex] == '0' ) + nFound++; + else if( nFound > 0 && + pFontData[nIndex] != '\r' && + pFontData[nIndex] != '\t' && + pFontData[nIndex] != '\n' && + pFontData[nIndex] != ' ' ) + break; } - if( ( pFontData[ nIndex ] >= '0' && pFontData[ nIndex ] <= '9' ) || - ( pFontData[ nIndex ] >= 'a' && pFontData[ nIndex ] <= 'f' ) || - ( pFontData[ nIndex ] >= 'A' && pFontData[ nIndex ] <= 'F' ) ) - nLength2++; + nIndex--; } - DBG_ASSERT( !(nLength2 & 1), "uneven number of hex chars in binary pfa section" ); - nLength2 /= 2; - } - // now we can actually write the font stream ! -#if OSL_DEBUG_LEVEL > 1 - { - OStringBuffer aLine( " PDFWriterImpl::emitEmbeddedFont" ); - emitComment( aLine.getStr() ); - } -#endif - OStringBuffer aLine( 512 ); - nStreamObject = createObject(); - if( !updateObject(nStreamObject)) - goto streamend; - sal_Int32 nStreamLengthObject = createObject(); - aLine.append( nStreamObject ); - aLine.append( " 0 obj\n" - "<>\n" - "stream\n" ); - if( !writeBuffer( aLine.getStr(), aLine.getLength() ) ) - goto streamend; + if( nIndex < 1 || nIndex <= nEndAsciiIndex ) + throw FontException(); - sal_uInt64 nBeginStreamPos = 0; - osl_getFilePos( m_aFile, &nBeginStreamPos ); - - beginCompression(); - checkAndEnableStreamEncryption( nStreamObject ); - - // write ascii section - if( aSections.begin() == aSections.end() ) - { - if( ! writeBuffer( pFontData, nEndAsciiIndex+1 ) ) - { - endCompression(); - disableStreamEncryption(); - goto streamend; - } - } - else - { - // first section always starts at 0 - it = aSections.begin(); - nIndex = (*it)+6; - ++it; - while( *it < nEndAsciiIndex ) + // nLength3 is the rest of the file - excluding any section headers + // nIndex now points to the first of the 512 '0' characters marking the + // fixed content portion + sal_Int32 nLength3 = nFontLen - nIndex; + for( it = aSections.begin(); it != aSections.end(); ++it ) { - if( ! writeBuffer( pFontData+nIndex, (*it)-nIndex ) ) + if( *it >= nIndex ) { - endCompression(); - disableStreamEncryption(); - goto streamend; + // special case: nIndex inside a section marker + if( nIndex >= (*it) && (*it)+5 > nIndex ) + nLength3 -= (*it)+5 - nIndex; + else + { + if( *it < nFontLen - 6 ) + nLength3 -= 6; + else // the last section 0x8003 is only 2 bytes after all + nLength3 -= (nFontLen - *it); + } } - nIndex = (*it)+6; - ++it; } - // write partial last section - if( ! writeBuffer( pFontData+nIndex, nEndAsciiIndex-nIndex+1 ) ) - { - endCompression(); - disableStreamEncryption(); - goto streamend; - } - } - // write binary section - if( ! bConvertHexData ) - { - if( aSections.begin() == aSections.end() ) + // there may be whitespace to ignore before the 512 '0' + while( pFontData[nIndex] == '\r' || pFontData[nIndex] == '\n' ) { - if( ! writeBuffer( pFontData+nBeginBinaryIndex, nFontLen-nBeginBinaryIndex ) ) + nIndex--; + for( it = aSections.begin(); it != aSections.end() && (nIndex < *it || nIndex > ((*it) + 5) ); ++it ) + ; + if( it != aSections.end() ) { - endCompression(); - disableStreamEncryption(); - goto streamend; + nIndex = (*it)-1; + break; // this is surely a binary boundary, in ascii case it wouldn't matter } } - else + nEndBinaryIndex = nIndex; + + // search for beginning of binary section + nBeginBinaryIndex = nEndAsciiIndex; + do { - for( it = aSections.begin(); *it < nBeginBinaryIndex; ++it ) + nBeginBinaryIndex++; + for( it = aSections.begin(); it != aSections.end() && (nBeginBinaryIndex < *it || nBeginBinaryIndex > ((*it) + 5) ); ++it ) ; - // write first partial section - if( ! writeBuffer( pFontData+nBeginBinaryIndex, (*it) - nBeginBinaryIndex ) ) - { - endCompression(); - disableStreamEncryption(); - goto streamend; - } - // write following sections - while( it != aSections.end() ) - { - nIndex = (*it)+6; - ++it; - if( nIndex < nFontLen ) // last section marker is usually the EOF which has only 2 bytes + } while( nBeginBinaryIndex < nEndBinaryIndex && + ( pFontData[nBeginBinaryIndex] == '\r' || + pFontData[nBeginBinaryIndex] == '\n' || + it != aSections.end() ) ); + + // it seems to be vital to copy the exact whitespace between binary data + // and eexec, else a invalid font results. so make nEndAsciiIndex + // always immediate in front of nBeginBinaryIndex + nEndAsciiIndex = nBeginBinaryIndex-1; + for( it = aSections.begin(); it != aSections.end() && (nEndAsciiIndex < *it || nEndAsciiIndex > ((*it)+5)); ++it ) + ; + if( it != aSections.end() ) + nEndAsciiIndex = (*it)-1; + + nLength1 = nEndAsciiIndex+1; // including the last character + for( it = aSections.begin(); it != aSections.end() && *it < nEndAsciiIndex; ++it ) + nLength1 -= 6; // decrease by pfb section size + + // if the first four bytes are all ascii hex characters, then binary data + // has to be converted to real binary data + for( nIndex = 0; nIndex < 4 && + ( ( pFontData[ nBeginBinaryIndex+nIndex ] >= '0' && pFontData[ nBeginBinaryIndex+nIndex ] <= '9' ) || + ( pFontData[ nBeginBinaryIndex+nIndex ] >= 'a' && pFontData[ nBeginBinaryIndex+nIndex ] <= 'f' ) || + ( pFontData[ nBeginBinaryIndex+nIndex ] >= 'A' && pFontData[ nBeginBinaryIndex+nIndex ] <= 'F' ) + ); ++nIndex ) + ; + bool bConvertHexData = true; + if( nIndex < 4 ) + { + bConvertHexData = false; + nLength2 = nEndBinaryIndex - nBeginBinaryIndex + 1; // include the last byte + for( it = aSections.begin(); it != aSections.end(); ++it ) + if( *it > nBeginBinaryIndex && *it < nEndBinaryIndex ) + nLength2 -= 6; + } + else { - sal_Int32 nSectionLen = (it == aSections.end()) ? nFontLen - nIndex : (*it) - nIndex; - if( ! writeBuffer( pFontData+nIndex, nSectionLen ) ) + // count the hex ascii characters to get nLength2 + nLength2 = 0; + int nNextSectionIndex = 0; + for( it = aSections.begin(); it != aSections.end() && *it < nBeginBinaryIndex; ++it ) + ; + if( it != aSections.end() ) + nNextSectionIndex = *it; + for( nIndex = nBeginBinaryIndex; nIndex <= nEndBinaryIndex; nIndex++ ) { - endCompression(); - disableStreamEncryption(); - goto streamend; + if( nIndex == nNextSectionIndex ) + { + nIndex += 6; + ++it; + nNextSectionIndex = (it == aSections.end() ? 0 : *it ); + } + if( ( pFontData[ nIndex ] >= '0' && pFontData[ nIndex ] <= '9' ) || + ( pFontData[ nIndex ] >= 'a' && pFontData[ nIndex ] <= 'f' ) || + ( pFontData[ nIndex ] >= 'A' && pFontData[ nIndex ] <= 'F' ) ) + nLength2++; } + DBG_ASSERT( !(nLength2 & 1), "uneven number of hex chars in binary pfa section" ); + nLength2 /= 2; } - } - } - } - else - { - unsigned char* pWriteBuffer = (unsigned char*)rtl_allocateMemory( nLength2 ); - memset( pWriteBuffer, 0, nLength2 ); - int nWriteIndex = 0; - int nNextSectionIndex = 0; - for( it = aSections.begin(); it != aSections.end() && *it < nBeginBinaryIndex; ++it ) - ; - if( it != aSections.end() ) - nNextSectionIndex = *it; - for( nIndex = nBeginBinaryIndex; nIndex <= nEndBinaryIndex; nIndex++ ) - { - if( nIndex == nNextSectionIndex ) - { - nIndex += 6; - ++it; - nNextSectionIndex = (it == aSections.end() ? nFontLen : *it ); - } - unsigned char cNibble = 0x80; - if( pFontData[ nIndex ] >= '0' && pFontData[ nIndex ] <= '9' ) - cNibble = pFontData[nIndex] - '0'; - else if( pFontData[ nIndex ] >= 'a' && pFontData[ nIndex ] <= 'f' ) - cNibble = pFontData[nIndex] - 'a' + 10; - else if( pFontData[ nIndex ] >= 'A' && pFontData[ nIndex ] <= 'F' ) - cNibble = pFontData[nIndex] - 'A' + 10; - if( cNibble != 0x80 ) - { - if( !(nWriteIndex & 1 ) ) - cNibble <<= 4; - pWriteBuffer[ nWriteIndex/2 ] |= cNibble; - nWriteIndex++; - } - } - if( ! writeBuffer( pWriteBuffer, nLength2 ) ) - { - endCompression(); - disableStreamEncryption(); - goto streamend; - } - rtl_freeMemory( pWriteBuffer ); + // now we can actually write the font stream ! + #if OSL_DEBUG_LEVEL > 1 + { + OStringBuffer aLine( " PDFWriterImpl::emitEmbeddedFont" ); + emitComment( aLine.getStr() ); + } + #endif + OStringBuffer aLine( 512 ); + nStreamObject = createObject(); + if( !updateObject(nStreamObject)) + throw FontException(); + sal_Int32 nStreamLengthObject = createObject(); + aLine.append( nStreamObject ); + aLine.append( " 0 obj\n" + "<>\n" + "stream\n" ); + if( !writeBuffer( aLine.getStr(), aLine.getLength() ) ) + throw FontException(); - if( aSections.empty() ) - { - if( ! writeBuffer( pFontData+nIndex, nFontLen-nIndex ) ) - { - endCompression(); - disableStreamEncryption(); - goto streamend; - } - } - else - { - // write rest of this section - if( nIndex < nNextSectionIndex ) - { - if( ! writeBuffer( pFontData+nIndex, nNextSectionIndex - nIndex ) ) + sal_uInt64 nBeginStreamPos = 0; + osl_getFilePos( m_aFile, &nBeginStreamPos ); + + beginCompression(); + checkAndEnableStreamEncryption( nStreamObject ); + + // write ascii section + if( aSections.begin() == aSections.end() ) { - endCompression(); - disableStreamEncryption(); - goto streamend; + if( ! writeBuffer( pFontData, nEndAsciiIndex+1 ) ) + throw FontException(); } - } - // write following sections - while( it != aSections.end() ) - { - nIndex = (*it)+6; - ++it; - if( nIndex < nFontLen ) // last section marker is usually the EOF which has only 2 bytes + else { - sal_Int32 nSectionLen = (it == aSections.end()) ? nFontLen - nIndex : (*it) - nIndex; - if( ! writeBuffer( pFontData+nIndex, nSectionLen ) ) + // first section always starts at 0 + it = aSections.begin(); + nIndex = (*it)+6; + ++it; + while( *it < nEndAsciiIndex ) { - endCompression(); - disableStreamEncryption(); - goto streamend; + if( ! writeBuffer( pFontData+nIndex, (*it)-nIndex ) ) + throw FontException(); + nIndex = (*it)+6; + ++it; } + // write partial last section + if( ! writeBuffer( pFontData+nIndex, nEndAsciiIndex-nIndex+1 ) ) + throw FontException(); } - } - } - } - endCompression(); - disableStreamEncryption(); - - sal_uInt64 nEndStreamPos = 0; - osl_getFilePos( m_aFile, &nEndStreamPos ); - - // and finally close the stream - aLine.setLength( 0 ); - aLine.append( "\nendstream\nendobj\n\n" ); - if( ! writeBuffer( aLine.getStr(), aLine.getLength() ) ) - goto streamend; + // write binary section + if( ! bConvertHexData ) + { + if( aSections.begin() == aSections.end() ) + { + if( ! writeBuffer( pFontData+nBeginBinaryIndex, nFontLen-nBeginBinaryIndex ) ) + throw FontException(); + } + else + { + for( it = aSections.begin(); *it < nBeginBinaryIndex; ++it ) + ; + // write first partial section + if( ! writeBuffer( pFontData+nBeginBinaryIndex, (*it) - nBeginBinaryIndex ) ) + throw FontException(); + // write following sections + while( it != aSections.end() ) + { + nIndex = (*it)+6; + ++it; + if( nIndex < nFontLen ) // last section marker is usually the EOF which has only 2 bytes + { + sal_Int32 nSectionLen = (it == aSections.end()) ? nFontLen - nIndex : (*it) - nIndex; + if( ! writeBuffer( pFontData+nIndex, nSectionLen ) ) + throw FontException(); + } + } + } + } + else + { + boost::shared_ptr pWriteBuffer( (unsigned char*)rtl_allocateMemory( nLength2 ), rtl_freeMemory ); + rtl_zeroMemory( pWriteBuffer.get(), nLength2 ); + int nWriteIndex = 0; + + int nNextSectionIndex = 0; + for( it = aSections.begin(); it != aSections.end() && *it < nBeginBinaryIndex; ++it ) + ; + if( it != aSections.end() ) + nNextSectionIndex = *it; + for( nIndex = nBeginBinaryIndex; nIndex <= nEndBinaryIndex; nIndex++ ) + { + if( nIndex == nNextSectionIndex ) + { + nIndex += 6; + ++it; + nNextSectionIndex = (it == aSections.end() ? nFontLen : *it ); + } + unsigned char cNibble = 0x80; + if( pFontData[ nIndex ] >= '0' && pFontData[ nIndex ] <= '9' ) + cNibble = pFontData[nIndex] - '0'; + else if( pFontData[ nIndex ] >= 'a' && pFontData[ nIndex ] <= 'f' ) + cNibble = pFontData[nIndex] - 'a' + 10; + else if( pFontData[ nIndex ] >= 'A' && pFontData[ nIndex ] <= 'F' ) + cNibble = pFontData[nIndex] - 'A' + 10; + if( cNibble != 0x80 ) + { + if( !(nWriteIndex & 1 ) ) + cNibble <<= 4; + pWriteBuffer.get()[ nWriteIndex/2 ] |= cNibble; + nWriteIndex++; + } + } + if( ! writeBuffer( pWriteBuffer.get(), nLength2 ) ) + throw FontException(); + if( aSections.empty() ) + { + if( ! writeBuffer( pFontData+nIndex, nFontLen-nIndex ) ) + throw FontException(); + } + else + { + // write rest of this section + if( nIndex < nNextSectionIndex ) + { + if( ! writeBuffer( pFontData+nIndex, nNextSectionIndex - nIndex ) ) + throw FontException(); + } + // write following sections + while( it != aSections.end() ) + { + nIndex = (*it)+6; + ++it; + if( nIndex < nFontLen ) // last section marker is usually the EOF which has only 2 bytes + { + sal_Int32 nSectionLen = (it == aSections.end()) ? nFontLen - nIndex : (*it) - nIndex; + if( ! writeBuffer( pFontData+nIndex, nSectionLen ) ) + throw FontException(); + } + } + } + } + endCompression(); + disableStreamEncryption(); - // write stream length object - aLine.setLength( 0 ); - if( ! updateObject( nStreamLengthObject ) ) - goto streamend; - aLine.append( nStreamLengthObject ); - aLine.append( " 0 obj\n" ); - aLine.append( (sal_Int64)(nEndStreamPos-nBeginStreamPos ) ); - aLine.append( "\nendobj\n\n" ); - if( ! writeBuffer( aLine.getStr(), aLine.getLength() ) ) - goto streamend; - } - else - { - rtl::OStringBuffer aErrorComment( 256 ); - aErrorComment.append( "GetEmbedFontData failed for font \"" ); - aErrorComment.append( OUStringToOString( pFont->GetFamilyName(), RTL_TEXTENCODING_UTF8 ) ); - aErrorComment.append( '\"' ); - if( pFont->GetSlant() == ITALIC_NORMAL ) - aErrorComment.append( " italic" ); - else if( pFont->GetSlant() == ITALIC_OBLIQUE ) - aErrorComment.append( " oblique" ); - aErrorComment.append( " weight=" ); - aErrorComment.append( sal_Int32(pFont->GetWeight()) ); - emitComment( aErrorComment.getStr() ); - } - - if( nStreamObject ) - // write font descriptor - nFontDescriptor = emitFontDescriptor( pFont, aInfo, 0, nStreamObject ); - if( nFontDescriptor ) - { - if( pEncoding ) - nToUnicodeStream = createToUnicodeCMap( nEncoding, &aUnicodes[0], pUnicodesPerGlyph, pEncToUnicodeIndex, sizeof(nEncoding)/sizeof(nEncoding[0]) ); + sal_uInt64 nEndStreamPos = 0; + osl_getFilePos( m_aFile, &nEndStreamPos ); - // write font object - sal_Int32 nObject = createObject(); - if( ! updateObject( nObject ) ) - goto streamend; + // and finally close the stream + aLine.setLength( 0 ); + aLine.append( "\nendstream\nendobj\n\n" ); + if( ! writeBuffer( aLine.getStr(), aLine.getLength() ) ) + throw FontException(); - OStringBuffer aLine( 1024 ); - aLine.append( nObject ); - aLine.append( " 0 obj\n" - "<mbSymbolFlag && pEncoding == 0 ) - aLine.append( "/Encoding/WinAnsiEncoding\n" ); - if( nToUnicodeStream ) - { - aLine.append( "/ToUnicode " ); - aLine.append( nToUnicodeStream ); - aLine.append( " 0 R\n" ); + // write stream length object + aLine.setLength( 0 ); + if( ! updateObject( nStreamLengthObject ) ) + throw FontException(); + aLine.append( nStreamLengthObject ); + aLine.append( " 0 obj\n" ); + aLine.append( (sal_Int64)(nEndStreamPos-nBeginStreamPos ) ); + aLine.append( "\nendobj\n\n" ); + if( ! writeBuffer( aLine.getStr(), aLine.getLength() ) ) + throw FontException(); } - aLine.append( "/FirstChar 0 /LastChar 255\n" - "/Widths[" ); - for( int i = 0; i < 256; i++ ) + else { - aLine.append( pWidths[i] ); - aLine.append( ((i&15) == 15) ? "\n" : " " ); - } - aLine.append( "]\n" - "/FontDescriptor " ); - aLine.append( nFontDescriptor ); - aLine.append( " 0 R>>\n" - "endobj\n\n" ); - if( ! writeBuffer( aLine.getStr(), aLine.getLength() ) ) - goto streamend; - - nFontObject = nObject; - - aRet[ rEmbed.m_nNormalFontID ] = nObject; + rtl::OStringBuffer aErrorComment( 256 ); + aErrorComment.append( "GetEmbedFontData failed for font \"" ); + aErrorComment.append( OUStringToOString( pFont->GetFamilyName(), RTL_TEXTENCODING_UTF8 ) ); + aErrorComment.append( '\"' ); + if( pFont->GetSlant() == ITALIC_NORMAL ) + aErrorComment.append( " italic" ); + else if( pFont->GetSlant() == ITALIC_OBLIQUE ) + aErrorComment.append( " oblique" ); + aErrorComment.append( " weight=" ); + aErrorComment.append( sal_Int32(pFont->GetWeight()) ); + emitComment( aErrorComment.getStr() ); + } + + if( nStreamObject ) + // write font descriptor + nFontDescriptor = emitFontDescriptor( pFont, aInfo, 0, nStreamObject ); - // write additional encodings - for( std::list< EmbedEncoding >::iterator enc_it = rEmbed.m_aExtendedEncodings.begin(); enc_it != rEmbed.m_aExtendedEncodings.end(); ++enc_it ) + if( nFontDescriptor ) { - sal_Int32 aEncWidths[ 256 ]; - // emit encoding dict - sal_Int32 nEncObject = createObject(); - if( ! updateObject( nEncObject ) ) - goto streamend; - - OutputDevice* pRef = getReferenceDevice(); - pRef->Push( PUSH_FONT | PUSH_MAPMODE ); - pRef->SetMapMode( MapMode( MAP_PIXEL ) ); - Font aFont( pFont->GetFamilyName(), pFont->GetStyleName(), Size( 0, 1000 ) ); - aFont.SetWeight( pFont->GetWeight() ); - aFont.SetItalic( pFont->GetSlant() ); - aFont.SetPitch( pFont->GetPitch() ); - pRef->SetFont( aFont ); - pRef->ImplNewFont(); - - aLine.setLength( 0 ); - aLine.append( nEncObject ); - aLine.append( " 0 obj\n" - "<::iterator str_it = enc_it->m_aEncVector.begin(); str_it != enc_it->m_aEncVector.end(); ++str_it ) - { - String aStr( str_it->m_aUnicode ); - aEncWidths[nEncoded] = pRef->GetTextWidth( aStr ); - nEncodedCodes[nEncoded] = str_it->m_aUnicode; - nEncoding[nEncoded] = sal::static_int_cast(nEncoded); - pEncToUnicodeIndex[nEncoded] = static_cast(aUnicodes.size()); - aUnicodes.push_back( nEncodedCodes[nEncoded] ); - pUnicodesPerGlyph[nEncoded] = 1; - - aLine.append( " /" ); - aLine.append( str_it->m_aName ); - if( !((++nEncoded) & 15) ) - aLine.append( "\n" ); - } - aLine.append( "]>>\n" - "endobj\n\n" ); - - pRef->Pop(); - - if( ! writeBuffer( aLine.getStr(), aLine.getLength() ) ) - goto streamend; - - nToUnicodeStream = createToUnicodeCMap( nEncoding, &aUnicodes[0], pUnicodesPerGlyph, pEncToUnicodeIndex, nEncoded ); + if( pEncoding ) + nToUnicodeStream = createToUnicodeCMap( nEncoding, &aUnicodes[0], pUnicodesPerGlyph, pEncToUnicodeIndex, sizeof(nEncoding)/sizeof(nEncoding[0]) ); - nObject = createObject(); + // write font object + sal_Int32 nObject = createObject(); if( ! updateObject( nObject ) ) - goto streamend; + throw FontException(); - aLine.setLength( 0 ); + OStringBuffer aLine( 1024 ); aLine.append( nObject ); aLine.append( " 0 obj\n" - "<mbSymbolFlag && pEncoding == 0 ) + aLine.append( "/Encoding/WinAnsiEncoding\n" ); if( nToUnicodeStream ) { aLine.append( "/ToUnicode " ); aLine.append( nToUnicodeStream ); aLine.append( " 0 R\n" ); } - aLine.append( "/FirstChar 0\n" - "/LastChar " ); - aLine.append( (sal_Int32)(nEncoded-1) ); - aLine.append( "\n" - "/Widths[" ); - for( int i = 0; i < nEncoded; i++ ) + aLine.append( "/FirstChar 0 /LastChar 255\n" + "/Widths[" ); + for( int i = 0; i < 256; i++ ) { - aLine.append( aEncWidths[i] ); + aLine.append( pWidths[i] ); aLine.append( ((i&15) == 15) ? "\n" : " " ); } - aLine.append( " ]\n" - "/FontDescriptor " ); + aLine.append( "]\n" + "/FontDescriptor " ); aLine.append( nFontDescriptor ); aLine.append( " 0 R>>\n" - "endobj\n\n" ); + "endobj\n\n" ); if( ! writeBuffer( aLine.getStr(), aLine.getLength() ) ) - goto streamend; + throw FontException(); + + nFontObject = nObject; + + aRet[ rEmbed.m_nNormalFontID ] = nObject; + + // write additional encodings + for( std::list< EmbedEncoding >::iterator enc_it = rEmbed.m_aExtendedEncodings.begin(); enc_it != rEmbed.m_aExtendedEncodings.end(); ++enc_it ) + { + sal_Int32 aEncWidths[ 256 ]; + // emit encoding dict + sal_Int32 nEncObject = createObject(); + if( ! updateObject( nEncObject ) ) + throw FontException(); + + OutputDevice* pRef = getReferenceDevice(); + pRef->Push( PUSH_FONT | PUSH_MAPMODE ); + pRef->SetMapMode( MapMode( MAP_PIXEL ) ); + Font aFont( pFont->GetFamilyName(), pFont->GetStyleName(), Size( 0, 1000 ) ); + aFont.SetWeight( pFont->GetWeight() ); + aFont.SetItalic( pFont->GetSlant() ); + aFont.SetPitch( pFont->GetPitch() ); + pRef->SetFont( aFont ); + pRef->ImplNewFont(); + + aLine.setLength( 0 ); + aLine.append( nEncObject ); + aLine.append( " 0 obj\n" + "<::iterator str_it = enc_it->m_aEncVector.begin(); str_it != enc_it->m_aEncVector.end(); ++str_it ) + { + String aStr( str_it->m_aUnicode ); + aEncWidths[nEncoded] = pRef->GetTextWidth( aStr ); + nEncodedCodes[nEncoded] = str_it->m_aUnicode; + nEncoding[nEncoded] = sal::static_int_cast(nEncoded); + pEncToUnicodeIndex[nEncoded] = static_cast(aUnicodes.size()); + aUnicodes.push_back( nEncodedCodes[nEncoded] ); + pUnicodesPerGlyph[nEncoded] = 1; + + aLine.append( " /" ); + aLine.append( str_it->m_aName ); + if( !((++nEncoded) & 15) ) + aLine.append( "\n" ); + } + aLine.append( "]>>\n" + "endobj\n\n" ); - aRet[ enc_it->m_nFontID ] = nObject; + pRef->Pop(); + + if( ! writeBuffer( aLine.getStr(), aLine.getLength() ) ) + throw FontException(); + + nToUnicodeStream = createToUnicodeCMap( nEncoding, &aUnicodes[0], pUnicodesPerGlyph, pEncToUnicodeIndex, nEncoded ); + + nObject = createObject(); + if( ! updateObject( nObject ) ) + throw FontException(); + + aLine.setLength( 0 ); + aLine.append( nObject ); + aLine.append( " 0 obj\n" + "<>\n" + "endobj\n\n" ); + if( ! writeBuffer( aLine.getStr(), aLine.getLength() ) ) + throw FontException(); + + aRet[ enc_it->m_nFontID ] = nObject; + } } } + catch( FontException& ) + { + // these do nothing in case there was no compression or encryption ongoing + endCompression(); + disableStreamEncryption(); + } - streamend: if( pFontData ) m_pReferenceDevice->mpGraphics->FreeEmbedFontData( pFontData, nFontLen ); @@ -9382,7 +9354,7 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask ) sal_uInt64 nStartPos = 0; CHECK_RETURN( (osl_File_E_None == osl_getFilePos( m_aFile, &nStartPos )) ); - checkAndEnableStreamEncryption( rObject.m_nObject ); + checkAndEnableStreamEncryption( rObject.m_nObject ); beginCompression(); if( ! bTrueColor || pAccess->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_RGB ) { @@ -9396,19 +9368,18 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask ) else { const int nScanLineBytes = pAccess->Width()*3; - sal_uInt8 *pCol = (sal_uInt8*)rtl_allocateMemory( nScanLineBytes ); + boost::shared_ptr pCol( (sal_uInt8*)rtl_allocateMemory( nScanLineBytes ), rtl_freeMemory ); for( int y = 0; y < pAccess->Height(); y++ ) { for( int x = 0; x < pAccess->Width(); x++ ) { BitmapColor aColor = pAccess->GetColor( y, x ); - pCol[3*x+0] = aColor.GetRed(); - pCol[3*x+1] = aColor.GetGreen(); - pCol[3*x+2] = aColor.GetBlue(); + pCol.get()[3*x+0] = aColor.GetRed(); + pCol.get()[3*x+1] = aColor.GetGreen(); + pCol.get()[3*x+2] = aColor.GetBlue(); } - CHECK_RETURN( writeBuffer( pCol, nScanLineBytes ) ); + CHECK_RETURN( writeBuffer( pCol.get(), nScanLineBytes ) ); } - rtl_freeMemory( pCol ); } endCompression(); disableStreamEncryption(); -- cgit v1.2.3 From ab6fc0e3dfa60ad2cb10e4e936335d2d8986fe55 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Fri, 18 Dec 2009 10:03:55 +0100 Subject: whitespace cleanup. --- ucb/source/ucp/hierarchy/hierarchycontentcaps.cxx | 30 +++++++++++------------ 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/ucb/source/ucp/hierarchy/hierarchycontentcaps.cxx b/ucb/source/ucp/hierarchy/hierarchycontentcaps.cxx index 117819ff0e70..cf6e0edd3f0b 100644 --- a/ucb/source/ucp/hierarchy/hierarchycontentcaps.cxx +++ b/ucb/source/ucp/hierarchy/hierarchycontentcaps.cxx @@ -39,23 +39,23 @@ Props/Commands: - root folder folder link link - (new) (new) + root folder folder link link + (new) (new) ---------------------------------------------------------------- - ContentType x x x x x - IsDocument x x x x x - IsFolder x x x x x - Title x x x x x - TargetURL x x + ContentType x x x x x + IsDocument x x x x x + IsFolder x x x x x + Title x x x x x + TargetURL x x - getCommandInfo x x x x x - getPropertySetInfo x x x x x - getPropertyValues x x x x x - setPropertyValues x x x x x - insert x x - delete x x - open x x - transfer x x + getCommandInfo x x x x x + getPropertySetInfo x x x x x + getPropertyValues x x x x x + setPropertyValues x x x x x + insert x x + delete x x + open x x + transfer x x *************************************************************************/ #include -- cgit v1.2.3 From f4ccd00d3626347be13ca5919a07bb39b58729c5 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 18 Dec 2009 11:44:01 +0100 Subject: vcl108: #i107254# copy with arbitrary length ligatures --- vcl/source/gdi/pdfwriter_impl.cxx | 15 ++++++------ vcl/source/gdi/pdfwriter_impl.hxx | 49 ++++++++++++++++++++++++++++++++++----- 2 files changed, 50 insertions(+), 14 deletions(-) diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 0564be3c1c1f..7db8325bfedd 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -3669,7 +3669,7 @@ bool PDFWriterImpl::emitFonts() rtl_zeroMemory( pEncToUnicodeIndex, sizeof( pEncToUnicodeIndex ) ); for( FontEmitMapping::iterator fit = lit->m_aMapping.begin(); fit != lit->m_aMapping.end();++fit ) { - sal_uInt8 nEnc = fit->second.m_nSubsetGlyphID; + sal_uInt8 nEnc = fit->second.getGlyphId(); DBG_ASSERT( pGlyphIDs[nEnc] == 0 && pEncoding[nEnc] == 0, "duplicate glyph" ); DBG_ASSERT( nEnc <= lit->m_aMapping.size(), "invalid glyph encoding" ); @@ -3677,10 +3677,10 @@ bool PDFWriterImpl::emitFonts() pGlyphIDs[ nEnc ] = fit->first; pEncoding[ nEnc ] = nEnc; pEncToUnicodeIndex[ nEnc ] = static_cast(aUnicodes.size()); - pUnicodesPerGlyph[ nEnc ] = fit->second.m_nUnicodes; - for( sal_Int32 n = 0; n < fit->second.m_nUnicodes; n++ ) - aUnicodes.push_back( fit->second.m_aUnicodes[n] ); - if( fit->second.m_aUnicodes[0] ) + pUnicodesPerGlyph[ nEnc ] = fit->second.countCodes(); + for( sal_Int32 n = 0; n < pUnicodesPerGlyph[ nEnc ]; n++ ) + aUnicodes.push_back( fit->second.getCode( n ) ); + if( fit->second.getCode(0) ) nToUnicodeStream = 1; if( nGlyphs < 256 ) nGlyphs++; @@ -6459,10 +6459,9 @@ void PDFWriterImpl::registerGlyphs( int nGlyphs, // add new glyph to emitted font subset GlyphEmit& rNewGlyphEmit = rSubset.m_aSubsets.back().m_aMapping[ nFontGlyphId ]; - rNewGlyphEmit.m_nSubsetGlyphID = nNewId; - rNewGlyphEmit.m_nUnicodes = pUnicodesPerGlyph[i]; + rNewGlyphEmit.setGlyphId( nNewId ); for( sal_Int32 n = 0; n < pUnicodesPerGlyph[i]; n++ ) - rNewGlyphEmit.m_aUnicodes[n] = pCurUnicode[n]; + rNewGlyphEmit.addCode( pCurUnicode[n] ); // add new glyph to font mapping Glyph& rNewGlyph = rSubset.m_aMapping[ nFontGlyphId ]; diff --git a/vcl/source/gdi/pdfwriter_impl.hxx b/vcl/source/gdi/pdfwriter_impl.hxx index c8b201a7bfb8..68cf8a808303 100644 --- a/vcl/source/gdi/pdfwriter_impl.hxx +++ b/vcl/source/gdi/pdfwriter_impl.hxx @@ -52,6 +52,8 @@ #include #include +#include + class ImplFontSelectData; class ImplFontMetricData; class FontSubsetInfo; @@ -270,17 +272,52 @@ public: }; // font subsets - struct GlyphEmit + class GlyphEmit { - static const int nMaxUnicodes = 8; // performance: actually this should probably a vector; - sal_Ucs m_aUnicodes[nMaxUnicodes]; - sal_Int32 m_nUnicodes; - sal_uInt8 m_nSubsetGlyphID; + sal_Ucs m_aBufferedUnicodes[3]; + sal_Int32 m_nUnicodes; + sal_Int32 m_nMaxUnicodes; + boost::shared_array m_pUnicodes; + sal_uInt8 m_nSubsetGlyphID; + public: GlyphEmit() : m_nUnicodes(0), m_nSubsetGlyphID(0) { - rtl_zeroMemory( m_aUnicodes, sizeof( m_aUnicodes ) ); + rtl_zeroMemory( m_aBufferedUnicodes, sizeof( m_aBufferedUnicodes ) ); + m_nMaxUnicodes = sizeof(m_aBufferedUnicodes)/sizeof(m_aBufferedUnicodes[0]); + } + ~GlyphEmit() + { + } + + void setGlyphId( sal_uInt8 i_nId ) { m_nSubsetGlyphID = i_nId; } + sal_uInt8 getGlyphId() const { return m_nSubsetGlyphID; } + + void addCode( sal_Ucs i_cCode ) + { + if( m_nUnicodes == m_nMaxUnicodes ) + { + sal_Ucs* pNew = new sal_Ucs[ 2 * m_nMaxUnicodes]; + if( m_pUnicodes.get() ) + rtl_copyMemory( pNew, m_pUnicodes.get(), m_nMaxUnicodes * sizeof(sal_Ucs) ); + else + rtl_copyMemory( pNew, m_aBufferedUnicodes, m_nMaxUnicodes * sizeof(sal_Ucs) ); + m_pUnicodes.reset( pNew ); + m_nMaxUnicodes *= 2; + } + if( m_pUnicodes.get() ) + m_pUnicodes[ m_nUnicodes++ ] = i_cCode; + else + m_aBufferedUnicodes[ m_nUnicodes++ ] = i_cCode; + } + sal_Int32 countCodes() const { return m_nUnicodes; } + sal_Ucs getCode( sal_Int32 i_nIndex ) const + { + sal_Ucs nRet = 0; + if( i_nIndex < m_nUnicodes ) + nRet = m_pUnicodes.get() ? m_pUnicodes[ i_nIndex ] : m_aBufferedUnicodes[ i_nIndex ]; + return nRet; } }; typedef std::map< sal_GlyphId, GlyphEmit > FontEmitMapping; -- cgit v1.2.3 From a0c826b44af446e44b7dc4e80919c1c7f00c2eee Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 18 Dec 2009 11:48:57 +0100 Subject: #vcl108: #i106704# use shared_array as is more appropriate --- vcl/source/gdi/pdfwriter_impl.cxx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 7db8325bfedd..496ce037e1b3 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -64,8 +64,6 @@ #include "implncvt.hxx" -#include - #include "cppuhelper/implbase1.hxx" #include @@ -3175,7 +3173,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont } else { - boost::shared_ptr pWriteBuffer( (unsigned char*)rtl_allocateMemory( nLength2 ), rtl_freeMemory ); + boost::shared_array pWriteBuffer( new unsigned char[ nLength2 ] ); rtl_zeroMemory( pWriteBuffer.get(), nLength2 ); int nWriteIndex = 0; @@ -9367,15 +9365,15 @@ bool PDFWriterImpl::writeBitmapObject( BitmapEmit& rObject, bool bMask ) else { const int nScanLineBytes = pAccess->Width()*3; - boost::shared_ptr pCol( (sal_uInt8*)rtl_allocateMemory( nScanLineBytes ), rtl_freeMemory ); + boost::shared_array pCol( new sal_uInt8[ nScanLineBytes ] ); for( int y = 0; y < pAccess->Height(); y++ ) { for( int x = 0; x < pAccess->Width(); x++ ) { BitmapColor aColor = pAccess->GetColor( y, x ); - pCol.get()[3*x+0] = aColor.GetRed(); - pCol.get()[3*x+1] = aColor.GetGreen(); - pCol.get()[3*x+2] = aColor.GetBlue(); + pCol[3*x+0] = aColor.GetRed(); + pCol[3*x+1] = aColor.GetGreen(); + pCol[3*x+2] = aColor.GetBlue(); } CHECK_RETURN( writeBuffer( pCol.get(), nScanLineBytes ) ); } -- cgit v1.2.3 From 52a1cb18450902320ef3d2431d0e3e0ec2739d3e Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Fri, 18 Dec 2009 13:38:21 +0100 Subject: whitespace cleanup. --- ucb/source/ucp/hierarchy/hierarchycontent.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ucb/source/ucp/hierarchy/hierarchycontent.cxx b/ucb/source/ucp/hierarchy/hierarchycontent.cxx index b3dfaba1fbb8..65911b4185cf 100644 --- a/ucb/source/ucp/hierarchy/hierarchycontent.cxx +++ b/ucb/source/ucp/hierarchy/hierarchycontent.cxx @@ -41,7 +41,7 @@ ************************************************************************** - Root Folder vs. 'normal' Folder - - root doesn't support command 'delete' + - root doesn't support command 'delete' - root doesn't support command 'insert' - root needs not created via XContentCreator - queryContent with root folder id ( HIERARCHY_ROOT_FOLDER_URL ) always returns a value != 0 @@ -552,7 +552,7 @@ uno::Any SAL_CALL HierarchyContent::execute( { ////////////////////////////////////////////////////////////////// // transfer - // ( Not available at link objects ) + // ( Not available at link objects ) ////////////////////////////////////////////////////////////////// ucb::TransferInfo aInfo; @@ -1161,7 +1161,7 @@ uno::Sequence< uno::Any > HierarchyContent::setPropertyValues( beans::PropertyChangeEvent aEvent; aEvent.Source = static_cast< cppu::OWeakObject * >( this ); - aEvent.Further = sal_False; + aEvent.Further = sal_False; // aEvent.PropertyName = aEvent.PropertyHandle = -1; // aEvent.OldValue = -- cgit v1.2.3 From 460919060e77525e3ac3e94054fc0f17fae5ba17 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 18 Dec 2009 15:29:59 +0100 Subject: vcl108: #i2446# add prominent entry style to listbox and combobox --- svtools/source/control/ctrlbox.cxx | 1 + vcl/inc/vcl/combobox.hxx | 4 ++++ vcl/inc/vcl/ilstbox.hxx | 10 ++++++++++ vcl/inc/vcl/lstbox.hxx | 4 ++++ vcl/inc/vcl/wintypes.hxx | 6 ++++++ vcl/source/control/combobox.cxx | 24 ++++++++++++++++++++++-- vcl/source/control/ilstbox.cxx | 27 +++++++++++++++++++-------- vcl/source/control/lstbox.cxx | 21 +++++++++++++++++++++ 8 files changed, 87 insertions(+), 10 deletions(-) diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index 097bba0e39f9..b4d8d0506917 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -1152,6 +1152,7 @@ void FontSizeBox::ImplInit() SetDecimalDigits( 1 ); SetMin( 20 ); SetMax( 9999 ); + SetProminentEntryType( PROMINENT_MIDDLE ); } // ----------------------------------------------------------------------- diff --git a/vcl/inc/vcl/combobox.hxx b/vcl/inc/vcl/combobox.hxx index d57d4b8a7372..cbceffaff6c0 100644 --- a/vcl/inc/vcl/combobox.hxx +++ b/vcl/inc/vcl/combobox.hxx @@ -192,8 +192,12 @@ public: void* GetEntryData( USHORT nPos ) const; void SetTopEntry( USHORT nPos ); + void ShowProminentEntry( USHORT nPos ); USHORT GetTopEntry() const; + void SetProminentEntryType( ProminentEntry eType ); + ProminentEntry GetProminentEntryType() const; + USHORT GetDisplayLineCount() const; USHORT GetSelectEntryCount() const; diff --git a/vcl/inc/vcl/ilstbox.hxx b/vcl/inc/vcl/ilstbox.hxx index 81dd32ef2705..f38825028080 100644 --- a/vcl/inc/vcl/ilstbox.hxx +++ b/vcl/inc/vcl/ilstbox.hxx @@ -227,6 +227,7 @@ private: long mnLeft; // Ausgabe ab Spalte long mnBorder; // Abstand Rahmen - Text long mnTextHeight; // Texthoehe + ProminentEntry meProminentType; // where is the "prominent" entry USHORT mnSelectModifier; // Modifiers @@ -309,6 +310,11 @@ public: void SetTopEntry( USHORT nTop ); USHORT GetTopEntry() const { return mnTop; } + // ShowProminentEntry will set the entry correspoding to nEntryPos + // either at top or in the middle depending on the chosen style + void ShowProminentEntry( USHORT nEntryPos ); + void SetProminentEntryType( ProminentEntry eType ) { meProminentType = eType; } + ProminentEntry GetProminentEntryType() const { return meProminentType; } using Window::IsVisible; BOOL IsVisible( USHORT nEntry ) const; @@ -443,9 +449,13 @@ public: void SetTopEntry( USHORT nTop ) { maLBWindow.SetTopEntry( nTop ); } USHORT GetTopEntry() const { return maLBWindow.GetTopEntry(); } + void ShowProminentEntry( USHORT nPos ) { maLBWindow.ShowProminentEntry( nPos ); } using Window::IsVisible; BOOL IsVisible( USHORT nEntry ) const { return maLBWindow.IsVisible( nEntry ); } + void SetProminentEntryType( ProminentEntry eType ) { maLBWindow.SetProminentEntryType( eType ); } + ProminentEntry GetProminentEntryType() const { return maLBWindow.GetProminentEntryType(); } + long GetLeftIndent() const { return maLBWindow.GetLeftIndent(); } void SetLeftIndent( USHORT n ) { maLBWindow.SetLeftIndent( n ); } void ScrollHorz( short nDiff ) { maLBWindow.ScrollHorz( nDiff ); } diff --git a/vcl/inc/vcl/lstbox.hxx b/vcl/inc/vcl/lstbox.hxx index 0bf281798674..806ff9bb3e0f 100644 --- a/vcl/inc/vcl/lstbox.hxx +++ b/vcl/inc/vcl/lstbox.hxx @@ -168,9 +168,13 @@ public: long GetEntryFlags( USHORT nPos ) const; void SetTopEntry( USHORT nPos ); + void ShowProminentEntry( USHORT nPos ); void SetTopEntryStr( const XubString& rStr ); USHORT GetTopEntry() const; + void SetProminentEntryType( ProminentEntry eType ); + ProminentEntry GetProminentEntryType() const; + void SaveValue() { mnSaveValue = GetSelectEntryPos(); } USHORT GetSavedValue() const { return mnSaveValue; } diff --git a/vcl/inc/vcl/wintypes.hxx b/vcl/inc/vcl/wintypes.hxx index 968f0e1d255f..1c32001a649b 100644 --- a/vcl/inc/vcl/wintypes.hxx +++ b/vcl/inc/vcl/wintypes.hxx @@ -333,5 +333,11 @@ typedef USHORT StandardButtonType; #define BUTTON_LESS ((StandardButtonType)10) #define BUTTON_COUNT 11 +// -------------------------------------------- +// - prominent place for ListBox window types - +// -------------------------------------------- + +enum ProminentEntry { PROMINENT_TOP, PROMINENT_MIDDLE }; + #endif // _SV_WINTYPES_HXX diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index 21707d0182f5..1eea72131b86 100644 --- a/vcl/source/control/combobox.cxx +++ b/vcl/source/control/combobox.cxx @@ -951,7 +951,7 @@ void ComboBox::ImplUpdateFloatSelection() if( nSelect != LISTBOX_ENTRY_NOTFOUND ) { if ( !mpImplLB->IsVisible( nSelect ) ) - mpImplLB->SetTopEntry( nSelect ); + mpImplLB->ShowProminentEntry( nSelect ); mpImplLB->SelectEntry( nSelect, bSelect ); } else @@ -959,7 +959,6 @@ void ComboBox::ImplUpdateFloatSelection() nSelect = mpImplLB->GetEntryList()->GetSelectEntryPos( 0 ); if( nSelect != LISTBOX_ENTRY_NOTFOUND ) mpImplLB->SelectEntry( nSelect, FALSE ); - // mpImplLB->SetTopEntry( 0 ); #92555# Ugly.... mpImplLB->ResetCurrentPos(); } } @@ -1440,6 +1439,13 @@ void ComboBox::SetTopEntry( USHORT nPos ) // ----------------------------------------------------------------------- +void ComboBox::ShowProminentEntry( USHORT nPos ) +{ + mpImplLB->ShowProminentEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount() ); +} + +// ----------------------------------------------------------------------- + USHORT ComboBox::GetTopEntry() const { USHORT nPos = GetEntryCount() ? mpImplLB->GetTopEntry() : LISTBOX_ENTRY_NOTFOUND; @@ -1450,6 +1456,20 @@ USHORT ComboBox::GetTopEntry() const // ----------------------------------------------------------------------- +void ComboBox::SetProminentEntryType( ProminentEntry eType ) +{ + mpImplLB->SetProminentEntryType( eType ); +} + +// ----------------------------------------------------------------------- + +ProminentEntry ComboBox::GetProminentEntryType() const +{ + return mpImplLB->GetProminentEntryType(); +} + +// ----------------------------------------------------------------------- + Rectangle ComboBox::GetDropDownPosSizePixel() const { return mpFloatWin ? mpFloatWin->GetWindowExtentsRelative( const_cast(this) ) : Rectangle(); diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx index a915d8e6b9e8..490651bd8b17 100644 --- a/vcl/source/control/ilstbox.cxx +++ b/vcl/source/control/ilstbox.cxx @@ -565,6 +565,7 @@ ImplListBoxWindow::ImplListBoxWindow( Window* pParent, WinBits nWinStyle ) : mnCurrentPos = LISTBOX_ENTRY_NOTFOUND; mnTrackingSaveSelection = LISTBOX_ENTRY_NOTFOUND; mnSeparatorPos = LISTBOX_ENTRY_NOTFOUND; + meProminentType = PROMINENT_TOP; SetLineColor(); SetTextFillColor(); @@ -1067,11 +1068,11 @@ void ImplListBoxWindow::SelectEntry( USHORT nPos, BOOL bSelect ) if ( !nVisibleEntries || !IsReallyVisible() || ( nPos < GetTopEntry() ) ) { Resize(); - SetTopEntry( nPos ); + ShowProminentEntry( nPos ); } else { - SetTopEntry( nPos-nVisibleEntries+1 ); + ShowProminentEntry( nPos ); } } } @@ -1702,11 +1703,7 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt ) if ( nSelect != LISTBOX_ENTRY_NOTFOUND ) { - USHORT nCurVis = GetLastVisibleEntry() - mnTop + 1; - if( nSelect < mnTop ) - SetTopEntry( nSelect ); - else if( nSelect >= (mnTop + nCurVis) ) - SetTopEntry( nSelect - nCurVis + 1 ); + ShowProminentEntry( nSelect ); if ( mpEntryList->IsEntryPosSelected( nSelect ) ) nSelect = LISTBOX_ENTRY_NOTFOUND; @@ -2051,6 +2048,20 @@ void ImplListBoxWindow::SetTopEntry( USHORT nTop ) // ----------------------------------------------------------------------- +void ImplListBoxWindow::ShowProminentEntry( USHORT nEntryPos ) +{ + if( meProminentType == PROMINENT_MIDDLE ) + { + USHORT nPos = nEntryPos; + long nWHeight = PixelToLogic( GetSizePixel() ).Height(); + while( nEntryPos > 0 && mpEntryList->GetAddedHeight( nPos+1, nEntryPos ) < nWHeight/2 ) + nEntryPos--; + } + SetTopEntry( nEntryPos ); +} + +// ----------------------------------------------------------------------- + void ImplListBoxWindow::SetLeftIndent( long n ) { ScrollHorz( n - mnLeft ); @@ -3204,7 +3215,7 @@ void ImplListBoxFloatingWindow::StartFloat( BOOL bStartTracking ) StartPopupMode( aRect, FLOATWIN_POPUPMODE_DOWN ); if( nPos != LISTBOX_ENTRY_NOTFOUND ) - mpImplLB->SetTopEntry( nPos ); + mpImplLB->ShowProminentEntry( nPos ); if( bStartTracking ) mpImplLB->GetMainWindow()->EnableMouseMoveSelect( TRUE ); diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx index ceabbe4ab166..37ce438fa79e 100644 --- a/vcl/source/control/lstbox.cxx +++ b/vcl/source/control/lstbox.cxx @@ -1209,6 +1209,13 @@ void ListBox::SetTopEntry( USHORT nPos ) // ----------------------------------------------------------------------- +void ListBox::ShowProminentEntry( USHORT nPos ) +{ + mpImplLB->ShowProminentEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount() ); +} + +// ----------------------------------------------------------------------- + USHORT ListBox::GetTopEntry() const { USHORT nPos = GetEntryCount() ? mpImplLB->GetTopEntry() : LISTBOX_ENTRY_NOTFOUND; @@ -1219,6 +1226,20 @@ USHORT ListBox::GetTopEntry() const // ----------------------------------------------------------------------- +void ListBox::SetProminentEntryType( ProminentEntry eType ) +{ + mpImplLB->SetProminentEntryType( eType ); +} + +// ----------------------------------------------------------------------- + +ProminentEntry ListBox::GetProminentEntryType() const +{ + return mpImplLB->GetProminentEntryType(); +} + +// ----------------------------------------------------------------------- + BOOL ListBox::IsTravelSelect() const { return mpImplLB->IsTravelSelect(); -- cgit v1.2.3 From 6167ab5334f65d27418308a0ec1fe5a24b27f134 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Fri, 18 Dec 2009 15:31:20 +0100 Subject: whitespace cleanup. --- ucb/source/ucp/hierarchy/hierarchycontent.hxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ucb/source/ucp/hierarchy/hierarchycontent.hxx b/ucb/source/ucp/hierarchy/hierarchycontent.hxx index b85f2aac781e..68cd2eed6f04 100644 --- a/ucb/source/ucp/hierarchy/hierarchycontent.hxx +++ b/ucb/source/ucp/hierarchy/hierarchycontent.hxx @@ -117,7 +117,7 @@ class HierarchyContent : public ::ucbhelper::ContentImplHelper, { enum ContentKind { LINK, FOLDER, ROOT }; enum ContentState { TRANSIENT, // created via CreateNewContent, - // but did not process "insert" yet + // but did not process "insert" yet PERSISTENT, // processed "insert" DEAD // processed "delete" }; @@ -198,7 +198,7 @@ private: ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow > getPropertyValues( const ::com::sun::star::uno::Sequence< - ::com::sun::star::beans::Property >& rProperties ); + ::com::sun::star::beans::Property >& rProperties ); ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > setPropertyValues( const ::com::sun::star::uno::Sequence< @@ -270,7 +270,7 @@ public: execute( const com::sun::star::ucb::Command& aCommand, sal_Int32 CommandId, const com::sun::star::uno::Reference< - com::sun::star::ucb::XCommandEnvironment >& Environment ) + com::sun::star::ucb::XCommandEnvironment >& Environment ) throw( com::sun::star::uno::Exception, com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::RuntimeException ); @@ -300,7 +300,7 @@ public: getPropertyValues( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rSMgr, const ::com::sun::star::uno::Sequence< - ::com::sun::star::beans::Property >& rProperties, + ::com::sun::star::beans::Property >& rProperties, const HierarchyContentProperties& rData, HierarchyContentProvider* pProvider, const ::rtl::OUString& rContentId ); -- cgit v1.2.3 From 44c3f12e20ad27a1118b696965f39ee7480a18ac Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Fri, 18 Dec 2009 16:40:20 +0100 Subject: whitespace cleanup. --- ucb/source/ucp/package/pkgcontent.cxx | 41 ++++++++++++++++------------------- ucb/source/ucp/package/pkgcontent.hxx | 24 ++++++++++---------- 2 files changed, 30 insertions(+), 35 deletions(-) diff --git a/ucb/source/ucp/package/pkgcontent.cxx b/ucb/source/ucp/package/pkgcontent.cxx index f06618b702d3..7fff9871c2cb 100644 --- a/ucb/source/ucp/package/pkgcontent.cxx +++ b/ucb/source/ucp/package/pkgcontent.cxx @@ -55,9 +55,7 @@ #include #include #include -#ifndef _COM_SUN_STAR_UCB_INTERACTIVEBADTRANSFRERURLEXCEPTION_HPP_ #include -#endif #include #include #include @@ -294,7 +292,7 @@ uno::Any SAL_CALL Content::queryInterface( const uno::Type & rType ) aRet = cppu::queryInterface( rType, static_cast< ucb::XContentCreator * >( this ) ); - return aRet.hasValue() ? aRet : ContentImplHelper::queryInterface( rType ); + return aRet.hasValue() ? aRet : ContentImplHelper::queryInterface( rType ); } //========================================================================= @@ -609,7 +607,7 @@ uno::Any SAL_CALL Content::execute( { ////////////////////////////////////////////////////////////////// // transfer - // ( Not available at stream objects ) + // ( Not available at stream objects ) ////////////////////////////////////////////////////////////////// ucb::TransferInfo aInfo; @@ -632,7 +630,7 @@ uno::Any SAL_CALL Content::execute( { ////////////////////////////////////////////////////////////////// // flush - // ( Not available at stream objects ) + // ( Not available at stream objects ) ////////////////////////////////////////////////////////////////// if( !flushData() ) @@ -1069,10 +1067,10 @@ uno::Sequence< uno::Any > Content::setPropertyValues( beans::PropertyChangeEvent aEvent; aEvent.Source = static_cast< cppu::OWeakObject * >( this ); aEvent.Further = sal_False; -// aEvent.PropertyName = +// aEvent.PropertyName = aEvent.PropertyHandle = -1; -// aEvent.OldValue = -// aEvent.NewValue = +// aEvent.OldValue = +// aEvent.NewValue = const beans::PropertyValue* pValues = rValues.getConstArray(); sal_Int32 nCount = rValues.getLength(); @@ -1181,7 +1179,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( aEvent.NewValue = uno::makeAny( aNewValue ); m_aProps.aMediaType = aNewValue; - nChanged++; + nChanged++; bStore = sal_True; m_nModifiedProps |= MEDIATYPE_MODIFIED; } @@ -1219,7 +1217,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( aEvent.NewValue = uno::makeAny( bNewValue ); m_aProps.bCompressed = bNewValue; - nChanged++; + nChanged++; bStore = sal_True; m_nModifiedProps |= COMPRESSED_MODIFIED; } @@ -1256,7 +1254,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( aEvent.NewValue = uno::makeAny( bNewValue ); m_aProps.bEncrypted = bNewValue; - nChanged++; + nChanged++; bStore = sal_True; m_nModifiedProps |= ENCRYPTED_MODIFIED; } @@ -1483,7 +1481,7 @@ uno::Any Content::open( uno::Reference< ucb::XDynamicResultSet > xSet = new DynamicResultSet( m_xSMgr, this, rArg, xEnv ); return uno::makeAny( xSet ); - } + } else { ////////////////////////////////////////////////////////////////// @@ -1506,7 +1504,7 @@ uno::Any Content::open( rtl::OUString aURL = m_xIdentifier->getContentIdentifier(); uno::Reference< io::XOutputStream > xOut( rArg.Sink, uno::UNO_QUERY ); if ( xOut.is() ) - { + { // PUSH: write data into xOut uno::Reference< io::XInputStream > xIn = getInputStream(); @@ -1560,14 +1558,14 @@ uno::Any Content::open( { // closeOutput, readSomeBytes, writeBytes } - } + } else - { + { uno::Reference< io::XActiveDataSink > xDataSink( rArg.Sink, uno::UNO_QUERY ); - if ( xDataSink.is() ) + if ( xDataSink.is() ) { - // PULL: wait for client read + // PULL: wait for client read uno::Reference< io::XInputStream > xIn = getInputStream(); if ( !xIn.is() ) @@ -1598,7 +1596,7 @@ uno::Any Content::open( // Done. xDataSink->setInputStream( xIn ); } - else + else { // Note: aOpenCommand.Sink may contain an XStream // implementation. Support for this type of @@ -1612,7 +1610,7 @@ uno::Any Content::open( xEnv ); // Unreachable } - } + } } return uno::Any(); @@ -2611,8 +2609,8 @@ sal_Bool Content::storeData( const uno::Reference< io::XInputStream >& xStream ) if ( !xNA->hasByHierarchicalName( m_aUri.getPath() ) ) { -// if ( !bCreate ) -// return sal_True; +// if ( !bCreate ) +// return sal_True; try { @@ -2956,4 +2954,3 @@ uno::Reference< container::XEnumeration > Content::getIterator() return xIter; } - diff --git a/ucb/source/ucp/package/pkgcontent.hxx b/ucb/source/ucp/package/pkgcontent.hxx index f542fb0b8222..f04e7ad54fd5 100644 --- a/ucb/source/ucp/package/pkgcontent.hxx +++ b/ucb/source/ucp/package/pkgcontent.hxx @@ -34,9 +34,7 @@ #include #include -#ifndef _COM_SUN_STAR_UCB_INTERACTIVEBADTRANSFRERURLEXCEPTION_HPP_ #include -#endif #include #include #include "pkguri.hxx" @@ -110,7 +108,7 @@ class Content : public ::ucbhelper::ContentImplHelper, public com::sun::star::ucb::XContentCreator { enum ContentState { TRANSIENT, // created via CreateNewContent, - // but did not process "insert" yet + // but did not process "insert" yet PERSISTENT, // processed "insert" DEAD // processed "delete" }; @@ -119,7 +117,7 @@ class Content : public ::ucbhelper::ContentImplHelper, ContentProperties m_aProps; ContentState m_eState; com::sun::star::uno::Reference< - com::sun::star::container::XHierarchicalNameAccess > m_xPackage; + com::sun::star::container::XHierarchicalNameAccess > m_xPackage; ContentProvider* m_pProvider; sal_uInt32 m_nModifiedProps; @@ -130,7 +128,7 @@ private: const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& Identifier, const ::com::sun::star::uno::Reference< - com::sun::star::container::XHierarchicalNameAccess >& Package, + com::sun::star::container::XHierarchicalNameAccess >& Package, const PackageUri& rUri, const ContentProperties& rProps ); Content( const com::sun::star::uno::Reference< @@ -139,7 +137,7 @@ private: const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& Identifier, const com::sun::star::uno::Reference< - com::sun::star::container::XHierarchicalNameAccess >& Package, + com::sun::star::container::XHierarchicalNameAccess >& Package, const PackageUri& rUri, const com::sun::star::ucb::ContentInfo& Info ); @@ -155,7 +153,7 @@ private: getPropertyValues( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rSMgr, const ::com::sun::star::uno::Sequence< - ::com::sun::star::beans::Property >& rProperties, + ::com::sun::star::beans::Property >& rProperties, const ContentProperties& rData, const rtl::Reference< ::ucbhelper::ContentProviderImplHelper >& rProvider, @@ -183,13 +181,13 @@ private: const PackageUri& rURI, ContentProperties& rProps, com::sun::star::uno::Reference< - com::sun::star::container::XHierarchicalNameAccess > & + com::sun::star::container::XHierarchicalNameAccess > & rxPackage ); static sal_Bool hasData( ContentProvider* pProvider, const PackageUri& rURI, com::sun::star::uno::Reference< - com::sun::star::container::XHierarchicalNameAccess > & + com::sun::star::container::XHierarchicalNameAccess > & rxPackage ); static ::rtl::OUString @@ -200,7 +198,7 @@ private: hasData( const PackageUri& rURI ); sal_Bool renameData( const com::sun::star::uno::Reference< - com::sun::star::ucb::XContentIdentifier >& xOldId, + com::sun::star::ucb::XContentIdentifier >& xOldId, const com::sun::star::uno::Reference< com::sun::star::ucb::XContentIdentifier >& xNewId ); sal_Bool @@ -223,7 +221,7 @@ private: ::com::sun::star::uno::Any open( const ::com::sun::star::ucb::OpenCommandArgument2& rArg, const ::com::sun::star::uno::Reference< - ::com::sun::star::ucb::XCommandEnvironment > & xEnv ) + ::com::sun::star::ucb::XCommandEnvironment > & xEnv ) throw( ::com::sun::star::uno::Exception ); void insert( const ::com::sun::star::uno::Reference< @@ -292,7 +290,7 @@ public: execute( const com::sun::star::ucb::Command& aCommand, sal_Int32 CommandId, const com::sun::star::uno::Reference< - com::sun::star::ucb::XCommandEnvironment >& Environment ) + com::sun::star::ucb::XCommandEnvironment >& Environment ) throw( com::sun::star::uno::Exception, com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::RuntimeException ); @@ -323,7 +321,7 @@ public: getPropertyValues( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& rSMgr, const ::com::sun::star::uno::Sequence< - ::com::sun::star::beans::Property >& rProperties, + ::com::sun::star::beans::Property >& rProperties, ContentProvider* pProvider, const ::rtl::OUString& rContentId ); -- cgit v1.2.3 From 22652581ffbb7b795f3ed5ee9dc4a85b24bac25f Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Mon, 21 Dec 2009 13:58:16 +0100 Subject: whitespace cleanup. --- ucb/source/ucp/tdoc/tdoc_content.cxx | 6 +++--- ucb/source/ucp/tdoc/tdoc_content.hxx | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ucb/source/ucp/tdoc/tdoc_content.cxx b/ucb/source/ucp/tdoc/tdoc_content.cxx index 908d7310889b..2f940e9715c9 100644 --- a/ucb/source/ucp/tdoc/tdoc_content.cxx +++ b/ucb/source/ucp/tdoc/tdoc_content.cxx @@ -1219,10 +1219,10 @@ uno::Sequence< uno::Any > Content::setPropertyValues( beans::PropertyChangeEvent aEvent; aEvent.Source = static_cast< cppu::OWeakObject * >( this ); aEvent.Further = sal_False; -// aEvent.PropertyName = + // aEvent.PropertyName = aEvent.PropertyHandle = -1; -// aEvent.OldValue = -// aEvent.NewValue = + // aEvent.OldValue = + // aEvent.NewValue = const beans::PropertyValue* pValues = rValues.getConstArray(); sal_Int32 nCount = rValues.getLength(); diff --git a/ucb/source/ucp/tdoc/tdoc_content.hxx b/ucb/source/ucp/tdoc/tdoc_content.hxx index c1ff14928496..c994d9911064 100644 --- a/ucb/source/ucp/tdoc/tdoc_content.hxx +++ b/ucb/source/ucp/tdoc/tdoc_content.hxx @@ -106,7 +106,7 @@ class Content : public ::ucbhelper::ContentImplHelper, public com::sun::star::ucb::XContentCreator { enum ContentState { TRANSIENT, // created via createNewContent, - // but did not process "insert" yet + // but did not process "insert" yet PERSISTENT, // processed "insert" DEAD // processed "delete" / document was closed }; @@ -173,7 +173,7 @@ private: ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow > getPropertyValues( const ::com::sun::star::uno::Sequence< - ::com::sun::star::beans::Property >& rProperties ); + ::com::sun::star::beans::Property >& rProperties ); ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > setPropertyValues( const ::com::sun::star::uno::Sequence< @@ -294,7 +294,7 @@ public: execute( const com::sun::star::ucb::Command& aCommand, sal_Int32 CommandId, const com::sun::star::uno::Reference< - com::sun::star::ucb::XCommandEnvironment >& Environment ) + com::sun::star::ucb::XCommandEnvironment >& Environment ) throw( com::sun::star::uno::Exception, com::sun::star::ucb::CommandAbortedException, com::sun::star::uno::RuntimeException ); -- cgit v1.2.3 From 7ad8a693a33398ddadcbb5a890fb2e6ce66ebf0b Mon Sep 17 00:00:00 2001 From: sj Date: Mon, 21 Dec 2009 14:06:42 +0100 Subject: impress181: #i100645# disabling slide transitions is now possible --- filter/source/pdf/impdialog.cxx | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx index 6c8bd9f23ae3..8806b0c26332 100644 --- a/filter/source/pdf/impdialog.cxx +++ b/filter/source/pdf/impdialog.cxx @@ -297,6 +297,14 @@ Sequence< PropertyValue > ImpPDFTabDialog::GetFilterData() // updating the FilterData sequence and storing FilterData to configuration if( GetTabPage( RID_PDF_TAB_GENER ) ) ( ( ImpPDFTabGeneralPage* )GetTabPage( RID_PDF_TAB_GENER ) )->GetFilterConfigItem( this ); + if( GetTabPage( RID_PDF_TAB_VPREFER ) ) + ( ( ImpPDFTabViewerPage* )GetTabPage( RID_PDF_TAB_VPREFER ) )->GetFilterConfigItem( this ); + if( GetTabPage( RID_PDF_TAB_OPNFTR ) ) + ( ( ImpPDFTabOpnFtrPage* )GetTabPage( RID_PDF_TAB_OPNFTR ) )->GetFilterConfigItem( this ); + if( GetTabPage( RID_PDF_TAB_LINKS ) ) + ( ( ImpPDFTabLinksPage* )GetTabPage( RID_PDF_TAB_LINKS ) )->GetFilterConfigItem( this ); + if( GetTabPage( RID_PDF_TAB_SECURITY ) ) + ( ( ImpPDFTabSecurityPage* )GetTabPage( RID_PDF_TAB_SECURITY ) )->GetFilterConfigItem( this ); //prepare the items to be returned maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "UseLosslessCompression" ) ), mbUseLosslessCompression ); @@ -323,12 +331,6 @@ Sequence< PropertyValue > ImpPDFTabDialog::GetFilterData() maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "FormsType" ) ), mnFormsType ); maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportFormFields" ) ), mbExportFormFields ); - if( GetTabPage( RID_PDF_TAB_VPREFER ) ) - ( ( ImpPDFTabViewerPage* )GetTabPage( RID_PDF_TAB_VPREFER ) )->GetFilterConfigItem( this ); - - if( GetTabPage( RID_PDF_TAB_OPNFTR ) ) - ( ( ImpPDFTabOpnFtrPage* )GetTabPage( RID_PDF_TAB_OPNFTR ) )->GetFilterConfigItem( this ); - maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "HideViewerToolbar" ) ), mbHideViewerToolbar ); maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "HideViewerMenubar" ) ), mbHideViewerMenubar ); maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "HideViewerWindowControls" ) ), mbHideViewerWindowControls ); @@ -344,17 +346,11 @@ Sequence< PropertyValue > ImpPDFTabDialog::GetFilterData() maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "FirstPageOnLeft" ) ), mbFirstPageLeft ); maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "OpenBookmarkLevels" ) ), mnOpenBookmarkLevels ); - if( GetTabPage( RID_PDF_TAB_LINKS ) ) - ( ( ImpPDFTabLinksPage* )GetTabPage( RID_PDF_TAB_LINKS ) )->GetFilterConfigItem( this ); - maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportLinksRelativeFsys" ) ), mbExportRelativeFsysLinks ); maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "PDFViewSelection" ) ), mnViewPDFMode ); maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ConvertOOoTargetToPDFTarget" ) ), mbConvertOOoTargets ); maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportBookmarksToPDFDestination" ) ), mbExportBmkToPDFDestination ); - if( GetTabPage( RID_PDF_TAB_SECURITY ) ) - ( ( ImpPDFTabSecurityPage* )GetTabPage( RID_PDF_TAB_SECURITY ) )->GetFilterConfigItem( this ); - maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Printing" ) ), mnPrint ); maConfigItem.WriteInt32( OUString( RTL_CONSTASCII_USTRINGPARAM( "Changes" ) ), mnChangesAllowed ); maConfigItem.WriteBool( OUString( RTL_CONSTASCII_USTRINGPARAM( "EnableCopyingOfContent" ) ), mbCanCopyOrExtract ); -- cgit v1.2.3 From b2b8880f39c7a5ba366e486506ed0df78f3bef94 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Mon, 21 Dec 2009 15:27:45 +0100 Subject: #i106820# - added OOo 3.3 since tags. --- odk/pack/copying/apiref-autodoc.since | 2 ++ 1 file changed, 2 insertions(+) diff --git a/odk/pack/copying/apiref-autodoc.since b/odk/pack/copying/apiref-autodoc.since index 576df44c7708..c374a1d23740 100644 --- a/odk/pack/copying/apiref-autodoc.since +++ b/odk/pack/copying/apiref-autodoc.since @@ -1,3 +1,5 @@ +"3.3.0" "OpenOffice 3.3.0" +"3.3" "OpenOffice 3.3" "3.2.0" "OpenOffice 3.2.0" "3.2" "OpenOffice 3.2" "3.1.0" "OpenOffice 3.1.0" -- cgit v1.2.3 From ee2ecbf89b002fa8f60316b4266b96dfca8b4591 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Mon, 21 Dec 2009 15:53:33 +0100 Subject: #i61429#, deprecated css.ucb.XContentCreator, implemented replacement. --- ucb/source/core/ucbcmds.cxx | 231 +++++++++++++--------- ucb/source/ucp/file/bc.cxx | 32 +-- ucb/source/ucp/file/filerror.hxx | 24 +-- ucb/source/ucp/file/filglob.cxx | 3 +- ucb/source/ucp/file/shell.cxx | 130 +++++++----- ucb/source/ucp/file/shell.hxx | 12 +- ucb/source/ucp/ftp/ftpcontent.cxx | 208 ++++++++++++------- ucb/source/ucp/ftp/ftpcontent.hxx | 18 +- ucb/source/ucp/ftp/ftpcontentcaps.cxx | 28 ++- ucb/source/ucp/ftp/ftpresultsetI.cxx | 6 +- ucb/source/ucp/ftp/ftpurl.cxx | 6 + ucb/source/ucp/gio/gio_content.cxx | 104 ++++++---- ucb/source/ucp/gio/gio_content.hxx | 6 + ucb/source/ucp/gio/gio_datasupplier.cxx | 2 +- ucb/source/ucp/gvfs/gvfs_content.cxx | 103 ++++++---- ucb/source/ucp/gvfs/gvfs_content.hxx | 7 + ucb/source/ucp/hierarchy/hierarchycontent.cxx | 185 +++++++++++------ ucb/source/ucp/hierarchy/hierarchycontent.hxx | 3 + ucb/source/ucp/hierarchy/hierarchycontentcaps.cxx | 107 +++++++--- ucb/source/ucp/package/pkgcontent.cxx | 165 +++++++++++----- ucb/source/ucp/package/pkgcontent.hxx | 10 +- ucb/source/ucp/package/pkgcontentcaps.cxx | 65 ++++-- ucb/source/ucp/tdoc/tdoc_content.cxx | 217 +++++++++++++------- ucb/source/ucp/tdoc/tdoc_content.hxx | 10 +- ucb/source/ucp/tdoc/tdoc_contentcaps.cxx | 83 ++++++-- ucb/source/ucp/webdav/webdavcontent.cxx | 71 ++++++- ucb/source/ucp/webdav/webdavcontentcaps.cxx | 34 +++- 27 files changed, 1266 insertions(+), 604 deletions(-) diff --git a/ucb/source/core/ucbcmds.cxx b/ucb/source/core/ucbcmds.cxx index 7caabc7f783d..d514ffcaa8bb 100644 --- a/ucb/source/core/ucbcmds.cxx +++ b/ucb/source/core/ucbcmds.cxx @@ -41,11 +41,10 @@ #include #include #include -#ifndef __COM_SUN_STAR_LANG_XINTERFACE_HPP_ #include -#endif #include #include +#include #include #include #include @@ -53,13 +52,12 @@ #include #include #include +#include #include #include #include #include -#ifndef _COM_SUN_STAR_UCB_INTERACTIVEBADTRANSFRERURLEXCEPTION_HPP_ #include -#endif #include #include #include @@ -79,7 +77,7 @@ using namespace com::sun::star; -namespace ucb_commands +namespace { //========================================================================= @@ -180,51 +178,6 @@ void SAL_CALL InteractionHandlerProxy::handle( m_xOrig->handle( Request ); } -//========================================================================= -// -// class CommandEnvironment. -// -//========================================================================= - -class CommandEnvironment : - public cppu::WeakImplHelper1< ucb::XCommandEnvironment > -{ - uno::Reference< task::XInteractionHandler > m_xIH; - uno::Reference< ucb::XProgressHandler > m_xPH; - -public: - CommandEnvironment( - const uno::Reference< task::XInteractionHandler > & xIH, - const uno::Reference< ucb::XProgressHandler > & xPH ) - : m_xIH( xIH ), m_xPH( xPH ) {} - - // XCommandEnvironment methods. - virtual uno::Reference< task::XInteractionHandler > SAL_CALL - getInteractionHandler() - throw ( uno::RuntimeException ); - virtual uno::Reference< ucb::XProgressHandler > SAL_CALL - getProgressHandler() - throw ( uno::RuntimeException ); -}; - -//========================================================================= -// virtual -uno::Reference< task::XInteractionHandler > SAL_CALL -CommandEnvironment::getInteractionHandler() - throw ( uno::RuntimeException ) -{ - return m_xIH; -} - -//========================================================================= -// virtual -uno::Reference< ucb::XProgressHandler > SAL_CALL -CommandEnvironment::getProgressHandler() - throw ( uno::RuntimeException ) -{ - return m_xPH; -} - //========================================================================= // // class ActiveDataSink. @@ -389,7 +342,7 @@ sal_Bool SAL_CALL CommandProcessorInfo::hasCommandByHandle( sal_Int32 Handle ) //========================================================================= //========================================================================= -static rtl::OUString createDesiredName( +rtl::OUString createDesiredName( const rtl::OUString & rSourceURL, const rtl::OUString & rNewTitle ) { rtl::OUString aName( rNewTitle ); @@ -438,13 +391,13 @@ static rtl::OUString createDesiredName( return rtl::OUString( aName ); } -static rtl::OUString createDesiredName( +rtl::OUString createDesiredName( const ucb::GlobalTransferCommandArgument & rArg ) { return createDesiredName( rArg.SourceURL, rArg.NewTitle ); } -static rtl::OUString createDesiredName( +rtl::OUString createDesiredName( const ucb::TransferInfo & rArg ) { return createDesiredName( rArg.SourceURL, rArg.NewTitle ); @@ -453,7 +406,7 @@ static rtl::OUString createDesiredName( //========================================================================= enum NameClashContinuation { NOT_HANDLED, ABORT, OVERWRITE, NEW_NAME, UNKNOWN }; -static NameClashContinuation interactiveNameClashResolve( +NameClashContinuation interactiveNameClashResolve( const uno::Reference< ucb::XCommandEnvironment > & xEnv, const rtl::OUString & rTargetURL, const rtl::OUString & rClashingName, @@ -528,7 +481,7 @@ static NameClashContinuation interactiveNameClashResolve( } //========================================================================= -static bool setTitle( +bool setTitle( const uno::Reference< ucb::XCommandProcessor > & xCommandProcessor, const uno::Reference< ucb::XCommandEnvironment > & xEnv, const rtl::OUString & rNewTitle ) @@ -576,7 +529,7 @@ static bool setTitle( } //========================================================================= -static uno::Reference< ucb::XContent > createNew( +uno::Reference< ucb::XContent > createNew( const TransferCommandContext & rContext, const uno::Reference< ucb::XContent > & xTarget, sal_Bool bSourceIsFolder, @@ -590,10 +543,12 @@ static uno::Reference< ucb::XContent > createNew( // ////////////////////////////////////////////////////////////////////// - uno::Reference< ucb::XContentCreator > xCreator( - xTarget, uno::UNO_QUERY ); + // First, try it using "CreatabeleContentsInfo" property and + // "createNewContent" command -> the "new" way. - if ( !xCreator.is() ) + uno::Reference< ucb::XCommandProcessor > xCommandProcessorT( + xTarget, uno::UNO_QUERY ); + if ( !xCommandProcessorT.is() ) { uno::Any aProps = uno::makeAny(beans::PropertyValue( @@ -606,24 +561,77 @@ static uno::Reference< ucb::XContent > createNew( ucb::IOErrorCode_CANT_CREATE, uno::Sequence< uno::Any >(&aProps, 1), rContext.xOrigEnv, - rtl::OUString::createFromAscii( "Target is no XContentCreator!" ), + rtl::OUString::createFromAscii( "Target is no XCommandProcessor!" ), rContext.xProcessor ); // Unreachable } - uno::Sequence< ucb::ContentInfo > aTypesInfo - = xCreator->queryCreatableContentsInfo(); + uno::Sequence< beans::Property > aPropsToObtain( 1 ); + aPropsToObtain[ 0 ].Name + = rtl::OUString::createFromAscii( "CreatableContentsInfo" ); + aPropsToObtain[ 0 ].Handle + = -1; - sal_Int32 nCount = aTypesInfo.getLength(); - if ( !nCount ) + ucb::Command aGetPropsCommand( + rtl::OUString::createFromAscii( "getPropertyValues" ), + -1, + uno::makeAny( aPropsToObtain ) ); + + uno::Reference< sdbc::XRow > xRow; + xCommandProcessorT->execute( aGetPropsCommand, 0, rContext.xEnv ) >>= xRow; + + uno::Sequence< ucb::ContentInfo > aTypesInfo; + bool bGotTypesInfo = false; + + if ( xRow.is() ) { - uno::Any aProps - = uno::makeAny(beans::PropertyValue( + uno::Any aValue = xRow->getObject( + 1, uno::Reference< container::XNameAccess >() ); + if ( aValue.hasValue() && ( aValue >>= aTypesInfo ) ) + { + bGotTypesInfo = true; + } + } + + uno::Reference< ucb::XContentCreator > xCreator; + + if ( !bGotTypesInfo ) + { + // Second, try it using XContentCreator interface -> the "old" way (not + // providing the chance to supply an XCommandEnvironment. + + xCreator.set( xTarget, uno::UNO_QUERY ); + + if ( !xCreator.is() ) + { + uno::Any aProps + = uno::makeAny(beans::PropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "Folder")), -1, uno::makeAny(rContext.aArg.TargetURL), beans::PropertyState_DIRECT_VALUE)); + ucbhelper::cancelCommandExecution( + ucb::IOErrorCode_CANT_CREATE, + uno::Sequence< uno::Any >(&aProps, 1), + rContext.xOrigEnv, + rtl::OUString::createFromAscii( "Target is no XContentCreator!" ), + rContext.xProcessor ); + // Unreachable + } + + aTypesInfo = xCreator->queryCreatableContentsInfo(); + } + + sal_Int32 nCount = aTypesInfo.getLength(); + if ( !nCount ) + { + uno::Any aProps + = uno::makeAny(beans::PropertyValue( + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Folder")), + -1, + uno::makeAny(rContext.aArg.TargetURL), + beans::PropertyState_DIRECT_VALUE)); ucbhelper::cancelCommandExecution( ucb::IOErrorCode_CANT_CREATE, uno::Sequence< uno::Any >(&aProps, 1), @@ -680,7 +688,7 @@ static uno::Reference< ucb::XContent > createNew( !!( nAttribs & ucb::ContentInfoAttribute::KIND_FOLDER ) ) && - ( !!bSourceIsDocument == + ( !!bSourceIsDocument == !!( nAttribs & ucb::ContentInfoAttribute::KIND_DOCUMENT ) ) ) @@ -710,7 +718,25 @@ static uno::Reference< ucb::XContent > createNew( // ////////////////////////////////////////////////////////////// - xNew = xCreator->createNewContent( aTypesInfo[ n ] ); + if ( !xCreator.is() ) + { + // First, try it using "CreatabeleContentsInfo" property and + // "createNewContent" command -> the "new" way. + ucb::Command aCreateNewCommand( + rtl::OUString::createFromAscii( "createNewContent" ), + -1, + uno::makeAny( aTypesInfo[ n ] ) ); + + xCommandProcessorT->execute( aCreateNewCommand, 0, rContext.xEnv ) + >>= xNew; + } + else + { + // Second, try it using XContentCreator interface -> the "old" + // way (not providing the chance to supply an XCommandEnvironment. + + xNew = xCreator->createNewContent( aTypesInfo[ n ] ); + } if ( !xNew.is() ) { @@ -739,7 +765,7 @@ static uno::Reference< ucb::XContent > createNew( } //========================================================================= -static void transferProperties( +void transferProperties( const TransferCommandContext & rContext, const uno::Reference< ucb::XCommandProcessor > & xCommandProcessorS, const uno::Reference< ucb::XCommandProcessor > & xCommandProcessorN ) @@ -904,7 +930,7 @@ static void transferProperties( } //========================================================================= -static uno::Reference< io::XInputStream > getInputStream( +uno::Reference< io::XInputStream > getInputStream( const TransferCommandContext & rContext, const uno::Reference< ucb::XCommandProcessor > & xCommandProcessorS ) throw( uno::Exception ) @@ -992,7 +1018,7 @@ static uno::Reference< io::XInputStream > getInputStream( } //========================================================================= -static uno::Reference< sdbc::XResultSet > getResultSet( +uno::Reference< sdbc::XResultSet > getResultSet( const TransferCommandContext & rContext, const uno::Reference< ucb::XCommandProcessor > & xCommandProcessorS ) throw( uno::Exception ) @@ -1038,7 +1064,7 @@ static uno::Reference< sdbc::XResultSet > getResultSet( } //========================================================================= -static void handleNameClashRename( +void handleNameClashRename( const TransferCommandContext & rContext, const uno::Reference< ucb::XContent > & xNew, const uno::Reference< @@ -1217,7 +1243,7 @@ static void handleNameClashRename( } //========================================================================= -static void globalTransfer( +void globalTransfer_( const TransferCommandContext & rContext, const uno::Reference< ucb::XContent > & xSource, const uno::Reference< ucb::XContent > & xTarget, @@ -1632,7 +1658,7 @@ static void globalTransfer( rtl::OUString(), // NewTitle; rContext.aArg.NameClash ); // NameClash - ucb_commands::TransferCommandContext aSubCtx( + TransferCommandContext aSubCtx( rContext.xSMgr, rContext.xProcessor, rContext.xEnv, @@ -1649,10 +1675,10 @@ static void globalTransfer( aSubCtx.aArg.SourceURL = xChild->getIdentifier()->getContentIdentifier(); - ucb_commands::globalTransfer( aSubCtx, - xChild, - xNew, - xChildRow ); + globalTransfer_( aSubCtx, + xChild, + xNew, + xChildRow ); } } while ( xResultSet->next() ); @@ -1695,7 +1721,7 @@ static void globalTransfer( } } -} /* namescpace ucb_commands */ +} /* namescpace */ //========================================================================= // @@ -1706,8 +1732,7 @@ static void globalTransfer( uno::Reference< ucb::XCommandInfo > UniversalContentBroker::getCommandInfo() { - return uno::Reference< ucb::XCommandInfo >( - new ucb_commands::CommandProcessorInfo() ); + return uno::Reference< ucb::XCommandInfo >( new CommandProcessorInfo() ); } //========================================================================= @@ -1717,14 +1742,24 @@ void UniversalContentBroker::globalTransfer( throw( uno::Exception ) { // Use own command environment with own interaction handler intercepting - // some interaction requests that shell not be handled by the user-supplied + // some interaction requests that shall not be handled by the user-supplied // interaction handler. uno::Reference< ucb::XCommandEnvironment > xLocalEnv; if (xEnv.is()) - xLocalEnv.set( new ucb_commands::CommandEnvironment( - new ucb_commands::InteractionHandlerProxy( - xEnv->getInteractionHandler() ), - xEnv->getProgressHandler() ) ); + { + uno::Reference< beans::XPropertySet > const xProps( + m_xSMgr, uno::UNO_QUERY_THROW ); + uno::Reference< uno::XComponentContext > xCtx; + xCtx.set( xProps->getPropertyValue( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) ) ), + uno::UNO_QUERY_THROW ); + + xLocalEnv.set( ucb::CommandEnvironment::create( + xCtx, + new InteractionHandlerProxy( xEnv->getInteractionHandler() ), + xEnv->getProgressHandler() ) ); + } ////////////////////////////////////////////////////////////////////// // @@ -1862,27 +1897,27 @@ void UniversalContentBroker::globalTransfer( uno::Any aExc; rtl::OUString aNewTitle; - ucb_commands::NameClashContinuation eCont - = ucb_commands::interactiveNameClashResolve( + NameClashContinuation eCont + = interactiveNameClashResolve( xEnv, // always use original environment! rArg.TargetURL, // target folder URL - ucb_commands::createDesiredName( - aTransferArg ), // clashing name + createDesiredName( + aTransferArg ), // clashing name aExc, aNewTitle ); switch ( eCont ) { - case ucb_commands::NOT_HANDLED: + case NOT_HANDLED: // Not handled. cppu::throwException( aExc ); // break; - case ucb_commands::UNKNOWN: + case UNKNOWN: // Handled, but not clear, how... // fall-thru intended. - case ucb_commands::ABORT: + case ABORT: throw ucb::CommandFailedException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( @@ -1892,13 +1927,13 @@ void UniversalContentBroker::globalTransfer( aExc ); // break; - case ucb_commands::OVERWRITE: + case OVERWRITE: aTransferArg.NameClash = ucb::NameClash::OVERWRITE; bRetry = true; break; - case ucb_commands::NEW_NAME: + case NEW_NAME: aTransferArg.NewTitle = aNewTitle; bRetry = true; break; @@ -2015,7 +2050,7 @@ void UniversalContentBroker::globalTransfer( // Unreachable } - ucb_commands::TransferCommandContext aTransferCtx( + TransferCommandContext aTransferCtx( m_xSMgr, this, xLocalEnv, xEnv, rArg ); if ( rArg.NewTitle.getLength() == 0 ) @@ -2025,12 +2060,12 @@ void UniversalContentBroker::globalTransfer( if ( aBaseURI.getLength() ) { aTransferCtx.aArg.NewTitle - = ucb_commands::createDesiredName( aBaseURI, rtl::OUString() ); + = createDesiredName( aBaseURI, rtl::OUString() ); } } // Do it! - ucb_commands::globalTransfer( aTransferCtx, xSource, xTarget, xRow ); + globalTransfer_( aTransferCtx, xSource, xTarget, xRow ); ////////////////////////////////////////////////////////////////////// // diff --git a/ucb/source/ucp/file/bc.cxx b/ucb/source/ucp/file/bc.cxx index d8f3d4afb461..222196637669 100644 --- a/ucb/source/ucp/file/bc.cxx +++ b/ucb/source/ucp/file/bc.cxx @@ -49,7 +49,6 @@ #include #include #include -#include #include "filglob.hxx" #include "filid.hxx" #include "filrow.hxx" @@ -437,6 +436,15 @@ BaseContent::execute( const Command& aCommand, if(!xRow->wasNull()) aAny <<= CasePreservingURL; } + else if( ! aCommand.Name.compareToAscii( "createNewContent" ) ) + { + ucb::ContentInfo aArg; + if ( !( aCommand.Argument >>= aArg ) ) + m_pMyShell->installError( CommandId, + TASKHANDLING_WRONG_CREATENEWCONTENT_ARGUMENT ); + else + aAny <<= createNewContent( aArg ); + } else m_pMyShell->installError( CommandId, TASKHANDLER_UNSUPPORTED_COMMAND ); @@ -637,27 +645,7 @@ BaseContent::queryCreatableContentsInfo( void ) throw( RuntimeException ) { - Sequence< ContentInfo > seq(2); - - // file - seq[0].Type = m_pMyShell->FileContentType; - seq[0].Attributes = ContentInfoAttribute::INSERT_WITH_INPUTSTREAM - | ContentInfoAttribute::KIND_DOCUMENT; - - Sequence< beans::Property > props( 1 ); - props[0] = beans::Property( - rtl::OUString::createFromAscii( "Title" ), - -1, - getCppuType( static_cast< rtl::OUString* >( 0 ) ), - beans::PropertyAttribute::MAYBEVOID - | beans::PropertyAttribute::BOUND ); - seq[0].Properties = props; - - // folder - seq[1].Type = m_pMyShell->FolderContentType; - seq[1].Attributes = ContentInfoAttribute::KIND_FOLDER; - seq[1].Properties = props; - return seq; + return m_pMyShell->queryCreatableContentsInfo(); } diff --git a/ucb/source/ucp/file/filerror.hxx b/ucb/source/ucp/file/filerror.hxx index 0ae47da5629d..e773e5a5064f 100644 --- a/ucb/source/ucp/file/filerror.hxx +++ b/ucb/source/ucp/file/filerror.hxx @@ -42,21 +42,21 @@ namespace fileaccess { #define TASKHANDLING_WRONG_DELETE_ARGUMENT 5 #define TASKHANDLING_WRONG_TRANSFER_ARGUMENT 6 #define TASKHANDLING_WRONG_INSERT_ARGUMENT 7 +#define TASKHANDLING_WRONG_CREATENEWCONTENT_ARGUMENT 8 +#define TASKHANDLING_UNSUPPORTED_OPEN_MODE 9 -#define TASKHANDLING_UNSUPPORTED_OPEN_MODE 8 +#define TASKHANDLING_DELETED_STATE_IN_OPEN_COMMAND 10 +#define TASKHANDLING_INSERTED_STATE_IN_OPEN_COMMAND 11 -#define TASKHANDLING_DELETED_STATE_IN_OPEN_COMMAND 9 -#define TASKHANDLING_INSERTED_STATE_IN_OPEN_COMMAND 10 +#define TASKHANDLING_OPEN_FILE_FOR_PAGING 12 +#define TASKHANDLING_NOTCONNECTED_FOR_PAGING 13 +#define TASKHANDLING_BUFFERSIZEEXCEEDED_FOR_PAGING 14 +#define TASKHANDLING_IOEXCEPTION_FOR_PAGING 15 +#define TASKHANDLING_READING_FILE_FOR_PAGING 16 -#define TASKHANDLING_OPEN_FILE_FOR_PAGING 11 -#define TASKHANDLING_NOTCONNECTED_FOR_PAGING 12 -#define TASKHANDLING_BUFFERSIZEEXCEEDED_FOR_PAGING 13 -#define TASKHANDLING_IOEXCEPTION_FOR_PAGING 14 -#define TASKHANDLING_READING_FILE_FOR_PAGING 15 - -#define TASKHANDLING_OPEN_FOR_INPUTSTREAM 16 -#define TASKHANDLING_OPEN_FOR_STREAM 17 -#define TASKHANDLING_OPEN_FOR_DIRECTORYLISTING 18 +#define TASKHANDLING_OPEN_FOR_INPUTSTREAM 17 +#define TASKHANDLING_OPEN_FOR_STREAM 18 +#define TASKHANDLING_OPEN_FOR_DIRECTORYLISTING 19 #define TASKHANDLING_NOFRESHINSERT_IN_INSERT_COMMAND 22 #define TASKHANDLING_NONAMESET_INSERT_COMMAND 23 diff --git a/ucb/source/ucp/file/filglob.cxx b/ucb/source/ucp/file/filglob.cxx index 6cc103ea7f08..ccc0342b8436 100644 --- a/ucb/source/ucp/file/filglob.cxx +++ b/ucb/source/ucp/file/filglob.cxx @@ -286,7 +286,8 @@ namespace fileaccess { errorCode == TASKHANDLING_WRONG_OPEN_ARGUMENT || errorCode == TASKHANDLING_WRONG_DELETE_ARGUMENT || errorCode == TASKHANDLING_WRONG_TRANSFER_ARGUMENT || - errorCode == TASKHANDLING_WRONG_INSERT_ARGUMENT ) + errorCode == TASKHANDLING_WRONG_INSERT_ARGUMENT || + errorCode == TASKHANDLING_WRONG_CREATENEWCONTENT_ARGUMENT ) { IllegalArgumentException excep; excep.ArgumentPosition = 0; diff --git a/ucb/source/ucp/file/shell.cxx b/ucb/source/ucp/file/shell.cxx index 524d6541844f..487fb75bf652 100644 --- a/ucb/source/ucp/file/shell.cxx +++ b/ucb/source/ucp/file/shell.cxx @@ -46,23 +46,18 @@ #include #include #include -#ifndef _COM_SUN_STAR_UCB_XCONTENTACCESS_ #include -#endif -#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBBUTE_HPP_ #include -#endif #include #include #include #include #include +#include #include #include #include -#ifndef _FILERROR_HXX_ #include "filerror.hxx" -#endif #include "filglob.hxx" #include "filcmd.hxx" #include "filinpstr.hxx" @@ -188,9 +183,10 @@ shell::shell( const uno::Reference< lang::XMultiServiceFactory >& xMultiServiceF IsHidden( rtl::OUString::createFromAscii( "IsHidden" ) ), ContentType( rtl::OUString::createFromAscii( "ContentType" ) ), IsReadOnly( rtl::OUString::createFromAscii( "IsReadOnly" ) ), + CreatableContentsInfo( rtl::OUString::createFromAscii( "CreatableContentsInfo" ) ), FolderContentType( rtl::OUString::createFromAscii( "application/vnd.sun.staroffice.fsys-folder" ) ), FileContentType( rtl::OUString::createFromAscii( "application/vnd.sun.staroffice.fsys-file" ) ), - m_sCommandInfo( 8 ) + m_sCommandInfo( 9 ) { // Title m_aDefaultProperties.insert( MyProperty( true, @@ -294,7 +290,7 @@ shell::shell( const uno::Reference< lang::XMultiServiceFactory >& xMultiServiceF | beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ) ); - // Remote + // Hidden m_aDefaultProperties.insert( MyProperty( true, @@ -357,6 +353,17 @@ shell::shell( const uno::Reference< lang::XMultiServiceFactory >& xMultiServiceF | beans::PropertyAttribute::BOUND ) ); + // CreatableContentsInfo + m_aDefaultProperties.insert( MyProperty( true, + CreatableContentsInfo, + -1 , + getCppuType( static_cast< const uno::Sequence< ucb::ContentInfo > * >( 0 ) ), + uno::Any(), + beans::PropertyState_DEFAULT_VALUE, + beans::PropertyAttribute::MAYBEVOID + | beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::READONLY ) ); + // Commands m_sCommandInfo[0].Name = rtl::OUString::createFromAscii( "getCommandInfo" ); m_sCommandInfo[0].Handle = -1; @@ -390,6 +397,9 @@ shell::shell( const uno::Reference< lang::XMultiServiceFactory >& xMultiServiceF m_sCommandInfo[7].Handle = -1; m_sCommandInfo[7].ArgType = getCppuType( static_cast< InsertCommandArgument* > ( 0 ) ); + m_sCommandInfo[7].Name = rtl::OUString::createFromAscii( "createNewContent" ); + m_sCommandInfo[7].Handle = -1; + m_sCommandInfo[7].ArgType = getCppuType( static_cast< ucb::ContentInfo * > ( 0 ) ); if(m_bWithConfig) { @@ -2296,9 +2306,9 @@ shell::commit( const shell::ContentMap::iterator& it, sal_Bool isDirectory,isFile,isVolume,isRemoveable,isRemote,isFloppy,isCompactDisc; - sal_Int64 dirSize = 0; - - if( aFileStatus.isValid( FileStatusMask_FileSize ) ) + sal_Int64 dirSize = 0; + + if( aFileStatus.isValid( FileStatusMask_FileSize ) ) dirSize = aFileStatus.getFileSize(); if( aFileStatus.isValid( FileStatusMask_Type ) ) @@ -2319,7 +2329,7 @@ shell::commit( const shell::ContentMap::iterator& it, isFile = osl::FileStatus::Regular == aFileStatus2.getFileType(); - if( aFileStatus2.isValid( FileStatusMask_FileSize ) ) + if( aFileStatus2.isValid( FileStatusMask_FileSize ) ) dirSize = aFileStatus2.getFileSize(); } else @@ -2345,17 +2355,17 @@ shell::commit( const shell::ContentMap::iterator& it, osl::FileStatus::Regular == aFileStatus.getFileType(); } - aAny <<= isVolume; it1 = properties.find( MyProperty( IsVolume ) ); - if( it1 != properties.end() ) it1->setValue( aAny ); + if( it1 != properties.end() ) + it1->setValue( uno::makeAny( isVolume ) ); - aAny <<= isDirectory; it1 = properties.find( MyProperty( IsFolder ) ); - if( it1 != properties.end() ) it1->setValue( aAny ); + if( it1 != properties.end() ) + it1->setValue( uno::makeAny( isDirectory ) ); - aAny <<= isFile; it1 = properties.find( MyProperty( IsDocument ) ); - if( it1 != properties.end() ) it1->setValue( aAny ); + if( it1 != properties.end() ) + it1->setValue( uno::makeAny( isFile ) ); osl::VolumeInfo aVolumeInfo( VolumeInfoMask_Attributes ); if( isVolume && @@ -2368,44 +2378,47 @@ shell::commit( const shell::ContentMap::iterator& it, isCompactDisc = aVolumeInfo.getCompactDiscFlag(); isFloppy = aVolumeInfo.getFloppyDiskFlag(); - aAny <<= isRemote; it1 = properties.find( MyProperty( IsRemote ) ); - if( it1 != properties.end() ) it1->setValue( aAny ); + if( it1 != properties.end() ) + it1->setValue( uno::makeAny( isRemote ) ); - aAny <<= isRemoveable; it1 = properties.find( MyProperty( IsRemoveable ) ); - if( it1 != properties.end() ) it1->setValue( aAny ); + if( it1 != properties.end() ) + it1->setValue( uno::makeAny( isRemoveable ) ); - aAny <<= isCompactDisc; it1 = properties.find( MyProperty( IsCompactDisc ) ); - if( it1 != properties.end() ) it1->setValue( aAny ); + if( it1 != properties.end() ) + it1->setValue( uno::makeAny( isCompactDisc ) ); - aAny <<= isFloppy; it1 = properties.find( MyProperty( IsFloppy ) ); - if( it1 != properties.end() ) it1->setValue( aAny ); + if( it1 != properties.end() ) + it1->setValue( uno::makeAny( isFloppy ) ); } else { sal_Bool dummy = false; aAny <<= dummy; it1 = properties.find( MyProperty( IsRemote ) ); - if( it1 != properties.end() ) it1->setValue( aAny ); + if( it1 != properties.end() ) + it1->setValue( aAny ); + it1 = properties.find( MyProperty( IsRemoveable ) ); - if( it1 != properties.end() ) it1->setValue( aAny ); + if( it1 != properties.end() ) + it1->setValue( aAny ); + it1 = properties.find( MyProperty( IsCompactDisc ) ); - if( it1 != properties.end() ) it1->setValue( aAny ); + if( it1 != properties.end() ) + it1->setValue( aAny ); + it1 = properties.find( MyProperty( IsFloppy ) ); - if( it1 != properties.end() ) it1->setValue( aAny ); + if( it1 != properties.end() ) + it1->setValue( aAny ); } } it1 = properties.find( MyProperty( Size ) ); if( it1 != properties.end() ) - { - aAny <<= dirSize; - it1->setValue( aAny ); - } - + it1->setValue( uno::makeAny( dirSize ) ); it1 = properties.find( MyProperty( IsReadOnly ) ); if( it1 != properties.end() ) @@ -2414,8 +2427,7 @@ shell::commit( const shell::ContentMap::iterator& it, { sal_uInt64 Attr = aFileStatus.getAttributes(); sal_Bool readonly = ( Attr & Attribute_ReadOnly ) != 0; - aAny <<= readonly; - it1->setValue( aAny ); + it1->setValue( uno::makeAny( readonly ) ); } } @@ -2426,13 +2438,11 @@ shell::commit( const shell::ContentMap::iterator& it, { sal_uInt64 Attr = aFileStatus.getAttributes(); sal_Bool ishidden = ( Attr & Attribute_Hidden ) != 0; - aAny <<= ishidden; - it1->setValue( aAny ); + it1->setValue( uno::makeAny( ishidden ) ); } } it1 = properties.find( MyProperty( DateModified ) ); - if( it1 != properties.end() ) { if( aFileStatus.isValid( FileStatusMask_ModifyTime ) ) @@ -2440,7 +2450,7 @@ shell::commit( const shell::ContentMap::iterator& it, TimeValue temp = aFileStatus.getModifyTime(); // Convert system time to local time (for EA) - TimeValue myLocalTime; + TimeValue myLocalTime; osl_getLocalTimeFromSystemTime( &temp, &myLocalTime ); oslDateTime myDateTime; @@ -2454,11 +2464,16 @@ shell::commit( const shell::ContentMap::iterator& it, aDateTime.Day = myDateTime.Day; aDateTime.Month = myDateTime.Month; aDateTime.Year = myDateTime.Year; - aAny <<= aDateTime; - it1->setValue( aAny ); + it1->setValue( uno::makeAny( aDateTime ) ); } } + it1 = properties.find( MyProperty( CreatableContentsInfo ) ); + if( it1 != properties.end() ) + it1->setValue( uno::makeAny( + isDirectory || !aFileStatus.isValid( FileStatusMask_Type ) + ? queryCreatableContentsInfo() + : uno::Sequence< ucb::ContentInfo >() ) ); } @@ -2493,8 +2508,8 @@ shell::getv( { // Assume failure aIsRegular = false; - osl::FileBase::RC result = osl::FileBase::E_INVAL; - osl::DirectoryItem aTargetItem; + osl::FileBase::RC result = osl::FileBase::E_INVAL; + osl::DirectoryItem aTargetItem; osl::DirectoryItem::get( aFileStatus.getLinkTargetURL(), aTargetItem ); if ( aTargetItem.is() ) { @@ -2999,6 +3014,31 @@ shell::copyPersistentSet( const rtl::OUString& srcUnqPath, } // end for( sal_Int... } +uno::Sequence< ucb::ContentInfo > shell::queryCreatableContentsInfo() +{ + uno::Sequence< ucb::ContentInfo > seq(2); + + // file + seq[0].Type = FileContentType; + seq[0].Attributes = ucb::ContentInfoAttribute::INSERT_WITH_INPUTSTREAM + | ucb::ContentInfoAttribute::KIND_DOCUMENT; + + uno::Sequence< beans::Property > props( 1 ); + props[0] = beans::Property( + rtl::OUString::createFromAscii( "Title" ), + -1, + getCppuType( static_cast< rtl::OUString* >( 0 ) ), + beans::PropertyAttribute::MAYBEVOID + | beans::PropertyAttribute::BOUND ); + seq[0].Properties = props; + + // folder + seq[1].Type = FolderContentType; + seq[1].Attributes = ucb::ContentInfoAttribute::KIND_FOLDER; + seq[1].Properties = props; + return seq; +} + /*******************************************************************************/ /* */ /* some misceancellous static functions */ diff --git a/ucb/source/ucp/file/shell.hxx b/ucb/source/ucp/file/shell.hxx index 811cdce531b0..80ffd38f55aa 100644 --- a/ucb/source/ucp/file/shell.hxx +++ b/ucb/source/ucp/file/shell.hxx @@ -54,21 +54,18 @@ #include #include #include -#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSETINFO_HPP_protected #include -#endif #include #include #include #include #include -#ifndef _COM_SUN_STAR_UCB_XDYNAMICRESULTSET_HPP__ #include -#endif #include #include #include #include +#include #include "filtask.hxx" #include "filnot.hxx" @@ -307,7 +304,7 @@ namespace fileaccess { /********************************************************************************/ - /* transfer-commandos */ + /* transfer-commands */ /********************************************************************************/ /** @@ -398,6 +395,9 @@ namespace fileaccess { void SAL_CALL insertDefaultProperties( const rtl::OUString& aUnqPath ); + com::sun::star::uno::Sequence< com::sun::star::ucb::ContentInfo > + queryCreatableContentsInfo(); + /******************************************************************************/ /* */ @@ -416,7 +416,6 @@ namespace fileaccess { com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xMultiServiceFactory; com::sun::star::uno::Reference< com::sun::star::ucb::XPropertySetRegistry > m_xFileRegistry; - private: /********************************************************************************/ @@ -580,6 +579,7 @@ namespace fileaccess { const rtl::OUString IsHidden; const rtl::OUString ContentType; const rtl::OUString IsReadOnly; + const rtl::OUString CreatableContentsInfo; public: diff --git a/ucb/source/ucp/ftp/ftpcontent.cxx b/ucb/source/ucp/ftp/ftpcontent.cxx index 63189c642e36..73300c16844b 100644 --- a/ucb/source/ucp/ftp/ftpcontent.cxx +++ b/ucb/source/ucp/ftp/ftpcontent.cxx @@ -218,7 +218,7 @@ void SAL_CALL FTPContent::abort( sal_Int32 /*CommandId*/ ) /***************************************************************************/ /* */ -/* Interne Implklasse */ +/* Internal implementation class. */ /* */ /***************************************************************************/ @@ -363,66 +363,85 @@ Any SAL_CALL FTPContent::execute( // return aRet; // } - if(action == THROWAUTHENTICATIONREQUEST) { + switch (action) + { + case NOACTION: + break; + + case THROWAUTHENTICATIONREQUEST: ucbhelper::cancelCommandExecution( aRet, Reference(0)); - } else if(action == THROWACCESSDENIED) { - Sequence seq(1); - PropertyValue value; - value.Name = - rtl::OUString::createFromAscii("Uri"); - value.Handle = -1; - value.Value <<= m_aFTPURL.ident(false,false); - value.State = PropertyState_DIRECT_VALUE; - seq[0] <<= value; - ucbhelper::cancelCommandExecution( - IOErrorCode_ACCESS_DENIED, - seq, - Environment); - } else if(action == THROWINTERACTIVECONNECT) { - InteractiveNetworkConnectException - excep; - excep.Server = m_aFTPURL.host(); - aRet <<= excep; - ucbhelper::cancelCommandExecution( - aRet, - Environment); - } else if(action == THROWRESOLVENAME) { - InteractiveNetworkResolveNameException - excep; - excep.Server = m_aFTPURL.host(); - aRet <<= excep; - ucbhelper::cancelCommandExecution( - aRet, - Environment); - } else if(action == THROWNOFILE) { - Sequence seq(1); - PropertyValue value; - value.Name = - rtl::OUString::createFromAscii("Uri"); - value.Handle = -1; - value.Value <<= m_aFTPURL.ident(false,false); - value.State = PropertyState_DIRECT_VALUE; - seq[0] <<= value; - ucbhelper::cancelCommandExecution( - IOErrorCode_NO_FILE, - seq, - Environment); - } else if(action == THROWQUOTE || - action == THROWGENERAL) { + break; + + case THROWACCESSDENIED: + { + Sequence seq(1); + PropertyValue value; + value.Name = rtl::OUString::createFromAscii("Uri"); + value.Handle = -1; + value.Value <<= m_aFTPURL.ident(false,false); + value.State = PropertyState_DIRECT_VALUE; + seq[0] <<= value; + ucbhelper::cancelCommandExecution( + IOErrorCode_ACCESS_DENIED, + seq, + Environment); + break; + } + case THROWINTERACTIVECONNECT: + { + InteractiveNetworkConnectException excep; + excep.Server = m_aFTPURL.host(); + aRet <<= excep; + ucbhelper::cancelCommandExecution( + aRet, + Environment); + break; + } + case THROWRESOLVENAME: + { + InteractiveNetworkResolveNameException excep; + excep.Server = m_aFTPURL.host(); + aRet <<= excep; + ucbhelper::cancelCommandExecution( + aRet, + Environment); + break; + } + case THROWNOFILE: + { + Sequence seq(1); + PropertyValue value; + value.Name = rtl::OUString::createFromAscii("Uri"); + value.Handle = -1; + value.Value <<= m_aFTPURL.ident(false,false); + value.State = PropertyState_DIRECT_VALUE; + seq[0] <<= value; + ucbhelper::cancelCommandExecution( + IOErrorCode_NO_FILE, + seq, + Environment); + break; + } + case THROWQUOTE: + case THROWGENERAL: ucbhelper::cancelCommandExecution( IOErrorCode_GENERAL, Sequence(0), Environment); + break; } - if(aCommand.Name.compareToAscii("getPropertyValues") == 0) { Sequence Properties; if(!(aCommand.Argument >>= Properties)) { - aRet <<= IllegalArgumentException(); + aRet <<= IllegalArgumentException( + rtl::OUString::createFromAscii( + "Wrong argument type!" ), + static_cast< cppu::OWeakObject * >(this), + -1); ucbhelper::cancelCommandExecution(aRet,Environment); } @@ -433,7 +452,11 @@ Any SAL_CALL FTPContent::execute( Sequence propertyValues; if( ! ( aCommand.Argument >>= propertyValues ) ) { - aRet <<= IllegalArgumentException(); + aRet <<= IllegalArgumentException( + rtl::OUString::createFromAscii( + "Wrong argument type!" ), + static_cast< cppu::OWeakObject * >(this), + -1); ucbhelper::cancelCommandExecution(aRet,Environment); } @@ -451,7 +474,11 @@ Any SAL_CALL FTPContent::execute( { InsertCommandArgument aInsertArgument; if ( ! ( aCommand.Argument >>= aInsertArgument ) ) { - aRet <<= IllegalArgumentException(); + aRet <<= IllegalArgumentException( + rtl::OUString::createFromAscii( + "Wrong argument type!" ), + static_cast< cppu::OWeakObject * >(this), + -1); ucbhelper::cancelCommandExecution(aRet,Environment); } insert(aInsertArgument,Environment); @@ -463,7 +490,12 @@ Any SAL_CALL FTPContent::execute( else if(aCommand.Name.compareToAscii( "open" ) == 0) { OpenCommandArgument2 aOpenCommand; if ( !( aCommand.Argument >>= aOpenCommand ) ) { - aRet <<= IllegalArgumentException(); + aRet <<= IllegalArgumentException( + rtl::OUString::createFromAscii( + "Wrong argument type!" ), + static_cast< cppu::OWeakObject * >(this), + -1); + ucbhelper::cancelCommandExecution(aRet,Environment); } @@ -516,7 +548,10 @@ Any SAL_CALL FTPContent::execute( } } else { - aRet <<= UnsupportedDataSinkException(); + aRet <<= UnsupportedDataSinkException( + rtl::OUString(), + static_cast< cppu::OWeakObject * >(this), + aOpenCommand.Sink); ucbhelper::cancelCommandExecution(aRet,Environment); } } @@ -544,17 +579,39 @@ Any SAL_CALL FTPContent::execute( aOpenCommand.Mode == OpenMode::DOCUMENT_SHARE_DENY_WRITE) { // Unsupported OpenMode - aRet <<= UnsupportedOpenModeException(); + aRet <<= UnsupportedOpenModeException( + rtl::OUString(), + static_cast< cppu::OWeakObject * >(this), + static_cast< sal_Int16 >(aOpenCommand.Mode)); ucbhelper::cancelCommandExecution(aRet,Environment); } else { - // IllegalArgumentException:: No OpenMode - aRet <<= IllegalArgumentException(); + aRet <<= IllegalArgumentException( + rtl::OUString::createFromAscii( + "Unexpected OpenMode!" ), + static_cast< cppu::OWeakObject * >(this), + -1); + ucbhelper::cancelCommandExecution(aRet,Environment); } - } - else { - aRet <<= UnsupportedCommandException(); + } else if(aCommand.Name.compareToAscii("createNewContent") == 0) { + ContentInfo aArg; + if (!(aCommand.Argument >>= aArg)) { + ucbhelper::cancelCommandExecution( + makeAny( + IllegalArgumentException( + rtl::OUString::createFromAscii( + "Wrong argument type!" ), + static_cast< cppu::OWeakObject * >(this), + -1)), + Environment); + // Unreachable + } + aRet <<= createNewContent(aArg); + } else { + aRet <<= UnsupportedCommandException( + aCommand.Name, + static_cast< cppu::OWeakObject * >(this)); ucbhelper::cancelCommandExecution(aRet,Environment); } @@ -565,8 +622,11 @@ Any SAL_CALL FTPContent::execute( else if(e.code() == CURLE_COULDNT_RESOLVE_HOST ) action = THROWRESOLVENAME; else if(e.code() == CURLE_FTP_USER_PASSWORD_INCORRECT || +#if LIBCURL_VERSION_NUM>=0x070d01 /* 7.13.1 */ + e.code() == CURLE_LOGIN_DENIED || +#endif e.code() == CURLE_BAD_PASSWORD_ENTERED || - e.code() == CURLE_FTP_WEIRD_PASS_REPLY ) + e.code() == CURLE_FTP_WEIRD_PASS_REPLY) action = THROWAUTHENTICATIONREQUEST; else if(e.code() == CURLE_FTP_ACCESS_DENIED) action = THROWACCESSDENIED; @@ -575,7 +635,7 @@ Any SAL_CALL FTPContent::execute( else if(e.code() == CURLE_FTP_COULDNT_RETR_FILE) action = THROWNOFILE; else - // nothing known about the course of the error + // nothing known about the cause of the error action = THROWGENERAL; } } @@ -591,6 +651,14 @@ Any SAL_CALL FTPContent::execute( Sequence SAL_CALL FTPContent::queryCreatableContentsInfo( ) throw (RuntimeException) +{ + return queryCreatableContentsInfo_Static(); +} + +// static +Sequence +FTPContent::queryCreatableContentsInfo_Static( ) + throw (RuntimeException) { Sequence< ContentInfo > seq(2); @@ -614,7 +682,6 @@ FTPContent::queryCreatableContentsInfo( ) return seq; } - Reference SAL_CALL FTPContent::createNewContent( const ContentInfo& Info ) throw (RuntimeException) @@ -785,6 +852,9 @@ Reference< XRow > FTPContent::getPropertyValues( const rtl::OUString& Name = seqProp[i].Name; if(Name.compareToAscii("Title") == 0) xRow->appendString(seqProp[i],aDirEntry.m_aName); + else if(Name.compareToAscii("CreatableContentsInfo") == 0) + xRow->appendObject(seqProp[i], + makeAny(queryCreatableContentsInfo())); else if(aDirEntry.m_nMode != INETCOREFTP_FILEMODE_UNKNOWN) { if(Name.compareToAscii("ContentType") == 0) xRow->appendString(seqProp[i], @@ -825,9 +895,6 @@ Reference< XRow > FTPContent::getPropertyValues( Sequence FTPContent::setPropertyValues( const Sequence& seqPropVal) { - Sequence props = - getProperties(Reference(0)); - Sequence ret(seqPropVal.getLength()); Sequence evt; @@ -866,11 +933,20 @@ Sequence FTPContent::setPropertyValues( ret[i] <<= excep; } } else { - // either not unknown or illegal + Sequence props = + getProperties(Reference(0)); + + // either unknown or read-only ret[i] <<= UnknownPropertyException(); for(sal_Int32 j = 0; j < props.getLength(); ++j) if(props[j].Name == seqPropVal[i].Name) { - ret[i] <<= IllegalAccessException(); + ret[i] <<= IllegalAccessException( + rtl::OUString::createFromAscii( + "Property is read-only!"), + //props[j].Attributes & PropertyAttribute::READONLY + // ? "Property is read-only!" + // : "Access denied!"), + static_cast< cppu::OWeakObject * >( this )); break; } } diff --git a/ucb/source/ucp/ftp/ftpcontent.hxx b/ucb/source/ucp/ftp/ftpcontent.hxx index 1997537d0d81..0b41c9be1d03 100644 --- a/ucb/source/ucp/ftp/ftpcontent.hxx +++ b/ucb/source/ucp/ftp/ftpcontent.hxx @@ -55,19 +55,6 @@ namespace ftp // UNO service name for the content. #define FTP_CONTENT_SERVICE_NAME "com.sun.star.ucb.FTPContent" -//========================================================================= - - struct ContentProperties - { - ::rtl::OUString aTitle; // Title - ::rtl::OUString aContentType; // ContentType - sal_Bool bIsDocument; // IsDocument - sal_Bool bIsFolder; // IsFolder - - ContentProperties() - : bIsDocument( sal_True ), bIsFolder( sal_False ) {} - }; - //========================================================================= class FTPContentProvider; @@ -150,6 +137,11 @@ namespace ftp ::com::sun::star::uno::RuntimeException); + static com::sun::star::uno::Sequence< + com::sun::star::ucb::ContentInfo > + queryCreatableContentsInfo_Static( ) + throw (com::sun::star::uno::RuntimeException); + private: FTPContentProvider *m_pFCP; diff --git a/ucb/source/ucp/ftp/ftpcontentcaps.cxx b/ucb/source/ucp/ftp/ftpcontentcaps.cxx index 59fa976ff656..874bb9bbd0d0 100644 --- a/ucb/source/ucp/ftp/ftpcontentcaps.cxx +++ b/ucb/source/ucp/ftp/ftpcontentcaps.cxx @@ -49,7 +49,7 @@ using namespace ftp; uno::Sequence< beans::Property > FTPContent::getProperties( const uno::Reference< ucb::XCommandEnvironment > & /*xEnv*/) { - #define PROPS_COUNT 7 + #define PROPS_COUNT 8 static const beans::Property aPropsInfoTable[] = { @@ -91,7 +91,7 @@ uno::Sequence< beans::Property > FTPContent::getProperties( beans::Property( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DateCreated" ) ), -1, - getCppuType( static_cast< util::DateTime* >( 0 ) ), + getCppuType( static_cast< util::DateTime * >( 0 ) ), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), @@ -101,10 +101,19 @@ uno::Sequence< beans::Property > FTPContent::getProperties( getCppuBooleanType(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY + ), + beans::Property( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "CreatableContentsInfo" ) ), + -1, + getCppuType( + static_cast< const uno::Sequence< ucb::ContentInfo > * >( 0 ) ), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::READONLY ) }; - return uno::Sequence< beans::Property >( aPropsInfoTable,PROPS_COUNT); + return uno::Sequence< beans::Property >( aPropsInfoTable, PROPS_COUNT ); } //========================================================================= @@ -112,7 +121,7 @@ uno::Sequence< beans::Property > FTPContent::getProperties( uno::Sequence< ucb::CommandInfo > FTPContent::getCommands( const uno::Reference< ucb::XCommandEnvironment > & /*xEnv*/ ) { -// osl::MutexGuard aGuard( m_aMutex ); +// osl::MutexGuard aGuard( m_aMutex ); //================================================================= // @@ -120,7 +129,7 @@ uno::Sequence< ucb::CommandInfo > FTPContent::getCommands( // //================================================================= - #define COMMAND_COUNT 7 + #define COMMAND_COUNT 8 static const ucb::CommandInfo aCommandInfoTable[] = { @@ -167,10 +176,15 @@ uno::Sequence< ucb::CommandInfo > FTPContent::getCommands( ucb::CommandInfo( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "delete" ) ), -1, - getCppuType( static_cast< sal_Bool * >( 0 ) ) + getCppuBooleanType() + ), + ucb::CommandInfo( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "createNewContent" ) ), + -1, + getCppuType( static_cast< ucb::ContentInfo * >( 0 ) ) ) }; - return uno::Sequence(aCommandInfoTable,COMMAND_COUNT); + return uno::Sequence< ucb::CommandInfo >( aCommandInfoTable, COMMAND_COUNT ); } diff --git a/ucb/source/ucp/ftp/ftpresultsetI.cxx b/ucb/source/ucp/ftp/ftpresultsetI.cxx index ab18061de31a..696107238339 100644 --- a/ucb/source/ucp/ftp/ftpresultsetI.cxx +++ b/ucb/source/ucp/ftp/ftpresultsetI.cxx @@ -38,7 +38,7 @@ #include "com/sun/star/ucb/XCommandProcessor.hpp" #include "com/sun/star/sdbc/XRow.hpp" #include "ftpresultsetI.hxx" - +#include "ftpcontent.hxx" using namespace std; @@ -96,6 +96,10 @@ ResultSetI::ResultSetI(const Reference& xMSF, else if(Name.compareToAscii("DateCreated") == 0) xRow->appendTimestamp(seqProp[i], dirvec[n].m_aDate); + else if(Name.compareToAscii("CreatableContentsInfo") == 0) + xRow->appendObject( + seqProp[i], + makeAny(FTPContent::queryCreatableContentsInfo_Static())); else xRow->appendVoid(seqProp[i]); } diff --git a/ucb/source/ucp/ftp/ftpurl.cxx b/ucb/source/ucp/ftp/ftpurl.cxx index a0dfbc1b6f51..52615e79f90e 100644 --- a/ucb/source/ucp/ftp/ftpurl.cxx +++ b/ucb/source/ucp/ftp/ftpurl.cxx @@ -589,6 +589,12 @@ rtl::OUString FTPURL::net_title() const // the client should retry after getting the correct // username + password throw curl_exception(err); +#if LIBCURL_VERSION_NUM>=0x070d01 /* 7.13.1 */ + else if(err == CURLE_LOGIN_DENIED) + // the client should retry after getting the correct + // username + password + throw curl_exception(err); +#endif else if(try_more && err == CURLE_FTP_ACCESS_DENIED) { // We were either denied access when trying to login to // an FTP server or when trying to change working directory diff --git a/ucb/source/ucp/gio/gio_content.cxx b/ucb/source/ucp/gio/gio_content.cxx index 84167fedb1f0..6e214308ae7b 100644 --- a/ucb/source/ucp/gio/gio_content.cxx +++ b/ucb/source/ucp/gio/gio_content.cxx @@ -402,6 +402,7 @@ static util::DateTime getDateFromUnix (time_t t) uno::Reference< sdbc::XRow > Content::getPropertyValuesFromGFileInfo(GFileInfo *pInfo, const uno::Reference< lang::XMultiServiceFactory >& rSMgr, + const uno::Reference< ucb::XCommandEnvironment > & xEnv, const uno::Sequence< beans::Property >& rProperties) { rtl::Reference< ::ucbhelper::PropertyValueSet > xRow = new ::ucbhelper::PropertyValueSet( rSMgr ); @@ -499,6 +500,10 @@ uno::Reference< sdbc::XRow > Content::getPropertyValuesFromGFileInfo(GFileInfo * else xRow->appendVoid( rProp ); } + else if (rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "CreatableContentsInfo" ) ) ) + { + xRow->appendObject( rProp, uno::makeAny( queryCreatableContentsInfo( xEnv ) ) ); + } #ifdef DEBUG else { @@ -520,7 +525,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( if (!pInfo) ucbhelper::cancelCommandExecution(mapGIOError(pError), xEnv); - return getPropertyValuesFromGFileInfo(pInfo, m_xSMgr, rProperties); + return getPropertyValuesFromGFileInfo(pInfo, m_xSMgr, xEnv, rProperties); } static lang::IllegalAccessException @@ -663,7 +668,8 @@ uno::Sequence< uno::Any > Content::setPropertyValues( rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "MediaType" ) ) || rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsDocument" ) ) || rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsFolder" ) ) || - rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Size" ) ) ) + rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Size" ) ) || + rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "CreatableContentsInfo" ) ) ) { aRet[ n ] <<= getReadOnlyException( static_cast< cppu::OWeakObject * >(this) ); } @@ -944,6 +950,14 @@ uno::Any SAL_CALL Content::execute( ucbhelper::cancelCommandExecution ( getBadArgExcept (), xEnv ); aRet <<= setPropertyValues( aProperties, xEnv ); } + else if (aCommand.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "createNewContent" ) ) + && isFolder( xEnv ) ) + { + ucb::ContentInfo arg; + if ( !( aCommand.Argument >>= arg ) ) + ucbhelper::cancelCommandExecution ( getBadArgExcept (), xEnv ); + aRet <<= createNewContent( arg ); + } else if (aCommand.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "insert" ) )) { ucb::InsertCommandArgument arg; @@ -956,8 +970,8 @@ uno::Any SAL_CALL Content::execute( sal_Bool bDeletePhysical = sal_False; aCommand.Argument >>= bDeletePhysical; - //If no delete physical, try and trashcan it, if that doesn't work go - //ahead and try and delete it anyway + //If no delete physical, try and trashcan it, if that doesn't work go + //ahead and try and delete it anyway if (!bDeletePhysical && !g_file_trash(getGFile(), NULL, NULL)) bDeletePhysical = true; @@ -1079,36 +1093,50 @@ void Content::transfer( const ucb::TransferInfo& aTransferInfo, const uno::Refer ucbhelper::cancelCommandExecution(mapGIOError(pError), xEnv); } -com::sun::star::uno::Sequence< com::sun::star::ucb::ContentInfo > SAL_CALL Content::queryCreatableContentsInfo() - throw( com::sun::star::uno::RuntimeException ) +uno::Sequence< ucb::ContentInfo > Content::queryCreatableContentsInfo( + const uno::Reference< ucb::XCommandEnvironment >& xEnv) + throw( uno::RuntimeException ) +{ + if ( isFolder( xEnv ) ) + { + uno::Sequence< ucb::ContentInfo > seq(2); + + // Minimum set of props we really need + uno::Sequence< beans::Property > props( 1 ); + props[0] = beans::Property( + rtl::OUString::createFromAscii( "Title" ), + -1, + getCppuType( static_cast< rtl::OUString* >( 0 ) ), + beans::PropertyAttribute::MAYBEVOID | beans::PropertyAttribute::BOUND ); + + // file + seq[0].Type = rtl::OUString::createFromAscii( GIO_FILE_TYPE ); + seq[0].Attributes = ( ucb::ContentInfoAttribute::INSERT_WITH_INPUTSTREAM | + ucb::ContentInfoAttribute::KIND_DOCUMENT ); + seq[0].Properties = props; + + // folder + seq[1].Type = rtl::OUString::createFromAscii( GIO_FOLDER_TYPE ); + seq[1].Attributes = ucb::ContentInfoAttribute::KIND_FOLDER; + seq[1].Properties = props; + + return seq; + } + else + { + return uno::Sequence< ucb::ContentInfo >(); + } +} + +uno::Sequence< ucb::ContentInfo > SAL_CALL Content::queryCreatableContentsInfo() + throw( uno::RuntimeException ) { - uno::Sequence< ucb::ContentInfo > seq(2); - - // Minimum set of props we really need - uno::Sequence< beans::Property > props( 1 ); - props[0] = beans::Property( - rtl::OUString::createFromAscii( "Title" ), - -1, - getCppuType( static_cast< rtl::OUString* >( 0 ) ), - beans::PropertyAttribute::MAYBEVOID | beans::PropertyAttribute::BOUND ); - - // file - seq[0].Type = rtl::OUString::createFromAscii( GIO_FILE_TYPE ); - seq[0].Attributes = ( ucb::ContentInfoAttribute::INSERT_WITH_INPUTSTREAM | - ucb::ContentInfoAttribute::KIND_DOCUMENT ); - seq[0].Properties = props; - - // folder - seq[1].Type = rtl::OUString::createFromAscii( GIO_FOLDER_TYPE ); - seq[1].Attributes = ucb::ContentInfoAttribute::KIND_FOLDER; - seq[1].Properties = props; - - return seq; + return queryCreatableContentsInfo( uno::Reference< ucb::XCommandEnvironment >() ); } -com::sun::star::uno::Reference< com::sun::star::ucb::XContent > - SAL_CALL Content::createNewContent( const com::sun::star::ucb::ContentInfo& Info ) - throw( com::sun::star::uno::RuntimeException ) +uno::Reference< ucb::XContent > + SAL_CALL Content::createNewContent( const ucb::ContentInfo& Info ) + throw( uno::RuntimeException ) { bool create_document; const char *name; @@ -1223,6 +1251,9 @@ uno::Sequence< beans::Property > Content::getProperties( beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), beans::Property( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsHidden" ) ), -1, getCppuBooleanType(), + beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), + beans::Property( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CreatableContentsInfo" ) ), + -1, getCppuType( static_cast< const uno::Sequence< ucb::ContentInfo > * >( 0 ) ), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ) }; @@ -1232,7 +1263,7 @@ uno::Sequence< beans::Property > Content::getProperties( uno::Sequence< ucb::CommandInfo > Content::getCommands( const uno::Reference< ucb::XCommandEnvironment > & xEnv) { - static ucb::CommandInfo aDocumentCommandInfoTable[] = + static ucb::CommandInfo aCommandInfoTable[] = { // Required commands ucb::CommandInfo @@ -1262,11 +1293,14 @@ uno::Sequence< ucb::CommandInfo > Content::getCommands( const uno::Reference< uc // Folder Only, omitted if not a folder ucb::CommandInfo ( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "transfer" ) ), - -1, getCppuType( static_cast( 0 ) ) ) + -1, getCppuType( static_cast( 0 ) ) ), + ucb::CommandInfo + ( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "createNewContent" ) ), + -1, getCppuType( static_cast( 0 ) ) ) }; - const int nProps = sizeof (aDocumentCommandInfoTable) / sizeof (aDocumentCommandInfoTable[0]); - return uno::Sequence< ucb::CommandInfo >(aDocumentCommandInfoTable, isFolder(xEnv) ? nProps : nProps - 1); + const int nProps = sizeof (aCommandInfoTable) / sizeof (aCommandInfoTable[0]); + return uno::Sequence< ucb::CommandInfo >(aCommandInfoTable, isFolder(xEnv) ? nProps : nProps - 2); } XTYPEPROVIDER_COMMON_IMPL( Content ); diff --git a/ucb/source/ucp/gio/gio_content.hxx b/ucb/source/ucp/gio/gio_content.hxx index b98d1d8a69bd..1cb32e61e9f8 100644 --- a/ucb/source/ucp/gio/gio_content.hxx +++ b/ucb/source/ucp/gio/gio_content.hxx @@ -145,6 +145,7 @@ public: static com::sun::star::uno::Reference< com::sun::star::sdbc::XRow > getPropertyValuesFromGFileInfo( GFileInfo *pInfo, const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rSMgr, + const com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment > & xEnv, const com::sun::star::uno::Sequence< com::sun::star::beans::Property >& rProperties); virtual com::sun::star::uno::Sequence< com::sun::star::beans::Property > @@ -189,6 +190,11 @@ public: SAL_CALL createNewContent( const com::sun::star::ucb::ContentInfo& Info ) throw( com::sun::star::uno::RuntimeException ); + com::sun::star::uno::Sequence< com::sun::star::ucb::ContentInfo > + queryCreatableContentsInfo( + const com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment >& xEnv) + throw( com::sun::star::uno::RuntimeException ); + GFile* getGFile(); }; diff --git a/ucb/source/ucp/gio/gio_datasupplier.cxx b/ucb/source/ucp/gio/gio_datasupplier.cxx index 5dae9c01f2c0..530456b2502e 100644 --- a/ucb/source/ucp/gio/gio_datasupplier.cxx +++ b/ucb/source/ucp/gio/gio_datasupplier.cxx @@ -240,7 +240,7 @@ uno::Reference< sdbc::XRow > DataSupplier::queryPropertyValues( sal_uInt32 nInde if ( getResult( nIndex ) ) { uno::Reference< sdbc::XRow > xRow = Content::getPropertyValuesFromGFileInfo( - maResults[ nIndex ]->pInfo, m_xSMgr, getResultSet()->getProperties()); + maResults[ nIndex ]->pInfo, m_xSMgr, getResultSet()->getEnvironment(), getResultSet()->getProperties()); maResults[ nIndex ]->xRow = xRow; return xRow; diff --git a/ucb/source/ucp/gvfs/gvfs_content.cxx b/ucb/source/ucp/gvfs/gvfs_content.cxx index 76d35dbf5ced..cdfc313a5c8f 100644 --- a/ucb/source/ucp/gvfs/gvfs_content.cxx +++ b/ucb/source/ucp/gvfs/gvfs_content.cxx @@ -390,6 +390,13 @@ uno::Any SAL_CALL Content::execute( g_warning ("Open falling through ..."); #endif + } else if ( COMMAND_IS( aCommand, "createNewContent" ) && isFolder( xEnv ) ) { + ucb::ContentInfo arg; + if ( !( aCommand.Argument >>= arg ) ) + ucbhelper::cancelCommandExecution ( getBadArgExcept (), xEnv ); + + aRet <<= createNewContent( arg ); + } else if ( COMMAND_IS( aCommand, "insert" ) ) { ucb::InsertCommandArgument arg; if ( !( aCommand.Argument >>= arg ) ) @@ -444,32 +451,45 @@ void SAL_CALL Content::abort( sal_Int32 /*CommandId*/ ) // XContentCreator methods. // -uno::Sequence< ucb::ContentInfo > SAL_CALL -Content::queryCreatableContentsInfo() - throw( uno::RuntimeException ) +uno::Sequence< ucb::ContentInfo > Content::queryCreatableContentsInfo( + const uno::Reference< ucb::XCommandEnvironment >& xEnv) + throw( uno::RuntimeException ) +{ + if ( isFolder( xEnv ) ) + { + uno::Sequence< ucb::ContentInfo > seq(2); + + // Minimum set of props we really need + uno::Sequence< beans::Property > props( 1 ); + props[0] = beans::Property( + rtl::OUString::createFromAscii( "Title" ), + -1, + getCppuType( static_cast< rtl::OUString* >( 0 ) ), + beans::PropertyAttribute::MAYBEVOID | beans::PropertyAttribute::BOUND ); + + // file + seq[0].Type = rtl::OUString::createFromAscii( GVFS_FILE_TYPE ); + seq[0].Attributes = ( ucb::ContentInfoAttribute::INSERT_WITH_INPUTSTREAM | + ucb::ContentInfoAttribute::KIND_DOCUMENT ); + seq[0].Properties = props; + + // folder + seq[1].Type = rtl::OUString::createFromAscii( GVFS_FOLDER_TYPE ); + seq[1].Attributes = ucb::ContentInfoAttribute::KIND_FOLDER; + seq[1].Properties = props; + + return seq; + } + else + { + return uno::Sequence< ucb::ContentInfo >(); + } +} + +uno::Sequence< ucb::ContentInfo > SAL_CALL Content::queryCreatableContentsInfo() + throw( uno::RuntimeException ) { - uno::Sequence< ucb::ContentInfo > seq(2); - - // Minimum set of props we really need - uno::Sequence< beans::Property > props( 1 ); - props[0] = beans::Property( - rtl::OUString::createFromAscii( "Title" ), - -1, - getCppuType( static_cast< rtl::OUString* >( 0 ) ), - beans::PropertyAttribute::MAYBEVOID | beans::PropertyAttribute::BOUND ); - - // file - seq[0].Type = rtl::OUString::createFromAscii( GVFS_FILE_TYPE ); - seq[0].Attributes = ( ucb::ContentInfoAttribute::INSERT_WITH_INPUTSTREAM | - ucb::ContentInfoAttribute::KIND_DOCUMENT ); - seq[0].Properties = props; - - // folder - seq[1].Type = rtl::OUString::createFromAscii( GVFS_FOLDER_TYPE ); - seq[1].Attributes = ucb::ContentInfoAttribute::KIND_FOLDER; - seq[1].Properties = props; - - return seq; + return queryCreatableContentsInfo( uno::Reference< ucb::XCommandEnvironment >() ); } uno::Reference< ucb::XContent > SAL_CALL @@ -668,7 +688,10 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( g_warning ("FIXME: Requested mime-type - an expensive op. indeed!"); #endif xRow->appendVoid( rProp ); - } else { + } else if (rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "CreatableContentsInfo" ) ) ) + xRow->appendObject( rProp, uno::makeAny( queryCreatableContentsInfo( xEnv ) ) ); + + else { xRow->appendVoid( rProp ); } } @@ -780,7 +803,8 @@ uno::Sequence< uno::Any > Content::setPropertyValues( rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "MediaType" ) ) || rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsDocument" ) ) || rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsFolder" ) ) || - rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Size" ) ) ) + rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Size" ) ) || + rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "CreatableContentsInfo" ) ) ) aRet[ n ] <<= getReadOnlyException( this ); else if ( rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Title" ) ) ) { @@ -1311,8 +1335,8 @@ uno::Sequence< beans::Property > Content::getProperties( beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), // FIXME: Too expensive for now (?) // beans::Property( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MediaType" ) ), -// -1, getCppuType( static_cast< const rtl::OUString * >( 0 ) ), -// beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), +// -1, getCppuType( static_cast< const rtl::OUString * >( 0 ) ), +// beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), beans::Property( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Size" ) ), -1, getCppuType( static_cast< const sal_Int64 * >( 0 ) ), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), @@ -1327,6 +1351,9 @@ uno::Sequence< beans::Property > Content::getProperties( beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), beans::Property( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsHidden" ) ), -1, getCppuBooleanType(), + beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), + beans::Property( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CreatableContentsInfo" ) ), + -1, getCppuType( static_cast< const uno::Sequence< ucb::ContentInfo > * >( 0 ) ), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ) }; @@ -1339,7 +1366,7 @@ uno::Sequence< beans::Property > Content::getProperties( uno::Sequence< ucb::CommandInfo > Content::getCommands( const uno::Reference< ucb::XCommandEnvironment > & xEnv ) { - static ucb::CommandInfo aDocumentCommandInfoTable[] = { + static ucb::CommandInfo aCommandInfoTable[] = { // Required commands ucb::CommandInfo ( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "getCommandInfo" ) ), @@ -1365,17 +1392,19 @@ uno::Sequence< ucb::CommandInfo > Content::getCommands( ( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "open" ) ), -1, getCppuType( static_cast( 0 ) ) ), - // Folder only + // Folder Only, omitted if not a folder ucb::CommandInfo ( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "transfer" ) ), - -1, getCppuType( static_cast( 0 ) ) ) + -1, getCppuType( static_cast( 0 ) ) ), + ucb::CommandInfo + ( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "createNewContent" ) ), + -1, getCppuType( static_cast( 0 ) ) ) }; - int num = 7; - - if ( isFolder( xEnv ) ) - num += 1; - return uno::Sequence< ucb::CommandInfo >(aDocumentCommandInfoTable, num ); + const int nProps + = sizeof( aCommandInfoTable ) / sizeof( aCommandInfoTable[ 0 ] ); + return uno::Sequence< ucb::CommandInfo >( + aCommandInfoTable, isFolder( xEnv ) ? nProps : nProps - 2 ); } rtl::OUString diff --git a/ucb/source/ucp/gvfs/gvfs_content.hxx b/ucb/source/ucp/gvfs/gvfs_content.hxx index 294d572ff175..67425da4df0b 100644 --- a/ucb/source/ucp/gvfs/gvfs_content.hxx +++ b/ucb/source/ucp/gvfs/gvfs_content.hxx @@ -255,6 +255,13 @@ public: com::sun::star::ucb::XContent > SAL_CALL createNewContent( const com::sun::star::ucb::ContentInfo& Info ) throw( com::sun::star::uno::RuntimeException ); + + + com::sun::star::uno::Sequence< com::sun::star::ucb::ContentInfo > + queryCreatableContentsInfo( + const com::sun::star::uno::Reference< + com::sun::star::ucb::XCommandEnvironment >& xEnv) + throw( com::sun::star::uno::RuntimeException ); }; } diff --git a/ucb/source/ucp/hierarchy/hierarchycontent.cxx b/ucb/source/ucp/hierarchy/hierarchycontent.cxx index 65911b4185cf..8027700a01bb 100644 --- a/ucb/source/ucp/hierarchy/hierarchycontent.cxx +++ b/ucb/source/ucp/hierarchy/hierarchycontent.cxx @@ -457,8 +457,8 @@ uno::Any SAL_CALL HierarchyContent::execute( aRet <<= getCommandInfo( Environment ); } - else if ( isFolder() && aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "open" ) ) ) + else if ( aCommand.Name.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM( "open" ) ) && isFolder() ) { ////////////////////////////////////////////////////////////////// // open command for a folder content @@ -481,9 +481,9 @@ uno::Any SAL_CALL HierarchyContent::execute( = new DynamicResultSet( m_xSMgr, this, aOpenCommand ); aRet <<= xSet; } - else if ( ( m_eKind != ROOT ) && !isReadOnly() && - aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "insert" ) ) ) + else if ( aCommand.Name.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM( "insert" ) ) && + ( m_eKind != ROOT ) && !isReadOnly() ) { ////////////////////////////////////////////////////////////////// // insert @@ -508,9 +508,9 @@ uno::Any SAL_CALL HierarchyContent::execute( : ucb::NameClash::ERROR; insert( nNameClash, Environment ); } - else if ( ( m_eKind != ROOT ) && !isReadOnly() && - aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "delete" ) ) ) + else if ( aCommand.Name.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM( "delete" ) ) && + ( m_eKind != ROOT ) && !isReadOnly() ) { ////////////////////////////////////////////////////////////////// // delete @@ -546,9 +546,9 @@ uno::Any SAL_CALL HierarchyContent::execute( // Remove own and all children's Additional Core Properties. removeAdditionalPropertySet( sal_True ); } - else if ( isFolder() && !isReadOnly() && - aCommand.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "transfer" ) ) ) + else if ( aCommand.Name.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM( "transfer" ) ) && + isFolder() && !isReadOnly() ) { ////////////////////////////////////////////////////////////////// // transfer @@ -571,6 +571,31 @@ uno::Any SAL_CALL HierarchyContent::execute( transfer( aInfo, Environment ); } + else if ( aCommand.Name.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM( "createNewContent" ) ) && + isFolder() && !isReadOnly() ) + { + ////////////////////////////////////////////////////////////////// + // createNewContent + // ( Not available at link objects ) + ////////////////////////////////////////////////////////////////// + + ucb::ContentInfo aInfo; + if ( !( aCommand.Argument >>= aInfo ) ) + { + OSL_ENSURE( sal_False, "Wrong argument type!" ); + ucbhelper::cancelCommandExecution( + uno::makeAny( lang::IllegalArgumentException( + rtl::OUString::createFromAscii( + "Wrong argument type!" ), + static_cast< cppu::OWeakObject * >( this ), + -1 ) ), + Environment ); + // Unreachable + } + + aRet <<= createNewContent( aInfo ); + } else { ////////////////////////////////////////////////////////////////// @@ -607,54 +632,7 @@ uno::Sequence< ucb::ContentInfo > SAL_CALL HierarchyContent::queryCreatableContentsInfo() throw( uno::RuntimeException ) { - if ( isFolder() ) - { - osl::Guard< osl::Mutex > aGuard( m_aMutex ); - - uno::Sequence< ucb::ContentInfo > aSeq( 2 ); - - // Folder. - aSeq.getArray()[ 0 ].Type - = rtl::OUString::createFromAscii( HIERARCHY_FOLDER_CONTENT_TYPE ); - aSeq.getArray()[ 0 ].Attributes - = ucb::ContentInfoAttribute::KIND_FOLDER; - - uno::Sequence< beans::Property > aFolderProps( 1 ); - aFolderProps.getArray()[ 0 ] = beans::Property( - rtl::OUString::createFromAscii( "Title" ), - -1, - getCppuType( static_cast< const rtl::OUString * >( 0 ) ), - beans::PropertyAttribute::BOUND ); - aSeq.getArray()[ 0 ].Properties = aFolderProps; - - // Link. - aSeq.getArray()[ 1 ].Type - = rtl::OUString::createFromAscii( HIERARCHY_LINK_CONTENT_TYPE ); - aSeq.getArray()[ 1 ].Attributes - = ucb::ContentInfoAttribute::KIND_LINK; - - uno::Sequence< beans::Property > aLinkProps( 2 ); - aLinkProps.getArray()[ 0 ] = beans::Property( - rtl::OUString::createFromAscii( "Title" ), - -1, - getCppuType( static_cast< const rtl::OUString * >( 0 ) ), - beans::PropertyAttribute::BOUND ); - aLinkProps.getArray()[ 1 ] = beans::Property( - rtl::OUString::createFromAscii( "TargetURL" ), - -1, - getCppuType( static_cast< const rtl::OUString * >( 0 ) ), - beans::PropertyAttribute::BOUND ); - aSeq.getArray()[ 1 ].Properties = aLinkProps; - - return aSeq; - } - else - { - OSL_ENSURE( sal_False, - "queryCreatableContentsInfo called on non-folder object!" ); - - return uno::Sequence< ucb::ContentInfo >( 0 ); - } + return m_aProps.getCreatableContentsInfo(); } //========================================================================= @@ -1026,7 +1004,7 @@ uno::Reference< sdbc::XRow > HierarchyContent::getPropertyValues( xRow->appendString ( rProp, rData.getContentType() ); } else if ( rProp.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "Title" ) ) ) + RTL_CONSTASCII_STRINGPARAM( "Title" ) ) ) { xRow->appendString ( rProp, rData.getTitle() ); } @@ -1040,6 +1018,12 @@ uno::Reference< sdbc::XRow > HierarchyContent::getPropertyValues( { xRow->appendBoolean( rProp, rData.getIsFolder() ); } + else if ( rProp.Name.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM( "CreatableContentsInfo" ) ) ) + { + xRow->appendObject( + rProp, uno::makeAny( rData.getCreatableContentsInfo() ) ); + } else if ( rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "TargetURL" ) ) ) { @@ -1123,6 +1107,15 @@ uno::Reference< sdbc::XRow > HierarchyContent::getPropertyValues( // @@@ Might actually be read-only! beans::PropertyAttribute::BOUND ), rData.getTargetURL() ); + xRow->appendObject( + beans::Property( + rtl::OUString::createFromAscii( "CreatableContentsInfo" ), + -1, + getCppuType( static_cast< + const uno::Sequence< ucb::ContentInfo > * >( 0 ) ), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::READONLY ), + uno::makeAny( rData.getCreatableContentsInfo() ) ); // Append all Additional Core Properties. @@ -1161,11 +1154,11 @@ uno::Sequence< uno::Any > HierarchyContent::setPropertyValues( beans::PropertyChangeEvent aEvent; aEvent.Source = static_cast< cppu::OWeakObject * >( this ); - aEvent.Further = sal_False; -// aEvent.PropertyName = + aEvent.Further = sal_False; +// aEvent.PropertyName = aEvent.PropertyHandle = -1; -// aEvent.OldValue = -// aEvent.NewValue = +// aEvent.OldValue = +// aEvent.NewValue = const beans::PropertyValue* pValues = rValues.getConstArray(); sal_Int32 nCount = rValues.getLength(); @@ -1209,6 +1202,15 @@ uno::Sequence< uno::Any > HierarchyContent::setPropertyValues( "Property is read-only!" ), static_cast< cppu::OWeakObject * >( this ) ); } + else if ( rValue.Name.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM( "CreatableContentsInfo" ) ) ) + { + // Read-only property! + aRet[ n ] <<= lang::IllegalAccessException( + rtl::OUString::createFromAscii( + "Property is read-only!" ), + static_cast< cppu::OWeakObject * >( this ) ); + } else if ( rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Title" ) ) ) { @@ -1953,3 +1955,58 @@ void HierarchyContent::transfer( } } +//========================================================================= +//========================================================================= +// +// HierarchyContentProperties Implementation. +// +//========================================================================= +//========================================================================= + +uno::Sequence< ucb::ContentInfo > +HierarchyContentProperties::getCreatableContentsInfo() const +{ + if ( getIsFolder() ) + { + uno::Sequence< ucb::ContentInfo > aSeq( 2 ); + + // Folder. + aSeq.getArray()[ 0 ].Type + = rtl::OUString::createFromAscii( HIERARCHY_FOLDER_CONTENT_TYPE ); + aSeq.getArray()[ 0 ].Attributes + = ucb::ContentInfoAttribute::KIND_FOLDER; + + uno::Sequence< beans::Property > aFolderProps( 1 ); + aFolderProps.getArray()[ 0 ] = beans::Property( + rtl::OUString::createFromAscii( "Title" ), + -1, + getCppuType( static_cast< const rtl::OUString * >( 0 ) ), + beans::PropertyAttribute::BOUND ); + aSeq.getArray()[ 0 ].Properties = aFolderProps; + + // Link. + aSeq.getArray()[ 1 ].Type + = rtl::OUString::createFromAscii( HIERARCHY_LINK_CONTENT_TYPE ); + aSeq.getArray()[ 1 ].Attributes + = ucb::ContentInfoAttribute::KIND_LINK; + + uno::Sequence< beans::Property > aLinkProps( 2 ); + aLinkProps.getArray()[ 0 ] = beans::Property( + rtl::OUString::createFromAscii( "Title" ), + -1, + getCppuType( static_cast< const rtl::OUString * >( 0 ) ), + beans::PropertyAttribute::BOUND ); + aLinkProps.getArray()[ 1 ] = beans::Property( + rtl::OUString::createFromAscii( "TargetURL" ), + -1, + getCppuType( static_cast< const rtl::OUString * >( 0 ) ), + beans::PropertyAttribute::BOUND ); + aSeq.getArray()[ 1 ].Properties = aLinkProps; + + return aSeq; + } + else + { + return uno::Sequence< ucb::ContentInfo >( 0 ); + } +} diff --git a/ucb/source/ucp/hierarchy/hierarchycontent.hxx b/ucb/source/ucp/hierarchy/hierarchycontent.hxx index 68cd2eed6f04..4094d77e4ca6 100644 --- a/ucb/source/ucp/hierarchy/hierarchycontent.hxx +++ b/ucb/source/ucp/hierarchy/hierarchycontent.hxx @@ -101,6 +101,9 @@ public: sal_Bool getIsDocument() const { return !getIsFolder(); } + com::sun::star::uno::Sequence< com::sun::star::ucb::ContentInfo > + getCreatableContentsInfo() const; + const HierarchyEntryData & getHierarchyEntryData() const { return m_aData; } private: diff --git a/ucb/source/ucp/hierarchy/hierarchycontentcaps.cxx b/ucb/source/ucp/hierarchy/hierarchycontentcaps.cxx index cf6e0edd3f0b..47280ec12503 100644 --- a/ucb/source/ucp/hierarchy/hierarchycontentcaps.cxx +++ b/ucb/source/ucp/hierarchy/hierarchycontentcaps.cxx @@ -47,17 +47,20 @@ IsFolder x x x x x Title x x x x x TargetURL x x + CreatableContentsInfo x x x x x getCommandInfo x x x x x getPropertySetInfo x x x x x getPropertyValues x x x x x setPropertyValues x x x x x + createNewContent x x insert x x delete x x open x x transfer x x *************************************************************************/ + #include #include #include @@ -76,6 +79,12 @@ using namespace hierarchy_ucp; // //========================================================================= +#define MAKEPROPSEQUENCE( a ) \ + uno::Sequence< beans::Property >( a, sizeof( a ) / sizeof( a[ 0 ] ) ) + +#define MAKECMDSEQUENCE( a ) \ + uno::Sequence< ucb::CommandInfo >( a, sizeof( a ) / sizeof( a[ 0 ] ) ) + //========================================================================= // // IMPORTENT: If any property data ( name / type / ... ) are changed, then @@ -143,13 +152,20 @@ uno::Sequence< beans::Property > HierarchyContent::getProperties( getCppuType( static_cast< const rtl::OUString * >( 0 ) ), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY - ) + ), + beans::Property( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "CreatableContentsInfo" ) ), + -1, + getCppuType( static_cast< + const uno::Sequence< ucb::ContentInfo > * >( 0 ) ), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::READONLY ) /////////////////////////////////////////////////////////// // New properties /////////////////////////////////////////////////////////// }; - return uno::Sequence< - beans::Property >( aLinkPropertyInfoTable, 5 ); + return MAKEPROPSEQUENCE( aLinkPropertyInfoTable ); } else { @@ -195,13 +211,20 @@ uno::Sequence< beans::Property > HierarchyContent::getProperties( -1, getCppuType( static_cast< const rtl::OUString * >( 0 ) ), beans::PropertyAttribute::BOUND - ) + ), + beans::Property( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "CreatableContentsInfo" ) ), + -1, + getCppuType( static_cast< + const uno::Sequence< ucb::ContentInfo > * >( 0 ) ), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::READONLY ) /////////////////////////////////////////////////////////// // New properties /////////////////////////////////////////////////////////// }; - return uno::Sequence< - beans::Property >( aLinkPropertyInfoTable, 5 ); + return MAKEPROPSEQUENCE( aLinkPropertyInfoTable ); } } else if ( m_eKind == FOLDER ) @@ -248,16 +271,23 @@ uno::Sequence< beans::Property > HierarchyContent::getProperties( getCppuType( static_cast< const rtl::OUString * >( 0 ) ), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY - ) + ), /////////////////////////////////////////////////////////// // Optional standard properties /////////////////////////////////////////////////////////// + beans::Property( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "CreatableContentsInfo" ) ), + -1, + getCppuType( static_cast< + const uno::Sequence< ucb::ContentInfo > * >( 0 ) ), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::READONLY ) /////////////////////////////////////////////////////////// // New properties /////////////////////////////////////////////////////////// }; - return uno::Sequence< - beans::Property >( aFolderPropertyInfoTable, 4 ); + return MAKEPROPSEQUENCE( aFolderPropertyInfoTable ); } else { @@ -294,16 +324,23 @@ uno::Sequence< beans::Property > HierarchyContent::getProperties( -1, getCppuType( static_cast< const rtl::OUString * >( 0 ) ), beans::PropertyAttribute::BOUND - ) + ), /////////////////////////////////////////////////////////// // Optional standard properties /////////////////////////////////////////////////////////// + beans::Property( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "CreatableContentsInfo" ) ), + -1, + getCppuType( static_cast< + const uno::Sequence< ucb::ContentInfo > * >( 0 ) ), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::READONLY ) /////////////////////////////////////////////////////////// // New properties /////////////////////////////////////////////////////////// }; - return uno::Sequence< - beans::Property >( aFolderPropertyInfoTable, 4 ); + return MAKEPROPSEQUENCE( aFolderPropertyInfoTable ); } } else @@ -314,6 +351,9 @@ uno::Sequence< beans::Property > HierarchyContent::getProperties( // //================================================================= + // Currently no difference between reonly /read-write + // -> all props ar read-only + static beans::Property aRootFolderPropertyInfoTable[] = { /////////////////////////////////////////////////////////////// @@ -346,16 +386,23 @@ uno::Sequence< beans::Property > HierarchyContent::getProperties( getCppuType( static_cast< const rtl::OUString * >( 0 ) ), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY - ) + ), /////////////////////////////////////////////////////////////// // Optional standard properties /////////////////////////////////////////////////////////////// + beans::Property( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "CreatableContentsInfo" ) ), + -1, + getCppuType( static_cast< + const uno::Sequence< ucb::ContentInfo > * >( 0 ) ), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::READONLY ) /////////////////////////////////////////////////////////////// // New properties /////////////////////////////////////////////////////////////// }; - return uno::Sequence< - beans::Property >( aRootFolderPropertyInfoTable, 4 ); + return MAKEPROPSEQUENCE( aRootFolderPropertyInfoTable ); } } @@ -416,8 +463,7 @@ uno::Sequence< ucb::CommandInfo > HierarchyContent::getCommands( // New commands /////////////////////////////////////////////////////////// }; - return uno::Sequence< - ucb::CommandInfo >( aLinkCommandInfoTable, 4 ); + return MAKECMDSEQUENCE( aLinkCommandInfoTable ); } else { @@ -470,8 +516,7 @@ uno::Sequence< ucb::CommandInfo > HierarchyContent::getCommands( // New commands /////////////////////////////////////////////////////////// }; - return uno::Sequence< - ucb::CommandInfo >( aLinkCommandInfoTable, 6 ); + return MAKECMDSEQUENCE( aLinkCommandInfoTable ); } } else if ( m_eKind == FOLDER ) @@ -529,8 +574,7 @@ uno::Sequence< ucb::CommandInfo > HierarchyContent::getCommands( // New commands /////////////////////////////////////////////////////////// }; - return uno::Sequence< - ucb::CommandInfo >( aFolderCommandInfoTable, 5 ); + return MAKECMDSEQUENCE( aFolderCommandInfoTable ); } else { @@ -589,13 +633,18 @@ uno::Sequence< ucb::CommandInfo > HierarchyContent::getCommands( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "transfer" ) ), -1, getCppuType( static_cast< ucb::TransferInfo * >( 0 ) ) + ), + ucb::CommandInfo( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "createNewContent" ) ), + -1, + getCppuType( static_cast< ucb::ContentInfo * >( 0 ) ) ) /////////////////////////////////////////////////////////// // New commands /////////////////////////////////////////////////////////// }; - return uno::Sequence< - ucb::CommandInfo >( aFolderCommandInfoTable, 8 ); + return MAKECMDSEQUENCE( aFolderCommandInfoTable ); } } else @@ -653,8 +702,7 @@ uno::Sequence< ucb::CommandInfo > HierarchyContent::getCommands( // New commands /////////////////////////////////////////////////////////// }; - return uno::Sequence< - ucb::CommandInfo >( aRootFolderCommandInfoTable, 5 ); + return MAKECMDSEQUENCE( aRootFolderCommandInfoTable ); } else { @@ -703,13 +751,18 @@ uno::Sequence< ucb::CommandInfo > HierarchyContent::getCommands( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "transfer" ) ), -1, getCppuType( static_cast< ucb::TransferInfo * >( 0 ) ) + ), + ucb::CommandInfo( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "createNewContent" ) ), + -1, + getCppuType( static_cast< ucb::ContentInfo * >( 0 ) ) ) /////////////////////////////////////////////////////////// // New commands /////////////////////////////////////////////////////////// }; - return uno::Sequence< - ucb::CommandInfo >( aRootFolderCommandInfoTable, 6 ); + return MAKECMDSEQUENCE( aRootFolderCommandInfoTable ); } } } diff --git a/ucb/source/ucp/package/pkgcontent.cxx b/ucb/source/ucp/package/pkgcontent.cxx index 7fff9871c2cb..7e8359545e9c 100644 --- a/ucb/source/ucp/package/pkgcontent.cxx +++ b/ucb/source/ucp/package/pkgcontent.cxx @@ -103,16 +103,59 @@ ContentProperties::ContentProperties( const rtl::OUString& rContentType ) bEncrypted( sal_False ), bHasEncryptedEntries( sal_False ) { - bIsFolder = rContentType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( PACKAGE_FOLDER_CONTENT_TYPE ) ) - || rContentType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( PACKAGE_ZIP_FOLDER_CONTENT_TYPE ) ); + bIsFolder = rContentType.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM( PACKAGE_FOLDER_CONTENT_TYPE ) ) + || rContentType.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM( PACKAGE_ZIP_FOLDER_CONTENT_TYPE ) ); bIsDocument = !bIsFolder; OSL_ENSURE( bIsFolder || - rContentType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( PACKAGE_STREAM_CONTENT_TYPE ) ) || - rContentType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( PACKAGE_ZIP_STREAM_CONTENT_TYPE ) ), + rContentType.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM( PACKAGE_STREAM_CONTENT_TYPE ) ) + || rContentType.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM( PACKAGE_ZIP_STREAM_CONTENT_TYPE ) ), "ContentProperties::ContentProperties - Unknown type!" ); } +//========================================================================= + +uno::Sequence< ucb::ContentInfo > +ContentProperties::getCreatableContentsInfo( PackageUri const & rUri ) const +{ + if ( bIsFolder ) + { + uno::Sequence< beans::Property > aProps( 1 ); + aProps.getArray()[ 0 ] = beans::Property( + rtl::OUString::createFromAscii( "Title" ), + -1, + getCppuType( static_cast< const rtl::OUString * >( 0 ) ), + beans::PropertyAttribute::BOUND ); + + uno::Sequence< ucb::ContentInfo > aSeq( 2 ); + + // Folder. + aSeq.getArray()[ 0 ].Type + = Content::getContentType( rUri.getScheme(), sal_True ); + aSeq.getArray()[ 0 ].Attributes + = ucb::ContentInfoAttribute::KIND_FOLDER; + aSeq.getArray()[ 0 ].Properties = aProps; + + // Stream. + aSeq.getArray()[ 1 ].Type + = Content::getContentType( rUri.getScheme(), sal_False ); + aSeq.getArray()[ 1 ].Attributes + = ucb::ContentInfoAttribute::INSERT_WITH_INPUTSTREAM + | ucb::ContentInfoAttribute::KIND_DOCUMENT; + aSeq.getArray()[ 1 ].Properties = aProps; + + return aSeq; + } + else + { + return uno::Sequence< ucb::ContentInfo >( 0 ); + } +} + //========================================================================= //========================================================================= // @@ -164,9 +207,9 @@ Content* Content::create( ucb::ContentInfo aInfo; if ( bFolder || aURI.isRootFolder() ) - aInfo.Type = GetContentType( aURI.getScheme(), sal_True ); + aInfo.Type = getContentType( aURI.getScheme(), sal_True ); else - aInfo.Type = GetContentType( aURI.getScheme(), sal_False ); + aInfo.Type = getContentType( aURI.getScheme(), sal_False ); return new Content( rxSMgr, pProvider, xId, xPackage, aURI, aInfo ); } @@ -186,9 +229,9 @@ Content* Content::create( PackageUri aURI( Identifier->getContentIdentifier() ); if ( !Info.Type.equalsIgnoreAsciiCase( - GetContentType( aURI.getScheme(), sal_True ) ) && + getContentType( aURI.getScheme(), sal_True ) ) && !Info.Type.equalsIgnoreAsciiCase( - GetContentType( aURI.getScheme(), sal_False ) ) ) + getContentType( aURI.getScheme(), sal_False ) ) ) return 0; uno::Reference< container::XHierarchicalNameAccess > xPackage; @@ -208,7 +251,7 @@ Content* Content::create( //========================================================================= // static -::rtl::OUString Content::GetContentType( +::rtl::OUString Content::getContentType( const ::rtl::OUString& aScheme, sal_Bool bFolder ) { return ( rtl::OUString::createFromAscii( "application/" ) @@ -625,6 +668,31 @@ uno::Any SAL_CALL Content::execute( transfer( aInfo, Environment ); } + else if ( aCommand.Name.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM( "createNewContent" ) ) && + isFolder() ) + { + ////////////////////////////////////////////////////////////////// + // createNewContent + // ( Not available at stream objects ) + ////////////////////////////////////////////////////////////////// + + ucb::ContentInfo aInfo; + if ( !( aCommand.Argument >>= aInfo ) ) + { + OSL_ENSURE( sal_False, "Wrong argument type!" ); + ucbhelper::cancelCommandExecution( + uno::makeAny( lang::IllegalArgumentException( + rtl::OUString::createFromAscii( + "Wrong argument type!" ), + static_cast< cppu::OWeakObject * >( this ), + -1 ) ), + Environment ); + // Unreachable + } + + aRet <<= createNewContent( aInfo ); + } else if ( aCommand.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "flush" ) ) ) { @@ -691,43 +759,7 @@ uno::Sequence< ucb::ContentInfo > SAL_CALL Content::queryCreatableContentsInfo() throw( uno::RuntimeException ) { - if ( isFolder() ) - { - osl::Guard< osl::Mutex > aGuard( m_aMutex ); - - uno::Sequence< beans::Property > aProps( 1 ); - aProps.getArray()[ 0 ] = beans::Property( - rtl::OUString::createFromAscii( "Title" ), - -1, - getCppuType( static_cast< const rtl::OUString * >( 0 ) ), - beans::PropertyAttribute::BOUND ); - - uno::Sequence< ucb::ContentInfo > aSeq( 2 ); - - // Folder. - aSeq.getArray()[ 0 ].Type - = GetContentType( m_aUri.getScheme(), sal_True ); - aSeq.getArray()[ 0 ].Attributes - = ucb::ContentInfoAttribute::KIND_FOLDER; - aSeq.getArray()[ 0 ].Properties = aProps; - - // Stream. - aSeq.getArray()[ 1 ].Type - = GetContentType( m_aUri.getScheme(), sal_False ); - aSeq.getArray()[ 1 ].Attributes - = ucb::ContentInfoAttribute::INSERT_WITH_INPUTSTREAM - | ucb::ContentInfoAttribute::KIND_DOCUMENT; - aSeq.getArray()[ 1 ].Properties = aProps; - - return aSeq; - } - else - { - OSL_ENSURE( sal_False, - "queryCreatableContentsInfo called on non-folder object!" ); - - return uno::Sequence< ucb::ContentInfo >( 0 ); - } + return m_aProps.getCreatableContentsInfo( m_aUri ); } //========================================================================= @@ -744,16 +776,16 @@ Content::createNewContent( const ucb::ContentInfo& Info ) return uno::Reference< ucb::XContent >(); if ( !Info.Type.equalsIgnoreAsciiCase( - GetContentType( m_aUri.getScheme(), sal_True ) ) && + getContentType( m_aUri.getScheme(), sal_True ) ) && !Info.Type.equalsIgnoreAsciiCase( - GetContentType( m_aUri.getScheme(), sal_False ) ) ) + getContentType( m_aUri.getScheme(), sal_False ) ) ) return uno::Reference< ucb::XContent >(); rtl::OUString aURL = m_aUri.getUri(); aURL += rtl::OUString::createFromAscii( "/" ); if ( Info.Type.equalsIgnoreAsciiCase( - GetContentType( m_aUri.getScheme(), sal_True ) ) ) + getContentType( m_aUri.getScheme(), sal_True ) ) ) aURL += rtl::OUString::createFromAscii( "New_Folder" ); else aURL += rtl::OUString::createFromAscii( "New_Stream" ); @@ -868,6 +900,14 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( { xRow->appendBoolean( rProp, rData.bIsFolder ); } + else if ( rProp.Name.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM( "CreatableContentsInfo" ) ) ) + { + xRow->appendObject( + rProp, uno::makeAny( + rData.getCreatableContentsInfo( + PackageUri( rContentId ) ) ) ); + } else if ( rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "MediaType" ) ) ) { @@ -976,6 +1016,16 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), rData.bIsFolder ); + xRow->appendObject( + beans::Property( + rtl::OUString::createFromAscii( "CreatableContentsInfo" ), + -1, + getCppuType( static_cast< + const uno::Sequence< ucb::ContentInfo > * >( 0 ) ), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::READONLY ), + uno::makeAny( + rData.getCreatableContentsInfo( PackageUri( rContentId ) ) ) ); xRow->appendString( beans::Property( rtl::OUString::createFromAscii( "MediaType" ), @@ -1113,6 +1163,15 @@ uno::Sequence< uno::Any > Content::setPropertyValues( "Property is read-only!" ), static_cast< cppu::OWeakObject * >( this ) ); } + else if ( rValue.Name.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM( "CreatableContentsInfo" ) ) ) + { + // Read-only property! + aRet[ n ] <<= lang::IllegalAccessException( + rtl::OUString::createFromAscii( + "Property is read-only!" ), + static_cast< cppu::OWeakObject * >( this ) ); + } else if ( rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Title" ) ) ) { @@ -1929,8 +1988,8 @@ void Content::transfer( ////////////////////////////////////////////////////////////////////// rtl::OUString aType = xSource->isFolder() - ? GetContentType( m_aUri.getScheme(), sal_True ) - : GetContentType( m_aUri.getScheme(), sal_False ); + ? getContentType( m_aUri.getScheme(), sal_True ) + : getContentType( m_aUri.getScheme(), sal_False ); ucb::ContentInfo aContentInfo; aContentInfo.Type = aType; aContentInfo.Attributes = 0; @@ -2411,14 +2470,14 @@ sal_Bool Content::loadData( if ( xEnumAccess.is() ) { // folder - rProps.aContentType = GetContentType( rURI.getScheme(), sal_True ); + rProps.aContentType = getContentType( rURI.getScheme(), sal_True ); rProps.bIsDocument = sal_False; rProps.bIsFolder = sal_True; } else { // stream - rProps.aContentType = GetContentType( rURI.getScheme(), sal_False ); + rProps.aContentType = getContentType( rURI.getScheme(), sal_False ); rProps.bIsDocument = sal_True; rProps.bIsFolder = sal_False; } diff --git a/ucb/source/ucp/package/pkgcontent.hxx b/ucb/source/ucp/package/pkgcontent.hxx index f04e7ad54fd5..1886d72470ae 100644 --- a/ucb/source/ucp/package/pkgcontent.hxx +++ b/ucb/source/ucp/package/pkgcontent.hxx @@ -98,6 +98,9 @@ struct ContentProperties bHasEncryptedEntries( sal_False ) {} ContentProperties( const ::rtl::OUString& rContentType ); + + com::sun::star::uno::Sequence< com::sun::star::ucb::ContentInfo > + getCreatableContentsInfo( PackageUri const & rUri ) const; }; //========================================================================= @@ -190,10 +193,6 @@ private: com::sun::star::container::XHierarchicalNameAccess > & rxPackage ); - static ::rtl::OUString - GetContentType( const ::rtl::OUString& aScheme, - sal_Bool bFolder ); - sal_Bool hasData( const PackageUri& rURI ); sal_Bool @@ -329,6 +328,9 @@ public: ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > getIterator(); + + static ::rtl::OUString + getContentType( const ::rtl::OUString& aScheme, sal_Bool bFolder ); }; } diff --git a/ucb/source/ucp/package/pkgcontentcaps.cxx b/ucb/source/ucp/package/pkgcontentcaps.cxx index 0538d93f8702..b2ae1951fb37 100644 --- a/ucb/source/ucp/package/pkgcontentcaps.cxx +++ b/ucb/source/ucp/package/pkgcontentcaps.cxx @@ -45,6 +45,7 @@ MediaType (w) (w) w Title r w w Size - - r + CreatableContentsInfo r r r Compressed - - w Encrypted - - w HasEncryptedEntries r - - @@ -58,6 +59,7 @@ open x x x transfer x x - flush x x - + createNewContent x x - *************************************************************************/ #include @@ -78,6 +80,12 @@ using namespace package_ucp; // //========================================================================= +#define MAKEPROPSEQUENCE( a ) \ + uno::Sequence< beans::Property >( a, sizeof( a ) / sizeof( a[ 0 ] ) ) + +#define MAKECMDSEQUENCE( a ) \ + uno::Sequence< ucb::CommandInfo >( a, sizeof( a ) / sizeof( a[ 0 ] ) ) + //========================================================================= // // IMPORTENT: If any property data ( name / type / ... ) are changed, then @@ -145,6 +153,15 @@ uno::Sequence< beans::Property > Content::getProperties( getCppuType( static_cast< const rtl::OUString * >( 0 ) ), beans::PropertyAttribute::BOUND ), + beans::Property( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "CreatableContentsInfo" ) ), + -1, + getCppuType( static_cast< + const uno::Sequence< ucb::ContentInfo > * >( 0 ) ), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::READONLY + ), /////////////////////////////////////////////////////////////// // New properties /////////////////////////////////////////////////////////////// @@ -157,8 +174,7 @@ uno::Sequence< beans::Property > Content::getProperties( | beans::PropertyAttribute::READONLY ) }; - return uno::Sequence< beans::Property >( - aRootFolderPropertyInfoTable, 6 ); + return MAKEPROPSEQUENCE( aRootFolderPropertyInfoTable ); } else { @@ -210,13 +226,21 @@ uno::Sequence< beans::Property > Content::getProperties( -1, getCppuType( static_cast< const rtl::OUString * >( 0 ) ), beans::PropertyAttribute::BOUND + ), + beans::Property( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "CreatableContentsInfo" ) ), + -1, + getCppuType( static_cast< + const uno::Sequence< ucb::ContentInfo > * >( 0 ) ), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::READONLY ) /////////////////////////////////////////////////////////////// // New properties /////////////////////////////////////////////////////////////// }; - return uno::Sequence< beans::Property >( - aFolderPropertyInfoTable, 5 ); + return MAKEPROPSEQUENCE( aFolderPropertyInfoTable ); } } else @@ -275,6 +299,15 @@ uno::Sequence< beans::Property > Content::getProperties( beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), + beans::Property( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "CreatableContentsInfo" ) ), + -1, + getCppuType( static_cast< + const uno::Sequence< ucb::ContentInfo > * >( 0 ) ), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::READONLY + ), /////////////////////////////////////////////////////////////// // New properties /////////////////////////////////////////////////////////////// @@ -291,7 +324,7 @@ uno::Sequence< beans::Property > Content::getProperties( beans::PropertyAttribute::BOUND ) }; - return uno::Sequence< beans::Property >( aStreamPropertyInfoTable, 8 ); + return MAKEPROPSEQUENCE( aStreamPropertyInfoTable ); } } @@ -360,6 +393,12 @@ uno::Sequence< ucb::CommandInfo > Content::getCommands( getCppuType( static_cast< ucb::TransferInfo * >( 0 ) ) ), + ucb::CommandInfo( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "createNewContent" ) ), + -1, + getCppuType( static_cast< ucb::ContentInfo * >( 0 ) ) + ), /////////////////////////////////////////////////////////// // New commands /////////////////////////////////////////////////////////// @@ -370,8 +409,7 @@ uno::Sequence< ucb::CommandInfo > Content::getCommands( ) }; - return uno::Sequence< - ucb::CommandInfo >( aRootFolderCommandInfoTable, 7 ); + return MAKECMDSEQUENCE( aRootFolderCommandInfoTable ); } else { @@ -439,6 +477,12 @@ uno::Sequence< ucb::CommandInfo > Content::getCommands( getCppuType( static_cast< ucb::TransferInfo * >( 0 ) ) ), + ucb::CommandInfo( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "createNewContent" ) ), + -1, + getCppuType( static_cast< ucb::ContentInfo * >( 0 ) ) + ), /////////////////////////////////////////////////////////// // New commands /////////////////////////////////////////////////////////// @@ -449,8 +493,7 @@ uno::Sequence< ucb::CommandInfo > Content::getCommands( ) }; - return uno::Sequence< - ucb::CommandInfo >( aFolderCommandInfoTable, 9 ); + return MAKECMDSEQUENCE( aFolderCommandInfoTable ); } } else @@ -517,8 +560,6 @@ uno::Sequence< ucb::CommandInfo > Content::getCommands( /////////////////////////////////////////////////////////////// }; - return uno::Sequence< ucb::CommandInfo >( - aStreamCommandInfoTable, 7 ); + return MAKECMDSEQUENCE( aStreamCommandInfoTable ); } } - diff --git a/ucb/source/ucp/tdoc/tdoc_content.cxx b/ucb/source/ucp/tdoc/tdoc_content.cxx index 2f940e9715c9..52d5e917bdb9 100644 --- a/ucb/source/ucp/tdoc/tdoc_content.cxx +++ b/ucb/source/ucp/tdoc/tdoc_content.cxx @@ -226,7 +226,7 @@ uno::Any SAL_CALL Content::queryInterface( const uno::Type & rType ) rType, static_cast< ucb::XContentCreator * >( this ) ); if ( aRet.hasValue() ) { - if ( !isContentCreator() ) + if ( !m_aProps.isContentCreator() ) return uno::Any(); } } @@ -249,7 +249,7 @@ uno::Sequence< uno::Type > SAL_CALL Content::getTypes() { cppu::OTypeCollection * pCollection = 0; - if ( isContentCreator() ) + if ( m_aProps.isContentCreator() ) { static cppu::OTypeCollection* pFolderTypes = 0; @@ -660,6 +660,49 @@ uno::Any SAL_CALL Content::execute( transfer( aInfo, Environment ); } + else if ( aCommand.Name.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM( "createNewContent" ) ) ) + { + ////////////////////////////////////////////////////////////////// + // createNewContent ( Supported by document and folders only ) + ////////////////////////////////////////////////////////////////// + + { + osl::MutexGuard aGuard( m_aMutex ); + + ContentType eType = m_aProps.getType(); + if ( ( eType != FOLDER ) && ( eType != DOCUMENT ) ) + { + ucbhelper::cancelCommandExecution( + uno::makeAny( ucb::UnsupportedCommandException( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + "createNewContent command only " + "supported by folders and " + "documents!" ) ), + static_cast< cppu::OWeakObject * >( + this ) ) ), + Environment ); + // Unreachable + } + } + + ucb::ContentInfo aInfo; + if ( !( aCommand.Argument >>= aInfo ) ) + { + OSL_ENSURE( sal_False, "Wrong argument type!" ); + ucbhelper::cancelCommandExecution( + uno::makeAny( lang::IllegalArgumentException( + rtl::OUString::createFromAscii( + "Wrong argument type!" ), + static_cast< cppu::OWeakObject * >( this ), + -1 ) ), + Environment ); + // Unreachable + } + + aRet <<= createNewContent( aInfo ); + } else { ////////////////////////////////////////////////////////////////// @@ -695,65 +738,7 @@ uno::Sequence< ucb::ContentInfo > SAL_CALL Content::queryCreatableContentsInfo() throw( uno::RuntimeException ) { - if ( isContentCreator() ) - { - osl::Guard< osl::Mutex > aGuard( m_aMutex ); - - uno::Sequence< beans::Property > aProps( 1 ); - aProps.getArray()[ 0 ] = beans::Property( - rtl::OUString::createFromAscii( "Title" ), - -1, - getCppuType( static_cast< const rtl::OUString * >( 0 ) ), - beans::PropertyAttribute::BOUND ); - -#ifdef NO_STREAM_CREATION_WITHIN_DOCUMENT_ROOT - if ( m_aProps.getType() == DOCUMENT ) - { - // streams cannot be created as direct children of document root - uno::Sequence< ucb::ContentInfo > aSeq( 1 ); - - // Folder. - aSeq.getArray()[ 0 ].Type - = rtl::OUString::createFromAscii( TDOC_FOLDER_CONTENT_TYPE ); - aSeq.getArray()[ 0 ].Attributes - = ucb::ContentInfoAttribute::KIND_FOLDER; - aSeq.getArray()[ 0 ].Properties = aProps; - - return aSeq; - } - else - { -#endif - uno::Sequence< ucb::ContentInfo > aSeq( 2 ); - - // Folder. - aSeq.getArray()[ 0 ].Type - = rtl::OUString::createFromAscii( TDOC_FOLDER_CONTENT_TYPE ); - aSeq.getArray()[ 0 ].Attributes - = ucb::ContentInfoAttribute::KIND_FOLDER; - aSeq.getArray()[ 0 ].Properties = aProps; - - // Stream. - aSeq.getArray()[ 1 ].Type - = rtl::OUString::createFromAscii( TDOC_STREAM_CONTENT_TYPE ); - aSeq.getArray()[ 1 ].Attributes - = ucb::ContentInfoAttribute::INSERT_WITH_INPUTSTREAM - | ucb::ContentInfoAttribute::KIND_DOCUMENT; - aSeq.getArray()[ 1 ].Properties = aProps; - - return aSeq; -#ifdef NO_STREAM_CREATION_WITHIN_DOCUMENT_ROOT - } -#endif - } - else - { - OSL_ENSURE( sal_False, - "queryCreatableContentsInfo called on non-contentcreator " - "object!" ); - - return uno::Sequence< ucb::ContentInfo >( 0 ); - } + return m_aProps.getCreatableContentsInfo(); } //========================================================================= @@ -762,7 +747,7 @@ uno::Reference< ucb::XContent > SAL_CALL Content::createNewContent( const ucb::ContentInfo& Info ) throw( uno::RuntimeException ) { - if ( isContentCreator() ) + if ( m_aProps.isContentCreator() ) { osl::Guard< osl::Mutex > aGuard( m_aMutex ); @@ -1060,6 +1045,12 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( { xRow->appendBoolean( rProp, rData.getIsFolder() ); } + else if ( rProp.Name.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM( "CreatableContentsInfo" ) ) ) + { + xRow->appendObject( + rProp, uno::makeAny( rData.getCreatableContentsInfo() ) ); + } else if ( rProp.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Storage" ) ) ) { @@ -1155,6 +1146,15 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ), rData.getIsFolder() ); + xRow->appendObject( + beans::Property( + rtl::OUString::createFromAscii( "CreatableContentsInfo" ), + -1, + getCppuType( static_cast< + const uno::Sequence< ucb::ContentInfo > * >( 0 ) ), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::READONLY ), + uno::makeAny( rData.getCreatableContentsInfo() ) ); // Storage is only supported by folders. if ( eType == FOLDER ) @@ -1265,6 +1265,15 @@ uno::Sequence< uno::Any > Content::setPropertyValues( "Property is read-only!" ), static_cast< cppu::OWeakObject * >( this ) ); } + else if ( rValue.Name.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM( "CreatableContentsInfo" ) ) ) + { + // Read-only property! + aRet[ n ] <<= lang::IllegalAccessException( + rtl::OUString::createFromAscii( + "Property is read-only!" ), + static_cast< cppu::OWeakObject * >( this ) ); + } else if ( rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Title" ) ) ) { @@ -2369,14 +2378,6 @@ void Content::transfer( } // rInfo.MoveData } -//========================================================================= -bool Content::isContentCreator() -{ - osl::Guard< osl::Mutex > aGuard( m_aMutex ); - return - ( m_aProps.getType() == FOLDER ) || ( m_aProps.getType() == DOCUMENT ); -} - //========================================================================= //static bool Content::hasData( ContentProvider* pProvider, const Uri & rUri ) @@ -3059,3 +3060,79 @@ uno::Reference< io::XStream > Content::getStream( } } } + +//========================================================================= +//========================================================================= +// +// ContentProperties Implementation. +// +//========================================================================= +//========================================================================= + +uno::Sequence< ucb::ContentInfo > +ContentProperties::getCreatableContentsInfo() const +{ + if ( isContentCreator() ) + { + uno::Sequence< beans::Property > aProps( 1 ); + aProps.getArray()[ 0 ] = beans::Property( + rtl::OUString::createFromAscii( "Title" ), + -1, + getCppuType( static_cast< const rtl::OUString * >( 0 ) ), + beans::PropertyAttribute::BOUND ); + +#ifdef NO_STREAM_CREATION_WITHIN_DOCUMENT_ROOT + if ( getType() == DOCUMENT ) + { + // streams cannot be created as direct children of document root + uno::Sequence< ucb::ContentInfo > aSeq( 1 ); + + // Folder. + aSeq.getArray()[ 0 ].Type + = rtl::OUString::createFromAscii( TDOC_FOLDER_CONTENT_TYPE ); + aSeq.getArray()[ 0 ].Attributes + = ucb::ContentInfoAttribute::KIND_FOLDER; + aSeq.getArray()[ 0 ].Properties = aProps; + + return aSeq; + } + else + { +#endif + uno::Sequence< ucb::ContentInfo > aSeq( 2 ); + + // Folder. + aSeq.getArray()[ 0 ].Type + = rtl::OUString::createFromAscii( TDOC_FOLDER_CONTENT_TYPE ); + aSeq.getArray()[ 0 ].Attributes + = ucb::ContentInfoAttribute::KIND_FOLDER; + aSeq.getArray()[ 0 ].Properties = aProps; + + // Stream. + aSeq.getArray()[ 1 ].Type + = rtl::OUString::createFromAscii( TDOC_STREAM_CONTENT_TYPE ); + aSeq.getArray()[ 1 ].Attributes + = ucb::ContentInfoAttribute::INSERT_WITH_INPUTSTREAM + | ucb::ContentInfoAttribute::KIND_DOCUMENT; + aSeq.getArray()[ 1 ].Properties = aProps; + + return aSeq; +#ifdef NO_STREAM_CREATION_WITHIN_DOCUMENT_ROOT + } +#endif + } + else + { + OSL_ENSURE( sal_False, + "getCreatableContentsInfo called on non-contentcreator " + "object!" ); + + return uno::Sequence< ucb::ContentInfo >( 0 ); + } +} + +//========================================================================= +bool ContentProperties::isContentCreator() const +{ + return ( getType() == FOLDER ) || ( getType() == DOCUMENT ); +} diff --git a/ucb/source/ucp/tdoc/tdoc_content.hxx b/ucb/source/ucp/tdoc/tdoc_content.hxx index c994d9911064..4f4d692e676d 100644 --- a/ucb/source/ucp/tdoc/tdoc_content.hxx +++ b/ucb/source/ucp/tdoc/tdoc_content.hxx @@ -43,7 +43,8 @@ namespace com { namespace sun { namespace star { namespace sdbc { class XRow; } namespace io { class XInputStream; class XOutputStream; } namespace beans { struct PropertyValue; } - namespace ucb { struct OpenCommandArgument2; struct TransferInfo; } + namespace ucb { struct OpenCommandArgument2; struct TransferInfo; + struct ContentInfo; } } } } namespace tdoc_ucp @@ -94,6 +95,11 @@ public: const rtl::OUString & getTitle() const { return m_aTitle; } void setTitle( const rtl::OUString & rTitle ) { m_aTitle = rTitle; } + com::sun::star::uno::Sequence< com::sun::star::ucb::ContentInfo > + getCreatableContentsInfo() const; + + bool isContentCreator() const; + private: ContentType m_eType; rtl::OUString m_aContentType; @@ -137,8 +143,6 @@ private: com::sun::star::ucb::XCommandEnvironment > & xEnv ); virtual ::rtl::OUString getParentURL(); - bool isContentCreator(); - static bool hasData( ContentProvider* pProvider, const Uri & rUri ); bool hasData( const Uri & rUri ) { return hasData( m_pProvider, rUri ); } diff --git a/ucb/source/ucp/tdoc/tdoc_contentcaps.cxx b/ucb/source/ucp/tdoc/tdoc_contentcaps.cxx index 792d693ab194..9d026ce7426b 100644 --- a/ucb/source/ucp/tdoc/tdoc_contentcaps.cxx +++ b/ucb/source/ucp/tdoc/tdoc_contentcaps.cxx @@ -46,6 +46,7 @@ IsDocument r r r r r r IsFolder r r r r r r Title r r w w w w + CreatableContentsInfo r r r r r r Storage - - r r - - DocumentModel - r - - - - @@ -57,6 +58,7 @@ delete - - x - x - open x x x - x - transfer - x x - - - + createNewContent - x x - - - #ifdef NO_STREAM_CREATION_WITHIN_DOCUMENT_ROOT (*) not supported by streams that are direct children of document @@ -88,6 +90,12 @@ using namespace tdoc_ucp; // //========================================================================= +#define MAKEPROPSEQUENCE( a ) \ + uno::Sequence< beans::Property >( a, sizeof( a ) / sizeof( a[ 0 ] ) ) + +#define MAKECMDSEQUENCE( a ) \ + uno::Sequence< ucb::CommandInfo >( a, sizeof( a ) / sizeof( a[ 0 ] ) ) + //========================================================================= // // IMPORTENT: If any property data ( name / type / ... ) are changed, then @@ -142,15 +150,24 @@ uno::Sequence< beans::Property > Content::getProperties( -1, getCppuType( static_cast< const rtl::OUString * >( 0 ) ), beans::PropertyAttribute::BOUND - ) + ), /////////////////////////////////////////////////////////// // Optional standard properties /////////////////////////////////////////////////////////// + beans::Property( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "CreatableContentsInfo" ) ), + -1, + getCppuType( static_cast< + const uno::Sequence< ucb::ContentInfo > * >( 0 ) ), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::READONLY + ) /////////////////////////////////////////////////////////// // New properties /////////////////////////////////////////////////////////// }; - return uno::Sequence< beans::Property >( aStreamPropertyInfoTable, 4 ); + return MAKEPROPSEQUENCE( aStreamPropertyInfoTable ); } else if ( m_aProps.getType() == FOLDER ) { @@ -197,6 +214,15 @@ uno::Sequence< beans::Property > Content::getProperties( /////////////////////////////////////////////////////////// // Optional standard properties /////////////////////////////////////////////////////////// + beans::Property( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "CreatableContentsInfo" ) ), + -1, + getCppuType( static_cast< + const uno::Sequence< ucb::ContentInfo > * >( 0 ) ), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::READONLY + ), /////////////////////////////////////////////////////////// // New properties /////////////////////////////////////////////////////////// @@ -209,7 +235,7 @@ uno::Sequence< beans::Property > Content::getProperties( | beans::PropertyAttribute::READONLY ) }; - return uno::Sequence< beans::Property >( aFolderPropertyInfoTable, 5 ); + return MAKEPROPSEQUENCE( aFolderPropertyInfoTable ); } else if ( m_aProps.getType() == DOCUMENT ) { @@ -257,6 +283,15 @@ uno::Sequence< beans::Property > Content::getProperties( /////////////////////////////////////////////////////////// // Optional standard properties /////////////////////////////////////////////////////////// + beans::Property( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "CreatableContentsInfo" ) ), + -1, + getCppuType( static_cast< + const uno::Sequence< ucb::ContentInfo > * >( 0 ) ), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::READONLY + ), /////////////////////////////////////////////////////////// // New properties /////////////////////////////////////////////////////////// @@ -269,7 +304,7 @@ uno::Sequence< beans::Property > Content::getProperties( | beans::PropertyAttribute::READONLY ) }; - return uno::Sequence< beans::Property >( aDocPropertyInfoTable, 5 ); + return MAKEPROPSEQUENCE( aDocPropertyInfoTable ); } else { @@ -313,15 +348,24 @@ uno::Sequence< beans::Property > Content::getProperties( getCppuType( static_cast< const rtl::OUString * >( 0 ) ), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY - ) + ), /////////////////////////////////////////////////////////////// // Optional standard properties /////////////////////////////////////////////////////////////// + beans::Property( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "CreatableContentsInfo" ) ), + -1, + getCppuType( static_cast< + const uno::Sequence< ucb::ContentInfo > * >( 0 ) ), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::READONLY + ) /////////////////////////////////////////////////////////////// // New properties /////////////////////////////////////////////////////////////// }; - return uno::Sequence< beans::Property >( aRootPropertyInfoTable, 4 ); + return MAKEPROPSEQUENCE( aRootPropertyInfoTable ); } } @@ -396,8 +440,7 @@ uno::Sequence< ucb::CommandInfo > Content::getCommands( // New commands /////////////////////////////////////////////////////////// }; - return uno::Sequence< - ucb::CommandInfo >( aStreamCommandInfoTable1, 6 ); + return MAKECMDSEQUENCE( aStreamCommandInfoTable1 ); } #endif //================================================================= @@ -461,8 +504,7 @@ uno::Sequence< ucb::CommandInfo > Content::getCommands( // New commands /////////////////////////////////////////////////////////// }; - return uno::Sequence< - ucb::CommandInfo >( aStreamCommandInfoTable, 7 ); + return MAKECMDSEQUENCE( aStreamCommandInfoTable ); } else if ( m_aProps.getType() == FOLDER ) { @@ -527,13 +569,18 @@ uno::Sequence< ucb::CommandInfo > Content::getCommands( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "transfer" ) ), -1, getCppuType( static_cast< ucb::TransferInfo * >( 0 ) ) + ), + ucb::CommandInfo( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "createNewContent" ) ), + -1, + getCppuType( static_cast< ucb::ContentInfo * >( 0 ) ) ) /////////////////////////////////////////////////////////// // New commands /////////////////////////////////////////////////////////// }; - return uno::Sequence< - ucb::CommandInfo >( aFolderCommandInfoTable, 8 ); + return MAKECMDSEQUENCE( aFolderCommandInfoTable ); } else if ( m_aProps.getType() == DOCUMENT ) { @@ -588,13 +635,18 @@ uno::Sequence< ucb::CommandInfo > Content::getCommands( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "transfer" ) ), -1, getCppuType( static_cast< ucb::TransferInfo * >( 0 ) ) + ), + ucb::CommandInfo( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "createNewContent" ) ), + -1, + getCppuType( static_cast< ucb::ContentInfo * >( 0 ) ) ) /////////////////////////////////////////////////////////// // New commands /////////////////////////////////////////////////////////// }; - return uno::Sequence< - ucb::CommandInfo >( aDocCommandInfoTable, 6 ); + return MAKECMDSEQUENCE( aDocCommandInfoTable ); } else { @@ -651,7 +703,6 @@ uno::Sequence< ucb::CommandInfo > Content::getCommands( // New commands /////////////////////////////////////////////////////////// }; - return uno::Sequence< - ucb::CommandInfo >( aRootCommandInfoTable, 5 ); + return MAKECMDSEQUENCE( aRootCommandInfoTable ); } } diff --git a/ucb/source/ucp/webdav/webdavcontent.cxx b/ucb/source/ucp/webdav/webdavcontent.cxx index 7adaa88585b3..def33876eb43 100644 --- a/ucb/source/ucp/webdav/webdavcontent.cxx +++ b/ucb/source/ucp/webdav/webdavcontent.cxx @@ -641,6 +641,29 @@ uno::Any SAL_CALL Content::execute( unlock( Environment ); } + else if ( aCommand.Name.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM( "createNewContent" ) ) && + isFolder( Environment ) ) + { + ////////////////////////////////////////////////////////////////// + // createNewContent + ////////////////////////////////////////////////////////////////// + + ucb::ContentInfo aArg; + if ( !( aCommand.Argument >>= aArg ) ) + { + ucbhelper::cancelCommandExecution( + uno::makeAny( lang::IllegalArgumentException( + rtl::OUString::createFromAscii( + "Wrong argument type!" ), + static_cast< cppu::OWeakObject * >( this ), + -1 ) ), + Environment ); + // Unreachable + } + + aRet = uno::makeAny( createNewContent( aArg ) ); + } else { ////////////////////////////////////////////////////////////////// @@ -1165,8 +1188,8 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( std::auto_ptr< DAVResourceAccess > xResAccess; rtl::OUString aEscapedTitle; bool bHasAll = false; - uno::Reference< lang::XMultiServiceFactory > xSMgr; - uno::Reference< ucb::XContentIdentifier > xIdentifier; + uno::Reference< lang::XMultiServiceFactory > xSMgr; + uno::Reference< ucb::XContentIdentifier > xIdentifier; rtl::Reference< ::ucbhelper::ContentProviderImplHelper > xProvider; { @@ -1413,14 +1436,35 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( m_bCollection ) ); } - // Add BaseURI property, if requested. - if ( !xProps->contains( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "BaseURI" ) ) ) ) + sal_Int32 nCount = rProperties.getLength(); + for ( sal_Int32 n = 0; n < nCount; ++n ) { - xProps->addProperty( - rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "BaseURI" ) ), - uno::makeAny( getBaseURI( xResAccess ) ), - true ); + const rtl::OUString rName = rProperties[ n ].Name; + if ( rName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM( "BaseURI" ) ) ) + { + // Add BaseURI property, if requested. + xProps->addProperty( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "BaseURI" ) ), + uno::makeAny( getBaseURI( xResAccess ) ), + true ); + } + else if ( rName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM( "CreatableContentsInfo" ) ) ) + { + // Add CreatableContentsInfo property, if requested. + sal_Bool bFolder = sal_False; + xProps->getValue( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsFolder" ) ) ) + >>= bFolder; + xProps->addProperty( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "CreatableContentsInfo" ) ), + uno::makeAny( bFolder + ? queryCreatableContentsInfo() + : uno::Sequence< ucb::ContentInfo >() ), + true ); + } } uno::Reference< sdbc::XRow > xResultRow @@ -1653,6 +1697,15 @@ uno::Sequence< uno::Any > Content::setPropertyValues( "Property is read-only!" ), static_cast< cppu::OWeakObject * >( this ) ); } + if ( rName.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM( "CreatableContentsInfo" ) ) ) + { + // Read-only property! + aRet[ n ] <<= lang::IllegalAccessException( + rtl::OUString::createFromAscii( + "Property is read-only!" ), + static_cast< cppu::OWeakObject * >( this ) ); + } else { if ( getResourceType( xEnv, xResAccess ) == DAV ) diff --git a/ucb/source/ucp/webdav/webdavcontentcaps.cxx b/ucb/source/ucp/webdav/webdavcontentcaps.cxx index cda93cfd855e..7f3c20eb0840 100644 --- a/ucb/source/ucp/webdav/webdavcontentcaps.cxx +++ b/ucb/source/ucp/webdav/webdavcontentcaps.cxx @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -156,6 +157,16 @@ bool ContentProvider::getProperty( beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY ) ); + m_pProps->insert( + beans::Property( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "CreatableContentsInfo" ) ), + -1, + getCppuType( static_cast< + const uno::Sequence< ucb::ContentInfo > * >( 0 ) ), + beans::PropertyAttribute::BOUND + | beans::PropertyAttribute::READONLY ) ); + // Standard DAV properties. m_pProps->insert( @@ -348,6 +359,7 @@ uno::Sequence< beans::Property > Content::getProperties( sal_Bool bHasDateModified = sal_False; sal_Bool bHasMediaType = sal_False; sal_Bool bHasSize = sal_False; + sal_Bool bHasCreatableInfos = sal_False; { std::set< rtl::OUString >::const_iterator it = aPropSet.begin(); @@ -428,7 +440,13 @@ uno::Sequence< beans::Property > Content::getProperties( { bHasSize = sal_True; } - + else if ( !bHasCreatableInfos && + (*it).equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM( + "CreatableContentsInfo" ) ) ) + { + bHasCreatableInfos = sal_True; + } it++; } } @@ -478,6 +496,11 @@ uno::Sequence< beans::Property > Content::getProperties( aPropSet.insert( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Size" ) ) ); + if ( !bHasCreatableInfos ) + aPropSet.insert( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "CreatableContentsInfo" ) ) ); + // Add cached properties, if present and still missing. if ( xCachedProps.get() ) { @@ -602,7 +625,7 @@ uno::Sequence< ucb::CommandInfo > Content::getCommands( sal_Bool bSupportsLocking = supportsExclusiveWriteLock( xEnv ); sal_Int32 nPos = aCmdInfo.getLength(); - sal_Int32 nMoreCmds = ( bFolder ? 1 : 0 ) + ( bSupportsLocking ? 2 : 0 ); + sal_Int32 nMoreCmds = ( bFolder ? 2 : 0 ) + ( bSupportsLocking ? 2 : 0 ); if ( nMoreCmds ) aCmdInfo.realloc( nPos + nMoreCmds ); else @@ -620,6 +643,13 @@ uno::Sequence< ucb::CommandInfo > Content::getCommands( -1, getCppuType( static_cast< ucb::TransferInfo * >( 0 ) ) ); nPos++; + aCmdInfo[ nPos ] = + ucb::CommandInfo( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "createNewContent" ) ), + -1, + getCppuType( static_cast< ucb::ContentInfo * >( 0 ) ) ); + nPos++; } else { -- cgit v1.2.3 From f62c114209af22c517d245f74f11f1dde02f53cc Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Mon, 21 Dec 2009 15:53:33 +0100 Subject: #i61429#, deprecated css.ucb.XContentCreator, implemented replacement. --- offapi/com/sun/star/ucb/Content.idl | 53 +++++++++++++++++++++++++---- offapi/com/sun/star/ucb/XContentCreator.idl | 13 +++++-- 2 files changed, 56 insertions(+), 10 deletions(-) diff --git a/offapi/com/sun/star/ucb/Content.idl b/offapi/com/sun/star/ucb/Content.idl index 5d363f9d880a..eef4f474e527 100644 --- a/offapi/com/sun/star/ucb/Content.idl +++ b/offapi/com/sun/star/ucb/Content.idl @@ -296,8 +296,8 @@ published service Content void // (1) This command inserts a new content. It commits the process of - // creating a new content via calling another content's method - // XContentCreator::createNewContent + // creating a new content via executing the command "createNewContent" + // and initializing it via setting properties, afterwards. // The command is not called on the content which created the new // content, because the new object already knows where it is to be // inserted (i.e. Calling createNewContent with the content type for a @@ -350,7 +350,7 @@ published service Content // Transfers without the transfer command can be done as follows: // // 1) Create a new content at the target folder - // --> targetContent = target.XContentCreator::createNewContent(...) + // --> targetContent = target.execute( "createNewContent", type ) // 2) Transfer data from source to target content // --> props = sourceContent.execute( "getPropertyValues", ... ) // --> dataStream = sourceContent.execute( "open", ... ) @@ -387,12 +387,36 @@ published service Content // Note that InteractiveLockingLockExpiredException might // be raised by any command that requires a previously obtained lock. + // This command creates a new non-persistent content of a given type. + // + //

Creation of a new (persistent) content: + //

    + //
  1. creatabletypes = obtain "CreatableContentsInfo" property
    + // from creator + //
  2. choose a suitable type from creatabletypes + //
  3. newObject = execute command "createNewContent(type)" at
    + // creator + //
  4. initialize the new object (i.e. newObject.Property1 = ...) + //
  5. execute command "insert" at new content. This command + // commits the data and makes the new content persistent. + //
+ // + // This command must be supported by every Content that supports the + // property "CreatableContentsInfo" if the returned property value + // contains a non-empty sequence of creatable types. + // + // Note: This command is part of the replacement for the deprecated + // interface XContentCreator. + XContent > + createNewContent + ContentInfo contentinfo + ======================================================================= Properties: ======================================================================= ----------------------------------------------------------------------- - Requiered properties: + Mandatory properties: ----------------------------------------------------------------------- // contains a unique(!) type string for the content ( i.e. @@ -401,8 +425,8 @@ published service Content // content. Media types may be provided through the optional property // "MediaType". // The value of this property should match the information on creatable - // contents given by UCB contents that implement the interface - // XContentCreator. + // contents given by UCB contents that implement the property + // "CreatableContentsInfo". string ContentType // indicates, whether a content can contain other contents. @@ -591,7 +615,6 @@ published service Content
Show in new task

- string TargetFrames // for contents that are links to other contents, contains the URL of @@ -607,6 +630,17 @@ published service Content // describes a verification policy. VerificationMode VerificationMode + + // contains the types of Contents a Content object can create via + // command "createNewContent". + // + // If the property value can be a non-empty sequence, the Content must + // also support command "createNewContent". + // + // Note: This property is part of the replacement for the deprecated + // interface XContentCreator. + sequence ContentInfo CreatableContentsInfo + */ interface com::sun::star::ucb::XCommandProcessor; @@ -696,6 +730,11 @@ published service Content

This interface is optional. It should be implemented by contents which shall be able to create new objects. + + @deprecated + +

This interface is deprecated. Use property + "CreatableContentsInfo" and command "createNewContent" instead. */ [optional] interface com::sun::star::ucb::XContentCreator; diff --git a/offapi/com/sun/star/ucb/XContentCreator.idl b/offapi/com/sun/star/ucb/XContentCreator.idl index 72b2dd02f6b5..df0c89a1b398 100644 --- a/offapi/com/sun/star/ucb/XContentCreator.idl +++ b/offapi/com/sun/star/ucb/XContentCreator.idl @@ -52,12 +52,19 @@ module com { module sun { module star { module ucb {

Creation of a new (persistent) content:

    -
  1. newObject = creator.createNewContent( ... ) +
  2. creatabletypes = creator.queryCreatableContentsInfo() +
  3. choose a suitable type from creatabletypes +
  4. newObject = creator.createNewContent( type )
  5. initialize the new object (i.e. newObject.Property1 = ...)
  6. let the new content execute the command "insert". That command commits the data and makes the new content persistent.
+ @deprecated + +

This interface is deprecated. Use Content property + "CreatableContentsInfo" and command "createNewContent" instead. + @version 1.0 @author Kai Sommerfeld @see XContent @@ -74,13 +81,13 @@ published interface XContentCreator: com::sun::star::uno::XInterface sequence queryCreatableContentsInfo(); //------------------------------------------------------------------------- - /** creates a new content of given type.. + /** creates a new content of given type. @param Info the content information. @returns - the new content, if operation was succesful. + the new content, if operation was successful. */ com::sun::star::ucb::XContent createNewContent( [in] com::sun::star::ucb::ContentInfo Info ); -- cgit v1.2.3 From 45e8e0fbee40f9a8d91f4c559c8bbb16dd7b3f36 Mon Sep 17 00:00:00 2001 From: sj Date: Mon, 21 Dec 2009 17:44:36 +0100 Subject: impress181: #i87410#: now writing greyscale jpgs if possible --- svtools/source/filter.vcl/jpeg/jpeg.cxx | 39 +++++++++++++++++++++++++++++---- svtools/source/filter.vcl/jpeg/jpeg.h | 2 +- svtools/source/filter.vcl/jpeg/jpegc.c | 14 +++++++++--- 3 files changed, 47 insertions(+), 8 deletions(-) diff --git a/svtools/source/filter.vcl/jpeg/jpeg.cxx b/svtools/source/filter.vcl/jpeg/jpeg.cxx index 81d07ccd5e79..ee2b2baebee0 100644 --- a/svtools/source/filter.vcl/jpeg/jpeg.cxx +++ b/svtools/source/filter.vcl/jpeg/jpeg.cxx @@ -656,10 +656,14 @@ void* JPEGWriter::GetScanline( long nY ) aColor = pAcc->GetPaletteColor( (BYTE) pAcc->GetPixel( nY, nX ) ); #ifndef SYSTEM_JPEG *pTmp++ = aColor.GetBlue(); + if ( bGreys ) + continue; *pTmp++ = aColor.GetGreen(); *pTmp++ = aColor.GetRed(); #else *pTmp++ = aColor.GetRed(); + if ( bGreys ) + continue; *pTmp++ = aColor.GetGreen(); *pTmp++ = aColor.GetBlue(); #endif @@ -672,10 +676,14 @@ void* JPEGWriter::GetScanline( long nY ) aColor = pAcc->GetPixel( nY, nX ); #ifndef SYSTEM_JPEG *pTmp++ = aColor.GetBlue(); + if ( bGreys ) + continue; *pTmp++ = aColor.GetGreen(); *pTmp++ = aColor.GetRed(); #else *pTmp++ = aColor.GetRed(); + if ( bGreys ) + continue; *pTmp++ = aColor.GetGreen(); *pTmp++ = aColor.GetBlue(); #endif @@ -711,20 +719,43 @@ BOOL JPEGWriter::Write( const Graphic& rGraphic ) pAcc = aGraphicBmp.AcquireReadAccess(); + if ( !bGreys ) // bitmap was not explicitely converted into greyscale, + { // check if source is greyscale only + + sal_Bool bIsGrey = sal_True; + + long nWidth = pAcc->Width(); + for ( long nY = 0; bIsGrey && ( nY < pAcc->Height() ); nY++ ) + { + BitmapColor aColor; + for( long nX = 0L; bIsGrey && ( nX < nWidth ); nX++ ) + { + aColor = pAcc->HasPalette() ? pAcc->GetPaletteColor( (BYTE) pAcc->GetPixel( nY, nX ) ) + : pAcc->GetPixel( nY, nX ); + bIsGrey = ( aColor.GetRed() == aColor.GetGreen() ) && ( aColor.GetRed() == aColor.GetBlue() ); + } + } + if ( bIsGrey ) + bGreys = sal_True; + } + if( pAcc ) { + if ( bGreys ) + bNative = ( pAcc->GetScanlineFormat() == BMP_FORMAT_8BIT_PAL ); + else #ifndef SYSTEM_JPEG - bNative = ( pAcc->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_BGR ); + bNative = ( pAcc->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_BGR ); #else - bNative = ( pAcc->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_RGB ); + bNative = ( pAcc->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_RGB ); #endif if( !bNative ) - pBuffer = new BYTE[ AlignedWidth4Bytes( pAcc->Width() * 24L ) ]; + pBuffer = new BYTE[ AlignedWidth4Bytes( bGreys ? pAcc->Width() * 8L : pAcc->Width() * 24L ) ]; JPEGCallbackStruct aCallbackData; aCallbackData.xStatusIndicator = xStatusIndicator; - bRet = (BOOL) WriteJPEG( this, &rOStm, pAcc->Width(), pAcc->Height(), nQuality, &aCallbackData ); + bRet = (BOOL) WriteJPEG( this, &rOStm, pAcc->Width(), pAcc->Height(), bGreys, nQuality, &aCallbackData ); delete[] pBuffer; pBuffer = NULL; diff --git a/svtools/source/filter.vcl/jpeg/jpeg.h b/svtools/source/filter.vcl/jpeg/jpeg.h index eaeaa503b5e9..4d5aafe413bb 100644 --- a/svtools/source/filter.vcl/jpeg/jpeg.h +++ b/svtools/source/filter.vcl/jpeg/jpeg.h @@ -64,7 +64,7 @@ void* JPEGMalloc( size_t size ); void JPEGFree( void *ptr ); long JPEGCallback( void* pCallbackData, long nPercent ); -long WriteJPEG( void* pJPEGWriter, void* pOStm, long nWidth, long nHeight, +long WriteJPEG( void* pJPEGWriter, void* pOStm, long nWidth, long nHeight, long bGreyScale, long nQualityPercent, void* pCallbackData ); void* GetScanline( void* pJPEGWriter, long nY ); diff --git a/svtools/source/filter.vcl/jpeg/jpegc.c b/svtools/source/filter.vcl/jpeg/jpegc.c index 84394d945f79..0525877f2614 100644 --- a/svtools/source/filter.vcl/jpeg/jpegc.c +++ b/svtools/source/filter.vcl/jpeg/jpegc.c @@ -182,7 +182,7 @@ Exit: } long WriteJPEG( void* pJPEGWriter, void* pOStm, - long nWidth, long nHeight, + long nWidth, long nHeight, long bGreys, long nQualityPercent, void* pCallbackData ) { struct jpeg_compress_struct cinfo; @@ -208,8 +208,16 @@ long WriteJPEG( void* pJPEGWriter, void* pOStm, cinfo.image_width = (JDIMENSION) nWidth; cinfo.image_height = (JDIMENSION) nHeight; - cinfo.input_components = 3; - cinfo.in_color_space = JCS_RGB; + if ( bGreys ) + { + cinfo.input_components = 1; + cinfo.in_color_space = JCS_GRAYSCALE; + } + else + { + cinfo.input_components = 3; + cinfo.in_color_space = JCS_RGB; + } jpeg_set_defaults( &cinfo ); jpeg_set_quality( &cinfo, (int) nQualityPercent, FALSE ); -- cgit v1.2.3 From 602bfe95fd059420048a53a8ab11357282d5fcdd Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Tue, 22 Dec 2009 08:41:44 +0100 Subject: windows build breaker due o warning. --- ucb/source/ucp/file/shell.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ucb/source/ucp/file/shell.cxx b/ucb/source/ucp/file/shell.cxx index 487fb75bf652..eaa4140bf841 100644 --- a/ucb/source/ucp/file/shell.cxx +++ b/ucb/source/ucp/file/shell.cxx @@ -2415,6 +2415,10 @@ shell::commit( const shell::ContentMap::iterator& it, it1->setValue( aAny ); } } + else + { + isDirectory = sal_False; + } it1 = properties.find( MyProperty( Size ) ); if( it1 != properties.end() ) -- cgit v1.2.3 From 9465334956ff0847e176174865eda637fec3fa95 Mon Sep 17 00:00:00 2001 From: sj Date: Tue, 22 Dec 2009 18:24:29 +0100 Subject: impress181: #i81457#: office import, fixed a problem with the arc shape --- svx/source/msfilter/msdffimp.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svx/source/msfilter/msdffimp.cxx b/svx/source/msfilter/msdffimp.cxx index e26d258ace6e..00ec0099fba1 100644 --- a/svx/source/msfilter/msdffimp.cxx +++ b/svx/source/msfilter/msdffimp.cxx @@ -5227,7 +5227,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r else { fNumber = 0.0; - seqAdjustmentValues[ 0 ].Value <<= fNumber; + seqAdjustmentValues[ 1 ].Value <<= fNumber; seqAdjustmentValues[ 1 ].State = com::sun::star::beans::PropertyState_DIRECT_VALUE; } -- cgit v1.2.3 From 125d4ada99032bdfa8aade3535007375c7276048 Mon Sep 17 00:00:00 2001 From: Vladimir Glazunov Date: Mon, 28 Dec 2009 16:10:08 +0100 Subject: #i107041# --- solenv/bin/build.pl | 202 +++++++++++++++++++------------------ solenv/bin/modules/SourceConfig.pm | 48 +++++++-- 2 files changed, 141 insertions(+), 109 deletions(-) diff --git a/solenv/bin/build.pl b/solenv/bin/build.pl index cc0677220777..5b4d4622754a 100755 --- a/solenv/bin/build.pl +++ b/solenv/bin/build.pl @@ -118,7 +118,7 @@ $pre_custom_job = ''; $custom_job = ''; $post_custom_job = ''; - %LocalDepsHash = (); + %local_deps_hash = (); %PathHash = (); %PlatformHash = (); %AliveDependencies = (); @@ -185,7 +185,7 @@ $setenv_string = ''; # string for configuration of the client environment $ports_string = ''; # string with possible ports for server @server_ports = (); - $html_port; + $html_port = 0; $server_socket_obj = undef; # socket object for server $html_socket_obj = undef; # socket object for server my %clients_jobs = (); @@ -201,7 +201,6 @@ my %module_paths = (); # hash with absolute module paths my %active_modules = (); my $generate_config = 0; - my $add_modules_to_config = 0; my %add_to_config = (); my %remove_from_config = (); my $clear_config = 0; @@ -385,7 +384,7 @@ sub generate_config_file { $removal_message .= "$1 "; } else { push(@config_content_new, $_); - if (defined $add_to_config{$1}) { + if (defined $add_to_config{$1} && !$prepare) { push(@warnings, "Module $1 already activated in $source_config_file\n"); delete $add_to_config{$1}; } @@ -492,11 +491,12 @@ sub start_html_message_trigger { my $rv; my $full_buffer = ''; my %modules_to_rebuild = (); + my $paddr; while ($rv = sysread(HTML_PIPE, $buffer, $buffer_size)) { $full_buffer .= $buffer; }; if (length $full_buffer) { - print "**********Got message $fullbuffer\n"; + print "**********Got message $full_buffer\n"; socket(SOCKET, PF_INET, SOCK_STREAM, getprotobyname('tcp')) or die "socket: $!"; if (connect(SOCKET, $paddr)) { $full_buffer .= "\n"; @@ -568,8 +568,8 @@ sub schedule_delete { kill 9, keys %{$module_deps_hash_pids{$projects_deps_hash{$_}}}; handle_dead_children(0); }; - RemoveFromDependencies($_, \%global_deps_hash); - RemoveFromDependencies($_, \%global_deps_hash_backup); + remove_from_dependencies($_, \%global_deps_hash); + remove_from_dependencies($_, \%global_deps_hash_backup); delete $reversed_dependencies{$_}; delete $build_is_finished{$_} if defined $build_is_finished{$_}; delete $modules_with_errors{$_} if defined $modules_with_errors{$_}; @@ -618,6 +618,7 @@ sub schedule_rebuild { # sub get_build_list_path { my $module = shift; + return $build_list_paths{$module} if (defined $build_list_paths{$module}); my @possible_dirs = ($module, $module. '.lnk', $module. '.link'); return $build_list_paths{$module} if (defined $build_list_paths{$module}); foreach (@possible_dirs) { @@ -720,19 +721,17 @@ sub build_all { $modules_types{$initial_module} = 'mod'; }; modules_classify(keys %global_deps_hash); - store_weights(\%global_deps_hash); - prepare_build_from(\%global_deps_hash) if ($build_from); + expand_dependencies (\%global_deps_hash); +# prepare_build_from(\%global_deps_hash) if (scalar keys %incompatibles); prepare_incompatible_build(\%global_deps_hash) if ($incompatible); if ($build_all_cont || $build_since) { - print STDERR "There are active module in $source_config_file. Inactive modules will be skipped.\n"; - push (@warnings, "\nThere are active module in $source_config_file. Inactive modules are skipped.\n\n"); prepare_build_all_cont(\%global_deps_hash); }; if ($generate_config) { %add_to_config = %global_deps_hash; generate_config_file(); exit 0; - } elsif (keys %incompatibles) { + } elsif ($incompatible) { my @missing_modules = (); foreach (keys %global_deps_hash) { push(@missing_modules, $_) if (!defined $active_modules{$_}); @@ -741,8 +740,12 @@ sub build_all { print_error("There are modules:\n@missing_modules\n\nthat should be built, but they are not activated. Please, verify your $source_config_file.\n"); }; }; + foreach my $module (%dead_parents) { + remove_from_dependencies($module, \%global_deps_hash); + delete ($global_deps_hash{$module}) if (defined $global_deps_hash{$module}); + }; + store_weights(\%global_deps_hash); backup_deps_hash(\%global_deps_hash, \%global_deps_hash_backup); - expand_dependencies (\%global_deps_hash_backup); reverse_dependensies(\%global_deps_hash_backup); $modules_number = scalar keys %global_deps_hash; initialize_html_info($_) foreach (keys %global_deps_hash); @@ -757,34 +760,34 @@ sub build_all { if (!defined $dead_parents{$Prj}) { if (scalar keys %broken_build) { print $echo . "Skipping project $Prj because of error(s)\n"; - RemoveFromDependencies($Prj, \%global_deps_hash); + remove_from_dependencies($Prj, \%global_deps_hash); $build_is_finished{$Prj}++; next; }; $PrjDir = $module_paths{$Prj}; - get_module_dep_hash($Prj, \%LocalDepsHash); + get_module_dep_hash($Prj, \%local_deps_hash); my $info_hash = $html_info{$Prj}; - $$info_hash{DIRS} = check_deps_hash(\%LocalDepsHash, $Prj); - $module_by_hash{\%LocalDepsHash} = $Prj; - build_dependent(\%LocalDepsHash); + $$info_hash{DIRS} = check_deps_hash(\%local_deps_hash, $Prj); + $module_by_hash{\%local_deps_hash} = $Prj; + build_dependent(\%local_deps_hash); print $check_error_string; }; - RemoveFromDependencies($Prj, \%global_deps_hash); + remove_from_dependencies($Prj, \%global_deps_hash); $build_is_finished{$Prj}++; }; } else { store_build_list_content($initial_module); - get_module_dep_hash($initial_module, \%LocalDepsHash); + get_module_dep_hash($initial_module, \%local_deps_hash); initialize_html_info($initial_module); my $info_hash = $html_info{$initial_module}; - $$info_hash{DIRS} = check_deps_hash(\%LocalDepsHash, $initial_module); - $module_by_hash{\%LocalDepsHash} = $initial_module; + $$info_hash{DIRS} = check_deps_hash(\%local_deps_hash, $initial_module); + $module_by_hash{\%local_deps_hash} = $initial_module; if ($server_mode) { run_server(); } else { - build_dependent(\%LocalDepsHash); + build_dependent(\%local_deps_hash); }; }; }; @@ -811,43 +814,42 @@ sub initialize_html_info { # Do job # sub dmake_dir { - my ($new_BuildDir, $OldBuildDir, $error_code); - my $BuildDir = shift; - $jobs_hash{$BuildDir}->{START_TIME} = time(); - $jobs_hash{$BuildDir}->{STATUS} = 'building'; - if ($BuildDir =~ /(\s)/o && (!-d $BuildDir)) { - print "\n$BuildDir\n\n" if ($BuildDir =~ /\sdeliver$/o); - $error_code = do_custom_job($BuildDir, \%LocalDepsHash); + my ($new_job_name, $error_code); + my $job_name = shift; + $jobs_hash{$job_name}->{START_TIME} = time(); + $jobs_hash{$job_name}->{STATUS} = 'building'; + if ($job_name =~ /(\s)/o && (!-d $job_name)) { + $error_code = do_custom_job($job_name, \%local_deps_hash); } else { - html_store_job_info(\%LocalDepsHash, $BuildDir); - print_error("$BuildDir not found!!\n") if (!-d $BuildDir); - if (!-d $BuildDir) { - $new_BuildDir = $BuildDir; - $new_BuildDir =~ s/_simple//g; - if ((-d $new_BuildDir)) { - print("\nTrying $new_BuildDir, $BuildDir not found!!\n"); - $BuildDir = $new_BuildDir; + html_store_job_info(\%local_deps_hash, $job_name); + print_error("$job_name not found!!\n") if (!-d $job_name); + if (!-d $job_name) { + $new_job_name = $job_name; + $new_job_name =~ s/_simple//g; + if ((-d $new_job_name)) { + print("\nTrying $new_job_name, $job_name not found!!\n"); + $job_name = $new_job_name; } else { - print_error("\n$BuildDir not found!!\n"); + print_error("\n$job_name not found!!\n"); } } if ($cmd_file) { - print "cd $BuildDir\n"; + print "cd $job_name\n"; print $check_error_string; - print $echo.$BuildDir."\n"; + print $echo.$job_name."\n"; print "$dmake\n"; print $check_error_string; } else { print "\n" if ( ! $show ); - print "Entering $BuildDir\n"; + print "Entering $job_name\n"; }; - RemoveFromDependencies($BuildDir, \%LocalDepsHash) if (!$child); + remove_from_dependencies($job_name, \%local_deps_hash) if (!$child); return if ($cmd_file || $show); - $error_code = run_job($dmake, $BuildDir); - html_store_job_info(\%LocalDepsHash, $BuildDir, $error_code) if (!$child); + $error_code = run_job($dmake, $job_name); + html_store_job_info(\%local_deps_hash, $job_name, $error_code) if (!$child); }; if ($error_code && $ignore) { - push(@ignored_errors, $BuildDir); + push(@ignored_errors, $job_name); $error_code = 0; }; if ($child) { @@ -863,7 +865,7 @@ sub dmake_dir { _exit(0); } elsif ($error_code && ($error_code != -1)) { return $error_code; -# print_error("Error $? occurred while making $BuildDir"); +# print_error("Error $? occurred while making $job_name"); }; }; @@ -1065,7 +1067,7 @@ sub get_deps_hash { foreach my $alias (keys %DeadDependencies) { next if defined $AliveDependencies{$alias}; if (!IsHashNative($alias)) { - RemoveFromDependencies($alias, $dependencies_hash); + remove_from_dependencies($alias, $dependencies_hash); delete $DeadDependencies{$alias}; }; }; @@ -1208,7 +1210,9 @@ sub get_stand_dir { foreach (@possible_build_lists) {# ('build.lst', 'build.xlist'); if (-e $StandDir . '/prj/'.$_) { $initial_module = File::Basename::basename($StandDir); + $build_list_paths{$initial_module} =$StandDir . '/prj/'.$_; $StandDir = File::Basename::dirname($StandDir); + $module_paths{$initial_module} = $StandDir . "/$initial_module"; return $StandDir; } elsif ($StandDir eq $previous_dir) { $ENV{mk_tmp} = ''; @@ -1255,7 +1259,7 @@ sub CheckPlatform { # Remove project to build ahead from dependencies and make an array # of all from given project dependent projects # -sub RemoveFromDependencies { +sub remove_from_dependencies { my ($ExclPrj, $i, $Prj, $Dependencies); $ExclPrj = shift; my $ExclPrj_orig = ''; @@ -1326,7 +1330,7 @@ sub check_deps_hash { CLIENT => '-' }; }; - RemoveFromDependencies($key, \%deps_hash); + remove_from_dependencies($key, \%deps_hash); delete $deps_hash{$key}; $consistent++; }; @@ -1576,7 +1580,6 @@ sub get_options { $arg =~ /^--genconf$/ and $generate_config = 1 and next; if ($arg =~ /^--add$/) { get_list_of_modules(\%add_to_config); - $add_modules_to_config++; next; }; if ($arg =~ /^--remove$/) { @@ -1676,16 +1679,19 @@ sub get_options { }; sub get_module_and_buildlist_paths { - my $source_config = SourceConfig -> new($StandDir); - $source_config_file = $source_config->get_config_file_path(); - $active_modules{$_}++ foreach ($source_config->get_active_modules()); - my %active_modules_copy = %active_modules; - foreach ($source_config->get_all_modules()) { - delete $active_modules_copy{$_} if defined($active_modules_copy{$_}); - $module_paths{$_} = $source_config->get_module_path($_); - $build_list_paths{$_} = $source_config->get_module_build_list($_) - } - $dead_parents{$_}++ foreach (keys %active_modules_copy); + if ($build_all_parents) { + my $source_config = SourceConfig -> new($StandDir); + $source_config_file = $source_config->get_config_file_path(); + $active_modules{$_}++ foreach ($source_config->get_active_modules()); + my %active_modules_copy = %active_modules; + foreach ($source_config->get_all_modules()) { + delete $active_modules_copy{$_} if defined($active_modules_copy{$_}); + next if ($_ eq $initial_module); + $module_paths{$_} = $source_config->get_module_path($_); + $build_list_paths{$_} = $source_config->get_module_build_list($_) + } + $dead_parents{$_}++ foreach (keys %active_modules_copy); + }; }; @@ -1735,7 +1741,7 @@ sub cancel_build { } else { $message_part .= "--all:@broken_modules_names\n"; }; - if ($broken_modules_number) { + if ($broken_modules_number && $build_all_parents) { print "\n"; print $broken_modules_number; print " module(s): "; @@ -1848,7 +1854,7 @@ sub clear_from_child { if (defined $broken_build{$child_nick}) { $error_code = $broken_build{$child_nick}; } else { - RemoveFromDependencies($child_nick, + remove_from_dependencies($child_nick, $folders_hashes{$child_nick}); }; foreach (keys %module_deps_hash_pids) { @@ -2034,12 +2040,12 @@ sub build_actual_queue { delete $$build_queue{$Prj}; next; }; - $started_children =+ build_dependent($projects_deps_hash{$Prj}); + $started_children += build_dependent($projects_deps_hash{$Prj}); if ((!scalar keys %{$projects_deps_hash{$Prj}}) && !$running_children{$projects_deps_hash{$Prj}}) { if (!defined $modules_with_errors{$projects_deps_hash{$Prj}} || $ignore) { - RemoveFromDependencies($Prj, \%global_deps_hash); + remove_from_dependencies($Prj, \%global_deps_hash); $build_is_finished{$Prj}++; delete $$build_queue{$Prj}; $finished_projects++; @@ -2060,10 +2066,8 @@ sub build_actual_queue { sub run_job { my ($job, $path, $registered_name) = @_; my $job_to_do = $job; - if ( $show ) { - print "$job_to_do\n"; - return 0; - } + print "$registered_name\n"; + return 0 if ( $show ); $job_to_do = $deliver_command if ($job eq 'deliver'); $registered_name = $path if (!defined $registered_name); chdir $path; @@ -2095,7 +2099,7 @@ sub do_custom_job { if ($job eq $pre_job) { announce_module($module); # html_store_job_info($dependencies_hash, $job_dir); - RemoveFromDependencies($module_job, $dependencies_hash); + remove_from_dependencies($module_job, $dependencies_hash); } else { $error_code = run_job($job, $module_paths{$module}, $module_job); if ($error_code) { @@ -2108,7 +2112,7 @@ sub do_custom_job { $modules_with_errors{$dependencies_hash}++; $broken_build{$module} = $error_code; } else { - RemoveFromDependencies($module_job, $dependencies_hash); + remove_from_dependencies($module_job, $dependencies_hash); }; }; html_store_job_info($dependencies_hash, $module_job, $error_code); @@ -2349,19 +2353,17 @@ sub fix_permissions { sub prepare_incompatible_build { my ($prj, $deps_hash, @missing_modules); $deps_hash = shift; - foreach (keys %incompatibles) { - my $incomp_prj = $_; - if (!defined $$deps_hash{$_}) { - $incomp_prj .= '.lnk' if ($module_paths{$module} =~ /\.lnk$/); - $incomp_prj .= '.link' if ($module_paths{$module} =~ /\.link$/); + foreach my $module (keys %incompatibles) { + if (!defined $$deps_hash{$module}) { + print_error("The module $initial_module is independent from $module\n"); } - delete $incompatibles{$_}; - $incompatibles{$incomp_prj} = $$deps_hash{$incomp_prj}; - delete $$deps_hash{$incomp_prj}; + delete $incompatibles{$module}; + $incompatibles{$module} = $$deps_hash{$module}; + delete $$deps_hash{$module}; } while ($prj = pick_prj_to_build($deps_hash)) { - RemoveFromDependencies($prj, $deps_hash); - RemoveFromDependencies($prj, \%incompatibles); + remove_from_dependencies($prj, $deps_hash); + remove_from_dependencies($prj, \%incompatibles); }; foreach (keys %incompatibles) { $$deps_hash{$_} = $incompatibles{$_}; @@ -2373,7 +2375,7 @@ sub prepare_incompatible_build { @modules_built = keys %$deps_hash; %add_to_config = %$deps_hash; if ($prepare) { - generate_config_file(); + generate_config_file() if ((!defined $ENV{UPDATER}) || (defined $ENV{CWS_WORK_STAMP})); clear_delivered(); } my $old_output_tree = ''; @@ -2419,16 +2421,16 @@ sub prepare_incompatible_build { # Removes projects which it is not necessary to build # with -with_branches switch # -sub prepare_build_from { - my ($prj, $deps_hash); - $deps_hash = shift; - my %from_deps_hash = (); # hash of dependencies of the -from project - get_parent_deps($build_from_with_branches, \%from_deps_hash); - foreach $prj (keys %from_deps_hash) { - delete $$deps_hash{$prj}; - RemoveFromDependencies($prj, $deps_hash); - }; -}; +#sub prepare_build_from { +# my ($prj, $deps_hash); +# $deps_hash = shift; +# my %from_deps_hash = (); # hash of dependencies of the -from project +# get_parent_deps($build_from_with_branches, \%from_deps_hash); +# foreach $prj (keys %from_deps_hash) { +# delete $$deps_hash{$prj}; +# remove_from_dependencies($prj, $deps_hash); +# }; +#}; # # Removes projects which it is not necessary to build @@ -2445,13 +2447,13 @@ sub prepare_build_all_cont { $orig_prj = $` if ($prj =~ /\.link$/o); if (($border_prj ne $prj) && ($border_prj ne $orig_prj)) { - RemoveFromDependencies($prj, $deps_hash); + remove_from_dependencies($prj, $deps_hash); next; } else { if ($build_all_cont) { $$deps_hash{$prj} = (); } else { - RemoveFromDependencies($prj, $deps_hash); + remove_from_dependencies($prj, $deps_hash); }; return; }; @@ -2605,15 +2607,15 @@ sub clear_delivered { my $undeliver = "$deliver_command $deliver_delete_switches $nul"; # my $current_dir = getcwd(); foreach my $module (sort @modules_built) { - if (!chdir($module_paths{$module})) { - push(@warnings, "Could not remove delivered files from the module $module. Your build can become inconsistent.\n"); - } else { + if (chdir($module_paths{$module})) { print "Removing delivered from module $module\n"; next if ($show); if (system($undeliver)) { $ENV{$_} = $backup_vars{$_} foreach (keys %backup_vars); print_error("Cannot run: $undeliver"); } + } else { + push(@warnings, "Could not remove delivered files from the module $module. Your build can become inconsistent.\n"); }; }; # chdir $current_dir; @@ -3520,9 +3522,9 @@ sub get_job_string { }; } while (!$job_dir); } else { - $dependencies_hash = \%LocalDepsHash; + $dependencies_hash = \%local_deps_hash; do { - $job_dir = pick_prj_to_build(\%LocalDepsHash); + $job_dir = pick_prj_to_build(\%local_deps_hash); if (!$job_dir && !children_number()) { cancel_build() if (scalar keys %broken_build); mp_success_exit(); @@ -3577,7 +3579,7 @@ sub pick_jobdir { if ((!scalar keys %$prj_deps_hash) && !$running_children{$prj_deps_hash}) { if (!defined $modules_with_errors{$prj_deps_hash} || $ignore) { - RemoveFromDependencies($Prj, \%global_deps_hash); + remove_from_dependencies($Prj, \%global_deps_hash); $build_is_finished{$Prj}++; splice (@$build_queue, $i, 1); next; diff --git a/solenv/bin/modules/SourceConfig.pm b/solenv/bin/modules/SourceConfig.pm index e43b1f50a990..31ebb8193ea9 100644 --- a/solenv/bin/modules/SourceConfig.pm +++ b/solenv/bin/modules/SourceConfig.pm @@ -57,12 +57,16 @@ sub new { my $proto = shift; my $class = ref($proto) || $proto; my $source_root = shift; + my $self = {}; + $self->{USER_SOURCE_ROOT} = undef; if (defined $source_root) { + $self->{USER_SOURCE_ROOT} = $source_root; $source_root =~ s/\\|\/$//; + $source_root .= '/..'; } else { - $source_root = $ENV{SOLARSRC}; + $source_root = $ENV{SOURCE_ROOT_DIR}; }; - my $self = {}; + $source_root = Cwd::realpath($source_root); $self->{DEBUG} = 0; $self->{SOURCE_ROOT} = $source_root; $self->{REPOSITORIES} = {}; @@ -72,7 +76,7 @@ sub new { $self->{MODULE_REPOSITORY} = {}; $self->{REAL_MODULES} = {}; $self->{SOURCE_CONFIG_FILE} = get_config_file($source_root); - $self->{SOURCE_CONFIG_DEFAULT} = Cwd::realpath($source_root) .'/'.SOURCE_CONFIG_FILE_NAME; + $self->{SOURCE_CONFIG_DEFAULT} = $source_root .'/'.SOURCE_CONFIG_FILE_NAME; read_config_file($self); bless($self, $class); return $self; @@ -206,18 +210,39 @@ sub get_module_paths { sub get_config_file { my $source_root = shift; - foreach ($source_root, $source_root . '/..') { - if (-f $_ . '/' . SOURCE_CONFIG_FILE_NAME) { - return Cwd::realpath($_) .'/'.SOURCE_CONFIG_FILE_NAME; + my $possible_path = $source_root . '/' . SOURCE_CONFIG_FILE_NAME; + return $possible_path if (-f $possible_path); + return ''; +}; + +sub get_hg_root { + my $hg_root; + if (open(COMMAND, "hg root 2>&1 |")) { + foreach () { + next if (/^Not trusting file/); + chomp; + $hg_root = $_; + last; + }; + close COMMAND; + chomp $hg_root; + if ($hg_root !~ /There is no Mercurial repository here/) { + return $hg_root; }; }; - return ''; + croak('Cannot open find source_config and/or determine hg root directory for ' . cwd()); }; sub read_config_file { my $self = shift; if (!$self->{SOURCE_CONFIG_FILE}) { - ${$self->{REPOSITORIES}}{File::Basename::basename($self->{SOURCE_ROOT})} = $self->{SOURCE_ROOT}; + my $repository_root; + if (defined $self->{USER_SOURCE_ROOT}) { + $repository_root = $self->{USER_SOURCE_ROOT}; + } else { + $repository_root = get_hg_root(); + }; + ${$self->{REPOSITORIES}}{File::Basename::basename($repository_root)} = $repository_root; return; }; my $repository_section = 0; @@ -243,7 +268,7 @@ sub read_config_file { next if (!$repository_section && !$module_section); if (/\s*(\S+)=active\s*(\s+#)*/) { if ($repository_section) { - ${$self->{REPOSITORIES}}{$1} = File::Basename::dirname($self->{SOURCE_ROOT}) . "/$1"; + ${$self->{REPOSITORIES}}{$1} = $self->{SOURCE_ROOT} . "/$1"; next; } if ($module_section) { @@ -254,6 +279,11 @@ sub read_config_file { croak("Line $line in " . $self->{SOURCE_CONFIG_FILE} . 'violates format. Please make your checks!!'); }; close SOURCE_CONFIG_FILE; + if (!scalar keys %{$self->{REPOSITORIES}}) { + # Fallback - default repository is the directory where is our module... + my $hg_root = get_hg_root(); + ${$self->{REPOSITORIES}}{File::Basename::basename($hg_root)} = $hg_root; + }; } else { croak('Cannot open ' . $self->{SOURCE_CONFIG_FILE} . 'for reading'); }; -- cgit v1.2.3 From 4e27c4d83c008af5a9d9bc1b6dd8ed9f2dad25b6 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Mon, 4 Jan 2010 15:03:09 +0100 Subject: clean up merge in copied file --- vcl/inc/vcl/wintypes.hxx | 6 ------ 1 file changed, 6 deletions(-) diff --git a/vcl/inc/vcl/wintypes.hxx b/vcl/inc/vcl/wintypes.hxx index 52484c80eff4..9e84648fb6a8 100644 --- a/vcl/inc/vcl/wintypes.hxx +++ b/vcl/inc/vcl/wintypes.hxx @@ -32,11 +32,5 @@ #include -// -------------------------------------------- -// - prominent place for ListBox window types - -// -------------------------------------------- - -enum ProminentEntry { PROMINENT_TOP, PROMINENT_MIDDLE }; - #endif // _SV_WINTYPES_HXX -- cgit v1.2.3 From 7ef41abc062018776247294bde7e56e2b46489bd Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Mon, 4 Jan 2010 15:08:47 +0100 Subject: fix a merge accident --- vcl/source/gdi/pdfwriter_impl.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 3b0d6fd2cb8d..a220f193945a 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -2817,6 +2817,7 @@ sal_Int32 PDFWriterImpl::emitBuiltinFont( const ImplFontData* pFont, sal_Int32 n } std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitSystemFont( const ImplFontData* pFont, EmbedFont& rEmbed ) +{ std::map< sal_Int32, sal_Int32 > aRet; if( isBuiltinFont( pFont ) ) { -- cgit v1.2.3 From a8dc64c99b23c3e7e73aa13bbde8a6f03f14b6e1 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 4 Jan 2010 15:12:01 +0000 Subject: cmcfixes69: #i106157#: workaround more graphite stl/stlport issues --- vcl/inc/pregraphitestl.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vcl/inc/pregraphitestl.h b/vcl/inc/pregraphitestl.h index 043ae84d0b45..84bede349d4f 100644 --- a/vcl/inc/pregraphitestl.h +++ b/vcl/inc/pregraphitestl.h @@ -12,7 +12,9 @@ # undef _STLP_MAP # define _STLP_DONT_REDEFINE_STD 1 # define _STLP_WHOLE_NATIVE_STD 1 +# pragma GCC visibility push(default) # include _STLP_NATIVE_HEADER(exception_defines.h) +# include _STLP_NATIVE_HEADER(limits) # include _STLP_NATIVE_HEADER(memory) # include _STLP_NATIVE_HEADER(exception) # include _STLP_NATIVE_HEADER(iosfwd) @@ -24,6 +26,7 @@ # include _STLP_NATIVE_HEADER(ostream) # include _STLP_NATIVE_HEADER(istream) # include _STLP_NATIVE_HEADER(iostream) +# pragma GCC visibility pop #endif //sil_std resolves to the std that Graphite was built with namespace sil_std = std; -- cgit v1.2.3 From 5ea66a47f68665b5fd16b02188b85f64db2e3866 Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Tue, 5 Jan 2010 10:42:47 +0100 Subject: fixed compile error on linux --- svtools/source/filter.vcl/wmf/winwmf.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svtools/source/filter.vcl/wmf/winwmf.cxx b/svtools/source/filter.vcl/wmf/winwmf.cxx index 54629383a4f8..f9ae46e98e12 100644 --- a/svtools/source/filter.vcl/wmf/winwmf.cxx +++ b/svtools/source/filter.vcl/wmf/winwmf.cxx @@ -918,7 +918,7 @@ void WMFReader::ReadRecordParams( USHORT nFunc ) } } } - else if ( nNewMagic == 0x43464D57 && nLen >= 34 && ( nLen + 10 <= nRecSize * 2 )) + else if ( (nNewMagic == static_cast< sal_uInt32 >(0x43464D57)) && (nLen >= 34) && ( (sal_Int32)(nLen + 10) <= (sal_Int32)(nRecSize * 2) )) { sal_uInt32 nComType, nVersion, nFlags, nComRecCount, nCurRecSize, nRemainingSize, nEMFTotalSize; -- cgit v1.2.3 From 8a82c9892f39d69d77937f4691c90a079a059bdf Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 5 Jan 2010 11:18:23 +0100 Subject: vcl108: #i107878# reenable accidentally lost environment variable SAL_USE_VCLPLUGIN --- vcl/unx/source/plugadapt/salplug.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vcl/unx/source/plugadapt/salplug.cxx b/vcl/unx/source/plugadapt/salplug.cxx index f1c63b8abee7..08820b2cb7f9 100644 --- a/vcl/unx/source/plugadapt/salplug.cxx +++ b/vcl/unx/source/plugadapt/salplug.cxx @@ -219,8 +219,10 @@ SalInstance *CreateSalInstance() if( !(pUsePlugin && *pUsePlugin) ) pInst = check_headless_plugin(); + else + pInst = tryInstance( OUString::createFromAscii( pUsePlugin ) ); - if( ! pInst && !(pUsePlugin && *pUsePlugin) ) + if( ! pInst ) pInst = autodetect_plugin(); // fallback to gen -- cgit v1.2.3 From 33e343aba54517201820c54ad01a9cf410d1d3c3 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Tue, 5 Jan 2010 13:56:08 +0100 Subject: vcl108: #i107875# fix an assertion with debug stdc++ lib (thanks dtardon) --- vcl/inc/vcl/vclevent.hxx | 5 ++++- vcl/source/app/vclevent.cxx | 3 +-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/vcl/inc/vcl/vclevent.hxx b/vcl/inc/vcl/vclevent.hxx index 74971f62c5a6..19f6ed8a98b9 100644 --- a/vcl/inc/vcl/vclevent.hxx +++ b/vcl/inc/vcl/vclevent.hxx @@ -262,7 +262,10 @@ class VCL_DLLPUBLIC VclEventListeners2 : public vcl::DeletionNotifier std::list< Link >::iterator m_aIt; bool m_bWasInvalidated; - ListenerIt() : m_bWasInvalidated( false ) {} + ListenerIt(const std::list::iterator& rIt) + : m_aIt(rIt) + , m_bWasInvalidated( false ) + {} }; std::vector< ListenerIt > m_aIterators; diff --git a/vcl/source/app/vclevent.cxx b/vcl/source/app/vclevent.cxx index 704d68c5bc7f..66c104da59d5 100644 --- a/vcl/source/app/vclevent.cxx +++ b/vcl/source/app/vclevent.cxx @@ -118,9 +118,8 @@ void VclEventListeners2::callListeners( VclSimpleEvent* i_pEvent ) { vcl::DeletionListener aDel( this ); - m_aIterators.push_back( ListenerIt() ); + m_aIterators.push_back(ListenerIt(m_aListeners.begin())); size_t nIndex = m_aIterators.size() - 1; - m_aIterators[ nIndex ].m_aIt = m_aListeners.begin(); while( ! aDel.isDeleted() && m_aIterators[ nIndex ].m_aIt != m_aListeners.end() ) { m_aIterators[ nIndex ].m_aIt->Call( i_pEvent ); -- cgit v1.2.3 From 8d7d1e352d9030efc94b73e1c1051657926c9153 Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Tue, 5 Jan 2010 15:19:56 +0100 Subject: fixed compile error on linux --- svx/source/items/numitem.cxx | 10 ---------- svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx | 1 - 2 files changed, 11 deletions(-) diff --git a/svx/source/items/numitem.cxx b/svx/source/items/numitem.cxx index 0e0021407e8e..384ead550c9e 100644 --- a/svx/source/items/numitem.cxx +++ b/svx/source/items/numitem.cxx @@ -1182,11 +1182,6 @@ SfxPoolItem* SvxNumBulletItem::Create(SvStream &s, USHORT n) const return SfxPoolItem::Create(s, n ); } -SvStream& SvxNumBulletItem::Store(SvStream & s, USHORT v ) const -{ - return SfxPoolItem::Store( s, v ); -} - /* -----------------27.10.98 10:41------------------- * * --------------------------------------------------*/ @@ -1220,11 +1215,6 @@ SfxPoolItem* SvxNumBulletItem::Clone( SfxItemPool * ) const /* -----------------08.12.98 10:43------------------- * * --------------------------------------------------*/ -SfxPoolItem* SvxNumBulletItem::Create(SvStream &rStream, USHORT) const -{ - SvxNumRule aRule(rStream); - return new SvxNumBulletItem(aRule, Which() ); -} USHORT SvxNumBulletItem::GetVersion( USHORT /*nFileVersion*/ ) const { return NUMITEM_VERSION_03; diff --git a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx index 688c8d938bc5..4bbb5c3331c9 100644 --- a/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrobjcustomshape.cxx @@ -67,7 +67,6 @@ namespace sdr // no need to correct if no extra text range if(aTextRange != aObjectRange) { - const double fExtraTextRotation(GetCustomShapeObj().GetExtraTextRotation()); const GeoStat& rGeoStat(GetCustomShapeObj().GetGeoStat()); // only correct when rotation and/or shear is used -- cgit v1.2.3 From d6e84e058f1bbdc4b774ff30e4f41689e0099bd6 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Tue, 5 Jan 2010 15:50:35 +0100 Subject: whitespace cleanup. --- ucbhelper/inc/ucbhelper/content.hxx | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/ucbhelper/inc/ucbhelper/content.hxx b/ucbhelper/inc/ucbhelper/content.hxx index 03cfa0bc8290..1e8f32107241 100644 --- a/ucbhelper/inc/ucbhelper/content.hxx +++ b/ucbhelper/inc/ucbhelper/content.hxx @@ -106,14 +106,14 @@ class UCBHELPER_DLLPUBLIC Content protected: ::com::sun::star::uno::Any createCursorAny( const ::com::sun::star::uno::Sequence< rtl::OUString >& rPropertyNames, - ResultSetInclude eMode ) + ResultSetInclude eMode ) throw( ::com::sun::star::ucb::CommandAbortedException, ::com::sun::star::uno::RuntimeException, ::com::sun::star::uno::Exception ); ::com::sun::star::uno::Any createCursorAny( const ::com::sun::star::uno::Sequence< sal_Int32 >& rPropertyHandles, - ResultSetInclude eMode ) + ResultSetInclude eMode ) throw( ::com::sun::star::ucb::CommandAbortedException, ::com::sun::star::uno::RuntimeException, ::com::sun::star::uno::Exception ); @@ -148,7 +148,7 @@ public: * errors. */ Content( const ::com::sun::star::uno::Reference< - ::com::sun::star::ucb::XContentIdentifier >& rId, + ::com::sun::star::ucb::XContentIdentifier >& rId, const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >& rEnv ) throw ( ::com::sun::star::ucb::ContentCreationException, @@ -163,7 +163,7 @@ public: * errors. */ Content( const ::com::sun::star::uno::Reference< - ::com::sun::star::ucb::XContent >& rContent, + ::com::sun::star::ucb::XContent >& rContent, const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >& rEnv ) throw ( ::com::sun::star::ucb::ContentCreationException, @@ -221,7 +221,7 @@ public: */ static sal_Bool create( const ::com::sun::star::uno::Reference< - ::com::sun::star::ucb::XContentIdentifier >& rId, + ::com::sun::star::ucb::XContentIdentifier >& rId, const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >& rEnv, Content& rContent ); @@ -241,7 +241,7 @@ public: */ static sal_Bool create( const ::com::sun::star::uno::Reference< - ::com::sun::star::ucb::XContent >& xContent, + ::com::sun::star::ucb::XContent >& xContent, const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >& rEnv, Content& rContent ); @@ -501,7 +501,7 @@ public: setPropertyValues( const ::com::sun::star::uno::Sequence< rtl::OUString >& rPropertyNames, const ::com::sun::star::uno::Sequence< - ::com::sun::star::uno::Any >& rValues ) + ::com::sun::star::uno::Any >& rValues ) throw( ::com::sun::star::ucb::CommandAbortedException, ::com::sun::star::uno::RuntimeException, ::com::sun::star::uno::Exception ); @@ -539,7 +539,7 @@ public: setPropertyValues( const ::com::sun::star::uno::Sequence< sal_Int32 >& nPropertyHandles, const ::com::sun::star::uno::Sequence< - ::com::sun::star::uno::Any >& rValues ) + ::com::sun::star::uno::Any >& rValues ) throw( ::com::sun::star::ucb::CommandAbortedException, ::com::sun::star::uno::RuntimeException, ::com::sun::star::uno::Exception ); @@ -655,8 +655,8 @@ public: ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XDynamicResultSet > createDynamicCursor( const ::com::sun::star::uno::Sequence< rtl::OUString >& rPropertyNames, - ResultSetInclude eMode - = INCLUDE_FOLDERS_AND_DOCUMENTS ) + ResultSetInclude eMode + = INCLUDE_FOLDERS_AND_DOCUMENTS ) throw( ::com::sun::star::ucb::CommandAbortedException, ::com::sun::star::uno::RuntimeException, ::com::sun::star::uno::Exception ); @@ -678,8 +678,8 @@ public: ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XDynamicResultSet > createDynamicCursor( const ::com::sun::star::uno::Sequence< sal_Int32 >& rPropertyHandles, - ResultSetInclude eMode - = INCLUDE_FOLDERS_AND_DOCUMENTS ) + ResultSetInclude eMode + = INCLUDE_FOLDERS_AND_DOCUMENTS ) throw( ::com::sun::star::ucb::CommandAbortedException, ::com::sun::star::uno::RuntimeException, ::com::sun::star::uno::Exception ); @@ -846,9 +846,9 @@ public: sal_Bool insertNewContent( const ::rtl::OUString& rContentType, const ::com::sun::star::uno::Sequence< - rtl::OUString >& rPropertyNames, + rtl::OUString >& rPropertyNames, const ::com::sun::star::uno::Sequence< - ::com::sun::star::uno::Any >& rPropertyValues, + ::com::sun::star::uno::Any >& rPropertyValues, Content& rNewContent ) throw( ::com::sun::star::ucb::CommandAbortedException, ::com::sun::star::uno::RuntimeException, @@ -880,7 +880,7 @@ public: const ::com::sun::star::uno::Sequence< sal_Int32 >& nPropertyHandles, const ::com::sun::star::uno::Sequence< - ::com::sun::star::uno::Any >& rPropertyValues, + ::com::sun::star::uno::Any >& rPropertyValues, Content& rNewContent ) throw( ::com::sun::star::ucb::CommandAbortedException, ::com::sun::star::uno::RuntimeException, @@ -913,9 +913,9 @@ public: sal_Bool insertNewContent( const ::rtl::OUString& rContentType, const ::com::sun::star::uno::Sequence< - rtl::OUString >& rPropertyNames, + rtl::OUString >& rPropertyNames, const ::com::sun::star::uno::Sequence< - ::com::sun::star::uno::Any >& rPropertyValues, + ::com::sun::star::uno::Any >& rPropertyValues, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rStream, Content& rNewContent ) @@ -952,7 +952,7 @@ public: const ::com::sun::star::uno::Sequence< sal_Int32 >& nPropertyHandles, const ::com::sun::star::uno::Sequence< - ::com::sun::star::uno::Any >& rPropertyValues, + ::com::sun::star::uno::Any >& rPropertyValues, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rStream, Content& rNewContent ) -- cgit v1.2.3 From caa8fc85e4757f2cc70a54c8190f995d963eac35 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Tue, 5 Jan 2010 15:57:12 +0100 Subject: whitespace cleanup. --- ucbhelper/source/client/content.cxx | 64 ++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/ucbhelper/source/client/content.cxx b/ucbhelper/source/client/content.cxx index c82a0bc19b77..e3b98ed24d81 100644 --- a/ucbhelper/source/client/content.cxx +++ b/ucbhelper/source/client/content.cxx @@ -149,7 +149,7 @@ void EmptyInputStream::closeInput() //========================================================================= class ContentEventListener_Impl : public cppu::OWeakObject, - public XContentEventListener + public XContentEventListener { Content_Impl& m_rContent; @@ -157,7 +157,7 @@ public: ContentEventListener_Impl( Content_Impl& rContent ) : m_rContent( rContent ) {} - // XInterface + // XInterface XINTERFACE_DECL() // XContentEventListener @@ -184,8 +184,8 @@ friend class ContentEventListener_Impl; mutable rtl::OUString m_aURL; Reference< XMultiServiceFactory > m_xSMgr; Reference< XContent > m_xContent; - Reference< XCommandProcessor > m_xCommandProcessor; - Reference< XCommandEnvironment > m_xEnv; + Reference< XCommandProcessor > m_xCommandProcessor; + Reference< XCommandEnvironment > m_xEnv; Reference< XContentEventListener > m_xContentEventListener; mutable osl::Mutex m_aMutex; sal_Int32 m_nCommandId; @@ -587,7 +587,7 @@ Any Content::getPropertyValue( sal_Int32 nPropertyHandle ) //========================================================================= Any Content::setPropertyValue( const rtl::OUString& rName, - const Any& rValue ) + const Any& rValue ) throw( CommandAbortedException, RuntimeException, Exception ) { Sequence< rtl::OUString > aNames( 1 ); @@ -602,7 +602,7 @@ Any Content::setPropertyValue( const rtl::OUString& rName, //========================================================================= Any Content::setPropertyValue( const sal_Int32 nPropertyHandle, - const Any& rValue ) + const Any& rValue ) throw( CommandAbortedException, RuntimeException, Exception ) { Sequence< sal_Int32 > aHandles( 1 ); @@ -674,8 +674,8 @@ Reference< XRow > Content::getPropertyValuesInterface( rProp.Name = pNames[ n ]; rProp.Handle = -1; // n/a -// rProp.Type = -// rProp.Attributes = ; +// rProp.Type = +// rProp.Attributes = ; } Command aCommand; @@ -707,8 +707,8 @@ Reference< XRow > Content::getPropertyValuesInterface( rProp.Name = rtl::OUString(); // n/a rProp.Handle = pHandles[ n ]; -// rProp.Type = -// rProp.Attributes = ; +// rProp.Type = +// rProp.Attributes = ; } Command aCommand; @@ -726,7 +726,7 @@ Reference< XRow > Content::getPropertyValuesInterface( //========================================================================= Sequence< Any > Content::setPropertyValues( const Sequence< rtl::OUString >& rPropertyNames, - const Sequence< Any >& rValues ) + const Sequence< Any >& rValues ) throw( CommandAbortedException, RuntimeException, Exception ) { if ( rPropertyNames.getLength() != rValues.getLength() ) @@ -756,7 +756,7 @@ Sequence< Any > Content::setPropertyValues( rProp.Name = pNames[ n ]; rProp.Handle = -1; // n/a rProp.Value = pValues[ n ]; -// rProp.State = ; +// rProp.State = ; } Command aCommand; @@ -774,7 +774,7 @@ Sequence< Any > Content::setPropertyValues( //========================================================================= Sequence< Any > Content::setPropertyValues( const Sequence< sal_Int32 >& nPropertyHandles, - const Sequence< Any >& rValues ) + const Sequence< Any >& rValues ) throw( CommandAbortedException, RuntimeException, Exception ) { if ( nPropertyHandles.getLength() != rValues.getLength() ) @@ -804,7 +804,7 @@ Sequence< Any > Content::setPropertyValues( rProp.Name = rtl::OUString(); // n/a rProp.Handle = pHandles[ n ]; rProp.Value = pValues[ n ]; -// rProp.State = ; +// rProp.State = ; } Command aCommand; @@ -934,7 +934,7 @@ Reference< XResultSet > Content::createCursor( OSL_ENSURE( aResult.is(), "Content::createCursor - no cursor!" ); - if ( !aResult.is() ) + if ( !aResult.is() ) { // Former, the open command directly returned a XResultSet. aCursorAny >>= aResult; @@ -964,7 +964,7 @@ Reference< XResultSet > Content::createCursor( OSL_ENSURE( aResult.is(), "Content::createCursor - no cursor!" ); - if ( !aResult.is() ) + if ( !aResult.is() ) { // Former, the open command directly returned a XResultSet. aCursorAny >>= aResult; @@ -1008,7 +1008,7 @@ Reference< XDynamicResultSet > Content::createDynamicCursor( //========================================================================= Reference< XDynamicResultSet > Content::createSortedDynamicCursor( const Sequence< rtl::OUString >& rPropertyNames, - const ::com::sun::star::uno::Sequence< ::com::sun::star::ucb::NumberedSortingInfo >& rSortInfo, + const Sequence< NumberedSortingInfo >& rSortInfo, Reference< XAnyCompareFactory > rAnyCompareFactory, ResultSetInclude eMode ) throw( CommandAbortedException, RuntimeException, Exception ) @@ -1043,7 +1043,7 @@ Reference< XDynamicResultSet > Content::createSortedDynamicCursor( //========================================================================= Reference< XDynamicResultSet > Content::createSortedDynamicCursor( const Sequence< sal_Int32 >& rPropertyHandles, - const ::com::sun::star::uno::Sequence< ::com::sun::star::ucb::NumberedSortingInfo >& rSortInfo, + const Sequence< NumberedSortingInfo >& rSortInfo, Reference< XAnyCompareFactory > rAnyCompareFactory, ResultSetInclude eMode ) throw( CommandAbortedException, RuntimeException, Exception ) @@ -1078,7 +1078,7 @@ Reference< XDynamicResultSet > Content::createSortedDynamicCursor( //========================================================================= Reference< XResultSet > Content::createSortedCursor( const Sequence< rtl::OUString >& rPropertyNames, - const ::com::sun::star::uno::Sequence< ::com::sun::star::ucb::NumberedSortingInfo >& rSortInfo, + const Sequence< NumberedSortingInfo >& rSortInfo, Reference< XAnyCompareFactory > rAnyCompareFactory, ResultSetInclude eMode ) throw( CommandAbortedException, RuntimeException, Exception ) @@ -1132,7 +1132,7 @@ Reference< XResultSet > Content::createSortedCursor( //========================================================================= Reference< XResultSet > Content::createSortedCursor( const Sequence< sal_Int32 >& rPropertyHandles, - const ::com::sun::star::uno::Sequence< ::com::sun::star::ucb::NumberedSortingInfo >& rSortInfo, + const Sequence< NumberedSortingInfo >& rSortInfo, Reference< XAnyCompareFactory > rAnyCompareFactory, ResultSetInclude eMode ) throw( CommandAbortedException, RuntimeException, Exception ) @@ -1331,7 +1331,7 @@ sal_Bool Content::openStream( const Reference< XOutputStream >& rStream ) //========================================================================= void Content::writeStream( const Reference< XInputStream >& rStream, - sal_Bool bReplaceExisting ) + sal_Bool bReplaceExisting ) throw( CommandAbortedException, RuntimeException, Exception ) { InsertCommandArgument aArg; @@ -1352,8 +1352,8 @@ void Content::writeStream( const Reference< XInputStream >& rStream, sal_Bool Content::insertNewContent( const rtl::OUString& rContentType, const Sequence< rtl::OUString >& rPropertyNames, - const Sequence< Any >& rPropertyValues, - Content& rNewContent ) + const Sequence< Any >& rPropertyValues, + Content& rNewContent ) throw( CommandAbortedException, RuntimeException, Exception ) { return insertNewContent( rContentType, @@ -1367,8 +1367,8 @@ sal_Bool Content::insertNewContent( const rtl::OUString& rContentType, sal_Bool Content::insertNewContent( const rtl::OUString& rContentType, const Sequence< sal_Int32 >& nPropertyHandles, - const Sequence< Any >& rPropertyValues, - Content& rNewContent ) + const Sequence< Any >& rPropertyValues, + Content& rNewContent ) throw( CommandAbortedException, RuntimeException, Exception ) { return insertNewContent( rContentType, @@ -1382,9 +1382,9 @@ sal_Bool Content::insertNewContent( const rtl::OUString& rContentType, sal_Bool Content::insertNewContent( const rtl::OUString& rContentType, const Sequence< rtl::OUString >& rPropertyNames, - const Sequence< Any >& rPropertyValues, + const Sequence< Any >& rPropertyValues, const Reference< XInputStream >& rData, - Content& rNewContent ) + Content& rNewContent ) throw( CommandAbortedException, RuntimeException, Exception ) { if ( rContentType.getLength() == 0 ) @@ -1423,9 +1423,9 @@ sal_Bool Content::insertNewContent( const rtl::OUString& rContentType, sal_Bool Content::insertNewContent( const rtl::OUString& rContentType, const Sequence< sal_Int32 >& nPropertyHandles, - const Sequence< Any >& rPropertyValues, + const Sequence< Any >& rPropertyValues, const Reference< XInputStream >& rData, - Content& rNewContent ) + Content& rNewContent ) throw( CommandAbortedException, RuntimeException, Exception ) { if ( rContentType.getLength() == 0 ) @@ -1464,7 +1464,7 @@ sal_Bool Content::insertNewContent( const rtl::OUString& rContentType, sal_Bool Content::transferContent( const Content& rSourceContent, InsertOperation eOperation, const rtl::OUString & rTitle, - const sal_Int32 nNameClashAction ) + const sal_Int32 nNameClashAction ) throw( CommandAbortedException, RuntimeException, Exception ) { ContentBroker* pBroker = ContentBroker::get(); @@ -1578,8 +1578,8 @@ sal_Bool Content::isDocument() //========================================================================= Content_Impl::Content_Impl( const Reference< XMultiServiceFactory >& rSMgr, - const Reference< XContent >& rContent, - const Reference< XCommandEnvironment >& rEnv ) + const Reference< XContent >& rContent, + const Reference< XCommandEnvironment >& rEnv ) : m_xSMgr( rSMgr ), m_xContent( rContent ), m_xEnv( rEnv ), -- cgit v1.2.3 -- cgit v1.2.3 From 4bbfefa5fde9fb5f3941528a54fcdcfac17ca78d Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 5 Jan 2010 16:37:36 +0100 Subject: swunolocking1: #i107171#: fix crash caused by SwXParagraph::attachToText(): register at the text node, not at an uno cursor. --- sw/inc/unoobj.hxx | 2 +- sw/source/core/unocore/unoparagraph.cxx | 7 ++++--- sw/source/core/unocore/unotext.cxx | 24 ++++++++++++++---------- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/sw/inc/unoobj.hxx b/sw/inc/unoobj.hxx index b7a6c54d2bd2..08f5d2308b66 100644 --- a/sw/inc/unoobj.hxx +++ b/sw/inc/unoobj.hxx @@ -1283,7 +1283,7 @@ public: static SwXParagraph* GetImplementation(::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> xRef ); //falls es mal als Service erzeugt werden kann //void attachToRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange)throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); - void attachToText(SwXText* pParent, SwUnoCrsr* pCrsr); + void attachToText(SwXText & rParent, SwTxtNode & rTxtNode); }; /* -----------------23.03.99 12:57------------------- * diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx index fe750469fade..4fbf9a7062d1 100644 --- a/sw/source/core/unocore/unoparagraph.cxx +++ b/sw/source/core/unocore/unoparagraph.cxx @@ -226,14 +226,15 @@ SwXParagraph::~SwXParagraph() /* -----------------------------11.07.00 14:48-------------------------------- ---------------------------------------------------------------------------*/ -void SwXParagraph::attachToText(SwXText* pParent, SwUnoCrsr* pCrsr) +void +SwXParagraph::attachToText(SwXText & rParent, SwTxtNode & rTxtNode) { DBG_ASSERT(m_bIsDescriptor, "Paragraph is not a descriptor"); if(m_bIsDescriptor) { m_bIsDescriptor = FALSE; - pCrsr->Add(this); - xParentText = pParent; + rTxtNode.Add(this); + xParentText = &rParent; if(m_sText.getLength()) { try { setString(m_sText); } diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index 7ae4b209f49f..7bcb064c8ced 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -662,7 +662,7 @@ void SwXText::insertTextContentBefore( SwXTextSection* pXSection = SwXTextSection::GetImplementation( xSuccessor ); SwXTextTable* pXTable = SwXTextTable::GetImplementation(xSuccessor ); SwFrmFmt* pTableFmt = pXTable ? pXTable->GetFrmFmt() : 0; - SwUnoCrsr* pUnoCrsr = 0; + SwTxtNode * pTxtNode = 0; if(pTableFmt && pTableFmt->GetDoc() == GetDoc()) { SwTable* pTable = SwTable::FindTable( pTableFmt ); @@ -671,7 +671,7 @@ void SwXText::insertTextContentBefore( SwNodeIndex aTblIdx( *pTblNode, -1 ); SwPosition aBefore(aTblIdx); bRet = GetDoc()->AppendTxtNode( aBefore ); - pUnoCrsr = GetDoc()->CreateUnoCrsr( aBefore, FALSE); + pTxtNode = aBefore.nNode.GetNode().GetTxtNode(); } else if(pXSection && pXSection->GetFmt() && @@ -683,13 +683,15 @@ void SwXText::insertTextContentBefore( SwNodeIndex aSectIdx( *pSectNode, -1 ); SwPosition aBefore(aSectIdx); bRet = GetDoc()->AppendTxtNode( aBefore ); - pUnoCrsr = GetDoc()->CreateUnoCrsr( aBefore, FALSE); + pTxtNode = aBefore.nNode.GetNode().GetTxtNode(); } - if(!bRet) + if (!bRet || !pTxtNode) + { throw lang::IllegalArgumentException(); + } else { - pPara->attachToText(this, pUnoCrsr); + pPara->attachToText(*this, *pTxtNode); } } @@ -708,11 +710,11 @@ void SwXText::insertTextContentAfter( if(!pPara || !pPara->IsDescriptor() || !xPredecessor.is()) throw lang::IllegalArgumentException(); - SwUnoCrsr* pUnoCrsr = 0; SwXTextSection* pXSection = SwXTextSection::GetImplementation( xPredecessor ); SwXTextTable* pXTable = SwXTextTable::GetImplementation(xPredecessor ); SwFrmFmt* pTableFmt = pXTable ? pXTable->GetFrmFmt() : 0; sal_Bool bRet = sal_False; + SwTxtNode * pTxtNode = 0; if(pTableFmt && pTableFmt->GetDoc() == GetDoc()) { SwTable* pTable = SwTable::FindTable( pTableFmt ); @@ -721,7 +723,7 @@ void SwXText::insertTextContentAfter( SwEndNode* pTableEnd = pTblNode->EndOfSectionNode(); SwPosition aTableEnd(*pTableEnd); bRet = GetDoc()->AppendTxtNode( aTableEnd ); - pUnoCrsr = GetDoc()->CreateUnoCrsr( aTableEnd, FALSE); + pTxtNode = aTableEnd.nNode.GetNode().GetTxtNode(); } else if(pXSection && pXSection->GetFmt() && @@ -732,13 +734,15 @@ void SwXText::insertTextContentAfter( SwEndNode* pEnd = pSectNode->EndOfSectionNode(); SwPosition aEnd(*pEnd); bRet = GetDoc()->AppendTxtNode( aEnd ); - pUnoCrsr = GetDoc()->CreateUnoCrsr( aEnd, FALSE); + pTxtNode = aEnd.nNode.GetNode().GetTxtNode(); } - if(!bRet) + if (!bRet || !pTxtNode) + { throw lang::IllegalArgumentException(); + } else { - pPara->attachToText(this, pUnoCrsr); + pPara->attachToText(*this, *pTxtNode); } } /* -----------------------------10.07.00 15:40-------------------------------- -- cgit v1.2.3 From c941bb6a756a79a5c0ae1d903cc50399d8200812 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 5 Jan 2010 16:37:36 +0100 Subject: swunolocking1: #i106930#: thints.cxx: tweak isNestedAny() a bit with the fix for i106930, inserting a nesting hint without extent never overrides an existing hint; but overriding is actually desirable in the corner case where the existing hint is _also_ empty. [the unoapi test sw.SwXTextTableCursor relies on this] --- sw/source/core/txtnode/thints.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx index 1222d6f2eeed..81a3b629f402 100644 --- a/sw/source/core/txtnode/thints.cxx +++ b/sw/source/core/txtnode/thints.cxx @@ -159,7 +159,8 @@ bool isNestedAny(const xub_StrLen nStart1, const xub_StrLen nEnd1, const xub_StrLen nStart2, const xub_StrLen nEnd2) { return ((nStart1 == nStart2) || (nEnd1 == nEnd2)) - ? (nStart1 != nEnd1) // same start/end: nested except if hint1 empty + // same start/end: nested except if hint1 empty and hint2 not empty + ? (nStart1 != nEnd1) || (nStart2 == nEnd2) : ((nStart1 < nStart2) ? (nEnd1 >= nEnd2) : (nEnd1 <= nEnd2)); } -- cgit v1.2.3 From 733b831970204059b9d89eff203551d6d3bf4bbe Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 5 Jan 2010 16:37:41 +0100 Subject: swunolocking1: swtypes.hxx: rename frame anchor types enum RndStdIds: rename frame anchor types (FLY_*) to be more intuitive. [note the completely ridiculous number of files that care about anchor types] --- sw/inc/dcontact.hxx | 10 +-- sw/inc/fmtanchr.hxx | 4 +- sw/inc/swtypes.hxx | 10 +-- sw/source/core/access/accframe.cxx | 6 +- sw/source/core/access/accfrmobj.cxx | 6 +- sw/source/core/doc/doc.cxx | 4 +- sw/source/core/doc/docbm.cxx | 33 +++++--- sw/source/core/doc/docdraw.cxx | 10 +-- sw/source/core/doc/docedt.cxx | 38 ++++----- sw/source/core/doc/docfly.cxx | 52 ++++++------ sw/source/core/doc/docglbl.cxx | 22 +++-- sw/source/core/doc/doclay.cxx | 98 ++++++++++++---------- sw/source/core/doc/docnew.cxx | 2 +- sw/source/core/doc/docsort.cxx | 19 ++--- sw/source/core/doc/poolfmt.cxx | 18 ++-- sw/source/core/doc/tblcpy.cxx | 12 +-- sw/source/core/docnode/ndcopy.cxx | 47 +++++------ sw/source/core/docnode/ndtbl.cxx | 19 +++-- sw/source/core/docnode/node.cxx | 6 +- sw/source/core/docnode/swbaslnk.cxx | 30 +++---- sw/source/core/draw/dcontact.cxx | 26 ++---- sw/source/core/draw/dview.cxx | 14 ++-- sw/source/core/edit/autofmt.cxx | 2 +- sw/source/core/fields/expfld.cxx | 15 ++-- sw/source/core/frmedt/fecopy.cxx | 73 ++++++++-------- sw/source/core/frmedt/fefly1.cxx | 84 +++++++++++-------- sw/source/core/frmedt/feshview.cxx | 24 +++--- sw/source/core/frmedt/fews.cxx | 18 ++-- sw/source/core/frmedt/tblsel.cxx | 9 +- sw/source/core/inc/flyfrm.hxx | 8 +- sw/source/core/layout/anchoreddrawobject.cxx | 16 ++-- sw/source/core/layout/anchoredobject.cxx | 12 +-- sw/source/core/layout/atrfrm.cxx | 75 +++++++++-------- sw/source/core/layout/calcmove.cxx | 6 +- sw/source/core/layout/flowfrm.cxx | 2 +- sw/source/core/layout/fly.cxx | 19 +++-- sw/source/core/layout/flycnt.cxx | 2 +- sw/source/core/layout/flylay.cxx | 9 +- sw/source/core/layout/flypos.cxx | 8 +- sw/source/core/layout/frmtool.cxx | 27 +++--- sw/source/core/layout/laycache.cxx | 11 ++- sw/source/core/layout/objectformatter.cxx | 2 +- sw/source/core/layout/objectformattertxtfrm.cxx | 6 +- sw/source/core/layout/pagechg.cxx | 12 ++- sw/source/core/layout/sortedobjsimpl.cxx | 41 +++++---- sw/source/core/layout/tabfrm.cxx | 8 +- sw/source/core/layout/wsfrm.cxx | 10 +-- .../tocntntanchoredobjectposition.cxx | 6 +- sw/source/core/text/EnhancedPDFExportHelper.cxx | 12 +-- sw/source/core/text/itratr.cxx | 6 +- sw/source/core/text/porfly.cxx | 5 +- sw/source/core/text/txtfly.cxx | 50 +++++------ sw/source/core/text/txtfrm.cxx | 20 ++--- sw/source/core/txtnode/atrflyin.cxx | 10 ++- sw/source/core/txtnode/thints.cxx | 8 +- sw/source/core/undo/rolbck.cxx | 2 +- sw/source/core/undo/unattr.cxx | 16 ++-- sw/source/core/undo/undel.cxx | 4 +- sw/source/core/undo/undobj.cxx | 6 +- sw/source/core/undo/undobj1.cxx | 91 ++++++++++++-------- sw/source/core/undo/undraw.cxx | 37 ++++---- sw/source/core/undo/untbl.cxx | 10 +-- sw/source/core/undo/untblk.cxx | 16 ++-- sw/source/core/unocore/unodraw.cxx | 46 ++++++---- sw/source/core/unocore/unoframe.cxx | 23 ++--- sw/source/core/unocore/unoobj2.cxx | 3 +- sw/source/core/view/vdraw.cxx | 9 +- sw/source/filter/basflt/shellio.cxx | 19 +++-- sw/source/filter/html/css1atr.cxx | 10 +-- sw/source/filter/html/htmlcss1.cxx | 13 +-- sw/source/filter/html/htmldraw.cxx | 14 ++-- sw/source/filter/html/htmlfly.cxx | 20 ++--- sw/source/filter/html/htmlforw.cxx | 7 +- sw/source/filter/html/htmlgrin.cxx | 30 +++---- sw/source/filter/html/htmlplug.cxx | 8 +- sw/source/filter/html/swhtml.cxx | 36 ++++---- sw/source/filter/inc/fltshell.hxx | 4 +- sw/source/filter/rtf/rtfatr.cxx | 20 ++--- sw/source/filter/rtf/rtffly.cxx | 17 ++-- sw/source/filter/rtf/swparrtf.cxx | 28 ++----- sw/source/filter/rtf/wrtrtf.cxx | 7 +- sw/source/filter/ww1/fltshell.cxx | 13 ++- sw/source/filter/ww1/w1sprm.cxx | 10 +-- sw/source/filter/ww8/writerhelper.cxx | 2 +- sw/source/filter/ww8/wrtw8esh.cxx | 16 ++-- sw/source/filter/ww8/wrtw8nds.cxx | 13 +-- sw/source/filter/ww8/wrtww8.cxx | 2 +- sw/source/filter/ww8/wrtww8gr.cxx | 6 +- sw/source/filter/ww8/ww8atr.cxx | 8 +- sw/source/filter/ww8/ww8glsy.cxx | 13 ++- sw/source/filter/ww8/ww8graf.cxx | 20 ++--- sw/source/filter/ww8/ww8graf2.cxx | 8 +- sw/source/filter/ww8/ww8par.cxx | 2 +- sw/source/filter/ww8/ww8par2.cxx | 13 +-- sw/source/filter/ww8/ww8par4.cxx | 8 +- sw/source/filter/ww8/ww8par5.cxx | 8 +- sw/source/filter/ww8/ww8par6.cxx | 24 ++---- sw/source/filter/xml/xmltexti.cxx | 5 +- sw/source/ui/app/appenv.cxx | 20 +---- sw/source/ui/app/applab.cxx | 18 +--- sw/source/ui/dbui/mmlayoutpage.cxx | 6 +- sw/source/ui/dialog/regionsw.cxx | 23 +---- sw/source/ui/docvw/edtwin.cxx | 25 ++---- sw/source/ui/frmdlg/column.cxx | 2 +- sw/source/ui/frmdlg/frmmgr.cxx | 27 +++--- sw/source/ui/frmdlg/frmpage.cxx | 60 +++++++------ sw/source/ui/frmdlg/wrap.cxx | 54 +++++++----- sw/source/ui/ribbar/conrect.cxx | 11 +-- sw/source/ui/ribbar/drawbase.cxx | 3 +- sw/source/ui/shells/basesh.cxx | 58 +++++++------ sw/source/ui/shells/drwbassh.cxx | 12 ++- sw/source/ui/shells/textdrw.cxx | 6 -- sw/source/ui/shells/textidx.cxx | 6 +- sw/source/ui/shells/textsh.cxx | 12 +-- sw/source/ui/uiview/view2.cxx | 19 ----- sw/source/ui/uiview/viewtab.cxx | 4 +- sw/source/ui/utlui/attrdesc.cxx | 8 +- sw/source/ui/wrtsh/select.cxx | 6 -- 118 files changed, 1003 insertions(+), 1146 deletions(-) diff --git a/sw/inc/dcontact.hxx b/sw/inc/dcontact.hxx index e1f20183deca..dc767403d1d5 100644 --- a/sw/inc/dcontact.hxx +++ b/sw/inc/dcontact.hxx @@ -191,11 +191,11 @@ public: } RndStdIds GetAnchorId() const { return GetAnchorFmt().GetAnchorId(); } - bool ObjAnchoredAtPage() const { return GetAnchorId() == FLY_PAGE; } - bool ObjAnchoredAtFly() const { return GetAnchorId() == FLY_AT_FLY; } - bool ObjAnchoredAtPara() const { return GetAnchorId() == FLY_AT_CNTNT; } - bool ObjAnchoredAtChar() const { return GetAnchorId() == FLY_AUTO_CNTNT; } - bool ObjAnchoredAsChar() const { return GetAnchorId() == FLY_IN_CNTNT; } + bool ObjAnchoredAtPage() const { return GetAnchorId() == FLY_AT_PAGE; } + bool ObjAnchoredAtFly() const { return GetAnchorId() == FLY_AT_FLY; } + bool ObjAnchoredAtPara() const { return GetAnchorId() == FLY_AT_PARA; } + bool ObjAnchoredAtChar() const { return GetAnchorId() == FLY_AT_CHAR; } + bool ObjAnchoredAsChar() const { return GetAnchorId() == FLY_AS_CHAR; } const SwPosition& GetCntntAnchor() const { diff --git a/sw/inc/fmtanchr.hxx b/sw/inc/fmtanchr.hxx index fd6975205347..df544884dd51 100644 --- a/sw/inc/fmtanchr.hxx +++ b/sw/inc/fmtanchr.hxx @@ -55,7 +55,7 @@ class SW_DLLPUBLIC SwFmtAnchor: public SfxPoolItem static sal_uInt32 mnOrderCounter; public: - SwFmtAnchor( RndStdIds eRnd = FLY_PAGE, USHORT nPageNum = 0 ); + SwFmtAnchor( RndStdIds eRnd = FLY_AT_PAGE, USHORT nPageNum = 0 ); SwFmtAnchor( const SwFmtAnchor &rCpy ); ~SwFmtAnchor(); @@ -86,7 +86,7 @@ public: }; inline const SwFmtAnchor &SwAttrSet::GetAnchor(BOOL bInP) const - { return (const SwFmtAnchor&)Get( RES_ANCHOR,bInP); } + { return static_cast(Get(RES_ANCHOR, bInP)); } inline const SwFmtAnchor &SwFmt::GetAnchor(BOOL bInP) const { return aSet.GetAnchor(bInP); } diff --git a/sw/inc/swtypes.hxx b/sw/inc/swtypes.hxx index 64cd8231f0ef..fbb90658098d 100644 --- a/sw/inc/swtypes.hxx +++ b/sw/inc/swtypes.hxx @@ -166,11 +166,11 @@ const short lOutlineMinTextDistance = 216; // 0.15 inch = 0.38 cm //Schnittstellen Bedeutung haben (SwDoc). enum RndStdIds { - FLY_AT_CNTNT, //Absatzgebundener Rahmen - FLY_IN_CNTNT, //Zeichengebundener Rahmen - FLY_PAGE, //Seitengebundener Rahmen - FLY_AT_FLY, //Rahmengebundener Rahmen ( LAYER_IMPL ) - FLY_AUTO_CNTNT, //Automatisch positionierter, absatzgebundener Rahmen + FLY_AT_PARA, // anchored at paragraph + FLY_AS_CHAR, // anchored as character + FLY_AT_PAGE, // anchored at page + FLY_AT_FLY, // anchored at frame + FLY_AT_CHAR, // anchored at character //Der Rest wird nur fuer SS benutzt. RND_STD_HEADER, RND_STD_FOOTER, diff --git a/sw/source/core/access/accframe.cxx b/sw/source/core/access/accframe.cxx index a62afc11e551..f6778c1564b8 100644 --- a/sw/source/core/access/accframe.cxx +++ b/sw/source/core/access/accframe.cxx @@ -438,7 +438,7 @@ const SwFrm *SwAccessibleFrame::GetParent( const SwFrmOrObj& rFrmOrObj, const SwFlyFrm *pFly = static_cast< const SwFlyFrm *>( pFrm ); if( pFly->IsFlyInCntFrm() ) { - // For FLY_IN_CNTNT the parent is the anchor + // For FLY_AS_CHAR the parent is the anchor aParent = pFly->GetAnchorFrm(); ASSERT( aParent.IsAccessible( bInPagePreview ), "parent is not accessible" ); @@ -471,9 +471,9 @@ const SwFrm *SwAccessibleFrame::GetParent( const SwFrmOrObj& rFrmOrObj, { const SwFrmFmt *pFrmFmt = pContact->GetFmt(); ASSERT( pFrmFmt, "frame format is missing" ); - if( pFrmFmt && FLY_IN_CNTNT == pFrmFmt->GetAnchor().GetAnchorId() ) + if (pFrmFmt && FLY_AS_CHAR == pFrmFmt->GetAnchor().GetAnchorId()) { - // For FLY_IN_CNTNT the parent is the anchor + // For FLY_AS_CHAR the parent is the anchor aParent = pContact->GetAnchorFrm(); ASSERT( aParent.IsAccessible( bInPagePreview ), "parent is not accessible" ); diff --git a/sw/source/core/access/accfrmobj.cxx b/sw/source/core/access/accfrmobj.cxx index f16d11692c9c..c7822e80ea72 100644 --- a/sw/source/core/access/accfrmobj.cxx +++ b/sw/source/core/access/accfrmobj.cxx @@ -59,8 +59,10 @@ sal_Bool SwFrmOrObj::IsBoundAsChar() const else { const SwFrmFmt *pFrmFmt = pObj ? ::FindFrmFmt( pObj ) : 0; - return pFrmFmt ? static_cast(FLY_IN_CNTNT == pFrmFmt->GetAnchor().GetAnchorId()) - : sal_False; + return (pFrmFmt) + ? static_cast(FLY_AS_CHAR == + pFrmFmt->GetAnchor().GetAnchorId()) + : sal_False; } } diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index 0c18b725d9f7..cacd46da9faf 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -95,9 +95,7 @@ #include #include #include -#ifndef _CMDID_H #include // fuer den dflt - Printer in SetJob -#endif #ifndef _STATSTR_HRC #include // StatLine-String #endif @@ -923,7 +921,7 @@ SwFlyFrmFmt* SwDoc::_InsNoTxtNode( const SwPosition& rPos, SwNoTxtNode* pNode, SwFlyFrmFmt *pFmt = 0; if( pNode ) { - pFmt = _MakeFlySection( rPos, *pNode, FLY_AT_CNTNT, + pFmt = _MakeFlySection( rPos, *pNode, FLY_AT_PARA, pFlyAttrSet, pFrmFmt ); if( pGrfAttrSet ) pNode->SetAttr( *pGrfAttrSet ); diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx index e1b4f3ee4322..924a677785ee 100644 --- a/sw/source/core/doc/docbm.cxx +++ b/sw/source/core/doc/docbm.cxx @@ -1259,7 +1259,6 @@ void _SaveCntntIdx(SwDoc* pDoc, SwCntntNode *pNode = pDoc->GetNodes()[nNode]->GetCntntNode(); if( pNode ) { - const SwPosition* pAPos; SwFrm* pFrm = pNode->GetFrm(); #if OSL_DEBUG_LEVEL > 1 @@ -1277,16 +1276,18 @@ void _SaveCntntIdx(SwDoc* pDoc, SwAnchoredObject* pObj = rDObj[ --n ]; const SwFrmFmt& rFmt = pObj->GetFrmFmt(); const SwFmtAnchor& rAnchor = rFmt.GetAnchor(); - if( ( ( nSaveFly && FLY_AT_CNTNT == rAnchor.GetAnchorId() ) || - FLY_AUTO_CNTNT == rAnchor.GetAnchorId() ) && - ( 0 != ( pAPos = rAnchor.GetCntntAnchor() ) ) ) + SwPosition const*const pAPos = rAnchor.GetCntntAnchor(); + if ( pAPos && + ( ( nSaveFly && + FLY_AT_PARA == rAnchor.GetAnchorId() ) || + ( FLY_AT_CHAR == rAnchor.GetAnchorId() ) ) ) { aSave.SetType( 0x2000 ); aSave.SetContent( pAPos->nContent.GetIndex() ); OSL_ENSURE( nNode == pAPos->nNode.GetIndex(), "_SaveCntntIdx: Wrong Node-Index" ); - if( FLY_AUTO_CNTNT == rAnchor.GetAnchorId() ) + if ( FLY_AT_CHAR == rAnchor.GetAnchorId() ) { if( nCntnt <= aSave.GetContent() ) { @@ -1321,14 +1322,14 @@ void _SaveCntntIdx(SwDoc* pDoc, continue; const SwFmtAnchor& rAnchor = pFrmFmt->GetAnchor(); - if( ( FLY_AT_CNTNT == rAnchor.GetAnchorId() || - FLY_AUTO_CNTNT == rAnchor.GetAnchorId() ) && - 0 != ( pAPos = rAnchor.GetCntntAnchor()) && - nNode == pAPos->nNode.GetIndex() ) + SwPosition const*const pAPos = rAnchor.GetCntntAnchor(); + if ( pAPos && ( nNode == pAPos->nNode.GetIndex() ) && + ( FLY_AT_PARA == rAnchor.GetAnchorId() || + FLY_AT_CHAR == rAnchor.GetAnchorId() ) ) { aSave.SetType( 0x2000 ); aSave.SetContent( pAPos->nContent.GetIndex() ); - if( FLY_AUTO_CNTNT == rAnchor.GetAnchorId() ) + if ( FLY_AT_CHAR == rAnchor.GetAnchorId() ) { if( nCntnt <= aSave.GetContent() ) { @@ -1444,11 +1445,15 @@ void _RestoreCntntIdx(SwDoc* pDoc, SwFmtAnchor aNew( rFlyAnchor ); SwPosition aNewPos( *rFlyAnchor.GetCntntAnchor() ); aNewPos.nNode = *pCNd; - if( FLY_AUTO_CNTNT == rFlyAnchor.GetAnchorId() ) + if ( FLY_AT_CHAR == rFlyAnchor.GetAnchorId() ) + { aNewPos.nContent.Assign( pCNd, aSave.GetContent() + nOffset ); + } else + { aNewPos.nContent.Assign( 0, 0 ); + } aNew.SetAnchor( &aNewPos ); pFrmFmt->SetFmtAttr( aNew ); } @@ -1608,11 +1613,15 @@ void _RestoreCntntIdx(SvULongs& rSaveArr, SwFmtAnchor aNew( rFlyAnchor ); SwPosition aNewPos( *rFlyAnchor.GetCntntAnchor() ); aNewPos.nNode = rNd; - if( FLY_AUTO_CNTNT == rFlyAnchor.GetAnchorId() ) + if ( FLY_AT_CHAR == rFlyAnchor.GetAnchorId() ) + { aNewPos.nContent.Assign( pCNd, Min( aSave.GetContent(), nLen ) ); + } else + { aNewPos.nContent.Assign( 0, 0 ); + } aNew.SetAnchor( &aNewPos ); pFrmFmt->SetFmtAttr( aNew ); } diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx index 95e18a7e78af..4ab6f8541e02 100644 --- a/sw/source/core/doc/docdraw.cxx +++ b/sw/source/core/doc/docdraw.cxx @@ -32,9 +32,7 @@ #include "precompiled_sw.hxx" #include #include -#ifndef _OUTDEV_HXX //autogen #include -#endif #include #include #include @@ -46,22 +44,16 @@ #include #include -#ifndef _SVDOMEAS_HXX #include -#endif #include #include #include #include #include #include -#ifndef _SWHINTS_HXX #include -#endif #include -#ifndef _DOCSH_HXX #include -#endif #include //Damit der RootDtor gerufen wird. #include #include // fuer MakeDrawView @@ -481,7 +473,7 @@ BOOL SwDoc::DeleteSelection( SwDrawView& rDrawView ) SwDrawContact *pC = (SwDrawContact*)GetUserCall(pObj); SwDrawFrmFmt *pFrmFmt = (SwDrawFrmFmt*)pC->GetFmt(); if( pFrmFmt && - FLY_IN_CNTNT == pFrmFmt->GetAnchor().GetAnchorId() ) + FLY_AS_CHAR == pFrmFmt->GetAnchor().GetAnchorId() ) { rDrawView.MarkObj( pObj, rDrawView.Imp().GetPageView(), TRUE ); --i; diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx index ddc6024c89ae..61c89cc579e2 100644 --- a/sw/source/core/doc/docedt.cxx +++ b/sw/source/core/doc/docedt.cxx @@ -220,17 +220,15 @@ void _RestFlyInRange( _SaveFlyArr & rArr, const SwNodeIndex& rSttIdx, void _SaveFlyInRange( const SwNodeRange& rRg, _SaveFlyArr& rArr ) { - SwFrmFmt* pFmt; - const SwFmtAnchor* pAnchor; - const SwPosition* pAPos; SwSpzFrmFmts& rFmts = *rRg.aStart.GetNode().GetDoc()->GetSpzFrmFmts(); for( sal_uInt16 n = 0; n < rFmts.Count(); ++n ) { - pFmt = (SwFrmFmt*)rFmts[n]; - pAnchor = &pFmt->GetAnchor(); - if( ( FLY_AT_CNTNT == pAnchor->GetAnchorId() || - FLY_AUTO_CNTNT == pAnchor->GetAnchorId() ) && - 0 != ( pAPos = pAnchor->GetCntntAnchor() ) && + SwFrmFmt *const pFmt = static_cast(rFmts[n]); + SwFmtAnchor const*const pAnchor = &pFmt->GetAnchor(); + SwPosition const*const pAPos = pAnchor->GetCntntAnchor(); + if (pAPos && + ((FLY_AT_PARA == pAnchor->GetAnchorId()) || + (FLY_AT_CHAR == pAnchor->GetAnchorId())) && rRg.aStart <= pAPos->nNode && pAPos->nNode < rRg.aEnd ) { _SaveFly aSave( pAPos->nNode.GetIndex() - rRg.aStart.GetIndex(), @@ -260,7 +258,6 @@ void _SaveFlyInRange( const SwPaM& rPam, const SwNodeIndex& rInsPos, pPos->nContent == rEndNdIdx.GetNode().GetCntntNode()->Len() )) ? 0 : 1; - const SwPosition* pAPos; const SwNodeIndex* pCntntIdx; for( sal_uInt16 n = 0; n < rFmts.Count(); ++n ) @@ -268,9 +265,10 @@ void _SaveFlyInRange( const SwPaM& rPam, const SwNodeIndex& rInsPos, sal_Bool bInsPos = sal_False; pFmt = (SwFrmFmt*)rFmts[n]; pAnchor = &pFmt->GetAnchor(); - if( ( FLY_AT_CNTNT == pAnchor->GetAnchorId() || - FLY_AUTO_CNTNT == pAnchor->GetAnchorId() ) && - 0 != ( pAPos = pAnchor->GetCntntAnchor() ) && + const SwPosition* pAPos = pAnchor->GetCntntAnchor(); + if (pAPos && + ((FLY_AT_PARA == pAnchor->GetAnchorId()) || + (FLY_AT_CHAR == pAnchor->GetAnchorId())) && // nicht verschieben, wenn die InsPos im CntntBereich vom Fly ist ( 0 == ( pCntntIdx = pFmt->GetCntnt().GetCntntIdx() ) || !( *pCntntIdx < rInsPos && @@ -317,14 +315,14 @@ void DelFlyInRange( const SwNodeIndex& rMkNdIdx, SwDoc* pDoc = rMkNdIdx.GetNode().GetDoc(); SwSpzFrmFmts& rTbl = *pDoc->GetSpzFrmFmts(); - const SwPosition* pAPos; for ( sal_uInt16 i = rTbl.Count(); i; ) { SwFrmFmt *pFmt = rTbl[--i]; const SwFmtAnchor &rAnch = pFmt->GetAnchor(); - if( ( rAnch.GetAnchorId() == FLY_AT_CNTNT || - rAnch.GetAnchorId() == FLY_AUTO_CNTNT ) && - 0 != ( pAPos = rAnch.GetCntntAnchor() ) && + SwPosition const*const pAPos = rAnch.GetCntntAnchor(); + if (pAPos && + ((rAnch.GetAnchorId() == FLY_AT_PARA) || + (rAnch.GetAnchorId() == FLY_AT_CHAR)) && ( bDelFwrd ? rMkNdIdx < pAPos->nNode && pAPos->nNode <= rPtNdIdx : rPtNdIdx <= pAPos->nNode && pAPos->nNode < rMkNdIdx )) @@ -2620,14 +2618,14 @@ bool SwDoc::DelFullPara( SwPaM& rPam ) // was ist mit Fly's ?? { // stehen noch FlyFrames rum, loesche auch diese - const SwPosition* pAPos; for( sal_uInt16 n = 0; n < GetSpzFrmFmts()->Count(); ++n ) { SwFrmFmt* pFly = (*GetSpzFrmFmts())[n]; const SwFmtAnchor* pAnchor = &pFly->GetAnchor(); - if( ( FLY_AT_CNTNT == pAnchor->GetAnchorId() || - FLY_AUTO_CNTNT == pAnchor->GetAnchorId() ) && - 0 != ( pAPos = pAnchor->GetCntntAnchor() ) && + SwPosition const*const pAPos = pAnchor->GetCntntAnchor(); + if (pAPos && + ((FLY_AT_PARA == pAnchor->GetAnchorId()) || + (FLY_AT_CHAR == pAnchor->GetAnchorId())) && aRg.aStart <= pAPos->nNode && pAPos->nNode <= aRg.aEnd ) { DelLayoutFmt( pFly ); diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx index 507e63ba7a47..a34dabb435cd 100644 --- a/sw/source/core/doc/docfly.cxx +++ b/sw/source/core/doc/docfly.cxx @@ -181,7 +181,7 @@ Point lcl_FindAnchorLayPos( SwDoc& rDoc, const SwFmtAnchor& rAnch, if( rDoc.GetRootFrm() ) switch( rAnch.GetAnchorId() ) { - case FLY_IN_CNTNT: + case FLY_AS_CHAR: if( pFlyFmt && rAnch.GetCntntAnchor() ) { const SwFrm* pOld = ((SwFlyFrmFmt*)pFlyFmt)->GetFrm( &aRet, FALSE ); @@ -190,8 +190,8 @@ Point lcl_FindAnchorLayPos( SwDoc& rDoc, const SwFmtAnchor& rAnch, } break; - case FLY_AT_CNTNT: - case FLY_AUTO_CNTNT: // LAYER_IMPL + case FLY_AT_PARA: + case FLY_AT_CHAR: // LAYER_IMPL if( rAnch.GetCntntAnchor() ) { const SwPosition *pPos = rAnch.GetCntntAnchor(); @@ -213,7 +213,7 @@ Point lcl_FindAnchorLayPos( SwDoc& rDoc, const SwFmtAnchor& rAnch, } break; - case FLY_PAGE: + case FLY_AT_PAGE: { USHORT nPgNum = rAnch.GetPageNum(); const SwPageFrm *pPage = (SwPageFrm*)rDoc.GetRootFrm()->Lower(); @@ -249,9 +249,11 @@ sal_Int8 SwDoc::SetFlyFrmAnchor( SwFrmFmt& rFmt, SfxItemSet& rSet, BOOL bNewFrms // ist der neue ein gueltiger Anker? if( !aNewAnch.GetCntntAnchor() && (FLY_AT_FLY == nNew || - FLY_AT_CNTNT == nNew || FLY_IN_CNTNT == nNew || - FLY_AUTO_CNTNT == nNew )) + (FLY_AT_PARA == nNew) || (FLY_AS_CHAR == nNew) || + (FLY_AT_CHAR == nNew) )) + { return IGNOREANCHOR; + } if( nOld == nNew ) return DONTMAKEFRMS; @@ -264,7 +266,7 @@ sal_Int8 SwDoc::SetFlyFrmAnchor( SwFrmFmt& rFmt, SfxItemSet& rSet, BOOL bNewFrms //doppeltes hiden waere so eine art Show! rFmt.DelFrms(); - if( FLY_IN_CNTNT == nOld ) + if ( FLY_AS_CHAR == nOld ) { //Bei InCntnt's wird es spannend: Das TxtAttribut muss vernichtet //werden. Leider reisst dies neben den Frms auch noch das Format mit @@ -295,7 +297,7 @@ sal_Int8 SwDoc::SetFlyFrmAnchor( SwFrmFmt& rFmt, SfxItemSet& rSet, BOOL bNewFrms const SfxPoolItem* pItem; switch( nNew ) { - case FLY_IN_CNTNT: + case FLY_AS_CHAR: //Wenn keine Positionsattribute hereinkommen, dann muss dafuer //gesorgt werden, das keine unerlaubte automatische Ausrichtung //bleibt. @@ -326,10 +328,10 @@ sal_Int8 SwDoc::SetFlyFrmAnchor( SwFrmFmt& rFmt, SfxItemSet& rSet, BOOL bNewFrms } break; - case FLY_AT_CNTNT: - case FLY_AUTO_CNTNT: // LAYER_IMPL + case FLY_AT_PARA: + case FLY_AT_CHAR: // LAYER_IMPL case FLY_AT_FLY: // LAYER_IMPL - case FLY_PAGE: + case FLY_AT_PAGE: { //Wenn keine Positionsattribute hereinschneien korrigieren wir //die Position so, dass die Dokumentkoordinaten des Flys erhalten @@ -345,7 +347,7 @@ sal_Int8 SwDoc::SetFlyFrmAnchor( SwFrmFmt& rFmt, SfxItemSet& rSet, BOOL bNewFrms if( text::HoriOrientation::NONE == aOldH.GetHoriOrient() && ( !pItem || aOldH.GetPos() == ((SwFmtHoriOrient*)pItem)->GetPos() )) { - SwTwips nPos = FLY_IN_CNTNT == nOld ? 0 : aOldH.GetPos(); + SwTwips nPos = (FLY_AS_CHAR == nOld) ? 0 : aOldH.GetPos(); nPos += aOldAnchorPos.X() - aNewAnchorPos.X(); if( pItem ) @@ -367,7 +369,7 @@ sal_Int8 SwDoc::SetFlyFrmAnchor( SwFrmFmt& rFmt, SfxItemSet& rSet, BOOL bNewFrms if( text::VertOrientation::NONE == aOldV.GetVertOrient() && (!pItem || aOldV.GetPos() == ((SwFmtVertOrient*)pItem)->GetPos() ) ) { - SwTwips nPos = FLY_IN_CNTNT == nOld ? 0 : aOldV.GetPos(); + SwTwips nPos = (FLY_AS_CHAR == nOld) ? 0 : aOldV.GetPos(); nPos += aOldAnchorPos.Y() - aNewAnchorPos.Y(); if( pItem ) { @@ -698,7 +700,7 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList, // xub_StrLen nIndx = STRING_NOTFOUND; const SwPosition* pOldAsCharAnchorPos( 0L ); const RndStdIds eOldAnchorType = pContact->GetAnchorId(); - if ( !_bSameOnly && eOldAnchorType == FLY_IN_CNTNT ) + if ( !_bSameOnly && eOldAnchorType == FLY_AS_CHAR ) { pOldAsCharAnchorPos = new SwPosition( pContact->GetCntntAnchor() ); } @@ -713,8 +715,8 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList, switch ( _eAnchorType ) { - case FLY_AT_CNTNT: - case FLY_AUTO_CNTNT: + case FLY_AT_PARA: + case FLY_AT_CHAR: { const Point aNewPoint = pOldAnchorFrm && ( pOldAnchorFrm->IsVertical() || @@ -768,10 +770,10 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList, break; } - aNewAnch.SetType( FLY_PAGE ); + aNewAnch.SetType( FLY_AT_PAGE ); // no break } - case FLY_PAGE: + case FLY_AT_PAGE: { pNewAnchorFrm = GetRootFrm()->Lower(); while ( pNewAnchorFrm && !pNewAnchorFrm->Frm().IsInside( aPt ) ) @@ -782,7 +784,7 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList, aNewAnch.SetPageNum( ((SwPageFrm*)pNewAnchorFrm)->GetPhyPageNum()); } break; - case FLY_IN_CNTNT: + case FLY_AS_CHAR: if( _bSameOnly ) // Positions/Groessenaenderung { if( !pOldAnchorFrm ) @@ -805,7 +807,7 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList, bUnmark = ( 0 != i ); Point aPoint( aPt ); aPoint.X() -= 1; // nicht im DrawObj landen!! - aNewAnch.SetType( FLY_IN_CNTNT ); + aNewAnch.SetType( FLY_AS_CHAR ); SwPosition aPos( *((SwCntntFrm*)pNewAnchorFrm)->GetNode() ); if ( pNewAnchorFrm->Frm().IsInside( aPoint ) ) { @@ -839,7 +841,7 @@ sal_Bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList, ASSERT( !this, "unexpected AnchorId." ); } - if ( (FLY_IN_CNTNT != _eAnchorType) && + if ( (FLY_AS_CHAR != _eAnchorType) && pNewAnchorFrm && ( !_bSameOnly || pNewAnchorFrm != pOldAnchorFrm ) ) { @@ -949,8 +951,8 @@ int SwDoc::Chainable( const SwFrmFmt &rSource, const SwFrmFmt &rDest ) const SwFmtAnchor& rAnchor = (*GetSpzFrmFmts())[ n ]->GetAnchor(); ULONG nTstSttNd; // OD 11.12.2003 #i20622# - to-frame anchored objects are allowed. - if ( ( rAnchor.GetAnchorId() == FLY_AT_CNTNT || - rAnchor.GetAnchorId() == FLY_AUTO_CNTNT ) && + if ( ((rAnchor.GetAnchorId() == FLY_AT_PARA) || + (rAnchor.GetAnchorId() == FLY_AT_CHAR)) && 0 != rAnchor.GetCntntAnchor() && nFlySttNd <= ( nTstSttNd = rAnchor.GetCntntAnchor()->nNode.GetIndex() ) && @@ -971,9 +973,9 @@ int SwDoc::Chainable( const SwFrmFmt &rSource, const SwFrmFmt &rDest ) &rDstAnchor = rDest.GetAnchor(); ULONG nEndOfExtras = GetNodes().GetEndOfExtras().GetIndex(); BOOL bAllowed = FALSE; - if( FLY_PAGE == rSrcAnchor.GetAnchorId() ) + if ( FLY_AT_PAGE == rSrcAnchor.GetAnchorId() ) { - if( FLY_PAGE == rDstAnchor.GetAnchorId() || + if ( (FLY_AT_PAGE == rDstAnchor.GetAnchorId()) || ( rDstAnchor.GetCntntAnchor() && rDstAnchor.GetCntntAnchor()->nNode.GetIndex() > nEndOfExtras )) bAllowed = TRUE; diff --git a/sw/source/core/doc/docglbl.cxx b/sw/source/core/doc/docglbl.cxx index 113319494e03..9bef76da7508 100644 --- a/sw/source/core/doc/docglbl.cxx +++ b/sw/source/core/doc/docglbl.cxx @@ -49,12 +49,8 @@ #include #include #include -#ifndef _DOCSH_HXX #include -#endif -#ifndef _GLOBDOC_HXX #include -#endif #include #include // fuer die UndoIds #include @@ -371,14 +367,15 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath, CorrAbs( aSIdx, aEIdx, *aTmp.GetPoint(), TRUE); // stehen noch FlyFrames rum, loesche auch diese - const SwPosition* pAPos; for( USHORT n = 0; n < GetSpzFrmFmts()->Count(); ++n ) { SwFrmFmt* pFly = (*GetSpzFrmFmts())[n]; const SwFmtAnchor* pAnchor = &pFly->GetAnchor(); - if( ( FLY_AT_CNTNT == pAnchor->GetAnchorId() || - FLY_AUTO_CNTNT == pAnchor->GetAnchorId() ) && - 0 != ( pAPos = pAnchor->GetCntntAnchor() ) && + SwPosition const*const pAPos = + pAnchor->GetCntntAnchor(); + if (pAPos && + ((FLY_AT_PARA == pAnchor->GetAnchorId()) || + (FLY_AT_CHAR == pAnchor->GetAnchorId())) && aSIdx <= pAPos->nNode && pAPos->nNode < aEIdx ) { @@ -717,14 +714,15 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath, int nOutlineLevel ) CorrAbs( aSIdx, aEIdx, *aTmp.GetPoint(), TRUE); // stehen noch FlyFrames rum, loesche auch diese - const SwPosition* pAPos; for( USHORT n = 0; n < GetSpzFrmFmts()->Count(); ++n ) { SwFrmFmt* pFly = (*GetSpzFrmFmts())[n]; const SwFmtAnchor* pAnchor = &pFly->GetAnchor(); - if( ( FLY_AT_CNTNT == pAnchor->GetAnchorId() || - FLY_AUTO_CNTNT == pAnchor->GetAnchorId() ) && - 0 != ( pAPos = pAnchor->GetCntntAnchor() ) && + SwPosition const*const pAPos = + pAnchor->GetCntntAnchor(); + if (pAPos && + ((FLY_AT_PARA == pAnchor->GetAnchorId()) || + (FLY_AT_CHAR == pAnchor->GetAnchorId())) && aSIdx <= pAPos->nNode && pAPos->nNode < aEIdx ) { diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index 1af12a64bf2f..e58059d95ac9 100644 --- a/sw/source/core/doc/doclay.cxx +++ b/sw/source/core/doc/doclay.cxx @@ -68,9 +68,7 @@ #include #include #include -#ifndef _FRMCNCT_HXX //autogen #include -#endif #include #include #include @@ -85,9 +83,7 @@ #include #include #include -#ifndef _DOCSH_HXX #include -#endif #include #include #include @@ -213,13 +209,12 @@ SwFrmFmt *SwDoc::MakeLayoutFmt( RndStdIds eRequest, const SfxItemSet* pSet ) break; #ifndef PRODUCT - case FLY_PAGE: - case FLY_AUTO_CNTNT: + case FLY_AT_PAGE: + case FLY_AT_CHAR: case FLY_AT_FLY: - case FLY_AT_CNTNT: - case FLY_IN_CNTNT: - ASSERT( !this, - "neue Schnittstelle benutzen: SwDoc::MakeFlySection!" ); + case FLY_AT_PARA: + case FLY_AS_CHAR: + ASSERT( false, "use new interface instead: SwDoc::MakeFlySection!" ); break; #endif @@ -358,7 +353,7 @@ void SwDoc::DelLayoutFmt( SwFrmFmt *pFmt ) // ggfs. bei Zeichengebundenen Flys das Zeichen loeschen const SwFmtAnchor& rAnchor = pFmt->GetAnchor(); - if( FLY_IN_CNTNT == rAnchor.GetAnchorId() && rAnchor.GetCntntAnchor()) + if ((FLY_AS_CHAR == rAnchor.GetAnchorId()) && rAnchor.GetCntntAnchor()) { const SwPosition* pPos = rAnchor.GetCntntAnchor(); SwTxtNode *pTxtNd = pPos->nNode.GetNode().GetTxtNode(); @@ -422,9 +417,9 @@ SwFrmFmt *SwDoc::CopyLayoutFmt( const SwFrmFmt& rSource, static_cast( rSource.FindContactObj() ); bMayNotCopy = - ( FLY_AT_CNTNT == rNewAnchor.GetAnchorId() || - FLY_AT_FLY == rNewAnchor.GetAnchorId() || - FLY_AUTO_CNTNT == rNewAnchor.GetAnchorId() ) && + ((FLY_AT_PARA == rNewAnchor.GetAnchorId()) || + (FLY_AT_FLY == rNewAnchor.GetAnchorId()) || + (FLY_AT_CHAR == rNewAnchor.GetAnchorId())) && rNewAnchor.GetCntntAnchor() && IsInHeaderFooter( rNewAnchor.GetCntntAnchor()->nNode ) && pDrawContact != NULL && @@ -551,7 +546,7 @@ SwFrmFmt *SwDoc::CopyLayoutFmt( const SwFrmFmt& rSource, } } - if( bSetTxtFlyAtt && FLY_IN_CNTNT == rNewAnchor.GetAnchorId() ) + if (bSetTxtFlyAtt && (FLY_AS_CHAR == rNewAnchor.GetAnchorId())) { const SwPosition* pPos = rNewAnchor.GetCntntAnchor(); SwFmtFlyCnt aFmt( pDest ); @@ -660,7 +655,7 @@ SwFlyFrmFmt* SwDoc::_MakeFlySection( const SwPosition& rAnchPos, RndStdIds eAnchorId = pAnchor ? pAnchor->GetAnchorId() : pFmt->GetAnchor().GetAnchorId(); if( !pAnchor || - (FLY_PAGE != pAnchor->GetAnchorId() && + ((FLY_AT_PAGE != pAnchor->GetAnchorId()) && //Nur Page und nicht: // FLY_AT_CNTNT == pAnchor->GetAnchorId() || // FLY_IN_CNTNT == pAnchor->GetAnchorId() || @@ -670,7 +665,7 @@ SwFlyFrmFmt* SwDoc::_MakeFlySection( const SwPosition& rAnchPos, { // dann setze ihn, wird im Undo gebraucht SwFmtAnchor aAnch( pFmt->GetAnchor() ); - if( pAnchor && FLY_AT_FLY == pAnchor->GetAnchorId() ) + if (pAnchor && (FLY_AT_FLY == pAnchor->GetAnchorId())) { SwPosition aPos( *rAnchPos.nNode.GetNode().FindFlyStartNode() ); aAnch.SetAnchor( &aPos ); @@ -683,7 +678,7 @@ SwFlyFrmFmt* SwDoc::_MakeFlySection( const SwPosition& rAnchPos, aAnch.SetType( eRequestId ); eAnchorId = aAnch.GetAnchorId(); - if ( FLY_PAGE != eAnchorId ) + if ( FLY_AT_PAGE != eAnchorId ) //Nur Page und nicht: // if( FLY_AT_CNTNT == eAnchorId || FLY_IN_CNTNT == eAnchorId || // FLY_AT_FLY == eAnchorId || FLY_AUTO_CNTNT == eAnchorId ) @@ -694,7 +689,7 @@ SwFlyFrmFmt* SwDoc::_MakeFlySection( const SwPosition& rAnchPos, else eAnchorId = pFmt->GetAnchor().GetAnchorId(); - if( FLY_IN_CNTNT == eAnchorId ) + if ( FLY_AS_CHAR == eAnchorId ) { xub_StrLen nStt = rAnchPos.nContent.GetIndex(); SwTxtNode * pTxtNode = rAnchPos.nNode.GetNode().GetTxtNode(); @@ -751,7 +746,7 @@ SwFlyFrmFmt* SwDoc::MakeFlySection( RndStdIds eAnchorType, { SwFlyFrmFmt* pFmt = 0; sal_Bool bCallMake = sal_True; - if( !pAnchorPos && FLY_PAGE != eAnchorType ) + if ( !pAnchorPos && (FLY_AT_PAGE != eAnchorType) ) { const SwFmtAnchor* pAnch; if( (pFlySet && SFX_ITEM_SET == pFlySet->GetItemState( @@ -759,9 +754,14 @@ SwFlyFrmFmt* SwDoc::MakeFlySection( RndStdIds eAnchorType, ( pFrmFmt && SFX_ITEM_SET == pFrmFmt->GetItemState( RES_ANCHOR, sal_True, (const SfxPoolItem**)&pAnch )) ) { - if( FLY_PAGE != pAnch->GetAnchorId() && - 0 == ( pAnchorPos = pAnch->GetCntntAnchor() ) ) - bCallMake = sal_False; + if ( (FLY_AT_PAGE != pAnch->GetAnchorId()) ) + { + pAnchorPos = pAnch->GetCntntAnchor(); + if (pAnchorPos) + { + bCallMake = sal_False; + } + } } } @@ -944,7 +944,7 @@ SwDrawFrmFmt* SwDoc::Insert( const SwPaM &rRg, // Anker noch nicht gesetzt ? // DrawObjecte duerfen niemals in Kopf-/Fusszeilen landen. - sal_Bool bIsAtCntnt = FLY_PAGE != eAnchorId; + const bool bIsAtCntnt = (FLY_AT_PAGE != eAnchorId); // FLY_AT_CNTNT == eAnchorId || FLY_IN_CNTNT == eAnchorId || // FLY_AT_FLY == eAnchorId || FLY_AUTO_CNTNT == eAnchorId; @@ -966,7 +966,7 @@ SwDrawFrmFmt* SwDoc::Insert( const SwPaM &rRg, ::CheckControlLayer( &rDrawObj ) && IsInHeaderFooter( *pChkIdx ) ) { - pFmt->SetFmtAttr( SwFmtAnchor( eAnchorId = FLY_PAGE ) ); + pFmt->SetFmtAttr( SwFmtAnchor( eAnchorId = FLY_AT_PAGE ) ); } else if( !pAnchor || (bIsAtCntnt && !pAnchor->GetCntntAnchor() )) { @@ -981,10 +981,10 @@ SwDrawFrmFmt* SwDoc::Insert( const SwPaM &rRg, else { aAnch.SetAnchor( rRg.GetPoint() ); - if( FLY_PAGE == eAnchorId ) + if ( FLY_AT_PAGE == eAnchorId ) { eAnchorId = rDrawObj.ISA( SdrUnoObj ) - ? FLY_IN_CNTNT : FLY_AT_CNTNT; + ? FLY_AS_CHAR : FLY_AT_PARA; aAnch.SetType( eAnchorId ); } } @@ -992,7 +992,7 @@ SwDrawFrmFmt* SwDoc::Insert( const SwPaM &rRg, } // bei als Zeichen gebundenen Draws das Attribut im Absatz setzen - if( FLY_IN_CNTNT == eAnchorId ) + if ( FLY_AS_CHAR == eAnchorId ) { xub_StrLen nStt = rRg.GetPoint()->nContent.GetIndex(); SwFmtFlyCnt aFmt( pFmt ); @@ -1063,7 +1063,7 @@ sal_Bool TstFlyRange( const SwPaM* pPam, const SwPosition* pFlyPos, const SwPosition* pPaMEnd = pTmp->End(); const sal_uInt32 nPamStartIndex = pPaMStart->nNode.GetIndex(); const sal_uInt32 nPamEndIndex = pPaMEnd->nNode.GetIndex(); - if(FLY_AT_CNTNT == nAnchorId) + if (FLY_AT_PARA == nAnchorId) bOk = (nPamStartIndex < nFlyIndex && nPamEndIndex > nFlyIndex) || (((nPamStartIndex == nFlyIndex) && (pPaMStart->nContent.GetIndex() == 0)) && (nPamEndIndex > nFlyIndex)); @@ -1091,7 +1091,6 @@ void SwDoc::GetAllFlyFmts( SwPosFlyFrms& rPosFlyFmts, const SwPaM* pCmpRange, sal_Bool bDrawAlso ) const { SwPosFlyFrm *pFPos = 0; - const SwPosition* pAPos; SwFrmFmt *pFly; // erstmal alle Absatzgebundenen einsammeln @@ -1103,10 +1102,11 @@ void SwDoc::GetAllFlyFmts( SwPosFlyFrms& rPosFlyFmts, if( bFlyFmt || bDrawFmt ) { const SwFmtAnchor& rAnchor = pFly->GetAnchor(); - if( ( FLY_AT_CNTNT == rAnchor.GetAnchorId() || - FLY_AT_FLY == rAnchor.GetAnchorId() || - FLY_AUTO_CNTNT == rAnchor.GetAnchorId() ) && - 0 != ( pAPos = rAnchor.GetCntntAnchor()) ) + SwPosition const*const pAPos = rAnchor.GetCntntAnchor(); + if (pAPos && + ((FLY_AT_PARA == rAnchor.GetAnchorId()) || + (FLY_AT_FLY == rAnchor.GetAnchorId()) || + (FLY_AT_CHAR == rAnchor.GetAnchorId()))) { if( pCmpRange && !TstFlyRange( pCmpRange, pAPos, rAnchor.GetAnchorId() )) @@ -1140,9 +1140,9 @@ void SwDoc::GetAllFlyFmts( SwPosFlyFrms& rPosFlyFmts, continue; const SwFmtAnchor& rAnchor = pFly->GetAnchor(); - if( FLY_AT_CNTNT != rAnchor.GetAnchorId() && - FLY_AT_FLY != rAnchor.GetAnchorId() && - FLY_AUTO_CNTNT != rAnchor.GetAnchorId() ) + if ((FLY_AT_PARA != rAnchor.GetAnchorId()) && + (FLY_AT_FLY != rAnchor.GetAnchorId()) && + (FLY_AT_CHAR != rAnchor.GetAnchorId())) { const SwCntntFrm * pCntntFrm = pPage->FindFirstBodyCntnt(); if ( !pCntntFrm ) @@ -1387,7 +1387,7 @@ SwFlyFrmFmt* SwDoc::InsertLabel( const SwLabelType eType, const String &rTxt, co //loesen wir vorher die Verbindung zwischen Attribut und Format. const SwFmtAnchor& rAnchor = pNewFmt->GetAnchor(); - if( FLY_IN_CNTNT == rAnchor.GetAnchorId() ) + if ( FLY_AS_CHAR == rAnchor.GetAnchorId() ) { const SwPosition *pPos = rAnchor.GetCntntAnchor(); SwTxtNode *pTxtNode = pPos->nNode.GetNode().GetTxtNode(); @@ -1433,7 +1433,7 @@ SwFlyFrmFmt* SwDoc::InsertLabel( const SwLabelType eType, const String &rTxt, co pNewSet->Put( SvxULSpaceItem(RES_UL_SPACE) ); //Der Alte ist absatzgebunden, und zwar am Absatz im neuen. - SwFmtAnchor aAnch( FLY_AT_CNTNT ); + SwFmtAnchor aAnch( FLY_AT_PARA ); SwNodeIndex aAnchIdx( *pNewFmt->GetCntnt().GetCntntIdx(), 1 ); pNew = aAnchIdx.GetNode().GetTxtNode(); SwPosition aPos( aAnchIdx ); @@ -1684,7 +1684,7 @@ SwFlyFrmFmt* SwDoc::InsertDrawLabel( const String &rTxt, pNewFmt->SetFmtAttr( *pNewSet ); const SwFmtAnchor& rAnchor = pNewFmt->GetAnchor(); - if( FLY_IN_CNTNT == rAnchor.GetAnchorId() ) + if ( FLY_AS_CHAR == rAnchor.GetAnchorId() ) { const SwPosition *pPos = rAnchor.GetCntntAnchor(); SwTxtNode *pTxtNode = pPos->nNode.GetNode().GetTxtNode(); @@ -1722,7 +1722,7 @@ SwFlyFrmFmt* SwDoc::InsertDrawLabel( const String &rTxt, pNewSet->Put( SwFmtHoriOrient( 0, text::HoriOrientation::CENTER, text::RelOrientation::FRAME ) ); //Der Alte ist absatzgebunden, und zwar am Absatz im neuen. - SwFmtAnchor aAnch( FLY_AT_CNTNT ); + SwFmtAnchor aAnch( FLY_AT_PARA ); SwNodeIndex aAnchIdx( *pNewFmt->GetCntnt().GetCntntIdx(), 1 ); pNew = aAnchIdx.GetNode().GetTxtNode(); SwPosition aPos( aAnchIdx ); @@ -2095,15 +2095,17 @@ void SwDoc::SetAllUniqueFlyNames() if( bLoadedFlag ) { const SwFmtAnchor& rAnchor = pFlyFmt->GetAnchor(); - if( ( FLY_PAGE == rAnchor.GetAnchorId() && - rAnchor.GetCntntAnchor() ) || + if (((FLY_AT_PAGE == rAnchor.GetAnchorId()) && + rAnchor.GetCntntAnchor()) || // oder werden DrawObjecte rel. zu irgendetwas ausgerichtet? ( RES_DRAWFRMFMT == pFlyFmt->Which() && ( SFX_ITEM_SET == pFlyFmt->GetItemState( RES_VERT_ORIENT )|| SFX_ITEM_SET == pFlyFmt->GetItemState( RES_HORI_ORIENT ))) ) + { bLoadedFlag = sal_False; + } } } @@ -2200,9 +2202,11 @@ sal_Bool SwDoc::IsInHeaderFooter( const SwNodeIndex& rIdx ) const if( pIdx && pFlyNd == &pIdx->GetNode() ) { const SwFmtAnchor& rAnchor = pFmt->GetAnchor(); - if( FLY_PAGE == rAnchor.GetAnchorId() || + if ((FLY_AT_PAGE == rAnchor.GetAnchorId()) || !rAnchor.GetCntntAnchor() ) + { return sal_False; + } pNd = &rAnchor.GetCntntAnchor()->nNode.GetNode(); pFlyNd = pNd->FindFlyStartNode(); @@ -2247,10 +2251,12 @@ short SwDoc::GetTextDirection( const SwPosition& rPos, { pItem = 0; const SwFmtAnchor* pAnchor = &pFlyFmt->GetAnchor(); - if( FLY_PAGE != pAnchor->GetAnchorId() && - pAnchor->GetCntntAnchor() ) + if ((FLY_AT_PAGE != pAnchor->GetAnchorId()) && + pAnchor->GetCntntAnchor()) + { pFlyFmt = pAnchor->GetCntntAnchor()->nNode. GetNode().GetFlyFmt(); + } else pFlyFmt = 0; } diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index 2a36ce970615..71c42cf27176 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -1415,7 +1415,7 @@ void SwDoc::Paste( const SwDoc& rSource ) if( bInsWithFmt ) { SwFmtAnchor aAnchor( rCpyFmt.GetAnchor() ); - if( FLY_PAGE == aAnchor.GetAnchorId() ) + if (FLY_AT_PAGE == aAnchor.GetAnchorId()) { aAnchor.SetPageNum( aAnchor.GetPageNum() + /*nStartPageNumber - */1 ); } diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx index 3f1a6babac56..de845b4ef433 100644 --- a/sw/source/core/doc/docsort.cxx +++ b/sw/source/core/doc/docsort.cxx @@ -48,9 +48,7 @@ #include #include #include -#ifndef _DOCSORT_HXX #include -#endif #include #include #include @@ -341,18 +339,13 @@ BOOL SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt) const SwPosition *pStart = rPaM.Start(), *pEnd = rPaM.End(); // Index auf den Start der Selektion - SwFrmFmt* pFmt; - const SwFmtAnchor* pAnchor; - const SwPosition* pAPos; - USHORT n; - - for( n = 0; n < GetSpzFrmFmts()->Count(); ++n ) + for ( USHORT n = 0; n < GetSpzFrmFmts()->Count(); ++n ) { - pFmt = (SwFrmFmt*)(*GetSpzFrmFmts())[n]; - pAnchor = &pFmt->GetAnchor(); + SwFrmFmt *const pFmt = static_cast((*GetSpzFrmFmts())[n]); + SwFmtAnchor const*const pAnchor = &pFmt->GetAnchor(); + SwPosition const*const pAPos = pAnchor->GetCntntAnchor(); - if( FLY_AT_CNTNT == pAnchor->GetAnchorId() && - 0 != (pAPos = pAnchor->GetCntntAnchor() ) && + if (pAPos && (FLY_AT_PARA == pAnchor->GetAnchorId()) && pStart->nNode <= pAPos->nNode && pAPos->nNode <= pEnd->nNode ) return FALSE; } @@ -444,7 +437,7 @@ BOOL SwDoc::SortText(const SwPaM& rPaM, const SwSortOptions& rOpt) DoUndo( FALSE ); - for( n = 0; n < aSortArr.Count(); ++n ) + for ( USHORT n = 0; n < aSortArr.Count(); ++n ) { SwSortTxtElement* pBox = (SwSortTxtElement*)aSortArr[n]; aStart = nBeg + n; diff --git a/sw/source/core/doc/poolfmt.cxx b/sw/source/core/doc/poolfmt.cxx index 5e2b2fead999..058dd50a833c 100644 --- a/sw/source/core/doc/poolfmt.cxx +++ b/sw/source/core/doc/poolfmt.cxx @@ -37,9 +37,7 @@ #include #include #include -#ifndef _SVX_TSTPITEM_HXX //autogen #include -#endif #include #include #include @@ -55,9 +53,7 @@ #include #include #include -#ifndef _SVX_EMPHITEM_HXX #include -#endif #include #include #include @@ -1303,13 +1299,13 @@ SwFmt* SwDoc::GetFmtFromPool( USHORT nId ) { if ( get(IDocumentSettingAccess::BROWSE_MODE) ) { - aSet.Put( SwFmtAnchor( FLY_IN_CNTNT )); + aSet.Put( SwFmtAnchor( FLY_AS_CHAR )); aSet.Put( SwFmtVertOrient( 0, text::VertOrientation::LINE_CENTER, text::RelOrientation::PRINT_AREA ) ); aSet.Put( SwFmtSurround( SURROUND_NONE ) ); } else { - aSet.Put( SwFmtAnchor( FLY_AT_CNTNT )); + aSet.Put( SwFmtAnchor( FLY_AT_PARA )); aSet.Put( SwFmtSurround( SURROUND_PARALLEL ) ); aSet.Put( SwFmtHoriOrient( 0, text::HoriOrientation::CENTER, text::RelOrientation::PRINT_AREA ) ); aSet.Put( SwFmtVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::PRINT_AREA ) ); @@ -1330,7 +1326,7 @@ SwFmt* SwDoc::GetFmtFromPool( USHORT nId ) case RES_POOLFRM_GRAPHIC: case RES_POOLFRM_OLE: { - aSet.Put( SwFmtAnchor( FLY_AT_CNTNT )); + aSet.Put( SwFmtAnchor( FLY_AT_PARA )); aSet.Put( SwFmtHoriOrient( 0, text::HoriOrientation::CENTER, text::RelOrientation::FRAME )); aSet.Put( SwFmtVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME )); aSet.Put( SwFmtSurround( SURROUND_NONE )); @@ -1338,14 +1334,14 @@ SwFmt* SwDoc::GetFmtFromPool( USHORT nId ) break; case RES_POOLFRM_FORMEL: { - aSet.Put( SwFmtAnchor( FLY_IN_CNTNT ) ); + aSet.Put( SwFmtAnchor( FLY_AS_CHAR ) ); aSet.Put( SwFmtVertOrient( 0, text::VertOrientation::CHAR_CENTER, text::RelOrientation::FRAME ) ); aSet.Put( SvxLRSpaceItem( 114, 114, 0, 0, RES_LR_SPACE ) ); } break; case RES_POOLFRM_MARGINAL: { - aSet.Put( SwFmtAnchor( FLY_AT_CNTNT )); + aSet.Put( SwFmtAnchor( FLY_AT_PARA )); aSet.Put( SwFmtHoriOrient( 0, text::HoriOrientation::LEFT, text::RelOrientation::FRAME )); aSet.Put( SwFmtVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME )); aSet.Put( SwFmtSurround( SURROUND_PARALLEL )); @@ -1358,7 +1354,7 @@ SwFmt* SwDoc::GetFmtFromPool( USHORT nId ) break; case RES_POOLFRM_WATERSIGN: { - aSet.Put( SwFmtAnchor( FLY_PAGE )); + aSet.Put( SwFmtAnchor( FLY_AT_PAGE )); aSet.Put( SwFmtHoriOrient( 0, text::HoriOrientation::CENTER, text::RelOrientation::FRAME )); aSet.Put( SwFmtVertOrient( 0, text::VertOrientation::CENTER, text::RelOrientation::FRAME )); aSet.Put( SvxOpaqueItem( FALSE )); @@ -1368,7 +1364,7 @@ SwFmt* SwDoc::GetFmtFromPool( USHORT nId ) case RES_POOLFRM_LABEL: { - aSet.Put( SwFmtAnchor( FLY_IN_CNTNT ) ); + aSet.Put( SwFmtAnchor( FLY_AS_CHAR ) ); aSet.Put( SwFmtVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME ) ); aSet.Put( SvxLRSpaceItem( 114, 114, 0, 0, RES_LR_SPACE ) ); diff --git a/sw/source/core/doc/tblcpy.cxx b/sw/source/core/doc/tblcpy.cxx index 5eea4c33247c..297328d0cca5 100644 --- a/sw/source/core/doc/tblcpy.cxx +++ b/sw/source/core/doc/tblcpy.cxx @@ -591,14 +591,14 @@ void lcl_CpyBox( const SwTable& rCpyTbl, const SwTableBox* pCpyBox, } // stehen noch FlyFrames rum, loesche auch diese - const SwPosition* pAPos; for( USHORT n = 0; n < pDoc->GetSpzFrmFmts()->Count(); ++n ) { - SwFrmFmt* pFly = (*pDoc->GetSpzFrmFmts())[n]; - const SwFmtAnchor* pAnchor = &pFly->GetAnchor(); - if( ( FLY_AT_CNTNT == pAnchor->GetAnchorId() || - FLY_AUTO_CNTNT == pAnchor->GetAnchorId() ) && - 0 != ( pAPos = pAnchor->GetCntntAnchor() ) && + SwFrmFmt *const pFly = (*pDoc->GetSpzFrmFmts())[n]; + SwFmtAnchor const*const pAnchor = &pFly->GetAnchor(); + SwPosition const*const pAPos = pAnchor->GetCntntAnchor(); + if (pAPos && + ((FLY_AT_PARA == pAnchor->GetAnchorId()) || + (FLY_AT_CHAR == pAnchor->GetAnchorId())) && aInsIdx <= pAPos->nNode && pAPos->nNode <= aEndNdIdx ) { pDoc->DelLayoutFmt( pFly ); diff --git a/sw/source/core/docnode/ndcopy.cxx b/sw/source/core/docnode/ndcopy.cxx index a2263bc3f442..f37b9c36392c 100644 --- a/sw/source/core/docnode/ndcopy.cxx +++ b/sw/source/core/docnode/ndcopy.cxx @@ -552,20 +552,18 @@ void SwTxtNode::CopyCollFmt( SwTxtNode& rDestNd ) BOOL lcl_ChkFlyFly( SwDoc* pDoc, ULONG nSttNd, ULONG nEndNd, ULONG nInsNd ) { - const SwFrmFmt* pFmt; - const SwFmtAnchor* pAnchor; - const SwPosition* pAPos; const SwSpzFrmFmts& rFrmFmtTbl = *pDoc->GetSpzFrmFmts(); for( USHORT n = 0; n < rFrmFmtTbl.Count(); ++n ) { - pFmt = rFrmFmtTbl[n]; - pAnchor = &pFmt->GetAnchor(); - if( 0 != ( pAPos = pAnchor->GetCntntAnchor()) && - ( FLY_IN_CNTNT == pAnchor->GetAnchorId() || - FLY_AUTO_CNTNT == pAnchor->GetAnchorId() || - FLY_AT_FLY == pAnchor->GetAnchorId() || - FLY_AT_CNTNT == pAnchor->GetAnchorId() ) && + SwFrmFmt const*const pFmt = rFrmFmtTbl[n]; + SwFmtAnchor const*const pAnchor = &pFmt->GetAnchor(); + SwPosition const*const pAPos = pAnchor->GetCntntAnchor(); + if (pAPos && + ((FLY_AS_CHAR == pAnchor->GetAnchorId()) || + (FLY_AT_CHAR == pAnchor->GetAnchorId()) || + (FLY_AT_FLY == pAnchor->GetAnchorId()) || + (FLY_AT_PARA == pAnchor->GetAnchorId())) && nSttNd <= pAPos->nNode.GetIndex() && pAPos->nNode.GetIndex() < nEndNd ) { @@ -1398,18 +1396,17 @@ void SwDoc::CopyFlyInFlyImpl( const SwNodeRange& rRg, SwDoc *const pDest = rStartIdx.GetNode().GetDoc(); _ZSortFlys aArr; USHORT nArrLen = GetSpzFrmFmts()->Count(); - USHORT n; - for( n = 0; n < nArrLen; ++n ) + for ( USHORT n = 0; n < nArrLen; ++n ) { - const SwFrmFmt* pFmt = (*GetSpzFrmFmts())[n]; - const SwFmtAnchor* pAnchor = &pFmt->GetAnchor(); - const SwPosition* pAPos; - bool bAtCntnt = pAnchor->GetAnchorId() == FLY_AT_CNTNT; - if ( ( bAtCntnt || - pAnchor->GetAnchorId() == FLY_AT_FLY || - pAnchor->GetAnchorId() == FLY_AUTO_CNTNT ) && - 0 != ( pAPos = pAnchor->GetCntntAnchor()) && + SwFrmFmt const*const pFmt = (*GetSpzFrmFmts())[n]; + SwFmtAnchor const*const pAnchor = &pFmt->GetAnchor(); + SwPosition const*const pAPos = pAnchor->GetCntntAnchor(); + bool bAtCntnt = (pAnchor->GetAnchorId() == FLY_AT_PARA); + if ( pAPos && + ( bAtCntnt || + (pAnchor->GetAnchorId() == FLY_AT_FLY) || + (pAnchor->GetAnchorId() == FLY_AT_CHAR)) && (( bCopyFlyAtFly && FLY_AT_FLY == pAnchor->GetAnchorId() ) ? rRg.aStart <= pAPos->nNode.GetIndex() + 1 : ( IsRedlineMove() @@ -1470,7 +1467,7 @@ void SwDoc::CopyFlyInFlyImpl( const SwNodeRange& rRg, //die Chains entsprechend aufgebaut werden koennen. SvPtrarr aNewArr( 10, 10 ); - for( n = 0; n < aArr.Count(); ++n ) + for ( USHORT n = 0; n < aArr.Count(); ++n ) { const _ZSortFly& rZSortFly = aArr[ n ]; @@ -1485,8 +1482,8 @@ void SwDoc::CopyFlyInFlyImpl( const SwNodeRange& rRg, // method . // Thus, the new anchor position in the destination document is found // by counting the text nodes. - if ( aAnchor.GetAnchorId() == FLY_AT_CNTNT || - aAnchor.GetAnchorId() == FLY_AUTO_CNTNT ) + if ((aAnchor.GetAnchorId() == FLY_AT_PARA) || + (aAnchor.GetAnchorId() == FLY_AT_CHAR) ) { // First, determine number of anchor text node in the copied range. // Note: The anchor text node *have* to be inside the copied range. @@ -1552,7 +1549,7 @@ void SwDoc::CopyFlyInFlyImpl( const SwNodeRange& rRg, } // <-- // die am Zeichen Flys wieder ans das vorgegebene Zeichen setzen - if ( FLY_AUTO_CNTNT == aAnchor.GetAnchorId() && + if ((FLY_AT_CHAR == aAnchor.GetAnchorId()) && pNewPos->nNode.GetNode().IsTxtNode() ) { pNewPos->nContent.Assign( (SwTxtNode*)&pNewPos->nNode.GetNode(), @@ -1592,7 +1589,7 @@ void SwDoc::CopyFlyInFlyImpl( const SwNodeRange& rRg, ASSERT( aArr.Count() == aNewArr.Count(), "Missing new Flys" ); if ( aArr.Count() == aNewArr.Count() ) { - for ( n = 0; n < aArr.Count(); ++n ) + for ( USHORT n = 0; n < aArr.Count(); ++n ) { const SwFrmFmt *pFmt = aArr[n].GetFmt(); const SwFmtChain &rChain = pFmt->GetChain(); diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index 6407e505aa0c..3c4149298983 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -38,7 +38,6 @@ #endif #include - #include #include #include @@ -91,9 +90,7 @@ #include #endif #include "docsh.hxx" -#ifdef LINUX #include -#endif #include #include @@ -104,6 +101,9 @@ // --> OD 2005-12-05 #i27138# #include // <-- +#include + + #ifdef PRODUCT #define CHECK_TABLE(t) #else @@ -113,7 +113,6 @@ #define CHECK_TABLE(t) #endif #endif -#include using namespace ::com::sun::star; @@ -1684,17 +1683,19 @@ BOOL SwNodes::TableToText( const SwNodeRange& rRange, sal_Unicode cCh, // #i28006# Fly frames have to be restored even if the table was // #alone in the section const SwSpzFrmFmts& rFlyArr = *GetDoc()->GetSpzFrmFmts(); - const SwPosition* pAPos; for( USHORT n = 0; n < rFlyArr.Count(); ++n ) { - SwFrmFmt* pFmt = (SwFrmFmt*)rFlyArr[n]; + SwFrmFmt *const pFmt = (SwFrmFmt*)rFlyArr[n]; const SwFmtAnchor& rAnchor = pFmt->GetAnchor(); - if( ( FLY_AT_CNTNT == rAnchor.GetAnchorId() || - FLY_AUTO_CNTNT == rAnchor.GetAnchorId() ) && - 0 != ( pAPos = rAnchor.GetCntntAnchor() ) && + SwPosition const*const pAPos = rAnchor.GetCntntAnchor(); + if (pAPos && + ((FLY_AT_PARA == rAnchor.GetAnchorId()) || + (FLY_AT_CHAR == rAnchor.GetAnchorId())) && nStt <= pAPos->nNode.GetIndex() && pAPos->nNode.GetIndex() < nEnd ) + { pFmt->MakeFrms(); + } } return TRUE; diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx index 61dd90bc509c..2dd69ef99db5 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -38,9 +38,7 @@ #include // <-- #include -#ifndef _COM_SUN_STAR_I18N_CHARACTERITERATORMODE_HDL_ #include -#endif #include #include #include @@ -609,7 +607,7 @@ const SwPageDesc* SwNode::FindPageDesc( BOOL bCalcLay, if( pFmt ) { const SwFmtAnchor* pAnchor = &pFmt->GetAnchor(); - if( FLY_PAGE != pAnchor->GetAnchorId() && + if ((FLY_AT_PAGE != pAnchor->GetAnchorId()) && pAnchor->GetCntntAnchor() ) { pNd = &pAnchor->GetCntntAnchor()->nNode.GetNode(); @@ -631,7 +629,7 @@ const SwPageDesc* SwNode::FindPageDesc( BOOL bCalcLay, break; } pAnchor = &pFrmFmt->GetAnchor(); - if( FLY_PAGE == pAnchor->GetAnchorId() || + if ((FLY_AT_PAGE == pAnchor->GetAnchorId()) || !pAnchor->GetCntntAnchor() ) { pFlyNd = 0; diff --git a/sw/source/core/docnode/swbaslnk.cxx b/sw/source/core/docnode/swbaslnk.cxx index bb799f7728e0..822a21e5b8c8 100644 --- a/sw/source/core/docnode/swbaslnk.cxx +++ b/sw/source/core/docnode/swbaslnk.cxx @@ -31,14 +31,11 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - #include #include #include -#ifndef _OSL_THREAD_HXX_ #include -#endif #include #include #include @@ -492,18 +489,23 @@ void SwBaseLink::Closed() const SwNode* SwBaseLink::GetAnchor() const { - SwFrmFmt* pFmt; - if( pCntntNode && 0 != ( pFmt = pCntntNode->GetFlyFmt()) ) + if (pCntntNode) { - const SwFmtAnchor& rAnchor = pFmt->GetAnchor(); - const SwPosition* pAPos; - if( 0 != ( pAPos = rAnchor.GetCntntAnchor()) && - ( FLY_IN_CNTNT == rAnchor.GetAnchorId() || - FLY_AUTO_CNTNT == rAnchor.GetAnchorId() || - FLY_AT_FLY == rAnchor.GetAnchorId() || - FLY_AT_CNTNT == rAnchor.GetAnchorId() )) - return &pAPos->nNode.GetNode(); - return 0; + SwFrmFmt *const pFmt = pCntntNode->GetFlyFmt(); + if (pFmt) + { + const SwFmtAnchor& rAnchor = pFmt->GetAnchor(); + SwPosition const*const pAPos = rAnchor.GetCntntAnchor(); + if (pAPos && + ((FLY_AS_CHAR == rAnchor.GetAnchorId()) || + (FLY_AT_CHAR == rAnchor.GetAnchorId()) || + (FLY_AT_FLY == rAnchor.GetAnchorId()) || + (FLY_AT_PARA == rAnchor.GetAnchorId()))) + { + return &pAPos->nNode.GetNode(); + } + return 0; + } } ASSERT( !this, "GetAnchor nicht ueberlagert" ); diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx index aa20281038da..13ae626bc8c7 100644 --- a/sw/source/core/draw/dcontact.cxx +++ b/sw/source/core/draw/dcontact.cxx @@ -61,9 +61,7 @@ #include #include #include -#ifndef IDOCUMENTDRAWMODELACCESS_HXX_INCLUDED #include -#endif #include #include #include @@ -80,17 +78,9 @@ #include // AW: For VCOfDrawVirtObj and stuff -#ifndef _SDR_CONTACT_VIEWCONTACTOFVIRTOBJ_HXX #include -#endif - -#ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TRANSFORMPRIMITIVE2D_HXX #include -#endif - -#ifndef _SDR_CONTACT_VIEWOBJECTCONTACTOFSDROBJ_HXX #include -#endif #include @@ -1958,7 +1948,7 @@ void SwDrawContact::ConnectToLayout( const SwFmtAnchor* pAnch ) switch ( pAnch->GetAnchorId() ) { - case FLY_PAGE: + case FLY_AT_PAGE: { USHORT nPgNum = pAnch->GetPageNum(); SwPageFrm *pPage = static_cast(pRoot->Lower()); @@ -1978,12 +1968,12 @@ void SwDrawContact::ConnectToLayout( const SwFmtAnchor* pAnch ) } break; - case FLY_AUTO_CNTNT: - case FLY_AT_CNTNT: + case FLY_AT_CHAR: + case FLY_AT_PARA: case FLY_AT_FLY: - case FLY_IN_CNTNT: + case FLY_AS_CHAR: { - if ( pAnch->GetAnchorId() == FLY_IN_CNTNT ) + if ( pAnch->GetAnchorId() == FLY_AS_CHAR ) { ClrContourCache( GetMaster() ); } @@ -2058,7 +2048,7 @@ void SwDrawContact::ConnectToLayout( const SwFmtAnchor* pAnch ) // OD 2004-01-20 #110582# - find correct follow for // as character anchored objects. - if ( pAnch->GetAnchorId() == FLY_IN_CNTNT && + if ((pAnch->GetAnchorId() == FLY_AS_CHAR) && pFrm->IsTxtFrm() ) { pFrm = lcl_GetFlyInCntntAnchor( @@ -2076,7 +2066,7 @@ void SwDrawContact::ConnectToLayout( const SwFmtAnchor* pAnch ) { // append 'virtual' drawing object SwDrawVirtObj* pDrawVirtObj = AddVirtObj(); - if ( pAnch->GetAnchorId() == FLY_IN_CNTNT ) + if ( pAnch->GetAnchorId() == FLY_AS_CHAR ) { ClrContourCache( pDrawVirtObj ); } @@ -2087,7 +2077,7 @@ void SwDrawContact::ConnectToLayout( const SwFmtAnchor* pAnch ) pDrawVirtObj->ActionChanged(); } - if ( pAnch->GetAnchorId() == FLY_IN_CNTNT ) + if ( pAnch->GetAnchorId() == FLY_AS_CHAR ) { pFrm->InvalidatePrt(); } diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx index 9843f8f8c34e..8cf40983caf9 100644 --- a/sw/source/core/draw/dview.cxx +++ b/sw/source/core/draw/dview.cxx @@ -34,9 +34,7 @@ #include "hintids.hxx" #include #include -#ifndef _FM_FMMODEL_HXX #include -#endif #include "swtypes.hxx" #include "pagefrm.hxx" @@ -62,8 +60,6 @@ #include -using namespace com::sun::star; - // OD 18.06.2003 #108784# //#ifndef _SVDVMARK_HXX //autogen //#include @@ -74,6 +70,10 @@ using namespace com::sun::star; #include // <-- + +using namespace com::sun::star; + + class SwSdrHdl : public SdrHdl { public: @@ -258,7 +258,7 @@ void SwDrawView::AddCustomHdl() const SwFmtAnchor &rAnchor = pFrmFmt->GetAnchor(); // <-- - if(FLY_IN_CNTNT == rAnchor.GetAnchorId()) + if (FLY_AS_CHAR == rAnchor.GetAnchorId()) return; const SwFrm* pAnch; @@ -267,7 +267,7 @@ void SwDrawView::AddCustomHdl() Point aPos(aAnchorPoint); - if ( FLY_AUTO_CNTNT == rAnchor.GetAnchorId() ) + if ( FLY_AT_CHAR == rAnchor.GetAnchorId() ) { // --> OD 2004-06-24 #i28701# - use last character rectangle saved at object // in order to avoid a format of the anchor frame @@ -1019,7 +1019,7 @@ void SwDrawView::CheckPossibilities() " - missing frame format" ); bProtect = TRUE; } - else if ( FLY_IN_CNTNT == pFrmFmt->GetAnchor().GetAnchorId() && + else if ((FLY_AS_CHAR == pFrmFmt->GetAnchor().GetAnchorId()) && rMrkList.GetMarkCount() > 1 ) { bProtect = TRUE; diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index 7bacee8fbde4..533810062ee7 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -386,7 +386,7 @@ BOOL SwAutoFormat::HasObjects( const SwNode& rNd ) for( USHORT n = 0; n < rFmts.Count(); ++n ) { const SwFmtAnchor& rAnchor = rFmts[ n ]->GetAnchor(); - if( FLY_PAGE != rAnchor.GetAnchorId() && + if ((FLY_AT_PAGE != rAnchor.GetAnchorId()) && rAnchor.GetCntntAnchor() && &rAnchor.GetCntntAnchor()->nNode.GetNode() == &rNd ) { diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx index ccb47233753d..38745a12ba7b 100644 --- a/sw/source/core/fields/expfld.cxx +++ b/sw/source/core/fields/expfld.cxx @@ -64,9 +64,7 @@ #include #include #include -#ifndef _UNOFLDMID_H #include -#endif #include using namespace ::com::sun::star; @@ -187,17 +185,20 @@ const SwTxtNode* GetBodyTxtNode( const SwDoc& rDoc, SwPosition& rPos, pLayout = (SwLayoutFrm*)((SwFlyFrm*)pLayout)->GetAnchorFrm(); continue; } - else if( FLY_AT_CNTNT == rAnchor.GetAnchorId() || - FLY_AUTO_CNTNT == rAnchor.GetAnchorId() || - FLY_IN_CNTNT == rAnchor.GetAnchorId() ) + else if ((FLY_AT_PARA == rAnchor.GetAnchorId()) || + (FLY_AT_CHAR == rAnchor.GetAnchorId()) || + (FLY_AS_CHAR == rAnchor.GetAnchorId())) { ASSERT( rAnchor.GetCntntAnchor(), "keine gueltige Position" ); rPos = *rAnchor.GetCntntAnchor(); pTxtNode = rPos.nNode.GetNode().GetTxtNode(); - if( FLY_AT_CNTNT == rAnchor.GetAnchorId() ) - ((SwTxtNode*)pTxtNode)->MakeStartIndex( &rPos.nContent ); + if ( FLY_AT_PARA == rAnchor.GetAnchorId() ) + { + const_cast(pTxtNode)->MakeStartIndex( + &rPos.nContent ); // oder doch besser das Ende vom (Anker-)TextNode nehmen ?? // ((SwTxtNode*)pTxtNode)->MakeEndIndex( &rPos.nContent ); + } // noch nicht abbrechen, kann ja auch noch im // Header/Footer/Footnote/Fly stehen !! diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx index ccd2d86e4531..bb1a230699ae 100644 --- a/sw/source/core/frmedt/fecopy.cxx +++ b/sw/source/core/frmedt/fecopy.cxx @@ -151,14 +151,16 @@ BOOL SwFEShell::Copy( SwDoc* pClpDoc, const String* pNewClpTxt ) SwFrmFmt* pFlyFmt = pFly->GetFmt(); SwFmtAnchor aAnchor( pFlyFmt->GetAnchor() ); - if ( FLY_AT_CNTNT == aAnchor.GetAnchorId() || - FLY_AUTO_CNTNT == aAnchor.GetAnchorId() || - FLY_AT_FLY == aAnchor.GetAnchorId() || - FLY_IN_CNTNT == aAnchor.GetAnchorId() ) + if ((FLY_AT_PARA == aAnchor.GetAnchorId()) || + (FLY_AT_CHAR == aAnchor.GetAnchorId()) || + (FLY_AT_FLY == aAnchor.GetAnchorId()) || + (FLY_AS_CHAR == aAnchor.GetAnchorId())) { SwPosition aPos( aSttIdx ); - if( FLY_IN_CNTNT == aAnchor.GetAnchorId() ) + if ( FLY_AS_CHAR == aAnchor.GetAnchorId() ) + { aPos.nContent.Assign( pTxtNd, 0 ); + } aAnchor.SetAnchor( &aPos ); } pFlyFmt = pClpDoc->CopyLayoutFmt( *pFlyFmt, aAnchor, true, true ); @@ -175,7 +177,7 @@ BOOL SwFEShell::Copy( SwDoc* pClpDoc, const String* pNewClpTxt ) rSpzFrmFmts.Insert( pFlyFmt, 0 ); } - if( FLY_IN_CNTNT == aAnchor.GetAnchorId() ) + if ( FLY_AS_CHAR == aAnchor.GetAnchorId() ) { // JP 13.02.99 Bug 61863: wenn eine Rahmenselektion ins Clipboard // gestellt wird, so muss beim Pasten auch wieder @@ -206,24 +208,25 @@ BOOL SwFEShell::Copy( SwDoc* pClpDoc, const String* pNewClpTxt ) { SfxItemSet aSet( pClpDoc->GetAttrPool(), aFrmFmtSetRange ); - SwFmtAnchor aAnchor( FLY_AT_CNTNT ); + SwFmtAnchor aAnchor( FLY_AT_PARA ); aAnchor.SetAnchor( &aPos ); aSet.Put( aAnchor ); - SdrObject* pNew = pClpDoc->CloneSdrObj( *pObj, FALSE, TRUE ); + SdrObject *const pNew = + pClpDoc->CloneSdrObj( *pObj, FALSE, TRUE ); SwPaM aTemp(aPos); - pClpDoc->Insert(aTemp, *pNew, &aSet, NULL); + pClpDoc->Insert(aTemp, *pNew, &aSet, NULL); } else { SwDrawContact *pContact = (SwDrawContact*)GetUserCall( pObj ); SwFrmFmt *pFmt = pContact->GetFmt(); SwFmtAnchor aAnchor( pFmt->GetAnchor() ); - if ( FLY_AT_CNTNT == aAnchor.GetAnchorId() || - FLY_AUTO_CNTNT == aAnchor.GetAnchorId() || - FLY_AT_FLY == aAnchor.GetAnchorId() || - FLY_IN_CNTNT == aAnchor.GetAnchorId() ) + if ((FLY_AT_PARA == aAnchor.GetAnchorId()) || + (FLY_AT_CHAR == aAnchor.GetAnchorId()) || + (FLY_AT_FLY == aAnchor.GetAnchorId()) || + (FLY_AS_CHAR == aAnchor.GetAnchorId())) { aAnchor.SetAnchor( &aPos ); } @@ -269,7 +272,9 @@ BOOL lcl_SetAnchor( const SwPosition& rPos, const SwNode& rNd, SwFlyFrm* pFly, SwCntntFrm* pTmpFrm = rNd.GetCntntNode()->GetFrm( &rInsPt, 0, FALSE ); SwFlyFrm *pTmpFly = pTmpFrm->FindFlyFrm(); if( pTmpFly && bCheckFlyRecur && pFly->IsUpperOf( *pTmpFly ) ) + { bRet = FALSE; + } else if ( FLY_AT_FLY == rAnchor.GetAnchorId() ) { if( pTmpFly ) @@ -281,7 +286,7 @@ BOOL lcl_SetAnchor( const SwPosition& rPos, const SwNode& rNd, SwFlyFrm* pFly, } else { - rAnchor.SetType( FLY_PAGE ); + rAnchor.SetType( FLY_AT_PAGE ); rAnchor.SetPageNum( rDestShell.GetPageNumber( rInsPt ) ); const SwFrm *pPg = pTmpFrm->FindPageFrm(); rNewPos = pPg->Frm().Pos(); @@ -329,7 +334,7 @@ BOOL SwFEShell::CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt, // in die Gruppe einfuegen, wenns aus einer betretenen Gruppe // kommt oder das Object nicht zeichengebunden ist if( pSrcDrwView->IsGroupEntered() || - FLY_IN_CNTNT != rAnchor.GetAnchorId() ) + (FLY_AS_CHAR != rAnchor.GetAnchorId()) ) { SdrObject* pNew = pDestDoc->CloneSdrObj( *pObj, bIsMove && @@ -345,10 +350,10 @@ BOOL SwFEShell::CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt, SwFmtAnchor aAnchor( rAnchor ); Point aNewAnch; - if ( FLY_AT_CNTNT == aAnchor.GetAnchorId() || - FLY_AUTO_CNTNT == aAnchor.GetAnchorId() || - FLY_AT_FLY == aAnchor.GetAnchorId() || - FLY_IN_CNTNT == aAnchor.GetAnchorId() ) + if ((FLY_AT_PARA == aAnchor.GetAnchorId()) || + (FLY_AT_CHAR == aAnchor.GetAnchorId()) || + (FLY_AT_FLY == aAnchor.GetAnchorId()) || + (FLY_AS_CHAR == aAnchor.GetAnchorId())) { if ( this == pDestShell ) { @@ -378,7 +383,7 @@ BOOL SwFEShell::CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt, aNewAnch, FALSE ); } } - else if( FLY_PAGE == aAnchor.GetAnchorId() ) + else if ( FLY_AT_PAGE == aAnchor.GetAnchorId() ) { aAnchor.SetPageNum( pDestShell->GetPageNumber( rInsPt ) ); const SwRootFrm* pTmpRoot = pDestShell->GetLayout(); @@ -406,7 +411,7 @@ BOOL SwFEShell::CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt, if ( pFmt ) { SdrObject* pNew = pFmt->FindSdrObject(); - if( FLY_IN_CNTNT != aAnchor.GetAnchorId() ) + if ( FLY_AS_CHAR != aAnchor.GetAnchorId() ) { Point aPos( rInsPt ); aPos -= aNewAnch; @@ -496,10 +501,10 @@ BOOL SwFEShell::Copy( SwFEShell* pDestShell, const Point& rSttPt, bRet = TRUE; Point aNewAnch; - if ( FLY_AT_CNTNT == aAnchor.GetAnchorId() || - FLY_AUTO_CNTNT == aAnchor.GetAnchorId() || - FLY_AT_FLY == aAnchor.GetAnchorId() || - FLY_IN_CNTNT == aAnchor.GetAnchorId() ) + if ((FLY_AT_PARA == aAnchor.GetAnchorId()) || + (FLY_AT_CHAR == aAnchor.GetAnchorId()) || + (FLY_AT_FLY == aAnchor.GetAnchorId()) || + (FLY_AS_CHAR == aAnchor.GetAnchorId())) { if ( this == pDestShell ) { @@ -537,7 +542,7 @@ BOOL SwFEShell::Copy( SwFEShell* pDestShell, const Point& rSttPt, aNewAnch, GetDoc() == pDestShell->GetDoc()); } } - else if( FLY_PAGE == aAnchor.GetAnchorId() ) + else if ( FLY_AT_PAGE == aAnchor.GetAnchorId() ) { aAnchor.SetPageNum( pDestShell->GetPageNumber( rInsPt ) ); const SwRootFrm* pTmpRoot = pDestShell->GetLayout(); @@ -554,7 +559,7 @@ BOOL SwFEShell::Copy( SwFEShell* pDestShell, const Point& rSttPt, SwFrmFmt *pOldFmt = pFlyFmt; pFlyFmt = pDestShell->GetDoc()->CopyLayoutFmt( *pFlyFmt, aAnchor, true, true ); - if( FLY_IN_CNTNT != aAnchor.GetAnchorId() ) + if ( FLY_AS_CHAR != aAnchor.GetAnchorId() ) { Point aPos( rInsPt ); aPos -= aNewAnch; @@ -918,7 +923,7 @@ BOOL SwFEShell::Paste( SwDoc* pClpDoc, BOOL bIncludingPageFrames ) if( Imp()->GetDrawView()->IsGroupEntered() && RES_DRAWFRMFMT == rCpyFmt.Which() && - FLY_IN_CNTNT != rCpyFmt.GetAnchor().GetAnchorId() ) + (FLY_AS_CHAR != rCpyFmt.GetAnchor().GetAnchorId()) ) { const SdrObject* pSdrObj = rCpyFmt.FindSdrObject(); if( pSdrObj ) @@ -966,9 +971,9 @@ BOOL SwFEShell::Paste( SwDoc* pClpDoc, BOOL bIncludingPageFrames ) if( bInsWithFmt ) { SwFmtAnchor aAnchor( rCpyFmt.GetAnchor() ); - if( FLY_AT_CNTNT == aAnchor.GetAnchorId() || - FLY_AUTO_CNTNT == aAnchor.GetAnchorId() || - FLY_IN_CNTNT == aAnchor.GetAnchorId() ) + if ((FLY_AT_PARA == aAnchor.GetAnchorId()) || + (FLY_AT_CHAR == aAnchor.GetAnchorId()) || + (FLY_AS_CHAR == aAnchor.GetAnchorId())) { SwPosition* pPos = PCURCRSR->GetPoint(); // #108784# allow shapes (no controls) in header/footer @@ -979,7 +984,7 @@ BOOL SwFEShell::Paste( SwDoc* pClpDoc, BOOL bIncludingPageFrames ) aAnchor.SetAnchor( pPos ); } - else if( FLY_PAGE == aAnchor.GetAnchorId() ) + else if ( FLY_AT_PAGE == aAnchor.GetAnchorId() ) { aAnchor.SetPageNum( GetPhyPageNum() ); } @@ -1091,7 +1096,7 @@ BOOL SwFEShell::Paste( SwDoc* pClpDoc, BOOL bIncludingPageFrames ) if( bInsWithFmt ) { SwFmtAnchor aAnchor( rCpyFmt.GetAnchor() ); - if( FLY_PAGE == aAnchor.GetAnchorId() ) + if ( FLY_AT_PAGE == aAnchor.GetAnchorId() ) { aAnchor.SetPageNum( aAnchor.GetPageNum() + nStartPageNumber - 1 ); } @@ -1199,7 +1204,7 @@ BOOL SwFEShell::PastePages( SwFEShell& rToFill, USHORT nStartPage, USHORT nEndPa { const SwFrmFmt& rCpyFmt = *(*GetDoc()->GetSpzFrmFmts())[i]; SwFmtAnchor aAnchor( rCpyFmt.GetAnchor() ); - if( FLY_PAGE == aAnchor.GetAnchorId() && + if ((FLY_AT_PAGE == aAnchor.GetAnchorId()) && aAnchor.GetPageNum() >= nStartPage && aAnchor.GetPageNum() <= nEndPage) { aAnchor.SetPageNum( aAnchor.GetPageNum() - nStartPage + 1); diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx index 1b18dc178dae..db708c63a0e1 100644 --- a/sw/source/core/frmedt/fefly1.cxx +++ b/sw/source/core/frmedt/fefly1.cxx @@ -113,7 +113,7 @@ sal_Bool lcl_SetNewFlyPos( const SwNode& rNode, SwFmtAnchor& rAnchor, const SwPageFrm *pPg = pCFrm ? pCFrm->FindPageFrm() : 0; rAnchor.SetPageNum( pPg ? pPg->GetPhyPageNum() : 1 ); - rAnchor.SetType( FLY_PAGE ); + rAnchor.SetType( FLY_AT_PAGE ); } return bRet; } @@ -130,9 +130,9 @@ BOOL lcl_FindAnchorPos( SwDoc& rDoc, const Point& rPt, const SwFrm& rFrm, Point aTmpPnt( rPt ); switch( nNew ) { - case FLY_IN_CNTNT: // sollte der nicht auch mit hinein? - case FLY_AT_CNTNT: - case FLY_AUTO_CNTNT: // LAYER_IMPL + case FLY_AS_CHAR: // sollte der nicht auch mit hinein? + case FLY_AT_PARA: + case FLY_AT_CHAR: // LAYER_IMPL { //Ausgehend von der linken oberen Ecke des Fly den //dichtesten CntntFrm suchen. @@ -146,7 +146,7 @@ BOOL lcl_FindAnchorPos( SwDoc& rDoc, const Point& rPt, const SwFrm& rFrm, } SwPosition aPos( *((SwCntntFrm*)pNewAnch)->GetNode() ); - if( FLY_AUTO_CNTNT == nNew || FLY_IN_CNTNT == nNew ) + if ((FLY_AT_CHAR == nNew) || (FLY_AS_CHAR == nNew)) { // es muss ein TextNode gefunden werden, denn nur in diesen // ist ein Inhaltsgebundene Frames zu verankern @@ -186,10 +186,10 @@ BOOL lcl_FindAnchorPos( SwDoc& rDoc, const Point& rPt, const SwFrm& rFrm, } } - aNewAnch.SetType( nNew = FLY_PAGE ); + aNewAnch.SetType( nNew = FLY_AT_PAGE ); // no break - case FLY_PAGE: + case FLY_AT_PAGE: pNewAnch = rFrm.FindPageFrm(); aNewAnch.SetPageNum( pNewAnch->GetPhyPageNum() ); break; @@ -219,8 +219,8 @@ sal_Bool lcl_ChkAndSetNewAnchor( const SwFlyFrm& rFly, SfxItemSet& rSet ) SwDoc* pDoc = (SwDoc*)rFmt.GetDoc(); #ifndef PRODUCT - ASSERT( !(nNew == FLY_PAGE && - (FLY_AT_CNTNT==nOld || FLY_AUTO_CNTNT==nOld || FLY_IN_CNTNT==nOld ) && + ASSERT( !(nNew == FLY_AT_PAGE && + (FLY_AT_PARA==nOld || FLY_AT_CHAR==nOld || FLY_AS_CHAR==nOld ) && pDoc->IsInHeaderFooter( rOldAnch.GetCntntAnchor()->nNode )), "Unerlaubter Ankerwechsel in Head/Foot." ); #endif @@ -441,7 +441,7 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, sal_Bool bMoveIt ) SwFrmFmt& rFmt = pAnchoredObj->GetFrmFmt(); RndStdIds nAnchorId = rFmt.GetAnchor().GetAnchorId(); - if ( FLY_IN_CNTNT == nAnchorId ) + if ( FLY_AS_CHAR == nAnchorId ) return aRet; sal_Bool bFlyFrame = pObj->ISA(SwVirtFlyDrawObj); @@ -462,8 +462,10 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, sal_Bool bMoveIt ) pOldAnch = pFly->GetAnchorFrm(); if( !pOldAnch ) return aRet; - if( FLY_PAGE != nAnchorId ) + if ( FLY_AT_PAGE != nAnchorId ) + { pFooterOrHeader = pCntnt->FindFooterOrHeader(); + } } // OD 26.06.2003 #108784# - set also for drawing // objects, but not for control objects. @@ -489,14 +491,18 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, sal_Bool bMoveIt ) const SwFrm *pNewAnch; if( pTxtFrm ) { - if( FLY_PAGE == nAnchorId ) + if ( FLY_AT_PAGE == nAnchorId ) + { pNewAnch = pTxtFrm->FindPageFrm(); + } else { pNewAnch = ::FindAnchor( pTxtFrm, rAbsPos ); if( FLY_AT_FLY == nAnchorId ) // LAYER_IMPL + { pNewAnch = pNewAnch->FindFlyFrm(); + } } } else @@ -522,19 +528,19 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, sal_Bool bMoveIt ) { aRet = pNewAnch->GetFrmAnchorPos( ::HasWrap( pObj ) ); - if( bMoveIt || nAnchorId == FLY_AUTO_CNTNT ) + if ( bMoveIt || (nAnchorId == FLY_AT_CHAR) ) { SwFmtAnchor aAnch( rFmt.GetAnchor() ); switch ( nAnchorId ) { - case FLY_AT_CNTNT: + case FLY_AT_PARA: { SwPosition *pPos = (SwPosition*)aAnch.GetCntntAnchor(); pPos->nNode = *pTxtFrm->GetNode(); pPos->nContent.Assign(0,0); break; } - case FLY_PAGE: + case FLY_AT_PAGE: { aAnch.SetPageNum( ((const SwPageFrm*)pNewAnch)-> GetPhyPageNum() ); @@ -547,7 +553,7 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, sal_Bool bMoveIt ) aAnch.SetAnchor( &aPos ); break; } - case FLY_AUTO_CNTNT: + case FLY_AT_CHAR: { SwPosition *pPos = (SwPosition*)aAnch.GetCntntAnchor(); Point aTmpPnt( rAbsPos ); @@ -666,21 +672,25 @@ const SwFrmFmt *SwFEShell::NewFlyFrm( const SfxItemSet& rSet, sal_Bool bAnchVali RndStdIds eRndId = rAnch.GetAnchorId(); switch( eRndId ) { - case FLY_PAGE: + case FLY_AT_PAGE: if( !rAnch.GetPageNum() ) //HotFix: Bug in UpdateByExample rAnch.SetPageNum( 1 ); break; case FLY_AT_FLY: - case FLY_AT_CNTNT: - case FLY_AUTO_CNTNT: - case FLY_IN_CNTNT: + case FLY_AT_PARA: + case FLY_AT_CHAR: + case FLY_AS_CHAR: if( !bAnchValid ) { if( FLY_AT_FLY != eRndId ) + { rAnch.SetAnchor( &rPos ); + } else if( lcl_SetNewFlyPos( rPos.nNode.GetNode(), rAnch, aPt ) ) - eRndId = FLY_PAGE; + { + eRndId = FLY_AT_PAGE; + } } break; @@ -698,7 +708,7 @@ const SwFrmFmt *SwFEShell::NewFlyFrm( const SfxItemSet& rSet, sal_Bool bAnchVali SwFmtVertOrient aOldV; SwFmtHoriOrient aOldH; - if( FLY_PAGE != eRndId ) + if ( FLY_AT_PAGE != eRndId ) { // erstmal als mit Seitenbindung, Absatz/Zeichenbindung erst wenn // alles verschoben ist. Dann ist die Position gueltig! @@ -706,7 +716,7 @@ const SwFrmFmt *SwFEShell::NewFlyFrm( const SfxItemSet& rSet, sal_Bool bAnchVali // umsetzen, damit diese beim Umanker NICHT // korrigiert wird pOldAnchor = new SwFmtAnchor( rAnch ); - ((SfxItemSet&)rSet).Put( SwFmtAnchor( FLY_PAGE, 1 ) ); + const_cast(rSet).Put( SwFmtAnchor( FLY_AT_PAGE, 1 ) ); const SfxPoolItem* pItem; if( SFX_ITEM_SET == rSet.GetItemState( RES_HORI_ORIENT, sal_False, &pItem ) @@ -741,8 +751,10 @@ const SwFrmFmt *SwFEShell::NewFlyFrm( const SfxItemSet& rSet, sal_Bool bAnchVali const SwFrm* pAnch = ::FindAnchor( GetLayout(), aPt, sal_False ); SwPosition aPos( *((SwCntntFrm*)pAnch)->GetNode() ); - if( FLY_IN_CNTNT == eRndId ) + if ( FLY_AS_CHAR == eRndId ) + { aPos.nContent.Assign( ((SwCntntFrm*)pAnch)->GetNode(), 0 ); + } pOldAnchor->SetAnchor( &aPos ); // das verschieben von TabelleSelektion ist noch nicht @@ -818,9 +830,9 @@ void SwFEShell::Insert( const String& rGrfName, const String& rFltName, SwFmtAnchor* pAnchor = (SwFmtAnchor*)pItem; switch( pAnchor->GetAnchorId()) { - case FLY_AT_CNTNT: - case FLY_AUTO_CNTNT: // LAYER_IMPL - case FLY_IN_CNTNT: + case FLY_AT_PARA: + case FLY_AT_CHAR: // LAYER_IMPL + case FLY_AS_CHAR: if( !pAnchor->GetCntntAnchor() ) { pAnchor->SetAnchor( pCursor->GetPoint() ); @@ -833,7 +845,7 @@ void SwFEShell::Insert( const String& rGrfName, const String& rFltName, *pAnchor, GetCrsrDocPos() ); } break; - case FLY_PAGE: + case FLY_AT_PAGE: if( !pAnchor->GetPageNum() ) { pAnchor->SetPageNum( pCursor->GetPageNum( @@ -912,10 +924,10 @@ void SwFEShell::Insert( SdrObject& rDrawObj, const SfxPoolItem* pItem; if( !pFlyAttrSet || !pFlyAttrSet->GetItemState( RES_ANCHOR, sal_False, &pItem ) || - FLY_PAGE != ((SwFmtAnchor*)pItem)->GetAnchorId() ) + (FLY_AT_PAGE != ((SwFmtAnchor*)pItem)->GetAnchorId())) { pSet = new SfxItemSet( GetDoc()->GetAttrPool(), aFrmFmtSetRange ); - pSet->Put( SwFmtAnchor( FLY_AT_CNTNT )); + pSet->Put( SwFmtAnchor( FLY_AT_PARA )); pFlyAttrSet = pSet; } @@ -978,8 +990,10 @@ void SwFEShell::GetPageObjs( SvPtrarr& rFillArr ) for( sal_uInt16 n = 0; n < pDoc->GetSpzFrmFmts()->Count(); ++n ) { pFmt = (const SwFrmFmt*)(*pDoc->GetSpzFrmFmts())[n]; - if( FLY_PAGE == pFmt->GetAnchor().GetAnchorId() ) + if (FLY_AT_PAGE == pFmt->GetAnchor().GetAnchorId()) + { rFillArr.Insert( (VoidPtr)pFmt, rFillArr.Count() ); + } } } @@ -1010,7 +1024,7 @@ void SwFEShell::SetPageObjsNewPage( SvPtrarr& rFillArr, int nOffset ) { // FlyFmt ist noch gueltig, also behandeln SwFmtAnchor aNewAnchor( pFmt->GetAnchor() ); - if( FLY_PAGE != aNewAnchor.GetAnchorId() || + if ((FLY_AT_PAGE != aNewAnchor.GetAnchorId()) || 0 >= ( nNewPage = aNewAnchor.GetPageNum() + nOffset ) ) // chaos::Anchor wurde veraendert oder ungueltige SeitenNummer, // also nicht veraendern !! @@ -1086,12 +1100,12 @@ sal_Bool SwFEShell::GetFlyFrmAttr( SfxItemSet &rSet ) const SwFmtAnchor* pAnchor = (SwFmtAnchor*)pItem; RndStdIds eType = pAnchor->GetAnchorId(); - if( FLY_PAGE != eType ) + if ( FLY_AT_PAGE != eType ) { // OD 12.11.2003 #i22341# - content anchor of anchor item is needed. // Thus, don't overwrite anchor item by default contructed anchor item. //rSet.Put( SwFmtAnchor( eType ) ); - if( FLY_IN_CNTNT == eType ) + if ( FLY_AS_CHAR == eType ) { rSet.ClearItem( RES_OPAQUE ); rSet.ClearItem( RES_SURROUND ); @@ -1828,7 +1842,7 @@ ObjCntType SwFEShell::GetObjCntType( const SdrObject& rObj ) const " - missing frame format" ); eType = OBJCNT_NONE; } - else if ( FLY_IN_CNTNT != pFrmFmt->GetAnchor().GetAnchorId() ) + else if ( FLY_AS_CHAR != pFrmFmt->GetAnchor().GetAnchorId() ) { eType = OBJCNT_GROUPOBJ; } diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index d465abc4403e..af2e8d1c7677 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -326,7 +326,7 @@ sal_Bool SwFEShell::MoveAnchor( USHORT nDir ) SwFrmFmt& rFmt = pAnchoredObj->GetFrmFmt(); SwFmtAnchor aAnch( rFmt.GetAnchor() ); RndStdIds nAnchorId = aAnch.GetAnchorId(); - if ( FLY_IN_CNTNT == nAnchorId ) + if ( FLY_AS_CHAR == nAnchorId ) return sal_False; if( pOld->IsVertical() ) { @@ -348,7 +348,7 @@ sal_Bool SwFEShell::MoveAnchor( USHORT nDir ) } } switch ( nAnchorId ) { - case FLY_PAGE: + case FLY_AT_PAGE: { ASSERT( pOld->IsPageFrm(), "Wrong anchor, page exspected." ); if( SW_MOVE_UP == nDir ) @@ -362,7 +362,7 @@ sal_Bool SwFEShell::MoveAnchor( USHORT nDir ) } break; } - case FLY_AUTO_CNTNT: + case FLY_AT_CHAR: { ASSERT( pOld->IsCntntFrm(), "Wrong anchor, page exspected." ); if( SW_MOVE_LEFT == nDir || SW_MOVE_RIGHT == nDir ) @@ -396,7 +396,7 @@ sal_Bool SwFEShell::MoveAnchor( USHORT nDir ) } } } // no break! - case FLY_AT_CNTNT: + case FLY_AT_PARA: { ASSERT( pOld->IsCntntFrm(), "Wrong anchor, page exspected." ); if( SW_MOVE_UP == nDir ) @@ -1652,7 +1652,7 @@ BOOL SwFEShell::ImpEndCreate() if( bCharBound ) { - aAnch.SetType( FLY_IN_CNTNT ); + aAnch.SetType( FLY_AS_CHAR ); aAnch.SetAnchor( &aPos ); } } @@ -1719,7 +1719,7 @@ BOOL SwFEShell::ImpEndCreate() bAtPage = true; else { - aAnch.SetType( FLY_AT_CNTNT ); + aAnch.SetType( FLY_AT_PARA ); aAnch.SetAnchor( &aPos ); } } @@ -1728,7 +1728,7 @@ BOOL SwFEShell::ImpEndCreate() { pPage = pAnch->FindPageFrm(); - aAnch.SetType( FLY_PAGE ); + aAnch.SetType( FLY_AT_PAGE ); aAnch.SetPageNum( pPage->GetPhyPageNum() ); pAnch = pPage; // die Page wird jetzt zum Anker } @@ -1871,7 +1871,7 @@ BOOL SwFEShell::ImpEndCreate() // <-- if( bCharBound ) { - ASSERT( aAnch.GetAnchorId() == FLY_IN_CNTNT, "wrong AnchorType" ); + ASSERT( aAnch.GetAnchorId() == FLY_AS_CHAR, "wrong AnchorType" ); SwTxtNode *pNd = aAnch.GetCntntAnchor()->nNode.GetNode().GetTxtNode(); SwFmtFlyCnt aFmt( pFmt ); pNd->InsertItem(aFmt, @@ -2256,7 +2256,7 @@ BOOL SwFEShell::IsGroupSelected() // --> FME 2004-12-08 #i38505# No ungroup allowed for 3d objects !pObj->Is3DObj() && // <-- - FLY_IN_CNTNT != ((SwDrawContact*)GetUserCall(pObj))-> + FLY_AS_CHAR != ((SwDrawContact*)GetUserCall(pObj))-> GetFmt()->GetAnchor().GetAnchorId() ) { return TRUE; @@ -2302,7 +2302,7 @@ bool SwFEShell::IsGroupAllowed() const " - missing frame format" ); bIsGroupAllowed = false; } - else if ( FLY_IN_CNTNT == pFrmFmt->GetAnchor().GetAnchorId() ) + else if ( FLY_AS_CHAR == pFrmFmt->GetAnchor().GetAnchorId() ) { bIsGroupAllowed = false; } @@ -2619,7 +2619,7 @@ BOOL SwFEShell::IsAlignPossible() const SdrObject *pO = Imp()->GetDrawView()->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj(); SwDrawContact *pC = (SwDrawContact*)GetUserCall(pO); //only as character bound drawings can be aligned - bRet = pC->GetFmt()->GetAnchor().GetAnchorId() == FLY_IN_CNTNT; + bRet = (pC->GetFmt()->GetAnchor().GetAnchorId() == FLY_AS_CHAR); } if ( bRet ) return Imp()->GetDrawView()->IsAlignPossible(); @@ -2664,7 +2664,7 @@ void SwFEShell::CheckUnboundObjects() { pAnch = ::FindAnchor( pPage, aPt, TRUE ); SwPosition aPos( *((SwCntntFrm*)pAnch)->GetNode() ); - aAnch.SetType( FLY_AT_CNTNT ); + aAnch.SetType( FLY_AT_PARA ); aAnch.SetAnchor( &aPos ); ((SwRect&)GetCharRect()).Pos() = aPt; } diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx index d82b1de4cfdb..9319cddcfd82 100644 --- a/sw/source/core/frmedt/fews.cxx +++ b/sw/source/core/frmedt/fews.cxx @@ -31,11 +31,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - #include -//#ifndef _SVDVMARK_HXX //autogen -//#include -//#endif #include #include #include @@ -71,8 +67,10 @@ // OD 2004-03-29 #i26791# #include + using namespace com::sun::star; + TYPEINIT1(SwFEShell,SwEditShell) /*********************************************************************** @@ -780,12 +778,12 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, BOOL bVertic = FALSE; BOOL bRTL = FALSE; - if( FLY_PAGE == _nAnchorId || FLY_AT_FLY == _nAnchorId ) // LAYER_IMPL + if ((FLY_AT_PAGE == _nAnchorId) || (FLY_AT_FLY == _nAnchorId)) // LAYER_IMPL { const SwFrm* pTmp = pFrm; // OD 06.11.2003 #i22305# - if ( FLY_PAGE == _nAnchorId || - ( FLY_AT_FLY == _nAnchorId && !_bFollowTextFlow ) ) + if ((FLY_AT_PAGE == _nAnchorId) || + ((FLY_AT_FLY == _nAnchorId) && !_bFollowTextFlow)) { pFrm = pPage; } @@ -906,7 +904,7 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, aPos = (pFrm->Frm().*fnRect->fnGetPos)(); // OD 08.09.2003 #i17567#, #108749#, #110354# - allow negative positions // for fly frames anchor to paragraph/to character. - if ( _nAnchorId == FLY_AT_CNTNT || _nAnchorId == FLY_AUTO_CNTNT ) + if ((_nAnchorId == FLY_AT_PARA) || (_nAnchorId == FLY_AT_CHAR)) { // The rectangle, the fly frame can be positioned in, is determined // horizontally by the frame area of the horizontal environment @@ -985,7 +983,7 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, // fly frame). Thus, assure this. const SwTxtFrm* pTxtFrm( dynamic_cast(pFrm) ); if ( pTxtFrm && - _nAnchorId == FLY_AUTO_CNTNT && + (_nAnchorId == FLY_AT_CHAR) && ( _eVertRelOrient == text::RelOrientation::CHAR || _eVertRelOrient == text::RelOrientation::TEXT_LINE ) ) { @@ -1032,7 +1030,7 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, // position ( respectively ), if object is // anchored to character and horizontal aligned at character. if ( pTxtFrm && - _nAnchorId == FLY_AUTO_CNTNT && + (_nAnchorId == FLY_AT_CHAR) && _eHoriRelOrient == text::RelOrientation::CHAR ) { SwTwips nLeft = 0L; diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx index f971be8d79e4..a61f27e864b4 100644 --- a/sw/source/core/frmedt/tblsel.cxx +++ b/sw/source/core/frmedt/tblsel.cxx @@ -30,6 +30,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" + #include #include #include @@ -984,11 +985,11 @@ BOOL IsEmptyBox( const SwTableBox& rBox, SwPaM& rPam ) for( USHORT n = 0; n < rFmts.Count(); ++n ) { - const SwPosition* pAPos; const SwFmtAnchor& rAnchor = rFmts[n]->GetAnchor(); - if( ( FLY_AT_CNTNT == rAnchor.GetAnchorId() || - FLY_AUTO_CNTNT == rAnchor.GetAnchorId() ) && - 0 != ( pAPos = rAnchor.GetCntntAnchor() ) && + const SwPosition* pAPos = rAnchor.GetCntntAnchor(); + if (pAPos && + ((FLY_AT_PARA == rAnchor.GetAnchorId()) || + (FLY_AT_CHAR == rAnchor.GetAnchorId())) && nSttIdx <= ( nIdx = pAPos->nNode.GetIndex() ) && nIdx < nEndIdx ) { diff --git a/sw/source/core/inc/flyfrm.hxx b/sw/source/core/inc/flyfrm.hxx index dc8975f3fd47..61004c3816a5 100644 --- a/sw/source/core/inc/flyfrm.hxx +++ b/sw/source/core/inc/flyfrm.hxx @@ -109,10 +109,10 @@ protected: //(CheckClip) nur das Format aufgerufen wird; //nicht aber die Breite anhand der Attribute //wieder bestimmt wird. - BOOL bInCnt :1; // FLY_IN_CNTNT, als Zeichen verankert - BOOL bAtCnt :1; // FLY_AT_CNTNT, am Absatz verankert - BOOL bLayout :1; // FLY_PAGE, FLY_AT_FLY, an Seite oder Rahmen - BOOL bAutoPosition :1; // FLY_AUTO_CNTNT, im Text verankerter Rahmen + BOOL bInCnt :1; // FLY_AS_CHAR, anchored as character + BOOL bAtCnt :1; // FLY_AT_PARA, anchored at paragraph + BOOL bLayout :1; // FLY_AT_PAGE, FLY_AT_FLY, at page or at frame + BOOL bAutoPosition :1; // FLY_AT_CHAR, anchored at character BOOL bNoShrink :1; // temporary forbud of shrinking to avoid loops BOOL bLockDeleteContent :1; // If the flag is set, the content of the // fly frame is not deleted if moved to diff --git a/sw/source/core/layout/anchoreddrawobject.cxx b/sw/source/core/layout/anchoreddrawobject.cxx index 0976dcbefdc0..5a6be9f2e255 100644 --- a/sw/source/core/layout/anchoreddrawobject.cxx +++ b/sw/source/core/layout/anchoreddrawobject.cxx @@ -37,12 +37,8 @@ #include #include #include -#ifndef _TOCNTNTANCHOROBJECTPOSITION_HXX #include -#endif -#ifndef _TOLAYOUTANCHOROBJECTPOSITION_HXX #include -#endif #include #include // --> OD 2004-08-12 #i32795# @@ -357,7 +353,7 @@ void SwAnchoredDrawObject::MakeObjPos() // determine relative position of drawing object and set it switch ( pDrawContact->GetAnchorId() ) { - case FLY_IN_CNTNT: + case FLY_AS_CHAR: { // indicate that position will be valid after positioning is performed mbValidPos = true; @@ -365,15 +361,15 @@ void SwAnchoredDrawObject::MakeObjPos() // during the format of its anchor frame - see } break; - case FLY_AT_CNTNT: - case FLY_AUTO_CNTNT: + case FLY_AT_PARA: + case FLY_AT_CHAR: { // --> OD 2004-08-12 #i32795# - move intrinsic positioning to // helper method <_MakeObjPosAnchoredAtPara()> _MakeObjPosAnchoredAtPara(); } break; - case FLY_PAGE: + case FLY_AT_PAGE: case FLY_AT_FLY: { // --> OD 2004-08-12 #i32795# - move intrinsic positioning to @@ -603,7 +599,7 @@ void SwAnchoredDrawObject::_InvalidatePage( SwPageFrm* _pPageFrm ) { // --> OD 2004-11-11 #i35007# - correct invalidation for as-character // anchored objects. - if ( GetFrmFmt().GetAnchor().GetAnchorId() == FLY_IN_CNTNT ) + if ( GetFrmFmt().GetAnchor().GetAnchorId() == FLY_AS_CHAR ) { _pPageFrm->InvalidateFlyInCnt(); } @@ -645,7 +641,7 @@ void SwAnchoredDrawObject::InvalidateObjPos() // --> OD 2005-03-09 #i44559# - assure, that text hint is already // existing in the text frame if ( GetAnchorFrm()->ISA(SwTxtFrm) && - GetFrmFmt().GetAnchor().GetAnchorId() == FLY_IN_CNTNT ) + (GetFrmFmt().GetAnchor().GetAnchorId() == FLY_AS_CHAR) ) { SwTxtFrm* pAnchorTxtFrm( static_cast(AnchorFrm()) ); if ( pAnchorTxtFrm->GetTxtNode()->GetpSwpHints() && diff --git a/sw/source/core/layout/anchoredobject.cxx b/sw/source/core/layout/anchoredobject.cxx index 62048fbca378..67a072832eb1 100644 --- a/sw/source/core/layout/anchoredobject.cxx +++ b/sw/source/core/layout/anchoredobject.cxx @@ -306,7 +306,7 @@ void SwAnchoredObject::CheckCharRectAndTopOfLine( GetAnchorFrm()->IsTxtFrm() ) { const SwFmtAnchor& rAnch = GetFrmFmt().GetAnchor(); - if ( rAnch.GetAnchorId() == FLY_AUTO_CNTNT && + if ( (rAnch.GetAnchorId() == FLY_AT_CHAR) && rAnch.GetCntntAnchor() ) { // --> OD 2004-07-14 #117380# - if requested, assure that anchor frame, @@ -540,8 +540,8 @@ bool SwAnchoredObject::ConsiderObjWrapInfluenceOnObjPos() const // <-- { const SwFmtAnchor& rAnchor = rObjFmt.GetAnchor(); - if ( ( rAnchor.GetAnchorId() == FLY_AUTO_CNTNT || - rAnchor.GetAnchorId() == FLY_AT_CNTNT ) && + if ( ((rAnchor.GetAnchorId() == FLY_AT_CHAR) || + (rAnchor.GetAnchorId() == FLY_AT_PARA)) && rObjFmt.GetSurround().GetSurround() != SURROUND_THROUGHT ) { // --> OD 2004-09-23 #i34520# - text also wraps around anchored @@ -792,7 +792,7 @@ void SwAnchoredObject::UpdateObjInSortedList() AnchorFrm()->GetDrawObjs()->Update( *this ); // update its position in the sorted object list of its page frame // note: as-character anchored object aren't registered at a page frame - if ( GetFrmFmt().GetAnchor().GetAnchorId() != FLY_IN_CNTNT ) + if ( GetFrmFmt().GetAnchor().GetAnchorId() != FLY_AS_CHAR ) { GetPageFrm()->GetSortedObjs()->Update( *this ); } @@ -859,8 +859,8 @@ SwTxtFrm* SwAnchoredObject::FindAnchorCharFrm() if ( mpAnchorFrm ) { const SwFmtAnchor& rAnch = GetFrmFmt().GetAnchor(); - if ( rAnch.GetAnchorId() == FLY_AUTO_CNTNT || - rAnch.GetAnchorId() == FLY_IN_CNTNT ) + if ((rAnch.GetAnchorId() == FLY_AT_CHAR) || + (rAnch.GetAnchorId() == FLY_AS_CHAR)) { pAnchorCharFrm = &(static_cast(AnchorFrm())-> GetFrmAtOfst( rAnch.GetCntntAnchor()->nContent.GetIndex() )); diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index 7601f4ae370d..bdef8a74bcf7 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -51,9 +51,7 @@ #include #include #include -#ifndef __SBX_SBXVARIABLE_HXX //autogen #include -#endif #include #include #include @@ -79,9 +77,7 @@ #include #include #include -#ifndef _FMTLINE_HXX #include -#endif #include #include #include @@ -110,18 +106,12 @@ #include #include -#ifndef _CMDID_H #include -#endif -#ifndef _UNOMID_H #include -#endif #ifndef _COMCORE_HRC #include #endif -#ifndef _SVX_SVUNDO_HXX #include // #111827# -#endif // OD 2004-05-24 #i28701# #include // --> OD 2006-03-06 #125892# @@ -1484,9 +1474,11 @@ void SwFmtAnchor::SetAnchor( const SwPosition *pPos ) delete pCntntAnchor; pCntntAnchor = pPos ? new SwPosition( *pPos ) : 0; //AM Absatz gebundene Flys sollten nie in den Absatz hineinzeigen. - if ( pCntntAnchor && ( FLY_AT_CNTNT == nAnchorId || - FLY_AT_FLY == nAnchorId )) + if (pCntntAnchor && + ((FLY_AT_PARA == nAnchorId) || (FLY_AT_FLY == nAnchorId))) + { pCntntAnchor->nContent.Assign( 0, 0 ); + } } SwFmtAnchor& SwFmtAnchor::operator=(const SwFmtAnchor& rAnchor) @@ -1543,14 +1535,23 @@ BOOL SwFmtAnchor::QueryValue( uno::Any& rVal, BYTE nMemberId ) const case MID_ANCHOR_ANCHORTYPE: text::TextContentAnchorType eRet; - switch((sal_Int16)GetAnchorId()) + switch (GetAnchorId()) { - case FLY_AUTO_CNTNT : eRet = text::TextContentAnchorType_AT_CHARACTER;break; - case FLY_PAGE : eRet = text::TextContentAnchorType_AT_PAGE; break; - case FLY_AT_FLY : eRet = text::TextContentAnchorType_AT_FRAME; break; - case FLY_IN_CNTNT : eRet = text::TextContentAnchorType_AS_CHARACTER;break; - //case FLY_AT_CNTNT : - default: eRet = text::TextContentAnchorType_AT_PARAGRAPH; + case FLY_AT_CHAR: + eRet = text::TextContentAnchorType_AT_CHARACTER; + break; + case FLY_AT_PAGE: + eRet = text::TextContentAnchorType_AT_PAGE; + break; + case FLY_AT_FLY: + eRet = text::TextContentAnchorType_AT_FRAME; + break; + case FLY_AS_CHAR: + eRet = text::TextContentAnchorType_AS_CHARACTER; + break; + //case FLY_AT_PARA: + default: + eRet = text::TextContentAnchorType_AT_PARAGRAPH; } rVal <<= eRet; break; @@ -1591,10 +1592,10 @@ BOOL SwFmtAnchor::PutValue( const uno::Any& rVal, BYTE nMemberId ) switch( SWUnoHelper::GetEnumAsInt32( rVal ) ) { case text::TextContentAnchorType_AS_CHARACTER: - eAnchor = FLY_IN_CNTNT; + eAnchor = FLY_AS_CHAR; break; case text::TextContentAnchorType_AT_PAGE: - eAnchor = FLY_PAGE; + eAnchor = FLY_AT_PAGE; if( GetPageNum() > 0 && pCntntAnchor ) { // If the anchor type is page and a valid page number @@ -1608,11 +1609,11 @@ BOOL SwFmtAnchor::PutValue( const uno::Any& rVal, BYTE nMemberId ) eAnchor = FLY_AT_FLY; break; case text::TextContentAnchorType_AT_CHARACTER: - eAnchor = FLY_AUTO_CNTNT; + eAnchor = FLY_AT_CHAR; break; //case text::TextContentAnchorType_AT_PARAGRAPH: default: - eAnchor = FLY_AT_CNTNT; + eAnchor = FLY_AT_PARA; break; } SetType( eAnchor ); @@ -1624,7 +1625,7 @@ BOOL SwFmtAnchor::PutValue( const uno::Any& rVal, BYTE nMemberId ) if((rVal >>= nVal) && nVal > 0) { SetPageNum( nVal ); - if( FLY_PAGE == GetAnchorId() && pCntntAnchor ) + if ((FLY_AT_PAGE == GetAnchorId()) && pCntntAnchor) { // If the anchor type is page and a valid page number // is set, the content paoition has to be deleted to not @@ -2597,7 +2598,7 @@ sal_Bool SwFrmFmt::IsLowerOf( const SwFrmFmt& rFmt ) const // dann mal ueber die Node-Positionen versuchen const SwFmtAnchor* pAnchor = &rFmt.GetAnchor(); - if( FLY_PAGE != pAnchor->GetAnchorId() && pAnchor->GetCntntAnchor() ) + if ((FLY_AT_PAGE != pAnchor->GetAnchorId()) && pAnchor->GetCntntAnchor()) { const SwSpzFrmFmts& rFmts = *GetDoc()->GetSpzFrmFmts(); const SwNode* pFlyNd = pAnchor->GetCntntAnchor()->nNode.GetNode(). @@ -2616,9 +2617,11 @@ sal_Bool SwFrmFmt::IsLowerOf( const SwFrmFmt& rFmt ) const return sal_True; pAnchor = &pFmt->GetAnchor(); - if( FLY_PAGE == pAnchor->GetAnchorId() || + if ((FLY_AT_PAGE == pAnchor->GetAnchorId()) || !pAnchor->GetCntntAnchor() ) + { return sal_False; + } pFlyNd = pAnchor->GetCntntAnchor()->nNode.GetNode(). FindFlyStartNode(); @@ -2702,11 +2705,13 @@ void SwFlyFrmFmt::MakeFrms() SwFmtAnchor aAnchorAttr( GetAnchor() ); switch( aAnchorAttr.GetAnchorId() ) { - case FLY_IN_CNTNT: - case FLY_AT_CNTNT: - case FLY_AUTO_CNTNT: + case FLY_AS_CHAR: + case FLY_AT_PARA: + case FLY_AT_CHAR: if( aAnchorAttr.GetCntntAnchor() ) + { pModify = aAnchorAttr.GetCntntAnchor()->nNode.GetNode().GetCntntNode(); + } break; case FLY_AT_FLY: @@ -2739,7 +2744,7 @@ void SwFlyFrmFmt::MakeFrms() } break; - case FLY_PAGE: + case FLY_AT_PAGE: { sal_uInt16 nPgNum = aAnchorAttr.GetPageNum(); SwPageFrm *pPage = (SwPageFrm*)GetDoc()->GetRootFrm()->Lower(); @@ -2822,12 +2827,12 @@ void SwFlyFrmFmt::MakeFrms() pFly = new SwFlyLayFrm( this, pFrm ); break; - case FLY_AT_CNTNT: - case FLY_AUTO_CNTNT: + case FLY_AT_PARA: + case FLY_AT_CHAR: pFly = new SwFlyAtCntFrm( this, pFrm ); break; - case FLY_IN_CNTNT: + case FLY_AS_CHAR: pFly = new SwFlyInCntFrm( this, pFrm ); break; default: @@ -3026,8 +3031,8 @@ SwHandleAnchorNodeChg::SwHandleAnchorNodeChg( SwFlyFrmFmt& _rFlyFrmFmt, mbAnchorNodeChanged( false ) { const RndStdIds nNewAnchorType( _rNewAnchorFmt.GetAnchorId() ); - if ( ( nNewAnchorType == FLY_AT_CNTNT || - nNewAnchorType == FLY_AUTO_CNTNT ) && + if ( ((nNewAnchorType == FLY_AT_PARA) || + (nNewAnchorType == FLY_AT_CHAR)) && _rNewAnchorFmt.GetCntntAnchor() && _rNewAnchorFmt.GetCntntAnchor()->nNode.GetNode().GetCntntNode() ) { diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx index b24ee7fd78b1..442a0fe38c57 100644 --- a/sw/source/core/layout/calcmove.cxx +++ b/sw/source/core/layout/calcmove.cxx @@ -46,9 +46,7 @@ #include #include -#ifndef _OUTDEV_HXX //autogen #include -#endif #include #include #include @@ -1014,10 +1012,12 @@ BOOL SwCntntFrm::MakePrtArea( const SwBorderAttrs &rAttrs ) rFmt.GetFrmSize().GetWidthPercent() ) continue; - if ( FLY_IN_CNTNT == rFmt.GetAnchor().GetAnchorId() ) + if ( FLY_AS_CHAR == rFmt.GetAnchor().GetAnchorId() ) + { nMinWidth = Max( nMinWidth, bFly ? rFmt.GetFrmSize().GetWidth() : pObj->GetObjRect().Width() ); + } // <-- } diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx index 108dadf23ec8..0be59dbbeca1 100644 --- a/sw/source/core/layout/flowfrm.cxx +++ b/sw/source/core/layout/flowfrm.cxx @@ -366,7 +366,7 @@ BYTE SwFlowFrm::BwdMoveNecessary( const SwPageFrm *pPage, const SwRect &rRect ) //denn dann weiche ich ihm nicht aus. if ( ::IsFrmInSameKontext( pAnchor, &rThis ) ) { - if ( rFmt.GetAnchor().GetAnchorId() == FLY_AT_CNTNT ) + if ( rFmt.GetAnchor().GetAnchorId() == FLY_AT_PARA ) { // Den Index des anderen erhalten wir immer ueber das Ankerattr. ULONG nTmpIndex = rFmt.GetAnchor().GetCntntAnchor()->nNode.GetIndex(); diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index 9ce3bc237db4..983c3a2b055e 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -33,9 +33,7 @@ #include "hintids.hxx" #include #include -#ifndef _GRAPH_HXX //autogen #include -#endif #include #include #include @@ -1182,7 +1180,7 @@ void SwFlyFrm::ChgRelPos( const Point &rNewPos ) // --> OD 2004-11-12 #i34948# - handle also at-page and at-fly anchored // Writer fly frames const RndStdIds eAnchorType = GetFrmFmt().GetAnchor().GetAnchorId(); - if ( eAnchorType == FLY_PAGE ) + if ( eAnchorType == FLY_AT_PAGE ) { aVert.SetVertOrient( text::VertOrientation::NONE ); aVert.SetRelationOrient( text::RelOrientation::PAGE_FRAME ); @@ -1235,7 +1233,7 @@ void SwFlyFrm::ChgRelPos( const Point &rNewPos ) SwFmtHoriOrient aHori( pFmt->GetHoriOrient() ); // --> OD 2004-11-12 #i34948# - handle also at-page and at-fly anchored // Writer fly frames - if ( eAnchorType == FLY_PAGE ) + if ( eAnchorType == FLY_AT_PAGE ) { aHori.SetHoriOrient( text::HoriOrientation::NONE ); aHori.SetRelationOrient( text::RelOrientation::PAGE_FRAME ); @@ -1645,11 +1643,17 @@ void CalcCntnt( SwLayoutFrm *pLay, { // Bei autopositionierten hilft manchmal nur // noch, auf Durchlauf zu schalten - if( rFmt.GetAnchor().GetAnchorId() == FLY_AUTO_CNTNT && - SURROUND_PARALLEL == aAttr.GetSurround() ) + if ((rFmt.GetAnchor().GetAnchorId() == + FLY_AT_CHAR) && + (SURROUND_PARALLEL == + aAttr.GetSurround())) + { aAttr.SetSurround( SURROUND_THROUGHT ); + } else + { aAttr.SetSurround( SURROUND_PARALLEL ); + } rFmt.LockModify(); rFmt.SetFmtAttr( aAttr ); rFmt.UnlockModify(); @@ -2313,7 +2317,8 @@ void SwFrm::InvalidateObjs( const bool _bInvaPosOnly, { SwAnchoredObject* pAnchoredObj = (*GetDrawObjs())[i]; if ( _bNoInvaOfAsCharAnchoredObjs && - pAnchoredObj->GetFrmFmt().GetAnchor().GetAnchorId() == FLY_IN_CNTNT ) + (pAnchoredObj->GetFrmFmt().GetAnchor().GetAnchorId() + == FLY_AS_CHAR) ) { continue; } diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx index 41d0e97ec6d6..90017ee4884e 100644 --- a/sw/source/core/layout/flycnt.cxx +++ b/sw/source/core/layout/flycnt.cxx @@ -90,7 +90,7 @@ SwFlyAtCntFrm::SwFlyAtCntFrm( SwFlyFrmFmt *pFmt, SwFrm *pAnch ) : SwFlyFreeFrm( pFmt, pAnch ) { bAtCnt = TRUE; - bAutoPosition = FLY_AUTO_CNTNT == pFmt->GetAnchor().GetAnchorId(); + bAutoPosition = (FLY_AT_CHAR == pFmt->GetAnchor().GetAnchorId()); } // --> OD 2004-06-29 #i28701# diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx index 252ea3298531..b68335451178 100644 --- a/sw/source/core/layout/flylay.cxx +++ b/sw/source/core/layout/flylay.cxx @@ -600,7 +600,7 @@ void SwFlyLayFrm::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ) SwPageFrm *pOldPage = GetPageFrm(); AnchorFrm()->RemoveFly( this ); - if( FLY_PAGE == pAnch->GetAnchorId() ) + if ( FLY_AT_PAGE == pAnch->GetAnchorId() ) { USHORT nPgNum = pAnch->GetPageNum(); SwRootFrm *pRoot = FindRootFrm(); @@ -955,7 +955,7 @@ void SwPageFrm::AppendDrawObjToPage( SwAnchoredObject& _rNewObj ) _rNewObj.DrawObj()->SetOrdNum( nNewNum ); } - if ( FLY_IN_CNTNT == _rNewObj.GetFrmFmt().GetAnchor().GetAnchorId() ) + if ( FLY_AS_CHAR == _rNewObj.GetFrmFmt().GetAnchor().GetAnchorId() ) { return; } @@ -999,7 +999,8 @@ void SwPageFrm::RemoveDrawObjFromPage( SwAnchoredObject& _rToRemoveObj ) } if ( GetUpper() ) { - if ( FLY_IN_CNTNT != _rToRemoveObj.GetFrmFmt().GetAnchor().GetAnchorId() ) + if (FLY_AS_CHAR != + _rToRemoveObj.GetFrmFmt().GetAnchor().GetAnchorId()) { ((SwRootFrm*)GetUpper())->SetSuperfluous(); InvalidatePage(); @@ -1333,7 +1334,7 @@ BOOL CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, BOOL bMove ) const SwDrawContact *pC = (const SwDrawContact*)GetUserCall(pSdrObj); const SwFrmFmt *pFmt = (const SwFrmFmt*)pC->GetFmt(); const SwFmtAnchor &rAnch = pFmt->GetAnchor(); - if ( FLY_IN_CNTNT == rAnch.GetAnchorId() ) + if ( FLY_AS_CHAR == rAnch.GetAnchorId() ) { const SwFrm* pAnchorFrm = pC->GetAnchorFrm( pSdrObj ); if( !pAnchorFrm ) diff --git a/sw/source/core/layout/flypos.cxx b/sw/source/core/layout/flypos.cxx index 333de7f3ff97..cb566792ca83 100644 --- a/sw/source/core/layout/flypos.cxx +++ b/sw/source/core/layout/flypos.cxx @@ -57,8 +57,10 @@ SwPosFlyFrm::SwPosFlyFrm( const SwNodeIndex& rIdx, const SwFrmFmt* pFmt, { BOOL bFnd = FALSE; const SwFmtAnchor& rAnchor = pFmt->GetAnchor(); - if( FLY_PAGE == rAnchor.GetAnchorId() ) + if (FLY_AT_PAGE == rAnchor.GetAnchorId()) + { pNdIdx = new SwNodeIndex( rIdx ); + } else if( pFmt->GetDoc()->GetRootFrm() ) { SwClientIter aIter( (SwFmt&)*pFmt ); @@ -88,8 +90,10 @@ SwPosFlyFrm::SwPosFlyFrm( const SwNodeIndex& rIdx, const SwFrmFmt* pFmt, SwPosFlyFrm::~SwPosFlyFrm() { const SwFmtAnchor& rAnchor = pFrmFmt->GetAnchor(); - if( FLY_PAGE == rAnchor.GetAnchorId() ) + if (FLY_AT_PAGE == rAnchor.GetAnchorId()) + { delete pNdIdx; + } } BOOL SwPosFlyFrm::operator==( const SwPosFlyFrm& ) diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index f7fa2a0a8e80..f3ac0f966c67 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -1033,9 +1033,11 @@ SwCntntNotify::~SwCntntNotify() SwFrmFmt *pFmt = (*pTbl)[i]; const SwFmtAnchor &rAnch = pFmt->GetAnchor(); - if ( FLY_PAGE != rAnch.GetAnchorId() && - FLY_AT_CNTNT != rAnch.GetAnchorId() ) + if ((FLY_AT_PAGE != rAnch.GetAnchorId()) && + (FLY_AT_PARA != rAnch.GetAnchorId())) + { continue; //#60878# nicht etwa zeichengebundene. + } BOOL bCheckPos = FALSE; if ( rAnch.GetCntntAnchor() ) @@ -1047,7 +1049,7 @@ SwCntntNotify::~SwCntntNotify() if ( rAnch.GetCntntAnchor()->nNode == *pIdx ) { bCheckPos = TRUE; - if ( FLY_PAGE == rAnch.GetAnchorId() ) + if (FLY_AT_PAGE == rAnch.GetAnchorId()) { ASSERT( false, " - to page anchored object with content position. Please inform OD." ); SwFmtAnchor aAnch( rAnch ); @@ -1097,7 +1099,7 @@ SwCntntNotify::~SwCntntNotify() { SwAnchoredObject* pAnchoredObj = (*pObjs)[i]; if ( pAnchoredObj->GetFrmFmt().GetAnchor().GetAnchorId() - == FLY_AUTO_CNTNT ) + == FLY_AT_CHAR ) { pAnchoredObj->CheckCharRectAndTopOfLine( !pMasterFrm->IsEmpty() ); } @@ -1135,11 +1137,11 @@ void AppendObjs( const SwSpzFrmFmts *pTbl, ULONG nIndex, // OD 23.06.2003 #108784# - append also drawing objects anchored // as character. const bool bDrawObjInCntnt = bSdrObj && - rAnch.GetAnchorId() == FLY_IN_CNTNT; + (rAnch.GetAnchorId() == FLY_AS_CHAR); if( bFlyAtFly || - rAnch.GetAnchorId() == FLY_AT_CNTNT || - rAnch.GetAnchorId() == FLY_AUTO_CNTNT || + (rAnch.GetAnchorId() == FLY_AT_PARA) || + (rAnch.GetAnchorId() == FLY_AT_CHAR) || bDrawObjInCntnt ) { SdrObject* pSdrObj = 0; @@ -1227,7 +1229,7 @@ bool lcl_InHeaderOrFooter( SwFrmFmt& _rFmt ) const SwFmtAnchor& rAnch = _rFmt.GetAnchor(); - if ( rAnch.GetAnchorId() != FLY_PAGE ) + if (rAnch.GetAnchorId() != FLY_AT_PAGE) { bRetVal = _rFmt.GetDoc()->IsInHeaderFooter( rAnch.GetCntntAnchor()->nNode ); } @@ -1256,10 +1258,13 @@ void AppendAllObjs( const SwSpzFrmFmts *pTbl ) SwFrmFmt *pFmt = (SwFrmFmt*)aCpy[ USHORT(i) ]; const SwFmtAnchor &rAnch = pFmt->GetAnchor(); BOOL bRemove = FALSE; - if ( rAnch.GetAnchorId() == FLY_PAGE || rAnch.GetAnchorId() == FLY_IN_CNTNT ) + if ((rAnch.GetAnchorId() == FLY_AT_PAGE) || + (rAnch.GetAnchorId() == FLY_AS_CHAR)) + { //Seitengebunde sind bereits verankert, zeichengebundene //will ich hier nicht. bRemove = TRUE; + } else if ( FALSE == (bRemove = ::lcl_ObjConnected( pFmt )) || ::lcl_InHeaderOrFooter( *pFmt ) ) { @@ -2578,7 +2583,7 @@ void MA_FASTCALL lcl_RemoveObjsFromPage( SwFrm* _pFrm ) // --> OD 2004-11-29 #115759# - remove also drawing objects from page else if ( pObj->ISA(SwAnchoredDrawObject) ) { - if ( pObj->GetFrmFmt().GetAnchor().GetAnchorId() != FLY_IN_CNTNT ) + if (pObj->GetFrmFmt().GetAnchor().GetAnchorId() != FLY_AS_CHAR) { pObj->GetPageFrm()->RemoveDrawObjFromPage( *(static_cast(pObj)) ); @@ -2746,7 +2751,7 @@ void MA_FASTCALL lcl_AddObjsToPage( SwFrm* _pFrm, SwPageFrm* _pPage ) // --> OD 2004-11-29 #115759# - remove also drawing objects from page else if ( pObj->ISA(SwAnchoredDrawObject) ) { - if ( pObj->GetFrmFmt().GetAnchor().GetAnchorId() != FLY_IN_CNTNT ) + if (pObj->GetFrmFmt().GetAnchor().GetAnchorId() != FLY_AS_CHAR) { pObj->InvalidateObjPos(); _pPage->AppendDrawObjToPage( diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx index 56995fcfcb26..999b8a1a6e77 100644 --- a/sw/source/core/layout/laycache.cxx +++ b/sw/source/core/layout/laycache.cxx @@ -63,17 +63,16 @@ #include // --> OD 2006-03-22 #b6375613# #include -#ifndef _DOCSH_HXX #include -#endif #include #include +#include + + using namespace ::com::sun::star; // <-- -#include - SV_IMPL_PTRARR( SwPageFlyCache, SwFlyCachePtr ) /*-----------------28.5.2001 10:06------------------ @@ -696,8 +695,8 @@ bool lcl_HasTextFrmAnchoredObjs( SwTxtFrm* p_pTxtFrm ) SwFrmFmt *pFmt = (SwFrmFmt*)(*pSpzFrmFmts)[i]; const SwFmtAnchor &rAnch = pFmt->GetAnchor(); if ( rAnch.GetCntntAnchor() && - ( rAnch.GetAnchorId() == FLY_AT_CNTNT || - rAnch.GetAnchorId() == FLY_AUTO_CNTNT ) && + ((rAnch.GetAnchorId() == FLY_AT_PARA) || + (rAnch.GetAnchorId() == FLY_AT_CHAR)) && rAnch.GetCntntAnchor()->nNode.GetIndex() == p_pTxtFrm->GetTxtNode()->GetIndex() ) { diff --git a/sw/source/core/layout/objectformatter.cxx b/sw/source/core/layout/objectformatter.cxx index b8d45b719014..0b98bc03f4cd 100644 --- a/sw/source/core/layout/objectformatter.cxx +++ b/sw/source/core/layout/objectformatter.cxx @@ -338,7 +338,7 @@ void SwObjectFormatter::_FormatObj( SwAnchoredObject& _rAnchoredObj ) // check, if only as-character anchored object have to be formatted, and // check the anchor type if ( FormatOnlyAsCharAnchored() && - !_rAnchoredObj.GetFrmFmt().GetAnchor().GetAnchorId() == FLY_IN_CNTNT ) + !(_rAnchoredObj.GetFrmFmt().GetAnchor().GetAnchorId() == FLY_AS_CHAR) ) { return; } diff --git a/sw/source/core/layout/objectformattertxtfrm.cxx b/sw/source/core/layout/objectformattertxtfrm.cxx index 697bea11dabf..2d7c2b02fb39 100644 --- a/sw/source/core/layout/objectformattertxtfrm.cxx +++ b/sw/source/core/layout/objectformattertxtfrm.cxx @@ -136,7 +136,7 @@ bool SwObjectFormatterTxtFrm::DoFormatObj( SwAnchoredObject& _rAnchoredObj, // check, if only as-character anchored object have to be formatted, and // check the anchor type if ( FormatOnlyAsCharAnchored() && - !_rAnchoredObj.GetFrmFmt().GetAnchor().GetAnchorId() == FLY_IN_CNTNT ) + !(_rAnchoredObj.GetFrmFmt().GetAnchor().GetAnchorId() == FLY_AS_CHAR) ) { return true; } @@ -656,8 +656,8 @@ bool SwObjectFormatterTxtFrm::CheckMovedFwdCondition( // which will be on the next page. if ( !bAnchorIsMovedForward && _bAnchoredAtMasterBeforeFormatAnchor && - ( _rAnchoredObj.GetFrmFmt().GetAnchor().GetAnchorId() == FLY_AUTO_CNTNT || - _rAnchoredObj.GetFrmFmt().GetAnchor().GetAnchorId() == FLY_AT_CNTNT ) ) + ((_rAnchoredObj.GetFrmFmt().GetAnchor().GetAnchorId() == FLY_AT_CHAR) || + (_rAnchoredObj.GetFrmFmt().GetAnchor().GetAnchorId() == FLY_AT_PARA))) { SwFrm* pAnchorFrm = _rAnchoredObj.GetAnchorFrmContainingAnchPos(); ASSERT( pAnchorFrm->IsTxtFrm(), diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx index b73f8b4d1eeb..ef80288b9349 100644 --- a/sw/source/core/layout/pagechg.cxx +++ b/sw/source/core/layout/pagechg.cxx @@ -46,9 +46,7 @@ #include #include #include -#ifndef _DOCSH_HXX #include -#endif #include "viewimp.hxx" #include "pagefrm.hxx" @@ -408,7 +406,7 @@ void MA_FASTCALL lcl_MakeObjs( const SwSpzFrmFmts &rTbl, SwPageFrm *pPage ) { if( rAnch.GetCntntAnchor() ) { - if( FLY_PAGE == rAnch.GetAnchorId() ) + if (FLY_AT_PAGE == rAnch.GetAnchorId()) { SwFmtAnchor aAnch( rAnch ); aAnch.SetAnchor( 0 ); @@ -1659,7 +1657,7 @@ void SwRootFrm::AssertPageFlys( SwPageFrm *pPage ) SwFrmFmt& rFmt = (*pPage->GetSortedObjs())[i]->GetFrmFmt(); const SwFmtAnchor &rAnch = rFmt.GetAnchor(); const USHORT nPg = rAnch.GetPageNum(); - if ( rAnch.GetAnchorId() == FLY_PAGE && + if ((rAnch.GetAnchorId() == FLY_AT_PAGE) && nPg != pPage->GetPhyPageNum() ) { //Das er auf der falschen Seite steht muss noch nichts @@ -1834,11 +1832,11 @@ void SwRootFrm::ImplCalcBrowseWidth() long nWidth = 0; switch ( rFmt.GetAnchor().GetAnchorId() ) { - case FLY_IN_CNTNT: + case FLY_AS_CHAR: nWidth = bFly ? rFmt.GetFrmSize().GetWidth() : pAnchoredObj->GetObjRect().Width(); break; - case FLY_AT_CNTNT: + case FLY_AT_PARA: { // --> FME 2004-09-13 #i33170# // Reactivated old code because @@ -2007,7 +2005,7 @@ void lcl_MoveAllLowerObjs( SwFrm* pFrm, const Point& rOffset ) // all except from the as character anchored objects are moved // when processing the page frame: - const bool bAsChar = rAnchor.GetAnchorId() == FLY_IN_CNTNT; + const bool bAsChar = (rAnchor.GetAnchorId() == FLY_AS_CHAR); if ( !bPage && !bAsChar ) continue; diff --git a/sw/source/core/layout/sortedobjsimpl.cxx b/sw/source/core/layout/sortedobjsimpl.cxx index 96d3c73e8e3b..8afa7968b5f0 100644 --- a/sw/source/core/layout/sortedobjsimpl.cxx +++ b/sw/source/core/layout/sortedobjsimpl.cxx @@ -41,17 +41,14 @@ #include #include #include -#ifndef IDOCUMENTDRAWMODELACCESS_HXX_INCLUDED #include -#endif + using namespace ::com::sun::star; typedef std::vector< SwAnchoredObject* >::iterator tIter; typedef std::vector< SwAnchoredObject* >::const_iterator tConstIter; -using namespace ::com::sun::star; - SwSortedObjsImpl::SwSortedObjsImpl() { @@ -96,36 +93,36 @@ struct ObjAnchorOrder const SwFmtAnchor* pAnchorNew = &(rFmtNew.GetAnchor()); // check for to-page anchored objects - if ( pAnchorListed->GetAnchorId() == FLY_PAGE && - pAnchorNew->GetAnchorId() != FLY_PAGE ) + if ((pAnchorListed->GetAnchorId() == FLY_AT_PAGE) && + (pAnchorNew ->GetAnchorId() != FLY_AT_PAGE)) { return true; } - else if ( pAnchorListed->GetAnchorId() != FLY_PAGE && - pAnchorNew->GetAnchorId() == FLY_PAGE ) + else if ((pAnchorListed->GetAnchorId() != FLY_AT_PAGE) && + (pAnchorNew ->GetAnchorId() == FLY_AT_PAGE)) { return false; } - else if ( pAnchorListed->GetAnchorId() == FLY_PAGE && - pAnchorNew->GetAnchorId() == FLY_PAGE ) + else if ((pAnchorListed->GetAnchorId() == FLY_AT_PAGE) && + (pAnchorNew ->GetAnchorId() == FLY_AT_PAGE)) { return pAnchorListed->GetOrder() < pAnchorNew->GetOrder(); } // Both objects aren't anchored to page. // Thus, check for to-fly anchored objects - if ( pAnchorListed->GetAnchorId() == FLY_AT_FLY && - pAnchorNew->GetAnchorId() != FLY_AT_FLY ) + if ((pAnchorListed->GetAnchorId() == FLY_AT_FLY) && + (pAnchorNew ->GetAnchorId() != FLY_AT_FLY)) { return true; } - else if ( pAnchorListed->GetAnchorId() != FLY_AT_FLY && - pAnchorNew->GetAnchorId() == FLY_AT_FLY ) + else if ((pAnchorListed->GetAnchorId() != FLY_AT_FLY) && + (pAnchorNew ->GetAnchorId() == FLY_AT_FLY)) { return false; } - else if ( pAnchorListed->GetAnchorId() == FLY_AT_FLY && - pAnchorNew->GetAnchorId() == FLY_AT_FLY ) + else if ((pAnchorListed->GetAnchorId() == FLY_AT_FLY) && + (pAnchorNew ->GetAnchorId() == FLY_AT_FLY)) { return pAnchorListed->GetOrder() < pAnchorNew->GetOrder(); } @@ -144,21 +141,21 @@ struct ObjAnchorOrder // --> OD 2006-11-29 #???# - objects have to be ordered by anchor node position // Thus, compare content anchor node positions and anchor type, // if not anchored at-paragraph - if ( pAnchorListed->GetAnchorId() != FLY_AT_CNTNT && - pAnchorNew->GetAnchorId() != FLY_AT_CNTNT && + if ((pAnchorListed->GetAnchorId() != FLY_AT_PARA) && + (pAnchorNew ->GetAnchorId() != FLY_AT_PARA) && pCntntAnchorListed && pCntntAnchorNew ) { if ( pCntntAnchorListed->nContent != pCntntAnchorNew->nContent ) { return pCntntAnchorListed->nContent < pCntntAnchorNew->nContent; } - else if ( pAnchorListed->GetAnchorId() == FLY_AUTO_CNTNT && - pAnchorNew->GetAnchorId() == FLY_IN_CNTNT ) + else if ((pAnchorListed->GetAnchorId() == FLY_AT_CHAR) && + (pAnchorNew ->GetAnchorId() == FLY_AS_CHAR)) { return true; } - else if ( pAnchorListed->GetAnchorId() == FLY_IN_CNTNT && - pAnchorNew->GetAnchorId() == FLY_AUTO_CNTNT ) + else if ((pAnchorListed->GetAnchorId() == FLY_AS_CHAR) && + (pAnchorNew ->GetAnchorId() == FLY_AT_CHAR)) { return false; } diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index f2a507bbd764..3605e3899706 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -57,9 +57,7 @@ // --> collapsing borders FME 2005-05-27 #i29550# #include // <-- -#ifndef _OUTDEV_HXX //autogen #include -#endif #include #include #include @@ -340,7 +338,7 @@ void lcl_InvalidateLowerObjs( SwLayoutFrm& _rLayoutFrm, pAnchoredObj->ClearCharRectAndTopOfLine(); pAnchoredObj->SetCurrRelPos( Point( 0, 0 ) ); if ( pAnchoredObj->GetFrmFmt().GetAnchor().GetAnchorId() - == FLY_IN_CNTNT ) + == FLY_AS_CHAR ) { pAnchoredObj->AnchorFrm() ->Prepare( PREP_FLY_ATTR_CHG, @@ -4194,7 +4192,7 @@ long MA_FASTCALL CalcHeightWidthFlys( const SwFrm *pFrm ) // the text flow have to be considered. const SwFrmFmt& rFrmFmt = pAnchoredObj->GetFrmFmt(); const bool bConsiderObj = - rFrmFmt.GetAnchor().GetAnchorId() != FLY_IN_CNTNT && + (rFrmFmt.GetAnchor().GetAnchorId() != FLY_AS_CHAR) && pAnchoredObj->GetObjRect().Top() != WEIT_WECH && rFrmFmt.GetFollowTextFlow().GetValue() && pAnchoredObj->GetPageFrm() == pTmp->FindPageFrm(); @@ -5222,7 +5220,7 @@ BOOL lcl_ArrangeLowers( SwLayoutFrm *pLay, long lYStart, BOOL bInva ) !( pTabFrm->IsFollow() && pTabFrm->FindMaster()->IsRebuildLastLine() ) && !pAnchoredObj->GetFrmFmt().GetAnchor().GetAnchorId() - == FLY_IN_CNTNT ) + == FLY_AS_CHAR ) { SwPageFrm* pPageFrm = pAnchoredObj->GetPageFrm(); SwPageFrm* pPageOfAnchor = pFrm->FindPageFrm(); diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx index af97063da6e3..4bca9ba61c5c 100644 --- a/sw/source/core/layout/wsfrm.cxx +++ b/sw/source/core/layout/wsfrm.cxx @@ -35,9 +35,7 @@ #include #include #include -#ifndef _OUTDEV_HXX #include -#endif #include #include #include @@ -52,9 +50,7 @@ #include #include #include -#ifndef _DOCSH_HXX #include -#endif #include #include #include @@ -81,8 +77,10 @@ // OD 2004-05-24 #i28701# #include + using namespace ::com::sun::star; + /************************************************************************* |* |* SwFrm::SwFrm() @@ -3999,8 +3997,8 @@ void SwRootFrm::InvalidateAllObjPos() { SwAnchoredObject* pAnchoredObj = rObjs[i]; const SwFmtAnchor& rAnch = pAnchoredObj->GetFrmFmt().GetAnchor(); - if ( rAnch.GetAnchorId() != FLY_AT_CNTNT && - rAnch.GetAnchorId() != FLY_AUTO_CNTNT ) + if ((rAnch.GetAnchorId() != FLY_AT_PARA) && + (rAnch.GetAnchorId() != FLY_AT_CHAR)) { // only to paragraph and to character anchored objects are considered. continue; diff --git a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx index 800235bf95e5..90a64c335e6f 100644 --- a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx +++ b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx @@ -47,13 +47,9 @@ #include #include #include -#ifndef _SVX_SVDOBJ_HXX #include -#endif #include -#ifndef _ENVIRONMENTOFANCHOREDOBJECT #include -#endif #include #include #include @@ -209,7 +205,7 @@ void SwToCntntAnchoredObjectPosition::CalcPosition() { // if object is at-character anchored, determine character-rectangle // and frame, position has to be oriented at. - mbAnchorToChar = FLY_AUTO_CNTNT == rFrmFmt.GetAnchor().GetAnchorId(); + mbAnchorToChar = (FLY_AT_CHAR == rFrmFmt.GetAnchor().GetAnchorId()); if ( mbAnchorToChar ) { const SwFmtAnchor& rAnch = rFrmFmt.GetAnchor(); diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx index 1784ad946e41..09758fe6e6c2 100644 --- a/sw/source/core/text/EnhancedPDFExportHelper.cxx +++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx @@ -31,15 +31,11 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" #include -#ifndef _COM_SUN_STAR_I18N_SCRIPTTYPE_HDL_ #include -#endif #include #include -#ifndef _OUTDEV_HXX #include -#endif #include #include #include @@ -370,9 +366,9 @@ bool SwTaggedPDFHelper::CheckReopenTag() { const SwFmtAnchor& rAnchor = static_cast(&rFrm)->GetFmt()->GetAnchor(); - if ( FLY_AT_CNTNT == rAnchor.GetAnchorId() || - FLY_AUTO_CNTNT == rAnchor.GetAnchorId() || - FLY_PAGE == rAnchor.GetAnchorId() ) + if ((FLY_AT_PARA == rAnchor.GetAnchorId()) || + (FLY_AT_CHAR == rAnchor.GetAnchorId()) || + (FLY_AT_PAGE == rAnchor.GetAnchorId())) { pKeyFrm = static_cast(rFrm).GetAnchorFrm(); bContinue = true; @@ -1814,7 +1810,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport() // --> FME 2005-05-09 #i44368# Links in Header/Footer const SwFmtAnchor &rAnch = pFrmFmt->GetAnchor(); - if ( FLY_PAGE != rAnch.GetAnchorId() ) + if (FLY_AT_PAGE != rAnch.GetAnchorId()) { const SwPosition* pPosition = rAnch.GetCntntAnchor(); if ( pPosition && pDoc->IsInHeaderFooter( pPosition->nNode ) ) diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx index bd51317f77fe..318f6770bf97 100644 --- a/sw/source/core/text/itratr.cxx +++ b/sw/source/core/text/itratr.cxx @@ -461,10 +461,8 @@ sal_Bool lcl_MinMaxNode( const SwFrmFmtPtr& rpNd, void* pArgs ) const SwFmtAnchor& rFmtA = ((SwFrmFmt*)rpNd)->GetAnchor(); bool bCalculate = false; - if ( - (FLY_AT_CNTNT == rFmtA.GetAnchorId()) || - (FLY_AUTO_CNTNT == rFmtA.GetAnchorId()) - ) + if ((FLY_AT_PARA == rFmtA.GetAnchorId()) || + (FLY_AT_CHAR == rFmtA.GetAnchorId())) { bCalculate = true; } diff --git a/sw/source/core/text/porfly.cxx b/sw/source/core/text/porfly.cxx index 55c905b7e679..105a1488cb06 100644 --- a/sw/source/core/text/porfly.cxx +++ b/sw/source/core/text/porfly.cxx @@ -39,9 +39,7 @@ #include "frmfmt.hxx" // SwFrmFmt #include "viewsh.hxx" -#ifndef _OUTDEV_HXX //autogen #include -#endif #include #include #include @@ -57,6 +55,7 @@ // OD 2004-05-24 #i28701# #include + /************************************************************************* * class SwFlyPortion * @@ -178,7 +177,7 @@ void SwTxtFrm::MoveFlyInCnt( SwTxtFrm *pNew, xub_StrLen nStart, xub_StrLen nEnd // entries SwAnchoredObject* pAnchoredObj = (*pObjs)[i]; const SwFmtAnchor& rAnch = pAnchoredObj->GetFrmFmt().GetAnchor(); - if ( rAnch.GetAnchorId() == FLY_IN_CNTNT ) + if (rAnch.GetAnchorId() == FLY_AS_CHAR) { const SwPosition* pPos = rAnch.GetCntntAnchor(); xub_StrLen nIdx = pPos->nContent.GetIndex(); diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx index 706eca2ec52e..b7d87b540bc1 100644 --- a/sw/source/core/text/txtfly.cxx +++ b/sw/source/core/text/txtfly.cxx @@ -31,12 +31,8 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" -#ifndef _OUTDEV_HXX //autogen #include -#endif -#ifndef _VIRDEV_HXX //autogen #include -#endif #include "viewsh.hxx" #include "pagefrm.hxx" @@ -61,14 +57,9 @@ #include "flyfrms.hxx" #include "fmtcnct.hxx" // SwFmtChain #include // SwMultiPortion -#ifdef VERT_DISTANCE -#include -#endif #include -#ifndef _TXTRANGE_HXX //autogen #include -#endif #include #include // --> OD 2004-06-16 #i28701# @@ -83,30 +74,26 @@ #include #include #include -#ifndef IDOCUMENTDRAWMODELACCESS_HXX_INCLUDED #include -#endif #include #include #include -#ifndef _TXTRANGE_HXX //autogen #include -#endif #include #include #include #include - +#include "doc.hxx" #ifndef PRODUCT #include "viewopt.hxx" // SwViewOptions, nur zum Testen (Test2) #endif -#include "doc.hxx" #ifdef VERT_DISTANCE #include #endif + using namespace ::com::sun::star; /***************************************************************************** @@ -1006,8 +993,8 @@ sal_Bool SwTxtFly::DrawTextOpaque( SwDrawTextInfo &rInf ) // --> OD 2006-08-15 #i68520# GetMaster() == pFly->GetAnchorFrm() || // <-- - ( FLY_AT_CNTNT != rAnchor.GetAnchorId() && - FLY_AUTO_CNTNT != rAnchor.GetAnchorId() + ((FLY_AT_PARA != rAnchor.GetAnchorId()) && + (FLY_AT_CHAR != rAnchor.GetAnchorId()) ) ) && // --> OD 2006-08-15 #i68520# @@ -1176,7 +1163,7 @@ sal_Bool SwTxtFly::GetTop( const SwAnchoredObject* _pAnchoredObj, const SwFrmFmt& rFrmFmt = _pAnchoredObj->GetFrmFmt(); const SwFmtAnchor& rNewA = rFrmFmt.GetAnchor(); // <-- - if ( FLY_PAGE == rNewA.GetAnchorId() ) + if (FLY_AT_PAGE == rNewA.GetAnchorId()) { if ( bInFtn ) return sal_False; @@ -1225,23 +1212,25 @@ sal_Bool SwTxtFly::GetTop( const SwAnchoredObject* _pAnchoredObj, // If is anchored as character, its content // does not wrap around pNew - if( FLY_IN_CNTNT == rCurrA.GetAnchorId() ) + if (FLY_AS_CHAR == rCurrA.GetAnchorId()) return sal_False; // If pNew is anchored to page and does not wrap around pNew // If both pNew and are anchored to page, we can do // some more checks - if( FLY_PAGE == rNewA.GetAnchorId() ) + if (FLY_AT_PAGE == rNewA.GetAnchorId()) { - if( FLY_PAGE == rCurrA.GetAnchorId() ) + if (FLY_AT_PAGE == rCurrA.GetAnchorId()) + { bEvade = sal_True; + } else return sal_False; } - else if( FLY_PAGE == rCurrA.GetAnchorId() ) + else if (FLY_AT_PAGE == rCurrA.GetAnchorId()) return sal_False; // Seitengebundene weichen nur seitengeb. aus - else if( FLY_AT_FLY == rNewA.GetAnchorId() ) + else if (FLY_AT_FLY == rNewA.GetAnchorId()) bEvade = sal_True; // Nicht seitengeb. weichen Rahmengeb. aus else if( FLY_AT_FLY == rCurrA.GetAnchorId() ) return sal_False; // Rahmengebundene weichen abs.geb. nicht aus @@ -1285,8 +1274,9 @@ sal_Bool SwTxtFly::GetTop( const SwAnchoredObject* _pAnchoredObj, // --> OD 2004-10-06 #i26945# const SwFmtAnchor& rNewA = _pAnchoredObj->GetFrmFmt().GetAnchor(); // <-- - ASSERT( FLY_IN_CNTNT != rNewA.GetAnchorId(), "Don't call GetTop with a FlyInCntFrm" ); - if( FLY_PAGE == rNewA.GetAnchorId() ) + ASSERT( FLY_AS_CHAR != rNewA.GetAnchorId(), + "Don't call GetTop with a FlyInCntFrm" ); + if (FLY_AT_PAGE == rNewA.GetAnchorId()) return sal_True; // Seitengebundenen wird immer ausgewichen. // Wenn absatzgebundene Flys in einem FlyCnt gefangen sind, so @@ -2015,8 +2005,8 @@ sal_Bool SwTxtFly::ForEach( const SwRect &rRect, SwRect* pRect, sal_Bool bAvoid // --> OD 2006-08-15 #i68520# GetMaster() == pAnchoredObj->GetAnchorFrm() || // <-- - ( FLY_AT_CNTNT != rAnchor.GetAnchorId() && - FLY_AUTO_CNTNT != rAnchor.GetAnchorId() ) ) ) + ((FLY_AT_PARA != rAnchor.GetAnchorId()) && + (FLY_AT_CHAR != rAnchor.GetAnchorId())) ) ) || aRect.Top() == WEIT_WECH ) continue; } @@ -2442,9 +2432,11 @@ SwSurround SwTxtFly::_GetSurroundForTextWrap( const SwAnchoredObject* pAnchoredO if( rFlyFmt.IsAnchorOnly() && pAnchoredObj->GetAnchorFrm() != GetMaster() ) { const SwFmtAnchor& rAnchor = pFmt->GetAnchor(); - if ( FLY_AT_CNTNT == rAnchor.GetAnchorId() || - FLY_AUTO_CNTNT == rAnchor.GetAnchorId() ) + if ((FLY_AT_PARA == rAnchor.GetAnchorId()) || + (FLY_AT_CHAR == rAnchor.GetAnchorId())) + { return SURROUND_NONE; + } } // Beim Durchlauf und Nowrap wird smart ignoriert. diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx index 14944264d39e..479d082b5477 100644 --- a/sw/source/core/text/txtfrm.cxx +++ b/sw/source/core/text/txtfrm.cxx @@ -65,9 +65,7 @@ #include #include #include -#ifndef _FMTLINE_HXX #include -#endif #include // SwTxtFrm #include // SwSectFrm #include // DBG_LOOP @@ -76,9 +74,7 @@ #include #include // GetLineSpace benutzt pLastFont #include -#ifndef _LINEINFO_HXX #include -#endif #include // OD 2004-01-15 #110582# #include @@ -101,6 +97,7 @@ extern const sal_Char *GetPrepName( const enum PrepareHint ePrep ); #endif + TYPEINIT1( SwTxtFrm, SwCntntFrm ); // Switches width and height of the text frame @@ -487,7 +484,7 @@ bool lcl_HideObj( const SwTxtFrm& _rFrm, { bool bRet( true ); - if ( _eAnchorType == FLY_AUTO_CNTNT ) + if (_eAnchorType == FLY_AT_CHAR) { const IDocumentSettingAccess* pIDSA = _rFrm.GetTxtNode()->getIDocumentSettingAccess(); if ( !pIDSA->get(IDocumentSettingAccess::USE_FORMER_TEXT_WRAPPING) && @@ -560,8 +557,9 @@ void SwTxtFrm::HideAndShowObjects() // under certain conditions const RndStdIds eAnchorType( pContact->GetAnchorId() ); const xub_StrLen nObjAnchorPos = pContact->GetCntntAnchorIndex().GetIndex(); - if ( eAnchorType != FLY_AUTO_CNTNT || - lcl_HideObj( *this, eAnchorType, nObjAnchorPos, (*GetDrawObjs())[i] ) ) + if ((eAnchorType != FLY_AT_CHAR) || + lcl_HideObj( *this, eAnchorType, nObjAnchorPos, + (*GetDrawObjs())[i] )) { pContact->MoveObjToInvisibleLayer( pObj ); } @@ -588,12 +586,12 @@ void SwTxtFrm::HideAndShowObjects() const RndStdIds eAnchorType( pContact->GetAnchorId() ); // <-- - if ( eAnchorType == FLY_AT_CNTNT ) + if (eAnchorType == FLY_AT_PARA) { pContact->MoveObjToVisibleLayer( pObj ); } - else if ( eAnchorType == FLY_AUTO_CNTNT || - eAnchorType == FLY_IN_CNTNT ) + else if ((eAnchorType == FLY_AT_CHAR) || + (eAnchorType == FLY_AS_CHAR)) { xub_StrLen nHiddenStart; xub_StrLen nHiddenEnd; @@ -1704,7 +1702,7 @@ void SwTxtFrm::Prepare( const PrepareHint ePrep, const void* pVoid, // --> OD 2004-07-16 #i28701# - consider all // to-character anchored objects if ( pAnchoredObj->GetFrmFmt().GetAnchor().GetAnchorId() - == FLY_AUTO_CNTNT ) + == FLY_AT_CHAR ) { bFormat = sal_True; break; diff --git a/sw/source/core/txtnode/atrflyin.cxx b/sw/source/core/txtnode/atrflyin.cxx index fa0a734f79c1..eefca09e08d0 100644 --- a/sw/source/core/txtnode/atrflyin.cxx +++ b/sw/source/core/txtnode/atrflyin.cxx @@ -124,8 +124,8 @@ void SwTxtFlyCnt::CopyFlyFmt( SwDoc* pDoc ) BOOL bUndo = pDoc->DoesUndo(); pDoc->DoUndo( FALSE ); SwFmtAnchor aAnchor( pFmt->GetAnchor() ); - if( FLY_PAGE != aAnchor.GetAnchorId() && - pDoc != pFmt->GetDoc() ) // Unterschiedliche Docs? + if ((FLY_AT_PAGE != aAnchor.GetAnchorId()) && + (pDoc != pFmt->GetDoc())) // different documents? { // JP 03.06.96: dann sorge dafuer, das der koperierte Anker auf // gueltigen Content zeigt! Die Umsetzung auf die @@ -137,8 +137,10 @@ void SwTxtFlyCnt::CopyFlyFmt( SwDoc* pDoc ) SwPosition* pPos = (SwPosition*)aAnchor.GetCntntAnchor(); pPos->nNode = aIdx; - if( FLY_IN_CNTNT == aAnchor.GetAnchorId() ) + if (FLY_AS_CHAR == aAnchor.GetAnchorId()) + { pPos->nContent.Assign( pCNd, 0 ); + } else { pPos->nContent.Assign( 0, 0 ); @@ -181,7 +183,7 @@ void SwTxtFlyCnt::SetAnchor( const SwTxtNode *pNode ) else aPos.nNode = aAnchor.GetCntntAnchor()->nNode; - aAnchor.SetType( FLY_IN_CNTNT ); // defaulten !! + aAnchor.SetType( FLY_AS_CHAR ); // default! aAnchor.SetAnchor( &aPos ); // beim Ankerwechsel werden immer alle FlyFrms vom Attribut geloescht diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx index 81a3b629f402..ba471381cad4 100644 --- a/sw/source/core/txtnode/thints.cxx +++ b/sw/source/core/txtnode/thints.cxx @@ -1270,11 +1270,15 @@ bool SwTxtNode::InsertHint( SwTxtAttr * const pAttr, const SetAttrMode nMode ) InsertText( c, aIdx, nInsertFlags ); nInsMode |= nsSetAttrMode::SETATTR_NOTXTATRCHR; - if( pAnchor && FLY_IN_CNTNT == pAnchor->GetAnchorId() && + if (pAnchor && + (FLY_AS_CHAR == pAnchor->GetAnchorId()) && pAnchor->GetCntntAnchor() && pAnchor->GetCntntAnchor()->nNode == *this && pAnchor->GetCntntAnchor()->nContent == aIdx ) - ((SwIndex&)pAnchor->GetCntntAnchor()->nContent)--; + { + const_cast( + pAnchor->GetCntntAnchor()->nContent)--; + } } pFly->SetAnchor( this ); diff --git a/sw/source/core/undo/rolbck.cxx b/sw/source/core/undo/rolbck.cxx index 908fc480fe66..d7df1593af7a 100644 --- a/sw/source/core/undo/rolbck.cxx +++ b/sw/source/core/undo/rolbck.cxx @@ -922,7 +922,7 @@ SwHistoryChangeFlyAnchor::SwHistoryChangeFlyAnchor( SwFrmFmt& rFmt ) : SwHistoryHint( HSTRY_CHGFLYANCHOR ) , m_rFmt( rFmt ) , m_nOldNodeIndex( rFmt.GetAnchor().GetCntntAnchor()->nNode.GetIndex() ) - , m_nOldContentIndex( ( FLY_AUTO_CNTNT == rFmt.GetAnchor().GetAnchorId() ) + , m_nOldContentIndex( (FLY_AT_CHAR == rFmt.GetAnchor().GetAnchorId()) ? rFmt.GetAnchor().GetCntntAnchor()->nContent.GetIndex() : STRING_MAXLEN ) { diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx index e5312b3cefdd..acc167ed9900 100644 --- a/sw/source/core/undo/unattr.cxx +++ b/sw/source/core/undo/unattr.cxx @@ -462,10 +462,10 @@ void SwUndoFmtAttr::SaveFlyAnchor( bool bSvDrwPt ) xub_StrLen nCntnt = 0; switch( rAnchor.GetAnchorId() ) { - case FLY_IN_CNTNT: - case FLY_AUTO_CNTNT: + case FLY_AS_CHAR: + case FLY_AT_CHAR: nCntnt = rAnchor.GetCntntAnchor()->nContent.GetIndex(); - case FLY_AT_CNTNT: + case FLY_AT_PARA: case FLY_AT_FLY: m_nNodeIndex = rAnchor.GetCntntAnchor()->nNode.GetIndex(); break; @@ -489,7 +489,7 @@ bool SwUndoFmtAttr::RestoreFlyAnchor( SwUndoIter& rIter ) static_cast( m_pOldSet->Get( RES_ANCHOR, FALSE ) ); SwFmtAnchor aNewAnchor( rAnchor.GetAnchorId() ); - if( FLY_PAGE != rAnchor.GetAnchorId() ) + if (FLY_AT_PAGE != rAnchor.GetAnchorId()) { SwNode* pNd = pDoc->GetNodes()[ m_nNodeIndex ]; @@ -505,8 +505,8 @@ bool SwUndoFmtAttr::RestoreFlyAnchor( SwUndoIter& rIter ) } SwPosition aPos( *pNd ); - if( FLY_IN_CNTNT == rAnchor.GetAnchorId() || - FLY_AUTO_CNTNT == rAnchor.GetAnchorId() ) + if ((FLY_AS_CHAR == rAnchor.GetAnchorId()) || + (FLY_AT_CHAR == rAnchor.GetAnchorId())) { aPos.nContent.Assign( (SwTxtNode*)pNd, rAnchor.GetPageNum() ); if ( aPos.nContent.GetIndex() > @@ -549,7 +549,7 @@ bool SwUndoFmtAttr::RestoreFlyAnchor( SwUndoIter& rIter ) const SwFmtAnchor &rOldAnch = pFrmFmt->GetAnchor(); // --> OD 2006-03-13 #i54336# // Consider case, that as-character anchored object has moved its anchor position. - if ( FLY_IN_CNTNT == rOldAnch.GetAnchorId() ) + if (FLY_AS_CHAR == rOldAnch.GetAnchorId()) // <-- { //Bei InCntnt's wird es spannend: Das TxtAttribut muss vernichtet @@ -613,7 +613,7 @@ bool SwUndoFmtAttr::RestoreFlyAnchor( SwUndoIter& rIter ) SwFmtFrmSize( ATT_VAR_SIZE, aDrawOldPt.X(), aDrawOldPt.Y() ) ); } - if( FLY_IN_CNTNT == aNewAnchor.GetAnchorId() ) + if (FLY_AS_CHAR == aNewAnchor.GetAnchorId()) { const SwPosition* pPos = aNewAnchor.GetCntntAnchor(); SwTxtNode* pTxtNd = pPos->nNode.GetNode().GetTxtNode(); diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx index d9a2e6e8486c..dfa0ee9d469e 100644 --- a/sw/source/core/undo/undel.cxx +++ b/sw/source/core/undo/undel.cxx @@ -81,7 +81,7 @@ void lcl_MakeAutoFrms( const SwSpzFrmFmts& rSpzArr, ULONG nMovedIndex ) { pFmt = (SwFlyFrmFmt*)rSpzArr[n]; pAnchor = &pFmt->GetAnchor(); - if( pAnchor->GetAnchorId() == FLY_AUTO_CNTNT ) + if (pAnchor->GetAnchorId() == FLY_AT_CHAR) { const SwPosition* pAPos = pAnchor->GetCntntAnchor(); if( pAPos && nMovedIndex == pAPos->nNode.GetIndex() ) @@ -632,7 +632,7 @@ void lcl_ReAnchorAtCntntFlyFrames( const SwSpzFrmFmts& rSpzArr, SwPosition &rPos { pFmt = (SwFlyFrmFmt*)rSpzArr[n]; pAnchor = &pFmt->GetAnchor(); - if( pAnchor->GetAnchorId() == FLY_AT_CNTNT ) + if (pAnchor->GetAnchorId() == FLY_AT_PARA) { pAPos = pAnchor->GetCntntAnchor(); if( pAPos && nOldIdx == pAPos->nNode.GetIndex() ) diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx index 3b090e875ea8..ce479d51ac98 100644 --- a/sw/source/core/undo/undobj.cxx +++ b/sw/source/core/undo/undobj.cxx @@ -593,7 +593,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark, pAnchor = &pFmt->GetAnchor(); switch( pAnchor->GetAnchorId() ) { - case FLY_IN_CNTNT: + case FLY_AS_CHAR: if( 0 != (pAPos = pAnchor->GetCntntAnchor() ) && (( nsDelCntntType::DELCNT_CHKNOCNTNT & nDelCntntType ) ? ( pStt->nNode <= pAPos->nNode && @@ -611,7 +611,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark, n = n >= rSpzArr.Count() ? rSpzArr.Count() : n+1; } break; - case FLY_AT_CNTNT: + case FLY_AT_PARA: { pAPos = pAnchor->GetCntntAnchor(); if( pAPos ) @@ -660,7 +660,7 @@ void SwUndoSaveCntnt::DelCntntIndex( const SwPosition& rMark, } } break; - case FLY_AUTO_CNTNT: + case FLY_AT_CHAR: if( 0 != (pAPos = pAnchor->GetCntntAnchor() ) && ( pStt->nNode <= pAPos->nNode && pAPos->nNode <= pEnd->nNode ) ) { diff --git a/sw/source/core/undo/undobj1.cxx b/sw/source/core/undo/undobj1.cxx index dd261282e5c7..69b235d7f5eb 100644 --- a/sw/source/core/undo/undobj1.cxx +++ b/sw/source/core/undo/undobj1.cxx @@ -93,15 +93,19 @@ void SwUndoFlyBase::InsFly( SwUndoIter& rUndoIter, BOOL bShowSelFrm ) SwFmtAnchor aAnchor( (RndStdIds)nRndId ); - if( FLY_PAGE == nRndId ) + if (FLY_AT_PAGE == nRndId) + { aAnchor.SetPageNum( (USHORT)nNdPgPos ); + } else { SwPosition aNewPos( *rUndoIter.pAktPam->GetPoint() ); aNewPos.nNode = nNdPgPos; - if( FLY_IN_CNTNT == nRndId || FLY_AUTO_CNTNT == nRndId ) + if ((FLY_AS_CHAR == nRndId) || (FLY_AT_CHAR == nRndId)) + { aNewPos.nContent.Assign( aNewPos.nNode.GetNode().GetCntntNode(), nCntPos ); + } aAnchor.SetAnchor( &aNewPos ); } @@ -119,7 +123,7 @@ void SwUndoFlyBase::InsFly( SwUndoIter& rUndoIter, BOOL bShowSelFrm ) // vorhanden ist! Sonst wuerde das Layout den Fly vorher // formatieren, aber keine Inhalt finden; so geschene bei // Grafiken aus dem Internet - if( FLY_IN_CNTNT == nRndId ) + if (FLY_AS_CHAR == nRndId) { // es muss mindestens das Attribut im TextNode stehen SwCntntNode* pCNd = aAnchor.GetCntntAnchor()->nNode.GetNode().GetCntntNode(); @@ -138,22 +142,22 @@ void SwUndoFlyBase::InsFly( SwUndoIter& rUndoIter, BOOL bShowSelFrm ) switch( nRndId ) { - case FLY_IN_CNTNT: - case FLY_AUTO_CNTNT: + case FLY_AS_CHAR: + case FLY_AT_CHAR: { const SwFmtAnchor& rAnchor = pFrmFmt->GetAnchor(); nNdPgPos = rAnchor.GetCntntAnchor()->nNode.GetIndex(); nCntPos = rAnchor.GetCntntAnchor()->nContent.GetIndex(); } break; - case FLY_AT_CNTNT: + case FLY_AT_PARA: case FLY_AT_FLY: { const SwFmtAnchor& rAnchor = pFrmFmt->GetAnchor(); nNdPgPos = rAnchor.GetCntntAnchor()->nNode.GetIndex(); } break; - case FLY_PAGE: + case FLY_AT_PAGE: break; } bDelFmt = FALSE; @@ -193,7 +197,8 @@ void SwUndoFlyBase::DelFly( SwDoc* pDoc ) const SwFmtAnchor& rAnchor = pFrmFmt->GetAnchor(); const SwPosition* pPos = rAnchor.GetCntntAnchor(); // die Positionen im Nodes-Array haben sich verschoben - if( FLY_IN_CNTNT == ( nRndId = static_cast(rAnchor.GetAnchorId()) ) ) + nRndId = static_cast(rAnchor.GetAnchorId()); + if (FLY_AS_CHAR == nRndId) { nNdPgPos = pPos->nNode.GetIndex(); nCntPos = pPos->nContent.GetIndex(); @@ -210,15 +215,19 @@ void SwUndoFlyBase::DelFly( SwDoc* pDoc ) pTxtNd->EraseText( aIdx, 1 ); } } - else if( FLY_AUTO_CNTNT == nRndId ) + else if (FLY_AT_CHAR == nRndId) { nNdPgPos = pPos->nNode.GetIndex(); nCntPos = pPos->nContent.GetIndex(); } - else if( FLY_AT_CNTNT == nRndId || FLY_AT_FLY == nRndId ) + else if ((FLY_AT_PARA == nRndId) || (FLY_AT_FLY == nRndId)) + { nNdPgPos = pPos->nNode.GetIndex(); + } else + { nNdPgPos = rAnchor.GetPageNum(); + } pFrmFmt->ResetFmtAttr( RES_ANCHOR ); // Anchor loeschen @@ -240,15 +249,15 @@ SwUndoInsLayFmt::SwUndoInsLayFmt( SwFrmFmt* pFormat, ULONG nNodeIdx, xub_StrLen bDelFmt = FALSE; switch( nRndId ) { - case FLY_PAGE: + case FLY_AT_PAGE: nNdPgPos = rAnchor.GetPageNum(); break; - case FLY_AT_CNTNT: + case FLY_AT_PARA: case FLY_AT_FLY: nNdPgPos = rAnchor.GetCntntAnchor()->nNode.GetIndex(); break; - case FLY_IN_CNTNT: - case FLY_AUTO_CNTNT: + case FLY_AS_CHAR: + case FLY_AT_CHAR: { const SwPosition* pPos = rAnchor.GetCntntAnchor(); nCntPos = pPos->nContent.GetIndex(); @@ -305,13 +314,15 @@ void SwUndoInsLayFmt::Repeat( SwUndoIter& rUndoIter ) SwDoc* pDoc = &rUndoIter.GetDoc(); // erfrage und setze den Anker neu SwFmtAnchor aAnchor( pFrmFmt->GetAnchor() ); - if( FLY_AT_CNTNT == aAnchor.GetAnchorId() || - FLY_AUTO_CNTNT == aAnchor.GetAnchorId() || - FLY_IN_CNTNT == aAnchor.GetAnchorId() ) + if ((FLY_AT_PARA == aAnchor.GetAnchorId()) || + (FLY_AT_CHAR == aAnchor.GetAnchorId()) || + (FLY_AS_CHAR == aAnchor.GetAnchorId())) { SwPosition aPos( *rUndoIter.pAktPam->GetPoint() ); - if( FLY_AT_CNTNT == aAnchor.GetAnchorId() ) + if (FLY_AT_PARA == aAnchor.GetAnchorId()) + { aPos.nContent.Assign( 0, 0 ); + } aAnchor.SetAnchor( &aPos ); } else if( FLY_AT_FLY == aAnchor.GetAnchorId() ) @@ -328,7 +339,7 @@ void SwUndoInsLayFmt::Repeat( SwUndoIter& rUndoIter ) return ; } } - else if( FLY_PAGE == aAnchor.GetAnchorId() ) + else if (FLY_AT_PAGE == aAnchor.GetAnchorId()) { aAnchor.SetPageNum( pDoc->GetRootFrm()->GetCurrPage( rUndoIter.pAktPam )); @@ -482,7 +493,7 @@ void SwUndoSetFlyFmt::GetAnchor( SwFmtAnchor& rAnchor, ULONG nNode, xub_StrLen nCntnt ) { RndStdIds nAnchorTyp = rAnchor.GetAnchorId(); - if( FLY_PAGE != nAnchorTyp ) + if (FLY_AT_PAGE != nAnchorTyp) { SwNode* pNd = pFrmFmt->GetDoc()->GetNodes()[ nNode ]; @@ -490,26 +501,34 @@ void SwUndoSetFlyFmt::GetAnchor( SwFmtAnchor& rAnchor, ? ( !pNd->IsStartNode() || SwFlyStartNode != ((SwStartNode*)pNd)->GetStartNodeType() ) : !pNd->IsTxtNode() ) - pNd = 0; // ungueltige Position + { + pNd = 0; // invalid position + } else { SwPosition aPos( *pNd ); - if( FLY_IN_CNTNT == nAnchorTyp || - FLY_AUTO_CNTNT == nAnchorTyp ) + if ((FLY_AS_CHAR == nAnchorTyp) || + (FLY_AT_CHAR == nAnchorTyp)) { - if( nCntnt > ((SwTxtNode*)pNd)->GetTxt().Len() ) - pNd = 0; // ungueltige Position + if ( nCntnt > static_cast(pNd)->GetTxt().Len() ) + { + pNd = 0; // invalid position + } else - aPos.nContent.Assign( (SwTxtNode*)pNd, nCntnt ); + { + aPos.nContent.Assign(static_cast(pNd), nCntnt); + } } - if( pNd ) + if ( pNd ) + { rAnchor.SetAnchor( &aPos ); + } } if( !pNd ) { // ungueltige Position - setze auf 1. Seite - rAnchor.SetType( FLY_PAGE ); + rAnchor.SetType( FLY_AT_PAGE ); rAnchor.SetPageNum( 1 ); } } @@ -548,7 +567,7 @@ void SwUndoSetFlyFmt::Undo( SwUndoIter& rIter ) if( bAnchorChgd ) { const SwFmtAnchor& rOldAnch = pFrmFmt->GetAnchor(); - if( FLY_IN_CNTNT == rOldAnch.GetAnchorId() ) + if (FLY_AS_CHAR == rOldAnch.GetAnchorId()) { // Bei InCntnt's wird es spannend: Das TxtAttribut muss // vernichtet werden. Leider reisst dies neben den Frms @@ -577,7 +596,7 @@ void SwUndoSetFlyFmt::Undo( SwUndoIter& rIter ) GetAnchor( aNewAnchor, nOldNode, nOldCntnt ); pFrmFmt->SetFmtAttr( aNewAnchor ); - if( FLY_IN_CNTNT == aNewAnchor.GetAnchorId() ) + if (FLY_AS_CHAR == aNewAnchor.GetAnchorId()) { SwPosition* pPos = (SwPosition*)aNewAnchor.GetCntntAnchor(); SwFmtFlyCnt aFmt( pFrmFmt ); @@ -629,10 +648,10 @@ void SwUndoSetFlyFmt::PutAttr( USHORT nWhich, const SfxPoolItem* pItem ) const SwFmtAnchor* pAnchor = (SwFmtAnchor*)pItem; switch( nOldAnchorTyp = static_cast(pAnchor->GetAnchorId()) ) { - case FLY_IN_CNTNT: - case FLY_AUTO_CNTNT: + case FLY_AS_CHAR: + case FLY_AT_CHAR: nOldCntnt = pAnchor->GetCntntAnchor()->nContent.GetIndex(); - case FLY_AT_CNTNT: + case FLY_AT_PARA: case FLY_AT_FLY: nOldNode = pAnchor->GetCntntAnchor()->nNode.GetIndex(); break; @@ -644,10 +663,10 @@ void SwUndoSetFlyFmt::PutAttr( USHORT nWhich, const SfxPoolItem* pItem ) pAnchor = (SwFmtAnchor*)&pFrmFmt->GetAnchor(); switch( nNewAnchorTyp = static_cast(pAnchor->GetAnchorId()) ) { - case FLY_IN_CNTNT: - case FLY_AUTO_CNTNT: + case FLY_AS_CHAR: + case FLY_AT_CHAR: nNewCntnt = pAnchor->GetCntntAnchor()->nContent.GetIndex(); - case FLY_AT_CNTNT: + case FLY_AT_PARA: case FLY_AT_FLY: nNewNode = pAnchor->GetCntntAnchor()->nNode.GetIndex(); break; diff --git a/sw/source/core/undo/undraw.cxx b/sw/source/core/undo/undraw.cxx index 54ed7ea8421d..2c09ff4f3da6 100644 --- a/sw/source/core/undo/undraw.cxx +++ b/sw/source/core/undo/undraw.cxx @@ -32,15 +32,9 @@ #include "precompiled_sw.hxx" #include - -#ifndef _RTL_MEMORY_H #include -#endif #include -#ifndef _RTL_STRING_H -#include -#endif #include #include #include @@ -61,6 +55,7 @@ #include #include + struct SwUndoGroupObjImpl { SwDrawFrmFmt* pFmt; @@ -142,15 +137,15 @@ void lcl_SendRemoveToUno( SwFmt& rFmt ) void lcl_SaveAnchor( SwFrmFmt* pFmt, ULONG& rNodePos ) { const SwFmtAnchor& rAnchor = pFmt->GetAnchor(); - if( FLY_AT_CNTNT == rAnchor.GetAnchorId() || - FLY_AUTO_CNTNT == rAnchor.GetAnchorId() || - FLY_AT_FLY == rAnchor.GetAnchorId() || - FLY_IN_CNTNT == rAnchor.GetAnchorId() ) + if ((FLY_AT_PARA == rAnchor.GetAnchorId()) || + (FLY_AT_CHAR == rAnchor.GetAnchorId()) || + (FLY_AT_FLY == rAnchor.GetAnchorId()) || + (FLY_AS_CHAR == rAnchor.GetAnchorId())) { rNodePos = rAnchor.GetCntntAnchor()->nNode.GetIndex(); xub_StrLen nCntntPos = 0; - if( FLY_IN_CNTNT == rAnchor.GetAnchorId() ) + if (FLY_AS_CHAR == rAnchor.GetAnchorId()) { nCntntPos = rAnchor.GetCntntAnchor()->nContent.GetIndex(); @@ -168,8 +163,10 @@ void lcl_SaveAnchor( SwFrmFmt* pFmt, ULONG& rNodePos ) pTxtNd->EraseText( aIdx, 1 ); } } - else if( FLY_AUTO_CNTNT == rAnchor.GetAnchorId() ) + else if (FLY_AT_CHAR == rAnchor.GetAnchorId()) + { nCntntPos = rAnchor.GetCntntAnchor()->nContent.GetIndex(); + } pFmt->SetFmtAttr( SwFmtAnchor( rAnchor.GetAnchorId(), nCntntPos ) ); } @@ -178,10 +175,10 @@ void lcl_SaveAnchor( SwFrmFmt* pFmt, ULONG& rNodePos ) void lcl_RestoreAnchor( SwFrmFmt* pFmt, ULONG& rNodePos ) { const SwFmtAnchor& rAnchor = pFmt->GetAnchor(); - if( FLY_AT_CNTNT == rAnchor.GetAnchorId() || - FLY_AUTO_CNTNT == rAnchor.GetAnchorId() || - FLY_AT_FLY == rAnchor.GetAnchorId() || - FLY_IN_CNTNT == rAnchor.GetAnchorId() ) + if ((FLY_AT_PARA == rAnchor.GetAnchorId()) || + (FLY_AT_CHAR == rAnchor.GetAnchorId()) || + (FLY_AT_FLY == rAnchor.GetAnchorId()) || + (FLY_AS_CHAR == rAnchor.GetAnchorId())) { xub_StrLen nCntntPos = rAnchor.GetPageNum(); SwNodes& rNds = pFmt->GetDoc()->GetNodes(); @@ -190,13 +187,15 @@ void lcl_RestoreAnchor( SwFrmFmt* pFmt, ULONG& rNodePos ) SwPosition aPos( aIdx ); SwFmtAnchor aTmp( rAnchor.GetAnchorId() ); - if( FLY_IN_CNTNT == rAnchor.GetAnchorId() || - FLY_AUTO_CNTNT == rAnchor.GetAnchorId() ) + if ((FLY_AS_CHAR == rAnchor.GetAnchorId()) || + (FLY_AT_CHAR == rAnchor.GetAnchorId())) + { aPos.nContent.Assign( aIdx.GetNode().GetCntntNode(), nCntntPos ); + } aTmp.SetAnchor( &aPos ); pFmt->SetFmtAttr( aTmp ); - if( FLY_IN_CNTNT == rAnchor.GetAnchorId() ) + if (FLY_AS_CHAR == rAnchor.GetAnchorId()) { SwTxtNode *pTxtNd = aIdx.GetNode().GetTxtNode(); ASSERT( pTxtNd, "no Text Node" ); diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx index 3d5dbd429e49..438bdf733666 100644 --- a/sw/source/core/undo/untbl.cxx +++ b/sw/source/core/undo/untbl.cxx @@ -449,12 +449,12 @@ SwUndoTblToTxt::SwUndoTblToTxt( const SwTable& rTbl, sal_Unicode cCh ) const SwSpzFrmFmts& rFrmFmtTbl = *pTblNd->GetDoc()->GetSpzFrmFmts(); for( USHORT n = 0; n < rFrmFmtTbl.Count(); ++n ) { - const SwPosition* pAPos; SwFrmFmt* pFmt = rFrmFmtTbl[ n ]; - const SwFmtAnchor* pAnchor = &pFmt->GetAnchor(); - if( 0 != ( pAPos = pAnchor->GetCntntAnchor()) && - ( FLY_AUTO_CNTNT == pAnchor->GetAnchorId() || - FLY_AT_CNTNT == pAnchor->GetAnchorId() ) && + SwFmtAnchor const*const pAnchor = &pFmt->GetAnchor(); + SwPosition const*const pAPos = pAnchor->GetCntntAnchor(); + if (pAPos && + ((FLY_AT_CHAR == pAnchor->GetAnchorId()) || + (FLY_AT_PARA == pAnchor->GetAnchorId())) && nTblStt <= pAPos->nNode.GetIndex() && pAPos->nNode.GetIndex() < nTblEnd ) { diff --git a/sw/source/core/undo/untblk.cxx b/sw/source/core/undo/untblk.cxx index 1c076a05dcce..6a6618935155 100644 --- a/sw/source/core/undo/untblk.cxx +++ b/sw/source/core/undo/untblk.cxx @@ -69,10 +69,10 @@ SwUndoInserts::SwUndoInserts( SwUndoId nUndoId, const SwPaM& rPam ) for( USHORT n = 0; n < nArrLen; ++n ) { SwFrmFmt* pFmt = (*pDoc->GetSpzFrmFmts())[n]; - const SwFmtAnchor* pAnchor = &pFmt->GetAnchor(); - const SwPosition* pAPos; - if ( pAnchor->GetAnchorId() == FLY_AT_CNTNT && - 0 != ( pAPos = pAnchor->GetCntntAnchor()) && + SwFmtAnchor const*const pAnchor = &pFmt->GetAnchor(); + const SwPosition* pAPos = pAnchor->GetCntntAnchor(); + if (pAPos && + (pAnchor->GetAnchorId() == FLY_AT_PARA) && nSttNode == pAPos->nNode.GetIndex() ) { if( !pFrmFmts ) @@ -124,10 +124,10 @@ void SwUndoInserts::SetInsertRange( const SwPaM& rPam, BOOL bScanFlys, for( USHORT n = 0; n < nArrLen; ++n ) { SwFrmFmt* pFmt = (*pDoc->GetSpzFrmFmts())[n]; - const SwFmtAnchor* pAnchor = &pFmt->GetAnchor(); - const SwPosition* pAPos; - if( pAnchor->GetAnchorId() == FLY_AT_CNTNT && - 0 != ( pAPos = pAnchor->GetCntntAnchor()) && + SwFmtAnchor const*const pAnchor = &pFmt->GetAnchor(); + SwPosition const*const pAPos = pAnchor->GetCntntAnchor(); + if (pAPos && + (pAnchor->GetAnchorId() == FLY_AT_PARA) && nSttNode == pAPos->nNode.GetIndex() ) { if( !pFrmFmts || diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index f8256a7ada0b..5a050eb690ed 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -163,7 +163,9 @@ public: SwFmtAnchor* GetAnchor(sal_Bool bCreate = sal_False) { if(bCreate && !pAnchor) - pAnchor = new SwFmtAnchor(FLY_IN_CNTNT); + { + pAnchor = new SwFmtAnchor(FLY_AS_CHAR); + } return pAnchor; } SwFmtHoriOrient* GetHOrient(sal_Bool bCreate = sal_False) @@ -700,7 +702,7 @@ void SwXDrawPage::add(const uno::Reference< drawing::XShape > & xShape) SfxItemSet aSet( pDoc->GetAttrPool(), RES_FRMATR_BEGIN, RES_FRMATR_END-1 ); - SwFmtAnchor aAnchor( FLY_IN_CNTNT ); + SwFmtAnchor aAnchor( FLY_AS_CHAR ); sal_Bool bOpaque = sal_False; if( pDesc ) { @@ -781,14 +783,18 @@ void SwXDrawPage::add(const uno::Reference< drawing::XShape > & xShape) { if(FLY_AT_FLY == aAnchor.GetAnchorId() && !pInternalPam->GetNode()->FindFlyStartNode()) - aAnchor.SetType(FLY_IN_CNTNT); - else if(FLY_PAGE == aAnchor.GetAnchorId()) + { + aAnchor.SetType(FLY_AS_CHAR); + } + else if (FLY_AT_PAGE == aAnchor.GetAnchorId()) + { aAnchor.SetAnchor(pInternalPam->Start()); + } } else throw uno::RuntimeException(); } - else if( aAnchor.GetAnchorId() != FLY_PAGE && pDoc->GetRootFrm() ) + else if ((aAnchor.GetAnchorId() != FLY_AT_PAGE) && pDoc->GetRootFrm()) { SwCrsrMoveState aState( MV_SETONLYTEXT ); Point aTmp(MM100_TO_TWIP(aMM100Pos.X), MM100_TO_TWIP(aMM100Pos.Y)); @@ -800,7 +806,7 @@ void SwXDrawPage::add(const uno::Reference< drawing::XShape > & xShape) } else { - aAnchor.SetType(FLY_PAGE); + aAnchor.SetType(FLY_AT_PAGE); // --> OD 2004-08-18 #i32349# - adjustment of vertical positioning // attributes no longer needed, because its already got a default. @@ -853,8 +859,11 @@ uno::Reference< drawing::XShapeGroup > SwXDrawPage::group(const uno::Reference< for ( sal_uInt16 i = 0; !bFlyInCnt && i < rMarkList.GetMarkCount(); ++i ) { const SdrObject *pObj = rMarkList.GetMark( i )->GetMarkedSdrObj(); - if ( FLY_IN_CNTNT == ::FindFrmFmt( (SdrObject*)pObj )->GetAnchor().GetAnchorId() ) + if (FLY_AS_CHAR == ::FindFrmFmt(const_cast( + pObj))->GetAnchor().GetAnchorId()) + { bFlyInCnt = sal_True; + } } if( bFlyInCnt ) throw uno::RuntimeException(); @@ -864,7 +873,9 @@ uno::Reference< drawing::XShapeGroup > SwXDrawPage::group(const uno::Reference< pDoc->StartUndo( UNDO_START, NULL ); SwDrawContact* pContact = pDoc->GroupSelection( *pPage->GetDrawView() ); - pDoc->ChgAnchor( pPage->GetDrawView()->GetMarkedObjectList(), FLY_AT_CNTNT/*int eAnchorId*/, + pDoc->ChgAnchor( + pPage->GetDrawView()->GetMarkedObjectList(), + FLY_AT_PARA/*int eAnchorId*/, sal_True, sal_False ); pPage->GetDrawView()->UnmarkAll(); @@ -899,7 +910,8 @@ void SwXDrawPage::ungroup(const uno::Reference< drawing::XShapeGroup > & xShapeG pDoc->StartUndo( UNDO_START, NULL ); pDoc->UnGroupSelection( *pPage->GetDrawView() ); - pDoc->ChgAnchor( pPage->GetDrawView()->GetMarkedObjectList(), FLY_AT_CNTNT/*int eAnchorId*/, + pDoc->ChgAnchor( pPage->GetDrawView()->GetMarkedObjectList(), + FLY_AT_PARA/*int eAnchorId*/, sal_True, sal_False ); pDoc->EndUndo( UNDO_END, NULL ); } @@ -1274,7 +1286,7 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A else if ( FN_TEXT_RANGE == pEntry->nWID ) { SwFmtAnchor aAnchor( static_cast(aSet.Get( RES_ANCHOR )) ); - if ( aAnchor.GetAnchorId() == FLY_PAGE ) + if (aAnchor.GetAnchorId() == FLY_AT_PAGE) { // set property not valid for to-page anchored shapes throw lang::IllegalArgumentException(); @@ -1287,7 +1299,7 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A aValue >>= xRg; if ( SwXTextRange::XTextRangeToSwPaM(*pInternalPam, xRg) ) { - if(aAnchor.GetAnchorId() == FLY_IN_CNTNT) + if (aAnchor.GetAnchorId() == FLY_AS_CHAR) { //delete old SwFmtFlyCnt //With AnchorAsCharacter the current TxtAttribute has to be deleted. @@ -1375,7 +1387,7 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A SwFrmFmt *pFlyFmt = FindFrmFmt( pObj ); pFlyFmt->DelFrms(); if( text::TextContentAnchorType_AS_CHARACTER != eNewAnchor && - FLY_IN_CNTNT == eOldAnchorId ) + (FLY_AS_CHAR == eOldAnchorId)) { //With AnchorAsCharacter the current TxtAttribute has to be deleted. //Tbis removes the frame format too. @@ -1398,7 +1410,7 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A pTxtNode->DeleteAttributes(RES_TXTATR_FLYCNT, nIdx); } else if( text::TextContentAnchorType_AT_PAGE != eNewAnchor && - FLY_PAGE == eOldAnchorId ) + (FLY_AT_PAGE == eOldAnchorId)) { SwFmtAnchor aNewAnchor( dynamic_cast< const SwFmtAnchor& >( aSet.Get( RES_ANCHOR ) ) ); //if the fly has been anchored at page then it needs to be connected @@ -1421,7 +1433,7 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A pFmt->SetFmtAttr(aSet); bSetAttr = false; if( text::TextContentAnchorType_AS_CHARACTER == eNewAnchor && - FLY_IN_CNTNT != eOldAnchorId ) + (FLY_AS_CHAR != eOldAnchorId)) { //the RES_TXTATR_FLYCNT needs to be added now SwTxtNode *pNd = aPam.GetNode()->GetTxtNode(); @@ -1606,7 +1618,7 @@ uno::Any SwXShape::getPropertyValue(const rtl::OUString& rPropertyName) else if ( FN_TEXT_RANGE == pEntry->nWID ) { const SwFmtAnchor aAnchor = pFmt->GetAnchor(); - if ( aAnchor.GetAnchorId() == FLY_PAGE ) + if (aAnchor.GetAnchorId() == FLY_AT_PAGE) { // return nothing, because property isn't // valid for to-page anchored shapes @@ -2180,7 +2192,7 @@ uno::Reference< text::XTextRange > SwXShape::getAnchor(void) throw( uno::Runtim const SwFmtAnchor& rAnchor = pFmt->GetAnchor(); // return an anchor for non-page bound frames // and for page bound frames that have a page no == NULL and a content position - if( rAnchor.GetAnchorId() != FLY_PAGE || + if ((rAnchor.GetAnchorId() != FLY_AT_PAGE) || (rAnchor.GetCntntAnchor() && !rAnchor.GetPageNum())) { const SwPosition &rPos = *(pFmt->GetAnchor().GetCntntAnchor()); @@ -2224,7 +2236,7 @@ void SwXShape::dispose(void) throw( uno::RuntimeException ) pObj->IsInserted() ) // <-- { - if( pFmt->GetAnchor().GetAnchorId() == FLY_IN_CNTNT ) + if (pFmt->GetAnchor().GetAnchorId() == FLY_AS_CHAR) { const SwPosition &rPos = *(pFmt->GetAnchor().GetCntntAnchor()); SwTxtNode *pTxtNode = rPos.nNode.GetNode().GetTxtNode(); diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 09066c447546..1f9d39bca94c 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -45,9 +45,7 @@ #include #include #include -#ifndef _DOCSH_HXX //autogen #include -#endif #include #include #include @@ -1402,7 +1400,8 @@ void SwXFrame::setPropertyValue(const :: OUString& rPropertyName, const :: uno:: aSet.Put(aAnchor); } } - else if(aAnchor.GetAnchorId() != FLY_PAGE && !aAnchor.GetCntntAnchor()) + else if ((aAnchor.GetAnchorId() != FLY_AT_PAGE) && + !aAnchor.GetCntntAnchor()) { SwNode& rNode = pDoc->GetNodes().GetEndOfContent(); SwPaM aPam(rNode); @@ -2023,7 +2022,7 @@ void SwXFrame::dispose(void) throw( uno::RuntimeException ) ( pObj->GetUserCall() && !static_cast(pObj->GetUserCall())->IsInDTOR() ) ) ) { - if( pFmt->GetAnchor().GetAnchorId() == FLY_IN_CNTNT ) + if (pFmt->GetAnchor().GetAnchorId() == FLY_AS_CHAR) { const SwPosition &rPos = *(pFmt->GetAnchor().GetCntntAnchor()); SwTxtNode *pTxtNode = rPos.nNode.GetNode().GetTxtNode(); @@ -2049,7 +2048,7 @@ uno::Reference< text::XTextRange > SwXFrame::getAnchor(void) throw( uno::Runtim const SwFmtAnchor& rAnchor = pFmt->GetAnchor(); // return an anchor for non-page bound frames // and for page bound frames that have a page no == NULL and a content position - if( rAnchor.GetAnchorId() != FLY_PAGE || + if ((rAnchor.GetAnchorId() != FLY_AT_PAGE) || (rAnchor.GetCntntAnchor() && !rAnchor.GetPageNum())) { const SwPosition &rPos = *(rAnchor.GetCntntAnchor()); @@ -2128,7 +2127,7 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan } const SfxPoolItem* pItem; - RndStdIds eAnchorId = FLY_AT_CNTNT; + RndStdIds eAnchorId = FLY_AT_PARA; if(SFX_ITEM_SET == aFrmSet.GetItemState(RES_ANCHOR, sal_False, &pItem) ) { eAnchorId = ((const SwFmtAnchor*)pItem)->GetAnchorId(); @@ -2136,10 +2135,10 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan !aPam.GetNode()->FindFlyStartNode()) { //rahmengebunden geht nur dort, wo ein Rahmen ist! - SwFmtAnchor aAnchor(FLY_AT_CNTNT); + SwFmtAnchor aAnchor(FLY_AT_PARA); aFrmSet.Put(aAnchor); } - else if( FLY_PAGE == eAnchorId && + else if ((FLY_AT_PAGE == eAnchorId) && 0 == ((const SwFmtAnchor*)pItem)->GetPageNum() ) { SwFmtAnchor aAnchor( *((const SwFmtAnchor*)pItem) ); @@ -2162,10 +2161,10 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan SwFmtAnchor* pAnchorItem = 0; // the frame is inserted bound to page // to prevent conflicts if the to-be-anchored position is part of the to-be-copied text - if(eAnchorId != FLY_PAGE) + if (eAnchorId != FLY_AT_PAGE) { pAnchorItem = static_cast(aFrmSet.Get(RES_ANCHOR).Clone()); - aFrmSet.Put( SwFmtAnchor( FLY_PAGE, 1 )); + aFrmSet.Put( SwFmtAnchor( FLY_AT_PAGE, 1 )); } pFmt = pDoc->MakeFlyAndMove( *m_pCopySource, aFrmSet, @@ -2183,8 +2182,10 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan DELETEZ( m_pCopySource ); } else - pFmt = pDoc->MakeFlySection( FLY_AT_CNTNT, aPam.GetPoint(), + { + pFmt = pDoc->MakeFlySection( FLY_AT_PARA, aPam.GetPoint(), &aFrmSet, pParentFrmFmt ); + } if(pFmt) { pFmt->Add(this); diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index 0d606ab2f50d..26a237b5625a 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -163,7 +163,8 @@ void CollectFrameAtNode( SwClient& rClnt, const SwNodeIndex& rIdx, // gebunden sind SwDoc* pDoc = rIdx.GetNode().GetDoc(); - USHORT nChkType = static_cast< USHORT >(_bAtCharAnchoredObjs ? FLY_AUTO_CNTNT : FLY_AT_CNTNT); + USHORT nChkType = static_cast< USHORT >((_bAtCharAnchoredObjs) + ? FLY_AT_CHAR : FLY_AT_PARA); const SwCntntFrm* pCFrm; const SwCntntNode* pCNd; if( pDoc->GetRootFrm() && diff --git a/sw/source/core/view/vdraw.cxx b/sw/source/core/view/vdraw.cxx index 7429eb5c444d..2e25913611a8 100644 --- a/sw/source/core/view/vdraw.cxx +++ b/sw/source/core/view/vdraw.cxx @@ -46,10 +46,8 @@ #include #ifndef PRODUCT -#ifndef _SVX_FMGLOB_HXX #include #endif -#endif #include "fesh.hxx" #include "pagefrm.hxx" @@ -62,9 +60,8 @@ #include "flyfrm.hxx" #include -#ifndef IDOCUMENTDRAWMODELACCESS_HXX_INCLUDED #include -#endif + /************************************************************************* |* @@ -337,8 +334,10 @@ void SwViewImp::NotifySizeChg( const Size &rNewSz ) const SwFrm *pAnchor = ((SwDrawContact*)pCont)->GetAnchorFrm(); if ( !pAnchor || pAnchor->IsInFly() || !pAnchor->IsValid() || !pAnchor->GetUpper() || !pAnchor->FindPageFrm() || - FLY_IN_CNTNT == pCont->GetFmt()->GetAnchor().GetAnchorId() ) + (FLY_AS_CHAR == pCont->GetFmt()->GetAnchor().GetAnchorId()) ) + { continue; + } // OD 19.06.2003 #108784# - no move for drawing objects in header/footer if ( pAnchor->FindFooterOrHeader() ) diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx index e21433271845..4d849174ddba 100644 --- a/sw/source/filter/basflt/shellio.cxx +++ b/sw/source/filter/basflt/shellio.cxx @@ -34,9 +34,7 @@ #include #include #include -#ifndef SVTOOLS_FSTATHELPER_HXX #include -#endif #include #include #include @@ -60,9 +58,7 @@ #include #include #include -#ifndef _DOCSH_HXX #include -#endif #include #include @@ -72,6 +68,7 @@ #include // <-- + using namespace ::com::sun::star; ////////////////////////////////////////////////////////////////////////// @@ -241,9 +238,9 @@ ULONG SwReader::Read( const Reader& rOptions ) { SwPosition const*const pFrameAnchor( rAnchor.GetCntntAnchor()); - if ( (FLY_PAGE == rAnchor.GetAnchorId()) + if ( (FLY_AT_PAGE == rAnchor.GetAnchorId()) || ( pFrameAnchor - && ( ( (FLY_AT_CNTNT == rAnchor.GetAnchorId()) + && ( ( (FLY_AT_PARA == rAnchor.GetAnchorId()) && ( (pUndoPam->GetPoint()->nNode == pFrameAnchor->nNode) || (pUndoPam->GetMark()->nNode == @@ -251,7 +248,7 @@ ULONG SwReader::Read( const Reader& rOptions ) ) ) // #i97570# also check frames anchored AT char - || ( (FLY_AUTO_CNTNT == rAnchor.GetAnchorId()) + || ( (FLY_AT_CHAR == rAnchor.GetAnchorId()) && !IsDestroyFrameAnchoredAtChar( *pFrameAnchor, *pUndoPam->GetPoint(), @@ -262,7 +259,7 @@ ULONG SwReader::Read( const Reader& rOptions ) ) { if( bChkHeaderFooter && - FLY_AT_CNTNT == rAnchor.GetAnchorId() && + (FLY_AT_PARA == rAnchor.GetAnchorId()) && RES_DRAWFRMFMT == pFrmFmt->Which() ) { // DrawObjecte in Kopf-/Fusszeilen ist nicht @@ -286,15 +283,19 @@ ULONG SwReader::Read( const Reader& rOptions ) pFrmFmt->DelFrms(); } - if( FLY_PAGE == rAnchor.GetAnchorId() ) + if (FLY_AT_PAGE == rAnchor.GetAnchorId()) { if( !rAnchor.GetCntntAnchor() ) + { pFrmFmt->MakeFrms(); + } else if( pCrsr ) + { // seitengebundene Flys eingefuegt, dann schalte // die Optimierungs-Flags vom SwDoc ab. Sonst // werden die Flys nicht an der Position erzeugt. pDoc->SetLoaded( FALSE ); + } } else pFrmFmt->MakeFrms(); diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index 01108a0d2567..33c354fbfebe 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -35,9 +35,7 @@ #include "hintids.hxx" #include -#ifndef _WRKWIN_HXX //autogen #include -#endif #include #include #include @@ -2130,8 +2128,8 @@ void SwHTMLWriter::OutCSS1_FrmFmtOptions( const SwFrmFmt& rFrmFmt, const SwFmtAnchor& rAnchor = rFrmFmt.GetAnchor(); switch( rAnchor.GetAnchorId() ) { - case FLY_AT_CNTNT: - case FLY_AUTO_CNTNT: + case FLY_AT_PARA: + case FLY_AT_CHAR: if( text::RelOrientation::FRAME == rHoriOri.GetRelationOrient() || text::RelOrientation::PRINT_AREA == rHoriOri.GetRelationOrient() ) { @@ -2146,7 +2144,7 @@ void SwHTMLWriter::OutCSS1_FrmFmtOptions( const SwFrmFmt& rFrmFmt, break; } - case FLY_PAGE: + case FLY_AT_PAGE: case FLY_AT_FLY: { // position @@ -2375,7 +2373,7 @@ void SwHTMLWriter::OutCSS1_FrmFmtBackground( const SwFrmFmt& rFrmFmt ) const SwFmtAnchor& rAnchor = rFrmFmt.GetAnchor(); RndStdIds eAnchorId = rAnchor.GetAnchorId(); const SwPosition *pAnchorPos = rAnchor.GetCntntAnchor(); - if( FLY_PAGE != eAnchorId && pAnchorPos ) + if (FLY_AT_PAGE != eAnchorId && pAnchorPos) { const SwNode& rNode = pAnchorPos->nNode.GetNode(); if( rNode.IsCntntNode() ) diff --git a/sw/source/filter/html/htmlcss1.cxx b/sw/source/filter/html/htmlcss1.cxx index 7fb4fd8502af..89af81314b99 100644 --- a/sw/source/filter/html/htmlcss1.cxx +++ b/sw/source/filter/html/htmlcss1.cxx @@ -39,17 +39,12 @@ #include #include #include -#ifndef _APP_HXX //autogen #include -#endif #include #include #include #include -#ifndef _SVX_BOXITEM_HXX //autogen - #include -#endif #include #include #include @@ -2094,7 +2089,7 @@ void SwHTMLParser::SetAnchorAndAdjustment( const SfxItemSet & /*rItemSet*/, } else { - aAnchor.SetType( FLY_PAGE ); + aAnchor.SetType( FLY_AT_PAGE ); aAnchor.SetPageNum( 1 ); } nHoriPos = rPropInfo.nLeft; @@ -2102,7 +2097,7 @@ void SwHTMLParser::SetAnchorAndAdjustment( const SfxItemSet & /*rItemSet*/, } else { - aAnchor.SetType( FLY_AT_CNTNT ); + aAnchor.SetType( FLY_AT_PARA ); aAnchor.SetAnchor( pPam->GetPoint() ); eVertOri = text::VertOrientation::TOP; eVertRel = text::RelOrientation::CHAR; @@ -2128,14 +2123,14 @@ void SwHTMLParser::SetAnchorAndAdjustment( const SfxItemSet & /*rItemSet*/, xub_StrLen nCntnt = pPam->GetPoint()->nContent.GetIndex(); if( nCntnt ) { - aAnchor.SetType( FLY_AUTO_CNTNT ); + aAnchor.SetType( FLY_AT_CHAR ); pPam->Move( fnMoveBackward ); eVertOri = text::VertOrientation::CHAR_BOTTOM; eVertRel = text::RelOrientation::CHAR; } else { - aAnchor.SetType( FLY_AT_CNTNT ); + aAnchor.SetType( FLY_AT_PARA ); eVertOri = text::VertOrientation::TOP; eVertRel = text::RelOrientation::PRINT_AREA; } diff --git a/sw/source/filter/html/htmldraw.cxx b/sw/source/filter/html/htmldraw.cxx index 328eb21be526..e3b3af0029a7 100644 --- a/sw/source/filter/html/htmldraw.cxx +++ b/sw/source/filter/html/htmldraw.cxx @@ -34,9 +34,7 @@ #include "hintids.hxx" #include -#ifndef _WRKWIN_HXX //autogen #include -#endif #include #include #include @@ -182,7 +180,7 @@ void SwHTMLParser::InsertDrawObject( SdrObject* pNewDrawObj, aFrmSet.Put( aULItem ); } - SwFmtAnchor aAnchor( FLY_IN_CNTNT ); + SwFmtAnchor aAnchor( FLY_AS_CHAR ); if( SVX_CSS1_POS_ABSOLUTE == rCSS1PropInfo.ePosition && SVX_CSS1_LTYPE_TWIP == rCSS1PropInfo.eLeftType && SVX_CSS1_LTYPE_TWIP == rCSS1PropInfo.eTopType ) @@ -198,7 +196,7 @@ void SwHTMLParser::InsertDrawObject( SdrObject* pNewDrawObj, } else { - aAnchor.SetType( FLY_PAGE ); + aAnchor.SetType( FLY_AT_PAGE ); } // OD 2004-04-13 #i26791# - direct positioning for pNewDrawObj->SetRelativePos( Point(rCSS1PropInfo.nLeft + nLeftSpace, @@ -208,7 +206,7 @@ void SwHTMLParser::InsertDrawObject( SdrObject* pNewDrawObj, else if( SVX_ADJUST_LEFT == rCSS1PropInfo.eFloat || text::HoriOrientation::LEFT == eHoriOri ) { - aAnchor.SetType( FLY_AT_CNTNT ); + aAnchor.SetType( FLY_AT_PARA ); aFrmSet.Put( SwFmtSurround(bHidden ? SURROUND_THROUGHT : SURROUND_RIGHT) ); // OD 2004-04-13 #i26791# - direct positioning for @@ -219,10 +217,14 @@ void SwHTMLParser::InsertDrawObject( SdrObject* pNewDrawObj, aFrmSet.Put( SwFmtVertOrient( 0, eVertOri ) ); } - if( FLY_PAGE == aAnchor.GetAnchorId() ) + if (FLY_AT_PAGE == aAnchor.GetAnchorId()) + { aAnchor.SetPageNum( 1 ); + } else if( FLY_AT_FLY != aAnchor.GetAnchorId() ) + { aAnchor.SetAnchor( pPam->GetPoint() ); + } aFrmSet.Put( aAnchor ); pDoc->Insert( *pPam, *pNewDrawObj, &aFrmSet, NULL ); diff --git a/sw/source/filter/html/htmlfly.cxx b/sw/source/filter/html/htmlfly.cxx index 92f9e1adb3d5..acbcb8eb0c25 100644 --- a/sw/source/filter/html/htmlfly.cxx +++ b/sw/source/filter/html/htmlfly.cxx @@ -39,12 +39,8 @@ #include "hintids.hxx" #include #include -#ifndef _APP_HXX #include -#endif -#ifndef _WRKWIN_HXX //autogen #include -#endif #include #include #include @@ -338,12 +334,12 @@ void SwHTMLWriter::CollectFlyFrms() sal_Int16 eHoriRel = rFrmFmt.GetHoriOrient().GetRelationOrient(); switch( rAnchor.GetAnchorId() ) { - case FLY_PAGE: + case FLY_AT_PAGE: case FLY_AT_FLY: nMode = aHTMLOutFrmPageFlyTable[eType][nExportMode]; break; - case FLY_AT_CNTNT: + case FLY_AT_PARA: // Absatz-gebundene Rahmen werden nur dann vor den // Absatz geschrieben, wenn der Absatz einen Abstand // hat. @@ -362,7 +358,7 @@ void SwHTMLWriter::CollectFlyFrms() nMode = aHTMLOutFrmParaPrtAreaTable[eType][nExportMode]; break; - case FLY_AUTO_CNTNT: + case FLY_AT_CHAR: if( text::RelOrientation::FRAME == eHoriRel || text::RelOrientation::PRINT_AREA == eHoriRel ) nMode = aHTMLOutFrmParaPrtAreaTable[eType][nExportMode]; else @@ -594,7 +590,7 @@ void SwHTMLWriter::OutFrmFmtOptions( const SwFrmFmt &rFrmFmt, const sal_Char *pStr = 0; RndStdIds eAnchorId = rFrmFmt.GetAnchor().GetAnchorId(); if( (nFrmOpts & HTML_FRMOPT_ALIGN) && - (FLY_AT_CNTNT == eAnchorId || FLY_AUTO_CNTNT == eAnchorId) ) + ((FLY_AT_PARA == eAnchorId) || (FLY_AT_CHAR == eAnchorId)) ) { // MIB 12.3.98: Ist es nicht schlauer, absatzgebundene // Rahmen notfalls links auszurichten als sie @@ -611,7 +607,7 @@ void SwHTMLWriter::OutFrmFmtOptions( const SwFrmFmt &rFrmFmt, } if( (nFrmOpts & HTML_FRMOPT_ALIGN) && !pStr && ( (nFrmOpts & HTML_FRMOPT_S_ALIGN) == 0 || - FLY_IN_CNTNT == eAnchorId ) && + (FLY_AS_CHAR == eAnchorId) ) && SFX_ITEM_SET == rItemSet.GetItemState( RES_VERT_ORIENT, TRUE, &pItem )) { switch( ((SwFmtVertOrient*)pItem)->GetVertOrient() ) @@ -764,8 +760,8 @@ void SwHTMLWriter::OutFrmFmtOptions( const SwFrmFmt &rFrmFmt, // Umlauf fuer absatzgeb. Grafiken als
in den String // schreiben if( (nFrmOpts & HTML_FRMOPT_BRCLEAR) && - (FLY_AT_CNTNT== rFrmFmt.GetAnchor().GetAnchorId() || - FLY_AUTO_CNTNT== rFrmFmt.GetAnchor().GetAnchorId()) && + ((FLY_AT_PARA == rFrmFmt.GetAnchor().GetAnchorId()) || + (FLY_AT_CHAR == rFrmFmt.GetAnchor().GetAnchorId())) && SFX_ITEM_SET == rItemSet.GetItemState( RES_SURROUND, TRUE, &pItem )) { const SwFmtSurround* pSurround = (const SwFmtSurround*)pItem; @@ -1893,7 +1889,7 @@ SwHTMLPosFlyFrm::SwHTMLPosFlyFrm( const SwPosFlyFrm& rPosFly, nOutputMode( nOutMode ) { const SwFmtAnchor& rAnchor = rPosFly.GetFmt().GetAnchor(); - if( FLY_AUTO_CNTNT==rAnchor.GetAnchorId() && + if ((FLY_AT_CHAR == rAnchor.GetAnchorId()) && HTML_POS_INSIDE == GetOutPos() ) { // Auto-gebundene Rahmen werden ein Zeichen weiter hinten diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx index 147e736a4353..575cbc4c719e 100644 --- a/sw/source/filter/html/htmlforw.cxx +++ b/sw/source/filter/html/htmlforw.cxx @@ -45,18 +45,14 @@ #include #include #include -#ifndef _WRKWIN_HXX //autogen #include -#endif #include #include #include #include #include #include "svtools/urihelper.hxx" -#ifndef _TOOLKIT_UNOHLP_HXX #include -#endif #include #include #include @@ -81,6 +77,7 @@ #include "htmlfly.hxx" #include "htmlform.hxx" + using namespace ::com::sun::star; using ::rtl::OUString; /* */ @@ -1427,7 +1424,7 @@ void SwHTMLWriter::GetControls() const SwFmtAnchor& rAnchor = pFrmFmt->GetAnchor(); const SwPosition *pPos = rAnchor.GetCntntAnchor(); - if( FLY_IN_CNTNT != rAnchor.GetAnchorId() || !pPos ) + if ((FLY_AS_CHAR != rAnchor.GetAnchorId()) || !pPos) continue; const SdrObject *pSdrObj = diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx index d18a2b762aa0..eaf43495fe1e 100644 --- a/sw/source/filter/html/htmlgrin.cxx +++ b/sw/source/filter/html/htmlgrin.cxx @@ -33,9 +33,7 @@ #include "hintids.hxx" #include -#ifndef _WRKWIN_HXX //autogen #include -#endif #include #include #include @@ -208,7 +206,7 @@ void SwHTMLParser::SetAnchorAndAdjustment( sal_Int16 eVertOri, BOOL bDontAppend ) { BOOL bMoveBackward = FALSE; - SwFmtAnchor aAnchor( FLY_IN_CNTNT ); + SwFmtAnchor aAnchor( FLY_AS_CHAR ); sal_Int16 eVertRel = text::RelOrientation::FRAME; if( text::HoriOrientation::NONE != eHoriOri ) @@ -267,14 +265,14 @@ void SwHTMLParser::SetAnchorAndAdjustment( sal_Int16 eVertOri, xub_StrLen nCntnt = pPam->GetPoint()->nContent.GetIndex(); if( nCntnt ) { - aAnchor.SetType( FLY_AUTO_CNTNT ); + aAnchor.SetType( FLY_AT_CHAR ); bMoveBackward = TRUE; eVertOri = text::VertOrientation::CHAR_BOTTOM; eVertRel = text::RelOrientation::CHAR; } else { - aAnchor.SetType( FLY_AT_CNTNT ); + aAnchor.SetType( FLY_AT_PARA ); eVertOri = text::VertOrientation::TOP; eVertRel = text::RelOrientation::PRINT_AREA; } @@ -301,7 +299,7 @@ void SwHTMLParser::RegisterFlyFrm( SwFrmFmt *pFlyFmt ) // automatisch verankerte Rahmen muessen noch um eine Position // nach vorne verschoben werden. if( RES_DRAWFRMFMT != pFlyFmt->Which() && - FLY_AT_CNTNT == pFlyFmt->GetAnchor().GetAnchorId() && + (FLY_AT_PARA == pFlyFmt->GetAnchor().GetAnchorId()) && SURROUND_THROUGHT == pFlyFmt->GetSurround().GetSurround() ) { aMoveFlyFrms.Insert( pFlyFmt, aMoveFlyFrms.Count() ); @@ -778,7 +776,7 @@ IMAGE_SETEVENT: aMacroItem.SetMacro( aEvents[ n ], *pMacro ); } - if( FLY_IN_CNTNT == pFlyFmt->GetAnchor().GetAnchorId() && + if ((FLY_AS_CHAR == pFlyFmt->GetAnchor().GetAnchorId()) && aAttrTab.pINetFmt->GetSttPara() == pPam->GetPoint()->nNode && aAttrTab.pINetFmt->GetSttCnt() == @@ -1342,20 +1340,16 @@ void SwHTMLParser::StripTrailingPara() { ULONG nNodeIdx = pPam->GetPoint()->nNode.GetIndex(); - USHORT i; - - const SwFrmFmt* pFmt; - const SwFmtAnchor* pAnchor; - const SwPosition* pAPos; const SwSpzFrmFmts& rFrmFmtTbl = *pDoc->GetSpzFrmFmts(); - for( i=0; iGetAnchor(); - if( 0 != ( pAPos = pAnchor->GetCntntAnchor()) && - (FLY_AT_CNTNT == pAnchor->GetAnchorId() || - FLY_AUTO_CNTNT == pAnchor->GetAnchorId()) && + SwFrmFmt const*const pFmt = rFrmFmtTbl[i]; + SwFmtAnchor const*const pAnchor = &pFmt->GetAnchor(); + SwPosition const*const pAPos = pAnchor->GetCntntAnchor(); + if (pAPos && + ((FLY_AT_PARA == pAnchor->GetAnchorId()) || + (FLY_AT_CHAR == pAnchor->GetAnchorId())) && pAPos->nNode == nNodeIdx ) return; // den Knoten duerfen wir nicht loeschen diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx index 21e409c48530..a003678013da 100644 --- a/sw/source/filter/html/htmlplug.cxx +++ b/sw/source/filter/html/htmlplug.cxx @@ -33,8 +33,6 @@ #include #include - - #include "hintids.hxx" #include #define _SVSTDARR_ULONGS @@ -42,9 +40,7 @@ #include #include #include -#ifndef _WRKWIN_HXX //autogen #include -#endif #include #include #include @@ -465,7 +461,7 @@ void SwHTMLParser::InsertEmbed() } else { - SwFmtAnchor aAnchor( FLY_AT_CNTNT ); + SwFmtAnchor aAnchor( FLY_AT_PARA ); aAnchor.SetAnchor( pPam->GetPoint() ); aFrmSet.Put( aAnchor ); aFrmSet.Put( SwFmtHoriOrient( 0, text::HoriOrientation::LEFT, text::RelOrientation::FRAME) ); @@ -1167,7 +1163,7 @@ Writer& OutHTML_FrmFmtOLENode( Writer& rWrt, const SwFrmFmt& rFrmFmt, sOut = '\"'; } - if( FLY_AT_CNTNT == rFrmFmt.GetAnchor().GetAnchorId() && + if ((FLY_AT_PARA == rFrmFmt.GetAnchor().GetAnchorId()) && SURROUND_THROUGHT == rFrmFmt.GetSurround().GetSurround() ) { // Das Plugin ist HIDDEN diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index 551ebf937be2..9f13486da684 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -2837,7 +2837,7 @@ void SwHTMLParser::_SetAttr( BOOL bChkEnd, BOOL bBeforeTable, SwFrmFmt *pFrmFmt = aMoveFlyFrms[ --n ]; const SwFmtAnchor& rAnchor = pFrmFmt->GetAnchor(); - ASSERT( FLY_AT_CNTNT==rAnchor.GetAnchorId(), + ASSERT( FLY_AT_PARA == rAnchor.GetAnchorId(), "Nur Auto-Rahmen brauchen eine Spezialbehandlung" ); const SwPosition *pFlyPos = rAnchor.GetCntntAnchor(); ULONG nFlyParaIdx = pFlyPos->nNode.GetIndex(); @@ -2862,7 +2862,7 @@ void SwHTMLParser::_SetAttr( BOOL bChkEnd, BOOL bBeforeTable, pAttrPam->GetPoint()->nContent.Assign( pAttrPam->GetCntntNode(), aMoveFlyCnts[n] ); SwFmtAnchor aAnchor( rAnchor ); - aAnchor.SetType( FLY_AUTO_CNTNT ); + aAnchor.SetType( FLY_AT_CHAR ); aAnchor.SetAnchor( pAttrPam->GetPoint() ); pFrmFmt->SetFmtAttr( aAnchor ); @@ -4411,27 +4411,23 @@ BOOL SwHTMLParser::HasCurrentParaFlys( BOOL bNoSurroundOnly, // sonst: Der Absatz enthaelt irgendeinen Rahmen SwNodeIndex& rNodeIdx = pPam->GetPoint()->nNode; - SwFrmFmt* pFmt; - const SwFmtAnchor* pAnchor; - const SwPosition* pAPos; const SwSpzFrmFmts& rFrmFmtTbl = *pDoc->GetSpzFrmFmts(); - USHORT i; BOOL bFound = FALSE; - for( i=0; iGetAnchor(); + SwFrmFmt *const pFmt = rFrmFmtTbl[i]; + SwFmtAnchor const*const pAnchor = &pFmt->GetAnchor(); // Ein Rahmen wurde gefunden, wenn // - er absatzgebunden ist, und // - im aktuellen Absatz verankert ist, und // - jeder absatzgebunene Rahmen zaehlt, oder // - (nur Rahmen oder umlauf zaehlen und ) der Rahmen keinen // Umlauf besitzt - - if( 0 != ( pAPos = pAnchor->GetCntntAnchor()) && - (FLY_AT_CNTNT == pAnchor->GetAnchorId() || - FLY_AUTO_CNTNT == pAnchor->GetAnchorId()) && + SwPosition const*const pAPos = pAnchor->GetCntntAnchor(); + if (pAPos && + ((FLY_AT_PARA == pAnchor->GetAnchorId()) || + (FLY_AT_CHAR == pAnchor->GetAnchorId())) && pAPos->nNode == rNodeIdx ) { if( !(bNoSurroundOnly || bSurroundOnly) ) @@ -5073,18 +5069,16 @@ void SwHTMLParser::InsertLineBreak() SwTxtNode* pTxtNd = rNodeIdx.GetNode().GetTxtNode(); if( pTxtNd ) { - SwFrmFmt* pFmt; - const SwFmtAnchor* pAnchor; - const SwPosition* pAPos; const SwSpzFrmFmts& rFrmFmtTbl = *pDoc->GetSpzFrmFmts(); for( USHORT i=0; iGetAnchor(); - if( 0 != ( pAPos = pAnchor->GetCntntAnchor()) && - (FLY_AT_CNTNT == pAnchor->GetAnchorId() || - FLY_AUTO_CNTNT == pAnchor->GetAnchorId()) && + SwFrmFmt *const pFmt = rFrmFmtTbl[i]; + SwFmtAnchor const*const pAnchor = &pFmt->GetAnchor(); + SwPosition const*const pAPos = pAnchor->GetCntntAnchor(); + if (pAPos && + ((FLY_AT_PARA == pAnchor->GetAnchorId()) || + (FLY_AT_CHAR == pAnchor->GetAnchorId())) && pAPos->nNode == rNodeIdx && pFmt->GetSurround().GetSurround() != SURROUND_NONE ) { diff --git a/sw/source/filter/inc/fltshell.hxx b/sw/source/filter/inc/fltshell.hxx index ec836f2b8549..036933bd4a67 100644 --- a/sw/source/filter/inc/fltshell.hxx +++ b/sw/source/filter/inc/fltshell.hxx @@ -36,9 +36,7 @@ #include #include #include -#ifndef _KEYCOD_HXX //autogen #include -#endif #include #include #include @@ -556,7 +554,7 @@ public: pOut->EndTable(); } // methoden zur verwaltung von Flys BOOL IsInFly() { return pOut->IsInFly(); } - BOOL BeginFly( RndStdIds eAnchor = FLY_AT_CNTNT, BOOL bAbsolutePos = FALSE ); + BOOL BeginFly( RndStdIds eAnchor = FLY_AT_PARA, BOOL bAbsolutePos = FALSE ); void SetFlyAnchor( RndStdIds eAnchor ) { pOut->SetFlyAnchor( eAnchor ); } void SetFlyXPos( short nXPos, sal_Int16 eHRel = com::sun::star::text::RelOrientation::FRAME, diff --git a/sw/source/filter/rtf/rtfatr.cxx b/sw/source/filter/rtf/rtfatr.cxx index fc60c857aedb..1f2e60f7c87d 100644 --- a/sw/source/filter/rtf/rtfatr.cxx +++ b/sw/source/filter/rtf/rtfatr.cxx @@ -38,9 +38,7 @@ */ #include -#ifndef _COM_SUN_STAR_I18N_SCRIPTTYPE_HDL_ #include -#endif #include #include #include @@ -50,9 +48,7 @@ #include #include #include -#ifndef _SVX_TSTPITEM_HXX //autogen #include -#endif #include #include #include @@ -72,16 +68,12 @@ #include #include #include -#ifndef _SVX_CNTRITEM_HXX //autogen #include -#endif #include #include #include #include -#ifndef _SVX_EMPHITEM_HXX #include -#endif #include #include #include @@ -127,9 +119,7 @@ #include #include // fuer SwPageDesc ... #include // fuer SwPageDesc ... -#ifndef _DOCSH_HXX #include -#endif #include #include #include @@ -3592,7 +3582,7 @@ static Writer& OutRTF_SwFmtVertOrient ( Writer& rWrt, const SfxPoolItem& rHt ) const char* pOrient; RndStdIds eAnchor = rRTFWrt.pFlyFmt->GetAnchor().GetAnchorId(); sal_Int16 eOrient = rFlyVert.GetRelationOrient(); - if( FLY_PAGE == eAnchor ) + if (FLY_AT_PAGE == eAnchor) { if( text::RelOrientation::PAGE_FRAME == eOrient || text::RelOrientation::FRAME == eOrient ) pOrient = OOO_STRING_SVTOOLS_RTF_PVPG; @@ -3648,7 +3638,7 @@ static Writer& OutRTF_SwFmtHoriOrient( Writer& rWrt, const SfxPoolItem& rHt ) const char* pS; RndStdIds eAnchor = rRTFWrt.pFlyFmt->GetAnchor().GetAnchorId(); sal_Int16 eOrient = rFlyHori.GetRelationOrient(); - if( FLY_PAGE == eAnchor ) + if (FLY_AT_PAGE == eAnchor) { if( text::RelOrientation::PAGE_FRAME == eOrient || text::RelOrientation::FRAME == eOrient ) pS = OOO_STRING_SVTOOLS_RTF_PHPG; @@ -3702,12 +3692,12 @@ static Writer& OutRTF_SwFmtAnchor( Writer& rWrt, const SfxPoolItem& rHt ) rRTFWrt.bOutFmtAttr = TRUE; switch( nId ) { - case FLY_PAGE: + case FLY_AT_PAGE: rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_FLYPAGE; rWrt.OutULong( rAnchor.GetPageNum() ); break; - case FLY_AT_CNTNT: - case FLY_IN_CNTNT: + case FLY_AT_PARA: + case FLY_AS_CHAR: rWrt.Strm() << OOO_STRING_SVTOOLS_RTF_FLYCNTNT; break; } diff --git a/sw/source/filter/rtf/rtffly.cxx b/sw/source/filter/rtf/rtffly.cxx index e4043f2e8529..0bfdaa0b206b 100644 --- a/sw/source/filter/rtf/rtffly.cxx +++ b/sw/source/filter/rtf/rtffly.cxx @@ -64,15 +64,9 @@ #include #include #include -#ifndef __SGI_STL_DEQUE #include -#endif -#ifndef __SGI_STL_MAP #include -#endif -#ifndef __SGI_STL_UTILITY #include -#endif // --> OD 2004-06-30 #i27767# #include // <-- @@ -82,6 +76,7 @@ #include "dcontact.hxx" // <-- + using namespace ::com::sun::star; #define ANCHOR(p) ((SwFmtAnchor*)p) @@ -459,7 +454,7 @@ void SwRTFParser::SetFlysInDoc() SwFlyFrmFmt* pFmt = pDoc->MakeFlyFrmFmt( aEmptyStr, pParent ); pFmt->SetFmtAttr( pFlySave->aFlySet ); const SwFmtAnchor& rAnchor = pFmt->GetAnchor(); - if( FLY_IN_CNTNT != rAnchor.GetAnchorId() ) + if (FLY_AS_CHAR != rAnchor.GetAnchorId()) { // korrigiere noch den Absatz, ist immer der vorhergehende ! // JP 20.09.95: wenn es diesen gibt! (DocAnfang!) @@ -568,7 +563,7 @@ void SwRTFParser::ReadFly( int nToken, SfxItemSet* pSet ) // RTF-Defaults setzen: // --> OD 2004-06-24 #i27767# - SwFmtAnchor aAnchor( FLY_AT_CNTNT ); + SwFmtAnchor aAnchor( FLY_AT_PARA ); SwFmtHoriOrient aHori( 0, text::HoriOrientation::LEFT, text::RelOrientation::FRAME ); SwFmtVertOrient aVert( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME ); @@ -844,7 +839,7 @@ void SwRTFParser::ReadFly( int nToken, SfxItemSet* pSet ) switch( GetNextToken() ) { case RTF_FLY_PAGE: - aAnchor.SetType( FLY_PAGE ); + aAnchor.SetType( FLY_AT_PAGE ); aAnchor.SetPageNum( USHORT(nTokenValue)); aAnchor.SetAnchor( 0 ); break; @@ -854,7 +849,7 @@ void SwRTFParser::ReadFly( int nToken, SfxItemSet* pSet ) SwNodeIndex aIdx( pPam->GetPoint()->nNode ); pDoc->GetNodes().GoPrevious( &aIdx ); SwPosition aPos( aIdx ); - aAnchor.SetType( FLY_AT_CNTNT ); + aAnchor.SetType( FLY_AT_PARA ); aAnchor.SetAnchor( &aPos ); } break; @@ -1288,7 +1283,7 @@ void SwRTFParser::InsPicture( const String& rGrfNm, const Graphic* pGrf, RES_VERT_ORIENT,*/ RES_ANCHOR ); const SwPosition* pPos = pPam->GetPoint(); - SwFmtAnchor aAnchor( FLY_IN_CNTNT ); + SwFmtAnchor aAnchor( FLY_AS_CHAR ); aAnchor.SetAnchor( pPos ); aFlySet.Put( aAnchor ); aFlySet.Put( SwFmtVertOrient( 0, text::VertOrientation::TOP )); diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx index 9b5b90a01641..c23cdb521491 100644 --- a/sw/source/filter/rtf/swparrtf.cxx +++ b/sw/source/filter/rtf/swparrtf.cxx @@ -35,18 +35,14 @@ #include -#ifndef __RSC //autogen #include -#endif #include #include #include #include #include #include -#ifndef _SVX_TSTPITEM_HXX //autogen #include -#endif #include #include #include @@ -82,18 +78,14 @@ #include #include #include -#ifndef _SECTIOM_HXX #include -#endif #include #include #include #include #include #include -#ifndef _CMDID_H #include -#endif #ifndef _STATSTR_HRC #include // ResId fuer Statusleiste #endif @@ -471,8 +463,8 @@ if( pSttNdIdx->GetIndex()+1 == pPam->GetBound( FALSE ).nNode.GetIndex() ) for ( USHORT nI = pFrmFmts->Count(); nI; --nI ) { const SwFmtAnchor & rAnchor = (*pFrmFmts)[ nI - 1 ]->GetAnchor(); - if ( FLY_AT_CNTNT == rAnchor.GetAnchorId() || - FLY_AUTO_CNTNT == rAnchor.GetAnchorId() ) + if ((FLY_AT_PARA == rAnchor.GetAnchorId()) || + (FLY_AT_CHAR == rAnchor.GetAnchorId())) { const SwPosition * pObjPos = rAnchor.GetCntntAnchor(); if ( pObjPos && nNodeIdx == pObjPos->nNode.GetIndex() ) @@ -1270,14 +1262,7 @@ void SwRTFParser::ReadDrawingObject() sw::util::SetLayer aSetLayer(*pDoc); aSetLayer.SendObjectToHeaven(*pStroke); */ - /* - FLY_AT_CNTNT, //Absatzgebundener Rahmen - FLY_IN_CNTNT, //Zeichengebundener Rahmen - FLY_PAGE, //Seitengebundener Rahmen - FLY_AT_FLY, //Rahmengebundener Rahmen ( LAYER_IMPL ) - FLY_AUTO_CNTNT, //Automatisch positionierter, absatzgebundener Rahmen - */ - SwFmtAnchor aAnchor( FLY_AT_CNTNT ); + SwFmtAnchor aAnchor( FLY_AT_PARA ); aAnchor.SetAnchor( pPam->GetPoint() ); aFlySet.Put( aAnchor ); @@ -1343,7 +1328,7 @@ void SwRTFParser::InsertShpObject(SdrObject* pStroke, int _nZOrder) SwFmtFollowTextFlow aFollowTextFlow( FALSE ); aFlySet.Put( aFollowTextFlow ); - SwFmtAnchor aAnchor( FLY_AT_CNTNT ); + SwFmtAnchor aAnchor( FLY_AT_PARA ); aAnchor.SetAnchor( pPam->GetPoint() ); aFlySet.Put( aAnchor ); @@ -3710,8 +3695,9 @@ void SwRTFParser::ReadHeaderFooter( int nToken, SwPageDesc* pPageDesc ) xub_StrLen nPos = pPam->GetPoint()->nContent.GetIndex(); SfxItemSet aSet( pDoc->GetAttrPool(), RES_FRMATR_BEGIN, RES_FRMATR_END-1 ); - aSet.Put( SwFmtAnchor( FLY_IN_CNTNT )); - pHdFtFmt = pDoc->MakeFlySection( FLY_IN_CNTNT, pPam->GetPoint(), &aSet ); + aSet.Put( SwFmtAnchor( FLY_AS_CHAR )); + pHdFtFmt = pDoc->MakeFlySection( FLY_AS_CHAR, + pPam->GetPoint(), &aSet ); pTxtAttr = pPam->GetNode()->GetTxtNode()->GetTxtAttrForCharAt( nPos, RES_TXTATR_FLYCNT ); diff --git a/sw/source/filter/rtf/wrtrtf.cxx b/sw/source/filter/rtf/wrtrtf.cxx index d0129f29380f..bcfafdd0c28f 100644 --- a/sw/source/filter/rtf/wrtrtf.cxx +++ b/sw/source/filter/rtf/wrtrtf.cxx @@ -46,9 +46,7 @@ #include #include #include -#ifndef _SVX_TSTPITEM_HXX //autogen #include -#endif #include #include #include @@ -85,6 +83,7 @@ #include #include + #if defined(UNX) const sal_Char SwRTFWriter::sNewLine = '\012'; #else @@ -1129,7 +1128,7 @@ bool ExportAsInline(const SwFlyFrmFmt& rFlyFrmFmt) { //if not an inline element (hack in our limitations here as to only //graphics like this!!!! - return rFlyFrmFmt.GetAnchor().GetAnchorId() == FLY_IN_CNTNT; + return rFlyFrmFmt.GetAnchor().GetAnchorId() == FLY_AS_CHAR; } void SwRTFWriter::OutRTFFlyFrms(const SwFlyFrmFmt& rFlyFrmFmt) @@ -1779,7 +1778,7 @@ short SwRTFWriter::TrueFrameDirection(const SwFrmFmt &rFlyFmt) const { pItem = 0; const SwFmtAnchor* pAnchor = &pFlyFmt2->GetAnchor(); - if( FLY_PAGE != pAnchor->GetAnchorId() && + if ((FLY_AT_PAGE != pAnchor->GetAnchorId()) && pAnchor->GetCntntAnchor() ) { pFlyFmt2 = pAnchor->GetCntntAnchor()->nNode. diff --git a/sw/source/filter/ww1/fltshell.cxx b/sw/source/filter/ww1/fltshell.cxx index 822091cec765..fa784f9fb86e 100644 --- a/sw/source/filter/ww1/fltshell.cxx +++ b/sw/source/filter/ww1/fltshell.cxx @@ -35,9 +35,7 @@ #include #include -#ifndef _GRAPH_HXX //autogen #include -#endif #include #include #include @@ -72,13 +70,12 @@ #include // class SwSection #include // class SwSelBoxes #include -#ifndef _DOCSH_HXX #include // class SwDocSh -#endif #include #include #include + #define MAX_FIELDLEN 64000 using namespace com::sun::star; @@ -437,7 +434,7 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos, SwFltStackEntry* // Damit die Frames bei Einfuegen in existierendes Doc // erzeugt werden (erst nach Setzen des Ankers!): if(pDoc->GetRootFrm() - && FLY_AT_CNTNT == pFmt->GetAnchor().GetAnchorId()) + && (FLY_AT_PARA == pFmt->GetAnchor().GetAnchorId())) { pFmt->MakeFrms(); } @@ -1285,7 +1282,7 @@ SwFltOutBase::~SwFltOutBase() } SwFltOutBase::SwFltOutBase(SwDoc& rDocu) - : rDoc(rDocu), eFlyAnchor(FLY_AT_CNTNT), bFlyAbsPos(false) + : rDoc(rDocu), eFlyAnchor(FLY_AT_PARA), bFlyAbsPos(false) { } @@ -1702,8 +1699,8 @@ BOOL SwFltOutBase::BeginFly( RndStdIds eAnchor /*= FLY_AT_CNTNT*/, ASSERT( FALSE, "SetFlyAnchor() ohne Fly" ); return; } - if( eAnchor == FLY_IN_CNTNT ){ - ASSERT( FALSE, "SetFlyAnchor( FLY_IN_CNTNT ) nicht implementiert" ); + if ( eAnchor == FLY_AS_CHAR ){ + ASSERT( FALSE, "SetFlyAnchor( FLY_AS_CHAR ) nicht implementiert" ); return; } SwFmtAnchor& rAnchor = (SwFmtAnchor&)GetFlyFrmAttr( RES_ANCHOR ); diff --git a/sw/source/filter/ww1/w1sprm.cxx b/sw/source/filter/ww1/w1sprm.cxx index 6aac7b226289..3ed4718cd7a8 100644 --- a/sw/source/filter/ww1/w1sprm.cxx +++ b/sw/source/filter/ww1/w1sprm.cxx @@ -31,9 +31,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - - - #include #include @@ -46,10 +43,7 @@ #include #include #include -#ifndef _SVX_TSTPITEM_HXX //autogen #include -#endif - #include #include @@ -595,13 +589,13 @@ void Ww1SingleSprmPpc::Start( sal_Int16 eVRel; // Seite oder Seitenrand switch ( ( nPpc & 0x30 ) >> 4 ){ // Y - Bindung bestimmt Sw-Bindung - case 0: eAnchor = FLY_AT_CNTNT; // Vert Margin + case 0: eAnchor = FLY_AT_PARA; // Vert Margin eVRel = text::RelOrientation::PRINT_AREA; // if( nYPos < 0 ) // nYPos = 0; // koennen wir nicht break; /* case 1:*/ // Vert. Seite - default:eAnchor = FLY_PAGE; // Vert Page oder unknown + default:eAnchor = FLY_AT_PAGE; // Vert Page oder unknown eVRel = text::RelOrientation::FRAME; break; // 2=Vert. Paragraph, 3=Use Default } diff --git a/sw/source/filter/ww8/writerhelper.cxx b/sw/source/filter/ww8/writerhelper.cxx index 2ad32c7be689..8bd1eaa39601 100644 --- a/sw/source/filter/ww8/writerhelper.cxx +++ b/sw/source/filter/ww8/writerhelper.cxx @@ -190,7 +190,7 @@ namespace sw meWriterType(eTxtBox), mpStartFrameContent(0), // --> OD 2007-04-19 #i43447# - move to initialization list - mbIsInline( (rFmt.GetAnchor().GetAnchorId() == FLY_IN_CNTNT) ) + mbIsInline( (rFmt.GetAnchor().GetAnchorId() == FLY_AS_CHAR) ) // <-- { switch (rFmt.Which()) diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index 5bb1ffc557b7..a53ee1b87e9f 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -587,7 +587,7 @@ void PlcDrawObj::WritePlc( WW8Export& rWrt ) const //fHdr/bx/by/wr/wrk/fRcaSimple/fBelowText/fAnchorLock USHORT nFlags=0; //If nFlags isn't 0x14 its overridden by the escher properties - if( FLY_PAGE == rFmt.GetAnchor().GetAnchorId()) + if (FLY_AT_PAGE == rFmt.GetAnchor().GetAnchorId()) nFlags = 0x0000; else nFlags = 0x0014; // x-rel to text, y-rel to text @@ -2117,7 +2117,7 @@ bool WinwordAnchoring::ConvertPosition( SwFmtHoriOrient& _iorHoriOri, { const RndStdIds eAnchor = _rFrmFmt.GetAnchor().GetAnchorId(); - if ( FLY_IN_CNTNT == eAnchor || FLY_AT_FLY == eAnchor ) + if ( (FLY_AS_CHAR == eAnchor) || (FLY_AT_FLY == eAnchor) ) { // no conversion for as-character or at frame anchored objects return false; @@ -2166,7 +2166,7 @@ bool WinwordAnchoring::ConvertPosition( SwFmtHoriOrient& _iorHoriOri, // the fact, that the object is anchored at a paragraph, which has a "column // break before" attribute bool bConvDueToAnchoredAtColBreakPara( false ); - if ( ( eAnchor == FLY_AT_CNTNT || eAnchor == FLY_AUTO_CNTNT ) && + if ( ( (eAnchor == FLY_AT_PARA) || (eAnchor == FLY_AT_CHAR) ) && _rFrmFmt.GetAnchor().GetCntntAnchor() && _rFrmFmt.GetAnchor().GetCntntAnchor()->nNode.GetNode().IsTxtNode() ) { @@ -2403,7 +2403,7 @@ bool WinwordAnchoring::ConvertPosition( SwFmtHoriOrient& _iorHoriOri, void WinwordAnchoring::SetAnchoring(const SwFrmFmt& rFmt) { const RndStdIds eAnchor = rFmt.GetAnchor().GetAnchorId(); - mbInline = (eAnchor == FLY_IN_CNTNT); + mbInline = (eAnchor == FLY_AS_CHAR); SwFmtHoriOrient rHoriOri = rFmt.GetHoriOrient(); SwFmtVertOrient rVertOri = rFmt.GetVertOrient(); @@ -2487,13 +2487,13 @@ void WinwordAnchoring::SetAnchoring(const SwFrmFmt& rFmt) case text::RelOrientation::FRAME: case text::RelOrientation::FRAME_LEFT: //:-( case text::RelOrientation::FRAME_RIGHT: //:-( - if (eAnchor == FLY_PAGE) + if (eAnchor == FLY_AT_PAGE) mnXRelTo = 1; else mnXRelTo = 2; break; case text::RelOrientation::PRINT_AREA: - if (eAnchor == FLY_PAGE) + if (eAnchor == FLY_AT_PAGE) mnXRelTo = 0; else mnXRelTo = 2; @@ -2515,13 +2515,13 @@ void WinwordAnchoring::SetAnchoring(const SwFrmFmt& rFmt) mnYRelTo = 1; break; case text::RelOrientation::PRINT_AREA: - if (eAnchor == FLY_PAGE) + if (eAnchor == FLY_AT_PAGE) mnYRelTo = 0; else mnYRelTo = 2; break; case text::RelOrientation::FRAME: - if (eAnchor == FLY_PAGE) + if (eAnchor == FLY_AT_PAGE) mnYRelTo = 1; else mnYRelTo = 2; diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 2cbbb7943f37..b9bf46cf750f 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -376,7 +376,7 @@ xub_StrLen SwAttrIter::SearchNext( xub_StrLen nStartPos ) if (nPos >= nStartPos && nPos <= nMinPos) nMinPos = nPos; - if (maFlyIter->GetFrmFmt().GetAnchor().GetAnchorId() == FLY_AUTO_CNTNT) + if (maFlyIter->GetFrmFmt().GetAnchor().GetAnchorId() == FLY_AT_CHAR) { ++nPos; if (nPos >= nStartPos && nPos <= nMinPos) @@ -1301,7 +1301,7 @@ short MSWordExportBase::TrueFrameDirection( const SwFrmFmt &rFlyFmt ) const { pItem = 0; const SwFmtAnchor* pAnchor = &pFlyFmt->GetAnchor(); - if ( FLY_PAGE != pAnchor->GetAnchorId() && + if ((FLY_AT_PAGE != pAnchor->GetAnchorId()) && pAnchor->GetCntntAnchor() ) { pFlyFmt = pAnchor->GetCntntAnchor()->nNode.GetNode().GetFlyFmt(); @@ -1359,7 +1359,7 @@ SvxBrushItem WW8Export::TrueFrameBgBrush(const SwFrmFmt &rFlyFmt) const { pRet = 0; const SwFmtAnchor* pAnchor = &pFlyFmt->GetAnchor(); - if (FLY_PAGE != pAnchor->GetAnchorId() && + if ((FLY_AT_PAGE != pAnchor->GetAnchorId()) && pAnchor->GetCntntAnchor()) { pFlyFmt = @@ -2497,12 +2497,13 @@ void WW8AttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFmt, const Point aOffset -= aPageRect.Pos(); m_rWW8Export.pFlyOffset = &aOffset; - m_rWW8Export.eNewAnchorType = FLY_PAGE; + m_rWW8Export.eNewAnchorType = FLY_AT_PAGE; } m_rWW8Export.mpParentFrame = &rFmt; if ( - m_rWW8Export.bIsInTable && (FLY_PAGE != rAnch.GetAnchorId()) && + m_rWW8Export.bIsInTable && + (FLY_AT_PAGE != rAnch.GetAnchorId()) && !m_rWW8Export.pDoc->GetNodes()[ nStt ]->IsNoTxtNode() ) { @@ -2534,7 +2535,7 @@ void AttributeOutputBase::OutputFlyFrame( const sw::Frame& rFmt ) Point* pLayPos; bool bValidNdPos = false, bValidPgPos = false; - if ( FLY_PAGE == rFmt.GetFrmFmt().GetAnchor().GetAnchorId() ) + if (FLY_AT_PAGE == rFmt.GetFrmFmt().GetAnchor().GetAnchorId()) { // get the Layout Node-Position. if ( !bValidPgPos ) diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index dcef287a1537..a32962640117 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -2899,7 +2899,7 @@ void MSWordExportBase::ExportDocument( bool bWriteAll ) mpParentFrame = 0; pFlyOffset = 0; - eNewAnchorType = FLY_PAGE; + eNewAnchorType = FLY_AT_PAGE; nTxtTyp = TXT_MAINTEXT; // --> OD 2007-04-19 #i43447# - removed // nFlyWidth = nFlyHeight = 0; diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx index aaafe0ee49fc..649bb7ed3b8e 100644 --- a/sw/source/filter/ww8/wrtww8gr.cxx +++ b/sw/source/filter/ww8/wrtww8gr.cxx @@ -404,7 +404,7 @@ void WW8Export::OutGrf(const sw::Frame &rFrame) const SwFrmFmt &rFlyFmt = rFrame.GetFrmFmt(); const RndStdIds eAn = rFlyFmt.GetAttrSet().GetAnchor(false).GetAnchorId(); - if( eAn == FLY_IN_CNTNT ) + if (eAn == FLY_AS_CHAR) { sal_Int16 eVert = rFlyFmt.GetVertOrient().GetVertOrient(); if ((eVert == text::VertOrientation::CHAR_CENTER) || (eVert == text::VertOrientation::LINE_CENTER)) @@ -465,8 +465,8 @@ void WW8Export::OutGrf(const sw::Frame &rFrame) // Otherwise, an additional paragraph is exported for a graphic, which is // forced to be treated as inline, because it's anchored inside another frame. if ( !rFrame.IsInline() && - ( ( eAn == FLY_AT_CNTNT && ( bWrtWW8 || !bIsInTable ) ) || - eAn == FLY_PAGE ) ) + ( ((eAn == FLY_AT_PARA) && ( bWrtWW8 || !bIsInTable )) || + (eAn == FLY_AT_PAGE)) ) // <-- { WriteChar( (char)0x0d ); // umgebenden Rahmen mit CR abschliessen diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index 3b91de937668..3712c13d372d 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -4069,15 +4069,15 @@ void WW8AttributeOutput::FormatAnchor( const SwFmtAnchor& rAnchor ) BYTE nP = 0; switch ( rAnchor.GetAnchorId() ) { - case FLY_PAGE: + case FLY_AT_PAGE: // Vert: Page | Horz: Page nP |= (1 << 4) | (2 << 6); break; // Im Fall eine Flys als Zeichen: Absatz-gebunden setzen!!! case FLY_AT_FLY: - case FLY_AUTO_CNTNT: - case FLY_AT_CNTNT: - case FLY_IN_CNTNT: + case FLY_AT_CHAR: + case FLY_AT_PARA: + case FLY_AS_CHAR: // Vert: Page | Horz: Page nP |= (2 << 4) | (0 << 6); break; diff --git a/sw/source/filter/ww8/ww8glsy.cxx b/sw/source/filter/ww8/ww8glsy.cxx index b0dabff56b2f..cdb13be50aaa 100644 --- a/sw/source/filter/ww8/ww8glsy.cxx +++ b/sw/source/filter/ww8/ww8glsy.cxx @@ -36,14 +36,10 @@ #include #include #include -#ifndef _NDTXT #include -#endif #include #include -#ifndef _DOCSH_HXX #include -#endif #include #include #include @@ -51,6 +47,7 @@ #include "ww8glsy.hxx" #include "ww8par.hxx" + WW8Glossary::WW8Glossary(SvStorageStreamRef &refStrm, BYTE nVersion, SvStorage *pStg) : pGlossary(0), rStrm(refStrm), xStg(pStg), nStrings(0) @@ -82,10 +79,10 @@ bool WW8Glossary::HasBareGraphicEnd(SwDoc *pDoc,SwNodeIndex &rIdx) RES_DRAWFRMFMT != pFrmFmt->Which() ) continue; const SwFmtAnchor& rAnchor = pFrmFmt->GetAnchor(); - const SwPosition* pAPos; - if( ( FLY_AT_CNTNT == rAnchor.GetAnchorId() || - FLY_AUTO_CNTNT == rAnchor.GetAnchorId() ) && - 0 != ( pAPos = rAnchor.GetCntntAnchor()) && + SwPosition const*const pAPos = rAnchor.GetCntntAnchor(); + if (pAPos && + ((FLY_AT_PARA == rAnchor.GetAnchorId()) || + (FLY_AT_CHAR == rAnchor.GetAnchorId())) && rIdx == pAPos->nNode.GetIndex() ) { bRet=true; diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index 4948ac5eddae..cc17df625630 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -58,9 +58,7 @@ #include #include #include -#ifndef _SVX_CNTRITEM_HXX #include -#endif #include #include #include @@ -191,13 +189,13 @@ bool SwWW8ImplReader::ReadGrafStart(void* pData, short nDataSiz, } pStrm->Read(pData, nDataSiz); - RndStdIds eAnchor = (SVBT8ToByte(pDo->by) < 2) ? FLY_PAGE : FLY_AT_CNTNT; + RndStdIds eAnchor = (SVBT8ToByte(pDo->by) < 2) ? FLY_AT_PAGE : FLY_AT_PARA; rSet.Put(SwFmtAnchor(eAnchor)); nDrawXOfs2 = nDrawXOfs; nDrawYOfs2 = nDrawYOfs; - if( eAnchor == FLY_AT_CNTNT ) + if (eAnchor == FLY_AT_PARA) { if( SVBT8ToByte( pDo->bx ) == 1 ) // Pos: echt links nDrawXOfs2 = static_cast< short >(nDrawXOfs2 - maSectionManager.GetPageLeft()); @@ -2247,7 +2245,7 @@ RndStdIds SwWW8ImplReader::ProcessEscherAlign(SvxMSDffImportRec* pRecord, { ASSERT(pRecord || pFSPA, "give me something! to work with for anchoring"); if (!pRecord && !pFSPA) - return FLY_PAGE; + return FLY_AT_PAGE; SvxMSDffImportRec aRecordFromFSPA; if (!pRecord) @@ -2298,7 +2296,7 @@ RndStdIds SwWW8ImplReader::ProcessEscherAlign(SvxMSDffImportRec* pRecord, UINT32 nYRelTo = nCntRelTo > pRecord->nYRelTo ? pRecord->nYRelTo : 1; // --> OD 2005-03-03 #i43718# - RndStdIds eAnchor = IsInlineEscherHack() ? FLY_IN_CNTNT : FLY_AUTO_CNTNT; + RndStdIds eAnchor = IsInlineEscherHack() ? FLY_AS_CHAR : FLY_AT_CHAR; // <-- SwFmtAnchor aAnchor( eAnchor ); @@ -2462,7 +2460,7 @@ RndStdIds SwWW8ImplReader::ProcessEscherAlign(SvxMSDffImportRec* pRecord, if ( (pFSPA->nYaTop < 0) && (eVertOri == text::VertOrientation::NONE) && - ((eAnchor == FLY_AT_CNTNT) || (eAnchor == FLY_AUTO_CNTNT)) + ((eAnchor == FLY_AT_PARA) || (eAnchor == FLY_AT_CHAR)) ) { maTracer.Log(sw::log::eNegativeVertPlacement); @@ -2845,7 +2843,7 @@ SwFrmFmt* SwWW8ImplReader::Read_GrafLayer( long nGrafAnchorCp ) SwFrmFmt *SwWW8ImplReader::AddAutoAnchor(SwFrmFmt *pFmt) { - if (pFmt && (pFmt->GetAnchor().GetAnchorId() != FLY_IN_CNTNT)) + if (pFmt && (pFmt->GetAnchor().GetAnchorId() != FLY_AS_CHAR)) { sal_uInt16 nTextAreaWidth = static_cast< sal_uInt16 >( maSectionManager.GetPageWidth() - maSectionManager.GetPageRight() - maSectionManager.GetPageLeft()); @@ -2860,8 +2858,10 @@ SwFrmFmt *SwWW8ImplReader::AddAutoAnchor(SwFrmFmt *pFmt) * * Leave to later and set the correct location then. */ - if ((pFmt) && (pFmt->GetAnchor().GetAnchorId() != FLY_IN_CNTNT)) + if ((pFmt) && (pFmt->GetAnchor().GetAnchorId() != FLY_AS_CHAR)) + { pAnchorStck->AddAnchor(*pPaM->GetPoint(), pFmt); + } return pFmt; } @@ -3234,7 +3234,7 @@ void SwWW8ImplReader::GrafikDtor() void SwWW8FltAnchorStack::AddAnchor(const SwPosition& rPos, SwFrmFmt *pFmt) { - ASSERT(pFmt->GetAnchor().GetAnchorId() != FLY_IN_CNTNT, + ASSERT(pFmt->GetAnchor().GetAnchorId() != FLY_AS_CHAR, "Don't use fltanchors with inline frames, slap!"); NewAttr(rPos, SwFltAnchor(pFmt)); } diff --git a/sw/source/filter/ww8/ww8graf2.cxx b/sw/source/filter/ww8/ww8graf2.cxx index dc653c5738e6..9c0ea275f10d 100644 --- a/sw/source/filter/ww8/ww8graf2.cxx +++ b/sw/source/filter/ww8/ww8graf2.cxx @@ -33,9 +33,7 @@ /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil -*- */ -#ifndef __SGI_STL_ITERATOR #include -#endif #include #include #include @@ -415,7 +413,7 @@ SwFlyFrmFmt* SwWW8ImplReader::MakeGrafNotInCntnt(const WW8PicDesc& rPD, // Damit die Frames bei Einfuegen in existierendes Doc erzeugt werden: if (rDoc.GetRootFrm() && - (FLY_AT_CNTNT == pFlyFmt->GetAnchor().GetAnchorId())) + (FLY_AT_PARA == pFlyFmt->GetAnchor().GetAnchorId())) { pFlyFmt->MakeFrms(); } @@ -548,9 +546,11 @@ SwFrmFmt* SwWW8ImplReader::ImportGraf(SdrTextObj* pTextObj, // it is anchored in content; because this anchor add // a character into the textnode. // IussueZilla task 2806 - if( FLY_IN_CNTNT == + if (FLY_AS_CHAR == pFlyFmtOfJustInsertedGraphic->GetAnchor().GetAnchorId() ) + { aFlySet.ClearItem( RES_ANCHOR ); + } pFlyFmtOfJustInsertedGraphic->SetFmtAttr( aFlySet ); diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 599c6b3ea1b6..2602c03f7138 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -1648,7 +1648,7 @@ void SwWW8ImplReader::Read_HdFtTextAsHackedFrame(long nStart, long nLen, pPaM->GetPoint()->nNode = pSttIdx->GetIndex() + 1; pPaM->GetPoint()->nContent.Assign(pPaM->GetCntntNode(), 0); - SwFlyFrmFmt *pFrame = rDoc.MakeFlySection(FLY_AT_CNTNT, pPaM->GetPoint()); + SwFlyFrmFmt *pFrame = rDoc.MakeFlySection(FLY_AT_PARA, pPaM->GetPoint()); pFrame->SetFmtAttr(SwFmtFrmSize(ATT_MIN_SIZE, nPageWidth, MINLAY)); pFrame->SetFmtAttr(SwFmtSurround(SURROUND_THROUGHT)); diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index 5cb19358f385..87b5cc4a806a 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -3473,7 +3473,7 @@ bool SwWW8ImplReader::StartTable(WW8_CP nStartCp) // --> OD 2005-03-21 #i45301# - anchor nested table inside Writer fly frame // only at-character, if absolute position object attributes are available. // Thus, default anchor type is as-character anchored. - RndStdIds eAnchor( FLY_IN_CNTNT ); + RndStdIds eAnchor( FLY_AS_CHAR ); // <-- if ( nInTable ) { @@ -3505,7 +3505,7 @@ bool SwWW8ImplReader::StartTable(WW8_CP nStartCp) // <-- // --> OD 2005-03-21 #i45301# - anchor nested table Writer fly // frame at-character - eAnchor = FLY_AUTO_CNTNT; + eAnchor = FLY_AT_CHAR; // <-- } } @@ -3523,7 +3523,8 @@ bool SwWW8ImplReader::StartTable(WW8_CP nStartCp) "how could we be in a local apo and have no apo"); } - if ( eAnchor == FLY_AUTO_CNTNT && !maTableStack.empty() && !InEqualApo(nNewInTable) ) + if ((eAnchor == FLY_AT_CHAR) + && !maTableStack.empty() && !InEqualApo(nNewInTable) ) { pTableDesc->pParentPos = new SwPosition(*pPaM->GetPoint()); SfxItemSet aItemSet(rDoc.GetAttrPool(), @@ -3551,7 +3552,7 @@ bool SwWW8ImplReader::StartTable(WW8_CP nStartCp) if ( pTableWFlyPara && pTableSFlyPara ) { WW8FlySet aFlySet( *this, pTableWFlyPara, pTableSFlyPara, false ); - SwFmtAnchor aAnchor( FLY_AUTO_CNTNT ); + SwFmtAnchor aAnchor( FLY_AT_CHAR ); aAnchor.SetAnchor( pTableDesc->pParentPos ); aFlySet.Put( aAnchor ); pTableDesc->pFlyFmt->SetFmtAttr( aFlySet ); @@ -3606,8 +3607,8 @@ bool lcl_PamContainsFly(SwPaM & rPam) switch (pAnchor->GetAnchorId()) { - case FLY_AT_CNTNT: - case FLY_AUTO_CNTNT: + case FLY_AT_PARA: + case FLY_AT_CHAR: { const SwPosition* pAPos = pAnchor->GetCntntAnchor(); diff --git a/sw/source/filter/ww8/ww8par4.cxx b/sw/source/filter/ww8/ww8par4.cxx index ccabdcf8cac1..eef92f7148cf 100644 --- a/sw/source/filter/ww8/ww8par4.cxx +++ b/sw/source/filter/ww8/ww8par4.cxx @@ -35,12 +35,8 @@ #include "writerhelper.hxx" #include -#ifndef __SGI_STL_ALGORITHM #include -#endif -#ifndef __SGI_STL_FUNCTIONAL #include -#endif #include #include #include @@ -59,9 +55,7 @@ #include #include #include -#ifndef _DOCSH_HXX #include // fuer Ole-Node -#endif #include // Progress #include #include @@ -296,7 +290,7 @@ SwFrmFmt* SwWW8ImplReader::ImportOle(const Graphic* pGrf, if (!mbNewDoc) Reader::ResetFrmFmtAttrs( *pTempSet ); - SwFmtAnchor aAnchor( FLY_IN_CNTNT ); + SwFmtAnchor aAnchor( FLY_AS_CHAR ); aAnchor.SetAnchor( pPaM->GetPoint() ); pTempSet->Put( aAnchor ); diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index f5f82d879aac..d51b4c5d2f4b 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -45,17 +45,11 @@ #include #include -#ifndef _UCBHELPER_CONTENT_HXX_ #include -#endif -#ifndef _UCBHELPER_CONTENTBROKER_HXX_ #include -#endif #include -#ifndef _COM_SUN_STAR_I18N_SCRIPTTYPE_HDL_ #include -#endif #include #include #include @@ -2216,7 +2210,7 @@ eF_ResT SwWW8ImplReader::Read_F_IncludePicture( WW8FieldDesc*, String& rStr ) */ SfxItemSet aFlySet( rDoc.GetAttrPool(), RES_FRMATR_BEGIN, RES_FRMATR_END-1 ); - aFlySet.Put( SwFmtAnchor( FLY_IN_CNTNT ) ); + aFlySet.Put( SwFmtAnchor( FLY_AS_CHAR ) ); aFlySet.Put( SwFmtVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME )); pFlyFmtOfJustInsertedGraphic = rDoc.Insert( *pPaM, aGrfName, diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index 978834f3345e..21bfa4efdc64 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -44,9 +44,7 @@ #include #include #include -#ifndef _SVX_CNTRITEM_HXX //autogen #include -#endif #include #include #include @@ -65,19 +63,13 @@ #include #include #include -#ifndef _SVX_TSTPITEM_HXX //autogen #include -#endif #include #include -#ifndef _SVX_EMPHITEM_HXX //autogen #include -#endif #include #include -#ifndef _SVX_SCRIPSPACEITEM_HXX #include -#endif #include #include #include @@ -1995,7 +1987,7 @@ WW8SwFlyPara::WW8SwFlyPara( SwPaM& rPaM, nYBind = (( rWW.nSp29 & 0x30 ) >> 4); // --> OD 2005-08-24 #i53725# - absolute positioned objects have to be // anchored at-paragraph to assure its correct anchor position. - eAnchor = FLY_AT_CNTNT; + eAnchor = FLY_AT_PARA; // <-- switch (nYBind) { @@ -2287,7 +2279,7 @@ void WW8FlySet::Init(const SwWW8ImplReader& rReader, const SwPaM* pPaM) Reader::ResetFrmFmtAttrs(*this); // Abstand/Umrandung raus Put(SvxLRSpaceItem(RES_LR_SPACE)); //inline writer ole2 objects start with 0.2cm l/r - SwFmtAnchor aAnchor(FLY_IN_CNTNT); + SwFmtAnchor aAnchor(FLY_AS_CHAR); aAnchor.SetAnchor(pPaM->GetPoint()); Put(aAnchor); @@ -2519,8 +2511,10 @@ bool SwWW8ImplReader::StartApo(const ApoTestResults &rApo, pWWZOrder->InsertTextLayerObject(pOurNewObject); } - if (FLY_IN_CNTNT != pSFlyPara->eAnchor) + if (FLY_AS_CHAR != pSFlyPara->eAnchor) + { pAnchorStck->AddAnchor(*pPaM->GetPoint(),pSFlyPara->pFlyFmt); + } // merke Pos im Haupttext pSFlyPara->pMainTextPos = new SwPosition( *pPaM->GetPoint() ); @@ -3206,7 +3200,7 @@ SwFrmFmt *SwWW8ImplReader::ContainsSingleInlineGraphic(const SwPaM &rRegion) subscripting to force the graphic into a centered position on the line, so we must check when applying sub/super to see if it the subscript range contains only a single graphic, and if that graphic is anchored as - FLY_IN_CNTNT and then we can change its anchoring to centered in the line. + FLY_AS_CHAR and then we can change its anchoring to centered in the line. */ SwFrmFmt *pRet=0; SwNodeIndex aBegin(rRegion.Start()->nNode); @@ -3223,8 +3217,8 @@ SwFrmFmt *SwWW8ImplReader::ContainsSingleInlineGraphic(const SwPaM &rRegion) { const SwFmtFlyCnt& rFly = pTFlyAttr->GetFlyCnt(); SwFrmFmt *pFlyFmt = rFly.GetFrmFmt(); - if( pFlyFmt && - FLY_IN_CNTNT == pFlyFmt->GetAnchor().GetAnchorId() ) + if (pFlyFmt && + (FLY_AS_CHAR == pFlyFmt->GetAnchor().GetAnchorId())) { pRet = pFlyFmt; } @@ -3240,7 +3234,7 @@ bool SwWW8ImplReader::ConvertSubToGraphicPlacement() subscripting to force the graphic into a centered position on the line, so we must check when applying sub/super to see if it the subscript range contains only a single graphic, and if that graphic is anchored as - FLY_IN_CNTNT and then we can change its anchoring to centered in the line. + FLY_AS_CHAR and then we can change its anchoring to centered in the line. */ bool bIsGraphicPlacementHack = false; USHORT nPos; diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx index 6953e065c82a..8c414cdeab0e 100644 --- a/sw/source/filter/xml/xmltexti.cxx +++ b/sw/source/filter/xml/xmltexti.cxx @@ -47,9 +47,7 @@ #include #include #include -#ifndef _XMLOFF_TXTPRMAP_HXX #include -#endif #include #include "unocrsr.hxx" #include "unoobj.hxx" @@ -76,6 +74,7 @@ #include #include + using ::rtl::OUString; using ::rtl::OUStringBuffer; using namespace ::com::sun::star; @@ -126,7 +125,7 @@ static void lcl_putHeightAndWidth ( SfxItemSet &rItemSet, rItemSet.Put( SwFmtFrmSize( ATT_FIX_SIZE, nWidth, nHeight ) ); } - SwFmtAnchor aAnchor( FLY_AUTO_CNTNT ); + SwFmtAnchor aAnchor( FLY_AT_CHAR ); rItemSet.Put( aAnchor ); if( pTwipWidth ) diff --git a/sw/source/ui/app/appenv.cxx b/sw/source/ui/app/appenv.cxx index 7f3acf375b35..57a5bed15f5c 100644 --- a/sw/source/ui/app/appenv.cxx +++ b/sw/source/ui/app/appenv.cxx @@ -43,18 +43,12 @@ #include #include -#ifndef _APP_HXX //autogen #include -#endif -#ifndef _WRKWIN_HXX //autogen #include -#endif #include #include #include -#ifndef _MSGBOX_HXX //autogen #include -#endif #include #include #include @@ -67,21 +61,13 @@ #include #include #include -#ifndef _VIEW_HXX #include -#endif -#ifndef _DOCSH_HXX #include -#endif #include #include #include -#ifndef IDOCUMENTDEVICEACCESS_HXX_INCLUDED #include -#endif -#ifndef _DBMGR_HXX #include -#endif #include #include #include @@ -91,9 +77,7 @@ #include #include -#ifndef _CMDID_H #include -#endif #ifndef _GLOBALS_HRC #include #endif @@ -478,7 +462,7 @@ static USHORT nTitleNo = 0; if (rItem.bSend) { pSh->SttEndDoc(TRUE); - aMgr.InsertFlyFrm(FLY_PAGE, + aMgr.InsertFlyFrm(FLY_AT_PAGE, Point(rItem.lSendFromLeft + lLeft, rItem.lSendFromTop + lUpper), Size (rItem.lAddrFromLeft - rItem.lSendFromLeft, 0)); @@ -494,7 +478,7 @@ static USHORT nTitleNo = 0; // Empfaenger pSh->SttEndDoc(TRUE); - aMgr.InsertFlyFrm(FLY_PAGE, + aMgr.InsertFlyFrm(FLY_AT_PAGE, Point(rItem.lAddrFromLeft + lLeft, rItem.lAddrFromTop + lUpper), Size (nPageW - rItem.lAddrFromLeft - 566, 0)); pSh->EnterSelFrmMode(); diff --git a/sw/source/ui/app/applab.cxx b/sw/source/ui/app/applab.cxx index d09e522599d7..b6df61c2b968 100644 --- a/sw/source/ui/app/applab.cxx +++ b/sw/source/ui/app/applab.cxx @@ -39,15 +39,9 @@ #include -#ifndef _APP_HXX //autogen #include -#endif -#ifndef _WRKWIN_HXX //autogen #include -#endif -#ifndef _MSGBOX_HXX //autogen #include -#endif #include #include #include @@ -71,21 +65,13 @@ #include #include #include -#ifndef _VIEW_HXX #include -#endif -#ifndef _DOCSH_HXX #include -#endif #include #include #include -#ifndef _CMDID_H #include -#endif -#ifndef _DBMGR_HXX #include -#endif #include #include #include @@ -126,7 +112,7 @@ const SwFrmFmt *lcl_InsertBCText( SwWrtShell& rSh, const SwLabItem& rItem, sal_uInt16 nPhyPageNum, nVirtPageNum; rSh.GetPageNum( nPhyPageNum, nVirtPageNum ); - aSet.Put(SwFmtAnchor(bPage ? FLY_IN_CNTNT : FLY_PAGE, nPhyPageNum)); + aSet.Put(SwFmtAnchor(bPage ? FLY_AS_CHAR : FLY_AT_PAGE, nPhyPageNum)); if (!bPage) { aSet.Put(SwFmtHoriOrient(rItem.lLeft + nCol * rItem.lHDist, @@ -166,7 +152,7 @@ const SwFrmFmt *lcl_InsertLabText( SwWrtShell& rSh, const SwLabItem& rItem, sal_uInt16 nPhyPageNum, nVirtPageNum; rSh.GetPageNum( nPhyPageNum, nVirtPageNum ); - aSet.Put(SwFmtAnchor(bPage ? FLY_IN_CNTNT : FLY_PAGE, nPhyPageNum)); + aSet.Put(SwFmtAnchor(bPage ? FLY_AS_CHAR : FLY_AT_PAGE, nPhyPageNum)); if (!bPage) { aSet.Put(SwFmtHoriOrient(rItem.lLeft + nCol * rItem.lHDist, diff --git a/sw/source/ui/dbui/mmlayoutpage.cxx b/sw/source/ui/dbui/mmlayoutpage.cxx index ddb37e3c8eeb..450311349694 100644 --- a/sw/source/ui/dbui/mmlayoutpage.cxx +++ b/sw/source/ui/dbui/mmlayoutpage.cxx @@ -42,9 +42,7 @@ #include #include #include -#ifndef _VIEW_HXX #include -#endif #include #include #include @@ -56,9 +54,7 @@ #include #include #include -#ifndef _DOCSH_HXX #include -#endif #include #include #include @@ -325,7 +321,7 @@ SwFrmFmt* SwMailMergeLayoutPage::InsertAddressFrame( RES_FRM_SIZE, RES_FRM_SIZE, RES_SURROUND, RES_SURROUND, 0 ); - aSet.Put(SwFmtAnchor(FLY_PAGE, 1)); + aSet.Put(SwFmtAnchor(FLY_AT_PAGE, 1)); if(bAlignLeft) aSet.Put(SwFmtHoriOrient( 0, text::HoriOrientation::NONE, text::RelOrientation::PAGE_PRINT_AREA )); else diff --git a/sw/source/ui/dialog/regionsw.cxx b/sw/source/ui/dialog/regionsw.cxx index 47936697a20d..aaf95674cb10 100644 --- a/sw/source/ui/dialog/regionsw.cxx +++ b/sw/source/ui/dialog/regionsw.cxx @@ -36,37 +36,24 @@ #include #include #include -#ifndef _MSGBOX_HXX //autogen #include -#endif #include #include #include -#ifndef _PASSWD_HXX //autogen #include -#endif #include #include #include #include -#ifndef _SVX_SIZEITEM_HXX //autogen - #include -#endif #include #include #include #include -#ifndef _BASESH_HXX #include -#endif -#ifndef _WDOCSH_HXX #include -#endif -#ifndef _VIEW_HXX #include -#endif #include #include #include // fuer Undo-Ids @@ -75,12 +62,8 @@ #include #include -#ifndef _HELPID_H #include -#endif -#ifndef _CMDID_H #include -#endif #ifndef _REGIONSW_HRC #include #endif @@ -118,7 +101,7 @@ void SwBaseShell::InsertRegionDialog(SfxRequest& rReq) if (!pSet || pSet->Count()==0) { SwRect aRect; - rSh.CalcBoundRect(aRect, FLY_IN_CNTNT); + rSh.CalcBoundRect(aRect, FLY_AS_CHAR); long nWidth = aRect.Width(); aSet.Put(SwFmtFrmSize(ATT_VAR_SIZE, nWidth)); @@ -154,7 +137,7 @@ void SwBaseShell::InsertRegionDialog(SfxRequest& rReq) { SwFmtCol aCol; SwRect aRect; - rSh.CalcBoundRect(aRect, FLY_IN_CNTNT); + rSh.CalcBoundRect(aRect, FLY_AS_CHAR); long nWidth = aRect.Width(); USHORT nCol = ((SfxUInt16Item *)pItem)->GetValue(); @@ -232,7 +215,7 @@ IMPL_STATIC_LINK( SwWrtShell, InsertRegionDialog, SwSection*, pSect ) SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE, 0); SwRect aRect; - pThis->CalcBoundRect(aRect, FLY_IN_CNTNT); + pThis->CalcBoundRect(aRect, FLY_AS_CHAR); long nWidth = aRect.Width(); aSet.Put(SwFmtFrmSize(ATT_VAR_SIZE, nWidth)); // Hoehe=Breite fuer konsistentere Vorschau (analog zu Bereich bearbeiten) diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx index 7d8e38443ca0..cdaa09f0a549 100644 --- a/sw/source/ui/docvw/edtwin.cxx +++ b/sw/source/ui/docvw/edtwin.cxx @@ -50,16 +50,12 @@ #include #include #include -#ifndef __SBX_SBXVARIABLE_HXX //autogen #include -#endif #include #include #include #include -#ifndef _SFX_CLIENTSH_HXX #include -#endif #include #include #include @@ -69,9 +65,6 @@ #include #include #include -//#ifndef _SVDVMARK_HXX //autogen -//#include -//#endif #include #include #include @@ -128,12 +121,8 @@ #include #include -#ifndef _HELPID_H #include -#endif -#ifndef _CMDID_H #include -#endif #ifndef _DOCVW_HRC #include #endif @@ -1019,7 +1008,7 @@ void SwEditWin::ChangeFly( BYTE nDir, BOOL bWeb ) default: ASSERT( TRUE, "ChangeFly: Unknown direction." ); } BOOL bSet = FALSE; - if( FLY_IN_CNTNT == eAnchorId && ( nDir % 2 ) ) + if ((FLY_AS_CHAR == eAnchorId) && ( nDir % 2 )) { long aDiff = aTmp.Top() - aRefPoint.Y(); if( aDiff > 0 ) @@ -1064,7 +1053,8 @@ void SwEditWin::ChangeFly( BYTE nDir, BOOL bWeb ) aSet.Put( aVert ); bSet = TRUE; } - if( bWeb && FLY_AT_CNTNT == eAnchorId && ( nDir==MOVE_LEFT_SMALL || nDir==MOVE_RIGHT_BIG ) ) + if (bWeb && (FLY_AT_PARA == eAnchorId) + && ( nDir==MOVE_LEFT_SMALL || nDir==MOVE_RIGHT_BIG )) { SwFmtHoriOrient aHori( (SwFmtHoriOrient&)aSet.Get(RES_HORI_ORIENT) ); sal_Int16 eNew; @@ -1091,11 +1081,13 @@ void SwEditWin::ChangeFly( BYTE nDir, BOOL bWeb ) rSh.StartAllAction(); if( bSet ) rSh.SetFlyFrmAttr( aSet ); - BOOL bSetPos = FLY_IN_CNTNT != eAnchorId; + BOOL bSetPos = (FLY_AS_CHAR != eAnchorId); if(bSetPos && bWeb) { - if(FLY_PAGE != eAnchorId) + if (FLY_AT_PAGE != eAnchorId) + { bSetPos = FALSE; + } else { bSetPos = (::GetHtmlMode(rView.GetDocShell()) & HTMLMODE_SOME_ABS_POS) ? @@ -1185,7 +1177,8 @@ void SwEditWin::ChangeDrawing( BYTE nDir ) BOOL bDummy; const bool bVertAnchor = rSh.IsFrmVertical( TRUE, bDummy ); const bool bHoriMove = !bVertAnchor == !( nDir % 2 ); - const bool bMoveAllowed = !bHoriMove || rSh.GetAnchorId() != FLY_IN_CNTNT; + const bool bMoveAllowed = + !bHoriMove || (rSh.GetAnchorId() != FLY_AS_CHAR); if ( bMoveAllowed ) { // <-- diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx index a9df9762ad92..af0298fe807e 100644 --- a/sw/source/ui/frmdlg/column.cxx +++ b/sw/source/ui/frmdlg/column.cxx @@ -125,7 +125,7 @@ SwColumnDlg::SwColumnDlg(Window* pParent, SwWrtShell& rSh) : FreeResource(); SwRect aRect; - rWrtShell.CalcBoundRect(aRect, FLY_IN_CNTNT); + rWrtShell.CalcBoundRect(aRect, FLY_AS_CHAR); nSelectionWidth = aRect.Width(); diff --git a/sw/source/ui/frmdlg/frmmgr.cxx b/sw/source/ui/frmdlg/frmmgr.cxx index bd1e98b37b9e..1d872a47e919 100644 --- a/sw/source/ui/frmdlg/frmmgr.cxx +++ b/sw/source/ui/frmdlg/frmmgr.cxx @@ -31,12 +31,9 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - - #include "cmdid.h" #include "hintids.hxx" - #include #include #include @@ -212,11 +209,11 @@ void SwFlyFrmAttrMgr::InsertFlyFrm(RndStdIds eAnchorType, const Size &rSize, BOOL bAbs ) { - ASSERT( eAnchorType == FLY_PAGE || - eAnchorType == FLY_AT_CNTNT || - eAnchorType == FLY_AUTO_CNTNT || - eAnchorType == FLY_AT_FLY || - eAnchorType == FLY_IN_CNTNT, "Rahmentyp nicht erlaubt" ); + ASSERT( eAnchorType == FLY_AT_PAGE || + eAnchorType == FLY_AT_PARA || + eAnchorType == FLY_AT_CHAR || + eAnchorType == FLY_AT_FLY || + eAnchorType == FLY_AS_CHAR, "invalid frame type" ); if ( bAbs ) SetAbsPos( rPos ); @@ -238,8 +235,8 @@ void SwFlyFrmAttrMgr::SetAnchor( RndStdIds eId ) pOwnSh->GetPageNum( nPhyPageNum, nVirtPageNum ); aSet.Put( SwFmtAnchor( eId, nPhyPageNum ) ); - if( FLY_PAGE == eId || FLY_AT_CNTNT == eId || FLY_AUTO_CNTNT == eId - || FLY_AT_FLY == eId ) + if ((FLY_AT_PAGE == eId) || (FLY_AT_PARA == eId) || (FLY_AT_CHAR == eId) + || (FLY_AT_FLY == eId)) { SwFmtVertOrient aVertOrient( GetVertOrient() ); SwFmtHoriOrient aHoriOrient( GetHoriOrient() ); @@ -319,7 +316,7 @@ void SwFlyFrmAttrMgr::ValidateMetrics( SvxSwFrameValidation& rVal, rVal.nWidth = rVal.nHeight; rVal.nHeight = nTmp; } - if ( eAnchorType == FLY_PAGE || eAnchorType == FLY_AT_FLY ) + if ((eAnchorType == FLY_AT_PAGE) || (eAnchorType == FLY_AT_FLY)) { // MinimalPosition rVal.nMinHPos = aBoundRect.Left(); @@ -369,8 +366,8 @@ void SwFlyFrmAttrMgr::ValidateMetrics( SvxSwFrameValidation& rVal, } // OD 12.11.2003 #i22341# - handle to character anchored objects vertical // aligned at character or top of line in a special case - else if ( eAnchorType == FLY_AT_CNTNT || - ( eAnchorType == FLY_AUTO_CNTNT && + else if ((eAnchorType == FLY_AT_PARA) || + ((eAnchorType == FLY_AT_CHAR) && !(rVal.nVRelOrient == text::RelOrientation::CHAR) && !(rVal.nVRelOrient == text::RelOrientation::TEXT_LINE) ) ) { @@ -437,7 +434,7 @@ void SwFlyFrmAttrMgr::ValidateMetrics( SvxSwFrameValidation& rVal, // vertical aligned at character or top of line. // Note: (1) positive vertical values are positions above the top of line // (2) negative vertical values are positions below the top of line - else if ( eAnchorType == FLY_AUTO_CNTNT && + else if ( (eAnchorType == FLY_AT_CHAR) && ( rVal.nVRelOrient == text::RelOrientation::CHAR || rVal.nVRelOrient == text::RelOrientation::TEXT_LINE ) ) { @@ -484,7 +481,7 @@ void SwFlyFrmAttrMgr::ValidateMetrics( SvxSwFrameValidation& rVal, rVal.nMaxHeight = aBoundRect.Height(); } } - else if ( eAnchorType == FLY_IN_CNTNT ) + else if ( eAnchorType == FLY_AS_CHAR ) { rVal.nMinHPos = 0; rVal.nMaxHPos = 0; diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index dc9fe2d1bf2e..c95f97e5ae59 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -37,12 +37,8 @@ #include #include -#ifndef _CMDID_H #include -#endif -#ifndef _HELPID_H #include -#endif #include #include #include @@ -68,9 +64,7 @@ #include #include #include -#ifndef _DOCSH_HXX #include -#endif #include #include #include @@ -881,10 +875,10 @@ void SwFrmPage::Reset( const SfxItemSet &rSet ) // Allgemeiner Initialisierungteil switch(rAnchor.GetAnchorId()) { - case FLY_PAGE: aAnchorAtPageRB.Check(); break; - case FLY_AT_CNTNT: aAnchorAtParaRB.Check(); break; - case FLY_AUTO_CNTNT: aAnchorAtCharRB.Check(); break; - case FLY_IN_CNTNT: aAnchorAsCharRB.Check(); break; + case FLY_AT_PAGE: aAnchorAtPageRB.Check(); break; + case FLY_AT_PARA: aAnchorAtParaRB.Check(); break; + case FLY_AT_CHAR: aAnchorAtCharRB.Check(); break; + case FLY_AS_CHAR: aAnchorAsCharRB.Check(); break; case FLY_AT_FLY: aAnchorAtFrameRB.Check();break; default:; //prevent warning } @@ -911,7 +905,7 @@ void SwFrmPage::Reset( const SfxItemSet &rSet ) } if( 0 == (nHtmlMode & HTMLMODE_SOME_ABS_POS)) { - if(GetAnchor() == FLY_PAGE) + if (GetAnchor() == FLY_AT_PAGE) { aAnchorAtParaRB.Check(); } @@ -1048,8 +1042,10 @@ BOOL SwFrmPage::FillItemSet(SfxItemSet &rSet) // Vertikale Position // fuer zeichengebundene Rahmen Offset umrechenen SwTwips nY = static_cast< SwTwips >(aAtVertPosED.Denormalize(aAtVertPosED.GetValue(FUNIT_TWIP))); - if (eAnchorId == FLY_IN_CNTNT) + if (eAnchorId == FLY_AS_CHAR) + { nY *= -1; + } aVertOrient.SetPos( nY ); } pOldItem = GetOldItem(rSet, FN_VERT_ORIENT); @@ -1188,7 +1184,7 @@ void SwFrmPage::InitPos(RndStdIds eId, } BOOL bEnable = TRUE; - if ( eId == FLY_PAGE ) + if ( eId == FLY_AT_PAGE ) { pVMap = bHtmlMode ? aVPageHtmlMap : aVPageMap; pHMap = bHtmlMode ? aHPageHtmlMap : aHPageMap; @@ -1200,7 +1196,7 @@ void SwFrmPage::InitPos(RndStdIds eId, pVMap = bHtmlMode ? aVFlyHtmlMap : aVFrameMap; pHMap = bHtmlMode ? aHFlyHtmlMap : aHFrameMap; } - else if ( eId == FLY_AT_CNTNT ) + else if ( eId == FLY_AT_PARA ) { if(bHtmlMode) { @@ -1213,7 +1209,7 @@ void SwFrmPage::InitPos(RndStdIds eId, pHMap = aHParaMap; } } - else if ( eId == FLY_AUTO_CNTNT ) + else if ( eId == FLY_AT_CHAR ) { if(bHtmlMode) { @@ -1226,7 +1222,7 @@ void SwFrmPage::InitPos(RndStdIds eId, pHMap = aHCharMap; } } - else if ( eId == FLY_IN_CNTNT ) + else if ( eId == FLY_AS_CHAR ) { pVMap = bHtmlMode ? aVAsCharHtmlMap : aVAsCharMap; pHMap = 0; @@ -1257,7 +1253,7 @@ void SwFrmPage::InitPos(RndStdIds eId, FillRelLB(pVMap, nMapPos, nV, nVRel, aVertRelationLB, aVertRelationFT); // Edits init - bEnable = nH == text::HoriOrientation::NONE && eId != FLY_IN_CNTNT;//#61359# warum nicht in Formaten&& !bFormat; + bEnable = nH == text::HoriOrientation::NONE && eId != FLY_AS_CHAR; if (!bEnable) { aAtHorzPosED.SetValue( 0, FUNIT_TWIP ); @@ -1281,7 +1277,7 @@ void SwFrmPage::InitPos(RndStdIds eId, } else { - if ( eId == FLY_IN_CNTNT ) + if ( eId == FLY_AS_CHAR ) { if ( nY == LONG_MAX ) nY = 0; @@ -1608,15 +1604,23 @@ USHORT SwFrmPage::GetMapPos( const FrmMap *pMap, ListBox &rAlignLB ) RndStdIds SwFrmPage::GetAnchor() { - RndStdIds nRet = FLY_PAGE; + RndStdIds nRet = FLY_AT_PAGE; if(aAnchorAtParaRB.IsChecked()) - nRet = FLY_AT_CNTNT; + { + nRet = FLY_AT_PARA; + } else if(aAnchorAtCharRB.IsChecked()) - nRet = FLY_AUTO_CNTNT; + { + nRet = FLY_AT_CHAR; + } else if(aAnchorAsCharRB.IsChecked()) - nRet = FLY_IN_CNTNT; + { + nRet = FLY_AS_CHAR; + } else if(aAnchorAtFrameRB.IsChecked()) + { nRet = FLY_AT_FLY; + } return nRet; } @@ -1818,8 +1822,10 @@ IMPL_LINK( SwFrmPage, RangeModifyHdl, Edit *, EMPTYARG ) if ( aVal.nHPos != nAtHorzPosVal ) aAtHorzPosED.SetValue(aAtHorzPosED.Normalize(aVal.nHPos), FUNIT_TWIP); - SwTwips nUpperOffset = aVal.nAnchorType == FLY_IN_CNTNT ? nUpperBorder : 0; - SwTwips nLowerOffset = aVal.nAnchorType == FLY_IN_CNTNT ? nLowerBorder : 0; + const SwTwips nUpperOffset = (aVal.nAnchorType == FLY_AS_CHAR) + ? nUpperBorder : 0; + const SwTwips nLowerOffset = (aVal.nAnchorType == FLY_AS_CHAR) + ? nLowerBorder : 0; aAtVertPosED.SetMin(aAtVertPosED.Normalize(aVal.nMinVPos + nLowerOffset + nUpperOffset), FUNIT_TWIP); aAtVertPosED.SetMax(aAtVertPosED.Normalize(aVal.nMaxVPos), FUNIT_TWIP); @@ -1905,7 +1911,7 @@ IMPL_LINK( SwFrmPage, PosHdl, ListBox *, pLB ) // Sonderbehandlung fuer HTML-Mode mit horz-vert-Abhaengigkeiten if(bHtmlMode && nHtmlMode&HTMLMODE_SOME_ABS_POS && - FLY_AUTO_CNTNT == (RndStdIds)GetAnchor()) + (FLY_AT_CHAR == GetAnchor())) { BOOL bSet = FALSE; if(bHori) @@ -1977,7 +1983,7 @@ IMPL_LINK( SwFrmPage, RelHdl, ListBox *, pLB ) else bAtVertPosModified = TRUE; - if(bHtmlMode && FLY_AUTO_CNTNT == (RndStdIds)GetAnchor()) // wieder Sonderbehandlung + if (bHtmlMode && (FLY_AT_CHAR == GetAnchor())) { if(bHori) { @@ -2219,7 +2225,7 @@ void SwFrmPage::Init(const SfxItemSet& rSet, BOOL bReset) nOldV = rVert.GetVertOrient(), nOldVRel = rVert.GetRelationOrient(); - if (eAnchorId == FLY_PAGE) + if (eAnchorId == FLY_AT_PAGE) { if (nOldHRel == text::RelOrientation::FRAME) nOldHRel = text::RelOrientation::PAGE_FRAME; diff --git a/sw/source/ui/frmdlg/wrap.cxx b/sw/source/ui/frmdlg/wrap.cxx index b3828797fc07..4479b7da8b1e 100644 --- a/sw/source/ui/frmdlg/wrap.cxx +++ b/sw/source/ui/frmdlg/wrap.cxx @@ -36,7 +36,6 @@ #endif - #include "hintids.hxx" #include #include @@ -141,7 +140,7 @@ SwWrapTabPage::SwWrapTabPage(Window *pParent, const SfxItemSet &rSet) : aWrapIL (SW_RES(IL_WRAP)), aWrapILH (SW_RES(ILH_WRAP)), - nAnchorId(FLY_AT_CNTNT), + nAnchorId(FLY_AT_PARA), nHtmlMode(0), pWrtSh(0), @@ -254,10 +253,15 @@ void SwWrapTabPage::Reset(const SfxItemSet &rSet) const SwFmtAnchor &rAnch = (const SwFmtAnchor&)rSet.Get(RES_ANCHOR); nAnchorId = rAnch.GetAnchorId(); - if ( (nAnchorId == FLY_AT_CNTNT || nAnchorId == FLY_AUTO_CNTNT) && nSur != SURROUND_NONE ) + if (((nAnchorId == FLY_AT_PARA) || (nAnchorId == FLY_AT_CHAR)) + && (nSur != SURROUND_NONE)) + { aWrapAnchorOnlyCB.Check( rSurround.IsAnchorOnly() ); + } else + { aWrapAnchorOnlyCB.Enable( FALSE ); + } BOOL bContour = rSurround.IsContour(); aWrapOutlineCB.Check( bContour ); @@ -452,7 +456,7 @@ void SwWrapTabPage::ActivatePage(const SfxItemSet& rSet) // Anchor const SwFmtAnchor &rAnch = (const SwFmtAnchor&)rSet.Get(RES_ANCHOR); nAnchorId = rAnch.GetAnchorId(); - BOOL bEnable = nAnchorId != FLY_IN_CNTNT; + BOOL bEnable = (nAnchorId != FLY_AS_CHAR); if (!bDrawMode) { @@ -521,7 +525,7 @@ void SwWrapTabPage::ActivatePage(const SfxItemSet& rSet) } else { - if (aVal.nAnchorType == FLY_IN_CNTNT) + if (aVal.nAnchorType == FLY_AS_CHAR) { nLeft = nRight; @@ -566,7 +570,8 @@ void SwWrapTabPage::ActivatePage(const SfxItemSet& rSet) sal_Int16 eHOrient = rHori.GetHoriOrient(); sal_Int16 eHRelOrient = rHori.GetRelationOrient(); aWrapOutlineCB.Hide(); - BOOL bAllHtmlModes = (nAnchorId == FLY_AT_CNTNT || nAnchorId == FLY_AUTO_CNTNT) && + const bool bAllHtmlModes = + ((nAnchorId == FLY_AT_PARA) || (nAnchorId == FLY_AT_CHAR)) && (eHOrient == text::HoriOrientation::RIGHT || eHOrient == text::HoriOrientation::LEFT); aWrapAnchorOnlyCB.Enable( bAllHtmlModes && nSur != SURROUND_NONE ); aWrapOutsideCB.Hide(); @@ -574,17 +579,26 @@ void SwWrapTabPage::ActivatePage(const SfxItemSet& rSet) aWrapTransparentCB.Enable( FALSE ); - aNoWrapRB.Enable( FLY_AT_CNTNT == nAnchorId ); + aNoWrapRB.Enable( FLY_AT_PARA == nAnchorId ); aWrapParallelRB.Enable( FALSE ); - aWrapLeftRB .Enable( FLY_AT_CNTNT == nAnchorId || - (FLY_AUTO_CNTNT == nAnchorId && eHOrient == text::HoriOrientation::RIGHT && eHRelOrient == text::RelOrientation::PRINT_AREA)); - aWrapRightRB .Enable( FLY_AT_CNTNT == nAnchorId || - ( FLY_AUTO_CNTNT == nAnchorId && eHOrient == text::HoriOrientation::LEFT && eHRelOrient == text::RelOrientation::PRINT_AREA)); - - aWrapThroughRB.Enable( (FLY_PAGE == nAnchorId || - (FLY_AUTO_CNTNT == nAnchorId && eHRelOrient != text::RelOrientation::PRINT_AREA) || FLY_AT_CNTNT == nAnchorId ) - && bSomeAbsPos && - eHOrient != text::HoriOrientation::RIGHT); + aWrapLeftRB .Enable + ( (FLY_AT_PARA == nAnchorId) + || ( (FLY_AT_CHAR == nAnchorId) + && (eHOrient == text::HoriOrientation::RIGHT) + && (eHRelOrient == text::RelOrientation::PRINT_AREA))); + aWrapRightRB .Enable + ( (FLY_AT_PARA == nAnchorId) + || ( (FLY_AT_CHAR == nAnchorId) + && (eHOrient == text::HoriOrientation::LEFT) + && (eHRelOrient == text::RelOrientation::PRINT_AREA))); + + aWrapThroughRB.Enable + ( ( (FLY_AT_PAGE == nAnchorId) + || ( (FLY_AT_CHAR == nAnchorId) + && (eHRelOrient != text::RelOrientation::PRINT_AREA)) + || (FLY_AT_PARA == nAnchorId)) + && bSomeAbsPos + && (eHOrient != text::HoriOrientation::RIGHT)); if(aNoWrapRB.IsChecked() && !aNoWrapRB.IsEnabled()) { if(aWrapThroughRB.IsEnabled()) @@ -624,7 +638,8 @@ void SwWrapTabPage::ActivatePage(const SfxItemSet& rSet) aIdealWrapRB.Enable( bEnable ); aWrapThroughRB.Enable( bEnable ); aWrapParallelRB.Enable( bEnable ); - aWrapAnchorOnlyCB.Enable( (nAnchorId == FLY_AT_CNTNT || nAnchorId == FLY_AUTO_CNTNT) + aWrapAnchorOnlyCB.Enable( + ((nAnchorId == FLY_AT_PARA) || (nAnchorId == FLY_AT_CHAR)) && nSur != SURROUND_NONE ); } ContourHdl(0); @@ -693,10 +708,11 @@ IMPL_LINK( SwWrapTabPage, WrapTypeHdl, ImageRadioButton *, pBtn ) { BOOL bWrapThrough = (pBtn == &aWrapThroughRB); aWrapTransparentCB.Enable( bWrapThrough && !bHtmlMode ); - bWrapThrough |= ( nAnchorId == FLY_IN_CNTNT ); + bWrapThrough |= ( nAnchorId == FLY_AS_CHAR ); aWrapOutlineCB.Enable( !bWrapThrough && pBtn != &aNoWrapRB); aWrapOutsideCB.Enable( !bWrapThrough && aWrapOutlineCB.IsChecked() ); - aWrapAnchorOnlyCB.Enable( (nAnchorId == FLY_AT_CNTNT || nAnchorId == FLY_AUTO_CNTNT) && + aWrapAnchorOnlyCB.Enable( + ((nAnchorId == FLY_AT_PARA) || (nAnchorId == FLY_AT_CHAR)) && (pBtn != &aNoWrapRB) ); ContourHdl(0); diff --git a/sw/source/ui/ribbar/conrect.cxx b/sw/source/ui/ribbar/conrect.cxx index e5540dab1c11..51cdc5a72a1f 100644 --- a/sw/source/ui/ribbar/conrect.cxx +++ b/sw/source/ui/ribbar/conrect.cxx @@ -43,21 +43,14 @@ #include #include #include -#ifndef _CMDID_H #include -#endif -#ifndef _VIEW_HXX #include -#endif #include #include #include -#ifndef _DRAWBASE_HXX #include -#endif -#ifndef _CONRECT_HXX #include -#endif + /************************************************************************* |* @@ -119,7 +112,7 @@ BOOL ConstRectangle::MouseButtonUp(const MouseEvent& rMEvt) case OBJ_TEXT: if( bMarquee ) { - m_pSh->ChgAnchor(FLY_IN_CNTNT); + m_pSh->ChgAnchor(FLY_AS_CHAR); if( pObj ) { diff --git a/sw/source/ui/ribbar/drawbase.cxx b/sw/source/ui/ribbar/drawbase.cxx index f6a48d36cd68..aa33c637f44c 100644 --- a/sw/source/ui/ribbar/drawbase.cxx +++ b/sw/source/ui/ribbar/drawbase.cxx @@ -344,7 +344,8 @@ BOOL SwDrawBase::MouseButtonUp(const MouseEvent& rMEvt) if ( xRecorder.is() ) { SfxRequest aReq(m_pSh->GetView().GetViewFrame(),FN_INSERT_FRAME); - aReq.AppendItem(SfxUInt16Item( FN_INSERT_FRAME, (USHORT)FLY_AT_CNTNT )); + aReq.AppendItem(SfxUInt16Item( FN_INSERT_FRAME, + static_cast(FLY_AT_PARA) )); aReq.AppendItem(SfxPointItem( FN_PARAM_1, m_pSh->GetAnchorObjDiff())); aReq.AppendItem(SvxSizeItem( FN_PARAM_2, m_pSh->GetObjSize())); aReq.Done(); diff --git a/sw/source/ui/shells/basesh.cxx b/sw/source/ui/shells/basesh.cxx index 6bb599e44867..93b74d40040f 100644 --- a/sw/source/ui/shells/basesh.cxx +++ b/sw/source/ui/shells/basesh.cxx @@ -100,9 +100,7 @@ #include #include #include -#ifndef _CMDID_H #include -#endif #ifndef _GLOBALS_HRC #include #endif @@ -1063,14 +1061,14 @@ void SwBaseShell::Execute(SfxRequest &rReq) case FN_TOOL_ANKER_FRAME: { RndStdIds eSet = nSlot == FN_TOOL_ANKER_PAGE - ? FLY_PAGE + ? FLY_AT_PAGE : nSlot == FN_TOOL_ANKER_PARAGRAPH - ? FLY_AT_CNTNT + ? FLY_AT_PARA : nSlot == FN_TOOL_ANKER_FRAME ? FLY_AT_FLY : nSlot == FN_TOOL_ANKER_CHAR - ? FLY_IN_CNTNT - : FLY_AUTO_CNTNT; + ? FLY_AS_CHAR + : FLY_AT_CHAR; rSh.StartUndo(); if( rSh.IsObjSelected() ) rSh.ChgAnchor( eSet ); @@ -1101,7 +1099,7 @@ void SwBaseShell::Execute(SfxRequest &rReq) switch( eSet ) { case FLY_AT_FLY: - case FLY_PAGE: + case FLY_AT_PAGE: //Durchlauf, links oder von links, oben, von oben if(eSurround != SURROUND_THROUGHT) @@ -1114,7 +1112,7 @@ void SwBaseShell::Execute(SfxRequest &rReq) aSet.Put(SwFmtHoriOrient(0, text::HoriOrientation::LEFT)); break; - case FLY_AT_CNTNT: + case FLY_AT_PARA: //links, von links, rechts, oben, kein Uml, li+re Umlauf, if(eSurround != SURROUND_LEFT || eSurround != SURROUND_RIGHT) aSet.Put(SwFmtSurround(SURROUND_LEFT)); @@ -1126,7 +1124,7 @@ void SwBaseShell::Execute(SfxRequest &rReq) aSet.Put(SwFmtHoriOrient(0, text::HoriOrientation::LEFT)); break; - case FLY_AUTO_CNTNT: + case FLY_AT_CHAR: //links, von links, rechts, oben, Durchlauf if(eSurround != SURROUND_THROUGHT) aSet.Put(SwFmtSurround(SURROUND_THROUGHT)); @@ -1624,12 +1622,17 @@ void SwBaseShell::GetState( SfxItemSet &rSet ) else rSh.GetFlyFrmAttr(aSet); RndStdIds eSet = ((SwFmtAnchor&)aSet.Get(RES_ANCHOR)).GetAnchorId(); - BOOL bSet; - bSet = (nWhich == FN_TOOL_ANKER_PAGE && eSet == FLY_PAGE) || - (nWhich == FN_TOOL_ANKER_PARAGRAPH && eSet == FLY_AT_CNTNT) || - (nWhich == FN_TOOL_ANKER_FRAME && eSet == FLY_AT_FLY) || - (nWhich == FN_TOOL_ANKER_AT_CHAR && eSet == FLY_AUTO_CNTNT) || - (nWhich == FN_TOOL_ANKER_CHAR && eSet == FLY_IN_CNTNT); + const BOOL bSet = + ((nWhich == FN_TOOL_ANKER_PAGE) && + (eSet == FLY_AT_PAGE)) + || ((nWhich == FN_TOOL_ANKER_PARAGRAPH) && + (eSet == FLY_AT_PARA)) + || ((nWhich == FN_TOOL_ANKER_FRAME) && + (eSet == FLY_AT_FLY)) + || ((nWhich == FN_TOOL_ANKER_AT_CHAR) && + (eSet == FLY_AT_CHAR)) + || ((nWhich == FN_TOOL_ANKER_CHAR) && + (eSet == FLY_AS_CHAR)); if(nWhich != FN_TOOL_ANKER) { USHORT nHtmlMode = ::GetHtmlMode(GetView().GetDocShell()); @@ -1646,16 +1649,16 @@ void SwBaseShell::GetState( SfxItemSet &rSet ) switch (eSet) { - case FLY_PAGE: + case FLY_AT_PAGE: nSlotId = FN_TOOL_ANKER_PAGE; break; - case FLY_AT_CNTNT: + case FLY_AT_PARA: nSlotId = FN_TOOL_ANKER_PARAGRAPH; break; - case FLY_IN_CNTNT: + case FLY_AS_CHAR: nSlotId = FN_TOOL_ANKER_CHAR; break; - case FLY_AUTO_CNTNT: + case FLY_AT_CHAR: nSlotId = FN_TOOL_ANKER_AT_CHAR; break; case FLY_AT_FLY: @@ -1705,15 +1708,18 @@ void SwBaseShell::GetState( SfxItemSet &rSet ) SwSurround nSurround = rWrap.GetSurround(); BOOL bSet = FALSE; - BOOL bDisable = nAnchorType == - 1 || nAnchorType == FLY_IN_CNTNT; - BOOL bHtmlMode = 0 != ::GetHtmlMode(GetView().GetDocShell()); + bool bDisable = + (nAnchorType == - 1) || (nAnchorType == FLY_AS_CHAR); + const bool bHtmlMode = + 0 != ::GetHtmlMode(GetView().GetDocShell()); switch( nWhich ) { case FN_FRAME_NOWRAP: bDisable |= - ( nAnchorType != FLY_AT_CNTNT && - nAnchorType != FLY_AUTO_CNTNT && nAnchorType != FLY_PAGE); + ( (nAnchorType != FLY_AT_PARA) + && (nAnchorType != FLY_AT_CHAR) + && (nAnchorType != FLY_AT_PAGE)); bSet = nSurround == SURROUND_NONE; break; case FN_FRAME_WRAP: @@ -1726,7 +1732,9 @@ void SwBaseShell::GetState( SfxItemSet &rSet ) break; case FN_FRAME_WRAPTHRU: bDisable |= (bHtmlMode || - (nAnchorType != FLY_AT_CNTNT&& nAnchorType != FLY_AUTO_CNTNT && nAnchorType != FLY_PAGE)); + ( (nAnchorType != FLY_AT_PARA) + && (nAnchorType != FLY_AT_CHAR) + && (nAnchorType != FLY_AT_PAGE))); if(bObj) bSet = nSurround == SURROUND_THROUGHT && rSh.GetLayerId(); else @@ -1766,7 +1774,7 @@ void SwBaseShell::GetState( SfxItemSet &rSet ) break; case FN_WRAP_ANCHOR_ONLY: bDisable |= (bHtmlMode || - (nAnchorType != FLY_AT_CNTNT)); + (nAnchorType != FLY_AT_PARA)); bSet = rWrap.IsAnchorOnly(); break; case FN_FRAME_WRAP_LEFT: diff --git a/sw/source/ui/shells/drwbassh.cxx b/sw/source/ui/shells/drwbassh.cxx index 339c332c9135..2de9201bffdd 100644 --- a/sw/source/ui/shells/drwbassh.cxx +++ b/sw/source/ui/shells/drwbassh.cxx @@ -49,9 +49,7 @@ #include #include #include -#ifndef _CMDID_H #include -#endif #include #include #include @@ -479,7 +477,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq) { // Objekte nicht aneinander ausrichten USHORT nAnchor = pSh->GetAnchorId(); - if (nAnchor == FLY_IN_CNTNT) + if (nAnchor == FLY_AS_CHAR) { sal_Int16 nVertOrient = -1; @@ -509,7 +507,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq) } break; } - if (nAnchor == FLY_AT_CNTNT) + if (nAnchor == FLY_AT_PARA) break; // Absatzverankerte Rahmen nicht ausrichten } @@ -855,7 +853,7 @@ IMPL_LINK(SwDrawBaseShell, ValidatePosition, SvxSwFrameValidation*, pValidation pValidation->nWidth = pValidation->nHeight; pValidation->nHeight = nTmp; } - if ( eAnchorType == FLY_PAGE || eAnchorType == FLY_AT_FLY ) + if ((eAnchorType == FLY_AT_PAGE) || (eAnchorType == FLY_AT_FLY)) { // MinimalPosition pValidation->nMinHPos = aBoundRect.Left(); @@ -903,7 +901,7 @@ IMPL_LINK(SwDrawBaseShell, ValidatePosition, SvxSwFrameValidation*, pValidation pValidation->nMaxVPos = aBoundRect.Bottom() - pValidation->nHeight; pValidation->nMaxWidth = aBoundRect.Right() - nH; } - else if ( eAnchorType == FLY_AT_CNTNT || eAnchorType == FLY_AUTO_CNTNT ) + else if ((eAnchorType == FLY_AT_PARA) || (eAnchorType == FLY_AT_CHAR)) { if (pValidation->nHPos + pValidation->nWidth > aBoundRect.Right()) { @@ -964,7 +962,7 @@ IMPL_LINK(SwDrawBaseShell, ValidatePosition, SvxSwFrameValidation*, pValidation pValidation->nMaxHeight = pValidation->nMaxVPos + pValidation->nHeight - nV; pValidation->nMaxWidth = pValidation->nMaxHPos + pValidation->nWidth - nH; } - else if ( eAnchorType == FLY_IN_CNTNT ) + else if (eAnchorType == FLY_AS_CHAR) { pValidation->nMinHPos = 0; pValidation->nMaxHPos = 0; diff --git a/sw/source/ui/shells/textdrw.cxx b/sw/source/ui/shells/textdrw.cxx index 1d10c885bc17..77a88a5a33ea 100644 --- a/sw/source/ui/shells/textdrw.cxx +++ b/sw/source/ui/shells/textdrw.cxx @@ -39,23 +39,17 @@ #include #include -#ifndef _VIEW_HXX #include -#endif #include #include #include -#ifndef _BASESH_HXX #include -#endif #ifndef _POOLFMT_HRC #include #endif -#ifndef _DOCSH_HXX #include -#endif #include #include #include diff --git a/sw/source/ui/shells/textidx.cxx b/sw/source/ui/shells/textidx.cxx index 3eb67f725acd..8ad65538640f 100644 --- a/sw/source/ui/shells/textidx.cxx +++ b/sw/source/ui/shells/textidx.cxx @@ -32,9 +32,7 @@ #include "precompiled_sw.hxx" #include -#ifndef _MSGBOX_HXX //autogen #include -#endif #include #include #include @@ -55,6 +53,8 @@ #include "swabstdlg.hxx" #include #include + + // STATIC DATA ----------------------------------------------------------- void SwTextShell::ExecIdx(SfxRequest &rReq) @@ -136,7 +136,7 @@ void SwTextShell::ExecIdx(SfxRequest &rReq) 0 ); SwWrtShell& rSh = GetShell(); SwRect aRect; - rSh.CalcBoundRect(aRect, FLY_IN_CNTNT); + rSh.CalcBoundRect(aRect, FLY_AS_CHAR); long nWidth = aRect.Width(); aSet.Put(SwFmtFrmSize(ATT_VAR_SIZE, nWidth)); diff --git a/sw/source/ui/shells/textsh.cxx b/sw/source/ui/shells/textsh.cxx index 7e38c1297d0b..6dffd49dd8c3 100644 --- a/sw/source/ui/shells/textsh.cxx +++ b/sw/source/ui/shells/textsh.cxx @@ -39,9 +39,7 @@ #include #include -#ifndef __RSC //autogen #include -#endif #include #include #include @@ -82,9 +80,7 @@ #include #include #include -#ifndef _CMDID_H #include -#endif #ifndef _GLOBALS_HRC #include #endif @@ -112,9 +108,7 @@ #ifndef _POPUP_HRC #include #endif -#ifndef _SWERROR_H #include -#endif #include #include @@ -566,7 +560,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) aCol.Init( nCols, aCol.GetGutterWidth(), aCol.GetWishWidth() ); aMgr.SetCol( aCol ); } - aMgr.InsertFlyFrm(FLY_AT_CNTNT, aStartPos, aSize); + aMgr.InsertFlyFrm(FLY_AT_PARA, aStartPos, aSize); GetShell().EndAllAction(); GetShell().UnlockPaint(); } @@ -600,7 +594,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) Size aSize(aMgr.GetSize()); aSize.Width() = GetShell().GetAnyCurRect(RECT_PAGE_PRT).Width(); Point aPos = aMgr.GetPos(); - RndStdIds eAnchor = FLY_AT_CNTNT; + RndStdIds eAnchor = FLY_AT_PARA; if(pArgs->GetItemState(nSlot, FALSE, &pItem) == SFX_ITEM_SET) eAnchor = (RndStdIds)((SfxUInt16Item *)pItem)->GetValue(); if(pArgs->GetItemState(FN_PARAM_1, FALSE, &pItem) == SFX_ITEM_SET) @@ -764,7 +758,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) SwFlyFrmAttrMgr aFrmMgr( TRUE, &rSh, FRMMGR_TYPE_GRF ); // am FrmMgr muessen die richtigen Parameter eingestellt werden - aFrmMgr.SetAnchor(FLY_IN_CNTNT); + aFrmMgr.SetAnchor(FLY_AS_CHAR); rSh.SplitNode( FALSE, FALSE ); rSh.SplitNode( FALSE, FALSE ); diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx index 77c06f44c494..dea0dc3d096b 100644 --- a/sw/source/ui/uiview/view2.cxx +++ b/sw/source/ui/uiview/view2.cxx @@ -34,12 +34,6 @@ #include #include -// #ifndef _COM_SUN_STAR_LANG_LOCALE_HPP_ -// #include -// #endif -// #ifndef _COM_SUN_STAR_UI_DIALOGS_XFILEPICKER_HPP_ -// #include -// #endif #include #include #include @@ -49,9 +43,6 @@ #include #include -// #ifndef _FILTER_HXX -// #include -// #endif #include #include #include @@ -69,12 +60,8 @@ #include #include #include -#ifndef _APP_HXX //autogen #include -#endif -#ifndef _WRKWIN_HXX //autogen #include -#endif #include #include #include @@ -94,9 +81,7 @@ #include #include #include -#ifndef __RSC //autogen #include -#endif #include #include #include @@ -148,10 +133,6 @@ #include #include -// #ifndef _FRMMGR_HXX -// #include -// #endif - #include //#outline level,added by zhaojianwei #include diff --git a/sw/source/ui/uiview/viewtab.cxx b/sw/source/ui/uiview/viewtab.cxx index 6223d1d0234a..592be8bc1d73 100644 --- a/sw/source/ui/uiview/viewtab.cxx +++ b/sw/source/ui/uiview/viewtab.cxx @@ -347,7 +347,7 @@ void SwView::ExecTabWin( SfxRequest& rReq ) if(aSize.GetWidthPercent()) { SwRect aRect; - rSh.CalcBoundRect(aRect, FLY_IN_CNTNT); + rSh.CalcBoundRect(aRect, FLY_AS_CHAR); long nPrtWidth = aRect.Width(); aSize.SetWidthPercent(BYTE((nPageWidth - aLongLR.GetLeft() - aLongLR.GetRight()) * 100 /nPrtWidth)); } @@ -472,7 +472,7 @@ void SwView::ExecTabWin( SfxRequest& rReq ) if(aSize.GetHeightPercent()) { SwRect aRect; - rSh.CalcBoundRect(aRect, FLY_IN_CNTNT); + rSh.CalcBoundRect(aRect, FLY_AS_CHAR); long nPrtHeight = aRect.Height(); aSize.SetHeightPercent(BYTE(nHeight * 100 /nPrtHeight)); } diff --git a/sw/source/ui/utlui/attrdesc.cxx b/sw/source/ui/utlui/attrdesc.cxx index 14c27c19b137..fcf675c26fcc 100644 --- a/sw/source/ui/utlui/attrdesc.cxx +++ b/sw/source/ui/utlui/attrdesc.cxx @@ -53,9 +53,7 @@ #include #include #include -#ifndef _FMTLINE_HXX #include -#endif #include #include #include @@ -687,13 +685,13 @@ SfxItemPresentation SwFmtAnchor::GetPresentation USHORT nId = 0; switch ( GetAnchorId() ) { - case FLY_AT_CNTNT: //Absatzgebundener Rahmen + case FLY_AT_PARA: nId = STR_FLY_AT_CNTNT; break; - case FLY_IN_CNTNT: //Zeichengebundener Rahmen + case FLY_AS_CHAR: nId = STR_FLY_IN_CNTNT; break; - case FLY_PAGE: //Seitengebundener Rahmen + case FLY_AT_PAGE: nId = STR_FLY_PAGE; break; default:;//prevent warning diff --git a/sw/source/ui/wrtsh/select.cxx b/sw/source/ui/wrtsh/select.cxx index 44a854a7ad4d..9499c44b63a4 100644 --- a/sw/source/ui/wrtsh/select.cxx +++ b/sw/source/ui/wrtsh/select.cxx @@ -39,15 +39,9 @@ #include #include #include -#ifndef _CMDID_H #include -#endif -#ifndef _VIEW_HXX #include -#endif -#ifndef _BASESH_HXX #include -#endif #include #include #include -- cgit v1.2.3 From eb1338534074029d8135c9a475cd301a8d11e3e3 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 5 Jan 2010 16:37:42 +0100 Subject: swunolocking1: calbck.hxx: SwClientIter constructor takes a const& parameter --- sw/inc/calbck.hxx | 5 ++--- sw/source/core/attr/calbck.cxx | 2 +- sw/source/core/inc/frmtool.hxx | 2 +- sw/source/core/layout/frmtool.cxx | 4 ++-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/sw/inc/calbck.hxx b/sw/inc/calbck.hxx index 7a8ff7f8f471..cde55aec812e 100644 --- a/sw/inc/calbck.hxx +++ b/sw/inc/calbck.hxx @@ -202,7 +202,7 @@ class SwClientIter friend SwClient* SwModify::_Remove(SwClient *); // fuer Ptr-Korrektur friend void SwModify::Add(SwClient *); // nur fuer ASSERT ! - SwModify& rRoot; + SwModify const& rRoot; SwClient *pAkt, *pDelNext; // fuers Updaten der aller Iteratoren beim Einfuegen/Loeschen von // Clients, wenn der Iterator gerade draufsteht. @@ -213,11 +213,10 @@ class SwClientIter TypeId aSrchId; // fuer First/Next - suche diesen Type public: - SW_DLLPUBLIC SwClientIter( SwModify& ); + SW_DLLPUBLIC SwClientIter( SwModify const& ); SW_DLLPUBLIC ~SwClientIter(); const SwModify& GetModify() const { return rRoot; } - SwModify& GetModify() { return rRoot; } #ifndef CFRONT SwClient* operator++(int); // zum Naechsten diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx index e4410c26e8bb..a844356d1e2e 100644 --- a/sw/source/core/attr/calbck.cxx +++ b/sw/source/core/attr/calbck.cxx @@ -463,7 +463,7 @@ BOOL SwDepend::GetInfo( SfxPoolItem& rInfo ) const /********************************************************************/ -SwClientIter::SwClientIter( SwModify& rModify ) +SwClientIter::SwClientIter( SwModify const& rModify ) : rRoot( rModify ) { // hinten einketten! diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx index ed172b310a01..8cb536f32cba 100644 --- a/sw/source/core/inc/frmtool.hxx +++ b/sw/source/core/inc/frmtool.hxx @@ -141,7 +141,7 @@ const SwFrm * MA_FASTCALL FindPage( const SwRect &rRect, const SwFrm *pPage ); // JP 07.05.98: wird von SwCntntNode::GetFrm und von SwFlyFrm::GetFrm // gerufen -SwFrm* GetFrmOfModify( SwModify&, USHORT nFrmType, const Point* = 0, +SwFrm* GetFrmOfModify( SwModify const&, USHORT const nFrmType, const Point* = 0, const SwPosition *pPos = 0, const BOOL bCalcFrm = FALSE ); diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index f3ac0f966c67..e04b9746a2f8 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -3519,8 +3519,8 @@ const SwFrm* MA_FASTCALL FindPage( const SwRect &rRect, const SwFrm *pPage ) return pPage; } -SwFrm* GetFrmOfModify( SwModify& rMod, USHORT nFrmType, const Point* pPoint, - const SwPosition *pPos, const BOOL bCalcFrm ) +SwFrm* GetFrmOfModify( SwModify const& rMod, USHORT const nFrmType, + const Point* pPoint, const SwPosition *pPos, const BOOL bCalcFrm ) { SwFrm *pMinFrm = 0, *pTmpFrm; SwRect aCalcRect; -- cgit v1.2.3 From c00fbf426f2add382d18d99ed14a3c48b7d36afb Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 5 Jan 2010 16:37:42 +0100 Subject: swunolocking1: swtable.hxx: SwTable::FindTable() takes a const parameter --- sw/inc/swtable.hxx | 2 +- sw/source/core/table/swtable.cxx | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sw/inc/swtable.hxx b/sw/inc/swtable.hxx index 1a62bb3d4dfd..800fd4bb4a18 100644 --- a/sw/inc/swtable.hxx +++ b/sw/inc/swtable.hxx @@ -299,7 +299,7 @@ public: virtual BOOL GetInfo( SfxPoolItem& ) const; // suche im Format nach der angemeldeten Tabelle - static SwTable* FindTable( SwFrmFmt* pFmt ); + static SwTable * FindTable( SwFrmFmt const*const pFmt ); // Struktur ein wenig aufraeumen void GCLines(); diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx index 070e8eb625f9..8e5dc1131e1b 100644 --- a/sw/source/core/table/swtable.cxx +++ b/sw/source/core/table/swtable.cxx @@ -2060,9 +2060,11 @@ BOOL SwTable::GetInfo( SfxPoolItem& rInfo ) const return TRUE; } -SwTable* SwTable::FindTable( SwFrmFmt* pFmt ) +SwTable * SwTable::FindTable( SwFrmFmt const*const pFmt ) { - return pFmt ? (SwTable*)SwClientIter( *pFmt ).First( TYPE(SwTable) ) : 0; + return (pFmt) + ? static_cast(SwClientIter(*pFmt).First( TYPE(SwTable) )) + : 0; } SwTableNode* SwTable::GetTableNode() const -- cgit v1.2.3 From 92bbc112a283deee8796f09a1eaa49515979a548 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 5 Jan 2010 16:37:42 +0100 Subject: swunolocking1: #i105557#: remove unnecessary includes of unoobj.hxx --- sw/inc/chpfld.hxx | 4 +++- sw/inc/unochart.hxx | 10 ++++++++-- sw/inc/unofield.hxx | 8 ++++++-- sw/inc/unoidx.hxx | 15 +++++++++++++-- sw/source/core/doc/docfld.cxx | 7 +------ sw/source/core/fields/expfld.cxx | 2 +- 6 files changed, 32 insertions(+), 14 deletions(-) diff --git a/sw/inc/chpfld.hxx b/sw/inc/chpfld.hxx index 08ebcf93bd5c..0edd6681da58 100644 --- a/sw/inc/chpfld.hxx +++ b/sw/inc/chpfld.hxx @@ -32,9 +32,11 @@ #include "fldbas.hxx" + class SwFrm; +class SwCntntNode; class SwTxtNode; -#include + enum SwChapterFormat { diff --git a/sw/inc/unochart.hxx b/sw/inc/unochart.hxx index 955030cbada8..bc29daa21a4d 100644 --- a/sw/inc/unochart.hxx +++ b/sw/inc/unochart.hxx @@ -32,6 +32,8 @@ #include #include + +#include #include #include #include @@ -48,8 +50,8 @@ #include #include #include - #include + #include //OMultiTypeInterfaceContainerHelper #include // helper for implementations #include // helper for implementations @@ -57,17 +59,21 @@ #include // helper for implementations #include +#include +#include +#include #include -#include +class SfxItemPropertySet; class SwDoc; class SwTable; class SwTableBox; class SwUnoCrsr; struct SwRangeDescriptor; class SwSelBoxes; +class SwFrmFmt; ////////////////////////////////////////////////////////////////////// diff --git a/sw/inc/unofield.hxx b/sw/inc/unofield.hxx index bef657b5b797..092a4bdc56a1 100644 --- a/sw/inc/unofield.hxx +++ b/sw/inc/unofield.hxx @@ -30,14 +30,18 @@ #ifndef _UNOFIELD_HXX #define _UNOFIELD_HXX -#include +#include #include #include +#include + +#include + #include -#include #include #include + class SwFieldType; class SwDoc; class SwFmtFld; diff --git a/sw/inc/unoidx.hxx b/sw/inc/unoidx.hxx index 5ea20f65c89d..ef503926ad1f 100644 --- a/sw/inc/unoidx.hxx +++ b/sw/inc/unoidx.hxx @@ -30,15 +30,26 @@ #ifndef _UNOIDX_HXX #define _UNOIDX_HXX +#include +#include +#include +#include +#include #include #include -#include -#include + +#include + +#include #include #include + + +class SfxItemPropertySet; class SwTOXBaseSection; class SwTOXMark; class SwTOXType; + /* -----------------07.12.98 10:08------------------- * * --------------------------------------------------*/ diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx index fba401974a5b..06999d846c81 100644 --- a/sw/source/core/doc/docfld.cxx +++ b/sw/source/core/doc/docfld.cxx @@ -41,12 +41,8 @@ #define _SVSTDARR_ULONGS #include #endif -#ifndef _APP_HXX //autogen #include -#endif -#ifndef _APP_HXX //autogen #include -#endif #include #include #include @@ -69,14 +65,13 @@ #include #include #include -#ifndef _DBMGR_HXX #include -#endif #include #include #include #include #include +#include #ifndef _POOLFMT_HRC #include // fuer InitFldTypes #endif diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx index 38745a12ba7b..05a8dee4253e 100644 --- a/sw/source/core/fields/expfld.cxx +++ b/sw/source/core/fields/expfld.cxx @@ -31,7 +31,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - #include #include #include @@ -41,6 +40,7 @@ #include #include #include +#include #include #include #include -- cgit v1.2.3 From 37dee57c4d5640e59c296c926a74a25342afdc2e Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 5 Jan 2010 16:37:43 +0100 Subject: swunolocking1: #i105557#: unoobj.hxx: split out unorefmark.hxx: move SwXReferenceMark from unoobj.hxx to new unorefmark.hxx. --- sw/inc/unoobj.hxx | 73 ------------ sw/inc/unorefmark.hxx | 199 +++++++++++++++++++++++++++++++ sw/source/core/unocore/unoclbck.cxx | 1 + sw/source/core/unocore/unocoll.cxx | 4 +- sw/source/core/unocore/unocrsrhelper.cxx | 2 +- sw/source/core/unocore/unoportenum.cxx | 1 + sw/source/core/unocore/unorefmk.cxx | 2 +- sw/source/core/unocore/unotext.cxx | 1 + 8 files changed, 206 insertions(+), 77 deletions(-) create mode 100644 sw/inc/unorefmark.hxx diff --git a/sw/inc/unoobj.hxx b/sw/inc/unoobj.hxx index 08f5d2308b66..62cf34e1a580 100644 --- a/sw/inc/unoobj.hxx +++ b/sw/inc/unoobj.hxx @@ -99,7 +99,6 @@ class SwFmtFtn; -class SwFmtRefMark; class GetCurTxtFmtColl; @@ -1416,78 +1415,6 @@ public: //SwClient virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); }; -/* -----------------27.08.98 15:11------------------- - * - * --------------------------------------------------*/ -typedef ::cppu::WeakImplHelper5 -< - ::com::sun::star::text::XTextContent, - ::com::sun::star::beans::XPropertySet, - ::com::sun::star::lang::XServiceInfo, - ::com::sun::star::container::XNamed, - ::com::sun::star::lang::XUnoTunnel -> -SwRefMarkBaseClass; - -class SwXReferenceMark : public SwRefMarkBaseClass, - public SwClient -{ - SwEventListenerContainer aLstnrCntnr; - SwDoc* pDoc; - const SwFmtRefMark* pMark; - String sMarkName; - BOOL m_bIsDescriptor; - - BOOL IsValid() const {return 0 != GetRegisteredIn();} - void InsertRefMark( SwPaM& rPam, SwXTextCursor * pCursor ); -public: - SwXReferenceMark(SwDoc* pDoc, const SwFmtRefMark* pMark); - ~SwXReferenceMark(); - - TYPEINFO(); - - static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); - - //XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); - - //XTextContent - virtual void SAL_CALL attach(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getAnchor( ) throw(::com::sun::star::uno::RuntimeException); - - //XComponent - virtual void SAL_CALL dispose(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); - - //XNamed - virtual rtl::OUString SAL_CALL getName(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL setName(const rtl::OUString& Name_) throw( ::com::sun::star::uno::RuntimeException ); - //XServiceInfo - virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); - - //XPropertySet - virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - - //SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); - - void attachToRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange)throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); - - const SwFmtRefMark* GetMark()const {return pMark;} - const String& GetMarkName() const {return sMarkName;} - SwDoc* GetDoc() const{return pDoc;} - void Invalidate(); -}; #endif - diff --git a/sw/inc/unorefmark.hxx b/sw/inc/unorefmark.hxx new file mode 100644 index 000000000000..8a37b5655e9e --- /dev/null +++ b/sw/inc/unorefmark.hxx @@ -0,0 +1,199 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: unoobj.hxx,v $ + * + * $Revision: 1.49 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SW_UNOREFMARK_HXX +#define SW_UNOREFMARK_HXX + +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include + + +class SwDoc; +class SwPaM; +class SwFmtRefMark; +class SwXTextCursor; + + +/* -----------------27.08.98 15:11------------------- + * + * --------------------------------------------------*/ +typedef ::cppu::WeakImplHelper5 +< ::com::sun::star::lang::XUnoTunnel +, ::com::sun::star::lang::XServiceInfo +, ::com::sun::star::beans::XPropertySet +, ::com::sun::star::container::XNamed +, ::com::sun::star::text::XTextContent +> SwXReferenceMark_Base; + +class SwXReferenceMark + : public SwXReferenceMark_Base + , public SwClient +{ + +private: + + SwEventListenerContainer aLstnrCntnr; + SwDoc* pDoc; + const SwFmtRefMark* pMark; + String sMarkName; + BOOL m_bIsDescriptor; + + BOOL IsValid() const {return 0 != GetRegisteredIn();} + void InsertRefMark( SwPaM& rPam, SwXTextCursor * pCursor ); + + virtual ~SwXReferenceMark(); + +public: + + SwXReferenceMark(SwDoc * pDoc, const SwFmtRefMark * pMark); + + void attachToRange( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange >& xTextRange) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + + const SwFmtRefMark* GetMark() const {return pMark;} + const String& GetMarkName() const {return sMarkName;} + SwDoc* GetDoc() const {return pDoc;} + void Invalidate(); + + TYPEINFO(); + + // SwClient + virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + + static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId(); + + // XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( + const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier) + throw (::com::sun::star::uno::RuntimeException); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( + const ::rtl::OUString& rServiceName) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames() + throw (::com::sun::star::uno::RuntimeException); + + // XComponent + virtual void SAL_CALL dispose() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XEventListener > & xListener) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XEventListener > & xListener) + throw (::com::sun::star::uno::RuntimeException); + + // XPropertySet + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySetInfo > SAL_CALL + getPropertySetInfo() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Any& rValue) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::beans::PropertyVetoException, + ::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( + const ::rtl::OUString& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertyChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertyChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XVetoableChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XVetoableChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + // XNamed + virtual ::rtl::OUString SAL_CALL getName() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setName(const ::rtl::OUString& rName) + throw (::com::sun::star::uno::RuntimeException); + + // XTextContent + virtual void SAL_CALL attach( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > & xTextRange) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > SAL_CALL getAnchor() + throw (::com::sun::star::uno::RuntimeException); + +}; + +#endif // SW_UNOREFMARK_HXX + diff --git a/sw/source/core/unocore/unoclbck.cxx b/sw/source/core/unocore/unoclbck.cxx index ef14a270630d..01890a1f40a4 100644 --- a/sw/source/core/unocore/unoclbck.cxx +++ b/sw/source/core/unocore/unoclbck.cxx @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx index 0a95eee00bcd..d7315e42383d 100644 --- a/sw/source/core/unocore/unocoll.cxx +++ b/sw/source/core/unocore/unocoll.cxx @@ -31,7 +31,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - #include #include #include @@ -76,7 +75,8 @@ #include #include -#include "unometa.hxx" +#include +#include #include "docsh.hxx" diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index 194200bfad0c..de893c8fe76a 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -32,10 +32,10 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx index a8426cf8b438..be51783b955f 100644 --- a/sw/source/core/unocore/unoportenum.cxx +++ b/sw/source/core/unocore/unoportenum.cxx @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unorefmk.cxx b/sw/source/core/unocore/unorefmk.cxx index 6fc3873db49c..25f87488d4d5 100644 --- a/sw/source/core/unocore/unorefmk.cxx +++ b/sw/source/core/unocore/unorefmk.cxx @@ -31,10 +31,10 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index 7bcb064c8ced..c16498a51979 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include -- cgit v1.2.3 From a36e10b3749788ccfb5c79827f53af04301866e1 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 5 Jan 2010 16:37:43 +0100 Subject: swunolocking1: #i105557#: unoobj.hxx: split out unobookmark.hxx: move SwXBookmark, SwXFieldmark from unoobj.hxx to new unobookmark.hxx. --- sw/inc/unobookmark.hxx | 248 +++++++++++++++++++++++++++++++++ sw/inc/unoobj.hxx | 113 +-------------- sw/source/core/crsr/bookmrk.cxx | 2 +- sw/source/core/unocore/unobkm.cxx | 18 ++- sw/source/core/unocore/unocoll.cxx | 1 + sw/source/core/unocore/unoportenum.cxx | 1 + sw/source/core/unocore/unotext.cxx | 1 + sw/source/ui/uno/unotxvw.cxx | 1 + 8 files changed, 270 insertions(+), 115 deletions(-) create mode 100644 sw/inc/unobookmark.hxx diff --git a/sw/inc/unobookmark.hxx b/sw/inc/unobookmark.hxx new file mode 100644 index 000000000000..2b16d7828001 --- /dev/null +++ b/sw/inc/unobookmark.hxx @@ -0,0 +1,248 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: unoobj.hxx,v $ + * + * $Revision: 1.49 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SW_UNOBOOKMARK_HXX +#define SW_UNOBOOKMARK_HXX + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include +#include + + +class SwDoc; + + +typedef ::cppu::ImplInheritanceHelper5 +< ::sfx2::MetadatableMixin +, ::com::sun::star::lang::XUnoTunnel +, ::com::sun::star::lang::XServiceInfo +, ::com::sun::star::beans::XPropertySet +, ::com::sun::star::container::XNamed +, ::com::sun::star::text::XTextContent +> SwXBookmark_Base; + +class SwXBookmark + : public SwXBookmark_Base + , private SwClient +{ + +private: + + SwEventListenerContainer m_aLstnrCntnr; + SwDoc* m_pDoc; + String m_aName; + ::sw::mark::IMark* m_pRegisteredBookmark; + + void registerInMark(::sw::mark::IMark* const pBkmk); + +protected: + + virtual ~SwXBookmark(); + +public: + + SwXBookmark(::sw::mark::IMark* pMark = 0, SwDoc* pDoc = 0); + + const ::sw::mark::IMark* GetBookmark() const + { return m_pRegisteredBookmark; } + ::sw::mark::IMark* GetBookmark() + { return m_pRegisteredBookmark; } + SwDoc* GetDoc() + { return m_pDoc; } + + void attachToRangeEx( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > & xTextRange, + IDocumentMarkAccess::MarkType eType) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException ); + virtual void attachToRange( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > & xTextRange) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + + TYPEINFO(); + + // SwClient + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ); + + // MetadatableMixin + virtual ::sfx2::Metadatable* GetCoreObject(); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::frame::XModel > GetModel(); + + static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId(); + + // XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( + const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier) + throw (::com::sun::star::uno::RuntimeException); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( + const ::rtl::OUString& rServiceName) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames() + throw (::com::sun::star::uno::RuntimeException); + + // XComponent + virtual void SAL_CALL dispose() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XEventListener > & xListener) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XEventListener > & xListener) + throw (::com::sun::star::uno::RuntimeException); + + // XPropertySet + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySetInfo > SAL_CALL + getPropertySetInfo() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Any& rValue) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::beans::PropertyVetoException, + ::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( + const ::rtl::OUString& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertyChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertyChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XVetoableChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XVetoableChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + // XNamed + virtual ::rtl::OUString SAL_CALL getName() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setName(const ::rtl::OUString& rName) + throw (::com::sun::star::uno::RuntimeException); + + // XTextContent + virtual void SAL_CALL attach( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > & xTextRange) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > SAL_CALL getAnchor() + throw (::com::sun::star::uno::RuntimeException); + +}; + +typedef cppu::ImplInheritanceHelper1< SwXBookmark, + ::com::sun::star::text::XFormField > SwXFieldmark_Base; + +class SwXFieldmark + : public SwXFieldmark_Base +{ + +private: + + bool isReplacementObject; + +public: + + SwXFieldmark(bool isReplacementObject, + ::sw::mark::IMark* pBkm = 0, SwDoc* pDoc = 0); + + virtual void attachToRange( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > & xTextRange) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + + virtual ::rtl::OUString SAL_CALL getDescription() + throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int16 SAL_CALL getType() + throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Int16 SAL_CALL getRes() + throw (::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL setDescription(const ::rtl::OUString& rDescription) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setType(::sal_Int16 fieldType) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setRes(::sal_Int16 res) + throw (::com::sun::star::uno::RuntimeException); + +}; + +#endif // SW_UNOBOOKMARK_HXX + diff --git a/sw/inc/unoobj.hxx b/sw/inc/unoobj.hxx index 62cf34e1a580..74197ec9b2ba 100644 --- a/sw/inc/unoobj.hxx +++ b/sw/inc/unoobj.hxx @@ -86,12 +86,11 @@ #include "TextCursorHelper.hxx" #include #include -#include #include #include -#include +#include #include #include @@ -569,116 +568,6 @@ public: }; */ -typedef ::cppu::ImplInheritanceHelper5 -< - ::sfx2::MetadatableMixin, - ::com::sun::star::text::XTextContent, - ::com::sun::star::beans::XPropertySet, - ::com::sun::star::lang::XServiceInfo, - ::com::sun::star::container::XNamed, - ::com::sun::star::lang::XUnoTunnel -> -SwBookmarkBaseClass; - -class SwXBookmark - : public SwBookmarkBaseClass - , private SwClient -{ - private: - SwEventListenerContainer m_aLstnrCntnr; - SwDoc* m_pDoc; - String m_aName; - ::sw::mark::IMark* m_pRegisteredBookmark; - - void registerInMark(::sw::mark::IMark* const pBkmk) - { - if(pBkmk) - pBkmk->Add(this); - else if(m_pRegisteredBookmark) - { - m_aName = m_pRegisteredBookmark->GetName(); - m_pRegisteredBookmark->Remove(this); - } - m_pRegisteredBookmark = pBkmk; - } - - protected: - virtual ~SwXBookmark(); - public: - SwXBookmark(::sw::mark::IMark* pMark = 0, SwDoc* pDoc = 0); - - TYPEINFO(); - - static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); - - //XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); - - //XTextContent - virtual void SAL_CALL attach(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getAnchor( ) throw(::com::sun::star::uno::RuntimeException); - - //XComponent - virtual void SAL_CALL dispose(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); - - //XNamed - virtual rtl::OUString SAL_CALL getName(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL setName(const rtl::OUString& rName) throw( ::com::sun::star::uno::RuntimeException ); - - //XServiceInfo - virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); - - //XPropertySet - virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - - void attachToRangeEx(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange, IDocumentMarkAccess::MarkType eType) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); - virtual void attachToRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); - - //SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ); - - // MetadatableMixin - virtual ::sfx2::Metadatable* GetCoreObject(); - virtual ::com::sun::star::uno::Reference< - ::com::sun::star::frame::XModel > GetModel(); - - const ::sw::mark::IMark* GetBookmark() const - { return m_pRegisteredBookmark; } - ::sw::mark::IMark* GetBookmark() - { return m_pRegisteredBookmark; } - SwDoc* GetDoc() - { return m_pDoc; } -}; - -typedef cppu::ImplInheritanceHelper1< SwXBookmark, ::com::sun::star::text::XFormField > SwXFieldmark_BASE; - -class SwXFieldmark : public SwXFieldmark_BASE -{ - private: - bool isReplacementObject; - public: - SwXFieldmark(bool isReplacementObject, ::sw::mark::IMark* pBkm = 0, SwDoc* pDoc = 0); - - virtual void attachToRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); - virtual ::rtl::OUString SAL_CALL getDescription(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::sal_Int16 SAL_CALL getType( ) throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Int16 SAL_CALL getRes( ) throw (::com::sun::star::uno::RuntimeException); - - virtual void SAL_CALL setType( ::sal_Int16 fieldType ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setRes( ::sal_Int16 res ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setDescription( const ::rtl::OUString& description ) throw (::com::sun::star::uno::RuntimeException); -}; - /*-----------------23.02.98 10:45------------------- --------------------------------------------------*/ diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx index 3cdfa7ec03e4..1028c7b2b432 100644 --- a/sw/source/core/crsr/bookmrk.cxx +++ b/sw/source/core/crsr/bookmrk.cxx @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include diff --git a/sw/source/core/unocore/unobkm.cxx b/sw/source/core/unocore/unobkm.cxx index 0a9528823689..da9568603b01 100644 --- a/sw/source/core/unocore/unobkm.cxx +++ b/sw/source/core/unocore/unobkm.cxx @@ -31,7 +31,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - +#include #include #include #include @@ -74,6 +74,20 @@ namespace ******************************************************************/ TYPEINIT1(SwXBookmark, SwClient) +void SwXBookmark::registerInMark(::sw::mark::IMark* const pBkmk) +{ + if (pBkmk) + { + pBkmk->Add(this); + } + else if (m_pRegisteredBookmark) + { + m_aName = m_pRegisteredBookmark->GetName(); + m_pRegisteredBookmark->Remove(this); + } + m_pRegisteredBookmark = pBkmk; +} + const uno::Sequence< sal_Int8 > & SwXBookmark::getUnoTunnelId() { static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId(); @@ -353,7 +367,7 @@ void SwXBookmark::removeVetoableChangeListener(const OUString& /*PropertyName*/, { } SwXFieldmark::SwXFieldmark(bool _isReplacementObject, ::sw::mark::IMark* pBkm, SwDoc* pDc) - : SwXFieldmark_BASE(pBkm, pDc) + : SwXFieldmark_Base(pBkm, pDc) , isReplacementObject(_isReplacementObject) { } diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx index d7315e42383d..cc9c3d34050a 100644 --- a/sw/source/core/unocore/unocoll.cxx +++ b/sw/source/core/unocore/unocoll.cxx @@ -75,6 +75,7 @@ #include #include +#include #include #include #include "docsh.hxx" diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx index be51783b955f..ad3e52cff75b 100644 --- a/sw/source/core/unocore/unoportenum.cxx +++ b/sw/source/core/unocore/unoportenum.cxx @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index c16498a51979..bbb371d66974 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx index 6197bb489d61..6ed41d64c7a6 100644 --- a/sw/source/ui/uno/unotxvw.cxx +++ b/sw/source/ui/uno/unotxvw.cxx @@ -77,6 +77,7 @@ #include #include #include +#include #include #include -- cgit v1.2.3 From af7ef16cd1dd50610a5d89798a3ef68aa43de922 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 5 Jan 2010 16:37:44 +0100 Subject: swunolocking1: #i105557#: unoobj.hxx: split out unoparagraph.hxx: move SwXParagraph{,Enumeration} from unoobj.hxx to new unoparagraph.hxx. move enum CursorType to unobaseclass.hxx. --- sw/inc/unobaseclass.hxx | 21 ++ sw/inc/unoobj.hxx | 201 --------------- sw/inc/unoparagraph.hxx | 439 ++++++++++++++++++++++++++++++++ sw/source/core/txtnode/ndtxt.cxx | 1 + sw/source/core/unocore/unobkm.cxx | 2 + sw/source/core/unocore/unocoll.cxx | 1 + sw/source/core/unocore/unodraw.cxx | 1 + sw/source/core/unocore/unoframe.cxx | 1 + sw/source/core/unocore/unoftn.cxx | 1 + sw/source/core/unocore/unoidx.cxx | 6 +- sw/source/core/unocore/unoobj2.cxx | 1 + sw/source/core/unocore/unoparagraph.cxx | 1 + sw/source/core/unocore/unoredline.cxx | 2 + sw/source/core/unocore/unorefmk.cxx | 1 + sw/source/core/unocore/unosect.cxx | 9 +- sw/source/core/unocore/unotbl.cxx | 7 +- sw/source/core/unocore/unotext.cxx | 3 + sw/source/ui/uno/unotxvw.cxx | 1 + 18 files changed, 484 insertions(+), 215 deletions(-) create mode 100644 sw/inc/unoparagraph.hxx diff --git a/sw/inc/unobaseclass.hxx b/sw/inc/unobaseclass.hxx index 17b6e6f5d080..adb7b880356a 100644 --- a/sw/inc/unobaseclass.hxx +++ b/sw/inc/unobaseclass.hxx @@ -43,5 +43,26 @@ cppu::WeakImplHelper2 > SwSimpleEnumerationBaseClass; + +/* -----------------29.04.98 07:35------------------- + * + * --------------------------------------------------*/ +enum CursorType +{ + CURSOR_INVALID, + CURSOR_BODY, + CURSOR_FRAME, + CURSOR_TBLTEXT, + CURSOR_FOOTNOTE, + CURSOR_HEADER, + CURSOR_FOOTER, + CURSOR_REDLINE, + CURSOR_ALL, // for Search&Replace + CURSOR_SELECTION, // create a paragraph enumeration from + // a text range or cursor + CURSOR_SELECTION_IN_TABLE, + CURSOR_META, // meta/meta-field +}; + #endif diff --git a/sw/inc/unoobj.hxx b/sw/inc/unoobj.hxx index 74197ec9b2ba..54e652fc6816 100644 --- a/sw/inc/unoobj.hxx +++ b/sw/inc/unoobj.hxx @@ -61,7 +61,6 @@ #include #include #include -#include #include #include #include @@ -91,7 +90,6 @@ #include #include -#include #include #include @@ -115,25 +113,6 @@ typedef ::std::deque< FrameDependSortListEntry > typedef ::std::deque< ::boost::shared_ptr > FrameDependList_t; -/* -----------------29.04.98 07:35------------------- - * - * --------------------------------------------------*/ -enum CursorType -{ - CURSOR_INVALID, - CURSOR_BODY, - CURSOR_FRAME, - CURSOR_TBLTEXT, - CURSOR_FOOTNOTE, - CURSOR_HEADER, - CURSOR_FOOTER, - CURSOR_REDLINE, - CURSOR_ALL, // fuer Search&Replace - CURSOR_SELECTION, // create a paragraph enumeration from a text range or cursor - CURSOR_SELECTION_IN_TABLE, - CURSOR_META, // meta/meta-field -}; - /* -----------------26.06.98 16:18------------------- * @@ -993,186 +972,6 @@ public: void Invalidate(); }; -/*-----------------07.04.98 08:10------------------- - ---------------------------------------------------*/ -class SwXParagraphEnumeration : public SwSimpleEnumerationBaseClass, - public SwClient -{ - ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParentText; - ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > xNextPara; - - const SwTable * pOwnTable; - const SwStartNode * pOwnStartNode; // start node of the cell the enumeration - // belongs to. - // Used to restrict the movement of the - // UNO cursor to the cell and its - // embedded tables. - sal_Int32 nFirstParaStart; - sal_Int32 nLastParaEnd; - ULONG nEndIndex; - CursorType eCursorType; - BOOL bFirstParagraph; - - SwUnoCrsr* GetCrsr(){return (SwUnoCrsr*)GetRegisteredIn();} - -protected: - virtual ~SwXParagraphEnumeration(); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > SAL_CALL NextElement_Impl(void) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); - -public: - SwXParagraphEnumeration(SwXText* pParent, SwPosition& rPos, CursorType eType); - SwXParagraphEnumeration(SwXText* pParent, SwUnoCrsr* pCrsr, CursorType eType); - - - - //XEnumeration - virtual BOOL SAL_CALL hasMoreElements(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Any SAL_CALL nextElement(void) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); - - //XServiceInfo - virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); - - //SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); - - //non-Uno functions - - void SetOwnTable( const SwTable* pTable ) { pOwnTable = pTable; } - const SwTable* GetOwnTable() const { return pOwnTable; } - void SetOwnStartNode( const SwStartNode* pNode ) { pOwnStartNode = pNode; } - const SwStartNode* GetOwnStartNode() const { return pOwnStartNode; } -}; -/*-----------------07.04.98 08:15------------------- - ---------------------------------------------------*/ -class SwXParagraph : public cppu::ImplInheritanceHelper10 -< - ::sfx2::MetadatableMixin, - ::com::sun::star::beans::XTolerantMultiPropertySet, - ::com::sun::star::beans::XMultiPropertySet, - ::com::sun::star::text::XTextRange, - ::com::sun::star::beans::XPropertySet, - ::com::sun::star::lang::XServiceInfo, - ::com::sun::star::lang::XUnoTunnel, - ::com::sun::star::beans::XPropertyState, - ::com::sun::star::container::XEnumerationAccess, - ::com::sun::star::text::XTextContent, - ::com::sun::star::container::XContentEnumerationAccess ->, - public SwClient -{ - ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParentText; - SwEventListenerContainer aLstnrCntnr; - const SfxItemPropertySet* m_pPropSet; - rtl::OUString m_sText; - sal_Int32 nSelectionStartPos; - sal_Int32 nSelectionEndPos; - BOOL m_bIsDescriptor; - - -protected: - void SAL_CALL SetPropertyValues_Impl( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL GetPropertyValues_Impl( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - - ::com::sun::star::uno::Sequence< ::com::sun::star::beans::GetDirectPropertyTolerantResult > SAL_CALL GetPropertyValuesTolerant_Impl( - const ::com::sun::star::uno::Sequence< rtl::OUString >& rPropertyNames, - sal_Bool bDirectValuesOnly ) throw (::com::sun::star::uno::RuntimeException); - - virtual ~SwXParagraph(); -public: - SwXParagraph(); - SwXParagraph(::com::sun::star::uno::Reference< ::com::sun::star::text::XText > const & i_xParent, SwTxtNode * i_pTxtNode, sal_Int32 nSelStart = -1, sal_Int32 nSelEnd = - 1); - - TYPEINFO(); - - static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); - - //XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); - - //XTolerantMultiPropertySet - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::SetPropertyTolerantFailed > SAL_CALL setPropertyValuesTolerant( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::GetPropertyTolerantResult > SAL_CALL getPropertyValuesTolerant( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::GetDirectPropertyTolerantResult > SAL_CALL getDirectPropertyValuesTolerant( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::uno::RuntimeException); - - //XMultiPropertySet -// virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addPropertiesChangeListener( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removePropertiesChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL firePropertiesChangeEvent( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); - - //XPropertySet - virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - - //XPropertyState - virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - - //XTextContent - virtual void SAL_CALL attach(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getAnchor( ) throw(::com::sun::star::uno::RuntimeException); - - //XComponent - virtual void SAL_CALL dispose(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); - - //XEnumerationAccess - war XTextPortionEnumerationAccess - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration(void) throw( ::com::sun::star::uno::RuntimeException ); - - //XElementAccess - virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); - - //XTextRange - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getStart(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getEnd(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual rtl::OUString SAL_CALL getString(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL setString(const rtl::OUString& aString) throw( ::com::sun::star::uno::RuntimeException ); - - //XServiceInfo - virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); - - //XContentEnumerationAccess - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createContentEnumeration(const rtl::OUString& aServiceName) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getAvailableServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); - - //MetadatableMixin - virtual ::sfx2::Metadatable* GetCoreObject(); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > - GetModel(); - - //SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); - - BOOL IsDescriptor() const {return m_bIsDescriptor;} - - const SwTxtNode * GetTxtNode() const; - SwTxtNode * GetTxtNode(); - - static BOOL getDefaultTextContentValue(::com::sun::star::uno::Any& rAny, - const rtl::OUString& rPropertyName, USHORT nWID = 0); - static SwXParagraph* GetImplementation(::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> xRef ); - //falls es mal als Service erzeugt werden kann - //void attachToRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange)throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); - void attachToText(SwXText & rParent, SwTxtNode & rTxtNode); -}; /* -----------------23.03.99 12:57------------------- * * --------------------------------------------------*/ diff --git a/sw/inc/unoparagraph.hxx b/sw/inc/unoparagraph.hxx new file mode 100644 index 000000000000..6ef62e00c1a9 --- /dev/null +++ b/sw/inc/unoparagraph.hxx @@ -0,0 +1,439 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: unoobj.hxx,v $ + * + * $Revision: 1.49 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SW_UNOPARAGRAPH_HXX +#define SW_UNOPARAGRAPH_HXX + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include + + +class SfxItemPropertySet; +struct SwPosition; +class SwUnoCrsr; +class SwStartNode; +class SwTxtNode; +class SwTable; +class SwXText; + + +/*-----------------07.04.98 08:15------------------- + +--------------------------------------------------*/ +typedef ::cppu::ImplInheritanceHelper10 +< ::sfx2::MetadatableMixin +, ::com::sun::star::lang::XUnoTunnel +, ::com::sun::star::lang::XServiceInfo +, ::com::sun::star::beans::XPropertySet +, ::com::sun::star::beans::XPropertyState +, ::com::sun::star::beans::XMultiPropertySet +, ::com::sun::star::beans::XTolerantMultiPropertySet +, ::com::sun::star::container::XEnumerationAccess +, ::com::sun::star::container::XContentEnumerationAccess +, ::com::sun::star::text::XTextContent +, ::com::sun::star::text::XTextRange +> SwXParagraph_Base; + +class SwXParagraph + : public SwXParagraph_Base + , public SwClient +{ + +private: + + ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParentText; + SwEventListenerContainer aLstnrCntnr; + const SfxItemPropertySet* m_pPropSet; + ::rtl::OUString m_sText; + sal_Int32 nSelectionStartPos; + sal_Int32 nSelectionEndPos; + BOOL m_bIsDescriptor; + +protected: + + void SAL_CALL SetPropertyValues_Impl( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& + rPropertyNames, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Any >& rValues) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::beans::PropertyVetoException, + ::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL + GetPropertyValues_Impl( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& + rPropertyNames) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::GetDirectPropertyTolerantResult > SAL_CALL + GetPropertyValuesTolerant_Impl( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& + rPropertyNames, + sal_Bool bDirectValuesOnly) + throw (::com::sun::star::uno::RuntimeException); + + virtual ~SwXParagraph(); + +public: + + SwXParagraph(); + SwXParagraph(::com::sun::star::uno::Reference< + ::com::sun::star::text::XText > const & i_xParent, + SwTxtNode * i_pTxtNode, + sal_Int32 nSelStart = -1, sal_Int32 nSelEnd = - 1); + + BOOL IsDescriptor() const {return m_bIsDescriptor;} + + const SwTxtNode * GetTxtNode() const; + SwTxtNode * GetTxtNode(); + + static BOOL getDefaultTextContentValue(::com::sun::star::uno::Any& rAny, + const ::rtl::OUString& rPropertyName, USHORT nWID = 0); + static SwXParagraph* GetImplementation( + ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XInterface> xRef); + void attachToText(SwXText & rParent, SwTxtNode & rTxtNode); + + TYPEINFO(); + + // SwClient + virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + + // MetadatableMixin + virtual ::sfx2::Metadatable* GetCoreObject(); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > + GetModel(); + + static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId(); + + // XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( + const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier) + throw (::com::sun::star::uno::RuntimeException); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( + const ::rtl::OUString& rServiceName) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames() + throw (::com::sun::star::uno::RuntimeException); + + // XComponent + virtual void SAL_CALL dispose() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XEventListener > & xListener) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XEventListener > & xListener) + throw (::com::sun::star::uno::RuntimeException); + + // XPropertySet + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySetInfo > SAL_CALL + getPropertySetInfo() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Any& rValue) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::beans::PropertyVetoException, + ::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( + const ::rtl::OUString& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertyChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertyChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XVetoableChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XVetoableChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + // XPropertyState + virtual ::com::sun::star::beans::PropertyState SAL_CALL + getPropertyState(const ::rtl::OUString& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyState > SAL_CALL + getPropertyStates( + const ::com::sun::star::uno::Sequence< + ::rtl::OUString >& rPropertyNames) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyToDefault( + const ::rtl::OUString& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( + const ::rtl::OUString& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + // XMultiPropertySet + virtual void SAL_CALL setPropertyValues( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& + rPropertyNames, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Any >& rValues) + throw (::com::sun::star::beans::PropertyVetoException, + ::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > + SAL_CALL getPropertyValues( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& + rPropertyNames) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertiesChangeListener( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& + rPropertyNames, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertiesChangeListener >& xListener) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertiesChangeListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertiesChangeListener >& xListener) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL firePropertiesChangeEvent( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& + rPropertyNames, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertiesChangeListener >& xListener) + throw (::com::sun::star::uno::RuntimeException); + + // XTolerantMultiPropertySet + virtual ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::SetPropertyTolerantFailed > SAL_CALL + setPropertyValuesTolerant( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& + rPropertyNames, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Any >& rValues) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::GetPropertyTolerantResult > SAL_CALL + getPropertyValuesTolerant( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& + rPropertyNames) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::GetDirectPropertyTolerantResult > SAL_CALL + getDirectPropertyValuesTolerant( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& + rPropertyNames) + throw (::com::sun::star::uno::RuntimeException); + + // XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements() + throw (::com::sun::star::uno::RuntimeException); + + // XEnumerationAccess + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::container::XEnumeration > SAL_CALL + createEnumeration() + throw (::com::sun::star::uno::RuntimeException); + + // XContentEnumerationAccess + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::container::XEnumeration > SAL_CALL + createContentEnumeration(const ::rtl::OUString& rServiceName) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getAvailableServiceNames() + throw (::com::sun::star::uno::RuntimeException); + + // XTextContent + virtual void SAL_CALL attach( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > & xTextRange) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > SAL_CALL getAnchor() + throw (::com::sun::star::uno::RuntimeException); + + // XTextRange + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > + SAL_CALL getText() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > SAL_CALL getStart() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > SAL_CALL getEnd() + throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getString() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setString(const ::rtl::OUString& rString) + throw (::com::sun::star::uno::RuntimeException); + +}; + + +/*-----------------07.04.98 08:10------------------- + +--------------------------------------------------*/ +class SwXParagraphEnumeration + : public SwSimpleEnumerationBaseClass + , public SwClient +{ + +private: + + ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > + xParentText; + ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > + xNextPara; + + const SwTable * pOwnTable; + /// Start node of the cell the enumeration belongs to. + /// Used to restrict the movement of the UNO cursor to the cell and its + /// embedded tables. + const SwStartNode * pOwnStartNode; + sal_Int32 nFirstParaStart; + sal_Int32 nLastParaEnd; + ULONG nEndIndex; + CursorType eCursorType; + BOOL bFirstParagraph; + + SwUnoCrsr* GetCrsr() {return (SwUnoCrsr*)GetRegisteredIn();} + +protected: + + virtual ~SwXParagraphEnumeration(); + + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextContent > SAL_CALL + NextElement_Impl() + throw (::com::sun::star::container::NoSuchElementException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + +public: + + SwXParagraphEnumeration( + SwXText* pParent, SwPosition& rPos, CursorType eType); + SwXParagraphEnumeration( + SwXText* pParent, SwUnoCrsr* pCrsr, CursorType eType); + + // non-Uno functions + + void SetOwnTable(const SwTable* pTable) + { pOwnTable = pTable; } + const SwTable* GetOwnTable() const + { return pOwnTable; } + void SetOwnStartNode(const SwStartNode* pNode) + { pOwnStartNode = pNode; } + const SwStartNode* GetOwnStartNode() const + { return pOwnStartNode; } + + // SwClient + virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( + const ::rtl::OUString& rServiceName) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames() + throw (::com::sun::star::uno::RuntimeException); + + // XEnumeration + virtual sal_Bool SAL_CALL hasMoreElements() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL nextElement() + throw (::com::sun::star::container::NoSuchElementException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + +}; + +#endif // SW_UNOPARAGRAPH_HXX + diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index eb1f5c3e94fc..46b105723a1d 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -4972,6 +4972,7 @@ bool SwTxtNode::IsInContent() const return !GetDoc()->IsInHeaderFooter( SwNodeIndex(*this) ); } +#include #include ::com::sun::star::uno::Reference< ::com::sun::star::rdf::XMetadatable > diff --git a/sw/source/core/unocore/unobkm.cxx b/sw/source/core/unocore/unobkm.cxx index da9568603b01..0ec0442457f5 100644 --- a/sw/source/core/unocore/unobkm.cxx +++ b/sw/source/core/unocore/unobkm.cxx @@ -31,10 +31,12 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" + #include #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx index cc9c3d34050a..598e95cbf385 100644 --- a/sw/source/core/unocore/unocoll.cxx +++ b/sw/source/core/unocore/unocoll.cxx @@ -75,6 +75,7 @@ #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index 5a050eb690ed..ec978f02a0ec 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 1f9d39bca94c..87bc0ff6b173 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -61,6 +61,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unoftn.cxx b/sw/source/core/unocore/unoftn.cxx index 98ee87c2ae33..cf1b6dc516c4 100644 --- a/sw/source/core/unocore/unoftn.cxx +++ b/sw/source/core/unocore/unoftn.cxx @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index 5633ca1f0661..3e1fde6746b3 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -43,9 +43,7 @@ #include #include #include -#ifndef _CMDID_H #include -#endif #include #include #include @@ -58,18 +56,18 @@ #include #include #include +#include #include #include #include #include #include #include -#ifndef _DOCSH_HXX //autogen #include -#endif #include #include + using namespace ::com::sun::star; using ::rtl::OUString; diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index 26a237b5625a..b8435fe17166 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -78,6 +78,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx index 4fbf9a7062d1..bb7c30667ab1 100644 --- a/sw/source/core/unocore/unoparagraph.cxx +++ b/sw/source/core/unocore/unoparagraph.cxx @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unoredline.cxx b/sw/source/core/unocore/unoredline.cxx index b04a7fea1fae..80297bb64321 100644 --- a/sw/source/core/unocore/unoredline.cxx +++ b/sw/source/core/unocore/unoredline.cxx @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -50,6 +51,7 @@ #include #include + using namespace ::com::sun::star; using ::rtl::OUString; using ::rtl::OUStringBuffer; diff --git a/sw/source/core/unocore/unorefmk.cxx b/sw/source/core/unocore/unorefmk.cxx index 25f87488d4d5..45c79b5edcf5 100644 --- a/sw/source/core/unocore/unorefmk.cxx +++ b/sw/source/core/unocore/unorefmk.cxx @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx index 1308c6ad7d3e..e3c0c56908a9 100644 --- a/sw/source/core/unocore/unosect.cxx +++ b/sw/source/core/unocore/unosect.cxx @@ -38,24 +38,21 @@ #include #include #include -#ifndef _SVX_XMLCNITEM_HXX #include -#endif #include #include #include #include #include #include +#include #include #include #include #include #include #include -#ifndef _DOCSH_HXX #include -#endif #include #include #include @@ -65,13 +62,12 @@ #include #include #include -#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPPP_ #include -#endif #include /* #109700# */ #include + using namespace ::com::sun::star; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::uno; @@ -80,6 +76,7 @@ using namespace ::com::sun::star::container; using namespace ::com::sun::star::beans; using ::rtl::OUString; + TYPEINIT1(SwXTextSectionClient, SwClient); /*-- 20.12.2005 09:56:33--------------------------------------------------- diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index 20dde56ead7d..b0514f74d4ab 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -33,16 +33,12 @@ #include "precompiled_sw.hxx" - - // STL includes #include #include // for DBL_MIN #include -#ifndef _CMDID_H #include -#endif #include #include #include @@ -87,6 +83,7 @@ #include #include #include +#include #include // SvNumberFormatter #include #include @@ -103,9 +100,11 @@ #include #include + using namespace ::com::sun::star; using ::rtl::OUString; + //----------------------------------------------------------------------------- // from unoobj.cxx extern void lcl_SetTxtFmtColl(const uno::Any& rAny, SwPaM& rPaM) throw (lang::IllegalArgumentException); diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index bbb371d66974..fed9109b094e 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -53,6 +53,7 @@ #include #include #include +#include #include #include #include @@ -70,9 +71,11 @@ #include + using namespace ::com::sun::star; using ::rtl::OUString; + const sal_Char cInvalidObject[] = "this object is invalid"; /****************************************************************** * SwXText diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx index 6ed41d64c7a6..6239bc9503ea 100644 --- a/sw/source/ui/uno/unotxvw.cxx +++ b/sw/source/ui/uno/unotxvw.cxx @@ -78,6 +78,7 @@ #include #include #include +#include #include #include -- cgit v1.2.3 From a04b8cd2adec9a16a9989670160634d588a15a87 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 5 Jan 2010 16:37:44 +0100 Subject: swunolocking1: #i105557#: unoobj.hxx: split out unosection.hxx: move SwXTextSection from unoobj.hxx to new unosection.hxx. --- sw/inc/unoframe.hxx | 1 + sw/inc/unoobj.hxx | 126 ------------ sw/inc/unosection.hxx | 337 +++++++++++++++++++++++++++++++ sw/inc/unotbl.hxx | 1 + sw/source/core/unocore/unocoll.cxx | 1 + sw/source/core/unocore/unocrsrhelper.cxx | 2 + sw/source/core/unocore/unoidx.cxx | 1 + sw/source/core/unocore/unosect.cxx | 2 +- sw/source/core/unocore/unotbl.cxx | 1 + sw/source/core/unocore/unotext.cxx | 1 + sw/source/filter/xml/xmltble.cxx | 5 +- 11 files changed, 348 insertions(+), 130 deletions(-) create mode 100644 sw/inc/unosection.hxx diff --git a/sw/inc/unoframe.hxx b/sw/inc/unoframe.hxx index a02999c8ca3d..4f62430f1cc2 100644 --- a/sw/inc/unoframe.hxx +++ b/sw/inc/unoframe.hxx @@ -32,6 +32,7 @@ #include #include +#include #include #include #include diff --git a/sw/inc/unoobj.hxx b/sw/inc/unoobj.hxx index 54e652fc6816..c4e6a3035ccd 100644 --- a/sw/inc/unoobj.hxx +++ b/sw/inc/unoobj.hxx @@ -49,7 +49,6 @@ #include #include #include -#include #include #include #include @@ -58,9 +57,7 @@ #include #include #include -#include #include -#include #include #include #include @@ -77,7 +74,6 @@ #include // helper for implementations #include // helper for implementations #include // helper for implementations -#include // helper for implementations #include #include #include @@ -754,128 +750,6 @@ public: const SwUnoCrsr* GetCursor() const { return (const SwUnoCrsr*)GetRegisteredIn(); } }; -/*-----------------09.03.98 13:57------------------- - ---------------------------------------------------*/ - -class SwXTextSection; -class SwXTextSectionClient : public SwClient -{ - friend class SwXTextSection; - SwXTextSection* m_pSection; - ::com::sun::star::uno::WeakReference< ::com::sun::star::text::XTextSection > m_xReference; - //SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); - SwXTextSectionClient( - SwSectionFmt& rFmt, - SwXTextSection& rTextSection, - ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextSection > xSection ); - virtual ~SwXTextSectionClient(); - DECL_STATIC_LINK( SwXTextSectionClient, RemoveSectionClient_Impl, - SwXTextSectionClient* ); - -public: - TYPEINFO(); - ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextSection > GetXTextSection(); - - static ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextSection > - CreateXTextSection(SwSectionFmt* pFmt = 0, BOOL bIndexHeader = FALSE ); - static SwXTextSectionClient* Create( - SwXTextSection& rSection, - ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextSection > xSection, - SwSectionFmt& rFmt ); -}; - -struct SwTextSectionProperties_Impl; -class SwXTextSection : public cppu::WeakImplHelper7 -< - ::com::sun::star::text::XTextSection, - ::com::sun::star::beans::XPropertyState, - ::com::sun::star::beans::XPropertySet, - ::com::sun::star::beans::XMultiPropertySet, - ::com::sun::star::lang::XServiceInfo, - ::com::sun::star::container::XNamed, - ::com::sun::star::lang::XUnoTunnel ->/*, - public SwClient*/ -{ - friend class SwXTextSectionClient; - SwEventListenerContainer aLstnrCntnr; - const SfxItemPropertySet* m_pPropSet; - - BOOL m_bIsDescriptor; - BOOL m_bIndexHeader; - String m_sName; - SwTextSectionProperties_Impl* pProps; - SwXTextSectionClient* m_pClient; -protected: - void SAL_CALL SetPropertyValues_Impl( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL GetPropertyValues_Impl( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - - SwXTextSection(sal_Bool bWithFormat, sal_Bool bIndexHeader = FALSE); - virtual ~SwXTextSection(); - void ResetClient() {m_pClient = 0;} - void SetClient( SwXTextSectionClient* pClient ){m_pClient = pClient;} - -public: - static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); - - //XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); - - //XTextSection - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextSection > SAL_CALL getParentSection(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextSection > > SAL_CALL getChildSections(void) throw( ::com::sun::star::uno::RuntimeException ); - - //XTextContent - virtual void SAL_CALL attach(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getAnchor( ) throw(::com::sun::star::uno::RuntimeException); - - //XComponent - virtual void SAL_CALL dispose(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); - - //XMultiPropertySet -// virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addPropertiesChangeListener( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removePropertiesChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL firePropertiesChangeEvent( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); - - //XPropertySet - virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - - //XPropertyState - virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - - //XNamed - virtual rtl::OUString SAL_CALL getName(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL setName(const rtl::OUString& Name_) throw( ::com::sun::star::uno::RuntimeException ); - - //XServiceInfo - virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); - - //SwClient -// virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); - - void attachToRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange)throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); - - SwSectionFmt* GetFmt()const; - static SwXTextSection* GetImplementation(::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> xRef ); -}; /*-----------------12.02.98 08:01------------------- --------------------------------------------------*/ diff --git a/sw/inc/unosection.hxx b/sw/inc/unosection.hxx new file mode 100644 index 000000000000..31d15d7010d4 --- /dev/null +++ b/sw/inc/unosection.hxx @@ -0,0 +1,337 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: unoobj.hxx,v $ + * + * $Revision: 1.49 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SW_UNOSECTION_HXX +#define SW_UNOSECTION_HXX + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include +#include + + +class SfxItemPropertySet; +class SwSectionFmt; + + +/*-----------------09.03.98 13:57------------------- + +--------------------------------------------------*/ + +class SwXTextSection; + +class SwXTextSectionClient + : public SwClient +{ + +private: + + friend class SwXTextSection; + + SwXTextSection * m_pSection; + ::com::sun::star::uno::WeakReference< + ::com::sun::star::text::XTextSection > m_xReference; + + // SwClient + virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + + SwXTextSectionClient( + SwSectionFmt& rFmt, + SwXTextSection& rTextSection, + ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextSection > xSection); + + virtual ~SwXTextSectionClient(); + + DECL_STATIC_LINK( SwXTextSectionClient, RemoveSectionClient_Impl, + SwXTextSectionClient* ); + +public: + + TYPEINFO(); + + ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextSection > + GetXTextSection(); + + static ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextSection > + CreateXTextSection(SwSectionFmt* pFmt = 0, BOOL bIndexHeader = FALSE); + static SwXTextSectionClient* Create( + SwXTextSection& rSection, + ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextSection > xSection, + SwSectionFmt& rFmt); +}; + + +struct SwTextSectionProperties_Impl; + +typedef ::cppu::WeakImplHelper7 +< ::com::sun::star::lang::XUnoTunnel +, ::com::sun::star::lang::XServiceInfo +, ::com::sun::star::beans::XPropertySet +, ::com::sun::star::beans::XPropertyState +, ::com::sun::star::beans::XMultiPropertySet +, ::com::sun::star::container::XNamed +, ::com::sun::star::text::XTextSection +> SwXTextSection_Base; + +class SwXTextSection + : public SwXTextSection_Base +{ + +private: + + friend class SwXTextSectionClient; + + SwEventListenerContainer aLstnrCntnr; + const SfxItemPropertySet* m_pPropSet; + + BOOL m_bIsDescriptor; + BOOL m_bIndexHeader; + String m_sName; + SwTextSectionProperties_Impl* pProps; + SwXTextSectionClient* m_pClient; + +protected: + + void SAL_CALL SetPropertyValues_Impl( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& + rPropertyNames, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Any >& aValues) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::beans::PropertyVetoException, + ::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL + GetPropertyValues_Impl( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& + rPropertyNames) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + SwXTextSection(sal_Bool bWithFormat, sal_Bool bIndexHeader = FALSE); + + virtual ~SwXTextSection(); + + void ResetClient() { m_pClient = 0; } + void SetClient(SwXTextSectionClient* pClient) { m_pClient = pClient; } + +public: + + void attachToRange( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > & xTextRange) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + + SwSectionFmt* GetFmt() const; + + static SwXTextSection* GetImplementation( + ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XInterface> xRef); + + static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId(); + + // XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( + const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier) + throw (::com::sun::star::uno::RuntimeException); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( + const ::rtl::OUString& rServiceName) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames() + throw (::com::sun::star::uno::RuntimeException); + + // XComponent + virtual void SAL_CALL dispose() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XEventListener > & xListener) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XEventListener > & xListener) + throw (::com::sun::star::uno::RuntimeException); + + // XPropertySet + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySetInfo > SAL_CALL + getPropertySetInfo() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Any& rValue) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::beans::PropertyVetoException, + ::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( + const ::rtl::OUString& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertyChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertyChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XVetoableChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XVetoableChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + // XPropertyState + virtual ::com::sun::star::beans::PropertyState SAL_CALL + getPropertyState(const ::rtl::OUString& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyState > SAL_CALL + getPropertyStates( + const ::com::sun::star::uno::Sequence< + ::rtl::OUString >& rPropertyNames) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyToDefault( + const ::rtl::OUString& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( + const ::rtl::OUString& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + // XMultiPropertySet + virtual void SAL_CALL setPropertyValues( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& + rPropertyNames, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Any >& rValues) + throw (::com::sun::star::beans::PropertyVetoException, + ::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > + SAL_CALL getPropertyValues( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& + rPropertyNames) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertiesChangeListener( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& + rPropertyNames, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertiesChangeListener >& xListener) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertiesChangeListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertiesChangeListener >& xListener) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL firePropertiesChangeEvent( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& + rPropertyNames, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertiesChangeListener >& xListener) + throw (::com::sun::star::uno::RuntimeException); + + // XNamed + virtual ::rtl::OUString SAL_CALL getName() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setName(const ::rtl::OUString& rName) + throw (::com::sun::star::uno::RuntimeException); + + // XTextContent + virtual void SAL_CALL attach( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > & xTextRange) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > SAL_CALL getAnchor() + throw (::com::sun::star::uno::RuntimeException); + + // XTextSection + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextSection > SAL_CALL + getParentSection() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextSection > > SAL_CALL + getChildSections() + throw (::com::sun::star::uno::RuntimeException); + +}; + +#endif // SW_UNOSECTION_HXX + diff --git a/sw/inc/unotbl.hxx b/sw/inc/unotbl.hxx index a8ca07bb0f34..7e28a5a2d116 100644 --- a/sw/inc/unotbl.hxx +++ b/sw/inc/unotbl.hxx @@ -31,6 +31,7 @@ #define _UNOTBL_HXX #include +#include #include #include #include diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx index 598e95cbf385..9cec70fa8a2f 100644 --- a/sw/source/core/unocore/unocoll.cxx +++ b/sw/source/core/unocore/unocoll.cxx @@ -75,6 +75,7 @@ #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index de893c8fe76a..a5fcf29f8b64 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -32,6 +32,8 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" +#include + #include #include #include diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index 3e1fde6746b3..a90bdc28bdab 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -31,6 +31,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" +#include #include #include diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx index e3c0c56908a9..c7d53042ee62 100644 --- a/sw/source/core/unocore/unosect.cxx +++ b/sw/source/core/unocore/unosect.cxx @@ -31,7 +31,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - #include #include @@ -45,6 +44,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index b0514f74d4ab..ab9006d5fae4 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -69,6 +69,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index fed9109b094e..f7ae2ebcde95 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx index 360f8349142e..b80a8f15eda8 100644 --- a/sw/source/filter/xml/xmltble.cxx +++ b/sw/source/filter/xml/xmltble.cxx @@ -31,10 +31,11 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" +#include +#include #include #include -#include #include #include #include @@ -44,9 +45,7 @@ #include #include #include -#ifndef _SVX_FRAMEDIRITEM_HXX #include -#endif #include #include "swtable.hxx" -- cgit v1.2.3 From 3d404991d52a130cf2144bcf3aec2ea52859d31f Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 5 Jan 2010 16:37:45 +0100 Subject: swunolocking1: #i105557#: unoobj.hxx: split out unotextcursor.hxx: move SwXTextCursor from unoobj.hxx to new unotextcursor.hxx. move enum SwGetPropertyStatesCaller to unotextcursor.hxx. --- sw/inc/unoobj.hxx | 222 +----------- sw/inc/unotbl.hxx | 5 + sw/inc/unotextcursor.hxx | 461 ++++++++++++++++++++++++ sw/source/core/access/accpara.cxx | 3 +- sw/source/core/edit/editsh.cxx | 2 +- sw/source/core/unocore/unobkm.cxx | 1 + sw/source/core/unocore/unocrsrhelper.cxx | 1 + sw/source/core/unocore/unodraw.cxx | 1 + sw/source/core/unocore/unofield.cxx | 1 + sw/source/core/unocore/unoframe.cxx | 1 + sw/source/core/unocore/unoftn.cxx | 1 + sw/source/core/unocore/unoidx.cxx | 1 + sw/source/core/unocore/unoobj.cxx | 2 + sw/source/core/unocore/unoobj2.cxx | 2 + sw/source/core/unocore/unoparagraph.cxx | 1 + sw/source/core/unocore/unoport.cxx | 1 + sw/source/core/unocore/unoportenum.cxx | 1 + sw/source/core/unocore/unoredline.cxx | 1 + sw/source/core/unocore/unorefmk.cxx | 1 + sw/source/core/unocore/unosect.cxx | 1 + sw/source/core/unocore/unotbl.cxx | 2 + sw/source/core/unocore/unotext.cxx | 1 + sw/source/filter/xml/XMLRedlineImportHelper.cxx | 1 + sw/source/filter/xml/xmlimp.cxx | 5 +- sw/source/filter/xml/xmltexti.cxx | 1 + sw/source/ui/uno/unoatxt.cxx | 5 +- sw/source/ui/uno/unotxdoc.cxx | 1 + sw/source/ui/uno/unotxvw.cxx | 1 + sw/source/ui/utlui/unotools.cxx | 3 +- 29 files changed, 499 insertions(+), 231 deletions(-) create mode 100644 sw/inc/unotextcursor.hxx diff --git a/sw/inc/unoobj.hxx b/sw/inc/unoobj.hxx index c4e6a3035ccd..98bee1bf0e93 100644 --- a/sw/inc/unoobj.hxx +++ b/sw/inc/unoobj.hxx @@ -42,24 +42,16 @@ #include #include #include -#include -#include -#include -#include -#include -#include #include #include #include #include #include -#include #include #include #include #include #include -#include #include #include #include @@ -77,13 +69,9 @@ #include #include #include -#include // helper for implementations -#include "TextCursorHelper.hxx" -#include #include #include -#include #include @@ -169,8 +157,8 @@ void ClientModify(SwClient* pClient, SfxPoolItem *pOld, SfxPoolItem *pNew); /* -----------------03.12.98 12:22------------------- * * --------------------------------------------------*/ +class OTextCursorHelper; class SwXTextRange; -class SwXTextCursor; class SwXText : public ::com::sun::star::lang::XTypeProvider, public ::com::sun::star::text::XTextRangeCompare, public ::com::sun::star::text::XRelativeTextContentInsert, @@ -285,214 +273,6 @@ public: CursorType GetTextType() {return eCrsrType;} }; -/* -----------------03.12.98 12:16------------------- - * - * --------------------------------------------------*/ -enum SwGetPropertyStatesCaller -{ - SW_PROPERTY_STATE_CALLER_DEFAULT, - SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION, - SW_PROPERTY_STATE_CALLER_SINGLE_VALUE_ONLY, - SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION_TOLERANT -}; -#define CRSR_ATTR_MODE_TABLE 1 //attributes should be applied to a table selection -#define CRSR_ATTR_MODE_DONTREPLACE 2 //attributes should be added, not replaced - -typedef cppu::WeakImplHelper12< - ::com::sun::star::text::XSentenceCursor, - ::com::sun::star::text::XWordCursor, - ::com::sun::star::text::XParagraphCursor, - ::com::sun::star::text::XRedline, - ::com::sun::star::beans::XPropertySet, - ::com::sun::star::beans::XPropertyState, - ::com::sun::star::document::XDocumentInsertable, - ::com::sun::star::lang::XServiceInfo, - ::com::sun::star::util::XSortable, - ::com::sun::star::container::XContentEnumerationAccess, - ::com::sun::star::container::XEnumerationAccess, - ::com::sun::star::beans::XMultiPropertyStates - > SwXTextCursor_Base; -class SwXTextCursor : public SwXTextCursor_Base, - public SwClient, - public OTextCursorHelper -{ - SwEventListenerContainer aLstnrCntnr; - const SfxItemPropertySet* m_pPropSet; - ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParentText; - SwSortOptions* pLastSortOptions; - - CursorType eType; - - // --> FME 2006-03-07 #126177# We need to track if the RemoveCursor_Impl - // user event has been posted. In this case we have to remove the user - // event in ~SwXTextCursor(). - ULONG mnUserEventId; - bool mbRemoveUserEvent; - // <-- - - DECL_STATIC_LINK( SwXTextCursor, RemoveCursor_Impl, - ::com::sun::star::uno::Reference< - ::com::sun::star::uno::XInterface>* ); - -protected: - virtual ~SwXTextCursor(); -public: - void DeleteAndInsert(const String& rText, const bool bForceExpandHints); - SwXTextCursor(::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParent, const SwPosition& rPos, - CursorType eSet, SwDoc* pDoc, const SwPosition* pMark = 0); - SwXTextCursor(::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParent, SwUnoCrsr* pSourceCrsr, CursorType eSet = CURSOR_ALL); - - static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); - - DECLARE_XINTERFACE() - - //XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); - - //XTextCursor - neu - virtual void SAL_CALL collapseToStart( ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL collapseToEnd( ) throw(::com::sun::star::uno::RuntimeException); - virtual BOOL SAL_CALL isCollapsed( ) throw(::com::sun::star::uno::RuntimeException); - virtual BOOL SAL_CALL goLeft( sal_Int16 nCount, BOOL bExpand ) throw(::com::sun::star::uno::RuntimeException); - virtual BOOL SAL_CALL goRight( sal_Int16 nCount, BOOL bExpand ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL gotoStart( BOOL bExpand ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL gotoEnd( BOOL bExpand ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL gotoRange( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xRange, BOOL bExpand ) throw(::com::sun::star::uno::RuntimeException); - - //XWordCursor - neu - virtual BOOL SAL_CALL isStartOfWord( ) throw(::com::sun::star::uno::RuntimeException); - virtual BOOL SAL_CALL isEndOfWord( ) throw(::com::sun::star::uno::RuntimeException); - virtual BOOL SAL_CALL gotoNextWord( BOOL bExpand ) throw(::com::sun::star::uno::RuntimeException); - virtual BOOL SAL_CALL gotoPreviousWord( BOOL bExpand ) throw(::com::sun::star::uno::RuntimeException); - virtual BOOL SAL_CALL gotoEndOfWord( BOOL bExpand ) throw(::com::sun::star::uno::RuntimeException); - virtual BOOL SAL_CALL gotoStartOfWord( BOOL bExpand ) throw(::com::sun::star::uno::RuntimeException); - - //XSentenceCursor - neu - virtual BOOL SAL_CALL isStartOfSentence( ) throw(::com::sun::star::uno::RuntimeException); - virtual BOOL SAL_CALL isEndOfSentence( ) throw(::com::sun::star::uno::RuntimeException); - virtual BOOL SAL_CALL gotoNextSentence( BOOL Expand ) throw(::com::sun::star::uno::RuntimeException); - virtual BOOL SAL_CALL gotoPreviousSentence( BOOL Expand ) throw(::com::sun::star::uno::RuntimeException); - virtual BOOL SAL_CALL gotoStartOfSentence( BOOL Expand ) throw(::com::sun::star::uno::RuntimeException); - virtual BOOL SAL_CALL gotoEndOfSentence( BOOL Expand ) throw(::com::sun::star::uno::RuntimeException); - - //ParagraphCursor - neu - virtual BOOL SAL_CALL isStartOfParagraph(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual BOOL SAL_CALL isEndOfParagraph(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual BOOL SAL_CALL gotoStartOfParagraph(BOOL Expand) throw( ::com::sun::star::uno::RuntimeException ); - virtual BOOL SAL_CALL gotoEndOfParagraph(BOOL Expand) throw( ::com::sun::star::uno::RuntimeException ); - virtual BOOL SAL_CALL gotoNextParagraph(BOOL Expand) throw( ::com::sun::star::uno::RuntimeException ); - virtual BOOL SAL_CALL gotoPreviousParagraph(BOOL Expand) throw( ::com::sun::star::uno::RuntimeException ); - - //XRedline - virtual void SAL_CALL makeRedline( const ::rtl::OUString& RedlineType, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& RedlineProperties ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - - //XTextRange - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getStart(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getEnd(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual rtl::OUString SAL_CALL getString(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL setString(const rtl::OUString& aString) throw( ::com::sun::star::uno::RuntimeException ); - - //XPropertySet - virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - - //XPropertyState - virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - - static void SetPropertyValue( - SwPaM& rPaM, - const SfxItemPropertySet& rPropSet, - const rtl::OUString& rPropertyName, - const ::com::sun::star::uno::Any& aValue, - USHORT nAttrMode = 0) - throw(::com::sun::star::beans::UnknownPropertyException, - ::com::sun::star::beans::PropertyVetoException, - ::com::sun::star::lang::IllegalArgumentException, - ::com::sun::star::lang::WrappedTargetException, - ::com::sun::star::uno::RuntimeException); - static ::com::sun::star::uno::Any GetPropertyValue( SwPaM& rPaM, const SfxItemPropertySet& rPropSet, const ::rtl::OUString& rPropertyName) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - static ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > GetPropertyStates( SwPaM& rPaM, const SfxItemPropertySet& rPropSet, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& PropertyNames, SwGetPropertyStatesCaller eCaller = SW_PROPERTY_STATE_CALLER_DEFAULT) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - static ::com::sun::star::beans::PropertyState GetPropertyState( SwPaM& rPaM, const SfxItemPropertySet& rPropSet, const ::rtl::OUString& rPropertyName) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - static void SetPropertyToDefault( SwPaM& rPaM, const SfxItemPropertySet& rPropSet, const rtl::OUString& rPropertyName) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - static ::com::sun::star::uno::Any GetPropertyDefault( SwPaM& rPaM, const SfxItemPropertySet& rPropSet, const ::rtl::OUString& rPropertyName) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - - //XDocumentInsertable - neu - virtual void SAL_CALL insertDocumentFromURL(const rtl::OUString& rURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aOptions) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException ); - - //XSortable - neu - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL createSortDescriptor(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL sort(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& xDescriptor) throw( ::com::sun::star::uno::RuntimeException ); - - //XContentEnumerationAccess - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createContentEnumeration(const rtl::OUString& aServiceName) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getAvailableServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); - - //XEnumerationAccess - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration(void) throw( ::com::sun::star::uno::RuntimeException ); - - //XElementAccess - virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); - - //XServiceInfo - virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); - - //XMultiPropertyStates - //virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setAllPropertiesToDefault( ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPropertiesToDefault( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyDefaults( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - - - //SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); - - virtual const SwPaM* GetPaM() const; - virtual SwPaM* GetPaM(); - virtual const SwDoc* GetDoc() const; - virtual SwDoc* GetDoc(); - SwUnoCrsr* GetCrsr(){return (SwUnoCrsr*)GetRegisteredIn();} - const SwUnoCrsr* GetCrsr()const{return (SwUnoCrsr*)GetRegisteredIn();} - - static void SetCrsrAttr(SwPaM& rPam, const SfxItemSet& rSet, USHORT nAttrMode ); - // --> OD 2006-07-12 #i63870# - // split third parameter into new parameters - // and to get better control about resulting -// static void GetCrsrAttr(SwPaM& rPam, SfxItemSet& rSet, BOOL bCurrentAttrOnly = FALSE); - static void GetCrsrAttr( SwPaM& rPam, - SfxItemSet& rSet, - BOOL bOnlyTxtAttr = FALSE, - BOOL bGetFromChrFmt = TRUE ); - // <-- - static void getTextFromPam(SwPaM& aCrsr, rtl::OUString& rBuffer); - static SwFmtColl* GetCurTxtFmtColl(SwPaM& rPam, BOOL bConditional); - - static void SelectPam(SwPaM& rCrsr, sal_Bool bExpand); - static void SetString(SwCursor& rCrsr, const rtl::OUString& rString); - - static ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > - createSortDescriptor(sal_Bool bFromTable); - static sal_Bool convertSortProperties( - const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& rDescriptor, - SwSortOptions& rSortOpt); - - // --> FME 2006-03-07 #126177# - void DoNotRemoveUserEvent() { mbRemoveUserEvent = false; } - // <-- - - bool IsAtEndOfMeta() const; -}; /*-----------------20.03.98 07:47------------------- --------------------------------------------------*/ diff --git a/sw/inc/unotbl.hxx b/sw/inc/unotbl.hxx index 7e28a5a2d116..fa82f1b63aa3 100644 --- a/sw/inc/unotbl.hxx +++ b/sw/inc/unotbl.hxx @@ -32,6 +32,7 @@ #include #include +#include #include #include #include @@ -44,6 +45,10 @@ #include // helper for implementations #include // helper for implementations +#include +#include + + class SwTableBoxFmt; class SwTableLine; class SwTableCursor; diff --git a/sw/inc/unotextcursor.hxx b/sw/inc/unotextcursor.hxx new file mode 100644 index 000000000000..ce91bd295267 --- /dev/null +++ b/sw/inc/unotextcursor.hxx @@ -0,0 +1,461 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: unoobj.hxx,v $ + * + * $Revision: 1.49 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SW_UNOTEXTCURSOR_HXX +#define SW_UNOTEXTCURSOR_HXX + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include +#include +#include +#include + + +class SfxItemSet; +class SfxItemPropertySet; +class SwDoc; +struct SwPosition; +class SwCursor; +class SwUnoCrsr; +class SwFmtColl; +struct SwSortOptions; + + +/* -----------------03.12.98 12:16------------------- + * + * --------------------------------------------------*/ +enum SwGetPropertyStatesCaller +{ + SW_PROPERTY_STATE_CALLER_DEFAULT, + SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION, + SW_PROPERTY_STATE_CALLER_SINGLE_VALUE_ONLY, + SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION_TOLERANT +}; + +/// attributes should be applied to a table selection +#define CRSR_ATTR_MODE_TABLE 1 +/// attributes should be added, not replaced +#define CRSR_ATTR_MODE_DONTREPLACE 2 + +typedef ::cppu::WeakImplHelper12 +< ::com::sun::star::lang::XServiceInfo +, ::com::sun::star::beans::XPropertySet +, ::com::sun::star::beans::XPropertyState +, ::com::sun::star::beans::XMultiPropertyStates +, ::com::sun::star::container::XEnumerationAccess +, ::com::sun::star::container::XContentEnumerationAccess +, ::com::sun::star::util::XSortable +, ::com::sun::star::document::XDocumentInsertable +, ::com::sun::star::text::XSentenceCursor +, ::com::sun::star::text::XWordCursor +, ::com::sun::star::text::XParagraphCursor +, ::com::sun::star::text::XRedline +> SwXTextCursor_Base; + +class SwXTextCursor + : public SwXTextCursor_Base + , public SwClient + , public OTextCursorHelper +{ + +private: + + SwEventListenerContainer aLstnrCntnr; + const SfxItemPropertySet* m_pPropSet; + ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParentText; + SwSortOptions* pLastSortOptions; + + CursorType eType; + + // --> FME 2006-03-07 #126177# We need to track if the RemoveCursor_Impl + // user event has been posted. In this case we have to remove the user + // event in ~SwXTextCursor(). + ULONG mnUserEventId; + bool mbRemoveUserEvent; + // <-- + + DECL_STATIC_LINK(SwXTextCursor, RemoveCursor_Impl, + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>*); + +protected: + + virtual ~SwXTextCursor(); + +public: + + SwXTextCursor( + ::com::sun::star::uno::Reference< + ::com::sun::star::text::XText > xParent, + const SwPosition& rPos, + CursorType eSet, SwDoc* pDoc, const SwPosition* pMark = 0); + SwXTextCursor( + ::com::sun::star::uno::Reference< + ::com::sun::star::text::XText > xParent, + SwUnoCrsr* pSourceCrsr, CursorType eSet = CURSOR_ALL); + + SwUnoCrsr* GetCrsr() {return (SwUnoCrsr*)GetRegisteredIn();} + const SwUnoCrsr* GetCrsr() const {return (SwUnoCrsr*)GetRegisteredIn();} + + // --> FME 2006-03-07 #126177# + void DoNotRemoveUserEvent() { mbRemoveUserEvent = false; } + // <-- + + bool IsAtEndOfMeta() const; + + void DeleteAndInsert(const String& rText, + const bool bForceExpandHints); + + static void SetCrsrAttr(SwPaM& rPam, const SfxItemSet& rSet, + USHORT nAttrMode); + static void GetCrsrAttr( SwPaM& rPam, SfxItemSet& rSet, + BOOL bOnlyTxtAttr = FALSE, BOOL bGetFromChrFmt = TRUE ); + static void getTextFromPam(SwPaM& aCrsr, ::rtl::OUString& rBuffer); + static SwFmtColl* GetCurTxtFmtColl(SwPaM& rPam, BOOL bConditional); + + static void SelectPam(SwPaM& rCrsr, sal_Bool bExpand); + static void SetString(SwCursor& rCrsr, const ::rtl::OUString& rString); + + static ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue > + createSortDescriptor(sal_Bool bFromTable); + static sal_Bool convertSortProperties( + const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue >& rDescriptor, + SwSortOptions& rSortOpt); + + static void SetPropertyValue( + SwPaM& rPaM, + const SfxItemPropertySet& rPropSet, + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Any& aValue, + USHORT nAttrMode = 0) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::beans::PropertyVetoException, + ::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + static ::com::sun::star::uno::Any GetPropertyValue( + SwPaM& rPaM, + const SfxItemPropertySet& rPropSet, + const ::rtl::OUString& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + static ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyState > GetPropertyStates( + SwPaM& rPaM, + const SfxItemPropertySet& rPropSet, + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& + rPropertyNames, + SwGetPropertyStatesCaller eCaller=SW_PROPERTY_STATE_CALLER_DEFAULT) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + static ::com::sun::star::beans::PropertyState GetPropertyState( + SwPaM& rPaM, + const SfxItemPropertySet& rPropSet, + const ::rtl::OUString& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + static void SetPropertyToDefault( + SwPaM& rPaM, + const SfxItemPropertySet& rPropSet, + const ::rtl::OUString& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + static ::com::sun::star::uno::Any GetPropertyDefault( + SwPaM& rPaM, + const SfxItemPropertySet& rPropSet, + const ::rtl::OUString& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + virtual const SwPaM* GetPaM() const; + virtual SwPaM* GetPaM(); + virtual const SwDoc* GetDoc() const; + virtual SwDoc* GetDoc(); + + // SwClient + virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + + DECLARE_XINTERFACE() + + static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId(); + + // XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( + const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier) + throw (::com::sun::star::uno::RuntimeException); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( + const ::rtl::OUString& rServiceName) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames() + throw (::com::sun::star::uno::RuntimeException); + + // XPropertySet + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySetInfo > SAL_CALL + getPropertySetInfo() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Any& rValue) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::beans::PropertyVetoException, + ::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( + const ::rtl::OUString& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertyChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertyChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XVetoableChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XVetoableChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + // XPropertyState + virtual ::com::sun::star::beans::PropertyState SAL_CALL + getPropertyState(const ::rtl::OUString& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyState > SAL_CALL + getPropertyStates( + const ::com::sun::star::uno::Sequence< + ::rtl::OUString >& rPropertyNames) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyToDefault( + const ::rtl::OUString& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( + const ::rtl::OUString& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + // XMultiPropertyStates + virtual void SAL_CALL setAllPropertiesToDefault() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertiesToDefault( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& + rPropertyNames) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > + SAL_CALL getPropertyDefaults( + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& + rPropertyNames) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + // XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements() + throw (::com::sun::star::uno::RuntimeException); + + // XEnumerationAccess + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::container::XEnumeration > SAL_CALL + createEnumeration() + throw (::com::sun::star::uno::RuntimeException); + + // XContentEnumerationAccess + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::container::XEnumeration > SAL_CALL + createContentEnumeration(const ::rtl::OUString& rServiceName) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getAvailableServiceNames() + throw (::com::sun::star::uno::RuntimeException); + + // XSortable + virtual ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue > SAL_CALL + createSortDescriptor() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL sort( + const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue >& xDescriptor) + throw (::com::sun::star::uno::RuntimeException); + + // XDocumentInsertable + virtual void SAL_CALL insertDocumentFromURL( + const ::rtl::OUString& rURL, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue >& rOptions) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::io::IOException, + ::com::sun::star::uno::RuntimeException); + + // XTextRange + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > + SAL_CALL getText() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > SAL_CALL getStart() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > SAL_CALL getEnd() + throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getString() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setString(const ::rtl::OUString& rString) + throw (::com::sun::star::uno::RuntimeException); + + // XTextCursor + virtual void SAL_CALL collapseToStart() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL collapseToEnd() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL isCollapsed() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL goLeft(sal_Int16 nCount, sal_Bool bExpand) + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL goRight(sal_Int16 nCount, sal_Bool bExpand) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL gotoStart(sal_Bool bExpand) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL gotoEnd(sal_Bool bExpand) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL gotoRange( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange >& xRange, + sal_Bool bExpand) + throw (::com::sun::star::uno::RuntimeException); + + // XWordCursor + virtual sal_Bool SAL_CALL isStartOfWord() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL isEndOfWord() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL gotoNextWord(sal_Bool bExpand) + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL gotoPreviousWord(sal_Bool bExpand) + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL gotoEndOfWord(sal_Bool bExpand) + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL gotoStartOfWord(sal_Bool bExpand) + throw (::com::sun::star::uno::RuntimeException); + + // XSentenceCursor + virtual sal_Bool SAL_CALL isStartOfSentence() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL isEndOfSentence() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL gotoNextSentence(sal_Bool Expand) + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL gotoPreviousSentence(sal_Bool Expand) + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL gotoStartOfSentence(sal_Bool Expand) + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL gotoEndOfSentence(sal_Bool Expand) + throw (::com::sun::star::uno::RuntimeException); + + // XParagraphCursor + virtual sal_Bool SAL_CALL isStartOfParagraph() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL isEndOfParagraph() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL gotoStartOfParagraph(sal_Bool Expand) + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL gotoEndOfParagraph(sal_Bool Expand) + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL gotoNextParagraph(sal_Bool Expand) + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL gotoPreviousParagraph(sal_Bool Expand) + throw (::com::sun::star::uno::RuntimeException); + + // XRedline + virtual void SAL_CALL makeRedline( + const ::rtl::OUString& rRedlineType, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue >& RedlineProperties) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + +}; + +#endif // SW_UNOTEXTCURSOR_HXX + diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index ced1e6261c7b..cf24aaa87065 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -30,10 +30,12 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" + #include #include #include #include +#include #include #include #include "fesh.hxx" @@ -63,7 +65,6 @@ #include // for GetWordBoundary // for get/setCharacterAttribute(...) #include "unocrsr.hxx" -#include "unoobj.hxx" #include "unoport.hxx" #include "doc.hxx" #include "crsskip.hxx" diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx index 4d7cbc07e4ad..796905fd49f5 100644 --- a/sw/source/core/edit/editsh.cxx +++ b/sw/source/core/edit/editsh.cxx @@ -63,7 +63,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sw/source/core/unocore/unobkm.cxx b/sw/source/core/unocore/unobkm.cxx index 0ec0442457f5..8f7a44de70d8 100644 --- a/sw/source/core/unocore/unobkm.cxx +++ b/sw/source/core/unocore/unobkm.cxx @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index a5fcf29f8b64..5b83f3007904 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index ec978f02a0ec..7eacc7eeaa68 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -49,6 +49,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index f8de0eb39691..c846c4a90f82 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 87bc0ff6b173..68598e3a3f98 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -61,6 +61,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unoftn.cxx b/sw/source/core/unocore/unoftn.cxx index cf1b6dc516c4..bb9e2f2ed5ff 100644 --- a/sw/source/core/unocore/unoftn.cxx +++ b/sw/source/core/unocore/unoftn.cxx @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index a90bdc28bdab..6bcb59dca0b1 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -58,6 +58,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx index 3f07ccf66b62..00c0f5bd0e6c 100644 --- a/sw/source/core/unocore/unoobj.cxx +++ b/sw/source/core/unocore/unoobj.cxx @@ -83,6 +83,7 @@ #include #include #include +#include #include #include #include @@ -118,6 +119,7 @@ #include #include #include +#include #include #include diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index b8435fe17166..85bc6f8270f1 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -78,6 +78,7 @@ #include #include #include +#include #include #include #include @@ -123,6 +124,7 @@ #include // OD 2004-05-24 #i28701# #include +#include #include #include diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx index bb7c30667ab1..db3accd76165 100644 --- a/sw/source/core/unocore/unoparagraph.cxx +++ b/sw/source/core/unocore/unoparagraph.cxx @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unoport.cxx b/sw/source/core/unocore/unoport.cxx index 7071eb59731d..5dae67498cfe 100644 --- a/sw/source/core/unocore/unoport.cxx +++ b/sw/source/core/unocore/unoport.cxx @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx index ad3e52cff75b..f9379cbd476f 100644 --- a/sw/source/core/unocore/unoportenum.cxx +++ b/sw/source/core/unocore/unoportenum.cxx @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unoredline.cxx b/sw/source/core/unocore/unoredline.cxx index 80297bb64321..eb8b43bc0ecc 100644 --- a/sw/source/core/unocore/unoredline.cxx +++ b/sw/source/core/unocore/unoredline.cxx @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unorefmk.cxx b/sw/source/core/unocore/unorefmk.cxx index 45c79b5edcf5..1b8f58d514e2 100644 --- a/sw/source/core/unocore/unorefmk.cxx +++ b/sw/source/core/unocore/unorefmk.cxx @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx index c7d53042ee62..b5f1c3765f00 100644 --- a/sw/source/core/unocore/unosect.cxx +++ b/sw/source/core/unocore/unosect.cxx @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index ab9006d5fae4..6e5bf7a554d8 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -84,6 +84,7 @@ #include #include #include +#include #include #include // SvNumberFormatter #include @@ -99,6 +100,7 @@ #include #include #include +#include #include diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index f7ae2ebcde95..06cd397269c9 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.cxx b/sw/source/filter/xml/XMLRedlineImportHelper.cxx index 7e3187a4a948..62fd05dac6f3 100644 --- a/sw/source/filter/xml/XMLRedlineImportHelper.cxx +++ b/sw/source/filter/xml/XMLRedlineImportHelper.cxx @@ -33,6 +33,7 @@ #include "XMLRedlineImportHelper.hxx" +#include #include "unoobj.hxx" #include #include "doc.hxx" diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx index 44744f0d18a2..aae9e1f60fd7 100644 --- a/sw/source/filter/xml/xmlimp.cxx +++ b/sw/source/filter/xml/xmlimp.cxx @@ -38,18 +38,15 @@ #include #include #include -#ifndef _XMLOFF_TXTIMP_HXX #include -#endif #include -#ifndef _XMLOFF_XMLTEXTSHAPEIMPORTHELPER_HXX_ #include -#endif #include #include #include #include #include +#include #include #include "unocrsr.hxx" #include diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx index 8c414cdeab0e..acf49038078a 100644 --- a/sw/source/filter/xml/xmltexti.cxx +++ b/sw/source/filter/xml/xmltexti.cxx @@ -51,6 +51,7 @@ #include #include "unocrsr.hxx" #include "unoobj.hxx" +#include "TextCursorHelper.hxx" #include "unoframe.hxx" #include "doc.hxx" #include "unocoll.hxx" diff --git a/sw/source/ui/uno/unoatxt.cxx b/sw/source/ui/uno/unoatxt.cxx index 2b302245f53b..88f7ce8dbaa8 100644 --- a/sw/source/ui/uno/unoatxt.cxx +++ b/sw/source/ui/uno/unoatxt.cxx @@ -34,10 +34,7 @@ #define _SVSTDARR_STRINGS - -#ifndef _COM_SUN_STAR_BEANS_PropertyAttribute_HPP_ #include -#endif #include #include #include @@ -53,6 +50,7 @@ #include #include #include +#include #include #include #include @@ -68,6 +66,7 @@ #include + SV_IMPL_REF ( SwDocShell ) using namespace ::com::sun::star; using ::rtl::OUString; diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index fe3d8639bf84..6be92a156397 100644 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx index 6239bc9503ea..5c71f6707873 100644 --- a/sw/source/ui/uno/unotxvw.cxx +++ b/sw/source/ui/uno/unotxvw.cxx @@ -79,6 +79,7 @@ #include #include #include +#include #include #include diff --git a/sw/source/ui/utlui/unotools.cxx b/sw/source/ui/utlui/unotools.cxx index f2efc1d85a00..c638594431d1 100644 --- a/sw/source/ui/utlui/unotools.cxx +++ b/sw/source/ui/utlui/unotools.cxx @@ -59,12 +59,13 @@ #include #include #include -#include +#include #include #include #include + using namespace ::com::sun::star; using ::rtl::OUString; -- cgit v1.2.3 From e23c9ccd3e9e8d415d0bbab189e2de5ba48b42e9 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 5 Jan 2010 16:37:46 +0100 Subject: swunolocking1: #i105557#: unoobj.hxx: split out unotextrange.hxx: move SwXTextRange, SwXTextRanges from unoobj.hxx to new unotextrange.hxx. move SwUnoInternalPaM to unotextrange.hxx. --- sw/inc/unoframe.hxx | 8 +- sw/inc/unoobj.hxx | 184 ----------- sw/inc/unotbl.hxx | 9 +- sw/inc/unotextrange.hxx | 376 +++++++++++++++++++++++ sw/source/core/access/accpara.cxx | 2 +- sw/source/core/crsr/crsrsh.cxx | 2 +- sw/source/core/txtnode/fmtatr2.cxx | 2 +- sw/source/core/txtnode/ndtxt.cxx | 2 +- sw/source/core/unocore/unobkm.cxx | 2 +- sw/source/core/unocore/unodraw.cxx | 1 + sw/source/core/unocore/unofield.cxx | 1 + sw/source/core/unocore/unoflatpara.cxx | 1 + sw/source/core/unocore/unoframe.cxx | 1 + sw/source/core/unocore/unoftn.cxx | 3 +- sw/source/core/unocore/unoidx.cxx | 1 + sw/source/core/unocore/unoobj.cxx | 1 + sw/source/core/unocore/unoobj2.cxx | 1 + sw/source/core/unocore/unoparagraph.cxx | 1 + sw/source/core/unocore/unoport.cxx | 1 + sw/source/core/unocore/unoredline.cxx | 1 + sw/source/core/unocore/unorefmk.cxx | 1 + sw/source/core/unocore/unosect.cxx | 1 + sw/source/core/unocore/unotbl.cxx | 1 + sw/source/core/unocore/unotext.cxx | 1 + sw/source/filter/html/htmlform.cxx | 9 +- sw/source/filter/ww8/ww8par3.cxx | 2 +- sw/source/filter/xml/XMLRedlineImportHelper.cxx | 1 + sw/source/filter/xml/swxml.cxx | 2 +- sw/source/filter/xml/xmlimp.cxx | 1 + sw/source/filter/xml/xmltbli.cxx | 2 +- sw/source/ui/dialog/SwSpellDialogChildWindow.cxx | 6 +- sw/source/ui/uno/unoatxt.cxx | 1 + sw/source/ui/uno/unotxdoc.cxx | 1 + sw/source/ui/uno/unotxvw.cxx | 1 + 34 files changed, 423 insertions(+), 207 deletions(-) create mode 100644 sw/inc/unotextrange.hxx diff --git a/sw/inc/unoframe.hxx b/sw/inc/unoframe.hxx index 4f62430f1cc2..470303ab92ed 100644 --- a/sw/inc/unoframe.hxx +++ b/sw/inc/unoframe.hxx @@ -31,7 +31,7 @@ #define _UNOFRAME_HXX #include -#include +#include #include #include #include @@ -43,8 +43,14 @@ #include */ +#include + +#include + + class SwDoc; class SfxItemPropertSet; + /*-----------------12.02.98 11:21------------------- --------------------------------------------------*/ diff --git a/sw/inc/unoobj.hxx b/sw/inc/unoobj.hxx index 98bee1bf0e93..fa6600b14107 100644 --- a/sw/inc/unoobj.hxx +++ b/sw/inc/unoobj.hxx @@ -35,46 +35,35 @@ #include #include #include -#include #include #include #include #include -#include #include #include #include -#include #include #include #include -#include -#include #include -#include #include #include #include #include #include -#include #include #include // helper for factories #include // helper for implementations -#include // helper for implementations #include // helper for implementations #include // helper for implementations #include // helper for implementations -#include #include #include #include #include -#include - #include #include @@ -110,19 +99,6 @@ void CollectFrameAtNode( SwClient& rClnt, const SwNodeIndex& rIdx, FrameDependSortList_t & rFrames, const bool _bAtCharAnchoredObjs ); -/* -----------------29.04.98 07:35------------------- - * - * --------------------------------------------------*/ -class SwUnoInternalPaM : public SwPaM -{ - SwUnoInternalPaM( const SwUnoInternalPaM& ); -public: - SwUnoInternalPaM(SwDoc& rDoc); - ~SwUnoInternalPaM(); - - SwUnoInternalPaM& operator=(const SwPaM& rPaM); -}; - /*-----------------04.03.98 11:54------------------- Start/EndAction oder Start/EndAllAction --------------------------------------------------*/ @@ -149,8 +125,6 @@ class UnoActionRemoveContext /****************************************************************************** * ******************************************************************************/ -typedef com::sun::star::uno::Reference< com::sun::star::text::XTextRange > * XTextRangeRefPtr; -SV_DECL_PTRARR(XTextRangeArr, XTextRangeRefPtr, 4, 4) void ClientModify(SwClient* pClient, SfxPoolItem *pOld, SfxPoolItem *pNew); @@ -371,164 +345,6 @@ public: ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > CreateTextCursor(BOOL bIgnoreTables = sal_False); }; -class SW_DLLPUBLIC SwXTextRange : public cppu::WeakImplHelper8 -< - ::com::sun::star::text::XTextRange, - ::com::sun::star::lang::XUnoTunnel, - ::com::sun::star::lang::XServiceInfo, - ::com::sun::star::container::XContentEnumerationAccess, - ::com::sun::star::beans::XPropertySet, - ::com::sun::star::beans::XPropertyState, - ::com::sun::star::container::XEnumerationAccess, - ::com::sun::star::text::XRedline ->, private SwClient -{ - friend class SwXText; - enum RangePosition - { - RANGE_IN_TEXT, // 'normaler' ::com::sun::star::text::TextRange - RANGE_IN_FRAME,// TextPosition wurde mit einem Rahmen angelegt, der kein Uno-Objekt besitzt - RANGE_IN_CELL, // TextPosition wurde mit einer Zelle angelegt, die kein Uno-Objekt besitzt - RANGE_IS_TABLE, // Anker einer Tabelle - RANGE_INVALID // von NewInstance erzeugt - } eRangePosition; - - SwDoc* pDoc; - SwTableBox* pBox; - const SwStartNode* pBoxStartNode; - SwDepend aObjectDepend; //Format der Tabelle oder des Rahmens anmelden - const SfxItemPropertySet* m_pPropSet; - //SwDepend aFrameDepend; - ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParentText; - ::sw::mark::IMark* pMark; - - void _CreateNewBookmark(SwPaM& rPam); - //TODO: new exception type for protected content - void DeleteAndInsert(const String& rText, const bool bForceExpandHints) - throw( ::com::sun::star::uno::RuntimeException ); -protected: - virtual ~SwXTextRange(); - -public: - SwXTextRange(SwPaM& rPam, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > & rxParent, enum RangePosition eRange = RANGE_IN_TEXT); - // only for RANGE_IS_TABLE - SwXTextRange(SwFrmFmt& rTblFmt); - - TYPEINFO(); - - static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); - - //XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); - - //XTextRange - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getStart(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getEnd(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual rtl::OUString SAL_CALL getString(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL setString(const rtl::OUString& aString) throw( ::com::sun::star::uno::RuntimeException ); - - //XContentEnumerationAccess - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createContentEnumeration(const rtl::OUString& aServiceName) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getAvailableServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); - - //XEnumerationAccess - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration(void) throw( ::com::sun::star::uno::RuntimeException ); - - //XElementAccess - virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); - - //XServiceInfo - virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); - - //XPropertySet - virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - - //XPropertyState - virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - - //XRedline - virtual void SAL_CALL makeRedline( const ::rtl::OUString& RedlineType, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& RedlineProperties ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - - //SwClient - virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); - BOOL GetPositions(SwPaM& rToFill) const; - const SwDoc* GetDoc() const - { return pDoc; } - SwDoc* GetDoc() - { return pDoc; } - const ::sw::mark::IMark * GetBookmark() const - { return pMark; } - - static BOOL XTextRangeToSwPaM(SwUnoInternalPaM& rToFill, - const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange); - static ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > CreateTextRangeFromPosition( - SwDoc* pDoc, - const SwPosition& rPos, const SwPosition* pMark); - static ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > CreateParentXText(SwDoc* pDoc, - const SwPosition& rPos); -}; - -/* -----------------15.05.98 08:29------------------- - * - * --------------------------------------------------*/ -typedef cppu::WeakImplHelper3 -< - ::com::sun::star::container::XIndexAccess, - ::com::sun::star::lang::XUnoTunnel, - ::com::sun::star::lang::XServiceInfo -> -SwXTextRangesBaseClass; -class SwXTextRanges : public SwXTextRangesBaseClass, - public SwClient -{ - XTextRangeArr* pRangeArr; - ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParentText; - XTextRangeArr* GetRangesArray(); - SwUnoCrsr* GetCrsr() const { return (SwUnoCrsr*)GetRegisteredIn(); } -protected: - virtual ~SwXTextRanges(); -public: - SwXTextRanges(); - SwXTextRanges(SwPaM* pCrsr); - - - static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); - - //XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) - throw(::com::sun::star::uno::RuntimeException); - - - //XIndexAccess - virtual sal_Int32 SAL_CALL getCount(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); - - //XElementAccess - virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); - - //XServiceInfo - virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); - - //SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); - const SwUnoCrsr* GetCursor() const { return (const SwUnoCrsr*)GetRegisteredIn(); } -}; /*-----------------12.02.98 08:01------------------- diff --git a/sw/inc/unotbl.hxx b/sw/inc/unotbl.hxx index fa82f1b63aa3..c14dac1bc2d0 100644 --- a/sw/inc/unotbl.hxx +++ b/sw/inc/unotbl.hxx @@ -41,11 +41,14 @@ #include #include #include -#include // helper for implementations -#include // helper for implementations -#include // helper for implementations + +#include +#include +#include +#include #include + #include diff --git a/sw/inc/unotextrange.hxx b/sw/inc/unotextrange.hxx new file mode 100644 index 000000000000..a7d13daf4848 --- /dev/null +++ b/sw/inc/unotextrange.hxx @@ -0,0 +1,376 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: unoobj.hxx,v $ + * + * $Revision: 1.49 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SW_UNOTEXTRANGE_HXX +#define SW_UNOTEXTRANGE_HXX + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include +#include + + +class String; +class SfxItemPropertySet; +class SwDoc; +class SwStartNode; +struct SwPosition; +class SwPaM; +class SwUnoCrsr; +class SwFrmFmt; +class SwTableBox; + +namespace sw { + namespace mark { + class IMark; + } +} + +/* -----------------29.04.98 07:35------------------- + * + * --------------------------------------------------*/ +class SwUnoInternalPaM + : public SwPaM +{ + +private: + SwUnoInternalPaM(const SwUnoInternalPaM&); + SwUnoInternalPaM& operator=(const SwPaM& rPaM); + +public: + SwUnoInternalPaM(SwDoc& rDoc); + virtual ~SwUnoInternalPaM(); + +}; + + +typedef ::cppu::WeakImplHelper8 +< ::com::sun::star::lang::XUnoTunnel +, ::com::sun::star::lang::XServiceInfo +, ::com::sun::star::beans::XPropertySet +, ::com::sun::star::beans::XPropertyState +, ::com::sun::star::container::XEnumerationAccess +, ::com::sun::star::container::XContentEnumerationAccess +, ::com::sun::star::text::XTextRange +, ::com::sun::star::text::XRedline +> SwXTextRange_Base; + +class SW_DLLPUBLIC SwXTextRange + : public SwXTextRange_Base + , private SwClient +{ + +private: + + friend class SwXText; + + enum RangePosition + { + RANGE_IN_TEXT, // "ordinary" ::com::sun::star::text::TextRange + RANGE_IN_FRAME, // position created with a frame that has no uno object + RANGE_IN_CELL, // position created with a cell that has no uno object + RANGE_IS_TABLE, // anchor of a table + RANGE_INVALID // created by NewInstance + } eRangePosition; + + SwDoc* pDoc; + SwTableBox* pBox; + const SwStartNode* pBoxStartNode; + SwDepend aObjectDepend; // register at format of table or frame + const SfxItemPropertySet* m_pPropSet; + //SwDepend aFrameDepend; + ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > + xParentText; + ::sw::mark::IMark* pMark; + + void _CreateNewBookmark(SwPaM& rPam); + //TODO: new exception type for protected content + void DeleteAndInsert(const String& rText, const bool bForceExpandHints) + throw (::com::sun::star::uno::RuntimeException); + +protected: + + virtual ~SwXTextRange(); + +public: + + SwXTextRange(SwPaM& rPam, + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XText > & xParent, + enum RangePosition eRange = RANGE_IN_TEXT); + // only for RANGE_IS_TABLE + SwXTextRange(SwFrmFmt& rTblFmt); + + BOOL GetPositions(SwPaM& rToFill) const; + const SwDoc* GetDoc() const + { return pDoc; } + SwDoc* GetDoc() + { return pDoc; } + const ::sw::mark::IMark * GetBookmark() const + { return pMark; } + + static BOOL XTextRangeToSwPaM(SwUnoInternalPaM& rToFill, + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > & xTextRange); + static ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > CreateTextRangeFromPosition( + SwDoc* pDoc, + const SwPosition& rPos, const SwPosition* pMark); + static ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > + CreateParentXText(SwDoc* pDoc, const SwPosition& rPos); + + TYPEINFO(); + + // SwClient + virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + + static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId(); + + // XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( + const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier) + throw (::com::sun::star::uno::RuntimeException); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( + const ::rtl::OUString& rServiceName) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames() + throw (::com::sun::star::uno::RuntimeException); + + // XPropertySet + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySetInfo > SAL_CALL + getPropertySetInfo() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Any& rValue) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::beans::PropertyVetoException, + ::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( + const ::rtl::OUString& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertyChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertyChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XVetoableChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XVetoableChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + // XPropertyState + virtual ::com::sun::star::beans::PropertyState SAL_CALL + getPropertyState(const ::rtl::OUString& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyState > SAL_CALL + getPropertyStates( + const ::com::sun::star::uno::Sequence< + ::rtl::OUString >& rPropertyNames) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyToDefault( + const ::rtl::OUString& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( + const ::rtl::OUString& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + // XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements() + throw (::com::sun::star::uno::RuntimeException); + + // XEnumerationAccess + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::container::XEnumeration > SAL_CALL + createEnumeration() + throw (::com::sun::star::uno::RuntimeException); + + // XContentEnumerationAccess + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::container::XEnumeration > SAL_CALL + createContentEnumeration(const ::rtl::OUString& rServiceName) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getAvailableServiceNames() + throw (::com::sun::star::uno::RuntimeException); + + // XTextRange + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > + SAL_CALL getText() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > SAL_CALL getStart() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > SAL_CALL getEnd() + throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getString() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setString(const ::rtl::OUString& rString) + throw (::com::sun::star::uno::RuntimeException); + + // XRedline + virtual void SAL_CALL makeRedline( + const ::rtl::OUString& rRedlineType, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue >& RedlineProperties) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + +}; + +/* -----------------15.05.98 08:29------------------- + * + * --------------------------------------------------*/ +typedef ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > * + XTextRangeRefPtr; +SV_DECL_PTRARR(XTextRangeArr, XTextRangeRefPtr, 4, 4) + +typedef ::cppu::WeakImplHelper3 +< ::com::sun::star::lang::XUnoTunnel +, ::com::sun::star::lang::XServiceInfo +, ::com::sun::star::container::XIndexAccess +> SwXTextRanges_Base; + +class SwXTextRanges + : public SwXTextRanges_Base + , public SwClient +{ + +private: + + XTextRangeArr* pRangeArr; + ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > + xParentText; + XTextRangeArr* GetRangesArray(); + SwUnoCrsr* GetCrsr() const { return (SwUnoCrsr*)GetRegisteredIn(); } + +protected: + + virtual ~SwXTextRanges(); + +public: + + SwXTextRanges(); + SwXTextRanges(SwPaM* pCrsr); + + const SwUnoCrsr* GetCursor() const { + return (const SwUnoCrsr*)(GetRegisteredIn()); + } + + // SwClient + virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + + static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId(); + + // XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( + const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier) + throw (::com::sun::star::uno::RuntimeException); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( + const ::rtl::OUString& rServiceName) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames() + throw (::com::sun::star::uno::RuntimeException); + + // XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements() + throw (::com::sun::star::uno::RuntimeException); + + // XIndexAccess + virtual sal_Int32 SAL_CALL getCount() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) + throw (::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + +}; + +#endif // SW_UNOTEXTRANGE_HXX + diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index cf24aaa87065..29464206c24b 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 8a82e66c4c7b..f4b7e0a0b10d 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -66,7 +66,7 @@ #include // ...Percent() #include #include // SMARTTAGS -#include // SMARTTAGS +#include // SMARTTAGS #include #include #include diff --git a/sw/source/core/txtnode/fmtatr2.cxx b/sw/source/core/txtnode/fmtatr2.cxx index 8093a84dbbd9..405358adac59 100644 --- a/sw/source/core/txtnode/fmtatr2.cxx +++ b/sw/source/core/txtnode/fmtatr2.cxx @@ -57,7 +57,7 @@ #include // for meta #include // for meta #include -#include // SwXTextRange +#include #include #include // GetNumberFormat diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 46b105723a1d..8e83c3cb9ded 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -4973,7 +4973,7 @@ bool SwTxtNode::IsInContent() const } #include -#include +#include ::com::sun::star::uno::Reference< ::com::sun::star::rdf::XMetadatable > SwTxtNode::MakeUnoObject() diff --git a/sw/source/core/unocore/unobkm.cxx b/sw/source/core/unocore/unobkm.cxx index 8f7a44de70d8..171bead57a09 100644 --- a/sw/source/core/unocore/unobkm.cxx +++ b/sw/source/core/unocore/unobkm.cxx @@ -31,12 +31,12 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - #include #include #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index 7eacc7eeaa68..b3c5eebc11a8 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index c846c4a90f82..eca06ed0d741 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unoflatpara.cxx b/sw/source/core/unocore/unoflatpara.cxx index ae773f389f30..66796031c4ba 100644 --- a/sw/source/core/unocore/unoflatpara.cxx +++ b/sw/source/core/unocore/unoflatpara.cxx @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 68598e3a3f98..14ac1007d3ae 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -61,6 +61,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unoftn.cxx b/sw/source/core/unocore/unoftn.cxx index bb9e2f2ed5ff..23ec936a4244 100644 --- a/sw/source/core/unocore/unoftn.cxx +++ b/sw/source/core/unocore/unoftn.cxx @@ -31,11 +31,11 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - #include #include #include #include +#include #include #include #include @@ -48,6 +48,7 @@ #include #include + using namespace ::com::sun::star; using ::rtl::OUString; diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index 6bcb59dca0b1..e8bba7ac7357 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -58,6 +58,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx index 00c0f5bd0e6c..13a102164cad 100644 --- a/sw/source/core/unocore/unoobj.cxx +++ b/sw/source/core/unocore/unoobj.cxx @@ -83,6 +83,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index 85bc6f8270f1..299d9904d4f4 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -78,6 +78,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx index db3accd76165..99e67d06a00a 100644 --- a/sw/source/core/unocore/unoparagraph.cxx +++ b/sw/source/core/unocore/unoparagraph.cxx @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unoport.cxx b/sw/source/core/unocore/unoport.cxx index 5dae67498cfe..f7b2e40fa440 100644 --- a/sw/source/core/unocore/unoport.cxx +++ b/sw/source/core/unocore/unoport.cxx @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unoredline.cxx b/sw/source/core/unocore/unoredline.cxx index eb8b43bc0ecc..1aca819a6d2e 100644 --- a/sw/source/core/unocore/unoredline.cxx +++ b/sw/source/core/unocore/unoredline.cxx @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unorefmk.cxx b/sw/source/core/unocore/unorefmk.cxx index 1b8f58d514e2..ce501056affc 100644 --- a/sw/source/core/unocore/unorefmk.cxx +++ b/sw/source/core/unocore/unorefmk.cxx @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx index b5f1c3765f00..5a87da1e48ab 100644 --- a/sw/source/core/unocore/unosect.cxx +++ b/sw/source/core/unocore/unosect.cxx @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index 6e5bf7a554d8..e24e17dd47cb 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -84,6 +84,7 @@ #include #include #include +#include #include #include #include // SvNumberFormatter diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index 06cd397269c9..be23a873ad28 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx index dd93a4e60b92..0b8ad7322a80 100644 --- a/sw/source/filter/html/htmlform.cxx +++ b/sw/source/filter/html/htmlform.cxx @@ -34,22 +34,16 @@ #include #include -#ifndef _WRKWIN_HXX //autogen #include -#endif #include -#ifndef _TOOLKIT_UNOHLP_HXX #include -#endif #include #include #include #include #include -#ifndef _SFXAPP_HXX #include -#endif #include #include #include @@ -84,13 +78,14 @@ #include #include #include -#include +#include #include "dcontact.hxx" #include "swcss1.hxx" #include "swhtml.hxx" #include "htmlform.hxx" + using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx index aa2737da1fa4..8ea782ad0426 100644 --- a/sw/source/filter/ww8/ww8par3.cxx +++ b/sw/source/filter/ww8/ww8par3.cxx @@ -77,7 +77,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.cxx b/sw/source/filter/xml/XMLRedlineImportHelper.cxx index 62fd05dac6f3..0102462b4864 100644 --- a/sw/source/filter/xml/XMLRedlineImportHelper.cxx +++ b/sw/source/filter/xml/XMLRedlineImportHelper.cxx @@ -35,6 +35,7 @@ #include "XMLRedlineImportHelper.hxx" #include #include "unoobj.hxx" +#include #include #include "doc.hxx" #include diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx index a99e719e3fe0..d53261ea3fe5 100644 --- a/sw/source/filter/xml/swxml.cxx +++ b/sw/source/filter/xml/swxml.cxx @@ -72,7 +72,7 @@ #include #include #include -#include +#include #include #include diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx index aae9e1f60fd7..476f8871e7a5 100644 --- a/sw/source/filter/xml/xmlimp.cxx +++ b/sw/source/filter/xml/xmlimp.cxx @@ -48,6 +48,7 @@ #include #include #include +#include #include "unocrsr.hxx" #include #include diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx index b71812df6774..e2b154178b29 100644 --- a/sw/source/filter/xml/xmltbli.cxx +++ b/sw/source/filter/xml/xmltbli.cxx @@ -32,7 +32,6 @@ #include "precompiled_sw.hxx" - #include "hintids.hxx" #include @@ -58,6 +57,7 @@ #include "swtblfmt.hxx" #include "pam.hxx" #include "unotbl.hxx" +#include "unotextrange.hxx" #include "unocrsr.hxx" #include "cellatr.hxx" #include "swddetbl.hxx" diff --git a/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx b/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx index 8dca8ef1abf0..85838652d370 100644 --- a/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx +++ b/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx @@ -30,6 +30,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" + #include #include #include @@ -50,21 +51,20 @@ #include #include #include -#ifndef _DOCSH_HXX #include -#endif #include #include #include #include #include #include -#include +#include #ifndef _DIALOG_HXX #include #endif #include + using namespace ::com::sun::star; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::text; diff --git a/sw/source/ui/uno/unoatxt.cxx b/sw/source/ui/uno/unoatxt.cxx index 88f7ce8dbaa8..5543277cc585 100644 --- a/sw/source/ui/uno/unoatxt.cxx +++ b/sw/source/ui/uno/unoatxt.cxx @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index 6be92a156397..8d29db3dd30d 100644 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx index 5c71f6707873..9da88953d481 100644 --- a/sw/source/ui/uno/unotxvw.cxx +++ b/sw/source/ui/uno/unotxvw.cxx @@ -80,6 +80,7 @@ #include #include #include +#include #include #include -- cgit v1.2.3 From a6b34b60ba3e7451cfa8d5a492d53484ec131421 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 5 Jan 2010 16:37:47 +0100 Subject: swunolocking1: #i105557#: unoobj.hxx: split out unotext.hxx etc.: move SwXText from unoobj.hxx to new unotext.hxx. move SwXBodyText, SwXHeadFootText from unoobj.hxx to new unotextbodyhf.hxx. move SwXFootnote from unoobj.hxx to new unofootnote.hxx. --- sw/inc/unofootnote.hxx | 246 ++++++++++++++++++++ sw/inc/unoframe.hxx | 18 +- sw/inc/unoobj.hxx | 326 --------------------------- sw/inc/unoredline.hxx | 4 +- sw/inc/unotbl.hxx | 13 +- sw/inc/unotext.hxx | 375 +++++++++++++++++++++++++++++++ sw/inc/unotextbodyhf.hxx | 218 ++++++++++++++++++ sw/source/core/doc/doclay.cxx | 3 +- sw/source/core/layout/atrfrm.cxx | 1 + sw/source/core/unocore/unoclbck.cxx | 2 +- sw/source/core/unocore/unocoll.cxx | 2 + sw/source/core/unocore/unocrsrhelper.cxx | 1 + sw/source/core/unocore/unodraw.cxx | 2 + sw/source/core/unocore/unoftn.cxx | 14 +- sw/source/core/unocore/unoobj2.cxx | 2 + sw/source/core/unocore/unoparagraph.cxx | 1 + sw/source/core/unocore/unoredlines.cxx | 1 + sw/source/core/unocore/unorefmk.cxx | 1 + sw/source/core/unocore/unostyle.cxx | 9 +- sw/source/core/unocore/unotext.cxx | 29 +-- sw/source/filter/xml/xmlexp.cxx | 4 +- sw/source/filter/xml/xmlfonte.cxx | 5 +- sw/source/filter/xml/xmlimp.cxx | 1 + sw/source/filter/xml/xmltexte.cxx | 5 +- sw/source/ui/uno/unoatxt.cxx | 1 + sw/source/ui/uno/unotxdoc.cxx | 1 + sw/source/ui/uno/unotxvw.cxx | 1 + 27 files changed, 914 insertions(+), 372 deletions(-) create mode 100644 sw/inc/unofootnote.hxx create mode 100644 sw/inc/unotext.hxx create mode 100644 sw/inc/unotextbodyhf.hxx diff --git a/sw/inc/unofootnote.hxx b/sw/inc/unofootnote.hxx new file mode 100644 index 000000000000..d1c869404d32 --- /dev/null +++ b/sw/inc/unofootnote.hxx @@ -0,0 +1,246 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: unoobj.hxx,v $ + * + * $Revision: 1.49 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SW_UNOFOOTNOTE_HXX +#define SW_UNOFOOTNOTE_HXX + +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include + + +class SwDoc; +class SwFmtFtn; + + +/*-----------------12.02.98 08:01------------------- + +--------------------------------------------------*/ +typedef ::cppu::WeakImplHelper5 +< ::com::sun::star::lang::XUnoTunnel +, ::com::sun::star::lang::XServiceInfo +, ::com::sun::star::beans::XPropertySet +, ::com::sun::star::container::XEnumerationAccess +, ::com::sun::star::text::XFootnote +> SwXFootnote_Base; + +class SwXFootnote + : public SwXFootnote_Base + , public SwXText + , public SwClient +{ + +private: + + friend class SwXFootnotes; + + SwEventListenerContainer aLstnrCntnr; + const SwFmtFtn* pFmtFtn; + BOOL m_bIsDescriptor; + String m_sLabel; + BOOL m_bIsEndnote; + +protected: + + virtual const SwStartNode *GetStartNode() const; + + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextCursor > + createCursor() + throw (::com::sun::star::uno::RuntimeException); + + virtual ~SwXFootnote(); + +public: + + SwXFootnote(BOOL bEndnote); + SwXFootnote(SwDoc* pDoc, const SwFmtFtn& rFmt); + + void attachToRange( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > & xTextRange) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + + const SwFmtFtn* FindFmt() const { return GetDoc() ? pFmtFtn : 0; } + void Invalidate(); + + TYPEINFO(); + + // SwClient + virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + + // XInterface + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( + const ::com::sun::star::uno::Type& rType) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL acquire() throw() { OWeakObject::acquire(); } + virtual void SAL_CALL release() throw() { OWeakObject::release(); } + + // XTypeProvider + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > + SAL_CALL getTypes() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL + getImplementationId() + throw (::com::sun::star::uno::RuntimeException); + + static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId(); + + // XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( + const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier) + throw (::com::sun::star::uno::RuntimeException); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( + const ::rtl::OUString& rServiceName) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames() + throw (::com::sun::star::uno::RuntimeException); + + // XComponent + virtual void SAL_CALL dispose() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XEventListener > & xListener) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XEventListener > & xListener) + throw (::com::sun::star::uno::RuntimeException); + + // XPropertySet + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySetInfo > SAL_CALL + getPropertySetInfo() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Any& rValue) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::beans::PropertyVetoException, + ::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( + const ::rtl::OUString& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertyChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertyChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XVetoableChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XVetoableChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + // XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements() + throw (::com::sun::star::uno::RuntimeException); + + // XEnumerationAccess + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::container::XEnumeration > SAL_CALL + createEnumeration() + throw (::com::sun::star::uno::RuntimeException); + + // XTextContent + virtual void SAL_CALL attach( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > & xTextRange) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > SAL_CALL getAnchor() + throw (::com::sun::star::uno::RuntimeException); + + // XFootnote + virtual ::rtl::OUString SAL_CALL getLabel() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setLabel(const ::rtl::OUString& rLabel) + throw (::com::sun::star::uno::RuntimeException); + + // XSimpleText + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextCursor > SAL_CALL + createTextCursor() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextCursor > SAL_CALL + createTextCursorByRange( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > & xTextPosition) + throw (::com::sun::star::uno::RuntimeException); + +}; + +#endif // SW_UNOFOOTNOTE_HXX + diff --git a/sw/inc/unoframe.hxx b/sw/inc/unoframe.hxx index 470303ab92ed..d681e520d028 100644 --- a/sw/inc/unoframe.hxx +++ b/sw/inc/unoframe.hxx @@ -30,26 +30,34 @@ #ifndef _UNOFRAME_HXX #define _UNOFRAME_HXX -#include #include #include +#include #include #include #include #include #include #include - /* -#include - */ +#include #include +#include #include +#include +#include +#include +#include + -class SwDoc; class SfxItemPropertSet; +class SdrObject; +class SwDoc; +class SwFmt; +class SwFlyFrmFmt; + /*-----------------12.02.98 11:21------------------- diff --git a/sw/inc/unoobj.hxx b/sw/inc/unoobj.hxx index fa6600b14107..d43a4a7105e1 100644 --- a/sw/inc/unoobj.hxx +++ b/sw/inc/unoobj.hxx @@ -36,28 +36,14 @@ #include #include #include -#include #include #include #include -#include #include -#include #include -#include -#include -#include -#include -#include -#include -#include #include #include // helper for factories -#include // helper for implementations -#include // helper for implementations -#include // helper for implementations -#include // helper for implementations #include #include #include @@ -68,7 +54,6 @@ #include -class SwFmtFtn; class GetCurTxtFmtColl; @@ -128,124 +113,6 @@ class UnoActionRemoveContext void ClientModify(SwClient* pClient, SfxPoolItem *pOld, SfxPoolItem *pNew); -/* -----------------03.12.98 12:22------------------- - * - * --------------------------------------------------*/ -class OTextCursorHelper; -class SwXTextRange; -class SwXText : public ::com::sun::star::lang::XTypeProvider, - public ::com::sun::star::text::XTextRangeCompare, - public ::com::sun::star::text::XRelativeTextContentInsert, - public ::com::sun::star::text::XRelativeTextContentRemove, - public ::com::sun::star::beans::XPropertySet, - public ::com::sun::star::lang::XUnoTunnel, - public ::com::sun::star::text::XTextAppendAndConvert -{ - SwDoc* pDoc; - BOOL bObjectValid; - CursorType eCrsrType; - const SfxItemPropertySet* m_pPropSet; - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL finishOrAppendParagraph( - bool bFinish, - const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > & CharacterAndParagraphProperties ) - throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - - virtual void PrepareForAttach( ::com::sun::star::uno::Reference< - ::com::sun::star::text::XTextRange > & xRange, - const SwXTextRange* const pRange, const SwPaM * const pPam); - -public: /*not protected because C++ is retarded*/ - virtual const SwStartNode *GetStartNode() const; - -public: - SwXText(SwDoc* pDc, CursorType eType); - virtual ~SwXText(); - - const SwDoc* GetDoc()const {return pDoc;} - SwDoc* GetDoc() {return pDoc;} - - // wenn ein SwXText attached wird, wird das Doc gesetzt - void SetDoc(SwDoc* pDc) - {DBG_ASSERT(!pDoc || !pDc, "Doc schon gesetzt?"); - pDoc = pDc; - bObjectValid = 0 != pDc; - } - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException); - - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); - - //XText - virtual void SAL_CALL insertString(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xRange, const rtl::OUString& aString, BOOL bAbsorb) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL insertControlCharacter(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xRange, sal_Int16 nControlCharacter, BOOL bAbsorb) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL insertTextContent(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xRange, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > & xContent, BOOL bAbsorb) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL removeTextContent(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > & xContent) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); - - //XTextRange - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL getText(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getStart(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getEnd(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual rtl::OUString SAL_CALL getString(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL setString(const rtl::OUString& aString) throw( ::com::sun::star::uno::RuntimeException ); - - //XTextRangeCompare - sal_Int16 SAL_CALL compareRegionStarts( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xR1, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xR2 ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - sal_Int16 SAL_CALL compareRegionEnds( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xR1, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& xR2 ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - - //XRelativeTextContentInsert - virtual void SAL_CALL insertTextContentBefore(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent>& xNewContent, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent>& xSuccessor) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL insertTextContentAfter(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent>& xNewContent, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent>& xPredecessor) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - - //XRelativeTextContentRemove - virtual void SAL_CALL removeTextContentBefore(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent>& xSuccessor) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeTextContentAfter(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent>& xPredecessor) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - - - //XPropertySet - virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - - //XUnoTunnel - static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); - virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); - - //XParagraphAppend - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL appendParagraph( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > & CharacterAndParagraphProperties ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL finishParagraph( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > & CharacterAndParagraphProperties ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - - //XTextPortionAppend - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL appendTextPortion( const ::rtl::OUString& Text, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > & CharacterAndParagraphProperties ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - - //XTextContentAppend - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL appendTextContent( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent >& TextContent, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& CharacterAndParagraphProperties ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - - //XTextConvert - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > SAL_CALL convertToTextFrame( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& Start, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange >& End, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& FrameProperties ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextTable > SAL_CALL convertToTable( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > > > >& TableRanges, - const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > > >& CellProperties, - const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > >& RowProperties, - const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& TableProperties - ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - - - // - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > createCursor()throw(::com::sun::star::uno::RuntimeException); - INT16 ComparePositions(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange>& xPos1, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange>& xPos2) throw (com::sun::star::lang::IllegalArgumentException, com::sun::star::uno::RuntimeException); - BOOL CheckForOwnMember(const SwXTextRange* pRange1, const OTextCursorHelper* pCursor1)throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - virtual bool CheckForOwnMemberMeta(const SwXTextRange* const pRange, - const SwPaM* const pPam, bool bAbsorb) - throw (::com::sun::star::lang::IllegalArgumentException, - ::com::sun::star::uno::RuntimeException); - // - void Invalidate() {bObjectValid = sal_False;} - BOOL IsValid()const {return bObjectValid;} - - CursorType GetTextType() {return eCrsrType;} -}; /*-----------------20.03.98 07:47------------------- @@ -301,147 +168,6 @@ public: --------------------------------------------------*/ -typedef cppu::WeakAggImplHelper2 -< - ::com::sun::star::container::XEnumerationAccess, - ::com::sun::star::lang::XServiceInfo -> SwXBodyTextBaseClass; -class SwXBodyText : public SwXBodyTextBaseClass, - public SwXText -{ -protected: - virtual ~SwXBodyText(); -public: - SwXBodyText(SwDoc* pDoc); - - - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL acquire( ) throw(){OWeakObject::acquire();} - virtual void SAL_CALL release( ) throw(){OWeakObject::release();} - - //XAggregation - virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException); - - //XTypeProvider - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException); - - //XText - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursor(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursorByRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & aTextPosition) throw( ::com::sun::star::uno::RuntimeException ); - - //XEnumerationAccess - frueher XParagraphEnumerationAccess - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration(void) throw( ::com::sun::star::uno::RuntimeException ); - - //XElementAccess - virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); - - //XServiceInfo - virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); - - ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > CreateTextCursor(BOOL bIgnoreTables = sal_False); -}; - - -/*-----------------12.02.98 08:01------------------- - ---------------------------------------------------*/ -typedef -cppu::WeakImplHelper5 -< - ::com::sun::star::text::XFootnote, - ::com::sun::star::lang::XServiceInfo, - ::com::sun::star::container::XEnumerationAccess, - ::com::sun::star::beans::XPropertySet, - ::com::sun::star::lang::XUnoTunnel -> -SwXFootnoteBaseClass; -class SwXFootnote : public SwXFootnoteBaseClass, - public SwXText, - public SwClient -{ - friend class SwXFootnotes; - - SwEventListenerContainer aLstnrCntnr; - const SwFmtFtn* pFmtFtn; - BOOL m_bIsDescriptor; - String m_sLabel; - BOOL m_bIsEndnote; - -protected: - virtual const SwStartNode *GetStartNode() const; - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > createCursor()throw(::com::sun::star::uno::RuntimeException); - virtual ~SwXFootnote(); -public: - SwXFootnote(BOOL bEndnote); - SwXFootnote(SwDoc* pDoc, const SwFmtFtn& rFmt); - - - TYPEINFO(); - - static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); - - //XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); - - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL acquire( ) throw(){SwXFootnoteBaseClass::acquire();} - virtual void SAL_CALL release( ) throw(){SwXFootnoteBaseClass::release();} - - //XTypeProvider - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException); - - //XFootnote - virtual rtl::OUString SAL_CALL getLabel(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL setLabel(const rtl::OUString& aLabel) throw( ::com::sun::star::uno::RuntimeException ); - - //XTextContent - virtual void SAL_CALL attach(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getAnchor( ) throw(::com::sun::star::uno::RuntimeException); - - //XComponent - virtual void SAL_CALL dispose(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); - - //XText - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursor(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursorByRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & aTextPosition) throw( ::com::sun::star::uno::RuntimeException ); - - //XEnumerationAccess - frueher XParagraphEnumerationAccess - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration(void) throw( ::com::sun::star::uno::RuntimeException ); - - //XElementAccess - virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); - - //XServiceInfo - virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); - - //XPropertySet - virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - - //SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); - - void attachToRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange)throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); - - const SwFmtFtn* FindFmt() const {return GetDoc() ? pFmtFtn : 0;} - void Invalidate(); -}; - /* -----------------23.03.99 12:57------------------- * * --------------------------------------------------*/ @@ -521,58 +247,6 @@ public: void SetSortOptions(const SwSortOptions& rSortOpt); }; */ -/* -----------------25.08.98 11:02------------------- - * - * --------------------------------------------------*/ -typedef -cppu::WeakImplHelper2 -< - ::com::sun::star::lang::XServiceInfo, - ::com::sun::star::container::XEnumerationAccess -> -SwXHeadFootTextBaseClass; -class SwXHeadFootText : public SwXHeadFootTextBaseClass, - public SwXText, - public SwClient -{ - SwFrmFmt* GetFmt() const { return (SwFrmFmt*)GetRegisteredIn(); } - BOOL bIsHeader; -protected: - virtual const SwStartNode *GetStartNode() const; - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > createCursor()throw(::com::sun::star::uno::RuntimeException); -public: - SwXHeadFootText(SwFrmFmt& rHeadFootFmt, BOOL bHeader); - ~SwXHeadFootText(); - - TYPEINFO(); - - virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL acquire( ) throw(){SwXHeadFootTextBaseClass::acquire();} - virtual void SAL_CALL release( ) throw(){SwXHeadFootTextBaseClass::release();} - - //XTypeProvider - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw(::com::sun::star::uno::RuntimeException); - - //XText - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursor(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL createTextCursorByRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & aTextPosition) throw( ::com::sun::star::uno::RuntimeException ); - - //XServiceInfo - virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); - - //XEnumerationAccess - frueher XParagraphEnumerationAccess - virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration(void) throw( ::com::sun::star::uno::RuntimeException ); - - //XElementAccess - virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); - - //SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); -}; #endif diff --git a/sw/inc/unoredline.hxx b/sw/inc/unoredline.hxx index 5730c6e55ff0..b46189734301 100644 --- a/sw/inc/unoredline.hxx +++ b/sw/inc/unoredline.hxx @@ -31,9 +31,11 @@ #define _UNOREDLINE_HXX #include -#include +#include + class SwRedline; + /* -----------------------------19.12.00 11:35-------------------------------- ---------------------------------------------------------------------------*/ diff --git a/sw/inc/unotbl.hxx b/sw/inc/unotbl.hxx index c14dac1bc2d0..d2e14309a5d4 100644 --- a/sw/inc/unotbl.hxx +++ b/sw/inc/unotbl.hxx @@ -30,8 +30,8 @@ #ifndef _UNOTBL_HXX #define _UNOTBL_HXX -#include #include +#include #include #include #include @@ -43,22 +43,27 @@ #include #include +#include #include #include #include #include +#include #include +#include +#include -class SwTableBoxFmt; +class SwUnoCrsr; +class SwTable; +class SwTableBox; class SwTableLine; class SwTableCursor; class SwTableBoxFmt; -class SwTableLine; -class SwTableCursor; class SwChartDataProvider; +class SwFrmFmt; /* -----------------------------22.09.00 11:10-------------------------------- diff --git a/sw/inc/unotext.hxx b/sw/inc/unotext.hxx new file mode 100644 index 000000000000..499e0620dae4 --- /dev/null +++ b/sw/inc/unotext.hxx @@ -0,0 +1,375 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: unoobj.hxx,v $ + * + * $Revision: 1.49 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SW_UNOTEXT_HXX +#define SW_UNOTEXT_HXX + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + + +namespace com { namespace sun { namespace star { + namespace text { + class XTextContent; + } +} } } + +class SfxItemPropertySet; +class SwDoc; +class SwStartNode; +class SwPaM; +class OTextCursorHelper; +class SwXTextRange; + + +/* -----------------03.12.98 12:22------------------- + * + * --------------------------------------------------*/ + +class SwXText + : public ::com::sun::star::lang::XTypeProvider + , public ::com::sun::star::lang::XUnoTunnel + , public ::com::sun::star::beans::XPropertySet + , public ::com::sun::star::text::XTextAppendAndConvert + , public ::com::sun::star::text::XTextRangeCompare + , public ::com::sun::star::text::XRelativeTextContentInsert + , public ::com::sun::star::text::XRelativeTextContentRemove +{ + +private: + + SwDoc* pDoc; + BOOL bObjectValid; + CursorType eCrsrType; + const SfxItemPropertySet* m_pPropSet; + + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > SAL_CALL + finishOrAppendParagraph( + bool bFinish, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue >& + rCharacterAndParagraphProperties) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + + virtual void PrepareForAttach( + ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > & xRange, + SwXTextRange const * const pRange, SwPaM const * const pPam); + +protected: + + virtual ~SwXText(); + +public: /*not protected because C++ is retarded*/ + virtual const SwStartNode *GetStartNode() const; + +public: + + SwXText(SwDoc* pDc, CursorType eType); + + const SwDoc* GetDoc() const { return pDoc; } + SwDoc* GetDoc() { return pDoc; } + + // SwDoc is set when SwXText is attached + void SetDoc(SwDoc* pDc) { + DBG_ASSERT(!pDoc || !pDc, "Doc schon gesetzt?"); + pDoc = pDc; + bObjectValid = 0 != pDc; + } + + void Invalidate() { bObjectValid = sal_False; } + BOOL IsValid() const { return bObjectValid; } + + CursorType GetTextType() { return eCrsrType; } + + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextCursor > createCursor() + throw (::com::sun::star::uno::RuntimeException); + INT16 ComparePositions( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange>& xPos1, + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange>& xPos2) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + BOOL CheckForOwnMember(const SwXTextRange* pRange1, + const OTextCursorHelper* pCursor1) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + virtual bool CheckForOwnMemberMeta( + const SwXTextRange* const pRange, + const SwPaM* const pPam, bool bAbsorb) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + + // XInterface + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( + const ::com::sun::star::uno::Type& rType) + throw (::com::sun::star::uno::RuntimeException); + + // XTypeProvider + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > + SAL_CALL getTypes() + throw (::com::sun::star::uno::RuntimeException); + + static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId(); + + // XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( + const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier) + throw (::com::sun::star::uno::RuntimeException); + + // XPropertySet + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySetInfo > SAL_CALL + getPropertySetInfo() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Any& rValue) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::beans::PropertyVetoException, + ::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( + const ::rtl::OUString& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertyChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertyChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XVetoableChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XVetoableChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + // XTextRange + virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > + SAL_CALL getText() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > SAL_CALL getStart() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > SAL_CALL getEnd() + throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getString() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setString(const ::rtl::OUString& rString) + throw (::com::sun::star::uno::RuntimeException); + + // XSimpleText + virtual void SAL_CALL insertString( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > & xRange, + const ::rtl::OUString& aString, sal_Bool bAbsorb) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL insertControlCharacter( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > & xRange, + sal_Int16 nControlCharacter, sal_Bool bAbsorb) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + + // XText + virtual void SAL_CALL insertTextContent( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > & xRange, + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextContent > & xContent, + sal_Bool bAbsorb) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeTextContent( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextContent > & xContent) + throw (::com::sun::star::container::NoSuchElementException, + ::com::sun::star::uno::RuntimeException); + + // XParagraphAppend + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > SAL_CALL + appendParagraph( + const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue >& + rCharacterAndParagraphProperties) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > SAL_CALL + finishParagraph( + const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue >& + rCharacterAndParagraphProperties) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + + // XTextPortionAppend + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > SAL_CALL + appendTextPortion( + const ::rtl::OUString& rText, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue >& + rCharacterAndParagraphProperties) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + + // XTextContentAppend + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > SAL_CALL + appendTextContent( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextContent >& xTextContent, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue >& + rCharacterAndParagraphProperties) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + + // XTextConvert + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextContent > SAL_CALL + convertToTextFrame( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange >& xStart, + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange >& xEnd, + const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue >& xFrameProperties) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextTable > SAL_CALL + convertToTable( + ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > > > > const& + rTableRanges, + ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue > > > const& + rCellProperties, + ::com::sun::star::uno::Sequence< + ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue > > const& + rRowProperties, + ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue > const& + rTableProperties) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + + // XTextRangeCompare + sal_Int16 SAL_CALL compareRegionStarts( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange >& xR1, + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange >& xR2) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + sal_Int16 SAL_CALL compareRegionEnds( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange >& xR1, + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange >& xR2) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + + // XRelativeTextContentInsert + virtual void SAL_CALL insertTextContentBefore( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextContent>& xNewContent, + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextContent>& xSuccessor) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL insertTextContentAfter( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextContent>& xNewContent, + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextContent>& xPredecessor) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + + // XRelativeTextContentRemove + virtual void SAL_CALL removeTextContentBefore( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextContent>& xSuccessor) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeTextContentAfter( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextContent>& xPredecessor) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + +}; + +#endif // SW_UNOTEXT_HXX + diff --git a/sw/inc/unotextbodyhf.hxx b/sw/inc/unotextbodyhf.hxx new file mode 100644 index 000000000000..8e7a64c18669 --- /dev/null +++ b/sw/inc/unotextbodyhf.hxx @@ -0,0 +1,218 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: unoobj.hxx,v $ + * + * $Revision: 1.49 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SW_UNOTEXTBODYHF_HXX +#define SW_UNOTEXTBODYHF_HXX + +#include +#include +#include + +#include + +#include +#include +#include + + +class SwDoc; +class SwFrmFmt; + + +typedef ::cppu::WeakAggImplHelper2 +< ::com::sun::star::lang::XServiceInfo +, ::com::sun::star::container::XEnumerationAccess +> SwXBodyText_Base; + +class SwXBodyText + : public SwXBodyText_Base + , public SwXText +{ + +protected: + + virtual ~SwXBodyText(); + +public: + + SwXBodyText(SwDoc* pDoc); + + ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > + CreateTextCursor(sal_Bool bIgnoreTables = sal_False); + + // XInterface + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( + const ::com::sun::star::uno::Type& rType) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL acquire() throw() { OWeakObject::acquire(); } + virtual void SAL_CALL release() throw() { OWeakObject::release(); } + + // XAggregation + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( + const ::com::sun::star::uno::Type& rType) + throw (::com::sun::star::uno::RuntimeException); + + // XTypeProvider + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > + SAL_CALL getTypes() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL + getImplementationId() + throw (::com::sun::star::uno::RuntimeException); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( + const ::rtl::OUString& rServiceName) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames() + throw (::com::sun::star::uno::RuntimeException); + + // XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements() + throw (::com::sun::star::uno::RuntimeException); + + // XEnumerationAccess + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::container::XEnumeration > SAL_CALL + createEnumeration() + throw (::com::sun::star::uno::RuntimeException); + + // XSimpleText + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextCursor > SAL_CALL + createTextCursor() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextCursor > SAL_CALL + createTextCursorByRange( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > & xTextPosition) + throw (::com::sun::star::uno::RuntimeException); + +}; + + +/* -----------------25.08.98 11:02------------------- + * + * --------------------------------------------------*/ +typedef ::cppu::WeakImplHelper2 +< ::com::sun::star::lang::XServiceInfo +, ::com::sun::star::container::XEnumerationAccess +> SwXHeadFootText_Base; + +class SwXHeadFootText + : public SwXHeadFootText_Base + , public SwXText + , public SwClient +{ + +private: + + SwFrmFmt* GetFmt() const { return (SwFrmFmt*)GetRegisteredIn(); } + BOOL bIsHeader; + +protected: + + virtual const SwStartNode *GetStartNode() const; + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextCursor > + createCursor() + throw (::com::sun::star::uno::RuntimeException); + + virtual ~SwXHeadFootText(); + +public: + + SwXHeadFootText(SwFrmFmt& rHeadFootFmt, BOOL bHeader); + + TYPEINFO(); + + // SwClient + virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + + // XInterface + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( + const ::com::sun::star::uno::Type& rType) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL acquire() throw() { OWeakObject::acquire(); } + virtual void SAL_CALL release() throw() { OWeakObject::release(); } + + // XTypeProvider + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > + SAL_CALL getTypes() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL + getImplementationId() + throw (::com::sun::star::uno::RuntimeException); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( + const ::rtl::OUString& rServiceName) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames() + throw (::com::sun::star::uno::RuntimeException); + + // XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements() + throw (::com::sun::star::uno::RuntimeException); + + // XEnumerationAccess + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::container::XEnumeration > SAL_CALL + createEnumeration() + throw (::com::sun::star::uno::RuntimeException); + + // XSimpleText + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextCursor > SAL_CALL + createTextCursor() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextCursor > SAL_CALL + createTextCursorByRange( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > & xTextPosition) + throw (::com::sun::star::uno::RuntimeException); + +}; + +#endif // SW_UNOTEXTBODYHF_HXX + diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index e58059d95ac9..a366f7f898b7 100644 --- a/sw/source/core/doc/doclay.cxx +++ b/sw/source/core/doc/doclay.cxx @@ -1880,7 +1880,8 @@ IMPL_LINK( SwDoc, DoIdleJobs, Timer *, pTimer ) BOOL bIsOnlineSpell = pSh->GetViewOptions()->IsOnlineSpell(); sal_Bool bIsAutoGrammar = sal_False; - SvtLinguConfig().GetProperty( C2U( UPN_IS_GRAMMAR_AUTO ) ) >>= bIsAutoGrammar; + SvtLinguConfig().GetProperty( ::rtl::OUString::createFromAscii( + UPN_IS_GRAMMAR_AUTO ) ) >>= bIsAutoGrammar; if (bIsOnlineSpell && bIsAutoGrammar) StartGrammarChecking( *this ); diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index bdef8a74bcf7..f5963931f545 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -99,6 +99,7 @@ #include #include #include +#include #include /// OD 22.08.2002 #99657# /// include definition of class SvxBrushItem and GraphicObject diff --git a/sw/source/core/unocore/unoclbck.cxx b/sw/source/core/unocore/unoclbck.cxx index 01890a1f40a4..9807a8f5b3fb 100644 --- a/sw/source/core/unocore/unoclbck.cxx +++ b/sw/source/core/unocore/unoclbck.cxx @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx index 9cec70fa8a2f..437fec101e53 100644 --- a/sw/source/core/unocore/unocoll.cxx +++ b/sw/source/core/unocore/unocoll.cxx @@ -66,7 +66,9 @@ #include #include #include +#include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index 5b83f3007904..e152ff2b9d23 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index b3c5eebc11a8..2bfaadaa4f1e 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -44,6 +45,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unoftn.cxx b/sw/source/core/unocore/unoftn.cxx index 23ec936a4244..a4d83d8f51d5 100644 --- a/sw/source/core/unocore/unoftn.cxx +++ b/sw/source/core/unocore/unoftn.cxx @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -147,7 +148,7 @@ SwXFootnote::~SwXFootnote() ---------------------------------------------------------------------------*/ uno::Sequence< uno::Type > SAL_CALL SwXFootnote::getTypes( ) throw(uno::RuntimeException) { - uno::Sequence< uno::Type > aFtnTypes = SwXFootnoteBaseClass::getTypes(); + uno::Sequence< uno::Type > aFtnTypes = SwXFootnote_Base::getTypes(); uno::Sequence< uno::Type > aTextTypes = SwXText::getTypes(); long nIndex = aFtnTypes.getLength(); @@ -179,12 +180,13 @@ uno::Sequence< sal_Int8 > SAL_CALL SwXFootnote::getImplementationId( ) throw(un /* -----------------------------21.03.00 15:46-------------------------------- ---------------------------------------------------------------------------*/ -uno::Any SAL_CALL SwXFootnote::queryInterface( const uno::Type& aType ) throw(uno::RuntimeException) +uno::Any SAL_CALL SwXFootnote::queryInterface(const uno::Type& rType) +throw (uno::RuntimeException) { - uno::Any aRet = SwXFootnoteBaseClass::queryInterface(aType); - if(aRet.getValueType() == ::getCppuVoidType() ) - aRet = SwXText::queryInterface(aType); - return aRet; + const uno::Any ret = SwXFootnote_Base::queryInterface(rType); + return (ret.getValueType() == ::getCppuVoidType()) + ? SwXText::queryInterface(rType) + : ret; } /*-- 10.12.98 15:31:47--------------------------------------------------- diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index 299d9904d4f4..aa6a35526866 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -78,6 +78,8 @@ #include #include #include +#include +#include #include #include #include diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx index 99e67d06a00a..8a47c71ebd75 100644 --- a/sw/source/core/unocore/unoparagraph.cxx +++ b/sw/source/core/unocore/unoparagraph.cxx @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unoredlines.cxx b/sw/source/core/unocore/unoredlines.cxx index efaaa32c9e3d..a88b3ff4672c 100644 --- a/sw/source/core/unocore/unoredlines.cxx +++ b/sw/source/core/unocore/unoredlines.cxx @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include "poolfmt.hxx" diff --git a/sw/source/core/unocore/unorefmk.cxx b/sw/source/core/unocore/unorefmk.cxx index ce501056affc..61c3056a7bef 100644 --- a/sw/source/core/unocore/unorefmk.cxx +++ b/sw/source/core/unocore/unorefmk.cxx @@ -440,6 +440,7 @@ void SwXReferenceMark::removeVetoableChangeListener( #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index 722235e3c391..cbf75f593146 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -31,7 +31,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - #include #include #include @@ -62,6 +61,7 @@ #include #include #include +#include #include #include #include @@ -74,16 +74,9 @@ #include #include #include -/* -#include -*/ #include -#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPPP_ #include -#endif -#ifndef _COM_SUN_STAR_BEANS_NAMEDVALUE_HPPP_ #include -#endif #include #include #include diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index be23a873ad28..63e27c7abc8d 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -40,6 +40,8 @@ #include #include #include +#include +#include #include #include #include @@ -2272,7 +2274,7 @@ uno::Any SwXBodyText::queryAggregation( -----------------------------------------------------------------------*/ uno::Sequence< uno::Type > SwXBodyText::getTypes( ) throw(uno::RuntimeException) { - uno::Sequence< uno::Type > aTypes = SwXBodyTextBaseClass::getTypes(); + uno::Sequence< uno::Type > aTypes = SwXBodyText_Base::getTypes(); uno::Sequence< uno::Type > aTextTypes = SwXText::getTypes(); long nIndex = aTypes.getLength(); aTypes.realloc(aTypes.getLength() + aTextTypes.getLength()); @@ -2301,13 +2303,13 @@ uno::Sequence< sal_Int8 > SwXBodyText::getImplementationId( ) throw(uno::Runtim -----------------------------------------------------------------------*/ uno::Any SAL_CALL - SwXBodyText::queryInterface( const uno::Type& rType ) - throw(uno::RuntimeException) +SwXBodyText::queryInterface(const uno::Type& rType) +throw (uno::RuntimeException) { - uno::Any aRet = SwXText::queryInterface( rType ); - if(aRet.getValueType() == ::getCppuVoidType()) - aRet = SwXBodyTextBaseClass::queryInterface( rType ); - return aRet; + const uno::Any ret = SwXText::queryInterface(rType); + return (ret.getValueType() == ::getCppuVoidType()) + ? SwXBodyText_Base::queryInterface(rType) + : ret; } /* -----------------------------05.01.00 11:07-------------------------------- @@ -2504,7 +2506,7 @@ uno::Reference< text::XTextCursor > SwXHeadFootText::createCursor() throw(uno: ---------------------------------------------------------------------------*/ uno::Sequence< uno::Type > SwXHeadFootText::getTypes( ) throw(uno::RuntimeException) { - uno::Sequence< uno::Type > aHFTypes = SwXHeadFootTextBaseClass::getTypes(); + uno::Sequence< uno::Type > aHFTypes = SwXHeadFootText_Base::getTypes(); uno::Sequence< uno::Type > aTextTypes = SwXText::getTypes(); long nIndex = aHFTypes.getLength(); @@ -2538,12 +2540,13 @@ uno::Sequence< sal_Int8 > SwXHeadFootText::getImplementationId( ) throw(uno::Ru /* -----------------------------21.03.00 15:46-------------------------------- ---------------------------------------------------------------------------*/ -uno::Any SwXHeadFootText::queryInterface( const uno::Type& aType ) throw(uno::RuntimeException) +uno::Any SwXHeadFootText::queryInterface(const uno::Type& rType) +throw (uno::RuntimeException) { - uno::Any aRet = SwXHeadFootTextBaseClass::queryInterface(aType); - if(aRet.getValueType() == ::getCppuVoidType() ) - aRet = SwXText::queryInterface(aType); - return aRet; + const uno::Any ret = SwXHeadFootText_Base::queryInterface(rType); + return (ret.getValueType() == ::getCppuVoidType()) + ? SwXText::queryInterface(rType) + : ret; } /*-- 11.12.98 10:14:50--------------------------------------------------- diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx index cd3c5d1734d4..74196dfbd9ce 100644 --- a/sw/source/filter/xml/xmlexp.cxx +++ b/sw/source/filter/xml/xmlexp.cxx @@ -31,7 +31,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - #include #include #include @@ -41,7 +40,6 @@ #include #include #include -#include #include #include #include @@ -59,6 +57,7 @@ #include #include #include +#include #include #include #include @@ -76,6 +75,7 @@ #include // <-- + using ::rtl::OUString; using namespace ::com::sun::star; using namespace ::com::sun::star::frame; diff --git a/sw/source/filter/xml/xmlfonte.cxx b/sw/source/filter/xml/xmlfonte.cxx index 1edeb1fc846a..d3d8772e43da 100644 --- a/sw/source/filter/xml/xmlfonte.cxx +++ b/sw/source/filter/xml/xmlfonte.cxx @@ -31,15 +31,16 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - #include "hintids.hxx" #include #include #include -#include +//#include +#include #include #include + using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::text; diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx index 476f8871e7a5..cf96a699dd7f 100644 --- a/sw/source/filter/xml/xmlimp.cxx +++ b/sw/source/filter/xml/xmlimp.cxx @@ -48,6 +48,7 @@ #include #include #include +#include #include #include "unocrsr.hxx" #include diff --git a/sw/source/filter/xml/xmltexte.cxx b/sw/source/filter/xml/xmltexte.cxx index 018ca0c0b5bb..6ef61df5a0bc 100644 --- a/sw/source/filter/xml/xmltexte.cxx +++ b/sw/source/filter/xml/xmltexte.cxx @@ -31,7 +31,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - #include #include #include @@ -44,13 +43,12 @@ #include #include #include -#ifndef _XMLOFF_TXTPRMAP_HXX #include -#endif #include #include #include +#include #include #include #include @@ -65,6 +63,7 @@ #include #include + using ::rtl::OUString; using ::rtl::OUStringBuffer; using namespace ::com::sun::star; diff --git a/sw/source/ui/uno/unoatxt.cxx b/sw/source/ui/uno/unoatxt.cxx index 5543277cc585..7ed98a979a6a 100644 --- a/sw/source/ui/uno/unoatxt.cxx +++ b/sw/source/ui/uno/unoatxt.cxx @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index 8d29db3dd30d..3afeb1ee0c39 100644 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx index 9da88953d481..9de9e882b869 100644 --- a/sw/source/ui/uno/unotxvw.cxx +++ b/sw/source/ui/uno/unotxvw.cxx @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include -- cgit v1.2.3 From 80c54710e69437a743c9a0213c4e76eed6286945 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 5 Jan 2010 16:37:47 +0100 Subject: swunolocking1: #i105557#: unoobj.hxx: split out unoparaframeenum.hxx: move SwXParaFrameEnumeration from unoobj.hxx to new unoparaframeenum.hxx. move FrameDependSortList_t, CollectFrameAtNode to unoparaframeenum.hxx. --- sw/inc/unoobj.hxx | 68 ---------------- sw/inc/unoparaframeenum.hxx | 138 ++++++++++++++++++++++++++++++++ sw/source/core/unocore/unoobj2.cxx | 2 +- sw/source/core/unocore/unoparagraph.cxx | 2 +- sw/source/core/unocore/unoport.cxx | 1 + sw/source/core/unocore/unoportenum.cxx | 1 + 6 files changed, 142 insertions(+), 70 deletions(-) create mode 100644 sw/inc/unoparaframeenum.hxx diff --git a/sw/inc/unoobj.hxx b/sw/inc/unoobj.hxx index d43a4a7105e1..ae9eaa205a3b 100644 --- a/sw/inc/unoobj.hxx +++ b/sw/inc/unoobj.hxx @@ -50,27 +50,10 @@ #include -#include -#include - class GetCurTxtFmtColl; -struct FrameDependSortListEntry { - xub_StrLen nIndex; - sal_uInt32 nOrder; - ::boost::shared_ptr pFrameDepend; - FrameDependSortListEntry (xub_StrLen const i_nIndex, - sal_uInt32 const i_nOrder, SwDepend * const i_pDepend) - : nIndex(i_nIndex), nOrder(i_nOrder), pFrameDepend(i_pDepend) { } -}; -typedef ::std::deque< FrameDependSortListEntry > - FrameDependSortList_t; - -typedef ::std::deque< ::boost::shared_ptr > - FrameDependList_t; - /* -----------------26.06.98 16:18------------------- * @@ -79,10 +62,6 @@ typedef ::std::deque< ::boost::shared_ptr > SwPageDesc* GetPageDescByName_Impl(SwDoc& rDoc, const String& rName); ::com::sun::star::uno::Sequence< sal_Int8 > CreateUnoTunnelId(); -// OD 2004-05-07 #i28701# - adjust 4th parameter -void CollectFrameAtNode( SwClient& rClnt, const SwNodeIndex& rIdx, - FrameDependSortList_t & rFrames, - const bool _bAtCharAnchoredObjs ); /*-----------------04.03.98 11:54------------------- Start/EndAction oder Start/EndAllAction @@ -168,53 +147,6 @@ public: --------------------------------------------------*/ -/* -----------------23.03.99 12:57------------------- - * - * --------------------------------------------------*/ -#define PARAFRAME_PORTION_PARAGRAPH 0 -#define PARAFRAME_PORTION_CHAR 1 -#define PARAFRAME_PORTION_TEXTRANGE 2 - -class SwXParaFrameEnumeration : public cppu::WeakImplHelper2 -< - ::com::sun::star::container::XEnumeration, - ::com::sun::star::lang::XServiceInfo ->, - public SwClient -{ - ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > - m_xNextObject; // created by hasMoreElements - FrameDependList_t m_Frames; - - SwUnoCrsr* GetCursor() const - {return static_cast(const_cast(GetRegisteredIn()));} - -public: - SwXParaFrameEnumeration(const SwPaM& rPaM, - sal_uInt8 nParaFrameMode, SwFrmFmt* pFmt = 0); - ~SwXParaFrameEnumeration(); - - // XEnumeration - virtual sal_Bool SAL_CALL hasMoreElements() - throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Any SAL_CALL nextElement() - throw( ::com::sun::star::container::NoSuchElementException, - ::com::sun::star::lang::WrappedTargetException, - ::com::sun::star::uno::RuntimeException ); - - // XServiceInfo - virtual rtl::OUString SAL_CALL getImplementationName() - throw( ::com::sun::star::uno::RuntimeException ); - virtual sal_Bool SAL_CALL supportsService(const rtl::OUString& ServiceName) - throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL - getSupportedServiceNames() - throw( ::com::sun::star::uno::RuntimeException ); - - //SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); -}; - /* -----------------29.09.98 09:01------------------- * diff --git a/sw/inc/unoparaframeenum.hxx b/sw/inc/unoparaframeenum.hxx new file mode 100644 index 000000000000..d05fccfed46d --- /dev/null +++ b/sw/inc/unoparaframeenum.hxx @@ -0,0 +1,138 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: unoobj.hxx,v $ + * + * $Revision: 1.49 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SW_UNOPARAFRAMEENUM_HXX +#define SW_UNOPARAFRAMEENUM_HXX + +#include + +#include + +#include +#include +#include + +#include + +#include +#include + + +class SwNodeIndex; +class SwPaM; +class SwUnoCrsr; +class SwFrmFmt; + + +struct FrameDependSortListEntry +{ + xub_StrLen nIndex; + sal_uInt32 nOrder; + ::boost::shared_ptr pFrameDepend; + + FrameDependSortListEntry (xub_StrLen const i_nIndex, + sal_uInt32 const i_nOrder, SwDepend * const i_pDepend) + : nIndex(i_nIndex), nOrder(i_nOrder), pFrameDepend(i_pDepend) { } +}; + +typedef ::std::deque< FrameDependSortListEntry > + FrameDependSortList_t; + +typedef ::std::deque< ::boost::shared_ptr > + FrameDependList_t; + + +// OD 2004-05-07 #i28701# - adjust 4th parameter +void CollectFrameAtNode( SwClient& rClnt, const SwNodeIndex& rIdx, + FrameDependSortList_t & rFrames, + const bool _bAtCharAnchoredObjs ); + + +/* -----------------23.03.99 12:57------------------- + * + * --------------------------------------------------*/ + +#define PARAFRAME_PORTION_PARAGRAPH 0 +#define PARAFRAME_PORTION_CHAR 1 +#define PARAFRAME_PORTION_TEXTRANGE 2 + + +typedef ::cppu::WeakImplHelper2 +< ::com::sun::star::lang::XServiceInfo +, ::com::sun::star::container::XEnumeration +> SwXParaFrameEnumeration_Base; + +class SwXParaFrameEnumeration + : public SwXParaFrameEnumeration_Base + , public SwClient +{ + +private: + + ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > + m_xNextObject; // created by hasMoreElements + FrameDependList_t m_Frames; + + SwUnoCrsr* GetCursor() const + {return static_cast(const_cast(GetRegisteredIn()));} + + virtual ~SwXParaFrameEnumeration(); + +public: + + SwXParaFrameEnumeration(const SwPaM& rPaM, + sal_uInt8 nParaFrameMode, SwFrmFmt* pFmt = 0); + + // SwClient + virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( + const ::rtl::OUString& rServiceName) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames() + throw (::com::sun::star::uno::RuntimeException); + + // XEnumeration + virtual sal_Bool SAL_CALL hasMoreElements() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL nextElement() + throw (::com::sun::star::container::NoSuchElementException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + +}; + +#endif // SW_UNOPARAFRAMEENUM_HXX + diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index aa6a35526866..506cc5d81cdf 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -31,7 +31,6 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - #include #include #include @@ -78,6 +77,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx index 8a47c71ebd75..dd809240151e 100644 --- a/sw/source/core/unocore/unoparagraph.cxx +++ b/sw/source/core/unocore/unoparagraph.cxx @@ -31,10 +31,10 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unoport.cxx b/sw/source/core/unocore/unoport.cxx index f7b2e40fa440..eba2f9e923d3 100644 --- a/sw/source/core/unocore/unoport.cxx +++ b/sw/source/core/unocore/unoport.cxx @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx index f9379cbd476f..214336dce955 100644 --- a/sw/source/core/unocore/unoportenum.cxx +++ b/sw/source/core/unocore/unoportenum.cxx @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include -- cgit v1.2.3 From 7e156d00e9e09e3329856c685a9c6c0138db1253 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 5 Jan 2010 16:37:49 +0100 Subject: swunolocking1: #i105557#: unoobj.hxx: move misc stuff: move GetPageDescByName_Impl from unoobj.hxx to pagedesc.hxx. move UnoActionContext, UnoActionRemoveContext, ClientModify, CreateUnoTunnelId from unoobj.hxx to unobaseclass.hxx. move UnoActionContext, UnoActionRemoveContext from unoobj.cxx to unoobj2.cxx. --- sw/inc/pagedesc.hxx | 3 ++ sw/inc/unobaseclass.hxx | 52 +++++++++++++++++++--- sw/inc/unoobj.hxx | 26 ----------- sw/inc/unoparagraph.hxx | 2 +- sw/inc/unoredlines.hxx | 5 ++- sw/inc/unotbl.hxx | 1 + sw/source/core/unocore/TextCursorHelper.cxx | 4 +- sw/source/core/unocore/unobkm.cxx | 1 - sw/source/core/unocore/unochart.cxx | 3 +- sw/source/core/unocore/unocoll.cxx | 3 +- sw/source/core/unocore/unocrsrhelper.cxx | 1 - sw/source/core/unocore/unodraw.cxx | 4 +- sw/source/core/unocore/unofield.cxx | 1 - sw/source/core/unocore/unoflatpara.cxx | 2 +- sw/source/core/unocore/unoframe.cxx | 3 +- sw/source/core/unocore/unoftn.cxx | 3 +- sw/source/core/unocore/unoidx.cxx | 2 +- sw/source/core/unocore/unoobj.cxx | 45 ------------------- sw/source/core/unocore/unoobj2.cxx | 57 ++++++++++++++++++++++++- sw/source/core/unocore/unoparagraph.cxx | 1 - sw/source/core/unocore/unoport.cxx | 3 +- sw/source/core/unocore/unoportenum.cxx | 3 +- sw/source/core/unocore/unoredline.cxx | 9 ++-- sw/source/core/unocore/unoredlines.cxx | 8 ++-- sw/source/core/unocore/unorefmk.cxx | 3 +- sw/source/core/unocore/unosect.cxx | 4 +- sw/source/core/unocore/unosett.cxx | 5 --- sw/source/core/unocore/unosrch.cxx | 7 +-- sw/source/core/unocore/unostyle.cxx | 1 - sw/source/core/unocore/unotbl.cxx | 1 - sw/source/core/unocore/unotext.cxx | 8 ++-- sw/source/filter/html/htmlforw.cxx | 2 +- sw/source/filter/ww8/ww8atr.cxx | 4 +- sw/source/filter/xml/XMLRedlineImportHelper.cxx | 1 - sw/source/filter/xml/xmlexp.cxx | 1 - sw/source/filter/xml/xmlfmt.cxx | 10 +---- sw/source/filter/xml/xmlfonte.cxx | 1 - sw/source/filter/xml/xmlimp.cxx | 2 +- sw/source/filter/xml/xmlmeta.cxx | 1 - sw/source/filter/xml/xmltble.cxx | 1 - sw/source/filter/xml/xmltexti.cxx | 2 +- sw/source/ui/app/docsh2.cxx | 35 ++------------- sw/source/ui/envelp/labelexp.cxx | 2 +- sw/source/ui/misc/glossary.cxx | 22 +--------- sw/source/ui/shells/drwtxtsh.cxx | 6 +-- sw/source/ui/shells/tabsh.cxx | 6 +-- sw/source/ui/table/chartins.cxx | 7 --- sw/source/ui/uno/SwXDocumentSettings.cxx | 6 +-- sw/source/ui/uno/unoatxt.cxx | 2 +- sw/source/ui/uno/unodispatch.cxx | 7 +-- sw/source/ui/uno/unomod.cxx | 2 +- sw/source/ui/uno/unotxdoc.cxx | 2 +- sw/source/ui/uno/unotxvw.cxx | 1 - sw/source/ui/utlui/swrenamexnameddlg.cxx | 1 - 54 files changed, 170 insertions(+), 225 deletions(-) diff --git a/sw/inc/pagedesc.hxx b/sw/inc/pagedesc.hxx index 40d8874f912d..8815945c8bc4 100644 --- a/sw/inc/pagedesc.hxx +++ b/sw/inc/pagedesc.hxx @@ -344,4 +344,7 @@ public: operator SwPageDesc() const; // #i7983# }; + +SwPageDesc* GetPageDescByName_Impl(SwDoc& rDoc, const String& rName); + #endif //_PAGEDESC_HXX diff --git a/sw/inc/unobaseclass.hxx b/sw/inc/unobaseclass.hxx index adb7b880356a..75443b2c7584 100644 --- a/sw/inc/unobaseclass.hxx +++ b/sw/inc/unobaseclass.hxx @@ -30,18 +30,22 @@ #ifndef _UNOBASECLASS_HXX #define _UNOBASECLASS_HXX -#include #include #include + #include -typedef -cppu::WeakImplHelper2 -< - ::com::sun::star::container::XEnumeration, - ::com::sun::star::lang::XServiceInfo + +class SfxPoolItem; +class SwClient; +class SwDoc; + + +typedef ::cppu::WeakImplHelper2 +< ::com::sun::star::lang::XServiceInfo +, ::com::sun::star::container::XEnumeration > -SwSimpleEnumerationBaseClass; +SwSimpleEnumeration_Base; /* -----------------29.04.98 07:35------------------- @@ -64,5 +68,39 @@ enum CursorType CURSOR_META, // meta/meta-field }; +/*-----------------04.03.98 11:54------------------- + Start/EndAction or Start/EndAllAction + -------------------------------------------------- */ +class UnoActionContext +{ + private: + SwDoc * m_pDoc; + + public: + UnoActionContext(SwDoc *const pDoc); + ~UnoActionContext(); + + void InvalidateDocument() { m_pDoc = 0; } +}; + +/* -----------------07.07.98 12:03------------------- + interrupt Actions for a little while + -------------------------------------------------- */ +class UnoActionRemoveContext +{ + private: + SwDoc *const m_pDoc; + + public: + UnoActionRemoveContext(SwDoc *const pDoc); + ~UnoActionRemoveContext(); +}; + + +::com::sun::star::uno::Sequence< sal_Int8 > CreateUnoTunnelId(); + +/// helper function for implementing SwClient::Modify +void ClientModify(SwClient* pClient, SfxPoolItem *pOld, SfxPoolItem *pNew); + #endif diff --git a/sw/inc/unoobj.hxx b/sw/inc/unoobj.hxx index ae9eaa205a3b..6ab11b13e9ec 100644 --- a/sw/inc/unoobj.hxx +++ b/sw/inc/unoobj.hxx @@ -59,38 +59,12 @@ class GetCurTxtFmtColl; * * --------------------------------------------------*/ -SwPageDesc* GetPageDescByName_Impl(SwDoc& rDoc, const String& rName); -::com::sun::star::uno::Sequence< sal_Int8 > CreateUnoTunnelId(); -/*-----------------04.03.98 11:54------------------- - Start/EndAction oder Start/EndAllAction ---------------------------------------------------*/ -class UnoActionContext -{ - SwDoc* pDoc; - public: - UnoActionContext(SwDoc* pDoc); - ~UnoActionContext(); - - void InvalidateDocument() {pDoc = 0;} -}; -/* -----------------07.07.98 12:03------------------- - * Actions kurzfristig unterbrechen - * --------------------------------------------------*/ -class UnoActionRemoveContext -{ - SwDoc* pDoc; - public: - UnoActionRemoveContext(SwDoc* pDoc); - ~UnoActionRemoveContext(); -}; - /****************************************************************************** * ******************************************************************************/ -void ClientModify(SwClient* pClient, SfxPoolItem *pOld, SfxPoolItem *pNew); /*-----------------20.03.98 07:47------------------- diff --git a/sw/inc/unoparagraph.hxx b/sw/inc/unoparagraph.hxx index 6ef62e00c1a9..984786b0d1fb 100644 --- a/sw/inc/unoparagraph.hxx +++ b/sw/inc/unoparagraph.hxx @@ -359,7 +359,7 @@ public: --------------------------------------------------*/ class SwXParagraphEnumeration - : public SwSimpleEnumerationBaseClass + : public SwSimpleEnumeration_Base , public SwClient { diff --git a/sw/inc/unoredlines.hxx b/sw/inc/unoredlines.hxx index 52f2ab16a368..ba08afc1f8bf 100644 --- a/sw/inc/unoredlines.hxx +++ b/sw/inc/unoredlines.hxx @@ -78,8 +78,9 @@ public: /* -----------------------------12.01.01 14:58-------------------------------- ---------------------------------------------------------------------------*/ -class SwXRedlineEnumeration : public SwSimpleEnumerationBaseClass, - public SwClient +class SwXRedlineEnumeration + : public SwSimpleEnumeration_Base + , public SwClient { SwDoc* pDoc; USHORT nCurrentIndex; diff --git a/sw/inc/unotbl.hxx b/sw/inc/unotbl.hxx index d2e14309a5d4..a539c7384a39 100644 --- a/sw/inc/unotbl.hxx +++ b/sw/inc/unotbl.hxx @@ -51,6 +51,7 @@ #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/TextCursorHelper.cxx b/sw/source/core/unocore/TextCursorHelper.cxx index ec64dd0d7593..8eb1019183ad 100644 --- a/sw/source/core/unocore/TextCursorHelper.cxx +++ b/sw/source/core/unocore/TextCursorHelper.cxx @@ -30,8 +30,10 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" + #include "TextCursorHelper.hxx" -#include "unoobj.hxx" +#include "unobaseclass.hxx" + using namespace ::com::sun::star; /* -----------------------------03.03.03 11:07-------------------------------- diff --git a/sw/source/core/unocore/unobkm.cxx b/sw/source/core/unocore/unobkm.cxx index 171bead57a09..282ae6b389a8 100644 --- a/sw/source/core/unocore/unobkm.cxx +++ b/sw/source/core/unocore/unobkm.cxx @@ -35,7 +35,6 @@ #include #include #include -#include #include #include #include diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx index 8103b924ae98..f3a2fe55499d 100644 --- a/sw/source/core/unocore/unochart.cxx +++ b/sw/source/core/unocore/unochart.cxx @@ -34,7 +34,6 @@ #include #include - #include #include #include @@ -51,7 +50,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx index 437fec101e53..557e73c17ac4 100644 --- a/sw/source/core/unocore/unocoll.cxx +++ b/sw/source/core/unocore/unocoll.cxx @@ -874,7 +874,8 @@ namespace } template - class SwXFrameEnumeration : public SwSimpleEnumerationBaseClass + class SwXFrameEnumeration + : public SwSimpleEnumeration_Base { private: typedef ::std::slist< Any > frmcontainer_t; diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index e152ff2b9d23..1138f5ee273e 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -36,7 +36,6 @@ #include #include -#include #include #include #include diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index 2bfaadaa4f1e..b967f59f4899 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -37,7 +37,6 @@ #include #include #include -#include #include #include #include @@ -443,7 +442,8 @@ uno::Reference< drawing::XShape > SwFmDrawPage::_CreateShape( SdrObject *pObj ) ****************************************************************************/ namespace { - class SwXShapesEnumeration : public SwSimpleEnumerationBaseClass + class SwXShapesEnumeration + : public SwSimpleEnumeration_Base { private: typedef ::std::slist< ::com::sun::star::uno::Any > shapescontainer_t; diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index eca06ed0d741..59954b6a954e 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -41,7 +41,6 @@ #include #include #include -#include #include #include #include diff --git a/sw/source/core/unocore/unoflatpara.cxx b/sw/source/core/unocore/unoflatpara.cxx index 66796031c4ba..42f2934c5b01 100644 --- a/sw/source/core/unocore/unoflatpara.cxx +++ b/sw/source/core/unocore/unoflatpara.cxx @@ -46,7 +46,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 14ac1007d3ae..9d3fab300c03 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -30,6 +30,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" + #include #include #include @@ -60,7 +61,6 @@ #include #include #include -#include #include #include #include @@ -100,6 +100,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unoftn.cxx b/sw/source/core/unocore/unoftn.cxx index a4d83d8f51d5..5ef6c3d3c5bc 100644 --- a/sw/source/core/unocore/unoftn.cxx +++ b/sw/source/core/unocore/unoftn.cxx @@ -34,7 +34,8 @@ #include #include #include -#include + +#include #include #include #include diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index e8bba7ac7357..92309d6368cf 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -55,8 +55,8 @@ #include #endif #include +#include #include -#include #include #include #include diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx index 13a102164cad..eb89201cf978 100644 --- a/sw/source/core/unocore/unoobj.cxx +++ b/sw/source/core/unocore/unoobj.cxx @@ -82,7 +82,6 @@ #include #include #include -#include #include #include #include @@ -187,50 +186,6 @@ SwUnoInternalPaM& SwUnoInternalPaM::operator=(const SwPaM& rPaM) } return *this; } -/**************************************************************************** - ActionContext -****************************************************************************/ -UnoActionContext::UnoActionContext(SwDoc* pDc) : - pDoc(pDc) -{ - SwRootFrm* pRootFrm = pDoc->GetRootFrm(); - if(pRootFrm) - pRootFrm->StartAllAction(); -} -/*-----------------04.03.98 11:56------------------- - ---------------------------------------------------*/ -UnoActionContext::~UnoActionContext() -{ - //das Doc kann hier schon entfernt worden sein - if(pDoc) - { - SwRootFrm* pRootFrm = pDoc->GetRootFrm(); - if(pRootFrm) - pRootFrm->EndAllAction(); - } -} - -/**************************************************************************** - ActionRemoveContext -****************************************************************************/ -UnoActionRemoveContext::UnoActionRemoveContext(SwDoc* pDc) : - pDoc(pDc) -{ - SwRootFrm* pRootFrm = pDoc->GetRootFrm(); - if(pRootFrm) - pRootFrm->UnoRemoveAllActions(); -} -/* -----------------07.07.98 12:05------------------- - * - * --------------------------------------------------*/ -UnoActionRemoveContext::~UnoActionRemoveContext() -{ - SwRootFrm* pRootFrm = pDoc->GetRootFrm(); - if(pRootFrm) - pRootFrm->UnoRestoreAllActions(); - -} /*-----------------09.03.98 08:29------------------- diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index 506cc5d81cdf..6d2a0d49f9d5 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -76,7 +76,6 @@ #include #include #include -#include #include #include #include @@ -100,6 +99,7 @@ #include #include #include +#include #include #include #include @@ -227,6 +227,60 @@ void CollectFrameAtNode( SwClient& rClnt, const SwNodeIndex& rIdx, } } +/**************************************************************************** + ActionContext +****************************************************************************/ +UnoActionContext::UnoActionContext(SwDoc *const pDoc) + : m_pDoc(pDoc) +{ + SwRootFrm *const pRootFrm = m_pDoc->GetRootFrm(); + if (pRootFrm) + { + pRootFrm->StartAllAction(); + } +} + +/*-----------------04.03.98 11:56------------------- + +--------------------------------------------------*/ +UnoActionContext::~UnoActionContext() +{ + // Doc may already have been removed here + if (m_pDoc) + { + SwRootFrm *const pRootFrm = m_pDoc->GetRootFrm(); + if (pRootFrm) + { + pRootFrm->EndAllAction(); + } + } +} + +/**************************************************************************** + ActionRemoveContext +****************************************************************************/ +UnoActionRemoveContext::UnoActionRemoveContext(SwDoc *const pDoc) + : m_pDoc(pDoc) +{ + SwRootFrm *const pRootFrm = m_pDoc->GetRootFrm(); + if (pRootFrm) + { + pRootFrm->UnoRemoveAllActions(); + } +} + +/* -----------------07.07.98 12:05------------------- + * + * --------------------------------------------------*/ +UnoActionRemoveContext::~UnoActionRemoveContext() +{ + SwRootFrm *const pRootFrm = m_pDoc->GetRootFrm(); + if (pRootFrm) + { + pRootFrm->UnoRestoreAllActions(); + } +} + /*-- 09.12.98 14:18:58--------------------------------------------------- @@ -752,6 +806,7 @@ SwDoc* SwXTextCursor::GetDoc() return GetCrsr() ? GetCrsr()->GetDoc() : 0; } + /*-- 09.12.98 14:19:03--------------------------------------------------- -----------------------------------------------------------------------*/ diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx index dd809240151e..22611e0b8e5b 100644 --- a/sw/source/core/unocore/unoparagraph.cxx +++ b/sw/source/core/unocore/unoparagraph.cxx @@ -33,7 +33,6 @@ #include #include -#include #include #include #include diff --git a/sw/source/core/unocore/unoport.cxx b/sw/source/core/unocore/unoport.cxx index eba2f9e923d3..909c7bc7a450 100644 --- a/sw/source/core/unocore/unoport.cxx +++ b/sw/source/core/unocore/unoport.cxx @@ -36,9 +36,9 @@ #include #include #include + #include #include -#include #include #include #include @@ -51,6 +51,7 @@ #include #include #include +#include #include #include diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx index 214336dce955..8ce587ef8bc6 100644 --- a/sw/source/core/unocore/unoportenum.cxx +++ b/sw/source/core/unocore/unoportenum.cxx @@ -46,7 +46,7 @@ #include #include #include -#include +#include #include #include #include @@ -56,6 +56,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/core/unocore/unoredline.cxx b/sw/source/core/unocore/unoredline.cxx index 1aca819a6d2e..031f339773a2 100644 --- a/sw/source/core/unocore/unoredline.cxx +++ b/sw/source/core/unocore/unoredline.cxx @@ -31,15 +31,19 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" +#include +#include +#include #include #include + #include #include "poolfmt.hxx" #include #include #include -#include +#include #include #include #include @@ -49,9 +53,6 @@ #include #include #include -#include -#include -#include using namespace ::com::sun::star; diff --git a/sw/source/core/unocore/unoredlines.cxx b/sw/source/core/unocore/unoredlines.cxx index a88b3ff4672c..4ce2e8f5a414 100644 --- a/sw/source/core/unocore/unoredlines.cxx +++ b/sw/source/core/unocore/unoredlines.cxx @@ -31,19 +31,21 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" +#include +#include #include #include + #include #include -#include -#include +#include #include #include "poolfmt.hxx" #include #include #include -#include + using namespace ::com::sun::star; using ::rtl::OUString; diff --git a/sw/source/core/unocore/unorefmk.cxx b/sw/source/core/unocore/unorefmk.cxx index 61c3056a7bef..13b52a6b226b 100644 --- a/sw/source/core/unocore/unorefmk.cxx +++ b/sw/source/core/unocore/unorefmk.cxx @@ -33,7 +33,8 @@ #include #include -#include + +#include #include #include #include diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx index 5a87da1e48ab..9f599533eec9 100644 --- a/sw/source/core/unocore/unosect.cxx +++ b/sw/source/core/unocore/unosect.cxx @@ -31,6 +31,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" +#include #include #include @@ -43,7 +44,6 @@ #include #include #include -#include #include #include #include @@ -64,7 +64,7 @@ #include #include #include -#include +#include #include /* #109700# */ #include diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx index 0df45c83458a..31d104cc96a5 100644 --- a/sw/source/core/unocore/unosett.cxx +++ b/sw/source/core/unocore/unosett.cxx @@ -61,20 +61,15 @@ #include #include #include -#ifndef _COM_SUN_STAR_BEANS_PropertyAttribute_HPP_ #include -#endif #include -#include #include #include #include #include #include #include -#ifndef _TOOLKIT_UNOHLP_HXX #include -#endif #include #include #include diff --git a/sw/source/core/unocore/unosrch.cxx b/sw/source/core/unocore/unosrch.cxx index 12cc91b1a3f5..1a0a523bb17f 100644 --- a/sw/source/core/unocore/unosrch.cxx +++ b/sw/source/core/unocore/unosrch.cxx @@ -30,13 +30,14 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" -#include "unosrch.hxx" - +#include "unosrch.hxx" #include #include #include -#include +#include +#include + #include #include #include "svx/unolingu.hxx" diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index cbf75f593146..1866613e8ab0 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -60,7 +60,6 @@ #include #include #include -#include #include #include #include diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index e24e17dd47cb..a6ad01ea7a4f 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -83,7 +83,6 @@ #include #include #include -#include #include #include #include diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index 63e27c7abc8d..e571cd722f6c 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -34,12 +34,13 @@ #include #include +#include -#include #include #include #include -#include + +#include #include #include #include @@ -68,9 +69,10 @@ #include #include #include +#include #include #include -#include + #include #include diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx index 575cbc4c719e..b234e16eecfe 100644 --- a/sw/source/filter/html/htmlforw.cxx +++ b/sw/source/filter/html/htmlforw.cxx @@ -63,7 +63,7 @@ #include #include #include -#include + #include #include #include diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index 3712c13d372d..c081d8c88a67 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -128,9 +128,7 @@ #include -#if OSL_DEBUG_LEVEL > 1 -# include -#endif +#include #include "writerhelper.hxx" #include "writerwordglue.hxx" #include "wrtww8.hxx" diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.cxx b/sw/source/filter/xml/XMLRedlineImportHelper.cxx index 0102462b4864..4b89f042977f 100644 --- a/sw/source/filter/xml/XMLRedlineImportHelper.cxx +++ b/sw/source/filter/xml/XMLRedlineImportHelper.cxx @@ -34,7 +34,6 @@ #include "XMLRedlineImportHelper.hxx" #include -#include "unoobj.hxx" #include #include #include "doc.hxx" diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx index 74196dfbd9ce..98009fccef38 100644 --- a/sw/source/filter/xml/xmlexp.cxx +++ b/sw/source/filter/xml/xmlexp.cxx @@ -56,7 +56,6 @@ #include #include #include -#include #include #include #include diff --git a/sw/source/filter/xml/xmlfmt.cxx b/sw/source/filter/xml/xmlfmt.cxx index 357546259777..cba68f69091e 100644 --- a/sw/source/filter/xml/xmlfmt.cxx +++ b/sw/source/filter/xml/xmlfmt.cxx @@ -43,7 +43,6 @@ #include #include #include -#include #include #include #include @@ -57,19 +56,11 @@ #include #include "xmlitem.hxx" #include -#ifndef _XMLOFF_TXTSTYLI_HXX #include -#endif -#ifndef _XMLOFF_TXTIMP_HXX #include -#endif -#ifndef _XMLOFF_FAMILIES_HXX #include -#endif #include -#ifndef _XMLOFF_XMLTEXTSHAPESTYLECONTEXT_HXX #include -#endif #include #include "xmlimp.hxx" #include "xmltbli.hxx" @@ -79,6 +70,7 @@ #include #include + using namespace ::com::sun::star; using ::rtl::OUString; using ::rtl::OUStringBuffer; diff --git a/sw/source/filter/xml/xmlfonte.cxx b/sw/source/filter/xml/xmlfonte.cxx index d3d8772e43da..3fc753058f3c 100644 --- a/sw/source/filter/xml/xmlfonte.cxx +++ b/sw/source/filter/xml/xmlfonte.cxx @@ -35,7 +35,6 @@ #include #include #include -//#include #include #include #include diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx index cf96a699dd7f..003318dbe989 100644 --- a/sw/source/filter/xml/xmlimp.cxx +++ b/sw/source/filter/xml/xmlimp.cxx @@ -30,6 +30,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" + #include #include #include @@ -47,7 +48,6 @@ #include #include #include -#include #include #include #include "unocrsr.hxx" diff --git a/sw/source/filter/xml/xmlmeta.cxx b/sw/source/filter/xml/xmlmeta.cxx index e9acd9a7ab77..733bf0749faf 100644 --- a/sw/source/filter/xml/xmlmeta.cxx +++ b/sw/source/filter/xml/xmlmeta.cxx @@ -45,7 +45,6 @@ #include "docstat.hxx" #include "docsh.hxx" #include -#include #include "xmlimp.hxx" #include "xmlexp.hxx" diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx index b80a8f15eda8..05b9d1740f4f 100644 --- a/sw/source/filter/xml/xmltble.cxx +++ b/sw/source/filter/xml/xmltble.cxx @@ -61,7 +61,6 @@ #include #include #include // for cTokenSeperator -#include "unoobj.hxx" #include "unotbl.hxx" #include "xmltexte.hxx" #include "xmlexp.hxx" diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx index acf49038078a..fdd551566789 100644 --- a/sw/source/filter/xml/xmltexti.cxx +++ b/sw/source/filter/xml/xmltexti.cxx @@ -50,13 +50,13 @@ #include #include #include "unocrsr.hxx" -#include "unoobj.hxx" #include "TextCursorHelper.hxx" #include "unoframe.hxx" #include "doc.hxx" #include "unocoll.hxx" #include #include +#include #include "xmlimp.hxx" #include "xmltbli.hxx" #include "xmltexti.hxx" diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx index 3fd1e879b063..4dad964fafca 100644 --- a/sw/source/ui/app/docsh2.cxx +++ b/sw/source/ui/app/docsh2.cxx @@ -30,30 +30,19 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" -#ifndef _COM_SUN_STAR_LANG_XMultiServiceFactory_HPP_ -#include -#endif -#ifndef _UNOTOOLS_PROCESSFACTORY_HXX -#include -#endif +#include #include +#include #include #include #include -#ifndef _WRKWIN_HXX //autogen #include -#endif -#ifndef _MSGBOX_HXX //autogen #include -#endif #include #include -/* -#include -*/ #include #include #include @@ -90,51 +79,33 @@ #include #include #include -#ifndef _VIEW_HXX #include // fuer die aktuelle Sicht -#endif -#ifndef _DOCSH_HXX #include // Dokumenterzeugung -#endif #include #include #include -#ifndef _GLOBDOC_HXX #include -#endif #include -#ifndef _REDLNDLG_HXX #include -#endif #include #include #include #include -#ifndef _PVIEW_HXX #include -#endif -#ifndef _SRCVIEW_HXX #include -#endif #include #include -#ifndef _WDOCSH_HXX #include -#endif #include #include #include -#include +#include #include #include -#ifndef _CMDID_H #include -#endif #include -#ifndef _HELPID_H #include -#endif #ifndef _APP_HRC #include #endif diff --git a/sw/source/ui/envelp/labelexp.cxx b/sw/source/ui/envelp/labelexp.cxx index 5c32abede88a..450ebabb1a76 100644 --- a/sw/source/ui/envelp/labelexp.cxx +++ b/sw/source/ui/envelp/labelexp.cxx @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx index ef368f680378..d40772b3a0f1 100644 --- a/sw/source/ui/misc/glossary.cxx +++ b/sw/source/ui/misc/glossary.cxx @@ -30,25 +30,18 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" + #ifdef SW_DLLIMPLEMENTATION #undef SW_DLLIMPLEMENTATION #endif - - #define _SVSTDARR_STRINGSDTOR #define _SVSTDARR_STRINGS #include -#ifndef _MENU_HXX //autogen #include -#endif -#ifndef _MSGBOX_HXX //autogen #include -#endif -#ifndef _HELP_HXX //autogen #include -#endif #ifndef _SVSTDARR_HXX #include #endif @@ -64,7 +57,6 @@ #include #include #include -#include #include #include #include @@ -75,12 +67,8 @@ #include #include #include -#ifndef _VIEW_HXX #include -#endif -#ifndef _BASESH_HXX #include -#endif #include #include #include @@ -88,20 +76,12 @@ #include #include #include -#ifndef _DOCSH_HXX #include -#endif #include -#ifndef _CMDID_H #include -#endif -#ifndef _HELPID_H #include -#endif -#ifndef _SWERROR_H #include -#endif #ifndef _GLOBALS_HRC #include #endif diff --git a/sw/source/ui/shells/drwtxtsh.cxx b/sw/source/ui/shells/drwtxtsh.cxx index 9f1d49ebe067..00bf99ce04a3 100644 --- a/sw/source/ui/shells/drwtxtsh.cxx +++ b/sw/source/ui/shells/drwtxtsh.cxx @@ -30,6 +30,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" + #include #include #include @@ -53,7 +54,6 @@ #include #include #include -#include #include #include #include @@ -67,12 +67,8 @@ #include #include -#ifndef _CMDID_H #include -#endif -#ifndef _HELPID_H #include -#endif #ifndef _GLOBALS_HRC #include #endif diff --git a/sw/source/ui/shells/tabsh.cxx b/sw/source/ui/shells/tabsh.cxx index 7ba4d0b8e954..fd7e4ba4d3b8 100644 --- a/sw/source/ui/shells/tabsh.cxx +++ b/sw/source/ui/shells/tabsh.cxx @@ -108,16 +108,12 @@ #ifndef _TABLE_HRC #include #endif -#ifndef _CMDID_H #include -#endif #ifndef _GLOBALS_HRC #include #endif -#ifndef _HELPID_H #include -#endif -#include +#include #define SwTableShell #include diff --git a/sw/source/ui/table/chartins.cxx b/sw/source/ui/table/chartins.cxx index 6c9916e27e0e..0cf308dd4fe4 100644 --- a/sw/source/ui/table/chartins.cxx +++ b/sw/source/ui/table/chartins.cxx @@ -33,9 +33,7 @@ #include -#ifndef _MSGBOX_HXX //autogen #include -#endif #include #include #include @@ -45,24 +43,19 @@ #include #include #include -#ifndef _VIEW_HXX #include -#endif #include #include #include #include #include -#include #include #include #include #include -#ifndef _CMDID_H #include -#endif #ifndef _CHARTINS_HRC #include #endif diff --git a/sw/source/ui/uno/SwXDocumentSettings.cxx b/sw/source/ui/uno/SwXDocumentSettings.cxx index 055dfab0c7f0..98c5903ce0eb 100644 --- a/sw/source/ui/uno/SwXDocumentSettings.cxx +++ b/sw/source/ui/uno/SwXDocumentSettings.cxx @@ -30,16 +30,13 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" + #include #include #include #include -#ifndef _COMPHELPER_MASTERPROPERTSETINFO_HXX_ #include -#endif -#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPPP_ #include -#endif #include #include #include @@ -50,7 +47,6 @@ #include #include #include -#include #include #include #include diff --git a/sw/source/ui/uno/unoatxt.cxx b/sw/source/ui/uno/unoatxt.cxx index 7ed98a979a6a..87d27b15a76b 100644 --- a/sw/source/ui/uno/unoatxt.cxx +++ b/sw/source/ui/uno/unoatxt.cxx @@ -49,7 +49,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sw/source/ui/uno/unodispatch.cxx b/sw/source/ui/uno/unodispatch.cxx index 81849559cfc2..d1d06ec87960 100644 --- a/sw/source/ui/uno/unodispatch.cxx +++ b/sw/source/ui/uno/unodispatch.cxx @@ -31,17 +31,18 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - #include #include #include +#include + #include -#include +#include #include #include #include "wrtsh.hxx" #include "dbmgr.hxx" -#include + using namespace ::com::sun::star; using namespace rtl; diff --git a/sw/source/ui/uno/unomod.cxx b/sw/source/ui/uno/unomod.cxx index ed6d61898804..69cfa1bd6457 100644 --- a/sw/source/ui/uno/unomod.cxx +++ b/sw/source/ui/uno/unomod.cxx @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index 3afeb1ee0c39..ca29279c132b 100644 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -49,7 +49,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx index 9de9e882b869..9da88953d481 100644 --- a/sw/source/ui/uno/unotxvw.cxx +++ b/sw/source/ui/uno/unotxvw.cxx @@ -47,7 +47,6 @@ #include #include #include -#include #include #include #include diff --git a/sw/source/ui/utlui/swrenamexnameddlg.cxx b/sw/source/ui/utlui/swrenamexnameddlg.cxx index 85d8aa2cf7a6..1420831b4a84 100644 --- a/sw/source/ui/utlui/swrenamexnameddlg.cxx +++ b/sw/source/ui/utlui/swrenamexnameddlg.cxx @@ -63,7 +63,6 @@ #include #include #include -#include #include #include "swrenamexnameddlg.hxx" -- cgit v1.2.3 From 4f555e6d5467a2a198113789c5527969e287da9c Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 5 Jan 2010 16:37:49 +0100 Subject: swunolocking1: #i105557#: remove unoobj.hxx --- sw/inc/unoobj.hxx | 158 ------------------------------------------------------ 1 file changed, 158 deletions(-) delete mode 100644 sw/inc/unoobj.hxx diff --git a/sw/inc/unoobj.hxx b/sw/inc/unoobj.hxx deleted file mode 100644 index 6ab11b13e9ec..000000000000 --- a/sw/inc/unoobj.hxx +++ /dev/null @@ -1,158 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: unoobj.hxx,v $ - * - * $Revision: 1.49 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _UNOOBJ_HXX -#define _UNOOBJ_HXX - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include // helper for factories - -#include -#include -#include - -#include - - -class GetCurTxtFmtColl; - - - -/* -----------------26.06.98 16:18------------------- - * - * --------------------------------------------------*/ - - - -/****************************************************************************** - * - ******************************************************************************/ - - - -/*-----------------20.03.98 07:47------------------- - ---------------------------------------------------*/ -/* das wird zunaechst nicht gebraucht - bisher fuer den XPropertySetCloner -class SwXPropertySet : public ::com::sun::star::beans::XPropertySet, - public UsrObject -{ - ::com::sun::star::uno::Sequence<::com::sun::star::uno::Any>* pAny; - ::com::sun::star::uno::Sequence< Property >* pInfo; - -public: - // Eigentumsuebergang der Pointer! - SwXPropertySet( ::com::sun::star::uno::Sequence<::com::sun::star::uno::Any>* pAny, - ::com::sun::star::uno::Sequence* pInfo ); - virtual ~SwXPropertySet(); - - SMART_UNO_DECLARATION( SwXPropertySet, UsrObject ); - - //XPropertySet - virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - -}; -*/ -/*-----------------20.03.98 08:26------------------- - ---------------------------------------------------*/ -/* das wird zunaechst nicht gebraucht - bisher fuer den XPropertySetCloner - -class SwXPropertySetInfo: public ::com::sun::star::beans::XPropertySetInfo, UsrObject -{ - ::com::sun::star::uno::Sequence< Property >* pSeq; - -public: - SwXPropertySetInfo( const ::com::sun::star::uno::Sequence& rInfo ); - virtual ~SwXPropertySetInfo(); - - SMART_UNO_DECLARATION( SwXPropertySetInfo, UsrObject ); - - virtual ::com::sun::star::uno::Sequence< Property > getProperties(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual Property getPropertyByName(const rtl::OUString& Name) throw( ::com::sun::star::uno::RuntimeException ); - virtual BOOL hasPropertyByName(const rtl::OUString& Name) throw( ::com::sun::star::uno::RuntimeException ); -}; -*/ - -/*-----------------23.02.98 10:45------------------- - ---------------------------------------------------*/ - - -/* -----------------29.09.98 09:01------------------- - * - * --------------------------------------------------*/ -/* os: 04.12.98 11:40 hier gibt es noch keine sinnvolle Definition -#define MAX_SORT_FIELDS 3 // das ist eher willkuerlich (wie im Dialog) -class SwXTextSortDescriptor : public XTextSortDescriptor, - public UsrObject -{ - SwSortOptions aSortOptions; - BOOL bUseHeader; -public: - SwXTextSortDescriptor(BOOL bUsedInTable); - virtual ~SwXTextSortDescriptor(); - - //XTextSortDescriptor - virtual sal_Unicode getTextColumnSeparator(void) const; - virtual void setTextColumnSeparator(sal_Unicode TextColumnSeparator_); - - //XSortDescriptor - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::util::SortField > getSortFields(void) const; - virtual void setSortFields(const ::com::sun::star::uno::Sequence< ::com::sun::star::util::SortField >& SortFields_); - virtual sal_uInt16 getMaxFieldCount(void) const; - virtual ColumnsOrRows getOrientation(void) const; - virtual void setOrientation(ColumnsOrRows Orientation_); - virtual BOOL getUseHeader(void) const; - virtual void setUseHeader(BOOL UseHeader_); - - const SwSortOptions& GetSortOptions() const {return aSortOptions;} - void SetSortOptions(const SwSortOptions& rSortOpt); -}; -*/ - -#endif - -- cgit v1.2.3 -- cgit v1.2.3 -- cgit v1.2.3 From 4d4395e6290e3057ff67e519bbd583ee30460b51 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Tue, 5 Jan 2010 17:22:07 +0100 Subject: whitespace cleanup. --- ucbhelper/workben/ucbexplorer/ucbexplorer.cxx | 56 +++++++++++++-------------- 1 file changed, 26 insertions(+), 30 deletions(-) diff --git a/ucbhelper/workben/ucbexplorer/ucbexplorer.cxx b/ucbhelper/workben/ucbexplorer/ucbexplorer.cxx index 51490ed40296..276476d9e21f 100644 --- a/ucbhelper/workben/ucbexplorer/ucbexplorer.cxx +++ b/ucbhelper/workben/ucbexplorer/ucbexplorer.cxx @@ -38,9 +38,7 @@ #include #include #include -#ifndef _COM_SUN_STAR_UCB_XCOMMMANDINFO_HPP_ #include -#endif #include #include #include @@ -57,9 +55,7 @@ #include #include #include -#ifndef _SV_BUTTON_HXX #include -#endif #include #include #include @@ -89,8 +85,8 @@ class TestDataSink : public cppu::OWeakObject, public XActiveDataSink uno::Reference< XInputStream > m_xStream; public: -// TestDataSink() {} -// virtual ~TestDataSink(); +// TestDataSink() {} +// virtual ~TestDataSink(); // XInterface methods virtual Any SAL_CALL queryInterface( const Type & rType ) @@ -230,7 +226,7 @@ Any SAL_CALL TestDataSink::queryInterface( const Type & rType ) { Any aRet = cppu::queryInterface( rType, - static_cast< XActiveDataSink * >( this ) ); + static_cast< XActiveDataSink * >( this ) ); return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType ); } @@ -457,7 +453,7 @@ BOOL UcbExplorerListBoxEntry::createNewContent( const ContentInfo& rInfo, if ( aSourceURL.getLength() == 0 ) { DBG_ERROR( "UcbExplorerListBoxEntry::createNewContent - " - "No document data URL!" ); + "No document data URL!" ); return FALSE; } @@ -469,7 +465,7 @@ BOOL UcbExplorerListBoxEntry::createNewContent( const ContentInfo& rInfo, if ( pBroker ) { uno::Reference< XInteractionHandler > xInteractionHandler( - pBroker->getServiceManager()->createInstance( + pBroker->getServiceManager()->createInstance( OUString::createFromAscii( "com.sun.star.task.InteractionHandler" ) ), UNO_QUERY ); @@ -478,7 +474,7 @@ BOOL UcbExplorerListBoxEntry::createNewContent( const ContentInfo& rInfo, /* = new ProgressHandler( *pBroker ) */ ; xEnv = new ::ucb::CommandEnvironment( xInteractionHandler, - xProgressHandler ); + xProgressHandler ); } ::ucb::Content aSourceContent( aSourceURL, xEnv ); @@ -491,7 +487,7 @@ BOOL UcbExplorerListBoxEntry::createNewContent( const ContentInfo& rInfo, catch ( ContentCreationException const & ) { DBG_ERROR( "UcbExplorerListBoxEntry::createNewContent - " - "No content for document data!" ); + "No content for document data!" ); return FALSE; } catch ( CommandAbortedException const & ) @@ -516,7 +512,7 @@ BOOL UcbExplorerListBoxEntry::createNewContent( const ContentInfo& rInfo, // Create new content. - ULONG n = Application::ReleaseSolarMutex(); + ULONG n = Application::ReleaseSolarMutex(); BOOL bRet = sal_False; try @@ -580,13 +576,13 @@ void UcbExplorerTreeListBox::RequestingChilds( SvLBoxEntry* pParent ) { case UcbExplorerListBoxEntry::FOLDER: { - ULONG n = Application::ReleaseSolarMutex(); + ULONG n = Application::ReleaseSolarMutex(); try { Sequence< OUString > aPropertyNames( 0 ); -// OUString* pNames = aPropertyNames.getArray(); -// pNames[ 0 ] = OUString::createFromAscii( "Title" ); +// OUString* pNames = aPropertyNames.getArray(); +// pNames[ 0 ] = OUString::createFromAscii( "Title" ); uno::Reference< XResultSet > xResultSet = pEntry->m_aContent.createCursor( @@ -651,9 +647,9 @@ void UcbExplorerTreeListBox::Command( const CommandEvent& rCEvt ) PopupMenu* pMenu = new PopupMenu( ResId( MENU_POPUP ) ); PopupMenu* pNewMenu = 0; -// pMenu->SetSelectHdl( LINK( this, -// SfxCommonTemplateDialog_Impl, -// MenuSelectHdl ) ); +// pMenu->SetSelectHdl( LINK( this, +// SfxCommonTemplateDialog_Impl, +// MenuSelectHdl ) ); ////////////////////////////////////////////////////////////// // Configure "New" @@ -721,7 +717,7 @@ void UcbExplorerTreeListBox::Command( const CommandEvent& rCEvt ) { pMenu->EnableItem( MENU_DELETE, pEntry->m_aContent - .getCommands()->hasCommandByName( + .getCommands()->hasCommandByName( OUString::createFromAscii( "delete" ) ) ); } @@ -743,8 +739,8 @@ void UcbExplorerTreeListBox::Command( const CommandEvent& rCEvt ) USHORT nSelected = pMenu->Execute( this, rPos ); switch ( nSelected ) { -// case MENU_NEW: -// break; +// case MENU_NEW: +// break; case MENU_RENAME: { @@ -884,7 +880,7 @@ void UcbExplorerTreeListBox::Command( const CommandEvent& rCEvt ) { // New-menu entry selected. - ::ucb::Content aNewContent; + ::ucb::Content aNewContent; if ( pEntry->createNewContent( aInfo.getConstArray()[ nSelected - 20001 ], aNewContent ) ) @@ -910,8 +906,8 @@ void UcbExplorerTreeListBox::Command( const CommandEvent& rCEvt ) //========================================================================= UcbExplorerListBoxEntry* UcbExplorerTreeListBox::InsertEntry( - ::ucb::Content& rContent, - SvLBoxEntry* pParent ) + ::ucb::Content& rContent, + SvLBoxEntry* pParent ) { try { @@ -921,7 +917,7 @@ UcbExplorerListBoxEntry* UcbExplorerTreeListBox::InsertEntry( if ( !aTitle.getLength() ) aTitle = OUString::createFromAscii( "/" ); - UcbExplorerListBoxEntry* pEntry = 0; + UcbExplorerListBoxEntry* pEntry = 0; if ( rContent.isFolder() ) { @@ -995,8 +991,8 @@ UcbExplorerListBoxEntry* UcbExplorerTreeListBox::InsertEntry( //========================================================================= UcbExplorerListBoxEntry* UcbExplorerTreeListBox::InsertEntry( - const String& rURL, - SvLBoxEntry* pParent ) + const String& rURL, + SvLBoxEntry* pParent ) { try { @@ -1006,7 +1002,7 @@ UcbExplorerListBoxEntry* UcbExplorerTreeListBox::InsertEntry( if ( pBroker ) { uno::Reference< XInteractionHandler > xInteractionHandler( - pBroker->getServiceManager()->createInstance( + pBroker->getServiceManager()->createInstance( OUString::createFromAscii( "com.sun.star.task.InteractionHandler" ) ), UNO_QUERY ); @@ -1015,7 +1011,7 @@ UcbExplorerListBoxEntry* UcbExplorerTreeListBox::InsertEntry( /* = new ProgressHandler( *pBroker ) */ ; xEnv = new ::ucb::CommandEnvironment( xInteractionHandler, - xProgressHandler ); + xProgressHandler ); } ::ucb::Content aContent( rURL, xEnv ); @@ -1105,7 +1101,7 @@ void MyApp::Main() comphelper::setProcessServiceFactory( xFac ); - unO::Reference< XComponent > xComponent( xFac, UNO_QUERY ); + unO::Reference< XComponent > xComponent( xFac, UNO_QUERY ); ////////////////////////////////////////////////////////////////////// // Create UCB. -- cgit v1.2.3 From c062cc0b89a8832c7ad507e79fe56de10b09f659 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Tue, 5 Jan 2010 18:17:29 +0100 Subject: whitespace cleanup. --- ucbhelper/workben/ucbexplorer/ucbexplorer.src | 9 --------- 1 file changed, 9 deletions(-) diff --git a/ucbhelper/workben/ucbexplorer/ucbexplorer.src b/ucbhelper/workben/ucbexplorer/ucbexplorer.src index 14d4b8ee8770..355732741d6d 100644 --- a/ucbhelper/workben/ucbexplorer/ucbexplorer.src +++ b/ucbhelper/workben/ucbexplorer/ucbexplorer.src @@ -27,15 +27,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -//========================================================================= -// -// UCB Explorer ( resources ) -// -// (C) 2000 StarOffice Entwicklungs GmbH, Hamburg, Germany -// -// $Author: rt $ $Date: 2008-04-10 16:20:05 $Revision$ -// -//========================================================================= #include "ucbexplorer.hrc" -- cgit v1.2.3 From 59a8c29ca861dbe23fcc41cb13dfc6a19f088bd4 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Wed, 6 Jan 2010 10:40:02 +0100 Subject: compiles again, but not yet working. --- ucbhelper/workben/ucbexplorer/ucbexplorer.cxx | 142 ++++++++++++++------------ ucbhelper/workben/ucbexplorer/ucbexplorer.src | 2 + 2 files changed, 77 insertions(+), 67 deletions(-) diff --git a/ucbhelper/workben/ucbexplorer/ucbexplorer.cxx b/ucbhelper/workben/ucbexplorer/ucbexplorer.cxx index 276476d9e21f..9a41c55ccfd8 100644 --- a/ucbhelper/workben/ucbexplorer/ucbexplorer.cxx +++ b/ucbhelper/workben/ucbexplorer/ucbexplorer.cxx @@ -40,8 +40,8 @@ #include #include #include -#include #include +#include #include #include "rtl/ref.hxx" @@ -124,7 +124,8 @@ private: DECL_LINK( NameHdl, Edit * ); public: - StringInputDialog( const String& rTitle, + StringInputDialog( ResMgr& rResMgr, + const String& rTitle, const String& rDefaultText, String* pGroupName = 0 ); String GetValue() const { return m_aNameEdit.GetText(); } @@ -143,15 +144,15 @@ class UcbExplorerListBoxEntry : public SvLBoxEntry enum EntryType { FOLDER, DOCUMENT, LINK }; - ::ucb::Content m_aContent; - EntryType m_eType; + ::ucbhelper::Content m_aContent; + EntryType m_eType; public: UcbExplorerListBoxEntry(); virtual ~UcbExplorerListBoxEntry(); BOOL createNewContent( const ContentInfo& rInfo, - ::ucb::Content& rNewContent ); + ::ucbhelper::Content& rNewContent ); }; //========================================================================= @@ -172,13 +173,13 @@ private: virtual void RequestingChilds( SvLBoxEntry* pParent ); public: - UcbExplorerTreeListBox( Window* pParent, WinBits nWinStyle = 0 ); + UcbExplorerTreeListBox( ResMgr & rResMgr, Window* pParent, WinBits nWinStyle = 0 ); virtual ~UcbExplorerTreeListBox(); virtual void Command( const CommandEvent& rCEvt ); UcbExplorerListBoxEntry* - InsertEntry( ::ucb::Content& rContent, SvLBoxEntry* pParent ); + InsertEntry( ::ucbhelper::Content& rContent, SvLBoxEntry* pParent ); UcbExplorerListBoxEntry* InsertEntry( const String& rURL, SvLBoxEntry* pParent = 0 ); }; @@ -196,7 +197,7 @@ class UcbExplorerWindow : public WorkWindow UcbExplorerTreeListBox m_aTree; public: - UcbExplorerWindow( Window *pParent, WinBits nWinStyle ); + UcbExplorerWindow( ResMgr & rResMgr, Window *pParent, WinBits nWinStyle ); virtual ~UcbExplorerWindow(); virtual void Resize(); @@ -269,16 +270,17 @@ uno::Reference< XInputStream > SAL_CALL TestDataSink::getInputStream() // //========================================================================= -StringInputDialog::StringInputDialog( const String& rTitle, +StringInputDialog::StringInputDialog( ResMgr& rResMgr, + const String& rTitle, const String& rDefaultText, String* pGroupName ) -: ModalDialog( 0, ResId( DLG_STRINGINPUT ) ), - m_aNameText ( this, ResId( FT_STRINGINPUT_DLG_NAME ) ), - m_aNameEdit ( this, ResId( ED_STRINGINPUT_DLG_NAME ) ), - m_aNameGroup( this, ResId( GB_STRINGINPUT_DLG_NAME ) ), - m_aOKBtn ( this, ResId( BT_STRINGINPUT_DLG_OK ) ), - m_aCancelBtn( this, ResId( BT_STRINGINPUT_DLG_CANCEL ) ), - m_aHelpBtn ( this, ResId( BT_STRINGINPUT_DLG_HELP ) ) + : ModalDialog( 0, ResId( DLG_STRINGINPUT, rResMgr ) ), + m_aNameText ( this, ResId( FT_STRINGINPUT_DLG_NAME, rResMgr ) ), + m_aNameEdit ( this, ResId( ED_STRINGINPUT_DLG_NAME, rResMgr ) ), + m_aNameGroup( this, ResId( GB_STRINGINPUT_DLG_NAME, rResMgr ) ), + m_aOKBtn ( this, ResId( BT_STRINGINPUT_DLG_OK, rResMgr ) ), + m_aCancelBtn( this, ResId( BT_STRINGINPUT_DLG_CANCEL, rResMgr ) ), + m_aHelpBtn ( this, ResId( BT_STRINGINPUT_DLG_HELP, rResMgr ) ) { FreeResource(); SetText( rTitle ); @@ -339,7 +341,7 @@ UcbExplorerListBoxEntry::~UcbExplorerListBoxEntry() //========================================================================= BOOL UcbExplorerListBoxEntry::createNewContent( const ContentInfo& rInfo, - ::ucb::Content& rNewContent ) + ::ucbhelper::Content& rNewContent ) { sal_Int32 nCount = rInfo.Properties.getLength(); Sequence< Any > aPropValues( nCount ); @@ -354,7 +356,10 @@ BOOL UcbExplorerListBoxEntry::createNewContent( const ContentInfo& rInfo, for ( sal_Int32 n = 0; n < nCount; ++n ) { const OUString& rName = pProps[ n ].Name; - StringInputDialog* pDlg = new StringInputDialog( rName, rName ); + + std::auto_ptr< ResMgr > xManager( + ResMgr::CreateResMgr( CREATEVERSIONRESMGR_NAME( ucbexplorer ) ) ); + StringInputDialog* pDlg = new StringInputDialog( *xManager.get(), rName, rName ); USHORT nRet = pDlg->Execute(); if ( nRet == RET_OK ) { @@ -440,7 +445,10 @@ BOOL UcbExplorerListBoxEntry::createNewContent( const ContentInfo& rInfo, // Let the user specify the URL of a content containing the // data to supply to the new content. + std::auto_ptr< ResMgr > xManager( + ResMgr::CreateResMgr( CREATEVERSIONRESMGR_NAME( ucbexplorer ) ) ); StringInputDialog* pDlg = new StringInputDialog( + *xManager.get(), OUString::createFromAscii( "Document Data Source URL" ), OUString() ); @@ -461,7 +469,7 @@ BOOL UcbExplorerListBoxEntry::createNewContent( const ContentInfo& rInfo, { uno::Reference< XCommandEnvironment > xEnv; - ::ucb::ContentBroker* pBroker = ::ucb::ContentBroker::get(); + ::ucbhelper::ContentBroker* pBroker = ::ucbhelper::ContentBroker::get(); if ( pBroker ) { uno::Reference< XInteractionHandler > xInteractionHandler( @@ -473,15 +481,15 @@ BOOL UcbExplorerListBoxEntry::createNewContent( const ContentInfo& rInfo, uno::Reference< XProgressHandler > xProgressHandler /* = new ProgressHandler( *pBroker ) */ ; - xEnv = new ::ucb::CommandEnvironment( xInteractionHandler, - xProgressHandler ); + xEnv = new ::ucbhelper::CommandEnvironment( xInteractionHandler, + xProgressHandler ); } - ::ucb::Content aSourceContent( aSourceURL, xEnv ); + ::ucbhelper::Content aSourceContent( aSourceURL, xEnv ); // Get source data. rtl::Reference< TestDataSink > xSourceData = new TestDataSink; - aSourceContent.openStream( xSourceData.getBodyPtr() ); + aSourceContent.openStream( xSourceData.get() ); xData = xSourceData->getInputStream(); } catch ( ContentCreationException const & ) @@ -541,13 +549,14 @@ BOOL UcbExplorerListBoxEntry::createNewContent( const ContentInfo& rInfo, // //========================================================================= -UcbExplorerTreeListBox::UcbExplorerTreeListBox( - Window* pParent, WinBits nWinStyle ) +UcbExplorerTreeListBox::UcbExplorerTreeListBox( ResMgr & rResMgr, + Window* pParent, + WinBits nWinStyle ) : SvTreeListBox( pParent, nWinStyle ), - m_aFolderClosed( ResId( BMP_FOLDER_CLOSED ) ), - m_aFolderOpened( ResId( BMP_FOLDER_OPENED ) ), - m_aDocument( ResId( BMP_DOCUMENT ) ), - m_aLink( ResId( BMP_LINK ) ) + m_aFolderClosed( ResId( BMP_FOLDER_CLOSED, rResMgr ) ), + m_aFolderOpened( ResId( BMP_FOLDER_OPENED, rResMgr ) ), + m_aDocument( ResId( BMP_DOCUMENT, rResMgr ) ), + m_aLink( ResId( BMP_LINK, rResMgr ) ) { } @@ -587,7 +596,7 @@ void UcbExplorerTreeListBox::RequestingChilds( SvLBoxEntry* pParent ) uno::Reference< XResultSet > xResultSet = pEntry->m_aContent.createCursor( aPropertyNames, - ::ucb::INCLUDE_FOLDERS_AND_DOCUMENTS ); + ::ucbhelper::INCLUDE_FOLDERS_AND_DOCUMENTS ); uno::Reference< XContentAccess > xContentAccess( xResultSet, UNO_QUERY ); @@ -644,7 +653,9 @@ void UcbExplorerTreeListBox::Command( const CommandEvent& rCEvt ) GetEntry( rPos, TRUE ) ); if ( pEntry ) { - PopupMenu* pMenu = new PopupMenu( ResId( MENU_POPUP ) ); + std::auto_ptr< ResMgr > xManager( + ResMgr::CreateResMgr( CREATEVERSIONRESMGR_NAME( ucbexplorer ) ) ); + PopupMenu* pMenu = new PopupMenu( ResId( MENU_POPUP, *xManager.get() ) ); PopupMenu* pNewMenu = 0; // pMenu->SetSelectHdl( LINK( this, @@ -655,25 +666,19 @@ void UcbExplorerTreeListBox::Command( const CommandEvent& rCEvt ) // Configure "New" ////////////////////////////////////////////////////////////// - uno::Reference< XContentCreator > xCreator( - pEntry->m_aContent.get(), UNO_QUERY ); - Sequence< ContentInfo > aInfo; - BOOL bCanCreate = xCreator.is(); - if ( bCanCreate ) - { - aInfo = xCreator->queryCreatableContentsInfo(); - const ContentInfo* pInfo = aInfo.getConstArray(); - sal_Int32 nCount = aInfo.getLength(); - bCanCreate = ( nCount > 0 ); + Sequence< ContentInfo > aInfo + = pEntry->m_aContent.queryCreatableContentsInfo(); + const ContentInfo* pInfo = aInfo.getConstArray(); + sal_Int32 nCount = aInfo.getLength(); + BOOL bCanCreate = ( nCount > 0 ); - pNewMenu = new PopupMenu; - pMenu->SetPopupMenu( MENU_NEW, pNewMenu ); + pNewMenu = new PopupMenu; + pMenu->SetPopupMenu( MENU_NEW, pNewMenu ); - for ( sal_Int32 n = 0; n < nCount; ++n ) - { - const ContentInfo& rInfo = pInfo[ n ]; - pNewMenu->InsertItem( 20000 + n + 1, rInfo.Type ); - } + for ( sal_Int32 n = 0; n < nCount; ++n ) + { + const ContentInfo& rInfo = pInfo[ n ]; + pNewMenu->InsertItem( 20000 + n + 1, rInfo.Type ); } pMenu->EnableItem( MENU_NEW, bCanCreate ); @@ -763,8 +768,11 @@ void UcbExplorerTreeListBox::Command( const CommandEvent& rCEvt ) { } + std::auto_ptr< ResMgr > xManager( + ResMgr::CreateResMgr( CREATEVERSIONRESMGR_NAME( ucbexplorer ) ) ); StringInputDialog* pDlg = new StringInputDialog( + *xManager.get(), OUString::createFromAscii( "Title" ), aNewTitle ); @@ -880,7 +888,7 @@ void UcbExplorerTreeListBox::Command( const CommandEvent& rCEvt ) { // New-menu entry selected. - ::ucb::Content aNewContent; + ::ucbhelper::Content aNewContent; if ( pEntry->createNewContent( aInfo.getConstArray()[ nSelected - 20001 ], aNewContent ) ) @@ -906,7 +914,7 @@ void UcbExplorerTreeListBox::Command( const CommandEvent& rCEvt ) //========================================================================= UcbExplorerListBoxEntry* UcbExplorerTreeListBox::InsertEntry( - ::ucb::Content& rContent, + ::ucbhelper::Content& rContent, SvLBoxEntry* pParent ) { try @@ -998,7 +1006,7 @@ UcbExplorerListBoxEntry* UcbExplorerTreeListBox::InsertEntry( { uno::Reference< XCommandEnvironment > xEnv; - ::ucb::ContentBroker* pBroker = ::ucb::ContentBroker::get(); + ::ucbhelper::ContentBroker* pBroker = ::ucbhelper::ContentBroker::get(); if ( pBroker ) { uno::Reference< XInteractionHandler > xInteractionHandler( @@ -1010,11 +1018,11 @@ UcbExplorerListBoxEntry* UcbExplorerTreeListBox::InsertEntry( uno::Reference< XProgressHandler > xProgressHandler /* = new ProgressHandler( *pBroker ) */ ; - xEnv = new ::ucb::CommandEnvironment( xInteractionHandler, - xProgressHandler ); + xEnv = new ::ucbhelper::CommandEnvironment( xInteractionHandler, + xProgressHandler ); } - ::ucb::Content aContent( rURL, xEnv ); + ::ucbhelper::Content aContent( rURL, xEnv ); return InsertEntry( aContent, pParent ); } catch ( ContentCreationException const & ) @@ -1030,9 +1038,9 @@ UcbExplorerListBoxEntry* UcbExplorerTreeListBox::InsertEntry( // //========================================================================= -UcbExplorerWindow::UcbExplorerWindow( Window *pParent, WinBits nWinStyle ) +UcbExplorerWindow::UcbExplorerWindow( ResMgr & rResMgr, Window *pParent, WinBits nWinStyle ) : WorkWindow( pParent, nWinStyle ), - m_aTree( this, WB_HSCROLL ) + m_aTree( rResMgr, this, WB_HSCROLL ) { Font aTreeFont( m_aTree.GetFont() ); aTreeFont.SetName( String( RTL_CONSTASCII_USTRINGPARAM("Courier") ) ); @@ -1101,7 +1109,7 @@ void MyApp::Main() comphelper::setProcessServiceFactory( xFac ); - unO::Reference< XComponent > xComponent( xFac, UNO_QUERY ); + uno::Reference< XComponent > xComponent( xFac, UNO_QUERY ); ////////////////////////////////////////////////////////////////////// // Create UCB. @@ -1112,16 +1120,16 @@ void MyApp::Main() Sequence< Any > aArgs( 2 ); aArgs[ 0 ] <<= OUString::createFromAscii( UCB_CONFIGURATION_KEY1_LOCAL ); aArgs[ 1 ] <<= OUString::createFromAscii( UCB_CONFIGURATION_KEY2_OFFICE ); - sal_Bool bSuccess = ::ucb::ContentBroker::initialize( xFac, aArgs ); + sal_Bool bSuccess = ::ucbhelper::ContentBroker::initialize( xFac, aArgs ); #else // Init UCB (Use provided configuration data) - ::ucb::ContentProviderDataList aProviders; + ::ucbhelper::ContentProviderDataList aProviders; aProviders.push_back( - ::ucb::ContentProviderData( + ::ucbhelper::ContentProviderData( OUString::createFromAscii( "com.sun.star.ucb.FileContentProvider" ), OUString::createFromAscii( "file" ), OUString() ) ); - sal_Bool bSuccess = ::ucb::ContentBroker::initialize( xFac, aProviders ); + sal_Bool bSuccess = ::ucbhelper::ContentBroker::initialize( xFac, aProviders ); #endif if ( !bSuccess ) @@ -1134,12 +1142,12 @@ void MyApp::Main() // Create/init/show app window. ////////////////////////////////////////////////////////////////////// - ResMgr* pMgr = ResMgr::CreateResMgr( CREATEVERSIONRESMGR( ucbexplorer ) ); - Resource::SetResManager( pMgr ); + std::auto_ptr< ResMgr > xManager( + ResMgr::CreateResMgr( CREATEVERSIONRESMGR_NAME( ucbexplorer ) ) ); - UcbExplorerWindow aAppWin( 0, WB_APP | WB_STDWORK ); + UcbExplorerWindow aAppWin( *xManager.get(), 0, WB_APP | WB_STDWORK ); - MenuBar aMBMain( ResId( MENU_MAIN ) ); + MenuBar aMBMain( ResId( MENU_MAIN, *xManager.get() ) ); // Check for command line params #if 0 @@ -1154,7 +1162,7 @@ void MyApp::Main() aRootURL = UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "vnd.sun.star.hier:/" ) ); - String aTitle( ResId( TEXT_TITLEBAR ) ); + String aTitle( ResId( TEXT_TITLEBAR, *xManager.get() ) ); aTitle.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " - " ) ); aTitle += aRootURL; @@ -1179,7 +1187,7 @@ void MyApp::Main() // m_aTree holds UCB contents! aAppWin.m_aTree.Clear(); - ::ucb::ContentBroker::deinitialize(); + ::ucbhelper::ContentBroker::deinitialize(); if ( xComponent.is() ) xComponent->dispose(); diff --git a/ucbhelper/workben/ucbexplorer/ucbexplorer.src b/ucbhelper/workben/ucbexplorer/ucbexplorer.src index 355732741d6d..1449897341d5 100644 --- a/ucbhelper/workben/ucbexplorer/ucbexplorer.src +++ b/ucbhelper/workben/ucbexplorer/ucbexplorer.src @@ -82,6 +82,7 @@ Menu MENU_POPUP }; }; +/* Bitmap BMP_FOLDER_CLOSED { File = "bmp/fldclose.bmp" ; @@ -98,6 +99,7 @@ Bitmap BMP_LINK { File = "bmp/link.bmp" ; }; +*/ ModalDialog DLG_STRINGINPUT { -- cgit v1.2.3 From bc84f5ed2a930322a45693ef6fde2592cded5c5d Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Wed, 6 Jan 2010 10:44:38 +0100 Subject: merge error --- filter/source/pdf/impdialog.src | 8 -------- 1 file changed, 8 deletions(-) diff --git a/filter/source/pdf/impdialog.src b/filter/source/pdf/impdialog.src index 14c0fbea536e..93db2a79a79a 100644 --- a/filter/source/pdf/impdialog.src +++ b/filter/source/pdf/impdialog.src @@ -226,11 +226,7 @@ TabPage RID_PDF_TAB_GENER }; CheckBox CB_EXPORTEMPTYPAGES { -<<<<<<< local Pos = MAP_APPFONT ( 12 , 216 ) ; -======= - Pos = MAP_APPFONT ( 12 , 219 ) ; ->>>>>>> other Size = MAP_APPFONT ( 158 , 16 ) ; TabStop = TRUE ; WordBreak = TRUE ; @@ -238,11 +234,7 @@ TabPage RID_PDF_TAB_GENER }; CheckBox CB_ADDSTREAM { -<<<<<<< local Pos = MAP_APPFONT ( 12 , 235 ) ; -======= - Pos = MAP_APPFONT ( 12 , 237 ) ; ->>>>>>> other Size = MAP_APPFONT ( 158 , 10 ) ; TabStop = TRUE ; Text[ en-US ] = "Create ~hybrid file"; -- cgit v1.2.3 From cdb860118873e199e1f011d9a328a38d2e14d34c Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Wed, 6 Jan 2010 10:48:26 +0100 Subject: whitespace cleanup. --- sot/source/sdstor/ucbstorage.cxx | 52 +++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 28 deletions(-) diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index d7e797c681f3..e671012fc560 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -43,9 +43,7 @@ #include #include #include -#ifndef _COM_SUN_STAR_SDBC_XRESULTSET_HDL_ #include -#endif #include #include #include @@ -55,9 +53,7 @@ #include #include #include -#ifndef _COM_SUN_STAR_UCB_INTERACTIVEIODEXCEPTION_HPP_ #include -#endif #include #include @@ -113,11 +109,11 @@ public: virtual void SAL_CALL seek( sal_Int64 _nLocation ) throw ( IllegalArgumentException, IOException, RuntimeException); virtual sal_Int64 SAL_CALL getPosition( ) throw ( IOException, RuntimeException); virtual sal_Int64 SAL_CALL getLength( ) throw ( IOException, RuntimeException); - virtual sal_Int32 SAL_CALL readBytes( Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead) throw( NotConnectedException, BufferSizeExceededException, RuntimeException ); - virtual sal_Int32 SAL_CALL readSomeBytes( Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead) throw( NotConnectedException, BufferSizeExceededException, RuntimeException ); - virtual void SAL_CALL skipBytes(sal_Int32 nBytesToSkip) throw( NotConnectedException, BufferSizeExceededException, RuntimeException); - virtual sal_Int32 SAL_CALL available() throw( NotConnectedException, RuntimeException ); - virtual void SAL_CALL closeInput() throw( NotConnectedException, RuntimeException ); + virtual sal_Int32 SAL_CALL readBytes( Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead) throw( NotConnectedException, BufferSizeExceededException, RuntimeException ); + virtual sal_Int32 SAL_CALL readSomeBytes( Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead) throw( NotConnectedException, BufferSizeExceededException, RuntimeException ); + virtual void SAL_CALL skipBytes(sal_Int32 nBytesToSkip) throw( NotConnectedException, BufferSizeExceededException, RuntimeException); + virtual sal_Int32 SAL_CALL available() throw( NotConnectedException, RuntimeException ); + virtual void SAL_CALL closeInput() throw( NotConnectedException, RuntimeException ); protected: void checkConnected(); @@ -540,7 +536,7 @@ public: // this means that the root storage does an autocommit when its external // reference is destroyed BOOL m_bIsRoot; // marks this storage as root storages that manages all oommits and reverts - BOOL m_bDirty; // ??? + BOOL m_bDirty; // ??? BOOL m_bIsLinked; BOOL m_bListCreated; ULONG m_nFormat; @@ -575,12 +571,12 @@ public: ReadContent(); if ( m_nMode & STREAM_WRITE ) { - m_nError = nError; - if ( m_pAntiImpl ) - { - m_pAntiImpl->ResetError(); - m_pAntiImpl->SetError( nError ); - } + m_nError = nError; + if ( m_pAntiImpl ) + { + m_pAntiImpl->ResetError(); + m_pAntiImpl->SetError( nError ); + } } return m_aChildrenList; @@ -867,7 +863,7 @@ BOOL UCBStorageStream_Impl::Init() // usually means that stream could not be opened } - if( m_rSource.is() ) + if( m_rSource.is() ) { m_pStream->Seek( STREAM_SEEK_TO_END ); @@ -894,7 +890,7 @@ BOOL UCBStorageStream_Impl::Init() { // if the new file is edited than no source exist m_bSourceRead = FALSE; - //SetError( SVSTREAM_CANNOT_MAKE ); + //SetError( SVSTREAM_CANNOT_MAKE ); } } @@ -1107,7 +1103,7 @@ ULONG UCBStorageStream_Impl::SeekPos( ULONG nPos ) else { // the temp stream pointer points to the end now - aResult = m_pStream->Tell(); + aResult = m_pStream->Tell(); if( aResult < nPos ) { @@ -1886,7 +1882,7 @@ void UCBStorage_Impl::Init() { if ( !pStream->GetError() ) { - ::utl::OInputStreamWrapper* pHelper = new ::utl::OInputStreamWrapper( *pStream ); + ::utl::OInputStreamWrapper* pHelper = new ::utl::OInputStreamWrapper( *pStream ); com::sun::star::uno::Reference < ::com::sun::star::io::XInputStream > xInputStream( pHelper ); // create a manifest reader object that will read in the manifest from the stream @@ -2042,8 +2038,8 @@ void UCBStorage_Impl::ReadContent() if ( m_bRepairPackage ) { xComEnv = new ::ucbhelper::CommandEnvironment( Reference< ::com::sun::star::task::XInteractionHandler >(), - m_xProgressHandler ); - aName += String( RTL_CONSTASCII_USTRINGPARAM( "?repairpackage" ) ); + m_xProgressHandler ); + aName += String( RTL_CONSTASCII_USTRINGPARAM( "?repairpackage" ) ); } ::ucbhelper::Content aContent( aName, xComEnv ); @@ -2639,7 +2635,7 @@ BOOL UCBStorage_Impl::Revert() } else if ( pElement->m_xStorage.Is() ) { - pElement->m_xStorage->m_bCommited = sal_False; + pElement->m_xStorage->m_bCommited = sal_False; pElement->m_xStorage->Revert(); } @@ -2655,7 +2651,7 @@ BOOL UCBStorage_Impl::Revert() const String& UCBStorage::GetName() const { - return pImp->m_aName; // pImp->m_aURL ?! + return pImp->m_aName; // pImp->m_aURL ?! } BOOL UCBStorage::IsRoot() const @@ -2893,7 +2889,7 @@ BOOL UCBStorage::CopyTo( const String& rElemName, BaseStorage* pDest, const Stri else { // for copying no optimization is usefull, because in every case the stream data must be copied - UCBStorageElement_Impl* pElement = FindElement_Impl( rElemName ); + UCBStorageElement_Impl* pElement = FindElement_Impl( rElemName ); if ( pElement ) return CopyStorageElement_Impl( *pElement, pDest, rNew ); else @@ -3256,10 +3252,10 @@ BOOL UCBStorage::MoveTo( const String& rEleName, BaseStorage* pNewSt, const Stri { // because the element is moved, not copied, a special optimization is possible : // first copy the UCBStorageElement; flag old element as "Removed" and new as "Inserted", - // clear original name/type of the new element - // if moved element is open: copy content, but change absolute URL ( and those of all children of the element! ), + // clear original name/type of the new element + // if moved element is open: copy content, but change absolute URL ( and those of all children of the element! ), // clear original name/type of new content, keep the old original stream/storage, but forget its working streams, - // close original UCBContent and original stream, only the TempFile and its stream may remain unchanged, but now + // close original UCBContent and original stream, only the TempFile and its stream may remain unchanged, but now // belong to the new content // if original and editable stream are identical ( readonly element ), it has to be copied to the editable // stream of the destination object -- cgit v1.2.3 From fcdda26bdb5285c2964987ab6243b495a6bb673e Mon Sep 17 00:00:00 2001 From: Christian Lippka Date: Wed, 6 Jan 2010 10:58:09 +0100 Subject: removed unused variable --- sd/source/ui/unoidl/unomodel.cxx | 2 -- 1 file changed, 2 deletions(-) diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index aaa6920749c2..4dab2fbac616 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -1618,8 +1618,6 @@ void ImplPDFExportComments( uno::Reference< drawing::XDrawPage > xPage, vcl::PDF uno::Reference< office::XAnnotationAccess > xAnnotationAccess( xPage, uno::UNO_QUERY_THROW ); uno::Reference< office::XAnnotationEnumeration > xAnnotationEnumeration( xAnnotationAccess->createAnnotationEnumeration() ); - sal_Int32 nIndex = 1; - LanguageType eLanguage = Application::GetSettings().GetLanguage(); while( xAnnotationEnumeration->hasMoreElements() ) { -- cgit v1.2.3 From ca5ed72ceb4ec26d5867b7e1abfc7a2f176cf181 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Wed, 6 Jan 2010 14:37:09 +0100 Subject: whitespace cleanup. --- sfx2/source/doc/doctempl.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sfx2/source/doc/doctempl.cxx b/sfx2/source/doc/doctempl.cxx index f1b117f6a1c9..e43da0b0bacc 100644 --- a/sfx2/source/doc/doctempl.cxx +++ b/sfx2/source/doc/doctempl.cxx @@ -794,12 +794,12 @@ String SfxDocumentTemplates::GetDefaultTemplatePath INetURLObject aTemplateObj( pImp->GetRootURL() ); aTemplateObj.insertName( aGroupName, false, - INetURLObject::LAST_SEGMENT, true, - INetURLObject::ENCODE_ALL ); + INetURLObject::LAST_SEGMENT, true, + INetURLObject::ENCODE_ALL ); aTemplateObj.insertName( aTitle, false, - INetURLObject::LAST_SEGMENT, true, - INetURLObject::ENCODE_ALL ); + INetURLObject::LAST_SEGMENT, true, + INetURLObject::ENCODE_ALL ); ::rtl::OUString aResult; -- cgit v1.2.3 From 8449238972164cf33fc51098723f14da6835192e Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Wed, 6 Jan 2010 16:10:01 +0100 Subject: whitespace cleanup. --- dbaccess/source/ui/app/AppDetailPageHelper.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx index 50e357b687b8..4b5085fbe11f 100644 --- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx +++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx @@ -1386,7 +1386,7 @@ void OAppDetailPageHelper::DataChanged( const DataChangedEvent& rDCEvt ) { Window::DataChanged( rDCEvt ); - if ( (rDCEvt.GetType() == DATACHANGED_FONTS) || + if ( (rDCEvt.GetType() == DATACHANGED_FONTS) || (rDCEvt.GetType() == DATACHANGED_DISPLAY) || (rDCEvt.GetType() == DATACHANGED_FONTSUBSTITUTION) || ((rDCEvt.GetType() == DATACHANGED_SETTINGS) && -- cgit v1.2.3 From 7e52f21b6b8717ebfd99f439eb8ffea8c121a363 Mon Sep 17 00:00:00 2001 From: ericb Date: Wed, 6 Jan 2010 16:41:04 +0100 Subject: eraser01: #i103174# cosmetic changes before RfQA --- slideshow/source/engine/eventmultiplexer.cxx | 2 +- slideshow/source/engine/slide/slideimpl.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/slideshow/source/engine/eventmultiplexer.cxx b/slideshow/source/engine/eventmultiplexer.cxx index ab36bf3d9e60..f59a1cf6a4f0 100644 --- a/slideshow/source/engine/eventmultiplexer.cxx +++ b/slideshow/source/engine/eventmultiplexer.cxx @@ -1071,7 +1071,7 @@ bool EventMultiplexer::notifyUserPaintStrokeWidth( double rUserStrokeWidth ) _1, rUserStrokeWidth)); } -//NELLE a regarder de plus près + bool EventMultiplexer::notifyUserPaintDisabled() { return mpImpl->maUserPaintEventHandlers.applyAll( diff --git a/slideshow/source/engine/slide/slideimpl.cxx b/slideshow/source/engine/slide/slideimpl.cxx index c0302fd92909..ca90ae80427d 100644 --- a/slideshow/source/engine/slide/slideimpl.cxx +++ b/slideshow/source/engine/slide/slideimpl.cxx @@ -913,7 +913,7 @@ void SlideImpl::drawPolygons() const void SlideImpl::addPolygons(PolyPolygonVector aPolygons) { - if(!aPolygons.empty()) /* FIXME : was if(aPolygons.size() != 0) */ + if(!aPolygons.empty()) { for( PolyPolygonVector::iterator aIter=aPolygons.begin(), aEnd=aPolygons.end(); -- cgit v1.2.3 From 5a57b4fbd058bb411ad38d37b4029b949fca1d20 Mon Sep 17 00:00:00 2001 From: ericb Date: Wed, 6 Jan 2010 16:41:36 +0100 Subject: eraser01: #i103174# cosmetic changes in sd before RfQA --- sd/source/ui/slideshow/slideshow.src | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sd/source/ui/slideshow/slideshow.src b/sd/source/ui/slideshow/slideshow.src index ee21508deb38..42459427f54f 100644 --- a/sd/source/ui/slideshow/slideshow.src +++ b/sd/source/ui/slideshow/slideshow.src @@ -147,11 +147,6 @@ Menu RID_SLIDESHOW_CONTEXTMENU Identifier = CM_ERASE_ALLINK ; Text [ en-US ] = "~Erase All Ink On Slide" ; }; - // MenuItem - // { - // Identifier = CM_ERASE_INK ; - // Text [ en-US ] = "~Erase Ink Mode ON/OFF" ; - // }; MenuItem { Separator = TRUE; -- cgit v1.2.3 From 93551bdf06411cbb37acf68192c94a41c146a03c Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Wed, 6 Jan 2010 16:46:36 +0100 Subject: #i61429# - Adapted UCB clients to deprecated XContentCreator interface. --- desktop/source/deployment/misc/dp_ucb.cxx | 75 +++++++++--------- fileaccess/source/FileAccess.cxx | 90 ++++++++++------------ fpicker/source/office/fpsmartcontent.cxx | 31 ++++---- sfx2/source/doc/doctempl.cxx | 1 - .../CheckTransientDocumentsDocumentContent.java | 11 ++- 5 files changed, 95 insertions(+), 113 deletions(-) diff --git a/desktop/source/deployment/misc/dp_ucb.cxx b/desktop/source/deployment/misc/dp_ucb.cxx index 8a4f55caae1a..013ba0e2ce23 100644 --- a/desktop/source/deployment/misc/dp_ucb.cxx +++ b/desktop/source/deployment/misc/dp_ucb.cxx @@ -40,7 +40,6 @@ #include "xmlscript/xml_helper.hxx" #include "com/sun/star/io/XInputStream.hpp" #include "com/sun/star/ucb/CommandFailedException.hpp" -#include "com/sun/star/ucb/XContentCreator.hpp" #include "com/sun/star/ucb/ContentInfo.hpp" #include "com/sun/star/ucb/ContentInfoAttribute.hpp" @@ -130,50 +129,46 @@ bool create_folder( if (! create_folder( &parentContent, url.copy( 0, slash ), xCmdEnv, throw_exc )) return false; - Reference xCreator( parentContent.get(), UNO_QUERY ); - if (xCreator.is()) + const Any title( ::rtl::Uri::decode( url.copy( slash + 1 ), + rtl_UriDecodeWithCharset, + RTL_TEXTENCODING_UTF8 ) ); + const Sequence infos( + parentContent.queryCreatableContentsInfo() ); + for ( sal_Int32 pos = 0; pos < infos.getLength(); ++pos ) { - const Any title( ::rtl::Uri::decode( url.copy( slash + 1 ), - rtl_UriDecodeWithCharset, - RTL_TEXTENCODING_UTF8 ) ); - const Sequence infos( - xCreator->queryCreatableContentsInfo() ); - for ( sal_Int32 pos = 0; pos < infos.getLength(); ++pos ) + // look KIND_FOLDER: + ContentInfo const & info = infos[ pos ]; + if ((info.Attributes & ContentInfoAttribute::KIND_FOLDER) != 0) { - // look KIND_FOLDER: - ContentInfo const & info = infos[ pos ]; - if ((info.Attributes & ContentInfoAttribute::KIND_FOLDER) != 0) - { - // make sure the only required bootstrap property is "Title": - Sequence const & rProps = info.Properties; - if (rProps.getLength() != 1 || - !rProps[ 0 ].Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM("Title") )) - continue; + // make sure the only required bootstrap property is "Title": + Sequence const & rProps = info.Properties; + if (rProps.getLength() != 1 || + !rProps[ 0 ].Name.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("Title") )) + continue; - try { - if (parentContent.insertNewContent( - info.Type, - Sequence( &StrTitle::get(), 1 ), - Sequence( &title, 1 ), - ucb_content )) { - if (ret_ucb_content != 0) - *ret_ucb_content = ucb_content; - return true; - } + try { + if (parentContent.insertNewContent( + info.Type, + Sequence( &StrTitle::get(), 1 ), + Sequence( &title, 1 ), + ucb_content )) { + if (ret_ucb_content != 0) + *ret_ucb_content = ucb_content; + return true; } - catch (RuntimeException &) { + } + catch (RuntimeException &) { + throw; + } + catch (CommandFailedException &) { + // Interaction Handler already handled the error + // that has occured... + } + catch (Exception &) { + if (throw_exc) throw; - } - catch (CommandFailedException &) { - // Interaction Handler already handled the error - // that has occured... - } - catch (Exception &) { - if (throw_exc) - throw; - return false; - } + return false; } } } diff --git a/fileaccess/source/FileAccess.cxx b/fileaccess/source/FileAccess.cxx index 5d568dc994cb..3f387afe4b4c 100644 --- a/fileaccess/source/FileAccess.cxx +++ b/fileaccess/source/FileAccess.cxx @@ -61,7 +61,6 @@ #include #include #include -#include #include #include @@ -480,11 +479,7 @@ void OFileAccess::createFolder( const rtl::OUString& NewFolderURL ) ucbhelper::Content aCnt( aURL.GetMainURL( INetURLObject::NO_DECODE ), mxEnvironment ); - Reference< XContentCreator > xCreator = Reference< XContentCreator >( aCnt.get(), UNO_QUERY ); - if ( !xCreator.is() ) - return; - - Sequence< ContentInfo > aInfo = xCreator->queryCreatableContentsInfo(); + Sequence< ContentInfo > aInfo = aCnt.queryCreatableContentsInfo(); sal_Int32 nCount = aInfo.getLength(); if ( nCount == 0 ) return; @@ -758,56 +753,51 @@ bool OFileAccess::createNewFile( const rtl::OUString & rParentURL, { ucbhelper::Content aParentCnt( rParentURL, mxEnvironment ); - Reference< XContentCreator > xCreator - = Reference< XContentCreator >( aParentCnt.get(), UNO_QUERY ); - if ( xCreator.is() ) - { - Sequence< ContentInfo > aInfo = xCreator->queryCreatableContentsInfo(); - sal_Int32 nCount = aInfo.getLength(); - if ( nCount == 0 ) - return false; + Sequence< ContentInfo > aInfo = aParentCnt.queryCreatableContentsInfo(); + sal_Int32 nCount = aInfo.getLength(); + if ( nCount == 0 ) + return false; - for ( sal_Int32 i = 0; i < nCount; ++i ) + for ( sal_Int32 i = 0; i < nCount; ++i ) + { + const ContentInfo & rCurr = aInfo[i]; + if ( ( rCurr.Attributes + & ContentInfoAttribute::KIND_DOCUMENT ) && + ( rCurr.Attributes + & ContentInfoAttribute::INSERT_WITH_INPUTSTREAM ) ) { - const ContentInfo & rCurr = aInfo[i]; - if ( ( rCurr.Attributes - & ContentInfoAttribute::KIND_DOCUMENT ) && - ( rCurr.Attributes - & ContentInfoAttribute::INSERT_WITH_INPUTSTREAM ) ) - { - // Make sure the only required bootstrap property is - // "Title", - const Sequence< Property > & rProps = rCurr.Properties; - if ( rProps.getLength() != 1 ) - continue; + // Make sure the only required bootstrap property is + // "Title", + const Sequence< Property > & rProps = rCurr.Properties; + if ( rProps.getLength() != 1 ) + continue; - if ( !rProps[ 0 ].Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "Title" ) ) ) - continue; + if ( !rProps[ 0 ].Name.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM( "Title" ) ) ) + continue; - Sequence aNames(1); - rtl::OUString* pNames = aNames.getArray(); - pNames[0] = rtl::OUString( - RTL_CONSTASCII_USTRINGPARAM( "Title" ) ); - Sequence< Any > aValues(1); - Any* pValues = aValues.getArray(); - pValues[0] = makeAny( rtl::OUString( rTitle ) ); + Sequence aNames(1); + rtl::OUString* pNames = aNames.getArray(); + pNames[0] = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "Title" ) ); + Sequence< Any > aValues(1); + Any* pValues = aValues.getArray(); + pValues[0] = makeAny( rtl::OUString( rTitle ) ); - try - { - ucbhelper::Content aNew; - if ( aParentCnt.insertNewContent( - rCurr.Type, aNames, aValues, data, aNew ) ) - return true; // success. - else - continue; - } - catch ( CommandFailedException const & ) - { - // Interaction Handler already handled the - // error that has occured... + try + { + ucbhelper::Content aNew; + if ( aParentCnt.insertNewContent( + rCurr.Type, aNames, aValues, data, aNew ) ) + return true; // success. + else continue; - } + } + catch ( CommandFailedException const & ) + { + // Interaction Handler already handled the + // error that has occured... + continue; } } } diff --git a/fpicker/source/office/fpsmartcontent.cxx b/fpicker/source/office/fpsmartcontent.cxx index 34be031fdf6e..3ee5166fed9b 100644 --- a/fpicker/source/office/fpsmartcontent.cxx +++ b/fpicker/source/office/fpsmartcontent.cxx @@ -33,14 +33,13 @@ #include "fpsmartcontent.hxx" /** === begin UNO includes === **/ -#include #include +#include #include +#include /** === end UNO includes === **/ -#ifndef _UNOTOOLS_PROCESSFACTORY_HXX #include -#endif #include #include #include @@ -282,25 +281,21 @@ namespace svt sal_Bool bRet = sal_False; try { - Reference< XContentCreator > xCreator = Reference< XContentCreator >( m_pContent->get(), UNO_QUERY ); - if ( xCreator.is() ) + Sequence< ContentInfo > aInfo = m_pContent->queryCreatableContentsInfo(); + const ContentInfo* pInfo = aInfo.getConstArray(); + sal_Int32 nCount = aInfo.getLength(); + for ( sal_Int32 i = 0; i < nCount; ++i, ++pInfo ) { - Sequence< ContentInfo > aInfo = xCreator->queryCreatableContentsInfo(); - const ContentInfo* pInfo = aInfo.getConstArray(); - sal_Int32 nCount = aInfo.getLength(); - for ( sal_Int32 i = 0; i < nCount; ++i, ++pInfo ) + // Simply look for the first KIND_FOLDER... + if ( pInfo->Attributes & ContentInfoAttribute::KIND_FOLDER ) { - // Simply look for the first KIND_FOLDER... - if ( pInfo->Attributes & ContentInfoAttribute::KIND_FOLDER ) - { - bRet = sal_True; - break; - } + bRet = sal_True; + break; } - - // now we're definately valid - m_eState = VALID; } + + // now we're definately valid + m_eState = VALID; } catch( Exception& ) { diff --git a/sfx2/source/doc/doctempl.cxx b/sfx2/source/doc/doctempl.cxx index e43da0b0bacc..f3e7b789a062 100644 --- a/sfx2/source/doc/doctempl.cxx +++ b/sfx2/source/doc/doctempl.cxx @@ -69,7 +69,6 @@ #include #include #include -#include #include #include #include diff --git a/ucb/qa/complex/tdoc/CheckTransientDocumentsDocumentContent.java b/ucb/qa/complex/tdoc/CheckTransientDocumentsDocumentContent.java index fc8cf81c4aaf..8600dcc7f1b7 100755 --- a/ucb/qa/complex/tdoc/CheckTransientDocumentsDocumentContent.java +++ b/ucb/qa/complex/tdoc/CheckTransientDocumentsDocumentContent.java @@ -49,7 +49,6 @@ import com.sun.star.ucb.OpenMode; import com.sun.star.ucb.XCommandProcessor; import com.sun.star.ucb.XContent; import com.sun.star.ucb.XContentAccess; -import com.sun.star.ucb.XContentCreator; import com.sun.star.ucb.XContentIdentifier; import com.sun.star.ucb.XContentIdentifierFactory; import com.sun.star.ucb.XContentProvider; @@ -139,12 +138,16 @@ public class CheckTransientDocumentsDocumentContent extends ComplexTestCase { } } // create a folder - XContent xNewFolder = null; log.println("Create new folder "+ folderName); ContentInfo contentInfo = new ContentInfo(); contentInfo.Type = "application/vnd.sun.star.tdoc-folder"; - XContentCreator xContentCreator = (XContentCreator)UnoRuntime.queryInterface(XContentCreator.class, xContent); - xNewFolder = xContentCreator.createNewContent(contentInfo); + + command.Name = "createNewContent"; + command.Argument = contentInfo; + + result = xCommandProcessor.execute(command, 0, null); + XContent xNewFolder = (XContent)UnoRuntime.queryInterface(XContent.class, result); + XCommandProcessor xFolderCommandProcessor = (XCommandProcessor)UnoRuntime.queryInterface(XCommandProcessor.class, xNewFolder); log.println("Got the new folder: " + utils.getImplName(xNewFolder)); -- cgit v1.2.3 From 31a763ce50ce977168ba7806077465130c89b26a Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Wed, 6 Jan 2010 16:46:36 +0100 Subject: #i61429# - Adapted UCB clients to deprecated XContentCreator interface. --- sot/source/sdstor/ucbstorage.cxx | 7 +-- ucbhelper/inc/ucbhelper/content.hxx | 67 +++++++++++++------- ucbhelper/source/client/content.cxx | 107 +++++++++++++++++++++++++------- unotools/source/ucbhelper/ucbhelper.cxx | 16 +---- 4 files changed, 133 insertions(+), 64 deletions(-) diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index e671012fc560..274f7d4a4c1a 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -48,7 +48,7 @@ #include #include #include -#include +#include #include #include #include @@ -2277,13 +2277,10 @@ BOOL UCBStorage_Impl::Insert( ::ucbhelper::Content *pContent ) // a new substorage is inserted into a UCBStorage ( given by the parameter pContent ) // it must be inserted with a title and a type BOOL bRet = FALSE; - Reference< XContentCreator > xCreator = Reference< XContentCreator >( pContent->get(), UNO_QUERY ); - if ( !xCreator.is() ) - return sal_False; try { - Sequence< ContentInfo > aInfo = xCreator->queryCreatableContentsInfo(); + Sequence< ContentInfo > aInfo = pContent->queryCreatableContentsInfo(); sal_Int32 nCount = aInfo.getLength(); if ( nCount == 0 ) return sal_False; diff --git a/ucbhelper/inc/ucbhelper/content.hxx b/ucbhelper/inc/ucbhelper/content.hxx index 1e8f32107241..fde86609e850 100644 --- a/ucbhelper/inc/ucbhelper/content.hxx +++ b/ucbhelper/inc/ucbhelper/content.hxx @@ -60,6 +60,7 @@ namespace com { namespace sun { namespace star { namespace ucb { class XContentIdentifier; class XDynamicResultSet; class XAnyCompareFactory; + struct ContentInfo; struct NumberedSortingInfo; } } } } @@ -70,7 +71,7 @@ namespace ucbhelper /** * These are the possible values for the parameter eMode of method - * ucb::Content::createCursor. + * ucbhelper::Content::createCursor. */ enum ResultSetInclude { @@ -81,7 +82,7 @@ enum ResultSetInclude /** * These are the possible values for the parameter eOperation of method - * ucb::Content::insertNewContent. + * ucbhelper::Content::insertNewContent. */ enum InsertOperation { @@ -821,16 +822,31 @@ public: throw( ::com::sun::star::ucb::CommandAbortedException, ::com::sun::star::uno::RuntimeException, ::com::sun::star::uno::Exception ); + + /** + * This method returns the different types of contents this content + * can create. + * + * @return the content types or an empty sequence if no contents can be + * created by this content. + */ + ::com::sun::star::uno::Sequence< ::com::sun::star::ucb::ContentInfo > + queryCreatableContentsInfo() + throw( ::com::sun::star::ucb::CommandAbortedException, + ::com::sun::star::uno::RuntimeException, + ::com::sun::star::uno::Exception ); + /** * This method creates, initializes and inserts ( commits ) a new content * (i.e. it could be used to create a new file system folder). - * Internally this method does a XContentCreator::createNewContent(...)- - * XCommandProcessor::execute( "setPropertyValues", ... )- - * XCommandProcessor::execute( "insert", ... ) calling sequence. + * Internally this method does a + * XCommandProcessor::execute( "createNewContent", ... ); + * XCommandProcessor::execute( "setPropertyValues", ... ); + * XCommandProcessor::execute( "insert", ... ); calling sequence. * * @param rContentType is the type for the new UCB content. Each content - * provider implementation may introduce own types for its contnt - * objects. + * provider implementation may introduce own types for its content + * objects (See queryCreatableContentsInfo()). * @param rPropertyNames is a sequence of names of properties for that * values are to set at the new content before it will be inserted * ( commited ). @@ -856,13 +872,14 @@ public: /** * This method creates, initializes and inserts ( commits ) a new content * (i.e. it could be used to create a new file system folder). - * Internally this method does a XContentCreator::createNewContent(...)- - * XCommandProcessor::execute( "setPropertyValues", ... )- - * XCommandProcessor::execute( "insert", ... ) calling sequence. + * Internally this method does a + * XCommandProcessor::execute( "createNewContent", ... ); + * XCommandProcessor::execute( "setPropertyValues", ... ); + * XCommandProcessor::execute( "insert", ... ); calling sequence. * * @param rContentType is the type for the new UCB content. Each content - * provider implementation may introduce own types for its contnt - * objects. + * provider implementation may introduce own types for its content + * objects (See queryCreatableContentsInfo()). * @param nPropertyHandes is a sequence of handles of properties for that * values are to set at the new content before it will be inserted * ( commited ). @@ -888,14 +905,15 @@ public: /** * This method creates, initializes and inserts (commits) a new content * inside this (the target folder) content. For example, it can be used to - * create a new file system folder. - * Internally this method does a XContentCreator::createNewContent(...)- - * XCommandProcessor::execute( "setPropertyValues", ... )- - * XCommandProcessor::execute( "insert", ... ) calling sequence. + * create a new file system file. + * Internally this method does a + * XCommandProcessor::execute( "createNewContent", ... ); + * XCommandProcessor::execute( "setPropertyValues", ... ); + * XCommandProcessor::execute( "insert", ... ); calling sequence. * * @param rContentType is the type for the new UCB content. Each content - * provider implementation may introduce own types for its contnt - * objects. + * provider implementation may introduce own types for its content + * objects (See queryCreatableContentsInfo()). * @param rPropertyNames is a sequence of names of properties for that * values are to set at the new content before it will be inserted * ( commited ). @@ -925,14 +943,15 @@ public: /** * This method creates, initializes and inserts (commits) a new content * inside this (the target folder) content. For example, it can be used to - * create a new file system folder. - * Internally this method does a XContentCreator::createNewContent(...)- - * XCommandProcessor::execute( "setPropertyValues", ... )- - * XCommandProcessor::execute( "insert", ... ) calling sequence. + * create a new file system file. + * Internally this method does a + * XCommandProcessor::execute( "createNewContent", ... ); + * XCommandProcessor::execute( "setPropertyValues", ... ); + * XCommandProcessor::execute( "insert", ... ); calling sequence. * * @param rContentType is the type for the new UCB content. Each content - * provider implementation may introduce own types for its contnt - * objects. + * provider implementation may introduce own types for its content + * objects (See queryCreatableContentsInfo()). * @param nPropertyHandes is a sequence of handles of properties for that * values are to set at the new content before it will be inserted * ( commited ). diff --git a/ucbhelper/source/client/content.cxx b/ucbhelper/source/client/content.cxx index e3b98ed24d81..28eef297e85f 100644 --- a/ucbhelper/source/client/content.cxx +++ b/ucbhelper/source/client/content.cxx @@ -73,9 +73,7 @@ #include #include #include -#ifndef _UCBHELPER_INTERACTIONREQUEST_HXX #include -#endif #include using namespace com::sun::star::container; @@ -210,6 +208,7 @@ public: Any executeCommand( const Command& rCommand ); void abortCommand(); + inline const Reference< XCommandEnvironment >& getEnvironment() const; inline void setEnvironment( const Reference< XCommandEnvironment >& xNewEnv ); @@ -1348,6 +1347,26 @@ void Content::writeStream( const Reference< XInputStream >& rStream, m_xImpl->inserted(); } +//========================================================================= +Sequence< ContentInfo > Content::queryCreatableContentsInfo() + throw( CommandAbortedException, RuntimeException, Exception ) +{ + // First, try it using "CreatableContentsInfo" property -> the "new" way. + Sequence< ContentInfo > aInfo; + if ( getPropertyValue( + rtl::OUString::createFromAscii( "CreatableContentsInfo" ) ) + >>= aInfo ) + return aInfo; + + // Second, try it using XContentCreator interface -> the "old" way (not + // providing the chance to supply an XCommandEnvironment. + Reference< XContentCreator > xCreator( m_xImpl->getContent(), UNO_QUERY ); + if ( xCreator.is() ) + aInfo = xCreator->queryCreatableContentsInfo(); + + return aInfo; +} + //========================================================================= sal_Bool Content::insertNewContent( const rtl::OUString& rContentType, const Sequence< rtl::OUString >& @@ -1390,21 +1409,43 @@ sal_Bool Content::insertNewContent( const rtl::OUString& rContentType, if ( rContentType.getLength() == 0 ) return sal_False; - Reference< XContentCreator > xCreator( m_xImpl->getContent(), UNO_QUERY ); - - OSL_ENSURE( xCreator.is(), - "Content::insertNewContent - Not a XContentCreator!" ); - - if ( !xCreator.is() ) - return sal_False; - + // First, try it using "createNewContent" command -> the "new" way. ContentInfo aInfo; aInfo.Type = rContentType; aInfo.Attributes = 0; - Reference< XContent > xNew = xCreator->createNewContent( aInfo ); + Command aCommand; + aCommand.Name = rtl::OUString::createFromAscii( "createNewContent" ); + aCommand.Handle = -1; // n/a + aCommand.Argument <<= aInfo; + + Reference< XContent > xNew; + try + { + m_xImpl->executeCommand( aCommand ) >>= xNew; + } + catch ( RuntimeException const & ) + { + throw; + } + catch ( Exception const & ) + { + } + if ( !xNew.is() ) - return sal_False; + { + // Second, try it using XContentCreator interface -> the "old" + // way (not providing the chance to supply an XCommandEnvironment. + Reference< XContentCreator > xCreator( m_xImpl->getContent(), UNO_QUERY ); + + if ( !xCreator.is() ) + return sal_False; + + xNew = xCreator->createNewContent( aInfo ); + + if ( !xNew.is() ) + return sal_False; + } Content aNewContent( xNew, m_xImpl->getEnvironment() ); aNewContent.setPropertyValues( rPropertyNames, rPropertyValues ); @@ -1431,21 +1472,43 @@ sal_Bool Content::insertNewContent( const rtl::OUString& rContentType, if ( rContentType.getLength() == 0 ) return sal_False; - Reference< XContentCreator > xCreator( m_xImpl->getContent(), UNO_QUERY ); - - OSL_ENSURE( xCreator.is(), - "Content::insertNewContent - Not a XContentCreator!" ); - - if ( !xCreator.is() ) - return sal_False; - + // First, try it using "createNewContent" command -> the "new" way. ContentInfo aInfo; aInfo.Type = rContentType; aInfo.Attributes = 0; - Reference< XContent > xNew = xCreator->createNewContent( aInfo ); + Command aCommand; + aCommand.Name = rtl::OUString::createFromAscii( "createNewContent" ); + aCommand.Handle = -1; // n/a + aCommand.Argument <<= aInfo; + + Reference< XContent > xNew; + try + { + m_xImpl->executeCommand( aCommand ) >>= xNew; + } + catch ( RuntimeException const & ) + { + throw; + } + catch ( Exception const & ) + { + } + if ( !xNew.is() ) - return sal_False; + { + // Second, try it using XContentCreator interface -> the "old" + // way (not providing the chance to supply an XCommandEnvironment. + Reference< XContentCreator > xCreator( m_xImpl->getContent(), UNO_QUERY ); + + if ( !xCreator.is() ) + return sal_False; + + xNew = xCreator->createNewContent( aInfo ); + + if ( !xNew.is() ) + return sal_False; + } Content aNewContent( xNew, m_xImpl->getEnvironment() ); aNewContent.setPropertyValues( nPropertyHandles, rPropertyValues ); diff --git a/unotools/source/ucbhelper/ucbhelper.cxx b/unotools/source/ucbhelper/ucbhelper.cxx index 2b301efc4e52..a798f485516a 100644 --- a/unotools/source/ucbhelper/ucbhelper.cxx +++ b/unotools/source/ucbhelper/ucbhelper.cxx @@ -46,15 +46,13 @@ #include #include #include +#include #include -#include #include #include #include #include -#ifndef _COM_SUN_STAR_UCB_INTERACTIVEIODEXCEPTION_HPP_ #include -#endif #include #include #include @@ -489,11 +487,7 @@ sal_Bool UCBContentHelper::CanMakeFolder( const String& rFolder ) try { Content aCnt( rFolder, uno::Reference< XCommandEnvironment > () ); - uno::Reference< XContentCreator > xCreator = uno::Reference< XContentCreator >( aCnt.get(), UNO_QUERY ); - if ( !xCreator.is() ) - return sal_False; - - Sequence< ContentInfo > aInfo = xCreator->queryCreatableContentsInfo(); + Sequence< ContentInfo > aInfo = aCnt.queryCreatableContentsInfo(); sal_Int32 nCount = aInfo.getLength(); if ( nCount == 0 ) return sal_False; @@ -538,11 +532,7 @@ sal_Bool UCBContentHelper::MakeFolder( Content& aCnt, const String& aTitle, Cont try { - uno::Reference< XContentCreator > xCreator( aCnt.get(), UNO_QUERY ); - if ( !xCreator.is() ) - return sal_False; - - Sequence< ContentInfo > aInfo = xCreator->queryCreatableContentsInfo(); + Sequence< ContentInfo > aInfo = aCnt.queryCreatableContentsInfo(); sal_Int32 nCount = aInfo.getLength(); if ( nCount == 0 ) return sal_False; -- cgit v1.2.3 From 9fed521e577fb47e1ec241f1a73e231a9dc789ed Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Wed, 6 Jan 2010 16:46:36 +0100 Subject: #i61429# - Adapted UCB clients to deprecated XContentCreator interface. --- dbaccess/source/ui/app/AppDetailPageHelper.cxx | 39 ++++++++++++-------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx index 4b5085fbe11f..6a387302f76b 100644 --- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx +++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx @@ -93,9 +93,6 @@ #ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_ #include #endif -#ifndef _COM_SUN_STAR_UCB_XCONTENTCREATOR_HPP_ -#include -#endif #ifndef _COM_SUN_STAR_UCB_XCOMMANDENVIRONMENT_HPP_ #include #endif @@ -256,7 +253,7 @@ namespace EnableInput(FALSE); return 0L; } - // ----------------------------------------------------------------------------- + // ----------------------------------------------------------------------------- void OTablePreviewWindow::DataChanged( const DataChangedEvent& rDCEvt ) { Window::DataChanged( rDCEvt ); @@ -268,7 +265,7 @@ namespace Invalidate(); } } - // ----------------------------------------------------------------------------- + // ----------------------------------------------------------------------------- void OTablePreviewWindow::ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground ) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); @@ -634,13 +631,13 @@ sal_Bool OAppDetailPageHelper::isCutAllowed() // ----------------------------------------------------------------------------- sal_Bool OAppDetailPageHelper::isCopyAllowed() { - // int nPos = getVisibleControlIndex(); + //int nPos = getVisibleControlIndex(); return sal_True; } // ----------------------------------------------------------------------------- sal_Bool OAppDetailPageHelper::isPasteAllowed() { - // int nPos = getVisibleControlIndex(); + //int nPos = getVisibleControlIndex(); return sal_True; } // ----------------------------------------------------------------------------- @@ -1099,8 +1096,8 @@ void OAppDetailPageHelper::Resize() ////////////////////////////////////////////////////////////////////// // Abmessungen parent window Size aOutputSize( GetOutputSize() ); - long nOutputWidth = aOutputSize.Width(); - long nOutputHeight = aOutputSize.Height(); + long nOutputWidth = aOutputSize.Width(); + long nOutputHeight = aOutputSize.Height(); Window* pWindow = getCurrentView(); if ( pWindow ) @@ -1115,12 +1112,12 @@ void OAppDetailPageHelper::Resize() String sText = m_aTBPreview.GetItemText(SID_DB_APP_DISABLE_PREVIEW); Size aTBSize = m_aTBPreview.CalcWindowSizePixel(); - m_aTBPreview.SetPosSizePixel( Point(nOutputWidth - aTBSize.getWidth(), 0 ), - aTBSize ); + m_aTBPreview.SetPosSizePixel(Point(nOutputWidth - aTBSize.getWidth(), 0 ), + aTBSize ); - m_aBorder.SetPosSizePixel( Point(nHalfOutputWidth + aFLSize.Width() + n6PPT, aTBSize.getHeight() + n6PPT ), - Size(nHalfOutputWidth - aFLSize.Width() - n6PPT, nOutputHeight - 2*n6PPT - aTBSize.getHeight()) ); - m_aPreview.SetPosSizePixel( Point(0,0),m_aBorder.GetSizePixel() ); + m_aBorder.SetPosSizePixel(Point(nHalfOutputWidth + aFLSize.Width() + n6PPT, aTBSize.getHeight() + n6PPT ), + Size(nHalfOutputWidth - aFLSize.Width() - n6PPT, nOutputHeight - 2*n6PPT - aTBSize.getHeight()) ); + m_aPreview.SetPosSizePixel(Point(0,0),m_aBorder.GetSizePixel() ); m_aDocumentInfo.SetPosSizePixel(Point(0,0),m_aBorder.GetSizePixel() ); m_pTablePreview->SetPosSizePixel(Point(0,0),m_aBorder.GetSizePixel() ); } @@ -1237,9 +1234,9 @@ void OAppDetailPageHelper::showPreview(const Reference< XContent >& _xContent) // Why the below code? It might have side effects, as the tree view needs to know // its current selection for other purposes than the preview, too. -// DBTreeListBox* pTreeView = getCurrentView(); -// if ( pTreeView ) -// pTreeView->clearCurrentSelection(); +// DBTreeListBox* pTreeView = getCurrentView(); +// if ( pTreeView ) +// pTreeView->clearCurrentSelection(); } } catch( const Exception& ) @@ -1445,9 +1442,9 @@ OPreviewWindow::OPreviewWindow(Window* _pParent) // ----------------------------------------------------------------------------- BOOL OPreviewWindow::ImplGetGraphicCenterRect( const Graphic& rGraphic, Rectangle& rResultRect ) const { - const Size aWinSize( GetOutputSizePixel() ); - Size aNewSize( LogicToPixel( rGraphic.GetPrefSize(), rGraphic.GetPrefMapMode() ) ); - BOOL bRet = FALSE; + const Size aWinSize( GetOutputSizePixel() ); + Size aNewSize( LogicToPixel( rGraphic.GetPrefSize(), rGraphic.GetPrefMapMode() ) ); + BOOL bRet = FALSE; if( aNewSize.Width() && aNewSize.Height() ) { @@ -1505,7 +1502,7 @@ void OPreviewWindow::DataChanged( const DataChangedEvent& rDCEvt ) Invalidate(); } } -// ----------------------------------------------------------------------------- +// ----------------------------------------------------------------------------- void OPreviewWindow::ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground ) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); -- cgit v1.2.3 From f7fab85572c59895588405b9c0e9f285c1d7aebd Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Wed, 6 Jan 2010 16:46:36 +0100 Subject: #i61429# - Adapted UCB clients to deprecated XContentCreator interface. --- odk/examples/DevelopersGuide/UCB/ResourceCreator.java | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/odk/examples/DevelopersGuide/UCB/ResourceCreator.java b/odk/examples/DevelopersGuide/UCB/ResourceCreator.java index 202941e1772a..c28bc47ea866 100644 --- a/odk/examples/DevelopersGuide/UCB/ResourceCreator.java +++ b/odk/examples/DevelopersGuide/UCB/ResourceCreator.java @@ -43,7 +43,6 @@ import com.sun.star.uno.UnoRuntime; import com.sun.star.ucb.ContentInfo; import com.sun.star.ucb.InsertCommandArgument; import com.sun.star.ucb.XContent; -import com.sun.star.ucb.XContentCreator; import com.sun.star.io.XInputStream; @@ -154,18 +153,17 @@ public class ResourceCreator { boolean result = false; if ( stream != null && name != null && !name.equals( "" )) { - // Obtain content creator interface. - XContentCreator creator = ( XContentCreator )UnoRuntime.queryInterface( - XContentCreator.class, m_content ); - - // Note: The data for info may have been obtained using - // XContentCreator::queryCreatableContentsInfo(). + // Note: The data for info may have been obtained from + // property CreatableContentsInfo. ContentInfo info = new ContentInfo(); info.Type = "application/vnd.sun.staroffice.fsys-file"; info.Attributes = 0; - // Create new, empty content. - XContent newContent = creator.createNewContent( info ); + // Create new, empty content (execute command "createNewContent"). + XContent newContent = ( XContent )UnoRuntime.queryInterface( + XContent.class, + m_helper.executeCommand( m_content, "createNewContent", info ) ); + if ( newContent != null ) { ///////////////////////////////////////////////////////////////////// @@ -181,7 +179,7 @@ public class ResourceCreator { props[ 0 ] = prop; // Execute command "setPropertyValues". - m_helper.executeCommand( newContent, "setPropertyValues",props ); + m_helper.executeCommand( newContent, "setPropertyValues", props ); ///////////////////////////////////////////////////////////////////// // Write the new file to disk... -- cgit v1.2.3 From 59a5f79d04ca9478a740d348e420ddb34f86c890 Mon Sep 17 00:00:00 2001 From: ericb Date: Thu, 7 Jan 2010 10:16:45 +0100 Subject: eraser01: #i103174# fix missing changes due to rebase from external repository --- offapi/com/sun/star/presentation/XSlideShow.idl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/offapi/com/sun/star/presentation/XSlideShow.idl b/offapi/com/sun/star/presentation/XSlideShow.idl index 0d6065f1b0ed..00a11f0dfbf0 100644 --- a/offapi/com/sun/star/presentation/XSlideShow.idl +++ b/offapi/com/sun/star/presentation/XSlideShow.idl @@ -136,6 +136,10 @@ interface XSlideShow : ::com::sun::star::uno::XInterface @param xPage The slide to display. + @param xDrawPages + For future use. + This parameter can be NULL when the ENABLE_PRESENTER_EXTRA_UI feature is disabled. + @param xAnimationNode The animation node determine the animations to display. -- cgit v1.2.3 From 74d69666a871202c0073d4fe23982c7cea063276 Mon Sep 17 00:00:00 2001 From: ericb Date: Thu, 7 Jan 2010 10:16:57 +0100 Subject: eraser01: #i103174# fix missing changes due to rebase from external repository --- cppcanvas/inc/cppcanvas/color.hxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cppcanvas/inc/cppcanvas/color.hxx b/cppcanvas/inc/cppcanvas/color.hxx index e1cb30900e5e..ad0430713ead 100644 --- a/cppcanvas/inc/cppcanvas/color.hxx +++ b/cppcanvas/inc/cppcanvas/color.hxx @@ -83,6 +83,11 @@ namespace cppcanvas return (nRed << 24U)|(nGreen << 16U)|(nBlue << 8U)|(nAlpha); } + inline sal_Int32 unMakeColor( sal_uInt8 nAlpha, sal_uInt8 nRed, sal_uInt8 nGreen, sal_uInt8 nBlue) + { + return (nAlpha << 24U)|(nRed << 16U)|(nGreen << 8U)|(nBlue); + } + inline sal_Int32 makeColorARGB( sal_uInt8 nAlpha, sal_uInt8 nRed, sal_uInt8 nGreen, sal_uInt8 nBlue) { return (nAlpha << 24U)|(nRed << 16U)|(nGreen << 8U)|(nBlue); -- cgit v1.2.3 From 01280720136d78180e154449784be30bcac302a0 Mon Sep 17 00:00:00 2001 From: sj Date: Thu, 7 Jan 2010 16:56:37 +0100 Subject: impress181: fixed resync problem --- filter/source/pdf/impdialog.src | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/filter/source/pdf/impdialog.src b/filter/source/pdf/impdialog.src index 93db2a79a79a..b20c5afb0237 100644 --- a/filter/source/pdf/impdialog.src +++ b/filter/source/pdf/impdialog.src @@ -30,7 +30,7 @@ #include "impdialog.hrc" -#define TAB_PDF_SIZE Size = MAP_APPFONT ( 176, 239 ) +#define TAB_PDF_SIZE Size = MAP_APPFONT ( 176, 255 ) //string for TabDialog standard buttons String STR_PDF_EXPORT { @@ -219,14 +219,14 @@ TabPage RID_PDF_TAB_GENER }; CheckBox CB_EXPORTNOTESPAGES { - Pos = MAP_APPFONT ( 12 , 206 ) ; + Pos = MAP_APPFONT ( 12 , 216 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; TabStop = TRUE ; Text[ en-US ] = "Export ~notes pages"; }; CheckBox CB_EXPORTEMPTYPAGES { - Pos = MAP_APPFONT ( 12 , 216 ) ; + Pos = MAP_APPFONT ( 12 , 229 ) ; Size = MAP_APPFONT ( 158 , 16 ) ; TabStop = TRUE ; WordBreak = TRUE ; @@ -234,7 +234,7 @@ TabPage RID_PDF_TAB_GENER }; CheckBox CB_ADDSTREAM { - Pos = MAP_APPFONT ( 12 , 235 ) ; + Pos = MAP_APPFONT ( 12 , 248 ) ; Size = MAP_APPFONT ( 158 , 10 ) ; TabStop = TRUE ; Text[ en-US ] = "Create ~hybrid file"; -- cgit v1.2.3 From 432e0fcb93c713a39890ec7ed0769521ef6ef3e8 Mon Sep 17 00:00:00 2001 From: hdu Date: Fri, 8 Jan 2010 12:59:39 +0100 Subject: #i108138# fix printing crash which happens since DEV300_m66 --- vcl/source/gdi/outdev3.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx index 51aad0790a26..28fa4f8f5461 100644 --- a/vcl/source/gdi/outdev3.cxx +++ b/vcl/source/gdi/outdev3.cxx @@ -5601,6 +5601,8 @@ void OutputDevice::DrawTextArray( const Point& rStartPt, const String& rStr, if ( !IsDeviceOutputNecessary() ) return; + if( !mpGraphics && !ImplGetGraphics() ) + return; if( mbInitClipRegion ) ImplInitClipRegion(); if( mbOutputClipped ) -- cgit v1.2.3 From f11c5dc93ef6c206e780ddd7d24943e728948ca1 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Fri, 8 Jan 2010 13:23:28 +0100 Subject: fixed compile error after resync. --- uui/source/iahndl-cookies.cxx | 2 +- uui/source/iahndl-errorhandler.cxx | 2 +- uui/source/iahndl-ssl.cxx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/uui/source/iahndl-cookies.cxx b/uui/source/iahndl-cookies.cxx index 89ed2779c732..9e8f45b5c154 100644 --- a/uui/source/iahndl-cookies.cxx +++ b/uui/source/iahndl-cookies.cxx @@ -34,7 +34,7 @@ #include "vos/mutex.hxx" #include "tools/list.hxx" -#include "svtools/httpcook.hxx" +#include "svl/httpcook.hxx" #include "vcl/svapp.hxx" #include "cookiedg.hxx" diff --git a/uui/source/iahndl-errorhandler.cxx b/uui/source/iahndl-errorhandler.cxx index 6e385372339c..ed8fd2118184 100644 --- a/uui/source/iahndl-errorhandler.cxx +++ b/uui/source/iahndl-errorhandler.cxx @@ -40,7 +40,7 @@ #include "com/sun/star/task/XInteractionRetry.hpp" #include "tools/errinf.hxx" // ErrorHandler, ErrorContext, ... -#include "svtools/svtools.hrc" // RID_ERRHDL +#include "svl/svtools.hrc" // RID_ERRHDL #include "ids.hrc" #include "getcontinuations.hxx" diff --git a/uui/source/iahndl-ssl.cxx b/uui/source/iahndl-ssl.cxx index 7788d1e0995d..e5e1a14bb20e 100644 --- a/uui/source/iahndl-ssl.cxx +++ b/uui/source/iahndl-ssl.cxx @@ -36,7 +36,7 @@ #include "vos/mutex.hxx" #include "tools/datetime.hxx" -#include "svtools/zforlist.hxx" +#include "svl/zforlist.hxx" #include "vcl/svapp.hxx" #include "ids.hrc" -- cgit v1.2.3 From ccae886783b578c2ecd162704815ac347ea2b773 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Fri, 8 Jan 2010 13:23:28 +0100 Subject: fixed compile error after resync. --- neon/neon.patch | 88 +++++++++++++++++++++++++++------------------------------ 1 file changed, 42 insertions(+), 46 deletions(-) diff --git a/neon/neon.patch b/neon/neon.patch index 7b58a09e791a..09233266b292 100644 --- a/neon/neon.patch +++ b/neon/neon.patch @@ -1,5 +1,5 @@ ---- misc/neon-0.28.2/src/config.h 2009-12-10 13:29:15.000000000 +0100 -+++ misc/build/neon-0.28.2/src/config.h 2009-12-10 13:21:58.000000000 +0100 +--- misc/neon-0.28.2/src/config.h 2010-01-08 11:51:21.000000000 +0100 ++++ misc/build/neon-0.28.2/src/config.h 2010-01-08 11:53:42.000000000 +0100 @@ -1 +1,488 @@ -dummy + @@ -490,8 +490,8 @@ +#else +#define HAVE_NTLM 1 +#endif ---- misc/neon-0.28.2/src/makefile.mk 2009-12-10 13:29:15.000000000 +0100 -+++ misc/build/neon-0.28.2/src/makefile.mk 2009-12-10 13:21:58.000000000 +0100 +--- misc/neon-0.28.2/src/makefile.mk 2010-01-08 11:51:21.000000000 +0100 ++++ misc/build/neon-0.28.2/src/makefile.mk 2010-01-08 11:53:27.000000000 +0100 @@ -1 +1,100 @@ -dummy +PRJ=..$/..$/..$/..$/.. @@ -595,7 +595,7 @@ +DEF1NAME=$(SHL1TARGET) +.INCLUDE : target.mk --- misc/neon-0.28.2/src/ne_auth.c 2008-02-29 17:30:12.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_auth.c 2009-12-10 13:21:58.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_auth.c 2010-01-08 11:30:06.000000000 +0100 @@ -77,6 +77,10 @@ #include "ne_sspi.h" #endif @@ -634,8 +634,8 @@ static int get_credentials(auth_session *sess, ne_buffer **errmsg, int attempt, struct auth_challenge *chall, char *pwbuf) { -- if (chall->handler->creds(chall->handler->userdata, sess->realm, -+ if (chall->handler->creds(chall->handler->userdata, chall->protocol->name, sess->realm, +- if (chall->handler->creds(chall->handler->userdata, sess->realm, ++ if (chall->handler->creds(chall->handler->userdata, chall->protocol->name, sess->realm, chall->handler->attempt++, sess->username, pwbuf) == 0) { return 0; } else { @@ -643,9 +643,9 @@ int ntlm = ne_strcasecmp(parms->protocol->name, "NTLM") == 0; int status; char *response = NULL; -- -+ char password[NE_ABUFSIZ]; -+ +- ++ char password[NE_ABUFSIZ]; ++ NE_DEBUG(NE_DBG_HTTPAUTH, "auth: SSPI challenge.\n"); if (!sess->sspi_context) { @@ -756,7 +756,7 @@ return ret; } --- misc/neon-0.28.2/src/ne_auth.h 2007-12-05 17:39:58.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_auth.h 2009-12-10 13:21:58.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_auth.h 2010-01-08 11:30:07.000000000 +0100 @@ -47,8 +47,8 @@ * Hint: if you just wish to attempt authentication just once (even if * the user gets the username/password wrong), have the callback @@ -769,7 +769,7 @@ /* Set callbacks to provide credentials for server and proxy * authentication, using the default set of authentication protocols. --- misc/neon-0.28.2/src/ne_defs.h 2006-10-24 21:40:09.000000000 +0200 -+++ misc/build/neon-0.28.2/src/ne_defs.h 2009-12-10 13:21:58.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_defs.h 2010-01-08 11:30:07.000000000 +0100 @@ -41,7 +41,7 @@ #endif @@ -780,7 +780,7 @@ #endif --- misc/neon-0.28.2/src/ne_locks.c 2007-02-05 11:09:27.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_locks.c 2009-12-10 13:21:58.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_locks.c 2010-01-08 11:30:06.000000000 +0100 @@ -579,6 +579,23 @@ const char *token = ne_get_response_header(ctx->req, "Lock-Token"); /* at the root element; retrieve the Lock-Token header, @@ -848,7 +848,7 @@ } } --- misc/neon-0.28.2/src/ne_locks.h 2006-01-02 12:43:19.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_locks.h 2009-12-10 13:21:58.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_locks.h 2010-01-08 11:30:07.000000000 +0100 @@ -22,6 +22,10 @@ #ifndef NE_LOCKS_H #define NE_LOCKS_H @@ -860,8 +860,8 @@ #include "ne_request.h" /* for ne_session + ne_request */ #include "ne_uri.h" /* for ne_uri */ ---- misc/neon-0.28.2/src/ne_ntlm.c 2009-12-10 13:29:15.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_ntlm.c 2009-12-10 13:21:58.000000000 +0100 +--- misc/neon-0.28.2/src/ne_ntlm.c 2010-01-08 11:51:21.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_ntlm.c 2010-01-08 11:53:52.000000000 +0100 @@ -1 +1,703 @@ -dummy +/* @@ -1567,8 +1567,8 @@ + +#endif /* HAVE_OPENSSL */ +#endif /* HAVE_NTLM */ ---- misc/neon-0.28.2/src/ne_ntlm.h 2009-12-10 13:29:15.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_ntlm.h 2009-12-10 13:21:58.000000000 +0100 +--- misc/neon-0.28.2/src/ne_ntlm.h 2010-01-08 11:51:21.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_ntlm.h 2010-01-08 11:53:52.000000000 +0100 @@ -1 +1,44 @@ -dummy +/* @@ -1616,7 +1616,7 @@ + +#endif /* NE_NTLM_H */ --- misc/neon-0.28.2/src/ne_socket.c 2008-02-28 14:19:19.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_socket.c 2009-12-10 13:21:58.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_socket.c 2010-01-08 11:30:06.000000000 +0100 @@ -60,6 +60,7 @@ #include #ifdef USE_GETADDRINFO @@ -1626,15 +1626,11 @@ #endif --- misc/neon-0.28.2/src/ne_sspi.c 2007-08-10 17:26:08.000000000 +0200 -+++ misc/build/neon-0.28.2/src/ne_sspi.c 2009-12-10 13:28:42.000000000 +0100 -@@ -202,9 +202,48 @@ - return -1; - } ++++ misc/build/neon-0.28.2/src/ne_sspi.c 2010-01-08 11:30:07.000000000 +0100 +@@ -206,6 +206,45 @@ + } -+ return 0; -+} -+ -+/* + /* + * Simplification wrapper arround AcquireCredentialsHandle as most of + * the parameters do not change. + */ @@ -1669,13 +1665,14 @@ + return -1; + } + - return 0; - } - ++ return 0; ++} + - /* ++ ++/* * Wrapper arround initializeSecurityContext. Supplies several * default parameters as well as logging in case of errors. + */ @@ -483,7 +522,7 @@ * Processes received authentication tokens as well as supplies the * response token. @@ -1685,11 +1682,17 @@ { SecBufferDesc outBufferDesc; SecBuffer outBuffer; -@@ -560,14 +599,23 @@ - +@@ -561,13 +600,22 @@ /* Reset any existing context since we are starting over */ resetContext(sspiContext); -+ + +- if (acquireCredentialsHandle +- (&sspiContext->credentials, sspiContext->mechanism) != SEC_E_OK) { +- freeBuffer(&outBufferDesc); +- NE_DEBUG(NE_DBG_HTTPAUTH, +- "sspi: acquireCredentialsHandle failed.\n"); +- return -1; +- } + if (strlen(username) != 0) { + if (acquireCredentialsHandleForUsername + (&sspiContext->credentials, sspiContext->mechanism, username, password) != SEC_E_OK) { @@ -1705,19 +1708,12 @@ + return -1; + } + } - -- if (acquireCredentialsHandle -- (&sspiContext->credentials, sspiContext->mechanism) != SEC_E_OK) { -- freeBuffer(&outBufferDesc); -- NE_DEBUG(NE_DBG_HTTPAUTH, -- "sspi: acquireCredentialsHandle failed.\n"); -- return -1; -- } ++ securityStatus = initializeSecurityContext(&sspiContext->credentials, NULL, --- misc/neon-0.28.2/src/ne_sspi.h 2006-02-12 13:05:14.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_sspi.h 2009-12-10 13:21:58.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_sspi.h 2010-01-08 11:30:06.000000000 +0100 @@ -41,7 +41,7 @@ int ne_sspi_clear_context(void *context); @@ -1728,7 +1724,7 @@ #endif /* HAVE_SSPI */ --- misc/neon-0.28.2/src/ne_uri.c 2007-12-05 12:04:47.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_uri.c 2009-12-10 13:21:58.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_uri.c 2010-01-08 11:30:06.000000000 +0100 @@ -42,7 +42,7 @@ #include "ne_alloc.h" #include "ne_uri.h" @@ -1775,7 +1771,7 @@ /* 4x */ AT, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, /* 5x */ AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, AL, GD, OT, GD, OT, US, --- misc/neon-0.28.2/src/ne_utils.c 2006-03-07 10:36:43.000000000 +0100 -+++ misc/build/neon-0.28.2/src/ne_utils.c 2009-12-10 13:21:58.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_utils.c 2010-01-08 11:30:06.000000000 +0100 @@ -118,6 +118,9 @@ #ifdef HAVE_GNUTLS ", GNU TLS " LIBGNUTLS_VERSION @@ -1806,7 +1802,7 @@ #endif /* NE_HAVE_* */ default: --- misc/neon-0.28.2/src/ne_utils.h 2007-07-16 08:54:57.000000000 +0200 -+++ misc/build/neon-0.28.2/src/ne_utils.h 2009-12-10 13:21:58.000000000 +0100 ++++ misc/build/neon-0.28.2/src/ne_utils.h 2010-01-08 11:30:07.000000000 +0100 @@ -54,6 +54,7 @@ #define NE_FEATURE_SOCKS (5) /* SOCKSv5 support */ #define NE_FEATURE_TS_SSL (6) /* Thread-safe SSL/TLS support */ -- cgit v1.2.3 From a3a11b622b45398761d00c813359bc73d6a7fbcb Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 8 Jan 2010 12:41:03 +0000 Subject: cmcfixes69: #i108151#: remotebridges: fix strict aliasing --- remotebridges/source/bridge/bridge_connection.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/remotebridges/source/bridge/bridge_connection.cxx b/remotebridges/source/bridge/bridge_connection.cxx index ebb49dba1874..8da07ab246b7 100644 --- a/remotebridges/source/bridge/bridge_connection.cxx +++ b/remotebridges/source/bridge/bridge_connection.cxx @@ -77,8 +77,8 @@ namespace remotebridges_bridge try { // TODO possible optimization : give - ::rtl::ByteSequence seq( nSize , ::rtl::BYTESEQ_NODEFAULT ); - sal_Int32 nRead = m->m_r->read( *(Sequence*)&seq , nSize ); + Sequence seq = toUnoSequence( ::rtl::ByteSequence(nSize, ::rtl::BYTESEQ_NODEFAULT) ); + sal_Int32 nRead = m->m_r->read( seq , nSize ); memcpy( pDest , seq.getConstArray() , nRead ); return nRead; } -- cgit v1.2.3 From 5e8eac444983d7fcf8e4c102171179dbb6fffed9 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:47 +0100 Subject: swunolocking1: #i105557#: unobaseclass.hxx: add UnoImplPtr: new smart pointer template UnoImplPtr: calls dtor with SolarMutex locked. --- sw/inc/unobaseclass.hxx | 43 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/sw/inc/unobaseclass.hxx b/sw/inc/unobaseclass.hxx index 75443b2c7584..5f55115f479e 100644 --- a/sw/inc/unobaseclass.hxx +++ b/sw/inc/unobaseclass.hxx @@ -27,8 +27,8 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#ifndef _UNOBASECLASS_HXX -#define _UNOBASECLASS_HXX +#ifndef SW_UNOBASECLASS_HXX +#define SW_UNOBASECLASS_HXX #include #include @@ -102,5 +102,42 @@ class UnoActionRemoveContext /// helper function for implementing SwClient::Modify void ClientModify(SwClient* pClient, SfxPoolItem *pOld, SfxPoolItem *pNew); -#endif + +#include +#include +#include +#include + +namespace sw { + + template class UnoImplPtr + : private ::boost::noncopyable + { + private: + T * m_p; + + public: + UnoImplPtr(T *const i_p) + : m_p(i_p) + { + OSL_ENSURE(i_p, "UnoImplPtr: null"); + } + + ~UnoImplPtr() + { + ::vos::OGuard g(Application::GetSolarMutex()); + delete m_p; // #i105557#: call dtor with locked solar mutex + m_p = 0; + } + + T & operator * () const { return *m_p; } + + T * operator ->() const { return m_p; } + + T * get () const { return m_p; } + }; + +} // namespace sw + +#endif // SW_UNOBASECLASS_HXX -- cgit v1.2.3 From a22723dc6276d018fcd2fffa04c143e9c6c04c7a Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:48 +0100 Subject: swunolocking1: #i105557#: unobaseclass.hxx: add UnoTunnel helpers: new template UnoTunnelImpl to implement XUnoTunnel::getSomething(). new template UnoTunnelGetImplementation to use XUnoTunnel::getSomething(). --- sw/inc/unobaseclass.hxx | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/sw/inc/unobaseclass.hxx b/sw/inc/unobaseclass.hxx index 5f55115f479e..e9ae3f909a63 100644 --- a/sw/inc/unobaseclass.hxx +++ b/sw/inc/unobaseclass.hxx @@ -30,6 +30,7 @@ #ifndef SW_UNOBASECLASS_HXX #define SW_UNOBASECLASS_HXX +#include #include #include @@ -137,6 +138,32 @@ namespace sw { T * get () const { return m_p; } }; + template< class C > C * + UnoTunnelGetImplementation( + ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XUnoTunnel > const & xUnoTunnel) + { + if (!xUnoTunnel.is()) { return 0; } + C *const pC( reinterpret_cast< C* >( + ::sal::static_int_cast< sal_IntPtr >( + xUnoTunnel->getSomething(C::getUnoTunnelId())))); + return pC; + } + + template< class C > sal_Int64 + UnoTunnelImpl(const ::com::sun::star::uno::Sequence< sal_Int8 > & rId, + C *const pThis) + { + if ((rId.getLength() == 16) && + (0 == rtl_compareMemory(C::getUnoTunnelId().getConstArray(), + rId.getConstArray(), 16))) + { + return ::sal::static_int_cast< sal_Int64 >( + reinterpret_cast< sal_IntPtr >(pThis) ); + } + return 0; + } + } // namespace sw #endif // SW_UNOBASECLASS_HXX -- cgit v1.2.3 From 6e3f9b6a9a1f70811e393d10a21addfaeedc174e Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:48 +0100 Subject: swunolocking1: #i105557#: unobaseclass.hxx: add XServiceInfo helpers: new functions GetSupportedServiceNamesImpl and SupportsServiceImpl. --- sw/inc/unobaseclass.hxx | 7 +++++++ sw/source/core/unocore/unoobj2.cxx | 31 +++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/sw/inc/unobaseclass.hxx b/sw/inc/unobaseclass.hxx index e9ae3f909a63..91ef17d4e9d4 100644 --- a/sw/inc/unobaseclass.hxx +++ b/sw/inc/unobaseclass.hxx @@ -164,6 +164,13 @@ namespace sw { return 0; } + ::com::sun::star::uno::Sequence< ::rtl::OUString > + GetSupportedServiceNamesImpl( + size_t const nServices, char const*const pServices[]); + sal_Bool SupportsServiceImpl( + size_t const nServices, char const*const pServices[], + ::rtl::OUString const & rServiceName); + } // namespace sw #endif // SW_UNOBASECLASS_HXX diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index 6d2a0d49f9d5..a7f6119e5962 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -146,6 +146,37 @@ using namespace ::com::sun::star::drawing; using ::rtl::OUString; +namespace sw { + +sal_Bool SupportsServiceImpl( + size_t const nServices, char const*const pServices[], + ::rtl::OUString const & rServiceName) +{ + for (size_t i = 0; i < nServices; ++i) + { + if (rServiceName.equalsAscii(pServices[i])) + { + return sal_True; + } + } + return sal_False; +} + +uno::Sequence< ::rtl::OUString > +GetSupportedServiceNamesImpl( + size_t const nServices, char const*const pServices[]) +{ + uno::Sequence< ::rtl::OUString > ret(nServices); + for (size_t i = 0; i < nServices; ++i) + { + ret[i] = C2U(pServices[i]); + } + return ret; +} + +} // namespace sw + + struct FrameDependSortListLess { bool operator() (FrameDependSortListEntry const& r1, -- cgit v1.2.3 From e9ca667fa65f946acec102e3932372010b8622bd Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:49 +0100 Subject: swunolocking1: refactor Meta registration at its text node. Meta will now be registered via SwTxtMeta::ChgTxtNode(), with additional workarounds necessary in SwFmtMeta::DoCopy(). --- sw/inc/fmtmeta.hxx | 8 +++-- sw/inc/txtatr.hxx | 2 +- .../complex/writer/TextPortionEnumerationTest.java | 2 +- sw/source/core/docnode/nodes.cxx | 11 +++++-- sw/source/core/txtnode/fmtatr2.cxx | 35 ++++++++++++++++++---- sw/source/core/txtnode/thints.cxx | 7 ++++- sw/source/core/txtnode/txtatr2.cxx | 10 +++++++ 7 files changed, 60 insertions(+), 15 deletions(-) diff --git a/sw/inc/fmtmeta.hxx b/sw/inc/fmtmeta.hxx index 952181d0498c..6d3f63ece477 100755 --- a/sw/inc/fmtmeta.hxx +++ b/sw/inc/fmtmeta.hxx @@ -122,8 +122,8 @@ public: virtual SfxPoolItem * Clone( SfxItemPool *pPool = 0 ) const; // TYPEINFO(); - // notify clients registered at m_pMeta that this meta is being removed - void NotifyRemoval(); + /// notify clients registered at m_pMeta that this meta is being (re-)moved + void NotifyChangeTxtNode(SwTxtNode *const pTxtNode); static SwFmtMeta * CreatePoolDefault( const USHORT i_nWhich ); ::sw::Meta * GetMeta() { return m_pMeta.get(); } /// this method must be called when the hint is actually copied @@ -140,7 +140,7 @@ class Meta , public SwModify { protected: - friend class ::SwFmtMeta; // SetFmtMeta + friend class ::SwFmtMeta; // SetFmtMeta, NotifyChangeTxtNode friend class ::SwXMeta; // GetTxtNode, GetTxtAttr SwFmtMeta * m_pFmt; @@ -151,6 +151,8 @@ protected: SwFmtMeta * GetFmtMeta() const { return m_pFmt; } void SetFmtMeta( SwFmtMeta * const i_pFmt ) { m_pFmt = i_pFmt; }; + void NotifyChangeTxtNode(); + public: explicit Meta(SwFmtMeta * const i_pFmt = 0); virtual ~Meta(); diff --git a/sw/inc/txtatr.hxx b/sw/inc/txtatr.hxx index d9e9463a30a7..8c0ad5854665 100644 --- a/sw/inc/txtatr.hxx +++ b/sw/inc/txtatr.hxx @@ -80,7 +80,7 @@ public: const xub_StrLen i_nStart, const xub_StrLen i_nEnd ); virtual ~SwTxtMeta(); - void ChgTxtNode( SwTxtNode * const pNode ) { m_pTxtNode = pNode; } + void ChgTxtNode(SwTxtNode * const pNode); SwTxtNode * GetTxtNode() const { return m_pTxtNode; } }; diff --git a/sw/qa/complex/writer/TextPortionEnumerationTest.java b/sw/qa/complex/writer/TextPortionEnumerationTest.java index a07b3cccadef..8110c82a6e58 100755 --- a/sw/qa/complex/writer/TextPortionEnumerationTest.java +++ b/sw/qa/complex/writer/TextPortionEnumerationTest.java @@ -3097,7 +3097,7 @@ public class TextPortionEnumerationTest extends ComplexTestCase XPropertySet xPropSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xPortion); String type = (String) xPropSet.getPropertyValue("TextPortionType"); - assure("first: not text", type.equals("Text")); + assure("first: not text: " + type, type.equals("Text")); String txt = xPortion.getString(); assure("first: text differs: " + txt, "45".equals(txt)); } diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx index ce24e4ba06b5..29d9c61e1ad8 100644 --- a/sw/source/core/docnode/nodes.cxx +++ b/sw/source/core/docnode/nodes.cxx @@ -47,7 +47,7 @@ #include #include #include -#include +#include #include #include @@ -350,8 +350,13 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, ULONG nSz, case RES_TXTATR_META: case RES_TXTATR_METAFIELD: - static_cast(pAttr->GetAttr()) - .NotifyRemoval(); + { + SwTxtMeta *const pTxtMeta( + static_cast(pAttr)); + // force removal of UNO object + pTxtMeta->ChgTxtNode(0); + pTxtMeta->ChgTxtNode(pTxtNd); + } break; default: diff --git a/sw/source/core/txtnode/fmtatr2.cxx b/sw/source/core/txtnode/fmtatr2.cxx index 405358adac59..f7fe06d6b006 100644 --- a/sw/source/core/txtnode/fmtatr2.cxx +++ b/sw/source/core/txtnode/fmtatr2.cxx @@ -650,19 +650,28 @@ void SwFmtMeta::SetTxtAttr(SwTxtMeta * const i_pTxtAttr) } } -void SwFmtMeta::NotifyRemoval() +void SwFmtMeta::NotifyChangeTxtNode(SwTxtNode *const pTxtNode) { // N.B.: do not reset m_pTxtAttr here: see call in nodes.cxx, // where the hint is not deleted! ASSERT(m_pMeta, "NotifyRemoval: no meta ?"); if (m_pMeta) { - SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, - &static_cast(*m_pMeta) ); // cast to proper base class! - m_pMeta->Modify(&aMsgHint, &aMsgHint); + if (!pTxtNode) + { + SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, + &static_cast(*m_pMeta) ); // cast to base class! + m_pMeta->Modify(&aMsgHint, &aMsgHint); + } + else + { // do not call Modify, that would call SwXMeta::Modify! + m_pMeta->NotifyChangeTxtNode(); + } } } +// UGLY: this really awful method fixes up an inconsistent state, +// and if it is not called when copying, total chaos will undoubtedly ensue void SwFmtMeta::DoCopy(SwFmtMeta & rOriginalMeta) { ASSERT(m_pMeta, "DoCopy called for SwFmtMeta with no sw::Meta?"); @@ -673,6 +682,8 @@ void SwFmtMeta::DoCopy(SwFmtMeta & rOriginalMeta) // inserted via MakeTxtAttr! so fix it up to point at the original item // (maybe would be better to tell MakeTxtAttr that it creates a copy?) pOriginal->SetFmtMeta(&rOriginalMeta); + // force pOriginal to register in original text node! + pOriginal->NotifyChangeTxtNode(); if (RES_TXTATR_META == Which()) { m_pMeta.reset( new ::sw::Meta(this) ); @@ -685,7 +696,10 @@ void SwFmtMeta::DoCopy(SwFmtMeta & rOriginalMeta) m_pMeta = pTargetDoc->GetMetaFieldManager().makeMetaField( this, pMetaField->m_nNumberFormat, pMetaField->IsFixedLanguage() ); } + // this cannot be done in Clone: a Clone is not necessarily a copy! m_pMeta->RegisterAsCopyOf(*pOriginal); + // force copy Meta to register in target text node! + m_pMeta->NotifyChangeTxtNode(); } } @@ -718,14 +732,23 @@ SwTxtNode * Meta::GetTxtNode() const return (pTxtAttr) ? pTxtAttr->GetTxtNode() : 0; } -// SwClient -void Meta::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ) +void Meta::NotifyChangeTxtNode() { SwTxtNode * const pTxtNode( GetTxtNode() ); if (pTxtNode && (GetRegisteredIn() != pTxtNode)) { pTxtNode->Add(this); } + else if (!pTxtNode && GetRegisteredIn()) + { + const_cast(GetRegisteredIn())->Remove(this); + } +} + +// SwClient +void Meta::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ) +{ + NotifyChangeTxtNode(); SwModify::Modify(pOld, pNew); } diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx index ba471381cad4..3300294f9e4b 100644 --- a/sw/source/core/txtnode/thints.cxx +++ b/sw/source/core/txtnode/thints.cxx @@ -114,6 +114,11 @@ struct TxtAttrDeleter TxtAttrDeleter( SwDoc & rDoc ) : m_rPool( rDoc.GetAttrPool() ) { } void operator() (SwTxtAttr * const pAttr) { + if (RES_TXTATR_META == pAttr->Which() || + RES_TXTATR_METAFIELD == pAttr->Which()) + { + static_cast(pAttr)->ChgTxtNode(0); // prevents ASSERT + } SwTxtAttr::Destroy( pAttr, m_rPool ); } }; @@ -1178,7 +1183,7 @@ void SwTxtNode::DestroyAttr( SwTxtAttr* pAttr ) case RES_TXTATR_META: case RES_TXTATR_METAFIELD: - static_cast(pAttr->GetAttr()).NotifyRemoval(); + static_cast(pAttr)->ChgTxtNode(0); break; default: diff --git a/sw/source/core/txtnode/txtatr2.cxx b/sw/source/core/txtnode/txtatr2.cxx index afed4e1af732..e3f1d1386a95 100644 --- a/sw/source/core/txtnode/txtatr2.cxx +++ b/sw/source/core/txtnode/txtatr2.cxx @@ -329,3 +329,13 @@ SwTxtMeta::~SwTxtMeta() } } +void SwTxtMeta::ChgTxtNode(SwTxtNode * const pNode) +{ + m_pTxtNode = pNode; // before Notify! + SwFmtMeta & rFmtMeta( static_cast(GetAttr()) ); + if (rFmtMeta.GetTxtAttr() == this) + { + rFmtMeta.NotifyChangeTxtNode(pNode); + } +} + -- cgit v1.2.3 From dd567990b4372498dfbe5063082c792f241ee41d Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:49 +0100 Subject: swunolocking1: #i105557#: fix locking for SwXMeta: move SwClient base to pImpl struct, and use UnoImplPtr to lock destructor. replace broken SwClient iteration with a WeakReference in sw::Meta. make constructor protected, and add factory function CreateXMeta. use new XUnoTunnel and XServiceInfo helpers. --- sw/inc/fmtmeta.hxx | 14 +- sw/source/core/inc/unometa.hxx | 193 +++++++++++++------------ sw/source/core/txtnode/fmtatr2.cxx | 31 +--- sw/source/core/unocore/unoportenum.cxx | 57 +++++--- sw/source/core/unocore/unorefmk.cxx | 251 ++++++++++++++++++++------------- 5 files changed, 311 insertions(+), 235 deletions(-) diff --git a/sw/inc/fmtmeta.hxx b/sw/inc/fmtmeta.hxx index 6d3f63ece477..792a7d8374db 100755 --- a/sw/inc/fmtmeta.hxx +++ b/sw/inc/fmtmeta.hxx @@ -31,6 +31,8 @@ #ifndef SW_FMTMETA_HXX #define SW_FMTMETA_HXX +#include + #include #include @@ -141,7 +143,10 @@ class Meta { protected: friend class ::SwFmtMeta; // SetFmtMeta, NotifyChangeTxtNode - friend class ::SwXMeta; // GetTxtNode, GetTxtAttr + friend class ::SwXMeta; // GetTxtNode, GetTxtAttr, Get/SetXMeta + + ::com::sun::star::uno::WeakReference< + ::com::sun::star::rdf::XMetadatable> m_wXMeta; SwFmtMeta * m_pFmt; @@ -153,6 +158,13 @@ protected: void NotifyChangeTxtNode(); + ::com::sun::star::uno::WeakReference< + ::com::sun::star::rdf::XMetadatable> const& GetXMeta() const + { return m_wXMeta; } + void SetXMeta(::com::sun::star::uno::Reference< + ::com::sun::star::rdf::XMetadatable> const& xMeta) + { m_wXMeta = xMeta; } + public: explicit Meta(SwFmtMeta * const i_pFmt = 0); virtual ~Meta(); diff --git a/sw/source/core/inc/unometa.hxx b/sw/source/core/inc/unometa.hxx index 1dc1985f7dfe..5568aa88b52e 100755 --- a/sw/source/core/inc/unometa.hxx +++ b/sw/source/core/inc/unometa.hxx @@ -31,19 +31,21 @@ #ifndef SW_UNOMETA_HXX #define SW_UNOMETA_HXX -#include "calbck.hxx" - -#include -#include -#include +#include #include #include +#include #include #include #include -#include +#include +#include + +#include + +#include typedef ::std::deque< @@ -52,42 +54,78 @@ typedef ::std::deque< class SwXTextRange; class SwPaM; -class SwTxtMeta; +class SwTxtNode; + namespace sw { class Meta; class MetaField; } -typedef -::cppu::ImplInheritanceHelper5 -< ::sfx2::MetadatableMixin -, ::com::sun::star::lang::XUnoTunnel -, ::com::sun::star::lang::XServiceInfo -, ::com::sun::star::text::XTextContent -, ::com::sun::star::text::XText -, ::com::sun::star::container::XEnumerationAccess -> SwXMetaBaseClass; +typedef ::cppu::ImplInheritanceHelper5 +< ::sfx2::MetadatableMixin +, ::com::sun::star::lang::XUnoTunnel +, ::com::sun::star::lang::XServiceInfo +, ::com::sun::star::container::XEnumerationAccess +, ::com::sun::star::text::XTextContent +, ::com::sun::star::text::XText +> SwXMeta_Base; class SwXMeta - : public SwXMetaBaseClass - , public SwClient + : public SwXMeta_Base , private ::boost::noncopyable { -private: - struct Impl; - ::std::auto_ptr m_pImpl; + +public: + + class Impl; protected: + + ::sw::UnoImplPtr m_pImpl; + + virtual void SAL_CALL AttachImpl( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > & xTextRange, + const USHORT nWhich) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + virtual ~SwXMeta(); -public: - SwXMeta(SwDoc *const pDoc, + /// @param pDoc and pMeta != 0, but not & because of ImplInheritanceHelper + SwXMeta(SwDoc *const pDoc, ::sw::Meta *const pMeta, ::com::sun::star::uno::Reference< ::com::sun::star::text::XText> const& xParentText, - TextRangeList_t * const pPortions, SwTxtMeta * const pHint); + TextRangeList_t const*const pPortions); + +public: + SwXMeta(SwDoc *const pDoc); - TYPEINFO(); + static ::com::sun::star::uno::Reference< + ::com::sun::star::rdf::XMetadatable > + CreateXMeta( + ::sw::Meta & rMeta, + ::com::sun::star::uno::Reference< ::com::sun::star::text::XText> + const& xParentText = 0, + ::std::auto_ptr pPortions = + ::std::auto_ptr(0)); + + /// init params with position of the attribute content (w/out CH_TXTATR) + bool SetContentRange( + SwTxtNode *& rpNode, xub_StrLen & rStart, xub_StrLen & rEnd) const; + ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > + GetParentText() const; + + bool CheckForOwnMemberMeta(const SwXTextRange* const pRange, + const SwPaM* const pPam, bool bAbsorb) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + + // MetadatableMixin + virtual ::sfx2::Metadatable * GetCoreObject(); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > + GetModel(); static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); @@ -118,6 +156,18 @@ public: ::com::sun::star::lang::XEventListener > & xListener) throw (::com::sun::star::uno::RuntimeException); + // XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements() + throw (::com::sun::star::uno::RuntimeException); + + // XEnumerationAccess + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::container::XEnumeration > SAL_CALL + createEnumeration() + throw (::com::sun::star::uno::RuntimeException); + // XTextContent virtual void SAL_CALL attach( const ::com::sun::star::uno::Reference< @@ -180,72 +230,37 @@ public: throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); - // XElementAccess - virtual ::com::sun::star::uno::Type SAL_CALL getElementType() - throw (::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL hasElements() - throw (::com::sun::star::uno::RuntimeException); - - // XEnumerationAccess - virtual ::com::sun::star::uno::Reference< - ::com::sun::star::container::XEnumeration > SAL_CALL - createEnumeration() - throw (::com::sun::star::uno::RuntimeException); - - // MetadatableMixin - virtual ::sfx2::Metadatable * GetCoreObject(); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > - GetModel(); - - // SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ); - - /// init params with position of the attribute content (w/out CH_TXTATR) - bool SetContentRange( - SwTxtNode *& rpNode, xub_StrLen & rStart, xub_StrLen & rEnd) const; - ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > - GetParentText() const; - - bool CheckForOwnMemberMeta(const SwXTextRange* const pRange, - const SwPaM* const pPam, bool bAbsorb) - throw (::com::sun::star::lang::IllegalArgumentException, - ::com::sun::star::uno::RuntimeException); - -protected: - virtual void SAL_CALL AttachImpl( - const ::com::sun::star::uno::Reference< - ::com::sun::star::text::XTextRange > & xTextRange, - const USHORT nWhich) - throw ( ::com::sun::star::lang::IllegalArgumentException, - ::com::sun::star::uno::RuntimeException ); - -private: - inline const ::sw::Meta * GetMeta() const; - }; -typedef -::cppu::ImplInheritanceHelper2 -< SwXMeta -, ::com::sun::star::beans::XPropertySet -, ::com::sun::star::text::XTextField -> SwXMetaFieldBaseClass; +typedef ::cppu::ImplInheritanceHelper2 +< SwXMeta +, ::com::sun::star::beans::XPropertySet +, ::com::sun::star::text::XTextField +> SwXMetaField_Base; class SwXMetaField - : public SwXMetaFieldBaseClass + : public SwXMetaField_Base { + private: + virtual ~SwXMetaField(); -private: - inline const ::sw::MetaField * GetMetaField() const; + friend ::com::sun::star::uno::Reference< + ::com::sun::star::rdf::XMetadatable > + SwXMeta::CreateXMeta(::sw::Meta &, + ::com::sun::star::uno::Reference< ::com::sun::star::text::XText> + const&, + ::std::auto_ptr pPortions); -public: - SwXMetaField(SwDoc *const pDoc, + SwXMetaField(SwDoc *const pDoc, ::sw::Meta *const pMeta, ::com::sun::star::uno::Reference< ::com::sun::star::text::XText> const& xParentText, - TextRangeList_t * const pPortions, SwTxtMeta * const pHint); + TextRangeList_t const*const pPortions); + +public: + SwXMetaField(SwDoc *const pDoc); // XServiceInfo @@ -270,16 +285,6 @@ public: ::com::sun::star::lang::XEventListener > & xListener) throw (::com::sun::star::uno::RuntimeException); - // XTextContent - virtual void SAL_CALL attach( - const ::com::sun::star::uno::Reference< - ::com::sun::star::text::XTextRange > & xTextRange) - throw ( ::com::sun::star::lang::IllegalArgumentException, - ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< - ::com::sun::star::text::XTextRange > SAL_CALL getAnchor() - throw (::com::sun::star::uno::RuntimeException); - // XPropertySet virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL @@ -327,6 +332,16 @@ public: ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + // XTextContent + virtual void SAL_CALL attach( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > & xTextRange) + throw ( ::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > SAL_CALL getAnchor() + throw (::com::sun::star::uno::RuntimeException); + // XTextField virtual rtl::OUString SAL_CALL getPresentation(sal_Bool bShowCommand) throw (::com::sun::star::uno::RuntimeException); diff --git a/sw/source/core/txtnode/fmtatr2.cxx b/sw/source/core/txtnode/fmtatr2.cxx index f7fe06d6b006..e76b7f8e4cb1 100644 --- a/sw/source/core/txtnode/fmtatr2.cxx +++ b/sw/source/core/txtnode/fmtatr2.cxx @@ -57,7 +57,6 @@ #include // for meta #include // for meta #include -#include #include #include // GetNumberFormat @@ -750,6 +749,10 @@ void Meta::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ) { NotifyChangeTxtNode(); SwModify::Modify(pOld, pNew); + if (pOld && (RES_REMOVE_UNO_OBJECT == pOld->Which())) + { // invalidate cached uno object + SetXMeta(uno::Reference(0)); + } } // sw::Metadatable @@ -788,31 +791,7 @@ bool Meta::IsInContent() const ::com::sun::star::uno::Reference< ::com::sun::star::rdf::XMetadatable > Meta::MakeUnoObject() { - // re-use existing SwXMeta - SwClientIter iter( *this ); - SwClient * pClient( iter.First( TYPE( SwXMeta ) ) ); - while (pClient) { - SwXMeta *const pMeta( dynamic_cast(pClient) ); - if (pMeta && pMeta->GetCoreObject() == this) { - return pMeta; - } - pClient = iter.Next(); - } - - // create new SwXMeta - SwTxtMeta * const pTxtAttr( GetTxtAttr() ); - OSL_ENSURE(pTxtAttr, "MakeUnoObject: no text attr?"); - if (!pTxtAttr) return 0; - SwTxtNode * const pTxtNode( pTxtAttr->GetTxtNode() ); - OSL_ENSURE(pTxtNode, "MakeUnoObject: no text node?"); - if (!pTxtNode) return 0; - const SwPosition aPos(*pTxtNode, *pTxtAttr->GetStart()); - const uno::Reference xParentText( - SwXTextRange::CreateParentXText(pTxtNode->GetDoc(), aPos) ); - if (!xParentText.is()) return 0; - return (RES_TXTATR_META == m_pFmt->Which()) - ? new SwXMeta (pTxtNode->GetDoc(), xParentText, 0, pTxtAttr) - : new SwXMetaField(pTxtNode->GetDoc(), xParentText, 0, pTxtAttr); + return SwXMeta::CreateXMeta(*this); } /************************************************************************* diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx index 8ce587ef8bc6..e7426091f745 100644 --- a/sw/source/core/unocore/unoportenum.cxx +++ b/sw/source/core/unocore/unoportenum.cxx @@ -54,6 +54,7 @@ #include #include #include +#include #include #include #include @@ -492,6 +493,33 @@ lcl_CreateTOXMarkPortion( return pPortion; } +//----------------------------------------------------------------------------- +static uno::Reference +lcl_CreateMetaPortion( + uno::Reference const& xParent, + const SwUnoCrsr * const pUnoCrsr, + SwTxtAttr & rAttr, ::std::auto_ptr & pPortions) +{ + const uno::Reference xMeta( SwXMeta::CreateXMeta( + *static_cast(rAttr.GetAttr()).GetMeta(), + xParent, pPortions)); + SwXTextPortion * pPortion(0); + if (RES_TXTATR_META == rAttr.Which()) + { + const uno::Reference xContent(xMeta, + uno::UNO_QUERY); + pPortion = new SwXTextPortion(pUnoCrsr, xParent, PORTION_META); + pPortion->SetMeta(xContent); + } + else + { + const uno::Reference xField(xMeta, uno::UNO_QUERY); + pPortion = new SwXTextPortion(pUnoCrsr, xParent, PORTION_FIELD); + pPortion->SetTextField(xField); + } + return pPortion; +} + //----------------------------------------------------------------------------- static void lcl_ExportBookmark( @@ -692,30 +720,13 @@ lcl_ExportHints( } else { - TextRangeList_t *const pCurrentPortions(Top.first); + ::std::auto_ptr + pCurrentPortions(Top.first); rPortionStack.pop(); - SwXTextPortion * pPortion; - if (RES_TXTATR_META == nWhich) - { - SwXMeta * const pMeta = - new SwXMeta(pDoc, xParent, - pCurrentPortions, - static_cast(pAttr)); - pPortion = new SwXTextPortion( - pUnoCrsr, xParent, PORTION_META); - pPortion->SetMeta(pMeta); - } - else - { - SwXMetaField * const pMeta = - new SwXMetaField(pDoc, xParent, - pCurrentPortions, - static_cast(pAttr)); - pPortion = new SwXTextPortion( - pUnoCrsr, xParent, PORTION_FIELD); - pPortion->SetTextField(pMeta); - } - rPortionStack.top().first->push_back(pPortion); + const uno::Reference xPortion( + lcl_CreateMetaPortion(xParent, pUnoCrsr, + *pAttr, pCurrentPortions)); + rPortionStack.top().first->push_back(xPortion); } } break; diff --git a/sw/source/core/unocore/unorefmk.cxx b/sw/source/core/unocore/unorefmk.cxx index 13b52a6b226b..8e1d18f1dae8 100644 --- a/sw/source/core/unocore/unorefmk.cxx +++ b/sw/source/core/unocore/unorefmk.cxx @@ -493,6 +493,8 @@ public: const uno::Reference< text::XTextRange > & xTextPosition) throw (uno::RuntimeException); + SwXMeta & GetXMeta() { return m_rMeta; } + }; SwXMetaText::SwXMetaText(SwDoc & rDoc, SwXMeta & rMeta) @@ -598,8 +600,12 @@ SwXMetaText::createTextCursorByRange( // this list is created by SwXTextPortionEnumeration // the Meta listens at the SwTxtNode and throws away the cache when it changes -struct SwXMeta::Impl +class SwXMeta::Impl + : public SwClient { + +public: + SwEventListenerContainer m_ListenerContainer; ::std::auto_ptr m_pTextPortions; // 3 possible states: not attached, attached, disposed @@ -608,37 +614,132 @@ struct SwXMeta::Impl uno::Reference m_xParentText; SwXMetaText m_Text; - Impl(SwXMeta & rThis, SwDoc & rDoc, + Impl( SwXMeta & rThis, SwDoc & rDoc, + ::sw::Meta * const pMeta, uno::Reference const& xParentText, - TextRangeList_t const * const pPortions, - SwTxtMeta const * const pHint) - : m_ListenerContainer( - static_cast< ::cppu::OWeakObject* >(&rThis)) + TextRangeList_t const * const pPortions) + : SwClient(pMeta) + , m_ListenerContainer(static_cast< ::cppu::OWeakObject* >(&rThis)) , m_pTextPortions( pPortions ) , m_bIsDisposed( false ) - , m_bIsDescriptor( 0 == pHint ) + , m_bIsDescriptor(0 == pMeta) , m_xParentText(xParentText) , m_Text(rDoc, rThis) { } -}; -TYPEINIT1(SwXMeta, SwClient); + inline const ::sw::Meta * GetMeta() const; + // only for SwXMetaField! + inline const ::sw::MetaField * GetMetaField() const; + + // SwClient + virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); -inline const ::sw::Meta * SwXMeta::GetMeta() const +}; + +inline const ::sw::Meta * SwXMeta::Impl::GetMeta() const { return static_cast< const ::sw::Meta * >(GetRegisteredIn()); } +// SwModify +void SwXMeta::Impl::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ) +{ + m_pTextPortions.reset(); // throw away cache (SwTxtNode changed) + + ClientModify(this, pOld, pNew); + + if (!GetRegisteredIn()) // removed => dispose + { + m_ListenerContainer.Disposing(); + m_bIsDisposed = true; + m_Text.Invalidate(); + } +} + uno::Reference SwXMeta::GetParentText() const { return m_pImpl->m_xParentText; } +SwXMeta::SwXMeta(SwDoc *const pDoc, ::sw::Meta *const pMeta, + uno::Reference const& xParentText, + TextRangeList_t const*const pPortions) + : m_pImpl( new SwXMeta::Impl(*this, *pDoc, pMeta, xParentText, pPortions) ) +{ +} + +SwXMeta::SwXMeta(SwDoc *const pDoc) + : m_pImpl( new SwXMeta::Impl(*this, *pDoc, 0, 0, 0) ) +{ +} + +SwXMeta::~SwXMeta() +{ +} + +uno::Reference +SwXMeta::CreateXMeta(::sw::Meta & rMeta, + uno::Reference const& i_xParent, + ::std::auto_ptr pPortions) +{ + // re-use existing SwXMeta + // #i105557#: do not iterate over the registered clients: race condition + uno::Reference xMeta(rMeta.GetXMeta()); + if (xMeta.is()) + { + if (pPortions.get()) // set cache in the XMeta to the given portions + { + const uno::Reference xUT(xMeta, uno::UNO_QUERY); + SwXMeta *const pXMeta( + ::sw::UnoTunnelGetImplementation(xUT)); + OSL_ENSURE(pXMeta, "no pXMeta?"); + // NB: the meta must always be created with the complete content + // if SwXTextPortionEnumeration is created for a selection, + // it must be checked that the Meta is contained in the selection! + pXMeta->m_pImpl->m_pTextPortions = pPortions; + // ??? is this necessary? + if (pXMeta->m_pImpl->m_xParentText.get() != i_xParent.get()) + { + OSL_ENSURE(false, "SwXMeta with different parent?"); + pXMeta->m_pImpl->m_xParentText.set(i_xParent); + } + } + return xMeta; + } + + // create new SwXMeta + SwTxtNode * const pTxtNode( rMeta.GetTxtNode() ); + OSL_ENSURE(pTxtNode, "CreateXMeta: no text node?"); + if (!pTxtNode) { return 0; } + uno::Reference xParentText(i_xParent); + if (!xParentText.is()) + { + SwTxtMeta * const pTxtAttr( rMeta.GetTxtAttr() ); + OSL_ENSURE(pTxtAttr, "CreateXMeta: no text attr?"); + if (!pTxtAttr) { return 0; } + const SwPosition aPos(*pTxtNode, *pTxtAttr->GetStart()); + xParentText.set( + SwXTextRange::CreateParentXText(pTxtNode->GetDoc(), aPos) ); + } + if (!xParentText.is()) { return 0; } + SwXMeta *const pXMeta( (RES_TXTATR_META == rMeta.GetFmtMeta()->Which()) + ? new SwXMeta (pTxtNode->GetDoc(), &rMeta, xParentText, + pPortions.release()) // temporarily un-auto_ptr :-( + : new SwXMetaField(pTxtNode->GetDoc(), &rMeta, xParentText, + pPortions.release())); + // this is why the constructor is private: need to acquire pXMeta here + xMeta.set(pXMeta); + // in order to initialize the weak pointer cache in the core object + rMeta.SetXMeta(xMeta); + return xMeta; +} + + bool SwXMeta::SetContentRange( SwTxtNode *& rpNode, xub_StrLen & rStart, xub_StrLen & rEnd ) const { - ::sw::Meta const * const pMeta( GetMeta() ); + ::sw::Meta const * const pMeta( m_pImpl->GetMeta() ); if (pMeta) { SwTxtMeta const * const pTxtAttr( pMeta->GetTxtAttr() ); @@ -657,23 +758,6 @@ bool SwXMeta::SetContentRange( return false; } -SwXMeta::SwXMeta(SwDoc *const pDoc, - uno::Reference const& xParentText, - TextRangeList_t * const pPortions, SwTxtMeta * const pHint) - : m_pImpl( new SwXMeta::Impl(*this, *pDoc, xParentText, pPortions, pHint) ) -{ - if (pHint) - { - ::sw::Meta * const pMeta( - static_cast(pHint->GetAttr()).GetMeta() ); - ASSERT(pMeta, "SwXMeta: no meta?") - if (pMeta) - { - pMeta->Add(this); - } - } -} - bool SwXMeta::CheckForOwnMemberMeta(const SwXTextRange* const pRange, const SwPaM* const pPam, bool bAbsorb) throw (lang::IllegalArgumentException, uno::RuntimeException) @@ -744,16 +828,6 @@ bool SwXMeta::CheckForOwnMemberMeta(const SwXTextRange* const pRange, return bForceExpandHints; } - -SwXMeta::SwXMeta(SwDoc *const pDoc) - : m_pImpl( new SwXMeta::Impl(*this, *pDoc, 0, 0, 0) ) -{ -} - -SwXMeta::~SwXMeta() -{ -} - const uno::Sequence< sal_Int8 > & SwXMeta::getUnoTunnelId() { static uno::Sequence< sal_Int8 > aSeq( ::CreateUnoTunnelId() ); @@ -765,14 +839,7 @@ sal_Int64 SAL_CALL SwXMeta::getSomething( const uno::Sequence< sal_Int8 > & i_rId ) throw (uno::RuntimeException) { - if ( i_rId.getLength() == 16 && - 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), - i_rId.getConstArray(), 16 ) ) - { - return sal::static_int_cast< sal_Int64 >( - reinterpret_cast< sal_IntPtr >(this) ); - } - return 0; + return ::sw::UnoTunnelImpl(i_rId, this); } // XServiceInfo @@ -782,21 +849,26 @@ SwXMeta::getImplementationName() throw (uno::RuntimeException) return C2U("SwXMeta"); } +static char const*const g_ServicesMeta[] = +{ + "com.sun.star.text.TextContent", + "com.sun.star.text.InContentMetadata", +}; +static const size_t g_nServicesMeta( + sizeof(g_ServicesMeta)/sizeof(g_ServicesMeta[0])); + sal_Bool SAL_CALL SwXMeta::supportsService(const ::rtl::OUString& rServiceName) throw (uno::RuntimeException) { - return rServiceName.equalsAscii("com.sun.star.text.TextContent") - || rServiceName.equalsAscii("com.sun.star.text.InContentMetadata"); + return ::sw::SupportsServiceImpl( + g_nServicesMeta, g_ServicesMeta, rServiceName); } uno::Sequence< ::rtl::OUString > SAL_CALL SwXMeta::getSupportedServiceNames() throw (uno::RuntimeException) { - uno::Sequence< ::rtl::OUString > aRet(2); - aRet[0] = C2U("com.sun.star.text.TextContent"); - aRet[1] = C2U("com.sun.star.text.InContentMetadata"); - return aRet; + return ::sw::GetSupportedServiceNamesImpl(g_nServicesMeta, g_ServicesMeta); } @@ -886,14 +958,10 @@ throw (lang::IllegalArgumentException, uno::RuntimeException) C2S("SwXMeta::attach(): argument is no XUnoTunnel"), static_cast< ::cppu::OWeakObject* >(this), 0); } - SwXTextRange * const pRange( - reinterpret_cast< SwXTextRange * >( - sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( - SwXTextRange::getUnoTunnelId() ))) ); - OTextCursorHelper * const pCursor( pRange ? 0 : - reinterpret_cast< OTextCursorHelper * >( - sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( - OTextCursorHelper::getUnoTunnelId() ))) ); + SwXTextRange *const pRange( + ::sw::UnoTunnelGetImplementation(xRangeTunnel)); + OTextCursorHelper *const pCursor( (pRange) ? 0 : + ::sw::UnoTunnelGetImplementation(xRangeTunnel)); if (!pRange && !pCursor) { throw lang::IllegalArgumentException( @@ -945,7 +1013,8 @@ throw (lang::IllegalArgumentException, uno::RuntimeException) static_cast< ::cppu::OWeakObject* >(this)); } - pMeta->Add(this); + pMeta->Add(m_pImpl.get()); + pMeta->SetXMeta(uno::Reference(this)); m_pImpl->m_xParentText = SwXTextRange::CreateParentXText(pDoc, *aPam.GetPoint()); @@ -1102,7 +1171,7 @@ SwXMeta::hasElements() throw (uno::RuntimeException) { vos::OGuard g(Application::GetSolarMutex()); - return GetRegisteredIn() ? sal_True : sal_False; + return m_pImpl->GetRegisteredIn() ? sal_True : sal_False; } // XEnumerationAccess @@ -1118,7 +1187,7 @@ SwXMeta::createEnumeration() throw (uno::RuntimeException) if (m_pImpl->m_bIsDescriptor) { throw uno::RuntimeException( - C2S("getAnchor(): not inserted"), + C2S("createEnumeration(): not inserted"), static_cast< ::cppu::OWeakObject* >(this)); } @@ -1147,12 +1216,12 @@ SwXMeta::createEnumeration() throw (uno::RuntimeException) // MetadatableMixin ::sfx2::Metadatable* SwXMeta::GetCoreObject() { - return const_cast< ::sw::Meta * >(GetMeta()); + return const_cast< ::sw::Meta * >(m_pImpl->GetMeta()); } uno::Reference SwXMeta::GetModel() { - ::sw::Meta const * const pMeta( GetMeta() ); + ::sw::Meta const * const pMeta( m_pImpl->GetMeta() ); if (pMeta) { SwTxtNode const * const pTxtNode( pMeta->GetTxtNode() ); @@ -1165,42 +1234,27 @@ uno::Reference SwXMeta::GetModel() return 0; } -// SwModify -void SwXMeta::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ) -{ - m_pImpl->m_pTextPortions.reset(); // throw away cache (SwTxtNode changed) - - ClientModify(this, pOld, pNew); - - if (!GetRegisteredIn()) // removed => dispose - { - m_pImpl->m_ListenerContainer.Disposing(); - m_pImpl->m_bIsDisposed = true; - m_pImpl->m_Text.Invalidate(); - } -} - /****************************************************************** * SwXMetaField ******************************************************************/ -inline const ::sw::MetaField * SwXMetaField::GetMetaField() const +inline const ::sw::MetaField * SwXMeta::Impl::GetMetaField() const { return static_cast< const ::sw::MetaField * >(GetRegisteredIn()); } -SwXMetaField::SwXMetaField(SwDoc *const pDoc, +SwXMetaField::SwXMetaField(SwDoc *const pDoc, ::sw::Meta *const pMeta, uno::Reference const& xParentText, - TextRangeList_t * const pPortions, SwTxtMeta * const pHint) - : SwXMetaFieldBaseClass(pDoc, xParentText, pPortions, pHint) + TextRangeList_t const*const pPortions) + : SwXMetaField_Base(pDoc, pMeta, xParentText, pPortions) { - ASSERT(!pHint || RES_TXTATR_METAFIELD == pHint->Which(), + ASSERT(pMeta && dynamic_cast< ::sw::MetaField* >(pMeta), "SwXMetaField created for wrong hint!"); } SwXMetaField::SwXMetaField(SwDoc *const pDoc) - : SwXMetaFieldBaseClass(pDoc) + : SwXMetaField_Base(pDoc) { } @@ -1215,23 +1269,28 @@ SwXMetaField::getImplementationName() throw (uno::RuntimeException) return C2U("SwXMetaField"); } +static char const*const g_ServicesMetaField[] = +{ + "com.sun.star.text.TextContent", + "com.sun.star.text.TextField", + "com.sun.star.text.textfield.MetadataField", +}; +static const size_t g_nServicesMetaField( + sizeof(g_ServicesMetaField)/sizeof(g_ServicesMetaField[0])); + sal_Bool SAL_CALL SwXMetaField::supportsService(const ::rtl::OUString& rServiceName) throw (uno::RuntimeException) { - return rServiceName.equalsAscii("com.sun.star.text.TextContent") - || rServiceName.equalsAscii("com.sun.star.text.TextField") - || rServiceName.equalsAscii("com.sun.star.text.textfield.MetadataField"); + return ::sw::SupportsServiceImpl( + g_nServicesMetaField, g_ServicesMetaField, rServiceName); } uno::Sequence< ::rtl::OUString > SAL_CALL SwXMetaField::getSupportedServiceNames() throw (uno::RuntimeException) { - uno::Sequence< ::rtl::OUString > aRet(3); - aRet[0] = C2U("com.sun.star.text.TextContent"); - aRet[1] = C2U("com.sun.star.text.TextField"); - aRet[2] = C2U("com.sun.star.text.textfield.MetadataField"); - return aRet; + return ::sw::GetSupportedServiceNamesImpl( + g_nServicesMetaField, g_ServicesMetaField); } // XComponent @@ -1293,7 +1352,7 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException, vos::OGuard g(Application::GetSolarMutex()); ::sw::MetaField * const pMeta( - const_cast< ::sw::MetaField * >(GetMetaField()) ); + const_cast< ::sw::MetaField * >(m_pImpl->GetMetaField()) ); if (!pMeta) throw lang::DisposedException(); @@ -1326,7 +1385,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, { vos::OGuard g(Application::GetSolarMutex()); - ::sw::MetaField const * const pMeta( GetMetaField() ); + ::sw::MetaField const * const pMeta( m_pImpl->GetMetaField() ); if (!pMeta) throw lang::DisposedException(); -- cgit v1.2.3 From faf50e31a983c1be11d74c1b574cd6c5f63d3a4e Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:49 +0100 Subject: swunolocking1: #i105557#: fix locking for SwXReferenceMark: add Impl struct, and use UnoImplPtr to lock destructor. move all implementation details out of header, into Impl struct. disable broken SwClient iteration. add factory function CreateXReferenceMark. use new XUnoTunnel and XServiceInfo helpers. clean up the implementation a little. --- sw/inc/unorefmark.hxx | 41 +-- sw/source/core/unocore/unoclbck.cxx | 16 +- sw/source/core/unocore/unocoll.cxx | 14 +- sw/source/core/unocore/unorefmk.cxx | 516 ++++++++++++++++++++++-------------- 4 files changed, 336 insertions(+), 251 deletions(-) diff --git a/sw/inc/unorefmark.hxx b/sw/inc/unorefmark.hxx index 8a37b5655e9e..61b6d09df06b 100644 --- a/sw/inc/unorefmark.hxx +++ b/sw/inc/unorefmark.hxx @@ -40,16 +40,12 @@ #include -#include - -#include -#include +#include class SwDoc; -class SwPaM; +class SwModify; class SwFmtRefMark; -class SwXTextCursor; /* -----------------27.08.98 15:11------------------- @@ -65,41 +61,24 @@ typedef ::cppu::WeakImplHelper5 class SwXReferenceMark : public SwXReferenceMark_Base - , public SwClient { private: - SwEventListenerContainer aLstnrCntnr; - SwDoc* pDoc; - const SwFmtRefMark* pMark; - String sMarkName; - BOOL m_bIsDescriptor; - - BOOL IsValid() const {return 0 != GetRegisteredIn();} - void InsertRefMark( SwPaM& rPam, SwXTextCursor * pCursor ); + class Impl; + ::sw::UnoImplPtr m_pImpl; virtual ~SwXReferenceMark(); public: - SwXReferenceMark(SwDoc * pDoc, const SwFmtRefMark * pMark); - - void attachToRange( - const ::com::sun::star::uno::Reference< - ::com::sun::star::text::XTextRange >& xTextRange) - throw (::com::sun::star::lang::IllegalArgumentException, - ::com::sun::star::uno::RuntimeException); - - const SwFmtRefMark* GetMark() const {return pMark;} - const String& GetMarkName() const {return sMarkName;} - SwDoc* GetDoc() const {return pDoc;} - void Invalidate(); - - TYPEINFO(); + SwXReferenceMark(SwDoc *const pDoc, const SwFmtRefMark *const pMark); - // SwClient - virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + static SwXReferenceMark * + CreateXReferenceMark(SwDoc & rDoc, SwFmtRefMark const& rMarkFmt); + /// may return 0 + static SwXReferenceMark * + GetReferenceMark(SwModify const& rUnoCB, SwFmtRefMark const& rMarkFmt); static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId(); diff --git a/sw/source/core/unocore/unoclbck.cxx b/sw/source/core/unocore/unoclbck.cxx index 9807a8f5b3fb..1d2185b381fb 100644 --- a/sw/source/core/unocore/unoclbck.cxx +++ b/sw/source/core/unocore/unoclbck.cxx @@ -64,21 +64,9 @@ SwUnoCallBack::~SwUnoCallBack() ---------------------------------------------------------------------------*/ SwXReferenceMark* SwUnoCallBack::GetRefMark(const SwFmtRefMark& rMark) { - SwClientIter aIter( *this ); - SwXReferenceMark* pxRefMark = (SwXReferenceMark*)aIter.First( TYPE( SwXReferenceMark )); - while(pxRefMark) - { - SwDoc* pDoc = pxRefMark->GetDoc(); - if(pDoc) - { - const SwFmtRefMark* pFmt = pDoc->GetRefMark(pxRefMark->GetMarkName()); - if(pFmt == &rMark) - return pxRefMark; - } - pxRefMark = (SwXReferenceMark*)aIter.Next( ); - } - return 0; + return SwXReferenceMark::GetReferenceMark(*this, rMark); } + /* -----------------------------05.09.00 12:38-------------------------------- ---------------------------------------------------------------------------*/ diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx index 557e73c17ac4..72606237ec70 100644 --- a/sw/source/core/unocore/unocoll.cxx +++ b/sw/source/core/unocore/unocoll.cxx @@ -1946,18 +1946,10 @@ sal_Bool SwXReferenceMarks::hasElements(void) throw( uno::RuntimeException ) SwXReferenceMark* SwXReferenceMarks::GetObject( SwDoc* pDoc, const SwFmtRefMark* pMark ) { vos::OGuard aGuard(Application::GetSolarMutex()); - SwClientIter aIter( *pDoc->GetUnoCallBack() ); - SwXReferenceMark* pxMark = (SwXReferenceMark*)aIter.First( TYPE( SwXReferenceMark )); - while(pxMark) - { - if(pxMark->GetMark() == pMark) - break; - pxMark = (SwXReferenceMark*)aIter.Next(); - } - if( !pxMark ) - pxMark = new SwXReferenceMark(pDoc, pMark); - return pxMark; + + return SwXReferenceMark::CreateXReferenceMark(*pDoc, *pMark); } + /****************************************************************** * ******************************************************************/ diff --git a/sw/source/core/unocore/unorefmk.cxx b/sw/source/core/unocore/unorefmk.cxx index 8e1d18f1dae8..39e93acd19dc 100644 --- a/sw/source/core/unocore/unorefmk.cxx +++ b/sw/source/core/unocore/unorefmk.cxx @@ -47,6 +47,7 @@ #include #include + using namespace ::com::sun::star; using ::rtl::OUString; @@ -54,81 +55,191 @@ using ::rtl::OUString; * SwXReferenceMark ******************************************************************/ -/* -----------------------------13.03.00 12:15-------------------------------- +class SwXReferenceMark::Impl + : public SwClient +{ + +public: + SwEventListenerContainer m_ListenerContainer; + bool m_bIsDescriptor; + SwDoc * m_pDoc; + const SwFmtRefMark * m_pMarkFmt; + ::rtl::OUString m_sMarkName; + + Impl( SwXReferenceMark & rThis, + SwDoc *const pDoc, SwFmtRefMark const*const pRefMark) + : SwClient((pDoc) ? pDoc->GetUnoCallBack() : 0) + , m_ListenerContainer(static_cast< ::cppu::OWeakObject* >(&rThis)) + , m_bIsDescriptor(0 == pRefMark) + , m_pDoc(pDoc) + , m_pMarkFmt(pRefMark) + { + if (pRefMark) + { + m_sMarkName = pRefMark->GetRefName(); + } + } + + bool IsValid() const { return 0 != GetRegisteredIn(); } + void InsertRefMark( SwPaM & rPam, SwXTextCursor const*const pCursor ); + void Invalidate(); + + // SwClient + virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + +}; + +/* -----------------------------07.01.00 12:51-------------------------------- ---------------------------------------------------------------------------*/ -const uno::Sequence< sal_Int8 > & SwXReferenceMark::getUnoTunnelId() +void SwXReferenceMark::Impl::Invalidate() { - static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId(); - return aSeq; + if (IsValid()) + { + const_cast(GetRegisteredIn())->Remove(this); + } + m_ListenerContainer.Disposing(); + m_pDoc = 0; + m_pMarkFmt = 0; } -/* -----------------------------10.03.00 18:04-------------------------------- - ---------------------------------------------------------------------------*/ -sal_Int64 SAL_CALL SwXReferenceMark::getSomething( const uno::Sequence< sal_Int8 >& rId ) - throw(uno::RuntimeException) +/*-- 11.12.98 10:28:37--------------------------------------------------- + + -----------------------------------------------------------------------*/ +void SwXReferenceMark::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew) +{ + ClientModify(this, pOld, pNew); + + if (!GetRegisteredIn()) // removed => dispose + { + Invalidate(); + } + else if (pOld) + { + switch (pOld->Which()) + { + case RES_REFMARK_DELETED: + if (static_cast(m_pMarkFmt) == + static_cast(pOld)->pObject) + { + Invalidate(); + } + break; + } + } +} + + +/*-- 11.12.98 10:28:32--------------------------------------------------- + + -----------------------------------------------------------------------*/ +SwXReferenceMark::SwXReferenceMark( + SwDoc *const pDoc, SwFmtRefMark const*const pRefMark) + : m_pImpl( new SwXReferenceMark::Impl(*this, pDoc, pRefMark) ) +{ +} + +/*-- 11.12.98 10:28:33--------------------------------------------------- + + -----------------------------------------------------------------------*/ +SwXReferenceMark::~SwXReferenceMark() +{ +} + +SwXReferenceMark * +SwXReferenceMark::GetReferenceMark( + SwModify const& /*rUnoCB*/, SwFmtRefMark const& /*rMarkFmt*/) { - if( rId.getLength() == 16 - && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), - rId.getConstArray(), 16 ) ) + // #i105557#: do not iterate over the registered clients: race condition + // to do this properly requires the SwXReferenceMark to register at the + // SwFmtRefMark directly, not at the unocallback +#if 0 + SwClientIter aIter( rUnoCB ); + SwXReferenceMark::Impl * pXMark = + static_cast( + aIter.First( TYPE( SwXReferenceMark::Impl ) )); + while (pXMark) { - return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(this) ); + if (pXMark->m_pMarkFmt == &rMarkFmt) + { + return &pXMark->m_rThis; + } + pXMark = static_cast(aIter.Next()); } +#endif return 0; } -/* -----------------------------06.04.00 16:41-------------------------------- + +SwXReferenceMark * +SwXReferenceMark::CreateXReferenceMark( + SwDoc & rDoc, SwFmtRefMark const& rMarkFmt) +{ + SwXReferenceMark *const pXMark( + GetReferenceMark(*rDoc.GetUnoCallBack(), rMarkFmt) ); + return (pXMark) + ? pXMark + : new SwXReferenceMark(&rDoc, &rMarkFmt); +} + +/* -----------------------------13.03.00 12:15-------------------------------- ---------------------------------------------------------------------------*/ -OUString SwXReferenceMark::getImplementationName(void) throw( uno::RuntimeException ) +const uno::Sequence< sal_Int8 > & SwXReferenceMark::getUnoTunnelId() { - return C2U("SwXReferenceMark"); + static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId(); + return aSeq; } -/* -----------------------------06.04.00 16:41-------------------------------- +/* -----------------------------10.03.00 18:04-------------------------------- ---------------------------------------------------------------------------*/ -BOOL SwXReferenceMark::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) +sal_Int64 SAL_CALL +SwXReferenceMark::getSomething(const uno::Sequence< sal_Int8 >& rId) +throw (uno::RuntimeException) { - return !rServiceName.compareToAscii("com.sun.star.text.ReferenceMark")|| - !rServiceName.compareToAscii("com.sun.star.text.TextContent"); + return ::sw::UnoTunnelImpl(rId, this); } /* -----------------------------06.04.00 16:41-------------------------------- ---------------------------------------------------------------------------*/ -uno::Sequence< OUString > SwXReferenceMark::getSupportedServiceNames(void) throw( uno::RuntimeException ) +OUString SAL_CALL SwXReferenceMark::getImplementationName() +throw (uno::RuntimeException) { - uno::Sequence< OUString > aRet(2); - OUString* pArray = aRet.getArray(); - pArray[0] = C2U("com.sun.star.text.ReferenceMark"); - pArray[1] = C2U("com.sun.star.text.TextContent"); - return aRet; + return C2U("SwXReferenceMark"); } -/*-- 11.12.98 10:28:32--------------------------------------------------- +/* -----------------------------06.04.00 16:41-------------------------------- - -----------------------------------------------------------------------*/ -TYPEINIT1(SwXReferenceMark, SwClient); + ---------------------------------------------------------------------------*/ +static char const*const g_ServicesReferenceMark[] = +{ + "com.sun.star.text.TextContent", + "com.sun.star.text.ReferenceMark", +}; +static const size_t g_nServicesReferenceMark( + sizeof(g_ServicesReferenceMark)/sizeof(g_ServicesReferenceMark[0])); -SwXReferenceMark::SwXReferenceMark(SwDoc* pDc, const SwFmtRefMark* pRefMark) : - aLstnrCntnr( (text::XTextContent*)this), - pDoc(pDc), - pMark(pRefMark), - m_bIsDescriptor(0 == pRefMark) +sal_Bool SAL_CALL +SwXReferenceMark::supportsService(const OUString& rServiceName) +throw (uno::RuntimeException) { - if(pRefMark) - sMarkName = pRefMark->GetRefName(); - if(pDoc) - pDoc->GetUnoCallBack()->Add(this); + return ::sw::SupportsServiceImpl( + g_nServicesReferenceMark, g_ServicesReferenceMark, rServiceName); } -/*-- 11.12.98 10:28:33--------------------------------------------------- +/* -----------------------------06.04.00 16:41-------------------------------- - -----------------------------------------------------------------------*/ -SwXReferenceMark::~SwXReferenceMark() + ---------------------------------------------------------------------------*/ +uno::Sequence< OUString > SAL_CALL +SwXReferenceMark::getSupportedServiceNames() +throw (uno::RuntimeException) { - + return ::sw::GetSupportedServiceNamesImpl( + g_nServicesReferenceMark, g_ServicesReferenceMark); } + /* -----------------03.11.99 14:14------------------- --------------------------------------------------*/ -void SwXReferenceMark::InsertRefMark(SwPaM& rPam, SwXTextCursor * pCursor) +void SwXReferenceMark::Impl::InsertRefMark(SwPaM& rPam, + SwXTextCursor const*const pCursor) { //! in some cases when this function is called the pDoc pointer member may have become //! invalid/deleted thus we obtain the document pointer from rPaM where it should always @@ -136,12 +247,8 @@ void SwXReferenceMark::InsertRefMark(SwPaM& rPam, SwXTextCursor * pCursor) SwDoc *pDoc2 = rPam.GetDoc(); UnoActionContext aCont(pDoc2); - SwTxtAttr* pTxtAttr = 0; - SwFmtRefMark aRefMark(sMarkName); -// SfxItemSet aSet(pDoc2->GetAttrPool(), RES_TXTATR_REFMARK, RES_TXTATR_REFMARK, 0L); -// aSet.Put(aRefMark); + SwFmtRefMark aRefMark(m_sMarkName); sal_Bool bMark = *rPam.GetPoint() != *rPam.GetMark(); -// SwXTextCursor::SetCrsrAttr(rPam, aSet, 0); const bool bForceExpandHints( (!bMark && pCursor) ? pCursor->IsAtEndOfMeta() : false ); @@ -153,290 +260,309 @@ void SwXReferenceMark::InsertRefMark(SwPaM& rPam, SwXTextCursor * pCursor) pDoc2->InsertPoolItem( rPam, aRefMark, nInsertFlags ); if( bMark && *rPam.GetPoint() > *rPam.GetMark()) - rPam.Exchange(); - - if( bMark ) - pTxtAttr = rPam.GetNode()->GetTxtNode()->GetTxtAttr( - rPam.GetPoint()->nContent, RES_TXTATR_REFMARK ); - else { - pTxtAttr = rPam.GetNode()->GetTxtNode()->GetTxtAttrForCharAt( - rPam.GetPoint()->nContent.GetIndex()-1, RES_TXTATR_REFMARK ); + rPam.Exchange(); } + SwTxtAttr *const pTxtAttr = (bMark) + ? rPam.GetNode()->GetTxtNode()->GetTxtAttr( + rPam.GetPoint()->nContent, RES_TXTATR_REFMARK) + : rPam.GetNode()->GetTxtNode()->GetTxtAttrForCharAt( + rPam.GetPoint()->nContent.GetIndex() - 1, RES_TXTATR_REFMARK); + if(pTxtAttr) - pMark = &pTxtAttr->GetRefMark(); + { + m_pMarkFmt = &pTxtAttr->GetRefMark(); + } pDoc2->GetUnoCallBack()->Add(this); } -/* -----------------18.02.99 13:33------------------- - * - * --------------------------------------------------*/ -void SwXReferenceMark::attachToRange(const uno::Reference< text::XTextRange > & xTextRange) - throw( lang::IllegalArgumentException, uno::RuntimeException ) +/*-- 11.12.98 10:28:34--------------------------------------------------- + + -----------------------------------------------------------------------*/ +void SAL_CALL +SwXReferenceMark::attach(const uno::Reference< text::XTextRange > & xTextRange) +throw (lang::IllegalArgumentException, uno::RuntimeException) { - if(!m_bIsDescriptor) + vos::OGuard aGuard(Application::GetSolarMutex()); + + if (!m_pImpl->m_bIsDescriptor) + { throw uno::RuntimeException(); + } uno::Reference xRangeTunnel( xTextRange, uno::UNO_QUERY); SwXTextRange* pRange = 0; OTextCursorHelper* pCursor = 0; if(xRangeTunnel.is()) { - pRange = reinterpret_cast< SwXTextRange * >( - sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( SwXTextRange::getUnoTunnelId()) )); - pCursor = reinterpret_cast< OTextCursorHelper * >( - sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( OTextCursorHelper::getUnoTunnelId()) )); + pRange = ::sw::UnoTunnelGetImplementation(xRangeTunnel); + pCursor = + ::sw::UnoTunnelGetImplementation(xRangeTunnel); } - SwDoc* pDocument = pRange ? (SwDoc*)pRange->GetDoc() : pCursor ? (SwDoc*)pCursor->GetDoc() : 0; - if(pDocument) + SwDoc *const pDocument = + (pRange) ? pRange->GetDoc() : ((pCursor) ? pCursor->GetDoc() : 0); + if (!pDocument) { - SwUnoInternalPaM aPam(*pDocument); - //das muss jetzt sal_True liefern - SwXTextRange::XTextRangeToSwPaM(aPam, xTextRange); - InsertRefMark(aPam, dynamic_cast(pCursor)); - m_bIsDescriptor = sal_False; - pDoc = pDocument; - pDoc->GetUnoCallBack()->Add(this); - } - else throw lang::IllegalArgumentException(); -} -/*-- 11.12.98 10:28:34--------------------------------------------------- + } - -----------------------------------------------------------------------*/ -void SwXReferenceMark::attach(const uno::Reference< text::XTextRange > & xTextRange) - throw( lang::IllegalArgumentException, uno::RuntimeException ) -{ - vos::OGuard aGuard(Application::GetSolarMutex()); - attachToRange( xTextRange ); + SwUnoInternalPaM aPam(*pDocument); + //das muss jetzt sal_True liefern + SwXTextRange::XTextRangeToSwPaM(aPam, xTextRange); + m_pImpl->InsertRefMark(aPam, dynamic_cast(pCursor)); + m_pImpl->m_bIsDescriptor = sal_False; + m_pImpl->m_pDoc = pDocument; + m_pImpl->m_pDoc->GetUnoCallBack()->Add(m_pImpl.get()); } + /*-- 11.12.98 10:28:34--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Reference< text::XTextRange > SwXReferenceMark::getAnchor(void) throw( uno::RuntimeException ) +uno::Reference< text::XTextRange > SAL_CALL +SwXReferenceMark::getAnchor() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - uno::Reference< text::XTextRange > xRet; - if(IsValid()) + + if (m_pImpl->IsValid()) { - const SwFmtRefMark* pNewMark = pDoc->GetRefMark(sMarkName); - if(pNewMark && pNewMark == pMark) + SwFmtRefMark const*const pNewMark = + m_pImpl->m_pDoc->GetRefMark(m_pImpl->m_sMarkName); + if (pNewMark && (pNewMark == m_pImpl->m_pMarkFmt)) { - const SwTxtRefMark* pTxtMark = pMark->GetTxtRefMark(); - if(pTxtMark && - &pTxtMark->GetTxtNode().GetNodes() == &pDoc->GetNodes()) + SwTxtRefMark const*const pTxtMark = + m_pImpl->m_pMarkFmt->GetTxtRefMark(); + if (pTxtMark && + (&pTxtMark->GetTxtNode().GetNodes() == + &m_pImpl->m_pDoc->GetNodes())) { - SwTxtNode& rTxtNode = (SwTxtNode&)pTxtMark->GetTxtNode(); - SwPaM* pPam = pTxtMark->GetEnd() ? - new SwPaM( rTxtNode, *pTxtMark->GetEnd(), - rTxtNode, *pTxtMark->GetStart()) : - new SwPaM( rTxtNode, *pTxtMark->GetStart()); - - - xRet = SwXTextRange::CreateTextRangeFromPosition(pDoc, - *pPam->Start(), pPam->End()); - delete pPam; + SwTxtNode const& rTxtNode = pTxtMark->GetTxtNode(); + const ::std::auto_ptr pPam( (pTxtMark->GetEnd()) + ? new SwPaM( rTxtNode, *pTxtMark->GetEnd(), + rTxtNode, *pTxtMark->GetStart()) + : new SwPaM( rTxtNode, *pTxtMark->GetStart()) ); + + return SwXTextRange::CreateTextRangeFromPosition( + m_pImpl->m_pDoc, *pPam->Start(), pPam->End()); } } } - return xRet; + return 0; } /*-- 11.12.98 10:28:35--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXReferenceMark::dispose(void) throw( uno::RuntimeException ) +void SAL_CALL SwXReferenceMark::dispose() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - if(IsValid()) + if (m_pImpl->IsValid()) { - const SwFmtRefMark* pNewMark = pDoc->GetRefMark(sMarkName); - if(pNewMark && pNewMark == pMark) + SwFmtRefMark const*const pNewMark = + m_pImpl->m_pDoc->GetRefMark(m_pImpl->m_sMarkName); + if (pNewMark && (pNewMark == m_pImpl->m_pMarkFmt)) { - const SwTxtRefMark* pTxtMark = pMark->GetTxtRefMark(); - if(pTxtMark && - &pTxtMark->GetTxtNode().GetNodes() == &pDoc->GetNodes()) + SwTxtRefMark const*const pTxtMark = + m_pImpl->m_pMarkFmt->GetTxtRefMark(); + if (pTxtMark && + (&pTxtMark->GetTxtNode().GetNodes() == + &m_pImpl->m_pDoc->GetNodes())) { - SwTxtNode& rTxtNode = (SwTxtNode&)pTxtMark->GetTxtNode(); + SwTxtNode const& rTxtNode = pTxtMark->GetTxtNode(); xub_StrLen nStt = *pTxtMark->GetStart(), nEnd = pTxtMark->GetEnd() ? *pTxtMark->GetEnd() : nStt + 1; SwPaM aPam( rTxtNode, nStt, rTxtNode, nEnd ); - pDoc->DeleteAndJoin( aPam ); + m_pImpl->m_pDoc->DeleteAndJoin( aPam ); } } } - else - throw uno::RuntimeException(); + else if (m_pImpl->m_bIsDescriptor) + { + m_pImpl->Invalidate(); + } } /*-- 11.12.98 10:28:35--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXReferenceMark::addEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException ) +void SAL_CALL SwXReferenceMark::addEventListener( + const uno::Reference< lang::XEventListener > & xListener) +throw (uno::RuntimeException) { - if(!GetRegisteredIn()) + vos::OGuard g(Application::GetSolarMutex()); + + if (!m_pImpl->IsValid()) + { throw uno::RuntimeException(); - aLstnrCntnr.AddListener(aListener); + } + m_pImpl->m_ListenerContainer.AddListener(xListener); } /*-- 11.12.98 10:28:35--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXReferenceMark::removeEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException ) +void SAL_CALL SwXReferenceMark::removeEventListener( + const uno::Reference< lang::XEventListener > & xListener) +throw (uno::RuntimeException) { - if(!GetRegisteredIn() || !aLstnrCntnr.RemoveListener(aListener)) + vos::OGuard g(Application::GetSolarMutex()); + + if (!m_pImpl->IsValid() || + !m_pImpl->m_ListenerContainer.RemoveListener(xListener)) + { throw uno::RuntimeException(); + } } /*-- 11.12.98 10:28:36--------------------------------------------------- -----------------------------------------------------------------------*/ -OUString SwXReferenceMark::getName(void) throw( uno::RuntimeException ) +OUString SAL_CALL SwXReferenceMark::getName() +throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - if(!IsValid() || !pDoc->GetRefMark(sMarkName)) + if (!m_pImpl->IsValid() || + !m_pImpl->m_pDoc->GetRefMark(m_pImpl->m_sMarkName)) { throw uno::RuntimeException(); } - return sMarkName; + return m_pImpl->m_sMarkName; } /*-- 11.12.98 10:28:36--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXReferenceMark::setName(const OUString& Name_) throw( uno::RuntimeException ) +void SAL_CALL SwXReferenceMark::setName(const OUString& rName) +throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - if(m_bIsDescriptor) - sMarkName = String(Name_); + if (m_pImpl->m_bIsDescriptor) + { + m_pImpl->m_sMarkName = rName; + } else { - String sNewName(Name_); - if(!IsValid() || !pDoc->GetRefMark(sMarkName) || pDoc->GetRefMark(sNewName)) + if (!m_pImpl->IsValid() + || !m_pImpl->m_pDoc->GetRefMark(m_pImpl->m_sMarkName) + || m_pImpl->m_pDoc->GetRefMark(rName)) { throw uno::RuntimeException(); } - const SwFmtRefMark* pCurMark = pDoc->GetRefMark(sMarkName); - if(sNewName != sMarkName && pCurMark && pCurMark == pMark) + SwFmtRefMark const*const pCurMark = + m_pImpl->m_pDoc->GetRefMark(m_pImpl->m_sMarkName); + if ((rName != m_pImpl->m_sMarkName) + && pCurMark && (pCurMark == m_pImpl->m_pMarkFmt)) { - UnoActionContext aCont(pDoc); - const SwTxtRefMark* pTxtMark = pMark->GetTxtRefMark(); - if(pTxtMark && - &pTxtMark->GetTxtNode().GetNodes() == &pDoc->GetNodes()) + const UnoActionContext aCont(m_pImpl->m_pDoc); + SwTxtRefMark const*const pTxtMark = + m_pImpl->m_pMarkFmt->GetTxtRefMark(); + if (pTxtMark && + (&pTxtMark->GetTxtNode().GetNodes() == + &m_pImpl->m_pDoc->GetNodes())) { - SwTxtNode& rTxtNode = (SwTxtNode&)pTxtMark->GetTxtNode(); + SwTxtNode const& rTxtNode = pTxtMark->GetTxtNode(); xub_StrLen nStt = *pTxtMark->GetStart(), nEnd = pTxtMark->GetEnd() ? *pTxtMark->GetEnd() : nStt + 1; SwPaM aPam( rTxtNode, nStt, rTxtNode, nEnd ); - pDoc->DeleteAndJoin( aPam ); //! deletes the pDoc member in the SwXReferenceMark - //! The aPam will keep the correct and functional doc though + // deletes the m_pImpl->m_pDoc member in the SwXReferenceMark! + m_pImpl->m_pDoc->DeleteAndJoin( aPam ); + // The aPam will keep the correct and functional doc though - sMarkName = sNewName; + m_pImpl->m_sMarkName = rName; //create a new one - InsertRefMark( aPam, 0 ); - pDoc = aPam.GetDoc(); + m_pImpl->InsertRefMark( aPam, 0 ); + m_pImpl->m_pDoc = aPam.GetDoc(); } } } } -/* -----------------------------07.01.00 12:51-------------------------------- - - ---------------------------------------------------------------------------*/ -void SwXReferenceMark::Invalidate() -{ - if(GetRegisteredIn()) - { - ((SwModify*)GetRegisteredIn())->Remove(this); - aLstnrCntnr.Disposing(); - pDoc = 0; - pMark = 0; - } -} -/*-- 11.12.98 10:28:37--------------------------------------------------- - - -----------------------------------------------------------------------*/ -void SwXReferenceMark::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) -{ - switch( pOld ? pOld->Which() : 0 ) - { - case RES_REMOVE_UNO_OBJECT: - case RES_OBJECTDYING: - if( (void*)GetRegisteredIn() == ((SwPtrMsgPoolItem *)pOld)->pObject ) - Invalidate(); - break; - case RES_FMT_CHG: - // wurden wir an das neue umgehaengt und wird das alte geloscht? - if( ((SwFmtChg*)pNew)->pChangedFmt == GetRegisteredIn() && - ((SwFmtChg*)pOld)->pChangedFmt->IsFmtInDTOR() ) - Invalidate(); - break; - case RES_REFMARK_DELETED: - if( (void*)pMark == ((SwPtrMsgPoolItem *)pOld)->pObject ) - Invalidate(); - break; - } -} /*-- 12.09.00 12:58:20--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Reference< beans::XPropertySetInfo > SwXReferenceMark::getPropertySetInfo( ) throw(uno::RuntimeException) +uno::Reference< beans::XPropertySetInfo > SAL_CALL +SwXReferenceMark::getPropertySetInfo() throw (uno::RuntimeException) { + vos::OGuard g(Application::GetSolarMutex()); + static uno::Reference< beans::XPropertySetInfo > xRef = - aSwMapProvider.GetPropertySet(PROPERTY_MAP_PARAGRAPH_EXTENSIONS)->getPropertySetInfo(); + aSwMapProvider.GetPropertySet(PROPERTY_MAP_PARAGRAPH_EXTENSIONS) + ->getPropertySetInfo(); return xRef; } /*-- 12.09.00 12:58:20--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXReferenceMark::setPropertyValue( +void SAL_CALL SwXReferenceMark::setPropertyValue( const OUString& /*rPropertyName*/, const uno::Any& /*rValue*/ ) - throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException) +throw (beans::UnknownPropertyException, beans::PropertyVetoException, + lang::IllegalArgumentException, lang::WrappedTargetException, + uno::RuntimeException) { throw lang::IllegalArgumentException(); } /*-- 12.09.00 12:58:20--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Any SwXReferenceMark::getPropertyValue( const OUString& rPropertyName ) - throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) +uno::Any SAL_CALL +SwXReferenceMark::getPropertyValue(const OUString& rPropertyName) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { + // does not seem to need SolarMutex uno::Any aRet; if(!SwXParagraph::getDefaultTextContentValue(aRet, rPropertyName)) + { throw beans::UnknownPropertyException(); + } return aRet; } /*-- 12.09.00 12:58:20--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXReferenceMark::addPropertyChangeListener( - const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/ ) - throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL SwXReferenceMark::addPropertyChangeListener( + const OUString& /*rPropertyName*/, + const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { + OSL_ENSURE(false, + "SwXReferenceMark::addPropertyChangeListener(): not implemented"); } /*-- 12.09.00 12:58:20--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXReferenceMark::removePropertyChangeListener( - const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/ ) - throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL SwXReferenceMark::removePropertyChangeListener( + const OUString& /*rPropertyName*/, + const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { + OSL_ENSURE(false, + "SwXReferenceMark::removePropertyChangeListener(): not implemented"); } /*-- 12.09.00 12:58:20--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXReferenceMark::addVetoableChangeListener( const OUString& /*rPropertyName*/, - const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/ ) - throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL SwXReferenceMark::addVetoableChangeListener( + const OUString& /*rPropertyName*/, + const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { + OSL_ENSURE(false, + "SwXReferenceMark::addVetoableChangeListener(): not implemented"); } /*-- 12.09.00 12:58:21--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXReferenceMark::removeVetoableChangeListener( - const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/ ) - throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL SwXReferenceMark::removeVetoableChangeListener( + const OUString& /*rPropertyName*/, + const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { + OSL_ENSURE(false, + "SwXReferenceMark::removeVetoableChangeListener(): not implemented"); } #include -- cgit v1.2.3 From 440e521dad8c97e939460af857c6a851b220c52e Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:50 +0100 Subject: swunolocking1: #i105557#: fix locking for SwXBookmark: add Impl struct, and use UnoImplPtr to lock destructor. move all implementation details out of header, into Impl struct. replace broken SwClient iteration with a WeakReference in sw::mark::MarkBase. make constructor protected, and add factory function CreateXBookmark. use new XUnoTunnel and XServiceInfo helpers. clean up the implementation a little. remove SwXBookmarks::GetObject(). --- sw/inc/unobookmark.hxx | 48 ++-- sw/inc/unocoll.hxx | 1 - sw/source/core/crsr/bookmrk.cxx | 30 +-- sw/source/core/inc/bookmrk.hxx | 24 +- sw/source/core/unocore/unobkm.cxx | 480 ++++++++++++++++++++++----------- sw/source/core/unocore/unocoll.cxx | 31 +-- sw/source/core/unocore/unoportenum.cxx | 15 +- sw/source/ui/uno/unotxvw.cxx | 17 +- 8 files changed, 399 insertions(+), 247 deletions(-) diff --git a/sw/inc/unobookmark.hxx b/sw/inc/unobookmark.hxx index 2b16d7828001..46d0054551b7 100644 --- a/sw/inc/unobookmark.hxx +++ b/sw/inc/unobookmark.hxx @@ -41,12 +41,10 @@ #include -#include #include +#include #include -#include -#include class SwDoc; @@ -63,33 +61,15 @@ typedef ::cppu::ImplInheritanceHelper5 class SwXBookmark : public SwXBookmark_Base - , private SwClient { private: - SwEventListenerContainer m_aLstnrCntnr; - SwDoc* m_pDoc; - String m_aName; - ::sw::mark::IMark* m_pRegisteredBookmark; - - void registerInMark(::sw::mark::IMark* const pBkmk); + class Impl; + ::sw::UnoImplPtr m_pImpl; protected: - virtual ~SwXBookmark(); - -public: - - SwXBookmark(::sw::mark::IMark* pMark = 0, SwDoc* pDoc = 0); - - const ::sw::mark::IMark* GetBookmark() const - { return m_pRegisteredBookmark; } - ::sw::mark::IMark* GetBookmark() - { return m_pRegisteredBookmark; } - SwDoc* GetDoc() - { return m_pDoc; } - void attachToRangeEx( const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange, @@ -102,10 +82,26 @@ public: throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - TYPEINFO(); + const ::sw::mark::IMark* GetBookmark() const; - // SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ); + virtual ~SwXBookmark(); + + /// @param pDoc and pMark != 0, but not & because of ImplInheritanceHelper + SwXBookmark(::sw::mark::IMark *const pMark, SwDoc *const pDoc); + +public: + + /// descriptor + SwXBookmark(); + + static ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextContent> + CreateXBookmark(SwDoc & rDoc, ::sw::mark::IMark & rBookmark); + + /// @return IMark for this, but only if it lives in pDoc + static ::sw::mark::IMark const* GetBookmarkInDoc(SwDoc const*const pDoc, + const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XUnoTunnel> & xUT); // MetadatableMixin virtual ::sfx2::Metadatable* GetCoreObject(); diff --git a/sw/inc/unocoll.hxx b/sw/inc/unocoll.hxx index b630668f8965..f4d54a55adca 100644 --- a/sw/inc/unocoll.hxx +++ b/sw/inc/unocoll.hxx @@ -481,7 +481,6 @@ class SwXBookmarks : public SwCollectionBaseClass, virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); - static SwXBookmark* GetObject( ::sw::mark::IMark& rBkm, SwDoc* pDoc); }; class SwXNumberingRulesCollection : public cppu::WeakImplHelper1 diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx index 1028c7b2b432..a9321324be3a 100644 --- a/sw/source/core/crsr/bookmrk.cxx +++ b/sw/source/core/crsr/bookmrk.cxx @@ -49,6 +49,7 @@ SV_IMPL_REF( SwServerObject ) using namespace ::sw::mark; +using namespace ::com::sun::star; namespace { @@ -147,6 +148,16 @@ namespace sw { namespace mark return aResult.append(nCount++).append(sUniquePostfix).makeStringAndClear(); } + // SwClient + void MarkBase::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew) + { + SwModify::Modify(pOld, pNew); + if (pOld && (RES_REMOVE_UNO_OBJECT == pOld->Which())) + { // invalidate cached uno object + SetXBookmark(uno::Reference(0)); + } + } + NavigatorReminder::NavigatorReminder(const SwPaM& rPaM) : MarkBase(rPaM, our_sNamePrefix) @@ -240,24 +251,13 @@ namespace sw { namespace mark return !pDoc->IsInHeaderFooter( SwNodeIndex(GetMarkPos().nNode) ); } - ::com::sun::star::uno::Reference< ::com::sun::star::rdf::XMetadatable > - Bookmark::MakeUnoObject() + uno::Reference< rdf::XMetadatable > Bookmark::MakeUnoObject() { - // re-use existing SwXBookmark - SwClientIter iter( *this ); - SwClient * pClient( iter.First( TYPE( SwXBookmark ) ) ); - while (pClient) { - SwXBookmark *const pBookmark( dynamic_cast(pClient) ); - if (pBookmark && pBookmark->GetCoreObject() == this) { - return pBookmark; - } - pClient = iter.Next(); - } - - // create new SwXBookmark SwDoc *const pDoc( GetMarkPos().GetDoc() ); OSL_ENSURE(pDoc, "Bookmark::MakeUnoObject: no doc?"); - return new SwXBookmark(this, pDoc); + const uno::Reference< rdf::XMetadatable> xMeta( + SwXBookmark::CreateXBookmark(*pDoc, *this), uno::UNO_QUERY); + return xMeta; } diff --git a/sw/source/core/inc/bookmrk.hxx b/sw/source/core/inc/bookmrk.hxx index 18f8860ecab9..313df12fddb7 100644 --- a/sw/source/core/inc/bookmrk.hxx +++ b/sw/source/core/inc/bookmrk.hxx @@ -31,12 +31,20 @@ #ifndef _BOOKMRK_HXX #define _BOOKMRK_HXX -#include +#include + #include #include #include +#include + + +namespace com { namespace sun { namespace star { + namespace text { class XTextContent; } +} } } + struct SwPosition; // fwd Decl. wg. UI class SwDoc; @@ -90,6 +98,17 @@ namespace sw { namespace mark {} virtual ~MarkBase(); + + // SwClient + virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew ); + + const ::com::sun::star::uno::WeakReference< + ::com::sun::star::text::XTextContent> & GetXBookmark() const + { return m_wXBookmark; } + void SetXBookmark(::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextContent> const& xBkmk) + { m_wXBookmark = xBkmk; } + protected: MarkBase(const SwPaM& rPaM, const ::rtl::OUString& rName); @@ -97,6 +116,9 @@ namespace sw { namespace mark ::boost::scoped_ptr m_pPos2; ::rtl::OUString m_aName; static ::rtl::OUString GenerateNewName(const ::rtl::OUString& rPrefix); + + ::com::sun::star::uno::WeakReference< + ::com::sun::star::text::XTextContent> m_wXBookmark; }; class NavigatorReminder diff --git a/sw/source/core/unocore/unobkm.cxx b/sw/source/core/unocore/unobkm.cxx index 282ae6b389a8..86b8b3ee8403 100644 --- a/sw/source/core/unocore/unobkm.cxx +++ b/sw/source/core/unocore/unobkm.cxx @@ -34,11 +34,13 @@ #include #include #include + #include #include #include #include #include +#include #include #include #include @@ -52,13 +54,8 @@ using namespace ::com::sun::star; -using namespace ::com::sun::star::lang; -using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::text; -using namespace ::com::sun::star::container; -using namespace ::com::sun::star::beans; using ::rtl::OUString; -using ::rtl::OUStringBuffer; + namespace { @@ -66,7 +63,7 @@ namespace { static const OUString sStart = OUString(String(SW_RES(STR_START_QUOTE))); static const OUString sEnd = OUString(String(SW_RES(STR_END_QUOTE))); - OUStringBuffer sBuf(64); + ::rtl::OUStringBuffer sBuf(64); return sBuf.append(sStart).append(rName).append(sEnd).makeStringAndClear(); } } @@ -74,184 +71,307 @@ namespace /****************************************************************** * SwXBookmark ******************************************************************/ -TYPEINIT1(SwXBookmark, SwClient) -void SwXBookmark::registerInMark(::sw::mark::IMark* const pBkmk) +class SwXBookmark::Impl + : public SwClient +{ + +public: + SwEventListenerContainer m_ListenerContainer; + SwDoc * m_pDoc; + ::sw::mark::IMark * m_pRegisteredBookmark; + ::rtl::OUString m_sMarkName; + + + Impl( SwXBookmark & rThis, + SwDoc *const pDoc, ::sw::mark::IMark *const /*pBookmark*/) + : SwClient() + , m_ListenerContainer(static_cast< ::cppu::OWeakObject* >(&rThis)) + , m_pDoc(pDoc) + , m_pRegisteredBookmark(0) + { + // DO NOT regiserInMark here! (because SetXBookmark would delete rThis) + } + + void registerInMark(SwXBookmark & rThis, ::sw::mark::IMark *const pBkmk); + + // SwClient + virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + +}; + +void SwXBookmark::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew) +{ + ClientModify(this, pOld, pNew); + if (!GetRegisteredIn()) + { + m_pRegisteredBookmark = NULL; + m_pDoc = NULL; + m_ListenerContainer.Disposing(); + } +} + +void SwXBookmark::Impl::registerInMark(SwXBookmark & rThis, + ::sw::mark::IMark *const pBkmk) { if (pBkmk) { pBkmk->Add(this); + ::sw::mark::MarkBase *const pMarkBase( + dynamic_cast< ::sw::mark::MarkBase * >(pBkmk)); + OSL_ENSURE(pMarkBase, "registerInMark: no MarkBase?"); + if (pMarkBase) + { + const uno::Reference xBookmark(& rThis); + pMarkBase->SetXBookmark(xBookmark); + } } else if (m_pRegisteredBookmark) { - m_aName = m_pRegisteredBookmark->GetName(); + m_sMarkName = m_pRegisteredBookmark->GetName(); m_pRegisteredBookmark->Remove(this); } m_pRegisteredBookmark = pBkmk; } -const uno::Sequence< sal_Int8 > & SwXBookmark::getUnoTunnelId() + +const ::sw::mark::IMark* SwXBookmark::GetBookmark() const { - static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId(); - return aSeq; + return m_pImpl->m_pRegisteredBookmark; } -sal_Int64 SAL_CALL SwXBookmark::getSomething( const uno::Sequence< sal_Int8 >& rId ) - throw(uno::RuntimeException) +SwXBookmark::SwXBookmark(::sw::mark::IMark *const pBkmk, SwDoc *const pDoc) + : m_pImpl( new SwXBookmark::Impl(*this, pDoc, pBkmk) ) { - if( rId.getLength() == 16 - && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) ) +} + +SwXBookmark::SwXBookmark() + : m_pImpl( new SwXBookmark::Impl(*this, 0, 0) ) +{ +} + +SwXBookmark::~SwXBookmark() +{ +} + +uno::Reference +SwXBookmark::CreateXBookmark(SwDoc & rDoc, ::sw::mark::IMark & rBookmark) +{ + // #i105557#: do not iterate over the registered clients: race condition + ::sw::mark::MarkBase *const pMarkBase( + dynamic_cast< ::sw::mark::MarkBase * >(&rBookmark)); + OSL_ENSURE(pMarkBase, "CreateXBookmark: no MarkBase?"); + if (!pMarkBase) { return 0; } + uno::Reference xBookmark(pMarkBase->GetXBookmark()); + if (!xBookmark.is()) { - return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(this) ); + // FIXME: These belong in XTextFieldsSupplier + //if (dynamic_cast< ::sw::mark::TextFieldmark* >(&rBkmk)) + // pXBkmk = new SwXFieldmark(false, &rBkmk, pDoc); + //else if (dynamic_cast< ::sw::mark::CheckboxFieldmark* >(&rBkmk)) + // pXBkmk = new SwXFieldmark(true, &rBkmk, pDoc); + //else + OSL_ENSURE( + dynamic_cast< ::sw::mark::IBookmark* >(&rBookmark), + "" + "SwXBookmark requested for non-bookmark mark."); + SwXBookmark *const pXBookmark = new SwXBookmark(&rBookmark, &rDoc); + xBookmark.set(pXBookmark); + pXBookmark->m_pImpl->registerInMark(*pXBookmark, pMarkBase); + } + return xBookmark; +} + +::sw::mark::IMark const* SwXBookmark::GetBookmarkInDoc(SwDoc const*const pDoc, + const uno::Reference< lang::XUnoTunnel> & xUT) +{ + SwXBookmark *const pXBkm( + ::sw::UnoTunnelGetImplementation(xUT)); + if (pXBkm && (pDoc == pXBkm->m_pImpl->m_pDoc)) + { + return pXBkm->m_pImpl->m_pRegisteredBookmark; } return 0; } -SwXBookmark::SwXBookmark(::sw::mark::IMark* pBkmk, SwDoc* pDoc) - : m_aLstnrCntnr((text::XTextContent*)this) - , m_pDoc(pDoc) - , m_pRegisteredBookmark(NULL) +const uno::Sequence< sal_Int8 > & SwXBookmark::getUnoTunnelId() { - registerInMark(pBkmk); + static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId(); + return aSeq; } -SwXBookmark::~SwXBookmark() -{ } +sal_Int64 SAL_CALL +SwXBookmark::getSomething(const uno::Sequence< sal_Int8 >& rId) +throw (uno::RuntimeException) +{ + return ::sw::UnoTunnelImpl(rId, this); +} void SwXBookmark::attachToRangeEx( const uno::Reference< text::XTextRange > & xTextRange, IDocumentMarkAccess::MarkType eType) - throw(lang::IllegalArgumentException, uno::RuntimeException) +throw (lang::IllegalArgumentException, uno::RuntimeException) { - if(m_pRegisteredBookmark) + if (m_pImpl->m_pRegisteredBookmark) + { throw uno::RuntimeException(); + } - uno::Reference xRangeTunnel( xTextRange, uno::UNO_QUERY); + const uno::Reference xRangeTunnel( + xTextRange, uno::UNO_QUERY); SwXTextRange* pRange = 0; OTextCursorHelper* pCursor = 0; if(xRangeTunnel.is()) { + pRange = ::sw::UnoTunnelGetImplementation(xRangeTunnel); + pCursor = + ::sw::UnoTunnelGetImplementation(xRangeTunnel); + } - pRange = reinterpret_cast< SwXTextRange * >( - sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( SwXTextRange::getUnoTunnelId() ))); - pCursor = reinterpret_cast< OTextCursorHelper * >( - sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( OTextCursorHelper::getUnoTunnelId() ))); + SwDoc *const pDoc = + (pRange) ? pRange->GetDoc() : ((pCursor) ? pCursor->GetDoc() : 0); + if (!pDoc) + { + throw lang::IllegalArgumentException(); } - SwDoc* pDc = pRange ? (SwDoc*)pRange->GetDoc() : pCursor ? - (SwDoc*)pCursor->GetDoc() : 0; - if(pDc) + m_pImpl->m_pDoc = pDoc; + SwUnoInternalPaM aPam(*m_pImpl->m_pDoc); + SwXTextRange::XTextRangeToSwPaM(aPam, xTextRange); + UnoActionContext aCont(m_pImpl->m_pDoc); + if (!m_pImpl->m_sMarkName.getLength()) { - m_pDoc = pDc; - SwUnoInternalPaM aPam(*m_pDoc); - SwXTextRange::XTextRangeToSwPaM(aPam, xTextRange); - UnoActionContext aCont(m_pDoc); - if(!m_aName.Len()) - m_aName = OUString::createFromAscii("Bookmark"); - if(eType == IDocumentMarkAccess::BOOKMARK && ::sw::mark::CrossRefNumItemBookmark::IsLegalName(m_aName)) - eType = IDocumentMarkAccess::CROSSREF_NUMITEM_BOOKMARK; - else if(eType == IDocumentMarkAccess::BOOKMARK && ::sw::mark::CrossRefHeadingBookmark::IsLegalName(m_aName)) - eType = IDocumentMarkAccess::CROSSREF_HEADING_BOOKMARK; - registerInMark(m_pDoc->getIDocumentMarkAccess()->makeMark(aPam, m_aName, eType)); - // --> OD 2007-10-23 #i81002# - // Check, if bookmark has been created. - // E.g., the creation of a cross-reference bookmark is suppress, - // if the PaM isn't a valid one for cross-reference bookmarks. - if(!m_pRegisteredBookmark) - { - OSL_ENSURE(false, - "" - " - could not create Mark."); - throw lang::IllegalArgumentException(); - } - // <-- + m_pImpl->m_sMarkName = OUString::createFromAscii("Bookmark"); } - else + if ((eType == IDocumentMarkAccess::BOOKMARK) && + ::sw::mark::CrossRefNumItemBookmark::IsLegalName(m_pImpl->m_sMarkName)) + { + eType = IDocumentMarkAccess::CROSSREF_NUMITEM_BOOKMARK; + } + else if ((eType == IDocumentMarkAccess::BOOKMARK) && + ::sw::mark::CrossRefHeadingBookmark::IsLegalName(m_pImpl->m_sMarkName)) + { + eType = IDocumentMarkAccess::CROSSREF_HEADING_BOOKMARK; + } + m_pImpl->registerInMark(*this, + m_pImpl->m_pDoc->getIDocumentMarkAccess()->makeMark( + aPam, m_pImpl->m_sMarkName, eType)); + // --> OD 2007-10-23 #i81002# + // Check, if bookmark has been created. + // E.g., the creation of a cross-reference bookmark is suppress, + // if the PaM isn't a valid one for cross-reference bookmarks. + if (!m_pImpl->m_pRegisteredBookmark) + { + OSL_ENSURE(false, + "" + " - could not create Mark."); throw lang::IllegalArgumentException(); + } + // <-- } -void SwXBookmark::attachToRange(const uno::Reference< text::XTextRange > & xTextRange) - throw( lang::IllegalArgumentException, uno::RuntimeException ) +void SwXBookmark::attachToRange( + const uno::Reference< text::XTextRange > & xTextRange) +throw (lang::IllegalArgumentException, uno::RuntimeException) { attachToRangeEx(xTextRange, IDocumentMarkAccess::BOOKMARK); } -void SwXBookmark::attach(const uno::Reference< text::XTextRange > & xTextRange) - throw( lang::IllegalArgumentException, uno::RuntimeException ) +void SAL_CALL +SwXBookmark::attach(const uno::Reference< text::XTextRange > & xTextRange) +throw (lang::IllegalArgumentException, uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); attachToRange( xTextRange ); } -uno::Reference< text::XTextRange > SwXBookmark::getAnchor(void) - throw( uno::RuntimeException ) +uno::Reference< text::XTextRange > SAL_CALL +SwXBookmark::getAnchor() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - uno::Reference< text::XTextRange > aRet; - if(m_pRegisteredBookmark) - aRet = SwXTextRange::CreateTextRangeFromPosition( - m_pDoc, - m_pRegisteredBookmark->GetMarkPos(), - m_pRegisteredBookmark->IsExpanded() ? &m_pRegisteredBookmark->GetOtherMarkPos() : NULL); - else + + if (!m_pImpl->m_pRegisteredBookmark) + { throw uno::RuntimeException(); - return aRet; + } + return SwXTextRange::CreateTextRangeFromPosition( + m_pImpl->m_pDoc, + m_pImpl->m_pRegisteredBookmark->GetMarkPos(), + (m_pImpl->m_pRegisteredBookmark->IsExpanded()) + ? &m_pImpl->m_pRegisteredBookmark->GetOtherMarkPos() : NULL); } -void SwXBookmark::dispose(void) - throw( uno::RuntimeException ) +void SAL_CALL SwXBookmark::dispose() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - if(m_pRegisteredBookmark) - GetDoc()->getIDocumentMarkAccess()->deleteMark(m_pRegisteredBookmark); - else - throw uno::RuntimeException(); + if (m_pImpl->m_pRegisteredBookmark) + { + m_pImpl->m_pDoc->getIDocumentMarkAccess()->deleteMark( + m_pImpl->m_pRegisteredBookmark); + } } -void SwXBookmark::addEventListener(const uno::Reference< lang::XEventListener > & aListener) - throw( uno::RuntimeException ) +void SAL_CALL SwXBookmark::addEventListener( + const uno::Reference< lang::XEventListener > & xListener) +throw (uno::RuntimeException) { - if(!m_pRegisteredBookmark) + vos::OGuard g(Application::GetSolarMutex()); + + if (!m_pImpl->m_pRegisteredBookmark) + { throw uno::RuntimeException(); - m_aLstnrCntnr.AddListener(aListener); + } + m_pImpl->m_ListenerContainer.AddListener(xListener); } -void SwXBookmark::removeEventListener(const uno::Reference< lang::XEventListener > & aListener) - throw( uno::RuntimeException ) +void SAL_CALL SwXBookmark::removeEventListener( + const uno::Reference< lang::XEventListener > & xListener) +throw (uno::RuntimeException) { - if(!m_pRegisteredBookmark || !m_aLstnrCntnr.RemoveListener(aListener)) + vos::OGuard g(Application::GetSolarMutex()); + + if (!m_pImpl->m_pRegisteredBookmark || + !m_pImpl->m_ListenerContainer.RemoveListener(xListener)) + { throw uno::RuntimeException(); + } } -OUString SwXBookmark::getName(void) - throw(uno::RuntimeException) +OUString SAL_CALL SwXBookmark::getName() +throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - OUString sRet; - if(m_pRegisteredBookmark) - sRet = m_pRegisteredBookmark->GetName(); - else - sRet = m_aName; - return sRet; + + return (m_pImpl->m_pRegisteredBookmark) + ? m_pImpl->m_pRegisteredBookmark->GetName() + : m_pImpl->m_sMarkName; } -void SwXBookmark::setName(const OUString& rName) - throw(uno::RuntimeException) +void SAL_CALL SwXBookmark::setName(const OUString& rName) +throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - if(!m_pRegisteredBookmark) - m_aName = rName; - if(!m_pRegisteredBookmark || getName() == rName) + + if (!m_pImpl->m_pRegisteredBookmark) + { + m_pImpl->m_sMarkName = rName; + } + if (!m_pImpl->m_pRegisteredBookmark || (getName() == rName)) + { return; - IDocumentMarkAccess* const pMarkAccess = m_pDoc->getIDocumentMarkAccess(); + } + IDocumentMarkAccess *const pMarkAccess = + m_pImpl->m_pDoc->getIDocumentMarkAccess(); if(pMarkAccess->findMark(rName) != pMarkAccess->getMarksEnd()) + { throw uno::RuntimeException(); + } - SwPaM aPam(m_pRegisteredBookmark->GetMarkPos()); - if(m_pRegisteredBookmark->IsExpanded()) + SwPaM aPam(m_pImpl->m_pRegisteredBookmark->GetMarkPos()); + if (m_pImpl->m_pRegisteredBookmark->IsExpanded()) { aPam.SetMark(); - *aPam.GetMark() = m_pRegisteredBookmark->GetOtherMarkPos(); + *aPam.GetMark() = m_pImpl->m_pRegisteredBookmark->GetOtherMarkPos(); } SwRewriter aRewriter; @@ -259,114 +379,145 @@ void SwXBookmark::setName(const OUString& rName) aRewriter.AddRule(UNDO_ARG2, SW_RES(STR_YIELDS)); aRewriter.AddRule(UNDO_ARG3, lcl_QuoteName(rName)); - m_pDoc->StartUndo(UNDO_BOOKMARK_RENAME, &aRewriter); - pMarkAccess->renameMark(m_pRegisteredBookmark, rName); - m_pDoc->EndUndo(UNDO_BOOKMARK_RENAME, NULL); + m_pImpl->m_pDoc->StartUndo(UNDO_BOOKMARK_RENAME, &aRewriter); + pMarkAccess->renameMark(m_pImpl->m_pRegisteredBookmark, rName); + m_pImpl->m_pDoc->EndUndo(UNDO_BOOKMARK_RENAME, NULL); } -OUString SwXBookmark::getImplementationName(void) throw( uno::RuntimeException ) +OUString SAL_CALL +SwXBookmark::getImplementationName() throw (uno::RuntimeException) { return OUString::createFromAscii("SwXBookmark"); } -sal_Bool SwXBookmark::supportsService(const OUString& rServiceName) - throw( uno::RuntimeException ) +static char const*const g_ServicesBookmark[] = { - return !rServiceName.compareToAscii("com.sun.star.text.Bookmark") || - !rServiceName.compareToAscii("com.sun.star.document.LinkTarget") || - !rServiceName.compareToAscii("com.sun.star.text.TextContent"); -} - -uno::Sequence< OUString > SwXBookmark::getSupportedServiceNames(void) - throw( uno::RuntimeException ) + "com.sun.star.text.TextContent", + "com.sun.star.text.Bookmark", + "com.sun.star.document.LinkTarget", +}; +static const size_t g_nServicesBookmark( + sizeof(g_ServicesBookmark)/sizeof(g_ServicesBookmark[0])); + +sal_Bool SAL_CALL SwXBookmark::supportsService(const OUString& rServiceName) +throw (uno::RuntimeException) { - uno::Sequence< OUString > aRet(3); - aRet[0] = OUString::createFromAscii("com.sun.star.text.Bookmark"); - aRet[1] = OUString::createFromAscii("com.sun.star.document.LinkTarget"); - aRet[2] = OUString::createFromAscii("com.sun.star.text.TextContent"); - return aRet; + return ::sw::SupportsServiceImpl( + g_nServicesBookmark, g_ServicesBookmark, rServiceName); } -void SwXBookmark::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew) +uno::Sequence< OUString > SAL_CALL +SwXBookmark::getSupportedServiceNames() throw (uno::RuntimeException) { - ClientModify(this, pOld, pNew); - if(!GetRegisteredIn()) - { - m_pRegisteredBookmark = NULL; - m_pDoc = NULL; - m_aLstnrCntnr.Disposing(); - } + return ::sw::GetSupportedServiceNamesImpl( + g_nServicesBookmark, g_ServicesBookmark); } // MetadatableMixin ::sfx2::Metadatable* SwXBookmark::GetCoreObject() { - return dynamic_cast< ::sfx2::Metadatable* >( GetBookmark() ); + return dynamic_cast< ::sfx2::Metadatable* >(m_pImpl->m_pRegisteredBookmark); } uno::Reference SwXBookmark::GetModel() { - if (GetDoc()) + if (m_pImpl->m_pDoc) { - SwDocShell const * const pShell( GetDoc()->GetDocShell() ); + SwDocShell const * const pShell( m_pImpl->m_pDoc->GetDocShell() ); return (pShell) ? pShell->GetModel() : 0; } return 0; } -uno::Reference< beans::XPropertySetInfo > SwXBookmark::getPropertySetInfo(void) - throw( uno::RuntimeException ) +uno::Reference< beans::XPropertySetInfo > SAL_CALL +SwXBookmark::getPropertySetInfo() throw (uno::RuntimeException) { - static uno::Reference< beans::XPropertySetInfo > aRef; - if(!aRef.is()) - { - aRef = aSwMapProvider.GetPropertySet(PROPERTY_MAP_BOOKMARK)->getPropertySetInfo(); - } - return aRef; + vos::OGuard g(Application::GetSolarMutex()); + + static uno::Reference< beans::XPropertySetInfo > xRef( + aSwMapProvider.GetPropertySet(PROPERTY_MAP_BOOKMARK) + ->getPropertySetInfo() ); + return xRef; } -void SwXBookmark::setPropertyValue(const OUString& PropertyName, const uno::Any& /*aValue*/) - throw( beans::UnknownPropertyException, - beans::PropertyVetoException, - lang::IllegalArgumentException, - lang::WrappedTargetException, - uno::RuntimeException ) +void SAL_CALL +SwXBookmark::setPropertyValue(const OUString& PropertyName, + const uno::Any& /*rValue*/) +throw (beans::UnknownPropertyException, beans::PropertyVetoException, + lang::IllegalArgumentException, lang::WrappedTargetException, + uno::RuntimeException) { // nothing to set here - throw IllegalArgumentException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only: " ) ) + PropertyName, static_cast < cppu::OWeakObject * > ( this ), 0 ); + throw lang::IllegalArgumentException( ::rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("Property is read-only: ")) + + PropertyName, static_cast< cppu::OWeakObject * >(this), 0 ); } -uno::Any SwXBookmark::getPropertyValue(const OUString& rPropertyName) - throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) +uno::Any SAL_CALL SwXBookmark::getPropertyValue(const OUString& rPropertyName) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { + vos::OGuard g(Application::GetSolarMutex()); + uno::Any aRet; if(!SwXParagraph::getDefaultTextContentValue(aRet, rPropertyName)) { if(rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_LINK_DISPLAY_NAME))) + { aRet <<= getName(); + } } return aRet; } -void SwXBookmark::addPropertyChangeListener(const OUString& /*PropertyName*/, - const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) - throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) -{ } +void SAL_CALL +SwXBookmark::addPropertyChangeListener( + const ::rtl::OUString& /*rPropertyName*/, + const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) +{ + OSL_ENSURE(false, + "SwXBookmark::addPropertyChangeListener(): not implemented"); +} -void SwXBookmark::removePropertyChangeListener(const OUString& /*PropertyName*/, - const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) - throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) -{ } +void SAL_CALL +SwXBookmark::removePropertyChangeListener( + const ::rtl::OUString& /*rPropertyName*/, + const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) +{ + OSL_ENSURE(false, + "SwXBookmark::removePropertyChangeListener(): not implemented"); +} -void SwXBookmark::addVetoableChangeListener(const OUString& /*PropertyName*/, - const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) - throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) -{ } +void SAL_CALL +SwXBookmark::addVetoableChangeListener( + const ::rtl::OUString& /*rPropertyName*/, + const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) +{ + OSL_ENSURE(false, + "SwXBookmark::addVetoableChangeListener(): not implemented"); +} -void SwXBookmark::removeVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) - throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) -{ } +void SAL_CALL +SwXBookmark::removeVetoableChangeListener( + const ::rtl::OUString& /*rPropertyName*/, + const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) +{ + OSL_ENSURE(false, + "SwXBookmark::removeVetoableChangeListener(): not implemented"); +} + +/****************************************************************** + * SwXFieldmark + ******************************************************************/ SwXFieldmark::SwXFieldmark(bool _isReplacementObject, ::sw::mark::IMark* pBkm, SwDoc* pDc) : SwXFieldmark_Base(pBkm, pDc) @@ -436,3 +587,4 @@ void SAL_CALL SwXFieldmark::setDescription( const ::rtl::OUString& description ) else throw uno::RuntimeException(); } + diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx index 72606237ec70..87f96ba72346 100644 --- a/sw/source/core/unocore/unocoll.cxx +++ b/sw/source/core/unocore/unocoll.cxx @@ -1529,8 +1529,9 @@ uno::Any SwXBookmarks::getByIndex(sal_Int32 nIndex) uno::Any aRet; ::sw::mark::IMark* pBkmk = pMarkAccess->getBookmarksBegin()[nIndex].get(); - uno::Reference< XTextContent > xRef = GetObject(*pBkmk, GetDoc()); - aRet.setValue(&xRef, ::getCppuType((uno::Reference*)0)); + const uno::Reference< text::XTextContent > xRef = + SwXBookmark::CreateXBookmark(*GetDoc(), *pBkmk); + aRet <<= xRef; return aRet; } @@ -1547,8 +1548,9 @@ uno::Any SwXBookmarks::getByName(const rtl::OUString& rName) throw NoSuchElementException(); uno::Any aRet; - uno::Reference< XTextContent > xRef = SwXBookmarks::GetObject(*(ppBkmk->get()), GetDoc()); - aRet.setValue(&xRef, ::getCppuType((uno::Reference*)0)); + const uno::Reference< text::XTextContent > xRef = + SwXBookmark::CreateXBookmark(*GetDoc(), *(ppBkmk->get())); + aRet <<= xRef; return aRet; } @@ -1594,27 +1596,6 @@ sal_Bool SwXBookmarks::hasElements(void) return GetDoc()->getIDocumentMarkAccess()->getBookmarksCount() != 0; } -SwXBookmark* SwXBookmarks::GetObject( ::sw::mark::IMark& rBkmk, SwDoc* pDoc) -{ - SwModify* const pModify = static_cast(&rBkmk); - SwXBookmark* pXBkmk = (SwXBookmark*)SwClientIter(*pModify).First(TYPE(SwXBookmark)); - if(!pXBkmk) - { - // FIXME: These belong in XTextFieldsSupplier - //if (dynamic_cast< ::sw::mark::TextFieldmark* >(&rBkmk)) - // pXBkmk = new SwXFieldmark(false, &rBkmk, pDoc); - //else if (dynamic_cast< ::sw::mark::CheckboxFieldmark* >(&rBkmk)) - // pXBkmk = new SwXFieldmark(true, &rBkmk, pDoc); - //else - OSL_ENSURE( - dynamic_cast< ::sw::mark::IBookmark* >(&rBkmk), - "" - "SwXBookmark requested for non-bookmark mark."); - pXBkmk = new SwXBookmark(&rBkmk, pDoc); - } - return pXBkmk; -} - /****************************************************************** * ******************************************************************/ diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx index e7426091f745..605554253bf8 100644 --- a/sw/source/core/unocore/unoportenum.cxx +++ b/sw/source/core/unocore/unoportenum.cxx @@ -100,8 +100,9 @@ namespace BYTE nBkmType; const SwPosition aPosition; - SwXBookmarkPortion_Impl( SwXBookmark* pXMark, BYTE nType, const SwPosition &rPosition ) - : xBookmark ( pXMark ) + SwXBookmarkPortion_Impl(uno::Reference const& xMark, + const BYTE nType, SwPosition const& rPosition) + : xBookmark ( xMark ) , nBkmType ( nType ) , aPosition ( rPosition ) { @@ -165,7 +166,9 @@ namespace { const BYTE nType = hasOther ? BKM_TYPE_START : BKM_TYPE_START_END; rBkmArr.insert(SwXBookmarkPortion_ImplSharedPtr( - new SwXBookmarkPortion_Impl ( SwXBookmarks::GetObject(*pBkmk, &rDoc ), nType, rStartPos))); + new SwXBookmarkPortion_Impl( + SwXBookmark::CreateXBookmark(rDoc, *pBkmk), + nType, rStartPos))); } const SwPosition& rEndPos = pBkmk->GetMarkEnd(); @@ -183,8 +186,12 @@ namespace pEndPos = pCrossRefEndPos.get(); } if(pEndPos) + { rBkmArr.insert(SwXBookmarkPortion_ImplSharedPtr( - new SwXBookmarkPortion_Impl ( SwXBookmarks::GetObject(*pBkmk, &rDoc ), BKM_TYPE_END, *pEndPos))); + new SwXBookmarkPortion_Impl( + SwXBookmark::CreateXBookmark(rDoc, *pBkmk), + BKM_TYPE_END, *pEndPos))); + } } } } diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx index 9da88953d481..35a4c5a2f92c 100644 --- a/sw/source/ui/uno/unotxvw.cxx +++ b/sw/source/ui/uno/unotxvw.cxx @@ -433,19 +433,14 @@ sal_Bool SwXTextView::select(const uno::Any& aInterface) throw( lang::IllegalArg if(xBkm.is() && xIfcTunnel.is()) { - SwXBookmark* pBkm = reinterpret_cast( - xIfcTunnel->getSomething(SwXBookmark::getUnoTunnelId())); - if(pBkm && pBkm->GetDoc() == pDoc) + ::sw::mark::IMark const*const pMark( + SwXBookmark::GetBookmarkInDoc(pDoc, xIfcTunnel) ); + if (pMark) { - IDocumentMarkAccess* const pMarkAccess = rSh.getIDocumentMarkAccess(); - IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->findMark(pBkm->getName()); - if( ppMark != pMarkAccess->getMarksEnd() ) - { - rSh.EnterStdMode(); - rSh.GotoMark( ppMark->get() ); - } - return sal_True; + rSh.EnterStdMode(); + rSh.GotoMark(pMark); } + return sal_True; } // IndexMark, Index, TextField, Draw, Section, Footnote, Paragraph // -- cgit v1.2.3 From ee9d6d30959b5467fb5f2407ce5aa24fe1043fc5 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:50 +0100 Subject: swunolocking1: #i105557#: fix locking for SwXParagraph: add Impl struct, and use UnoImplPtr to lock destructor. move all implementation details out of header, into Impl struct. make SwXParagraph instances reusable with a WeakReference in SwTxtNode. make constructor private, and add factory function CreateXParagraph. use new XUnoTunnel and XServiceInfo helpers. clean up the implementation a little. --- sw/inc/ndtxt.hxx | 20 +- sw/inc/unoparagraph.hxx | 75 +- sw/source/core/txtnode/ndtxt.cxx | 31 +- sw/source/core/unocore/unodraw.cxx | 4 +- sw/source/core/unocore/unoobj2.cxx | 16 +- sw/source/core/unocore/unoparagraph.cxx | 1163 +++++++++++++++++++------------ sw/source/core/unocore/unotext.cxx | 15 +- 7 files changed, 775 insertions(+), 549 deletions(-) diff --git a/sw/inc/ndtxt.hxx b/sw/inc/ndtxt.hxx index d4d59afa3d9c..04f1fad3e660 100644 --- a/sw/inc/ndtxt.hxx +++ b/sw/inc/ndtxt.hxx @@ -30,6 +30,8 @@ #ifndef _NDTXT_HXX #define _NDTXT_HXX +#include + #include "swdllapi.h" #include #include @@ -76,9 +78,12 @@ class SwScriptInfo; struct SwDocStat; struct SwParaIdleData_Impl; -namespace com { namespace sun { namespace star { namespace uno { - template < class > class Sequence; -}}}} +namespace com { namespace sun { namespace star { + namespace uno { + template < class > class Sequence; + } + namespace text { class XTextContent; } +} } } typedef std::set< xub_StrLen > SwSoftPageBreakList; @@ -132,6 +137,8 @@ class SW_DLLPUBLIC SwTxtNode: public SwCntntNode, public ::sfx2::Metadatable SwList* mpList; // <-- + ::com::sun::star::uno::WeakReference< + ::com::sun::star::text::XTextContent> m_wXParagraph; SW_DLLPRIVATE SwTxtNode( const SwNodeIndex &rWhere, SwTxtFmtColl *pTxtColl, const SfxItemSet* pAutoAttr = 0 ); @@ -813,6 +820,13 @@ public: USHORT GetScalingOfSelectedText( xub_StrLen nStt, xub_StrLen nEnd ) const; + SW_DLLPRIVATE ::com::sun::star::uno::WeakReference< + ::com::sun::star::text::XTextContent> const& GetXParagraph() const + { return m_wXParagraph; } + SW_DLLPRIVATE void SetXParagraph(::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextContent> const& xParagraph) + { m_wXParagraph = xParagraph; } + // sfx2::Metadatable virtual ::sfx2::IXmlIdRegistry& GetRegistry(); virtual bool IsInClipboard() const; diff --git a/sw/inc/unoparagraph.hxx b/sw/inc/unoparagraph.hxx index 984786b0d1fb..d5c5e2ed2832 100644 --- a/sw/inc/unoparagraph.hxx +++ b/sw/inc/unoparagraph.hxx @@ -48,12 +48,11 @@ #include #include -#include #include -class SfxItemPropertySet; struct SwPosition; +class SwPaM; class SwUnoCrsr; class SwStartNode; class SwTxtNode; @@ -80,73 +79,41 @@ typedef ::cppu::ImplInheritanceHelper10 class SwXParagraph : public SwXParagraph_Base - , public SwClient { private: - ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParentText; - SwEventListenerContainer aLstnrCntnr; - const SfxItemPropertySet* m_pPropSet; - ::rtl::OUString m_sText; - sal_Int32 nSelectionStartPos; - sal_Int32 nSelectionEndPos; - BOOL m_bIsDescriptor; - -protected: - - void SAL_CALL SetPropertyValues_Impl( - const ::com::sun::star::uno::Sequence< ::rtl::OUString >& - rPropertyNames, - const ::com::sun::star::uno::Sequence< - ::com::sun::star::uno::Any >& rValues) - throw (::com::sun::star::beans::UnknownPropertyException, - ::com::sun::star::beans::PropertyVetoException, - ::com::sun::star::lang::IllegalArgumentException, - ::com::sun::star::lang::WrappedTargetException, - ::com::sun::star::uno::RuntimeException); - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL - GetPropertyValues_Impl( - const ::com::sun::star::uno::Sequence< ::rtl::OUString >& - rPropertyNames) - throw (::com::sun::star::beans::UnknownPropertyException, - ::com::sun::star::lang::WrappedTargetException, - ::com::sun::star::uno::RuntimeException); - - ::com::sun::star::uno::Sequence< - ::com::sun::star::beans::GetDirectPropertyTolerantResult > SAL_CALL - GetPropertyValuesTolerant_Impl( - const ::com::sun::star::uno::Sequence< ::rtl::OUString >& - rPropertyNames, - sal_Bool bDirectValuesOnly) - throw (::com::sun::star::uno::RuntimeException); + class Impl; + ::sw::UnoImplPtr m_pImpl; virtual ~SwXParagraph(); + SwXParagraph(::com::sun::star::uno::Reference< + ::com::sun::star::text::XText > const & xParent, + SwTxtNode & rTxtNode, + const sal_Int32 nSelStart = -1, const sal_Int32 nSelEnd = - 1); + public: + /// descriptor SwXParagraph(); - SwXParagraph(::com::sun::star::uno::Reference< - ::com::sun::star::text::XText > const & i_xParent, - SwTxtNode * i_pTxtNode, - sal_Int32 nSelStart = -1, sal_Int32 nSelEnd = - 1); - BOOL IsDescriptor() const {return m_bIsDescriptor;} + static ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextContent> + CreateXParagraph(SwDoc & rDoc, SwTxtNode& rTxtNode, + ::com::sun::star::uno::Reference< ::com::sun::star::text::XText> + const& xParentText = 0, + const sal_Int32 nSelStart = -1, const sal_Int32 nSelEnd = - 1); const SwTxtNode * GetTxtNode() const; - SwTxtNode * GetTxtNode(); - - static BOOL getDefaultTextContentValue(::com::sun::star::uno::Any& rAny, - const ::rtl::OUString& rPropertyName, USHORT nWID = 0); - static SwXParagraph* GetImplementation( - ::com::sun::star::uno::Reference< - ::com::sun::star::uno::XInterface> xRef); + bool IsDescriptor() const; + /// make rPaM select the paragraph + bool SelectPaM(SwPaM & rPaM); + /// for SwXText void attachToText(SwXText & rParent, SwTxtNode & rTxtNode); - TYPEINFO(); - - // SwClient - virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + static bool getDefaultTextContentValue(::com::sun::star::uno::Any& rAny, + const ::rtl::OUString& rPropertyName, USHORT nWID = 0); // MetadatableMixin virtual ::sfx2::Metadatable* GetCoreObject(); diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 8e83c3cb9ded..acae6495e046 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -3623,6 +3623,12 @@ void SwTxtNode::Modify( SfxPoolItem* pOldValue, SfxPoolItem* pNewValue ) } m_bNotifiable = bWasNotifiable; + + if (pOldValue && (RES_REMOVE_UNO_OBJECT == pOldValue->Which())) + { // invalidate cached uno object + SetXParagraph(::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextContent>(0)); + } } SwFmtColl* SwTxtNode::ChgFmtColl( SwFmtColl *pNewColl ) @@ -4973,27 +4979,14 @@ bool SwTxtNode::IsInContent() const } #include -#include -::com::sun::star::uno::Reference< ::com::sun::star::rdf::XMetadatable > +using namespace ::com::sun::star; + +uno::Reference< rdf::XMetadatable > SwTxtNode::MakeUnoObject() { - // re-use existing SwXParagraph - SwClientIter iter( *this ); - SwClient * pClient( iter.First( TYPE( SwXParagraph ) ) ); - while (pClient) { - SwXParagraph *pPara( dynamic_cast(pClient) ); - if (pPara && pPara->GetCoreObject() == this ) { - return pPara; - } - pClient = iter.Next(); - } - - // create new SwXParagraph - SwPosition Pos( *this ); - ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParent( - SwXTextRange::CreateParentXText( GetDoc(), Pos ) ); - SwXParagraph * pXPara( new SwXParagraph( xParent, this ) ); - return pXPara; + const uno::Reference xMeta( + SwXParagraph::CreateXParagraph(*GetDoc(), *this), uno::UNO_QUERY); + return xMeta; } diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index b967f59f4899..9a2eb1dfae45 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -2158,7 +2158,9 @@ void SwXShape::attach(const uno::Reference< text::XTextRange > & xTextRange) pDoc = pPortion->GetCursor()->GetDoc(); } else if ( !pDoc && pParagraph && pParagraph->GetTxtNode( ) ) - pDoc = pParagraph->GetTxtNode( )->GetDoc( ); + { + pDoc = const_cast(pParagraph->GetTxtNode()->GetDoc()); + } } diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index a7f6119e5962..b5c2ea2a6993 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -1169,9 +1169,9 @@ uno::Reference< XTextContent > SAL_CALL SwXParagraphEnumeration::NextElement_Imp } else { - aRef = new SwXParagraph(static_cast(pText), - pStart->nNode.GetNode().GetTxtNode(), - nFirstContent, nLastContent); + aRef = SwXParagraph::CreateXParagraph(*pUnoCrsr->GetDoc(), + *pStart->nNode.GetNode().GetTxtNode(), + static_cast(pText), nFirstContent, nLastContent); } } } @@ -1528,15 +1528,7 @@ sal_Bool SwXTextRange::XTextRangeToSwPaM( SwUnoInternalPaM& rToFill, { if (pPara) { - const SwTxtNode * pTxtNode( pPara->GetTxtNode() ); - - if (pTxtNode) { - bRet = sal_True; - *rToFill.GetPoint() = SwPosition( *pTxtNode ); - // set selection to the whole paragraph - rToFill.SetMark(); - rToFill.GetMark()->nContent = pTxtNode->GetTxt().Len(); - } + bRet = pPara->SelectPaM(rToFill); } else { diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx index 22611e0b8e5b..404a93005a19 100644 --- a/sw/source/core/unocore/unoparagraph.cxx +++ b/sw/source/core/unocore/unoparagraph.cxx @@ -31,13 +31,13 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" +#include #include #include #include #include #include #include -#include #include #include #include @@ -60,6 +60,7 @@ #include #include + using namespace ::com::sun::star; using ::rtl::OUString; @@ -69,38 +70,38 @@ using ::rtl::OUString; ---------------------------------------------------------------------------*/ class SwParaSelection { - SwCursor* m_pCursor; + SwCursor & m_rCursor; public: - SwParaSelection(SwCursor* pPam); + SwParaSelection(SwCursor & rCursor); ~SwParaSelection(); }; -SwParaSelection::SwParaSelection(SwCursor* pCursor) - : m_pCursor(pCursor) +SwParaSelection::SwParaSelection(SwCursor & rCursor) + : m_rCursor(rCursor) { - if (m_pCursor->HasMark()) + if (m_rCursor.HasMark()) { - m_pCursor->DeleteMark(); + m_rCursor.DeleteMark(); } // is it at the start? - if (m_pCursor->GetPoint()->nContent != 0) + if (m_rCursor.GetPoint()->nContent != 0) { - m_pCursor->MovePara(fnParaCurr, fnParaStart); + m_rCursor.MovePara(fnParaCurr, fnParaStart); } // or at the end already? - if (m_pCursor->GetPoint()->nContent != m_pCursor->GetCntntNode()->Len()) + if (m_rCursor.GetPoint()->nContent != m_rCursor.GetCntntNode()->Len()) { - m_pCursor->SetMark(); - m_pCursor->MovePara(fnParaCurr, fnParaEnd); + m_rCursor.SetMark(); + m_rCursor.MovePara(fnParaCurr, fnParaEnd); } } SwParaSelection::~SwParaSelection() { - if (m_pCursor->GetPoint()->nContent != 0) + if (m_rCursor.GetPoint()->nContent != 0) { - m_pCursor->DeleteMark(); - m_pCursor->MovePara(fnParaCurr, fnParaStart); + m_rCursor.DeleteMark(); + m_rCursor.MovePara(fnParaCurr, fnParaStart); } } @@ -114,25 +115,184 @@ beans::PropertyState lcl_SwXParagraph_getPropertyState( const SwAttrSet** ppSet, const SfxItemPropertySimpleEntry& rEntry, sal_Bool &rAttrSetFetched ) - throw( beans::UnknownPropertyException); + throw (beans::UnknownPropertyException); /****************************************************************** * SwXParagraph ******************************************************************/ -TYPEINIT1(SwXParagraph, SwClient); +class SwXParagraph::Impl + : public SwClient +{ -/* -----------------------------11.07.00 12:10-------------------------------- +public: + SwXParagraph & m_rThis; + SwEventListenerContainer m_ListenerContainer; + SfxItemPropertySet const& m_rPropSet; + bool m_bIsDescriptor; + sal_Int32 m_nSelectionStartPos; + sal_Int32 m_nSelectionEndPos; + ::rtl::OUString m_sText; + uno::Reference m_xParentText; + + Impl( SwXParagraph & rThis, + SwTxtNode *const pTxtNode = 0, + uno::Reference< text::XText > const & xParent = 0, + const sal_Int32 nSelStart = -1, const sal_Int32 nSelEnd = -1) + : SwClient(pTxtNode) + , m_rThis(rThis) + , m_ListenerContainer(static_cast< ::cppu::OWeakObject* >(&rThis)) + , m_rPropSet(*aSwMapProvider.GetPropertySet(PROPERTY_MAP_PARAGRAPH)) + , m_bIsDescriptor(0 == pTxtNode) + , m_nSelectionStartPos(nSelStart) + , m_nSelectionEndPos(nSelEnd) + , m_xParentText(xParent) + { + } - ---------------------------------------------------------------------------*/ -SwXParagraph* SwXParagraph::GetImplementation(uno::Reference< XInterface> xRef ) + const SwTxtNode * GetTxtNode() const { + return static_cast(GetRegisteredIn()); + } + SwTxtNode * GetTxtNode() { + return static_cast(pRegisteredIn); + } + + SwTxtNode & GetTxtNodeOrThrow() { + SwTxtNode *const pTxtNode( GetTxtNode() ); + if (!pTxtNode) { + throw uno::RuntimeException(OUString(RTL_CONSTASCII_USTRINGPARAM( + "SwXParagraph: disposed or invalid")), 0); + } + return *pTxtNode; + } + + bool IsDescriptor() const { return m_bIsDescriptor; } + + void SetPropertyValues_Impl( + const uno::Sequence< ::rtl::OUString >& rPropertyNames, + const uno::Sequence< uno::Any >& rValues) + throw (beans::UnknownPropertyException, beans::PropertyVetoException, + lang::IllegalArgumentException, lang::WrappedTargetException, + uno::RuntimeException); + + uno::Sequence< uno::Any > + GetPropertyValues_Impl( + const uno::Sequence< ::rtl::OUString >& rPropertyNames) + throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException); + + uno::Sequence< beans::GetDirectPropertyTolerantResult > + GetPropertyValuesTolerant_Impl( + const uno::Sequence< ::rtl::OUString >& rPropertyNames, + bool bDirectValuesOnly) + throw (uno::RuntimeException); + + // SwClient + virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + +}; + +/*-- 11.12.98 08:12:58--------------------------------------------------- + + -----------------------------------------------------------------------*/ +void SwXParagraph::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew) +{ + ClientModify(this, pOld, pNew); + if (!GetRegisteredIn()) + { + m_ListenerContainer.Disposing(); + } +} + +/*-- 11.12.98 08:12:47--------------------------------------------------- + + -----------------------------------------------------------------------*/ +SwXParagraph::SwXParagraph() + : m_pImpl( new SwXParagraph::Impl(*this) ) +{ +} + +/*-- 11.12.98 08:12:47--------------------------------------------------- + + -----------------------------------------------------------------------*/ +SwXParagraph::SwXParagraph( + uno::Reference< text::XText > const & xParent, + SwTxtNode & rTxtNode, + const sal_Int32 nSelStart, const sal_Int32 nSelEnd) + : m_pImpl( + new SwXParagraph::Impl(*this, &rTxtNode, xParent, nSelStart, nSelEnd)) { - uno::Reference xParaTunnel( xRef, uno::UNO_QUERY); - if(xParaTunnel.is()) - return reinterpret_cast< SwXParagraph * >( - sal::static_int_cast< sal_IntPtr >( xParaTunnel->getSomething(SwXParagraph::getUnoTunnelId()) )); - return 0; } + +/*-- 11.12.98 08:12:48--------------------------------------------------- + + -----------------------------------------------------------------------*/ +SwXParagraph::~SwXParagraph() +{ +} + +const SwTxtNode * SwXParagraph::GetTxtNode() const +{ + return m_pImpl->GetTxtNode(); +} + +bool SwXParagraph::IsDescriptor() const +{ + return m_pImpl->IsDescriptor(); +} + +uno::Reference +SwXParagraph::CreateXParagraph(SwDoc & rDoc, SwTxtNode& rTxtNode, + uno::Reference< text::XText> const& i_xParent, + const sal_Int32 nSelStart, const sal_Int32 nSelEnd) +{ + // re-use existing SwXParagraph + // #i105557#: do not iterate over the registered clients: race condition + uno::Reference xParagraph; + if ((-1 == nSelStart) && (-1 == nSelEnd)) // only use cache if no selection! + { + xParagraph.set(rTxtNode.GetXParagraph()); + } + if (xParagraph.is()) + { + return xParagraph; + } + + // create new SwXParagraph + uno::Reference xParentText(i_xParent); + if (!xParentText.is()) + { + SwPosition Pos( rTxtNode ); + xParentText.set(SwXTextRange::CreateParentXText( &rDoc, Pos )); + } + SwXParagraph *const pXPara( + new SwXParagraph(xParentText, rTxtNode, nSelStart, nSelEnd) ); + // this is why the constructor is private: need to acquire pXPara here + xParagraph.set(pXPara); + // in order to initialize the weak pointer cache in the core object + if ((-1 == nSelStart) && (-1 == nSelEnd)) + { + rTxtNode.SetXParagraph(xParagraph); + } + return xParagraph; +} + +bool SwXParagraph::SelectPaM(SwPaM & rPaM) +{ + SwTxtNode const*const pTxtNode( GetTxtNode() ); + + if (!pTxtNode) + { + return false; + } + + *rPaM.GetPoint() = SwPosition( *pTxtNode ); + // set selection to the whole paragraph + rPaM.SetMark(); + rPaM.GetMark()->nContent = pTxtNode->GetTxt().Len(); + return true; +} + /* -----------------------------13.03.00 12:15-------------------------------- ---------------------------------------------------------------------------*/ @@ -144,191 +304,176 @@ const uno::Sequence< sal_Int8 > & SwXParagraph::getUnoTunnelId() /* -----------------------------10.03.00 18:04-------------------------------- ---------------------------------------------------------------------------*/ -sal_Int64 SAL_CALL SwXParagraph::getSomething( const uno::Sequence< sal_Int8 >& rId ) - throw(uno::RuntimeException) +sal_Int64 SAL_CALL +SwXParagraph::getSomething(const uno::Sequence< sal_Int8 >& rId) +throw (uno::RuntimeException) { - if( rId.getLength() == 16 - && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), - rId.getConstArray(), 16 ) ) - { - return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(this) ); - } - return 0; + return ::sw::UnoTunnelImpl(rId, this); } -/* -----------------------------06.04.00 16:37-------------------------------- - ---------------------------------------------------------------------------*/ -OUString SwXParagraph::getImplementationName(void) throw( uno::RuntimeException ) -{ - return C2U("SwXParagraph"); -} /* -----------------------------06.04.00 16:37-------------------------------- ---------------------------------------------------------------------------*/ -BOOL SwXParagraph::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) +OUString SAL_CALL +SwXParagraph::getImplementationName() throw (uno::RuntimeException) { - String sServiceName(rServiceName); - return sServiceName.EqualsAscii("com.sun.star.text.TextContent") || - sServiceName.EqualsAscii("com.sun.star.text.Paragraph") || - sServiceName.EqualsAscii("com.sun.star.style.CharacterProperties")|| - sServiceName.EqualsAscii("com.sun.star.style.CharacterPropertiesAsian")|| - sServiceName.EqualsAscii("com.sun.star.style.CharacterPropertiesComplex")|| - sServiceName.EqualsAscii("com.sun.star.style.ParagraphProperties") || - sServiceName.EqualsAscii("com.sun.star.style.ParagraphPropertiesAsian") || - sServiceName.EqualsAscii("com.sun.star.style.ParagraphPropertiesComplex"); + return C2U("SwXParagraph"); } /* -----------------------------06.04.00 16:37-------------------------------- ---------------------------------------------------------------------------*/ -uno::Sequence< OUString > SwXParagraph::getSupportedServiceNames(void) throw( uno::RuntimeException ) +static char const*const g_ServicesParagraph[] = { - uno::Sequence< OUString > aRet(8); - OUString* pArray = aRet.getArray(); - pArray[0] = C2U("com.sun.star.text.Paragraph"); - pArray[1] = C2U("com.sun.star.style.CharacterProperties"); - pArray[2] = C2U("com.sun.star.style.CharacterPropertiesAsian"); - pArray[3] = C2U("com.sun.star.style.CharacterPropertiesComplex"); - pArray[4] = C2U("com.sun.star.style.ParagraphProperties"); - pArray[5] = C2U("com.sun.star.style.ParagraphPropertiesAsian"); - pArray[6] = C2U("com.sun.star.style.ParagraphPropertiesComplex"); - pArray[7] = C2U("com.sun.star.text.TextContent"); - return aRet; -} -/*-- 11.12.98 08:12:47--------------------------------------------------- + "com.sun.star.text.TextContent", + "com.sun.star.text.Paragraph", + "com.sun.star.style.CharacterProperties", + "com.sun.star.style.CharacterPropertiesAsian", + "com.sun.star.style.CharacterPropertiesComplex", + "com.sun.star.style.ParagraphProperties", + "com.sun.star.style.ParagraphPropertiesAsian", + "com.sun.star.style.ParagraphPropertiesComplex", +}; +static const size_t g_nServicesParagraph( + sizeof(g_ServicesParagraph)/sizeof(g_ServicesParagraph[0])); - -----------------------------------------------------------------------*/ -SwXParagraph::SwXParagraph() : - xParentText(0), - aLstnrCntnr( (text::XTextRange*)this), - m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_PARAGRAPH)), - nSelectionStartPos(-1), - nSelectionEndPos(-1), - m_bIsDescriptor(TRUE) +sal_Bool SAL_CALL +SwXParagraph::supportsService(const OUString& rServiceName) +throw (uno::RuntimeException) { + return ::sw::SupportsServiceImpl( + g_nServicesParagraph, g_ServicesParagraph, rServiceName); } +/* -----------------------------06.04.00 16:37-------------------------------- -/*-- 11.12.98 08:12:47--------------------------------------------------- - - -----------------------------------------------------------------------*/ -SwXParagraph::SwXParagraph(uno::Reference< text::XText > const & i_xParent, SwTxtNode * i_pTxtNode, sal_Int32 nSelStart, sal_Int32 nSelEnd) : - SwClient(i_pTxtNode), - xParentText(i_xParent), - aLstnrCntnr( (text::XTextRange*)this), - m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_PARAGRAPH)), - nSelectionStartPos(nSelStart), - nSelectionEndPos(nSelEnd), - m_bIsDescriptor(FALSE) + ---------------------------------------------------------------------------*/ +uno::Sequence< OUString > SAL_CALL +SwXParagraph::getSupportedServiceNames() throw (uno::RuntimeException) { + return ::sw::GetSupportedServiceNamesImpl( + g_nServicesParagraph, g_ServicesParagraph); } -/*-- 11.12.98 08:12:48--------------------------------------------------- - -----------------------------------------------------------------------*/ -SwXParagraph::~SwXParagraph() -{ -} /* -----------------------------11.07.00 14:48-------------------------------- ---------------------------------------------------------------------------*/ void SwXParagraph::attachToText(SwXText & rParent, SwTxtNode & rTxtNode) { - DBG_ASSERT(m_bIsDescriptor, "Paragraph is not a descriptor"); - if(m_bIsDescriptor) + DBG_ASSERT(m_pImpl->m_bIsDescriptor, "Paragraph is not a descriptor"); + if (m_pImpl->m_bIsDescriptor) { - m_bIsDescriptor = FALSE; - rTxtNode.Add(this); - xParentText = &rParent; - if(m_sText.getLength()) + m_pImpl->m_bIsDescriptor = false; + rTxtNode.Add(m_pImpl.get()); + rTxtNode.SetXParagraph(uno::Reference(this)); + m_pImpl->m_xParentText = &rParent; + if (m_pImpl->m_sText.getLength()) { - try { setString(m_sText); } + try { setString(m_pImpl->m_sText); } catch(...){} - m_sText = OUString(); + m_pImpl->m_sText = OUString(); } } } + /*-- 11.12.98 08:12:49--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Reference< beans::XPropertySetInfo > SwXParagraph::getPropertySetInfo(void) - throw( uno::RuntimeException ) +uno::Reference< beans::XPropertySetInfo > SAL_CALL +SwXParagraph::getPropertySetInfo() +throw (uno::RuntimeException) { - static uno::Reference< beans::XPropertySetInfo > xRef = m_pPropSet->getPropertySetInfo(); + vos::OGuard g(Application::GetSolarMutex()); + + static uno::Reference< beans::XPropertySetInfo > xRef = + m_pImpl->m_rPropSet.getPropertySetInfo(); return xRef; } /*-- 11.12.98 08:12:49--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXParagraph::setPropertyValue(const OUString& rPropertyName, const uno::Any& aValue) - throw( beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, - lang::WrappedTargetException, uno::RuntimeException ) +void SAL_CALL +SwXParagraph::setPropertyValue(const OUString& rPropertyName, + const uno::Any& rValue) +throw (beans::UnknownPropertyException, beans::PropertyVetoException, + lang::IllegalArgumentException, lang::WrappedTargetException, + uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); uno::Sequence aPropertyNames(1); aPropertyNames.getArray()[0] = rPropertyName; uno::Sequence aValues(1); - aValues.getArray()[0] = aValue; - SetPropertyValues_Impl( aPropertyNames, aValues ); + aValues.getArray()[0] = rValue; + m_pImpl->SetPropertyValues_Impl( aPropertyNames, aValues ); } + /*-- 11.12.98 08:12:49--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Any SwXParagraph::getPropertyValue(const OUString& rPropertyName) - throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) +uno::Any +SwXParagraph::getPropertyValue(const OUString& rPropertyName) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); uno::Sequence aPropertyNames(1); aPropertyNames.getArray()[0] = rPropertyName; - uno::Sequence< uno::Any > aRet = GetPropertyValues_Impl(aPropertyNames ); + const uno::Sequence< uno::Any > aRet = + m_pImpl->GetPropertyValues_Impl(aPropertyNames); return aRet.getConstArray()[0]; } /* -----------------------------02.04.01 11:43-------------------------------- ---------------------------------------------------------------------------*/ -void SAL_CALL SwXParagraph::SetPropertyValues_Impl( +void SwXParagraph::Impl::SetPropertyValues_Impl( const uno::Sequence< OUString >& rPropertyNames, const uno::Sequence< uno::Any >& rValues ) - throw( beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, - lang::WrappedTargetException, uno::RuntimeException) +throw (beans::UnknownPropertyException, beans::PropertyVetoException, + lang::IllegalArgumentException, lang::WrappedTargetException, + uno::RuntimeException) { - if (GetTxtNode()) + SwTxtNode & rTxtNode(GetTxtNodeOrThrow()); + + SwPosition aPos( rTxtNode ); + SwCursor aCursor( aPos, 0, false ); + const OUString* pPropertyNames = rPropertyNames.getConstArray(); + const uno::Any* pValues = rValues.getConstArray(); + SfxItemPropertyMap const*const pMap = m_rPropSet.getPropertyMap(); + SwParaSelection aParaSel( aCursor ); + for (sal_Int32 nProp = 0; nProp < rPropertyNames.getLength(); nProp++) { - SwPosition aPos( *GetTxtNode() ); - SwCursor aCursor( aPos, 0, false ); - const OUString* pPropertyNames = rPropertyNames.getConstArray(); - const uno::Any* pValues = rValues.getConstArray(); - const SfxItemPropertyMap* pMap = m_pPropSet->getPropertyMap(); - SwParaSelection aParaSel( & aCursor ); - for(sal_Int32 nProp = 0; nProp < rPropertyNames.getLength(); nProp++) + SfxItemPropertySimpleEntry const*const pEntry = + pMap->getByName( pPropertyNames[nProp] ); + if (!pEntry) { - const SfxItemPropertySimpleEntry* pEntry = pMap->getByName( pPropertyNames[nProp] ); - if(!pEntry) - throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + pPropertyNames[nProp], static_cast < cppu::OWeakObject * > ( this ) ); - else - { - if ( pEntry->nFlags & beans::PropertyAttribute::READONLY) - throw beans::PropertyVetoException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only: " ) ) + pPropertyNames[nProp], static_cast < cppu::OWeakObject * > ( this ) ); - - SwXTextCursor::SetPropertyValue(aCursor, *m_pPropSet, - pPropertyNames[nProp], pValues[nProp]); - } + throw beans::UnknownPropertyException( + OUString(RTL_CONSTASCII_USTRINGPARAM("Unknown property: ")) + + pPropertyNames[nProp], + static_cast< cppu::OWeakObject * >(&m_rThis)); + } + if (pEntry->nFlags & beans::PropertyAttribute::READONLY) + { + throw beans::PropertyVetoException( + OUString(RTL_CONSTASCII_USTRINGPARAM("Property is read-only: ")) + + pPropertyNames[nProp], + static_cast< cppu::OWeakObject * >(&m_rThis)); } + SwXTextCursor::SetPropertyValue(aCursor, m_rPropSet, + pPropertyNames[nProp], pValues[nProp]); } - else - throw uno::RuntimeException(); } -void SwXParagraph::setPropertyValues( +void SAL_CALL SwXParagraph::setPropertyValues( const uno::Sequence< OUString >& rPropertyNames, const uno::Sequence< uno::Any >& rValues ) - throw(beans::PropertyVetoException, lang::IllegalArgumentException, - lang::WrappedTargetException, uno::RuntimeException) +throw (beans::PropertyVetoException, lang::IllegalArgumentException, + lang::WrappedTargetException, uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); // workaround for bad designed API try { - SetPropertyValues_Impl( rPropertyNames, rValues ); + m_pImpl->SetPropertyValues_Impl( rPropertyNames, rValues ); } catch (beans::UnknownPropertyException &rException) { @@ -339,53 +484,57 @@ void SwXParagraph::setPropertyValues( throw aWExc; } } + /* -----------------------------02.04.01 11:43-------------------------------- ---------------------------------------------------------------------------*/ -uno::Sequence< uno::Any > SAL_CALL SwXParagraph::GetPropertyValues_Impl( +uno::Sequence< uno::Any > SwXParagraph::Impl::GetPropertyValues_Impl( const uno::Sequence< OUString > & rPropertyNames ) - throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { + SwTxtNode & rTxtNode(GetTxtNodeOrThrow()); + uno::Sequence< uno::Any > aValues(rPropertyNames.getLength()); - const SwTxtNode * pTxtNode( GetTxtNode() ); - if (pTxtNode) + SwPosition aPos( rTxtNode ); + SwPaM aPam( aPos ); + uno::Any* pValues = aValues.getArray(); + const OUString* pPropertyNames = rPropertyNames.getConstArray(); + SfxItemPropertyMap const*const pMap = m_rPropSet.getPropertyMap(); + const SwAttrSet& rAttrSet( rTxtNode.GetSwAttrSet() ); + for (sal_Int32 nProp = 0; nProp < rPropertyNames.getLength(); nProp++) { - SwPosition aPos( *pTxtNode ); - SwPaM aPam( aPos ); - uno::Any* pValues = aValues.getArray(); - const OUString* pPropertyNames = rPropertyNames.getConstArray(); - const SfxItemPropertyMap* pMap = m_pPropSet->getPropertyMap(); - const SwAttrSet& rAttrSet( pTxtNode->GetSwAttrSet() ); - for(sal_Int32 nProp = 0; nProp < rPropertyNames.getLength(); nProp++) + SfxItemPropertySimpleEntry const*const pEntry = + pMap->getByName( pPropertyNames[nProp] ); + if (!pEntry) + { + throw beans::UnknownPropertyException( + OUString(RTL_CONSTASCII_USTRINGPARAM("Unknown property: ")) + + pPropertyNames[nProp], + static_cast< cppu::OWeakObject * >(&m_rThis)); + } + if (!SwXParagraph::getDefaultTextContentValue( + pValues[nProp], pPropertyNames[nProp], pEntry->nWID)) { - const SfxItemPropertySimpleEntry* pEntry = pMap->getByName( pPropertyNames[nProp] ); - if(pEntry) + beans::PropertyState eTemp; + const bool bDone = SwUnoCursorHelper::getCrsrPropertyValue( + *pEntry, aPam, &(pValues[nProp]), eTemp, &rTxtNode ); + if (!bDone) { - if(!SwXParagraph::getDefaultTextContentValue( - pValues[nProp], pPropertyNames[nProp], pEntry->nWID)) - { - BOOL bDone = FALSE; - beans::PropertyState eTemp; - bDone = SwUnoCursorHelper::getCrsrPropertyValue( - *pEntry, aPam, &(pValues[nProp]), eTemp, pTxtNode ); - if(!bDone) - m_pPropSet->getPropertyValue(*pEntry, rAttrSet, pValues[nProp]); - } + m_rPropSet.getPropertyValue( + *pEntry, rAttrSet, pValues[nProp]); } - else - throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + pPropertyNames[nProp], static_cast < cppu::OWeakObject * > ( this ) ); } } - else - throw uno::RuntimeException(); return aValues; } + /* -----------------------------04.11.03 11:43-------------------------------- ---------------------------------------------------------------------------*/ -uno::Sequence< uno::Any > SwXParagraph::getPropertyValues( - const uno::Sequence< OUString >& rPropertyNames ) - throw(uno::RuntimeException) +uno::Sequence< uno::Any > SAL_CALL +SwXParagraph::getPropertyValues(const uno::Sequence< OUString >& rPropertyNames) +throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); uno::Sequence< uno::Any > aValues; @@ -393,67 +542,82 @@ uno::Sequence< uno::Any > SwXParagraph::getPropertyValues( // workaround for bad designed API try { - aValues = GetPropertyValues_Impl( rPropertyNames ); + aValues = m_pImpl->GetPropertyValues_Impl( rPropertyNames ); } catch (beans::UnknownPropertyException &) { - throw uno::RuntimeException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property exception caught" ) ), static_cast < cppu::OWeakObject * > ( this ) ); + throw uno::RuntimeException(OUString(RTL_CONSTASCII_USTRINGPARAM( + "Unknown property exception caught")), + static_cast(this)); } catch (lang::WrappedTargetException &) { - throw uno::RuntimeException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "WrappedTargetException caught" ) ), static_cast < cppu::OWeakObject * > ( this ) ); + throw uno::RuntimeException(OUString(RTL_CONSTASCII_USTRINGPARAM( + "WrappedTargetException caught")), + static_cast(this)); } return aValues; } + /* -----------------------------02.04.01 11:43-------------------------------- ---------------------------------------------------------------------------*/ -void SwXParagraph::addPropertiesChangeListener( +void SAL_CALL SwXParagraph::addPropertiesChangeListener( const uno::Sequence< OUString >& /*aPropertyNames*/, const uno::Reference< beans::XPropertiesChangeListener >& /*xListener*/ ) - throw(uno::RuntimeException) -{} +throw (uno::RuntimeException) +{ + OSL_ENSURE(false, + "SwXParagraph::addPropertiesChangeListener(): not implemented"); +} /* -----------------------------02.04.01 11:43-------------------------------- ---------------------------------------------------------------------------*/ -void SwXParagraph::removePropertiesChangeListener( +void SAL_CALL SwXParagraph::removePropertiesChangeListener( const uno::Reference< beans::XPropertiesChangeListener >& /*xListener*/ ) - throw(uno::RuntimeException) -{} +throw (uno::RuntimeException) +{ + OSL_ENSURE(false, + "SwXParagraph::removePropertiesChangeListener(): not implemented"); +} /* -----------------------------02.04.01 11:43-------------------------------- ---------------------------------------------------------------------------*/ -void SwXParagraph::firePropertiesChangeEvent( +void SAL_CALL SwXParagraph::firePropertiesChangeEvent( const uno::Sequence< OUString >& /*aPropertyNames*/, const uno::Reference< beans::XPropertiesChangeListener >& /*xListener*/ ) throw(uno::RuntimeException) -{} +{ + OSL_ENSURE(false, + "SwXParagraph::firePropertiesChangeEvent(): not implemented"); +} /* -----------------------------25.09.03 11:09-------------------------------- ---------------------------------------------------------------------------*/ /* disabled for #i46921# */ -uno::Sequence< beans::SetPropertyTolerantFailed > SAL_CALL SwXParagraph::setPropertyValuesTolerant( +uno::Sequence< beans::SetPropertyTolerantFailed > SAL_CALL +SwXParagraph::setPropertyValuesTolerant( const uno::Sequence< OUString >& rPropertyNames, const uno::Sequence< uno::Any >& rValues ) - throw (lang::IllegalArgumentException, uno::RuntimeException) +throw (lang::IllegalArgumentException, uno::RuntimeException) { vos::OGuard aGuard( Application::GetSolarMutex() ); if (rPropertyNames.getLength() != rValues.getLength()) + { throw lang::IllegalArgumentException(); + } - const SwTxtNode * const pTxtNode( GetTxtNode() ); - if (!pTxtNode) - throw uno::RuntimeException(); + SwTxtNode & rTxtNode(m_pImpl->GetTxtNodeOrThrow()); //SwNode& rTxtNode = pUnoCrsr->GetPoint()->nNode.GetNode(); //const SwAttrSet& rAttrSet = ((SwTxtNode&)rTxtNode).GetSwAttrSet(); //USHORT nAttrCount = rAttrSet.Count(); - sal_Int32 nProps = rPropertyNames.getLength(); + const sal_Int32 nProps = rPropertyNames.getLength(); const OUString *pProp = rPropertyNames.getConstArray(); //sal_Int32 nVals = rValues.getLength(); @@ -464,31 +628,39 @@ uno::Sequence< beans::SetPropertyTolerantFailed > SAL_CALL SwXParagraph::setProp beans::SetPropertyTolerantFailed *pFailed = aFailed.getArray(); // get entry to start with - const SfxItemPropertyMap* pPropMap = m_pPropSet->getPropertyMap(); + SfxItemPropertyMap const*const pPropMap = + m_pImpl->m_rPropSet.getPropertyMap(); OUString sTmp; - SwPosition aPos( *pTxtNode ); + SwPosition aPos( rTxtNode ); SwCursor aCursor( aPos, 0, false ); - SwParaSelection aParaSel( & aCursor ); + SwParaSelection aParaSel( aCursor ); for (sal_Int32 i = 0; i < nProps; ++i) { try { pFailed[ nFailed ].Name = pProp[i]; - const SfxItemPropertySimpleEntry* pEntry = pPropMap->getByName( pProp[i] ); + SfxItemPropertySimpleEntry const*const pEntry = + pPropMap->getByName( pProp[i] ); if (!pEntry) - pFailed[ nFailed++ ].Result = beans::TolerantPropertySetResultType::UNKNOWN_PROPERTY; + { + pFailed[ nFailed++ ].Result = + beans::TolerantPropertySetResultType::UNKNOWN_PROPERTY; + } else { // set property value // (compare to SwXParagraph::setPropertyValues) if (pEntry->nFlags & beans::PropertyAttribute::READONLY) - pFailed[ nFailed++ ].Result = beans::TolerantPropertySetResultType::PROPERTY_VETO; + { + pFailed[ nFailed++ ].Result = + beans::TolerantPropertySetResultType::PROPERTY_VETO; + } else { SwXTextCursor::SetPropertyValue( - aCursor, *m_pPropSet, pProp[i], pValue[i] ); + aCursor, m_pImpl->m_rPropSet, pProp[i], pValue[i]); } } } @@ -496,19 +668,23 @@ uno::Sequence< beans::SetPropertyTolerantFailed > SAL_CALL SwXParagraph::setProp { // should not occur because property was searched for before DBG_ERROR( "unexpected exception catched" ); - pFailed[ nFailed++ ].Result = beans::TolerantPropertySetResultType::UNKNOWN_PROPERTY; + pFailed[ nFailed++ ].Result = + beans::TolerantPropertySetResultType::UNKNOWN_PROPERTY; } catch (lang::IllegalArgumentException &) { - pFailed[ nFailed++ ].Result = beans::TolerantPropertySetResultType::ILLEGAL_ARGUMENT; + pFailed[ nFailed++ ].Result = + beans::TolerantPropertySetResultType::ILLEGAL_ARGUMENT; } catch (beans::PropertyVetoException &) { - pFailed[ nFailed++ ].Result = beans::TolerantPropertySetResultType::PROPERTY_VETO; + pFailed[ nFailed++ ].Result = + beans::TolerantPropertySetResultType::PROPERTY_VETO; } catch (lang::WrappedTargetException &) { - pFailed[ nFailed++ ].Result = beans::TolerantPropertySetResultType::WRAPPED_TARGET; + pFailed[ nFailed++ ].Result = + beans::TolerantPropertySetResultType::WRAPPED_TARGET; } } @@ -517,52 +693,56 @@ uno::Sequence< beans::SetPropertyTolerantFailed > SAL_CALL SwXParagraph::setProp } -uno::Sequence< beans::GetPropertyTolerantResult > SAL_CALL SwXParagraph::getPropertyValuesTolerant( +uno::Sequence< beans::GetPropertyTolerantResult > SAL_CALL +SwXParagraph::getPropertyValuesTolerant( const uno::Sequence< OUString >& rPropertyNames ) - throw (uno::RuntimeException) +throw (uno::RuntimeException) { vos::OGuard aGuard( Application::GetSolarMutex() ); uno::Sequence< beans::GetDirectPropertyTolerantResult > aTmpRes( - GetPropertyValuesTolerant_Impl( rPropertyNames, sal_False ) ); - const beans::GetDirectPropertyTolerantResult *pTmpRes = aTmpRes.getConstArray(); + m_pImpl->GetPropertyValuesTolerant_Impl( rPropertyNames, false ) ); + const beans::GetDirectPropertyTolerantResult *pTmpRes = + aTmpRes.getConstArray(); // copy temporary result to final result type - sal_Int32 nLen = aTmpRes.getLength(); + const sal_Int32 nLen = aTmpRes.getLength(); uno::Sequence< beans::GetPropertyTolerantResult > aRes( nLen ); beans::GetPropertyTolerantResult *pRes = aRes.getArray(); for (sal_Int32 i = 0; i < nLen; i++) + { *pRes++ = *pTmpRes++; + } return aRes; } -uno::Sequence< beans::GetDirectPropertyTolerantResult > SAL_CALL SwXParagraph::getDirectPropertyValuesTolerant( +uno::Sequence< beans::GetDirectPropertyTolerantResult > SAL_CALL +SwXParagraph::getDirectPropertyValuesTolerant( const uno::Sequence< OUString >& rPropertyNames ) - throw (uno::RuntimeException) +throw (uno::RuntimeException) { vos::OGuard aGuard( Application::GetSolarMutex() ); - return GetPropertyValuesTolerant_Impl( rPropertyNames, sal_True ); + + return m_pImpl->GetPropertyValuesTolerant_Impl( rPropertyNames, true ); } -uno::Sequence< beans::GetDirectPropertyTolerantResult > SAL_CALL SwXParagraph::GetPropertyValuesTolerant_Impl( +uno::Sequence< beans::GetDirectPropertyTolerantResult > +SwXParagraph::Impl::GetPropertyValuesTolerant_Impl( const uno::Sequence< OUString >& rPropertyNames, - sal_Bool bDirectValuesOnly ) - throw (uno::RuntimeException) + bool bDirectValuesOnly ) +throw (uno::RuntimeException) { vos::OGuard aGuard( Application::GetSolarMutex() ); - const SwTxtNode * const pTxtNode( GetTxtNode() ); - DBG_ASSERT( pTxtNode != NULL, "need text node" ); - if (!pTxtNode) - throw uno::RuntimeException(); + SwTxtNode & rTxtNode(GetTxtNodeOrThrow()); // #i46786# Use SwAttrSet pointer for determining the state. // Use the value SwAttrSet (from the paragraph OR the style) // for determining the actual value(s). - const SwAttrSet* pAttrSet = pTxtNode->GetpSwAttrSet(); - const SwAttrSet& rValueAttrSet = pTxtNode->GetSwAttrSet(); + const SwAttrSet* pAttrSet = rTxtNode.GetpSwAttrSet(); + const SwAttrSet& rValueAttrSet = rTxtNode.GetSwAttrSet(); sal_Int32 nProps = rPropertyNames.getLength(); const OUString *pProp = rPropertyNames.getConstArray(); @@ -572,7 +752,7 @@ uno::Sequence< beans::GetDirectPropertyTolerantResult > SAL_CALL SwXParagraph::G sal_Int32 nIdx = 0; // get entry to start with - const SfxItemPropertyMap *pPropMap = m_pPropSet->getPropertyMap(); + SfxItemPropertyMap const*const pPropMap = m_rPropSet.getPropertyMap(); for (sal_Int32 i = 0; i < nProps; ++i) { @@ -583,23 +763,28 @@ uno::Sequence< beans::GetDirectPropertyTolerantResult > SAL_CALL SwXParagraph::G { rResult.Name = pProp[i]; - const SfxItemPropertySimpleEntry* pEntry = pPropMap->getByName( pProp[i] ); + SfxItemPropertySimpleEntry const*const pEntry = + pPropMap->getByName( pProp[i] ); if (!pEntry) // property available? - rResult.Result = beans::TolerantPropertySetResultType::UNKNOWN_PROPERTY; + { + rResult.Result = + beans::TolerantPropertySetResultType::UNKNOWN_PROPERTY; + } else { // get property state // (compare to SwXParagraph::getPropertyState) sal_Bool bAttrSetFetched = sal_True; beans::PropertyState eState = lcl_SwXParagraph_getPropertyState( - *pTxtNode, &pAttrSet, *pEntry, bAttrSetFetched ); + rTxtNode, &pAttrSet, *pEntry, bAttrSetFetched ); rResult.State = eState; // if (bDirectValuesOnly && PropertyState_DIRECT_VALUE != eState) // rResult.Result = beans::TolerantPropertySetResultType::NO_DIRECT_VALUE; // else rResult.Result = beans::TolerantPropertySetResultType::UNKNOWN_FAILURE; - if (!bDirectValuesOnly || beans::PropertyState_DIRECT_VALUE == eState) + if (!bDirectValuesOnly || + (beans::PropertyState_DIRECT_VALUE == eState)) { // get property value // (compare to SwXParagraph::getPropertyValue(s)) @@ -607,18 +792,21 @@ uno::Sequence< beans::GetDirectPropertyTolerantResult > SAL_CALL SwXParagraph::G if (!SwXParagraph::getDefaultTextContentValue( aValue, pProp[i], pEntry->nWID ) ) { - SwPosition aPos( *pTxtNode ); + SwPosition aPos( rTxtNode ); SwPaM aPam( aPos ); // handle properties that are not part of the attribute // and thus only pretendend to be paragraph attributes - BOOL bDone = FALSE; beans::PropertyState eTemp; - bDone = SwUnoCursorHelper::getCrsrPropertyValue( - *pEntry, aPam, &aValue, eTemp, pTxtNode ); + const bool bDone = + SwUnoCursorHelper::getCrsrPropertyValue( + *pEntry, aPam, &aValue, eTemp, &rTxtNode ); // if not found try the real paragraph attributes... if (!bDone) - m_pPropSet->getPropertyValue( *pEntry, rValueAttrSet, aValue ); + { + m_rPropSet.getPropertyValue( + *pEntry, rValueAttrSet, aValue ); + } } rResult.Value = aValue; @@ -661,7 +849,8 @@ uno::Sequence< beans::GetDirectPropertyTolerantResult > SAL_CALL SwXParagraph::G /* -----------------------------12.09.00 11:09-------------------------------- ---------------------------------------------------------------------------*/ -BOOL SwXParagraph::getDefaultTextContentValue(uno::Any& rAny, const OUString& rPropertyName, USHORT nWID) +bool SwXParagraph::getDefaultTextContentValue( + uno::Any& rAny, const OUString& rPropertyName, USHORT nWID) { if(!nWID) { @@ -694,35 +883,59 @@ BOOL SwXParagraph::getDefaultTextContentValue(uno::Any& rAny, const OUString& rP /*-- 11.12.98 08:12:50--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXParagraph::addPropertyChangeListener( - const OUString& /*PropertyName*/, - const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) - throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) +void SAL_CALL +SwXParagraph::addPropertyChangeListener( + const ::rtl::OUString& /*rPropertyName*/, + const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { - DBG_WARNING("not implemented"); + OSL_ENSURE(false, + "SwXParagraph::addPropertyChangeListener(): not implemented"); } + /*-- 11.12.98 08:12:50--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXParagraph::removePropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) +void SAL_CALL +SwXParagraph::removePropertyChangeListener( + const ::rtl::OUString& /*rPropertyName*/, + const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { - DBG_WARNING("not implemented"); + OSL_ENSURE(false, + "SwXParagraph::removePropertyChangeListener(): not implemented"); } + /*-- 11.12.98 08:12:50--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXParagraph::addVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) +void SAL_CALL +SwXParagraph::addVetoableChangeListener( + const ::rtl::OUString& /*rPropertyName*/, + const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { - DBG_WARNING("not implemented"); + OSL_ENSURE(false, + "SwXParagraph::addVetoableChangeListener(): not implemented"); } + /*-- 11.12.98 08:12:51--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXParagraph::removeVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) - throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) +void SAL_CALL +SwXParagraph::removeVetoableChangeListener( + const ::rtl::OUString& /*rPropertyName*/, + const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { - DBG_WARNING("not implemented"); + OSL_ENSURE(false, + "SwXParagraph::removeVetoableChangeListener(): not implemented"); } + //----------------------------------------------------------------------------- beans::PropertyState lcl_SwXParagraph_getPropertyState( // SwUnoCrsr& rUnoCrsr, @@ -730,7 +943,7 @@ beans::PropertyState lcl_SwXParagraph_getPropertyState( const SwAttrSet** ppSet, const SfxItemPropertySimpleEntry& rEntry, sal_Bool &rAttrSetFetched ) - throw( beans::UnknownPropertyException) +throw (beans::UnknownPropertyException) { beans::PropertyState eRet = beans::PropertyState_DEFAULT_VALUE; @@ -786,348 +999,393 @@ beans::PropertyState lcl_SwXParagraph_getPropertyState( /*-- 05.03.99 11:37:30--------------------------------------------------- -----------------------------------------------------------------------*/ -beans::PropertyState SwXParagraph::getPropertyState(const OUString& rPropertyName) - throw( beans::UnknownPropertyException, uno::RuntimeException ) +beans::PropertyState SAL_CALL +SwXParagraph::getPropertyState(const OUString& rPropertyName) +throw (beans::UnknownPropertyException, uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - beans::PropertyState eRet = beans::PropertyState_DEFAULT_VALUE; - const SwTxtNode * const pTxtNode( GetTxtNode() ); - if (pTxtNode) + + SwTxtNode & rTxtNode(m_pImpl->GetTxtNodeOrThrow()); + + const SwAttrSet* pSet = 0; + SfxItemPropertySimpleEntry const*const pEntry = + m_pImpl->m_rPropSet.getPropertyMap()->getByName(rPropertyName); + if (!pEntry) { - const SwAttrSet* pSet = 0; - const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName( rPropertyName ); - if(!pEntry) - throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); - sal_Bool bDummy = sal_False; - eRet = lcl_SwXParagraph_getPropertyState( *pTxtNode, &pSet, *pEntry, - bDummy ); + throw beans::UnknownPropertyException( + OUString(RTL_CONSTASCII_USTRINGPARAM("Unknown property: ")) + + rPropertyName, + static_cast(this)); } - else - throw uno::RuntimeException(); + sal_Bool bDummy = sal_False; + const beans::PropertyState eRet = + lcl_SwXParagraph_getPropertyState(rTxtNode, &pSet, *pEntry, bDummy); return eRet; } /*-- 05.03.99 11:37:32--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Sequence< beans::PropertyState > SwXParagraph::getPropertyStates( +uno::Sequence< beans::PropertyState > SAL_CALL +SwXParagraph::getPropertyStates( const uno::Sequence< OUString >& PropertyNames) - throw( beans::UnknownPropertyException, uno::RuntimeException ) +throw (beans::UnknownPropertyException, uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); + + SwTxtNode & rTxtNode(m_pImpl->GetTxtNodeOrThrow()); + const OUString* pNames = PropertyNames.getConstArray(); uno::Sequence< beans::PropertyState > aRet(PropertyNames.getLength()); beans::PropertyState* pStates = aRet.getArray(); + SfxItemPropertyMap const*const pMap = m_pImpl->m_rPropSet.getPropertyMap(); + const SwAttrSet* pSet = 0; + sal_Bool bAttrSetFetched = sal_False; - const SwTxtNode * pTxtNode( GetTxtNode() ); - if (pTxtNode) + for (sal_Int32 i = 0, nEnd = PropertyNames.getLength(); i < nEnd; + ++i, ++pStates, ++pNames) { - const SfxItemPropertyMap* pMap = m_pPropSet->getPropertyMap(); - const SwAttrSet* pSet = 0; - sal_Bool bAttrSetFetched = sal_False; - for(sal_Int32 i = 0, nEnd = PropertyNames.getLength(); i < nEnd; i++,++pStates,++pNames ) + SfxItemPropertySimpleEntry const*const pEntry = + pMap->getByName( *pNames ); + if (!pEntry) { - const SfxItemPropertySimpleEntry* pEntry = pMap->getByName( *pNames ); - if(!pEntry) - throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + *pNames, static_cast < cppu::OWeakObject * > ( this ) ); + throw beans::UnknownPropertyException( + OUString(RTL_CONSTASCII_USTRINGPARAM("Unknown property: ")) + + *pNames, + static_cast(this)); + } - if (bAttrSetFetched && !pSet && isATR(pEntry->nWID)) - { - *pStates = beans::PropertyState_DEFAULT_VALUE; - } - else - { - *pStates = lcl_SwXParagraph_getPropertyState( - *pTxtNode, &pSet, *pEntry, bAttrSetFetched ); - } + if (bAttrSetFetched && !pSet && isATR(pEntry->nWID)) + { + *pStates = beans::PropertyState_DEFAULT_VALUE; + } + else + { + *pStates = lcl_SwXParagraph_getPropertyState( + rTxtNode, &pSet, *pEntry, bAttrSetFetched ); } } - else - throw uno::RuntimeException(); return aRet; } + /*-- 05.03.99 11:37:33--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXParagraph::setPropertyToDefault(const OUString& rPropertyName) - throw( beans::UnknownPropertyException, uno::RuntimeException ) +void SAL_CALL +SwXParagraph::setPropertyToDefault(const OUString& rPropertyName) +throw (beans::UnknownPropertyException, uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - const SwTxtNode * pTxtNode( GetTxtNode() ); - if (pTxtNode) + + SwTxtNode & rTxtNode(m_pImpl->GetTxtNodeOrThrow()); + + SwPosition aPos( rTxtNode ); + SwCursor aCursor( aPos, 0, false ); + if (rPropertyName.equalsAsciiL(SW_PROP_NAME(UNO_NAME_ANCHOR_TYPE)) || + rPropertyName.equalsAsciiL(SW_PROP_NAME(UNO_NAME_ANCHOR_TYPES)) || + rPropertyName.equalsAsciiL(SW_PROP_NAME(UNO_NAME_TEXT_WRAP))) { - SwPosition aPos( *pTxtNode ); - SwCursor aCursor( aPos, 0, false ); - if( rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_ANCHOR_TYPE)) || - rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_ANCHOR_TYPES)) || - rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_TEXT_WRAP))) - return; + return; + } - // select paragraph - SwParaSelection aParaSel( & aCursor ); - const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName( rPropertyName ); - if(pEntry) - { - if ( pEntry->nFlags & beans::PropertyAttribute::READONLY) - throw uno::RuntimeException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only:" ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); + // select paragraph + SwParaSelection aParaSel( aCursor ); + SfxItemPropertySimpleEntry const*const pEntry = + m_pImpl->m_rPropSet.getPropertyMap()->getByName( rPropertyName ); + if (!pEntry) + { + throw beans::UnknownPropertyException( + OUString(RTL_CONSTASCII_USTRINGPARAM("Unknown property: ")) + + rPropertyName, + static_cast(this)); + } - if(pEntry->nWID < RES_FRMATR_END) + if (pEntry->nFlags & beans::PropertyAttribute::READONLY) + { + throw uno::RuntimeException( + OUString(RTL_CONSTASCII_USTRINGPARAM("Property is read-only: ")) + + rPropertyName, + static_cast(this)); + } + + if (pEntry->nWID < RES_FRMATR_END) + { + SvUShortsSort aWhichIds; + aWhichIds.Insert(pEntry->nWID); + if (pEntry->nWID < RES_PARATR_BEGIN) + { + aCursor.GetDoc()->ResetAttrs(aCursor, sal_True, &aWhichIds); + } + else + { + // for paragraph attributes the selection must be extended + // to paragraph boundaries + SwPosition aStart( *aCursor.Start() ); + SwPosition aEnd ( *aCursor.End() ); + ::std::auto_ptr pTemp( + aCursor.GetDoc()->CreateUnoCrsr(aStart, sal_False) ); + if(!SwUnoCursorHelper::IsStartOfPara(*pTemp)) { - SvUShortsSort aWhichIds; - aWhichIds.Insert(pEntry->nWID); - if(pEntry->nWID < RES_PARATR_BEGIN) - { - aCursor.GetDoc()->ResetAttrs(aCursor, sal_True, &aWhichIds); - } - else - { - // for paragraph attributes the selection must be extended - // to paragraph boundaries - SwPosition aStart( *aCursor.Start() ); - SwPosition aEnd ( *aCursor.End() ); - std::auto_ptr pTemp( - aCursor.GetDoc()->CreateUnoCrsr(aStart, sal_False) ); - if(!SwUnoCursorHelper::IsStartOfPara(*pTemp)) - { - pTemp->MovePara(fnParaCurr, fnParaStart); - } - pTemp->SetMark(); - *pTemp->GetPoint() = aEnd; - //pTemp->Exchange(); - SwXTextCursor::SelectPam(*pTemp, sal_True); - if(!SwUnoCursorHelper::IsEndOfPara(*pTemp)) - { - pTemp->MovePara(fnParaCurr, fnParaEnd); - } - pTemp->GetDoc()->ResetAttrs(*pTemp, sal_True, &aWhichIds); - } + pTemp->MovePara(fnParaCurr, fnParaStart); } - else + pTemp->SetMark(); + *pTemp->GetPoint() = aEnd; + //pTemp->Exchange(); + SwXTextCursor::SelectPam(*pTemp, sal_True); + if (!SwUnoCursorHelper::IsEndOfPara(*pTemp)) { - SwUnoCursorHelper::resetCrsrPropertyValue(*pEntry, aCursor); + pTemp->MovePara(fnParaCurr, fnParaEnd); } + pTemp->GetDoc()->ResetAttrs(*pTemp, sal_True, &aWhichIds); } - else - throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); } else - throw uno::RuntimeException(); + { + SwUnoCursorHelper::resetCrsrPropertyValue(*pEntry, aCursor); + } } + /*-- 05.03.99 11:37:33--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Any SwXParagraph::getPropertyDefault(const OUString& rPropertyName) - throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) +uno::Any SAL_CALL +SwXParagraph::getPropertyDefault(const OUString& rPropertyName) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { + vos::OGuard g(Application::GetSolarMutex()); + + SwTxtNode & rTxtNode(m_pImpl->GetTxtNodeOrThrow()); + uno::Any aRet; - const SwTxtNode * pTxtNode( GetTxtNode() ); - if (pTxtNode) + if (SwXParagraph::getDefaultTextContentValue(aRet, rPropertyName)) { - if(SwXParagraph::getDefaultTextContentValue(aRet, rPropertyName)) - return aRet; + return aRet; + } - const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName( rPropertyName ); - if(pEntry) - { - if(pEntry->nWID < RES_FRMATR_END) - { - const SfxPoolItem& rDefItem = - pTxtNode->GetDoc()->GetAttrPool().GetDefaultItem( - pEntry->nWID); - rDefItem.QueryValue(aRet, pEntry->nMemberId); - } - } - else - throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); + SfxItemPropertySimpleEntry const*const pEntry = + m_pImpl->m_rPropSet.getPropertyMap()->getByName(rPropertyName); + if (!pEntry) + { + throw beans::UnknownPropertyException( + OUString(RTL_CONSTASCII_USTRINGPARAM("Unknown property: ")) + + rPropertyName, + static_cast(this)); + } + + if (pEntry->nWID < RES_FRMATR_END) + { + const SfxPoolItem& rDefItem = + rTxtNode.GetDoc()->GetAttrPool().GetDefaultItem(pEntry->nWID); + rDefItem.QueryValue(aRet, pEntry->nMemberId); } - else - throw uno::RuntimeException(); return aRet; } + /*-- 11.12.98 08:12:51--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXParagraph::attach(const uno::Reference< text::XTextRange > & /*xTextRange*/) - throw( lang::IllegalArgumentException, uno::RuntimeException ) +void SAL_CALL +SwXParagraph::attach(const uno::Reference< text::XTextRange > & /*xTextRange*/) +throw (lang::IllegalArgumentException, uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - // SwXParagraph will only created in order to be inserteb by + // SwXParagraph will only created in order to be inserted by // 'insertTextContentBefore' or 'insertTextContentAfter' therefore // they cannot be attached throw uno::RuntimeException(); } + /*-- 11.12.98 08:12:51--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Reference< text::XTextRange > SwXParagraph::getAnchor(void) throw( uno::RuntimeException ) +uno::Reference< text::XTextRange > SAL_CALL +SwXParagraph::getAnchor() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - uno::Reference< text::XTextRange > aRet; - const SwTxtNode * pTxtNode( GetTxtNode() ); - if (pTxtNode) - { - SwPosition aPos( *pTxtNode ); - SwCursor aCursor( aPos, 0, false ); - // select paragraph - SwParaSelection aParaSel( & aCursor ); - aRet = new SwXTextRange(aCursor, xParentText); - } - else - throw uno::RuntimeException(); - return aRet; + + SwTxtNode & rTxtNode(m_pImpl->GetTxtNodeOrThrow()); + + SwPosition aPos( rTxtNode ); + SwCursor aCursor( aPos, 0, false ); + // select paragraph + SwParaSelection aParaSel( aCursor ); + const uno::Reference< text::XTextRange > xRet = + new SwXTextRange(aCursor, m_pImpl->m_xParentText); + return xRet; } + /*-- 11.12.98 08:12:52--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXParagraph::dispose(void) throw( uno::RuntimeException ) +void SAL_CALL SwXParagraph::dispose() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - SwTxtNode * pTxtNode( GetTxtNode() ); + + SwTxtNode *const pTxtNode( m_pImpl->GetTxtNode() ); if (pTxtNode) { SwCursor aCursor( SwPosition( *pTxtNode ), 0, false ); // select paragraph { - SwParaSelection aParaSel( & aCursor ); + SwParaSelection aParaSel( aCursor ); pTxtNode->GetDoc()->DelFullPara(aCursor); } - aLstnrCntnr.Disposing(); + m_pImpl->m_ListenerContainer.Disposing(); } - else - throw uno::RuntimeException(); } + /*-- 11.12.98 08:12:52--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXParagraph::addEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException ) +void SAL_CALL SwXParagraph::addEventListener( + const uno::Reference< lang::XEventListener > & xListener) +throw (uno::RuntimeException) { - if(!GetRegisteredIn()) + vos::OGuard g(Application::GetSolarMutex()); + + if (!m_pImpl->GetTxtNode()) + { throw uno::RuntimeException(); - aLstnrCntnr.AddListener(aListener); + } + m_pImpl->m_ListenerContainer.AddListener(xListener); } /*-- 11.12.98 08:12:53--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXParagraph::removeEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException ) +void SAL_CALL SwXParagraph::removeEventListener( + const uno::Reference< lang::XEventListener > & xListener) +throw (uno::RuntimeException) { - if(!GetRegisteredIn() || !aLstnrCntnr.RemoveListener(aListener)) + vos::OGuard g(Application::GetSolarMutex()); + + if (!m_pImpl->GetTxtNode() || + !m_pImpl->m_ListenerContainer.RemoveListener(xListener)) + { throw uno::RuntimeException(); + } } + /*-- 11.12.98 08:12:53--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Reference< container::XEnumeration > SwXParagraph::createEnumeration(void) throw( uno::RuntimeException ) +uno::Reference< container::XEnumeration > SAL_CALL +SwXParagraph::createEnumeration() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - uno::Reference< container::XEnumeration > aRef; - const SwTxtNode * pTxtNode( GetTxtNode() ); - if (pTxtNode) - { - SwPosition aPos( *pTxtNode ); - SwPaM aPam ( aPos ); - aRef = new SwXTextPortionEnumeration(aPam, xParentText, - nSelectionStartPos, nSelectionEndPos); - } - else - throw uno::RuntimeException(); - return aRef; + SwTxtNode & rTxtNode(m_pImpl->GetTxtNodeOrThrow()); + + SwPosition aPos( rTxtNode ); + SwPaM aPam ( aPos ); + const uno::Reference< container::XEnumeration > xRef = + new SwXTextPortionEnumeration(aPam, m_pImpl->m_xParentText, + m_pImpl->m_nSelectionStartPos, m_pImpl->m_nSelectionEndPos); + return xRef; } + /*-- 11.12.98 08:12:54--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Type SwXParagraph::getElementType(void) throw( uno::RuntimeException ) +uno::Type SAL_CALL SwXParagraph::getElementType() throw (uno::RuntimeException) { - return ::getCppuType((uno::Reference*)0); + return text::XTextRange::static_type(); } /*-- 11.12.98 08:12:54--------------------------------------------------- -----------------------------------------------------------------------*/ -sal_Bool SwXParagraph::hasElements(void) throw( uno::RuntimeException ) +sal_Bool SAL_CALL SwXParagraph::hasElements() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); return (GetTxtNode()) ? sal_True : sal_False; } + /*-- 11.12.98 08:12:55--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Reference< text::XText > SwXParagraph::getText(void) throw( uno::RuntimeException ) +uno::Reference< text::XText > SAL_CALL +SwXParagraph::getText() throw (uno::RuntimeException) { - return xParentText; + vos::OGuard g(Application::GetSolarMutex()); + + return m_pImpl->m_xParentText; } + /*-- 11.12.98 08:12:55--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Reference< text::XTextRange > SwXParagraph::getStart(void) throw( uno::RuntimeException ) +uno::Reference< text::XTextRange > SAL_CALL +SwXParagraph::getStart() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - uno::Reference< text::XTextRange > xRet; - const SwTxtNode * pTxtNode( GetTxtNode() ); - if (pTxtNode) - { - SwPosition aPos( *pTxtNode ); - SwCursor aCursor( aPos, 0, false ); - SwParaSelection aParaSel( &aCursor ); - SwPaM aPam( *aCursor.Start() ); - uno::Reference< text::XText > xParent = getText(); - xRet = new SwXTextRange(aPam, xParent); - } - else - throw uno::RuntimeException(); + + SwTxtNode & rTxtNode(m_pImpl->GetTxtNodeOrThrow()); + + SwPosition aPos( rTxtNode ); + SwCursor aCursor( aPos, 0, false ); + SwParaSelection aParaSel( aCursor ); + SwPaM aPam( *aCursor.Start() ); + uno::Reference< text::XText > xParent = getText(); + const uno::Reference< text::XTextRange > xRet = + new SwXTextRange(aPam, xParent); return xRet; } /*-- 11.12.98 08:12:56--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Reference< text::XTextRange > SwXParagraph::getEnd(void) throw( uno::RuntimeException ) +uno::Reference< text::XTextRange > SAL_CALL +SwXParagraph::getEnd() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - uno::Reference< text::XTextRange > xRet; - const SwTxtNode * pTxtNode( GetTxtNode() ); - if (pTxtNode) - { - SwPosition aPos( *pTxtNode ); - SwCursor aCursor( aPos, 0, false ); - SwParaSelection aParaSel( &aCursor ); - SwPaM aPam( *aCursor.End() ); - uno::Reference< text::XText > xParent = getText(); - xRet = new SwXTextRange(aPam, xParent); - } - else - throw uno::RuntimeException(); + + SwTxtNode & rTxtNode(m_pImpl->GetTxtNodeOrThrow()); + + SwPosition aPos( rTxtNode ); + SwCursor aCursor( aPos, 0, false ); + SwParaSelection aParaSel( aCursor ); + SwPaM aPam( *aCursor.End() ); + uno::Reference< text::XText > xParent = getText(); + const uno::Reference< text::XTextRange > xRet = + new SwXTextRange(aPam, xParent); return xRet; } + /*-- 11.12.98 08:12:56--------------------------------------------------- -----------------------------------------------------------------------*/ -OUString SwXParagraph::getString(void) throw( uno::RuntimeException ) +OUString SAL_CALL SwXParagraph::getString() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); OUString aRet; - const SwTxtNode * pTxtNode( GetTxtNode() ); + SwTxtNode const*const pTxtNode( GetTxtNode() ); if (pTxtNode) { SwPosition aPos( *pTxtNode ); SwCursor aCursor( aPos, 0, false ); - SwParaSelection aParaSel( & aCursor ); + SwParaSelection aParaSel( aCursor ); SwXTextCursor::getTextFromPam(aCursor, aRet); } - else if(IsDescriptor()) - aRet = m_sText; + else if (m_pImpl->IsDescriptor()) + { + aRet = m_pImpl->m_sText; + } else + { throw uno::RuntimeException(); + } return aRet; } /*-- 11.12.98 08:12:57--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXParagraph::setString(const OUString& aString) throw( uno::RuntimeException ) +void SAL_CALL SwXParagraph::setString(const OUString& aString) +throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - const SwTxtNode * pTxtNode( GetTxtNode() ); + SwTxtNode const*const pTxtNode( GetTxtNode() ); if (pTxtNode) { SwPosition aPos( *pTxtNode ); @@ -1142,23 +1400,33 @@ void SwXParagraph::setString(const OUString& aString) throw( uno::RuntimeExcepti SwXTextCursor::SetString(aCursor, aString); SwXTextCursor::SelectPam(aCursor, sal_False); } - else if(IsDescriptor()) - m_sText = aString; + else if (m_pImpl->IsDescriptor()) + { + m_pImpl->m_sText = aString; + } else + { throw uno::RuntimeException(); - + } } + /* -----------------23.03.99 12:49------------------- * * --------------------------------------------------*/ -uno::Reference< container::XEnumeration > SwXParagraph::createContentEnumeration(const OUString& rServiceName) - throw( uno::RuntimeException ) +uno::Reference< container::XEnumeration > SAL_CALL +SwXParagraph::createContentEnumeration(const OUString& rServiceName) +throw (uno::RuntimeException) { - const SwTxtNode * pTxtNode( GetTxtNode() ); - if(!pTxtNode || !rServiceName.equalsAscii("com.sun.star.text.TextContent")) + vos::OGuard g(Application::GetSolarMutex()); + + if (!rServiceName.equalsAscii("com.sun.star.text.TextContent")) + { throw uno::RuntimeException(); + } - SwPosition aPos( *pTxtNode ); + SwTxtNode & rTxtNode(m_pImpl->GetTxtNodeOrThrow()); + + SwPosition aPos( rTxtNode ); SwPaM aPam( aPos ); uno::Reference< container::XEnumeration > xRet = new SwXParaFrameEnumeration(aPam, PARAFRAME_PORTION_PARAGRAPH); @@ -1167,50 +1435,31 @@ uno::Reference< container::XEnumeration > SwXParagraph::createContentEnumeratio /* -----------------23.03.99 12:49------------------- * * --------------------------------------------------*/ -uno::Sequence< OUString > SwXParagraph::getAvailableServiceNames(void) throw( uno::RuntimeException ) +uno::Sequence< OUString > SAL_CALL +SwXParagraph::getAvailableServiceNames() throw (uno::RuntimeException) { uno::Sequence< OUString > aRet(1); OUString* pArray = aRet.getArray(); pArray[0] = C2U("com.sun.star.text.TextContent"); return aRet; } -/*-- 11.12.98 08:12:58--------------------------------------------------- - - -----------------------------------------------------------------------*/ -void SwXParagraph::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) -{ - ClientModify(this, pOld, pNew); - if(!GetRegisteredIn()) - aLstnrCntnr.Disposing(); -} - -const SwTxtNode * SwXParagraph::GetTxtNode() const -{ - return static_cast(GetRegisteredIn()); -} -SwTxtNode * SwXParagraph::GetTxtNode() -{ - return static_cast(pRegisteredIn); -} +// MetadatableMixin ::sfx2::Metadatable* SwXParagraph::GetCoreObject() { - SwTxtNode * pTxtNode( GetTxtNode() ); + SwTxtNode *const pTxtNode( m_pImpl->GetTxtNode() ); return pTxtNode; } uno::Reference SwXParagraph::GetModel() { - SwTxtNode * pTxtNode( GetTxtNode() ); + SwTxtNode *const pTxtNode( m_pImpl->GetTxtNode() ); if (pTxtNode) { - const SwDocShell * pShell( pTxtNode->GetDoc()->GetDocShell() ); + SwDocShell const*const pShell( pTxtNode->GetDoc()->GetDocShell() ); return (pShell) ? pShell->GetModel() : 0; } - else - { - return 0; - } + return 0; } diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index e571cd722f6c..75eebe7047b2 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -666,7 +666,10 @@ void SwXText::insertTextContentBefore( throw aRuntime; } - SwXParagraph* pPara = SwXParagraph::GetImplementation(xNewContent); + const uno::Reference xParaTunnel(xNewContent, + uno::UNO_QUERY); + SwXParagraph *const pPara = + ::sw::UnoTunnelGetImplementation(xParaTunnel); if(!pPara || !pPara->IsDescriptor() || !xSuccessor.is()) throw lang::IllegalArgumentException(); @@ -718,7 +721,10 @@ void SwXText::insertTextContentAfter( vos::OGuard aGuard(Application::GetSolarMutex()); if(!GetDoc()) throw uno::RuntimeException(); - SwXParagraph* pPara = SwXParagraph::GetImplementation(xNewContent); + const uno::Reference xParaTunnel(xNewContent, + uno::UNO_QUERY); + SwXParagraph *const pPara = + ::sw::UnoTunnelGetImplementation(xParaTunnel); if(!pPara || !pPara->IsDescriptor() || !xPredecessor.is()) throw lang::IllegalArgumentException(); @@ -1414,7 +1420,10 @@ uno::Reference< text::XTextRange > SwXText::finishOrAppendParagraph( } SwTxtNode * pTxtNode( aPam.Start()->nNode.GetNode().GetTxtNode() ); OSL_ENSURE(pTxtNode, "no SwTxtNode?"); - xRet = new SwXParagraph(this, pTxtNode); + if (pTxtNode) + { + xRet.set(SwXParagraph::CreateXParagraph(*pDoc, *pTxtNode, this), uno::UNO_QUERY); + } } return xRet; -- cgit v1.2.3 From 77ca8486db12a970aef9aeafea3ac9a4c297d2b2 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:51 +0100 Subject: swunolocking1: #i105557#: fix locking for SwXParagraphEnumeration: add Impl struct, and use UnoImplPtr to lock destructor. move all implementation details out of header, into Impl struct. use new XServiceInfo helpers. clean up the implementation a little. --- sw/inc/unoparagraph.hxx | 56 +---- sw/source/core/unocore/unoframe.cxx | 7 +- sw/source/core/unocore/unoftn.cxx | 8 +- sw/source/core/unocore/unoobj2.cxx | 445 ++++++++++++++++++++-------------- sw/source/core/unocore/unoredline.cxx | 8 +- sw/source/core/unocore/unotbl.cxx | 13 +- sw/source/core/unocore/unotext.cxx | 15 +- 7 files changed, 303 insertions(+), 249 deletions(-) diff --git a/sw/inc/unoparagraph.hxx b/sw/inc/unoparagraph.hxx index d5c5e2ed2832..b14aeb7dc3d9 100644 --- a/sw/inc/unoparagraph.hxx +++ b/sw/inc/unoparagraph.hxx @@ -32,6 +32,8 @@ #ifndef SW_UNOPARAGRAPH_HXX #define SW_UNOPARAGRAPH_HXX +#include + #include #include #include @@ -47,16 +49,13 @@ #include -#include #include struct SwPosition; class SwPaM; class SwUnoCrsr; -class SwStartNode; class SwTxtNode; -class SwTable; class SwXText; @@ -327,60 +326,23 @@ public: --------------------------------------------------*/ class SwXParagraphEnumeration : public SwSimpleEnumeration_Base - , public SwClient { private: - ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > - xParentText; - ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > - xNextPara; - - const SwTable * pOwnTable; - /// Start node of the cell the enumeration belongs to. - /// Used to restrict the movement of the UNO cursor to the cell and its - /// embedded tables. - const SwStartNode * pOwnStartNode; - sal_Int32 nFirstParaStart; - sal_Int32 nLastParaEnd; - ULONG nEndIndex; - CursorType eCursorType; - BOOL bFirstParagraph; - - SwUnoCrsr* GetCrsr() {return (SwUnoCrsr*)GetRegisteredIn();} - -protected: + class Impl; + ::sw::UnoImplPtr m_pImpl; virtual ~SwXParagraphEnumeration(); - virtual ::com::sun::star::uno::Reference< - ::com::sun::star::text::XTextContent > SAL_CALL - NextElement_Impl() - throw (::com::sun::star::container::NoSuchElementException, - ::com::sun::star::lang::WrappedTargetException, - ::com::sun::star::uno::RuntimeException); - public: + /// takes ownership of cursor SwXParagraphEnumeration( - SwXText* pParent, SwPosition& rPos, CursorType eType); - SwXParagraphEnumeration( - SwXText* pParent, SwUnoCrsr* pCrsr, CursorType eType); - - // non-Uno functions - - void SetOwnTable(const SwTable* pTable) - { pOwnTable = pTable; } - const SwTable* GetOwnTable() const - { return pOwnTable; } - void SetOwnStartNode(const SwStartNode* pNode) - { pOwnStartNode = pNode; } - const SwStartNode* GetOwnStartNode() const - { return pOwnStartNode; } - - // SwClient - virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > + const & xParent, + ::std::auto_ptr pCursor, + const CursorType eType); // XServiceInfo virtual ::rtl::OUString SAL_CALL getImplementationName() diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 9d3fab300c03..8b3349332895 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -2700,14 +2700,15 @@ uno::Reference< container::XEnumeration > SwXTextFrame::createEnumeration(void) if(pFmt) { SwPosition aPos(pFmt->GetCntnt().GetCntntIdx()->GetNode()); - SwUnoCrsr* pUnoCrsr = GetDoc()->CreateUnoCrsr(aPos, sal_False); - pUnoCrsr->Move( fnMoveForward, fnGoNode ); + ::std::auto_ptr pUnoCursor( + GetDoc()->CreateUnoCrsr(aPos, sal_False)); + pUnoCursor->Move(fnMoveForward, fnGoNode); // // no Cursor in protected sections // SwCrsrSaveState aSave( *pUnoCrsr ); // if(pUnoCrsr->IsInProtectTable( sal_True ) || // pUnoCrsr->IsSelOvr( SELOVER_TOGGLE | SELOVER_CHANGEPOS )) // throw uno::RuntimeException() ); - aRef = new SwXParagraphEnumeration(this, pUnoCrsr, CURSOR_FRAME); + aRef = new SwXParagraphEnumeration(this, pUnoCursor, CURSOR_FRAME); } return aRef; } diff --git a/sw/source/core/unocore/unoftn.cxx b/sw/source/core/unocore/unoftn.cxx index 5ef6c3d3c5bc..f18a46d8ad37 100644 --- a/sw/source/core/unocore/unoftn.cxx +++ b/sw/source/core/unocore/unoftn.cxx @@ -439,10 +439,10 @@ uno::Reference< container::XEnumeration > SwXFootnote::createEnumeration() thro { const SwTxtFtn* pTxtFtn = pFmt->GetTxtFtn(); SwPosition aPos( *pTxtFtn->GetStartNode() ); - SwXTextCursor* pXCrsr = new SwXTextCursor(this, aPos, CURSOR_FOOTNOTE, GetDoc()); - SwUnoCrsr* pUnoCrsr = pXCrsr->GetCrsr(); - pUnoCrsr->Move(fnMoveForward, fnGoNode); - aRef = new SwXParagraphEnumeration(this, pUnoCrsr, CURSOR_FOOTNOTE); + ::std::auto_ptr pUnoCursor( + GetDoc()->CreateUnoCrsr(aPos, sal_False)); + pUnoCursor->Move(fnMoveForward, fnGoNode); + aRef = new SwXParagraphEnumeration(this, pUnoCursor, CURSOR_FOOTNOTE); } return aRef; } diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index b5c2ea2a6993..e3515d700d10 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -699,28 +699,22 @@ uno::Reference< XEnumeration > SwXTextCursor::createEnumeration(void) throw( Ru sal::static_int_cast< sal_IntPtr >( xTunnel->getSomething(SwXText::getUnoTunnelId()) )); } DBG_ASSERT(pParentText, "parent is not a SwXText"); + if (!pParentText) + { + throw uno::RuntimeException(); + } - SwUnoCrsr* pNewCrsr = pUnoCrsr->GetDoc()->CreateUnoCrsr(*pUnoCrsr->GetPoint()); + ::std::auto_ptr pNewCrsr( + pUnoCrsr->GetDoc()->CreateUnoCrsr(*pUnoCrsr->GetPoint()) ); if(pUnoCrsr->HasMark()) { pNewCrsr->SetMark(); *pNewCrsr->GetMark() = *pUnoCrsr->GetMark(); } - CursorType eSetType = eType == CURSOR_TBLTEXT ? CURSOR_SELECTION_IN_TABLE : CURSOR_SELECTION; - SwXParagraphEnumeration *pEnum = + const CursorType eSetType = (CURSOR_TBLTEXT == eType) + ? CURSOR_SELECTION_IN_TABLE : CURSOR_SELECTION; + const uno::Reference< XEnumeration > xRet = new SwXParagraphEnumeration(pParentText, pNewCrsr, eSetType); - uno::Reference< XEnumeration > xRet = pEnum; - if (eType == CURSOR_TBLTEXT) - { - // for import of tables in tables we have to remember the actual - // table and start node of the current position in the enumeration. - SwTableNode *pStartN = pUnoCrsr->GetPoint()->nNode.GetNode().FindTableNode(); - if (pStartN) - { - pEnum->SetOwnTable( &pStartN->GetTable() ); - pEnum->SetOwnStartNode( pStartN ); - } - } return xRet; } @@ -959,103 +953,180 @@ void SwXTextCursor::GetCrsrAttr( SwPaM& rPam, /****************************************************************** * SwXParagraphEnumeration ******************************************************************/ -/* -----------------------------06.04.00 16:33-------------------------------- - ---------------------------------------------------------------------------*/ -OUString SwXParagraphEnumeration::getImplementationName(void) throw( RuntimeException ) +static SwStartNode * +lcl_InitStartNode(const CursorType eType, SwUnoCrsr *const pCursor) { - return C2U("SwXParagraphEnumeration"); + switch (eType) + { + case CURSOR_TBLTEXT: // table cell: pCursor points at first paragraph + return pCursor->Start()->nNode.GetNode().StartOfSectionNode(); + case CURSOR_SELECTION_IN_TABLE: // table + return pCursor->Start()->nNode.GetNode().FindTableNode(); + default: + return 0; + } } -/* -----------------------------06.04.00 16:33-------------------------------- - ---------------------------------------------------------------------------*/ -BOOL SwXParagraphEnumeration::supportsService(const OUString& rServiceName) throw( RuntimeException ) +static SwTable const* +lcl_InitTable(const CursorType eType, SwStartNode const*const pStartNode) { - return C2U("com.sun.star.text.ParagraphEnumeration") == rServiceName; -} -/* -----------------------------06.04.00 16:33-------------------------------- + switch (eType) + { + case CURSOR_TBLTEXT: // table cell + return & pStartNode->FindTableNode()->GetTable(); + case CURSOR_SELECTION_IN_TABLE: // table + return & static_cast(pStartNode)->GetTable(); + default: + return 0; + } +} + +class SwXParagraphEnumeration::Impl + : public SwClient +{ + +public: + + uno::Reference< text::XText > const m_xParentText; + const CursorType m_eCursorType; + /// Start node of the cell _or_ table the enumeration belongs to. + /// Used to restrict the movement of the UNO cursor to the cell and its + /// embedded tables. + SwStartNode const*const m_pOwnStartNode; + SwTable const*const m_pOwnTable; + const ULONG m_nEndIndex; + sal_Int32 m_nFirstParaStart; + sal_Int32 m_nLastParaEnd; + bool m_bFirstParagraph; + uno::Reference< text::XTextContent > m_xNextPara; + + Impl( uno::Reference< text::XText > const& xParent, + ::std::auto_ptr pCursor, + const CursorType eType) + : SwClient( pCursor.release() ) + , m_xParentText( xParent ) + , m_eCursorType( eType ) + // remember table and start node for later travelling + // (used in export of tables in tables) + , m_pOwnStartNode( lcl_InitStartNode(eType, GetCursor()) ) + // for import of tables in tables we have to remember the actual + // table and start node of the current position in the enumeration. + , m_pOwnTable( lcl_InitTable(eType, m_pOwnStartNode) ) + , m_nEndIndex( GetCursor()->End()->nNode.GetIndex() ) + , m_nFirstParaStart( -1 ) + , m_nLastParaEnd( -1 ) + , m_bFirstParagraph( true ) + { + OSL_ENSURE(m_xParentText.is(), "SwXParagraphEnumeration: no parent?"); + OSL_ENSURE(GetRegisteredIn(), "SwXParagraphEnumeration: no cursor?"); - ---------------------------------------------------------------------------*/ -Sequence< OUString > SwXParagraphEnumeration::getSupportedServiceNames(void) throw( RuntimeException ) -{ - Sequence< OUString > aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = C2U("com.sun.star.text.ParagraphEnumeration"); - return aRet; -} -/*-- 10.12.98 11:52:12--------------------------------------------------- + if ((CURSOR_SELECTION == m_eCursorType) || + (CURSOR_SELECTION_IN_TABLE == m_eCursorType)) + { + SwUnoCrsr & rCursor = *GetCursor(); + rCursor.Normalize(); + m_nFirstParaStart = rCursor.GetPoint()->nContent.GetIndex(); + m_nLastParaEnd = rCursor.GetMark()->nContent.GetIndex(); + rCursor.DeleteMark(); + } + } - -----------------------------------------------------------------------*/ -SwXParagraphEnumeration::SwXParagraphEnumeration(SwXText* pParent, - SwPosition& rPos, - CursorType eType) : - xParentText(pParent), - nFirstParaStart(-1), - nLastParaEnd(-1), - nEndIndex(rPos.nNode.GetIndex()), - eCursorType(eType), - bFirstParagraph(sal_True) -{ - pOwnTable = 0; - pOwnStartNode = 0; - SwUnoCrsr* pUnoCrsr = pParent->GetDoc()->CreateUnoCrsr(rPos, sal_False); - pUnoCrsr->Add(this); + ~Impl() { + // Impl owns the cursor; delete it here: SolarMutex is locked + delete GetRegisteredIn(); + } + + SwUnoCrsr * GetCursor() { + return static_cast( + const_cast(GetRegisteredIn())); + } + + uno::Reference< text::XTextContent > NextElement_Impl() + throw (container::NoSuchElementException, lang::WrappedTargetException, + uno::RuntimeException); + + // SwClient + virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + +}; + +void SwXParagraphEnumeration::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew) +{ + ClientModify(this, pOld, pNew); } /*-- 10.12.98 11:52:12--------------------------------------------------- -----------------------------------------------------------------------*/ -SwXParagraphEnumeration::SwXParagraphEnumeration(SwXText* pParent, - SwUnoCrsr* pCrsr, - CursorType eType) : - SwClient(pCrsr), - xParentText(pParent), - nFirstParaStart(-1), - nLastParaEnd(-1), - nEndIndex(pCrsr->End()->nNode.GetIndex()), - eCursorType(eType), - bFirstParagraph(sal_True) -{ - pOwnTable = 0; - pOwnStartNode = 0; - if(CURSOR_SELECTION == eCursorType || CURSOR_SELECTION_IN_TABLE == eCursorType) - { - if(*pCrsr->GetPoint() > *pCrsr->GetMark()) - pCrsr->Exchange(); - nFirstParaStart = pCrsr->GetPoint()->nContent.GetIndex(); - nLastParaEnd = pCrsr->GetMark()->nContent.GetIndex(); - if(pCrsr->HasMark()) - pCrsr->DeleteMark(); - } +SwXParagraphEnumeration::SwXParagraphEnumeration( + uno::Reference< text::XText > const& xParent, + ::std::auto_ptr pCursor, + const CursorType eType) + : m_pImpl( new SwXParagraphEnumeration::Impl(xParent, pCursor, eType) ) +{ } /*-- 10.12.98 11:52:12--------------------------------------------------- -----------------------------------------------------------------------*/ SwXParagraphEnumeration::~SwXParagraphEnumeration() { - vos::OGuard aGuard(Application::GetSolarMutex()); - SwUnoCrsr* pUnoCrsr = GetCrsr(); - if(pUnoCrsr) - delete pUnoCrsr; +} + +/* -----------------------------06.04.00 16:33-------------------------------- + + ---------------------------------------------------------------------------*/ +OUString SAL_CALL +SwXParagraphEnumeration::getImplementationName() throw (uno::RuntimeException) +{ + return C2U("SwXParagraphEnumeration"); +} +/* -----------------------------06.04.00 16:33-------------------------------- + + ---------------------------------------------------------------------------*/ +static char const*const g_ServicesParagraphEnum[] = +{ + "com.sun.star.text.ParagraphEnumeration", +}; +static const size_t g_nServicesParagraphEnum( + sizeof(g_ServicesParagraphEnum)/sizeof(g_ServicesParagraphEnum[0])); +sal_Bool SAL_CALL +SwXParagraphEnumeration::supportsService(const OUString& rServiceName) +throw (uno::RuntimeException) +{ + return ::sw::SupportsServiceImpl( + g_nServicesParagraphEnum, g_ServicesParagraphEnum, rServiceName); } +/* -----------------------------06.04.00 16:33-------------------------------- + + ---------------------------------------------------------------------------*/ +uno::Sequence< OUString > SAL_CALL +SwXParagraphEnumeration::getSupportedServiceNames() +throw (uno::RuntimeException) +{ + return ::sw::GetSupportedServiceNamesImpl( + g_nServicesParagraphEnum, g_ServicesParagraphEnum); +} + /*-- 10.12.98 11:52:13--------------------------------------------------- -----------------------------------------------------------------------*/ -sal_Bool SwXParagraphEnumeration::hasMoreElements(void) throw( uno::RuntimeException ) +sal_Bool SAL_CALL +SwXParagraphEnumeration::hasMoreElements() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - return bFirstParagraph ? sal_True : xNextPara.is(); + + return (m_pImpl->m_bFirstParagraph) ? sal_True : m_pImpl->m_xNextPara.is(); } /*-- 14.08.03 13:10:14--------------------------------------------------- -----------------------------------------------------------------------*/ //!! compare to SwShellTableCrsr::FillRects() in viscrs.cxx -SwTableNode * lcl_FindTopLevelTable( - /*SwUnoCrsr* pUnoCrsr ,*/ - SwTableNode *pTblNode, - const SwTable *pOwnTable ) +static SwTableNode * +lcl_FindTopLevelTable( + SwTableNode *const pTblNode, SwTable const*const pOwnTable) { // find top-most table in current context (section) level @@ -1070,14 +1141,14 @@ SwTableNode * lcl_FindTopLevelTable( } -BOOL lcl_CursorIsInSection( - const SwUnoCrsr *pUnoCrsr, - const SwStartNode *pOwnStartNode ) +static bool +lcl_CursorIsInSection( + SwUnoCrsr const*const pUnoCrsr, SwStartNode const*const pOwnStartNode) { // returns true if the cursor is in the section (or in a sub section!) // represented by pOwnStartNode - BOOL bRes = TRUE; + bool bRes = true; if (pUnoCrsr && pOwnStartNode) { const SwEndNode * pOwnEndNode = pOwnStartNode->EndOfSectionNode(); @@ -1088,124 +1159,134 @@ BOOL lcl_CursorIsInSection( } -uno::Reference< XTextContent > SAL_CALL SwXParagraphEnumeration::NextElement_Impl(void) - throw( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException ) +uno::Reference< text::XTextContent > +SwXParagraphEnumeration::Impl::NextElement_Impl() +throw (container::NoSuchElementException, lang::WrappedTargetException, + uno::RuntimeException) { - uno::Reference< XTextContent > aRef; - SwUnoCrsr* pUnoCrsr = GetCrsr(); - if(pUnoCrsr) + SwUnoCrsr *const pUnoCrsr = GetCursor(); + if (!pUnoCrsr) { - // check for exceeding selections - if(!bFirstParagraph && - (CURSOR_SELECTION == eCursorType || CURSOR_SELECTION_IN_TABLE == eCursorType)) + throw uno::RuntimeException(); + } + + // check for exceeding selections + if (!m_bFirstParagraph && + ((CURSOR_SELECTION == m_eCursorType) || + (CURSOR_SELECTION_IN_TABLE == m_eCursorType))) + { + SwPosition* pStart = pUnoCrsr->Start(); + const ::std::auto_ptr aNewCrsr( + pUnoCrsr->GetDoc()->CreateUnoCrsr(*pStart, sal_False) ); + // one may also go into tables here + if ((CURSOR_TBLTEXT != m_eCursorType) && + (CURSOR_SELECTION_IN_TABLE != m_eCursorType)) { - SwPosition* pStart = pUnoCrsr->Start(); - ::std::auto_ptr aNewCrsr( pUnoCrsr->GetDoc()->CreateUnoCrsr(*pStart, sal_False) ); - //man soll hier auch in Tabellen landen duerfen - if(CURSOR_TBLTEXT != eCursorType && CURSOR_SELECTION_IN_TABLE != eCursorType) - aNewCrsr->SetRemainInSection( sal_False ); - - // os 2005-01-14: This part is only necessary to detect movements out of a selection - // if there is no selection we don't have to care - SwTableNode* pTblNode = aNewCrsr->GetNode()->FindTableNode(); - if((CURSOR_TBLTEXT != eCursorType && CURSOR_SELECTION_IN_TABLE != eCursorType) && pTblNode) - { - aNewCrsr->GetPoint()->nNode = pTblNode->EndOfSectionIndex(); - aNewCrsr->Move(fnMoveForward, fnGoNode); - } - else - aNewCrsr->MovePara(fnParaNext, fnParaStart); - if(nEndIndex < aNewCrsr->Start()->nNode.GetIndex()) - return aRef; // empty reference + aNewCrsr->SetRemainInSection( sal_False ); } - XText* pText = xParentText.get(); - sal_Bool bInTable = sal_False; - if(!bFirstParagraph) + // os 2005-01-14: This part is only necessary to detect movements out + // of a selection; if there is no selection we don't have to care + SwTableNode *const pTblNode = aNewCrsr->GetNode()->FindTableNode(); + if (((CURSOR_TBLTEXT != m_eCursorType) && + (CURSOR_SELECTION_IN_TABLE != m_eCursorType)) && pTblNode) { - //man soll hier auch in Tabellen landen duerfen - //if(CURSOR_TBLTEXT != eCursorType && CURSOR_SELECTION_IN_TABLE != eCursorType) - { - //BOOL bRemain = sal_False; - //pUnoCrsr->SetRemainInSection( bRemain ); - pUnoCrsr->SetRemainInSection( sal_False ); - //was mache ich, wenn ich schon in einer Tabelle stehe? - SwTableNode* pTblNode = pUnoCrsr->GetNode()->FindTableNode(); - pTblNode = lcl_FindTopLevelTable( /*pUnoCrsr,*/ pTblNode, pOwnTable ); - if(pTblNode && &pTblNode->GetTable() != pOwnTable) - { - // wir haben es mit einer fremden Tabelle zu tun - also ans Ende - pUnoCrsr->GetPoint()->nNode = pTblNode->EndOfSectionIndex(); - if(!pUnoCrsr->Move(fnMoveForward, fnGoNode)) - return aRef; - else - bInTable = sal_True; - - } - } + aNewCrsr->GetPoint()->nNode = pTblNode->EndOfSectionIndex(); + aNewCrsr->Move(fnMoveForward, fnGoNode); } + else + { + aNewCrsr->MovePara(fnParaNext, fnParaStart); + } + if (m_nEndIndex < aNewCrsr->Start()->nNode.GetIndex()) + { + return 0; + } + } - // the cursor must remain in the current section or a subsection - // before AND after the movement... - if( lcl_CursorIsInSection( pUnoCrsr, pOwnStartNode ) && - (bFirstParagraph || bInTable || - (pUnoCrsr->MovePara(fnParaNext, fnParaStart) && - lcl_CursorIsInSection( pUnoCrsr, pOwnStartNode ) ) ) ) + sal_Bool bInTable = sal_False; + if (!m_bFirstParagraph) + { + pUnoCrsr->SetRemainInSection( sal_False ); + // what to do if already in a table? + SwTableNode * pTblNode = pUnoCrsr->GetNode()->FindTableNode(); + pTblNode = lcl_FindTopLevelTable( pTblNode, m_pOwnTable ); + if (pTblNode && (&pTblNode->GetTable() != m_pOwnTable)) { - SwPosition* pStart = pUnoCrsr->Start(); - sal_Int32 nFirstContent = bFirstParagraph ? nFirstParaStart : -1; - sal_Int32 nLastContent = nEndIndex == pStart->nNode.GetIndex() ? nLastParaEnd : -1; - //steht man nun in einer Tabelle, oder in einem einfachen Absatz? - - SwTableNode* pTblNode = pUnoCrsr->GetNode()->FindTableNode(); - pTblNode = lcl_FindTopLevelTable( /*pUnoCrsr,*/ pTblNode, pOwnTable ); - if(/*CURSOR_TBLTEXT != eCursorType && CURSOR_SELECTION_IN_TABLE != eCursorType && */ - pTblNode && &pTblNode->GetTable() != pOwnTable) + // this is a foreign table: go to end + pUnoCrsr->GetPoint()->nNode = pTblNode->EndOfSectionIndex(); + if (!pUnoCrsr->Move(fnMoveForward, fnGoNode)) { - // wir haben es mit einer fremden Tabelle zu tun - SwFrmFmt* pTableFmt = (SwFrmFmt*)pTblNode->GetTable().GetFrmFmt(); - XTextTable* pTable = SwXTextTables::GetObject( *pTableFmt ); - aRef = (XTextContent*)(SwXTextTable*)pTable; - } - else - { - aRef = SwXParagraph::CreateXParagraph(*pUnoCrsr->GetDoc(), - *pStart->nNode.GetNode().GetTxtNode(), - static_cast(pText), nFirstContent, nLastContent); + return 0; } + bInTable = sal_True; } } - else - throw uno::RuntimeException(); - return aRef; + uno::Reference< text::XTextContent > xRef; + // the cursor must remain in the current section or a subsection + // before AND after the movement... + if (lcl_CursorIsInSection( pUnoCrsr, m_pOwnStartNode ) && + (m_bFirstParagraph || bInTable || + (pUnoCrsr->MovePara(fnParaNext, fnParaStart) && + lcl_CursorIsInSection( pUnoCrsr, m_pOwnStartNode )))) + { + SwPosition* pStart = pUnoCrsr->Start(); + const sal_Int32 nFirstContent = + (m_bFirstParagraph) ? m_nFirstParaStart : -1; + const sal_Int32 nLastContent = + (m_nEndIndex == pStart->nNode.GetIndex()) ? m_nLastParaEnd : -1; + + // position in a table, or in a simple paragraph? + SwTableNode * pTblNode = pUnoCrsr->GetNode()->FindTableNode(); + pTblNode = lcl_FindTopLevelTable( pTblNode, m_pOwnTable ); + if (/*CURSOR_TBLTEXT != eCursorType && CURSOR_SELECTION_IN_TABLE != eCursorType && */ + pTblNode && (&pTblNode->GetTable() != m_pOwnTable)) + { + // this is a foreign table + SwFrmFmt* pTableFmt = + static_cast(pTblNode->GetTable().GetFrmFmt()); + text::XTextTable *const pTable = + SwXTextTables::GetObject( *pTableFmt ); + xRef = static_cast( + static_cast(pTable)); + } + else + { + text::XText *const pText = m_xParentText.get(); + xRef = SwXParagraph::CreateXParagraph(*pUnoCrsr->GetDoc(), + *pStart->nNode.GetNode().GetTxtNode(), + static_cast(pText), nFirstContent, nLastContent); + } + } + + return xRef; } /*-- 10.12.98 11:52:14--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Any SwXParagraphEnumeration::nextElement(void) - throw( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException ) +uno::Any SAL_CALL SwXParagraphEnumeration::nextElement() +throw (container::NoSuchElementException, lang::WrappedTargetException, + uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - uno::Reference< XTextContent > aRef; - if (bFirstParagraph) + if (m_pImpl->m_bFirstParagraph) { - xNextPara = NextElement_Impl(); - bFirstParagraph = sal_False; + m_pImpl->m_xNextPara = m_pImpl->NextElement_Impl(); + m_pImpl->m_bFirstParagraph = false; } - aRef = xNextPara; - if (!aRef.is()) + const uno::Reference< text::XTextContent > xRef = m_pImpl->m_xNextPara; + if (!xRef.is()) + { throw container::NoSuchElementException(); - xNextPara = NextElement_Impl(); + } + m_pImpl->m_xNextPara = m_pImpl->NextElement_Impl(); - uno::Any aRet(&aRef, ::getCppuType((uno::Reference*)0)); + uno::Any aRet; + aRet <<= xRef; return aRet; } -void SwXParagraphEnumeration::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) -{ - ClientModify(this, pOld, pNew); -} /****************************************************************** * SwXTextRange @@ -1727,7 +1808,7 @@ uno::Reference< XEnumeration > SwXTextRange::createEnumeration(void) throw( Runt ::sw::mark::IMark const * const pBkmk = GetBookmark(); if(!pBkmk) throw RuntimeException(); const SwPosition& rPoint = pBkmk->GetMarkPos(); - SwUnoCrsr* pNewCrsr = pDoc->CreateUnoCrsr(rPoint, FALSE); + ::std::auto_ptr pNewCrsr(pDoc->CreateUnoCrsr(rPoint, sal_False)); if(pBkmk->IsExpanded() && pBkmk->GetOtherMarkPos() != rPoint) { pNewCrsr->SetMark(); @@ -1741,8 +1822,14 @@ uno::Reference< XEnumeration > SwXTextRange::createEnumeration(void) throw( Runt sal::static_int_cast< sal_IntPtr >( xTunnel->getSomething(SwXText::getUnoTunnelId()) )); } DBG_ASSERT(pParentText, "parent is not a SwXText"); - CursorType eSetType = RANGE_IN_CELL == eRangePosition ? CURSOR_SELECTION_IN_TABLE : CURSOR_SELECTION; - uno::Reference< XEnumeration > xRet = + if (!pParentText) + { + throw uno::RuntimeException(); + } + + const CursorType eSetType = (RANGE_IN_CELL == eRangePosition) + ? CURSOR_SELECTION_IN_TABLE : CURSOR_SELECTION; + const uno::Reference< XEnumeration > xRet = new SwXParagraphEnumeration(pParentText, pNewCrsr, eSetType); return xRet; } diff --git a/sw/source/core/unocore/unoredline.cxx b/sw/source/core/unocore/unoredline.cxx index 031f339773a2..9cfce5c31a62 100644 --- a/sw/source/core/unocore/unoredline.cxx +++ b/sw/source/core/unocore/unoredline.cxx @@ -198,7 +198,9 @@ uno::Reference SwXRedlineText::createEnumeration(void) vos::OGuard aGuard(Application::GetSolarMutex()); SwPaM aPam(aNodeIndex); aPam.Move(fnMoveForward, fnGoNode); - return new SwXParagraphEnumeration(this, *aPam.Start(), CURSOR_REDLINE); + ::std::auto_ptr pUnoCursor( + GetDoc()->CreateUnoCrsr(*aPam.Start(), sal_False)); + return new SwXParagraphEnumeration(this, pUnoCursor, CURSOR_REDLINE); } /* --------------------------------------------------------------------------- @@ -681,7 +683,9 @@ uno::Reference< container::XEnumeration > SwXRedline::createEnumeration(void) t { SwPaM aPam(*pNodeIndex); aPam.Move(fnMoveForward, fnGoNode); - xRet = new SwXParagraphEnumeration(this, *aPam.Start(), CURSOR_REDLINE); + ::std::auto_ptr pUnoCursor( + GetDoc()->CreateUnoCrsr(*aPam.Start(), sal_False)); + xRet = new SwXParagraphEnumeration(this, pUnoCursor, CURSOR_REDLINE); } return xRet; } diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index a6ad01ea7a4f..866c4979072e 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -1214,15 +1214,12 @@ uno::Reference< container::XEnumeration > SwXCell::createEnumeration(void) thro { const SwStartNode* pSttNd = pBox->GetSttNd(); SwPosition aPos(*pSttNd); - SwUnoCrsr* pUnoCrsr = GetDoc()->CreateUnoCrsr(aPos, sal_False); - pUnoCrsr->Move( fnMoveForward, fnGoNode ); + ::std::auto_ptr pUnoCursor( + GetDoc()->CreateUnoCrsr(aPos, sal_False)); + pUnoCursor->Move(fnMoveForward, fnGoNode); - SwXParagraphEnumeration *pEnum = new SwXParagraphEnumeration(this, pUnoCrsr, CURSOR_TBLTEXT); - const SwTableNode* pTblNode = pSttNd->FindTableNode(); - // remember table and start node for later travelling - // (used in export of tables in tables) - pEnum->SetOwnTable( &pTblNode->GetTable() ); - pEnum->SetOwnStartNode( pSttNd ); + SwXParagraphEnumeration *const pEnum = + new SwXParagraphEnumeration(this, pUnoCursor, CURSOR_TBLTEXT); aRef = pEnum; // // no Cursor in protected sections diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index 75eebe7047b2..8dadfc47cdf2 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -2412,9 +2412,10 @@ uno::Reference< container::XEnumeration > SwXBodyText::createEnumeration(void) { SwNode& rNode = GetDoc()->GetNodes().GetEndOfContent(); SwPosition aPos(rNode); - SwUnoCrsr* pUnoCrsr = GetDoc()->CreateUnoCrsr(aPos, sal_False); - pUnoCrsr->Move( fnMoveBackward, fnGoDoc ); - aRef = new SwXParagraphEnumeration(this, pUnoCrsr, CURSOR_BODY); + ::std::auto_ptr pUnoCursor( + GetDoc()->CreateUnoCrsr(aPos, sal_False)); + pUnoCursor->Move(fnMoveBackward, fnGoDoc); + aRef = new SwXParagraphEnumeration(this, pUnoCursor, CURSOR_BODY); } else { @@ -2653,9 +2654,11 @@ uno::Reference< container::XEnumeration > SwXHeadFootText::createEnumeration(vo const SwFmtCntnt& rFlyCntnt = pHeadFootFmt->GetCntnt(); const SwNode& rNode = rFlyCntnt.GetCntntIdx()->GetNode(); SwPosition aPos(rNode); - SwUnoCrsr* pUnoCrsr = GetDoc()->CreateUnoCrsr(aPos, sal_False); - pUnoCrsr->Move(fnMoveForward, fnGoNode); - aRef = new SwXParagraphEnumeration(this, pUnoCrsr, bIsHeader ? CURSOR_HEADER : CURSOR_FOOTER); + ::std::auto_ptr pUnoCursor( + GetDoc()->CreateUnoCrsr(aPos, sal_False)); + pUnoCursor->Move(fnMoveForward, fnGoNode); + aRef = new SwXParagraphEnumeration(this, pUnoCursor, + (bIsHeader) ? CURSOR_HEADER : CURSOR_FOOTER); } else { -- cgit v1.2.3 From 2fee7963e992089b67eeb2fb60da27054037da32 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:51 +0100 Subject: swunolocking1: #i105557#: fix locking for SwXTextSection: replace SwXTextSectionClient with Impl struct, use UnoImplPtr to lock dtor. move all implementation details out of header, into Impl struct. remove ugly destruction of SwUnoCrsr via Application::PostUserEvent. replace broken SwClient iteration with a WeakReference in SwSectionFmt. add factory function CreateXTextSection. use new XUnoTunnel and XServiceInfo helpers. clean up the implementation a little. --- sw/inc/frmfmt.hxx | 19 +- sw/inc/section.hxx | 20 + sw/inc/unosection.hxx | 102 +- sw/source/core/docnode/section.cxx | 5 + sw/source/core/layout/atrfrm.cxx | 5 + sw/source/core/unocore/unocoll.cxx | 13 +- sw/source/core/unocore/unosect.cxx | 2427 ++++++++++++++++++++---------------- sw/source/core/unocore/unotext.cxx | 20 +- 8 files changed, 1413 insertions(+), 1198 deletions(-) diff --git a/sw/inc/frmfmt.hxx b/sw/inc/frmfmt.hxx index a86b1c6689a0..61663d131aad 100644 --- a/sw/inc/frmfmt.hxx +++ b/sw/inc/frmfmt.hxx @@ -30,11 +30,14 @@ #ifndef _FRMFMT_HXX #define _FRMFMT_HXX -#include - // --> OD 2004-08-06 #i28749# #include // <-- + +#include + +#include + #include "swdllapi.h" class SwFlyFrm; @@ -51,8 +54,9 @@ class SW_DLLPUBLIC SwFrmFmt: public SwFmt { friend class SwDoc; friend class SwPageDesc; //darf den protected CTor rufen. -// friend class SwSwgReader; // der SW2-Reader auch! -// friend class Sw3IoImp; // der SW3-Reader auch! + + ::com::sun::star::uno::WeakReference< + ::com::sun::star::uno::XInterface> m_wXObject; protected: SwFrmFmt( SwAttrPool& rPool, const sal_Char* pFmtNm, @@ -136,6 +140,13 @@ public: virtual String GetDescription() const; + SW_DLLPRIVATE ::com::sun::star::uno::WeakReference< + ::com::sun::star::uno::XInterface> const& GetXObject() const + { return m_wXObject; } + SW_DLLPRIVATE void SetXObject(::com::sun::star::uno::Reference< + ::com::sun::star::uno::XInterface> const& xObject) + { m_wXObject = xObject; } + DECL_FIXEDMEMPOOL_NEWDEL_DLL(SwFrmFmt) }; diff --git a/sw/inc/section.hxx b/sw/inc/section.hxx index c530c8280870..3acd8cab16cb 100644 --- a/sw/inc/section.hxx +++ b/sw/inc/section.hxx @@ -41,6 +41,11 @@ #include #include + +namespace com { namespace sun { namespace star { + namespace text { class XTextSection; } +} } } + // Forward Deklaration class SwSectionFmt; class SwDoc; @@ -230,6 +235,13 @@ class SW_DLLPUBLIC SwSectionFmt : public SwFrmFmt { friend class SwDoc; + /** why does this exist in addition to the m_wXObject in SwFrmFmt? + in case of an index, both a SwXDocumentIndex and a SwXTextSection + register at this SwSectionFmt, so we need to have two refs. + */ + ::com::sun::star::uno::WeakReference< + ::com::sun::star::text::XTextSection> m_wXTextSection; + /* SW_DLLPUBLIC */ SwSection* _GetSection() const; SW_DLLPRIVATE void UpdateParent(); // Parent wurde veraendert @@ -271,6 +283,14 @@ public: // ist die Section eine gueltige fuers GlobalDocument? const SwSection* GetGlobalDocSection() const; + + SW_DLLPRIVATE ::com::sun::star::uno::WeakReference< + ::com::sun::star::text::XTextSection> const& GetXTextSection() const + { return m_wXTextSection; } + SW_DLLPRIVATE void SetXTextSection(::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextSection> const& xTextSection) + { m_wXTextSection = xTextSection; } + }; // -------------- inlines --------------------------------- diff --git a/sw/inc/unosection.hxx b/sw/inc/unosection.hxx index 31d15d7010d4..6f3eb1794c84 100644 --- a/sw/inc/unosection.hxx +++ b/sw/inc/unosection.hxx @@ -43,14 +43,9 @@ #include -#include -#include +#include -#include -#include - -class SfxItemPropertySet; class SwSectionFmt; @@ -58,51 +53,6 @@ class SwSectionFmt; --------------------------------------------------*/ -class SwXTextSection; - -class SwXTextSectionClient - : public SwClient -{ - -private: - - friend class SwXTextSection; - - SwXTextSection * m_pSection; - ::com::sun::star::uno::WeakReference< - ::com::sun::star::text::XTextSection > m_xReference; - - // SwClient - virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); - - SwXTextSectionClient( - SwSectionFmt& rFmt, - SwXTextSection& rTextSection, - ::com::sun::star::uno::Reference< - ::com::sun::star::text::XTextSection > xSection); - - virtual ~SwXTextSectionClient(); - - DECL_STATIC_LINK( SwXTextSectionClient, RemoveSectionClient_Impl, - SwXTextSectionClient* ); - -public: - - TYPEINFO(); - - ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextSection > - GetXTextSection(); - - static ::com::sun::star::uno::Reference< - ::com::sun::star::text::XTextSection > - CreateXTextSection(SwSectionFmt* pFmt = 0, BOOL bIndexHeader = FALSE); - static SwXTextSectionClient* Create( - SwXTextSection& rSection, - ::com::sun::star::uno::Reference< - ::com::sun::star::text::XTextSection > xSection, - SwSectionFmt& rFmt); -}; - struct SwTextSectionProperties_Impl; @@ -122,57 +72,21 @@ class SwXTextSection private: - friend class SwXTextSectionClient; - - SwEventListenerContainer aLstnrCntnr; - const SfxItemPropertySet* m_pPropSet; + class Impl; + ::sw::UnoImplPtr m_pImpl; - BOOL m_bIsDescriptor; - BOOL m_bIndexHeader; - String m_sName; - SwTextSectionProperties_Impl* pProps; - SwXTextSectionClient* m_pClient; - -protected: - - void SAL_CALL SetPropertyValues_Impl( - const ::com::sun::star::uno::Sequence< ::rtl::OUString >& - rPropertyNames, - const ::com::sun::star::uno::Sequence< - ::com::sun::star::uno::Any >& aValues) - throw (::com::sun::star::beans::UnknownPropertyException, - ::com::sun::star::beans::PropertyVetoException, - ::com::sun::star::lang::IllegalArgumentException, - ::com::sun::star::lang::WrappedTargetException, - ::com::sun::star::uno::RuntimeException); - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL - GetPropertyValues_Impl( - const ::com::sun::star::uno::Sequence< ::rtl::OUString >& - rPropertyNames) - throw (::com::sun::star::beans::UnknownPropertyException, - ::com::sun::star::lang::WrappedTargetException, - ::com::sun::star::uno::RuntimeException); - - SwXTextSection(sal_Bool bWithFormat, sal_Bool bIndexHeader = FALSE); + SwXTextSection(SwSectionFmt *const pFmt, const bool bIndexHeader = false); virtual ~SwXTextSection(); - void ResetClient() { m_pClient = 0; } - void SetClient(SwXTextSectionClient* pClient) { m_pClient = pClient; } - public: - void attachToRange( - const ::com::sun::star::uno::Reference< - ::com::sun::star::text::XTextRange > & xTextRange) - throw (::com::sun::star::lang::IllegalArgumentException, - ::com::sun::star::uno::RuntimeException); - SwSectionFmt* GetFmt() const; - static SwXTextSection* GetImplementation( - ::com::sun::star::uno::Reference< - ::com::sun::star::uno::XInterface> xRef); + static ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextSection > + CreateXTextSection(SwSectionFmt *const pFmt = 0, + const bool bIndexHeader = false); static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId(); diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx index 1a174d9d54de..46f494643f9e 100644 --- a/sw/source/core/docnode/section.cxx +++ b/sw/source/core/docnode/section.cxx @@ -835,6 +835,11 @@ void SwSectionFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) break; } SwFrmFmt::Modify( pOld, pNew ); + + if (pOld && (RES_REMOVE_UNO_OBJECT == pOld->Which())) + { // invalidate cached uno object + SetXTextSection(uno::Reference(0)); + } } // erfrage vom Format Informationen diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index f5963931f545..061826e764f0 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -2480,6 +2480,11 @@ void SwFrmFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) // wegen RESET_FMTWRITTEN. // if ( GetDepends() ) SwFmt::Modify( pOld, pNew ); + + if (pOld && (RES_REMOVE_UNO_OBJECT == pOld->Which())) + { // invalidate cached uno object + SetXObject(uno::Reference(0)); + } } //Vernichtet alle Frms, die in aDepend angemeldet sind. diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx index 87f96ba72346..079ba1fa0b95 100644 --- a/sw/source/core/unocore/unocoll.cxx +++ b/sw/source/core/unocore/unocoll.cxx @@ -447,7 +447,8 @@ uno::Reference< uno::XInterface > SwXServiceProvider::MakeInstance(sal_uInt16 break; case SW_SERVICE_INDEX_HEADER_SECTION : case SW_SERVICE_TEXT_SECTION : - xRet = SwXTextSectionClient::CreateXTextSection( 0, SW_SERVICE_INDEX_HEADER_SECTION == nObjectType); + xRet = SwXTextSection::CreateXTextSection(0, + (SW_SERVICE_INDEX_HEADER_SECTION == nObjectType)); break; case SW_SERVICE_REFERENCE_MARK : @@ -1473,15 +1474,7 @@ sal_Bool SwXTextSections::hasElements(void) throw( uno::RuntimeException ) -----------------------------------------------------------------------*/ uno::Reference< XTextSection > SwXTextSections::GetObject( SwSectionFmt& rFmt ) { - SwXTextSectionClient* pClient = (SwXTextSectionClient*)SwClientIter( rFmt ). - First( TYPE( SwXTextSectionClient )); - uno::Reference< XTextSection > xRet; - if( pClient ) - xRet = pClient->GetXTextSection(); - // it is possible that the client is still registered but the reference is already invalid - if( !xRet.is() ) - xRet = SwXTextSectionClient::CreateXTextSection(&rFmt); - return xRet; + return SwXTextSection::CreateXTextSection(&rFmt); } OUString SwXBookmarks::getImplementationName(void) throw( RuntimeException ) diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx index 9f599533eec9..c47a3aef1345 100644 --- a/sw/source/core/unocore/unosect.cxx +++ b/sw/source/core/unocore/unosect.cxx @@ -36,6 +36,7 @@ #include #include +#include #include #include #include @@ -71,182 +72,171 @@ using namespace ::com::sun::star; -using namespace ::com::sun::star::lang; -using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::text; -using namespace ::com::sun::star::container; -using namespace ::com::sun::star::beans; using ::rtl::OUString; -TYPEINIT1(SwXTextSectionClient, SwClient); -/*-- 20.12.2005 09:56:33--------------------------------------------------- +/****************************************************************** + * + ******************************************************************/ +struct SwTextSectionProperties_Impl +{ + uno::Sequence m_Password; + ::rtl::OUString m_sCondition; + ::rtl::OUString m_sLinkFileName; + ::rtl::OUString m_sSectionFilter; + ::rtl::OUString m_sSectionRegion; + + ::std::auto_ptr m_pColItem; + ::std::auto_ptr m_pBrushItem; + ::std::auto_ptr m_pFtnItem; + ::std::auto_ptr m_pEndItem; + ::std::auto_ptr m_pXMLAttr; + ::std::auto_ptr m_pNoBalanceItem; + ::std::auto_ptr m_pFrameDirItem; + ::std::auto_ptr m_pLRSpaceItem; // #109700# + + bool m_bDDE; + bool m_bHidden; + bool m_bCondHidden; + bool m_bProtect; + // --> FME 2004-06-22 #114856# edit in readonly sections + bool m_bEditInReadonly; + // <-- + bool m_bUpdateType; - -----------------------------------------------------------------------*/ -SwXTextSectionClient::SwXTextSectionClient( - SwSectionFmt& rFmt, - SwXTextSection& rTextSection, - uno::Reference< text::XTextSection > xSection ) : - SwClient(&rFmt), - m_pSection( &rTextSection ), - m_xReference( xSection ) + SwTextSectionProperties_Impl() + : m_bDDE(false) + , m_bHidden(false) + , m_bCondHidden(false) + , m_bProtect(false) + // --> FME 2004-06-22 #114856# edit in readonly sections + , m_bEditInReadonly(false) + // <-- + , m_bUpdateType(true) + { + } -{ - m_pSection->SetClient( this ); -} -/*-- 20.12.2005 09:56:33--------------------------------------------------- +}; - -----------------------------------------------------------------------*/ -SwXTextSectionClient::~SwXTextSectionClient() + +class SwXTextSection::Impl + : public SwClient { - uno::Reference< text::XTextSection > xSection( m_xReference ); - if(xSection.is()) + +public: + + SwXTextSection & m_rThis; + const SfxItemPropertySet & m_rPropSet; + SwEventListenerContainer m_ListenerContainer; + const bool m_bIndexHeader; + bool m_bIsDescriptor; + ::rtl::OUString m_sName; + ::std::auto_ptr m_pProps; + + Impl( SwXTextSection & rThis, + SwSectionFmt *const pFmt, const bool bIndexHeader) + : SwClient(pFmt) + , m_rThis(rThis) + , m_rPropSet(*aSwMapProvider.GetPropertySet(PROPERTY_MAP_SECTION)) + , m_ListenerContainer(static_cast< ::cppu::OWeakObject* >(&rThis)) + , m_bIndexHeader(bIndexHeader) + , m_bIsDescriptor(0 == pFmt) + , m_pProps((pFmt) ? 0 : new SwTextSectionProperties_Impl()) { - m_pSection->SetClient( 0 ); } -} -/*-- 20.12.2005 09:56:35--------------------------------------------------- - -----------------------------------------------------------------------*/ -uno::Reference< text::XTextSection > SwXTextSectionClient::GetXTextSection() -{ - return uno::Reference< text::XTextSection >( m_xReference ); -} + SwSectionFmt * GetSectionFmt() const + { + return static_cast(const_cast( + GetRegisteredIn())); + } -/*-- 29.12.2005 11:29:30--------------------------------------------------- + SwSectionFmt & GetSectionFmtOrThrow() const { + SwSectionFmt *const pFmt( GetSectionFmt() ); + if (!pFmt) { + throw uno::RuntimeException(OUString(RTL_CONSTASCII_USTRINGPARAM( + "SwXTextSection: disposed or invalid")), 0); + } + return *pFmt; + } - -----------------------------------------------------------------------*/ -/*SwXTextSection* SwXTextSectionClient::GetSwTextSection() -{ - if( m_xReference.is() ) - return m_pSection;; -} */ + void SAL_CALL SetPropertyValues_Impl( + const uno::Sequence< ::rtl::OUString >& rPropertyNames, + const uno::Sequence< uno::Any >& aValues) + throw (beans::UnknownPropertyException, beans::PropertyVetoException, + lang::IllegalArgumentException, lang::WrappedTargetException, + uno::RuntimeException); + uno::Sequence< uno::Any > SAL_CALL + GetPropertyValues_Impl( + const uno::Sequence< ::rtl::OUString >& rPropertyNames) + throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException); + + // SwClient + virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + +}; /*-- 10.12.98 14:42:52--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXTextSectionClient::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) +void SwXTextSection::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew) { - if(pOld && pOld->Which() == RES_REMOVE_UNO_OBJECT && - (void*)GetRegisteredIn() == ((SwPtrMsgPoolItem *)pOld)->pObject ) - ((SwModify*)GetRegisteredIn())->Remove(this); - else - ClientModify(this, pOld, pNew); - if(!GetRegisteredIn()) + ClientModify(this, pOld, pNew); + if (!GetRegisteredIn()) { - uno::Reference< text::XTextSection > xSection( m_xReference ); - if(xSection.is()) - { - m_pSection->SetClient( 0 ); - m_pSection->aLstnrCntnr.Disposing(); - m_xReference = uno::Reference< text::XTextSection >(); - - Application::PostUserEvent( - STATIC_LINK( this, SwXTextSectionClient, RemoveSectionClient_Impl ), this ); - } + m_ListenerContainer.Disposing(); } } -/*-- 29.12.2005 13:04:57--------------------------------------------------- +/*-- 20.12.2005 10:27:33--------------------------------------------------- -----------------------------------------------------------------------*/ -IMPL_STATIC_LINK_NOINSTANCE( SwXTextSectionClient, RemoveSectionClient_Impl, - SwXTextSectionClient*, pClient ) +SwSectionFmt * SwXTextSection::GetFmt() const { - delete pClient; - return 0; + return m_pImpl->GetSectionFmt(); } /*-- 20.12.2005 09:56:36--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Reference< text::XTextSection > SwXTextSectionClient::CreateXTextSection( - SwSectionFmt* pFmt, BOOL bIndexHeader ) +uno::Reference< text::XTextSection > +SwXTextSection::CreateXTextSection( + SwSectionFmt *const pFmt, const bool bIndexHeader) { - SwXTextSection* pNew; - uno::Reference< text::XTextSection > xSection = pNew = new SwXTextSection( pFmt != 0, bIndexHeader ); - if(pFmt) - new SwXTextSectionClient( *pFmt, *pNew, xSection ); + // re-use existing SwXTextSection + // #i105557#: do not iterate over the registered clients: race condition + uno::Reference< text::XTextSection > xSection; + if (pFmt) + { + xSection.set(pFmt->GetXTextSection()); + } + if ( !xSection.is() ) + { + SwXTextSection *const pNew = new SwXTextSection(pFmt, bIndexHeader); + xSection.set(pNew); + if (pFmt) + { + pFmt->SetXTextSection(xSection); + } + } return xSection; } -/*-- 29.12.2005 10:23:37--------------------------------------------------- +/*-- 10.12.98 14:47:05--------------------------------------------------- -----------------------------------------------------------------------*/ -SwXTextSectionClient* SwXTextSectionClient::Create(SwXTextSection& rSection, - uno::Reference< text::XTextSection >xSection, SwSectionFmt& rFmt ) +SwXTextSection::SwXTextSection( + SwSectionFmt *const pFmt, const bool bIndexHeader) + : m_pImpl( new SwXTextSection::Impl(*this, pFmt, bIndexHeader) ) { - return new SwXTextSectionClient( rFmt, rSection, xSection ); } -/****************************************************************** - * - ******************************************************************/ -struct SwTextSectionProperties_Impl -{ - - String sCondition; - String sLinkFileName; - String sSectionFilter; - String sSectionRegion; - uno::Sequence aPassword; - - SwFmtCol* pColItem; - SvxBrushItem* pBrushItem; - SwFmtFtnAtTxtEnd* pFtnItem; - SwFmtEndAtTxtEnd* pEndItem; - SvXMLAttrContainerItem *pXMLAttr; - SwFmtNoBalancedColumns *pNoBalanceItem; - SvxFrameDirectionItem *pFrameDirItem; - SvxLRSpaceItem *pLRSpaceItem; // #109700# - sal_Bool bDDE; - sal_Bool bHidden; - sal_Bool bCondHidden; - sal_Bool bProtect; - // --> FME 2004-06-22 #114856# edit in readonly sections - sal_Bool bEditInReadonly; - // <-- - sal_Bool bUpdateType; - - SwTextSectionProperties_Impl() : - pColItem(0), - pBrushItem(0), - pFtnItem(0), - pEndItem(0), - pXMLAttr(0), - pNoBalanceItem(0), - pFrameDirItem(0), - pLRSpaceItem(0), // #109700# - bDDE(0), - bHidden(0), - bCondHidden(0), - bProtect(0), - // --> FME 2004-06-22 #114856# edit in readonly sections - bEditInReadonly(0), - // <-- - bUpdateType(sal_True){} - ~SwTextSectionProperties_Impl() - { - delete pColItem; - delete pBrushItem; - delete pFtnItem; - delete pEndItem; - delete pXMLAttr; - delete pNoBalanceItem; - delete pFrameDirItem; - delete pLRSpaceItem; // #109700# - } -}; -/* -----------------------------11.07.00 12:10-------------------------------- +/*-- 10.12.98 14:47:07--------------------------------------------------- - ---------------------------------------------------------------------------*/ -SwXTextSection* SwXTextSection::GetImplementation(uno::Reference< XInterface> xRef ) + -----------------------------------------------------------------------*/ +SwXTextSection::~SwXTextSection() { - uno::Reference xTunnel( xRef, uno::UNO_QUERY); - if(xTunnel.is()) - return reinterpret_cast< SwXTextSection * >( - sal::static_int_cast< sal_IntPtr >( xTunnel->getSomething(SwXTextSection::getUnoTunnelId()) )); - return 0; } /* -----------------------------13.03.00 12:15-------------------------------- @@ -260,258 +250,230 @@ const uno::Sequence< sal_Int8 > & SwXTextSection::getUnoTunnelId() /* -----------------------------10.03.00 18:04-------------------------------- ---------------------------------------------------------------------------*/ -sal_Int64 SAL_CALL SwXTextSection::getSomething( const uno::Sequence< sal_Int8 >& rId ) - throw(uno::RuntimeException) -{ - if( rId.getLength() == 16 - && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), - rId.getConstArray(), 16 ) ) - { - return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >( this ) ); - } - return 0; -} -/*-- 10.12.98 14:47:05--------------------------------------------------- - - -----------------------------------------------------------------------*/ -SwXTextSection::SwXTextSection(sal_Bool bWithFormat, sal_Bool bIndexHeader) : -// SwClient(pFmt), - aLstnrCntnr( (text::XTextContent*)this), - m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_SECTION)), - m_bIsDescriptor(!bWithFormat), - m_bIndexHeader(bIndexHeader), - pProps(bWithFormat ? 0 : new SwTextSectionProperties_Impl()), - m_pClient( 0 ) +sal_Int64 SAL_CALL +SwXTextSection::getSomething(const uno::Sequence< sal_Int8 >& rId) +throw (uno::RuntimeException) { - + return ::sw::UnoTunnelImpl(rId, this); } -/*-- 10.12.98 14:47:07--------------------------------------------------- - -----------------------------------------------------------------------*/ -SwXTextSection::~SwXTextSection() -{ - vos::OGuard aGuard(Application::GetSolarMutex()); - delete m_pClient; - delete pProps; -} /*-- 10.12.98 14:47:08--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Reference< text::XTextSection > SwXTextSection::getParentSection(void) throw( uno::RuntimeException ) +uno::Reference< text::XTextSection > SAL_CALL +SwXTextSection::getParentSection() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - uno::Reference< text::XTextSection > aRef; - SwSectionFmt* pSectFmt = GetFmt(); - if(pSectFmt) - { - SwSectionFmt* pParentFmt = pSectFmt->GetParent(); - if(pParentFmt) - { - SwXTextSectionClient* pClient = (SwXTextSectionClient*)SwClientIter(*pParentFmt). - First(TYPE(SwXTextSectionClient)); - if(pClient) - aRef = pClient->GetXTextSection(); - else - aRef = SwXTextSectionClient::CreateXTextSection(pParentFmt); - } - } - else - throw uno::RuntimeException(); - return aRef; + + SwSectionFmt & rSectionFmt( m_pImpl->GetSectionFmtOrThrow() ); + + SwSectionFmt *const pParentFmt = rSectionFmt.GetParent(); + const uno::Reference< text::XTextSection > xRet = + (pParentFmt) ? CreateXTextSection(pParentFmt) : 0; + return xRet; } + /*-- 10.12.98 14:47:08--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Sequence< uno::Reference< text::XTextSection > > SwXTextSection::getChildSections(void) - throw( uno::RuntimeException ) +uno::Sequence< uno::Reference< text::XTextSection > > SAL_CALL +SwXTextSection::getChildSections() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - uno::Sequence > aSeq; - SwSectionFmt* pSectFmt = GetFmt(); - if(pSectFmt) - { - SwSections aChildren; - pSectFmt->GetChildSections(aChildren, SORTSECT_NOT, sal_False); - aSeq.realloc(aChildren.Count()); - uno::Reference< text::XTextSection > * pArray = aSeq.getArray(); - for(sal_uInt16 i = 0; i < aChildren.Count(); i++) - { - SwSectionFmt* pChild = aChildren.GetObject(i)->GetFmt(); - SwXTextSectionClient* pClient = (SwXTextSectionClient*)SwClientIter(*pChild). - First(TYPE(SwXTextSectionClient)); - if(pClient) - pArray[i] = pClient->GetXTextSection(); - else - pArray[i] = SwXTextSectionClient::CreateXTextSection(pChild); - } + SwSectionFmt & rSectionFmt( m_pImpl->GetSectionFmtOrThrow() ); + + SwSections aChildren; + rSectionFmt.GetChildSections(aChildren, SORTSECT_NOT, sal_False); + uno::Sequence > aSeq(aChildren.Count()); + uno::Reference< text::XTextSection > * pArray = aSeq.getArray(); + for (sal_uInt16 i = 0; i < aChildren.Count(); i++) + { + SwSectionFmt *const pChild = aChildren.GetObject(i)->GetFmt(); + pArray[i] = CreateXTextSection(pChild); } return aSeq; - } + /* -----------------18.02.99 13:31------------------- * * --------------------------------------------------*/ -void SwXTextSection::attachToRange(const uno::Reference< text::XTextRange > & xTextRange) - throw( lang::IllegalArgumentException, uno::RuntimeException ) +void SAL_CALL +SwXTextSection::attach(const uno::Reference< text::XTextRange > & xTextRange) +throw (lang::IllegalArgumentException, uno::RuntimeException) { - if(!m_bIsDescriptor) + vos::OGuard g(Application::GetSolarMutex()); + + if (!m_pImpl->m_bIsDescriptor) + { throw uno::RuntimeException(); + } uno::Reference xRangeTunnel( xTextRange, uno::UNO_QUERY); SwXTextRange* pRange = 0; OTextCursorHelper* pCursor = 0; if(xRangeTunnel.is()) { - pRange = reinterpret_cast< SwXTextRange * >( - sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( SwXTextRange::getUnoTunnelId()) )); - pCursor = reinterpret_cast< OTextCursorHelper * >( - sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( OTextCursorHelper::getUnoTunnelId()) )); + pRange = ::sw::UnoTunnelGetImplementation(xRangeTunnel); + pCursor = + ::sw::UnoTunnelGetImplementation(xRangeTunnel); } - SwDoc* pDoc = pRange ? (SwDoc*)pRange->GetDoc() : pCursor ? (SwDoc*)pCursor->GetDoc() : 0; - if(pDoc) + SwDoc *const pDoc = + (pRange) ? pRange->GetDoc() : ((pCursor) ? pCursor->GetDoc() : 0); + if (!pDoc) { - SwUnoInternalPaM aPam(*pDoc); - //das muss jetzt sal_True liefern - SwXTextRange::XTextRangeToSwPaM(aPam, xTextRange); - UnoActionContext aCont(pDoc); - pDoc->StartUndo( UNDO_INSSECTION, NULL ); - - SwSection* pRet = 0; - if(!m_sName.Len()) - m_sName = C2S("TextSection"); - SectionType eType = pProps->bDDE ? DDE_LINK_SECTION : - pProps->sLinkFileName.Len() || pProps->sSectionRegion.Len() ? FILE_LINK_SECTION : - CONTENT_SECTION; - // index header section? - if(m_bIndexHeader) + throw lang::IllegalArgumentException(); + } + + SwUnoInternalPaM aPam(*pDoc); + //das muss jetzt sal_True liefern + SwXTextRange::XTextRangeToSwPaM(aPam, xTextRange); + UnoActionContext aCont(pDoc); + pDoc->StartUndo( UNDO_INSSECTION, NULL ); + + if (!m_pImpl->m_sName.getLength()) + { + m_pImpl->m_sName = C2U("TextSection"); + } + SectionType eType = (m_pImpl->m_pProps->m_bDDE) + ? DDE_LINK_SECTION + : ((m_pImpl->m_pProps->m_sLinkFileName.getLength() || + m_pImpl->m_pProps->m_sSectionRegion.getLength()) + ? FILE_LINK_SECTION : CONTENT_SECTION); + // index header section? + if (m_pImpl->m_bIndexHeader) + { + // caller wants an index header section, but will only + // give him one if a) we are inside an index, and b) said + // index doesn't yet have a header section. + const SwTOXBase* pBase = aPam.GetDoc()->GetCurTOX(*aPam.Start()); + + // are we inside an index? + if (pBase) { - // caller wants an index header section, but will only - // give him one if a) we are inside an index, and b) said - // index doesn't yet have a header section. - const SwTOXBase* pBase = aPam.GetDoc()->GetCurTOX( - *aPam.Start() ); - - // are we inside an index? - if (pBase) + // get all child sections + SwSections aSectionsArr; + static_cast(pBase)->GetFmt()-> + GetChildSections(aSectionsArr); + + // and search for current header section + const sal_uInt16 nCount = aSectionsArr.Count(); + sal_Bool bHeaderPresent = sal_False; + for(sal_uInt16 i = 0; i < nCount; i++) { - // get all child sections - SwSections aSectionsArr; - ((SwTOXBaseSection*)pBase)->GetFmt()-> - GetChildSections(aSectionsArr); - - // and search for current header section - sal_uInt16 nCount = aSectionsArr.Count(); - sal_Bool bHeaderPresent = sal_False; - for(sal_uInt16 i = 0; i < nCount; i++) - { - bHeaderPresent |= - (aSectionsArr[i]->GetType() == TOX_HEADER_SECTION); - } - if (! bHeaderPresent) - { - eType = TOX_HEADER_SECTION; - } + bHeaderPresent |= + (aSectionsArr[i]->GetType() == TOX_HEADER_SECTION); + } + if (! bHeaderPresent) + { + eType = TOX_HEADER_SECTION; } } + } - SwSection aSect(eType, pDoc->GetUniqueSectionName(&m_sName)); - aSect.SetCondition(pProps->sCondition); - String sLinkName(pProps->sLinkFileName); - sLinkName += sfx2::cTokenSeperator; - sLinkName += pProps->sSectionFilter; - sLinkName += sfx2::cTokenSeperator; - sLinkName += pProps->sSectionRegion; - aSect.SetLinkFileName(sLinkName); - - aSect.SetHidden(pProps->bHidden); - aSect.SetProtect(pProps->bProtect); - // --> FME 2004-06-22 #114856# edit in readonly sections - aSect.SetEditInReadonly(pProps->bEditInReadonly); - // <-- + String tmp(m_pImpl->m_sName); + SwSection aSect(eType, pDoc->GetUniqueSectionName(&tmp)); + aSect.SetCondition(m_pImpl->m_pProps->m_sCondition); + ::rtl::OUStringBuffer sLinkNameBuf(m_pImpl->m_pProps->m_sLinkFileName); + sLinkNameBuf.append(sfx2::cTokenSeperator); + sLinkNameBuf.append(m_pImpl->m_pProps->m_sSectionFilter); + sLinkNameBuf.append(sfx2::cTokenSeperator); + sLinkNameBuf.append(m_pImpl->m_pProps->m_sSectionRegion); + aSect.SetLinkFileName(sLinkNameBuf.makeStringAndClear()); + + aSect.SetHidden(m_pImpl->m_pProps->m_bHidden); + aSect.SetProtect(m_pImpl->m_pProps->m_bProtect); + // --> FME 2004-06-22 #114856# edit in readonly sections + aSect.SetEditInReadonly(m_pImpl->m_pProps->m_bEditInReadonly); + // <-- - SfxItemSet aSet(pDoc->GetAttrPool(), - RES_COL, RES_COL, - RES_BACKGROUND, RES_BACKGROUND, - RES_FTN_AT_TXTEND, RES_FRAMEDIR, - RES_LR_SPACE, RES_LR_SPACE, // #109700# - RES_UNKNOWNATR_CONTAINER,RES_UNKNOWNATR_CONTAINER, - 0); - if(pProps->pBrushItem) - aSet.Put(*pProps->pBrushItem); - if(pProps->pColItem) - aSet.Put(*pProps->pColItem); - if(pProps->pFtnItem) - aSet.Put(*pProps->pFtnItem); - if(pProps->pEndItem) - aSet.Put(*pProps->pEndItem); - if(pProps->pXMLAttr) - aSet.Put(*pProps->pXMLAttr); - if(pProps->pNoBalanceItem) - aSet.Put(*pProps->pNoBalanceItem); - if(pProps->pFrameDirItem) - aSet.Put(*pProps->pFrameDirItem); - /* #109700# */ - if(pProps->pLRSpaceItem) - aSet.Put(*pProps->pLRSpaceItem); - - // section password - if (pProps->aPassword.getLength() > 0) - aSect.SetPasswd(pProps->aPassword); - - pRet = pDoc->InsertSwSection( aPam, aSect, aSet.Count() ? &aSet : 0 ); - // now create the client - m_refCount++; - // keep block to remove Reference before the refcount is decremented - { - uno::Reference< text::XTextSection> xSection( this ); - m_pClient = SwXTextSectionClient::Create(*this, xSection, *pRet->GetFmt()); - } - m_refCount--; + SfxItemSet aSet(pDoc->GetAttrPool(), + RES_COL, RES_COL, + RES_BACKGROUND, RES_BACKGROUND, + RES_FTN_AT_TXTEND, RES_FRAMEDIR, + RES_LR_SPACE, RES_LR_SPACE, // #109700# + RES_UNKNOWNATR_CONTAINER,RES_UNKNOWNATR_CONTAINER, + 0); + if (m_pImpl->m_pProps->m_pBrushItem.get()) + { + aSet.Put(*m_pImpl->m_pProps->m_pBrushItem); + } + if (m_pImpl->m_pProps->m_pColItem.get()) + { + aSet.Put(*m_pImpl->m_pProps->m_pColItem); + } + if (m_pImpl->m_pProps->m_pFtnItem.get()) + { + aSet.Put(*m_pImpl->m_pProps->m_pFtnItem); + } + if (m_pImpl->m_pProps->m_pEndItem.get()) + { + aSet.Put(*m_pImpl->m_pProps->m_pEndItem); + } + if (m_pImpl->m_pProps->m_pXMLAttr.get()) + { + aSet.Put(*m_pImpl->m_pProps->m_pXMLAttr); + } + if (m_pImpl->m_pProps->m_pNoBalanceItem.get()) + { + aSet.Put(*m_pImpl->m_pProps->m_pNoBalanceItem); + } + if (m_pImpl->m_pProps->m_pFrameDirItem.get()) + { + aSet.Put(*m_pImpl->m_pProps->m_pFrameDirItem); + } + /* #109700# */ + if (m_pImpl->m_pProps->m_pLRSpaceItem.get()) + { + aSet.Put(*m_pImpl->m_pProps->m_pLRSpaceItem); + } + // section password + if (m_pImpl->m_pProps->m_Password.getLength() > 0) + { + aSect.SetPasswd(m_pImpl->m_pProps->m_Password); + } - // #97450# XML import must hide sections depending on their old - // condition status - if( pProps->sCondition.Len() != 0 ) - pRet->SetCondHidden(pProps->bCondHidden); + SwSection *const pRet = + pDoc->InsertSwSection( aPam, aSect, aSet.Count() ? &aSet : 0 ); + pRet->GetFmt()->Add(m_pImpl.get()); + pRet->GetFmt()->SetXObject(static_cast< ::cppu::OWeakObject*>(this)); - // set update type if DDE link (and connect, if necessary) - if (pProps->bDDE) + // #97450# XML import must hide sections depending on their old + // condition status + if (m_pImpl->m_pProps->m_sCondition.getLength() != 0) + { + pRet->SetCondHidden(m_pImpl->m_pProps->m_bCondHidden); + } + + // set update type if DDE link (and connect, if necessary) + if (m_pImpl->m_pProps->m_bDDE) + { + if (! pRet->IsConnected()) { - if (! pRet->IsConnected()) - { - pRet->CreateLink(CREATE_CONNECT); - } - pRet->SetUpdateType( static_cast< USHORT >(pProps->bUpdateType ? - sfx2::LINKUPDATE_ALWAYS : sfx2::LINKUPDATE_ONCALL) ); + pRet->CreateLink(CREATE_CONNECT); } - - // Undo-Klammerung hier beenden - pDoc->EndUndo( UNDO_INSSECTION, NULL ); - DELETEZ(pProps); - m_bIsDescriptor = sal_False; + pRet->SetUpdateType( static_cast< USHORT >( + (m_pImpl->m_pProps->m_bUpdateType) ? + sfx2::LINKUPDATE_ALWAYS : sfx2::LINKUPDATE_ONCALL) ); } - else - throw lang::IllegalArgumentException(); -} -/*-- 10.12.98 14:47:09--------------------------------------------------- - -----------------------------------------------------------------------*/ -void SwXTextSection::attach(const uno::Reference< text::XTextRange > & xTextRange) - throw( lang::IllegalArgumentException, uno::RuntimeException ) -{ - vos::OGuard aGuard(Application::GetSolarMutex()); - attachToRange( xTextRange ); + // Undo-Klammerung hier beenden + pDoc->EndUndo( UNDO_INSSECTION, NULL ); + m_pImpl->m_pProps.reset(); + m_pImpl->m_bIsDescriptor = false; } /*-- 10.12.98 14:47:09--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Reference< text::XTextRange > SwXTextSection::getAnchor(void) throw( uno::RuntimeException ) +uno::Reference< text::XTextRange > SAL_CALL +SwXTextSection::getAnchor() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); + uno::Reference< text::XTextRange > xRet; - SwSectionFmt* pSectFmt = GetFmt(); + SwSectionFmt *const pSectFmt = m_pImpl->GetSectionFmt(); if(pSectFmt) { const SwSection* pSect; @@ -535,677 +497,858 @@ uno::Reference< text::XTextRange > SwXTextSection::getAnchor(void) throw( uno:: /*-- 10.12.98 14:47:09--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXTextSection::dispose(void) throw( uno::RuntimeException ) +void SAL_CALL SwXTextSection::dispose() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - SwSectionFmt* pSectFmt = GetFmt(); - if(pSectFmt) + + SwSectionFmt *const pSectFmt = m_pImpl->GetSectionFmt(); + if (pSectFmt) + { pSectFmt->GetDoc()->DelSectionFmt( pSectFmt ); - else - throw uno::RuntimeException(); + } } /*-- 10.12.98 14:47:10--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXTextSection::addEventListener(const uno::Reference< lang::XEventListener > & aListener) - throw( uno::RuntimeException ) +void SAL_CALL SwXTextSection::addEventListener( + const uno::Reference< lang::XEventListener > & xListener) +throw (uno::RuntimeException) { - if(!GetFmt()) + vos::OGuard g(Application::GetSolarMutex()); + + if (!m_pImpl->GetSectionFmt()) + { throw uno::RuntimeException(); - aLstnrCntnr.AddListener(aListener); + } + m_pImpl->m_ListenerContainer.AddListener(xListener); } /*-- 10.12.98 14:47:10--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXTextSection::removeEventListener(const uno::Reference< lang::XEventListener > & aListener) - throw( uno::RuntimeException ) +void SAL_CALL SwXTextSection::removeEventListener( + const uno::Reference< lang::XEventListener > & xListener) +throw (uno::RuntimeException) { - if(!GetFmt() || !aLstnrCntnr.RemoveListener(aListener)) + vos::OGuard g(Application::GetSolarMutex()); + + if (!m_pImpl->GetSectionFmt() || + !m_pImpl->m_ListenerContainer.RemoveListener(xListener)) + { throw uno::RuntimeException(); + } } /*-- 10.12.98 14:47:11--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Reference< beans::XPropertySetInfo > SwXTextSection::getPropertySetInfo(void) throw( uno::RuntimeException ) +uno::Reference< beans::XPropertySetInfo > SAL_CALL +SwXTextSection::getPropertySetInfo() throw (uno::RuntimeException) { - static uno::Reference< beans::XPropertySetInfo > aRef = m_pPropSet->getPropertySetInfo(); + vos::OGuard g(Application::GetSolarMutex()); + + static const uno::Reference< beans::XPropertySetInfo > aRef = + m_pImpl->m_rPropSet.getPropertySetInfo(); return aRef; } -/* -----------------------------12.02.01 10:29-------------------------------- - ---------------------------------------------------------------------------*/ -struct SwSectItemSet_Impl -{ - - SfxItemSet* pItemSet; - SwSectItemSet_Impl() : - pItemSet(0){} - ~SwSectItemSet_Impl() - {delete pItemSet;} -}; /* -----------------------------12.02.01 10:45-------------------------------- ---------------------------------------------------------------------------*/ -void SAL_CALL SwXTextSection::SetPropertyValues_Impl( +void SwXTextSection::Impl::SetPropertyValues_Impl( const uno::Sequence< OUString >& rPropertyNames, - const uno::Sequence< Any >& rValues ) - throw( UnknownPropertyException, PropertyVetoException, IllegalArgumentException, - WrappedTargetException, RuntimeException) + const uno::Sequence< uno::Any >& rValues) +throw (beans::UnknownPropertyException, beans::PropertyVetoException, + lang::IllegalArgumentException, lang::WrappedTargetException, + uno::RuntimeException) { - SwSectionFmt* pFmt = GetFmt(); if(rPropertyNames.getLength() != rValues.getLength()) - throw IllegalArgumentException(); - if(pFmt || m_bIsDescriptor) { - SwSection aSection(CONTENT_SECTION, aEmptyStr); - SwSection* pSect = pFmt ? pFmt->GetSection() : 0; - if(pFmt) - aSection = *pSect; - const OUString* pPropertyNames = rPropertyNames.getConstArray(); - const Any* pValues = rValues.getConstArray(); - SwSectItemSet_Impl aItemSet; - - sal_Bool bLinkModeChanged = sal_False; - sal_Bool bLinkMode = sal_False; - for(sal_Int16 nProperty = 0; nProperty < rPropertyNames.getLength(); nProperty++) + throw lang::IllegalArgumentException(); + } + SwSectionFmt *const pFmt = GetSectionFmt(); + if (!pFmt && !m_bIsDescriptor) + { + throw uno::RuntimeException(); + } + + SwSection aSection(CONTENT_SECTION, aEmptyStr); + SwSection *const pSect = (pFmt) ? pFmt->GetSection() : 0; + if (pFmt) + { + aSection = *pSect; + } + OUString const*const pPropertyNames = rPropertyNames.getConstArray(); + uno::Any const*const pValues = rValues.getConstArray(); + ::std::auto_ptr pItemSet; + sal_Bool bLinkModeChanged = sal_False; + sal_Bool bLinkMode = sal_False; + + for (sal_Int32 nProperty = 0; nProperty < rPropertyNames.getLength(); + nProperty++) + { + SfxItemPropertySimpleEntry const*const pEntry = + m_rPropSet.getPropertyMap()->getByName(pPropertyNames[nProperty]); + if (!pEntry) { - const SfxItemPropertySimpleEntry* pEntry = - m_pPropSet->getPropertyMap()->getByName( pPropertyNames[nProperty] ); - if(!pEntry) - throw UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + pPropertyNames[nProperty], static_cast < cppu::OWeakObject * > ( this ) ); - else + throw beans::UnknownPropertyException( + OUString(RTL_CONSTASCII_USTRINGPARAM("Unknown property: ")) + + pPropertyNames[nProperty], + static_cast(& m_rThis)); + } + if (pEntry->nFlags & beans::PropertyAttribute::READONLY) + { + throw beans::PropertyVetoException( + OUString(RTL_CONSTASCII_USTRINGPARAM("Property is read-only: ")) + + pPropertyNames[nProperty], + static_cast(& m_rThis)); + } + switch (pEntry->nWID) + { + case WID_SECT_CONDITION: + { + OUString uTmp; + pValues[nProperty] >>= uTmp; + if (m_bIsDescriptor) + { + m_pProps->m_sCondition = uTmp; + } + else + { + aSection.SetCondition(uTmp); + } + } + break; + case WID_SECT_DDE_TYPE: + case WID_SECT_DDE_FILE: + case WID_SECT_DDE_ELEMENT: { - if ( pEntry->nFlags & PropertyAttribute::READONLY) - throw PropertyVetoException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only: " ) ) + pPropertyNames[nProperty], static_cast < cppu::OWeakObject * > ( this ) ); - switch(pEntry->nWID) + OUString uTmp; + pValues[nProperty] >>= uTmp; + String sTmp(uTmp); + if (m_bIsDescriptor) { - case WID_SECT_CONDITION: + if (!m_pProps->m_bDDE) { - OUString uTmp; - pValues[nProperty] >>= uTmp; - if(m_bIsDescriptor) - pProps->sCondition = String(uTmp); - else - aSection.SetCondition(uTmp); + ::rtl::OUStringBuffer buf; + buf.append(sfx2::cTokenSeperator); + buf.append(sfx2::cTokenSeperator); + m_pProps->m_sLinkFileName = buf.makeStringAndClear(); + m_pProps->m_bDDE = true; + } + String sLinkFileName(m_pProps->m_sLinkFileName); + sLinkFileName.SetToken(pEntry->nWID - WID_SECT_DDE_TYPE, + sfx2::cTokenSeperator, sTmp); + m_pProps->m_sLinkFileName = sLinkFileName; + } + else + { + String sLinkFileName(aSection.GetLinkFileName()); + if (aSection.GetType() != DDE_LINK_SECTION) + { + sLinkFileName = sfx2::cTokenSeperator; + sLinkFileName += sfx2::cTokenSeperator; + aSection.SetType(DDE_LINK_SECTION); + } + sLinkFileName.SetToken(pEntry->nWID - WID_SECT_DDE_TYPE, + sfx2::cTokenSeperator, sTmp); + aSection.SetLinkFileName(sLinkFileName); + } + } + break; + case WID_SECT_DDE_AUTOUPDATE: + { + sal_Bool bVal(sal_False); + if (!(pValues[nProperty] >>= bVal)) + { + throw lang::IllegalArgumentException(); + } + if (m_bIsDescriptor) + { + m_pProps->m_bUpdateType = bVal; + } + else + { + bLinkModeChanged = sal_True; + bLinkMode = bVal; + } + } + break; + case WID_SECT_LINK: + { + text::SectionFileLink aLink; + if (!(pValues[nProperty] >>= aLink)) + { + throw lang::IllegalArgumentException(); + } + if (m_bIsDescriptor) + { + m_pProps->m_bDDE = sal_False; + m_pProps->m_sLinkFileName = aLink.FileURL; + m_pProps->m_sSectionFilter = aLink.FilterName; + } + else + { + if (aSection.GetType() != FILE_LINK_SECTION && + aLink.FileURL.getLength()) + { + aSection.SetType(FILE_LINK_SECTION); + } + ::rtl::OUStringBuffer sFileNameBuf; + if (aLink.FileURL.getLength()) + { + sFileNameBuf.append( URIHelper::SmartRel2Abs( + pFmt->GetDoc()->GetDocShell()->GetMedium() + ->GetURLObject(), + aLink.FileURL, URIHelper::GetMaybeFileHdl())); } - break; - case WID_SECT_DDE_TYPE : - case WID_SECT_DDE_FILE : - case WID_SECT_DDE_ELEMENT : + sFileNameBuf.append(sfx2::cTokenSeperator); + sFileNameBuf.append(aLink.FilterName); + sFileNameBuf.append(sfx2::cTokenSeperator); + sFileNameBuf.append( + aSection.GetLinkFileName().GetToken(2, + sfx2::cTokenSeperator)); + const ::rtl::OUString sFileName( + sFileNameBuf.makeStringAndClear()); + aSection.SetLinkFileName(sFileName); + if (sFileName.getLength() < 3) { - OUString uTmp; - pValues[nProperty] >>= uTmp; - String sTmp(uTmp); - if(m_bIsDescriptor) + aSection.SetType(CONTENT_SECTION); + } + } + } + break; + case WID_SECT_REGION: + { + OUString sLink; + pValues[nProperty] >>= sLink; + if (m_bIsDescriptor) + { + m_pProps->m_bDDE = sal_False; + m_pProps->m_sSectionRegion = sLink; + } + else + { + if (aSection.GetType() != FILE_LINK_SECTION && + sLink.getLength()) + { + aSection.SetType(FILE_LINK_SECTION); + } + String sSectLink(aSection.GetLinkFileName()); + while (3 < sSectLink.GetTokenCount(sfx2::cTokenSeperator)) + { + sSectLink += sfx2::cTokenSeperator; + } + sSectLink.SetToken(2, sfx2::cTokenSeperator, sLink); + aSection.SetLinkFileName(sSectLink); + if (sSectLink.Len() < 3) + { + aSection.SetType(CONTENT_SECTION); + } + } + } + break; + case WID_SECT_VISIBLE: + { + sal_Bool bVal(sal_False); + if (!(pValues[nProperty] >>= bVal)) + { + throw lang::IllegalArgumentException(); + } + if (m_bIsDescriptor) + { + m_pProps->m_bHidden = !bVal; + } + else + { + aSection.SetHidden(!bVal); + } + } + break; + case WID_SECT_CURRENTLY_VISIBLE: + { + sal_Bool bVal(sal_False); + if (!(pValues[nProperty] >>= bVal)) + { + throw lang::IllegalArgumentException(); + } + if (m_bIsDescriptor) + { + m_pProps->m_bCondHidden = !bVal; + } + else + { + if (aSection.GetCondition().Len() != 0) + { + aSection.SetCondHidden(!bVal); + } + } + } + break; + case WID_SECT_PROTECTED: + { + sal_Bool bVal(sal_False); + if (!(pValues[nProperty] >>= bVal)) + { + throw lang::IllegalArgumentException(); + } + if (m_bIsDescriptor) + { + m_pProps->m_bProtect = bVal; + } + else + { + aSection.SetProtect(bVal); + } + } + break; + // --> FME 2004-06-22 #114856# edit in readonly sections + case WID_SECT_EDIT_IN_READONLY: + { + sal_Bool bVal(sal_False); + if (!(pValues[nProperty] >>= bVal)) + { + throw lang::IllegalArgumentException(); + } + if (m_bIsDescriptor) + { + m_pProps->m_bEditInReadonly = bVal; + } + else + { + aSection.SetEditInReadonly(bVal); + } + } + // <-- + break; + case WID_SECT_PASSWORD: + { + uno::Sequence aSeq; + pValues[nProperty] >>= aSeq; + if (m_bIsDescriptor) + { + m_pProps->m_Password = aSeq; + } + else + { + aSection.SetPasswd(aSeq); + } + } + break; + default: + { + if (pFmt) + { + const SfxItemSet& rOldAttrSet = pFmt->GetAttrSet(); + pItemSet.reset( new SfxItemSet(*rOldAttrSet.GetPool(), + pEntry->nWID, pEntry->nWID, 0)); + pItemSet->Put(rOldAttrSet); + m_rPropSet.setPropertyValue(*pEntry, + pValues[nProperty], *pItemSet); + } + else + { + SfxPoolItem* pPutItem = 0; + if (RES_COL == pEntry->nWID) + { + if (!m_pProps->m_pColItem.get()) { - if(!pProps->bDDE) - { - pProps->sLinkFileName = sfx2::cTokenSeperator; - pProps->sLinkFileName += sfx2::cTokenSeperator; - pProps->bDDE = sal_True; - } - pProps->sLinkFileName.SetToken(pEntry->nWID - WID_SECT_DDE_TYPE,sfx2::cTokenSeperator,sTmp); + m_pProps->m_pColItem.reset(new SwFmtCol); } - else + pPutItem = m_pProps->m_pColItem.get(); + } + else if (RES_BACKGROUND == pEntry->nWID) + { + if (!m_pProps->m_pBrushItem.get()) { - String sLinkFileName(aSection.GetLinkFileName()); - if(aSection.GetType() != DDE_LINK_SECTION) - { - sLinkFileName = sfx2::cTokenSeperator; - sLinkFileName += sfx2::cTokenSeperator; - aSection.SetType(DDE_LINK_SECTION); - } - sLinkFileName.SetToken(pEntry->nWID - WID_SECT_DDE_TYPE,sfx2::cTokenSeperator, sTmp); - aSection.SetLinkFileName(sLinkFileName); + m_pProps->m_pBrushItem.reset( + new SvxBrushItem(RES_BACKGROUND)); } + pPutItem = m_pProps->m_pBrushItem.get(); } - break; - case WID_SECT_DDE_AUTOUPDATE: + else if (RES_FTN_AT_TXTEND == pEntry->nWID) { - sal_Bool bVal = *(sal_Bool*)pValues[nProperty].getValue(); - if(m_bIsDescriptor) + if (!m_pProps->m_pFtnItem.get()) { - pProps->bUpdateType = bVal; + m_pProps->m_pFtnItem.reset(new SwFmtFtnAtTxtEnd); } - else + pPutItem = m_pProps->m_pFtnItem.get(); + } + else if (RES_END_AT_TXTEND == pEntry->nWID) + { + if (!m_pProps->m_pEndItem.get()) { - bLinkModeChanged = sal_True; - bLinkMode = bVal; + m_pProps->m_pEndItem.reset(new SwFmtEndAtTxtEnd); } + pPutItem = m_pProps->m_pEndItem.get(); } - break; - case WID_SECT_LINK : + else if (RES_UNKNOWNATR_CONTAINER== pEntry->nWID) { - text::SectionFileLink aLink; - if(pValues[nProperty] >>= aLink) + if (!m_pProps->m_pXMLAttr.get()) { - if(m_bIsDescriptor) - { - pProps->bDDE = sal_False; - pProps->sLinkFileName = String(aLink.FileURL); - pProps->sSectionFilter = String(aLink.FilterName); - } - else - { - if(aSection.GetType() != FILE_LINK_SECTION && - aLink.FileURL.getLength()) - aSection.SetType(FILE_LINK_SECTION); - String sFileName; - if(aLink.FileURL.getLength()) - { - sFileName += URIHelper::SmartRel2Abs( - pFmt->GetDoc()->GetDocShell()->GetMedium()->GetURLObject(), - aLink.FileURL, - URIHelper::GetMaybeFileHdl()); - } - sFileName += sfx2::cTokenSeperator; - sFileName += String(aLink.FilterName); - sFileName += sfx2::cTokenSeperator; - sFileName += aSection.GetLinkFileName().GetToken( 2, sfx2::cTokenSeperator ); - aSection.SetLinkFileName(sFileName); - if(sFileName.Len() < 3) - aSection.SetType(CONTENT_SECTION); - } + m_pProps->m_pXMLAttr.reset( + new SvXMLAttrContainerItem( + RES_UNKNOWNATR_CONTAINER)); } - else - throw lang::IllegalArgumentException(); + pPutItem = m_pProps->m_pXMLAttr.get(); } - break; - case WID_SECT_REGION : + else if (RES_COLUMNBALANCE== pEntry->nWID) { - OUString uTmp; - pValues[nProperty] >>= uTmp; - String sLink(uTmp); - if(m_bIsDescriptor) + if (!m_pProps->m_pNoBalanceItem.get()) { - pProps->bDDE = sal_False; - pProps->sSectionRegion = sLink; + m_pProps->m_pNoBalanceItem.reset( + new SwFmtNoBalancedColumns(RES_COLUMNBALANCE)); } - else + pPutItem = m_pProps->m_pNoBalanceItem.get(); + } + else if (RES_FRAMEDIR == pEntry->nWID) + { + if (!m_pProps->m_pFrameDirItem.get()) { - if(aSection.GetType() != FILE_LINK_SECTION && - sLink.Len()) - aSection.SetType(FILE_LINK_SECTION); - String sSectLink(aSection.GetLinkFileName()); - while( 3 < sSectLink.GetTokenCount( sfx2::cTokenSeperator )) - { - sSectLink += sfx2::cTokenSeperator; - } - sSectLink.SetToken(2, sfx2::cTokenSeperator, sLink); - aSection.SetLinkFileName(sSectLink); - if(sSectLink.Len() < 3) - aSection.SetType(CONTENT_SECTION); + m_pProps->m_pFrameDirItem.reset( + new SvxFrameDirectionItem( + FRMDIR_HORI_LEFT_TOP, RES_FRAMEDIR)); } + pPutItem = m_pProps->m_pFrameDirItem.get(); } - break; - case WID_SECT_VISIBLE : + else if (RES_LR_SPACE == pEntry->nWID) { - sal_Bool bVal = *(sal_Bool*)pValues[nProperty].getValue(); - if(m_bIsDescriptor) - pProps->bHidden = !bVal; - else - aSection.SetHidden(!bVal); + // #109700# + if (!m_pProps->m_pLRSpaceItem.get()) + { + m_pProps->m_pLRSpaceItem.reset( + new SvxLRSpaceItem( RES_LR_SPACE )); + } + pPutItem = m_pProps->m_pLRSpaceItem.get(); } - break; - case WID_SECT_CURRENTLY_VISIBLE: + if (pPutItem) { - sal_Bool bVal = *(sal_Bool*)pValues[nProperty].getValue(); - if(m_bIsDescriptor) - pProps->bCondHidden = !bVal; - else - if( aSection.GetCondition().Len() != 0 ) - aSection.SetCondHidden(!bVal); + pPutItem->PutValue(pValues[nProperty], + pEntry->nMemberId); } - break; - case WID_SECT_PROTECTED: + } + } + } + } + + if (pFmt) + { + SwDoc* pDoc = pFmt->GetDoc(); + const SwSectionFmts& rFmts = pDoc->GetSections(); + UnoActionContext aContext(pDoc); + for (sal_uInt16 i = 0; i < rFmts.Count(); i++) + { + if (rFmts[i]->GetSection()->GetName() == pSect->GetName()) + { + pDoc->ChgSection(i, aSection, pItemSet.get(), + pDoc->IsInReading()); + { + // temporarily remove actions to allow cursor update + UnoActionRemoveContext aRemoveContext( pDoc ); + } + + //SwSection* pSect = pFmt->GetSection(); + if (bLinkModeChanged && pSect->GetType() == DDE_LINK_SECTION) + { + // set update type; needs an established link + if (!pSect->IsConnected()) { - sal_Bool bVal = *(sal_Bool*)pValues[nProperty].getValue(); - if(m_bIsDescriptor) - pProps->bProtect = bVal; - else - aSection.SetProtect(bVal); + pSect->CreateLink(CREATE_CONNECT); } - break; - // --> FME 2004-06-22 #114856# edit in readonly sections - case WID_SECT_EDIT_IN_READONLY: + pSect->SetUpdateType( static_cast< USHORT >((bLinkMode) ? + sfx2::LINKUPDATE_ALWAYS : sfx2::LINKUPDATE_ONCALL) ); + } + // section found and processed: break from loop + break; + } + } + } +} + +void SAL_CALL +SwXTextSection::setPropertyValues( + const uno::Sequence< ::rtl::OUString >& rPropertyNames, + const uno::Sequence< uno::Any >& rValues) +throw (beans::PropertyVetoException, lang::IllegalArgumentException, + lang::WrappedTargetException, uno::RuntimeException) +{ + vos::OGuard aGuard(Application::GetSolarMutex()); + + // workaround for bad designed API + try + { + m_pImpl->SetPropertyValues_Impl( rPropertyNames, rValues ); + } + catch (beans::UnknownPropertyException &rException) + { + // wrap the original (here not allowed) exception in + // a WrappedTargetException that gets thrown instead. + lang::WrappedTargetException aWExc; + aWExc.TargetException <<= rException; + throw aWExc; + } +} +/*-- 10.12.98 14:47:11--------------------------------------------------- + + -----------------------------------------------------------------------*/ +void SwXTextSection::setPropertyValue( + const OUString& rPropertyName, const uno::Any& rValue) +throw (beans::UnknownPropertyException, beans::PropertyVetoException, + lang::IllegalArgumentException, lang::WrappedTargetException, + uno::RuntimeException ) +{ + vos::OGuard aGuard(Application::GetSolarMutex()); + + uno::Sequence< ::rtl::OUString > aPropertyNames(1); + aPropertyNames.getArray()[0] = rPropertyName; + uno::Sequence< uno::Any > aValues(1); + aValues.getArray()[0] = rValue; + m_pImpl->SetPropertyValues_Impl( aPropertyNames, aValues ); +} + +/* -----------------------------12.02.01 10:43-------------------------------- + + ---------------------------------------------------------------------------*/ +uno::Sequence< uno::Any > +SwXTextSection::Impl::GetPropertyValues_Impl( + const uno::Sequence< OUString > & rPropertyNames ) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) +{ + SwSectionFmt *const pFmt = GetSectionFmt(); + if (!pFmt && !m_bIsDescriptor) + { + throw uno::RuntimeException(); + } + + uno::Sequence< uno::Any > aRet(rPropertyNames.getLength()); + uno::Any* pRet = aRet.getArray(); + SwSection *const pSect = (pFmt) ? pFmt->GetSection() : 0; + const OUString* pPropertyNames = rPropertyNames.getConstArray(); + + for (sal_Int32 nProperty = 0; nProperty < rPropertyNames.getLength(); + nProperty++) + { + SfxItemPropertySimpleEntry const*const pEntry = + m_rPropSet.getPropertyMap()->getByName(pPropertyNames[nProperty]); + if (!pEntry) + { + throw beans::UnknownPropertyException( + OUString(RTL_CONSTASCII_USTRINGPARAM("Unknown property: ")) + + pPropertyNames[nProperty], + static_cast(& m_rThis)); + } + switch(pEntry->nWID) + { + case WID_SECT_CONDITION: + { + OUString uTmp( (m_bIsDescriptor) + ? m_pProps->m_sCondition + : ::rtl::OUString(pSect->GetCondition())); + pRet[nProperty] <<= uTmp; + } + break; + case WID_SECT_DDE_TYPE: + case WID_SECT_DDE_FILE: + case WID_SECT_DDE_ELEMENT: + { + ::rtl::OUString sRet; + if (m_bIsDescriptor) + { + if (m_pProps->m_bDDE) { - sal_Bool bVal = *(sal_Bool*)pValues[nProperty].getValue(); - if(m_bIsDescriptor) - pProps->bEditInReadonly = bVal; - else - aSection.SetEditInReadonly(bVal); + sRet = m_pProps->m_sLinkFileName; } - // <-- - break; - case WID_SECT_PASSWORD: + } + else if (DDE_LINK_SECTION == pSect->GetType()) + { + sRet = pSect->GetLinkFileName(); + } + sal_Int32 nDummy(0); + sRet = sRet.getToken(pEntry->nWID - WID_SECT_DDE_TYPE, + sfx2::cTokenSeperator, nDummy); + pRet[nProperty] <<= sRet; + } + break; + case WID_SECT_DDE_AUTOUPDATE: + { + // GetUpdateType() returns .._ALWAYS or .._ONCALL + if (pSect && pSect->IsLinkType() && pSect->IsConnected()) // lijian i73247 + { + const sal_Bool bTemp = + (pSect->GetUpdateType() == sfx2::LINKUPDATE_ALWAYS); + pRet[nProperty] <<= bTemp; + } + } + break; + case WID_SECT_LINK : + { + text::SectionFileLink aLink; + if (m_bIsDescriptor) + { + if (!m_pProps->m_bDDE) { - uno::Sequence aSeq; - pValues[nProperty] >>= aSeq; - if (m_bIsDescriptor) - pProps->aPassword = aSeq; - else - aSection.SetPasswd(aSeq); + aLink.FileURL = m_pProps->m_sLinkFileName; + aLink.FilterName = m_pProps->m_sSectionFilter; } - break; - default: - if(pFmt) - { - const SfxItemSet& rOldAttrSet = pFmt->GetAttrSet(); - aItemSet.pItemSet = new SfxItemSet(*rOldAttrSet.GetPool(), - pEntry->nWID, pEntry->nWID, 0); - aItemSet.pItemSet->Put(rOldAttrSet); - m_pPropSet->setPropertyValue(*pEntry, pValues[nProperty], *aItemSet.pItemSet); - } - else - { - SfxPoolItem* pPutItem = 0; - if(RES_COL == pEntry->nWID) - { - if(!pProps->pColItem) - pProps->pColItem = new SwFmtCol; - pPutItem = pProps->pColItem; - } - else if(RES_BACKGROUND == pEntry->nWID) - { - if(!pProps->pBrushItem) - pProps->pBrushItem = new SvxBrushItem(RES_BACKGROUND); - pPutItem = pProps->pBrushItem; - } - else if(RES_FTN_AT_TXTEND == pEntry->nWID) - { - if(!pProps->pFtnItem) - pProps->pFtnItem = new SwFmtFtnAtTxtEnd; - pPutItem = pProps->pFtnItem; - } - else if(RES_END_AT_TXTEND == pEntry->nWID) - { - if(!pProps->pEndItem) - pProps->pEndItem = new SwFmtEndAtTxtEnd; - pPutItem = pProps->pEndItem; - } - else if(RES_UNKNOWNATR_CONTAINER== pEntry->nWID) - { - if(!pProps->pXMLAttr) - pProps->pXMLAttr= new SvXMLAttrContainerItem( RES_UNKNOWNATR_CONTAINER ); - pPutItem = pProps->pXMLAttr; - } - else if(RES_COLUMNBALANCE== pEntry->nWID) - { - if(!pProps->pNoBalanceItem) - pProps->pNoBalanceItem= new SwFmtNoBalancedColumns( RES_COLUMNBALANCE ); - pPutItem = pProps->pNoBalanceItem; - } - else if(RES_FRAMEDIR == pEntry->nWID) - { - if(!pProps->pFrameDirItem) - pProps->pFrameDirItem = new SvxFrameDirectionItem( FRMDIR_HORI_LEFT_TOP, RES_FRAMEDIR ); - pPutItem = pProps->pFrameDirItem; - } - else if(RES_LR_SPACE == pEntry->nWID) - { - // #109700# - if(!pProps->pLRSpaceItem) - pProps->pLRSpaceItem = new SvxLRSpaceItem( RES_LR_SPACE ); - pPutItem = pProps->pLRSpaceItem; - } - if(pPutItem) - pPutItem->PutValue(pValues[nProperty], pEntry->nMemberId); - } } + else if (FILE_LINK_SECTION == pSect->GetType()) + { + ::rtl::OUString sRet( pSect->GetLinkFileName() ); + sal_Int32 nIndex(0); + aLink.FileURL = + sRet.getToken(0, sfx2::cTokenSeperator, nIndex); + aLink.FilterName = + sRet.getToken(0, sfx2::cTokenSeperator, nIndex); + } + pRet[nProperty] <<= aLink; } - } - if(pFmt) - { - SwDoc* pDoc = pFmt->GetDoc(); - const SwSectionFmts& rFmts = pDoc->GetSections(); - UnoActionContext aContext(pDoc); - for( sal_uInt16 i = 0; i < rFmts.Count(); i++ ) + break; + case WID_SECT_REGION : + { + ::rtl::OUString sRet; + if (m_bIsDescriptor) + { + sRet = m_pProps->m_sSectionRegion; + } + else if (FILE_LINK_SECTION == pSect->GetType()) + { + sRet = pSect->GetLinkFileName().GetToken(2, + sfx2::cTokenSeperator); + } + pRet[nProperty] <<= sRet; + } + break; + case WID_SECT_VISIBLE : + { + const sal_Bool bTemp = (m_bIsDescriptor) + ? !m_pProps->m_bHidden : !pSect->IsHidden(); + pRet[nProperty] <<= bTemp; + } + break; + case WID_SECT_CURRENTLY_VISIBLE: + { + const sal_Bool bTemp = (m_bIsDescriptor) + ? !m_pProps->m_bCondHidden : !pSect->IsCondHidden(); + pRet[nProperty] <<= bTemp; + } + break; + case WID_SECT_PROTECTED: + { + const sal_Bool bTemp = (m_bIsDescriptor) + ? m_pProps->m_bProtect : pSect->IsProtect(); + pRet[nProperty] <<= bTemp; + } + break; + // --> FME 2004-06-22 #114856# edit in readonly sections + case WID_SECT_EDIT_IN_READONLY: + { + const sal_Bool bTemp = (m_bIsDescriptor) + ? m_pProps->m_bEditInReadonly : pSect->IsEditInReadonly(); + pRet[nProperty] <<= bTemp; + } + break; + // <-- + case FN_PARAM_LINK_DISPLAY_NAME: + { + if (pFmt) + { + pRet[nProperty] <<= OUString(pFmt->GetSection()->GetName()); + } + } + break; + case WID_SECT_DOCUMENT_INDEX: + { + // search enclosing index + SwSection* pEnclosingSection = pSect; + while ((pEnclosingSection != NULL) && + (TOX_CONTENT_SECTION != pEnclosingSection->GetType())) + { + pEnclosingSection = pEnclosingSection->GetParent(); + } + if (pEnclosingSection) + { + // convert section to TOXBase and get SwXDocumentIndex + SwTOXBaseSection *const pTOXBaseSect = + PTR_CAST(SwTOXBaseSection, pEnclosingSection); + const uno::Reference xIndex = + SwXDocumentIndexes::GetObject(pTOXBaseSect); + pRet[nProperty] <<= xIndex; + } + // else: no enclosing index found -> empty return value + } + break; + case WID_SECT_IS_GLOBAL_DOC_SECTION: + { + const sal_Bool bRet = (NULL == pFmt) ? sal_False : + static_cast(NULL != pFmt->GetGlobalDocSection()); + pRet[nProperty] <<= bRet; + } + break; + case FN_UNO_ANCHOR_TYPES: + case FN_UNO_TEXT_WRAP: + case FN_UNO_ANCHOR_TYPE: + SwXParagraph::getDefaultTextContentValue( + pRet[nProperty], OUString(), pEntry->nWID); + break; + case FN_UNO_REDLINE_NODE_START: + case FN_UNO_REDLINE_NODE_END: { - if(rFmts[i]->GetSection()->GetName() == pSect->GetName()) + if (!pFmt) + break; // lijian i73247 + SwNode* pSectNode = pFmt->GetSectionNode(); + if (FN_UNO_REDLINE_NODE_END == pEntry->nWID) { - pDoc->ChgSection( i, aSection, aItemSet.pItemSet, pDoc->IsInReading()); - - { - // temporarily remove actions to allow cursor update - UnoActionRemoveContext aRemoveContext( pDoc ); - } - - //SwSection* pSect = pFmt->GetSection(); - if( bLinkModeChanged && pSect->GetType() == DDE_LINK_SECTION) + pSectNode = pSectNode->EndOfSectionNode(); + } + const SwRedlineTbl& rRedTbl = + pFmt->GetDoc()->GetRedlineTbl(); + for (USHORT nRed = 0; nRed < rRedTbl.Count(); nRed++) + { + const SwRedline* pRedline = rRedTbl[nRed]; + SwNode const*const pRedPointNode = pRedline->GetNode(TRUE); + SwNode const*const pRedMarkNode = pRedline->GetNode(FALSE); + if ((pRedPointNode == pSectNode) || + (pRedMarkNode == pSectNode)) { - // set update type; needs an established link - if(!pSect->IsConnected()) - { - pSect->CreateLink(CREATE_CONNECT); - } - pSect->SetUpdateType( static_cast< USHORT >(bLinkMode ? - sfx2::LINKUPDATE_ALWAYS : sfx2::LINKUPDATE_ONCALL) ); + SwNode const*const pStartOfRedline = + (SwNodeIndex(*pRedPointNode) <= + SwNodeIndex(*pRedMarkNode)) + ? pRedPointNode : pRedMarkNode; + const bool bIsStart = (pStartOfRedline == pSectNode); + pRet[nProperty] <<= + SwXRedlinePortion::CreateRedlineProperties( + *pRedline, bIsStart); + break; } - // section found and processed: break from loop - break; } } - } - } - else - throw uno::RuntimeException(); -} - -void SwXTextSection::setPropertyValues( - const Sequence< ::rtl::OUString >& rPropertyNames, - const Sequence< Any >& rValues ) - throw(PropertyVetoException, lang::IllegalArgumentException, - lang::WrappedTargetException, RuntimeException) -{ - vos::OGuard aGuard(Application::GetSolarMutex()); - - // workaround for bad designed API - try - { - SetPropertyValues_Impl( rPropertyNames, rValues ); - } - catch (UnknownPropertyException &rException) - { - // wrap the original (here not allowed) exception in - // a WrappedTargetException that gets thrown instead. - WrappedTargetException aWExc; - aWExc.TargetException <<= rException; - throw aWExc; - } -} -/*-- 10.12.98 14:47:11--------------------------------------------------- - - -----------------------------------------------------------------------*/ -void SwXTextSection::setPropertyValue( - const OUString& rPropertyName, const uno::Any& aValue) - throw( beans::UnknownPropertyException, beans::PropertyVetoException, - lang::IllegalArgumentException, lang::WrappedTargetException, - uno::RuntimeException ) -{ - vos::OGuard aGuard(Application::GetSolarMutex()); - Sequence< ::rtl::OUString > aPropertyNames(1); - aPropertyNames.getArray()[0] = rPropertyName; - Sequence< Any > aValues(1); - aValues.getArray()[0] = aValue; - SetPropertyValues_Impl( aPropertyNames, aValues ); -} -/* -----------------------------12.02.01 10:43-------------------------------- - - ---------------------------------------------------------------------------*/ -uno::Sequence< Any > SAL_CALL SwXTextSection::GetPropertyValues_Impl( - const uno::Sequence< OUString > & rPropertyNames ) - throw( UnknownPropertyException, WrappedTargetException, RuntimeException) -{ - Sequence< Any > aRet(rPropertyNames.getLength()); - Any* pRet = aRet.getArray(); - SwSectionFmt* pFmt = GetFmt(); - if(pFmt||m_bIsDescriptor) - { - SwSection* pSect = pFmt ? pFmt->GetSection() : 0; - const OUString* pPropertyNames = rPropertyNames.getConstArray(); - for(sal_Int32 nProperty = 0; nProperty < rPropertyNames.getLength(); nProperty++) - { - const SfxItemPropertySimpleEntry* pEntry = - m_pPropSet->getPropertyMap()->getByName( pPropertyNames[nProperty]); - if(pEntry) + break; + case WID_SECT_PASSWORD: { - switch(pEntry->nWID) + pRet[nProperty] <<= (m_bIsDescriptor) + ? m_pProps->m_Password : pSect->GetPasswd(); + } + break; + default: + { + if (pFmt) { - case WID_SECT_CONDITION: - { - OUString uTmp( - m_bIsDescriptor ? pProps->sCondition : pSect->GetCondition()); - pRet[nProperty] <<= uTmp; - } - break; - case WID_SECT_DDE_TYPE : - case WID_SECT_DDE_FILE : - case WID_SECT_DDE_ELEMENT : + m_rPropSet.getPropertyValue(*pEntry, + pFmt->GetAttrSet(), pRet[nProperty]); + } + else + { + const SfxPoolItem* pQueryItem = 0; + if (RES_COL == pEntry->nWID) { - String sRet; - if(m_bIsDescriptor) - { - if(pProps->bDDE) - sRet = pProps->sLinkFileName; - } - else if( DDE_LINK_SECTION == pSect->GetType() ) + if (!m_pProps->m_pColItem.get()) { - sRet = pSect->GetLinkFileName(); + m_pProps->m_pColItem.reset(new SwFmtCol); } - sRet = sRet.GetToken(pEntry->nWID - WID_SECT_DDE_TYPE, sfx2::cTokenSeperator); - pRet[nProperty] <<= OUString(sRet); + pQueryItem = m_pProps->m_pColItem.get(); } - break; - case WID_SECT_DDE_AUTOUPDATE: + else if (RES_BACKGROUND == pEntry->nWID) { - // GetUpdateType() returns .._ALWAYS or .._ONCALL - if ( pSect && pSect->IsLinkType() && pSect->IsConnected() ) // lijian i73247 + if (!m_pProps->m_pBrushItem.get()) { - sal_Bool bTemp = - (pSect->GetUpdateType() == sfx2::LINKUPDATE_ALWAYS); - pRet[nProperty].setValue( &bTemp, ::getCppuBooleanType()); + m_pProps->m_pBrushItem.reset( + new SvxBrushItem(RES_BACKGROUND)); } + pQueryItem = m_pProps->m_pBrushItem.get(); } - break; - case WID_SECT_LINK : + else if (RES_FTN_AT_TXTEND == pEntry->nWID) { - text::SectionFileLink aLink; - if(m_bIsDescriptor) - { - if(!pProps->bDDE) - { - aLink.FileURL = pProps->sLinkFileName; - aLink.FilterName = pProps->sSectionFilter; - } - } - else if( FILE_LINK_SECTION == pSect->GetType() ) + if (!m_pProps->m_pFtnItem.get()) { - String sRet( pSect->GetLinkFileName() ); - aLink.FileURL = sRet.GetToken(0, sfx2::cTokenSeperator ); - aLink.FilterName = sRet.GetToken(1, sfx2::cTokenSeperator ); + m_pProps->m_pFtnItem.reset(new SwFmtFtnAtTxtEnd); } - pRet[nProperty].setValue(&aLink, ::getCppuType((text::SectionFileLink*)0)); + pQueryItem = m_pProps->m_pFtnItem.get(); } - break; - case WID_SECT_REGION : + else if (RES_END_AT_TXTEND == pEntry->nWID) { - String sRet; - if(m_bIsDescriptor) + if (!m_pProps->m_pEndItem.get()) { - sRet = pProps->sSectionRegion; + m_pProps->m_pEndItem.reset(new SwFmtEndAtTxtEnd); } - else if( FILE_LINK_SECTION == pSect->GetType() ) - sRet = pSect->GetLinkFileName().GetToken(2, sfx2::cTokenSeperator); - pRet[nProperty] <<= OUString(sRet); - } - break; - case WID_SECT_VISIBLE : - { - sal_Bool bTemp = m_bIsDescriptor ? !pProps->bHidden : !pSect->IsHidden(); - pRet[nProperty].setValue( &bTemp, ::getCppuBooleanType()); - } - break; - case WID_SECT_CURRENTLY_VISIBLE: - { - sal_Bool bTmp = m_bIsDescriptor ? !pProps->bCondHidden : !pSect->IsCondHidden(); - pRet[nProperty].setValue( &bTmp, ::getCppuBooleanType()); - } - break; - case WID_SECT_PROTECTED: - { - sal_Bool bTemp = m_bIsDescriptor ? pProps->bProtect : pSect->IsProtect(); - pRet[nProperty].setValue( &bTemp, ::getCppuBooleanType()); - } - break; - // --> FME 2004-06-22 #114856# edit in readonly sections - case WID_SECT_EDIT_IN_READONLY: - { - sal_Bool bTemp = m_bIsDescriptor ? pProps->bEditInReadonly : pSect->IsEditInReadonly(); - pRet[nProperty].setValue( &bTemp, ::getCppuBooleanType()); - } - break; - // <-- - case FN_PARAM_LINK_DISPLAY_NAME: - { - if(pFmt) - pRet[nProperty] <<= OUString(pFmt->GetSection()->GetName()); + pQueryItem = m_pProps->m_pEndItem.get(); } - break; - case WID_SECT_DOCUMENT_INDEX: + else if (RES_UNKNOWNATR_CONTAINER== pEntry->nWID) { - // search enclosing index - SwSection* pEnclosingSection = pSect; - while ( (pEnclosingSection != NULL) && - (TOX_CONTENT_SECTION != - pEnclosingSection->GetType()) ) + if (!m_pProps->m_pXMLAttr.get()) { - pEnclosingSection = pEnclosingSection->GetParent(); + m_pProps->m_pXMLAttr.reset( + new SvXMLAttrContainerItem); } - if (pEnclosingSection) + pQueryItem = m_pProps->m_pXMLAttr.get(); + } + else if (RES_COLUMNBALANCE== pEntry->nWID) + { + if (!m_pProps->m_pNoBalanceItem.get()) { - // convert section to TOXBase and get SwXDocumentIndex - SwTOXBaseSection* pTOXBaseSect = - PTR_CAST(SwTOXBaseSection, pEnclosingSection); - uno::Reference xIndex = - SwXDocumentIndexes::GetObject(pTOXBaseSect); - pRet[nProperty] <<= xIndex; + m_pProps->m_pNoBalanceItem.reset( + new SwFmtNoBalancedColumns); } - // else: no enclosing index found -> empty return value + pQueryItem = m_pProps->m_pNoBalanceItem.get(); } - break; - case WID_SECT_IS_GLOBAL_DOC_SECTION: + else if (RES_FRAMEDIR == pEntry->nWID) { - sal_Bool bRet = (NULL == pFmt) ? sal_False : - static_cast< sal_Bool >(NULL != pFmt->GetGlobalDocSection()); - pRet[nProperty].setValue( &bRet, ::getCppuBooleanType()); + if (!m_pProps->m_pFrameDirItem.get()) + { + m_pProps->m_pFrameDirItem.reset( + new SvxFrameDirectionItem( + FRMDIR_ENVIRONMENT, RES_FRAMEDIR)); + } + pQueryItem = m_pProps->m_pFrameDirItem.get(); } - break; - case FN_UNO_ANCHOR_TYPES: - case FN_UNO_TEXT_WRAP: - case FN_UNO_ANCHOR_TYPE: - SwXParagraph::getDefaultTextContentValue(pRet[nProperty], OUString(), pEntry->nWID); - break; - case FN_UNO_REDLINE_NODE_START: - case FN_UNO_REDLINE_NODE_END: + /* -> #109700# */ + else if (RES_LR_SPACE == pEntry->nWID) { - if(!pFmt) - break; // lijian i73247 - SwNode* pSectNode = pFmt->GetSectionNode(); - if(FN_UNO_REDLINE_NODE_END == pEntry->nWID) - pSectNode = pSectNode->EndOfSectionNode(); - const SwRedlineTbl& rRedTbl = pFmt->GetDoc()->GetRedlineTbl(); - for(USHORT nRed = 0; nRed < rRedTbl.Count(); nRed++) + if (!m_pProps->m_pLRSpaceItem.get()) { - const SwRedline* pRedline = rRedTbl[nRed]; - const SwNode* pRedPointNode = pRedline->GetNode(TRUE); - const SwNode* pRedMarkNode = pRedline->GetNode(FALSE); - if(pRedPointNode == pSectNode || pRedMarkNode == pSectNode) - { - const SwNode* pStartOfRedline = SwNodeIndex(*pRedPointNode) <= SwNodeIndex(*pRedMarkNode) ? - pRedPointNode : pRedMarkNode; - BOOL bIsStart = pStartOfRedline == pSectNode; - pRet[nProperty] <<= SwXRedlinePortion::CreateRedlineProperties(*pRedline, bIsStart); - break; - } + m_pProps->m_pLRSpaceItem.reset( + new SvxLRSpaceItem( RES_LR_SPACE )); } + pQueryItem = m_pProps->m_pLRSpaceItem.get(); } - break; - case WID_SECT_PASSWORD: + /* <- #109700# */ + if (pQueryItem) { - pRet[nProperty] <<= m_bIsDescriptor ? pProps->aPassword : pSect->GetPasswd(); + pQueryItem->QueryValue(pRet[nProperty], + pEntry->nMemberId); } - break; - default: - if(pFmt) - m_pPropSet->getPropertyValue(*pEntry, pFmt->GetAttrSet(), pRet[nProperty]); - else - { - const SfxPoolItem* pQueryItem = 0; - if(RES_COL == pEntry->nWID) - { - if(!pProps->pColItem) - pProps->pColItem = new SwFmtCol; - pQueryItem = pProps->pColItem; - } - else if(RES_BACKGROUND == pEntry->nWID) - { - if(!pProps->pBrushItem) - pProps->pBrushItem = new SvxBrushItem(RES_BACKGROUND); - pQueryItem = pProps->pBrushItem; - } - else if(RES_FTN_AT_TXTEND == pEntry->nWID) - { - if(!pProps->pFtnItem) - pProps->pFtnItem = new SwFmtFtnAtTxtEnd; - pQueryItem = pProps->pFtnItem; - } - else if(RES_END_AT_TXTEND == pEntry->nWID) - { - if(!pProps->pEndItem) - pProps->pEndItem = new SwFmtEndAtTxtEnd; - pQueryItem = pProps->pEndItem; - } - else if(RES_UNKNOWNATR_CONTAINER== pEntry->nWID) - { - if(!pProps->pXMLAttr) - pProps->pXMLAttr= new SvXMLAttrContainerItem ; - pQueryItem = pProps->pXMLAttr; - } - else if(RES_COLUMNBALANCE== pEntry->nWID) - { - if(!pProps->pNoBalanceItem) - pProps->pNoBalanceItem= new SwFmtNoBalancedColumns; - pQueryItem = pProps->pNoBalanceItem; - } - else if(RES_FRAMEDIR == pEntry->nWID) - { - if(!pProps->pFrameDirItem) - pProps->pFrameDirItem = new SvxFrameDirectionItem(FRMDIR_ENVIRONMENT, RES_FRAMEDIR); - pQueryItem = pProps->pFrameDirItem; - } - /* -> #109700# */ - else if(RES_LR_SPACE == pEntry->nWID) - { - if(!pProps->pLRSpaceItem) - pProps->pLRSpaceItem = new SvxLRSpaceItem( RES_LR_SPACE ); - pQueryItem = pProps->pLRSpaceItem; - } - /* <- #109700# */ - if(pQueryItem) - pQueryItem->QueryValue(pRet[nProperty], pEntry->nMemberId); - } } } - else - throw UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + pPropertyNames[nProperty], static_cast < cppu::OWeakObject * > ( this ) ); } } - else - throw uno::RuntimeException(); return aRet; } + /* -----------------------------04.11.03 10:43-------------------------------- ---------------------------------------------------------------------------*/ -Sequence< Any > SwXTextSection::getPropertyValues( - const Sequence< ::rtl::OUString >& rPropertyNames ) - throw(RuntimeException) +uno::Sequence< uno::Any > SAL_CALL +SwXTextSection::getPropertyValues( + const uno::Sequence< ::rtl::OUString >& rPropertyNames) +throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - Sequence< Any > aValues; + uno::Sequence< uno::Any > aValues; // workaround for bad designed API try { - aValues = GetPropertyValues_Impl( rPropertyNames ); + aValues = m_pImpl->GetPropertyValues_Impl( rPropertyNames ); } - catch (UnknownPropertyException &) + catch (beans::UnknownPropertyException &) { - throw RuntimeException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property exception caught" ) ), static_cast < cppu::OWeakObject * > ( this ) ); + throw uno::RuntimeException(OUString( + RTL_CONSTASCII_USTRINGPARAM("Unknown property exception caught")), + static_cast(this)); } - catch (WrappedTargetException &) + catch (lang::WrappedTargetException &) { - throw RuntimeException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "WrappedTargetException caught" ) ), static_cast < cppu::OWeakObject * > ( this ) ); + throw uno::RuntimeException(OUString( + RTL_CONSTASCII_USTRINGPARAM("WrappedTargetException caught")), + static_cast(this)); } return aValues; @@ -1213,279 +1356,373 @@ Sequence< Any > SwXTextSection::getPropertyValues( /*-- 10.12.98 14:47:12--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Any SwXTextSection::getPropertyValue(const OUString& rPropertyName) - throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) +uno::Any SAL_CALL +SwXTextSection::getPropertyValue(const OUString& rPropertyName) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - Sequence< ::rtl::OUString > aPropertyNames(1); + + uno::Sequence< ::rtl::OUString > aPropertyNames(1); aPropertyNames.getArray()[0] = rPropertyName; - return GetPropertyValues_Impl(aPropertyNames).getConstArray()[0]; + return m_pImpl->GetPropertyValues_Impl(aPropertyNames).getConstArray()[0]; } /* -----------------------------12.02.01 10:30-------------------------------- ---------------------------------------------------------------------------*/ -void SwXTextSection::addPropertiesChangeListener( - const uno::Sequence< ::rtl::OUString >& /*aPropertyNames*/, - const uno::Reference< beans::XPropertiesChangeListener >& /*xListener*/ ) throw(RuntimeException) +void SAL_CALL SwXTextSection::addPropertiesChangeListener( + const uno::Sequence< OUString >& /*aPropertyNames*/, + const uno::Reference< beans::XPropertiesChangeListener >& /*xListener*/ ) +throw (uno::RuntimeException) { - DBG_WARNING("not implemented"); + OSL_ENSURE(false, + "SwXTextSection::addPropertiesChangeListener(): not implemented"); } + /* -----------------------------12.02.01 10:30-------------------------------- ---------------------------------------------------------------------------*/ -void SwXTextSection::removePropertiesChangeListener( +void SAL_CALL SwXTextSection::removePropertiesChangeListener( const uno::Reference< beans::XPropertiesChangeListener >& /*xListener*/ ) - throw(RuntimeException) +throw (uno::RuntimeException) { - DBG_WARNING("not implemented"); + OSL_ENSURE(false, + "SwXTextSection::removePropertiesChangeListener(): not implemented"); } + /* -----------------------------12.02.01 10:30-------------------------------- ---------------------------------------------------------------------------*/ -void SwXTextSection::firePropertiesChangeEvent( - const uno::Sequence< ::rtl::OUString >& /*aPropertyNames*/, +void SAL_CALL SwXTextSection::firePropertiesChangeEvent( + const uno::Sequence< OUString >& /*aPropertyNames*/, const uno::Reference< beans::XPropertiesChangeListener >& /*xListener*/ ) - throw(RuntimeException) + throw(uno::RuntimeException) { - DBG_WARNING("not implemented"); + OSL_ENSURE(false, + "SwXTextSection::firePropertiesChangeEvent(): not implemented"); } + /*-- 10.12.98 14:47:13--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXTextSection::addPropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) +void SAL_CALL +SwXTextSection::addPropertyChangeListener( + const ::rtl::OUString& /*rPropertyName*/, + const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { - DBG_WARNING("not implemented"); + OSL_ENSURE(false, + "SwXTextSection::addPropertyChangeListener(): not implemented"); } -/*-- 10.12.98 14:47:13--------------------------------------------------- - -----------------------------------------------------------------------*/ -void SwXTextSection::removePropertyChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) +void SAL_CALL +SwXTextSection::removePropertyChangeListener( + const ::rtl::OUString& /*rPropertyName*/, + const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { - DBG_WARNING("not implemented"); + OSL_ENSURE(false, + "SwXTextSection::removePropertyChangeListener(): not implemented"); } -/*-- 10.12.98 14:47:14--------------------------------------------------- - -----------------------------------------------------------------------*/ -void SwXTextSection::addVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) +void SAL_CALL +SwXTextSection::addVetoableChangeListener( + const ::rtl::OUString& /*rPropertyName*/, + const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { - DBG_WARNING("not implemented"); + OSL_ENSURE(false, + "SwXTextSection::addVetoableChangeListener(): not implemented"); } -/*-- 10.12.98 14:47:14--------------------------------------------------- - -----------------------------------------------------------------------*/ -void SwXTextSection::removeVetoableChangeListener(const OUString& /*rPropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*xListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) +void SAL_CALL +SwXTextSection::removeVetoableChangeListener( + const ::rtl::OUString& /*rPropertyName*/, + const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { - DBG_WARNING("not implemented"); + OSL_ENSURE(false, + "SwXTextSection::removeVetoableChangeListener(): not implemented"); } /*-- 08.11.00 10:47:55--------------------------------------------------- -----------------------------------------------------------------------*/ -PropertyState SwXTextSection::getPropertyState( const OUString& rPropertyName ) - throw(UnknownPropertyException, RuntimeException) +beans::PropertyState SAL_CALL +SwXTextSection::getPropertyState(const OUString& rPropertyName) +throw (beans::UnknownPropertyException, uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - Sequence< OUString > aNames(1); + + uno::Sequence< OUString > aNames(1); aNames.getArray()[0] = rPropertyName; return getPropertyStates(aNames).getConstArray()[0]; } /*-- 08.11.00 10:47:55--------------------------------------------------- -----------------------------------------------------------------------*/ -Sequence< PropertyState > SwXTextSection::getPropertyStates( - const Sequence< OUString >& rPropertyNames ) - throw(UnknownPropertyException, RuntimeException) +uno::Sequence< beans::PropertyState > SAL_CALL +SwXTextSection::getPropertyStates( + const uno::Sequence< OUString >& rPropertyNames) +throw (beans::UnknownPropertyException, uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - Sequence< PropertyState > aStates(rPropertyNames.getLength()); - SwSectionFmt* pFmt = GetFmt(); - if(pFmt||m_bIsDescriptor) + + SwSectionFmt *const pFmt = m_pImpl->GetSectionFmt(); + if (!pFmt && !m_pImpl->m_bIsDescriptor) + { + throw uno::RuntimeException(); + } + + uno::Sequence< beans::PropertyState > aStates(rPropertyNames.getLength()); + beans::PropertyState *const pStates = aStates.getArray(); + const OUString* pNames = rPropertyNames.getConstArray(); + for (sal_Int32 i = 0; i < rPropertyNames.getLength(); i++) { - PropertyState* pStates = aStates.getArray(); - const OUString* pNames = rPropertyNames.getConstArray(); - for(sal_Int32 i = 0; i < rPropertyNames.getLength(); i++) + pStates[i] = beans::PropertyState_DEFAULT_VALUE; + SfxItemPropertySimpleEntry const*const pEntry = + m_pImpl->m_rPropSet.getPropertyMap()->getByName( pNames[i]); + if (!pEntry) + { + throw beans::UnknownPropertyException( + OUString(RTL_CONSTASCII_USTRINGPARAM("Unknown property: ")) + + pNames[i], static_cast< cppu::OWeakObject* >(this)); + } + switch (pEntry->nWID) { - pStates[i] = PropertyState_DEFAULT_VALUE; - const SfxItemPropertySimpleEntry* pEntry = - m_pPropSet->getPropertyMap()->getByName( pNames[i]); - if(!pEntry) - throw UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + pNames[i], static_cast < cppu::OWeakObject * > ( this ) ); - switch(pEntry->nWID) + case WID_SECT_CONDITION: + case WID_SECT_DDE_TYPE: + case WID_SECT_DDE_FILE: + case WID_SECT_DDE_ELEMENT: + case WID_SECT_DDE_AUTOUPDATE: + case WID_SECT_LINK: + case WID_SECT_REGION : + case WID_SECT_VISIBLE: + case WID_SECT_PROTECTED: + // --> FME 2004-06-22 #114856# edit in readonly sections + case WID_SECT_EDIT_IN_READONLY: + // <-- + case FN_PARAM_LINK_DISPLAY_NAME: + case FN_UNO_ANCHOR_TYPES: + case FN_UNO_TEXT_WRAP: + case FN_UNO_ANCHOR_TYPE: + pStates[i] = beans::PropertyState_DIRECT_VALUE; + break; + default: { - case WID_SECT_CONDITION: - case WID_SECT_DDE_TYPE : - case WID_SECT_DDE_FILE : - case WID_SECT_DDE_ELEMENT : - case WID_SECT_DDE_AUTOUPDATE: - case WID_SECT_LINK : - case WID_SECT_REGION : - case WID_SECT_VISIBLE : - case WID_SECT_PROTECTED: - // --> FME 2004-06-22 #114856# edit in readonly sections - case WID_SECT_EDIT_IN_READONLY: - // <-- - case FN_PARAM_LINK_DISPLAY_NAME: - case FN_UNO_ANCHOR_TYPES: - case FN_UNO_TEXT_WRAP: - case FN_UNO_ANCHOR_TYPE: - pStates[i] = PropertyState_DIRECT_VALUE; - break; - default: - if(pFmt) - pStates[i] = m_pPropSet->getPropertyState(pNames[i], pFmt->GetAttrSet()); - else + if (pFmt) + { + pStates[i] = m_pImpl->m_rPropSet.getPropertyState( + pNames[i], pFmt->GetAttrSet()); + } + else + { + if (RES_COL == pEntry->nWID) + { + if (!m_pImpl->m_pProps->m_pColItem.get()) + { + pStates[i] = beans::PropertyState_DEFAULT_VALUE; + } + else + { + pStates[i] = beans::PropertyState_DIRECT_VALUE; + } + } + else //if(RES_BACKGROUND == pEntry->nWID) { - if(RES_COL == pEntry->nWID) + if (!m_pImpl->m_pProps->m_pBrushItem.get()) { - if(!pProps->pColItem) - pStates[i] = PropertyState_DEFAULT_VALUE; - else - pStates[i] = PropertyState_DIRECT_VALUE; + pStates[i] = beans::PropertyState_DEFAULT_VALUE; } - else //if(RES_BACKGROUND == pEntry->nWID) + else { - if(!pProps->pBrushItem) - pStates[i] = PropertyState_DEFAULT_VALUE; - else - pStates[i] = PropertyState_DIRECT_VALUE; + pStates[i] = beans::PropertyState_DIRECT_VALUE; } } + } } } } - else - throw RuntimeException(); return aStates; } + /*-- 08.11.00 10:47:55--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXTextSection::setPropertyToDefault( const OUString& rPropertyName ) - throw(UnknownPropertyException, RuntimeException) +void SAL_CALL +SwXTextSection::setPropertyToDefault(const OUString& rPropertyName) +throw (beans::UnknownPropertyException, uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - SwSectionFmt* pFmt = GetFmt(); - if(pFmt||m_bIsDescriptor) + + SwSectionFmt *const pFmt = m_pImpl->GetSectionFmt(); + if (!pFmt && !m_pImpl->m_bIsDescriptor) { - SwSection aSection(CONTENT_SECTION, aEmptyStr); - SwSection* pSect = pFmt ? pFmt->GetSection() : 0; - if(pFmt) - aSection = *pSect; - const SfxItemPropertySimpleEntry* pEntry = - m_pPropSet->getPropertyMap()->getByName( rPropertyName ); - if(!pEntry) - throw UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); - if ( pEntry->nFlags & PropertyAttribute::READONLY) - throw RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "setPropertyToDefault: property is read-only: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); - SfxItemSet* pNewAttrSet = 0; - switch(pEntry->nWID) + throw uno::RuntimeException(); + } + + SwSection aSection(CONTENT_SECTION, aEmptyStr); + SwSection *const pSect = (pFmt) ? pFmt->GetSection() : 0; + if (pFmt) + { + aSection = *pSect; + } + SfxItemPropertySimpleEntry const*const pEntry = + m_pImpl->m_rPropSet.getPropertyMap()->getByName(rPropertyName); + if (!pEntry) + { + throw beans::UnknownPropertyException( + OUString(RTL_CONSTASCII_USTRINGPARAM("Unknown property: ")) + + rPropertyName, static_cast< cppu::OWeakObject* >(this)); + } + if (pEntry->nFlags & beans::PropertyAttribute::READONLY) + { + throw uno::RuntimeException(OUString(RTL_CONSTASCII_USTRINGPARAM( + "setPropertyToDefault: property is read-only: ")) + + rPropertyName, + static_cast(this)); + } + + ::std::auto_ptr pNewAttrSet; + switch (pEntry->nWID) + { + case WID_SECT_CONDITION: { - case WID_SECT_CONDITION: + if (m_pImpl->m_bIsDescriptor) { - if(m_bIsDescriptor) - pProps->sCondition = aEmptyStr; - else - aSection.SetCondition(aEmptyStr); + m_pImpl->m_pProps->m_sCondition = aEmptyStr; } - break; - case WID_SECT_DDE_TYPE : - case WID_SECT_DDE_FILE : - case WID_SECT_DDE_ELEMENT : - case WID_SECT_LINK : - case WID_SECT_REGION : - aSection.SetType(CONTENT_SECTION); - break; - case WID_SECT_DDE_AUTOUPDATE: - aSection.SetUpdateType(sfx2::LINKUPDATE_ALWAYS); - break; - case WID_SECT_VISIBLE : + else { - if(m_bIsDescriptor) - pProps->bHidden = FALSE; - else - aSection.SetHidden(FALSE); + aSection.SetCondition(aEmptyStr); } - break; - case WID_SECT_PROTECTED: + } + break; + case WID_SECT_DDE_TYPE : + case WID_SECT_DDE_FILE : + case WID_SECT_DDE_ELEMENT : + case WID_SECT_LINK : + case WID_SECT_REGION : + aSection.SetType(CONTENT_SECTION); + break; + case WID_SECT_DDE_AUTOUPDATE: + aSection.SetUpdateType(sfx2::LINKUPDATE_ALWAYS); + break; + case WID_SECT_VISIBLE : + { + if (m_pImpl->m_bIsDescriptor) { - if(m_bIsDescriptor) - pProps->bProtect = FALSE; - else - aSection.SetProtect(FALSE); + m_pImpl->m_pProps->m_bHidden = false; } - break; - // --> FME 2004-06-22 #114856# edit in readonly sections - case WID_SECT_EDIT_IN_READONLY: + else { - if(m_bIsDescriptor) - pProps->bEditInReadonly = FALSE; - else - aSection.SetEditInReadonly(FALSE); + aSection.SetHidden(FALSE); } - break; - // <-- + } + break; + case WID_SECT_PROTECTED: + { + if (m_pImpl->m_bIsDescriptor) + { + m_pImpl->m_pProps->m_bProtect = false; + } + else + { + aSection.SetProtect(FALSE); + } + } + break; + // --> FME 2004-06-22 #114856# edit in readonly sections + case WID_SECT_EDIT_IN_READONLY: + { + if (m_pImpl->m_bIsDescriptor) + { + m_pImpl->m_pProps->m_bEditInReadonly = false; + } + else + { + aSection.SetEditInReadonly(FALSE); + } + } + break; + // <-- - case FN_UNO_ANCHOR_TYPES: - case FN_UNO_TEXT_WRAP: - case FN_UNO_ANCHOR_TYPE: - break; - default: - if(pEntry->nWID <= SFX_WHICH_MAX) + case FN_UNO_ANCHOR_TYPES: + case FN_UNO_TEXT_WRAP: + case FN_UNO_ANCHOR_TYPE: + break; + default: + { + if (pEntry->nWID <= SFX_WHICH_MAX) + { + if (pFmt) + { + const SfxItemSet& rOldAttrSet = pFmt->GetAttrSet(); + pNewAttrSet.reset( new SfxItemSet(*rOldAttrSet.GetPool(), + pEntry->nWID, pEntry->nWID, 0)); + pNewAttrSet->ClearItem(pEntry->nWID); + } + else { - if(pFmt) + if (RES_COL == pEntry->nWID) { - const SfxItemSet& rOldAttrSet = pFmt->GetAttrSet(); - pNewAttrSet = new SfxItemSet(*rOldAttrSet.GetPool(), - pEntry->nWID, pEntry->nWID, 0); - pNewAttrSet->ClearItem(pEntry->nWID); + m_pImpl->m_pProps->m_pColItem.reset(); } - else + else if (RES_BACKGROUND == pEntry->nWID) { - if(RES_COL == pEntry->nWID) - DELETEZ(pProps->pColItem); - else if(RES_BACKGROUND == pEntry->nWID) - DELETEZ(pProps->pBrushItem); + m_pImpl->m_pProps->m_pBrushItem.reset(); } } + } } - if(pFmt) + } + + if (pFmt) + { + SwDoc *const pDoc = pFmt->GetDoc(); + const SwSectionFmts& rFmts = pDoc->GetSections(); + UnoActionContext aContext(pDoc); + for (sal_uInt16 i = 0; i < rFmts.Count(); i++) { - SwDoc* pDoc = pFmt->GetDoc(); - const SwSectionFmts& rFmts = pDoc->GetSections(); - UnoActionContext aContext(pDoc); - for( sal_uInt16 i = 0; i < rFmts.Count(); i++ ) + if (rFmts[i]->GetSection()->GetName() == pSect->GetName()) { - if(rFmts[i]->GetSection()->GetName() == pSect->GetName()) + pDoc->ChgSection(i, aSection, pNewAttrSet.get(), + pDoc->IsInReading()); { - pDoc->ChgSection( i, aSection, pNewAttrSet, pDoc->IsInReading()); - - { - // temporarily remove actions to allow cursor update - UnoActionRemoveContext aRemoveContext( pDoc ); - } - - break; + // temporarily remove actions to allow cursor update + UnoActionRemoveContext aRemoveContext( pDoc ); } + break; } - delete pNewAttrSet; } } - else - throw RuntimeException(); } + /*-- 08.11.00 10:47:56--------------------------------------------------- -----------------------------------------------------------------------*/ -Any SwXTextSection::getPropertyDefault( const OUString& rPropertyName ) - throw(UnknownPropertyException, WrappedTargetException, RuntimeException) +uno::Any SAL_CALL +SwXTextSection::getPropertyDefault(const OUString& rPropertyName) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); + uno::Any aRet; - SwSectionFmt* pFmt = GetFmt(); - const SfxItemPropertySimpleEntry* pEntry = - m_pPropSet->getPropertyMap()->getByName( rPropertyName ); + SwSectionFmt *const pFmt = m_pImpl->GetSectionFmt(); + SfxItemPropertySimpleEntry const*const pEntry = + m_pImpl->m_rPropSet.getPropertyMap()->getByName(rPropertyName); if (!pEntry) - throw UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); + { + throw beans::UnknownPropertyException( + OUString(RTL_CONSTASCII_USTRINGPARAM("Unknown property: ")) + + rPropertyName, + static_cast(this)); + } switch(pEntry->nWID) { @@ -1498,7 +1735,7 @@ Any SwXTextSection::getPropertyDefault( const OUString& rPropertyName ) aRet <<= OUString(); break; case WID_SECT_LINK : - aRet <<= SectionFileLink(); + aRet <<= text::SectionFileLink(); break; case WID_SECT_DDE_AUTOUPDATE: case WID_SECT_VISIBLE : @@ -1524,7 +1761,7 @@ Any SwXTextSection::getPropertyDefault( const OUString& rPropertyName ) default: if(pFmt && pEntry->nWID <= SFX_WHICH_MAX) { - SwDoc* pDoc = pFmt->GetDoc(); + SwDoc *const pDoc = pFmt->GetDoc(); const SfxPoolItem& rDefItem = pDoc->GetAttrPool().GetDefaultItem(pEntry->nWID); rDefItem.QueryValue(aRet, pEntry->nMemberId); @@ -1532,33 +1769,43 @@ Any SwXTextSection::getPropertyDefault( const OUString& rPropertyName ) } return aRet; } + /*-- 10.12.98 14:47:15--------------------------------------------------- -----------------------------------------------------------------------*/ -OUString SwXTextSection::getName(void) throw( uno::RuntimeException ) +OUString SAL_CALL SwXTextSection::getName() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - String sRet; - const SwSectionFmt* pFmt = GetFmt(); + + ::rtl::OUString sRet; + SwSectionFmt const*const pFmt = m_pImpl->GetSectionFmt(); if(pFmt) + { sRet = pFmt->GetSection()->GetName(); - else if(m_bIsDescriptor) - sRet = m_sName; + } + else if (m_pImpl->m_bIsDescriptor) + { + sRet = m_pImpl->m_sName; + } else + { throw uno::RuntimeException(); + } return sRet; } /*-- 10.12.98 14:47:16--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXTextSection::setName(const OUString& rName) throw( uno::RuntimeException ) +void SAL_CALL SwXTextSection::setName(const OUString& rName) +throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - SwSectionFmt* pFmt = GetFmt(); + + SwSectionFmt *const pFmt = m_pImpl->GetSectionFmt(); if(pFmt) { SwSection aSection(CONTENT_SECTION, aEmptyStr); - SwSection* pSect = pFmt->GetSection(); + SwSection *const pSect = pFmt->GetSection(); aSection = *pSect; String sNewName(rName); aSection.SetName(sNewName); @@ -1568,9 +1815,13 @@ void SwXTextSection::setName(const OUString& rName) throw( uno::RuntimeException for( sal_uInt16 i = 0; i < rFmts.Count(); i++ ) { if(rFmts[i]->GetSection() == pSect) + { nApplyPos = i; + } else if(sNewName == rFmts[i]->GetSection()->GetName()) + { throw uno::RuntimeException(); + } } if(nApplyPos != USHRT_MAX) { @@ -1584,46 +1835,50 @@ void SwXTextSection::setName(const OUString& rName) throw( uno::RuntimeException } } } - else if(m_bIsDescriptor) - m_sName = String(rName); + else if (m_pImpl->m_bIsDescriptor) + { + m_pImpl->m_sName = rName; + } else + { throw uno::RuntimeException(); + } } /* -----------------02.11.99 11:30------------------- --------------------------------------------------*/ -OUString SwXTextSection::getImplementationName(void) throw( uno::RuntimeException ) +OUString SAL_CALL +SwXTextSection::getImplementationName() throw (uno::RuntimeException) { return C2U("SwXTextSection"); } + /* -----------------02.11.99 11:30------------------- --------------------------------------------------*/ -sal_Bool SwXTextSection::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) +static char const*const g_ServicesTextSection[] = { - return !rServiceName.compareToAscii("com.sun.star.text.TextSection") || - !rServiceName.compareToAscii("com.sun.star.document.LinkTarget") || - !rServiceName.compareToAscii("com.sun.star.text.TextContent"); -} -/* -----------------02.11.99 11:30------------------- + "com.sun.star.text.TextContent", + "com.sun.star.text.TextSection", + "com.sun.star.document.LinkTarget", +}; +static const size_t g_nServicesTextSection( + sizeof(g_ServicesTextSection)/sizeof(g_ServicesTextSection[0])); - --------------------------------------------------*/ -uno::Sequence< OUString > SwXTextSection::getSupportedServiceNames(void) throw( uno::RuntimeException ) +sal_Bool SAL_CALL SwXTextSection::supportsService(const OUString& rServiceName) +throw (uno::RuntimeException) { - uno::Sequence< OUString > aRet(3); - OUString* pArr = aRet.getArray(); - pArr[0] = C2U("com.sun.star.text.TextSection"); - pArr[1] = C2U("com.sun.star.document.LinkTarget"); - pArr[2] = C2U("com.sun.star.text.TextContent"); - return aRet; + return ::sw::SupportsServiceImpl( + g_nServicesTextSection, g_ServicesTextSection, rServiceName); } -/*-- 20.12.2005 10:27:33--------------------------------------------------- +/* -----------------02.11.99 11:30------------------- - -----------------------------------------------------------------------*/ -SwSectionFmt* SwXTextSection::GetFmt()const + --------------------------------------------------*/ +uno::Sequence< OUString > SAL_CALL +SwXTextSection::getSupportedServiceNames() throw (uno::RuntimeException) { - return m_pClient ? - const_cast(static_cast< const SwSectionFmt* >(m_pClient->GetRegisteredIn())) - : 0; + return ::sw::GetSupportedServiceNamesImpl( + g_nServicesTextSection, g_ServicesTextSection); } + diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index 8dadfc47cdf2..4b0a259f2120 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -674,7 +674,10 @@ void SwXText::insertTextContentBefore( throw lang::IllegalArgumentException(); sal_Bool bRet = sal_False; - SwXTextSection* pXSection = SwXTextSection::GetImplementation( xSuccessor ); + const uno::Reference xSuccTunnel(xSuccessor, + uno::UNO_QUERY); + SwXTextSection *const pXSection = + ::sw::UnoTunnelGetImplementation(xSuccTunnel); SwXTextTable* pXTable = SwXTextTable::GetImplementation(xSuccessor ); SwFrmFmt* pTableFmt = pXTable ? pXTable->GetFrmFmt() : 0; SwTxtNode * pTxtNode = 0; @@ -728,7 +731,10 @@ void SwXText::insertTextContentAfter( if(!pPara || !pPara->IsDescriptor() || !xPredecessor.is()) throw lang::IllegalArgumentException(); - SwXTextSection* pXSection = SwXTextSection::GetImplementation( xPredecessor ); + const uno::Reference xPredTunnel(xPredecessor, + uno::UNO_QUERY); + SwXTextSection *const pXSection = + ::sw::UnoTunnelGetImplementation(xPredTunnel); SwXTextTable* pXTable = SwXTextTable::GetImplementation(xPredecessor ); SwFrmFmt* pTableFmt = pXTable ? pXTable->GetFrmFmt() : 0; sal_Bool bRet = sal_False; @@ -779,7 +785,10 @@ void SwXText::removeTextContentBefore( } sal_Bool bRet = sal_False; - SwXTextSection* pXSection = SwXTextSection::GetImplementation( xSuccessor ); + const uno::Reference xSuccTunnel(xSuccessor, + uno::UNO_QUERY); + SwXTextSection *const pXSection = + ::sw::UnoTunnelGetImplementation(xSuccTunnel); SwXTextTable* pXTable = SwXTextTable::GetImplementation( xSuccessor ); SwFrmFmt* pTableFmt = pXTable ? pXTable->GetFrmFmt() : 0; if(pTableFmt && pTableFmt->GetDoc() == GetDoc()) @@ -826,7 +835,10 @@ void SwXText::removeTextContentAfter(const uno::Reference< text::XTextContent>& } sal_Bool bRet = sal_False; - SwXTextSection* pXSection = SwXTextSection::GetImplementation( xPredecessor ); + const uno::Reference xPredTunnel(xPredecessor, + uno::UNO_QUERY); + SwXTextSection *const pXSection = + ::sw::UnoTunnelGetImplementation(xPredTunnel); SwXTextTable* pXTable = SwXTextTable::GetImplementation(xPredecessor ); SwFrmFmt* pTableFmt = pXTable ? pXTable->GetFrmFmt() : 0; if(pTableFmt && pTableFmt->GetDoc() == GetDoc()) -- cgit v1.2.3 From 30bfe9b171379f987c470761acf6735a8b48fe67 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:51 +0100 Subject: swunolocking1: #i105557#: fix locking for SwXTextRanges: add Impl struct, and use UnoImplPtr to lock destructor. move all implementation details out of header, into Impl struct. use new XServiceInfo helpers. replace SvWeirdArray with STL vector. clean up the implementation a little. --- sw/inc/unotextrange.hxx | 33 ++--- sw/source/core/unocore/unoobj2.cxx | 285 ++++++++++++++++++++----------------- sw/source/ui/uno/unotxdoc.cxx | 5 +- sw/source/ui/uno/unotxvw.cxx | 20 +-- 4 files changed, 169 insertions(+), 174 deletions(-) diff --git a/sw/inc/unotextrange.hxx b/sw/inc/unotextrange.hxx index a7d13daf4848..94d4996b4633 100644 --- a/sw/inc/unotextrange.hxx +++ b/sw/inc/unotextrange.hxx @@ -45,10 +45,9 @@ #include #include -#include - #include #include +#include class String; @@ -85,6 +84,13 @@ public: }; +namespace sw { + + void DeepCopyPaM(SwPaM const & rSource, SwPaM & rTarget); + +} // namespace sw + + typedef ::cppu::WeakImplHelper8 < ::com::sun::star::lang::XUnoTunnel , ::com::sun::star::lang::XServiceInfo @@ -300,9 +306,6 @@ public: /* -----------------15.05.98 08:29------------------- * * --------------------------------------------------*/ -typedef ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > * - XTextRangeRefPtr; -SV_DECL_PTRARR(XTextRangeArr, XTextRangeRefPtr, 4, 4) typedef ::cppu::WeakImplHelper3 < ::com::sun::star::lang::XUnoTunnel @@ -312,32 +315,20 @@ typedef ::cppu::WeakImplHelper3 class SwXTextRanges : public SwXTextRanges_Base - , public SwClient { private: - XTextRangeArr* pRangeArr; - ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > - xParentText; - XTextRangeArr* GetRangesArray(); - SwUnoCrsr* GetCrsr() const { return (SwUnoCrsr*)GetRegisteredIn(); } - -protected: + class Impl; + ::sw::UnoImplPtr m_pImpl; virtual ~SwXTextRanges(); public: - SwXTextRanges(); - SwXTextRanges(SwPaM* pCrsr); + SwXTextRanges(SwPaM *const pCrsr); - const SwUnoCrsr* GetCursor() const { - return (const SwUnoCrsr*)(GetRegisteredIn()); - } - - // SwClient - virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + const SwUnoCrsr* GetCursor() const; static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId(); diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index e3515d700d10..57c533833985 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -177,6 +177,29 @@ GetSupportedServiceNamesImpl( } // namespace sw +namespace sw { + +void DeepCopyPaM(SwPaM const & rSource, SwPaM & rTarget) +{ + rTarget = rSource; + + if (rSource.GetNext() != &rSource) + { + SwPaM *pPam = static_cast(rSource.GetNext()); + do + { + // create new PaM + SwPaM *const pNew = new SwPaM(*pPam); + // insert into ring + pNew->MoveTo(&rTarget); + pPam = static_cast(pPam->GetNext()); + } + while (pPam != &rSource); + } +} + +} // namespace sw + struct FrameDependSortListLess { bool operator() (FrameDependSortListEntry const& r1, @@ -1971,6 +1994,96 @@ void SwXTextRange::makeRedline( /****************************************************************** * SwXTextRanges ******************************************************************/ + +class SwXTextRanges::Impl + : public SwClient +{ + +public: + + ::std::vector< uno::Reference< text::XTextRange > > m_Ranges; + + Impl(SwPaM *const pPaM) + : SwClient( (pPaM) + ? pPaM->GetDoc()->CreateUnoCrsr(*pPaM->GetPoint()) + : 0 ) + { + if (pPaM) + { + ::sw::DeepCopyPaM(*pPaM, *GetCursor()); + } + MakeRanges(); + } + + ~Impl() { + // Impl owns the cursor; delete it here: SolarMutex is locked + delete GetRegisteredIn(); + } + + SwUnoCrsr * GetCursor() { + return static_cast( + const_cast(GetRegisteredIn())); + } + + void MakeRanges(); + + // SwClient + virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + +}; + +/*-- 10.12.98 13:57:02--------------------------------------------------- + + -----------------------------------------------------------------------*/ +void SwXTextRanges::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew) +{ + ClientModify(this, pOld, pNew); +} + +/* -----------------10.12.98 14:25------------------- + * + * --------------------------------------------------*/ +void SwXTextRanges::Impl::MakeRanges() +{ + SwUnoCrsr *const pCursor = GetCursor(); + if (pCursor) + { + SwPaM *pTmpCursor = pCursor; + do { + const uno::Reference< text::XTextRange > xRange( + SwXTextRange::CreateTextRangeFromPosition( + pTmpCursor->GetDoc(), + *pTmpCursor->GetPoint(), pTmpCursor->GetMark())); + if (xRange.is()) + { + m_Ranges.push_back(xRange); + } + pTmpCursor = static_cast(pTmpCursor->GetNext()); + } + while (pTmpCursor != pCursor); + } +} + +const SwUnoCrsr* SwXTextRanges::GetCursor() const +{ + return m_pImpl->GetCursor(); +} + +/*-- 10.12.98 13:57:22--------------------------------------------------- + + -----------------------------------------------------------------------*/ +SwXTextRanges::SwXTextRanges(SwPaM *const pPaM) + : m_pImpl( new SwXTextRanges::Impl(pPaM) ) +{ +} + +/*-- 10.12.98 13:57:22--------------------------------------------------- + + -----------------------------------------------------------------------*/ +SwXTextRanges::~SwXTextRanges() +{ +} + /* -----------------------------13.03.00 12:15-------------------------------- ---------------------------------------------------------------------------*/ @@ -1982,188 +2095,98 @@ const uno::Sequence< sal_Int8 > & SwXTextRanges::getUnoTunnelId() /* -----------------------------10.03.00 18:04-------------------------------- ---------------------------------------------------------------------------*/ -sal_Int64 SAL_CALL SwXTextRanges::getSomething( const uno::Sequence< sal_Int8 >& rId ) - throw(uno::RuntimeException) +sal_Int64 SAL_CALL +SwXTextRanges::getSomething(const uno::Sequence< sal_Int8 >& rId) +throw (uno::RuntimeException) { - if( rId.getLength() == 16 - && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), - rId.getConstArray(), 16 ) ) - { - return sal::static_int_cast< sal_Int64 >( reinterpret_cast (this) ); - } - return 0; + return ::sw::UnoTunnelImpl(rId, this); } + /**************************************************************************** * Text positions * Bis zum ersten Zugriff auf eine TextPosition wird ein SwCursor gehalten, * danach wird ein Array mit uno::Reference< XTextPosition > angelegt * ****************************************************************************/ -SV_IMPL_PTRARR(XTextRangeArr, XTextRangeRefPtr); /* -----------------------------06.04.00 16:36-------------------------------- ---------------------------------------------------------------------------*/ -OUString SwXTextRanges::getImplementationName(void) throw( RuntimeException ) +OUString SAL_CALL +SwXTextRanges::getImplementationName() throw (uno::RuntimeException) { return C2U("SwXTextRanges"); } /* -----------------------------06.04.00 16:36-------------------------------- ---------------------------------------------------------------------------*/ -BOOL SwXTextRanges::supportsService(const OUString& rServiceName) throw( RuntimeException ) -{ - return C2U("com.sun.star.text.TextRanges") == rServiceName; -} -/* -----------------------------06.04.00 16:36-------------------------------- - - ---------------------------------------------------------------------------*/ -Sequence< OUString > SwXTextRanges::getSupportedServiceNames(void) throw( RuntimeException ) +static char const*const g_ServicesTextRanges[] = { - Sequence< OUString > aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = C2U("com.sun.star.text.TextRanges"); - return aRet; -} -/*-- 10.12.98 13:57:20--------------------------------------------------- + "com.sun.star.text.TextRanges", +}; +static const size_t g_nServicesTextRanges( + sizeof(g_ServicesTextRanges)/sizeof(g_ServicesTextRanges[0])); - -----------------------------------------------------------------------*/ -SwXTextRanges::SwXTextRanges() : - pRangeArr(0) +sal_Bool SAL_CALL SwXTextRanges::supportsService(const OUString& rServiceName) +throw (uno::RuntimeException) { - + return ::sw::SupportsServiceImpl( + g_nServicesTextRanges, g_ServicesTextRanges, rServiceName); } -/*-- 10.12.98 13:57:22--------------------------------------------------- +/* -----------------------------06.04.00 16:36-------------------------------- - -----------------------------------------------------------------------*/ -SwXTextRanges::SwXTextRanges(SwPaM* pCrsr) : - pRangeArr(0) + ---------------------------------------------------------------------------*/ +uno::Sequence< OUString > SAL_CALL +SwXTextRanges::getSupportedServiceNames() throw (uno::RuntimeException) { - SwUnoCrsr* pUnoCrsr = pCrsr->GetDoc()->CreateUnoCrsr(*pCrsr->GetPoint()); - if(pCrsr->HasMark()) - { - pUnoCrsr->SetMark(); - *pUnoCrsr->GetMark() = *pCrsr->GetMark(); - } - if(pCrsr->GetNext() != pCrsr) - { - SwPaM *_pStartCrsr = (SwPaM *)pCrsr->GetNext(); - do - { - //neuen PaM erzeugen - SwPaM* pPaM = _pStartCrsr->HasMark() ? - new SwPaM(*_pStartCrsr->GetMark(), *_pStartCrsr->GetPoint()) : - new SwPaM(*_pStartCrsr->GetPoint()); - //und in den Ring einfuegen - pPaM->MoveTo(pUnoCrsr); - - } while( (_pStartCrsr=(SwPaM *)_pStartCrsr->GetNext()) != pCrsr ); - } - - pUnoCrsr->Add(this); + return ::sw::GetSupportedServiceNamesImpl( + g_nServicesTextRanges, g_ServicesTextRanges); } -/*-- 10.12.98 13:57:22--------------------------------------------------- - -----------------------------------------------------------------------*/ -SwXTextRanges::~SwXTextRanges() -{ - vos::OGuard aGuard(Application::GetSolarMutex()); - SwUnoCrsr* pCrsr = GetCrsr(); - delete pCrsr; - if(pRangeArr) - { - pRangeArr->DeleteAndDestroy(0, pRangeArr->Count()); - delete pRangeArr; - } -} /*-- 10.12.98 13:57:24--------------------------------------------------- -----------------------------------------------------------------------*/ -sal_Int32 SwXTextRanges::getCount(void) throw( uno::RuntimeException ) +sal_Int32 SAL_CALL SwXTextRanges::getCount() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - sal_Int32 nRet = 0; - SwUnoCrsr* pCrsr = GetCrsr(); - if(pCrsr) - { - SwPaM *pTmpCrsr = pCrsr; - do { - nRet++; - pTmpCrsr = static_cast(pTmpCrsr->GetNext()); - } while ( pTmpCrsr != pCrsr ); - } - else if(pRangeArr) - nRet = pRangeArr->Count(); - return nRet; + + return static_cast(m_pImpl->m_Ranges.size()); } /*-- 10.12.98 13:57:25--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Any SwXTextRanges::getByIndex(sal_Int32 nIndex) - throw( lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException ) +uno::Any SAL_CALL SwXTextRanges::getByIndex(sal_Int32 nIndex) +throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, + uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - uno::Reference< XTextRange > aRef; - XTextRangeArr* pArr = ((SwXTextRanges*)this)->GetRangesArray(); - if(pArr && 0 <= nIndex && nIndex < pArr->Count()) + + if ((nIndex < 0) || + (static_cast(nIndex) >= m_pImpl->m_Ranges.size())) { - XTextRangeRefPtr pRef = pArr->GetObject( USHORT( nIndex )); - aRef = *pRef; - } - else throw lang::IndexOutOfBoundsException(); - uno::Any aRet(&aRef, ::getCppuType((uno::Reference*)0)); - return aRet; + } + uno::Any ret; + ret <<= (m_pImpl->m_Ranges.at(nIndex)); + return ret; } + /*-- 10.12.98 13:57:25--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Type SwXTextRanges::getElementType(void) throw( uno::RuntimeException ) +uno::Type SAL_CALL +SwXTextRanges::getElementType() throw (uno::RuntimeException) { - return ::getCppuType((uno::Reference*)0); + return text::XTextRange::static_type(); } /*-- 10.12.98 13:57:26--------------------------------------------------- -----------------------------------------------------------------------*/ -sal_Bool SwXTextRanges::hasElements(void) throw( uno::RuntimeException ) +sal_Bool SAL_CALL SwXTextRanges::hasElements() throw (uno::RuntimeException) { - vos::OGuard aGuard(Application::GetSolarMutex()); + // no mutex necessary: getCount() does locking return getCount() > 0; } -/* -----------------10.12.98 14:25------------------- - * - * --------------------------------------------------*/ -XTextRangeArr* SwXTextRanges::GetRangesArray() -{ - SwUnoCrsr* pCrsr = GetCrsr(); - if(!pRangeArr && pCrsr) - { - pRangeArr = new XTextRangeArr(); - SwPaM *pTmpCrsr = pCrsr; - do { - - uno::Reference< XTextRange >* pPtr = - new uno::Reference( - SwXTextRange::CreateTextRangeFromPosition( - pTmpCrsr->GetDoc(), - *pTmpCrsr->GetPoint(), pTmpCrsr->GetMark())); -// new uno::Reference( SwXTextRange::createTextRangeFromPaM(*pTmpCrsr, xParentText)); - if(pPtr->is()) - pRangeArr->Insert(pPtr, pRangeArr->Count()); - - pTmpCrsr = static_cast(pTmpCrsr->GetNext()); - } while ( pTmpCrsr != pCrsr ); - pCrsr->Remove( this ); - } - return pRangeArr; -} -/*-- 10.12.98 13:57:02--------------------------------------------------- - - -----------------------------------------------------------------------*/ -void SwXTextRanges::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) -{ - ClientModify(this, pOld, pNew); -} /* -----------------11.12.98 10:07------------------- * diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index ca29279c132b..22d683a0f29d 100644 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -971,10 +971,7 @@ Reference< XIndexAccess > if(!pResultCrsr) throw RuntimeException(); Reference< XIndexAccess > xRet; - if(nResult) - xRet = new SwXTextRanges(pResultCrsr); - else - xRet = new SwXTextRanges(); + xRet = new SwXTextRanges( (nResult) ? pResultCrsr : 0 ); delete pResultCrsr; return xRet; } diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx index 35a4c5a2f92c..6df8553be298 100644 --- a/sw/source/ui/uno/unotxvw.cxx +++ b/sw/source/ui/uno/unotxvw.cxx @@ -108,24 +108,8 @@ SV_IMPL_PTRARR( SelectionChangeListenerArr, XSelectionChangeListenerPtr ); * --------------------------------------------------*/ SwPaM* lcl_createPamCopy(const SwPaM& rPam) { - SwPaM* pRet = new SwPaM(*rPam.GetPoint()); - if(rPam.HasMark()) - { - pRet->SetMark(); - *pRet->GetMark() = *rPam.GetMark(); - } - if(rPam.GetNext() != (const Ring*)&rPam) - { - SwPaM *_pStartCrsr = (SwPaM *)rPam.GetNext(); - do - { - //neuen PaM erzeugen - SwPaM* pPaM = new SwPaM(*_pStartCrsr); - //und in den Ring einfuegen - pPaM->MoveTo(pRet); - - } while( (_pStartCrsr=(SwPaM *)_pStartCrsr->GetNext()) != rPam.GetNext() ); - } + SwPaM *const pRet = new SwPaM(*rPam.GetPoint()); + ::sw::DeepCopyPaM(rPam, *pRet); return pRet; } /****************************************************************** -- cgit v1.2.3 From 220dc1e003f4a26a2d92b6c9bb2464a9b9d63b0e Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:52 +0100 Subject: swunolocking1: #i105557#: SwXTextRange: try to hide the implementation detail that SwXTextRange registers at a bookmark from its clients by using SwXTextRange::GetPositions(). --- sw/inc/unotext.hxx | 5 +- sw/inc/unotextrange.hxx | 6 +- sw/source/core/inc/unometa.hxx | 4 +- sw/source/core/unocore/unoobj.cxx | 87 ++++++++---------------- sw/source/core/unocore/unoobj2.cxx | 8 +-- sw/source/core/unocore/unorefmk.cxx | 63 +++++------------- sw/source/core/unocore/unotext.cxx | 128 ++++++++++++++---------------------- sw/source/ui/uno/unoatxt.cxx | 48 ++++++-------- sw/source/ui/uno/unotxvw.cxx | 9 ++- 9 files changed, 130 insertions(+), 228 deletions(-) diff --git a/sw/inc/unotext.hxx b/sw/inc/unotext.hxx index 499e0620dae4..97a45ece73cf 100644 --- a/sw/inc/unotext.hxx +++ b/sw/inc/unotext.hxx @@ -93,7 +93,7 @@ private: virtual void PrepareForAttach( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xRange, - SwXTextRange const * const pRange, SwPaM const * const pPam); + SwPaM const & rPam); protected: @@ -136,8 +136,7 @@ public: throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); virtual bool CheckForOwnMemberMeta( - const SwXTextRange* const pRange, - const SwPaM* const pPam, bool bAbsorb) + const SwPaM & rPam, const bool bAbsorb) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); diff --git a/sw/inc/unotextrange.hxx b/sw/inc/unotextrange.hxx index 94d4996b4633..079296d2a441 100644 --- a/sw/inc/unotextrange.hxx +++ b/sw/inc/unotextrange.hxx @@ -130,7 +130,9 @@ private: xParentText; ::sw::mark::IMark* pMark; - void _CreateNewBookmark(SwPaM& rPam); + const ::sw::mark::IMark * GetBookmark() const + { return pMark; } + void SetPositions(SwPaM const& rPam); //TODO: new exception type for protected content void DeleteAndInsert(const String& rText, const bool bForceExpandHints) throw (::com::sun::star::uno::RuntimeException); @@ -153,8 +155,6 @@ public: { return pDoc; } SwDoc* GetDoc() { return pDoc; } - const ::sw::mark::IMark * GetBookmark() const - { return pMark; } static BOOL XTextRangeToSwPaM(SwUnoInternalPaM& rToFill, const ::com::sun::star::uno::Reference< diff --git a/sw/source/core/inc/unometa.hxx b/sw/source/core/inc/unometa.hxx index 5568aa88b52e..39f81caa902a 100755 --- a/sw/source/core/inc/unometa.hxx +++ b/sw/source/core/inc/unometa.hxx @@ -52,7 +52,6 @@ typedef ::std::deque< ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > > TextRangeList_t; -class SwXTextRange; class SwPaM; class SwTxtNode; @@ -117,8 +116,7 @@ public: ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > GetParentText() const; - bool CheckForOwnMemberMeta(const SwXTextRange* const pRange, - const SwPaM* const pPam, bool bAbsorb) + bool CheckForOwnMemberMeta(const SwPaM & rPam, const bool bAbsorb) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx index eb89201cf978..b48451b90cf9 100644 --- a/sw/source/core/unocore/unoobj.cxx +++ b/sw/source/core/unocore/unoobj.cxx @@ -1181,17 +1181,26 @@ void SwXTextCursor::gotoRange(const uno::Reference< XTextRange > & xRange, sal_B const SwStartNode* pOwnStartNode = pOwnCursor->GetNode()-> FindSttNodeByType(eSearchNodeType); - const SwNode* pSrcNode = 0; - if(pCursor && pCursor->GetPaM()) + SwPaM aPam(GetDoc()->GetNodes()); + const SwPaM * pPam(0); + if (pCursor) { - pSrcNode = pCursor->GetPaM()->GetNode(); + pPam = pCursor->GetPaM(); } - else if(pRange && pRange->GetBookmark()) + else if (pRange) { - ::sw::mark::IMark const * const pBkmk = pRange->GetBookmark(); - pSrcNode = &pBkmk->GetMarkPos().nNode.GetNode(); + if (pRange->GetPositions(aPam)) + { + pPam = & aPam; + } + } + + if (!pPam) + { + throw uno::RuntimeException(); } - const SwStartNode* pTmp = pSrcNode ? pSrcNode->FindSttNodeByType(eSearchNodeType) : 0; + const SwStartNode* pTmp = + pPam->GetNode()->FindSttNodeByType(eSearchNodeType); //SectionNodes ueberspringen while(pTmp && pTmp->IsSectionNode()) @@ -1209,16 +1218,9 @@ void SwXTextCursor::gotoRange(const uno::Reference< XTextRange > & xRange, sal_B if (CURSOR_META == eType) { - const SwPosition & rPoint( (pRange) - ? pRange->GetBookmark()->GetMarkPos() - : *pCursor->GetPaM()->GetPoint() ); - const SwPosition & rMark ( (pRange) - ? ((pRange->GetBookmark()->IsExpanded()) - ? pRange->GetBookmark()->GetOtherMarkPos() : rPoint) - : *pCursor->GetPaM()->GetMark() ); - SwPaM aPam(rPoint, rMark); + SwPaM CopyPam(*pPam->GetMark(), *pPam->GetPoint()); const bool bNotForced( - lcl_ForceIntoMeta(aPam, xParentText, META_CHECK_BOTH) ); + lcl_ForceIntoMeta(CopyPam, xParentText, META_CHECK_BOTH) ); if (!bNotForced) { throw uno::RuntimeException( @@ -1241,26 +1243,9 @@ void SwXTextCursor::gotoRange(const uno::Reference< XTextRange > & xRange, sal_B aOwnLeft = aOwnRight; aOwnRight = aTmp; } - SwPosition* pParamLeft; - SwPosition* pParamRight; - if(pCursor) - { - const SwPaM* pTmp2 = pCursor->GetPaM(); - pParamLeft = new SwPosition(*pTmp2->GetPoint()); - pParamRight = new SwPosition(pTmp2->HasMark() ? *pTmp2->GetMark() : *pParamLeft); - } - else - { - ::sw::mark::IMark const * const pBkmk = pRange->GetBookmark(); - pParamLeft = new SwPosition(pBkmk->GetMarkPos()); - pParamRight = new SwPosition(pBkmk->IsExpanded() ? pBkmk->GetOtherMarkPos() : *pParamLeft); - } - if(*pParamRight < *pParamLeft) - { - SwPosition* pTmp2 = pParamLeft; - pParamLeft = pParamRight; - pParamRight = pTmp2; - } + SwPosition const* pParamLeft = pPam->Start(); + SwPosition const* pParamRight = pPam->End(); + // jetzt sind vier SwPositions da, zwei davon werden gebraucht, also welche? if(aOwnRight > *pParamRight) *pOwnCursor->GetPoint() = aOwnRight; @@ -1271,35 +1256,19 @@ void SwXTextCursor::gotoRange(const uno::Reference< XTextRange > & xRange, sal_B *pOwnCursor->GetMark() = aOwnLeft; else *pOwnCursor->GetMark() = *pParamLeft; - delete pParamLeft; - delete pParamRight; } else { - //der Cursor soll dem uebergebenen Range entsprechen - if(pCursor) + // cursor should be the given range + *pOwnCursor->GetPoint() = *pPam->GetPoint(); + if (pPam->HasMark()) { - const SwPaM* pTmp2 = pCursor->GetPaM(); - *pOwnCursor->GetPoint() = *pTmp2->GetPoint(); - if(pTmp2->HasMark()) - { - pOwnCursor->SetMark(); - *pOwnCursor->GetMark() = *pTmp2->GetMark(); - } - else - pOwnCursor->DeleteMark(); + pOwnCursor->SetMark(); + *pOwnCursor->GetMark() = *pPam->GetMark(); } else { - ::sw::mark::IMark const * const pBkmk = pRange->GetBookmark(); - *pOwnCursor->GetPoint() = pBkmk->GetMarkPos(); - if(pBkmk->IsExpanded()) - { - pOwnCursor->SetMark(); - *pOwnCursor->GetMark() = pBkmk->GetOtherMarkPos(); - } - else - pOwnCursor->DeleteMark(); + pOwnCursor->DeleteMark(); } } } @@ -1923,7 +1892,7 @@ void SwXTextCursor::setString(const OUString& aString) throw( uno::RuntimeExcept const bool bForceExpandHints( (CURSOR_META != eType) ? false : dynamic_cast(xParentText.get())->CheckForOwnMemberMeta( - 0, GetPaM(), true) ); + *GetPaM(), true) ); DeleteAndInsert(aString, bForceExpandHints); } /* -----------------------------03.05.00 12:56-------------------------------- diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index 57c533833985..6ca031d041ba 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -1377,7 +1377,7 @@ SwXTextRange::SwXTextRange(SwPaM& rPam, xParentText(rxParent), pMark(NULL) { - _CreateNewBookmark(rPam); + SetPositions(rPam); } SwXTextRange::SwXTextRange(SwFrmFmt& rTblFmt) : @@ -1394,7 +1394,7 @@ SwXTextRange::SwXTextRange(SwFrmFmt& rTblFmt) : SwPosition aPosition( *pTblNode ); SwPaM aPam( aPosition ); - _CreateNewBookmark( aPam ); + SetPositions( aPam ); } SwXTextRange::~SwXTextRange() @@ -1405,7 +1405,7 @@ SwXTextRange::~SwXTextRange() pDoc->getIDocumentMarkAccess()->deleteMark(pBkmk); } -void SwXTextRange::_CreateNewBookmark(SwPaM& rPam) +void SwXTextRange::SetPositions(const SwPaM& rPam) { IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess(); @@ -1452,7 +1452,7 @@ void SwXTextRange::DeleteAndInsert( SwXTextCursor::SelectPam(aNewCrsr, sal_True); aNewCrsr.Left(rText.Len(), CRSR_SKIP_CHARS, FALSE, FALSE); } - _CreateNewBookmark(aNewCrsr); + SetPositions(aNewCrsr); pDoc->EndUndo(UNDO_INSERT, NULL); } } diff --git a/sw/source/core/unocore/unorefmk.cxx b/sw/source/core/unocore/unorefmk.cxx index 39e93acd19dc..68516a923eb7 100644 --- a/sw/source/core/unocore/unorefmk.cxx +++ b/sw/source/core/unocore/unorefmk.cxx @@ -586,12 +586,10 @@ private: SwXMeta & m_rMeta; virtual void PrepareForAttach(uno::Reference< text::XTextRange > & xRange, - const SwXTextRange* const pRange, const SwPaM * const pPam); + const SwPaM & rPam); - virtual bool CheckForOwnMemberMeta(const SwXTextRange* const pRange, - const SwPaM* const pPam, bool bAbsorb) - throw (::com::sun::star::lang::IllegalArgumentException, - ::com::sun::star::uno::RuntimeException); + virtual bool CheckForOwnMemberMeta(const SwPaM & rPam, const bool bAbsorb) + throw (lang::IllegalArgumentException, uno::RuntimeException); protected: virtual const SwStartNode *GetStartNode() const; @@ -637,41 +635,18 @@ const SwStartNode *SwXMetaText::GetStartNode() const } void SwXMetaText::PrepareForAttach( uno::Reference & xRange, - const SwXTextRange* const pRange, const SwPaM * const pPam) + const SwPaM & rPam) { - SwPosition const* pPoint(0); - SwPosition const* pMark (0); - if (pRange) - { - ::sw::mark::IMark const& rIMark(*pRange->GetBookmark()); - pMark = &rIMark.GetMarkPos(); - if (rIMark.IsExpanded()) - { - pMark = &rIMark.GetOtherMarkPos(); - } - } - else if (pPam) - { - pPoint = pPam->GetPoint(); - if (pPam->HasMark()) - { - pMark = pPam->GetMark(); - } - } // create a new cursor to prevent modifying SwXTextRange - if (pPoint) - { - xRange = static_cast( - new SwXTextCursor(&m_rMeta, *pPoint, CURSOR_META, GetDoc(), pMark)); - } + xRange = static_cast( + new SwXTextCursor(&m_rMeta, *rPam.GetPoint(), CURSOR_META, + GetDoc(), (rPam.HasMark()) ? rPam.GetMark() : 0)); } -bool SwXMetaText::CheckForOwnMemberMeta(const SwXTextRange* const pRange, - const SwPaM* const pPam, bool bAbsorb) - throw (::com::sun::star::lang::IllegalArgumentException, - ::com::sun::star::uno::RuntimeException) +bool SwXMetaText::CheckForOwnMemberMeta(const SwPaM & rPam, const bool bAbsorb) + throw (lang::IllegalArgumentException, uno::RuntimeException) { - return m_rMeta.CheckForOwnMemberMeta(pRange, pPam, bAbsorb); + return m_rMeta.CheckForOwnMemberMeta(rPam, bAbsorb); } uno::Reference< text::XTextCursor > SwXMetaText::createCursor() @@ -884,11 +859,9 @@ bool SwXMeta::SetContentRange( return false; } -bool SwXMeta::CheckForOwnMemberMeta(const SwXTextRange* const pRange, - const SwPaM* const pPam, bool bAbsorb) +bool SwXMeta::CheckForOwnMemberMeta(const SwPaM & rPam, const bool bAbsorb) throw (lang::IllegalArgumentException, uno::RuntimeException) { - ASSERT((pPam && !pRange) || (!pPam && pRange), "ERROR: pam xor range"); SwTxtNode * pTxtNode; xub_StrLen nMetaStart; xub_StrLen nMetaEnd; @@ -896,9 +869,8 @@ bool SwXMeta::CheckForOwnMemberMeta(const SwXTextRange* const pRange, ASSERT(bSuccess, "no pam?"); if (!bSuccess) throw lang::DisposedException(); - SwPosition const * const pStartPos( (pPam) - ? pPam->Start() - : &pRange->GetBookmark()->GetMarkStart() ); + + SwPosition const * const pStartPos( rPam.Start() ); if (&pStartPos->nNode.GetNode() != pTxtNode) { throw lang::IllegalArgumentException( @@ -921,14 +893,9 @@ bool SwXMeta::CheckForOwnMemberMeta(const SwXTextRange* const pRange, { bForceExpandHints = true; } - const bool bHasEnd( (pPam) - ? pPam->HasMark() - : pRange->GetBookmark()->IsExpanded()); - if (bHasEnd && bAbsorb) + if (rPam.HasMark() && bAbsorb) { - SwPosition const * const pEndPos( (pPam) - ? pPam->End() - : &pRange->GetBookmark()->GetMarkEnd() ); + SwPosition const * const pEndPos( rPam.End() ); if (&pEndPos->nNode.GetNode() != pTxtNode) { throw lang::IllegalArgumentException( diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index 4b0a259f2120..7c0fe114b489 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -91,16 +91,13 @@ const sal_Char cInvalidObject[] = "this object is invalid"; -----------------------------------------------------------------------*/ -void SwXText::PrepareForAttach( ::com::sun::star::uno::Reference< - ::com::sun::star::text::XTextRange > &, - const SwXTextRange* const, const SwPaM * const) +void +SwXText::PrepareForAttach(uno::Reference< text::XTextRange > &, const SwPaM &) { } -bool SwXText::CheckForOwnMemberMeta(const SwXTextRange* const, - const SwPaM* const, bool) - throw (::com::sun::star::lang::IllegalArgumentException, - ::com::sun::star::uno::RuntimeException) +bool SwXText::CheckForOwnMemberMeta(const SwPaM &, const bool) + throw (lang::IllegalArgumentException, uno::RuntimeException) { ASSERT(CURSOR_META != eCrsrType, "should not be called!"); return false; @@ -285,35 +282,43 @@ void SwXText::insertString(const uno::Reference< text::XTextRange >& xTextRange, if(pRange && pRange->GetDoc() == GetDoc() || pCursor && pCursor->GetDoc() == GetDoc()) { - const SwStartNode* pOwnStartNode = GetStartNode(); - if(pCursor) + const SwStartNode *const pOwnStartNode = GetStartNode(); + SwPaM aPam(GetDoc()->GetNodes()); + const SwPaM * pPam(0); + if (pCursor) { - const SwStartNode* pTmp = pCursor->GetPaM()->GetNode()->StartOfSectionNode(); - while(pTmp && pTmp->IsSectionNode()) - { - pTmp = pTmp->StartOfSectionNode(); - } - if( !pOwnStartNode || pOwnStartNode != pTmp) + pPam = pCursor->GetPaM(); + } + else // pRange + { + if (pRange->GetPositions(aPam)) { - throw uno::RuntimeException(); + pPam = &aPam; } } - else //dann pRange + if (!pPam) { - ::sw::mark::IMark const * const pBkmk = pRange->GetBookmark(); - const SwStartNode* pTmp = pBkmk->GetMarkPos().nNode.GetNode().StartOfSectionNode(); - while(pTmp && pTmp->IsSectionNode()) + throw uno::RuntimeException(); + } + else + { + const SwStartNode* pTmp(pPam->GetNode()->StartOfSectionNode()); + while (pTmp && pTmp->IsSectionNode()) + { pTmp = pTmp->StartOfSectionNode(); - if(!pOwnStartNode || pOwnStartNode != pTmp) + } + if (!pOwnStartNode || (pOwnStartNode != pTmp)) + { throw uno::RuntimeException(); + } } + bool bForceExpandHints( false ); if (CURSOR_META == eCrsrType) { try { - bForceExpandHints = CheckForOwnMemberMeta( - pRange, (pCursor) ? pCursor->GetPaM() : 0, bAbsorb); + bForceExpandHints = CheckForOwnMemberMeta(*pPam, bAbsorb); } catch (lang::IllegalArgumentException & iae) { @@ -348,10 +353,7 @@ void SwXText::insertString(const uno::Reference< text::XTextRange >& xTextRange, //hier wird ein PaM angelegt, der vor dem Parameter-PaM liegt, damit der //Text davor eingefuegt wird UnoActionContext aContext(GetDoc()); - const SwPosition* pPos = pCursor - ? pCursor->GetPaM()->Start() - : &pRange->GetBookmark()->GetMarkStart(); - SwPaM aInsertPam(*pPos); + SwPaM aInsertPam(*pPam->Start()); const sal_Bool bGroupUndo = GetDoc()->DoesGroupUndo(); GetDoc()->DoGroupUndo(sal_False); @@ -382,8 +384,7 @@ void SwXText::insertControlCharacter(const uno::Reference< text::XTextRange > & SwUnoInternalPaM aPam(*GetDoc()); if(SwXTextRange::XTextRangeToSwPaM(aPam, xTextRange)) { - const bool bForceExpandHints( - CheckForOwnMemberMeta( 0, &aPam, bAbsorb) ); + const bool bForceExpandHints(CheckForOwnMemberMeta(aPam, bAbsorb)); const enum IDocumentContentOperations::InsertFlags nInsertFlags = (bForceExpandHints) @@ -424,7 +425,7 @@ void SwXText::insertControlCharacter(const uno::Reference< text::XTextRange > & } if(pRange) { - pRange->_CreateNewBookmark(aTmp); + pRange->SetPositions(aTmp); } else if(pCursor) { @@ -462,7 +463,9 @@ void SwXText::insertControlCharacter(const uno::Reference< text::XTextRange > & aCrsr.Left(1, CRSR_SKIP_CHARS, FALSE, FALSE); //hier muss der uebergebene PaM umgesetzt werden: if(pRange) - pRange->_CreateNewBookmark(aCrsr); + { + pRange->SetPositions(aCrsr); + } else { SwPaM* pUnoCrsr = pCursor->GetPaM(); @@ -541,33 +544,8 @@ void SwXText::insertTextContent(const uno::Reference< text::XTextRange > & xRang ; } - const SwNode* pSrcNode = 0; - if(pCursor && pCursor->GetPaM()) - { - pSrcNode = pCursor->GetPaM()->GetNode(); - } - else if (pRange && pRange->GetBookmark()) - { - ::sw::mark::IMark const * const pBkmk = pRange->GetBookmark(); - pSrcNode = &pBkmk->GetMarkPos().nNode.GetNode(); - } - else if (pPortion && pPortion->GetCursor()) - { - pSrcNode = pPortion->GetCursor()->GetNode(); - } - else if (pText) - { - uno::Reference xTextCursor = pText->createCursor(); - xTextCursor->gotoEnd(sal_True); - uno::Reference xCrsrTunnel( xTextCursor, uno::UNO_QUERY ); - pCursor = reinterpret_cast< OTextCursorHelper * >( - sal::static_int_cast< sal_IntPtr >( xCrsrTunnel->getSomething( OTextCursorHelper::getUnoTunnelId()) )); - pSrcNode = pCursor->GetPaM()->GetNode(); - } - else - throw lang::IllegalArgumentException(); - - const SwStartNode* pTmp = pSrcNode->FindSttNodeByType(eSearchNodeType); + const SwStartNode* pTmp = + aPam.GetNode()->FindSttNodeByType(eSearchNodeType); //SectionNodes ueberspringen while(pTmp && pTmp->IsSectionNode()) @@ -587,8 +565,7 @@ void SwXText::insertTextContent(const uno::Reference< text::XTextRange > & xRang throw aRunException; } - const bool bForceExpandHints( CheckForOwnMemberMeta( - pRange, (pCursor) ? pCursor->GetPaM() : 0, bAbsorb) ); + const bool bForceExpandHints(CheckForOwnMemberMeta(aPam, bAbsorb)); // Sonderbehandlung fuer Contents, die den Range nicht ersetzen, sonder darueber gelegt werden // Bookmarks, IndexEntry @@ -627,8 +604,7 @@ void SwXText::insertTextContent(const uno::Reference< text::XTextRange > & xRang if (bForceExpandHints) { // if necessary, replace xTempRange with a new SwXTextCursor - PrepareForAttach(xTempRange, pRange, - (pCursor) ? pCursor->GetPaM() : 0); + PrepareForAttach(xTempRange, aPam); } xContent->attach(xTempRange); } @@ -1047,13 +1023,19 @@ sal_Bool SwXText::CheckForOwnMember( } const SwNode* pSrcNode; - if(pCursor) + if (pCursor) + { pSrcNode = pCursor->GetPaM()->GetNode(); - else //dann pRange + } + else // pRange { - ::sw::mark::IMark const * const pBkmk = pRange->GetBookmark(); - pSrcNode = &pBkmk->GetMarkPos().nNode.GetNode(); + SwPaM aPam(pRange->GetDoc()->GetNodes().GetEndOfContent()); + if (pRange->GetPositions(aPam)) + { + pSrcNode = aPam.GetNode(); + } } + if (!pSrcNode) { return sal_False; } const SwStartNode* pTmp = pSrcNode->FindSttNodeByType(eSearchNodeType); //SectionNodes ueberspringen @@ -1107,18 +1089,8 @@ sal_Int16 SwXText::ComparePositions( if(CheckForOwnMember(pRange1, pCursor1) && CheckForOwnMember( pRange2, pCursor2)) { - const SwPosition *pStart1 = 0; - const SwPosition *pStart2 = 0; - - if(pRange1) - pStart1 = pRange1->GetBookmark() ? &(pRange1->GetBookmark()->GetMarkStart()) : 0; - else - pStart1 = pCursor1->GetPaM() ? pCursor1->GetPaM()->Start() : 0; - - if(pRange2) - pStart2 = pRange2->GetBookmark() ? &(pRange2->GetBookmark()->GetMarkStart()) : 0; - else - pStart2 = pCursor2->GetPaM() ? pCursor2->GetPaM()->Start() : 0; + SwPosition const*const pStart1 = aPam1.Start(); + SwPosition const*const pStart2 = aPam2.Start(); if(pStart1 && pStart2) { diff --git a/sw/source/ui/uno/unoatxt.cxx b/sw/source/ui/uno/unoatxt.cxx index 87d27b15a76b..d3e03aa307a6 100644 --- a/sw/source/ui/uno/unoatxt.cxx +++ b/sw/source/ui/uno/unoatxt.cxx @@ -411,25 +411,25 @@ sal_Bool lcl_CopySelToDoc( SwDoc* pInsDoc, OTextCursorHelper* pxCursor, SwXTextR SwCntntNode * pNd = aIdx.GetNode().GetCntntNode(); SwPosition aPos( aIdx, SwIndex( pNd, pNd->Len() )); - sal_Bool bRet = sal_False; + bool bRet = false; pInsDoc->LockExpFlds(); { + SwDoc *const pDoc((pxCursor) ? pxCursor->GetDoc() : pxRange->GetDoc()); + SwPaM aPam(pDoc->GetNodes()); + SwPaM * pPam(0); if(pxCursor) { - SwPaM* pUnoCrsr = pxCursor->GetPaM(); - bRet = pxCursor->GetDoc()->CopyRange( *pUnoCrsr, aPos, false ) - || bRet; + pPam = pxCursor->GetPaM(); } else { - const ::sw::mark::IMark* const pBkmk = pxRange->GetBookmark(); - if(pBkmk && pBkmk->IsExpanded()) + if (pxRange->GetPositions(aPam)) { - SwPaM aTmp(pBkmk->GetOtherMarkPos(), pBkmk->GetMarkPos()); - bRet = pxRange->GetDoc()->CopyRange(aTmp, aPos, false) - || bRet; + pPam = & aPam; } } + if (!pPam) { return false; } + bRet = pDoc->CopyRange( *pPam, aPos, false ) || bRet; } pInsDoc->UnlockExpFlds(); @@ -1113,7 +1113,7 @@ void SwXAutoTextEntry::applyTo(const uno::Reference< text::XTextRange > & xTextR } SwDoc* pDoc = 0; - if ( pRange && pRange->GetBookmark()) + if (pRange) pDoc = pRange->GetDoc(); else if ( pCursor ) pDoc = pCursor->GetDoc(); @@ -1131,29 +1131,23 @@ void SwXAutoTextEntry::applyTo(const uno::Reference< text::XTextRange > & xTextR if(!pDoc) throw uno::RuntimeException(); - SwPaM* pInsertPaM = 0; - if(pRange) + + SwPaM InsertPaM(pDoc->GetNodes()); + if (pRange) { - const ::sw::mark::IMark* const pBkmk = pRange->GetBookmark(); - if(pBkmk->IsExpanded()) - pInsertPaM = new SwPaM(pBkmk->GetOtherMarkPos(), pBkmk->GetMarkPos()); - else - pInsertPaM = new SwPaM(pBkmk->GetMarkPos()); + if (!pRange->GetPositions(InsertPaM)) + { + throw uno::RuntimeException(); + } } else { - SwPaM* pCrsr = pCursor->GetPaM(); - if(pCrsr->HasMark()) - pInsertPaM = new SwPaM(*pCrsr->GetPoint(), *pCrsr->GetMark()); - else - pInsertPaM = new SwPaM(*pCrsr->GetPoint()); + InsertPaM = *pCursor->GetPaM(); } - SwTextBlocks* pBlock = pGlossaries->GetGroupDoc(sGroupName); - sal_Bool bResult = pBlock && !pBlock->GetError() && - pDoc->InsertGlossary( *pBlock, sEntryName, *pInsertPaM); - delete pBlock; - delete pInsertPaM; + ::std::auto_ptr pBlock(pGlossaries->GetGroupDoc(sGroupName)); + const bool bResult = pBlock.get() && !pBlock->GetError() + && pDoc->InsertGlossary( *pBlock, sEntryName, InsertPaM); if(!bResult) throw uno::RuntimeException(); diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx index 6df8553be298..9e637ca58260 100644 --- a/sw/source/ui/uno/unotxvw.cxx +++ b/sw/source/ui/uno/unotxvw.cxx @@ -1418,10 +1418,13 @@ void SwXTextViewCursor::gotoRange( { pSrcNode = pCursor->GetPaM()->GetNode(); } - else if(pRange && pRange->GetBookmark()) + else if (pRange) { - const ::sw::mark::IMark* const pBkmk = pRange->GetBookmark(); - pSrcNode = &(pBkmk->GetMarkPos().nNode.GetNode()); + SwPaM aPam(pRange->GetDoc()->GetNodes()); + if (pRange->GetPositions(aPam)) + { + pSrcNode = aPam.GetNode(); + } } else if (pPara && pPara->GetTxtNode()) { -- cgit v1.2.3 From 1f8d8b1e17487074cf77595ab9d9569858e6f04e Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:52 +0100 Subject: swunolocking1: #i105557#: fix locking for SwXTextRange: add Impl struct, and use UnoImplPtr to lock destructor. move all implementation details out of header, into Impl struct. use new XUnoTunnel and XServiceInfo helpers. clean up the implementation a little. --- sw/inc/unotextrange.hxx | 54 +--- sw/source/core/unocore/unoobj2.cxx | 641 ++++++++++++++++++++++--------------- sw/source/core/unocore/unotext.cxx | 8 +- 3 files changed, 395 insertions(+), 308 deletions(-) diff --git a/sw/inc/unotextrange.hxx b/sw/inc/unotextrange.hxx index 079296d2a441..8b34ce7f94c1 100644 --- a/sw/inc/unotextrange.hxx +++ b/sw/inc/unotextrange.hxx @@ -45,26 +45,15 @@ #include #include -#include #include #include -class String; -class SfxItemPropertySet; class SwDoc; -class SwStartNode; struct SwPosition; class SwPaM; class SwUnoCrsr; class SwFrmFmt; -class SwTableBox; - -namespace sw { - namespace mark { - class IMark; - } -} /* -----------------29.04.98 07:35------------------- * @@ -104,13 +93,15 @@ typedef ::cppu::WeakImplHelper8 class SW_DLLPUBLIC SwXTextRange : public SwXTextRange_Base - , private SwClient { private: friend class SwXText; + class Impl; + ::sw::UnoImplPtr m_pImpl; + enum RangePosition { RANGE_IN_TEXT, // "ordinary" ::com::sun::star::text::TextRange @@ -118,26 +109,14 @@ private: RANGE_IN_CELL, // position created with a cell that has no uno object RANGE_IS_TABLE, // anchor of a table RANGE_INVALID // created by NewInstance - } eRangePosition; - - SwDoc* pDoc; - SwTableBox* pBox; - const SwStartNode* pBoxStartNode; - SwDepend aObjectDepend; // register at format of table or frame - const SfxItemPropertySet* m_pPropSet; - //SwDepend aFrameDepend; - ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > - xParentText; - ::sw::mark::IMark* pMark; - - const ::sw::mark::IMark * GetBookmark() const - { return pMark; } + }; + void SetPositions(SwPaM const& rPam); //TODO: new exception type for protected content - void DeleteAndInsert(const String& rText, const bool bForceExpandHints) + void DeleteAndInsert( + const ::rtl::OUString& rText, const bool bForceExpandHints) throw (::com::sun::star::uno::RuntimeException); - -protected: + void Invalidate(); virtual ~SwXTextRange(); @@ -146,31 +125,26 @@ public: SwXTextRange(SwPaM& rPam, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > & xParent, - enum RangePosition eRange = RANGE_IN_TEXT); + const enum RangePosition eRange = RANGE_IN_TEXT); // only for RANGE_IS_TABLE SwXTextRange(SwFrmFmt& rTblFmt); - BOOL GetPositions(SwPaM& rToFill) const; - const SwDoc* GetDoc() const - { return pDoc; } - SwDoc* GetDoc() - { return pDoc; } + const SwDoc* GetDoc() const; + SwDoc* GetDoc(); + bool GetPositions(SwPaM & rToFill) const; static BOOL XTextRangeToSwPaM(SwUnoInternalPaM& rToFill, const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange); + static ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > CreateTextRangeFromPosition( SwDoc* pDoc, const SwPosition& rPos, const SwPosition* pMark); + static ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > CreateParentXText(SwDoc* pDoc, const SwPosition& rPos); - TYPEINFO(); - - // SwClient - virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); - static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId(); // XUnoTunnel diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index 6ca031d041ba..0af4a74b52ff 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -1314,83 +1314,97 @@ throw (container::NoSuchElementException, lang::WrappedTargetException, /****************************************************************** * SwXTextRange ******************************************************************/ -TYPEINIT1(SwXTextRange, SwClient); -const uno::Sequence< sal_Int8 > & SwXTextRange::getUnoTunnelId() +class SwXTextRange::Impl + : public SwClient { - static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId(); - return aSeq; -} -//XUnoTunnel -sal_Int64 SAL_CALL SwXTextRange::getSomething( - const uno::Sequence< sal_Int8 >& rId ) - throw(uno::RuntimeException) -{ - if( rId.getLength() == 16 - && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), - rId.getConstArray(), 16 ) ) +public: + + const SfxItemPropertySet & m_rPropSet; + const enum RangePosition m_eRangePosition; + SwDoc & m_rDoc; + uno::Reference m_xParentText; + SwDepend m_ObjectDepend; // register at format of table or frame + ::sw::mark::IMark * m_pMark; + + Impl( SwDoc & rDoc, const enum RangePosition eRange, + SwFrmFmt *const pTblFmt = 0, + const uno::Reference< text::XText > & xParent = 0) + : SwClient() + , m_rPropSet(*aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_CURSOR)) + , m_eRangePosition(eRange) + , m_rDoc(rDoc) + , m_xParentText(xParent) + , m_ObjectDepend(this, pTblFmt) + , m_pMark(0) + { + } + + ~Impl() + { + // Impl owns the bookmark; delete it here: SolarMutex is locked + Invalidate(); + } + + void Invalidate() + { + if (m_pMark) { - return sal::static_int_cast< sal_Int64 >( reinterpret_cast (this) ); + m_rDoc.getIDocumentMarkAccess()->deleteMark(m_pMark); + m_pMark = 0; } - return 0; -} + } -OUString SwXTextRange::getImplementationName(void) throw( RuntimeException ) -{ - return OUString::createFromAscii("SwXTextRange"); -} + const ::sw::mark::IMark * GetBookmark() const { return m_pMark; } -BOOL SwXTextRange::supportsService(const OUString& rServiceName) throw( RuntimeException ) -{ - String sServiceName(rServiceName); - return sServiceName.EqualsAscii("com.sun.star.text.TextRange") || - sServiceName.EqualsAscii("com.sun.star.style.CharacterProperties")|| - sServiceName.EqualsAscii("com.sun.star.style.CharacterPropertiesAsian")|| - sServiceName.EqualsAscii("com.sun.star.style.CharacterPropertiesComplex")|| - sServiceName.EqualsAscii("com.sun.star.style.ParagraphProperties") || - sServiceName.EqualsAscii("com.sun.star.style.ParagraphPropertiesAsian") || - sServiceName.EqualsAscii("com.sun.star.style.ParagraphPropertiesComplex"); -} + // SwClient + virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); -Sequence< OUString > SwXTextRange::getSupportedServiceNames(void) throw( RuntimeException ) +}; + +void SwXTextRange::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew) { - Sequence< OUString > aRet(7); - aRet[0] = OUString::createFromAscii("com.sun.star.text.TextRange"); - aRet[1] = OUString::createFromAscii("com.sun.star.style.CharacterProperties"); - aRet[2] = OUString::createFromAscii("com.sun.star.style.CharacterPropertiesAsian"); - aRet[3] = OUString::createFromAscii("com.sun.star.style.CharacterPropertiesComplex"); - aRet[4] = OUString::createFromAscii("com.sun.star.style.ParagraphProperties"); - aRet[5] = OUString::createFromAscii("com.sun.star.style.ParagraphPropertiesAsian"); - aRet[6] = OUString::createFromAscii("com.sun.star.style.ParagraphPropertiesComplex"); - return aRet; + const bool bAlreadyRegistered = 0 != GetRegisteredIn(); + ClientModify(this, pOld, pNew); + if (m_ObjectDepend.GetRegisteredIn()) + { + ClientModify(&m_ObjectDepend, pOld, pNew); + // if the depend was removed then the range must be removed too + if (!m_ObjectDepend.GetRegisteredIn() && GetRegisteredIn()) + { + const_cast(GetRegisteredIn())->Remove(this); + } + // or if the range has been removed but the depend ist still + // connected then the depend must be removed + else if (bAlreadyRegistered && !GetRegisteredIn() && + m_ObjectDepend.GetRegisteredIn()) + { + const_cast(m_ObjectDepend.GetRegisteredIn()) + ->Remove(& m_ObjectDepend); + } + } + if (!GetRegisteredIn()) + { + m_pMark = 0; + } } + SwXTextRange::SwXTextRange(SwPaM& rPam, - const uno::Reference< XText > & rxParent, enum RangePosition eRange) : - eRangePosition(eRange), - pDoc(rPam.GetDoc()), - pBox(0), - pBoxStartNode(0), - aObjectDepend(this, 0), - m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_CURSOR)), - xParentText(rxParent), - pMark(NULL) + const uno::Reference< text::XText > & xParent, + const enum RangePosition eRange) + : m_pImpl( new SwXTextRange::Impl(*rPam.GetDoc(), eRange, 0, xParent) ) { SetPositions(rPam); } -SwXTextRange::SwXTextRange(SwFrmFmt& rTblFmt) : - eRangePosition(RANGE_IS_TABLE), - pDoc(rTblFmt.GetDoc()), - pBox(0), - pBoxStartNode(0), - aObjectDepend(this, &rTblFmt), - m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_CURSOR)), - pMark(NULL) +SwXTextRange::SwXTextRange(SwFrmFmt& rTblFmt) + : m_pImpl( + new SwXTextRange::Impl(*rTblFmt.GetDoc(), RANGE_IS_TABLE, &rTblFmt) ) { - SwTable* pTable = SwTable::FindTable( &rTblFmt ); - SwTableNode* pTblNode = pTable->GetTableNode( ); + SwTable *const pTable = SwTable::FindTable( &rTblFmt ); + SwTableNode *const pTblNode = pTable->GetTableNode(); SwPosition aPosition( *pTblNode ); SwPaM aPam( aPosition ); @@ -1399,181 +1413,221 @@ SwXTextRange::SwXTextRange(SwFrmFmt& rTblFmt) : SwXTextRange::~SwXTextRange() { - vos::OGuard aGuard(Application::GetSolarMutex()); - ::sw::mark::IMark const * const pBkmk = GetBookmark(); - if(pBkmk) - pDoc->getIDocumentMarkAccess()->deleteMark(pBkmk); } -void SwXTextRange::SetPositions(const SwPaM& rPam) +const SwDoc * SwXTextRange::GetDoc() const { - IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess(); + return & m_pImpl->m_rDoc; +} - ::sw::mark::IMark const * const pBkmk = GetBookmark(); - if(pBkmk) - pMarkAccess->deleteMark(pBkmk); - pMark = pMarkAccess->makeMark(rPam, ::rtl::OUString(), IDocumentMarkAccess::UNO_BOOKMARK); - pMark->Add(this); +SwDoc * SwXTextRange::GetDoc() +{ + return & m_pImpl->m_rDoc; +} + + +void SwXTextRange::Invalidate() +{ + m_pImpl->Invalidate(); +} + +void SwXTextRange::SetPositions(const SwPaM& rPam) +{ + m_pImpl->Invalidate(); + IDocumentMarkAccess* const pMA = m_pImpl->m_rDoc.getIDocumentMarkAccess(); + m_pImpl->m_pMark = pMA->makeMark(rPam, ::rtl::OUString(), + IDocumentMarkAccess::UNO_BOOKMARK); + m_pImpl->m_pMark->Add(m_pImpl.get()); } void SwXTextRange::DeleteAndInsert( - const String& rText, const bool bForceExpandHints) - throw(uno::RuntimeException) + const ::rtl::OUString& rText, const bool bForceExpandHints) +throw (uno::RuntimeException) { - if (RANGE_IS_TABLE == eRangePosition) + if (RANGE_IS_TABLE == m_pImpl->m_eRangePosition) { // setString on table not allowed throw uno::RuntimeException(); } - ::sw::mark::IMark const * const pBkmk = GetBookmark(); - if(pBkmk) + const SwPosition aPos(GetDoc()->GetNodes().GetEndOfContent()); + SwCursor aCursor(aPos, 0, false); + if (GetPositions(aCursor)) { - const SwPosition& rPoint = pBkmk->GetMarkStart(); - SwCursor aNewCrsr(rPoint, 0, false); - if(pBkmk->IsExpanded()) - { - aNewCrsr.SetMark(); - const SwPosition& rMark = pBkmk->GetMarkEnd(); - *aNewCrsr.GetMark() = rMark; - } - UnoActionContext aAction(pDoc); - pDoc->StartUndo(UNDO_INSERT, NULL); - if(aNewCrsr.HasMark()) + UnoActionContext aAction(& m_pImpl->m_rDoc); + m_pImpl->m_rDoc.StartUndo(UNDO_INSERT, NULL); + if (aCursor.HasMark()) { - pDoc->DeleteAndJoin(aNewCrsr); + m_pImpl->m_rDoc.DeleteAndJoin(aCursor); } - if(rText.Len()) + if (rText.getLength()) { SwUnoCursorHelper::DocInsertStringSplitCR( - *pDoc, aNewCrsr, rText, bForceExpandHints); + m_pImpl->m_rDoc, aCursor, rText, bForceExpandHints); - SwXTextCursor::SelectPam(aNewCrsr, sal_True); - aNewCrsr.Left(rText.Len(), CRSR_SKIP_CHARS, FALSE, FALSE); + SwXTextCursor::SelectPam(aCursor, sal_True); + aCursor.Left(rText.getLength(), CRSR_SKIP_CHARS, FALSE, FALSE); } - SetPositions(aNewCrsr); - pDoc->EndUndo(UNDO_INSERT, NULL); + SetPositions(aCursor); + m_pImpl->m_rDoc.EndUndo(UNDO_INSERT, NULL); } } -uno::Reference< XText > SwXTextRange::getText(void) throw( uno::RuntimeException ) +const uno::Sequence< sal_Int8 > & SwXTextRange::getUnoTunnelId() +{ + static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId(); + return aSeq; +} + +// XUnoTunnel +sal_Int64 SAL_CALL +SwXTextRange::getSomething(const uno::Sequence< sal_Int8 >& rId) +throw (uno::RuntimeException) +{ + return ::sw::UnoTunnelImpl(rId, this); +} + +OUString SAL_CALL +SwXTextRange::getImplementationName() throw (uno::RuntimeException) +{ + return OUString::createFromAscii("SwXTextRange"); +} + +static char const*const g_ServicesTextRange[] = +{ + "com.sun.star.text.TextRange", + "com.sun.star.style.CharacterProperties", + "com.sun.star.style.CharacterPropertiesAsian", + "com.sun.star.style.CharacterPropertiesComplex", + "com.sun.star.style.ParagraphProperties", + "com.sun.star.style.ParagraphPropertiesAsian", + "com.sun.star.style.ParagraphPropertiesComplex", +}; +static const size_t g_nServicesTextRange( + sizeof(g_ServicesTextRange)/sizeof(g_ServicesTextRange[0])); + +sal_Bool SAL_CALL SwXTextRange::supportsService(const OUString& rServiceName) +throw (uno::RuntimeException) +{ + return ::sw::SupportsServiceImpl( + g_nServicesTextRange, g_ServicesTextRange, rServiceName); +} + +uno::Sequence< OUString > SAL_CALL +SwXTextRange::getSupportedServiceNames() throw (uno::RuntimeException) +{ + return ::sw::GetSupportedServiceNamesImpl( + g_nServicesTextRange, g_ServicesTextRange); +} + +uno::Reference< text::XText > SAL_CALL +SwXTextRange::getText() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - if (!xParentText.is()) + + if (!m_pImpl->m_xParentText.is()) { - if (eRangePosition == RANGE_IS_TABLE && - aObjectDepend.GetRegisteredIn() ) - { - SwFrmFmt* pTblFmt = (SwFrmFmt*)aObjectDepend.GetRegisteredIn(); - SwTable* pTable = SwTable::FindTable( pTblFmt ); - SwTableNode* pTblNode = pTable->GetTableNode(); - SwPosition aPosition( *pTblNode ); - uno::Reference< XTextRange > xRange = - SwXTextRange::CreateTextRangeFromPosition(pDoc, aPosition, 0); - xParentText = xRange->getText(); - } - else + if (m_pImpl->m_eRangePosition == RANGE_IS_TABLE && + m_pImpl->m_ObjectDepend.GetRegisteredIn()) { - OSL_ENSURE(false, "SwXTextRange::getText: no text"); + SwFrmFmt const*const pTblFmt = static_cast( + m_pImpl->m_ObjectDepend.GetRegisteredIn()); + SwTable const*const pTable = SwTable::FindTable( pTblFmt ); + SwTableNode const*const pTblNode = pTable->GetTableNode(); + const SwPosition aPosition( *pTblNode ); + const uno::Reference< text::XTextRange > xRange = + SwXTextRange::CreateTextRangeFromPosition( + &m_pImpl->m_rDoc, aPosition, 0); + m_pImpl->m_xParentText = xRange->getText(); } } - return xParentText; + OSL_ENSURE(m_pImpl->m_xParentText.is(), "SwXTextRange::getText: no text"); + return m_pImpl->m_xParentText; } -uno::Reference< XTextRange > SwXTextRange::getStart(void) throw( uno::RuntimeException ) +uno::Reference< text::XTextRange > SAL_CALL +SwXTextRange::getStart() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - uno::Reference< XTextRange > xRet; - ::sw::mark::IMark const * const pBkmk = GetBookmark(); - if(!xParentText.is()) + uno::Reference< text::XTextRange > xRet; + ::sw::mark::IMark const * const pBkmk = m_pImpl->GetBookmark(); + if (!m_pImpl->m_xParentText.is()) + { getText(); + } if(pBkmk) { SwPaM aPam(pBkmk->GetMarkStart()); - xRet = new SwXTextRange(aPam, xParentText); + xRet = new SwXTextRange(aPam, m_pImpl->m_xParentText); } - else if(eRangePosition == RANGE_IS_TABLE) + else if (RANGE_IS_TABLE == m_pImpl->m_eRangePosition) { - //start and end are this, if its a table + // start and end are this, if its a table xRet = this; } else + { throw uno::RuntimeException(); + } return xRet; } -uno::Reference< XTextRange > SwXTextRange::getEnd(void) throw( uno::RuntimeException ) +uno::Reference< text::XTextRange > SAL_CALL +SwXTextRange::getEnd() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - uno::Reference< XTextRange > xRet; - ::sw::mark::IMark const * const pBkmk = GetBookmark(); - if(!xParentText.is()) + + uno::Reference< text::XTextRange > xRet; + ::sw::mark::IMark const * const pBkmk = m_pImpl->GetBookmark(); + if (!m_pImpl->m_xParentText.is()) + { getText(); + } if(pBkmk) { SwPaM aPam(pBkmk->GetMarkEnd()); - xRet = new SwXTextRange(aPam, xParentText); + xRet = new SwXTextRange(aPam, m_pImpl->m_xParentText); } - else if(eRangePosition == RANGE_IS_TABLE) + else if (RANGE_IS_TABLE == m_pImpl->m_eRangePosition) { - //start and end are this, if its a table + // start and end are this, if its a table xRet = this; } else + { throw uno::RuntimeException(); + } return xRet; } -OUString SwXTextRange::getString(void) throw( uno::RuntimeException ) +OUString SAL_CALL SwXTextRange::getString() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); + OUString sRet; - ::sw::mark::IMark const * const pBkmk = GetBookmark(); // for tables there is no bookmark, thus also no text // one could export the table as ASCII here maybe? - if(pBkmk && pBkmk->IsExpanded()) + SwPaM aPaM(GetDoc()->GetNodes()); + if (GetPositions(aPaM) && aPaM.HasMark()) { - const SwPosition& rPoint = pBkmk->GetMarkPos(); - const SwPosition& rMark = pBkmk->GetOtherMarkPos(); - SwPaM aCrsr(rMark, rPoint); - SwXTextCursor::getTextFromPam(aCrsr, sRet); + SwXTextCursor::getTextFromPam(aPaM, sRet); } return sRet; } -void SwXTextRange::setString(const OUString& aString) - throw( uno::RuntimeException ) +void SAL_CALL SwXTextRange::setString(const OUString& rString) +throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - DeleteAndInsert(aString, false); -} -void SwXTextRange::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) -{ - sal_Bool bAlreadyRegisterred = 0 != GetRegisteredIn(); - ClientModify(this, pOld, pNew); - if(aObjectDepend.GetRegisteredIn()) - { - ClientModify(&aObjectDepend, pOld, pNew); - // if the depend was removed then the range must be removed too - if(!aObjectDepend.GetRegisteredIn() && GetRegisteredIn()) - ((SwModify*)GetRegisteredIn())->Remove(this); - // or if the range has been removed but the depend ist still - // connected then the depend must be removed - else if(bAlreadyRegisterred && !GetRegisteredIn() && - aObjectDepend.GetRegisteredIn()) - ((SwModify*)aObjectDepend.GetRegisteredIn())->Remove(&aObjectDepend); - } - if(!GetRegisteredIn()) - pMark = NULL; + DeleteAndInsert(rString, false); } -sal_Bool SwXTextRange::GetPositions(SwPaM& rToFill) const +bool SwXTextRange::GetPositions(SwPaM& rToFill) const { - sal_Bool bRet = sal_False; - ::sw::mark::IMark const * const pBkmk = GetBookmark(); + ::sw::mark::IMark const * const pBkmk = m_pImpl->GetBookmark(); if(pBkmk) { *rToFill.GetPoint() = pBkmk->GetMarkPos(); @@ -1583,10 +1637,12 @@ sal_Bool SwXTextRange::GetPositions(SwPaM& rToFill) const *rToFill.GetMark() = pBkmk->GetOtherMarkPos(); } else + { rToFill.DeleteMark(); - bRet = sal_True; + } + return true; } - return bRet; + return false; } sal_Bool SwXTextRange::XTextRangeToSwPaM( SwUnoInternalPaM& rToFill, @@ -1806,187 +1862,248 @@ uno::Reference< XText > SwXTextRange::CreateParentXText(SwDoc* pDoc, return xParentText; } -uno::Reference< XEnumeration > SAL_CALL SwXTextRange::createContentEnumeration( - const OUString& rServiceName) - throw(RuntimeException) +uno::Reference< container::XEnumeration > SAL_CALL +SwXTextRange::createContentEnumeration(const OUString& rServiceName) +throw (uno::RuntimeException) { - ::sw::mark::IMark const * const pBkmk = GetBookmark(); - if( !pBkmk || COMPARE_EQUAL != rServiceName.compareToAscii("com.sun.star.text.TextContent") ) - throw RuntimeException(); + vos::OGuard g(Application::GetSolarMutex()); - const SwPosition& rPoint = pBkmk->GetMarkPos(); - SwUnoCrsr* pNewCrsr = pDoc->CreateUnoCrsr(rPoint, FALSE); - if(pBkmk->IsExpanded() && pBkmk->GetOtherMarkPos() != rPoint) + if (!rServiceName.equalsAscii("com.sun.star.text.TextContent")) { - pNewCrsr->SetMark(); - *pNewCrsr->GetMark() = pBkmk->GetOtherMarkPos(); + throw uno::RuntimeException(); } - uno::Reference< XEnumeration > xRet = new SwXParaFrameEnumeration(*pNewCrsr, PARAFRAME_PORTION_TEXTRANGE); - delete pNewCrsr; + + if (!GetDoc() || !m_pImpl->GetBookmark()) + { + throw uno::RuntimeException(); + } + const SwPosition aPos(GetDoc()->GetNodes().GetEndOfContent()); + const ::std::auto_ptr pNewCrsr( + m_pImpl->m_rDoc.CreateUnoCrsr(aPos, FALSE)); + if (!GetPositions(*pNewCrsr)) + { + throw uno::RuntimeException(); + } + + const uno::Reference< container::XEnumeration > xRet = + new SwXParaFrameEnumeration(*pNewCrsr, PARAFRAME_PORTION_TEXTRANGE); return xRet; } -uno::Reference< XEnumeration > SwXTextRange::createEnumeration(void) throw( RuntimeException ) +uno::Reference< container::XEnumeration > SAL_CALL +SwXTextRange::createEnumeration() throw (uno::RuntimeException) { - ::sw::mark::IMark const * const pBkmk = GetBookmark(); - if(!pBkmk) throw RuntimeException(); - const SwPosition& rPoint = pBkmk->GetMarkPos(); - ::std::auto_ptr pNewCrsr(pDoc->CreateUnoCrsr(rPoint, sal_False)); - if(pBkmk->IsExpanded() && pBkmk->GetOtherMarkPos() != rPoint) + vos::OGuard g(Application::GetSolarMutex()); + + if (!GetDoc() || !m_pImpl->GetBookmark()) { - pNewCrsr->SetMark(); - *pNewCrsr->GetMark() = pBkmk->GetOtherMarkPos(); + throw uno::RuntimeException(); } - uno::Reference xTunnel(xParentText, UNO_QUERY); - SwXText* pParentText = 0; - if(xTunnel.is()) + const SwPosition aPos(GetDoc()->GetNodes().GetEndOfContent()); + ::std::auto_ptr pNewCrsr( + m_pImpl->m_rDoc.CreateUnoCrsr(aPos, FALSE)); + if (!GetPositions(*pNewCrsr)) { - pParentText = reinterpret_cast< SwXText * >( - sal::static_int_cast< sal_IntPtr >( xTunnel->getSomething(SwXText::getUnoTunnelId()) )); + throw uno::RuntimeException(); } - DBG_ASSERT(pParentText, "parent is not a SwXText"); - if (!pParentText) + if (!m_pImpl->m_xParentText.is()) { - throw uno::RuntimeException(); + getText(); } - const CursorType eSetType = (RANGE_IN_CELL == eRangePosition) + const CursorType eSetType = (RANGE_IN_CELL == m_pImpl->m_eRangePosition) ? CURSOR_SELECTION_IN_TABLE : CURSOR_SELECTION; - const uno::Reference< XEnumeration > xRet = - new SwXParagraphEnumeration(pParentText, pNewCrsr, eSetType); + const uno::Reference< container::XEnumeration > xRet = + new SwXParagraphEnumeration(m_pImpl->m_xParentText, pNewCrsr, eSetType); return xRet; } -uno::Type SwXTextRange::getElementType(void) throw( RuntimeException ) +uno::Type SAL_CALL SwXTextRange::getElementType() throw (uno::RuntimeException) { - return ::getCppuType((uno::Reference*)0); + return text::XTextRange::static_type(); } -sal_Bool SwXTextRange::hasElements(void) throw( RuntimeException ) +sal_Bool SAL_CALL SwXTextRange::hasElements() throw (uno::RuntimeException) { return sal_True; } -Sequence< OUString > SAL_CALL SwXTextRange::getAvailableServiceNames(void) throw( RuntimeException ) +uno::Sequence< OUString > SAL_CALL +SwXTextRange::getAvailableServiceNames() throw (uno::RuntimeException) { - Sequence< OUString > aRet(1); + uno::Sequence< OUString > aRet(1); OUString* pArray = aRet.getArray(); pArray[0] = OUString::createFromAscii("com.sun.star.text.TextContent"); return aRet; } -uno::Reference< XPropertySetInfo > SAL_CALL SwXTextRange::getPropertySetInfo( ) throw(RuntimeException) +uno::Reference< beans::XPropertySetInfo > SAL_CALL +SwXTextRange::getPropertySetInfo() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - static uno::Reference< XPropertySetInfo > xRef = m_pPropSet->getPropertySetInfo(); + + static uno::Reference< beans::XPropertySetInfo > xRef = + m_pImpl->m_rPropSet.getPropertySetInfo(); return xRef; } -void SAL_CALL SwXTextRange::setPropertyValue( - const OUString& rPropertyName, const Any& rValue ) - throw(UnknownPropertyException, PropertyVetoException, - IllegalArgumentException, WrappedTargetException, RuntimeException) +void SAL_CALL +SwXTextRange::setPropertyValue( + const OUString& rPropertyName, const uno::Any& rValue) +throw (beans::UnknownPropertyException, beans::PropertyVetoException, + lang::IllegalArgumentException, lang::WrappedTargetException, + uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - if(!GetDoc() || !GetBookmark()) - throw RuntimeException(); + + if (!GetDoc() || !m_pImpl->GetBookmark()) + { + throw uno::RuntimeException(); + } SwPaM aPaM(GetDoc()->GetNodes()); - SwXTextRange::GetPositions(aPaM); - SwXTextCursor::SetPropertyValue(aPaM, *m_pPropSet, rPropertyName, rValue); + GetPositions(aPaM); + SwXTextCursor::SetPropertyValue(aPaM, m_pImpl->m_rPropSet, + rPropertyName, rValue); } -Any SAL_CALL SwXTextRange::getPropertyValue( const OUString& rPropertyName ) - throw(UnknownPropertyException, WrappedTargetException, RuntimeException) +uno::Any SAL_CALL +SwXTextRange::getPropertyValue(const OUString& rPropertyName) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - if(!GetDoc() || !GetBookmark()) - throw RuntimeException(); - SwPaM aPaM(((SwDoc*)GetDoc())->GetNodes()); - SwXTextRange::GetPositions(aPaM); - return SwXTextCursor::GetPropertyValue(aPaM, *m_pPropSet, rPropertyName); + + if (!GetDoc() || !m_pImpl->GetBookmark()) + { + throw uno::RuntimeException(); + } + SwPaM aPaM(GetDoc()->GetNodes()); + GetPositions(aPaM); + return SwXTextCursor::GetPropertyValue(aPaM, m_pImpl->m_rPropSet, + rPropertyName); } -void SAL_CALL SwXTextRange::addPropertyChangeListener( - const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener >& /*aListener*/ ) - throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL +SwXTextRange::addPropertyChangeListener( + const ::rtl::OUString& /*rPropertyName*/, + const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { - DBG_WARNING("not implemented"); + OSL_ENSURE(false, + "SwXTextRange::addPropertyChangeListener(): not implemented"); } -void SAL_CALL SwXTextRange::removePropertyChangeListener( - const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener >& /*aListener*/ ) - throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL +SwXTextRange::removePropertyChangeListener( + const ::rtl::OUString& /*rPropertyName*/, + const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { - DBG_WARNING("not implemented"); + OSL_ENSURE(false, + "SwXTextRange::removePropertyChangeListener(): not implemented"); } -void SAL_CALL SwXTextRange::addVetoableChangeListener( - const OUString& /*PropertyName*/, const uno::Reference< XVetoableChangeListener >& /*aListener*/ ) - throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL +SwXTextRange::addVetoableChangeListener( + const ::rtl::OUString& /*rPropertyName*/, + const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { - DBG_WARNING("not implemented"); + OSL_ENSURE(false, + "SwXTextRange::addVetoableChangeListener(): not implemented"); } -void SAL_CALL SwXTextRange::removeVetoableChangeListener( - const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener >& /*aListener*/ ) - throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL +SwXTextRange::removeVetoableChangeListener( + const ::rtl::OUString& /*rPropertyName*/, + const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { - DBG_WARNING("not implemented"); + OSL_ENSURE(false, + "SwXTextRange::removeVetoableChangeListener(): not implemented"); } -PropertyState SAL_CALL SwXTextRange::getPropertyState( const OUString& rPropertyName ) - throw(UnknownPropertyException, RuntimeException) +beans::PropertyState SAL_CALL +SwXTextRange::getPropertyState(const OUString& rPropertyName) +throw (beans::UnknownPropertyException, uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - if(!GetDoc() || !GetBookmark()) - throw RuntimeException(); - SwPaM aPaM(((SwDoc*)GetDoc())->GetNodes()); - SwXTextRange::GetPositions(aPaM); - return SwXTextCursor::GetPropertyState(aPaM, *m_pPropSet, rPropertyName); + + if (!GetDoc() || !m_pImpl->GetBookmark()) + { + throw uno::RuntimeException(); + } + SwPaM aPaM(GetDoc()->GetNodes()); + GetPositions(aPaM); + return SwXTextCursor::GetPropertyState(aPaM, m_pImpl->m_rPropSet, + rPropertyName); } -Sequence< PropertyState > SAL_CALL SwXTextRange::getPropertyStates( - const Sequence< OUString >& rPropertyName ) throw(UnknownPropertyException, RuntimeException) +uno::Sequence< beans::PropertyState > SAL_CALL +SwXTextRange::getPropertyStates(const uno::Sequence< OUString >& rPropertyName) +throw (beans::UnknownPropertyException, uno::RuntimeException) { - NAMESPACE_VOS(OGuard) aGuard(Application::GetSolarMutex()); - if(!GetDoc() || !GetBookmark()) - throw RuntimeException(); - SwPaM aPaM(((SwDoc*)GetDoc())->GetNodes()); - SwXTextRange::GetPositions(aPaM); - return SwXTextCursor::GetPropertyStates(aPaM, *m_pPropSet, rPropertyName); + vos::OGuard g(Application::GetSolarMutex()); + + if (!GetDoc() || !m_pImpl->GetBookmark()) + { + throw uno::RuntimeException(); + } + SwPaM aPaM(GetDoc()->GetNodes()); + GetPositions(aPaM); + return SwXTextCursor::GetPropertyStates(aPaM, m_pImpl->m_rPropSet, + rPropertyName); } -void SAL_CALL SwXTextRange::setPropertyToDefault( const OUString& rPropertyName ) - throw(UnknownPropertyException, RuntimeException) +void SAL_CALL SwXTextRange::setPropertyToDefault(const OUString& rPropertyName) +throw (beans::UnknownPropertyException, uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - if(!GetDoc() || !GetBookmark()) - throw RuntimeException(); - SwPaM aPaM(((SwDoc*)GetDoc())->GetNodes()); - SwXTextRange::GetPositions(aPaM); - SwXTextCursor::SetPropertyToDefault(aPaM, *m_pPropSet, rPropertyName); + + if (!GetDoc() || !m_pImpl->GetBookmark()) + { + throw uno::RuntimeException(); + } + SwPaM aPaM(GetDoc()->GetNodes()); + GetPositions(aPaM); + SwXTextCursor::SetPropertyToDefault(aPaM, m_pImpl->m_rPropSet, + rPropertyName); } -Any SAL_CALL SwXTextRange::getPropertyDefault( const OUString& rPropertyName ) - throw(UnknownPropertyException, WrappedTargetException, RuntimeException) +uno::Any SAL_CALL +SwXTextRange::getPropertyDefault(const OUString& rPropertyName) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - if(!GetDoc() || !GetBookmark()) - throw RuntimeException(); - SwPaM aPaM(((SwDoc*)GetDoc())->GetNodes()); - SwXTextRange::GetPositions(aPaM); - return SwXTextCursor::GetPropertyDefault(aPaM, *m_pPropSet, rPropertyName); + + if (!GetDoc() || !m_pImpl->GetBookmark()) + { + throw uno::RuntimeException(); + } + SwPaM aPaM(GetDoc()->GetNodes()); + GetPositions(aPaM); + return SwXTextCursor::GetPropertyDefault(aPaM, m_pImpl->m_rPropSet, + rPropertyName); } -void SwXTextRange::makeRedline( +void SAL_CALL +SwXTextRange::makeRedline( const ::rtl::OUString& rRedlineType, const uno::Sequence< beans::PropertyValue >& rRedlineProperties ) - throw (lang::IllegalArgumentException, uno::RuntimeException) +throw (lang::IllegalArgumentException, uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - if(!GetDoc() || !GetBookmark()) - throw RuntimeException(); - SwPaM aPaM(((SwDoc*)GetDoc())->GetNodes()); + + if (!GetDoc() || !m_pImpl->GetBookmark()) + { + throw uno::RuntimeException(); + } + SwPaM aPaM(GetDoc()->GetNodes()); SwXTextRange::GetPositions(aPaM); SwUnoCursorHelper::makeRedline( aPaM, rRedlineType, rRedlineProperties ); } diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index 7c0fe114b489..023290984ebf 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -1594,15 +1594,11 @@ uno::Reference< text::XTextContent > SwXText::convertToTextFrame( //bookmarks have to be removed before the referenced text node is deleted in DelFullPara if(pStartRange) { - ::sw::mark::IMark const * const pStartBookmark = pStartRange->GetBookmark(); - if(pStartBookmark) - pDoc->getIDocumentMarkAccess()->deleteMark(pStartBookmark); + pStartRange->Invalidate(); } if(pEndRange) { - ::sw::mark::IMark const * const pEndBookmark = pEndRange->GetBookmark(); - if(pEndBookmark) - pDoc->getIDocumentMarkAccess()->deleteMark(pEndBookmark); + pEndRange->Invalidate(); } pDoc->StartUndo( UNDO_START, NULL ); -- cgit v1.2.3 From 5d6da5c1f774b02973085816bb0717d8a2c891a3 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:53 +0100 Subject: swunolocking1: #i105557#: SwXTextRange: move static methods to namespace sw. clean up the implementation a little. --- sw/inc/unotextrange.hxx | 22 ++- sw/source/core/access/accpara.cxx | 6 +- sw/source/core/crsr/crsrsh.cxx | 4 +- sw/source/core/unocore/unobkm.cxx | 6 +- sw/source/core/unocore/unodraw.cxx | 12 +- sw/source/core/unocore/unofield.cxx | 6 +- sw/source/core/unocore/unoflatpara.cxx | 8 +- sw/source/core/unocore/unoframe.cxx | 8 +- sw/source/core/unocore/unoftn.cxx | 7 +- sw/source/core/unocore/unoidx.cxx | 6 +- sw/source/core/unocore/unoobj2.cxx | 175 +++++++++++++---------- sw/source/core/unocore/unoparagraph.cxx | 2 +- sw/source/core/unocore/unoredline.cxx | 7 +- sw/source/core/unocore/unorefmk.cxx | 17 +-- sw/source/core/unocore/unosect.cxx | 4 +- sw/source/core/unocore/unotbl.cxx | 5 +- sw/source/core/unocore/unotext.cxx | 20 +-- sw/source/filter/xml/XMLRedlineImportHelper.cxx | 4 +- sw/source/filter/xml/swxml.cxx | 5 +- sw/source/filter/xml/xmlimp.cxx | 6 +- sw/source/filter/xml/xmltbli.cxx | 4 +- sw/source/ui/dialog/SwSpellDialogChildWindow.cxx | 9 +- sw/source/ui/uno/unotxdoc.cxx | 18 ++- sw/source/ui/uno/unotxvw.cxx | 14 +- 24 files changed, 198 insertions(+), 177 deletions(-) diff --git a/sw/inc/unotextrange.hxx b/sw/inc/unotextrange.hxx index 8b34ce7f94c1..c3c3d362db6b 100644 --- a/sw/inc/unotextrange.hxx +++ b/sw/inc/unotextrange.hxx @@ -77,6 +77,13 @@ namespace sw { void DeepCopyPaM(SwPaM const & rSource, SwPaM & rTarget); + bool XTextRangeToSwPaM(SwUnoInternalPaM& rToFill, + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > & xTextRange); + + ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > + CreateParentXText(SwDoc & rDoc, const SwPosition& rPos); + } // namespace sw @@ -105,10 +112,8 @@ private: enum RangePosition { RANGE_IN_TEXT, // "ordinary" ::com::sun::star::text::TextRange - RANGE_IN_FRAME, // position created with a frame that has no uno object RANGE_IN_CELL, // position created with a cell that has no uno object RANGE_IS_TABLE, // anchor of a table - RANGE_INVALID // created by NewInstance }; void SetPositions(SwPaM const& rPam); @@ -133,17 +138,10 @@ public: SwDoc* GetDoc(); bool GetPositions(SwPaM & rToFill) const; - static BOOL XTextRangeToSwPaM(SwUnoInternalPaM& rToFill, - const ::com::sun::star::uno::Reference< - ::com::sun::star::text::XTextRange > & xTextRange); - static ::com::sun::star::uno::Reference< - ::com::sun::star::text::XTextRange > CreateTextRangeFromPosition( - SwDoc* pDoc, - const SwPosition& rPos, const SwPosition* pMark); - - static ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > - CreateParentXText(SwDoc* pDoc, const SwPosition& rPos); + ::com::sun::star::text::XTextRange > CreateXTextRange( + SwDoc & rDoc, + const SwPosition& rPos, const SwPosition *const pMark); static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId(); diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index 29464206c24b..950a0d3fc81c 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -2105,8 +2105,10 @@ sal_Bool SwAccessibleParagraph::replaceText( aEndPos.nContent = nEnd; // now create XTextRange as helper and set string - SwXTextRange::CreateTextRangeFromPosition( - pNode->GetDoc(), aStartPos, &aEndPos)->setString(sReplacement); + const uno::Reference xRange( + SwXTextRange::CreateXTextRange( + *pNode->GetDoc(), aStartPos, &aEndPos)); + xRange->setString(sReplacement); // delete portion data ClearPortionData(); diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index f4b7e0a0b10d..59c8570ba212 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -3372,8 +3372,8 @@ void lcl_FillTextRange( uno::Reference& rRange, SwPosition aEndPos( aStartPos ); aEndPos.nContent = nBegin + nLen; - uno::Reference xRange = - SwXTextRange::CreateTextRangeFromPosition( rNode.GetDoc(), aStartPos, &aEndPos); + const uno::Reference xRange = + SwXTextRange::CreateXTextRange(*rNode.GetDoc(), aStartPos, &aEndPos); rRange = xRange; } diff --git a/sw/source/core/unocore/unobkm.cxx b/sw/source/core/unocore/unobkm.cxx index 86b8b3ee8403..ad35f1f28b33 100644 --- a/sw/source/core/unocore/unobkm.cxx +++ b/sw/source/core/unocore/unobkm.cxx @@ -237,7 +237,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException) m_pImpl->m_pDoc = pDoc; SwUnoInternalPaM aPam(*m_pImpl->m_pDoc); - SwXTextRange::XTextRangeToSwPaM(aPam, xTextRange); + ::sw::XTextRangeToSwPaM(aPam, xTextRange); UnoActionContext aCont(m_pImpl->m_pDoc); if (!m_pImpl->m_sMarkName.getLength()) { @@ -294,8 +294,8 @@ SwXBookmark::getAnchor() throw (uno::RuntimeException) { throw uno::RuntimeException(); } - return SwXTextRange::CreateTextRangeFromPosition( - m_pImpl->m_pDoc, + return SwXTextRange::CreateXTextRange( + *m_pImpl->m_pDoc, m_pImpl->m_pRegisteredBookmark->GetMarkPos(), (m_pImpl->m_pRegisteredBookmark->IsExpanded()) ? &m_pImpl->m_pRegisteredBookmark->GetOtherMarkPos() : NULL); diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index 9a2eb1dfae45..c8a0b78bb48c 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -784,7 +784,7 @@ void SwXDrawPage::add(const uno::Reference< drawing::XShape > & xShape) if( pDesc && (xRg = pDesc->GetTextRange()).is() ) { pInternalPam = new SwUnoInternalPaM(*pDoc); - if(SwXTextRange::XTextRangeToSwPaM(*pInternalPam, xRg)) + if (::sw::XTextRangeToSwPaM(*pInternalPam, xRg)) { if(FLY_AT_FLY == aAnchor.GetAnchorId() && !pInternalPam->GetNode()->FindFlyStartNode()) @@ -1302,7 +1302,7 @@ void SwXShape::setPropertyValue(const rtl::OUString& rPropertyName, const uno::A new SwUnoInternalPaM( *(pFmt->GetDoc()) ); uno::Reference< text::XTextRange > xRg; aValue >>= xRg; - if ( SwXTextRange::XTextRangeToSwPaM(*pInternalPam, xRg) ) + if (::sw::XTextRangeToSwPaM(*pInternalPam, xRg) ) { if (aAnchor.GetAnchorId() == FLY_AS_CHAR) { @@ -1634,9 +1634,9 @@ uno::Any SwXShape::getPropertyValue(const rtl::OUString& rPropertyName) { if ( aAnchor.GetCntntAnchor() ) { - uno::Reference< text::XTextRange > xTextRange = - SwXTextRange::CreateTextRangeFromPosition( - pFmt->GetDoc(), + const uno::Reference< text::XTextRange > xTextRange + = SwXTextRange::CreateXTextRange( + *pFmt->GetDoc(), *aAnchor.GetCntntAnchor(), 0L ); aRet.setValue(&xTextRange, ::getCppuType((uno::Reference*)0)); @@ -2203,7 +2203,7 @@ uno::Reference< text::XTextRange > SwXShape::getAnchor(void) throw( uno::Runtim (rAnchor.GetCntntAnchor() && !rAnchor.GetPageNum())) { const SwPosition &rPos = *(pFmt->GetAnchor().GetCntntAnchor()); - aRef = SwXTextRange::CreateTextRangeFromPosition(pFmt->GetDoc(), rPos, 0); + aRef = SwXTextRange::CreateXTextRange(*pFmt->GetDoc(), rPos, 0); } } else diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index 59954b6a954e..eb8af4d93673 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -1305,7 +1305,7 @@ void SwXTextField::attachToRange( { SwUnoInternalPaM aPam(*pDoc); //das muss jetzt sal_True liefern - SwXTextRange::XTextRangeToSwPaM(aPam, xTextRange); + ::sw::XTextRangeToSwPaM(aPam, xTextRange); SwField* pFld = 0; switch(m_nServiceId) { @@ -1880,8 +1880,8 @@ uno::Reference< text::XTextRange > SwXTextField::getAnchor(void) throw( uno::Ru SwPaM aPam(rTxtNode, *pTxtFld->GetStart() + 1, rTxtNode, *pTxtFld->GetStart()); - aRef = SwXTextRange::CreateTextRangeFromPosition(m_pDoc, - *aPam.GetPoint(), aPam.GetMark()); + aRef = SwXTextRange::CreateXTextRange( + *m_pDoc, *aPam.GetPoint(), aPam.GetMark()); } return aRef; diff --git a/sw/source/core/unocore/unoflatpara.cxx b/sw/source/core/unocore/unoflatpara.cxx index 42f2934c5b01..d68fc43a3abc 100644 --- a/sw/source/core/unocore/unoflatpara.cxx +++ b/sw/source/core/unocore/unoflatpara.cxx @@ -218,7 +218,9 @@ void SAL_CALL SwXFlatParagraph::changeText(::sal_Int32 nPos, ::sal_Int32 nLen, c UnoActionContext aAction( mpTxtNode->GetDoc() ); - uno::Reference< text::XTextRange > xRange = SwXTextRange::CreateTextRangeFromPosition( mpTxtNode->GetDoc(), *aPaM.GetPoint(), aPaM.GetMark() ); + const uno::Reference< text::XTextRange > xRange = + SwXTextRange::CreateXTextRange( + *mpTxtNode->GetDoc(), *aPaM.GetPoint(), aPaM.GetMark() ); uno::Reference< beans::XPropertySet > xPropSet( xRange, uno::UNO_QUERY ); if ( xPropSet.is() ) { @@ -246,7 +248,9 @@ void SAL_CALL SwXFlatParagraph::changeAttributes(::sal_Int32 nPos, ::sal_Int32 n UnoActionContext aAction( mpTxtNode->GetDoc() ); - uno::Reference< text::XTextRange > xRange = SwXTextRange::CreateTextRangeFromPosition( mpTxtNode->GetDoc(), *aPaM.GetPoint(), aPaM.GetMark() ); + const uno::Reference< text::XTextRange > xRange = + SwXTextRange::CreateXTextRange( + *mpTxtNode->GetDoc(), *aPaM.GetPoint(), aPaM.GetMark() ); uno::Reference< beans::XPropertySet > xPropSet( xRange, uno::UNO_QUERY ); if ( xPropSet.is() ) { diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 8b3349332895..ac2dc2d55529 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -2056,7 +2056,7 @@ uno::Reference< text::XTextRange > SwXFrame::getAnchor(void) throw( uno::Runtim (rAnchor.GetCntntAnchor() && !rAnchor.GetPageNum())) { const SwPosition &rPos = *(rAnchor.GetCntntAnchor()); - aRef = SwXTextRange::CreateTextRangeFromPosition(pFmt->GetDoc(), rPos, 0); + aRef = SwXTextRange::CreateXTextRange(*pFmt->GetDoc(), rPos, 0); } } else @@ -2098,7 +2098,7 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan { SwUnoInternalPaM aIntPam(*pDoc); //das muss jetzt sal_True liefern - SwXTextRange::XTextRangeToSwPaM(aIntPam, xTextRange); + ::sw::XTextRangeToSwPaM(aIntPam, xTextRange); SwNode& rNode = pDoc->GetNodes().GetEndOfContent(); SwPaM aPam(rNode); @@ -2430,7 +2430,7 @@ void SwXFrame::attach(const uno::Reference< text::XTextRange > & xTextRange) } SwDoc* pDoc = pFmt->GetDoc(); SwUnoInternalPaM aIntPam(*pDoc); - if(SwXTextRange::XTextRangeToSwPaM(aIntPam, xTextRange)) + if (::sw::XTextRangeToSwPaM(aIntPam, xTextRange)) { SfxItemSet aSet( pDoc->GetAttrPool(), RES_ANCHOR, RES_ANCHOR ); @@ -2672,7 +2672,7 @@ uno::Reference< text::XTextCursor > SwXTextFrame::createTextCursorByRange(const uno::Reference< text::XTextCursor > aRef; SwFrmFmt* pFmt = GetFrmFmt(); SwUnoInternalPaM aPam(*GetDoc()); - if(pFmt && SwXTextRange::XTextRangeToSwPaM(aPam, aTextPosition)) + if (pFmt && ::sw::XTextRangeToSwPaM(aPam, aTextPosition)) { SwNode& rNode = pFmt->GetCntnt().GetCntntIdx()->GetNode(); #if OSL_DEBUG_LEVEL > 1 diff --git a/sw/source/core/unocore/unoftn.cxx b/sw/source/core/unocore/unoftn.cxx index f18a46d8ad37..3d24e282f7c8 100644 --- a/sw/source/core/unocore/unoftn.cxx +++ b/sw/source/core/unocore/unoftn.cxx @@ -251,7 +251,7 @@ void SwXFootnote::attachToRange(const uno::Reference< text::XTextRange > & xText { SwUnoInternalPaM aPam(*pNewDoc); //das muss jetzt sal_True liefern - SwXTextRange::XTextRangeToSwPaM(aPam, xTextRange); + ::sw::XTextRangeToSwPaM(aPam, xTextRange); UnoActionContext aCont(pNewDoc); SwTxtAttr* pTxtAttr = 0; @@ -315,7 +315,8 @@ uno::Reference< text::XTextRange > SwXFootnote::getAnchor(void) throw( uno::Run SwPosition aMark( *aPam.Start() ); aPam.SetMark(); aPam.GetMark()->nContent++; - aRef = SwXTextRange::CreateTextRangeFromPosition((SwDoc*)GetDoc(), *aPam.Start(), aPam.End()); + aRef = SwXTextRange::CreateXTextRange( + *GetDoc(), *aPam.Start(), aPam.End()); } else throw uno::RuntimeException(); @@ -412,7 +413,7 @@ uno::Reference< text::XTextCursor > SwXFootnote::createTextCursorByRange( throw uno::RuntimeException(); uno::Reference< text::XTextCursor > aRef; SwUnoInternalPaM aPam(*GetDoc()); - if(SwXTextRange::XTextRangeToSwPaM(aPam, aTextPosition)) + if (::sw::XTextRangeToSwPaM(aPam, aTextPosition)) { const SwTxtFtn* pTxtFtn = pFmt->GetTxtFtn(); const SwNode* pFtnStartNode = &pTxtFtn->GetStartNode()->GetNode(); diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index 92309d6368cf..7119f3708711 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -1030,7 +1030,7 @@ void SwXDocumentIndex::attachToRange(const uno::Reference< text::XTextRange > & { SwUnoInternalPaM aPam(*pDoc); //das muss jetzt sal_True liefern - SwXTextRange::XTextRangeToSwPaM(aPam, xTextRange); + ::sw::XTextRangeToSwPaM(aPam, xTextRange); const SwTOXBase* pOld = pDoc->GetCurTOX( *aPam.Start() ); if(!pOld) @@ -1092,7 +1092,7 @@ uno::Reference< text::XTextRange > SwXDocumentIndex::getAnchor(void) throw( uno aPaM.SetMark(); aPaM.GetPoint()->nNode = *pIdx->GetNode().EndOfSectionNode(); aPaM.Move( fnMoveBackward, fnGoCntnt ); - xRet = SwXTextRange::CreateTextRangeFromPosition(pSectFmt->GetDoc(), + xRet = SwXTextRange::CreateXTextRange(*pSectFmt->GetDoc(), *aPaM.GetMark(), aPaM.GetPoint()); } } @@ -1469,7 +1469,7 @@ void SwXDocumentIndexMark::attachToRange(const uno::Reference< text::XTextRange SwUnoInternalPaM aPam(*pDoc); //das muss jetzt sal_True liefern - SwXTextRange::XTextRangeToSwPaM(aPam, xTextRange); + ::sw::XTextRangeToSwPaM(aPam, xTextRange); SwTOXMark aMark (pTOXType); if(sAltText.Len()) aMark.SetAlternativeText(sAltText); diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index 0af4a74b52ff..0027d8ef0b02 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -1536,10 +1536,8 @@ SwXTextRange::getText() throw (uno::RuntimeException) SwTable const*const pTable = SwTable::FindTable( pTblFmt ); SwTableNode const*const pTblNode = pTable->GetTableNode(); const SwPosition aPosition( *pTblNode ); - const uno::Reference< text::XTextRange > xRange = - SwXTextRange::CreateTextRangeFromPosition( - &m_pImpl->m_rDoc, aPosition, 0); - m_pImpl->m_xParentText = xRange->getText(); + m_pImpl->m_xParentText = + ::sw::CreateParentXText(m_pImpl->m_rDoc, aPosition); } } OSL_ENSURE(m_pImpl->m_xParentText.is(), "SwXTextRange::getText: no text"); @@ -1645,10 +1643,12 @@ bool SwXTextRange::GetPositions(SwPaM& rToFill) const return false; } -sal_Bool SwXTextRange::XTextRangeToSwPaM( SwUnoInternalPaM& rToFill, - const uno::Reference< XTextRange > & xTextRange) +namespace sw { + +bool XTextRangeToSwPaM( SwUnoInternalPaM & rToFill, + const uno::Reference< text::XTextRange > & xTextRange) { - sal_Bool bRet = sal_False; + bool bRet = false; uno::Reference xRangeTunnel( xTextRange, uno::UNO_QUERY); SwXTextRange* pRange = 0; @@ -1658,27 +1658,26 @@ sal_Bool SwXTextRange::XTextRangeToSwPaM( SwUnoInternalPaM& rToFill, SwXParagraph* pPara = 0; if(xRangeTunnel.is()) { - pRange = reinterpret_cast< SwXTextRange * >( - sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( SwXTextRange::getUnoTunnelId()) )); - pCursor = reinterpret_cast< OTextCursorHelper * >( - sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( OTextCursorHelper::getUnoTunnelId()) )); - pPortion = reinterpret_cast< SwXTextPortion * >( - sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( SwXTextPortion::getUnoTunnelId()) )); - pText = reinterpret_cast< SwXText * >( - sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( SwXText::getUnoTunnelId()) )); - pPara = reinterpret_cast< SwXParagraph * >( - sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( SwXParagraph::getUnoTunnelId()) )); + pRange = ::sw::UnoTunnelGetImplementation(xRangeTunnel); + pCursor = + ::sw::UnoTunnelGetImplementation(xRangeTunnel); + pPortion= + ::sw::UnoTunnelGetImplementation(xRangeTunnel); + pText = ::sw::UnoTunnelGetImplementation(xRangeTunnel); + pPara = ::sw::UnoTunnelGetImplementation(xRangeTunnel); } - //if it's a text cursor then create a temporary cursor there and re-use the pCursor variable - uno::Reference< XTextCursor > xTextCursor; + // if it's a text then create a temporary cursor there and re-use + // the pCursor variable if(pText) { - xTextCursor = pText->createCursor(); + const uno::Reference< text::XTextCursor > xTextCursor = + pText->createCursor(); xTextCursor->gotoEnd(sal_True); - uno::Reference xCrsrTunnel( xTextCursor, UNO_QUERY); - pCursor = reinterpret_cast< OTextCursorHelper * >( - sal::static_int_cast< sal_IntPtr >( xCrsrTunnel->getSomething( OTextCursorHelper::getUnoTunnelId()) )); + const uno::Reference xCrsrTunnel( + xTextCursor, uno::UNO_QUERY); + pCursor = + ::sw::UnoTunnelGetImplementation(xCrsrTunnel); } if(pRange && pRange->GetDoc() == rToFill.GetDoc()) { @@ -1698,8 +1697,9 @@ sal_Bool SwXTextRange::XTextRangeToSwPaM( SwUnoInternalPaM& rToFill, : ((pPortion) ? pPortion->GetCursor() : 0); if (pUnoCrsr && pDoc == rToFill.GetDoc()) { - DBG_ASSERT((SwPaM*)pUnoCrsr->GetNext() == pUnoCrsr, "was machen wir mit Ringen?" ); - bRet = sal_True; + DBG_ASSERT((SwPaM*)pUnoCrsr->GetNext() == pUnoCrsr, + "what to do about rings?"); + bRet = true; *rToFill.GetPoint() = *pUnoCrsr->GetPoint(); if (pUnoCrsr->HasMark()) { @@ -1714,53 +1714,65 @@ sal_Bool SwXTextRange::XTextRangeToSwPaM( SwUnoInternalPaM& rToFill, return bRet; } -sal_Bool lcl_IsStartNodeInFormat(sal_Bool bHeader, SwStartNode* pSttNode, - const SwFrmFmt* pFrmFmt, SwFrmFmt*& rpFormat) +static bool +lcl_IsStartNodeInFormat(const bool bHeader, SwStartNode *const pSttNode, + SwFrmFmt const*const pFrmFmt, SwFrmFmt*& rpFormat) { - sal_Bool bRet = sal_False; + bool bRet = false; const SfxItemSet& rSet = pFrmFmt->GetAttrSet(); const SfxPoolItem* pItem; - SwFrmFmt* pHeadFootFmt; - if(SFX_ITEM_SET == rSet.GetItemState( static_cast< USHORT >(bHeader ? RES_HEADER : RES_FOOTER), sal_True, &pItem) && - 0 != (pHeadFootFmt = bHeader ? - ((SwFmtHeader*)pItem)->GetHeaderFmt() : - ((SwFmtFooter*)pItem)->GetFooterFmt())) - { - const SwFmtCntnt& rFlyCntnt = pHeadFootFmt->GetCntnt(); - const SwNode& rNode = rFlyCntnt.GetCntntIdx()->GetNode(); - const SwStartNode* pCurSttNode = rNode.FindSttNodeByType( - bHeader ? SwHeaderStartNode : SwFooterStartNode); - if(pCurSttNode && pCurSttNode == pSttNode) + if (SFX_ITEM_SET == rSet.GetItemState( + static_cast(bHeader ? RES_HEADER : RES_FOOTER), + sal_True, &pItem)) + { + SfxPoolItem *const pItemNonConst(const_cast(pItem)); + SwFrmFmt *const pHeadFootFmt = (bHeader) ? + static_cast(pItemNonConst)->GetHeaderFmt() : + static_cast(pItemNonConst)->GetFooterFmt(); + if (pHeadFootFmt) { - bRet = sal_True; - rpFormat = pHeadFootFmt; + const SwFmtCntnt& rFlyCntnt = pHeadFootFmt->GetCntnt(); + const SwNode& rNode = rFlyCntnt.GetCntntIdx()->GetNode(); + SwStartNode const*const pCurSttNode = rNode.FindSttNodeByType( + (bHeader) ? SwHeaderStartNode : SwFooterStartNode); + if (pCurSttNode && (pCurSttNode == pSttNode)) + { + rpFormat = pHeadFootFmt; + bRet = true; + } } } return bRet; } -uno::Reference< XTextRange > SwXTextRange::CreateTextRangeFromPosition( - SwDoc* pDoc, const SwPosition& rPos, const SwPosition* pMark) +} // namespace sw + +uno::Reference< text::XTextRange > +SwXTextRange::CreateXTextRange( + SwDoc & rDoc, const SwPosition& rPos, const SwPosition *const pMark) { - uno::Reference< XText > xParentText( CreateParentXText(pDoc, rPos) ); - std::auto_ptr pNewCrsr( pDoc->CreateUnoCrsr(rPos, sal_False) ); + const uno::Reference xParentText( + ::sw::CreateParentXText(rDoc, rPos)); + const ::std::auto_ptr pNewCrsr( + rDoc.CreateUnoCrsr(rPos, sal_False)); if(pMark) { pNewCrsr->SetMark(); *pNewCrsr->GetMark() = *pMark; } - bool isCell( dynamic_cast(xParentText.get()) ); - uno::Reference< XTextRange > xRet( + const bool isCell( dynamic_cast(xParentText.get()) ); + const uno::Reference< text::XTextRange > xRet( new SwXTextRange(*pNewCrsr, xParentText, isCell ? RANGE_IN_CELL : RANGE_IN_TEXT) ); return xRet; - } -uno::Reference< XText > SwXTextRange::CreateParentXText(SwDoc* pDoc, - const SwPosition& rPos) +namespace sw { + +uno::Reference< text::XText > +CreateParentXText(SwDoc & rDoc, const SwPosition& rPos) { - uno::Reference< XText > xParentText; + uno::Reference< text::XText > xParentText; SwStartNode* pSttNode = rPos.nNode.GetNode().StartOfSectionNode(); while(pSttNode && pSttNode->IsSectionNode()) { @@ -1771,18 +1783,19 @@ uno::Reference< XText > SwXTextRange::CreateParentXText(SwDoc* pDoc, { case SwTableBoxStartNode: { - const SwTableNode* pTblNode = pSttNode->FindTableNode(); - SwFrmFmt* pTableFmt = (SwFrmFmt*)pTblNode->GetTable().GetFrmFmt(); - SwTableBox* pBox = pSttNode->GetTblBox(); + SwTableNode const*const pTblNode = pSttNode->FindTableNode(); + SwFrmFmt *const pTableFmt = + static_cast(pTblNode->GetTable().GetFrmFmt()); + SwTableBox *const pBox = pSttNode->GetTblBox(); - xParentText = pBox + xParentText = (pBox) ? SwXCell::CreateXCell( pTableFmt, pBox ) : new SwXCell( pTableFmt, *pSttNode ); } break; case SwFlyStartNode: { - SwFrmFmt* pFmt = pSttNode->GetFlyFmt(); + SwFrmFmt *const pFmt = pSttNode->GetFlyFmt(); if (0 != pFmt) { SwXTextFrame* pFrame( static_cast( @@ -1794,18 +1807,23 @@ uno::Reference< XText > SwXTextRange::CreateParentXText(SwDoc* pDoc, case SwHeaderStartNode: case SwFooterStartNode: { - sal_Bool bHeader = SwHeaderStartNode == eType; - sal_uInt16 nPDescCount = pDoc->GetPageDescCnt(); + const bool bHeader = (SwHeaderStartNode == eType); + const sal_uInt16 nPDescCount = rDoc.GetPageDescCnt(); for(sal_uInt16 i = 0; i < nPDescCount; i++) { - const SwPageDesc& rDesc = const_cast(pDoc) - ->GetPageDesc( i ); + const SwPageDesc& rDesc = + // C++ is retarded + const_cast(rDoc).GetPageDesc( i ); const SwFrmFmt* pFrmFmtMaster = &rDesc.GetMaster(); const SwFrmFmt* pFrmFmtLeft = &rDesc.GetLeft(); SwFrmFmt* pHeadFootFmt = 0; - if(!lcl_IsStartNodeInFormat(bHeader, pSttNode, pFrmFmtMaster, pHeadFootFmt)) - lcl_IsStartNodeInFormat(bHeader, pSttNode, pFrmFmtLeft, pHeadFootFmt); + if (!lcl_IsStartNodeInFormat(bHeader, pSttNode, pFrmFmtMaster, + pHeadFootFmt)) + { + lcl_IsStartNodeInFormat(bHeader, pSttNode, pFrmFmtLeft, + pHeadFootFmt); + } if(pHeadFootFmt) { @@ -1813,7 +1831,10 @@ uno::Reference< XText > SwXTextRange::CreateParentXText(SwDoc* pDoc, First( TYPE( SwXHeadFootText )); xParentText = pxHdFt; if(!pxHdFt) - xParentText = new SwXHeadFootText(*pHeadFootFmt, bHeader); + { + xParentText = + new SwXHeadFootText(*pHeadFootFmt, bHeader); + } break; } } @@ -1821,15 +1842,16 @@ uno::Reference< XText > SwXTextRange::CreateParentXText(SwDoc* pDoc, break; case SwFootnoteStartNode: { - sal_uInt16 n, nFtnCnt = pDoc->GetFtnIdxs().Count(); - uno::Reference< XFootnote > xRef; - for( n = 0; n < nFtnCnt; ++n ) + const sal_uInt16 nFtnCnt = rDoc.GetFtnIdxs().Count(); + uno::Reference< text::XFootnote > xRef; + for (sal_uInt16 n = 0; n < nFtnCnt; ++n ) { - const SwTxtFtn* pTxtFtn = pDoc->GetFtnIdxs()[ n ]; + const SwTxtFtn* pTxtFtn = rDoc.GetFtnIdxs()[ n ]; const SwFmtFtn& rFtn = pTxtFtn->GetFtn(); pTxtFtn = rFtn.GetTxtFtn(); #if OSL_DEBUG_LEVEL > 1 - const SwStartNode* pTmpSttNode = pTxtFtn->GetStartNode()->GetNode(). + const SwStartNode* pTmpSttNode = + pTxtFtn->GetStartNode()->GetNode(). FindSttNodeByType(SwFootnoteStartNode); (void)pTmpSttNode; #endif @@ -1837,11 +1859,12 @@ uno::Reference< XText > SwXTextRange::CreateParentXText(SwDoc* pDoc, if (pSttNode == pTxtFtn->GetStartNode()->GetNode(). FindSttNodeByType(SwFootnoteStartNode)) { - xParentText = ((SwUnoCallBack*)pDoc->GetUnoCallBack())-> + xParentText = + static_cast(rDoc.GetUnoCallBack())-> GetFootnote(rFtn); if (!xParentText.is()) { - xParentText = new SwXFootnote(pDoc, rFtn); + xParentText = new SwXFootnote(&rDoc, rFtn); } break; } @@ -1851,9 +1874,9 @@ uno::Reference< XText > SwXTextRange::CreateParentXText(SwDoc* pDoc, default: { // then it is the body text - uno::Reference xModel = - pDoc->GetDocShell()->GetBaseModel(); - uno::Reference< XTextDocument > xDoc( + const uno::Reference xModel = + rDoc.GetDocShell()->GetBaseModel(); + const uno::Reference< text::XTextDocument > xDoc( xModel, uno::UNO_QUERY); xParentText = xDoc->getText(); } @@ -1862,6 +1885,8 @@ uno::Reference< XText > SwXTextRange::CreateParentXText(SwDoc* pDoc, return xParentText; } +} // namespace sw + uno::Reference< container::XEnumeration > SAL_CALL SwXTextRange::createContentEnumeration(const OUString& rServiceName) throw (uno::RuntimeException) @@ -2168,8 +2193,8 @@ void SwXTextRanges::Impl::MakeRanges() SwPaM *pTmpCursor = pCursor; do { const uno::Reference< text::XTextRange > xRange( - SwXTextRange::CreateTextRangeFromPosition( - pTmpCursor->GetDoc(), + SwXTextRange::CreateXTextRange( + *pTmpCursor->GetDoc(), *pTmpCursor->GetPoint(), pTmpCursor->GetMark())); if (xRange.is()) { diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx index 404a93005a19..17336d80f64c 100644 --- a/sw/source/core/unocore/unoparagraph.cxx +++ b/sw/source/core/unocore/unoparagraph.cxx @@ -263,7 +263,7 @@ SwXParagraph::CreateXParagraph(SwDoc & rDoc, SwTxtNode& rTxtNode, if (!xParentText.is()) { SwPosition Pos( rTxtNode ); - xParentText.set(SwXTextRange::CreateParentXText( &rDoc, Pos )); + xParentText.set(::sw::CreateParentXText( rDoc, Pos )); } SwXParagraph *const pXPara( new SwXParagraph(xParentText, rTxtNode, nSelStart, nSelEnd) ); diff --git a/sw/source/core/unocore/unoredline.cxx b/sw/source/core/unocore/unoredline.cxx index 9cfce5c31a62..e1680cabecc2 100644 --- a/sw/source/core/unocore/unoredline.cxx +++ b/sw/source/core/unocore/unoredline.cxx @@ -591,11 +591,8 @@ uno::Any SwXRedline::getPropertyValue( const OUString& rPropertyName ) pPoint = pRedline->GetPoint(); else pPoint = pRedline->GetMark(); - SwPaM aTmp(*pPoint); - uno::Reference xTmpParent; -// uno::Reference< text::XTextRange > xRange = SwXTextRange::createTextRangeFromPaM(aTmp); - uno::ReferencexRange = - SwXTextRange::CreateTextRangeFromPosition( pDoc, *pPoint, 0 ); + const uno::Reference xRange = + SwXTextRange::CreateXTextRange(*pDoc, *pPoint, 0); xRet = xRange.get(); } break; diff --git a/sw/source/core/unocore/unorefmk.cxx b/sw/source/core/unocore/unorefmk.cxx index 68516a923eb7..a0903b6ea145 100644 --- a/sw/source/core/unocore/unorefmk.cxx +++ b/sw/source/core/unocore/unorefmk.cxx @@ -309,7 +309,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException) SwUnoInternalPaM aPam(*pDocument); //das muss jetzt sal_True liefern - SwXTextRange::XTextRangeToSwPaM(aPam, xTextRange); + ::sw::XTextRangeToSwPaM(aPam, xTextRange); m_pImpl->InsertRefMark(aPam, dynamic_cast(pCursor)); m_pImpl->m_bIsDescriptor = sal_False; m_pImpl->m_pDoc = pDocument; @@ -342,8 +342,8 @@ SwXReferenceMark::getAnchor() throw (uno::RuntimeException) rTxtNode, *pTxtMark->GetStart()) : new SwPaM( rTxtNode, *pTxtMark->GetStart()) ); - return SwXTextRange::CreateTextRangeFromPosition( - m_pImpl->m_pDoc, *pPam->Start(), pPam->End()); + return SwXTextRange::CreateXTextRange( + *m_pImpl->m_pDoc, *pPam->Start(), pPam->End()); } } } @@ -820,8 +820,7 @@ SwXMeta::CreateXMeta(::sw::Meta & rMeta, OSL_ENSURE(pTxtAttr, "CreateXMeta: no text attr?"); if (!pTxtAttr) { return 0; } const SwPosition aPos(*pTxtNode, *pTxtAttr->GetStart()); - xParentText.set( - SwXTextRange::CreateParentXText(pTxtNode->GetDoc(), aPos) ); + xParentText.set( ::sw::CreateParentXText(*pTxtNode->GetDoc(), aPos) ); } if (!xParentText.is()) { return 0; } SwXMeta *const pXMeta( (RES_TXTATR_META == rMeta.GetFmtMeta()->Which()) @@ -1072,7 +1071,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException) } SwUnoInternalPaM aPam(*pDoc); - SwXTextRange::XTextRangeToSwPaM(aPam, i_xTextRange); + ::sw::XTextRangeToSwPaM(aPam, i_xTextRange); UnoActionContext aContext(pDoc); @@ -1109,8 +1108,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException) pMeta->Add(m_pImpl.get()); pMeta->SetXMeta(uno::Reference(this)); - m_pImpl->m_xParentText = - SwXTextRange::CreateParentXText(pDoc, *aPam.GetPoint()); + m_pImpl->m_xParentText = ::sw::CreateParentXText(*pDoc, *aPam.GetPoint()); m_pImpl->m_bIsDescriptor = false; } @@ -1153,8 +1151,7 @@ SwXMeta::getAnchor() throw (uno::RuntimeException) const SwPosition start(*pTxtNode, nMetaStart - 1); // -1 due to CH_TXTATR const SwPosition end(*pTxtNode, nMetaEnd); - return SwXTextRange::CreateTextRangeFromPosition( - pTxtNode->GetDoc(), start, &end); + return SwXTextRange::CreateXTextRange(*pTxtNode->GetDoc(), start, &end); } // XTextRange diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx index c47a3aef1345..d9d6bafa31a1 100644 --- a/sw/source/core/unocore/unosect.cxx +++ b/sw/source/core/unocore/unosect.cxx @@ -328,7 +328,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException) SwUnoInternalPaM aPam(*pDoc); //das muss jetzt sal_True liefern - SwXTextRange::XTextRangeToSwPaM(aPam, xTextRange); + ::sw::XTextRangeToSwPaM(aPam, xTextRange); UnoActionContext aCont(pDoc); pDoc->StartUndo( UNDO_INSSECTION, NULL ); @@ -488,7 +488,7 @@ SwXTextSection::getAnchor() throw (uno::RuntimeException) const SwEndNode* pEndNode = pIdx->GetNode().EndOfSectionNode(); SwPaM aEnd(*pEndNode); aEnd.Move( fnMoveBackward, fnGoCntnt ); - xRet = SwXTextRange::CreateTextRangeFromPosition(pSectFmt->GetDoc(), + xRet = SwXTextRange::CreateXTextRange(*pSectFmt->GetDoc(), *aPaM.Start(), aEnd.Start()); } } diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index 866c4979072e..6143e7ed2661 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -1062,7 +1062,8 @@ uno::Reference< text::XTextCursor > SwXCell::createTextCursorByRange(const uno: vos::OGuard aGuard(Application::GetSolarMutex()); uno::Reference< text::XTextCursor > aRef; SwUnoInternalPaM aPam(*GetDoc()); - if((pStartNode || IsValid()) && SwXTextRange::XTextRangeToSwPaM(aPam, xTextPosition)) + if ((pStartNode || IsValid()) + && ::sw::XTextRangeToSwPaM(aPam, xTextPosition)) { const SwStartNode* pSttNd = pStartNode ? pStartNode : pBox->GetSttNd(); //skip sections @@ -2468,7 +2469,7 @@ void SwXTextTable::attachToRange(const uno::Reference< text::XTextRange > & xTex { SwUnoInternalPaM aPam(*pDoc); //das muss jetzt sal_True liefern - SwXTextRange::XTextRangeToSwPaM(aPam, xTextRange); + ::sw::XTextRangeToSwPaM(aPam, xTextRange); { UnoActionContext aCont( pDoc ); diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index 023290984ebf..415a3aaf6933 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -382,7 +382,7 @@ void SwXText::insertControlCharacter(const uno::Reference< text::XTextRange > & if (GetDoc()) { SwUnoInternalPaM aPam(*GetDoc()); - if(SwXTextRange::XTextRangeToSwPaM(aPam, xTextRange)) + if (::sw::XTextRangeToSwPaM(aPam, xTextRange)) { const bool bForceExpandHints(CheckForOwnMemberMeta(aPam, bAbsorb)); @@ -504,7 +504,7 @@ void SwXText::insertTextContent(const uno::Reference< text::XTextRange > & xRang if(xRange.is() && xContent.is()) { SwUnoInternalPaM aPam(*GetDoc()); - if(SwXTextRange::XTextRangeToSwPaM(aPam, xRange)) + if (::sw::XTextRangeToSwPaM(aPam, xRange)) { uno::Reference xRangeTunnel( xRange, uno::UNO_QUERY); SwXTextRange* pRange = 0; @@ -1060,8 +1060,8 @@ sal_Int16 SwXText::ComparePositions( SwUnoInternalPaM aPam2(*GetDoc()); BOOL bExcept = FALSE; - if(SwXTextRange::XTextRangeToSwPaM(aPam1, xPos1) && - SwXTextRange::XTextRangeToSwPaM(aPam2, xPos2)) + if (::sw::XTextRangeToSwPaM(aPam1, xPos1) && + ::sw::XTextRangeToSwPaM(aPam2, xPos2)) { uno::Reference xRangeTunnel1( xPos1, uno::UNO_QUERY); SwXTextRange* pRange1 = 0; @@ -1582,8 +1582,8 @@ uno::Reference< text::XTextContent > SwXText::convertToTextFrame( uno::Reference< text::XTextContent > xRet; SwUnoInternalPaM aStartPam(*GetDoc()); std::auto_ptr < SwUnoInternalPaM > pEndPam( new SwUnoInternalPaM(*GetDoc())); - if(SwXTextRange::XTextRangeToSwPaM(aStartPam, xStart) && - SwXTextRange::XTextRangeToSwPaM(*pEndPam, xEnd) ) + if (::sw::XTextRangeToSwPaM(aStartPam, xStart) && + ::sw::XTextRangeToSwPaM(*pEndPam, xEnd)) { uno::Reference xStartRangeTunnel( xStart, uno::UNO_QUERY); SwXTextRange* pStartRange = reinterpret_cast< SwXTextRange * >( @@ -1826,8 +1826,8 @@ uno::Reference< text::XTextTable > SwXText::convertToTable( // !!! TODO - PaMs in tables and sections do not work here - the same applies to PaMs in frames !!! - if(!SwXTextRange::XTextRangeToSwPaM(aStartCellPam, xStartRange) || - !SwXTextRange::XTextRangeToSwPaM(aEndCellPam, xEndRange) ) + if (!::sw::XTextRangeToSwPaM(aStartCellPam, xStartRange) || + !::sw::XTextRangeToSwPaM(aEndCellPam, xEndRange)) throw lang::IllegalArgumentException(); /** check the nodes between start and end it is allowed to have pairs of StartNode/EndNodes @@ -2361,7 +2361,7 @@ uno::Reference< text::XTextCursor > SwXBodyText::createTextCursorByRange( throw aRuntime; } SwUnoInternalPaM aPam(*GetDoc()); - if(SwXTextRange::XTextRangeToSwPaM(aPam, aTextPosition)) + if (::sw::XTextRangeToSwPaM(aPam, aTextPosition)) { SwNode& rNode = GetDoc()->GetNodes().GetEndOfContent(); @@ -2603,7 +2603,7 @@ uno::Reference< text::XTextCursor > SwXHeadFootText::createTextCursorByRange( uno::Reference< text::XTextCursor > xRet; SwFrmFmt* pHeadFootFmt = GetFmt(); SwUnoInternalPaM aPam(*GetDoc()); - if(pHeadFootFmt && SwXTextRange::XTextRangeToSwPaM(aPam, aTextPosition)) + if (pHeadFootFmt && ::sw::XTextRangeToSwPaM(aPam, aTextPosition)) { SwNode& rNode = pHeadFootFmt->GetCntnt().GetCntntIdx()->GetNode(); SwPosition aPos(rNode); diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.cxx b/sw/source/filter/xml/XMLRedlineImportHelper.cxx index 4b89f042977f..bd1dea07179e 100644 --- a/sw/source/filter/xml/XMLRedlineImportHelper.cxx +++ b/sw/source/filter/xml/XMLRedlineImportHelper.cxx @@ -162,7 +162,7 @@ void XTextRangeOrNodeIndexPosition::SetAsNodeIndex( #ifdef DBG_UTIL sal_Bool bSuccess = #endif - SwXTextRange::XTextRangeToSwPaM( aPaM, rRange); + ::sw::XTextRangeToSwPaM(aPaM, rRange); DBG_ASSERT(bSuccess, "illegal range"); // PaM -> Index @@ -180,7 +180,7 @@ void XTextRangeOrNodeIndexPosition::CopyPositionInto(SwPosition& rPos) #ifdef DBG_UTIL sal_Bool bSuccess = #endif - SwXTextRange::XTextRangeToSwPaM(aUnoPaM, xRange); + ::sw::XTextRangeToSwPaM(aUnoPaM, xRange); DBG_ASSERT(bSuccess, "illegal range"); rPos = *aUnoPaM.GetPoint(); diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx index d53261ea3fe5..704b6af7fa74 100644 --- a/sw/source/filter/xml/swxml.cxx +++ b/sw/source/filter/xml/swxml.cxx @@ -788,9 +788,8 @@ ULONG XMLReader::Read( SwDoc &rDoc, const String& rBaseURL, SwPaM &rPaM, const S } else if( bInsertMode ) { - uno::Reference xInsertTextRange = - SwXTextRange::CreateTextRangeFromPosition( &rDoc, *rPaM.GetPoint(), - 0 ); + const uno::Reference xInsertTextRange = + SwXTextRange::CreateXTextRange(rDoc, *rPaM.GetPoint(), 0); OUString sTextInsertModeRange( RTL_CONSTASCII_USTRINGPARAM("TextInsertModeRange")); xInfoSet->setPropertyValue( sTextInsertModeRange, diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx index 003318dbe989..9059b98db6b8 100644 --- a/sw/source/filter/xml/xmlimp.cxx +++ b/sw/source/filter/xml/xmlimp.cxx @@ -713,9 +713,9 @@ void SwXMLImport::startDocument( void ) } if( pCrsrSh ) { - Reference xInsertTextRange( - SwXTextRange::CreateTextRangeFromPosition( - pDoc, *pCrsrSh->GetCrsr()->GetPoint(), 0 ) ); + const uno::Reference xInsertTextRange( + SwXTextRange::CreateXTextRange( + *pDoc, *pCrsrSh->GetCrsr()->GetPoint(), 0 ) ); setTextInsertMode( xInsertTextRange ); xTextCursor = GetTextImport()->GetCursor(); pTxtCrsr = 0; diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx index e2b154178b29..0cf164489eb4 100644 --- a/sw/source/filter/xml/xmltbli.cxx +++ b/sw/source/filter/xml/xmltbli.cxx @@ -2926,8 +2926,8 @@ const SwStartNode *SwXMLTableContext::InsertTableSection( SwPosition aPos( *pCNd ); aPos.nContent.Assign( pCNd, 0U ); - Reference < XTextRange > xTextRange = - SwXTextRange::CreateTextRangeFromPosition( pDoc, aPos, 0 ); + const uno::Reference< text::XTextRange > xTextRange = + SwXTextRange::CreateXTextRange( *pDoc, aPos, 0 ); Reference < XText > xText = xTextRange->getText(); Reference < XTextCursor > xTextCursor = xText->createTextCursorByRange( xTextRange ); diff --git a/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx b/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx index 85838652d370..0332dfa7058b 100644 --- a/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx +++ b/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx @@ -258,8 +258,10 @@ svx::SpellPortions SwSpellDialogChildWindow::GetNextWrongSentence (void) //mark the start position only if not at start of doc if(!pWrtShell->IsStartOfDoc()) { - m_pSpellState->m_xStartRange = SwXTextRange::CreateTextRangeFromPosition( - pWrtShell->GetDoc(), *pCrsr->Start(), pCrsr->End()); + m_pSpellState->m_xStartRange = + SwXTextRange::CreateXTextRange( + *pWrtShell->GetDoc(), + *pCrsr->Start(), pCrsr->End()); } pWrtShell->SpellStart( DOCPOS_START, DOCPOS_END, DOCPOS_CURR, FALSE ); } @@ -390,7 +392,8 @@ svx::SpellPortions SwSpellDialogChildWindow::GetNextWrongSentence (void) if(RET_YES == nRet) { SwUnoInternalPaM aPam(*pWrtShell->GetDoc()); - if(SwXTextRange::XTextRangeToSwPaM(aPam, m_pSpellState->m_xStartRange)) + if (::sw::XTextRangeToSwPaM(aPam, + m_pSpellState->m_xStartRange)) { pWrtShell->SetSelection(aPam); pWrtShell->SpellStart(DOCPOS_START, DOCPOS_CURR, DOCPOS_START); diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index 22d683a0f29d..3bb65ea4e900 100644 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -991,11 +991,10 @@ Reference< XInterface > SwXTextDocument::findFirst(const Reference< util::XSear Reference< XInterface > xRet; if(nResult) { - Reference< XTextRange > xTempRange = SwXTextRange::CreateTextRangeFromPosition( - pDocShell->GetDoc(), - *pResultCrsr->GetPoint(), - pResultCrsr->GetMark()); - xRet = *new SwXTextCursor(xTempRange->getText(), pResultCrsr); + const uno::Reference< text::XText > xParent = + ::sw::CreateParentXText(*pDocShell->GetDoc(), + *pResultCrsr->GetPoint()); + xRet = *new SwXTextCursor(xParent, pResultCrsr); delete pResultCrsr; } return xRet; @@ -1019,12 +1018,11 @@ Reference< XInterface > SwXTextDocument::findNext(const Reference< XInterface > Reference< XInterface > xRet; if(nResult) { - Reference< XTextRange > xTempRange = SwXTextRange::CreateTextRangeFromPosition( - pDocShell->GetDoc(), - *pResultCrsr->GetPoint(), - pResultCrsr->GetMark()); + const uno::Reference< text::XText > xParent = + ::sw::CreateParentXText(*pDocShell->GetDoc(), + *pResultCrsr->GetPoint()); - xRet = *new SwXTextCursor(xTempRange->getText(), pResultCrsr); + xRet = *new SwXTextCursor(xParent, pResultCrsr); delete pResultCrsr; } return xRet; diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx index 9e637ca58260..6d001b95f378 100644 --- a/sw/source/ui/uno/unotxvw.cxx +++ b/sw/source/ui/uno/unotxvw.cxx @@ -334,7 +334,7 @@ sal_Bool SwXTextView::select(const uno::Any& aInterface) throw( lang::IllegalArg else if(!pFrame && !pCell && xPos.is()) { SwUnoInternalPaM aPam(*pDoc); - if(SwXTextRange::XTextRangeToSwPaM(aPam, xPos)) + if (::sw::XTextRangeToSwPaM(aPam, xPos)) { pPam = lcl_createPamCopy(aPam); } @@ -1362,7 +1362,7 @@ void SwXTextViewCursor::gotoRange( throw uno::RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "no text selection" ) ), static_cast < cppu::OWeakObject * > ( this ) ); SwUnoInternalPaM rDestPam(*m_pView->GetDocShell()->GetDoc()); - if(!SwXTextRange::XTextRangeToSwPaM( rDestPam, xRange)) + if (!::sw::XTextRangeToSwPaM(rDestPam, xRange)) throw IllegalArgumentException(); ShellModes eSelMode = m_pView->GetShellMode(); @@ -1699,9 +1699,7 @@ uno::Reference< text::XText > SwXTextViewCursor::getText(void) throw( uno::Runt SwWrtShell& rSh = m_pView->GetWrtShell(); SwPaM* pShellCrsr = rSh.GetCrsr(); SwDoc* pDoc = m_pView->GetDocShell()->GetDoc(); - uno::Reference< text::XTextRange > xRg = SwXTextRange::CreateTextRangeFromPosition(pDoc, - *pShellCrsr->Start(), 0); - xRet = xRg->getText(); + xRet = ::sw::CreateParentXText(*pDoc, *pShellCrsr->Start()); } else throw uno::RuntimeException(); @@ -1722,8 +1720,7 @@ uno::Reference< text::XTextRange > SwXTextViewCursor::getStart(void) throw( uno SwWrtShell& rSh = m_pView->GetWrtShell(); SwPaM* pShellCrsr = rSh.GetCrsr(); SwDoc* pDoc = m_pView->GetDocShell()->GetDoc(); - xRet = SwXTextRange::CreateTextRangeFromPosition(pDoc, - *pShellCrsr->Start(), 0); + xRet = SwXTextRange::CreateXTextRange(*pDoc, *pShellCrsr->Start(), 0); } else throw uno::RuntimeException(); @@ -1744,8 +1741,7 @@ uno::Reference< text::XTextRange > SwXTextViewCursor::getEnd(void) throw( uno:: SwWrtShell& rSh = m_pView->GetWrtShell(); SwPaM* pShellCrsr = rSh.GetCrsr(); SwDoc* pDoc = m_pView->GetDocShell()->GetDoc(); - xRet = SwXTextRange::CreateTextRangeFromPosition(pDoc, - *pShellCrsr->End(), 0); + xRet = SwXTextRange::CreateXTextRange(*pDoc, *pShellCrsr->End(), 0); } else throw uno::RuntimeException(); -- cgit v1.2.3 From 0a3b5f8b3edacaf2e58de0b661077683e5973db5 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:54 +0100 Subject: swunolocking1: #i105557#: fix locking for SwXParaFrameEnumeration: add Impl struct, and use UnoImplPtr to lock destructor. move all implementation details out of header, into Impl struct. replace PARAFRAME_PORTION_ macros with an enum. use new XServiceInfo helpers. clean up the implementation a little. --- sw/inc/unoparaframeenum.hxx | 29 ++-- sw/source/core/unocore/unoobj2.cxx | 271 +++++++++++++++++++++---------------- 2 files changed, 165 insertions(+), 135 deletions(-) diff --git a/sw/inc/unoparaframeenum.hxx b/sw/inc/unoparaframeenum.hxx index d05fccfed46d..7e5b43f1e637 100644 --- a/sw/inc/unoparaframeenum.hxx +++ b/sw/inc/unoparaframeenum.hxx @@ -42,13 +42,12 @@ #include -#include -#include +#include +class SwDepend; class SwNodeIndex; class SwPaM; -class SwUnoCrsr; class SwFrmFmt; @@ -80,10 +79,12 @@ void CollectFrameAtNode( SwClient& rClnt, const SwNodeIndex& rIdx, * * --------------------------------------------------*/ -#define PARAFRAME_PORTION_PARAGRAPH 0 -#define PARAFRAME_PORTION_CHAR 1 -#define PARAFRAME_PORTION_TEXTRANGE 2 - +enum ParaFrameMode +{ + PARAFRAME_PORTION_PARAGRAPH, + PARAFRAME_PORTION_CHAR, + PARAFRAME_PORTION_TEXTRANGE, +}; typedef ::cppu::WeakImplHelper2 < ::com::sun::star::lang::XServiceInfo @@ -92,27 +93,19 @@ typedef ::cppu::WeakImplHelper2 class SwXParaFrameEnumeration : public SwXParaFrameEnumeration_Base - , public SwClient { private: - ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > - m_xNextObject; // created by hasMoreElements - FrameDependList_t m_Frames; - - SwUnoCrsr* GetCursor() const - {return static_cast(const_cast(GetRegisteredIn()));} + class Impl; + ::sw::UnoImplPtr m_pImpl; virtual ~SwXParaFrameEnumeration(); public: SwXParaFrameEnumeration(const SwPaM& rPaM, - sal_uInt8 nParaFrameMode, SwFrmFmt* pFmt = 0); - - // SwClient - virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + const enum ParaFrameMode eParaFrameMode, SwFrmFmt *const pFmt = 0); // XServiceInfo virtual ::rtl::OUString SAL_CALL getImplementationName() diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index 0027d8ef0b02..1f53b5130e51 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -2359,6 +2359,68 @@ void SwXTextCursor::SetString(SwCursor& rCrsr, const OUString& rString) * SwXParaFrameEnumeration ******************************************************************/ +class SwXParaFrameEnumeration::Impl + : public SwClient +{ + +public: + + // created by hasMoreElements + uno::Reference< text::XTextContent > m_xNextObject; + FrameDependList_t m_Frames; + + Impl(SwPaM const & rPaM) + : SwClient(rPaM.GetDoc()->CreateUnoCrsr(*rPaM.GetPoint(), sal_False)) + { + if (rPaM.HasMark()) + { + GetCursor()->SetMark(); + *GetCursor()->GetMark() = *rPaM.GetMark(); + } + } + + ~Impl() { + // Impl owns the cursor; delete it here: SolarMutex is locked + delete GetRegisteredIn(); + } + + SwUnoCrsr * GetCursor() { + return static_cast( + const_cast(GetRegisteredIn())); + } + + // SwClient + virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + +}; + +/*-- 23.03.99 13:22:37--------------------------------------------------- + + -----------------------------------------------------------------------*/ + +struct InvalidFrameDepend { + bool operator() (::boost::shared_ptr const & rEntry) + { return !rEntry->GetRegisteredIn(); } +}; + +void SwXParaFrameEnumeration::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew) +{ + ClientModify(this, pOld, pNew); + if(!GetRegisteredIn()) + { + m_Frames.clear(); + m_xNextObject = 0; + } + else + { + // check if any frame went away... + FrameDependList_t::iterator const iter = + ::std::remove_if(m_Frames.begin(), m_Frames.end(), + InvalidFrameDepend()); + m_Frames.erase(iter, m_Frames.end()); + } +} + /* -----------------23.03.99 13:38------------------- * * --------------------------------------------------*/ @@ -2370,7 +2432,7 @@ lcl_CreateNextObject(SwUnoCrsr& i_rUnoCrsr, if (!i_rFrames.size()) return sal_False; - SwFrmFmt* pFormat = static_cast(const_cast( + SwFrmFmt *const pFormat = static_cast(const_cast( i_rFrames.front()->GetRegisteredIn())); i_rFrames.pop_front(); // the format should be valid here, otherwise the client @@ -2391,7 +2453,7 @@ lcl_CreateNextObject(SwUnoCrsr& i_rUnoCrsr, { const SwNodeIndex* pIdx = pFormat->GetCntnt().GetCntntIdx(); DBG_ASSERT(pIdx, "where is the index?"); - const SwNode* pNd = + SwNode const*const pNd = i_rUnoCrsr.GetDoc()->GetNodes()[ pIdx->GetIndex() + 1 ]; const FlyCntType eType = (!pNd->IsNoTxtNode()) ? FLYCNTTYPE_FRM @@ -2410,11 +2472,12 @@ lcl_CreateNextObject(SwUnoCrsr& i_rUnoCrsr, and fill the frame into the array ---------------------------------------------------------------------------*/ static void -lcl_FillFrame(SwXParaFrameEnumeration & rEnum, SwUnoCrsr& rUnoCrsr, +lcl_FillFrame(SwClient & rEnum, SwUnoCrsr& rUnoCrsr, FrameDependList_t & rFrames) { // search for objects at the cursor - anchored at/as char - const SwTxtAttr * pTxtAttr = rUnoCrsr.GetNode()->GetTxtNode()->GetTxtAttr( + SwTxtAttr const*const pTxtAttr = + rUnoCrsr.GetNode()->GetTxtNode()->GetTxtAttr( rUnoCrsr.GetPoint()->nContent, RES_TXTATR_FLYCNT); if (pTxtAttr) { @@ -2425,93 +2488,64 @@ lcl_FillFrame(SwXParaFrameEnumeration & rEnum, SwUnoCrsr& rUnoCrsr, } } -/* -----------------------------06.04.00 16:39-------------------------------- - - ---------------------------------------------------------------------------*/ -OUString SwXParaFrameEnumeration::getImplementationName() -throw( RuntimeException ) -{ - return C2U("SwXParaFrameEnumeration"); -} -/* -----------------------------06.04.00 16:39-------------------------------- - - ---------------------------------------------------------------------------*/ -sal_Bool SwXParaFrameEnumeration::supportsService(const OUString& rServiceName) -throw( RuntimeException ) -{ - return C2U("com.sun.star.util.ContentEnumeration") == rServiceName; -} -/* -----------------------------06.04.00 16:39-------------------------------- - - ---------------------------------------------------------------------------*/ -Sequence< OUString > SwXParaFrameEnumeration::getSupportedServiceNames() -throw( RuntimeException ) -{ - Sequence< OUString > aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = C2U("com.sun.star.util.ContentEnumeration"); - return aRet; -} /*-- 23.03.99 13:22:29--------------------------------------------------- -----------------------------------------------------------------------*/ -SwXParaFrameEnumeration::SwXParaFrameEnumeration(const SwPaM& rPaM, - sal_uInt8 nParaFrameMode, - SwFrmFmt* pFmt) +SwXParaFrameEnumeration::SwXParaFrameEnumeration( + const SwPaM& rPaM, const enum ParaFrameMode eParaFrameMode, + SwFrmFmt *const pFmt) + : m_pImpl( new SwXParaFrameEnumeration::Impl(rPaM) ) { - SwDoc* pDoc = rPaM.GetDoc(); - SwUnoCrsr* pUnoCrsr = pDoc->CreateUnoCrsr(*rPaM.GetPoint(), sal_False); - if (rPaM.HasMark()) - { - pUnoCrsr->SetMark(); - *pUnoCrsr->GetMark() = *rPaM.GetMark(); - } - pUnoCrsr->Add(this); - - if (PARAFRAME_PORTION_PARAGRAPH == nParaFrameMode) + if (PARAFRAME_PORTION_PARAGRAPH == eParaFrameMode) { FrameDependSortList_t frames; - ::CollectFrameAtNode( *this, rPaM.GetPoint()->nNode, frames, false ); + ::CollectFrameAtNode(*m_pImpl.get(), rPaM.GetPoint()->nNode, + frames, false); ::std::transform(frames.begin(), frames.end(), - ::std::back_inserter(m_Frames), + ::std::back_inserter(m_pImpl->m_Frames), ::boost::bind(&FrameDependSortListEntry::pFrameDepend, _1)); } else if (pFmt) { - //jetzt einen SwDepend anlegen und in das Array einfuegen - SwDepend* pNewDepend = new SwDepend(this, pFmt); - m_Frames.push_back( ::boost::shared_ptr(pNewDepend) ); + // create SwDepend for frame and insert into array + SwDepend *const pNewDepend = new SwDepend(m_pImpl.get(), pFmt); + m_pImpl->m_Frames.push_back(::boost::shared_ptr(pNewDepend)); } - else if((PARAFRAME_PORTION_CHAR == nParaFrameMode) || - (PARAFRAME_PORTION_TEXTRANGE == nParaFrameMode)) + else if ((PARAFRAME_PORTION_CHAR == eParaFrameMode) || + (PARAFRAME_PORTION_TEXTRANGE == eParaFrameMode)) { - if(PARAFRAME_PORTION_TEXTRANGE == nParaFrameMode) + if (PARAFRAME_PORTION_TEXTRANGE == eParaFrameMode) { SwPosFlyFrms aFlyFrms; //get all frames that are bound at paragraph or at character - pDoc->GetAllFlyFmts(aFlyFrms, pUnoCrsr);//, bDraw); + rPaM.GetDoc()->GetAllFlyFmts(aFlyFrms, m_pImpl->GetCursor()); for(USHORT i = 0; i < aFlyFrms.Count(); i++) { SwPosFlyFrm* pPosFly = aFlyFrms[i]; - SwFrmFmt* pFrmFmt = (SwFrmFmt*)&pPosFly->GetFmt(); - //jetzt einen SwDepend anlegen und in das Array einfuegen - SwDepend* pNewDepend = new SwDepend(this, pFrmFmt); - m_Frames.push_back( ::boost::shared_ptr(pNewDepend) ); + SwFrmFmt *const pFrmFmt = + const_cast(&pPosFly->GetFmt()); + // create SwDepend for frame and insert into array + SwDepend *const pNewDepend = + new SwDepend(m_pImpl.get(), pFrmFmt); + m_pImpl->m_Frames.push_back( + ::boost::shared_ptr(pNewDepend) ); } //created from any text range - if(pUnoCrsr->HasMark()) + if (m_pImpl->GetCursor()->HasMark()) { - if(pUnoCrsr->Start() != pUnoCrsr->GetPoint()) - pUnoCrsr->Exchange(); + m_pImpl->GetCursor()->Normalize(); do { - lcl_FillFrame(*this, *pUnoCrsr, m_Frames); - pUnoCrsr->Right(1, CRSR_SKIP_CHARS, FALSE, FALSE); + lcl_FillFrame(*m_pImpl.get(), *m_pImpl->GetCursor(), + m_pImpl->m_Frames); + m_pImpl->GetCursor()->Right( + 1, CRSR_SKIP_CHARS, FALSE, FALSE); } - while(*pUnoCrsr->GetPoint() < *pUnoCrsr->GetMark()); + while (*m_pImpl->GetCursor()->GetPoint() < + *m_pImpl->GetCursor()->GetMark()); } } - lcl_FillFrame(*this, *pUnoCrsr, m_Frames); + lcl_FillFrame(*m_pImpl.get(), *m_pImpl->GetCursor(), m_pImpl->m_Frames); } } /*-- 23.03.99 13:22:30--------------------------------------------------- @@ -2519,89 +2553,92 @@ SwXParaFrameEnumeration::SwXParaFrameEnumeration(const SwPaM& rPaM, -----------------------------------------------------------------------*/ SwXParaFrameEnumeration::~SwXParaFrameEnumeration() { - vos::OGuard aGuard(Application::GetSolarMutex()); - - SwUnoCrsr* pUnoCrsr = GetCursor(); - delete pUnoCrsr; } /*-- 23.03.99 13:22:32--------------------------------------------------- -----------------------------------------------------------------------*/ -sal_Bool SwXParaFrameEnumeration::hasMoreElements() -throw( uno::RuntimeException ) +sal_Bool SAL_CALL +SwXParaFrameEnumeration::hasMoreElements() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - if (!GetCursor()) + if (!m_pImpl->GetCursor()) throw uno::RuntimeException(); - return m_xNextObject.is() ? sal_True : - lcl_CreateNextObject(*GetCursor(), m_xNextObject, m_Frames); + return (m_pImpl->m_xNextObject.is()) + ? sal_True + : lcl_CreateNextObject(*m_pImpl->GetCursor(), + m_pImpl->m_xNextObject, m_pImpl->m_Frames); } /*-- 23.03.99 13:22:33--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Any SwXParaFrameEnumeration::nextElement() - throw( container::NoSuchElementException, - lang::WrappedTargetException, uno::RuntimeException ) +uno::Any SAL_CALL SwXParaFrameEnumeration::nextElement() +throw (container::NoSuchElementException, + lang::WrappedTargetException, uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - if (!GetCursor()) + if (!m_pImpl->GetCursor()) + { throw uno::RuntimeException(); + } - if (!m_xNextObject.is() && m_Frames.size()) + if (!m_pImpl->m_xNextObject.is() && m_pImpl->m_Frames.size()) { - lcl_CreateNextObject(*GetCursor(), m_xNextObject, m_Frames); + lcl_CreateNextObject(*m_pImpl->GetCursor(), + m_pImpl->m_xNextObject, m_pImpl->m_Frames); } - if(!m_xNextObject.is()) + if (!m_pImpl->m_xNextObject.is()) + { throw container::NoSuchElementException(); - uno::Any aRet(&m_xNextObject, - ::getCppuType((uno::Reference*)0)); - m_xNextObject = 0; + } + uno::Any aRet; + aRet <<= m_pImpl->m_xNextObject; + m_pImpl->m_xNextObject = 0; return aRet; } -struct InvalidFrameDepend { - bool operator() (::boost::shared_ptr const & rEntry) - { return !rEntry->GetRegisteredIn(); } -}; +/* -----------------------------06.04.00 16:39-------------------------------- -/*-- 23.03.99 13:22:37--------------------------------------------------- + ---------------------------------------------------------------------------*/ +OUString SAL_CALL +SwXParaFrameEnumeration::getImplementationName() throw (uno::RuntimeException) +{ + return C2U("SwXParaFrameEnumeration"); +} - -----------------------------------------------------------------------*/ -void SwXParaFrameEnumeration::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) +/* -----------------------------06.04.00 16:39-------------------------------- + + ---------------------------------------------------------------------------*/ +static char const*const g_ServicesParaFrameEnum[] = { - switch( pOld ? pOld->Which() : 0 ) - { - case RES_REMOVE_UNO_OBJECT: - case RES_OBJECTDYING: - if( (void*)GetRegisteredIn() == ((SwPtrMsgPoolItem *)pOld)->pObject ) - ((SwModify*)GetRegisteredIn())->Remove(this); - break; + "com.sun.star.util.ContentEnumeration", +}; +static const size_t g_nServicesParaFrameEnum( + sizeof(g_ServicesParaFrameEnum)/sizeof(g_ServicesParaFrameEnum[0])); - case RES_FMT_CHG: - // wurden wir an das neue umgehaengt und wird das alte geloscht? - if( ((SwFmtChg*)pNew)->pChangedFmt == GetRegisteredIn() && - ((SwFmtChg*)pOld)->pChangedFmt->IsFmtInDTOR() ) - ((SwModify*)GetRegisteredIn())->Remove(this); - break; - } - if(!GetRegisteredIn()) - { - m_Frames.clear(); - m_xNextObject = 0; - } - else - { - // check if any frame went away... - FrameDependList_t::iterator iter = - ::std::remove_if(m_Frames.begin(), m_Frames.end(), - InvalidFrameDepend()); - m_Frames.erase(iter, m_Frames.end()); - } +sal_Bool SAL_CALL +SwXParaFrameEnumeration::supportsService(const OUString& rServiceName) +throw (uno::RuntimeException) +{ + return ::sw::SupportsServiceImpl( + g_nServicesParaFrameEnum, g_ServicesParaFrameEnum, rServiceName); +} + +/* -----------------------------06.04.00 16:39-------------------------------- + + ---------------------------------------------------------------------------*/ +uno::Sequence< OUString > SAL_CALL +SwXParaFrameEnumeration::getSupportedServiceNames() +throw (uno::RuntimeException) +{ + return ::sw::GetSupportedServiceNamesImpl( + g_nServicesParaFrameEnum, g_ServicesParaFrameEnum); } + + // ----------------------------------------------------------------------------- IMPLEMENT_FORWARD_REFCOUNT( SwXTextCursor,SwXTextCursor_Base ) -- cgit v1.2.3 From 2245100b4ac33d68ba6033871e22c3573bc10047 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:54 +0100 Subject: swunolocking1: #i105557#: SwXTextCursor: move implementation of all non-static methods into unoobj.cxx. --- sw/source/core/unocore/unoobj.cxx | 603 +++++++++++++++++++++++++++++++++++++ sw/source/core/unocore/unoobj2.cxx | 512 ------------------------------- 2 files changed, 603 insertions(+), 512 deletions(-) diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx index b48451b90cf9..a0b08fffc879 100644 --- a/sw/source/core/unocore/unoobj.cxx +++ b/sw/source/core/unocore/unoobj.cxx @@ -31,9 +31,11 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" +#include #include #include +#include #include #include #include @@ -115,6 +117,7 @@ #define _SVSTDARR_USHORTSSORT #include #include +#include #include #include #include @@ -122,6 +125,8 @@ #include #include #include +#include +#include using namespace ::com::sun::star; @@ -708,6 +713,96 @@ SwFmtColl* SwXTextCursor::GetCurTxtFmtColl(SwPaM& rPaM, BOOL bConditional) * SwXTextCursor ******************************************************************/ +/*-- 09.12.98 14:19:00--------------------------------------------------- + + -----------------------------------------------------------------------*/ +IMPL_STATIC_LINK( SwXTextCursor, RemoveCursor_Impl, + uno::Reference< XInterface >*, EMPTYARG ) +{ + ASSERT( pThis != NULL, "no reference?" ); + //ASSERT( pArg != NULL, "no reference?" ); + + // --> FME 2006-03-07 #126177# Tell the SwXTextCursor that the user event + // has been executed. It is not necessary to remove the user event in + // ~SwXTextCursor + pThis->DoNotRemoveUserEvent(); + // <-- + + SwUnoCrsr* pCursor = pThis->GetCrsr(); + if( pCursor != NULL ) + { + pCursor->Remove( pThis ); + delete pCursor; + } + + // --> FME 2006-03-07 #126177# + //delete pArg; + // <-- + + return 0; +} + +void SwXTextCursor::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) +{ + ClientModify(this, pOld, pNew); + + // if the cursor leaves its designated section, it becomes invalid + if( !mbRemoveUserEvent && ( pOld != NULL ) && ( pOld->Which() == RES_UNOCURSOR_LEAVES_SECTION ) ) + { + // --> FME 2006-03-07 #126177# We don't need to create a reference + // to the SwXTextCursor to prevent its deletion. If the destructor + // of the SwXTextCursor is called before the user event is executed, + // the user event will be removed. This is necessary, because an other + // thread might be currently waiting in ~SwXTextCursor. In this case + // the pRef = new ... stuff did not work! + + // create reference to this object to prevent deletion before + // the STATIC_LINK is executed. The link will delete the + // reference. + //uno::Reference* pRef = + //new uno::Reference( static_cast( this ) ); + + mbRemoveUserEvent = true; + // <-- + + mnUserEventId = Application::PostUserEvent( + STATIC_LINK( this, SwXTextCursor, RemoveCursor_Impl ), this ); + } + + if(!GetRegisteredIn()) + aLstnrCntnr.Disposing(); + +} + +/*-- 09.12.98 14:19:01--------------------------------------------------- + + -----------------------------------------------------------------------*/ +const SwPaM* SwXTextCursor::GetPaM() const +{ + return GetCrsr() ? GetCrsr() : 0; +} + +SwPaM* SwXTextCursor::GetPaM() +{ + return GetCrsr() ? GetCrsr() : 0; +} + +/*-- 09.12.98 14:19:02--------------------------------------------------- + + -----------------------------------------------------------------------*/ +const SwDoc* SwXTextCursor::GetDoc()const +{ + return GetCrsr() ? GetCrsr()->GetDoc() : 0; +} +/* -----------------22.07.99 13:52------------------- + + --------------------------------------------------*/ +SwDoc* SwXTextCursor::GetDoc() +{ + return GetCrsr() ? GetCrsr()->GetDoc() : 0; +} + + /*-- 09.12.98 14:19:19--------------------------------------------------- -----------------------------------------------------------------------*/ @@ -2447,3 +2542,511 @@ void SwXTextCursor::makeRedline( else throw uno::RuntimeException(); } + +/*-- 09.12.98 14:18:58--------------------------------------------------- + + -----------------------------------------------------------------------*/ +void SAL_CALL SwXTextCursor::insertDocumentFromURL(const OUString& rURL, + const uno::Sequence< beans::PropertyValue >& rOptions) +throw (lang::IllegalArgumentException, io::IOException, + uno::RuntimeException) +{ + vos::OGuard aGuard(Application::GetSolarMutex()); + + SwUnoCrsr* pUnoCrsr = GetCrsr(); + if (!pUnoCrsr) + { + throw uno::RuntimeException(); + } + SwUnoCursorHelper::InsertFile(pUnoCrsr, rURL, rOptions); +} + +/* -----------------------------15.12.00 14:01-------------------------------- + + ---------------------------------------------------------------------------*/ +uno::Sequence< beans::PropertyValue > +SwXTextCursor::createSortDescriptor(sal_Bool bFromTable) +{ + uno::Sequence< beans::PropertyValue > aRet(5); + beans::PropertyValue* pArray = aRet.getArray(); + + uno::Any aVal; + aVal.setValue( &bFromTable, ::getCppuBooleanType()); + pArray[0] = beans::PropertyValue(C2U("IsSortInTable"), -1, aVal, + beans::PropertyState_DIRECT_VALUE); + + String sSpace(String::CreateFromAscii(" ")); + sal_Unicode uSpace = sSpace.GetChar(0); + + aVal <<= uSpace; + pArray[1] = beans::PropertyValue(C2U("Delimiter"), -1, aVal, + beans::PropertyState_DIRECT_VALUE); + + aVal <<= (sal_Bool) sal_False; + pArray[2] = beans::PropertyValue(C2U("IsSortColumns"), -1, aVal, + beans::PropertyState_DIRECT_VALUE); + + aVal <<= (sal_Int32) 3; + pArray[3] = beans::PropertyValue(C2U("MaxSortFieldsCount"), -1, aVal, + beans::PropertyState_DIRECT_VALUE); + + uno::Sequence< table::TableSortField > aFields(3); + table::TableSortField* pFields = aFields.getArray(); + + Locale aLang( SvxCreateLocale( LANGUAGE_SYSTEM ) ); + // get collator algorithm to be used for the locale + uno::Sequence< OUString > aSeq( + GetAppCollator().listCollatorAlgorithms( aLang ) ); + INT32 nLen = aSeq.getLength(); + DBG_ASSERT( nLen > 0, "list of collator algorithms is empty!"); + OUString aCollAlg; + if (nLen > 0) + aCollAlg = aSeq.getConstArray()[0]; + +#if OSL_DEBUG_LEVEL > 1 + const OUString *pTxt = aSeq.getConstArray(); + (void)pTxt; +#endif + + pFields[0].Field = 1; + pFields[0].IsAscending = sal_True; + pFields[0].IsCaseSensitive = sal_False; + pFields[0].FieldType = table::TableSortFieldType_ALPHANUMERIC; + pFields[0].CollatorLocale = aLang; + pFields[0].CollatorAlgorithm = aCollAlg; + + pFields[1].Field = 1; + pFields[1].IsAscending = sal_True; + pFields[1].IsCaseSensitive = sal_False; + pFields[1].FieldType = table::TableSortFieldType_ALPHANUMERIC; + pFields[1].CollatorLocale = aLang; + pFields[1].CollatorAlgorithm = aCollAlg; + + pFields[2].Field = 1; + pFields[2].IsAscending = sal_True; + pFields[2].IsCaseSensitive = sal_False; + pFields[2].FieldType = table::TableSortFieldType_ALPHANUMERIC; + pFields[2].CollatorLocale = aLang; + pFields[2].CollatorAlgorithm = aCollAlg; + + aVal <<= aFields; + pArray[4] = beans::PropertyValue(C2U("SortFields"), -1, aVal, + beans::PropertyState_DIRECT_VALUE); + + return aRet; +} + +/*-- 09.12.98 14:18:58--------------------------------------------------- + + -----------------------------------------------------------------------*/ +uno::Sequence< beans::PropertyValue > SAL_CALL +SwXTextCursor::createSortDescriptor() throw (uno::RuntimeException) +{ + vos::OGuard aGuard(Application::GetSolarMutex()); + return SwXTextCursor::createSortDescriptor(sal_False); +} + +/* -----------------------------15.12.00 14:06-------------------------------- + + ---------------------------------------------------------------------------*/ +sal_Bool SwXTextCursor::convertSortProperties( + const uno::Sequence< beans::PropertyValue >& rDescriptor, + SwSortOptions& rSortOpt) +{ + sal_Bool bRet = sal_True; + const beans::PropertyValue* pProperties = rDescriptor.getConstArray(); + + rSortOpt.bTable = sal_False; + rSortOpt.cDeli = ' '; + rSortOpt.eDirection = SRT_COLUMNS; //!! UI text may be contrary though !! + + SwSortKey* pKey1 = new SwSortKey; + pKey1->nColumnId = USHRT_MAX; + pKey1->bIsNumeric = TRUE; + pKey1->eSortOrder = SRT_ASCENDING; + + SwSortKey* pKey2 = new SwSortKey; + pKey2->nColumnId = USHRT_MAX; + pKey2->bIsNumeric = TRUE; + pKey2->eSortOrder = SRT_ASCENDING; + + SwSortKey* pKey3 = new SwSortKey; + pKey3->nColumnId = USHRT_MAX; + pKey3->bIsNumeric = TRUE; + pKey3->eSortOrder = SRT_ASCENDING; + SwSortKey* aKeys[3] = {pKey1, pKey2, pKey3}; + + sal_Bool bOldSortdescriptor(sal_False); + sal_Bool bNewSortdescriptor(sal_False); + + for (int n = 0; n < rDescriptor.getLength(); ++n) + { + uno::Any aValue( pProperties[n].Value ); +// String sPropName = pProperties[n].Name; + const OUString& rPropName = pProperties[n].Name; + + // old and new sortdescriptor + if (COMPARE_EQUAL == rPropName.compareToAscii("IsSortInTable")) + { + if (aValue.getValueType() == ::getBooleanCppuType()) + { + rSortOpt.bTable = *(sal_Bool*)aValue.getValue(); + } + else + { + bRet = sal_False; + } + } + else if (COMPARE_EQUAL == rPropName.compareToAscii("Delimiter")) + { + sal_Unicode uChar = sal_Unicode(); + if (aValue >>= uChar) + { + rSortOpt.cDeli = uChar; + } + else + { + bRet = sal_False; + } + } + // old sortdescriptor + else if (COMPARE_EQUAL == rPropName.compareToAscii("SortColumns")) + { + bOldSortdescriptor = sal_True; + if (aValue.getValueType() == ::getBooleanCppuType()) + { + sal_Bool bTemp = *(sal_Bool*)aValue.getValue(); + rSortOpt.eDirection = bTemp ? SRT_COLUMNS : SRT_ROWS; + } + else + { + bRet = sal_False; + } + } + else if (COMPARE_EQUAL == rPropName.compareToAscii("IsCaseSensitive")) + { + bOldSortdescriptor = sal_True; + if (aValue.getValueType() == ::getBooleanCppuType()) + { + sal_Bool bTemp = *(sal_Bool*)aValue.getValue(); + rSortOpt.bIgnoreCase = !bTemp; + } + else + { + bRet = sal_False; + } + } + else if (COMPARE_EQUAL == rPropName.compareToAscii("CollatorLocale")) + { + bOldSortdescriptor = sal_True; + Locale aLocale; + if (aValue >>= aLocale) + { + rSortOpt.nLanguage = SvxLocaleToLanguage( aLocale ); + } + else + { + bRet = sal_False; + } + } + else if (COMPARE_EQUAL == rPropName.compareToAscii("CollatorAlgorithm", + 17) && + rPropName.getLength() == 18 && + (rPropName.getStr()[17] >= '0' && rPropName.getStr()[17] <= '9')) + { + bOldSortdescriptor = sal_True; + sal_uInt16 nIndex = rPropName.getStr()[17]; + nIndex -= '0'; + OUString aTxt; + if ((aValue >>= aTxt) && nIndex < 3) + { + aKeys[nIndex]->sSortType = aTxt; + } + else + { + bRet = sal_False; + } + } + else if (COMPARE_EQUAL == rPropName.compareToAscii("SortRowOrColumnNo", + 17) && + rPropName.getLength() == 18 && + (rPropName.getStr()[17] >= '0' && rPropName.getStr()[17] <= '9')) + { + bOldSortdescriptor = sal_True; + sal_uInt16 nIndex = rPropName.getStr()[17]; + nIndex -= '0'; + sal_Int16 nCol = -1; + if (aValue.getValueType() == ::getCppuType((const sal_Int16*)0) + && nIndex < 3) + { + aValue >>= nCol; + } + if (nCol >= 0) + { + aKeys[nIndex]->nColumnId = nCol; + } + else + { + bRet = sal_False; + } + } + else if (0 == rPropName.indexOf(C2U("IsSortNumeric")) && + rPropName.getLength() == 14 && + (rPropName.getStr()[13] >= '0' && rPropName.getStr()[13] <= '9')) + { + bOldSortdescriptor = sal_True; + sal_uInt16 nIndex = rPropName.getStr()[13]; + nIndex = nIndex - '0'; + if (aValue.getValueType() == ::getBooleanCppuType() && nIndex < 3) + { + sal_Bool bTemp = *(sal_Bool*)aValue.getValue(); + aKeys[nIndex]->bIsNumeric = bTemp; + } + else + { + bRet = sal_False; + } + } + else if (0 == rPropName.indexOf(C2U("IsSortAscending")) && + rPropName.getLength() == 16 && + (rPropName.getStr()[15] >= '0' && rPropName.getStr()[15] <= '9')) + { + bOldSortdescriptor = sal_True; + sal_uInt16 nIndex = rPropName.getStr()[15]; + nIndex -= '0'; + if (aValue.getValueType() == ::getBooleanCppuType() && nIndex < 3) + { + sal_Bool bTemp = *(sal_Bool*)aValue.getValue(); + aKeys[nIndex]->eSortOrder = (bTemp) + ? SRT_ASCENDING : SRT_DESCENDING; + } + else + { + bRet = sal_False; + } + } + // new sortdescriptor + else if (COMPARE_EQUAL == rPropName.compareToAscii("IsSortColumns")) + { + bNewSortdescriptor = sal_True; + if (aValue.getValueType() == ::getBooleanCppuType()) + { + sal_Bool bTemp = *(sal_Bool*)aValue.getValue(); + rSortOpt.eDirection = bTemp ? SRT_COLUMNS : SRT_ROWS; + } + else + { + bRet = sal_False; + } + } + else if (COMPARE_EQUAL == rPropName.compareToAscii("SortFields")) + { + bNewSortdescriptor = sal_True; + uno::Sequence < table::TableSortField > aFields; + if (aValue >>= aFields) + { + sal_Int32 nCount(aFields.getLength()); + if (nCount <= 3) + { + table::TableSortField* pFields = aFields.getArray(); + for (sal_Int32 i = 0; i < nCount; ++i) + { + rSortOpt.bIgnoreCase = !pFields[i].IsCaseSensitive; + rSortOpt.nLanguage = + SvxLocaleToLanguage( pFields[i].CollatorLocale ); + aKeys[i]->sSortType = pFields[i].CollatorAlgorithm; + aKeys[i]->nColumnId = + static_cast(pFields[i].Field); + aKeys[i]->bIsNumeric = (pFields[i].FieldType == + table::TableSortFieldType_NUMERIC); + aKeys[i]->eSortOrder = (pFields[i].IsAscending) + ? SRT_ASCENDING : SRT_DESCENDING; + } + } + else + { + bRet = sal_False; + } + } + else + { + bRet = sal_False; + } + } + } + + if (bNewSortdescriptor && bOldSortdescriptor) + { + DBG_ERROR("someone tried to set the old deprecated and " + "the new sortdescriptor"); + bRet = sal_False; + } + + if (pKey1->nColumnId != USHRT_MAX) + { + rSortOpt.aKeys.C40_INSERT(SwSortKey, pKey1, rSortOpt.aKeys.Count()); + } + if (pKey2->nColumnId != USHRT_MAX) + { + rSortOpt.aKeys.C40_INSERT(SwSortKey, pKey2, rSortOpt.aKeys.Count()); + } + if (pKey3->nColumnId != USHRT_MAX) + { + rSortOpt.aKeys.C40_INSERT(SwSortKey, pKey3, rSortOpt.aKeys.Count()); + } + + return bRet && rSortOpt.aKeys.Count() > 0; +} + +/*-- 09.12.98 14:19:00--------------------------------------------------- + + -----------------------------------------------------------------------*/ +void SAL_CALL +SwXTextCursor::sort(const uno::Sequence< beans::PropertyValue >& rDescriptor) +throw (uno::RuntimeException) +{ + vos::OGuard aGuard(Application::GetSolarMutex()); + + SwSortOptions aSortOpt; + SwUnoCrsr* pUnoCrsr = GetCrsr(); + + if (!pUnoCrsr) + { + throw uno::RuntimeException(); + } + + if (pUnoCrsr->HasMark()) + { + if (!SwXTextCursor::convertSortProperties(rDescriptor, aSortOpt)) + { + throw uno::RuntimeException(); + } + UnoActionContext aContext( pUnoCrsr->GetDoc() ); + + SwPosition* pStart = pUnoCrsr->Start(); + SwPosition* pEnd = pUnoCrsr->End(); + + SwNodeIndex aPrevIdx( pStart->nNode, -1 ); + ULONG nOffset = pEnd->nNode.GetIndex() - pStart->nNode.GetIndex(); + xub_StrLen nCntStt = pStart->nContent.GetIndex(); + + pUnoCrsr->GetDoc()->SortText(*pUnoCrsr, aSortOpt); + + // Selektion wieder setzen + pUnoCrsr->DeleteMark(); + pUnoCrsr->GetPoint()->nNode.Assign( aPrevIdx.GetNode(), +1 ); + SwCntntNode* pCNd = pUnoCrsr->GetCntntNode(); + xub_StrLen nLen = pCNd->Len(); + if (nLen > nCntStt) + { + nLen = nCntStt; + } + pUnoCrsr->GetPoint()->nContent.Assign(pCNd, nLen ); + pUnoCrsr->SetMark(); + + pUnoCrsr->GetPoint()->nNode += nOffset; + pCNd = pUnoCrsr->GetCntntNode(); + pUnoCrsr->GetPoint()->nContent.Assign( pCNd, pCNd->Len() ); + } +} + +/* -----------------------------03.04.00 09:11-------------------------------- + + ---------------------------------------------------------------------------*/ +uno::Reference< container::XEnumeration > SAL_CALL +SwXTextCursor::createContentEnumeration(const OUString& rServiceName) +throw (uno::RuntimeException) +{ + SwUnoCrsr* pUnoCrsr = GetCrsr(); + if (!pUnoCrsr || + 0 != rServiceName.compareToAscii("com.sun.star.text.TextContent")) + { + throw uno::RuntimeException(); + } + + uno::Reference< container::XEnumeration > xRet = + new SwXParaFrameEnumeration(*pUnoCrsr, PARAFRAME_PORTION_TEXTRANGE); + return xRet; +} + +/* -----------------------------07.03.01 14:53-------------------------------- + + ---------------------------------------------------------------------------*/ +uno::Reference< container::XEnumeration > SAL_CALL +SwXTextCursor::createEnumeration() throw (uno::RuntimeException) +{ + SwUnoCrsr* pUnoCrsr = GetCrsr(); + if (!pUnoCrsr) + { + throw uno::RuntimeException(); + } + uno::Reference xTunnel(xParentText, UNO_QUERY); + SwXText* pParentText = 0; + if (xTunnel.is()) + { + pParentText = reinterpret_cast< SwXText *>( + sal::static_int_cast< sal_IntPtr >( + xTunnel->getSomething(SwXText::getUnoTunnelId()) )); + } + DBG_ASSERT(pParentText, "parent is not a SwXText"); + if (!pParentText) + { + throw uno::RuntimeException(); + } + + ::std::auto_ptr pNewCrsr( + pUnoCrsr->GetDoc()->CreateUnoCrsr(*pUnoCrsr->GetPoint()) ); + if (pUnoCrsr->HasMark()) + { + pNewCrsr->SetMark(); + *pNewCrsr->GetMark() = *pUnoCrsr->GetMark(); + } + const CursorType eSetType = (CURSOR_TBLTEXT == eType) + ? CURSOR_SELECTION_IN_TABLE : CURSOR_SELECTION; + const uno::Reference< XEnumeration > xRet = + new SwXParagraphEnumeration(pParentText, pNewCrsr, eSetType); + + return xRet; +} + +/* -----------------------------07.03.01 15:43-------------------------------- + + ---------------------------------------------------------------------------*/ +uno::Type SAL_CALL +SwXTextCursor::getElementType() throw (uno::RuntimeException) +{ + return ::getCppuType((uno::Reference*)0); +} + +/* -----------------------------07.03.01 15:43-------------------------------- + + ---------------------------------------------------------------------------*/ +sal_Bool SAL_CALL SwXTextCursor::hasElements() throw (uno::RuntimeException) +{ + return sal_True; +} + +/* -----------------------------03.04.00 09:11-------------------------------- + + ---------------------------------------------------------------------------*/ +uno::Sequence< OUString > SAL_CALL +SwXTextCursor::getAvailableServiceNames() throw (uno::RuntimeException) +{ + uno::Sequence< OUString > aRet(1); + OUString* pArray = aRet.getArray(); + pArray[0] = OUString::createFromAscii("com.sun.star.text.TextContent"); + return aRet; +} + +// --------------------------------------------------------------------------- +IMPLEMENT_FORWARD_REFCOUNT( SwXTextCursor,SwXTextCursor_Base ) + +uno::Any SAL_CALL +SwXTextCursor::queryInterface(const uno::Type& rType) +throw (uno::RuntimeException) +{ + return (rType == lang::XUnoTunnel::static_type()) + ? OTextCursorHelper::queryInterface(rType) + : SwXTextCursor_Base::queryInterface(rType); +} + diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index 1f53b5130e51..a71fe16f7024 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -94,7 +94,6 @@ #include #include #include -#include #include #include #include @@ -106,8 +105,6 @@ #include #include #include -#include -#include #include #include #include @@ -336,342 +333,6 @@ UnoActionRemoveContext::~UnoActionRemoveContext() } -/*-- 09.12.98 14:18:58--------------------------------------------------- - - -----------------------------------------------------------------------*/ -void SwXTextCursor::insertDocumentFromURL(const OUString& rURL, - const uno::Sequence< beans::PropertyValue >& rOptions) - throw( lang::IllegalArgumentException, io::IOException, uno::RuntimeException ) -{ - vos::OGuard aGuard(Application::GetSolarMutex()); - SwUnoCrsr* pUnoCrsr = GetCrsr(); - if(pUnoCrsr) - { - SwUnoCursorHelper::InsertFile(pUnoCrsr, rURL, rOptions); - } - else - throw uno::RuntimeException(); -} -/* -----------------------------15.12.00 14:01-------------------------------- - - ---------------------------------------------------------------------------*/ -uno::Sequence< beans::PropertyValue > SwXTextCursor::createSortDescriptor(sal_Bool bFromTable) -{ - uno::Sequence< beans::PropertyValue > aRet(5); - beans::PropertyValue* pArray = aRet.getArray(); - - uno::Any aVal; - aVal.setValue( &bFromTable, ::getCppuBooleanType()); - pArray[0] = beans::PropertyValue(C2U("IsSortInTable"), -1, aVal, beans::PropertyState_DIRECT_VALUE); - - String sSpace(String::CreateFromAscii(" ")); - sal_Unicode uSpace = sSpace.GetChar(0); - - aVal <<= uSpace; - pArray[1] = beans::PropertyValue(C2U("Delimiter"), -1, aVal, beans::PropertyState_DIRECT_VALUE); - - aVal <<= (sal_Bool) sal_False; - pArray[2] = beans::PropertyValue(C2U("IsSortColumns"), -1, aVal, beans::PropertyState_DIRECT_VALUE); - - aVal <<= (sal_Int32) 3; - pArray[3] = beans::PropertyValue(C2U("MaxSortFieldsCount"), -1, aVal, beans::PropertyState_DIRECT_VALUE); - - uno::Sequence< table::TableSortField > aFields(3); - table::TableSortField* pFields = aFields.getArray(); - - Locale aLang( SvxCreateLocale( LANGUAGE_SYSTEM ) ); - // get collator algorithm to be used for the locale - Sequence < OUString > aSeq( GetAppCollator().listCollatorAlgorithms( aLang ) ); - INT32 nLen = aSeq.getLength(); - DBG_ASSERT( nLen > 0, "list of collator algorithms is empty!"); - OUString aCollAlg; - if (nLen > 0) - aCollAlg = aSeq.getConstArray()[0]; - -#if OSL_DEBUG_LEVEL > 1 - const OUString *pTxt = aSeq.getConstArray(); - (void)pTxt; -#endif - - pFields[0].Field = 1; - pFields[0].IsAscending = sal_True; - pFields[0].IsCaseSensitive = sal_False; - pFields[0].FieldType = table::TableSortFieldType_ALPHANUMERIC; - pFields[0].CollatorLocale = aLang; - pFields[0].CollatorAlgorithm = aCollAlg; - - pFields[1].Field = 1; - pFields[1].IsAscending = sal_True; - pFields[1].IsCaseSensitive = sal_False; - pFields[1].FieldType = table::TableSortFieldType_ALPHANUMERIC; - pFields[1].CollatorLocale = aLang; - pFields[1].CollatorAlgorithm = aCollAlg; - - pFields[2].Field = 1; - pFields[2].IsAscending = sal_True; - pFields[2].IsCaseSensitive = sal_False; - pFields[2].FieldType = table::TableSortFieldType_ALPHANUMERIC; - pFields[2].CollatorLocale = aLang; - pFields[2].CollatorAlgorithm = aCollAlg; - - aVal <<= aFields; - pArray[4] = beans::PropertyValue(C2U("SortFields"), -1, aVal, beans::PropertyState_DIRECT_VALUE); - - return aRet; -} - -/*-- 09.12.98 14:18:58--------------------------------------------------- - - -----------------------------------------------------------------------*/ -uno::Sequence< beans::PropertyValue > SwXTextCursor::createSortDescriptor(void) throw( uno::RuntimeException ) -{ - vos::OGuard aGuard(Application::GetSolarMutex()); - return SwXTextCursor::createSortDescriptor(sal_False); -} -/* -----------------------------15.12.00 14:06-------------------------------- - - ---------------------------------------------------------------------------*/ -sal_Bool SwXTextCursor::convertSortProperties( - const uno::Sequence< beans::PropertyValue >& rDescriptor, SwSortOptions& rSortOpt) -{ - sal_Bool bRet = sal_True; - const beans::PropertyValue* pProperties = rDescriptor.getConstArray(); - - rSortOpt.bTable = sal_False; - rSortOpt.cDeli = ' '; - rSortOpt.eDirection = SRT_COLUMNS; //!! UI text may be contrary though !! - - SwSortKey* pKey1 = new SwSortKey; - pKey1->nColumnId = USHRT_MAX; - pKey1->bIsNumeric = TRUE; - pKey1->eSortOrder = SRT_ASCENDING; - - SwSortKey* pKey2 = new SwSortKey; - pKey2->nColumnId = USHRT_MAX; - pKey2->bIsNumeric = TRUE; - pKey2->eSortOrder = SRT_ASCENDING; - - SwSortKey* pKey3 = new SwSortKey; - pKey3->nColumnId = USHRT_MAX; - pKey3->bIsNumeric = TRUE; - pKey3->eSortOrder = SRT_ASCENDING; - SwSortKey* aKeys[3] = {pKey1, pKey2, pKey3}; - - sal_Bool bOldSortdescriptor(sal_False); - sal_Bool bNewSortdescriptor(sal_False); - - for( int n = 0; n < rDescriptor.getLength(); ++n ) - { - uno::Any aValue( pProperties[n].Value ); -// String sPropName = pProperties[n].Name; - const OUString& rPropName = pProperties[n].Name; - - // old and new sortdescriptor - if( COMPARE_EQUAL == rPropName.compareToAscii("IsSortInTable")) - { - if ( aValue.getValueType() == ::getBooleanCppuType() ) - rSortOpt.bTable = *(sal_Bool*)aValue.getValue(); - else - bRet = sal_False; - } - else if(COMPARE_EQUAL == rPropName.compareToAscii("Delimiter")) - { - sal_Unicode uChar = sal_Unicode(); - if( aValue >>= uChar ) - rSortOpt.cDeli = uChar; - else - bRet = sal_False; - } - // old sortdescriptor - else if(COMPARE_EQUAL == rPropName.compareToAscii("SortColumns")) - { - bOldSortdescriptor = sal_True; - if ( aValue.getValueType() == ::getBooleanCppuType() ) - { - sal_Bool bTemp = *(sal_Bool*)aValue.getValue(); - rSortOpt.eDirection = bTemp ? SRT_COLUMNS : SRT_ROWS; - } - else - bRet = sal_False; - } - else if(COMPARE_EQUAL == rPropName.compareToAscii("IsCaseSensitive")) - { - bOldSortdescriptor = sal_True; - if ( aValue.getValueType() == ::getBooleanCppuType() ) - { - sal_Bool bTemp = *(sal_Bool*)aValue.getValue(); - rSortOpt.bIgnoreCase = !bTemp; - } - else - bRet = sal_False; - } - else if(COMPARE_EQUAL == rPropName.compareToAscii("CollatorLocale")) - { - bOldSortdescriptor = sal_True; - Locale aLocale; - if (aValue >>= aLocale) - rSortOpt.nLanguage = SvxLocaleToLanguage( aLocale ); - else - bRet = sal_False; - } - else if(COMPARE_EQUAL == rPropName.compareToAscii("CollatorAlgorithm", 17) && - rPropName.getLength() == 18 && - (rPropName.getStr()[17] >= '0' && rPropName.getStr()[17] <= '9')) - { - bOldSortdescriptor = sal_True; - sal_uInt16 nIndex = rPropName.getStr()[17]; - nIndex -= '0'; - OUString aTxt; - if ((aValue >>= aTxt) && nIndex < 3) - aKeys[nIndex]->sSortType = aTxt; - else - bRet = sal_False; - } - else if(COMPARE_EQUAL == rPropName.compareToAscii("SortRowOrColumnNo", 17) && - rPropName.getLength() == 18 && - (rPropName.getStr()[17] >= '0' && rPropName.getStr()[17] <= '9')) - { - bOldSortdescriptor = sal_True; - sal_uInt16 nIndex = rPropName.getStr()[17]; - nIndex -= '0'; - sal_Int16 nCol = -1; - if( aValue.getValueType() == ::getCppuType((const sal_Int16*)0) && nIndex < 3) - aValue >>= nCol; - if( nCol >= 0 ) - aKeys[nIndex]->nColumnId = nCol; - else - bRet = sal_False; - } - else if(0 == rPropName.indexOf(C2U("IsSortNumeric")) && - rPropName.getLength() == 14 && - (rPropName.getStr()[13] >= '0' && rPropName.getStr()[13] <= '9')) - { - bOldSortdescriptor = sal_True; - sal_uInt16 nIndex = rPropName.getStr()[13]; - nIndex = nIndex - '0'; - if ( aValue.getValueType() == ::getBooleanCppuType() && nIndex < 3 ) - { - sal_Bool bTemp = *(sal_Bool*)aValue.getValue(); - aKeys[nIndex]->bIsNumeric = bTemp; - } - else - bRet = sal_False; - } - else if(0 == rPropName.indexOf(C2U("IsSortAscending")) && - rPropName.getLength() == 16 && - (rPropName.getStr()[15] >= '0' && rPropName.getStr()[15] <= '9')) - { - bOldSortdescriptor = sal_True; - sal_uInt16 nIndex = rPropName.getStr()[15]; - nIndex -= '0'; - if ( aValue.getValueType() == ::getBooleanCppuType() && nIndex < 3 ) - { - sal_Bool bTemp = *(sal_Bool*)aValue.getValue(); - aKeys[nIndex]->eSortOrder = bTemp ? SRT_ASCENDING : SRT_DESCENDING; - } - else - bRet = sal_False; - } - // new sortdescriptor - else if(COMPARE_EQUAL == rPropName.compareToAscii("IsSortColumns")) - { - bNewSortdescriptor = sal_True; - if ( aValue.getValueType() == ::getBooleanCppuType() ) - { - sal_Bool bTemp = *(sal_Bool*)aValue.getValue(); - rSortOpt.eDirection = bTemp ? SRT_COLUMNS : SRT_ROWS; - } - else - bRet = sal_False; - } - else if (COMPARE_EQUAL == rPropName.compareToAscii("SortFields")) - { - bNewSortdescriptor = sal_True; - uno::Sequence < table::TableSortField > aFields; - if ( aValue >>= aFields ) - { - sal_Int32 nCount(aFields.getLength()); - if (nCount <= 3) - { - table::TableSortField* pFields = aFields.getArray(); - for (sal_Int32 i = 0; i < nCount; ++i) - { - rSortOpt.bIgnoreCase = !pFields[i].IsCaseSensitive; - rSortOpt.nLanguage = SvxLocaleToLanguage( pFields[i].CollatorLocale ); - aKeys[i]->sSortType = pFields[i].CollatorAlgorithm; - aKeys[i]->nColumnId = static_cast< USHORT >(pFields[i].Field); - aKeys[i]->bIsNumeric = (pFields[i].FieldType == table::TableSortFieldType_NUMERIC); - aKeys[i]->eSortOrder = pFields[i].IsAscending ? SRT_ASCENDING : SRT_DESCENDING; - } - } - else - bRet = sal_False; - } - else - bRet = sal_False; - } - } - - if (bNewSortdescriptor && bOldSortdescriptor) - { - DBG_ERROR("someone tried to set the old deprecated and the new sortdescriptor"); - bRet = sal_False; - } - - if(pKey1->nColumnId != USHRT_MAX) - rSortOpt.aKeys.C40_INSERT(SwSortKey, pKey1, rSortOpt.aKeys.Count()); - if(pKey2->nColumnId != USHRT_MAX) - rSortOpt.aKeys.C40_INSERT(SwSortKey, pKey2, rSortOpt.aKeys.Count()); - if(pKey3->nColumnId != USHRT_MAX) - rSortOpt.aKeys.C40_INSERT(SwSortKey, pKey3, rSortOpt.aKeys.Count()); - - return bRet && rSortOpt.aKeys.Count() > 0; -} -/*-- 09.12.98 14:19:00--------------------------------------------------- - - -----------------------------------------------------------------------*/ -void SwXTextCursor::sort(const uno::Sequence< beans::PropertyValue >& rDescriptor) - throw( uno::RuntimeException ) -{ - vos::OGuard aGuard(Application::GetSolarMutex()); - SwSortOptions aSortOpt; - SwUnoCrsr* pUnoCrsr = GetCrsr(); - - if(pUnoCrsr) - { - if(pUnoCrsr->HasMark()) - { - if(!SwXTextCursor::convertSortProperties(rDescriptor, aSortOpt)) - throw uno::RuntimeException(); - UnoActionContext aContext( pUnoCrsr->GetDoc() ); - - SwPosition* pStart = pUnoCrsr->Start(); - SwPosition* pEnd = pUnoCrsr->End(); - - SwNodeIndex aPrevIdx( pStart->nNode, -1 ); - ULONG nOffset = pEnd->nNode.GetIndex() - pStart->nNode.GetIndex(); - xub_StrLen nCntStt = pStart->nContent.GetIndex(); - - pUnoCrsr->GetDoc()->SortText(*pUnoCrsr, aSortOpt); - - // Selektion wieder setzen - pUnoCrsr->DeleteMark(); - pUnoCrsr->GetPoint()->nNode.Assign( aPrevIdx.GetNode(), +1 ); - SwCntntNode* pCNd = pUnoCrsr->GetCntntNode(); - xub_StrLen nLen = pCNd->Len(); - if( nLen > nCntStt ) - nLen = nCntStt; - pUnoCrsr->GetPoint()->nContent.Assign(pCNd, nLen ); - pUnoCrsr->SetMark(); - - pUnoCrsr->GetPoint()->nNode += nOffset; - pCNd = pUnoCrsr->GetCntntNode(); - pUnoCrsr->GetPoint()->nContent.Assign( pCNd, pCNd->Len() ); - } - } - else - throw uno::RuntimeException(); -} /*-- 10.12.98 11:52:15--------------------------------------------------- -----------------------------------------------------------------------*/ @@ -694,166 +355,6 @@ void ClientModify(SwClient* pClient, SfxPoolItem *pOld, SfxPoolItem *pNew) } } -/* -----------------------------03.04.00 09:11-------------------------------- - - ---------------------------------------------------------------------------*/ -uno::Reference< XEnumeration > SAL_CALL SwXTextCursor::createContentEnumeration(const OUString& rServiceName) throw( RuntimeException ) -{ - SwUnoCrsr* pUnoCrsr = GetCrsr(); - if( !pUnoCrsr || 0 != rServiceName.compareToAscii("com.sun.star.text.TextContent") ) - throw RuntimeException(); - - uno::Reference< XEnumeration > xRet = new SwXParaFrameEnumeration(*pUnoCrsr, PARAFRAME_PORTION_TEXTRANGE); - return xRet; -} -/* -----------------------------07.03.01 14:53-------------------------------- - - ---------------------------------------------------------------------------*/ -uno::Reference< XEnumeration > SwXTextCursor::createEnumeration(void) throw( RuntimeException ) -{ - SwUnoCrsr* pUnoCrsr = GetCrsr(); - if( !pUnoCrsr ) - throw RuntimeException(); - uno::Reference xTunnel(xParentText, UNO_QUERY); - SwXText* pParentText = 0; - if(xTunnel.is()) - { - pParentText = reinterpret_cast< SwXText *>( - sal::static_int_cast< sal_IntPtr >( xTunnel->getSomething(SwXText::getUnoTunnelId()) )); - } - DBG_ASSERT(pParentText, "parent is not a SwXText"); - if (!pParentText) - { - throw uno::RuntimeException(); - } - - ::std::auto_ptr pNewCrsr( - pUnoCrsr->GetDoc()->CreateUnoCrsr(*pUnoCrsr->GetPoint()) ); - if(pUnoCrsr->HasMark()) - { - pNewCrsr->SetMark(); - *pNewCrsr->GetMark() = *pUnoCrsr->GetMark(); - } - const CursorType eSetType = (CURSOR_TBLTEXT == eType) - ? CURSOR_SELECTION_IN_TABLE : CURSOR_SELECTION; - const uno::Reference< XEnumeration > xRet = - new SwXParagraphEnumeration(pParentText, pNewCrsr, eSetType); - - return xRet; -} -/* -----------------------------07.03.01 15:43-------------------------------- - - ---------------------------------------------------------------------------*/ -uno::Type SwXTextCursor::getElementType(void) throw( RuntimeException ) -{ - return ::getCppuType((uno::Reference*)0); -} -/* -----------------------------07.03.01 15:43-------------------------------- - - ---------------------------------------------------------------------------*/ -sal_Bool SwXTextCursor::hasElements(void) throw( RuntimeException ) -{ - return sal_True; -} -/* -----------------------------03.04.00 09:11-------------------------------- - - ---------------------------------------------------------------------------*/ -Sequence< OUString > SAL_CALL SwXTextCursor::getAvailableServiceNames(void) throw( RuntimeException ) -{ - Sequence< OUString > aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = OUString::createFromAscii("com.sun.star.text.TextContent"); - return aRet; -} -/*-- 09.12.98 14:19:00--------------------------------------------------- - - -----------------------------------------------------------------------*/ - -IMPL_STATIC_LINK( SwXTextCursor, RemoveCursor_Impl, - uno::Reference< XInterface >*, EMPTYARG ) -{ - ASSERT( pThis != NULL, "no reference?" ); - //ASSERT( pArg != NULL, "no reference?" ); - - // --> FME 2006-03-07 #126177# Tell the SwXTextCursor that the user event - // has been executed. It is not necessary to remove the user event in - // ~SwXTextCursor - pThis->DoNotRemoveUserEvent(); - // <-- - - SwUnoCrsr* pCursor = pThis->GetCrsr(); - if( pCursor != NULL ) - { - pCursor->Remove( pThis ); - delete pCursor; - } - - // --> FME 2006-03-07 #126177# - //delete pArg; - // <-- - - return 0; -} - -void SwXTextCursor::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) -{ - ClientModify(this, pOld, pNew); - - // if the cursor leaves its designated section, it becomes invalid - if( !mbRemoveUserEvent && ( pOld != NULL ) && ( pOld->Which() == RES_UNOCURSOR_LEAVES_SECTION ) ) - { - // --> FME 2006-03-07 #126177# We don't need to create a reference - // to the SwXTextCursor to prevent its deletion. If the destructor - // of the SwXTextCursor is called before the user event is executed, - // the user event will be removed. This is necessary, because an other - // thread might be currently waiting in ~SwXTextCursor. In this case - // the pRef = new ... stuff did not work! - - // create reference to this object to prevent deletion before - // the STATIC_LINK is executed. The link will delete the - // reference. - //uno::Reference* pRef = - //new uno::Reference( static_cast( this ) ); - - mbRemoveUserEvent = true; - // <-- - - mnUserEventId = Application::PostUserEvent( - STATIC_LINK( this, SwXTextCursor, RemoveCursor_Impl ), this ); - } - - if(!GetRegisteredIn()) - aLstnrCntnr.Disposing(); - -} -/*-- 09.12.98 14:19:01--------------------------------------------------- - - -----------------------------------------------------------------------*/ -const SwPaM* SwXTextCursor::GetPaM() const -{ - return GetCrsr() ? GetCrsr() : 0; -} -// ----------------------------------------------------------------------------- -SwPaM* SwXTextCursor::GetPaM() -{ - return GetCrsr() ? GetCrsr() : 0; -} - -/*-- 09.12.98 14:19:02--------------------------------------------------- - - -----------------------------------------------------------------------*/ -const SwDoc* SwXTextCursor::GetDoc()const -{ - return GetCrsr() ? GetCrsr()->GetDoc() : 0; -} -/* -----------------22.07.99 13:52------------------- - - --------------------------------------------------*/ -SwDoc* SwXTextCursor::GetDoc() -{ - return GetCrsr() ? GetCrsr()->GetDoc() : 0; -} - /*-- 09.12.98 14:19:03--------------------------------------------------- @@ -2638,16 +2139,3 @@ throw (uno::RuntimeException) g_nServicesParaFrameEnum, g_ServicesParaFrameEnum); } - -// ----------------------------------------------------------------------------- -IMPLEMENT_FORWARD_REFCOUNT( SwXTextCursor,SwXTextCursor_Base ) - -uno::Any SAL_CALL SwXTextCursor::queryInterface( const uno::Type& _rType ) throw (uno::RuntimeException) -{ - if( _rType == ::getCppuType( (uno::Reference*)0) ) - return OTextCursorHelper::queryInterface( _rType ); - else - return SwXTextCursor_Base::queryInterface( _rType ); -} - - -- cgit v1.2.3 From aa16ebadc706825e9884378ba41b311eaad069b9 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:54 +0100 Subject: swunolocking1: #i105557#: SwXTextCursor: move enum SwGetPropertyStatesCaller to unocrsrhelper.hxx. move static methods of SwXTextCursor to namespace SwUnoCursorHelper. move various not-actually-local functions with declarations in multiple cxx files to namespace SwUnoCursorHelper. clean up the implementation a little. --- sw/inc/unocrsrhelper.hxx | 111 +++- sw/inc/unotextcursor.hxx | 84 --- sw/source/core/access/accpara.cxx | 4 +- sw/source/core/edit/editsh.cxx | 4 +- sw/source/core/unocore/SwXTextDefaults.cxx | 11 +- sw/source/core/unocore/unocrsrhelper.cxx | 12 +- sw/source/core/unocore/unoobj.cxx | 991 +++++++++++++++++------------ sw/source/core/unocore/unoobj2.cxx | 168 +++-- sw/source/core/unocore/unoparagraph.cxx | 17 +- sw/source/core/unocore/unoport.cxx | 23 +- sw/source/core/unocore/unoportenum.cxx | 4 +- sw/source/core/unocore/unosect.cxx | 2 +- sw/source/core/unocore/unotbl.cxx | 59 +- sw/source/core/unocore/unotext.cxx | 22 +- sw/source/ui/uno/unotxvw.cxx | 31 +- 15 files changed, 862 insertions(+), 681 deletions(-) diff --git a/sw/inc/unocrsrhelper.hxx b/sw/inc/unocrsrhelper.hxx index 613a5e51eb89..b7e92df88b30 100644 --- a/sw/inc/unocrsrhelper.hxx +++ b/sw/inc/unocrsrhelper.hxx @@ -30,12 +30,25 @@ #ifndef _UNOCRSRHELPER_HXX #define _UNOCRSRHELPER_HXX -#include -#include #include +#include +#include + +#include +#include + + +class String; +class SfxItemSet; +class SfxItemPropertySet; struct SfxItemPropertySimpleEntry; +class SwTxtNode; class SwPaM; +class SwCursor; +class SwUnoCrsr; +class SwFmtColl; +struct SwSortOptions; class SwDoc; namespace com{ namespace sun{ namespace star{ @@ -47,6 +60,17 @@ namespace com{ namespace sun{ namespace star{ } }}} +/* -----------------03.12.98 12:16------------------- + * + * --------------------------------------------------*/ +enum SwGetPropertyStatesCaller +{ + SW_PROPERTY_STATE_CALLER_DEFAULT, + SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION, + SW_PROPERTY_STATE_CALLER_SINGLE_VALUE_ONLY, + SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION_TOLERANT +}; + /* -----------------------------14.12.00 15:06-------------------------------- ---------------------------------------------------------------------------*/ @@ -62,6 +86,7 @@ namespace SwUnoCursorHelper void SetValue( USHORT nWhichId, USHORT nMemberId, const com::sun::star::uno::Any& rAny ); bool FillValue( USHORT nWhichId, USHORT nMemberId, const com::sun::star::uno::Any*& pAny ); }; + sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry , SwPaM& rPam , com::sun::star::uno::Any *pAny @@ -102,6 +127,88 @@ namespace SwUnoCursorHelper const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& RedlineProperties ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + + /// @param bTableMode: attributes should be applied to a table selection + void SetCrsrAttr(SwPaM & rPam, const SfxItemSet & rSet, + const SetAttrMode nAttrMode, + const bool bTableMode = false); + void GetCrsrAttr(SwPaM & rPam, SfxItemSet & rSet, + const bool bOnlyTxtAttr = false, + const bool bGetFromChrFmt = true); + void GetTextFromPam(SwPaM & rPam, ::rtl::OUString & rBuffer); + SwFmtColl * GetCurTxtFmtColl(SwPaM & rPam, const bool bConditional); + + void SelectPam(SwPaM & rPam, const bool bExpand); + void SetString(SwCursor & rCursor, const ::rtl::OUString & rString); + + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > + CreateSortDescriptor(const bool bFromTable); + sal_Bool ConvertSortProperties( + const ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyValue >& rDescriptor, + SwSortOptions & rSortOpt); + + /// @param bTableMode: attributes should be applied to a table selection + void SetPropertyValue( + SwPaM& rPaM, + const SfxItemPropertySet & rPropSet, + const ::rtl::OUString & rPropertyName, + const ::com::sun::star::uno::Any & rValue, + const SetAttrMode nAttrMode = nsSetAttrMode::SETATTR_DEFAULT, + const bool bTableMode = false) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::beans::PropertyVetoException, + ::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Any GetPropertyValue( + SwPaM& rPaM, + const SfxItemPropertySet & rPropSet, + const ::rtl::OUString & rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< + ::com::sun::star::beans::PropertyState > GetPropertyStates( + SwPaM & rPaM, + const SfxItemPropertySet & rPropSet, + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& + rPropertyNames, + const SwGetPropertyStatesCaller eCaller = + SW_PROPERTY_STATE_CALLER_DEFAULT) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + ::com::sun::star::beans::PropertyState GetPropertyState( + SwPaM & rPaM, + const SfxItemPropertySet & rPropSet, + const ::rtl::OUString & rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + void SetPropertyToDefault( + SwPaM & rPaM, + const SfxItemPropertySet & rPropSet, + const ::rtl::OUString & rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Any GetPropertyDefault( + SwPaM & rPaM, + const SfxItemPropertySet & rPropSet, + const ::rtl::OUString & rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + bool SetPageDesc( + const ::com::sun::star::uno::Any& rValue, + SwDoc & rDoc, SfxItemSet & rSet); + void SetTxtFmtColl(const ::com::sun::star::uno::Any & rAny, SwPaM & rPaM) + throw (::com::sun::star::lang::IllegalArgumentException); + bool SetCursorPropertyValue( + SfxItemPropertySimpleEntry const& rEntry, + ::com::sun::star::uno::Any const& rValue, + SwPaM & rPam, SfxItemSet & rItemSet) + throw (::com::sun::star::lang::IllegalArgumentException); + } // namespace SwUnoCursorHelper #endif diff --git a/sw/inc/unotextcursor.hxx b/sw/inc/unotextcursor.hxx index ce91bd295267..fe9b2602180f 100644 --- a/sw/inc/unotextcursor.hxx +++ b/sw/inc/unotextcursor.hxx @@ -58,32 +58,13 @@ #include -class SfxItemSet; class SfxItemPropertySet; class SwDoc; struct SwPosition; -class SwCursor; class SwUnoCrsr; -class SwFmtColl; struct SwSortOptions; -/* -----------------03.12.98 12:16------------------- - * - * --------------------------------------------------*/ -enum SwGetPropertyStatesCaller -{ - SW_PROPERTY_STATE_CALLER_DEFAULT, - SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION, - SW_PROPERTY_STATE_CALLER_SINGLE_VALUE_ONLY, - SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION_TOLERANT -}; - -/// attributes should be applied to a table selection -#define CRSR_ATTR_MODE_TABLE 1 -/// attributes should be added, not replaced -#define CRSR_ATTR_MODE_DONTREPLACE 2 - typedef ::cppu::WeakImplHelper12 < ::com::sun::star::lang::XServiceInfo , ::com::sun::star::beans::XPropertySet @@ -152,71 +133,6 @@ public: void DeleteAndInsert(const String& rText, const bool bForceExpandHints); - static void SetCrsrAttr(SwPaM& rPam, const SfxItemSet& rSet, - USHORT nAttrMode); - static void GetCrsrAttr( SwPaM& rPam, SfxItemSet& rSet, - BOOL bOnlyTxtAttr = FALSE, BOOL bGetFromChrFmt = TRUE ); - static void getTextFromPam(SwPaM& aCrsr, ::rtl::OUString& rBuffer); - static SwFmtColl* GetCurTxtFmtColl(SwPaM& rPam, BOOL bConditional); - - static void SelectPam(SwPaM& rCrsr, sal_Bool bExpand); - static void SetString(SwCursor& rCrsr, const ::rtl::OUString& rString); - - static ::com::sun::star::uno::Sequence< - ::com::sun::star::beans::PropertyValue > - createSortDescriptor(sal_Bool bFromTable); - static sal_Bool convertSortProperties( - const ::com::sun::star::uno::Sequence< - ::com::sun::star::beans::PropertyValue >& rDescriptor, - SwSortOptions& rSortOpt); - - static void SetPropertyValue( - SwPaM& rPaM, - const SfxItemPropertySet& rPropSet, - const ::rtl::OUString& rPropertyName, - const ::com::sun::star::uno::Any& aValue, - USHORT nAttrMode = 0) - throw (::com::sun::star::beans::UnknownPropertyException, - ::com::sun::star::beans::PropertyVetoException, - ::com::sun::star::lang::IllegalArgumentException, - ::com::sun::star::lang::WrappedTargetException, - ::com::sun::star::uno::RuntimeException); - static ::com::sun::star::uno::Any GetPropertyValue( - SwPaM& rPaM, - const SfxItemPropertySet& rPropSet, - const ::rtl::OUString& rPropertyName) - throw (::com::sun::star::beans::UnknownPropertyException, - ::com::sun::star::lang::WrappedTargetException, - ::com::sun::star::uno::RuntimeException); - static ::com::sun::star::uno::Sequence< - ::com::sun::star::beans::PropertyState > GetPropertyStates( - SwPaM& rPaM, - const SfxItemPropertySet& rPropSet, - const ::com::sun::star::uno::Sequence< ::rtl::OUString >& - rPropertyNames, - SwGetPropertyStatesCaller eCaller=SW_PROPERTY_STATE_CALLER_DEFAULT) - throw (::com::sun::star::beans::UnknownPropertyException, - ::com::sun::star::uno::RuntimeException); - static ::com::sun::star::beans::PropertyState GetPropertyState( - SwPaM& rPaM, - const SfxItemPropertySet& rPropSet, - const ::rtl::OUString& rPropertyName) - throw (::com::sun::star::beans::UnknownPropertyException, - ::com::sun::star::uno::RuntimeException); - static void SetPropertyToDefault( - SwPaM& rPaM, - const SfxItemPropertySet& rPropSet, - const ::rtl::OUString& rPropertyName) - throw (::com::sun::star::beans::UnknownPropertyException, - ::com::sun::star::uno::RuntimeException); - static ::com::sun::star::uno::Any GetPropertyDefault( - SwPaM& rPaM, - const SfxItemPropertySet& rPropSet, - const ::rtl::OUString& rPropertyName) - throw (::com::sun::star::beans::UnknownPropertyException, - ::com::sun::star::lang::WrappedTargetException, - ::com::sun::star::uno::RuntimeException); - virtual const SwPaM* GetPaM() const; virtual SwPaM* GetPaM(); virtual const SwDoc* GetDoc() const; diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index 950a0d3fc81c..9fd8059894f4 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include #include "fesh.hxx" @@ -1533,7 +1533,7 @@ void SwAccessibleParagraph::_getRunAttributesImpl( SfxItemSet aCharAttrsAtPaM( pPaM->GetDoc()->GetAttrPool(), RES_CHRATR_BEGIN, RES_CHRATR_END -1, 0 ); - SwXTextCursor::GetCrsrAttr( *pPaM, aCharAttrsAtPaM, TRUE, TRUE ); + SwUnoCursorHelper::GetCrsrAttr(*pPaM, aCharAttrsAtPaM, TRUE, TRUE); aSet.Put( aCharAttrsAtPaM ); } // <-- diff --git a/sw/source/core/edit/editsh.cxx b/sw/source/core/edit/editsh.cxx index 796905fd49f5..554e66a56ed8 100644 --- a/sw/source/core/edit/editsh.cxx +++ b/sw/source/core/edit/editsh.cxx @@ -63,7 +63,7 @@ #include #include #include -#include +#include #include #include #include @@ -1111,7 +1111,7 @@ String SwEditShell::DeleteExtTextInput( SwExtTextInput* pDel, BOOL bInsText ) if( pDel ) { rtl::OUString sTmp; - SwXTextCursor::getTextFromPam(*pDel, sTmp); + SwUnoCursorHelper::GetTextFromPam(*pDel, sTmp); sRet = sTmp; SET_CURR_SHELL( this ); StartAllAction(); diff --git a/sw/source/core/unocore/SwXTextDefaults.cxx b/sw/source/core/unocore/SwXTextDefaults.cxx index 43c1743023d7..81a2cf34e93a 100644 --- a/sw/source/core/unocore/SwXTextDefaults.cxx +++ b/sw/source/core/unocore/SwXTextDefaults.cxx @@ -30,9 +30,12 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" + +#include + #include #include -#include + #include #include #include @@ -44,6 +47,7 @@ #include #include #include +#include #include #include @@ -56,9 +60,6 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::lang; -// declarations -void lcl_setPageDesc(SwDoc*, const uno::Any&, SfxItemSet& ); // from unoobj.cxx - SwXTextDefaults::SwXTextDefaults ( SwDoc * pNewDoc ) : m_pPropSet( aSwMapProvider.GetPropertySet( PROPERTY_MAP_TEXT_DEFAULT ) ), @@ -97,7 +98,7 @@ void SAL_CALL SwXTextDefaults::setPropertyValue( const OUString& rPropertyName, { SfxItemSet aSet( m_pDoc->GetAttrPool(), RES_PAGEDESC, RES_PAGEDESC ); aSet.Put(rItem); - lcl_setPageDesc( m_pDoc, aValue, aSet ); + SwUnoCursorHelper::SetPageDesc( aValue, *m_pDoc, aSet ); m_pDoc->SetDefault(aSet.Get(RES_PAGEDESC)); } else if ((RES_PARATR_DROP == pMap->nWID && MID_DROPCAP_CHAR_STYLE_NAME == pMap->nMemberId) || diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index 1138f5ee273e..4d179f133446 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -32,12 +32,13 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" +#include + #include #include #include #include -#include #include #include #include @@ -45,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -103,8 +105,9 @@ using ::rtl::OUString; namespace SwUnoCursorHelper { + /* -----------------16.09.98 12:27------------------- - * Lesen spezieller Properties am Cursor +* Lesen spezieller Properties am Cursor * --------------------------------------------------*/ sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry , SwPaM& rPam @@ -196,7 +199,10 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry pFmt = FN_UNO_PARA_CONDITIONAL_STYLE_NAME == rEntry.nWID ? pNode->GetFmtColl() : &pNode->GetAnyFmtColl(); else - pFmt = SwXTextCursor::GetCurTxtFmtColl(rPam, FN_UNO_PARA_CONDITIONAL_STYLE_NAME == rEntry.nWID); + { + pFmt = SwUnoCursorHelper::GetCurTxtFmtColl(rPam, + FN_UNO_PARA_CONDITIONAL_STYLE_NAME == rEntry.nWID); + } if(pFmt) { if( pAny ) diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx index a0b08fffc879..837caa62634b 100644 --- a/sw/source/core/unocore/unoobj.cxx +++ b/sw/source/core/unocore/unoobj.cxx @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -195,25 +196,30 @@ SwUnoInternalPaM& SwUnoInternalPaM::operator=(const SwPaM& rPaM) /*-----------------09.03.98 08:29------------------- --------------------------------------------------*/ -void SwXTextCursor::SelectPam(SwPaM& rCrsr, sal_Bool bExpand) +void SwUnoCursorHelper::SelectPam(SwPaM & rPam, const bool bExpand) { - if(bExpand) + if (bExpand) { - if(!rCrsr.HasMark()) - rCrsr.SetMark(); + if (!rPam.HasMark()) + { + rPam.SetMark(); + } + } + else if (rPam.HasMark()) + { + rPam.DeleteMark(); } - else if(rCrsr.HasMark()) - rCrsr.DeleteMark(); - } /* -----------------20.05.98 14:59------------------- * * --------------------------------------------------*/ -void SwXTextCursor::getTextFromPam(SwPaM& aCrsr, OUString& rBuffer) +void SwUnoCursorHelper::GetTextFromPam(SwPaM & rPam, OUString & rBuffer) { - if(!aCrsr.HasMark()) + if (!rPam.HasMark()) + { return; + } SvCacheStream aStream( 20480 ); #ifdef OSL_BIGENDIAN aStream.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN ); @@ -225,7 +231,7 @@ void SwXTextCursor::getTextFromPam(SwPaM& aCrsr, OUString& rBuffer) SwReaderWriter::GetWriter( C2S(FILTER_TEXT_DLG), String(), xWrt ); if( xWrt.Is() ) { - SwWriter aWriter( aStream, aCrsr ); + SwWriter aWriter( aStream, rPam ); xWrt->bASCII_NoLastLineEnd = sal_True; xWrt->bExportPargraphNumbering = sal_False; SwAsciiOptions aOpt = xWrt->GetAsciiOptions(); @@ -253,10 +259,15 @@ void SwXTextCursor::getTextFromPam(SwPaM& aCrsr, OUString& rBuffer) String sBuf; sal_Int32 nLocalLen = 0; if( lUniLen >= STRING_MAXLEN ) + { nLocalLen = STRING_MAXLEN - 1; + } else + { nLocalLen = lUniLen; - sal_Unicode* pStrBuf = sBuf.AllocBuffer( xub_StrLen( nLocalLen + 1)); + } + sal_Unicode *const pStrBuf = + sBuf.AllocBuffer( xub_StrLen( nLocalLen + 1)); aStream.Read( pStrBuf, 2 * nLocalLen ); pStrBuf[ nLocalLen ] = '\0'; aStrBuffer.append( pStrBuf, nLocalLen ); @@ -271,46 +282,52 @@ void SwXTextCursor::getTextFromPam(SwPaM& aCrsr, OUString& rBuffer) /* -----------------06.07.98 07:33------------------- * * --------------------------------------------------*/ -void lcl_setCharStyle(SwDoc* pDoc, const uno::Any aValue, SfxItemSet& rSet) - throw (lang::IllegalArgumentException) +static void +lcl_setCharStyle(SwDoc *const pDoc, const uno::Any & rValue, SfxItemSet & rSet) +throw (lang::IllegalArgumentException) { - SwDocShell* pDocSh = pDoc->GetDocShell(); + SwDocShell *const pDocSh = pDoc->GetDocShell(); if(pDocSh) { OUString uStyle; - aValue >>= uStyle; - String sStyle; - SwStyleNameMapper::FillUIName(uStyle, sStyle, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, sal_True ); - SwDocStyleSheet* pStyle = - (SwDocStyleSheet*)pDocSh->GetStyleSheetPool()->Find(sStyle, SFX_STYLE_FAMILY_CHAR); - if(pStyle) + if (!(rValue >>= uStyle)) { - SwFmtCharFmt aFmt(pStyle->GetCharFmt()); - rSet.Put(aFmt); + throw lang::IllegalArgumentException(); } - else + String sStyle; + SwStyleNameMapper::FillUIName(uStyle, sStyle, + nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, sal_True); + SwDocStyleSheet *const pStyle = static_cast( + pDocSh->GetStyleSheetPool()->Find(sStyle, SFX_STYLE_FAMILY_CHAR)); + if (!pStyle) { - throw lang::IllegalArgumentException(); + throw lang::IllegalArgumentException(); } - + const SwFmtCharFmt aFmt(pStyle->GetCharFmt()); + rSet.Put(aFmt); } }; /* -----------------08.06.06 10:43------------------- * * --------------------------------------------------*/ -void lcl_setAutoStyle(IStyleAccess& rStyleAccess, const uno::Any aValue, SfxItemSet& rSet, bool bPara ) - throw (lang::IllegalArgumentException) +static void +lcl_setAutoStyle(IStyleAccess & rStyleAccess, const uno::Any & rValue, + SfxItemSet & rSet, const bool bPara) +throw (lang::IllegalArgumentException) { OUString uStyle; - aValue >>= uStyle; - String sStyle; + if (!(rValue >>= uStyle)) + { + throw lang::IllegalArgumentException(); + } StylePool::SfxItemSet_Pointer_t pStyle = bPara ? rStyleAccess.getByName(uStyle, IStyleAccess::AUTO_STYLE_PARA ): rStyleAccess.getByName(uStyle, IStyleAccess::AUTO_STYLE_CHAR ); if(pStyle.get()) { - SwFmtAutoFmt aFmt( bPara ? sal::static_int_cast< USHORT >(RES_AUTO_STYLE) - : sal::static_int_cast< USHORT >(RES_TXTATR_AUTOFMT) ); + SwFmtAutoFmt aFmt( (bPara) + ? sal::static_int_cast< USHORT >(RES_AUTO_STYLE) + : sal::static_int_cast< USHORT >(RES_TXTATR_AUTOFMT) ); aFmt.SetStyleHandle( pStyle ); rSet.Put(aFmt); } @@ -322,71 +339,77 @@ void lcl_setAutoStyle(IStyleAccess& rStyleAccess, const uno::Any aValue, SfxItem /* -----------------30.06.98 08:46------------------- * * --------------------------------------------------*/ -void lcl_SetTxtFmtColl(const uno::Any& rAny, SwPaM& rPaM) - throw (lang::IllegalArgumentException) +void +SwUnoCursorHelper::SetTxtFmtColl(const uno::Any & rAny, SwPaM & rPaM) +throw (lang::IllegalArgumentException) { - SwDoc* pDoc = rPaM.GetDoc(); - SwDocShell* pDocSh = pDoc->GetDocShell(); + SwDoc *const pDoc = rPaM.GetDoc(); + SwDocShell *const pDocSh = pDoc->GetDocShell(); if(!pDocSh) return; OUString uStyle; rAny >>= uStyle; String sStyle; - SwStyleNameMapper::FillUIName(uStyle, sStyle, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, sal_True ); - SwDocStyleSheet* pStyle = - (SwDocStyleSheet*)pDocSh->GetStyleSheetPool()->Find(sStyle, SFX_STYLE_FAMILY_PARA); - if(pStyle) - { - SwTxtFmtColl *pLocal = pStyle->GetCollection(); - UnoActionContext aAction(pDoc); - pDoc->StartUndo( UNDO_START, NULL ); - SwPaM *pTmpCrsr = &rPaM; - do { - pDoc->SetTxtFmtColl(*pTmpCrsr, pLocal); - pTmpCrsr = static_cast(pTmpCrsr->GetNext()); - } while ( pTmpCrsr != &rPaM ); - pDoc->EndUndo( UNDO_END, NULL ); - } - else + SwStyleNameMapper::FillUIName(uStyle, sStyle, + nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, sal_True ); + SwDocStyleSheet *const pStyle = static_cast( + pDocSh->GetStyleSheetPool()->Find(sStyle, SFX_STYLE_FAMILY_PARA)); + if (!pStyle) { throw lang::IllegalArgumentException(); } + SwTxtFmtColl *const pLocal = pStyle->GetCollection(); + UnoActionContext aAction(pDoc); + pDoc->StartUndo( UNDO_START, NULL ); + SwPaM *pTmpCrsr = &rPaM; + do { + pDoc->SetTxtFmtColl(*pTmpCrsr, pLocal); + pTmpCrsr = static_cast(pTmpCrsr->GetNext()); + } while ( pTmpCrsr != &rPaM ); + pDoc->EndUndo( UNDO_END, NULL ); } + /* -----------------06.07.98 07:38------------------- * * --------------------------------------------------*/ - void lcl_setPageDesc(SwDoc* pDoc, const uno::Any& aValue, SfxItemSet& rSet) - { - if(aValue.getValueType() != ::getCppuType((const OUString*)0)) - return; - SwFmtPageDesc *pNewDesc = 0 ; +bool +SwUnoCursorHelper::SetPageDesc( + const uno::Any& rValue, SwDoc & rDoc, SfxItemSet & rSet) +{ + OUString uDescName; + if (!(rValue >>= uDescName)) + { + return false; + } + ::std::auto_ptr pNewDesc; const SfxPoolItem* pItem; if(SFX_ITEM_SET == rSet.GetItemState( RES_PAGEDESC, sal_True, &pItem ) ) { - pNewDesc = new SwFmtPageDesc(*((SwFmtPageDesc*)pItem)); + pNewDesc.reset(new SwFmtPageDesc( + *static_cast(pItem))); + } + if (!pNewDesc.get()) + { + pNewDesc.reset(new SwFmtPageDesc()); } - if(!pNewDesc) - pNewDesc = new SwFmtPageDesc(); - OUString uDescName; - aValue >>= uDescName; String sDescName; - SwStyleNameMapper::FillUIName(uDescName, sDescName, nsSwGetPoolIdFromName::GET_POOLID_PAGEDESC, sal_True ); - if(!pNewDesc->GetPageDesc() || pNewDesc->GetPageDesc()->GetName() != sDescName) + SwStyleNameMapper::FillUIName(uDescName, sDescName, + nsSwGetPoolIdFromName::GET_POOLID_PAGEDESC, sal_True); + if (!pNewDesc->GetPageDesc() || + (pNewDesc->GetPageDesc()->GetName() != sDescName)) { sal_Bool bPut = sal_False; if(sDescName.Len()) { - SwPageDesc* pPageDesc = ::GetPageDescByName_Impl(*pDoc, sDescName); - if(pPageDesc) - { - pPageDesc->Add( pNewDesc ); - bPut = sal_True; - } - else + SwPageDesc *const pPageDesc = + ::GetPageDescByName_Impl(rDoc, sDescName); + if (!pPageDesc) { throw lang::IllegalArgumentException(); } + pPageDesc->Add( pNewDesc.get() ); + bPut = sal_True; } if(!bPut) { @@ -394,17 +417,21 @@ void lcl_SetTxtFmtColl(const uno::Any& rAny, SwPaM& rPaM) rSet.Put(SwFmtPageDesc()); } else + { rSet.Put(*pNewDesc); + } } - delete pNewDesc; + return true; } + /* -----------------30.06.98 10:29------------------- * * --------------------------------------------------*/ -void lcl_SetNodeNumStart( SwPaM& rCrsr, uno::Any aValue ) +static void +lcl_SetNodeNumStart(SwPaM & rCrsr, uno::Any const& rValue) { sal_Int16 nTmp = 1; - aValue >>= nTmp; + rValue >>= nTmp; sal_uInt16 nStt = (nTmp < 0 ? USHRT_MAX : (sal_uInt16)nTmp); SwDoc* pDoc = rCrsr.GetDoc(); UnoActionContext aAction(pDoc); @@ -429,215 +456,264 @@ void lcl_SetNodeNumStart( SwPaM& rCrsr, uno::Any aValue ) } } +static bool +lcl_setCharFmtSequence(SwPaM & rPam, uno::Any const& rValue) +{ + uno::Sequence aCharStyles; + if (!(rValue >>= aCharStyles)) + { + return false; + } + + for (sal_Int32 nStyle = 0; nStyle < aCharStyles.getLength(); nStyle++) + { + uno::Any aStyle; + rPam.GetDoc()->StartUndo(UNDO_START, NULL); + aStyle <<= aCharStyles.getConstArray()[nStyle]; + // create a local set and apply each format directly + SfxItemSet aSet(rPam.GetDoc()->GetAttrPool(), + RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT); + lcl_setCharStyle(rPam.GetDoc(), aStyle, aSet); + // the first style should replace the current attributes, + // all other have to be added + SwUnoCursorHelper::SetCrsrAttr(rPam, aSet, (nStyle) + ? nsSetAttrMode::SETATTR_DONTREPLACE + : nsSetAttrMode::SETATTR_DEFAULT); + rPam.GetDoc()->EndUndo(UNDO_START, NULL); + } + return true; +} + +static void +lcl_setDropcapCharStyle(SwPaM & rPam, SfxItemSet & rItemSet, + uno::Any const& rValue) +{ + OUString uStyle; + if (!(rValue >>= uStyle)) + { + throw lang::IllegalArgumentException(); + } + String sStyle; + SwStyleNameMapper::FillUIName(uStyle, sStyle, + nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, sal_True); + SwDoc *const pDoc = rPam.GetDoc(); + //default character style must not be set as default format + SwDocStyleSheet *const pStyle = static_cast( + pDoc->GetDocShell() + ->GetStyleSheetPool()->Find(sStyle, SFX_STYLE_FAMILY_CHAR)); + if (!pStyle || + (static_cast(pStyle)->GetCharFmt() == + pDoc->GetDfltCharFmt())) + { + throw lang::IllegalArgumentException(); + } + ::std::auto_ptr pDrop; + SfxPoolItem const* pItem(0); + if (SFX_ITEM_SET == + rItemSet.GetItemState(RES_PARATR_DROP, sal_True, &pItem)) + { + pDrop.reset(new SwFmtDrop(*static_cast(pItem))); + } + if (!pDrop.get()) + { + pDrop.reset(new SwFmtDrop); + } + const rtl::Reference xStyle(new SwDocStyleSheet(*pStyle)); + pDrop->SetCharFmt(xStyle->GetCharFmt()); + rItemSet.Put(*pDrop); +} + +static void +lcl_setRubyCharstyle(SfxItemSet & rItemSet, uno::Any const& rValue) +{ + OUString sTmp; + if (!(rValue >>= sTmp)) + { + throw lang::IllegalArgumentException(); + } + + ::std::auto_ptr pRuby; + const SfxPoolItem* pItem; + if (SFX_ITEM_SET == + rItemSet.GetItemState(RES_TXTATR_CJK_RUBY, sal_True, &pItem)) + { + pRuby.reset(new SwFmtRuby(*static_cast(pItem))); + } + if (!pRuby.get()) + { + pRuby.reset(new SwFmtRuby(aEmptyStr)); + } + String sStyle; + SwStyleNameMapper::FillUIName(sTmp, sStyle, + nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, sal_True ); + pRuby->SetCharFmtName(sStyle); + pRuby->SetCharFmtId(0); + if (sStyle.Len() > 0) + { + const sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName( + sStyle, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT); + pRuby->SetCharFmtId(nId); + } + rItemSet.Put(*pRuby); +} + /* -----------------17.09.98 09:44------------------- * * --------------------------------------------------*/ -sal_Bool lcl_setCrsrPropertyValue(const SfxItemPropertySimpleEntry* pEntry, - SwPaM& rPam, - SfxItemSet& rItemSet, - const uno::Any& aValue ) throw (lang::IllegalArgumentException) -{ - sal_Bool bRet = sal_True; - if(0 == ( pEntry->nFlags&PropertyAttribute::MAYBEVOID ) && - aValue.getValueType() == ::getCppuVoidType()) - bRet = sal_False; - else - { - switch(pEntry->nWID) +bool +SwUnoCursorHelper::SetCursorPropertyValue( + SfxItemPropertySimpleEntry const& rEntry, const uno::Any& rValue, + SwPaM & rPam, SfxItemSet & rItemSet) +throw (lang::IllegalArgumentException) +{ + if (!(rEntry.nFlags & beans::PropertyAttribute::MAYBEVOID) && + (rValue.getValueType() == ::getCppuVoidType())) + { + return false; + } + bool bRet = true; + switch (rEntry.nWID) + { + case RES_TXTATR_CHARFMT: + lcl_setCharStyle(rPam.GetDoc(), rValue, rItemSet); + break; + case RES_TXTATR_AUTOFMT: + lcl_setAutoStyle(rPam.GetDoc()->GetIStyleAccess(), + rValue, rItemSet, false); + break; + case FN_UNO_CHARFMT_SEQUENCE: + lcl_setCharFmtSequence(rPam, rValue); + break; + case FN_UNO_PARA_STYLE : + SwUnoCursorHelper::SetTxtFmtColl(rValue, rPam); + break; + case RES_AUTO_STYLE: + lcl_setAutoStyle(rPam.GetDoc()->GetIStyleAccess(), + rValue, rItemSet, true); + break; + case FN_UNO_PAGE_STYLE: + //FIXME nothing here? + break; + case FN_UNO_NUM_START_VALUE: + lcl_SetNodeNumStart( rPam, rValue ); + break; + case FN_UNO_NUM_LEVEL: + // --> OD 2008-07-14 #i91601# + case FN_UNO_LIST_ID: + // <-- + case FN_UNO_IS_NUMBER: { - case RES_TXTATR_CHARFMT: - lcl_setCharStyle(rPam.GetDoc(), aValue, rItemSet ); - break; - case RES_TXTATR_AUTOFMT: - lcl_setAutoStyle(rPam.GetDoc()->GetIStyleAccess(), aValue, rItemSet, false ); - break; - case FN_UNO_CHARFMT_SEQUENCE: + // multi selection is not considered + SwTxtNode *const pTxtNd = rPam.GetNode()->GetTxtNode(); + // --> OD 2008-05-14 #refactorlists# - check on list style not needed +// const SwNumRule* pRule = pTxtNd->GetNumRule(); +// if( FN_UNO_NUM_LEVEL == rEntry.nWID && pRule != NULL ) + if (FN_UNO_NUM_LEVEL == rEntry.nWID) + // <-- { - Sequence aCharStyles; - if(aValue >>= aCharStyles) + sal_Int16 nLevel = 0; + if (rValue >>= nLevel) { - for(sal_Int32 nStyle = 0; nStyle < aCharStyles.getLength(); nStyle++) - { - Any aStyle; - rPam.GetDoc()->StartUndo( UNDO_START, NULL); - aStyle <<= aCharStyles.getConstArray()[nStyle]; - //create a local set and apply each format directly - SfxItemSet aSet(rPam.GetDoc()->GetAttrPool(), RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT ); - lcl_setCharStyle(rPam.GetDoc(), aStyle, aSet ); - //the first style should replace the current attributes, all other have to be added - SwXTextCursor::SetCrsrAttr(rPam, aSet, nStyle ? CRSR_ATTR_MODE_DONTREPLACE : 0); - rPam.GetDoc()->EndUndo( UNDO_START, NULL ); - } + pTxtNd->SetAttrListLevel(nLevel); } - else - bRet = sal_False; } - break; - case FN_UNO_PARA_STYLE : - lcl_SetTxtFmtColl(aValue, rPam); - break; - case RES_AUTO_STYLE: - lcl_setAutoStyle(rPam.GetDoc()->GetIStyleAccess(), aValue, rItemSet, true ); - break; - case FN_UNO_PAGE_STYLE : - break; - case FN_UNO_NUM_START_VALUE : - lcl_SetNodeNumStart( rPam, aValue ); - break; - case FN_UNO_NUM_LEVEL : // --> OD 2008-07-14 #i91601# - case FN_UNO_LIST_ID: - // <-- - case FN_UNO_IS_NUMBER : + else if (FN_UNO_LIST_ID == rEntry.nWID) { - // multi selection is not considered - SwTxtNode* pTxtNd = rPam.GetNode()->GetTxtNode(); - // --> OD 2008-05-14 #refactorlists# - check on list style not needed -// const SwNumRule* pRule = pTxtNd->GetNumRule(); -// if( FN_UNO_NUM_LEVEL == pEntry->nWID && pRule != NULL ) - if ( FN_UNO_NUM_LEVEL == pEntry->nWID ) - // <-- - { - sal_Int16 nLevel = 0; - aValue >>= nLevel; - - pTxtNd->SetAttrListLevel(nLevel); - - } - // --> OD 2008-07-14 #i91601# - else if( FN_UNO_LIST_ID == pEntry->nWID ) + ::rtl::OUString sListId; + if (rValue >>= sListId) { - ::rtl::OUString sListId; - aValue >>= sListId; pTxtNd->SetListId( sListId ); } - // <-- - else if( FN_UNO_IS_NUMBER == pEntry->nWID ) + } + // <-- + else if (FN_UNO_IS_NUMBER == rEntry.nWID) + { + sal_Bool bIsNumber(sal_False); + if (rValue >>= bIsNumber) { - BOOL bIsNumber = *(sal_Bool*) aValue.getValue(); - if(!bIsNumber) + if (!bIsNumber) + { pTxtNd->SetCountedInList( false ); + } } - //PROPERTY_MAYBEVOID! } - break; - case FN_NUMBER_NEWSTART : + //PROPERTY_MAYBEVOID! + } + break; + case FN_NUMBER_NEWSTART: + { + sal_Bool bVal = sal_False; + if (!(rValue >>= bVal)) { - sal_Bool bVal = sal_False; - if (aValue >>= bVal) - rPam.GetDoc()->SetNumRuleStart(*rPam.GetPoint(), bVal); - else - throw lang::IllegalArgumentException(); + throw lang::IllegalArgumentException(); } - break; - case FN_UNO_NUM_RULES: - SwUnoCursorHelper::setNumberingProperty(aValue, rPam); - break; - case RES_PARATR_DROP: + rPam.GetDoc()->SetNumRuleStart(*rPam.GetPoint(), bVal); + } + break; + case FN_UNO_NUM_RULES: + SwUnoCursorHelper::setNumberingProperty(rValue, rPam); + break; + case RES_PARATR_DROP: + { + if (MID_DROPCAP_CHAR_STYLE_NAME == rEntry.nMemberId) { - if( MID_DROPCAP_CHAR_STYLE_NAME == pEntry->nMemberId) - { - OUString uStyle; - if(aValue >>= uStyle) - { - String sStyle; - SwStyleNameMapper::FillUIName(uStyle, sStyle, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, sal_True ); - SwDoc* pDoc = rPam.GetDoc(); - //default character style mustn't be set as default format - SwDocStyleSheet* pStyle = - (SwDocStyleSheet*)pDoc->GetDocShell()->GetStyleSheetPool()->Find(sStyle, SFX_STYLE_FAMILY_CHAR); - SwFmtDrop* pDrop = 0; - if(pStyle && - ((SwDocStyleSheet*)pStyle)->GetCharFmt() != pDoc->GetDfltCharFmt()) - { - const SfxPoolItem* pItem; - if(SFX_ITEM_SET == rItemSet.GetItemState( RES_PARATR_DROP, sal_True, &pItem ) ) - pDrop = new SwFmtDrop(*((SwFmtDrop*)pItem)); - if(!pDrop) - pDrop = new SwFmtDrop(); - rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet( *(SwDocStyleSheet*)pStyle ) ); - pDrop->SetCharFmt(xStyle->GetCharFmt()); - } - else - throw lang::IllegalArgumentException(); - rItemSet.Put(*pDrop); - delete pDrop; - } - else - throw lang::IllegalArgumentException(); - } - else - bRet = sal_False; + lcl_setDropcapCharStyle(rPam, rItemSet, rValue); } - break; - case RES_TXTATR_CJK_RUBY: - if(MID_RUBY_CHARSTYLE == pEntry->nMemberId ) - { - OUString sTmp; - if(aValue >>= sTmp) - { - SwFmtRuby* pRuby = 0; - const SfxPoolItem* pItem; - if(SFX_ITEM_SET == rItemSet.GetItemState( RES_TXTATR_CJK_RUBY, sal_True, &pItem ) ) - pRuby = new SwFmtRuby(*((SwFmtRuby*)pItem)); - if(!pRuby) - pRuby = new SwFmtRuby(aEmptyStr); - String sStyle; - SwStyleNameMapper::FillUIName(sTmp, sStyle, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, sal_True ); - pRuby->SetCharFmtName( sStyle ); - pRuby->SetCharFmtId( 0 ); - if(sStyle.Len() > 0) - { - sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName( sStyle, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT ); - pRuby->SetCharFmtId(nId); - } - rItemSet.Put(*pRuby); - delete pRuby; - } - else - throw lang::IllegalArgumentException(); - bRet = sal_True; - } - else - bRet = sal_False; - break; - case RES_PAGEDESC : - if(MID_PAGEDESC_PAGEDESCNAME == pEntry->nMemberId ) + else { - lcl_setPageDesc(rPam.GetDoc(), aValue, rItemSet); - break; + bRet = false; } - //hier kein break - default: bRet = sal_False; } + break; + case RES_TXTATR_CJK_RUBY: + { + if (MID_RUBY_CHARSTYLE == rEntry.nMemberId) + { + lcl_setRubyCharstyle(rItemSet, rValue); + } + else + { + bRet = false; + } + } + break; + case RES_PAGEDESC: + { + if (MID_PAGEDESC_PAGEDESCNAME == rEntry.nMemberId) + { + SwUnoCursorHelper::SetPageDesc( + rValue, *rPam.GetDoc(), rItemSet); + } + else + { + bRet = false; + } + } + break; + default: + bRet = false; } -return bRet; + return bRet; } /* -----------------30.06.98 08:39------------------- * * --------------------------------------------------*/ -SwFmtColl* SwXTextCursor::GetCurTxtFmtColl(SwPaM& rPaM, BOOL bConditional) +SwFmtColl * +SwUnoCursorHelper::GetCurTxtFmtColl(SwPaM & rPaM, const bool bConditional) { static const sal_uInt16 nMaxLookup = 1000; SwFmtColl *pFmt = 0; // if ( GetCrsrCnt() > nMaxLookup ) // return 0; - sal_Bool bError = sal_False; + bool bError = false; SwPaM *pTmpCrsr = &rPaM; - do { - - ULONG nSttNd = pTmpCrsr->GetMark()->nNode.GetIndex(); - ULONG nEndNd = pTmpCrsr->GetPoint()->nNode.GetIndex(); - xub_StrLen nSttCnt = pTmpCrsr->GetMark()->nContent.GetIndex(); - xub_StrLen nEndCnt = pTmpCrsr->GetPoint()->nContent.GetIndex(); - - if( nSttNd > nEndNd || ( nSttNd == nEndNd && nSttCnt > nEndCnt )) - { - sal_uInt32 nTmp = nSttNd; nSttNd = nEndNd; nEndNd = nTmp; - nTmp = nSttCnt; nSttCnt = nEndCnt; nEndCnt = (sal_uInt16)nTmp; - } + do + { + const ULONG nSttNd = pTmpCrsr->Start()->nNode.GetIndex(); + const ULONG nEndNd = pTmpCrsr->End()->nNode.GetIndex(); if( nEndNd - nSttNd >= nMaxLookup ) { @@ -648,33 +724,33 @@ SwFmtColl* SwXTextCursor::GetCurTxtFmtColl(SwPaM& rPaM, BOOL bConditional) const SwNodes& rNds = rPaM.GetDoc()->GetNodes(); for( ULONG n = nSttNd; n <= nEndNd; ++n ) { - const SwTxtNode* pNd = rNds[ n ]->GetTxtNode(); + SwTxtNode const*const pNd = rNds[ n ]->GetTxtNode(); if( pNd ) { - SwFmtColl* pNdFmt = bConditional ? pNd->GetFmtColl() - : &pNd->GetAnyFmtColl(); + SwFmtColl *const pNdFmt = (bConditional) + ? pNd->GetFmtColl() : &pNd->GetAnyFmtColl(); if( !pFmt ) + { pFmt = pNdFmt; + } else if( pFmt != pNdFmt ) { - bError = sal_True; + bError = true; break; } } } - if(bError) - break; pTmpCrsr = static_cast(pTmpCrsr->GetNext()); } while ( pTmpCrsr != &rPaM ); - return bError ? 0 : pFmt; + return (bError) ? 0 : pFmt; } /* -----------------26.06.98 16:20------------------- * Hilfsfunktion fuer PageDesc * --------------------------------------------------*/ - SwPageDesc* GetPageDescByName_Impl(SwDoc& rDoc, const String& rName) - { +SwPageDesc* GetPageDescByName_Impl(SwDoc& rDoc, const String& rName) +{ SwPageDesc* pRet = 0; sal_uInt16 nDCount = rDoc.GetPageDescCnt(); sal_uInt16 i; @@ -695,7 +771,8 @@ SwFmtColl* SwXTextCursor::GetCurTxtFmtColl(SwPaM& rPaM, BOOL bConditional) const String aFmtName(SW_RES(i)); if(aFmtName == rName) { - pRet = rDoc.GetPageDescFromPool( static_cast< sal_uInt16 >(RES_POOLPAGE_BEGIN + i - RC_POOLPAGEDESC_BEGIN) ); + pRet = rDoc.GetPageDescFromPool( static_cast< sal_uInt16 >( + RES_POOLPAGE_BEGIN + i - RC_POOLPAGEDESC_BEGIN) ); break; } } @@ -934,7 +1011,7 @@ void SwXTextCursor::DeleteAndInsert(const String& rText, DBG_ASSERT( bSuccess, "Doc->Insert(Str) failed." ); (void) bSuccess; - SwXTextCursor::SelectPam(*pUnoCrsr, sal_True); + SwUnoCursorHelper::SelectPam(*pUnoCrsr, true); _pStartCrsr->Left(rText.Len(), CRSR_SKIP_CHARS, FALSE, FALSE); } } while( (_pStartCrsr=(SwCursor*)_pStartCrsr->GetNext()) != pUnoCrsr ); @@ -945,7 +1022,8 @@ void SwXTextCursor::DeleteAndInsert(const String& rText, enum ForceIntoMetaMode { META_CHECK_BOTH, META_INIT_START, META_INIT_END }; -sal_Bool lcl_ForceIntoMeta(SwPaM & rCursor, +static sal_Bool +lcl_ForceIntoMeta(SwPaM & rCursor, uno::Reference const & xParentText, const enum ForceIntoMetaMode eMode) { @@ -1106,7 +1184,7 @@ sal_Bool SwXTextCursor::goLeft(sal_Int16 nCount, sal_Bool Expand) throw( uno::Ru SwUnoCrsr* pUnoCrsr = GetCrsr(); if(pUnoCrsr) { - SwXTextCursor::SelectPam(*pUnoCrsr, Expand); + SwUnoCursorHelper::SelectPam(*pUnoCrsr, Expand); bRet = pUnoCrsr->Left( nCount, CRSR_SKIP_CHARS, FALSE, FALSE); if (CURSOR_META == eType) { @@ -1130,7 +1208,7 @@ sal_Bool SwXTextCursor::goRight(sal_Int16 nCount, sal_Bool Expand) throw( uno::R SwUnoCrsr* pUnoCrsr = GetCrsr(); if(pUnoCrsr) { - SwXTextCursor::SelectPam(*pUnoCrsr, Expand); + SwUnoCursorHelper::SelectPam(*pUnoCrsr, Expand); bRet = pUnoCrsr->Right(nCount, CRSR_SKIP_CHARS, FALSE, FALSE); if (CURSOR_META == eType) { @@ -1153,7 +1231,7 @@ void SwXTextCursor::gotoStart(sal_Bool Expand) throw( uno::RuntimeException ) SwUnoCrsr* pUnoCrsr = GetCrsr(); if(pUnoCrsr) { - SwXTextCursor::SelectPam(*pUnoCrsr, Expand); + SwUnoCursorHelper::SelectPam(*pUnoCrsr, Expand); if(eType == CURSOR_BODY) { pUnoCrsr->Move( fnMoveBackward, fnGoDoc ); @@ -1209,7 +1287,7 @@ void SwXTextCursor::gotoEnd(sal_Bool Expand) throw( uno::RuntimeException ) SwUnoCrsr* pUnoCrsr = GetCrsr(); if(pUnoCrsr) { - SwXTextCursor::SelectPam(*pUnoCrsr, Expand); + SwUnoCursorHelper::SelectPam(*pUnoCrsr, Expand); if(eType == CURSOR_BODY) { pUnoCrsr->Move( fnMoveForward, fnGoDoc ); @@ -1424,7 +1502,7 @@ sal_Bool SwXTextCursor::gotoNextWord(sal_Bool Expand) throw( uno::RuntimeExcepti SwNode *pOldNode = &pPoint->nNode.GetNode(); xub_StrLen nOldIndex = pPoint->nContent.GetIndex(); - SwXTextCursor::SelectPam(*pUnoCrsr, Expand); + SwUnoCursorHelper::SelectPam(*pUnoCrsr, Expand); //Absatzende? if(pUnoCrsr->GetCntntNode() && pPoint->nContent == pUnoCrsr->GetCntntNode()->Len()) @@ -1470,7 +1548,7 @@ sal_Bool SwXTextCursor::gotoPreviousWord(sal_Bool Expand) throw( uno::RuntimeExc SwNode *pOldNode = &pPoint->nNode.GetNode(); xub_StrLen nOldIndex = pPoint->nContent.GetIndex(); - SwXTextCursor::SelectPam(*pUnoCrsr, Expand); + SwUnoCursorHelper::SelectPam(*pUnoCrsr, Expand); //Absatzanfang ? if(pPoint->nContent == 0) { @@ -1514,7 +1592,7 @@ sal_Bool SwXTextCursor::gotoEndOfWord(sal_Bool Expand) throw( uno::RuntimeExcept xub_StrLen nOldIndex = pPoint->nContent.GetIndex(); sal_Int16 nWordType = i18n::WordType::DICTIONARY_WORD; - SwXTextCursor::SelectPam(*pUnoCrsr, Expand); + SwUnoCursorHelper::SelectPam(*pUnoCrsr, Expand); if(!pUnoCrsr->IsEndWordWT( nWordType )) pUnoCrsr->GoEndWordWT( nWordType ); @@ -1554,7 +1632,7 @@ sal_Bool SwXTextCursor::gotoStartOfWord(sal_Bool Expand) throw( uno::RuntimeExce xub_StrLen nOldIndex = pPoint->nContent.GetIndex(); sal_Int16 nWordType = i18n::WordType::DICTIONARY_WORD; - SwXTextCursor::SelectPam(*pUnoCrsr, Expand); + SwUnoCursorHelper::SelectPam(*pUnoCrsr, Expand); if(!pUnoCrsr->IsStartWordWT( nWordType )) pUnoCrsr->GoStartWordWT( nWordType ); @@ -1646,7 +1724,7 @@ sal_Bool SwXTextCursor::gotoNextSentence(sal_Bool Expand) throw( uno::RuntimeExc if(pUnoCrsr) { BOOL bWasEOS = isEndOfSentence(); - SwXTextCursor::SelectPam(*pUnoCrsr, Expand); + SwUnoCursorHelper::SelectPam(*pUnoCrsr, Expand); bRet = pUnoCrsr->GoSentence(SwCursor::NEXT_SENT); if(!bRet) bRet = pUnoCrsr->MovePara(fnParaNext, fnParaStart); @@ -1680,7 +1758,7 @@ sal_Bool SwXTextCursor::gotoPreviousSentence(sal_Bool Expand) throw( uno::Runtim SwUnoCrsr* pUnoCrsr = GetCrsr(); if(pUnoCrsr) { - SwXTextCursor::SelectPam(*pUnoCrsr, Expand); + SwUnoCursorHelper::SelectPam(*pUnoCrsr, Expand); bRet = pUnoCrsr->GoSentence(SwCursor::PREV_SENT); if(!bRet) { @@ -1712,7 +1790,7 @@ sal_Bool SwXTextCursor::gotoStartOfSentence(sal_Bool Expand) throw( uno::Runtime SwUnoCrsr* pUnoCrsr = GetCrsr(); if(pUnoCrsr) { - SwXTextCursor::SelectPam(*pUnoCrsr, Expand); + SwUnoCursorHelper::SelectPam(*pUnoCrsr, Expand); // if we're at the para start then we wont move // but bRet is also true if GoSentence failed but // the start of the sentence is reached @@ -1739,7 +1817,7 @@ sal_Bool SwXTextCursor::gotoEndOfSentence(sal_Bool Expand) throw( uno::RuntimeEx SwUnoCrsr* pUnoCrsr = GetCrsr(); if(pUnoCrsr) { - SwXTextCursor::SelectPam(*pUnoCrsr, Expand); + SwUnoCursorHelper::SelectPam(*pUnoCrsr, Expand); // bRet is true if GoSentence() succeeded or if the // MovePara() succeeded while the end of the para is // not reached already @@ -1798,7 +1876,7 @@ sal_Bool SwXTextCursor::gotoStartOfParagraph(sal_Bool Expand) throw( uno::Runtim SwUnoCrsr* pUnoCrsr = GetCrsr(); if(pUnoCrsr ) { - SwXTextCursor::SelectPam(*pUnoCrsr, Expand); + SwUnoCursorHelper::SelectPam(*pUnoCrsr, Expand); bRet = SwUnoCursorHelper::IsStartOfPara(*pUnoCrsr); if(!bRet) bRet = pUnoCrsr->MovePara(fnParaCurr, fnParaStart); @@ -1824,7 +1902,7 @@ sal_Bool SwXTextCursor::gotoEndOfParagraph(sal_Bool Expand) throw( uno::RuntimeE SwUnoCrsr* pUnoCrsr = GetCrsr(); if(pUnoCrsr) { - SwXTextCursor::SelectPam(*pUnoCrsr, Expand); + SwUnoCursorHelper::SelectPam(*pUnoCrsr, Expand); bRet = SwUnoCursorHelper::IsEndOfPara(*pUnoCrsr); if(!bRet) bRet = pUnoCrsr->MovePara(fnParaCurr, fnParaEnd); @@ -1850,7 +1928,7 @@ sal_Bool SwXTextCursor::gotoNextParagraph(sal_Bool Expand) throw( uno::RuntimeEx SwUnoCrsr* pUnoCrsr = GetCrsr(); if(pUnoCrsr) { - SwXTextCursor::SelectPam(*pUnoCrsr, Expand); + SwUnoCursorHelper::SelectPam(*pUnoCrsr, Expand); bRet = pUnoCrsr->MovePara(fnParaNext, fnParaStart); } else @@ -1869,7 +1947,7 @@ sal_Bool SwXTextCursor::gotoPreviousParagraph(sal_Bool Expand) throw( uno::Runti SwUnoCrsr* pUnoCrsr = GetCrsr(); if(pUnoCrsr) { - SwXTextCursor::SelectPam(*pUnoCrsr, Expand); + SwUnoCursorHelper::SelectPam(*pUnoCrsr, Expand); bRet = pUnoCrsr->MovePara(fnParaPrev, fnParaStart); } else @@ -1967,7 +2045,7 @@ OUString SwXTextCursor::getString(void) throw( uno::RuntimeException ) else */ { //Text ueber mehrere Absaetze - SwXTextCursor::getTextFromPam(*pUnoCrsr, aTxt); + SwUnoCursorHelper::GetTextFromPam(*pUnoCrsr, aTxt); } } else @@ -1993,242 +2071,307 @@ void SwXTextCursor::setString(const OUString& aString) throw( uno::RuntimeExcept /* -----------------------------03.05.00 12:56-------------------------------- ---------------------------------------------------------------------------*/ -Any SwXTextCursor::GetPropertyValue( +uno::Any SwUnoCursorHelper::GetPropertyValue( SwPaM& rPaM, const SfxItemPropertySet& rPropSet, const OUString& rPropertyName) - throw( UnknownPropertyException, WrappedTargetException, RuntimeException) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { - Any aAny; - const SfxItemPropertySimpleEntry* pEntry = rPropSet.getPropertyMap()->getByName( - rPropertyName); - if(pEntry) + uno::Any aAny; + SfxItemPropertySimpleEntry const*const pEntry = + rPropSet.getPropertyMap()->getByName(rPropertyName); + + if (!pEntry) { - PropertyState eTemp; - BOOL bDone = SwUnoCursorHelper::getCrsrPropertyValue( *pEntry, rPaM, &aAny, eTemp ); - if(!bDone) - { - SfxItemSet aSet(rPaM.GetDoc()->GetAttrPool(), - RES_CHRATR_BEGIN, RES_FRMATR_END -1, - RES_TXTATR_UNKNOWN_CONTAINER, RES_TXTATR_UNKNOWN_CONTAINER, - RES_UNKNOWNATR_CONTAINER, RES_UNKNOWNATR_CONTAINER, - 0L); - SwXTextCursor::GetCrsrAttr(rPaM, aSet); + throw beans::UnknownPropertyException( + OUString(RTL_CONSTASCII_USTRINGPARAM("Unknown property: ")) + + rPropertyName, static_cast(0)); + } - rPropSet.getPropertyValue(*pEntry, aSet, aAny); - } + beans::PropertyState eTemp; + const sal_Bool bDone = SwUnoCursorHelper::getCrsrPropertyValue( + *pEntry, rPaM, &aAny, eTemp ); + + if (!bDone) + { + SfxItemSet aSet(rPaM.GetDoc()->GetAttrPool(), + RES_CHRATR_BEGIN, RES_FRMATR_END - 1, + RES_TXTATR_UNKNOWN_CONTAINER, RES_TXTATR_UNKNOWN_CONTAINER, + RES_UNKNOWNATR_CONTAINER, RES_UNKNOWNATR_CONTAINER, + 0L); + SwUnoCursorHelper::GetCrsrAttr(rPaM, aSet); + + rPropSet.getPropertyValue(*pEntry, aSet, aAny); } - else - throw UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( 0 ) ); return aAny; } /* -----------------------------03.05.00 12:57-------------------------------- ---------------------------------------------------------------------------*/ -void SwXTextCursor::SetPropertyValue( - SwPaM& rPaM, const SfxItemPropertySet& rPropSet, const OUString& rPropertyName, - const Any& aValue, USHORT nAttrMode) - throw (UnknownPropertyException, PropertyVetoException, - IllegalArgumentException, WrappedTargetException, RuntimeException) +void SwUnoCursorHelper::SetPropertyValue( + SwPaM& rPaM, const SfxItemPropertySet& rPropSet, + const OUString& rPropertyName, + const uno::Any& rValue, + const SetAttrMode nAttrMode, const bool bTableMode) +throw (beans::UnknownPropertyException, beans::PropertyVetoException, + lang::IllegalArgumentException, lang::WrappedTargetException, + uno::RuntimeException) { - SwDoc* pDoc = rPaM.GetDoc(); - const SfxItemPropertySimpleEntry* pEntry = rPropSet.getPropertyMap()->getByName(rPropertyName); - if(pEntry) + SwDoc *const pDoc = rPaM.GetDoc(); + SfxItemPropertySimpleEntry const*const pEntry = + rPropSet.getPropertyMap()->getByName(rPropertyName); + if (!pEntry) { - if( pEntry->nFlags & PropertyAttribute::READONLY) - throw PropertyVetoException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( 0 ) ); + throw beans::UnknownPropertyException( + OUString(RTL_CONSTASCII_USTRINGPARAM("Unknown property: ")) + + rPropertyName, + static_cast(0)); + } - SfxItemSet aItemSet( pDoc->GetAttrPool(), pEntry->nWID, pEntry->nWID ); - SwXTextCursor::GetCrsrAttr( rPaM, aItemSet ); + if (pEntry->nFlags & beans::PropertyAttribute::READONLY) + { + throw beans::PropertyVetoException( + OUString(RTL_CONSTASCII_USTRINGPARAM("Property is read-only: ")) + + rPropertyName, + static_cast(0)); + } + + SfxItemSet aItemSet( pDoc->GetAttrPool(), pEntry->nWID, pEntry->nWID ); + SwUnoCursorHelper::GetCrsrAttr( rPaM, aItemSet ); - if(!lcl_setCrsrPropertyValue( pEntry, rPaM, aItemSet, aValue )) - rPropSet.setPropertyValue(*pEntry, aValue, aItemSet ); - SwXTextCursor::SetCrsrAttr(rPaM, aItemSet, nAttrMode ); + if (!SwUnoCursorHelper::SetCursorPropertyValue( + *pEntry, rValue, rPaM, aItemSet)) + { + rPropSet.setPropertyValue(*pEntry, rValue, aItemSet ); } - else - throw UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( 0 ) ); + SwUnoCursorHelper::SetCrsrAttr(rPaM, aItemSet, nAttrMode, bTableMode); } + /* -----------------------------03.05.00 13:16-------------------------------- ---------------------------------------------------------------------------*/ -Sequence< PropertyState > SwXTextCursor::GetPropertyStates( +uno::Sequence< beans::PropertyState > +SwUnoCursorHelper::GetPropertyStates( SwPaM& rPaM, const SfxItemPropertySet& rPropSet, - const Sequence< OUString >& PropertyNames, - SwGetPropertyStatesCaller eCaller ) - throw(UnknownPropertyException, RuntimeException) + const uno::Sequence< OUString >& rPropertyNames, + const SwGetPropertyStatesCaller eCaller) +throw (beans::UnknownPropertyException, uno::RuntimeException) { - const OUString* pNames = PropertyNames.getConstArray(); - Sequence< PropertyState > aRet ( PropertyNames.getLength() ); - PropertyState* pStates = aRet.getArray(); + const OUString* pNames = rPropertyNames.getConstArray(); + uno::Sequence< beans::PropertyState > aRet(rPropertyNames.getLength()); + beans::PropertyState* pStates = aRet.getArray(); + SfxItemPropertyMap const*const pMap = rPropSet.getPropertyMap(); + ::std::auto_ptr pSet; + ::std::auto_ptr pSetParent; - SfxItemSet *pSet = 0, *pSetParent = 0; - const SfxItemPropertyMap *pMap = rPropSet.getPropertyMap(); - for( INT32 i = 0, nEnd = PropertyNames.getLength(); i < nEnd; i++ ) + for (sal_Int32 i = 0, nEnd = rPropertyNames.getLength(); i < nEnd; i++) { - const SfxItemPropertySimpleEntry* pEntry = pMap->getByName( pNames[i] ); + SfxItemPropertySimpleEntry const*const pEntry = + pMap->getByName( pNames[i] ); if(!pEntry) { - if(pNames[i].equalsAsciiL( SW_PROP_NAME(UNO_NAME_IS_SKIP_HIDDEN_TEXT)) || - pNames[i].equalsAsciiL( SW_PROP_NAME(UNO_NAME_IS_SKIP_PROTECTED_TEXT))) + if (pNames[i].equalsAsciiL( SW_PROP_NAME(UNO_NAME_IS_SKIP_HIDDEN_TEXT)) || + pNames[i].equalsAsciiL( SW_PROP_NAME(UNO_NAME_IS_SKIP_PROTECTED_TEXT))) { pStates[i] = beans::PropertyState_DEFAULT_VALUE; continue; } - else if( SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION_TOLERANT == eCaller ) + else if (SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION_TOLERANT == + eCaller) { //this values marks the element as unknown property pStates[i] = beans::PropertyState_MAKE_FIXED_SIZE; continue; } else - throw UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + pNames[i], static_cast < cppu::OWeakObject * > ( 0 ) ); + { + throw beans::UnknownPropertyException( + OUString( RTL_CONSTASCII_USTRINGPARAM("Unknown property: ")) + + pNames[i], + static_cast(0)); + } } - if ((eCaller == SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION || eCaller == SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION_TOLERANT) && + if (((SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION == eCaller) || + (SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION_TOLERANT == eCaller)) && pEntry->nWID < FN_UNO_RANGE_BEGIN && pEntry->nWID > FN_UNO_RANGE_END && pEntry->nWID < RES_CHRATR_BEGIN && pEntry->nWID > RES_TXTATR_END ) + { pStates[i] = beans::PropertyState_DEFAULT_VALUE; + } else { if ( pEntry->nWID >= FN_UNO_RANGE_BEGIN && pEntry->nWID <= FN_UNO_RANGE_END ) - SwUnoCursorHelper::getCrsrPropertyValue(*pEntry, rPaM, 0, pStates[i] ); + { + SwUnoCursorHelper::getCrsrPropertyValue( + *pEntry, rPaM, 0, pStates[i] ); + } else { - if( !pSet ) + if (!pSet.get()) { switch ( eCaller ) { case SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION_TOLERANT: case SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION: - pSet = new SfxItemSet( rPaM.GetDoc()->GetAttrPool(), - RES_CHRATR_BEGIN, RES_TXTATR_END ); + pSet.reset( + new SfxItemSet( rPaM.GetDoc()->GetAttrPool(), + RES_CHRATR_BEGIN, RES_TXTATR_END )); break; case SW_PROPERTY_STATE_CALLER_SINGLE_VALUE_ONLY: - pSet = new SfxItemSet( rPaM.GetDoc()->GetAttrPool(), - pEntry->nWID, pEntry->nWID ); + pSet.reset( + new SfxItemSet( rPaM.GetDoc()->GetAttrPool(), + pEntry->nWID, pEntry->nWID )); break; default: - pSet = new SfxItemSet( rPaM.GetDoc()->GetAttrPool(), + pSet.reset( new SfxItemSet( + rPaM.GetDoc()->GetAttrPool(), RES_CHRATR_BEGIN, RES_FRMATR_END - 1, RES_UNKNOWNATR_CONTAINER, RES_UNKNOWNATR_CONTAINER, RES_TXTATR_UNKNOWN_CONTAINER, RES_TXTATR_UNKNOWN_CONTAINER, - 0L ); + 0L )); } // --> OD 2006-07-12 #i63870# - SwXTextCursor::GetCrsrAttr( rPaM, *pSet ); + SwUnoCursorHelper::GetCrsrAttr( rPaM, *pSet ); // <-- } - if( pSet->Count() ) - pStates[i] = rPropSet.getPropertyState( *pEntry, *pSet ); - else - pStates[i] = PropertyState_DEFAULT_VALUE; + pStates[i] = ( pSet->Count() ) + ? rPropSet.getPropertyState( *pEntry, *pSet ) + : beans::PropertyState_DEFAULT_VALUE; //try again to find out if a value has been inherited if( beans::PropertyState_DIRECT_VALUE == pStates[i] ) { - if( !pSetParent ) + if (!pSetParent.get()) { - pSetParent = pSet->Clone( FALSE ); + pSetParent.reset( pSet->Clone( FALSE ) ); // --> OD 2006-07-12 #i63870# - SwXTextCursor::GetCrsrAttr( rPaM, *pSetParent, TRUE, FALSE ); + SwUnoCursorHelper::GetCrsrAttr( + rPaM, *pSetParent, TRUE, FALSE ); // <-- } - if( (pSetParent)->Count() ) - pStates[i] = rPropSet.getPropertyState( *pEntry, *pSetParent ); - else - pStates[i] = PropertyState_DEFAULT_VALUE; + pStates[i] = ( (pSetParent)->Count() ) + ? rPropSet.getPropertyState( *pEntry, *pSetParent ) + : beans::PropertyState_DEFAULT_VALUE; } } } } - delete pSet; - delete pSetParent; return aRet; } /* -----------------------------03.05.00 13:17-------------------------------- ---------------------------------------------------------------------------*/ -PropertyState SwXTextCursor::GetPropertyState( - SwPaM& rPaM, const SfxItemPropertySet& rPropSet, const OUString& rPropertyName) - throw(UnknownPropertyException, RuntimeException) +beans::PropertyState SwUnoCursorHelper::GetPropertyState( + SwPaM& rPaM, const SfxItemPropertySet& rPropSet, + const OUString& rPropertyName) +throw (beans::UnknownPropertyException, uno::RuntimeException) { - Sequence < OUString > aStrings ( 1 ); + uno::Sequence< OUString > aStrings ( 1 ); aStrings[0] = rPropertyName; - Sequence < PropertyState > aSeq = GetPropertyStates( rPaM, rPropSet, aStrings, SW_PROPERTY_STATE_CALLER_SINGLE_VALUE_ONLY ); + uno::Sequence< beans::PropertyState > aSeq = + GetPropertyStates(rPaM, rPropSet, aStrings, + SW_PROPERTY_STATE_CALLER_SINGLE_VALUE_ONLY ); return aSeq[0]; } /* -----------------------------03.05.00 13:20-------------------------------- ---------------------------------------------------------------------------*/ -void lcl_SelectParaAndReset ( SwPaM &rPaM, SwDoc* pDoc, const SvUShortsSort* pWhichIds = 0 ) +static void +lcl_SelectParaAndReset( SwPaM &rPaM, SwDoc & rDoc, + SvUShortsSort const*const pWhichIds = 0 ) { // if we are reseting paragraph attributes, we need to select the full paragraph first SwPosition aStart = *rPaM.Start(); SwPosition aEnd = *rPaM.End(); - auto_ptr < SwUnoCrsr > pTemp ( pDoc->CreateUnoCrsr(aStart, FALSE) ); + ::std::auto_ptr< SwUnoCrsr > pTemp ( rDoc.CreateUnoCrsr(aStart, FALSE) ); if(!SwUnoCursorHelper::IsStartOfPara(*pTemp)) + { pTemp->MovePara(fnParaCurr, fnParaStart); + } pTemp->SetMark(); *pTemp->GetPoint() = aEnd; - SwXTextCursor::SelectPam(*pTemp, sal_True); + SwUnoCursorHelper::SelectPam(*pTemp, true); if(!SwUnoCursorHelper::IsEndOfPara(*pTemp)) + { pTemp->MovePara(fnParaCurr, fnParaEnd); - pDoc->ResetAttrs(*pTemp, sal_True, pWhichIds); + } + rDoc.ResetAttrs(*pTemp, sal_True, pWhichIds); } -void SwXTextCursor::SetPropertyToDefault( +void SwUnoCursorHelper::SetPropertyToDefault( SwPaM& rPaM, const SfxItemPropertySet& rPropSet, const OUString& rPropertyName) - throw(UnknownPropertyException, RuntimeException) +throw (beans::UnknownPropertyException, uno::RuntimeException) { - NAMESPACE_VOS(OGuard) aGuard(Application::GetSolarMutex()); - SwDoc* pDoc = rPaM.GetDoc(); - const SfxItemPropertySimpleEntry* pEntry = rPropSet.getPropertyMap()->getByName( rPropertyName); - if(pEntry) + SwDoc & rDoc = *rPaM.GetDoc(); + SfxItemPropertySimpleEntry const*const pEntry = + rPropSet.getPropertyMap()->getByName(rPropertyName); + if (!pEntry) + { + throw beans::UnknownPropertyException( + OUString(RTL_CONSTASCII_USTRINGPARAM("Unknown property: ")) + + rPropertyName, static_cast(0)); + } + + if (pEntry->nFlags & beans::PropertyAttribute::READONLY) + { + throw uno::RuntimeException(OUString(RTL_CONSTASCII_USTRINGPARAM( + "setPropertyToDefault: property is read-only: ")) + + rPropertyName, 0); + } + + if (pEntry->nWID < RES_FRMATR_END) { - if ( pEntry->nFlags & PropertyAttribute::READONLY) - throw RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "setPropertyToDefault: property is read-only: " ) ) + rPropertyName, 0 ); - if(pEntry->nWID < RES_FRMATR_END) + SvUShortsSort aWhichIds; + aWhichIds.Insert(pEntry->nWID); + if (pEntry->nWID < RES_PARATR_BEGIN) { - SvUShortsSort aWhichIds; - aWhichIds.Insert(pEntry->nWID); - if(pEntry->nWID < RES_PARATR_BEGIN) - pDoc->ResetAttrs(rPaM, sal_True, &aWhichIds); - else - lcl_SelectParaAndReset ( rPaM, pDoc, &aWhichIds ); + rDoc.ResetAttrs(rPaM, sal_True, &aWhichIds); } else - SwUnoCursorHelper::resetCrsrPropertyValue(*pEntry, rPaM); + { + lcl_SelectParaAndReset ( rPaM, rDoc, &aWhichIds ); + } } else - throw UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( 0 ) ); + { + SwUnoCursorHelper::resetCrsrPropertyValue(*pEntry, rPaM); + } } + /* -----------------------------03.05.00 13:19-------------------------------- ---------------------------------------------------------------------------*/ -Any SwXTextCursor::GetPropertyDefault( +uno::Any SwUnoCursorHelper::GetPropertyDefault( SwPaM& rPaM, const SfxItemPropertySet& rPropSet, const OUString& rPropertyName) - throw( UnknownPropertyException, WrappedTargetException, RuntimeException) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { - Any aRet; - SwDoc* pDoc = rPaM.GetDoc(); - const SfxItemPropertySimpleEntry* pEntry = rPropSet.getPropertyMap()->getByName( rPropertyName); - if(pEntry) + SfxItemPropertySimpleEntry const*const pEntry = + rPropSet.getPropertyMap()->getByName(rPropertyName); + if (!pEntry) { - if(pEntry->nWID < RES_FRMATR_END) - { - const SfxPoolItem& rDefItem = pDoc->GetAttrPool().GetDefaultItem(pEntry->nWID); - rDefItem.QueryValue(aRet, pEntry->nMemberId); - } + throw beans::UnknownPropertyException( + OUString(RTL_CONSTASCII_USTRINGPARAM("Unknown property: ")) + + rPropertyName, static_cast(0)); + } + + uno::Any aRet; + if (pEntry->nWID < RES_FRMATR_END) + { + SwDoc & rDoc = *rPaM.GetDoc(); + const SfxPoolItem& rDefItem = + rDoc.GetAttrPool().GetDefaultItem(pEntry->nWID); + rDefItem.QueryValue(aRet, pEntry->nMemberId); } - else - throw UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( 0 ) ); return aRet; } /*-- 09.12.98 14:18:54--------------------------------------------------- @@ -2276,7 +2419,10 @@ void SwXTextCursor::setPropertyValue(const OUString& rPropertyName, const uno::A pUnoCrsr->SetSkipOverProtectSections(bSet); } else - SetPropertyValue(*pUnoCrsr, *m_pPropSet, rPropertyName, aValue); + { + SwUnoCursorHelper::SetPropertyValue(*pUnoCrsr, + *m_pPropSet, rPropertyName, aValue); + } } else throw uno::RuntimeException(); @@ -2304,7 +2450,10 @@ Any SwXTextCursor::getPropertyValue(const OUString& rPropertyName) aAny.setValue(&bSet, ::getBooleanCppuType()); } else - aAny = GetPropertyValue(*pUnoCrsr, *m_pPropSet, rPropertyName); + { + aAny = SwUnoCursorHelper::GetPropertyValue(*pUnoCrsr, + *m_pPropSet, rPropertyName); + } } else throw uno::RuntimeException(); @@ -2350,7 +2499,8 @@ beans::PropertyState SwXTextCursor::getPropertyState(const OUString& rPropertyNa SwUnoCrsr* pUnoCrsr = GetCrsr(); if(pUnoCrsr) { - eRet = GetPropertyState(*pUnoCrsr, *m_pPropSet, rPropertyName); + eRet = SwUnoCursorHelper::GetPropertyState( + *pUnoCrsr, *m_pPropSet, rPropertyName); } else throw RuntimeException(); @@ -2367,7 +2517,8 @@ uno::Sequence< beans::PropertyState > SwXTextCursor::getPropertyStates( SwUnoCrsr* pUnoCrsr = GetCrsr(); if(!pUnoCrsr) throw RuntimeException(); - return GetPropertyStates(*pUnoCrsr, *m_pPropSet, PropertyNames); + return SwUnoCursorHelper::GetPropertyStates( + *pUnoCrsr, *m_pPropSet, PropertyNames); } /*-- 05.03.99 11:36:12--------------------------------------------------- @@ -2430,7 +2581,7 @@ void SAL_CALL SwXTextCursor::setAllPropertiesToDefault() } } if (aParaWhichIds.Count()) - lcl_SelectParaAndReset( *pUnoCrsr, pUnoCrsr->GetDoc(), &aParaWhichIds ); + lcl_SelectParaAndReset( *pUnoCrsr, *pUnoCrsr->GetDoc(), &aParaWhichIds ); if (aWhichIds.Count() ) pUnoCrsr->GetDoc()->ResetAttrs( *pUnoCrsr, sal_True, &aWhichIds ); } @@ -2479,7 +2630,7 @@ void SAL_CALL SwXTextCursor::setPropertiesToDefault( const Sequence< OUString >& } if ( aParaWhichIds.Count() ) - lcl_SelectParaAndReset ( *pUnoCrsr, pDoc, &aParaWhichIds ); + lcl_SelectParaAndReset ( *pUnoCrsr, *pDoc, &aParaWhichIds ); if (aWhichIds.Count() ) pDoc->ResetAttrs(*pUnoCrsr, sal_True, &aWhichIds); } @@ -2565,7 +2716,7 @@ throw (lang::IllegalArgumentException, io::IOException, ---------------------------------------------------------------------------*/ uno::Sequence< beans::PropertyValue > -SwXTextCursor::createSortDescriptor(sal_Bool bFromTable) +SwUnoCursorHelper::CreateSortDescriptor(const bool bFromTable) { uno::Sequence< beans::PropertyValue > aRet(5); beans::PropertyValue* pArray = aRet.getArray(); @@ -2575,10 +2726,7 @@ SwXTextCursor::createSortDescriptor(sal_Bool bFromTable) pArray[0] = beans::PropertyValue(C2U("IsSortInTable"), -1, aVal, beans::PropertyState_DIRECT_VALUE); - String sSpace(String::CreateFromAscii(" ")); - sal_Unicode uSpace = sSpace.GetChar(0); - - aVal <<= uSpace; + aVal <<= sal_Unicode(' '); pArray[1] = beans::PropertyValue(C2U("Delimiter"), -1, aVal, beans::PropertyState_DIRECT_VALUE); @@ -2593,15 +2741,17 @@ SwXTextCursor::createSortDescriptor(sal_Bool bFromTable) uno::Sequence< table::TableSortField > aFields(3); table::TableSortField* pFields = aFields.getArray(); - Locale aLang( SvxCreateLocale( LANGUAGE_SYSTEM ) ); + lang::Locale aLang( SvxCreateLocale( LANGUAGE_SYSTEM ) ); // get collator algorithm to be used for the locale uno::Sequence< OUString > aSeq( GetAppCollator().listCollatorAlgorithms( aLang ) ); - INT32 nLen = aSeq.getLength(); + const sal_Int32 nLen = aSeq.getLength(); DBG_ASSERT( nLen > 0, "list of collator algorithms is empty!"); OUString aCollAlg; if (nLen > 0) + { aCollAlg = aSeq.getConstArray()[0]; + } #if OSL_DEBUG_LEVEL > 1 const OUString *pTxt = aSeq.getConstArray(); @@ -2643,13 +2793,14 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SwXTextCursor::createSortDescriptor() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - return SwXTextCursor::createSortDescriptor(sal_False); + + return SwUnoCursorHelper::CreateSortDescriptor(false); } /* -----------------------------15.12.00 14:06-------------------------------- ---------------------------------------------------------------------------*/ -sal_Bool SwXTextCursor::convertSortProperties( +sal_Bool SwUnoCursorHelper::ConvertSortProperties( const uno::Sequence< beans::PropertyValue >& rDescriptor, SwSortOptions& rSortOpt) { @@ -2679,14 +2830,14 @@ sal_Bool SwXTextCursor::convertSortProperties( sal_Bool bOldSortdescriptor(sal_False); sal_Bool bNewSortdescriptor(sal_False); - for (int n = 0; n < rDescriptor.getLength(); ++n) + for (sal_Int32 n = 0; n < rDescriptor.getLength(); ++n) { uno::Any aValue( pProperties[n].Value ); // String sPropName = pProperties[n].Name; const OUString& rPropName = pProperties[n].Name; // old and new sortdescriptor - if (COMPARE_EQUAL == rPropName.compareToAscii("IsSortInTable")) + if (rPropName.equalsAscii("IsSortInTable")) { if (aValue.getValueType() == ::getBooleanCppuType()) { @@ -2697,7 +2848,7 @@ sal_Bool SwXTextCursor::convertSortProperties( bRet = sal_False; } } - else if (COMPARE_EQUAL == rPropName.compareToAscii("Delimiter")) + else if (rPropName.equalsAscii("Delimiter")) { sal_Unicode uChar = sal_Unicode(); if (aValue >>= uChar) @@ -2710,12 +2861,12 @@ sal_Bool SwXTextCursor::convertSortProperties( } } // old sortdescriptor - else if (COMPARE_EQUAL == rPropName.compareToAscii("SortColumns")) + else if (rPropName.equalsAscii("SortColumns")) { bOldSortdescriptor = sal_True; - if (aValue.getValueType() == ::getBooleanCppuType()) + sal_Bool bTemp(sal_False); + if (aValue >>= bTemp) { - sal_Bool bTemp = *(sal_Bool*)aValue.getValue(); rSortOpt.eDirection = bTemp ? SRT_COLUMNS : SRT_ROWS; } else @@ -2723,12 +2874,12 @@ sal_Bool SwXTextCursor::convertSortProperties( bRet = sal_False; } } - else if (COMPARE_EQUAL == rPropName.compareToAscii("IsCaseSensitive")) + else if ( rPropName.equalsAscii("IsCaseSensitive")) { bOldSortdescriptor = sal_True; - if (aValue.getValueType() == ::getBooleanCppuType()) + sal_Bool bTemp(sal_False); + if (aValue >>= bTemp) { - sal_Bool bTemp = *(sal_Bool*)aValue.getValue(); rSortOpt.bIgnoreCase = !bTemp; } else @@ -2736,10 +2887,10 @@ sal_Bool SwXTextCursor::convertSortProperties( bRet = sal_False; } } - else if (COMPARE_EQUAL == rPropName.compareToAscii("CollatorLocale")) + else if (rPropName.equalsAscii("CollatorLocale")) { bOldSortdescriptor = sal_True; - Locale aLocale; + lang::Locale aLocale; if (aValue >>= aLocale) { rSortOpt.nLanguage = SvxLocaleToLanguage( aLocale ); @@ -2749,8 +2900,7 @@ sal_Bool SwXTextCursor::convertSortProperties( bRet = sal_False; } } - else if (COMPARE_EQUAL == rPropName.compareToAscii("CollatorAlgorithm", - 17) && + else if (rPropName.matchAsciiL("CollatorAlgorithm", 17) && rPropName.getLength() == 18 && (rPropName.getStr()[17] >= '0' && rPropName.getStr()[17] <= '9')) { @@ -2767,8 +2917,7 @@ sal_Bool SwXTextCursor::convertSortProperties( bRet = sal_False; } } - else if (COMPARE_EQUAL == rPropName.compareToAscii("SortRowOrColumnNo", - 17) && + else if (rPropName.matchAsciiL("SortRowOrColumnNo", 17) && rPropName.getLength() == 18 && (rPropName.getStr()[17] >= '0' && rPropName.getStr()[17] <= '9')) { @@ -2826,7 +2975,7 @@ sal_Bool SwXTextCursor::convertSortProperties( } } // new sortdescriptor - else if (COMPARE_EQUAL == rPropName.compareToAscii("IsSortColumns")) + else if (rPropName.equalsAscii("IsSortColumns")) { bNewSortdescriptor = sal_True; if (aValue.getValueType() == ::getBooleanCppuType()) @@ -2839,7 +2988,7 @@ sal_Bool SwXTextCursor::convertSortProperties( bRet = sal_False; } } - else if (COMPARE_EQUAL == rPropName.compareToAscii("SortFields")) + else if (rPropName.equalsAscii("SortFields")) { bNewSortdescriptor = sal_True; uno::Sequence < table::TableSortField > aFields; @@ -2917,7 +3066,7 @@ throw (uno::RuntimeException) if (pUnoCrsr->HasMark()) { - if (!SwXTextCursor::convertSortProperties(rDescriptor, aSortOpt)) + if (!SwUnoCursorHelper::ConvertSortProperties(rDescriptor, aSortOpt)) { throw uno::RuntimeException(); } diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index a71fe16f7024..84d276e6618e 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -80,7 +80,6 @@ #include #include #include -#include #include #include #include @@ -132,14 +131,6 @@ using namespace ::com::sun::star; -using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::lang; -using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::text; -using namespace ::com::sun::star::container; -using namespace ::com::sun::star::beans; -using namespace ::com::sun::star::drawing; - using ::rtl::OUString; @@ -359,28 +350,29 @@ void ClientModify(SwClient* pClient, SfxPoolItem *pOld, SfxPoolItem *pNew) /*-- 09.12.98 14:19:03--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXTextCursor::SetCrsrAttr(SwPaM& rPam, const SfxItemSet& rSet, USHORT nAttrMode) +void SwUnoCursorHelper::SetCrsrAttr(SwPaM & rPam, + const SfxItemSet& rSet, + const SetAttrMode nAttrMode, const bool bTableMode) { - sal_uInt16 nFlags = nsSetAttrMode::SETATTR_APICALL | (nAttrMode & nsSetAttrMode::SETATTR_NOFORMATATTR); - if(nAttrMode & CRSR_ATTR_MODE_DONTREPLACE) - nFlags |= nsSetAttrMode::SETATTR_DONTREPLACE; + const SetAttrMode nFlags = nAttrMode | nsSetAttrMode::SETATTR_APICALL; SwDoc* pDoc = rPam.GetDoc(); //StartEndAction UnoActionContext aAction(pDoc); - SwPaM* pCrsr = &rPam; - if( pCrsr->GetNext() != pCrsr ) // Ring von Cursorn + if (rPam.GetNext() != &rPam) // Ring of Cursors { pDoc->StartUndo(UNDO_INSATTR, NULL); - SwPaM *_pStartCrsr = &rPam; + SwPaM *pCurrent = &rPam; do { - if( _pStartCrsr->HasMark() && ( (CRSR_ATTR_MODE_TABLE & nAttrMode) || - *_pStartCrsr->GetPoint() != *_pStartCrsr->GetMark() )) + if (pCurrent->HasMark() && + ( (bTableMode) || + (*pCurrent->GetPoint() != *pCurrent->GetMark()) )) { - pDoc->InsertItemSet(*_pStartCrsr, rSet, nFlags); + pDoc->InsertItemSet(*pCurrent, rSet, nFlags); } - } while( (_pStartCrsr=(SwPaM *)_pStartCrsr->GetNext()) != &rPam ); + pCurrent= static_cast(pCurrent->GetNext()); + } while (pCurrent != &rPam); pDoc->EndUndo(UNDO_INSATTR, NULL); } @@ -388,7 +380,7 @@ void SwXTextCursor::SetCrsrAttr(SwPaM& rPam, const SfxItemSet& rSet, USHORT nAtt { // if( !HasSelection() ) // UpdateAttr(); - pDoc->InsertItemSet( *pCrsr, rSet, nFlags ); + pDoc->InsertItemSet( rPam, rSet, nFlags ); } //#outline level,add by zhaojianwei if( rSet.GetItemState( RES_PARATR_OUTLINELEVEL, false ) >= SFX_ITEM_AVAILABLE ) @@ -398,7 +390,6 @@ void SwXTextCursor::SetCrsrAttr(SwPaM& rPam, const SfxItemSet& rSet, USHORT nAtt { rPam.GetDoc()->GetNodes().UpdateOutlineNode( *pTmpNode ); } - } //<-end,zhaojianwei } @@ -408,72 +399,72 @@ void SwXTextCursor::SetCrsrAttr(SwPaM& rPam, const SfxItemSet& rSet, USHORT nAtt // --> OD 2006-07-12 #i63870# // split third parameter into new parameters // and to get better control about resulting -void SwXTextCursor::GetCrsrAttr( SwPaM& rPam, - SfxItemSet& rSet, - BOOL bOnlyTxtAttr, - BOOL bGetFromChrFmt ) +void SwUnoCursorHelper::GetCrsrAttr(SwPaM & rPam, + SfxItemSet & rSet, const bool bOnlyTxtAttr, const bool bGetFromChrFmt) { static const sal_uInt16 nMaxLookup = 1000; SfxItemSet aSet( *rSet.GetPool(), rSet.GetRanges() ); SfxItemSet *pSet = &rSet; - SwPaM *_pStartCrsr = &rPam; + SwPaM *pCurrent = & rPam; do { - ULONG nSttNd = _pStartCrsr->GetMark()->nNode.GetIndex(), - nEndNd = _pStartCrsr->GetPoint()->nNode.GetIndex(); - xub_StrLen nSttCnt = _pStartCrsr->GetMark()->nContent.GetIndex(), - nEndCnt = _pStartCrsr->GetPoint()->nContent.GetIndex(); - - if( nSttNd > nEndNd || ( nSttNd == nEndNd && nSttCnt > nEndCnt )) - { - sal_uInt32 nTmp = nSttNd; nSttNd = nEndNd; nEndNd = nTmp; - nTmp = nSttCnt; nSttCnt = nEndCnt; nEndCnt = (sal_uInt16)nTmp; - } + SwPosition const & rStart( *pCurrent->Start() ); + SwPosition const & rEnd( *pCurrent->End() ); + const ULONG nSttNd = rStart.nNode.GetIndex(); + const ULONG nEndNd = rEnd .nNode.GetIndex(); - if( nEndNd - nSttNd >= nMaxLookup ) - { - rSet.ClearItem(); - rSet.InvalidateAllItems(); - return;// uno::Any(); - } + if (nEndNd - nSttNd >= nMaxLookup) + { + rSet.ClearItem(); + rSet.InvalidateAllItems(); + return;// uno::Any(); + } - // beim 1.Node traegt der Node die Werte in den GetSet ein (Initial) - // alle weiteren Nodes werden zum GetSet zu gemergt - for( ULONG n = nSttNd; n <= nEndNd; ++n ) + // the first node inserts the values into the get set + // all other nodes merge their values into the get set + for (ULONG n = nSttNd; n <= nEndNd; ++n) + { + SwNode *const pNd = rPam.GetDoc()->GetNodes()[ n ]; + switch (pNd->GetNodeType()) { - SwNode* pNd = rPam.GetDoc()->GetNodes()[ n ]; - switch( pNd->GetNodeType() ) - { case ND_TEXTNODE: - { - xub_StrLen nStt = n == nSttNd ? nSttCnt : 0, - nEnd = n == nEndNd ? nEndCnt - : ((SwTxtNode*)pNd)->GetTxt().Len(); - ((SwTxtNode*)pNd)->GetAttr( *pSet, nStt, nEnd, bOnlyTxtAttr, bGetFromChrFmt ); - } - break; + { + const xub_StrLen nStart = (n == nSttNd) + ? rStart.nContent.GetIndex() : 0; + const xub_StrLen nEnd = (n == nEndNd) + ? rEnd.nContent.GetIndex() + : static_cast(pNd)->GetTxt().Len(); + static_cast(pNd)->GetAttr( + *pSet, nStart, nEnd, bOnlyTxtAttr, bGetFromChrFmt); + } + break; case ND_GRFNODE: case ND_OLENODE: - ((SwCntntNode*)pNd)->GetAttr( *pSet ); - break; + static_cast(pNd)->GetAttr( *pSet ); + break; default: - pNd = 0; - } - - if( pNd ) - { - if( pSet != &rSet ) - rSet.MergeValues( aSet ); - - if( aSet.Count() ) - aSet.ClearItem(); + continue; // skip this node + } - } + if (pSet != &rSet) + { + rSet.MergeValues( aSet ); + } + else + { pSet = &aSet; } - } while( (_pStartCrsr=(SwPaM *)_pStartCrsr->GetNext()) != &rPam ); + + if (aSet.Count()) + { + aSet.ClearItem(); + } + } + pCurrent= static_cast(pCurrent->GetNext()); + } while ( pCurrent != &rPam ); } + /****************************************************************** * SwXParagraphEnumeration ******************************************************************/ @@ -967,7 +958,7 @@ throw (uno::RuntimeException) SwUnoCursorHelper::DocInsertStringSplitCR( m_pImpl->m_rDoc, aCursor, rText, bForceExpandHints); - SwXTextCursor::SelectPam(aCursor, sal_True); + SwUnoCursorHelper::SelectPam(aCursor, true); aCursor.Left(rText.getLength(), CRSR_SKIP_CHARS, FALSE, FALSE); } SetPositions(aCursor); @@ -1111,7 +1102,7 @@ OUString SAL_CALL SwXTextRange::getString() throw (uno::RuntimeException) SwPaM aPaM(GetDoc()->GetNodes()); if (GetPositions(aPaM) && aPaM.HasMark()) { - SwXTextCursor::getTextFromPam(aPaM, sRet); + SwUnoCursorHelper::GetTextFromPam(aPaM, sRet); } return sRet; } @@ -1488,7 +1479,7 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException, } SwPaM aPaM(GetDoc()->GetNodes()); GetPositions(aPaM); - SwXTextCursor::SetPropertyValue(aPaM, m_pImpl->m_rPropSet, + SwUnoCursorHelper::SetPropertyValue(aPaM, m_pImpl->m_rPropSet, rPropertyName, rValue); } @@ -1505,7 +1496,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, } SwPaM aPaM(GetDoc()->GetNodes()); GetPositions(aPaM); - return SwXTextCursor::GetPropertyValue(aPaM, m_pImpl->m_rPropSet, + return SwUnoCursorHelper::GetPropertyValue(aPaM, m_pImpl->m_rPropSet, rPropertyName); } @@ -1565,7 +1556,7 @@ throw (beans::UnknownPropertyException, uno::RuntimeException) } SwPaM aPaM(GetDoc()->GetNodes()); GetPositions(aPaM); - return SwXTextCursor::GetPropertyState(aPaM, m_pImpl->m_rPropSet, + return SwUnoCursorHelper::GetPropertyState(aPaM, m_pImpl->m_rPropSet, rPropertyName); } @@ -1581,7 +1572,7 @@ throw (beans::UnknownPropertyException, uno::RuntimeException) } SwPaM aPaM(GetDoc()->GetNodes()); GetPositions(aPaM); - return SwXTextCursor::GetPropertyStates(aPaM, m_pImpl->m_rPropSet, + return SwUnoCursorHelper::GetPropertyStates(aPaM, m_pImpl->m_rPropSet, rPropertyName); } @@ -1596,7 +1587,7 @@ throw (beans::UnknownPropertyException, uno::RuntimeException) } SwPaM aPaM(GetDoc()->GetNodes()); GetPositions(aPaM); - SwXTextCursor::SetPropertyToDefault(aPaM, m_pImpl->m_rPropSet, + SwUnoCursorHelper::SetPropertyToDefault(aPaM, m_pImpl->m_rPropSet, rPropertyName); } @@ -1613,7 +1604,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, } SwPaM aPaM(GetDoc()->GetNodes()); GetPositions(aPaM); - return SwXTextCursor::GetPropertyDefault(aPaM, m_pImpl->m_rPropSet, + return SwUnoCursorHelper::GetPropertyDefault(aPaM, m_pImpl->m_rPropSet, rPropertyName); } @@ -1834,24 +1825,25 @@ sal_Bool SAL_CALL SwXTextRanges::hasElements() throw (uno::RuntimeException) /* -----------------11.12.98 10:07------------------- * * --------------------------------------------------*/ -void SwXTextCursor::SetString(SwCursor& rCrsr, const OUString& rString) +void SwUnoCursorHelper::SetString(SwCursor & rCursor, const OUString& rString) { // Start/EndAction - SwDoc* pDoc = rCrsr.GetDoc(); + SwDoc *const pDoc = rCursor.GetDoc(); UnoActionContext aAction(pDoc); - String aText(rString); - xub_StrLen nTxtLen = aText.Len(); pDoc->StartUndo(UNDO_INSERT, NULL); - if(rCrsr.HasMark()) - pDoc->DeleteAndJoin(rCrsr); - if(nTxtLen) + if (rCursor.HasMark()) + { + pDoc->DeleteAndJoin(rCursor); + } + if (rString.getLength()) { + String aText(rString); const bool bSuccess( SwUnoCursorHelper::DocInsertStringSplitCR( - *pDoc, rCrsr, aText, false ) ); + *pDoc, rCursor, aText, false ) ); DBG_ASSERT( bSuccess, "DocInsertStringSplitCR" ); (void) bSuccess; - SwXTextCursor::SelectPam(rCrsr, sal_True); - rCrsr.Left(nTxtLen, CRSR_SKIP_CHARS, FALSE, FALSE); + SwUnoCursorHelper::SelectPam(rCursor, true); + rCursor.Left(rString.getLength(), CRSR_SKIP_CHARS, FALSE, FALSE); } pDoc->EndUndo(UNDO_INSERT, NULL); } diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx index 17336d80f64c..8d6ee3f3a65d 100644 --- a/sw/source/core/unocore/unoparagraph.cxx +++ b/sw/source/core/unocore/unoparagraph.cxx @@ -37,7 +37,6 @@ #include #include #include -#include #include #include #include @@ -457,7 +456,7 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException, + pPropertyNames[nProp], static_cast< cppu::OWeakObject * >(&m_rThis)); } - SwXTextCursor::SetPropertyValue(aCursor, m_rPropSet, + SwUnoCursorHelper::SetPropertyValue(aCursor, m_rPropSet, pPropertyNames[nProp], pValues[nProp]); } } @@ -659,7 +658,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException) } else { - SwXTextCursor::SetPropertyValue( + SwUnoCursorHelper::SetPropertyValue( aCursor, m_pImpl->m_rPropSet, pProp[i], pValue[i]); } } @@ -973,7 +972,7 @@ throw (beans::UnknownPropertyException) case FN_UNO_PARA_STYLE: case FN_UNO_PARA_CONDITIONAL_STYLE_NAME: { - SwFmtColl* pFmt = SwXTextCursor::GetCurTxtFmtColl( + SwFmtColl* pFmt = SwUnoCursorHelper::GetCurTxtFmtColl( aPam, rEntry.nWID == FN_UNO_PARA_CONDITIONAL_STYLE_NAME); eRet = pFmt ? beans::PropertyState_DIRECT_VALUE : beans::PropertyState_AMBIGUOUS_VALUE; @@ -1132,7 +1131,7 @@ throw (beans::UnknownPropertyException, uno::RuntimeException) pTemp->SetMark(); *pTemp->GetPoint() = aEnd; //pTemp->Exchange(); - SwXTextCursor::SelectPam(*pTemp, sal_True); + SwUnoCursorHelper::SelectPam(*pTemp, true); if (!SwUnoCursorHelper::IsEndOfPara(*pTemp)) { pTemp->MovePara(fnParaCurr, fnParaEnd); @@ -1365,7 +1364,7 @@ OUString SAL_CALL SwXParagraph::getString() throw (uno::RuntimeException) SwPosition aPos( *pTxtNode ); SwCursor aCursor( aPos, 0, false ); SwParaSelection aParaSel( aCursor ); - SwXTextCursor::getTextFromPam(aCursor, aRet); + SwUnoCursorHelper::GetTextFromPam(aCursor, aRet); } else if (m_pImpl->IsDescriptor()) { @@ -1393,12 +1392,12 @@ throw (uno::RuntimeException) if (!SwUnoCursorHelper::IsStartOfPara(aCursor)) { aCursor.MovePara(fnParaCurr, fnParaStart); } - SwXTextCursor::SelectPam(aCursor, sal_True); + SwUnoCursorHelper::SelectPam(aCursor, true); if (pTxtNode->GetTxt().Len()) { aCursor.MovePara(fnParaCurr, fnParaEnd); } - SwXTextCursor::SetString(aCursor, aString); - SwXTextCursor::SelectPam(aCursor, sal_False); + SwUnoCursorHelper::SetString(aCursor, aString); + SwUnoCursorHelper::SelectPam(aCursor, false); } else if (m_pImpl->IsDescriptor()) { diff --git a/sw/source/core/unocore/unoport.cxx b/sw/source/core/unocore/unoport.cxx index 909c7bc7a450..55f8754d34b1 100644 --- a/sw/source/core/unocore/unoport.cxx +++ b/sw/source/core/unocore/unoport.cxx @@ -41,7 +41,6 @@ #include #include #include -#include #include #include #include @@ -241,7 +240,7 @@ void SwXTextPortion::setString(const OUString& aString) throw( uno::RuntimeExcep if (!pUnoCrsr) throw uno::RuntimeException(); - SwXTextCursor::SetString(*pUnoCrsr, aString); + SwUnoCursorHelper::SetString(*pUnoCrsr, aString); } /*-- 11.12.98 09:56:57--------------------------------------------------- @@ -275,7 +274,7 @@ void SwXTextPortion::setPropertyValue(const OUString& rPropertyName, if (!pUnoCrsr) throw uno::RuntimeException(); - SwXTextCursor::SetPropertyValue(*pUnoCrsr, *m_pPropSet, + SwUnoCursorHelper::SetPropertyValue(*pUnoCrsr, *m_pPropSet, rPropertyName, aValue); } /*-- 04.11.03 09:56:58--------------------------------------------------- @@ -426,7 +425,7 @@ void SwXTextPortion::GetPropertyValue( RES_UNKNOWNATR_CONTAINER, RES_UNKNOWNATR_CONTAINER, RES_TXTATR_UNKNOWN_CONTAINER, RES_TXTATR_UNKNOWN_CONTAINER, 0L); - SwXTextCursor::GetCrsrAttr(*pUnoCrsr, *pSet); + SwUnoCursorHelper::GetCrsrAttr(*pUnoCrsr, *pSet); } m_pPropSet->getPropertyValue(rEntry, *pSet, rVal); } @@ -503,7 +502,7 @@ void SAL_CALL SwXTextPortion::SetPropertyValues_Impl( if ( pEntry->nFlags & beans::PropertyAttribute::READONLY) throw beans::PropertyVetoException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only: " ) ) + pPropertyNames[nProp], static_cast < cppu::OWeakObject * > ( this ) ); - SwXTextCursor::SetPropertyValue( *pUnoCrsr, *m_pPropSet, + SwUnoCursorHelper::SetPropertyValue( *pUnoCrsr, *m_pPropSet, pPropertyNames[nProp], pValues[nProp]); } } @@ -606,7 +605,7 @@ uno::Sequence< beans::SetPropertyTolerantFailed > SAL_CALL SwXTextPortion::setPr pFailed[ nFailed++ ].Result = beans::TolerantPropertySetResultType::PROPERTY_VETO; else { - SwXTextCursor::SetPropertyValue( + SwUnoCursorHelper::SetPropertyValue( *pUnoCrsr, *m_pPropSet, pProp[i], pValue[i] ); } } @@ -683,7 +682,8 @@ uno::Sequence< beans::GetDirectPropertyTolerantResult > SAL_CALL SwXTextPortion: const SfxItemPropertyMap* pPropMap = m_pPropSet->getPropertyMap(); - uno::Sequence< beans::PropertyState > aPropertyStates = SwXTextCursor::GetPropertyStates( + uno::Sequence< beans::PropertyState > aPropertyStates = + SwUnoCursorHelper::GetPropertyStates( *pUnoCrsr, *m_pPropSet, rPropertyNames, SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION_TOLERANT ); @@ -832,7 +832,7 @@ beans::PropertyState SwXTextPortion::getPropertyState(const OUString& rPropertyN } else { - eRet = SwXTextCursor::GetPropertyState(*pUnoCrsr, *m_pPropSet, + eRet = SwUnoCursorHelper::GetPropertyState(*pUnoCrsr, *m_pPropSet, rPropertyName); } return eRet; @@ -850,7 +850,7 @@ uno::Sequence< beans::PropertyState > SwXTextPortion::getPropertyStates( throw uno::RuntimeException(); uno::Sequence< beans::PropertyState > aRet = - SwXTextCursor::GetPropertyStates(*pUnoCrsr, *m_pPropSet, + SwUnoCursorHelper::GetPropertyStates(*pUnoCrsr, *m_pPropSet, rPropertyNames, SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION); if(GetTextPortionType() == PORTION_RUBY_START) @@ -876,7 +876,8 @@ void SwXTextPortion::setPropertyToDefault(const OUString& rPropertyName) if (!pUnoCrsr) throw uno::RuntimeException(); - SwXTextCursor::SetPropertyToDefault(*pUnoCrsr, *m_pPropSet, rPropertyName); + SwUnoCursorHelper::SetPropertyToDefault( + *pUnoCrsr, *m_pPropSet, rPropertyName); } /*-- 08.03.99 09:41:48--------------------------------------------------- @@ -890,7 +891,7 @@ uno::Any SwXTextPortion::getPropertyDefault(const OUString& rPropertyName) if (!pUnoCrsr) throw uno::RuntimeException(); - aRet = SwXTextCursor::GetPropertyDefault(*pUnoCrsr, *m_pPropSet, + aRet = SwUnoCursorHelper::GetPropertyDefault(*pUnoCrsr, *m_pPropSet, rPropertyName); return aRet; } diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx index 605554253bf8..e780e95c361e 100644 --- a/sw/source/core/unocore/unoportenum.cxx +++ b/sw/source/core/unocore/unoportenum.cxx @@ -48,7 +48,7 @@ #include #include #include -#include +#include #include #include #include @@ -1150,7 +1150,7 @@ lcl_CreatePortions( // text at nCurrentIndex; i.e. it must be set _once_ per iteration uno::Reference< XTextRange > xRef; - SwXTextCursor::SelectPam(*pUnoCrsr, sal_True); // set mark + SwUnoCursorHelper::SelectPam(*pUnoCrsr, true); // set mark const sal_Int32 nFirstFrameIndex = lcl_ExportFrames( *PortionStack.top().first, diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx index d9d6bafa31a1..fbe7e6e7eb5d 100644 --- a/sw/source/core/unocore/unosect.cxx +++ b/sw/source/core/unocore/unosect.cxx @@ -48,7 +48,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index 6143e7ed2661..2806a5984d24 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -109,10 +109,6 @@ using ::rtl::OUString; //----------------------------------------------------------------------------- -// from unoobj.cxx -extern void lcl_SetTxtFmtColl(const uno::Any& rAny, SwPaM& rPaM) throw (lang::IllegalArgumentException); -extern void lcl_setCharStyle(SwDoc* pDoc, const uno::Any aValue, SfxItemSet& rSet) throw (lang::IllegalArgumentException); - // from swtable.cxx extern void lcl_GetTblBoxColStr( sal_uInt16 nCol, String& rNm ); @@ -1854,12 +1850,6 @@ uno::Reference< beans::XPropertySetInfo > SwXTextTableCursor::getPropertySetInf /*-- 11.12.98 12:16:17--------------------------------------------------- -----------------------------------------------------------------------*/ -extern sal_Bool lcl_setCrsrPropertyValue(const SfxItemPropertySimpleEntry* pEntry, - SwPaM& rPam, - SfxItemSet& rSet, - const uno::Any& aValue ) throw (lang::IllegalArgumentException); - - void SwXTextTableCursor::setPropertyValue(const OUString& rPropertyName, const uno::Any& aValue) throw( beans::UnknownPropertyException, @@ -1903,16 +1893,21 @@ void SwXTextTableCursor::setPropertyValue(const OUString& rPropertyName, } break; case FN_UNO_PARA_STYLE: - lcl_SetTxtFmtColl(aValue, *pUnoCrsr); + SwUnoCursorHelper::SetTxtFmtColl(aValue, *pUnoCrsr); break; default: { SfxItemSet aItemSet( pDoc->GetAttrPool(), pEntry->nWID, pEntry->nWID ); - SwXTextCursor::GetCrsrAttr( pTblCrsr->GetSelRing(), aItemSet ); + SwUnoCursorHelper::GetCrsrAttr(pTblCrsr->GetSelRing(), + aItemSet); - if(!lcl_setCrsrPropertyValue( pEntry, pTblCrsr->GetSelRing(), aItemSet, aValue )) - m_pPropSet->setPropertyValue( *pEntry, aValue, aItemSet ); - SwXTextCursor::SetCrsrAttr( pTblCrsr->GetSelRing(), aItemSet, CRSR_ATTR_MODE_TABLE ); + if (!SwUnoCursorHelper::SetCursorPropertyValue( + *pEntry, aValue, pTblCrsr->GetSelRing(), aItemSet)) + { + m_pPropSet->setPropertyValue(*pEntry, aValue, aItemSet); + } + SwUnoCursorHelper::SetCrsrAttr(pTblCrsr->GetSelRing(), + aItemSet, nsSetAttrMode::SETATTR_DEFAULT, true); } } } @@ -1956,7 +1951,8 @@ uno::Any SwXTextTableCursor::getPropertyValue(const OUString& rPropertyName) break; case FN_UNO_PARA_STYLE: { - SwFmtColl* pFmt = SwXTextCursor::GetCurTxtFmtColl(*pUnoCrsr, FALSE); + SwFmtColl *const pFmt = + SwUnoCursorHelper::GetCurTxtFmtColl(*pUnoCrsr, FALSE); OUString sRet; if(pFmt) sRet = pFmt->GetName(); @@ -1970,7 +1966,8 @@ uno::Any SwXTextTableCursor::getPropertyValue(const OUString& rPropertyName) RES_UNKNOWNATR_CONTAINER, RES_UNKNOWNATR_CONTAINER, 0L); // erstmal die Attribute des Cursors - SwXTextCursor::GetCrsrAttr(pTblCrsr->GetSelRing(), aSet); + SwUnoCursorHelper::GetCrsrAttr(pTblCrsr->GetSelRing(), + aSet); m_pPropSet->getPropertyValue(*pEntry, aSet, aRet); } } @@ -3162,7 +3159,8 @@ uno::Sequence< beans::PropertyValue > SwXTextTable::createSortDescriptor(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); - return SwXTextCursor::createSortDescriptor(sal_True); + + return SwUnoCursorHelper::CreateSortDescriptor(true); } /*-- 11.12.98 12:42:49--------------------------------------------------- @@ -3174,7 +3172,7 @@ void SwXTextTable::sort(const uno::Sequence< beans::PropertyValue >& rDescriptor SwSortOptions aSortOpt; SwFrmFmt* pFmt = GetFrmFmt(); if(pFmt && - SwXTextCursor::convertSortProperties(rDescriptor, aSortOpt)) + SwUnoCursorHelper::ConvertSortProperties(rDescriptor, aSortOpt)) { SwTable* pTable = SwTable::FindTable( pFmt ); SwSelBoxes aBoxes; @@ -4157,11 +4155,16 @@ void SwXCellRange::setPropertyValue(const OUString& rPropertyName, default: { SfxItemSet aItemSet( pDoc->GetAttrPool(), pEntry->nWID, pEntry->nWID ); - SwXTextCursor::GetCrsrAttr( pCrsr->GetSelRing(), aItemSet ); + SwUnoCursorHelper::GetCrsrAttr(pCrsr->GetSelRing(), + aItemSet); - if(!lcl_setCrsrPropertyValue( pEntry, pCrsr->GetSelRing(), aItemSet, aValue )) - m_pPropSet->setPropertyValue(*pEntry, aValue, aItemSet ); - SwXTextCursor::SetCrsrAttr(pCrsr->GetSelRing(), aItemSet, CRSR_ATTR_MODE_TABLE ); + if (!SwUnoCursorHelper::SetCursorPropertyValue( + *pEntry, aValue, pCrsr->GetSelRing(), aItemSet)) + { + m_pPropSet->setPropertyValue(*pEntry, aValue, aItemSet); + } + SwUnoCursorHelper::SetCrsrAttr(pCrsr->GetSelRing(), + aItemSet, nsSetAttrMode::SETATTR_DEFAULT, true); } } } @@ -4214,7 +4217,8 @@ uno::Any SwXCellRange::getPropertyValue(const OUString& rPropertyName) throw( be break; case FN_UNO_PARA_STYLE: { - SwFmtColl* pTmpFmt = SwXTextCursor::GetCurTxtFmtColl(*pTblCrsr, FALSE); + SwFmtColl *const pTmpFmt = + SwUnoCursorHelper::GetCurTxtFmtColl(*pTblCrsr, FALSE); OUString sRet; if(pFmt) sRet = pTmpFmt->GetName(); @@ -4242,7 +4246,7 @@ uno::Any SwXCellRange::getPropertyValue(const OUString& rPropertyName) throw( be 0L); // erstmal die Attribute des Cursors SwUnoTableCrsr* pCrsr = dynamic_cast(pTblCrsr); - SwXTextCursor::GetCrsrAttr(pCrsr->GetSelRing(), aSet); + SwUnoCursorHelper::GetCrsrAttr(pCrsr->GetSelRing(), aSet); m_pPropSet->getPropertyValue(*pEntry, aSet, aRet); } } @@ -4875,7 +4879,8 @@ double SwXCellRange::getNotANumber(void) throw( uno::RuntimeException ) uno::Sequence< beans::PropertyValue > SwXCellRange::createSortDescriptor(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); - return SwXTextCursor::createSortDescriptor(sal_True); + + return SwUnoCursorHelper::CreateSortDescriptor(true); } /*-- 11.12.98 14:27:39--------------------------------------------------- @@ -4887,7 +4892,7 @@ void SAL_CALL SwXCellRange::sort(const uno::Sequence< beans::PropertyValue >& rD SwSortOptions aSortOpt; SwFrmFmt* pFmt = GetFrmFmt(); if(pFmt && - SwXTextCursor::convertSortProperties(rDescriptor, aSortOpt)) + SwUnoCursorHelper::ConvertSortProperties(rDescriptor, aSortOpt)) { SwUnoTableCrsr* pTableCrsr = dynamic_cast(pTblCrsr); pTableCrsr->MakeBoxSels(); diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index 415a3aaf6933..d3eebeae8af5 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -459,7 +459,7 @@ void SwXText::insertControlCharacter(const uno::Reference< text::XTextRange > & } SwCursor aCrsr(*aTmp.GetPoint(),0,false); - SwXTextCursor::SelectPam(aCrsr, sal_True); + SwUnoCursorHelper::SelectPam(aCrsr, true); aCrsr.Left(1, CRSR_SKIP_CHARS, FALSE, FALSE); //hier muss der uebergebene PaM umgesetzt werden: if(pRange) @@ -1359,11 +1359,9 @@ uno::Reference< text::XTextRange > SwXText::finishOrAppendParagraph( { try { - SwXTextCursor::SetPropertyValue( - aPam, - *pParaPropSet, - pValues[nProp].Name, - pValues[nProp].Value); + SwUnoCursorHelper::SetPropertyValue( + aPam, *pParaPropSet, + pValues[nProp].Name, pValues[nProp].Value); } catch( lang::IllegalArgumentException& rIllegal ) { @@ -1448,7 +1446,7 @@ uno::Reference< text::XTextRange > SwXText::appendTextPortion( xub_StrLen nContentPos = pCursor->GetPoint()->nContent.GetIndex(); SwUnoCursorHelper::DocInsertStringSplitCR( *pDoc, *pCursor, rText, false ); - SwXTextCursor::SelectPam(*pCursor, sal_True); + SwUnoCursorHelper::SelectPam(*pCursor, true); pCursor->GetPoint()->nContent = nContentPos; } @@ -1463,12 +1461,10 @@ uno::Reference< text::XTextRange > SwXText::appendTextPortion( { try { - SwXTextCursor::SetPropertyValue( - *pCursor, - *pCursorPropSet, - pValues[nProp].Name, - pValues[nProp].Value, - nsSetAttrMode::SETATTR_NOFORMATATTR); + SwUnoCursorHelper::SetPropertyValue( + *pCursor, *pCursorPropSet, + pValues[nProp].Name, pValues[nProp].Value, + nsSetAttrMode::SETATTR_NOFORMATATTR); } catch( lang::IllegalArgumentException& rIllegal ) { diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx index 6d001b95f378..c83db6909045 100644 --- a/sw/source/ui/uno/unotxvw.cxx +++ b/sw/source/ui/uno/unotxvw.cxx @@ -79,7 +79,7 @@ #include #include #include -#include +#include #include #include @@ -317,8 +317,9 @@ sal_Bool SwXTextView::select(const uno::Any& aInterface) throw( lang::IllegalArg : 0; if(pCursor && pCursor->GetDoc() == GetView()->GetDocShell()->GetDoc()) - pPam = lcl_createPamCopy(*((SwXTextCursor*)pCursor)->GetPaM()); - + { + pPam = lcl_createPamCopy(*pCursor->GetPaM()); + } } else if(xPosN.is() && xIfcTunnel.is() && @@ -1773,7 +1774,7 @@ OUString SwXTextViewCursor::getString(void) throw( uno::RuntimeException ) { SwWrtShell& rSh = m_pView->GetWrtShell(); SwPaM* pShellCrsr = rSh.GetCrsr(); - SwXTextCursor::getTextFromPam(*pShellCrsr, uRet); + SwUnoCursorHelper::GetTextFromPam(*pShellCrsr, uRet); } default:;//prevent warning } @@ -1805,7 +1806,7 @@ void SwXTextViewCursor::setString(const OUString& aString) throw( uno::RuntimeEx { SwWrtShell& rSh = m_pView->GetWrtShell(); SwCursor* pShellCrsr = rSh.GetSwCrsr(); - SwXTextCursor::SetString( *pShellCrsr, aString ); + SwUnoCursorHelper::SetString(*pShellCrsr, aString); } default:;//prevent warning } @@ -1834,7 +1835,10 @@ void SwXTextViewCursor::setPropertyValue( const OUString& rPropertyName, const SwPaM* pShellCrsr = rSh.GetCrsr(); SwNode *pNode = pShellCrsr->GetNode(); if (pNode && pNode->IsTxtNode()) - SwXTextCursor::SetPropertyValue(*pShellCrsr, *m_pPropSet, rPropertyName, aValue ); + { + SwUnoCursorHelper::SetPropertyValue( + *pShellCrsr, *m_pPropSet, rPropertyName, aValue ); + } else throw RuntimeException(); } @@ -1853,7 +1857,8 @@ Any SwXTextViewCursor::getPropertyValue( const OUString& rPropertyName ) { SwWrtShell& rSh = m_pView->GetWrtShell(); SwPaM* pShellCrsr = rSh.GetCrsr(); - aRet = SwXTextCursor::GetPropertyValue( *pShellCrsr, *m_pPropSet, rPropertyName); + aRet = SwUnoCursorHelper::GetPropertyValue( + *pShellCrsr, *m_pPropSet, rPropertyName); } else throw RuntimeException(); @@ -1902,7 +1907,8 @@ PropertyState SwXTextViewCursor::getPropertyState( const OUString& rPropertyNam { SwWrtShell& rSh = m_pView->GetWrtShell(); SwPaM* pShellCrsr = rSh.GetCrsr(); - eState = SwXTextCursor::GetPropertyState( *pShellCrsr, *m_pPropSet, rPropertyName); + eState = SwUnoCursorHelper::GetPropertyState( + *pShellCrsr, *m_pPropSet, rPropertyName); } else throw RuntimeException(); @@ -1920,7 +1926,8 @@ Sequence< PropertyState > SwXTextViewCursor::getPropertyStates( { SwWrtShell& rSh = m_pView->GetWrtShell(); SwPaM* pShellCrsr = rSh.GetCrsr(); - aRet = SwXTextCursor::GetPropertyStates(*pShellCrsr, *m_pPropSet, rPropertyNames); + aRet = SwUnoCursorHelper::GetPropertyStates( + *pShellCrsr, *m_pPropSet, rPropertyNames); } return aRet; } @@ -1935,7 +1942,8 @@ void SwXTextViewCursor::setPropertyToDefault( const OUString& rPropertyName ) { SwWrtShell& rSh = m_pView->GetWrtShell(); SwPaM* pShellCrsr = rSh.GetCrsr(); - SwXTextCursor::SetPropertyToDefault( *pShellCrsr, *m_pPropSet, rPropertyName); + SwUnoCursorHelper::SetPropertyToDefault( + *pShellCrsr, *m_pPropSet, rPropertyName); } } /*-- 29.06.00 17:33:43--------------------------------------------------- @@ -1950,7 +1958,8 @@ Any SwXTextViewCursor::getPropertyDefault( const OUString& rPropertyName ) { SwWrtShell& rSh = m_pView->GetWrtShell(); SwPaM* pShellCrsr = rSh.GetCrsr(); - aRet = SwXTextCursor::GetPropertyDefault( *pShellCrsr, *m_pPropSet, rPropertyName); + aRet = SwUnoCursorHelper::GetPropertyDefault( + *pShellCrsr, *m_pPropSet, rPropertyName); } return aRet; } -- cgit v1.2.3 From 2db8914dbed3ba6148f53d7548c126d92a1f9b90 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:55 +0100 Subject: swunolocking1: #i105557#: SwXParagraph: move static methods to namespace sw. --- sw/inc/unoparagraph.hxx | 3 --- sw/inc/unotextrange.hxx | 3 +++ sw/source/core/unocore/unobkm.cxx | 3 +-- sw/source/core/unocore/unoftn.cxx | 2 +- sw/source/core/unocore/unoidx.cxx | 5 +++-- sw/source/core/unocore/unoparagraph.cxx | 10 +++++----- sw/source/core/unocore/unorefmk.cxx | 3 +-- sw/source/core/unocore/unosect.cxx | 5 ++--- sw/source/core/unocore/unotbl.cxx | 3 ++- 9 files changed, 18 insertions(+), 19 deletions(-) diff --git a/sw/inc/unoparagraph.hxx b/sw/inc/unoparagraph.hxx index b14aeb7dc3d9..add936e9c702 100644 --- a/sw/inc/unoparagraph.hxx +++ b/sw/inc/unoparagraph.hxx @@ -111,9 +111,6 @@ public: /// for SwXText void attachToText(SwXText & rParent, SwTxtNode & rTxtNode); - static bool getDefaultTextContentValue(::com::sun::star::uno::Any& rAny, - const ::rtl::OUString& rPropertyName, USHORT nWID = 0); - // MetadatableMixin virtual ::sfx2::Metadatable* GetCoreObject(); virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > diff --git a/sw/inc/unotextrange.hxx b/sw/inc/unotextrange.hxx index c3c3d362db6b..164b35b703da 100644 --- a/sw/inc/unotextrange.hxx +++ b/sw/inc/unotextrange.hxx @@ -84,6 +84,9 @@ namespace sw { ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > CreateParentXText(SwDoc & rDoc, const SwPosition& rPos); + bool GetDefaultTextContentValue(::com::sun::star::uno::Any& rAny, + const ::rtl::OUString& rPropertyName, USHORT nWID = 0); + } // namespace sw diff --git a/sw/source/core/unocore/unobkm.cxx b/sw/source/core/unocore/unobkm.cxx index ad35f1f28b33..97e90488172a 100644 --- a/sw/source/core/unocore/unobkm.cxx +++ b/sw/source/core/unocore/unobkm.cxx @@ -37,7 +37,6 @@ #include #include -#include #include #include #include @@ -461,7 +460,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, vos::OGuard g(Application::GetSolarMutex()); uno::Any aRet; - if(!SwXParagraph::getDefaultTextContentValue(aRet, rPropertyName)) + if (! ::sw::GetDefaultTextContentValue(aRet, rPropertyName)) { if(rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_LINK_DISPLAY_NAME))) { diff --git a/sw/source/core/unocore/unoftn.cxx b/sw/source/core/unocore/unoftn.cxx index 3d24e282f7c8..4511b455b5c9 100644 --- a/sw/source/core/unocore/unoftn.cxx +++ b/sw/source/core/unocore/unoftn.cxx @@ -526,7 +526,7 @@ uno::Any SwXFootnote::getPropertyValue( const OUString& rPropertyName ) { vos::OGuard aGuard(Application::GetSolarMutex()); uno::Any aRet; - if(!SwXParagraph::getDefaultTextContentValue(aRet, rPropertyName)) + if (! ::sw::GetDefaultTextContentValue(aRet, rPropertyName)) { if(rPropertyName.equalsAsciiL(SW_PROP_NAME(UNO_NAME_START_REDLINE))|| rPropertyName.equalsAsciiL(SW_PROP_NAME(UNO_NAME_END_REDLINE))) diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index 7119f3708711..8fad219d742e 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -57,7 +57,6 @@ #include #include #include -#include #include #include #include @@ -1784,8 +1783,10 @@ uno::Any SwXDocumentIndexMark::getPropertyValue(const OUString& rPropertyName) const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName(rPropertyName); if (!pEntry) throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); - if(SwXParagraph::getDefaultTextContentValue(aRet, rPropertyName, pEntry->nWID)) + if (::sw::GetDefaultTextContentValue(aRet, rPropertyName, pEntry->nWID)) + { return aRet; + } if(pType && m_pTOXMark) { switch(pEntry->nWID) diff --git a/sw/source/core/unocore/unoparagraph.cxx b/sw/source/core/unocore/unoparagraph.cxx index 8d6ee3f3a65d..8b04e34ac84e 100644 --- a/sw/source/core/unocore/unoparagraph.cxx +++ b/sw/source/core/unocore/unoparagraph.cxx @@ -512,8 +512,8 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, + pPropertyNames[nProp], static_cast< cppu::OWeakObject * >(&m_rThis)); } - if (!SwXParagraph::getDefaultTextContentValue( - pValues[nProp], pPropertyNames[nProp], pEntry->nWID)) + if (! ::sw::GetDefaultTextContentValue( + pValues[nProp], pPropertyNames[nProp], pEntry->nWID)) { beans::PropertyState eTemp; const bool bDone = SwUnoCursorHelper::getCrsrPropertyValue( @@ -788,7 +788,7 @@ throw (uno::RuntimeException) // get property value // (compare to SwXParagraph::getPropertyValue(s)) uno::Any aValue; - if (!SwXParagraph::getDefaultTextContentValue( + if (! ::sw::GetDefaultTextContentValue( aValue, pProp[i], pEntry->nWID ) ) { SwPosition aPos( rTxtNode ); @@ -848,7 +848,7 @@ throw (uno::RuntimeException) /* -----------------------------12.09.00 11:09-------------------------------- ---------------------------------------------------------------------------*/ -bool SwXParagraph::getDefaultTextContentValue( +bool ::sw::GetDefaultTextContentValue( uno::Any& rAny, const OUString& rPropertyName, USHORT nWID) { if(!nWID) @@ -1158,7 +1158,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, SwTxtNode & rTxtNode(m_pImpl->GetTxtNodeOrThrow()); uno::Any aRet; - if (SwXParagraph::getDefaultTextContentValue(aRet, rPropertyName)) + if (::sw::GetDefaultTextContentValue(aRet, rPropertyName)) { return aRet; } diff --git a/sw/source/core/unocore/unorefmk.cxx b/sw/source/core/unocore/unorefmk.cxx index a0903b6ea145..6b3ed8e04dd8 100644 --- a/sw/source/core/unocore/unorefmk.cxx +++ b/sw/source/core/unocore/unorefmk.cxx @@ -37,7 +37,6 @@ #include #include #include -#include #include #include #include @@ -510,7 +509,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, { // does not seem to need SolarMutex uno::Any aRet; - if(!SwXParagraph::getDefaultTextContentValue(aRet, rPropertyName)) + if (! ::sw::GetDefaultTextContentValue(aRet, rPropertyName)) { throw beans::UnknownPropertyException(); } diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx index fbe7e6e7eb5d..907a2a617c9b 100644 --- a/sw/source/core/unocore/unosect.cxx +++ b/sw/source/core/unocore/unosect.cxx @@ -47,7 +47,6 @@ #include #include #include -#include #include #include #include @@ -1186,7 +1185,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, case FN_UNO_ANCHOR_TYPES: case FN_UNO_TEXT_WRAP: case FN_UNO_ANCHOR_TYPE: - SwXParagraph::getDefaultTextContentValue( + ::sw::GetDefaultTextContentValue( pRet[nProperty], OUString(), pEntry->nWID); break; case FN_UNO_REDLINE_NODE_START: @@ -1756,7 +1755,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, case FN_UNO_ANCHOR_TYPES: case FN_UNO_TEXT_WRAP: case FN_UNO_ANCHOR_TYPE: - SwXParagraph::getDefaultTextContentValue(aRet, OUString(), pEntry->nWID); + ::sw::GetDefaultTextContentValue(aRet, OUString(), pEntry->nWID); break; default: if(pFmt && pEntry->nWID <= SFX_WHICH_MAX) diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index 2806a5984d24..b75d9dd93c0c 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -3472,7 +3472,8 @@ uno::Any SwXTextTable::getPropertyValue(const OUString& rPropertyName) throw( be case FN_UNO_ANCHOR_TYPES: case FN_UNO_TEXT_WRAP: case FN_UNO_ANCHOR_TYPE: - SwXParagraph::getDefaultTextContentValue(aRet, OUString(), pEntry->nWID); + ::sw::GetDefaultTextContentValue( + aRet, OUString(), pEntry->nWID); break; case FN_UNO_RANGE_ROW_LABEL: { -- cgit v1.2.3 From 8b1fb77c76b7a3c1616af58aac9d8eb8f97c019e Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:55 +0100 Subject: swunolocking1: #i105557#: SwXBodyText: make SwXBodyText::CreateTextCursor() return a pointer, not a UNO reference. --- sw/inc/unotextbodyhf.hxx | 4 +-- sw/source/core/unocore/unotext.cxx | 50 ++++++++++++++++++++------------------ sw/source/ui/uno/unotxdoc.cxx | 15 +++--------- 3 files changed, 33 insertions(+), 36 deletions(-) diff --git a/sw/inc/unotextbodyhf.hxx b/sw/inc/unotextbodyhf.hxx index 8e7a64c18669..baab8bc15845 100644 --- a/sw/inc/unotextbodyhf.hxx +++ b/sw/inc/unotextbodyhf.hxx @@ -45,6 +45,7 @@ class SwDoc; class SwFrmFmt; +class SwXTextCursor; typedef ::cppu::WeakAggImplHelper2 @@ -65,8 +66,7 @@ public: SwXBodyText(SwDoc* pDoc); - ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > - CreateTextCursor(sal_Bool bIgnoreTables = sal_False); + SwXTextCursor * CreateTextCursor(const bool bIgnoreTables = false); // XInterface virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index d3eebeae8af5..72a86050fadf 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -2301,46 +2301,50 @@ throw (uno::RuntimeException) /* -----------------------------05.01.00 11:07-------------------------------- ---------------------------------------------------------------------------*/ -uno::Reference< text::XTextCursor > SwXBodyText::CreateTextCursor(sal_Bool bIgnoreTables) +SwXTextCursor * SwXBodyText::CreateTextCursor(const bool bIgnoreTables) { - uno::Reference< text::XTextCursor > xRet; - if(IsValid()) + if(!IsValid()) { - SwNode& rNode = GetDoc()->GetNodes().GetEndOfContent(); - //the cursor has to skip tables contained in this text - SwPaM aPam(rNode); - aPam.Move( fnMoveBackward, fnGoDoc ); - if(!bIgnoreTables) + return 0; + } + + // the cursor has to skip tables contained in this text + SwPaM aPam(GetDoc()->GetNodes().GetEndOfContent()); + aPam.Move( fnMoveBackward, fnGoDoc ); + if (!bIgnoreTables) + { + SwTableNode * pTblNode = aPam.GetNode()->FindTableNode(); + SwCntntNode * pCont = 0; + while (pTblNode) { - SwTableNode* pTblNode = aPam.GetNode()->FindTableNode(); - SwCntntNode* pCont = 0; - while( pTblNode ) - { - aPam.GetPoint()->nNode = *pTblNode->EndOfSectionNode(); - pCont = GetDoc()->GetNodes().GoNext(&aPam.GetPoint()->nNode); - pTblNode = pCont->FindTableNode(); - } - if(pCont) - aPam.GetPoint()->nContent.Assign(pCont, 0); + aPam.GetPoint()->nNode = *pTblNode->EndOfSectionNode(); + pCont = GetDoc()->GetNodes().GoNext(&aPam.GetPoint()->nNode); + pTblNode = pCont->FindTableNode(); + } + if (pCont) + { + aPam.GetPoint()->nContent.Assign(pCont, 0); } - xRet = (text::XWordCursor*)new SwXTextCursor(this, *aPam.GetPoint(), CURSOR_BODY, GetDoc()); } - return xRet; + return new SwXTextCursor(this, *aPam.GetPoint(), CURSOR_BODY, GetDoc()); } + /*-- 10.12.98 11:17:29--------------------------------------------------- -----------------------------------------------------------------------*/ uno::Reference< text::XTextCursor > SwXBodyText::createTextCursor(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); - uno::Reference< text::XTextCursor > aRef = CreateTextCursor(sal_False); - if(!aRef.is()) + + const uno::Reference< text::XTextCursor > xRef( + static_cast(CreateTextCursor(false)) ); + if (!xRef.is()) { uno::RuntimeException aRuntime; aRuntime.Message = C2U(cInvalidObject); throw aRuntime; } - return aRef; + return xRef; } /*-- 10.12.98 11:17:29--------------------------------------------------- diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index 3bb65ea4e900..374ee9ab0133 100644 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -728,19 +728,12 @@ Reference< util::XReplaceDescriptor > SwXTextDocument::createReplaceDescriptor( SwUnoCrsr* SwXTextDocument::CreateCursorForSearch(Reference< XTextCursor > & xCrsr) { getText(); - XText* pText = xBodyText.get(); + XText *const pText = xBodyText.get(); SwXBodyText* pBText = (SwXBodyText*)pText; - xCrsr = pBText->CreateTextCursor(sal_True); + SwXTextCursor *const pXTextCursor = pBText->CreateTextCursor(true); + xCrsr.set( static_cast(pXTextCursor) ); - Reference xRangeTunnel( xCrsr, UNO_QUERY); - SwXTextCursor* pxUnoCrsr = 0; - if(xRangeTunnel.is()) - { - pxUnoCrsr = reinterpret_cast(xRangeTunnel->getSomething( - SwXTextCursor::getUnoTunnelId())); - } - - SwUnoCrsr* pUnoCrsr = pxUnoCrsr->GetCrsr(); + SwUnoCrsr *const pUnoCrsr = pXTextCursor->GetCrsr(); pUnoCrsr->SetRemainInSection(sal_False); return pUnoCrsr; } -- cgit v1.2.3 From 456e9d587f26b98929d7821b6d9e14d328c024b5 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:55 +0100 Subject: swunolocking1: #i105557#: SwXTextCursor: add Impl struct, and use UnoImplPtr to lock destructor. move all implementation details out of header, into Impl struct. remove ugly destruction of SwUnoCrsr via Application::PostUserEvent. use new XUnoTunnel and XServiceInfo helpers. clean up the implementation a little. --- sw/inc/unotextcursor.hxx | 54 +- sw/source/core/unocore/unoframe.cxx | 14 +- sw/source/core/unocore/unoftn.cxx | 11 +- sw/source/core/unocore/unoobj.cxx | 1884 ++++++++++++----------- sw/source/core/unocore/unoredline.cxx | 15 +- sw/source/core/unocore/unorefmk.cxx | 7 +- sw/source/core/unocore/unotbl.cxx | 13 +- sw/source/core/unocore/unotext.cxx | 28 +- sw/source/filter/xml/XMLRedlineImportHelper.cxx | 10 +- sw/source/ui/uno/unotxdoc.cxx | 6 +- 10 files changed, 1022 insertions(+), 1020 deletions(-) diff --git a/sw/inc/unotextcursor.hxx b/sw/inc/unotextcursor.hxx index fe9b2602180f..e976af91e147 100644 --- a/sw/inc/unotextcursor.hxx +++ b/sw/inc/unotextcursor.hxx @@ -49,20 +49,14 @@ #include #include -#include -#include -#include -#include #include #include -class SfxItemPropertySet; class SwDoc; struct SwPosition; class SwUnoCrsr; -struct SwSortOptions; typedef ::cppu::WeakImplHelper12 @@ -82,65 +76,45 @@ typedef ::cppu::WeakImplHelper12 class SwXTextCursor : public SwXTextCursor_Base - , public SwClient , public OTextCursorHelper { private: - SwEventListenerContainer aLstnrCntnr; - const SfxItemPropertySet* m_pPropSet; - ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > xParentText; - SwSortOptions* pLastSortOptions; - - CursorType eType; - - // --> FME 2006-03-07 #126177# We need to track if the RemoveCursor_Impl - // user event has been posted. In this case we have to remove the user - // event in ~SwXTextCursor(). - ULONG mnUserEventId; - bool mbRemoveUserEvent; - // <-- - - DECL_STATIC_LINK(SwXTextCursor, RemoveCursor_Impl, - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>*); - -protected: + class Impl; + ::sw::UnoImplPtr m_pImpl; virtual ~SwXTextCursor(); public: SwXTextCursor( + SwDoc & rDoc, ::com::sun::star::uno::Reference< - ::com::sun::star::text::XText > xParent, - const SwPosition& rPos, - CursorType eSet, SwDoc* pDoc, const SwPosition* pMark = 0); + ::com::sun::star::text::XText > const& xParent, + const enum CursorType eType, + SwPosition const& rPos, + SwPosition const*const pMark = 0); SwXTextCursor( ::com::sun::star::uno::Reference< - ::com::sun::star::text::XText > xParent, - SwUnoCrsr* pSourceCrsr, CursorType eSet = CURSOR_ALL); - - SwUnoCrsr* GetCrsr() {return (SwUnoCrsr*)GetRegisteredIn();} - const SwUnoCrsr* GetCrsr() const {return (SwUnoCrsr*)GetRegisteredIn();} + ::com::sun::star::text::XText > const& xParent, + SwPaM const& rSourceCursor, + const enum CursorType eType = CURSOR_ALL); - // --> FME 2006-03-07 #126177# - void DoNotRemoveUserEvent() { mbRemoveUserEvent = false; } - // <-- + SwUnoCrsr * GetCursor(); + const SwUnoCrsr * GetCursor() const; bool IsAtEndOfMeta() const; - void DeleteAndInsert(const String& rText, + void DeleteAndInsert(::rtl::OUString const& rText, const bool bForceExpandHints); + // OTextCursorHelper virtual const SwPaM* GetPaM() const; virtual SwPaM* GetPaM(); virtual const SwDoc* GetDoc() const; virtual SwDoc* GetDoc(); - // SwClient - virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); - DECLARE_XINTERFACE() static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId(); diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index ac2dc2d55529..c9e9771a3bae 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -2652,10 +2652,11 @@ uno::Reference< text::XTextCursor > SwXTextFrame::createTextCursor(void) throw( throw aExcept; } - SwXTextCursor* pXCrsr = new SwXTextCursor(this, *aPam.GetPoint(), CURSOR_FRAME, pFmt->GetDoc()); - aRef = (text::XWordCursor*)pXCrsr; + SwXTextCursor *const pXCursor = new SwXTextCursor( + *pFmt->GetDoc(), this, CURSOR_FRAME, *aPam.GetPoint()); + aRef = static_cast(pXCursor); #if OSL_DEBUG_LEVEL > 1 - SwUnoCrsr* pUnoCrsr = pXCrsr->GetCrsr(); + SwUnoCrsr *const pUnoCrsr = pXCursor->GetCursor(); (void) pUnoCrsr; #endif } @@ -2682,8 +2683,11 @@ uno::Reference< text::XTextCursor > SwXTextFrame::createTextCursorByRange(const (void)p2; #endif if(aPam.GetNode()->FindFlyStartNode() == rNode.FindFlyStartNode()) - aRef = (text::XWordCursor*)new SwXTextCursor(this , - *aPam.GetPoint(), CURSOR_FRAME, pFmt->GetDoc(), aPam.GetMark()); + { + aRef = static_cast( + new SwXTextCursor(*pFmt->GetDoc(), this, CURSOR_FRAME, + *aPam.GetPoint(), aPam.GetMark())); + } } else throw uno::RuntimeException(); diff --git a/sw/source/core/unocore/unoftn.cxx b/sw/source/core/unocore/unoftn.cxx index 4511b455b5c9..e98238967a11 100644 --- a/sw/source/core/unocore/unoftn.cxx +++ b/sw/source/core/unocore/unoftn.cxx @@ -391,9 +391,10 @@ uno::Reference< text::XTextCursor > SwXFootnote::createTextCursor(void) throw( { const SwTxtFtn* pTxtFtn = pFmt->GetTxtFtn(); SwPosition aPos( *pTxtFtn->GetStartNode() ); - SwXTextCursor* pXCrsr = new SwXTextCursor(this, aPos, CURSOR_FOOTNOTE, GetDoc()); - aRef = (text::XWordCursor*)pXCrsr; - SwUnoCrsr* pUnoCrsr = pXCrsr->GetCrsr(); + SwXTextCursor *const pXCursor = + new SwXTextCursor(*GetDoc(), this, CURSOR_FOOTNOTE, aPos); + aRef = static_cast(pXCursor); + SwUnoCrsr *const pUnoCrsr = pXCursor->GetCursor(); pUnoCrsr->Move(fnMoveForward, fnGoNode); } else @@ -422,7 +423,9 @@ uno::Reference< text::XTextCursor > SwXFootnote::createTextCursorByRange( if( pStart != pFtnStartNode ) throw uno::RuntimeException(); - aRef = (text::XWordCursor*)new SwXTextCursor(this , *aPam.GetPoint(), CURSOR_FOOTNOTE, GetDoc(), aPam.GetMark()); + aRef = static_cast( + new SwXTextCursor(*GetDoc(), this, CURSOR_FOOTNOTE, + *aPam.GetPoint(), aPam.GetMark())); } else throw uno::RuntimeException(); diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx index 837caa62634b..ba86f9c509b1 100644 --- a/sw/source/core/unocore/unoobj.cxx +++ b/sw/source/core/unocore/unoobj.cxx @@ -131,17 +131,10 @@ using namespace ::com::sun::star; -using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::lang; -using namespace ::com::sun::star::uno; -using namespace ::com::sun::star::text; -using namespace ::com::sun::star::container; -using namespace ::com::sun::star::beans; -using namespace ::com::sun::star::drawing; -using std::auto_ptr; using ::rtl::OUString; using ::rtl::OUStringBuffer; + /**************************************************************************** static methods ****************************************************************************/ @@ -780,185 +773,146 @@ SwPageDesc* GetPageDescByName_Impl(SwDoc& rDoc, const String& rName) return pRet; } -/****************************************************************************** - ****************************************************************************** - ****************************************************************************** - * Taskforce ONE51 - ******************************************************************************/ /****************************************************************** * SwXTextCursor ******************************************************************/ -/*-- 09.12.98 14:19:00--------------------------------------------------- - - -----------------------------------------------------------------------*/ -IMPL_STATIC_LINK( SwXTextCursor, RemoveCursor_Impl, - uno::Reference< XInterface >*, EMPTYARG ) +class SwXTextCursor::Impl + : public SwClient { - ASSERT( pThis != NULL, "no reference?" ); - //ASSERT( pArg != NULL, "no reference?" ); - // --> FME 2006-03-07 #126177# Tell the SwXTextCursor that the user event - // has been executed. It is not necessary to remove the user event in - // ~SwXTextCursor - pThis->DoNotRemoveUserEvent(); - // <-- +public: + + const SfxItemPropertySet & m_rPropSet; + const enum CursorType m_eType; + const uno::Reference< text::XText > m_xParentText; + SwEventListenerContainer m_ListenerContainer; + bool m_bIsDisposed; - SwUnoCrsr* pCursor = pThis->GetCrsr(); - if( pCursor != NULL ) + Impl( SwXTextCursor & rThis, + SwDoc & rDoc, + const enum CursorType eType, + uno::Reference xParent, + SwPosition const& rPoint, SwPosition const*const pMark) + : SwClient(rDoc.CreateUnoCrsr(rPoint, sal_False)) + , m_rPropSet(*aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_CURSOR)) + , m_eType(eType) + , m_xParentText(xParent) + , m_ListenerContainer(static_cast< ::cppu::OWeakObject* >(&rThis)) + , m_bIsDisposed(false) { - pCursor->Remove( pThis ); - delete pCursor; + if (pMark) + { + GetCursor()->SetMark(); + *GetCursor()->GetMark() = *pMark; + } } - // --> FME 2006-03-07 #126177# - //delete pArg; - // <-- + ~Impl() { + // Impl owns the cursor; delete it here: SolarMutex is locked + delete GetRegisteredIn(); + } - return 0; -} + SwUnoCrsr * GetCursor() { + return (m_bIsDisposed) ? 0 : + static_cast(const_cast(GetRegisteredIn())); + } -void SwXTextCursor::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) -{ - ClientModify(this, pOld, pNew); + SwUnoCrsr & GetCursorOrThrow() { + SwUnoCrsr *const pUnoCursor( GetCursor() ); + if (!pUnoCursor) { + throw uno::RuntimeException(OUString(RTL_CONSTASCII_USTRINGPARAM( + "SwXTextCursor: disposed or invalid")), 0); + } + return *pUnoCursor; + } - // if the cursor leaves its designated section, it becomes invalid - if( !mbRemoveUserEvent && ( pOld != NULL ) && ( pOld->Which() == RES_UNOCURSOR_LEAVES_SECTION ) ) - { - // --> FME 2006-03-07 #126177# We don't need to create a reference - // to the SwXTextCursor to prevent its deletion. If the destructor - // of the SwXTextCursor is called before the user event is executed, - // the user event will be removed. This is necessary, because an other - // thread might be currently waiting in ~SwXTextCursor. In this case - // the pRef = new ... stuff did not work! + void Invalidate() { + m_bIsDisposed = true; + m_ListenerContainer.Disposing(); + } - // create reference to this object to prevent deletion before - // the STATIC_LINK is executed. The link will delete the - // reference. - //uno::Reference* pRef = - //new uno::Reference( static_cast( this ) ); + // SwClient + virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); - mbRemoveUserEvent = true; - // <-- +}; - mnUserEventId = Application::PostUserEvent( - STATIC_LINK( this, SwXTextCursor, RemoveCursor_Impl ), this ); +void SwXTextCursor::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew) +{ + ClientModify(this, pOld, pNew); + + if (!GetRegisteredIn() || + // if the cursor leaves its designated section, it becomes invalid + (pOld != NULL) && (pOld->Which() == RES_UNOCURSOR_LEAVES_SECTION)) + { + Invalidate(); } +} + - if(!GetRegisteredIn()) - aLstnrCntnr.Disposing(); +SwUnoCrsr const* SwXTextCursor::GetCursor() const +{ + return m_pImpl->GetCursor(); +} +SwUnoCrsr * SwXTextCursor::GetCursor() +{ + return m_pImpl->GetCursor(); } /*-- 09.12.98 14:19:01--------------------------------------------------- -----------------------------------------------------------------------*/ -const SwPaM* SwXTextCursor::GetPaM() const +SwPaM const* SwXTextCursor::GetPaM() const { - return GetCrsr() ? GetCrsr() : 0; + return m_pImpl->GetCursor(); } -SwPaM* SwXTextCursor::GetPaM() +SwPaM * SwXTextCursor::GetPaM() { - return GetCrsr() ? GetCrsr() : 0; + return m_pImpl->GetCursor(); } /*-- 09.12.98 14:19:02--------------------------------------------------- -----------------------------------------------------------------------*/ -const SwDoc* SwXTextCursor::GetDoc()const +SwDoc const* SwXTextCursor::GetDoc() const { - return GetCrsr() ? GetCrsr()->GetDoc() : 0; + return m_pImpl->GetCursor() ? m_pImpl->GetCursor()->GetDoc() : 0; } /* -----------------22.07.99 13:52------------------- --------------------------------------------------*/ -SwDoc* SwXTextCursor::GetDoc() -{ - return GetCrsr() ? GetCrsr()->GetDoc() : 0; -} - - -/*-- 09.12.98 14:19:19--------------------------------------------------- - - -----------------------------------------------------------------------*/ -OUString SwXTextCursor::getImplementationName(void) throw( RuntimeException ) +SwDoc * SwXTextCursor::GetDoc() { - return C2U("SwXTextCursor"); + return m_pImpl->GetCursor() ? m_pImpl->GetCursor()->GetDoc() : 0; } -/*-- 09.12.98 14:19:19--------------------------------------------------- - -----------------------------------------------------------------------*/ -BOOL SwXTextCursor::supportsService(const OUString& rServiceName) throw( RuntimeException ) -{ - String sServiceName(rServiceName); - return sServiceName.EqualsAscii("com.sun.star.text.TextCursor") || - sServiceName.EqualsAscii("com.sun.star.style.CharacterProperties")|| - sServiceName.EqualsAscii("com.sun.star.style.CharacterPropertiesAsian")|| - sServiceName.EqualsAscii("com.sun.star.style.CharacterPropertiesComplex")|| - sServiceName.EqualsAscii("com.sun.star.style.ParagraphProperties") || - sServiceName.EqualsAscii("com.sun.star.style.ParagraphPropertiesAsian") || - sServiceName.EqualsAscii("com.sun.star.style.ParagraphPropertiesComplex") || - sServiceName.EqualsAscii("com.sun.star.text.TextSortable"); -} -/*-- 09.12.98 14:19:19--------------------------------------------------- - -----------------------------------------------------------------------*/ -Sequence< OUString > SwXTextCursor::getSupportedServiceNames(void) throw( RuntimeException ) -{ - Sequence< OUString > aRet(8); - OUString* pArray = aRet.getArray(); - pArray[0] = C2U("com.sun.star.text.TextCursor"); - pArray[1] = C2U("com.sun.star.style.CharacterProperties"); - pArray[2] = C2U("com.sun.star.style.CharacterPropertiesAsian"); - pArray[3] = C2U("com.sun.star.style.CharacterPropertiesComplex"); - pArray[4] = C2U("com.sun.star.style.ParagraphProperties"); - pArray[5] = C2U("com.sun.star.style.ParagraphPropertiesAsian"); - pArray[6] = C2U("com.sun.star.style.ParagraphPropertiesComplex"); - pArray[7] = C2U("com.sun.star.text.TextSortable"); - return aRet; -} /*-- 09.12.98 14:19:19--------------------------------------------------- -----------------------------------------------------------------------*/ -SwXTextCursor::SwXTextCursor(uno::Reference< XText > xParent, const SwPosition& rPos, - CursorType eSet, SwDoc* pDoc, const SwPosition* pMark) : - aLstnrCntnr(( util::XSortable*)this), - m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_CURSOR)), - xParentText(xParent), - pLastSortOptions(0), - eType(eSet), - mbRemoveUserEvent( false ) +SwXTextCursor::SwXTextCursor( + SwDoc & rDoc, + uno::Reference< text::XText > const& xParent, + const enum CursorType eType, + const SwPosition& rPos, + SwPosition const*const pMark) + : m_pImpl( new SwXTextCursor::Impl(*this, rDoc, eType, xParent, + rPos, pMark ) ) { - SwUnoCrsr* pUnoCrsr = pDoc->CreateUnoCrsr(rPos, sal_False); - if(pMark) - { - pUnoCrsr->SetMark(); - *pUnoCrsr->GetMark() = *pMark; - } - pUnoCrsr->Add(this); } /* -----------------04.03.99 09:02------------------- * * --------------------------------------------------*/ -SwXTextCursor::SwXTextCursor(uno::Reference< XText > xParent, - SwUnoCrsr* pSourceCrsr, CursorType eSet) : - aLstnrCntnr( (util::XSortable*)this), - m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_CURSOR)), - xParentText(xParent), - pLastSortOptions(0), - eType(eSet), - mbRemoveUserEvent( false ) +SwXTextCursor::SwXTextCursor(uno::Reference< text::XText > const& xParent, + SwPaM const& rSourceCursor, const enum CursorType eType) + : m_pImpl( new SwXTextCursor::Impl(*this, *rSourceCursor.GetDoc(), eType, + xParent, *rSourceCursor.GetPoint(), + rSourceCursor.HasMark() ? rSourceCursor.GetMark() : 0) ) { - SwUnoCrsr* pUnoCrsr = pSourceCrsr->GetDoc()->CreateUnoCrsr(*pSourceCrsr->GetPoint(), sal_False); - if(pSourceCrsr->HasMark()) - { - pUnoCrsr->SetMark(); - *pUnoCrsr->GetMark() = *pSourceCrsr->GetMark(); - } - pUnoCrsr->Add(this); } /*-- 09.12.98 14:19:20--------------------------------------------------- @@ -966,55 +920,43 @@ SwXTextCursor::SwXTextCursor(uno::Reference< XText > xParent, -----------------------------------------------------------------------*/ SwXTextCursor::~SwXTextCursor() { - vos::OGuard aGuard(Application::GetSolarMutex()); - - // --> FME 2006-03-07 #126177# A user event has been posted in order - // to delete the SwUnoCursor. Remove the user event if the SwXTextCursor - // is destroyed before the user event could be handled. - if ( mbRemoveUserEvent ) - { - mbRemoveUserEvent = false; - Application::RemoveUserEvent( mnUserEventId ); - } - // <-- - - SwUnoCrsr* pUnoCrsr = GetCrsr(); - delete pUnoCrsr; - delete pLastSortOptions; } + /*-- 09.12.98 14:19:18--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXTextCursor::DeleteAndInsert(const String& rText, +void SwXTextCursor::DeleteAndInsert(const ::rtl::OUString& rText, const bool bForceExpandHints) { - SwUnoCrsr* pUnoCrsr = GetCrsr(); + SwUnoCrsr *const pUnoCrsr = m_pImpl->GetCursor(); if(pUnoCrsr) { // Start/EndAction SwDoc* pDoc = pUnoCrsr->GetDoc(); UnoActionContext aAction(pDoc); - xub_StrLen nTxtLen = rText.Len(); + const xub_StrLen nTxtLen = rText.getLength(); pDoc->StartUndo(UNDO_INSERT, NULL); - SwCursor *_pStartCrsr = pUnoCrsr; + SwCursor * pCurrent = pUnoCrsr; do { - if(_pStartCrsr->HasMark()) + if (pCurrent->HasMark()) { - pDoc->DeleteAndJoin(*_pStartCrsr); + pDoc->DeleteAndJoin(*pCurrent); } if(nTxtLen) { const bool bSuccess( SwUnoCursorHelper::DocInsertStringSplitCR( - *pDoc, *_pStartCrsr, rText, bForceExpandHints ) ); + *pDoc, *pCurrent, rText, bForceExpandHints ) ); DBG_ASSERT( bSuccess, "Doc->Insert(Str) failed." ); (void) bSuccess; SwUnoCursorHelper::SelectPam(*pUnoCrsr, true); - _pStartCrsr->Left(rText.Len(), CRSR_SKIP_CHARS, FALSE, FALSE); + pCurrent->Left(rText.getLength(), + CRSR_SKIP_CHARS, FALSE, FALSE); } - } while( (_pStartCrsr=(SwCursor*)_pStartCrsr->GetNext()) != pUnoCrsr ); + pCurrent = static_cast(pCurrent->GetNext()); + } while (pCurrent != pUnoCrsr); pDoc->EndUndo(UNDO_INSERT, NULL); } } @@ -1068,10 +1010,11 @@ lcl_ForceIntoMeta(SwPaM & rCursor, bool SwXTextCursor::IsAtEndOfMeta() const { - if (CURSOR_META == eType) + if (CURSOR_META == m_pImpl->m_eType) { - SwUnoCrsr const * const pCursor( GetCrsr() ); - SwXMeta const*const pXMeta( dynamic_cast(xParentText.get()) ); + SwUnoCrsr const * const pCursor( m_pImpl->GetCursor() ); + SwXMeta const*const pXMeta( + dynamic_cast(m_pImpl->m_xParentText.get()) ); ASSERT(pXMeta, "no meta?"); if (pCursor && pXMeta) { @@ -1095,6 +1038,45 @@ bool SwXTextCursor::IsAtEndOfMeta() const return false; } +/*-- 09.12.98 14:19:19--------------------------------------------------- + + -----------------------------------------------------------------------*/ +OUString SwXTextCursor::getImplementationName() throw (uno::RuntimeException) +{ + return C2U("SwXTextCursor"); +} + +/*-- 09.12.98 14:19:19--------------------------------------------------- + + -----------------------------------------------------------------------*/ +static char const*const g_ServicesTextCursor[] = +{ + "com.sun.star.text.TextCursor", + "com.sun.star.style.CharacterProperties", + "com.sun.star.style.CharacterPropertiesAsian", + "com.sun.star.style.CharacterPropertiesComplex", + "com.sun.star.style.ParagraphProperties", + "com.sun.star.style.ParagraphPropertiesAsian", + "com.sun.star.style.ParagraphPropertiesComplex", + "com.sun.star.text.TextSortable", +}; +static const size_t g_nServicesTextCursor( + sizeof(g_ServicesTextCursor)/sizeof(g_ServicesTextCursor[0])); + +sal_Bool SAL_CALL SwXTextCursor::supportsService(const OUString& rServiceName) +throw (uno::RuntimeException) +{ + return ::sw::SupportsServiceImpl( + g_nServicesTextCursor, g_ServicesTextCursor, rServiceName); +} + +uno::Sequence< OUString > SAL_CALL +SwXTextCursor::getSupportedServiceNames() throw (uno::RuntimeException) +{ + return ::sw::GetSupportedServiceNamesImpl( + g_nServicesTextCursor, g_ServicesTextCursor); +} + /* -----------------------------10.03.00 18:02-------------------------------- ---------------------------------------------------------------------------*/ @@ -1106,231 +1088,219 @@ const uno::Sequence< sal_Int8 > & SwXTextCursor::getUnoTunnelId() /* -----------------------------10.03.00 18:04-------------------------------- ---------------------------------------------------------------------------*/ -sal_Int64 SAL_CALL SwXTextCursor::getSomething( const uno::Sequence< sal_Int8 >& rId ) - throw(uno::RuntimeException) +sal_Int64 SAL_CALL +SwXTextCursor::getSomething(const uno::Sequence< sal_Int8 >& rId) +throw (uno::RuntimeException) { - if( rId.getLength() == 16 - && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), - rId.getConstArray(), 16 ) ) - { - return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(this) ); - } - return OTextCursorHelper::getSomething(rId); + const sal_Int64 nRet( ::sw::UnoTunnelImpl(rId, this) ); + return (nRet) ? nRet : OTextCursorHelper::getSomething(rId); } /*-- 09.12.98 14:18:12--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXTextCursor::collapseToStart(void) throw( uno::RuntimeException ) +void SAL_CALL SwXTextCursor::collapseToStart() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - SwUnoCrsr* pUnoCrsr = GetCrsr(); - if(pUnoCrsr) + + SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + + if (rUnoCursor.HasMark()) { - if(pUnoCrsr->HasMark()) + if (*rUnoCursor.GetPoint() > *rUnoCursor.GetMark()) { - if(*pUnoCrsr->GetPoint() > *pUnoCrsr->GetMark()) - pUnoCrsr->Exchange(); - pUnoCrsr->DeleteMark(); + rUnoCursor.Exchange(); } - } - else - { - throw uno::RuntimeException(); + rUnoCursor.DeleteMark(); } } /*-- 09.12.98 14:18:14--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXTextCursor::collapseToEnd(void) throw( uno::RuntimeException ) +void SAL_CALL SwXTextCursor::collapseToEnd() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - SwUnoCrsr* pUnoCrsr = GetCrsr(); - if(pUnoCrsr) + + SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + + if (rUnoCursor.HasMark()) { - if(pUnoCrsr->HasMark()) + if (*rUnoCursor.GetPoint() < *rUnoCursor.GetMark()) { - if(*pUnoCrsr->GetPoint() < *pUnoCrsr->GetMark()) - pUnoCrsr->Exchange(); - pUnoCrsr->DeleteMark(); + rUnoCursor.Exchange(); } - } - else - { - throw uno::RuntimeException(); + rUnoCursor.DeleteMark(); } } /*-- 09.12.98 14:18:41--------------------------------------------------- -----------------------------------------------------------------------*/ -sal_Bool SwXTextCursor::isCollapsed(void) throw( uno::RuntimeException ) +sal_Bool SAL_CALL SwXTextCursor::isCollapsed() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); + sal_Bool bRet = sal_True; - SwUnoCrsr* pUnoCrsr = GetCrsr(); + SwUnoCrsr *const pUnoCrsr = m_pImpl->GetCursor(); if(pUnoCrsr && pUnoCrsr->GetMark()) { bRet = (*pUnoCrsr->GetPoint() == *pUnoCrsr->GetMark()); } return bRet; } + /*-- 09.12.98 14:18:42--------------------------------------------------- -----------------------------------------------------------------------*/ -sal_Bool SwXTextCursor::goLeft(sal_Int16 nCount, sal_Bool Expand) throw( uno::RuntimeException ) +sal_Bool SAL_CALL +SwXTextCursor::goLeft(sal_Int16 nCount, sal_Bool Expand) +throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - sal_Bool bRet = sal_False; - SwUnoCrsr* pUnoCrsr = GetCrsr(); - if(pUnoCrsr) - { - SwUnoCursorHelper::SelectPam(*pUnoCrsr, Expand); - bRet = pUnoCrsr->Left( nCount, CRSR_SKIP_CHARS, FALSE, FALSE); - if (CURSOR_META == eType) - { - bRet = lcl_ForceIntoMeta(*pUnoCrsr, xParentText, META_CHECK_BOTH) - && bRet; - } - } - else + + SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + + SwUnoCursorHelper::SelectPam(rUnoCursor, Expand); + sal_Bool bRet = rUnoCursor.Left( nCount, CRSR_SKIP_CHARS, FALSE, FALSE); + if (CURSOR_META == m_pImpl->m_eType) { - throw uno::RuntimeException(); + bRet = lcl_ForceIntoMeta(rUnoCursor, m_pImpl->m_xParentText, + META_CHECK_BOTH) + && bRet; } return bRet; } /*-- 09.12.98 14:18:42--------------------------------------------------- -----------------------------------------------------------------------*/ -sal_Bool SwXTextCursor::goRight(sal_Int16 nCount, sal_Bool Expand) throw( uno::RuntimeException ) +sal_Bool SAL_CALL +SwXTextCursor::goRight(sal_Int16 nCount, sal_Bool Expand) +throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - sal_Bool bRet = sal_False; - SwUnoCrsr* pUnoCrsr = GetCrsr(); - if(pUnoCrsr) - { - SwUnoCursorHelper::SelectPam(*pUnoCrsr, Expand); - bRet = pUnoCrsr->Right(nCount, CRSR_SKIP_CHARS, FALSE, FALSE); - if (CURSOR_META == eType) - { - bRet = lcl_ForceIntoMeta(*pUnoCrsr, xParentText, META_CHECK_BOTH) - && bRet; - } - } - else + + SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + + SwUnoCursorHelper::SelectPam(rUnoCursor, Expand); + sal_Bool bRet = rUnoCursor.Right(nCount, CRSR_SKIP_CHARS, FALSE, FALSE); + if (CURSOR_META == m_pImpl->m_eType) { - throw uno::RuntimeException(); + bRet = lcl_ForceIntoMeta(rUnoCursor, m_pImpl->m_xParentText, + META_CHECK_BOTH) + && bRet; } return bRet; } + /*-- 09.12.98 14:18:43--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXTextCursor::gotoStart(sal_Bool Expand) throw( uno::RuntimeException ) +void SAL_CALL +SwXTextCursor::gotoStart(sal_Bool Expand) throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - SwUnoCrsr* pUnoCrsr = GetCrsr(); - if(pUnoCrsr) + + SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + + SwUnoCursorHelper::SelectPam(rUnoCursor, Expand); + if (CURSOR_BODY == m_pImpl->m_eType) { - SwUnoCursorHelper::SelectPam(*pUnoCrsr, Expand); - if(eType == CURSOR_BODY) + rUnoCursor.Move( fnMoveBackward, fnGoDoc ); + //check, that the cursor is not in a table + SwTableNode * pTblNode = rUnoCursor.GetNode()->FindTableNode(); + SwCntntNode * pCNode = 0; + while (pTblNode) { - pUnoCrsr->Move( fnMoveBackward, fnGoDoc ); - //check, that the cursor is not in a table - SwTableNode* pTblNode = pUnoCrsr->GetNode()->FindTableNode(); - SwCntntNode* pCont = 0; - while( pTblNode ) - { - pUnoCrsr->GetPoint()->nNode = *pTblNode->EndOfSectionNode(); - pCont = GetDoc()->GetNodes().GoNext(&pUnoCrsr->GetPoint()->nNode); - pTblNode = pCont ? pCont->FindTableNode() : 0; - } - if(pCont) - pUnoCrsr->GetPoint()->nContent.Assign(pCont, 0); - const SwStartNode* pTmp = pUnoCrsr->GetNode()->StartOfSectionNode(); - if(pTmp->IsSectionNode()) - { - SwSectionNode* pSectionStartNode = (SwSectionNode*)pTmp; - if(pSectionStartNode->GetSection().IsHiddenFlag()) - { - pCont = GetDoc()->GetNodes().GoNextSection( - &pUnoCrsr->GetPoint()->nNode, sal_True, sal_False); - if(pCont) - pUnoCrsr->GetPoint()->nContent.Assign(pCont, 0); - } - } + rUnoCursor.GetPoint()->nNode = *pTblNode->EndOfSectionNode(); + pCNode = GetDoc()->GetNodes().GoNext(&rUnoCursor.GetPoint()->nNode); + pTblNode = (pCNode) ? pCNode->FindTableNode() : 0; } - else if(eType == CURSOR_FRAME || - eType == CURSOR_TBLTEXT || - eType == CURSOR_HEADER || - eType == CURSOR_FOOTER || - eType == CURSOR_FOOTNOTE|| - eType == CURSOR_REDLINE) + if (pCNode) { - pUnoCrsr->MoveSection( fnSectionCurr, fnSectionStart); + rUnoCursor.GetPoint()->nContent.Assign(pCNode, 0); } - else if (CURSOR_META == eType) + SwStartNode const*const pTmp = + rUnoCursor.GetNode()->StartOfSectionNode(); + if (pTmp->IsSectionNode()) { - lcl_ForceIntoMeta(*pUnoCrsr, xParentText, META_INIT_START); + SwSectionNode const*const pSectionStartNode = + static_cast(pTmp); + if (pSectionStartNode->GetSection().IsHiddenFlag()) + { + pCNode = GetDoc()->GetNodes().GoNextSection( + &rUnoCursor.GetPoint()->nNode, sal_True, sal_False); + if (pCNode) + { + rUnoCursor.GetPoint()->nContent.Assign(pCNode, 0); + } + } } } - else + else if ( (CURSOR_FRAME == m_pImpl->m_eType) + || (CURSOR_TBLTEXT == m_pImpl->m_eType) + || (CURSOR_HEADER == m_pImpl->m_eType) + || (CURSOR_FOOTER == m_pImpl->m_eType) + || (CURSOR_FOOTNOTE== m_pImpl->m_eType) + || (CURSOR_REDLINE == m_pImpl->m_eType)) { - throw uno::RuntimeException(); + rUnoCursor.MoveSection(fnSectionCurr, fnSectionStart); + } + else if (CURSOR_META == m_pImpl->m_eType) + { + lcl_ForceIntoMeta(rUnoCursor, m_pImpl->m_xParentText, META_INIT_START); } } /*-- 09.12.98 14:18:43--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXTextCursor::gotoEnd(sal_Bool Expand) throw( uno::RuntimeException ) +void SAL_CALL +SwXTextCursor::gotoEnd(sal_Bool Expand) throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - SwUnoCrsr* pUnoCrsr = GetCrsr(); - if(pUnoCrsr) + + SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + + SwUnoCursorHelper::SelectPam(rUnoCursor, Expand); + if (CURSOR_BODY == m_pImpl->m_eType) { - SwUnoCursorHelper::SelectPam(*pUnoCrsr, Expand); - if(eType == CURSOR_BODY) - { - pUnoCrsr->Move( fnMoveForward, fnGoDoc ); - } - else if(eType == CURSOR_FRAME || - eType == CURSOR_TBLTEXT || - eType == CURSOR_HEADER || - eType == CURSOR_FOOTER || - eType == CURSOR_FOOTNOTE|| - eType == CURSOR_REDLINE) - { - pUnoCrsr->MoveSection( fnSectionCurr, fnSectionEnd); - } - else if (CURSOR_META == eType) - { - lcl_ForceIntoMeta(*pUnoCrsr, xParentText, META_INIT_END); - } + rUnoCursor.Move( fnMoveForward, fnGoDoc ); } - else + else if ( (CURSOR_FRAME == m_pImpl->m_eType) + || (CURSOR_TBLTEXT == m_pImpl->m_eType) + || (CURSOR_HEADER == m_pImpl->m_eType) + || (CURSOR_FOOTER == m_pImpl->m_eType) + || (CURSOR_FOOTNOTE== m_pImpl->m_eType) + || (CURSOR_REDLINE == m_pImpl->m_eType)) { - throw uno::RuntimeException(); + rUnoCursor.MoveSection( fnSectionCurr, fnSectionEnd); + } + else if (CURSOR_META == m_pImpl->m_eType) + { + lcl_ForceIntoMeta(rUnoCursor, m_pImpl->m_xParentText, META_INIT_END); } } -void SwXTextCursor::gotoRange(const uno::Reference< XTextRange > & xRange, sal_Bool bExpand ) - throw( uno::RuntimeException ) +void SAL_CALL +SwXTextCursor::gotoRange( + const uno::Reference< text::XTextRange > & xRange, sal_Bool bExpand) +throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - SwUnoCrsr* pOwnCursor = GetCrsr(); - if(!pOwnCursor || !xRange.is()) + + if (!xRange.is()) { throw uno::RuntimeException(); } + SwUnoCrsr & rOwnCursor( m_pImpl->GetCursorOrThrow() ); + uno::Reference xRangeTunnel( xRange, uno::UNO_QUERY); SwXTextRange* pRange = 0; OTextCursorHelper* pCursor = 0; if(xRangeTunnel.is()) { - pRange = reinterpret_cast< SwXTextRange * >( - sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( SwXTextRange::getUnoTunnelId()) )); - pCursor = reinterpret_cast< OTextCursorHelper * >( - sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( OTextCursorHelper::getUnoTunnelId()) )); + pRange = ::sw::UnoTunnelGetImplementation(xRangeTunnel); + pCursor = + ::sw::UnoTunnelGetImplementation(xRangeTunnel); } if (!pRange && !pCursor) @@ -1339,7 +1309,7 @@ void SwXTextCursor::gotoRange(const uno::Reference< XTextRange > & xRange, sal_B } SwStartNodeType eSearchNodeType = SwNormalStartNode; - switch(eType) + switch (m_pImpl->m_eType) { case CURSOR_FRAME: eSearchNodeType = SwFlyStartNode; break; case CURSOR_TBLTEXT: eSearchNodeType = SwTableBoxStartNode; break; @@ -1351,8 +1321,8 @@ void SwXTextCursor::gotoRange(const uno::Reference< XTextRange > & xRange, sal_B default: ; } - const SwStartNode* pOwnStartNode = pOwnCursor->GetNode()-> - FindSttNodeByType(eSearchNodeType); + const SwStartNode* pOwnStartNode = + rOwnCursor.GetNode()->FindSttNodeByType(eSearchNodeType); SwPaM aPam(GetDoc()->GetNodes()); const SwPaM * pPam(0); @@ -1389,11 +1359,11 @@ void SwXTextCursor::gotoRange(const uno::Reference< XTextRange > & xRange, sal_B throw uno::RuntimeException(); } - if (CURSOR_META == eType) + if (CURSOR_META == m_pImpl->m_eType) { SwPaM CopyPam(*pPam->GetMark(), *pPam->GetPoint()); - const bool bNotForced( - lcl_ForceIntoMeta(CopyPam, xParentText, META_CHECK_BOTH) ); + const bool bNotForced( lcl_ForceIntoMeta( + CopyPam, m_pImpl->m_xParentText, META_CHECK_BOTH) ); if (!bNotForced) { throw uno::RuntimeException( @@ -1408,40 +1378,30 @@ void SwXTextCursor::gotoRange(const uno::Reference< XTextRange > & xRange, sal_B { // der Cursor soll alles einschliessen, was bisher von ihm und dem uebergebenen // Range eingeschlossen wurde - SwPosition aOwnLeft(*pOwnCursor->GetPoint()); - SwPosition aOwnRight(pOwnCursor->HasMark() ? *pOwnCursor->GetMark() : aOwnLeft); - if(aOwnRight < aOwnLeft) - { - SwPosition aTmp = aOwnLeft; - aOwnLeft = aOwnRight; - aOwnRight = aTmp; - } - SwPosition const* pParamLeft = pPam->Start(); - SwPosition const* pParamRight = pPam->End(); + const SwPosition aOwnLeft(*rOwnCursor.Start()); + const SwPosition aOwnRight(*rOwnCursor.End()); + SwPosition const& rParamLeft = *pPam->Start(); + SwPosition const& rParamRight = *pPam->End(); // jetzt sind vier SwPositions da, zwei davon werden gebraucht, also welche? - if(aOwnRight > *pParamRight) - *pOwnCursor->GetPoint() = aOwnRight; - else - *pOwnCursor->GetPoint() = *pParamRight; - pOwnCursor->SetMark(); - if(aOwnLeft < *pParamLeft) - *pOwnCursor->GetMark() = aOwnLeft; - else - *pOwnCursor->GetMark() = *pParamLeft; + *rOwnCursor.GetPoint() = (aOwnRight > rParamRight) + ? aOwnRight : *rOwnCursor.GetPoint() = rParamRight; + rOwnCursor.SetMark(); + *rOwnCursor.GetMark() = (aOwnLeft < rParamLeft) + ? aOwnLeft : *rOwnCursor.GetMark() = rParamLeft; } else { // cursor should be the given range - *pOwnCursor->GetPoint() = *pPam->GetPoint(); + *rOwnCursor.GetPoint() = *pPam->GetPoint(); if (pPam->HasMark()) { - pOwnCursor->SetMark(); - *pOwnCursor->GetMark() = *pPam->GetMark(); + rOwnCursor.SetMark(); + *rOwnCursor.GetMark() = *pPam->GetMark(); } else { - pOwnCursor->DeleteMark(); + rOwnCursor.DeleteMark(); } } } @@ -1449,169 +1409,157 @@ void SwXTextCursor::gotoRange(const uno::Reference< XTextRange > & xRange, sal_B /*-- 09.12.98 14:18:44--------------------------------------------------- -----------------------------------------------------------------------*/ -sal_Bool SwXTextCursor::isStartOfWord(void) throw( uno::RuntimeException ) +sal_Bool SAL_CALL SwXTextCursor::isStartOfWord() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - sal_Bool bRet = sal_False; - SwUnoCrsr* pUnoCrsr = GetCrsr(); - if(pUnoCrsr) - { - bRet = pUnoCrsr->IsStartWordWT( i18n::WordType::DICTIONARY_WORD ); - } - else - { - throw uno::RuntimeException(); - } + + SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + + const sal_Bool bRet = + rUnoCursor.IsStartWordWT( i18n::WordType::DICTIONARY_WORD ); return bRet; } /*-- 09.12.98 14:18:44--------------------------------------------------- -----------------------------------------------------------------------*/ -sal_Bool SwXTextCursor::isEndOfWord(void) throw( uno::RuntimeException ) +sal_Bool SAL_CALL SwXTextCursor::isEndOfWord() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - sal_Bool bRet = sal_False; - SwUnoCrsr* pUnoCrsr = GetCrsr(); - if(pUnoCrsr) - { - bRet = pUnoCrsr->IsEndWordWT( i18n::WordType::DICTIONARY_WORD ); - } - else - { - throw uno::RuntimeException(); - } + + SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + + const sal_Bool bRet = + rUnoCursor.IsEndWordWT( i18n::WordType::DICTIONARY_WORD ); return bRet; } + /*-- 09.12.98 14:18:44--------------------------------------------------- -----------------------------------------------------------------------*/ -sal_Bool SwXTextCursor::gotoNextWord(sal_Bool Expand) throw( uno::RuntimeException ) +sal_Bool SAL_CALL +SwXTextCursor::gotoNextWord(sal_Bool Expand) throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - //Probleme gibt's noch mit einem Absatzanfang, an dem kein Wort beginnt. - SwUnoCrsr* pUnoCrsr = GetCrsr(); + SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + //Probleme gibt's noch mit einem Absatzanfang, an dem kein Wort beginnt. sal_Bool bRet = sal_False; - if(pUnoCrsr) - { - // remember old position to check if cursor has moved - // since the called functions are sometimes a bit unreliable - // in specific cases... - SwPosition *pPoint = pUnoCrsr->GetPoint(); - SwNode *pOldNode = &pPoint->nNode.GetNode(); - xub_StrLen nOldIndex = pPoint->nContent.GetIndex(); - - SwUnoCursorHelper::SelectPam(*pUnoCrsr, Expand); - //Absatzende? - if(pUnoCrsr->GetCntntNode() && - pPoint->nContent == pUnoCrsr->GetCntntNode()->Len()) - { - pUnoCrsr->Right(1, CRSR_SKIP_CHARS, FALSE, FALSE); - } - else - { - sal_Bool bTmp = pUnoCrsr->GoNextWordWT( i18n::WordType::DICTIONARY_WORD ); - //if there is no next word within the current paragraph try to go to the start of the next paragraph - if(!bTmp) - pUnoCrsr->MovePara(fnParaNext, fnParaStart); - } + // remember old position to check if cursor has moved + // since the called functions are sometimes a bit unreliable + // in specific cases... + SwPosition *const pPoint = rUnoCursor.GetPoint(); + SwNode *const pOldNode = &pPoint->nNode.GetNode(); + xub_StrLen const nOldIndex = pPoint->nContent.GetIndex(); - // return true if cursor has moved - bRet = &pPoint->nNode.GetNode() != pOldNode || - pPoint->nContent.GetIndex() != nOldIndex; - if (bRet && (CURSOR_META == eType)) + SwUnoCursorHelper::SelectPam(rUnoCursor, Expand); + // end of paragraph + if (rUnoCursor.GetCntntNode() && + (pPoint->nContent == rUnoCursor.GetCntntNode()->Len())) + { + rUnoCursor.Right(1, CRSR_SKIP_CHARS, FALSE, FALSE); + } + else + { + const bool bTmp = + rUnoCursor.GoNextWordWT( i18n::WordType::DICTIONARY_WORD ); + // if there is no next word within the current paragraph + // try to go to the start of the next paragraph + if (!bTmp) { - bRet = lcl_ForceIntoMeta(*pUnoCrsr, xParentText, META_CHECK_BOTH); + rUnoCursor.MovePara(fnParaNext, fnParaStart); } } - else + + // return true if cursor has moved + bRet = (&pPoint->nNode.GetNode() != pOldNode) || + (pPoint->nContent.GetIndex() != nOldIndex); + if (bRet && (CURSOR_META == m_pImpl->m_eType)) { - throw uno::RuntimeException(); + bRet = lcl_ForceIntoMeta(rUnoCursor, m_pImpl->m_xParentText, + META_CHECK_BOTH); } return bRet; } + /*-- 09.12.98 14:18:45--------------------------------------------------- -----------------------------------------------------------------------*/ -sal_Bool SwXTextCursor::gotoPreviousWord(sal_Bool Expand) throw( uno::RuntimeException ) +sal_Bool SAL_CALL +SwXTextCursor::gotoPreviousWord(sal_Bool Expand) throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - // hier machen Leerzeichen am Absatzanfang Probleme - SwUnoCrsr* pUnoCrsr = GetCrsr(); - sal_Bool bRet = sal_False; - if(pUnoCrsr) - { - SwPosition *pPoint = pUnoCrsr->GetPoint(); - SwNode *pOldNode = &pPoint->nNode.GetNode(); - xub_StrLen nOldIndex = pPoint->nContent.GetIndex(); + SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); - SwUnoCursorHelper::SelectPam(*pUnoCrsr, Expand); - //Absatzanfang ? - if(pPoint->nContent == 0) - { - pUnoCrsr->Left(1, CRSR_SKIP_CHARS, FALSE, FALSE); - } - else - { - pUnoCrsr->GoPrevWordWT( i18n::WordType::DICTIONARY_WORD ); - if(pPoint->nContent == 0) - pUnoCrsr->Left(1, CRSR_SKIP_CHARS, FALSE, FALSE); - } + // hier machen Leerzeichen am Absatzanfang Probleme + sal_Bool bRet = sal_False; + SwPosition *const pPoint = rUnoCursor.GetPoint(); + SwNode *const pOldNode = &pPoint->nNode.GetNode(); + xub_StrLen const nOldIndex = pPoint->nContent.GetIndex(); - // return true if cursor has moved - bRet = &pPoint->nNode.GetNode() != pOldNode || - pPoint->nContent.GetIndex() != nOldIndex; - if (bRet && (CURSOR_META == eType)) + SwUnoCursorHelper::SelectPam(rUnoCursor, Expand); + // start of paragraph? + if (pPoint->nContent == 0) + { + rUnoCursor.Left(1, CRSR_SKIP_CHARS, FALSE, FALSE); + } + else + { + rUnoCursor.GoPrevWordWT( i18n::WordType::DICTIONARY_WORD ); + if (pPoint->nContent == 0) { - bRet = lcl_ForceIntoMeta(*pUnoCrsr, xParentText, META_CHECK_BOTH); + rUnoCursor.Left(1, CRSR_SKIP_CHARS, FALSE, FALSE); } } - else + + // return true if cursor has moved + bRet = (&pPoint->nNode.GetNode() != pOldNode) || + (pPoint->nContent.GetIndex() != nOldIndex); + if (bRet && (CURSOR_META == m_pImpl->m_eType)) { - throw uno::RuntimeException(); + bRet = lcl_ForceIntoMeta(rUnoCursor, m_pImpl->m_xParentText, + META_CHECK_BOTH); } return bRet; } + /*-- 09.12.98 14:18:45--------------------------------------------------- -----------------------------------------------------------------------*/ -sal_Bool SwXTextCursor::gotoEndOfWord(sal_Bool Expand) throw( uno::RuntimeException ) +sal_Bool SAL_CALL +SwXTextCursor::gotoEndOfWord(sal_Bool Expand) throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - SwUnoCrsr* pUnoCrsr = GetCrsr(); + + SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); sal_Bool bRet = sal_False; - if(pUnoCrsr) - { - SwPosition *pPoint = pUnoCrsr->GetPoint(); - SwNode &rOldNode = pPoint->nNode.GetNode(); - xub_StrLen nOldIndex = pPoint->nContent.GetIndex(); + SwPosition *const pPoint = rUnoCursor.GetPoint(); + SwNode & rOldNode = pPoint->nNode.GetNode(); + xub_StrLen const nOldIndex = pPoint->nContent.GetIndex(); - sal_Int16 nWordType = i18n::WordType::DICTIONARY_WORD; - SwUnoCursorHelper::SelectPam(*pUnoCrsr, Expand); - if(!pUnoCrsr->IsEndWordWT( nWordType )) - pUnoCrsr->GoEndWordWT( nWordType ); + const sal_Int16 nWordType = i18n::WordType::DICTIONARY_WORD; + SwUnoCursorHelper::SelectPam(rUnoCursor, Expand); + if (!rUnoCursor.IsEndWordWT( nWordType )) + { + rUnoCursor.GoEndWordWT( nWordType ); + } - // restore old cursor if we are not at the end of a word by now - // otherwise use current one - bRet = pUnoCrsr->IsEndWordWT( nWordType ); - if (!bRet) - { - pPoint->nNode = rOldNode; - pPoint->nContent = nOldIndex; - } - else if (CURSOR_META == eType) - { - bRet = lcl_ForceIntoMeta(*pUnoCrsr, xParentText, META_CHECK_BOTH); - } + // restore old cursor if we are not at the end of a word by now + // otherwise use current one + bRet = rUnoCursor.IsEndWordWT( nWordType ); + if (!bRet) + { + pPoint->nNode = rOldNode; + pPoint->nContent = nOldIndex; } - else + else if (CURSOR_META == m_pImpl->m_eType) { - throw uno::RuntimeException(); + bRet = lcl_ForceIntoMeta(rUnoCursor, m_pImpl->m_xParentText, + META_CHECK_BOTH); } return bRet; @@ -1619,270 +1567,266 @@ sal_Bool SwXTextCursor::gotoEndOfWord(sal_Bool Expand) throw( uno::RuntimeExcept /*-- 09.12.98 14:18:46--------------------------------------------------- -----------------------------------------------------------------------*/ -sal_Bool SwXTextCursor::gotoStartOfWord(sal_Bool Expand) throw( uno::RuntimeException ) +sal_Bool SAL_CALL +SwXTextCursor::gotoStartOfWord(sal_Bool Expand) throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - SwUnoCrsr* pUnoCrsr = GetCrsr(); + + SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); sal_Bool bRet = sal_False; - if(pUnoCrsr) - { - SwPosition *pPoint = pUnoCrsr->GetPoint(); - SwNode &rOldNode = pPoint->nNode.GetNode(); - xub_StrLen nOldIndex = pPoint->nContent.GetIndex(); + SwPosition *const pPoint = rUnoCursor.GetPoint(); + SwNode & rOldNode = pPoint->nNode.GetNode(); + xub_StrLen const nOldIndex = pPoint->nContent.GetIndex(); - sal_Int16 nWordType = i18n::WordType::DICTIONARY_WORD; - SwUnoCursorHelper::SelectPam(*pUnoCrsr, Expand); - if(!pUnoCrsr->IsStartWordWT( nWordType )) - pUnoCrsr->GoStartWordWT( nWordType ); + const sal_Int16 nWordType = i18n::WordType::DICTIONARY_WORD; + SwUnoCursorHelper::SelectPam(rUnoCursor, Expand); + if (!rUnoCursor.IsStartWordWT( nWordType )) + { + rUnoCursor.GoStartWordWT( nWordType ); + } - // restore old cursor if we are not at the start of a word by now - // otherwise use current one - bRet = pUnoCrsr->IsStartWordWT( nWordType ); - if (!bRet) - { - pPoint->nNode = rOldNode; - pPoint->nContent = nOldIndex; - } - else if (CURSOR_META == eType) - { - bRet = lcl_ForceIntoMeta(*pUnoCrsr, xParentText, META_CHECK_BOTH); - } + // restore old cursor if we are not at the start of a word by now + // otherwise use current one + bRet = rUnoCursor.IsStartWordWT( nWordType ); + if (!bRet) + { + pPoint->nNode = rOldNode; + pPoint->nContent = nOldIndex; } - else + else if (CURSOR_META == m_pImpl->m_eType) { - throw uno::RuntimeException(); + bRet = lcl_ForceIntoMeta(rUnoCursor, m_pImpl->m_xParentText, + META_CHECK_BOTH); } return bRet; } + /*-- 09.12.98 14:18:46--------------------------------------------------- -----------------------------------------------------------------------*/ -sal_Bool SwXTextCursor::isStartOfSentence(void) throw( uno::RuntimeException ) +sal_Bool SAL_CALL +SwXTextCursor::isStartOfSentence() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - sal_Bool bRet = sal_False; - SwUnoCrsr* pUnoCrsr = GetCrsr(); - if(pUnoCrsr) + + SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + + // start of paragraph? + sal_Bool bRet = rUnoCursor.GetPoint()->nContent == 0; + // with mark ->no sentence start + // (check if cursor is no selection, i.e. it does not have + // a mark or else point and mark are identical) + if (!bRet && (!rUnoCursor.HasMark() || + *rUnoCursor.GetPoint() == *rUnoCursor.GetMark())) { - // start of paragraph? - bRet = pUnoCrsr->GetPoint()->nContent == 0; - // with mark ->no sentence start - // (check if cursor is no selection, i.e. it does not have - // a mark or else point and mark are identical) - if(!bRet && (!pUnoCrsr->HasMark() || - *pUnoCrsr->GetPoint() == *pUnoCrsr->GetMark())) - { - SwCursor aCrsr(*pUnoCrsr->GetPoint(),0,false); - SwPosition aOrigPos = *aCrsr.GetPoint(); - aCrsr.GoSentence(SwCursor::START_SENT ); - bRet = aOrigPos == *aCrsr.GetPoint(); - } + SwCursor aCrsr(*rUnoCursor.GetPoint(),0,false); + SwPosition aOrigPos = *aCrsr.GetPoint(); + aCrsr.GoSentence(SwCursor::START_SENT ); + bRet = aOrigPos == *aCrsr.GetPoint(); } - else - throw uno::RuntimeException(); return bRet; } /*-- 09.12.98 14:18:47--------------------------------------------------- -----------------------------------------------------------------------*/ -sal_Bool SwXTextCursor::isEndOfSentence(void) throw( uno::RuntimeException ) +sal_Bool SAL_CALL +SwXTextCursor::isEndOfSentence() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - sal_Bool bRet = sal_False; - SwUnoCrsr* pUnoCrsr = GetCrsr(); - if(pUnoCrsr) + + SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + + // end of paragraph? + sal_Bool bRet = rUnoCursor.GetCntntNode() && + (rUnoCursor.GetPoint()->nContent == rUnoCursor.GetCntntNode()->Len()); + // with mark->no sentence end + // (check if cursor is no selection, i.e. it does not have + // a mark or else point and mark are identical) + if (!bRet && (!rUnoCursor.HasMark() || + *rUnoCursor.GetPoint() == *rUnoCursor.GetMark())) { - //end of paragraph? - bRet = pUnoCrsr->GetCntntNode() && - pUnoCrsr->GetPoint()->nContent == pUnoCrsr->GetCntntNode()->Len(); - // with mark->no sentence end - // (check if cursor is no selection, i.e. it does not have - // a mark or else point and mark are identical) - if(!bRet && (!pUnoCrsr->HasMark() || - *pUnoCrsr->GetPoint() == *pUnoCrsr->GetMark())) - { - SwCursor aCrsr(*pUnoCrsr->GetPoint(),0,false); - SwPosition aOrigPos = *aCrsr.GetPoint(); - aCrsr.GoSentence(SwCursor::END_SENT ); - bRet = aOrigPos == *aCrsr.GetPoint(); - } + SwCursor aCrsr(*rUnoCursor.GetPoint(), 0, false); + SwPosition aOrigPos = *aCrsr.GetPoint(); + aCrsr.GoSentence(SwCursor::END_SENT); + bRet = aOrigPos == *aCrsr.GetPoint(); } - else - throw uno::RuntimeException(); return bRet; } + /*-- 09.12.98 14:18:47--------------------------------------------------- -----------------------------------------------------------------------*/ -sal_Bool SwXTextCursor::gotoNextSentence(sal_Bool Expand) throw( uno::RuntimeException ) +sal_Bool SAL_CALL +SwXTextCursor::gotoNextSentence(sal_Bool Expand) throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - sal_Bool bRet = sal_False; - SwUnoCrsr* pUnoCrsr = GetCrsr(); - if(pUnoCrsr) + + SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + + const bool bWasEOS = isEndOfSentence(); + SwUnoCursorHelper::SelectPam(rUnoCursor, Expand); + sal_Bool bRet = rUnoCursor.GoSentence(SwCursor::NEXT_SENT); + if (!bRet) { - BOOL bWasEOS = isEndOfSentence(); - SwUnoCursorHelper::SelectPam(*pUnoCrsr, Expand); - bRet = pUnoCrsr->GoSentence(SwCursor::NEXT_SENT); - if(!bRet) - bRet = pUnoCrsr->MovePara(fnParaNext, fnParaStart); + bRet = rUnoCursor.MovePara(fnParaNext, fnParaStart); + } - // if at the end of the sentence (i.e. at the space after the '.') - // advance to next word in order for GoSentence to work properly - // next time and have isStartOfSentence return true after this call - if (!pUnoCrsr->IsStartWord()) - { - BOOL bNextWord = pUnoCrsr->GoNextWord(); - if (bWasEOS && !bNextWord) - bRet = sal_False; - } - if (CURSOR_META == eType) + // if at the end of the sentence (i.e. at the space after the '.') + // advance to next word in order for GoSentence to work properly + // next time and have isStartOfSentence return true after this call + if (!rUnoCursor.IsStartWord()) + { + const bool bNextWord = rUnoCursor.GoNextWord(); + if (bWasEOS && !bNextWord) { - bRet = lcl_ForceIntoMeta(*pUnoCrsr, xParentText, META_CHECK_BOTH) - && bRet; + bRet = sal_False; } } - else - throw uno::RuntimeException(); + if (CURSOR_META == m_pImpl->m_eType) + { + bRet = lcl_ForceIntoMeta(rUnoCursor, m_pImpl->m_xParentText, + META_CHECK_BOTH) + && bRet; + } return bRet; } /*-- 09.12.98 14:18:47--------------------------------------------------- -----------------------------------------------------------------------*/ -sal_Bool SwXTextCursor::gotoPreviousSentence(sal_Bool Expand) throw( uno::RuntimeException ) +sal_Bool SAL_CALL +SwXTextCursor::gotoPreviousSentence(sal_Bool Expand) +throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - sal_Bool bRet = sal_False; - SwUnoCrsr* pUnoCrsr = GetCrsr(); - if(pUnoCrsr) + + SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + + SwUnoCursorHelper::SelectPam(rUnoCursor, Expand); + sal_Bool bRet = rUnoCursor.GoSentence(SwCursor::PREV_SENT); + if (!bRet) { - SwUnoCursorHelper::SelectPam(*pUnoCrsr, Expand); - bRet = pUnoCrsr->GoSentence(SwCursor::PREV_SENT); - if(!bRet) - { - if(0 != (bRet = pUnoCrsr->MovePara(fnParaPrev, fnParaStart))) - { - pUnoCrsr->MovePara(fnParaCurr, fnParaEnd); - //at the end of a paragraph move to the sentence end again - // - pUnoCrsr->GoSentence(SwCursor::PREV_SENT); - } - } - if (CURSOR_META == eType) + bRet = rUnoCursor.MovePara(fnParaPrev, fnParaStart); + if (bRet) { - bRet = lcl_ForceIntoMeta(*pUnoCrsr, xParentText, META_CHECK_BOTH) - && bRet; + rUnoCursor.MovePara(fnParaCurr, fnParaEnd); + // at the end of a paragraph move to the sentence end again + rUnoCursor.GoSentence(SwCursor::PREV_SENT); } } - else - throw uno::RuntimeException(); + if (CURSOR_META == m_pImpl->m_eType) + { + bRet = lcl_ForceIntoMeta(rUnoCursor, m_pImpl->m_xParentText, + META_CHECK_BOTH) + && bRet; + } return bRet; } + /* -----------------15.10.99 08:24------------------- --------------------------------------------------*/ -sal_Bool SwXTextCursor::gotoStartOfSentence(sal_Bool Expand) throw( uno::RuntimeException ) +sal_Bool SAL_CALL +SwXTextCursor::gotoStartOfSentence(sal_Bool Expand) +throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); + + SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + sal_Bool bRet = sal_False; - SwUnoCrsr* pUnoCrsr = GetCrsr(); - if(pUnoCrsr) - { - SwUnoCursorHelper::SelectPam(*pUnoCrsr, Expand); - // if we're at the para start then we wont move - // but bRet is also true if GoSentence failed but - // the start of the sentence is reached - bRet = SwUnoCursorHelper::IsStartOfPara(*pUnoCrsr) - || pUnoCrsr->GoSentence(SwCursor::START_SENT) || - SwUnoCursorHelper::IsStartOfPara(*pUnoCrsr); - if (CURSOR_META == eType) - { - bRet = lcl_ForceIntoMeta(*pUnoCrsr, xParentText, META_CHECK_BOTH) - && bRet; - } + SwUnoCursorHelper::SelectPam(rUnoCursor, Expand); + // if we're at the para start then we wont move + // but bRet is also true if GoSentence failed but + // the start of the sentence is reached + bRet = SwUnoCursorHelper::IsStartOfPara(rUnoCursor) + || rUnoCursor.GoSentence(SwCursor::START_SENT) + || SwUnoCursorHelper::IsStartOfPara(rUnoCursor); + if (CURSOR_META == m_pImpl->m_eType) + { + bRet = lcl_ForceIntoMeta(rUnoCursor, m_pImpl->m_xParentText, + META_CHECK_BOTH) + && bRet; } - else - throw uno::RuntimeException(); return bRet; } /* -----------------15.10.99 08:24------------------- --------------------------------------------------*/ -sal_Bool SwXTextCursor::gotoEndOfSentence(sal_Bool Expand) throw( uno::RuntimeException ) +sal_Bool SAL_CALL +SwXTextCursor::gotoEndOfSentence(sal_Bool Expand) throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); + + SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + sal_Bool bRet = sal_False; - SwUnoCrsr* pUnoCrsr = GetCrsr(); - if(pUnoCrsr) - { - SwUnoCursorHelper::SelectPam(*pUnoCrsr, Expand); - // bRet is true if GoSentence() succeeded or if the - // MovePara() succeeded while the end of the para is - // not reached already - sal_Bool bAlreadyParaEnd = SwUnoCursorHelper::IsEndOfPara(*pUnoCrsr); - bRet = !bAlreadyParaEnd && - (pUnoCrsr->GoSentence(SwCursor::END_SENT) || - pUnoCrsr->MovePara(fnParaCurr, fnParaEnd)); - if (CURSOR_META == eType) - { - bRet = lcl_ForceIntoMeta(*pUnoCrsr, xParentText, META_CHECK_BOTH) - && bRet; - } + SwUnoCursorHelper::SelectPam(rUnoCursor, Expand); + // bRet is true if GoSentence() succeeded or if the + // MovePara() succeeded while the end of the para is + // not reached already + sal_Bool bAlreadyParaEnd = SwUnoCursorHelper::IsEndOfPara(rUnoCursor); + bRet = !bAlreadyParaEnd + && (rUnoCursor.GoSentence(SwCursor::END_SENT) + || rUnoCursor.MovePara(fnParaCurr, fnParaEnd)); + if (CURSOR_META == m_pImpl->m_eType) + { + bRet = lcl_ForceIntoMeta(rUnoCursor, m_pImpl->m_xParentText, + META_CHECK_BOTH) + && bRet; } - else - throw uno::RuntimeException(); return bRet; } /*-- 09.12.98 14:18:48--------------------------------------------------- -----------------------------------------------------------------------*/ -sal_Bool SwXTextCursor::isStartOfParagraph(void) throw( uno::RuntimeException ) +sal_Bool SAL_CALL +SwXTextCursor::isStartOfParagraph() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - sal_Bool bRet = sal_False; - SwUnoCrsr* pUnoCrsr = GetCrsr(); - if(pUnoCrsr) - bRet = SwUnoCursorHelper::IsStartOfPara(*pUnoCrsr); - else - throw uno::RuntimeException(); + + SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + + const sal_Bool bRet = SwUnoCursorHelper::IsStartOfPara(rUnoCursor); return bRet; } /*-- 09.12.98 14:18:48--------------------------------------------------- -----------------------------------------------------------------------*/ -sal_Bool SwXTextCursor::isEndOfParagraph(void) throw( uno::RuntimeException ) +sal_Bool SAL_CALL +SwXTextCursor::isEndOfParagraph() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - sal_Bool bRet = sal_False; - SwUnoCrsr* pUnoCrsr = GetCrsr(); - if(pUnoCrsr) - bRet = SwUnoCursorHelper::IsEndOfPara(*pUnoCrsr); - else - throw uno::RuntimeException(); + + SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + + const sal_Bool bRet = SwUnoCursorHelper::IsEndOfPara(rUnoCursor); return bRet; } + /*-- 09.12.98 14:18:49--------------------------------------------------- -----------------------------------------------------------------------*/ -sal_Bool SwXTextCursor::gotoStartOfParagraph(sal_Bool Expand) throw( uno::RuntimeException ) +sal_Bool SAL_CALL +SwXTextCursor::gotoStartOfParagraph(sal_Bool Expand) +throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - sal_Bool bRet = sal_False; - if (CURSOR_META == eType) - return bRet; - SwUnoCrsr* pUnoCrsr = GetCrsr(); - if(pUnoCrsr ) + + SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + + if (CURSOR_META == m_pImpl->m_eType) { - SwUnoCursorHelper::SelectPam(*pUnoCrsr, Expand); - bRet = SwUnoCursorHelper::IsStartOfPara(*pUnoCrsr); - if(!bRet) - bRet = pUnoCrsr->MovePara(fnParaCurr, fnParaStart); + return sal_False; + } + SwUnoCursorHelper::SelectPam(rUnoCursor, Expand); + sal_Bool bRet = SwUnoCursorHelper::IsStartOfPara(rUnoCursor); + if (!bRet) + { + bRet = rUnoCursor.MovePara(fnParaCurr, fnParaStart); } - else - throw uno::RuntimeException(); // since MovePara(fnParaCurr, fnParaStart) only returns false // if we were already at the start of the paragraph this function @@ -1893,22 +1837,23 @@ sal_Bool SwXTextCursor::gotoStartOfParagraph(sal_Bool Expand) throw( uno::Runtim /*-- 09.12.98 14:18:49--------------------------------------------------- -----------------------------------------------------------------------*/ -sal_Bool SwXTextCursor::gotoEndOfParagraph(sal_Bool Expand) throw( uno::RuntimeException ) +sal_Bool SAL_CALL +SwXTextCursor::gotoEndOfParagraph(sal_Bool Expand) throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - sal_Bool bRet = sal_False; - if (CURSOR_META == eType) - return bRet; - SwUnoCrsr* pUnoCrsr = GetCrsr(); - if(pUnoCrsr) + + SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + + if (CURSOR_META == m_pImpl->m_eType) { - SwUnoCursorHelper::SelectPam(*pUnoCrsr, Expand); - bRet = SwUnoCursorHelper::IsEndOfPara(*pUnoCrsr); - if(!bRet) - bRet = pUnoCrsr->MovePara(fnParaCurr, fnParaEnd); + return sal_False; + } + SwUnoCursorHelper::SelectPam(rUnoCursor, Expand); + sal_Bool bRet = SwUnoCursorHelper::IsEndOfPara(rUnoCursor); + if (!bRet) + { + bRet = rUnoCursor.MovePara(fnParaCurr, fnParaEnd); } - else - throw uno::RuntimeException(); // since MovePara(fnParaCurr, fnParaEnd) only returns false // if we were already at the end of the paragraph this function @@ -1916,158 +1861,144 @@ sal_Bool SwXTextCursor::gotoEndOfParagraph(sal_Bool Expand) throw( uno::RuntimeE DBG_ASSERT( bRet, "gotoEndOfParagraph failed" ); return bRet; } + /*-- 09.12.98 14:18:50--------------------------------------------------- -----------------------------------------------------------------------*/ -sal_Bool SwXTextCursor::gotoNextParagraph(sal_Bool Expand) throw( uno::RuntimeException ) +sal_Bool SAL_CALL +SwXTextCursor::gotoNextParagraph(sal_Bool Expand) throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - sal_Bool bRet = sal_False; - if (CURSOR_META == eType) - return bRet; - SwUnoCrsr* pUnoCrsr = GetCrsr(); - if(pUnoCrsr) + + SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + + if (CURSOR_META == m_pImpl->m_eType) { - SwUnoCursorHelper::SelectPam(*pUnoCrsr, Expand); - bRet = pUnoCrsr->MovePara(fnParaNext, fnParaStart); + return sal_False; } - else - throw uno::RuntimeException(); + SwUnoCursorHelper::SelectPam(rUnoCursor, Expand); + const sal_Bool bRet = rUnoCursor.MovePara(fnParaNext, fnParaStart); return bRet; } /*-- 09.12.98 14:18:50--------------------------------------------------- -----------------------------------------------------------------------*/ -sal_Bool SwXTextCursor::gotoPreviousParagraph(sal_Bool Expand) throw( uno::RuntimeException ) +sal_Bool SAL_CALL +SwXTextCursor::gotoPreviousParagraph(sal_Bool Expand) +throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - sal_Bool bRet = sal_False; - if (CURSOR_META == eType) - return bRet; - SwUnoCrsr* pUnoCrsr = GetCrsr(); - if(pUnoCrsr) + + SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + + if (CURSOR_META == m_pImpl->m_eType) { - SwUnoCursorHelper::SelectPam(*pUnoCrsr, Expand); - bRet = pUnoCrsr->MovePara(fnParaPrev, fnParaStart); + return sal_False; } - else - throw uno::RuntimeException(); + SwUnoCursorHelper::SelectPam(rUnoCursor, Expand); + const sal_Bool bRet = rUnoCursor.MovePara(fnParaPrev, fnParaStart); return bRet; } + /*-- 09.12.98 14:18:50--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Reference< XText > SwXTextCursor::getText(void) throw( uno::RuntimeException ) +uno::Reference< text::XText > SAL_CALL +SwXTextCursor::getText() throw (uno::RuntimeException) { - return xParentText; + vos::OGuard g(Application::GetSolarMutex()); + + return m_pImpl->m_xParentText; } + /*-- 09.12.98 14:18:50--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Reference< XTextRange > SwXTextCursor::getStart(void) throw( uno::RuntimeException ) +uno::Reference< text::XTextRange > SAL_CALL +SwXTextCursor::getStart() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - uno::Reference< XTextRange > xRet; - SwUnoCrsr* pUnoCrsr = ((SwXTextCursor*)this)->GetCrsr(); - if( pUnoCrsr) + + SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + + uno::Reference< text::XTextRange > xRet; + SwPaM aPam(*rUnoCursor.Start()); + const uno::Reference< text::XText > xParent = getText(); + if (CURSOR_META == m_pImpl->m_eType) { - SwPaM aPam(*pUnoCrsr->Start()); - uno::Reference< XText > xParent = getText(); - if (CURSOR_META == eType) - { - // return cursor to prevent modifying SwXTextRange for META - SwXTextCursor * const pCursor( - new SwXTextCursor(xParent, *pUnoCrsr->GetPoint(), - CURSOR_META, pUnoCrsr->GetDoc()) ); - pCursor->gotoStart(sal_False); - xRet = static_cast(pCursor); - } - else - { - xRet = new SwXTextRange(aPam, xParent); - } + // return cursor to prevent modifying SwXTextRange for META + SwXTextCursor * const pXCursor( + new SwXTextCursor(*rUnoCursor.GetDoc(), xParent, CURSOR_META, + *rUnoCursor.GetPoint()) ); + pXCursor->gotoStart(sal_False); + xRet = static_cast(pXCursor); } else - throw uno::RuntimeException(); + { + xRet = new SwXTextRange(aPam, xParent); + } return xRet; } /*-- 09.12.98 14:18:51--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Reference< XTextRange > SwXTextCursor::getEnd(void) throw( uno::RuntimeException ) +uno::Reference< text::XTextRange > SAL_CALL +SwXTextCursor::getEnd() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - uno::Reference< XTextRange > xRet; - SwUnoCrsr* pUnoCrsr = ((SwXTextCursor*)this)->GetCrsr(); - if( pUnoCrsr) + + SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + + uno::Reference< text::XTextRange > xRet; + SwPaM aPam(*rUnoCursor.End()); + const uno::Reference< text::XText > xParent = getText(); + if (CURSOR_META == m_pImpl->m_eType) { - SwPaM aPam(*pUnoCrsr->End()); - uno::Reference< XText > xParent = getText(); - if (CURSOR_META == eType) - { - // return cursor to prevent modifying SwXTextRange for META - SwXTextCursor * const pCursor( - new SwXTextCursor(xParent, *pUnoCrsr->GetPoint(), - CURSOR_META, pUnoCrsr->GetDoc()) ); - pCursor->gotoEnd(sal_False); - xRet = static_cast(pCursor); - } - else - { - xRet = new SwXTextRange(aPam, xParent); - } + // return cursor to prevent modifying SwXTextRange for META + SwXTextCursor * const pXCursor( + new SwXTextCursor(*rUnoCursor.GetDoc(), xParent, CURSOR_META, + *rUnoCursor.GetPoint()) ); + pXCursor->gotoEnd(sal_False); + xRet = static_cast(pXCursor); } else - throw uno::RuntimeException(); + { + xRet = new SwXTextRange(aPam, xParent); + } return xRet; } + /*-- 09.12.98 14:18:51--------------------------------------------------- -----------------------------------------------------------------------*/ -OUString SwXTextCursor::getString(void) throw( uno::RuntimeException ) +OUString SAL_CALL SwXTextCursor::getString() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); + + SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + OUString aTxt; - SwUnoCrsr* pUnoCrsr = ((SwXTextCursor*)this)->GetCrsr(); - if( pUnoCrsr) - { -/* if( pUnoCrsr->GetPoint()->nNode.GetIndex() == - pUnoCrsr->GetMark()->nNode.GetIndex() ) - { - SwTxtNode* pTxtNd = pUnoCrsr->GetNode()->GetTxtNode(); - if( pTxtNd ) - { - sal_uInt16 nStt = pUnoCrsr->Start()->nContent.GetIndex(); - aTxt = pTxtNd->GetExpandTxt( nStt, - pUnoCrsr->End()->nContent.GetIndex() - nStt ); - } - } - else -*/ { - //Text ueber mehrere Absaetze - SwUnoCursorHelper::GetTextFromPam(*pUnoCrsr, aTxt); - } - } - else - throw uno::RuntimeException(); + SwUnoCursorHelper::GetTextFromPam(rUnoCursor, aTxt); return aTxt; } /*-- 09.12.98 14:18:52--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXTextCursor::setString(const OUString& aString) throw( uno::RuntimeException ) +void SAL_CALL +SwXTextCursor::setString(const OUString& aString) throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - SwUnoCrsr* pUnoCrsr = GetCrsr(); - if(!pUnoCrsr) - throw uno::RuntimeException(); - const bool bForceExpandHints( (CURSOR_META != eType) + SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + (void) rUnoCursor; // just to check if valid + + const bool bForceExpandHints( (CURSOR_META != m_pImpl->m_eType) ? false - : dynamic_cast(xParentText.get())->CheckForOwnMemberMeta( - *GetPaM(), true) ); + : dynamic_cast(m_pImpl->m_xParentText.get()) + ->CheckForOwnMemberMeta(*GetPaM(), true) ); DeleteAndInsert(aString, bForceExpandHints); } + /* -----------------------------03.05.00 12:56-------------------------------- ---------------------------------------------------------------------------*/ @@ -2374,11 +2305,15 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, } return aRet; } + /*-- 09.12.98 14:18:54--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Reference< beans::XPropertySetInfo > SwXTextCursor::getPropertySetInfo(void) throw( uno::RuntimeException ) +uno::Reference< beans::XPropertySetInfo > SAL_CALL +SwXTextCursor::getPropertySetInfo() throw (uno::RuntimeException) { + vos::OGuard g(Application::GetSolarMutex()); + static uno::Reference< beans::XPropertySetInfo > xRef; if(!xRef.is()) { @@ -2388,7 +2323,8 @@ uno::Reference< beans::XPropertySetInfo > SwXTextCursor::getPropertySetInfo(voi { SW_PROP_NAME(UNO_NAME_IS_SKIP_PROTECTED_TEXT), FN_SKIP_PROTECTED_TEXT, &::getBooleanCppuType(), PROPERTY_NONE, 0}, {0,0,0,0,0,0} }; - uno::Reference< beans::XPropertySetInfo > xInfo = m_pPropSet->getPropertySetInfo(); + const uno::Reference< beans::XPropertySetInfo > xInfo = + m_pImpl->m_rPropSet.getPropertySetInfo(); // PropertySetInfo verlaengern! const uno::Sequence aPropSeq = xInfo->getProperties(); xRef = new SfxExtItemPropertySetInfo( @@ -2397,283 +2333,361 @@ uno::Reference< beans::XPropertySetInfo > SwXTextCursor::getPropertySetInfo(voi } return xRef; } + /*-- 09.12.98 14:18:54--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXTextCursor::setPropertyValue(const OUString& rPropertyName, const uno::Any& aValue) - throw( beans::UnknownPropertyException, beans::PropertyVetoException, - lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL +SwXTextCursor::setPropertyValue( + const OUString& rPropertyName, const uno::Any& rValue) +throw (beans::UnknownPropertyException, beans::PropertyVetoException, + lang::IllegalArgumentException, lang::WrappedTargetException, + uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - SwUnoCrsr* pUnoCrsr = GetCrsr(); - if(pUnoCrsr) + + SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + + if (rPropertyName.equalsAsciiL(SW_PROP_NAME(UNO_NAME_IS_SKIP_HIDDEN_TEXT))) { - if(rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_IS_SKIP_HIDDEN_TEXT))) + sal_Bool bSet(sal_False); + if (!(rValue >>= bSet)) { - sal_Bool bSet = *(sal_Bool*)aValue.getValue(); - pUnoCrsr->SetSkipOverHiddenSections(bSet); - } - else if(rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_IS_SKIP_PROTECTED_TEXT))) - { - sal_Bool bSet = *(sal_Bool*)aValue.getValue(); - pUnoCrsr->SetSkipOverProtectSections(bSet); + throw lang::IllegalArgumentException(); } - else + rUnoCursor.SetSkipOverHiddenSections(bSet); + } + else if (rPropertyName.equalsAsciiL( + SW_PROP_NAME(UNO_NAME_IS_SKIP_PROTECTED_TEXT))) + { + sal_Bool bSet(sal_False); + if (!(rValue >>= bSet)) { - SwUnoCursorHelper::SetPropertyValue(*pUnoCrsr, - *m_pPropSet, rPropertyName, aValue); + throw lang::IllegalArgumentException(); } + rUnoCursor.SetSkipOverProtectSections(bSet); } else - throw uno::RuntimeException(); - + { + SwUnoCursorHelper::SetPropertyValue(rUnoCursor, + m_pImpl->m_rPropSet, rPropertyName, rValue); + } } + /*-- 09.12.98 14:18:55--------------------------------------------------- -----------------------------------------------------------------------*/ -Any SwXTextCursor::getPropertyValue(const OUString& rPropertyName) - throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) +uno::Any SAL_CALL +SwXTextCursor::getPropertyValue(const OUString& rPropertyName) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); + + SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + uno::Any aAny; - SwUnoCrsr* pUnoCrsr = GetCrsr(); - if(pUnoCrsr) + if (rPropertyName.equalsAsciiL(SW_PROP_NAME(UNO_NAME_IS_SKIP_HIDDEN_TEXT))) { - if(rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_IS_SKIP_HIDDEN_TEXT))) - { - BOOL bSet = pUnoCrsr->IsSkipOverHiddenSections(); - aAny.setValue(&bSet, ::getBooleanCppuType()); - } - else if(rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_IS_SKIP_PROTECTED_TEXT))) - { - BOOL bSet = pUnoCrsr->IsSkipOverProtectSections(); - aAny.setValue(&bSet, ::getBooleanCppuType()); - } - else - { - aAny = SwUnoCursorHelper::GetPropertyValue(*pUnoCrsr, - *m_pPropSet, rPropertyName); - } + const sal_Bool bSet = rUnoCursor.IsSkipOverHiddenSections(); + aAny <<= bSet; + } + else if (rPropertyName.equalsAsciiL( + SW_PROP_NAME(UNO_NAME_IS_SKIP_PROTECTED_TEXT))) + { + const sal_Bool bSet = rUnoCursor.IsSkipOverProtectSections(); + aAny <<= bSet; } else - throw uno::RuntimeException(); + { + aAny = SwUnoCursorHelper::GetPropertyValue(rUnoCursor, + m_pImpl->m_rPropSet, rPropertyName); + } return aAny; - } + /*-- 09.12.98 14:18:55--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXTextCursor::addPropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) +void SAL_CALL +SwXTextCursor::addPropertyChangeListener( + const ::rtl::OUString& /*rPropertyName*/, + const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { - DBG_WARNING("not implemented"); + OSL_ENSURE(false, + "SwXTextCursor::addPropertyChangeListener(): not implemented"); } + /*-- 09.12.98 14:18:57--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXTextCursor::removePropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) +void SAL_CALL +SwXTextCursor::removePropertyChangeListener( + const ::rtl::OUString& /*rPropertyName*/, + const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { - DBG_WARNING("not implemented"); + OSL_ENSURE(false, + "SwXTextCursor::removePropertyChangeListener(): not implemented"); } + /*-- 09.12.98 14:18:57--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXTextCursor::addVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) +void SAL_CALL +SwXTextCursor::addVetoableChangeListener( + const ::rtl::OUString& /*rPropertyName*/, + const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { - DBG_WARNING("not implemented"); + OSL_ENSURE(false, + "SwXTextCursor::addVetoableChangeListener(): not implemented"); } + /*-- 09.12.98 14:18:58--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXTextCursor::removeVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) +void SAL_CALL +SwXTextCursor::removeVetoableChangeListener( + const ::rtl::OUString& /*rPropertyName*/, + const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { - DBG_WARNING("not implemented"); + OSL_ENSURE(false, + "SwXTextCursor::removeVetoableChangeListener(): not implemented"); } + /*-- 05.03.99 11:36:11--------------------------------------------------- -----------------------------------------------------------------------*/ -beans::PropertyState SwXTextCursor::getPropertyState(const OUString& rPropertyName) - throw( beans::UnknownPropertyException, uno::RuntimeException ) +beans::PropertyState SAL_CALL +SwXTextCursor::getPropertyState(const OUString& rPropertyName) +throw (beans::UnknownPropertyException, uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - beans::PropertyState eRet = beans::PropertyState_DEFAULT_VALUE; - SwUnoCrsr* pUnoCrsr = GetCrsr(); - if(pUnoCrsr) - { - eRet = SwUnoCursorHelper::GetPropertyState( - *pUnoCrsr, *m_pPropSet, rPropertyName); - } - else - throw RuntimeException(); + + SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + + const beans::PropertyState eRet = SwUnoCursorHelper::GetPropertyState( + rUnoCursor, m_pImpl->m_rPropSet, rPropertyName); return eRet; } /*-- 05.03.99 11:36:11--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Sequence< beans::PropertyState > SwXTextCursor::getPropertyStates( - const uno::Sequence< OUString >& PropertyNames) - throw( beans::UnknownPropertyException, uno::RuntimeException ) +uno::Sequence< beans::PropertyState > SAL_CALL +SwXTextCursor::getPropertyStates( + const uno::Sequence< OUString >& rPropertyNames) +throw (beans::UnknownPropertyException, uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - SwUnoCrsr* pUnoCrsr = GetCrsr(); - if(!pUnoCrsr) - throw RuntimeException(); + + SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + return SwUnoCursorHelper::GetPropertyStates( - *pUnoCrsr, *m_pPropSet, PropertyNames); + rUnoCursor, m_pImpl->m_rPropSet, rPropertyNames); } + /*-- 05.03.99 11:36:12--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXTextCursor::setPropertyToDefault(const OUString& rPropertyName) - throw( beans::UnknownPropertyException, uno::RuntimeException ) +void SAL_CALL +SwXTextCursor::setPropertyToDefault(const OUString& rPropertyName) +throw (beans::UnknownPropertyException, uno::RuntimeException) { - Sequence < OUString > aSequence ( &rPropertyName, 1 ); + // forward: need no solar mutex here + uno::Sequence < OUString > aSequence ( &rPropertyName, 1 ); setPropertiesToDefault ( aSequence ); } /*-- 05.03.99 11:36:12--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Any SwXTextCursor::getPropertyDefault(const OUString& rPropertyName) - throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) +uno::Any SAL_CALL +SwXTextCursor::getPropertyDefault(const OUString& rPropertyName) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { - const Sequence < OUString > aSequence ( &rPropertyName, 1 ); + // forward: need no solar mutex here + const uno::Sequence < OUString > aSequence ( &rPropertyName, 1 ); return getPropertyDefaults ( aSequence ).getConstArray()[0]; } -void SAL_CALL SwXTextCursor::setAllPropertiesToDefault() - throw (RuntimeException) -{ - vos::OGuard aGuard(Application::GetSolarMutex()); +// para specific attribut ranges +static USHORT g_ParaResetableSetRange[] = { + RES_FRMATR_BEGIN, RES_FRMATR_END-1, + RES_PARATR_BEGIN, RES_PARATR_END-1, + // --> OD 2008-02-25 #refactorlists# + RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END-1, + // <-- + RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1, + 0 +}; + +// selection specific attribut ranges +static USHORT g_ResetableSetRange[] = { + RES_CHRATR_BEGIN, RES_CHRATR_END-1, + RES_TXTATR_INETFMT, RES_TXTATR_INETFMT, + RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT, + RES_TXTATR_CJK_RUBY, RES_TXTATR_CJK_RUBY, + RES_TXTATR_UNKNOWN_CONTAINER, RES_TXTATR_UNKNOWN_CONTAINER, + 0 +}; - SwUnoCrsr* pUnoCrsr = GetCrsr(); - if (pUnoCrsr) +static void +lcl_EnumerateIds(USHORT const* pIdRange, SvUShortsSort & rWhichIds) +{ + while (*pIdRange) { - // para specific attribut ranges - USHORT aParaResetableSetRange[] = { - RES_FRMATR_BEGIN, RES_FRMATR_END-1, - RES_PARATR_BEGIN, RES_PARATR_END-1, - // --> OD 2008-02-25 #refactorlists# - RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END-1, - // <-- - RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1, - 0 - }; - // selection specific attribut ranges - USHORT aResetableSetRange[] = { - RES_CHRATR_BEGIN, RES_CHRATR_END-1, - RES_TXTATR_INETFMT, RES_TXTATR_INETFMT, - RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT, - RES_TXTATR_CJK_RUBY, RES_TXTATR_CJK_RUBY, - RES_TXTATR_UNKNOWN_CONTAINER, RES_TXTATR_UNKNOWN_CONTAINER, - 0 - }; - SvUShortsSort aParaWhichIds; - SvUShortsSort aWhichIds; - for (USHORT k = 0; k < 2; ++k) + const USHORT nStart = sal::static_int_cast(*pIdRange++); + const USHORT nEnd = sal::static_int_cast(*pIdRange++); + for (USHORT nId = nStart + 1; nId <= nEnd; ++nId) { - SvUShortsSort &rWhichIds = k == 0? aParaWhichIds : aWhichIds; - USHORT *pResetableSetRange = k == 0? aParaResetableSetRange : aResetableSetRange; - while (*pResetableSetRange) - { - USHORT nStart = sal::static_int_cast< USHORT >(*pResetableSetRange++); - USHORT nEnd = sal::static_int_cast< USHORT >(*pResetableSetRange++); - for (USHORT nId = nStart + 1; nId <= nEnd; ++nId) - rWhichIds.Insert( nId ); - } + rWhichIds.Insert( nId ); } - if (aParaWhichIds.Count()) - lcl_SelectParaAndReset( *pUnoCrsr, *pUnoCrsr->GetDoc(), &aParaWhichIds ); - if (aWhichIds.Count() ) - pUnoCrsr->GetDoc()->ResetAttrs( *pUnoCrsr, sal_True, &aWhichIds ); } - else - throw uno::RuntimeException(); } -void SAL_CALL SwXTextCursor::setPropertiesToDefault( const Sequence< OUString >& aPropertyNames ) - throw (UnknownPropertyException, RuntimeException) +void SAL_CALL +SwXTextCursor::setAllPropertiesToDefault() +throw (uno::RuntimeException) +{ + vos::OGuard aGuard(Application::GetSolarMutex()); + + SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + + SvUShortsSort aParaWhichIds; + SvUShortsSort aWhichIds; + lcl_EnumerateIds(g_ParaResetableSetRange, aParaWhichIds); + lcl_EnumerateIds(g_ResetableSetRange, aWhichIds); + if (aParaWhichIds.Count()) + { + lcl_SelectParaAndReset(rUnoCursor, *rUnoCursor.GetDoc(), + &aParaWhichIds); + } + if (aWhichIds.Count()) + { + rUnoCursor.GetDoc()->ResetAttrs(rUnoCursor, sal_True, &aWhichIds); + } +} + +void SAL_CALL +SwXTextCursor::setPropertiesToDefault( + const uno::Sequence< OUString >& rPropertyNames) +throw (beans::UnknownPropertyException, uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - sal_Int32 nCount = aPropertyNames.getLength(); + + SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + + const sal_Int32 nCount = rPropertyNames.getLength(); if ( nCount ) { - SwUnoCrsr* pUnoCrsr = GetCrsr(); - if(pUnoCrsr) + SwDoc & rDoc = *rUnoCursor.GetDoc(); + const OUString * pNames = rPropertyNames.getConstArray(); + SvUShortsSort aWhichIds; + SvUShortsSort aParaWhichIds; + for (sal_Int32 i = 0; i < nCount; i++) { - SwDoc* pDoc = pUnoCrsr->GetDoc(); - const OUString * pNames = aPropertyNames.getConstArray(); - SvUShortsSort aWhichIds, aParaWhichIds; - for ( sal_Int32 i = 0; i < nCount; i++ ) + SfxItemPropertySimpleEntry const*const pEntry = + m_pImpl->m_rPropSet.getPropertyMap()->getByName( pNames[i] ); + if (!pEntry) { - const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName( pNames[i] ); - if(!pEntry) + if (pNames[i].equalsAsciiL( + SW_PROP_NAME(UNO_NAME_IS_SKIP_HIDDEN_TEXT)) || + pNames[i].equalsAsciiL( + SW_PROP_NAME(UNO_NAME_IS_SKIP_PROTECTED_TEXT))) { - if(pNames[i].equalsAsciiL( SW_PROP_NAME(UNO_NAME_IS_SKIP_HIDDEN_TEXT)) || - pNames[i].equalsAsciiL( SW_PROP_NAME(UNO_NAME_IS_SKIP_PROTECTED_TEXT))) - { - continue; - } - else - throw UnknownPropertyException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + pNames[i], static_cast < cppu::OWeakObject * > ( 0 ) ); + continue; } - if( pEntry->nFlags & PropertyAttribute::READONLY) - throw RuntimeException( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "setPropertiesToDefault: property is read-only: " ) ) + pNames[i], static_cast < cppu::OWeakObject * > ( this ) ); + throw beans::UnknownPropertyException( + OUString(RTL_CONSTASCII_USTRINGPARAM("Unknown property: ")) + + pNames[i], + static_cast(this)); + } + if (pEntry->nFlags & beans::PropertyAttribute::READONLY) + { + throw uno::RuntimeException( + OUString(RTL_CONSTASCII_USTRINGPARAM( + "setPropertiesToDefault: property is read-only: ")) + + pNames[i], + static_cast(this)); + } - if( pEntry->nWID < RES_FRMATR_END) + if (pEntry->nWID < RES_FRMATR_END) + { + if (pEntry->nWID < RES_PARATR_BEGIN) { - if(pEntry->nWID < RES_PARATR_BEGIN) - aWhichIds.Insert(pEntry->nWID); - else - aParaWhichIds.Insert (pEntry->nWID); + aWhichIds.Insert(pEntry->nWID); } - else if ( pEntry->nWID == FN_UNO_NUM_START_VALUE ) - SwUnoCursorHelper::resetCrsrPropertyValue(*pEntry, *pUnoCrsr); + else + { + aParaWhichIds.Insert(pEntry->nWID); + } + } + else if (pEntry->nWID == FN_UNO_NUM_START_VALUE) + { + SwUnoCursorHelper::resetCrsrPropertyValue(*pEntry, rUnoCursor); } + } - if ( aParaWhichIds.Count() ) - lcl_SelectParaAndReset ( *pUnoCrsr, *pDoc, &aParaWhichIds ); - if (aWhichIds.Count() ) - pDoc->ResetAttrs(*pUnoCrsr, sal_True, &aWhichIds); + if (aParaWhichIds.Count()) + { + lcl_SelectParaAndReset(rUnoCursor, rDoc, &aParaWhichIds); + } + if (aWhichIds.Count()) + { + rDoc.ResetAttrs(rUnoCursor, sal_True, &aWhichIds); } - else - throw uno::RuntimeException(); } } -Sequence< Any > SAL_CALL SwXTextCursor::getPropertyDefaults( const Sequence< OUString >& aPropertyNames ) - throw (UnknownPropertyException, WrappedTargetException, RuntimeException) + +uno::Sequence< uno::Any > SAL_CALL +SwXTextCursor::getPropertyDefaults( + const uno::Sequence< OUString >& rPropertyNames) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - sal_Int32 nCount = aPropertyNames.getLength(); - Sequence < Any > aRet ( nCount ); + + SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + + const sal_Int32 nCount = rPropertyNames.getLength(); + uno::Sequence< uno::Any > aRet(nCount); if ( nCount ) { - SwUnoCrsr* pUnoCrsr = GetCrsr(); - if (pUnoCrsr) + SwDoc & rDoc = *rUnoCursor.GetDoc(); + const OUString *pNames = rPropertyNames.getConstArray(); + uno::Any *pAny = aRet.getArray(); + for (sal_Int32 i = 0; i < nCount; i++) { - SwDoc* pDoc = pUnoCrsr->GetDoc(); - const OUString *pNames = aPropertyNames.getConstArray(); - Any *pAny = aRet.getArray(); - for ( sal_Int32 i = 0; i < nCount; i++) + SfxItemPropertySimpleEntry const*const pEntry = + m_pImpl->m_rPropSet.getPropertyMap()->getByName( pNames[i] ); + if (!pEntry) { - const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName( pNames[i] ); - if(!pEntry) + if (pNames[i].equalsAsciiL( + SW_PROP_NAME(UNO_NAME_IS_SKIP_HIDDEN_TEXT)) || + pNames[i].equalsAsciiL( + SW_PROP_NAME(UNO_NAME_IS_SKIP_PROTECTED_TEXT))) { - if(pNames[i].equalsAsciiL( SW_PROP_NAME(UNO_NAME_IS_SKIP_HIDDEN_TEXT)) || - pNames[i].equalsAsciiL( SW_PROP_NAME(UNO_NAME_IS_SKIP_PROTECTED_TEXT))) - { - continue; - } - else - throw UnknownPropertyException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + pNames[i], static_cast < cppu::OWeakObject * > ( 0 ) ); - } - if(pEntry->nWID < RES_FRMATR_END) - { - const SfxPoolItem& rDefItem = pDoc->GetAttrPool().GetDefaultItem(pEntry->nWID); - rDefItem.QueryValue(pAny[i], pEntry->nMemberId); + continue; } + throw beans::UnknownPropertyException( + OUString(RTL_CONSTASCII_USTRINGPARAM("Unknown property: ")) + + pNames[i], + static_cast(0)); + } + if (pEntry->nWID < RES_FRMATR_END) + { + const SfxPoolItem& rDefItem = + rDoc.GetAttrPool().GetDefaultItem(pEntry->nWID); + rDefItem.QueryValue(pAny[i], pEntry->nMemberId); } } - else - throw UnknownPropertyException(); } return aRet; } @@ -2681,17 +2695,17 @@ Sequence< Any > SAL_CALL SwXTextCursor::getPropertyDefaults( const Sequence< OUS /*-- 10.03.2008 09:58:47--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXTextCursor::makeRedline( +void SAL_CALL +SwXTextCursor::makeRedline( const ::rtl::OUString& rRedlineType, - const uno::Sequence< beans::PropertyValue >& rRedlineProperties ) - throw (lang::IllegalArgumentException, uno::RuntimeException) + const uno::Sequence< beans::PropertyValue >& rRedlineProperties) +throw (lang::IllegalArgumentException, uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - SwUnoCrsr* pUnoCrsr = GetCrsr(); - if(pUnoCrsr) - SwUnoCursorHelper::makeRedline( *pUnoCrsr, rRedlineType, rRedlineProperties ); - else - throw uno::RuntimeException(); + + SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + + SwUnoCursorHelper::makeRedline(rUnoCursor, rRedlineType, rRedlineProperties); } /*-- 09.12.98 14:18:58--------------------------------------------------- @@ -2704,12 +2718,9 @@ throw (lang::IllegalArgumentException, io::IOException, { vos::OGuard aGuard(Application::GetSolarMutex()); - SwUnoCrsr* pUnoCrsr = GetCrsr(); - if (!pUnoCrsr) - { - throw uno::RuntimeException(); - } - SwUnoCursorHelper::InsertFile(pUnoCrsr, rURL, rOptions); + SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + + SwUnoCursorHelper::InsertFile(&rUnoCursor, rURL, rOptions); } /* -----------------------------15.12.00 14:01-------------------------------- @@ -3056,46 +3067,41 @@ throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - SwSortOptions aSortOpt; - SwUnoCrsr* pUnoCrsr = GetCrsr(); - - if (!pUnoCrsr) - { - throw uno::RuntimeException(); - } + SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); - if (pUnoCrsr->HasMark()) + if (rUnoCursor.HasMark()) { + SwSortOptions aSortOpt; if (!SwUnoCursorHelper::ConvertSortProperties(rDescriptor, aSortOpt)) { - throw uno::RuntimeException(); + throw uno::RuntimeException(); } - UnoActionContext aContext( pUnoCrsr->GetDoc() ); + UnoActionContext aContext( rUnoCursor.GetDoc() ); - SwPosition* pStart = pUnoCrsr->Start(); - SwPosition* pEnd = pUnoCrsr->End(); + SwPosition & rStart = *rUnoCursor.Start(); + SwPosition & rEnd = *rUnoCursor.End(); - SwNodeIndex aPrevIdx( pStart->nNode, -1 ); - ULONG nOffset = pEnd->nNode.GetIndex() - pStart->nNode.GetIndex(); - xub_StrLen nCntStt = pStart->nContent.GetIndex(); + SwNodeIndex aPrevIdx( rStart.nNode, -1 ); + const ULONG nOffset = rEnd.nNode.GetIndex() - rStart.nNode.GetIndex(); + const xub_StrLen nCntStt = rStart.nContent.GetIndex(); - pUnoCrsr->GetDoc()->SortText(*pUnoCrsr, aSortOpt); + rUnoCursor.GetDoc()->SortText(rUnoCursor, aSortOpt); // Selektion wieder setzen - pUnoCrsr->DeleteMark(); - pUnoCrsr->GetPoint()->nNode.Assign( aPrevIdx.GetNode(), +1 ); - SwCntntNode* pCNd = pUnoCrsr->GetCntntNode(); + rUnoCursor.DeleteMark(); + rUnoCursor.GetPoint()->nNode.Assign( aPrevIdx.GetNode(), +1 ); + SwCntntNode *const pCNd = rUnoCursor.GetCntntNode(); xub_StrLen nLen = pCNd->Len(); if (nLen > nCntStt) { nLen = nCntStt; } - pUnoCrsr->GetPoint()->nContent.Assign(pCNd, nLen ); - pUnoCrsr->SetMark(); + rUnoCursor.GetPoint()->nContent.Assign(pCNd, nLen ); + rUnoCursor.SetMark(); - pUnoCrsr->GetPoint()->nNode += nOffset; - pCNd = pUnoCrsr->GetCntntNode(); - pUnoCrsr->GetPoint()->nContent.Assign( pCNd, pCNd->Len() ); + rUnoCursor.GetPoint()->nNode += nOffset; + SwCntntNode *const pCNd2 = rUnoCursor.GetCntntNode(); + rUnoCursor.GetPoint()->nContent.Assign( pCNd2, pCNd2->Len() ); } } @@ -3106,15 +3112,17 @@ uno::Reference< container::XEnumeration > SAL_CALL SwXTextCursor::createContentEnumeration(const OUString& rServiceName) throw (uno::RuntimeException) { - SwUnoCrsr* pUnoCrsr = GetCrsr(); - if (!pUnoCrsr || - 0 != rServiceName.compareToAscii("com.sun.star.text.TextContent")) + vos::OGuard g(Application::GetSolarMutex()); + + if (!rServiceName.equalsAscii("com.sun.star.text.TextContent")) { throw uno::RuntimeException(); } + SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + uno::Reference< container::XEnumeration > xRet = - new SwXParaFrameEnumeration(*pUnoCrsr, PARAFRAME_PORTION_TEXTRANGE); + new SwXParaFrameEnumeration(rUnoCursor, PARAFRAME_PORTION_TEXTRANGE); return xRet; } @@ -3124,18 +3132,16 @@ throw (uno::RuntimeException) uno::Reference< container::XEnumeration > SAL_CALL SwXTextCursor::createEnumeration() throw (uno::RuntimeException) { - SwUnoCrsr* pUnoCrsr = GetCrsr(); - if (!pUnoCrsr) - { - throw uno::RuntimeException(); - } - uno::Reference xTunnel(xParentText, UNO_QUERY); + vos::OGuard g(Application::GetSolarMutex()); + + SwUnoCrsr & rUnoCursor( m_pImpl->GetCursorOrThrow() ); + + const uno::Reference xTunnel( + m_pImpl->m_xParentText, uno::UNO_QUERY); SwXText* pParentText = 0; if (xTunnel.is()) { - pParentText = reinterpret_cast< SwXText *>( - sal::static_int_cast< sal_IntPtr >( - xTunnel->getSomething(SwXText::getUnoTunnelId()) )); + pParentText = ::sw::UnoTunnelGetImplementation(xTunnel); } DBG_ASSERT(pParentText, "parent is not a SwXText"); if (!pParentText) @@ -3144,15 +3150,15 @@ SwXTextCursor::createEnumeration() throw (uno::RuntimeException) } ::std::auto_ptr pNewCrsr( - pUnoCrsr->GetDoc()->CreateUnoCrsr(*pUnoCrsr->GetPoint()) ); - if (pUnoCrsr->HasMark()) + rUnoCursor.GetDoc()->CreateUnoCrsr(*rUnoCursor.GetPoint()) ); + if (rUnoCursor.HasMark()) { pNewCrsr->SetMark(); - *pNewCrsr->GetMark() = *pUnoCrsr->GetMark(); + *pNewCrsr->GetMark() = *rUnoCursor.GetMark(); } - const CursorType eSetType = (CURSOR_TBLTEXT == eType) + const CursorType eSetType = (CURSOR_TBLTEXT == m_pImpl->m_eType) ? CURSOR_SELECTION_IN_TABLE : CURSOR_SELECTION; - const uno::Reference< XEnumeration > xRet = + const uno::Reference< container::XEnumeration > xRet = new SwXParagraphEnumeration(pParentText, pNewCrsr, eSetType); return xRet; @@ -3164,7 +3170,7 @@ SwXTextCursor::createEnumeration() throw (uno::RuntimeException) uno::Type SAL_CALL SwXTextCursor::getElementType() throw (uno::RuntimeException) { - return ::getCppuType((uno::Reference*)0); + return text::XTextRange::static_type(); } /* -----------------------------07.03.01 15:43-------------------------------- diff --git a/sw/source/core/unocore/unoredline.cxx b/sw/source/core/unocore/unoredline.cxx index e1680cabecc2..a75bbd9ecfef 100644 --- a/sw/source/core/unocore/unoredline.cxx +++ b/sw/source/core/unocore/unoredline.cxx @@ -141,9 +141,9 @@ uno::Reference SwXRedlineText::createTextCursor(void) vos::OGuard aGuard(Application::GetSolarMutex()); SwPosition aPos(aNodeIndex); - SwXTextCursor* pCrsr = new SwXTextCursor(this, aPos, CURSOR_REDLINE, - GetDoc()); - SwUnoCrsr* pUnoCursor = pCrsr->GetCrsr(); + SwXTextCursor *const pXCursor = + new SwXTextCursor(*GetDoc(), this, CURSOR_REDLINE, aPos); + SwUnoCrsr *const pUnoCursor = pXCursor->GetCursor(); pUnoCursor->Move(fnMoveForward, fnGoNode); // #101929# prevent a newly created text cursor from running inside a table @@ -175,7 +175,7 @@ uno::Reference SwXRedlineText::createTextCursor(void) throw aExcept; } - return (text::XWordCursor*)pCrsr; + return static_cast(pXCursor); } /* --------------------------------------------------------------------------- @@ -716,8 +716,9 @@ uno::Reference< text::XTextCursor > SwXRedline::createTextCursor(void) throw( u if(pNodeIndex) { SwPosition aPos(*pNodeIndex); - SwXTextCursor* pCrsr = new SwXTextCursor(this, aPos, CURSOR_REDLINE, pDoc); - SwUnoCrsr* pUnoCrsr = pCrsr->GetCrsr(); + SwXTextCursor *const pXCursor = + new SwXTextCursor(*pDoc, this, CURSOR_REDLINE, aPos); + SwUnoCrsr *const pUnoCrsr = pXCursor->GetCursor(); pUnoCrsr->Move(fnMoveForward, fnGoNode); //steht hier eine Tabelle? @@ -731,7 +732,7 @@ uno::Reference< text::XTextCursor > SwXRedline::createTextCursor(void) throw( u } if(pCont) pUnoCrsr->GetPoint()->nContent.Assign(pCont, 0); - xRet = (text::XWordCursor*)pCrsr; + xRet = static_cast(pXCursor); } else { diff --git a/sw/source/core/unocore/unorefmk.cxx b/sw/source/core/unocore/unorefmk.cxx index 6b3ed8e04dd8..f084d1b63dfb 100644 --- a/sw/source/core/unocore/unorefmk.cxx +++ b/sw/source/core/unocore/unorefmk.cxx @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -638,8 +639,8 @@ void SwXMetaText::PrepareForAttach( uno::Reference & xRange, { // create a new cursor to prevent modifying SwXTextRange xRange = static_cast( - new SwXTextCursor(&m_rMeta, *rPam.GetPoint(), CURSOR_META, - GetDoc(), (rPam.HasMark()) ? rPam.GetMark() : 0)); + new SwXTextCursor(*GetDoc(), &m_rMeta, CURSOR_META, *rPam.GetPoint(), + (rPam.HasMark()) ? rPam.GetMark() : 0)); } bool SwXMetaText::CheckForOwnMemberMeta(const SwPaM & rPam, const bool bAbsorb) @@ -663,7 +664,7 @@ throw (uno::RuntimeException) { SwPosition aPos(*pTxtNode, nMetaStart); xRet = static_cast( - new SwXTextCursor(&m_rMeta, aPos, CURSOR_META, GetDoc())); + new SwXTextCursor(*GetDoc(), &m_rMeta, CURSOR_META, aPos)); } } return xRet; diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index b75d9dd93c0c..d0699acd82f4 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -1035,10 +1035,11 @@ uno::Reference< text::XTextCursor > SwXCell::createTextCursor(void) throw( uno: { const SwStartNode* pSttNd = pStartNode ? pStartNode : pBox->GetSttNd(); SwPosition aPos(*pSttNd); - SwXTextCursor* pCrsr = new SwXTextCursor(this, aPos, CURSOR_TBLTEXT, GetDoc()); - SwUnoCrsr* pUnoCrsr = pCrsr->GetCrsr(); + SwXTextCursor *const pXCursor = + new SwXTextCursor(*GetDoc(), this, CURSOR_TBLTEXT, aPos); + SwUnoCrsr *const pUnoCrsr = pXCursor->GetCursor(); pUnoCrsr->Move(fnMoveForward, fnGoNode); - aRef = (text::XWordCursor*)pCrsr; + aRef = static_cast(pXCursor); // // no Cursor in protected sections // SwCrsrSaveState aSave( *pUnoCrsr ); // if(pUnoCrsr->IsInProtectTable( sal_True ) || @@ -1068,7 +1069,11 @@ uno::Reference< text::XTextCursor > SwXCell::createTextCursorByRange(const uno: p1 = p1->StartOfSectionNode(); if( p1 == pSttNd ) - aRef = (text::XWordCursor*)new SwXTextCursor(this , *aPam.GetPoint(), CURSOR_TBLTEXT, GetDoc(), aPam.GetMark()); + { + aRef = static_cast( + new SwXTextCursor(*GetDoc(), this, CURSOR_TBLTEXT, + *aPam.GetPoint(), aPam.GetMark())); + } } else throw uno::RuntimeException(); diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index 72a86050fadf..d84ac7062981 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -116,7 +116,7 @@ uno::Reference< text::XTextCursor > SwXText::createCursor() throw (uno::Runtim SwNode& rNode = GetDoc()->GetNodes().GetEndOfContent(); SwPosition aPos(rNode); xRet = static_cast( - new SwXTextCursor(this, aPos, GetTextType(), GetDoc())); + new SwXTextCursor(*GetDoc(), this, GetTextType(), aPos)); xRet->gotoStart(sal_False); } return xRet; @@ -1437,7 +1437,7 @@ uno::Reference< text::XTextRange > SwXText::appendTextPortion( // SwPaM aPam(*pStartNode->EndOfSectionNode()); //aPam.Move( fnMoveBackward, fnGoNode ); - SwUnoCrsr* pCursor = pTextCursor->GetCrsr(); + SwUnoCrsr * pCursor = pTextCursor->GetCursor(); pCursor->MovePara( fnParaCurr, fnParaEnd ); pDoc->DontExpandFmt( *pCursor->Start() ); @@ -2326,7 +2326,7 @@ SwXTextCursor * SwXBodyText::CreateTextCursor(const bool bIgnoreTables) aPam.GetPoint()->nContent.Assign(pCont, 0); } } - return new SwXTextCursor(this, *aPam.GetPoint(), CURSOR_BODY, GetDoc()); + return new SwXTextCursor(*GetDoc(), this, CURSOR_BODY, *aPam.GetPoint()); } /*-- 10.12.98 11:17:29--------------------------------------------------- @@ -2374,7 +2374,11 @@ uno::Reference< text::XTextCursor > SwXBodyText::createTextCursorByRange( SwStartNode* p2 = rNode.StartOfSectionNode(); if(p1 == p2) - aRef = (text::XWordCursor*)new SwXTextCursor(this , *aPam.GetPoint(), CURSOR_BODY, GetDoc(), aPam.GetMark()); + { + aRef = static_cast( + new SwXTextCursor(*GetDoc(), this, CURSOR_BODY, + *aPam.GetPoint(), aPam.GetMark())); + } } if(!aRef.is()) throw uno::RuntimeException(); @@ -2554,8 +2558,9 @@ uno::Reference< text::XTextCursor > SwXHeadFootText::createTextCursor(void) thr const SwFmtCntnt& rFlyCntnt = pHeadFootFmt->GetCntnt(); const SwNode& rNode = rFlyCntnt.GetCntntIdx()->GetNode(); SwPosition aPos(rNode); - SwXTextCursor* pCrsr = new SwXTextCursor(this, aPos, bIsHeader ? CURSOR_HEADER : CURSOR_FOOTER, GetDoc()); - SwUnoCrsr* pUnoCrsr = pCrsr->GetCrsr(); + SwXTextCursor *const pXCursor = new SwXTextCursor(*GetDoc(), this, + (bIsHeader) ? CURSOR_HEADER : CURSOR_FOOTER, aPos); + SwUnoCrsr *const pUnoCrsr = pXCursor->GetCursor(); pUnoCrsr->Move(fnMoveForward, fnGoNode); //save current start node to be able to check if there is content after the table - @@ -2578,12 +2583,11 @@ uno::Reference< text::XTextCursor > SwXHeadFootText::createTextCursor(void) thr bIsHeader ? SwHeaderStartNode : SwFooterStartNode); if(!pNewStartNode || pNewStartNode != pOwnStartNode) { - pCrsr = NULL; uno::RuntimeException aExcept; aExcept.Message = S2U("no text available"); throw aExcept; } - xRet = (text::XWordCursor*)pCrsr; + xRet = static_cast(pXCursor); } else { @@ -2614,8 +2618,12 @@ uno::Reference< text::XTextCursor > SwXHeadFootText::createTextCursorByRange( SwStartNode* p1 = aPam.GetNode()->FindSttNodeByType( bIsHeader ? SwHeaderStartNode : SwFooterStartNode); if(p1 == pOwnStartNode) - xRet = (text::XWordCursor*)new SwXTextCursor(this, *aPam.GetPoint(), - bIsHeader ? CURSOR_HEADER : CURSOR_FOOTER, GetDoc(), aPam.GetMark()); + { + xRet = static_cast( + new SwXTextCursor(*GetDoc(), this, + (bIsHeader) ? CURSOR_HEADER : CURSOR_FOOTER, + *aPam.GetPoint(), aPam.GetMark())); + } } return xRet; } diff --git a/sw/source/filter/xml/XMLRedlineImportHelper.cxx b/sw/source/filter/xml/XMLRedlineImportHelper.cxx index bd1dea07179e..480cc3810e21 100644 --- a/sw/source/filter/xml/XMLRedlineImportHelper.cxx +++ b/sw/source/filter/xml/XMLRedlineImportHelper.cxx @@ -500,11 +500,11 @@ Reference XMLRedlineImportHelper::CreateRedlineTextSection( // create (UNO-) cursor SwPosition aPos(*pRedlineNode); - SwXTextCursor* pCursor = - new SwXTextCursor(pXText, aPos, CURSOR_REDLINE, pDoc); - pCursor->GetCrsr()->Move(fnMoveForward, fnGoNode); - - xReturn = (XWordCursor*)pCursor; // cast to avoid ambigiouty + SwXTextCursor *const pXCursor = + new SwXTextCursor(*pDoc, pXText, CURSOR_REDLINE, aPos); + pXCursor->GetCursor()->Move(fnMoveForward, fnGoNode); + // cast to avoid ambiguity + xReturn = static_cast(pXCursor); } // else: unknown redline -> Ignore diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index 374ee9ab0133..cc959988a767 100644 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -733,7 +733,7 @@ SwUnoCrsr* SwXTextDocument::CreateCursorForSearch(Reference< XTextCursor > & xC SwXTextCursor *const pXTextCursor = pBText->CreateTextCursor(true); xCrsr.set( static_cast(pXTextCursor) ); - SwUnoCrsr *const pUnoCrsr = pXTextCursor->GetCrsr(); + SwUnoCrsr *const pUnoCrsr = pXTextCursor->GetCursor(); pUnoCrsr->SetRemainInSection(sal_False); return pUnoCrsr; } @@ -987,7 +987,7 @@ Reference< XInterface > SwXTextDocument::findFirst(const Reference< util::XSear const uno::Reference< text::XText > xParent = ::sw::CreateParentXText(*pDocShell->GetDoc(), *pResultCrsr->GetPoint()); - xRet = *new SwXTextCursor(xParent, pResultCrsr); + xRet = *new SwXTextCursor(xParent, *pResultCrsr); delete pResultCrsr; } return xRet; @@ -1015,7 +1015,7 @@ Reference< XInterface > SwXTextDocument::findNext(const Reference< XInterface > ::sw::CreateParentXText(*pDocShell->GetDoc(), *pResultCrsr->GetPoint()); - xRet = *new SwXTextCursor(xParent, pResultCrsr); + xRet = *new SwXTextCursor(xParent, *pResultCrsr); delete pResultCrsr; } return xRet; -- cgit v1.2.3 From 817e682f25904005a810839d32a881df6760b8b6 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:56 +0100 Subject: swunolocking1: #i105557#: fix locking for SwXText: add Impl struct, and use UnoImplPtr to lock destructor. move all implementation details out of header, into Impl struct. use new XUnoTunnel and XServiceInfo helpers. clean up the implementation a little. --- sw/inc/unofootnote.hxx | 2 +- sw/inc/unoframe.hxx | 8 +- sw/inc/unotbl.hxx | 10 +- sw/inc/unotext.hxx | 63 +- sw/inc/unotextbodyhf.hxx | 2 +- sw/source/core/unocore/unoframe.cxx | 3 +- sw/source/core/unocore/unoftn.cxx | 3 +- sw/source/core/unocore/unoobj2.cxx | 2 +- sw/source/core/unocore/unorefmk.cxx | 11 +- sw/source/core/unocore/unotbl.cxx | 21 +- sw/source/core/unocore/unotext.cxx | 2127 ++++++++++++++++++----------------- 11 files changed, 1154 insertions(+), 1098 deletions(-) diff --git a/sw/inc/unofootnote.hxx b/sw/inc/unofootnote.hxx index d1c869404d32..8710f7effa03 100644 --- a/sw/inc/unofootnote.hxx +++ b/sw/inc/unofootnote.hxx @@ -85,7 +85,7 @@ protected: virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > - createCursor() + CreateCursor() throw (::com::sun::star::uno::RuntimeException); virtual ~SwXFootnote(); diff --git a/sw/inc/unoframe.hxx b/sw/inc/unoframe.hxx index d681e520d028..0aaaebbe7338 100644 --- a/sw/inc/unoframe.hxx +++ b/sw/inc/unoframe.hxx @@ -186,12 +186,18 @@ class SwXTextFrame : public SwXTextFrameBaseClass, protected: virtual const SwStartNode *GetStartNode() const; - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > createCursor()throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextCursor > + CreateCursor() + throw (::com::sun::star::uno::RuntimeException); + virtual ~SwXTextFrame(); public: SwXTextFrame(SwDoc *pDoc); SwXTextFrame(SwFrmFmt& rFmt); + // FIXME: EVIL HACK: make available for SwXFrame::attachToRange + void SetDoc(SwDoc *const pDoc) { SwXText::SetDoc(pDoc); }; virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException); virtual void SAL_CALL acquire( ) throw(); diff --git a/sw/inc/unotbl.hxx b/sw/inc/unotbl.hxx index a539c7384a39..d6daa705b739 100644 --- a/sw/inc/unotbl.hxx +++ b/sw/inc/unotbl.hxx @@ -106,13 +106,15 @@ class SwXCell : public SwXCellBaseClass, // table position where pBox was found last sal_uInt16 nFndPos; - using SwXText::IsValid; - protected: virtual const SwStartNode *GetStartNode() const; - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > createCursor()throw(::com::sun::star::uno::RuntimeException); - sal_Bool IsValid(); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextCursor > + CreateCursor() + throw (::com::sun::star::uno::RuntimeException); + + bool IsValid() const; virtual ~SwXCell(); diff --git a/sw/inc/unotext.hxx b/sw/inc/unotext.hxx index 97a45ece73cf..3c805da5127c 100644 --- a/sw/inc/unotext.hxx +++ b/sw/inc/unotext.hxx @@ -40,8 +40,6 @@ #include #include -#include - #include @@ -75,28 +73,24 @@ class SwXText private: - SwDoc* pDoc; - BOOL bObjectValid; - CursorType eCrsrType; - const SfxItemPropertySet* m_pPropSet; - - virtual ::com::sun::star::uno::Reference< - ::com::sun::star::text::XTextRange > SAL_CALL - finishOrAppendParagraph( - bool bFinish, - const ::com::sun::star::uno::Sequence< - ::com::sun::star::beans::PropertyValue >& - rCharacterAndParagraphProperties) - throw (::com::sun::star::lang::IllegalArgumentException, - ::com::sun::star::uno::RuntimeException); + class Impl; + ::sw::UnoImplPtr m_pImpl; virtual void PrepareForAttach( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xRange, SwPaM const & rPam); + virtual bool CheckForOwnMemberMeta( + const SwPaM & rPam, const bool bAbsorb) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); protected: + bool IsValid() const; + void Invalidate(); + void SetDoc(SwDoc *const pDoc); + virtual ~SwXText(); public: /*not protected because C++ is retarded*/ @@ -104,41 +98,16 @@ public: /*not protected because C++ is retarded*/ public: - SwXText(SwDoc* pDc, CursorType eType); + SwXText(SwDoc *const pDoc, const enum CursorType eType); - const SwDoc* GetDoc() const { return pDoc; } - SwDoc* GetDoc() { return pDoc; } - - // SwDoc is set when SwXText is attached - void SetDoc(SwDoc* pDc) { - DBG_ASSERT(!pDoc || !pDc, "Doc schon gesetzt?"); - pDoc = pDc; - bObjectValid = 0 != pDc; - } - - void Invalidate() { bObjectValid = sal_False; } - BOOL IsValid() const { return bObjectValid; } - - CursorType GetTextType() { return eCrsrType; } + const SwDoc* GetDoc() const; + SwDoc* GetDoc(); virtual ::com::sun::star::uno::Reference< - ::com::sun::star::text::XTextCursor > createCursor() + ::com::sun::star::text::XTextCursor > + CreateCursor() throw (::com::sun::star::uno::RuntimeException); - INT16 ComparePositions( - const ::com::sun::star::uno::Reference< - ::com::sun::star::text::XTextRange>& xPos1, - const ::com::sun::star::uno::Reference< - ::com::sun::star::text::XTextRange>& xPos2) - throw (::com::sun::star::lang::IllegalArgumentException, - ::com::sun::star::uno::RuntimeException); - BOOL CheckForOwnMember(const SwXTextRange* pRange1, - const OTextCursorHelper* pCursor1) - throw (::com::sun::star::lang::IllegalArgumentException, - ::com::sun::star::uno::RuntimeException); - virtual bool CheckForOwnMemberMeta( - const SwPaM & rPam, const bool bAbsorb) - throw (::com::sun::star::lang::IllegalArgumentException, - ::com::sun::star::uno::RuntimeException); + // XInterface virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( diff --git a/sw/inc/unotextbodyhf.hxx b/sw/inc/unotextbodyhf.hxx index baab8bc15845..98656ca68c29 100644 --- a/sw/inc/unotextbodyhf.hxx +++ b/sw/inc/unotextbodyhf.hxx @@ -149,7 +149,7 @@ protected: virtual const SwStartNode *GetStartNode() const; virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > - createCursor() + CreateCursor() throw (::com::sun::star::uno::RuntimeException); virtual ~SwXHeadFootText(); diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index c9e9771a3bae..5c5c10d1b80f 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -2611,7 +2611,8 @@ const SwStartNode *SwXTextFrame::GetStartNode() const return pSttNd; } -uno::Reference< text::XTextCursor > SwXTextFrame::createCursor() throw ( uno::RuntimeException) +uno::Reference< text::XTextCursor > +SwXTextFrame::CreateCursor() throw (uno::RuntimeException) { return createTextCursor(); } diff --git a/sw/source/core/unocore/unoftn.cxx b/sw/source/core/unocore/unoftn.cxx index e98238967a11..3d3937f56524 100644 --- a/sw/source/core/unocore/unoftn.cxx +++ b/sw/source/core/unocore/unoftn.cxx @@ -375,7 +375,8 @@ const SwStartNode *SwXFootnote::GetStartNode() const return pSttNd; } -uno::Reference< text::XTextCursor > SwXFootnote::createCursor() throw ( uno::RuntimeException) +uno::Reference< text::XTextCursor > +SwXFootnote::CreateCursor() throw (uno::RuntimeException) { return createTextCursor(); } diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index 84d276e6618e..857638d872dc 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -1164,7 +1164,7 @@ bool XTextRangeToSwPaM( SwUnoInternalPaM & rToFill, if(pText) { const uno::Reference< text::XTextCursor > xTextCursor = - pText->createCursor(); + pText->CreateCursor(); xTextCursor->gotoEnd(sal_True); const uno::Reference xCrsrTunnel( xTextCursor, uno::UNO_QUERY); diff --git a/sw/source/core/unocore/unorefmk.cxx b/sw/source/core/unocore/unorefmk.cxx index f084d1b63dfb..7acabb196e22 100644 --- a/sw/source/core/unocore/unorefmk.cxx +++ b/sw/source/core/unocore/unorefmk.cxx @@ -594,11 +594,14 @@ private: protected: virtual const SwStartNode *GetStartNode() const; virtual uno::Reference< text::XTextCursor > - createCursor() throw (uno::RuntimeException); + CreateCursor() throw (uno::RuntimeException); public: SwXMetaText(SwDoc & rDoc, SwXMeta & rMeta); + /// make available for SwXMeta + void Invalidate() { SwXText::Invalidate(); }; + // XInterface virtual void SAL_CALL acquire() throw() { OSL_ENSURE(false, "ERROR: SwXMetaText::acquire"); } @@ -649,7 +652,7 @@ bool SwXMetaText::CheckForOwnMemberMeta(const SwPaM & rPam, const bool bAbsorb) return m_rMeta.CheckForOwnMemberMeta(rPam, bAbsorb); } -uno::Reference< text::XTextCursor > SwXMetaText::createCursor() +uno::Reference< text::XTextCursor > SwXMetaText::CreateCursor() throw (uno::RuntimeException) { uno::Reference< text::XTextCursor > xRet; @@ -680,7 +683,7 @@ SwXMetaText::getImplementationId() throw (uno::RuntimeException) uno::Reference< text::XTextCursor > SAL_CALL SwXMetaText::createTextCursor() throw (uno::RuntimeException) { - return createCursor(); + return CreateCursor(); } uno::Reference< text::XTextCursor > SAL_CALL @@ -688,7 +691,7 @@ SwXMetaText::createTextCursorByRange( const uno::Reference & xTextPosition) throw (uno::RuntimeException) { - const uno::Reference xCursor( createCursor() ); + const uno::Reference xCursor( CreateCursor() ); xCursor->gotoRange(xTextPosition, sal_False); return xCursor; } diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index d0699acd82f4..e17ba707c1a8 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -893,25 +893,32 @@ const SwStartNode *SwXCell::GetStartNode() const return pSttNd; } -uno::Reference< text::XTextCursor > SwXCell::createCursor() throw (uno::RuntimeException) +uno::Reference< text::XTextCursor > +SwXCell::CreateCursor() throw (uno::RuntimeException) { return createTextCursor(); } /*-- 11.12.98 10:56:24--------------------------------------------------- -----------------------------------------------------------------------*/ -sal_Bool SwXCell::IsValid() +bool SwXCell::IsValid() const { + // FIXME: this is now a const method, to make SwXText::IsValid invisible + // but the const_cast here are still ridiculous. TODO: find a better way. SwFrmFmt* pTblFmt = pBox ? GetFrmFmt() : 0; if(!pTblFmt) - pBox = 0; + { + const_cast(this)->pBox = 0; + } else { SwTable* pTable = SwTable::FindTable( pTblFmt ); - const SwTableBox* pFoundBox ; - pFoundBox = FindBox(pTable, pBox); - if(!pFoundBox) - pBox = 0; + SwTableBox const*const pFoundBox = + const_cast(this)->FindBox(pTable, pBox); + if (!pFoundBox) + { + const_cast(this)->pBox = 0; + } } return 0 != pBox; } diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index d84ac7062981..c45f8772a217 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -84,13 +84,92 @@ using ::rtl::OUString; const sal_Char cInvalidObject[] = "this object is invalid"; + /****************************************************************** * SwXText ******************************************************************/ + +class SwXText::Impl +{ + +public: + SwXText & m_rThis; + SfxItemPropertySet const& m_rPropSet; + const enum CursorType m_eType; + SwDoc * m_pDoc; + bool m_bIsValid; + + Impl( SwXText & rThis, + SwDoc *const pDoc, const enum CursorType eType) + : m_rThis(rThis) + , m_rPropSet(*aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT)) + , m_eType(eType) + , m_pDoc(pDoc) + , m_bIsValid(0 != pDoc) + { + } + + uno::Reference< text::XTextRange > + finishOrAppendParagraph( + const bool bFinish, + const uno::Sequence< beans::PropertyValue >& + rCharacterAndParagraphProperties) + throw (lang::IllegalArgumentException, uno::RuntimeException); + + sal_Int16 ComparePositions( + const uno::Reference& xPos1, + const uno::Reference& xPos2) + throw (lang::IllegalArgumentException, uno::RuntimeException); + + bool CheckForOwnMember(const SwPaM & rPaM) + throw (lang::IllegalArgumentException, uno::RuntimeException); +}; + +/* -----------------------------15.03.2002 12:39------------------------------ + + ---------------------------------------------------------------------------*/ +SwXText::SwXText(SwDoc *const pDoc, const enum CursorType eType) + : m_pImpl( new SwXText::Impl(*this, pDoc, eType) ) +{ +} +/*-- 09.12.98 12:43:55--------------------------------------------------- + + -----------------------------------------------------------------------*/ +SwXText::~SwXText() +{ +} + /*-- 09.12.98 12:44:07--------------------------------------------------- -----------------------------------------------------------------------*/ +const SwDoc * SwXText::GetDoc() const +{ + return m_pImpl->m_pDoc; +} + SwDoc * SwXText::GetDoc() +{ + return m_pImpl->m_pDoc; +} + +bool SwXText::IsValid() const +{ + return m_pImpl->m_bIsValid; +} + +void SwXText::Invalidate() +{ + m_pImpl->m_bIsValid = false; +} + +void SwXText::SetDoc(SwDoc *const pDoc) +{ + OSL_ENSURE(!m_pImpl->m_pDoc || !pDoc, + "SwXText::SetDoc: already have a doc?"); + m_pImpl->m_pDoc = pDoc; + m_pImpl->m_bIsValid = (0 != pDoc); +} + void SwXText::PrepareForAttach(uno::Reference< text::XTextRange > &, const SwPaM &) { @@ -99,7 +178,7 @@ SwXText::PrepareForAttach(uno::Reference< text::XTextRange > &, const SwPaM &) bool SwXText::CheckForOwnMemberMeta(const SwPaM &, const bool) throw (lang::IllegalArgumentException, uno::RuntimeException) { - ASSERT(CURSOR_META != eCrsrType, "should not be called!"); + ASSERT(CURSOR_META != m_pImpl->m_eType, "should not be called!"); return false; } @@ -108,7 +187,8 @@ const SwStartNode *SwXText::GetStartNode() const return GetDoc()->GetNodes().GetEndOfContent().StartOfSectionNode(); } -uno::Reference< text::XTextCursor > SwXText::createCursor() throw (uno::RuntimeException) +uno::Reference< text::XTextCursor > +SwXText::CreateCursor() throw (uno::RuntimeException) { uno::Reference< text::XTextCursor > xRet; if(IsValid()) @@ -116,525 +196,457 @@ uno::Reference< text::XTextCursor > SwXText::createCursor() throw (uno::Runtim SwNode& rNode = GetDoc()->GetNodes().GetEndOfContent(); SwPosition aPos(rNode); xRet = static_cast( - new SwXTextCursor(*GetDoc(), this, GetTextType(), aPos)); + new SwXTextCursor(*GetDoc(), this, m_pImpl->m_eType, aPos)); xRet->gotoStart(sal_False); } return xRet; } -/* -----------------------------15.03.2002 12:39------------------------------ - - ---------------------------------------------------------------------------*/ -SwXText::SwXText(SwDoc* pDc, CursorType eType) : - pDoc(pDc), - bObjectValid(0 != pDc), - eCrsrType(eType), - m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT)) -{ -} -/*-- 09.12.98 12:43:55--------------------------------------------------- - -----------------------------------------------------------------------*/ -SwXText::~SwXText() -{ -} /*-- 09.12.98 12:43:02--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Any SAL_CALL SwXText::queryInterface( const uno::Type& rType ) throw(uno::RuntimeException) -{ - const uno::Type& rXTextType = ::getCppuType((uno::Reference< text::XText >*)0); - const uno::Type& rXTextRangeCompareType = ::getCppuType((uno::Reference< text::XTextRangeCompare >*)0); - const uno::Type& rXSimpleTextType = ::getCppuType((const uno::Reference< XSimpleText >*)0); - const uno::Type& rXTextRangeType = ::getCppuType((uno::Reference< text::XTextRange >*)0); - const uno::Type& rXTypeProviderType = ::getCppuType((uno::Reference< lang::XTypeProvider >*)0); - const uno::Type& rXTextContentInsert = ::getCppuType((uno::Reference< text::XRelativeTextContentInsert >*)0); - const uno::Type& rXTextContentRemove = ::getCppuType((uno::Reference< text::XRelativeTextContentRemove >*)0); - const uno::Type& rXPropertySet = ::getCppuType((uno::Reference*)0); - const uno::Type& rXUnoTunnel = ::getCppuType((uno::Reference< lang::XUnoTunnel >*)0); - const uno::Type& rXTextPortionAppend = ::getCppuType((uno::Reference< text::XTextPortionAppend >*)0); - const uno::Type& rXParagraphAppend = ::getCppuType((uno::Reference< text::XParagraphAppend >*)0); - const uno::Type& rXTextContentAppend = ::getCppuType((uno::Reference< text::XTextContentAppend >*)0); - const uno::Type& rXTextConvert = ::getCppuType((uno::Reference< text::XTextConvert >*)0); - const uno::Type& rXTextAppend = ::getCppuType((uno::Reference< text::XTextAppend >*)0); - const uno::Type& rXTextAppendAndConvert = ::getCppuType((uno::Reference< text::XTextAppendAndConvert >*)0); - +uno::Any SAL_CALL +SwXText::queryInterface(const uno::Type& rType) throw (uno::RuntimeException) +{ uno::Any aRet; - if(rType == rXTextType) + if (rType == text::XText::static_type()) { - uno::Reference< text::XText > xRet = this; - aRet.setValue(&xRet, rXTextType); + aRet <<= uno::Reference< text::XText >(this); } - else if(rType == rXSimpleTextType) + else if (rType == text::XSimpleText::static_type()) { - uno::Reference< XSimpleText > xRet = this; - aRet.setValue(&xRet, rXSimpleTextType); + aRet <<= uno::Reference< text::XSimpleText >(this); } - else if(rType == rXTextRangeType) + else if (rType == text::XTextRange::static_type()) { - uno::Reference< text::XTextRange > xRet = this; - aRet.setValue(&xRet, rXTextRangeType); + aRet <<= uno::Reference< text::XTextRange>(this); } - else if(rType == rXTextRangeCompareType) + else if (rType == text::XTextRangeCompare::static_type()) { - uno::Reference< text::XTextRangeCompare > xRet = this; - aRet.setValue(&xRet, rXTextRangeCompareType); + aRet <<= uno::Reference< text::XTextRangeCompare >(this); } - else if(rType == rXTypeProviderType) + else if (rType == lang::XTypeProvider::static_type()) { - uno::Reference< lang::XTypeProvider > xRet = this; - aRet.setValue(&xRet, rXTypeProviderType); + aRet <<= uno::Reference< lang::XTypeProvider >(this); } - else if(rType == rXTextContentInsert) + else if (rType == text::XRelativeTextContentInsert::static_type()) { - uno::Reference< text::XRelativeTextContentInsert > xRet = this; - aRet.setValue(&xRet, rXTextContentInsert); + aRet <<= uno::Reference< text::XRelativeTextContentInsert >(this); } - else if(rType == rXTextContentRemove) + else if (rType == text::XRelativeTextContentRemove::static_type()) { - uno::Reference< text::XRelativeTextContentRemove > xRet = this; - aRet.setValue(&xRet, rXTextContentRemove); + aRet <<= uno::Reference< text::XRelativeTextContentRemove >(this); } - else if(rType == rXPropertySet) + else if (rType == beans::XPropertySet::static_type()) { - uno::Reference< beans::XPropertySet > xRet = this; - aRet.setValue(&xRet, rXPropertySet); + aRet <<= uno::Reference< beans::XPropertySet >(this); } - else if(rType == rXUnoTunnel ) + else if (rType == lang::XUnoTunnel::static_type()) { - uno::Reference< lang::XUnoTunnel > xRet = this; - aRet.setValue(&xRet, rXUnoTunnel); + aRet <<= uno::Reference< lang::XUnoTunnel >(this); } - else if(rType == rXTextAppendAndConvert ) + else if (rType == text::XTextAppendAndConvert::static_type()) { - uno::Reference< XTextAppendAndConvert > xRet = this; - aRet.setValue(&xRet, rXTextAppendAndConvert); + aRet <<= uno::Reference< text::XTextAppendAndConvert >(this); } - else if(rType == rXTextAppend ) + else if (rType == text::XTextAppend::static_type()) { - uno::Reference< XTextAppend > xRet = this; - aRet.setValue(&xRet, rXTextAppend); + aRet <<= uno::Reference< text::XTextAppend >(this); } - else if(rType == rXTextPortionAppend ) + else if (rType == text::XTextPortionAppend::static_type()) { - uno::Reference< XTextPortionAppend > xRet = this; - aRet.setValue(&xRet, rXTextPortionAppend); + aRet <<= uno::Reference< text::XTextPortionAppend >(this); } - else if(rType == rXParagraphAppend ) + else if (rType == text::XParagraphAppend::static_type()) { - uno::Reference< XParagraphAppend > xRet = this; - aRet.setValue(&xRet, rXParagraphAppend ); + aRet <<= uno::Reference< text::XParagraphAppend >(this); } - else if(rType == rXTextConvert ) + else if (rType == text::XTextConvert::static_type() ) { - uno::Reference< XTextConvert > xRet = this; - aRet.setValue(&xRet, rXParagraphAppend ); + aRet <<= uno::Reference< text::XTextConvert >(this); } - else if(rType == rXTextContentAppend ) + else if (rType == text::XTextContentAppend::static_type()) { - uno::Reference< XTextContentAppend > xRet = this; - aRet.setValue(&xRet, rXTextContentAppend ); + aRet <<= uno::Reference< text::XTextContentAppend >(this); } return aRet; } /* -----------------------------15.03.00 17:42-------------------------------- ---------------------------------------------------------------------------*/ -uno::Sequence< uno::Type > SAL_CALL SwXText::getTypes() throw(uno::RuntimeException) +uno::Sequence< uno::Type > SAL_CALL +SwXText::getTypes() throw (uno::RuntimeException) { uno::Sequence< uno::Type > aRet(12); uno::Type* pTypes = aRet.getArray(); - pTypes[0] = ::getCppuType((uno::Reference< text::XText >*)0); - pTypes[1] = ::getCppuType((uno::Reference< text::XTextRangeCompare >*)0); - pTypes[2] = ::getCppuType((uno::Reference< text::XRelativeTextContentInsert >*)0); - pTypes[3] = ::getCppuType((uno::Reference< text::XRelativeTextContentRemove >*)0); - pTypes[4] = ::getCppuType((uno::Reference< lang::XUnoTunnel >*)0); - pTypes[5] = ::getCppuType((uno::Reference< beans::XPropertySet >*)0); - pTypes[6] = ::getCppuType((uno::Reference< text::XTextPortionAppend >*)0); - pTypes[7] = ::getCppuType((uno::Reference< text::XParagraphAppend >*)0); - pTypes[8] = ::getCppuType((uno::Reference< text::XTextContentAppend >*)0); - pTypes[9] = ::getCppuType((uno::Reference< text::XTextConvert >*)0); - pTypes[10] = ::getCppuType((uno::Reference< text::XTextAppend >*)0); - pTypes[11] = ::getCppuType((uno::Reference< text::XTextAppendAndConvert >*)0); + pTypes[0] = text::XText::static_type(); + pTypes[1] = text::XTextRangeCompare::static_type(); + pTypes[2] = text::XRelativeTextContentInsert::static_type(); + pTypes[3] = text::XRelativeTextContentRemove::static_type(); + pTypes[4] = lang::XUnoTunnel::static_type(); + pTypes[5] = beans::XPropertySet::static_type(); + pTypes[6] = text::XTextPortionAppend::static_type(); + pTypes[7] = text::XParagraphAppend::static_type(); + pTypes[8] = text::XTextContentAppend::static_type(); + pTypes[9] = text::XTextConvert::static_type(); + pTypes[10] = text::XTextAppend::static_type(); + pTypes[11] = text::XTextAppendAndConvert::static_type(); return aRet; } // belongs the range in the text ? insert it then. -void SwXText::insertString(const uno::Reference< text::XTextRange >& xTextRange, - const OUString& aString, - sal_Bool bAbsorb) - throw( uno::RuntimeException ) +void SAL_CALL +SwXText::insertString(const uno::Reference< text::XTextRange >& xTextRange, + const OUString& rString, sal_Bool bAbsorb) +throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - if(GetDoc() && xTextRange.is()) + + if (!xTextRange.is()) { - uno::Reference xRangeTunnel( xTextRange, uno::UNO_QUERY); - SwXTextRange* pRange = 0; - OTextCursorHelper* pCursor = 0; - if(xRangeTunnel.is()) + throw uno::RuntimeException(); + } + if (!GetDoc()) + { + throw uno::RuntimeException(); + } + const uno::Reference xRangeTunnel(xTextRange, + uno::UNO_QUERY); + SwXTextRange *const pRange = + ::sw::UnoTunnelGetImplementation(xRangeTunnel); + OTextCursorHelper *const pCursor = + ::sw::UnoTunnelGetImplementation(xRangeTunnel); + if ((!pRange || pRange ->GetDoc() != GetDoc()) && + (!pCursor || pCursor->GetDoc() != GetDoc())) + { + throw uno::RuntimeException(); + } + + const SwStartNode *const pOwnStartNode = GetStartNode(); + SwPaM aPam(GetDoc()->GetNodes()); + const SwPaM * pPam(0); + if (pCursor) + { + pPam = pCursor->GetPaM(); + } + else // pRange + { + if (pRange->GetPositions(aPam)) { - pRange = reinterpret_cast< SwXTextRange * >( - sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( SwXTextRange::getUnoTunnelId()) )); - pCursor = reinterpret_cast< OTextCursorHelper * >( - sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( OTextCursorHelper::getUnoTunnelId()) )); + pPam = &aPam; } + } + if (!pPam) + { + throw uno::RuntimeException(); + } - if(pRange && pRange->GetDoc() == GetDoc() || - pCursor && pCursor->GetDoc() == GetDoc()) - { - const SwStartNode *const pOwnStartNode = GetStartNode(); - SwPaM aPam(GetDoc()->GetNodes()); - const SwPaM * pPam(0); - if (pCursor) - { - pPam = pCursor->GetPaM(); - } - else // pRange - { - if (pRange->GetPositions(aPam)) - { - pPam = &aPam; - } - } - if (!pPam) - { - throw uno::RuntimeException(); - } - else - { - const SwStartNode* pTmp(pPam->GetNode()->StartOfSectionNode()); - while (pTmp && pTmp->IsSectionNode()) - { - pTmp = pTmp->StartOfSectionNode(); - } - if (!pOwnStartNode || (pOwnStartNode != pTmp)) - { - throw uno::RuntimeException(); - } - } + const SwStartNode* pTmp(pPam->GetNode()->StartOfSectionNode()); + while (pTmp && pTmp->IsSectionNode()) + { + pTmp = pTmp->StartOfSectionNode(); + } + if (!pOwnStartNode || (pOwnStartNode != pTmp)) + { + throw uno::RuntimeException(); + } - bool bForceExpandHints( false ); - if (CURSOR_META == eCrsrType) - { - try - { - bForceExpandHints = CheckForOwnMemberMeta(*pPam, bAbsorb); - } - catch (lang::IllegalArgumentException & iae) - { - // stupid method not allowed to throw iae - throw uno::RuntimeException(iae.Message, 0); - } - } - if(bAbsorb) + bool bForceExpandHints( false ); + if (CURSOR_META == m_pImpl->m_eType) + { + try + { + bForceExpandHints = CheckForOwnMemberMeta(*pPam, bAbsorb); + } + catch (lang::IllegalArgumentException & iae) + { + // stupid method not allowed to throw iae + throw uno::RuntimeException(iae.Message, 0); + } + } + if (bAbsorb) + { + //!! scan for CR characters and inserting the paragraph breaks + //!! has to be done in the called function. + //!! Implemented in SwXTextRange::DeleteAndInsert + if (pCursor) + { + SwXTextCursor * const pTextCursor( + dynamic_cast(pCursor) ); + if (pTextCursor) { - //!! scan for CR characters and inserting the paragraph breaks - //!! has to be done in the called function. - //!! Implemented in SwXTextRange::DeleteAndInsert - if (pCursor) - { - SwXTextCursor * const pTextCursor( dynamic_cast(pCursor) ); - if (pTextCursor) - { - pTextCursor->DeleteAndInsert(aString, bForceExpandHints); - } - else - { - xTextRange->setString(aString); - } - } - else - { - pRange->DeleteAndInsert(aString, bForceExpandHints); - } + pTextCursor->DeleteAndInsert(rString, bForceExpandHints); } else { - //hier wird ein PaM angelegt, der vor dem Parameter-PaM liegt, damit der - //Text davor eingefuegt wird - UnoActionContext aContext(GetDoc()); - SwPaM aInsertPam(*pPam->Start()); - const sal_Bool bGroupUndo = GetDoc()->DoesGroupUndo(); - GetDoc()->DoGroupUndo(sal_False); - - SwUnoCursorHelper::DocInsertStringSplitCR( - *GetDoc(), aInsertPam, aString, bForceExpandHints ); - GetDoc()->DoGroupUndo(bGroupUndo); + xTextRange->setString(rString); } } else - throw uno::RuntimeException(); + { + pRange->DeleteAndInsert(rString, bForceExpandHints); + } } else - throw uno::RuntimeException(); + { + // create a PaM positioned before the parameter PaM, + // so the text is inserted before + UnoActionContext aContext(GetDoc()); + SwPaM aInsertPam(*pPam->Start()); + const sal_Bool bGroupUndo = GetDoc()->DoesGroupUndo(); + GetDoc()->DoGroupUndo(sal_False); + + SwUnoCursorHelper::DocInsertStringSplitCR( + *GetDoc(), aInsertPam, rString, bForceExpandHints ); + GetDoc()->DoGroupUndo(bGroupUndo); + } } /*-- 09.12.98 12:43:16--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXText::insertControlCharacter(const uno::Reference< text::XTextRange > & xTextRange, - sal_Int16 nControlCharacter, sal_Bool bAbsorb) - throw( lang::IllegalArgumentException, uno::RuntimeException ) +void SAL_CALL +SwXText::insertControlCharacter( + const uno::Reference< text::XTextRange > & xTextRange, + sal_Int16 nControlCharacter, sal_Bool bAbsorb) +throw (lang::IllegalArgumentException, uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); + if (!xTextRange.is()) + { throw lang::IllegalArgumentException(); - if (GetDoc()) + } + if (!GetDoc()) { - SwUnoInternalPaM aPam(*GetDoc()); - if (::sw::XTextRangeToSwPaM(aPam, xTextRange)) + throw uno::RuntimeException(); + } + + SwUnoInternalPaM aPam(*GetDoc()); + if (!::sw::XTextRangeToSwPaM(aPam, xTextRange)) + { + throw uno::RuntimeException(); + } + const bool bForceExpandHints(CheckForOwnMemberMeta(aPam, bAbsorb)); + + const enum IDocumentContentOperations::InsertFlags nInsertFlags = + (bForceExpandHints) + ? static_cast( + IDocumentContentOperations::INS_FORCEHINTEXPAND | + IDocumentContentOperations::INS_EMPTYEXPAND) + : IDocumentContentOperations::INS_EMPTYEXPAND; + + SwPaM aTmp(*aPam.Start()); + if (bAbsorb && aPam.HasMark()) + { + m_pImpl->m_pDoc->DeleteAndJoin(aPam); + } + + sal_Unicode cIns = 0; + switch (nControlCharacter) + { + case text::ControlCharacter::PARAGRAPH_BREAK : + // a table cell now becomes an ordinary text cell! + m_pImpl->m_pDoc->ClearBoxNumAttrs( aTmp.GetPoint()->nNode ); + m_pImpl->m_pDoc->SplitNode( *aTmp.GetPoint(), sal_False ); + break; + case text::ControlCharacter::APPEND_PARAGRAPH: { - const bool bForceExpandHints(CheckForOwnMemberMeta(aPam, bAbsorb)); - - const enum IDocumentContentOperations::InsertFlags nInsertFlags = - (bForceExpandHints) - ? static_cast( - IDocumentContentOperations::INS_FORCEHINTEXPAND | - IDocumentContentOperations::INS_EMPTYEXPAND) - : IDocumentContentOperations::INS_EMPTYEXPAND; - - //Steuerzeichen einfuegen - SwPaM aTmp(*aPam.Start()); - if(bAbsorb && aPam.HasMark()) + m_pImpl->m_pDoc->ClearBoxNumAttrs( aTmp.GetPoint()->nNode ); + m_pImpl->m_pDoc->AppendTxtNode( *aTmp.GetPoint() ); + + const uno::Reference xRangeTunnel( + xTextRange, uno::UNO_QUERY); + SwXTextRange *const pRange = + ::sw::UnoTunnelGetImplementation(xRangeTunnel); + OTextCursorHelper *const pCursor = + ::sw::UnoTunnelGetImplementation( + xRangeTunnel); + if (pRange) { - pDoc->DeleteAndJoin(aPam); + pRange->SetPositions(aTmp); } - - sal_Unicode cIns = 0; - switch( nControlCharacter ) + else if (pCursor) { - case text::ControlCharacter::PARAGRAPH_BREAK : - // eine Tabellen Zelle wird jetzt zu einer normalen Textzelle! - pDoc->ClearBoxNumAttrs( aTmp.GetPoint()->nNode ); - pDoc->SplitNode( *aTmp.GetPoint(), sal_False ); - break; - case text::ControlCharacter::APPEND_PARAGRAPH: - { - pDoc->ClearBoxNumAttrs( aTmp.GetPoint()->nNode ); - pDoc->AppendTxtNode( *aTmp.GetPoint() ); - - uno::Reference xRangeTunnel( xTextRange, uno::UNO_QUERY); - SwXTextRange* pRange = 0; - OTextCursorHelper* pCursor = 0; - if(xRangeTunnel.is()) - { - pRange = reinterpret_cast< SwXTextRange * >( - sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( SwXTextRange::getUnoTunnelId()) )); - pCursor = reinterpret_cast< OTextCursorHelper * >( - sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( OTextCursorHelper::getUnoTunnelId()) )); - } - if(pRange) - { - pRange->SetPositions(aTmp); - } - else if(pCursor) - { - SwPaM* pCrsr = pCursor->GetPaM(); - *pCrsr->GetPoint() = *aTmp.GetPoint(); - pCrsr->DeleteMark(); - } - } - break; - case text::ControlCharacter::LINE_BREAK: cIns = 10; break; - case text::ControlCharacter::SOFT_HYPHEN: cIns = CHAR_SOFTHYPHEN; break; - case text::ControlCharacter::HARD_HYPHEN: cIns = CHAR_HARDHYPHEN; break; - case text::ControlCharacter::HARD_SPACE: cIns = CHAR_HARDBLANK; break; + SwPaM *const pCrsr = pCursor->GetPaM(); + *pCrsr->GetPoint() = *aTmp.GetPoint(); + pCrsr->DeleteMark(); } - if( cIns ) + } + break; + case text::ControlCharacter::LINE_BREAK: cIns = 10; break; + case text::ControlCharacter::SOFT_HYPHEN: cIns = CHAR_SOFTHYPHEN; break; + case text::ControlCharacter::HARD_HYPHEN: cIns = CHAR_HARDHYPHEN; break; + case text::ControlCharacter::HARD_SPACE: cIns = CHAR_HARDBLANK; break; + } + if (cIns) + { + m_pImpl->m_pDoc->InsertString( aTmp, cIns, nInsertFlags ); + } + + if (bAbsorb) + { + const uno::Reference xRangeTunnel( + xTextRange, uno::UNO_QUERY); + SwXTextRange *const pRange = + ::sw::UnoTunnelGetImplementation(xRangeTunnel); + OTextCursorHelper *const pCursor = + ::sw::UnoTunnelGetImplementation(xRangeTunnel); + + SwCursor aCrsr(*aTmp.GetPoint(),0,false); + SwUnoCursorHelper::SelectPam(aCrsr, true); + aCrsr.Left(1, CRSR_SKIP_CHARS, FALSE, FALSE); + //hier muss der uebergebene PaM umgesetzt werden: + if (pRange) + { + pRange->SetPositions(aCrsr); + } + else + { + SwPaM *const pUnoCrsr = pCursor->GetPaM(); + *pUnoCrsr->GetPoint() = *aCrsr.GetPoint(); + if (aCrsr.HasMark()) { - pDoc->InsertString( aTmp, cIns, nInsertFlags ); + pUnoCrsr->SetMark(); + *pUnoCrsr->GetMark() = *aCrsr.GetMark(); } - - if(bAbsorb) + else { - uno::Reference xRangeTunnel( xTextRange, uno::UNO_QUERY); - SwXTextRange* pRange = 0; - OTextCursorHelper* pCursor = 0; - if(xRangeTunnel.is()) - { - pRange = reinterpret_cast< SwXTextRange * >( - sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( SwXTextRange::getUnoTunnelId()) )); - pCursor = reinterpret_cast< OTextCursorHelper * >( - sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( OTextCursorHelper::getUnoTunnelId()) )); - } - - SwCursor aCrsr(*aTmp.GetPoint(),0,false); - SwUnoCursorHelper::SelectPam(aCrsr, true); - aCrsr.Left(1, CRSR_SKIP_CHARS, FALSE, FALSE); - //hier muss der uebergebene PaM umgesetzt werden: - if(pRange) - { - pRange->SetPositions(aCrsr); - } - else - { - SwPaM* pUnoCrsr = pCursor->GetPaM(); - *pUnoCrsr->GetPoint() = *aCrsr.GetPoint(); - if(aCrsr.HasMark()) - { - pUnoCrsr->SetMark(); - *pUnoCrsr->GetMark() = *aCrsr.GetMark(); - } - else - pUnoCrsr->DeleteMark(); - } + pUnoCrsr->DeleteMark(); } } } - else - throw uno::RuntimeException(); } + /*-- 09.12.98 12:43:17--------------------------------------------------- -----------------------------------------------------------------------*/ - -void SwXText::insertTextContent(const uno::Reference< text::XTextRange > & xRange, - const uno::Reference< text::XTextContent > & xContent, sal_Bool bAbsorb) - throw( lang::IllegalArgumentException, uno::RuntimeException ) +void SAL_CALL +SwXText::insertTextContent( + const uno::Reference< text::XTextRange > & xRange, + const uno::Reference< text::XTextContent > & xContent, + sal_Bool bAbsorb) +throw (lang::IllegalArgumentException, uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - // erstmal testen, ob der Range an der richtigen Stelle ist und dann - // am Sw-Content attachToRange aufrufen + + if (!xRange.is()) + { + lang::IllegalArgumentException aIllegal; + aIllegal.Message = C2U("first parameter invalid;"); + throw aIllegal; + } + if (!xContent.is()) + { + lang::IllegalArgumentException aIllegal; + aIllegal.Message += C2U("second parameter invalid"); + throw aIllegal; + } if(!GetDoc()) { uno::RuntimeException aRuntime; aRuntime.Message = C2U(cInvalidObject); throw aRuntime; } - if(xRange.is() && xContent.is()) - { - SwUnoInternalPaM aPam(*GetDoc()); - if (::sw::XTextRangeToSwPaM(aPam, xRange)) - { - uno::Reference xRangeTunnel( xRange, uno::UNO_QUERY); - SwXTextRange* pRange = 0; - OTextCursorHelper* pCursor = 0; - SwXTextPortion* pPortion = 0; - SwXText* pText = 0; - if(xRangeTunnel.is()) - { - pRange = reinterpret_cast< SwXTextRange * >( - sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( SwXTextRange::getUnoTunnelId()) )); - pCursor = reinterpret_cast< OTextCursorHelper * >( - sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( OTextCursorHelper::getUnoTunnelId()) )); - pPortion = reinterpret_cast< SwXTextPortion * >( - sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( SwXTextPortion::getUnoTunnelId()) )); - pText = reinterpret_cast< SwXText * >( - sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( SwXText::getUnoTunnelId()) )); - } + SwUnoInternalPaM aPam(*GetDoc()); + if (!::sw::XTextRangeToSwPaM(aPam, xRange)) + { + lang::IllegalArgumentException aIllegal; + aIllegal.Message = C2U("first parameter invalid"); + throw aIllegal; + } + // first test if the range is at the right position, then call + // xContent->attach + const SwStartNode* pOwnStartNode = GetStartNode(); + SwStartNodeType eSearchNodeType = SwNormalStartNode; + switch (m_pImpl->m_eType) + { + case CURSOR_FRAME: eSearchNodeType = SwFlyStartNode; break; + case CURSOR_TBLTEXT: eSearchNodeType = SwTableBoxStartNode; break; + case CURSOR_FOOTNOTE: eSearchNodeType = SwFootnoteStartNode; break; + case CURSOR_HEADER: eSearchNodeType = SwHeaderStartNode; break; + case CURSOR_FOOTER: eSearchNodeType = SwFooterStartNode; break; + //case CURSOR_INVALID: + //case CURSOR_BODY: + default: + break; + } - uno::Reference< text::XTextCursor > xOwnCursor = createCursor(); - uno::Reference xOwnTunnel( xOwnCursor, uno::UNO_QUERY); -// OTextCursorHelper* pOwnCursor = reinterpret_cast< OTextCursorHelper * >( -// sal::static_int_cast< sal_IntPtr >( xOwnTunnel->getSomething( OTextCursorHelper::getUnoTunnelId()) )); + const SwStartNode* pTmp = + aPam.GetNode()->FindSttNodeByType(eSearchNodeType); - const SwStartNode* pOwnStartNode = GetStartNode(); - SwStartNodeType eSearchNodeType = SwNormalStartNode; - switch(eCrsrType) - { - case CURSOR_FRAME: eSearchNodeType = SwFlyStartNode; break; - case CURSOR_TBLTEXT: eSearchNodeType = SwTableBoxStartNode; break; - case CURSOR_FOOTNOTE: eSearchNodeType = SwFootnoteStartNode; break; - case CURSOR_HEADER: eSearchNodeType = SwHeaderStartNode; break; - case CURSOR_FOOTER: eSearchNodeType = SwFooterStartNode; break; - //case CURSOR_INVALID: - //case CURSOR_BODY: - default: - ; - } + // ignore SectionNodes + while (pTmp && pTmp->IsSectionNode()) + { + pTmp = pTmp->StartOfSectionNode(); + } + // if the document starts with a section + while (pOwnStartNode->IsSectionNode()) + { + pOwnStartNode = pOwnStartNode->StartOfSectionNode(); + } + // this checks if (this) and xRange are in the same text::XText interface + if (pOwnStartNode != pTmp) + { + uno::RuntimeException aRunException; + aRunException.Message = C2U("text interface and cursor not related"); + throw aRunException; + } - const SwStartNode* pTmp = - aPam.GetNode()->FindSttNodeByType(eSearchNodeType); + const bool bForceExpandHints(CheckForOwnMemberMeta(aPam, bAbsorb)); - //SectionNodes ueberspringen - while(pTmp && pTmp->IsSectionNode()) - { - pTmp = pTmp->StartOfSectionNode(); - } - //if the document starts with a section - while(pOwnStartNode->IsSectionNode()) - { - pOwnStartNode = pOwnStartNode->StartOfSectionNode(); - } - //this checks if (this) and xRange are in the same text::XText interface - if(pOwnStartNode != pTmp) - { - uno::RuntimeException aRunException; - aRunException.Message = C2U("text interface and cursor not related"); - throw aRunException; - } + // special treatment for Contents that do not replace the range, but + // instead are "overlaid" + const uno::Reference xContentTunnel(xContent, + uno::UNO_QUERY); + if (!xContentTunnel.is()) + { + lang::IllegalArgumentException aArgException; + aArgException.Message = + C2U("text content does not support lang::XUnoTunnel"); + throw aArgException; + } + SwXDocumentIndexMark *const pDocumentIndexMark = + ::sw::UnoTunnelGetImplementation(xContentTunnel); + SwXTextSection *const pSection = + ::sw::UnoTunnelGetImplementation(xContentTunnel); + SwXBookmark *const pBookmark = + ::sw::UnoTunnelGetImplementation(xContentTunnel); + SwXReferenceMark *const pReferenceMark = + ::sw::UnoTunnelGetImplementation(xContentTunnel); + SwXMeta *const pMeta = + ::sw::UnoTunnelGetImplementation(xContentTunnel); - const bool bForceExpandHints(CheckForOwnMemberMeta(aPam, bAbsorb)); + const bool bAttribute = pBookmark || pDocumentIndexMark + || pSection || pReferenceMark || pMeta; - // Sonderbehandlung fuer Contents, die den Range nicht ersetzen, sonder darueber gelegt werden - // Bookmarks, IndexEntry - uno::Reference xContentTunnel( xContent, uno::UNO_QUERY); - if(!xContentTunnel.is()) - { - lang::IllegalArgumentException aArgException; - aArgException.Message = C2U("text content doesn't support lang::XUnoTunnel"); - throw aArgException; - } - SwXDocumentIndexMark* pDocumentIndexMark = reinterpret_cast< SwXDocumentIndexMark * >( - sal::static_int_cast< sal_IntPtr >( xContentTunnel->getSomething( SwXDocumentIndexMark::getUnoTunnelId()) )); - SwXTextSection* pSection = reinterpret_cast< SwXTextSection * >( - sal::static_int_cast< sal_IntPtr >( xContentTunnel->getSomething( SwXTextSection::getUnoTunnelId()) )); - SwXBookmark* pBookmark = reinterpret_cast< SwXBookmark * >( - sal::static_int_cast< sal_IntPtr >( xContentTunnel->getSomething( SwXBookmark::getUnoTunnelId()) )); - SwXReferenceMark* pReferenceMark = reinterpret_cast< SwXReferenceMark * >( - sal::static_int_cast< sal_IntPtr >( xContentTunnel->getSomething( SwXReferenceMark::getUnoTunnelId()) )); - SwXMeta *const pMeta = reinterpret_cast< SwXMeta* >( - sal::static_int_cast< sal_IntPtr >( - xContentTunnel->getSomething( SwXMeta::getUnoTunnelId()))); - - const bool bAttribute = pBookmark || pDocumentIndexMark - || pSection || pReferenceMark || pMeta; - - if(bAbsorb && !bAttribute) - { - xRange->setString(aEmptyStr); - } - //hier wird tatsaechlich eingefuegt - uno::Reference< text::XTextRange > xTempRange; - if(bAttribute && bAbsorb) - xTempRange = xRange; - else - xTempRange = xRange->getStart(); - if (bForceExpandHints) - { - // if necessary, replace xTempRange with a new SwXTextCursor - PrepareForAttach(xTempRange, aPam); - } - xContent->attach(xTempRange); - } - else - { - lang::IllegalArgumentException aIllegal; - aIllegal.Message = C2U("first parameter invalid"); - throw aIllegal; - } + if (bAbsorb && !bAttribute) + { + xRange->setString(aEmptyStr); } - else + uno::Reference< text::XTextRange > xTempRange = + (bAttribute && bAbsorb) ? xRange : xRange->getStart(); + if (bForceExpandHints) { - lang::IllegalArgumentException aIllegal; - if(!xRange.is()) - aIllegal.Message = C2U("first parameter invalid;"); - if(!xContent.is()) - aIllegal.Message += C2U("second parameter invalid"); - throw aIllegal; + // if necessary, replace xTempRange with a new SwXTextCursor + PrepareForAttach(xTempRange, aPam); } - + xContent->attach(xTempRange); } + /* -----------------------------10.07.00 15:40-------------------------------- ---------------------------------------------------------------------------*/ -void SwXText::insertTextContentBefore( +void SAL_CALL +SwXText::insertTextContentBefore( const uno::Reference< text::XTextContent>& xNewContent, const uno::Reference< text::XTextContent>& xSuccessor) - throw(lang::IllegalArgumentException, uno::RuntimeException) +throw (lang::IllegalArgumentException, uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); + if(!GetDoc()) { uno::RuntimeException aRuntime; @@ -646,35 +658,37 @@ void SwXText::insertTextContentBefore( uno::UNO_QUERY); SwXParagraph *const pPara = ::sw::UnoTunnelGetImplementation(xParaTunnel); - if(!pPara || !pPara->IsDescriptor() || !xSuccessor.is()) + if (!pPara || !pPara->IsDescriptor() || !xSuccessor.is()) + { throw lang::IllegalArgumentException(); + } sal_Bool bRet = sal_False; const uno::Reference xSuccTunnel(xSuccessor, uno::UNO_QUERY); SwXTextSection *const pXSection = ::sw::UnoTunnelGetImplementation(xSuccTunnel); - SwXTextTable* pXTable = SwXTextTable::GetImplementation(xSuccessor ); - SwFrmFmt* pTableFmt = pXTable ? pXTable->GetFrmFmt() : 0; + SwXTextTable *const pXTable = + ::sw::UnoTunnelGetImplementation(xSuccTunnel); + SwFrmFmt *const pTableFmt = (pXTable) ? pXTable->GetFrmFmt() : 0; SwTxtNode * pTxtNode = 0; if(pTableFmt && pTableFmt->GetDoc() == GetDoc()) { - SwTable* pTable = SwTable::FindTable( pTableFmt ); - SwTableNode* pTblNode = pTable->GetTableNode(); + SwTable *const pTable = SwTable::FindTable( pTableFmt ); + SwTableNode *const pTblNode = pTable->GetTableNode(); - SwNodeIndex aTblIdx( *pTblNode, -1 ); + const SwNodeIndex aTblIdx( *pTblNode, -1 ); SwPosition aBefore(aTblIdx); bRet = GetDoc()->AppendTxtNode( aBefore ); pTxtNode = aBefore.nNode.GetNode().GetTxtNode(); } - else if(pXSection && - pXSection->GetFmt() && + else if (pXSection && pXSection->GetFmt() && pXSection->GetFmt()->GetDoc() == GetDoc()) { - SwSectionFmt* pSectFmt = pXSection->GetFmt(); - SwSectionNode* pSectNode = pSectFmt->GetSectionNode(); + SwSectionFmt *const pSectFmt = pXSection->GetFmt(); + SwSectionNode *const pSectNode = pSectFmt->GetSectionNode(); - SwNodeIndex aSectIdx( *pSectNode, -1 ); + const SwNodeIndex aSectIdx( *pSectNode, -1 ); SwPosition aBefore(aSectIdx); bRet = GetDoc()->AppendTxtNode( aBefore ); pTxtNode = aBefore.nNode.GetNode().GetTxtNode(); @@ -683,55 +697,59 @@ void SwXText::insertTextContentBefore( { throw lang::IllegalArgumentException(); } - else - { - pPara->attachToText(*this, *pTxtNode); - } - + pPara->attachToText(*this, *pTxtNode); } + /* -----------------------------10.07.00 15:40-------------------------------- ---------------------------------------------------------------------------*/ -void SwXText::insertTextContentAfter( +void SAL_CALL +SwXText::insertTextContentAfter( const uno::Reference< text::XTextContent>& xNewContent, const uno::Reference< text::XTextContent>& xPredecessor) - throw(lang::IllegalArgumentException, uno::RuntimeException) +throw (lang::IllegalArgumentException, uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); + if(!GetDoc()) + { throw uno::RuntimeException(); + } + const uno::Reference xParaTunnel(xNewContent, uno::UNO_QUERY); SwXParagraph *const pPara = ::sw::UnoTunnelGetImplementation(xParaTunnel); if(!pPara || !pPara->IsDescriptor() || !xPredecessor.is()) + { throw lang::IllegalArgumentException(); + } const uno::Reference xPredTunnel(xPredecessor, uno::UNO_QUERY); SwXTextSection *const pXSection = ::sw::UnoTunnelGetImplementation(xPredTunnel); - SwXTextTable* pXTable = SwXTextTable::GetImplementation(xPredecessor ); - SwFrmFmt* pTableFmt = pXTable ? pXTable->GetFrmFmt() : 0; + SwXTextTable *const pXTable = + ::sw::UnoTunnelGetImplementation(xPredTunnel); + SwFrmFmt *const pTableFmt = (pXTable) ? pXTable->GetFrmFmt() : 0; sal_Bool bRet = sal_False; SwTxtNode * pTxtNode = 0; if(pTableFmt && pTableFmt->GetDoc() == GetDoc()) { - SwTable* pTable = SwTable::FindTable( pTableFmt ); - SwTableNode* pTblNode = pTable->GetTableNode(); + SwTable *const pTable = SwTable::FindTable( pTableFmt ); + SwTableNode *const pTblNode = pTable->GetTableNode(); - SwEndNode* pTableEnd = pTblNode->EndOfSectionNode(); + SwEndNode *const pTableEnd = pTblNode->EndOfSectionNode(); SwPosition aTableEnd(*pTableEnd); bRet = GetDoc()->AppendTxtNode( aTableEnd ); pTxtNode = aTableEnd.nNode.GetNode().GetTxtNode(); } - else if(pXSection && - pXSection->GetFmt() && + else if (pXSection && pXSection->GetFmt() && pXSection->GetFmt()->GetDoc() == GetDoc()) { - SwSectionFmt* pSectFmt = pXSection->GetFmt(); - SwSectionNode* pSectNode = pSectFmt->GetSectionNode(); - SwEndNode* pEnd = pSectNode->EndOfSectionNode(); + SwSectionFmt *const pSectFmt = pXSection->GetFmt(); + SwSectionNode *const pSectNode = pSectFmt->GetSectionNode(); + SwEndNode *const pEnd = pSectNode->EndOfSectionNode(); SwPosition aEnd(*pEnd); bRet = GetDoc()->AppendTxtNode( aEnd ); pTxtNode = aEnd.nNode.GetNode().GetTxtNode(); @@ -740,19 +758,19 @@ void SwXText::insertTextContentAfter( { throw lang::IllegalArgumentException(); } - else - { - pPara->attachToText(*this, *pTxtNode); - } + pPara->attachToText(*this, *pTxtNode); } + /* -----------------------------10.07.00 15:40-------------------------------- ---------------------------------------------------------------------------*/ -void SwXText::removeTextContentBefore( +void SAL_CALL +SwXText::removeTextContentBefore( const uno::Reference< text::XTextContent>& xSuccessor) - throw(lang::IllegalArgumentException, uno::RuntimeException) +throw (lang::IllegalArgumentException, uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); + if(!GetDoc()) { uno::RuntimeException aRuntime; @@ -765,28 +783,28 @@ void SwXText::removeTextContentBefore( uno::UNO_QUERY); SwXTextSection *const pXSection = ::sw::UnoTunnelGetImplementation(xSuccTunnel); - SwXTextTable* pXTable = SwXTextTable::GetImplementation( xSuccessor ); - SwFrmFmt* pTableFmt = pXTable ? pXTable->GetFrmFmt() : 0; + SwXTextTable *const pXTable = + ::sw::UnoTunnelGetImplementation(xSuccTunnel); + SwFrmFmt *const pTableFmt = (pXTable) ? pXTable->GetFrmFmt() : 0; if(pTableFmt && pTableFmt->GetDoc() == GetDoc()) { - SwTable* pTable = SwTable::FindTable( pTableFmt ); - SwTableNode* pTblNode = pTable->GetTableNode(); + SwTable *const pTable = SwTable::FindTable( pTableFmt ); + SwTableNode *const pTblNode = pTable->GetTableNode(); - SwNodeIndex aTblIdx( *pTblNode, -1 ); + const SwNodeIndex aTblIdx( *pTblNode, -1 ); if(aTblIdx.GetNode().IsTxtNode()) { SwPaM aBefore(aTblIdx); bRet = GetDoc()->DelFullPara( aBefore ); } } - else if(pXSection && - pXSection->GetFmt() && + else if (pXSection && pXSection->GetFmt() && pXSection->GetFmt()->GetDoc() == GetDoc()) { - SwSectionFmt* pSectFmt = pXSection->GetFmt(); - SwSectionNode* pSectNode = pSectFmt->GetSectionNode(); + SwSectionFmt *const pSectFmt = pXSection->GetFmt(); + SwSectionNode *const pSectNode = pSectFmt->GetSectionNode(); - SwNodeIndex aSectIdx( *pSectNode, -1 ); + const SwNodeIndex aSectIdx( *pSectNode, -1 ); if(aSectIdx.GetNode().IsTxtNode()) { SwPaM aBefore(aSectIdx); @@ -794,15 +812,21 @@ void SwXText::removeTextContentBefore( } } if(!bRet) + { throw lang::IllegalArgumentException(); + } } + /* -----------------------------10.07.00 15:40-------------------------------- ---------------------------------------------------------------------------*/ -void SwXText::removeTextContentAfter(const uno::Reference< text::XTextContent>& xPredecessor) - throw(lang::IllegalArgumentException, uno::RuntimeException) +void SAL_CALL +SwXText::removeTextContentAfter( + const uno::Reference< text::XTextContent>& xPredecessor) +throw (lang::IllegalArgumentException, uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); + if(!GetDoc()) { uno::RuntimeException aRuntime; @@ -815,29 +839,29 @@ void SwXText::removeTextContentAfter(const uno::Reference< text::XTextContent>& uno::UNO_QUERY); SwXTextSection *const pXSection = ::sw::UnoTunnelGetImplementation(xPredTunnel); - SwXTextTable* pXTable = SwXTextTable::GetImplementation(xPredecessor ); - SwFrmFmt* pTableFmt = pXTable ? pXTable->GetFrmFmt() : 0; + SwXTextTable *const pXTable = + ::sw::UnoTunnelGetImplementation(xPredTunnel); + SwFrmFmt *const pTableFmt = (pXTable) ? pXTable->GetFrmFmt() : 0; if(pTableFmt && pTableFmt->GetDoc() == GetDoc()) { - SwTable* pTable = SwTable::FindTable( pTableFmt ); - SwTableNode* pTblNode = pTable->GetTableNode(); - SwEndNode* pTableEnd = pTblNode->EndOfSectionNode(); + SwTable *const pTable = SwTable::FindTable( pTableFmt ); + SwTableNode *const pTblNode = pTable->GetTableNode(); + SwEndNode *const pTableEnd = pTblNode->EndOfSectionNode(); - SwNodeIndex aTblIdx( *pTableEnd, 1 ); + const SwNodeIndex aTblIdx( *pTableEnd, 1 ); if(aTblIdx.GetNode().IsTxtNode()) { SwPaM aPaM(aTblIdx); bRet = GetDoc()->DelFullPara( aPaM ); } } - else if(pXSection && - pXSection->GetFmt() && + else if (pXSection && pXSection->GetFmt() && pXSection->GetFmt()->GetDoc() == GetDoc()) { - SwSectionFmt* pSectFmt = pXSection->GetFmt(); - SwSectionNode* pSectNode = pSectFmt->GetSectionNode(); - SwEndNode* pEnd = pSectNode->EndOfSectionNode(); - SwNodeIndex aSectIdx( *pEnd, 1 ); + SwSectionFmt *const pSectFmt = pXSection->GetFmt(); + SwSectionNode *const pSectNode = pSectFmt->GetSectionNode(); + SwEndNode *const pEnd = pSectNode->EndOfSectionNode(); + const SwNodeIndex aSectIdx( *pEnd, 1 ); if(aSectIdx.GetNode().IsTxtNode()) { SwPaM aAfter(aSectIdx); @@ -845,42 +869,50 @@ void SwXText::removeTextContentAfter(const uno::Reference< text::XTextContent>& } } if(!bRet) + { throw lang::IllegalArgumentException(); + } } + /*-- 09.12.98 12:43:19--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXText::removeTextContent(const uno::Reference< text::XTextContent > & xContent) - throw( container::NoSuchElementException, uno::RuntimeException ) +void SAL_CALL +SwXText::removeTextContent( + const uno::Reference< text::XTextContent > & xContent) +throw (container::NoSuchElementException, uno::RuntimeException) { - vos::OGuard aGuard(Application::GetSolarMutex()); + // forward: need no solar mutex here if(!xContent.is()) { uno::RuntimeException aRuntime; aRuntime.Message = C2U("first parameter invalid"); throw aRuntime; } - else - xContent->dispose(); + xContent->dispose(); } + /*-- 09.12.98 12:43:22--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Reference< text::XText > SwXText::getText(void) - throw( uno::RuntimeException ) +uno::Reference< text::XText > SAL_CALL +SwXText::getText() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - uno::Reference< text::XText > xRet = (SwXText*)this; - return xRet; + const uno::Reference< text::XText > xRet(this); + return xRet; } + /*-- 09.12.98 12:43:24--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Reference< text::XTextRange > SwXText::getStart(void) throw( uno::RuntimeException ) +uno::Reference< text::XTextRange > SAL_CALL +SwXText::getStart() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - uno::Reference< text::XTextCursor > xRef = createCursor(); + + const uno::Reference< text::XTextCursor > xRef = CreateCursor(); if(!xRef.is()) { uno::RuntimeException aRuntime; @@ -888,16 +920,18 @@ uno::Reference< text::XTextRange > SwXText::getStart(void) throw( uno::RuntimeE throw aRuntime; } xRef->gotoStart(sal_False); - uno::Reference< text::XTextRange > xRet(xRef, uno::UNO_QUERY); + const uno::Reference< text::XTextRange > xRet(xRef, uno::UNO_QUERY); return xRet; } /*-- 09.12.98 12:43:27--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Reference< text::XTextRange > SwXText::getEnd(void) throw( uno::RuntimeException ) +uno::Reference< text::XTextRange > SAL_CALL +SwXText::getEnd() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - uno::Reference< text::XTextCursor > xRef = createCursor(); + + const uno::Reference< text::XTextCursor > xRef = CreateCursor(); if(!xRef.is()) { uno::RuntimeException aRuntime; @@ -905,42 +939,52 @@ uno::Reference< text::XTextRange > SwXText::getEnd(void) throw( uno::RuntimeExc throw aRuntime; } xRef->gotoEnd(sal_False); - uno::Reference< text::XTextRange > xRet(xRef, uno::UNO_QUERY); + const uno::Reference< text::XTextRange > xRet(xRef, uno::UNO_QUERY); return xRet; } + /*-- 09.12.98 12:43:29--------------------------------------------------- -----------------------------------------------------------------------*/ -OUString SwXText::getString(void) throw( uno::RuntimeException ) +OUString SAL_CALL SwXText::getString() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - uno::Reference< text::XTextCursor > xRet = createCursor(); + + const uno::Reference< text::XTextCursor > xRet = CreateCursor(); if(!xRet.is()) { uno::RuntimeException aRuntime; aRuntime.Message = C2U(cInvalidObject); throw aRuntime; } - else - { - xRet->gotoEnd(sal_True); - } + xRet->gotoEnd(sal_True); return xRet->getString(); } /*-- 09.12.98 12:43:30--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXText::setString(const OUString& aString) throw( uno::RuntimeException ) +void SAL_CALL +SwXText::setString(const OUString& rString) throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); + + if (!GetDoc()) + { + uno::RuntimeException aRuntime; + aRuntime.Message = C2U(cInvalidObject); + throw aRuntime; + } + const SwStartNode* pStartNode = GetStartNode(); - if(!pStartNode) + if (!pStartNode) + { throw uno::RuntimeException(); + } GetDoc()->StartUndo(UNDO_START, NULL); //insert an empty paragraph at the start and at the end to ensure that //all tables and sections can be removed by the selecting text::XTextCursor - if (CURSOR_META != eCrsrType) + if (CURSOR_META != m_pImpl->m_eType) { SwPosition aStartPos(*pStartNode); const SwEndNode* pEnd = pStartNode->EndOfSectionNode(); @@ -972,7 +1016,7 @@ void SwXText::setString(const OUString& aString) throw( uno::RuntimeException ) } } - uno::Reference< text::XTextCursor > xRet = createCursor(); + const uno::Reference< text::XTextCursor > xRet = CreateCursor(); if(!xRet.is()) { GetDoc()->EndUndo(UNDO_END, NULL); @@ -980,36 +1024,28 @@ void SwXText::setString(const OUString& aString) throw( uno::RuntimeException ) aRuntime.Message = C2U(cInvalidObject); throw aRuntime; } - else - { - xRet->gotoEnd(sal_True); - } - xRet->setString(aString); + xRet->gotoEnd(sal_True); + xRet->setString(rString); GetDoc()->EndUndo(UNDO_END, NULL); } //FIXME why is CheckForOwnMember duplicated in some insert methods? // Description: Checks if pRange/pCursor are member of the same text interface. // Only one of the pointers has to be set! -sal_Bool SwXText::CheckForOwnMember( - const SwXTextRange* pRange, - const OTextCursorHelper* pCursor) - throw(lang::IllegalArgumentException, uno::RuntimeException) +bool SwXText::Impl::CheckForOwnMember( + const SwPaM & rPaM) +throw (lang::IllegalArgumentException, uno::RuntimeException) { - DBG_ASSERT((!pRange || !pCursor) && (pRange || pCursor), "only one pointer will be checked" ); - uno::Reference xOwnCursor = createCursor(); + const uno::Reference xOwnCursor(m_rThis.CreateCursor()); - uno::Reference xTunnel( xOwnCursor, uno::UNO_QUERY); - OTextCursorHelper* pOwnCursor = 0; - if(xTunnel.is()) - { - pOwnCursor = reinterpret_cast< OTextCursorHelper * >( - sal::static_int_cast< sal_IntPtr >( xTunnel->getSomething(OTextCursorHelper::getUnoTunnelId()) )); - } + const uno::Reference xTunnel(xOwnCursor, uno::UNO_QUERY); + OTextCursorHelper *const pOwnCursor = + ::sw::UnoTunnelGetImplementation(xTunnel); DBG_ASSERT(pOwnCursor, "OTextCursorHelper::getUnoTunnelId() ??? "); - const SwStartNode* pOwnStartNode = pOwnCursor->GetPaM()->GetNode()->StartOfSectionNode(); + const SwStartNode* pOwnStartNode = + pOwnCursor->GetPaM()->GetNode()->StartOfSectionNode(); SwStartNodeType eSearchNodeType = SwNormalStartNode; - switch(eCrsrType) + switch (m_eType) { case CURSOR_FRAME: eSearchNodeType = SwFlyStartNode; break; case CURSOR_TBLTEXT: eSearchNodeType = SwTableBoxStartNode; break; @@ -1022,101 +1058,62 @@ sal_Bool SwXText::CheckForOwnMember( ; } - const SwNode* pSrcNode; - if (pCursor) - { - pSrcNode = pCursor->GetPaM()->GetNode(); - } - else // pRange - { - SwPaM aPam(pRange->GetDoc()->GetNodes().GetEndOfContent()); - if (pRange->GetPositions(aPam)) - { - pSrcNode = aPam.GetNode(); - } - } - if (!pSrcNode) { return sal_False; } + SwNode const*const pSrcNode(rPaM.GetNode()); + if (!pSrcNode) { return false; } const SwStartNode* pTmp = pSrcNode->FindSttNodeByType(eSearchNodeType); //SectionNodes ueberspringen while(pTmp && pTmp->IsSectionNode()) + { pTmp = pTmp->StartOfSectionNode(); + } //if the document starts with a section while(pOwnStartNode->IsSectionNode()) + { pOwnStartNode = pOwnStartNode->StartOfSectionNode(); + } //this checks if (this) and xRange are in the same text::XText interface - return(pOwnStartNode == pTmp); + return (pOwnStartNode == pTmp); } -sal_Int16 SwXText::ComparePositions( +sal_Int16 +SwXText::Impl::ComparePositions( const uno::Reference& xPos1, const uno::Reference& xPos2) - throw(lang::IllegalArgumentException, uno::RuntimeException) +throw (lang::IllegalArgumentException, uno::RuntimeException) { - sal_Int16 nCompare = 0; - SwUnoInternalPaM aPam1(*GetDoc()); - SwUnoInternalPaM aPam2(*GetDoc()); + SwUnoInternalPaM aPam1(*m_pDoc); + SwUnoInternalPaM aPam2(*m_pDoc); - BOOL bExcept = FALSE; - if (::sw::XTextRangeToSwPaM(aPam1, xPos1) && - ::sw::XTextRangeToSwPaM(aPam2, xPos2)) + if (!::sw::XTextRangeToSwPaM(aPam1, xPos1) || + !::sw::XTextRangeToSwPaM(aPam2, xPos2)) { - uno::Reference xRangeTunnel1( xPos1, uno::UNO_QUERY); - SwXTextRange* pRange1 = 0; - OTextCursorHelper* pCursor1 = 0; - if(xRangeTunnel1.is()) - { - pRange1 = reinterpret_cast< SwXTextRange * >( - sal::static_int_cast< sal_IntPtr >( xRangeTunnel1->getSomething( SwXTextRange::getUnoTunnelId()) )); - pCursor1 = reinterpret_cast< OTextCursorHelper * >( - sal::static_int_cast< sal_IntPtr >( xRangeTunnel1->getSomething( OTextCursorHelper::getUnoTunnelId()) )); - } - uno::Reference xRangeTunnel2( xPos2, uno::UNO_QUERY); - SwXTextRange* pRange2 = 0; - OTextCursorHelper* pCursor2 = 0; - if(xRangeTunnel2.is()) - { - pRange2 = reinterpret_cast< SwXTextRange * >( - sal::static_int_cast< sal_IntPtr >( xRangeTunnel2->getSomething( SwXTextRange::getUnoTunnelId()) )); - pCursor2 = reinterpret_cast< OTextCursorHelper * >( - sal::static_int_cast< sal_IntPtr >( xRangeTunnel2->getSomething( OTextCursorHelper::getUnoTunnelId()) )); - } - - if((pRange1||pCursor1) && (pRange2||pCursor2)) - { - if(CheckForOwnMember(pRange1, pCursor1) - && CheckForOwnMember( pRange2, pCursor2)) - { - SwPosition const*const pStart1 = aPam1.Start(); - SwPosition const*const pStart2 = aPam2.Start(); + throw lang::IllegalArgumentException(); + } + if (!CheckForOwnMember(aPam1) || !CheckForOwnMember(aPam2)) + { + throw lang::IllegalArgumentException(); + } - if(pStart1 && pStart2) - { - if(*pStart1 < *pStart2) - nCompare = 1; - else if(*pStart1 > *pStart2) - nCompare = -1; - else - { - DBG_ASSERT(*pStart1 == *pStart2, "SwPositions should be equal here"); - nCompare = 0; - } - } - else - bExcept = TRUE; - } - else - bExcept = TRUE; - } - else - bExcept = TRUE; + sal_Int16 nCompare = 0; + SwPosition const*const pStart1 = aPam1.Start(); + SwPosition const*const pStart2 = aPam2.Start(); + if (*pStart1 < *pStart2) + { + nCompare = 1; + } + else if (*pStart1 > *pStart2) + { + nCompare = -1; } else - bExcept = TRUE; - if(bExcept) - throw lang::IllegalArgumentException(); + { + DBG_ASSERT(*pStart1 == *pStart2, + "SwPositions should be equal here"); + nCompare = 0; + } return nCompare; } @@ -1124,50 +1121,64 @@ sal_Int16 SwXText::ComparePositions( /*-- 28.03.00 10:37:22--------------------------------------------------- -----------------------------------------------------------------------*/ -sal_Int16 SwXText::compareRegionStarts( - const uno::Reference& xR1, - const uno::Reference& xR2) - throw(lang::IllegalArgumentException, uno::RuntimeException) +sal_Int16 SAL_CALL +SwXText::compareRegionStarts( + const uno::Reference& xRange1, + const uno::Reference& xRange2) +throw (lang::IllegalArgumentException, uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - if(!xR1.is() || !xR2.is()) + + if (!xRange1.is() || !xRange2.is()) + { throw lang::IllegalArgumentException(); - uno::Reference xStart1 = xR1->getStart(); - uno::Reference xStart2 = xR2->getStart(); + } + const uno::Reference xStart1 = xRange1->getStart(); + const uno::Reference xStart2 = xRange2->getStart(); - return ComparePositions(xStart1, xStart2); + return m_pImpl->ComparePositions(xStart1, xStart2); } /*-- 28.03.00 10:37:25--------------------------------------------------- -----------------------------------------------------------------------*/ -sal_Int16 SwXText::compareRegionEnds( - const uno::Reference& xR1, - const uno::Reference& xR2) - throw(lang::IllegalArgumentException, uno::RuntimeException) +sal_Int16 SAL_CALL +SwXText::compareRegionEnds( + const uno::Reference& xRange1, + const uno::Reference& xRange2) +throw (lang::IllegalArgumentException, uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - if(!xR1.is() || !xR2.is()) + + if (!xRange1.is() || !xRange2.is()) + { throw lang::IllegalArgumentException(); - uno::Reference xEnd1 = xR1->getEnd(); - uno::Reference xEnd2 = xR2->getEnd(); + } + uno::Reference xEnd1 = xRange1->getEnd(); + uno::Reference xEnd2 = xRange2->getEnd(); - return ComparePositions(xEnd1, xEnd2); + return m_pImpl->ComparePositions(xEnd1, xEnd2); } /*-- 15.03.2002 12:30:40--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Reference< beans::XPropertySetInfo > SwXText::getPropertySetInfo( ) - throw(uno::RuntimeException) +uno::Reference< beans::XPropertySetInfo > SAL_CALL +SwXText::getPropertySetInfo() throw(uno::RuntimeException) { - static uno::Reference< beans::XPropertySetInfo > xInfo = m_pPropSet->getPropertySetInfo(); + vos::OGuard g(Application::GetSolarMutex()); + + static uno::Reference< beans::XPropertySetInfo > xInfo = + m_pImpl->m_rPropSet.getPropertySetInfo(); return xInfo; } + /*-- 15.03.2002 12:30:42--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXText::setPropertyValue( const ::rtl::OUString& /*aPropertyName*/, const uno::Any& /*aValue*/ ) - throw(beans::UnknownPropertyException, beans::PropertyVetoException, +void SAL_CALL +SwXText::setPropertyValue(const ::rtl::OUString& /*aPropertyName*/, + const uno::Any& /*aValue*/) +throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException) { @@ -1176,100 +1187,113 @@ void SwXText::setPropertyValue( const ::rtl::OUString& /*aPropertyName*/, const /*-- 15.03.2002 12:30:42--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Any SwXText::getPropertyValue( - const ::rtl::OUString& rPropertyName ) - throw(beans::UnknownPropertyException, lang::WrappedTargetException, - uno::RuntimeException) +uno::Any SAL_CALL +SwXText::getPropertyValue( + const ::rtl::OUString& rPropertyName) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); + if(!IsValid()) + { throw uno::RuntimeException(); - const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName(rPropertyName); + } + + SfxItemPropertySimpleEntry const*const pEntry = + m_pImpl->m_rPropSet.getPropertyMap()->getByName(rPropertyName); + if (!pEntry) + { + beans::UnknownPropertyException aExcept; + aExcept.Message = C2U("Unknown property: "); + aExcept.Message += rPropertyName; + throw aExcept; + } + uno::Any aRet; - if(pEntry) + switch (pEntry->nWID) { - switch(pEntry->nWID) - { // no code necessary - the redline is always located at the end node // case FN_UNO_REDLINE_NODE_START: // break; - case FN_UNO_REDLINE_NODE_END: + case FN_UNO_REDLINE_NODE_END: + { + const SwRedlineTbl& rRedTbl = GetDoc()->GetRedlineTbl(); + const USHORT nRedTblCount = rRedTbl.Count(); + if (nRedTblCount > 0) { - const SwRedlineTbl& rRedTbl = GetDoc()->GetRedlineTbl(); - USHORT nRedTblCount = rRedTbl.Count(); - if ( nRedTblCount > 0 ) + SwStartNode const*const pStartNode = GetStartNode(); + const ULONG nOwnIndex = pStartNode->EndOfSectionIndex(); + for (USHORT nRed = 0; nRed < nRedTblCount; nRed++) { - const SwStartNode* pStartNode = GetStartNode(); - ULONG nOwnIndex = pStartNode->EndOfSectionIndex(); - for(USHORT nRed = 0; nRed < nRedTblCount; nRed++) + SwRedline const*const pRedline = rRedTbl[nRed]; + SwPosition const*const pRedStart = pRedline->Start(); + const SwNodeIndex nRedNode = pRedStart->nNode; + if (nOwnIndex == nRedNode.GetIndex()) { - const SwRedline* pRedline = rRedTbl[nRed]; - const SwPosition* pRedStart = pRedline->Start(); - const SwNodeIndex nRedNode = pRedStart->nNode; - if(nOwnIndex == nRedNode.GetIndex()) - { - aRet <<= SwXRedlinePortion::CreateRedlineProperties(*pRedline, TRUE); - break; - } + aRet <<= SwXRedlinePortion::CreateRedlineProperties( + *pRedline, TRUE); + break; } } } - break; } - } - else - { - beans::UnknownPropertyException aExcept; - aExcept.Message = C2U("Unknown property: "); - aExcept.Message += rPropertyName; - throw aExcept; + break; } return aRet; - } + /*-- 15.03.2002 12:30:42--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXText::addPropertyChangeListener( - const ::rtl::OUString& /*aPropertyName*/, - const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/ ) - throw(beans::UnknownPropertyException, lang::WrappedTargetException, - uno::RuntimeException) +void SAL_CALL +SwXText::addPropertyChangeListener( + const ::rtl::OUString& /*rPropertyName*/, + const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { - throw uno::RuntimeException(); + OSL_ENSURE(false, + "SwXText::addPropertyChangeListener(): not implemented"); } /*-- 15.03.2002 12:30:43--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXText::removePropertyChangeListener( - const ::rtl::OUString& /*aPropertyName*/, - const uno::Reference< beans::XPropertyChangeListener >& /*aListener*/ ) - throw(beans::UnknownPropertyException, lang::WrappedTargetException, - uno::RuntimeException) +void SAL_CALL +SwXText::removePropertyChangeListener( + const ::rtl::OUString& /*rPropertyName*/, + const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { - throw uno::RuntimeException(); + OSL_ENSURE(false, + "SwXText::removePropertyChangeListener(): not implemented"); } /*-- 15.03.2002 12:30:43--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXText::addVetoableChangeListener( - const ::rtl::OUString& /*PropertyName*/, - const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/ ) - throw(beans::UnknownPropertyException, lang::WrappedTargetException, - uno::RuntimeException) +void SAL_CALL +SwXText::addVetoableChangeListener( + const ::rtl::OUString& /*rPropertyName*/, + const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { - throw uno::RuntimeException(); + OSL_ENSURE(false, + "SwXText::addVetoableChangeListener(): not implemented"); } /*-- 15.03.2002 12:30:43--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXText::removeVetoableChangeListener( - const ::rtl::OUString& /*rPropertyName*/, - const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/ ) - throw(beans::UnknownPropertyException, lang::WrappedTargetException, +void SAL_CALL +SwXText::removeVetoableChangeListener( + const ::rtl::OUString& /*rPropertyName*/, + const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) { - throw uno::RuntimeException(); + OSL_ENSURE(false, + "SwXText::removeVetoableChangeListener(): not implemented"); } /* -----------------------------08.01.01 09:07-------------------------------- @@ -1283,488 +1307,527 @@ const uno::Sequence< sal_Int8 > & SwXText::getUnoTunnelId() /* -----------------------------08.01.01 09:07-------------------------------- ---------------------------------------------------------------------------*/ -sal_Int64 SwXText::getSomething( const uno::Sequence< sal_Int8 >& rId ) - throw(uno::RuntimeException) +sal_Int64 SAL_CALL +SwXText::getSomething(const uno::Sequence< sal_Int8 >& rId) +throw (uno::RuntimeException) { - if( rId.getLength() == 16 - && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), - rId.getConstArray(), 16 ) ) - { - return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(this) ); - } - return 0; + return ::sw::UnoTunnelImpl(rId, this); } + /*-- 23.06.2006 08:56:30--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Reference< text::XTextRange > SwXText::appendParagraph( - const uno::Sequence< beans::PropertyValue > & rProperties ) - throw (lang::IllegalArgumentException, uno::RuntimeException) +uno::Reference< text::XTextRange > SAL_CALL +SwXText::appendParagraph( + const uno::Sequence< beans::PropertyValue > & rProperties) +throw (lang::IllegalArgumentException, uno::RuntimeException) { - return finishOrAppendParagraph(false, rProperties); + vos::OGuard g(Application::GetSolarMutex()); + + return m_pImpl->finishOrAppendParagraph(false, rProperties); } /*-- 23.06.2006 08:56:22--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Reference< text::XTextRange > SwXText::finishParagraph( - const uno::Sequence< beans::PropertyValue > & rProperties ) - throw (lang::IllegalArgumentException, uno::RuntimeException) +uno::Reference< text::XTextRange > SAL_CALL +SwXText::finishParagraph( + const uno::Sequence< beans::PropertyValue > & rProperties) +throw (lang::IllegalArgumentException, uno::RuntimeException) { - return finishOrAppendParagraph(true, rProperties); + vos::OGuard g(Application::GetSolarMutex()); + + return m_pImpl->finishOrAppendParagraph(true, rProperties); } /*-- 08.05.2006 13:26:26--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Reference< text::XTextRange > SwXText::finishOrAppendParagraph( - bool bFinish, - const uno::Sequence< beans::PropertyValue > & rProperties ) - throw (lang::IllegalArgumentException, uno::RuntimeException) - +uno::Reference< text::XTextRange > +SwXText::Impl::finishOrAppendParagraph( + const bool bFinish, + const uno::Sequence< beans::PropertyValue > & rProperties) +throw (lang::IllegalArgumentException, uno::RuntimeException) { - vos::OGuard aGuard(Application::GetSolarMutex()); - if(!IsValid()) + if (!m_bIsValid) + { throw uno::RuntimeException(); - uno::Reference< text::XTextRange > xRet; + } - const SwStartNode* pStartNode = GetStartNode(); + const SwStartNode* pStartNode = m_rThis.GetStartNode(); if(!pStartNode) + { throw uno::RuntimeException(); + } + + uno::Reference< text::XTextRange > xRet; + bool bIllegalException = false; + bool bRuntimeException = false; + ::rtl::OUString sMessage; + m_pDoc->StartUndo(UNDO_START , NULL); + // find end node, go backward - don't skip tables because the new + // paragraph has to be the last node + //aPam.Move( fnMoveBackward, fnGoNode ); + SwPosition aInsertPosition( + SwNodeIndex( *pStartNode->EndOfSectionNode(), -1 ) ); + SwPaM aPam(aInsertPosition); + m_pDoc->AppendTxtNode( *aPam.GetPoint() ); + // remove attributes from the previous paragraph + m_pDoc->ResetAttrs(aPam); + // in case of finishParagraph the PaM needs to be moved to the + // previous paragraph + if (bFinish) { - bool bIllegalException = false; - bool bRuntimeException = false; - ::rtl::OUString sMessage; - pDoc->StartUndo(UNDO_START , NULL); - //find end node, go backward - don't skip tables because the new paragraph has to be the last node - //aPam.Move( fnMoveBackward, fnGoNode ); - SwPosition aInsertPosition( SwNodeIndex( *pStartNode->EndOfSectionNode(), -1 ) ); - SwPaM aPam(aInsertPosition); - pDoc->AppendTxtNode( *aPam.GetPoint() ); - //remove attributes from the previous paragraph - pDoc->ResetAttrs(aPam); - //in case of finishParagraph the PaM needs to be moved to the previous paragraph - if(bFinish) - aPam.Move( fnMoveBackward, fnGoNode ); - if(rProperties.getLength()) - { - // now set the properties - const SfxItemPropertySet* pParaPropSet = aSwMapProvider.GetPropertySet(PROPERTY_MAP_PARAGRAPH); - const SfxItemPropertyMap* pParagraphMap = pParaPropSet->getPropertyMap(); + aPam.Move( fnMoveBackward, fnGoNode ); + } + if (rProperties.getLength()) + { + // now set the properties + SfxItemPropertySet const*const pParaPropSet = + aSwMapProvider.GetPropertySet(PROPERTY_MAP_PARAGRAPH); + SfxItemPropertyMap const*const pParagraphMap = + pParaPropSet->getPropertyMap(); - const beans::PropertyValue* pValues = rProperties.getConstArray(); + const beans::PropertyValue* pValues = rProperties.getConstArray(); - for( sal_Int32 nProp = 0; nProp < rProperties.getLength(); ++nProp) + for (sal_Int32 nProp = 0; nProp < rProperties.getLength(); ++nProp) + { + if (!pParagraphMap->getByName(pValues[nProp].Name)) { - if(pParagraphMap->getByName( pValues[nProp].Name )) - { - try - { - SwUnoCursorHelper::SetPropertyValue( - aPam, *pParaPropSet, - pValues[nProp].Name, pValues[nProp].Value); - } - catch( lang::IllegalArgumentException& rIllegal ) - { - sMessage = rIllegal.Message; - bIllegalException = true; - } - catch( uno::RuntimeException& rRuntime ) - { - sMessage = rRuntime.Message; - bRuntimeException = true; - } - } - else - bIllegalException = true; - if( bIllegalException || bRuntimeException ) - { - break; - } + bIllegalException = true; + break; } - } - pDoc->EndUndo(UNDO_END, NULL); - if( bIllegalException || bRuntimeException ) - { - SwUndoIter aUndoIter( &aPam, UNDO_EMPTY ); - pDoc->Undo(aUndoIter); - if(bIllegalException) + try { - lang::IllegalArgumentException aEx; - aEx.Message = sMessage; - throw aEx; + SwUnoCursorHelper::SetPropertyValue(aPam, *pParaPropSet, + pValues[nProp].Name, pValues[nProp].Value); } - else //if(bRuntimeException) + catch (lang::IllegalArgumentException& rIllegal) { - uno::RuntimeException aEx; - aEx.Message = sMessage; - throw aEx; + sMessage = rIllegal.Message; + bIllegalException = true; + break; + } + catch (uno::RuntimeException& rRuntime) + { + sMessage = rRuntime.Message; + bRuntimeException = true; + break; } } - SwTxtNode * pTxtNode( aPam.Start()->nNode.GetNode().GetTxtNode() ); - OSL_ENSURE(pTxtNode, "no SwTxtNode?"); - if (pTxtNode) + } + m_pDoc->EndUndo(UNDO_END, NULL); + if (bIllegalException || bRuntimeException) + { + SwUndoIter aUndoIter( &aPam, UNDO_EMPTY ); + m_pDoc->Undo(aUndoIter); + if (bIllegalException) + { + lang::IllegalArgumentException aEx; + aEx.Message = sMessage; + throw aEx; + } + else // if(bRuntimeException) { - xRet.set(SwXParagraph::CreateXParagraph(*pDoc, *pTxtNode, this), uno::UNO_QUERY); + uno::RuntimeException aEx; + aEx.Message = sMessage; + throw aEx; } } + SwTxtNode *const pTxtNode( aPam.Start()->nNode.GetNode().GetTxtNode() ); + OSL_ENSURE(pTxtNode, "no SwTxtNode?"); + if (pTxtNode) + { + xRet.set(SwXParagraph::CreateXParagraph(*m_pDoc, *pTxtNode, &m_rThis), + uno::UNO_QUERY); + } return xRet; } + /*-- 08.05.2006 13:28:26--------------------------------------------------- Append text portions at the end of the last paragraph of the text interface. Support of import filters. -----------------------------------------------------------------------*/ -uno::Reference< text::XTextRange > SwXText::appendTextPortion( +uno::Reference< text::XTextRange > SAL_CALL +SwXText::appendTextPortion( const ::rtl::OUString& rText, - const uno::Sequence< beans::PropertyValue > & rCharacterAndParagraphProperties ) - throw (lang::IllegalArgumentException, uno::RuntimeException) + const uno::Sequence< beans::PropertyValue > & + rCharacterAndParagraphProperties) +throw (lang::IllegalArgumentException, uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); + if(!IsValid()) + { throw uno::RuntimeException(); - uno::Reference< text::XTextRange > xRet; - uno::Reference< text::XTextCursor > xTextCursor = createCursor(); + } + uno::Reference< text::XTextRange > xRet; + const uno::Reference< text::XTextCursor > xTextCursor = CreateCursor(); xTextCursor->gotoEnd(sal_False); - uno::Reference< lang::XUnoTunnel > xRangeTunnel( xTextCursor, uno::UNO_QUERY_THROW ); - SwXTextCursor* pTextCursor = reinterpret_cast< SwXTextCursor * >( - sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( SwXTextCursor::getUnoTunnelId()))); - { - bool bIllegalException = false; - bool bRuntimeException = false; - ::rtl::OUString sMessage; - pDoc->StartUndo(UNDO_INSERT, NULL); - -// SwPaM aPam(*pStartNode->EndOfSectionNode()); - //aPam.Move( fnMoveBackward, fnGoNode ); - SwUnoCrsr * pCursor = pTextCursor->GetCursor(); - pCursor->MovePara( fnParaCurr, fnParaEnd ); - pDoc->DontExpandFmt( *pCursor->Start() ); + const uno::Reference< lang::XUnoTunnel > xRangeTunnel( + xTextCursor, uno::UNO_QUERY_THROW ); + SwXTextCursor *const pTextCursor = + ::sw::UnoTunnelGetImplementation(xRangeTunnel); - if(rText.getLength()) - { - xub_StrLen nContentPos = pCursor->GetPoint()->nContent.GetIndex(); - SwUnoCursorHelper::DocInsertStringSplitCR( *pDoc, *pCursor, rText, - false ); - SwUnoCursorHelper::SelectPam(*pCursor, true); - pCursor->GetPoint()->nContent = nContentPos; - } + bool bIllegalException = false; + bool bRuntimeException = false; + ::rtl::OUString sMessage; + m_pImpl->m_pDoc->StartUndo(UNDO_INSERT, NULL); - if(rCharacterAndParagraphProperties.getLength()) +// SwPaM aPam(*pStartNode->EndOfSectionNode()); + //aPam.Move( fnMoveBackward, fnGoNode ); + SwUnoCrsr *const pCursor = pTextCursor->GetCursor(); + pCursor->MovePara( fnParaCurr, fnParaEnd ); + m_pImpl->m_pDoc->DontExpandFmt( *pCursor->Start() ); + + if (rText.getLength()) + { + const xub_StrLen nContentPos = pCursor->GetPoint()->nContent.GetIndex(); + SwUnoCursorHelper::DocInsertStringSplitCR( + *m_pImpl->m_pDoc, *pCursor, rText, false); + SwUnoCursorHelper::SelectPam(*pCursor, true); + pCursor->GetPoint()->nContent = nContentPos; + } + + if (rCharacterAndParagraphProperties.getLength()) + { + SfxItemPropertyMap const*const pCursorMap = + aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_CURSOR) + ->getPropertyMap(); + beans::PropertyValue const*const pValues = + rCharacterAndParagraphProperties.getConstArray(); + SfxItemPropertySet const*const pCursorPropSet = + aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_CURSOR); + const sal_Int32 nLen(rCharacterAndParagraphProperties.getLength()); + for (sal_Int32 nProp = 0; nProp < nLen; ++nProp) { - const SfxItemPropertyMap* pCursorMap = aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_CURSOR)->getPropertyMap(); - const beans::PropertyValue* pValues = rCharacterAndParagraphProperties.getConstArray(); - const SfxItemPropertySet* pCursorPropSet = aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_CURSOR); - for( sal_Int32 nProp = 0; nProp < rCharacterAndParagraphProperties.getLength(); ++nProp) + if (!pCursorMap->getByName( pValues[nProp].Name )) { - if( pCursorMap->getByName( pValues[nProp].Name ) ) - { - try - { - SwUnoCursorHelper::SetPropertyValue( - *pCursor, *pCursorPropSet, - pValues[nProp].Name, pValues[nProp].Value, - nsSetAttrMode::SETATTR_NOFORMATATTR); - } - catch( lang::IllegalArgumentException& rIllegal ) - { - sMessage = rIllegal.Message; - bIllegalException = true; - } - catch( uno::RuntimeException& rRuntime ) - { - sMessage = rRuntime.Message; - bRuntimeException = true; - } - } - else - bIllegalException = true; - if( bIllegalException || bRuntimeException ) - { - break; - } + bIllegalException = true; + break; } - } - pDoc->EndUndo(UNDO_INSERT, NULL); - if( bIllegalException || bRuntimeException ) - { - SwUndoIter aUndoIter( pCursor, UNDO_EMPTY ); - pDoc->Undo(aUndoIter); - delete pCursor; - pCursor = 0; - if(bIllegalException) + try { - lang::IllegalArgumentException aEx; - aEx.Message = sMessage; - throw aEx; + SwUnoCursorHelper::SetPropertyValue( + *pCursor, *pCursorPropSet, + pValues[nProp].Name, pValues[nProp].Value, + nsSetAttrMode::SETATTR_NOFORMATATTR); } - else //if(bRuntimeException) + catch( lang::IllegalArgumentException& rIllegal ) { - uno::RuntimeException aEx; - aEx.Message = sMessage; - throw aEx; + sMessage = rIllegal.Message; + bIllegalException = true; + break; } + catch( uno::RuntimeException& rRuntime ) + { + sMessage = rRuntime.Message; + bRuntimeException = true; + break; + } + } + } + m_pImpl->m_pDoc->EndUndo(UNDO_INSERT, NULL); + if (bIllegalException || bRuntimeException) + { + SwUndoIter aUndoIter( pCursor, UNDO_EMPTY ); + m_pImpl->m_pDoc->Undo(aUndoIter); + if (bIllegalException) + { + lang::IllegalArgumentException aEx; + aEx.Message = sMessage; + throw aEx; + } + else //if(bRuntimeException) + { + uno::RuntimeException aEx; + aEx.Message = sMessage; + throw aEx; } - xRet = new SwXTextRange(*pCursor, this); - delete pCursor; } - return xRet; + xRet = new SwXTextRange(*pCursor, this); + return xRet; } + /*-- 11.05.2006 15:46:26--------------------------------------------------- enable appending text contents like graphic objects, shapes and so on to support import filters -----------------------------------------------------------------------*/ -uno::Reference< text::XTextRange > SwXText::appendTextContent( +uno::Reference< text::XTextRange > SAL_CALL +SwXText::appendTextContent( const uno::Reference< text::XTextContent >& xTextContent, - const uno::Sequence< beans::PropertyValue >& rCharacterAndParagraphProperties ) - throw (lang::IllegalArgumentException, uno::RuntimeException) + const uno::Sequence< beans::PropertyValue >& + rCharacterAndParagraphProperties) +throw (lang::IllegalArgumentException, uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - if(!IsValid()) + + if (!IsValid()) + { throw uno::RuntimeException(); - const SwStartNode* pStartNode = GetStartNode(); + } + SwStartNode const*const pStartNode = GetStartNode(); if(!pStartNode) + { throw uno::RuntimeException(); + } + uno::Reference< text::XTextRange > xRet; + m_pImpl->m_pDoc->StartUndo(UNDO_INSERT, NULL); + // find end node, go backward - don't skip tables because the + // new paragraph has to be the last node + SwPaM aPam(*pStartNode->EndOfSectionNode()); + aPam.Move( fnMoveBackward, fnGoNode ); + // set cursor to the end of the last text node + SwCursor aCursor( *aPam.Start(), 0, false ); + xRet = new SwXTextRange(aCursor, this); + aCursor.MovePara( fnParaCurr, fnParaEnd ); + m_pImpl->m_pDoc->DontExpandFmt( *aCursor.Start() ); + // now attach the text content here + insertTextContent( xRet, xTextContent, false ); + // now apply the properties to the anchor + if (rCharacterAndParagraphProperties.getLength()) { - pDoc->StartUndo(UNDO_INSERT, NULL); - //find end node, go backward - don't skip tables because the new paragraph has to be the last node - SwPaM aPam(*pStartNode->EndOfSectionNode()); - aPam.Move( fnMoveBackward, fnGoNode ); - //set cursor to the end of the last text node - SwCursor* pCursor = new SwCursor( *aPam.Start(),0,false ); - xRet = new SwXTextRange(*pCursor, this); - pCursor->MovePara( fnParaCurr, fnParaEnd ); - pDoc->DontExpandFmt( *pCursor->Start() ); - //now attach the text content here - insertTextContent( xRet, xTextContent, false ); - //now apply the properties to the anchor - if( rCharacterAndParagraphProperties.getLength()) + try { - try + const sal_Int32 nLen(rCharacterAndParagraphProperties.getLength()); + const uno::Reference< beans::XPropertySet > xAnchor( + xTextContent->getAnchor(), uno::UNO_QUERY); + if (xAnchor.is()) { - uno::Reference< beans::XPropertySet > xAnchor( xTextContent->getAnchor(), uno::UNO_QUERY); - if( xAnchor.is() ) + for (sal_Int32 nElement = 0; nElement < nLen; ++nElement) { - for( sal_Int32 nElement = 0; nElement < rCharacterAndParagraphProperties.getLength(); ++nElement ) - { - xAnchor->setPropertyValue( rCharacterAndParagraphProperties[nElement].Name, rCharacterAndParagraphProperties[nElement].Value ); - } + xAnchor->setPropertyValue( + rCharacterAndParagraphProperties[nElement].Name, + rCharacterAndParagraphProperties[nElement].Value); } - - } - catch(const uno::Exception&) - { - throw uno::RuntimeException(); } } - delete pCursor; - pDoc->EndUndo(UNDO_INSERT, NULL); + catch (const uno::Exception&) + { + throw uno::RuntimeException(); + } } + m_pImpl->m_pDoc->EndUndo(UNDO_INSERT, NULL); return xRet; } // move previously appended paragraphs into a text frames // to support import filters -uno::Reference< text::XTextContent > SwXText::convertToTextFrame( +uno::Reference< text::XTextContent > SAL_CALL +SwXText::convertToTextFrame( const uno::Reference< text::XTextRange >& xStart, const uno::Reference< text::XTextRange >& xEnd, - const uno::Sequence< beans::PropertyValue >& rFrameProperties ) - throw (lang::IllegalArgumentException, uno::RuntimeException) + const uno::Sequence< beans::PropertyValue >& rFrameProperties) +throw (lang::IllegalArgumentException, uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); + if(!IsValid()) + { throw uno::RuntimeException(); + } uno::Reference< text::XTextContent > xRet; SwUnoInternalPaM aStartPam(*GetDoc()); - std::auto_ptr < SwUnoInternalPaM > pEndPam( new SwUnoInternalPaM(*GetDoc())); - if (::sw::XTextRangeToSwPaM(aStartPam, xStart) && - ::sw::XTextRangeToSwPaM(*pEndPam, xEnd)) - { - uno::Reference xStartRangeTunnel( xStart, uno::UNO_QUERY); - SwXTextRange* pStartRange = reinterpret_cast< SwXTextRange * >( - sal::static_int_cast< sal_IntPtr >( xStartRangeTunnel->getSomething( SwXTextRange::getUnoTunnelId()) )); - uno::Reference xEndRangeTunnel( xEnd, uno::UNO_QUERY); - SwXTextRange* pEndRange = reinterpret_cast< SwXTextRange * >( - sal::static_int_cast< sal_IntPtr >( xEndRangeTunnel->getSomething( SwXTextRange::getUnoTunnelId()) )); - //bookmarks have to be removed before the referenced text node is deleted in DelFullPara - if(pStartRange) - { - pStartRange->Invalidate(); - } - if(pEndRange) - { - pEndRange->Invalidate(); - } + std::auto_ptr< SwUnoInternalPaM > pEndPam(new SwUnoInternalPaM(*GetDoc())); + if (!::sw::XTextRangeToSwPaM(aStartPam, xStart) || + !::sw::XTextRangeToSwPaM(*pEndPam, xEnd)) + { + throw lang::IllegalArgumentException(); + } - pDoc->StartUndo( UNDO_START, NULL ); - bool bIllegalException = false; - bool bRuntimeException = false; - ::rtl::OUString sMessage; - SwStartNode* pStartStartNode = aStartPam.GetNode()->StartOfSectionNode(); - while(pStartStartNode && pStartStartNode->IsSectionNode()) + const uno::Reference xStartRangeTunnel(xStart, + uno::UNO_QUERY); + SwXTextRange *const pStartRange = + ::sw::UnoTunnelGetImplementation(xStartRangeTunnel); + const uno::Reference xEndRangeTunnel(xEnd, + uno::UNO_QUERY); + SwXTextRange *const pEndRange = + ::sw::UnoTunnelGetImplementation(xEndRangeTunnel); + // bookmarks have to be removed before the referenced text node + // is deleted in DelFullPara + if (pStartRange) + { + pStartRange->Invalidate(); + } + if (pEndRange) + { + pEndRange->Invalidate(); + } + + m_pImpl->m_pDoc->StartUndo( UNDO_START, NULL ); + bool bIllegalException = false; + bool bRuntimeException = false; + ::rtl::OUString sMessage; + SwStartNode* pStartStartNode = aStartPam.GetNode()->StartOfSectionNode(); + while (pStartStartNode && pStartStartNode->IsSectionNode()) + { + pStartStartNode = pStartStartNode->StartOfSectionNode(); + } + SwStartNode* pEndStartNode = pEndPam->GetNode()->StartOfSectionNode(); + while (pEndStartNode && pEndStartNode->IsSectionNode()) + { + pEndStartNode = pEndStartNode->StartOfSectionNode(); + } + bool bParaAfterInserted = false; + bool bParaBeforeInserted = false; + if (pStartStartNode != pEndStartNode || pStartStartNode != GetStartNode()) + { + // todo: if the start/end is in a table then insert a paragraph + // before/after, move the start/end nodes, then convert and + // remove the addtional paragraphs in the end + if (pStartStartNode->GetStartNodeType() == SwTableBoxStartNode) { - pStartStartNode = pStartStartNode->StartOfSectionNode(); + SwTableNode *const pSartTableNode(pStartStartNode->FindTableNode()); + const SwNodeIndex aTblIdx( *pSartTableNode, -1 ); + SwPosition aBefore(aTblIdx); + bParaBeforeInserted = GetDoc()->AppendTxtNode( aBefore ); + aStartPam.DeleteMark(); + *aStartPam.GetPoint() = aBefore; + pStartStartNode = aStartPam.GetNode()->StartOfSectionNode(); } - SwStartNode* pEndStartNode = pEndPam->GetNode()->StartOfSectionNode(); - while(pEndStartNode && pEndStartNode->IsSectionNode()) + if (pEndStartNode->GetStartNodeType() == SwTableBoxStartNode) { - pEndStartNode = pEndStartNode->StartOfSectionNode(); + SwTableNode *const pEndTableNode = pEndStartNode->FindTableNode(); + SwEndNode *const pTableEnd = pEndTableNode->EndOfSectionNode(); + SwPosition aTableEnd(*pTableEnd); + bParaAfterInserted = GetDoc()->AppendTxtNode( aTableEnd ); + pEndPam->DeleteMark(); + *pEndPam->GetPoint() = aTableEnd; + pEndStartNode = pEndPam->GetNode()->StartOfSectionNode(); } - bool bParaAfterInserted = false; - bool bParaBeforeInserted = false; - if(pStartStartNode != pEndStartNode || pStartStartNode != GetStartNode()) + // now we should have the positions in the same hierarchy + if ((pStartStartNode != pEndStartNode) || + (pStartStartNode != GetStartNode())) { - //todo: if the start/end is in a table then insert a paragraph before/after, move - //the start/end nodes, then convert and remove the addtional paragraphs in the end - if( pStartStartNode->GetStartNodeType() == SwTableBoxStartNode ) - { - SwTableNode* pSartTableNode = pStartStartNode->FindTableNode(); - SwNodeIndex aTblIdx( *pSartTableNode, -1 ); - SwPosition aBefore(aTblIdx); - bParaBeforeInserted = GetDoc()->AppendTxtNode( aBefore ); - aStartPam.DeleteMark(); - *aStartPam.GetPoint() = aBefore; - pStartStartNode = aStartPam.GetNode()->StartOfSectionNode(); - } - if( pEndStartNode->GetStartNodeType() == SwTableBoxStartNode ) + // if not - remove the additional paragraphs and throw + if (bParaBeforeInserted) { - SwTableNode* pEndTableNode = pEndStartNode->FindTableNode(); - SwEndNode* pTableEnd = pEndTableNode->EndOfSectionNode(); - SwPosition aTableEnd(*pTableEnd); - bParaAfterInserted = GetDoc()->AppendTxtNode( aTableEnd ); - pEndPam->DeleteMark(); - *pEndPam->GetPoint() = aTableEnd; - pEndStartNode = pEndPam->GetNode()->StartOfSectionNode(); + SwCursor aDelete(*aStartPam.GetPoint(), 0, false); + aDelete.MovePara(fnParaCurr, fnParaStart); + aDelete.SetMark(); + aDelete.MovePara(fnParaCurr, fnParaEnd); + GetDoc()->DelFullPara(aDelete); } - //now we should have the positions in the same hierarchy - if(pStartStartNode != pEndStartNode || pStartStartNode != GetStartNode()) + if (bParaAfterInserted) { - //if not - remove the additional paragraphs and throw - if( bParaBeforeInserted ) - { - SwCursor aDelete(*aStartPam.GetPoint(), 0, false); - aDelete.MovePara(fnParaCurr, fnParaStart); - aDelete.SetMark(); - aDelete.MovePara(fnParaCurr, fnParaEnd); - GetDoc()->DelFullPara(aDelete); - } - if( bParaAfterInserted ) - { - SwCursor aDelete(*pEndPam->GetPoint(), 0, false); - aDelete.MovePara(fnParaCurr, fnParaStart); - aDelete.SetMark(); - aDelete.MovePara(fnParaCurr, fnParaEnd); - GetDoc()->DelFullPara(aDelete); - } - throw lang::IllegalArgumentException(); + SwCursor aDelete(*pEndPam->GetPoint(), 0, false); + aDelete.MovePara(fnParaCurr, fnParaStart); + aDelete.SetMark(); + aDelete.MovePara(fnParaCurr, fnParaEnd); + GetDoc()->DelFullPara(aDelete); } + throw lang::IllegalArgumentException(); } + } - //make a selection from aStartPam to a EndPam - SwSelBoxes aBoxes; - SfxItemSet aFrameItemSet(pDoc->GetAttrPool(), - RES_FRMATR_BEGIN, RES_FRMATR_END-1, - 0 ); + // make a selection from aStartPam to a EndPam + SwSelBoxes aBoxes; + SfxItemSet aFrameItemSet(m_pImpl->m_pDoc->GetAttrPool(), + RES_FRMATR_BEGIN, RES_FRMATR_END-1, + 0 ); - aStartPam.SetMark(); - *aStartPam.End() = *pEndPam->End(); - pEndPam.reset(0); + aStartPam.SetMark(); + *aStartPam.End() = *pEndPam->End(); + pEndPam.reset(0); - SwXTextFrame* pNewFrame; - uno::Reference< text::XTextFrame > xNewFrame = pNewFrame = new SwXTextFrame( pDoc ); - pNewFrame->SetSelection( aStartPam ); - try + SwXTextFrame *const pNewFrame = new SwXTextFrame(m_pImpl->m_pDoc); + const uno::Reference< text::XTextFrame > xNewFrame = pNewFrame; + pNewFrame->SetSelection( aStartPam ); + try + { + const beans::PropertyValue* pValues = rFrameProperties.getConstArray(); + for (sal_Int32 nProp = 0; nProp < rFrameProperties.getLength(); ++nProp) { - const beans::PropertyValue* pValues = rFrameProperties.getConstArray(); - for(sal_Int32 nProp = 0; nProp < rFrameProperties.getLength(); ++nProp) - pNewFrame->SwXFrame::setPropertyValue(pValues[nProp].Name, pValues[nProp].Value); - - {//has to be in a block to remove the SwIndexes before DelFullPara is called - uno::Reference< text::XTextRange> xInsertTextRange = new SwXTextRange(aStartPam, this); - pNewFrame->attach( xInsertTextRange ); - pNewFrame->setName(pDoc->GetUniqueFrameName()); - } + pNewFrame->SwXFrame::setPropertyValue( + pValues[nProp].Name, pValues[nProp].Value); + } - if( !aStartPam.GetTxt().Len() ) - { + { // has to be in a block to remove the SwIndexes before + // DelFullPara is called + const uno::Reference< text::XTextRange> xInsertTextRange = + new SwXTextRange(aStartPam, this); + pNewFrame->attach( xInsertTextRange ); + pNewFrame->setName(m_pImpl->m_pDoc->GetUniqueFrameName()); + } - bool bMoved = false; - {//has to be in a block to remove the SwIndexes before DelFullPara is called - SwPaM aMovePam( *aStartPam.GetNode() ); - if( aMovePam.Move( fnMoveForward, fnGoCntnt ) ) - { - //move the anchor to the next paragraph - SwFmtAnchor aNewAnchor( pNewFrame->GetFrmFmt()->GetAnchor() ); - aNewAnchor.SetAnchor( aMovePam.Start() ); - pDoc->SetAttr( aNewAnchor, *pNewFrame->GetFrmFmt() ); - } - bMoved = true; - } - if(bMoved) + if (!aStartPam.GetTxt().Len()) + { + bool bMoved = false; + { // has to be in a block to remove the SwIndexes before + // DelFullPara is called + SwPaM aMovePam( *aStartPam.GetNode() ); + if (aMovePam.Move( fnMoveForward, fnGoCntnt )) { - aStartPam.DeleteMark(); -// SwPaM aDelPam( *aStartPam.GetNode() ); - pDoc->DelFullPara(aStartPam/*aDelPam*/); + // move the anchor to the next paragraph + SwFmtAnchor aNewAnchor(pNewFrame->GetFrmFmt()->GetAnchor()); + aNewAnchor.SetAnchor( aMovePam.Start() ); + m_pImpl->m_pDoc->SetAttr( + aNewAnchor, *pNewFrame->GetFrmFmt() ); } + bMoved = true; + } + if (bMoved) + { + aStartPam.DeleteMark(); +// SwPaM aDelPam( *aStartPam.GetNode() ); + m_pImpl->m_pDoc->DelFullPara(aStartPam/*aDelPam*/); } } - catch( lang::IllegalArgumentException& rIllegal ) - { - sMessage = rIllegal.Message; - bIllegalException = true; - } - catch( uno::RuntimeException& rRuntime ) + } + catch (lang::IllegalArgumentException& rIllegal) + { + sMessage = rIllegal.Message; + bIllegalException = true; + } + catch (uno::RuntimeException& rRuntime) + { + sMessage = rRuntime.Message; + bRuntimeException = true; + } + xRet = pNewFrame; + if (bParaBeforeInserted || bParaAfterInserted) + { + const uno::Reference xFrameTextCursor = + pNewFrame->createTextCursor(); + const uno::Reference xTunnel(xFrameTextCursor, + uno::UNO_QUERY); + SwXTextCursor *const pFrameCursor = + ::sw::UnoTunnelGetImplementation(xTunnel); + if (bParaBeforeInserted) { - sMessage = rRuntime.Message; - bRuntimeException = true; + // todo: remove paragraph before frame + m_pImpl->m_pDoc->DelFullPara(*pFrameCursor->GetPaM()); } - xRet = pNewFrame; - uno::Reference xFrameTextCursor; - if( bParaBeforeInserted ) + if (bParaAfterInserted) { - //todo: remove paragraph before frame - xFrameTextCursor = pNewFrame->createTextCursor(); - uno::Reference xTunnel(xFrameTextCursor, uno::UNO_QUERY); - SwXTextCursor* pFrameCursor = reinterpret_cast< SwXTextCursor* >( - sal::static_int_cast< sal_IntPtr >( xTunnel->getSomething(SwXTextCursor::getUnoTunnelId()) )); - pDoc->DelFullPara(*pFrameCursor->GetPaM()); + xFrameTextCursor->gotoEnd(sal_False); + m_pImpl->m_pDoc->DelFullPara(*pFrameCursor->GetPaM()); } - if( bParaAfterInserted ) + } + + m_pImpl->m_pDoc->EndUndo(UNDO_END, NULL); + if (bIllegalException || bRuntimeException) + { + SwUndoIter aUndoIter( &aStartPam, UNDO_EMPTY ); + m_pImpl->m_pDoc->Undo(aUndoIter); + if (bIllegalException) { - //todo: remove paragraph after frame - if( xFrameTextCursor.is() ) - xFrameTextCursor = pNewFrame->createTextCursor(); - xFrameTextCursor->gotoEnd( false ); - uno::Reference xTunnel(xFrameTextCursor, uno::UNO_QUERY); - SwXTextCursor* pFrameCursor = reinterpret_cast< SwXTextCursor* >( - sal::static_int_cast< sal_IntPtr >( xTunnel->getSomething(SwXTextCursor::getUnoTunnelId()) )); - pDoc->DelFullPara(*pFrameCursor->GetPaM()); + lang::IllegalArgumentException aEx; + aEx.Message = sMessage; + throw aEx; } - - pDoc->EndUndo(UNDO_END, NULL); - if( bIllegalException || bRuntimeException ) + else //if(bRuntimeException) { - SwUndoIter aUndoIter( &aStartPam, UNDO_EMPTY ); - pDoc->Undo(aUndoIter); - if(bIllegalException) - { - lang::IllegalArgumentException aEx; - aEx.Message = sMessage; - throw aEx; - } - else //if(bRuntimeException) - { - uno::RuntimeException aEx; - aEx.Message = sMessage; - throw aEx; - } + uno::RuntimeException aEx; + aEx.Message = sMessage; + throw aEx; } } - else - throw lang::IllegalArgumentException(); return xRet; } + /*-- 11.05.2006 15:46:26--------------------------------------------------- Move previously imported paragraphs into a new text table. @@ -1788,12 +1851,15 @@ bool lcl_SimilarPosition( sal_Int32 nPos1, sal_Int32 nPos2 ) return abs( nPos1 - nPos2 ) < COL_POS_FUZZY; } -uno::Reference< text::XTextTable > SwXText::convertToTable( - const uno::Sequence< uno::Sequence< uno::Sequence< uno::Reference< text::XTextRange > > > >& rTableRanges, - const uno::Sequence< uno::Sequence< uno::Sequence< beans::PropertyValue > > >& rCellProperties, +uno::Reference< text::XTextTable > SAL_CALL +SwXText::convertToTable( + const uno::Sequence< uno::Sequence< uno::Sequence< + uno::Reference< text::XTextRange > > > >& rTableRanges, + const uno::Sequence< uno::Sequence< uno::Sequence< + beans::PropertyValue > > >& rCellProperties, const uno::Sequence< uno::Sequence< beans::PropertyValue > >& rRowProperties, - const uno::Sequence< beans::PropertyValue >& rTableProperties ) - throw (lang::IllegalArgumentException, uno::RuntimeException) + const uno::Sequence< beans::PropertyValue >& rTableProperties) +throw (lang::IllegalArgumentException, uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); if(!IsValid()) @@ -1804,7 +1870,7 @@ uno::Reference< text::XTextTable > SwXText::convertToTable( std::auto_ptr < SwPaM > pFirstPaM; std::vector< std::vector > aTableNodes; bool bExcept = false; - SwPaM aLastPaM(pDoc->GetNodes()); + SwPaM aLastPaM(m_pImpl->m_pDoc->GetNodes()); for( sal_Int32 nRow = 0; !bExcept && (nRow < rTableRanges.getLength()); ++nRow) { std::vector aRowNodes; @@ -1817,8 +1883,8 @@ uno::Reference< text::XTextTable > SwXText::convertToTable( throw lang::IllegalArgumentException(); const uno::Reference< text::XTextRange > xStartRange = pRow[nCell][0]; const uno::Reference< text::XTextRange > xEndRange = pRow[nCell][1]; - SwUnoInternalPaM aStartCellPam(*pDoc); - SwUnoInternalPaM aEndCellPam(*pDoc); + SwUnoInternalPaM aStartCellPam(*m_pImpl->m_pDoc); + SwUnoInternalPaM aEndCellPam(*m_pImpl->m_pDoc); // !!! TODO - PaMs in tables and sections do not work here - the same applies to PaMs in frames !!! @@ -1865,7 +1931,7 @@ uno::Reference< text::XTextTable > SwXText::convertToTable( { //align the beginning - if necessary if(aStartCellPam.Start()->nContent.GetIndex()) - pDoc->SplitNode(*aStartCellPam.Start(), sal_False); + m_pImpl->m_pDoc->SplitNode(*aStartCellPam.Start(), sal_False); } else { @@ -1880,7 +1946,7 @@ uno::Reference< text::XTextTable > SwXText::convertToTable( bExcept = true; else { - pDoc->SplitNode(*aStartCellPam.Start(), sal_False); + m_pImpl->m_pDoc->SplitNode(*aStartCellPam.Start(), sal_False); } } else if(nStartCellNodeIndex == ( nLastNodeEndIndex + 1)) @@ -1898,7 +1964,7 @@ uno::Reference< text::XTextTable > SwXText::convertToTable( //now check if there's a need to insert another paragraph break if( aEndCellPam.End()->nContent.GetIndex() < aEndCellPam.End()->nNode.GetNode().GetTxtNode()->Len()) { - pDoc->SplitNode(*aEndCellPam.End(), sal_False); + m_pImpl->m_pDoc->SplitNode(*aEndCellPam.End(), sal_False); //take care that the new start/endcell is moved to the right position //aStartCellPam has to point to the start of the new (previous) node //aEndCellPam has to point the the end of the new (previous) node @@ -1931,7 +1997,7 @@ uno::Reference< text::XTextTable > SwXText::convertToTable( if(bExcept) { SwUndoIter aUndoIter( &aLastPaM, UNDO_EMPTY ); - pDoc->Undo(aUndoIter); + m_pImpl->m_pDoc->Undo(aUndoIter); throw lang::IllegalArgumentException(); } @@ -1939,7 +2005,7 @@ uno::Reference< text::XTextTable > SwXText::convertToTable( std::vector< TableColumnSeparators > aRowSeparators(rRowProperties.getLength()); std::vector aMergedCells; - const SwTable* pTable = pDoc->TextToTable( aTableNodes ); + const SwTable* pTable = m_pImpl->m_pDoc->TextToTable( aTableNodes ); SwXTextTable* pTextTable = 0; uno::Reference< text::XTextTable > xRet = pTextTable = new SwXTextTable( *pTable->GetFrmFmt() ); uno::Reference< beans::XPropertySet > xPrSet = pTextTable; @@ -2159,12 +2225,12 @@ uno::Reference< text::XTextTable > SwXText::convertToTable( bool bIllegalException = false; bool bRuntimeException = false; ::rtl::OUString sMessage; - pDoc->StartUndo(UNDO_START, NULL); - pDoc->EndUndo(UNDO_START, NULL); + m_pImpl->m_pDoc->StartUndo(UNDO_START, NULL); + m_pImpl->m_pDoc->EndUndo(UNDO_START, NULL); if( bIllegalException || bRuntimeException ) { SwUndoIter aUndoIter( pFirstPaM.get(), UNDO_EMPTY ); - pDoc->Undo(aUndoIter); + m_pImpl->m_pDoc->Undo(aUndoIter); if(bIllegalException) { lang::IllegalArgumentException aEx; @@ -2493,7 +2559,8 @@ const SwStartNode *SwXHeadFootText::GetStartNode() const return pSttNd; } -uno::Reference< text::XTextCursor > SwXHeadFootText::createCursor() throw(uno::RuntimeException) +uno::Reference< text::XTextCursor > +SwXHeadFootText::CreateCursor() throw (uno::RuntimeException) { return createTextCursor(); } -- cgit v1.2.3 From 150d65d3115d361f19df118c25e530d54a055937 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:56 +0100 Subject: swunolocking1: #i105557#: clean up implementation of SwXText::convertToTable(). --- sw/source/core/unocore/unotext.cxx | 745 +++++++++++++++++++++---------------- 1 file changed, 422 insertions(+), 323 deletions(-) diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index c45f8772a217..987f4e359752 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -123,6 +123,15 @@ public: bool CheckForOwnMember(const SwPaM & rPaM) throw (lang::IllegalArgumentException, uno::RuntimeException); + + void ConvertCell( + const bool bFirstCell, + const uno::Sequence< uno::Reference< text::XTextRange > > & rCell, + ::std::vector & rRowNodes, + ::std::auto_ptr< SwPaM > & rpFirstPaM, + SwPaM & rLastPaM, + bool & rbExcept); + }; /* -----------------------------15.03.2002 12:39------------------------------ @@ -1838,158 +1847,407 @@ struct VerticallyMergedCell sal_Int32 nLeftPosition; bool bOpen; - VerticallyMergedCell( uno::Reference< beans::XPropertySet >& rxCell, sal_Int32 nLeft ) : - nLeftPosition( nLeft ), - bOpen( true ) - { - aCells.push_back( rxCell ); - } + VerticallyMergedCell(uno::Reference< beans::XPropertySet > const& rxCell, + const sal_Int32 nLeft) + : nLeftPosition( nLeft ) + , bOpen( true ) + { + aCells.push_back( rxCell ); + } }; #define COL_POS_FUZZY 2 -bool lcl_SimilarPosition( sal_Int32 nPos1, sal_Int32 nPos2 ) +static bool lcl_SimilarPosition( const sal_Int32 nPos1, const sal_Int32 nPos2 ) { return abs( nPos1 - nPos2 ) < COL_POS_FUZZY; } -uno::Reference< text::XTextTable > SAL_CALL -SwXText::convertToTable( - const uno::Sequence< uno::Sequence< uno::Sequence< - uno::Reference< text::XTextRange > > > >& rTableRanges, - const uno::Sequence< uno::Sequence< uno::Sequence< - beans::PropertyValue > > >& rCellProperties, - const uno::Sequence< uno::Sequence< beans::PropertyValue > >& rRowProperties, - const uno::Sequence< beans::PropertyValue >& rTableProperties) -throw (lang::IllegalArgumentException, uno::RuntimeException) +void SwXText::Impl::ConvertCell( + const bool bFirstCell, + const uno::Sequence< uno::Reference< text::XTextRange > > & rCell, + ::std::vector & rRowNodes, + ::std::auto_ptr< SwPaM > & rpFirstPaM, + SwPaM & rLastPaM, + bool & rbExcept) { - vos::OGuard aGuard(Application::GetSolarMutex()); - if(!IsValid()) - throw uno::RuntimeException(); + if (rCell.getLength() != 2) + { + throw lang::IllegalArgumentException(); + } + const uno::Reference xStartRange = rCell[0]; + const uno::Reference xEndRange = rCell[1]; + SwUnoInternalPaM aStartCellPam(*m_pDoc); + SwUnoInternalPaM aEndCellPam(*m_pDoc); - //at first collect the text ranges as SwPaMs - const uno::Sequence< uno::Sequence< uno::Reference< text::XTextRange > > >* pTableRanges = rTableRanges.getConstArray(); - std::auto_ptr < SwPaM > pFirstPaM; - std::vector< std::vector > aTableNodes; - bool bExcept = false; - SwPaM aLastPaM(m_pImpl->m_pDoc->GetNodes()); - for( sal_Int32 nRow = 0; !bExcept && (nRow < rTableRanges.getLength()); ++nRow) + // !!! TODO - PaMs in tables and sections do not work here - + // the same applies to PaMs in frames !!! + + if (!::sw::XTextRangeToSwPaM(aStartCellPam, xStartRange) || + !::sw::XTextRangeToSwPaM(aEndCellPam, xEndRange)) { - std::vector aRowNodes; - const uno::Sequence< uno::Sequence< uno::Reference< text::XTextRange > > >& rRow = pTableRanges[nRow]; - const uno::Sequence< uno::Reference< text::XTextRange > >* pRow = pTableRanges[nRow].getConstArray(); + throw lang::IllegalArgumentException(); + } + /** check the nodes between start and end + it is allowed to have pairs of StartNode/EndNodes + */ + if (aStartCellPam.Start()->nNode < aEndCellPam.End()->nNode) + { + // increment on each StartNode and decrement on each EndNode + // we must reach zero at the end and must not go below zero + long nOpenNodeBlock = 0; + SwNodeIndex aCellIndex = aStartCellPam.Start()->nNode; + while (aCellIndex < aEndCellPam.End()->nNode.GetIndex()) + { + if (aCellIndex.GetNode().IsStartNode()) + { + ++nOpenNodeBlock; + } + else if (aCellIndex.GetNode().IsEndNode()) + { + --nOpenNodeBlock; + } + if (nOpenNodeBlock < 0) + { + rbExcept = true; + break; + } + ++aCellIndex; + } + if (nOpenNodeBlock != 0) + { + rbExcept = true; + return; + } + } - for( sal_Int32 nCell = 0; nCell < rRow.getLength(); ++nCell) + /** The vector NodeRanges has to contain consecutive nodes. + In rTableRanges the ranges don't need to be full paragraphs but + they have to follow each other. To process the ranges they + have to be aligned on paragraph borders by inserting paragraph + breaks. Non-consecutive ranges must initiate an exception. + */ + if (bFirstCell) + { + // align the beginning - if necessary + if (aStartCellPam.Start()->nContent.GetIndex()) { - if( pRow[nCell].getLength() != 2 ) - throw lang::IllegalArgumentException(); - const uno::Reference< text::XTextRange > xStartRange = pRow[nCell][0]; - const uno::Reference< text::XTextRange > xEndRange = pRow[nCell][1]; - SwUnoInternalPaM aStartCellPam(*m_pImpl->m_pDoc); - SwUnoInternalPaM aEndCellPam(*m_pImpl->m_pDoc); - - // !!! TODO - PaMs in tables and sections do not work here - the same applies to PaMs in frames !!! - - if (!::sw::XTextRangeToSwPaM(aStartCellPam, xStartRange) || - !::sw::XTextRangeToSwPaM(aEndCellPam, xEndRange)) - throw lang::IllegalArgumentException(); - /** check the nodes between start and end - it is allowed to have pairs of StartNode/EndNodes - */ - if(aStartCellPam.Start()->nNode < aEndCellPam.End()->nNode) + m_pDoc->SplitNode(*aStartCellPam.Start(), sal_False); + } + } + else + { + // check the predecessor + const ULONG nLastNodeIndex = rLastPaM.End()->nNode.GetIndex(); + const ULONG nStartCellNodeIndex = + aStartCellPam.Start()->nNode.GetIndex(); + const ULONG nLastNodeEndIndex = rLastPaM.End()->nNode.GetIndex(); + if (nLastNodeIndex == nStartCellNodeIndex) + { + // same node as predecessor then equal nContent? + if (rLastPaM.End()->nContent != aStartCellPam.Start()->nContent) { - // increment on each StartNode and decrement on each EndNode - // we must reach zero at the end and must not go below zero - long nOpenNodeBlock = 0; - SwNodeIndex aCellIndex = aStartCellPam.Start()->nNode; - while( aCellIndex < aEndCellPam.End()->nNode.GetIndex()) - { - if( aCellIndex.GetNode().IsStartNode() ) - ++nOpenNodeBlock; - else if(aCellIndex.GetNode().IsEndNode() ) - --nOpenNodeBlock; - if( nOpenNodeBlock < 0 ) - { - bExcept = true; - break; - } - ++aCellIndex; - } - if( nOpenNodeBlock != 0) - { - bExcept = true; - break; - } + rbExcept = true; } + else + { + m_pDoc->SplitNode(*aStartCellPam.Start(), sal_False); + } + } + else if (nStartCellNodeIndex == (nLastNodeEndIndex + 1)) + { + // next paragraph - now the content index of the new should be 0 + // and of the old one should be equal to the text length + // but if it isn't we don't care - the cell is being inserted on + // the node border anyway + } + else + { + rbExcept = true; + } + } + // now check if there's a need to insert another paragraph break + if (aEndCellPam.End()->nContent.GetIndex() < + aEndCellPam.End()->nNode.GetNode().GetTxtNode()->Len()) + { + m_pDoc->SplitNode(*aEndCellPam.End(), sal_False); + // take care that the new start/endcell is moved to the right position + // aStartCellPam has to point to the start of the new (previous) node + // aEndCellPam has to point to the end of the new (previous) node + aStartCellPam.DeleteMark(); + aStartCellPam.Move(fnMoveBackward, fnGoNode); + aStartCellPam.GetPoint()->nContent = 0; + aEndCellPam.DeleteMark(); + aEndCellPam.Move(fnMoveBackward, fnGoNode); + aEndCellPam.GetPoint()->nContent = + aEndCellPam.GetNode()->GetTxtNode()->Len(); + } + + *rLastPaM.GetPoint() = *aEndCellPam.Start(); + if (aStartCellPam.HasMark()) + { + rLastPaM.SetMark(); + *rLastPaM.GetMark() = *aEndCellPam.End(); + } + else + { + rLastPaM.DeleteMark(); + } + + SwNodeRange aCellRange(aStartCellPam.Start()->nNode, + aEndCellPam.End()->nNode); + rRowNodes.push_back(aCellRange); + if (bFirstCell) + { + rpFirstPaM.reset(new SwPaM(*aStartCellPam.Start())); + } +} + +typedef uno::Sequence< text::TableColumnSeparator > TableColumnSeparators; + +static void +lcl_ApplyRowProperties( + uno::Sequence const& rRowProperties, + uno::Any const& rRow, + TableColumnSeparators & rRowSeparators) +{ + uno::Reference< beans::XPropertySet > xRow; + rRow >>= xRow; + const beans::PropertyValue* pProperties = rRowProperties.getConstArray(); + for (sal_Int32 nProperty = 0; nProperty < rRowProperties.getLength(); + ++nProperty) + { + if (pProperties[ nProperty ].Name.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("TableColumnSeparators"))) + { + // add the separators to access the cell's positions + // for vertical merging later + TableColumnSeparators aSeparators; + pProperties[ nProperty ].Value >>= aSeparators; + rRowSeparators = aSeparators; + } + xRow->setPropertyValue( + pProperties[ nProperty ].Name, pProperties[ nProperty ].Value); + } +} + +#ifdef DEBUG +//-->debug cell properties of all rows +static void +lcl_DebugCellProperties( + const uno::Sequence< uno::Sequence< uno::Sequence< + beans::PropertyValue > > >& rCellProperties) +{ + ::rtl::OUString sNames; + for (sal_Int32 nDebugRow = 0; nDebugRow < rCellProperties.getLength(); + ++nDebugRow) + { + const uno::Sequence< beans::PropertyValues > aDebugCurrentRow = + rCellProperties[nDebugRow]; + sal_Int32 nDebugCells = aDebugCurrentRow.getLength(); + (void) nDebugCells; + for (sal_Int32 nDebugCell = 0; nDebugCell < nDebugCells; + ++nDebugCell) + { + const uno::Sequence< beans::PropertyValue >& + rDebugCellProperties = aDebugCurrentRow[nDebugCell]; + const sal_Int32 nDebugCellProperties = + rDebugCellProperties.getLength(); + for (sal_Int32 nDebugProperty = 0; + nDebugProperty < nDebugCellProperties; ++nDebugProperty) + { + const ::rtl::OUString sName = + rDebugCellProperties[nDebugProperty].Name; + sNames += sName; + sNames += ::rtl::OUString('-'); + } + sNames += ::rtl::OUString('+'); + } + sNames += ::rtl::OUString('|'); + } + (void)sNames; +} +//--< +#endif - /** The vector NodeRanges has to contain consecutive nodes. - In rTableRanges the ranges don't need to be full paragraphs but they have to follow - each other. To process the ranges they have to be aligned on paragraph borders - by inserting paragraph breaks. Non-consecutive ranges must initiate an - exception. - */ - if(!nRow && !nCell) +static void +lcl_ApplyCellProperties( + const sal_Int32 nCell, + TableColumnSeparators const& rRowSeparators, + const uno::Sequence< beans::PropertyValue >& rCellProperties, + uno::Reference< uno::XInterface > xCell, + ::std::vector & rMergedCells) +{ + const sal_Int32 nCellProperties = rCellProperties.getLength(); + const uno::Reference< beans::XPropertySet > xCellPS(xCell, uno::UNO_QUERY); + for (sal_Int32 nProperty = 0; nProperty < nCellProperties; ++nProperty) + { + const OUString & rName = rCellProperties[nProperty].Name; + const uno::Any & rValue = rCellProperties[nProperty].Value; + if (rName.equalsAscii("VerticalMerge")) + { + // determine left border position + // add the cell to a queue of merged cells + sal_Bool bMerge = sal_False; + rValue >>= bMerge; + sal_Int32 nLeftPos = -1; + if (!nCell) { - //align the beginning - if necessary - if(aStartCellPam.Start()->nContent.GetIndex()) - m_pImpl->m_pDoc->SplitNode(*aStartCellPam.Start(), sal_False); + nLeftPos = 0; } - else + else if (rRowSeparators.getLength() >= nCell) { - //check the predecessor - ULONG nLastNodeIndex = aLastPaM.End()->nNode.GetIndex(); - ULONG nStartCellNodeIndex = aStartCellPam.Start()->nNode.GetIndex(); - ULONG nLastNodeEndIndex = aLastPaM.End()->nNode.GetIndex(); - if( nLastNodeIndex == nStartCellNodeIndex) + const text::TableColumnSeparator* pSeparators = + rRowSeparators.getConstArray(); + nLeftPos = pSeparators[nCell - 1].Position; + } + if (bMerge) + { + // 'close' all the cell with the same left position + // if separate vertical merges in the same column exist + if (rMergedCells.size()) { - //- same node as predecessor then equal nContent? - if(aLastPaM.End()->nContent != aStartCellPam.Start()->nContent) - bExcept = true; - else + std::vector::iterator aMergedIter = + rMergedCells.begin(); + while (aMergedIter != rMergedCells.end()) { - m_pImpl->m_pDoc->SplitNode(*aStartCellPam.Start(), sal_False); + if (lcl_SimilarPosition(aMergedIter->nLeftPosition, + nLeftPos)) + { + aMergedIter->bOpen = false; + } + ++aMergedIter; } } - else if(nStartCellNodeIndex == ( nLastNodeEndIndex + 1)) - { - //next paragraph - now the content index of the new should be 0 - //and of the old one should be equal to the text length - //but if it isn't we don't care - the cell is being inserted on the - //node border anyway - } - else + // add the new group of merged cells + rMergedCells.push_back(VerticallyMergedCell(xCellPS, nLeftPos)); + } + else + { + // find the cell that + DBG_ASSERT(rMergedCells.size(), + "the first merged cell is missing"); + if (rMergedCells.size()) { - bExcept = true; + std::vector::iterator aMergedIter = + rMergedCells.begin(); +#if OSL_DEBUG_LEVEL > 1 + bool bDbgFound = false; +#endif + while (aMergedIter != rMergedCells.end()) + { + if (aMergedIter->bOpen && + lcl_SimilarPosition(aMergedIter->nLeftPosition, + nLeftPos)) + { + aMergedIter->aCells.push_back( xCellPS ); +#if OSL_DEBUG_LEVEL > 1 + bDbgFound = true; +#endif + } + ++aMergedIter; + } +#if OSL_DEBUG_LEVEL > 1 + DBG_ASSERT( bDbgFound, + "couldn't find first vertically merged cell" ); +#endif } } - //now check if there's a need to insert another paragraph break - if( aEndCellPam.End()->nContent.GetIndex() < aEndCellPam.End()->nNode.GetNode().GetTxtNode()->Len()) - { - m_pImpl->m_pDoc->SplitNode(*aEndCellPam.End(), sal_False); - //take care that the new start/endcell is moved to the right position - //aStartCellPam has to point to the start of the new (previous) node - //aEndCellPam has to point the the end of the new (previous) node - aStartCellPam.DeleteMark(); - aStartCellPam.Move(fnMoveBackward, fnGoNode); - aStartCellPam.GetPoint()->nContent = 0; - aEndCellPam.DeleteMark(); - aEndCellPam.Move(fnMoveBackward, fnGoNode); - aEndCellPam.GetPoint()->nContent = aEndCellPam.GetNode()->GetTxtNode()->Len(); - - } - - *aLastPaM.GetPoint() = *aEndCellPam.Start(); - if( aStartCellPam.HasMark() ) + } + else + { + try { - aLastPaM.SetMark(); - *aLastPaM.GetMark() = *aEndCellPam.End(); + xCellPS->setPropertyValue(rName, rValue); } - else - aLastPaM.DeleteMark(); + catch (uno::Exception const& e) + { + // Apply the paragraph and char properties to the cell's content + const uno::Reference< text::XText > xCellText(xCell, + uno::UNO_QUERY); + const uno::Reference< text::XTextCursor > xCellCurs = + xCellText->createTextCursor(); + xCellCurs->gotoStart( sal_False ); + xCellCurs->gotoEnd( sal_True ); + const uno::Reference< beans::XPropertySet > xCellTextProps( + xCellCurs, uno::UNO_QUERY); + xCellTextProps->setPropertyValue(rName, rValue); + } + } + } +} + +static void +lcl_MergeCells(::std::vector & rMergedCells) +{ + if (rMergedCells.size()) + { + std::vector::iterator aMergedIter = + rMergedCells.begin(); + while (aMergedIter != rMergedCells.end()) + { + sal_Int32 nCellCount = + static_cast(aMergedIter->aCells.size()); + std::vector >::iterator + aCellIter = aMergedIter->aCells.begin(); + bool bFirstCell = true; + // the first of the cells gets the number of cells set as RowSpan + // the others get the inverted number of remaining merged cells + // (3,-2,-1) + while (aCellIter != aMergedIter->aCells.end()) + { + (*aCellIter)->setPropertyValue( + C2U(SW_PROP_NAME_STR(UNO_NAME_ROW_SPAN)), + uno::makeAny(nCellCount)); + if (bFirstCell) + { + nCellCount *= -1; + bFirstCell = false; + } + ++nCellCount; + ++aCellIter; + } + ++aMergedIter; + } + } +} + +uno::Reference< text::XTextTable > SAL_CALL +SwXText::convertToTable( + const uno::Sequence< uno::Sequence< uno::Sequence< + uno::Reference< text::XTextRange > > > >& rTableRanges, + const uno::Sequence< uno::Sequence< uno::Sequence< + beans::PropertyValue > > >& rCellProperties, + const uno::Sequence< uno::Sequence< beans::PropertyValue > >& + rRowProperties, + const uno::Sequence< beans::PropertyValue >& rTableProperties) +throw (lang::IllegalArgumentException, uno::RuntimeException) +{ + vos::OGuard aGuard(Application::GetSolarMutex()); + + if(!IsValid()) + { + throw uno::RuntimeException(); + } + + //at first collect the text ranges as SwPaMs + const uno::Sequence< uno::Sequence< uno::Reference< text::XTextRange > > >* + pTableRanges = rTableRanges.getConstArray(); + std::auto_ptr < SwPaM > pFirstPaM; + std::vector< std::vector > aTableNodes; + bool bExcept = false; + SwPaM aLastPaM(m_pImpl->m_pDoc->GetNodes()); + for (sal_Int32 nRow = 0; !bExcept && (nRow < rTableRanges.getLength()); + ++nRow) + { + std::vector aRowNodes; + const uno::Sequence< uno::Reference< text::XTextRange > >* pRow = + pTableRanges[nRow].getConstArray(); + const sal_Int32 nCells(pTableRanges[nRow].getLength()); - SwNodeRange aCellRange( aStartCellPam.Start()->nNode, aEndCellPam.End()->nNode); - aRowNodes.push_back(aCellRange); - if( !nRow && !nCell ) - pFirstPaM.reset( new SwPaM(*aStartCellPam.Start())); + for (sal_Int32 nCell = 0; nCell < nCells; ++nCell) + { + m_pImpl->ConvertCell((nCell == 0) && (nRow == 0), pRow[nCell], + aRowNodes, pFirstPaM, aLastPaM, bExcept); } aTableNodes.push_back(aRowNodes); } @@ -2001,216 +2259,80 @@ throw (lang::IllegalArgumentException, uno::RuntimeException) throw lang::IllegalArgumentException(); } - typedef uno::Sequence< text::TableColumnSeparator > TableColumnSeparators; - std::vector< TableColumnSeparators > aRowSeparators(rRowProperties.getLength()); - std::vector aMergedCells; + std::vector< TableColumnSeparators > + aRowSeparators(rRowProperties.getLength()); + std::vector aMergedCells; - const SwTable* pTable = m_pImpl->m_pDoc->TextToTable( aTableNodes ); - SwXTextTable* pTextTable = 0; - uno::Reference< text::XTextTable > xRet = pTextTable = new SwXTextTable( *pTable->GetFrmFmt() ); - uno::Reference< beans::XPropertySet > xPrSet = pTextTable; - // set properties to the table - catch lang::WrappedTargetException and lang::IndexOutOfBoundsException + SwTable const*const pTable = m_pImpl->m_pDoc->TextToTable( aTableNodes ); + SwXTextTable *const pTextTable = new SwXTextTable( *pTable->GetFrmFmt() ); + const uno::Reference< text::XTextTable > xRet = pTextTable; + const uno::Reference< beans::XPropertySet > xPrSet = pTextTable; + // set properties to the table + // catch lang::WrappedTargetException and lang::IndexOutOfBoundsException try { //apply table properties - const beans::PropertyValue* pTableProperties = rTableProperties.getConstArray(); - sal_Int32 nProperty = 0; - for( ; nProperty < rTableProperties.getLength(); ++nProperty) + const beans::PropertyValue* pTableProperties = + rTableProperties.getConstArray(); + for (sal_Int32 nProperty = 0; nProperty < rTableProperties.getLength(); + ++nProperty) { try { - xPrSet->setPropertyValue( pTableProperties[nProperty].Name, pTableProperties[nProperty].Value ); + xPrSet->setPropertyValue( pTableProperties[nProperty].Name, + pTableProperties[nProperty].Value ); } - catch ( const uno::Exception e ) + catch ( uno::Exception const& e ) { #if DEBUG std::clog << "Exception when setting property: "; - std::clog << rtl::OUStringToOString( pTableProperties[nProperty].Name, RTL_TEXTENCODING_UTF8 ).getStr( ); + std::clog << rtl::OUStringToOString( + pTableProperties[nProperty].Name, RTL_TEXTENCODING_UTF8) + .getStr(); std::clog << ". Message: "; - std::clog << rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_UTF8 ).getStr( ); + std::clog << rtl::OUStringToOString( e.Message, + RTL_TEXTENCODING_UTF8 ).getStr(); std::clog << std::endl; #endif } } //apply row properties - uno::Reference< table::XTableRows > xRows = xRet->getRows(); - const beans::PropertyValues* pRowProperties = rRowProperties.getConstArray(); - sal_Int32 nRow = 0; - for( ; nRow < xRows->getCount(); ++nRow) + const uno::Reference< table::XTableRows > xRows = xRet->getRows(); + + const beans::PropertyValues* pRowProperties = + rRowProperties.getConstArray(); + for (sal_Int32 nRow = 0; nRow < xRows->getCount(); ++nRow) { if( nRow >= rRowProperties.getLength()) { break; } - uno::Reference< beans::XPropertySet > xRow; - xRows->getByIndex( nRow ) >>= xRow; - const beans::PropertyValue* pProperties = pRowProperties[nRow].getConstArray(); - for( nProperty = 0; nProperty < pRowProperties[nRow].getLength(); ++nProperty) - { - if( pProperties[ nProperty ].Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM ( "TableColumnSeparators" ))) - { - //add the separators to access the cell's positions for vertical merging later - TableColumnSeparators aSeparators; - pProperties[ nProperty ].Value >>= aSeparators; - aRowSeparators[nRow] = aSeparators; - } - xRow->setPropertyValue( pProperties[ nProperty ].Name, pProperties[ nProperty ].Value ); - } + lcl_ApplyRowProperties(pRowProperties[nRow], + xRows->getByIndex(nRow), aRowSeparators[nRow]); } #ifdef DEBUG -//-->debug cell properties of all rows - { - ::rtl::OUString sNames; - for( sal_Int32 nDebugRow = 0; nDebugRow < rCellProperties.getLength(); ++nDebugRow) - { - const uno::Sequence< beans::PropertyValues > aDebugCurrentRow = rCellProperties[nDebugRow]; - sal_Int32 nDebugCells = aDebugCurrentRow.getLength(); - (void) nDebugCells; - for( sal_Int32 nDebugCell = 0; nDebugCell < nDebugCells; ++nDebugCell) - { - const uno::Sequence< beans::PropertyValue >& aDebugCellProperties = aDebugCurrentRow[nDebugCell]; - sal_Int32 nDebugCellProperties = aDebugCellProperties.getLength(); - for( sal_Int32 nDebugProperty = 0; nDebugProperty < nDebugCellProperties; ++nDebugProperty) - { - const ::rtl::OUString sName = aDebugCellProperties[nDebugProperty].Name; - sNames += sName; - sNames += ::rtl::OUString('-'); - } - sNames += ::rtl::OUString('+'); - } - sNames += ::rtl::OUString('|'); - } - (void)sNames; - } -//--< + lcl_DebugCellProperties(rCellProperties); #endif - //apply cell properties - for( nRow = 0; nRow < rCellProperties.getLength(); ++nRow) + for (sal_Int32 nRow = 0; nRow < rCellProperties.getLength(); ++nRow) { - const uno::Sequence< beans::PropertyValues > aCurrentRow = rCellProperties[nRow]; + const uno::Sequence< beans::PropertyValues > aCurrentRow = + rCellProperties[nRow]; sal_Int32 nCells = aCurrentRow.getLength(); - for( sal_Int32 nCell = 0; nCell < nCells; ++nCell) - { - const uno::Sequence< beans::PropertyValue >& aCellProperties = aCurrentRow[nCell]; - sal_Int32 nCellProperties = aCellProperties.getLength(); - uno::Reference< beans::XPropertySet > xCell( pTextTable->getCellByPosition(nCell, nRow), uno::UNO_QUERY ); - for( nProperty = 0; nProperty < nCellProperties; ++nProperty) - { - const OUString& rName = aCellProperties[nProperty].Name; - if( rName.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM ( "VerticalMerge"))) - { - //determine left border position - //add the cell to a queue of merged cells - // - sal_Bool bMerge = sal_False; - aCellProperties[nProperty].Value >>= bMerge; - sal_Int32 nLeftPos = -1; - if( !nCell ) - nLeftPos = 0; - else if( aRowSeparators[nRow].getLength() >= nCell ) - { - const text::TableColumnSeparator* pSeparators = aRowSeparators[nRow].getConstArray(); - nLeftPos = pSeparators[nCell - 1].Position; - } - if( bMerge ) - { - // 'close' all the cell with the same left position - // if separate vertical merges in the same column exist - if( aMergedCells.size() ) - { - std::vector::iterator aMergedIter = aMergedCells.begin(); - while( aMergedIter != aMergedCells.end()) - { - if( lcl_SimilarPosition( aMergedIter->nLeftPosition, nLeftPos) ) - { - aMergedIter->bOpen = false; - } - ++aMergedIter; - } - } - //add the new group of merged cells - aMergedCells.push_back(VerticallyMergedCell(xCell, nLeftPos )); - } - else - { - //find the cell that - DBG_ASSERT(aMergedCells.size(), "the first merged cell is missing"); - if( aMergedCells.size() ) - { - std::vector::iterator aMergedIter = aMergedCells.begin(); -#if OSL_DEBUG_LEVEL > 1 - bool bDbgFound = false; -#endif - while( aMergedIter != aMergedCells.end()) - { - if( aMergedIter->bOpen && - lcl_SimilarPosition( aMergedIter->nLeftPosition, nLeftPos) ) - { - aMergedIter->aCells.push_back( xCell ); -#if OSL_DEBUG_LEVEL > 1 - bDbgFound = true; -#endif - } - ++aMergedIter; - } -#if OSL_DEBUG_LEVEL > 1 - DBG_ASSERT( bDbgFound, "couldn't find first vertically merged cell" ); -#endif - } - } - } - else - { - try - { - xCell->setPropertyValue(rName, aCellProperties[nProperty].Value); - } - catch ( const uno::Exception e ) - { - // Apply the paragraph and char properties to the cell's content - uno::Reference< text::XText > xCellText( xCell, uno::UNO_QUERY ); - uno::Reference< text::XTextCursor > xCellCurs = xCellText->createTextCursor( ); - xCellCurs->gotoStart( false ); - xCellCurs->gotoEnd( true ); - - uno::Reference< beans::XPropertySet > xCellTextProps( xCellCurs, uno::UNO_QUERY ); - xCellTextProps->setPropertyValue( rName, aCellProperties[nProperty].Value ); - } - } - } - } - } - //now that the cell properties are set the vertical merge values have to be applied - if( aMergedCells.size() ) - { - std::vector::iterator aMergedIter = aMergedCells.begin(); - while( aMergedIter != aMergedCells.end()) + for (sal_Int32 nCell = 0; nCell < nCells; ++nCell) { - sal_Int32 nCellCount = (sal_Int32)aMergedIter->aCells.size(); - std::vector >::iterator aCellIter = aMergedIter->aCells.begin(); - bool bFirstCell = true; - //the first of the cells get's the number of cells set as RowSpan - //the others get the inverted number of remaining merged cells (3,-2,-1) - while( aCellIter != aMergedIter->aCells.end() ) - { - (*aCellIter)->setPropertyValue(C2U(SW_PROP_NAME_STR(UNO_NAME_ROW_SPAN)), uno::makeAny( nCellCount )); - if( bFirstCell ) - { - nCellCount *= -1; - bFirstCell = false; - } - ++nCellCount; - ++aCellIter; - } - ++aMergedIter; + lcl_ApplyCellProperties(nCell, + aRowSeparators[nRow], aCurrentRow[nCell], + pTextTable->getCellByPosition(nCell, nRow), + aMergedCells); } } + // now that the cell properties are set the vertical merge values + // have to be applied + lcl_MergeCells(aMergedCells); } catch( const lang::WrappedTargetException& rWrapped ) { @@ -2221,29 +2343,6 @@ throw (lang::IllegalArgumentException, uno::RuntimeException) (void)rBounds; } - - bool bIllegalException = false; - bool bRuntimeException = false; - ::rtl::OUString sMessage; - m_pImpl->m_pDoc->StartUndo(UNDO_START, NULL); - m_pImpl->m_pDoc->EndUndo(UNDO_START, NULL); - if( bIllegalException || bRuntimeException ) - { - SwUndoIter aUndoIter( pFirstPaM.get(), UNDO_EMPTY ); - m_pImpl->m_pDoc->Undo(aUndoIter); - if(bIllegalException) - { - lang::IllegalArgumentException aEx; - aEx.Message = sMessage; - throw aEx; - } - else //if(bRuntimeException) - { - uno::RuntimeException aEx; - aEx.Message = sMessage; - throw aEx; - } - } return xRet; } -- cgit v1.2.3 From 3356582b67bb91d6d438cbf356527a928070d7fa Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:56 +0100 Subject: swunolocking1: #i105557#: fix locking for SwXBodyText: use new XServiceInfo helpers. clean up the implementation a little. --- sw/inc/unotextbodyhf.hxx | 2 +- sw/source/core/unocore/unotext.cxx | 145 ++++++++++++++++++++----------------- 2 files changed, 80 insertions(+), 67 deletions(-) diff --git a/sw/inc/unotextbodyhf.hxx b/sw/inc/unotextbodyhf.hxx index 98656ca68c29..15c38044e4ff 100644 --- a/sw/inc/unotextbodyhf.hxx +++ b/sw/inc/unotextbodyhf.hxx @@ -64,7 +64,7 @@ protected: public: - SwXBodyText(SwDoc* pDoc); + SwXBodyText(SwDoc *const pDoc); SwXTextCursor * CreateTextCursor(const bool bIgnoreTables = false); diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index 987f4e359752..03bdaba7e6c4 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -36,9 +36,11 @@ #include #include +#include + #include #include -#include +#include #include #include @@ -2349,8 +2351,8 @@ throw (lang::IllegalArgumentException, uno::RuntimeException) /****************************************************************** * SwXBodyText ******************************************************************/ -SwXBodyText::SwXBodyText(SwDoc* _pDoc) : - SwXText(_pDoc, CURSOR_BODY) +SwXBodyText::SwXBodyText(SwDoc *const pDoc) + : SwXText(pDoc, CURSOR_BODY) { } @@ -2364,82 +2366,81 @@ SwXBodyText::~SwXBodyText() /* -----------------------------06.04.00 16:33-------------------------------- ---------------------------------------------------------------------------*/ -OUString SwXBodyText::getImplementationName(void) throw( uno::RuntimeException ) +OUString SAL_CALL +SwXBodyText::getImplementationName() throw (uno::RuntimeException) { return C2U("SwXBodyText"); } /* -----------------------------06.04.00 16:33-------------------------------- ---------------------------------------------------------------------------*/ -BOOL SwXBodyText::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) +static char const*const g_ServicesBodyText[] = { - return C2U("com.sun.star.text.Text") == rServiceName; + "com.sun.star.text.Text", +}; +static const size_t g_nServicesBodyText( + sizeof(g_ServicesBodyText)/sizeof(g_ServicesBodyText[0])); + +sal_Bool SAL_CALL SwXBodyText::supportsService(const OUString& rServiceName) +throw (uno::RuntimeException) +{ + return ::sw::SupportsServiceImpl( + g_nServicesBodyText, g_ServicesBodyText, rServiceName); } -/* -----------------------------06.04.00 16:33-------------------------------- - ---------------------------------------------------------------------------*/ -uno::Sequence< OUString > SwXBodyText::getSupportedServiceNames(void) throw( uno::RuntimeException ) +uno::Sequence< OUString > SAL_CALL +SwXBodyText::getSupportedServiceNames() throw (uno::RuntimeException) { - uno::Sequence< OUString > aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = C2U("com.sun.star.text.Text"); - return aRet; + return ::sw::GetSupportedServiceNamesImpl( + g_nServicesBodyText, g_ServicesBodyText); } + /*-- 10.12.98 11:17:27--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Any SwXBodyText::queryAggregation( - const uno::Type& rType ) - throw(uno::RuntimeException) +uno::Any SAL_CALL +SwXBodyText::queryAggregation(const uno::Type& rType) +throw (uno::RuntimeException) { uno::Any aRet; - const uno::Type& rXEnumerationAccessType = ::getCppuType((uno::Reference< container::XEnumerationAccess >*)0); - const uno::Type& rXElementAccessType = ::getCppuType((uno::Reference< container::XElementAccess >*)0); - const uno::Type& rXServiceInfoType = ::getCppuType((uno::Reference< lang::XServiceInfo >*)0); - - if(rType == rXEnumerationAccessType) + if (rType == container::XEnumerationAccess::static_type()) { - uno::Reference xRet = this; - aRet.setValue(&xRet, rXEnumerationAccessType); + aRet <<= uno::Reference< container::XEnumerationAccess >(this); } - else if(rType == rXElementAccessType) + else if (rType == container::XElementAccess::static_type()) { - uno::Reference xRet = this; - aRet.setValue(&xRet, rXElementAccessType); + aRet <<= uno::Reference< container::XElementAccess >(this); } - else if(rType == rXServiceInfoType) + else if (rType == lang::XServiceInfo::static_type()) { - uno::Reference xRet = this; - aRet.setValue(&xRet, rXServiceInfoType); + aRet <<= uno::Reference< lang::XServiceInfo >(this); } else { aRet = SwXText::queryInterface( rType ); } if(aRet.getValueType() == ::getCppuVoidType()) + { aRet = OWeakAggObject::queryAggregation( rType ); + } return aRet; } /*-- 10.12.98 11:17:28--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Sequence< uno::Type > SwXBodyText::getTypes( ) throw(uno::RuntimeException) +uno::Sequence< uno::Type > SAL_CALL +SwXBodyText::getTypes() throw (uno::RuntimeException) { - uno::Sequence< uno::Type > aTypes = SwXBodyText_Base::getTypes(); - uno::Sequence< uno::Type > aTextTypes = SwXText::getTypes(); - long nIndex = aTypes.getLength(); - aTypes.realloc(aTypes.getLength() + aTextTypes.getLength()); - uno::Type* pTypes = aTypes.getArray(); - const uno::Type* pTextTypes = aTextTypes.getConstArray(); - for(int i = 0; i < aTextTypes.getLength(); i++) - pTypes[nIndex++] = pTextTypes[i]; - return aTypes; + const uno::Sequence< uno::Type > aTypes = SwXBodyText_Base::getTypes(); + const uno::Sequence< uno::Type > aTextTypes = SwXText::getTypes(); + return ::comphelper::concatSequences(aTypes, aTextTypes); } /* -----------------------------21.03.00 15:39-------------------------------- ---------------------------------------------------------------------------*/ -uno::Sequence< sal_Int8 > SwXBodyText::getImplementationId( ) throw(uno::RuntimeException) +uno::Sequence< sal_Int8 > SAL_CALL +SwXBodyText::getImplementationId() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); static uno::Sequence< sal_Int8 > aId( 16 ); @@ -2497,7 +2498,8 @@ SwXTextCursor * SwXBodyText::CreateTextCursor(const bool bIgnoreTables) /*-- 10.12.98 11:17:29--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Reference< text::XTextCursor > SwXBodyText::createTextCursor(void) throw( uno::RuntimeException ) +uno::Reference< text::XTextCursor > SAL_CALL +SwXBodyText::createTextCursor() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -2514,19 +2516,23 @@ uno::Reference< text::XTextCursor > SwXBodyText::createTextCursor(void) throw( /*-- 10.12.98 11:17:29--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Reference< text::XTextCursor > SwXBodyText::createTextCursorByRange( - const uno::Reference< text::XTextRange > & aTextPosition) throw( uno::RuntimeException ) +uno::Reference< text::XTextCursor > SAL_CALL +SwXBodyText::createTextCursorByRange( + const uno::Reference< text::XTextRange > & xTextPosition) +throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - uno::Reference< text::XTextCursor > aRef; + if(!IsValid()) { uno::RuntimeException aRuntime; aRuntime.Message = C2U(cInvalidObject); throw aRuntime; } + + uno::Reference< text::XTextCursor > aRef; SwUnoInternalPaM aPam(*GetDoc()); - if (::sw::XTextRangeToSwPaM(aPam, aTextPosition)) + if (::sw::XTextRangeToSwPaM(aPam, xTextPosition)) { SwNode& rNode = GetDoc()->GetNodes().GetEndOfContent(); @@ -2536,7 +2542,7 @@ uno::Reference< text::XTextCursor > SwXBodyText::createTextCursorByRange( { p1 = p1->StartOfSectionNode(); } - SwStartNode* p2 = rNode.StartOfSectionNode(); + SwStartNode *const p2 = rNode.StartOfSectionNode(); if(p1 == p2) { @@ -2546,57 +2552,64 @@ uno::Reference< text::XTextCursor > SwXBodyText::createTextCursorByRange( } } if(!aRef.is()) + { throw uno::RuntimeException(); + } return aRef; } + /*-- 10.12.98 11:17:30--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Reference< container::XEnumeration > SwXBodyText::createEnumeration(void) - throw( uno::RuntimeException ) +uno::Reference< container::XEnumeration > SAL_CALL +SwXBodyText::createEnumeration() +throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - uno::Reference< container::XEnumeration > aRef; - if(IsValid()) - { - SwNode& rNode = GetDoc()->GetNodes().GetEndOfContent(); - SwPosition aPos(rNode); - ::std::auto_ptr pUnoCursor( - GetDoc()->CreateUnoCrsr(aPos, sal_False)); - pUnoCursor->Move(fnMoveBackward, fnGoDoc); - aRef = new SwXParagraphEnumeration(this, pUnoCursor, CURSOR_BODY); - } - else + + if (!IsValid()) { uno::RuntimeException aRuntime; aRuntime.Message = C2U(cInvalidObject); throw aRuntime; } - return aRef; + SwNode& rNode = GetDoc()->GetNodes().GetEndOfContent(); + SwPosition aPos(rNode); + ::std::auto_ptr pUnoCursor( + GetDoc()->CreateUnoCrsr(aPos, sal_False)); + pUnoCursor->Move(fnMoveBackward, fnGoDoc); + const uno::Reference< container::XEnumeration > xRet + = new SwXParagraphEnumeration(this, pUnoCursor, CURSOR_BODY); + return xRet; } + /* -----------------18.12.98 13:36------------------- * * --------------------------------------------------*/ -uno::Type SwXBodyText::getElementType(void) throw( uno::RuntimeException ) +uno::Type SAL_CALL +SwXBodyText::getElementType() throw (uno::RuntimeException) { - return ::getCppuType((uno::Reference*)0); + return text::XTextRange::static_type(); } /* -----------------18.12.98 13:36------------------- * * --------------------------------------------------*/ -sal_Bool SwXBodyText::hasElements(void) throw( uno::RuntimeException ) +sal_Bool SAL_CALL +SwXBodyText::hasElements() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - if(IsValid()) - return sal_True; - else + + if (!IsValid()) { uno::RuntimeException aRuntime; aRuntime.Message = C2U(cInvalidObject); throw aRuntime; } + + return sal_True; } + /****************************************************************** * SwXHeadFootText ******************************************************************/ -- cgit v1.2.3 From 069dead98a0b185ff521a31ed26dd81d98a91b7c Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:57 +0100 Subject: swunolocking1: #i105557#: fix locking for SwXHeadFootText: add Impl struct, and use UnoImplPtr to lock destructor. move all implementation details out of header, into Impl struct. replace broken SwClient iteration with a WeakReference in SwFrmFmt. make constructor protected, and add factory function CreateXHeadFootText. use new XUnoTunnel and XServiceInfo helpers. clean up the implementation a little. --- sw/inc/unotextbodyhf.hxx | 18 +- sw/source/core/layout/atrfrm.cxx | 3 +- sw/source/core/unocore/unoobj2.cxx | 13 +- sw/source/core/unocore/unostyle.cxx | 53 +++--- sw/source/core/unocore/unotext.cxx | 331 +++++++++++++++++++++--------------- 5 files changed, 242 insertions(+), 176 deletions(-) diff --git a/sw/inc/unotextbodyhf.hxx b/sw/inc/unotextbodyhf.hxx index 15c38044e4ff..8fd4e8c2a442 100644 --- a/sw/inc/unotextbodyhf.hxx +++ b/sw/inc/unotextbodyhf.hxx @@ -38,8 +38,6 @@ #include -#include -#include #include @@ -136,13 +134,12 @@ typedef ::cppu::WeakImplHelper2 class SwXHeadFootText : public SwXHeadFootText_Base , public SwXText - , public SwClient { private: - SwFrmFmt* GetFmt() const { return (SwFrmFmt*)GetRegisteredIn(); } - BOOL bIsHeader; + class Impl; + ::sw::UnoImplPtr m_pImpl; protected: @@ -154,14 +151,13 @@ protected: virtual ~SwXHeadFootText(); -public: - - SwXHeadFootText(SwFrmFmt& rHeadFootFmt, BOOL bHeader); + SwXHeadFootText(SwFrmFmt & rHeadFootFmt, const bool bIsHeader); - TYPEINFO(); +public: - // SwClient - virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + static ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > + CreateXHeadFootText(SwFrmFmt & rHeadFootFmt, const bool bIsHeader); + static bool IsXHeadFootText(SwClient *const pClient); // XInterface virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index 061826e764f0..9ed5687b075a 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -198,7 +198,8 @@ void DelHFFormat( SwClient *pToRemove, SwFrmFmt *pFmt ) SwClient *pLast = aIter.GoStart(); if( pLast ) do { - bDel = pLast->IsA( TYPE(SwFrm) )|| pLast->IsA(TYPE(SwXHeadFootText)); + bDel = pLast->IsA( TYPE(SwFrm) ) + || SwXHeadFootText::IsXHeadFootText(pLast); } while( bDel && 0 != ( pLast = aIter++ )); } diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index 857638d872dc..918ab49d45f0 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -1317,17 +1317,10 @@ CreateParentXText(SwDoc & rDoc, const SwPosition& rPos) pHeadFootFmt); } - if(pHeadFootFmt) + if (pHeadFootFmt) { - SwXHeadFootText* pxHdFt = (SwXHeadFootText*)SwClientIter( *pHeadFootFmt ). - First( TYPE( SwXHeadFootText )); - xParentText = pxHdFt; - if(!pxHdFt) - { - xParentText = - new SwXHeadFootText(*pHeadFootFmt, bHeader); - } - break; + xParentText = SwXHeadFootText::CreateXHeadFootText( + *pHeadFootFmt, bHeader); } } } diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index 1866613e8ab0..940c454b7401 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -3436,6 +3436,29 @@ void SwXPageStyle::setPropertyValues( /* -----------------------------04.11.03 13:50-------------------------------- ---------------------------------------------------------------------------*/ +static uno::Reference +lcl_makeHeaderFooter( + const sal_uInt16 nRes, const bool bHeader, SwFrmFmt const*const pFrmFmt) +{ + if (!pFrmFmt) { return 0; } + + const SfxItemSet& rSet = pFrmFmt->GetAttrSet(); + const SfxPoolItem* pItem; + if (SFX_ITEM_SET == rSet.GetItemState(nRes, sal_True, &pItem)) + { + SwFrmFmt *const pHeadFootFmt = (bHeader) + ? static_cast(const_cast(pItem))-> + GetHeaderFmt() + : static_cast(const_cast(pItem))-> + GetFooterFmt(); + if (pHeadFootFmt) + { + return SwXHeadFootText::CreateXHeadFootText(*pHeadFootFmt, bHeader); + } + } + return 0; +} + uno::Sequence< uno::Any > SAL_CALL SwXPageStyle::GetPropertyValues_Impl( const uno::Sequence< OUString >& rPropertyNames ) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) @@ -3468,7 +3491,8 @@ uno::Sequence< uno::Any > SAL_CALL SwXPageStyle::GetPropertyValues_Impl( GetBasePool()->SetSearchMask(GetFamily(), nSaveMask ); } sal_uInt16 nRes = 0; - sal_Bool bHeader = sal_False, bAll = sal_False, bLeft = sal_False, bRight = sal_False; + bool bHeader = false; + sal_Bool bAll = sal_False, bLeft = sal_False, bRight = sal_False; switch(pEntry->nWID) { case FN_UNO_HEADER_ON: @@ -3574,7 +3598,7 @@ uno::Sequence< uno::Any > SAL_CALL SwXPageStyle::GetPropertyValues_Impl( case FN_UNO_HEADER_RIGHT : bRight = sal_True; goto Header; Header: - bHeader = sal_True; + bHeader = true; nRes = RES_HEADER; goto MakeObject; case FN_UNO_FOOTER : bAll = sal_True; goto Footer; @@ -3595,27 +3619,18 @@ MakeObject: // TextRight does the same as Text and is for // comptability only. if( bLeft && !bShare ) + { pFrmFmt = &rDesc.GetLeft(); + } else + { pFrmFmt = &rDesc.GetMaster(); - if(pFrmFmt) + } + const uno::Reference< text::XText > xRet = + lcl_makeHeaderFooter(nRes, bHeader, pFrmFmt); + if (xRet.is()) { - const SfxItemSet& rSet = pFrmFmt->GetAttrSet(); - const SfxPoolItem* pItem; - SwFrmFmt* pHeadFootFmt; - if(SFX_ITEM_SET == rSet.GetItemState(nRes, sal_True, &pItem) && - 0 != (pHeadFootFmt = bHeader ? - ((SwFmtHeader*)pItem)->GetHeaderFmt() : - ((SwFmtFooter*)pItem)->GetFooterFmt())) - { - // gibt es schon ein Objekt dafuer? - SwXHeadFootText* pxHdFt = (SwXHeadFootText*)SwClientIter( *pHeadFootFmt ). - First( TYPE( SwXHeadFootText )); - uno::Reference< text::XText > xRet = pxHdFt; - if(!pxHdFt) - xRet = new SwXHeadFootText(*pHeadFootFmt, bHeader); - pRet[nProp].setValue(&xRet, ::getCppuType((uno::Reference*)0)); - } + pRet[nProp] <<= xRet; } } break; diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index 03bdaba7e6c4..4fb2a861be21 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -2613,60 +2613,136 @@ SwXBodyText::hasElements() throw (uno::RuntimeException) /****************************************************************** * SwXHeadFootText ******************************************************************/ -TYPEINIT1(SwXHeadFootText, SwClient); -/* -----------------------------06.04.00 16:40-------------------------------- - ---------------------------------------------------------------------------*/ -OUString SwXHeadFootText::getImplementationName(void) throw( uno::RuntimeException ) +class SwXHeadFootText::Impl + : public SwClient { - return C2U("SwXHeadFootText"); + +public: + + bool m_bIsHeader; + + Impl( SwXHeadFootText & /*rThis*/, + SwFrmFmt & rHeadFootFmt, const bool bIsHeader) + : SwClient(& rHeadFootFmt) + , m_bIsHeader(bIsHeader) + { + } + + SwFrmFmt * GetHeadFootFmt() const { + return static_cast( + const_cast(GetRegisteredIn())); + } + + SwFrmFmt & GetHeadFootFmtOrThrow() { + SwFrmFmt *const pFmt( GetHeadFootFmt() ); + if (!pFmt) { + throw uno::RuntimeException(OUString(RTL_CONSTASCII_USTRINGPARAM( + "SwXHeadFootText: disposed or invalid")), 0); + } + return *pFmt; + } + + // SwClient + virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + +}; + +/*-- 11.12.98 10:14:51--------------------------------------------------- + + -----------------------------------------------------------------------*/ +void SwXHeadFootText::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew) +{ + ClientModify(this, pOld, pNew); } -/* -----------------------------06.04.00 16:40-------------------------------- - ---------------------------------------------------------------------------*/ -BOOL SwXHeadFootText::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) +bool SwXHeadFootText::IsXHeadFootText(SwClient *const pClient) { - return C2U("com.sun.star.text.Text") == rServiceName; + return 0 != dynamic_cast(pClient); } -/* -----------------------------06.04.00 16:40-------------------------------- - ---------------------------------------------------------------------------*/ -uno::Sequence< OUString > SwXHeadFootText::getSupportedServiceNames(void) throw( uno::RuntimeException ) +uno::Reference< text::XText > +SwXHeadFootText::CreateXHeadFootText( + SwFrmFmt & rHeadFootFmt, const bool bIsHeader) { - uno::Sequence< OUString > aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = C2U("com.sun.star.text.Text"); - return aRet; + // re-use existing SwXHeadFootText + // #i105557#: do not iterate over the registered clients: race condition + uno::Reference< text::XText > xText(rHeadFootFmt.GetXObject(), + uno::UNO_QUERY); + if (!xText.is()) + { + SwXHeadFootText *const pXHFT( + new SwXHeadFootText(rHeadFootFmt, bIsHeader)); + xText.set(pXHFT); + rHeadFootFmt.SetXObject(xText); + } + return xText; } + /*-- 11.12.98 10:14:48--------------------------------------------------- -----------------------------------------------------------------------*/ -SwXHeadFootText::SwXHeadFootText(SwFrmFmt& rHeadFootFmt, BOOL bHeader) : - SwXText(rHeadFootFmt.GetDoc(), bHeader ? CURSOR_HEADER : CURSOR_FOOTER), - SwClient(&rHeadFootFmt), - bIsHeader(bHeader) +SwXHeadFootText::SwXHeadFootText(SwFrmFmt & rHeadFootFmt, const bool bIsHeader) + : SwXText(rHeadFootFmt.GetDoc(), + (bIsHeader) ? CURSOR_HEADER : CURSOR_FOOTER) + , m_pImpl( new SwXHeadFootText::Impl(*this, rHeadFootFmt, bIsHeader) ) { - } + /*-- 11.12.98 10:14:48--------------------------------------------------- -----------------------------------------------------------------------*/ SwXHeadFootText::~SwXHeadFootText() { +} + +/* -----------------------------06.04.00 16:40-------------------------------- + + ---------------------------------------------------------------------------*/ +OUString SAL_CALL +SwXHeadFootText::getImplementationName() throw (uno::RuntimeException) +{ + return C2U("SwXHeadFootText"); +} + +/* -----------------------------06.04.00 16:40-------------------------------- + + ---------------------------------------------------------------------------*/ +static char const*const g_ServicesHeadFootText[] = +{ + "com.sun.star.text.Text", +}; +static const size_t g_nServicesHeadFootText( + sizeof(g_ServicesHeadFootText)/sizeof(g_ServicesHeadFootText[0])); + +sal_Bool SAL_CALL SwXHeadFootText::supportsService(const OUString& rServiceName) +throw (uno::RuntimeException) +{ + return ::sw::SupportsServiceImpl( + g_nServicesHeadFootText, g_ServicesHeadFootText, rServiceName); +} +uno::Sequence< OUString > SAL_CALL +SwXHeadFootText::getSupportedServiceNames() throw (uno::RuntimeException) +{ + return ::sw::GetSupportedServiceNamesImpl( + g_nServicesHeadFootText, g_ServicesHeadFootText); } + /*-- 11.12.98 10:14:49--------------------------------------------------- -----------------------------------------------------------------------*/ const SwStartNode *SwXHeadFootText::GetStartNode() const { const SwStartNode *pSttNd = 0; - SwFrmFmt* pHeadFootFmt = GetFmt(); + SwFrmFmt *const pHeadFootFmt = m_pImpl->GetHeadFootFmt(); if(pHeadFootFmt) { const SwFmtCntnt& rFlyCntnt = pHeadFootFmt->GetCntnt(); if( rFlyCntnt.GetCntntIdx() ) + { pSttNd = rFlyCntnt.GetCntntIdx()->GetNode().GetStartNode(); + } } return pSttNd; } @@ -2679,28 +2755,19 @@ SwXHeadFootText::CreateCursor() throw (uno::RuntimeException) /* -----------------------------21.03.00 15:39-------------------------------- ---------------------------------------------------------------------------*/ -uno::Sequence< uno::Type > SwXHeadFootText::getTypes( ) throw(uno::RuntimeException) +uno::Sequence< uno::Type > SAL_CALL +SwXHeadFootText::getTypes() throw (uno::RuntimeException) { - uno::Sequence< uno::Type > aHFTypes = SwXHeadFootText_Base::getTypes(); - uno::Sequence< uno::Type > aTextTypes = SwXText::getTypes(); - - long nIndex = aHFTypes.getLength(); - aHFTypes.realloc( - aHFTypes.getLength() + - aTextTypes.getLength()); - - uno::Type* pHFTypes = aHFTypes.getArray(); - const uno::Type* pTextTypes = aTextTypes.getConstArray(); - for(long nPos = 0; nPos < aTextTypes.getLength(); nPos++) - pHFTypes[nIndex++] = pTextTypes[nPos]; - - return aHFTypes; + const uno::Sequence< uno::Type > aTypes = SwXHeadFootText_Base::getTypes(); + const uno::Sequence< uno::Type > aTextTypes = SwXText::getTypes(); + return ::comphelper::concatSequences(aTypes, aTextTypes); } /* -----------------------------21.03.00 15:39-------------------------------- ---------------------------------------------------------------------------*/ -uno::Sequence< sal_Int8 > SwXHeadFootText::getImplementationId( ) throw(uno::RuntimeException) +uno::Sequence< sal_Int8 > SAL_CALL +SwXHeadFootText::getImplementationId() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); static uno::Sequence< sal_Int8 > aId( 16 ); @@ -2715,7 +2782,8 @@ uno::Sequence< sal_Int8 > SwXHeadFootText::getImplementationId( ) throw(uno::Ru /* -----------------------------21.03.00 15:46-------------------------------- ---------------------------------------------------------------------------*/ -uno::Any SwXHeadFootText::queryInterface(const uno::Type& rType) +uno::Any SAL_CALL +SwXHeadFootText::queryInterface(const uno::Type& rType) throw (uno::RuntimeException) { const uno::Any ret = SwXHeadFootText_Base::queryInterface(rType); @@ -2727,135 +2795,128 @@ throw (uno::RuntimeException) /*-- 11.12.98 10:14:50--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Reference< text::XTextCursor > SwXHeadFootText::createTextCursor(void) throw( uno::RuntimeException ) +uno::Reference< text::XTextCursor > SAL_CALL +SwXHeadFootText::createTextCursor() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - uno::Reference< text::XTextCursor > xRet; - SwFrmFmt* pHeadFootFmt = GetFmt(); - if(pHeadFootFmt) - { - const SwFmtCntnt& rFlyCntnt = pHeadFootFmt->GetCntnt(); - const SwNode& rNode = rFlyCntnt.GetCntntIdx()->GetNode(); - SwPosition aPos(rNode); - SwXTextCursor *const pXCursor = new SwXTextCursor(*GetDoc(), this, - (bIsHeader) ? CURSOR_HEADER : CURSOR_FOOTER, aPos); - SwUnoCrsr *const pUnoCrsr = pXCursor->GetCursor(); - pUnoCrsr->Move(fnMoveForward, fnGoNode); - - //save current start node to be able to check if there is content after the table - - //otherwise the cursor would be in the body text! - - const SwStartNode* pOwnStartNode = rNode.FindSttNodeByType( - bIsHeader ? SwHeaderStartNode : SwFooterStartNode); - //steht hier eine Tabelle? - SwTableNode* pTblNode = pUnoCrsr->GetNode()->FindTableNode(); - SwCntntNode* pCont = 0; - while( pTblNode ) - { - pUnoCrsr->GetPoint()->nNode = *pTblNode->EndOfSectionNode(); - pCont = GetDoc()->GetNodes().GoNext(&pUnoCrsr->GetPoint()->nNode); - pTblNode = pCont->FindTableNode(); - } - if(pCont) - pUnoCrsr->GetPoint()->nContent.Assign(pCont, 0); - const SwStartNode* pNewStartNode = pUnoCrsr->GetNode()->FindSttNodeByType( - bIsHeader ? SwHeaderStartNode : SwFooterStartNode); - if(!pNewStartNode || pNewStartNode != pOwnStartNode) - { - uno::RuntimeException aExcept; - aExcept.Message = S2U("no text available"); - throw aExcept; - } - xRet = static_cast(pXCursor); - } - else - { - uno::RuntimeException aRuntime; - aRuntime.Message = C2U(cInvalidObject); - throw aRuntime; + + SwFrmFmt & rHeadFootFmt( m_pImpl->GetHeadFootFmtOrThrow() ); + + uno::Reference< text::XTextCursor > xRet; + const SwFmtCntnt& rFlyCntnt = rHeadFootFmt.GetCntnt(); + const SwNode& rNode = rFlyCntnt.GetCntntIdx()->GetNode(); + SwPosition aPos(rNode); + SwXTextCursor *const pXCursor = new SwXTextCursor(*GetDoc(), this, + (m_pImpl->m_bIsHeader) ? CURSOR_HEADER : CURSOR_FOOTER, aPos); + SwUnoCrsr *const pUnoCrsr = pXCursor->GetCursor(); + pUnoCrsr->Move(fnMoveForward, fnGoNode); + + // save current start node to be able to check if there is content + // after the table - otherwise the cursor would be in the body text! + SwStartNode const*const pOwnStartNode = rNode.FindSttNodeByType( + (m_pImpl->m_bIsHeader) ? SwHeaderStartNode : SwFooterStartNode); + // is there a table here? + SwTableNode* pTblNode = pUnoCrsr->GetNode()->FindTableNode(); + SwCntntNode* pCont = 0; + while (pTblNode) + { + pUnoCrsr->GetPoint()->nNode = *pTblNode->EndOfSectionNode(); + pCont = GetDoc()->GetNodes().GoNext(&pUnoCrsr->GetPoint()->nNode); + pTblNode = pCont->FindTableNode(); + } + if (pCont) + { + pUnoCrsr->GetPoint()->nContent.Assign(pCont, 0); + } + SwStartNode const*const pNewStartNode = + pUnoCrsr->GetNode()->FindSttNodeByType( + (m_pImpl->m_bIsHeader) ? SwHeaderStartNode : SwFooterStartNode); + if (!pNewStartNode || (pNewStartNode != pOwnStartNode)) + { + uno::RuntimeException aExcept; + aExcept.Message = S2U("no text available"); + throw aExcept; } + xRet = static_cast(pXCursor); return xRet; } + /*-- 11.12.98 10:14:50--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Reference< text::XTextCursor > SwXHeadFootText::createTextCursorByRange( - const uno::Reference< text::XTextRange > & aTextPosition) throw( uno::RuntimeException ) +uno::Reference< text::XTextCursor > SAL_CALL +SwXHeadFootText::createTextCursorByRange( + const uno::Reference< text::XTextRange > & xTextPosition) +throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - uno::Reference< text::XTextCursor > xRet; - SwFrmFmt* pHeadFootFmt = GetFmt(); + + SwFrmFmt & rHeadFootFmt( m_pImpl->GetHeadFootFmtOrThrow() ); + SwUnoInternalPaM aPam(*GetDoc()); - if (pHeadFootFmt && ::sw::XTextRangeToSwPaM(aPam, aTextPosition)) + if (!::sw::XTextRangeToSwPaM(aPam, xTextPosition)) { - SwNode& rNode = pHeadFootFmt->GetCntnt().GetCntntIdx()->GetNode(); - SwPosition aPos(rNode); - SwPaM aHFPam(aPos); - aHFPam.Move(fnMoveForward, fnGoNode); - SwStartNode* pOwnStartNode = aHFPam.GetNode()->FindSttNodeByType( - bIsHeader ? SwHeaderStartNode : SwFooterStartNode); - SwStartNode* p1 = aPam.GetNode()->FindSttNodeByType( - bIsHeader ? SwHeaderStartNode : SwFooterStartNode); - if(p1 == pOwnStartNode) - { - xRet = static_cast( - new SwXTextCursor(*GetDoc(), this, - (bIsHeader) ? CURSOR_HEADER : CURSOR_FOOTER, - *aPam.GetPoint(), aPam.GetMark())); - } + uno::RuntimeException aRuntime; + aRuntime.Message = C2U(cInvalidObject); + throw aRuntime; + } + + uno::Reference< text::XTextCursor > xRet; + SwNode& rNode = rHeadFootFmt.GetCntnt().GetCntntIdx()->GetNode(); + SwPosition aPos(rNode); + SwPaM aHFPam(aPos); + aHFPam.Move(fnMoveForward, fnGoNode); + SwStartNode *const pOwnStartNode = aHFPam.GetNode()->FindSttNodeByType( + (m_pImpl->m_bIsHeader) ? SwHeaderStartNode : SwFooterStartNode); + SwStartNode *const p1 = aPam.GetNode()->FindSttNodeByType( + (m_pImpl->m_bIsHeader) ? SwHeaderStartNode : SwFooterStartNode); + if (p1 == pOwnStartNode) + { + xRet = static_cast( + new SwXTextCursor(*GetDoc(), this, + (m_pImpl->m_bIsHeader) ? CURSOR_HEADER : CURSOR_FOOTER, + *aPam.GetPoint(), aPam.GetMark())); } return xRet; } + /* -----------------19.03.99 15:44------------------- * * --------------------------------------------------*/ -uno::Reference< container::XEnumeration > SwXHeadFootText::createEnumeration(void) - throw( uno::RuntimeException ) +uno::Reference< container::XEnumeration > SAL_CALL +SwXHeadFootText::createEnumeration() +throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); + + SwFrmFmt & rHeadFootFmt( m_pImpl->GetHeadFootFmtOrThrow() ); + uno::Reference< container::XEnumeration > aRef; - //wenn this ungueltig ist, dann kommt die uno::Exception aus createTextCursor() - SwFrmFmt* pHeadFootFmt = GetFmt(); - if(pHeadFootFmt) - { - const SwFmtCntnt& rFlyCntnt = pHeadFootFmt->GetCntnt(); - const SwNode& rNode = rFlyCntnt.GetCntntIdx()->GetNode(); - SwPosition aPos(rNode); - ::std::auto_ptr pUnoCursor( - GetDoc()->CreateUnoCrsr(aPos, sal_False)); - pUnoCursor->Move(fnMoveForward, fnGoNode); - aRef = new SwXParagraphEnumeration(this, pUnoCursor, - (bIsHeader) ? CURSOR_HEADER : CURSOR_FOOTER); - } - else - { - uno::RuntimeException aRuntime; - aRuntime.Message = C2U(cInvalidObject); - throw aRuntime; - } + const SwFmtCntnt& rFlyCntnt = rHeadFootFmt.GetCntnt(); + const SwNode& rNode = rFlyCntnt.GetCntntIdx()->GetNode(); + SwPosition aPos(rNode); + ::std::auto_ptr pUnoCursor( + GetDoc()->CreateUnoCrsr(aPos, sal_False)); + pUnoCursor->Move(fnMoveForward, fnGoNode); + aRef = new SwXParagraphEnumeration(this, pUnoCursor, + (m_pImpl->m_bIsHeader) ? CURSOR_HEADER : CURSOR_FOOTER); return aRef; } + /* -----------------19.03.99 15:50------------------- * * --------------------------------------------------*/ -uno::Type SwXHeadFootText::getElementType(void) throw( uno::RuntimeException ) +uno::Type SAL_CALL +SwXHeadFootText::getElementType() throw (uno::RuntimeException) { - return ::getCppuType((uno::Reference*)0); + return text::XTextRange::static_type(); } /* -----------------19.03.99 15:50------------------- * * --------------------------------------------------*/ -sal_Bool SwXHeadFootText::hasElements(void) throw( uno::RuntimeException ) +sal_Bool SAL_CALL SwXHeadFootText::hasElements() throw (uno::RuntimeException) { return sal_True; } -/*-- 11.12.98 10:14:51--------------------------------------------------- - - -----------------------------------------------------------------------*/ -void SwXHeadFootText::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) -{ - ClientModify( this, pOld, pNew); -} - -- cgit v1.2.3 From 1f70baf3d1eaf363f0fb6281c7877a6ea783a667 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:58 +0100 Subject: swunolocking1: #i105557#: fix locking for SwXFootnote: add Impl struct, and use UnoImplPtr to lock destructor. move all implementation details out of header, into Impl struct. disable broken SwClient iteration. make constructor protected, and add factory function CreateXFootnote. use new XUnoTunnel and XServiceInfo helpers. clean up the implementation a little. --- sw/inc/unofootnote.hxx | 37 +- sw/source/core/unocore/unoclbck.cxx | 15 +- sw/source/core/unocore/unocoll.cxx | 11 +- sw/source/core/unocore/unocrsrhelper.cxx | 5 +- sw/source/core/unocore/unoftn.cxx | 743 ++++++++++++++++++------------- sw/source/core/unocore/unoobj2.cxx | 8 +- 6 files changed, 461 insertions(+), 358 deletions(-) diff --git a/sw/inc/unofootnote.hxx b/sw/inc/unofootnote.hxx index 8710f7effa03..8d9a65d963ae 100644 --- a/sw/inc/unofootnote.hxx +++ b/sw/inc/unofootnote.hxx @@ -41,14 +41,11 @@ #include -#include - -#include -#include #include class SwDoc; +class SwModify; class SwFmtFtn; @@ -66,18 +63,15 @@ typedef ::cppu::WeakImplHelper5 class SwXFootnote : public SwXFootnote_Base , public SwXText - , public SwClient { private: friend class SwXFootnotes; - SwEventListenerContainer aLstnrCntnr; - const SwFmtFtn* pFmtFtn; - BOOL m_bIsDescriptor; - String m_sLabel; - BOOL m_bIsEndnote; + class Impl; + ::sw::UnoImplPtr m_pImpl; + protected: @@ -90,24 +84,17 @@ protected: virtual ~SwXFootnote(); -public: - - SwXFootnote(BOOL bEndnote); - SwXFootnote(SwDoc* pDoc, const SwFmtFtn& rFmt); - - void attachToRange( - const ::com::sun::star::uno::Reference< - ::com::sun::star::text::XTextRange > & xTextRange) - throw (::com::sun::star::lang::IllegalArgumentException, - ::com::sun::star::uno::RuntimeException); + SwXFootnote(SwDoc & rDoc, const SwFmtFtn & rFmt); - const SwFmtFtn* FindFmt() const { return GetDoc() ? pFmtFtn : 0; } - void Invalidate(); +public: - TYPEINFO(); + SwXFootnote(const bool bEndnote); - // SwClient - virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + static SwXFootnote * + CreateXFootnote(SwDoc & rDoc, SwFmtFtn const& rFootnoteFmt); + /// may return 0 + static SwXFootnote * + GetXFootnote(SwModify const& rUnoCB, SwFmtFtn const& rFootnoteFmt); // XInterface virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( diff --git a/sw/source/core/unocore/unoclbck.cxx b/sw/source/core/unocore/unoclbck.cxx index 1d2185b381fb..6cc9cc0ee910 100644 --- a/sw/source/core/unocore/unoclbck.cxx +++ b/sw/source/core/unocore/unoclbck.cxx @@ -72,20 +72,7 @@ SwXReferenceMark* SwUnoCallBack::GetRefMark(const SwFmtRefMark& rMark) ---------------------------------------------------------------------------*/ SwXFootnote* SwUnoCallBack::GetFootnote(const SwFmtFtn& rMark) { - SwClientIter aIter( *this ); - SwXFootnote* pxFootnote = (SwXFootnote*)aIter.First( TYPE( SwXFootnote )); - while(pxFootnote) - { - SwDoc* pDoc = pxFootnote->GetDoc(); - if(pDoc) - { - const SwFmtFtn* pFtn = pxFootnote->FindFmt(); - if(pFtn == &rMark) - return pxFootnote; - } - pxFootnote = (SwXFootnote*)aIter.Next( ); - } - return 0; + return SwXFootnote::GetXFootnote(*this, rMark); } /* -----------------------------27.11.00 17:15-------------------------------- diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx index 079ba1fa0b95..57f9b05a9c01 100644 --- a/sw/source/core/unocore/unocoll.cxx +++ b/sw/source/core/unocore/unocoll.cxx @@ -1727,8 +1727,8 @@ uno::Any SwXFootnotes::getByIndex(sal_Int32 nIndex) if(nCount == nIndex) { - xRef = new SwXFootnote(GetDoc(), rFtn); - aRet.setValue(&xRef, ::getCppuType((uno::Reference*)0)); + xRef = SwXFootnote::CreateXFootnote(*GetDoc(), rFtn); + aRet <<= xRef; break; } nCount++; @@ -1762,12 +1762,7 @@ sal_Bool SwXFootnotes::hasElements(void) throw( uno::RuntimeException ) ---------------------------------------------------------------------------*/ Reference SwXFootnotes::GetObject( SwDoc& rDoc, const SwFmtFtn& rFmt ) { - Reference xContent = ((SwUnoCallBack*)rDoc.GetUnoCallBack())-> - GetFootnote(rFmt); - if(!xContent.is()) - xContent = new SwXFootnote(&rDoc, rFmt); - Reference xRet(xContent, UNO_QUERY); - return xRet; + return SwXFootnote::CreateXFootnote(rDoc, rFmt); } /****************************************************************** diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index 4d179f133446..29318ce49986 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -445,8 +445,9 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry { if( pAny ) { - uno::Reference< XFootnote > xFoot = new SwXFootnote(rPam.GetDoc(), rFtn); - pAny->setValue(&xFoot, ::getCppuType((uno::Reference*)0)); + const uno::Reference< text::XFootnote > xFootnote = + SwXFootnote::CreateXFootnote(*rPam.GetDoc(), rFtn); + *pAny <<= xFootnote; } } else diff --git a/sw/source/core/unocore/unoftn.cxx b/sw/source/core/unocore/unoftn.cxx index 3d3937f56524..777ebb3e114f 100644 --- a/sw/source/core/unocore/unoftn.cxx +++ b/sw/source/core/unocore/unoftn.cxx @@ -31,9 +31,11 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" +#include + #include #include -#include +#include #include #include @@ -42,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -55,118 +58,233 @@ using namespace ::com::sun::star; using ::rtl::OUString; /****************************************************************** - * + * SwXFootnote ******************************************************************/ -/* -----------------------------13.03.00 12:15-------------------------------- - ---------------------------------------------------------------------------*/ -const uno::Sequence< sal_Int8 > & SwXFootnote::getUnoTunnelId() +class SwXFootnote::Impl + : public SwClient { - static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId(); - return aSeq; -} -/* -----------------------------10.03.00 18:04-------------------------------- - ---------------------------------------------------------------------------*/ -sal_Int64 SAL_CALL SwXFootnote::getSomething( const uno::Sequence< sal_Int8 >& rId ) - throw(uno::RuntimeException) -{ - if( rId.getLength() == 16 - && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), - rId.getConstArray(), 16 ) ) +public: + + SwXFootnote & m_rThis; + const bool m_bIsEndnote; + SwEventListenerContainer m_ListenerContainer; + bool m_bIsDescriptor; + const SwFmtFtn * m_pFmtFtn; + ::rtl::OUString m_sLabel; + + Impl( SwXFootnote & rThis, + SwDoc *const pDoc, SwFmtFtn const*const pFootnote, + const bool bIsEndnote) + : SwClient((pDoc) ? pDoc->GetUnoCallBack() : 0) + , m_rThis(rThis) + , m_bIsEndnote(bIsEndnote) + , m_ListenerContainer(static_cast< ::cppu::OWeakObject* >(&rThis)) + , m_bIsDescriptor(0 == pFootnote) + , m_pFmtFtn(pFootnote) { - return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(this) ); } - return SwXText::getSomething( rId ); -} -/* -----------------------------06.04.00 16:36-------------------------------- + + const SwFmtFtn* GetFootnoteFormat() const { + return m_rThis.GetDoc() ? m_pFmtFtn : 0; + } + + SwFmtFtn const& GetFootnoteFormatOrThrow() { + SwFmtFtn const*const pFootnote( GetFootnoteFormat() ); + if (!pFootnote) { + throw uno::RuntimeException(OUString(RTL_CONSTASCII_USTRINGPARAM( + "SwXFootnote: disposed or invalid")), 0); + } + return *pFootnote; + } + + void Invalidate(); + + // SwClient + virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + +}; + +/* -----------------------------07.01.00 12:39-------------------------------- ---------------------------------------------------------------------------*/ -OUString SwXFootnote::getImplementationName(void) throw( uno::RuntimeException ) +void SwXFootnote::Impl::Invalidate() { - return C2U("SwXFootnote"); + if (GetRegisteredIn()) + { + const_cast(GetRegisteredIn())->Remove(this); + } + m_ListenerContainer.Disposing(); + m_pFmtFtn = 0; + m_rThis.SetDoc(0); } -/* -----------------------------06.04.00 16:36-------------------------------- - ---------------------------------------------------------------------------*/ -BOOL SwXFootnote::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) +/* -----------------18.01.99 09:12------------------- + * + * --------------------------------------------------*/ +void SwXFootnote::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew) { - return !rServiceName.compareToAscii("com.sun.star.text.Footnote") || - !rServiceName.compareToAscii("com.sun.star.text.TextContent") || - !rServiceName.compareToAscii("com.sun.star.text.Text") || - (m_bIsEndnote && !rServiceName.compareToAscii("com.sun.star.text.Endnote")); -; -} -/* -----------------------------06.04.00 16:36-------------------------------- + ClientModify(this, pOld, pNew); - ---------------------------------------------------------------------------*/ -uno::Sequence< OUString > SwXFootnote::getSupportedServiceNames(void) throw( uno::RuntimeException ) -{ - uno::Sequence< OUString > aRet(m_bIsEndnote ? 4 : 3); - OUString* pArray = aRet.getArray(); - pArray[0] = C2U("com.sun.star.text.Footnote"); - pArray[1] = C2U("com.sun.star.text.TextContent"); - pArray[2] = C2U("com.sun.star.text.Text"); - if(m_bIsEndnote) - pArray[3] = C2U("com.sun.star.text.Endnote"); - return aRet; + if (!GetRegisteredIn()) // removed => dispose + { + Invalidate(); + } + else if (pOld) + { + switch (pOld->Which()) + { + case RES_FOOTNOTE_DELETED: + if (static_cast(m_pFmtFtn) == + static_cast(pOld)->pObject) + { + Invalidate(); + } + break; + } + } } + /*-- 10.12.98 15:31:44--------------------------------------------------- -----------------------------------------------------------------------*/ -TYPEINIT1(SwXFootnote, SwClient); - -SwXFootnote::SwXFootnote(sal_Bool bEndnote) : - SwXText(0, CURSOR_FOOTNOTE), - aLstnrCntnr( (text::XTextContent*)this), - pFmtFtn(0), - m_bIsDescriptor(sal_True), - m_bIsEndnote(bEndnote) +SwXFootnote::SwXFootnote(const bool bEndnote) + : SwXText(0, CURSOR_FOOTNOTE) + , m_pImpl( new SwXFootnote::Impl(*this, 0, 0, bEndnote) ) { - } /*-- 10.12.98 15:31:45--------------------------------------------------- -----------------------------------------------------------------------*/ -SwXFootnote::SwXFootnote(SwDoc* _pDoc, const SwFmtFtn& rFmt) : - SwXText(_pDoc, CURSOR_FOOTNOTE), - aLstnrCntnr( (text::XTextContent*)this), - pFmtFtn(&rFmt), - m_bIsDescriptor(sal_False), - m_bIsEndnote(rFmt.IsEndNote()) +SwXFootnote::SwXFootnote(SwDoc & rDoc, const SwFmtFtn& rFmt) + : SwXText(& rDoc, CURSOR_FOOTNOTE) + , m_pImpl( new SwXFootnote::Impl(*this, &rDoc, &rFmt, rFmt.IsEndNote()) ) { - GetDoc()->GetUnoCallBack()->Add(this); } /*-- 10.12.98 15:31:45--------------------------------------------------- -----------------------------------------------------------------------*/ SwXFootnote::~SwXFootnote() { +} + +SwXFootnote * +SwXFootnote::GetXFootnote( + SwModify const& /*rUnoCB*/, SwFmtFtn const& /*rFootnoteFmt*/) +{ + // re-use existing SwXFootnote + // #i105557#: do not iterate over the registered clients: race condition + // to do this properly requires the SwXFootnote to register at the + // SwFmtFtn directly, not at the unocallback + // also this function must return a uno Reference! +#if 0 + SwClientIter aIter( rUnoCB ); + SwXFootnote::Impl * pXFootnote = static_cast( + aIter.First( TYPE( SwXFootnote::Impl ))); + while (pXFootnote) + { + SwDoc *const pDoc = pXFootnote->m_rThis.GetDoc(); + if (pDoc) + { + SwFmtFtn const*const pFtn = pXFootnote->GetFootnoteFormat(); + if (pFtn == &rFootnoteFmt) + { + return & pXFootnote->m_rThis; + } + } + pXFootnote = static_cast(aIter.Next()); + } +#endif + return 0; +} + +SwXFootnote * +SwXFootnote::CreateXFootnote(SwDoc & rDoc, SwFmtFtn const& rFootnoteFmt) +{ + SwXFootnote *const pXFootnote( + GetXFootnote(*rDoc.GetUnoCallBack(), rFootnoteFmt)); + return (pXFootnote) + ? pXFootnote + : new SwXFootnote(rDoc, rFootnoteFmt); +} +/* -----------------------------13.03.00 12:15-------------------------------- + + ---------------------------------------------------------------------------*/ +const uno::Sequence< sal_Int8 > & SwXFootnote::getUnoTunnelId() +{ + static uno::Sequence< sal_Int8 > aSeq = ::CreateUnoTunnelId(); + return aSeq; } -/* -----------------------------21.03.00 15:39-------------------------------- +/* -----------------------------10.03.00 18:04-------------------------------- + + ---------------------------------------------------------------------------*/ +sal_Int64 SAL_CALL +SwXFootnote::getSomething(const uno::Sequence< sal_Int8 >& rId) +throw (uno::RuntimeException) +{ + const sal_Int64 nRet( ::sw::UnoTunnelImpl(rId, this) ); + return (nRet) ? nRet : SwXText::getSomething(rId); +} + +/* -----------------------------06.04.00 16:36-------------------------------- + + ---------------------------------------------------------------------------*/ +OUString SAL_CALL +SwXFootnote::getImplementationName() throw (uno::RuntimeException) +{ + return C2U("SwXFootnote"); +} + +/* -----------------------------06.04.00 16:36-------------------------------- ---------------------------------------------------------------------------*/ -uno::Sequence< uno::Type > SAL_CALL SwXFootnote::getTypes( ) throw(uno::RuntimeException) +static char const*const g_ServicesFootnote[] = +{ + "com.sun.star.text.TextContent", + "com.sun.star.text.Footnote", + "com.sun.star.text.Text", + "com.sun.star.text.Endnote", // NB: only supported for endnotes! +}; +static const size_t g_nServicesEndnote( + sizeof(g_ServicesFootnote)/sizeof(g_ServicesFootnote[0])); +static const size_t g_nServicesFootnote( g_nServicesEndnote - 1 ); // NB: omit! + +sal_Bool SAL_CALL SwXFootnote::supportsService(const OUString& rServiceName) +throw (uno::RuntimeException) { - uno::Sequence< uno::Type > aFtnTypes = SwXFootnote_Base::getTypes(); - uno::Sequence< uno::Type > aTextTypes = SwXText::getTypes(); + vos::OGuard g(Application::GetSolarMutex()); + return ::sw::SupportsServiceImpl( + (m_pImpl->m_bIsEndnote) ? g_nServicesEndnote : g_nServicesFootnote, + g_ServicesFootnote, rServiceName); +} - long nIndex = aFtnTypes.getLength(); - aFtnTypes.realloc( aFtnTypes.getLength() + aTextTypes.getLength()); +uno::Sequence< OUString > SAL_CALL +SwXFootnote::getSupportedServiceNames() throw (uno::RuntimeException) +{ + vos::OGuard g(Application::GetSolarMutex()); + return ::sw::GetSupportedServiceNamesImpl( + (m_pImpl->m_bIsEndnote) ? g_nServicesEndnote : g_nServicesFootnote, + g_ServicesFootnote); +} - uno::Type* pFtnTypes = aFtnTypes.getArray(); - const uno::Type* pTextTypes = aTextTypes.getConstArray(); - for(long nPos = 0; nPos < aTextTypes.getLength(); nPos++) - pFtnTypes[nIndex++] = pTextTypes[nPos]; +/* -----------------------------21.03.00 15:39-------------------------------- - return aFtnTypes; + ---------------------------------------------------------------------------*/ +uno::Sequence< uno::Type > SAL_CALL +SwXFootnote::getTypes() throw (uno::RuntimeException) +{ + const uno::Sequence< uno::Type > aTypes = SwXFootnote_Base::getTypes(); + const uno::Sequence< uno::Type > aTextTypes = SwXText::getTypes(); + return ::comphelper::concatSequences(aTypes, aTextTypes); } /* -----------------------------21.03.00 15:39-------------------------------- ---------------------------------------------------------------------------*/ -uno::Sequence< sal_Int8 > SAL_CALL SwXFootnote::getImplementationId( ) throw(uno::RuntimeException) +uno::Sequence< sal_Int8 > SAL_CALL +SwXFootnote::getImplementationId() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); static uno::Sequence< sal_Int8 > aId( 16 ); @@ -181,7 +299,8 @@ uno::Sequence< sal_Int8 > SAL_CALL SwXFootnote::getImplementationId( ) throw(un /* -----------------------------21.03.00 15:46-------------------------------- ---------------------------------------------------------------------------*/ -uno::Any SAL_CALL SwXFootnote::queryInterface(const uno::Type& rType) +uno::Any SAL_CALL +SwXFootnote::queryInterface(const uno::Type& rType) throw (uno::RuntimeException) { const uno::Any ret = SwXFootnote_Base::queryInterface(rType); @@ -193,26 +312,36 @@ throw (uno::RuntimeException) /*-- 10.12.98 15:31:47--------------------------------------------------- -----------------------------------------------------------------------*/ -OUString SwXFootnote::getLabel(void) throw( uno::RuntimeException ) +OUString SAL_CALL SwXFootnote::getLabel() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - String sRet; - const SwFmtFtn* pFmt = SwXFootnote::FindFmt(); + + ::rtl::OUString sRet; + SwFmtFtn const*const pFmt = m_pImpl->GetFootnoteFormat(); if(pFmt) + { sRet = pFmt->GetNumStr(); - else if(m_bIsDescriptor) - return m_sLabel; + } + else if (m_pImpl->m_bIsDescriptor) + { + sRet = m_pImpl->m_sLabel; + } else + { throw uno::RuntimeException(); + } return sRet; } + /*-- 10.12.98 15:31:48--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXFootnote::setLabel(const OUString& aLabel) throw( uno::RuntimeException ) +void SAL_CALL +SwXFootnote::setLabel(const OUString& aLabel) throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - const SwFmtFtn* pFmt = FindFmt(); + + SwFmtFtn const*const pFmt = m_pImpl->GetFootnoteFormat(); if(pFmt) { const SwTxtFtn* pTxtFtn = pFmt->GetTxtFtn(); @@ -222,157 +351,172 @@ void SwXFootnote::setLabel(const OUString& aLabel) throw( uno::RuntimeException SwPaM aPam(rTxtNode, *pTxtFtn->GetStart()); GetDoc()->SetCurFtn(aPam, aLabel, pFmt->GetNumber(), pFmt->IsEndNote()); } - else if(m_bIsDescriptor) - m_sLabel = String(aLabel); + else if (m_pImpl->m_bIsDescriptor) + { + m_pImpl->m_sLabel = String(aLabel); + } else + { throw uno::RuntimeException(); - + } } + /* -----------------18.02.99 13:32------------------- * * --------------------------------------------------*/ -void SwXFootnote::attachToRange(const uno::Reference< text::XTextRange > & xTextRange) - throw( lang::IllegalArgumentException, uno::RuntimeException ) +void SAL_CALL +SwXFootnote::attach(const uno::Reference< text::XTextRange > & xTextRange) +throw (lang::IllegalArgumentException, uno::RuntimeException) { - if(!m_bIsDescriptor) + vos::OGuard aGuard(Application::GetSolarMutex()); + + if (!m_pImpl->m_bIsDescriptor) + { throw uno::RuntimeException(); - uno::Reference xRangeTunnel( xTextRange, uno::UNO_QUERY); - SwXTextRange* pRange = 0; - OTextCursorHelper* pCursor = 0; - if(xRangeTunnel.is()) + } + const uno::Reference xRangeTunnel( + xTextRange, uno::UNO_QUERY); + SwXTextRange *const pRange = + ::sw::UnoTunnelGetImplementation(xRangeTunnel); + OTextCursorHelper *const pCursor = + ::sw::UnoTunnelGetImplementation(xRangeTunnel); + SwDoc *const pNewDoc = + (pRange) ? pRange->GetDoc() : ((pCursor) ? pCursor->GetDoc() : 0); + if (!pNewDoc) + { + throw lang::IllegalArgumentException(); + } + + SwUnoInternalPaM aPam(*pNewDoc); + //das muss jetzt sal_True liefern + ::sw::XTextRangeToSwPaM(aPam, xTextRange); + + UnoActionContext aCont(pNewDoc); + pNewDoc->DeleteAndJoin(aPam); + aPam.DeleteMark(); + SwFmtFtn aFootNote(m_pImpl->m_bIsEndnote); + if (m_pImpl->m_sLabel.getLength()) { - pRange = reinterpret_cast< SwXTextRange * >( - sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( SwXTextRange::getUnoTunnelId()) )); - pCursor = reinterpret_cast< OTextCursorHelper * >( - sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( OTextCursorHelper::getUnoTunnelId()) )); + aFootNote.SetNumStr(m_pImpl->m_sLabel); } - SwDoc* pNewDoc = pRange ? (SwDoc*)pRange->GetDoc() : pCursor ? (SwDoc*)pCursor->GetDoc() : 0; - if(pNewDoc) + + SwXTextCursor const*const pTextCursor( + dynamic_cast(pCursor)); + const bool bForceExpandHints( (pTextCursor) + ? pTextCursor->IsAtEndOfMeta() : false ); + const SetAttrMode nInsertFlags = (bForceExpandHints) + ? nsSetAttrMode::SETATTR_FORCEHINTEXPAND + : nsSetAttrMode::SETATTR_DEFAULT; + + pNewDoc->InsertPoolItem(aPam, aFootNote, nInsertFlags); + + SwTxtFtn *const pTxtAttr = static_cast( + aPam.GetNode()->GetTxtNode()->GetTxtAttrForCharAt( + aPam.GetPoint()->nContent.GetIndex()-1, RES_TXTATR_FTN )); + + if (pTxtAttr) { - SwUnoInternalPaM aPam(*pNewDoc); - //das muss jetzt sal_True liefern - ::sw::XTextRangeToSwPaM(aPam, xTextRange); - - UnoActionContext aCont(pNewDoc); - SwTxtAttr* pTxtAttr = 0; - pNewDoc->DeleteAndJoin(aPam); - aPam.DeleteMark(); - SwFmtFtn aFootNote(m_bIsEndnote); - if(m_sLabel.Len()) - aFootNote.SetNumStr(m_sLabel); - - SwXTextCursor const*const pTextCursor( - dynamic_cast(pCursor)); - const bool bForceExpandHints( (pTextCursor) - ? pTextCursor->IsAtEndOfMeta() : false ); - const SetAttrMode nInsertFlags = (bForceExpandHints) - ? nsSetAttrMode::SETATTR_FORCEHINTEXPAND - : nsSetAttrMode::SETATTR_DEFAULT; - - pNewDoc->InsertPoolItem(aPam, aFootNote, nInsertFlags); - - pTxtAttr = aPam.GetNode()->GetTxtNode()->GetTxtAttrForCharAt( - aPam.GetPoint()->nContent.GetIndex()-1, RES_TXTATR_FTN ); - - if(pTxtAttr) + const SwFmtFtn& rFtn = pTxtAttr->GetFtn(); + m_pImpl->m_pFmtFtn = &rFtn; + pNewDoc->GetUnoCallBack()->Add(m_pImpl.get()); + // force creation of sequence id - is used for references + if (pNewDoc->IsInReading()) + { + pTxtAttr->SetSeqNo(pNewDoc->GetFtnIdxs().Count()); + } + else { - const SwFmtFtn& rFtn = pTxtAttr->GetFtn(); - pFmtFtn = &rFtn; - pNewDoc->GetUnoCallBack()->Add(this); - //force creation of sequence id - is used for references - if(pNewDoc->IsInReading()) - ((SwTxtFtn*)pTxtAttr)->SetSeqNo(pNewDoc->GetFtnIdxs().Count()); - else - ((SwTxtFtn*)pTxtAttr)->SetSeqRefNo(); + pTxtAttr->SetSeqRefNo(); } - m_bIsDescriptor = sal_False; - SetDoc(pNewDoc); } - else - throw lang::IllegalArgumentException(); + m_pImpl->m_bIsDescriptor = sal_False; + SetDoc(pNewDoc); } -/*-- 10.12.98 15:31:48--------------------------------------------------- - -----------------------------------------------------------------------*/ -void SwXFootnote::attach(const uno::Reference< text::XTextRange > & xTextRange) - throw( lang::IllegalArgumentException, uno::RuntimeException ) -{ - vos::OGuard aGuard(Application::GetSolarMutex()); - attachToRange( xTextRange ); -} /*-- 10.12.98 15:31:48--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Reference< text::XTextRange > SwXFootnote::getAnchor(void) throw( uno::RuntimeException ) +uno::Reference< text::XTextRange > SAL_CALL +SwXFootnote::getAnchor() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - uno::Reference< text::XTextRange > aRef; - const SwFmtFtn* pFmt = FindFmt(); - if(pFmt) - { - const SwTxtFtn* pTxtFtn = pFmt->GetTxtFtn(); - SwPaM aPam( pTxtFtn->GetTxtNode(), *pTxtFtn->GetStart() ); - SwPosition aMark( *aPam.Start() ); - aPam.SetMark(); - aPam.GetMark()->nContent++; - aRef = SwXTextRange::CreateXTextRange( - *GetDoc(), *aPam.Start(), aPam.End()); - } - else - throw uno::RuntimeException(); - return aRef; + + SwFmtFtn const& rFmt( m_pImpl->GetFootnoteFormatOrThrow() ); + + SwTxtFtn const*const pTxtFtn = rFmt.GetTxtFtn(); + SwPaM aPam( pTxtFtn->GetTxtNode(), *pTxtFtn->GetStart() ); + SwPosition aMark( *aPam.Start() ); + aPam.SetMark(); + aPam.GetMark()->nContent++; + const uno::Reference< text::XTextRange > xRet = + SwXTextRange::CreateXTextRange(*GetDoc(), *aPam.Start(), aPam.End()); + return xRet; } /*-- 10.12.98 15:31:49--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXFootnote::dispose(void) throw( uno::RuntimeException ) +void SAL_CALL SwXFootnote::dispose() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - const SwFmtFtn* pFmt = FindFmt(); - if(pFmt) - { - const SwTxtFtn* pTxtFtn = pFmt->GetTxtFtn(); - DBG_ASSERT(pTxtFtn, "kein TextNode?"); - SwTxtNode& rTxtNode = (SwTxtNode&)pTxtFtn->GetTxtNode(); - xub_StrLen nPos = *pTxtFtn->GetStart(); - SwPaM aPam(rTxtNode, nPos, rTxtNode, nPos+1 ); - GetDoc()->DeleteAndJoin( aPam ); - } - else - throw uno::RuntimeException(); + SwFmtFtn const& rFmt( m_pImpl->GetFootnoteFormatOrThrow() ); + + SwTxtFtn const*const pTxtFtn = rFmt.GetTxtFtn(); + DBG_ASSERT(pTxtFtn, "no TextNode?"); + SwTxtNode& rTxtNode = const_cast(pTxtFtn->GetTxtNode()); + const xub_StrLen nPos = *pTxtFtn->GetStart(); + SwPaM aPam(rTxtNode, nPos, rTxtNode, nPos+1); + GetDoc()->DeleteAndJoin( aPam ); } + /*-- 10.12.98 15:31:49--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXFootnote::addEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException ) +void SAL_CALL +SwXFootnote::addEventListener( + const uno::Reference< lang::XEventListener > & xListener) +throw (uno::RuntimeException) { - if(!GetRegisteredIn()) + vos::OGuard g(Application::GetSolarMutex()); + + if (!m_pImpl->GetFootnoteFormat()) + { throw uno::RuntimeException(); - aLstnrCntnr.AddListener(aListener); + } + m_pImpl->m_ListenerContainer.AddListener(xListener); } /*-- 10.12.98 15:31:50--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXFootnote::removeEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException ) +void SAL_CALL +SwXFootnote::removeEventListener( + const uno::Reference< lang::XEventListener > & xListener) +throw (uno::RuntimeException) { - if(!GetRegisteredIn() || !aLstnrCntnr.RemoveListener(aListener)) + vos::OGuard g(Application::GetSolarMutex()); + + if (!m_pImpl->GetFootnoteFormat() || + !m_pImpl->m_ListenerContainer.RemoveListener(xListener)) + { throw uno::RuntimeException(); + } } + /* -----------------06.05.99 15:31------------------- * * --------------------------------------------------*/ const SwStartNode *SwXFootnote::GetStartNode() const { - const SwStartNode *pSttNd = 0; - const SwFmtFtn* pFmt = FindFmt(); + SwFmtFtn const*const pFmt = m_pImpl->GetFootnoteFormat(); if(pFmt) { const SwTxtFtn* pTxtFtn = pFmt->GetTxtFtn(); if( pTxtFtn ) - pSttNd = pTxtFtn->GetStartNode()->GetNode().GetStartNode(); + { + return pTxtFtn->GetStartNode()->GetNode().GetStartNode(); + } } - return pSttNd; + return 0; } uno::Reference< text::XTextCursor > @@ -380,144 +524,119 @@ SwXFootnote::CreateCursor() throw (uno::RuntimeException) { return createTextCursor(); } + /*-- 10.12.98 15:31:50--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Reference< text::XTextCursor > SwXFootnote::createTextCursor(void) throw( uno::RuntimeException ) +uno::Reference< text::XTextCursor > SAL_CALL +SwXFootnote::createTextCursor() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - uno::Reference< text::XTextCursor > aRef; - const SwFmtFtn* pFmt = FindFmt(); - if(pFmt) - { - const SwTxtFtn* pTxtFtn = pFmt->GetTxtFtn(); - SwPosition aPos( *pTxtFtn->GetStartNode() ); - SwXTextCursor *const pXCursor = - new SwXTextCursor(*GetDoc(), this, CURSOR_FOOTNOTE, aPos); - aRef = static_cast(pXCursor); - SwUnoCrsr *const pUnoCrsr = pXCursor->GetCursor(); - pUnoCrsr->Move(fnMoveForward, fnGoNode); - } - else - throw uno::RuntimeException(); - return aRef; + + SwFmtFtn const& rFmt( m_pImpl->GetFootnoteFormatOrThrow() ); + + SwTxtFtn const*const pTxtFtn = rFmt.GetTxtFtn(); + SwPosition aPos( *pTxtFtn->GetStartNode() ); + SwXTextCursor *const pXCursor = + new SwXTextCursor(*GetDoc(), this, CURSOR_FOOTNOTE, aPos); + SwUnoCrsr *const pUnoCrsr = pXCursor->GetCursor(); + pUnoCrsr->Move(fnMoveForward, fnGoNode); + const uno::Reference< text::XTextCursor > xRet = + static_cast(pXCursor); + return xRet; } + /*-- 10.12.98 15:31:51--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Reference< text::XTextCursor > SwXFootnote::createTextCursorByRange( - const uno::Reference< text::XTextRange > & aTextPosition) - throw( uno::RuntimeException ) +uno::Reference< text::XTextCursor > SAL_CALL +SwXFootnote::createTextCursorByRange( + const uno::Reference< text::XTextRange > & xTextPosition) +throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - const SwFmtFtn* pFmt = FindFmt(); - if( !pFmt ) - throw uno::RuntimeException(); - uno::Reference< text::XTextCursor > aRef; + + SwFmtFtn const& rFmt( m_pImpl->GetFootnoteFormatOrThrow() ); + SwUnoInternalPaM aPam(*GetDoc()); - if (::sw::XTextRangeToSwPaM(aPam, aTextPosition)) + if (!::sw::XTextRangeToSwPaM(aPam, xTextPosition)) { - const SwTxtFtn* pTxtFtn = pFmt->GetTxtFtn(); - const SwNode* pFtnStartNode = &pTxtFtn->GetStartNode()->GetNode(); + throw uno::RuntimeException(); + } - const SwNode* pStart = aPam.GetNode()->FindFootnoteStartNode(); - if( pStart != pFtnStartNode ) - throw uno::RuntimeException(); + SwTxtFtn const*const pTxtFtn = rFmt.GetTxtFtn(); + SwNode const*const pFtnStartNode = &pTxtFtn->GetStartNode()->GetNode(); - aRef = static_cast( + const SwNode* pStart = aPam.GetNode()->FindFootnoteStartNode(); + if (pStart != pFtnStartNode) + { + throw uno::RuntimeException(); + } + + const uno::Reference< text::XTextCursor > xRet = + static_cast( new SwXTextCursor(*GetDoc(), this, CURSOR_FOOTNOTE, *aPam.GetPoint(), aPam.GetMark())); - } - else - throw uno::RuntimeException(); - return aRef; + return xRet; } + /*-- 13.06.00 14:28:23--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Reference< container::XEnumeration > SwXFootnote::createEnumeration() throw( uno::RuntimeException ) +uno::Reference< container::XEnumeration > SAL_CALL +SwXFootnote::createEnumeration() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - uno::Reference< container::XEnumeration > aRef; - const SwFmtFtn* pFmt = FindFmt(); - if(pFmt) - { - const SwTxtFtn* pTxtFtn = pFmt->GetTxtFtn(); - SwPosition aPos( *pTxtFtn->GetStartNode() ); - ::std::auto_ptr pUnoCursor( - GetDoc()->CreateUnoCrsr(aPos, sal_False)); - pUnoCursor->Move(fnMoveForward, fnGoNode); - aRef = new SwXParagraphEnumeration(this, pUnoCursor, CURSOR_FOOTNOTE); - } - return aRef; + + SwFmtFtn const& rFmt( m_pImpl->GetFootnoteFormatOrThrow() ); + + SwTxtFtn const*const pTxtFtn = rFmt.GetTxtFtn(); + SwPosition aPos( *pTxtFtn->GetStartNode() ); + ::std::auto_ptr pUnoCursor( + GetDoc()->CreateUnoCrsr(aPos, sal_False)); + pUnoCursor->Move(fnMoveForward, fnGoNode); + const uno::Reference< container::XEnumeration > xRet = + new SwXParagraphEnumeration(this, pUnoCursor, CURSOR_FOOTNOTE); + return xRet; } + /*-- 13.06.00 14:28:24--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Type SwXFootnote::getElementType( ) throw(uno::RuntimeException) +uno::Type SAL_CALL SwXFootnote::getElementType() throw (uno::RuntimeException) { - return ::getCppuType(static_cast*>(0)); + return text::XTextRange::static_type(); } /*-- 13.06.00 14:28:24--------------------------------------------------- -----------------------------------------------------------------------*/ -sal_Bool SwXFootnote::hasElements( ) throw(uno::RuntimeException) +sal_Bool SAL_CALL SwXFootnote::hasElements() throw (uno::RuntimeException) { return sal_True; } -/* -----------------------------07.01.00 12:39-------------------------------- - ---------------------------------------------------------------------------*/ -void SwXFootnote::Invalidate() -{ - if(GetRegisteredIn()) - { - ((SwModify*)GetRegisteredIn())->Remove(this); - pFmtFtn = 0; - aLstnrCntnr.Disposing(); - SetDoc(0); - } -} -/* -----------------18.01.99 09:12------------------- - * - * --------------------------------------------------*/ -void SwXFootnote::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) -{ - switch( pOld ? pOld->Which() : 0 ) - { - case RES_REMOVE_UNO_OBJECT: - case RES_OBJECTDYING: - if( (void*)GetRegisteredIn() == ((SwPtrMsgPoolItem *)pOld)->pObject ) - Invalidate(); - break; - case RES_FMT_CHG: - // wurden wir an das neue umgehaengt und wird das alte geloscht? - if( ((SwFmtChg*)pNew)->pChangedFmt == GetRegisteredIn() && - ((SwFmtChg*)pOld)->pChangedFmt->IsFmtInDTOR() ) - Invalidate(); - break; - case RES_FOOTNOTE_DELETED: - if( (void*)pFmtFtn == ((SwPtrMsgPoolItem *)pOld)->pObject ) - Invalidate(); - break; - } -} /*-- 11.09.00 13:12:03--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Reference< beans::XPropertySetInfo > SwXFootnote::getPropertySetInfo( ) - throw(uno::RuntimeException) +uno::Reference< beans::XPropertySetInfo > SAL_CALL +SwXFootnote::getPropertySetInfo() +throw (uno::RuntimeException) { - static uno::Reference< beans::XPropertySetInfo > xRef = aSwMapProvider.GetPropertySet(PROPERTY_MAP_FOOTNOTE)->getPropertySetInfo(); - return xRef; + vos::OGuard g(Application::GetSolarMutex()); + static uno::Reference< beans::XPropertySetInfo > xRet = + aSwMapProvider.GetPropertySet(PROPERTY_MAP_FOOTNOTE) + ->getPropertySetInfo(); + return xRet; } + /*-- 11.09.00 13:12:04--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXFootnote::setPropertyValue( const ::rtl::OUString&, - const uno::Any& ) - throw(beans::UnknownPropertyException, beans::PropertyVetoException, - lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL +SwXFootnote::setPropertyValue(const ::rtl::OUString&, const uno::Any&) +throw (beans::UnknownPropertyException, beans::PropertyVetoException, + lang::IllegalArgumentException, lang::WrappedTargetException, + uno::RuntimeException) { //no values to be set throw lang::IllegalArgumentException(); @@ -525,28 +644,34 @@ void SwXFootnote::setPropertyValue( const ::rtl::OUString&, /*-- 11.09.00 13:12:04--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Any SwXFootnote::getPropertyValue( const OUString& rPropertyName ) - throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) +uno::Any SAL_CALL +SwXFootnote::getPropertyValue(const OUString& rPropertyName) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); + uno::Any aRet; if (! ::sw::GetDefaultTextContentValue(aRet, rPropertyName)) { - if(rPropertyName.equalsAsciiL(SW_PROP_NAME(UNO_NAME_START_REDLINE))|| - rPropertyName.equalsAsciiL(SW_PROP_NAME(UNO_NAME_END_REDLINE))) + if (rPropertyName.equalsAsciiL(SW_PROP_NAME(UNO_NAME_START_REDLINE)) || + rPropertyName.equalsAsciiL(SW_PROP_NAME(UNO_NAME_END_REDLINE))) { //redline can only be returned if it's a living object - if(!m_bIsDescriptor) + if (!m_pImpl->m_bIsDescriptor) + { aRet = SwXText::getPropertyValue(rPropertyName); + } } - else if(rPropertyName.equalsAsciiL( SW_PROP_NAME(UNO_NAME_REFERENCE_ID))) + else if (rPropertyName.equalsAsciiL( + SW_PROP_NAME(UNO_NAME_REFERENCE_ID))) { - const SwFmtFtn* pFmt = FindFmt(); - if(pFmt) + SwFmtFtn const*const pFmt = m_pImpl->GetFootnoteFormat(); + if (pFmt) { - const SwTxtFtn* pTxtFtn = pFmt->GetTxtFtn(); + SwTxtFtn const*const pTxtFtn = pFmt->GetTxtFtn(); DBG_ASSERT(pTxtFtn, "no TextNode?"); - aRet <<= (sal_Int16)pTxtFtn->GetSeqRefNo(); + aRet <<= static_cast(pTxtFtn->GetSeqRefNo()); } } else @@ -558,37 +683,51 @@ uno::Any SwXFootnote::getPropertyValue( const OUString& rPropertyName ) } return aRet; } + /*-- 11.09.00 13:12:04--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXFootnote::addPropertyChangeListener( const OUString& /*aPropertyName*/, - const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/ ) - throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL +SwXFootnote::addPropertyChangeListener( + const ::rtl::OUString& /*rPropertyName*/, + const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { + OSL_ENSURE(false, + "SwXFootnote::addPropertyChangeListener(): not implemented"); } -/*-- 11.09.00 13:12:04--------------------------------------------------- - -----------------------------------------------------------------------*/ -void SwXFootnote::removePropertyChangeListener( const OUString& /*aPropertyName*/, - const uno::Reference< beans::XPropertyChangeListener >& /*aListener*/ ) - throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL +SwXFootnote::removePropertyChangeListener( + const ::rtl::OUString& /*rPropertyName*/, + const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { + OSL_ENSURE(false, + "SwXFootnote::removePropertyChangeListener(): not implemented"); } -/*-- 11.09.00 13:12:04--------------------------------------------------- - -----------------------------------------------------------------------*/ -void SwXFootnote::addVetoableChangeListener( const OUString& /*PropertyName*/, - const uno::Reference< beans::XVetoableChangeListener >& /*aListener*/ ) - throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL +SwXFootnote::addVetoableChangeListener( + const ::rtl::OUString& /*rPropertyName*/, + const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { + OSL_ENSURE(false, + "SwXFootnote::addVetoableChangeListener(): not implemented"); } -/*-- 11.09.00 13:12:05--------------------------------------------------- - -----------------------------------------------------------------------*/ -void SwXFootnote::removeVetoableChangeListener( const OUString& /*PropertyName*/, - const uno::Reference< beans::XVetoableChangeListener >& /*aListener*/ ) - throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL +SwXFootnote::removeVetoableChangeListener( + const ::rtl::OUString& /*rPropertyName*/, + const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { + OSL_ENSURE(false, + "SwXFootnote::removeVetoableChangeListener(): not implemented"); } - diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index 918ab49d45f0..53b0da94b12d 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -1344,13 +1344,7 @@ CreateParentXText(SwDoc & rDoc, const SwPosition& rPos) if (pSttNode == pTxtFtn->GetStartNode()->GetNode(). FindSttNodeByType(SwFootnoteStartNode)) { - xParentText = - static_cast(rDoc.GetUnoCallBack())-> - GetFootnote(rFtn); - if (!xParentText.is()) - { - xParentText = new SwXFootnote(&rDoc, rFtn); - } + xParentText = SwXFootnote::CreateXFootnote(rDoc, rFtn); break; } } -- cgit v1.2.3 From 399fb822ef81bd2440da8ab48cc2028a6b44d5b7 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:58 +0100 Subject: swunolocking1: #i105557#: fix locking for SwXDocumentIndex: add Impl struct, and use UnoImplPtr to lock destructor. move all implementation details out of header, into Impl struct. replace broken SwClient iteration with a WeakReference in SwFrmFmt. make constructor private, and add factory function CreateXDocumentIndex. use new XUnoTunnel helpers. clean up the implementation a little. remove SwXDocumentIndexes::GetObject(). --- sw/inc/unoidx.hxx | 197 ++-- sw/source/core/unocore/unocrsrhelper.cxx | 8 +- sw/source/core/unocore/unoidx.cxx | 1681 +++++++++++++++++------------- sw/source/core/unocore/unosect.cxx | 3 +- 4 files changed, 1082 insertions(+), 807 deletions(-) diff --git a/sw/inc/unoidx.hxx b/sw/inc/unoidx.hxx index ef503926ad1f..f82e2c9984d2 100644 --- a/sw/inc/unoidx.hxx +++ b/sw/inc/unoidx.hxx @@ -53,101 +53,143 @@ class SwTOXType; /* -----------------07.12.98 10:08------------------- * * --------------------------------------------------*/ -class SwDocIdxProperties_Impl; class SwXIndexStyleAccess_Impl; class SwXIndexTokenAccess_Impl; -class SwXDocumentIndex : public cppu::WeakImplHelper5 -< - ::com::sun::star::text::XDocumentIndex, - ::com::sun::star::lang::XServiceInfo, - ::com::sun::star::beans::XPropertySet, - ::com::sun::star::container::XNamed, - ::com::sun::star::lang::XUnoTunnel ->, - public SwClient -{ - friend class SwXIndexStyleAccess_Impl; - friend class SwXIndexTokenAccess_Impl; +typedef ::cppu::WeakImplHelper5 +< ::com::sun::star::lang::XUnoTunnel +, ::com::sun::star::lang::XServiceInfo +, ::com::sun::star::beans::XPropertySet +, ::com::sun::star::container::XNamed +, ::com::sun::star::text::XDocumentIndex +> SwXDocumentIndex_Base; - SwEventListenerContainer aLstnrCntnr; - const SfxItemPropertySet* m_pPropSet; - SwDoc* m_pDoc; - const SwTOXBaseSection* pBase; - TOXTypes eTOXType; +class SwXDocumentIndex + : public SwXDocumentIndex_Base +{ - //Descriptor-Interface - sal_Bool bIsDescriptor; - SwDocIdxProperties_Impl* pProps; +private: - SwXIndexStyleAccess_Impl* pStyleAccess; - SwXIndexTokenAccess_Impl* pTokenAccess; + friend class SwXIndexStyleAccess_Impl; + friend class SwXIndexTokenAccess_Impl; - SwSectionFmt* GetFmt()const {return (SwSectionFmt*)GetRegisteredIn();} + class Impl; + ::sw::UnoImplPtr m_pImpl; - sal_Bool IsDescriptor() const {return bIsDescriptor;} - const SwDocIdxProperties_Impl* GetProperties_Impl() const { return pProps;} - SwDocIdxProperties_Impl* GetProperties_Impl() { return pProps;} - TOXTypes GetTOXType() const {return eTOXType;} + virtual ~SwXDocumentIndex(); - SwXIndexStyleAccess_Impl* GetStyleAccess() const {return pStyleAccess;} - void SetStyleAccess(SwXIndexStyleAccess_Impl* pSet) - {pStyleAccess = pSet;} + SwXDocumentIndex(SwTOXBaseSection const&, SwDoc &); - SwXIndexTokenAccess_Impl* GetTokenAccess() const {return pTokenAccess;} - void SetTokenAccess(SwXIndexTokenAccess_Impl* pSet) - {pTokenAccess = pSet;} -protected: - virtual ~SwXDocumentIndex(); public: - SwXDocumentIndex(const SwTOXBaseSection* = 0, SwDoc* = 0); - //Descriptor-Ctor - SwXDocumentIndex(TOXTypes eToxType, SwDoc& rDoc); + /// descriptor + SwXDocumentIndex(const TOXTypes eToxType, SwDoc& rDoc); - TYPEINFO(); + static ::com::sun::star::uno::Reference< + ::com::sun::star::text::XDocumentIndex> + CreateXDocumentIndex(SwDoc & rDoc, SwTOXBaseSection const& rSection); static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); - //XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); - - //XDocumentIndex - virtual ::rtl::OUString SAL_CALL getServiceName( ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL update( ) throw(::com::sun::star::uno::RuntimeException); + // XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( + const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier) + throw (::com::sun::star::uno::RuntimeException); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( + const ::rtl::OUString& rServiceName) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames() + throw (::com::sun::star::uno::RuntimeException); + + // XComponent + virtual void SAL_CALL dispose() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XEventListener > & xListener) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XEventListener > & xListener) + throw (::com::sun::star::uno::RuntimeException); + + // XPropertySet + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySetInfo > SAL_CALL + getPropertySetInfo() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Any& rValue) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::beans::PropertyVetoException, + ::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( + const ::rtl::OUString& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertyChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertyChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XVetoableChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XVetoableChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + // XNamed + virtual ::rtl::OUString SAL_CALL getName() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setName(const ::rtl::OUString& rName) + throw (::com::sun::star::uno::RuntimeException); + + // XTextContent + virtual void SAL_CALL attach( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > & xTextRange) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > SAL_CALL getAnchor() + throw (::com::sun::star::uno::RuntimeException); + + + // XDocumentIndex + virtual ::rtl::OUString SAL_CALL getServiceName() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL update() + throw (::com::sun::star::uno::RuntimeException); - //XPropertySet - virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - - //XTextContent - virtual void SAL_CALL attach(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getAnchor(void) throw( ::com::sun::star::uno::RuntimeException ); - - //XComponent - virtual void SAL_CALL dispose(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); - - //XNamed - virtual rtl::OUString SAL_CALL getName(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL setName(const rtl::OUString& Name_) throw( ::com::sun::star::uno::RuntimeException ); - - //XServiceInfo - virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); - - //SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); - - void attachToRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange)throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); }; + /* -----------------07.12.98 10:08------------------- * * --------------------------------------------------*/ @@ -274,7 +316,6 @@ public: virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); - static SwXDocumentIndex* GetObject(const SwTOXBaseSection* pTOX); }; /* -----------------13.09.99 16:39------------------- diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index 29318ce49986..df34c675bfa0 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -69,6 +69,7 @@ #include #include #include +#include #include #include #include @@ -331,9 +332,10 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry { if( pAny ) { - uno::Reference< XDocumentIndex > aRef = - SwXDocumentIndexes::GetObject((SwTOXBaseSection*)pBase); - pAny->setValue(&aRef, ::getCppuType((uno::Reference*)0)); + const uno::Reference< text::XDocumentIndex > xRef = + SwXDocumentIndex::CreateXDocumentIndex(*rPam.GetDoc(), + *static_cast(pBase)); + (*pAny) <<= xRef; } } else diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index 8fad219d742e..d860cedd3fb7 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -31,19 +31,19 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" -#include - -#include -#include -#include -#include -#include #include #include #include #include #include #include + +#include +#include +#include +#include + +#include #include #include #include @@ -59,6 +59,7 @@ #include #include #include +#include #include #include #include @@ -74,36 +75,61 @@ using namespace ::com::sun::star; using ::rtl::OUString; //----------------------------------------------------------------------------- -String lcl_AnyToString(uno::Any rVal) throw(lang::IllegalArgumentException) +static String +lcl_AnyToString(uno::Any const& rVal) throw (lang::IllegalArgumentException) { OUString sRet; if(!(rVal >>= sRet)) + { throw lang::IllegalArgumentException(); + } return sRet; } //----------------------------------------------------------------------------- -sal_Int16 lcl_AnyToInt16(uno::Any rVal) throw(lang::IllegalArgumentException) +static sal_Int16 +lcl_AnyToInt16(uno::Any const& rVal) throw (lang::IllegalArgumentException) { sal_Int16 nRet = 0; if(!(rVal >>= nRet)) + { throw lang::IllegalArgumentException(); + } return nRet; } //----------------------------------------------------------------------------- -sal_Bool lcl_AnyToBool(uno::Any rVal) throw(lang::IllegalArgumentException) +static sal_Bool +lcl_AnyToBool(uno::Any const& rVal) throw (lang::IllegalArgumentException) { sal_Bool bRet = sal_False; if(!(rVal >>= bRet)) + { throw lang::IllegalArgumentException(); + } return bRet; } -/****************************************************************************** - * - ******************************************************************************/ + +static void +lcl_AnyToBitMask(uno::Any const& rValue, + sal_uInt16 & rBitMask, const sal_uInt16 nBit) +throw (lang::IllegalArgumentException) +{ + rBitMask = lcl_AnyToBool(rValue) + ? (rBitMask | nBit) + : (rBitMask & ~nBit); +} +static void +lcl_BitMaskToAny(uno::Any & o_rValue, + const sal_uInt16 nBitMask, const sal_uInt16 nBit) +{ + const sal_Bool bRet = 0 != (nBitMask & nBit); + o_rValue <<= bRet; +} + //----------------------------------------------------------------------------- -void lcl_ReAssignTOXType(SwDoc* pDoc, SwTOXBase& rTOXBase, const OUString& rNewName) +static void +lcl_ReAssignTOXType(SwDoc* pDoc, SwTOXBase& rTOXBase, const OUString& rNewName) { - sal_uInt16 nUserCount = pDoc->GetTOXTypeCount( TOX_USER ); + const sal_uInt16 nUserCount = pDoc->GetTOXTypeCount( TOX_USER ); const SwTOXType* pNewType = 0; for(sal_uInt16 nUser = 0; nUser < nUserCount; nUser++) { @@ -133,14 +159,19 @@ void lcl_ConvertTOUNameToProgrammaticName(OUString& rTmp) ShellResource* pShellRes = ViewShell::GetShellRes(); if(rTmp.equals(pShellRes->aTOXUserName)) + { rTmp = OUString(C2U(cUserDefined)); - //if the version is not English but the alternative index's name is "User-Defined" - //a " (user)" is appended + } + // if the version is not English but the alternative index's name is + // "User-Defined" a " (user)" is appended else if(rTmp.equalsAscii(cUserDefined)) + { rTmp += C2U(cUserSuffix); + } } //----------------------------------------------------------------------------- -void lcl_ConvertTOUNameToUserName(OUString& rTmp) +static void +lcl_ConvertTOUNameToUserName(OUString& rTmp) { ShellResource* pShellRes = ViewShell::GetShellRes(); if(rTmp.equalsAscii(cUserDefined)) @@ -150,43 +181,189 @@ void lcl_ConvertTOUNameToUserName(OUString& rTmp) else if(!pShellRes->aTOXUserName.EqualsAscii(cUserDefined) && USER_AND_SUFFIXLEN == rTmp.getLength()) { - String sToChange(rTmp); //make sure that in non-English versions the " (user)" suffix is removed - if(!sToChange.SearchAscii(cUserDefined) && USER_LEN == sToChange.SearchAscii(cUserSuffix)) + if (rTmp.matchAsciiL(cUserDefined, sizeof(cUserDefined)) && + rTmp.matchAsciiL(cUserSuffix, sizeof(cUserSuffix), USER_LEN)) + { rTmp = C2U(cUserDefined); + } } } /****************************************************************** * SwXDocumentIndex ******************************************************************/ + /* -----------------20.06.98 11:06------------------- * * --------------------------------------------------*/ -class SwDocIdxProperties_Impl +class SwDocIndexDescriptorProperties_Impl { - SwTOXBase* pTOXBase; - OUString sUserTOXTypeName; +private: + ::std::auto_ptr m_pTOXBase; + OUString m_sUserTOXTypeName; + public: - SwTOXBase& GetTOXBase() {return *pTOXBase;} - SwDocIdxProperties_Impl(const SwTOXType* pType); - ~SwDocIdxProperties_Impl(){delete pTOXBase;} + SwDocIndexDescriptorProperties_Impl(SwTOXType const*const pType); - const OUString& GetTypeName()const {return sUserTOXTypeName;} - void SetTypeName(const OUString& rSet) {sUserTOXTypeName = rSet;} + SwTOXBase & GetTOXBase() { return *m_pTOXBase; } + const OUString& GetTypeName() const { return m_sUserTOXTypeName; } + void SetTypeName(const OUString& rSet) { m_sUserTOXTypeName = rSet; } }; /* -----------------20.06.98 11:41------------------- * * --------------------------------------------------*/ -SwDocIdxProperties_Impl::SwDocIdxProperties_Impl(const SwTOXType* pType) +SwDocIndexDescriptorProperties_Impl::SwDocIndexDescriptorProperties_Impl( + SwTOXType const*const pType) { SwForm aForm(pType->GetType()); - pTOXBase = new SwTOXBase(pType, aForm, - nsSwTOXElement::TOX_MARK, pType->GetTypeName()); + m_pTOXBase.reset(new SwTOXBase(pType, aForm, + nsSwTOXElement::TOX_MARK, pType->GetTypeName())); if(pType->GetType() == TOX_CONTENT || pType->GetType() == TOX_USER) - pTOXBase->SetLevel(MAXLEVEL); - sUserTOXTypeName = pType->GetTypeName(); + { + m_pTOXBase->SetLevel(MAXLEVEL); + } + m_sUserTOXTypeName = pType->GetTypeName(); +} + +static sal_uInt16 +lcl_TypeToPropertyMap(const TOXTypes eType) +{ + switch (eType) + { + case TOX_INDEX: return PROPERTY_MAP_INDEX_IDX; + case TOX_CONTENT: return PROPERTY_MAP_INDEX_CNTNT; + case TOX_TABLES: return PROPERTY_MAP_INDEX_TABLES; + case TOX_ILLUSTRATIONS: return PROPERTY_MAP_INDEX_ILLUSTRATIONS; + case TOX_OBJECTS: return PROPERTY_MAP_INDEX_OBJECTS; + case TOX_AUTHORITIES: return PROPERTY_MAP_BIBLIOGRAPHY; + //case TOX_USER: + default: + return PROPERTY_MAP_INDEX_USER; + } +} + +class SwXDocumentIndex::Impl + : public SwClient +{ + +public: + + SfxItemPropertySet const& m_rPropSet; + const TOXTypes m_eTOXType; + SwEventListenerContainer m_ListenerContainer; + bool m_bIsDescriptor; + SwDoc * m_pDoc; + ::std::auto_ptr m_pProps; + uno::WeakReference m_wStyleAccess; + uno::WeakReference m_wTokenAccess; + + Impl( SwXDocumentIndex & rThis, + SwDoc & rDoc, + const TOXTypes eType, + SwTOXBaseSection const*const pBaseSection) + : SwClient((pBaseSection) ? pBaseSection->GetFmt() : 0) + , m_rPropSet( + *aSwMapProvider.GetPropertySet(lcl_TypeToPropertyMap(eType))) + , m_eTOXType(eType) + , m_ListenerContainer(static_cast< ::cppu::OWeakObject* >(&rThis)) + , m_bIsDescriptor(0 == pBaseSection) + , m_pDoc(&rDoc) + , m_pProps((m_bIsDescriptor) + ? new SwDocIndexDescriptorProperties_Impl(rDoc.GetTOXType(eType, 0)) + : 0) + { + } + + SwSectionFmt * GetSectionFmt() const { + return static_cast( + const_cast(GetRegisteredIn())); + } + + SwTOXBase & GetTOXSectionOrThrow() const + { + SwSectionFmt *const pSectionFmt(GetSectionFmt()); + SwTOXBase *const pTOXSection( (m_bIsDescriptor) + ? &m_pProps->GetTOXBase() + : ((pSectionFmt) + ? static_cast(pSectionFmt->GetSection()) + : 0)); + if (!pTOXSection) + { + throw uno::RuntimeException(OUString(RTL_CONSTASCII_USTRINGPARAM( + "SwXDocumentIndex: disposed or invalid")), 0); + } + return *pTOXSection; + } + + sal_Int32 GetFormMax() const + { + SwTOXBase & rSection( GetTOXSectionOrThrow() ); + return (m_bIsDescriptor) + ? SwForm::GetFormMaxLevel(m_eTOXType) + : rSection.GetTOXForm().GetFormMax(); + } + + // SwClient + virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + +}; + +/*-- 14.12.98 09:35:07--------------------------------------------------- + + -----------------------------------------------------------------------*/ +void SwXDocumentIndex::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew) +{ + ClientModify(this, pOld, pNew); + + if (!GetRegisteredIn()) + { + m_ListenerContainer.Disposing(); + } +} + +/*-- 14.12.98 09:35:03--------------------------------------------------- + + -----------------------------------------------------------------------*/ +SwXDocumentIndex::SwXDocumentIndex( + SwTOXBaseSection const& rBaseSection, SwDoc & rDoc) + : m_pImpl( new SwXDocumentIndex::Impl( *this, + rDoc, rBaseSection.SwTOXBase::GetType(), & rBaseSection) ) +{ +} +/* -----------------15.01.99 14:59------------------- + * + * --------------------------------------------------*/ +SwXDocumentIndex::SwXDocumentIndex(const TOXTypes eType, SwDoc& rDoc) + : m_pImpl( new SwXDocumentIndex::Impl( *this, rDoc, eType, 0) ) +{ +} + +/*-- 14.12.98 09:35:04--------------------------------------------------- + + -----------------------------------------------------------------------*/ +SwXDocumentIndex::~SwXDocumentIndex() +{ } + +uno::Reference +SwXDocumentIndex::CreateXDocumentIndex( + SwDoc & rDoc, SwTOXBaseSection const& rSection) +{ + // re-use existing SwXDocumentIndex + // #i105557#: do not iterate over the registered clients: race condition + SwSectionFmt *const pFmt = rSection.GetFmt(); + uno::Reference xIndex(pFmt->GetXObject(), + uno::UNO_QUERY); + if (!xIndex.is()) + { + SwXDocumentIndex *const pIndex(new SwXDocumentIndex(rSection, rDoc)); + xIndex.set(pIndex); + pFmt->SetXObject(uno::Reference(xIndex)); + } + return xIndex; +} + /* -----------------------------10.03.00 18:02-------------------------------- ---------------------------------------------------------------------------*/ @@ -198,505 +375,530 @@ const uno::Sequence< sal_Int8 > & SwXDocumentIndex::getUnoTunnelId() /* -----------------------------10.03.00 18:04-------------------------------- ---------------------------------------------------------------------------*/ -sal_Int64 SAL_CALL SwXDocumentIndex::getSomething( const uno::Sequence< sal_Int8 >& rId ) - throw(uno::RuntimeException) +sal_Int64 SAL_CALL +SwXDocumentIndex::getSomething(const uno::Sequence< sal_Int8 >& rId) +throw (uno::RuntimeException) { - if( rId.getLength() == 16 - && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), - rId.getConstArray(), 16 ) ) - { - return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(this) ); - } - return 0; + return ::sw::UnoTunnelImpl(rId, this); } + /* -----------------------------06.04.00 15:01-------------------------------- ---------------------------------------------------------------------------*/ -OUString SwXDocumentIndex::getImplementationName(void) throw( uno::RuntimeException ) +OUString SAL_CALL +SwXDocumentIndex::getImplementationName() throw (uno::RuntimeException) { return C2U("SwXDocumentIndex"); } /* -----------------------------06.04.00 15:01-------------------------------- ---------------------------------------------------------------------------*/ -BOOL SwXDocumentIndex::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) -{ - return C2U("com.sun.star.text.BaseIndex") == rServiceName || - ( TOX_INDEX == eTOXType && C2U("com.sun.star.text.DocumentIndex") == rServiceName) || - ( TOX_CONTENT == eTOXType && C2U("com.sun.star.text.ContentIndex") == rServiceName) || - ( TOX_USER == eTOXType && C2U("com.sun.star.text.UserDefinedIndex") == rServiceName) || - ( TOX_ILLUSTRATIONS == eTOXType && C2U("com.sun.star.text.IllustrationsIndex") == rServiceName) || - ( TOX_TABLES == eTOXType && C2U("com.sun.star.text.TableIndex") == rServiceName) || - ( TOX_OBJECTS == eTOXType && C2U("com.sun.star.text.ObjectIndex") == rServiceName) || - ( TOX_AUTHORITIES == eTOXType && C2U("com.sun.star.text.Bibliography") == rServiceName); +sal_Bool SAL_CALL +SwXDocumentIndex::supportsService(const OUString& rServiceName) +throw (uno::RuntimeException) +{ + vos::OGuard g(Application::GetSolarMutex()); + + return C2U("com.sun.star.text.BaseIndex") == rServiceName + || ((TOX_INDEX == m_pImpl->m_eTOXType) && + rServiceName.equalsAscii("com.sun.star.text.DocumentIndex")) + || ((TOX_CONTENT == m_pImpl->m_eTOXType) && + rServiceName.equalsAscii("com.sun.star.text.ContentIndex")) + || ((TOX_USER == m_pImpl->m_eTOXType) && + rServiceName.equalsAscii("com.sun.star.text.UserDefinedIndex")) + || ((TOX_ILLUSTRATIONS == m_pImpl->m_eTOXType) && + rServiceName.equalsAscii("com.sun.star.text.IllustrationsIndex")) + || ((TOX_TABLES == m_pImpl->m_eTOXType) && + rServiceName.equalsAscii("com.sun.star.text.TableIndex")) + || ((TOX_OBJECTS == m_pImpl->m_eTOXType) && + rServiceName.equalsAscii("com.sun.star.text.ObjectIndex")) + || ((TOX_AUTHORITIES == m_pImpl->m_eTOXType) && + rServiceName.equalsAscii("com.sun.star.text.Bibliography")); } /* -----------------------------06.04.00 15:01-------------------------------- ---------------------------------------------------------------------------*/ -uno::Sequence< OUString > SwXDocumentIndex::getSupportedServiceNames(void) throw( uno::RuntimeException ) +uno::Sequence< OUString > SAL_CALL +SwXDocumentIndex::getSupportedServiceNames() throw (uno::RuntimeException) { + vos::OGuard g(Application::GetSolarMutex()); + uno::Sequence< OUString > aRet(2); OUString* pArray = aRet.getArray(); pArray[0] = C2U("com.sun.star.text.BaseIndex"); - switch( eTOXType ) - { - case TOX_INDEX: pArray[1] = C2U("com.sun.star.text.DocumentIndex");break; - case TOX_CONTENT: pArray[1] = C2U("com.sun.star.text.ContentIndex");break; - case TOX_TABLES: pArray[1] = C2U("com.sun.star.text.TableIndex");break; - case TOX_ILLUSTRATIONS: pArray[1] = C2U("com.sun.star.text.IllustrationsIndex");break; - case TOX_OBJECTS: pArray[1] = C2U("com.sun.star.text.ObjectIndex");break; - case TOX_AUTHORITIES : pArray[1] = C2U("com.sun.star.text.Bibliography");break; + switch (m_pImpl->m_eTOXType) + { + case TOX_INDEX: + pArray[1] = C2U("com.sun.star.text.DocumentIndex"); + break; + case TOX_CONTENT: + pArray[1] = C2U("com.sun.star.text.ContentIndex"); + break; + case TOX_TABLES: + pArray[1] = C2U("com.sun.star.text.TableIndex"); + break; + case TOX_ILLUSTRATIONS: + pArray[1] = C2U("com.sun.star.text.IllustrationsIndex"); + break; + case TOX_OBJECTS: + pArray[1] = C2U("com.sun.star.text.ObjectIndex"); + break; + case TOX_AUTHORITIES: + pArray[1] = C2U("com.sun.star.text.Bibliography"); + break; //case TOX_USER: default: pArray[1] = C2U("com.sun.star.text.UserDefinedIndex"); } return aRet; } -/*-- 14.12.98 09:35:03--------------------------------------------------- - - -----------------------------------------------------------------------*/ -TYPEINIT1(SwXDocumentIndex, SwClient) -SwXDocumentIndex::SwXDocumentIndex(const SwTOXBaseSection* pB, SwDoc* pDc) : - aLstnrCntnr( (text::XTextContent*)this), - m_pPropSet(0), - m_pDoc(pDc), - pBase(pB), - eTOXType(TOX_USER), - bIsDescriptor(sal_False), - pProps(0), - pStyleAccess(0), - pTokenAccess(0) -{ - if(pBase && m_pDoc) - { - pBase->GetFmt()->Add(this); - sal_uInt16 PropertyId; - eTOXType = pBase->SwTOXBase::GetType(); - switch( eTOXType ) - { - case TOX_INDEX: PropertyId = PROPERTY_MAP_INDEX_IDX; break; - case TOX_CONTENT: PropertyId = PROPERTY_MAP_INDEX_CNTNT; break; - case TOX_TABLES: PropertyId = PROPERTY_MAP_INDEX_TABLES; break; - case TOX_ILLUSTRATIONS: PropertyId = PROPERTY_MAP_INDEX_ILLUSTRATIONS; break; - case TOX_OBJECTS: PropertyId = PROPERTY_MAP_INDEX_OBJECTS; break; - case TOX_AUTHORITIES : PropertyId = PROPERTY_MAP_BIBLIOGRAPHY; break; - //case TOX_USER: - default: - PropertyId = PROPERTY_MAP_INDEX_USER; - } - m_pPropSet = aSwMapProvider.GetPropertySet(PropertyId); - } -} -/* -----------------15.01.99 14:59------------------- - * - * --------------------------------------------------*/ -SwXDocumentIndex::SwXDocumentIndex(TOXTypes eType, SwDoc& rDoc) : - aLstnrCntnr( (text::XTextContent*)this), - m_pDoc(0), - pBase(0), - eTOXType(eType), - bIsDescriptor(sal_True), - pProps(new SwDocIdxProperties_Impl(rDoc.GetTOXType(eType, 0))), - pStyleAccess(0), - pTokenAccess(0) -{ - sal_uInt16 PropertyId; - switch(eType) - { - case TOX_INDEX: PropertyId = PROPERTY_MAP_INDEX_IDX; break; - case TOX_CONTENT: PropertyId = PROPERTY_MAP_INDEX_CNTNT; break; - case TOX_TABLES: PropertyId = PROPERTY_MAP_INDEX_TABLES; break; - case TOX_ILLUSTRATIONS: PropertyId = PROPERTY_MAP_INDEX_ILLUSTRATIONS; break; - case TOX_OBJECTS: PropertyId = PROPERTY_MAP_INDEX_OBJECTS; break; - case TOX_AUTHORITIES : PropertyId = PROPERTY_MAP_BIBLIOGRAPHY; break; - //case TOX_USER: - default: - PropertyId = PROPERTY_MAP_INDEX_USER; - } - m_pPropSet = aSwMapProvider.GetPropertySet(PropertyId); -} - -/*-- 14.12.98 09:35:04--------------------------------------------------- - -----------------------------------------------------------------------*/ -SwXDocumentIndex::~SwXDocumentIndex() -{ - delete pProps; -} /*-- 14.12.98 09:35:05--------------------------------------------------- -----------------------------------------------------------------------*/ -OUString SwXDocumentIndex::getServiceName(void) throw( uno::RuntimeException ) +OUString SAL_CALL SwXDocumentIndex::getServiceName() +throw (uno::RuntimeException) { + vos::OGuard g(Application::GetSolarMutex()); + USHORT nObjectType = SW_SERVICE_TYPE_INDEX; - switch(eTOXType) + switch (m_pImpl->m_eTOXType) { // case TOX_INDEX: break; - case TOX_USER: nObjectType = SW_SERVICE_USER_INDEX;break; - case TOX_CONTENT: nObjectType = SW_SERVICE_CONTENT_INDEX;break; - case TOX_ILLUSTRATIONS: nObjectType = SW_SERVICE_INDEX_ILLUSTRATIONS;break; - case TOX_OBJECTS: nObjectType = SW_SERVICE_INDEX_OBJECTS;break; - case TOX_TABLES: nObjectType = SW_SERVICE_INDEX_TABLES;break; - case TOX_AUTHORITIES: nObjectType = SW_SERVICE_INDEX_BIBLIOGRAPHY;break; + case TOX_USER: nObjectType = SW_SERVICE_USER_INDEX; + break; + case TOX_CONTENT: nObjectType = SW_SERVICE_CONTENT_INDEX; + break; + case TOX_ILLUSTRATIONS: nObjectType = SW_SERVICE_INDEX_ILLUSTRATIONS; + break; + case TOX_OBJECTS: nObjectType = SW_SERVICE_INDEX_OBJECTS; + break; + case TOX_TABLES: nObjectType = SW_SERVICE_INDEX_TABLES; + break; + case TOX_AUTHORITIES: nObjectType = SW_SERVICE_INDEX_BIBLIOGRAPHY; + break; default: - ; + break; } return SwXServiceProvider::GetProviderName(nObjectType); } + /*-- 14.12.98 09:35:05--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXDocumentIndex::update(void) throw( uno::RuntimeException ) +void SAL_CALL SwXDocumentIndex::update() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - SwSectionFmt *pFmt = GetFmt(); - SwTOXBase* pTOXBase = pFmt ? (SwTOXBaseSection*)pFmt->GetSection() : 0; + + SwSectionFmt *const pFmt = m_pImpl->GetSectionFmt(); + SwTOXBaseSection *const pTOXBase = (pFmt) ? + static_cast(pFmt->GetSection()) : 0; if(!pTOXBase) + { throw uno::RuntimeException(); - ((SwTOXBaseSection*)pTOXBase)->Update(); - // Seitennummern eintragen - ((SwTOXBaseSection*)pTOXBase)->UpdatePageNum(); + } + pTOXBase->Update(); + // page numbers + pTOXBase->UpdatePageNum(); } + /*-- 14.12.98 09:35:05--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Reference< beans::XPropertySetInfo > SwXDocumentIndex::getPropertySetInfo(void) throw( uno::RuntimeException ) +uno::Reference< beans::XPropertySetInfo > SAL_CALL +SwXDocumentIndex::getPropertySetInfo() throw (uno::RuntimeException) { - uno::Reference< beans::XPropertySetInfo > aRef = m_pPropSet->getPropertySetInfo(); - return aRef; + vos::OGuard g(Application::GetSolarMutex()); + + const uno::Reference< beans::XPropertySetInfo > xRef = + m_pImpl->m_rPropSet.getPropertySetInfo(); + return xRef; } + /*-- 14.12.98 09:35:05--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXDocumentIndex::setPropertyValue(const OUString& rPropertyName, - const uno::Any& aValue) - throw( beans::UnknownPropertyException, beans::PropertyVetoException, - lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL +SwXDocumentIndex::setPropertyValue( + const OUString& rPropertyName, const uno::Any& rValue) +throw (beans::UnknownPropertyException, beans::PropertyVetoException, + lang::IllegalArgumentException, lang::WrappedTargetException, + uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName(rPropertyName); + + SfxItemPropertySimpleEntry const*const pEntry = + m_pImpl->m_rPropSet.getPropertyMap()->getByName(rPropertyName); if (!pEntry) - throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); - if ( pEntry->nFlags & beans::PropertyAttribute::READONLY) - throw beans::PropertyVetoException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); + { + throw beans::UnknownPropertyException( + OUString(RTL_CONSTASCII_USTRINGPARAM("Unknown property: ")) + + rPropertyName, + static_cast(this)); + } + if (pEntry->nFlags & beans::PropertyAttribute::READONLY) + { + throw beans::PropertyVetoException( + OUString(RTL_CONSTASCII_USTRINGPARAM("Property is read-only: " )) + + rPropertyName, + static_cast(this)); + } - SwTOXBase* pTOXBase = 0; - if(GetFmt()) - pTOXBase = (SwTOXBaseSection*)GetFmt()->GetSection(); - else if(bIsDescriptor) - pTOXBase = &pProps->GetTOXBase(); - if(pTOXBase) + SwSectionFmt *const pSectionFmt(m_pImpl->GetSectionFmt()); + SwTOXBase & rTOXBase( m_pImpl->GetTOXSectionOrThrow() ); + + sal_uInt16 nCreate = rTOXBase.GetCreateType(); + sal_uInt16 nTOIOptions = 0; + sal_uInt16 nOLEOptions = rTOXBase.GetOLEOptions(); + const TOXTypes eTxBaseType = rTOXBase.GetTOXType()->GetType(); + if (eTxBaseType == TOX_INDEX) { - sal_uInt16 nCreate = pTOXBase->GetCreateType(); - sal_uInt16 nTOIOptions = 0; - sal_uInt16 nOLEOptions = pTOXBase->GetOLEOptions(); - TOXTypes eTxBaseType = pTOXBase->GetTOXType()->GetType(); - if( eTxBaseType == TOX_INDEX ) - nTOIOptions = pTOXBase->GetOptions(); - SwForm aForm(pTOXBase->GetTOXForm()); - sal_Bool bForm = sal_False; - SfxItemSet* pAttrSet = 0; - switch(pEntry->nWID) + nTOIOptions = rTOXBase.GetOptions(); + } + SwForm aForm(rTOXBase.GetTOXForm()); + sal_Bool bForm = sal_False; + switch (pEntry->nWID) + { + case WID_IDX_TITLE: { - case WID_IDX_TITLE : - { - OUString sNewName; - aValue >>= sNewName; - pTOXBase->SetTitle(sNewName); - } - break; - case WID_IDX_NAME: - { - OUString sNewName; - aValue >>= sNewName; - pTOXBase->SetTOXName(sNewName); - } - break; - case WID_USER_IDX_NAME: + OUString sNewName; + if (!(rValue >>= sNewName)) { - OUString sNewName; - aValue >>= sNewName; - lcl_ConvertTOUNameToUserName(sNewName); - DBG_ASSERT(TOX_USER == eTxBaseType, "tox type name can only be changed for user indexes"); - if(GetFmt()) - { - OUString sTmp = pTOXBase->GetTOXType()->GetTypeName(); - if(sTmp != sNewName) - { - lcl_ReAssignTOXType(GetFmt()->GetDoc(), *pTOXBase, sNewName); - } - } - else - pProps->SetTypeName(sNewName); + throw lang::IllegalArgumentException(); } - break; - case WID_IDX_LOCALE: + rTOXBase.SetTitle(sNewName); + } + break; + case WID_IDX_NAME: + { + OUString sNewName; + if (!(rValue >>= sNewName)) { - lang::Locale aLocale; - if(aValue>>= aLocale) - pTOXBase->SetLanguage(SvxLocaleToLanguage(aLocale)); - else - throw lang::IllegalArgumentException(); + throw lang::IllegalArgumentException(); } - break; - case WID_IDX_SORT_ALGORITHM: + rTOXBase.SetTOXName(sNewName); + } + break; + case WID_USER_IDX_NAME: + { + OUString sNewName; + if (!(rValue >>= sNewName)) { - OUString sTmp; - if(aValue >>= sTmp) - pTOXBase->SetSortAlgorithm(sTmp); - else - throw lang::IllegalArgumentException(); + throw lang::IllegalArgumentException(); } - break; - case WID_LEVEL : - pTOXBase->SetLevel(lcl_AnyToInt16(aValue)); - break; - case WID_CREATE_FROM_MARKS : - nCreate = lcl_AnyToBool(aValue) ? nCreate | nsSwTOXElement::TOX_MARK: nCreate & ~nsSwTOXElement::TOX_MARK; - break; - case WID_CREATE_FROM_OUTLINE : - nCreate = lcl_AnyToBool(aValue) ? nCreate | nsSwTOXElement::TOX_OUTLINELEVEL: nCreate & ~nsSwTOXElement::TOX_OUTLINELEVEL; - break; -// case WID_PARAGRAPH_STYLE_NAMES :DBG_ERROR("not implemented") -// break; - case WID_CREATE_FROM_CHAPTER : - pTOXBase->SetFromChapter(lcl_AnyToBool(aValue)); - break; - case WID_CREATE_FROM_LABELS : - pTOXBase->SetFromObjectNames(! lcl_AnyToBool(aValue)); - break; - case WID_PROTECTED : + lcl_ConvertTOUNameToUserName(sNewName); + DBG_ASSERT(TOX_USER == eTxBaseType, + "tox type name can only be changed for user indexes"); + if (pSectionFmt) { - sal_Bool bSet = lcl_AnyToBool(aValue); - pTOXBase->SetProtected(bSet); - if(GetFmt()) - ((SwTOXBaseSection*)pTOXBase)->SetProtect(bSet); + OUString sTmp = rTOXBase.GetTOXType()->GetTypeName(); + if (sTmp != sNewName) + { + lcl_ReAssignTOXType(pSectionFmt->GetDoc(), + rTOXBase, sNewName); + } } - break; - case WID_USE_ALPHABETICAL_SEPARATORS: - nTOIOptions = lcl_AnyToBool(aValue) ? - nTOIOptions | nsSwTOIOptions::TOI_ALPHA_DELIMITTER : nTOIOptions & ~nsSwTOIOptions::TOI_ALPHA_DELIMITTER; - break; - case WID_USE_KEY_AS_ENTRY : - nTOIOptions = lcl_AnyToBool(aValue) ? - nTOIOptions | nsSwTOIOptions::TOI_KEY_AS_ENTRY : nTOIOptions & ~nsSwTOIOptions::TOI_KEY_AS_ENTRY; - break; - case WID_USE_COMBINED_ENTRIES : - nTOIOptions = lcl_AnyToBool(aValue) ? - nTOIOptions | nsSwTOIOptions::TOI_SAME_ENTRY : nTOIOptions & ~nsSwTOIOptions::TOI_SAME_ENTRY; - break; - case WID_IS_CASE_SENSITIVE : - nTOIOptions = lcl_AnyToBool(aValue) ? - nTOIOptions | nsSwTOIOptions::TOI_CASE_SENSITIVE : nTOIOptions & ~nsSwTOIOptions::TOI_CASE_SENSITIVE; - break; - case WID_USE_P_P : - nTOIOptions = lcl_AnyToBool(aValue) ? - nTOIOptions | nsSwTOIOptions::TOI_FF : nTOIOptions & ~nsSwTOIOptions::TOI_FF; - break; - case WID_USE_DASH : - nTOIOptions = lcl_AnyToBool(aValue) ? - nTOIOptions | nsSwTOIOptions::TOI_DASH : nTOIOptions & ~nsSwTOIOptions::TOI_DASH; - break; - case WID_USE_UPPER_CASE : - nTOIOptions = lcl_AnyToBool(aValue) ? - nTOIOptions | nsSwTOIOptions::TOI_INITIAL_CAPS : nTOIOptions & ~nsSwTOIOptions::TOI_INITIAL_CAPS; - break; - case WID_IS_COMMA_SEPARATED : - bForm = sal_True; - aForm.SetCommaSeparated(lcl_AnyToBool(aValue)); - break; - case WID_LABEL_CATEGORY : + else { - // convert file-format/API/external programmatic english name - // to internal UI name before usage - String aName( SwStyleNameMapper::GetSpecialExtraUIName( - lcl_AnyToString(aValue) ) ); - pTOXBase->SetSequenceName( aName ); + m_pImpl->m_pProps->SetTypeName(sNewName); } - break; - case WID_LABEL_DISPLAY_TYPE : + } + break; + case WID_IDX_LOCALE: + { + lang::Locale aLocale; + if (!(rValue>>= aLocale)) { - sal_Int16 nVal = lcl_AnyToInt16(aValue); - sal_uInt16 nSet = CAPTION_COMPLETE; - switch (nVal) - { - case text::ReferenceFieldPart::TEXT: nSet = CAPTION_COMPLETE; - break; - case text::ReferenceFieldPart::CATEGORY_AND_NUMBER : nSet = CAPTION_NUMBER; - break; - case text::ReferenceFieldPart::ONLY_CAPTION : nSet = CAPTION_TEXT; - break; - default: - throw lang::IllegalArgumentException(); - } - pTOXBase->SetCaptionDisplay((SwCaptionDisplay)nSet); + throw lang::IllegalArgumentException(); } - break; - case WID_USE_LEVEL_FROM_SOURCE : - pTOXBase->SetLevelFromChapter(lcl_AnyToBool(aValue)); - break; - case WID_MAIN_ENTRY_CHARACTER_STYLE_NAME : + rTOXBase.SetLanguage(SvxLocaleToLanguage(aLocale)); + } + break; + case WID_IDX_SORT_ALGORITHM: + { + OUString sTmp; + if (!(rValue >>= sTmp)) { - String aString; - SwStyleNameMapper::FillUIName(lcl_AnyToString(aValue), aString, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, sal_True); - pTOXBase->SetMainEntryCharStyle( aString ); + throw lang::IllegalArgumentException(); } - break; - case WID_CREATE_FROM_TABLES : - nCreate = lcl_AnyToBool(aValue) ? nCreate | nsSwTOXElement::TOX_TABLE : nCreate & ~nsSwTOXElement::TOX_TABLE; - break; - case WID_CREATE_FROM_TEXT_FRAMES : - nCreate = lcl_AnyToBool(aValue) ? nCreate | nsSwTOXElement::TOX_FRAME : nCreate & ~nsSwTOXElement::TOX_FRAME; - break; - case WID_CREATE_FROM_GRAPHIC_OBJECTS : - nCreate = lcl_AnyToBool(aValue) ? nCreate | nsSwTOXElement::TOX_GRAPHIC : nCreate & ~nsSwTOXElement::TOX_GRAPHIC; - break; - case WID_CREATE_FROM_EMBEDDED_OBJECTS : - if(lcl_AnyToBool(aValue)) - nCreate |= nsSwTOXElement::TOX_OLE; - else - nCreate &= ~nsSwTOXElement::TOX_OLE; - break; - case WID_CREATE_FROM_STAR_MATH: - nOLEOptions = lcl_AnyToBool(aValue) ? nOLEOptions | nsSwTOOElements::TOO_MATH : nOLEOptions & ~nsSwTOOElements::TOO_MATH; - break; - case WID_CREATE_FROM_STAR_CHART : - nOLEOptions = lcl_AnyToBool(aValue) ? nOLEOptions | nsSwTOOElements::TOO_CHART : nOLEOptions & ~nsSwTOOElements::TOO_CHART; - break; - case WID_CREATE_FROM_STAR_CALC : - nOLEOptions = lcl_AnyToBool(aValue) ? nOLEOptions | nsSwTOOElements::TOO_CALC : nOLEOptions & ~nsSwTOOElements::TOO_CALC; - break; - case WID_CREATE_FROM_STAR_DRAW : - nOLEOptions = lcl_AnyToBool(aValue) ? nOLEOptions | nsSwTOOElements::TOO_DRAW_IMPRESS : nOLEOptions & ~nsSwTOOElements::TOO_DRAW_IMPRESS; - break; - case WID_CREATE_FROM_OTHER_EMBEDDED_OBJECTS: - nOLEOptions = lcl_AnyToBool(aValue) ? nOLEOptions | nsSwTOOElements::TOO_OTHER : nOLEOptions & ~nsSwTOOElements::TOO_OTHER; - break; - case WID_PARA_HEAD : + rTOXBase.SetSortAlgorithm(sTmp); + } + break; + case WID_LEVEL: + { + rTOXBase.SetLevel(lcl_AnyToInt16(rValue)); + } + break; + case WID_CREATE_FROM_MARKS: + lcl_AnyToBitMask(rValue, nCreate, nsSwTOXElement::TOX_MARK); + break; + case WID_CREATE_FROM_OUTLINE: + lcl_AnyToBitMask(rValue, nCreate, nsSwTOXElement::TOX_OUTLINELEVEL); + break; +// case WID_PARAGRAPH_STYLE_NAMES :DBG_ERROR("not implemented") +// break; + case WID_CREATE_FROM_CHAPTER: + rTOXBase.SetFromChapter(lcl_AnyToBool(rValue)); + break; + case WID_CREATE_FROM_LABELS: + rTOXBase.SetFromObjectNames(! lcl_AnyToBool(rValue)); + break; + case WID_PROTECTED: + { + sal_Bool bSet = lcl_AnyToBool(rValue); + rTOXBase.SetProtected(bSet); + if (pSectionFmt) { - String aString; - SwStyleNameMapper::FillUIName( lcl_AnyToString(aValue), aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, sal_True); - bForm = sal_True; - //Header steht an Pos 0 - aForm.SetTemplate( 0, aString ); + static_cast(rTOXBase).SetProtect(bSet); } - break; - case WID_IS_RELATIVE_TABSTOPS: - bForm = sal_True; - aForm.SetRelTabPos(lcl_AnyToBool(aValue)); - break; - case WID_PARA_SEP : + } + break; + case WID_USE_ALPHABETICAL_SEPARATORS: + lcl_AnyToBitMask(rValue, nTOIOptions, + nsSwTOIOptions::TOI_ALPHA_DELIMITTER); + break; + case WID_USE_KEY_AS_ENTRY: + lcl_AnyToBitMask(rValue, nTOIOptions, + nsSwTOIOptions::TOI_KEY_AS_ENTRY); + break; + case WID_USE_COMBINED_ENTRIES: + lcl_AnyToBitMask(rValue, nTOIOptions, + nsSwTOIOptions::TOI_SAME_ENTRY); + break; + case WID_IS_CASE_SENSITIVE: + lcl_AnyToBitMask(rValue, nTOIOptions, + nsSwTOIOptions::TOI_CASE_SENSITIVE); + break; + case WID_USE_P_P: + lcl_AnyToBitMask(rValue, nTOIOptions, nsSwTOIOptions::TOI_FF); + break; + case WID_USE_DASH: + lcl_AnyToBitMask(rValue, nTOIOptions, nsSwTOIOptions::TOI_DASH); + break; + case WID_USE_UPPER_CASE: + lcl_AnyToBitMask(rValue, nTOIOptions, + nsSwTOIOptions::TOI_INITIAL_CAPS); + break; + case WID_IS_COMMA_SEPARATED: + bForm = sal_True; + aForm.SetCommaSeparated(lcl_AnyToBool(rValue)); + break; + case WID_LABEL_CATEGORY: + { + // convert file-format/API/external programmatic english name + // to internal UI name before usage + String aName( SwStyleNameMapper::GetSpecialExtraUIName( + lcl_AnyToString(rValue) ) ); + rTOXBase.SetSequenceName( aName ); + } + break; + case WID_LABEL_DISPLAY_TYPE: + { + const sal_Int16 nVal = lcl_AnyToInt16(rValue); + sal_uInt16 nSet = CAPTION_COMPLETE; + switch (nVal) { - String aString; - bForm = sal_True; - SwStyleNameMapper::FillUIName( lcl_AnyToString(aValue), aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, sal_True); - aForm.SetTemplate( 1, aString ); + case text::ReferenceFieldPart::TEXT: + nSet = CAPTION_COMPLETE; + break; + case text::ReferenceFieldPart::CATEGORY_AND_NUMBER: + nSet = CAPTION_NUMBER; + break; + case text::ReferenceFieldPart::ONLY_CAPTION: + nSet = CAPTION_TEXT; + break; + default: + throw lang::IllegalArgumentException(); } - break; - case WID_CREATE_FROM_PARAGRAPH_STYLES: - nCreate = lcl_AnyToBool(aValue) ? - (nCreate | nsSwTOXElement::TOX_TEMPLATE) : (nCreate & ~nsSwTOXElement::TOX_TEMPLATE); - break; - - case WID_PARA_LEV1 : - case WID_PARA_LEV2 : - case WID_PARA_LEV3 : - case WID_PARA_LEV4 : - case WID_PARA_LEV5 : - case WID_PARA_LEV6 : - case WID_PARA_LEV7 : - case WID_PARA_LEV8 : - case WID_PARA_LEV9 : - case WID_PARA_LEV10 : + rTOXBase.SetCaptionDisplay(static_cast(nSet)); + } + break; + case WID_USE_LEVEL_FROM_SOURCE: + rTOXBase.SetLevelFromChapter(lcl_AnyToBool(rValue)); + break; + case WID_MAIN_ENTRY_CHARACTER_STYLE_NAME: + { + String aString; + SwStyleNameMapper::FillUIName(lcl_AnyToString(rValue), + aString, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT, sal_True); + rTOXBase.SetMainEntryCharStyle( aString ); + } + break; + case WID_CREATE_FROM_TABLES: + lcl_AnyToBitMask(rValue, nCreate, nsSwTOXElement::TOX_TABLE); + break; + case WID_CREATE_FROM_TEXT_FRAMES: + lcl_AnyToBitMask(rValue, nCreate, nsSwTOXElement::TOX_FRAME); + break; + case WID_CREATE_FROM_GRAPHIC_OBJECTS: + lcl_AnyToBitMask(rValue, nCreate, nsSwTOXElement::TOX_GRAPHIC); + break; + case WID_CREATE_FROM_EMBEDDED_OBJECTS: + lcl_AnyToBitMask(rValue, nCreate, nsSwTOXElement::TOX_OLE); + break; + case WID_CREATE_FROM_STAR_MATH: + lcl_AnyToBitMask(rValue, nOLEOptions, nsSwTOOElements::TOO_MATH); + break; + case WID_CREATE_FROM_STAR_CHART: + lcl_AnyToBitMask(rValue, nOLEOptions, nsSwTOOElements::TOO_CHART); + break; + case WID_CREATE_FROM_STAR_CALC: + lcl_AnyToBitMask(rValue, nOLEOptions, nsSwTOOElements::TOO_CALC); + break; + case WID_CREATE_FROM_STAR_DRAW: + lcl_AnyToBitMask(rValue, nOLEOptions, + nsSwTOOElements::TOO_DRAW_IMPRESS); + break; + case WID_CREATE_FROM_OTHER_EMBEDDED_OBJECTS: + lcl_AnyToBitMask(rValue, nOLEOptions, nsSwTOOElements::TOO_OTHER); + break; + case WID_PARA_HEAD: + { + String aString; + SwStyleNameMapper::FillUIName( lcl_AnyToString(rValue), + aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, sal_True); + bForm = sal_True; + // Header is on Pos 0 + aForm.SetTemplate( 0, aString ); + } + break; + case WID_IS_RELATIVE_TABSTOPS: + bForm = sal_True; + aForm.SetRelTabPos(lcl_AnyToBool(rValue)); + break; + case WID_PARA_SEP: + { + String aString; + bForm = sal_True; + SwStyleNameMapper::FillUIName( lcl_AnyToString(rValue), + aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, sal_True); + aForm.SetTemplate( 1, aString ); + } + break; + case WID_CREATE_FROM_PARAGRAPH_STYLES: + lcl_AnyToBitMask(rValue, nCreate, nsSwTOXElement::TOX_TEMPLATE); + break; + + case WID_PARA_LEV1: + case WID_PARA_LEV2: + case WID_PARA_LEV3: + case WID_PARA_LEV4: + case WID_PARA_LEV5: + case WID_PARA_LEV6: + case WID_PARA_LEV7: + case WID_PARA_LEV8: + case WID_PARA_LEV9: + case WID_PARA_LEV10: + { + bForm = sal_True; + // in sdbcx::Index Label 1 begins at Pos 2 otherwise at Pos 1 + const sal_uInt16 nLPos = rTOXBase.GetType() == TOX_INDEX ? 2 : 1; + String aString; + SwStyleNameMapper::FillUIName( lcl_AnyToString(rValue), + aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, sal_True); + aForm.SetTemplate(nLPos + pEntry->nWID - WID_PARA_LEV1, aString ); + } + break; + default: + //this is for items only + if (WID_PRIMARY_KEY > pEntry->nWID) { - bForm = sal_True; - // im sdbcx::Index beginnt Lebel 1 bei Pos 2 sonst bei Pos 1 - sal_uInt16 nLPos = pTOXBase->GetType() == TOX_INDEX ? 2 : 1; - String aString; - SwStyleNameMapper::FillUIName( lcl_AnyToString(aValue), aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, sal_True); - aForm.SetTemplate(nLPos + pEntry->nWID - WID_PARA_LEV1, aString ); - } - break; - default: - //this is for items only - if(WID_PRIMARY_KEY > pEntry->nWID) + const SwAttrSet& rSet = + m_pImpl->m_pDoc->GetTOXBaseAttrSet(rTOXBase); + SfxItemSet aAttrSet(rSet); + m_pImpl->m_rPropSet.setPropertyValue( + rPropertyName, rValue, aAttrSet); + + const SwSectionFmts& rSects = m_pImpl->m_pDoc->GetSections(); + for (sal_uInt16 i = 0; i < rSects.Count(); i++) { - const SwAttrSet& rSet = m_pDoc->GetTOXBaseAttrSet(*pTOXBase); - pAttrSet = new SfxItemSet(rSet); - m_pPropSet->setPropertyValue(rPropertyName, aValue, *pAttrSet); - - const SwSectionFmts& rSects = m_pDoc->GetSections(); - const SwSectionFmt* pOwnFmt = GetFmt(); - for(sal_uInt16 i = 0; i < rSects.Count(); i++) + const SwSectionFmt* pTmpFmt = rSects[ i ]; + if (pTmpFmt == pSectionFmt) { - const SwSectionFmt* pTmpFmt = rSects[ i ]; - if(pTmpFmt == pOwnFmt) - { - m_pDoc->ChgSection( i, *(SwTOXBaseSection*)pTOXBase, pAttrSet ); - break; - } + m_pImpl->m_pDoc->ChgSection( i, + static_cast(rTOXBase), + & aAttrSet); + break; } } - } - pTOXBase->SetCreate(nCreate); - pTOXBase->SetOLEOptions(nOLEOptions); - if(pTOXBase->GetTOXType()->GetType() == TOX_INDEX) - pTOXBase->SetOptions(nTOIOptions); - if(bForm) - pTOXBase->SetTOXForm(aForm); - delete pAttrSet; + } + } + rTOXBase.SetCreate(nCreate); + rTOXBase.SetOLEOptions(nOLEOptions); + if (rTOXBase.GetTOXType()->GetType() == TOX_INDEX) + { + rTOXBase.SetOptions(nTOIOptions); + } + if (bForm) + { + rTOXBase.SetTOXForm(aForm); } - else - throw uno::RuntimeException(); - } + /*-- 14.12.98 09:35:05--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Any SwXDocumentIndex::getPropertyValue(const OUString& rPropertyName) - throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) +uno::Any SAL_CALL +SwXDocumentIndex::getPropertyValue(const OUString& rPropertyName) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); + uno::Any aRet; - const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName(rPropertyName); + SfxItemPropertySimpleEntry const*const pEntry = + m_pImpl->m_rPropSet.getPropertyMap()->getByName(rPropertyName); if (!pEntry) - throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); + { + throw beans::UnknownPropertyException( + OUString(RTL_CONSTASCII_USTRINGPARAM("Unknown property: ")) + + rPropertyName, + static_cast< cppu::OWeakObject * >(this)); + } + + SwSectionFmt *const pSectionFmt( m_pImpl->GetSectionFmt() ); SwTOXBase* pTOXBase = 0; - if(GetFmt()) - pTOXBase = (SwTOXBaseSection*)GetFmt()->GetSection(); - else if(bIsDescriptor) - pTOXBase = &pProps->GetTOXBase(); + if (pSectionFmt) + { + pTOXBase = static_cast(pSectionFmt->GetSection()); + } + else if (m_pImpl->m_bIsDescriptor) + { + pTOXBase = &m_pImpl->m_pProps->GetTOXBase(); + } if(pTOXBase) { - sal_uInt16 nCreate = pTOXBase->GetCreateType(); - sal_uInt16 nTOIOptions = 0; - sal_uInt16 nOLEOptions = pTOXBase->GetOLEOptions(); - if(pTOXBase->GetTOXType()->GetType() == TOX_INDEX) - nTOIOptions = pTOXBase->GetOptions(); + const sal_uInt16 nCreate = pTOXBase->GetCreateType(); + const sal_uInt16 nOLEOptions = pTOXBase->GetOLEOptions(); + const sal_uInt16 nTOIOptions = + (pTOXBase->GetTOXType()->GetType() == TOX_INDEX) + ? pTOXBase->GetOptions() + : 0U; const SwForm& rForm = pTOXBase->GetTOXForm(); - sal_Bool bBOOL = sal_True; - sal_Bool bRet = sal_False; switch(pEntry->nWID) { case WID_IDX_CONTENT_SECTION: case WID_IDX_HEADER_SECTION : - bBOOL = sal_False; if(WID_IDX_CONTENT_SECTION == pEntry->nWID) { - uno::Reference xContentSect = SwXTextSections::GetObject( *GetFmt() ); + const uno::Reference xContentSect = + SwXTextSection::CreateXTextSection( pSectionFmt ); aRet <<= xContentSect; } else { SwSections aSectArr; - GetFmt()->GetChildSections( aSectArr, SORTSECT_NOT, FALSE); + pSectionFmt->GetChildSections(aSectArr, + SORTSECT_NOT, FALSE); for(USHORT i = 0; i < aSectArr.Count(); i++) { SwSection* pSect = aSectArr[i]; if(pSect->GetType() == TOX_HEADER_SECTION) { - uno::Reference xHeaderSect = SwXTextSections::GetObject( *pSect->GetFmt() ); - aRet <<= xHeaderSect; + const uno::Reference xHeader = + SwXTextSection::CreateXTextSection( + pSect->GetFmt() ); + aRet <<= xHeader; break; } } @@ -704,80 +906,96 @@ uno::Any SwXDocumentIndex::getPropertyValue(const OUString& rPropertyName) break; case WID_IDX_TITLE : { - bBOOL = sal_False; OUString uRet(pTOXBase->GetTitle()); aRet <<= uRet; break; } case WID_IDX_NAME: - bBOOL = sal_False; aRet <<= OUString(pTOXBase->GetTOXName()); break; case WID_USER_IDX_NAME: { - bBOOL = sal_False; OUString sTmp; - if(!IsDescriptor()) + if (!m_pImpl->m_bIsDescriptor) + { sTmp = pTOXBase->GetTOXType()->GetTypeName(); + } else - sTmp = pProps->GetTypeName(); + { + sTmp = m_pImpl->m_pProps->GetTypeName(); + } //I18N lcl_ConvertTOUNameToProgrammaticName(sTmp); aRet <<= sTmp; } break; case WID_IDX_LOCALE: - bBOOL = sal_False; aRet <<= SvxCreateLocale(pTOXBase->GetLanguage()); break; case WID_IDX_SORT_ALGORITHM: - bBOOL = sal_False; aRet <<= OUString(pTOXBase->GetSortAlgorithm()); break; case WID_LEVEL : - bBOOL = sal_False; - aRet <<= (sal_Int16)pTOXBase->GetLevel(); + aRet <<= static_cast(pTOXBase->GetLevel()); break; - case WID_CREATE_FROM_MARKS : - bRet = 0 != (nCreate & nsSwTOXElement::TOX_MARK); + case WID_CREATE_FROM_MARKS: + lcl_BitMaskToAny(aRet, nCreate, nsSwTOXElement::TOX_MARK); break; - case WID_CREATE_FROM_OUTLINE : - bRet = 0 != (nCreate & nsSwTOXElement::TOX_OUTLINELEVEL); + case WID_CREATE_FROM_OUTLINE: + lcl_BitMaskToAny(aRet, nCreate, + nsSwTOXElement::TOX_OUTLINELEVEL); break; - case WID_CREATE_FROM_CHAPTER : - bRet = pTOXBase->IsFromChapter(); + case WID_CREATE_FROM_CHAPTER: + { + const sal_Bool bRet = pTOXBase->IsFromChapter(); + aRet <<= bRet; + } break; - case WID_CREATE_FROM_LABELS : - bRet = ! pTOXBase->IsFromObjectNames(); + case WID_CREATE_FROM_LABELS: + { + const sal_Bool bRet = ! pTOXBase->IsFromObjectNames(); + aRet <<= bRet; + } break; - case WID_PROTECTED : - bRet = pTOXBase->IsProtected(); + case WID_PROTECTED: + { + const sal_Bool bRet = pTOXBase->IsProtected(); + aRet <<= bRet; + } break; case WID_USE_ALPHABETICAL_SEPARATORS: - bRet = 0 != (nTOIOptions & nsSwTOIOptions::TOI_ALPHA_DELIMITTER); + lcl_BitMaskToAny(aRet, nTOIOptions, + nsSwTOIOptions::TOI_ALPHA_DELIMITTER); break; - case WID_USE_KEY_AS_ENTRY : - bRet = 0 != (nTOIOptions & nsSwTOIOptions::TOI_KEY_AS_ENTRY); + case WID_USE_KEY_AS_ENTRY: + lcl_BitMaskToAny(aRet, nTOIOptions, + nsSwTOIOptions::TOI_KEY_AS_ENTRY); break; - case WID_USE_COMBINED_ENTRIES : - bRet = 0 != (nTOIOptions & nsSwTOIOptions::TOI_SAME_ENTRY); + case WID_USE_COMBINED_ENTRIES: + lcl_BitMaskToAny(aRet, nTOIOptions, + nsSwTOIOptions::TOI_SAME_ENTRY); break; - case WID_IS_CASE_SENSITIVE : - bRet = 0 != (nTOIOptions & nsSwTOIOptions::TOI_CASE_SENSITIVE); + case WID_IS_CASE_SENSITIVE: + lcl_BitMaskToAny(aRet, nTOIOptions, + nsSwTOIOptions::TOI_CASE_SENSITIVE); break; case WID_USE_P_P: - bRet = 0 != (nTOIOptions & nsSwTOIOptions::TOI_FF); + lcl_BitMaskToAny(aRet, nTOIOptions, nsSwTOIOptions::TOI_FF); break; - case WID_USE_DASH : - bRet = 0 != (nTOIOptions & nsSwTOIOptions::TOI_DASH); + case WID_USE_DASH: + lcl_BitMaskToAny(aRet, nTOIOptions, nsSwTOIOptions::TOI_DASH); break; - case WID_USE_UPPER_CASE : - bRet = 0 != (nTOIOptions & nsSwTOIOptions::TOI_INITIAL_CAPS); + case WID_USE_UPPER_CASE: + lcl_BitMaskToAny(aRet, nTOIOptions, + nsSwTOIOptions::TOI_INITIAL_CAPS); break; - case WID_IS_COMMA_SEPARATED : - bRet = rForm.IsCommaSeparated(); + case WID_IS_COMMA_SEPARATED: + { + const sal_Bool bRet = rForm.IsCommaSeparated(); + aRet <<= bRet; + } break; - case WID_LABEL_CATEGORY : + case WID_LABEL_CATEGORY: { // convert internal UI name to // file-format/API/external programmatic english name @@ -785,50 +1003,58 @@ uno::Any SwXDocumentIndex::getPropertyValue(const OUString& rPropertyName) String aName( SwStyleNameMapper::GetSpecialExtraProgName( pTOXBase->GetSequenceName() ) ); aRet <<= OUString( aName ); - bBOOL = sal_False; } break; - case WID_LABEL_DISPLAY_TYPE : + case WID_LABEL_DISPLAY_TYPE: { - bBOOL = sal_False; sal_Int16 nSet = text::ReferenceFieldPart::TEXT; switch (pTOXBase->GetCaptionDisplay()) { - case CAPTION_COMPLETE: nSet = text::ReferenceFieldPart::TEXT;break; - case CAPTION_NUMBER : nSet = text::ReferenceFieldPart::CATEGORY_AND_NUMBER; break; - case CAPTION_TEXT : nSet = text::ReferenceFieldPart::ONLY_CAPTION; break; + case CAPTION_COMPLETE: + nSet = text::ReferenceFieldPart::TEXT; + break; + case CAPTION_NUMBER: + nSet = text::ReferenceFieldPart::CATEGORY_AND_NUMBER; + break; + case CAPTION_TEXT: + nSet = text::ReferenceFieldPart::ONLY_CAPTION; + break; } aRet <<= nSet; } break; - case WID_USE_LEVEL_FROM_SOURCE : - bRet = pTOXBase->IsLevelFromChapter(); + case WID_USE_LEVEL_FROM_SOURCE: + { + const sal_Bool bRet = pTOXBase->IsLevelFromChapter(); + aRet <<= bRet; + } break; - case WID_LEVEL_FORMAT : + case WID_LEVEL_FORMAT: { - uno::Reference< container::XIndexReplace > xTokenAcc = - ((SwXDocumentIndex*)this)->GetTokenAccess(); - if(!xTokenAcc.is()) - xTokenAcc = new SwXIndexTokenAccess_Impl(* - (SwXDocumentIndex*)this); - aRet.setValue(&xTokenAcc, ::getCppuType((const uno::Reference*)0)); - bBOOL = sal_False; + uno::Reference< container::XIndexReplace > xTokenAccess( + m_pImpl->m_wTokenAccess); + if (!xTokenAccess.is()) + { + xTokenAccess = new SwXIndexTokenAccess_Impl(*this); + m_pImpl->m_wTokenAccess = xTokenAccess; + } + aRet <<= xTokenAccess; } break; - case WID_LEVEL_PARAGRAPH_STYLES : + case WID_LEVEL_PARAGRAPH_STYLES: { - uno::Reference< container::XIndexReplace > xStyleAcc = - ((SwXDocumentIndex*)this)->GetStyleAccess(); - if(!xStyleAcc.is()) - xStyleAcc = new SwXIndexStyleAccess_Impl(* - (SwXDocumentIndex*)this); - aRet.setValue(&xStyleAcc, ::getCppuType((const uno::Reference*)0)); - bBOOL = sal_False; + uno::Reference< container::XIndexReplace > xStyleAccess( + m_pImpl->m_wStyleAccess); + if (!xStyleAccess.is()) + { + xStyleAccess = new SwXIndexStyleAccess_Impl(*this); + m_pImpl->m_wStyleAccess = xStyleAccess; + } + aRet <<= xStyleAccess; } break; - case WID_MAIN_ENTRY_CHARACTER_STYLE_NAME : + case WID_MAIN_ENTRY_CHARACTER_STYLE_NAME: { - bBOOL = sal_False; String aString; SwStyleNameMapper::FillProgName( pTOXBase->GetMainEntryCharStyle(), @@ -838,47 +1064,47 @@ uno::Any SwXDocumentIndex::getPropertyValue(const OUString& rPropertyName) aRet <<= OUString( aString ); } break; - case WID_CREATE_FROM_TABLES : - bRet = 0 != (nCreate & nsSwTOXElement::TOX_TABLE); + case WID_CREATE_FROM_TABLES: + lcl_BitMaskToAny(aRet, nCreate, nsSwTOXElement::TOX_TABLE); break; - case WID_CREATE_FROM_TEXT_FRAMES : - bRet = 0 != (nCreate & nsSwTOXElement::TOX_FRAME); + case WID_CREATE_FROM_TEXT_FRAMES: + lcl_BitMaskToAny(aRet, nCreate, nsSwTOXElement::TOX_FRAME); break; - case WID_CREATE_FROM_GRAPHIC_OBJECTS : - bRet = 0 != (nCreate & nsSwTOXElement::TOX_GRAPHIC); + case WID_CREATE_FROM_GRAPHIC_OBJECTS: + lcl_BitMaskToAny(aRet, nCreate, nsSwTOXElement::TOX_GRAPHIC); break; - case WID_CREATE_FROM_EMBEDDED_OBJECTS : - bRet = 0 != (nCreate & nsSwTOXElement::TOX_OLE); + case WID_CREATE_FROM_EMBEDDED_OBJECTS: + lcl_BitMaskToAny(aRet, nCreate, nsSwTOXElement::TOX_OLE); break; case WID_CREATE_FROM_STAR_MATH: - bRet = 0 != (nOLEOptions & nsSwTOOElements::TOO_MATH); + lcl_BitMaskToAny(aRet, nOLEOptions, nsSwTOOElements::TOO_MATH); break; - case WID_CREATE_FROM_STAR_CHART : - bRet = 0 != (nOLEOptions & nsSwTOOElements::TOO_CHART); + case WID_CREATE_FROM_STAR_CHART: + lcl_BitMaskToAny(aRet, nOLEOptions, nsSwTOOElements::TOO_CHART); break; - case WID_CREATE_FROM_STAR_CALC : - bRet = 0 != (nOLEOptions & nsSwTOOElements::TOO_CALC); + case WID_CREATE_FROM_STAR_CALC: + lcl_BitMaskToAny(aRet, nOLEOptions, nsSwTOOElements::TOO_CALC); break; - case WID_CREATE_FROM_STAR_DRAW : - bRet = 0 != (nOLEOptions & nsSwTOOElements::TOO_DRAW_IMPRESS); + case WID_CREATE_FROM_STAR_DRAW: + lcl_BitMaskToAny(aRet, nOLEOptions, + nsSwTOOElements::TOO_DRAW_IMPRESS); break; case WID_CREATE_FROM_OTHER_EMBEDDED_OBJECTS: - bRet = 0 != (nOLEOptions & nsSwTOOElements::TOO_OTHER); + lcl_BitMaskToAny(aRet, nOLEOptions, nsSwTOOElements::TOO_OTHER); break; case WID_CREATE_FROM_PARAGRAPH_STYLES: - bRet = 0 != (nCreate & nsSwTOXElement::TOX_TEMPLATE); + lcl_BitMaskToAny(aRet, nCreate, nsSwTOXElement::TOX_TEMPLATE); break; - case WID_PARA_HEAD : + case WID_PARA_HEAD: { //Header steht an Pos 0 String aString; SwStyleNameMapper::FillProgName(rForm.GetTemplate( 0 ), aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, sal_True ); aRet <<= OUString( aString ); - bBOOL = sal_False; } break; - case WID_PARA_SEP : + case WID_PARA_SEP: { String aString; SwStyleNameMapper::FillProgName( @@ -887,21 +1113,20 @@ uno::Any SwXDocumentIndex::getPropertyValue(const OUString& rPropertyName) nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, sal_True); aRet <<= OUString( aString ); - bBOOL = sal_False; } break; - case WID_PARA_LEV1 : - case WID_PARA_LEV2 : - case WID_PARA_LEV3 : - case WID_PARA_LEV4 : - case WID_PARA_LEV5 : - case WID_PARA_LEV6 : - case WID_PARA_LEV7 : - case WID_PARA_LEV8 : - case WID_PARA_LEV9 : - case WID_PARA_LEV10 : + case WID_PARA_LEV1: + case WID_PARA_LEV2: + case WID_PARA_LEV3: + case WID_PARA_LEV4: + case WID_PARA_LEV5: + case WID_PARA_LEV6: + case WID_PARA_LEV7: + case WID_PARA_LEV8: + case WID_PARA_LEV9: + case WID_PARA_LEV10: { - // im sdbcx::Index beginnt Lebel 1 bei Pos 2 sonst bei Pos 1 + // in sdbcx::Index Label 1 begins at Pos 2 otherwise at Pos 1 sal_uInt16 nLPos = pTOXBase->GetType() == TOX_INDEX ? 2 : 1; String aString; SwStyleNameMapper::FillProgName( @@ -910,282 +1135,319 @@ uno::Any SwXDocumentIndex::getPropertyValue(const OUString& rPropertyName) nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, sal_True); aRet <<= OUString( aString ); - bBOOL = sal_False; } break; case WID_IS_RELATIVE_TABSTOPS: - bRet = rForm.IsRelTabPos(); + { + const sal_Bool bRet = rForm.IsRelTabPos(); + aRet <<= bRet; + } break; case WID_INDEX_MARKS: { SwTOXMarks aMarks; - const SwTOXType* pType = pTOXBase->GetTOXType(); - SwClientIter aIter(*(SwTOXType*)pType); - SwTOXMark* pMark = (SwTOXMark*)aIter.First(TYPE(SwTOXMark)); + SwTOXType const*const pType = pTOXBase->GetTOXType(); + SwClientIter aIter(*pType); + SwTOXMark * pMark = + static_cast(aIter.First(TYPE(SwTOXMark))); while( pMark ) { if(pMark->GetTxtTOXMark()) + { aMarks.C40_INSERT(SwTOXMark, pMark, aMarks.Count()); - pMark = (SwTOXMark*)aIter.Next(); + } + pMark = static_cast(aIter.Next()); } - uno::Sequence< uno::Reference < text::XDocumentIndexMark > > aXMarks(aMarks.Count()); - uno::Reference* pxMarks = aXMarks.getArray(); + uno::Sequence< uno::Reference > + aXMarks(aMarks.Count()); + uno::Reference* pxMarks = + aXMarks.getArray(); for(USHORT i = 0; i < aMarks.Count(); i++) { pMark = aMarks.GetObject(i); - pxMarks[i] = SwXDocumentIndexMark::GetObject((SwTOXType*)pType, pMark, m_pDoc); + pxMarks[i] = SwXDocumentIndexMark::GetObject( + const_cast(pType), pMark, m_pImpl->m_pDoc); } - aRet.setValue(&aXMarks, ::getCppuType((uno::Sequence< uno::Reference< text::XDocumentIndexMark > >*)0)); - bBOOL = sal_False; + aRet <<= aXMarks; } break; default: //this is for items only - bBOOL = sal_False; if(WID_PRIMARY_KEY > pEntry->nWID) { - const SwAttrSet& rSet = m_pDoc->GetTOXBaseAttrSet(*pTOXBase); - aRet = m_pPropSet->getPropertyValue(rPropertyName, rSet); + const SwAttrSet& rSet = + m_pImpl->m_pDoc->GetTOXBaseAttrSet(*pTOXBase); + aRet = m_pImpl->m_rPropSet.getPropertyValue( + rPropertyName, rSet); } } - if(bBOOL) - aRet.setValue(&bRet, ::getCppuBooleanType()); } return aRet; } -/*-- 14.12.98 09:35:06--------------------------------------------------- - -----------------------------------------------------------------------*/ -void SwXDocumentIndex::addPropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) -{ - DBG_WARNING("not implemented"); -} /*-- 14.12.98 09:35:06--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXDocumentIndex::removePropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) +void SAL_CALL +SwXDocumentIndex::addPropertyChangeListener( + const ::rtl::OUString& /*rPropertyName*/, + const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { - DBG_WARNING("not implemented"); + OSL_ENSURE(false, + "SwXDocumentIndex::addPropertyChangeListener(): not implemented"); } -/*-- 14.12.98 09:35:06--------------------------------------------------- - -----------------------------------------------------------------------*/ -void SwXDocumentIndex::addVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) +void SAL_CALL +SwXDocumentIndex::removePropertyChangeListener( + const ::rtl::OUString& /*rPropertyName*/, + const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { - DBG_WARNING("not implemented"); + OSL_ENSURE(false, + "SwXDocumentIndex::removePropertyChangeListener(): not implemented"); } -/*-- 14.12.98 09:35:07--------------------------------------------------- - -----------------------------------------------------------------------*/ -void SwXDocumentIndex::removeVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) +void SAL_CALL +SwXDocumentIndex::addVetoableChangeListener( + const ::rtl::OUString& /*rPropertyName*/, + const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { - DBG_WARNING("not implemented"); + OSL_ENSURE(false, + "SwXDocumentIndex::addVetoableChangeListener(): not implemented"); } -/*-- 14.12.98 09:35:07--------------------------------------------------- - -----------------------------------------------------------------------*/ -void SwXDocumentIndex::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) +void SAL_CALL +SwXDocumentIndex::removeVetoableChangeListener( + const ::rtl::OUString& /*rPropertyName*/, + const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { - BOOL bRemove = FALSE; - switch( pOld ? pOld->Which() : 0 ) - { - case RES_REMOVE_UNO_OBJECT: - case RES_OBJECTDYING: - bRemove = (void*)GetRegisteredIn() == ((SwPtrMsgPoolItem *)pOld)->pObject; - break; - case RES_FMT_CHG: - // wurden wir an das neue umgehaengt und wird das alte geloscht? - bRemove = ((SwFmtChg*)pNew)->pChangedFmt == GetRegisteredIn() && - ((SwFmtChg*)pOld)->pChangedFmt->IsFmtInDTOR(); - break; - } - if( bRemove ) - { - ((SwModify*)GetRegisteredIn())->Remove( this ); - aLstnrCntnr.Disposing(); - } + OSL_ENSURE(false, + "SwXDocumentIndex::removeVetoableChangeListener(): not implemented"); } + /* -----------------18.02.99 13:39------------------- * * --------------------------------------------------*/ -void SwXDocumentIndex::attachToRange(const uno::Reference< text::XTextRange > & xTextRange) - throw( lang::IllegalArgumentException, uno::RuntimeException ) +void SAL_CALL +SwXDocumentIndex::attach(const uno::Reference< text::XTextRange > & xTextRange) +throw (lang::IllegalArgumentException, uno::RuntimeException) { - if(!bIsDescriptor) + vos::OGuard aGuard(Application::GetSolarMutex()); + + if (!m_pImpl->m_bIsDescriptor) + { throw uno::RuntimeException(); - uno::Reference xRangeTunnel( xTextRange, uno::UNO_QUERY); - SwXTextRange* pRange = 0; - OTextCursorHelper* pCursor = 0; - if(xRangeTunnel.is()) + } + const uno::Reference xRangeTunnel( xTextRange, uno::UNO_QUERY); + SwXTextRange *const pRange = + ::sw::UnoTunnelGetImplementation(xRangeTunnel); + OTextCursorHelper *const pCursor = + ::sw::UnoTunnelGetImplementation(xRangeTunnel); + + SwDoc *const pDoc = + (pRange) ? pRange->GetDoc() : ((pCursor) ? pCursor->GetDoc() : 0); + if (!pDoc) { - pRange = reinterpret_cast< SwXTextRange * >( - sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( SwXTextRange::getUnoTunnelId()) )); - pCursor = reinterpret_cast< OTextCursorHelper * >( - sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( OTextCursorHelper::getUnoTunnelId()) )); + throw lang::IllegalArgumentException(); } - SwDoc* pDoc = pRange ? (SwDoc*)pRange->GetDoc() : pCursor ? (SwDoc*)pCursor->GetDoc() : 0; - if(pDoc ) + SwUnoInternalPaM aPam(*pDoc); + //das muss jetzt sal_True liefern + ::sw::XTextRangeToSwPaM(aPam, xTextRange); + + const SwTOXBase* pOld = pDoc->GetCurTOX( *aPam.Start() ); + if (pOld) { - SwUnoInternalPaM aPam(*pDoc); - //das muss jetzt sal_True liefern - ::sw::XTextRangeToSwPaM(aPam, xTextRange); + throw lang::IllegalArgumentException(); + } - const SwTOXBase* pOld = pDoc->GetCurTOX( *aPam.Start() ); - if(!pOld) - { - UnoActionContext aAction(pDoc); - if(aPam.HasMark()) - pDoc->DeleteAndJoin(aPam); + UnoActionContext aAction(pDoc); + if (aPam.HasMark()) + { + pDoc->DeleteAndJoin(aPam); + } - SwTOXBase& rTOXBase = pProps->GetTOXBase(); - const SwTOXType* pTOXType = rTOXBase.GetTOXType(); - if(TOX_USER == pTOXType->GetType() && !pProps->GetTypeName().equals(pTOXType->GetTypeName())) - { - lcl_ReAssignTOXType(pDoc, rTOXBase, pProps->GetTypeName()); - } - //TODO: apply Section attributes (columns and background) - const SwTOXBaseSection* pTOX = pDoc->InsertTableOf( - *aPam.GetPoint(), rTOXBase, 0, sal_False ); + SwTOXBase & rTOXBase = m_pImpl->m_pProps->GetTOXBase(); + SwTOXType const*const pTOXType = rTOXBase.GetTOXType(); + if ((TOX_USER == pTOXType->GetType()) && + !m_pImpl->m_pProps->GetTypeName().equals(pTOXType->GetTypeName())) + { + lcl_ReAssignTOXType(pDoc, rTOXBase, m_pImpl->m_pProps->GetTypeName()); + } + //TODO: apply Section attributes (columns and background) + SwTOXBaseSection const*const pTOX = + pDoc->InsertTableOf( *aPam.GetPoint(), rTOXBase, 0, sal_False ); - pDoc->SetTOXBaseName( *pTOX, pProps->GetTOXBase().GetTOXName() ); + pDoc->SetTOXBaseName(*pTOX, m_pImpl->m_pProps->GetTOXBase().GetTOXName()); - // Seitennummern eintragen - pBase = (const SwTOXBaseSection*)pTOX; - pBase->GetFmt()->Add(this); - ((SwTOXBaseSection*)pTOX)->UpdatePageNum(); - } - else - throw lang::IllegalArgumentException(); + // update page numbers + pTOX->GetFmt()->Add(m_pImpl.get()); + pTOX->GetFmt()->SetXObject(static_cast< ::cppu::OWeakObject*>(this)); + const_cast(pTOX)->UpdatePageNum(); - DELETEZ(pProps); - m_pDoc = pDoc; - bIsDescriptor = sal_False; - } + m_pImpl->m_pProps.reset(); + m_pImpl->m_pDoc = pDoc; + m_pImpl->m_bIsDescriptor = sal_False; } -/*-- 15.01.99 14:23:51--------------------------------------------------- - -----------------------------------------------------------------------*/ -void SwXDocumentIndex::attach(const uno::Reference< text::XTextRange > & xTextRange) - throw( lang::IllegalArgumentException, uno::RuntimeException ) -{ - vos::OGuard aGuard(Application::GetSolarMutex()); - attachToRange( xTextRange ); -} /*-- 15.01.99 14:23:56--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Reference< text::XTextRange > SwXDocumentIndex::getAnchor(void) throw( uno::RuntimeException ) +uno::Reference< text::XTextRange > SAL_CALL +SwXDocumentIndex::getAnchor() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - uno::Reference< text::XTextRange > xRet; - if(GetRegisteredIn()) + + SwSectionFmt *const pSectionFmt( m_pImpl->GetSectionFmt() ); + if (!pSectionFmt) { - SwSectionFmt* pSectFmt = GetFmt(); - const SwNodeIndex* pIdx; - if( 0 != ( pIdx = pSectFmt->GetCntnt().GetCntntIdx() ) && - pIdx->GetNode().GetNodes().IsDocNodes() ) - { - SwPaM aPaM(*pIdx); - aPaM.Move( fnMoveForward, fnGoCntnt ); - aPaM.SetMark(); - aPaM.GetPoint()->nNode = *pIdx->GetNode().EndOfSectionNode(); - aPaM.Move( fnMoveBackward, fnGoCntnt ); - xRet = SwXTextRange::CreateXTextRange(*pSectFmt->GetDoc(), - *aPaM.GetMark(), aPaM.GetPoint()); - } - } - else throw uno::RuntimeException(); + } + + uno::Reference< text::XTextRange > xRet; + SwNodeIndex const*const pIdx( pSectionFmt->GetCntnt().GetCntntIdx() ); + if (pIdx && pIdx->GetNode().GetNodes().IsDocNodes()) + { + SwPaM aPaM(*pIdx); + aPaM.Move( fnMoveForward, fnGoCntnt ); + aPaM.SetMark(); + aPaM.GetPoint()->nNode = *pIdx->GetNode().EndOfSectionNode(); + aPaM.Move( fnMoveBackward, fnGoCntnt ); + xRet = SwXTextRange::CreateXTextRange(*pSectionFmt->GetDoc(), + *aPaM.GetMark(), aPaM.GetPoint()); + } return xRet; } + /*-- 15.01.99 15:46:48--------------------------------------------------- -----------------------------------------------------------------------*/ void lcl_RemoveChildSections(SwSectionFmt& rParentFmt) { SwSections aTmpArr; - SwDoc* pDoc = rParentFmt.GetDoc(); - sal_uInt16 nCnt = rParentFmt.GetChildSections(aTmpArr,SORTSECT_POS); + SwDoc *const pDoc = rParentFmt.GetDoc(); + const sal_uInt16 nCnt = rParentFmt.GetChildSections(aTmpArr, SORTSECT_POS); if( nCnt ) { for( sal_uInt16 n = 0; n < nCnt; ++n ) + { if( aTmpArr[n]->GetFmt()->IsInNodesArr() ) { SwSectionFmt* pFmt = aTmpArr[n]->GetFmt(); lcl_RemoveChildSections(*pFmt); pDoc->DelSectionFmt( pFmt ); } + } } } -void SwXDocumentIndex::dispose(void) throw( uno::RuntimeException ) + +void SAL_CALL SwXDocumentIndex::dispose() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - if(GetRegisteredIn()) + + SwSectionFmt *const pSectionFmt( m_pImpl->GetSectionFmt() ); + if (pSectionFmt) { - SwSectionFmt* pSectFmt = GetFmt(); - pSectFmt->GetDoc()->DeleteTOX( *(SwTOXBaseSection*)pSectFmt->GetSection(), sal_True); + pSectionFmt->GetDoc()->DeleteTOX( + *static_cast(pSectionFmt->GetSection()), + sal_True); } - else - throw uno::RuntimeException(); } + /*-- 15.01.99 15:46:49--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXDocumentIndex::addEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException ) +void SAL_CALL +SwXDocumentIndex::addEventListener( + const uno::Reference< lang::XEventListener > & xListener) +throw (uno::RuntimeException) { - if(!GetRegisteredIn()) + vos::OGuard g(Application::GetSolarMutex()); + + if (!m_pImpl->GetRegisteredIn()) + { throw uno::RuntimeException(); - aLstnrCntnr.AddListener(aListener); + } + m_pImpl->m_ListenerContainer.AddListener(xListener); } /*-- 15.01.99 15:46:54--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXDocumentIndex::removeEventListener(const uno::Reference< lang::XEventListener > & aListener) throw( uno::RuntimeException ) +void SAL_CALL +SwXDocumentIndex::removeEventListener( + const uno::Reference< lang::XEventListener > & xListener) +throw (uno::RuntimeException) { - if(!GetRegisteredIn() || !aLstnrCntnr.RemoveListener(aListener)) + vos::OGuard g(Application::GetSolarMutex()); + + if (!m_pImpl->GetRegisteredIn() || + !m_pImpl->m_ListenerContainer.RemoveListener(xListener)) + { throw uno::RuntimeException(); + } } + /* -----------------30.07.99 11:28------------------- --------------------------------------------------*/ -OUString SwXDocumentIndex::getName(void) throw( uno::RuntimeException ) +OUString SAL_CALL SwXDocumentIndex::getName() throw (uno::RuntimeException) { - SwSectionFmt* pSectionFmt = GetFmt(); + vos::OGuard g(Application::GetSolarMutex()); + OUString uRet; - if(bIsDescriptor) + SwSectionFmt *const pSectionFmt( m_pImpl->GetSectionFmt() ); + if (m_pImpl->m_bIsDescriptor) { - uRet = OUString(pProps->GetTOXBase().GetTOXName()); + uRet = OUString(m_pImpl->m_pProps->GetTOXBase().GetTOXName()); } else if(pSectionFmt) { uRet = OUString(pSectionFmt->GetSection()->GetName()); } else + { throw uno::RuntimeException(); + } return uRet; } /* -----------------30.07.99 11:28------------------- --------------------------------------------------*/ -void SwXDocumentIndex::setName(const OUString& rName) throw( uno::RuntimeException ) +void SAL_CALL +SwXDocumentIndex::setName(const OUString& rName) throw (uno::RuntimeException) { - SwSectionFmt* pSectionFmt = GetFmt(); - String sNewName(rName); - sal_Bool bExcept = sal_False; - if(!sNewName.Len()) - bExcept = sal_True; - if(bIsDescriptor) + vos::OGuard g(Application::GetSolarMutex()); + + if (!rName.getLength()) { - pProps->GetTOXBase().SetTOXName(sNewName); + throw uno::RuntimeException(); } - else if(!pSectionFmt || - !pSectionFmt->GetDoc()->SetTOXBaseName( - *(SwTOXBaseSection*)pSectionFmt->GetSection(), sNewName)) - bExcept = sal_True; - if(bExcept) + SwSectionFmt *const pSectionFmt( m_pImpl->GetSectionFmt() ); + if (m_pImpl->m_bIsDescriptor) + { + m_pImpl->m_pProps->GetTOXBase().SetTOXName(rName); + } + else if (pSectionFmt) + { + const bool bSuccess = pSectionFmt->GetDoc()->SetTOXBaseName( + *static_cast(pSectionFmt->GetSection()), rName); + if (!bSuccess) + { + throw uno::RuntimeException(); + } + } + else + { throw uno::RuntimeException(); + } } /****************************************************************** @@ -2018,7 +2280,6 @@ uno::Any SwXDocumentIndexes::getByIndex(sal_Int32 nIndex) if(!IsValid()) throw uno::RuntimeException(); - uno::Any aRet; sal_Int32 nIdx = 0; const SwSectionFmts& rFmts = GetDoc()->GetSections(); @@ -2029,9 +2290,11 @@ uno::Any SwXDocumentIndexes::getByIndex(sal_Int32 nIndex) pSect->GetFmt()->GetSectionNode() && nIdx++ == nIndex ) { - uno::Reference< text::XDocumentIndex > xTmp = new SwXDocumentIndex( - (SwTOXBaseSection*)pSect, GetDoc() ); - aRet.setValue(&xTmp, ::getCppuType((uno::Reference*)0)); + const uno::Reference< text::XDocumentIndex > xTmp = + SwXDocumentIndex::CreateXDocumentIndex( + *GetDoc(), static_cast(*pSect)); + uno::Any aRet; + aRet <<= xTmp; return aRet; } } @@ -2049,7 +2312,6 @@ uno::Any SwXDocumentIndexes::getByName(const OUString& rName) if(!IsValid()) throw uno::RuntimeException(); - uno::Any aRet; String sToFind(rName); const SwSectionFmts& rFmts = GetDoc()->GetSections(); @@ -2060,9 +2322,11 @@ uno::Any SwXDocumentIndexes::getByName(const OUString& rName) pSect->GetFmt()->GetSectionNode() && ((SwTOXBaseSection*)pSect)->GetTOXName() == sToFind) { - uno::Reference< text::XDocumentIndex > xTmp = new SwXDocumentIndex( - (SwTOXBaseSection*)pSect, GetDoc() ); - aRet.setValue(&xTmp, ::getCppuType((uno::Reference*)0)); + const uno::Reference< text::XDocumentIndex > xTmp = + SwXDocumentIndex::CreateXDocumentIndex( + *GetDoc(), static_cast(*pSect)); + uno::Any aRet; + aRet <<= xTmp; return aRet; } } @@ -2145,17 +2409,6 @@ sal_Bool SwXDocumentIndexes::hasElements(void) throw( uno::RuntimeException ) return 0 != getCount(); } -SwXDocumentIndex* SwXDocumentIndexes::GetObject(const SwTOXBaseSection* pTOX) -{ - SwSectionFmt* pFmt = pTOX->GetFmt(); - SwClientIter aIter(*pFmt); - SwXDocumentIndex* pxIdx = (SwXDocumentIndex*)aIter.First(TYPE(SwXDocumentIndex)); - if(pxIdx) - return pxIdx; - else - return new SwXDocumentIndex(pTOX, pFmt->GetDoc()); -} - /* -----------------------------06.04.00 15:08-------------------------------- ---------------------------------------------------------------------------*/ @@ -2187,16 +2440,12 @@ SwXIndexStyleAccess_Impl::SwXIndexStyleAccess_Impl(SwXDocumentIndex& rParentIdx) rParent(rParentIdx), xParent(&rParentIdx) { - vos::OGuard aGuard(Application::GetSolarMutex()); - rParent.SetStyleAccess(this); } /*-- 13.09.99 16:52:29--------------------------------------------------- -----------------------------------------------------------------------*/ SwXIndexStyleAccess_Impl::~SwXIndexStyleAccess_Impl() { - vos::OGuard aGuard(Application::GetSolarMutex()); - rParent.SetStyleAccess(0); } /*-- 13.09.99 16:52:29--------------------------------------------------- @@ -2206,14 +2455,13 @@ void SwXIndexStyleAccess_Impl::replaceByIndex(sal_Int32 nIndex, const uno::Any& lang::WrappedTargetException, uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - const sal_Bool bDescriptor = rParent.IsDescriptor(); - SwSectionFmt* pSectFmt = rParent.GetFmt(); - if(!pSectFmt && !bDescriptor) - throw uno::RuntimeException(); + if(nIndex < 0 || nIndex > MAXLEVEL) + { throw lang::IndexOutOfBoundsException(); - SwTOXBase* pTOXBase = bDescriptor ? &rParent.GetProperties_Impl()->GetTOXBase() : - (SwTOXBaseSection*)pSectFmt->GetSection(); + } + + SwTOXBase * pTOXBase( &rParent.m_pImpl->GetTOXSectionOrThrow() ); uno::Sequence aSeq; if(!(rElement >>= aSeq)) @@ -2247,14 +2495,13 @@ uno::Any SwXIndexStyleAccess_Impl::getByIndex(sal_Int32 nIndex) uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - const sal_Bool bDescriptor = rParent.IsDescriptor(); - SwSectionFmt* pSectFmt = rParent.GetFmt(); - if(!pSectFmt && !bDescriptor) - throw uno::RuntimeException(); + if(nIndex < 0 || nIndex > MAXLEVEL) + { throw lang::IndexOutOfBoundsException(); - SwTOXBase* pTOXBase = bDescriptor ? &rParent.GetProperties_Impl()->GetTOXBase() : - (SwTOXBaseSection*)pSectFmt->GetSection(); + } + + SwTOXBase * pTOXBase( &rParent.m_pImpl->GetTOXSectionOrThrow() ); const String& rStyles = pTOXBase->GetStyleNames((sal_uInt16) nIndex); sal_uInt16 nStyles = rStyles.GetTokenCount(TOX_STYLE_DELIMITER); @@ -2322,18 +2569,14 @@ uno::Sequence< OUString > SwXIndexTokenAccess_Impl::getSupportedServiceNames(voi SwXIndexTokenAccess_Impl::SwXIndexTokenAccess_Impl(SwXDocumentIndex& rParentIdx) : rParent(rParentIdx), xParent(&rParentIdx), - nCount(SwForm::GetFormMaxLevel(rParent.GetTOXType())) + nCount(0) { - vos::OGuard aGuard(Application::GetSolarMutex()); - rParent.SetTokenAccess(this); } /*-- 13.09.99 16:52:29--------------------------------------------------- -----------------------------------------------------------------------*/ SwXIndexTokenAccess_Impl::~SwXIndexTokenAccess_Impl() { - vos::OGuard aGuard(Application::GetSolarMutex()); - rParent.SetTokenAccess(0); } /*-- 13.09.99 16:52:29--------------------------------------------------- @@ -2343,13 +2586,9 @@ void SwXIndexTokenAccess_Impl::replaceByIndex(sal_Int32 nIndex, const uno::Any& lang::WrappedTargetException, uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - const sal_Bool bDescriptor = rParent.IsDescriptor(); - SwSectionFmt* pSectFmt = rParent.GetFmt(); - if(!pSectFmt && !bDescriptor) - throw uno::RuntimeException(); - SwTOXBase* pTOXBase = bDescriptor ? &rParent.GetProperties_Impl()->GetTOXBase() : - (SwTOXBaseSection*)pSectFmt->GetSection(); + SwTOXBase * pTOXBase( &rParent.m_pImpl->GetTOXSectionOrThrow() ); + if(nIndex < 0 || (nIndex > pTOXBase->GetTOXForm().GetFormMax())) throw lang::IndexOutOfBoundsException(); @@ -2358,6 +2597,7 @@ void SwXIndexTokenAccess_Impl::replaceByIndex(sal_Int32 nIndex, const uno::Any& if(!(rElement >>= aSeq)) throw lang::IllegalArgumentException(); + String sPattern; sal_Int32 nTokens = aSeq.getLength(); const beans::PropertyValues* pTokens = aSeq.getConstArray(); @@ -2519,14 +2759,8 @@ void SwXIndexTokenAccess_Impl::replaceByIndex(sal_Int32 nIndex, const uno::Any& sal_Int32 SwXIndexTokenAccess_Impl::getCount(void) throw( uno::RuntimeException ) { vos::OGuard aGuard(Application::GetSolarMutex()); - const sal_Bool bDescriptor = rParent.IsDescriptor(); - SwSectionFmt* pSectFmt = rParent.GetFmt(); - if(!pSectFmt && !bDescriptor) - throw uno::RuntimeException(); - sal_Int32 nRet = bDescriptor ? - nCount : - ((SwTOXBaseSection*)pSectFmt->GetSection())-> - GetTOXForm().GetFormMax(); + + const sal_Int32 nRet = rParent.m_pImpl->GetFormMax(); return nRet; } /*-- 13.09.99 16:52:30--------------------------------------------------- @@ -2537,12 +2771,9 @@ uno::Any SwXIndexTokenAccess_Impl::getByIndex(sal_Int32 nIndex) uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - const sal_Bool bDescriptor = rParent.IsDescriptor(); - SwSectionFmt* pSectFmt = rParent.GetFmt(); - if(!pSectFmt && !bDescriptor) - throw uno::RuntimeException(); - SwTOXBase* pTOXBase = bDescriptor ? &rParent.GetProperties_Impl()->GetTOXBase() : - (SwTOXBaseSection*)pSectFmt->GetSection(); + + SwTOXBase * pTOXBase( &rParent.m_pImpl->GetTOXSectionOrThrow() ); + if(nIndex < 0 || (nIndex > pTOXBase->GetTOXForm().GetFormMax())) throw lang::IndexOutOfBoundsException(); diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx index 907a2a617c9b..6eeb9757e47a 100644 --- a/sw/source/core/unocore/unosect.cxx +++ b/sw/source/core/unocore/unosect.cxx @@ -1169,7 +1169,8 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, SwTOXBaseSection *const pTOXBaseSect = PTR_CAST(SwTOXBaseSection, pEnclosingSection); const uno::Reference xIndex = - SwXDocumentIndexes::GetObject(pTOXBaseSect); + SwXDocumentIndex::CreateXDocumentIndex( + *pTOXBaseSect->GetFmt()->GetDoc(), *pTOXBaseSect); pRet[nProperty] <<= xIndex; } // else: no enclosing index found -> empty return value -- cgit v1.2.3 From 342e7b53a498adba704d9c177db58cdf3cf0733f Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:58 +0100 Subject: swunolocking1: #i105557#: move SwXDocumentIndex helper classes out of header. use new XUnoTunnel and XServiceInfo helpers. clean up the implementation a little. --- sw/inc/unoidx.hxx | 80 +----- sw/source/core/unocore/unoidx.cxx | 549 ++++++++++++++++++++++++++------------ 2 files changed, 381 insertions(+), 248 deletions(-) diff --git a/sw/inc/unoidx.hxx b/sw/inc/unoidx.hxx index f82e2c9984d2..f3462a17bebb 100644 --- a/sw/inc/unoidx.hxx +++ b/sw/inc/unoidx.hxx @@ -32,9 +32,7 @@ #include #include -#include #include -#include #include #include @@ -53,8 +51,6 @@ class SwTOXType; /* -----------------07.12.98 10:08------------------- * * --------------------------------------------------*/ -class SwXIndexStyleAccess_Impl; -class SwXIndexTokenAccess_Impl; typedef ::cppu::WeakImplHelper5 < ::com::sun::star::lang::XUnoTunnel @@ -70,8 +66,8 @@ class SwXDocumentIndex private: - friend class SwXIndexStyleAccess_Impl; - friend class SwXIndexTokenAccess_Impl; + class StyleAccess_Impl; + class TokenAccess_Impl; class Impl; ::sw::UnoImplPtr m_pImpl; @@ -316,79 +312,7 @@ public: virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); -}; -/* -----------------13.09.99 16:39------------------- - - --------------------------------------------------*/ -class SwXIndexStyleAccess_Impl : public cppu::WeakImplHelper2 -< - ::com::sun::star::container::XIndexReplace, - ::com::sun::star::lang::XServiceInfo -> -{ - SwXDocumentIndex& rParent; - ::com::sun::star::uno::Reference< ::com::sun::star::text::XDocumentIndex > xParent; -protected: - virtual ~SwXIndexStyleAccess_Impl(); -public: - SwXIndexStyleAccess_Impl(SwXDocumentIndex& rParentIdx); - - - //XIndexReplace - virtual void SAL_CALL replaceByIndex( sal_Int32 Index, const ::com::sun::star::uno::Any& Element ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - - //XIndexAccess - virtual sal_Int32 SAL_CALL getCount(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); - - //XElementAccess - virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); - - //XServiceInfo - virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); - -}; - -/* -----------------13.09.99 16:39------------------- - - --------------------------------------------------*/ -class SwXIndexTokenAccess_Impl : public cppu::WeakImplHelper2 -< - ::com::sun::star::container::XIndexReplace, - ::com::sun::star::lang::XServiceInfo -> -{ - SwXDocumentIndex& rParent; - ::com::sun::star::uno::Reference< ::com::sun::star::text::XDocumentIndex > xParent; - sal_Int32 nCount; -protected: - virtual ~SwXIndexTokenAccess_Impl(); -public: - SwXIndexTokenAccess_Impl(SwXDocumentIndex& rParentIdx); - - - - //XIndexReplace - virtual void SAL_CALL replaceByIndex( sal_Int32 Index, const ::com::sun::star::uno::Any& Element ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - - //XIndexAccess - virtual sal_Int32 SAL_CALL getCount(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); - - //XElementAccess - virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); - - //XServiceInfo - virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); - }; #endif - diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index d860cedd3fb7..4c55e3e1963f 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -31,12 +31,13 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" +#include +#include +#include #include #include #include -#include #include -#include #include #include @@ -75,7 +76,7 @@ using namespace ::com::sun::star; using ::rtl::OUString; //----------------------------------------------------------------------------- -static String +static OUString lcl_AnyToString(uno::Any const& rVal) throw (lang::IllegalArgumentException) { OUString sRet; @@ -190,6 +191,104 @@ lcl_ConvertTOUNameToUserName(OUString& rTmp) } } +/* -----------------13.09.99 16:39------------------- + + --------------------------------------------------*/ +typedef ::cppu::WeakImplHelper2 +< lang::XServiceInfo +, container::XIndexReplace +> SwXDocumentIndexStyleAccess_Base; + +class SwXDocumentIndex::StyleAccess_Impl + : public SwXDocumentIndexStyleAccess_Base +{ + +private: + /// can be destroyed threadsafely, so no UnoImplPtr here + ::rtl::Reference m_xParent; + + virtual ~StyleAccess_Impl(); + +public: + StyleAccess_Impl(SwXDocumentIndex& rParentIdx); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw (uno::RuntimeException); + virtual sal_Bool SAL_CALL + supportsService(const ::rtl::OUString& rServiceName) + throw (uno::RuntimeException); + virtual uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames() throw (uno::RuntimeException); + + // XElementAccess + virtual uno::Type SAL_CALL getElementType() throw (uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements() throw (uno::RuntimeException); + + // XIndexAccess + virtual sal_Int32 SAL_CALL getCount() throw (uno::RuntimeException); + virtual uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) + throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, + uno::RuntimeException); + + // XIndexReplace + virtual void SAL_CALL + replaceByIndex(sal_Int32 Index, const uno::Any& rElement) + throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException, + lang::WrappedTargetException, uno::RuntimeException); + +}; + +/* -----------------13.09.99 16:39------------------- + + --------------------------------------------------*/ +typedef ::cppu::WeakImplHelper2 +< lang::XServiceInfo +, container::XIndexReplace +> SwXDocumentIndexTokenAccess_Base; + +class SwXDocumentIndex::TokenAccess_Impl + : public SwXDocumentIndexTokenAccess_Base +{ + +private: + /// can be destroyed threadsafely, so no UnoImplPtr here + ::rtl::Reference m_xParent; + + virtual ~TokenAccess_Impl(); + +public: + + TokenAccess_Impl(SwXDocumentIndex& rParentIdx); + + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw (uno::RuntimeException); + virtual sal_Bool SAL_CALL + supportsService(const ::rtl::OUString& rServiceName) + throw (uno::RuntimeException); + virtual uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames() throw (uno::RuntimeException); + + // XElementAccess + virtual uno::Type SAL_CALL getElementType() throw (uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements() throw (uno::RuntimeException); + + // XIndexAccess + virtual sal_Int32 SAL_CALL getCount() throw (uno::RuntimeException); + virtual uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) + throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, + uno::RuntimeException); + + // XIndexReplace + virtual void SAL_CALL + replaceByIndex(sal_Int32 Index, const uno::Any& rElement) + throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException, + lang::WrappedTargetException, uno::RuntimeException); + +}; + + /****************************************************************** * SwXDocumentIndex ******************************************************************/ @@ -1035,7 +1134,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, m_pImpl->m_wTokenAccess); if (!xTokenAccess.is()) { - xTokenAccess = new SwXIndexTokenAccess_Impl(*this); + xTokenAccess = new TokenAccess_Impl(*this); m_pImpl->m_wTokenAccess = xTokenAccess; } aRet <<= xTokenAccess; @@ -1047,7 +1146,7 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, m_pImpl->m_wStyleAccess); if (!xStyleAccess.is()) { - xStyleAccess = new SwXIndexStyleAccess_Impl(*this); + xStyleAccess = new StyleAccess_Impl(*this); m_pImpl->m_wStyleAccess = xStyleAccess; } aRet <<= xStyleAccess; @@ -2409,49 +2508,66 @@ sal_Bool SwXDocumentIndexes::hasElements(void) throw( uno::RuntimeException ) return 0 != getCount(); } -/* -----------------------------06.04.00 15:08-------------------------------- +/****************************************************************** + * SwXDocumentIndex::StyleAccess_Impl + ******************************************************************/ - ---------------------------------------------------------------------------*/ -OUString SwXIndexStyleAccess_Impl::getImplementationName(void) throw( uno::RuntimeException ) +/*-- 13.09.99 16:52:28--------------------------------------------------- + + -----------------------------------------------------------------------*/ +SwXDocumentIndex::StyleAccess_Impl::StyleAccess_Impl( + SwXDocumentIndex& rParentIdx) + : m_xParent(&rParentIdx) { - return C2U("SwXIndexStyleAccess_Impl"); } -/* -----------------------------06.04.00 15:08-------------------------------- +/*-- 13.09.99 16:52:29--------------------------------------------------- - ---------------------------------------------------------------------------*/ -BOOL SwXIndexStyleAccess_Impl::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) + -----------------------------------------------------------------------*/ +SwXDocumentIndex::StyleAccess_Impl::~StyleAccess_Impl() { - return C2U("com.sun.star.text.DocumentIndexParagraphStyles") == rServiceName; } + /* -----------------------------06.04.00 15:08-------------------------------- ---------------------------------------------------------------------------*/ -uno::Sequence< OUString > SwXIndexStyleAccess_Impl::getSupportedServiceNames(void) throw( uno::RuntimeException ) +OUString SAL_CALL +SwXDocumentIndex::StyleAccess_Impl::getImplementationName() +throw (uno::RuntimeException) { - uno::Sequence< OUString > aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = C2U("com.sun.star.text.DocumentIndexParagraphStyles"); - return aRet; + return C2U("SwXDocumentIndex::StyleAccess_Impl"); } -/*-- 13.09.99 16:52:28--------------------------------------------------- - -----------------------------------------------------------------------*/ -SwXIndexStyleAccess_Impl::SwXIndexStyleAccess_Impl(SwXDocumentIndex& rParentIdx) : - rParent(rParentIdx), - xParent(&rParentIdx) +static char const*const g_ServicesIndexStyleAccess[] = { + "com.sun.star.text.DocumentIndexParagraphStyles", +}; +static const size_t g_nServicesIndexStyleAccess( + sizeof(g_ServicesIndexStyleAccess)/sizeof(g_ServicesIndexStyleAccess[0])); + +sal_Bool SAL_CALL +SwXDocumentIndex::StyleAccess_Impl::supportsService( + const OUString& rServiceName) +throw (uno::RuntimeException) +{ + return ::sw::SupportsServiceImpl( + g_nServicesIndexStyleAccess, g_ServicesIndexStyleAccess, rServiceName); } -/*-- 13.09.99 16:52:29--------------------------------------------------- - -----------------------------------------------------------------------*/ -SwXIndexStyleAccess_Impl::~SwXIndexStyleAccess_Impl() +uno::Sequence< OUString > SAL_CALL +SwXDocumentIndex::StyleAccess_Impl::getSupportedServiceNames() +throw (uno::RuntimeException) { + return ::sw::GetSupportedServiceNamesImpl( + g_nServicesIndexStyleAccess, g_ServicesIndexStyleAccess); } + /*-- 13.09.99 16:52:29--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXIndexStyleAccess_Impl::replaceByIndex(sal_Int32 nIndex, const uno::Any& rElement) - throw( lang::IllegalArgumentException, lang::IndexOutOfBoundsException, +void SAL_CALL +SwXDocumentIndex::StyleAccess_Impl::replaceByIndex( + sal_Int32 nIndex, const uno::Any& rElement) +throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -2461,38 +2577,45 @@ void SwXIndexStyleAccess_Impl::replaceByIndex(sal_Int32 nIndex, const uno::Any& throw lang::IndexOutOfBoundsException(); } - SwTOXBase * pTOXBase( &rParent.m_pImpl->GetTOXSectionOrThrow() ); + SwTOXBase & rTOXBase( m_xParent->m_pImpl->GetTOXSectionOrThrow() ); uno::Sequence aSeq; if(!(rElement >>= aSeq)) + { throw lang::IllegalArgumentException(); + } - sal_Int32 nStyles = aSeq.getLength(); + const sal_Int32 nStyles = aSeq.getLength(); const OUString* pStyles = aSeq.getConstArray(); String sSetStyles; String aString; for(sal_Int32 i = 0; i < nStyles; i++) { if(i) + { sSetStyles += TOX_STYLE_DELIMITER; - SwStyleNameMapper::FillUIName(pStyles[i], aString, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, sal_True); + } + SwStyleNameMapper::FillUIName(pStyles[i], aString, + nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, sal_True); sSetStyles += aString; } - pTOXBase->SetStyleNames(sSetStyles, (sal_uInt16) nIndex); + rTOXBase.SetStyleNames(sSetStyles, static_cast(nIndex)); } /*-- 13.09.99 16:52:29--------------------------------------------------- -----------------------------------------------------------------------*/ -sal_Int32 SwXIndexStyleAccess_Impl::getCount(void) throw( uno::RuntimeException ) +sal_Int32 SAL_CALL +SwXDocumentIndex::StyleAccess_Impl::getCount() throw (uno::RuntimeException) { return MAXLEVEL; } /*-- 13.09.99 16:52:30--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Any SwXIndexStyleAccess_Impl::getByIndex(sal_Int32 nIndex) - throw( lang::IndexOutOfBoundsException, lang::WrappedTargetException, - uno::RuntimeException) +uno::Any SAL_CALL +SwXDocumentIndex::StyleAccess_Impl::getByIndex(sal_Int32 nIndex) +throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, + uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); @@ -2501,10 +2624,11 @@ uno::Any SwXIndexStyleAccess_Impl::getByIndex(sal_Int32 nIndex) throw lang::IndexOutOfBoundsException(); } - SwTOXBase * pTOXBase( &rParent.m_pImpl->GetTOXSectionOrThrow() ); + SwTOXBase & rTOXBase( m_xParent->m_pImpl->GetTOXSectionOrThrow() ); - const String& rStyles = pTOXBase->GetStyleNames((sal_uInt16) nIndex); - sal_uInt16 nStyles = rStyles.GetTokenCount(TOX_STYLE_DELIMITER); + const String& rStyles = + rTOXBase.GetStyleNames(static_cast(nIndex)); + const sal_uInt16 nStyles = rStyles.GetTokenCount(TOX_STYLE_DELIMITER); uno::Sequence aStyles(nStyles); OUString* pStyles = aStyles.getArray(); String aString; @@ -2523,116 +2647,143 @@ uno::Any SwXIndexStyleAccess_Impl::getByIndex(sal_Int32 nIndex) /*-- 13.09.99 16:52:30--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Type SwXIndexStyleAccess_Impl::getElementType(void) - throw( uno::RuntimeException ) +uno::Type SAL_CALL +SwXDocumentIndex::StyleAccess_Impl::getElementType() +throw (uno::RuntimeException) { return ::getCppuType((uno::Sequence*)0); } /*-- 13.09.99 16:52:30--------------------------------------------------- -----------------------------------------------------------------------*/ -sal_Bool SwXIndexStyleAccess_Impl::hasElements(void) throw( uno::RuntimeException ) +sal_Bool SAL_CALL +SwXDocumentIndex::StyleAccess_Impl::hasElements() throw (uno::RuntimeException) { return sal_True; } -/* -----------------13.09.99 16:51------------------- - - --------------------------------------------------*/ -/* -----------------------------06.04.00 15:08-------------------------------- +/****************************************************************** + * SwXDocumentIndex::TokenAccess_Impl + ******************************************************************/ +/*-- 13.09.99 16:52:28--------------------------------------------------- - ---------------------------------------------------------------------------*/ -OUString SwXIndexTokenAccess_Impl::getImplementationName(void) throw( uno::RuntimeException ) + -----------------------------------------------------------------------*/ +SwXDocumentIndex::TokenAccess_Impl::TokenAccess_Impl( + SwXDocumentIndex& rParentIdx) + : m_xParent(&rParentIdx) { - return C2U("SwXIndexTokenAccess_Impl"); } -/* -----------------------------06.04.00 15:08-------------------------------- +/*-- 13.09.99 16:52:29--------------------------------------------------- - ---------------------------------------------------------------------------*/ -BOOL SwXIndexTokenAccess_Impl::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) + -----------------------------------------------------------------------*/ +SwXDocumentIndex::TokenAccess_Impl::~TokenAccess_Impl() { - return C2U("com.sun.star.text.DocumentIndexLevelFormat") == rServiceName; } + /* -----------------------------06.04.00 15:08-------------------------------- ---------------------------------------------------------------------------*/ -uno::Sequence< OUString > SwXIndexTokenAccess_Impl::getSupportedServiceNames(void) throw( uno::RuntimeException ) +OUString SAL_CALL +SwXDocumentIndex::TokenAccess_Impl::getImplementationName() +throw (uno::RuntimeException) { - uno::Sequence< OUString > aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = C2U("com.sun.star.text.DocumentIndexLevelFormat"); - return aRet; + return C2U("SwXDocumentIndex::TokenAccess_Impl"); } -/*-- 13.09.99 16:52:28--------------------------------------------------- - -----------------------------------------------------------------------*/ -SwXIndexTokenAccess_Impl::SwXIndexTokenAccess_Impl(SwXDocumentIndex& rParentIdx) : - rParent(rParentIdx), - xParent(&rParentIdx), - nCount(0) +static char const*const g_ServicesIndexTokenAccess[] = +{ + "com.sun.star.text.DocumentIndexLevelFormat", +}; +static const size_t g_nServicesIndexTokenAccess( + sizeof(g_ServicesIndexTokenAccess)/sizeof(g_ServicesIndexTokenAccess[0])); + +sal_Bool SAL_CALL +SwXDocumentIndex::TokenAccess_Impl::supportsService( + const OUString& rServiceName) +throw (uno::RuntimeException) { + return ::sw::SupportsServiceImpl( + g_nServicesIndexTokenAccess, g_ServicesIndexTokenAccess, rServiceName); } -/*-- 13.09.99 16:52:29--------------------------------------------------- - -----------------------------------------------------------------------*/ -SwXIndexTokenAccess_Impl::~SwXIndexTokenAccess_Impl() +uno::Sequence< OUString > SAL_CALL +SwXDocumentIndex::TokenAccess_Impl::getSupportedServiceNames() +throw (uno::RuntimeException) { + return ::sw::GetSupportedServiceNamesImpl( + g_nServicesIndexTokenAccess, g_ServicesIndexTokenAccess); } + +struct TokenType { + const char *pName; + const enum FormTokenType eTokenType; +}; + +static const struct TokenType g_TokenTypes[] = +{ + { "TokenEntryNumber", TOKEN_ENTRY_NO }, + { "TokenEntryText", TOKEN_ENTRY_TEXT }, + { "TokenTabStop", TOKEN_TAB_STOP }, + { "TokenText", TOKEN_TEXT }, + { "TokenPageNumber", TOKEN_PAGE_NUMS }, + { "TokenChapterInfo", TOKEN_CHAPTER_INFO }, + { "TokenHyperlinkStart", TOKEN_LINK_START }, + { "TokenHyperlinkEnd", TOKEN_LINK_END }, + { "TokenBibliographyDataField", TOKEN_AUTHORITY }, + { 0, static_cast(0) } +}; + /*-- 13.09.99 16:52:29--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXIndexTokenAccess_Impl::replaceByIndex(sal_Int32 nIndex, const uno::Any& rElement) - throw( lang::IllegalArgumentException, lang::IndexOutOfBoundsException, - lang::WrappedTargetException, uno::RuntimeException) +void SAL_CALL +SwXDocumentIndex::TokenAccess_Impl::replaceByIndex( + sal_Int32 nIndex, const uno::Any& rElement) +throw (lang::IllegalArgumentException, lang::IndexOutOfBoundsException, + lang::WrappedTargetException, uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - SwTOXBase * pTOXBase( &rParent.m_pImpl->GetTOXSectionOrThrow() ); + SwTOXBase & rTOXBase( m_xParent->m_pImpl->GetTOXSectionOrThrow() ); - if(nIndex < 0 || - (nIndex > pTOXBase->GetTOXForm().GetFormMax())) - throw lang::IndexOutOfBoundsException(); + if ((nIndex < 0) || (nIndex > rTOXBase.GetTOXForm().GetFormMax())) + { + throw lang::IndexOutOfBoundsException(); + } uno::Sequence aSeq; if(!(rElement >>= aSeq)) + { throw lang::IllegalArgumentException(); - + } String sPattern; - sal_Int32 nTokens = aSeq.getLength(); + const sal_Int32 nTokens = aSeq.getLength(); const beans::PropertyValues* pTokens = aSeq.getConstArray(); for(sal_Int32 i = 0; i < nTokens; i++) { const beans::PropertyValue* pProperties = pTokens[i].getConstArray(); - sal_Int32 nProperties = pTokens[i].getLength(); + const sal_Int32 nProperties = pTokens[i].getLength(); //create an invalid token SwFormToken aToken(TOKEN_END); for(sal_Int32 j = 0; j < nProperties; j++) { - if( COMPARE_EQUAL == pProperties[j].Name.compareToAscii("TokenType")) + if (pProperties[j].Name.equalsAscii("TokenType")) { - const String sTokenType = + const OUString sTokenType = lcl_AnyToString(pProperties[j].Value); - if(sTokenType.EqualsAscii("TokenEntryNumber")) - aToken.eTokenType = TOKEN_ENTRY_NO; - else if(sTokenType.EqualsAscii("TokenEntryText" )) - aToken.eTokenType = TOKEN_ENTRY_TEXT; - else if(sTokenType.EqualsAscii("TokenTabStop" )) - aToken.eTokenType = TOKEN_TAB_STOP; - else if(sTokenType.EqualsAscii("TokenText" )) - aToken.eTokenType = TOKEN_TEXT; - else if(sTokenType.EqualsAscii("TokenPageNumber")) - aToken.eTokenType = TOKEN_PAGE_NUMS; - else if(sTokenType.EqualsAscii("TokenChapterInfo" )) - aToken.eTokenType = TOKEN_CHAPTER_INFO; - else if(sTokenType.EqualsAscii("TokenHyperlinkStart" )) - aToken.eTokenType = TOKEN_LINK_START; - else if(sTokenType.EqualsAscii("TokenHyperlinkEnd")) - aToken.eTokenType = TOKEN_LINK_END; - else if(sTokenType.EqualsAscii("TokenBibliographyDataField" )) - aToken.eTokenType = TOKEN_AUTHORITY; + for (TokenType const* pTokenType = g_TokenTypes; + pTokenType->pName; ++pTokenType) + { + if (sTokenType.equalsAscii(pTokenType->pName)) + { + aToken.eTokenType = pTokenType->eTokenType; + break; + } + } } - else if( pProperties[j].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("CharacterStyleName" ) )) + else if (pProperties[j].Name.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("CharacterStyleName"))) { String sCharStyleName; SwStyleNameMapper::FillUIName( @@ -2642,54 +2793,68 @@ void SwXIndexTokenAccess_Impl::replaceByIndex(sal_Int32 nIndex, const uno::Any& sal_True); aToken.sCharStyleName = sCharStyleName; aToken.nPoolId = SwStyleNameMapper::GetPoolIdFromUIName ( - sCharStyleName, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT ); + sCharStyleName, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT ); } - else if( pProperties[j].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("TabStopRightAligned") )) + else if (pProperties[j].Name.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("TabStopRightAligned"))) { - sal_Bool bRight = lcl_AnyToBool(pProperties[j].Value); + const sal_Bool bRight = lcl_AnyToBool(pProperties[j].Value); aToken.eTabAlign = bRight ? SVX_TAB_ADJUST_END : SVX_TAB_ADJUST_LEFT; } - else if( pProperties[j].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("TabStopPosition" ))) + else if (pProperties[j].Name.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("TabStopPosition"))) { sal_Int32 nPosition = 0; - if(pProperties[j].Value.getValueType() != ::getCppuType((sal_Int32*)0)) + if (!(pProperties[j].Value >>= nPosition)) + { throw lang::IllegalArgumentException(); - pProperties[j].Value >>= nPosition; + } nPosition = MM100_TO_TWIP(nPosition); if(nPosition < 0) + { throw lang::IllegalArgumentException(); + } aToken.nTabStopPosition = nPosition; } - else if( pProperties[j].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("TabStopFillCharacter" ))) + else if (pProperties[j].Name.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("TabStopFillCharacter"))) { - const String sFillChar = + const OUString sFillChar = lcl_AnyToString(pProperties[j].Value); - if(sFillChar.Len() > 1) + if (sFillChar.getLength() > 1) + { throw lang::IllegalArgumentException(); - aToken.cTabFillChar = sFillChar.Len() ? - sFillChar.GetChar(0) : ' '; + } + aToken.cTabFillChar = + (sFillChar.getLength()) ? sFillChar[0] : ' '; } - else if( pProperties[j].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Text" ))) + else if (pProperties[j].Name.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("Text"))) { - const String sText = - lcl_AnyToString(pProperties[j].Value); + const OUString sText = lcl_AnyToString(pProperties[j].Value); aToken.sText = sText; } - else if( pProperties[j].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ChapterFormat" ))) + else if (pProperties[j].Name.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ChapterFormat"))) { sal_Int16 nFormat = lcl_AnyToInt16(pProperties[j].Value); switch(nFormat) { - case text::ChapterFormat::NUMBER: nFormat = CF_NUMBER; + case text::ChapterFormat::NUMBER: + nFormat = CF_NUMBER; break; - case text::ChapterFormat::NAME: nFormat = CF_TITLE; + case text::ChapterFormat::NAME: + nFormat = CF_TITLE; break; - case text::ChapterFormat::NAME_NUMBER: nFormat = CF_NUM_TITLE; + case text::ChapterFormat::NAME_NUMBER: + nFormat = CF_NUM_TITLE; break; - case text::ChapterFormat::NO_PREFIX_SUFFIX:nFormat = CF_NUMBER_NOPREPST; + case text::ChapterFormat::NO_PREFIX_SUFFIX: + nFormat = CF_NUMBER_NOPREPST; break; - case text::ChapterFormat::DIGIT: nFormat = CF_NUM_NOPREPST_TITLE; + case text::ChapterFormat::DIGIT: + nFormat = CF_NUM_NOPREPST_TITLE; break; default: throw lang::IllegalArgumentException(); @@ -2697,15 +2862,19 @@ void SwXIndexTokenAccess_Impl::replaceByIndex(sal_Int32 nIndex, const uno::Any& aToken.nChapterFormat = nFormat; } //--->i53420 - else if( pProperties[j].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ChapterLevel")) ) + else if (pProperties[j].Name.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("ChapterLevel"))) { const sal_Int16 nLevel = lcl_AnyToInt16(pProperties[j].Value); if( nLevel < 1 || nLevel > MAXLEVEL ) + { throw lang::IllegalArgumentException(); + } aToken.nOutlineLevel = nLevel; } //<--- - else if( pProperties[j].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("BibliographyDataField"))) + else if (pProperties[j].Name.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("BibliographyDataField"))) { sal_Int16 nType = 0; pProperties[j].Value >>= nType; @@ -2719,7 +2888,8 @@ void SwXIndexTokenAccess_Impl::replaceByIndex(sal_Int32 nIndex, const uno::Any& aToken.nAuthorityField = nType; } // #i21237# - else if ( pProperties[j].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("WithTab"))) + else if (pProperties[j].Name.equalsAsciiL( + RTL_CONSTASCII_STRINGPARAM("WithTab"))) { aToken.bWithTab = lcl_AnyToBool(pProperties[j].Value); } @@ -2727,17 +2897,22 @@ void SwXIndexTokenAccess_Impl::replaceByIndex(sal_Int32 nIndex, const uno::Any& } //exception if wrong TokenType if(TOKEN_END <= aToken.eTokenType ) + { throw lang::IllegalArgumentException(); + } // set TokenType from TOKEN_ENTRY_TEXT to TOKEN_ENTRY if it is // not a content index if(TOKEN_ENTRY_TEXT == aToken.eTokenType && - TOX_CONTENT != pTOXBase->GetType()) + (TOX_CONTENT != rTOXBase.GetType())) + { aToken.eTokenType = TOKEN_ENTRY; + } //---> i53420 // check for chapter format allowed values if it was TOKEN_ENTRY_NO type // only allowed value are CF_NUMBER and CF_NUM_NOPREPST_TITLE // reading from file if( TOKEN_ENTRY_NO == aToken.eTokenType ) + { switch(aToken.nChapterFormat) { case CF_NUMBER: @@ -2746,41 +2921,47 @@ void SwXIndexTokenAccess_Impl::replaceByIndex(sal_Int32 nIndex, const uno::Any& default: throw lang::IllegalArgumentException(); } + } //<--- sPattern += aToken.GetString(); } - SwForm aForm(pTOXBase->GetTOXForm()); - aForm.SetPattern((sal_uInt16) nIndex, sPattern); - pTOXBase->SetTOXForm(aForm); + SwForm aForm(rTOXBase.GetTOXForm()); + aForm.SetPattern(static_cast(nIndex), sPattern); + rTOXBase.SetTOXForm(aForm); } + /*-- 13.09.99 16:52:29--------------------------------------------------- -----------------------------------------------------------------------*/ -sal_Int32 SwXIndexTokenAccess_Impl::getCount(void) throw( uno::RuntimeException ) +sal_Int32 SAL_CALL +SwXDocumentIndex::TokenAccess_Impl::getCount() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - const sal_Int32 nRet = rParent.m_pImpl->GetFormMax(); + const sal_Int32 nRet = m_xParent->m_pImpl->GetFormMax(); return nRet; } + /*-- 13.09.99 16:52:30--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Any SwXIndexTokenAccess_Impl::getByIndex(sal_Int32 nIndex) - throw( lang::IndexOutOfBoundsException, lang::WrappedTargetException, - uno::RuntimeException) +uno::Any SAL_CALL +SwXDocumentIndex::TokenAccess_Impl::getByIndex(sal_Int32 nIndex) +throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, + uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - SwTOXBase * pTOXBase( &rParent.m_pImpl->GetTOXSectionOrThrow() ); + SwTOXBase & rTOXBase( m_xParent->m_pImpl->GetTOXSectionOrThrow() ); - if(nIndex < 0 || - (nIndex > pTOXBase->GetTOXForm().GetFormMax())) + if ((nIndex < 0) || (nIndex > rTOXBase.GetTOXForm().GetFormMax())) + { throw lang::IndexOutOfBoundsException(); + } // #i21237# - SwFormTokens aPattern = pTOXBase->GetTOXForm(). - GetPattern((sal_uInt16) nIndex); + SwFormTokens aPattern = rTOXBase.GetTOXForm(). + GetPattern(static_cast(nIndex)); SwFormTokens::iterator aIt = aPattern.begin(); sal_uInt16 nTokenCount = 0; @@ -2793,7 +2974,8 @@ uno::Any SwXIndexTokenAccess_Impl::getByIndex(sal_Int32 nIndex) beans::PropertyValues* pTokenProps = aRetSeq.getArray(); SwFormToken aToken = *aIt; // #i21237# - uno::Sequence< beans::PropertyValue >& rCurTokenSeq = pTokenProps[nTokenCount-1]; + uno::Sequence< beans::PropertyValue >& rCurTokenSeq = + pTokenProps[nTokenCount-1]; SwStyleNameMapper::FillProgName( aToken.sCharStyleName, aString, @@ -2802,25 +2984,30 @@ uno::Any SwXIndexTokenAccess_Impl::getByIndex(sal_Int32 nIndex) const OUString aProgCharStyle( aString ); switch(aToken.eTokenType) { - case TOKEN_ENTRY_NO : + case TOKEN_ENTRY_NO: { //--->i53420 // writing to file (from doc to properties) sal_Int32 nElements = 2; sal_Int32 nCurrentElement = 0; - if( aToken.nChapterFormat != CF_NUMBER )//check for default value + // check for default value + if (aToken.nChapterFormat != CF_NUMBER) + { nElements++;//we need the element + } if( aToken.nOutlineLevel != MAXLEVEL ) + { nElements++; + } rCurTokenSeq.realloc( nElements ); beans::PropertyValue* pArr = rCurTokenSeq.getArray(); pArr[nCurrentElement].Name = C2U("TokenType"); - pArr[nCurrentElement++].Value <<= OUString::createFromAscii("TokenEntryNumber"); -// pArr[0].Value <<= C2U("TokenEntryNumber"); + pArr[nCurrentElement++].Value <<= + OUString::createFromAscii("TokenEntryNumber"); pArr[nCurrentElement].Name = C2U("CharacterStyleName"); pArr[nCurrentElement++].Value <<= aProgCharStyle; @@ -2828,18 +3015,24 @@ uno::Any SwXIndexTokenAccess_Impl::getByIndex(sal_Int32 nIndex) { pArr[nCurrentElement].Name = C2U("ChapterFormat"); sal_Int16 nVal; -//! the allowed values for chapter format, when used as entry number, are CF_NUMBER and CF_NUM_NOPREPST_TITLE only, all else forced to +// the allowed values for chapter format, when used as entry number, +// are CF_NUMBER and CF_NUM_NOPREPST_TITLE only, all else forced to //CF_NUMBER switch(aToken.nChapterFormat) { default: - case CF_NUMBER: nVal = text::ChapterFormat::NUMBER; break; - case CF_NUM_NOPREPST_TITLE: nVal = text::ChapterFormat::DIGIT; break; + case CF_NUMBER: + nVal = text::ChapterFormat::NUMBER; + break; + case CF_NUM_NOPREPST_TITLE: + nVal = text::ChapterFormat::DIGIT; + break; } - pArr[nCurrentElement++].Value <<= (sal_Int16)nVal; + pArr[nCurrentElement++].Value <<= nVal; } - if( aToken.nOutlineLevel != MAXLEVEL ) //only a ChapterLevel != MAXLEVEL is registered + // only a ChapterLevel != MAXLEVEL is registered + if (aToken.nOutlineLevel != MAXLEVEL) { pArr[nCurrentElement].Name = C2U("ChapterLevel"); pArr[nCurrentElement].Value <<= aToken.nOutlineLevel; @@ -2847,8 +3040,8 @@ uno::Any SwXIndexTokenAccess_Impl::getByIndex(sal_Int32 nIndex) //<--- } break; - case TOKEN_ENTRY : // no difference between Entry and Entry Text - case TOKEN_ENTRY_TEXT : + case TOKEN_ENTRY: // no difference between Entry and Entry Text + case TOKEN_ENTRY_TEXT: { rCurTokenSeq.realloc( 2 ); beans::PropertyValue* pArr = rCurTokenSeq.getArray(); @@ -2860,7 +3053,7 @@ uno::Any SwXIndexTokenAccess_Impl::getByIndex(sal_Int32 nIndex) pArr[1].Value <<= aProgCharStyle; } break; - case TOKEN_TAB_STOP : + case TOKEN_TAB_STOP: { rCurTokenSeq.realloc(5); // #i21237# beans::PropertyValue* pArr = rCurTokenSeq.getArray(); @@ -2868,7 +3061,6 @@ uno::Any SwXIndexTokenAccess_Impl::getByIndex(sal_Int32 nIndex) pArr[0].Name = C2U("TokenType"); pArr[0].Value <<= OUString::createFromAscii("TokenTabStop"); - if(SVX_TAB_ADJUST_END == aToken.eTabAlign) { pArr[1].Name = C2U("TabStopRightAligned"); @@ -2889,10 +3081,10 @@ uno::Any SwXIndexTokenAccess_Impl::getByIndex(sal_Int32 nIndex) pArr[3].Value <<= aProgCharStyle; // #i21237# pArr[4].Name = C2U("WithTab"); - pArr[4].Value.setValue(&aToken.bWithTab, ::getCppuBooleanType()); + pArr[4].Value <<= static_cast(aToken.bWithTab); } break; - case TOKEN_TEXT : + case TOKEN_TEXT: { rCurTokenSeq.realloc( 3 ); beans::PropertyValue* pArr = rCurTokenSeq.getArray(); @@ -2907,7 +3099,7 @@ uno::Any SwXIndexTokenAccess_Impl::getByIndex(sal_Int32 nIndex) pArr[2].Value <<= OUString(aToken.sText); } break; - case TOKEN_PAGE_NUMS : + case TOKEN_PAGE_NUMS: { rCurTokenSeq.realloc( 2 ); beans::PropertyValue* pArr = rCurTokenSeq.getArray(); @@ -2919,7 +3111,7 @@ uno::Any SwXIndexTokenAccess_Impl::getByIndex(sal_Int32 nIndex) pArr[1].Value <<= aProgCharStyle; } break; - case TOKEN_CHAPTER_INFO : + case TOKEN_CHAPTER_INFO: { rCurTokenSeq.realloc( 4 ); beans::PropertyValue* pArr = rCurTokenSeq.getArray(); @@ -2934,13 +3126,23 @@ uno::Any SwXIndexTokenAccess_Impl::getByIndex(sal_Int32 nIndex) sal_Int16 nVal = text::ChapterFormat::NUMBER; switch(aToken.nChapterFormat) { - case CF_NUMBER: nVal = text::ChapterFormat::NUMBER; break; - case CF_TITLE: nVal = text::ChapterFormat::NAME; break; - case CF_NUM_TITLE: nVal = text::ChapterFormat::NAME_NUMBER; break; - case CF_NUMBER_NOPREPST: nVal = text::ChapterFormat::NO_PREFIX_SUFFIX; break; - case CF_NUM_NOPREPST_TITLE: nVal = text::ChapterFormat::DIGIT; break; + case CF_NUMBER: + nVal = text::ChapterFormat::NUMBER; + break; + case CF_TITLE: + nVal = text::ChapterFormat::NAME; + break; + case CF_NUM_TITLE: + nVal = text::ChapterFormat::NAME_NUMBER; + break; + case CF_NUMBER_NOPREPST: + nVal = text::ChapterFormat::NO_PREFIX_SUFFIX; + break; + case CF_NUM_NOPREPST_TITLE: + nVal = text::ChapterFormat::DIGIT; + break; } - pArr[2].Value <<= (sal_Int16)nVal; + pArr[2].Value <<= nVal; //--->i53420 pArr[3].Name = C2U("ChapterLevel"); // @@ -2948,33 +3150,36 @@ uno::Any SwXIndexTokenAccess_Impl::getByIndex(sal_Int32 nIndex) //<--- } break; - case TOKEN_LINK_START : + case TOKEN_LINK_START: { rCurTokenSeq.realloc( 2 ); beans::PropertyValue* pArr = rCurTokenSeq.getArray(); pArr[0].Name = C2U("TokenType"); - pArr[0].Value <<= OUString::createFromAscii("TokenHyperlinkStart"); + pArr[0].Value <<= + OUString::createFromAscii("TokenHyperlinkStart"); pArr[1].Name = C2U("CharacterStyleName"); pArr[1].Value <<= aProgCharStyle; } break; - case TOKEN_LINK_END : + case TOKEN_LINK_END: { rCurTokenSeq.realloc( 1 ); beans::PropertyValue* pArr = rCurTokenSeq.getArray(); pArr[0].Name = C2U("TokenType"); - pArr[0].Value <<= OUString::createFromAscii("TokenHyperlinkEnd"); + pArr[0].Value <<= + OUString::createFromAscii("TokenHyperlinkEnd"); } break; - case TOKEN_AUTHORITY : + case TOKEN_AUTHORITY: { rCurTokenSeq.realloc( 3 ); beans::PropertyValue* pArr = rCurTokenSeq.getArray(); pArr[0].Name = C2U("TokenType"); - pArr[0].Value <<= OUString::createFromAscii("TokenBibliographyDataField"); + pArr[0].Value <<= + OUString::createFromAscii("TokenBibliographyDataField"); pArr[1].Name = C2U("CharacterStyleName"); pArr[1].Value <<= aProgCharStyle; @@ -2991,22 +3196,26 @@ uno::Any SwXIndexTokenAccess_Impl::getByIndex(sal_Int32 nIndex) aIt++; // #i21237# } - uno::Any aRet(&aRetSeq, ::getCppuType((uno::Sequence< beans::PropertyValues >*)0)); - + uno::Any aRet; + aRet <<= aRetSeq; return aRet; } + /*-- 13.09.99 16:52:30--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Type SwXIndexTokenAccess_Impl::getElementType(void) - throw( uno::RuntimeException ) +uno::Type SAL_CALL +SwXDocumentIndex::TokenAccess_Impl::getElementType() +throw (uno::RuntimeException) { return ::getCppuType((uno::Sequence< beans::PropertyValues >*)0); } /*-- 13.09.99 16:52:30--------------------------------------------------- -----------------------------------------------------------------------*/ -sal_Bool SwXIndexTokenAccess_Impl::hasElements(void) throw( uno::RuntimeException ) +sal_Bool SAL_CALL +SwXDocumentIndex::TokenAccess_Impl::hasElements() +throw (uno::RuntimeException) { return sal_True; } -- cgit v1.2.3 From f3dca2c04f5bd6d30c33e06de2ef6f35636ddbe9 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:59 +0100 Subject: swunolocking1: #i105557#: SwXDocumentIndexes: use new XServiceInfo helpers. clean up the implementation a little. --- sw/inc/unoidx.hxx | 67 ++++++++++------- sw/source/core/unocore/unoidx.cxx | 150 +++++++++++++++++++++++--------------- 2 files changed, 131 insertions(+), 86 deletions(-) diff --git a/sw/inc/unoidx.hxx b/sw/inc/unoidx.hxx index f3462a17bebb..8d432f9fdcf3 100644 --- a/sw/inc/unoidx.hxx +++ b/sw/inc/unoidx.hxx @@ -271,46 +271,57 @@ public: SwDoc* pDoc); void Invalidate(); }; + /* -----------------05.05.99 12:27------------------- * * --------------------------------------------------*/ - -class SwXDocumentIndexes : public SwCollectionBaseClass, - public SwUnoCollection +class SwXDocumentIndexes + : public SwCollectionBaseClass + , public SwUnoCollection { -protected: - virtual ~SwXDocumentIndexes(); -public: - SwXDocumentIndexes(SwDoc* pDoc); - -// SMART_UNO_DECLARATION( SwXDocumentIndexes, UsrObject ); +private: -// automatisch auskommentiert - [getIdlClass or queryInterface] - Bitte XTypeProvider benutzen! -// virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::reflection::XIdlClass > > getIdlClasses(void) + virtual ~SwXDocumentIndexes(); -// throw( ::com::sun::star::uno::RuntimeException ); -// automatisch auskommentiert - [getIdlClass or queryInterface] - Bitte XTypeProvider benutzen! -// virtual sal_Bool queryInterface( ::com::sun::star::uno::Uik aUik, ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & rOut ); +public: + SwXDocumentIndexes(SwDoc *const pDoc); - //XNameAccess - virtual ::com::sun::star::uno::Any SAL_CALL getByName(const rtl::OUString& Name) throw( ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getElementNames(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual sal_Bool SAL_CALL hasByName(const rtl::OUString& Name) throw( ::com::sun::star::uno::RuntimeException ); + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( + const ::rtl::OUString& rServiceName) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames() + throw (::com::sun::star::uno::RuntimeException); - //XIndexAccess - virtual sal_Int32 SAL_CALL getCount(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) throw( ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException ); + // XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasElements() + throw (::com::sun::star::uno::RuntimeException); - //XElementAccess - virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); + // XIndexAccess + virtual sal_Int32 SAL_CALL getCount() + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) + throw (::com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); - //XServiceInfo - virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + // XNameAccess + virtual ::com::sun::star::uno::Any SAL_CALL getByName( + const ::rtl::OUString& rName) + throw (::com::sun::star::container::NoSuchElementException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getElementNames() throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasByName(const ::rtl::OUString& rName) + throw (::com::sun::star::uno::RuntimeException); }; diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index 4c55e3e1963f..0b6a3c8c93c2 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -2312,49 +2312,63 @@ void SwXDocumentIndexMark::Invalidate() m_pDoc = 0; } } -/* -----------------------------06.04.00 15:08-------------------------------- - ---------------------------------------------------------------------------*/ -OUString SwXDocumentIndexes::getImplementationName(void) throw( uno::RuntimeException ) +/****************************************************************** + * SwXDocumentIndexes + ******************************************************************/ +/*-- 05.05.99 13:14:59--------------------------------------------------- + + -----------------------------------------------------------------------*/ +SwXDocumentIndexes::SwXDocumentIndexes(SwDoc *const _pDoc) + : SwUnoCollection(_pDoc) { - return C2U("SwXDocumentIndexes"); } -/* -----------------------------06.04.00 15:08-------------------------------- +/*-- 05.05.99 13:15:00--------------------------------------------------- - ---------------------------------------------------------------------------*/ -BOOL SwXDocumentIndexes::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) + -----------------------------------------------------------------------*/ +SwXDocumentIndexes::~SwXDocumentIndexes() { - return C2U("com.sun.star.text.DocumentIndexes") == rServiceName; } + /* -----------------------------06.04.00 15:08-------------------------------- ---------------------------------------------------------------------------*/ -uno::Sequence< OUString > SwXDocumentIndexes::getSupportedServiceNames(void) throw( uno::RuntimeException ) +OUString SAL_CALL +SwXDocumentIndexes::getImplementationName() throw (uno::RuntimeException) { - uno::Sequence< OUString > aRet(1); - OUString* pArray = aRet.getArray(); - pArray[0] = C2U("com.sun.star.text.DocumentIndexes"); - return aRet; + return C2U("SwXDocumentIndexes"); } -/*-- 05.05.99 13:14:59--------------------------------------------------- - -----------------------------------------------------------------------*/ -SwXDocumentIndexes::SwXDocumentIndexes(SwDoc* _pDoc) : - SwUnoCollection(_pDoc) +static char const*const g_ServicesDocumentIndexes[] = +{ + "com.sun.star.text.DocumentIndexes", +}; +static const size_t g_nServicesDocumentIndexes( + sizeof(g_ServicesDocumentIndexes)/sizeof(g_ServicesDocumentIndexes[0])); + +sal_Bool SAL_CALL +SwXDocumentIndexes::supportsService(const OUString& rServiceName) +throw (uno::RuntimeException) { + return ::sw::SupportsServiceImpl( + g_nServicesDocumentIndexes, g_ServicesDocumentIndexes, rServiceName); } -/*-- 05.05.99 13:15:00--------------------------------------------------- - -----------------------------------------------------------------------*/ -SwXDocumentIndexes::~SwXDocumentIndexes() +uno::Sequence< OUString > SAL_CALL +SwXDocumentIndexes::getSupportedServiceNames() throw (uno::RuntimeException) { + return ::sw::GetSupportedServiceNamesImpl( + g_nServicesDocumentIndexes, g_ServicesDocumentIndexes); } + /*-- 05.05.99 13:15:01--------------------------------------------------- -----------------------------------------------------------------------*/ -sal_Int32 SwXDocumentIndexes::getCount(void) throw( uno::RuntimeException ) +sal_Int32 SAL_CALL +SwXDocumentIndexes::getCount() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); + if(!IsValid()) throw uno::RuntimeException(); @@ -2365,17 +2379,23 @@ sal_Int32 SwXDocumentIndexes::getCount(void) throw( uno::RuntimeException ) const SwSection* pSect = rFmts[ n ]->GetSection(); if( TOX_CONTENT_SECTION == pSect->GetType() && pSect->GetFmt()->GetSectionNode() ) + { ++nRet; + } } return nRet; } + /*-- 05.05.99 13:15:01--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Any SwXDocumentIndexes::getByIndex(sal_Int32 nIndex) - throw( lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException ) +uno::Any SAL_CALL +SwXDocumentIndexes::getByIndex(sal_Int32 nIndex) +throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, + uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); + if(!IsValid()) throw uno::RuntimeException(); @@ -2388,14 +2408,14 @@ uno::Any SwXDocumentIndexes::getByIndex(sal_Int32 nIndex) if( TOX_CONTENT_SECTION == pSect->GetType() && pSect->GetFmt()->GetSectionNode() && nIdx++ == nIndex ) - { - const uno::Reference< text::XDocumentIndex > xTmp = - SwXDocumentIndex::CreateXDocumentIndex( - *GetDoc(), static_cast(*pSect)); - uno::Any aRet; - aRet <<= xTmp; - return aRet; - } + { + const uno::Reference< text::XDocumentIndex > xTmp = + SwXDocumentIndex::CreateXDocumentIndex( + *GetDoc(), static_cast(*pSect)); + uno::Any aRet; + aRet <<= xTmp; + return aRet; + } } throw lang::IndexOutOfBoundsException(); @@ -2404,14 +2424,16 @@ uno::Any SwXDocumentIndexes::getByIndex(sal_Int32 nIndex) /*-- 31.01.00 10:12:31--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Any SwXDocumentIndexes::getByName(const OUString& rName) - throw( container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException ) +uno::Any SAL_CALL +SwXDocumentIndexes::getByName(const OUString& rName) +throw (container::NoSuchElementException, lang::WrappedTargetException, + uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); + if(!IsValid()) throw uno::RuntimeException(); - String sToFind(rName); const SwSectionFmts& rFmts = GetDoc()->GetSections(); for( sal_uInt16 n = 0; n < rFmts.Count(); ++n ) @@ -2419,25 +2441,28 @@ uno::Any SwXDocumentIndexes::getByName(const OUString& rName) const SwSection* pSect = rFmts[ n ]->GetSection(); if( TOX_CONTENT_SECTION == pSect->GetType() && pSect->GetFmt()->GetSectionNode() && - ((SwTOXBaseSection*)pSect)->GetTOXName() == sToFind) - { - const uno::Reference< text::XDocumentIndex > xTmp = - SwXDocumentIndex::CreateXDocumentIndex( - *GetDoc(), static_cast(*pSect)); - uno::Any aRet; - aRet <<= xTmp; - return aRet; - } + (static_cast(pSect)->GetTOXName() + == sToFind)) + { + const uno::Reference< text::XDocumentIndex > xTmp = + SwXDocumentIndex::CreateXDocumentIndex( + *GetDoc(), static_cast(*pSect)); + uno::Any aRet; + aRet <<= xTmp; + return aRet; + } } throw container::NoSuchElementException(); } + /*-- 31.01.00 10:12:31--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Sequence< OUString > SwXDocumentIndexes::getElementNames(void) - throw( uno::RuntimeException ) +uno::Sequence< OUString > SAL_CALL +SwXDocumentIndexes::getElementNames() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); + if(!IsValid()) throw uno::RuntimeException(); @@ -2446,10 +2471,12 @@ uno::Sequence< OUString > SwXDocumentIndexes::getElementNames(void) sal_uInt16 n; for( n = 0; n < rFmts.Count(); ++n ) { - const SwSection* pSect = rFmts[ n ]->GetSection(); + SwSection const*const pSect = rFmts[ n ]->GetSection(); if( TOX_CONTENT_SECTION == pSect->GetType() && pSect->GetFmt()->GetSectionNode() ) + { ++nCount; + } } uno::Sequence< OUString > aRet(nCount); @@ -2457,22 +2484,26 @@ uno::Sequence< OUString > SwXDocumentIndexes::getElementNames(void) sal_uInt16 nCnt; for( n = 0, nCnt = 0; n < rFmts.Count(); ++n ) { - const SwSection* pSect = rFmts[ n ]->GetSection(); + SwSection const*const pSect = rFmts[ n ]->GetSection(); if( TOX_CONTENT_SECTION == pSect->GetType() && pSect->GetFmt()->GetSectionNode()) { - pArray[nCnt++] = OUString(((SwTOXBaseSection*)pSect)->GetTOXName()); + pArray[nCnt++] = OUString( + static_cast(pSect)->GetTOXName()); } } return aRet; } + /*-- 31.01.00 10:12:31--------------------------------------------------- -----------------------------------------------------------------------*/ -sal_Bool SwXDocumentIndexes::hasByName(const OUString& rName) - throw( uno::RuntimeException ) +sal_Bool SAL_CALL +SwXDocumentIndexes::hasByName(const OUString& rName) +throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); + if(!IsValid()) throw uno::RuntimeException(); @@ -2480,31 +2511,34 @@ sal_Bool SwXDocumentIndexes::hasByName(const OUString& rName) const SwSectionFmts& rFmts = GetDoc()->GetSections(); for( sal_uInt16 n = 0; n < rFmts.Count(); ++n ) { - const SwSection* pSect = rFmts[ n ]->GetSection(); + SwSection const*const pSect = rFmts[ n ]->GetSection(); if( TOX_CONTENT_SECTION == pSect->GetType() && pSect->GetFmt()->GetSectionNode()) { - if(((SwTOXBaseSection*)pSect)->GetTOXName() == sToFind) + if (static_cast(pSect)->GetTOXName() + == sToFind) + { return sal_True; + } } } return sal_False; } + /*-- 05.05.99 13:15:01--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Type SwXDocumentIndexes::getElementType(void) throw( uno::RuntimeException ) +uno::Type SAL_CALL +SwXDocumentIndexes::getElementType() throw (uno::RuntimeException) { - return ::getCppuType((uno::Reference< text::XDocumentIndex> *)0); + return text::XDocumentIndex::static_type(); } /*-- 05.05.99 13:15:02--------------------------------------------------- -----------------------------------------------------------------------*/ -sal_Bool SwXDocumentIndexes::hasElements(void) throw( uno::RuntimeException ) +sal_Bool SAL_CALL +SwXDocumentIndexes::hasElements() throw (uno::RuntimeException) { - vos::OGuard aGuard(Application::GetSolarMutex()); - if(!IsValid()) - throw uno::RuntimeException(); return 0 != getCount(); } -- cgit v1.2.3 From fb0dd0d206e140a72291bff3e0225c938bb9de68 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:59 +0100 Subject: swunolocking1: #i105557#: fix locking for SwXDocumentIndexMark: add Impl struct, and use UnoImplPtr to lock destructor. move all implementation details out of header, into Impl struct. disable broken SwClient iteration. make constructor private, and add factory function CreateXDocumentIndexMark. use new XUnoTunnel helpers. clean up the implementation a little. remove SwXDocumentIndexMark::GetObject(). --- sw/inc/unoidx.hxx | 179 +++--- sw/source/core/unocore/unoclbck.cxx | 12 +- sw/source/core/unocore/unocrsrhelper.cxx | 8 +- sw/source/core/unocore/unoidx.cxx | 992 ++++++++++++++++++------------- sw/source/core/unocore/unoportenum.cxx | 5 +- 5 files changed, 700 insertions(+), 496 deletions(-) diff --git a/sw/inc/unoidx.hxx b/sw/inc/unoidx.hxx index 8d432f9fdcf3..dd1edce22d0d 100644 --- a/sw/inc/unoidx.hxx +++ b/sw/inc/unoidx.hxx @@ -36,14 +36,13 @@ #include #include +#include #include -#include #include #include -class SfxItemPropertySet; class SwTOXBaseSection; class SwTOXMark; class SwTOXType; @@ -189,87 +188,129 @@ public: /* -----------------07.12.98 10:08------------------- * * --------------------------------------------------*/ -class SwXDocumentIndexMark : public cppu::WeakImplHelper4 -< - ::com::sun::star::text::XDocumentIndexMark, - ::com::sun::star::lang::XServiceInfo, - ::com::sun::star::beans::XPropertySet, - ::com::sun::star::lang::XUnoTunnel ->, - public SwClient +typedef ::cppu::WeakImplHelper4 +< ::com::sun::star::lang::XUnoTunnel +, ::com::sun::star::lang::XServiceInfo +, ::com::sun::star::beans::XPropertySet +, ::com::sun::star::text::XDocumentIndexMark +> SwXDocumentIndexMark_Base; + +class SwXDocumentIndexMark + : public SwXDocumentIndexMark_Base { - SwEventListenerContainer aLstnrCntnr; - SwDepend aTypeDepend; - SwDoc* m_pDoc; - const SwTOXMark* m_pTOXMark; - const SfxItemPropertySet* m_pPropSet; - - sal_Bool bIsDescriptor; - sal_Bool bMainEntry; - TOXTypes eType; - sal_uInt16 nLevel; - String sAltText; - String sPrimaryKey; - String sSecondaryKey; - String sTextReading; - String sPrimaryKeyReading; - String sSecondaryKeyReading; - String sUserIndexName; - - void InitMap(TOXTypes eToxType); -protected: - virtual ~SwXDocumentIndexMark(); -public: - SwXDocumentIndexMark(TOXTypes eToxType); - SwXDocumentIndexMark(const SwTOXType* pType, - const SwTOXMark* pMark, - SwDoc* pDc); +private: - TYPEINFO(); + class Impl; + ::sw::UnoImplPtr m_pImpl; - static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); + virtual ~SwXDocumentIndexMark(); - //XUnoTunnel - virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); + SwXDocumentIndexMark(SwDoc & rDoc, + SwTOXType & rType, const SwTOXMark & rMark); - virtual rtl::OUString SAL_CALL getMarkEntry(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL setMarkEntry(const rtl::OUString& aIndexEntry) throw( ::com::sun::star::uno::RuntimeException ); +public: - //XTextContent - virtual void SAL_CALL attach(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL getAnchor(void) throw( ::com::sun::star::uno::RuntimeException ); + /// descriptor + SwXDocumentIndexMark(const TOXTypes eToxType); - //XComponent - virtual void SAL_CALL dispose(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); - virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw( ::com::sun::star::uno::RuntimeException ); + static ::com::sun::star::uno::Reference< + ::com::sun::star::text::XDocumentIndexMark> + CreateXDocumentIndexMark(SwDoc & rDoc, + SwTOXType & rType, const SwTOXMark & rMark); - //XPropertySet - virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); - //XServiceInfo - virtual rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); - virtual BOOL SAL_CALL supportsService(const rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); - virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); + // XUnoTunnel + virtual sal_Int64 SAL_CALL getSomething( + const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier) + throw (::com::sun::star::uno::RuntimeException); - //SwClient - virtual void Modify( SfxPoolItem *pOld, SfxPoolItem *pNew); + // XServiceInfo + virtual ::rtl::OUString SAL_CALL getImplementationName() + throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( + const ::rtl::OUString& rServiceName) + throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL + getSupportedServiceNames() + throw (::com::sun::star::uno::RuntimeException); + + // XComponent + virtual void SAL_CALL dispose() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XEventListener > & xListener) + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeEventListener( + const ::com::sun::star::uno::Reference< + ::com::sun::star::lang::XEventListener > & xListener) + throw (::com::sun::star::uno::RuntimeException); + + // XPropertySet + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertySetInfo > SAL_CALL + getPropertySetInfo() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setPropertyValue( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Any& rValue) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::beans::PropertyVetoException, + ::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( + const ::rtl::OUString& rPropertyName) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addPropertyChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertyChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removePropertyChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XPropertyChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addVetoableChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XVetoableChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeVetoableChangeListener( + const ::rtl::OUString& rPropertyName, + const ::com::sun::star::uno::Reference< + ::com::sun::star::beans::XVetoableChangeListener >& xListener) + throw (::com::sun::star::beans::UnknownPropertyException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); - void attachToRange(const ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > & xTextRange)throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); + // XTextContent + virtual void SAL_CALL attach( + const ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > & xTextRange) + throw (::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< + ::com::sun::star::text::XTextRange > SAL_CALL getAnchor() + throw (::com::sun::star::uno::RuntimeException); - SwTOXType* GetTOXType() const {return (SwTOXType*)aTypeDepend.GetRegisteredIn();} - const SwTOXMark* GetTOXMark() const {return m_pTOXMark;} + // XDocumentIndexMark + virtual rtl::OUString SAL_CALL getMarkEntry() + throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setMarkEntry(const rtl::OUString& rIndexEntry) + throw (::com::sun::star::uno::RuntimeException); - static SwXDocumentIndexMark* GetObject(SwTOXType* pType, const SwTOXMark* pMark, - SwDoc* pDoc); - void Invalidate(); }; /* -----------------05.05.99 12:27------------------- diff --git a/sw/source/core/unocore/unoclbck.cxx b/sw/source/core/unocore/unoclbck.cxx index 6cc9cc0ee910..6e5b08210147 100644 --- a/sw/source/core/unocore/unoclbck.cxx +++ b/sw/source/core/unocore/unoclbck.cxx @@ -78,18 +78,8 @@ SwXFootnote* SwUnoCallBack::GetFootnote(const SwFmtFtn& rMark) /* -----------------------------27.11.00 17:15-------------------------------- ---------------------------------------------------------------------------*/ -SwXDocumentIndexMark* SwUnoCallBack::GetTOXMark(const SwTOXMark& rMark) +SwXDocumentIndexMark* SwUnoCallBack::GetTOXMark(const SwTOXMark& /*rMark*/) { - SwClientIter aIter( *this ); - SwXDocumentIndexMark* pxIndexMark = (SwXDocumentIndexMark*)aIter.First( TYPE( SwXDocumentIndexMark )); - while(pxIndexMark) - { - const SwTOXMark* pMark = pxIndexMark->GetTOXMark(); - if(pMark == &rMark) - return pxIndexMark; - - pxIndexMark = (SwXDocumentIndexMark*)aIter.Next( ); - } return 0; } diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index df34c675bfa0..642b0b5030aa 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -314,9 +314,11 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry if( pAny ) { const SwTOXMark& rMark = pTxtAttr->GetTOXMark(); - uno::Reference< XDocumentIndexMark > xRef = SwXDocumentIndexMark::GetObject( - (SwTOXType*)rMark.GetTOXType(), &rMark, rPam.GetDoc()); - pAny->setValue(&xRef, ::getCppuType((uno::Reference*)0)); + const uno::Reference< text::XDocumentIndexMark > xRef = + SwXDocumentIndexMark::CreateXDocumentIndexMark( + *rPam.GetDoc(), + *const_cast(rMark.GetTOXType()), rMark); + (*pAny) <<= xRef; } } else diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index 0b6a3c8c93c2..807b230c5b6d 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -70,6 +70,7 @@ #include #include #include +#include using namespace ::com::sun::star; @@ -326,7 +327,7 @@ SwDocIndexDescriptorProperties_Impl::SwDocIndexDescriptorProperties_Impl( } static sal_uInt16 -lcl_TypeToPropertyMap(const TOXTypes eType) +lcl_TypeToPropertyMap_Index(const TOXTypes eType) { switch (eType) { @@ -363,7 +364,7 @@ public: SwTOXBaseSection const*const pBaseSection) : SwClient((pBaseSection) ? pBaseSection->GetFmt() : 0) , m_rPropSet( - *aSwMapProvider.GetPropertySet(lcl_TypeToPropertyMap(eType))) + *aSwMapProvider.GetPropertySet(lcl_TypeToPropertyMap_Index(eType))) , m_eTOXType(eType) , m_ListenerContainer(static_cast< ::cppu::OWeakObject* >(&rThis)) , m_bIsDescriptor(0 == pBaseSection) @@ -1264,8 +1265,9 @@ throw (beans::UnknownPropertyException, lang::WrappedTargetException, for(USHORT i = 0; i < aMarks.Count(); i++) { pMark = aMarks.GetObject(i); - pxMarks[i] = SwXDocumentIndexMark::GetObject( - const_cast(pType), pMark, m_pImpl->m_pDoc); + pxMarks[i] = SwXDocumentIndexMark::CreateXDocumentIndexMark( + *m_pImpl->m_pDoc, + *const_cast(pType), *pMark); } aRet <<= aXMarks; } @@ -1552,6 +1554,165 @@ SwXDocumentIndex::setName(const OUString& rName) throw (uno::RuntimeException) /****************************************************************** * SwXDocumentIndexMark ******************************************************************/ +/* -----------------21.04.99 09:36------------------- + * + * --------------------------------------------------*/ +static sal_uInt16 +lcl_TypeToPropertyMap_Mark(const TOXTypes eType) +{ + switch (eType) + { + case TOX_INDEX: return PROPERTY_MAP_INDEX_MARK; + case TOX_CONTENT: return PROPERTY_MAP_CNTIDX_MARK; + //case TOX_USER: + default: + return PROPERTY_MAP_USER_MARK; + } +} + +class SwXDocumentIndexMark::Impl + : public SwClient +{ + +public: + + SfxItemPropertySet const& m_rPropSet; + const TOXTypes m_eTOXType; + SwEventListenerContainer m_ListenerContainer; + bool m_bIsDescriptor; + SwDepend m_TypeDepend; + const SwTOXMark * m_pTOXMark; + SwDoc * m_pDoc; + + sal_Bool m_bMainEntry; + sal_uInt16 m_nLevel; + OUString m_sAltText; + OUString m_sPrimaryKey; + OUString m_sSecondaryKey; + OUString m_sTextReading; + OUString m_sPrimaryKeyReading; + OUString m_sSecondaryKeyReading; + OUString m_sUserIndexName; + + Impl( SwXDocumentIndexMark & rThis, + SwDoc *const pDoc, + const enum TOXTypes eType, + SwTOXType *const pType, SwTOXMark const*const pMark) + : SwClient((pDoc) ? pDoc->GetUnoCallBack() : 0) + , m_rPropSet( + *aSwMapProvider.GetPropertySet(lcl_TypeToPropertyMap_Mark(eType))) + , m_eTOXType(eType) + , m_ListenerContainer(static_cast< ::cppu::OWeakObject* >(&rThis)) + , m_bIsDescriptor(0 == pMark) + , m_TypeDepend(this, pType) + , m_pTOXMark(pMark) + , m_pDoc(pDoc) + , m_bMainEntry(sal_False) + , m_nLevel(0) + { + } + + SwTOXType * GetTOXType() const { + return static_cast( + const_cast(m_TypeDepend.GetRegisteredIn())); + } + + void Invalidate(); + + // SwClient + virtual void Modify(SfxPoolItem *pOld, SfxPoolItem *pNew); + +}; + +/* -----------------------------16.10.00 11:24-------------------------------- + + ---------------------------------------------------------------------------*/ +void SwXDocumentIndexMark::Impl::Invalidate() +{ + if (GetRegisteredIn()) + { + const_cast(GetRegisteredIn())->Remove(this); + if (m_TypeDepend.GetRegisteredIn()) + { + const_cast(m_TypeDepend.GetRegisteredIn())->Remove( + &m_TypeDepend); + } + } + m_ListenerContainer.Disposing(); + m_pDoc = 0; + m_pTOXMark = 0; +} + +/*-- 14.12.98 10:25:47--------------------------------------------------- + + -----------------------------------------------------------------------*/ +void SwXDocumentIndexMark::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew) +{ + ClientModify(this, pOld, pNew); + + if (!GetRegisteredIn()) // removed => dispose + { + Invalidate(); + } + else if (pOld) + { + switch (pOld->Which()) + { + case RES_TOXMARK_DELETED: + if (static_cast(m_pTOXMark) == + static_cast(pOld)->pObject) + { + Invalidate(); + } + break; + } + } +} + +/*-- 14.12.98 10:25:43--------------------------------------------------- + + -----------------------------------------------------------------------*/ +SwXDocumentIndexMark::SwXDocumentIndexMark(const TOXTypes eToxType) + : m_pImpl( new SwXDocumentIndexMark::Impl(*this, 0, eToxType, 0, 0) ) +{ +} +/*-- 14.12.98 10:25:44--------------------------------------------------- + + -----------------------------------------------------------------------*/ +SwXDocumentIndexMark::SwXDocumentIndexMark(SwDoc & rDoc, + SwTOXType & rType, const SwTOXMark & rMark) + : m_pImpl( new SwXDocumentIndexMark::Impl(*this, &rDoc, rType.GetType(), + &rType, &rMark) ) +{ +} +/*-- 14.12.98 10:25:44--------------------------------------------------- + + -----------------------------------------------------------------------*/ +SwXDocumentIndexMark::~SwXDocumentIndexMark() +{ +} + +uno::Reference +SwXDocumentIndexMark::CreateXDocumentIndexMark( + SwDoc & rDoc, SwTOXType & rType, const SwTOXMark & rMark) +{ + // #i105557#: do not iterate over the registered clients: race condition + // to do this properly requires the SwXDocumentIndexMark to register at the + // format directly, not at the unocallback +#if 0 + SwClientIter aIter(*pType); + SwXDocumentIndexMark::Impl* pxMark = (SwXDocumentIndexMark::Impl*) + aIter.First(TYPE(SwXDocumentIndexMark::Impl)); + while( pxMark ) + { + if(pxMark->m_pTOXMark == pMark) + return pxMark->m_rThis; + pxMark = (SwXDocumentIndexMark::Impl*)aIter.Next(); + } +#endif + return new SwXDocumentIndexMark(rDoc, rType, rMark); +} + /* -----------------------------10.03.00 18:02-------------------------------- ---------------------------------------------------------------------------*/ @@ -1563,55 +1724,62 @@ const uno::Sequence< sal_Int8 > & SwXDocumentIndexMark::getUnoTunnelId() /* -----------------------------10.03.00 18:04-------------------------------- ---------------------------------------------------------------------------*/ -sal_Int64 SAL_CALL SwXDocumentIndexMark::getSomething( const uno::Sequence< sal_Int8 >& rId ) - throw(uno::RuntimeException) +sal_Int64 SAL_CALL +SwXDocumentIndexMark::getSomething(const uno::Sequence< sal_Int8 >& rId) +throw (uno::RuntimeException) { - if( rId.getLength() == 16 - && 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), - rId.getConstArray(), 16 ) ) - { - return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(this) ); - } - return 0; + return ::sw::UnoTunnelImpl(rId, this); } -TYPEINIT1(SwXDocumentIndexMark, SwClient) -const sal_Char cBaseMark[] = "com.sun.star.text.BaseIndexMark"; -const sal_Char cContentMark[] = "com.sun.star.text.ContentIndexMark"; -const sal_Char cIdxMark[] = "com.sun.star.text.DocumentIndexMark"; -const sal_Char cIdxMarkAsian[] = "com.sun.star.text.DocumentIndexMarkAsian"; -const sal_Char cUserMark[] = "com.sun.star.text.UserIndexMark"; -const sal_Char cTextContent[] = "com.sun.star.text.TextContent"; +static const sal_Char cBaseMark[] = "com.sun.star.text.BaseIndexMark"; +static const sal_Char cContentMark[] = "com.sun.star.text.ContentIndexMark"; +static const sal_Char cIdxMark[] = "com.sun.star.text.DocumentIndexMark"; +static const sal_Char cIdxMarkAsian[] = "com.sun.star.text.DocumentIndexMarkAsian"; +static const sal_Char cUserMark[] = "com.sun.star.text.UserIndexMark"; +static const sal_Char cTextContent[] = "com.sun.star.text.TextContent"; + /* -----------------------------06.04.00 15:07-------------------------------- ---------------------------------------------------------------------------*/ -OUString SwXDocumentIndexMark::getImplementationName(void) throw( uno::RuntimeException ) +OUString SAL_CALL +SwXDocumentIndexMark::getImplementationName() throw (uno::RuntimeException) { return C2U("SwXDocumentIndexMark"); } /* -----------------------------06.04.00 15:07-------------------------------- ---------------------------------------------------------------------------*/ -BOOL SwXDocumentIndexMark::supportsService(const OUString& rServiceName) throw( uno::RuntimeException ) +sal_Bool SAL_CALL +SwXDocumentIndexMark::supportsService(const OUString& rServiceName) +throw (uno::RuntimeException) { - return !rServiceName.compareToAscii(cBaseMark)|| - !rServiceName.compareToAscii(cTextContent) || - (eType == TOX_USER && !rServiceName.compareToAscii(cUserMark)) || - (eType == TOX_CONTENT && !rServiceName.compareToAscii(cContentMark)) || - (eType == TOX_INDEX && !rServiceName.compareToAscii(cIdxMark)) || - (eType == TOX_INDEX && !rServiceName.compareToAscii(cIdxMarkAsian)); + vos::OGuard g(Application::GetSolarMutex()); + + return rServiceName.equalsAscii(cBaseMark) + || rServiceName.equalsAscii(cTextContent) + || ((m_pImpl->m_eTOXType == TOX_USER) + && rServiceName.equalsAscii(cUserMark)) + || ((m_pImpl->m_eTOXType == TOX_CONTENT) + && rServiceName.equalsAscii(cContentMark)) + || ((m_pImpl->m_eTOXType == TOX_INDEX) + && rServiceName.equalsAscii(cIdxMark)) + || ((m_pImpl->m_eTOXType == TOX_INDEX) + && rServiceName.equalsAscii(cIdxMarkAsian)); } /* -----------------------------06.04.00 15:07-------------------------------- ---------------------------------------------------------------------------*/ -uno::Sequence< OUString > SwXDocumentIndexMark::getSupportedServiceNames(void) throw( uno::RuntimeException ) +uno::Sequence< OUString > SAL_CALL +SwXDocumentIndexMark::getSupportedServiceNames() throw (uno::RuntimeException) { - INT32 nCnt = (eType == TOX_INDEX) ? 4 : 3; + vos::OGuard g(Application::GetSolarMutex()); + + const sal_Int32 nCnt = (m_pImpl->m_eTOXType == TOX_INDEX) ? 4 : 3; uno::Sequence< OUString > aRet(nCnt); OUString* pArray = aRet.getArray(); pArray[0] = C2U(cBaseMark); pArray[1] = C2U(cTextContent); - switch(eType) + switch (m_pImpl->m_eTOXType) { case TOX_USER: pArray[2] = C2U(cUserMark); @@ -1629,97 +1797,47 @@ uno::Sequence< OUString > SwXDocumentIndexMark::getSupportedServiceNames(void) t } return aRet; } -/*-- 14.12.98 10:25:43--------------------------------------------------- - - -----------------------------------------------------------------------*/ -SwXDocumentIndexMark::SwXDocumentIndexMark(TOXTypes eToxType) : - aLstnrCntnr( (text::XTextContent*)this), - aTypeDepend(this, 0), - m_pDoc(0), - m_pTOXMark(0), - bIsDescriptor(sal_True), - bMainEntry(sal_False), - eType(eToxType), - nLevel(0) -{ - InitMap(eToxType); -} -/*-- 14.12.98 10:25:44--------------------------------------------------- - - -----------------------------------------------------------------------*/ -SwXDocumentIndexMark::SwXDocumentIndexMark(const SwTOXType* pType, - const SwTOXMark* pMark, - SwDoc* pDc) : - aLstnrCntnr( (text::XTextContent*)this), - aTypeDepend(this, (SwTOXType*)pType), - m_pDoc(pDc), - m_pTOXMark(pMark), - bIsDescriptor(sal_False), - bMainEntry(sal_False), - eType(pType->GetType()), - nLevel(0) -{ - m_pDoc->GetUnoCallBack()->Add(this); - InitMap(eType); -} -/*-- 14.12.98 10:25:44--------------------------------------------------- - - -----------------------------------------------------------------------*/ -SwXDocumentIndexMark::~SwXDocumentIndexMark() -{ - -} -/* -----------------21.04.99 09:36------------------- - * - * --------------------------------------------------*/ -void SwXDocumentIndexMark::InitMap(TOXTypes eToxType) -{ - sal_uInt16 nMapId = PROPERTY_MAP_USER_MARK; //case TOX_USER: - switch( eToxType ) - { - case TOX_INDEX: - nMapId = PROPERTY_MAP_INDEX_MARK ; - break; - case TOX_CONTENT: - nMapId = PROPERTY_MAP_CNTIDX_MARK; - break; - //case TOX_USER: - default: - ; - } - m_pPropSet = aSwMapProvider.GetPropertySet(nMapId); -} /*-- 14.12.98 10:25:45--------------------------------------------------- -----------------------------------------------------------------------*/ -OUString SwXDocumentIndexMark::getMarkEntry(void) throw( uno::RuntimeException ) +OUString SAL_CALL +SwXDocumentIndexMark::getMarkEntry() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - SwTOXType* pType = ((SwXDocumentIndexMark*)this)->GetTOXType(); + OUString sRet; - if(pType && m_pTOXMark) + SwTOXType *const pType = m_pImpl->GetTOXType(); + if (pType && m_pImpl->m_pTOXMark) { - sRet = OUString(m_pTOXMark->GetAlternativeText()); + sRet = OUString(m_pImpl->m_pTOXMark->GetAlternativeText()); + } + else if (m_pImpl->m_bIsDescriptor) + { + sRet = m_pImpl->m_sAltText; } - else if(bIsDescriptor) - sRet = sAltText; else + { throw uno::RuntimeException(); + } return sRet; } /*-- 14.12.98 10:25:45--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXDocumentIndexMark::setMarkEntry(const OUString& rIndexEntry) throw( uno::RuntimeException ) +void SAL_CALL +SwXDocumentIndexMark::setMarkEntry(const OUString& rIndexEntry) +throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - SwTOXType* pType = ((SwXDocumentIndexMark*)this)->GetTOXType(); - if(pType && m_pTOXMark) + + SwTOXType *const pType = m_pImpl->GetTOXType(); + if (pType && m_pImpl->m_pTOXMark) { - SwTOXMark aMark(*m_pTOXMark); + SwTOXMark aMark(*m_pImpl->m_pTOXMark); aMark.SetAlternativeText(rIndexEntry); - const SwTxtTOXMark* pTxtMark = m_pTOXMark->GetTxtTOXMark(); + SwTxtTOXMark const*const pTxtMark = + m_pImpl->m_pTOXMark->GetTxtTOXMark(); SwPaM aPam(pTxtMark->GetTxtNode(), *pTxtMark->GetStart()); aPam.SetMark(); if(pTxtMark->GetEnd()) @@ -1729,9 +1847,9 @@ void SwXDocumentIndexMark::setMarkEntry(const OUString& rIndexEntry) throw( uno: else aPam.GetPoint()->nContent++; - //die alte Marke loeschen - m_pDoc->DeleteTOXMark(m_pTOXMark); - m_pTOXMark = 0; + // delete old mark + m_pImpl->m_pDoc->DeleteTOXMark(m_pImpl->m_pTOXMark); + m_pImpl->m_pTOXMark = 0; SwTxtAttr* pTxtAttr = 0; sal_Bool bInsAtPos = aMark.IsAlternativeText(); @@ -1740,311 +1858,377 @@ void SwXDocumentIndexMark::setMarkEntry(const OUString& rIndexEntry) throw( uno: if( bInsAtPos ) { SwPaM aTmp( *pStt ); - m_pDoc->InsertPoolItem( aTmp, aMark, 0 ); + m_pImpl->m_pDoc->InsertPoolItem( aTmp, aMark, 0 ); pTxtAttr = pStt->nNode.GetNode().GetTxtNode()->GetTxtAttrForCharAt( pStt->nContent.GetIndex()-1, RES_TXTATR_TOXMARK); } else if( *pEnd != *pStt ) { - m_pDoc->InsertPoolItem( aPam, aMark, + m_pImpl->m_pDoc->InsertPoolItem( aPam, aMark, nsSetAttrMode::SETATTR_DONTEXPAND ); pTxtAttr = pStt->nNode.GetNode().GetTxtNode()->GetTxtAttr( pStt->nContent, RES_TXTATR_TOXMARK); } - //und sonst - Marke geloescht? if(pTxtAttr) - m_pTOXMark = &pTxtAttr->GetTOXMark(); + { + m_pImpl->m_pTOXMark = &pTxtAttr->GetTOXMark(); + } } - else if(bIsDescriptor) + else if (m_pImpl->m_bIsDescriptor) { - sAltText = rIndexEntry; + m_pImpl->m_sAltText = rIndexEntry; } else + { throw uno::RuntimeException(); + } } + /* -----------------18.02.99 13:40------------------- * * --------------------------------------------------*/ -void SwXDocumentIndexMark::attachToRange(const uno::Reference< text::XTextRange > & xTextRange) - throw( lang::IllegalArgumentException, uno::RuntimeException ) +void SAL_CALL +SwXDocumentIndexMark::attach( + const uno::Reference< text::XTextRange > & xTextRange) +throw (lang::IllegalArgumentException, uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - if(!bIsDescriptor) - throw uno::RuntimeException(); - uno::Reference xRangeTunnel( xTextRange, uno::UNO_QUERY); - SwXTextRange* pRange = 0; - OTextCursorHelper* pCursor = 0; - if(xRangeTunnel.is()) + if (!m_pImpl->m_bIsDescriptor) { - pRange = reinterpret_cast< SwXTextRange * >( - sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( SwXTextRange::getUnoTunnelId()) )); - pCursor = reinterpret_cast< OTextCursorHelper * >( - sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( OTextCursorHelper::getUnoTunnelId()) )); + throw uno::RuntimeException(); } - SwDoc* pDoc = pRange ? (SwDoc*)pRange->GetDoc() : pCursor ? (SwDoc*)pCursor->GetDoc() : 0; + const uno::Reference xRangeTunnel(xTextRange, uno::UNO_QUERY); + SwXTextRange *const pRange = + ::sw::UnoTunnelGetImplementation(xRangeTunnel); + OTextCursorHelper *const pCursor = + ::sw::UnoTunnelGetImplementation(xRangeTunnel); + SwDoc *const pDoc = + (pRange) ? pRange->GetDoc() : ((pCursor) ? pCursor->GetDoc() : 0); + if (!pDoc) + { + throw lang::IllegalArgumentException(); + } - if(pDoc ) + const SwTOXType* pTOXType = 0; + switch (m_pImpl->m_eTOXType) { - const SwTOXType* pTOXType = 0; - switch(eType) + case TOX_INDEX: + case TOX_CONTENT: + pTOXType = pDoc->GetTOXType( m_pImpl->m_eTOXType, 0 ); + break; + case TOX_USER: { - case TOX_INDEX: - case TOX_CONTENT: - pTOXType = pDoc->GetTOXType( eType, 0 ); - break; - case TOX_USER: + if (!m_pImpl->m_sUserIndexName.getLength()) { - if(!sUserIndexName.Len()) - pTOXType = pDoc->GetTOXType( eType, 0 ); - else + pTOXType = pDoc->GetTOXType( m_pImpl->m_eTOXType, 0 ); + } + else + { + const sal_uInt16 nCount = + pDoc->GetTOXTypeCount(m_pImpl->m_eTOXType); + for (sal_uInt16 i = 0; i < nCount; i++) { - sal_uInt16 nCount = pDoc->GetTOXTypeCount( eType); - for(sal_uInt16 i = 0; i < nCount; i++) + SwTOXType const*const pTemp = + pDoc->GetTOXType( m_pImpl->m_eTOXType, i ); + if (m_pImpl->m_sUserIndexName == + OUString(pTemp->GetTypeName())) { - const SwTOXType* pTemp = pDoc->GetTOXType( eType, i ); - if(sUserIndexName == pTemp->GetTypeName()) - { - pTOXType = pTemp; - break; - } - } - if(!pTOXType) - { - SwTOXType aUserType(TOX_USER, sUserIndexName); - pTOXType = pDoc->InsertTOXType(aUserType); + pTOXType = pTemp; + break; } } + if (!pTOXType) + { + SwTOXType aUserType(TOX_USER, m_pImpl->m_sUserIndexName); + pTOXType = pDoc->InsertTOXType(aUserType); + } } - break; - - default: - ; } - if(!pTOXType) - throw lang::IllegalArgumentException(); - pDoc->GetUnoCallBack()->Add(this); - ((SwTOXType*)pTOXType)->Add(&aTypeDepend); - - SwUnoInternalPaM aPam(*pDoc); - //das muss jetzt sal_True liefern - ::sw::XTextRangeToSwPaM(aPam, xTextRange); - SwTOXMark aMark (pTOXType); - if(sAltText.Len()) - aMark.SetAlternativeText(sAltText); - switch(eType) - { - case TOX_INDEX: - if(sPrimaryKey.Len()) - aMark.SetPrimaryKey(sPrimaryKey); - if(sSecondaryKey.Len()) - aMark.SetSecondaryKey(sSecondaryKey); - if(sTextReading.Len()) - aMark.SetTextReading(sTextReading); - if(sPrimaryKeyReading.Len()) - aMark.SetPrimaryKeyReading(sPrimaryKeyReading); - if(sSecondaryKeyReading.Len()) - aMark.SetSecondaryKeyReading(sSecondaryKeyReading); - aMark.SetMainEntry(bMainEntry); - break; - case TOX_USER: - case TOX_CONTENT: - if(USHRT_MAX != nLevel) - aMark.SetLevel(nLevel+1); - break; + break; - default: - ; - } - UnoActionContext aAction(pDoc); - sal_Bool bMark = *aPam.GetPoint() != *aPam.GetMark(); - // Marks ohne Alternativtext ohne selektierten Text koennen nicht eingefuegt werden, - // deshalb hier ein Leerzeichen - ob das die ideale Loesung ist? - if(!bMark && !aMark.GetAlternativeText().Len()) - aMark.SetAlternativeText( String(' ') ); - - SwXTextCursor const*const pTextCursor( - dynamic_cast(pCursor)); - const bool bForceExpandHints( (!bMark && pTextCursor) - ? pTextCursor->IsAtEndOfMeta() : false ); - const SetAttrMode nInsertFlags = (bForceExpandHints) - ? ( nsSetAttrMode::SETATTR_FORCEHINTEXPAND - | nsSetAttrMode::SETATTR_DONTEXPAND) - : nsSetAttrMode::SETATTR_DONTEXPAND; - - pDoc->InsertPoolItem(aPam, aMark, nInsertFlags); - if( bMark && *aPam.GetPoint() > *aPam.GetMark()) - aPam.Exchange(); + default: + break; + } + if (!pTOXType) + { + throw lang::IllegalArgumentException(); + } + pDoc->GetUnoCallBack()->Add(m_pImpl.get()); + const_cast(pTOXType)->Add(&m_pImpl->m_TypeDepend); - SwTxtAttr* pTxtAttr = 0; - if( bMark ) - pTxtAttr = aPam.GetNode()->GetTxtNode()->GetTxtAttr( - aPam.GetPoint()->nContent, RES_TXTATR_TOXMARK ); - else - { - pTxtAttr = aPam.GetNode()->GetTxtNode()->GetTxtAttrForCharAt( - aPam.GetPoint()->nContent.GetIndex()-1, RES_TXTATR_TOXMARK ); - } + SwUnoInternalPaM aPam(*pDoc); + //das muss jetzt sal_True liefern + ::sw::XTextRangeToSwPaM(aPam, xTextRange); + SwTOXMark aMark (pTOXType); + if (m_pImpl->m_sAltText.getLength()) + { + aMark.SetAlternativeText(m_pImpl->m_sAltText); + } + switch (m_pImpl->m_eTOXType) + { + case TOX_INDEX: + if (m_pImpl->m_sPrimaryKey.getLength()) + { + aMark.SetPrimaryKey(m_pImpl->m_sPrimaryKey); + } + if (m_pImpl->m_sSecondaryKey.getLength()) + { + aMark.SetSecondaryKey(m_pImpl->m_sSecondaryKey); + } + if (m_pImpl->m_sTextReading.getLength()) + { + aMark.SetTextReading(m_pImpl->m_sTextReading); + } + if (m_pImpl->m_sPrimaryKeyReading.getLength()) + { + aMark.SetPrimaryKeyReading(m_pImpl->m_sPrimaryKeyReading); + } + if (m_pImpl->m_sSecondaryKeyReading.getLength()) + { + aMark.SetSecondaryKeyReading(m_pImpl->m_sSecondaryKeyReading); + } + aMark.SetMainEntry(m_pImpl->m_bMainEntry); + break; + case TOX_USER: + case TOX_CONTENT: + if (USHRT_MAX != m_pImpl->m_nLevel) + { + aMark.SetLevel(m_pImpl->m_nLevel+1); + } + break; - if(pTxtAttr) - { - m_pTOXMark = &pTxtAttr->GetTOXMark(); - m_pDoc = pDoc; - bIsDescriptor = sal_False; - } - else - throw uno::RuntimeException(); + default: + break; + } + UnoActionContext aAction(pDoc); + const sal_Bool bMark = *aPam.GetPoint() != *aPam.GetMark(); + // Marks ohne Alternativtext ohne selektierten Text koennen nicht eingefuegt werden, + // deshalb hier ein Leerzeichen - ob das die ideale Loesung ist? + if (!bMark && !aMark.GetAlternativeText().Len()) + { + aMark.SetAlternativeText( String(' ') ); } -} -/*-- 14.12.98 10:25:45--------------------------------------------------- - -----------------------------------------------------------------------*/ -void SwXDocumentIndexMark::attach(const uno::Reference< text::XTextRange > & xTextRange) - throw( lang::IllegalArgumentException, uno::RuntimeException ) -{ - vos::OGuard aGuard(Application::GetSolarMutex()); - attachToRange( xTextRange ); + SwXTextCursor const*const pTextCursor( + dynamic_cast(pCursor)); + const bool bForceExpandHints( (!bMark && pTextCursor) + ? pTextCursor->IsAtEndOfMeta() : false ); + const SetAttrMode nInsertFlags = (bForceExpandHints) + ? ( nsSetAttrMode::SETATTR_FORCEHINTEXPAND + | nsSetAttrMode::SETATTR_DONTEXPAND) + : nsSetAttrMode::SETATTR_DONTEXPAND; + + pDoc->InsertPoolItem(aPam, aMark, nInsertFlags); + if (bMark && *aPam.GetPoint() > *aPam.GetMark()) + { + aPam.Exchange(); + } + + SwTxtAttr* pTxtAttr = 0; + if (bMark) + { + pTxtAttr = aPam.GetNode()->GetTxtNode()->GetTxtAttr( + aPam.GetPoint()->nContent, RES_TXTATR_TOXMARK ); + } + else + { + pTxtAttr = aPam.GetNode()->GetTxtNode()->GetTxtAttrForCharAt( + aPam.GetPoint()->nContent.GetIndex()-1, RES_TXTATR_TOXMARK ); + } + + if (!pTxtAttr) + { + throw uno::RuntimeException(); + } + + m_pImpl->m_pTOXMark = &pTxtAttr->GetTOXMark(); + m_pImpl->m_pDoc = pDoc; + m_pImpl->m_bIsDescriptor = sal_False; } + /*-- 14.12.98 10:25:45--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Reference< text::XTextRange > SwXDocumentIndexMark::getAnchor(void) throw( uno::RuntimeException ) +uno::Reference< text::XTextRange > SAL_CALL +SwXDocumentIndexMark::getAnchor() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - uno::Reference< text::XTextRange > aRet; - SwTOXType* pType = ((SwXDocumentIndexMark*)this)->GetTOXType(); - if(pType && m_pTOXMark) + + SwTOXType *const pType = m_pImpl->GetTOXType(); + if (!pType || !m_pImpl->m_pTOXMark) { - if( m_pTOXMark->GetTxtTOXMark() ) - { - const SwTxtTOXMark* pTxtMark = m_pTOXMark->GetTxtTOXMark(); - SwPaM aPam(pTxtMark->GetTxtNode(), *pTxtMark->GetStart()); - aPam.SetMark(); - if(pTxtMark->GetEnd()) - { - aPam.GetPoint()->nContent = *pTxtMark->GetEnd(); - } - else - aPam.GetPoint()->nContent++; - uno::Reference< frame::XModel > xModel = m_pDoc->GetDocShell()->GetBaseModel(); - uno::Reference< text::XTextDocument > xTDoc(xModel, uno::UNO_QUERY); - aRet = new SwXTextRange(aPam, xTDoc->getText()); - } + throw uno::RuntimeException(); } - if(!aRet.is()) + if (!m_pImpl->m_pTOXMark->GetTxtTOXMark()) + { throw uno::RuntimeException(); - return aRet; + } + const SwTxtTOXMark* pTxtMark = m_pImpl->m_pTOXMark->GetTxtTOXMark(); + SwPaM aPam(pTxtMark->GetTxtNode(), *pTxtMark->GetStart()); + aPam.SetMark(); + if(pTxtMark->GetEnd()) + { + aPam.GetPoint()->nContent = *pTxtMark->GetEnd(); + } + else + { + aPam.GetPoint()->nContent++; + } + const uno::Reference< frame::XModel > xModel = + m_pImpl->m_pDoc->GetDocShell()->GetBaseModel(); + const uno::Reference< text::XTextDocument > xTDoc(xModel, uno::UNO_QUERY); + const uno::Reference< text::XTextRange > xRet = + new SwXTextRange(aPam, xTDoc->getText()); + + return xRet; } + /*-- 14.12.98 10:25:45--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXDocumentIndexMark::dispose(void) throw( uno::RuntimeException ) +void SAL_CALL +SwXDocumentIndexMark::dispose() throw (uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - SwTOXType* pType = ((SwXDocumentIndexMark*)this)->GetTOXType(); - if(pType && m_pTOXMark) + + SwTOXType *const pType = m_pImpl->GetTOXType(); + if (pType && m_pImpl->m_pTOXMark) { - m_pDoc->DeleteTOXMark(m_pTOXMark); + m_pImpl->m_pDoc->DeleteTOXMark(m_pImpl->m_pTOXMark); } - else - throw uno::RuntimeException(); } /*-- 14.12.98 10:25:45--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXDocumentIndexMark::addEventListener(const uno::Reference< lang::XEventListener > & aListener) - throw( uno::RuntimeException ) +void SAL_CALL +SwXDocumentIndexMark::addEventListener( + const uno::Reference< lang::XEventListener > & xListener) +throw (uno::RuntimeException) { - if(!GetRegisteredIn()) + vos::OGuard g(Application::GetSolarMutex()); + + if (!m_pImpl->GetRegisteredIn()) + { throw uno::RuntimeException(); - aLstnrCntnr.AddListener(aListener); + } + m_pImpl->m_ListenerContainer.AddListener(xListener); } /*-- 14.12.98 10:25:46--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXDocumentIndexMark::removeEventListener(const uno::Reference< lang::XEventListener > & aListener) - throw( uno::RuntimeException ) +void SAL_CALL +SwXDocumentIndexMark::removeEventListener( + const uno::Reference< lang::XEventListener > & xListener) +throw (uno::RuntimeException) { - if(!GetRegisteredIn() || !aLstnrCntnr.RemoveListener(aListener)) + vos::OGuard g(Application::GetSolarMutex()); + + if (!m_pImpl->GetRegisteredIn() || + !m_pImpl->m_ListenerContainer.RemoveListener(xListener)) + { throw uno::RuntimeException(); + } } + /*-- 14.12.98 10:25:46--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Reference< beans::XPropertySetInfo > SwXDocumentIndexMark::getPropertySetInfo(void) - throw( uno::RuntimeException ) +uno::Reference< beans::XPropertySetInfo > SAL_CALL +SwXDocumentIndexMark::getPropertySetInfo() throw (uno::RuntimeException) { + vos::OGuard g(Application::GetSolarMutex()); + static uno::Reference< beans::XPropertySetInfo > xInfos[3]; int nPos = 0; - switch(eType) + switch (m_pImpl->m_eTOXType) { - case TOX_INDEX: nPos = 0; break; - case TOX_CONTENT: nPos = 1; break; - case TOX_USER: nPos = 2; break; + case TOX_INDEX: nPos = 0; break; + case TOX_CONTENT: nPos = 1; break; + case TOX_USER: nPos = 2; break; default: ; } if(!xInfos[nPos].is()) { - uno::Reference< beans::XPropertySetInfo > xInfo = m_pPropSet->getPropertySetInfo(); + const uno::Reference< beans::XPropertySetInfo > xInfo = + m_pImpl->m_rPropSet.getPropertySetInfo(); // extend PropertySetInfo! const uno::Sequence aPropSeq = xInfo->getProperties(); xInfos[nPos] = new SfxExtItemPropertySetInfo( - aSwMapProvider.GetPropertyMapEntries(PROPERTY_MAP_PARAGRAPH_EXTENSIONS), + aSwMapProvider.GetPropertyMapEntries( + PROPERTY_MAP_PARAGRAPH_EXTENSIONS), aPropSeq ); } return xInfos[nPos]; } + /*-- 14.12.98 10:25:46--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXDocumentIndexMark::setPropertyValue(const OUString& rPropertyName, - const uno::Any& aValue) - throw( beans::UnknownPropertyException, beans::PropertyVetoException, - lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException ) +void SAL_CALL +SwXDocumentIndexMark::setPropertyValue( + const OUString& rPropertyName, const uno::Any& rValue) +throw (beans::UnknownPropertyException, beans::PropertyVetoException, + lang::IllegalArgumentException, lang::WrappedTargetException, + uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); - SwTOXType* pType = ((SwXDocumentIndexMark*)this)->GetTOXType(); - const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName(rPropertyName); + + SfxItemPropertySimpleEntry const*const pEntry = + m_pImpl->m_rPropSet.getPropertyMap()->getByName(rPropertyName); if (!pEntry) - throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); - if ( pEntry->nFlags & beans::PropertyAttribute::READONLY) - throw beans::PropertyVetoException ( OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Property is read-only: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); - if(pType && m_pTOXMark) { - SwDoc* pLocalDoc = m_pDoc; + throw beans::UnknownPropertyException( + OUString(RTL_CONSTASCII_USTRINGPARAM("Unknown property: ")) + + rPropertyName, + static_cast(this)); + } + if (pEntry->nFlags & beans::PropertyAttribute::READONLY) + { + throw beans::PropertyVetoException( + OUString(RTL_CONSTASCII_USTRINGPARAM("Property is read-only: ")) + + rPropertyName, + static_cast(this)); + } + + SwTOXType *const pType = m_pImpl->GetTOXType(); + if (pType && m_pImpl->m_pTOXMark) + { + SwDoc* pLocalDoc = m_pImpl->m_pDoc; - SwTOXMark aMark(*m_pTOXMark); + SwTOXMark aMark(*m_pImpl->m_pTOXMark); switch(pEntry->nWID) { case WID_ALT_TEXT: - aMark.SetAlternativeText(lcl_AnyToString(aValue)); + aMark.SetAlternativeText(lcl_AnyToString(rValue)); break; case WID_LEVEL: - aMark.SetLevel(Min( (sal_Int8) ( MAXLEVEL ), - (sal_Int8)(lcl_AnyToInt16(aValue)+1))); + aMark.SetLevel(Min( static_cast( MAXLEVEL ), + static_cast(lcl_AnyToInt16(rValue)+1))); break; case WID_PRIMARY_KEY : - aMark.SetPrimaryKey(lcl_AnyToString(aValue)); + aMark.SetPrimaryKey(lcl_AnyToString(rValue)); break; case WID_SECONDARY_KEY: - aMark.SetSecondaryKey(lcl_AnyToString(aValue)); + aMark.SetSecondaryKey(lcl_AnyToString(rValue)); break; case WID_MAIN_ENTRY: - aMark.SetMainEntry(lcl_AnyToBool(aValue)); + aMark.SetMainEntry(lcl_AnyToBool(rValue)); break; case WID_TEXT_READING: - aMark.SetTextReading(lcl_AnyToString(aValue)); + aMark.SetTextReading(lcl_AnyToString(rValue)); break; case WID_PRIMARY_KEY_READING: - aMark.SetPrimaryKeyReading(lcl_AnyToString(aValue)); + aMark.SetPrimaryKeyReading(lcl_AnyToString(rValue)); break; case WID_SECONDARY_KEY_READING: - aMark.SetSecondaryKeyReading(lcl_AnyToString(aValue)); + aMark.SetSecondaryKeyReading(lcl_AnyToString(rValue)); break; } - const SwTxtTOXMark* pTxtMark = m_pTOXMark->GetTxtTOXMark(); + SwTxtTOXMark const*const pTxtMark = + m_pImpl->m_pTOXMark->GetTxtTOXMark(); SwPaM aPam(pTxtMark->GetTxtNode(), *pTxtMark->GetStart()); aPam.SetMark(); if(pTxtMark->GetEnd()) @@ -2052,15 +2236,17 @@ void SwXDocumentIndexMark::setPropertyValue(const OUString& rPropertyName, aPam.GetPoint()->nContent = *pTxtMark->GetEnd(); } else + { aPam.GetPoint()->nContent++; + } //delete the old mark - pLocalDoc->DeleteTOXMark(m_pTOXMark); - m_pTOXMark = 0; + pLocalDoc->DeleteTOXMark(m_pImpl->m_pTOXMark); + m_pImpl->m_pTOXMark = 0; sal_Bool bInsAtPos = aMark.IsAlternativeText(); - const SwPosition *pStt = aPam.Start(), - *pEnd = aPam.End(); + const SwPosition *pStt = aPam.Start(); + const SwPosition *pEnd = aPam.End(); SwTxtAttr* pTxtAttr = 0; if( bInsAtPos ) @@ -2077,101 +2263,120 @@ void SwXDocumentIndexMark::setPropertyValue(const OUString& rPropertyName, pTxtAttr = pStt->nNode.GetNode().GetTxtNode()->GetTxtAttr( pStt->nContent, RES_TXTATR_TOXMARK ); } - m_pDoc = pLocalDoc; + m_pImpl->m_pDoc = pLocalDoc; if(pTxtAttr) { - m_pTOXMark = &pTxtAttr->GetTOXMark(); - m_pDoc->GetUnoCallBack()->Add(this); - pType->Add(&aTypeDepend); + m_pImpl->m_pTOXMark = &pTxtAttr->GetTOXMark(); + m_pImpl->m_pDoc->GetUnoCallBack()->Add(m_pImpl.get()); + pType->Add(&m_pImpl->m_TypeDepend); } } - else if(bIsDescriptor) + else if (m_pImpl->m_bIsDescriptor) { switch(pEntry->nWID) { case WID_ALT_TEXT: - sAltText = lcl_AnyToString(aValue); + m_pImpl->m_sAltText = lcl_AnyToString(rValue); break; case WID_LEVEL: { - sal_Int16 nVal = lcl_AnyToInt16(aValue); + const sal_Int16 nVal = lcl_AnyToInt16(rValue); if(nVal >= 0 && nVal < MAXLEVEL) - nLevel = nVal; + { + m_pImpl->m_nLevel = nVal; + } else + { throw lang::IllegalArgumentException(); + } } break; - case WID_PRIMARY_KEY : - sPrimaryKey = lcl_AnyToString(aValue); + case WID_PRIMARY_KEY: + m_pImpl->m_sPrimaryKey = lcl_AnyToString(rValue); break; case WID_SECONDARY_KEY: - sSecondaryKey = lcl_AnyToString(aValue); + m_pImpl->m_sSecondaryKey = lcl_AnyToString(rValue); break; case WID_TEXT_READING: - sTextReading = lcl_AnyToString(aValue); + m_pImpl->m_sTextReading = lcl_AnyToString(rValue); break; case WID_PRIMARY_KEY_READING: - sPrimaryKeyReading = lcl_AnyToString(aValue); + m_pImpl->m_sPrimaryKeyReading = lcl_AnyToString(rValue); break; case WID_SECONDARY_KEY_READING: - sSecondaryKeyReading = lcl_AnyToString(aValue); + m_pImpl->m_sSecondaryKeyReading = lcl_AnyToString(rValue); break; - case WID_USER_IDX_NAME : + case WID_USER_IDX_NAME: { - OUString sTmp(lcl_AnyToString(aValue)); + OUString sTmp(lcl_AnyToString(rValue)); lcl_ConvertTOUNameToUserName(sTmp); - sUserIndexName = sTmp; + m_pImpl->m_sUserIndexName = sTmp; } break; case WID_MAIN_ENTRY: - bMainEntry = lcl_AnyToBool(aValue); + m_pImpl->m_bMainEntry = lcl_AnyToBool(rValue); break; } } else + { throw uno::RuntimeException(); + } } + /*-- 14.12.98 10:25:46--------------------------------------------------- -----------------------------------------------------------------------*/ -uno::Any SwXDocumentIndexMark::getPropertyValue(const OUString& rPropertyName) - throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) +uno::Any SAL_CALL +SwXDocumentIndexMark::getPropertyValue(const OUString& rPropertyName) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { vos::OGuard aGuard(Application::GetSolarMutex()); + uno::Any aRet; - SwTOXType* pType = ((SwXDocumentIndexMark*)this)->GetTOXType(); - const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap()->getByName(rPropertyName); + SfxItemPropertySimpleEntry const*const pEntry = + m_pImpl->m_rPropSet.getPropertyMap()->getByName(rPropertyName); if (!pEntry) - throw beans::UnknownPropertyException(OUString ( RTL_CONSTASCII_USTRINGPARAM ( "Unknown property: " ) ) + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); + { + throw beans::UnknownPropertyException( + OUString(RTL_CONSTASCII_USTRINGPARAM("Unknown property: ")) + + rPropertyName, + static_cast(this)); + } if (::sw::GetDefaultTextContentValue(aRet, rPropertyName, pEntry->nWID)) { return aRet; } - if(pType && m_pTOXMark) + + SwTOXType *const pType = m_pImpl->GetTOXType(); + if (pType && m_pImpl->m_pTOXMark) { switch(pEntry->nWID) { case WID_ALT_TEXT: - aRet <<= OUString(m_pTOXMark->GetAlternativeText()); + aRet <<= OUString(m_pImpl->m_pTOXMark->GetAlternativeText()); break; case WID_LEVEL: - aRet <<= (sal_Int16)(m_pTOXMark->GetLevel() - 1); + aRet <<= static_cast( + m_pImpl->m_pTOXMark->GetLevel() - 1); break; case WID_PRIMARY_KEY : - aRet <<= OUString(m_pTOXMark->GetPrimaryKey()); + aRet <<= OUString(m_pImpl->m_pTOXMark->GetPrimaryKey()); break; case WID_SECONDARY_KEY: - aRet <<= OUString(m_pTOXMark->GetSecondaryKey()); + aRet <<= OUString(m_pImpl->m_pTOXMark->GetSecondaryKey()); break; case WID_TEXT_READING: - aRet <<= OUString(m_pTOXMark->GetTextReading()); + aRet <<= OUString(m_pImpl->m_pTOXMark->GetTextReading()); break; case WID_PRIMARY_KEY_READING: - aRet <<= OUString(m_pTOXMark->GetPrimaryKeyReading()); + aRet <<= OUString(m_pImpl->m_pTOXMark->GetPrimaryKeyReading()); break; case WID_SECONDARY_KEY_READING: - aRet <<= OUString(m_pTOXMark->GetSecondaryKeyReading()); + aRet <<= OUString( + m_pImpl->m_pTOXMark->GetSecondaryKeyReading()); break; case WID_USER_IDX_NAME : { @@ -2182,136 +2387,101 @@ uno::Any SwXDocumentIndexMark::getPropertyValue(const OUString& rPropertyName) break; case WID_MAIN_ENTRY: { - sal_Bool bTemp = m_pTOXMark->IsMainEntry(); - aRet.setValue(&bTemp, ::getBooleanCppuType()); + const sal_Bool bTemp = m_pImpl->m_pTOXMark->IsMainEntry(); + aRet <<= bTemp; } break; } } - else if(bIsDescriptor) + else if (m_pImpl->m_bIsDescriptor) { switch(pEntry->nWID) { case WID_ALT_TEXT: - aRet <<= OUString(sAltText); + aRet <<= m_pImpl->m_sAltText; break; case WID_LEVEL: - aRet <<= (sal_Int16)nLevel; + aRet <<= static_cast(m_pImpl->m_nLevel); break; - case WID_PRIMARY_KEY : - aRet <<= OUString(sPrimaryKey); + case WID_PRIMARY_KEY: + aRet <<= m_pImpl->m_sPrimaryKey; break; case WID_SECONDARY_KEY: - aRet <<= OUString(sSecondaryKey); + aRet <<= m_pImpl->m_sSecondaryKey; break; case WID_TEXT_READING: - aRet <<= OUString(sTextReading); + aRet <<= m_pImpl->m_sTextReading; break; case WID_PRIMARY_KEY_READING: - aRet <<= OUString(sPrimaryKeyReading); + aRet <<= m_pImpl->m_sPrimaryKeyReading; break; case WID_SECONDARY_KEY_READING: - aRet <<= OUString(sSecondaryKeyReading); + aRet <<= m_pImpl->m_sSecondaryKeyReading; break; case WID_USER_IDX_NAME : - aRet <<= OUString(sUserIndexName); + aRet <<= m_pImpl->m_sUserIndexName; break; case WID_MAIN_ENTRY: { - aRet.setValue(&bMainEntry, ::getBooleanCppuType()); + aRet <<= static_cast(m_pImpl->m_bMainEntry); } break; } } else + { throw uno::RuntimeException(); + } return aRet; } -/*-- 14.12.98 10:25:46--------------------------------------------------- - -----------------------------------------------------------------------*/ -void SwXDocumentIndexMark::addPropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) -{ - DBG_WARNING("not implemented"); -} /*-- 14.12.98 10:25:46--------------------------------------------------- -----------------------------------------------------------------------*/ -void SwXDocumentIndexMark::removePropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) -{ - DBG_WARNING("not implemented"); -} -/*-- 14.12.98 10:25:47--------------------------------------------------- - - -----------------------------------------------------------------------*/ -void SwXDocumentIndexMark::addVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) +void SAL_CALL +SwXDocumentIndexMark::addPropertyChangeListener( + const ::rtl::OUString& /*rPropertyName*/, + const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { - DBG_WARNING("not implemented"); + OSL_ENSURE(false, + "SwXDocumentIndexMark::addPropertyChangeListener(): not implemented"); } -/*-- 14.12.98 10:25:47--------------------------------------------------- - -----------------------------------------------------------------------*/ -void SwXDocumentIndexMark::removeVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException ) +void SAL_CALL +SwXDocumentIndexMark::removePropertyChangeListener( + const ::rtl::OUString& /*rPropertyName*/, + const uno::Reference< beans::XPropertyChangeListener >& /*xListener*/) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { - DBG_WARNING("not implemented"); + OSL_ENSURE(false, + "SwXDocumentIndexMark::removePropertyChangeListener(): not implemented"); } -/*-- 14.12.98 10:25:47--------------------------------------------------- - -----------------------------------------------------------------------*/ -SwXDocumentIndexMark* SwXDocumentIndexMark::GetObject(SwTOXType* pType, - const SwTOXMark* pMark, SwDoc* pDoc) +void SAL_CALL +SwXDocumentIndexMark::addVetoableChangeListener( + const ::rtl::OUString& /*rPropertyName*/, + const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { - SwClientIter aIter(*pType); - SwXDocumentIndexMark* pxMark = (SwXDocumentIndexMark*) - aIter.First(TYPE(SwXDocumentIndexMark)); - while( pxMark ) - { - if(pxMark->m_pTOXMark == pMark) - return pxMark; - pxMark = (SwXDocumentIndexMark*)aIter.Next(); - } - return new SwXDocumentIndexMark(pType, pMark, pDoc); + OSL_ENSURE(false, + "SwXDocumentIndexMark::addVetoableChangeListener(): not implemented"); } -/*-- 14.12.98 10:25:47--------------------------------------------------- - -----------------------------------------------------------------------*/ -void SwXDocumentIndexMark::Modify( SfxPoolItem *pOld, SfxPoolItem *pNew) +void SAL_CALL +SwXDocumentIndexMark::removeVetoableChangeListener( + const ::rtl::OUString& /*rPropertyName*/, + const uno::Reference< beans::XVetoableChangeListener >& /*xListener*/) +throw (beans::UnknownPropertyException, lang::WrappedTargetException, + uno::RuntimeException) { - switch( pOld ? pOld->Which() : 0 ) - { - case RES_REMOVE_UNO_OBJECT: - case RES_OBJECTDYING: - if( (void*)GetRegisteredIn() == ((SwPtrMsgPoolItem *)pOld)->pObject ) - Invalidate(); - break; - - case RES_FMT_CHG: - // wurden wir an das neue umgehaengt und wird das alte geloscht? - if( ((SwFmtChg*)pNew)->pChangedFmt == GetRegisteredIn() && - ((SwFmtChg*)pOld)->pChangedFmt->IsFmtInDTOR() ) - Invalidate(); - break; - case RES_TOXMARK_DELETED: - if( (void*)m_pTOXMark == ((SwPtrMsgPoolItem *)pOld)->pObject ) - Invalidate(); - break; - } + OSL_ENSURE(false, + "SwXDocumentIndexMark::removeVetoableChangeListener(): not implemented"); } -/* -----------------------------16.10.00 11:24-------------------------------- - ---------------------------------------------------------------------------*/ -void SwXDocumentIndexMark::Invalidate() -{ - if(GetRegisteredIn()) - { - ((SwModify*)GetRegisteredIn())->Remove(this); - if(aTypeDepend.GetRegisteredIn()) - ((SwModify*)aTypeDepend.GetRegisteredIn())->Remove(&aTypeDepend); - aLstnrCntnr.Disposing(); - m_pTOXMark = 0; - m_pDoc = 0; - } -} /****************************************************************** * SwXDocumentIndexes diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx index e780e95c361e..6e29ff314cf8 100644 --- a/sw/source/core/unocore/unoportenum.cxx +++ b/sw/source/core/unocore/unoportenum.cxx @@ -481,8 +481,9 @@ lcl_CreateTOXMarkPortion( ->GetTOXMark(rTOXMark); if (!xContent.is()) { - xContent = new SwXDocumentIndexMark(rTOXMark.GetTOXType(), - &rTOXMark, pDoc); + xContent.set( SwXDocumentIndexMark::CreateXDocumentIndexMark(*pDoc, + *const_cast(rTOXMark.GetTOXType()), rTOXMark), + uno::UNO_QUERY); } SwXTextPortion* pPortion = 0; -- cgit v1.2.3 From 82aba30102fe1cce3f6582bfbe29bacb7498363d Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:13:59 +0100 Subject: swunolocking1: #i105557#: remove class SwUnoCallBack. everything SwUnoCallBack class does has unfixable race conditions. in SwDoc, the uno callback is now a plain SwModify. --- sw/inc/doc.hxx | 3 +- sw/source/core/doc/docnew.cxx | 3 +- sw/source/core/inc/unoclbck.hxx | 52 --------------------- sw/source/core/unocore/makefile.mk | 1 - sw/source/core/unocore/unoclbck.cxx | 85 ---------------------------------- sw/source/core/unocore/unocoll.cxx | 1 - sw/source/core/unocore/unoobj.cxx | 1 - sw/source/core/unocore/unoobj2.cxx | 1 - sw/source/core/unocore/unoportenum.cxx | 16 ++----- 9 files changed, 6 insertions(+), 157 deletions(-) delete mode 100644 sw/source/core/inc/unoclbck.hxx delete mode 100644 sw/source/core/unocore/unoclbck.cxx diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx index de82d9056ff9..0066b37b4575 100644 --- a/sw/inc/doc.hxx +++ b/sw/inc/doc.hxx @@ -199,7 +199,6 @@ class SwLayouter; class SdrView; class SdrMarkList; class SwAuthEntry; -class SwUnoCallBack; class SwLayoutCache; class IStyleAccess; struct SwCallMouseEvent; @@ -391,7 +390,7 @@ class SW_DLLPUBLIC SwDoc : SwLayoutCache *pLayoutCache; // Layout cache to read and save with the // document for a faster formatting - SwUnoCallBack *pUnoCallBack; + SwModify *pUnoCallBack; IGrammarContact *mpGrammarContact; // for grammar checking in paragraphs during editing mutable comphelper::ImplementationReference< SwChartDataProvider diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index 71c42cf27176..7b333ad1f960 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -90,7 +90,6 @@ #include #include #include -#include #include #include #include @@ -259,7 +258,7 @@ SwDoc::SwDoc() : pStyleAccess( 0 ), // <-- pLayoutCache( 0 ), - pUnoCallBack(new SwUnoCallBack(0)), + pUnoCallBack(new SwModify(0)), mpGrammarContact( 0 ), aChartDataProviderImplRef(), pChartControllerHelper( 0 ), diff --git a/sw/source/core/inc/unoclbck.hxx b/sw/source/core/inc/unoclbck.hxx deleted file mode 100644 index 30a338f358f6..000000000000 --- a/sw/source/core/inc/unoclbck.hxx +++ /dev/null @@ -1,52 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: unoclbck.hxx,v $ - * $Revision: 1.6 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _UNOCLBCK_HXX -#define _UNOCLBCK_HXX -#include - -class SwXReferenceMark; -class SwFmtRefMark; -class SwFmtFtn; -class SwXFootnote; -class SwTOXMark; -class SwXDocumentIndexMark; - -class SwUnoCallBack : public SwModify -{ -public: - SwUnoCallBack(SwModify *pToRegisterIn); - virtual ~SwUnoCallBack(); - - // returns the API object of a reference mark if available - SwXReferenceMark* GetRefMark(const SwFmtRefMark& rMark); - SwXFootnote* GetFootnote(const SwFmtFtn& rMark); - SwXDocumentIndexMark* GetTOXMark(const SwTOXMark& rMark); -}; -#endif diff --git a/sw/source/core/unocore/makefile.mk b/sw/source/core/unocore/makefile.mk index b364956a3d0c..31c6f4f72668 100644 --- a/sw/source/core/unocore/makefile.mk +++ b/sw/source/core/unocore/makefile.mk @@ -115,7 +115,6 @@ SLOFILES = \ $(SLO)$/unotextmarkup.obj\ $(SLO)$/TextCursorHelper.obj \ $(SLO)$/unotext.obj\ - $(SLO)$/unoclbck.obj\ $(SLO)$/unomap.obj\ $(SLO)$/unoprnms.obj\ $(SLO)$/XMLRangeHelper.obj diff --git a/sw/source/core/unocore/unoclbck.cxx b/sw/source/core/unocore/unoclbck.cxx deleted file mode 100644 index 6e5b08210147..000000000000 --- a/sw/source/core/unocore/unoclbck.cxx +++ /dev/null @@ -1,85 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: unoclbck.cxx,v $ - * $Revision: 1.10 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_sw.hxx" - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* -----------------------------06.01.00 13:51-------------------------------- - - ---------------------------------------------------------------------------*/ -SwUnoCallBack::SwUnoCallBack(SwModify *pToRegisterIn) : - SwModify(pToRegisterIn) -{ -} -/* -----------------------------06.01.00 13:51-------------------------------- - - ---------------------------------------------------------------------------*/ -SwUnoCallBack::~SwUnoCallBack() -{ -} -/* -----------------------------01.09.00 12:03-------------------------------- - - ---------------------------------------------------------------------------*/ -SwXReferenceMark* SwUnoCallBack::GetRefMark(const SwFmtRefMark& rMark) -{ - return SwXReferenceMark::GetReferenceMark(*this, rMark); -} - -/* -----------------------------05.09.00 12:38-------------------------------- - - ---------------------------------------------------------------------------*/ -SwXFootnote* SwUnoCallBack::GetFootnote(const SwFmtFtn& rMark) -{ - return SwXFootnote::GetXFootnote(*this, rMark); -} - -/* -----------------------------27.11.00 17:15-------------------------------- - - ---------------------------------------------------------------------------*/ -SwXDocumentIndexMark* SwUnoCallBack::GetTOXMark(const SwTOXMark& /*rMark*/) -{ - return 0; -} - diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx index 57f9b05a9c01..daafeb65888b 100644 --- a/sw/source/core/unocore/unocoll.cxx +++ b/sw/source/core/unocore/unocoll.cxx @@ -43,7 +43,6 @@ #include #include #include -#include #include #include #include diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx index ba86f9c509b1..e1601dcbcad1 100644 --- a/sw/source/core/unocore/unoobj.cxx +++ b/sw/source/core/unocore/unoobj.cxx @@ -84,7 +84,6 @@ #include #include #include -#include #include #include #include diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index 53b0da94b12d..90d8c7538a0d 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -75,7 +75,6 @@ #include #include #include -#include #include #include #include diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx index 6e29ff314cf8..fd9722db9616 100644 --- a/sw/source/core/unocore/unoportenum.cxx +++ b/sw/source/core/unocore/unoportenum.cxx @@ -45,7 +45,6 @@ #include #include #include -#include #include #include #include @@ -429,9 +428,7 @@ lcl_CreateRefMarkPortion( SwDoc* pDoc = pUnoCrsr->GetDoc(); const SwFmtRefMark& rRefMark = static_cast(rAttr.GetAttr()); - Reference xContent = - static_cast(pDoc->GetUnoCallBack()) - ->GetRefMark(rRefMark); + Reference xContent; if (!xContent.is()) { xContent = new SwXReferenceMark(pDoc, &rRefMark); @@ -476,15 +473,10 @@ lcl_CreateTOXMarkPortion( SwDoc* pDoc = pUnoCrsr->GetDoc(); const SwTOXMark& rTOXMark = static_cast(rAttr.GetAttr()); - Reference xContent = - static_cast(pDoc->GetUnoCallBack()) - ->GetTOXMark(rTOXMark); - if (!xContent.is()) - { - xContent.set( SwXDocumentIndexMark::CreateXDocumentIndexMark(*pDoc, + Reference xContent( + SwXDocumentIndexMark::CreateXDocumentIndexMark(*pDoc, *const_cast(rTOXMark.GetTOXType()), rTOXMark), - uno::UNO_QUERY); - } + uno::UNO_QUERY); SwXTextPortion* pPortion = 0; if (!bEnd) -- cgit v1.2.3 From c93ddde38115731d4e5ca2dd41f0dced93625cd7 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:14:00 +0100 Subject: swunolocking1: #i107771#: SwXDocumentIndexMark: register at SwTOXMark instead of UnoCallBack. implement instance caching with a WeakReference in SwTOXMark. [the ODF export depends on caching: see XMLIndexMarkExport::GetID()] --- sw/inc/tox.hxx | 32 ++++++++++++++++++--- sw/inc/unoidx.hxx | 4 +-- sw/source/core/docnode/nodes.cxx | 4 ++- sw/source/core/tox/tox.cxx | 34 +++++++++++++++++----- sw/source/core/txtnode/thints.cxx | 2 +- sw/source/core/unocore/unocrsrhelper.cxx | 3 +- sw/source/core/unocore/unoidx.cxx | 49 +++++++++++--------------------- sw/source/core/unocore/unoportenum.cxx | 8 +++--- 8 files changed, 84 insertions(+), 52 deletions(-) diff --git a/sw/inc/tox.hxx b/sw/inc/tox.hxx index 9223ffa2d9df..b7384212a4e5 100644 --- a/sw/inc/tox.hxx +++ b/sw/inc/tox.hxx @@ -27,8 +27,10 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#ifndef _TOX_HXX -#define _TOX_HXX +#ifndef SW_TOX_HXX +#define SW_TOX_HXX + +#include #include #include @@ -47,6 +49,11 @@ #define INCLUDED_VECTOR #endif + +namespace com { namespace sun { namespace star { + namespace text { class XDocumentIndexMark; } +} } } + class SwTOXType; class SwTOXMark; class SwTxtTOXMark; @@ -61,7 +68,9 @@ SV_DECL_PTRARR(SwTOXMarks, SwTOXMark*, 0, 10) #define IVER_TOXMARK_STRPOOL ((USHORT)1) #define IVER_TOXMARK_NEWTOX ((USHORT)2) -class SW_DLLPUBLIC SwTOXMark : public SfxPoolItem, public SwClient +class SW_DLLPUBLIC SwTOXMark + : public SfxPoolItem + , public SwModify { friend void _InitCore(); friend class SwTxtTOXMark; @@ -80,6 +89,8 @@ class SW_DLLPUBLIC SwTOXMark : public SfxPoolItem, public SwClient BOOL bAutoGenerated : 1; // generated using a concordance file BOOL bMainEntry : 1; // main entry emphasized by character style + ::com::sun::star::uno::WeakReference< + ::com::sun::star::text::XDocumentIndexMark> m_wXDocumentIndexMark; SwTOXMark(); // to create the dflt. atr. in _InitCore @@ -97,6 +108,11 @@ public: virtual int operator==( const SfxPoolItem& ) const; virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const; + // SwClient + virtual void Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ); + + void InvalidateTOXMark(); + String GetText() const; inline BOOL IsAlternativeText() const; @@ -131,6 +147,14 @@ public: const SwTxtTOXMark* GetTxtTOXMark() const { return pTxtAttr; } SwTxtTOXMark* GetTxtTOXMark() { return pTxtAttr; } + + SW_DLLPRIVATE ::com::sun::star::uno::WeakReference< + ::com::sun::star::text::XDocumentIndexMark> const& GetXTOXMark() const + { return m_wXDocumentIndexMark; } + SW_DLLPRIVATE void SetXTOXMark(::com::sun::star::uno::Reference< + ::com::sun::star::text::XDocumentIndexMark> const& xMark) + { m_wXDocumentIndexMark = xMark; } + }; /*-------------------------------------------------------------------- @@ -769,4 +793,4 @@ inline void SwTOXBase::SetOptions(USHORT nOpt) } -#endif // _TOX_HXX +#endif // SW_TOX_HXX diff --git a/sw/inc/unoidx.hxx b/sw/inc/unoidx.hxx index dd1edce22d0d..664b0c46a78b 100644 --- a/sw/inc/unoidx.hxx +++ b/sw/inc/unoidx.hxx @@ -207,7 +207,7 @@ private: virtual ~SwXDocumentIndexMark(); SwXDocumentIndexMark(SwDoc & rDoc, - SwTOXType & rType, const SwTOXMark & rMark); + SwTOXType & rType, SwTOXMark & rMark); public: @@ -217,7 +217,7 @@ public: static ::com::sun::star::uno::Reference< ::com::sun::star::text::XDocumentIndexMark> CreateXDocumentIndexMark(SwDoc & rDoc, - SwTOXType & rType, const SwTOXMark & rMark); + SwTOXType & rType, SwTOXMark & rMark); static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); diff --git a/sw/source/core/docnode/nodes.cxx b/sw/source/core/docnode/nodes.cxx index 29d9c61e1ad8..78008db5da00 100644 --- a/sw/source/core/docnode/nodes.cxx +++ b/sw/source/core/docnode/nodes.cxx @@ -48,6 +48,7 @@ #include #include #include +#include // InvalidateTOXMark #include #include @@ -341,7 +342,8 @@ void SwNodes::ChgNode( SwNodeIndex& rDelPos, ULONG nSz, break; case RES_TXTATR_TOXMARK: - nDelMsg = RES_TOXMARK_DELETED; + static_cast(pAttr->GetAttr()) + .InvalidateTOXMark(); break; case RES_TXTATR_REFMARK: diff --git a/sw/source/core/tox/tox.cxx b/sw/source/core/tox/tox.cxx index ddf9a2563a4b..5779b985346d 100644 --- a/sw/source/core/tox/tox.cxx +++ b/sw/source/core/tox/tox.cxx @@ -50,6 +50,7 @@ #include #include #include +#include // SwPtrMsgPoolItem // -> #i21237# #include @@ -176,10 +177,11 @@ SwFormTokens lcl_GetAuthPattern(USHORT nTypeId) --------------------------------------------------------------------*/ - // Konstruktor fuers Default vom Attribut-Pool +/// pool default constructor SwTOXMark::SwTOXMark() - : SfxPoolItem( RES_TXTATR_TOXMARK ), - SwClient( 0 ), + : SfxPoolItem( RES_TXTATR_TOXMARK ) + , SwModify( 0 ) + , pTxtAttr( 0 ), bAutoGenerated(FALSE), bMainEntry(FALSE) @@ -188,8 +190,9 @@ SwTOXMark::SwTOXMark() SwTOXMark::SwTOXMark( const SwTOXType* pTyp ) - : SfxPoolItem( RES_TXTATR_TOXMARK ), - SwClient( (SwModify*)pTyp ), + : SfxPoolItem( RES_TXTATR_TOXMARK ) + , SwModify( const_cast(pTyp) ) + , pTxtAttr( 0 ), nLevel( 0 ), bAutoGenerated(FALSE), bMainEntry(FALSE) @@ -198,8 +201,9 @@ SwTOXMark::SwTOXMark( const SwTOXType* pTyp ) SwTOXMark::SwTOXMark( const SwTOXMark& rCopy ) - : SfxPoolItem( RES_TXTATR_TOXMARK ), - SwClient((SwModify*)rCopy.GetRegisteredIn()), + : SfxPoolItem( RES_TXTATR_TOXMARK ) + , SwModify(rCopy.pRegisteredIn) + , aPrimaryKey( rCopy.aPrimaryKey ), aSecondaryKey( rCopy.aSecondaryKey ), aTextReading( rCopy.aTextReading ), aPrimaryKeyReading( rCopy.aPrimaryKeyReading ), @@ -230,6 +234,22 @@ SfxPoolItem* SwTOXMark::Clone( SfxItemPool* ) const return new SwTOXMark( *this ); } +void SwTOXMark::Modify(SfxPoolItem* pOld, SfxPoolItem* pNew) +{ + SwModify::Modify(pOld, pNew); + if (pOld && (RES_REMOVE_UNO_OBJECT == pOld->Which())) + { // invalidate cached uno object + SetXTOXMark(::com::sun::star::uno::Reference< + ::com::sun::star::text::XDocumentIndexMark>(0)); + } +} + +void SwTOXMark::InvalidateTOXMark() +{ + SwPtrMsgPoolItem aMsgHint( RES_REMOVE_UNO_OBJECT, + &static_cast(*this) ); // cast to base class! + Modify(&aMsgHint, &aMsgHint); +} String SwTOXMark::GetText() const { diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx index 3300294f9e4b..5fdbc0026353 100644 --- a/sw/source/core/txtnode/thints.cxx +++ b/sw/source/core/txtnode/thints.cxx @@ -1174,7 +1174,7 @@ void SwTxtNode::DestroyAttr( SwTxtAttr* pAttr ) break; case RES_TXTATR_TOXMARK: - nDelMsg = RES_TOXMARK_DELETED; + static_cast(pAttr->GetAttr()).InvalidateTOXMark(); break; case RES_TXTATR_REFMARK: diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index 642b0b5030aa..e5540bb9bc3b 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -313,7 +313,8 @@ sal_Bool getCrsrPropertyValue(const SfxItemPropertySimpleEntry& rEntry { if( pAny ) { - const SwTOXMark& rMark = pTxtAttr->GetTOXMark(); + SwTOXMark & rMark = + static_cast(pTxtAttr->GetAttr()); const uno::Reference< text::XDocumentIndexMark > xRef = SwXDocumentIndexMark::CreateXDocumentIndexMark( *rPam.GetDoc(), diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index 807b230c5b6d..db2ab16e5784 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -1598,7 +1598,7 @@ public: SwDoc *const pDoc, const enum TOXTypes eType, SwTOXType *const pType, SwTOXMark const*const pMark) - : SwClient((pDoc) ? pDoc->GetUnoCallBack() : 0) + : SwClient(const_cast(pMark)) , m_rPropSet( *aSwMapProvider.GetPropertySet(lcl_TypeToPropertyMap_Mark(eType))) , m_eTOXType(eType) @@ -1654,19 +1654,6 @@ void SwXDocumentIndexMark::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew) { Invalidate(); } - else if (pOld) - { - switch (pOld->Which()) - { - case RES_TOXMARK_DELETED: - if (static_cast(m_pTOXMark) == - static_cast(pOld)->pObject) - { - Invalidate(); - } - break; - } - } } /*-- 14.12.98 10:25:43--------------------------------------------------- @@ -1680,7 +1667,7 @@ SwXDocumentIndexMark::SwXDocumentIndexMark(const TOXTypes eToxType) -----------------------------------------------------------------------*/ SwXDocumentIndexMark::SwXDocumentIndexMark(SwDoc & rDoc, - SwTOXType & rType, const SwTOXMark & rMark) + SwTOXType & rType, SwTOXMark & rMark) : m_pImpl( new SwXDocumentIndexMark::Impl(*this, &rDoc, rType.GetType(), &rType, &rMark) ) { @@ -1694,23 +1681,20 @@ SwXDocumentIndexMark::~SwXDocumentIndexMark() uno::Reference SwXDocumentIndexMark::CreateXDocumentIndexMark( - SwDoc & rDoc, SwTOXType & rType, const SwTOXMark & rMark) + SwDoc & rDoc, SwTOXType & rType, SwTOXMark & rMark) { + // re-use existing SwXDocumentIndexMark + // NB: xmloff depends on this caching to generate ID from the address! // #i105557#: do not iterate over the registered clients: race condition - // to do this properly requires the SwXDocumentIndexMark to register at the - // format directly, not at the unocallback -#if 0 - SwClientIter aIter(*pType); - SwXDocumentIndexMark::Impl* pxMark = (SwXDocumentIndexMark::Impl*) - aIter.First(TYPE(SwXDocumentIndexMark::Impl)); - while( pxMark ) - { - if(pxMark->m_pTOXMark == pMark) - return pxMark->m_rThis; - pxMark = (SwXDocumentIndexMark::Impl*)aIter.Next(); + uno::Reference< text::XDocumentIndexMark > xTOXMark(rMark.GetXTOXMark()); + if (!xTOXMark.is()) + { + SwXDocumentIndexMark *const pNew = + new SwXDocumentIndexMark(rDoc, rType, rMark); + xTOXMark.set(pNew); + rMark.SetXTOXMark(xTOXMark); } -#endif - return new SwXDocumentIndexMark(rDoc, rType, rMark); + return xTOXMark; } /* -----------------------------10.03.00 18:02-------------------------------- @@ -1955,8 +1939,6 @@ throw (lang::IllegalArgumentException, uno::RuntimeException) { throw lang::IllegalArgumentException(); } - pDoc->GetUnoCallBack()->Add(m_pImpl.get()); - const_cast(pTOXType)->Add(&m_pImpl->m_TypeDepend); SwUnoInternalPaM aPam(*pDoc); //das muss jetzt sal_True liefern @@ -2046,6 +2028,9 @@ throw (lang::IllegalArgumentException, uno::RuntimeException) m_pImpl->m_pTOXMark = &pTxtAttr->GetTOXMark(); m_pImpl->m_pDoc = pDoc; m_pImpl->m_bIsDescriptor = sal_False; + + const_cast(m_pImpl->m_pTOXMark)->Add(m_pImpl.get()); + const_cast(pTOXType)->Add(&m_pImpl->m_TypeDepend); } /*-- 14.12.98 10:25:45--------------------------------------------------- @@ -2268,7 +2253,7 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException, if(pTxtAttr) { m_pImpl->m_pTOXMark = &pTxtAttr->GetTOXMark(); - m_pImpl->m_pDoc->GetUnoCallBack()->Add(m_pImpl.get()); + const_cast(m_pImpl->m_pTOXMark)->Add(m_pImpl.get()); pType->Add(&m_pImpl->m_TypeDepend); } } diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx index fd9722db9616..7996a5e13bcf 100644 --- a/sw/source/core/unocore/unoportenum.cxx +++ b/sw/source/core/unocore/unoportenum.cxx @@ -468,12 +468,12 @@ static Reference lcl_CreateTOXMarkPortion( Reference const& xParent, const SwUnoCrsr * const pUnoCrsr, - const SwTxtAttr & rAttr, const bool bEnd) + SwTxtAttr & rAttr, const bool bEnd) { SwDoc* pDoc = pUnoCrsr->GetDoc(); - const SwTOXMark& rTOXMark = static_cast(rAttr.GetAttr()); + SwTOXMark & rTOXMark = static_cast(rAttr.GetAttr()); - Reference xContent( + const Reference xContent( SwXDocumentIndexMark::CreateXDocumentIndexMark(*pDoc, *const_cast(rTOXMark.GetTOXType()), rTOXMark), uno::UNO_QUERY); @@ -742,7 +742,7 @@ lcl_ExportHints( while(nStartIndex < pHints->GetStartCount() && nCurrentIndex >= (nNextStart = (*pHints->GetStart(nStartIndex)->GetStart()))) { - const SwTxtAttr * const pAttr = pHints->GetStart(nStartIndex); + SwTxtAttr * const pAttr = pHints->GetStart(nStartIndex); USHORT nAttrWhich = pAttr->Which(); if (nNextStart == nCurrentIndex) { -- cgit v1.2.3 From 6d528f43c248ac048957b656af551befd36cb306 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 17:14:01 +0100 Subject: swunolocking1: #i107777#: qadevOOo: fix SwXDocumentIndex{,Mark}.java --- qadevOOo/tests/java/mod/_sw/SwXDocumentIndex.java | 4 ++++ qadevOOo/tests/java/mod/_sw/SwXDocumentIndexMark.java | 9 --------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/qadevOOo/tests/java/mod/_sw/SwXDocumentIndex.java b/qadevOOo/tests/java/mod/_sw/SwXDocumentIndex.java index 5035f0dcd138..73ac3b6b76a3 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXDocumentIndex.java +++ b/qadevOOo/tests/java/mod/_sw/SwXDocumentIndex.java @@ -42,6 +42,7 @@ import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.text.XText; import com.sun.star.text.XTextContent; import com.sun.star.text.XTextCursor; +import com.sun.star.text.XTextRange; import com.sun.star.text.XTextDocument; import com.sun.star.uno.UnoRuntime; @@ -132,6 +133,9 @@ public class SwXDocumentIndex extends TestCase { tEnv.addObjRelation("CONTENT", (XTextContent) UnoRuntime.queryInterface(XTextContent.class,instance)); + oCursor.gotoEnd(false); + tEnv.addObjRelation("RANGE", (XTextRange) + UnoRuntime.queryInterface(XTextRange.class, oCursor)); // relation for XDocumentIndex tEnv.addObjRelation("TextDoc", xTextDoc); diff --git a/qadevOOo/tests/java/mod/_sw/SwXDocumentIndexMark.java b/qadevOOo/tests/java/mod/_sw/SwXDocumentIndexMark.java index ee00f765ca86..bbdf6dc90c19 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXDocumentIndexMark.java +++ b/qadevOOo/tests/java/mod/_sw/SwXDocumentIndexMark.java @@ -126,15 +126,6 @@ public class SwXDocumentIndexMark extends TestCase { XDocumentIndexMark xDIM = (XDocumentIndexMark) UnoRuntime.queryInterface(XDocumentIndexMark.class, oDIM); - try { - xDIM.attach(oText); - //xDIM.setMarkEntry("SwXDocumentIndexMark"); - } catch( com.sun.star.lang.IllegalArgumentException e ) { - log.println("Error: " + e); - e.printStackTrace(log); - throw new StatusException("Couldn't attach IndexMark", e); - } - try { oText.insertTextContent(oCursor, xDIM, false); } catch (com.sun.star.lang.IllegalArgumentException e) { -- cgit v1.2.3 From 0e6633d40e720360f357518d033307b1ab40e93a Mon Sep 17 00:00:00 2001 From: Kurt Zenker Date: Fri, 8 Jan 2010 18:41:41 +0100 Subject: bserver50: #161439# add a broadcast to insert jobs into a module --- soldep/bootstrp/prj.cxx | 120 +++++++++++++++++++++++++++++++++++++++++++--- soldep/inc/soldep/prj.hxx | 14 ++++++ 2 files changed, 127 insertions(+), 7 deletions(-) diff --git a/soldep/bootstrp/prj.cxx b/soldep/bootstrp/prj.cxx index c26f50ae3f7c..5e93c1142673 100644 --- a/soldep/bootstrp/prj.cxx +++ b/soldep/bootstrp/prj.cxx @@ -216,6 +216,7 @@ CommandData::CommandData() nOSType = 0; nCommand = 0; pDepList = 0; + pCommandList = 0; } /*****************************************************************************/ @@ -234,6 +235,18 @@ CommandData::~CommandData() pDepList = NULL; } + if ( pCommandList ) + { + ByteString *pString = pCommandList->First(); + while ( pString ) + { + delete pString; + pString = pCommandList->Next(); + } + delete pCommandList; + + pCommandList = NULL; + } } /*****************************************************************************/ @@ -295,6 +308,15 @@ ByteString CommandData::GetCommandTypeString() return aRetStr; } +/*****************************************************************************/ +void CommandData::AddCommand(ByteString* pCommand) +/*****************************************************************************/ +{ + if (!pCommandList) + pCommandList = new SByteStringList(); + pCommandList->Insert(pCommand, LIST_APPEND); +} + /*****************************************************************************/ CommandData& CommandData::operator>> ( SvStream& rStream ) /*****************************************************************************/ @@ -325,6 +347,14 @@ CommandData& CommandData::operator>> ( SvStream& rStream ) else rStream << sal_False; + if (pCommandList) + { + rStream << sal_True; + *pCommandList >> rStream; + } + else + rStream << sal_False; + return *this; } @@ -361,7 +391,26 @@ CommandData& CommandData::operator<< ( SvStream& rStream ) *pDepList << rStream; } else + { + if (pDepList) DELETEZ (pDepList); + } + + BOOL bCommandList; + rStream >> bCommandList; + if (pCommandList) + pCommandList->CleanUp(); + if (bCommandList) + { + if (!pCommandList) + pCommandList = new SByteStringList(); + *pCommandList << rStream; + } + else + { + if (pCommandList) + DELETEZ (pCommandList); + } return *this; } @@ -751,11 +800,12 @@ CommandData* Prj::GetDirectoryList ( USHORT nWhatOS, USHORT nCommand ) CommandData* Prj::GetDirectoryData( ByteString aLogFileName ) /*****************************************************************************/ { + PrjList* pPrjList = GetCommandDataList (); CommandData *pData = NULL; - ULONG nCount_l = Count(); + ULONG nCount_l = pPrjList->Count(); for ( ULONG i=0; iGetObject(i); if ( pData->GetLogFile() == aLogFileName ) return pData; } @@ -775,7 +825,9 @@ Prj::Prj() : bHardDependencies( FALSE ), bFixedDependencies( FALSE ), bVisited( FALSE ), - bIsAvailable( TRUE ) + bIsAvailable( TRUE ), + pTempCommandDataList (0), + bTempCommandDataListPermanent (FALSE) /*****************************************************************************/ { } @@ -790,7 +842,9 @@ Prj::Prj( ByteString aName ) : bHardDependencies( FALSE ), bFixedDependencies( FALSE ), bVisited( FALSE ), - bIsAvailable( TRUE ) + bIsAvailable( TRUE ), + pTempCommandDataList (0), + bTempCommandDataListPermanent (FALSE) /*****************************************************************************/ { } @@ -954,7 +1008,8 @@ BOOL Prj::InsertDirectory ( ByteString aDirName, USHORT aWhat, pData->SetLogFile( aLogFileName ); pData->SetClientRestriction( rClientRestriction ); - Insert( pData ); + PrjList* pPrjList = GetCommandDataList (); + pPrjList->Insert( pData ); return FALSE; } @@ -966,14 +1021,15 @@ BOOL Prj::InsertDirectory ( ByteString aDirName, USHORT aWhat, CommandData* Prj::RemoveDirectory ( ByteString aLogFileName ) /*****************************************************************************/ { - ULONG nCount_l = Count(); + PrjList* pPrjList = GetCommandDataList (); + ULONG nCount_l = pPrjList->Count(); CommandData* pData; CommandData* pDataFound = NULL; SByteStringList* pDataDeps; for ( USHORT i = 0; i < nCount_l; i++ ) { - pData = GetObject( i ); + pData = pPrjList->GetObject( i ); if ( pData->GetLogFile() == aLogFileName ) pDataFound = pData; else @@ -1032,6 +1088,56 @@ void Prj::ExtractDependencies() } } +/*****************************************************************************/ +PrjList* Prj::GetCommandDataList () +/*****************************************************************************/ +{ + if (pTempCommandDataList) + return pTempCommandDataList; + else + return (PrjList*)this; +} + +/*****************************************************************************/ +void Prj::RemoveTempCommandDataList() +/*****************************************************************************/ +{ + if (pTempCommandDataList) + { + delete pTempCommandDataList; // this list remove the elements by itself + pTempCommandDataList = NULL; + } +} + +/*****************************************************************************/ +void Prj::GenerateTempCommandDataList() +/*****************************************************************************/ +{ + if (pTempCommandDataList) + RemoveTempCommandDataList(); + pTempCommandDataList = new PrjList(); + CommandData* pCommandData = First(); + while (pCommandData) { + SvMemoryStream* pStream = new SvMemoryStream(); + *pCommandData >> *pStream; + CommandData* pNewCommandData = new CommandData(); + pStream->Seek( STREAM_SEEK_TO_BEGIN ); + *pNewCommandData << *pStream; + pTempCommandDataList->Insert(pNewCommandData, LIST_APPEND); + delete pStream; + pCommandData = Next(); + } +} + +/*****************************************************************************/ +void Prj::GenerateEmptyTempCommandDataList() +/*****************************************************************************/ +{ + if (pTempCommandDataList) + RemoveTempCommandDataList(); + pTempCommandDataList = new PrjList(); +} + /*****************************************************************************/ Prj& Prj::operator>> ( SvStream& rStream ) /*****************************************************************************/ diff --git a/soldep/inc/soldep/prj.hxx b/soldep/inc/soldep/prj.hxx index 858afac2d56a..bd94a3e87f9a 100644 --- a/soldep/inc/soldep/prj.hxx +++ b/soldep/inc/soldep/prj.hxx @@ -87,6 +87,7 @@ class CommandData ByteString aComment; ByteString sClientRestriction; SByteStringList *pDepList; + SByteStringList *pCommandList; USHORT nOSType; USHORT nCommand; @@ -131,6 +132,9 @@ public: void AddDepth(){nDepth++;} ULONG GetDepth(){return nDepth;} + void AddCommand(ByteString* pCommand); + SByteStringList* GetCommandList() {return pCommandList;} + CommandData& operator<< ( SvStream& rStream ); CommandData& operator>> ( SvStream& rStream ); }; @@ -284,6 +288,8 @@ private: BOOL bIsAvailable; SByteStringList* RemoveStringList(SByteStringList* pStringList ); SDepInfoList* RemoveDepInfoList(SDepInfoList* pInfoList ); + PrjList* pTempCommandDataList; + BOOL bTempCommandDataListPermanent; public: Prj(); Prj( ByteString aName ); @@ -318,6 +324,14 @@ public: void ExtractDependencies(); + PrjList* GetCommandDataList (); + void RemoveTempCommandDataList(); + void GenerateTempCommandDataList(); + void GenerateEmptyTempCommandDataList(); + BOOL HasTempCommandDataList() {return pTempCommandDataList != NULL;} + void SetTempCommandDataListPermanent (BOOL bVar = TRUE) {bTempCommandDataListPermanent = bVar;} + BOOL IsTempCommandDataListPermanent() {return bTempCommandDataListPermanent;} + Prj& operator<< ( SvStream& rStream ); Prj& operator>> ( SvStream& rStream ); }; -- cgit v1.2.3 From 66c1f6c7ffc872283f257dfd1ec40cd5c7a5dfa6 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 8 Jan 2010 20:23:02 +0000 Subject: cmcfixes69: #i108165#: remove unused ctor --- .../unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx | 8 -------- .../unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx | 1 - 2 files changed, 9 deletions(-) diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx index 45a38fd86361..6011ff35dcfe 100644 --- a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx +++ b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx @@ -446,14 +446,6 @@ DictionaryEntry::DictionaryEntry( const rtl::OUString& rTerm, const rtl::OUStrin m_nConversionPropertyType = 1; } -DictionaryEntry::DictionaryEntry() - : m_aTerm() - , m_aMapping() - , m_nConversionPropertyType( linguistic2::ConversionPropertyType::OTHER ) - , m_bNewEntry( sal_True ) -{ -} - DictionaryEntry::~DictionaryEntry() { } diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx index b9784ef0e8ff..54184a7998a5 100644 --- a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx +++ b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.hxx @@ -61,7 +61,6 @@ namespace textconversiondlgs struct DictionaryEntry { - DictionaryEntry(); DictionaryEntry( const rtl::OUString& rTerm, const rtl::OUString& rMapping , sal_Int16 nConversionPropertyType //linguistic2::ConversionPropertyType , sal_Bool bNewEntry = sal_False ); -- cgit v1.2.3 -- cgit v1.2.3 From 0aab9a48358f905de8d65568e5f32e8d36d6021c Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 22:22:08 +0100 Subject: swunolocking1: #i108161#: WeakReferenceHelper::operator=(): avoid creating a temporary WeakReferenceHelper for uno::Reference assignment. [according to callgrind this is 3 times faster] --- cppuhelper/inc/cppuhelper/weakref.hxx | 21 +++++++++++++++++---- cppuhelper/source/cc5_solaris_sparc.map | 1 + cppuhelper/source/gcc3.map | 1 + cppuhelper/source/weak.cxx | 16 ++++++++++++---- 4 files changed, 31 insertions(+), 8 deletions(-) diff --git a/cppuhelper/inc/cppuhelper/weakref.hxx b/cppuhelper/inc/cppuhelper/weakref.hxx index 01a4c7c6e0df..a8506f036f21 100644 --- a/cppuhelper/inc/cppuhelper/weakref.hxx +++ b/cppuhelper/inc/cppuhelper/weakref.hxx @@ -79,13 +79,15 @@ public: */ WeakReferenceHelper & SAL_CALL operator = ( const WeakReferenceHelper & rWeakRef ) SAL_THROW( () ); - /** Releases this reference and takes over hard reference xInt. If the implementation behind - xInt does not support XWeak or XInt is null, than this reference is null. + /** Releases this reference and takes over hard reference xInt. + If the implementation behind xInt does not support XWeak + or XInt is null, then this reference is null. @param xInt another hard reference */ - inline WeakReferenceHelper & SAL_CALL operator = ( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & xInt ) SAL_THROW( () ) - { return operator = ( WeakReferenceHelper( xInt ) ); } + WeakReferenceHelper & SAL_CALL operator = ( + const ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XInterface > & xInt ) SAL_THROW( () ); /** Returns true if both weak refs reference to the same object. @@ -135,6 +137,17 @@ public: : WeakReferenceHelper( rRef ) {} + /** Releases this reference and takes over hard reference xInt. + If the implementation behind xInt does not support XWeak + or XInt is null, then this reference is null. + + @param xInt another hard reference + */ + WeakReference & SAL_CALL operator = ( + const ::com::sun::star::uno::Reference< interface_type > & xInt ) + SAL_THROW( () ) + { WeakReferenceHelper::operator=(xInt); return *this; } + /** Gets a hard reference to the object. @return hard reference or null, if the weakly referenced interface has gone diff --git a/cppuhelper/source/cc5_solaris_sparc.map b/cppuhelper/source/cc5_solaris_sparc.map index 0961c6830d1f..0cda7be0bb7d 100755 --- a/cppuhelper/source/cc5_solaris_sparc.map +++ b/cppuhelper/source/cc5_solaris_sparc.map @@ -383,4 +383,5 @@ UDK_3.6 { # OOo 3.0 UDK_3.7 { # OOo 3.3 global: __1cEcppuLOWeakObjectbAdisposeWeakConnectionPoint6M_v_; + __1cDcomDsunEstarDunoTWeakReferenceHelper2G6Mrkn0DJReference4n0DKXInterface____r4_; } UDK_3.6; diff --git a/cppuhelper/source/gcc3.map b/cppuhelper/source/gcc3.map index 9348e91525c0..6b6bac67d8f7 100644 --- a/cppuhelper/source/gcc3.map +++ b/cppuhelper/source/gcc3.map @@ -377,5 +377,6 @@ UDK_3.5 { # OOo 3.0 UDK_3.6 { # OOo 3.3 global: _ZN4cppu11OWeakObject26disposeWeakConnectionPointEv; + _ZN3com3sun4star3uno19WeakReferenceHelperaSERKNS2_9ReferenceINS2_10XInterfaceEEE; } UDK_3.5; diff --git a/cppuhelper/source/weak.cxx b/cppuhelper/source/weak.cxx index b518d2526e3b..1901610d40b7 100644 --- a/cppuhelper/source/weak.cxx +++ b/cppuhelper/source/weak.cxx @@ -481,11 +481,20 @@ WeakReferenceHelper::WeakReferenceHelper(const WeakReferenceHelper& rWeakRef) SA WeakReferenceHelper& WeakReferenceHelper::operator=(const WeakReferenceHelper& rWeakRef) SAL_THROW( () ) { - try + if (this == &rWeakRef) { - if (this != &rWeakRef) + return *this; + } + Reference< XInterface > xInt( rWeakRef.get() ); + return operator = ( xInt ); +} + +WeakReferenceHelper & SAL_CALL +WeakReferenceHelper::operator= (const Reference< XInterface > & xInt) +SAL_THROW( () ) +{ + try { - Reference< XInterface > xInt( rWeakRef.get() ); if (m_pImpl) { if (m_pImpl->m_XWeakConnectionPoint.is()) @@ -502,7 +511,6 @@ WeakReferenceHelper& WeakReferenceHelper::operator=(const WeakReferenceHelper& r m_pImpl->acquire(); } } - } catch (RuntimeException &) { OSL_ASSERT( 0 ); } // assert here, but no unexpected() return *this; } -- cgit v1.2.3 From 5468c694b9f87b60ed961ccff472131d14881189 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Jan 2010 22:22:08 +0100 Subject: swunolocking1: dmake depend=t is utterly broken; patch by ause to fix it... --- solenv/inc/tg_dep.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/solenv/inc/tg_dep.mk b/solenv/inc/tg_dep.mk index 22eb11198bb2..8fb6d5502fd4 100644 --- a/solenv/inc/tg_dep.mk +++ b/solenv/inc/tg_dep.mk @@ -94,6 +94,7 @@ ALLDPC: @echo $(EMQ)# > $(MISC)/$(TARGET).dpc ALLDEP: + @echo nothing to do here... .ENDIF -- cgit v1.2.3 From 28159e10f92b56dadb2cec057532f41f4fa51fad Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sat, 9 Jan 2010 14:59:14 +0000 Subject: cmcfixes69: #i108178#: delete allocated object (removes unused code warning from callcatcher) --- soltools/mkdepend/collectdircontent.cxx | 4 ++++ soltools/mkdepend/collectdircontent.hxx | 1 + soltools/mkdepend/main.c | 3 +++ 3 files changed, 8 insertions(+) diff --git a/soltools/mkdepend/collectdircontent.cxx b/soltools/mkdepend/collectdircontent.cxx index 691996d56cca..c9308faf0562 100755 --- a/soltools/mkdepend/collectdircontent.cxx +++ b/soltools/mkdepend/collectdircontent.cxx @@ -73,6 +73,10 @@ extern "C" { return new IncludesCollection; } + void delete_IncludesCollection(IncludesCollection *m) { + delete m; + } + int call_IncludesCollection_exists(IncludesCollection* m, const char * filePath) { return m->exists(filePath); } diff --git a/soltools/mkdepend/collectdircontent.hxx b/soltools/mkdepend/collectdircontent.hxx index 1ffd9cf60f0c..1896df0c8bc7 100644 --- a/soltools/mkdepend/collectdircontent.hxx +++ b/soltools/mkdepend/collectdircontent.hxx @@ -47,6 +47,7 @@ extern "C" { #endif struct IncludesCollection * create_IncludesCollection(void); +void delete_IncludesCollection(struct IncludesCollection *); int call_IncludesCollection_exists(struct IncludesCollection* m, const char* filePath); diff --git a/soltools/mkdepend/main.c b/soltools/mkdepend/main.c index a786f5a4d7f6..fd9bdc18e5d2 100644 --- a/soltools/mkdepend/main.c +++ b/soltools/mkdepend/main.c @@ -465,6 +465,9 @@ int main(argc, argv) } if (printed) printf("\n"); + + delete_IncludesCollection(incCollection); + exit(0); } -- cgit v1.2.3 From 81f4386da532ba62e5e2381e57485197ce5da0bf Mon Sep 17 00:00:00 2001 From: sj Date: Mon, 11 Jan 2010 12:28:07 +0100 Subject: impress181: #i74384# correctly interpreting maxcolor value vor ppm (taking care also for pbp) --- goodies/source/filter.vcl/ipbm/ipbm.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/goodies/source/filter.vcl/ipbm/ipbm.cxx b/goodies/source/filter.vcl/ipbm/ipbm.cxx index c0b0f6012116..3c30dd0c2ba3 100644 --- a/goodies/source/filter.vcl/ipbm/ipbm.cxx +++ b/goodies/source/filter.vcl/ipbm/ipbm.cxx @@ -172,6 +172,7 @@ BOOL PBMReader::ImplReadHeader() *mpPBM >> nID[ 0 ] >> nID[ 1 ]; if ( nID[ 0 ] != 'P' ) return FALSE; + mnMaxVal = mnWidth = mnHeight = 0; switch ( nID[ 1 ] ) { case '1' : @@ -179,6 +180,7 @@ BOOL PBMReader::ImplReadHeader() case '4' : mnMode = 0; nMax = 2; // number of parameters in Header + mnMaxVal = 1; break; case '2' : mbRaw = FALSE; @@ -195,9 +197,6 @@ BOOL PBMReader::ImplReadHeader() default: return FALSE; } - - mnMaxVal = mnWidth = mnHeight = 0; - while ( bFinished == FALSE ) { if ( mpPBM->GetError() ) -- cgit v1.2.3 From bb94dd8918d401094768173d99ecf5a6efeb6739 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Mon, 11 Jan 2010 16:02:06 +0100 Subject: swunolocking1: #i108161#: add forgotten since tag --- cppuhelper/inc/cppuhelper/weakref.hxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cppuhelper/inc/cppuhelper/weakref.hxx b/cppuhelper/inc/cppuhelper/weakref.hxx index a8506f036f21..a4f9f46eabd9 100644 --- a/cppuhelper/inc/cppuhelper/weakref.hxx +++ b/cppuhelper/inc/cppuhelper/weakref.hxx @@ -142,6 +142,8 @@ public: or XInt is null, then this reference is null. @param xInt another hard reference + + @since UDK 3.2.12 */ WeakReference & SAL_CALL operator = ( const ::com::sun::star::uno::Reference< interface_type > & xInt ) -- cgit v1.2.3 From c7fcabef35a9ccf49a5de2c8ff1470aee77c238d Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 12 Jan 2010 11:18:27 +0000 Subject: cmcfixes69: #i106157# support system graphite, even with a different stlport --- vcl/inc/postgraphitestl.h | 12 ++---------- vcl/inc/pregraphitestl.h | 20 +++++++++----------- 2 files changed, 11 insertions(+), 21 deletions(-) diff --git a/vcl/inc/postgraphitestl.h b/vcl/inc/postgraphitestl.h index 8a8a0ca056ae..736aa248b7ff 100644 --- a/vcl/inc/postgraphitestl.h +++ b/vcl/inc/postgraphitestl.h @@ -1,17 +1,9 @@ #ifdef std_was_redefined_as_stlport // put things back the way they were # define std std_was_redefined_as_stlport -# undef _STLP_DONT_REDEFINE_STD -# undef _STLP_WHOLE_NATIVE_STD -# undef _STLP_STRING -# undef _STLP_IOSTREAM -# undef _STLP_IOSFWD -# undef _STLP_IOMANIP -# undef _STLP_ALGORITHM -# undef _STLP_VECTOR -# undef _STLP_SET -# undef _STLP_MAP +# undef _STLP_OUTERMOST_HEADER_ID // force config to be re-read +# undef _STLP_NOTHROW_INHERENTLY # undef _STLP_CONFIG_H # include #endif diff --git a/vcl/inc/pregraphitestl.h b/vcl/inc/pregraphitestl.h index 84bede349d4f..ece0af477113 100644 --- a/vcl/inc/pregraphitestl.h +++ b/vcl/inc/pregraphitestl.h @@ -1,23 +1,20 @@ #if defined(GRAPHITEADAPTSTL) && defined(std) +# include +# include +# include +# include +# include +# include # define std_was_redefined_as_stlport std # undef std -# undef _STLP_CONFIG_H -# undef _STLP_STRING -# undef _STLP_IOSTREAM -# undef _STLP_IOSFWD -# undef _STLP_IOMANIP -# undef _STLP_ALGORITHM -# undef _STLP_VECTOR -# undef _STLP_SET -# undef _STLP_MAP -# define _STLP_DONT_REDEFINE_STD 1 -# define _STLP_WHOLE_NATIVE_STD 1 +# define _STLP_OUTERMOST_HEADER_ID 0xdeadbeaf # pragma GCC visibility push(default) # include _STLP_NATIVE_HEADER(exception_defines.h) # include _STLP_NATIVE_HEADER(limits) # include _STLP_NATIVE_HEADER(memory) # include _STLP_NATIVE_HEADER(exception) # include _STLP_NATIVE_HEADER(iosfwd) +# include _STLP_NATIVE_HEADER(algorithm) # include _STLP_NATIVE_HEADER(string) # include _STLP_NATIVE_HEADER(streambuf) # include _STLP_NATIVE_HEADER(ios) @@ -26,6 +23,7 @@ # include _STLP_NATIVE_HEADER(ostream) # include _STLP_NATIVE_HEADER(istream) # include _STLP_NATIVE_HEADER(iostream) +# include _STLP_NATIVE_HEADER(vector) # pragma GCC visibility pop #endif //sil_std resolves to the std that Graphite was built with -- cgit v1.2.3 From ff0b3db30d0aba0605601c1aa514de83d4d3bc81 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 12 Jan 2010 11:18:27 +0000 Subject: cmcfixes69: #i106157# support system graphite, even with a different stlport --- configure | 25900 +++++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 15973 insertions(+), 9927 deletions(-) diff --git a/configure b/configure index 7298fe182c7c..409ec509e222 100755 --- a/configure +++ b/configure @@ -1,416 +1,82 @@ #! /bin/sh # From configure.in Revision: 1.290 . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.65. -# -# -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. -# +# Generated by GNU Autoconf 2.59. # +# Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix fi +DUALCASE=1; export DUALCASE # for MKS sh -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi -" - as_required="as_fn_return () { (exit \$1); } -as_fn_success () { as_fn_return 0; } -as_fn_failure () { as_fn_return 1; } -as_fn_ret_success () { return 0; } -as_fn_ret_failure () { return 1; } - -exitcode=0 -as_fn_success || { exitcode=1; echo as_fn_success failed.; } -as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } -as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } -as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : - -else - exitcode=1; echo positional parameters were not saved. -fi -test x\$exitcode = x0 || exit 1" - as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO - as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO - eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : - as_have_required=yes -else - as_have_required=no -fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : - -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_found=false -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - as_found=: - case $as_dir in #( - /*) - for as_base in sh bash ksh sh5; do - # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : - CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : - break 2 -fi -fi - done;; - esac - as_found=false -done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } -IFS=$as_save_IFS - - - if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} -fi - - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var else - $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, -$0: including any error possibly output before this -$0: message. Then install a modern shell, or manually run -$0: the script under such a shell if you do have one." - fi - exit 1 -fi -fi -fi -SHELL=${CONFIG_SHELL-/bin/sh} -export SHELL -# Unset more variables known to interfere with behavior of common tools. -CLICOLOR_FORCE= GREP_OPTIONS= -unset CLICOLOR_FORCE GREP_OPTIONS - -## --------------------- ## -## M4sh Shell Functions. ## -## --------------------- ## -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" - - -} # as_fn_mkdir_p -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -# as_fn_error ERROR [LINENO LOG_FD] -# --------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with status $?, using 1 if that was 0. -as_fn_error () -{ - as_status=$?; test $as_status -eq 0 && as_status=1 - if test "$3"; then - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + $as_unset $as_var fi - $as_echo "$as_me: error: $1" >&2 - as_fn_exit $as_status -} # as_fn_error +done -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi -as_me=`$as_basename -- "$0" || +# Name of the executable. +as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + +# PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' @@ -418,107 +84,146 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac - as_lineno_1=$LINENO as_lineno_1a=$LINENO - as_lineno_2=$LINENO as_lineno_2a=$LINENO - eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && - test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { - # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop - s/-\n.*// + s,-$,, + s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + chmod +x $as_me.lineno || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno # Exit status is that of the last command. exit } -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null + as_expr=false fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links as_ln_s='cp -p' + else + as_ln_s='ln -s' fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null +rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' + as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x +as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -527,25 +232,38 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -test -n "$DJDIR" || exec 7<&0 &1 +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` +exec 6>&1 + # # Initializations. # ac_default_prefix=/usr/local -ac_clean_files= ac_config_libobj_dir=. -LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME= @@ -553,625 +271,50 @@ PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= -PACKAGE_URL= # Factoring default headers for most tests. ac_includes_default="\ #include -#ifdef HAVE_SYS_TYPES_H +#if HAVE_SYS_TYPES_H # include #endif -#ifdef HAVE_SYS_STAT_H +#if HAVE_SYS_STAT_H # include #endif -#ifdef STDC_HEADERS +#if STDC_HEADERS # include # include #else -# ifdef HAVE_STDLIB_H +# if HAVE_STDLIB_H # include # endif #endif -#ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif -#ifdef HAVE_STRINGS_H +#if HAVE_STRINGS_H # include #endif -#ifdef HAVE_INTTYPES_H +#if HAVE_INTTYPES_H # include +#else +# if HAVE_STDINT_H +# include +# endif #endif -#ifdef HAVE_STDINT_H -# include -#endif -#ifdef HAVE_UNISTD_H +#if HAVE_UNISTD_H # include #endif" -ac_subst_vars='LTLIBOBJS -LIBOBJS -BUILD_TYPE -LOCAL_SOLVER -VERBOSE -ENABLE_LAYOUT -ENABLE_STATIC_GTK -UNIXWRAPPERNAME -OOO_VENDOR -ABOUT_BITMAPS -INTRO_BITMAPS -WITH_DICT -WITH_POOR_HELP_LOCALIZATIONS -WITH_LANG -ANT_LIB -ANT_HOME -ANT -XINERAMA_LINK -USE_XINERAMA -SCPDEFS -WITHOUT_AFMS -WITHOUT_PPDS -WITH_FONTS -ENABLE_KAB -ENABLE_EVOAB2 -GOBJECT_LIBS -GOBJECT_CFLAGS -ENABLE_LOCKDOWN -KDE4_LIBS -KDE4_CFLAGS -MOC4 -KDE_LIBS -KDE_CFLAGS -MOC -COMMONS_LOGGING_JAR -COMMONS_HTTPCLIENT_JAR -COMMONS_LANG_JAR -COMMONS_CODEC_JAR -SYSTEM_APACHE_COMMONS -LIBSERIALIZER_JAR -LIBFONTS_JAR -LIBREPOSITORY_JAR -LIBFORMULA_JAR -LIBLOADER_JAR -LIBLAYOUT_JAR -LIBBASE_JAR -JFREEREPORT_JAR -FLUTE_JAR -LIBXML_JAR -SAC_JAR -SYSTEM_JFREEREPORT -ENABLE_REPORTBUILDER -SERVLETAPI_JAR -SYSTEM_SERVLETAPI -ENABLE_MEDIAWIKI -SYSTEM_POPPLER -ENABLE_PDFIMPORT -POPPLER_LIBS -POPPLER_CFLAGS -ENABLE_PRESENTER_SCREEN -ENABLE_MINIMIZER -ENABLE_OPENGL -SYSTEM_CAIRO -BUILD_PIXMAN -ENABLE_CAIRO -CAIRO_LIBS -CAIRO_CFLAGS -ENABLE_SYSTRAY_GTK -ENABLE_DBUS -ENABLE_GIO -GIO_LIBS -GIO_CFLAGS -DBUS_LIBS -DBUS_CFLAGS -GTK_LIBS -GTK_CFLAGS -ENABLE_GNOMEVFS -GNOMEVFS_LIBS -GNOMEVFS_CFLAGS -ENABLE_GCONF -GCONF_LIBS -GCONF_CFLAGS -ENABLE_KDE4 -ENABLE_KDE -ENABLE_GTK -ZIP_HOME -UNZIP -ZIP -ASM_HOME -ML_EXE -CYGWIN_PATH -GNUPATCH -GNUCP -PATCH -FLEX -BISON -NSIS_PATH -DIRECTXSDK_LIB -DIRECTXSDK_HOME -WINDOWS_VISTA_PSDK -PSDK_HOME -SYSTEM_LPSOLVE -SYSTEM_MYTHES -HYPHEN_LIB -SYSTEM_HYPH -SYSTEM_HUNSPELL -HUNSPELL_LIBS -HUNSPELL_CFLAGS -SYSTEM_REDLAND -REDLAND_LIBS -REDLAND_CFLAGS -AGG_VERSION -SYSTEM_AGG -AGG_LIBS -AGG_CFLAGS -ENABLE_AGG -SYSTEM_OPENSSL -OPENSSL_LIBS -OPENSSL_CFLAGS -NEON_VERSION -SYSTEM_NEON -NEON_LIBS -NEON_CFLAGS -DISABLE_NEON -ENABLE_RANDR -XRANDR_DLOPEN -XRANDR_LIBS -XRANDR_CFLAGS -XRENDER_LINK -SYSTEM_XRENDER_HEADERS -DISABLE_XAW -XAU_LIBS -XLIB -XINC -X_EXTRA_LIBS -X_LIBS -X_PRE_LIBS -X_CFLAGS -XMKMF -SYSTEM_GRAPHITE -ENABLE_GRAPHITE -GRAPHITE_LIBS -GRAPHITE_CFLAGS -SYSTEM_ICU -SYSTEM_GENCMN -SYSTEM_GENCCODE -SYSTEM_GENBRK -SYSTEM_SANE_HEADER -MOZ_LDAP_CFLAGS -MOZ_LIB_XPCOM -MOZ_LIB -MOZ_INC -MOZ_FLAVOUR -SYSTEM_MOZILLA -MOZILLABUILD -ENABLE_NSS_MODULE -BUILD_MOZAB -MOZLIBREQ_LIBS -MOZLIBREQ_CFLAGS -MOZGTK2_LIBS -MOZGTK2_CFLAGS -MOZILLA_TOOLKIT -MOZILLA_VERSION -MOZILLAXPCOM_LIBS -MOZILLAXPCOM_CFLAGS -NSPR_LIB -MOZ_NSPR_LIBS -MOZ_NSPR_CFLAGS -NSS_LIB -MOZ_NSS_LIBS -MOZ_NSS_CFLAGS -WITH_OPENLDAP -WITH_LDAP -WITH_MOZILLA -SYSTEM_ODBC_HEADERS -SYSTEM_VIGRA -SYSTEM_BOOST -CURL_LIBS -CURL_CFLAGS -SYSTEM_CURL -CURLCONFIG -SAXON_JAR -SYSTEM_SAXON -SERIALIZER_JAR -BSH_JAR -SYSTEM_BSH -HSQLDB_JAR -SYSTEM_HSQLDB -LUCENE_ANALYZERS_JAR -LUCENE_CORE_JAR -SYSTEM_LUCENE -DB_JAR -DB_INCLUDES -DB_VERSION -SYSTEM_DB -HOME -PYTHON_LIBS -PYTHON_CFLAGS -SYSTEM_PYTHON -BZIP2 -pkgpyexecdir -pyexecdir -pkgpythondir -pythondir -PYTHON_PLATFORM -PYTHON_EXEC_PREFIX -PYTHON_PREFIX -PYTHON_VERSION -PYTHON -SYSTEM_LIBXML -LIBXML_LIBS -LIBXML_CFLAGS -SYSTEM_LIBXSLT -XSLTPROC -LIBXSLT_LIBS -LIBXSLT_CFLAGS -USE_FT_EMBOLDEN -FREETYPE_LIBS -FREETYPE_CFLAGS -SYSTEM_LIBWPD -LIBWPD_LIBS -LIBWPD_CFLAGS -PKG_CONFIG -SYSTEM_EXPAT -SYSTEM_JPEG -SYSTEM_ZLIB -SYSTEM_STDLIBS -BUILD_QADEVOOO -BUILD_UNOWINREG -MINGWSTRIP -MINGWCXX -GPERF -RPM -PKGFORMAT -BUILD_EPM -PKGMK -DPKG -EPM -BUILD_DMAKE -DMAKE -JAVAFLAGS -JDK -JAVA_HOME -JAVAAOTCOMPILER -AWTLIB -JAVADOC -JAVACISGCJ -JAVACOMPILER -JAVAINTERPRETER -SOLAR_JAVA -BUILD_VER_STRING -ALLOC -HAVE_GCC_VISIBILITY_FEATURE -CCACHE -USE_CCACHE -USE_SYSTEM_STL -STLPORT_VER -STLPORT4 -EXCEPTIONS -MINGW_GXXDLL -MINGW_GCCDLL -MINGW_SHARED_GXXLIB -MINGW_GCCLIB_EH -MINGW_SHARED_GCCLIB -MINGW_CLIB_DIR -MINGW_BACKWARD_INCLUDE_PATH -MINGW_LIB_INCLUDE_PATH -GXX_INCLUDE_PATH -CRYPT_LINK -PAM_LINK -NEW_SHADOW_API -PAM -VBA_EXTENSION -ENABLE_VBA -LFS_CFLAGS -WORDS_BIGENDIAN -SIZEOF_LONG -CXXCPP -ac_ct_CXX -CXXFLAGS -CXX -CPP -FRAME_HOME -CSC_PATH -MIDL_PATH -USE_MINGW -COMEX -MSPDB_PATH -PERL -HAVE_LD_HASH_STYLE -_cc -GNUMAKE -NO_HIDS -ENABLE_PCH -HAVE_LD_BSYMBOLIC_FUNCTIONS -GCCVER -COMPATH -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC -GCC_HOME -SHELLPATH -WITH_MINGWIN -USE_SHELL -THES_SYSTEM_DIR -HYPH_SYSTEM_DIR -DICT_SYSTEM_DIR -SYSTEM_DICTS -WITH_MYSPELL_DICTS -ENABLE_RPATH -DISABLE_ATL -DISABLE_ACTIVEX -ENABLE_DIRECTX -WITH_BINFILTER -ENABLE_FONTCONFIG -ENABLE_CUPS -DISABLE_STRIP -ENABLE_SYMBOLS -PROEXT -PROFULLSWITCH -PRODUCT -ENABLE_DEBUG -ENABLE_WERROR -VC_STANDARD -ENABLE_CRASHDUMP -PTHREAD_LIBS -PTHREAD_CFLAGS -OSVERSION -GNUTAR -target_os -target_vendor -target_cpu -target -host_os -host_vendor -host_cpu -host -build_os -build_vendor -build_cpu -build -SOURCEVERSION -UPD -_solenv -LOCAL_SOLENV -SED -AWK -EGREP -GREP -target_alias -host_alias -build_alias -LIBS -ECHO_T -ECHO_N -ECHO_C -DEFS -mandir -localedir -libdir -psdir -pdfdir -dvidir -htmldir -infodir -docdir -oldincludedir -includedir -localstatedir -sharedstatedir -sysconfdir -datadir -datarootdir -libexecdir -sbindir -bindir -program_transform_name -prefix -exec_prefix -PACKAGE_URL -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME -PATH_SEPARATOR -SHELL' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS EGREP AWK SED LOCAL_SOLENV _solenv UPD SOURCEVERSION build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os GNUTAR OSVERSION PTHREAD_CFLAGS PTHREAD_LIBS ENABLE_CRASHDUMP VC_STANDARD ENABLE_WERROR ENABLE_DEBUG PRODUCT PROFULLSWITCH PROEXT ENABLE_SYMBOLS DISABLE_STRIP ENABLE_CUPS ENABLE_FONTCONFIG WITH_BINFILTER ENABLE_DIRECTX DISABLE_ACTIVEX DISABLE_ATL ENABLE_RPATH WITH_MYSPELL_DICTS SYSTEM_DICTS DICT_SYSTEM_DIR HYPH_SYSTEM_DIR THES_SYSTEM_DIR USE_SHELL WITH_MINGWIN SHELLPATH GCC_HOME CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT COMPATH GCCVER HAVE_LD_BSYMBOLIC_FUNCTIONS ENABLE_PCH NO_HIDS GNUMAKE _cc HAVE_LD_HASH_STYLE PERL MSPDB_PATH COMEX USE_MINGW MIDL_PATH CSC_PATH FRAME_HOME CPP CXX CXXFLAGS ac_ct_CXX CXXCPP SIZEOF_LONG WORDS_BIGENDIAN LFS_CFLAGS ENABLE_VBA VBA_EXTENSION PAM NEW_SHADOW_API PAM_LINK CRYPT_LINK GXX_INCLUDE_PATH MINGW_LIB_INCLUDE_PATH MINGW_BACKWARD_INCLUDE_PATH MINGW_CLIB_DIR MINGW_SHARED_GCCLIB MINGW_GCCLIB_EH MINGW_SHARED_GXXLIB MINGW_GCCDLL MINGW_GXXDLL EXCEPTIONS STLPORT4 STLPORT_VER USE_SYSTEM_STL USE_CCACHE CCACHE HAVE_GCC_VISIBILITY_FEATURE ALLOC BUILD_VER_STRING SOLAR_JAVA JAVAINTERPRETER JAVACOMPILER JAVACISGCJ JAVADOC AWTLIB JAVAAOTCOMPILER JAVA_HOME JDK JAVAFLAGS DMAKE BUILD_DMAKE EPM DPKG PKGMK BUILD_EPM PKGFORMAT RPM GPERF MINGWCXX ac_ct_MINGWCXX MINGWSTRIP ac_ct_MINGWSTRIP BUILD_UNOWINREG BUILD_QADEVOOO SYSTEM_STDLIBS SYSTEM_ZLIB SYSTEM_JPEG SYSTEM_EXPAT PKG_CONFIG LIBWPD_CFLAGS LIBWPD_LIBS SYSTEM_LIBWPD FREETYPE_CFLAGS FREETYPE_LIBS USE_FT_EMBOLDEN LIBXSLT_CFLAGS LIBXSLT_LIBS XSLTPROC SYSTEM_LIBXSLT LIBXML_CFLAGS LIBXML_LIBS SYSTEM_LIBXML PYTHON PYTHON_VERSION PYTHON_PREFIX PYTHON_EXEC_PREFIX PYTHON_PLATFORM pythondir pkgpythondir pyexecdir pkgpyexecdir BZIP2 SYSTEM_PYTHON PYTHON_CFLAGS PYTHON_LIBS HOME SYSTEM_DB DB_VERSION DB_INCLUDES DB_JAR SYSTEM_LUCENE LUCENE_CORE_JAR LUCENE_ANALYZERS_JAR SYSTEM_HSQLDB HSQLDB_JAR SYSTEM_BSH BSH_JAR SERIALIZER_JAR SYSTEM_SAXON SAXON_JAR CURLCONFIG SYSTEM_CURL CURL_CFLAGS CURL_LIBS SYSTEM_BOOST SYSTEM_VIGRA SYSTEM_ODBC_HEADERS WITH_MOZILLA WITH_LDAP WITH_OPENLDAP MOZ_NSS_CFLAGS MOZ_NSS_LIBS NSS_LIB MOZ_NSPR_CFLAGS MOZ_NSPR_LIBS NSPR_LIB MOZILLAXPCOM_CFLAGS MOZILLAXPCOM_LIBS MOZILLA_VERSION MOZILLA_TOOLKIT MOZGTK2_CFLAGS MOZGTK2_LIBS MOZLIBREQ_CFLAGS MOZLIBREQ_LIBS BUILD_MOZAB ENABLE_NSS_MODULE MOZILLABUILD SYSTEM_MOZILLA MOZ_FLAVOUR MOZ_INC MOZ_LIB MOZ_LIB_XPCOM MOZ_LDAP_CFLAGS SYSTEM_SANE_HEADER SYSTEM_GENBRK SYSTEM_GENCCODE SYSTEM_GENCMN SYSTEM_ICU GRAPHITE_CFLAGS GRAPHITE_LIBS ENABLE_GRAPHITE SYSTEM_GRAPHITE X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS XINC XLIB XAU_LIBS DISABLE_XAW SYSTEM_XRENDER_HEADERS XRENDER_LINK XRANDR_CFLAGS XRANDR_LIBS XRANDR_DLOPEN ENABLE_RANDR DISABLE_NEON NEON_CFLAGS NEON_LIBS SYSTEM_NEON NEON_VERSION OPENSSL_CFLAGS OPENSSL_LIBS SYSTEM_OPENSSL ENABLE_AGG AGG_CFLAGS AGG_LIBS SYSTEM_AGG AGG_VERSION REDLAND_CFLAGS REDLAND_LIBS SYSTEM_REDLAND HUNSPELL_CFLAGS HUNSPELL_LIBS SYSTEM_HUNSPELL SYSTEM_HYPH HYPHEN_LIB SYSTEM_MYTHES SYSTEM_LPSOLVE PSDK_HOME WINDOWS_VISTA_PSDK DIRECTXSDK_HOME DIRECTXSDK_LIB NSIS_PATH BISON FLEX PATCH GNUCP GNUPATCH CYGWIN_PATH ML_EXE ASM_HOME ZIP UNZIP ZIP_HOME ENABLE_GTK ENABLE_KDE ENABLE_KDE4 GCONF_CFLAGS GCONF_LIBS ENABLE_GCONF GNOMEVFS_CFLAGS GNOMEVFS_LIBS ENABLE_GNOMEVFS GTK_CFLAGS GTK_LIBS DBUS_CFLAGS DBUS_LIBS GIO_CFLAGS GIO_LIBS ENABLE_GIO ENABLE_DBUS ENABLE_SYSTRAY_GTK CAIRO_CFLAGS CAIRO_LIBS ENABLE_CAIRO BUILD_PIXMAN SYSTEM_CAIRO ENABLE_OPENGL ENABLE_MINIMIZER ENABLE_PRESENTER_SCREEN POPPLER_CFLAGS POPPLER_LIBS ENABLE_PDFIMPORT SYSTEM_POPPLER ENABLE_MEDIAWIKI SYSTEM_SERVLETAPI SERVLETAPI_JAR ENABLE_REPORTBUILDER SYSTEM_JFREEREPORT SAC_JAR LIBXML_JAR FLUTE_JAR JFREEREPORT_JAR LIBBASE_JAR LIBLAYOUT_JAR LIBLOADER_JAR LIBFORMULA_JAR LIBREPOSITORY_JAR LIBFONTS_JAR LIBSERIALIZER_JAR SYSTEM_APACHE_COMMONS COMMONS_CODEC_JAR COMMONS_LANG_JAR COMMONS_HTTPCLIENT_JAR COMMONS_LOGGING_JAR MOC KDE_CFLAGS KDE_LIBS MOC4 KDE4_CFLAGS KDE4_LIBS ENABLE_LOCKDOWN GOBJECT_CFLAGS GOBJECT_LIBS ENABLE_EVOAB2 ENABLE_KAB WITH_FONTS WITHOUT_PPDS WITHOUT_AFMS SCPDEFS USE_XINERAMA XINERAMA_LINK ANT ANT_HOME ANT_LIB WITH_LANG WITH_POOR_HELP_LOCALIZATIONS WITH_DICT INTRO_BITMAPS ABOUT_BITMAPS OOO_VENDOR UNIXWRAPPERNAME ENABLE_STATIC_GTK ENABLE_LAYOUT VERBOSE LOCAL_SOLVER BUILD_TYPE LIBOBJS LTLIBOBJS' ac_subst_files='' -ac_user_opts=' -enable_option_checking -with_gnu_patch -with_agg -with_gnu_cp -enable_graphite -with_system_graphite -enable_ldap -with_openldap -enable_lockdown -enable_vba -with_vba_package_format -enable_pch -enable_hids -enable_mozilla -with_fonts -with_ppds -with_afms -enable_epm -with_epm -with_package_format -enable_odk -enable_qadevooo -enable_mathmldtd -enable_evolution2 -with_system_stdlibs -enable_cups -enable_fontconfig -enable_directx -enable_activex -enable_atl -enable_symbols -enable_strip_solver -enable_werror -enable_debug -enable_dbgutil -enable_crashdump -enable_cl_standard -enable_gtk -enable_systray -enable_cairo -with_system_cairo -enable_opengl -enable_dbus -enable_gconf -enable_gnome_vfs -enable_gio -enable_static_gtk -enable_layout -enable_build_mozilla -with_mozilla_version -with_mozilla_toolkit -enable_nss_module -enable_kde -enable_kdeab -enable_kde4 -enable_binfilter -enable_rpath -enable_pam -enable_pam_link -enable_crypt_link -enable_xrender_link -enable_randr -enable_randr_link -with_myspell_dicts -with_system_dicts -with_external_dict_dir -with_external_hyph_dir -with_external_thes_dir -with_system_libs -with_system_headers -with_system_jars -with_system_zlib -with_system_openssl -with_system_jpeg -with_system_expat -with_system_libwpd -with_system_libxml -with_system_python -with_system_icu -with_system_poppler -with_system_db -with_system_lucene -with_lucene_core_jar -with_lucene_analyzers_jar -with_system_hsqldb -with_hsqldb_jar -with_system_beanshell -with_beanshell_jar -enable_minimizer -enable_presenter_console -enable_pdfimport -enable_wiki_publisher -with_commons_codec_jar -with_commons_lang_jar -with_commons_httpclient_jar -with_commons_logging_jar -with_servlet_api_jar -enable_report_builder -with_system_jfreereport -with_sac_jar -with_libxml_jar -with_flute_jar -with_jfreereport_jar -with_liblayout_jar -with_libloader_jar -with_libformula_jar -with_librepository_jar -with_libfonts_jar -with_libserializer_jar -with_libbase_jar -with_system_saxon -with_saxon_jar -with_system_libxslt -with_system_odbc -with_system_sane -with_system_xrender -with_system_curl -with_system_boost -with_system_vigra -enable_neon -enable_Xaw -with_system_neon -with_system_agg -with_system_hunspell -with_system_mythes -with_system_altlinuxhyph -with_system_lpsolve -with_system_mozilla -with_stlport -with_jdk_home -with_gxx_include_path -with_java -enable_gcjaot -with_ant_home -with_perl_home -with_cl_home -with_mspdb_path -with_midl_path -with_csc_path -with_nsis_path -with_frame_home -with_psdk_home -with_directx_home -with_mozilla_build -with_local_solenv -with_local_solver -enable_check_only -enable_ccache_skip -with_lang -with_poor_help_localizations -with_dict -with_intro_bitmaps -with_about_bitmaps -with_vendor -with_unix_wrapper -with_asm_home -with_os_version -with_unzip_home -with_zip_home -with_mingwin -with_use_shell -with_build_version -with_alloc -enable_verbose -enable_largefile -with_x -' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -CPP -CXX -CXXFLAGS -CCC -CXXCPP -XMKMF' - # Initialize some variables set by options. ac_init_help= ac_init_version=false -ac_unrecognized_opts= -ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null @@ -1194,48 +337,34 @@ x_libraries=NONE # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' +datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' +infodir='${prefix}/info' +mandir='${prefix}/man' ac_prev= -ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option + eval "$ac_prev=\$ac_option" ac_prev= continue fi - case $ac_option in - *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *) ac_optarg=yes ;; - esac + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; + case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; @@ -1257,59 +386,33 @@ do --config-cache | -C) cache_file=config.cache ;; - -datadir | --datadir | --datadi | --datad) + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) datadir=$ac_optarg ;; - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - -disable-* | --disable-*) - ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) - ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; esac - eval enable_$ac_useropt=\$ac_optarg ;; + eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -1336,12 +439,6 @@ do -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; @@ -1366,16 +463,13 @@ do | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) @@ -1440,16 +534,6 @@ do | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; @@ -1500,36 +584,26 @@ do ac_init_version=: ;; -with-* | --with-*) - ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; esac - eval with_$ac_useropt=\$ac_optarg ;; + eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) - ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=no ;; + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. @@ -1549,25 +623,26 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) as_fn_error "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information." + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. - case $ac_envvar in #( - '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error "invalid variable name: \`$ac_envvar'" ;; - esac - eval $ac_envvar=\$ac_optarg + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; @@ -1576,36 +651,31 @@ done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error "missing argument to $ac_option" -fi - -if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } fi -# Check all directory arguments for consistency. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix do - eval ac_val=\$$ac_var - # Remove trailing slashes. + eval ac_val=$`echo $ac_var` case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; esac - # Be sure to have absolute directory names. +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; esac - as_fn_error "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' @@ -1619,7 +689,7 @@ target=$target_alias if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes @@ -1632,72 +702,86 @@ test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error "working directory cannot be determined" -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error "pwd does not report name of working directory" - - # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$as_myself" || -$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_myself" : 'X\(//\)[^/]' \| \ - X"$as_myself" : 'X\(//\)$' \| \ - X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` + # Try the directory containing this script, then its parent. + ac_confdir=`(dirname "$0") 2>/dev/null || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then + if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi -if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - as_fn_error "cannot find sources ($ac_unique_file) in $srcdir" -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg" - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } + else + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } + fi +fi +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP +ac_env_CXX_set=${CXX+set} +ac_env_CXX_value=$CXX +ac_cv_env_CXX_set=${CXX+set} +ac_cv_env_CXX_value=$CXX +ac_env_CXXFLAGS_set=${CXXFLAGS+set} +ac_env_CXXFLAGS_value=$CXXFLAGS +ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} +ac_cv_env_CXXFLAGS_value=$CXXFLAGS +ac_env_CXXCPP_set=${CXXCPP+set} +ac_env_CXXCPP_value=$CXXCPP +ac_cv_env_CXXCPP_set=${CXXCPP+set} +ac_cv_env_CXXCPP_value=$CXXCPP # # Report the --help message. @@ -1726,11 +810,14 @@ Configuration: -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] +_ACEOF + + cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] + [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] + [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify @@ -1740,25 +827,18 @@ for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data [PREFIX/share] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF @@ -1779,7 +859,6 @@ if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: - --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-graphite Enables the compilation of Graphite smart font rendering @@ -2354,975 +1433,165 @@ Some influential environment variables: CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory - LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if - you have headers in a nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor - XMKMF Path to xmkmf, Makefile generator for X Window System Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. -Report bugs to the package provider. _ACEOF -ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. + ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || - { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || - continue + test -d $ac_dir || continue ac_builddir=. -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi case $srcdir in - .) # We are building in place. + .) # No --srcdir option. We are building in place. ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_srcdir/configure.gnu; then + echo + $SHELL $ac_srcdir/configure.gnu --help=recursive + elif test -f $ac_srcdir/configure; then + echo + $SHELL $ac_srcdir/configure --help=recursive + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi + cd $ac_popdir done fi -test -n "$ac_init_help" && exit $ac_status +test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF -configure -generated by GNU Autoconf 2.65 -Copyright (C) 2009 Free Software Foundation, Inc. +Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF - exit + exit 0 fi +exec 5>config.log +cat >&5 <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. -## ------------------------ ## -## Autoconf initialization. ## -## ------------------------ ## +It was created by $as_me, which was +generated by GNU Autoconf 2.59. Invocation command line was + + $ $0 $@ -# ac_fn_c_try_compile LINENO -# -------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_compile () +_ACEOF { - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## - ac_retval=1 -fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - as_fn_set_status $ac_retval +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` -} # ac_fn_c_try_compile +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` -# ac_fn_c_try_link LINENO -# ----------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - as_fn_set_status $ac_retval +_ASUNAME -} # ac_fn_c_try_link +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +} >&5 - ac_retval=1 -fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - as_fn_set_status $ac_retval - -} # ac_fn_c_try_cpp - -# ac_fn_c_try_run LINENO -# ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. -ac_fn_c_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - as_fn_set_status $ac_retval - -} # ac_fn_c_try_run - -# ac_fn_cxx_try_compile LINENO -# ---------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_cxx_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - as_fn_set_status $ac_retval - -} # ac_fn_cxx_try_compile - -# ac_fn_cxx_try_cpp LINENO -# ------------------------ -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_cxx_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } >/dev/null && { - test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - as_fn_set_status $ac_retval - -} # ac_fn_cxx_try_cpp - -# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES -# -------------------------------------------- -# Tries to find the compile-time value of EXPR in a program that includes -# INCLUDES, setting VAR accordingly. Returns whether the value could be -# computed -ac_fn_c_compute_int () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) >= 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_lo=0 ac_mid=0 - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_hi=$ac_mid; break -else - as_fn_arith $ac_mid + 1 && ac_lo=$as_val - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) < 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_hi=-1 ac_mid=-1 - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) >= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_lo=$ac_mid; break -else - as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - ac_lo= ac_hi= -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_hi=$ac_mid -else - as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in #(( -?*) eval "$3=\$ac_lo"; ac_retval=0 ;; -'') ac_retval=1 ;; -esac - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -static long int longval () { return $2; } -static unsigned long int ulongval () { return $2; } -#include -#include -int -main () -{ - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if (($2) < 0) - { - long int i = longval (); - if (i != ($2)) - return 1; - fprintf (f, "%ld", i); - } - else - { - unsigned long int i = ulongval (); - if (i != ($2)) - return 1; - fprintf (f, "%lu", i); - } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - echo >>conftest.val; read $3 &5 -$as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - -} # ac_fn_c_check_header_compile - -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - -} # ac_fn_c_check_header_mongrel - -# ac_fn_cxx_try_link LINENO -# ------------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_cxx_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_cxx_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - as_fn_set_status $ac_retval - -} # ac_fn_cxx_try_link - -# ac_fn_c_check_func LINENO FUNC VAR -# ---------------------------------- -# Tests whether FUNC exists, setting the cache variable VAR accordingly -ac_fn_c_check_func () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Define $2 to an innocuous variant, in case declares $2. - For example, HP-UX 11i declares gettimeofday. */ -#define $2 innocuous_$2 - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $2 - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $2 (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$2 || defined __stub___$2 -choke me -#endif - -int -main () -{ -return $2 (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - -} # ac_fn_c_check_func - -# ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES -# --------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_cxx_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - -} # ac_fn_cxx_check_header_mongrel - -# ac_fn_cxx_try_run LINENO -# ------------------------ -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. -ac_fn_cxx_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - as_fn_set_status $ac_retval - -} # ac_fn_cxx_try_run - -# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES -# ---------------------------------------------------- -# Tries to find if the field MEMBER exists in type AGGR, after including -# INCLUDES, setting cache variable VAR accordingly. -ac_fn_c_check_member () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 -$as_echo_n "checking for $2.$3... " >&6; } -if { as_var=$4; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$5 -int -main () -{ -static $2 ac_aggr; -if (ac_aggr.$3) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$4=yes" -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$5 -int -main () -{ -static $2 ac_aggr; -if (sizeof ac_aggr.$3) -return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$4=yes" -else - eval "$4=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$4 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - -} # ac_fn_c_check_member -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by $as_me, which was -generated by GNU Autoconf 2.65. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" - done -IFS=$as_save_IFS - -} >&5 - -cat >&5 <<_ACEOF +cat >&5 <<_ACEOF ## ----------- ## @@ -3340,6 +1609,7 @@ _ACEOF ac_configure_args= ac_configure_args0= ac_configure_args1= +ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do @@ -3350,13 +1620,13 @@ do -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; - *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in - 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) - as_fn_append ac_configure_args1 " '$ac_arg'" + ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else @@ -3372,19 +1642,21 @@ do -* ) ac_must_keep_next=true ;; esac fi - as_fn_append ac_configure_args " '$ac_arg'" + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " ;; esac done done -{ ac_configure_args0=; unset ac_configure_args0;} -{ ac_configure_args1=; unset ac_configure_args1;} +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +# WARNING: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { @@ -3397,35 +1669,20 @@ trap 'exit_status=$? _ASBOX echo # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done +{ (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; - esac | - sort -) + esac; +} echo cat <<\_ASBOX @@ -3436,28 +1693,22 @@ _ASBOX echo for ac_var in $ac_subst_vars do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX -## ------------------- ## -## File substitutions. ## -## ------------------- ## +## ------------- ## +## Output files. ## +## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi @@ -3469,26 +1720,26 @@ _ASBOX ## ----------- ## _ASBOX echo - cat confdefs.h + sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + rm -f core *.core && + rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status -' 0 + ' 0 for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -$as_echo "/* confdefs.h */" > confdefs.h +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h # Predefined preprocessor variables. @@ -3496,128 +1747,112 @@ cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF + cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF + cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF + cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE -if test -n "$CONFIG_SITE"; then - ac_site_file1=$CONFIG_SITE -elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site -else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site -fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" -do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special files - # actually), so we avoid doing that. DJGPP emulates it as a regular file. - if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; esac fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -3626,1019 +1861,1036 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + + + + + + + echo "$@" >config.parms -# Check whether --with-gnu-patch was given. -if test "${with_gnu_patch+set}" = set; then : - withval=$with_gnu_patch; -fi +# Check whether --with-gnu-patch or --without-gnu-patch was given. +if test "${with_gnu_patch+set}" = set; then + withval="$with_gnu_patch" + +fi; +# Check whether --with-agg or --without-agg was given. +if test "${with_agg+set}" = set; then + withval="$with_agg" -# Check whether --with-agg was given. -if test "${with_agg+set}" = set; then : - withval=$with_agg; else with_agg=yes -fi +fi; +# Check whether --with-gnu-cp or --without-gnu-cp was given. +if test "${with_gnu_cp+set}" = set; then + withval="$with_gnu_cp" -# Check whether --with-gnu-cp was given. -if test "${with_gnu_cp+set}" = set; then : - withval=$with_gnu_cp; -fi +fi; +# Check whether --enable-graphite or --disable-graphite was given. +if test "${enable_graphite+set}" = set; then + enableval="$enable_graphite" -# Check whether --enable-graphite was given. -if test "${enable_graphite+set}" = set; then : - enableval=$enable_graphite; -fi +fi; +# Check whether --with-system-graphite or --without-system-graphite was given. +if test "${with_system_graphite+set}" = set; then + withval="$with_system_graphite" -# Check whether --with-system-graphite was given. -if test "${with_system_graphite+set}" = set; then : - withval=$with_system_graphite; -fi +fi; +# Check whether --enable-ldap or --disable-ldap was given. +if test "${enable_ldap+set}" = set; then + enableval="$enable_ldap" -# Check whether --enable-ldap was given. -if test "${enable_ldap+set}" = set; then : - enableval=$enable_ldap; -fi +fi; +# Check whether --with-openldap or --without-openldap was given. +if test "${with_openldap+set}" = set; then + withval="$with_openldap" -# Check whether --with-openldap was given. -if test "${with_openldap+set}" = set; then : - withval=$with_openldap; -fi +fi; +# Check whether --enable-lockdown or --disable-lockdown was given. +if test "${enable_lockdown+set}" = set; then + enableval="$enable_lockdown" -# Check whether --enable-lockdown was given. -if test "${enable_lockdown+set}" = set; then : - enableval=$enable_lockdown; -fi +fi; +# Check whether --enable-vba or --disable-vba was given. +if test "${enable_vba+set}" = set; then + enableval="$enable_vba" -# Check whether --enable-vba was given. -if test "${enable_vba+set}" = set; then : - enableval=$enable_vba; -fi +fi; +# Check whether --with-vba-package-format or --without-vba-package-format was given. +if test "${with_vba_package_format+set}" = set; then + withval="$with_vba_package_format" -# Check whether --with-vba-package-format was given. -if test "${with_vba_package_format+set}" = set; then : - withval=$with_vba_package_format; -fi +fi; +# Check whether --enable-pch or --disable-pch was given. +if test "${enable_pch+set}" = set; then + enableval="$enable_pch" -# Check whether --enable-pch was given. -if test "${enable_pch+set}" = set; then : - enableval=$enable_pch; -fi +fi; +# Check whether --enable-hids or --disable-hids was given. +if test "${enable_hids+set}" = set; then + enableval="$enable_hids" -# Check whether --enable-hids was given. -if test "${enable_hids+set}" = set; then : - enableval=$enable_hids; -fi +fi; +# Check whether --enable-mozilla or --disable-mozilla was given. +if test "${enable_mozilla+set}" = set; then + enableval="$enable_mozilla" -# Check whether --enable-mozilla was given. -if test "${enable_mozilla+set}" = set; then : - enableval=$enable_mozilla; else enable_mozilla="yes" -fi +fi; +# Check whether --with-fonts or --without-fonts was given. +if test "${with_fonts+set}" = set; then + withval="$with_fonts" -# Check whether --with-fonts was given. -if test "${with_fonts+set}" = set; then : - withval=$with_fonts; -fi +fi; +# Check whether --with-ppds or --without-ppds was given. +if test "${with_ppds+set}" = set; then + withval="$with_ppds" -# Check whether --with-ppds was given. -if test "${with_ppds+set}" = set; then : - withval=$with_ppds; -fi +fi; +# Check whether --with-afms or --without-afms was given. +if test "${with_afms+set}" = set; then + withval="$with_afms" -# Check whether --with-afms was given. -if test "${with_afms+set}" = set; then : - withval=$with_afms; -fi +fi; +# Check whether --enable-epm or --disable-epm was given. +if test "${enable_epm+set}" = set; then + enableval="$enable_epm" -# Check whether --enable-epm was given. -if test "${enable_epm+set}" = set; then : - enableval=$enable_epm; else enable_epm="yes" -fi +fi; +# Check whether --with-epm or --without-epm was given. +if test "${with_epm+set}" = set; then + withval="$with_epm" -# Check whether --with-epm was given. -if test "${with_epm+set}" = set; then : - withval=$with_epm; -fi +fi; +# Check whether --with-package-format or --without-package-format was given. +if test "${with_package_format+set}" = set; then + withval="$with_package_format" -# Check whether --with-package-format was given. -if test "${with_package_format+set}" = set; then : - withval=$with_package_format; -fi +fi; +# Check whether --enable-odk or --disable-odk was given. +if test "${enable_odk+set}" = set; then + enableval="$enable_odk" -# Check whether --enable-odk was given. -if test "${enable_odk+set}" = set; then : - enableval=$enable_odk; else enable_odk="yes" -fi +fi; +# Check whether --enable-qadevooo or --disable-qadevooo was given. +if test "${enable_qadevooo+set}" = set; then + enableval="$enable_qadevooo" -# Check whether --enable-qadevooo was given. -if test "${enable_qadevooo+set}" = set; then : - enableval=$enable_qadevooo; else enable_qadevooo="yes" -fi +fi; +# Check whether --enable-mathmldtd or --disable-mathmldtd was given. +if test "${enable_mathmldtd+set}" = set; then + enableval="$enable_mathmldtd" -# Check whether --enable-mathmldtd was given. -if test "${enable_mathmldtd+set}" = set; then : - enableval=$enable_mathmldtd; else enable_mathmldtd="yes" -fi +fi; +# Check whether --enable-evolution2 or --disable-evolution2 was given. +if test "${enable_evolution2+set}" = set; then + enableval="$enable_evolution2" -# Check whether --enable-evolution2 was given. -if test "${enable_evolution2+set}" = set; then : - enableval=$enable_evolution2; -fi +fi; +# Check whether --with-system-stdlibs or --without-system-stdlibs was given. +if test "${with_system_stdlibs+set}" = set; then + withval="$with_system_stdlibs" -# Check whether --with-system-stdlibs was given. -if test "${with_system_stdlibs+set}" = set; then : - withval=$with_system_stdlibs; else checkforstdlibproblems=yes -fi +fi; +# Check whether --enable-cups or --disable-cups was given. +if test "${enable_cups+set}" = set; then + enableval="$enable_cups" -# Check whether --enable-cups was given. -if test "${enable_cups+set}" = set; then : - enableval=$enable_cups; else enable_cups=yes -fi +fi; +# Check whether --enable-fontconfig or --disable-fontconfig was given. +if test "${enable_fontconfig+set}" = set; then + enableval="$enable_fontconfig" -# Check whether --enable-fontconfig was given. -if test "${enable_fontconfig+set}" = set; then : - enableval=$enable_fontconfig; else enable_fontconfig=yes -fi +fi; +# Check whether --enable-directx or --disable-directx was given. +if test "${enable_directx+set}" = set; then + enableval="$enable_directx" -# Check whether --enable-directx was given. -if test "${enable_directx+set}" = set; then : - enableval=$enable_directx; else enable_directx=yes -fi +fi; +# Check whether --enable-activex or --disable-activex was given. +if test "${enable_activex+set}" = set; then + enableval="$enable_activex" -# Check whether --enable-activex was given. -if test "${enable_activex+set}" = set; then : - enableval=$enable_activex; -fi +fi; +# Check whether --enable-atl or --disable-atl was given. +if test "${enable_atl+set}" = set; then + enableval="$enable_atl" -# Check whether --enable-atl was given. -if test "${enable_atl+set}" = set; then : - enableval=$enable_atl; -fi +fi; +# Check whether --enable-symbols or --disable-symbols was given. +if test "${enable_symbols+set}" = set; then + enableval="$enable_symbols" -# Check whether --enable-symbols was given. -if test "${enable_symbols+set}" = set; then : - enableval=$enable_symbols; -fi +fi; +# Check whether --enable-strip-solver or --disable-strip-solver was given. +if test "${enable_strip_solver+set}" = set; then + enableval="$enable_strip_solver" -# Check whether --enable-strip-solver was given. -if test "${enable_strip_solver+set}" = set; then : - enableval=$enable_strip_solver; -fi +fi; +# Check whether --enable-werror or --disable-werror was given. +if test "${enable_werror+set}" = set; then + enableval="$enable_werror" -# Check whether --enable-werror was given. -if test "${enable_werror+set}" = set; then : - enableval=$enable_werror; -fi +fi; +# Check whether --enable-debug or --disable-debug was given. +if test "${enable_debug+set}" = set; then + enableval="$enable_debug" -# Check whether --enable-debug was given. -if test "${enable_debug+set}" = set; then : - enableval=$enable_debug; -fi +fi; +# Check whether --enable-dbgutil or --disable-dbgutil was given. +if test "${enable_dbgutil+set}" = set; then + enableval="$enable_dbgutil" -# Check whether --enable-dbgutil was given. -if test "${enable_dbgutil+set}" = set; then : - enableval=$enable_dbgutil; -fi +fi; +# Check whether --enable-crashdump or --disable-crashdump was given. +if test "${enable_crashdump+set}" = set; then + enableval="$enable_crashdump" -# Check whether --enable-crashdump was given. -if test "${enable_crashdump+set}" = set; then : - enableval=$enable_crashdump; else enable_crashdump=no -fi +fi; +# Check whether --enable-cl-standard or --disable-cl-standard was given. +if test "${enable_cl_standard+set}" = set; then + enableval="$enable_cl_standard" -# Check whether --enable-cl-standard was given. -if test "${enable_cl_standard+set}" = set; then : - enableval=$enable_cl_standard; -fi +fi; +# Check whether --enable-gtk or --disable-gtk was given. +if test "${enable_gtk+set}" = set; then + enableval="$enable_gtk" -# Check whether --enable-gtk was given. -if test "${enable_gtk+set}" = set; then : - enableval=$enable_gtk; else enable_gtk=yes -fi +fi; +# Check whether --enable-systray or --disable-systray was given. +if test "${enable_systray+set}" = set; then + enableval="$enable_systray" -# Check whether --enable-systray was given. -if test "${enable_systray+set}" = set; then : - enableval=$enable_systray; else enable_systray=yes -fi +fi; +# Check whether --enable-cairo or --disable-cairo was given. +if test "${enable_cairo+set}" = set; then + enableval="$enable_cairo" -# Check whether --enable-cairo was given. -if test "${enable_cairo+set}" = set; then : - enableval=$enable_cairo; else enable_cairo=no -fi +fi; +# Check whether --with-system-cairo or --without-system-cairo was given. +if test "${with_system_cairo+set}" = set; then + withval="$with_system_cairo" -# Check whether --with-system-cairo was given. -if test "${with_system_cairo+set}" = set; then : - withval=$with_system_cairo; -fi +fi; +# Check whether --enable-opengl or --disable-opengl was given. +if test "${enable_opengl+set}" = set; then + enableval="$enable_opengl" -# Check whether --enable-opengl was given. -if test "${enable_opengl+set}" = set; then : - enableval=$enable_opengl; else enable_opengl=no -fi +fi; +# Check whether --enable-dbus or --disable-dbus was given. +if test "${enable_dbus+set}" = set; then + enableval="$enable_dbus" -# Check whether --enable-dbus was given. -if test "${enable_dbus+set}" = set; then : - enableval=$enable_dbus; else enable_dbus=no -fi +fi; +# Check whether --enable-gconf or --disable-gconf was given. +if test "${enable_gconf+set}" = set; then + enableval="$enable_gconf" -# Check whether --enable-gconf was given. -if test "${enable_gconf+set}" = set; then : - enableval=$enable_gconf; else enable_gconf=yes -fi +fi; +# Check whether --enable-gnome-vfs or --disable-gnome-vfs was given. +if test "${enable_gnome_vfs+set}" = set; then + enableval="$enable_gnome_vfs" -# Check whether --enable-gnome-vfs was given. -if test "${enable_gnome_vfs+set}" = set; then : - enableval=$enable_gnome_vfs; else enable_gnome_vfs=yes -fi +fi; +# Check whether --enable-gio or --disable-gio was given. +if test "${enable_gio+set}" = set; then + enableval="$enable_gio" -# Check whether --enable-gio was given. -if test "${enable_gio+set}" = set; then : - enableval=$enable_gio; else enable_gio=no -fi +fi; +# Check whether --enable-static-gtk or --disable-static-gtk was given. +if test "${enable_static_gtk+set}" = set; then + enableval="$enable_static_gtk" -# Check whether --enable-static-gtk was given. -if test "${enable_static_gtk+set}" = set; then : - enableval=$enable_static_gtk; -fi +fi; +# Check whether --enable-layout or --disable-layout was given. +if test "${enable_layout+set}" = set; then + enableval="$enable_layout" -# Check whether --enable-layout was given. -if test "${enable_layout+set}" = set; then : - enableval=$enable_layout; -fi +fi; +# Check whether --enable-build-mozilla or --disable-build-mozilla was given. +if test "${enable_build_mozilla+set}" = set; then + enableval="$enable_build_mozilla" -# Check whether --enable-build-mozilla was given. -if test "${enable_build_mozilla+set}" = set; then : - enableval=$enable_build_mozilla; -fi +fi; +# Check whether --with-mozilla-version or --without-mozilla-version was given. +if test "${with_mozilla_version+set}" = set; then + withval="$with_mozilla_version" -# Check whether --with-mozilla-version was given. -if test "${with_mozilla_version+set}" = set; then : - withval=$with_mozilla_version; -fi +fi; +# Check whether --with-mozilla-toolkit or --without-mozilla-toolkit was given. +if test "${with_mozilla_toolkit+set}" = set; then + withval="$with_mozilla_toolkit" -# Check whether --with-mozilla-toolkit was given. -if test "${with_mozilla_toolkit+set}" = set; then : - withval=$with_mozilla_toolkit; -fi +fi; +# Check whether --enable-nss_module or --disable-nss_module was given. +if test "${enable_nss_module+set}" = set; then + enableval="$enable_nss_module" -# Check whether --enable-nss_module was given. -if test "${enable_nss_module+set}" = set; then : - enableval=$enable_nss_module; else enable_nss_module=yes -fi +fi; +# Check whether --enable-kde or --disable-kde was given. +if test "${enable_kde+set}" = set; then + enableval="$enable_kde" -# Check whether --enable-kde was given. -if test "${enable_kde+set}" = set; then : - enableval=$enable_kde; -fi +fi; +# Check whether --enable-kdeab or --disable-kdeab was given. +if test "${enable_kdeab+set}" = set; then + enableval="$enable_kdeab" -# Check whether --enable-kdeab was given. -if test "${enable_kdeab+set}" = set; then : - enableval=$enable_kdeab; else if test "$enable_kde" = "yes"; then enable_kdeab=yes; fi -fi +fi; +# Check whether --enable-kde4 or --disable-kde4 was given. +if test "${enable_kde4+set}" = set; then + enableval="$enable_kde4" -# Check whether --enable-kde4 was given. -if test "${enable_kde4+set}" = set; then : - enableval=$enable_kde4; -fi +fi; +# Check whether --enable-binfilter or --disable-binfilter was given. +if test "${enable_binfilter+set}" = set; then + enableval="$enable_binfilter" -# Check whether --enable-binfilter was given. -if test "${enable_binfilter+set}" = set; then : - enableval=$enable_binfilter; else if ! test -d ./binfilter; then enable_binfilter=no; fi -fi +fi; +# Check whether --enable-rpath or --disable-rpath was given. +if test "${enable_rpath+set}" = set; then + enableval="$enable_rpath" -# Check whether --enable-rpath was given. -if test "${enable_rpath+set}" = set; then : - enableval=$enable_rpath; -fi +fi; +# Check whether --enable-pam or --disable-pam was given. +if test "${enable_pam+set}" = set; then + enableval="$enable_pam" -# Check whether --enable-pam was given. -if test "${enable_pam+set}" = set; then : - enableval=$enable_pam; -fi +fi; +# Check whether --enable-pam-link or --disable-pam-link was given. +if test "${enable_pam_link+set}" = set; then + enableval="$enable_pam_link" -# Check whether --enable-pam-link was given. -if test "${enable_pam_link+set}" = set; then : - enableval=$enable_pam_link; -fi +fi; +# Check whether --enable-crypt-link or --disable-crypt-link was given. +if test "${enable_crypt_link+set}" = set; then + enableval="$enable_crypt_link" -# Check whether --enable-crypt-link was given. -if test "${enable_crypt_link+set}" = set; then : - enableval=$enable_crypt_link; else enable_crypt_link=yes -fi +fi; +# Check whether --enable-xrender-link or --disable-xrender-link was given. +if test "${enable_xrender_link+set}" = set; then + enableval="$enable_xrender_link" -# Check whether --enable-xrender-link was given. -if test "${enable_xrender_link+set}" = set; then : - enableval=$enable_xrender_link; -fi +fi; +# Check whether --enable-randr or --disable-randr was given. +if test "${enable_randr+set}" = set; then + enableval="$enable_randr" -# Check whether --enable-randr was given. -if test "${enable_randr+set}" = set; then : - enableval=$enable_randr; else enable_randr=yes -fi +fi; +# Check whether --enable-randr-link or --disable-randr-link was given. +if test "${enable_randr_link+set}" = set; then + enableval="$enable_randr_link" -# Check whether --enable-randr-link was given. -if test "${enable_randr_link+set}" = set; then : - enableval=$enable_randr_link; else enable_randr_link=yes -fi - - -# Check whether --with-myspell-dicts was given. -if test "${with_myspell_dicts+set}" = set; then : - withval=$with_myspell_dicts; -fi - - -# Check whether --with-system-dicts was given. -if test "${with_system_dicts+set}" = set; then : - withval=$with_system_dicts; -fi - - -# Check whether --with-external-dict-dir was given. -if test "${with_external_dict_dir+set}" = set; then : - withval=$with_external_dict_dir; -fi - - -# Check whether --with-external-hyph-dir was given. -if test "${with_external_hyph_dir+set}" = set; then : - withval=$with_external_hyph_dir; -fi - - -# Check whether --with-external-thes-dir was given. -if test "${with_external_thes_dir+set}" = set; then : - withval=$with_external_thes_dir; -fi +fi; +# Check whether --with-myspell-dicts or --without-myspell-dicts was given. +if test "${with_myspell_dicts+set}" = set; then + withval="$with_myspell_dicts" -# Check whether --with-system-libs was given. -if test "${with_system_libs+set}" = set; then : - withval=$with_system_libs; -fi - - -# Check whether --with-system-headers was given. -if test "${with_system_headers+set}" = set; then : - withval=$with_system_headers; -fi - - -# Check whether --with-system-jars was given. -if test "${with_system_jars+set}" = set; then : - withval=$with_system_jars; -fi - - -# Check whether --with-system-zlib was given. -if test "${with_system_zlib+set}" = set; then : - withval=$with_system_zlib; -fi - - -# Check whether --with-system-openssl was given. -if test "${with_system_openssl+set}" = set; then : - withval=$with_system_openssl; -fi - - -# Check whether --with-system-jpeg was given. -if test "${with_system_jpeg+set}" = set; then : - withval=$with_system_jpeg; -fi +fi; +# Check whether --with-system-dicts or --without-system-dicts was given. +if test "${with_system_dicts+set}" = set; then + withval="$with_system_dicts" -# Check whether --with-system-expat was given. -if test "${with_system_expat+set}" = set; then : - withval=$with_system_expat; -fi - - -# Check whether --with-system-libwpd was given. -if test "${with_system_libwpd+set}" = set; then : - withval=$with_system_libwpd; -fi +fi; +# Check whether --with-external-dict-dir or --without-external-dict-dir was given. +if test "${with_external_dict_dir+set}" = set; then + withval="$with_external_dict_dir" -# Check whether --with-system-libxml was given. -if test "${with_system_libxml+set}" = set; then : - withval=$with_system_libxml; -fi - +fi; -# Check whether --with-system-python was given. -if test "${with_system_python+set}" = set; then : - withval=$with_system_python; -fi +# Check whether --with-external-hyph-dir or --without-external-hyph-dir was given. +if test "${with_external_hyph_dir+set}" = set; then + withval="$with_external_hyph_dir" +fi; -# Check whether --with-system-icu was given. -if test "${with_system_icu+set}" = set; then : - withval=$with_system_icu; -fi +# Check whether --with-external-thes-dir or --without-external-thes-dir was given. +if test "${with_external_thes_dir+set}" = set; then + withval="$with_external_thes_dir" +fi; -# Check whether --with-system-poppler was given. -if test "${with_system_poppler+set}" = set; then : - withval=$with_system_poppler; -fi +# Check whether --with-system-libs or --without-system-libs was given. +if test "${with_system_libs+set}" = set; then + withval="$with_system_libs" +fi; -# Check whether --with-system-db was given. -if test "${with_system_db+set}" = set; then : - withval=$with_system_db; -fi +# Check whether --with-system-headers or --without-system-headers was given. +if test "${with_system_headers+set}" = set; then + withval="$with_system_headers" +fi; -# Check whether --with-system-lucene was given. -if test "${with_system_lucene+set}" = set; then : - withval=$with_system_lucene; -fi +# Check whether --with-system-jars or --without-system-jars was given. +if test "${with_system_jars+set}" = set; then + withval="$with_system_jars" +fi; -# Check whether --with-lucene-core-jar was given. -if test "${with_lucene_core_jar+set}" = set; then : - withval=$with_lucene_core_jar; LUCENE_CORE_JAR="$withval" +# Check whether --with-system-zlib or --without-system-zlib was given. +if test "${with_system_zlib+set}" = set; then + withval="$with_system_zlib" -fi +fi; +# Check whether --with-system-openssl or --without-system-openssl was given. +if test "${with_system_openssl+set}" = set; then + withval="$with_system_openssl" -# Check whether --with-lucene-analyzers-jar was given. -if test "${with_lucene_analyzers_jar+set}" = set; then : - withval=$with_lucene_analyzers_jar; LUCENE_ANALYZERS_JAR="$withval" +fi; -fi +# Check whether --with-system-jpeg or --without-system-jpeg was given. +if test "${with_system_jpeg+set}" = set; then + withval="$with_system_jpeg" +fi; -# Check whether --with-system-hsqldb was given. -if test "${with_system_hsqldb+set}" = set; then : - withval=$with_system_hsqldb; -fi +# Check whether --with-system-expat or --without-system-expat was given. +if test "${with_system_expat+set}" = set; then + withval="$with_system_expat" +fi; -# Check whether --with-hsqldb-jar was given. -if test "${with_hsqldb_jar+set}" = set; then : - withval=$with_hsqldb_jar; HSQLDB_JAR="$withval" +# Check whether --with-system-libwpd or --without-system-libwpd was given. +if test "${with_system_libwpd+set}" = set; then + withval="$with_system_libwpd" -fi +fi; +# Check whether --with-system-libxml or --without-system-libxml was given. +if test "${with_system_libxml+set}" = set; then + withval="$with_system_libxml" -# Check whether --with-system-beanshell was given. -if test "${with_system_beanshell+set}" = set; then : - withval=$with_system_beanshell; -fi +fi; +# Check whether --with-system-python or --without-system-python was given. +if test "${with_system_python+set}" = set; then + withval="$with_system_python" -# Check whether --with-beanshell-jar was given. -if test "${with_beanshell_jar+set}" = set; then : - withval=$with_beanshell_jar; BSH_JAR="$withval" +fi; -fi +# Check whether --with-system-icu or --without-system-icu was given. +if test "${with_system_icu+set}" = set; then + withval="$with_system_icu" -# Check whether --enable-minimizer was given. -if test "${enable_minimizer+set}" = set; then : - enableval=$enable_minimizer; -fi +fi; -# Check whether --enable-presenter-console was given. -if test "${enable_presenter_console+set}" = set; then : - enableval=$enable_presenter_console; -fi +# Check whether --with-system-poppler or --without-system-poppler was given. +if test "${with_system_poppler+set}" = set; then + withval="$with_system_poppler" -# Check whether --enable-pdfimport was given. -if test "${enable_pdfimport+set}" = set; then : - enableval=$enable_pdfimport; -fi +fi; -# Check whether --enable-wiki-publisher was given. -if test "${enable_wiki_publisher+set}" = set; then : - enableval=$enable_wiki_publisher; -fi +# Check whether --with-system-db or --without-system-db was given. +if test "${with_system_db+set}" = set; then + withval="$with_system_db" +fi; -# Check whether --with-commons-codec-jar was given. -if test "${with_commons_codec_jar+set}" = set; then : - withval=$with_commons_codec_jar; COMMONS_CODEC_JAR="$withval" +# Check whether --with-system-lucene or --without-system-lucene was given. +if test "${with_system_lucene+set}" = set; then + withval="$with_system_lucene" -fi +fi; +# Check whether --with-lucene-core-jar or --without-lucene-core-jar was given. +if test "${with_lucene_core_jar+set}" = set; then + withval="$with_lucene_core_jar" + LUCENE_CORE_JAR="$withval" -# Check whether --with-commons-lang-jar was given. -if test "${with_commons_lang_jar+set}" = set; then : - withval=$with_commons_lang_jar; COMMONS_LANG_JAR="$withval" +fi; -fi +# Check whether --with-lucene-analyzers-jar or --without-lucene-analyzers-jar was given. +if test "${with_lucene_analyzers_jar+set}" = set; then + withval="$with_lucene_analyzers_jar" + LUCENE_ANALYZERS_JAR="$withval" +fi; -# Check whether --with-commons-httpclient-jar was given. -if test "${with_commons_httpclient_jar+set}" = set; then : - withval=$with_commons_httpclient_jar; COMMONS_HTTPCLIENT_JAR="$withval" +# Check whether --with-system-hsqldb or --without-system-hsqldb was given. +if test "${with_system_hsqldb+set}" = set; then + withval="$with_system_hsqldb" -fi +fi; +# Check whether --with-hsqldb-jar or --without-hsqldb-jar was given. +if test "${with_hsqldb_jar+set}" = set; then + withval="$with_hsqldb_jar" + HSQLDB_JAR="$withval" -# Check whether --with-commons-logging-jar was given. -if test "${with_commons_logging_jar+set}" = set; then : - withval=$with_commons_logging_jar; COMMONS_LOGGING_JAR="$withval" +fi; -fi +# Check whether --with-system-beanshell or --without-system-beanshell was given. +if test "${with_system_beanshell+set}" = set; then + withval="$with_system_beanshell" +fi; -# Check whether --with-servlet-api-jar was given. -if test "${with_servlet_api_jar+set}" = set; then : - withval=$with_servlet_api_jar; SERVLETAPI_JAR="$withval" +# Check whether --with-beanshell-jar or --without-beanshell-jar was given. +if test "${with_beanshell_jar+set}" = set; then + withval="$with_beanshell_jar" + BSH_JAR="$withval" -fi +fi; +# Check whether --enable-minimizer or --disable-minimizer was given. +if test "${enable_minimizer+set}" = set; then + enableval="$enable_minimizer" -# Check whether --enable-report-builder was given. -if test "${enable_report_builder+set}" = set; then : - enableval=$enable_report_builder; -fi +fi; +# Check whether --enable-presenter-console or --disable-presenter-console was given. +if test "${enable_presenter_console+set}" = set; then + enableval="$enable_presenter_console" +fi; +# Check whether --enable-pdfimport or --disable-pdfimport was given. +if test "${enable_pdfimport+set}" = set; then + enableval="$enable_pdfimport" -# Check whether --with-system-jfreereport was given. -if test "${with_system_jfreereport+set}" = set; then : - withval=$with_system_jfreereport; -fi +fi; +# Check whether --enable-wiki-publisher or --disable-wiki-publisher was given. +if test "${enable_wiki_publisher+set}" = set; then + enableval="$enable_wiki_publisher" +fi; -# Check whether --with-sac-jar was given. -if test "${with_sac_jar+set}" = set; then : - withval=$with_sac_jar; SAC_JAR="$withval" +# Check whether --with-commons-codec-jar or --without-commons-codec-jar was given. +if test "${with_commons_codec_jar+set}" = set; then + withval="$with_commons_codec_jar" + COMMONS_CODEC_JAR="$withval" -fi +fi; +# Check whether --with-commons-lang-jar or --without-commons-lang-jar was given. +if test "${with_commons_lang_jar+set}" = set; then + withval="$with_commons_lang_jar" + COMMONS_LANG_JAR="$withval" -# Check whether --with-libxml-jar was given. -if test "${with_libxml_jar+set}" = set; then : - withval=$with_libxml_jar; LIBXML_JAR="$withval" +fi; -fi +# Check whether --with-commons-httpclient-jar or --without-commons-httpclient-jar was given. +if test "${with_commons_httpclient_jar+set}" = set; then + withval="$with_commons_httpclient_jar" + COMMONS_HTTPCLIENT_JAR="$withval" +fi; -# Check whether --with-flute-jar was given. -if test "${with_flute_jar+set}" = set; then : - withval=$with_flute_jar; FLUTE_JAR="$withval" +# Check whether --with-commons-logging-jar or --without-commons-logging-jar was given. +if test "${with_commons_logging_jar+set}" = set; then + withval="$with_commons_logging_jar" + COMMONS_LOGGING_JAR="$withval" -fi +fi; +# Check whether --with-servlet-api-jar or --without-servlet-api-jar was given. +if test "${with_servlet_api_jar+set}" = set; then + withval="$with_servlet_api_jar" + SERVLETAPI_JAR="$withval" -# Check whether --with-jfreereport-jar was given. -if test "${with_jfreereport_jar+set}" = set; then : - withval=$with_jfreereport_jar; JFREEREPORT_JAR="$withval" +fi; +# Check whether --enable-report-builder or --disable-report-builder was given. +if test "${enable_report_builder+set}" = set; then + enableval="$enable_report_builder" -fi +fi; +# Check whether --with-system-jfreereport or --without-system-jfreereport was given. +if test "${with_system_jfreereport+set}" = set; then + withval="$with_system_jfreereport" -# Check whether --with-liblayout-jar was given. -if test "${with_liblayout_jar+set}" = set; then : - withval=$with_liblayout_jar; LIBLAYOUT_JAR="$withval" +fi; -fi +# Check whether --with-sac-jar or --without-sac-jar was given. +if test "${with_sac_jar+set}" = set; then + withval="$with_sac_jar" + SAC_JAR="$withval" +fi; -# Check whether --with-libloader-jar was given. -if test "${with_libloader_jar+set}" = set; then : - withval=$with_libloader_jar; LIBLOADER_JAR="$withval" +# Check whether --with-libxml-jar or --without-libxml-jar was given. +if test "${with_libxml_jar+set}" = set; then + withval="$with_libxml_jar" + LIBXML_JAR="$withval" -fi +fi; +# Check whether --with-flute-jar or --without-flute-jar was given. +if test "${with_flute_jar+set}" = set; then + withval="$with_flute_jar" + FLUTE_JAR="$withval" -# Check whether --with-libloader-jar was given. -if test "${with_libloader_jar+set}" = set; then : - withval=$with_libloader_jar; LIBLOADER_JAR="$withval" +fi; -fi +# Check whether --with-jfreereport-jar or --without-jfreereport-jar was given. +if test "${with_jfreereport_jar+set}" = set; then + withval="$with_jfreereport_jar" + JFREEREPORT_JAR="$withval" +fi; -# Check whether --with-libformula-jar was given. -if test "${with_libformula_jar+set}" = set; then : - withval=$with_libformula_jar; LIBFORMULA_JAR="$withval" +# Check whether --with-liblayout-jar or --without-liblayout-jar was given. +if test "${with_liblayout_jar+set}" = set; then + withval="$with_liblayout_jar" + LIBLAYOUT_JAR="$withval" -fi +fi; +# Check whether --with-libloader-jar or --without-libloader-jar was given. +if test "${with_libloader_jar+set}" = set; then + withval="$with_libloader_jar" + LIBLOADER_JAR="$withval" -# Check whether --with-librepository-jar was given. -if test "${with_librepository_jar+set}" = set; then : - withval=$with_librepository_jar; LIBREPOSITORY_JAR="$withval" +fi; -fi +# Check whether --with-libloader-jar or --without-libloader-jar was given. +if test "${with_libloader_jar+set}" = set; then + withval="$with_libloader_jar" + LIBLOADER_JAR="$withval" +fi; -# Check whether --with-libfonts-jar was given. -if test "${with_libfonts_jar+set}" = set; then : - withval=$with_libfonts_jar; LIBFONTS_JAR="$withval" +# Check whether --with-libformula-jar or --without-libformula-jar was given. +if test "${with_libformula_jar+set}" = set; then + withval="$with_libformula_jar" + LIBFORMULA_JAR="$withval" -fi +fi; +# Check whether --with-librepository-jar or --without-librepository-jar was given. +if test "${with_librepository_jar+set}" = set; then + withval="$with_librepository_jar" + LIBREPOSITORY_JAR="$withval" -# Check whether --with-libserializer-jar was given. -if test "${with_libserializer_jar+set}" = set; then : - withval=$with_libserializer_jar; LIBSERIALIZER_JAR="$withval" +fi; -fi +# Check whether --with-libfonts-jar or --without-libfonts-jar was given. +if test "${with_libfonts_jar+set}" = set; then + withval="$with_libfonts_jar" + LIBFONTS_JAR="$withval" +fi; -# Check whether --with-libbase-jar was given. -if test "${with_libbase_jar+set}" = set; then : - withval=$with_libbase_jar; LIBBASE_JAR="$withval" +# Check whether --with-libserializer-jar or --without-libserializer-jar was given. +if test "${with_libserializer_jar+set}" = set; then + withval="$with_libserializer_jar" + LIBSERIALIZER_JAR="$withval" -fi +fi; +# Check whether --with-libbase-jar or --without-libbase-jar was given. +if test "${with_libbase_jar+set}" = set; then + withval="$with_libbase_jar" + LIBBASE_JAR="$withval" -# Check whether --with-system-saxon was given. -if test "${with_system_saxon+set}" = set; then : - withval=$with_system_saxon; -fi +fi; +# Check whether --with-system-saxon or --without-system-saxon was given. +if test "${with_system_saxon+set}" = set; then + withval="$with_system_saxon" -# Check whether --with-saxon-jar was given. -if test "${with_saxon_jar+set}" = set; then : - withval=$with_saxon_jar; SAXON_JAR="$withval" +fi; -fi +# Check whether --with-saxon-jar or --without-saxon-jar was given. +if test "${with_saxon_jar+set}" = set; then + withval="$with_saxon_jar" + SAXON_JAR="$withval" +fi; -# Check whether --with-system-libxslt was given. -if test "${with_system_libxslt+set}" = set; then : - withval=$with_system_libxslt; -fi +# Check whether --with-system-libxslt or --without-system-libxslt was given. +if test "${with_system_libxslt+set}" = set; then + withval="$with_system_libxslt" +fi; -# Check whether --with-system-odbc was given. -if test "${with_system_odbc+set}" = set; then : - withval=$with_system_odbc; -fi +# Check whether --with-system-odbc or --without-system-odbc was given. +if test "${with_system_odbc+set}" = set; then + withval="$with_system_odbc" +fi; -# Check whether --with-system-sane was given. -if test "${with_system_sane+set}" = set; then : - withval=$with_system_sane; -fi +# Check whether --with-system-sane or --without-system-sane was given. +if test "${with_system_sane+set}" = set; then + withval="$with_system_sane" +fi; -# Check whether --with-system-xrender was given. -if test "${with_system_xrender+set}" = set; then : - withval=$with_system_xrender; -fi +# Check whether --with-system-xrender or --without-system-xrender was given. +if test "${with_system_xrender+set}" = set; then + withval="$with_system_xrender" +fi; -# Check whether --with-system-curl was given. -if test "${with_system_curl+set}" = set; then : - withval=$with_system_curl; -fi +# Check whether --with-system-curl or --without-system-curl was given. +if test "${with_system_curl+set}" = set; then + withval="$with_system_curl" +fi; -# Check whether --with-system-boost was given. -if test "${with_system_boost+set}" = set; then : - withval=$with_system_boost; -fi +# Check whether --with-system-boost or --without-system-boost was given. +if test "${with_system_boost+set}" = set; then + withval="$with_system_boost" +fi; -# Check whether --with-system-vigra was given. -if test "${with_system_vigra+set}" = set; then : - withval=$with_system_vigra; -fi +# Check whether --with-system-vigra or --without-system-vigra was given. +if test "${with_system_vigra+set}" = set; then + withval="$with_system_vigra" -# Check whether --enable-neon was given. -if test "${enable_neon+set}" = set; then : - enableval=$enable_neon; -fi +fi; +# Check whether --enable-neon or --disable-neon was given. +if test "${enable_neon+set}" = set; then + enableval="$enable_neon" -# Check whether --enable-Xaw was given. -if test "${enable_Xaw+set}" = set; then : - enableval=$enable_Xaw; -fi +fi; +# Check whether --enable-Xaw or --disable-Xaw was given. +if test "${enable_Xaw+set}" = set; then + enableval="$enable_Xaw" +fi; -# Check whether --with-system-neon was given. -if test "${with_system_neon+set}" = set; then : - withval=$with_system_neon; -fi +# Check whether --with-system-neon or --without-system-neon was given. +if test "${with_system_neon+set}" = set; then + withval="$with_system_neon" +fi; -# Check whether --with-system-agg was given. -if test "${with_system_agg+set}" = set; then : - withval=$with_system_agg; -fi +# Check whether --with-system-agg or --without-system-agg was given. +if test "${with_system_agg+set}" = set; then + withval="$with_system_agg" +fi; -# Check whether --with-system-hunspell was given. -if test "${with_system_hunspell+set}" = set; then : - withval=$with_system_hunspell; -fi +# Check whether --with-system-hunspell or --without-system-hunspell was given. +if test "${with_system_hunspell+set}" = set; then + withval="$with_system_hunspell" +fi; -# Check whether --with-system-mythes was given. -if test "${with_system_mythes+set}" = set; then : - withval=$with_system_mythes; -fi +# Check whether --with-system-mythes or --without-system-mythes was given. +if test "${with_system_mythes+set}" = set; then + withval="$with_system_mythes" +fi; -# Check whether --with-system-altlinuxhyph was given. -if test "${with_system_altlinuxhyph+set}" = set; then : - withval=$with_system_altlinuxhyph; -fi +# Check whether --with-system-altlinuxhyph or --without-system-altlinuxhyph was given. +if test "${with_system_altlinuxhyph+set}" = set; then + withval="$with_system_altlinuxhyph" +fi; -# Check whether --with-system-lpsolve was given. -if test "${with_system_lpsolve+set}" = set; then : - withval=$with_system_lpsolve; -fi +# Check whether --with-system-lpsolve or --without-system-lpsolve was given. +if test "${with_system_lpsolve+set}" = set; then + withval="$with_system_lpsolve" +fi; -# Check whether --with-system-mozilla was given. -if test "${with_system_mozilla+set}" = set; then : - withval=$with_system_mozilla; WITH_SYSTEM_MOZILLA=$withval +# Check whether --with-system-mozilla or --without-system-mozilla was given. +if test "${with_system_mozilla+set}" = set; then + withval="$with_system_mozilla" + WITH_SYSTEM_MOZILLA=$withval else WITH_SYSTEM_MOZILLA=no -fi +fi; - -# Check whether --with-stlport was given. -if test "${with_stlport+set}" = set; then : - withval=$with_stlport; WITH_STLPORT=$withval +# Check whether --with-stlport or --without-stlport was given. +if test "${with_stlport+set}" = set; then + withval="$with_stlport" + WITH_STLPORT=$withval else WITH_STLPORT=auto -fi +fi; +# Check whether --with-jdk-home or --without-jdk-home was given. +if test "${with_jdk_home+set}" = set; then + withval="$with_jdk_home" -# Check whether --with-jdk-home was given. -if test "${with_jdk_home+set}" = set; then : - withval=$with_jdk_home; -fi - +fi; -# Check whether --with-gxx_include_path was given. -if test "${with_gxx_include_path+set}" = set; then : - withval=$with_gxx_include_path; -fi +# Check whether --with-gxx_include_path or --without-gxx_include_path was given. +if test "${with_gxx_include_path+set}" = set; then + withval="$with_gxx_include_path" +fi; -# Check whether --with-java was given. -if test "${with_java+set}" = set; then : - withval=$with_java; if test "$withval" = "yes"; then WITH_JAVA=java; else WITH_JAVA=$withval; fi +# Check whether --with-java or --without-java was given. +if test "${with_java+set}" = set; then + withval="$with_java" + if test "$withval" = "yes"; then WITH_JAVA=java; else WITH_JAVA=$withval; fi else WITH_JAVA=java -fi - -# Check whether --enable-gcjaot was given. -if test "${enable_gcjaot+set}" = set; then : - enableval=$enable_gcjaot; -fi +fi; +# Check whether --enable-gcjaot or --disable-gcjaot was given. +if test "${enable_gcjaot+set}" = set; then + enableval="$enable_gcjaot" +fi; -# Check whether --with-ant-home was given. -if test "${with_ant_home+set}" = set; then : - withval=$with_ant_home; -fi +# Check whether --with-ant-home or --without-ant-home was given. +if test "${with_ant_home+set}" = set; then + withval="$with_ant_home" +fi; -# Check whether --with-perl-home was given. -if test "${with_perl_home+set}" = set; then : - withval=$with_perl_home; -fi +# Check whether --with-perl-home or --without-perl-home was given. +if test "${with_perl_home+set}" = set; then + withval="$with_perl_home" +fi; -# Check whether --with-cl-home was given. -if test "${with_cl_home+set}" = set; then : - withval=$with_cl_home; -fi +# Check whether --with-cl-home or --without-cl-home was given. +if test "${with_cl_home+set}" = set; then + withval="$with_cl_home" +fi; -# Check whether --with-mspdb-path was given. -if test "${with_mspdb_path+set}" = set; then : - withval=$with_mspdb_path; -fi +# Check whether --with-mspdb-path or --without-mspdb-path was given. +if test "${with_mspdb_path+set}" = set; then + withval="$with_mspdb_path" +fi; -# Check whether --with-midl-path was given. -if test "${with_midl_path+set}" = set; then : - withval=$with_midl_path; -fi +# Check whether --with-midl-path or --without-midl-path was given. +if test "${with_midl_path+set}" = set; then + withval="$with_midl_path" +fi; -# Check whether --with-csc-path was given. -if test "${with_csc_path+set}" = set; then : - withval=$with_csc_path; -fi +# Check whether --with-csc-path or --without-csc-path was given. +if test "${with_csc_path+set}" = set; then + withval="$with_csc_path" +fi; -# Check whether --with-nsis-path was given. -if test "${with_nsis_path+set}" = set; then : - withval=$with_nsis_path; -fi +# Check whether --with-nsis-path or --without-nsis-path was given. +if test "${with_nsis_path+set}" = set; then + withval="$with_nsis_path" +fi; -# Check whether --with-frame-home was given. -if test "${with_frame_home+set}" = set; then : - withval=$with_frame_home; -fi +# Check whether --with-frame-home or --without-frame-home was given. +if test "${with_frame_home+set}" = set; then + withval="$with_frame_home" +fi; -# Check whether --with-psdk-home was given. -if test "${with_psdk_home+set}" = set; then : - withval=$with_psdk_home; -fi +# Check whether --with-psdk-home or --without-psdk-home was given. +if test "${with_psdk_home+set}" = set; then + withval="$with_psdk_home" +fi; -# Check whether --with-directx-home was given. -if test "${with_directx_home+set}" = set; then : - withval=$with_directx_home; -fi +# Check whether --with-directx-home or --without-directx-home was given. +if test "${with_directx_home+set}" = set; then + withval="$with_directx_home" +fi; -# Check whether --with-mozilla-build was given. -if test "${with_mozilla_build+set}" = set; then : - withval=$with_mozilla_build; MOZILLABUILD=$withval -fi +# Check whether --with-mozilla-build or --without-mozilla-build was given. +if test "${with_mozilla_build+set}" = set; then + withval="$with_mozilla_build" + MOZILLABUILD=$withval +fi; +# Check whether --with-local-solenv or --without-local-solenv was given. +if test "${with_local_solenv+set}" = set; then + withval="$with_local_solenv" -# Check whether --with-local-solenv was given. -if test "${with_local_solenv+set}" = set; then : - withval=$with_local_solenv; -fi +fi; +# Check whether --with-local-solver or --without-local-solver was given. +if test "${with_local_solver+set}" = set; then + withval="$with_local_solver" -# Check whether --with-local-solver was given. -if test "${with_local_solver+set}" = set; then : - withval=$with_local_solver; -fi +fi; +# Check whether --enable-check-only or --disable-check-only was given. +if test "${enable_check_only+set}" = set; then + enableval="$enable_check_only" -# Check whether --enable-check-only was given. -if test "${enable_check_only+set}" = set; then : - enableval=$enable_check_only; -fi +fi; +# Check whether --enable-ccache-skip or --disable-ccache-skip was given. +if test "${enable_ccache_skip+set}" = set; then + enableval="$enable_ccache_skip" -# Check whether --enable-ccache-skip was given. -if test "${enable_ccache_skip+set}" = set; then : - enableval=$enable_ccache_skip; else enable_ccache_skip=auto -fi - +fi; -# Check whether --with-lang was given. -if test "${with_lang+set}" = set; then : - withval=$with_lang; -fi +# Check whether --with-lang or --without-lang was given. +if test "${with_lang+set}" = set; then + withval="$with_lang" +fi; -# Check whether --with-poor-help-localizations was given. -if test "${with_poor_help_localizations+set}" = set; then : - withval=$with_poor_help_localizations; -fi +# Check whether --with-poor-help-localizations or --without-poor-help-localizations was given. +if test "${with_poor_help_localizations+set}" = set; then + withval="$with_poor_help_localizations" +fi; -# Check whether --with-dict was given. -if test "${with_dict+set}" = set; then : - withval=$with_dict; -fi +# Check whether --with-dict or --without-dict was given. +if test "${with_dict+set}" = set; then + withval="$with_dict" +fi; -# Check whether --with-intro-bitmaps was given. -if test "${with_intro_bitmaps+set}" = set; then : - withval=$with_intro_bitmaps; -fi +# Check whether --with-intro-bitmaps or --without-intro-bitmaps was given. +if test "${with_intro_bitmaps+set}" = set; then + withval="$with_intro_bitmaps" +fi; -# Check whether --with-about-bitmaps was given. -if test "${with_about_bitmaps+set}" = set; then : - withval=$with_about_bitmaps; -fi +# Check whether --with-about-bitmaps or --without-about-bitmaps was given. +if test "${with_about_bitmaps+set}" = set; then + withval="$with_about_bitmaps" +fi; -# Check whether --with-vendor was given. -if test "${with_vendor+set}" = set; then : - withval=$with_vendor; -fi +# Check whether --with-vendor or --without-vendor was given. +if test "${with_vendor+set}" = set; then + withval="$with_vendor" +fi; -# Check whether --with-unix-wrapper was given. -if test "${with_unix_wrapper+set}" = set; then : - withval=$with_unix_wrapper; -fi +# Check whether --with-unix-wrapper or --without-unix-wrapper was given. +if test "${with_unix_wrapper+set}" = set; then + withval="$with_unix_wrapper" +fi; -# Check whether --with-asm-home was given. -if test "${with_asm_home+set}" = set; then : - withval=$with_asm_home; -fi +# Check whether --with-asm-home or --without-asm-home was given. +if test "${with_asm_home+set}" = set; then + withval="$with_asm_home" +fi; -# Check whether --with-os-version was given. -if test "${with_os_version+set}" = set; then : - withval=$with_os_version; -fi +# Check whether --with-os-version or --without-os-version was given. +if test "${with_os_version+set}" = set; then + withval="$with_os_version" +fi; -# Check whether --with-unzip-home was given. -if test "${with_unzip_home+set}" = set; then : - withval=$with_unzip_home; -fi +# Check whether --with-unzip-home or --without-unzip-home was given. +if test "${with_unzip_home+set}" = set; then + withval="$with_unzip_home" +fi; -# Check whether --with-zip-home was given. -if test "${with_zip_home+set}" = set; then : - withval=$with_zip_home; -fi +# Check whether --with-zip-home or --without-zip-home was given. +if test "${with_zip_home+set}" = set; then + withval="$with_zip_home" +fi; -# Check whether --with-mingwin was given. -if test "${with_mingwin+set}" = set; then : - withval=$with_mingwin; WITH_MINGWIN=$withval +# Check whether --with-mingwin or --without-mingwin was given. +if test "${with_mingwin+set}" = set; then + withval="$with_mingwin" + WITH_MINGWIN=$withval else WITH_MINGWIN=0 -fi +fi; - -# Check whether --with-use-shell was given. -if test "${with_use_shell+set}" = set; then : - withval=$with_use_shell; with_use_shell=$withval +# Check whether --with-use-shell or --without-use-shell was given. +if test "${with_use_shell+set}" = set; then + withval="$with_use_shell" + with_use_shell=$withval else with_use_shell="tcsh" -fi +fi; +# Check whether --with-build-version or --without-build-version was given. +if test "${with_build_version+set}" = set; then + withval="$with_build_version" + with_build_version=$withval +fi; -# Check whether --with-build-version was given. -if test "${with_build_version+set}" = set; then : - withval=$with_build_version; with_build_version=$withval -fi - - -# Check whether --with-alloc was given. -if test "${with_alloc+set}" = set; then : - withval=$with_alloc; -fi +# Check whether --with-alloc or --without-alloc was given. +if test "${with_alloc+set}" = set; then + withval="$with_alloc" -# Check whether --enable-verbose was given. -if test "${enable_verbose+set}" = set; then : - enableval=$enable_verbose; -fi +fi; +# Check whether --enable-verbose or --disable-verbose was given. +if test "${enable_verbose+set}" = set; then + enableval="$enable_verbose" +fi; BUILD_TYPE="OOo" @@ -4662,147 +2914,32 @@ echo "********************************************************************" echo "* *" echo "* Checking the platform pre-requisites. *" echo "* *" -echo "********************************************************************" -echo "" -cat /dev/null > warn -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if test "${ac_cv_path_GREP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi +echo "********************************************************************" +echo "" +cat /dev/null > warn +echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_prog_egrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6 + EGREP=$ac_cv_prog_egrep for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AWK+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. @@ -4812,37 +2949,35 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } + echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - test -n "$AWK" && break done # Extract the first word of "$AWK", so it can be a program name with args. set dummy $AWK; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_AWK+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $AWK in [\\/]* | ?:[\\/]*) @@ -4854,41 +2989,42 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_AWK="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done ;; esac fi AWK=$ac_cv_path_AWK + if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } + echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test -z "$AWK"; then - as_fn_error "install awk to run this script" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: install awk to run this script" >&5 +echo "$as_me: error: install awk to run this script" >&2;} + { (exit 1); exit 1; }; } fi for ac_prog in sed do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_SED+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_SED+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $SED in [\\/]* | ?:[\\/]*) @@ -4900,46 +3036,47 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_SED="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done ;; esac fi SED=$ac_cv_path_SED + if test -n "$SED"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SED" >&5 -$as_echo "$SED" >&6; } + echo "$as_me:$LINENO: result: $SED" >&5 +echo "${ECHO_T}$SED" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - test -n "$SED" && break done if test -z "$SED"; then - as_fn_error "install sed to run this script" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: install sed to run this script" >&5 +echo "$as_me: error: install sed to run this script" >&2;} + { (exit 1); exit 1; }; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for solenv environment" >&5 -$as_echo_n "checking for solenv environment... " >&6; } +echo "$as_me:$LINENO: checking for solenv environment" >&5 +echo $ECHO_N "checking for solenv environment... $ECHO_C" >&6 if test -z "$with_local_solenv"; then LOCAL_SOLENV="DEFAULT" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: default" >&5 -$as_echo "default" >&6; } + echo "$as_me:$LINENO: result: default" >&5 +echo "${ECHO_T}default" >&6 else LOCAL_SOLENV=$with_local_solenv - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_local_solenv" >&5 -$as_echo "$with_local_solenv" >&6; } + echo "$as_me:$LINENO: result: $with_local_solenv" >&5 +echo "${ECHO_T}$with_local_solenv" >&6 fi @@ -4957,134 +3094,110 @@ if test -e $_solenv/inc/minor.mk; then SOURCEVERSION="`grep SOURCEVERSION= $_solenv/inc/minor.mk | $AWK -F"=" '{ print $2 }'`" else - as_fn_error "$_solenv/inc/minor.mk missing but needed for architecture/os detecion and proper environment script generation..." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: $_solenv/inc/minor.mk missing but needed for architecture/os detecion and proper environment script generation..." >&5 +echo "$as_me: error: $_solenv/inc/minor.mk missing but needed for architecture/os detecion and proper environment script generation..." >&2;} + { (exit 1); exit 1; }; } fi ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - for ac_t in install-sh install.sh shtool; do - if test -f "$ac_dir/$ac_t"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/$ac_t -c" - break 2 - fi - done +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f $ac_dir/shtool; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi done if test -z "$ac_aux_dir"; then - as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 +echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { (exit 1); exit 1; }; } fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if test "${ac_cv_build+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) as_fn_error "invalid value of canonical build" "$LINENO" 5;; -esac +$ac_config_sub sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 +echo "$as_me: error: cannot run $ac_config_sub" >&2;} + { (exit 1); exit 1; }; } + +echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6 +if test "${ac_cv_build+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_build_alias=$build_alias +test -z "$ac_cv_build_alias" && + ac_cv_build_alias=`$ac_config_guess` +test -z "$ac_cv_build_alias" && + { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6 build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac +build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if test "${ac_cv_host+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build +echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6 +if test "${ac_cv_host+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 -fi + ac_cv_host_alias=$host_alias +test -z "$ac_cv_host_alias" && + ac_cv_host_alias=$ac_cv_build_alias +ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + { (exit 1); exit 1; }; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) as_fn_error "invalid value of canonical host" "$LINENO" 5;; -esac +echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6 host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac +host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 -$as_echo_n "checking target system type... " >&6; } -if test "${ac_cv_target+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking target system type" >&5 +echo $ECHO_N "checking target system type... $ECHO_C" >&6 +if test "${ac_cv_target+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "x$target_alias" = x; then - ac_cv_target=$ac_cv_host -else - ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || - as_fn_error "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 -fi + ac_cv_target_alias=$target_alias +test "x$ac_cv_target_alias" = "x" && + ac_cv_target_alias=$ac_cv_host_alias +ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} + { (exit 1); exit 1; }; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 -$as_echo "$ac_cv_target" >&6; } -case $ac_cv_target in -*-*-*) ;; -*) as_fn_error "invalid value of canonical target" "$LINENO" 5;; -esac +echo "$as_me:$LINENO: result: $ac_cv_target" >&5 +echo "${ECHO_T}$ac_cv_target" >&6 target=$ac_cv_target -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_target -shift -target_cpu=$1 -target_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -target_os=$* -IFS=$ac_save_IFS -case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac +target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` # The aliases save the names the user supplied, while $host etc. @@ -5093,22 +3206,23 @@ test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- - if test "$build" != "$host" -o "$build" != "$target" \ -o "$host" != "$target"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cross-compiling by any means is not supported (yet)!" >&5 -$as_echo "$as_me: WARNING: cross-compiling by any means is not supported (yet)!" >&2;} + { echo "$as_me:$LINENO: WARNING: cross-compiling by any means is not supported (yet)!" >&5 +echo "$as_me: WARNING: cross-compiling by any means is not supported (yet)!" >&2;} echo "cross-compiling by any means is not supported (yet)!" >> warn fi if echo "$build_os" | grep cygwin; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Cygwin version" >&5 -$as_echo_n "checking Cygwin version... " >&6; } + echo "$as_me:$LINENO: checking Cygwin version" >&5 +echo $ECHO_N "checking Cygwin version... $ECHO_C" >&6 CygwinVer=`uname -r` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CygwinVer" >&5 -$as_echo "$CygwinVer" >&6; } + echo "$as_me:$LINENO: result: $CygwinVer" >&5 +echo "${ECHO_T}$CygwinVer" >&6 if test "`echo $CygwinVer | $AWK -F . '{ print $1$2 }'`" -lt "15"; then - as_fn_error "You need at least Cygwin V1.5.x" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: You need at least Cygwin V1.5.x" >&5 +echo "$as_me: error: You need at least Cygwin V1.5.x" >&2;} + { (exit 1); exit 1; }; } fi else CygwinVer="false" @@ -5125,10 +3239,10 @@ case "$build_os" in _os=SunOS # Extract the first word of "gtar", so it can be a program name with args. set dummy gtar; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_GNUTAR+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_GNUTAR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $GNUTAR in [\\/]* | ?:[\\/]*) @@ -5141,51 +3255,56 @@ for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GNUTAR="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done ;; esac fi GNUTAR=$ac_cv_path_GNUTAR + if test -n "$GNUTAR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GNUTAR" >&5 -$as_echo "$GNUTAR" >&6; } + echo "$as_me:$LINENO: result: $GNUTAR" >&5 +echo "${ECHO_T}$GNUTAR" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test -z "$GNUTAR"; then - as_fn_error "gtar (gnu tar) not found but needed. Install it (SUN Freeware package)." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: gtar (gnu tar) not found but needed. Install it (SUN Freeware package)." >&5 +echo "$as_me: error: gtar (gnu tar) not found but needed. Install it (SUN Freeware package)." >&2;} + { (exit 1); exit 1; }; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking the Solaris operating system release" >&5 -$as_echo_n "checking the Solaris operating system release... " >&6; } + echo "$as_me:$LINENO: checking the Solaris operating system release" >&5 +echo $ECHO_N "checking the Solaris operating system release... $ECHO_C" >&6 _os_release=`echo $build_os | $SED -e s/solaris2\.//` if test "$_os_release" -lt "6"; then - as_fn_error "use solaris >= 6 to build OpenOffice.org" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: use solaris >= 6 to build OpenOffice.org" >&5 +echo "$as_me: error: use solaris >= 6 to build OpenOffice.org" >&2;} + { (exit 1); exit 1; }; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok ($_os_release)" >&5 -$as_echo "ok ($_os_release)" >&6; } + echo "$as_me:$LINENO: result: ok ($_os_release)" >&5 +echo "${ECHO_T}ok ($_os_release)" >&6 fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking the processor type" >&5 -$as_echo_n "checking the processor type... " >&6; } + echo "$as_me:$LINENO: checking the processor type" >&5 +echo $ECHO_N "checking the processor type... $ECHO_C" >&6 if test "$build_cpu" = "sparc" -o "$build_cpu" = "i386"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok ($build_cpu)" >&5 -$as_echo "ok ($build_cpu)" >&6; } + echo "$as_me:$LINENO: result: ok ($build_cpu)" >&5 +echo "${ECHO_T}ok ($build_cpu)" >&6 else - as_fn_error "only sparc and i386 processors are supported" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: only sparc and i386 processors are supported" >&5 +echo "$as_me: error: only sparc and i386 processors are supported" >&2;} + { (exit 1); exit 1; }; } fi ;; linux-gnu*) @@ -5216,8 +3335,8 @@ $as_echo "ok ($build_cpu)" >&6; } test_freetype=no _os=Darwin if test "$enable_systray" = "yes" && test "$enable_gtk" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Disabling gtk-quickstarter - not supported on Mac. Use --disable-systray" >&5 -$as_echo "$as_me: WARNING: Disabling gtk-quickstarter - not supported on Mac. Use --disable-systray" >&2;} + { echo "$as_me:$LINENO: WARNING: Disabling gtk-quickstarter - not supported on Mac. Use --disable-systray" >&5 +echo "$as_me: WARNING: Disabling gtk-quickstarter - not supported on Mac. Use --disable-systray" >&2;} echo "Disabling gtk-quickstarter - not supported on Mac. Use --disable-systray" >>warn enable_systray=no fi @@ -5238,17 +3357,17 @@ $as_echo "$as_me: WARNING: Disabling gtk-quickstarter - not supported on Mac. Us test_cups=yes test_randr=yes test_freetype=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking the FreeBSD operating system release" >&5 -$as_echo_n "checking the FreeBSD operating system release... " >&6; } + echo "$as_me:$LINENO: checking the FreeBSD operating system release" >&5 +echo $ECHO_N "checking the FreeBSD operating system release... $ECHO_C" >&6 if test -n "$with_os_version"; then OSVERSION="$with_os_version" else OSVERSION=`/sbin/sysctl -n kern.osreldate` fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found OSVERSION=$OSVERSION" >&5 -$as_echo "found OSVERSION=$OSVERSION" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking which thread library to use" >&5 -$as_echo_n "checking which thread library to use... " >&6; } + echo "$as_me:$LINENO: result: found OSVERSION=$OSVERSION" >&5 +echo "${ECHO_T}found OSVERSION=$OSVERSION" >&6 + echo "$as_me:$LINENO: checking which thread library to use" >&5 +echo $ECHO_N "checking which thread library to use... $ECHO_C" >&6 if test "$OSVERSION" -lt "500016"; then PTHREAD_CFLAGS="-D_THREAD_SAFE" PTHREAD_LIBS="-pthread" @@ -5259,8 +3378,8 @@ $as_echo_n "checking which thread library to use... " >&6; } PTHREAD_CFLAGS="" PTHREAD_LIBS="-pthread" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_LIBS" >&5 -$as_echo "$PTHREAD_LIBS" >&6; } + echo "$as_me:$LINENO: result: $PTHREAD_LIBS" >&5 +echo "${ECHO_T}$PTHREAD_LIBS" >&6 _os=FreeBSD ;; osf) @@ -5289,7 +3408,9 @@ $as_echo "$PTHREAD_LIBS" >&6; } _os=AIX ;; *) - as_fn_error "$_os operating system is not suitable to build OpenOffice.org!" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: $_os operating system is not suitable to build OpenOffice.org!" >&5 +echo "$as_me: error: $_os operating system is not suitable to build OpenOffice.org!" >&2;} + { (exit 1); exit 1; }; } ;; esac @@ -5297,26 +3418,28 @@ esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable crashdump feature" >&5 -$as_echo_n "checking whether to enable crashdump feature... " >&6; } +echo "$as_me:$LINENO: checking whether to enable crashdump feature" >&5 +echo $ECHO_N "checking whether to enable crashdump feature... $ECHO_C" >&6 if test "$enable_crashdump" = "yes" -o "$enable_crashdump" = "TRUE"; then ENABLE_CRASHDUMP="TRUE" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 BUILD_TYPE="$BUILD_TYPE CRASHREP" else if test "$enable_crashdump" = "STATIC"; then ENABLE_CRASHDUMP="STATIC" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, STATIC" >&5 -$as_echo "yes, STATIC" >&6; } + echo "$as_me:$LINENO: result: yes, STATIC" >&5 +echo "${ECHO_T}yes, STATIC" >&6 BUILD_TYPE="$BUILD_TYPE CRASHREP" else if test "$enable_crashdump" = "" -o "$enable_crashdump" = "no"; then ENABLE_CRASHDUMP="" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 else - as_fn_error "--enable-crashdump only accepts yes, no, TRUE or STATIC as parameter." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: --enable-crashdump only accepts yes, no, TRUE or STATIC as parameter." >&5 +echo "$as_me: error: --enable-crashdump only accepts yes, no, TRUE or STATIC as parameter." >&2;} + { (exit 1); exit 1; }; } fi fi fi @@ -5327,88 +3450,90 @@ if test "$_os" = "WINNT"; then fi if test "$_os" = "WINNT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use the standard non-optimizing compiler" >&5 -$as_echo_n "checking whether to use the standard non-optimizing compiler... " >&6; } + echo "$as_me:$LINENO: checking whether to use the standard non-optimizing compiler" >&5 +echo $ECHO_N "checking whether to use the standard non-optimizing compiler... $ECHO_C" >&6 if test "$enable_cl_standard" = "" -o "$enable_cl_standard" = "no"; then VC_STANDARD="" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 else VC_STANDARD="TRUE" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to turn warnings to errors" >&5 -$as_echo_n "checking whether to turn warnings to errors... " >&6; } +echo "$as_me:$LINENO: checking whether to turn warnings to errors" >&5 +echo $ECHO_N "checking whether to turn warnings to errors... $ECHO_C" >&6 if test -n "$enable_werror" && test "$enable_werror" != "no"; then ENABLE_WERROR="TRUE" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Turning warnings to errors has no effect in modules or" >&5 -$as_echo "$as_me: WARNING: Turning warnings to errors has no effect in modules or" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: on platforms where it has been disabled explicitely" >&5 -$as_echo "$as_me: WARNING: on platforms where it has been disabled explicitely" >&2;} + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + { echo "$as_me:$LINENO: WARNING: Turning warnings to errors has no effect in modules or" >&5 +echo "$as_me: WARNING: Turning warnings to errors has no effect in modules or" >&2;} + { echo "$as_me:$LINENO: WARNING: on platforms where it has been disabled explicitely" >&5 +echo "$as_me: WARNING: on platforms where it has been disabled explicitely" >&2;} echo "Turning warnings to errors has no effect in modules or on platforms where it has been disabled explicitely" >> warn else ENABLE_WERROR="FALSE" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to do a debug build" >&5 -$as_echo_n "checking whether to do a debug build... " >&6; } +echo "$as_me:$LINENO: checking whether to do a debug build" >&5 +echo $ECHO_N "checking whether to do a debug build... $ECHO_C" >&6 if test -n "$enable_debug" && test "$enable_debug" != "no"; then ENABLE_DEBUG="TRUE" if test -z "$enable_symbols"; then enable_symbols="yes" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else ENABLE_DEBUG="FALSE" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with additional debug utilities" >&5 -$as_echo_n "checking whether to build with additional debug utilities... " >&6; } +echo "$as_me:$LINENO: checking whether to build with additional debug utilities" >&5 +echo $ECHO_N "checking whether to build with additional debug utilities... $ECHO_C" >&6 if test -n "$enable_dbgutil" && test "$enable_dbgutil" != "no"; then PROEXT="" PRODUCT="" PROFULLSWITCH="" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else PRODUCT="full" PROFULLSWITCH="product=full" PROEXT=".pro" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, full product build" >&5 -$as_echo "no, full product build" >&6; } + echo "$as_me:$LINENO: result: no, full product build" >&5 +echo "${ECHO_T}no, full product build" >&6 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include symbols into final build" >&5 -$as_echo_n "checking whether to include symbols into final build... " >&6; } +echo "$as_me:$LINENO: checking whether to include symbols into final build" >&5 +echo $ECHO_N "checking whether to include symbols into final build... $ECHO_C" >&6 if test -n "$enable_symbols" && test "$enable_symbols" != "no"; then if test "$enable_symbols" = "yes" -o "$enable_symbols" = "TRUE"; then ENABLE_SYMBOLS="TRUE" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else if test "$enable_symbols" = "SMALL" -o "$enable_symbols" = "small"; then ENABLE_SYMBOLS="SMALL" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, small ones" >&5 -$as_echo "yes, small ones" >&6; } + echo "$as_me:$LINENO: result: yes, small ones" >&5 +echo "${ECHO_T}yes, small ones" >&6 else if test "$enable_symbols" != "no" ; then echo enable symbols is: $enable_symbols - as_fn_error "--enable-symbols only accepts yes, TRUE or SMALL as parameter." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: --enable-symbols only accepts yes, TRUE or SMALL as parameter." >&5 +echo "$as_me: error: --enable-symbols only accepts yes, TRUE or SMALL as parameter." >&2;} + { (exit 1); exit 1; }; } else ENABLE_SYMBOLS= fi @@ -5416,20 +3541,22 @@ $as_echo "yes, small ones" >&6; } fi else ENABLE_SYMBOLS= - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to strip the solver or not." >&5 -$as_echo_n "checking whether to strip the solver or not.... " >&6; } +echo "$as_me:$LINENO: checking whether to strip the solver or not." >&5 +echo $ECHO_N "checking whether to strip the solver or not.... $ECHO_C" >&6 if test -n "$enable_strip_solver"; then if test "$enable_strip_solver" = "yes"; then DISABLE_STRIP= else if test "$enable_strip_solver" = "no"; then DISABLE_STRIP="TRUE" else - as_fn_error "--disable-strip-solver only accepts yes or no as parameter." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: --disable-strip-solver only accepts yes or no as parameter." >&5 +echo "$as_me: error: --disable-strip-solver only accepts yes or no as parameter." >&2;} + { (exit 1); exit 1; }; } fi fi else @@ -5441,151 +3568,151 @@ else fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable native CUPS support" >&5 -$as_echo_n "checking whether to enable native CUPS support... " >&6; } +echo "$as_me:$LINENO: checking whether to enable native CUPS support" >&5 +echo $ECHO_N "checking whether to enable native CUPS support... $ECHO_C" >&6 if test "$test_cups" = "yes" -a \( "$enable_cups" = "yes" -o "$enable_cups" = "TRUE" \) ; then ENABLE_CUPS="TRUE" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else ENABLE_CUPS="" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable fontconfig support" >&5 -$as_echo_n "checking whether to enable fontconfig support... " >&6; } +echo "$as_me:$LINENO: checking whether to enable fontconfig support" >&5 +echo $ECHO_N "checking whether to enable fontconfig support... $ECHO_C" >&6 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a \( "$enable_fontconfig" = "yes" -o "$enable_fontconfig" = "TRUE" \); then ENABLE_FONTCONFIG="TRUE" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else ENABLE_FONTCONFIG="" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable filters for legacy binary file formats (StarOffice 5.2)" >&5 -$as_echo_n "checking whether to enable filters for legacy binary file formats (StarOffice 5.2)... " >&6; } +echo "$as_me:$LINENO: checking whether to enable filters for legacy binary file formats (StarOffice 5.2)" >&5 +echo $ECHO_N "checking whether to enable filters for legacy binary file formats (StarOffice 5.2)... $ECHO_C" >&6 if test "$enable_binfilter" = "no"; then WITH_BINFILTER="NO" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 else WITH_BINFILTER="YES" BUILD_TYPE="$BUILD_TYPE BINFILTER" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 fi if test "$_os" = "WINNT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use DirectX" >&5 -$as_echo_n "checking whether to use DirectX... " >&6; } + echo "$as_me:$LINENO: checking whether to use DirectX" >&5 +echo $ECHO_N "checking whether to use DirectX... $ECHO_C" >&6 if test "$enable_directx" = "yes" -o "$enable_directx" = "TRUE" -o "$enable_directx" = ""; then ENABLE_DIRECTX="TRUE" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else ENABLE_DIRECTX="" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use ActiveX" >&5 -$as_echo_n "checking whether to use ActiveX... " >&6; } + echo "$as_me:$LINENO: checking whether to use ActiveX" >&5 +echo $ECHO_N "checking whether to use ActiveX... $ECHO_C" >&6 if test "$enable_activex" = "yes" -o "$enable_activex" = "TRUE" -o "$enable_activex" = ""; then DISABLE_ACTIVEX="" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else DISABLE_ACTIVEX="TRUE" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use ATL" >&5 -$as_echo_n "checking whether to use ATL... " >&6; } + echo "$as_me:$LINENO: checking whether to use ATL" >&5 +echo $ECHO_N "checking whether to use ATL... $ECHO_C" >&6 if test "$enable_atl" = "yes" -o "$enable_atl" = "TRUE" -o "$enable_atl" = ""; then DISABLE_ATL="" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else DISABLE_ATL="TRUE" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use RPATH in shared libraries" >&5 -$as_echo_n "checking whether to use RPATH in shared libraries... " >&6; } +echo "$as_me:$LINENO: checking whether to use RPATH in shared libraries" >&5 +echo $ECHO_N "checking whether to use RPATH in shared libraries... $ECHO_C" >&6 if test "$enable_rpath" = "no"; then ENABLE_RPATH="no" else ENABLE_RPATH="yes" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ENABLE_RPATH" >&5 -$as_echo "$ENABLE_RPATH" >&6; } +echo "$as_me:$LINENO: result: $ENABLE_RPATH" >&5 +echo "${ECHO_T}$ENABLE_RPATH" >&6 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include MySpell dictionaries" >&5 -$as_echo_n "checking whether to include MySpell dictionaries... " >&6; } +echo "$as_me:$LINENO: checking whether to include MySpell dictionaries" >&5 +echo $ECHO_N "checking whether to include MySpell dictionaries... $ECHO_C" >&6 if test -z "$with_myspell_dicts" || test "$with_myspell_dicts" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 WITH_MYSPELL_DICTS=YES BUILD_TYPE="$BUILD_TYPE DICTIONARIES" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 WITH_MYSPELL_DICTS=NO fi if test "$WITH_MYSPELL_DICTS" = "NO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use dicts from external paths" >&5 -$as_echo_n "checking whether to use dicts from external paths... " >&6; } + echo "$as_me:$LINENO: checking whether to use dicts from external paths" >&5 +echo $ECHO_N "checking whether to use dicts from external paths... $ECHO_C" >&6 if test -n "$with_system_dicts" -a "$with_system_dicts" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 SYSTEM_DICTS=YES - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for spelling dictionary directory" >&5 -$as_echo_n "checking for spelling dictionary directory... " >&6; } + echo "$as_me:$LINENO: checking for spelling dictionary directory" >&5 +echo $ECHO_N "checking for spelling dictionary directory... $ECHO_C" >&6 if test -n "$with_external_dict_dir"; then DICT_SYSTEM_DIR=file://$with_external_dict_dir else DICT_SYSTEM_DIR=file:///usr/share/hunspell fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DICT_SYSTEM_DIR" >&5 -$as_echo "$DICT_SYSTEM_DIR" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hyphenation patterns directory" >&5 -$as_echo_n "checking for hyphenation patterns directory... " >&6; } + echo "$as_me:$LINENO: result: $DICT_SYSTEM_DIR" >&5 +echo "${ECHO_T}$DICT_SYSTEM_DIR" >&6 + echo "$as_me:$LINENO: checking for hyphenation patterns directory" >&5 +echo $ECHO_N "checking for hyphenation patterns directory... $ECHO_C" >&6 if test -n "$with_external_hyph_dir"; then HYPH_SYSTEM_DIR=file://$with_external_hyph_dir else HYPH_SYSTEM_DIR=file:///usr/share/hyphen fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HYPH_SYSTEM_DIR" >&5 -$as_echo "$HYPH_SYSTEM_DIR" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thesaurus directory" >&5 -$as_echo_n "checking for thesaurus directory... " >&6; } + echo "$as_me:$LINENO: result: $HYPH_SYSTEM_DIR" >&5 +echo "${ECHO_T}$HYPH_SYSTEM_DIR" >&6 + echo "$as_me:$LINENO: checking for thesaurus directory" >&5 +echo $ECHO_N "checking for thesaurus directory... $ECHO_C" >&6 if test -n "$with_external_thes_dir"; then THES_SYSTEM_DIR=file://$with_external_thes_dir else THES_SYSTEM_DIR=file:///usr/share/mythes fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $THES_SYSTEM_DIR" >&5 -$as_echo "$THES_SYSTEM_DIR" >&6; } + echo "$as_me:$LINENO: result: $THES_SYSTEM_DIR" >&5 +echo "${ECHO_T}$THES_SYSTEM_DIR" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 SYSTEM_DICTS=NO fi fi @@ -5594,16 +3721,22 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which shell to use" >&5 -$as_echo_n "checking which shell to use... " >&6; } +echo "$as_me:$LINENO: checking which shell to use" >&5 +echo $ECHO_N "checking which shell to use... $ECHO_C" >&6 if test $_os = "WINNT"; then if test "$with_use_shell" != "tcsh" -a "$with_use_shell" != "bash"; then - as_fn_error "only \"tcsh\" or \"bash\" are supported options" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: only \"tcsh\" or \"bash\" are supported options" >&5 +echo "$as_me: error: only \"tcsh\" or \"bash\" are supported options" >&2;} + { (exit 1); exit 1; }; } fi if test -L $AWK -o -L `which awk` -o -L `which tar` -o -L `which gunzip` ; then - as_fn_error "$AWK, awk, tar or gunzip is a cygwin symlink! + { { echo "$as_me:$LINENO: error: $AWK, awk, tar or gunzip is a cygwin symlink! Native windows programs cannot use cygwin symlinks. Remove the symbolic -link, and copy the program to the name of the link." "$LINENO" 5 +link, and copy the program to the name of the link." >&5 +echo "$as_me: error: $AWK, awk, tar or gunzip is a cygwin symlink! +Native windows programs cannot use cygwin symlinks. Remove the symbolic +link, and copy the program to the name of the link." >&2;} + { (exit 1); exit 1; }; } fi CC=`echo $CC | $SED "s/^guw.exe //"` CXX=`echo $CXX | $SED "s/^guw.exe //"` @@ -5623,27 +3756,33 @@ link, and copy the program to the name of the link." "$LINENO" 5 fi elif test $_os = "OS2"; then if test "$with_use_shell" != "tcsh"; then - as_fn_error "only \"tcsh\" is supported options" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: only \"tcsh\" is supported options" >&5 +echo "$as_me: error: only \"tcsh\" is supported options" >&2;} + { (exit 1); exit 1; }; } fi else if test "$with_use_shell" != "tcsh" -a "$with_use_shell" != "bash"; then - as_fn_error "only \"tcsh\" or \"bash\" are supported options" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: only \"tcsh\" or \"bash\" are supported options" >&5 +echo "$as_me: error: only \"tcsh\" or \"bash\" are supported options" >&2;} + { (exit 1); exit 1; }; } fi fi USE_SHELL="$with_use_shell" -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_SHELL" >&5 -$as_echo "$USE_SHELL" >&6; } +echo "$as_me:$LINENO: result: $USE_SHELL" >&5 +echo "${ECHO_T}$USE_SHELL" >&6 if test "$_os" = "WINNT" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cygwin gcc/g++" >&5 -$as_echo_n "checking for cygwin gcc/g++... " >&6; } + echo "$as_me:$LINENO: checking for cygwin gcc/g++" >&5 +echo $ECHO_N "checking for cygwin gcc/g++... $ECHO_C" >&6 if which gcc > /dev/null && which g++ > /dev/null ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 -$as_echo "found" >&6; } + echo "$as_me:$LINENO: result: found" >&5 +echo "${ECHO_T}found" >&6 else - as_fn_error "cygwin gcc and g++ are needed, please install them." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cygwin gcc and g++ are needed, please install them." >&5 +echo "$as_me: error: cygwin gcc and g++ are needed, please install them." >&2;} + { (exit 1); exit 1; }; } fi fi @@ -5651,10 +3790,10 @@ fi if test "$with_use_shell" = "tcsh"; then # Extract the first word of "tcsh", so it can be a program name with args. set dummy tcsh; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_SHELLPATH+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_SHELLPATH+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $SHELLPATH in [\\/]* | ?:[\\/]*) @@ -5666,41 +3805,42 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_SHELLPATH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done ;; esac fi SHELLPATH=$ac_cv_path_SHELLPATH + if test -n "$SHELLPATH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SHELLPATH" >&5 -$as_echo "$SHELLPATH" >&6; } + echo "$as_me:$LINENO: result: $SHELLPATH" >&5 +echo "${ECHO_T}$SHELLPATH" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test -z "$SHELLPATH"; then - as_fn_error "tcsh not found in \$PATH" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: tcsh not found in \$PATH" >&5 +echo "$as_me: error: tcsh not found in \$PATH" >&2;} + { (exit 1); exit 1; }; } else SHELLPATH=`echo $SHELLPATH | $SED -n "s/\/tcsh$//p"` fi elif test "$with_use_shell" = "bash"; then # Extract the first word of "bash", so it can be a program name with args. set dummy bash; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_SHELLPATH+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_SHELLPATH+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $SHELLPATH in [\\/]* | ?:[\\/]*) @@ -5712,50 +3852,51 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_SHELLPATH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done ;; esac fi SHELLPATH=$ac_cv_path_SHELLPATH + if test -n "$SHELLPATH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SHELLPATH" >&5 -$as_echo "$SHELLPATH" >&6; } + echo "$as_me:$LINENO: result: $SHELLPATH" >&5 +echo "${ECHO_T}$SHELLPATH" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test -z "$SHELLPATH"; then - as_fn_error "bash not found in \$PATH" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: bash not found in \$PATH" >&5 +echo "$as_me: error: bash not found in \$PATH" >&2;} + { (exit 1); exit 1; }; } else SHELLPATH=`echo $SHELLPATH | $SED -n "s/\/bash$//p"` fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Windows/OS/2 4NT builds don't test for the shell" >&5 -$as_echo "$as_me: WARNING: Windows/OS/2 4NT builds don't test for the shell" >&2;} + { echo "$as_me:$LINENO: WARNING: Windows/OS/2 4NT builds don't test for the shell" >&5 +echo "$as_me: WARNING: Windows/OS/2 4NT builds don't test for the shell" >&2;} SHELLPATH="NO_SHELLPATH_NEEDED" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking gcc home" >&5 -$as_echo_n "checking gcc home... " >&6; } +echo "$as_me:$LINENO: checking gcc home" >&5 +echo $ECHO_N "checking gcc home... $ECHO_C" >&6 if test -z "$with_gcc_home"; then GCC_HOME=`which gcc | $SED -e s,/bin/gcc,,` else GCC_HOME="$with_gcc_home" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $GCC_HOME" >&5 -$as_echo "$GCC_HOME" >&6; } +echo "$as_me:$LINENO: result: $GCC_HOME" >&5 +echo "${ECHO_T}$GCC_HOME" >&6 if test -n "$with_gcc_home"; then @@ -5773,10 +3914,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -5786,37 +3927,35 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -5826,50 +3965,39 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi + CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -5879,37 +4007,77 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -5920,19 +4088,18 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. @@ -5950,25 +4117,24 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe + for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -5978,41 +4144,39 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC - for ac_prog in cl.exe + for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -6022,78 +4186,66 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - test -n "$ac_ct_CC" && break done - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi + CC=$ac_ct_CC fi fi -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "no acceptable C compiler found in \$PATH -See \`config.log' for more details." "$LINENO" 5; } +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -6105,109 +4257,112 @@ main () } _ACEOF ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { { ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' +echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. + +# Be careful to initialize this variable, since it used to be cached. +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +ac_cv_exeext= +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext break;; * ) break;; esac done -test "$ac_cv_exeext" = no && ac_cv_exeext= - else - ac_file='' -fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "C compiler cannot create executables -See \`config.log' for more details." "$LINENO" 5; }; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } + ac_exeext=$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } -if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with @@ -6215,90 +4370,38 @@ $as_echo "$ac_try_echo"; } >&5 for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext break;; * ) break;; esac done else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." "$LINENO" 5; } + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } fi -rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -FILE *f = fopen ("conftest.out", "w"); - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -ac_clean_files="$ac_clean_files conftest.out" -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -if test "$cross_compiling" != yes; then - { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if { ac_try='./conftest$ac_cv_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." "$LINENO" 5; } - fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if test "${ac_cv_objext+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -6310,46 +4413,45 @@ main () } _ACEOF rm -f conftest.o conftest.obj -if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot compute suffix of object files: cannot compile -See \`config.log' for more details." "$LINENO" 5; } +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } fi + rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -6363,49 +4465,55 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_compiler_gnu=yes else - ac_compiler_gnu=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -6416,34 +4524,39 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_prog_cc_g=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -6459,14 +4572,18 @@ else CFLAGS= fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_prog_cc_c89=no + ac_cv_prog_cc_stdc=no ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include @@ -6494,17 +4611,12 @@ static char *f (char * (*g) (char **, int), char **p, ...) /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get + as 'x'. The following induces an error, until -std1 is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ + that's true only with -std1. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; @@ -6514,42 +4626,210 @@ char **argv; int main () { -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); ; return 0; } _ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done -rm -f conftest.$ac_ext -CC=$ac_save_CC - +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : -fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -6564,10 +4844,10 @@ if test "$COMPATH" = "." ; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_COMPATH+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_COMPATH+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $COMPATH in [\\/]* | ?:[\\/]*) @@ -6579,29 +4859,28 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_COMPATH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done ;; esac fi COMPATH=$ac_cv_path_COMPATH + if test -n "$COMPATH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $COMPATH" >&5 -$as_echo "$COMPATH" >&6; } + echo "$as_me:$LINENO: result: $COMPATH" >&5 +echo "${ECHO_T}$COMPATH" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - test -n "$COMPATH" && break done @@ -6611,44 +4890,54 @@ COMPATH=`echo $COMPATH | $SED "s@/[Bb][Ii][Nn]\\\$@@"`; echo $COMPATH GCCVER=20995 if test \( "$_os" != "WINNT" -o "$WITH_MINGWIN" = "yes" \) -a "$GCC" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking the GNU gcc compiler version" >&5 -$as_echo_n "checking the GNU gcc compiler version... " >&6; } + echo "$as_me:$LINENO: checking the GNU gcc compiler version" >&5 +echo $ECHO_N "checking the GNU gcc compiler version... $ECHO_C" >&6 _gcc_version=`$CC -dumpversion` _gcc_major=`echo $_gcc_version | $AWK -F. '{ print \$1 }'` _gcc_longver=`echo $_gcc_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'` GCCVER=`echo $_gcc_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'` if test "$_gcc_major" -lt "3"; then - as_fn_error "found version \"$_gcc_version\", use version 3+ of the gcc compiler" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: found version \"$_gcc_version\", use version 3+ of the gcc compiler" >&5 +echo "$as_me: error: found version \"$_gcc_version\", use version 3+ of the gcc compiler" >&2;} + { (exit 1); exit 1; }; } else if test "$GCCVER" -eq "030203"; then if test "$ENABLE_SYMBOLS" = "SMALL"; then - as_fn_error "version \"$_gcc_version\" gives internal error with small." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: version \"$_gcc_version\" gives internal error with small." >&5 +echo "$as_me: error: version \"$_gcc_version\" gives internal error with small." >&2;} + { (exit 1); exit 1; }; } fi fi fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked (gcc $_gcc_version)" >&5 -$as_echo "checked (gcc $_gcc_version)" >&6; } + echo "$as_me:$LINENO: result: checked (gcc $_gcc_version)" >&5 +echo "${ECHO_T}checked (gcc $_gcc_version)" >&6 if test "$_os" = "SunOS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking gcc linker" >&5 -$as_echo_n "checking gcc linker... " >&6; } + echo "$as_me:$LINENO: checking gcc linker" >&5 +echo $ECHO_N "checking gcc linker... $ECHO_C" >&6 if $CC -Wl,--version 2>&1 |head -n 1| grep -v GNU > /dev/null;then - as_fn_error "failed (not GNU ld). Use GNU ld instead of Sun ld on Solaris" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: failed (not GNU ld). Use GNU ld instead of Sun ld on Solaris" >&5 +echo "$as_me: error: failed (not GNU ld). Use GNU ld instead of Sun ld on Solaris" >&2;} + { (exit 1); exit 1; }; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok (GNU ld)" >&5 -$as_echo "ok (GNU ld)" >&6; } + echo "$as_me:$LINENO: result: ok (GNU ld)" >&5 +echo "${ECHO_T}ok (GNU ld)" >&6 fi fi HAVE_LD_BSYMBOLIC_FUNCTIONS= if test "$GCC" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Bsymbolic-functions linker support " >&5 -$as_echo_n "checking for -Bsymbolic-functions linker support ... " >&6; } + echo "$as_me:$LINENO: checking for -Bsymbolic-functions linker support " >&5 +echo $ECHO_N "checking for -Bsymbolic-functions linker support ... $ECHO_C" >&6 bsymbolic_functions_ldflags_save=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions -Wl,--dynamic-list-cpp-new -Wl,--dynamic-list-cpp-typeinfo" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include @@ -6663,60 +4952,85 @@ main () return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then HAVE_LD_BSYMBOLIC_FUNCTIONS=TRUE +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext if test "z$HAVE_LD_BSYMBOLIC_FUNCTIONS" = "zTRUE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found " >&5 -$as_echo "found " >&6; } + echo "$as_me:$LINENO: result: found " >&5 +echo "${ECHO_T}found " >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found " >&5 -$as_echo "not found " >&6; } + echo "$as_me:$LINENO: result: not found " >&5 +echo "${ECHO_T}not found " >&6 fi LDFLAGS=$bsymbolic_functions_ldflags_save fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable pch feature" >&5 -$as_echo_n "checking whether to enable pch feature... " >&6; } +echo "$as_me:$LINENO: checking whether to enable pch feature" >&5 +echo $ECHO_N "checking whether to enable pch feature... $ECHO_C" >&6 if test -n "$enable_pch" && test "$enable_pch" != "no"; then if test "$_os" = "WINNT" -a "$WITH_MINGWIN" != "yes"; then ENABLE_PCH="TRUE" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 elif test "$GCC" = "yes" -a "$GCCVER" -gt "030400"; then ENABLE_PCH="TRUE" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else ENABLE_PCH="" - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Precompiled header not yet supported for your platform/compiler" >&5 -$as_echo "$as_me: WARNING: Precompiled header not yet supported for your platform/compiler" >&2;} + { echo "$as_me:$LINENO: WARNING: Precompiled header not yet supported for your platform/compiler" >&5 +echo "$as_me: WARNING: Precompiled header not yet supported for your platform/compiler" >&2;} fi else ENABLE_PCH="" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable hid list feature" >&5 -$as_echo_n "checking whether to enable hid list feature... " >&6; } +echo "$as_me:$LINENO: checking whether to enable hid list feature" >&5 +echo $ECHO_N "checking whether to enable hid list feature... $ECHO_C" >&6 if test -n "$enable_hids" && test "$enable_hids" != "no"; then NO_HIDS="" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else NO_HIDS="TRUE" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU make" >&5 -$as_echo_n "checking for GNU make... " >&6; } +echo "$as_me:$LINENO: checking for GNU make" >&5 +echo $ECHO_N "checking for GNU make... $ECHO_C" >&6 for a in "$MAKE" $GNUMAKE make gmake gnumake; do $a --version 2> /dev/null | grep GNU 2>&1 > /dev/null if test $? -eq 0; then @@ -6724,36 +5038,40 @@ for a in "$MAKE" $GNUMAKE make gmake gnumake; do break fi done -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $GNUMAKE" >&5 -$as_echo "$GNUMAKE" >&6; } +echo "$as_me:$LINENO: result: $GNUMAKE" >&5 +echo "${ECHO_T}$GNUMAKE" >&6 if test -z "$GNUMAKE"; then - as_fn_error "not found. install GNU make." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: not found. install GNU make." >&5 +echo "$as_me: error: not found. install GNU make." >&2;} + { (exit 1); exit 1; }; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the GNU make version" >&5 -$as_echo_n "checking the GNU make version... " >&6; } +echo "$as_me:$LINENO: checking the GNU make version" >&5 +echo $ECHO_N "checking the GNU make version... $ECHO_C" >&6 _make_version=`$GNUMAKE --version | grep GNU | $SED -e 's@^[^0-9]*@@' -e 's@ .*@@' -e 's@,.*@@'`; _make_longver=`echo $_make_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'` if test "$_make_longver" -ge "037901" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GNUMAKE $_make_version" >&5 -$as_echo "$GNUMAKE $_make_version" >&6; } + echo "$as_me:$LINENO: result: $GNUMAKE $_make_version" >&5 +echo "${ECHO_T}$GNUMAKE $_make_version" >&6 else if test "$_os" = "Darwin"; then if test "$_make_longver" -ge "037900" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GNUMAKE $_make_version" >&5 -$as_echo "$GNUMAKE $_make_version" >&6; } + echo "$as_me:$LINENO: result: $GNUMAKE $_make_version" >&5 +echo "${ECHO_T}$GNUMAKE $_make_version" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: failed ($GNUMAKE $_make_version need 3.79.0+)" >&5 -$as_echo "$as_me: WARNING: failed ($GNUMAKE $_make_version need 3.79.0+)" >&2;} + { echo "$as_me:$LINENO: WARNING: failed ($GNUMAKE $_make_version need 3.79.0+)" >&5 +echo "$as_me: WARNING: failed ($GNUMAKE $_make_version need 3.79.0+)" >&2;} fi else - as_fn_error "failed ($GNUMAKE $_make_version need 3.79.1+)" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: failed ($GNUMAKE $_make_version need 3.79.1+)" >&5 +echo "$as_me: error: failed ($GNUMAKE $_make_version need 3.79.1+)" >&2;} + { (exit 1); exit 1; }; } fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU tar" >&5 -$as_echo_n "checking for GNU tar... " >&6; } +echo "$as_me:$LINENO: checking for GNU tar" >&5 +echo $ECHO_N "checking for GNU tar... $ECHO_C" >&6 for a in $GNUTAR gtar gnutar tar; do $a --version 2> /dev/null | grep GNU 2>&1 > /dev/null if test $? -eq 0; then @@ -6761,10 +5079,12 @@ for a in $GNUTAR gtar gnutar tar; do break fi done -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $GNUTAR" >&5 -$as_echo "$GNUTAR" >&6; } +echo "$as_me:$LINENO: result: $GNUTAR" >&5 +echo "${ECHO_T}$GNUTAR" >&6 if test -z "$GNUTAR"; then - as_fn_error "not found. install GNU tar." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: not found. install GNU tar." >&5 +echo "$as_me: error: not found. install GNU tar." >&2;} + { (exit 1); exit 1; }; } fi @@ -6775,10 +5095,10 @@ if test "$_os" = "SunOS"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path__cc+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path__cc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $_cc in [\\/]* | ?:[\\/]*) @@ -6790,58 +5110,65 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path__cc="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done ;; esac fi _cc=$ac_cv_path__cc + if test -n "$_cc"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_cc" >&5 -$as_echo "$_cc" >&6; } + echo "$as_me:$LINENO: result: $_cc" >&5 +echo "${ECHO_T}$_cc" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - test -n "$_cc" && break done COMPATH=`echo $_cc | $SED -n "s/\/bin\/cc//p"` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking the SunStudio C/C++ compiler version" >&5 -$as_echo_n "checking the SunStudio C/C++ compiler version... " >&6; } + echo "$as_me:$LINENO: checking the SunStudio C/C++ compiler version" >&5 +echo $ECHO_N "checking the SunStudio C/C++ compiler version... $ECHO_C" >&6 _sunstudio_string=`$CC -V 2>&1 | grep '^cc' | sed -e 's/.* C //'` _sunstudio_version=`echo $_sunstudio_string | $AWK '{ print $1 }'` _sunstudio_major=`echo $_sunstudio_version | $AWK -F. '{ print $1 }'` if test "$_sunstudio_major" != "5"; then - as_fn_error "found version \"$_sunstudio_version\", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: found version \"$_sunstudio_version\", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler" >&5 +echo "$as_me: error: found version \"$_sunstudio_version\", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler" >&2;} + { (exit 1); exit 1; }; } else _sunstudio_minor=`echo $_sunstudio_version | $AWK -F. '{ if ($2 == 5) print "true"; else if ($2 == 7) print "true"; else if ($2 == 8) print "true"; else if ($2 == 9) print "true"; else print "false" }'` if test "$_sunstudio_minor" = "false"; then - as_fn_error "found version \"$_sunstudio_version\", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: found version \"$_sunstudio_version\", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler" >&5 +echo "$as_me: error: found version \"$_sunstudio_version\", use version 5.5, 5.7, 5.8 or 5.9 of the SunStudio C/C++ compiler" >&2;} + { (exit 1); exit 1; }; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked" >&5 -$as_echo "checked" >&6; } + echo "$as_me:$LINENO: result: checked" >&5 +echo "${ECHO_T}checked" >&6 fi fi fi fi if test "$GCC" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --hash-style=both linker support " >&5 -$as_echo_n "checking for --hash-style=both linker support ... " >&6; } + echo "$as_me:$LINENO: checking for --hash-style=both linker support " >&5 +echo $ECHO_N "checking for --hash-style=both linker support ... $ECHO_C" >&6 hash_style_ldflags_save=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,--hash-style=both" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include @@ -6856,19 +5183,43 @@ main () return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then HAVE_LD_HASH_STYLE=TRUE else - HAVE_LD_HASH_STYLE=FALSE + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +HAVE_LD_HASH_STYLE=FALSE fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext if test "z$HAVE_LD_HASH_STYLE" = "zTRUE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found " >&5 -$as_echo "found " >&6; } + echo "$as_me:$LINENO: result: found " >&5 +echo "${ECHO_T}found " >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found " >&5 -$as_echo "not found " >&6; } + echo "$as_me:$LINENO: result: not found " >&5 +echo "${ECHO_T}not found " >&6 fi LDFLAGS=$hash_style_ldflags_save fi @@ -6880,10 +5231,10 @@ if test "$_os" = "OSF1"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path__cc+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path__cc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $_cc in [\\/]* | ?:[\\/]*) @@ -6895,44 +5246,45 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path__cc="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done ;; esac fi _cc=$ac_cv_path__cc + if test -n "$_cc"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_cc" >&5 -$as_echo "$_cc" >&6; } + echo "$as_me:$LINENO: result: $_cc" >&5 +echo "${ECHO_T}$_cc" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - test -n "$_cc" && break done COMPATH=`echo $_cc | $SED -n "s/\/bin\/cc//p"` - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ******* $_cc , $COMPATH" >&5 -$as_echo "$as_me: WARNING: ******* $_cc , $COMPATH" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: checking the Compaq C compiler version" >&5 -$as_echo_n "checking the Compaq C compiler version... " >&6; } + { echo "$as_me:$LINENO: WARNING: ******* $_cc , $COMPATH" >&5 +echo "$as_me: WARNING: ******* $_cc , $COMPATH" >&2;} + echo "$as_me:$LINENO: checking the Compaq C compiler version" >&5 +echo $ECHO_N "checking the Compaq C compiler version... $ECHO_C" >&6 _compaqc_version=`$CC -V 2>&1 | $AWK '{ print $3 }'` _compaqc_major=`echo $_compaqc_version | $AWK -F. '{ print $1 }'` if test "$_compaqc_major" != "T6"; then - as_fn_error "found version \"$_compaqc_version\", use version 6 of the Compaq C compiler" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: found version \"$_compaqc_version\", use version 6 of the Compaq C compiler" >&5 +echo "$as_me: error: found version \"$_compaqc_version\", use version 6 of the Compaq C compiler" >&2;} + { (exit 1); exit 1; }; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked" >&5 -$as_echo "checked" >&6; } + echo "$as_me:$LINENO: result: checked" >&5 +echo "${ECHO_T}checked" >&6 fi fi fi @@ -6940,10 +5292,10 @@ fi if test -z "$with_perl_home"; then # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PERL+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PERL+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PERL in [\\/]* | ?:[\\/]*) @@ -6955,29 +5307,28 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done ;; esac fi PERL=$ac_cv_path_PERL + if test -n "$PERL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 -$as_echo "$PERL" >&6; } + echo "$as_me:$LINENO: result: $PERL" >&5 +echo "${ECHO_T}$PERL" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - else if test "$_os" = "WINNT"; then with_perl_home=`cygpath -u "$with_perl_home"` @@ -6986,38 +5337,46 @@ else if test -x "$_perl_path"; then PERL=$_perl_path else - as_fn_error "$_perl_path not found" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: $_perl_path not found" >&5 +echo "$as_me: error: $_perl_path not found" >&2;} + { (exit 1); exit 1; }; } fi fi if test "$PERL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking the Perl version" >&5 -$as_echo_n "checking the Perl version... " >&6; } + echo "$as_me:$LINENO: checking the Perl version" >&5 +echo $ECHO_N "checking the Perl version... $ECHO_C" >&6 ${PERL} -e "exit($]);" _perl_version=$? if test "$_perl_version" -lt 5; then - as_fn_error "found Perl version \"$_perl_version\", use version 5 of Perl" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: found Perl version \"$_perl_version\", use version 5 of Perl" >&5 +echo "$as_me: error: found Perl version \"$_perl_version\", use version 5 of Perl" >&2;} + { (exit 1); exit 1; }; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked (perl $_perl_version)" >&5 -$as_echo "checked (perl $_perl_version)" >&6; } + echo "$as_me:$LINENO: result: checked (perl $_perl_version)" >&5 +echo "${ECHO_T}checked (perl $_perl_version)" >&6 else - as_fn_error "Perl not found, install version 5 of Perl" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Perl not found, install version 5 of Perl" >&5 +echo "$as_me: error: Perl not found, install version 5 of Perl" >&2;} + { (exit 1); exit 1; }; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for required Perl modules" >&5 -$as_echo_n "checking for required Perl modules... " >&6; } +echo "$as_me:$LINENO: checking for required Perl modules" >&5 +echo $ECHO_N "checking for required Perl modules... $ECHO_C" >&6 if `$PERL -e 'use Archive::Zip;'`; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: all modules found" >&5 -$as_echo "all modules found" >&6; } + echo "$as_me:$LINENO: result: all modules found" >&5 +echo "${ECHO_T}all modules found" >&6 else - as_fn_error "Failed to find some modules" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Failed to find some modules" >&5 +echo "$as_me: error: Failed to find some modules" >&2;} + { (exit 1); exit 1; }; } fi if test "$_os" = "WINNT"; then if test "$WITH_MINGWIN" != "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for friendly registry keys" >&5 -$as_echo_n "checking for friendly registry keys... " >&6; } + echo "$as_me:$LINENO: checking for friendly registry keys" >&5 +echo $ECHO_N "checking for friendly registry keys... $ECHO_C" >&6 # VS.Net 2003, VS.Net 2005 if test -z "$with_cl_home"; then vctest=`./oowintool --msvc-productdir`; @@ -7027,8 +5386,8 @@ $as_echo_n "checking for friendly registry keys... " >&6; } else with_cl_home=`cygpath -u "$with_cl_home"` fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 -$as_echo "done" >&6; } + echo "$as_me:$LINENO: result: done" >&5 +echo "${ECHO_T}done" >&6 if test -n "$with_mspdb_path";then with_mspdb_path=`cygpath -u "$with_mspdb_path"` @@ -7049,10 +5408,10 @@ $as_echo "done" >&6; } if test -z "$MSPDB_PATH";then # Extract the first word of "mspdb80.dll", so it can be a program name with args. set dummy mspdb80.dll; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_MSPDB_PATH+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_MSPDB_PATH+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MSPDB_PATH in [\\/]* | ?:[\\/]*) @@ -7064,35 +5423,34 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MSPDB_PATH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done ;; esac fi MSPDB_PATH=$ac_cv_path_MSPDB_PATH + if test -n "$MSPDB_PATH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSPDB_PATH" >&5 -$as_echo "$MSPDB_PATH" >&6; } + echo "$as_me:$LINENO: result: $MSPDB_PATH" >&5 +echo "${ECHO_T}$MSPDB_PATH" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - # Extract the first word of "mspdb71.dll", so it can be a program name with args. set dummy mspdb71.dll; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_MSPDB_PATH+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_MSPDB_PATH+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MSPDB_PATH in [\\/]* | ?:[\\/]*) @@ -7104,50 +5462,51 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MSPDB_PATH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done ;; esac fi MSPDB_PATH=$ac_cv_path_MSPDB_PATH + if test -n "$MSPDB_PATH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MSPDB_PATH" >&5 -$as_echo "$MSPDB_PATH" >&6; } + echo "$as_me:$LINENO: result: $MSPDB_PATH" >&5 +echo "${ECHO_T}$MSPDB_PATH" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - MSPDB_PATH=`dirname "$MSPDB_PATH"` fi if test -z "$MSPDB_PATH"; then - as_fn_error "You need a mspdb71.dll/mspdb80.dll, make sure it's in the path or use --with-mspdb-path" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: You need a mspdb71.dll/mspdb80.dll, make sure it's in the path or use --with-mspdb-path" >&5 +echo "$as_me: error: You need a mspdb71.dll/mspdb80.dll, make sure it's in the path or use --with-mspdb-path" >&2;} + { (exit 1); exit 1; }; } fi MSPDB_PATH=`cygpath -d "$MSPDB_PATH"` MSPDB_PATH=`cygpath -u "$MSPDB_PATH"` PATH="$MSPDB_PATH:$PATH" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking the Microsoft C/C++ Compiler" >&5 -$as_echo_n "checking the Microsoft C/C++ Compiler... " >&6; } + echo "$as_me:$LINENO: checking the Microsoft C/C++ Compiler" >&5 +echo $ECHO_N "checking the Microsoft C/C++ Compiler... $ECHO_C" >&6 if test -x "$with_cl_home/bin/cl.exe"; then CC="$with_cl_home/bin/cl.exe" else # Extract the first word of "cl.exe", so it can be a program name with args. set dummy cl.exe; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $CC in [\\/]* | ?:[\\/]*) @@ -7159,41 +5518,40 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_CC="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done ;; esac fi CC=$ac_cv_path_CC + if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test -e "$CC"; then # This gives us a posix path with 8.3 filename restrictions CC=`cygpath -d "$CC"` CC=`cygpath -u "$CC"` # Remove /cl.exe from CC case insensitive - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found ($CC)" >&5 -$as_echo "found ($CC)" >&6; } + echo "$as_me:$LINENO: result: found ($CC)" >&5 +echo "${ECHO_T}found ($CC)" >&6 COMPATH=`echo $CC | $SED 's@\/[Bb][Ii][Nn]\/[cC][lL]\.[eE][xX][eE]@@'` export INCLUDE=`cygpath -d "$COMPATH/Include"` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking the Version of Microsoft C/C++ Compiler" >&5 -$as_echo_n "checking the Version of Microsoft C/C++ Compiler... " >&6; } + echo "$as_me:$LINENO: checking the Version of Microsoft C/C++ Compiler" >&5 +echo $ECHO_N "checking the Version of Microsoft C/C++ Compiler... $ECHO_C" >&6 CCNUMVER=`$CC 2>&1 | $AWK "/Microsoft/ && /..\\...\\...../ { x = match( \\\$0, /..\\...\\...../ ) CCversion = substr( \\\$0, RSTART, RLENGTH) @@ -7202,42 +5560,48 @@ $as_echo_n "checking the Version of Microsoft C/C++ Compiler... " >&6; } printf (\"%04d\",vertoken[i] ) } }"` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found Compiler version $CCNUMVER." >&5 -$as_echo "found Compiler version $CCNUMVER." >&6; } + echo "$as_me:$LINENO: result: found Compiler version $CCNUMVER." >&5 +echo "${ECHO_T}found Compiler version $CCNUMVER." >&6 if test "$CCNUMVER" -ge "001500000000"; then COMEX=12 MSVSVER=2008 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found .NET 2008 / VS 9.0." >&5 -$as_echo "found .NET 2008 / VS 9.0." >&6; } + echo "$as_me:$LINENO: result: found .NET 2008 / VS 9.0." >&5 +echo "${ECHO_T}found .NET 2008 / VS 9.0." >&6 elif test "$CCNUMVER" -ge "001400000000"; then COMEX=11 MSVSVER=2005 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found .NET 2005." >&5 -$as_echo "found .NET 2005." >&6; } + echo "$as_me:$LINENO: result: found .NET 2005." >&5 +echo "${ECHO_T}found .NET 2005." >&6 elif test "$CCNUMVER" -ge "001300102240"; then COMEX=10 MSVSVER=2003 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found .NET 2003." >&5 -$as_echo "found .NET 2003." >&6; } + echo "$as_me:$LINENO: result: found .NET 2003." >&5 +echo "${ECHO_T}found .NET 2003." >&6 else - as_fn_error "Compiler too old. Use Microsoft C/C++ .NET 2003/2005 compiler." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Compiler too old. Use Microsoft C/C++ .NET 2003/2005 compiler." >&5 +echo "$as_me: error: Compiler too old. Use Microsoft C/C++ .NET 2003/2005 compiler." >&2;} + { (exit 1); exit 1; }; } fi else - as_fn_error "Microsoft C/C++ Compiler not found. Use --with-cl-home or set path to cl.exe." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Microsoft C/C++ Compiler not found. Use --with-cl-home or set path to cl.exe." >&5 +echo "$as_me: error: Microsoft C/C++ Compiler not found. Use --with-cl-home or set path to cl.exe." >&2;} + { (exit 1); exit 1; }; } fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking the Mingwin32 C++ Compiler" >&5 -$as_echo_n "checking the Mingwin32 C++ Compiler... " >&6; } + echo "$as_me:$LINENO: checking the Mingwin32 C++ Compiler" >&5 +echo $ECHO_N "checking the Mingwin32 C++ Compiler... $ECHO_C" >&6 if test `$CC -dumpmachine | $SED -e 's/^.*-//'` = "mingw32"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found." >&5 -$as_echo "found." >&6; } + echo "$as_me:$LINENO: result: found." >&5 +echo "${ECHO_T}found." >&6 if $CC -dumpspecs | grep -q "mno-cygwin"; then USE_MINGW="cygwin" else USE_MINGW="pure-mingw" fi else - as_fn_error "Mingwin32 C++ Compiler not found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Mingwin32 C++ Compiler not found." >&5 +echo "$as_me: error: Mingwin32 C++ Compiler not found." >&2;} + { (exit 1); exit 1; }; } fi fi fi @@ -7249,10 +5613,10 @@ if test "$_os" = "WINNT"; then if test "$WITH_MINGWIN" = "yes" || test "$COMEX" -ge "10"; then # Extract the first word of "midl.exe", so it can be a program name with args. set dummy midl.exe; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_MIDL_PATH+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_MIDL_PATH+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MIDL_PATH in [\\/]* | ?:[\\/]*) @@ -7264,29 +5628,28 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MIDL_PATH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done ;; esac fi MIDL_PATH=$ac_cv_path_MIDL_PATH + if test -n "$MIDL_PATH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MIDL_PATH" >&5 -$as_echo "$MIDL_PATH" >&6; } + echo "$as_me:$LINENO: result: $MIDL_PATH" >&5 +echo "${ECHO_T}$MIDL_PATH" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test -n "$MIDL_PATH";then MIDL_PATH=`dirname "$MIDL_PATH"` fi @@ -7312,7 +5675,9 @@ fi fi fi if test ! -x "$MIDL_PATH/midl.exe"; then - as_fn_error "midl.exe not found. Make sure it's in the path or use --with-midl-path" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: midl.exe not found. Make sure it's in the path or use --with-midl-path" >&5 +echo "$as_me: error: midl.exe not found. Make sure it's in the path or use --with-midl-path" >&2;} + { (exit 1); exit 1; }; } fi # Convert to posix path with 8.3 filename restrictions ( No spaces ) MIDL_PATH=`cygpath -d "$MIDL_PATH"` @@ -7320,10 +5685,10 @@ fi # Extract the first word of "csc.exe", so it can be a program name with args. set dummy csc.exe; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_CSC_PATH+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_CSC_PATH+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $CSC_PATH in [\\/]* | ?:[\\/]*) @@ -7335,29 +5700,28 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_CSC_PATH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done ;; esac fi CSC_PATH=$ac_cv_path_CSC_PATH + if test -n "$CSC_PATH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CSC_PATH" >&5 -$as_echo "$CSC_PATH" >&6; } + echo "$as_me:$LINENO: result: $CSC_PATH" >&5 +echo "${ECHO_T}$CSC_PATH" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test -n "$CSC_PATH";then CSC_PATH=`dirname "$CSC_PATH"` fi @@ -7373,14 +5737,16 @@ fi fi fi if test ! -x "$CSC_PATH/csc.exe"; then - as_fn_error "csc.exe not found. Make sure it's in the path or use --with-csc-path" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: csc.exe not found. Make sure it's in the path or use --with-csc-path" >&5 +echo "$as_me: error: csc.exe not found. Make sure it's in the path or use --with-csc-path" >&2;} + { (exit 1); exit 1; }; } fi # Convert to posix path with 8.3 filename restrictions ( No spaces ) CSC_PATH=`cygpath -d "$CSC_PATH"` CSC_PATH=`cygpath -u "$CSC_PATH"` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking .NET Framework" >&5 -$as_echo_n "checking .NET Framework... " >&6; } + echo "$as_me:$LINENO: checking .NET Framework" >&5 +echo $ECHO_N "checking .NET Framework... $ECHO_C" >&6 if test -n "$with_frame_home"; then with_frame_home=`cygpath -u "$with_frame_home"` fi @@ -7402,10 +5768,12 @@ $as_echo_n "checking .NET Framework... " >&6; } fi fi if test ! -f "$FRAME_HOME/lib/mscoree.lib"; then - as_fn_error "mscoree.lib (.NET Framework) not found. Make sure you use --with-frame-home" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: mscoree.lib (.NET Framework) not found. Make sure you use --with-frame-home" >&5 +echo "$as_me: error: mscoree.lib (.NET Framework) not found. Make sure you use --with-frame-home" >&2;} + { (exit 1); exit 1; }; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 -$as_echo "found" >&6; } + echo "$as_me:$LINENO: result: found" >&5 +echo "${ECHO_T}found" >&6 # Convert to posix path with 8.3 filename restrictions ( No spaces ) FRAME_HOME=`cygpath -d "$FRAME_HOME"` FRAME_HOME=`cygpath -u "$FRAME_HOME"` @@ -7421,15 +5789,15 @@ ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } +echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then : - $as_echo_n "(cached) " >&6 + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" @@ -7443,7 +5811,11 @@ do # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include @@ -7452,24 +5824,68 @@ do #endif Syntax error _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether nonexistent headers + # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Passes both tests. ac_preproc_ok=: break @@ -7479,7 +5895,7 @@ rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : +if $ac_preproc_ok; then break fi @@ -7491,8 +5907,8 @@ fi else ac_cv_prog_CPP=$CPP fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } +echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -7502,7 +5918,11 @@ do # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include @@ -7511,24 +5931,68 @@ do #endif Syntax error _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether nonexistent headers + # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Passes both tests. ac_preproc_ok=: break @@ -7538,13 +6002,14 @@ rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - +if $ac_preproc_ok; then + : else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." "$LINENO" 5; } + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } fi ac_ext=c @@ -7554,12 +6019,16 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if test "${ac_cv_header_stdc+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include @@ -7574,23 +6043,51 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_header_stdc=yes else - ac_cv_header_stdc=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - + $EGREP "memchr" >/dev/null 2>&1; then + : else ac_cv_header_stdc=no fi @@ -7600,14 +6097,18 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - + $EGREP "free" >/dev/null 2>&1; then + : else ac_cv_header_stdc=no fi @@ -7617,13 +6118,16 @@ fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : + if test "$cross_compiling" = yes; then : else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include -#include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) @@ -7643,50 +6147,61 @@ main () for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) - return 2; - return 0; + exit(2); + exit (0); } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : else - ac_cv_header_stdc=no + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then -$as_echo "#define STDC_HEADERS 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF fi fi if test "$_os" != "WINNT" -o "$WITH_MINGWIN" = "yes"; then - ac_ext=cpp + ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test -z "$CXX"; then - if test -n "$CCC"; then - CXX=$CCC - else - if test -n "$ac_tool_prefix"; then - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +if test -n "$ac_tool_prefix"; then + for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CXX+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. @@ -7696,41 +6211,39 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -$as_echo "$CXX" >&6; } + echo "$as_me:$LINENO: result: $CXX" >&5 +echo "${ECHO_T}$CXX" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. @@ -7740,77 +6253,64 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 -$as_echo "$ac_ct_CXX" >&6; } + echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 +echo "${ECHO_T}$ac_ct_CXX" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - test -n "$ac_ct_CXX" && break done +test -n "$ac_ct_CXX" || ac_ct_CXX="g++" - if test "x$ac_ct_CXX" = x; then - CXX="g++" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CXX=$ac_ct_CXX - fi + CXX=$ac_ct_CXX fi - fi -fi + # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err +echo "$as_me:$LINENO:" \ + "checking for C++ compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 -$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } -if test "${ac_cv_cxx_compiler_gnu+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 +if test "${ac_cv_cxx_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -7824,34 +6324,55 @@ main () return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_compiler_gnu=yes else - ac_compiler_gnu=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 -$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GXX=yes -else - GXX= -fi +echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 +GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 -$as_echo_n "checking whether $CXX accepts -g... " >&6; } -if test "${ac_cv_prog_cxx_g+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_save_cxx_werror_flag=$ac_cxx_werror_flag - ac_cxx_werror_flag=yes - ac_cv_prog_cxx_g=no - CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +CXXFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 +echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cxx_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -7862,80 +6383,176 @@ main () return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_prog_cxx_g=yes else - CXXFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_prog_cxx_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include int main () { - +exit (42); ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : else - ac_cxx_werror_flag=$ac_save_cxx_werror_flag - CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration int main () { - +exit (42); ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_prog_cxx_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cxx_werror_flag=$ac_save_cxx_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 -$as_echo "$ac_cv_prog_cxx_g" >&6; } -if test "$ac_test_CXXFLAGS" = set; then - CXXFLAGS=$ac_save_CXXFLAGS -elif test $ac_cv_prog_cxx_g = yes; then - if test "$GXX" = yes; then - CXXFLAGS="-g -O2" - else - CXXFLAGS="-g" - fi +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break else - if test "$GXX" = yes; then - CXXFLAGS="-O2" - else - CXXFLAGS= - fi + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h fi + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -ac_ext=cpp +ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 -$as_echo_n "checking how to run the C++ preprocessor... " >&6; } +echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 +echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6 if test -z "$CXXCPP"; then - if test "${ac_cv_prog_CXXCPP+set}" = set; then : - $as_echo_n "(cached) " >&6 + if test "${ac_cv_prog_CXXCPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" @@ -7949,7 +6566,11 @@ do # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include @@ -7958,24 +6579,68 @@ do #endif Syntax error _ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether nonexistent headers + # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Passes both tests. ac_preproc_ok=: break @@ -7985,7 +6650,7 @@ rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : +if $ac_preproc_ok; then break fi @@ -7997,8 +6662,8 @@ fi else ac_cv_prog_CXXCPP=$CXXCPP fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 -$as_echo "$CXXCPP" >&6; } +echo "$as_me:$LINENO: result: $CXXCPP" >&5 +echo "${ECHO_T}$CXXCPP" >&6 ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do @@ -8008,7 +6673,11 @@ do # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include @@ -8017,24 +6686,68 @@ do #endif Syntax error _ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether nonexistent headers + # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Passes both tests. ac_preproc_ok=: break @@ -8044,13 +6757,14 @@ rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - +if $ac_preproc_ok; then + : else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "C++ preprocessor \"$CXXCPP\" fails sanity check -See \`config.log' for more details." "$LINENO" 5; } + { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } fi ac_ext=c @@ -8068,15 +6782,15 @@ ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } +echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then : - $as_echo_n "(cached) " >&6 + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" @@ -8090,7 +6804,11 @@ do # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include @@ -8099,24 +6817,68 @@ do #endif Syntax error _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether nonexistent headers + # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Passes both tests. ac_preproc_ok=: break @@ -8126,7 +6888,7 @@ rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : +if $ac_preproc_ok; then break fi @@ -8138,8 +6900,8 @@ fi else ac_cv_prog_CPP=$CPP fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } +echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -8149,7 +6911,11 @@ do # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include @@ -8158,24 +6924,68 @@ do #endif Syntax error _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether nonexistent headers + # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + # Passes both tests. ac_preproc_ok=: break @@ -8185,13 +6995,14 @@ rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - +if $ac_preproc_ok; then + : else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." "$LINENO" 5; } + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } fi ac_ext=c @@ -8204,16 +7015,70 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -8221,35 +7086,415 @@ fi done -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 -$as_echo_n "checking size of long... " >&6; } -if test "${ac_cv_sizeof_long+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for long" >&5 +echo $ECHO_N "checking for long... $ECHO_C" >&6 +if test "${ac_cv_type_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((long *) 0) + return 0; +if (sizeof (long)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_long=yes else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_long=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 +echo "${ECHO_T}$ac_cv_type_long" >&6 +echo "$as_me:$LINENO: checking size of long" >&5 +echo $ECHO_N "checking size of long... $ECHO_C" >&6 +if test "${ac_cv_sizeof_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$ac_cv_type_long" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (long) -See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof_long=0 - fi + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=0 ac_mid=0 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=-1 ac_mid=-1 + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_lo=$ac_mid; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_lo= ac_hi= +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_hi=$ac_mid +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_lo=`expr '(' $ac_mid ')' + 1` fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 -$as_echo "$ac_cv_sizeof_long" >&6; } +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in +?*) ac_cv_sizeof_long=$ac_lo;; +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (long), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } ;; +esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +long longval () { return (long) (sizeof (long)); } +unsigned long ulongval () { return (long) (sizeof (long)); } +#include +#include +int +main () +{ + FILE *f = fopen ("conftest.val", "w"); + if (! f) + exit (1); + if (((long) (sizeof (long))) < 0) + { + long i = longval (); + if (i != ((long) (sizeof (long)))) + exit (1); + fprintf (f, "%ld\n", i); + } + else + { + unsigned long i = ulongval (); + if (i != ((long) (sizeof (long)))) + exit (1); + fprintf (f, "%lu\n", i); + } + exit (ferror (f) || fclose (f) != 0); + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_sizeof_long=`cat conftest.val` +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute sizeof (long), 77 +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.val +else + ac_cv_sizeof_long=0 +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 +echo "${ECHO_T}$ac_cv_sizeof_long" >&6 cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF @@ -8257,252 +7502,262 @@ _ACEOF SIZEOF_LONG=$ac_cv_sizeof_long - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 -$as_echo_n "checking whether byte ordering is bigendian... " >&6; } -if test "${ac_cv_c_bigendian+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 +echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 +if test "${ac_cv_c_bigendian+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_c_bigendian=unknown - # See if we're dealing with a universal compiler. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __APPLE_CC__ - not a universal capable compiler - #endif - typedef int dummy; - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - - # Check for potential -arch flags. It is not universal unless - # there are at least two -arch flags with different values. - ac_arch= - ac_prev= - for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do - if test -n "$ac_prev"; then - case $ac_word in - i?86 | x86_64 | ppc | ppc64) - if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then - ac_arch=$ac_word - else - ac_cv_c_bigendian=universal - break - fi - ;; - esac - ac_prev= - elif test "x$ac_word" = "x-arch"; then - ac_prev=arch - fi - done -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test $ac_cv_c_bigendian = unknown; then - # See if sys/param.h defines the BYTE_ORDER macro. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + # See if sys/param.h defines the BYTE_ORDER macro. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include - #include +#include int main () { -#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ - && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ - && LITTLE_ENDIAN) - bogus endian macros - #endif +#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN + bogus endian macros +#endif ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then # It does; now see whether it defined to BIG_ENDIAN or not. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include - #include +#include int main () { #if BYTE_ORDER != BIG_ENDIAN - not big endian - #endif + not big endian +#endif ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_c_bigendian=yes else - ac_cv_c_bigendian=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test $ac_cv_c_bigendian = unknown; then - # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -int -main () -{ -#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) - bogus endian macros - #endif +ac_cv_c_bigendian=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - ; - return 0; -} +# It does not; compile a test program. +if test "$cross_compiling" = yes; then + # try to guess the endianness by grepping values into an object file + ac_cv_c_bigendian=unknown + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - # It does; now see whether it defined to _BIG_ENDIAN or not. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include - +short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; +short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; +void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } +short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; +short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; +void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } int main () { -#ifndef _BIG_ENDIAN - not big endian - #endif - + _ascii (); _ebcdic (); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then ac_cv_c_bigendian=yes -else - ac_cv_c_bigendian=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test $ac_cv_c_bigendian = unknown; then - # Compile a test program. - if test "$cross_compiling" = yes; then : - # Try to guess by grepping values from an object file. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -short int ascii_mm[] = - { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; - short int ascii_ii[] = - { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; - int use_ascii (int i) { - return ascii_mm[i] + ascii_ii[i]; - } - short int ebcdic_ii[] = - { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; - short int ebcdic_mm[] = - { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; - int use_ebcdic (int i) { - return ebcdic_mm[i] + ebcdic_ii[i]; - } - extern int foo; +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -int -main () -{ -return use_ascii (foo) == use_ebcdic (foo); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then - ac_cv_c_bigendian=yes - fi - if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi - fi fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default int main () { - - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long int l; - char c[sizeof (long int)]; - } u; - u.l = 1; - return u.c[sizeof (long int) - 1] == 1; - - ; - return 0; + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long l; + char c[sizeof (long)]; + } u; + u.l = 1; + exit (u.c[sizeof (long) - 1] == 1); } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_c_bigendian=no else - ac_cv_c_bigendian=yes + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_c_bigendian=yes fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - - fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 -$as_echo "$ac_cv_c_bigendian" >&6; } - case $ac_cv_c_bigendian in #( - yes) - $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h -;; #( - no) - ;; #( - universal) - -$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 +echo "${ECHO_T}$ac_cv_c_bigendian" >&6 +case $ac_cv_c_bigendian in + yes) - ;; #( - *) - as_fn_error "unknown endianness - presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; - esac +cat >>confdefs.h <<\_ACEOF +#define WORDS_BIGENDIAN 1 +_ACEOF + ;; + no) + ;; + *) + { { echo "$as_me:$LINENO: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&5 +echo "$as_me: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} + { (exit 1); exit 1; }; } ;; +esac WORDS_BIGENDIAN=$ac_cv_c_bigendian -# Check whether --enable-largefile was given. -if test "${enable_largefile+set}" = set; then : - enableval=$enable_largefile; -fi +# Check whether --enable-largefile or --disable-largefile was given. +if test "${enable_largefile+set}" = set; then + enableval="$enable_largefile" +fi; if test "$enable_largefile" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 -$as_echo_n "checking for special C compiler options needed for large files... " >&6; } -if test "${ac_cv_sys_largefile_CC+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 +echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6 +if test "${ac_cv_sys_largefile_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then ac_save_CC=$CC while :; do - # IRIX 6.2 and later do not support large files by default, - # so use the C compiler's -n32 option if that helps. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. @@ -8521,34 +7776,89 @@ main () return 0; } _ACEOF - if ac_fn_c_try_compile "$LINENO"; then : + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f core conftest.err conftest.$ac_objext - CC="$CC -n32" - if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.err conftest.$ac_objext + CC="$CC -n32" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_sys_largefile_CC=' -n32'; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f core conftest.err conftest.$ac_objext +rm -f conftest.err conftest.$ac_objext break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 -$as_echo "$ac_cv_sys_largefile_CC" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 +echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6 if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 -$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } -if test "${ac_cv_sys_file_offset_bits+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6 +if test "${ac_cv_sys_file_offset_bits+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_cv_sys_file_offset_bits=no + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. @@ -8567,11 +7877,40 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_sys_file_offset_bits=no; break +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _FILE_OFFSET_BITS 64 #include @@ -8591,33 +7930,60 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_sys_file_offset_bits=64; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cv_sys_file_offset_bits=unknown +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext break done fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 -$as_echo "$ac_cv_sys_file_offset_bits" >&6; } -case $ac_cv_sys_file_offset_bits in #( - no | unknown) ;; - *) +echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 +echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6 +if test "$ac_cv_sys_file_offset_bits" != no; then + cat >>confdefs.h <<_ACEOF #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits _ACEOF -;; -esac -rm -rf conftest* - if test $ac_cv_sys_file_offset_bits = unknown; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 -$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } -if test "${ac_cv_sys_large_files+set}" = set; then : - $as_echo_n "(cached) " >&6 + +fi +rm -f conftest* + echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 +echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6 +if test "${ac_cv_sys_large_files+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_cv_sys_large_files=no + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. @@ -8636,11 +8002,40 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_sys_large_files=no; break +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _LARGE_FILES 1 #include @@ -8660,26 +8055,48 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_sys_large_files=1; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cv_sys_large_files=unknown +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext break done fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 -$as_echo "$ac_cv_sys_large_files" >&6; } -case $ac_cv_sys_large_files in #( - no | unknown) ;; - *) +echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 +echo "${ECHO_T}$ac_cv_sys_large_files" >&6 +if test "$ac_cv_sys_large_files" != no; then + cat >>confdefs.h <<_ACEOF #define _LARGE_FILES $ac_cv_sys_large_files _ACEOF -;; -esac -rm -rf conftest* - fi + +fi +rm -f conftest* fi if test -n "$ac_cv_sys_file_offset_bits"; then @@ -8690,42 +8107,44 @@ if test -n "$ac_cv_sys_large_files" && test "$ac_cv_sys_large_files" != "no"; th fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to disable vba feature" >&5 -$as_echo_n "checking whether to disable vba feature... " >&6; } +echo "$as_me:$LINENO: checking whether to disable vba feature" >&5 +echo $ECHO_N "checking whether to disable vba feature... $ECHO_C" >&6 if test -n "$enable_vba" && test "$enable_vba" = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 ENABLE_VBA=NO else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 ENABLE_VBA=YES fi if test "$ENABLE_VBA" = "YES"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to package the vba compatibility api" >&5 -$as_echo_n "checking how to package the vba compatibility api... " >&6; } + echo "$as_me:$LINENO: checking how to package the vba compatibility api" >&5 +echo $ECHO_N "checking how to package the vba compatibility api... $ECHO_C" >&6 if test -n "$with_vba_package_format"; then if test "$with_vba_package_format" = "extn"; then VBA_EXTENSION=YES - { $as_echo "$as_me:${as_lineno-$LINENO}: result: uno extension" >&5 -$as_echo "uno extension" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: --with-vba-package-format=extn can cause problems" >&5 -$as_echo "$as_me: WARNING: --with-vba-package-format=extn can cause problems" >&2;} + echo "$as_me:$LINENO: result: uno extension" >&5 +echo "${ECHO_T}uno extension" >&6 + { echo "$as_me:$LINENO: WARNING: --with-vba-package-format=extn can cause problems" >&5 +echo "$as_me: WARNING: --with-vba-package-format=extn can cause problems" >&2;} else if test "$with_vba_package_format" = "builtin"; then VBA_EXTENSION=NO - { $as_echo "$as_me:${as_lineno-$LINENO}: result: build into installset" >&5 -$as_echo "build into installset" >&6; } + echo "$as_me:$LINENO: result: build into installset" >&5 +echo "${ECHO_T}build into installset" >&6 else - as_fn_error "unknown packaging method" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: unknown packaging method" >&5 +echo "$as_me: error: unknown packaging method" >&2;} + { (exit 1); exit 1; }; } fi fi else VBA_EXTENSION=NO - { $as_echo "$as_me:${as_lineno-$LINENO}: result: defaulting to build into installset" >&5 -$as_echo "defaulting to build into installset" >&6; } + echo "$as_me:$LINENO: result: defaulting to build into installset" >&5 +echo "${ECHO_T}defaulting to build into installset" >&6 fi else VBA_EXTENSION=NO @@ -8735,74 +8154,379 @@ fi if test "$test_cups" = "yes" -a "$ENABLE_CUPS" = "TRUE" ; then - ac_fn_c_check_header_mongrel "$LINENO" "cups/cups.h" "ac_cv_header_cups_cups_h" "$ac_includes_default" -if test "x$ac_cv_header_cups_cups_h" = x""yes; then : + if test "${ac_cv_header_cups_cups_h+set}" = set; then + echo "$as_me:$LINENO: checking for cups/cups.h" >&5 +echo $ECHO_N "checking for cups/cups.h... $ECHO_C" >&6 +if test "${ac_cv_header_cups_cups_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_cups_cups_h" >&5 +echo "${ECHO_T}$ac_cv_header_cups_cups_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking cups/cups.h usability" >&5 +echo $ECHO_N "checking cups/cups.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking cups/cups.h presence" >&5 +echo $ECHO_N "checking cups/cups.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: cups/cups.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: cups/cups.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: cups/cups.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: cups/cups.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: cups/cups.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: cups/cups.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: cups/cups.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: cups/cups.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: cups/cups.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: cups/cups.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: cups/cups.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: cups/cups.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: cups/cups.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: cups/cups.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: cups/cups.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: cups/cups.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for cups/cups.h" >&5 +echo $ECHO_N "checking for cups/cups.h... $ECHO_C" >&6 +if test "${ac_cv_header_cups_cups_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_cups_cups_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_cups_cups_h" >&5 +echo "${ECHO_T}$ac_cv_header_cups_cups_h" >&6 +fi +if test $ac_cv_header_cups_cups_h = yes; then + : else - as_fn_error "cups/cups.h could not be found. libcupsys2-dev or cups???-devel missing?" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cups/cups.h could not be found. libcupsys2-dev or cups???-devel missing?" >&5 +echo "$as_me: error: cups/cups.h could not be found. libcupsys2-dev or cups???-devel missing?" >&2;} + { (exit 1); exit 1; }; } fi fi if test "$_os" = "Linux" -o "$_os" = "FreeBSD" -o "$_os" = "GNU"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable pam support" >&5 -$as_echo_n "checking whether to enable pam support... " >&6; } + echo "$as_me:$LINENO: checking whether to enable pam support" >&5 +echo $ECHO_N "checking whether to enable pam support... $ECHO_C" >&6 if test -z "$enable_pam" || test "$enable_pam" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 PAM=YES - ac_fn_c_check_header_mongrel "$LINENO" "security/pam_appl.h" "ac_cv_header_security_pam_appl_h" "$ac_includes_default" -if test "x$ac_cv_header_security_pam_appl_h" = x""yes; then : + if test "${ac_cv_header_security_pam_appl_h+set}" = set; then + echo "$as_me:$LINENO: checking for security/pam_appl.h" >&5 +echo $ECHO_N "checking for security/pam_appl.h... $ECHO_C" >&6 +if test "${ac_cv_header_security_pam_appl_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_security_pam_appl_h" >&5 +echo "${ECHO_T}$ac_cv_header_security_pam_appl_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking security/pam_appl.h usability" >&5 +echo $ECHO_N "checking security/pam_appl.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking security/pam_appl.h presence" >&5 +echo $ECHO_N "checking security/pam_appl.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: security/pam_appl.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: security/pam_appl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: security/pam_appl.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: security/pam_appl.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: security/pam_appl.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: security/pam_appl.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: security/pam_appl.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: security/pam_appl.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: security/pam_appl.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: security/pam_appl.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: security/pam_appl.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: security/pam_appl.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: security/pam_appl.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: security/pam_appl.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: security/pam_appl.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: security/pam_appl.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for security/pam_appl.h" >&5 +echo $ECHO_N "checking for security/pam_appl.h... $ECHO_C" >&6 +if test "${ac_cv_header_security_pam_appl_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - as_fn_error "pam_appl.h could not be found. libpam-dev or pam-devel missing?" "$LINENO" 5 + ac_cv_header_security_pam_appl_h=$ac_header_preproc fi +echo "$as_me:$LINENO: result: $ac_cv_header_security_pam_appl_h" >&5 +echo "${ECHO_T}$ac_cv_header_security_pam_appl_h" >&6 +fi +if test $ac_cv_header_security_pam_appl_h = yes; then + : +else + { { echo "$as_me:$LINENO: error: pam_appl.h could not be found. libpam-dev or pam-devel missing?" >&5 +echo "$as_me: error: pam_appl.h could not be found. libpam-dev or pam-devel missing?" >&2;} + { (exit 1); exit 1; }; } +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to link to libpam" >&5 -$as_echo_n "checking whether to link to libpam... " >&6; } + + echo "$as_me:$LINENO: checking whether to link to libpam" >&5 +echo $ECHO_N "checking whether to link to libpam... $ECHO_C" >&6 if test -n "$enable_pam_link" -a "$enable_pam_link" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 PAM_LINK=YES - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pam_start in -lpam" >&5 -$as_echo_n "checking for pam_start in -lpam... " >&6; } -if test "${ac_cv_lib_pam_pam_start+set}" = set; then : - $as_echo_n "(cached) " >&6 + +echo "$as_me:$LINENO: checking for pam_start in -lpam" >&5 +echo $ECHO_N "checking for pam_start in -lpam... $ECHO_C" >&6 +if test "${ac_cv_lib_pam_pam_start+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpam $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char pam_start (); int main () { -return pam_start (); +pam_start (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_pam_pam_start=yes else - ac_cv_lib_pam_pam_start=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_pam_pam_start=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pam_pam_start" >&5 -$as_echo "$ac_cv_lib_pam_pam_start" >&6; } -if test "x$ac_cv_lib_pam_pam_start" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_pam_pam_start" >&5 +echo "${ECHO_T}$ac_cv_lib_pam_pam_start" >&6 +if test $ac_cv_lib_pam_pam_start = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBPAM 1 _ACEOF @@ -8810,17 +8534,19 @@ _ACEOF LIBS="-lpam $LIBS" else - as_fn_error "libpam not found or functional" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: libpam not found or functional" >&5 +echo "$as_me: error: libpam not found or functional" >&2;} + { (exit 1); exit 1; }; } fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, dynamically open it" >&5 -$as_echo "no, dynamically open it" >&6; } + echo "$as_me:$LINENO: result: no, dynamically open it" >&5 +echo "${ECHO_T}no, dynamically open it" >&6 PAM_LINK=NO fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 PAM=NO PAM_LINK=NO @@ -8831,11 +8557,11 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how many arguments getspnam_r() takes" >&5 -$as_echo_n "checking how many arguments getspnam_r() takes... " >&6; } + echo "$as_me:$LINENO: checking how many arguments getspnam_r() takes" >&5 +echo $ECHO_N "checking how many arguments getspnam_r() takes... $ECHO_C" >&6 - if test "${ac_cv_func_which_getspnam_r+set}" = set; then : - $as_echo_n "(cached) " >&6 + if test "${ac_cv_func_which_getspnam_r+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -8852,7 +8578,11 @@ ac_cv_func_which_getspnam_r=unknown # netdb.h is not declaring the function, and the compiler is thereby # assuming an implicit prototype. In which case, we're out of luck. # -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include @@ -8869,10 +8599,35 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_func_which_getspnam_r=no +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # # FIVE ARGUMENTS @@ -8880,7 +8635,11 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "$ac_cv_func_which_getspnam_r" = "unknown"; then -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include @@ -8899,10 +8658,35 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_func_which_getspnam_r=five +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi @@ -8912,7 +8696,11 @@ fi if test "$ac_cv_func_which_getspnam_r" = "unknown"; then -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include @@ -8931,10 +8719,35 @@ main () return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_func_which_getspnam_r=four +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi @@ -8945,28 +8758,30 @@ fi case "$ac_cv_func_which_getspnam_r" in five) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: five" >&5 -$as_echo "five" >&6; } + echo "$as_me:$LINENO: result: five" >&5 +echo "${ECHO_T}five" >&6 NEW_SHADOW_API=YES ;; four) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: four" >&5 -$as_echo "four" >&6; } + echo "$as_me:$LINENO: result: four" >&5 +echo "${ECHO_T}four" >&6 ;; no) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot find function declaration in shadow.h" >&5 -$as_echo "cannot find function declaration in shadow.h" >&6; } + echo "$as_me:$LINENO: result: cannot find function declaration in shadow.h" >&5 +echo "${ECHO_T}cannot find function declaration in shadow.h" >&6 ;; unknown) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: can't tell" >&5 -$as_echo "can't tell" >&6; } + echo "$as_me:$LINENO: result: can't tell" >&5 +echo "${ECHO_T}can't tell" >&6 ;; *) - as_fn_error "internal error" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: internal error" >&5 +echo "$as_me: error: internal error" >&2;} + { (exit 1); exit 1; }; } ;; esac @@ -8985,49 +8800,78 @@ fi if test "$_os" = "Linux"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to link to libcrypt" >&5 -$as_echo_n "checking whether to link to libcrypt... " >&6; } + echo "$as_me:$LINENO: checking whether to link to libcrypt" >&5 +echo $ECHO_N "checking whether to link to libcrypt... $ECHO_C" >&6 if test -n "$enable_crypt_link" -a "$enable_crypt_link" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 CRYPT_LINK=YES - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for crypt in -lcrypt" >&5 -$as_echo_n "checking for crypt in -lcrypt... " >&6; } -if test "${ac_cv_lib_crypt_crypt+set}" = set; then : - $as_echo_n "(cached) " >&6 + +echo "$as_me:$LINENO: checking for crypt in -lcrypt" >&5 +echo $ECHO_N "checking for crypt in -lcrypt... $ECHO_C" >&6 +if test "${ac_cv_lib_crypt_crypt+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcrypt $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char crypt (); int main () { -return crypt (); +crypt (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_crypt_crypt=yes else - ac_cv_lib_crypt_crypt=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_crypt_crypt=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypt_crypt" >&5 -$as_echo "$ac_cv_lib_crypt_crypt" >&6; } -if test "x$ac_cv_lib_crypt_crypt" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_crypt_crypt" >&5 +echo "${ECHO_T}$ac_cv_lib_crypt_crypt" >&6 +if test $ac_cv_lib_crypt_crypt = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBCRYPT 1 _ACEOF @@ -9035,12 +8879,14 @@ _ACEOF LIBS="-lcrypt $LIBS" else - as_fn_error "libcrypt not found or functional" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: libcrypt not found or functional" >&5 +echo "$as_me: error: libcrypt not found or functional" >&2;} + { (exit 1); exit 1; }; } fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, dynamically open it" >&5 -$as_echo "no, dynamically open it" >&6; } + echo "$as_me:$LINENO: result: no, dynamically open it" >&5 +echo "${ECHO_T}no, dynamically open it" >&6 CRYPT_LINK=NO fi fi @@ -9059,24 +8905,20 @@ if test "$_os" = "WINNT" -a "$WITH_MINGWIN" != "yes"; then fi if test "$_os" != "WINNT" -o "$WITH_MINGWIN" = "yes"; then - ac_ext=cpp + ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu -if test -z "$CXX"; then - if test -n "$CCC"; then - CXX=$CCC - else - if test -n "$ac_tool_prefix"; then - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC +if test -n "$ac_tool_prefix"; then + for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CXX+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. @@ -9086,41 +8928,39 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 -$as_echo "$CXX" >&6; } + echo "$as_me:$LINENO: result: $CXX" >&5 +echo "${ECHO_T}$CXX" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX - for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC + for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. @@ -9130,77 +8970,64 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 -$as_echo "$ac_ct_CXX" >&6; } + echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 +echo "${ECHO_T}$ac_ct_CXX" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - test -n "$ac_ct_CXX" && break done +test -n "$ac_ct_CXX" || ac_ct_CXX="g++" - if test "x$ac_ct_CXX" = x; then - CXX="g++" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CXX=$ac_ct_CXX - fi + CXX=$ac_ct_CXX fi - fi -fi + # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err +echo "$as_me:$LINENO:" \ + "checking for C++ compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 -$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } -if test "${ac_cv_cxx_compiler_gnu+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 +if test "${ac_cv_cxx_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -9214,34 +9041,55 @@ main () return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_compiler_gnu=yes else - ac_compiler_gnu=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 -$as_echo "$ac_cv_cxx_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GXX=yes -else - GXX= -fi +echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 +GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 -$as_echo_n "checking whether $CXX accepts -g... " >&6; } -if test "${ac_cv_prog_cxx_g+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_save_cxx_werror_flag=$ac_cxx_werror_flag - ac_cxx_werror_flag=yes - ac_cv_prog_cxx_g=no - CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +CXXFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 +echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cxx_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -9252,64 +9100,160 @@ main () return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_prog_cxx_g=yes else - CXXFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_prog_cxx_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include int main () { - +exit (42); ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : else - ac_cxx_werror_flag=$ac_save_cxx_werror_flag - CXXFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration int main () { - +exit (42); ; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : - ac_cv_prog_cxx_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cxx_werror_flag=$ac_save_cxx_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 -$as_echo "$ac_cv_prog_cxx_g" >&6; } -if test "$ac_test_CXXFLAGS" = set; then - CXXFLAGS=$ac_save_CXXFLAGS -elif test $ac_cv_prog_cxx_g = yes; then - if test "$GXX" = yes; then - CXXFLAGS="-g -O2" - else - CXXFLAGS="-g" - fi +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break else - if test "$GXX" = yes; then - CXXFLAGS="-O2" - else - CXXFLAGS= - fi + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -9319,27 +9263,32 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi if test "$GXX" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking the GNU C++ compiler version" >&5 -$as_echo_n "checking the GNU C++ compiler version... " >&6; } + echo "$as_me:$LINENO: checking the GNU C++ compiler version" >&5 +echo $ECHO_N "checking the GNU C++ compiler version... $ECHO_C" >&6 _gpp_version=`$CXX -dumpversion` _gpp_major=`echo $_gpp_version | $AWK -F. '{ print \$1 }'` _gpp_minor=`echo $_gpp_version | $AWK -F. '{ print \$2 }'` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked (g++ $_gpp_version)" >&5 -$as_echo "checked (g++ $_gpp_version)" >&6; } + echo "$as_me:$LINENO: result: checked (g++ $_gpp_version)" >&5 +echo "${ECHO_T}checked (g++ $_gpp_version)" >&6 if test "$_gpp_major" = "3"; then if test "$_gpp_minor" = "4"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX has the enum bug" >&5 -$as_echo_n "checking whether $CXX has the enum bug... " >&6; } -if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot run test program while cross compiling -See \`config.log' for more details." "$LINENO" 5; } -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + echo "$as_me:$LINENO: checking whether $CXX has the enum bug" >&5 +echo $ECHO_N "checking whether $CXX has the enum bug... $ECHO_C" >&6 +if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ extern "C" void abort (void); @@ -9364,16 +9313,31 @@ main (void) } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - as_fn_error "your version of the GNU C++ compile has a bug which prevents OpenOffice.org from being compiled correctly - please check http://gcc.gnu.org/ml/gcc-patches/2004-07/msg00968.html for details." "$LINENO" 5 -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + { { echo "$as_me:$LINENO: error: your version of the GNU C++ compile has a bug which prevents OpenOffice.org from being compiled correctly - please check http://gcc.gnu.org/ml/gcc-patches/2004-07/msg00968.html for details." >&5 +echo "$as_me: error: your version of the GNU C++ compile has a bug which prevents OpenOffice.org from being compiled correctly - please check http://gcc.gnu.org/ml/gcc-patches/2004-07/msg00968.html for details." >&2;} + { (exit 1); exit 1; }; } +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - fi fi fi @@ -9381,8 +9345,8 @@ fi # Removed the special FreeBSD treatment. The problem was that with_gxx_include_path # often contains an i386 which is expanded as a macro. Solved in stlport. if test "$GXX" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for g++ include path" >&5 -$as_echo_n "checking for g++ include path... " >&6; } + echo "$as_me:$LINENO: checking for g++ include path" >&5 +echo $ECHO_N "checking for g++ include path... $ECHO_C" >&6 if test -z "$with_gxx_include_path"; then with_gxx_include_path=`echo "#include " | $CXX -E -xc++ - | $SED -n '/.*1*"\(.*\)\/cstring".*/s//\1/p' | head -n 1` if test "$with_gxx_include_path" = "/usr/libexec/(null)/include"; then @@ -9400,18 +9364,18 @@ $as_echo_n "checking for g++ include path... " >&6; } fi if test -z "$with_gxx_include_path"; then with_gxx_include_path="NO_GXX_INCLUDE" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no g++ includes" >&5 -$as_echo "no g++ includes" >&6; } + echo "$as_me:$LINENO: result: no g++ includes" >&5 +echo "${ECHO_T}no g++ includes" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_gxx_include_path" >&5 -$as_echo "$with_gxx_include_path" >&6; } + echo "$as_me:$LINENO: result: $with_gxx_include_path" >&5 +echo "${ECHO_T}$with_gxx_include_path" >&6 fi GXX_INCLUDE_PATH="$with_gxx_include_path" if test "$WITH_MINGWIN" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mingwin runtime include path" >&5 -$as_echo_n "checking for mingwin runtime include path... " >&6; } + echo "$as_me:$LINENO: checking for mingwin runtime include path" >&5 +echo $ECHO_N "checking for mingwin runtime include path... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #include #include @@ -9429,16 +9393,16 @@ _ACEOF fi if test -z "$_mingw_lib_include_path"; then _mingw_lib_include_path="NO_LIB_INCLUDE" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no mingwin runtime includes" >&5 -$as_echo "no mingwin runtime includes" >&6; } + echo "$as_me:$LINENO: result: no mingwin runtime includes" >&5 +echo "${ECHO_T}no mingwin runtime includes" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_mingw_lib_include_path" >&5 -$as_echo "$_mingw_lib_include_path" >&6; } + echo "$as_me:$LINENO: result: $_mingw_lib_include_path" >&5 +echo "${ECHO_T}$_mingw_lib_include_path" >&6 fi MINGW_LIB_INCLUDE_PATH="$_mingw_lib_include_path" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mingwin c++ backward include path" >&5 -$as_echo_n "checking for mingwin c++ backward include path... " >&6; } + echo "$as_me:$LINENO: checking for mingwin c++ backward include path" >&5 +echo $ECHO_N "checking for mingwin c++ backward include path... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF #include _ACEOF @@ -9447,57 +9411,57 @@ _ACEOF if test -n "$_mingw_backward_include_path"; then _mingw_backward_include_path=`cygpath -d $_mingw_backward_include_path` _mingw_backward_include_path=`cygpath -u $_mingw_backward_include_path` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_mingw_backward_include_path" >&5 -$as_echo "$_mingw_backward_include_path" >&6; } + echo "$as_me:$LINENO: result: $_mingw_backward_include_path" >&5 +echo "${ECHO_T}$_mingw_backward_include_path" >&6 else _mingw_backward_include_path="NO_BACKWARD_INCLUDE" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no mingwin c++ backward includes" >&5 -$as_echo "no mingwin c++ backward includes" >&6; } + echo "$as_me:$LINENO: result: no mingwin c++ backward includes" >&5 +echo "${ECHO_T}no mingwin c++ backward includes" >&6 fi MINGW_BACKWARD_INCLUDE_PATH="$_mingw_backward_include_path" mingw_crtbegin=`$CC -print-file-name=crtbegin.o` MINGW_CLIB_DIR=`dirname $mingw_crtbegin` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use dynamic libgcc" >&5 -$as_echo_n "checking whether to use dynamic libgcc... " >&6; } + echo "$as_me:$LINENO: checking whether to use dynamic libgcc" >&5 +echo $ECHO_N "checking whether to use dynamic libgcc... $ECHO_C" >&6 if test -e "$MINGW_CLIB_DIR/libgcc_s.a"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic libgcc name" >&5 -$as_echo_n "checking dynamic libgcc name... " >&6; } + echo "$as_me:$LINENO: checking dynamic libgcc name" >&5 +echo $ECHO_N "checking dynamic libgcc name... $ECHO_C" >&6 MINGW_GCCDLL_pattern=`nm $MINGW_CLIB_DIR/libgcc_s.a | sed -ne 's@.* _libgcc\(.*\)_dll_iname@libgcc\1.dll@p' | uniq | sed -e 's@_@?@g'` MINGW_GCCDLL=`cd $COMPATH/bin && ls $MINGW_GCCDLL_pattern 2>/dev/null` if test -n "$MINGW_GCCDLL"; then MINGW_SHARED_GCCLIB=YES - { $as_echo "$as_me:${as_lineno-$LINENO}: result: use $MINGW_GCCDLL" >&5 -$as_echo "use $MINGW_GCCDLL" >&6; } + echo "$as_me:$LINENO: result: use $MINGW_GCCDLL" >&5 +echo "${ECHO_T}use $MINGW_GCCDLL" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi if test -e "$MINGW_CLIB_DIR/libgcc_eh.a"; then MINGW_GCCLIB_EH=YES fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use dynamic libstdc++" >&5 -$as_echo_n "checking whether to use dynamic libstdc++... " >&6; } + echo "$as_me:$LINENO: checking whether to use dynamic libstdc++" >&5 +echo $ECHO_N "checking whether to use dynamic libstdc++... $ECHO_C" >&6 if test -e "$MINGW_CLIB_DIR/libstdc++_s.a" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic libstdc++ name" >&5 -$as_echo_n "checking dynamic libstdc++ name... " >&6; } + echo "$as_me:$LINENO: checking dynamic libstdc++ name" >&5 +echo $ECHO_N "checking dynamic libstdc++ name... $ECHO_C" >&6 MINGW_GXXDLL_pattern=`nm $MINGW_CLIB_DIR/libstdc++_s.a | sed -ne 's@.* _libstdc__\(.*\)_dll_iname@libstdc++\1.dll@p' | uniq | sed -e 's@_@?@g'` MINGW_GXXDLL=`cd $COMPATH/bin && ls $MINGW_GXXDLL_pattern 2>/dev/null` if test -n "$MINGW_GXXDLL"; then MINGW_SHARED_GXXLIB=YES - { $as_echo "$as_me:${as_lineno-$LINENO}: result: use $MINGW_GXXDLL" >&5 -$as_echo "use $MINGW_GXXDLL" >&6; } + echo "$as_me:$LINENO: result: use $MINGW_GXXDLL" >&5 +echo "${ECHO_T}use $MINGW_GXXDLL" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi MINGW_CLIB_DIR=`cygpath $MINGW_CLIB_DIR` @@ -9510,50 +9474,50 @@ fi if test "$_os" = "SunOS"; then if test "$CC" = "cc"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking SunStudio C++ Compiler" >&5 -$as_echo_n "checking SunStudio C++ Compiler... " >&6; } + echo "$as_me:$LINENO: checking SunStudio C++ Compiler" >&5 +echo $ECHO_N "checking SunStudio C++ Compiler... $ECHO_C" >&6 if test "$CXX" != "CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: SunStudio C++ was not found" >&5 -$as_echo "$as_me: WARNING: SunStudio C++ was not found" >&2;} + { echo "$as_me:$LINENO: WARNING: SunStudio C++ was not found" >&5 +echo "$as_me: WARNING: SunStudio C++ was not found" >&2;} echo "SunStudio C++ was not found" >> warn else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked" >&5 -$as_echo "checked" >&6; } + echo "$as_me:$LINENO: result: checked" >&5 +echo "${ECHO_T}checked" >&6 fi fi fi if test "$_os" = "Darwin"; then if test "$CC" = "cc"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Macosx c++ Compiler" >&5 -$as_echo_n "checking Macosx c++ Compiler... " >&6; } + echo "$as_me:$LINENO: checking Macosx c++ Compiler" >&5 +echo $ECHO_N "checking Macosx c++ Compiler... $ECHO_C" >&6 if test "$CXX" != "c++"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Macosx C++ was not found" >&5 -$as_echo "$as_me: WARNING: Macosx C++ was not found" >&2;} + { echo "$as_me:$LINENO: WARNING: Macosx C++ was not found" >&5 +echo "$as_me: WARNING: Macosx C++ was not found" >&2;} echo "Macosx C++ was not found" >> warn else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked" >&5 -$as_echo "checked" >&6; } + echo "$as_me:$LINENO: result: checked" >&5 +echo "${ECHO_T}checked" >&6 fi fi fi if test "$_os" = "OSF1"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Compaq C++ compiler version" >&5 -$as_echo_n "checking Compaq C++ compiler version... " >&6; } + echo "$as_me:$LINENO: checking Compaq C++ compiler version" >&5 +echo $ECHO_N "checking Compaq C++ compiler version... $ECHO_C" >&6 _compaqcxx_version=`$CXX -V 2>&1 | $AWK '{ print $3 }'` _compaqcxx_major=`echo $_compaqcxx_version | $AWK -F. '{ print $1 }'` if test "$_compaqcxx_major" != "V6"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: found version \"$_compaqc_version\", use version 6 of the Compaq C++ compiler" >&5 -$as_echo "$as_me: WARNING: found version \"$_compaqc_version\", use version 6 of the Compaq C++ compiler" >&2;} + { echo "$as_me:$LINENO: WARNING: found version \"$_compaqc_version\", use version 6 of the Compaq C++ compiler" >&5 +echo "$as_me: WARNING: found version \"$_compaqc_version\", use version 6 of the Compaq C++ compiler" >&2;} echo "found version $_compaqc_version, use version 6 of the Compaq C++ compiler" >> warn else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked" >&5 -$as_echo "checked" >&6; } + echo "$as_me:$LINENO: result: checked" >&5 +echo "${ECHO_T}checked" >&6 fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking exception type" >&5 -$as_echo_n "checking exception type... " >&6; } -ac_ext=cpp +echo "$as_me:$LINENO: checking exception type" >&5 +echo $ECHO_N "checking exception type... $ECHO_C" >&6 +ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -9561,7 +9525,11 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test "$WITH_MINGWIN" = "yes"; then -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include @@ -9576,18 +9544,42 @@ _Unwind_SjLj_RaiseException() return 0; } _ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then exceptions_type="sjlj" else - exceptions_type="dwarf2" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +exceptions_type="dwarf2" fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $exceptions_type" >&5 -$as_echo "$exceptions_type" >&6; } +echo "$as_me:$LINENO: result: $exceptions_type" >&5 +echo "${ECHO_T}$exceptions_type" >&6 ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -9600,8 +9592,8 @@ EXCEPTIONS="$exceptions_type" if test "$_os" = "SunOS"; then _temp=`showrev -p | $AWK -F" " '{ print $2 }'` if test "$_os_release" = "7"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for patch 106327-06 or greater" >&5 -$as_echo_n "checking for patch 106327-06 or greater... " >&6; } + echo "$as_me:$LINENO: checking for patch 106327-06 or greater" >&5 +echo $ECHO_N "checking for patch 106327-06 or greater... $ECHO_C" >&6 _patch=`echo $_temp | $AWK '/106327-06/ { print "found" }'` _patch="false" for i in $_temp @@ -9615,15 +9607,15 @@ $as_echo_n "checking for patch 106327-06 or greater... " >&6; } fi done if test "$_patch" = "found"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 -$as_echo "found" >&6; } + echo "$as_me:$LINENO: result: found" >&5 +echo "${ECHO_T}found" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: patch 106327-06 not found, please install compiler patch 106327-06 or greater" >&5 -$as_echo "$as_me: WARNING: patch 106327-06 not found, please install compiler patch 106327-06 or greater" >&2;} + { echo "$as_me:$LINENO: WARNING: patch 106327-06 not found, please install compiler patch 106327-06 or greater" >&5 +echo "$as_me: WARNING: patch 106327-06 not found, please install compiler patch 106327-06 or greater" >&2;} echo "patch 106327-06 not found, please install compiler patch 106327-06 or greater" >> warn fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for patch 106950-11 or greater" >&5 -$as_echo_n "checking for patch 106950-11 or greater... " >&6; } + echo "$as_me:$LINENO: checking for patch 106950-11 or greater" >&5 +echo $ECHO_N "checking for patch 106950-11 or greater... $ECHO_C" >&6 _patch=`echo $_temp | $AWK '/106950-11/ { print "found" }'` _patch="false" for i in $_temp @@ -9637,17 +9629,17 @@ $as_echo_n "checking for patch 106950-11 or greater... " >&6; } fi done if test "$_patch" = "found"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 -$as_echo "found" >&6; } + echo "$as_me:$LINENO: result: found" >&5 +echo "${ECHO_T}found" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: patch 106950-11 not found, please install linker patch 106950-11 or greater" >&5 -$as_echo "$as_me: WARNING: patch 106950-11 not found, please install linker patch 106950-11 or greater" >&2;} + { echo "$as_me:$LINENO: WARNING: patch 106950-11 not found, please install linker patch 106950-11 or greater" >&5 +echo "$as_me: WARNING: patch 106950-11 not found, please install linker patch 106950-11 or greater" >&2;} echo "patch 106950-11 not found, please install linker patch 106950-11 or greater" >> warn fi else if test "$_os_release" = "6"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for patch 105591-09 or greater" >&5 -$as_echo_n "checking for patch 105591-09 or greater... " >&6; } + echo "$as_me:$LINENO: checking for patch 105591-09 or greater" >&5 +echo $ECHO_N "checking for patch 105591-09 or greater... $ECHO_C" >&6 _patch=`echo $_temp | $AWK '/105591-09/ { print "found" }'` _patch="false" for i in $_temp @@ -9661,15 +9653,15 @@ $as_echo_n "checking for patch 105591-09 or greater... " >&6; } fi done if test "$_patch" = "found"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 -$as_echo "found" >&6; } + echo "$as_me:$LINENO: result: found" >&5 +echo "${ECHO_T}found" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: patch 105591-09 not found, please install compiler patch 105591-09 or greater" >&5 -$as_echo "$as_me: WARNING: patch 105591-09 not found, please install compiler patch 105591-09 or greater" >&2;} + { echo "$as_me:$LINENO: WARNING: patch 105591-09 not found, please install compiler patch 105591-09 or greater" >&5 +echo "$as_me: WARNING: patch 105591-09 not found, please install compiler patch 105591-09 or greater" >&2;} echo "patch 105591-09 not found, please install compiler patch 105591-09 or greater" >> warn fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for patch 107733-08 or greater" >&5 -$as_echo_n "checking for patch 107733-08 or greater... " >&6; } + echo "$as_me:$LINENO: checking for patch 107733-08 or greater" >&5 +echo $ECHO_N "checking for patch 107733-08 or greater... $ECHO_C" >&6 _patch=`echo $_temp | $AWK '/107733-08/ { print "found" }'` _patch="false" for i in $_temp @@ -9683,19 +9675,19 @@ $as_echo_n "checking for patch 107733-08 or greater... " >&6; } fi done if test "$_patch" = "found"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 -$as_echo "found" >&6; } + echo "$as_me:$LINENO: result: found" >&5 +echo "${ECHO_T}found" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: patch 107733-06 not found, please install linker patch 107733-08 or greater" >&5 -$as_echo "$as_me: WARNING: patch 107733-06 not found, please install linker patch 107733-08 or greater" >&2;} + { echo "$as_me:$LINENO: WARNING: patch 107733-06 not found, please install linker patch 107733-08 or greater" >&5 +echo "$as_me: WARNING: patch 107733-06 not found, please install linker patch 107733-08 or greater" >&2;} echo "patch 107733-06 not found, please install linker patch 107733-08 or greater" >> warn fi fi fi fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking what the default STL should be" >&5 -$as_echo_n "checking what the default STL should be... " >&6; } + echo "$as_me:$LINENO: checking what the default STL should be" >&5 +echo $ECHO_N "checking what the default STL should be... $ECHO_C" >&6 DEFAULT_TO_STLPORT="no" if test "$_os" = "Linux"; then case "$build_cpu" in @@ -9716,100 +9708,134 @@ $as_echo_n "checking what the default STL should be... " >&6; } DEFAULT_TO_STLPORT="yes" fi if test "$DEFAULT_TO_STLPORT" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: stlport" >&5 -$as_echo "stlport" >&6; } + echo "$as_me:$LINENO: result: stlport" >&5 +echo "${ECHO_T}stlport" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: system" >&5 -$as_echo "system" >&6; } + echo "$as_me:$LINENO: result: system" >&5 +echo "${ECHO_T}system" >&6 fi if test "$WITH_STLPORT" = "auto"; then WITH_STLPORT=$DEFAULT_TO_STLPORT fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for STL providing headers" >&5 -$as_echo_n "checking for STL providing headers... " >&6; } + echo "$as_me:$LINENO: checking for STL providing headers" >&5 +echo $ECHO_N "checking for STL providing headers... $ECHO_C" >&6 STLPORT4="" USE_SYSTEM_STL="" if test "$WITH_STLPORT" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using internal stlport." >&5 -$as_echo "using internal stlport." >&6; } + echo "$as_me:$LINENO: result: using internal stlport." >&5 +echo "${ECHO_T}using internal stlport." >&6 if test "$DEFAULT_TO_STLPORT" != "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using stlport. Warning, breaks your ABI compatability!" >&5 -$as_echo "$as_me: WARNING: using stlport. Warning, breaks your ABI compatability!" >&2;} + { echo "$as_me:$LINENO: WARNING: using stlport. Warning, breaks your ABI compatability!" >&5 +echo "$as_me: WARNING: using stlport. Warning, breaks your ABI compatability!" >&2;} echo "using stlport. Warning, breaks your ABI compatability!" >>warn fi elif test "$WITH_STLPORT" = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using system STL" >&5 -$as_echo "using system STL" >&6; } + echo "$as_me:$LINENO: result: using system STL" >&5 +echo "${ECHO_T}using system STL" >&6 USE_SYSTEM_STL="YES" if test "$DEFAULT_TO_STLPORT" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using system STL. Warning, breaks your ABI compatability!" >&5 -$as_echo "$as_me: WARNING: using system STL. Warning, breaks your ABI compatability!" >&2;} + { echo "$as_me:$LINENO: WARNING: using system STL. Warning, breaks your ABI compatability!" >&5 +echo "$as_me: WARNING: using system STL. Warning, breaks your ABI compatability!" >&2;} echo "using system STL. Warning, breaks your ABI compatability!" >>warn fi else STLPORT4=$WITH_STLPORT if test "$_os" != "WINNT" -o "$WITH_MINGWIN" = "yes"; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $STLPORT4/stlport/hash_map _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked." >&5 -$as_echo "checked." >&6; } +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + echo "$as_me:$LINENO: result: checked." >&5 +echo "${ECHO_T}checked." >&6 else - as_fn_error "STLport headers not found." "$LINENO" 5 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { { echo "$as_me:$LINENO: error: STLport headers not found." >&5 +echo "$as_me: error: STLport headers not found." >&2;} + { (exit 1); exit 1; }; } fi rm -f conftest.err conftest.$ac_ext else if test -f "$STLPORT4/stlport/hash_map"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked." >&5 -$as_echo "checked." >&6; } + echo "$as_me:$LINENO: result: checked." >&5 +echo "${ECHO_T}checked." >&6 else - as_fn_error "STLport headers not found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: STLport headers not found." >&5 +echo "$as_me: error: STLport headers not found." >&2;} + { (exit 1); exit 1; }; } fi fi if test "$_os" != "WINNT" -o "$WITH_MINGWIN" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for STLport libraries" >&5 -$as_echo_n "checking for STLport libraries... " >&6; } + echo "$as_me:$LINENO: checking for STLport libraries" >&5 +echo $ECHO_N "checking for STLport libraries... $ECHO_C" >&6 if test "$_os" = "SunOS"; then if test -f "$STLPORT4/lib/libstlport_sunpro.so"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked" >&5 -$as_echo "checked" >&6; } + echo "$as_me:$LINENO: result: checked" >&5 +echo "${ECHO_T}checked" >&6 elif test -f "$STLPORT4/lib/libstlport.so"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked" >&5 -$as_echo "checked" >&6; } + echo "$as_me:$LINENO: result: checked" >&5 +echo "${ECHO_T}checked" >&6 STLPORT_VER=500 else - as_fn_error "STLport libraries not found" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: STLport libraries not found" >&5 +echo "$as_me: error: STLport libraries not found" >&2;} + { (exit 1); exit 1; }; } fi elif test "$_os" = "Darwin"; then if test -f "$STLPORT4/lib/libstlport_gcc.dylib"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked" >&5 -$as_echo "checked" >&6; } + echo "$as_me:$LINENO: result: checked" >&5 +echo "${ECHO_T}checked" >&6 elif test -f "$STLPORT4/lib/libstlport.dylib"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked" >&5 -$as_echo "checked" >&6; } + echo "$as_me:$LINENO: result: checked" >&5 +echo "${ECHO_T}checked" >&6 STLPORT_VER=500 else - as_fn_error "STLport libraries not found" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: STLport libraries not found" >&5 +echo "$as_me: error: STLport libraries not found" >&2;} + { (exit 1); exit 1; }; } fi else if test -f "$STLPORT4/lib/libstlport_gcc.so"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked" >&5 -$as_echo "checked" >&6; } + echo "$as_me:$LINENO: result: checked" >&5 +echo "${ECHO_T}checked" >&6 elif test -f "$STLPORT4/lib/libstlport.so"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked" >&5 -$as_echo "checked" >&6; } + echo "$as_me:$LINENO: result: checked" >&5 +echo "${ECHO_T}checked" >&6 STLPORT_VER=500 else - as_fn_error "STLport libraries not found" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: STLport libraries not found" >&5 +echo "$as_me: error: STLport libraries not found" >&2;} + { (exit 1); exit 1; }; } fi fi fi if test "$DEFAULT_TO_STLPORT" != "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using stlport. Warning, breaks your ABI compatability!" >&5 -$as_echo "$as_me: WARNING: using stlport. Warning, breaks your ABI compatability!" >&2;} + { echo "$as_me:$LINENO: WARNING: using stlport. Warning, breaks your ABI compatability!" >&5 +echo "$as_me: WARNING: using stlport. Warning, breaks your ABI compatability!" >&2;} echo "using stlport. Warning, breaks your ABI compatability!" >>warn fi fi @@ -9825,11 +9851,15 @@ fi if test "$GCC" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports -fvisibility=hidden" >&5 -$as_echo_n "checking whether $CC supports -fvisibility=hidden... " >&6; } + echo "$as_me:$LINENO: checking whether $CC supports -fvisibility=hidden" >&5 +echo $ECHO_N "checking whether $CC supports -fvisibility=hidden... $ECHO_C" >&6 save_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -fvisibility=hidden" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -9840,47 +9870,72 @@ main () return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then HAVE_GCC_VISIBILITY_FEATURE=TRUE +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext CFLAGS=$save_CFLAGS if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi # =================================================================== # use --ccache-skip? # =================================================================== -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are allowed and able to use --ccache-skip" >&5 -$as_echo_n "checking whether we are allowed and able to use --ccache-skip... " >&6; } +echo "$as_me:$LINENO: checking whether we are allowed and able to use --ccache-skip" >&5 +echo $ECHO_N "checking whether we are allowed and able to use --ccache-skip... $ECHO_C" >&6 if test "$_os" != "Darwin" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: only used on Mac currently, skipping" >&5 -$as_echo "only used on Mac currently, skipping" >&6; } + echo "$as_me:$LINENO: result: only used on Mac currently, skipping" >&5 +echo "${ECHO_T}only used on Mac currently, skipping" >&6 elif test "$enable_ccache_skip" = "no" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - diabled explicitly" >&5 -$as_echo "no - diabled explicitly" >&6; } + echo "$as_me:$LINENO: result: no - diabled explicitly" >&5 +echo "${ECHO_T}no - diabled explicitly" >&6 elif test "$enable_ccache_skip" = "yes" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes - enabled explicitly, skipping checks" >&5 -$as_echo "yes - enabled explicitly, skipping checks" >&6; } + echo "$as_me:$LINENO: result: yes - enabled explicitly, skipping checks" >&5 +echo "${ECHO_T}yes - enabled explicitly, skipping checks" >&6 USE_CCACHE=YES elif test "$enable_ccache_skip" = "auto" ; then # checking for ccache presence/version - { $as_echo "$as_me:${as_lineno-$LINENO}: result: probing..." >&5 -$as_echo "probing..." >&6; } + echo "$as_me:$LINENO: result: probing..." >&5 +echo "${ECHO_T}probing..." >&6 # Extract the first word of "ccache", so it can be a program name with args. set dummy ccache; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_CCACHE+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_CCACHE+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $CCACHE in [\\/]* | ?:[\\/]*) @@ -9892,44 +9947,43 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_CCACHE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done test -z "$ac_cv_path_CCACHE" && ac_cv_path_CCACHE="not_found" ;; esac fi CCACHE=$ac_cv_path_CCACHE + if test -n "$CCACHE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CCACHE" >&5 -$as_echo "$CCACHE" >&6; } + echo "$as_me:$LINENO: result: $CCACHE" >&5 +echo "${ECHO_T}$CCACHE" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test "$CCACHE" = "not_found" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: not enabling --ccache-skip (ccache not found)" >&5 -$as_echo "$as_me: not enabling --ccache-skip (ccache not found)" >&6;} + { echo "$as_me:$LINENO: not enabling --ccache-skip (ccache not found)" >&5 +echo "$as_me: not enabling --ccache-skip (ccache not found)" >&6;} else # check ccache version - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether version of ccache is suitable" >&5 -$as_echo_n "checking whether version of ccache is suitable... " >&6; } + echo "$as_me:$LINENO: checking whether version of ccache is suitable" >&5 +echo $ECHO_N "checking whether version of ccache is suitable... $ECHO_C" >&6 CCACHE_VERSION=`"$CCACHE" -V | "$AWK" '/^ccache version/{print $3}'` if test "$CCACHE_VERSION" = "2.4_OOo"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ccache is actually used for the build" >&5 -$as_echo_n "checking whether ccache is actually used for the build... " >&6; } - ac_ext=cpp + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + echo "$as_me:$LINENO: checking whether ccache is actually used for the build" >&5 +echo $ECHO_N "checking whether ccache is actually used for the build... $ECHO_C" >&6 + ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -9937,7 +9991,11 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu save_CXXFLAGS=$CXXFLAGS CXXFLAGS="$CXXFLAGS --ccache-skip -O2" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -9948,20 +10006,44 @@ main () return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then use_ccache=yes else - use_ccache=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +use_ccache=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $use_ccache = yes ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, will enable --ccache-skip" >&5 -$as_echo "yes, will enable --ccache-skip" >&6; } + echo "$as_me:$LINENO: result: yes, will enable --ccache-skip" >&5 +echo "${ECHO_T}yes, will enable --ccache-skip" >&6 USE_CCACHE=YES else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, will not enable --ccache-skip" >&5 -$as_echo "no, will not enable --ccache-skip" >&6; } + echo "$as_me:$LINENO: result: no, will not enable --ccache-skip" >&5 +echo "${ECHO_T}no, will not enable --ccache-skip" >&6 fi CXXFLAGS=$save_CXXFLAGS ac_ext=c @@ -9971,27 +10053,33 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: ccache version $CCACHE_VERSION not accepted. See description for --enable-ccache-skip" >&5 -$as_echo "$as_me: ccache version $CCACHE_VERSION not accepted. See description for --enable-ccache-skip" >&6;} + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: ccache version $CCACHE_VERSION not accepted. See description for --enable-ccache-skip" >&5 +echo "$as_me: ccache version $CCACHE_VERSION not accepted. See description for --enable-ccache-skip" >&6;} fi fi else - as_fn_error "invalid option to --enable-ccache-skip. Valid values are \"auto\", \"yes\" and \"no\"" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: invalid option to --enable-ccache-skip. Valid values are \"auto\", \"yes\" and \"no\"" >&5 +echo "$as_me: error: invalid option to --enable-ccache-skip. Valid values are \"auto\", \"yes\" and \"no\"" >&2;} + { (exit 1); exit 1; }; } fi if test "$USE_SYSTEM_STL" = "YES"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if hash_map will be in __gnu_cxx namespace" >&5 -$as_echo_n "checking if hash_map will be in __gnu_cxx namespace... " >&6; } - ac_ext=cpp + echo "$as_me:$LINENO: checking if hash_map will be in __gnu_cxx namespace" >&5 +echo $ECHO_N "checking if hash_map will be in __gnu_cxx namespace... $ECHO_C" >&6 + ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include using namespace __gnu_cxx; @@ -10004,42 +10092,72 @@ hash_map t; return 0; return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_cxx_have_ext_hash_map=yes else - ac_cv_cxx_have_ext_hash_map=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_cxx_have_ext_hash_map=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test "$ac_cv_cxx_have_ext_hash_map" = "no"; then - as_fn_error "Can't find hash_map. Try with --with-stlport" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Can't find hash_map. Try with --with-stlport" >&5 +echo "$as_me: error: Can't find hash_map. Try with --with-stlport" >&2;} + { (exit 1); exit 1; }; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_have_ext_hash_map" >&5 -$as_echo "$ac_cv_cxx_have_ext_hash_map" >&6; } + echo "$as_me:$LINENO: result: $ac_cv_cxx_have_ext_hash_map" >&5 +echo "${ECHO_T}$ac_cv_cxx_have_ext_hash_map" >&6 fi if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if STL headers are visibility safe" >&5 -$as_echo_n "checking if STL headers are visibility safe... " >&6; } + echo "$as_me:$LINENO: checking if STL headers are visibility safe" >&5 +echo $ECHO_N "checking if STL headers are visibility safe... $ECHO_C" >&6 -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "visibility push" >/dev/null 2>&1; then : + $EGREP "visibility push" >/dev/null 2>&1; then stlvisok=yes else stlvisok=no fi rm -f conftest* - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $stlvisok" >&5 -$as_echo "$stlvisok" >&6; } + echo "$as_me:$LINENO: result: $stlvisok" >&5 +echo "${ECHO_T}$stlvisok" >&6 if test "$stlvisok" = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Your gcc STL headers are not visibility safe. Disabling visibility" >&5 -$as_echo "$as_me: WARNING: Your gcc STL headers are not visibility safe. Disabling visibility" >&2;} + { echo "$as_me:$LINENO: WARNING: Your gcc STL headers are not visibility safe. Disabling visibility" >&5 +echo "$as_me: WARNING: Your gcc STL headers are not visibility safe. Disabling visibility" >&2;} echo "Your gcc STL headers are not visibility safe. Disabling visibility" >> warn unset HAVE_GCC_VISIBILITY_FEATURE fi @@ -10049,9 +10167,13 @@ $as_echo "$as_me: WARNING: Your gcc STL headers are not visibility safe. Disabli sharedlink_ldflags_save=$LDFLAGS LDFLAGS="$LDFLAGS -fvisibility-inlines-hidden -fpic -shared" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gcc is -fvisibility-inlines-hidden safe with STL headers" >&5 -$as_echo_n "checking if gcc is -fvisibility-inlines-hidden safe with STL headers... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + echo "$as_me:$LINENO: checking if gcc is -fvisibility-inlines-hidden safe with STL headers" >&5 +echo $ECHO_N "checking if gcc is -fvisibility-inlines-hidden safe with STL headers... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include using namespace std; @@ -10064,19 +10186,43 @@ istringstream strm( "test" ); return 0; return 0; } _ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then $EGREP -q unresolvable conftest.err; if test $? -eq 0; then gccvisok=no; else gccvisok=yes; fi else - gccvisok=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +gccvisok=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gccvisok" >&5 -$as_echo "$gccvisok" >&6; } +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + echo "$as_me:$LINENO: result: $gccvisok" >&5 +echo "${ECHO_T}$gccvisok" >&6 if test "$gccvisok" = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Your gcc is not -fvisibility-inlines-hidden safe. Disabling visibility" >&5 -$as_echo "$as_me: WARNING: Your gcc is not -fvisibility-inlines-hidden safe. Disabling visibility" >&2;} + { echo "$as_me:$LINENO: WARNING: Your gcc is not -fvisibility-inlines-hidden safe. Disabling visibility" >&5 +echo "$as_me: WARNING: Your gcc is not -fvisibility-inlines-hidden safe. Disabling visibility" >&2;} echo "Your gcc is not -fvisibility-inlines-hidden safe. Disabling visibility" >> warn unset HAVE_GCC_VISIBILITY_FEATURE fi @@ -10085,8 +10231,8 @@ $as_echo "$as_me: WARNING: Your gcc is not -fvisibility-inlines-hidden safe. Dis fi if test "$HAVE_GCC_VISIBILITY_FEATURE" = "TRUE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gcc has a visibility bug with class-level attributes (GCC bug 26905)" >&5 -$as_echo_n "checking if gcc has a visibility bug with class-level attributes (GCC bug 26905)... " >&6; } + echo "$as_me:$LINENO: checking if gcc has a visibility bug with class-level attributes (GCC bug 26905)" >&5 +echo $ECHO_N "checking if gcc has a visibility bug with class-level attributes (GCC bug 26905)... $ECHO_C" >&6 cat >visibility.cxx <<_ACEOF #pragma GCC visibility push(hidden) struct __attribute__ ((visibility ("default"))) TestStruct { @@ -10114,11 +10260,11 @@ _ACEOF fi rm -f visibility.s - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gccvisbroken" >&5 -$as_echo "$gccvisbroken" >&6; } + echo "$as_me:$LINENO: result: $gccvisbroken" >&5 +echo "${ECHO_T}$gccvisbroken" >&6 if test "$gccvisbroken" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Your gcc is not -fvisibility=hidden safe. Disabling visibility" >&5 -$as_echo "$as_me: WARNING: Your gcc is not -fvisibility=hidden safe. Disabling visibility" >&2;} + { echo "$as_me:$LINENO: WARNING: Your gcc is not -fvisibility=hidden safe. Disabling visibility" >&5 +echo "$as_me: WARNING: Your gcc is not -fvisibility=hidden safe. Disabling visibility" >&2;} echo "Your gcc is not -fvisibility=hidden safe. Disabling visibility" >> warn unset HAVE_GCC_VISIBILITY_FEATURE fi @@ -10134,20 +10280,112 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which memory allocator to use" >&5 -$as_echo_n "checking which memory allocator to use... " >&6; } +echo "$as_me:$LINENO: checking which memory allocator to use" >&5 +echo $ECHO_N "checking which memory allocator to use... $ECHO_C" >&6 if test "$with_alloc" = "system"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: system" >&5 -$as_echo "system" >&6; } + echo "$as_me:$LINENO: result: system" >&5 +echo "${ECHO_T}system" >&6 ALLOC="SYS_ALLOC"; - for ac_func in malloc realloc calloc free -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : + + + + +for ac_func in malloc realloc calloc free +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -10155,48 +10393,79 @@ done fi if test "$with_alloc" = "tcmalloc"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: tcmalloc" >&5 -$as_echo "tcmalloc" >&6; } + echo "$as_me:$LINENO: result: tcmalloc" >&5 +echo "${ECHO_T}tcmalloc" >&6 if ! echo $build_cpu | grep -E 'i[3456]86' 2>/dev/null >/dev/null; then - as_fn_error "tcmalloc only available/usable on ix86" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: tcmalloc only available/usable on ix86" >&5 +echo "$as_me: error: tcmalloc only available/usable on ix86" >&2;} + { (exit 1); exit 1; }; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for malloc in -ltcmalloc" >&5 -$as_echo_n "checking for malloc in -ltcmalloc... " >&6; } -if test "${ac_cv_lib_tcmalloc_malloc+set}" = set; then : - $as_echo_n "(cached) " >&6 + +echo "$as_me:$LINENO: checking for malloc in -ltcmalloc" >&5 +echo $ECHO_N "checking for malloc in -ltcmalloc... $ECHO_C" >&6 +if test "${ac_cv_lib_tcmalloc_malloc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ltcmalloc $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char malloc (); int main () { -return malloc (); +malloc (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_tcmalloc_malloc=yes else - ac_cv_lib_tcmalloc_malloc=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_tcmalloc_malloc=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tcmalloc_malloc" >&5 -$as_echo "$ac_cv_lib_tcmalloc_malloc" >&6; } -if test "x$ac_cv_lib_tcmalloc_malloc" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_tcmalloc_malloc" >&5 +echo "${ECHO_T}$ac_cv_lib_tcmalloc_malloc" >&6 +if test $ac_cv_lib_tcmalloc_malloc = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBTCMALLOC 1 _ACEOF @@ -10204,44 +10473,46 @@ _ACEOF LIBS="-ltcmalloc $LIBS" else - as_fn_error "tcmalloc not found or functional. Install the Google Profiling Tools" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: tcmalloc not found or functional. Install the Google Profiling Tools" >&5 +echo "$as_me: error: tcmalloc not found or functional. Install the Google Profiling Tools" >&2;} + { (exit 1); exit 1; }; } fi ALLOC="TCMALLOC"; fi if test "$with_alloc" = "internal" -o -z "$with_alloc"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 -$as_echo "internal" >&6; } + echo "$as_me:$LINENO: result: internal" >&5 +echo "${ECHO_T}internal" >&6 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to add custom build version" >&5 -$as_echo_n "checking whether to add custom build version... " >&6; } +echo "$as_me:$LINENO: checking whether to add custom build version" >&5 +echo $ECHO_N "checking whether to add custom build version... $ECHO_C" >&6 if test "z$with_build_version" != "z"; then BUILD_VER_STRING=$with_build_version - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, $BUILD_VER_STRING" >&5 -$as_echo "yes, $BUILD_VER_STRING" >&6; } + echo "$as_me:$LINENO: result: yes, $BUILD_VER_STRING" >&5 +echo "${ECHO_T}yes, $BUILD_VER_STRING" >&6 else BUILD_VER_STRING= - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build with Java support" >&5 -$as_echo_n "checking whether to build with Java support... " >&6; } +echo "$as_me:$LINENO: checking whether to build with Java support" >&5 +echo $ECHO_N "checking whether to build with Java support... $ECHO_C" >&6 if test "$WITH_JAVA" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 SOLAR_JAVA="TRUE" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 SOLAR_JAVA="" - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: building without java will mean some features will not be available" >&5 -$as_echo "$as_me: WARNING: building without java will mean some features will not be available" >&2;} + { echo "$as_me:$LINENO: WARNING: building without java will mean some features will not be available" >&5 +echo "$as_me: WARNING: building without java will mean some features will not be available" >&2;} echo "building without java will mean some features will not be available" >>warn fi @@ -10268,10 +10539,10 @@ if test "$SOLAR_JAVA" != ""; then if test -z "$with_jdk_home"; then # Extract the first word of "$WITH_JAVA", so it can be a program name with args. set dummy $WITH_JAVA; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_JAVAINTERPRETER+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_JAVAINTERPRETER+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $JAVAINTERPRETER in [\\/]* | ?:[\\/]*) @@ -10283,35 +10554,36 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_JAVAINTERPRETER="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done ;; esac fi JAVAINTERPRETER=$ac_cv_path_JAVAINTERPRETER + if test -n "$JAVAINTERPRETER"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVAINTERPRETER" >&5 -$as_echo "$JAVAINTERPRETER" >&6; } + echo "$as_me:$LINENO: result: $JAVAINTERPRETER" >&5 +echo "${ECHO_T}$JAVAINTERPRETER" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - else _java_path="$with_jdk_home/bin/$WITH_JAVA" if test -x "$_java_path"; then JAVAINTERPRETER=$_java_path else - as_fn_error "$_java_path not found set with_jdk_home" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: $_java_path not found set with_jdk_home" >&5 +echo "$as_me: error: $_java_path not found set with_jdk_home" >&2;} + { (exit 1); exit 1; }; } fi fi if test "$_os" = "WINNT"; then @@ -10325,11 +10597,13 @@ fi if test "$SOLAR_JAVA" != ""; then _gij_longver=0 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking the installed JDK" >&5 -$as_echo_n "checking the installed JDK... " >&6; } + echo "$as_me:$LINENO: checking the installed JDK" >&5 +echo $ECHO_N "checking the installed JDK... $ECHO_C" >&6 if test -n "$JAVAINTERPRETER"; then if test `$JAVAINTERPRETER -version 2>&1 | grep -c "Kaffe"` -gt 0; then - as_fn_error "No valid check available. Please check the block for your desired java in configure.in" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: No valid check available. Please check the block for your desired java in configure.in" >&5 +echo "$as_me: error: No valid check available. Please check the block for your desired java in configure.in" >&2;} + { (exit 1); exit 1; }; } # dnl Kaffe specific tests # KAFFE_VER=`$JAVAINTERPRETER -version 2>&1 | $EGREP " Version:" | $SED -r "s/.* Version: ([[0-9\.]]*).*/\1/"` # if test -z "$KAFFE_VER"; then @@ -10349,13 +10623,15 @@ $as_echo_n "checking the installed JDK... " >&6; } # JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*java,,p"` elif test `$JAVAINTERPRETER --version 2>&1 | grep -c "GNU libgcj"` -gt 0; then JDK=gcj - { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked (gcj)" >&5 -$as_echo "checked (gcj)" >&6; } + echo "$as_me:$LINENO: result: checked (gcj)" >&5 +echo "${ECHO_T}checked (gcj)" >&6 _gij_version=`$JAVAINTERPRETER --version | grep GNU | $SED -e 's@^[^0-9]*@@' -e 's@ .*@@' -e 's@,.*@@'`; _gij_longver=`echo $_gij_version | $AWK -F. '{ print \$1*10000+\$2*100+\$3 }'` elif test `$JAVAINTERPRETER -version 2>&1 | awk '{ print }' | grep -c "BEA"` -gt 0; then - as_fn_error "No valid check available. Please check the block for your desired java in configure.in" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: No valid check available. Please check the block for your desired java in configure.in" >&5 +echo "$as_me: error: No valid check available. Please check the block for your desired java in configure.in" >&2;} + { (exit 1); exit 1; }; } # JDK=bea # # dnl BEA JDK specific tests @@ -10385,15 +10661,20 @@ $as_echo "checked (gcj)" >&6; } _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'` if test "$_jdk_ver" -lt 10500; then - as_fn_error "IBM JDK is too old, you need at least 1.5" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: IBM JDK is too old, you need at least 1.5" >&5 +echo "$as_me: error: IBM JDK is too old, you need at least 1.5" >&2;} + { (exit 1); exit 1; }; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked (IBM JDK $_jdk)" >&5 -$as_echo "checked (IBM JDK $_jdk)" >&6; } + echo "$as_me:$LINENO: result: checked (IBM JDK $_jdk)" >&5 +echo "${ECHO_T}checked (IBM JDK $_jdk)" >&6 if test "$with_jdk_home" = ""; then - as_fn_error "In order to successfully build OpenOffice.org using the IBM JDK, -you must use the \"--with-jdk-home\" configure option explicitly" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: In order to successfully build OpenOffice.org using the IBM JDK, +you must use the \"--with-jdk-home\" configure option explicitly" >&5 +echo "$as_me: error: In order to successfully build OpenOffice.org using the IBM JDK, +you must use the \"--with-jdk-home\" configure option explicitly" >&2;} + { (exit 1); exit 1; }; } fi JAVA_HOME=$with_jdk_home @@ -10405,10 +10686,12 @@ you must use the \"--with-jdk-home\" configure option explicitly" "$LINENO" 5 _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'` if test "$_jdk_ver" -lt 10500; then - as_fn_error "JDK is too old, you need at least 1.5" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: JDK is too old, you need at least 1.5" >&5 +echo "$as_me: error: JDK is too old, you need at least 1.5" >&2;} + { (exit 1); exit 1; }; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked (JDK $_jdk)" >&5 -$as_echo "checked (JDK $_jdk)" >&6; } + echo "$as_me:$LINENO: result: checked (JDK $_jdk)" >&5 +echo "${ECHO_T}checked (JDK $_jdk)" >&6 JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*java,,p"` if test "$_os" = "WINNT"; then JAVA_HOME=`echo $JAVA_HOME | $SED "s,\.[eE][xX][eE]$,,"` @@ -10418,7 +10701,9 @@ $as_echo "checked (JDK $_jdk)" >&6; } fi fi else - as_fn_error "JAVA not found. You need at least jdk-1.5, or gcj-4" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: JAVA not found. You need at least jdk-1.5, or gcj-4" >&5 +echo "$as_me: error: JAVA not found. You need at least jdk-1.5, or gcj-4" >&2;} + { (exit 1); exit 1; }; } fi else JAVA_HOME=NO_JAVA_HOME ; export JAVA_HOME @@ -10438,10 +10723,10 @@ if test "$SOLAR_JAVA" != ""; then if test -z "$with_jdk_home"; then # Extract the first word of "$javacompiler", so it can be a program name with args. set dummy $javacompiler; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_JAVACOMPILER+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_JAVACOMPILER+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $JAVACOMPILER in [\\/]* | ?:[\\/]*) @@ -10453,29 +10738,28 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_JAVACOMPILER="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done ;; esac fi JAVACOMPILER=$ac_cv_path_JAVACOMPILER + if test -n "$JAVACOMPILER"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVACOMPILER" >&5 -$as_echo "$JAVACOMPILER" >&6; } + echo "$as_me:$LINENO: result: $JAVACOMPILER" >&5 +echo "${ECHO_T}$JAVACOMPILER" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - else _javac_path="$with_jdk_home/bin/$javacompiler" if test -x "$_javac_path"; then @@ -10483,7 +10767,9 @@ fi fi fi if test -z "$JAVACOMPILER"; then - as_fn_error "$javacompiler not found set with_jdk_home" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: $javacompiler not found set with_jdk_home" >&5 +echo "$as_me: error: $javacompiler not found set with_jdk_home" >&2;} + { (exit 1); exit 1; }; } fi if test "$_os" = "WINNT"; then if test x`echo "$JAVACOMPILER" | grep -i '\.exe$'` = x; then @@ -10499,11 +10785,11 @@ fi fi if test `$JAVACOMPILER -version 2>&1 | grep -c "Eclipse Java Compiler"` -gt 0; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking re-checking JDK" >&5 -$as_echo_n "checking re-checking JDK... " >&6; } + echo "$as_me:$LINENO: checking re-checking JDK" >&5 +echo $ECHO_N "checking re-checking JDK... $ECHO_C" >&6 JDK=gcj - { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked (ecj)" >&5 -$as_echo "checked (ecj)" >&6; } + echo "$as_me:$LINENO: result: checked (ecj)" >&5 +echo "${ECHO_T}checked (ecj)" >&6 #TODO: what's to do here? some switch to do 1.5 compiling? JAVAFLAGS="-source 1.5 -target 1.5" _gij_longver="40200" @@ -10522,10 +10808,10 @@ if test "$SOLAR_JAVA" != ""; then if test -z "$with_jdk_home"; then # Extract the first word of "javadoc", so it can be a program name with args. set dummy javadoc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_JAVADOC+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_JAVADOC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $JAVADOC in [\\/]* | ?:[\\/]*) @@ -10537,29 +10823,28 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_JAVADOC="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done ;; esac fi JAVADOC=$ac_cv_path_JAVADOC + if test -n "$JAVADOC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVADOC" >&5 -$as_echo "$JAVADOC" >&6; } + echo "$as_me:$LINENO: result: $JAVADOC" >&5 +echo "${ECHO_T}$JAVADOC" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - else _javadoc_path="$with_jdk_home/bin/javadoc" if test "$_os" = "OS2"; then @@ -10572,10 +10857,10 @@ fi else # Extract the first word of "javadoc", so it can be a program name with args. set dummy javadoc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_JAVADOC+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_JAVADOC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $JAVADOC in [\\/]* | ?:[\\/]*) @@ -10587,33 +10872,34 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_JAVADOC="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done ;; esac fi JAVADOC=$ac_cv_path_JAVADOC + if test -n "$JAVADOC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVADOC" >&5 -$as_echo "$JAVADOC" >&6; } + echo "$as_me:$LINENO: result: $JAVADOC" >&5 +echo "${ECHO_T}$JAVADOC" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi fi if test -z "$JAVADOC"; then - as_fn_error "$_javadoc_path not found set with_jdk_home" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: $_javadoc_path not found set with_jdk_home" >&5 +echo "$as_me: error: $_javadoc_path not found set with_jdk_home" >&2;} + { (exit 1); exit 1; }; } fi if test "$_os" = "WINNT"; then if test x`echo "$JAVADOC" | grep -i '\.exe$'` = x; then @@ -10645,33 +10931,37 @@ class findhome } } _ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if javac works" >&5 -$as_echo_n "checking if javac works... " >&6; } + echo "$as_me:$LINENO: checking if javac works" >&5 +echo $ECHO_N "checking if javac works... $ECHO_C" >&6 javac_cmd="$JAVACOMPILER findhome.java 1>&2" - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$javac_cmd\""; } >&5 + { (eval echo "$as_me:$LINENO: \"$javac_cmd\"") >&5 (eval $javac_cmd) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } if test $? = 0 && test -f ./findhome.class ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: javac works" >&5 -$as_echo "javac works" >&6; } + echo "$as_me:$LINENO: result: javac works" >&5 +echo "${ECHO_T}javac works" >&6 else echo "configure: javac test failed" >&5 cat findhome.java >&5 - as_fn_error "javac does not work - java projects will not build!" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: javac does not work - java projects will not build!" >&5 +echo "$as_me: error: javac does not work - java projects will not build!" >&2;} + { (exit 1); exit 1; }; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gij knows its java.home" >&5 -$as_echo_n "checking if gij knows its java.home... " >&6; } + echo "$as_me:$LINENO: checking if gij knows its java.home" >&5 +echo $ECHO_N "checking if gij knows its java.home... $ECHO_C" >&6 JAVA_HOME=`$JAVAINTERPRETER findhome` if test $? = 0 && test "$JAVA_HOME" != "" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVA_HOME" >&5 -$as_echo "$JAVA_HOME" >&6; } + echo "$as_me:$LINENO: result: $JAVA_HOME" >&5 +echo "${ECHO_T}$JAVA_HOME" >&6 else echo "configure: java test failed" >&5 cat findhome.java >&5 - as_fn_error "gij does not know its java.home - use --with-jdk-home" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: gij does not know its java.home - use --with-jdk-home" >&5 +echo "$as_me: error: gij does not know its java.home - use --with-jdk-home" >&2;} + { (exit 1); exit 1; }; } fi else JAVA_HOME=`echo $JAVAINTERPRETER | $SED -n "s,//*bin//*$WITH_JAVA,,p"` @@ -10693,10 +10983,10 @@ $as_echo "$JAVA_HOME" >&6; } JAVA_HOME=$(readlink $JAVACOMPILER) else # else warn - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: JAVA_HOME is set to /usr - this is very likely to be incorrect" >&5 -$as_echo "$as_me: WARNING: JAVA_HOME is set to /usr - this is very likely to be incorrect" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: if this is the case, please inform the correct JAVA_HOME with --with-jdk-home" >&5 -$as_echo "$as_me: WARNING: if this is the case, please inform the correct JAVA_HOME with --with-jdk-home" >&2;} + { echo "$as_me:$LINENO: WARNING: JAVA_HOME is set to /usr - this is very likely to be incorrect" >&5 +echo "$as_me: WARNING: JAVA_HOME is set to /usr - this is very likely to be incorrect" >&2;} + { echo "$as_me:$LINENO: WARNING: if this is the case, please inform the correct JAVA_HOME with --with-jdk-home" >&5 +echo "$as_me: WARNING: if this is the case, please inform the correct JAVA_HOME with --with-jdk-home" >&2;} echo "JAVA_HOME is set to /usr - this is very likely to be incorrect" >> warn echo "if this is the case, please inform the correct JAVA_HOME with --with-jdk-home" >> warn fi @@ -10718,12 +11008,12 @@ $as_echo "$as_me: WARNING: if this is the case, please inform the correct JAVA_H JAVA_HOME_OK="NO" fi if test "$JAVA_HOME_OK" = "NO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script" >&5 -$as_echo "$as_me: WARNING: JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: attempted to find JAVA_HOME automatically, but apparently it failed" >&5 -$as_echo "$as_me: WARNING: attempted to find JAVA_HOME automatically, but apparently it failed" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: in case JAVA_HOME is incorrectly set, some projects with not be built correctly" >&5 -$as_echo "$as_me: WARNING: in case JAVA_HOME is incorrectly set, some projects with not be built correctly" >&2;} + { echo "$as_me:$LINENO: WARNING: JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script" >&5 +echo "$as_me: WARNING: JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script" >&2;} + { echo "$as_me:$LINENO: WARNING: attempted to find JAVA_HOME automatically, but apparently it failed" >&5 +echo "$as_me: WARNING: attempted to find JAVA_HOME automatically, but apparently it failed" >&2;} + { echo "$as_me:$LINENO: WARNING: in case JAVA_HOME is incorrectly set, some projects with not be built correctly" >&5 +echo "$as_me: WARNING: in case JAVA_HOME is incorrectly set, some projects with not be built correctly" >&2;} echo "JAVA_HOME was not explicitly informed with --with-jdk-home. the configure script" >> warn echo "attempted to find JAVA_HOME automatically, but apparently it failed" >> warn echo "in case JAVA_HOME is incorrectly set, some projects with not be built correctly" >> warn @@ -10734,61 +11024,227 @@ $as_echo "$as_me: WARNING: in case JAVA_HOME is incorrectly set, some projects w fi fi -AWTLIB= -if test "$SOLAR_JAVA" != ""; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jawt lib name" >&5 -$as_echo_n "checking for jawt lib name... " >&6; } - if test "$JDK" = "gcj"; then - save_CFLAGS=$CFLAGS - save_LDFLAGS=$LDFLAGS - CFLAGS="$CFLAGS -I$JAVA_HOME/include" - LDFLAGS="$LDFLAGS -L$JAVA_HOME/lib -lgcj" - exec 6>/dev/null # no output - ac_fn_c_check_header_mongrel "$LINENO" "jni.h" "ac_cv_header_jni_h" "$ac_includes_default" -if test "x$ac_cv_header_jni_h" = x""yes; then : +AWTLIB= +if test "$SOLAR_JAVA" != ""; then + echo "$as_me:$LINENO: checking for jawt lib name" >&5 +echo $ECHO_N "checking for jawt lib name... $ECHO_C" >&6 + if test "$JDK" = "gcj"; then + save_CFLAGS=$CFLAGS + save_LDFLAGS=$LDFLAGS + CFLAGS="$CFLAGS -I$JAVA_HOME/include" + LDFLAGS="$LDFLAGS -L$JAVA_HOME/lib -lgcj" + exec 6>/dev/null # no output + if test "${ac_cv_header_jni_h+set}" = set; then + echo "$as_me:$LINENO: checking for jni.h" >&5 +echo $ECHO_N "checking for jni.h... $ECHO_C" >&6 +if test "${ac_cv_header_jni_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_jni_h" >&5 +echo "${ECHO_T}$ac_cv_header_jni_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking jni.h usability" >&5 +echo $ECHO_N "checking jni.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking jni.h presence" >&5 +echo $ECHO_N "checking jni.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: jni.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: jni.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: jni.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: jni.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: jni.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: jni.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: jni.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: jni.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: jni.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: jni.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: jni.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: jni.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: jni.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: jni.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: jni.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: jni.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for jni.h" >&5 +echo $ECHO_N "checking for jni.h... $ECHO_C" >&6 +if test "${ac_cv_header_jni_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_jni_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_jni_h" >&5 +echo "${ECHO_T}$ac_cv_header_jni_h" >&6 +fi +if test $ac_cv_header_jni_h = yes; then + : else - as_fn_error "jni.h could not be found. Mismatch between gcc and libgcj or libgcj-devel missing?" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: jni.h could not be found. Mismatch between gcc and libgcj or libgcj-devel missing?" >&5 +echo "$as_me: error: jni.h could not be found. Mismatch between gcc and libgcj or libgcj-devel missing?" >&2;} + { (exit 1); exit 1; }; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JAWT_GetAWT in -lgcjawt" >&5 -$as_echo_n "checking for JAWT_GetAWT in -lgcjawt... " >&6; } -if test "${ac_cv_lib_gcjawt_JAWT_GetAWT+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for JAWT_GetAWT in -lgcjawt" >&5 +echo $ECHO_N "checking for JAWT_GetAWT in -lgcjawt... $ECHO_C" >&6 +if test "${ac_cv_lib_gcjawt_JAWT_GetAWT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgcjawt $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char JAWT_GetAWT (); int main () { -return JAWT_GetAWT (); +JAWT_GetAWT (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_gcjawt_JAWT_GetAWT=yes else - ac_cv_lib_gcjawt_JAWT_GetAWT=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_gcjawt_JAWT_GetAWT=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gcjawt_JAWT_GetAWT" >&5 -$as_echo "$ac_cv_lib_gcjawt_JAWT_GetAWT" >&6; } -if test "x$ac_cv_lib_gcjawt_JAWT_GetAWT" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_gcjawt_JAWT_GetAWT" >&5 +echo "${ECHO_T}$ac_cv_lib_gcjawt_JAWT_GetAWT" >&6 +if test $ac_cv_lib_gcjawt_JAWT_GetAWT = yes; then AWTLIB="-lgcjawt -lgcj" fi @@ -10807,93 +11263,287 @@ fi LD_LIBRARY_PATH=$JAVA_HOME/jre/bin:$JAVA_HOME/jre/bin/classic:$JAVA_HOME/jre/bin/xawt:$LD_LIBRARY_PATH export LD_LIBRARY_PATH exec 6>/dev/null # no output - ac_fn_c_check_header_mongrel "$LINENO" "jni.h" "ac_cv_header_jni_h" "$ac_includes_default" -if test "x$ac_cv_header_jni_h" = x""yes; then : + if test "${ac_cv_header_jni_h+set}" = set; then + echo "$as_me:$LINENO: checking for jni.h" >&5 +echo $ECHO_N "checking for jni.h... $ECHO_C" >&6 +if test "${ac_cv_header_jni_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_jni_h" >&5 +echo "${ECHO_T}$ac_cv_header_jni_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking jni.h usability" >&5 +echo $ECHO_N "checking jni.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking jni.h presence" >&5 +echo $ECHO_N "checking jni.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: jni.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: jni.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: jni.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: jni.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: jni.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: jni.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: jni.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: jni.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: jni.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: jni.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: jni.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: jni.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: jni.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: jni.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: jni.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: jni.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for jni.h" >&5 +echo $ECHO_N "checking for jni.h... $ECHO_C" >&6 +if test "${ac_cv_header_jni_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_jni_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_jni_h" >&5 +echo "${ECHO_T}$ac_cv_header_jni_h" >&6 +fi +if test $ac_cv_header_jni_h = yes; then + : else - as_fn_error "jni.h could not be found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: jni.h could not be found." >&5 +echo "$as_me: error: jni.h could not be found." >&2;} + { (exit 1); exit 1; }; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JAWT_GetAWT in -ljawt" >&5 -$as_echo_n "checking for JAWT_GetAWT in -ljawt... " >&6; } -if test "${ac_cv_lib_jawt_JAWT_GetAWT+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for JAWT_GetAWT in -ljawt" >&5 +echo $ECHO_N "checking for JAWT_GetAWT in -ljawt... $ECHO_C" >&6 +if test "${ac_cv_lib_jawt_JAWT_GetAWT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ljawt $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char JAWT_GetAWT (); int main () { -return JAWT_GetAWT (); +JAWT_GetAWT (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_jawt_JAWT_GetAWT=yes else - ac_cv_lib_jawt_JAWT_GetAWT=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_jawt_JAWT_GetAWT=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jawt_JAWT_GetAWT" >&5 -$as_echo "$ac_cv_lib_jawt_JAWT_GetAWT" >&6; } -if test "x$ac_cv_lib_jawt_JAWT_GetAWT" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_jawt_JAWT_GetAWT" >&5 +echo "${ECHO_T}$ac_cv_lib_jawt_JAWT_GetAWT" >&6 +if test $ac_cv_lib_jawt_JAWT_GetAWT = yes; then AWTLIB="-ljawt" fi if test -z "$AWTLIB"; then LDFLAGS="$LDFLAGS -L$JAVA_HOME/jre/bin/xawt -ljawt" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for JAWT_GetAWT in -lmawt" >&5 -$as_echo_n "checking for JAWT_GetAWT in -lmawt... " >&6; } -if test "${ac_cv_lib_mawt_JAWT_GetAWT+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for JAWT_GetAWT in -lmawt" >&5 +echo $ECHO_N "checking for JAWT_GetAWT in -lmawt... $ECHO_C" >&6 +if test "${ac_cv_lib_mawt_JAWT_GetAWT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmawt $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char JAWT_GetAWT (); int main () { -return JAWT_GetAWT (); +JAWT_GetAWT (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_mawt_JAWT_GetAWT=yes else - ac_cv_lib_mawt_JAWT_GetAWT=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_mawt_JAWT_GetAWT=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mawt_JAWT_GetAWT" >&5 -$as_echo "$ac_cv_lib_mawt_JAWT_GetAWT" >&6; } -if test "x$ac_cv_lib_mawt_JAWT_GetAWT" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_mawt_JAWT_GetAWT" >&5 +echo "${ECHO_T}$ac_cv_lib_mawt_JAWT_GetAWT" >&6 +if test $ac_cv_lib_mawt_JAWT_GetAWT = yes; then AWTLIB="-L$JAVA_HOME/jre/bin/xawt -ljawt -lmawt" fi @@ -10906,24 +11556,24 @@ fi if test -z "$AWTLIB"; then AWTLIB=-ljawt fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWTLIB" >&5 -$as_echo "$AWTLIB" >&6; } + echo "$as_me:$LINENO: result: $AWTLIB" >&5 +echo "${ECHO_T}$AWTLIB" >&6 fi if test "$SOLAR_JAVA" != ""; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable gcj aot compilation" >&5 -$as_echo_n "checking whether to enable gcj aot compilation... " >&6; } + echo "$as_me:$LINENO: checking whether to enable gcj aot compilation" >&5 +echo $ECHO_N "checking whether to enable gcj aot compilation... $ECHO_C" >&6 if test -n "$enable_gcjaot" && test "$enable_gcjaot" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 if test `echo $WITH_JAVA | grep -c "gij"` -eq 0; then gcjaot="gcj" else gcjaot=`echo $WITH_JAVA | $SED -e "s/gij/gcj/g"` fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcjaot" >&5 -$as_echo "$gcjaot" >&6; } + echo "$as_me:$LINENO: result: $gcjaot" >&5 +echo "${ECHO_T}$gcjaot" >&6 if test -n "$with_jdk_home"; then _javac_path="$with_jdk_home/bin/$gcjaot" if test -x "$_javac_path"; then @@ -10933,10 +11583,10 @@ $as_echo "$gcjaot" >&6; } if test -z "$JAVAAOTCOMPILER"; then # Extract the first word of "$gcjaot", so it can be a program name with args. set dummy $gcjaot; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_JAVAAOTCOMPILER+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_JAVAAOTCOMPILER+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $JAVAAOTCOMPILER in [\\/]* | ?:[\\/]*) @@ -10948,37 +11598,36 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_JAVAAOTCOMPILER="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done ;; esac fi JAVAAOTCOMPILER=$ac_cv_path_JAVAAOTCOMPILER + if test -n "$JAVAAOTCOMPILER"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JAVAAOTCOMPILER" >&5 -$as_echo "$JAVAAOTCOMPILER" >&6; } + echo "$as_me:$LINENO: result: $JAVAAOTCOMPILER" >&5 +echo "${ECHO_T}$JAVAAOTCOMPILER" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test -z "$JAVAAOTCOMPILER"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $gcjaot not found, set with_jdk_home" >&5 -$as_echo "$as_me: WARNING: $gcjaot not found, set with_jdk_home" >&2;} + { echo "$as_me:$LINENO: WARNING: $gcjaot not found, set with_jdk_home" >&5 +echo "$as_me: WARNING: $gcjaot not found, set with_jdk_home" >&2;} fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi @@ -10994,10 +11643,10 @@ fi # Extract the first word of "dmake", so it can be a program name with args. set dummy dmake; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_DMAKE+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_DMAKE+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $DMAKE in [\\/]* | ?:[\\/]*) @@ -11009,36 +11658,35 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_DMAKE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done test -z "$ac_cv_path_DMAKE" && ac_cv_path_DMAKE="no" ;; esac fi DMAKE=$ac_cv_path_DMAKE + if test -n "$DMAKE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DMAKE" >&5 -$as_echo "$DMAKE" >&6; } + echo "$as_me:$LINENO: result: $DMAKE" >&5 +echo "${ECHO_T}$DMAKE" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test "$DMAKE" = "no"; then BUILD_DMAKE=YES echo "dmake will be built on ./bootstrap" else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the found dmake is the right dmake" >&5 -$as_echo_n "checking whether the found dmake is the right dmake... " >&6; } + echo "$as_me:$LINENO: checking whether the found dmake is the right dmake" >&5 +echo $ECHO_N "checking whether the found dmake is the right dmake... $ECHO_C" >&6 # we need to find out whether that dmake we found is "our" dmake # or the dmake from Sun's SunStudio Compiler which is something # different @@ -11047,48 +11695,48 @@ $as_echo_n "checking whether the found dmake is the right dmake... " >&6; } $DMAKE -V 2>/dev/null | grep 'dmake .* Version .*' >/dev/null if test $? -eq 0; then BUILD_DMAKE=NO - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking the dmake version" >&5 -$as_echo_n "checking the dmake version... " >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + echo "$as_me:$LINENO: checking the dmake version" >&5 +echo $ECHO_N "checking the dmake version... $ECHO_C" >&6 DMAKE_VERSION=`$DMAKE -V | $AWK '$3 == "Version" {print $4}'` if test "`echo $DMAKE_VERSION | cut -d'.' -f1`" -gt "4"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK, >= 4.11" >&5 -$as_echo "OK, >= 4.11" >&6; } + echo "$as_me:$LINENO: result: OK, >= 4.11" >&5 +echo "${ECHO_T}OK, >= 4.11" >&6 elif test "`echo $DMAKE_VERSION | cut -d'.' -f1`" = "4" && \ test "`echo $DMAKE_VERSION | cut -d'.' -f2`" -ge "11"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK, >= 4.11" >&5 -$as_echo "OK, >= 4.11" >&6; } + echo "$as_me:$LINENO: result: OK, >= 4.11" >&5 +echo "${ECHO_T}OK, >= 4.11" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: too old. >= 4.11 is needed" >&5 -$as_echo "too old. >= 4.11 is needed" >&6; } + echo "$as_me:$LINENO: result: too old. >= 4.11 is needed" >&5 +echo "${ECHO_T}too old. >= 4.11 is needed" >&6 echo "A newer dmake will be built on ./bootstrap" BUILD_DMAKE=YES fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 echo "dmake will be built on ./bootstrap" BUILD_DMAKE=YES fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable EPM for packing" >&5 -$as_echo_n "checking whether to enable EPM for packing... " >&6; } +echo "$as_me:$LINENO: checking whether to enable EPM for packing" >&5 +echo $ECHO_N "checking whether to enable EPM for packing... $ECHO_C" >&6 if test "$_os" != "WINNT" -a \( "z$enable_epm" = "z" -o "$enable_epm" != "no" \) ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 if test "$_os" != "WINNT"; then if test -n "$with_epm"; then EPM=$with_epm else # Extract the first word of "epm", so it can be a program name with args. set dummy epm; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_EPM+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_EPM+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $EPM in [\\/]* | ?:[\\/]*) @@ -11100,30 +11748,29 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_EPM="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done test -z "$ac_cv_path_EPM" && ac_cv_path_EPM="no" ;; esac fi EPM=$ac_cv_path_EPM + if test -n "$EPM"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $EPM" >&5 -$as_echo "$EPM" >&6; } + echo "$as_me:$LINENO: result: $EPM" >&5 +echo "${ECHO_T}$EPM" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test "$EPM" = "no" || test "$EPM" = "internal"; then echo "EPM will be built." @@ -11131,38 +11778,44 @@ fi BUILD_TYPE="$BUILD_TYPE EPM" else # Gentoo has some epm which is something different... - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the found epm is the right epm" >&5 -$as_echo_n "checking whether the found epm is the right epm... " >&6; } + echo "$as_me:$LINENO: checking whether the found epm is the right epm" >&5 +echo $ECHO_N "checking whether the found epm is the right epm... $ECHO_C" >&6 if $EPM | grep "ESP Package Manager" >/dev/null 2>/dev/null; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else - as_fn_error "no. Install ESP Package Manager (www.easysw.com/epm) and/or specify the path to the right epm" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: no. Install ESP Package Manager (www.easysw.com/epm) and/or specify the path to the right epm" >&5 +echo "$as_me: error: no. Install ESP Package Manager (www.easysw.com/epm) and/or specify the path to the right epm" >&2;} + { (exit 1); exit 1; }; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking epm version" >&5 -$as_echo_n "checking epm version... " >&6; } + echo "$as_me:$LINENO: checking epm version" >&5 +echo $ECHO_N "checking epm version... $ECHO_C" >&6 EPM_VERSION=`$EPM | grep 'ESP Package Manager' | cut -d' ' -f4 | $SED -e s/v//` if test "`echo $EPM_VERSION | cut -d'.' -f1`" -gt "3" || \ test "`echo $EPM_VERSION | cut -d'.' -f1`" -eq "3" -a "`echo $EPM_VERSION | cut -d'.' -f2`" -ge "7"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK, >= 3.7" >&5 -$as_echo "OK, >= 3.7" >&6; } + echo "$as_me:$LINENO: result: OK, >= 3.7" >&5 +echo "${ECHO_T}OK, >= 3.7" >&6 BUILD_EPM=NO if test "$_os" = "Darwin"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking which PackageMaker EPM thinks to use" >&5 -$as_echo_n "checking which PackageMaker EPM thinks to use... " >&6; } + echo "$as_me:$LINENO: checking which PackageMaker EPM thinks to use" >&5 +echo $ECHO_N "checking which PackageMaker EPM thinks to use... $ECHO_C" >&6 _pm=`strings $EPM | grep PackageMaker | cut -d" " -f1` if test "$_pm" = "/Developer/Applications/PackageMaker.app/Contents/MacOS/PackageMaker"; then - as_fn_error "$_pm; PackageMaker expected in wrong path. Either patch your epm with the right path (/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker) or use internal patched epm (--with-epm=internal)" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: $_pm; PackageMaker expected in wrong path. Either patch your epm with the right path (/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker) or use internal patched epm (--with-epm=internal)" >&5 +echo "$as_me: error: $_pm; PackageMaker expected in wrong path. Either patch your epm with the right path (/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker) or use internal patched epm (--with-epm=internal)" >&2;} + { (exit 1); exit 1; }; } elif test "$_pm" = "/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_pm, ok" >&5 -$as_echo "$_pm, ok" >&6; } + echo "$as_me:$LINENO: result: $_pm, ok" >&5 +echo "${ECHO_T}$_pm, ok" >&6 else # we never should get here, but go safe - as_fn_error "$_pm; PackageMaker expected in unknown path. Either patch your epm with the right path (/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker) or use internal patched epm (--with-epm=internal)" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: $_pm; PackageMaker expected in unknown path. Either patch your epm with the right path (/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker) or use internal patched epm (--with-epm=internal)" >&5 +echo "$as_me: error: $_pm; PackageMaker expected in unknown path. Either patch your epm with the right path (/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker) or use internal patched epm (--with-epm=internal)" >&2;} + { (exit 1); exit 1; }; } fi fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: too old. epm >= 3.7 is required." >&5 -$as_echo "too old. epm >= 3.7 is required." >&6; } + echo "$as_me:$LINENO: result: too old. epm >= 3.7 is required." >&5 +echo "${ECHO_T}too old. epm >= 3.7 is required." >&6 echo "EPM will be built." BUILD_EPM=YES BUILD_TYPE="$BUILD_TYPE EPM" @@ -11171,8 +11824,8 @@ $as_echo "too old. epm >= 3.7 is required." >&6; } fi # test which package format to use - { $as_echo "$as_me:${as_lineno-$LINENO}: checking which package format to use" >&5 -$as_echo_n "checking which package format to use... " >&6; } + echo "$as_me:$LINENO: checking which package format to use" >&5 +echo $ECHO_N "checking which package format to use... $ECHO_C" >&6 # epm supports the following formats: # aix - AIX software distribution # bsd - FreeBSD, NetBSD, or OpenBSD software distribution @@ -11217,7 +11870,9 @@ $as_echo_n "checking which package format to use... " >&6; } # we never should get here since we check the arciecture/os at the beginning, # but go sure... *) - as_fn_error "unknown system" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: unknown system" >&5 +echo "$as_me: error: unknown system" >&2;} + { (exit 1); exit 1; }; } esac if test -n "$with_package_format"; then for i in $with_package_format; do @@ -11225,7 +11880,20 @@ $as_echo_n "checking which package format to use... " >&6; } aix | bsd | deb | inst | tardist | osx | pkg | rpm | setld | native | portable) ;; *) - as_fn_error "unsupported format $i. Supported by EPM are: + { { echo "$as_me:$LINENO: error: unsupported format $i. Supported by EPM are: +aix - AIX software distribution +bsd - FreeBSD, NetBSD, or OpenBSD software distribution +depot or swinstall - HP-UX software distribution +deb - Debian software distribution +inst or tardist - IRIX software distribution +osx - MacOS X software distribution +pkg - Solaris software distribution +rpm - RedHat software distribution +setld - Tru64 (setld) software distribution +native - \"Native\" software distribution for the platform +portable - Portable software distribution + " >&5 +echo "$as_me: error: unsupported format $i. Supported by EPM are: aix - AIX software distribution bsd - FreeBSD, NetBSD, or OpenBSD software distribution depot or swinstall - HP-UX software distribution @@ -11237,17 +11905,18 @@ rpm - RedHat software distribution setld - Tru64 (setld) software distribution native - \"Native\" software distribution for the platform portable - Portable software distribution - " "$LINENO" 5 + " >&2;} + { (exit 1); exit 1; }; } ;; esac done PKGFORMAT="$with_package_format" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGFORMAT" >&5 -$as_echo "$PKGFORMAT" >&6; } + echo "$as_me:$LINENO: result: $PKGFORMAT" >&5 +echo "${ECHO_T}$PKGFORMAT" >&6 if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for rpm" >&5 -$as_echo_n "checking for rpm... " >&6; } + echo "$as_me:$LINENO: checking for rpm" >&5 +echo $ECHO_N "checking for rpm... $ECHO_C" >&6 for a in "$RPM" rpmbuild rpm; do $a --usage >/dev/null 2> /dev/null if test $? -eq 0; then @@ -11262,20 +11931,22 @@ $as_echo_n "checking for rpm... " >&6; } fi done if test -z "$RPM" ; then - as_fn_error "not found" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: not found" >&5 +echo "$as_me: error: not found" >&2;} + { (exit 1); exit 1; }; } else RPM_PATH=`which $RPM` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RPM_PATH" >&5 -$as_echo "$RPM_PATH" >&6; } + echo "$as_me:$LINENO: result: $RPM_PATH" >&5 +echo "${ECHO_T}$RPM_PATH" >&6 fi fi if echo "$PKGFORMAT" | $EGREP deb 2>&1 >/dev/null; then # Extract the first word of "dpkg", so it can be a program name with args. set dummy dpkg; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_DPKG+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_DPKG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $DPKG in [\\/]* | ?:[\\/]*) @@ -11287,76 +11958,81 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_DPKG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done test -z "$ac_cv_path_DPKG" && ac_cv_path_DPKG="no" ;; esac fi DPKG=$ac_cv_path_DPKG + if test -n "$DPKG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DPKG" >&5 -$as_echo "$DPKG" >&6; } + echo "$as_me:$LINENO: result: $DPKG" >&5 +echo "${ECHO_T}$DPKG" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test "$DPKG" = "no"; then - as_fn_error "dpkg needed for deb creation. Install dpkg." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: dpkg needed for deb creation. Install dpkg." >&5 +echo "$as_me: error: dpkg needed for deb creation. Install dpkg." >&2;} + { (exit 1); exit 1; }; } fi fi if echo "PKGFORMAT" | $EGREP osx 2>&1 >/dev/null; then if test "$_os" = "Darwin"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PackageMaker availability" >&5 -$as_echo_n "checking for PackageMaker availability... " >&6; } + echo "$as_me:$LINENO: checking for PackageMaker availability" >&5 +echo $ECHO_N "checking for PackageMaker availability... $ECHO_C" >&6 if ! test -x /Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker; then - as_fn_error "not installed. Please install Apples Dev Tools" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: not installed. Please install Apples Dev Tools" >&5 +echo "$as_me: error: not installed. Please install Apples Dev Tools" >&2;} + { (exit 1); exit 1; }; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } + echo "$as_me:$LINENO: result: ok" >&5 +echo "${ECHO_T}ok" >&6 fi else - as_fn_error "PackageMaker needed to build OSX packages and you are not on OSX..." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: PackageMaker needed to build OSX packages and you are not on OSX..." >&5 +echo "$as_me: error: PackageMaker needed to build OSX packages and you are not on OSX..." >&2;} + { (exit 1); exit 1; }; } fi fi if echo "$PKGFORMAT" | $EGREP rpm 2>&1 >/dev/null || \ echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then if test "$EPM" != "no" && test "$EPM" != "internal"; then if test "`echo $EPM_VERSION | cut -d'.' -f1`" -lt "4"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether epm is patched for OOos needs" >&5 -$as_echo_n "checking whether epm is patched for OOos needs... " >&6; } + echo "$as_me:$LINENO: checking whether epm is patched for OOos needs" >&5 +echo $ECHO_N "checking whether epm is patched for OOos needs... $ECHO_C" >&6 if grep "Patched for OpenOffice.org" $EPM >/dev/null 2>/dev/null; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 if echo "$PKGFORMAT" | grep -q rpm; then _pt="rpm" - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: the rpms will need to be installed with --nodeps" >&5 -$as_echo "$as_me: WARNING: the rpms will need to be installed with --nodeps" >&2;} + { echo "$as_me:$LINENO: WARNING: the rpms will need to be installed with --nodeps" >&5 +echo "$as_me: WARNING: the rpms will need to be installed with --nodeps" >&2;} echo "the rpms will need to be installed with --nodeps" >> warn else _pt="pkg" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: the ${_pt}s will not be relocateable" >&5 -$as_echo "$as_me: WARNING: the ${_pt}s will not be relocateable" >&2;} + { echo "$as_me:$LINENO: WARNING: the ${_pt}s will not be relocateable" >&5 +echo "$as_me: WARNING: the ${_pt}s will not be relocateable" >&2;} echo "the ${_pt}s will not be relocateable" >> warn - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: if you want to make sure installation without --nodeps and + { echo "$as_me:$LINENO: WARNING: if you want to make sure installation without --nodeps and relocation will work, you need to patch your epm with the patch in epm/epm-3.7.patch or build with --with-epm=internal which will build a suitable epm" >&5 -$as_echo "$as_me: WARNING: if you want to make sure installation without --nodeps and +echo "$as_me: WARNING: if you want to make sure installation without --nodeps and relocation will work, you need to patch your epm with the patch in epm/epm-3.7.patch or build with --with-epm=internal which will build a suitable epm" >&2;} @@ -11367,10 +12043,10 @@ $as_echo "$as_me: WARNING: if you want to make sure installation without --nodep if echo "$PKGFORMAT" | $EGREP pkg 2>&1 >/dev/null; then # Extract the first word of "pkgmk", so it can be a program name with args. set dummy pkgmk; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKGMK+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKGMK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKGMK in [\\/]* | ?:[\\/]*) @@ -11382,32 +12058,33 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKGMK="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done test -z "$ac_cv_path_PKGMK" && ac_cv_path_PKGMK="no" ;; esac fi PKGMK=$ac_cv_path_PKGMK + if test -n "$PKGMK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKGMK" >&5 -$as_echo "$PKGMK" >&6; } + echo "$as_me:$LINENO: result: $PKGMK" >&5 +echo "${ECHO_T}$PKGMK" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test "$PKGMK" = "no"; then - as_fn_error "pkgmk needed for Solaris pkg creation. Install it." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: pkgmk needed for Solaris pkg creation. Install it." >&5 +echo "$as_me: error: pkgmk needed for Solaris pkg creation. Install it." >&2;} + { (exit 1); exit 1; }; } fi fi @@ -11416,18 +12093,18 @@ fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 EPM=NO fi # Extract the first word of "gperf", so it can be a program name with args. set dummy gperf; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_GPERF+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_GPERF+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $GPERF in [\\/]* | ?:[\\/]*) @@ -11439,74 +12116,82 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GPERF="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done ;; esac fi GPERF=$ac_cv_path_GPERF + if test -n "$GPERF"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GPERF" >&5 -$as_echo "$GPERF" >&6; } + echo "$as_me:$LINENO: result: $GPERF" >&5 +echo "${ECHO_T}$GPERF" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test -z "$GPERF"; then - as_fn_error "gperf not found but needed. Install it." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: gperf not found but needed. Install it." >&5 +echo "$as_me: error: gperf not found but needed. Install it." >&2;} + { (exit 1); exit 1; }; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking gperf version" >&5 -$as_echo_n "checking gperf version... " >&6; } +echo "$as_me:$LINENO: checking gperf version" >&5 +echo $ECHO_N "checking gperf version... $ECHO_C" >&6 if test "`$GPERF --version | $EGREP ^GNU\ gperf | $AWK '{ print $3 }' | cut -d. -f1`" -ge "3"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5 -$as_echo "OK" >&6; } + echo "$as_me:$LINENO: result: OK" >&5 +echo "${ECHO_T}OK" >&6 else - as_fn_error "too old, you need at least 3.0.0" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: too old, you need at least 3.0.0" >&5 +echo "$as_me: error: too old, you need at least 3.0.0" >&2;} + { (exit 1); exit 1; }; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build the ODK" >&5 -$as_echo_n "checking whether to build the ODK... " >&6; } +echo "$as_me:$LINENO: checking whether to build the ODK" >&5 +echo $ECHO_N "checking whether to build the ODK... $ECHO_C" >&6 if test "z$enable_odk" = "z" -o "$enable_odk" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 if test "$WITH_JAVA" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for external/unowinreg/unowinreg.dll" >&5 -$as_echo_n "checking for external/unowinreg/unowinreg.dll... " >&6; } + echo "$as_me:$LINENO: checking for external/unowinreg/unowinreg.dll" >&5 +echo $ECHO_N "checking for external/unowinreg/unowinreg.dll... $ECHO_C" >&6 if ! test -f "./external/unowinreg/unowinreg.dll"; then HAVE_UNOWINREG_DLL=no else HAVE_UNOWINREG_DLL=yes fi if test "$HAVE_UNOWINREG_DLL" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 -$as_echo "found" >&6; } + echo "$as_me:$LINENO: result: found" >&5 +echo "${ECHO_T}found" >&6 BUILD_UNOWINREG=NO else if test "$_os" = "WINNT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found, will be built" >&5 -$as_echo "not found, will be built" >&6; } + echo "$as_me:$LINENO: result: not found, will be built" >&5 +echo "${ECHO_T}not found, will be built" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: not found, will be cross-built using mingw32" >&5 -$as_echo "$as_me: WARNING: not found, will be cross-built using mingw32" >&2;} + { echo "$as_me:$LINENO: WARNING: not found, will be cross-built using mingw32" >&5 +echo "$as_me: WARNING: not found, will be cross-built using mingw32" >&2;} fi BUILD_UNOWINREG=YES fi if test "$_os" != "WINNT" && test "$BUILD_UNOWINREG" = "YES"; then if test -z "$WITH_MINGWIN" || test "$WITH_MINGWIN" = "0"; then - as_fn_error "for rebuilding unowinreg.dll you need the mingw32 C++ compiler. + { { echo "$as_me:$LINENO: error: for rebuilding unowinreg.dll you need the mingw32 C++ compiler. Specify mingw32 g++ executable name with --with-mingwin. Or use prebuilt one from http://tools.openoffice.org/unowinreg_prebuild/680/ and - put it into external/unowinreg" "$LINENO" 5 + put it into external/unowinreg" >&5 +echo "$as_me: error: for rebuilding unowinreg.dll you need the mingw32 C++ compiler. + Specify mingw32 g++ executable name with --with-mingwin. + Or use prebuilt one from http://tools.openoffice.org/unowinreg_prebuild/680/ and + put it into external/unowinreg" >&2;} + { (exit 1); exit 1; }; } fi if echo "$WITH_MINGWIN" | $EGREP -q "/"; then if ! test -x "$WITH_MINGWIN"; then MINGWCXX=false; else MINGWCXX=`basename $WITH_MINGWIN`; fi @@ -11514,10 +12199,10 @@ $as_echo "$as_me: WARNING: not found, will be cross-built using mingw32" >&2;} if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}$WITH_MINGWIN", so it can be a program name with args. set dummy ${ac_tool_prefix}$WITH_MINGWIN; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_MINGWCXX+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_MINGWCXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$MINGWCXX"; then ac_cv_prog_MINGWCXX="$MINGWCXX" # Let the user override the test. @@ -11527,37 +12212,35 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MINGWCXX="${ac_tool_prefix}$WITH_MINGWIN" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done fi fi MINGWCXX=$ac_cv_prog_MINGWCXX if test -n "$MINGWCXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MINGWCXX" >&5 -$as_echo "$MINGWCXX" >&6; } + echo "$as_me:$LINENO: result: $MINGWCXX" >&5 +echo "${ECHO_T}$MINGWCXX" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test -z "$ac_cv_prog_MINGWCXX"; then ac_ct_MINGWCXX=$MINGWCXX # Extract the first word of "$WITH_MINGWIN", so it can be a program name with args. set dummy $WITH_MINGWIN; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_MINGWCXX+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_MINGWCXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_MINGWCXX"; then ac_cv_prog_ac_ct_MINGWCXX="$ac_ct_MINGWCXX" # Let the user override the test. @@ -11567,53 +12250,47 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MINGWCXX="$WITH_MINGWIN" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done + test -z "$ac_cv_prog_ac_ct_MINGWCXX" && ac_cv_prog_ac_ct_MINGWCXX="false" fi fi ac_ct_MINGWCXX=$ac_cv_prog_ac_ct_MINGWCXX if test -n "$ac_ct_MINGWCXX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MINGWCXX" >&5 -$as_echo "$ac_ct_MINGWCXX" >&6; } + echo "$as_me:$LINENO: result: $ac_ct_MINGWCXX" >&5 +echo "${ECHO_T}$ac_ct_MINGWCXX" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test "x$ac_ct_MINGWCXX" = x; then - MINGWCXX="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - MINGWCXX=$ac_ct_MINGWCXX - fi + MINGWCXX=$ac_ct_MINGWCXX else MINGWCXX="$ac_cv_prog_MINGWCXX" fi fi if test "$MINGWCXX" = "false"; then - as_fn_error "specified MinGW32 C++ cross-compiler not found. Install it or correct name." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: specified MinGW32 C++ cross-compiler not found. Install it or correct name." >&5 +echo "$as_me: error: specified MinGW32 C++ cross-compiler not found. Install it or correct name." >&2;} + { (exit 1); exit 1; }; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the MinGW32 cross C++ compiler" >&5 -$as_echo_n "checking whether we are using the MinGW32 cross C++ compiler... " >&6; } + echo "$as_me:$LINENO: checking whether we are using the MinGW32 cross C++ compiler" >&5 +echo $ECHO_N "checking whether we are using the MinGW32 cross C++ compiler... $ECHO_C" >&6 if ! echo "`$MINGWCXX -dumpmachine`" | grep -q mingw32; then - as_fn_error "no" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: no" >&5 +echo "$as_me: error: no" >&2;} + { (exit 1); exit 1; }; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 fi if echo "$WITH_MINGWIN" | $EGREP -q "/"; then if ! test -x "`echo $WITH_MINGWIN | $SED -e s/g++/strip/`"; then MINGSTRIP=false; else MINGWSTRIP=$(basename $(echo $WITH_MINGWIN | $SED -e s/g++/strip/)); fi @@ -11621,10 +12298,10 @@ $as_echo "yes" >&6; } if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}`echo $WITH_MINGWIN | $SED -e s/g++/strip/`", so it can be a program name with args. set dummy ${ac_tool_prefix}`echo $WITH_MINGWIN | $SED -e s/g++/strip/`; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_MINGWSTRIP+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_MINGWSTRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$MINGWSTRIP"; then ac_cv_prog_MINGWSTRIP="$MINGWSTRIP" # Let the user override the test. @@ -11634,37 +12311,35 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MINGWSTRIP="${ac_tool_prefix}`echo $WITH_MINGWIN | $SED -e s/g++/strip/`" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done fi fi MINGWSTRIP=$ac_cv_prog_MINGWSTRIP if test -n "$MINGWSTRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MINGWSTRIP" >&5 -$as_echo "$MINGWSTRIP" >&6; } + echo "$as_me:$LINENO: result: $MINGWSTRIP" >&5 +echo "${ECHO_T}$MINGWSTRIP" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test -z "$ac_cv_prog_MINGWSTRIP"; then ac_ct_MINGWSTRIP=$MINGWSTRIP # Extract the first word of "`echo $WITH_MINGWIN | $SED -e s/g++/strip/`", so it can be a program name with args. set dummy `echo $WITH_MINGWIN | $SED -e s/g++/strip/`; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_MINGWSTRIP+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_MINGWSTRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_MINGWSTRIP"; then ac_cv_prog_ac_ct_MINGWSTRIP="$ac_ct_MINGWSTRIP" # Let the user override the test. @@ -11674,47 +12349,39 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MINGWSTRIP="`echo $WITH_MINGWIN | $SED -e s/g++/strip/`" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done + test -z "$ac_cv_prog_ac_ct_MINGWSTRIP" && ac_cv_prog_ac_ct_MINGWSTRIP="false" fi fi ac_ct_MINGWSTRIP=$ac_cv_prog_ac_ct_MINGWSTRIP if test -n "$ac_ct_MINGWSTRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MINGWSTRIP" >&5 -$as_echo "$ac_ct_MINGWSTRIP" >&6; } + echo "$as_me:$LINENO: result: $ac_ct_MINGWSTRIP" >&5 +echo "${ECHO_T}$ac_ct_MINGWSTRIP" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test "x$ac_ct_MINGWSTRIP" = x; then - MINGWSTRIP="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - MINGWSTRIP=$ac_ct_MINGWSTRIP - fi + MINGWSTRIP=$ac_ct_MINGWSTRIP else MINGWSTRIP="$ac_cv_prog_MINGWSTRIP" fi fi if test "$MINGWSTRIP" = "false"; then - as_fn_error "MinGW32 binutils needed. Install them." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: MinGW32 binutils needed. Install them." >&5 +echo "$as_me: error: MinGW32 binutils needed. Install them." >&2;} + { (exit 1); exit 1; }; } fi - ac_ext=cpp + ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -11732,37 +12399,66 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu # do not make sense here (and 'd make the check fail) save_LIBS=$LIBS LIBS="" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lkernel32" >&5 -$as_echo_n "checking for main in -lkernel32... " >&6; } -if test "${ac_cv_lib_kernel32_main+set}" = set; then : - $as_echo_n "(cached) " >&6 + +echo "$as_me:$LINENO: checking for main in -lkernel32" >&5 +echo $ECHO_N "checking for main in -lkernel32... $ECHO_C" >&6 +if test "${ac_cv_lib_kernel32_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lkernel32 $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { -return main (); +main (); ; return 0; } _ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_kernel32_main=yes else - ac_cv_lib_kernel32_main=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_kernel32_main=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_kernel32_main" >&5 -$as_echo "$ac_cv_lib_kernel32_main" >&6; } -if test "x$ac_cv_lib_kernel32_main" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_kernel32_main" >&5 +echo "${ECHO_T}$ac_cv_lib_kernel32_main" >&6 +if test $ac_cv_lib_kernel32_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBKERNEL32 1 _ACEOF @@ -11772,37 +12468,66 @@ _ACEOF fi ac_cv_lib_kernel32=ac_cv_lib_kernel32_main - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -ladvapi32" >&5 -$as_echo_n "checking for main in -ladvapi32... " >&6; } -if test "${ac_cv_lib_advapi32_main+set}" = set; then : - $as_echo_n "(cached) " >&6 + +echo "$as_me:$LINENO: checking for main in -ladvapi32" >&5 +echo $ECHO_N "checking for main in -ladvapi32... $ECHO_C" >&6 +if test "${ac_cv_lib_advapi32_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ladvapi32 $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { -return main (); +main (); ; return 0; } _ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_advapi32_main=yes else - ac_cv_lib_advapi32_main=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_advapi32_main=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_advapi32_main" >&5 -$as_echo "$ac_cv_lib_advapi32_main" >&6; } -if test "x$ac_cv_lib_advapi32_main" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_advapi32_main" >&5 +echo "${ECHO_T}$ac_cv_lib_advapi32_main" >&6 +if test $ac_cv_lib_advapi32_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBADVAPI32 1 _ACEOF @@ -11812,11 +12537,149 @@ _ACEOF fi ac_cv_lib_advapi32=ac_cv_lib_advapi32_main - ac_fn_cxx_check_header_mongrel "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default" -if test "x$ac_cv_header_windows_h" = x""yes; then : + if test "${ac_cv_header_windows_h+set}" = set; then + echo "$as_me:$LINENO: checking for windows.h" >&5 +echo $ECHO_N "checking for windows.h... $ECHO_C" >&6 +if test "${ac_cv_header_windows_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_windows_h" >&5 +echo "${ECHO_T}$ac_cv_header_windows_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking windows.h usability" >&5 +echo $ECHO_N "checking windows.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking windows.h presence" >&5 +echo $ECHO_N "checking windows.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: windows.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: windows.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: windows.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: windows.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: windows.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: windows.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: windows.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: windows.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: windows.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: windows.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: windows.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: windows.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: windows.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: windows.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: windows.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: windows.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for windows.h" >&5 +echo $ECHO_N "checking for windows.h... $ECHO_C" >&6 +if test "${ac_cv_header_windows_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_windows_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_windows_h" >&5 +echo "${ECHO_T}$ac_cv_header_windows_h" >&6 +fi +if test $ac_cv_header_windows_h = yes; then + : else - as_fn_error "windows.h missing" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: windows.h missing" >&5 +echo "$as_me: error: windows.h missing" >&2;} + { (exit 1); exit 1; }; } fi @@ -11835,25 +12698,25 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi BUILD_TYPE="$BUILD_TYPE ODK" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 BUILD_UNOWINREG=NO fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build qadevOOo" >&5 -$as_echo_n "checking whether to build qadevOOo... " >&6; } +echo "$as_me:$LINENO: checking whether to build qadevOOo" >&5 +echo $ECHO_N "checking whether to build qadevOOo... $ECHO_C" >&6 if test "z$enable_qadevooo" = "z" -o "$enable_qadevooo" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 BUILD_QADEVOOO="YES" BUILD_TYPE="$BUILD_TYPE QADEVOOO" else BUILD_QADEVOOO="NO" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi @@ -11861,218 +12724,719 @@ if test "$_os" = "Linux" -a -z "$with_system_stdlibs" -a -z "$with_system_libs"; if test -n "$checkforstdlibproblems"; then if test -f /etc/rpm/macros.prelink; then with_system_stdlibs=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: prelinked libgcc_s.so.1, enabling --with-system-stdlibs, use --without-system-stdlibs to override" >&5 -$as_echo "$as_me: WARNING: prelinked libgcc_s.so.1, enabling --with-system-stdlibs, use --without-system-stdlibs to override" >&2;} + { echo "$as_me:$LINENO: WARNING: prelinked libgcc_s.so.1, enabling --with-system-stdlibs, use --without-system-stdlibs to override" >&5 +echo "$as_me: WARNING: prelinked libgcc_s.so.1, enabling --with-system-stdlibs, use --without-system-stdlibs to override" >&2;} echo "prelinked libgcc_s.so.1, enabling --with-system-stdlibs, use --without-system-stdlibs to override" >> warn elif test "$GCC" = "yes" -a ! -e `$CC -print-file-name=libgcc_s.so.1`; then with_system_stdlibs=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: platform doesn't have a libgcc_s.so.1, enabling --with-system-stdlibs, use --without-system-stdlibs to override" >&5 -$as_echo "$as_me: WARNING: platform doesn't have a libgcc_s.so.1, enabling --with-system-stdlibs, use --without-system-stdlibs to override" >&2;} + { echo "$as_me:$LINENO: WARNING: platform doesn't have a libgcc_s.so.1, enabling --with-system-stdlibs, use --without-system-stdlibs to override" >&5 +echo "$as_me: WARNING: platform doesn't have a libgcc_s.so.1, enabling --with-system-stdlibs, use --without-system-stdlibs to override" >&2;} echo "platform doesn't have a libgcc_s.so.1, enabling --with-system-stdlibs, use --without-system-stdlibs to override" >> warn fi fi -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to provide libstdc++/libgcc_s in the installset" >&5 -$as_echo_n "checking whether to provide libstdc++/libgcc_s in the installset... " >&6; } -if test -n "$with_system_stdlibs" -o -n "$with_system_libs" && \ - test "$with_system_stdlibs" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - SYSTEM_STDLIBS=YES +fi + +echo "$as_me:$LINENO: checking whether to provide libstdc++/libgcc_s in the installset" >&5 +echo $ECHO_N "checking whether to provide libstdc++/libgcc_s in the installset... $ECHO_C" >&6 +if test -n "$with_system_stdlibs" -o -n "$with_system_libs" && \ + test "$with_system_stdlibs" != "no"; then + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + SYSTEM_STDLIBS=YES +else + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + SYSTEM_STDLIBS=NO +fi + + +if test "$_os" = "Darwin" && test "$with_system_zlib" != "no"; then + with_system_zlib=yes +fi +echo "$as_me:$LINENO: checking which zlib to use" >&5 +echo $ECHO_N "checking which zlib to use... $ECHO_C" >&6 +if test -n "$with_system_zlib" -o -n "$with_system_libs" && \ + test "$with_system_zlib" != "no"; then + echo "$as_me:$LINENO: result: external" >&5 +echo "${ECHO_T}external" >&6 + SYSTEM_ZLIB=YES + if test "${ac_cv_header_zlib_h+set}" = set; then + echo "$as_me:$LINENO: checking for zlib.h" >&5 +echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6 +if test "${ac_cv_header_zlib_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 +echo "${ECHO_T}$ac_cv_header_zlib_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking zlib.h usability" >&5 +echo $ECHO_N "checking zlib.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking zlib.h presence" >&5 +echo $ECHO_N "checking zlib.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - SYSTEM_STDLIBS=NO + ac_cpp_err=yes fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 -if test "$_os" = "Darwin" && test "$with_system_zlib" != "no"; then - with_system_zlib=yes +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: zlib.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: zlib.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: zlib.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: zlib.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: zlib.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: zlib.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: zlib.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for zlib.h" >&5 +echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6 +if test "${ac_cv_header_zlib_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_zlib_h=$ac_header_preproc fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which zlib to use" >&5 -$as_echo_n "checking which zlib to use... " >&6; } -if test -n "$with_system_zlib" -o -n "$with_system_libs" && \ - test "$with_system_zlib" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 -$as_echo "external" >&6; } - SYSTEM_ZLIB=YES - ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" -if test "x$ac_cv_header_zlib_h" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 +echo "${ECHO_T}$ac_cv_header_zlib_h" >&6 +fi +if test $ac_cv_header_zlib_h = yes; then + : else - as_fn_error "zlib.h not found. install zlib" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: zlib.h not found. install zlib" >&5 +echo "$as_me: error: zlib.h not found. install zlib" >&2;} + { (exit 1); exit 1; }; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for deflate in -lz" >&5 -$as_echo_n "checking for deflate in -lz... " >&6; } -if test "${ac_cv_lib_z_deflate+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for deflate in -lz" >&5 +echo $ECHO_N "checking for deflate in -lz... $ECHO_C" >&6 +if test "${ac_cv_lib_z_deflate+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char deflate (); int main () { -return deflate (); +deflate (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_z_deflate=yes else - ac_cv_lib_z_deflate=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_z_deflate=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_deflate" >&5 -$as_echo "$ac_cv_lib_z_deflate" >&6; } -if test "x$ac_cv_lib_z_deflate" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_z_deflate" >&5 +echo "${ECHO_T}$ac_cv_lib_z_deflate" >&6 +if test $ac_cv_lib_z_deflate = yes; then ZLIB=-lz else - as_fn_error "zlib not found or functional" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: zlib not found or functional" >&5 +echo "$as_me: error: zlib not found or functional" >&2;} + { (exit 1); exit 1; }; } fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 -$as_echo "internal" >&6; } + echo "$as_me:$LINENO: result: internal" >&5 +echo "${ECHO_T}internal" >&6 SYSTEM_ZLIB=NO BUILD_TYPE="$BUILD_TYPE ZLIB" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which jpeg to use" >&5 -$as_echo_n "checking which jpeg to use... " >&6; } +echo "$as_me:$LINENO: checking which jpeg to use" >&5 +echo $ECHO_N "checking which jpeg to use... $ECHO_C" >&6 if test -n "$with_system_jpeg" -o -n "$with_system_libs" && \ test "$with_system_jpeg" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 -$as_echo "external" >&6; } + echo "$as_me:$LINENO: result: external" >&5 +echo "${ECHO_T}external" >&6 SYSTEM_JPEG=YES - ac_fn_c_check_header_mongrel "$LINENO" "jpeglib.h" "ac_cv_header_jpeglib_h" "$ac_includes_default" -if test "x$ac_cv_header_jpeglib_h" = x""yes; then : + if test "${ac_cv_header_jpeglib_h+set}" = set; then + echo "$as_me:$LINENO: checking for jpeglib.h" >&5 +echo $ECHO_N "checking for jpeglib.h... $ECHO_C" >&6 +if test "${ac_cv_header_jpeglib_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_jpeglib_h" >&5 +echo "${ECHO_T}$ac_cv_header_jpeglib_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking jpeglib.h usability" >&5 +echo $ECHO_N "checking jpeglib.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking jpeglib.h presence" >&5 +echo $ECHO_N "checking jpeglib.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: jpeglib.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: jpeglib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: jpeglib.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: jpeglib.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: jpeglib.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: jpeglib.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: jpeglib.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: jpeglib.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: jpeglib.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: jpeglib.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: jpeglib.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: jpeglib.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: jpeglib.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: jpeglib.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: jpeglib.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: jpeglib.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for jpeglib.h" >&5 +echo $ECHO_N "checking for jpeglib.h... $ECHO_C" >&6 +if test "${ac_cv_header_jpeglib_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_jpeglib_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_jpeglib_h" >&5 +echo "${ECHO_T}$ac_cv_header_jpeglib_h" >&6 +fi +if test $ac_cv_header_jpeglib_h = yes; then + : else - as_fn_error "jpeg.h not found. install libjpeg" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: jpeg.h not found. install libjpeg" >&5 +echo "$as_me: error: jpeg.h not found. install libjpeg" >&2;} + { (exit 1); exit 1; }; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jpeg_resync_to_restart in -ljpeg" >&5 -$as_echo_n "checking for jpeg_resync_to_restart in -ljpeg... " >&6; } -if test "${ac_cv_lib_jpeg_jpeg_resync_to_restart+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for jpeg_resync_to_restart in -ljpeg" >&5 +echo $ECHO_N "checking for jpeg_resync_to_restart in -ljpeg... $ECHO_C" >&6 +if test "${ac_cv_lib_jpeg_jpeg_resync_to_restart+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ljpeg $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char jpeg_resync_to_restart (); int main () { -return jpeg_resync_to_restart (); +jpeg_resync_to_restart (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_jpeg_jpeg_resync_to_restart=yes else - ac_cv_lib_jpeg_jpeg_resync_to_restart=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_jpeg_jpeg_resync_to_restart=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_jpeg_resync_to_restart" >&5 -$as_echo "$ac_cv_lib_jpeg_jpeg_resync_to_restart" >&6; } -if test "x$ac_cv_lib_jpeg_jpeg_resync_to_restart" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_jpeg_jpeg_resync_to_restart" >&5 +echo "${ECHO_T}$ac_cv_lib_jpeg_jpeg_resync_to_restart" >&6 +if test $ac_cv_lib_jpeg_jpeg_resync_to_restart = yes; then JPEG3RDLIB=-ljpeg else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking jpeg library not found or fuctional" >&5 -$as_echo_n "checking jpeg library not found or fuctional... " >&6; } + echo "$as_me:$LINENO: checking jpeg library not found or fuctional" >&5 +echo $ECHO_N "checking jpeg library not found or fuctional... $ECHO_C" >&6 fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 -$as_echo "internal" >&6; } + echo "$as_me:$LINENO: result: internal" >&5 +echo "${ECHO_T}internal" >&6 SYSTEM_JPEG=NO BUILD_TYPE="$BUILD_TYPE JPEG" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which expat to use" >&5 -$as_echo_n "checking which expat to use... " >&6; } +echo "$as_me:$LINENO: checking which expat to use" >&5 +echo $ECHO_N "checking which expat to use... $ECHO_C" >&6 if test -n "$with_system_expat" -o -n "$with_system_libs" && \ test "$with_system_expat" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 -$as_echo "external" >&6; } + echo "$as_me:$LINENO: result: external" >&5 +echo "${ECHO_T}external" >&6 SYSTEM_EXPAT=YES - ac_fn_c_check_header_mongrel "$LINENO" "expat.h" "ac_cv_header_expat_h" "$ac_includes_default" -if test "x$ac_cv_header_expat_h" = x""yes; then : + if test "${ac_cv_header_expat_h+set}" = set; then + echo "$as_me:$LINENO: checking for expat.h" >&5 +echo $ECHO_N "checking for expat.h... $ECHO_C" >&6 +if test "${ac_cv_header_expat_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_expat_h" >&5 +echo "${ECHO_T}$ac_cv_header_expat_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking expat.h usability" >&5 +echo $ECHO_N "checking expat.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking expat.h presence" >&5 +echo $ECHO_N "checking expat.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: expat.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: expat.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: expat.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: expat.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: expat.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: expat.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: expat.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: expat.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: expat.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: expat.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: expat.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: expat.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: expat.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: expat.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: expat.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: expat.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for expat.h" >&5 +echo $ECHO_N "checking for expat.h... $ECHO_C" >&6 +if test "${ac_cv_header_expat_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_expat_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_expat_h" >&5 +echo "${ECHO_T}$ac_cv_header_expat_h" >&6 +fi +if test $ac_cv_header_expat_h = yes; then + : else - as_fn_error "expat.h not found. install expat" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: expat.h not found. install expat" >&5 +echo "$as_me: error: expat.h not found. install expat" >&2;} + { (exit 1); exit 1; }; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XML_ParserCreate in -lexpat" >&5 -$as_echo_n "checking for XML_ParserCreate in -lexpat... " >&6; } -if test "${ac_cv_lib_expat_XML_ParserCreate+set}" = set; then : - $as_echo_n "(cached) " >&6 + +echo "$as_me:$LINENO: checking for XML_ParserCreate in -lexpat" >&5 +echo $ECHO_N "checking for XML_ParserCreate in -lexpat... $ECHO_C" >&6 +if test "${ac_cv_lib_expat_XML_ParserCreate+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lexpat $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char XML_ParserCreate (); int main () { -return XML_ParserCreate (); +XML_ParserCreate (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_expat_XML_ParserCreate=yes else - ac_cv_lib_expat_XML_ParserCreate=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_expat_XML_ParserCreate=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_expat_XML_ParserCreate" >&5 -$as_echo "$ac_cv_lib_expat_XML_ParserCreate" >&6; } -if test "x$ac_cv_lib_expat_XML_ParserCreate" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_expat_XML_ParserCreate" >&5 +echo "${ECHO_T}$ac_cv_lib_expat_XML_ParserCreate" >&6 +if test $ac_cv_lib_expat_XML_ParserCreate = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBEXPAT 1 _ACEOF @@ -12080,24 +13444,24 @@ _ACEOF LIBS="-lexpat $LIBS" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: expat library not found or functional." >&5 -$as_echo "expat library not found or functional." >&6; } + echo "$as_me:$LINENO: result: expat library not found or functional." >&5 +echo "${ECHO_T}expat library not found or functional." >&6 fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 -$as_echo "internal" >&6; } + echo "$as_me:$LINENO: result: internal" >&5 +echo "${ECHO_T}internal" >&6 SYSTEM_EXPAT=NO BUILD_TYPE="$BUILD_TYPE EXPAT" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which libwpd to use" >&5 -$as_echo_n "checking which libwpd to use... " >&6; } +echo "$as_me:$LINENO: checking which libwpd to use" >&5 +echo $ECHO_N "checking which libwpd to use... $ECHO_C" >&6 if test -n "$with_system_libwpd" -o -n "$with_system_libs" && \ test "$with_system_libwpd" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 -$as_echo "external" >&6; } + echo "$as_me:$LINENO: result: external" >&5 +echo "${ECHO_T}external" >&6 SYSTEM_LIBWPD=YES succeeded=no @@ -12105,10 +13469,10 @@ $as_echo "external" >&6; } if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -12120,30 +13484,29 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG + if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test "$PKG_CONFIG" = "no" ; then @@ -12154,25 +13517,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libwpd-0.8 " >&5 -$as_echo_n "checking for libwpd-0.8 ... " >&6; } + echo "$as_me:$LINENO: checking for libwpd-0.8 " >&5 +echo $ECHO_N "checking for libwpd-0.8 ... $ECHO_C" >&6 if $PKG_CONFIG --exists "libwpd-0.8 " ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 succeeded=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking LIBWPD_CFLAGS" >&5 -$as_echo_n "checking LIBWPD_CFLAGS... " >&6; } + echo "$as_me:$LINENO: checking LIBWPD_CFLAGS" >&5 +echo $ECHO_N "checking LIBWPD_CFLAGS... $ECHO_C" >&6 LIBWPD_CFLAGS=`$PKG_CONFIG --cflags "libwpd-0.8 "` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBWPD_CFLAGS" >&5 -$as_echo "$LIBWPD_CFLAGS" >&6; } + echo "$as_me:$LINENO: result: $LIBWPD_CFLAGS" >&5 +echo "${ECHO_T}$LIBWPD_CFLAGS" >&6 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking LIBWPD_LIBS" >&5 -$as_echo_n "checking LIBWPD_LIBS... " >&6; } + echo "$as_me:$LINENO: checking LIBWPD_LIBS" >&5 +echo $ECHO_N "checking LIBWPD_LIBS... $ECHO_C" >&6 LIBWPD_LIBS=`$PKG_CONFIG --libs "libwpd-0.8 "` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBWPD_LIBS" >&5 -$as_echo "$LIBWPD_LIBS" >&6; } + echo "$as_me:$LINENO: result: $LIBWPD_LIBS" >&5 +echo "${ECHO_T}$LIBWPD_LIBS" >&6 else LIBWPD_CFLAGS="" LIBWPD_LIBS="" @@ -12193,12 +13556,14 @@ $as_echo "$LIBWPD_LIBS" >&6; } if test $succeeded = yes; then : else - as_fn_error "Library requirements (libwpd-0.8 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Library requirements (libwpd-0.8 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 +echo "$as_me: error: Library requirements (libwpd-0.8 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} + { (exit 1); exit 1; }; } fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 -$as_echo "internal" >&6; } + echo "$as_me:$LINENO: result: internal" >&5 +echo "${ECHO_T}internal" >&6 SYSTEM_LIBWPD=NO BUILD_TYPE="$BUILD_TYPE LIBWPD" fi @@ -12207,18 +13572,18 @@ fi if test "$test_freetype" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether freetype is available" >&5 -$as_echo_n "checking whether freetype is available... " >&6; } + echo "$as_me:$LINENO: checking whether freetype is available" >&5 +echo $ECHO_N "checking whether freetype is available... $ECHO_C" >&6 succeeded=no if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -12230,30 +13595,29 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG + if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test "$PKG_CONFIG" = "no" ; then @@ -12264,25 +13628,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for freetype2 >= 2.0 " >&5 -$as_echo_n "checking for freetype2 >= 2.0 ... " >&6; } + echo "$as_me:$LINENO: checking for freetype2 >= 2.0 " >&5 +echo $ECHO_N "checking for freetype2 >= 2.0 ... $ECHO_C" >&6 if $PKG_CONFIG --exists "freetype2 >= 2.0 " ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 succeeded=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking FREETYPE_CFLAGS" >&5 -$as_echo_n "checking FREETYPE_CFLAGS... " >&6; } + echo "$as_me:$LINENO: checking FREETYPE_CFLAGS" >&5 +echo $ECHO_N "checking FREETYPE_CFLAGS... $ECHO_C" >&6 FREETYPE_CFLAGS=`$PKG_CONFIG --cflags "freetype2 >= 2.0 "` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_CFLAGS" >&5 -$as_echo "$FREETYPE_CFLAGS" >&6; } + echo "$as_me:$LINENO: result: $FREETYPE_CFLAGS" >&5 +echo "${ECHO_T}$FREETYPE_CFLAGS" >&6 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking FREETYPE_LIBS" >&5 -$as_echo_n "checking FREETYPE_LIBS... " >&6; } + echo "$as_me:$LINENO: checking FREETYPE_LIBS" >&5 +echo $ECHO_N "checking FREETYPE_LIBS... $ECHO_C" >&6 FREETYPE_LIBS=`$PKG_CONFIG --libs "freetype2 >= 2.0 "` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FREETYPE_LIBS" >&5 -$as_echo "$FREETYPE_LIBS" >&6; } + echo "$as_me:$LINENO: result: $FREETYPE_LIBS" >&5 +echo "${ECHO_T}$FREETYPE_LIBS" >&6 else FREETYPE_CFLAGS="" FREETYPE_LIBS="" @@ -12303,7 +13667,9 @@ $as_echo "$FREETYPE_LIBS" >&6; } if test $succeeded = yes; then : else - as_fn_error "Library requirements (freetype2 >= 2.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Library requirements (freetype2 >= 2.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 +echo "$as_me: error: Library requirements (freetype2 >= 2.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} + { (exit 1); exit 1; }; } fi fi @@ -12316,43 +13682,71 @@ if test "$test_freetype" = "yes"; then save_LIBS="$LIBS" CPPFLAGS="$CPPFLAGS $FREETYPE_CFLAGS" LDFLAGS="$LDFLAGS $FREETYPE_LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FT_GlyphSlot_Embolden in -lfreetype" >&5 -$as_echo_n "checking for FT_GlyphSlot_Embolden in -lfreetype... " >&6; } -if test "${ac_cv_lib_freetype_FT_GlyphSlot_Embolden+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for FT_GlyphSlot_Embolden in -lfreetype" >&5 +echo $ECHO_N "checking for FT_GlyphSlot_Embolden in -lfreetype... $ECHO_C" >&6 +if test "${ac_cv_lib_freetype_FT_GlyphSlot_Embolden+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfreetype $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char FT_GlyphSlot_Embolden (); int main () { -return FT_GlyphSlot_Embolden (); +FT_GlyphSlot_Embolden (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_freetype_FT_GlyphSlot_Embolden=yes else - ac_cv_lib_freetype_FT_GlyphSlot_Embolden=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_freetype_FT_GlyphSlot_Embolden=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_freetype_FT_GlyphSlot_Embolden" >&5 -$as_echo "$ac_cv_lib_freetype_FT_GlyphSlot_Embolden" >&6; } -if test "x$ac_cv_lib_freetype_FT_GlyphSlot_Embolden" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_freetype_FT_GlyphSlot_Embolden" >&5 +echo "${ECHO_T}$ac_cv_lib_freetype_FT_GlyphSlot_Embolden" >&6 +if test $ac_cv_lib_freetype_FT_GlyphSlot_Embolden = yes; then USE_FT_EMBOLDEN="YES" else USE_FT_EMBOLDEN="NO" @@ -12385,26 +13779,26 @@ if test -n "$with_system_libxml" -o -n "$with_system_libs" && \ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which libxslt to use" >&5 -$as_echo_n "checking which libxslt to use... " >&6; } +echo "$as_me:$LINENO: checking which libxslt to use" >&5 +echo $ECHO_N "checking which libxslt to use... $ECHO_C" >&6 if test -n "$with_system_libxslt" -o -n "$with_system_libs" -o \ "$_os" = "Darwin" && \ test "$with_system_libxslt" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 -$as_echo "external" >&6; } + echo "$as_me:$LINENO: result: external" >&5 +echo "${ECHO_T}external" >&6 SYSTEM_LIBXSLT=YES if test "$_os" = "Darwin"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking LIBXSLT_CFLAGS" >&5 -$as_echo_n "checking LIBXSLT_CFLAGS... " >&6; } + echo "$as_me:$LINENO: checking LIBXSLT_CFLAGS" >&5 +echo $ECHO_N "checking LIBXSLT_CFLAGS... $ECHO_C" >&6 LIBXSLT_CFLAGS=`xslt-config --cflags` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBXSLT_CFLAGS" >&5 -$as_echo "$LIBXSLT_CFLAGS" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking LIBXSLT_LIBS" >&5 -$as_echo_n "checking LIBXSLT_LIBS... " >&6; } + echo "$as_me:$LINENO: result: $LIBXSLT_CFLAGS" >&5 +echo "${ECHO_T}$LIBXSLT_CFLAGS" >&6 + echo "$as_me:$LINENO: checking LIBXSLT_LIBS" >&5 +echo $ECHO_N "checking LIBXSLT_LIBS... $ECHO_C" >&6 LIBXSLT_LIBS=`xslt-config --libs` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBXSLT_LIBS" >&5 -$as_echo "$LIBXSLT_LIBS" >&6; } + echo "$as_me:$LINENO: result: $LIBXSLT_LIBS" >&5 +echo "${ECHO_T}$LIBXSLT_LIBS" >&6 else @@ -12414,10 +13808,10 @@ $as_echo "$LIBXSLT_LIBS" >&6; } if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -12429,30 +13823,29 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG + if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test "$PKG_CONFIG" = "no" ; then @@ -12463,25 +13856,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libxslt" >&5 -$as_echo_n "checking for libxslt... " >&6; } + echo "$as_me:$LINENO: checking for libxslt" >&5 +echo $ECHO_N "checking for libxslt... $ECHO_C" >&6 if $PKG_CONFIG --exists "libxslt" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 succeeded=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking LIBXSLT_CFLAGS" >&5 -$as_echo_n "checking LIBXSLT_CFLAGS... " >&6; } + echo "$as_me:$LINENO: checking LIBXSLT_CFLAGS" >&5 +echo $ECHO_N "checking LIBXSLT_CFLAGS... $ECHO_C" >&6 LIBXSLT_CFLAGS=`$PKG_CONFIG --cflags "libxslt"` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBXSLT_CFLAGS" >&5 -$as_echo "$LIBXSLT_CFLAGS" >&6; } + echo "$as_me:$LINENO: result: $LIBXSLT_CFLAGS" >&5 +echo "${ECHO_T}$LIBXSLT_CFLAGS" >&6 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking LIBXSLT_LIBS" >&5 -$as_echo_n "checking LIBXSLT_LIBS... " >&6; } + echo "$as_me:$LINENO: checking LIBXSLT_LIBS" >&5 +echo $ECHO_N "checking LIBXSLT_LIBS... $ECHO_C" >&6 LIBXSLT_LIBS=`$PKG_CONFIG --libs "libxslt"` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBXSLT_LIBS" >&5 -$as_echo "$LIBXSLT_LIBS" >&6; } + echo "$as_me:$LINENO: result: $LIBXSLT_LIBS" >&5 +echo "${ECHO_T}$LIBXSLT_LIBS" >&6 else LIBXSLT_CFLAGS="" LIBXSLT_LIBS="" @@ -12502,7 +13895,9 @@ $as_echo "$LIBXSLT_LIBS" >&6; } if test $succeeded = yes; then : else - as_fn_error "Library requirements (libxslt) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Library requirements (libxslt) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 +echo "$as_me: error: Library requirements (libxslt) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} + { (exit 1); exit 1; }; } fi fi @@ -12510,10 +13905,10 @@ $as_echo "$LIBXSLT_LIBS" >&6; } # Extract the first word of "xsltproc", so it can be a program name with args. set dummy xsltproc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_XSLTPROC+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_XSLTPROC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $XSLTPROC in [\\/]* | ?:[\\/]*) @@ -12525,36 +13920,37 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_XSLTPROC="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done test -z "$ac_cv_path_XSLTPROC" && ac_cv_path_XSLTPROC="no" ;; esac fi XSLTPROC=$ac_cv_path_XSLTPROC + if test -n "$XSLTPROC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSLTPROC" >&5 -$as_echo "$XSLTPROC" >&6; } + echo "$as_me:$LINENO: result: $XSLTPROC" >&5 +echo "${ECHO_T}$XSLTPROC" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test "$XSLTPROC" = "no"; then - as_fn_error "xsltproc is required" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: xsltproc is required" >&5 +echo "$as_me: error: xsltproc is required" >&2;} + { (exit 1); exit 1; }; } fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 -$as_echo "internal" >&6; } + echo "$as_me:$LINENO: result: internal" >&5 +echo "${ECHO_T}internal" >&6 SYSTEM_LIBXSLT=NO BUILD_TYPE="$BUILD_TYPE LIBXSLT" fi @@ -12563,25 +13959,25 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which libxml to use" >&5 -$as_echo_n "checking which libxml to use... " >&6; } +echo "$as_me:$LINENO: checking which libxml to use" >&5 +echo $ECHO_N "checking which libxml to use... $ECHO_C" >&6 if test -n "$with_system_libxml" -o -n "$with_system_libs" -o \ "$_os" = "Darwin" && \ test "$with_system_libxml" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 -$as_echo "external" >&6; } + echo "$as_me:$LINENO: result: external" >&5 +echo "${ECHO_T}external" >&6 SYSTEM_LIBXML=YES if test "$_os" = "Darwin"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking LIBXML_CFLAGS" >&5 -$as_echo_n "checking LIBXML_CFLAGS... " >&6; } + echo "$as_me:$LINENO: checking LIBXML_CFLAGS" >&5 +echo $ECHO_N "checking LIBXML_CFLAGS... $ECHO_C" >&6 LIBXML_CFLAGS=`xml2-config --cflags` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBXML_CFLAGS" >&5 -$as_echo "$LIBXML_CFLAGS" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking LIBXML_LIBS" >&5 -$as_echo_n "checking LIBXML_LIBS... " >&6; } + echo "$as_me:$LINENO: result: $LIBXML_CFLAGS" >&5 +echo "${ECHO_T}$LIBXML_CFLAGS" >&6 + echo "$as_me:$LINENO: checking LIBXML_LIBS" >&5 +echo $ECHO_N "checking LIBXML_LIBS... $ECHO_C" >&6 LIBXML_LIBS=`xml2-config --libs` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBXML_LIBS" >&5 -$as_echo "$LIBXML_LIBS" >&6; } + echo "$as_me:$LINENO: result: $LIBXML_LIBS" >&5 +echo "${ECHO_T}$LIBXML_LIBS" >&6 else @@ -12591,10 +13987,10 @@ $as_echo "$LIBXML_LIBS" >&6; } if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -12606,30 +14002,29 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG + if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test "$PKG_CONFIG" = "no" ; then @@ -12640,25 +14035,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libxml-2.0 >= 2.0" >&5 -$as_echo_n "checking for libxml-2.0 >= 2.0... " >&6; } + echo "$as_me:$LINENO: checking for libxml-2.0 >= 2.0" >&5 +echo $ECHO_N "checking for libxml-2.0 >= 2.0... $ECHO_C" >&6 if $PKG_CONFIG --exists "libxml-2.0 >= 2.0" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 succeeded=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking LIBXML_CFLAGS" >&5 -$as_echo_n "checking LIBXML_CFLAGS... " >&6; } + echo "$as_me:$LINENO: checking LIBXML_CFLAGS" >&5 +echo $ECHO_N "checking LIBXML_CFLAGS... $ECHO_C" >&6 LIBXML_CFLAGS=`$PKG_CONFIG --cflags "libxml-2.0 >= 2.0"` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBXML_CFLAGS" >&5 -$as_echo "$LIBXML_CFLAGS" >&6; } + echo "$as_me:$LINENO: result: $LIBXML_CFLAGS" >&5 +echo "${ECHO_T}$LIBXML_CFLAGS" >&6 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking LIBXML_LIBS" >&5 -$as_echo_n "checking LIBXML_LIBS... " >&6; } + echo "$as_me:$LINENO: checking LIBXML_LIBS" >&5 +echo $ECHO_N "checking LIBXML_LIBS... $ECHO_C" >&6 LIBXML_LIBS=`$PKG_CONFIG --libs "libxml-2.0 >= 2.0"` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBXML_LIBS" >&5 -$as_echo "$LIBXML_LIBS" >&6; } + echo "$as_me:$LINENO: result: $LIBXML_LIBS" >&5 +echo "${ECHO_T}$LIBXML_LIBS" >&6 else LIBXML_CFLAGS="" LIBXML_LIBS="" @@ -12679,15 +14074,17 @@ $as_echo "$LIBXML_LIBS" >&6; } if test $succeeded = yes; then : else - as_fn_error "Library requirements (libxml-2.0 >= 2.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Library requirements (libxml-2.0 >= 2.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 +echo "$as_me: error: Library requirements (libxml-2.0 >= 2.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} + { (exit 1); exit 1; }; } fi fi BUILD_TYPE="$BUILD_TYPE LIBXMLSEC" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 -$as_echo "internal" >&6; } + echo "$as_me:$LINENO: result: internal" >&5 +echo "${ECHO_T}internal" >&6 SYSTEM_LIBXML=NO BUILD_TYPE="$BUILD_TYPE LIBXML2 LIBXMLSEC" fi @@ -12698,21 +14095,21 @@ fi if test "$_os" = "Darwin" && test "$with_system_python" != "no"; then with_system_python=yes fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which python to use" >&5 -$as_echo_n "checking which python to use... " >&6; } +echo "$as_me:$LINENO: checking which python to use" >&5 +echo $ECHO_N "checking which python to use... $ECHO_C" >&6 if test -n "$with_system_python" -o -n "$with_system_libs" && \ test "$with_system_python" != "no"; then SYSTEM_PYTHON=YES - { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 -$as_echo "external" >&6; } + echo "$as_me:$LINENO: result: external" >&5 +echo "${ECHO_T}external" >&6 if test -n "$PYTHON"; then # If the user set $PYTHON, use it and don't search something else. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON version >= 2.2" >&5 -$as_echo_n "checking whether $PYTHON version >= 2.2... " >&6; } + echo "$as_me:$LINENO: checking whether $PYTHON version >= 2.2" >&5 +echo $ECHO_N "checking whether $PYTHON version >= 2.2... $ECHO_C" >&6 prog="import sys, string # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. @@ -12724,20 +14121,23 @@ sys.exit(sys.hexversion < minverhex)" ($PYTHON -c "$prog") >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + (exit $ac_status); }; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else - as_fn_error "too old" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: too old" >&5 +echo "$as_me: error: too old" >&2;} + { (exit 1); exit 1; }; } fi + am_display_PYTHON=$PYTHON else # Otherwise, try each interpreter until we find one that satisfies # VERSION. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a Python interpreter with version >= 2.2" >&5 -$as_echo_n "checking for a Python interpreter with version >= 2.2... " >&6; } -if test "${am_cv_pathless_PYTHON+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for a Python interpreter with version >= 2.2" >&5 +echo $ECHO_N "checking for a Python interpreter with version >= 2.2... $ECHO_C" >&6 +if test "${am_cv_pathless_PYTHON+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else for am_cv_pathless_PYTHON in python python2 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5 none; do @@ -12753,23 +14153,24 @@ sys.exit(sys.hexversion < minverhex)" ($am_cv_pathless_PYTHON -c "$prog") >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then : + (exit $ac_status); }; then break fi + done fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_pathless_PYTHON" >&5 -$as_echo "$am_cv_pathless_PYTHON" >&6; } +echo "$as_me:$LINENO: result: $am_cv_pathless_PYTHON" >&5 +echo "${ECHO_T}$am_cv_pathless_PYTHON" >&6 # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. if test "$am_cv_pathless_PYTHON" = none; then PYTHON=: else # Extract the first word of "$am_cv_pathless_PYTHON", so it can be a program name with args. set dummy $am_cv_pathless_PYTHON; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PYTHON+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PYTHON+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PYTHON in [\\/]* | ?:[\\/]*) @@ -12781,48 +14182,49 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done ;; esac fi PYTHON=$ac_cv_path_PYTHON + if test -n "$PYTHON"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 -$as_echo "$PYTHON" >&6; } + echo "$as_me:$LINENO: result: $PYTHON" >&5 +echo "${ECHO_T}$PYTHON" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi am_display_PYTHON=$am_cv_pathless_PYTHON fi if test "$PYTHON" = :; then - as_fn_error "no suitable Python interpreter found" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: no suitable Python interpreter found" >&5 +echo "$as_me: error: no suitable Python interpreter found" >&2;} + { (exit 1); exit 1; }; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5 -$as_echo_n "checking for $am_display_PYTHON version... " >&6; } -if test "${am_cv_python_version+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for $am_display_PYTHON version" >&5 +echo $ECHO_N "checking for $am_display_PYTHON version... $ECHO_C" >&6 +if test "${am_cv_python_version+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else am_cv_python_version=`$PYTHON -c "import sys; print sys.version[:3]"` fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_version" >&5 -$as_echo "$am_cv_python_version" >&6; } +echo "$as_me:$LINENO: result: $am_cv_python_version" >&5 +echo "${ECHO_T}$am_cv_python_version" >&6 PYTHON_VERSION=$am_cv_python_version @@ -12833,30 +14235,30 @@ $as_echo "$am_cv_python_version" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5 -$as_echo_n "checking for $am_display_PYTHON platform... " >&6; } -if test "${am_cv_python_platform+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for $am_display_PYTHON platform" >&5 +echo $ECHO_N "checking for $am_display_PYTHON platform... $ECHO_C" >&6 +if test "${am_cv_python_platform+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else am_cv_python_platform=`$PYTHON -c "import sys; print sys.platform"` fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_platform" >&5 -$as_echo "$am_cv_python_platform" >&6; } +echo "$as_me:$LINENO: result: $am_cv_python_platform" >&5 +echo "${ECHO_T}$am_cv_python_platform" >&6 PYTHON_PLATFORM=$am_cv_python_platform - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory" >&5 -$as_echo_n "checking for $am_display_PYTHON script directory... " >&6; } -if test "${am_cv_python_pythondir+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for $am_display_PYTHON script directory" >&5 +echo $ECHO_N "checking for $am_display_PYTHON script directory... $ECHO_C" >&6 +if test "${am_cv_python_pythondir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else am_cv_python_pythondir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(0,0,prefix='$PYTHON_PREFIX')" 2>/dev/null || echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"` fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pythondir" >&5 -$as_echo "$am_cv_python_pythondir" >&6; } +echo "$as_me:$LINENO: result: $am_cv_python_pythondir" >&5 +echo "${ECHO_T}$am_cv_python_pythondir" >&6 pythondir=$am_cv_python_pythondir @@ -12864,16 +14266,16 @@ $as_echo "$am_cv_python_pythondir" >&6; } pkgpythondir=\${pythondir}/$PACKAGE - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory" >&5 -$as_echo_n "checking for $am_display_PYTHON extension module directory... " >&6; } -if test "${am_cv_python_pyexecdir+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for $am_display_PYTHON extension module directory" >&5 +echo $ECHO_N "checking for $am_display_PYTHON extension module directory... $ECHO_C" >&6 +if test "${am_cv_python_pyexecdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else am_cv_python_pyexecdir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(1,0,prefix='$PYTHON_EXEC_PREFIX')" 2>/dev/null || echo "${PYTHON_EXEC_PREFIX}/lib/python${PYTHON_VERSION}/site-packages"` fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pyexecdir" >&5 -$as_echo "$am_cv_python_pyexecdir" >&6; } +echo "$as_me:$LINENO: result: $am_cv_python_pyexecdir" >&5 +echo "${ECHO_T}$am_cv_python_pyexecdir" >&6 pyexecdir=$am_cv_python_pyexecdir @@ -12898,11 +14300,149 @@ $as_echo "$am_cv_python_pyexecdir" >&6; } save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS" - ac_fn_c_check_header_mongrel "$LINENO" "Python.h" "ac_cv_header_Python_h" "$ac_includes_default" -if test "x$ac_cv_header_Python_h" = x""yes; then : + if test "${ac_cv_header_Python_h+set}" = set; then + echo "$as_me:$LINENO: checking for Python.h" >&5 +echo $ECHO_N "checking for Python.h... $ECHO_C" >&6 +if test "${ac_cv_header_Python_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_Python_h" >&5 +echo "${ECHO_T}$ac_cv_header_Python_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking Python.h usability" >&5 +echo $ECHO_N "checking Python.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking Python.h presence" >&5 +echo $ECHO_N "checking Python.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: Python.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: Python.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: Python.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: Python.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: Python.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: Python.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: Python.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: Python.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: Python.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: Python.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: Python.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: Python.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: Python.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: Python.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: Python.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: Python.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for Python.h" >&5 +echo $ECHO_N "checking for Python.h... $ECHO_C" >&6 +if test "${ac_cv_header_Python_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_Python_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_Python_h" >&5 +echo "${ECHO_T}$ac_cv_header_Python_h" >&6 +fi +if test $ac_cv_header_Python_h = yes; then + : else - as_fn_error "Python headers not found" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Python headers not found" >&5 +echo "$as_me: error: Python headers not found" >&2;} + { (exit 1); exit 1; }; } fi @@ -12910,8 +14450,8 @@ fi else SYSTEM_PYTHON=NO BUILD_TYPE="$BUILD_TYPE PYTHON" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 -$as_echo "internal" >&6; } + echo "$as_me:$LINENO: result: internal" >&5 +echo "${ECHO_T}internal" >&6 # Embedded python dies without Home set if test "z$HOME" = "z"; then export HOME=""; @@ -12920,10 +14460,10 @@ $as_echo "internal" >&6; } if test -z "$BZIP2"; then # Extract the first word of "bzip2", so it can be a program name with args. set dummy bzip2; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_BZIP2+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_BZIP2+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $BZIP2 in [\\/]* | ?:[\\/]*) @@ -12935,31 +14475,32 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_BZIP2="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done ;; esac fi BZIP2=$ac_cv_path_BZIP2 + if test -n "$BZIP2"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BZIP2" >&5 -$as_echo "$BZIP2" >&6; } + echo "$as_me:$LINENO: result: $BZIP2" >&5 +echo "${ECHO_T}$BZIP2" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test -z "$BZIP2"; then - as_fn_error "the internal Python module has a .tar.bz2. You need bzip2" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: the internal Python module has a .tar.bz2. You need bzip2" >&5 +echo "$as_me: error: the internal Python module has a .tar.bz2. You need bzip2" >&2;} + { (exit 1); exit 1; }; } fi fi fi @@ -12969,27 +14510,121 @@ fi HOME=`echo $HOME | sed 's:\\\\:/:g'` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which db to use" >&5 -$as_echo_n "checking which db to use... " >&6; } +echo "$as_me:$LINENO: checking which db to use" >&5 +echo $ECHO_N "checking which db to use... $ECHO_C" >&6 if test -n "$with_system_db" -o -n "$with_system_libs" && \ test "$with_system_db" != "no"; then SYSTEM_DB=YES - { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 -$as_echo "external" >&6; } - ac_fn_c_check_header_compile "$LINENO" "db.h" "ac_cv_header_db_h" " + echo "$as_me:$LINENO: result: external" >&5 +echo "${ECHO_T}external" >&6 + echo "$as_me:$LINENO: checking for db.h" >&5 +echo $ECHO_N "checking for db.h... $ECHO_C" >&6 +if test "${ac_cv_header_db_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + + +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_db_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -" -if test "x$ac_cv_header_db_h" = x""yes; then : +ac_cv_header_db_h=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_header_db_h" >&5 +echo "${ECHO_T}$ac_cv_header_db_h" >&6 +if test $ac_cv_header_db_h = yes; then DB_INCLUDES=/usr/include else CFLAGS=-I/usr/include/db4 - ac_fn_c_check_header_compile "$LINENO" "db4/db.h" "ac_cv_header_db4_db_h" "+ -" -if test "x$ac_cv_header_db4_db_h" = x""yes; then : + echo "$as_me:$LINENO: checking for db4/db.h" >&5 +echo $ECHO_N "checking for db4/db.h... $ECHO_C" >&6 +if test "${ac_cv_header_db4_db_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ ++ + +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_db4_db_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_db4_db_h=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_header_db4_db_h" >&5 +echo "${ECHO_T}$ac_cv_header_db4_db_h" >&6 +if test $ac_cv_header_db4_db_h = yes; then DB_INCLUDES=/usr/include/db4 else - as_fn_error "no. install the db4 libraries" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: no. install the db4 libraries" >&5 +echo "$as_me: error: no. install the db4 libraries" >&2;} + { (exit 1); exit 1; }; } fi @@ -12997,15 +14632,20 @@ fi fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether db is at least 4.1" >&5 -$as_echo_n "checking whether db is at least 4.1... " >&6; } - if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot run test program while cross compiling -See \`config.log' for more details." "$LINENO" 5; } + echo "$as_me:$LINENO: checking whether db is at least 4.1" >&5 +echo $ECHO_N "checking whether db is at least 4.1... $ECHO_C" >&6 + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include @@ -13016,47 +14656,91 @@ int main(int argc, char **argv) { } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else - as_fn_error "no. you need at least db 4.1" "$LINENO" 5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: no. you need at least db 4.1" >&5 +echo "$as_me: error: no. you need at least db 4.1" >&2;} + { (exit 1); exit 1; }; } fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -ldb" >&5 -$as_echo_n "checking for main in -ldb... " >&6; } -if test "${ac_cv_lib_db_main+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for main in -ldb" >&5 +echo $ECHO_N "checking for main in -ldb... $ECHO_C" >&6 +if test "${ac_cv_lib_db_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldb $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { -return main (); +main (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_db_main=yes else - ac_cv_lib_db_main=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_db_main=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_db_main" >&5 -$as_echo "$ac_cv_lib_db_main" >&6; } -if test "x$ac_cv_lib_db_main" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_db_main" >&5 +echo "${ECHO_T}$ac_cv_lib_db_main" >&6 +if test $ac_cv_lib_db_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBDB 1 _ACEOF @@ -13064,14 +14748,16 @@ _ACEOF LIBS="-ldb $LIBS" else - as_fn_error "db not installed or functional" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: db not installed or functional" >&5 +echo "$as_me: error: db not installed or functional" >&2;} + { (exit 1); exit 1; }; } fi ac_cv_lib_db=ac_cv_lib_db_main SCPDEFS="$SCPDEFS -DSYSTEM_DB" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 -$as_echo "internal" >&6; } + echo "$as_me:$LINENO: result: internal" >&5 +echo "${ECHO_T}internal" >&6 SYSTEM_DB=NO BUILD_TYPE="$BUILD_TYPE BERKELEYDB" fi @@ -13080,52 +14766,58 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which lucene to use" >&5 -$as_echo_n "checking which lucene to use... " >&6; } +echo "$as_me:$LINENO: checking which lucene to use" >&5 +echo $ECHO_N "checking which lucene to use... $ECHO_C" >&6 if test -n "$with_system_lucene" -o -n "$with_system_libs" && \ test "$with_system_lucene" != "no" && test "$with_system_jars" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 -$as_echo "external" >&6; } + echo "$as_me:$LINENO: result: external" >&5 +echo "${ECHO_T}external" >&6 SYSTEM_LUCENE=YES if test -z $LUCENE_CORE_JAR; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/lucene-core-2.3.jar" >&5 -$as_echo_n "checking for /usr/share/java/lucene-core-2.3.jar... " >&6; } -if test "${ac_cv_file__usr_share_java_lucene_core_2_3_jar+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for /usr/share/java/lucene-core-2.3.jar" >&5 +echo $ECHO_N "checking for /usr/share/java/lucene-core-2.3.jar... $ECHO_C" >&6 +if test "${ac_cv_file__usr_share_java_lucene_core_2_3_jar+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "/usr/share/java/lucene-core-2.3.jar"; then ac_cv_file__usr_share_java_lucene_core_2_3_jar=yes else ac_cv_file__usr_share_java_lucene_core_2_3_jar=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_lucene_core_2_3_jar" >&5 -$as_echo "$ac_cv_file__usr_share_java_lucene_core_2_3_jar" >&6; } -if test "x$ac_cv_file__usr_share_java_lucene_core_2_3_jar" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_lucene_core_2_3_jar" >&5 +echo "${ECHO_T}$ac_cv_file__usr_share_java_lucene_core_2_3_jar" >&6 +if test $ac_cv_file__usr_share_java_lucene_core_2_3_jar = yes; then LUCENE_CORE_JAR=/usr/share/java/lucene-core-2.3.jar else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/lucene.jar" >&5 -$as_echo_n "checking for /usr/share/java/lucene.jar... " >&6; } -if test "${ac_cv_file__usr_share_java_lucene_jar+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for /usr/share/java/lucene.jar" >&5 +echo $ECHO_N "checking for /usr/share/java/lucene.jar... $ECHO_C" >&6 +if test "${ac_cv_file__usr_share_java_lucene_jar+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "/usr/share/java/lucene.jar"; then ac_cv_file__usr_share_java_lucene_jar=yes else ac_cv_file__usr_share_java_lucene_jar=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_lucene_jar" >&5 -$as_echo "$ac_cv_file__usr_share_java_lucene_jar" >&6; } -if test "x$ac_cv_file__usr_share_java_lucene_jar" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_lucene_jar" >&5 +echo "${ECHO_T}$ac_cv_file__usr_share_java_lucene_jar" >&6 +if test $ac_cv_file__usr_share_java_lucene_jar = yes; then LUCENE_CORE_JAR=/usr/share/java/lucene.jar else - as_fn_error "lucene-core.jar replacement not found" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: lucene-core.jar replacement not found" >&5 +echo "$as_me: error: lucene-core.jar replacement not found" >&2;} + { (exit 1); exit 1; }; } fi @@ -13134,71 +14826,79 @@ fi fi else - as_ac_File=`$as_echo "ac_cv_file_$LUCENE_CORE_JAR" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LUCENE_CORE_JAR" >&5 -$as_echo_n "checking for $LUCENE_CORE_JAR... " >&6; } -if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 + as_ac_File=`echo "ac_cv_file_$LUCENE_CORE_JAR" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $LUCENE_CORE_JAR" >&5 +echo $ECHO_N "checking for $LUCENE_CORE_JAR... $ECHO_C" >&6 +if eval "test \"\${$as_ac_File+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "$LUCENE_CORE_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -eval as_val=\$$as_ac_File - if test "x$as_val" = x""yes; then : - +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 +if test `eval echo '${'$as_ac_File'}'` = yes; then + : else - as_fn_error "lucene-core.jar not found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: lucene-core.jar not found." >&5 +echo "$as_me: error: lucene-core.jar not found." >&2;} + { (exit 1); exit 1; }; } fi fi if test -z $LUCENE_ANALYZERS_JAR; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/lucene-analyzers-2.3.jar" >&5 -$as_echo_n "checking for /usr/share/java/lucene-analyzers-2.3.jar... " >&6; } -if test "${ac_cv_file__usr_share_java_lucene_analyzers_2_3_jar+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for /usr/share/java/lucene-analyzers-2.3.jar" >&5 +echo $ECHO_N "checking for /usr/share/java/lucene-analyzers-2.3.jar... $ECHO_C" >&6 +if test "${ac_cv_file__usr_share_java_lucene_analyzers_2_3_jar+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "/usr/share/java/lucene-analyzers-2.3.jar"; then ac_cv_file__usr_share_java_lucene_analyzers_2_3_jar=yes else ac_cv_file__usr_share_java_lucene_analyzers_2_3_jar=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_lucene_analyzers_2_3_jar" >&5 -$as_echo "$ac_cv_file__usr_share_java_lucene_analyzers_2_3_jar" >&6; } -if test "x$ac_cv_file__usr_share_java_lucene_analyzers_2_3_jar" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_lucene_analyzers_2_3_jar" >&5 +echo "${ECHO_T}$ac_cv_file__usr_share_java_lucene_analyzers_2_3_jar" >&6 +if test $ac_cv_file__usr_share_java_lucene_analyzers_2_3_jar = yes; then LUCENE_ANALYZERS_JAR=/usr/share/java/lucene-analyzers-2.3.jar else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/lucene-contrib/lucene-analyzers.jar" >&5 -$as_echo_n "checking for /usr/share/java/lucene-contrib/lucene-analyzers.jar... " >&6; } -if test "${ac_cv_file__usr_share_java_lucene_contrib_lucene_analyzers_jar+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for /usr/share/java/lucene-contrib/lucene-analyzers.jar" >&5 +echo $ECHO_N "checking for /usr/share/java/lucene-contrib/lucene-analyzers.jar... $ECHO_C" >&6 +if test "${ac_cv_file__usr_share_java_lucene_contrib_lucene_analyzers_jar+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "/usr/share/java/lucene-contrib/lucene-analyzers.jar"; then ac_cv_file__usr_share_java_lucene_contrib_lucene_analyzers_jar=yes else ac_cv_file__usr_share_java_lucene_contrib_lucene_analyzers_jar=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_lucene_contrib_lucene_analyzers_jar" >&5 -$as_echo "$ac_cv_file__usr_share_java_lucene_contrib_lucene_analyzers_jar" >&6; } -if test "x$ac_cv_file__usr_share_java_lucene_contrib_lucene_analyzers_jar" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_lucene_contrib_lucene_analyzers_jar" >&5 +echo "${ECHO_T}$ac_cv_file__usr_share_java_lucene_contrib_lucene_analyzers_jar" >&6 +if test $ac_cv_file__usr_share_java_lucene_contrib_lucene_analyzers_jar = yes; then LUCENE_ANALYZERS_JAR=/usr/share/java/lucene-contrib/lucene-analyzers.jar else - as_fn_error "lucene-analyzers.jar replacement not found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: lucene-analyzers.jar replacement not found." >&5 +echo "$as_me: error: lucene-analyzers.jar replacement not found." >&2;} + { (exit 1); exit 1; }; } fi @@ -13207,34 +14907,36 @@ fi fi else - as_ac_File=`$as_echo "ac_cv_file_$LUCENE_CORE_JAR" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LUCENE_CORE_JAR" >&5 -$as_echo_n "checking for $LUCENE_CORE_JAR... " >&6; } -if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 + as_ac_File=`echo "ac_cv_file_$LUCENE_CORE_JAR" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $LUCENE_CORE_JAR" >&5 +echo $ECHO_N "checking for $LUCENE_CORE_JAR... $ECHO_C" >&6 +if eval "test \"\${$as_ac_File+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "$LUCENE_CORE_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -eval as_val=\$$as_ac_File - if test "x$as_val" = x""yes; then : - +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 +if test `eval echo '${'$as_ac_File'}'` = yes; then + : else - as_fn_error "lucene-analyzers.jar not found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: lucene-analyzers.jar not found." >&5 +echo "$as_me: error: lucene-analyzers.jar not found." >&2;} + { (exit 1); exit 1; }; } fi fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 -$as_echo "internal" >&6; } + echo "$as_me:$LINENO: result: internal" >&5 +echo "${ECHO_T}internal" >&6 SYSTEM_LUCENE=NO BUILD_TYPE="$BUILD_TYPE LUCENE" fi @@ -13242,42 +14944,44 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which hsqldb to use" >&5 -$as_echo_n "checking which hsqldb to use... " >&6; } +echo "$as_me:$LINENO: checking which hsqldb to use" >&5 +echo $ECHO_N "checking which hsqldb to use... $ECHO_C" >&6 if test -n "$with_system_hsqldb" -o -n "$with_system_libs" && \ test "$with_system_hsqldb" != "no" && test "$with_system_jars" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 -$as_echo "external" >&6; } + echo "$as_me:$LINENO: result: external" >&5 +echo "${ECHO_T}external" >&6 SYSTEM_HSQLDB=YES if test -z $HSQLDB_JAR; then HSQLDB_JAR=/usr/share/java/hsqldb.jar fi - as_ac_File=`$as_echo "ac_cv_file_$HSQLDB_JAR" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $HSQLDB_JAR" >&5 -$as_echo_n "checking for $HSQLDB_JAR... " >&6; } -if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 + as_ac_File=`echo "ac_cv_file_$HSQLDB_JAR" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $HSQLDB_JAR" >&5 +echo $ECHO_N "checking for $HSQLDB_JAR... $ECHO_C" >&6 +if eval "test \"\${$as_ac_File+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "$HSQLDB_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -eval as_val=\$$as_ac_File - if test "x$as_val" = x""yes; then : - +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 +if test `eval echo '${'$as_ac_File'}'` = yes; then + : else - as_fn_error "hsqldb.jar not found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: hsqldb.jar not found." >&5 +echo "$as_me: error: hsqldb.jar not found." >&2;} + { (exit 1); exit 1; }; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether hsqldb is >= 1.8.0.9" >&5 -$as_echo_n "checking whether hsqldb is >= 1.8.0.9... " >&6; } + echo "$as_me:$LINENO: checking whether hsqldb is >= 1.8.0.9" >&5 +echo $ECHO_N "checking whether hsqldb is >= 1.8.0.9... $ECHO_C" >&6 export HSQLDB_JAR if $PERL -e 'use Archive::Zip; my $file = "$ENV{'HSQLDB_JAR'}"; @@ -13300,57 +15004,61 @@ $as_echo_n "checking whether hsqldb is >= 1.8.0.9... " >&6; } } else { exit 1; }'; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else - as_fn_error "no, hsqldb >= 1.8.0.9 is needed" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: no, hsqldb >= 1.8.0.9 is needed" >&5 +echo "$as_me: error: no, hsqldb >= 1.8.0.9 is needed" >&2;} + { (exit 1); exit 1; }; } fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 -$as_echo "internal" >&6; } + echo "$as_me:$LINENO: result: internal" >&5 +echo "${ECHO_T}internal" >&6 SYSTEM_HSQLDB=NO BUILD_TYPE="$BUILD_TYPE HSQLDB" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which beanshell to use" >&5 -$as_echo_n "checking which beanshell to use... " >&6; } +echo "$as_me:$LINENO: checking which beanshell to use" >&5 +echo $ECHO_N "checking which beanshell to use... $ECHO_C" >&6 if test -n "$with_system_beanshell" -o -n "$with_system_libs" && \ test "$with_system_beanshell" != "no" && test "$with_system_jars" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 -$as_echo "external" >&6; } + echo "$as_me:$LINENO: result: external" >&5 +echo "${ECHO_T}external" >&6 SYSTEM_BSH=YES if test -z $BSH_JAR; then BSH_JAR=/usr/share/java/bsh.jar fi - as_ac_File=`$as_echo "ac_cv_file_$BSH_JAR" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $BSH_JAR" >&5 -$as_echo_n "checking for $BSH_JAR... " >&6; } -if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 + as_ac_File=`echo "ac_cv_file_$BSH_JAR" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $BSH_JAR" >&5 +echo $ECHO_N "checking for $BSH_JAR... $ECHO_C" >&6 +if eval "test \"\${$as_ac_File+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "$BSH_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -eval as_val=\$$as_ac_File - if test "x$as_val" = x""yes; then : - +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 +if test `eval echo '${'$as_ac_File'}'` = yes; then + : else - as_fn_error "bsh.jar not found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: bsh.jar not found." >&5 +echo "$as_me: error: bsh.jar not found." >&2;} + { (exit 1); exit 1; }; } fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 -$as_echo "internal" >&6; } + echo "$as_me:$LINENO: result: internal" >&5 +echo "${ECHO_T}internal" >&6 SYSTEM_BSH=NO BUILD_TYPE="$BUILD_TYPE BSH" fi @@ -13358,70 +15066,78 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which saxon to use" >&5 -$as_echo_n "checking which saxon to use... " >&6; } +echo "$as_me:$LINENO: checking which saxon to use" >&5 +echo $ECHO_N "checking which saxon to use... $ECHO_C" >&6 if test -n "$with_system_saxon" -o -n "$with_system_libs" && \ test "$with_system_saxon" != "no" && test "$with_system_jars" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 -$as_echo "external" >&6; } + echo "$as_me:$LINENO: result: external" >&5 +echo "${ECHO_T}external" >&6 SYSTEM_SAXON=YES if test -z $SAXON_JAR; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/saxon9.jar" >&5 -$as_echo_n "checking for /usr/share/java/saxon9.jar... " >&6; } -if test "${ac_cv_file__usr_share_java_saxon9_jar+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for /usr/share/java/saxon9.jar" >&5 +echo $ECHO_N "checking for /usr/share/java/saxon9.jar... $ECHO_C" >&6 +if test "${ac_cv_file__usr_share_java_saxon9_jar+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "/usr/share/java/saxon9.jar"; then ac_cv_file__usr_share_java_saxon9_jar=yes else ac_cv_file__usr_share_java_saxon9_jar=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_saxon9_jar" >&5 -$as_echo "$ac_cv_file__usr_share_java_saxon9_jar" >&6; } -if test "x$ac_cv_file__usr_share_java_saxon9_jar" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_saxon9_jar" >&5 +echo "${ECHO_T}$ac_cv_file__usr_share_java_saxon9_jar" >&6 +if test $ac_cv_file__usr_share_java_saxon9_jar = yes; then SAXON_JAR=/usr/share/java/saxon9.jar else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/saxon.jar" >&5 -$as_echo_n "checking for /usr/share/java/saxon.jar... " >&6; } -if test "${ac_cv_file__usr_share_java_saxon_jar+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for /usr/share/java/saxon.jar" >&5 +echo $ECHO_N "checking for /usr/share/java/saxon.jar... $ECHO_C" >&6 +if test "${ac_cv_file__usr_share_java_saxon_jar+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "/usr/share/java/saxon.jar"; then ac_cv_file__usr_share_java_saxon_jar=yes else ac_cv_file__usr_share_java_saxon_jar=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_saxon_jar" >&5 -$as_echo "$ac_cv_file__usr_share_java_saxon_jar" >&6; } -if test "x$ac_cv_file__usr_share_java_saxon_jar" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_saxon_jar" >&5 +echo "${ECHO_T}$ac_cv_file__usr_share_java_saxon_jar" >&6 +if test $ac_cv_file__usr_share_java_saxon_jar = yes; then SAXON_JAR=/usr/share/java/saxon.jar else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/saxon9.jar" >&5 -$as_echo_n "checking for /usr/share/java/saxon9.jar... " >&6; } -if test "${ac_cv_file__usr_share_java_saxon9_jar+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for /usr/share/java/saxon9.jar" >&5 +echo $ECHO_N "checking for /usr/share/java/saxon9.jar... $ECHO_C" >&6 +if test "${ac_cv_file__usr_share_java_saxon9_jar+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "/usr/share/java/saxon9.jar"; then ac_cv_file__usr_share_java_saxon9_jar=yes else ac_cv_file__usr_share_java_saxon9_jar=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_saxon9_jar" >&5 -$as_echo "$ac_cv_file__usr_share_java_saxon9_jar" >&6; } -if test "x$ac_cv_file__usr_share_java_saxon9_jar" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_saxon9_jar" >&5 +echo "${ECHO_T}$ac_cv_file__usr_share_java_saxon9_jar" >&6 +if test $ac_cv_file__usr_share_java_saxon9_jar = yes; then SAXON_JAR=/usr/share/java/saxon9.jar else - as_fn_error "saxon.jar replacement not found" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: saxon.jar replacement not found" >&5 +echo "$as_me: error: saxon.jar replacement not found" >&2;} + { (exit 1); exit 1; }; } fi @@ -13434,61 +15150,65 @@ fi fi else - as_ac_File=`$as_echo "ac_cv_file_$SAXON_JAR" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $SAXON_JAR" >&5 -$as_echo_n "checking for $SAXON_JAR... " >&6; } -if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 + as_ac_File=`echo "ac_cv_file_$SAXON_JAR" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $SAXON_JAR" >&5 +echo $ECHO_N "checking for $SAXON_JAR... $ECHO_C" >&6 +if eval "test \"\${$as_ac_File+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "$SAXON_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -eval as_val=\$$as_ac_File - if test "x$as_val" = x""yes; then : - +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 +if test `eval echo '${'$as_ac_File'}'` = yes; then + : else - as_fn_error "saxon.jar replacement not found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: saxon.jar replacement not found." >&5 +echo "$as_me: error: saxon.jar replacement not found." >&2;} + { (exit 1); exit 1; }; } fi fi if test -n "$SERIALIZER_JAR"; then - as_ac_File=`$as_echo "ac_cv_file_$SERIALIZER_JAR" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $SERIALIZER_JAR" >&5 -$as_echo_n "checking for $SERIALIZER_JAR... " >&6; } -if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 + as_ac_File=`echo "ac_cv_file_$SERIALIZER_JAR" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $SERIALIZER_JAR" >&5 +echo $ECHO_N "checking for $SERIALIZER_JAR... $ECHO_C" >&6 +if eval "test \"\${$as_ac_File+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "$SERIALIZER_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -eval as_val=\$$as_ac_File - if test "x$as_val" = x""yes; then : - +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 +if test `eval echo '${'$as_ac_File'}'` = yes; then + : else - as_fn_error "serializer.jar not found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: serializer.jar not found." >&5 +echo "$as_me: error: serializer.jar not found." >&2;} + { (exit 1); exit 1; }; } fi fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 -$as_echo "internal" >&6; } + echo "$as_me:$LINENO: result: internal" >&5 +echo "${ECHO_T}internal" >&6 SYSTEM_SAXON=NO NEED_SAXON=TRUE fi @@ -13502,20 +15222,20 @@ fi if test "$_os" = "Darwin" && test "$with_system_curl" != "no"; then with_system_curl=yes fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which curl to use" >&5 -$as_echo_n "checking which curl to use... " >&6; } +echo "$as_me:$LINENO: checking which curl to use" >&5 +echo $ECHO_N "checking which curl to use... $ECHO_C" >&6 if test -n "$with_system_curl" -o -n "$with_system_libs" && \ test "$with_system_curl" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 -$as_echo "external" >&6; } + echo "$as_me:$LINENO: result: external" >&5 +echo "${ECHO_T}external" >&6 SYSTEM_CURL=YES # Extract the first word of "curl-config", so it can be a program name with args. set dummy curl-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_CURLCONFIG+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_CURLCONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $CURLCONFIG in [\\/]* | ?:[\\/]*) @@ -13527,49 +15247,52 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_CURLCONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done ;; esac fi CURLCONFIG=$ac_cv_path_CURLCONFIG + if test -n "$CURLCONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CURLCONFIG" >&5 -$as_echo "$CURLCONFIG" >&6; } + echo "$as_me:$LINENO: result: $CURLCONFIG" >&5 +echo "${ECHO_T}$CURLCONFIG" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test -z "$CURLCONFIG"; then - as_fn_error "install curl to run this script" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: install curl to run this script" >&5 +echo "$as_me: error: install curl to run this script" >&2;} + { (exit 1); exit 1; }; } fi # check curl version - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether curl is >= 7.9.8" >&5 -$as_echo_n "checking whether curl is >= 7.9.8... " >&6; } + echo "$as_me:$LINENO: checking whether curl is >= 7.9.8" >&5 +echo $ECHO_N "checking whether curl is >= 7.9.8... $ECHO_C" >&6 if test "`$CURLCONFIG --version | $AWK -F' ' '{print $2}' | $AWK -F. '{ print $1 }'`" -gt "7" -a \ "`$CURLCONFIG --version | $AWK -F' ' '{print $2}' | $AWK -F. '{ print $2 }'`" -gt "9" -a \ "`$CURLCONFIG --version | $AWK -F' ' '{print $2}' | $AWK -F. '{ print $3 }'`" -gt "8"; then - as_fn_error "no, you need at least curl 7.9,8" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: no, you need at least curl 7.9,8" >&5 +echo "$as_me: error: no, you need at least curl 7.9,8" >&2;} + { (exit 1); exit 1; }; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 fi CURL_LIBS=`$CURLCONFIG --libs` CURL_CFLAGS=`$CURLCONFIG --cflags` else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 -$as_echo "internal" >&6; } + echo "$as_me:$LINENO: result: internal" >&5 +echo "${ECHO_T}internal" >&6 SYSTEM_CURL=NO BUILD_TYPE="$BUILD_TYPE CURL" fi @@ -13577,49 +15300,467 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which boost to use" >&5 -$as_echo_n "checking which boost to use... " >&6; } +echo "$as_me:$LINENO: checking which boost to use" >&5 +echo $ECHO_N "checking which boost to use... $ECHO_C" >&6 if test -n "$with_system_boost" -o -n "$with_system_headers" && \ test "$with_system_boost" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 -$as_echo "external" >&6; } + echo "$as_me:$LINENO: result: external" >&5 +echo "${ECHO_T}external" >&6 SYSTEM_BOOST=YES - ac_ext=cpp + ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - ac_fn_cxx_check_header_mongrel "$LINENO" "boost/shared_ptr.hpp" "ac_cv_header_boost_shared_ptr_hpp" "$ac_includes_default" -if test "x$ac_cv_header_boost_shared_ptr_hpp" = x""yes; then : + if test "${ac_cv_header_boost_shared_ptr_hpp+set}" = set; then + echo "$as_me:$LINENO: checking for boost/shared_ptr.hpp" >&5 +echo $ECHO_N "checking for boost/shared_ptr.hpp... $ECHO_C" >&6 +if test "${ac_cv_header_boost_shared_ptr_hpp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_boost_shared_ptr_hpp" >&5 +echo "${ECHO_T}$ac_cv_header_boost_shared_ptr_hpp" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking boost/shared_ptr.hpp usability" >&5 +echo $ECHO_N "checking boost/shared_ptr.hpp usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking boost/shared_ptr.hpp presence" >&5 +echo $ECHO_N "checking boost/shared_ptr.hpp presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: boost/shared_ptr.hpp: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: boost/shared_ptr.hpp: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: boost/shared_ptr.hpp: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: boost/shared_ptr.hpp: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: boost/shared_ptr.hpp: present but cannot be compiled" >&5 +echo "$as_me: WARNING: boost/shared_ptr.hpp: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: boost/shared_ptr.hpp: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: boost/shared_ptr.hpp: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: boost/shared_ptr.hpp: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: boost/shared_ptr.hpp: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: boost/shared_ptr.hpp: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: boost/shared_ptr.hpp: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: boost/shared_ptr.hpp: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: boost/shared_ptr.hpp: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: boost/shared_ptr.hpp: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: boost/shared_ptr.hpp: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for boost/shared_ptr.hpp" >&5 +echo $ECHO_N "checking for boost/shared_ptr.hpp... $ECHO_C" >&6 +if test "${ac_cv_header_boost_shared_ptr_hpp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_boost_shared_ptr_hpp=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_boost_shared_ptr_hpp" >&5 +echo "${ECHO_T}$ac_cv_header_boost_shared_ptr_hpp" >&6 + +fi +if test $ac_cv_header_boost_shared_ptr_hpp = yes; then + : +else + { { echo "$as_me:$LINENO: error: boost/shared_ptr.hpp not found. install boost" >&5 +echo "$as_me: error: boost/shared_ptr.hpp not found. install boost" >&2;} + { (exit 1); exit 1; }; } +fi + + + if test "${ac_cv_header_boost_spirit_include_classic_core_hpp+set}" = set; then + echo "$as_me:$LINENO: checking for boost/spirit/include/classic_core.hpp" >&5 +echo $ECHO_N "checking for boost/spirit/include/classic_core.hpp... $ECHO_C" >&6 +if test "${ac_cv_header_boost_spirit_include_classic_core_hpp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_boost_spirit_include_classic_core_hpp" >&5 +echo "${ECHO_T}$ac_cv_header_boost_spirit_include_classic_core_hpp" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking boost/spirit/include/classic_core.hpp usability" >&5 +echo $ECHO_N "checking boost/spirit/include/classic_core.hpp usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking boost/spirit/include/classic_core.hpp presence" >&5 +echo $ECHO_N "checking boost/spirit/include/classic_core.hpp presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: boost/spirit/include/classic_core.hpp: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: boost/spirit/include/classic_core.hpp: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: boost/spirit/include/classic_core.hpp: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: boost/spirit/include/classic_core.hpp: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: boost/spirit/include/classic_core.hpp: present but cannot be compiled" >&5 +echo "$as_me: WARNING: boost/spirit/include/classic_core.hpp: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: boost/spirit/include/classic_core.hpp: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: boost/spirit/include/classic_core.hpp: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: boost/spirit/include/classic_core.hpp: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: boost/spirit/include/classic_core.hpp: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: boost/spirit/include/classic_core.hpp: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: boost/spirit/include/classic_core.hpp: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: boost/spirit/include/classic_core.hpp: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: boost/spirit/include/classic_core.hpp: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: boost/spirit/include/classic_core.hpp: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: boost/spirit/include/classic_core.hpp: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for boost/spirit/include/classic_core.hpp" >&5 +echo $ECHO_N "checking for boost/spirit/include/classic_core.hpp... $ECHO_C" >&6 +if test "${ac_cv_header_boost_spirit_include_classic_core_hpp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_boost_spirit_include_classic_core_hpp=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_boost_spirit_include_classic_core_hpp" >&5 +echo "${ECHO_T}$ac_cv_header_boost_spirit_include_classic_core_hpp" >&6 +fi +if test $ac_cv_header_boost_spirit_include_classic_core_hpp = yes; then + : else - as_fn_error "boost/shared_ptr.hpp not found. install boost" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: boost/spirit/include/classic_core.hpp not found. install boost >= 1.38" >&5 +echo "$as_me: error: boost/spirit/include/classic_core.hpp not found. install boost >= 1.38" >&2;} + { (exit 1); exit 1; }; } fi - ac_fn_cxx_check_header_mongrel "$LINENO" "boost/spirit/include/classic_core.hpp" "ac_cv_header_boost_spirit_include_classic_core_hpp" "$ac_includes_default" -if test "x$ac_cv_header_boost_spirit_include_classic_core_hpp" = x""yes; then : + if test "${ac_cv_header_boost_function_hpp+set}" = set; then + echo "$as_me:$LINENO: checking for boost/function.hpp" >&5 +echo $ECHO_N "checking for boost/function.hpp... $ECHO_C" >&6 +if test "${ac_cv_header_boost_function_hpp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_boost_function_hpp" >&5 +echo "${ECHO_T}$ac_cv_header_boost_function_hpp" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking boost/function.hpp usability" >&5 +echo $ECHO_N "checking boost/function.hpp usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 +# Is the header present? +echo "$as_me:$LINENO: checking boost/function.hpp presence" >&5 +echo $ECHO_N "checking boost/function.hpp presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi else - as_fn_error "boost/spirit/include/classic_core.hpp not found. install boost >= 1.38" "$LINENO" 5 + ac_cpp_err=yes fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 - ac_fn_cxx_check_header_mongrel "$LINENO" "boost/function.hpp" "ac_cv_header_boost_function_hpp" "$ac_includes_default" -if test "x$ac_cv_header_boost_function_hpp" = x""yes; then : +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: boost/function.hpp: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: boost/function.hpp: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: boost/function.hpp: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: boost/function.hpp: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: boost/function.hpp: present but cannot be compiled" >&5 +echo "$as_me: WARNING: boost/function.hpp: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: boost/function.hpp: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: boost/function.hpp: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: boost/function.hpp: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: boost/function.hpp: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: boost/function.hpp: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: boost/function.hpp: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: boost/function.hpp: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: boost/function.hpp: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: boost/function.hpp: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: boost/function.hpp: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for boost/function.hpp" >&5 +echo $ECHO_N "checking for boost/function.hpp... $ECHO_C" >&6 +if test "${ac_cv_header_boost_function_hpp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_boost_function_hpp=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_boost_function_hpp" >&5 +echo "${ECHO_T}$ac_cv_header_boost_function_hpp" >&6 +fi +if test $ac_cv_header_boost_function_hpp = yes; then + : else - as_fn_error "boost/function.hpp not found. install boost" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: boost/function.hpp not found. install boost" >&5 +echo "$as_me: error: boost/function.hpp not found. install boost" >&2;} + { (exit 1); exit 1; }; } fi save_CXXFLAGS=$CXXFLAGS CXXFLAGS="$CXXFLAGS -fno-exceptions" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether boost/function.hpp compiles with -fno-exceptions" >&5 -$as_echo_n "checking whether boost/function.hpp compiles with -fno-exceptions... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + echo "$as_me:$LINENO: checking whether boost/function.hpp compiles with -fno-exceptions" >&5 +echo $ECHO_N "checking whether boost/function.hpp compiles with -fno-exceptions... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include @@ -13631,18 +15772,44 @@ main () return 0; } _ACEOF -if ac_fn_cxx_try_compile "$LINENO"; then : +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_cxx_boost_no_exceptons_broken=no else - ac_cv_cxx_boost_no_exceptons_broken=yes + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_cxx_boost_no_exceptons_broken=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test "$ac_cv_cxx_boost_no_exceptons_broken" = "yes"; then - as_fn_error "no, see https://bugzilla.redhat.com/show_bug.cgi?id=477131" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: no, see https://bugzilla.redhat.com/show_bug.cgi?id=477131" >&5 +echo "$as_me: error: no, see https://bugzilla.redhat.com/show_bug.cgi?id=477131" >&2;} + { (exit 1); exit 1; }; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 fi CXXFLAGS=$save_CXXFLAGS ac_ext=c @@ -13652,185 +15819,630 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 -$as_echo "internal" >&6; } + echo "$as_me:$LINENO: result: internal" >&5 +echo "${ECHO_T}internal" >&6 BUILD_TYPE="$BUILD_TYPE BOOST" SYSTEM_BOOST=NO fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which vigra to use" >&5 -$as_echo_n "checking which vigra to use... " >&6; } +echo "$as_me:$LINENO: checking which vigra to use" >&5 +echo $ECHO_N "checking which vigra to use... $ECHO_C" >&6 if test -n "$with_system_vigra" -o -n "$with_system_headers" && \ test "$with_system_vigra" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 -$as_echo "external" >&6; } + echo "$as_me:$LINENO: result: external" >&5 +echo "${ECHO_T}external" >&6 SYSTEM_VIGRA=YES - ac_ext=cpp + ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - ac_fn_cxx_check_header_mongrel "$LINENO" "vigra/copyimage.hxx" "ac_cv_header_vigra_copyimage_hxx" "$ac_includes_default" -if test "x$ac_cv_header_vigra_copyimage_hxx" = x""yes; then : + if test "${ac_cv_header_vigra_copyimage_hxx+set}" = set; then + echo "$as_me:$LINENO: checking for vigra/copyimage.hxx" >&5 +echo $ECHO_N "checking for vigra/copyimage.hxx... $ECHO_C" >&6 +if test "${ac_cv_header_vigra_copyimage_hxx+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_vigra_copyimage_hxx" >&5 +echo "${ECHO_T}$ac_cv_header_vigra_copyimage_hxx" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking vigra/copyimage.hxx usability" >&5 +echo $ECHO_N "checking vigra/copyimage.hxx usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking vigra/copyimage.hxx presence" >&5 +echo $ECHO_N "checking vigra/copyimage.hxx presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: vigra/copyimage.hxx: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: vigra/copyimage.hxx: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: vigra/copyimage.hxx: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: vigra/copyimage.hxx: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: vigra/copyimage.hxx: present but cannot be compiled" >&5 +echo "$as_me: WARNING: vigra/copyimage.hxx: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: vigra/copyimage.hxx: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: vigra/copyimage.hxx: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: vigra/copyimage.hxx: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: vigra/copyimage.hxx: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: vigra/copyimage.hxx: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: vigra/copyimage.hxx: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: vigra/copyimage.hxx: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: vigra/copyimage.hxx: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: vigra/copyimage.hxx: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: vigra/copyimage.hxx: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for vigra/copyimage.hxx" >&5 +echo $ECHO_N "checking for vigra/copyimage.hxx... $ECHO_C" >&6 +if test "${ac_cv_header_vigra_copyimage_hxx+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_vigra_copyimage_hxx=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_vigra_copyimage_hxx" >&5 +echo "${ECHO_T}$ac_cv_header_vigra_copyimage_hxx" >&6 + +fi +if test $ac_cv_header_vigra_copyimage_hxx = yes; then + : +else + { { echo "$as_me:$LINENO: error: vigra/copyimage.hxx not found. install vigra" >&5 +echo "$as_me: error: vigra/copyimage.hxx not found. install vigra" >&2;} + { (exit 1); exit 1; }; } +fi + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +else + echo "$as_me:$LINENO: result: internal" >&5 +echo "${ECHO_T}internal" >&6 + BUILD_TYPE="$BUILD_TYPE VIGRA" + SYSTEM_VIGRA=NO +fi + + +echo "$as_me:$LINENO: checking which odbc headers to use" >&5 +echo $ECHO_N "checking which odbc headers to use... $ECHO_C" >&6 +if test -n "$with_system_odbc_headers" -o -n "$with_system_headers" && \ + test "$with_system_odbc_headers" != "no"; then + echo "$as_me:$LINENO: result: external" >&5 +echo "${ECHO_T}external" >&6 + SYSTEM_ODBC_HEADERS=YES + + if test "${ac_cv_header_sqlext_h+set}" = set; then + echo "$as_me:$LINENO: checking for sqlext.h" >&5 +echo $ECHO_N "checking for sqlext.h... $ECHO_C" >&6 +if test "${ac_cv_header_sqlext_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_sqlext_h" >&5 +echo "${ECHO_T}$ac_cv_header_sqlext_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking sqlext.h usability" >&5 +echo $ECHO_N "checking sqlext.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 +# Is the header present? +echo "$as_me:$LINENO: checking sqlext.h presence" >&5 +echo $ECHO_N "checking sqlext.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi else - as_fn_error "vigra/copyimage.hxx not found. install vigra" "$LINENO" 5 + ac_cpp_err=yes fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: sqlext.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: sqlext.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: sqlext.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: sqlext.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: sqlext.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: sqlext.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: sqlext.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: sqlext.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: sqlext.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: sqlext.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: sqlext.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: sqlext.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: sqlext.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: sqlext.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: sqlext.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: sqlext.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for sqlext.h" >&5 +echo $ECHO_N "checking for sqlext.h... $ECHO_C" >&6 +if test "${ac_cv_header_sqlext_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 -$as_echo "internal" >&6; } - BUILD_TYPE="$BUILD_TYPE VIGRA" - SYSTEM_VIGRA=NO + ac_cv_header_sqlext_h=$ac_header_preproc fi +echo "$as_me:$LINENO: result: $ac_cv_header_sqlext_h" >&5 +echo "${ECHO_T}$ac_cv_header_sqlext_h" >&6 - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which odbc headers to use" >&5 -$as_echo_n "checking which odbc headers to use... " >&6; } -if test -n "$with_system_odbc_headers" -o -n "$with_system_headers" && \ - test "$with_system_odbc_headers" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 -$as_echo "external" >&6; } - SYSTEM_ODBC_HEADERS=YES - - ac_fn_c_check_header_mongrel "$LINENO" "sqlext.h" "ac_cv_header_sqlext_h" "$ac_includes_default" -if test "x$ac_cv_header_sqlext_h" = x""yes; then : - +fi +if test $ac_cv_header_sqlext_h = yes; then + : else - as_fn_error "odbc not found. install odbc" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: odbc not found. install odbc" >&5 +echo "$as_me: error: odbc not found. install odbc" >&2;} + { (exit 1); exit 1; }; } fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 -$as_echo "internal" >&6; } + echo "$as_me:$LINENO: result: internal" >&5 +echo "${ECHO_T}internal" >&6 SYSTEM_ODBC_HEADERS=NO BUILD_TYPE="$BUILD_TYPE UNIXODBC" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable build of Mozilla/Mozilla NSS-using components" >&5 -$as_echo_n "checking whether to enable build of Mozilla/Mozilla NSS-using components... " >&6; } +echo "$as_me:$LINENO: checking whether to enable build of Mozilla/Mozilla NSS-using components" >&5 +echo $ECHO_N "checking whether to enable build of Mozilla/Mozilla NSS-using components... $ECHO_C" >&6 if test "$enable_mozilla" = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 WITH_MOZILLA=NO ENABLE_NSS_MODULE=NO else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 WITH_MOZILLA=YES fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build Mozilla addressbook connectivity" >&5 -$as_echo_n "checking whether to build Mozilla addressbook connectivity... " >&6; } +echo "$as_me:$LINENO: checking whether to build Mozilla addressbook connectivity" >&5 +echo $ECHO_N "checking whether to build Mozilla addressbook connectivity... $ECHO_C" >&6 if test "$enable_mozilla" = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 elif test "$with_system_mozilla" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, not possible with system-mozilla" >&5 -$as_echo "no, not possible with system-mozilla" >&6; } + echo "$as_me:$LINENO: result: no, not possible with system-mozilla" >&5 +echo "${ECHO_T}no, not possible with system-mozilla" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build XML Security support" >&5 -$as_echo_n "checking whether to build XML Security support... " >&6; } +echo "$as_me:$LINENO: checking whether to build XML Security support" >&5 +echo $ECHO_N "checking whether to build XML Security support... $ECHO_C" >&6 if test "$enable_mozilla" = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, since Mozilla (NSS) disabled but needed" >&5 -$as_echo "no, since Mozilla (NSS) disabled but needed" >&6; } + echo "$as_me:$LINENO: result: no, since Mozilla (NSS) disabled but needed" >&5 +echo "${ECHO_T}no, since Mozilla (NSS) disabled but needed" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build LDAP configuration backend" >&5 -$as_echo_n "checking whether to build LDAP configuration backend... " >&6; } +echo "$as_me:$LINENO: checking whether to build LDAP configuration backend" >&5 +echo $ECHO_N "checking whether to build LDAP configuration backend... $ECHO_C" >&6 if test -z "$enable_ldap" || test "$enable_ldap" = "yes"; then if test "$enable_mozilla" = "yes" || test "$with_openldap" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 WITH_LDAP=YES else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no. Either Mozilla or OpenLDAP needed" >&5 -$as_echo "no. Either Mozilla or OpenLDAP needed" >&6; } + echo "$as_me:$LINENO: result: no. Either Mozilla or OpenLDAP needed" >&5 +echo "${ECHO_T}no. Either Mozilla or OpenLDAP needed" >&6 WITH_LDAP=NO fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 WITH_LDAP=NO fi if test "$WITH_LDAP" = "YES"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking which LDAP SDK to use" >&5 -$as_echo_n "checking which LDAP SDK to use... " >&6; } + echo "$as_me:$LINENO: checking which LDAP SDK to use" >&5 +echo $ECHO_N "checking which LDAP SDK to use... $ECHO_C" >&6 if test -n "$with_openldap" && test "$with_openldap" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: OpenLDAP" >&5 -$as_echo "OpenLDAP" >&6; } + echo "$as_me:$LINENO: result: OpenLDAP" >&5 +echo "${ECHO_T}OpenLDAP" >&6 WITH_OPENLDAP=YES - for ac_header in ldap.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "ldap.h" "ac_cv_header_ldap_h" "$ac_includes_default" -if test "x$ac_cv_header_ldap_h" = x""yes; then : + +for ac_header in ldap.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_LDAP_H 1 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else - as_fn_error "ldap.h not found. install openldap libs" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: ldap.h not found. install openldap libs" >&5 +echo "$as_me: error: ldap.h not found. install openldap libs" >&2;} + { (exit 1); exit 1; }; } fi done - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_simple_bind_s in -lldap" >&5 -$as_echo_n "checking for ldap_simple_bind_s in -lldap... " >&6; } -if test "${ac_cv_lib_ldap_ldap_simple_bind_s+set}" = set; then : - $as_echo_n "(cached) " >&6 + +echo "$as_me:$LINENO: checking for ldap_simple_bind_s in -lldap" >&5 +echo $ECHO_N "checking for ldap_simple_bind_s in -lldap... $ECHO_C" >&6 +if test "${ac_cv_lib_ldap_ldap_simple_bind_s+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lldap $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char ldap_simple_bind_s (); int main () { -return ldap_simple_bind_s (); +ldap_simple_bind_s (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_ldap_ldap_simple_bind_s=yes else - ac_cv_lib_ldap_ldap_simple_bind_s=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_ldap_ldap_simple_bind_s=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_ldap_simple_bind_s" >&5 -$as_echo "$ac_cv_lib_ldap_ldap_simple_bind_s" >&6; } -if test "x$ac_cv_lib_ldap_ldap_simple_bind_s" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_ldap_ldap_simple_bind_s" >&5 +echo "${ECHO_T}$ac_cv_lib_ldap_ldap_simple_bind_s" >&6 +if test $ac_cv_lib_ldap_ldap_simple_bind_s = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBLDAP 1 _ACEOF @@ -13838,48 +16450,79 @@ _ACEOF LIBS="-lldap $LIBS" else - as_fn_error "openldap lib not found or functional" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: openldap lib not found or functional" >&5 +echo "$as_me: error: openldap lib not found or functional" >&2;} + { (exit 1); exit 1; }; } fi # rumours say that OpenLDAP doesn't have that function. I looked and # it has it. Test for it to be sure - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldap_set_option in -lldap" >&5 -$as_echo_n "checking for ldap_set_option in -lldap... " >&6; } -if test "${ac_cv_lib_ldap_ldap_set_option+set}" = set; then : - $as_echo_n "(cached) " >&6 + +echo "$as_me:$LINENO: checking for ldap_set_option in -lldap" >&5 +echo $ECHO_N "checking for ldap_set_option in -lldap... $ECHO_C" >&6 +if test "${ac_cv_lib_ldap_ldap_set_option+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lldap $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char ldap_set_option (); int main () { -return ldap_set_option (); +ldap_set_option (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_ldap_ldap_set_option=yes else - ac_cv_lib_ldap_ldap_set_option=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_ldap_ldap_set_option=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ldap_ldap_set_option" >&5 -$as_echo "$ac_cv_lib_ldap_ldap_set_option" >&6; } -if test "x$ac_cv_lib_ldap_ldap_set_option" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_ldap_ldap_set_option" >&5 +echo "${ECHO_T}$ac_cv_lib_ldap_ldap_set_option" >&6 +if test $ac_cv_lib_ldap_ldap_set_option = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBLDAP 1 _ACEOF @@ -13887,12 +16530,14 @@ _ACEOF LIBS="-lldap $LIBS" else - as_fn_error "openldap lib not found or functional" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: openldap lib not found or functional" >&5 +echo "$as_me: error: openldap lib not found or functional" >&2;} + { (exit 1); exit 1; }; } fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Netscape/Mozilla" >&5 -$as_echo "Netscape/Mozilla" >&6; } + echo "$as_me:$LINENO: result: Netscape/Mozilla" >&5 +echo "${ECHO_T}Netscape/Mozilla" >&6 # TODO. Actually do a sanity check and check for # LDAP_OPT_SIZELIMIT and LDAP_X_OPT_CONNECT_TIMEOUT WITH_OPENLDAP=NO @@ -13901,16 +16546,16 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which mozilla to use" >&5 -$as_echo_n "checking which mozilla to use... " >&6; } +echo "$as_me:$LINENO: checking which mozilla to use" >&5 +echo $ECHO_N "checking which mozilla to use... $ECHO_C" >&6 if test -n "$with_system_mozilla" && test "$with_system_mozilla" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 -$as_echo "external" >&6; } + echo "$as_me:$LINENO: result: external" >&5 +echo "${ECHO_T}external" >&6 SYSTEM_MOZILLA=YES ENABLE_NSS_MODULE=NO enable_nss_module=no - { $as_echo "$as_me:${as_lineno-$LINENO}: checking which Mozilla flavour to use" >&5 -$as_echo_n "checking which Mozilla flavour to use... " >&6; } + echo "$as_me:$LINENO: checking which Mozilla flavour to use" >&5 +echo $ECHO_N "checking which Mozilla flavour to use... $ECHO_C" >&6 if test -n "$with_system_mozilla" && test "$with_system_mozilla" = "libxul"; then MOZ_FLAVOUR=libxul elif test -n "$with_system_mozilla" && test "$with_system_mozilla" = "xulrunner"; then @@ -13925,8 +16570,8 @@ $as_echo_n "checking which Mozilla flavour to use... " >&6; } MOZ_FLAVOUR=libxul fi tmp=`echo $MOZ_FLAVOUR | $PERL -e 'print ucfirst();'` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tmp" >&5 -$as_echo "$tmp" >&6; } + echo "$as_me:$LINENO: result: $tmp" >&5 +echo "${ECHO_T}$tmp" >&6 succeeded=no @@ -13934,10 +16579,10 @@ $as_echo "$tmp" >&6; } if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -13949,30 +16594,29 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG + if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test "$PKG_CONFIG" = "no" ; then @@ -13983,25 +16627,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nss" >&5 -$as_echo_n "checking for nss... " >&6; } + echo "$as_me:$LINENO: checking for nss" >&5 +echo $ECHO_N "checking for nss... $ECHO_C" >&6 if $PKG_CONFIG --exists "nss" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 succeeded=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZ_NSS_CFLAGS" >&5 -$as_echo_n "checking MOZ_NSS_CFLAGS... " >&6; } + echo "$as_me:$LINENO: checking MOZ_NSS_CFLAGS" >&5 +echo $ECHO_N "checking MOZ_NSS_CFLAGS... $ECHO_C" >&6 MOZ_NSS_CFLAGS=`$PKG_CONFIG --cflags "nss"` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZ_NSS_CFLAGS" >&5 -$as_echo "$MOZ_NSS_CFLAGS" >&6; } + echo "$as_me:$LINENO: result: $MOZ_NSS_CFLAGS" >&5 +echo "${ECHO_T}$MOZ_NSS_CFLAGS" >&6 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZ_NSS_LIBS" >&5 -$as_echo_n "checking MOZ_NSS_LIBS... " >&6; } + echo "$as_me:$LINENO: checking MOZ_NSS_LIBS" >&5 +echo $ECHO_N "checking MOZ_NSS_LIBS... $ECHO_C" >&6 MOZ_NSS_LIBS=`$PKG_CONFIG --libs "nss"` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZ_NSS_LIBS" >&5 -$as_echo "$MOZ_NSS_LIBS" >&6; } + echo "$as_me:$LINENO: result: $MOZ_NSS_LIBS" >&5 +echo "${ECHO_T}$MOZ_NSS_LIBS" >&6 else MOZ_NSS_CFLAGS="" MOZ_NSS_LIBS="" @@ -14032,10 +16676,10 @@ $as_echo "$MOZ_NSS_LIBS" >&6; } if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -14047,30 +16691,29 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG + if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test "$PKG_CONFIG" = "no" ; then @@ -14081,25 +16724,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $MOZ_FLAVOUR-nss " >&5 -$as_echo_n "checking for $MOZ_FLAVOUR-nss ... " >&6; } + echo "$as_me:$LINENO: checking for $MOZ_FLAVOUR-nss " >&5 +echo $ECHO_N "checking for $MOZ_FLAVOUR-nss ... $ECHO_C" >&6 if $PKG_CONFIG --exists "$MOZ_FLAVOUR-nss " ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 succeeded=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZ_NSS_CFLAGS" >&5 -$as_echo_n "checking MOZ_NSS_CFLAGS... " >&6; } + echo "$as_me:$LINENO: checking MOZ_NSS_CFLAGS" >&5 +echo $ECHO_N "checking MOZ_NSS_CFLAGS... $ECHO_C" >&6 MOZ_NSS_CFLAGS=`$PKG_CONFIG --cflags "$MOZ_FLAVOUR-nss "` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZ_NSS_CFLAGS" >&5 -$as_echo "$MOZ_NSS_CFLAGS" >&6; } + echo "$as_me:$LINENO: result: $MOZ_NSS_CFLAGS" >&5 +echo "${ECHO_T}$MOZ_NSS_CFLAGS" >&6 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZ_NSS_LIBS" >&5 -$as_echo_n "checking MOZ_NSS_LIBS... " >&6; } + echo "$as_me:$LINENO: checking MOZ_NSS_LIBS" >&5 +echo $ECHO_N "checking MOZ_NSS_LIBS... $ECHO_C" >&6 MOZ_NSS_LIBS=`$PKG_CONFIG --libs "$MOZ_FLAVOUR-nss "` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZ_NSS_LIBS" >&5 -$as_echo "$MOZ_NSS_LIBS" >&6; } + echo "$as_me:$LINENO: result: $MOZ_NSS_LIBS" >&5 +echo "${ECHO_T}$MOZ_NSS_LIBS" >&6 else MOZ_NSS_CFLAGS="" MOZ_NSS_LIBS="" @@ -14120,7 +16763,9 @@ $as_echo "$MOZ_NSS_LIBS" >&6; } if test $succeeded = yes; then : else - as_fn_error "Library requirements ($MOZ_FLAVOUR-nss ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Library requirements ($MOZ_FLAVOUR-nss ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 +echo "$as_me: error: Library requirements ($MOZ_FLAVOUR-nss ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} + { (exit 1); exit 1; }; } fi else @@ -14135,10 +16780,10 @@ $as_echo "$MOZ_NSS_LIBS" >&6; } if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -14150,30 +16795,29 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG + if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test "$PKG_CONFIG" = "no" ; then @@ -14184,25 +16828,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nspr " >&5 -$as_echo_n "checking for nspr ... " >&6; } + echo "$as_me:$LINENO: checking for nspr " >&5 +echo $ECHO_N "checking for nspr ... $ECHO_C" >&6 if $PKG_CONFIG --exists "nspr " ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 succeeded=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZ_NSPR_CFLAGS" >&5 -$as_echo_n "checking MOZ_NSPR_CFLAGS... " >&6; } + echo "$as_me:$LINENO: checking MOZ_NSPR_CFLAGS" >&5 +echo $ECHO_N "checking MOZ_NSPR_CFLAGS... $ECHO_C" >&6 MOZ_NSPR_CFLAGS=`$PKG_CONFIG --cflags "nspr "` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZ_NSPR_CFLAGS" >&5 -$as_echo "$MOZ_NSPR_CFLAGS" >&6; } + echo "$as_me:$LINENO: result: $MOZ_NSPR_CFLAGS" >&5 +echo "${ECHO_T}$MOZ_NSPR_CFLAGS" >&6 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZ_NSPR_LIBS" >&5 -$as_echo_n "checking MOZ_NSPR_LIBS... " >&6; } + echo "$as_me:$LINENO: checking MOZ_NSPR_LIBS" >&5 +echo $ECHO_N "checking MOZ_NSPR_LIBS... $ECHO_C" >&6 MOZ_NSPR_LIBS=`$PKG_CONFIG --libs "nspr "` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZ_NSPR_LIBS" >&5 -$as_echo "$MOZ_NSPR_LIBS" >&6; } + echo "$as_me:$LINENO: result: $MOZ_NSPR_LIBS" >&5 +echo "${ECHO_T}$MOZ_NSPR_LIBS" >&6 else MOZ_NSPR_CFLAGS="" MOZ_NSPR_LIBS="" @@ -14223,7 +16867,9 @@ $as_echo "$MOZ_NSPR_LIBS" >&6; } if test $succeeded = yes; then : else - as_fn_error "Library requirements (nspr ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Library requirements (nspr ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 +echo "$as_me: error: Library requirements (nspr ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} + { (exit 1); exit 1; }; } fi NSPR_LIB="-L`$PKG_CONFIG --variable=libdir nspr`" @@ -14235,10 +16881,10 @@ $as_echo "$MOZ_NSPR_LIBS" >&6; } if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -14250,30 +16896,29 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG + if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test "$PKG_CONFIG" = "no" ; then @@ -14284,25 +16929,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $MOZ_FLAVOUR-nspr " >&5 -$as_echo_n "checking for $MOZ_FLAVOUR-nspr ... " >&6; } + echo "$as_me:$LINENO: checking for $MOZ_FLAVOUR-nspr " >&5 +echo $ECHO_N "checking for $MOZ_FLAVOUR-nspr ... $ECHO_C" >&6 if $PKG_CONFIG --exists "$MOZ_FLAVOUR-nspr " ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 succeeded=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZ_NSPR_CFLAGS" >&5 -$as_echo_n "checking MOZ_NSPR_CFLAGS... " >&6; } + echo "$as_me:$LINENO: checking MOZ_NSPR_CFLAGS" >&5 +echo $ECHO_N "checking MOZ_NSPR_CFLAGS... $ECHO_C" >&6 MOZ_NSPR_CFLAGS=`$PKG_CONFIG --cflags "$MOZ_FLAVOUR-nspr "` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZ_NSPR_CFLAGS" >&5 -$as_echo "$MOZ_NSPR_CFLAGS" >&6; } + echo "$as_me:$LINENO: result: $MOZ_NSPR_CFLAGS" >&5 +echo "${ECHO_T}$MOZ_NSPR_CFLAGS" >&6 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZ_NSPR_LIBS" >&5 -$as_echo_n "checking MOZ_NSPR_LIBS... " >&6; } + echo "$as_me:$LINENO: checking MOZ_NSPR_LIBS" >&5 +echo $ECHO_N "checking MOZ_NSPR_LIBS... $ECHO_C" >&6 MOZ_NSPR_LIBS=`$PKG_CONFIG --libs "$MOZ_FLAVOUR-nspr "` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZ_NSPR_LIBS" >&5 -$as_echo "$MOZ_NSPR_LIBS" >&6; } + echo "$as_me:$LINENO: result: $MOZ_NSPR_LIBS" >&5 +echo "${ECHO_T}$MOZ_NSPR_LIBS" >&6 else MOZ_NSPR_CFLAGS="" MOZ_NSPR_LIBS="" @@ -14323,7 +16968,9 @@ $as_echo "$MOZ_NSPR_LIBS" >&6; } if test $succeeded = yes; then : else - as_fn_error "Library requirements ($MOZ_FLAVOUR-nspr ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Library requirements ($MOZ_FLAVOUR-nspr ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 +echo "$as_me: error: Library requirements ($MOZ_FLAVOUR-nspr ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} + { (exit 1); exit 1; }; } fi fi @@ -14335,10 +16982,10 @@ $as_echo "$MOZ_NSPR_LIBS" >&6; } if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -14350,30 +16997,29 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG + if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test "$PKG_CONFIG" = "no" ; then @@ -14384,25 +17030,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $MOZ_FLAVOUR-xpcom" >&5 -$as_echo_n "checking for $MOZ_FLAVOUR-xpcom... " >&6; } + echo "$as_me:$LINENO: checking for $MOZ_FLAVOUR-xpcom" >&5 +echo $ECHO_N "checking for $MOZ_FLAVOUR-xpcom... $ECHO_C" >&6 if $PKG_CONFIG --exists "$MOZ_FLAVOUR-xpcom" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 succeeded=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZILLAXPCOM_CFLAGS" >&5 -$as_echo_n "checking MOZILLAXPCOM_CFLAGS... " >&6; } + echo "$as_me:$LINENO: checking MOZILLAXPCOM_CFLAGS" >&5 +echo $ECHO_N "checking MOZILLAXPCOM_CFLAGS... $ECHO_C" >&6 MOZILLAXPCOM_CFLAGS=`$PKG_CONFIG --cflags "$MOZ_FLAVOUR-xpcom"` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZILLAXPCOM_CFLAGS" >&5 -$as_echo "$MOZILLAXPCOM_CFLAGS" >&6; } + echo "$as_me:$LINENO: result: $MOZILLAXPCOM_CFLAGS" >&5 +echo "${ECHO_T}$MOZILLAXPCOM_CFLAGS" >&6 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZILLAXPCOM_LIBS" >&5 -$as_echo_n "checking MOZILLAXPCOM_LIBS... " >&6; } + echo "$as_me:$LINENO: checking MOZILLAXPCOM_LIBS" >&5 +echo $ECHO_N "checking MOZILLAXPCOM_LIBS... $ECHO_C" >&6 MOZILLAXPCOM_LIBS=`$PKG_CONFIG --libs "$MOZ_FLAVOUR-xpcom"` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZILLAXPCOM_LIBS" >&5 -$as_echo "$MOZILLAXPCOM_LIBS" >&6; } + echo "$as_me:$LINENO: result: $MOZILLAXPCOM_LIBS" >&5 +echo "${ECHO_T}$MOZILLAXPCOM_LIBS" >&6 else MOZILLAXPCOM_CFLAGS="" MOZILLAXPCOM_LIBS="" @@ -14437,10 +17083,10 @@ $as_echo "$MOZILLAXPCOM_LIBS" >&6; } if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -14452,30 +17098,29 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG + if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test "$PKG_CONFIG" = "no" ; then @@ -14486,25 +17131,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libxul " >&5 -$as_echo_n "checking for libxul ... " >&6; } + echo "$as_me:$LINENO: checking for libxul " >&5 +echo $ECHO_N "checking for libxul ... $ECHO_C" >&6 if $PKG_CONFIG --exists "libxul " ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 succeeded=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZILLAXPCOM_CFLAGS" >&5 -$as_echo_n "checking MOZILLAXPCOM_CFLAGS... " >&6; } + echo "$as_me:$LINENO: checking MOZILLAXPCOM_CFLAGS" >&5 +echo $ECHO_N "checking MOZILLAXPCOM_CFLAGS... $ECHO_C" >&6 MOZILLAXPCOM_CFLAGS=`$PKG_CONFIG --cflags "libxul "` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZILLAXPCOM_CFLAGS" >&5 -$as_echo "$MOZILLAXPCOM_CFLAGS" >&6; } + echo "$as_me:$LINENO: result: $MOZILLAXPCOM_CFLAGS" >&5 +echo "${ECHO_T}$MOZILLAXPCOM_CFLAGS" >&6 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZILLAXPCOM_LIBS" >&5 -$as_echo_n "checking MOZILLAXPCOM_LIBS... " >&6; } + echo "$as_me:$LINENO: checking MOZILLAXPCOM_LIBS" >&5 +echo $ECHO_N "checking MOZILLAXPCOM_LIBS... $ECHO_C" >&6 MOZILLAXPCOM_LIBS=`$PKG_CONFIG --libs "libxul "` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZILLAXPCOM_LIBS" >&5 -$as_echo "$MOZILLAXPCOM_LIBS" >&6; } + echo "$as_me:$LINENO: result: $MOZILLAXPCOM_LIBS" >&5 +echo "${ECHO_T}$MOZILLAXPCOM_LIBS" >&6 else MOZILLAXPCOM_CFLAGS="" MOZILLAXPCOM_LIBS="" @@ -14525,7 +17170,9 @@ $as_echo "$MOZILLAXPCOM_LIBS" >&6; } if test $succeeded = yes; then : else - as_fn_error "Library requirements (libxul ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Library requirements (libxul ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 +echo "$as_me: error: Library requirements (libxul ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} + { (exit 1); exit 1; }; } fi MOZ_INC=`$PKG_CONFIG --variable=includedir libxul` @@ -14543,43 +17190,72 @@ $as_echo "$MOZILLAXPCOM_LIBS" >&6; } save_LIBS="$LIBS" CPPFLAGS="$CPPFLAGS $MOZ_NSS_CFLAGS" LDFLAGS="$LDFLAGS $MOZ_NSS_LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PK11_GetCertFromPrivateKey in -lnss3" >&5 -$as_echo_n "checking for PK11_GetCertFromPrivateKey in -lnss3... " >&6; } -if test "${ac_cv_lib_nss3_PK11_GetCertFromPrivateKey+set}" = set; then : - $as_echo_n "(cached) " >&6 + +echo "$as_me:$LINENO: checking for PK11_GetCertFromPrivateKey in -lnss3" >&5 +echo $ECHO_N "checking for PK11_GetCertFromPrivateKey in -lnss3... $ECHO_C" >&6 +if test "${ac_cv_lib_nss3_PK11_GetCertFromPrivateKey+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnss3 $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char PK11_GetCertFromPrivateKey (); int main () { -return PK11_GetCertFromPrivateKey (); +PK11_GetCertFromPrivateKey (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_nss3_PK11_GetCertFromPrivateKey=yes else - ac_cv_lib_nss3_PK11_GetCertFromPrivateKey=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_nss3_PK11_GetCertFromPrivateKey=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nss3_PK11_GetCertFromPrivateKey" >&5 -$as_echo "$ac_cv_lib_nss3_PK11_GetCertFromPrivateKey" >&6; } -if test "x$ac_cv_lib_nss3_PK11_GetCertFromPrivateKey" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_nss3_PK11_GetCertFromPrivateKey" >&5 +echo "${ECHO_T}$ac_cv_lib_nss3_PK11_GetCertFromPrivateKey" >&6 +if test $ac_cv_lib_nss3_PK11_GetCertFromPrivateKey = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBNSS3 1 _ACEOF @@ -14587,9 +17263,13 @@ _ACEOF LIBS="-lnss3 $LIBS" else - as_fn_error "PK11_GetCertFromPrivateKey missing but needed. + { { echo "$as_me:$LINENO: error: PK11_GetCertFromPrivateKey missing but needed. +See https://bugzilla.mozilla.org/show_bug.cgi?id=262274. +Fixed since nss 3.9.3 (contained by e.g. mozilla >= 1.7.5)" >&5 +echo "$as_me: error: PK11_GetCertFromPrivateKey missing but needed. See https://bugzilla.mozilla.org/show_bug.cgi?id=262274. -Fixed since nss 3.9.3 (contained by e.g. mozilla >= 1.7.5)" "$LINENO" 5 +Fixed since nss 3.9.3 (contained by e.g. mozilla >= 1.7.5)" >&2;} + { (exit 1); exit 1; }; } fi LDFLAGS="$save_LDFLAGS" @@ -14598,16 +17278,20 @@ fi MOZ_LIB_XPCOM=$MOZILLAXPCOM_LIBS if test "$WITH_LDAP" != "NO" && test "$WITH_OPENLDAP" != "YES"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $tmp was compiled with --enable-ldap" >&5 -$as_echo_n "checking whether $tmp was compiled with --enable-ldap... " >&6; } + echo "$as_me:$LINENO: checking whether $tmp was compiled with --enable-ldap" >&5 +echo $ECHO_N "checking whether $tmp was compiled with --enable-ldap... $ECHO_C" >&6 if test -d "$MOZ_INC/ldap"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 MOZ_LDAP_CFLAGS="-I$MOZ_INC" else - as_fn_error "no. + { { echo "$as_me:$LINENO: error: no. Could not find LDAP header include files in $MOZ_INC/ldap. -Please recompile $tmp with --enable-ldap or use --with-openldap." "$LINENO" 5 +Please recompile $tmp with --enable-ldap or use --with-openldap." >&5 +echo "$as_me: error: no. +Could not find LDAP header include files in $MOZ_INC/ldap. +Please recompile $tmp with --enable-ldap or use --with-openldap." >&2;} + { (exit 1); exit 1; }; } fi fi @@ -14618,48 +17302,48 @@ Please recompile $tmp with --enable-ldap or use --with-openldap." "$LINENO" 5 fi elif test "$enable_mozilla" = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 -$as_echo "none" >&6; } + echo "$as_me:$LINENO: result: none" >&5 +echo "${ECHO_T}none" >&6 WITH_MOZILLA=NO ENABLE_NSS_MODULE=NO enable_nss_module=no else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 -$as_echo "internal" >&6; } + echo "$as_me:$LINENO: result: internal" >&5 +echo "${ECHO_T}internal" >&6 SYSTEM_MOZILLA=NO BUILD_TYPE="$BUILD_TYPE MOZ" if test -z "$with_mozilla_version"; then MOZILLA_VERSION= else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking which mozilla version to build" >&5 -$as_echo_n "checking which mozilla version to build... " >&6; } + echo "$as_me:$LINENO: checking which mozilla version to build" >&5 +echo $ECHO_N "checking which mozilla version to build... $ECHO_C" >&6 MOZILLA_VERSION=$with_mozilla_version enable_build_mozilla=1 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZILLA_VERSION" >&5 -$as_echo "$MOZILLA_VERSION" >&6; } + echo "$as_me:$LINENO: result: $MOZILLA_VERSION" >&5 +echo "${ECHO_T}$MOZILLA_VERSION" >&6 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for toolkit mozilla should use" >&5 -$as_echo_n "checking for toolkit mozilla should use... " >&6; } +echo "$as_me:$LINENO: checking for toolkit mozilla should use" >&5 +echo $ECHO_N "checking for toolkit mozilla should use... $ECHO_C" >&6 if test -z "$with_mozilla_toolkit"; then if test "$_os" != "WINNT" ; then if test "$_os" = "Darwin" ; then MOZILLA_TOOLKIT=mac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: mac" >&5 -$as_echo "mac" >&6; } + echo "$as_me:$LINENO: result: mac" >&5 +echo "${ECHO_T}mac" >&6 else MOZILLA_TOOLKIT=gtk2 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: gtk2" >&5 -$as_echo "gtk2" >&6; } + echo "$as_me:$LINENO: result: gtk2" >&5 +echo "${ECHO_T}gtk2" >&6 fi fi else MOZILLA_TOOLKIT=$with_mozilla_toolkit enable_build_mozilla=1 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZILLA_TOOLKIT" >&5 -$as_echo "$MOZILLA_TOOLKIT" >&6; } + echo "$as_me:$LINENO: result: $MOZILLA_TOOLKIT" >&5 +echo "${ECHO_T}$MOZILLA_TOOLKIT" >&6 fi #if test "$_os" = "Darwin" && test "$MOZILLA_TOOLKIT" != "gtk2"; then # #only gtk2 toolkit supported - xlib or cocoa nees glib1 and libIDL1 - the latter is not @@ -14676,55 +17360,63 @@ else enable_build_mozilla= fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build Mozilla/SeaMonkey" >&5 -$as_echo_n "checking whether to build Mozilla/SeaMonkey... " >&6; } +echo "$as_me:$LINENO: checking whether to build Mozilla/SeaMonkey" >&5 +echo $ECHO_N "checking whether to build Mozilla/SeaMonkey... $ECHO_C" >&6 if test -n "$enable_build_mozilla"; then BUILD_MOZAB="TRUE" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else BUILD_MOZAB="" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build provided NSS module" >&5 -$as_echo_n "checking whether to build provided NSS module... " >&6; } +echo "$as_me:$LINENO: checking whether to build provided NSS module" >&5 +echo $ECHO_N "checking whether to build provided NSS module... $ECHO_C" >&6 if test "$enable_nss_module" != "no"; then ENABLE_NSS_MODULE="YES" BUILD_TYPE="$BUILD_TYPE NSS" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 if test "$_os" = "WINNT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Mozilla build tooling" >&5 -$as_echo_n "checking for Mozilla build tooling... " >&6; } + echo "$as_me:$LINENO: checking for Mozilla build tooling" >&5 +echo $ECHO_N "checking for Mozilla build tooling... $ECHO_C" >&6 if test -z "$MOZILLABUILD" ; then -as_fn_error "Mozilla build tooling not found. +{ { echo "$as_me:$LINENO: error: Mozilla build tooling not found. +Use the --with-mozilla-build option after installling the tools obtained +from http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32" >&5 +echo "$as_me: error: Mozilla build tooling not found. Use the --with-mozilla-build option after installling the tools obtained -from http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32" "$LINENO" 5 +from http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32" >&2;} + { (exit 1); exit 1; }; } else if test \( "$WITH_MINGWIN" = "yes" \) ; then if test ! -d "$MOZILLABUILD" ; then -as_fn_error "Mozilla build tooling incomplete!" "$LINENO" 5 +{ { echo "$as_me:$LINENO: error: Mozilla build tooling incomplete!" >&5 +echo "$as_me: error: Mozilla build tooling incomplete!" >&2;} + { (exit 1); exit 1; }; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } + echo "$as_me:$LINENO: result: ok" >&5 +echo "${ECHO_T}ok" >&6 fi else if test ! -d "$MOZILLABUILD/moztools" \ -o ! -d "$MOZILLABUILD/msys" ; then -as_fn_error "Mozilla build tooling incomplete!" "$LINENO" 5 +{ { echo "$as_me:$LINENO: error: Mozilla build tooling incomplete!" >&5 +echo "$as_me: error: Mozilla build tooling incomplete!" >&2;} + { (exit 1); exit 1; }; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } + echo "$as_me:$LINENO: result: ok" >&5 +echo "${ECHO_T}ok" >&6 fi fi fi fi else ENABLE_NSS_MODULE="NO" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi if test "$BUILD_MOZAB" = "TRUE"; then @@ -14732,11 +17424,13 @@ if test "$BUILD_MOZAB" = "TRUE"; then if test "$WITH_MINGWIN" != "yes"; then # compiling with MSVC. Only supported platform here is MSVS2005 at the moment. if test "$MSVSVER" != "2005"; then - as_fn_error "Building SeaMonkey is supported with Microsoft Visual Studio .NET 2005 only." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Building SeaMonkey is supported with Microsoft Visual Studio .NET 2005 only." >&5 +echo "$as_me: error: Building SeaMonkey is supported with Microsoft Visual Studio .NET 2005 only." >&2;} + { (exit 1); exit 1; }; } fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Building SeaMonkey with mingwin is not tested, and likely to break." >&5 -$as_echo "$as_me: WARNING: Building SeaMonkey with mingwin is not tested, and likely to break." >&2;} + { echo "$as_me:$LINENO: WARNING: Building SeaMonkey with mingwin is not tested, and likely to break." >&5 +echo "$as_me: WARNING: Building SeaMonkey with mingwin is not tested, and likely to break." >&2;} echo "Building SeaMonkey with mingwin is not tested, and likely to break." >> warn fi fi @@ -14746,48 +17440,56 @@ $as_echo "$as_me: WARNING: Building SeaMonkey with mingwin is not tested, and li fi MOZILLA_SOURCE_VERSION="seamonkey-${MOZILLA_VERSION}.source" for e in gz bz2; do - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $MOZILLA_SOURCE_VERSION.tar.$e" >&5 -$as_echo_n "checking for $MOZILLA_SOURCE_VERSION.tar.$e... " >&6; } + echo "$as_me:$LINENO: checking for $MOZILLA_SOURCE_VERSION.tar.$e" >&5 +echo $ECHO_N "checking for $MOZILLA_SOURCE_VERSION.tar.$e... $ECHO_C" >&6 if test ! -e "moz/download/$MOZILLA_SOURCE_VERSION.tar.$e" && test "$HAVE_MOZILLA_TARBALL" != "y"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 -$as_echo "not found" >&6; } + echo "$as_me:$LINENO: result: not found" >&5 +echo "${ECHO_T}not found" >&6 HAVE_MOZILLA_TARBALL=n else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 -$as_echo "found" >&6; } + echo "$as_me:$LINENO: result: found" >&5 +echo "${ECHO_T}found" >&6 HAVE_MOZILLA_TARBALL=y fi done if test "$HAVE_MOZILLA_TARBALL" != "y"; then - as_fn_error "Mozilla/SeaMonkey source archive not found. + { { echo "$as_me:$LINENO: error: Mozilla/SeaMonkey source archive not found. +Please copy $MOZILLA_SOURCE_VERSION.tar.bz2 or $MOZILLA_SOURCE_VERSION.tar.gz to moz/download/. +The archives can be found here: +ftp://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/$MOZILLA_VERSION/" >&5 +echo "$as_me: error: Mozilla/SeaMonkey source archive not found. Please copy $MOZILLA_SOURCE_VERSION.tar.bz2 or $MOZILLA_SOURCE_VERSION.tar.gz to moz/download/. The archives can be found here: -ftp://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/$MOZILLA_VERSION/" "$LINENO" 5 +ftp://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/$MOZILLA_VERSION/" >&2;} + { (exit 1); exit 1; }; } fi if test "$_os" = "WINNT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for moztools binaries" >&5 -$as_echo_n "checking for moztools binaries... " >&6; } + echo "$as_me:$LINENO: checking for moztools binaries" >&5 +echo $ECHO_N "checking for moztools binaries... $ECHO_C" >&6 if test ! -e "moz/download/vc8-moztools.zip" ; then - as_fn_error "The following file is missing in moz/download: vc8-moztools.zip -(from ftp://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/historic/vc8/)" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: The following file is missing in moz/download: vc8-moztools.zip +(from ftp://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/historic/vc8/)" >&5 +echo "$as_me: error: The following file is missing in moz/download: vc8-moztools.zip +(from ftp://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/historic/vc8/)" >&2;} + { (exit 1); exit 1; }; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } + echo "$as_me:$LINENO: result: ok" >&5 +echo "${ECHO_T}ok" >&6 fi elif test "$_os" = "Darwin"; then if test "$MOZILLA_TOOLKIT" = "gtk2"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mozilla can be built..." >&5 -$as_echo "$as_me: checking whether mozilla can be built..." >&6;} + { echo "$as_me:$LINENO: checking whether mozilla can be built..." >&5 +echo "$as_me: checking whether mozilla can be built..." >&6;} succeeded=no if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -14799,30 +17501,29 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG + if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test "$PKG_CONFIG" = "no" ; then @@ -14833,25 +17534,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gtk+-2.0 >= 2.4 libIDL-2.0 >= 0.8" >&5 -$as_echo_n "checking for gtk+-2.0 >= 2.4 libIDL-2.0 >= 0.8... " >&6; } + echo "$as_me:$LINENO: checking for gtk+-2.0 >= 2.4 libIDL-2.0 >= 0.8" >&5 +echo $ECHO_N "checking for gtk+-2.0 >= 2.4 libIDL-2.0 >= 0.8... $ECHO_C" >&6 if $PKG_CONFIG --exists "gtk+-2.0 >= 2.4 libIDL-2.0 >= 0.8" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 succeeded=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZGTK2_CFLAGS" >&5 -$as_echo_n "checking MOZGTK2_CFLAGS... " >&6; } + echo "$as_me:$LINENO: checking MOZGTK2_CFLAGS" >&5 +echo $ECHO_N "checking MOZGTK2_CFLAGS... $ECHO_C" >&6 MOZGTK2_CFLAGS=`$PKG_CONFIG --cflags "gtk+-2.0 >= 2.4 libIDL-2.0 >= 0.8"` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZGTK2_CFLAGS" >&5 -$as_echo "$MOZGTK2_CFLAGS" >&6; } + echo "$as_me:$LINENO: result: $MOZGTK2_CFLAGS" >&5 +echo "${ECHO_T}$MOZGTK2_CFLAGS" >&6 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZGTK2_LIBS" >&5 -$as_echo_n "checking MOZGTK2_LIBS... " >&6; } + echo "$as_me:$LINENO: checking MOZGTK2_LIBS" >&5 +echo $ECHO_N "checking MOZGTK2_LIBS... $ECHO_C" >&6 MOZGTK2_LIBS=`$PKG_CONFIG --libs "gtk+-2.0 >= 2.4 libIDL-2.0 >= 0.8"` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZGTK2_LIBS" >&5 -$as_echo "$MOZGTK2_LIBS" >&6; } + echo "$as_me:$LINENO: result: $MOZGTK2_LIBS" >&5 +echo "${ECHO_T}$MOZGTK2_LIBS" >&6 else MOZGTK2_CFLAGS="" MOZGTK2_LIBS="" @@ -14870,10 +17571,12 @@ $as_echo "$MOZGTK2_LIBS" >&6; } fi if test $succeeded = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: OK - can build mozilla" >&5 -$as_echo "$as_me: OK - can build mozilla" >&6;} + { echo "$as_me:$LINENO: OK - can build mozilla" >&5 +echo "$as_me: OK - can build mozilla" >&6;} else - as_fn_error "Prerequisites to build mozilla not met. Either use the precompiled mozilla binaries or install the missing packages" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Prerequisites to build mozilla not met. Either use the precompiled mozilla binaries or install the missing packages" >&5 +echo "$as_me: error: Prerequisites to build mozilla not met. Either use the precompiled mozilla binaries or install the missing packages" >&2;} + { (exit 1); exit 1; }; } fi else @@ -14883,10 +17586,10 @@ $as_echo "$as_me: OK - can build mozilla" >&6;} if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -14898,30 +17601,29 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG + if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test "$PKG_CONFIG" = "no" ; then @@ -14932,25 +17634,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libIDL-2.0 >= 0.6.3" >&5 -$as_echo_n "checking for libIDL-2.0 >= 0.6.3... " >&6; } + echo "$as_me:$LINENO: checking for libIDL-2.0 >= 0.6.3" >&5 +echo $ECHO_N "checking for libIDL-2.0 >= 0.6.3... $ECHO_C" >&6 if $PKG_CONFIG --exists "libIDL-2.0 >= 0.6.3" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 succeeded=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZLIBREQ_CFLAGS" >&5 -$as_echo_n "checking MOZLIBREQ_CFLAGS... " >&6; } + echo "$as_me:$LINENO: checking MOZLIBREQ_CFLAGS" >&5 +echo $ECHO_N "checking MOZLIBREQ_CFLAGS... $ECHO_C" >&6 MOZLIBREQ_CFLAGS=`$PKG_CONFIG --cflags "libIDL-2.0 >= 0.6.3"` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZLIBREQ_CFLAGS" >&5 -$as_echo "$MOZLIBREQ_CFLAGS" >&6; } + echo "$as_me:$LINENO: result: $MOZLIBREQ_CFLAGS" >&5 +echo "${ECHO_T}$MOZLIBREQ_CFLAGS" >&6 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZLIBREQ_LIBS" >&5 -$as_echo_n "checking MOZLIBREQ_LIBS... " >&6; } + echo "$as_me:$LINENO: checking MOZLIBREQ_LIBS" >&5 +echo $ECHO_N "checking MOZLIBREQ_LIBS... $ECHO_C" >&6 MOZLIBREQ_LIBS=`$PKG_CONFIG --libs "libIDL-2.0 >= 0.6.3"` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZLIBREQ_LIBS" >&5 -$as_echo "$MOZLIBREQ_LIBS" >&6; } + echo "$as_me:$LINENO: result: $MOZLIBREQ_LIBS" >&5 +echo "${ECHO_T}$MOZLIBREQ_LIBS" >&6 else MOZLIBREQ_CFLAGS="" MOZLIBREQ_LIBS="" @@ -14975,7 +17677,9 @@ $as_echo "$MOZLIBREQ_LIBS" >&6; } fi if test -z "$MOZIDL"; then - as_fn_error "libIDL 0.6.3 or newer is needed to build mozilla with mac toolkit." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: libIDL 0.6.3 or newer is needed to build mozilla with mac toolkit." >&5 +echo "$as_me: error: libIDL 0.6.3 or newer is needed to build mozilla with mac toolkit." >&2;} + { (exit 1); exit 1; }; } fi fi else @@ -14987,10 +17691,10 @@ $as_echo "$MOZLIBREQ_LIBS" >&6; } if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -15002,30 +17706,29 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG + if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test "$PKG_CONFIG" = "no" ; then @@ -15036,25 +17739,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gtk+-2.0" >&5 -$as_echo_n "checking for gtk+-2.0... " >&6; } + echo "$as_me:$LINENO: checking for gtk+-2.0" >&5 +echo $ECHO_N "checking for gtk+-2.0... $ECHO_C" >&6 if $PKG_CONFIG --exists "gtk+-2.0" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 succeeded=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZLIBREQ_CFLAGS" >&5 -$as_echo_n "checking MOZLIBREQ_CFLAGS... " >&6; } + echo "$as_me:$LINENO: checking MOZLIBREQ_CFLAGS" >&5 +echo $ECHO_N "checking MOZLIBREQ_CFLAGS... $ECHO_C" >&6 MOZLIBREQ_CFLAGS=`$PKG_CONFIG --cflags "gtk+-2.0"` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZLIBREQ_CFLAGS" >&5 -$as_echo "$MOZLIBREQ_CFLAGS" >&6; } + echo "$as_me:$LINENO: result: $MOZLIBREQ_CFLAGS" >&5 +echo "${ECHO_T}$MOZLIBREQ_CFLAGS" >&6 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZLIBREQ_LIBS" >&5 -$as_echo_n "checking MOZLIBREQ_LIBS... " >&6; } + echo "$as_me:$LINENO: checking MOZLIBREQ_LIBS" >&5 +echo $ECHO_N "checking MOZLIBREQ_LIBS... $ECHO_C" >&6 MOZLIBREQ_LIBS=`$PKG_CONFIG --libs "gtk+-2.0"` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZLIBREQ_LIBS" >&5 -$as_echo "$MOZLIBREQ_LIBS" >&6; } + echo "$as_me:$LINENO: result: $MOZLIBREQ_LIBS" >&5 +echo "${ECHO_T}$MOZLIBREQ_LIBS" >&6 else MOZLIBREQ_CFLAGS="" MOZLIBREQ_LIBS="" @@ -15079,7 +17782,9 @@ $as_echo "$MOZLIBREQ_LIBS" >&6; } fi if test -z "$MOZGTK"; then - as_fn_error "GTK2 is needed to build mozilla." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: GTK2 is needed to build mozilla." >&5 +echo "$as_me: error: GTK2 is needed to build mozilla." >&2;} + { (exit 1); exit 1; }; } fi succeeded=no @@ -15087,10 +17792,10 @@ $as_echo "$MOZLIBREQ_LIBS" >&6; } if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -15102,30 +17807,29 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG + if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test "$PKG_CONFIG" = "no" ; then @@ -15136,25 +17840,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libIDL-2.0 >= 0.8.0" >&5 -$as_echo_n "checking for libIDL-2.0 >= 0.8.0... " >&6; } + echo "$as_me:$LINENO: checking for libIDL-2.0 >= 0.8.0" >&5 +echo $ECHO_N "checking for libIDL-2.0 >= 0.8.0... $ECHO_C" >&6 if $PKG_CONFIG --exists "libIDL-2.0 >= 0.8.0" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 succeeded=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZLIBREQ_CFLAGS" >&5 -$as_echo_n "checking MOZLIBREQ_CFLAGS... " >&6; } + echo "$as_me:$LINENO: checking MOZLIBREQ_CFLAGS" >&5 +echo $ECHO_N "checking MOZLIBREQ_CFLAGS... $ECHO_C" >&6 MOZLIBREQ_CFLAGS=`$PKG_CONFIG --cflags "libIDL-2.0 >= 0.8.0"` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZLIBREQ_CFLAGS" >&5 -$as_echo "$MOZLIBREQ_CFLAGS" >&6; } + echo "$as_me:$LINENO: result: $MOZLIBREQ_CFLAGS" >&5 +echo "${ECHO_T}$MOZLIBREQ_CFLAGS" >&6 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZLIBREQ_LIBS" >&5 -$as_echo_n "checking MOZLIBREQ_LIBS... " >&6; } + echo "$as_me:$LINENO: checking MOZLIBREQ_LIBS" >&5 +echo $ECHO_N "checking MOZLIBREQ_LIBS... $ECHO_C" >&6 MOZLIBREQ_LIBS=`$PKG_CONFIG --libs "libIDL-2.0 >= 0.8.0"` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZLIBREQ_LIBS" >&5 -$as_echo "$MOZLIBREQ_LIBS" >&6; } + echo "$as_me:$LINENO: result: $MOZLIBREQ_LIBS" >&5 +echo "${ECHO_T}$MOZLIBREQ_LIBS" >&6 else MOZLIBREQ_CFLAGS="" MOZLIBREQ_LIBS="" @@ -15179,7 +17883,9 @@ $as_echo "$MOZLIBREQ_LIBS" >&6; } fi if test -z "$MOZIDL"; then - as_fn_error "libIDL >= 0.8.0 is needed when using GTK2 to build mozilla." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: libIDL >= 0.8.0 is needed when using GTK2 to build mozilla." >&5 +echo "$as_me: error: libIDL >= 0.8.0 is needed when using GTK2 to build mozilla." >&2;} + { (exit 1); exit 1; }; } fi else @@ -15188,10 +17894,10 @@ $as_echo "$MOZLIBREQ_LIBS" >&6; } if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -15203,30 +17909,29 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG + if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test "$PKG_CONFIG" = "no" ; then @@ -15237,25 +17942,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gtk+ >= 1.2.3" >&5 -$as_echo_n "checking for gtk+ >= 1.2.3... " >&6; } + echo "$as_me:$LINENO: checking for gtk+ >= 1.2.3" >&5 +echo $ECHO_N "checking for gtk+ >= 1.2.3... $ECHO_C" >&6 if $PKG_CONFIG --exists "gtk+ >= 1.2.3" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 succeeded=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZLIBREQ_CFLAGS" >&5 -$as_echo_n "checking MOZLIBREQ_CFLAGS... " >&6; } + echo "$as_me:$LINENO: checking MOZLIBREQ_CFLAGS" >&5 +echo $ECHO_N "checking MOZLIBREQ_CFLAGS... $ECHO_C" >&6 MOZLIBREQ_CFLAGS=`$PKG_CONFIG --cflags "gtk+ >= 1.2.3"` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZLIBREQ_CFLAGS" >&5 -$as_echo "$MOZLIBREQ_CFLAGS" >&6; } + echo "$as_me:$LINENO: result: $MOZLIBREQ_CFLAGS" >&5 +echo "${ECHO_T}$MOZLIBREQ_CFLAGS" >&6 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZLIBREQ_LIBS" >&5 -$as_echo_n "checking MOZLIBREQ_LIBS... " >&6; } + echo "$as_me:$LINENO: checking MOZLIBREQ_LIBS" >&5 +echo $ECHO_N "checking MOZLIBREQ_LIBS... $ECHO_C" >&6 MOZLIBREQ_LIBS=`$PKG_CONFIG --libs "gtk+ >= 1.2.3"` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZLIBREQ_LIBS" >&5 -$as_echo "$MOZLIBREQ_LIBS" >&6; } + echo "$as_me:$LINENO: result: $MOZLIBREQ_LIBS" >&5 +echo "${ECHO_T}$MOZLIBREQ_LIBS" >&6 else MOZLIBREQ_CFLAGS="" MOZLIBREQ_LIBS="" @@ -15280,7 +17985,9 @@ $as_echo "$MOZLIBREQ_LIBS" >&6; } fi if test -z "$MOZGTK"; then - as_fn_error "gtk 1.2 is needed when not using GTK2 to build mozilla." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: gtk 1.2 is needed when not using GTK2 to build mozilla." >&5 +echo "$as_me: error: gtk 1.2 is needed when not using GTK2 to build mozilla." >&2;} + { (exit 1); exit 1; }; } fi succeeded=no @@ -15288,10 +17995,10 @@ $as_echo "$MOZLIBREQ_LIBS" >&6; } if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -15303,30 +18010,29 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG + if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test "$PKG_CONFIG" = "no" ; then @@ -15337,25 +18043,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libidl >= 0.6.3 libidl <= 0.6.8" >&5 -$as_echo_n "checking for libidl >= 0.6.3 libidl <= 0.6.8... " >&6; } + echo "$as_me:$LINENO: checking for libidl >= 0.6.3 libidl <= 0.6.8" >&5 +echo $ECHO_N "checking for libidl >= 0.6.3 libidl <= 0.6.8... $ECHO_C" >&6 if $PKG_CONFIG --exists "libidl >= 0.6.3 libidl <= 0.6.8" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 succeeded=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZLIBREQ_CFLAGS" >&5 -$as_echo_n "checking MOZLIBREQ_CFLAGS... " >&6; } + echo "$as_me:$LINENO: checking MOZLIBREQ_CFLAGS" >&5 +echo $ECHO_N "checking MOZLIBREQ_CFLAGS... $ECHO_C" >&6 MOZLIBREQ_CFLAGS=`$PKG_CONFIG --cflags "libidl >= 0.6.3 libidl <= 0.6.8"` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZLIBREQ_CFLAGS" >&5 -$as_echo "$MOZLIBREQ_CFLAGS" >&6; } + echo "$as_me:$LINENO: result: $MOZLIBREQ_CFLAGS" >&5 +echo "${ECHO_T}$MOZLIBREQ_CFLAGS" >&6 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking MOZLIBREQ_LIBS" >&5 -$as_echo_n "checking MOZLIBREQ_LIBS... " >&6; } + echo "$as_me:$LINENO: checking MOZLIBREQ_LIBS" >&5 +echo $ECHO_N "checking MOZLIBREQ_LIBS... $ECHO_C" >&6 MOZLIBREQ_LIBS=`$PKG_CONFIG --libs "libidl >= 0.6.3 libidl <= 0.6.8"` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOZLIBREQ_LIBS" >&5 -$as_echo "$MOZLIBREQ_LIBS" >&6; } + echo "$as_me:$LINENO: result: $MOZLIBREQ_LIBS" >&5 +echo "${ECHO_T}$MOZLIBREQ_LIBS" >&6 else MOZLIBREQ_CFLAGS="" MOZLIBREQ_LIBS="" @@ -15380,7 +18086,9 @@ $as_echo "$MOZLIBREQ_LIBS" >&6; } fi if test -z "$MOZIDL"; then - as_fn_error "libIDL 0.6.3 - 0.6.8 is needed when not using GTK2 to build mozilla." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: libIDL 0.6.3 - 0.6.8 is needed when not using GTK2 to build mozilla." >&5 +echo "$as_me: error: libIDL 0.6.3 - 0.6.8 is needed when not using GTK2 to build mozilla." >&2;} + { (exit 1); exit 1; }; } fi fi fi @@ -15400,61 +18108,225 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which sane header to use" >&5 -$as_echo_n "checking which sane header to use... " >&6; } +echo "$as_me:$LINENO: checking which sane header to use" >&5 +echo $ECHO_N "checking which sane header to use... $ECHO_C" >&6 if test -n "$with_system_sane_header" -o -n "$with_system_headers" && \ test "$with_system_sane_header" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 -$as_echo "external" >&6; } + echo "$as_me:$LINENO: result: external" >&5 +echo "${ECHO_T}external" >&6 SYSTEM_SANE_HEADER=YES - ac_fn_c_check_header_mongrel "$LINENO" "sane/sane.h" "ac_cv_header_sane_sane_h" "$ac_includes_default" -if test "x$ac_cv_header_sane_sane_h" = x""yes; then : + if test "${ac_cv_header_sane_sane_h+set}" = set; then + echo "$as_me:$LINENO: checking for sane/sane.h" >&5 +echo $ECHO_N "checking for sane/sane.h... $ECHO_C" >&6 +if test "${ac_cv_header_sane_sane_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_sane_sane_h" >&5 +echo "${ECHO_T}$ac_cv_header_sane_sane_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking sane/sane.h usability" >&5 +echo $ECHO_N "checking sane/sane.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking sane/sane.h presence" >&5 +echo $ECHO_N "checking sane/sane.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: sane/sane.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: sane/sane.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: sane/sane.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: sane/sane.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: sane/sane.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: sane/sane.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: sane/sane.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: sane/sane.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: sane/sane.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: sane/sane.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: sane/sane.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: sane/sane.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: sane/sane.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: sane/sane.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: sane/sane.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: sane/sane.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for sane/sane.h" >&5 +echo $ECHO_N "checking for sane/sane.h... $ECHO_C" >&6 +if test "${ac_cv_header_sane_sane_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_sane_sane_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_sane_sane_h" >&5 +echo "${ECHO_T}$ac_cv_header_sane_sane_h" >&6 +fi +if test $ac_cv_header_sane_sane_h = yes; then + : else - as_fn_error "sane not found. install sane" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: sane not found. install sane" >&5 +echo "$as_me: error: sane not found. install sane" >&2;} + { (exit 1); exit 1; }; } fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 -$as_echo "internal" >&6; } + echo "$as_me:$LINENO: result: internal" >&5 +echo "${ECHO_T}internal" >&6 SYSTEM_SANE_HEADER=NO BUILD_TYPE="$BUILD_TYPE SANE" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which icu to use" >&5 -$as_echo_n "checking which icu to use... " >&6; } +echo "$as_me:$LINENO: checking which icu to use" >&5 +echo $ECHO_N "checking which icu to use... $ECHO_C" >&6 if test -n "$with_system_icu" -o -n "$with_system_libs" && \ test "$with_system_icu" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 -$as_echo "external" >&6; } + echo "$as_me:$LINENO: result: external" >&5 +echo "${ECHO_T}external" >&6 SYSTEM_ICU=YES - ac_ext=cpp + ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unicode/rbbi.h" >&5 -$as_echo_n "checking for unicode/rbbi.h... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + echo "$as_me:$LINENO: checking for unicode/rbbi.h" >&5 +echo $ECHO_N "checking for unicode/rbbi.h... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ unicode/rbbi.h _ACEOF -if ac_fn_cxx_try_cpp "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked." >&5 -$as_echo "checked." >&6; } +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi else - as_fn_error "icu headers not found." "$LINENO" 5 + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + echo "$as_me:$LINENO: result: checked." >&5 +echo "${ECHO_T}checked." >&6 +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { { echo "$as_me:$LINENO: error: icu headers not found." >&5 +echo "$as_me: error: icu headers not found." >&2;} + { (exit 1); exit 1; }; } fi rm -f conftest.err conftest.$ac_ext # Extract the first word of "genbrk", so it can be a program name with args. set dummy genbrk; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_SYSTEM_GENBRK+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_SYSTEM_GENBRK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $SYSTEM_GENBRK in [\\/]* | ?:[\\/]*) @@ -15467,38 +18339,39 @@ for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_SYSTEM_GENBRK="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done ;; esac fi SYSTEM_GENBRK=$ac_cv_path_SYSTEM_GENBRK + if test -n "$SYSTEM_GENBRK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SYSTEM_GENBRK" >&5 -$as_echo "$SYSTEM_GENBRK" >&6; } + echo "$as_me:$LINENO: result: $SYSTEM_GENBRK" >&5 +echo "${ECHO_T}$SYSTEM_GENBRK" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test -z "$SYSTEM_GENBRK"; then - as_fn_error "\\"genbrk\\" not found in \$PATH, install the icu development tool \\"genbrk\"\" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: \\"genbrk\\" not found in \$PATH, install the icu development tool \\"genbrk\"\" >&5 +echo "$as_me: error: \\"genbrk\\" not found in \$PATH, install the icu development tool \\"genbrk\"\" >&2;} + { (exit 1); exit 1; }; } fi # Extract the first word of "genccode", so it can be a program name with args. set dummy genccode; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_SYSTEM_GENCCODE+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_SYSTEM_GENCCODE+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $SYSTEM_GENCCODE in [\\/]* | ?:[\\/]*) @@ -15511,38 +18384,39 @@ for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_SYSTEM_GENCCODE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done ;; esac fi SYSTEM_GENCCODE=$ac_cv_path_SYSTEM_GENCCODE + if test -n "$SYSTEM_GENCCODE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SYSTEM_GENCCODE" >&5 -$as_echo "$SYSTEM_GENCCODE" >&6; } + echo "$as_me:$LINENO: result: $SYSTEM_GENCCODE" >&5 +echo "${ECHO_T}$SYSTEM_GENCCODE" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test -z "$SYSTEM_GENCCODE"; then - as_fn_error "\\"genccode\\" not found in \$PATH, install the icu development tool \\"genccode\"\" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: \\"genccode\\" not found in \$PATH, install the icu development tool \\"genccode\"\" >&5 +echo "$as_me: error: \\"genccode\\" not found in \$PATH, install the icu development tool \\"genccode\"\" >&2;} + { (exit 1); exit 1; }; } fi # Extract the first word of "gencmn", so it can be a program name with args. set dummy gencmn; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_SYSTEM_GENCMN+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_SYSTEM_GENCMN+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $SYSTEM_GENCMN in [\\/]* | ?:[\\/]*) @@ -15555,41 +18429,47 @@ for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_SYSTEM_GENCMN="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done ;; esac fi SYSTEM_GENCMN=$ac_cv_path_SYSTEM_GENCMN + if test -n "$SYSTEM_GENCMN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SYSTEM_GENCMN" >&5 -$as_echo "$SYSTEM_GENCMN" >&6; } + echo "$as_me:$LINENO: result: $SYSTEM_GENCMN" >&5 +echo "${ECHO_T}$SYSTEM_GENCMN" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test -z "$SYSTEM_GENCMN"; then - as_fn_error "\\"gencmn\\" not found in \$PATH, install the icu development tool \\"gencmn\"\" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: \\"gencmn\\" not found in \$PATH, install the icu development tool \\"gencmn\"\" >&5 +echo "$as_me: error: \\"gencmn\\" not found in \$PATH, install the icu development tool \\"gencmn\"\" >&2;} + { (exit 1); exit 1; }; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking ICU version" >&5 -$as_echo_n "checking ICU version... " >&6; } - if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot run test program while cross compiling -See \`config.log' for more details." "$LINENO" 5; } -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + echo "$as_me:$LINENO: checking ICU version" >&5 +echo $ECHO_N "checking ICU version... $ECHO_C" >&6 + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include @@ -15602,16 +18482,31 @@ int main(int argc, char **argv) { } _ACEOF -if ac_fn_cxx_try_run "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5 -$as_echo "OK" >&6; } +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + echo "$as_me:$LINENO: result: OK" >&5 +echo "${ECHO_T}OK" >&6 else - as_fn_error "not suitable, only >= 4.0 supported currently" "$LINENO" 5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: not suitable, only >= 4.0 supported currently" >&5 +echo "$as_me: error: not suitable, only >= 4.0 supported currently" >&2;} + { (exit 1); exit 1; }; } fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -15619,8 +18514,8 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 -$as_echo "internal" >&6; } + echo "$as_me:$LINENO: result: internal" >&5 +echo "${ECHO_T}internal" >&6 SYSTEM_ICU=NO BUILD_TYPE="$BUILD_TYPE ICU" fi @@ -15630,18 +18525,18 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable graphite support" >&5 -$as_echo_n "checking whether to enable graphite support... " >&6; } +echo "$as_me:$LINENO: checking whether to enable graphite support" >&5 +echo $ECHO_N "checking whether to enable graphite support... $ECHO_C" >&6 if test "$_os" = "WINNT" -o "$_os" = "Linux" && test "z$enable_graphite" == "z" -o "$enable_graphite" != "no" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 ENABLE_GRAPHITE="TRUE" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking which graphite to use" >&5 -$as_echo_n "checking which graphite to use... " >&6; } + echo "$as_me:$LINENO: checking which graphite to use" >&5 +echo $ECHO_N "checking which graphite to use... $ECHO_C" >&6 if test -n "$with_system_graphite" -o -n "$with_system_libs" && \ test "$with_system_graphite" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 -$as_echo "external" >&6; } + echo "$as_me:$LINENO: result: external" >&5 +echo "${ECHO_T}external" >&6 SYSTEM_GRAPHITE=YES succeeded=no @@ -15649,10 +18544,10 @@ $as_echo "external" >&6; } if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -15664,30 +18559,29 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG + if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test "$PKG_CONFIG" = "no" ; then @@ -15698,25 +18592,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for silgraphite " >&5 -$as_echo_n "checking for silgraphite ... " >&6; } + echo "$as_me:$LINENO: checking for silgraphite " >&5 +echo $ECHO_N "checking for silgraphite ... $ECHO_C" >&6 if $PKG_CONFIG --exists "silgraphite " ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 succeeded=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking GRAPHITE_CFLAGS" >&5 -$as_echo_n "checking GRAPHITE_CFLAGS... " >&6; } + echo "$as_me:$LINENO: checking GRAPHITE_CFLAGS" >&5 +echo $ECHO_N "checking GRAPHITE_CFLAGS... $ECHO_C" >&6 GRAPHITE_CFLAGS=`$PKG_CONFIG --cflags "silgraphite "` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GRAPHITE_CFLAGS" >&5 -$as_echo "$GRAPHITE_CFLAGS" >&6; } + echo "$as_me:$LINENO: result: $GRAPHITE_CFLAGS" >&5 +echo "${ECHO_T}$GRAPHITE_CFLAGS" >&6 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking GRAPHITE_LIBS" >&5 -$as_echo_n "checking GRAPHITE_LIBS... " >&6; } + echo "$as_me:$LINENO: checking GRAPHITE_LIBS" >&5 +echo $ECHO_N "checking GRAPHITE_LIBS... $ECHO_C" >&6 GRAPHITE_LIBS=`$PKG_CONFIG --libs "silgraphite "` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GRAPHITE_LIBS" >&5 -$as_echo "$GRAPHITE_LIBS" >&6; } + echo "$as_me:$LINENO: result: $GRAPHITE_LIBS" >&5 +echo "${ECHO_T}$GRAPHITE_LIBS" >&6 else GRAPHITE_CFLAGS="" GRAPHITE_LIBS="" @@ -15737,18 +18631,20 @@ $as_echo "$GRAPHITE_LIBS" >&6; } if test $succeeded = yes; then : else - as_fn_error "Library requirements (silgraphite ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Library requirements (silgraphite ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 +echo "$as_me: error: Library requirements (silgraphite ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} + { (exit 1); exit 1; }; } fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 -$as_echo "internal" >&6; } + echo "$as_me:$LINENO: result: internal" >&5 +echo "${ECHO_T}internal" >&6 SYSTEM_GRAPHITE=NO BUILD_TYPE="$BUILD_TYPE GRAPHITE" fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi @@ -15758,13 +18654,15 @@ fi if test "$_os" = "Darwin"; then if test "x$with_x" = "xyes"; then - as_fn_error "X11 build is no longer supported on MacOSX, please use the native aqua build" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: X11 build is no longer supported on MacOSX, please use the native aqua build" >&5 +echo "$as_me: error: X11 build is no longer supported on MacOSX, please use the native aqua build" >&2;} + { (exit 1); exit 1; }; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /System/Library/Frameworks/AppKit.framework" >&5 -$as_echo_n "checking for /System/Library/Frameworks/AppKit.framework... " >&6; } + echo "$as_me:$LINENO: checking for /System/Library/Frameworks/AppKit.framework" >&5 +echo $ECHO_N "checking for /System/Library/Frameworks/AppKit.framework... $ECHO_C" >&6 if test -d "/System/Library/Frameworks/AppKit.framework/"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 x_includes="no_x_includes" x_libraries="no_x_libraries" enable_gtk=no @@ -15772,7 +18670,9 @@ $as_echo "yes" >&6; } ENABLE_CUPS="" else - as_fn_error "No AppKit.framewrok found" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: No AppKit.framewrok found" >&5 +echo "$as_me: error: No AppKit.framewrok found" >&2;} + { (exit 1); exit 1; }; } fi fi fi @@ -15784,47 +18684,44 @@ elif test "$_os" = "OS2" ; then echo "Do Nothing for _os = OS2. Don't check for X11." : elif test "$_os" != "WINNT" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5 -$as_echo_n "checking for X... " >&6; } + echo "$as_me:$LINENO: checking for X" >&5 +echo $ECHO_N "checking for X... $ECHO_C" >&6 -# Check whether --with-x was given. -if test "${with_x+set}" = set; then : - withval=$with_x; -fi +# Check whether --with-x or --without-x was given. +if test "${with_x+set}" = set; then + withval="$with_x" +fi; # $have_x is `yes', `no', `disabled', or empty when we do not yet know. if test "x$with_x" = xno; then # The user explicitly disabled X. have_x=disabled else - case $x_includes,$x_libraries in #( - *\'*) as_fn_error "cannot use X directory names containing '" "$LINENO" 5;; #( - *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then : - $as_echo_n "(cached) " >&6 + if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then + # Both variables are already set. + have_x=yes + else + if test "${ac_cv_have_x+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else # One or both of the vars are not set, and there is no cached value. ac_x_includes=no ac_x_libraries=no -rm -f -r conftest.dir +rm -fr conftest.dir if mkdir conftest.dir; then cd conftest.dir + # Make sure to not put "make" in the Imakefile rules, since we grep it out. cat >Imakefile <<'_ACEOF' -incroot: - @echo incroot='${INCROOT}' -usrlibdir: - @echo usrlibdir='${USRLIBDIR}' -libdir: - @echo libdir='${LIBDIR}' -_ACEOF - if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then +acfindx: + @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"' +_ACEOF + if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then # GNU make sometimes prints "make[1]: Entering...", which would confuse us. - for ac_var in incroot usrlibdir libdir; do - eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" - done + eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. - for ac_extension in a so sl dylib la dll; do - if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && - test -f "$ac_im_libdir/libX11.$ac_extension"; then + for ac_extension in a so sl; do + if test ! -f $ac_im_usrlibdir/libX11.$ac_extension && + test -f $ac_im_libdir/libX11.$ac_extension; then ac_im_usrlibdir=$ac_im_libdir; break fi done @@ -15832,41 +18729,37 @@ _ACEOF # bogus both because they are the default anyway, and because # using them would break gcc on systems where it needs fixed includes. case $ac_im_incroot in - /usr/include) ac_x_includes= ;; + /usr/include) ;; *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; esac case $ac_im_usrlibdir in - /usr/lib | /usr/lib64 | /lib | /lib64) ;; + /usr/lib | /lib) ;; *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; esac fi cd .. - rm -f -r conftest.dir + rm -fr conftest.dir fi # Standard set of common directories for X headers. # Check X11 before X11Rn because it is often a symlink to the current release. ac_x_header_dirs=' /usr/X11/include -/usr/X11R7/include /usr/X11R6/include /usr/X11R5/include /usr/X11R4/include /usr/include/X11 -/usr/include/X11R7 /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 /usr/local/X11/include -/usr/local/X11R7/include /usr/local/X11R6/include /usr/local/X11R5/include /usr/local/X11R4/include /usr/local/include/X11 -/usr/local/include/X11R7 /usr/local/include/X11R6 /usr/local/include/X11R5 /usr/local/include/X11R4 @@ -15886,18 +18779,42 @@ ac_x_header_dirs=' /usr/openwin/share/include' if test "$ac_x_includes" = no; then - # Guess where to find include files, by looking for Xlib.h. + # Guess where to find include files, by looking for Intrinsic.h. # First, try using that file with no special directory specified. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then # We can compile using X headers with no special include directory. ac_x_includes= else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + for ac_dir in $ac_x_header_dirs; do - if test -r "$ac_dir/X11/Xlib.h"; then + if test -r "$ac_dir/X11/Intrinsic.h"; then ac_x_includes=$ac_dir break fi @@ -15911,76 +18828,102 @@ if test "$ac_x_libraries" = no; then # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS - LIBS="-lX11 $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + LIBS="-lXt $LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include int main () { -XrmInitialize () +XtMalloc (0) ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else - LIBS=$ac_save_LIBS -for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +LIBS=$ac_save_LIBS +for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! - for ac_extension in a so sl dylib la dll; do - if test -r "$ac_dir/libX11.$ac_extension"; then + for ac_extension in a so sl; do + if test -r $ac_dir/libXt.$ac_extension; then ac_x_libraries=$ac_dir break 2 fi done done fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi # $ac_x_libraries = no -case $ac_x_includes,$ac_x_libraries in #( - no,* | *,no | *\'*) - # Didn't find X, or a directory has "'" in its name. - ac_cv_have_x="have_x=no";; #( - *) - # Record where we found X for the cache. - ac_cv_have_x="have_x=yes\ - ac_x_includes='$ac_x_includes'\ - ac_x_libraries='$ac_x_libraries'" -esac +if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then + # Didn't find X anywhere. Cache the known absence of X. + ac_cv_have_x="have_x=no" +else + # Record where we found X for the cache. + ac_cv_have_x="have_x=yes \ + ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" fi -;; #( - *) have_x=yes;; - esac +fi + + fi eval "$ac_cv_have_x" fi # $with_x != no if test "$have_x" != yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5 -$as_echo "$have_x" >&6; } + echo "$as_me:$LINENO: result: $have_x" >&5 +echo "${ECHO_T}$have_x" >&6 no_x=yes else # If each of the values was on the command line, it overrides each guess. test "x$x_includes" = xNONE && x_includes=$ac_x_includes test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries # Update the cache value to reflect the command line values. - ac_cv_have_x="have_x=yes\ - ac_x_includes='$x_includes'\ - ac_x_libraries='$x_libraries'" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5 -$as_echo "libraries $x_libraries, headers $x_includes" >&6; } + ac_cv_have_x="have_x=yes \ + ac_x_includes=$x_includes ac_x_libraries=$x_libraries" + echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5 +echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6 fi if test "$no_x" = yes; then # Not all programs may use this symbol, but it does not hurt to define it. -$as_echo "#define X_DISPLAY_MISSING 1" >>confdefs.h +cat >>confdefs.h <<\_ACEOF +#define X_DISPLAY_MISSING 1 +_ACEOF X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= else @@ -15993,12 +18936,16 @@ else X_LIBS="$X_LIBS -L$x_libraries" # For Solaris; some versions of Sun CC require a space after -R and # others require no space. Words are not sufficient . . . . - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -R must be followed by a space" >&5 -$as_echo_n "checking whether -R must be followed by a space... " >&6; } - ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" - ac_xsave_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + case `(uname -sr) 2>/dev/null` in + "SunOS 5"*) + echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5 +echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6 + ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -16009,13 +18956,48 @@ main () return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - X_LIBS="$X_LIBS -R$x_libraries" +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_R_nospace=yes else - LIBS="$ac_xsave_LIBS -R $x_libraries" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_R_nospace=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test $ac_R_nospace = yes; then + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + X_LIBS="$X_LIBS -R$x_libraries" + else + LIBS="$ac_xsave_LIBS -R $x_libraries" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int @@ -16026,21 +19008,48 @@ main () return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - X_LIBS="$X_LIBS -R $x_libraries" +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_R_space=yes else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: neither works" >&5 -$as_echo "neither works" >&6; } -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_R_space=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - ac_c_werror_flag=$ac_xsave_c_werror_flag - LIBS=$ac_xsave_LIBS +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test $ac_R_space = yes; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + X_LIBS="$X_LIBS -R $x_libraries" + else + echo "$as_me:$LINENO: result: neither works" >&5 +echo "${ECHO_T}neither works" >&6 + fi + fi + LIBS=$ac_xsave_LIBS + esac fi # Check for system-dependent libraries X programs must link with. @@ -16054,112 +19063,196 @@ rm -f core conftest.err conftest.$ac_objext \ # libraries were built with DECnet support. And Karl Berry says # the Alpha needs dnet_stub (dnet does not exist). ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char XOpenDisplay (); int main () { -return XOpenDisplay (); +XOpenDisplay (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5 -$as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; } -if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5 +echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6 +if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char dnet_ntoa (); int main () { -return dnet_ntoa (); +dnet_ntoa (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_dnet_dnet_ntoa=yes else - ac_cv_lib_dnet_dnet_ntoa=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dnet_dnet_ntoa=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 -$as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; } -if test "x$ac_cv_lib_dnet_dnet_ntoa" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 +echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6 +if test $ac_cv_lib_dnet_dnet_ntoa = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet_stub" >&5 -$as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; } -if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet_stub" >&5 +echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6 +if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet_stub $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char dnet_ntoa (); int main () { -return dnet_ntoa (); +dnet_ntoa (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_dnet_stub_dnet_ntoa=yes else - ac_cv_lib_dnet_stub_dnet_ntoa=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_dnet_stub_dnet_ntoa=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 -$as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } -if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 +echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6 +if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" fi fi fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS="$ac_xsave_LIBS" # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, @@ -16170,90 +19263,232 @@ rm -f core conftest.err conftest.$ac_objext \ # on Irix 5.2, according to T.E. Dickey. # The functions gethostbyname, getservbyname, and inet_addr are # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. - ac_fn_c_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" -if test "x$ac_cv_func_gethostbyname" = x""yes; then : + echo "$as_me:$LINENO: checking for gethostbyname" >&5 +echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6 +if test "${ac_cv_func_gethostbyname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define gethostbyname to an innocuous variant, in case declares gethostbyname. + For example, HP-UX 11i declares gettimeofday. */ +#define gethostbyname innocuous_gethostbyname + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char gethostbyname (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef gethostbyname + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gethostbyname (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname) +choke me +#else +char (*f) () = gethostbyname; +#endif +#ifdef __cplusplus +} +#endif +int +main () +{ +return f != gethostbyname; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_gethostbyname=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_gethostbyname=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi +echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 +echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6 if test $ac_cv_func_gethostbyname = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 -$as_echo_n "checking for gethostbyname in -lnsl... " >&6; } -if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 +echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6 +if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char gethostbyname (); int main () { -return gethostbyname (); +gethostbyname (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_nsl_gethostbyname=yes else - ac_cv_lib_nsl_gethostbyname=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_nsl_gethostbyname=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 -$as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } -if test "x$ac_cv_lib_nsl_gethostbyname" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 +echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6 +if test $ac_cv_lib_nsl_gethostbyname = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" fi if test $ac_cv_lib_nsl_gethostbyname = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lbsd" >&5 -$as_echo_n "checking for gethostbyname in -lbsd... " >&6; } -if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5 +echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6 +if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char gethostbyname (); int main () { -return gethostbyname (); +gethostbyname (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_bsd_gethostbyname=yes else - ac_cv_lib_bsd_gethostbyname=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_bsd_gethostbyname=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5 -$as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; } -if test "x$ac_cv_lib_bsd_gethostbyname" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5 +echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6 +if test $ac_cv_lib_bsd_gethostbyname = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" fi @@ -16267,147 +19502,489 @@ fi # variants that don't use the name server (or something). -lsocket # must be given before -lnsl if both are needed. We assume that # if connect needs -lnsl, so does gethostbyname. - ac_fn_c_check_func "$LINENO" "connect" "ac_cv_func_connect" -if test "x$ac_cv_func_connect" = x""yes; then : + echo "$as_me:$LINENO: checking for connect" >&5 +echo $ECHO_N "checking for connect... $ECHO_C" >&6 +if test "${ac_cv_func_connect+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define connect to an innocuous variant, in case declares connect. + For example, HP-UX 11i declares gettimeofday. */ +#define connect innocuous_connect + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char connect (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef connect + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char connect (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_connect) || defined (__stub___connect) +choke me +#else +char (*f) () = connect; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != connect; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_connect=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_func_connect=no fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 +echo "${ECHO_T}$ac_cv_func_connect" >&6 if test $ac_cv_func_connect = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5 -$as_echo_n "checking for connect in -lsocket... " >&6; } -if test "${ac_cv_lib_socket_connect+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for connect in -lsocket" >&5 +echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6 +if test "${ac_cv_lib_socket_connect+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $X_EXTRA_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char connect (); int main () { -return connect (); +connect (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_socket_connect=yes else - ac_cv_lib_socket_connect=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_socket_connect=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5 -$as_echo "$ac_cv_lib_socket_connect" >&6; } -if test "x$ac_cv_lib_socket_connect" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5 +echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6 +if test $ac_cv_lib_socket_connect = yes; then X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" fi fi # Guillermo Gomez says -lposix is necessary on A/UX. - ac_fn_c_check_func "$LINENO" "remove" "ac_cv_func_remove" -if test "x$ac_cv_func_remove" = x""yes; then : + echo "$as_me:$LINENO: checking for remove" >&5 +echo $ECHO_N "checking for remove... $ECHO_C" >&6 +if test "${ac_cv_func_remove+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define remove to an innocuous variant, in case declares remove. + For example, HP-UX 11i declares gettimeofday. */ +#define remove innocuous_remove + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char remove (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef remove + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char remove (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_remove) || defined (__stub___remove) +choke me +#else +char (*f) () = remove; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != remove; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_remove=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_remove=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5 +echo "${ECHO_T}$ac_cv_func_remove" >&6 + + if test $ac_cv_func_remove = no; then + echo "$as_me:$LINENO: checking for remove in -lposix" >&5 +echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6 +if test "${ac_cv_lib_posix_remove+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lposix $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char remove (); +int +main () +{ +remove (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_posix_remove=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_lib_posix_remove=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5 +echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6 +if test $ac_cv_lib_posix_remove = yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" fi - if test $ac_cv_func_remove = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for remove in -lposix" >&5 -$as_echo_n "checking for remove in -lposix... " >&6; } -if test "${ac_cv_lib_posix_remove+set}" = set; then : - $as_echo_n "(cached) " >&6 + fi + + # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. + echo "$as_me:$LINENO: checking for shmat" >&5 +echo $ECHO_N "checking for shmat... $ECHO_C" >&6 +if test "${ac_cv_func_shmat+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lposix $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +/* Define shmat to an innocuous variant, in case declares shmat. + For example, HP-UX 11i declares gettimeofday. */ +#define shmat innocuous_shmat -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shmat (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef shmat + +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" +{ #endif -char remove (); +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shmat (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_shmat) || defined (__stub___shmat) +choke me +#else +char (*f) () = shmat; +#endif +#ifdef __cplusplus +} +#endif + int main () { -return remove (); +return f != shmat; ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_posix_remove=yes +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_shmat=yes else - ac_cv_lib_posix_remove=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5 -$as_echo "$ac_cv_lib_posix_remove" >&6; } -if test "x$ac_cv_lib_posix_remove" = x""yes; then : - X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" -fi - - fi - - # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. - ac_fn_c_check_func "$LINENO" "shmat" "ac_cv_func_shmat" -if test "x$ac_cv_func_shmat" = x""yes; then : + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_func_shmat=no fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5 +echo "${ECHO_T}$ac_cv_func_shmat" >&6 if test $ac_cv_func_shmat = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shmat in -lipc" >&5 -$as_echo_n "checking for shmat in -lipc... " >&6; } -if test "${ac_cv_lib_ipc_shmat+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for shmat in -lipc" >&5 +echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6 +if test "${ac_cv_lib_ipc_shmat+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lipc $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char shmat (); int main () { -return shmat (); +shmat (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_ipc_shmat=yes else - ac_cv_lib_ipc_shmat=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_ipc_shmat=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5 -$as_echo "$ac_cv_lib_ipc_shmat" >&6; } -if test "x$ac_cv_lib_ipc_shmat" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5 +echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6 +if test $ac_cv_lib_ipc_shmat = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" fi @@ -16423,43 +20000,71 @@ fi # These have to be linked with before -lX11, unlike the other # libraries we check for below, so use a different variable. # John Interrante, Karl Berry - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IceConnectionNumber in -lICE" >&5 -$as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; } -if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for IceConnectionNumber in -lICE" >&5 +echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6 +if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lICE $X_EXTRA_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char IceConnectionNumber (); int main () { -return IceConnectionNumber (); +IceConnectionNumber (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_ICE_IceConnectionNumber=yes else - ac_cv_lib_ICE_IceConnectionNumber=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_ICE_IceConnectionNumber=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 -$as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; } -if test "x$ac_cv_lib_ICE_IceConnectionNumber" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 +echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6 +if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" fi @@ -16476,92 +20081,154 @@ fi x_libraries="default_x_libraries" fi if test -z "$x_libraries"; then - as_fn_error "No X libraries found" "$LINENO" 5 # Exit + { { echo "$as_me:$LINENO: error: No X libraries found" >&5 +echo "$as_me: error: No X libraries found" >&2;} + { (exit 1); exit 1; }; } # Exit fi if test -z "$x_includes"; then - as_fn_error "No X includes found" "$LINENO" 5 # Exit + { { echo "$as_me:$LINENO: error: No X includes found" >&5 +echo "$as_me: error: No X includes found" >&2;} + { (exit 1); exit 1; }; } # Exit fi CFLAGS=$X_CFLAGS LDFLAGS="$X_LDFLAGS $X_LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XOpenDisplay in -lX11" >&5 -$as_echo_n "checking for XOpenDisplay in -lX11... " >&6; } -if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for XOpenDisplay in -lX11" >&5 +echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6 +if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lX11 $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char XOpenDisplay (); int main () { -return XOpenDisplay (); +XOpenDisplay (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_X11_XOpenDisplay=yes else - ac_cv_lib_X11_XOpenDisplay=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_X11_XOpenDisplay=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_X11_XOpenDisplay" >&5 -$as_echo "$ac_cv_lib_X11_XOpenDisplay" >&6; } -if test "x$ac_cv_lib_X11_XOpenDisplay" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_X11_XOpenDisplay" >&5 +echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6 +if test $ac_cv_lib_X11_XOpenDisplay = yes; then x_libs="-lX11 $X_EXTRA_LIBS" else - as_fn_error "X Development libraries not found" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: X Development libraries not found" >&5 +echo "$as_me: error: X Development libraries not found" >&2;} + { (exit 1); exit 1; }; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XauDisposeAuth in -lXau" >&5 -$as_echo_n "checking for XauDisposeAuth in -lXau... " >&6; } -if test "${ac_cv_lib_Xau_XauDisposeAuth+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for XauDisposeAuth in -lXau" >&5 +echo $ECHO_N "checking for XauDisposeAuth in -lXau... $ECHO_C" >&6 +if test "${ac_cv_lib_Xau_XauDisposeAuth+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXau $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char XauDisposeAuth (); int main () { -return XauDisposeAuth (); +XauDisposeAuth (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_Xau_XauDisposeAuth=yes else - ac_cv_lib_Xau_XauDisposeAuth=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_Xau_XauDisposeAuth=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xau_XauDisposeAuth" >&5 -$as_echo "$ac_cv_lib_Xau_XauDisposeAuth" >&6; } -if test "x$ac_cv_lib_Xau_XauDisposeAuth" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_Xau_XauDisposeAuth" >&5 +echo "${ECHO_T}$ac_cv_lib_Xau_XauDisposeAuth" >&6 +if test $ac_cv_lib_Xau_XauDisposeAuth = yes; then XAU_LIBS="-lXau" fi @@ -16593,76 +20260,205 @@ fi if test "$_os" != "WINNT" -a "$_os" != "OS2" -a "$_os" != "Darwin"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use Xaw" >&5 -$as_echo_n "checking whether to use Xaw... " >&6; } + echo "$as_me:$LINENO: checking whether to use Xaw" >&5 +echo $ECHO_N "checking whether to use Xaw... $ECHO_C" >&6 if test "$enable_Xaw" = "no"; then DISABLE_XAW=TRUE - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - for ac_header in X11/Composite.h -do : - ac_fn_c_check_header_compile "$LINENO" "X11/Composite.h" "ac_cv_header_X11_Composite_h" "#include -" -if test "x$ac_cv_header_X11_Composite_h" = x""yes; then : + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + +for ac_header in X11/Composite.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_X11_COMPOSITE_H 1 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else - as_fn_error "Xt include headers not found" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Xt include headers not found" >&5 +echo "$as_me: error: Xt include headers not found" >&2;} + { (exit 1); exit 1; }; } fi done else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - for ac_header in X11/Xaw/Label.h -do : - ac_fn_c_check_header_compile "$LINENO" "X11/Xaw/Label.h" "ac_cv_header_X11_Xaw_Label_h" "#include -" -if test "x$ac_cv_header_X11_Xaw_Label_h" = x""yes; then : + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +for ac_header in X11/Xaw/Label.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_X11_XAW_LABEL_H 1 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else - as_fn_error "Xaw include headers not found" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Xaw include headers not found" >&5 +echo "$as_me: error: Xaw include headers not found" >&2;} + { (exit 1); exit 1; }; } fi done - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lXaw" >&5 -$as_echo_n "checking for main in -lXaw... " >&6; } -if test "${ac_cv_lib_Xaw_main+set}" = set; then : - $as_echo_n "(cached) " >&6 + +echo "$as_me:$LINENO: checking for main in -lXaw" >&5 +echo $ECHO_N "checking for main in -lXaw... $ECHO_C" >&6 +if test "${ac_cv_lib_Xaw_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXaw $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { -return main (); +main (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_Xaw_main=yes else - ac_cv_lib_Xaw_main=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_Xaw_main=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xaw_main" >&5 -$as_echo "$ac_cv_lib_Xaw_main" >&6; } -if test "x$ac_cv_lib_Xaw_main" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_Xaw_main" >&5 +echo "${ECHO_T}$ac_cv_lib_Xaw_main" >&6 +if test $ac_cv_lib_Xaw_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBXAW 1 _ACEOF @@ -16670,7 +20466,9 @@ _ACEOF LIBS="-lXaw $LIBS" else - as_fn_error "Xaw library not found or functional" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Xaw library not found or functional" >&5 +echo "$as_me: error: Xaw library not found or functional" >&2;} + { (exit 1); exit 1; }; } fi fi @@ -16680,23 +20478,166 @@ fi if test "$ENABLE_FONTCONFIG" = "TRUE" ; then - ac_fn_c_check_header_mongrel "$LINENO" "fontconfig/fontconfig.h" "ac_cv_header_fontconfig_fontconfig_h" "$ac_includes_default" -if test "x$ac_cv_header_fontconfig_fontconfig_h" = x""yes; then : + if test "${ac_cv_header_fontconfig_fontconfig_h+set}" = set; then + echo "$as_me:$LINENO: checking for fontconfig/fontconfig.h" >&5 +echo $ECHO_N "checking for fontconfig/fontconfig.h... $ECHO_C" >&6 +if test "${ac_cv_header_fontconfig_fontconfig_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_fontconfig_fontconfig_h" >&5 +echo "${ECHO_T}$ac_cv_header_fontconfig_fontconfig_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking fontconfig/fontconfig.h usability" >&5 +echo $ECHO_N "checking fontconfig/fontconfig.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking fontconfig/fontconfig.h presence" >&5 +echo $ECHO_N "checking fontconfig/fontconfig.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: fontconfig/fontconfig.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: fontconfig/fontconfig.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: fontconfig/fontconfig.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: fontconfig/fontconfig.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: fontconfig/fontconfig.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: fontconfig/fontconfig.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: fontconfig/fontconfig.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: fontconfig/fontconfig.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: fontconfig/fontconfig.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: fontconfig/fontconfig.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: fontconfig/fontconfig.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: fontconfig/fontconfig.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: fontconfig/fontconfig.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: fontconfig/fontconfig.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: fontconfig/fontconfig.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: fontconfig/fontconfig.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for fontconfig/fontconfig.h" >&5 +echo $ECHO_N "checking for fontconfig/fontconfig.h... $ECHO_C" >&6 +if test "${ac_cv_header_fontconfig_fontconfig_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_fontconfig_fontconfig_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_fontconfig_fontconfig_h" >&5 +echo "${ECHO_T}$ac_cv_header_fontconfig_fontconfig_h" >&6 +fi +if test $ac_cv_header_fontconfig_fontconfig_h = yes; then + : else - as_fn_error "fontconfig/fontconfig.h could not be found. libfontconfig1-dev or fontconfig???-devel missing?" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: fontconfig/fontconfig.h could not be found. libfontconfig1-dev or fontconfig???-devel missing?" >&5 +echo "$as_me: error: fontconfig/fontconfig.h could not be found. libfontconfig1-dev or fontconfig???-devel missing?" >&2;} + { (exit 1); exit 1; }; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fontconfig is >= 2.2.0" >&5 -$as_echo_n "checking whether fontconfig is >= 2.2.0... " >&6; } - if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot run test program while cross compiling -See \`config.log' for more details." "$LINENO" 5; } + echo "$as_me:$LINENO: checking whether fontconfig is >= 2.2.0" >&5 +echo $ECHO_N "checking whether fontconfig is >= 2.2.0... $ECHO_C" >&6 + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include @@ -16707,89 +20648,271 @@ int main(int argc, char **argv) { } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else - as_fn_error "no, fontconfig >= 2.2.0 needed" "$LINENO" 5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: no, fontconfig >= 2.2.0 needed" >&5 +echo "$as_me: error: no, fontconfig >= 2.2.0 needed" >&2;} + { (exit 1); exit 1; }; } fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to link to Xrender" >&5 -$as_echo_n "checking whether to link to Xrender... " >&6; } +echo "$as_me:$LINENO: checking whether to link to Xrender" >&5 +echo $ECHO_N "checking whether to link to Xrender... $ECHO_C" >&6 if test -n "$enable_xrender_link" -a "$enable_xrender_link" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 XRENDER_LINK=YES with_system_xrender_headers=yes else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, dynamically open it" >&5 -$as_echo "no, dynamically open it" >&6; } + echo "$as_me:$LINENO: result: no, dynamically open it" >&5 +echo "${ECHO_T}no, dynamically open it" >&6 XRENDER_LINK=NO fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which Xrender headers to use" >&5 -$as_echo_n "checking which Xrender headers to use... " >&6; } +echo "$as_me:$LINENO: checking which Xrender headers to use" >&5 +echo $ECHO_N "checking which Xrender headers to use... $ECHO_C" >&6 if test -n "$with_system_xrender_headers" -o -n "$with_system_headers" && \ test "$with_system_xrender_headers" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 -$as_echo "external" >&6; } + echo "$as_me:$LINENO: result: external" >&5 +echo "${ECHO_T}external" >&6 SYSTEM_XRENDER_HEADERS=YES - ac_fn_c_check_header_mongrel "$LINENO" "X11/extensions/Xrender.h" "ac_cv_header_X11_extensions_Xrender_h" "$ac_includes_default" -if test "x$ac_cv_header_X11_extensions_Xrender_h" = x""yes; then : + if test "${ac_cv_header_X11_extensions_Xrender_h+set}" = set; then + echo "$as_me:$LINENO: checking for X11/extensions/Xrender.h" >&5 +echo $ECHO_N "checking for X11/extensions/Xrender.h... $ECHO_C" >&6 +if test "${ac_cv_header_X11_extensions_Xrender_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_Xrender_h" >&5 +echo "${ECHO_T}$ac_cv_header_X11_extensions_Xrender_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking X11/extensions/Xrender.h usability" >&5 +echo $ECHO_N "checking X11/extensions/Xrender.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking X11/extensions/Xrender.h presence" >&5 +echo $ECHO_N "checking X11/extensions/Xrender.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: X11/extensions/Xrender.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: X11/extensions/Xrender.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: X11/extensions/Xrender.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: X11/extensions/Xrender.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: X11/extensions/Xrender.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: X11/extensions/Xrender.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: X11/extensions/Xrender.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: X11/extensions/Xrender.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: X11/extensions/Xrender.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: X11/extensions/Xrender.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: X11/extensions/Xrender.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: X11/extensions/Xrender.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: X11/extensions/Xrender.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: X11/extensions/Xrender.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: X11/extensions/Xrender.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: X11/extensions/Xrender.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for X11/extensions/Xrender.h" >&5 +echo $ECHO_N "checking for X11/extensions/Xrender.h... $ECHO_C" >&6 +if test "${ac_cv_header_X11_extensions_Xrender_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_X11_extensions_Xrender_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_Xrender_h" >&5 +echo "${ECHO_T}$ac_cv_header_X11_extensions_Xrender_h" >&6 +fi +if test $ac_cv_header_X11_extensions_Xrender_h = yes; then + : else - as_fn_error "Xrender not found. install X" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Xrender not found. install X" >&5 +echo "$as_me: error: Xrender not found. install X" >&2;} + { (exit 1); exit 1; }; } fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 -$as_echo "internal" >&6; } + echo "$as_me:$LINENO: result: internal" >&5 +echo "${ECHO_T}internal" >&6 SYSTEM_XRENDER_HEADERS=NO BUILD_TYPE="$BUILD_TYPE X11_EXTENSIONS" fi if test "$XRENDER_LINK" = "YES"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XRenderQueryVersion in -lXrender" >&5 -$as_echo_n "checking for XRenderQueryVersion in -lXrender... " >&6; } -if test "${ac_cv_lib_Xrender_XRenderQueryVersion+set}" = set; then : - $as_echo_n "(cached) " >&6 + +echo "$as_me:$LINENO: checking for XRenderQueryVersion in -lXrender" >&5 +echo $ECHO_N "checking for XRenderQueryVersion in -lXrender... $ECHO_C" >&6 +if test "${ac_cv_lib_Xrender_XRenderQueryVersion+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXrender $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char XRenderQueryVersion (); int main () { -return XRenderQueryVersion (); +XRenderQueryVersion (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_Xrender_XRenderQueryVersion=yes else - ac_cv_lib_Xrender_XRenderQueryVersion=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_Xrender_XRenderQueryVersion=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xrender_XRenderQueryVersion" >&5 -$as_echo "$ac_cv_lib_Xrender_XRenderQueryVersion" >&6; } -if test "x$ac_cv_lib_Xrender_XRenderQueryVersion" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_Xrender_XRenderQueryVersion" >&5 +echo "${ECHO_T}$ac_cv_lib_Xrender_XRenderQueryVersion" >&6 +if test $ac_cv_lib_Xrender_XRenderQueryVersion = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBXRENDER 1 _ACEOF @@ -16797,20 +20920,22 @@ _ACEOF LIBS="-lXrender $LIBS" else - as_fn_error "libXrender not found or functional" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: libXrender not found or functional" >&5 +echo "$as_me: error: libXrender not found or functional" >&2;} + { (exit 1); exit 1; }; } fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable RandR support" >&5 -$as_echo_n "checking whether to enable RandR support... " >&6; } +echo "$as_me:$LINENO: checking whether to enable RandR support" >&5 +echo $ECHO_N "checking whether to enable RandR support... $ECHO_C" >&6 if test "$test_randr" = "yes" -a \( "$enable_randr" = "yes" -o "$enable_randr" = "TRUE" \) ; then if test -z "$enable_randr_link" -o "$enable_randr_link" = "no"; then XRANDR_DLOPEN="TRUE" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: resorting to dlopen libXrandr at runtime" >&5 -$as_echo "resorting to dlopen libXrandr at runtime" >&6; } + echo "$as_me:$LINENO: result: resorting to dlopen libXrandr at runtime" >&5 +echo "${ECHO_T}resorting to dlopen libXrandr at runtime" >&6 else XRANDR_DLOPEN="FALSE" @@ -16819,10 +20944,10 @@ $as_echo "resorting to dlopen libXrandr at runtime" >&6; } if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -16834,30 +20959,29 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG + if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test "$PKG_CONFIG" = "no" ; then @@ -16868,25 +20992,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xrandr >= 1.2" >&5 -$as_echo_n "checking for xrandr >= 1.2... " >&6; } + echo "$as_me:$LINENO: checking for xrandr >= 1.2" >&5 +echo $ECHO_N "checking for xrandr >= 1.2... $ECHO_C" >&6 if $PKG_CONFIG --exists "xrandr >= 1.2" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 succeeded=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking XRANDR_CFLAGS" >&5 -$as_echo_n "checking XRANDR_CFLAGS... " >&6; } + echo "$as_me:$LINENO: checking XRANDR_CFLAGS" >&5 +echo $ECHO_N "checking XRANDR_CFLAGS... $ECHO_C" >&6 XRANDR_CFLAGS=`$PKG_CONFIG --cflags "xrandr >= 1.2"` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XRANDR_CFLAGS" >&5 -$as_echo "$XRANDR_CFLAGS" >&6; } + echo "$as_me:$LINENO: result: $XRANDR_CFLAGS" >&5 +echo "${ECHO_T}$XRANDR_CFLAGS" >&6 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking XRANDR_LIBS" >&5 -$as_echo_n "checking XRANDR_LIBS... " >&6; } + echo "$as_me:$LINENO: checking XRANDR_LIBS" >&5 +echo $ECHO_N "checking XRANDR_LIBS... $ECHO_C" >&6 XRANDR_LIBS=`$PKG_CONFIG --libs "xrandr >= 1.2"` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XRANDR_LIBS" >&5 -$as_echo "$XRANDR_LIBS" >&6; } + echo "$as_me:$LINENO: result: $XRANDR_LIBS" >&5 +echo "${ECHO_T}$XRANDR_LIBS" >&6 else XRANDR_CFLAGS="" XRANDR_LIBS="" @@ -16898,65 +21022,232 @@ $as_echo "$XRANDR_LIBS" >&6; } - else - echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." - echo "*** See http://www.freedesktop.org/software/pkgconfig" - fi - fi + else + echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." + echo "*** See http://www.freedesktop.org/software/pkgconfig" + fi + fi + + if test $succeeded = yes; then + ENABLE_RANDR="TRUE" + else + ENABLE_RANDR="" + fi + + if test "$ENABLE_RANDR" != "TRUE"; then + if test "${ac_cv_header_X11_extensions_Xrandr_h+set}" = set; then + echo "$as_me:$LINENO: checking for X11/extensions/Xrandr.h" >&5 +echo $ECHO_N "checking for X11/extensions/Xrandr.h... $ECHO_C" >&6 +if test "${ac_cv_header_X11_extensions_Xrandr_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_Xrandr_h" >&5 +echo "${ECHO_T}$ac_cv_header_X11_extensions_Xrandr_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking X11/extensions/Xrandr.h usability" >&5 +echo $ECHO_N "checking X11/extensions/Xrandr.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 - if test $succeeded = yes; then - ENABLE_RANDR="TRUE" +# Is the header present? +echo "$as_me:$LINENO: checking X11/extensions/Xrandr.h presence" >&5 +echo $ECHO_N "checking X11/extensions/Xrandr.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else - ENABLE_RANDR="" + ac_cpp_err= fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - if test "$ENABLE_RANDR" != "TRUE"; then - ac_fn_c_check_header_mongrel "$LINENO" "X11/extensions/Xrandr.h" "ac_cv_header_X11_extensions_Xrandr_h" "$ac_includes_default" -if test "x$ac_cv_header_X11_extensions_Xrandr_h" = x""yes; then : + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: X11/extensions/Xrandr.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: X11/extensions/Xrandr.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: X11/extensions/Xrandr.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: X11/extensions/Xrandr.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: X11/extensions/Xrandr.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: X11/extensions/Xrandr.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: X11/extensions/Xrandr.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: X11/extensions/Xrandr.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: X11/extensions/Xrandr.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: X11/extensions/Xrandr.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: X11/extensions/Xrandr.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: X11/extensions/Xrandr.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: X11/extensions/Xrandr.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: X11/extensions/Xrandr.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: X11/extensions/Xrandr.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: X11/extensions/Xrandr.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for X11/extensions/Xrandr.h" >&5 +echo $ECHO_N "checking for X11/extensions/Xrandr.h... $ECHO_C" >&6 +if test "${ac_cv_header_X11_extensions_Xrandr_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_X11_extensions_Xrandr_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_Xrandr_h" >&5 +echo "${ECHO_T}$ac_cv_header_X11_extensions_Xrandr_h" >&6 +fi +if test $ac_cv_header_X11_extensions_Xrandr_h = yes; then + : else - as_fn_error "X11/extensions/Xrandr.h could not be found. X11 dev missing?" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: X11/extensions/Xrandr.h could not be found. X11 dev missing?" >&5 +echo "$as_me: error: X11/extensions/Xrandr.h could not be found. X11 dev missing?" >&2;} + { (exit 1); exit 1; }; } fi XRANDR_CFLAGS=" " - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XRRQueryExtension in -lXrandr" >&5 -$as_echo_n "checking for XRRQueryExtension in -lXrandr... " >&6; } -if test "${ac_cv_lib_Xrandr_XRRQueryExtension+set}" = set; then : - $as_echo_n "(cached) " >&6 + +echo "$as_me:$LINENO: checking for XRRQueryExtension in -lXrandr" >&5 +echo $ECHO_N "checking for XRRQueryExtension in -lXrandr... $ECHO_C" >&6 +if test "${ac_cv_lib_Xrandr_XRRQueryExtension+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXrandr $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char XRRQueryExtension (); int main () { -return XRRQueryExtension (); +XRRQueryExtension (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_Xrandr_XRRQueryExtension=yes else - ac_cv_lib_Xrandr_XRRQueryExtension=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_Xrandr_XRRQueryExtension=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xrandr_XRRQueryExtension" >&5 -$as_echo "$ac_cv_lib_Xrandr_XRRQueryExtension" >&6; } -if test "x$ac_cv_lib_Xrandr_XRRQueryExtension" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_Xrandr_XRRQueryExtension" >&5 +echo "${ECHO_T}$ac_cv_lib_Xrandr_XRRQueryExtension" >&6 +if test $ac_cv_lib_Xrandr_XRRQueryExtension = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBXRANDR 1 _ACEOF @@ -16964,51 +21255,53 @@ _ACEOF LIBS="-lXrandr $LIBS" else - as_fn_error "libXrandr not found or functional" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: libXrandr not found or functional" >&5 +echo "$as_me: error: libXrandr not found or functional" >&2;} + { (exit 1); exit 1; }; } fi XRANDR_LIBS="-lXrandr " ENABLE_RANDR="TRUE" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: enabling RandR support" >&5 -$as_echo "enabling RandR support" >&6; } + echo "$as_me:$LINENO: result: enabling RandR support" >&5 +echo "${ECHO_T}enabling RandR support" >&6 fi fi else ENABLE_RANDR="" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use neon" >&5 -$as_echo_n "checking whether to use neon... " >&6; } +echo "$as_me:$LINENO: checking whether to use neon" >&5 +echo $ECHO_N "checking whether to use neon... $ECHO_C" >&6 if test "$enable_neon" = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 DISABLE_NEON=TRUE else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which neon to use" >&5 -$as_echo_n "checking which neon to use... " >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +echo "$as_me:$LINENO: checking which neon to use" >&5 +echo $ECHO_N "checking which neon to use... $ECHO_C" >&6 if test -n "$with_system_neon" -o -n "$with_system_libs" && \ test "$with_system_neon" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 -$as_echo "external" >&6; } + echo "$as_me:$LINENO: result: external" >&5 +echo "${ECHO_T}external" >&6 succeeded=no if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -17020,30 +21313,29 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG + if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test "$PKG_CONFIG" = "no" ; then @@ -17054,25 +21346,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for neon >= 0.24.0" >&5 -$as_echo_n "checking for neon >= 0.24.0... " >&6; } + echo "$as_me:$LINENO: checking for neon >= 0.24.0" >&5 +echo $ECHO_N "checking for neon >= 0.24.0... $ECHO_C" >&6 if $PKG_CONFIG --exists "neon >= 0.24.0" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 succeeded=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking NEON_CFLAGS" >&5 -$as_echo_n "checking NEON_CFLAGS... " >&6; } + echo "$as_me:$LINENO: checking NEON_CFLAGS" >&5 +echo $ECHO_N "checking NEON_CFLAGS... $ECHO_C" >&6 NEON_CFLAGS=`$PKG_CONFIG --cflags "neon >= 0.24.0"` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NEON_CFLAGS" >&5 -$as_echo "$NEON_CFLAGS" >&6; } + echo "$as_me:$LINENO: result: $NEON_CFLAGS" >&5 +echo "${ECHO_T}$NEON_CFLAGS" >&6 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking NEON_LIBS" >&5 -$as_echo_n "checking NEON_LIBS... " >&6; } + echo "$as_me:$LINENO: checking NEON_LIBS" >&5 +echo $ECHO_N "checking NEON_LIBS... $ECHO_C" >&6 NEON_LIBS=`$PKG_CONFIG --libs "neon >= 0.24.0"` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NEON_LIBS" >&5 -$as_echo "$NEON_LIBS" >&6; } + echo "$as_me:$LINENO: result: $NEON_LIBS" >&5 +echo "${ECHO_T}$NEON_LIBS" >&6 else NEON_CFLAGS="" NEON_LIBS="" @@ -17093,15 +21385,17 @@ $as_echo "$NEON_LIBS" >&6; } if test $succeeded = yes; then : else - as_fn_error "you need neon >= 0.24.x for system-neon" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: you need neon >= 0.24.x for system-neon" >&5 +echo "$as_me: error: you need neon >= 0.24.x for system-neon" >&2;} + { (exit 1); exit 1; }; } fi NEON_VERSION="`$PKG_CONFIG --modversion neon | $SED 's/\.//g'`" NEON_CFLAGS="$NEON_CFLAGS -DSYSTEM_NEON -DUSE_DAV_LOCKS=1" SYSTEM_NEON=YES else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 -$as_echo "internal" >&6; } + echo "$as_me:$LINENO: result: internal" >&5 +echo "${ECHO_T}internal" >&6 SYSTEM_NEON=NO NEON_LIBS=-lneon NEON_CFLAGS= @@ -17116,12 +21410,12 @@ fi if test "$_os" = "Darwin" && test "$with_system_openssl" != "no"; then with_system_openssl=yes fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which libssl to use" >&5 -$as_echo_n "checking which libssl to use... " >&6; } +echo "$as_me:$LINENO: checking which libssl to use" >&5 +echo $ECHO_N "checking which libssl to use... $ECHO_C" >&6 if test -n "$with_system_openssl" -o -n "$with_system_libs" && \ test "$with_system_openssl" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 -$as_echo "external" >&6; } + echo "$as_me:$LINENO: result: external" >&5 +echo "${ECHO_T}external" >&6 # Mac OS builds should get out without extra stuff is the Mac porters' # wish. And pkg-config is although Xcode ships a .pc for openssl if test "$_os" = "Darwin"; then @@ -17134,10 +21428,10 @@ $as_echo "external" >&6; } if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -17149,30 +21443,29 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG + if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test "$PKG_CONFIG" = "no" ; then @@ -17183,25 +21476,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openssl " >&5 -$as_echo_n "checking for openssl ... " >&6; } + echo "$as_me:$LINENO: checking for openssl " >&5 +echo $ECHO_N "checking for openssl ... $ECHO_C" >&6 if $PKG_CONFIG --exists "openssl " ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 succeeded=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking OPENSSL_CFLAGS" >&5 -$as_echo_n "checking OPENSSL_CFLAGS... " >&6; } + echo "$as_me:$LINENO: checking OPENSSL_CFLAGS" >&5 +echo $ECHO_N "checking OPENSSL_CFLAGS... $ECHO_C" >&6 OPENSSL_CFLAGS=`$PKG_CONFIG --cflags "openssl "` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OPENSSL_CFLAGS" >&5 -$as_echo "$OPENSSL_CFLAGS" >&6; } + echo "$as_me:$LINENO: result: $OPENSSL_CFLAGS" >&5 +echo "${ECHO_T}$OPENSSL_CFLAGS" >&6 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking OPENSSL_LIBS" >&5 -$as_echo_n "checking OPENSSL_LIBS... " >&6; } + echo "$as_me:$LINENO: checking OPENSSL_LIBS" >&5 +echo $ECHO_N "checking OPENSSL_LIBS... $ECHO_C" >&6 OPENSSL_LIBS=`$PKG_CONFIG --libs "openssl "` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OPENSSL_LIBS" >&5 -$as_echo "$OPENSSL_LIBS" >&6; } + echo "$as_me:$LINENO: result: $OPENSSL_LIBS" >&5 +echo "${ECHO_T}$OPENSSL_LIBS" >&6 else OPENSSL_CFLAGS="" OPENSSL_LIBS="" @@ -17222,14 +21515,16 @@ $as_echo "$OPENSSL_LIBS" >&6; } if test $succeeded = yes; then : else - as_fn_error "Library requirements (openssl ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Library requirements (openssl ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 +echo "$as_me: error: Library requirements (openssl ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} + { (exit 1); exit 1; }; } fi fi SYSTEM_OPENSSL=YES else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 -$as_echo "internal" >&6; } + echo "$as_me:$LINENO: result: internal" >&5 +echo "${ECHO_T}internal" >&6 SYSTEM_OPENSSL=NO BUILD_TYPE="$BUILD_TYPE OPENSSL" fi @@ -17237,33 +21532,33 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable agg" >&5 -$as_echo_n "checking whether to enable agg... " >&6; } +echo "$as_me:$LINENO: checking whether to enable agg" >&5 +echo $ECHO_N "checking whether to enable agg... $ECHO_C" >&6 if test "$with_agg" = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 ENABLE_AGG=YES - { $as_echo "$as_me:${as_lineno-$LINENO}: checking which AGG to use" >&5 -$as_echo_n "checking which AGG to use... " >&6; } + echo "$as_me:$LINENO: checking which AGG to use" >&5 +echo $ECHO_N "checking which AGG to use... $ECHO_C" >&6 if test -n "$with_system_agg" -o -n "$with_system_libs" && \ test "$with_system_agg" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 -$as_echo "external" >&6; } + echo "$as_me:$LINENO: result: external" >&5 +echo "${ECHO_T}external" >&6 succeeded=no if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -17275,30 +21570,29 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG + if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test "$PKG_CONFIG" = "no" ; then @@ -17309,25 +21603,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libagg >= 2.3" >&5 -$as_echo_n "checking for libagg >= 2.3... " >&6; } + echo "$as_me:$LINENO: checking for libagg >= 2.3" >&5 +echo $ECHO_N "checking for libagg >= 2.3... $ECHO_C" >&6 if $PKG_CONFIG --exists "libagg >= 2.3" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 succeeded=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking AGG_CFLAGS" >&5 -$as_echo_n "checking AGG_CFLAGS... " >&6; } + echo "$as_me:$LINENO: checking AGG_CFLAGS" >&5 +echo $ECHO_N "checking AGG_CFLAGS... $ECHO_C" >&6 AGG_CFLAGS=`$PKG_CONFIG --cflags "libagg >= 2.3"` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AGG_CFLAGS" >&5 -$as_echo "$AGG_CFLAGS" >&6; } + echo "$as_me:$LINENO: result: $AGG_CFLAGS" >&5 +echo "${ECHO_T}$AGG_CFLAGS" >&6 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking AGG_LIBS" >&5 -$as_echo_n "checking AGG_LIBS... " >&6; } + echo "$as_me:$LINENO: checking AGG_LIBS" >&5 +echo $ECHO_N "checking AGG_LIBS... $ECHO_C" >&6 AGG_LIBS=`$PKG_CONFIG --libs "libagg >= 2.3"` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AGG_LIBS" >&5 -$as_echo "$AGG_LIBS" >&6; } + echo "$as_me:$LINENO: result: $AGG_LIBS" >&5 +echo "${ECHO_T}$AGG_LIBS" >&6 else AGG_CFLAGS="" AGG_LIBS="" @@ -17348,11 +21642,13 @@ $as_echo "$AGG_LIBS" >&6; } if test $succeeded = yes; then : else - as_fn_error "Library requirements (libagg >= 2.3) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Library requirements (libagg >= 2.3) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 +echo "$as_me: error: Library requirements (libagg >= 2.3) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} + { (exit 1); exit 1; }; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking agg version" >&5 -$as_echo_n "checking agg version... " >&6; } + echo "$as_me:$LINENO: checking agg version" >&5 +echo $ECHO_N "checking agg version... $ECHO_C" >&6 # workaround; if AGG_CFLAGS is empty (broken libagg.pc in 2.3), add /usr/include/agg2 anyway # (/usr/include gets stripped from pkg-config output) if test -z "$AGG_CFLAGS" || test "$AGG_CFLAGS" = " "; then @@ -17364,21 +21660,23 @@ $as_echo_n "checking agg version... " >&6; } $PKG_CONFIG --modversion libagg | grep -q 2.4; then # 2.4's libagg.pc.in still contains 2.3 :/ if $EGREP -q "Version 2.4" `echo $AGG_INCDIR`/agg_basics.h; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: 2.4" >&5 -$as_echo "2.4" >&6; } + echo "$as_me:$LINENO: result: 2.4" >&5 +echo "${ECHO_T}2.4" >&6 AGG_VERSION=2400 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: 2.3" >&5 -$as_echo "2.3" >&6; } + echo "$as_me:$LINENO: result: 2.3" >&5 +echo "${ECHO_T}2.3" >&6 AGG_VERSION=2300 fi SYSTEM_AGG=YES else - as_fn_error "only agg 2.3 and 2.4 are supported" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: only agg 2.3 and 2.4 are supported" >&5 +echo "$as_me: error: only agg 2.3 and 2.4 are supported" >&2;} + { (exit 1); exit 1; }; } fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 -$as_echo "internal" >&6; } + echo "$as_me:$LINENO: result: internal" >&5 +echo "${ECHO_T}internal" >&6 SYSTEM_AGG=NO AGG_VERSION=2300 BUILD_TYPE="$BUILD_TYPE AGG" @@ -17387,12 +21685,12 @@ $as_echo "internal" >&6; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which redland library to use" >&5 -$as_echo_n "checking which redland library to use... " >&6; } +echo "$as_me:$LINENO: checking which redland library to use" >&5 +echo $ECHO_N "checking which redland library to use... $ECHO_C" >&6 if test -n "$with_system_redland" && \ test "$with_system_redland" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 -$as_echo "external" >&6; } + echo "$as_me:$LINENO: result: external" >&5 +echo "${ECHO_T}external" >&6 SYSTEM_REDLAND=YES succeeded=no @@ -17400,10 +21698,10 @@ $as_echo "external" >&6; } if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -17415,30 +21713,29 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG + if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test "$PKG_CONFIG" = "no" ; then @@ -17449,25 +21746,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for redland" >&5 -$as_echo_n "checking for redland... " >&6; } + echo "$as_me:$LINENO: checking for redland" >&5 +echo $ECHO_N "checking for redland... $ECHO_C" >&6 if $PKG_CONFIG --exists "redland" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 succeeded=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking REDLAND_CFLAGS" >&5 -$as_echo_n "checking REDLAND_CFLAGS... " >&6; } + echo "$as_me:$LINENO: checking REDLAND_CFLAGS" >&5 +echo $ECHO_N "checking REDLAND_CFLAGS... $ECHO_C" >&6 REDLAND_CFLAGS=`$PKG_CONFIG --cflags "redland"` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $REDLAND_CFLAGS" >&5 -$as_echo "$REDLAND_CFLAGS" >&6; } + echo "$as_me:$LINENO: result: $REDLAND_CFLAGS" >&5 +echo "${ECHO_T}$REDLAND_CFLAGS" >&6 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking REDLAND_LIBS" >&5 -$as_echo_n "checking REDLAND_LIBS... " >&6; } + echo "$as_me:$LINENO: checking REDLAND_LIBS" >&5 +echo $ECHO_N "checking REDLAND_LIBS... $ECHO_C" >&6 REDLAND_LIBS=`$PKG_CONFIG --libs "redland"` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $REDLAND_LIBS" >&5 -$as_echo "$REDLAND_LIBS" >&6; } + echo "$as_me:$LINENO: result: $REDLAND_LIBS" >&5 +echo "${ECHO_T}$REDLAND_LIBS" >&6 else REDLAND_CFLAGS="" REDLAND_LIBS="" @@ -17488,26 +21785,28 @@ $as_echo "$REDLAND_LIBS" >&6; } if test $succeeded = yes; then : else - as_fn_error "Library requirements (redland) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Library requirements (redland) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 +echo "$as_me: error: Library requirements (redland) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} + { (exit 1); exit 1; }; } fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 -$as_echo "internal" >&6; } + echo "$as_me:$LINENO: result: internal" >&5 +echo "${ECHO_T}internal" >&6 BUILD_TYPE="$BUILD_TYPE REDLAND" SYSTEM_REDLAND=NO fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which libhunspell to use" >&5 -$as_echo_n "checking which libhunspell to use... " >&6; } +echo "$as_me:$LINENO: checking which libhunspell to use" >&5 +echo $ECHO_N "checking which libhunspell to use... $ECHO_C" >&6 if test -n "$with_system_hunspell" -o -n "$with_system_libs" && \ test "$with_system_hunspell" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 -$as_echo "external" >&6; } + echo "$as_me:$LINENO: result: external" >&5 +echo "${ECHO_T}external" >&6 SYSTEM_HUNSPELL=YES - ac_ext=cpp + ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -17519,10 +21818,10 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -17534,30 +21833,29 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG + if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test "$PKG_CONFIG" = "no" ; then @@ -17568,25 +21866,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hunspell" >&5 -$as_echo_n "checking for hunspell... " >&6; } + echo "$as_me:$LINENO: checking for hunspell" >&5 +echo $ECHO_N "checking for hunspell... $ECHO_C" >&6 if $PKG_CONFIG --exists "hunspell" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 succeeded=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking HUNSPELL_CFLAGS" >&5 -$as_echo_n "checking HUNSPELL_CFLAGS... " >&6; } + echo "$as_me:$LINENO: checking HUNSPELL_CFLAGS" >&5 +echo $ECHO_N "checking HUNSPELL_CFLAGS... $ECHO_C" >&6 HUNSPELL_CFLAGS=`$PKG_CONFIG --cflags "hunspell"` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HUNSPELL_CFLAGS" >&5 -$as_echo "$HUNSPELL_CFLAGS" >&6; } + echo "$as_me:$LINENO: result: $HUNSPELL_CFLAGS" >&5 +echo "${ECHO_T}$HUNSPELL_CFLAGS" >&6 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking HUNSPELL_LIBS" >&5 -$as_echo_n "checking HUNSPELL_LIBS... " >&6; } + echo "$as_me:$LINENO: checking HUNSPELL_LIBS" >&5 +echo $ECHO_N "checking HUNSPELL_LIBS... $ECHO_C" >&6 HUNSPELL_LIBS=`$PKG_CONFIG --libs "hunspell"` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HUNSPELL_LIBS" >&5 -$as_echo "$HUNSPELL_LIBS" >&6; } + echo "$as_me:$LINENO: result: $HUNSPELL_LIBS" >&5 +echo "${ECHO_T}$HUNSPELL_LIBS" >&6 else HUNSPELL_CFLAGS="" HUNSPELL_LIBS="" @@ -17611,288 +21909,1091 @@ $as_echo "$HUNSPELL_LIBS" >&6; } fi if test "$HUNSPELL_PC" != "TRUE"; then - ac_fn_cxx_check_header_mongrel "$LINENO" "hunspell.hxx" "ac_cv_header_hunspell_hxx" "$ac_includes_default" -if test "x$ac_cv_header_hunspell_hxx" = x""yes; then : + if test "${ac_cv_header_hunspell_hxx+set}" = set; then + echo "$as_me:$LINENO: checking for hunspell.hxx" >&5 +echo $ECHO_N "checking for hunspell.hxx... $ECHO_C" >&6 +if test "${ac_cv_header_hunspell_hxx+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_hunspell_hxx" >&5 +echo "${ECHO_T}$ac_cv_header_hunspell_hxx" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking hunspell.hxx usability" >&5 +echo $ECHO_N "checking hunspell.hxx usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking hunspell.hxx presence" >&5 +echo $ECHO_N "checking hunspell.hxx presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: hunspell.hxx: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: hunspell.hxx: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: hunspell.hxx: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: hunspell.hxx: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: hunspell.hxx: present but cannot be compiled" >&5 +echo "$as_me: WARNING: hunspell.hxx: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: hunspell.hxx: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: hunspell.hxx: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: hunspell.hxx: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: hunspell.hxx: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: hunspell.hxx: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: hunspell.hxx: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: hunspell.hxx: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: hunspell.hxx: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: hunspell.hxx: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: hunspell.hxx: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for hunspell.hxx" >&5 +echo $ECHO_N "checking for hunspell.hxx... $ECHO_C" >&6 +if test "${ac_cv_header_hunspell_hxx+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_hunspell_hxx=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_hunspell_hxx" >&5 +echo "${ECHO_T}$ac_cv_header_hunspell_hxx" >&6 + +fi +if test $ac_cv_header_hunspell_hxx = yes; then + : +else + + if test "${ac_cv_header_hunspell_hunspell_hxx+set}" = set; then + echo "$as_me:$LINENO: checking for hunspell/hunspell.hxx" >&5 +echo $ECHO_N "checking for hunspell/hunspell.hxx... $ECHO_C" >&6 +if test "${ac_cv_header_hunspell_hunspell_hxx+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_hunspell_hunspell_hxx" >&5 +echo "${ECHO_T}$ac_cv_header_hunspell_hunspell_hxx" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking hunspell/hunspell.hxx usability" >&5 +echo $ECHO_N "checking hunspell/hunspell.hxx usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking hunspell/hunspell.hxx presence" >&5 +echo $ECHO_N "checking hunspell/hunspell.hxx presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_cxx_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: hunspell/hunspell.hxx: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: hunspell/hunspell.hxx: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: hunspell/hunspell.hxx: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: hunspell/hunspell.hxx: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: hunspell/hunspell.hxx: present but cannot be compiled" >&5 +echo "$as_me: WARNING: hunspell/hunspell.hxx: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: hunspell/hunspell.hxx: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: hunspell/hunspell.hxx: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: hunspell/hunspell.hxx: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: hunspell/hunspell.hxx: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: hunspell/hunspell.hxx: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: hunspell/hunspell.hxx: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: hunspell/hunspell.hxx: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: hunspell/hunspell.hxx: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: hunspell/hunspell.hxx: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: hunspell/hunspell.hxx: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for hunspell/hunspell.hxx" >&5 +echo $ECHO_N "checking for hunspell/hunspell.hxx... $ECHO_C" >&6 +if test "${ac_cv_header_hunspell_hunspell_hxx+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_hunspell_hunspell_hxx=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_hunspell_hunspell_hxx" >&5 +echo "${ECHO_T}$ac_cv_header_hunspell_hunspell_hxx" >&6 + +fi +if test $ac_cv_header_hunspell_hunspell_hxx = yes; then + HUNSPELL_CFLAGS=-I/usr/include/hunspell +else + { { echo "$as_me:$LINENO: error: hunspell headers not found." >&5 +echo "$as_me: error: hunspell headers not found." >&2;} + { (exit 1); exit 1; }; } +fi + + + +fi + + + +echo "$as_me:$LINENO: checking for main in -lhunspell" >&5 +echo $ECHO_N "checking for main in -lhunspell... $ECHO_C" >&6 +if test "${ac_cv_lib_hunspell_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lhunspell $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + +int +main () +{ +main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_cxx_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_hunspell_main=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_hunspell_main=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_hunspell_main" >&5 +echo "${ECHO_T}$ac_cv_lib_hunspell_main" >&6 +if test $ac_cv_lib_hunspell_main = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBHUNSPELL 1 +_ACEOF + + LIBS="-lhunspell $LIBS" + +else + { { echo "$as_me:$LINENO: error: hunspell library not found." >&5 +echo "$as_me: error: hunspell library not found." >&2;} + { (exit 1); exit 1; }; } +fi + + HUNSPELL_LIBS=-lhunspell + fi + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +else + echo "$as_me:$LINENO: result: internal" >&5 +echo "${ECHO_T}internal" >&6 + SYSTEM_HUNSPELL=NO + BUILD_TYPE="$BUILD_TYPE HUNSPELL" +fi + + + + +echo "$as_me:$LINENO: checking which altlinuxhyph to use" >&5 +echo $ECHO_N "checking which altlinuxhyph to use... $ECHO_C" >&6 +if test -n "$with_system_altlinuxhyph" -o -n "$with_system_libs" && \ + test "$with_system_altlinuxhyph" != "no"; then + echo "$as_me:$LINENO: result: external" >&5 +echo "${ECHO_T}external" >&6 + SYSTEM_HYPH=YES + if test "${ac_cv_header_hyphen_h+set}" = set; then + echo "$as_me:$LINENO: checking for hyphen.h" >&5 +echo $ECHO_N "checking for hyphen.h... $ECHO_C" >&6 +if test "${ac_cv_header_hyphen_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_hyphen_h" >&5 +echo "${ECHO_T}$ac_cv_header_hyphen_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking hyphen.h usability" >&5 +echo $ECHO_N "checking hyphen.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 +# Is the header present? +echo "$as_me:$LINENO: checking hyphen.h presence" >&5 +echo $ECHO_N "checking hyphen.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 - ac_fn_cxx_check_header_mongrel "$LINENO" "hunspell/hunspell.hxx" "ac_cv_header_hunspell_hunspell_hxx" "$ac_includes_default" -if test "x$ac_cv_header_hunspell_hunspell_hxx" = x""yes; then : - HUNSPELL_CFLAGS=-I/usr/include/hunspell +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: hyphen.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: hyphen.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: hyphen.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: hyphen.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: hyphen.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: hyphen.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: hyphen.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: hyphen.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: hyphen.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: hyphen.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: hyphen.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: hyphen.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: hyphen.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: hyphen.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: hyphen.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: hyphen.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for hyphen.h" >&5 +echo $ECHO_N "checking for hyphen.h... $ECHO_C" >&6 +if test "${ac_cv_header_hyphen_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - as_fn_error "hunspell headers not found." "$LINENO" 5 + ac_cv_header_hyphen_h=$ac_header_preproc fi +echo "$as_me:$LINENO: result: $ac_cv_header_hyphen_h" >&5 +echo "${ECHO_T}$ac_cv_header_hyphen_h" >&6 - - +fi +if test $ac_cv_header_hyphen_h = yes; then + : +else + { { echo "$as_me:$LINENO: error: altlinuxhyph headers not found." >&5 +echo "$as_me: error: altlinuxhyph headers not found." >&2;} + { (exit 1); exit 1; }; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lhunspell" >&5 -$as_echo_n "checking for main in -lhunspell... " >&6; } -if test "${ac_cv_lib_hunspell_main+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for struct _HyphenDict.cset" >&5 +echo $ECHO_N "checking for struct _HyphenDict.cset... $ECHO_C" >&6 +if test "${ac_cv_member_struct__HyphenDict_cset+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lhunspell $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - +#include int main () { -return main (); +static struct _HyphenDict ac_aggr; +if (ac_aggr.cset) +return 0; ; return 0; } _ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - ac_cv_lib_hunspell_main=yes +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_member_struct__HyphenDict_cset=yes else - ac_cv_lib_hunspell_main=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hunspell_main" >&5 -$as_echo "$ac_cv_lib_hunspell_main" >&6; } -if test "x$ac_cv_lib_hunspell_main" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBHUNSPELL 1 -_ACEOF + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - LIBS="-lhunspell $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +static struct _HyphenDict ac_aggr; +if (sizeof ac_aggr.cset) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_member_struct__HyphenDict_cset=yes else - as_fn_error "hunspell library not found." "$LINENO" 5 -fi - - HUNSPELL_LIBS=-lhunspell - fi - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 -$as_echo "internal" >&6; } - SYSTEM_HUNSPELL=NO - BUILD_TYPE="$BUILD_TYPE HUNSPELL" +ac_cv_member_struct__HyphenDict_cset=no fi - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which altlinuxhyph to use" >&5 -$as_echo_n "checking which altlinuxhyph to use... " >&6; } -if test -n "$with_system_altlinuxhyph" -o -n "$with_system_libs" && \ - test "$with_system_altlinuxhyph" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 -$as_echo "external" >&6; } - SYSTEM_HYPH=YES - ac_fn_c_check_header_mongrel "$LINENO" "hyphen.h" "ac_cv_header_hyphen_h" "$ac_includes_default" -if test "x$ac_cv_header_hyphen_h" = x""yes; then : - -else - as_fn_error "altlinuxhyph headers not found." "$LINENO" 5 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi - - - ac_fn_c_check_member "$LINENO" "struct _HyphenDict" "cset" "ac_cv_member_struct__HyphenDict_cset" "#include -" -if test "x$ac_cv_member_struct__HyphenDict_cset" = x""yes; then : - +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_member_struct__HyphenDict_cset" >&5 +echo "${ECHO_T}$ac_cv_member_struct__HyphenDict_cset" >&6 +if test $ac_cv_member_struct__HyphenDict_cset = yes; then + : else - as_fn_error "no. You are sure you have altlinuyhyph headers?" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: no. You are sure you have altlinuyhyph headers?" >&5 +echo "$as_me: error: no. You are sure you have altlinuyhyph headers?" >&2;} + { (exit 1); exit 1; }; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hnj_hyphen_hyphenate2 in -lhyphen" >&5 -$as_echo_n "checking for hnj_hyphen_hyphenate2 in -lhyphen... " >&6; } -if test "${ac_cv_lib_hyphen_hnj_hyphen_hyphenate2+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for hnj_hyphen_hyphenate2 in -lhyphen" >&5 +echo $ECHO_N "checking for hnj_hyphen_hyphenate2 in -lhyphen... $ECHO_C" >&6 +if test "${ac_cv_lib_hyphen_hnj_hyphen_hyphenate2+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lhyphen $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char hnj_hyphen_hyphenate2 (); int main () { -return hnj_hyphen_hyphenate2 (); +hnj_hyphen_hyphenate2 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_hyphen_hnj_hyphen_hyphenate2=yes else - ac_cv_lib_hyphen_hnj_hyphen_hyphenate2=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_hyphen_hnj_hyphen_hyphenate2=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hyphen_hnj_hyphen_hyphenate2" >&5 -$as_echo "$ac_cv_lib_hyphen_hnj_hyphen_hyphenate2" >&6; } -if test "x$ac_cv_lib_hyphen_hnj_hyphen_hyphenate2" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_hyphen_hnj_hyphen_hyphenate2" >&5 +echo "${ECHO_T}$ac_cv_lib_hyphen_hnj_hyphen_hyphenate2" >&6 +if test $ac_cv_lib_hyphen_hnj_hyphen_hyphenate2 = yes; then HYPHEN_LIB=-lhyphen else - as_fn_error "altlinuxhyph library not found or too old." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: altlinuxhyph library not found or too old." >&5 +echo "$as_me: error: altlinuxhyph library not found or too old." >&2;} + { (exit 1); exit 1; }; } fi if test -z "$HYPHEN_LIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hnj_hyphen_hyphenate2 in -lhyph" >&5 -$as_echo_n "checking for hnj_hyphen_hyphenate2 in -lhyph... " >&6; } -if test "${ac_cv_lib_hyph_hnj_hyphen_hyphenate2+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for hnj_hyphen_hyphenate2 in -lhyph" >&5 +echo $ECHO_N "checking for hnj_hyphen_hyphenate2 in -lhyph... $ECHO_C" >&6 +if test "${ac_cv_lib_hyph_hnj_hyphen_hyphenate2+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lhyph $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char hnj_hyphen_hyphenate2 (); int main () { -return hnj_hyphen_hyphenate2 (); +hnj_hyphen_hyphenate2 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_hyph_hnj_hyphen_hyphenate2=yes else - ac_cv_lib_hyph_hnj_hyphen_hyphenate2=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_hyph_hnj_hyphen_hyphenate2=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hyph_hnj_hyphen_hyphenate2" >&5 -$as_echo "$ac_cv_lib_hyph_hnj_hyphen_hyphenate2" >&6; } -if test "x$ac_cv_lib_hyph_hnj_hyphen_hyphenate2" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_hyph_hnj_hyphen_hyphenate2" >&5 +echo "${ECHO_T}$ac_cv_lib_hyph_hnj_hyphen_hyphenate2" >&6 +if test $ac_cv_lib_hyph_hnj_hyphen_hyphenate2 = yes; then HYPHEN_LIB=-lhyph else - as_fn_error "altlinuxhyph library not found or too old." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: altlinuxhyph library not found or too old." >&5 +echo "$as_me: error: altlinuxhyph library not found or too old." >&2;} + { (exit 1); exit 1; }; } fi fi if test -z "$HYPHEN_LIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hnj_hyphen_hyphenate2 in -lhnj" >&5 -$as_echo_n "checking for hnj_hyphen_hyphenate2 in -lhnj... " >&6; } -if test "${ac_cv_lib_hnj_hnj_hyphen_hyphenate2+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for hnj_hyphen_hyphenate2 in -lhnj" >&5 +echo $ECHO_N "checking for hnj_hyphen_hyphenate2 in -lhnj... $ECHO_C" >&6 +if test "${ac_cv_lib_hnj_hnj_hyphen_hyphenate2+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lhnj $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char hnj_hyphen_hyphenate2 (); int main () { -return hnj_hyphen_hyphenate2 (); +hnj_hyphen_hyphenate2 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_hnj_hnj_hyphen_hyphenate2=yes else - ac_cv_lib_hnj_hnj_hyphen_hyphenate2=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_hnj_hnj_hyphen_hyphenate2=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_hnj_hnj_hyphen_hyphenate2" >&5 -$as_echo "$ac_cv_lib_hnj_hnj_hyphen_hyphenate2" >&6; } -if test "x$ac_cv_lib_hnj_hnj_hyphen_hyphenate2" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_hnj_hnj_hyphen_hyphenate2" >&5 +echo "${ECHO_T}$ac_cv_lib_hnj_hnj_hyphen_hyphenate2" >&6 +if test $ac_cv_lib_hnj_hnj_hyphen_hyphenate2 = yes; then HYPHEN_LIB=-lhnj else - as_fn_error "altlinuxhyph library not found or too old." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: altlinuxhyph library not found or too old." >&5 +echo "$as_me: error: altlinuxhyph library not found or too old." >&2;} + { (exit 1); exit 1; }; } fi fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 -$as_echo "internal" >&6; } + echo "$as_me:$LINENO: result: internal" >&5 +echo "${ECHO_T}internal" >&6 SYSTEM_HYPH=NO fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which mythes to use" >&5 -$as_echo_n "checking which mythes to use... " >&6; } +echo "$as_me:$LINENO: checking which mythes to use" >&5 +echo $ECHO_N "checking which mythes to use... $ECHO_C" >&6 if test -n "$with_system_mythes" && test "$with_system_mythes" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 -$as_echo "external" >&6; } + echo "$as_me:$LINENO: result: external" >&5 +echo "${ECHO_T}external" >&6 SYSTEM_MYTHES=YES - ac_fn_c_check_header_mongrel "$LINENO" "mythes.hxx" "ac_cv_header_mythes_hxx" "$ac_includes_default" -if test "x$ac_cv_header_mythes_hxx" = x""yes; then : + if test "${ac_cv_header_mythes_hxx+set}" = set; then + echo "$as_me:$LINENO: checking for mythes.hxx" >&5 +echo $ECHO_N "checking for mythes.hxx... $ECHO_C" >&6 +if test "${ac_cv_header_mythes_hxx+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_mythes_hxx" >&5 +echo "${ECHO_T}$ac_cv_header_mythes_hxx" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking mythes.hxx usability" >&5 +echo $ECHO_N "checking mythes.hxx usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking mythes.hxx presence" >&5 +echo $ECHO_N "checking mythes.hxx presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: mythes.hxx: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: mythes.hxx: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: mythes.hxx: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: mythes.hxx: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: mythes.hxx: present but cannot be compiled" >&5 +echo "$as_me: WARNING: mythes.hxx: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: mythes.hxx: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: mythes.hxx: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: mythes.hxx: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: mythes.hxx: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: mythes.hxx: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: mythes.hxx: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: mythes.hxx: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: mythes.hxx: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: mythes.hxx: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: mythes.hxx: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for mythes.hxx" >&5 +echo $ECHO_N "checking for mythes.hxx... $ECHO_C" >&6 +if test "${ac_cv_header_mythes_hxx+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - as_fn_error "mythes.hxx headers not found." "$LINENO" 5 + ac_cv_header_mythes_hxx=$ac_header_preproc fi +echo "$as_me:$LINENO: result: $ac_cv_header_mythes_hxx" >&5 +echo "${ECHO_T}$ac_cv_header_mythes_hxx" >&6 +fi +if test $ac_cv_header_mythes_hxx = yes; then + : +else + { { echo "$as_me:$LINENO: error: mythes.hxx headers not found." >&5 +echo "$as_me: error: mythes.hxx headers not found." >&2;} + { (exit 1); exit 1; }; } +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lmythes" >&5 -$as_echo_n "checking for main in -lmythes... " >&6; } -if test "${ac_cv_lib_mythes_main+set}" = set; then : - $as_echo_n "(cached) " >&6 + + +echo "$as_me:$LINENO: checking for main in -lmythes" >&5 +echo $ECHO_N "checking for main in -lmythes... $ECHO_C" >&6 +if test "${ac_cv_lib_mythes_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmythes $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { -return main (); +main (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_mythes_main=yes else - ac_cv_lib_mythes_main=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_mythes_main=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mythes_main" >&5 -$as_echo "$ac_cv_lib_mythes_main" >&6; } -if test "x$ac_cv_lib_mythes_main" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_mythes_main" >&5 +echo "${ECHO_T}$ac_cv_lib_mythes_main" >&6 +if test $ac_cv_lib_mythes_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBMYTHES 1 _ACEOF @@ -17900,68 +23001,237 @@ _ACEOF LIBS="-lmythes $LIBS" else - as_fn_error "mythes library not found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: mythes library not found." >&5 +echo "$as_me: error: mythes library not found." >&2;} + { (exit 1); exit 1; }; } fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 -$as_echo "internal" >&6; } + echo "$as_me:$LINENO: result: internal" >&5 +echo "${ECHO_T}internal" >&6 SYSTEM_MYTHES=NO fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which lpsolve to use" >&5 -$as_echo_n "checking which lpsolve to use... " >&6; } +echo "$as_me:$LINENO: checking which lpsolve to use" >&5 +echo $ECHO_N "checking which lpsolve to use... $ECHO_C" >&6 if test -n "$with_system_lpsolve" -o -n "$with_system_libs" && \ test "$with_system_lpsolve" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 -$as_echo "external" >&6; } + echo "$as_me:$LINENO: result: external" >&5 +echo "${ECHO_T}external" >&6 SYSTEM_LPSOLVE=YES - ac_fn_c_check_header_mongrel "$LINENO" "lpsolve/lp_lib.h" "ac_cv_header_lpsolve_lp_lib_h" "$ac_includes_default" -if test "x$ac_cv_header_lpsolve_lp_lib_h" = x""yes; then : + if test "${ac_cv_header_lpsolve_lp_lib_h+set}" = set; then + echo "$as_me:$LINENO: checking for lpsolve/lp_lib.h" >&5 +echo $ECHO_N "checking for lpsolve/lp_lib.h... $ECHO_C" >&6 +if test "${ac_cv_header_lpsolve_lp_lib_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_lpsolve_lp_lib_h" >&5 +echo "${ECHO_T}$ac_cv_header_lpsolve_lp_lib_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking lpsolve/lp_lib.h usability" >&5 +echo $ECHO_N "checking lpsolve/lp_lib.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking lpsolve/lp_lib.h presence" >&5 +echo $ECHO_N "checking lpsolve/lp_lib.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: lpsolve/lp_lib.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: lpsolve/lp_lib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: lpsolve/lp_lib.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: lpsolve/lp_lib.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: lpsolve/lp_lib.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: lpsolve/lp_lib.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: lpsolve/lp_lib.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: lpsolve/lp_lib.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: lpsolve/lp_lib.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: lpsolve/lp_lib.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: lpsolve/lp_lib.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: lpsolve/lp_lib.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: lpsolve/lp_lib.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: lpsolve/lp_lib.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: lpsolve/lp_lib.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: lpsolve/lp_lib.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for lpsolve/lp_lib.h" >&5 +echo $ECHO_N "checking for lpsolve/lp_lib.h... $ECHO_C" >&6 +if test "${ac_cv_header_lpsolve_lp_lib_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_lpsolve_lp_lib_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_lpsolve_lp_lib_h" >&5 +echo "${ECHO_T}$ac_cv_header_lpsolve_lp_lib_h" >&6 +fi +if test $ac_cv_header_lpsolve_lp_lib_h = yes; then + : else - as_fn_error "lpsolve headers not found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: lpsolve headers not found." >&5 +echo "$as_me: error: lpsolve headers not found." >&2;} + { (exit 1); exit 1; }; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for make_lp in -llpsolve55" >&5 -$as_echo_n "checking for make_lp in -llpsolve55... " >&6; } -if test "${ac_cv_lib_lpsolve55_make_lp+set}" = set; then : - $as_echo_n "(cached) " >&6 + +echo "$as_me:$LINENO: checking for make_lp in -llpsolve55" >&5 +echo $ECHO_N "checking for make_lp in -llpsolve55... $ECHO_C" >&6 +if test "${ac_cv_lib_lpsolve55_make_lp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llpsolve55 $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char make_lp (); int main () { -return make_lp (); +make_lp (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_lpsolve55_make_lp=yes else - ac_cv_lib_lpsolve55_make_lp=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_lpsolve55_make_lp=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lpsolve55_make_lp" >&5 -$as_echo "$ac_cv_lib_lpsolve55_make_lp" >&6; } -if test "x$ac_cv_lib_lpsolve55_make_lp" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_lpsolve55_make_lp" >&5 +echo "${ECHO_T}$ac_cv_lib_lpsolve55_make_lp" >&6 +if test $ac_cv_lib_lpsolve55_make_lp = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBLPSOLVE55 1 _ACEOF @@ -17969,73 +23239,105 @@ _ACEOF LIBS="-llpsolve55 $LIBS" else - as_fn_error "lpsolve library not found or too old." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: lpsolve library not found or too old." >&5 +echo "$as_me: error: lpsolve library not found or too old." >&2;} + { (exit 1); exit 1; }; } fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 -$as_echo "internal" >&6; } + echo "$as_me:$LINENO: result: internal" >&5 +echo "${ECHO_T}internal" >&6 SYSTEM_LPSOLVE=NO BUILD_TYPE="$BUILD_TYPE LPSOLVE" fi if test "$_os" = "Linux"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libc is >= 2.1.1" >&5 -$as_echo_n "checking whether libc is >= 2.1.1... " >&6; } + echo "$as_me:$LINENO: checking whether libc is >= 2.1.1" >&5 +echo $ECHO_N "checking whether libc is >= 2.1.1... $ECHO_C" >&6 exec 6>/dev/null # no output - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gnu_get_libc_version in -lc" >&5 -$as_echo_n "checking for gnu_get_libc_version in -lc... " >&6; } -if test "${ac_cv_lib_c_gnu_get_libc_version+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for gnu_get_libc_version in -lc" >&5 +echo $ECHO_N "checking for gnu_get_libc_version in -lc... $ECHO_C" >&6 +if test "${ac_cv_lib_c_gnu_get_libc_version+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char gnu_get_libc_version (); int main () { -return gnu_get_libc_version (); +gnu_get_libc_version (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_c_gnu_get_libc_version=yes else - ac_cv_lib_c_gnu_get_libc_version=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_c_gnu_get_libc_version=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_gnu_get_libc_version" >&5 -$as_echo "$ac_cv_lib_c_gnu_get_libc_version" >&6; } -if test "x$ac_cv_lib_c_gnu_get_libc_version" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_c_gnu_get_libc_version" >&5 +echo "${ECHO_T}$ac_cv_lib_c_gnu_get_libc_version" >&6 +if test $ac_cv_lib_c_gnu_get_libc_version = yes; then HAVE_LIBC=yes; export HAVE_LIBC fi exec 6>&1 # output on again if test "$HAVE_LIBC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else - as_fn_error "no, upgrade libc" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: no, upgrade libc" >&5 +echo "$as_me: error: no, upgrade libc" >&2;} + { (exit 1); exit 1; }; } fi fi if test \( "$_os" = "WINNT" \) ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PSDK files" >&5 -$as_echo_n "checking for PSDK files... " >&6; } + echo "$as_me:$LINENO: checking for PSDK files" >&5 +echo $ECHO_N "checking for PSDK files... $ECHO_C" >&6 if test -z "$with_psdk_home"; then # This first line will detect a February 2003 Microsoft Platform SDK PSDK_HOME=`./oowintool --psdk-home` @@ -18056,12 +23358,19 @@ $as_echo_n "checking for PSDK files... " >&6; } PSDK_HOME=`echo $PSDK_HOME | $SED 's/\/$//'` # Problem with current PSDK (iz 49865) if test -f "$PSDK_HOME/Lib/libcp.lib"; then - as_fn_error " + { { echo "$as_me:$LINENO: error: + +Some modules do not build correctly with MS Platform SDK - April 2005 +Edition if the library ($PSDK_HOME/Lib/libcp.lib) is found. +Remove/rename/backup that file and restart configure. Details about this +problem can be found in issue 49856." >&5 +echo "$as_me: error: Some modules do not build correctly with MS Platform SDK - April 2005 Edition if the library ($PSDK_HOME/Lib/libcp.lib) is found. Remove/rename/backup that file and restart configure. Details about this -problem can be found in issue 49856." "$LINENO" 5 +problem can be found in issue 49856." >&2;} + { (exit 1); exit 1; }; } fi # WIndows SDK has different headers if test \( -f "$PSDK_HOME/Include/adoint.h" \) \ @@ -18077,36 +23386,41 @@ problem can be found in issue 49856." "$LINENO" 5 HAVE_PSDK_LIB="no" fi if test "$HAVE_PSDK_H" = "no" -o "$HAVE_PSDK_LIB" = "no"; then - as_fn_error "Some (all?) PSDK files not found, please check if all needed Platform SDKs -are installed or use --with-psdk-home ." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Some (all?) PSDK files not found, please check if all needed Platform SDKs +are installed or use --with-psdk-home ." >&5 +echo "$as_me: error: Some (all?) PSDK files not found, please check if all needed Platform SDKs +are installed or use --with-psdk-home ." >&2;} + { (exit 1); exit 1; }; } fi if test ! -x "$PSDK_HOME/bin/msiinfo.exe" \ -o ! -x "$PSDK_HOME/bin/msidb.exe" \ -o ! -x "$PSDK_HOME/bin/uuidgen.exe" \ -o ! -x "$PSDK_HOME/bin/msitran.exe" ; then - as_fn_error "Some (all) files of the Windows Installer SDK are missing, please install." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Some (all) files of the Windows Installer SDK are missing, please install." >&5 +echo "$as_me: error: Some (all) files of the Windows Installer SDK are missing, please install." >&2;} + { (exit 1); exit 1; }; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: SDK files found ...)" >&5 -$as_echo "SDK files found ...)" >&6; } + echo "$as_me:$LINENO: result: SDK files found ...)" >&5 +echo "${ECHO_T}SDK files found ...)" >&6 if echo $PSDK_HOME | grep "v6.1" >/dev/null 2>/dev/null; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Found Windows SDK 6.1 ($PSDK_HOME)" >&5 -$as_echo "Found Windows SDK 6.1 ($PSDK_HOME)" >&6; } + echo "$as_me:$LINENO: result: Found Windows SDK 6.1 ($PSDK_HOME)" >&5 +echo "${ECHO_T}Found Windows SDK 6.1 ($PSDK_HOME)" >&6 WINDOWS_VISTA_PSDK=TRUE elif echo $PSDK_HOME | grep "v6.0" >/dev/null 2>/dev/null; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Found Windows SDK 6.0 ($PSDK_HOME)" >&5 -$as_echo "Found Windows SDK 6.0 ($PSDK_HOME)" >&6; } + echo "$as_me:$LINENO: result: Found Windows SDK 6.0 ($PSDK_HOME)" >&5 +echo "${ECHO_T}Found Windows SDK 6.0 ($PSDK_HOME)" >&6 WINDOWS_VISTA_PSDK=TRUE else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Found Legacy Windows Platform SDK ($PSDK_HOME)" >&5 -$as_echo "Found Legacy Windows Platform SDK ($PSDK_HOME)" >&6; } + echo "$as_me:$LINENO: result: Found Legacy Windows Platform SDK ($PSDK_HOME)" >&5 +echo "${ECHO_T}Found Legacy Windows Platform SDK ($PSDK_HOME)" >&6 fi fi if test \( "$_os" = "WINNT" \) ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DirectX SDK files" >&5 -$as_echo_n "checking for DirectX SDK files... " >&6; } + echo "$as_me:$LINENO: checking for DirectX SDK files" >&5 +echo $ECHO_N "checking for DirectX SDK files... $ECHO_C" >&6 if test -z "$with_directx_home"; then if test -n "$DXSDK_DIR"; then DIRECTXSDK_HOME=`cygpath -d "$DXSDK_DIR"` @@ -18138,15 +23452,17 @@ $as_echo_n "checking for DirectX SDK files... " >&6; } fi if test -n "$ENABLE_DIRECTX"; then if test "$HAVE_DIRECTXSDK_H" = "yes" -a "$HAVE_DIRECTXSDK_LIB" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 -$as_echo "found" >&6; } + echo "$as_me:$LINENO: result: found" >&5 +echo "${ECHO_T}found" >&6 else - as_fn_error "DirectX SDK files not found, please use --with-directx-home or -disable-directx." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: DirectX SDK files not found, please use --with-directx-home or -disable-directx." >&5 +echo "$as_me: error: DirectX SDK files not found, please use --with-directx-home or -disable-directx." >&2;} + { (exit 1); exit 1; }; } fi else DIRECTXSDK_HOME="" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 -$as_echo "disabled" >&6; } + echo "$as_me:$LINENO: result: disabled" >&5 +echo "${ECHO_T}disabled" >&6 fi fi @@ -18154,14 +23470,14 @@ fi NSIS_PATH="" if test "$_os" = "WINNT" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NSIS" >&5 -$as_echo_n "checking for NSIS... " >&6; } + echo "$as_me:$LINENO: checking for NSIS" >&5 +echo $ECHO_N "checking for NSIS... $ECHO_C" >&6 # Extract the first word of "nsis.exe", so it can be a program name with args. set dummy nsis.exe; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_NSIS_PATH+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_NSIS_PATH+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $NSIS_PATH in [\\/]* | ?:[\\/]*) @@ -18173,29 +23489,28 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_NSIS_PATH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done ;; esac fi NSIS_PATH=$ac_cv_path_NSIS_PATH + if test -n "$NSIS_PATH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NSIS_PATH" >&5 -$as_echo "$NSIS_PATH" >&6; } + echo "$as_me:$LINENO: result: $NSIS_PATH" >&5 +echo "${ECHO_T}$NSIS_PATH" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test -n "$NSIS_PATH"; then NSIS_PATH=`dirname "$NSIS_PATH"` fi @@ -18210,24 +23525,24 @@ fi NSIS_PATH="$nsistest" fi if test -z "$NSIS_PATH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: NSIS not found, no self contained installer will be build." >&5 -$as_echo "$as_me: WARNING: NSIS not found, no self contained installer will be build." >&2;} + { echo "$as_me:$LINENO: WARNING: NSIS not found, no self contained installer will be build." >&5 +echo "$as_me: WARNING: NSIS not found, no self contained installer will be build." >&2;} echo "NSIS not found, no self contained installer will be build." >> warn else NSIS_PATH=`cygpath -d "$NSIS_PATH"` NSIS_PATH=`cygpath -u "$NSIS_PATH"` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found ($NSIS_PATH)" >&5 -$as_echo "found ($NSIS_PATH)" >&6; } + echo "$as_me:$LINENO: result: found ($NSIS_PATH)" >&5 +echo "${ECHO_T}found ($NSIS_PATH)" >&6 fi fi # Extract the first word of "bison", so it can be a program name with args. set dummy bison; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_BISON+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_BISON+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $BISON in [\\/]* | ?:[\\/]*) @@ -18239,56 +23554,59 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_BISON="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done ;; esac fi BISON=$ac_cv_path_BISON + if test -n "$BISON"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BISON" >&5 -$as_echo "$BISON" >&6; } + echo "$as_me:$LINENO: result: $BISON" >&5 +echo "${ECHO_T}$BISON" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test -z "$BISON"; then - as_fn_error "no bison found in \$PATH, install bison" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: no bison found in \$PATH, install bison" >&5 +echo "$as_me: error: no bison found in \$PATH, install bison" >&2;} + { (exit 1); exit 1; }; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking the bison version" >&5 -$as_echo_n "checking the bison version... " >&6; } + echo "$as_me:$LINENO: checking the bison version" >&5 +echo $ECHO_N "checking the bison version... $ECHO_C" >&6 _bison_version=`$BISON --version | grep GNU | $SED -e 's@^[^0-9]*@@' -e 's@ .*@@' -e 's@,.*@@'`; _bison_longver=`echo $_bison_version | $AWK -F. '{ print \$1*1000+\$2}'` # Accept newer than 1.875 or older(equal) than 1.75 if test "$_bison_longver" -ge 1875 -o "$_bison_longver" -le 1075; then if test "$_bison_version" = "1.875" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: suspect ($BISON $_bison_version)" >&5 -$as_echo "$as_me: WARNING: suspect ($BISON $_bison_version)" >&2;} + { echo "$as_me:$LINENO: WARNING: suspect ($BISON $_bison_version)" >&5 +echo "$as_me: WARNING: suspect ($BISON $_bison_version)" >&2;} echo "Suspect ($BISON $_bison_version) suggest upgrade" >> warn else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: checked ($BISON $_bison_version)" >&5 -$as_echo "checked ($BISON $_bison_version)" >&6; } + echo "$as_me:$LINENO: result: checked ($BISON $_bison_version)" >&5 +echo "${ECHO_T}checked ($BISON $_bison_version)" >&6 fi else - as_fn_error "failed ($BISON $_bison_version need 1.875+ (or 1.75 and older))" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: failed ($BISON $_bison_version need 1.875+ (or 1.75 and older))" >&5 +echo "$as_me: error: failed ($BISON $_bison_version need 1.875+ (or 1.75 and older))" >&2;} + { (exit 1); exit 1; }; } fi fi # Extract the first word of "flex", so it can be a program name with args. set dummy flex; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_FLEX+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_FLEX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $FLEX in [\\/]* | ?:[\\/]*) @@ -18300,38 +23618,39 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_FLEX="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done ;; esac fi FLEX=$ac_cv_path_FLEX + if test -n "$FLEX"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FLEX" >&5 -$as_echo "$FLEX" >&6; } + echo "$as_me:$LINENO: result: $FLEX" >&5 +echo "${ECHO_T}$FLEX" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test -z "$FLEX"; then - as_fn_error "no flex found in \$PATH, install flex" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: no flex found in \$PATH, install flex" >&5 +echo "$as_me: error: no flex found in \$PATH, install flex" >&2;} + { (exit 1); exit 1; }; } fi # Extract the first word of "patch", so it can be a program name with args. set dummy patch; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PATCH+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PATCH+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PATCH in [\\/]* | ?:[\\/]*) @@ -18343,31 +23662,32 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PATCH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done ;; esac fi PATCH=$ac_cv_path_PATCH + if test -n "$PATCH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATCH" >&5 -$as_echo "$PATCH" >&6; } + echo "$as_me:$LINENO: result: $PATCH" >&5 +echo "${ECHO_T}$PATCH" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test -z "$PATCH"; then - as_fn_error "\\"patch\\" not found in \$PATH, install the development tool named\\"patch\"\" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: \\"patch\\" not found in \$PATH, install the development tool named\\"patch\"\" >&5 +echo "$as_me: error: \\"patch\\" not found in \$PATH, install the development tool named\\"patch\"\" >&2;} + { (exit 1); exit 1; }; } fi if test "$_os" = "SunOS" -o "$_os" = "FreeBSD" -o "$_os" = "Darwin"; then @@ -18377,17 +23697,21 @@ if test "$_os" = "SunOS" -o "$_os" = "FreeBSD" -o "$_os" = "Darwin"; then if test -x "$with_gnu_patch"; then GNUPATCH=$with_gnu_patch else - as_fn_error "--with-gnu-patch did not point to an executable" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: --with-gnu-patch did not point to an executable" >&5 +echo "$as_me: error: --with-gnu-patch did not point to an executable" >&2;} + { (exit 1); exit 1; }; } fi fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $GNUPATCH is GNU patch" >&5 -$as_echo_n "checking whether $GNUPATCH is GNU patch... " >&6; } + echo "$as_me:$LINENO: checking whether $GNUPATCH is GNU patch" >&5 +echo $ECHO_N "checking whether $GNUPATCH is GNU patch... $ECHO_C" >&6 if $GNUPATCH --version | grep "Free Software Foundation" >/dev/null 2>/dev/null; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else - as_fn_error "no, GNU patch needed. install or specify with --with-gnu-patch=/path/to/it" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: no, GNU patch needed. install or specify with --with-gnu-patch=/path/to/it" >&5 +echo "$as_me: error: no, GNU patch needed. install or specify with --with-gnu-patch=/path/to/it" >&2;} + { (exit 1); exit 1; }; } fi @@ -18396,10 +23720,10 @@ $as_echo "yes" >&6; } do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_GNUCP+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_GNUCP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $GNUCP in [\\/]* | ?:[\\/]*) @@ -18411,59 +23735,64 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GNUCP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done ;; esac fi GNUCP=$ac_cv_path_GNUCP + if test -n "$GNUCP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GNUCP" >&5 -$as_echo "$GNUCP" >&6; } + echo "$as_me:$LINENO: result: $GNUCP" >&5 +echo "${ECHO_T}$GNUCP" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - test -n "$GNUCP" && break done if test -z $GNUCP; then - as_fn_error "Neither gnucp nor cp found. Install GNU cp and/or specify --with-gnu-cp=/path/to/it" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Neither gnucp nor cp found. Install GNU cp and/or specify --with-gnu-cp=/path/to/it" >&5 +echo "$as_me: error: Neither gnucp nor cp found. Install GNU cp and/or specify --with-gnu-cp=/path/to/it" >&2;} + { (exit 1); exit 1; }; } fi else if test -x "$with_gnu_cp"; then GNUCP=$with_gnu_cp else - as_fn_error "--with-gnu-cp did not point to an executable" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: --with-gnu-cp did not point to an executable" >&5 +echo "$as_me: error: --with-gnu-cp did not point to an executable" >&2;} + { (exit 1); exit 1; }; } fi fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $GNUCP is GNU cp" >&5 -$as_echo_n "checking whether $GNUCP is GNU cp... " >&6; } + echo "$as_me:$LINENO: checking whether $GNUCP is GNU cp" >&5 +echo $ECHO_N "checking whether $GNUCP is GNU cp... $ECHO_C" >&6 if $GNUCP --version 2>/dev/null | grep "Free Software Foundation" >/dev/null 2>/dev/null; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else if $GNUCP --version 2>/dev/null | grep "GNU fileutils" >/dev/null 2>/dev/null; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else if test "$_os" = "Darwin"; then GNUCP='' - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no gnucp found - using the system's cp command" >&5 -$as_echo "no gnucp found - using the system's cp command" >&6; } + echo "$as_me:$LINENO: result: no gnucp found - using the system's cp command" >&5 +echo "${ECHO_T}no gnucp found - using the system's cp command" >&6 else - as_fn_error "no, GNU cp needed. install or specify with --with-gnu-cp=/path/to/it" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: no, GNU cp needed. install or specify with --with-gnu-cp=/path/to/it" >&5 +echo "$as_me: error: no, GNU cp needed. install or specify with --with-gnu-cp=/path/to/it" >&2;} + { (exit 1); exit 1; }; } fi fi fi @@ -18476,10 +23805,10 @@ if test "$_os" = "WINNT"; then CYGWIN_PATH="" # Extract the first word of "bash", so it can be a program name with args. set dummy bash; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_CYGWIN_PATH+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_CYGWIN_PATH+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $CYGWIN_PATH in [\\/]* | ?:[\\/]*) @@ -18491,29 +23820,28 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_CYGWIN_PATH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done ;; esac fi CYGWIN_PATH=$ac_cv_path_CYGWIN_PATH + if test -n "$CYGWIN_PATH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CYGWIN_PATH" >&5 -$as_echo "$CYGWIN_PATH" >&6; } + echo "$as_me:$LINENO: result: $CYGWIN_PATH" >&5 +echo "${ECHO_T}$CYGWIN_PATH" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - CYGWIN_PATH=`dirname "$CYGWIN_PATH"` fi if test -z "$CYGWIN_PATH"; then @@ -18522,18 +23850,18 @@ fi if test "$_os" = "WINNT" -a "$WITH_MINGWIN" != "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking ml.exe assembler path" >&5 -$as_echo_n "checking ml.exe assembler path... " >&6; } + echo "$as_me:$LINENO: checking ml.exe assembler path" >&5 +echo $ECHO_N "checking ml.exe assembler path... $ECHO_C" >&6 if test -n "$with_asm_home"; then with_asm_home=`cygpath -u "$with_asm_home"` fi if test ! -x "$with_asm_home/ml.exe"; then # Extract the first word of "ml.exe", so it can be a program name with args. set dummy ml.exe; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_ML_EXE+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_ML_EXE+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ML_EXE in [\\/]* | ?:[\\/]*) @@ -18545,36 +23873,37 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ML_EXE="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done ;; esac fi ML_EXE=$ac_cv_path_ML_EXE + if test -n "$ML_EXE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ML_EXE" >&5 -$as_echo "$ML_EXE" >&6; } + echo "$as_me:$LINENO: result: $ML_EXE" >&5 +echo "${ECHO_T}$ML_EXE" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test -z "$ML_EXE"; then if test -x "$with_cl_home/bin/ml.exe"; then with_asm_home=$with_cl_home/bin - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found ($with_asm_home)" >&5 -$as_echo "found ($with_asm_home)" >&6; } + echo "$as_me:$LINENO: result: found ($with_asm_home)" >&5 +echo "${ECHO_T}found ($with_asm_home)" >&6 else - as_fn_error "Configure did not find ml.exe assembler." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Configure did not find ml.exe assembler." >&5 +echo "$as_me: error: Configure did not find ml.exe assembler." >&2;} + { (exit 1); exit 1; }; } fi else with_asm_home="ASM_IN_PATH" @@ -18585,8 +23914,8 @@ else fi ASM_HOME="$with_asm_home" if test -n "$ASM_HOME"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ASM_HOME" >&5 -$as_echo "$ASM_HOME" >&6; } + echo "$as_me:$LINENO: result: $ASM_HOME" >&5 +echo "${ECHO_T}$ASM_HOME" >&6 fi @@ -18603,10 +23932,10 @@ if test -n "$with_zip_home" ; then else # Extract the first word of "zip", so it can be a program name with args. set dummy zip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_ZIP+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_ZIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ZIP in [\\/]* | ?:[\\/]*) @@ -18618,35 +23947,34 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ZIP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done ;; esac fi ZIP=$ac_cv_path_ZIP + if test -n "$ZIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ZIP" >&5 -$as_echo "$ZIP" >&6; } + echo "$as_me:$LINENO: result: $ZIP" >&5 +echo "${ECHO_T}$ZIP" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - # Extract the first word of "unzip", so it can be a program name with args. set dummy unzip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_UNZIP+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_UNZIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $UNZIP in [\\/]* | ?:[\\/]*) @@ -18658,69 +23986,84 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_UNZIP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done ;; esac fi UNZIP=$ac_cv_path_UNZIP + if test -n "$UNZIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $UNZIP" >&5 -$as_echo "$UNZIP" >&6; } + echo "$as_me:$LINENO: result: $UNZIP" >&5 +echo "${ECHO_T}$UNZIP" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - ZIP_HOME=`dirname "$ZIP"` fi if test -z "$ZIP" -o -z "$UNZIP"; then - as_fn_error "Zip/Unzip are required to build, please install or use --with-zip-home" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Zip/Unzip are required to build, please install or use --with-zip-home" >&5 +echo "$as_me: error: Zip/Unzip are required to build, please install or use --with-zip-home" >&2;} + { (exit 1); exit 1; }; } fi if test "$_os" = "WINNT"; then if test -n "`$ZIP -h | grep -i WinNT`" ; then -as_fn_error "$ZIP found in the path is not the required cygwin version of Info-ZIPs zip.exe." "$LINENO" 5 +{ { echo "$as_me:$LINENO: error: $ZIP found in the path is not the required cygwin version of Info-ZIPs zip.exe." >&5 +echo "$as_me: error: $ZIP found in the path is not the required cygwin version of Info-ZIPs zip.exe." >&2;} + { (exit 1); exit 1; }; } fi fi if test "$_os" = "WINNT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unicows.dll" >&5 -$as_echo_n "checking for unicows.dll... " >&6; } + echo "$as_me:$LINENO: checking for unicows.dll" >&5 +echo $ECHO_N "checking for unicows.dll... $ECHO_C" >&6 if test -x ./external/unicows/unicows.dll; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 -$as_echo "found" >&6; } + echo "$as_me:$LINENO: result: found" >&5 +echo "${ECHO_T}found" >&6 else - as_fn_error "The Microsoft Layer for Unicode (unicows.dll) is missing in external/unicows/. + { { echo "$as_me:$LINENO: error: The Microsoft Layer for Unicode (unicows.dll) is missing in external/unicows/. +Get it from the Microsoft site and put it into external/unicows. +(Note: Microsoft seems to enjoy changing the exact location of this file. You +may have to search Microsoft's website.) Last time it was seen at: +." >&5 +echo "$as_me: error: The Microsoft Layer for Unicode (unicows.dll) is missing in external/unicows/. Get it from the Microsoft site and put it into external/unicows. (Note: Microsoft seems to enjoy changing the exact location of this file. You may have to search Microsoft's website.) Last time it was seen at: -." "$LINENO" 5 +." >&2;} + { (exit 1); exit 1; }; } fi fi if test "$_os" = "WINNT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbghelp.dll" >&5 -$as_echo_n "checking for dbghelp.dll... " >&6; } + echo "$as_me:$LINENO: checking for dbghelp.dll" >&5 +echo $ECHO_N "checking for dbghelp.dll... $ECHO_C" >&6 if test -x ./external/dbghelp/dbghelp.dll; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 -$as_echo "found" >&6; } + echo "$as_me:$LINENO: result: found" >&5 +echo "${ECHO_T}found" >&6 else - as_fn_error "dbghelp.dll is missing in external/dbghelp/. + { { echo "$as_me:$LINENO: error: dbghelp.dll is missing in external/dbghelp/. +Get it from the Microsoft site and put it into external/dbghelp. +(Note: Microsoft seems to enjoy changing the exact location of this file. You +may have to search Microsoft's website.) Last time it was seen at: +." >&5 +echo "$as_me: error: dbghelp.dll is missing in external/dbghelp/. Get it from the Microsoft site and put it into external/dbghelp. (Note: Microsoft seems to enjoy changing the exact location of this file. You may have to search Microsoft's website.) Last time it was seen at: -." "$LINENO" 5 +." >&2;} + { (exit 1); exit 1; }; } fi fi @@ -18728,21 +24071,28 @@ if test "$_os" = "WINNT" -a "$WITH_MINGWIN" != "yes"; then if ./oowintool --msvc-copy-dlls ./external/msvcp ; then : else - as_fn_error "oowintool failed to copy CRT" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: oowintool failed to copy CRT" >&5 +echo "$as_me: error: oowintool failed to copy CRT" >&2;} + { (exit 1); exit 1; }; } fi fi if test "$_os" = "WINNT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gdiplus.dll" >&5 -$as_echo_n "checking for gdiplus.dll... " >&6; } + echo "$as_me:$LINENO: checking for gdiplus.dll" >&5 +echo $ECHO_N "checking for gdiplus.dll... $ECHO_C" >&6 if test -x ./external/gdiplus/gdiplus.dll; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 -$as_echo "found" >&6; } + echo "$as_me:$LINENO: result: found" >&5 +echo "${ECHO_T}found" >&6 else - as_fn_error "gdiplus.dll is missing in external/gdiplus/. + { { echo "$as_me:$LINENO: error: gdiplus.dll is missing in external/gdiplus/. +Get it from the Microsoft site and put it into external/gdiplus. +You may have to search Microsoft's website. Last time it was seen at: +." >&5 +echo "$as_me: error: gdiplus.dll is missing in external/gdiplus/. Get it from the Microsoft site and put it into external/gdiplus. You may have to search Microsoft's website. Last time it was seen at: -." "$LINENO" 5 +." >&2;} + { (exit 1); exit 1; }; } fi fi @@ -18752,11 +24102,11 @@ fi if test "$_os" = "WINNT"; then if test "$WITH_MINGWIN" = "yes" || test "$COMEX" -ge "10"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for instmsia.exe/instmsiw.exe" >&5 -$as_echo_n "checking for instmsia.exe/instmsiw.exe... " >&6; } + echo "$as_me:$LINENO: checking for instmsia.exe/instmsiw.exe" >&5 +echo $ECHO_N "checking for instmsia.exe/instmsiw.exe... $ECHO_C" >&6 if test -x ./external/msi/instmsia.exe -a -x ./external/msi/instmsiw.exe; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found" >&5 -$as_echo "found" >&6; } + echo "$as_me:$LINENO: result: found" >&5 +echo "${ECHO_T}found" >&6 else MSIAPATH=`/bin/find "$COMPATH/.." -iname instmsia.exe | head -n 1` MSIWPATH=`/bin/find "$COMPATH/.." -iname instmsiw.exe | head -n 1` @@ -18765,21 +24115,27 @@ $as_echo "found" >&6; } cp "$MSIWPATH" ./external/msi/ && chmod +x ./external/msi/instmsiw.exe && MSIWCOPY="OK" fi if test -z "$MSIACOPY" -o -z "$MSIWCOPY"; then - as_fn_error "instmsia.exe and/or instmsiw.exe are/is missing in the default location. + { { echo "$as_me:$LINENO: error: instmsia.exe and/or instmsiw.exe are/is missing in the default location. +These programs are part of the Visual Studio installation and should be found in a +directory similar to: +\"c:\\Program Files\\Microsoft Visual Studio .NET 2003\\Common7\\Tools\\Deployment\\MsiRedist\\\" +As the automatic detection fails please copy the files to external/msi/." >&5 +echo "$as_me: error: instmsia.exe and/or instmsiw.exe are/is missing in the default location. These programs are part of the Visual Studio installation and should be found in a directory similar to: \"c:\\Program Files\\Microsoft Visual Studio .NET 2003\\Common7\\Tools\\Deployment\\MsiRedist\\\" -As the automatic detection fails please copy the files to external/msi/." "$LINENO" 5 +As the automatic detection fails please copy the files to external/msi/." >&2;} + { (exit 1); exit 1; }; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: found and copied" >&5 -$as_echo "found and copied" >&6; } + echo "$as_me:$LINENO: result: found and copied" >&5 +echo "${ECHO_T}found and copied" >&6 fi fi fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which VCLplugs shall be built" >&5 -$as_echo_n "checking which VCLplugs shall be built... " >&6; } +echo "$as_me:$LINENO: checking which VCLplugs shall be built" >&5 +echo $ECHO_N "checking which VCLplugs shall be built... $ECHO_C" >&6 ENABLE_GTK="" if test "x$enable_gtk" = "xyes"; then ENABLE_GTK="TRUE" @@ -18802,31 +24158,31 @@ fi if test -z "$R"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 -$as_echo "none" >&6; } + echo "$as_me:$LINENO: result: none" >&5 +echo "${ECHO_T}none" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $R" >&5 -$as_echo "$R" >&6; } + echo "$as_me:$LINENO: result: $R" >&5 +echo "${ECHO_T}$R" >&6 fi ENABLE_GCONF="" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable GConf support" >&5 -$as_echo_n "checking whether to enable GConf support... " >&6; } +echo "$as_me:$LINENO: checking whether to enable GConf support" >&5 +echo $ECHO_N "checking whether to enable GConf support... $ECHO_C" >&6 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$_os" != "OS2" -a "$enable_gconf" = "yes"; then ENABLE_GCONF="TRUE" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 succeeded=no if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -18838,30 +24194,29 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG + if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test "$PKG_CONFIG" = "no" ; then @@ -18872,25 +24227,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gconf-2.0 " >&5 -$as_echo_n "checking for gconf-2.0 ... " >&6; } + echo "$as_me:$LINENO: checking for gconf-2.0 " >&5 +echo $ECHO_N "checking for gconf-2.0 ... $ECHO_C" >&6 if $PKG_CONFIG --exists "gconf-2.0 " ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 succeeded=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking GCONF_CFLAGS" >&5 -$as_echo_n "checking GCONF_CFLAGS... " >&6; } + echo "$as_me:$LINENO: checking GCONF_CFLAGS" >&5 +echo $ECHO_N "checking GCONF_CFLAGS... $ECHO_C" >&6 GCONF_CFLAGS=`$PKG_CONFIG --cflags "gconf-2.0 "` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GCONF_CFLAGS" >&5 -$as_echo "$GCONF_CFLAGS" >&6; } + echo "$as_me:$LINENO: result: $GCONF_CFLAGS" >&5 +echo "${ECHO_T}$GCONF_CFLAGS" >&6 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking GCONF_LIBS" >&5 -$as_echo_n "checking GCONF_LIBS... " >&6; } + echo "$as_me:$LINENO: checking GCONF_LIBS" >&5 +echo $ECHO_N "checking GCONF_LIBS... $ECHO_C" >&6 GCONF_LIBS=`$PKG_CONFIG --libs "gconf-2.0 "` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GCONF_LIBS" >&5 -$as_echo "$GCONF_LIBS" >&6; } + echo "$as_me:$LINENO: result: $GCONF_LIBS" >&5 +echo "${ECHO_T}$GCONF_LIBS" >&6 else GCONF_CFLAGS="" GCONF_LIBS="" @@ -18911,33 +24266,35 @@ $as_echo "$GCONF_LIBS" >&6; } if test $succeeded = yes; then : else - as_fn_error "Library requirements (gconf-2.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Library requirements (gconf-2.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 +echo "$as_me: error: Library requirements (gconf-2.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} + { (exit 1); exit 1; }; } fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi ENABLE_GNOMEVFS="" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable GNOME VFS support" >&5 -$as_echo_n "checking whether to enable GNOME VFS support... " >&6; } +echo "$as_me:$LINENO: checking whether to enable GNOME VFS support" >&5 +echo $ECHO_N "checking whether to enable GNOME VFS support... $ECHO_C" >&6 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gnome_vfs" = "yes"; then ENABLE_GNOMEVFS="TRUE" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 succeeded=no if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -18949,30 +24306,29 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG + if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test "$PKG_CONFIG" = "no" ; then @@ -18983,25 +24339,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gnome-vfs-2.0 >= 2.6.0 " >&5 -$as_echo_n "checking for gnome-vfs-2.0 >= 2.6.0 ... " >&6; } + echo "$as_me:$LINENO: checking for gnome-vfs-2.0 >= 2.6.0 " >&5 +echo $ECHO_N "checking for gnome-vfs-2.0 >= 2.6.0 ... $ECHO_C" >&6 if $PKG_CONFIG --exists "gnome-vfs-2.0 >= 2.6.0 " ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 succeeded=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking GNOMEVFS_CFLAGS" >&5 -$as_echo_n "checking GNOMEVFS_CFLAGS... " >&6; } + echo "$as_me:$LINENO: checking GNOMEVFS_CFLAGS" >&5 +echo $ECHO_N "checking GNOMEVFS_CFLAGS... $ECHO_C" >&6 GNOMEVFS_CFLAGS=`$PKG_CONFIG --cflags "gnome-vfs-2.0 >= 2.6.0 "` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GNOMEVFS_CFLAGS" >&5 -$as_echo "$GNOMEVFS_CFLAGS" >&6; } + echo "$as_me:$LINENO: result: $GNOMEVFS_CFLAGS" >&5 +echo "${ECHO_T}$GNOMEVFS_CFLAGS" >&6 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking GNOMEVFS_LIBS" >&5 -$as_echo_n "checking GNOMEVFS_LIBS... " >&6; } + echo "$as_me:$LINENO: checking GNOMEVFS_LIBS" >&5 +echo $ECHO_N "checking GNOMEVFS_LIBS... $ECHO_C" >&6 GNOMEVFS_LIBS=`$PKG_CONFIG --libs "gnome-vfs-2.0 >= 2.6.0 "` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GNOMEVFS_LIBS" >&5 -$as_echo "$GNOMEVFS_LIBS" >&6; } + echo "$as_me:$LINENO: result: $GNOMEVFS_LIBS" >&5 +echo "${ECHO_T}$GNOMEVFS_LIBS" >&6 else GNOMEVFS_CFLAGS="" GNOMEVFS_LIBS="" @@ -19022,7 +24378,9 @@ $as_echo "$GNOMEVFS_LIBS" >&6; } if test $succeeded = yes; then : else - as_fn_error "Library requirements (gnome-vfs-2.0 >= 2.6.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Library requirements (gnome-vfs-2.0 >= 2.6.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 +echo "$as_me: error: Library requirements (gnome-vfs-2.0 >= 2.6.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} + { (exit 1); exit 1; }; } fi if test "$ENABLE_GCONF" != "TRUE"; then @@ -19032,10 +24390,10 @@ $as_echo "$GNOMEVFS_LIBS" >&6; } if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -19047,30 +24405,29 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG + if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test "$PKG_CONFIG" = "no" ; then @@ -19081,25 +24438,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gconf-2.0 " >&5 -$as_echo_n "checking for gconf-2.0 ... " >&6; } + echo "$as_me:$LINENO: checking for gconf-2.0 " >&5 +echo $ECHO_N "checking for gconf-2.0 ... $ECHO_C" >&6 if $PKG_CONFIG --exists "gconf-2.0 " ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 succeeded=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking GCONF_CFLAGS" >&5 -$as_echo_n "checking GCONF_CFLAGS... " >&6; } + echo "$as_me:$LINENO: checking GCONF_CFLAGS" >&5 +echo $ECHO_N "checking GCONF_CFLAGS... $ECHO_C" >&6 GCONF_CFLAGS=`$PKG_CONFIG --cflags "gconf-2.0 "` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GCONF_CFLAGS" >&5 -$as_echo "$GCONF_CFLAGS" >&6; } + echo "$as_me:$LINENO: result: $GCONF_CFLAGS" >&5 +echo "${ECHO_T}$GCONF_CFLAGS" >&6 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking GCONF_LIBS" >&5 -$as_echo_n "checking GCONF_LIBS... " >&6; } + echo "$as_me:$LINENO: checking GCONF_LIBS" >&5 +echo $ECHO_N "checking GCONF_LIBS... $ECHO_C" >&6 GCONF_LIBS=`$PKG_CONFIG --libs "gconf-2.0 "` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GCONF_LIBS" >&5 -$as_echo "$GCONF_LIBS" >&6; } + echo "$as_me:$LINENO: result: $GCONF_LIBS" >&5 +echo "${ECHO_T}$GCONF_LIBS" >&6 else GCONF_CFLAGS="" GCONF_LIBS="" @@ -19120,13 +24477,15 @@ $as_echo "$GCONF_LIBS" >&6; } if test $succeeded = yes; then : else - as_fn_error "Library requirements (gconf-2.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Library requirements (gconf-2.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 +echo "$as_me: error: Library requirements (gconf-2.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} + { (exit 1); exit 1; }; } fi fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi @@ -19144,10 +24503,10 @@ if test "$test_gtk" = "yes"; then if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -19159,30 +24518,29 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG + if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test "$PKG_CONFIG" = "no" ; then @@ -19193,25 +24551,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gtk+-2.0 >= 2.4 gdk-pixbuf-xlib-2.0 >= 2.2 " >&5 -$as_echo_n "checking for gtk+-2.0 >= 2.4 gdk-pixbuf-xlib-2.0 >= 2.2 ... " >&6; } + echo "$as_me:$LINENO: checking for gtk+-2.0 >= 2.4 gdk-pixbuf-xlib-2.0 >= 2.2 " >&5 +echo $ECHO_N "checking for gtk+-2.0 >= 2.4 gdk-pixbuf-xlib-2.0 >= 2.2 ... $ECHO_C" >&6 if $PKG_CONFIG --exists "gtk+-2.0 >= 2.4 gdk-pixbuf-xlib-2.0 >= 2.2 " ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 succeeded=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking GTK_CFLAGS" >&5 -$as_echo_n "checking GTK_CFLAGS... " >&6; } + echo "$as_me:$LINENO: checking GTK_CFLAGS" >&5 +echo $ECHO_N "checking GTK_CFLAGS... $ECHO_C" >&6 GTK_CFLAGS=`$PKG_CONFIG --cflags "gtk+-2.0 >= 2.4 gdk-pixbuf-xlib-2.0 >= 2.2 "` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTK_CFLAGS" >&5 -$as_echo "$GTK_CFLAGS" >&6; } + echo "$as_me:$LINENO: result: $GTK_CFLAGS" >&5 +echo "${ECHO_T}$GTK_CFLAGS" >&6 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking GTK_LIBS" >&5 -$as_echo_n "checking GTK_LIBS... " >&6; } + echo "$as_me:$LINENO: checking GTK_LIBS" >&5 +echo $ECHO_N "checking GTK_LIBS... $ECHO_C" >&6 GTK_LIBS=`$PKG_CONFIG --libs "gtk+-2.0 >= 2.4 gdk-pixbuf-xlib-2.0 >= 2.2 "` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GTK_LIBS" >&5 -$as_echo "$GTK_LIBS" >&6; } + echo "$as_me:$LINENO: result: $GTK_LIBS" >&5 +echo "${ECHO_T}$GTK_LIBS" >&6 else GTK_CFLAGS="" GTK_LIBS="" @@ -19232,7 +24590,9 @@ $as_echo "$GTK_LIBS" >&6; } if test $succeeded = yes; then : else - as_fn_error "requirements to build the gtk-plugin not met. Use --disable-gtk or install the missing packages" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: requirements to build the gtk-plugin not met. Use --disable-gtk or install the missing packages" >&5 +echo "$as_me: error: requirements to build the gtk-plugin not met. Use --disable-gtk or install the missing packages" >&2;} + { (exit 1); exit 1; }; } fi BUILD_TYPE="$BUILD_TYPE GTK" @@ -19242,22 +24602,22 @@ $as_echo "$GTK_LIBS" >&6; } BUILD_TYPE="$BUILD_TYPE SYSTRAY_GTK" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable DBUS support" >&5 -$as_echo_n "checking whether to enable DBUS support... " >&6; } + echo "$as_me:$LINENO: checking whether to enable DBUS support" >&5 +echo $ECHO_N "checking whether to enable DBUS support... $ECHO_C" >&6 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_dbus" = "yes"; then ENABLE_DBUS="TRUE" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 succeeded=no if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -19269,30 +24629,29 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG + if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test "$PKG_CONFIG" = "no" ; then @@ -19303,25 +24662,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbus-glib-1 >= 0.70 " >&5 -$as_echo_n "checking for dbus-glib-1 >= 0.70 ... " >&6; } + echo "$as_me:$LINENO: checking for dbus-glib-1 >= 0.70 " >&5 +echo $ECHO_N "checking for dbus-glib-1 >= 0.70 ... $ECHO_C" >&6 if $PKG_CONFIG --exists "dbus-glib-1 >= 0.70 " ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 succeeded=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking DBUS_CFLAGS" >&5 -$as_echo_n "checking DBUS_CFLAGS... " >&6; } + echo "$as_me:$LINENO: checking DBUS_CFLAGS" >&5 +echo $ECHO_N "checking DBUS_CFLAGS... $ECHO_C" >&6 DBUS_CFLAGS=`$PKG_CONFIG --cflags "dbus-glib-1 >= 0.70 "` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DBUS_CFLAGS" >&5 -$as_echo "$DBUS_CFLAGS" >&6; } + echo "$as_me:$LINENO: result: $DBUS_CFLAGS" >&5 +echo "${ECHO_T}$DBUS_CFLAGS" >&6 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking DBUS_LIBS" >&5 -$as_echo_n "checking DBUS_LIBS... " >&6; } + echo "$as_me:$LINENO: checking DBUS_LIBS" >&5 +echo $ECHO_N "checking DBUS_LIBS... $ECHO_C" >&6 DBUS_LIBS=`$PKG_CONFIG --libs "dbus-glib-1 >= 0.70 "` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DBUS_LIBS" >&5 -$as_echo "$DBUS_LIBS" >&6; } + echo "$as_me:$LINENO: result: $DBUS_LIBS" >&5 +echo "${ECHO_T}$DBUS_LIBS" >&6 else DBUS_CFLAGS="" DBUS_LIBS="" @@ -19342,33 +24701,37 @@ $as_echo "$DBUS_LIBS" >&6; } if test $succeeded = yes; then : else - as_fn_error "Library requirements (dbus-glib-1 >= 0.70 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Library requirements (dbus-glib-1 >= 0.70 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 +echo "$as_me: error: Library requirements (dbus-glib-1 >= 0.70 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} + { (exit 1); exit 1; }; } fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable GIO support" >&5 -$as_echo_n "checking whether to enable GIO support... " >&6; } + echo "$as_me:$LINENO: checking whether to enable GIO support" >&5 +echo $ECHO_N "checking whether to enable GIO support... $ECHO_C" >&6 if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_gio" = "yes"; then if test "$ENABLE_GNOMEVFS" = "TRUE" ; then - as_fn_error "please use --enable-gio only together with --disable-gnome-vfs." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: please use --enable-gio only together with --disable-gnome-vfs." >&5 +echo "$as_me: error: please use --enable-gio only together with --disable-gnome-vfs." >&2;} + { (exit 1); exit 1; }; } fi ENABLE_GIO="TRUE" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 succeeded=no if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -19380,30 +24743,29 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG + if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test "$PKG_CONFIG" = "no" ; then @@ -19414,25 +24776,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gio-2.0 " >&5 -$as_echo_n "checking for gio-2.0 ... " >&6; } + echo "$as_me:$LINENO: checking for gio-2.0 " >&5 +echo $ECHO_N "checking for gio-2.0 ... $ECHO_C" >&6 if $PKG_CONFIG --exists "gio-2.0 " ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 succeeded=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking GIO_CFLAGS" >&5 -$as_echo_n "checking GIO_CFLAGS... " >&6; } + echo "$as_me:$LINENO: checking GIO_CFLAGS" >&5 +echo $ECHO_N "checking GIO_CFLAGS... $ECHO_C" >&6 GIO_CFLAGS=`$PKG_CONFIG --cflags "gio-2.0 "` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GIO_CFLAGS" >&5 -$as_echo "$GIO_CFLAGS" >&6; } + echo "$as_me:$LINENO: result: $GIO_CFLAGS" >&5 +echo "${ECHO_T}$GIO_CFLAGS" >&6 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking GIO_LIBS" >&5 -$as_echo_n "checking GIO_LIBS... " >&6; } + echo "$as_me:$LINENO: checking GIO_LIBS" >&5 +echo $ECHO_N "checking GIO_LIBS... $ECHO_C" >&6 GIO_LIBS=`$PKG_CONFIG --libs "gio-2.0 "` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GIO_LIBS" >&5 -$as_echo "$GIO_LIBS" >&6; } + echo "$as_me:$LINENO: result: $GIO_LIBS" >&5 +echo "${ECHO_T}$GIO_LIBS" >&6 else GIO_CFLAGS="" GIO_LIBS="" @@ -19453,12 +24815,14 @@ $as_echo "$GIO_LIBS" >&6; } if test $succeeded = yes; then : else - as_fn_error "Library requirements (gio-2.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Library requirements (gio-2.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 +echo "$as_me: error: Library requirements (gio-2.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} + { (exit 1); exit 1; }; } fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi @@ -19477,18 +24841,18 @@ SYSTEM_CAIRO="" if test "$test_cairo" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use cairo" >&5 -$as_echo_n "checking whether to use cairo... " >&6; } + echo "$as_me:$LINENO: checking whether to use cairo" >&5 +echo $ECHO_N "checking whether to use cairo... $ECHO_C" >&6 if test "x$enable_cairo" != "xno" ; then ENABLE_CAIRO="TRUE" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking which cairo to use" >&5 -$as_echo_n "checking which cairo to use... " >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + echo "$as_me:$LINENO: checking which cairo to use" >&5 +echo $ECHO_N "checking which cairo to use... $ECHO_C" >&6 if test -n "$with_system_cairo" -o -n "$with_system_libs" && \ test "$with_system_cairo" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 -$as_echo "external" >&6; } + echo "$as_me:$LINENO: result: external" >&5 +echo "${ECHO_T}external" >&6 SYSTEM_CAIRO=YES @@ -19497,10 +24861,10 @@ $as_echo "external" >&6; } if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -19512,30 +24876,29 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG + if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test "$PKG_CONFIG" = "no" ; then @@ -19546,25 +24909,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cairo >= 1.0.2 " >&5 -$as_echo_n "checking for cairo >= 1.0.2 ... " >&6; } + echo "$as_me:$LINENO: checking for cairo >= 1.0.2 " >&5 +echo $ECHO_N "checking for cairo >= 1.0.2 ... $ECHO_C" >&6 if $PKG_CONFIG --exists "cairo >= 1.0.2 " ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 succeeded=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking CAIRO_CFLAGS" >&5 -$as_echo_n "checking CAIRO_CFLAGS... " >&6; } + echo "$as_me:$LINENO: checking CAIRO_CFLAGS" >&5 +echo $ECHO_N "checking CAIRO_CFLAGS... $ECHO_C" >&6 CAIRO_CFLAGS=`$PKG_CONFIG --cflags "cairo >= 1.0.2 "` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CAIRO_CFLAGS" >&5 -$as_echo "$CAIRO_CFLAGS" >&6; } + echo "$as_me:$LINENO: result: $CAIRO_CFLAGS" >&5 +echo "${ECHO_T}$CAIRO_CFLAGS" >&6 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking CAIRO_LIBS" >&5 -$as_echo_n "checking CAIRO_LIBS... " >&6; } + echo "$as_me:$LINENO: checking CAIRO_LIBS" >&5 +echo $ECHO_N "checking CAIRO_LIBS... $ECHO_C" >&6 CAIRO_LIBS=`$PKG_CONFIG --libs "cairo >= 1.0.2 "` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CAIRO_LIBS" >&5 -$as_echo "$CAIRO_LIBS" >&6; } + echo "$as_me:$LINENO: result: $CAIRO_LIBS" >&5 +echo "${ECHO_T}$CAIRO_LIBS" >&6 else CAIRO_CFLAGS="" CAIRO_LIBS="" @@ -19585,22 +24948,31 @@ $as_echo "$CAIRO_LIBS" >&6; } if test $succeeded = yes; then : else - as_fn_error "Library requirements (cairo >= 1.0.2 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Library requirements (cairo >= 1.0.2 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 +echo "$as_me: error: Library requirements (cairo >= 1.0.2 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} + { (exit 1); exit 1; }; } fi if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$ENABLE_FONTCONFIG" != "TRUE" ; then - as_fn_error "Cairo library requires fontconfig." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Cairo library requires fontconfig." >&5 +echo "$as_me: error: Cairo library requires fontconfig." >&2;} + { (exit 1); exit 1; }; } fi if test "$with_system_xrender_headers" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Xrender.h defines PictStandardA8" >&5 -$as_echo_n "checking whether Xrender.h defines PictStandardA8... " >&6; } - if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot run test program while cross compiling -See \`config.log' for more details." "$LINENO" 5; } -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + echo "$as_me:$LINENO: checking whether Xrender.h defines PictStandardA8" >&5 +echo $ECHO_N "checking whether Xrender.h defines PictStandardA8... $ECHO_C" >&6 + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include @@ -19614,28 +24986,43 @@ int main(int argc, char **argv) { } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else - as_fn_error "no, X headers too old." "$LINENO" 5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: no, X headers too old." >&5 +echo "$as_me: error: no, X headers too old." >&2;} + { (exit 1); exit 1; }; } fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - fi else BUILD_TYPE="$BUILD_TYPE CAIRO" if test "$build_cpu" != "x86_64"; then BUILD_PIXMAN=YES fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 -$as_echo "internal" >&6; } + echo "$as_me:$LINENO: result: internal" >&5 +echo "${ECHO_T}internal" >&6 fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi fi @@ -19646,52 +25033,219 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build the OpenGL Transitions component" >&5 -$as_echo_n "checking whether to build the OpenGL Transitions component... " >&6; } +echo "$as_me:$LINENO: checking whether to build the OpenGL Transitions component" >&5 +echo $ECHO_N "checking whether to build the OpenGL Transitions component... $ECHO_C" >&6 ENABLE_OPENGL= if test "x$enable_opengl" != "xno" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ac_fn_c_check_header_mongrel "$LINENO" "GL/gl.h" "ac_cv_header_GL_gl_h" "$ac_includes_default" -if test "x$ac_cv_header_GL_gl_h" = x""yes; then : + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + if test "${ac_cv_header_GL_gl_h+set}" = set; then + echo "$as_me:$LINENO: checking for GL/gl.h" >&5 +echo $ECHO_N "checking for GL/gl.h... $ECHO_C" >&6 +if test "${ac_cv_header_GL_gl_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_GL_gl_h" >&5 +echo "${ECHO_T}$ac_cv_header_GL_gl_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking GL/gl.h usability" >&5 +echo $ECHO_N "checking GL/gl.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking GL/gl.h presence" >&5 +echo $ECHO_N "checking GL/gl.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: GL/gl.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: GL/gl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: GL/gl.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: GL/gl.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: GL/gl.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: GL/gl.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: GL/gl.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: GL/gl.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: GL/gl.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: GL/gl.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: GL/gl.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: GL/gl.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: GL/gl.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: GL/gl.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: GL/gl.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: GL/gl.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for GL/gl.h" >&5 +echo $ECHO_N "checking for GL/gl.h... $ECHO_C" >&6 +if test "${ac_cv_header_GL_gl_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_GL_gl_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_GL_gl_h" >&5 +echo "${ECHO_T}$ac_cv_header_GL_gl_h" >&6 +fi +if test $ac_cv_header_GL_gl_h = yes; then + : else - as_fn_error "OpenGL headers not found" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: OpenGL headers not found" >&5 +echo "$as_me: error: OpenGL headers not found" >&2;} + { (exit 1); exit 1; }; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lGL" >&5 -$as_echo_n "checking for main in -lGL... " >&6; } -if test "${ac_cv_lib_GL_main+set}" = set; then : - $as_echo_n "(cached) " >&6 + +echo "$as_me:$LINENO: checking for main in -lGL" >&5 +echo $ECHO_N "checking for main in -lGL... $ECHO_C" >&6 +if test "${ac_cv_lib_GL_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lGL $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { -return main (); +main (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_GL_main=yes else - ac_cv_lib_GL_main=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_GL_main=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GL_main" >&5 -$as_echo "$ac_cv_lib_GL_main" >&6; } -if test "x$ac_cv_lib_GL_main" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_GL_main" >&5 +echo "${ECHO_T}$ac_cv_lib_GL_main" >&6 +if test $ac_cv_lib_GL_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBGL 1 _ACEOF @@ -19699,40 +25253,71 @@ _ACEOF LIBS="-lGL $LIBS" else - as_fn_error "libGL not installed or functional" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: libGL not installed or functional" >&5 +echo "$as_me: error: libGL not installed or functional" >&2;} + { (exit 1); exit 1; }; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lGLU" >&5 -$as_echo_n "checking for main in -lGLU... " >&6; } -if test "${ac_cv_lib_GLU_main+set}" = set; then : - $as_echo_n "(cached) " >&6 + +echo "$as_me:$LINENO: checking for main in -lGLU" >&5 +echo $ECHO_N "checking for main in -lGLU... $ECHO_C" >&6 +if test "${ac_cv_lib_GLU_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lGLU $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { -return main (); +main (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_GLU_main=yes else - ac_cv_lib_GLU_main=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_GLU_main=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GLU_main" >&5 -$as_echo "$ac_cv_lib_GLU_main" >&6; } -if test "x$ac_cv_lib_GLU_main" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_GLU_main" >&5 +echo "${ECHO_T}$ac_cv_lib_GLU_main" >&6 +if test $ac_cv_lib_GLU_main = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBGLU 1 _ACEOF @@ -19740,56 +25325,58 @@ _ACEOF LIBS="-lGLU $LIBS" else - as_fn_error "libGLU not installed or functional" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: libGLU not installed or functional" >&5 +echo "$as_me: error: libGLU not installed or functional" >&2;} + { (exit 1); exit 1; }; } fi ENABLE_OPENGL=TRUE else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build the Presentation Minimizer extension" >&5 -$as_echo_n "checking whether to build the Presentation Minimizer extension... " >&6; } +echo "$as_me:$LINENO: checking whether to build the Presentation Minimizer extension" >&5 +echo $ECHO_N "checking whether to build the Presentation Minimizer extension... $ECHO_C" >&6 if test -n "$enable_minimizer" -a "$enable_minimizer" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 ENABLE_MINIMIZER=YES else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 ENABLE_MINIMIZER=NO fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build the Presenter Screen extension" >&5 -$as_echo_n "checking whether to build the Presenter Screen extension... " >&6; } +echo "$as_me:$LINENO: checking whether to build the Presenter Screen extension" >&5 +echo $ECHO_N "checking whether to build the Presenter Screen extension... $ECHO_C" >&6 if test -n "$enable_presenter_console" -a "$enable_presenter_screen" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 ENABLE_PRESENTER_SCREEN=YES else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 ENABLE_PRESENTER_SCREEN=NO fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build the PDF Import extension" >&5 -$as_echo_n "checking whether to build the PDF Import extension... " >&6; } +echo "$as_me:$LINENO: checking whether to build the PDF Import extension" >&5 +echo $ECHO_N "checking whether to build the PDF Import extension... $ECHO_C" >&6 if test -n "$enable_pdfimport" -a "$enable_pdfimport" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 ENABLE_PDFIMPORT=YES - { $as_echo "$as_me:${as_lineno-$LINENO}: checking which pdf backend to use" >&5 -$as_echo_n "checking which pdf backend to use... " >&6; } + echo "$as_me:$LINENO: checking which pdf backend to use" >&5 +echo $ECHO_N "checking which pdf backend to use... $ECHO_C" >&6 if test -n "$with_system_poppler" -o -n "$with_system_libs" && \ test "$with_system_poppler" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 -$as_echo "external" >&6; } + echo "$as_me:$LINENO: result: external" >&5 +echo "${ECHO_T}external" >&6 SYSTEM_POPPLER=YES succeeded=no @@ -19797,10 +25384,10 @@ $as_echo "external" >&6; } if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -19812,30 +25399,29 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG + if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test "$PKG_CONFIG" = "no" ; then @@ -19846,25 +25432,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for poppler >= 0.8.0 " >&5 -$as_echo_n "checking for poppler >= 0.8.0 ... " >&6; } + echo "$as_me:$LINENO: checking for poppler >= 0.8.0 " >&5 +echo $ECHO_N "checking for poppler >= 0.8.0 ... $ECHO_C" >&6 if $PKG_CONFIG --exists "poppler >= 0.8.0 " ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 succeeded=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking POPPLER_CFLAGS" >&5 -$as_echo_n "checking POPPLER_CFLAGS... " >&6; } + echo "$as_me:$LINENO: checking POPPLER_CFLAGS" >&5 +echo $ECHO_N "checking POPPLER_CFLAGS... $ECHO_C" >&6 POPPLER_CFLAGS=`$PKG_CONFIG --cflags "poppler >= 0.8.0 "` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $POPPLER_CFLAGS" >&5 -$as_echo "$POPPLER_CFLAGS" >&6; } + echo "$as_me:$LINENO: result: $POPPLER_CFLAGS" >&5 +echo "${ECHO_T}$POPPLER_CFLAGS" >&6 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking POPPLER_LIBS" >&5 -$as_echo_n "checking POPPLER_LIBS... " >&6; } + echo "$as_me:$LINENO: checking POPPLER_LIBS" >&5 +echo $ECHO_N "checking POPPLER_LIBS... $ECHO_C" >&6 POPPLER_LIBS=`$PKG_CONFIG --libs "poppler >= 0.8.0 "` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $POPPLER_LIBS" >&5 -$as_echo "$POPPLER_LIBS" >&6; } + echo "$as_me:$LINENO: result: $POPPLER_LIBS" >&5 +echo "${ECHO_T}$POPPLER_LIBS" >&6 else POPPLER_CFLAGS="" POPPLER_LIBS="" @@ -19885,26 +25471,30 @@ $as_echo "$POPPLER_LIBS" >&6; } if test $succeeded = yes; then : else - as_fn_error "Library requirements (poppler >= 0.8.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Library requirements (poppler >= 0.8.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 +echo "$as_me: error: Library requirements (poppler >= 0.8.0 ) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} + { (exit 1); exit 1; }; } fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 -$as_echo "internal" >&6; } + echo "$as_me:$LINENO: result: internal" >&5 +echo "${ECHO_T}internal" >&6 SYSTEM_POPPLER=NO BUILD_TYPE="$BUILD_TYPE XPDF" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xpdf module" >&5 -$as_echo_n "checking for xpdf module... " >&6; } + echo "$as_me:$LINENO: checking for xpdf module" >&5 +echo $ECHO_N "checking for xpdf module... $ECHO_C" >&6 if test -d ./xpdf; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5 -$as_echo "OK" >&6; } + echo "$as_me:$LINENO: result: OK" >&5 +echo "${ECHO_T}OK" >&6 else - as_fn_error "not existing. get it (did you get the -extensions tarball?)" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: not existing. get it (did you get the -extensions tarball?)" >&5 +echo "$as_me: error: not existing. get it (did you get the -extensions tarball?)" >&2;} + { (exit 1); exit 1; }; } fi fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 ENABLE_PDFIMPORT=NO fi @@ -19913,76 +25503,82 @@ fi if test "$ENABLE_PRESENTER_SCREEN" = "YES" -o "$ENABLE_MINIMIZER" = "YES" -o "$ENABLE_PDFIMPORT" = "YES"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sdext module" >&5 -$as_echo_n "checking for sdext module... " >&6; } + echo "$as_me:$LINENO: checking for sdext module" >&5 +echo $ECHO_N "checking for sdext module... $ECHO_C" >&6 if test -d ./sdext; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5 -$as_echo "OK" >&6; } + echo "$as_me:$LINENO: result: OK" >&5 +echo "${ECHO_T}OK" >&6 else - as_fn_error "not existing. get it (did you get the -extensions tarball?)" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: not existing. get it (did you get the -extensions tarball?)" >&5 +echo "$as_me: error: not existing. get it (did you get the -extensions tarball?)" >&2;} + { (exit 1); exit 1; }; } fi BUILD_TYPE="$BUILD_TYPE SDEXT" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build the Wiki Publisher extension" >&5 -$as_echo_n "checking whether to build the Wiki Publisher extension... " >&6; } +echo "$as_me:$LINENO: checking whether to build the Wiki Publisher extension" >&5 +echo $ECHO_N "checking whether to build the Wiki Publisher extension... $ECHO_C" >&6 if test -n "$enable_wiki_publisher" -a "$enable_wiki_publisher" != "no" && test "$WITH_JAVA" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for swext module" >&5 -$as_echo_n "checking for swext module... " >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + echo "$as_me:$LINENO: checking for swext module" >&5 +echo $ECHO_N "checking for swext module... $ECHO_C" >&6 if test -d ./swext; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5 -$as_echo "OK" >&6; } + echo "$as_me:$LINENO: result: OK" >&5 +echo "${ECHO_T}OK" >&6 else - as_fn_error "not existing. get it (did you get the -extensions tarball?)" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: not existing. get it (did you get the -extensions tarball?)" >&5 +echo "$as_me: error: not existing. get it (did you get the -extensions tarball?)" >&2;} + { (exit 1); exit 1; }; } fi ENABLE_MEDIAWIKI=YES BUILD_TYPE="$BUILD_TYPE SWEXT" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 ENABLE_MEDIAWIKI=NO fi if test "$ENABLE_MEDIAWIKI" == "YES"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking which Servlet API Jar to use" >&5 -$as_echo_n "checking which Servlet API Jar to use... " >&6; } + echo "$as_me:$LINENO: checking which Servlet API Jar to use" >&5 +echo $ECHO_N "checking which Servlet API Jar to use... $ECHO_C" >&6 if test -n "$with_system_servlet_api"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 -$as_echo "external" >&6; } + echo "$as_me:$LINENO: result: external" >&5 +echo "${ECHO_T}external" >&6 SYSTEM_SERVLETAPI=YES if test -z "$SERVLETAPI_JAR"; then SERVLETAPI_JAR=/usr/share/java/servlet-api.jar fi - as_ac_File=`$as_echo "ac_cv_file_$SERVLETAPI_JAR" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $SERVLETAPI_JAR" >&5 -$as_echo_n "checking for $SERVLETAPI_JAR... " >&6; } -if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 + as_ac_File=`echo "ac_cv_file_$SERVLETAPI_JAR" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $SERVLETAPI_JAR" >&5 +echo $ECHO_N "checking for $SERVLETAPI_JAR... $ECHO_C" >&6 +if eval "test \"\${$as_ac_File+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "$SERVLETAPI_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -eval as_val=\$$as_ac_File - if test "x$as_val" = x""yes; then : - +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 +if test `eval echo '${'$as_ac_File'}'` = yes; then + : else - as_fn_error "servlet-api.jar not found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: servlet-api.jar not found." >&5 +echo "$as_me: error: servlet-api.jar not found." >&2;} + { (exit 1); exit 1; }; } fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 -$as_echo "internal" >&6; } + echo "$as_me:$LINENO: result: internal" >&5 +echo "${ECHO_T}internal" >&6 SYSTEM_SERVLETAPI=NO BUILD_TYPE="$BUILD_TYPE TOMCAT" fi @@ -19990,93 +25586,103 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build the Report Builder extension" >&5 -$as_echo_n "checking whether to build the Report Builder extension... " >&6; } +echo "$as_me:$LINENO: checking whether to build the Report Builder extension" >&5 +echo $ECHO_N "checking whether to build the Report Builder extension... $ECHO_C" >&6 if test -n "$enable_report_builder" -a "$enable_report_builder" != "no" && test "$WITH_JAVA" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 ENABLE_REPORTBUILDER=YES - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for reportbuilder module" >&5 -$as_echo_n "checking for reportbuilder module... " >&6; } + echo "$as_me:$LINENO: checking for reportbuilder module" >&5 +echo $ECHO_N "checking for reportbuilder module... $ECHO_C" >&6 if test -d ./reportbuilder; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5 -$as_echo "OK" >&6; } + echo "$as_me:$LINENO: result: OK" >&5 +echo "${ECHO_T}OK" >&6 else - as_fn_error "not existing. get it (did you get the -extensions tarball?)" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: not existing. get it (did you get the -extensions tarball?)" >&5 +echo "$as_me: error: not existing. get it (did you get the -extensions tarball?)" >&2;} + { (exit 1); exit 1; }; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking which jfreereport libs to use" >&5 -$as_echo_n "checking which jfreereport libs to use... " >&6; } + echo "$as_me:$LINENO: checking which jfreereport libs to use" >&5 +echo $ECHO_N "checking which jfreereport libs to use... $ECHO_C" >&6 if test "$with_system_jfreereport" == "yes"; then SYSTEM_JFREEREPORT=YES - { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 -$as_echo "external" >&6; } + echo "$as_me:$LINENO: result: external" >&5 +echo "${ECHO_T}external" >&6 if test -z $SAC_JAR; then SAC_JAR=/usr/share/java/sac.jar fi - as_ac_File=`$as_echo "ac_cv_file_$SAC_JAR" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $SAC_JAR" >&5 -$as_echo_n "checking for $SAC_JAR... " >&6; } -if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 + as_ac_File=`echo "ac_cv_file_$SAC_JAR" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $SAC_JAR" >&5 +echo $ECHO_N "checking for $SAC_JAR... $ECHO_C" >&6 +if eval "test \"\${$as_ac_File+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "$SAC_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -eval as_val=\$$as_ac_File - if test "x$as_val" = x""yes; then : - +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 +if test `eval echo '${'$as_ac_File'}'` = yes; then + : else - as_fn_error "sac.jar not found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: sac.jar not found." >&5 +echo "$as_me: error: sac.jar not found." >&2;} + { (exit 1); exit 1; }; } fi if test -z $LIBXML_JAR; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/libxml-1.0.0.jar" >&5 -$as_echo_n "checking for /usr/share/java/libxml-1.0.0.jar... " >&6; } -if test "${ac_cv_file__usr_share_java_libxml_1_0_0_jar+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for /usr/share/java/libxml-1.0.0.jar" >&5 +echo $ECHO_N "checking for /usr/share/java/libxml-1.0.0.jar... $ECHO_C" >&6 +if test "${ac_cv_file__usr_share_java_libxml_1_0_0_jar+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "/usr/share/java/libxml-1.0.0.jar"; then ac_cv_file__usr_share_java_libxml_1_0_0_jar=yes else ac_cv_file__usr_share_java_libxml_1_0_0_jar=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_libxml_1_0_0_jar" >&5 -$as_echo "$ac_cv_file__usr_share_java_libxml_1_0_0_jar" >&6; } -if test "x$ac_cv_file__usr_share_java_libxml_1_0_0_jar" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libxml_1_0_0_jar" >&5 +echo "${ECHO_T}$ac_cv_file__usr_share_java_libxml_1_0_0_jar" >&6 +if test $ac_cv_file__usr_share_java_libxml_1_0_0_jar = yes; then LIBXML_JAR=/usr/share/java/libxml-1.0.0.jar else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/libxml.jar" >&5 -$as_echo_n "checking for /usr/share/java/libxml.jar... " >&6; } -if test "${ac_cv_file__usr_share_java_libxml_jar+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for /usr/share/java/libxml.jar" >&5 +echo $ECHO_N "checking for /usr/share/java/libxml.jar... $ECHO_C" >&6 +if test "${ac_cv_file__usr_share_java_libxml_jar+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "/usr/share/java/libxml.jar"; then ac_cv_file__usr_share_java_libxml_jar=yes else ac_cv_file__usr_share_java_libxml_jar=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_libxml_jar" >&5 -$as_echo "$ac_cv_file__usr_share_java_libxml_jar" >&6; } -if test "x$ac_cv_file__usr_share_java_libxml_jar" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libxml_jar" >&5 +echo "${ECHO_T}$ac_cv_file__usr_share_java_libxml_jar" >&6 +if test $ac_cv_file__usr_share_java_libxml_jar = yes; then LIBXML_JAR=/usr/share/java/libxml.jar else - as_fn_error "libxml.jar replacement not found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: libxml.jar replacement not found." >&5 +echo "$as_me: error: libxml.jar replacement not found." >&2;} + { (exit 1); exit 1; }; } fi @@ -20085,71 +25691,79 @@ fi fi else - as_ac_File=`$as_echo "ac_cv_file_$LIBXML_JAR" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LIBXML_JAR" >&5 -$as_echo_n "checking for $LIBXML_JAR... " >&6; } -if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 + as_ac_File=`echo "ac_cv_file_$LIBXML_JAR" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $LIBXML_JAR" >&5 +echo $ECHO_N "checking for $LIBXML_JAR... $ECHO_C" >&6 +if eval "test \"\${$as_ac_File+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "$LIBXML_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -eval as_val=\$$as_ac_File - if test "x$as_val" = x""yes; then : - +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 +if test `eval echo '${'$as_ac_File'}'` = yes; then + : else - as_fn_error "libxml.jar not found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: libxml.jar not found." >&5 +echo "$as_me: error: libxml.jar not found." >&2;} + { (exit 1); exit 1; }; } fi fi if test -z $FLUTE_JAR; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/flute-1.3.0.jar" >&5 -$as_echo_n "checking for /usr/share/java/flute-1.3.0.jar... " >&6; } -if test "${ac_cv_file__usr_share_java_flute_1_3_0_jar+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for /usr/share/java/flute-1.3.0.jar" >&5 +echo $ECHO_N "checking for /usr/share/java/flute-1.3.0.jar... $ECHO_C" >&6 +if test "${ac_cv_file__usr_share_java_flute_1_3_0_jar+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "/usr/share/java/flute-1.3.0.jar"; then ac_cv_file__usr_share_java_flute_1_3_0_jar=yes else ac_cv_file__usr_share_java_flute_1_3_0_jar=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_flute_1_3_0_jar" >&5 -$as_echo "$ac_cv_file__usr_share_java_flute_1_3_0_jar" >&6; } -if test "x$ac_cv_file__usr_share_java_flute_1_3_0_jar" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_flute_1_3_0_jar" >&5 +echo "${ECHO_T}$ac_cv_file__usr_share_java_flute_1_3_0_jar" >&6 +if test $ac_cv_file__usr_share_java_flute_1_3_0_jar = yes; then FLUTE_JAR=/usr/share/java/flute-1.3.0.jar else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/flute.jar" >&5 -$as_echo_n "checking for /usr/share/java/flute.jar... " >&6; } -if test "${ac_cv_file__usr_share_java_flute_jar+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for /usr/share/java/flute.jar" >&5 +echo $ECHO_N "checking for /usr/share/java/flute.jar... $ECHO_C" >&6 +if test "${ac_cv_file__usr_share_java_flute_jar+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "/usr/share/java/flute.jar"; then ac_cv_file__usr_share_java_flute_jar=yes else ac_cv_file__usr_share_java_flute_jar=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_flute_jar" >&5 -$as_echo "$ac_cv_file__usr_share_java_flute_jar" >&6; } -if test "x$ac_cv_file__usr_share_java_flute_jar" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_flute_jar" >&5 +echo "${ECHO_T}$ac_cv_file__usr_share_java_flute_jar" >&6 +if test $ac_cv_file__usr_share_java_flute_jar = yes; then FLUTE_JAR=/usr/share/java/flute.jar else - as_fn_error "flute-1.3.0.jar replacement not found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: flute-1.3.0.jar replacement not found." >&5 +echo "$as_me: error: flute-1.3.0.jar replacement not found." >&2;} + { (exit 1); exit 1; }; } fi @@ -20158,71 +25772,79 @@ fi fi else - as_ac_File=`$as_echo "ac_cv_file_$FLUTE_JAR" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $FLUTE_JAR" >&5 -$as_echo_n "checking for $FLUTE_JAR... " >&6; } -if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 + as_ac_File=`echo "ac_cv_file_$FLUTE_JAR" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $FLUTE_JAR" >&5 +echo $ECHO_N "checking for $FLUTE_JAR... $ECHO_C" >&6 +if eval "test \"\${$as_ac_File+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "$FLUTE_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -eval as_val=\$$as_ac_File - if test "x$as_val" = x""yes; then : - +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 +if test `eval echo '${'$as_ac_File'}'` = yes; then + : else - as_fn_error "flute-1.3.0.jar not found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: flute-1.3.0.jar not found." >&5 +echo "$as_me: error: flute-1.3.0.jar not found." >&2;} + { (exit 1); exit 1; }; } fi fi if test -z $JFREEREPORT_JAR; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/flow-engine-0.9.2.jar" >&5 -$as_echo_n "checking for /usr/share/java/flow-engine-0.9.2.jar... " >&6; } -if test "${ac_cv_file__usr_share_java_flow_engine_0_9_2_jar+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for /usr/share/java/flow-engine-0.9.2.jar" >&5 +echo $ECHO_N "checking for /usr/share/java/flow-engine-0.9.2.jar... $ECHO_C" >&6 +if test "${ac_cv_file__usr_share_java_flow_engine_0_9_2_jar+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "/usr/share/java/flow-engine-0.9.2.jar"; then ac_cv_file__usr_share_java_flow_engine_0_9_2_jar=yes else ac_cv_file__usr_share_java_flow_engine_0_9_2_jar=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_flow_engine_0_9_2_jar" >&5 -$as_echo "$ac_cv_file__usr_share_java_flow_engine_0_9_2_jar" >&6; } -if test "x$ac_cv_file__usr_share_java_flow_engine_0_9_2_jar" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_flow_engine_0_9_2_jar" >&5 +echo "${ECHO_T}$ac_cv_file__usr_share_java_flow_engine_0_9_2_jar" >&6 +if test $ac_cv_file__usr_share_java_flow_engine_0_9_2_jar = yes; then JFREEREPORT_JAR=/usr/share/java/flow-engine-0.9.2.jar else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/flow-engine.jar" >&5 -$as_echo_n "checking for /usr/share/java/flow-engine.jar... " >&6; } -if test "${ac_cv_file__usr_share_java_flow_engine_jar+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for /usr/share/java/flow-engine.jar" >&5 +echo $ECHO_N "checking for /usr/share/java/flow-engine.jar... $ECHO_C" >&6 +if test "${ac_cv_file__usr_share_java_flow_engine_jar+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "/usr/share/java/flow-engine.jar"; then ac_cv_file__usr_share_java_flow_engine_jar=yes else ac_cv_file__usr_share_java_flow_engine_jar=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_flow_engine_jar" >&5 -$as_echo "$ac_cv_file__usr_share_java_flow_engine_jar" >&6; } -if test "x$ac_cv_file__usr_share_java_flow_engine_jar" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_flow_engine_jar" >&5 +echo "${ECHO_T}$ac_cv_file__usr_share_java_flow_engine_jar" >&6 +if test $ac_cv_file__usr_share_java_flow_engine_jar = yes; then JFREEREPORT_JAR=/usr/share/java/flow-engine.jar else - as_fn_error "jfreereport.jar replacement not found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: jfreereport.jar replacement not found." >&5 +echo "$as_me: error: jfreereport.jar replacement not found." >&2;} + { (exit 1); exit 1; }; } fi @@ -20231,71 +25853,79 @@ fi fi else - as_ac_File=`$as_echo "ac_cv_file_$JFREEREPORT_JAR" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $JFREEREPORT_JAR" >&5 -$as_echo_n "checking for $JFREEREPORT_JAR... " >&6; } -if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 + as_ac_File=`echo "ac_cv_file_$JFREEREPORT_JAR" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $JFREEREPORT_JAR" >&5 +echo $ECHO_N "checking for $JFREEREPORT_JAR... $ECHO_C" >&6 +if eval "test \"\${$as_ac_File+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "$JFREEREPORT_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -eval as_val=\$$as_ac_File - if test "x$as_val" = x""yes; then : - +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 +if test `eval echo '${'$as_ac_File'}'` = yes; then + : else - as_fn_error "jfreereport.jar not found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: jfreereport.jar not found." >&5 +echo "$as_me: error: jfreereport.jar not found." >&2;} + { (exit 1); exit 1; }; } fi fi if test -z $LIBLAYOUT_JAR; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/liblayout-0.2.9.jar" >&5 -$as_echo_n "checking for /usr/share/java/liblayout-0.2.9.jar... " >&6; } -if test "${ac_cv_file__usr_share_java_liblayout_0_2_9_jar+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for /usr/share/java/liblayout-0.2.9.jar" >&5 +echo $ECHO_N "checking for /usr/share/java/liblayout-0.2.9.jar... $ECHO_C" >&6 +if test "${ac_cv_file__usr_share_java_liblayout_0_2_9_jar+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "/usr/share/java/liblayout-0.2.9.jar"; then ac_cv_file__usr_share_java_liblayout_0_2_9_jar=yes else ac_cv_file__usr_share_java_liblayout_0_2_9_jar=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_liblayout_0_2_9_jar" >&5 -$as_echo "$ac_cv_file__usr_share_java_liblayout_0_2_9_jar" >&6; } -if test "x$ac_cv_file__usr_share_java_liblayout_0_2_9_jar" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_liblayout_0_2_9_jar" >&5 +echo "${ECHO_T}$ac_cv_file__usr_share_java_liblayout_0_2_9_jar" >&6 +if test $ac_cv_file__usr_share_java_liblayout_0_2_9_jar = yes; then LIBLAYOUT_JAR=/usr/share/java/liblayout-0.2.9.jar else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/liblayout.jar" >&5 -$as_echo_n "checking for /usr/share/java/liblayout.jar... " >&6; } -if test "${ac_cv_file__usr_share_java_liblayout_jar+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for /usr/share/java/liblayout.jar" >&5 +echo $ECHO_N "checking for /usr/share/java/liblayout.jar... $ECHO_C" >&6 +if test "${ac_cv_file__usr_share_java_liblayout_jar+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "/usr/share/java/liblayout.jar"; then ac_cv_file__usr_share_java_liblayout_jar=yes else ac_cv_file__usr_share_java_liblayout_jar=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_liblayout_jar" >&5 -$as_echo "$ac_cv_file__usr_share_java_liblayout_jar" >&6; } -if test "x$ac_cv_file__usr_share_java_liblayout_jar" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_liblayout_jar" >&5 +echo "${ECHO_T}$ac_cv_file__usr_share_java_liblayout_jar" >&6 +if test $ac_cv_file__usr_share_java_liblayout_jar = yes; then LIBLAYOUT_JAR=/usr/share/java/liblayout.jar else - as_fn_error "liblayout.jar replacement not found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: liblayout.jar replacement not found." >&5 +echo "$as_me: error: liblayout.jar replacement not found." >&2;} + { (exit 1); exit 1; }; } fi @@ -20304,71 +25934,79 @@ fi fi else - as_ac_File=`$as_echo "ac_cv_file_$LIBLAYOUT_JAR" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LIBLAYOUT_JAR" >&5 -$as_echo_n "checking for $LIBLAYOUT_JAR... " >&6; } -if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 + as_ac_File=`echo "ac_cv_file_$LIBLAYOUT_JAR" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $LIBLAYOUT_JAR" >&5 +echo $ECHO_N "checking for $LIBLAYOUT_JAR... $ECHO_C" >&6 +if eval "test \"\${$as_ac_File+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "$LIBLAYOUT_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -eval as_val=\$$as_ac_File - if test "x$as_val" = x""yes; then : - +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 +if test `eval echo '${'$as_ac_File'}'` = yes; then + : else - as_fn_error "liblayout.jar not found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: liblayout.jar not found." >&5 +echo "$as_me: error: liblayout.jar not found." >&2;} + { (exit 1); exit 1; }; } fi fi if test -z $LIBLOADER_JAR; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/libloader-1.0.0.jar" >&5 -$as_echo_n "checking for /usr/share/java/libloader-1.0.0.jar... " >&6; } -if test "${ac_cv_file__usr_share_java_libloader_1_0_0_jar+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for /usr/share/java/libloader-1.0.0.jar" >&5 +echo $ECHO_N "checking for /usr/share/java/libloader-1.0.0.jar... $ECHO_C" >&6 +if test "${ac_cv_file__usr_share_java_libloader_1_0_0_jar+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "/usr/share/java/libloader-1.0.0.jar"; then ac_cv_file__usr_share_java_libloader_1_0_0_jar=yes else ac_cv_file__usr_share_java_libloader_1_0_0_jar=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_libloader_1_0_0_jar" >&5 -$as_echo "$ac_cv_file__usr_share_java_libloader_1_0_0_jar" >&6; } -if test "x$ac_cv_file__usr_share_java_libloader_1_0_0_jar" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libloader_1_0_0_jar" >&5 +echo "${ECHO_T}$ac_cv_file__usr_share_java_libloader_1_0_0_jar" >&6 +if test $ac_cv_file__usr_share_java_libloader_1_0_0_jar = yes; then LIBLOADER_JAR=/usr/share/java/libloader-1.0.0.jar else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/libloader.jar" >&5 -$as_echo_n "checking for /usr/share/java/libloader.jar... " >&6; } -if test "${ac_cv_file__usr_share_java_libloader_jar+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for /usr/share/java/libloader.jar" >&5 +echo $ECHO_N "checking for /usr/share/java/libloader.jar... $ECHO_C" >&6 +if test "${ac_cv_file__usr_share_java_libloader_jar+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "/usr/share/java/libloader.jar"; then ac_cv_file__usr_share_java_libloader_jar=yes else ac_cv_file__usr_share_java_libloader_jar=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_libloader_jar" >&5 -$as_echo "$ac_cv_file__usr_share_java_libloader_jar" >&6; } -if test "x$ac_cv_file__usr_share_java_libloader_jar" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libloader_jar" >&5 +echo "${ECHO_T}$ac_cv_file__usr_share_java_libloader_jar" >&6 +if test $ac_cv_file__usr_share_java_libloader_jar = yes; then LIBLOADER_JAR=/usr/share/java/libloader.jar else - as_fn_error "libloader.jar replacement not found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: libloader.jar replacement not found." >&5 +echo "$as_me: error: libloader.jar replacement not found." >&2;} + { (exit 1); exit 1; }; } fi @@ -20377,71 +26015,79 @@ fi fi else - as_ac_File=`$as_echo "ac_cv_file_$LIBLOADER_JAR" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LIBLOADER_JAR" >&5 -$as_echo_n "checking for $LIBLOADER_JAR... " >&6; } -if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 + as_ac_File=`echo "ac_cv_file_$LIBLOADER_JAR" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $LIBLOADER_JAR" >&5 +echo $ECHO_N "checking for $LIBLOADER_JAR... $ECHO_C" >&6 +if eval "test \"\${$as_ac_File+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "$LIBLOADER_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -eval as_val=\$$as_ac_File - if test "x$as_val" = x""yes; then : - +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 +if test `eval echo '${'$as_ac_File'}'` = yes; then + : else - as_fn_error "libloader.jar not found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: libloader.jar not found." >&5 +echo "$as_me: error: libloader.jar not found." >&2;} + { (exit 1); exit 1; }; } fi fi if test -z $LIBFORMULA_JAR; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/libformula-0.2.0.jar" >&5 -$as_echo_n "checking for /usr/share/java/libformula-0.2.0.jar... " >&6; } -if test "${ac_cv_file__usr_share_java_libformula_0_2_0_jar+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for /usr/share/java/libformula-0.2.0.jar" >&5 +echo $ECHO_N "checking for /usr/share/java/libformula-0.2.0.jar... $ECHO_C" >&6 +if test "${ac_cv_file__usr_share_java_libformula_0_2_0_jar+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "/usr/share/java/libformula-0.2.0.jar"; then ac_cv_file__usr_share_java_libformula_0_2_0_jar=yes else ac_cv_file__usr_share_java_libformula_0_2_0_jar=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_libformula_0_2_0_jar" >&5 -$as_echo "$ac_cv_file__usr_share_java_libformula_0_2_0_jar" >&6; } -if test "x$ac_cv_file__usr_share_java_libformula_0_2_0_jar" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libformula_0_2_0_jar" >&5 +echo "${ECHO_T}$ac_cv_file__usr_share_java_libformula_0_2_0_jar" >&6 +if test $ac_cv_file__usr_share_java_libformula_0_2_0_jar = yes; then LIBFORMULA_JAR=/usr/share/java/libformula-0.2.0.jar else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/libformula.jar" >&5 -$as_echo_n "checking for /usr/share/java/libformula.jar... " >&6; } -if test "${ac_cv_file__usr_share_java_libformula_jar+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for /usr/share/java/libformula.jar" >&5 +echo $ECHO_N "checking for /usr/share/java/libformula.jar... $ECHO_C" >&6 +if test "${ac_cv_file__usr_share_java_libformula_jar+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "/usr/share/java/libformula.jar"; then ac_cv_file__usr_share_java_libformula_jar=yes else ac_cv_file__usr_share_java_libformula_jar=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_libformula_jar" >&5 -$as_echo "$ac_cv_file__usr_share_java_libformula_jar" >&6; } -if test "x$ac_cv_file__usr_share_java_libformula_jar" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libformula_jar" >&5 +echo "${ECHO_T}$ac_cv_file__usr_share_java_libformula_jar" >&6 +if test $ac_cv_file__usr_share_java_libformula_jar = yes; then LIBFORMULA_JAR=/usr/share/java/libformula.jar else - as_fn_error "libformula.jar replacement not found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: libformula.jar replacement not found." >&5 +echo "$as_me: error: libformula.jar replacement not found." >&2;} + { (exit 1); exit 1; }; } fi @@ -20450,71 +26096,79 @@ fi fi else - as_ac_File=`$as_echo "ac_cv_file_$LIBFORMULA_JAR" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LIBFORMULA_JAR" >&5 -$as_echo_n "checking for $LIBFORMULA_JAR... " >&6; } -if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 + as_ac_File=`echo "ac_cv_file_$LIBFORMULA_JAR" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $LIBFORMULA_JAR" >&5 +echo $ECHO_N "checking for $LIBFORMULA_JAR... $ECHO_C" >&6 +if eval "test \"\${$as_ac_File+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "$LIBFORMULA_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -eval as_val=\$$as_ac_File - if test "x$as_val" = x""yes; then : - +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 +if test `eval echo '${'$as_ac_File'}'` = yes; then + : else - as_fn_error "libformula.jar not found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: libformula.jar not found." >&5 +echo "$as_me: error: libformula.jar not found." >&2;} + { (exit 1); exit 1; }; } fi fi if test -z $LIBREPOSITORY_JAR; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/librepository-1.0.0.jar" >&5 -$as_echo_n "checking for /usr/share/java/librepository-1.0.0.jar... " >&6; } -if test "${ac_cv_file__usr_share_java_librepository_1_0_0_jar+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for /usr/share/java/librepository-1.0.0.jar" >&5 +echo $ECHO_N "checking for /usr/share/java/librepository-1.0.0.jar... $ECHO_C" >&6 +if test "${ac_cv_file__usr_share_java_librepository_1_0_0_jar+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "/usr/share/java/librepository-1.0.0.jar"; then ac_cv_file__usr_share_java_librepository_1_0_0_jar=yes else ac_cv_file__usr_share_java_librepository_1_0_0_jar=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_librepository_1_0_0_jar" >&5 -$as_echo "$ac_cv_file__usr_share_java_librepository_1_0_0_jar" >&6; } -if test "x$ac_cv_file__usr_share_java_librepository_1_0_0_jar" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_librepository_1_0_0_jar" >&5 +echo "${ECHO_T}$ac_cv_file__usr_share_java_librepository_1_0_0_jar" >&6 +if test $ac_cv_file__usr_share_java_librepository_1_0_0_jar = yes; then LIBREPOSITORY_JAR=/usr/share/java/librepository-1.0.0.jar else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/librepository.jar" >&5 -$as_echo_n "checking for /usr/share/java/librepository.jar... " >&6; } -if test "${ac_cv_file__usr_share_java_librepository_jar+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for /usr/share/java/librepository.jar" >&5 +echo $ECHO_N "checking for /usr/share/java/librepository.jar... $ECHO_C" >&6 +if test "${ac_cv_file__usr_share_java_librepository_jar+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "/usr/share/java/librepository.jar"; then ac_cv_file__usr_share_java_librepository_jar=yes else ac_cv_file__usr_share_java_librepository_jar=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_librepository_jar" >&5 -$as_echo "$ac_cv_file__usr_share_java_librepository_jar" >&6; } -if test "x$ac_cv_file__usr_share_java_librepository_jar" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_librepository_jar" >&5 +echo "${ECHO_T}$ac_cv_file__usr_share_java_librepository_jar" >&6 +if test $ac_cv_file__usr_share_java_librepository_jar = yes; then LIBREPOSITORY_JAR=/usr/share/java/librepository.jar else - as_fn_error "librepository.jar replacement not found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: librepository.jar replacement not found." >&5 +echo "$as_me: error: librepository.jar replacement not found." >&2;} + { (exit 1); exit 1; }; } fi @@ -20523,71 +26177,79 @@ fi fi else - as_ac_File=`$as_echo "ac_cv_file_$LIBREPOSITORY_JAR" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LIBREPOSITORY_JAR" >&5 -$as_echo_n "checking for $LIBREPOSITORY_JAR... " >&6; } -if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 + as_ac_File=`echo "ac_cv_file_$LIBREPOSITORY_JAR" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $LIBREPOSITORY_JAR" >&5 +echo $ECHO_N "checking for $LIBREPOSITORY_JAR... $ECHO_C" >&6 +if eval "test \"\${$as_ac_File+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "$LIBREPOSITORY_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -eval as_val=\$$as_ac_File - if test "x$as_val" = x""yes; then : - +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 +if test `eval echo '${'$as_ac_File'}'` = yes; then + : else - as_fn_error "librepository.jar not found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: librepository.jar not found." >&5 +echo "$as_me: error: librepository.jar not found." >&2;} + { (exit 1); exit 1; }; } fi fi if test -z $LIBFONTS_JAR; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/libfonts-1.0.0.jar" >&5 -$as_echo_n "checking for /usr/share/java/libfonts-1.0.0.jar... " >&6; } -if test "${ac_cv_file__usr_share_java_libfonts_1_0_0_jar+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for /usr/share/java/libfonts-1.0.0.jar" >&5 +echo $ECHO_N "checking for /usr/share/java/libfonts-1.0.0.jar... $ECHO_C" >&6 +if test "${ac_cv_file__usr_share_java_libfonts_1_0_0_jar+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "/usr/share/java/libfonts-1.0.0.jar"; then ac_cv_file__usr_share_java_libfonts_1_0_0_jar=yes else ac_cv_file__usr_share_java_libfonts_1_0_0_jar=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_libfonts_1_0_0_jar" >&5 -$as_echo "$ac_cv_file__usr_share_java_libfonts_1_0_0_jar" >&6; } -if test "x$ac_cv_file__usr_share_java_libfonts_1_0_0_jar" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libfonts_1_0_0_jar" >&5 +echo "${ECHO_T}$ac_cv_file__usr_share_java_libfonts_1_0_0_jar" >&6 +if test $ac_cv_file__usr_share_java_libfonts_1_0_0_jar = yes; then LIBFONTS_JAR=/usr/share/java/libfonts-1.0.0.jar else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/libfonts.jar" >&5 -$as_echo_n "checking for /usr/share/java/libfonts.jar... " >&6; } -if test "${ac_cv_file__usr_share_java_libfonts_jar+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for /usr/share/java/libfonts.jar" >&5 +echo $ECHO_N "checking for /usr/share/java/libfonts.jar... $ECHO_C" >&6 +if test "${ac_cv_file__usr_share_java_libfonts_jar+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "/usr/share/java/libfonts.jar"; then ac_cv_file__usr_share_java_libfonts_jar=yes else ac_cv_file__usr_share_java_libfonts_jar=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_libfonts_jar" >&5 -$as_echo "$ac_cv_file__usr_share_java_libfonts_jar" >&6; } -if test "x$ac_cv_file__usr_share_java_libfonts_jar" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libfonts_jar" >&5 +echo "${ECHO_T}$ac_cv_file__usr_share_java_libfonts_jar" >&6 +if test $ac_cv_file__usr_share_java_libfonts_jar = yes; then LIBFONTS_JAR=/usr/share/java/libfonts.jar else - as_fn_error "libfonts.jar replacement not found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: libfonts.jar replacement not found." >&5 +echo "$as_me: error: libfonts.jar replacement not found." >&2;} + { (exit 1); exit 1; }; } fi @@ -20596,71 +26258,79 @@ fi fi else - as_ac_File=`$as_echo "ac_cv_file_$LIBFONTS_JAR" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LIBFONTS_JAR" >&5 -$as_echo_n "checking for $LIBFONTS_JAR... " >&6; } -if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 + as_ac_File=`echo "ac_cv_file_$LIBFONTS_JAR" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $LIBFONTS_JAR" >&5 +echo $ECHO_N "checking for $LIBFONTS_JAR... $ECHO_C" >&6 +if eval "test \"\${$as_ac_File+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "$LIBFONTS_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -eval as_val=\$$as_ac_File - if test "x$as_val" = x""yes; then : - +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 +if test `eval echo '${'$as_ac_File'}'` = yes; then + : else - as_fn_error "libfonts.jar not found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: libfonts.jar not found." >&5 +echo "$as_me: error: libfonts.jar not found." >&2;} + { (exit 1); exit 1; }; } fi fi if test -z $LIBSERIALIZER_JAR; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/libserializer-1.0.0.jar" >&5 -$as_echo_n "checking for /usr/share/java/libserializer-1.0.0.jar... " >&6; } -if test "${ac_cv_file__usr_share_java_libserializer_1_0_0_jar+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for /usr/share/java/libserializer-1.0.0.jar" >&5 +echo $ECHO_N "checking for /usr/share/java/libserializer-1.0.0.jar... $ECHO_C" >&6 +if test "${ac_cv_file__usr_share_java_libserializer_1_0_0_jar+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "/usr/share/java/libserializer-1.0.0.jar"; then ac_cv_file__usr_share_java_libserializer_1_0_0_jar=yes else ac_cv_file__usr_share_java_libserializer_1_0_0_jar=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_libserializer_1_0_0_jar" >&5 -$as_echo "$ac_cv_file__usr_share_java_libserializer_1_0_0_jar" >&6; } -if test "x$ac_cv_file__usr_share_java_libserializer_1_0_0_jar" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libserializer_1_0_0_jar" >&5 +echo "${ECHO_T}$ac_cv_file__usr_share_java_libserializer_1_0_0_jar" >&6 +if test $ac_cv_file__usr_share_java_libserializer_1_0_0_jar = yes; then LIBSERIALIZER_JAR=/usr/share/java/libserializer-1.0.0.jar else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/libserializer.jar" >&5 -$as_echo_n "checking for /usr/share/java/libserializer.jar... " >&6; } -if test "${ac_cv_file__usr_share_java_libserializer_jar+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for /usr/share/java/libserializer.jar" >&5 +echo $ECHO_N "checking for /usr/share/java/libserializer.jar... $ECHO_C" >&6 +if test "${ac_cv_file__usr_share_java_libserializer_jar+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "/usr/share/java/libserializer.jar"; then ac_cv_file__usr_share_java_libserializer_jar=yes else ac_cv_file__usr_share_java_libserializer_jar=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_libserializer_jar" >&5 -$as_echo "$ac_cv_file__usr_share_java_libserializer_jar" >&6; } -if test "x$ac_cv_file__usr_share_java_libserializer_jar" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libserializer_jar" >&5 +echo "${ECHO_T}$ac_cv_file__usr_share_java_libserializer_jar" >&6 +if test $ac_cv_file__usr_share_java_libserializer_jar = yes; then LIBSERIALIZER_JAR=/usr/share/java/libserializer.jar else - as_fn_error "libserializer.jar replacement not found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: libserializer.jar replacement not found." >&5 +echo "$as_me: error: libserializer.jar replacement not found." >&2;} + { (exit 1); exit 1; }; } fi @@ -20669,72 +26339,80 @@ fi fi else - as_ac_File=`$as_echo "ac_cv_file_$LIBSERIALIZER_JAR" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LIBSERIALIZER_JAR" >&5 -$as_echo_n "checking for $LIBSERIALIZER_JAR... " >&6; } -if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 + as_ac_File=`echo "ac_cv_file_$LIBSERIALIZER_JAR" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $LIBSERIALIZER_JAR" >&5 +echo $ECHO_N "checking for $LIBSERIALIZER_JAR... $ECHO_C" >&6 +if eval "test \"\${$as_ac_File+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "$LIBSERIALIZER_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -eval as_val=\$$as_ac_File - if test "x$as_val" = x""yes; then : - +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 +if test `eval echo '${'$as_ac_File'}'` = yes; then + : else - as_fn_error "libserializer.jar not found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: libserializer.jar not found." >&5 +echo "$as_me: error: libserializer.jar not found." >&2;} + { (exit 1); exit 1; }; } fi fi if test -z $LIBBASE_JAR; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/libbase-1.0.0.jar" >&5 -$as_echo_n "checking for /usr/share/java/libbase-1.0.0.jar... " >&6; } -if test "${ac_cv_file__usr_share_java_libbase_1_0_0_jar+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for /usr/share/java/libbase-1.0.0.jar" >&5 +echo $ECHO_N "checking for /usr/share/java/libbase-1.0.0.jar... $ECHO_C" >&6 +if test "${ac_cv_file__usr_share_java_libbase_1_0_0_jar+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "/usr/share/java/libbase-1.0.0.jar"; then ac_cv_file__usr_share_java_libbase_1_0_0_jar=yes else ac_cv_file__usr_share_java_libbase_1_0_0_jar=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_libbase_1_0_0_jar" >&5 -$as_echo "$ac_cv_file__usr_share_java_libbase_1_0_0_jar" >&6; } -if test "x$ac_cv_file__usr_share_java_libbase_1_0_0_jar" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libbase_1_0_0_jar" >&5 +echo "${ECHO_T}$ac_cv_file__usr_share_java_libbase_1_0_0_jar" >&6 +if test $ac_cv_file__usr_share_java_libbase_1_0_0_jar = yes; then LIBBASE_JAR=/usr/share/java/libbase-1.0.0.jar else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/libbase.jar" >&5 -$as_echo_n "checking for /usr/share/java/libbase.jar... " >&6; } -if test "${ac_cv_file__usr_share_java_libbase_jar+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for /usr/share/java/libbase.jar" >&5 +echo $ECHO_N "checking for /usr/share/java/libbase.jar... $ECHO_C" >&6 +if test "${ac_cv_file__usr_share_java_libbase_jar+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "/usr/share/java/libbase.jar"; then ac_cv_file__usr_share_java_libbase_jar=yes else ac_cv_file__usr_share_java_libbase_jar=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_libbase_jar" >&5 -$as_echo "$ac_cv_file__usr_share_java_libbase_jar" >&6; } -if test "x$ac_cv_file__usr_share_java_libbase_jar" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_libbase_jar" >&5 +echo "${ECHO_T}$ac_cv_file__usr_share_java_libbase_jar" >&6 +if test $ac_cv_file__usr_share_java_libbase_jar = yes; then LIBBASE_JAR=/usr/share/java/libbase.jar else - as_fn_error "libbase.jar replacement not found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: libbase.jar replacement not found." >&5 +echo "$as_me: error: libbase.jar replacement not found." >&2;} + { (exit 1); exit 1; }; } fi @@ -20743,50 +26421,54 @@ fi fi else - as_ac_File=`$as_echo "ac_cv_file_$LIBBASE_JAR" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LIBBASE_JAR" >&5 -$as_echo_n "checking for $LIBBASE_JAR... " >&6; } -if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 + as_ac_File=`echo "ac_cv_file_$LIBBASE_JAR" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $LIBBASE_JAR" >&5 +echo $ECHO_N "checking for $LIBBASE_JAR... $ECHO_C" >&6 +if eval "test \"\${$as_ac_File+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "$LIBBASE_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -eval as_val=\$$as_ac_File - if test "x$as_val" = x""yes; then : - +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 +if test `eval echo '${'$as_ac_File'}'` = yes; then + : else - as_fn_error "libbase.jar not found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: libbase.jar not found." >&5 +echo "$as_me: error: libbase.jar not found." >&2;} + { (exit 1); exit 1; }; } fi fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 -$as_echo "internal" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jfreereport module" >&5 -$as_echo_n "checking for jfreereport module... " >&6; } + echo "$as_me:$LINENO: result: internal" >&5 +echo "${ECHO_T}internal" >&6 + echo "$as_me:$LINENO: checking for jfreereport module" >&5 +echo $ECHO_N "checking for jfreereport module... $ECHO_C" >&6 if test -d ./jfreereport; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: OK" >&5 -$as_echo "OK" >&6; } + echo "$as_me:$LINENO: result: OK" >&5 +echo "${ECHO_T}OK" >&6 else - as_fn_error "not existing. get it (did you get the -extensions tarball?)" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: not existing. get it (did you get the -extensions tarball?)" >&5 +echo "$as_me: error: not existing. get it (did you get the -extensions tarball?)" >&2;} + { (exit 1); exit 1; }; } fi SYSTEM_JFREEREPORT=NO BUILD_TYPE="$BUILD_TYPE JFREEREPORT" fi BUILD_TYPE="$BUILD_TYPE REPORTBUILDER" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 ENABLE_REPORTBUILDER=NO SYSTEM_JFREEREPORT=NO fi @@ -20807,52 +26489,58 @@ fi # this has to be here because both the wiki publisher and the SRB use # commons-logging if test "$ENABLE_MEDIAWIKI" = "YES" -o "$ENABLE_REPORTBUILDER" = "YES"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking which Apache commons-* libs to use" >&5 -$as_echo_n "checking which Apache commons-* libs to use... " >&6; } + echo "$as_me:$LINENO: checking which Apache commons-* libs to use" >&5 +echo $ECHO_N "checking which Apache commons-* libs to use... $ECHO_C" >&6 if test "$with_system_apache_commons" = "yes"; then SYSTEM_APACHE_COMMONS=YES - { $as_echo "$as_me:${as_lineno-$LINENO}: result: external" >&5 -$as_echo "external" >&6; } + echo "$as_me:$LINENO: result: external" >&5 +echo "${ECHO_T}external" >&6 if test "$ENABLE_MEDIAWIKI" = "YES"; then if test -z $COMMONS_CODEC_JAR; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/commons-codec-1.3.jar" >&5 -$as_echo_n "checking for /usr/share/java/commons-codec-1.3.jar... " >&6; } -if test "${ac_cv_file__usr_share_java_commons_codec_1_3_jar+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for /usr/share/java/commons-codec-1.3.jar" >&5 +echo $ECHO_N "checking for /usr/share/java/commons-codec-1.3.jar... $ECHO_C" >&6 +if test "${ac_cv_file__usr_share_java_commons_codec_1_3_jar+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "/usr/share/java/commons-codec-1.3.jar"; then ac_cv_file__usr_share_java_commons_codec_1_3_jar=yes else ac_cv_file__usr_share_java_commons_codec_1_3_jar=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_commons_codec_1_3_jar" >&5 -$as_echo "$ac_cv_file__usr_share_java_commons_codec_1_3_jar" >&6; } -if test "x$ac_cv_file__usr_share_java_commons_codec_1_3_jar" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_commons_codec_1_3_jar" >&5 +echo "${ECHO_T}$ac_cv_file__usr_share_java_commons_codec_1_3_jar" >&6 +if test $ac_cv_file__usr_share_java_commons_codec_1_3_jar = yes; then COMMONS_CODEC_JAR=/usr/share/java/commons-codec-1.3.jar else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/commons-codec.jar" >&5 -$as_echo_n "checking for /usr/share/java/commons-codec.jar... " >&6; } -if test "${ac_cv_file__usr_share_java_commons_codec_jar+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for /usr/share/java/commons-codec.jar" >&5 +echo $ECHO_N "checking for /usr/share/java/commons-codec.jar... $ECHO_C" >&6 +if test "${ac_cv_file__usr_share_java_commons_codec_jar+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "/usr/share/java/commons-codec.jar"; then ac_cv_file__usr_share_java_commons_codec_jar=yes else ac_cv_file__usr_share_java_commons_codec_jar=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_commons_codec_jar" >&5 -$as_echo "$ac_cv_file__usr_share_java_commons_codec_jar" >&6; } -if test "x$ac_cv_file__usr_share_java_commons_codec_jar" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_commons_codec_jar" >&5 +echo "${ECHO_T}$ac_cv_file__usr_share_java_commons_codec_jar" >&6 +if test $ac_cv_file__usr_share_java_commons_codec_jar = yes; then COMMONS_CODEC_JAR=/usr/share/java/commons-codecs.jar else - as_fn_error "commons-codec.jar replacement not found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: commons-codec.jar replacement not found." >&5 +echo "$as_me: error: commons-codec.jar replacement not found." >&2;} + { (exit 1); exit 1; }; } fi @@ -20861,71 +26549,79 @@ fi fi else - as_ac_File=`$as_echo "ac_cv_file_$COMMONS_CODEC_JAR" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $COMMONS_CODEC_JAR" >&5 -$as_echo_n "checking for $COMMONS_CODEC_JAR... " >&6; } -if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 + as_ac_File=`echo "ac_cv_file_$COMMONS_CODEC_JAR" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $COMMONS_CODEC_JAR" >&5 +echo $ECHO_N "checking for $COMMONS_CODEC_JAR... $ECHO_C" >&6 +if eval "test \"\${$as_ac_File+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "$COMMONS_CODEC_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -eval as_val=\$$as_ac_File - if test "x$as_val" = x""yes; then : - +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 +if test `eval echo '${'$as_ac_File'}'` = yes; then + : else - as_fn_error "commons-codec.jar not found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: commons-codec.jar not found." >&5 +echo "$as_me: error: commons-codec.jar not found." >&2;} + { (exit 1); exit 1; }; } fi fi if test -z $COMMONS_LANG_JAR; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/commons-lang-2.3.jar" >&5 -$as_echo_n "checking for /usr/share/java/commons-lang-2.3.jar... " >&6; } -if test "${ac_cv_file__usr_share_java_commons_lang_2_3_jar+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for /usr/share/java/commons-lang-2.3.jar" >&5 +echo $ECHO_N "checking for /usr/share/java/commons-lang-2.3.jar... $ECHO_C" >&6 +if test "${ac_cv_file__usr_share_java_commons_lang_2_3_jar+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "/usr/share/java/commons-lang-2.3.jar"; then ac_cv_file__usr_share_java_commons_lang_2_3_jar=yes else ac_cv_file__usr_share_java_commons_lang_2_3_jar=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_commons_lang_2_3_jar" >&5 -$as_echo "$ac_cv_file__usr_share_java_commons_lang_2_3_jar" >&6; } -if test "x$ac_cv_file__usr_share_java_commons_lang_2_3_jar" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_commons_lang_2_3_jar" >&5 +echo "${ECHO_T}$ac_cv_file__usr_share_java_commons_lang_2_3_jar" >&6 +if test $ac_cv_file__usr_share_java_commons_lang_2_3_jar = yes; then COMMONS_LANG_JAR=/usr/share/java/commons-lang-2.3.jar else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/commons-lang.jar" >&5 -$as_echo_n "checking for /usr/share/java/commons-lang.jar... " >&6; } -if test "${ac_cv_file__usr_share_java_commons_lang_jar+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for /usr/share/java/commons-lang.jar" >&5 +echo $ECHO_N "checking for /usr/share/java/commons-lang.jar... $ECHO_C" >&6 +if test "${ac_cv_file__usr_share_java_commons_lang_jar+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "/usr/share/java/commons-lang.jar"; then ac_cv_file__usr_share_java_commons_lang_jar=yes else ac_cv_file__usr_share_java_commons_lang_jar=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_commons_lang_jar" >&5 -$as_echo "$ac_cv_file__usr_share_java_commons_lang_jar" >&6; } -if test "x$ac_cv_file__usr_share_java_commons_lang_jar" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_commons_lang_jar" >&5 +echo "${ECHO_T}$ac_cv_file__usr_share_java_commons_lang_jar" >&6 +if test $ac_cv_file__usr_share_java_commons_lang_jar = yes; then COMMONS_LANG_JAR=/usr/share/java/commons-lang.jar else - as_fn_error "commons-lang.jar replacement not found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: commons-lang.jar replacement not found." >&5 +echo "$as_me: error: commons-lang.jar replacement not found." >&2;} + { (exit 1); exit 1; }; } fi @@ -20934,71 +26630,79 @@ fi fi else - as_ac_File=`$as_echo "ac_cv_file_$COMMONS_LANG_JAR" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $COMMONS_LANG_JAR" >&5 -$as_echo_n "checking for $COMMONS_LANG_JAR... " >&6; } -if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 + as_ac_File=`echo "ac_cv_file_$COMMONS_LANG_JAR" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $COMMONS_LANG_JAR" >&5 +echo $ECHO_N "checking for $COMMONS_LANG_JAR... $ECHO_C" >&6 +if eval "test \"\${$as_ac_File+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "$COMMONS_LANG_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -eval as_val=\$$as_ac_File - if test "x$as_val" = x""yes; then : - +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 +if test `eval echo '${'$as_ac_File'}'` = yes; then + : else - as_fn_error "commons-lang.jar not found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: commons-lang.jar not found." >&5 +echo "$as_me: error: commons-lang.jar not found." >&2;} + { (exit 1); exit 1; }; } fi fi if test -z $COMMONS_HTTPCLIENT_JAR; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/commons-httpclient-3.1.jar" >&5 -$as_echo_n "checking for /usr/share/java/commons-httpclient-3.1.jar... " >&6; } -if test "${ac_cv_file__usr_share_java_commons_httpclient_3_1_jar+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for /usr/share/java/commons-httpclient-3.1.jar" >&5 +echo $ECHO_N "checking for /usr/share/java/commons-httpclient-3.1.jar... $ECHO_C" >&6 +if test "${ac_cv_file__usr_share_java_commons_httpclient_3_1_jar+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "/usr/share/java/commons-httpclient-3.1.jar"; then ac_cv_file__usr_share_java_commons_httpclient_3_1_jar=yes else ac_cv_file__usr_share_java_commons_httpclient_3_1_jar=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_commons_httpclient_3_1_jar" >&5 -$as_echo "$ac_cv_file__usr_share_java_commons_httpclient_3_1_jar" >&6; } -if test "x$ac_cv_file__usr_share_java_commons_httpclient_3_1_jar" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_commons_httpclient_3_1_jar" >&5 +echo "${ECHO_T}$ac_cv_file__usr_share_java_commons_httpclient_3_1_jar" >&6 +if test $ac_cv_file__usr_share_java_commons_httpclient_3_1_jar = yes; then COMMONS_HTTPCLIENT_JAR=/usr/share/java/commons-httpclient-3.1.jar else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/commons-httpclient.jar" >&5 -$as_echo_n "checking for /usr/share/java/commons-httpclient.jar... " >&6; } -if test "${ac_cv_file__usr_share_java_commons_httpclient_jar+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for /usr/share/java/commons-httpclient.jar" >&5 +echo $ECHO_N "checking for /usr/share/java/commons-httpclient.jar... $ECHO_C" >&6 +if test "${ac_cv_file__usr_share_java_commons_httpclient_jar+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "/usr/share/java/commons-httpclient.jar"; then ac_cv_file__usr_share_java_commons_httpclient_jar=yes else ac_cv_file__usr_share_java_commons_httpclient_jar=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_commons_httpclient_jar" >&5 -$as_echo "$ac_cv_file__usr_share_java_commons_httpclient_jar" >&6; } -if test "x$ac_cv_file__usr_share_java_commons_httpclient_jar" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_commons_httpclient_jar" >&5 +echo "${ECHO_T}$ac_cv_file__usr_share_java_commons_httpclient_jar" >&6 +if test $ac_cv_file__usr_share_java_commons_httpclient_jar = yes; then COMMONS_HTTPCLIENT_JAR=/usr/share/java/commons-httpclient.jar else - as_fn_error "commons-httpclient.jar replacement not found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: commons-httpclient.jar replacement not found." >&5 +echo "$as_me: error: commons-httpclient.jar replacement not found." >&2;} + { (exit 1); exit 1; }; } fi @@ -21007,72 +26711,80 @@ fi fi else - as_ac_File=`$as_echo "ac_cv_file_$COMMONS_HTTPCLIENT_JAR" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $COMMONS_HTTPCLIENT_JAR" >&5 -$as_echo_n "checking for $COMMONS_HTTPCLIENT_JAR... " >&6; } -if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 + as_ac_File=`echo "ac_cv_file_$COMMONS_HTTPCLIENT_JAR" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $COMMONS_HTTPCLIENT_JAR" >&5 +echo $ECHO_N "checking for $COMMONS_HTTPCLIENT_JAR... $ECHO_C" >&6 +if eval "test \"\${$as_ac_File+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "$COMMONS_HTTPCLIENT_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -eval as_val=\$$as_ac_File - if test "x$as_val" = x""yes; then : - +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 +if test `eval echo '${'$as_ac_File'}'` = yes; then + : else - as_fn_error "commons-httpclient.jar not found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: commons-httpclient.jar not found." >&5 +echo "$as_me: error: commons-httpclient.jar not found." >&2;} + { (exit 1); exit 1; }; } fi fi fi if test "$ENABLE_MEDIAWIKI" = "YES" -o "$ENABLE_REPORTBUILDER" = "YES"; then if test -z $COMMONS_LOGGING_JAR; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/commons-logging-1.1.1.jar" >&5 -$as_echo_n "checking for /usr/share/java/commons-logging-1.1.1.jar... " >&6; } -if test "${ac_cv_file__usr_share_java_commons_logging_1_1_1_jar+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for /usr/share/java/commons-logging-1.1.1.jar" >&5 +echo $ECHO_N "checking for /usr/share/java/commons-logging-1.1.1.jar... $ECHO_C" >&6 +if test "${ac_cv_file__usr_share_java_commons_logging_1_1_1_jar+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "/usr/share/java/commons-logging-1.1.1.jar"; then ac_cv_file__usr_share_java_commons_logging_1_1_1_jar=yes else ac_cv_file__usr_share_java_commons_logging_1_1_1_jar=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_commons_logging_1_1_1_jar" >&5 -$as_echo "$ac_cv_file__usr_share_java_commons_logging_1_1_1_jar" >&6; } -if test "x$ac_cv_file__usr_share_java_commons_logging_1_1_1_jar" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_commons_logging_1_1_1_jar" >&5 +echo "${ECHO_T}$ac_cv_file__usr_share_java_commons_logging_1_1_1_jar" >&6 +if test $ac_cv_file__usr_share_java_commons_logging_1_1_1_jar = yes; then COMMONS_LOGGING_JAR=/usr/share/java/commons-logging-1.1.1.jar else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/share/java/commons-logging.jar" >&5 -$as_echo_n "checking for /usr/share/java/commons-logging.jar... " >&6; } -if test "${ac_cv_file__usr_share_java_commons_logging_jar+set}" = set; then : - $as_echo_n "(cached) " >&6 + echo "$as_me:$LINENO: checking for /usr/share/java/commons-logging.jar" >&5 +echo $ECHO_N "checking for /usr/share/java/commons-logging.jar... $ECHO_C" >&6 +if test "${ac_cv_file__usr_share_java_commons_logging_jar+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "/usr/share/java/commons-logging.jar"; then ac_cv_file__usr_share_java_commons_logging_jar=yes else ac_cv_file__usr_share_java_commons_logging_jar=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_share_java_commons_logging_jar" >&5 -$as_echo "$ac_cv_file__usr_share_java_commons_logging_jar" >&6; } -if test "x$ac_cv_file__usr_share_java_commons_logging_jar" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_file__usr_share_java_commons_logging_jar" >&5 +echo "${ECHO_T}$ac_cv_file__usr_share_java_commons_logging_jar" >&6 +if test $ac_cv_file__usr_share_java_commons_logging_jar = yes; then COMMONS_LOGGING_JAR=/usr/share/java/commons-logging.jar else - as_fn_error "commons-logging.jar replacement not found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: commons-logging.jar replacement not found." >&5 +echo "$as_me: error: commons-logging.jar replacement not found." >&2;} + { (exit 1); exit 1; }; } fi @@ -21081,35 +26793,37 @@ fi fi else - as_ac_File=`$as_echo "ac_cv_file_$COMMONS_LOGGING_JAR" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $COMMONS_LOGGING_JAR" >&5 -$as_echo_n "checking for $COMMONS_LOGGING_JAR... " >&6; } -if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 + as_ac_File=`echo "ac_cv_file_$COMMONS_LOGGING_JAR" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $COMMONS_LOGGING_JAR" >&5 +echo $ECHO_N "checking for $COMMONS_LOGGING_JAR... $ECHO_C" >&6 +if eval "test \"\${$as_ac_File+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - as_fn_error "cannot check for file existence when cross compiling" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { (exit 1); exit 1; }; } if test -r "$COMMONS_LOGGING_JAR"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -eval ac_res=\$$as_ac_File - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -eval as_val=\$$as_ac_File - if test "x$as_val" = x""yes; then : - +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 +if test `eval echo '${'$as_ac_File'}'` = yes; then + : else - as_fn_error "commons-logging.jar not found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: commons-logging.jar not found." >&5 +echo "$as_me: error: commons-logging.jar not found." >&2;} + { (exit 1); exit 1; }; } fi fi fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: internal" >&5 -$as_echo "internal" >&6; } + echo "$as_me:$LINENO: result: internal" >&5 +echo "${ECHO_T}internal" >&6 SYSTEM_APACHE_COMMONS=NO BUILD_TYPE="$BUILD_TYPE APACHE_COMMONS TOMCAT" fi @@ -21161,8 +26875,8 @@ if test "$test_kde" = "yes" -a "$ENABLE_KDE" = "TRUE" ; then kde_test_include="ksharedptr.h" kde_test_library="libkdeui.so" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Qt headers" >&5 -$as_echo_n "checking for Qt headers... " >&6; } + echo "$as_me:$LINENO: checking for Qt headers" >&5 +echo $ECHO_N "checking for Qt headers... $ECHO_C" >&6 qt_incdir="no" for kde_check in $qt_incdirs ; do if test -r "$kde_check/$qt_test_include" ; then @@ -21170,15 +26884,18 @@ $as_echo_n "checking for Qt headers... " >&6; } break fi done - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $qt_incdir" >&5 -$as_echo "$qt_incdir" >&6; } + echo "$as_me:$LINENO: result: $qt_incdir" >&5 +echo "${ECHO_T}$qt_incdir" >&6 if test "x$qt_incdir" = "xno" ; then - as_fn_error "Qt headers not found. Please specify the root of -your Qt installation by exporting QTDIR before running \"configure\"." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Qt headers not found. Please specify the root of +your Qt installation by exporting QTDIR before running \"configure\"." >&5 +echo "$as_me: error: Qt headers not found. Please specify the root of +your Qt installation by exporting QTDIR before running \"configure\"." >&2;} + { (exit 1); exit 1; }; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Qt libraries" >&5 -$as_echo_n "checking for Qt libraries... " >&6; } + echo "$as_me:$LINENO: checking for Qt libraries" >&5 +echo $ECHO_N "checking for Qt libraries... $ECHO_C" >&6 qt_libdir="no" for qt_check in $qt_libdirs ; do if test -r "$qt_check/$qt_test_library" ; then @@ -21186,19 +26903,22 @@ $as_echo_n "checking for Qt libraries... " >&6; } break fi done - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $qt_libdir" >&5 -$as_echo "$qt_libdir" >&6; } + echo "$as_me:$LINENO: result: $qt_libdir" >&5 +echo "${ECHO_T}$qt_libdir" >&6 if test "x$qt_libdir" = "xno" ; then - as_fn_error "Qt libraries not found. Please specify the root of -your Qt installation by exporting QTDIR before running \"configure\"." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Qt libraries not found. Please specify the root of +your Qt installation by exporting QTDIR before running \"configure\"." >&5 +echo "$as_me: error: Qt libraries not found. Please specify the root of +your Qt installation by exporting QTDIR before running \"configure\"." >&2;} + { (exit 1); exit 1; }; } fi # Extract the first word of "moc", so it can be a program name with args. set dummy moc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_MOC+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_MOC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MOC in [\\/]* | ?:[\\/]*) @@ -21211,37 +26931,39 @@ for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MOC="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done test -z "$ac_cv_path_MOC" && ac_cv_path_MOC="no" ;; esac fi MOC=$ac_cv_path_MOC + if test -n "$MOC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOC" >&5 -$as_echo "$MOC" >&6; } + echo "$as_me:$LINENO: result: $MOC" >&5 +echo "${ECHO_T}$MOC" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test "$MOC" = "no" ; then - as_fn_error "Qt Meta Object Compiler not found. Please specify -the root of your Qt installation by exporting QTDIR before running \"configure\"." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Qt Meta Object Compiler not found. Please specify +the root of your Qt installation by exporting QTDIR before running \"configure\"." >&5 +echo "$as_me: error: Qt Meta Object Compiler not found. Please specify +the root of your Qt installation by exporting QTDIR before running \"configure\"." >&2;} + { (exit 1); exit 1; }; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for KDE headers" >&5 -$as_echo_n "checking for KDE headers... " >&6; } + echo "$as_me:$LINENO: checking for KDE headers" >&5 +echo $ECHO_N "checking for KDE headers... $ECHO_C" >&6 kde_incdir="no" for kde_check in $kde_incdirs ; do if test -r "$kde_check/$kde_test_include" ; then @@ -21249,15 +26971,18 @@ $as_echo_n "checking for KDE headers... " >&6; } break fi done - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $kde_incdir" >&5 -$as_echo "$kde_incdir" >&6; } + echo "$as_me:$LINENO: result: $kde_incdir" >&5 +echo "${ECHO_T}$kde_incdir" >&6 if test "x$kde_incdir" = "xno" ; then - as_fn_error "KDE headers not found. Please specify the root of -your KDE installation by exporting KDEDIR before running \"configure\"." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: KDE headers not found. Please specify the root of +your KDE installation by exporting KDEDIR before running \"configure\"." >&5 +echo "$as_me: error: KDE headers not found. Please specify the root of +your KDE installation by exporting KDEDIR before running \"configure\"." >&2;} + { (exit 1); exit 1; }; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for KDE libraries" >&5 -$as_echo_n "checking for KDE libraries... " >&6; } + echo "$as_me:$LINENO: checking for KDE libraries" >&5 +echo $ECHO_N "checking for KDE libraries... $ECHO_C" >&6 kde_libdir="no" for kde_check in $kde_libdirs ; do if test -r "$kde_check/$kde_test_library" ; then @@ -21265,11 +26990,14 @@ $as_echo_n "checking for KDE libraries... " >&6; } break fi done - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $kde_libdir" >&5 -$as_echo "$kde_libdir" >&6; } + echo "$as_me:$LINENO: result: $kde_libdir" >&5 +echo "${ECHO_T}$kde_libdir" >&6 if test "x$kde_libdir" = "xno" ; then - as_fn_error "KDE libraries not found. Please specify the root of -your KDE installation by exporting KDEDIR before running \"configure\"." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: KDE libraries not found. Please specify the root of +your KDE installation by exporting KDEDIR before running \"configure\"." >&5 +echo "$as_me: error: KDE libraries not found. Please specify the root of +your KDE installation by exporting KDEDIR before running \"configure\"." >&2;} + { (exit 1); exit 1; }; } fi KDE_CFLAGS="-I$qt_incdir -I$kde_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT" @@ -21309,8 +27037,8 @@ if test "$test_kde4" = "yes" -a "$ENABLE_KDE4" = "TRUE" ; then kde_test_include="ksharedptr.h" kde_test_library="libkdeui.so" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Qt4 headers" >&5 -$as_echo_n "checking for Qt4 headers... " >&6; } + echo "$as_me:$LINENO: checking for Qt4 headers" >&5 +echo $ECHO_N "checking for Qt4 headers... $ECHO_C" >&6 qt_header_dir="no" for inc_dir in $qt_incdirs ; do if test -r "$inc_dir/$qt_test_include" ; then @@ -21319,14 +27047,16 @@ $as_echo_n "checking for Qt4 headers... " >&6; } fi done - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $qt_header_dir" >&5 -$as_echo "$qt_header_dir" >&6; } + echo "$as_me:$LINENO: result: $qt_header_dir" >&5 +echo "${ECHO_T}$qt_header_dir" >&6 if test "x$qt_header_dir" = "xno" ; then - as_fn_error "Qt4 headers not found. Please specify the root of your Qt4 installation by exporting QT4DIR before running \"configure\"." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Qt4 headers not found. Please specify the root of your Qt4 installation by exporting QT4DIR before running \"configure\"." >&5 +echo "$as_me: error: Qt4 headers not found. Please specify the root of your Qt4 installation by exporting QT4DIR before running \"configure\"." >&2;} + { (exit 1); exit 1; }; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Qt4 libraries" >&5 -$as_echo_n "checking for Qt4 libraries... " >&6; } + echo "$as_me:$LINENO: checking for Qt4 libraries" >&5 +echo $ECHO_N "checking for Qt4 libraries... $ECHO_C" >&6 qt_lib_dir="no" for lib_dir in $qt_libdirs ; do if test -r "$lib_dir/$qt_test_library" ; then @@ -21335,19 +27065,21 @@ $as_echo_n "checking for Qt4 libraries... " >&6; } fi done - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $qt_lib_dir" >&5 -$as_echo "$qt_lib_dir" >&6; } + echo "$as_me:$LINENO: result: $qt_lib_dir" >&5 +echo "${ECHO_T}$qt_lib_dir" >&6 if test "x$qt_lib_dir" = "xno" ; then - as_fn_error "Qt4 libraries not found. Please specify the root of your Qt4 installation by exporting QT4DIR before running \"configure\"." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Qt4 libraries not found. Please specify the root of your Qt4 installation by exporting QT4DIR before running \"configure\"." >&5 +echo "$as_me: error: Qt4 libraries not found. Please specify the root of your Qt4 installation by exporting QT4DIR before running \"configure\"." >&2;} + { (exit 1); exit 1; }; } fi # Extract the first word of "moc", so it can be a program name with args. set dummy moc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_MOC4+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_MOC4+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MOC4 in [\\/]* | ?:[\\/]*) @@ -21360,37 +27092,39 @@ for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_MOC4="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done test -z "$ac_cv_path_MOC4" && ac_cv_path_MOC4="no" ;; esac fi MOC4=$ac_cv_path_MOC4 + if test -n "$MOC4"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOC4" >&5 -$as_echo "$MOC4" >&6; } + echo "$as_me:$LINENO: result: $MOC4" >&5 +echo "${ECHO_T}$MOC4" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test "$MOC4" = "no" ; then - as_fn_error "Qt Meta Object Compiler not found. Please specify -the root of your Qt installation by exporting QT4DIR before running \"configure\"." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Qt Meta Object Compiler not found. Please specify +the root of your Qt installation by exporting QT4DIR before running \"configure\"." >&5 +echo "$as_me: error: Qt Meta Object Compiler not found. Please specify +the root of your Qt installation by exporting QT4DIR before running \"configure\"." >&2;} + { (exit 1); exit 1; }; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for KDE4 headers" >&5 -$as_echo_n "checking for KDE4 headers... " >&6; } + echo "$as_me:$LINENO: checking for KDE4 headers" >&5 +echo $ECHO_N "checking for KDE4 headers... $ECHO_C" >&6 kde_incdir="no" for kde_check in $kde_incdirs ; do if test -r "$kde_check/$kde_test_include" ; then @@ -21398,14 +27132,16 @@ $as_echo_n "checking for KDE4 headers... " >&6; } break fi done - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $kde_incdir" >&5 -$as_echo "$kde_incdir" >&6; } + echo "$as_me:$LINENO: result: $kde_incdir" >&5 +echo "${ECHO_T}$kde_incdir" >&6 if test "x$kde_incdir" = "xno" ; then - as_fn_error "KDE4 headers not found. Please specify the root of your KDE4 installation by exporting KDE4DIR before running \"configure\"." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: KDE4 headers not found. Please specify the root of your KDE4 installation by exporting KDE4DIR before running \"configure\"." >&5 +echo "$as_me: error: KDE4 headers not found. Please specify the root of your KDE4 installation by exporting KDE4DIR before running \"configure\"." >&2;} + { (exit 1); exit 1; }; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for KDE4 libraries" >&5 -$as_echo_n "checking for KDE4 libraries... " >&6; } + echo "$as_me:$LINENO: checking for KDE4 libraries" >&5 +echo $ECHO_N "checking for KDE4 libraries... $ECHO_C" >&6 kde_libdir="no" for kde_check in $kde_libdirs ; do if test -r "$kde_check/$kde_test_library" ; then @@ -21414,10 +27150,12 @@ $as_echo_n "checking for KDE4 libraries... " >&6; } fi done - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $kde_libdir" >&5 -$as_echo "$kde_libdir" >&6; } + echo "$as_me:$LINENO: result: $kde_libdir" >&5 +echo "${ECHO_T}$kde_libdir" >&6 if test "x$kde_libdir" = "xno" ; then - as_fn_error "KDE4 libraries not found. Please specify the root of your KDE4 installation by exporting KDE4DIR before running \"configure\"." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: KDE4 libraries not found. Please specify the root of your KDE4 installation by exporting KDE4DIR before running \"configure\"." >&5 +echo "$as_me: error: KDE4 libraries not found. Please specify the root of your KDE4 installation by exporting KDE4DIR before running \"configure\"." >&2;} + { (exit 1); exit 1; }; } fi KDE4_CFLAGS="`pkg-config --cflags QtCore` `pkg-config --cflags QtGui` -I$kde_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT" @@ -21427,34 +27165,34 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable the lockdown pieces" >&5 -$as_echo_n "checking whether to enable the lockdown pieces... " >&6; } +echo "$as_me:$LINENO: checking whether to enable the lockdown pieces" >&5 +echo $ECHO_N "checking whether to enable the lockdown pieces... $ECHO_C" >&6 ENABLE_LOCKDOWN="" if test -n "$enable_lockdown" && test "$enable_lockdown" != "no"; then ENABLE_LOCKDOWN=YES - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable evolution 2 support" >&5 -$as_echo_n "checking whether to enable evolution 2 support... " >&6; } +echo "$as_me:$LINENO: checking whether to enable evolution 2 support" >&5 +echo $ECHO_N "checking whether to enable evolution 2 support... $ECHO_C" >&6 if test "$enable_evolution2" = "yes" -o "$enable_evolution2" = "TRUE"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 succeeded=no if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_PKG_CONFIG+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) @@ -21466,30 +27204,29 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG + if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } + echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test "$PKG_CONFIG" = "no" ; then @@ -21500,25 +27237,25 @@ fi else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gobject-2.0" >&5 -$as_echo_n "checking for gobject-2.0... " >&6; } + echo "$as_me:$LINENO: checking for gobject-2.0" >&5 +echo $ECHO_N "checking for gobject-2.0... $ECHO_C" >&6 if $PKG_CONFIG --exists "gobject-2.0" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 succeeded=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: checking GOBJECT_CFLAGS" >&5 -$as_echo_n "checking GOBJECT_CFLAGS... " >&6; } + echo "$as_me:$LINENO: checking GOBJECT_CFLAGS" >&5 +echo $ECHO_N "checking GOBJECT_CFLAGS... $ECHO_C" >&6 GOBJECT_CFLAGS=`$PKG_CONFIG --cflags "gobject-2.0"` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GOBJECT_CFLAGS" >&5 -$as_echo "$GOBJECT_CFLAGS" >&6; } + echo "$as_me:$LINENO: result: $GOBJECT_CFLAGS" >&5 +echo "${ECHO_T}$GOBJECT_CFLAGS" >&6 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking GOBJECT_LIBS" >&5 -$as_echo_n "checking GOBJECT_LIBS... " >&6; } + echo "$as_me:$LINENO: checking GOBJECT_LIBS" >&5 +echo $ECHO_N "checking GOBJECT_LIBS... $ECHO_C" >&6 GOBJECT_LIBS=`$PKG_CONFIG --libs "gobject-2.0"` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GOBJECT_LIBS" >&5 -$as_echo "$GOBJECT_LIBS" >&6; } + echo "$as_me:$LINENO: result: $GOBJECT_LIBS" >&5 +echo "${ECHO_T}$GOBJECT_LIBS" >&6 else GOBJECT_CFLAGS="" GOBJECT_LIBS="" @@ -21539,25 +27276,27 @@ $as_echo "$GOBJECT_LIBS" >&6; } if test $succeeded = yes; then : else - as_fn_error "Library requirements (gobject-2.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Library requirements (gobject-2.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&5 +echo "$as_me: error: Library requirements (gobject-2.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." >&2;} + { (exit 1); exit 1; }; } fi ENABLE_EVOAB2="TRUE" else ENABLE_EVOAB2="" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable KDE address book support" >&5 -$as_echo_n "checking whether to enable KDE address book support... " >&6; } +echo "$as_me:$LINENO: checking whether to enable KDE address book support" >&5 +echo $ECHO_N "checking whether to enable KDE address book support... $ECHO_C" >&6 if test "$enable_kdeab" = "yes" && test "$enable_kde" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - ac_ext=cpp + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -21565,15 +27304,20 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu save_CXXFLAGS=$CXXFLAGS CXXFLAGS="$CXXFLAGS $KDE_CFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether KDE is between 3.2 and 3.6" >&5 -$as_echo_n "checking whether KDE is between 3.2 and 3.6... " >&6; } - if test "$cross_compiling" = yes; then : - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot run test program while cross compiling -See \`config.log' for more details." "$LINENO" 5; } -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + echo "$as_me:$LINENO: checking whether KDE is between 3.2 and 3.6" >&5 +echo $ECHO_N "checking whether KDE is between 3.2 and 3.6... $ECHO_C" >&6 + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include @@ -21584,16 +27328,31 @@ int main(int argc, char **argv) { } _ACEOF -if ac_fn_cxx_try_run "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else - as_fn_error "KDE version too old or too recent, please use another version of KDE or disable KDE address book support" "$LINENO" 5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +{ { echo "$as_me:$LINENO: error: KDE version too old or too recent, please use another version of KDE or disable KDE address book support" >&5 +echo "$as_me: error: KDE version too old or too recent, please use another version of KDE or disable KDE address book support" >&2;} + { (exit 1); exit 1; }; } fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - CXXFLAGS=$save_CXXFLAGS ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -21603,66 +27362,66 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu ENABLE_KAB=TRUE else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 ENABLE_KAB= fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include MathMLDTD" >&5 -$as_echo_n "checking whether to include MathMLDTD... " >&6; } +echo "$as_me:$LINENO: checking whether to include MathMLDTD" >&5 +echo $ECHO_N "checking whether to include MathMLDTD... $ECHO_C" >&6 if test -n "$enable_mathmldtd"; then if test "$enable_mathmldtd" = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 SCPDEFS="$SCPDEFS -DWITHOUT_MATHMLDTD" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 BUILD_TYPE="$BUILD_TYPE MATHMLDTD" fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 SCPDEFS="$SCPDEFS -DWITHOUT_MATHMLDTD" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include Bitstream Vera fonts" >&5 -$as_echo_n "checking whether to include Bitstream Vera fonts... " >&6; } +echo "$as_me:$LINENO: checking whether to include Bitstream Vera fonts" >&5 +echo $ECHO_N "checking whether to include Bitstream Vera fonts... $ECHO_C" >&6 if test "$with_fonts" != "no" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 WITH_FONTS=YES BUILD_TYPE="$BUILD_TYPE BITSTREAM_VERA_FONTS" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 WITH_FONTS=NO SCPDEFS="$SCPDEFS -DWITHOUT_FONTS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include PPDs" >&5 -$as_echo_n "checking whether to include PPDs... " >&6; } +echo "$as_me:$LINENO: checking whether to include PPDs" >&5 +echo $ECHO_N "checking whether to include PPDs... $ECHO_C" >&6 if test "$with_ppds" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 WITHOUT_PPDS=YES SCPDEFS="$SCPDEFS -DWITHOUT_PPDS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include AFMs" >&5 -$as_echo_n "checking whether to include AFMs... " >&6; } +echo "$as_me:$LINENO: checking whether to include AFMs" >&5 +echo $ECHO_N "checking whether to include AFMs... $ECHO_C" >&6 if test "$with_afms" != "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 WITHOUT_AFMS=YES SCPDEFS="$SCPDEFS -DWITHOUT_AFMS" fi @@ -21670,13 +27429,13 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether and how to use Xinerama" >&5 -$as_echo_n "checking whether and how to use Xinerama... " >&6; } +echo "$as_me:$LINENO: checking whether and how to use Xinerama" >&5 +echo $ECHO_N "checking whether and how to use Xinerama... $ECHO_C" >&6 if test "$_os" = "Darwin"; then USE_XINERAMA=YES XINERAMA_LINK=dynamic - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 elif test "$_os" = "Linux" -o "$_os" = "FreeBSD"; then if test -e "$XLIB/libXinerama.so" -a -e "$XLIB/libXinerama.a"; then # we have both versions, let the user decide but use the dynamic one @@ -21706,13 +27465,151 @@ elif test "$_os" = "Linux" -o "$_os" = "FreeBSD"; then XINERAMA_LINK=none fi if test "$USE_XINERAMA" = "YES"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, with $XINERAMA_LINK linking" >&5 -$as_echo "yes, with $XINERAMA_LINK linking" >&6; } - ac_fn_c_check_header_mongrel "$LINENO" "X11/extensions/Xinerama.h" "ac_cv_header_X11_extensions_Xinerama_h" "$ac_includes_default" -if test "x$ac_cv_header_X11_extensions_Xinerama_h" = x""yes; then : + echo "$as_me:$LINENO: result: yes, with $XINERAMA_LINK linking" >&5 +echo "${ECHO_T}yes, with $XINERAMA_LINK linking" >&6 + if test "${ac_cv_header_X11_extensions_Xinerama_h+set}" = set; then + echo "$as_me:$LINENO: checking for X11/extensions/Xinerama.h" >&5 +echo $ECHO_N "checking for X11/extensions/Xinerama.h... $ECHO_C" >&6 +if test "${ac_cv_header_X11_extensions_Xinerama_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_Xinerama_h" >&5 +echo "${ECHO_T}$ac_cv_header_X11_extensions_Xinerama_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking X11/extensions/Xinerama.h usability" >&5 +echo $ECHO_N "checking X11/extensions/Xinerama.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking X11/extensions/Xinerama.h presence" >&5 +echo $ECHO_N "checking X11/extensions/Xinerama.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: X11/extensions/Xinerama.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: X11/extensions/Xinerama.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: X11/extensions/Xinerama.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: X11/extensions/Xinerama.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: X11/extensions/Xinerama.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: X11/extensions/Xinerama.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: X11/extensions/Xinerama.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: X11/extensions/Xinerama.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: X11/extensions/Xinerama.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: X11/extensions/Xinerama.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: X11/extensions/Xinerama.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: X11/extensions/Xinerama.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: X11/extensions/Xinerama.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: X11/extensions/Xinerama.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: X11/extensions/Xinerama.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: X11/extensions/Xinerama.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for X11/extensions/Xinerama.h" >&5 +echo $ECHO_N "checking for X11/extensions/Xinerama.h... $ECHO_C" >&6 +if test "${ac_cv_header_X11_extensions_Xinerama_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_X11_extensions_Xinerama_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_Xinerama_h" >&5 +echo "${ECHO_T}$ac_cv_header_X11_extensions_Xinerama_h" >&6 +fi +if test $ac_cv_header_X11_extensions_Xinerama_h = yes; then + : else - as_fn_error "Xinerama header not found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Xinerama header not found." >&5 +echo "$as_me: error: Xinerama header not found." >&2;} + { (exit 1); exit 1; }; } fi @@ -21723,43 +27620,72 @@ fi if test "$_os" = "Linux"; then XINERAMA_EXTRA_LIBS="$XINERAMA_EXTRA_LIBS -ldl" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XineramaIsActive in -lXinerama" >&5 -$as_echo_n "checking for XineramaIsActive in -lXinerama... " >&6; } -if test "${ac_cv_lib_Xinerama_XineramaIsActive+set}" = set; then : - $as_echo_n "(cached) " >&6 + +echo "$as_me:$LINENO: checking for XineramaIsActive in -lXinerama" >&5 +echo $ECHO_N "checking for XineramaIsActive in -lXinerama... $ECHO_C" >&6 +if test "${ac_cv_lib_Xinerama_XineramaIsActive+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXinerama $XINERAMA_EXTRA_LIBS $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char XineramaIsActive (); int main () { -return XineramaIsActive (); +XineramaIsActive (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_Xinerama_XineramaIsActive=yes else - ac_cv_lib_Xinerama_XineramaIsActive=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_Xinerama_XineramaIsActive=no fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xinerama_XineramaIsActive" >&5 -$as_echo "$ac_cv_lib_Xinerama_XineramaIsActive" >&6; } -if test "x$ac_cv_lib_Xinerama_XineramaIsActive" = x""yes; then : +echo "$as_me:$LINENO: result: $ac_cv_lib_Xinerama_XineramaIsActive" >&5 +echo "${ECHO_T}$ac_cv_lib_Xinerama_XineramaIsActive" >&6 +if test $ac_cv_lib_Xinerama_XineramaIsActive = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBXINERAMA 1 _ACEOF @@ -21767,16 +27693,18 @@ _ACEOF LIBS="-lXinerama $LIBS" else - as_fn_error "Xinerama not functional?" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Xinerama not functional?" >&5 +echo "$as_me: error: Xinerama not functional?" >&2;} + { (exit 1); exit 1; }; } fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, libXinerama not found or wrong architecture." >&5 -$as_echo "no, libXinerama not found or wrong architecture." >&6; } + echo "$as_me:$LINENO: result: no, libXinerama not found or wrong architecture." >&5 +echo "${ECHO_T}no, libXinerama not found or wrong architecture." >&6 fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi @@ -21790,10 +27718,10 @@ if test -z "$with_ant_home"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_ANT+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_ANT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ANT in [\\/]* | ?:[\\/]*) @@ -21805,29 +27733,28 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ANT="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done ;; esac fi ANT=$ac_cv_path_ANT + if test -n "$ANT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ANT" >&5 -$as_echo "$ANT" >&6; } + echo "$as_me:$LINENO: result: $ANT" >&5 +echo "${ECHO_T}$ANT" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - test -n "$ANT" && break done @@ -21839,10 +27766,10 @@ else do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_ANT+set}" = set; then : - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_ANT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ANT in [\\/]* | ?:[\\/]*) @@ -21855,29 +27782,28 @@ for as_dir in $as_dummy do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ANT="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done - done -IFS=$as_save_IFS +done ;; esac fi ANT=$ac_cv_path_ANT + if test -n "$ANT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ANT" >&5 -$as_echo "$ANT" >&6; } + echo "$as_me:$LINENO: result: $ANT" >&5 +echo "${ECHO_T}$ANT" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - test -n "$ANT" && break done @@ -21886,7 +27812,9 @@ done fi if test -z "$ANT"; then - as_fn_error "Ant not found - Make sure it's in the path or use --with-ant-home" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Ant not found - Make sure it's in the path or use --with-ant-home" >&5 +echo "$as_me: error: Ant not found - Make sure it's in the path or use --with-ant-home" >&2;} + { (exit 1); exit 1; }; } else # resolve relative or absolute symlink while test -h "$ANT"; do @@ -21911,8 +27839,8 @@ else fi ant_minminor1=`echo $ant_minver | cut -d"." -f2` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ant is >= $ant_minver" >&5 -$as_echo_n "checking whether ant is >= $ant_minver... " >&6; } + echo "$as_me:$LINENO: checking whether ant is >= $ant_minver" >&5 +echo $ECHO_N "checking whether ant is >= $ant_minver... $ECHO_C" >&6 ant_version=`$ANT -version | $AWK '{ print $4; }'` ant_version_major=`echo $ant_version | cut -d. -f1` ant_version_minor=`echo $ant_version | cut -d. -f2` @@ -21920,16 +27848,18 @@ echo "configure: ant_version $ant_version " >&5 echo "configure: ant_version_major $ant_version_major " >&5 echo "configure: ant_version_minor $ant_version_minor " >&5 if test "$ant_version_major" -ge "2"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, $ant_version" >&5 -$as_echo "yes, $ant_version" >&6; } + echo "$as_me:$LINENO: result: yes, $ant_version" >&5 +echo "${ECHO_T}yes, $ant_version" >&6 elif test "$ant_version_major" = "1" && test "$ant_version_minor" -ge "$ant_minminor1"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, $ant_version" >&5 -$as_echo "yes, $ant_version" >&6; } + echo "$as_me:$LINENO: result: yes, $ant_version" >&5 +echo "${ECHO_T}yes, $ant_version" >&6 else - as_fn_error "no, you need at least ant >= $ant_minver" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: no, you need at least ant >= $ant_minver" >&5 +echo "$as_me: error: no, you need at least ant >= $ant_minver" >&2;} + { (exit 1); exit 1; }; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $ANT works" >&5 -$as_echo_n "checking if $ANT works... " >&6; } + echo "$as_me:$LINENO: checking if $ANT works" >&5 +echo $ECHO_N "checking if $ANT works... $ECHO_C" >&6 cat > conftest.java << EOF public class conftest { int testmethod(int a, int b) { @@ -21953,14 +27883,14 @@ EOF else ant_cmd="$ANT -buildfile conftest.xml 1>&2" fi - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ant_cmd\""; } >&5 + { (eval echo "$as_me:$LINENO: \"$ant_cmd\"") >&5 (eval $ant_cmd) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } if test $? = 0 && test -f ./conftest.class ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Ant works" >&5 -$as_echo "Ant works" >&6; } + echo "$as_me:$LINENO: result: Ant works" >&5 +echo "${ECHO_T}Ant works" >&6 if test -z "$WITH_ANT_HOME"; then ANT_HOME=`$ANT -diagnostics | $EGREP "ant.home :" | $SED -e "s#ant.home : ##g"` if test -z "$ANT_HOME"; then @@ -21973,8 +27903,8 @@ $as_echo "Ant works" >&6; } echo "configure: Ant test failed" >&5 cat conftest.java >&5 cat conftest.xml >&5 - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ant does not work - Some Java projects will not build!" >&5 -$as_echo "$as_me: WARNING: Ant does not work - Some Java projects will not build!" >&2;} + { echo "$as_me:$LINENO: WARNING: Ant does not work - Some Java projects will not build!" >&5 +echo "$as_me: WARNING: Ant does not work - Some Java projects will not build!" >&2;} ANT_HOME="" echo "Ant does not work - Some Java projects will not build!" >>warn fi @@ -21987,8 +27917,8 @@ fi if test "$ANT_HOME" != "NO_ANT_HOME"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Ant lib directory" >&5 -$as_echo_n "checking Ant lib directory... " >&6; } + echo "$as_me:$LINENO: checking Ant lib directory" >&5 +echo $ECHO_N "checking Ant lib directory... $ECHO_C" >&6 if test -f $ANT_HOME/lib/ant.jar; then ANT_LIB="$ANT_HOME/lib" else @@ -22004,21 +27934,23 @@ $as_echo_n "checking Ant lib directory... " >&6; } if test -f $ANT_HOME/lib/ant/ant.jar; then ANT_LIB="$ANT_HOME/lib/ant" else - as_fn_error "Ant libraries not found!" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: Ant libraries not found!" >&5 +echo "$as_me: error: Ant libraries not found!" >&2;} + { (exit 1); exit 1; }; } fi fi fi fi fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Ant lib directory found." >&5 -$as_echo "Ant lib directory found." >&6; } + echo "$as_me:$LINENO: result: Ant lib directory found." >&5 +echo "${ECHO_T}Ant lib directory found." >&6 fi fi if test "$ENABLE_MEDIAWIKI" = "YES"; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ant supports mapper type=\"regexp\"" >&5 -$as_echo_n "checking whether ant supports mapper type=\"regexp\"... " >&6; } +echo "$as_me:$LINENO: checking whether ant supports mapper type=\"regexp\"" >&5 +echo $ECHO_N "checking whether ant supports mapper type=\"regexp\"... $ECHO_C" >&6 rm -rf confdir mkdir confdir cat > conftest.java << EOF @@ -22050,179 +27982,181 @@ EOF else ant_cmd="$ANT -buildfile conftest.xml 1>&2" fi - { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ant_cmd\""; } >&5 + { (eval echo "$as_me:$LINENO: \"$ant_cmd\"") >&5 (eval $ant_cmd) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } if test $? = 0 && test -f ./conftest.class ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 rm -rf confdir else echo "configure: Ant test failed" >&5 cat conftest.java >&5 cat conftest.xml >&5 rm -rf confdir - as_fn_error "no. Did you install ant-apache-regexp?" "$LINENO" 5 + { { echo "$as_me:$LINENO: error: no. Did you install ant-apache-regexp?" >&5 +echo "$as_me: error: no. Did you install ant-apache-regexp?" >&2;} + { (exit 1); exit 1; }; } fi fi rm -f conftest* core core.* *.core -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which languages to be built" >&5 -$as_echo_n "checking which languages to be built... " >&6; } +echo "$as_me:$LINENO: checking which languages to be built" >&5 +echo $ECHO_N "checking which languages to be built... $ECHO_C" >&6 WITH_LANG="$with_lang" if test -z "$WITH_LANG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: en-US" >&5 -$as_echo "en-US" >&6; } + echo "$as_me:$LINENO: result: en-US" >&5 +echo "${ECHO_T}en-US" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WITH_LANG" >&5 -$as_echo "$WITH_LANG" >&6; } + echo "$as_me:$LINENO: result: $WITH_LANG" >&5 +echo "${ECHO_T}$WITH_LANG" >&6 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which languages have poor help localizations" >&5 -$as_echo_n "checking which languages have poor help localizations... " >&6; } +echo "$as_me:$LINENO: checking which languages have poor help localizations" >&5 +echo $ECHO_N "checking which languages have poor help localizations... $ECHO_C" >&6 WITH_POOR_HELP_LOCALIZATIONS="$with_poor_help_localizations" if test -z "$WITH_POOR_HELP_LOCALIZATIONS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 -$as_echo "none" >&6; } + echo "$as_me:$LINENO: result: none" >&5 +echo "${ECHO_T}none" >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $WITH_POOR_HELP_LOCALIZATIONS" >&5 -$as_echo "$WITH_POOR_HELP_LOCALIZATIONS" >&6; } + echo "$as_me:$LINENO: result: $WITH_POOR_HELP_LOCALIZATIONS" >&5 +echo "${ECHO_T}$WITH_POOR_HELP_LOCALIZATIONS" >&6 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which dictionaries to include" >&5 -$as_echo_n "checking which dictionaries to include... " >&6; } +echo "$as_me:$LINENO: checking which dictionaries to include" >&5 +echo $ECHO_N "checking which dictionaries to include... $ECHO_C" >&6 if test -z "$with_dict"; then WITH_DICT=,ALL, - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ALL" >&5 -$as_echo "ALL" >&6; } + echo "$as_me:$LINENO: result: ALL" >&5 +echo "${ECHO_T}ALL" >&6 else WITH_DICT=","$with_dict"," - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_dict" >&5 -$as_echo "$with_dict" >&6; } + echo "$as_me:$LINENO: result: $with_dict" >&5 +echo "${ECHO_T}$with_dict" >&6 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for additional 'intro' bitmaps" >&5 -$as_echo_n "checking for additional 'intro' bitmaps... " >&6; } +echo "$as_me:$LINENO: checking for additional 'intro' bitmaps" >&5 +echo $ECHO_N "checking for additional 'intro' bitmaps... $ECHO_C" >&6 INTRO_BITMAPS= if test -z "$with_intro_bitmaps" -o "$with_intro_bitmaps" = "no" ; then INTRO_BITMAPS= - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 -$as_echo "none" >&6; } + echo "$as_me:$LINENO: result: none" >&5 +echo "${ECHO_T}none" >&6 else for bitmap in `echo $with_intro_bitmaps | tr ',' ' '` ; do case "$bitmap" in *.bmp) ;; - *) bitmap= ; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Intro bitmaps should be .bmp files!" >&5 -$as_echo "$as_me: WARNING: Intro bitmaps should be .bmp files!" >&2;} ;; + *) bitmap= ; { echo "$as_me:$LINENO: WARNING: Intro bitmaps should be .bmp files!" >&5 +echo "$as_me: WARNING: Intro bitmaps should be .bmp files!" >&2;} ;; esac if test -n "$bitmap" ; then INTRO_BITMAPS="$INTRO_BITMAPS $bitmap" fi done - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INTRO_BITMAPS" >&5 -$as_echo "$INTRO_BITMAPS" >&6; } + echo "$as_me:$LINENO: result: $INTRO_BITMAPS" >&5 +echo "${ECHO_T}$INTRO_BITMAPS" >&6 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for additional 'about' bitmaps" >&5 -$as_echo_n "checking for additional 'about' bitmaps... " >&6; } +echo "$as_me:$LINENO: checking for additional 'about' bitmaps" >&5 +echo $ECHO_N "checking for additional 'about' bitmaps... $ECHO_C" >&6 ABOUT_BITMAPS= if test -z "$with_about_bitmaps" -o "$with_about_bitmaps" = "no" ; then ABOUT_BITMAPS= - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 -$as_echo "none" >&6; } + echo "$as_me:$LINENO: result: none" >&5 +echo "${ECHO_T}none" >&6 else for bitmap in `echo $with_about_bitmaps | tr ',' ' '` ; do case "$bitmap" in *.bmp) ;; - *) bitmap= ; { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: About bitmaps should be .bmp files!" >&5 -$as_echo "$as_me: WARNING: About bitmaps should be .bmp files!" >&2;} ;; + *) bitmap= ; { echo "$as_me:$LINENO: WARNING: About bitmaps should be .bmp files!" >&5 +echo "$as_me: WARNING: About bitmaps should be .bmp files!" >&2;} ;; esac if test -n "$bitmap" ; then ABOUT_BITMAPS="$ABOUT_BITMAPS $bitmap" fi done - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ABOUT_BITMAPS" >&5 -$as_echo "$ABOUT_BITMAPS" >&6; } + echo "$as_me:$LINENO: result: $ABOUT_BITMAPS" >&5 +echo "${ECHO_T}$ABOUT_BITMAPS" >&6 fi OOO_VENDOR= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for vendor" >&5 -$as_echo_n "checking for vendor... " >&6; } +echo "$as_me:$LINENO: checking for vendor" >&5 +echo $ECHO_N "checking for vendor... $ECHO_C" >&6 if test -z "$with_vendor" -o "$with_vendor" = "no" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not set" >&5 -$as_echo "not set" >&6; } + echo "$as_me:$LINENO: result: not set" >&5 +echo "${ECHO_T}not set" >&6 else OOO_VENDOR="$with_vendor" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OOO_VENDOR" >&5 -$as_echo "$OOO_VENDOR" >&6; } + echo "$as_me:$LINENO: result: $OOO_VENDOR" >&5 +echo "${ECHO_T}$OOO_VENDOR" >&6 fi UNIXWRAPPERNAME= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for UNIX wrapper name" >&5 -$as_echo_n "checking for UNIX wrapper name... " >&6; } +echo "$as_me:$LINENO: checking for UNIX wrapper name" >&5 +echo $ECHO_N "checking for UNIX wrapper name... $ECHO_C" >&6 if test -z "$with_unix_wrapper" -o "$with_unix_wrapper" = "no" -o "$with_unix_wrapper" = "yes" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not set" >&5 -$as_echo "not set" >&6; } + echo "$as_me:$LINENO: result: not set" >&5 +echo "${ECHO_T}not set" >&6 else UNIXWRAPPERNAME="$with_unix_wrapper" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $UNIXWRAPPERNAME" >&5 -$as_echo "$UNIXWRAPPERNAME" >&6; } + echo "$as_me:$LINENO: result: $UNIXWRAPPERNAME" >&5 +echo "${ECHO_T}$UNIXWRAPPERNAME" >&6 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to statically link to Gtk" >&5 -$as_echo_n "checking whether to statically link to Gtk... " >&6; } +echo "$as_me:$LINENO: checking whether to statically link to Gtk" >&5 +echo $ECHO_N "checking whether to statically link to Gtk... $ECHO_C" >&6 if test -n "$enable_static_gtk" && test "$enable_static_gtk" != "no"; then ENABLE_STATIC_GTK="TRUE" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else ENABLE_STATIC_GTK="FALSE" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use layout dialogs" >&5 -$as_echo_n "checking whether to use layout dialogs... " >&6; } +echo "$as_me:$LINENO: checking whether to use layout dialogs" >&5 +echo $ECHO_N "checking whether to use layout dialogs... $ECHO_C" >&6 if test -n "$enable_layout" && test "$enable_layout" != "no"; then ENABLE_LAYOUT="TRUE" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else ENABLE_LAYOUT="FALSE" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi # =================================================================== # De- or increase default verbosity of build process # =================================================================== -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build verbosity" >&5 -$as_echo_n "checking build verbosity... " >&6; } +echo "$as_me:$LINENO: checking build verbosity" >&5 +echo $ECHO_N "checking build verbosity... $ECHO_C" >&6 if test -n "$enable_verbose"; then if test "$enable_verbose" == "yes"; then VERBOSE="TRUE" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: high" >&5 -$as_echo "high" >&6; } + echo "$as_me:$LINENO: result: high" >&5 +echo "${ECHO_T}high" >&6 fi if test "$enable_verbose" == "no"; then VERBOSE="FALSE" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: low" >&5 -$as_echo "low" >&6; } + echo "$as_me:$LINENO: result: low" >&5 +echo "${ECHO_T}low" >&6 fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: not set" >&5 -$as_echo "not set" >&6; } + echo "$as_me:$LINENO: result: not set" >&5 +echo "${ECHO_T}not set" >&6 fi @@ -22233,20 +28167,22 @@ echo "* *" echo "********************************************************************" if test -z "$COMPATH"; then - as_fn_error "No compiler found." "$LINENO" 5 + { { echo "$as_me:$LINENO: error: No compiler found." >&5 +echo "$as_me: error: No compiler found." >&2;} + { (exit 1); exit 1; }; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking solver path" >&5 -$as_echo_n "checking solver path... " >&6; } +echo "$as_me:$LINENO: checking solver path" >&5 +echo $ECHO_N "checking solver path... $ECHO_C" >&6 if test -z "$with_local_solver"; then LOCAL_SOLVER="DEFAULT" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: default" >&5 -$as_echo "default" >&6; } + echo "$as_me:$LINENO: result: default" >&5 +echo "${ECHO_T}default" >&6 else LOCAL_SOLVER=$with_local_solver - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_local_solver" >&5 -$as_echo "$with_local_solver" >&6; } + echo "$as_me:$LINENO: result: $with_local_solver" >&5 +echo "${ECHO_T}$with_local_solver" >&6 fi @@ -22255,8 +28191,7 @@ fi # make sure config.guess is +x; we execute config.guess, so it has to be so; chmod +x ./config.guess -ac_config_files="$ac_config_files set_soenv Makefile" - + ac_config_files="$ac_config_files set_soenv Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure @@ -22275,59 +28210,39 @@ _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. +# So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - +{ (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \. + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( + ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; - esac | - sort -) | + esac; +} | sed ' - /^ac_cv_env_/b end t clear - :clear + : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - test "x$cache_file" != "x/dev/null" && - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + echo "not updating unwritable cache $cache_file" fi fi rm -f confcache @@ -22336,54 +28251,63 @@ test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that -# take arguments), then branch to the quote section. Otherwise, +# take arguments), then we branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. -ac_script=' -:mline -/\\$/{ - N - s,\\\n,, - b mline -} +cat >confdef2opt.sed <<\_ACEOF t clear -:clear -s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g t quote -s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g t quote -b any -:quote -s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g -s/\[/\\&/g -s/\]/\\&/g -s/\$/$$/g -H -:any -${ - g - s/^\n// - s/\n/ /g - p -} -' -DEFS=`sed -n "$ac_script" confdefs.h` +d +: quote +s,[ `~#$^&*(){}\\|;'"<>?],\\&,g +s,\[,\\&,g +s,\],\\&,g +s,\$,$$,g +p +_ACEOF +# We use echo to avoid assuming a particular line-breaking character. +# The extra dot is to prevent the shell from consuming trailing +# line-breaks from the sub-command output. A line-break within +# single-quotes doesn't work because, if this script is created in a +# platform that uses two characters for line-breaks (e.g., DOS), tr +# would break. +ac_LF_and_DOT=`echo; echo .` +DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` +rm -f confdef2opt.sed ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" - as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' + ac_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs @@ -22391,15 +28315,12 @@ LTLIBOBJS=$ac_ltlibobjs - : ${CONFIG_STATUS=./config.status} -ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -as_write_fail=0 -cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. @@ -22409,252 +28330,81 @@ cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 debug=false ac_cs_recheck=false ac_cs_silent=false - SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix fi +DUALCASE=1; export DUALCASE # for MKS sh -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - - -# as_fn_error ERROR [LINENO LOG_FD] -# --------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with status $?, using 1 if that was 0. -as_fn_error () -{ - as_status=$?; test $as_status -eq 0 && as_status=1 - if test "$3"; then - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var fi - $as_echo "$as_me: error: $1" >&2 - as_fn_exit $as_status -} # as_fn_error - - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - +done -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi -as_me=`$as_basename -- "$0" || +# Name of the executable. +as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + +# PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' @@ -22662,123 +28412,148 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null + as_expr=false fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links as_ln_s='cp -p' + else + as_ln_s='ln -s' fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" - +rm -f conf$$ conf$$.exe conf$$.file -} # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' + as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x +as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -22787,20 +28562,31 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + exec 6>&1 -## ----------------------------------- ## -## Main body of $CONFIG_STATUS script. ## -## ----------------------------------- ## -_ASEOF -test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# Save the log message, to keep $0 and so on meaningful, and to + +# Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF + This file was extended by $as_me, which was -generated by GNU Autoconf 2.65. Invocation command line was +generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -22808,111 +28594,124 @@ generated by GNU Autoconf 2.65. Invocation command line was CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 _ACEOF -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# Files that config.status was made for. -config_files="$ac_config_files" +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi -_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions -from templates according to the current configuration. Unless the files -and actions are specified as TAGs, all are instantiated by default. +\`$as_me' instantiates files from templates according to the +current configuration. -Usage: $0 [OPTION]... [TAG]... +Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - --config print configuration, then exit - -q, --quiet, --silent - do not print progress messages + -V, --version print version number, then exit + -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE Configuration files: $config_files -Report bugs to the package provider." - +Report bugs to ." _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" + +cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.65, - with options \\"\$ac_cs_config\\" +configured by $0, generated by GNU Autoconf 2.59, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" -Copyright (C) 2009 Free Software Foundation, Inc. +Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -AWK='$AWK' -test -n "\$AWK" || AWK=awk +srcdir=$srcdir _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; - *) + -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_option=$1 + ac_need_defaults=false;; esac case $ac_option in # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; - --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append CONFIG_FILES " '$ac_optarg'" + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; - --he | --h | --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) as_fn_error "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; - *) as_fn_append ac_config_targets " $1" - ac_need_defaults=false ;; + *) ac_config_targets="$ac_config_targets $1" ;; esac shift @@ -22926,45 +28725,31 @@ if $ac_cs_silent; then fi _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' - export CONFIG_SHELL - exec "\$@" + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - $as_echo "$ac_log" -} >&5 -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# Handling of arguments. + + +cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do - case $ac_config_target in - "set_soenv") CONFIG_FILES="$CONFIG_FILES set_soenv" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - - *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + case "$ac_config_target" in + # Handling of arguments. + "set_soenv" ) CONFIG_FILES="$CONFIG_FILES set_soenv" ;; + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; esac done - # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely @@ -22974,403 +28759,668 @@ if $ac_need_defaults; then fi # Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, +# simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. +# Create a temporary directory, and hook for its removal unless debugging. $debug || { - tmp= - trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status -' 0 - trap 'as_fn_exit 1' 1 2 13 15 + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 } + # Create a (secure) tmp directory for tmp files. { - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 - -# Set up the scripts for CONFIG_FILES section. -# No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. -if test -n "$CONFIG_FILES"; then - - -ac_cr=`echo X | tr X '\015'` -# On cygwin, bash can eat \r inside `` if the user requested igncr. -# But we know of no other shell where ac_cr would be empty at this -# point, so we can use a bashism as a fallback. -if test "x$ac_cr" = x; then - eval ac_cr=\$\'\\r\' -fi -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\r' -else - ac_cs_awk_cr=$ac_cr -fi - -echo 'BEGIN {' >"$tmp/subs1.awk" && -_ACEOF - - -{ - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 - - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then - break - elif $ac_last_try; then - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done -rm -f conf$$subs.sh - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$tmp/subs1.awk" <<\\_ACAWK && -_ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\)..*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\)..*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' >$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" - -} + tmp=./confstat$$-$RANDOM + (umask 077 && mkdir $tmp) +} || { - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } - - print line + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } } -_ACAWK _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ - || as_fn_error "could not setup config files machinery" "$LINENO" 5 -_ACEOF - -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/ -s/:*\${srcdir}:*/:/ -s/:*@srcdir@:*/:/ -s/^\([^=]*=[ ]*\):*/\1/ -s/:*$// -s/^[^=]*=[ ]*$// -}' -fi -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -fi # test -n "$CONFIG_FILES" +cat >>$CONFIG_STATUS <<_ACEOF +# +# CONFIG_FILES section. +# -eval set X " :F $CONFIG_FILES " -shift -for ac_tag -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@DEFS@,$DEFS,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@LIBS@,$LIBS,;t t +s,@EGREP@,$EGREP,;t t +s,@AWK@,$AWK,;t t +s,@SED@,$SED,;t t +s,@LOCAL_SOLENV@,$LOCAL_SOLENV,;t t +s,@_solenv@,$_solenv,;t t +s,@UPD@,$UPD,;t t +s,@SOURCEVERSION@,$SOURCEVERSION,;t t +s,@build@,$build,;t t +s,@build_cpu@,$build_cpu,;t t +s,@build_vendor@,$build_vendor,;t t +s,@build_os@,$build_os,;t t +s,@host@,$host,;t t +s,@host_cpu@,$host_cpu,;t t +s,@host_vendor@,$host_vendor,;t t +s,@host_os@,$host_os,;t t +s,@target@,$target,;t t +s,@target_cpu@,$target_cpu,;t t +s,@target_vendor@,$target_vendor,;t t +s,@target_os@,$target_os,;t t +s,@GNUTAR@,$GNUTAR,;t t +s,@OSVERSION@,$OSVERSION,;t t +s,@PTHREAD_CFLAGS@,$PTHREAD_CFLAGS,;t t +s,@PTHREAD_LIBS@,$PTHREAD_LIBS,;t t +s,@ENABLE_CRASHDUMP@,$ENABLE_CRASHDUMP,;t t +s,@VC_STANDARD@,$VC_STANDARD,;t t +s,@ENABLE_WERROR@,$ENABLE_WERROR,;t t +s,@ENABLE_DEBUG@,$ENABLE_DEBUG,;t t +s,@PRODUCT@,$PRODUCT,;t t +s,@PROFULLSWITCH@,$PROFULLSWITCH,;t t +s,@PROEXT@,$PROEXT,;t t +s,@ENABLE_SYMBOLS@,$ENABLE_SYMBOLS,;t t +s,@DISABLE_STRIP@,$DISABLE_STRIP,;t t +s,@ENABLE_CUPS@,$ENABLE_CUPS,;t t +s,@ENABLE_FONTCONFIG@,$ENABLE_FONTCONFIG,;t t +s,@WITH_BINFILTER@,$WITH_BINFILTER,;t t +s,@ENABLE_DIRECTX@,$ENABLE_DIRECTX,;t t +s,@DISABLE_ACTIVEX@,$DISABLE_ACTIVEX,;t t +s,@DISABLE_ATL@,$DISABLE_ATL,;t t +s,@ENABLE_RPATH@,$ENABLE_RPATH,;t t +s,@WITH_MYSPELL_DICTS@,$WITH_MYSPELL_DICTS,;t t +s,@SYSTEM_DICTS@,$SYSTEM_DICTS,;t t +s,@DICT_SYSTEM_DIR@,$DICT_SYSTEM_DIR,;t t +s,@HYPH_SYSTEM_DIR@,$HYPH_SYSTEM_DIR,;t t +s,@THES_SYSTEM_DIR@,$THES_SYSTEM_DIR,;t t +s,@USE_SHELL@,$USE_SHELL,;t t +s,@WITH_MINGWIN@,$WITH_MINGWIN,;t t +s,@SHELLPATH@,$SHELLPATH,;t t +s,@GCC_HOME@,$GCC_HOME,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@COMPATH@,$COMPATH,;t t +s,@GCCVER@,$GCCVER,;t t +s,@HAVE_LD_BSYMBOLIC_FUNCTIONS@,$HAVE_LD_BSYMBOLIC_FUNCTIONS,;t t +s,@ENABLE_PCH@,$ENABLE_PCH,;t t +s,@NO_HIDS@,$NO_HIDS,;t t +s,@GNUMAKE@,$GNUMAKE,;t t +s,@_cc@,$_cc,;t t +s,@HAVE_LD_HASH_STYLE@,$HAVE_LD_HASH_STYLE,;t t +s,@PERL@,$PERL,;t t +s,@MSPDB_PATH@,$MSPDB_PATH,;t t +s,@COMEX@,$COMEX,;t t +s,@USE_MINGW@,$USE_MINGW,;t t +s,@MIDL_PATH@,$MIDL_PATH,;t t +s,@CSC_PATH@,$CSC_PATH,;t t +s,@FRAME_HOME@,$FRAME_HOME,;t t +s,@CPP@,$CPP,;t t +s,@CXX@,$CXX,;t t +s,@CXXFLAGS@,$CXXFLAGS,;t t +s,@ac_ct_CXX@,$ac_ct_CXX,;t t +s,@CXXCPP@,$CXXCPP,;t t +s,@SIZEOF_LONG@,$SIZEOF_LONG,;t t +s,@WORDS_BIGENDIAN@,$WORDS_BIGENDIAN,;t t +s,@LFS_CFLAGS@,$LFS_CFLAGS,;t t +s,@ENABLE_VBA@,$ENABLE_VBA,;t t +s,@VBA_EXTENSION@,$VBA_EXTENSION,;t t +s,@PAM@,$PAM,;t t +s,@NEW_SHADOW_API@,$NEW_SHADOW_API,;t t +s,@PAM_LINK@,$PAM_LINK,;t t +s,@CRYPT_LINK@,$CRYPT_LINK,;t t +s,@GXX_INCLUDE_PATH@,$GXX_INCLUDE_PATH,;t t +s,@MINGW_LIB_INCLUDE_PATH@,$MINGW_LIB_INCLUDE_PATH,;t t +s,@MINGW_BACKWARD_INCLUDE_PATH@,$MINGW_BACKWARD_INCLUDE_PATH,;t t +s,@MINGW_CLIB_DIR@,$MINGW_CLIB_DIR,;t t +s,@MINGW_SHARED_GCCLIB@,$MINGW_SHARED_GCCLIB,;t t +s,@MINGW_GCCLIB_EH@,$MINGW_GCCLIB_EH,;t t +s,@MINGW_SHARED_GXXLIB@,$MINGW_SHARED_GXXLIB,;t t +s,@MINGW_GCCDLL@,$MINGW_GCCDLL,;t t +s,@MINGW_GXXDLL@,$MINGW_GXXDLL,;t t +s,@EXCEPTIONS@,$EXCEPTIONS,;t t +s,@STLPORT4@,$STLPORT4,;t t +s,@STLPORT_VER@,$STLPORT_VER,;t t +s,@USE_SYSTEM_STL@,$USE_SYSTEM_STL,;t t +s,@USE_CCACHE@,$USE_CCACHE,;t t +s,@CCACHE@,$CCACHE,;t t +s,@HAVE_GCC_VISIBILITY_FEATURE@,$HAVE_GCC_VISIBILITY_FEATURE,;t t +s,@ALLOC@,$ALLOC,;t t +s,@BUILD_VER_STRING@,$BUILD_VER_STRING,;t t +s,@SOLAR_JAVA@,$SOLAR_JAVA,;t t +s,@JAVAINTERPRETER@,$JAVAINTERPRETER,;t t +s,@JAVACOMPILER@,$JAVACOMPILER,;t t +s,@JAVACISGCJ@,$JAVACISGCJ,;t t +s,@JAVADOC@,$JAVADOC,;t t +s,@AWTLIB@,$AWTLIB,;t t +s,@JAVAAOTCOMPILER@,$JAVAAOTCOMPILER,;t t +s,@JAVA_HOME@,$JAVA_HOME,;t t +s,@JDK@,$JDK,;t t +s,@JAVAFLAGS@,$JAVAFLAGS,;t t +s,@DMAKE@,$DMAKE,;t t +s,@BUILD_DMAKE@,$BUILD_DMAKE,;t t +s,@EPM@,$EPM,;t t +s,@DPKG@,$DPKG,;t t +s,@PKGMK@,$PKGMK,;t t +s,@BUILD_EPM@,$BUILD_EPM,;t t +s,@PKGFORMAT@,$PKGFORMAT,;t t +s,@RPM@,$RPM,;t t +s,@GPERF@,$GPERF,;t t +s,@MINGWCXX@,$MINGWCXX,;t t +s,@ac_ct_MINGWCXX@,$ac_ct_MINGWCXX,;t t +s,@MINGWSTRIP@,$MINGWSTRIP,;t t +s,@ac_ct_MINGWSTRIP@,$ac_ct_MINGWSTRIP,;t t +s,@BUILD_UNOWINREG@,$BUILD_UNOWINREG,;t t +s,@BUILD_QADEVOOO@,$BUILD_QADEVOOO,;t t +s,@SYSTEM_STDLIBS@,$SYSTEM_STDLIBS,;t t +s,@SYSTEM_ZLIB@,$SYSTEM_ZLIB,;t t +s,@SYSTEM_JPEG@,$SYSTEM_JPEG,;t t +s,@SYSTEM_EXPAT@,$SYSTEM_EXPAT,;t t +s,@PKG_CONFIG@,$PKG_CONFIG,;t t +s,@LIBWPD_CFLAGS@,$LIBWPD_CFLAGS,;t t +s,@LIBWPD_LIBS@,$LIBWPD_LIBS,;t t +s,@SYSTEM_LIBWPD@,$SYSTEM_LIBWPD,;t t +s,@FREETYPE_CFLAGS@,$FREETYPE_CFLAGS,;t t +s,@FREETYPE_LIBS@,$FREETYPE_LIBS,;t t +s,@USE_FT_EMBOLDEN@,$USE_FT_EMBOLDEN,;t t +s,@LIBXSLT_CFLAGS@,$LIBXSLT_CFLAGS,;t t +s,@LIBXSLT_LIBS@,$LIBXSLT_LIBS,;t t +s,@XSLTPROC@,$XSLTPROC,;t t +s,@SYSTEM_LIBXSLT@,$SYSTEM_LIBXSLT,;t t +s,@LIBXML_CFLAGS@,$LIBXML_CFLAGS,;t t +s,@LIBXML_LIBS@,$LIBXML_LIBS,;t t +s,@SYSTEM_LIBXML@,$SYSTEM_LIBXML,;t t +s,@PYTHON@,$PYTHON,;t t +s,@PYTHON_VERSION@,$PYTHON_VERSION,;t t +s,@PYTHON_PREFIX@,$PYTHON_PREFIX,;t t +s,@PYTHON_EXEC_PREFIX@,$PYTHON_EXEC_PREFIX,;t t +s,@PYTHON_PLATFORM@,$PYTHON_PLATFORM,;t t +s,@pythondir@,$pythondir,;t t +s,@pkgpythondir@,$pkgpythondir,;t t +s,@pyexecdir@,$pyexecdir,;t t +s,@pkgpyexecdir@,$pkgpyexecdir,;t t +s,@BZIP2@,$BZIP2,;t t +s,@SYSTEM_PYTHON@,$SYSTEM_PYTHON,;t t +s,@PYTHON_CFLAGS@,$PYTHON_CFLAGS,;t t +s,@PYTHON_LIBS@,$PYTHON_LIBS,;t t +s,@HOME@,$HOME,;t t +s,@SYSTEM_DB@,$SYSTEM_DB,;t t +s,@DB_VERSION@,$DB_VERSION,;t t +s,@DB_INCLUDES@,$DB_INCLUDES,;t t +s,@DB_JAR@,$DB_JAR,;t t +s,@SYSTEM_LUCENE@,$SYSTEM_LUCENE,;t t +s,@LUCENE_CORE_JAR@,$LUCENE_CORE_JAR,;t t +s,@LUCENE_ANALYZERS_JAR@,$LUCENE_ANALYZERS_JAR,;t t +s,@SYSTEM_HSQLDB@,$SYSTEM_HSQLDB,;t t +s,@HSQLDB_JAR@,$HSQLDB_JAR,;t t +s,@SYSTEM_BSH@,$SYSTEM_BSH,;t t +s,@BSH_JAR@,$BSH_JAR,;t t +s,@SERIALIZER_JAR@,$SERIALIZER_JAR,;t t +s,@SYSTEM_SAXON@,$SYSTEM_SAXON,;t t +s,@SAXON_JAR@,$SAXON_JAR,;t t +s,@CURLCONFIG@,$CURLCONFIG,;t t +s,@SYSTEM_CURL@,$SYSTEM_CURL,;t t +s,@CURL_CFLAGS@,$CURL_CFLAGS,;t t +s,@CURL_LIBS@,$CURL_LIBS,;t t +s,@SYSTEM_BOOST@,$SYSTEM_BOOST,;t t +s,@SYSTEM_VIGRA@,$SYSTEM_VIGRA,;t t +s,@SYSTEM_ODBC_HEADERS@,$SYSTEM_ODBC_HEADERS,;t t +s,@WITH_MOZILLA@,$WITH_MOZILLA,;t t +s,@WITH_LDAP@,$WITH_LDAP,;t t +s,@WITH_OPENLDAP@,$WITH_OPENLDAP,;t t +s,@MOZ_NSS_CFLAGS@,$MOZ_NSS_CFLAGS,;t t +s,@MOZ_NSS_LIBS@,$MOZ_NSS_LIBS,;t t +s,@NSS_LIB@,$NSS_LIB,;t t +s,@MOZ_NSPR_CFLAGS@,$MOZ_NSPR_CFLAGS,;t t +s,@MOZ_NSPR_LIBS@,$MOZ_NSPR_LIBS,;t t +s,@NSPR_LIB@,$NSPR_LIB,;t t +s,@MOZILLAXPCOM_CFLAGS@,$MOZILLAXPCOM_CFLAGS,;t t +s,@MOZILLAXPCOM_LIBS@,$MOZILLAXPCOM_LIBS,;t t +s,@MOZILLA_VERSION@,$MOZILLA_VERSION,;t t +s,@MOZILLA_TOOLKIT@,$MOZILLA_TOOLKIT,;t t +s,@MOZGTK2_CFLAGS@,$MOZGTK2_CFLAGS,;t t +s,@MOZGTK2_LIBS@,$MOZGTK2_LIBS,;t t +s,@MOZLIBREQ_CFLAGS@,$MOZLIBREQ_CFLAGS,;t t +s,@MOZLIBREQ_LIBS@,$MOZLIBREQ_LIBS,;t t +s,@BUILD_MOZAB@,$BUILD_MOZAB,;t t +s,@ENABLE_NSS_MODULE@,$ENABLE_NSS_MODULE,;t t +s,@MOZILLABUILD@,$MOZILLABUILD,;t t +s,@SYSTEM_MOZILLA@,$SYSTEM_MOZILLA,;t t +s,@MOZ_FLAVOUR@,$MOZ_FLAVOUR,;t t +s,@MOZ_INC@,$MOZ_INC,;t t +s,@MOZ_LIB@,$MOZ_LIB,;t t +s,@MOZ_LIB_XPCOM@,$MOZ_LIB_XPCOM,;t t +s,@MOZ_LDAP_CFLAGS@,$MOZ_LDAP_CFLAGS,;t t +s,@SYSTEM_SANE_HEADER@,$SYSTEM_SANE_HEADER,;t t +s,@SYSTEM_GENBRK@,$SYSTEM_GENBRK,;t t +s,@SYSTEM_GENCCODE@,$SYSTEM_GENCCODE,;t t +s,@SYSTEM_GENCMN@,$SYSTEM_GENCMN,;t t +s,@SYSTEM_ICU@,$SYSTEM_ICU,;t t +s,@GRAPHITE_CFLAGS@,$GRAPHITE_CFLAGS,;t t +s,@GRAPHITE_LIBS@,$GRAPHITE_LIBS,;t t +s,@ENABLE_GRAPHITE@,$ENABLE_GRAPHITE,;t t +s,@SYSTEM_GRAPHITE@,$SYSTEM_GRAPHITE,;t t +s,@X_CFLAGS@,$X_CFLAGS,;t t +s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t +s,@X_LIBS@,$X_LIBS,;t t +s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t +s,@XINC@,$XINC,;t t +s,@XLIB@,$XLIB,;t t +s,@XAU_LIBS@,$XAU_LIBS,;t t +s,@DISABLE_XAW@,$DISABLE_XAW,;t t +s,@SYSTEM_XRENDER_HEADERS@,$SYSTEM_XRENDER_HEADERS,;t t +s,@XRENDER_LINK@,$XRENDER_LINK,;t t +s,@XRANDR_CFLAGS@,$XRANDR_CFLAGS,;t t +s,@XRANDR_LIBS@,$XRANDR_LIBS,;t t +s,@XRANDR_DLOPEN@,$XRANDR_DLOPEN,;t t +s,@ENABLE_RANDR@,$ENABLE_RANDR,;t t +s,@DISABLE_NEON@,$DISABLE_NEON,;t t +s,@NEON_CFLAGS@,$NEON_CFLAGS,;t t +s,@NEON_LIBS@,$NEON_LIBS,;t t +s,@SYSTEM_NEON@,$SYSTEM_NEON,;t t +s,@NEON_VERSION@,$NEON_VERSION,;t t +s,@OPENSSL_CFLAGS@,$OPENSSL_CFLAGS,;t t +s,@OPENSSL_LIBS@,$OPENSSL_LIBS,;t t +s,@SYSTEM_OPENSSL@,$SYSTEM_OPENSSL,;t t +s,@ENABLE_AGG@,$ENABLE_AGG,;t t +s,@AGG_CFLAGS@,$AGG_CFLAGS,;t t +s,@AGG_LIBS@,$AGG_LIBS,;t t +s,@SYSTEM_AGG@,$SYSTEM_AGG,;t t +s,@AGG_VERSION@,$AGG_VERSION,;t t +s,@REDLAND_CFLAGS@,$REDLAND_CFLAGS,;t t +s,@REDLAND_LIBS@,$REDLAND_LIBS,;t t +s,@SYSTEM_REDLAND@,$SYSTEM_REDLAND,;t t +s,@HUNSPELL_CFLAGS@,$HUNSPELL_CFLAGS,;t t +s,@HUNSPELL_LIBS@,$HUNSPELL_LIBS,;t t +s,@SYSTEM_HUNSPELL@,$SYSTEM_HUNSPELL,;t t +s,@SYSTEM_HYPH@,$SYSTEM_HYPH,;t t +s,@HYPHEN_LIB@,$HYPHEN_LIB,;t t +s,@SYSTEM_MYTHES@,$SYSTEM_MYTHES,;t t +s,@SYSTEM_LPSOLVE@,$SYSTEM_LPSOLVE,;t t +s,@PSDK_HOME@,$PSDK_HOME,;t t +s,@WINDOWS_VISTA_PSDK@,$WINDOWS_VISTA_PSDK,;t t +s,@DIRECTXSDK_HOME@,$DIRECTXSDK_HOME,;t t +s,@DIRECTXSDK_LIB@,$DIRECTXSDK_LIB,;t t +s,@NSIS_PATH@,$NSIS_PATH,;t t +s,@BISON@,$BISON,;t t +s,@FLEX@,$FLEX,;t t +s,@PATCH@,$PATCH,;t t +s,@GNUCP@,$GNUCP,;t t +s,@GNUPATCH@,$GNUPATCH,;t t +s,@CYGWIN_PATH@,$CYGWIN_PATH,;t t +s,@ML_EXE@,$ML_EXE,;t t +s,@ASM_HOME@,$ASM_HOME,;t t +s,@ZIP@,$ZIP,;t t +s,@UNZIP@,$UNZIP,;t t +s,@ZIP_HOME@,$ZIP_HOME,;t t +s,@ENABLE_GTK@,$ENABLE_GTK,;t t +s,@ENABLE_KDE@,$ENABLE_KDE,;t t +s,@ENABLE_KDE4@,$ENABLE_KDE4,;t t +s,@GCONF_CFLAGS@,$GCONF_CFLAGS,;t t +s,@GCONF_LIBS@,$GCONF_LIBS,;t t +s,@ENABLE_GCONF@,$ENABLE_GCONF,;t t +s,@GNOMEVFS_CFLAGS@,$GNOMEVFS_CFLAGS,;t t +s,@GNOMEVFS_LIBS@,$GNOMEVFS_LIBS,;t t +s,@ENABLE_GNOMEVFS@,$ENABLE_GNOMEVFS,;t t +s,@GTK_CFLAGS@,$GTK_CFLAGS,;t t +s,@GTK_LIBS@,$GTK_LIBS,;t t +s,@DBUS_CFLAGS@,$DBUS_CFLAGS,;t t +s,@DBUS_LIBS@,$DBUS_LIBS,;t t +s,@GIO_CFLAGS@,$GIO_CFLAGS,;t t +s,@GIO_LIBS@,$GIO_LIBS,;t t +s,@ENABLE_GIO@,$ENABLE_GIO,;t t +s,@ENABLE_DBUS@,$ENABLE_DBUS,;t t +s,@ENABLE_SYSTRAY_GTK@,$ENABLE_SYSTRAY_GTK,;t t +s,@CAIRO_CFLAGS@,$CAIRO_CFLAGS,;t t +s,@CAIRO_LIBS@,$CAIRO_LIBS,;t t +s,@ENABLE_CAIRO@,$ENABLE_CAIRO,;t t +s,@BUILD_PIXMAN@,$BUILD_PIXMAN,;t t +s,@SYSTEM_CAIRO@,$SYSTEM_CAIRO,;t t +s,@ENABLE_OPENGL@,$ENABLE_OPENGL,;t t +s,@ENABLE_MINIMIZER@,$ENABLE_MINIMIZER,;t t +s,@ENABLE_PRESENTER_SCREEN@,$ENABLE_PRESENTER_SCREEN,;t t +s,@POPPLER_CFLAGS@,$POPPLER_CFLAGS,;t t +s,@POPPLER_LIBS@,$POPPLER_LIBS,;t t +s,@ENABLE_PDFIMPORT@,$ENABLE_PDFIMPORT,;t t +s,@SYSTEM_POPPLER@,$SYSTEM_POPPLER,;t t +s,@ENABLE_MEDIAWIKI@,$ENABLE_MEDIAWIKI,;t t +s,@SYSTEM_SERVLETAPI@,$SYSTEM_SERVLETAPI,;t t +s,@SERVLETAPI_JAR@,$SERVLETAPI_JAR,;t t +s,@ENABLE_REPORTBUILDER@,$ENABLE_REPORTBUILDER,;t t +s,@SYSTEM_JFREEREPORT@,$SYSTEM_JFREEREPORT,;t t +s,@SAC_JAR@,$SAC_JAR,;t t +s,@LIBXML_JAR@,$LIBXML_JAR,;t t +s,@FLUTE_JAR@,$FLUTE_JAR,;t t +s,@JFREEREPORT_JAR@,$JFREEREPORT_JAR,;t t +s,@LIBBASE_JAR@,$LIBBASE_JAR,;t t +s,@LIBLAYOUT_JAR@,$LIBLAYOUT_JAR,;t t +s,@LIBLOADER_JAR@,$LIBLOADER_JAR,;t t +s,@LIBFORMULA_JAR@,$LIBFORMULA_JAR,;t t +s,@LIBREPOSITORY_JAR@,$LIBREPOSITORY_JAR,;t t +s,@LIBFONTS_JAR@,$LIBFONTS_JAR,;t t +s,@LIBSERIALIZER_JAR@,$LIBSERIALIZER_JAR,;t t +s,@SYSTEM_APACHE_COMMONS@,$SYSTEM_APACHE_COMMONS,;t t +s,@COMMONS_CODEC_JAR@,$COMMONS_CODEC_JAR,;t t +s,@COMMONS_LANG_JAR@,$COMMONS_LANG_JAR,;t t +s,@COMMONS_HTTPCLIENT_JAR@,$COMMONS_HTTPCLIENT_JAR,;t t +s,@COMMONS_LOGGING_JAR@,$COMMONS_LOGGING_JAR,;t t +s,@MOC@,$MOC,;t t +s,@KDE_CFLAGS@,$KDE_CFLAGS,;t t +s,@KDE_LIBS@,$KDE_LIBS,;t t +s,@MOC4@,$MOC4,;t t +s,@KDE4_CFLAGS@,$KDE4_CFLAGS,;t t +s,@KDE4_LIBS@,$KDE4_LIBS,;t t +s,@ENABLE_LOCKDOWN@,$ENABLE_LOCKDOWN,;t t +s,@GOBJECT_CFLAGS@,$GOBJECT_CFLAGS,;t t +s,@GOBJECT_LIBS@,$GOBJECT_LIBS,;t t +s,@ENABLE_EVOAB2@,$ENABLE_EVOAB2,;t t +s,@ENABLE_KAB@,$ENABLE_KAB,;t t +s,@WITH_FONTS@,$WITH_FONTS,;t t +s,@WITHOUT_PPDS@,$WITHOUT_PPDS,;t t +s,@WITHOUT_AFMS@,$WITHOUT_AFMS,;t t +s,@SCPDEFS@,$SCPDEFS,;t t +s,@USE_XINERAMA@,$USE_XINERAMA,;t t +s,@XINERAMA_LINK@,$XINERAMA_LINK,;t t +s,@ANT@,$ANT,;t t +s,@ANT_HOME@,$ANT_HOME,;t t +s,@ANT_LIB@,$ANT_LIB,;t t +s,@WITH_LANG@,$WITH_LANG,;t t +s,@WITH_POOR_HELP_LOCALIZATIONS@,$WITH_POOR_HELP_LOCALIZATIONS,;t t +s,@WITH_DICT@,$WITH_DICT,;t t +s,@INTRO_BITMAPS@,$INTRO_BITMAPS,;t t +s,@ABOUT_BITMAPS@,$ABOUT_BITMAPS,;t t +s,@OOO_VENDOR@,$OOO_VENDOR,;t t +s,@UNIXWRAPPERNAME@,$UNIXWRAPPERNAME,;t t +s,@ENABLE_STATIC_GTK@,$ENABLE_STATIC_GTK,;t t +s,@ENABLE_LAYOUT@,$ENABLE_LAYOUT,;t t +s,@VERBOSE@,$VERBOSE,;t t +s,@LOCAL_SOLVER@,$LOCAL_SOLVER,;t t +s,@BUILD_TYPE@,$BUILD_TYPE,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t +CEOF - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;; - esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - as_fn_append ac_file_inputs " '$ac_f'" - done +_ACEOF - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" - case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; - esac - ;; +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; esac - ac_dir=`$as_dirname -- "$ac_file" || + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir="$ac_dir"; as_fn_mkdir_p + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + ac_builddir=. -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi case $srcdir in - .) # We are building in place. + .) # No --srcdir option. We are building in place. ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac - case $ac_mode in - :F) - # - # CONFIG_FILE - # -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= -ac_sed_dataroot=' -/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p' -case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } _ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_sed_extra="$ac_vpsub +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub $extrasub _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s|@configure_input@|$ac_sed_conf_input|;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@top_build_prefix@&$ac_top_build_prefix&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -$ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&2;} - - rm -f "$tmp/stdin" - case $ac_file in - -) cat "$tmp/out" && rm -f "$tmp/out";; - *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; - esac \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 - ;; - - - - esac +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@abs_srcdir@,$ac_abs_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t +s,@builddir@,$ac_builddir,;t t +s,@abs_builddir@,$ac_abs_builddir,;t t +s,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi -done # for ac_tag +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF -as_fn_exit 0 +{ (exit 0); exit 0; } _ACEOF +chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save -test $ac_write_fail = 0 || - as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5 - # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. @@ -23390,11 +29440,7 @@ if test "$no_create" != yes; then exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit $? -fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} + $ac_cs_success || { (exit 1); exit 1; } fi -- cgit v1.2.3 From 1fa5cf73fc3521fbdff99878e9baba2c4f4b03ec Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 12 Jan 2010 11:18:27 +0000 Subject: cmcfixes69: #i106157# support system graphite, even with a different stlport --- graphite/makefile.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/graphite/makefile.mk b/graphite/makefile.mk index 5faa9054f98a..5ec831b61c00 100644 --- a/graphite/makefile.mk +++ b/graphite/makefile.mk @@ -68,6 +68,12 @@ TARGET=so_graphite .INCLUDE : settings.mk +.IF "$(SYSTEM_GRAPHITE)" == "YES" +all: + @echo "An already available installation of silgraphite should exist on your system." + @echo "Therefore the version provided here does not need to be built in addition." +.ENDIF + # --- Files -------------------------------------------------------- .IF "$(ENABLE_GRAPHITE)"=="TRUE" TARFILE_NAME=silgraphite-2.3.1 -- cgit v1.2.3 From 6d62a5cf692529856b21cfa84a71fdfde75521e3 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 12 Jan 2010 13:04:00 +0000 Subject: cmcfixes69: #i108258# fix mismatch new[]/delete --- transex3/source/inireader.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transex3/source/inireader.cxx b/transex3/source/inireader.cxx index 0985e788452d..63f902a5a1da 100644 --- a/transex3/source/inireader.cxx +++ b/transex3/source/inireader.cxx @@ -120,7 +120,7 @@ void INIreader::toStlString( const UnicodeString& str , string& stl_str) char* buffer = new char[ str.length()*3 ]; str.extract( 0 , str.length() , buffer ); stl_str = string( buffer ); - delete buffer; + delete [] buffer; } void INIreader::trim( string& str ) -- cgit v1.2.3 From b38be2caf83f44538f213d1c01420aee67bebce3 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 12 Jan 2010 13:06:48 +0000 Subject: cmcfixes69: #i108259# fix possible leaks --- transex3/source/export2.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/transex3/source/export2.cxx b/transex3/source/export2.cxx index 7815e80e033f..bf2648b0ca4f 100644 --- a/transex3/source/export2.cxx +++ b/transex3/source/export2.cxx @@ -354,17 +354,18 @@ bool Export::CopyFile( const ByteString& source , const ByteString& dest ) const int BUFFERSIZE = 8192; char buf[ BUFFERSIZE ]; - FILE* IN_FILE = fopen( source.GetBuffer() , "r" ); - FILE* OUT_FILE = fopen( dest.GetBuffer() , "w" ); - + FILE* IN_FILE = fopen( source.GetBuffer() , "r" ); if( IN_FILE == NULL ) { cerr << "Export::CopyFile WARNING: Could not open " << source.GetBuffer() << "\n"; return false; } + + FILE* OUT_FILE = fopen( dest.GetBuffer() , "w" ); if( OUT_FILE == NULL ) { cerr << "Export::CopyFile WARNING: Could not open/create " << dest.GetBuffer() << " for writing\n"; + fclose( IN_FILE ); return false; } -- cgit v1.2.3 From 022eec80a272cddcf5ee6eda2b14236df1a4e30c Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 12 Jan 2010 13:23:47 +0000 Subject: cmcfixes69: #i108261# fix mismatch ifdefs --- sd/source/ui/unoidl/facreg.cxx | 2 -- 1 file changed, 2 deletions(-) diff --git a/sd/source/ui/unoidl/facreg.cxx b/sd/source/ui/unoidl/facreg.cxx index b90832acaa51..959f22e30cf1 100644 --- a/sd/source/ui/unoidl/facreg.cxx +++ b/sd/source/ui/unoidl/facreg.cxx @@ -270,10 +270,8 @@ static ::boost::shared_ptr spFactoryMap; } // end of anonymous namespace -#ifdef __cplusplus extern "C" { -#endif SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, -- cgit v1.2.3 From 5c75442ef1d77016394583a112d37886d562eef6 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 12 Jan 2010 13:25:32 +0000 Subject: cmcfixes69: #i108262# fix mismatch braces --- writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx b/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx index 067ae4615a0f..936ef27de272 100644 --- a/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx +++ b/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx @@ -422,6 +422,7 @@ void OOXMLPropertySetImpl::resolve(Properties & rHandler) debug_logger->startElement("error"); debug_logger->chars("zero-property"); debug_logger->endElement("error"); + } #endif aIt++; -- cgit v1.2.3 From 0f26adb46fc7d371c686089c674d408c93f36771 Mon Sep 17 00:00:00 2001 From: Carsten Driesner Date: Tue, 12 Jan 2010 13:48:41 +0000 Subject: #108263# Fix problem with empty system values which need to be intergers. Use 0 to reflect unknown. --- .../com/sun/star/servicetag/SystemEnvironment.java | 29 ++++++++++++++++------ 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/desktop/source/registration/com/sun/star/servicetag/SystemEnvironment.java b/desktop/source/registration/com/sun/star/servicetag/SystemEnvironment.java index 4628034723e1..e920bc098219 100644 --- a/desktop/source/registration/com/sun/star/servicetag/SystemEnvironment.java +++ b/desktop/source/registration/com/sun/star/servicetag/SystemEnvironment.java @@ -95,12 +95,12 @@ public class SystemEnvironment { this.systemManufacturer = ""; this.cpuManufacturer = ""; this.serialNumber = ""; - this.physmem = ""; - this.sockets = ""; - this.cores = ""; - this.virtcpus = ""; + this.physmem = "0"; + this.sockets = "0"; + this.cores = "0"; + this.virtcpus = "0"; this.cpuname = ""; - this.clockrate = ""; + this.clockrate = "0"; } @@ -173,6 +173,8 @@ public class SystemEnvironment { * @param physmem The physmem to set. */ public void setPhysMem(String physmem) { + if (physmem.length() == 0) + physmem = "0"; this.physmem = physmem; } @@ -181,6 +183,8 @@ public class SystemEnvironment { * @param sockets The sockets to set. */ public void setSockets(String sockets) { + if (sockets.length() == 0) + sockets = "0"; this.sockets = sockets; } @@ -189,6 +193,8 @@ public class SystemEnvironment { * @param cores The cores to set. */ public void setCores(String cores) { + if (cores.length() == 0) + cores ="0"; this.cores = cores; } @@ -197,6 +203,8 @@ public class SystemEnvironment { * @param virtcpus The virtcpus to set. */ public void setVirtCpus(String virtcpus) { + if (virtcpus.length() == 0) + virtcpus = "0"; this.virtcpus = virtcpus; } @@ -213,9 +221,14 @@ public class SystemEnvironment { * @param clockrate The clockrate to set. */ public void setClockRate(String clockrate) { - Float f = Float.parseFloat(clockrate); - Integer nClockrate = f.intValue(); - this.clockrate = nClockrate.toString(); + if (clockrate.length() == 0) + this.clockrate = "0"; + else + { + Float f = Float.parseFloat(clockrate); + Integer nClockrate = f.intValue(); + this.clockrate = nClockrate.toString(); + } } /** -- cgit v1.2.3 From 56660ceabd571ab96ec493c8c2f4986617fd14af Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Wed, 13 Jan 2010 13:52:52 +0100 Subject: dba33d: set control as string --- dbaccess/source/filter/xml/xmlColumn.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dbaccess/source/filter/xml/xmlColumn.cxx b/dbaccess/source/filter/xml/xmlColumn.cxx index c9670d98317a..c0113fe7a14a 100644 --- a/dbaccess/source/filter/xml/xmlColumn.cxx +++ b/dbaccess/source/filter/xml/xmlColumn.cxx @@ -130,7 +130,8 @@ OXMLColumn::OXMLColumn( ODBFilter& rImport break; case XML_TOK_COLUMN_DEFAULT_VALUE: if ( sValue.getLength() && sType.getLength() ) - SvXMLUnitConverter::convertAny(m_aDefaultValue,sType,sValue); + m_aDefaultValue <<= sValue; + // SvXMLUnitConverter::convertAny(m_aDefaultValue,sType,sValue); break; case XML_TOK_COLUMN_VISIBLE: m_bHidden = sValue.equalsAscii("false"); -- cgit v1.2.3 From bf46dbcd552d7538474af43b82eb16e17e02d0a4 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Wed, 13 Jan 2010 17:55:09 +0100 Subject: swunolocking1: #i108161#: WeakReferenceHelper: Apple g++ 4.0.1 erroneously believes that it is ambiguous to use WeakReference::operator=(Reference). as a workaround, introduce WeakReferenceHelper::clear(), and fix all users. --- cppuhelper/inc/cppuhelper/weakref.hxx | 6 +++++ cppuhelper/source/cc5_solaris_sparc.map | 1 + cppuhelper/source/gcc3.map | 1 + cppuhelper/source/msvc_win32_intel.map | 1 + cppuhelper/source/weak.cxx | 45 +++++++++++++++------------------ 5 files changed, 30 insertions(+), 24 deletions(-) diff --git a/cppuhelper/inc/cppuhelper/weakref.hxx b/cppuhelper/inc/cppuhelper/weakref.hxx index a4f9f46eabd9..5ed14743a520 100644 --- a/cppuhelper/inc/cppuhelper/weakref.hxx +++ b/cppuhelper/inc/cppuhelper/weakref.hxx @@ -109,6 +109,12 @@ public: inline SAL_CALL operator Reference< XInterface > () const SAL_THROW( () ) { return get(); } + /** Releases this reference. + + @since UDK 3.2.12 + */ + void SAL_CALL clear() SAL_THROW( () ); + protected: /** @internal */ OWeakRefListener * m_pImpl; diff --git a/cppuhelper/source/cc5_solaris_sparc.map b/cppuhelper/source/cc5_solaris_sparc.map index 0cda7be0bb7d..941465519a08 100755 --- a/cppuhelper/source/cc5_solaris_sparc.map +++ b/cppuhelper/source/cc5_solaris_sparc.map @@ -384,4 +384,5 @@ UDK_3.7 { # OOo 3.3 global: __1cEcppuLOWeakObjectbAdisposeWeakConnectionPoint6M_v_; __1cDcomDsunEstarDunoTWeakReferenceHelper2G6Mrkn0DJReference4n0DKXInterface____r4_; + __1cDcomDsunEstarDunoTWeakReferenceHelperFclear6M_v_; } UDK_3.6; diff --git a/cppuhelper/source/gcc3.map b/cppuhelper/source/gcc3.map index 6b6bac67d8f7..099373b2e220 100644 --- a/cppuhelper/source/gcc3.map +++ b/cppuhelper/source/gcc3.map @@ -378,5 +378,6 @@ UDK_3.6 { # OOo 3.3 global: _ZN4cppu11OWeakObject26disposeWeakConnectionPointEv; _ZN3com3sun4star3uno19WeakReferenceHelperaSERKNS2_9ReferenceINS2_10XInterfaceEEE; + _ZN3com3sun4star3uno19WeakReferenceHelper5clearEv; } UDK_3.5; diff --git a/cppuhelper/source/msvc_win32_intel.map b/cppuhelper/source/msvc_win32_intel.map index c999ae200ac2..6bc10cb175c2 100644 --- a/cppuhelper/source/msvc_win32_intel.map +++ b/cppuhelper/source/msvc_win32_intel.map @@ -275,4 +275,5 @@ UDK_3.5 { # OOo 3.0 UDK_3.6 { # OOo 3.3 global: ?disposeWeakConnectionPoint@OWeakObject@cppu@@IAEXXZ; + ?clear@WeakReferenceHelper@uno@star@sun@com@@QAAXXZ; } UDK_3.5; diff --git a/cppuhelper/source/weak.cxx b/cppuhelper/source/weak.cxx index 1901610d40b7..1fbfb3fa96ad 100644 --- a/cppuhelper/source/weak.cxx +++ b/cppuhelper/source/weak.cxx @@ -479,6 +479,25 @@ WeakReferenceHelper::WeakReferenceHelper(const WeakReferenceHelper& rWeakRef) SA } } +void WeakReferenceHelper::clear() SAL_THROW( () ) +{ + try + { + if (m_pImpl) + { + if (m_pImpl->m_XWeakConnectionPoint.is()) + { + m_pImpl->m_XWeakConnectionPoint->removeReference( + (XReference*)m_pImpl); + m_pImpl->m_XWeakConnectionPoint.clear(); + } + m_pImpl->release(); + m_pImpl = 0; + } + } + catch (RuntimeException &) { OSL_ASSERT( 0 ); } // assert here, but no unexpected() +} + WeakReferenceHelper& WeakReferenceHelper::operator=(const WeakReferenceHelper& rWeakRef) SAL_THROW( () ) { if (this == &rWeakRef) @@ -495,16 +514,7 @@ SAL_THROW( () ) { try { - if (m_pImpl) - { - if (m_pImpl->m_XWeakConnectionPoint.is()) - { - m_pImpl->m_XWeakConnectionPoint->removeReference((XReference*)m_pImpl); - m_pImpl->m_XWeakConnectionPoint.clear(); - } - m_pImpl->release(); - m_pImpl = 0; - } + clear(); if (xInt.is()) { m_pImpl = new OWeakRefListener(xInt); @@ -517,20 +527,7 @@ SAL_THROW( () ) WeakReferenceHelper::~WeakReferenceHelper() SAL_THROW( () ) { - try - { - if (m_pImpl) - { - if (m_pImpl->m_XWeakConnectionPoint.is()) - { - m_pImpl->m_XWeakConnectionPoint->removeReference((XReference*)m_pImpl); - m_pImpl->m_XWeakConnectionPoint.clear(); - } - m_pImpl->release(); - m_pImpl = 0; // for safety - } - } - catch (RuntimeException &) { OSL_ASSERT( 0 ); } // assert here, but no unexpected() + clear(); } Reference< XInterface > WeakReferenceHelper::get() const SAL_THROW( () ) -- cgit v1.2.3 From e646dde27ab190586ad123de14cfe870dc26aaae Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Wed, 13 Jan 2010 17:55:09 +0100 Subject: swunolocking1: #i108161#: WeakReferenceHelper: Apple g++ 4.0.1 erroneously believes that it is ambiguous to use WeakReference::operator=(Reference). as a workaround, introduce WeakReferenceHelper::clear(), and fix all users. --- comphelper/inc/comphelper/weakeventlistener.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comphelper/inc/comphelper/weakeventlistener.hxx b/comphelper/inc/comphelper/weakeventlistener.hxx index c6938e2b8423..045dfb169312 100644 --- a/comphelper/inc/comphelper/weakeventlistener.hxx +++ b/comphelper/inc/comphelper/weakeventlistener.hxx @@ -76,7 +76,7 @@ namespace comphelper inline void resetListener( ) { - m_aListener = ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >(); + m_aListener.clear(); } -- cgit v1.2.3 From e9af447dcbc786acc2dcb8fff41d4d06a1f4c28d Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Wed, 13 Jan 2010 17:55:09 +0100 Subject: swunolocking1: #i108161#: WeakReferenceHelper: Apple g++ 4.0.1 erroneously believes that it is ambiguous to use WeakReference::operator=(Reference). as a workaround, introduce WeakReferenceHelper::clear(), and fix all users. --- sd/source/ui/unoidl/unolayer.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sd/source/ui/unoidl/unolayer.cxx b/sd/source/ui/unoidl/unolayer.cxx index 96dd05a01267..17fad0f5fdc1 100644 --- a/sd/source/ui/unoidl/unolayer.cxx +++ b/sd/source/ui/unoidl/unolayer.cxx @@ -826,8 +826,8 @@ uno::Reference SdLayerManager::GetLayer (SdrLayer* pLayer) xLayer = new SdLayer (this, pLayer); // Remember the new xLayer for future calls. - xRef = uno::Reference (xLayer, uno::UNO_QUERY); - mpLayers->insert (xRef); + uno::WeakReference wRef(xLayer); + mpLayers->insert(wRef); } return xLayer; -- cgit v1.2.3 -- cgit v1.2.3 From b15930156ffd1eae186c9996f8d2979c2e097685 Mon Sep 17 00:00:00 2001 From: sj Date: Wed, 13 Jan 2010 19:13:55 +0100 Subject: impress181: #i107561#: now also exporting notes to pdf --- sd/source/ui/unoidl/unomodel.cxx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 4dab2fbac616..89985f43f1dd 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -1885,14 +1885,11 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r const sal_Int32 nPageNumber = nRenderer + 1; PageKind ePageKind = PK_STANDARD; sal_Bool bExportNotesPages = sal_False; - sal_Bool bExportNotes = sal_False; for( sal_Int32 nProperty = 0, nPropertyCount = rxOptions.getLength(); nProperty < nPropertyCount; ++nProperty ) { if( rxOptions[ nProperty ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "RenderDevice" ) ) ) rxOptions[ nProperty ].Value >>= xRenderDevice; - else if ( rxOptions[ nProperty ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportNotes" ) ) ) - rxOptions[ nProperty ].Value >>= bExportNotes; else if ( rxOptions[ nProperty ].Name == OUString( RTL_CONSTASCII_USTRINGPARAM( "ExportNotesPages" ) ) ) { rxOptions[ nProperty].Value >>= bExportNotesPages; @@ -1988,7 +1985,7 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r uno::Reference< drawing::XDrawPage > xPage( uno::Reference< drawing::XDrawPage >::query( pPage->getUnoPage() ) ); if ( xPage.is() ) { - if ( bExportNotes ) + if ( pPDFExtOutDevData->GetIsExportNotes() ) ImplPDFExportComments( xPage, *pPDFExtOutDevData ); uno::Reference< beans::XPropertySet > xPagePropSet( xPage, uno::UNO_QUERY ); if( xPagePropSet.is() ) -- cgit v1.2.3 From a7062ae8ee7e24437b490abea605524a2d3a8486 Mon Sep 17 00:00:00 2001 From: Ingrid Halama Date: Thu, 14 Jan 2010 13:36:46 +0000 Subject: #i108313# & #i108281# pie charts without series crashes office --- chart2/source/tools/ChartTypeHelper.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chart2/source/tools/ChartTypeHelper.cxx b/chart2/source/tools/ChartTypeHelper.cxx index 9e521fa76dae..243e30093ff3 100644 --- a/chart2/source/tools/ChartTypeHelper.cxx +++ b/chart2/source/tools/ChartTypeHelper.cxx @@ -549,7 +549,7 @@ sal_Int32 ChartTypeHelper::getNumberOfDisplayedSeries( if( (xChartTypeProp->getPropertyValue( C2U("UseRings")) >>= bDonut) && !bDonut ) { - return 1; + return nNumberOfSeries>0 ? 1 : 0; } } } -- cgit v1.2.3 From 0203776ff2c1253188f488be8cc9d80c38d982ce Mon Sep 17 00:00:00 2001 From: Ingrid Halama Date: Thu, 14 Jan 2010 13:37:50 +0000 Subject: #i108122# data label from categories crashes office when having no categories --- chart2/source/view/charttypes/VSeriesPlotter.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx index c8f473d226d0..864a9f8accfa 100644 --- a/chart2/source/view/charttypes/VSeriesPlotter.cxx +++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx @@ -537,6 +537,9 @@ uno::Reference< drawing::XShape > VSeriesPlotter::createDataLabel( const uno::Re createText( xTarget_, aText.makeStringAndClear() , *pPropNames, *pPropValues, ShapeFactory::makeTransformation( aScreenPosition2D ) ); + if( !xTextShape.is() ) + return xTextShape; + const awt::Point aUnrotatedTextPos( xTextShape->getPosition() ); if( fRotationDegrees != 0.0 ) { @@ -547,7 +550,7 @@ uno::Reference< drawing::XShape > VSeriesPlotter::createDataLabel( const uno::Re LabelPositionHelper::correctPositionForRotation( xTextShape, eAlignment, fRotationDegrees, true /*bRotateAroundCenter*/ ); } - if( xSymbol.is() && xTextShape.is() ) + if( xSymbol.is() ) { const awt::Point aOldTextPos( xTextShape->getPosition() ); awt::Point aNewTextPos( aOldTextPos ); -- cgit v1.2.3 From 47f2782d29c156c888e8e9f0cd1b41b259a14206 Mon Sep 17 00:00:00 2001 From: Ingo Schmidt Date: Thu, 14 Jan 2010 14:23:50 +0000 Subject: #i108322# new java6u18 --- setup_native/source/java/javaversion.dat | 26 +++++++++++++------------- setup_native/source/java/javaversion2.dat | 26 +++++++++++++------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/setup_native/source/java/javaversion.dat b/setup_native/source/java/javaversion.dat index 7ff47b499e45..6a18f1641eab 100755 --- a/setup_native/source/java/javaversion.dat +++ b/setup_native/source/java/javaversion.dat @@ -30,30 +30,30 @@ #************************************************************************* # GUI String in the installer ("Java Runtime Environment (${JAVAVERSION})") -JAVAVERSION=Java 6 Update 17 -WINDOWSJAVAVERSION=Java 6 Update 17 +JAVAVERSION=Java 6 Update 18 +WINDOWSJAVAVERSION=Java 6 Update 18 # Windows (scp2 and downloadtemplate.nsi) -WINDOWSJAVAFILENAME=jre-6u17-windows-i586.exe -WINDOWSJAVAREGISTRYENTRY=1.6.0_17 +WINDOWSJAVAFILENAME=jre-6u18-windows-i586.exe +WINDOWSJAVAREGISTRYENTRY=1.6.0_18 # Linux (scp2) -LINUXJAVAFILENAME=jre-6u17-linux-i586.rpm +LINUXJAVAFILENAME=jre-6u18-linux-i586.rpm # Linux (rpmUnit.xml, rpm -qp ) -LINUXJAVANAME=jre-1.6.0_17-fcs +LINUXJAVANAME=jre-1.6.0_18-fcs # Linux-x64 (scp2) -LINUXX64JAVAFILENAME=jre-6u17-linux-amd64.rpm +LINUXX64JAVAFILENAME=jre-6u18-linux-amd64.rpm # Solaris Sparc (scp2) -SOLSJAVARTPACKED=SUNWj6rt_1_6_0_17_sparc.tar.gz -SOLSJAVACFGPACKED=SUNWj6cfg_1_6_0_17_sparc.tar.gz -SOLSJAVAMANPACKED=SUNWj6man_1_6_0_17_sparc.tar.gz +SOLSJAVARTPACKED=SUNWj6rt_1_6_0_18_sparc.tar.gz +SOLSJAVACFGPACKED=SUNWj6cfg_1_6_0_18_sparc.tar.gz +SOLSJAVAMANPACKED=SUNWj6man_1_6_0_18_sparc.tar.gz # Solaris x86 (scp2) -SOLIJAVARTPACKED=SUNWj6rt_1_6_0_17_x86.tar.gz -SOLIJAVACFGPACKED=SUNWj6cfg_1_6_0_17_x86.tar.gz -SOLIJAVAMANPACKED=SUNWj6man_1_6_0_17_x86.tar.gz +SOLIJAVARTPACKED=SUNWj6rt_1_6_0_18_x86.tar.gz +SOLIJAVACFGPACKED=SUNWj6cfg_1_6_0_18_x86.tar.gz +SOLIJAVAMANPACKED=SUNWj6man_1_6_0_18_x86.tar.gz # Solaris (pkgUnit.xml, needs only to be changed in major changes) SOLARISJAVART=SUNWj6rt diff --git a/setup_native/source/java/javaversion2.dat b/setup_native/source/java/javaversion2.dat index 7ff47b499e45..6a18f1641eab 100644 --- a/setup_native/source/java/javaversion2.dat +++ b/setup_native/source/java/javaversion2.dat @@ -30,30 +30,30 @@ #************************************************************************* # GUI String in the installer ("Java Runtime Environment (${JAVAVERSION})") -JAVAVERSION=Java 6 Update 17 -WINDOWSJAVAVERSION=Java 6 Update 17 +JAVAVERSION=Java 6 Update 18 +WINDOWSJAVAVERSION=Java 6 Update 18 # Windows (scp2 and downloadtemplate.nsi) -WINDOWSJAVAFILENAME=jre-6u17-windows-i586.exe -WINDOWSJAVAREGISTRYENTRY=1.6.0_17 +WINDOWSJAVAFILENAME=jre-6u18-windows-i586.exe +WINDOWSJAVAREGISTRYENTRY=1.6.0_18 # Linux (scp2) -LINUXJAVAFILENAME=jre-6u17-linux-i586.rpm +LINUXJAVAFILENAME=jre-6u18-linux-i586.rpm # Linux (rpmUnit.xml, rpm -qp ) -LINUXJAVANAME=jre-1.6.0_17-fcs +LINUXJAVANAME=jre-1.6.0_18-fcs # Linux-x64 (scp2) -LINUXX64JAVAFILENAME=jre-6u17-linux-amd64.rpm +LINUXX64JAVAFILENAME=jre-6u18-linux-amd64.rpm # Solaris Sparc (scp2) -SOLSJAVARTPACKED=SUNWj6rt_1_6_0_17_sparc.tar.gz -SOLSJAVACFGPACKED=SUNWj6cfg_1_6_0_17_sparc.tar.gz -SOLSJAVAMANPACKED=SUNWj6man_1_6_0_17_sparc.tar.gz +SOLSJAVARTPACKED=SUNWj6rt_1_6_0_18_sparc.tar.gz +SOLSJAVACFGPACKED=SUNWj6cfg_1_6_0_18_sparc.tar.gz +SOLSJAVAMANPACKED=SUNWj6man_1_6_0_18_sparc.tar.gz # Solaris x86 (scp2) -SOLIJAVARTPACKED=SUNWj6rt_1_6_0_17_x86.tar.gz -SOLIJAVACFGPACKED=SUNWj6cfg_1_6_0_17_x86.tar.gz -SOLIJAVAMANPACKED=SUNWj6man_1_6_0_17_x86.tar.gz +SOLIJAVARTPACKED=SUNWj6rt_1_6_0_18_x86.tar.gz +SOLIJAVACFGPACKED=SUNWj6cfg_1_6_0_18_x86.tar.gz +SOLIJAVAMANPACKED=SUNWj6man_1_6_0_18_x86.tar.gz # Solaris (pkgUnit.xml, needs only to be changed in major changes) SOLARISJAVART=SUNWj6rt -- cgit v1.2.3 From 3d62f771bcf77aaabb236b90474828577f324256 Mon Sep 17 00:00:00 2001 From: Philipp Lohmann Date: Thu, 14 Jan 2010 16:15:04 +0000 Subject: #i108325# workaround a form control paint issue --- drawinglayer/source/processor2d/vclpixelprocessor2d.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx index 5a74b0471b7f..92420fb6da3a 100644 --- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx @@ -70,6 +70,9 @@ #include #include +#include +#include + ////////////////////////////////////////////////////////////////////////////// using namespace com::sun::star; @@ -370,6 +373,12 @@ namespace drawinglayer aOrigin.X() + basegfx::fround(aTopLeftPixel.getX()), aOrigin.Y() + basegfx::fround(aTopLeftPixel.getY())); } + else if( xControlWindow.is() ) + { + Window* pWin = VCLUnoHelper::GetWindow( rXControl->getPeer() ); + if( pWin ) + pWin->Invalidate(); + } // restore original graphics xControlView->setGraphics(xOriginalGraphics); -- cgit v1.2.3 From 03a36337afdb951f7912e4b7b9bf8c365b310ccc Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Fri, 15 Jan 2010 07:55:20 +0100 Subject: dba33d: set the control only when not before or after last row --- forms/source/component/FormattedField.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/forms/source/component/FormattedField.cxx b/forms/source/component/FormattedField.cxx index 0edbf781e786..e8c61ecded7e 100644 --- a/forms/source/component/FormattedField.cxx +++ b/forms/source/component/FormattedField.cxx @@ -583,7 +583,7 @@ void OFormattedModel::_propertyChanged( const com::sun::star::beans::PropertyCha // as m_aSaveValue (which is used by commitControlValueToDbColumn) is format dependent we have // to recalc it, which is done by translateDbColumnToControlValue - if ( m_xColumn.is() && m_xAggregateFastSet.is() ) + if ( m_xColumn.is() && m_xAggregateFastSet.is() && !m_xCursor->isBeforeFirst() && !m_xCursor->isAfterLast()) { setControlValue( translateDbColumnToControlValue(), eOther ); } -- cgit v1.2.3 From 24519f54a51bc481acff466670b1d74df3ce9ab3 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Fri, 15 Jan 2010 08:06:07 +0100 Subject: dba33d: #i106772# slice decimal value to scale --- dbaccess/source/core/api/KeySet.cxx | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx index 1e7aa0f51f97..474ad8a38b65 100644 --- a/dbaccess/source/core/api/KeySet.cxx +++ b/dbaccess/source/core/api/KeySet.cxx @@ -802,7 +802,24 @@ void OKeySet::copyRowValue(const ORowSetRow& _rInsertRow,ORowSetRow& _rKeyRow) SelectColumnsMetaData::const_iterator aPosEnd = (*m_pKeyColumnNames).end(); for(;aPosIter != aPosEnd;++aPosIter,++aIter) { - *aIter = (_rInsertRow->get())[aPosIter->second.nPosition]; + ORowSetValue aValue((_rInsertRow->get())[aPosIter->second.nPosition]); + switch(aPosIter->second.nType) + { + case DataType::DECIMAL: + case DataType::NUMERIC: + { + ::rtl::OUString sValue = aValue.getString(); + sal_Int32 nIndex = sValue.indexOf('.'); + if ( nIndex != -1 ) + { + aValue = sValue.copy(0,nIndex + (aPosIter->second.nScale > 0 ? aPosIter->second.nScale + 1 : 0)); + } + } + break; + default: + break; + } + *aIter = aValue; aIter->setTypeKind(aPosIter->second.nType); } } -- cgit v1.2.3 From 23aabe20a1766634414e90713d6e18243bd39e83 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Fri, 15 Jan 2010 10:59:38 +0100 Subject: dba33d: create sdb interaction --- dbaccess/source/ui/misc/WCopyTable.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx index 1cdf6156a789..b178947bf5f9 100644 --- a/dbaccess/source/ui/misc/WCopyTable.cxx +++ b/dbaccess/source/ui/misc/WCopyTable.cxx @@ -709,6 +709,8 @@ OCopyTableWizard::OCopyTableWizard( Window* pParent, const ::rtl::OUString& _rDe ::dbaui::fillTypeInfo( _xConnection, m_sTypeNames, m_aTypeInfo, m_aTypeInfoIndex ); ::dbaui::fillTypeInfo( _xConnection, m_sTypeNames, m_aDestTypeInfo, m_aDestTypeInfoIndex ); + m_xInteractionHandler.set( m_xFactory->createInstance( SERVICE_SDB_INTERACTION_HANDLER ), UNO_QUERY); + OCopyTable* pPage1( new OCopyTable( this ) ); pPage1->disallowViews(); pPage1->setCreateStyleAction(); -- cgit v1.2.3 From cbb8cded67d757f53642e6753d286c6612757ffe Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 18 Jan 2010 11:56:59 +0000 Subject: s390xport02: #i108410# fix endian issues in s390x --- bridges/source/cpp_uno/gcc3_linux_s390x/cpp2uno.cxx | 8 +++++++- bridges/source/cpp_uno/gcc3_linux_s390x/uno2cpp.cxx | 8 +++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/bridges/source/cpp_uno/gcc3_linux_s390x/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_s390x/cpp2uno.cxx index e866e05f32c5..4cb95f9faf76 100644 --- a/bridges/source/cpp_uno/gcc3_linux_s390x/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_s390x/cpp2uno.cxx @@ -522,15 +522,21 @@ long privateSnippetExecutor(long r2, long r3, long r4, long r5, long r6, long fi switch( aType ) { - case typelib_TypeClass_VOID: case typelib_TypeClass_BOOLEAN: case typelib_TypeClass_BYTE: + nRegReturn[0] = (unsigned long)(*(unsigned char *)nRegReturn); + break; case typelib_TypeClass_CHAR: case typelib_TypeClass_UNSIGNED_SHORT: case typelib_TypeClass_SHORT: + nRegReturn[0] = (unsigned long)(*(unsigned short *)nRegReturn); + break; case typelib_TypeClass_ENUM: case typelib_TypeClass_UNSIGNED_LONG: case typelib_TypeClass_LONG: + nRegReturn[0] = (unsigned long)(*(unsigned int *)nRegReturn); + break; + case typelib_TypeClass_VOID: default: break; case typelib_TypeClass_FLOAT: diff --git a/bridges/source/cpp_uno/gcc3_linux_s390x/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_s390x/uno2cpp.cxx index 5940f566f9ca..cd922c2fa870 100644 --- a/bridges/source/cpp_uno/gcc3_linux_s390x/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_s390x/uno2cpp.cxx @@ -60,19 +60,21 @@ void MapReturn(long r2, double f0, typelib_TypeClass eTypeClass, sal_uInt64* pRe { case typelib_TypeClass_HYPER: case typelib_TypeClass_UNSIGNED_HYPER: + *pRegisterReturn = r2; + break; case typelib_TypeClass_LONG: case typelib_TypeClass_UNSIGNED_LONG: case typelib_TypeClass_ENUM: - *pRegisterReturn = r2; + *(unsigned int*)pRegisterReturn = (unsigned int)r2; break; case typelib_TypeClass_CHAR: case typelib_TypeClass_SHORT: case typelib_TypeClass_UNSIGNED_SHORT: - *pRegisterReturn = (unsigned short)r2; + *(unsigned short*)pRegisterReturn = (unsigned short)r2; break; case typelib_TypeClass_BOOLEAN: case typelib_TypeClass_BYTE: - *pRegisterReturn = (unsigned char)r2; + *(unsigned char*)pRegisterReturn = (unsigned char)r2; break; case typelib_TypeClass_FLOAT: *reinterpret_cast( pRegisterReturn ) = f0; -- cgit v1.2.3 From 9d8149396e1d60f8341302ac3c52c811f388d9de Mon Sep 17 00:00:00 2001 From: sj Date: Mon, 18 Jan 2010 14:40:48 +0100 Subject: #i108328# fixed textorientation problem --- sc/source/filter/excel/xiescher.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx index 990351fe2471..dece34280d8b 100644 --- a/sc/source/filter/excel/xiescher.cxx +++ b/sc/source/filter/excel/xiescher.cxx @@ -1459,8 +1459,9 @@ void XclImpTextObj::DoProcessSdrObj( SdrObject& rSdrObj ) const com::sun::star::beans::PropertyValue aTextRotateAngle; aTextRotateAngle.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "TextRotateAngle" ) ); aTextRotateAngle.Value <<= fAngle; - SdrCustomShapeGeometryItem& rGeometryItem = (SdrCustomShapeGeometryItem&)pObjCustomShape->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ); - rGeometryItem.SetPropertyValue( aTextRotateAngle ); + SdrCustomShapeGeometryItem aGeometryItem((SdrCustomShapeGeometryItem&)pObjCustomShape->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY )); + aGeometryItem.SetPropertyValue( aTextRotateAngle ); + pObjCustomShape->SetMergedItem( aGeometryItem ); } eWriteMode = csst::WritingMode_TB_RL; switch( maTextData.maData.GetHorAlign() ) -- cgit v1.2.3 From 37375c0464d0912ea7b173a99f9cbbc47bd93de4 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 18 Jan 2010 15:37:42 +0000 Subject: s390xport02: #i108410# different results for s390x --- basegfx/test/basegfx2d.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/basegfx/test/basegfx2d.cxx b/basegfx/test/basegfx2d.cxx index 1bd15702e143..61c02e8ccdd2 100644 --- a/basegfx/test/basegfx2d.cxx +++ b/basegfx/test/basegfx2d.cxx @@ -490,7 +490,12 @@ public: // fTools::equal, linux and mac produce more 'C' than 'S' statements, while WIN32 // uses more 'S' statements (as it should be for circles) CPPUNIT_ASSERT_MESSAGE("exporting to circle does not produce the expected number of coordinates", - nCount==67 || nCount==50); +#ifdef S390X + nCount==61 +#else + nCount==67 || nCount==50 +#endif + ); const B2DPolygon aRect( tools::createPolygonFromRect( B2DRange(0.0,0.0,4000.0,4000.0) )); -- cgit v1.2.3 From d57ab8fc9b140e60cbc5999a75a59c4575151dcd Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Mon, 18 Jan 2010 16:48:07 +0100 Subject: #i106830# - Fixed Solaris build breaker (compiler warning). --- ucb/source/ucp/webdav/NeonSession.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/ucb/source/ucp/webdav/NeonSession.cxx b/ucb/source/ucp/webdav/NeonSession.cxx index db8b69625f3c..78f351f88f77 100644 --- a/ucb/source/ucp/webdav/NeonSession.cxx +++ b/ucb/source/ucp/webdav/NeonSession.cxx @@ -1482,7 +1482,6 @@ void NeonSession::LOCK( const ::rtl::OUString & inPath, break; default: throw DAVException( DAVException::DAV_INVALID_ARG ); - break; } // Set the lock timeout -- cgit v1.2.3 From 43d361521cf304792a3bc6fe41def014bec0cab7 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 19 Jan 2010 11:25:34 +0000 Subject: s390xport02: #i108410# argh\!, 64, not 32 in s390x --- bridges/source/cpp_uno/gcc3_linux_s390/except.cxx | 6 +++--- bridges/source/cpp_uno/gcc3_linux_s390x/cpp2uno.cxx | 2 +- bridges/source/cpp_uno/gcc3_linux_s390x/except.cxx | 6 +++--- bridges/source/cpp_uno/gcc3_linux_s390x/uno2cpp.cxx | 2 -- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/bridges/source/cpp_uno/gcc3_linux_s390/except.cxx b/bridges/source/cpp_uno/gcc3_linux_s390/except.cxx index 0d49d0b95a74..eaf9566c54b9 100644 --- a/bridges/source/cpp_uno/gcc3_linux_s390/except.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_s390/except.cxx @@ -137,8 +137,8 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR OUString const & unoName = *(OUString const *)&pTypeDescr->aBase.pTypeName; MutexGuard guard( m_mutex ); - t_rtti_map::const_iterator iFind( m_rttis.find( unoName ) ); - if (iFind == m_rttis.end()) + t_rtti_map::const_iterator iRttiFind( m_rttis.find( unoName ) ); + if (iRttiFind == m_rttis.end()) { // RTTI symbol OStringBuffer buf( 64 ); @@ -202,7 +202,7 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR } else { - rtti = iFind->second; + rtti = iRttiFind->second; } return rtti; diff --git a/bridges/source/cpp_uno/gcc3_linux_s390x/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_s390x/cpp2uno.cxx index 4cb95f9faf76..7e169993e905 100644 --- a/bridges/source/cpp_uno/gcc3_linux_s390x/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_s390x/cpp2uno.cxx @@ -491,7 +491,7 @@ static typelib_TypeClass cpp_mediate( long privateSnippetExecutor(long r2, long r3, long r4, long r5, long r6, long firstonstack) { register long r0 asm("r0"); - sal_uInt32 nOffsetAndIndex = r0; + sal_uInt64 nOffsetAndIndex = r0; long sp = (long)&firstonstack; diff --git a/bridges/source/cpp_uno/gcc3_linux_s390x/except.cxx b/bridges/source/cpp_uno/gcc3_linux_s390x/except.cxx index e474dce7268c..11ddfbb424e2 100644 --- a/bridges/source/cpp_uno/gcc3_linux_s390x/except.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_s390x/except.cxx @@ -138,8 +138,8 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR OUString const & unoName = *(OUString const *)&pTypeDescr->aBase.pTypeName; MutexGuard guard( m_mutex ); - t_rtti_map::const_iterator iFind( m_rttis.find( unoName ) ); - if (iFind == m_rttis.end()) + t_rtti_map::const_iterator iRttiFind( m_rttis.find( unoName ) ); + if (iRttiFind == m_rttis.end()) { // RTTI symbol OStringBuffer buf( 64 ); @@ -203,7 +203,7 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR } else { - rtti = iFind->second; + rtti = iRttiFind->second; } return rtti; diff --git a/bridges/source/cpp_uno/gcc3_linux_s390x/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_s390x/uno2cpp.cxx index cd922c2fa870..2b85eb125d59 100644 --- a/bridges/source/cpp_uno/gcc3_linux_s390x/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_s390x/uno2cpp.cxx @@ -92,7 +92,6 @@ void MapReturn(long r2, double f0, typelib_TypeClass eTypeClass, sal_uInt64* pRe #define INSERT_FLOAT( pSV, nr, pFPR, pDS ) \ { \ - float tmp = *reinterpret_cast( pSV ); \ if ( nr < s390x::MAX_SSE_REGS ) \ { \ pFPR[nr++] = *reinterpret_cast( pSV ); \ @@ -423,7 +422,6 @@ void unoInterfaceProxyDispatch( // is my surrogate bridges::cpp_uno::shared::UnoInterfaceProxy * pThis = static_cast< bridges::cpp_uno::shared::UnoInterfaceProxy *> (pUnoI); - typelib_InterfaceTypeDescription * pTypeDescr = pThis->pTypeDescr; switch (pMemberDescr->eTypeClass) { -- cgit v1.2.3 From d8aa5dfaa29bb4113bc78106edc2a77f7bb859dd Mon Sep 17 00:00:00 2001 From: Vladimir Glazunov Date: Wed, 20 Jan 2010 14:21:58 +0100 Subject: #i107041# use user defined SOURCE_ROOT as default hg_root --- solenv/bin/modules/SourceConfig.pm | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/solenv/bin/modules/SourceConfig.pm b/solenv/bin/modules/SourceConfig.pm index 31ebb8193ea9..67bb540acb9f 100644 --- a/solenv/bin/modules/SourceConfig.pm +++ b/solenv/bin/modules/SourceConfig.pm @@ -216,6 +216,8 @@ sub get_config_file { }; sub get_hg_root { + my $self = shift; + return $self->{USER_SOURCE_ROOT} if (defined $self->{USER_SOURCE_ROOT}); my $hg_root; if (open(COMMAND, "hg root 2>&1 |")) { foreach () { @@ -236,12 +238,7 @@ sub get_hg_root { sub read_config_file { my $self = shift; if (!$self->{SOURCE_CONFIG_FILE}) { - my $repository_root; - if (defined $self->{USER_SOURCE_ROOT}) { - $repository_root = $self->{USER_SOURCE_ROOT}; - } else { - $repository_root = get_hg_root(); - }; + my $repository_root = get_hg_root($self); ${$self->{REPOSITORIES}}{File::Basename::basename($repository_root)} = $repository_root; return; }; @@ -281,7 +278,7 @@ sub read_config_file { close SOURCE_CONFIG_FILE; if (!scalar keys %{$self->{REPOSITORIES}}) { # Fallback - default repository is the directory where is our module... - my $hg_root = get_hg_root(); + my $hg_root = get_hg_root($self); ${$self->{REPOSITORIES}}{File::Basename::basename($hg_root)} = $hg_root; }; } else { -- cgit v1.2.3 From a4bcd82d3aebaa856b11ba92571e79ea6aab5775 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Wed, 20 Jan 2010 14:49:00 +0100 Subject: dba33d: #i106772# cut decimal and numeric when greater than scale allows to be --- dbaccess/source/core/api/KeySet.cxx | 43 +++++++++++++++++++++---------------- dbaccess/source/core/api/KeySet.hxx | 2 ++ 2 files changed, 27 insertions(+), 18 deletions(-) diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx index 474ad8a38b65..4f6c15d22798 100644 --- a/dbaccess/source/core/api/KeySet.cxx +++ b/dbaccess/source/core/api/KeySet.cxx @@ -594,6 +594,7 @@ void SAL_CALL OKeySet::updateRow(const ORowSetRow& _rInsertRow ,const ORowSetRow sal_Int32 nPos = aIter->second.nPosition; if((_rInsertRow->get())[nPos].isModified()) { + impl_convertValue_throw(_rInsertRow,aIter->second); (_rInsertRow->get())[nPos].setSigned((_rOrginalRow->get())[nPos].isSigned()); setParameter(i++,xParameter,(_rInsertRow->get())[nPos],aIter->second.nType,aIter->second.nScale); } @@ -676,6 +677,7 @@ void SAL_CALL OKeySet::insertRow( const ORowSetRow& _rInsertRow,const connectivi xParameter->setNull(i++,(_rInsertRow->get())[nPos].getTypeKind()); else { + impl_convertValue_throw(_rInsertRow,aIter->second); (_rInsertRow->get())[nPos].setSigned(m_aSignedFlags[nPos-1]); setParameter(i++,xParameter,(_rInsertRow->get())[nPos],aIter->second.nType,aIter->second.nScale); } @@ -802,24 +804,7 @@ void OKeySet::copyRowValue(const ORowSetRow& _rInsertRow,ORowSetRow& _rKeyRow) SelectColumnsMetaData::const_iterator aPosEnd = (*m_pKeyColumnNames).end(); for(;aPosIter != aPosEnd;++aPosIter,++aIter) { - ORowSetValue aValue((_rInsertRow->get())[aPosIter->second.nPosition]); - switch(aPosIter->second.nType) - { - case DataType::DECIMAL: - case DataType::NUMERIC: - { - ::rtl::OUString sValue = aValue.getString(); - sal_Int32 nIndex = sValue.indexOf('.'); - if ( nIndex != -1 ) - { - aValue = sValue.copy(0,nIndex + (aPosIter->second.nScale > 0 ? aPosIter->second.nScale + 1 : 0)); - } - } - break; - default: - break; - } - *aIter = aValue; + *aIter = (_rInsertRow->get())[aPosIter->second.nPosition]; aIter->setTypeKind(aPosIter->second.nType); } } @@ -1477,3 +1462,25 @@ namespace dbaccess } } } +// ----------------------------------------------------------------------------- +void OKeySet::impl_convertValue_throw(const ORowSetRow& _rInsertRow,const SelectColumnDescription& i_aMetaData) +{ + ORowSetValue& aValue((_rInsertRow->get())[i_aMetaData.nPosition]); + switch(i_aMetaData.nType) + { + case DataType::DECIMAL: + case DataType::NUMERIC: + { + ::rtl::OUString sValue = aValue.getString(); + sal_Int32 nIndex = sValue.indexOf('.'); + if ( nIndex != -1 ) + { + aValue = sValue.copy(0,nIndex + (i_aMetaData.nScale > 0 ? i_aMetaData.nScale + 1 : 0)); + } + } + break; + default: + break; + } +} +// ----------------------------------------------------------------------------- diff --git a/dbaccess/source/core/api/KeySet.hxx b/dbaccess/source/core/api/KeySet.hxx index 7a213d05b466..3a73487c2c3d 100644 --- a/dbaccess/source/core/api/KeySet.hxx +++ b/dbaccess/source/core/api/KeySet.hxx @@ -134,6 +134,8 @@ namespace dbaccess ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > getKeyColumns() const; void fillAllRows(); sal_Bool fetchRow(); + + void impl_convertValue_throw(const ORowSetRow& _rInsertRow,const SelectColumnDescription& i_aMetaData); protected: virtual ~OKeySet(); public: -- cgit v1.2.3 From 85bd4fb7e1db9d02ab9801afcd7e45381ae6a787 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Wed, 20 Jan 2010 16:59:56 +0100 Subject: swunolocking1: #i108489#: fix crash: XTextRangeToSwPaM(): do not prematurely release newly created text cursor. SwXTextViewCursor::gotoRange(): do not throw IllegalArgumentException. --- sw/source/core/unocore/unoobj2.cxx | 7 ++++--- sw/source/ui/uno/unotxvw.cxx | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index 90d8c7538a0d..8f6c3c3340d1 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -1160,10 +1160,11 @@ bool XTextRangeToSwPaM( SwUnoInternalPaM & rToFill, // if it's a text then create a temporary cursor there and re-use // the pCursor variable - if(pText) + // #i108489#: Reference in outside scope to keep cursor alive + uno::Reference< text::XTextCursor > xTextCursor; + if (pText) { - const uno::Reference< text::XTextCursor > xTextCursor = - pText->CreateCursor(); + xTextCursor.set( pText->CreateCursor() ); xTextCursor->gotoEnd(sal_True); const uno::Reference xCrsrTunnel( xTextCursor, uno::UNO_QUERY); diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx index c83db6909045..4ce45761485b 100644 --- a/sw/source/ui/uno/unotxvw.cxx +++ b/sw/source/ui/uno/unotxvw.cxx @@ -1364,7 +1364,9 @@ void SwXTextViewCursor::gotoRange( SwUnoInternalPaM rDestPam(*m_pView->GetDocShell()->GetDoc()); if (!::sw::XTextRangeToSwPaM(rDestPam, xRange)) - throw IllegalArgumentException(); + { + throw uno::RuntimeException(); + } ShellModes eSelMode = m_pView->GetShellMode(); SwWrtShell& rSh = m_pView->GetWrtShell(); -- cgit v1.2.3 From 6b654608285809ed2f754987f94728c3870d25e3 Mon Sep 17 00:00:00 2001 From: "Ocke Janssen [oj]" Date: Thu, 21 Jan 2010 08:32:46 +0100 Subject: dba33d: #i108517# order of checks changed --- dbaccess/source/core/api/RowSet.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx index 8d15ba24604e..5a3514d65f23 100644 --- a/dbaccess/source/core/api/RowSet.cxx +++ b/dbaccess/source/core/api/RowSet.cxx @@ -2652,8 +2652,8 @@ void ORowSet::checkUpdateIterator() void ORowSet::checkUpdateConditions(sal_Int32 columnIndex) { checkCache(); - if ( columnIndex <= 0 || sal_Int32((*m_aCurrentRow)->get().size()) <= columnIndex ) - ::dbtools::throwSQLException( DBACORE_RESSTRING( RID_STR_INVALID_INDEX ), SQL_INVALID_DESCRIPTOR_INDEX, *this ); + if ( m_nResultSetConcurrency == ResultSetConcurrency::READ_ONLY) + ::dbtools::throwSQLException( DBACORE_RESSTRING( RID_STR_RESULT_IS_READONLY ), SQL_GENERAL_ERROR, *this ); if ( rowDeleted() ) ::dbtools::throwSQLException( DBACORE_RESSTRING( RID_STR_ROW_ALREADY_DELETED ), SQL_INVALID_CURSOR_POSITION, *this ); @@ -2661,8 +2661,8 @@ void ORowSet::checkUpdateConditions(sal_Int32 columnIndex) if ( m_aCurrentRow.isNull() ) ::dbtools::throwSQLException( DBACORE_RESSTRING( RID_STR_INVALID_CURSOR_STATE ), SQL_INVALID_CURSOR_STATE, *this ); - if ( m_nResultSetConcurrency == ResultSetConcurrency::READ_ONLY) - ::dbtools::throwSQLException( DBACORE_RESSTRING( RID_STR_RESULT_IS_READONLY ), SQL_GENERAL_ERROR, *this ); + if ( columnIndex <= 0 || sal_Int32((*m_aCurrentRow)->get().size()) <= columnIndex ) + ::dbtools::throwSQLException( DBACORE_RESSTRING( RID_STR_INVALID_INDEX ), SQL_INVALID_DESCRIPTOR_INDEX, *this ); } // ----------------------------------------------------------------------------- void SAL_CALL ORowSet::refreshRow( ) throw(SQLException, RuntimeException) -- cgit v1.2.3 From 853497c4a7d7a481235569ab59b511f63e1051fa Mon Sep 17 00:00:00 2001 From: Frank Schönheit Date: Thu, 21 Jan 2010 07:52:26 +0000 Subject: reverting the fix for #i108325#, which caused #i108423#. Adding another, less invasive workaround. Still not the final solution, which is covered by issue 108357 --- drawinglayer/source/processor2d/vclpixelprocessor2d.cxx | 6 ------ svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx index 92420fb6da3a..bb7635913dce 100644 --- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx @@ -373,12 +373,6 @@ namespace drawinglayer aOrigin.X() + basegfx::fround(aTopLeftPixel.getX()), aOrigin.Y() + basegfx::fround(aTopLeftPixel.getY())); } - else if( xControlWindow.is() ) - { - Window* pWin = VCLUnoHelper::GetWindow( rXControl->getPeer() ); - if( pWin ) - pWin->Invalidate(); - } // restore original graphics xControlView->setGraphics(xOriginalGraphics); diff --git a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx index 5f7bf41386e0..81d19df1e2fa 100644 --- a/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx @@ -238,6 +238,8 @@ namespace sdr { namespace contact { getGraphics() const { return m_xControlView->getGraphics(); } inline void draw( const Point& _rTopLeft ) const { m_xControlView->draw( _rTopLeft.X(), _rTopLeft.Y() ); } + void invalidate() const; + public: inline const Reference< XControl >& getControl() const { return m_xControl; } }; @@ -297,6 +299,15 @@ namespace sdr { namespace contact { m_xControlView->setZoom( (float)_rScale.getX(), (float)_rScale.getY() ); } + //-------------------------------------------------------------------- + void ControlHolder::invalidate() const + { + Window* pWindow = VCLUnoHelper::GetWindow( m_xControl->getPeer() ); + OSL_ENSURE( pWindow, "ControlHolder::invalidate: no implementation access!" ); + if ( pWindow ) + pWindow->Invalidate(); + } + //-------------------------------------------------------------------- ::basegfx::B2DVector ControlHolder::getZoom() const { @@ -1666,6 +1677,8 @@ namespace sdr { namespace contact { double fRotate, fShearX; _rViewInformation.getObjectToViewTransformation().decompose( aScale, aTranslate, fRotate, fShearX ); #endif + const bool bHadControl = m_pVOCImpl->getExistentControl().is(); + // force control here to make it a VCL ChildWindow. Will be fetched // and used below by getExistentControl() m_pVOCImpl->ensureControl( &_rViewInformation.getObjectToViewTransformation() ); @@ -1676,6 +1689,9 @@ namespace sdr { namespace contact { Reference< XControlModel > xControlModel( rViewContactOfUnoControl.GetSdrUnoObj().GetUnoControlModel() ); const ControlHolder& rControl( m_pVOCImpl->getExistentControl() ); + if ( !bHadControl && rControl.is() && rControl.isVisible() ) + rControl.invalidate(); + // check if we already have an XControl. if ( !xControlModel.is() || !rControl.is() ) // use the default mechanism. This will create a ControlPrimitive2D without -- cgit v1.2.3 From ea62ada1ce0c04388de528a21f1e5d2edfab0fcf Mon Sep 17 00:00:00 2001 From: Frank Schönheit Date: Thu, 21 Jan 2010 07:54:11 +0000 Subject: copying nn's fix from CWS dba321a herein, original commit comment: #i108488# #i108512# don't remove SC_MF_SCENARIO in ScAttrArray::InsertRow, block-wise skipping in zip stream --- sc/source/core/data/attarray.cxx | 3 ++- sc/source/filter/xml/xmlexprt.cxx | 22 +++++++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx index 590f278901d6..a4875ba4d1e3 100644 --- a/sc/source/core/data/attarray.cxx +++ b/sc/source/core/data/attarray.cxx @@ -2117,7 +2117,8 @@ void ScAttrArray::InsertRow( SCROW nStartRow, SCSIZE nSize ) } // Don't duplicate the merge flags in the inserted row. - RemoveFlags( nStartRow, nStartRow+nSize-1, SC_MF_ALL ); + // #i108488# SC_MF_SCENARIO has to be allowed. + RemoveFlags( nStartRow, nStartRow+nSize-1, SC_MF_HOR | SC_MF_VER | SC_MF_AUTO | SC_MF_BUTTON ); } diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 94613379a32d..c2fd53acb736 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -1575,6 +1575,26 @@ static bool lcl_CopyStreamElement( const uno::Reference< io::XInputStream >& xIn return true; // successful } +static void lcl_SkipBytesInBlocks( const uno::Reference< io::XInputStream >& xInput, sal_Int32 nBytesToSkip ) +{ + // skipBytes in zip stream is implemented as reading. + // For now, split into several calls to avoid allocating a large buffer. + // Later, skipBytes should be changed. + + const sal_Int32 nMaxSize = 32*1024; + + if ( nBytesToSkip > 0 ) + { + sal_Int32 nRemaining = nBytesToSkip; + while ( nRemaining > 0 ) + { + sal_Int32 nSkip = std::min( nRemaining, nMaxSize ); + xInput->skipBytes( nSkip ); + nRemaining -= nSkip; + } + } +} + void ScXMLExport::CopySourceStream( sal_Int32 nStartOffset, sal_Int32 nEndOffset, sal_Int32& rNewStart, sal_Int32& rNewEnd ) { uno::Reference xHandler = GetDocHandler(); @@ -1598,7 +1618,7 @@ void ScXMLExport::CopySourceStream( sal_Int32 nStartOffset, sal_Int32 nEndOffset rNewStart = (sal_Int32)xDestSeek->getPosition(); if ( nStartOffset > nSourceStreamPos ) - xSourceStream->skipBytes( nStartOffset - nSourceStreamPos ); + lcl_SkipBytesInBlocks( xSourceStream, nStartOffset - nSourceStreamPos ); if ( !lcl_CopyStreamElement( xSourceStream, xDestStream, nEndOffset - nStartOffset ) ) { -- cgit v1.2.3 From b532272a17f8c0ba953a9c77590458521c3ba8f5 Mon Sep 17 00:00:00 2001 From: thb Date: Thu, 21 Jan 2010 11:30:03 +0100 Subject: #i10000# WaE: dummy-use extra parameter --- slideshow/source/engine/shapes/shapeimporter.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/slideshow/source/engine/shapes/shapeimporter.cxx b/slideshow/source/engine/shapes/shapeimporter.cxx index 98bda086286a..a524aa697935 100644 --- a/slideshow/source/engine/shapes/shapeimporter.cxx +++ b/slideshow/source/engine/shapes/shapeimporter.cxx @@ -661,6 +661,9 @@ ShapeImporter::ShapeImporter( uno::Reference const& mnAscendingPrio( nOrdNumStart ), mbConvertingMasterPage( bConvertingMasterPage ) { +#ifndef ENABLE_PRESENTER_EXTRA_UI + (void)xPagesSupplier; +#endif uno::Reference const xShapes( xPage, uno::UNO_QUERY_THROW ); maShapesStack.push( XShapesEntry(xShapes) ); -- cgit v1.2.3 From 420538a137f8c2e9c2c8d6351b05d958f9e0e677 Mon Sep 17 00:00:00 2001 From: Vladimir Glazunov Date: Thu, 21 Jan 2010 13:31:40 +0100 Subject: #i107041# Error when active modules are not in the active repositories --- solenv/bin/modules/SourceConfig.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/solenv/bin/modules/SourceConfig.pm b/solenv/bin/modules/SourceConfig.pm index 67bb540acb9f..5c8dc89a641c 100644 --- a/solenv/bin/modules/SourceConfig.pm +++ b/solenv/bin/modules/SourceConfig.pm @@ -205,6 +205,11 @@ sub get_module_paths { croak("Cannot read $_ repository content"); }; }; + my @false_actives = (); + foreach (keys %{$self->{ACTIVATED_MODULES}}) { + push(@false_actives, $_) if (!defined ${$self->{MODULE_PATHS}}{$_}); + }; + croak("Error!! Activated module(s): @false_actives\nnot found in the active repositories!! Please check your " . $self->{SOURCE_CONFIG_FILE} . "\n") if (scalar @false_actives); croak("No modules found!") if (!scalar keys %{$self->{MODULE_PATHS}}); }; -- cgit v1.2.3 From f97686f0876e965d0e600c1d29758c21057dffe4 Mon Sep 17 00:00:00 2001 From: Mikhail Voitenko Date: Fri, 22 Jan 2010 08:25:03 +0000 Subject: #i108559# copy empty file correctly --- sal/osl/unx/file_misc.cxx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sal/osl/unx/file_misc.cxx b/sal/osl/unx/file_misc.cxx index 0bde1616f6ae..b1a3f39ddf81 100644 --- a/sal/osl/unx/file_misc.cxx +++ b/sal/osl/unx/file_misc.cxx @@ -1013,6 +1013,15 @@ static int oslDoCopyFile(const sal_Char* pszSourceFileName, const sal_Char* pszD return nRet; } + DestFileFD=open(pszDestFileName, O_WRONLY | O_CREAT, mode); + + if ( DestFileFD < 0 ) + { + nRet=errno; + close(SourceFileFD); + return nRet; + } + /* HACK: because memory mapping fails on various platforms if the size of the source file is 0 byte */ if (0 == nSourceSize) @@ -1034,15 +1043,6 @@ static int oslDoCopyFile(const sal_Char* pszSourceFileName, const sal_Char* pszD return nRet; } - DestFileFD=open(pszDestFileName, O_WRONLY | O_CREAT, mode); - - if ( DestFileFD < 0 ) - { - nRet=errno; - close(SourceFileFD); - return nRet; - } - size_t nWritten = 0; size_t nRemains = nSourceSize; -- cgit v1.2.3 From f3448fafc37127cf89025f6293e8b18b8909b99e Mon Sep 17 00:00:00 2001 From: Mikhail Voitenko Date: Fri, 22 Jan 2010 08:34:57 +0000 Subject: #i108559# copy empty file correctly --- sal/osl/unx/file_misc.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sal/osl/unx/file_misc.cxx b/sal/osl/unx/file_misc.cxx index b1a3f39ddf81..7d797c2be226 100644 --- a/sal/osl/unx/file_misc.cxx +++ b/sal/osl/unx/file_misc.cxx @@ -1039,7 +1039,8 @@ static int oslDoCopyFile(const sal_Char* pszSourceFileName, const sal_Char* pszD || -1 == lseek( SourceFileFD, 0, SEEK_SET ) ) { nRet = errno; - (void) close( SourceFileFD ); + close( SourceFileFD ); + close( DestFileFD ); return nRet; } -- cgit v1.2.3 From 154463ac8c2cdf76a57fefcc13a310f3a7eff794 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Fri, 22 Jan 2010 18:50:33 +0100 Subject: cws l10ntools: #i107386# #i107993# #ii107992# #i107991# #i108587# Added some buildtypes , fix for broken localize_sl regarding UPDMINOREXT , pmladeks localize.pl ooo enforcer patch --- solenv/bin/localize | 4 ++-- solenv/bin/localize_sl | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100755 solenv/bin/localize_sl diff --git a/solenv/bin/localize b/solenv/bin/localize index 74a75ecc3aee..e14b149226b5 100755 --- a/solenv/bin/localize +++ b/solenv/bin/localize @@ -12,9 +12,9 @@ else export LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${SOLARVERSION?}/${INPATH?}/lib${UPDMINOREXT} fi -if [ x${SOLARVER}x = xx -o x${UPDMINOR}x = xx ]; then +if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then exec perl -w $SOLARVERSION/$INPATH/bin/localize.pl "$@" else - exec perl -w $SOLARVERSION/$INPATH/bin.$UPDMINOR/localize.pl "$@" + exec perl -w $SOLARVERSION/$INPATH/bin$UPDMINOREXT/localize.pl "$@" fi diff --git a/solenv/bin/localize_sl b/solenv/bin/localize_sl new file mode 100755 index 000000000000..df8205cf6d22 --- /dev/null +++ b/solenv/bin/localize_sl @@ -0,0 +1,18 @@ +#!/bin/sh +if [ x${SOLARENV}x = xx ]; then + echo No environment found, please use 'setsolar' +exit 1 +fi + +if [ "${OS?}" = MACOSX ]; then + export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH+${DYLD_LIBRARY_PATH}:}${SOLARVERSION?}/${INPATH?}/lib${UPDMINOREXT} +else + export LD_LIBRARY_PATH=${LD_LIBRARY_PATH+${LD_LIBRARY_PATH}:}${SOLARVERSION?}/${INPATH?}/lib${UPDMINOREXT} +fi + +if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx ]; then + exec $SOLARVERSION/$INPATH/bin/localize_sl "$@" +else + exec $SOLARVERSION/$INPATH/bin$UPDMINOREXT/localize_sl "$@" +fi + -- cgit v1.2.3 From 54311d2499a8502ea3a827347992c2f4d6e40d31 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Fri, 22 Jan 2010 18:50:33 +0100 Subject: cws l10ntools: #i107386# #i107993# #ii107992# #i107991# #i108587# Added some buildtypes , fix for broken localize_sl regarding UPDMINOREXT , pmladeks localize.pl ooo enforcer patch --- transex3/prj/build.lst | 2 +- transex3/scripts/localize.pl | 13 ++++++++++--- transex3/source/localize.cxx | 17 ++++++++++++++++- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/transex3/prj/build.lst b/transex3/prj/build.lst index 0017471af134..685686192daf 100644 --- a/transex3/prj/build.lst +++ b/transex3/prj/build.lst @@ -1,4 +1,4 @@ -tr transex3 : tools libxslt berkeleydb LUCENE:lucene NULL +tr transex3 : tools LIBXSLT:libxslt BERKELEYDB:berkeleydb LUCENE:lucene NULL tr transex3 usr1 - all tr_mkout NULL tr transex3\inc nmake - all tr_inc NULL tr transex3\source nmake - all tr_src tr_inc NULL diff --git a/transex3/scripts/localize.pl b/transex3/scripts/localize.pl index 10e8124027b1..0f6a19effc38 100755 --- a/transex3/scripts/localize.pl +++ b/transex3/scripts/localize.pl @@ -78,6 +78,7 @@ my $WIN; my $languages; #my %sl_modules; # Contains all modules where en-US and de is source language my $use_default_date = '0'; +my $force_ooo_module = '0'; my %is_ooo_module; my %is_so_module; my $DELIMITER; @@ -275,7 +276,7 @@ sub check_modules_scm sub is_openoffice_module { my $module = shift; - return "TRUE", if defined $is_ooo_module{ $module }; + return "TRUE", if ( $force_ooo_module || defined $is_ooo_module{ $module } ); return ""; } @@ -1114,7 +1115,7 @@ sub parse_options{ my $extract; my $success = GetOptions('f=s' => \$sdffile , 'l=s' => \$languages , 's=s' => \$srcpath , 'h' => \$help , 'v' => \$bVerbose , 'm' => \$merge , 'e' => \$extract , 'x' => \$no_sort , 'd' => \$use_default_date , 'c' => \$create_dirs , - 'n' => \$no_gsicheck ); + 'n' => \$no_gsicheck , 'o' => \$force_ooo_module ); $outputfile = $sdffile; #print STDOUT "DBG: lang = $languages\n"; @@ -1126,7 +1127,11 @@ sub parse_options{ exit(1); } } - if( $help || !$success || $#ARGV > 1 || ( !$sdffile ) ){ + if( $help ){ + usage(); + exit(0); + } + if( !$success || $#ARGV > 1 || ( !$sdffile ) ){ usage(); exit(1); } @@ -1167,6 +1172,8 @@ sub usage{ print STDERR " -h File with localize.sdf's\n!"; print STDERR " -n No gsicheck\n"; print STDERR " -i Module to merge\n"; + print STDERR " -o force using ooo localization from the l10n module instead of l10n_so; \n"; + print STDERR " useful if the type can't be detected by the .svn tags; \n"; print STDERR " -v Verbose\n"; print STDERR "\nExample:\n"; print STDERR "\nlocalize -e -l en-US,pt-BR=en-US -f my.sdf\n( Extract en-US and pt-BR with en-US fallback )\n"; diff --git a/transex3/source/localize.cxx b/transex3/source/localize.cxx index c82d152cac7e..e23165ee657c 100644 --- a/transex3/source/localize.cxx +++ b/transex3/source/localize.cxx @@ -938,10 +938,25 @@ int _cdecl main( int argc, char *argv[] ) bool hasPwd = treeconfig.getActiveRepositories( repos ); if( hasPwd ) cout << "Found special path!\n"; + string minor_ext; + bool has_minor_ext; + + if( Export::GetEnv("UPDMINOREXT") != NULL ) + { + minor_ext = string( Export::GetEnv("UPDMINOREXT") ); + has_minor_ext = minor_ext.size(); + } + else + has_minor_ext = false; + // localize through all repositories for( vector::iterator iter = repos.begin(); iter != repos.end() ; ++iter ) { - string curRepository = string( Export::GetEnv("SOURCE_ROOT_DIR") ) + "/" + *iter; + string curRepository; + if( has_minor_ext ) + curRepository = string( Export::GetEnv("SOURCE_ROOT_DIR") ) + "/" + *iter + minor_ext; + else + curRepository = string( Export::GetEnv("SOURCE_ROOT_DIR") ) + "/" + *iter; cout << "Localizing repository " << curRepository << "\n"; SourceTreeLocalizer aIter( ByteString( curRepository.c_str() ) , sVersion , (sOutput.Len() > 0) , bQuiet2 , bSkipLinks ); aIter.SetLanguageRestriction( sLanguages ); -- cgit v1.2.3 From efc5727b1ae910f678a355ce075c766af2a0554d Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Fri, 22 Jan 2010 18:50:33 +0100 Subject: cws l10ntools: #i107386# #i107993# #ii107992# #i107991# #i108587# Added some buildtypes , fix for broken localize_sl regarding UPDMINOREXT , pmladeks localize.pl ooo enforcer patch --- lingucomponent/prj/build.lst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lingucomponent/prj/build.lst b/lingucomponent/prj/build.lst index 65e8459bea3f..138e5858f70e 100644 --- a/lingucomponent/prj/build.lst +++ b/lingucomponent/prj/build.lst @@ -1,4 +1,4 @@ -lc lingucomponent : linguistic libtextcat svl hyphen HUNSPELL:hunspell NULL +lc lingucomponent : linguistic libtextcat svl HYPHEN:hyphen HUNSPELL:hunspell NULL lc lingucomponent usr1 - all lc_mkout NULL lc lingucomponent\inc nmake - all lc_inc NULL lc lingucomponent\source\lingutil nmake - all lc_util lc_inc NULL -- cgit v1.2.3 From 43a7c90bdbacb767b8a9efe4c4d5ac22b0f8b6a5 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Fri, 22 Jan 2010 18:50:33 +0100 Subject: cws l10ntools: #i107386# #i107993# #ii107992# #i107991# #i108587# Added some buildtypes , fix for broken localize_sl regarding UPDMINOREXT , pmladeks localize.pl ooo enforcer patch --- cairo/prj/build.lst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cairo/prj/build.lst b/cairo/prj/build.lst index 6f45aedc4047..c531e6c0ffb9 100644 --- a/cairo/prj/build.lst +++ b/cairo/prj/build.lst @@ -1,4 +1,4 @@ -lcairo cairo : zlib soltools NULL +lcairo cairo : ZLIB:zlib soltools NULL lcairo cairo usr1 - all lcairo_mkout NULL lcairo cairo\pixman nmake - all lcairo_pixman NULL lcairo cairo\cairo nmake - all lcairo_cairo lcairo_pixman NULL -- cgit v1.2.3 From 35933081fda3551db61a81c9af5ac393fb5fc80e Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 22 Jan 2010 19:07:50 +0100 Subject: swunolocking1: fix regression: SwXParagraphEnumeration constructor really needs the start node as a parameter because determining it from the cursor cannot work in nested tables. --- sw/inc/unoparagraph.hxx | 6 ++++- sw/source/core/unocore/unoobj.cxx | 8 ++++++- sw/source/core/unocore/unoobj2.cxx | 45 ++++++++++---------------------------- sw/source/core/unocore/unotbl.cxx | 6 ++++- 4 files changed, 29 insertions(+), 36 deletions(-) diff --git a/sw/inc/unoparagraph.hxx b/sw/inc/unoparagraph.hxx index add936e9c702..8743737c338e 100644 --- a/sw/inc/unoparagraph.hxx +++ b/sw/inc/unoparagraph.hxx @@ -55,7 +55,9 @@ struct SwPosition; class SwPaM; class SwUnoCrsr; +class SwStartNode; class SwTxtNode; +class SwTable; class SwXText; @@ -339,7 +341,9 @@ public: ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > const & xParent, ::std::auto_ptr pCursor, - const CursorType eType); + const CursorType eType, + SwStartNode const*const pStartNode = 0, + SwTable const*const pTable = 0); // XServiceInfo virtual ::rtl::OUString SAL_CALL getImplementationName() diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx index e1601dcbcad1..1e8eea9392f0 100644 --- a/sw/source/core/unocore/unoobj.cxx +++ b/sw/source/core/unocore/unoobj.cxx @@ -3157,8 +3157,14 @@ SwXTextCursor::createEnumeration() throw (uno::RuntimeException) } const CursorType eSetType = (CURSOR_TBLTEXT == m_pImpl->m_eType) ? CURSOR_SELECTION_IN_TABLE : CURSOR_SELECTION; + SwTableNode const*const pStartNode( (CURSOR_TBLTEXT == m_pImpl->m_eType) + ? rUnoCursor.GetPoint()->nNode.GetNode().FindTableNode() + : 0); + SwTable const*const pTable( + (pStartNode) ? & pStartNode->GetTable() : 0 ); const uno::Reference< container::XEnumeration > xRet = - new SwXParagraphEnumeration(pParentText, pNewCrsr, eSetType); + new SwXParagraphEnumeration( + pParentText, pNewCrsr, eSetType, pStartNode, pTable); return xRet; } diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index 8f6c3c3340d1..f4935586efaf 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -468,34 +468,6 @@ void SwUnoCursorHelper::GetCrsrAttr(SwPaM & rPam, * SwXParagraphEnumeration ******************************************************************/ -static SwStartNode * -lcl_InitStartNode(const CursorType eType, SwUnoCrsr *const pCursor) -{ - switch (eType) - { - case CURSOR_TBLTEXT: // table cell: pCursor points at first paragraph - return pCursor->Start()->nNode.GetNode().StartOfSectionNode(); - case CURSOR_SELECTION_IN_TABLE: // table - return pCursor->Start()->nNode.GetNode().FindTableNode(); - default: - return 0; - } -} - -static SwTable const* -lcl_InitTable(const CursorType eType, SwStartNode const*const pStartNode) -{ - switch (eType) - { - case CURSOR_TBLTEXT: // table cell - return & pStartNode->FindTableNode()->GetTable(); - case CURSOR_SELECTION_IN_TABLE: // table - return & static_cast(pStartNode)->GetTable(); - default: - return 0; - } -} - class SwXParagraphEnumeration::Impl : public SwClient { @@ -517,16 +489,17 @@ public: Impl( uno::Reference< text::XText > const& xParent, ::std::auto_ptr pCursor, - const CursorType eType) + const CursorType eType, + SwStartNode const*const pStartNode, SwTable const*const pTable) : SwClient( pCursor.release() ) , m_xParentText( xParent ) , m_eCursorType( eType ) // remember table and start node for later travelling // (used in export of tables in tables) - , m_pOwnStartNode( lcl_InitStartNode(eType, GetCursor()) ) + , m_pOwnStartNode( pStartNode ) // for import of tables in tables we have to remember the actual // table and start node of the current position in the enumeration. - , m_pOwnTable( lcl_InitTable(eType, m_pOwnStartNode) ) + , m_pOwnTable( pTable ) , m_nEndIndex( GetCursor()->End()->nNode.GetIndex() ) , m_nFirstParaStart( -1 ) , m_nLastParaEnd( -1 ) @@ -534,6 +507,10 @@ public: { OSL_ENSURE(m_xParentText.is(), "SwXParagraphEnumeration: no parent?"); OSL_ENSURE(GetRegisteredIn(), "SwXParagraphEnumeration: no cursor?"); + OSL_ENSURE( !((CURSOR_SELECTION_IN_TABLE == eType) || + (CURSOR_TBLTEXT == eType)) + || (m_pOwnTable && m_pOwnStartNode), + "SwXParagraphEnumeration: table type but no start node or table?"); if ((CURSOR_SELECTION == m_eCursorType) || (CURSOR_SELECTION_IN_TABLE == m_eCursorType)) @@ -576,8 +553,10 @@ void SwXParagraphEnumeration::Impl::Modify(SfxPoolItem *pOld, SfxPoolItem *pNew) SwXParagraphEnumeration::SwXParagraphEnumeration( uno::Reference< text::XText > const& xParent, ::std::auto_ptr pCursor, - const CursorType eType) - : m_pImpl( new SwXParagraphEnumeration::Impl(xParent, pCursor, eType) ) + const CursorType eType, + SwStartNode const*const pStartNode, SwTable const*const pTable) + : m_pImpl( new SwXParagraphEnumeration::Impl(xParent, pCursor, eType, + pStartNode, pTable) ) { } /*-- 10.12.98 11:52:12--------------------------------------------------- diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index e17ba707c1a8..a52f04e5a8c4 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -1227,8 +1227,12 @@ uno::Reference< container::XEnumeration > SwXCell::createEnumeration(void) thro GetDoc()->CreateUnoCrsr(aPos, sal_False)); pUnoCursor->Move(fnMoveForward, fnGoNode); + // remember table and start node for later travelling + // (used in export of tables in tables) + SwTable const*const pTable( & pSttNd->FindTableNode()->GetTable() ); SwXParagraphEnumeration *const pEnum = - new SwXParagraphEnumeration(this, pUnoCursor, CURSOR_TBLTEXT); + new SwXParagraphEnumeration(this, pUnoCursor, CURSOR_TBLTEXT, + pSttNd, pTable); aRef = pEnum; // // no Cursor in protected sections -- cgit v1.2.3 From 703aa707b342139eab23e607bd905a9442ff86d6 Mon Sep 17 00:00:00 2001 From: Vladimir Glazunov Date: Mon, 25 Jan 2010 11:34:49 +0100 Subject: #i107041# add start root directory as a repository --- solenv/bin/modules/SourceConfig.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/solenv/bin/modules/SourceConfig.pm b/solenv/bin/modules/SourceConfig.pm index 5c8dc89a641c..088005e43d7b 100644 --- a/solenv/bin/modules/SourceConfig.pm +++ b/solenv/bin/modules/SourceConfig.pm @@ -75,6 +75,9 @@ sub new { $self->{ACTIVATED_MODULES} = {}; $self->{MODULE_REPOSITORY} = {}; $self->{REAL_MODULES} = {}; + if (defined $self->{USER_SOURCE_ROOT}) { + ${$self->{REPOSITORIES}}{File::Basename::basename($self->{USER_SOURCE_ROOT})} = $self->{USER_SOURCE_ROOT}; + }; $self->{SOURCE_CONFIG_FILE} = get_config_file($source_root); $self->{SOURCE_CONFIG_DEFAULT} = $source_root .'/'.SOURCE_CONFIG_FILE_NAME; read_config_file($self); -- cgit v1.2.3 From 9f64e562d4231b9ab0aa1f29681e31893d23d2e0 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Mon, 25 Jan 2010 15:38:49 +0100 Subject: l10ntools: #i108419# removed the tabs from readme --- readlicense_oo/docs/readme/readme.xrm | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/readlicense_oo/docs/readme/readme.xrm b/readlicense_oo/docs/readme/readme.xrm index 60c1267482e4..2a8a409b4eff 100755 --- a/readlicense_oo/docs/readme/readme.xrm +++ b/readlicense_oo/docs/readme/readme.xrm @@ -165,23 +165,15 @@ - The Berkeley database engine has been upgraded in this version of ${PRODUCTNAME}. The database engine - upgrade introduces an incompatibility with user data for installed extensions for ${PRODUCTNAME} versions prior to 3.2 that may - require your action if you downgrade your version of ${PRODUCTNAME}. - + The Berkeley database engine has been upgraded in this version of ${PRODUCTNAME}. The database engine upgrade introduces an incompatibility with user data for installed extensions for ${PRODUCTNAME} versions prior to 3.2 that may require your action if you downgrade your version of ${PRODUCTNAME}. - This version of ${PRODUCTNAME} will convert your extension database to the new Berkeley - database format when extensions are installed or removed. After this conversion, the database can no longer be read - by earlier versions of ${PRODUCTNAME}. Downgrading to an earlier version may result in a dysfunctional installation. - + This version of ${PRODUCTNAME} will convert your extension database to the new Berkeley database format when extensions are installed or removed. After this conversion, the database can no longer be read by earlier versions of ${PRODUCTNAME}. Downgrading to an earlier version may result in a dysfunctional installation. - If you downgrade to an earlier version of ${PRODUCTNAME}, you must remove the user - data directory {user data}/uno_packages, for example ~/.openoffice.org/3/user/uno_packages, and reinstall all extensions. - + If you downgrade to an earlier version of ${PRODUCTNAME}, you must remove the user data directory {user data}/uno_packages, for example ~/.openoffice.org/3/user/uno_packages, and reinstall all extensions. -- cgit v1.2.3 From 35221c8379a5b3859329664ec4338310d734f068 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Mon, 25 Jan 2010 17:20:55 +0100 Subject: l10ntools: #i108657# rename transex3 to l10ntools --- sysui/prj/build.lst | 2 +- xmlhelp/prj/build.lst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sysui/prj/build.lst b/sysui/prj/build.lst index 9f6934e2352a..1530997a3ec3 100644 --- a/sysui/prj/build.lst +++ b/sysui/prj/build.lst @@ -1,4 +1,4 @@ -su sysui : l10n offapi xml2cmp rdbmaker transex3 setup_native NULL +su sysui : l10n offapi xml2cmp rdbmaker l10ntools setup_native NULL su sysui\source\win32\QuickStart nmake - w su_win32_quickstart NULL su sysui\source\win32\QuickStart\so nmake - w su_win32_quickstart_so su_win32_quickstart.w NULL su sysui\desktop\icons nmake - w su_iconsw NULL diff --git a/xmlhelp/prj/build.lst b/xmlhelp/prj/build.lst index 6fd64bb01730..7430bf6d7ba9 100644 --- a/xmlhelp/prj/build.lst +++ b/xmlhelp/prj/build.lst @@ -1,4 +1,4 @@ -xh xmlhelp : comphelper ucbhelper LIBXSLT:libxslt unoil BERKELEYDB:berkeleydb LUCENE:lucene javaunohelper transex3 NULL +xh xmlhelp : comphelper ucbhelper LIBXSLT:libxslt unoil BERKELEYDB:berkeleydb LUCENE:lucene javaunohelper l10ntools NULL xh xmlhelp usr1 - all xh_mkout NULL xh xmlhelp\inc nmake - all xh_inc NULL xh xmlhelp\source\treeview nmake - all xh_treeview xh_inc NULL -- cgit v1.2.3 From 7d7dabe5cf15fb33165b0af3db02150a64363960 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Mon, 25 Jan 2010 17:20:55 +0100 Subject: l10ntools: #i108657# rename transex3 to l10ntools --- scp2/prj/build.lst | 2 +- splitbuild/prj/build.lst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scp2/prj/build.lst b/scp2/prj/build.lst index abf5f14740da..f3fbbec38273 100644 --- a/scp2/prj/build.lst +++ b/scp2/prj/build.lst @@ -1,4 +1,4 @@ -cp scp2 : l10n i18npool setup_native transex3 PYTHON:python ICU:icu REDLAND:redland LIBXSLT:libxslt NULL +cp scp2 : l10n i18npool setup_native l10ntools PYTHON:python ICU:icu REDLAND:redland LIBXSLT:libxslt NULL cp scp2 usr1 - all cp_mkout NULL cp scp2\macros nmake - all cp_langmacros NULL cp scp2\source\templates nmake - all cp_langtemplates NULL diff --git a/splitbuild/prj/build.lst b/splitbuild/prj/build.lst index 24bc4e91e33c..a2bdbf37c28d 100644 --- a/splitbuild/prj/build.lst +++ b/splitbuild/prj/build.lst @@ -1,2 +1,2 @@ -spl splitbuild :: reportdesign dbaccess packimages postprocess scp2 testtools instsetoo_native scaddins sccomp sc basebmp basegfx bean comphelper configmgr connectivity crashrep embedserv eventattacher fileaccess i18npool i18nutil javainstaller2 linguistic lingucomponent o3tl officecfg oovbaapi package pyuno regexp rsc sax shell sot svl tools transex3 ucb ucbhelper unotools unoxml vos xmerge xmlhelp xmloff xmlscript wizards animations sd slideshow migrationanalysis reportbuilder sdext swext afms agg apache-commons apple_remote beanshell berkeleydb bitstream_vera_fonts boost cairo cppunit curl epm expat external fondu graphite hsqldb hunspell hyphen icc icu JFREEREPORT:jfreereport jpeg libegg libtextcat libwpd libxml2 libxmlsec libxslt lpsolve lucene MathMLDTD moz neon np_sdk nss openssl python redland rhino sane saxon stax stlport tomcat twain unixODBC vigra x11_extensions xpdf xsltml zlib automation avmedia basic drawinglayer embeddedobj filter formula fpicker framework idl oox sfx2 svx uui accessibility canvas cppcanvas dtrans goodies padmin psprint_config setup_native svtools sysui toolkit UnoControls vcl binfilter dictionaries extras helpcontent2 soltools basctl chart2 cui desktop extensions forms scripting starmath xmlsecurity autodoc bridges cli_ure codemaker cosv cppu cppuhelper cpputools idlc io javaunohelper jurt jvmaccess jvmfwk odk offapi offuh qadevOOo rdbmaker readlicense_oo registry remotebridges ridljar sal salhelper stoc store testshl2 udkapi udm unodevtools unoil ure xml2cmp hwpfilter sw writerfilter writerperfect NULL +spl splitbuild :: reportdesign dbaccess packimages postprocess scp2 testtools instsetoo_native scaddins sccomp sc basebmp basegfx bean comphelper configmgr connectivity crashrep embedserv eventattacher fileaccess i18npool i18nutil javainstaller2 linguistic lingucomponent o3tl officecfg oovbaapi package pyuno regexp rsc sax shell sot svl tools l10ntools ucb ucbhelper unotools unoxml vos xmerge xmlhelp xmloff xmlscript wizards animations sd slideshow migrationanalysis reportbuilder sdext swext afms agg apache-commons apple_remote beanshell berkeleydb bitstream_vera_fonts boost cairo cppunit curl epm expat external fondu graphite hsqldb hunspell hyphen icc icu JFREEREPORT:jfreereport jpeg libegg libtextcat libwpd libxml2 libxmlsec libxslt lpsolve lucene MathMLDTD moz neon np_sdk nss openssl python redland rhino sane saxon stax stlport tomcat twain unixODBC vigra x11_extensions xpdf xsltml zlib automation avmedia basic drawinglayer embeddedobj filter formula fpicker framework idl oox sfx2 svx uui accessibility canvas cppcanvas dtrans goodies padmin psprint_config setup_native svtools sysui toolkit UnoControls vcl binfilter dictionaries extras helpcontent2 soltools basctl chart2 cui desktop extensions forms scripting starmath xmlsecurity autodoc bridges cli_ure codemaker cosv cppu cppuhelper cpputools idlc io javaunohelper jurt jvmaccess jvmfwk odk offapi offuh qadevOOo rdbmaker readlicense_oo registry remotebridges ridljar sal salhelper stoc store testshl2 udkapi udm unodevtools unoil ure xml2cmp hwpfilter sw writerfilter writerperfect NULL -- cgit v1.2.3 From 8316671089f33c8aba5c5e72348854de16df9379 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Mon, 25 Jan 2010 17:20:55 +0100 Subject: l10ntools: #i108657# rename transex3 to l10ntools --- l10ntools/inc/cfgmerge.hxx | 208 ++ l10ntools/inc/export.hxx | 586 +++++ l10ntools/inc/gsicheck.hxx | 131 + l10ntools/inc/helpmerge.hxx | 87 + l10ntools/inc/inireader.hxx | 52 + l10ntools/inc/l10ntools/directory.hxx | 54 + l10ntools/inc/l10ntools/file.hxx | 23 + l10ntools/inc/l10ntools/vosapp.hxx | 33 + l10ntools/inc/lngmerge.hxx | 69 + l10ntools/inc/makefile.mk | 51 + l10ntools/inc/pch/precompiled_l10ntools.cxx | 32 + l10ntools/inc/pch/precompiled_l10ntools.hxx | 35 + l10ntools/inc/srciter.hxx | 61 + l10ntools/inc/tagtest.hxx | 399 +++ l10ntools/inc/tokens.h | 112 + l10ntools/inc/treeconfig.hxx | 28 + l10ntools/inc/utf8conv.hxx | 47 + l10ntools/inc/wrdtrans.hxx | 90 + l10ntools/inc/wtranode.hxx | 121 + l10ntools/inc/wtratree.hxx | 162 ++ l10ntools/inc/xmlparse.hxx | 553 ++++ l10ntools/inc/xmlutil.hxx | 9 + l10ntools/inc/xrmmerge.hxx | 161 ++ l10ntools/java/l10nconv/build.xml | 233 ++ l10ntools/java/l10nconv/converter.MF | 1 + .../l10nconv/documentation/readmeConverter.sxw | Bin 0 -> 9824 bytes .../star/tooling/DirtyTags/DirtyTagWrapCheck.java | 85 + .../star/tooling/DirtyTags/DirtyTagWrapper.java | 252 ++ .../java/com/sun/star/tooling/DirtyTags/Tag.java | 249 ++ .../com/sun/star/tooling/DirtyTags/TagPair.java | 310 +++ .../com/sun/star/tooling/converter/Convert.java | 553 ++++ .../com/sun/star/tooling/converter/Converter.java | 523 ++++ .../star/tooling/converter/ConverterException.java | 79 + .../sun/star/tooling/converter/DataHandler.java | 149 ++ .../com/sun/star/tooling/converter/DataReader.java | 79 + .../com/sun/star/tooling/converter/DataWriter.java | 91 + .../com/sun/star/tooling/converter/ExtMap.java | 97 + .../com/sun/star/tooling/converter/FileMaker.java | 87 + .../com/sun/star/tooling/converter/GSIReader.java | 250 ++ .../com/sun/star/tooling/converter/GSIWriter.java | 246 ++ .../star/tooling/converter/GSIandSDFMerger.java | 167 ++ .../star/tooling/converter/LineErrorException.java | 81 + .../sun/star/tooling/converter/OutputHandler.java | 228 ++ .../star/tooling/converter/ResTypeResolver.java | 71 + .../com/sun/star/tooling/converter/Resolver.java | 98 + .../com/sun/star/tooling/converter/SDFReader.java | 635 +++++ .../com/sun/star/tooling/converter/SDFWriter.java | 175 ++ .../sun/star/tooling/converter/XLIFFReader.java | 745 ++++++ .../sun/star/tooling/converter/XLIFFWriter.java | 535 ++++ .../com/sun/star/tooling/converter/dtd/xliff.dtd | 391 +++ .../tooling/languageResolver/LanguageResolver.java | 201 ++ .../com/sun/star/tooling/languageResolver/lang.map | 41 + l10ntools/java/l10nconv/makefile.mk | 39 + l10ntools/java/receditor/build.xml | 173 ++ .../java/transex3/controller/EditorController.java | 334 +++ .../receditor/java/transex3/controller/Main.java | 10 + .../java/transex3/model/ResourceFile.java | 77 + .../receditor/java/transex3/model/SdfEntity.java | 211 ++ .../receditor/java/transex3/model/SdfString.java | 192 ++ .../java/receditor/java/transex3/view/Editor.java | 97 + .../receditor/java/transex3/view/SdfTable.java | 24 + l10ntools/java/receditor/makefile.mk | 39 + l10ntools/java/receditor/receditor.MF | 1 + l10ntools/layout/README | 27 + l10ntools/layout/layoutparse.cxx | 139 + l10ntools/layout/layoutparse.hxx | 55 + l10ntools/layout/loc.sdf | 24 + l10ntools/layout/makefile.mk | 81 + l10ntools/layout/tralay.cxx | 403 +++ l10ntools/layout/zoom.xml | 40 + l10ntools/prj/build.lst | 10 + l10ntools/prj/d.lst | 61 + l10ntools/scripts/fast_merge.pl | 348 +++ l10ntools/scripts/keyidGen.pl | 189 ++ l10ntools/scripts/localize.pl | 1201 +++++++++ l10ntools/scripts/localize_old.pl | 1130 +++++++++ l10ntools/source/cfg_yy_wrapper.c | 2 + l10ntools/source/cfglex.l | 232 ++ l10ntools/source/cfgmerge.cxx | 886 +++++++ l10ntools/source/directory.cxx | 276 ++ l10ntools/source/export.cxx | 2660 ++++++++++++++++++++ l10ntools/source/export2.cxx | 741 ++++++ l10ntools/source/file.cxx | 58 + l10ntools/source/filter/merge/FCFGMerge.cfg | 125 + l10ntools/source/filter/merge/FCFGMerge.java | 131 + l10ntools/source/filter/merge/Manifest.mf | 1 + l10ntools/source/filter/merge/Merger.java | 364 +++ l10ntools/source/filter/merge/makefile.mk | 96 + .../source/filter/utils/AnalyzeStartupLog.java | 328 +++ l10ntools/source/filter/utils/Cache.java | 2449 ++++++++++++++++++ l10ntools/source/filter/utils/ConfigHelper.java | 303 +++ l10ntools/source/filter/utils/FileHelper.java | 766 ++++++ l10ntools/source/filter/utils/Logger.java | 177 ++ .../utils/MalformedCommandLineException.java | 50 + l10ntools/source/filter/utils/XMLHelper.java | 825 ++++++ l10ntools/source/filter/utils/makefile.mk | 57 + l10ntools/source/gsicheck.cxx | 1177 +++++++++ l10ntools/source/gsiconv.cxx | 372 +++ l10ntools/source/help/HelpCompiler.cxx | 593 +++++ l10ntools/source/help/HelpCompiler.hxx | 320 +++ l10ntools/source/help/HelpFileDocument.java | 89 + l10ntools/source/help/HelpIndexerTool.java | 372 +++ l10ntools/source/help/HelpLinker.cxx | 1173 +++++++++ l10ntools/source/help/compilehelp.hxx | 81 + l10ntools/source/help/helplinker.pmk | 35 + l10ntools/source/help/makefile.mk | 120 + l10ntools/source/helpex.cxx | 299 +++ l10ntools/source/helpmerge.cxx | 730 ++++++ l10ntools/source/inireader.cxx | 132 + l10ntools/source/lngex.cxx | 226 ++ l10ntools/source/lngmerge.cxx | 360 +++ l10ntools/source/localize.cxx | 986 ++++++++ l10ntools/source/makefile.mk | 210 ++ l10ntools/source/merge.cxx | 445 ++++ l10ntools/source/src_yy_wrapper.c | 2 + l10ntools/source/srciter.cxx | 141 ++ l10ntools/source/srclex.l | 308 +++ l10ntools/source/tagtest.cxx | 1577 ++++++++++++ l10ntools/source/treeconfig.cxx | 128 + l10ntools/source/utf8conv.cxx | 77 + l10ntools/source/wrdtrans.cxx | 248 ++ l10ntools/source/wtranode.cxx | 111 + l10ntools/source/wtratree.cxx | 421 ++++ l10ntools/source/xgfconv.cxx | 66 + l10ntools/source/xmlparse.cxx | 1456 +++++++++++ l10ntools/source/xrm_yy_wrapper.c | 2 + l10ntools/source/xrmlex.l | 228 ++ l10ntools/source/xrmmerge.cxx | 754 ++++++ l10ntools/workbench/gsicheck_errors.sdf | 15 + l10ntools/workbench/gsicheck_errors_err-.sdf | 11 + l10ntools/workbench/gsicheck_errors_err-l.sdf | 2 + l10ntools/workbench/gsicheck_errors_err-s.sdf | 9 + l10ntools/workbench/gsicheck_errors_err-t.sdf | 9 + l10ntools/workbench/gsicheck_errors_ok-.sdf | 5 + l10ntools/workbench/gsicheck_errors_ok-l.sdf | 12 + l10ntools/workbench/gsicheck_errors_ok-s.sdf | 6 + l10ntools/workbench/gsicheck_errors_ok-t.sdf | 6 + l10ntools/workbench/gsicheckcheck.btm | 17 + transex3/inc/cfgmerge.hxx | 208 -- transex3/inc/export.hxx | 586 ----- transex3/inc/gsicheck.hxx | 131 - transex3/inc/helpmerge.hxx | 87 - transex3/inc/inireader.hxx | 52 - transex3/inc/lngmerge.hxx | 69 - transex3/inc/makefile.mk | 51 - transex3/inc/pch/precompiled_transex3.cxx | 32 - transex3/inc/pch/precompiled_transex3.hxx | 35 - transex3/inc/srciter.hxx | 61 - transex3/inc/tagtest.hxx | 399 --- transex3/inc/tokens.h | 112 - transex3/inc/transex3/directory.hxx | 54 - transex3/inc/transex3/file.hxx | 23 - transex3/inc/transex3/vosapp.hxx | 33 - transex3/inc/treeconfig.hxx | 28 - transex3/inc/utf8conv.hxx | 47 - transex3/inc/wrdtrans.hxx | 90 - transex3/inc/wtranode.hxx | 121 - transex3/inc/wtratree.hxx | 162 -- transex3/inc/xmlparse.hxx | 553 ---- transex3/inc/xmlutil.hxx | 9 - transex3/inc/xrmmerge.hxx | 161 -- transex3/java/l10nconv/build.xml | 233 -- transex3/java/l10nconv/converter.MF | 1 - .../l10nconv/documentation/readmeConverter.sxw | Bin 9824 -> 0 bytes .../star/tooling/DirtyTags/DirtyTagWrapCheck.java | 85 - .../star/tooling/DirtyTags/DirtyTagWrapper.java | 252 -- .../java/com/sun/star/tooling/DirtyTags/Tag.java | 249 -- .../com/sun/star/tooling/DirtyTags/TagPair.java | 310 --- .../com/sun/star/tooling/converter/Convert.java | 553 ---- .../com/sun/star/tooling/converter/Converter.java | 523 ---- .../star/tooling/converter/ConverterException.java | 79 - .../sun/star/tooling/converter/DataHandler.java | 149 -- .../com/sun/star/tooling/converter/DataReader.java | 79 - .../com/sun/star/tooling/converter/DataWriter.java | 91 - .../com/sun/star/tooling/converter/ExtMap.java | 97 - .../com/sun/star/tooling/converter/FileMaker.java | 87 - .../com/sun/star/tooling/converter/GSIReader.java | 250 -- .../com/sun/star/tooling/converter/GSIWriter.java | 246 -- .../star/tooling/converter/GSIandSDFMerger.java | 167 -- .../star/tooling/converter/LineErrorException.java | 81 - .../sun/star/tooling/converter/OutputHandler.java | 228 -- .../star/tooling/converter/ResTypeResolver.java | 71 - .../com/sun/star/tooling/converter/Resolver.java | 98 - .../com/sun/star/tooling/converter/SDFReader.java | 635 ----- .../com/sun/star/tooling/converter/SDFWriter.java | 175 -- .../sun/star/tooling/converter/XLIFFReader.java | 745 ------ .../sun/star/tooling/converter/XLIFFWriter.java | 535 ---- .../com/sun/star/tooling/converter/dtd/xliff.dtd | 391 --- .../tooling/languageResolver/LanguageResolver.java | 201 -- .../com/sun/star/tooling/languageResolver/lang.map | 41 - transex3/java/l10nconv/makefile.mk | 39 - transex3/java/receditor/build.xml | 173 -- .../java/transex3/controller/EditorController.java | 334 --- .../receditor/java/transex3/controller/Main.java | 10 - .../java/transex3/model/ResourceFile.java | 77 - .../receditor/java/transex3/model/SdfEntity.java | 211 -- .../receditor/java/transex3/model/SdfString.java | 192 -- .../java/receditor/java/transex3/view/Editor.java | 97 - .../receditor/java/transex3/view/SdfTable.java | 24 - transex3/java/receditor/makefile.mk | 39 - transex3/java/receditor/receditor.MF | 1 - transex3/layout/README | 27 - transex3/layout/layoutparse.cxx | 139 - transex3/layout/layoutparse.hxx | 55 - transex3/layout/loc.sdf | 24 - transex3/layout/makefile.mk | 81 - transex3/layout/tralay.cxx | 403 --- transex3/layout/zoom.xml | 40 - transex3/prj/build.lst | 10 - transex3/prj/d.lst | 61 - transex3/scripts/fast_merge.pl | 348 --- transex3/scripts/keyidGen.pl | 189 -- transex3/scripts/localize.pl | 1201 --------- transex3/scripts/localize_old.pl | 1130 --------- transex3/source/cfg_yy_wrapper.c | 2 - transex3/source/cfglex.l | 232 -- transex3/source/cfgmerge.cxx | 886 ------- transex3/source/directory.cxx | 276 -- transex3/source/export.cxx | 2660 -------------------- transex3/source/export2.cxx | 741 ------ transex3/source/file.cxx | 58 - transex3/source/filter/merge/FCFGMerge.cfg | 125 - transex3/source/filter/merge/FCFGMerge.java | 131 - transex3/source/filter/merge/Manifest.mf | 1 - transex3/source/filter/merge/Merger.java | 364 --- transex3/source/filter/merge/makefile.mk | 96 - .../source/filter/utils/AnalyzeStartupLog.java | 328 --- transex3/source/filter/utils/Cache.java | 2449 ------------------ transex3/source/filter/utils/ConfigHelper.java | 303 --- transex3/source/filter/utils/FileHelper.java | 766 ------ transex3/source/filter/utils/Logger.java | 177 -- .../utils/MalformedCommandLineException.java | 50 - transex3/source/filter/utils/XMLHelper.java | 825 ------ transex3/source/filter/utils/makefile.mk | 57 - transex3/source/gsicheck.cxx | 1177 --------- transex3/source/gsiconv.cxx | 372 --- transex3/source/help/HelpCompiler.cxx | 593 ----- transex3/source/help/HelpCompiler.hxx | 320 --- transex3/source/help/HelpFileDocument.java | 89 - transex3/source/help/HelpIndexerTool.java | 372 --- transex3/source/help/HelpLinker.cxx | 1173 --------- transex3/source/help/compilehelp.hxx | 81 - transex3/source/help/helplinker.pmk | 35 - transex3/source/help/makefile.mk | 120 - transex3/source/helpex.cxx | 299 --- transex3/source/helpmerge.cxx | 730 ------ transex3/source/inireader.cxx | 132 - transex3/source/lngex.cxx | 226 -- transex3/source/lngmerge.cxx | 360 --- transex3/source/localize.cxx | 986 -------- transex3/source/makefile.mk | 210 -- transex3/source/merge.cxx | 445 ---- transex3/source/src_yy_wrapper.c | 2 - transex3/source/srciter.cxx | 141 -- transex3/source/srclex.l | 308 --- transex3/source/tagtest.cxx | 1577 ------------ transex3/source/treeconfig.cxx | 128 - transex3/source/utf8conv.cxx | 77 - transex3/source/wrdtrans.cxx | 248 -- transex3/source/wtranode.cxx | 111 - transex3/source/wtratree.cxx | 421 ---- transex3/source/xgfconv.cxx | 66 - transex3/source/xmlparse.cxx | 1456 ----------- transex3/source/xrm_yy_wrapper.c | 2 - transex3/source/xrmlex.l | 228 -- transex3/source/xrmmerge.cxx | 754 ------ transex3/workbench/gsicheck_errors.sdf | 15 - transex3/workbench/gsicheck_errors_err-.sdf | 11 - transex3/workbench/gsicheck_errors_err-l.sdf | 2 - transex3/workbench/gsicheck_errors_err-s.sdf | 9 - transex3/workbench/gsicheck_errors_err-t.sdf | 9 - transex3/workbench/gsicheck_errors_ok-.sdf | 5 - transex3/workbench/gsicheck_errors_ok-l.sdf | 12 - transex3/workbench/gsicheck_errors_ok-s.sdf | 6 - transex3/workbench/gsicheck_errors_ok-t.sdf | 6 - transex3/workbench/gsicheckcheck.btm | 17 - vcl/prj/build.lst | 2 +- 277 files changed, 38520 insertions(+), 38520 deletions(-) create mode 100644 l10ntools/inc/cfgmerge.hxx create mode 100644 l10ntools/inc/export.hxx create mode 100644 l10ntools/inc/gsicheck.hxx create mode 100644 l10ntools/inc/helpmerge.hxx create mode 100644 l10ntools/inc/inireader.hxx create mode 100644 l10ntools/inc/l10ntools/directory.hxx create mode 100644 l10ntools/inc/l10ntools/file.hxx create mode 100644 l10ntools/inc/l10ntools/vosapp.hxx create mode 100644 l10ntools/inc/lngmerge.hxx create mode 100644 l10ntools/inc/makefile.mk create mode 100644 l10ntools/inc/pch/precompiled_l10ntools.cxx create mode 100644 l10ntools/inc/pch/precompiled_l10ntools.hxx create mode 100644 l10ntools/inc/srciter.hxx create mode 100644 l10ntools/inc/tagtest.hxx create mode 100644 l10ntools/inc/tokens.h create mode 100644 l10ntools/inc/treeconfig.hxx create mode 100644 l10ntools/inc/utf8conv.hxx create mode 100644 l10ntools/inc/wrdtrans.hxx create mode 100644 l10ntools/inc/wtranode.hxx create mode 100644 l10ntools/inc/wtratree.hxx create mode 100644 l10ntools/inc/xmlparse.hxx create mode 100644 l10ntools/inc/xmlutil.hxx create mode 100644 l10ntools/inc/xrmmerge.hxx create mode 100755 l10ntools/java/l10nconv/build.xml create mode 100755 l10ntools/java/l10nconv/converter.MF create mode 100755 l10ntools/java/l10nconv/documentation/readmeConverter.sxw create mode 100755 l10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/DirtyTagWrapCheck.java create mode 100755 l10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/DirtyTagWrapper.java create mode 100755 l10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/Tag.java create mode 100755 l10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/TagPair.java create mode 100755 l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/Convert.java create mode 100755 l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/Converter.java create mode 100755 l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/ConverterException.java create mode 100755 l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/DataHandler.java create mode 100755 l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/DataReader.java create mode 100755 l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/DataWriter.java create mode 100755 l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/ExtMap.java create mode 100755 l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/FileMaker.java create mode 100755 l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/GSIReader.java create mode 100755 l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/GSIWriter.java create mode 100755 l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/GSIandSDFMerger.java create mode 100755 l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/LineErrorException.java create mode 100755 l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/OutputHandler.java create mode 100755 l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/ResTypeResolver.java create mode 100755 l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/Resolver.java create mode 100755 l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/SDFReader.java create mode 100755 l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/SDFWriter.java create mode 100755 l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/XLIFFReader.java create mode 100755 l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/XLIFFWriter.java create mode 100755 l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/dtd/xliff.dtd create mode 100755 l10ntools/java/l10nconv/java/com/sun/star/tooling/languageResolver/LanguageResolver.java create mode 100755 l10ntools/java/l10nconv/java/com/sun/star/tooling/languageResolver/lang.map create mode 100755 l10ntools/java/l10nconv/makefile.mk create mode 100755 l10ntools/java/receditor/build.xml create mode 100644 l10ntools/java/receditor/java/transex3/controller/EditorController.java create mode 100644 l10ntools/java/receditor/java/transex3/controller/Main.java create mode 100644 l10ntools/java/receditor/java/transex3/model/ResourceFile.java create mode 100644 l10ntools/java/receditor/java/transex3/model/SdfEntity.java create mode 100644 l10ntools/java/receditor/java/transex3/model/SdfString.java create mode 100644 l10ntools/java/receditor/java/transex3/view/Editor.java create mode 100644 l10ntools/java/receditor/java/transex3/view/SdfTable.java create mode 100755 l10ntools/java/receditor/makefile.mk create mode 100755 l10ntools/java/receditor/receditor.MF create mode 100644 l10ntools/layout/README create mode 100644 l10ntools/layout/layoutparse.cxx create mode 100644 l10ntools/layout/layoutparse.hxx create mode 100644 l10ntools/layout/loc.sdf create mode 100644 l10ntools/layout/makefile.mk create mode 100644 l10ntools/layout/tralay.cxx create mode 100644 l10ntools/layout/zoom.xml create mode 100644 l10ntools/prj/build.lst create mode 100644 l10ntools/prj/d.lst create mode 100644 l10ntools/scripts/fast_merge.pl create mode 100644 l10ntools/scripts/keyidGen.pl create mode 100755 l10ntools/scripts/localize.pl create mode 100755 l10ntools/scripts/localize_old.pl create mode 100644 l10ntools/source/cfg_yy_wrapper.c create mode 100644 l10ntools/source/cfglex.l create mode 100644 l10ntools/source/cfgmerge.cxx create mode 100644 l10ntools/source/directory.cxx create mode 100644 l10ntools/source/export.cxx create mode 100644 l10ntools/source/export2.cxx create mode 100644 l10ntools/source/file.cxx create mode 100644 l10ntools/source/filter/merge/FCFGMerge.cfg create mode 100644 l10ntools/source/filter/merge/FCFGMerge.java create mode 100644 l10ntools/source/filter/merge/Manifest.mf create mode 100644 l10ntools/source/filter/merge/Merger.java create mode 100644 l10ntools/source/filter/merge/makefile.mk create mode 100644 l10ntools/source/filter/utils/AnalyzeStartupLog.java create mode 100644 l10ntools/source/filter/utils/Cache.java create mode 100644 l10ntools/source/filter/utils/ConfigHelper.java create mode 100644 l10ntools/source/filter/utils/FileHelper.java create mode 100644 l10ntools/source/filter/utils/Logger.java create mode 100644 l10ntools/source/filter/utils/MalformedCommandLineException.java create mode 100644 l10ntools/source/filter/utils/XMLHelper.java create mode 100644 l10ntools/source/filter/utils/makefile.mk create mode 100644 l10ntools/source/gsicheck.cxx create mode 100644 l10ntools/source/gsiconv.cxx create mode 100644 l10ntools/source/help/HelpCompiler.cxx create mode 100644 l10ntools/source/help/HelpCompiler.hxx create mode 100644 l10ntools/source/help/HelpFileDocument.java create mode 100644 l10ntools/source/help/HelpIndexerTool.java create mode 100644 l10ntools/source/help/HelpLinker.cxx create mode 100644 l10ntools/source/help/compilehelp.hxx create mode 100644 l10ntools/source/help/helplinker.pmk create mode 100644 l10ntools/source/help/makefile.mk create mode 100644 l10ntools/source/helpex.cxx create mode 100644 l10ntools/source/helpmerge.cxx create mode 100644 l10ntools/source/inireader.cxx create mode 100644 l10ntools/source/lngex.cxx create mode 100644 l10ntools/source/lngmerge.cxx create mode 100644 l10ntools/source/localize.cxx create mode 100644 l10ntools/source/makefile.mk create mode 100644 l10ntools/source/merge.cxx create mode 100644 l10ntools/source/src_yy_wrapper.c create mode 100644 l10ntools/source/srciter.cxx create mode 100644 l10ntools/source/srclex.l create mode 100644 l10ntools/source/tagtest.cxx create mode 100644 l10ntools/source/treeconfig.cxx create mode 100644 l10ntools/source/utf8conv.cxx create mode 100644 l10ntools/source/wrdtrans.cxx create mode 100644 l10ntools/source/wtranode.cxx create mode 100644 l10ntools/source/wtratree.cxx create mode 100644 l10ntools/source/xgfconv.cxx create mode 100644 l10ntools/source/xmlparse.cxx create mode 100644 l10ntools/source/xrm_yy_wrapper.c create mode 100644 l10ntools/source/xrmlex.l create mode 100644 l10ntools/source/xrmmerge.cxx create mode 100644 l10ntools/workbench/gsicheck_errors.sdf create mode 100644 l10ntools/workbench/gsicheck_errors_err-.sdf create mode 100644 l10ntools/workbench/gsicheck_errors_err-l.sdf create mode 100644 l10ntools/workbench/gsicheck_errors_err-s.sdf create mode 100644 l10ntools/workbench/gsicheck_errors_err-t.sdf create mode 100644 l10ntools/workbench/gsicheck_errors_ok-.sdf create mode 100644 l10ntools/workbench/gsicheck_errors_ok-l.sdf create mode 100644 l10ntools/workbench/gsicheck_errors_ok-s.sdf create mode 100644 l10ntools/workbench/gsicheck_errors_ok-t.sdf create mode 100644 l10ntools/workbench/gsicheckcheck.btm delete mode 100644 transex3/inc/cfgmerge.hxx delete mode 100644 transex3/inc/export.hxx delete mode 100644 transex3/inc/gsicheck.hxx delete mode 100644 transex3/inc/helpmerge.hxx delete mode 100644 transex3/inc/inireader.hxx delete mode 100644 transex3/inc/lngmerge.hxx delete mode 100644 transex3/inc/makefile.mk delete mode 100644 transex3/inc/pch/precompiled_transex3.cxx delete mode 100644 transex3/inc/pch/precompiled_transex3.hxx delete mode 100644 transex3/inc/srciter.hxx delete mode 100644 transex3/inc/tagtest.hxx delete mode 100644 transex3/inc/tokens.h delete mode 100644 transex3/inc/transex3/directory.hxx delete mode 100644 transex3/inc/transex3/file.hxx delete mode 100644 transex3/inc/transex3/vosapp.hxx delete mode 100644 transex3/inc/treeconfig.hxx delete mode 100644 transex3/inc/utf8conv.hxx delete mode 100644 transex3/inc/wrdtrans.hxx delete mode 100644 transex3/inc/wtranode.hxx delete mode 100644 transex3/inc/wtratree.hxx delete mode 100644 transex3/inc/xmlparse.hxx delete mode 100644 transex3/inc/xmlutil.hxx delete mode 100644 transex3/inc/xrmmerge.hxx delete mode 100755 transex3/java/l10nconv/build.xml delete mode 100755 transex3/java/l10nconv/converter.MF delete mode 100755 transex3/java/l10nconv/documentation/readmeConverter.sxw delete mode 100755 transex3/java/l10nconv/java/com/sun/star/tooling/DirtyTags/DirtyTagWrapCheck.java delete mode 100755 transex3/java/l10nconv/java/com/sun/star/tooling/DirtyTags/DirtyTagWrapper.java delete mode 100755 transex3/java/l10nconv/java/com/sun/star/tooling/DirtyTags/Tag.java delete mode 100755 transex3/java/l10nconv/java/com/sun/star/tooling/DirtyTags/TagPair.java delete mode 100755 transex3/java/l10nconv/java/com/sun/star/tooling/converter/Convert.java delete mode 100755 transex3/java/l10nconv/java/com/sun/star/tooling/converter/Converter.java delete mode 100755 transex3/java/l10nconv/java/com/sun/star/tooling/converter/ConverterException.java delete mode 100755 transex3/java/l10nconv/java/com/sun/star/tooling/converter/DataHandler.java delete mode 100755 transex3/java/l10nconv/java/com/sun/star/tooling/converter/DataReader.java delete mode 100755 transex3/java/l10nconv/java/com/sun/star/tooling/converter/DataWriter.java delete mode 100755 transex3/java/l10nconv/java/com/sun/star/tooling/converter/ExtMap.java delete mode 100755 transex3/java/l10nconv/java/com/sun/star/tooling/converter/FileMaker.java delete mode 100755 transex3/java/l10nconv/java/com/sun/star/tooling/converter/GSIReader.java delete mode 100755 transex3/java/l10nconv/java/com/sun/star/tooling/converter/GSIWriter.java delete mode 100755 transex3/java/l10nconv/java/com/sun/star/tooling/converter/GSIandSDFMerger.java delete mode 100755 transex3/java/l10nconv/java/com/sun/star/tooling/converter/LineErrorException.java delete mode 100755 transex3/java/l10nconv/java/com/sun/star/tooling/converter/OutputHandler.java delete mode 100755 transex3/java/l10nconv/java/com/sun/star/tooling/converter/ResTypeResolver.java delete mode 100755 transex3/java/l10nconv/java/com/sun/star/tooling/converter/Resolver.java delete mode 100755 transex3/java/l10nconv/java/com/sun/star/tooling/converter/SDFReader.java delete mode 100755 transex3/java/l10nconv/java/com/sun/star/tooling/converter/SDFWriter.java delete mode 100755 transex3/java/l10nconv/java/com/sun/star/tooling/converter/XLIFFReader.java delete mode 100755 transex3/java/l10nconv/java/com/sun/star/tooling/converter/XLIFFWriter.java delete mode 100755 transex3/java/l10nconv/java/com/sun/star/tooling/converter/dtd/xliff.dtd delete mode 100755 transex3/java/l10nconv/java/com/sun/star/tooling/languageResolver/LanguageResolver.java delete mode 100755 transex3/java/l10nconv/java/com/sun/star/tooling/languageResolver/lang.map delete mode 100755 transex3/java/l10nconv/makefile.mk delete mode 100755 transex3/java/receditor/build.xml delete mode 100644 transex3/java/receditor/java/transex3/controller/EditorController.java delete mode 100644 transex3/java/receditor/java/transex3/controller/Main.java delete mode 100644 transex3/java/receditor/java/transex3/model/ResourceFile.java delete mode 100644 transex3/java/receditor/java/transex3/model/SdfEntity.java delete mode 100644 transex3/java/receditor/java/transex3/model/SdfString.java delete mode 100644 transex3/java/receditor/java/transex3/view/Editor.java delete mode 100644 transex3/java/receditor/java/transex3/view/SdfTable.java delete mode 100755 transex3/java/receditor/makefile.mk delete mode 100755 transex3/java/receditor/receditor.MF delete mode 100644 transex3/layout/README delete mode 100644 transex3/layout/layoutparse.cxx delete mode 100644 transex3/layout/layoutparse.hxx delete mode 100644 transex3/layout/loc.sdf delete mode 100644 transex3/layout/makefile.mk delete mode 100644 transex3/layout/tralay.cxx delete mode 100644 transex3/layout/zoom.xml delete mode 100644 transex3/prj/build.lst delete mode 100644 transex3/prj/d.lst delete mode 100644 transex3/scripts/fast_merge.pl delete mode 100644 transex3/scripts/keyidGen.pl delete mode 100755 transex3/scripts/localize.pl delete mode 100755 transex3/scripts/localize_old.pl delete mode 100644 transex3/source/cfg_yy_wrapper.c delete mode 100644 transex3/source/cfglex.l delete mode 100644 transex3/source/cfgmerge.cxx delete mode 100644 transex3/source/directory.cxx delete mode 100644 transex3/source/export.cxx delete mode 100644 transex3/source/export2.cxx delete mode 100644 transex3/source/file.cxx delete mode 100644 transex3/source/filter/merge/FCFGMerge.cfg delete mode 100644 transex3/source/filter/merge/FCFGMerge.java delete mode 100644 transex3/source/filter/merge/Manifest.mf delete mode 100644 transex3/source/filter/merge/Merger.java delete mode 100644 transex3/source/filter/merge/makefile.mk delete mode 100644 transex3/source/filter/utils/AnalyzeStartupLog.java delete mode 100644 transex3/source/filter/utils/Cache.java delete mode 100644 transex3/source/filter/utils/ConfigHelper.java delete mode 100644 transex3/source/filter/utils/FileHelper.java delete mode 100644 transex3/source/filter/utils/Logger.java delete mode 100644 transex3/source/filter/utils/MalformedCommandLineException.java delete mode 100644 transex3/source/filter/utils/XMLHelper.java delete mode 100644 transex3/source/filter/utils/makefile.mk delete mode 100644 transex3/source/gsicheck.cxx delete mode 100644 transex3/source/gsiconv.cxx delete mode 100644 transex3/source/help/HelpCompiler.cxx delete mode 100644 transex3/source/help/HelpCompiler.hxx delete mode 100644 transex3/source/help/HelpFileDocument.java delete mode 100644 transex3/source/help/HelpIndexerTool.java delete mode 100644 transex3/source/help/HelpLinker.cxx delete mode 100644 transex3/source/help/compilehelp.hxx delete mode 100644 transex3/source/help/helplinker.pmk delete mode 100644 transex3/source/help/makefile.mk delete mode 100644 transex3/source/helpex.cxx delete mode 100644 transex3/source/helpmerge.cxx delete mode 100644 transex3/source/inireader.cxx delete mode 100644 transex3/source/lngex.cxx delete mode 100644 transex3/source/lngmerge.cxx delete mode 100644 transex3/source/localize.cxx delete mode 100644 transex3/source/makefile.mk delete mode 100644 transex3/source/merge.cxx delete mode 100644 transex3/source/src_yy_wrapper.c delete mode 100644 transex3/source/srciter.cxx delete mode 100644 transex3/source/srclex.l delete mode 100644 transex3/source/tagtest.cxx delete mode 100644 transex3/source/treeconfig.cxx delete mode 100644 transex3/source/utf8conv.cxx delete mode 100644 transex3/source/wrdtrans.cxx delete mode 100644 transex3/source/wtranode.cxx delete mode 100644 transex3/source/wtratree.cxx delete mode 100644 transex3/source/xgfconv.cxx delete mode 100644 transex3/source/xmlparse.cxx delete mode 100644 transex3/source/xrm_yy_wrapper.c delete mode 100644 transex3/source/xrmlex.l delete mode 100644 transex3/source/xrmmerge.cxx delete mode 100644 transex3/workbench/gsicheck_errors.sdf delete mode 100644 transex3/workbench/gsicheck_errors_err-.sdf delete mode 100644 transex3/workbench/gsicheck_errors_err-l.sdf delete mode 100644 transex3/workbench/gsicheck_errors_err-s.sdf delete mode 100644 transex3/workbench/gsicheck_errors_err-t.sdf delete mode 100644 transex3/workbench/gsicheck_errors_ok-.sdf delete mode 100644 transex3/workbench/gsicheck_errors_ok-l.sdf delete mode 100644 transex3/workbench/gsicheck_errors_ok-s.sdf delete mode 100644 transex3/workbench/gsicheck_errors_ok-t.sdf delete mode 100644 transex3/workbench/gsicheckcheck.btm diff --git a/l10ntools/inc/cfgmerge.hxx b/l10ntools/inc/cfgmerge.hxx new file mode 100644 index 000000000000..9f1c97f05af5 --- /dev/null +++ b/l10ntools/inc/cfgmerge.hxx @@ -0,0 +1,208 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: cfgmerge.hxx,v $ + * $Revision: 1.8 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _CFG_MERGE_HXX +#define _CFG_MERGE_HXX + +#include +#include +#include + +typedef std::hash_map + ByteStringHashMap; + + +// +// class CfgStackData +// + +class CfgStackData +{ +friend class CfgParser; +friend class CfgExport; +friend class CfgMerge; +private: + ByteString sTagType; + ByteString sIdentifier; + + ByteString sResTyp; + + ByteString sTextTag; + ByteString sEndTextTag; + + ByteStringHashMap sText; +public: + CfgStackData( const ByteString &rTag, const ByteString &rId ) + : sTagType( rTag ), sIdentifier( rId ) {}; + + ByteString &GetTagType() { return sTagType; } + ByteString &GetIdentifier() { return sIdentifier; } + +}; + +// +// class CfgStack +// + +DECLARE_LIST( CfgStackList, CfgStackData * ) + +class CfgStack : public CfgStackList +{ +public: + CfgStack() : CfgStackList( 10, 10 ) {} + ~CfgStack(); + + ULONG Push( CfgStackData *pStackData ); + CfgStackData *Push( const ByteString &rTag, const ByteString &rId ); + CfgStackData *Pop() { return Remove( Count() - 1 ); } + + CfgStackData *GetStackData( ULONG nPos = LIST_APPEND ); + + ByteString GetAccessPath( ULONG nPos = LIST_APPEND ); +}; + +// +// class CfgParser +// + +class CfgParser +{ +protected: + ByteString sCurrentResTyp; + ByteString sCurrentIsoLang; + ByteString sCurrentText; + + ByteString sLastWhitespace; + + CfgStack aStack; + CfgStackData *pStackData; + + BOOL bLocalize; + + virtual void WorkOnText( + ByteString &rText, + const ByteString &nLangIndex )=0; + + virtual void WorkOnRessourceEnd()=0; + + virtual void Output( const ByteString& rOutput )=0; + + void Error( const ByteString &rError ); + +private: + int ExecuteAnalyzedToken( int nToken, char *pToken ); + std::vector aLanguages; + void AddText( + ByteString &rText, + const ByteString &rIsoLang, + const ByteString &rResTyp ); + +BOOL IsTokenClosed( const ByteString &rToken ); + +public: + CfgParser(); + virtual ~CfgParser(); + + int Execute( int nToken, char * pToken ); +}; + +// +// class CfgOutputParser +// + +class CfgOutputParser : public CfgParser +{ +protected: + SvFileStream *pOutputStream; +public: + CfgOutputParser ( const ByteString &rOutputFile ); + virtual ~CfgOutputParser(); +}; + +// +// class CfgExport +// + +class CfgExport : public CfgOutputParser +{ +private: + ByteString sPrj; + ByteString sPath; + std::vector aLanguages; +protected: + void WorkOnText( + ByteString &rText, + const ByteString &rIsoLang + ); + + void WorkOnRessourceEnd(); + void Output( const ByteString& rOutput ); +public: + CfgExport( + const ByteString &rOutputFile, + const ByteString &rProject, + const ByteString &rFilePath + ); + ~CfgExport(); +}; + +// +// class CfgMerge +// + +class CfgMerge : public CfgOutputParser +{ +private: + MergeDataFile *pMergeDataFile; + std::vector aLanguages; + ResData *pResData; + + BOOL bGerman; + ByteString sFilename; + BOOL bEnglish; + +protected: + void WorkOnText( + ByteString &rText, + const ByteString &nLangIndex ); + + void WorkOnRessourceEnd(); + + void Output( const ByteString& rOutput ); +public: + CfgMerge( + const ByteString &rMergeSource, + const ByteString &rOutputFile, + ByteString &rFilename + ); + ~CfgMerge(); +}; + +#endif diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx new file mode 100644 index 000000000000..6d94297c25fb --- /dev/null +++ b/l10ntools/inc/export.hxx @@ -0,0 +1,586 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: export.hxx,v $ + * $Revision: 1.27 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _EXPORT_HXX +#define _EXPORT_HXX + +#ifndef L10NTOOLS_DIRECTORY_HXX +#define L10NTOOLS_DIRECTORY_HXX +#include +#endif + + +// #define MERGE_SOURCE_LANGUAGES <- To merge en-US and de resource + +#include +#include +#include +#include +#include +#include + +#include /* std::hashmap*/ +#include /* std::iterator*/ +#include /* std::set*/ +#include /* std::vector*/ +#include +#include + +#include +#ifdef WNT +#include +#endif + +#define NO_TRANSLATE_ISO "x-no-translate" + +#define JAPANESE_ISO "ja" + + +struct eqstr{ + BOOL operator()(const char* s1, const char* s2) const{ + return strcmp(s1,s2)==0; + } +}; + +struct equalByteString{ + bool operator()( const ByteString& rKey1, const ByteString& rKey2 ) const { + return rKey1.CompareTo( rKey2 )==COMPARE_EQUAL; + } +}; +struct lessByteString{ + bool operator()( const ByteString& rKey1, const ByteString& rKey2 ) const { + return rKey1.CompareTo( rKey2 )==COMPARE_LESS; + } +}; + +struct hashByteString{ + size_t operator()( const ByteString& rName ) const{ + std::hash< const char* > myHash; + return myHash( rName.GetBuffer() ); + } +}; + +class PFormEntrys; +class MergeData; +typedef std::set ByteStringSet; + +typedef std::hash_map + ByteStringHashMap; + +typedef std::hash_map + ByteStringBoolHashMap; + +typedef std::hash_map + PFormEntrysHashMap; + +typedef std::hash_map + MergeDataHashMap; + +#define SOURCE_LANGUAGE ByteString("en-US") +#define LIST_REFID "LIST_REFID" + +typedef ByteStringHashMap ExportListEntry; + +DECLARE_LIST( ExportListBase, ExportListEntry * ) + +// +// class ExportList +// + +class ExportList : public ExportListBase +{ +private: + ULONG nSourceLanguageListEntryCount; + +public: + ExportList() : ExportListBase() { nSourceLanguageListEntryCount = 0; } + ULONG GetSourceLanguageListEntryCount() { return nSourceLanguageListEntryCount; } + void NewSourceLanguageListEntry() { nSourceLanguageListEntryCount++; } +}; + +#define REFID_NONE 0xFFFF + +// +// struct ResData +// + +/****************************************************************************** +* Purpose: holds mandatory data to export a single res (used with ResStack) +******************************************************************************/ + +#define ID_LEVEL_NULL 0x0000 +#define ID_LEVEL_AUTOID 0x0001 +#define ID_LEVEL_TEXT 0x0002 +#define ID_LEVEL_FIELDNAME 0x0003 +#define ID_LEVEL_ACCESSPATH 0x0004 +#define ID_LEVEL_IDENTIFIER 0x0005 +#define ID_LEVEL_LISTINDEX 0x0006 + +class ResData +{ +public: + ~ResData(); + BOOL SetId( const ByteString &rId, USHORT nLevel ); + + USHORT nWidth; + USHORT nChildIndex; + USHORT nIdLevel; + BOOL bChild; + BOOL bChildWithText; + + BOOL bText; + BOOL bHelpText; + BOOL bQuickHelpText; + BOOL bTitle; + BOOL bList; + + BOOL bRestMerged; + + ByteString sResTyp; + ByteString sId; + ByteString sGId; + ByteString sHelpId; + ByteString sFilename; + + ByteStringHashMap sText; + USHORT nTextRefId; + + ByteStringHashMap sHelpText; + USHORT nHelpTextRefId; + + ByteStringHashMap sQuickHelpText; + USHORT nQuickHelpTextRefId; + + ByteStringHashMap sTitle; + USHORT nTitleRefId; + + ByteString sTextTyp; + ByteStringHashMap aFallbackData; + ByteStringHashMap aMergedLanguages; + + ExportList *pStringList; + ExportList *pUIEntries; + ExportList *pItemList; + ExportList *pFilterList; + ExportList *pPairedList; + + ByteString sPForm; + + void Dump(); + void addFallbackData( ByteString& sId , const ByteString& sText ); + bool getFallbackData( ByteString& sId , ByteString& sText); + + void addMergedLanguage( ByteString& sLang ); + bool isMerged( ByteString& sLang ); + ResData( const ByteString &rPF, const ByteString &rGId ) + : + nWidth( 0 ), + nChildIndex( 0 ), + nIdLevel( ID_LEVEL_NULL ), + bChild( FALSE ), + bChildWithText( FALSE ), + bText( FALSE ), + bHelpText( FALSE ), + bQuickHelpText( FALSE ), + bTitle( FALSE ), + bList( FALSE ), + bRestMerged( FALSE ), + sGId( rGId ), + nTextRefId( REFID_NONE ), + nHelpTextRefId( REFID_NONE ), + nQuickHelpTextRefId( REFID_NONE ), + nTitleRefId( REFID_NONE ), + sTextTyp( "Text" ), + pStringList( NULL ), + pUIEntries( NULL ), + pItemList( NULL ), + pFilterList( NULL ), + pPairedList( NULL ), + sPForm( rPF ) + { + sGId.EraseAllChars( '\r' ); + sPForm.EraseAllChars( '\r' ); + }; + ResData( const ByteString &rPF, const ByteString &rGId , const ByteString &rFilename ) + : + nChildIndex( 0 ), + nIdLevel( ID_LEVEL_NULL ), + bChild( FALSE ), + bChildWithText( FALSE ), + bText( FALSE ), + bHelpText( FALSE ), + bQuickHelpText( FALSE ), + bTitle( FALSE ), + bList( FALSE ), + bRestMerged( FALSE ), + sGId( rGId ), + sFilename( rFilename ), + nTextRefId( REFID_NONE ), + nHelpTextRefId( REFID_NONE ), + nQuickHelpTextRefId( REFID_NONE ), + nTitleRefId( REFID_NONE ), + sTextTyp( "Text" ), + pStringList( NULL ), + pUIEntries( NULL ), + pItemList( NULL ), + pFilterList( NULL ), + pPairedList( NULL ), + sPForm( rPF ) + + { + sGId.EraseAllChars( '\r' ); + sPForm.EraseAllChars( '\r' ); + }; + + +}; + + +// +// class Export +// + +/****************************************************************************** +* Purpose: syntax check and export of *.src, called from lexer +******************************************************************************/ + +#define LIST_NON 0x0000 +#define LIST_STRING 0x0001 +#define LIST_FILTER 0x0002 +#define LIST_ITEM 0x0004 +#define LIST_PAIRED 0x0005 +#define LIST_UIENTRIES 0x0008 +#define STRING_TYP_TEXT 0x0010 +#define STRING_TYP_HELPTEXT 0x0020 +#define STRING_TYP_QUICKHELPTEXT 0x0040 +#define STRING_TYP_TITLE 0x0080 + +#define MERGE_MODE_NORMAL 0x0000 +#define MERGE_MODE_LIST 0x0001 + +DECLARE_LIST( ResStack, ResData * ) +// forwards +class WordTransformer; +class ParserQueue; + +class Export +{ +private: + WordTransformer *pWordTransformer; + + CharSet aCharSet; // used charset in src + + SvFileStream aOutput; + + ResStack aResStack; // stack for parsing recursive + + ByteString sActPForm; // hold cur. system + + BOOL bDefine; // cur. res. in a define? + BOOL bNextMustBeDefineEOL; // define but no \ at lineend + ULONG nLevel; // res. recursiv? how deep? + USHORT nList; // cur. res. is String- or FilterList + ByteString nListLang; + ULONG nListIndex; + ULONG nListLevel; + bool bSkipFile; + ByteString sProject; + ByteString sRoot; + BOOL bEnableExport; + BOOL bMergeMode; + ByteString sMergeSrc; + ByteString sLastListLine; + BOOL bError; // any errors while export? + BOOL bReadOver; + BOOL bDontWriteOutput; + ByteString sLastTextTyp; + static bool isInitialized; + ByteString sFilename; + + +public: + ParserQueue* pParseQueue; // public ? + static ByteString sLanguages; // public ? + static ByteString sForcedLanguages; // public ? + + + static bool skipProject( ByteString sPrj ) ; + static void InitLanguages( bool bMergeMode = false ); + static void InitForcedLanguages( bool bMergeMode = false ); + static std::vector GetLanguages(); + static std::vector GetForcedLanguages(); + + static void SetLanguages( std::vector val ); + static void RemoveUTF8ByteOrderMarker( ByteString &rString ); + static bool hasUTF8ByteOrderMarker( const ByteString &rString ); + static void RemoveUTF8ByteOrderMarkerFromFile( const ByteString &rFilename ); + static bool fileHasUTF8ByteOrderMarker( const ByteString &rString ); + static ByteString GetIsoLangByIndex( USHORT nIndex ); + static void QuotHTML( ByteString &rString ); + static bool CopyFile( const ByteString& source , const ByteString& dest ); + + static void QuotHTMLXRM( ByteString &rString ); + static void UnquotHTML( ByteString &rString ); + + static const char* GetEnv( const char *pVar ); + static int getCurrentDirectory( rtl::OUString& base_fqurl , rtl::OUString& base ); + + static bool isSourceLanguage( const ByteString &sLanguage ); + static bool isAllowed( const ByteString &sLanguage ); + + static bool LanguageAllowed( const ByteString &nLanguage ); + static void Languages( std::vector::const_iterator& begin , std::vector::const_iterator& end ); + static void getRandomName( const ByteString& sPrefix , ByteString& sRandStr , const ByteString& sPostfix ); + static void getRandomName( ByteString& sRandStr ); + static void getCurrentDir( std::string& dir ); + + static void replaceEncoding( ByteString& rString ); + + static ByteString GetFallbackLanguage( const ByteString nLanguage ); + static void FillInFallbacks( ResData *pResData ); + static void FillInListFallbacks( ExportList *pList, const ByteString &nSource, const ByteString &nFallback ); + static ByteString GetTimeStamp(); + static BOOL ConvertLineEnds( ByteString sSource, ByteString sDestination ); + static ByteString GetNativeFile( ByteString sSource ); + static DirEntry GetTempFile(); + + static void DumpExportList( ByteString& sListName , ExportList& aList ); + static ByteString DumpMap( ByteString& sMapName , ByteStringHashMap& aMap ); + +private: + static std::vector aLanguages; + static std::vector aForcedLanguages; + + BOOL ListExists( ResData *pResData, USHORT nLst ); + + BOOL WriteData( ResData *pResData, BOOL bCreateNew = FALSE );// called befor dest. cur ResData + BOOL WriteExportList( ResData *pResData, ExportList *pExportList, + const ByteString &rTyp, BOOL bCreateNew = FALSE ); + + ByteString MergePairedList( ByteString& sLine , ByteString& sText ); + + ByteString FullId(); // creates cur. GID + + bool PairedListFallback( ByteString& sText , ResData& aResData ); + + ByteString GetPairedListID ( const ByteString& sText ); + ByteString GetPairedListString ( const ByteString& sText ); + ByteString StripList ( const ByteString& sText ); + + void UnmergeUTF8( ByteString& sOrig ); + void InsertListEntry( const ByteString &rText, const ByteString &rLine ); + void CleanValue( ByteString &rValue ); + ByteString GetText( const ByteString &rSource, int nToken ); + + BOOL PrepareTextToMerge( ByteString &rText, USHORT nTyp, + ByteString &nLangIndex, ResData *pResData ); + + void MergeRest( ResData *pResData, USHORT nMode = MERGE_MODE_NORMAL ); + void ConvertMergeContent( ByteString &rText ); + + void WriteToMerged( const ByteString &rText , bool bSDFContent ); + void SetChildWithText(); + + void CutComment( ByteString &rText ); + +public: + Export( const ByteString &rOutput, BOOL bWrite, + const ByteString &rPrj, const ByteString &rPrjRoot , const ByteString& rFile ); + Export( const ByteString &rOutput, BOOL bWrite, + const ByteString &rPrj, const ByteString &rPrjRoot, + const ByteString &rMergeSource , const ByteString& rFile ); + ~Export(); + + void Init(); + int Execute( int nToken, const char * pToken ); // called from lexer + void SetError() { bError = TRUE; } + BOOL GetError() { return bError; } +}; + + +// +// class PFormEntrys +// + +/****************************************************************************** +* Purpose: holds information of data to merge (one pform) +******************************************************************************/ + +class PFormEntrys : public ByteString +{ +friend class MergeDataFile; +private: + ByteString sHelpText; // empty string + ByteStringHashMap sText; + ByteStringBoolHashMap bTextFirst; + ByteStringHashMap sQuickHelpText; + ByteStringBoolHashMap bQuickHelpTextFirst; + ByteStringHashMap sTitle; + ByteStringBoolHashMap bTitleFirst; + +public: + PFormEntrys( const ByteString &rPForm ) : ByteString( rPForm ) {}; + ByteString Dump(); + void InsertEntry( + const ByteString &nId , + const ByteString &rText, + const ByteString &rQuickHelpText, + const ByteString &rTitle + ) + { + + sText[ nId ] = rText; + bTextFirst[ nId ] = true; + sQuickHelpText[ nId ] = rQuickHelpText; + bQuickHelpTextFirst[ nId ] = true; + sTitle[ nId ] = rTitle; + bTitleFirst[ nId ] = true; + } + BOOL GetText( ByteString &rReturn, USHORT nTyp, const ByteString &nLangIndex, BOOL bDel = FALSE ); +}; + +// +// class MergeData +// + +/****************************************************************************** +* Purpose: holds information of data to merge (one ressource) +******************************************************************************/ + +class MergeDataFile; + +class MergeData +{ +friend class MergeDataFile; +private: + ByteString sTyp; + ByteString sGID; + ByteString sLID; + ByteString sFilename; + PFormEntrysHashMap aMap; +public: + MergeData( const ByteString &rTyp, const ByteString &rGID, const ByteString &rLID , const ByteString &rFilename ) + : sTyp( rTyp ), sGID( rGID ), sLID( rLID ) , sFilename( rFilename ) {}; + ~MergeData(); + PFormEntrys* InsertEntry( const ByteString &rPForm ); + PFormEntrys* GetPFormEntrys( ResData *pResData ); + + void Insert( const ByteString& rPFO , PFormEntrys* pfEntrys ); + PFormEntrys* GetPFObject( const ByteString& rPFO ); + + ByteString Dump(); + BOOL operator==( ResData *pData ); +}; + +// +// class MergeDataFile +// + +/****************************************************************************** +* Purpose: holds information of data to merge +******************************************************************************/ + +class MergeDataFile +{ +private: + BOOL bErrorLog; + ByteString sErrorLog; + SvFileStream aErrLog; + ByteStringSet aLanguageSet; + MergeDataHashMap aMap; + ByteStringHashMap aLanguageMap; + std::vector aLanguageList; + ByteStringHashMap aFilenames; + + +public: + MergeDataFile( const ByteString &rFileName, const ByteString& rFile , BOOL bErrLog, CharSet aCharSet, bool bCaseSensitive = false ); + ~MergeDataFile(); + + + std::vector GetLanguages(); + MergeData *GetMergeData( ResData *pResData , bool bCaseSensitve = false ); + + PFormEntrys *GetPFormEntrys( ResData *pResData ); + PFormEntrys *GetPFormEntrysCaseSensitive( ResData *pResData ); + + void InsertEntry( const ByteString &rTYP, const ByteString &rGID, const ByteString &rLID, + const ByteString &rPFO, + const ByteString &nLang , const ByteString &rTEXT, + const ByteString &rQHTEXT, const ByteString &rTITLE , + const ByteString &sFilename , bool bCaseSensitive + ); + static USHORT GetLangIndex( USHORT nId ); + static ByteString CreateKey( const ByteString& rTYP , const ByteString& rGID , const ByteString& rLID , const ByteString& rFilename , bool bCaseSensitive = false ); + + ByteString Dump(); + void WriteError( const ByteString &rLine ); +}; + + +class QueueEntry +{ +public: + QueueEntry( int nTypVal , ByteString sLineVal ): nTyp( nTypVal ) , sLine( sLineVal ){}; + int nTyp; + ByteString sLine; +}; + +class ParserQueue +{ +public: + + ParserQueue( Export& aExportObj ); + ~ParserQueue(); + + inline void Push( const QueueEntry& aEntry ); + bool bCurrentIsM; // public ? + bool bNextIsM; // public ? + bool bLastWasM; // public ? + bool bMflag; // public ? + + void Close(); +private: + // Future / Next + std::queue* aQueueNext; + // Current + std::queue* aQueueCur; + // Ref + std::queue* aQref; + + Export& aExport; + bool bStart; + bool bStartNext; + + inline void Pop( std::queue& aQueue ); + +}; +#endif + diff --git a/l10ntools/inc/gsicheck.hxx b/l10ntools/inc/gsicheck.hxx new file mode 100644 index 000000000000..13debcfc7106 --- /dev/null +++ b/l10ntools/inc/gsicheck.hxx @@ -0,0 +1,131 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: gsicheck.hxx,v $ + * $Revision: 1.8.22.1 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _GSICHECK_HXX_ +#define _GSICHECK_HXX_ + +#include "tagtest.hxx" + +// +// class GSILine +// +enum LineFormat { FORMAT_GSI, FORMAT_SDF, FORMAT_UNKNOWN }; + +class GSILine : public ByteString +{ +private: + + ParserMessageList aMessages; + LineFormat aFormat; + ULONG nLineNumber; + + ByteString aUniqId; + ByteString aLineType; + ByteString aLangId; + ByteString aText; + ByteString aQuickHelpText; + ByteString aTitle; + + BOOL bOK; + BOOL bFixed; + + void ReassembleLine(); + +public: + GSILine( const ByteString &rLine, ULONG nLine ); + LineFormat GetLineFormat() const { return aFormat; } + ULONG GetLineNumber() const { return nLineNumber; } + + ByteString const GetUniqId() const { return aUniqId; } + ByteString const GetLineType() const { return aLineType; } + ByteString const GetLanguageId() const { return aLangId; } + ByteString const GetText() const { return aText; } + String const GetUText() const { return String( aText, RTL_TEXTENCODING_UTF8 ); } + ByteString const GetQuickHelpText() const { return aQuickHelpText; } + ByteString const GetTitle() const { return aTitle; } + + void SetUText( String &aNew ) { aText = ByteString( aNew, RTL_TEXTENCODING_UTF8 ); ReassembleLine(); } + void SetText( ByteString &aNew ) { aText = aNew; ReassembleLine(); } + void SetQuickHelpText( ByteString &aNew ) { aQuickHelpText = aNew; ReassembleLine(); } + void SetTitle( ByteString &aNew ) { aTitle = aNew; ReassembleLine(); } + + ParserMessageList* GetMessageList() { return &aMessages; }; + BOOL HasMessages(){ return ( aMessages.Count() > 0 ); }; + + BOOL IsOK() const { return bOK; } + void NotOK(); + + BOOL IsFixed() const { return bFixed; } + void SetFixed() { bFixed = TRUE; }; +}; + +// +// class GSIBlock +// + +DECLARE_LIST( GSIBlock_Impl, GSILine * ) + +class LazySvFileStream; + +class GSIBlock : public GSIBlock_Impl +{ +private: + GSILine *pSourceLine; + GSILine *pReferenceLine; + void PrintList( ParserMessageList *pList, ByteString aPrefix, GSILine *pLine ); + BOOL bPrintContext; + BOOL bCheckSourceLang; + BOOL bCheckTranslationLang; + BOOL bReference; + BOOL bAllowKeyIDs; + BOOL bAllowSuspicious; + + BOOL bHasBlockError; + + BOOL IsUTF8( const ByteString &aTestee, BOOL bFixTags, USHORT &nErrorPos, ByteString &aErrorMsg, BOOL &bHasBeenFixed, ByteString &aFixed ) const; + BOOL TestUTF8( GSILine* pTestee, BOOL bFixTags ); + BOOL HasSuspiciousChars( GSILine* pTestee, GSILine* pSource ); + +public: + GSIBlock( BOOL PbPrintContext, BOOL bSource, BOOL bTrans, BOOL bRef, BOOL bAllowKID, BOOL bAllowSusp ); + ~GSIBlock(); + void PrintMessage( ByteString aType, ByteString aMsg, ByteString aPrefix, ByteString aContext, ULONG nLine, ByteString aUniqueId = ByteString() ); + void PrintError( ByteString aMsg, ByteString aPrefix, ByteString aContext, ULONG nLine, ByteString aUniqueId = ByteString() ); + void InsertLine( GSILine* pLine, const ByteString aSourceLang); + void SetReferenceLine( GSILine* pLine ); + BOOL CheckSyntax( ULONG nLine, BOOL bRequireSourceLine, BOOL bFixTags ); + + void WriteError( LazySvFileStream &aErrOut, BOOL bRequireSourceLine ); + void WriteCorrect( LazySvFileStream &aOkOut, BOOL bRequireSourceLine ); + void WriteFixed( LazySvFileStream &aFixOut, BOOL bRequireSourceLine ); +}; + +#endif + diff --git a/l10ntools/inc/helpmerge.hxx b/l10ntools/inc/helpmerge.hxx new file mode 100644 index 000000000000..0ebfa7ed62a9 --- /dev/null +++ b/l10ntools/inc/helpmerge.hxx @@ -0,0 +1,87 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: helpmerge.hxx,v $ + * $Revision: 1.12 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +// local includes +#include "export.hxx" +#include "xmlparse.hxx" +#include +#include +#include +#include /* auto_ptr */ +#include "tools/isofallback.hxx" + +#define MOVEFILE_REPLACE_EXISTING 0x01 + +/// This Class is responsible for extracting/merging OpenOffice XML Helpfiles +class HelpParser +{ +private: + ByteString sHelpFile; + bool bUTF8; + bool bHasInputList; + +/// Copy fallback language String (ENUS,DE) into position of the numeric language iso code +/// @PRECOND 0 < langIdx_in < MAX_IDX + static void FillInFallbacks( LangHashMap& rElem_out, ByteString sLangIdx_in ); + +/// Debugmethod, prints the content of the map to stdout + static void Dump( LangHashMap* rElem_in , const ByteString sKey_in ); + +/// Debugmethod, prints the content of the map to stdout + static void Dump( XMLHashMap* rElem_in ) ; + + + +public: + HelpParser( const ByteString &rHelpFile, bool bUTF8 , bool bHasInputList ); + ~HelpParser(){}; + +/// Method creates/append a SDF file with the content of a parsed XML file +/// @PRECOND rHelpFile is valid + static bool CreateSDF( const ByteString &rSDFFile_in, const ByteString &rPrj_in, const ByteString &rRoot_in, + const ByteString &sHelpFile, XMLFile *pXmlFile, const ByteString &rGsi1 ); + + static void parse_languages( std::vector& aLanguages , MergeDataFile& aMergeDataFile ); + +/// Method merges the String from the SDFfile into XMLfile. Both Strings must +/// point to existing files. + bool Merge( const ByteString &rSDFFile_in, const ByteString &rDestinationFile_in , ByteString& sLanguage , MergeDataFile& aMergeDataFile ); + bool Merge( const ByteString &rSDFFile, const ByteString &rPathX , const ByteString &rPathY , bool bISO + , const std::vector& aLanguages , MergeDataFile& aMergeDataFile , bool bCreateDir ); + +private: + static ByteString makeAbsolutePath( const ByteString& sHelpFile , const ByteString& rRoot_in ); + + ByteString GetOutpath( const ByteString& rPathX , const ByteString& sCur , const ByteString& rPathY ); + bool MergeSingleFile( XMLFile* file , MergeDataFile& aMergeDataFile , const ByteString& sLanguage , ByteString sPath ); + + void Process( LangHashMap* aLangHM , const ByteString& sCur , ResData *pResData , MergeDataFile& aMergeDataFile ); + void ProcessHelp( LangHashMap* aLangHM , const ByteString& sCur , ResData *pResData , MergeDataFile& aMergeDataFile ); + void MakeDir( const ByteString& sPath ); +}; diff --git a/l10ntools/inc/inireader.hxx b/l10ntools/inc/inireader.hxx new file mode 100644 index 000000000000..0861290adf9f --- /dev/null +++ b/l10ntools/inc/inireader.hxx @@ -0,0 +1,52 @@ +#include +#include +#include + +using namespace std; + +namespace transex3 +{ + +struct eqstr +{ + bool operator()( const string s1 , const string s2) const + { + return s1.compare( s2 ) == 0; + } +}; + +typedef std::hash_map< string , string > stringmap; +typedef std::hash_map< string, stringmap* > INImap; + +class INIreader +{ + private: + UErrorCode section_status; + UErrorCode parameter_status; + RegexMatcher* section_match; + RegexMatcher* parameter_match; + + public: + INIreader(): section_status ( U_ZERO_ERROR ) , + parameter_status ( U_ZERO_ERROR ) + { + section_match = new RegexMatcher ( "^\\s*\\[([a-zA-Z0-9]*)\\].*" , 0 , section_status ); + parameter_match = new RegexMatcher ( "^\\s*([a-zA-Z0-9]*)\\s*=\\s*([a-zA-Z0-9 ]*).*" , 0 , parameter_status ) ; + } + ~INIreader() + { + delete section_match; + delete parameter_match; + } + // open "filename", fill hash_map with sections / paramaters + bool read( INImap& myMap , string& filename ); + + private: + bool is_section( string& line , string& section_str ); + bool is_parameter( string& line , string& parameter_key , string& parameter_value ); + inline void check_status( UErrorCode status ); + inline void toStlString ( const UnicodeString& str, string& stl_str ); + inline void trim( string& str ); +}; + +} diff --git a/l10ntools/inc/l10ntools/directory.hxx b/l10ntools/inc/l10ntools/directory.hxx new file mode 100644 index 000000000000..6b71f59435f7 --- /dev/null +++ b/l10ntools/inc/l10ntools/directory.hxx @@ -0,0 +1,54 @@ +#include +#include +#include +#include + +#ifdef WNT +#else +#include +#include +#include +#endif + +#include + +#ifndef L10NTOOLS_FILE_HXX +#define L10NTOOLS_FILE_HXX +#include +#endif + +namespace transex{ + +class Directory +{ + private: + rtl::OUString sDirectoryName; + rtl::OUString sFullName; + bool bSkipLinks; + + std::vector aDirVec; + std::vector aFileVec; + + public: + std::vector getSubDirectories() { return aDirVec; } + std::vector getFiles() { return aFileVec; } + + void readDirectory(); + void readDirectory( const rtl::OUString& sFullpath ); + void scanSubDir( int nLevels = 0 ); + + rtl::OUString getDirectoryName() { return sDirectoryName; } + rtl::OUString getFullName() { return sFullName ; } + void setSkipLinks( bool is_skipped ); + + void dump(); + Directory(){}; + + Directory( const rtl::OUString sFullPath ); + Directory( const rtl::OUString sFullPath , const rtl::OUString sEntry ) ; + Directory( const ByteString sFullPath ); + + static bool lessDir ( const Directory& rKey1, const Directory& rKey2 ) ; +}; + +} diff --git a/l10ntools/inc/l10ntools/file.hxx b/l10ntools/inc/l10ntools/file.hxx new file mode 100644 index 000000000000..e3a1a46b4ee8 --- /dev/null +++ b/l10ntools/inc/l10ntools/file.hxx @@ -0,0 +1,23 @@ +#include "rtl/ustring.hxx" + +namespace transex +{ + +class File +{ + private: + rtl::OUString sFileName; + rtl::OUString sFullName; + + public: + rtl::OUString getFileName(){ return sFileName; } + rtl::OUString getFullName(){ return sFullName; } + + File( const rtl::OUString sFile ); + File( const rtl::OUString sFullName , const rtl::OUString sFile ); + + static bool lessFile ( const File& rKey1, const File& rKey2 ); + +}; + +} diff --git a/l10ntools/inc/l10ntools/vosapp.hxx b/l10ntools/inc/l10ntools/vosapp.hxx new file mode 100644 index 000000000000..49e10e15e3d4 --- /dev/null +++ b/l10ntools/inc/l10ntools/vosapp.hxx @@ -0,0 +1,33 @@ +#ifndef VOSAPP_HXX +#define VOSAPP_HXX + +#include +#include +#include +#include + +// Mininmal vcl/svapp compatibility without vcl dependence +class Application +{ +public: + USHORT GetCommandLineParamCount(); + XubString GetCommandLineParam( USHORT nParam ); + virtual void Main() = 0; +}; + +// Urg: Cut & Paste from svapp.cxx: we don't want to depend on vcl +USHORT Application::GetCommandLineParamCount() +{ + vos::OStartupInfo aStartInfo; + return (USHORT)aStartInfo.getCommandArgCount(); +} + +XubString Application::GetCommandLineParam( USHORT nParam ) +{ + vos::OStartupInfo aStartInfo; + rtl::OUString aParam; + aStartInfo.getCommandArg( nParam, aParam ); + return XubString( aParam ); +} + +#endif /* VOSAPP_HXX */ diff --git a/l10ntools/inc/lngmerge.hxx b/l10ntools/inc/lngmerge.hxx new file mode 100644 index 000000000000..502889b27aa9 --- /dev/null +++ b/l10ntools/inc/lngmerge.hxx @@ -0,0 +1,69 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: lngmerge.hxx,v $ + * $Revision: 1.9 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +// local includes +#include "export.hxx" + +DECLARE_LIST( LngLineList, ByteString * ) + +#define LNG_OK 0x0000 +#define LNG_FILE_NOTFOUND 0x0001 +#define LNG_COULD_NOT_OPEN 0x0002 +#define SDF_OK 0x0003 +#define SDF_FILE_NOTFOUND 0x0004 +#define SDF_COULD_NOT_OPEN 0x0005 + +// +// class LngParser +// + +class LngParser +{ +private: + USHORT nError; + LngLineList *pLines; + ByteString sSource; + BOOL bDBIsUTF8; + BOOL bULF; + bool bQuiet; + std::vector aLanguages; + + void FillInFallbacks( ByteStringHashMap Text ); + bool isNextGroup( ByteString &sGroup_out , ByteString &sLine_in); + void ReadLine( const ByteString &sLine_in , ByteStringHashMap &rText_inout ); + void WriteSDF( SvFileStream &aSDFStream , ByteStringHashMap &rText_inout , + const ByteString &rPrj , + const ByteString &rRoot , const ByteString &sActFileName , const ByteString &sID ); +public: + LngParser( const ByteString &rLngFile, BOOL bUTF8, BOOL bULFFormat, bool bQuiet_in ); + ~LngParser(); + + BOOL CreateSDF( const ByteString &rSDFFile, const ByteString &rPrj, const ByteString &rRoot ); + BOOL Merge( const ByteString &rSDFFile, const ByteString &rDestinationFile , const ByteString &rPrj ); +}; diff --git a/l10ntools/inc/makefile.mk b/l10ntools/inc/makefile.mk new file mode 100644 index 000000000000..6a704d63e48f --- /dev/null +++ b/l10ntools/inc/makefile.mk @@ -0,0 +1,51 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2008 by Sun Microsystems, Inc. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.3 $ +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* +PRJ=.. + +PRJNAME=l10ntools +TARGET=inc + +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk + +# --- Files -------------------------------------------------------- +# --- Targets ------------------------------------------------------- + +.INCLUDE : target.mk + +.IF "$(ENABLE_PCH)"!="" +ALLTAR : \ + $(SLO)$/precompiled.pch \ + $(SLO)$/precompiled_ex.pch + +.ENDIF # "$(ENABLE_PCH)"!="" + diff --git a/l10ntools/inc/pch/precompiled_l10ntools.cxx b/l10ntools/inc/pch/precompiled_l10ntools.cxx new file mode 100644 index 000000000000..b6cac813375f --- /dev/null +++ b/l10ntools/inc/pch/precompiled_l10ntools.cxx @@ -0,0 +1,32 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: precompiled_transex3.cxx,v $ + * $Revision: 1.3 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "precompiled_l10ntools.hxx" + diff --git a/l10ntools/inc/pch/precompiled_l10ntools.hxx b/l10ntools/inc/pch/precompiled_l10ntools.hxx new file mode 100644 index 000000000000..2ed3c72ad4ee --- /dev/null +++ b/l10ntools/inc/pch/precompiled_l10ntools.hxx @@ -0,0 +1,35 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: precompiled_transex3.hxx,v $ + * $Revision: 1.3 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): Generated on 2006-09-01 17:50:15.326479 + +#ifdef PRECOMPILED_HEADERS +#endif + diff --git a/l10ntools/inc/srciter.hxx b/l10ntools/inc/srciter.hxx new file mode 100644 index 000000000000..7f80074cd651 --- /dev/null +++ b/l10ntools/inc/srciter.hxx @@ -0,0 +1,61 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: srciter.hxx,v $ + * $Revision: 1.7 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef L10NTOOLS_DIRECTORY_HXX +#define L10NTOOLS_DIRECTORY_HXX +#include +#endif + +// class SourceTreeIterator +// + +class SourceTreeIterator +{ +private: + transex::Directory aRootDirectory; + bool bInExecute; + + void ExecuteDirectory( transex::Directory& pDirectory ); + +protected: + bool bLocal; + bool bSkipLinks; + +public: + SourceTreeIterator( const ByteString &rRootDirectory, const ByteString &rVersion , bool bLocal_in = false); + virtual ~SourceTreeIterator(); + + BOOL StartExecute(); + void EndExecute(); + + virtual void OnExecuteDirectory( const rtl::OUString &rDirectory ); +}; + + diff --git a/l10ntools/inc/tagtest.hxx b/l10ntools/inc/tagtest.hxx new file mode 100644 index 000000000000..811c4bf0e164 --- /dev/null +++ b/l10ntools/inc/tagtest.hxx @@ -0,0 +1,399 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: tagtest.hxx,v $ + * $Revision: 1.12 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _TAGTEST_HXX_ +#define _TAGTEST_HXX_ + +#include +#include +#include /* std::hashmap*/ + +class GSILine; + +typedef USHORT TokenId; + +#define TOK_INVALIDPOS USHORT( 0xFFFF ) + +class ParserMessage; + +DECLARE_LIST( Impl_ParserMessageList, ParserMessage* ) +class ParserMessageList; + + +struct equalByteString{ + bool operator()( const ByteString& rKey1, const ByteString& rKey2 ) const { + return rKey1.CompareTo( rKey2 )==COMPARE_EQUAL; + } +}; +struct lessByteString{ + bool operator()( const ByteString& rKey1, const ByteString& rKey2 ) const { + return rKey1.CompareTo( rKey2 )==COMPARE_LESS; + } +}; + +struct hashByteString{ + size_t operator()( const ByteString& rName ) const{ + std::hash< const char* > myHash; + return myHash( rName.GetBuffer() ); + } +}; + + + +typedef std::hash_map + StringHashMap; + +class TokenInfo +{ +private: + void SplitTag( ParserMessageList &rErrorList ); + + String aTagName; + StringHashMap aProperties; + BOOL bClosed; // tag is closed + BOOL bCloseTag; // tag is close Tag + + + BOOL bIsBroken; + BOOL bHasBeenFixed; + BOOL bDone; + +public: + + String aTokenString; + TokenId nId; + USHORT nPos; // Position in String + + TokenInfo():bClosed(FALSE),bCloseTag(FALSE),bIsBroken(FALSE),bHasBeenFixed(FALSE),bDone(FALSE),nId( 0 ){;} +explicit TokenInfo( TokenId pnId, USHORT nP ):bClosed(FALSE),bCloseTag(FALSE),bIsBroken(FALSE),bHasBeenFixed(FALSE),bDone(FALSE),nId( pnId ),nPos(nP){;} +explicit TokenInfo( TokenId pnId, USHORT nP, String paStr ):bClosed(FALSE),bCloseTag(FALSE),bIsBroken(FALSE),bHasBeenFixed(FALSE),bDone(FALSE),aTokenString( paStr ),nId( pnId ),nPos(nP) {;} +explicit TokenInfo( TokenId pnId, USHORT nP, String paStr, ParserMessageList &rErrorList ); + + String GetTagName() const; + + String MakeTag() const; + + /** + Is the property to be ignored or does it have the default value anyways + **/ + BOOL IsPropertyRelevant( const ByteString &aName, const String &aValue ) const; + BOOL IsPropertyValueValid( const ByteString &aName, const String &aValue ) const; + /** + Does the property contain the same value for all languages + e.g.: the href in a link tag + **/ + BOOL IsPropertyInvariant( const ByteString &aName, const String &aValue ) const; + /** + a subset of IsPropertyInvariant but containing only those that are fixable + we dont wat to fix e.g.: ahelp :: visibility + **/ + BOOL IsPropertyFixable( const ByteString &aName ) const; + BOOL MatchesTranslation( TokenInfo& rInfo, BOOL bGenErrors, ParserMessageList &rErrorList, BOOL bFixTags = FALSE ) const; + + BOOL IsDone() const { return bDone; } + void SetDone( BOOL bNew = TRUE ) { bDone = bNew; } + + BOOL HasBeenFixed() const { return bHasBeenFixed; } + void SetHasBeenFixed( BOOL bNew = TRUE ) { bHasBeenFixed = bNew; } +}; + + +class ParserMessageList : public Impl_ParserMessageList +{ +public: + void AddError( USHORT nErrorNr, ByteString aErrorText, const TokenInfo &rTag ); + void AddWarning( USHORT nErrorNr, ByteString aErrorText, const TokenInfo &rTag ); + + BOOL HasErrors(); +}; + + +#define TAG_GROUPMASK 0xF000 +#define TAG_GROUPSHIFT 12 + +#define TAG_GROUP( nTag ) (( nTag & TAG_GROUPMASK ) >> TAG_GROUPSHIFT ) +#define TAG_NOGROUP( nTag ) ( nTag & ~TAG_GROUPMASK ) // ~ = Bitweises NOT + +#define TAG_NOMORETAGS 0x0 + +#define TAG_GROUP_FORMAT 0x1 +#define TAG_ON 0x100 +#define TAG_BOLDON ( TAG_GROUP_FORMAT << TAG_GROUPSHIFT | TAG_ON | 0x001 ) +#define TAG_BOLDOFF ( TAG_GROUP_FORMAT << TAG_GROUPSHIFT | 0x001 ) +#define TAG_ITALICON ( TAG_GROUP_FORMAT << TAG_GROUPSHIFT | TAG_ON | 0x002 ) +#define TAG_ITALICOFF ( TAG_GROUP_FORMAT << TAG_GROUPSHIFT | 0x002 ) +#define TAG_UNDERLINEON ( TAG_GROUP_FORMAT << TAG_GROUPSHIFT | TAG_ON | 0x004 ) +#define TAG_UNDERLINEOFF ( TAG_GROUP_FORMAT << TAG_GROUPSHIFT | 0x004 ) + +#define TAG_GROUP_NOTALLOWED 0x2 +#define TAG_HELPID ( TAG_GROUP_NOTALLOWED << TAG_GROUPSHIFT | 0x001 ) +#define TAG_MODIFY ( TAG_GROUP_NOTALLOWED << TAG_GROUPSHIFT | 0x002 ) +#define TAG_REFNR ( TAG_GROUP_NOTALLOWED << TAG_GROUPSHIFT | 0x004 ) + +#define TAG_GROUP_STRUCTURE 0x3 +#define TAG_NAME ( TAG_GROUP_STRUCTURE << TAG_GROUPSHIFT | 0x001 ) +#define TAG_HREF ( TAG_GROUP_STRUCTURE << TAG_GROUPSHIFT | 0x002 ) +#define TAG_AVIS ( TAG_GROUP_STRUCTURE << TAG_GROUPSHIFT | 0x004 ) +#define TAG_AHID ( TAG_GROUP_STRUCTURE << TAG_GROUPSHIFT | 0x008 ) + +#define TAG_TITEL ( TAG_GROUP_STRUCTURE << TAG_GROUPSHIFT | 0x020 ) +#define TAG_KEY ( TAG_GROUP_STRUCTURE << TAG_GROUPSHIFT | 0x040 ) +#define TAG_INDEX ( TAG_GROUP_STRUCTURE << TAG_GROUPSHIFT | 0x080 ) + +#define TAG_REFSTART ( TAG_GROUP_STRUCTURE << TAG_GROUPSHIFT | 0x100 ) + +#define TAG_GRAPHIC ( TAG_GROUP_STRUCTURE << TAG_GROUPSHIFT | 0x200 ) +#define TAG_NEXTVERSION ( TAG_GROUP_STRUCTURE << TAG_GROUPSHIFT | 0x400 ) + +#define TAG_GROUP_SYSSWITCH 0x4 +#define TAG_WIN ( TAG_GROUP_SYSSWITCH << TAG_GROUPSHIFT | 0x001 ) +#define TAG_UNIX ( TAG_GROUP_SYSSWITCH << TAG_GROUPSHIFT | 0x002 ) +#define TAG_MAC ( TAG_GROUP_SYSSWITCH << TAG_GROUPSHIFT | 0x004 ) +#define TAG_OS2 ( TAG_GROUP_SYSSWITCH << TAG_GROUPSHIFT | 0x008 ) + +#define TAG_GROUP_PROGSWITCH 0x5 +#define TAG_WRITER ( TAG_GROUP_PROGSWITCH << TAG_GROUPSHIFT | 0x001 ) +#define TAG_CALC ( TAG_GROUP_PROGSWITCH << TAG_GROUPSHIFT | 0x002 ) +#define TAG_DRAW ( TAG_GROUP_PROGSWITCH << TAG_GROUPSHIFT | 0x004 ) +#define TAG_IMPRESS ( TAG_GROUP_PROGSWITCH << TAG_GROUPSHIFT | 0x008 ) +#define TAG_SCHEDULE ( TAG_GROUP_PROGSWITCH << TAG_GROUPSHIFT | 0x010 ) +#define TAG_IMAGE ( TAG_GROUP_PROGSWITCH << TAG_GROUPSHIFT | 0x020 ) +#define TAG_MATH ( TAG_GROUP_PROGSWITCH << TAG_GROUPSHIFT | 0x040 ) +#define TAG_CHART ( TAG_GROUP_PROGSWITCH << TAG_GROUPSHIFT | 0x080 ) +#define TAG_OFFICE ( TAG_GROUP_PROGSWITCH << TAG_GROUPSHIFT | 0x100 ) + + +#define TAG_GROUP_META 0x6 +#define TAG_OFFICEFULLNAME ( TAG_GROUP_META << TAG_GROUPSHIFT | 0x001 ) +#define TAG_OFFICENAME ( TAG_GROUP_META << TAG_GROUPSHIFT | 0x002 ) +#define TAG_OFFICEPATH ( TAG_GROUP_META << TAG_GROUPSHIFT | 0x004 ) +#define TAG_OFFICEVERSION ( TAG_GROUP_META << TAG_GROUPSHIFT | 0x008 ) +#define TAG_PORTALNAME ( TAG_GROUP_META << TAG_GROUPSHIFT | 0x010 ) +#define TAG_PORTALFULLNAME ( TAG_GROUP_META << TAG_GROUPSHIFT | 0x020 ) +#define TAG_PORTALPATH ( TAG_GROUP_META << TAG_GROUPSHIFT | 0x040 ) +#define TAG_PORTALVERSION ( TAG_GROUP_META << TAG_GROUPSHIFT | 0x080 ) +#define TAG_PORTALSHORTNAME ( TAG_GROUP_META << TAG_GROUPSHIFT | 0x100 ) + + +#define TAG_GROUP_SINGLE 0x7 +#define TAG_REFINSERT ( TAG_GROUP_SINGLE << TAG_GROUPSHIFT | 0x001 ) + + +#define TAG_GROUP_MULTI 0x8 +#define TAG_END ( TAG_GROUP_MULTI << TAG_GROUPSHIFT | 0x010 ) +#define TAG_ELSE ( TAG_GROUP_MULTI << TAG_GROUPSHIFT | 0x020 ) +#define TAG_AEND ( TAG_GROUP_MULTI << TAG_GROUPSHIFT | 0x040 ) +#define TAG_VERSIONEND ( TAG_GROUP_MULTI << TAG_GROUPSHIFT | 0x080 ) +#define TAG_ENDGRAPHIC ( TAG_GROUP_MULTI << TAG_GROUPSHIFT | 0x100 ) + +#define TAG_GROUP_MISC 0x9 +#define TAG_COMMONSTART ( TAG_GROUP_MISC << TAG_GROUPSHIFT | 0x001 ) +#define TAG_COMMONEND ( TAG_GROUP_MISC << TAG_GROUPSHIFT | 0x002 ) + +#define TAG_UNKNOWN_TAG ( TAG_GROUP_MULTI << TAG_GROUPSHIFT | 0x800 ) + +DECLARE_LIST( TokenListImpl, TokenInfo* ) + +class TokenList : private TokenListImpl +{ +private: + + TokenList& operator =( const TokenList& rList ); +// { TokenListImpl::operator =( rList ); return *this; } + + +public: + using TokenListImpl::Count; + + + TokenList() : TokenListImpl(){}; + ~TokenList(){ Clear(); }; + + void Clear() + { + for ( ULONG i = 0 ; i < Count() ; i++ ) + delete TokenListImpl::GetObject( i ); + TokenListImpl::Clear(); + } + void Insert( TokenInfo p, ULONG nIndex = LIST_APPEND ) + { TokenListImpl::Insert( new TokenInfo(p), nIndex ); } +/* TokenInfo Remove( ULONG nIndex ) + { + TokenInfo aT = GetObject( nIndex ); + delete TokenListImpl::GetObject( nIndex ); + TokenListImpl::Remove( nIndex ); + return aT; + }*/ +// TokenInfo Remove( TokenInfo p ){ return Remove( GetPos( p ) ); } +// TokenInfo GetCurObject() const { return *TokenListImpl::GetCurObject(); } + TokenInfo& GetObject( ULONG nIndex ) const + { +// if ( TokenListImpl::GetObject(nIndex) ) + return *TokenListImpl::GetObject(nIndex); +// else +// return TokenInfo(); + } +/* ULONG GetPos( const TokenInfo p ) const + { + for ( ULONG i = 0 ; i < Count() ; i++ ) + if ( p == GetObject( i ) ) + return i; + return LIST_ENTRY_NOTFOUND; + }*/ + + TokenList( const TokenList& rList ); +/* { + for ( ULONG i = 0 ; i < rList.Count() ; i++ ) + { + Insert( rList.GetObject( i ), LIST_APPEND ); + } + }*/ +}; + +class ParserMessage +{ + USHORT nErrorNr; + ByteString aErrorText; + USHORT nTagBegin,nTagLength; + +protected: + ParserMessage( USHORT PnErrorNr, ByteString PaErrorText, const TokenInfo &rTag ); +public: + + USHORT GetErrorNr() { return nErrorNr; } + ByteString GetErrorText() { return aErrorText; } + + USHORT GetTagBegin() { return nTagBegin; } + USHORT GetTagLength() { return nTagLength; } + + virtual ~ParserMessage() {} + virtual BOOL IsError() =0; + virtual ByteString Prefix() =0; +}; + +class ParserError : public ParserMessage +{ +public: + ParserError( USHORT PnErrorNr, ByteString PaErrorText, const TokenInfo &rTag ); + + virtual BOOL IsError() {return TRUE;}; + virtual ByteString Prefix() {return "Error:"; }; +}; + +class ParserWarning : public ParserMessage +{ +public: + ParserWarning( USHORT PnErrorNr, ByteString PaErrorText, const TokenInfo &rTag ); + + virtual BOOL IsError() {return FALSE;}; + virtual ByteString Prefix() {return "Warning:"; }; +}; + +class SimpleParser +{ +private: + USHORT nPos; + String aSource; + String aLastToken; + TokenList aTokenList; + + TokenInfo aNextTag; // to store closetag in case of combined tags like
+ + String GetNextTokenString( ParserMessageList &rErrorList, USHORT &rTokeStartPos ); + +public: + SimpleParser(); + void Parse( String PaSource ); + TokenInfo GetNextToken( ParserMessageList &rErrorList ); + static String GetLexem( TokenInfo const &aToken ); + TokenList& GetTokenList(){ return aTokenList; } +}; + +class TokenParser +{ + BOOL match( const TokenInfo &aCurrentToken, const TokenId &aExpectedToken ); + BOOL match( const TokenInfo &aCurrentToken, const TokenInfo &aExpectedToken ); + void ParseError( USHORT nErrNr, ByteString aErrMsg, const TokenInfo &rTag ); + void Paragraph(); + void PfCase(); + void PfCaseBegin(); + void AppCase(); + void AppCaseBegin(); + void CaseEnd(); + void SimpleTag(); + void TagPair(); + void TagRef(); + + SimpleParser aParser; + TokenInfo aTag; + + TokenId nPfCaseOptions; + TokenId nAppCaseOptions; + BOOL bPfCaseActive ,bAppCaseActive; + + TokenId nActiveRefTypes; + + ParserMessageList *pErrorList; + +public: + TokenParser(); + void Parse( const String &aCode, ParserMessageList* pList ); +// ParserMessageList& GetErrors(){ return aErrorList; } +// BOOL HasErrors(){ return ( aErrorList.Count() > 0 ); } + TokenList& GetTokenList(){ return aParser.GetTokenList(); } +}; + +class LingTest +{ +private: + TokenParser aReferenceParser; + TokenParser aTesteeParser; + ParserMessageList aCompareWarningList; + void CheckTags( TokenList &aReference, TokenList &aTestee, BOOL bFixTags ); + BOOL IsTagMandatory( TokenInfo const &aToken, TokenId &aMetaTokens ); + String aFixedTestee; +public: + void CheckReference( GSILine *aReference ); + void CheckTestee( GSILine *aTestee, BOOL bHasSourceLine, BOOL bFixTags ); + +// ParserMessageList& GetReferenceErrors(){ return aReferenceParser.GetErrors(); } +// BOOL HasReferenceErrors(){ return aReferenceParser.HasErrors(); } + +// ParserMessageList& GetTesteeErrors(){ return aTesteeParser.GetErrors(); } +// BOOL HasTesteeErrors(){ return aTesteeParser.HasErrors(); } + + ParserMessageList& GetCompareWarnings(){ return aCompareWarningList; } + BOOL HasCompareWarnings(){ return ( aCompareWarningList.Count() > 0 ); } + + String GetFixedTestee(){ return aFixedTestee; } +}; + +#endif + diff --git a/l10ntools/inc/tokens.h b/l10ntools/inc/tokens.h new file mode 100644 index 000000000000..ef285f4c6361 --- /dev/null +++ b/l10ntools/inc/tokens.h @@ -0,0 +1,112 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: tokens.h,v $ + * $Revision: 1.9 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _TOKENS_H +#define _TOKENS_H + +/*------------------------------------------------------ */ +/*------------------------------------------------------ */ +/* Tokens for parsing src files */ +/*------------------------------------------------------ */ +/*------------------------------------------------------ */ +#define IGNOREDTOKENS 400 /* #include | #pragma | //... | ... */ +#define COMMEND 401 /*... */ +#define DEFINEDRES 402 /* Text = { */ +#define ANYTOKEN 404 /* XYZ */ +#define UNKNOWNTOKEN 405 /* XYZ[ \t]$ */ +#define UNKNOWNCONSTRUCTION 406 /* XYZ ( xxx, yyy, zzz ) */ +#define UNKNOWNCHAR 407 /* . */ +/*------------------------------------------------------ */ +/* prev. tokens will not be executed */ +#define FILTER_LEVEL 500 +/* following tokens will be executed */ +/*------------------------------------------------------ */ +#define CONDITION 501 /* #if... | #endif ... | ... */ +#define EMPTYLINE 502 /* */ +#define RESSOURCE 503 /* Menu MID_TEST */ +#define RESSOURCEEXPR 504 /* Menu ( MID_TEST + .. ) */ +#define SMALRESSOURCE 505 /* PageItem { */ +#define TEXTLINE 506 /* TEXT = "hhh" */ +#define LONGTEXTLINE 507 /* TEXT = "hhh" TEST "HHH" ... */ +#define TEXT 508 /* "Something like this" */ +#define LEVELUP 509 /* { */ +#define LEVELDOWN 510 /* }; */ +#define APPFONTMAPPING 511 /* MAP_APPFONT(10,10) */ +#define ASSIGNMENT 512 /* Somathing = Anything */ +#define LISTASSIGNMENT 513 /* ...List [xyz]=... */ +#define LISTTEXT 514 /* < "Text" ... > */ +#define RSCDEFINE 515 /* #define MY_TEXT */ +#define RSCDEFINELEND 516 /* */ +#define NEWTEXTINRES 517 /* ### Achtung : Ne... */ +#define UIENTRIES 518 /* UIEntries = { */ +#define PRAGMA 519 /* #pragma ... */ +#define _LISTTEXT 521 /* { "Text" ... } */ +#define TEXTREFID 522 /* Text = 12345 */ +#define LISTRESID 523 /* < 12345; ... > */ +#define _LISTRESID 523 /* { 12345; ... } */ +#define NORMDEFINE 524 /* #define ... */ +/*------------------------------------------------------ */ +/*------------------------------------------------------ */ +/* Tokens for parsing cfg files */ +/*------------------------------------------------------ */ +/*------------------------------------------------------ */ +#define CFG_TAG 501 +#define CFG_TEXT_START 505 +#define CFG_TEXT_END 506 +#define CFG_TEXTCHAR 507 +#define CFG_CLOSETAG 508 +#define CFG_UNKNOWNTAG 509 +#define CFG_TOKEN_PACKAGE 600 +#define CFG_TOKEN_COMPONENT 601 +#define CFG_TOKEN_CONFIGNAME 602 +#define CFG_TOKEN_TEMPLATE 603 +#define CFG_TOKEN_OORNAME 604 +#define CFG_TOKEN_OORVALUE 605 +#define CFG_TOKEN_NO_TRANSLATE 606 + +/*------------------------------------------------------ */ +/*------------------------------------------------------ */ +/* Tokens for parsing xrm files */ +/*------------------------------------------------------ */ +/*------------------------------------------------------ */ +#define XRM_README_START 501 +#define XRM_README_END 502 +#define XRM_SECTION_START 503 +#define XRM_SECTION_END 504 +#define XRM_PARAGRAPH_START 505 +#define XRM_PARAGRAPH_END 506 +#define XRM_TEXT_START 507 +#define XRM_TEXT_END 508 +#define XRM_LIST_START 509 +#define XRM_LIST_END 510 +#define XML_TEXTCHAR 600 + + +#endif diff --git a/l10ntools/inc/treeconfig.hxx b/l10ntools/inc/treeconfig.hxx new file mode 100644 index 000000000000..96d693b0d376 --- /dev/null +++ b/l10ntools/inc/treeconfig.hxx @@ -0,0 +1,28 @@ +#include +#include + +#include "inireader.hxx" + +namespace transex3{ + +class Treeconfig +{ + + private: + INIreader inireader; + INImap map; + bool has_config_file; + void getCurrentDir( string& dir ); + bool isConfigFilePresent(); + + public: + + Treeconfig() : has_config_file( false ) { parseConfig(); } + // read the config file, returns true in case a config file had been found + bool parseConfig(); + // returns a string vector containing all active repositories, returns true in case we are deep inside + // of a source tree. This could affect the behavour of the tool + bool getActiveRepositories( vector& active_repos); +}; + +} diff --git a/l10ntools/inc/utf8conv.hxx b/l10ntools/inc/utf8conv.hxx new file mode 100644 index 000000000000..32e506edbda8 --- /dev/null +++ b/l10ntools/inc/utf8conv.hxx @@ -0,0 +1,47 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: utf8conv.hxx,v $ + * $Revision: 1.3 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// global includes +#include +#include + +// +// class UTF8Converter +// + +class UTF8Converter +{ +private: + static void Convert( ByteString &rBuffer, rtl_TextEncoding nSourceENC, rtl_TextEncoding nDestENC ); + +public: + static ByteString ConvertToUTF8( const ByteString &rASCII, rtl_TextEncoding nEncoding ); + static ByteString ConvertFromUTF8( const ByteString &rUTF8, rtl_TextEncoding nEncoding ); +}; diff --git a/l10ntools/inc/wrdtrans.hxx b/l10ntools/inc/wrdtrans.hxx new file mode 100644 index 000000000000..efcb663204a6 --- /dev/null +++ b/l10ntools/inc/wrdtrans.hxx @@ -0,0 +1,90 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: wrdtrans.hxx,v $ + * $Revision: 1.4 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +/* + +// OBSOLETE // + +#ifndef TX3_WRDTRANS_HXX +#define TX3_WRDTRANS_HXX + +// USED + // Base Classes + // Components +class WordTransTree; +class WordTrans_ErrorList; + // Parameters +#include + +class WordTransformer +{ + public: + enum E_Error + { + OK = 0, + ERROR_NO_WORDLIST, + ERROR_HOTKEY, + ERROR_OUTPUTSTRING_TOO_LONG, + OTHER_ERROR + }; + + // LIFECYCLE + WordTransformer(); + ~WordTransformer(); + BOOL LoadWordlist( /// @return False, if file could not be read, or there is already a wordlist loaded. + const ByteString & i_sWordlist_Filepath, + CharSet i_nWorkingCharSet = RTL_TEXTENCODING_MS_1252, + CharSet i_nFileCharSet = RTL_TEXTENCODING_MS_1252 ); + + // OPERATIONS + USHORT Transform( /// @return The number of errors during transforming. + ByteString & io_sText); + + // INQUIRY + USHORT NrOfErrors() const; + E_Error GetError( + USHORT i_nNr, /// [0 .. NrOfErrors()-1], other values return an empty error. + ByteString * o_pErrorText = 0) const; /// If o_pErrorText != 0, the String is filled with the description of the error. + + private: + // SERVICE FUNCTION + void CreateError(); + + // DATA + WordTransTree * dpTransformer; + WordTrans_ErrorList * + dpErrors; +}; + + + +#endif + + +*/ diff --git a/l10ntools/inc/wtranode.hxx b/l10ntools/inc/wtranode.hxx new file mode 100644 index 000000000000..4d71fc160fff --- /dev/null +++ b/l10ntools/inc/wtranode.hxx @@ -0,0 +1,121 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: wtranode.hxx,v $ + * $Revision: 1.3 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + + +#ifndef TX3_WTRANODE_HXX +#define TX3_WTRANODE_HXX + +// USED + // Base Classes + // Components + // Parameters +#include + + +typedef UINT8 BRANCH_T; + + + +const BRANCH_T C_BR_ALPHABASE = 4; +const BRANCH_T C_NR_OF_BRANCHES = 34; + + + + +/** @task + This is a node of the parsing-tree which implements the fuctionality of + class WordTransTree. + WordTransTree is dependant of this class, but NOT the other way! +**/ +class WTT_Node // WordTransTree-Node +{ + public: + enum E_TokenType + { +// no_token = 0, + token_to_keep, + token_to_replace + }; + + // LIFECYCLE + WTT_Node( + UINT8 i_nValue, // Own branch-value. + WTT_Node * i_pDefaultBranch, + WTT_Node * i_pDefaultBranchForAlphas ); + void SetBranch( + UINT8 i_cBranch, + WTT_Node * i_pNode ); + void SetAsTokenToReplace( + const ByteString & i_sReplaceString ); + ~WTT_Node(); + + // OPERATIONS + WTT_Node * GetNextNode( + UINT8 i_cBranch ); /// [0 .. C_NR_OF_BRANCHES-1], sonst GPF !!! + + // INQUIRY + E_TokenType TokenType() const; + UINT8 Value() const; + BOOL IsOnDeleting() const; + const ByteString & ReplaceString() const; + + private: + // DATA + UINT8 nValue; + E_TokenType eType; + ByteString sReplaceString; + WTT_Node * aBranches[C_NR_OF_BRANCHES]; // Mostly DYN pointers. + char bIsOnDeleting; +}; + + +inline WTT_Node * +WTT_Node::GetNextNode(UINT8 i_cBranch) + { return aBranches[i_cBranch]; } +inline WTT_Node::E_TokenType +WTT_Node::TokenType() const + { return eType; } +inline UINT8 +WTT_Node::Value() const + { return nValue; } +inline BOOL +WTT_Node::IsOnDeleting() const + { return bIsOnDeleting; } +inline const ByteString & +WTT_Node::ReplaceString() const + { return sReplaceString; } + + + + +#endif + + + diff --git a/l10ntools/inc/wtratree.hxx b/l10ntools/inc/wtratree.hxx new file mode 100644 index 000000000000..67d63280449f --- /dev/null +++ b/l10ntools/inc/wtratree.hxx @@ -0,0 +1,162 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: wtratree.hxx,v $ + * $Revision: 1.3 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + + +#ifndef TX3_WTRATREE_HXX +#define TX3_WTRATREE_HXX + +// USED + // Base Classes + // Components + // Parameters +#include + +const INT16 C_NR_OF_WTT_RESULTS = 5; +const INT16 C_NR_OF_POSSIBLE_CHARS = 256; + + +typedef unsigned char u_char; +typedef const char * constr; + + +class WTT_Node; + + +/** @task + This class implements the functionality, that class WordTransformer + offers. + WordTransformer is dependant of this class, but NOT the other way! +**/ +class WordTransTree +{ + public: + enum E_Result + { + OK = 0, + HOTKEY_LOST, + OUTPUT_OVERFLOW + }; + + + // LIFECYCLE + WordTransTree( + CharSet i_nWorkingCharSet = RTL_TEXTENCODING_MS_1252); + void SetCharSet( + CharSet i_nWorkingCharSet); + ~WordTransTree(); + + void AddWordPair( + const ByteString & i_sOldString, + const ByteString & i_sReplaceString ); + + // OPERATIONS + void InitTransformation( + const char * i_sInput, /// [!=0], a range of i_nInputLength must be valid memory for read. + UINT32 i_nInputLength, + UINT32 i_nOutputMaxLength = STRING_MAXLEN - 12 ); + E_Result TransformNextToken(); + + // INQUIRY + BOOL TextEndReached() const; + const char * Output() const; + + // These 3 functions are valid between two calls of + // TransformNextToken(): + E_Result CurResult() const; + ByteString CurReplacedString() const; + ByteString CurReplacingString() const; + char CurHotkey() const; + + private: + // SERVICE FUNCTONS + UINT8 CalculateBranch( + u_char i_cInputChar ) const; + + void Handle_Hotkey(); + void Handle_TokenToKeep(); + void Handle_TokenToTransform(); + + // DATA + // Fixed data + const u_char * sInput; + UINT32 nInputLength; + const u_char * pInputEnd; + + u_char * sOutput; // DYN + UINT32 nOutputMaxLength; + + WTT_Node * dpParsingTreeTop; // DYN + WTT_Node * pUnknownAlpha; + u_char cChar2Branch[C_NR_OF_POSSIBLE_CHARS]; + u_char c_AE, c_OE, c_UE, c_ae, c_oe, c_ue; + + // Working data + const u_char * pInputCurTokenStart; + const u_char * pInputPosition; + u_char * pOutputPosition; + WTT_Node * pCurParseNode; + + // Data which are valid only after a completed call to TransformNextToken() + E_Result eCurResult; + u_char cCurHotkey; // Letter wich is used as hotkey + u_char cCurHotkeySign; // Letter which is used to assign hotkey ('~'or '&') . +}; + + + + + + + +inline BOOL +WordTransTree::TextEndReached() const + { return pInputPosition == pInputEnd; } +inline const char * +WordTransTree::Output() const + { return TextEndReached() ? (constr) sOutput : ""; } +inline WordTransTree::E_Result +WordTransTree::CurResult() const + { return eCurResult; } +inline ByteString +WordTransTree::CurReplacedString() const + { return ByteString((constr) pInputCurTokenStart,pInputPosition-pInputCurTokenStart); } +inline char +WordTransTree::CurHotkey() const + { return cCurHotkey; } +inline UINT8 +WordTransTree::CalculateBranch(u_char i_cInputChar) const + { return cChar2Branch[i_cInputChar]; } + + + +#endif + + + diff --git a/l10ntools/inc/xmlparse.hxx b/l10ntools/inc/xmlparse.hxx new file mode 100644 index 000000000000..18b047ef75c1 --- /dev/null +++ b/l10ntools/inc/xmlparse.hxx @@ -0,0 +1,553 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: xmlparse.hxx,v $ + * $Revision: 1.15 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef BOOTSTRP_XMLPARSE_HXX +#define BOOTSTRP_XMLPARSE_HXX + +#include +#include +#include +#include +#include "tools/string.hxx" +#include "tools/list.hxx" +#define ENABLE_BYTESTRING_STREAM_OPERATORS +#include "tools/stream.hxx" +#include "tools/isofallback.hxx" +#include "export.hxx" +#include "xmlutil.hxx" + +#include +#include + +class XMLParentNode; +class XMLElement; + + +using namespace ::rtl; +using namespace std; + +#include /* std::hashmap*/ +#include /* std::deque*/ +#include /* std::iterator*/ +#include /* std::list*/ +#include /* std::vector*/ +#define XML_NODE_TYPE_FILE 0x001 +#define XML_NODE_TYPE_ELEMENT 0x002 +#define XML_NODE_TYPE_DATA 0x003 +#define XML_NODE_TYPE_COMMENT 0x004 +#define XML_NODE_TYPE_DEFAULT 0x005 +#define MAX_LANGUAGES 99 + + +//#define TESTDRIVER /* use xml2gsi testclass */ +//------------------------------------------------------------------------- + +/** Holds data of Attributes + */ +class XMLAttribute : public String +{ +private: + String sValue; + +public: + /// creates an attribute + XMLAttribute( + const String &rName, // attributes name + const String &rValue // attributes data + ) + : String( rName ), sValue( rValue ) {} + + /// getting value of an attribue + const String &GetValue() { return sValue; } + + void setValue(const String &rValue){sValue=rValue;} + + /// returns true if two attributes are equal and have the same value + BOOL IsEqual( + const XMLAttribute &rAttribute // the attribute which has to be equal + ) + { + return (( rAttribute == *this ) && ( rAttribute.sValue == sValue )); + } +}; + +DECLARE_LIST( XMLAttributeList, XMLAttribute * ) + +//------------------------------------------------------------------------- + +/** Virtual base to handle different kinds of XML nodes + */ +class XMLNode +{ +protected: + XMLNode() {} + +public: + virtual USHORT GetNodeType() = 0; + virtual ~XMLNode() {} +}; + +//------------------------------------------------------------------------- + +/** Virtual base to handle different kinds of child nodes + */ +class XMLChildNode : public XMLNode +{ +private: + XMLParentNode *pParent; + +protected: + XMLChildNode( XMLParentNode *pPar ); + XMLChildNode():pParent( NULL ){}; + XMLChildNode( const XMLChildNode& obj); + XMLChildNode& operator=(const XMLChildNode& obj); +public: + virtual USHORT GetNodeType() = 0; + + /// returns the parent of this node + XMLParentNode *GetParent() { return pParent; } + virtual ~XMLChildNode(){}; +}; + +DECLARE_LIST( XMLChildNodeList, XMLChildNode * ) + +//------------------------------------------------------------------------- + +/** Virtual base to handle different kinds of parent nodes + */ +class XMLData; + +class XMLParentNode : public XMLChildNode +{ +private: + XMLChildNodeList *pChildList; + static int dbgcnt; + //int nParentPos; +protected: + XMLParentNode( XMLParentNode *pPar ) + : XMLChildNode( pPar ), pChildList( NULL ) + { + } + XMLParentNode(): pChildList(NULL){ + } + /// Copyconstructor + XMLParentNode( const XMLParentNode& ); + + XMLParentNode& operator=(const XMLParentNode& obj); + virtual ~XMLParentNode(); + + +public: + virtual USHORT GetNodeType() = 0; + + /// returns child list of this node + XMLChildNodeList *GetChildList() { return pChildList; } + + /// adds a new child + void AddChild( + XMLChildNode *pChild /// the new child + ); + + void AddChild( + XMLChildNode *pChild , int pos /// the new child + ); + + virtual int GetPosition( ByteString id ); + int RemoveChild( XMLElement *pRefElement ); + void RemoveAndDeleteAllChilds(); + + /// returns a child element which matches the given one + XMLElement *GetChildElement( + XMLElement *pRefElement // the reference elelement + ); +}; + +//------------------------------------------------------------------------- + +DECLARE_LIST( XMLStringList, XMLElement* ) + +/// Mapping numeric Language code <-> XML Element +typedef std::hash_map< ByteString ,XMLElement* , hashByteString,equalByteString > LangHashMap; + +/// Mapping XML Element string identifier <-> Language Map +typedef std::hash_map XMLHashMap; + +/// Mapping iso alpha string code <-> iso numeric code +typedef std::hash_map HashMap; + +/// Mapping XML tag names <-> have localizable strings +typedef std::hash_map TagMap; + +/** Holds information of a XML file, is root node of tree + */ + + +class XMLFile : public XMLParentNode +{ +public: + XMLFile() ; + XMLFile( + const String &rFileName // the file name, empty if created from memory stream + ); + XMLFile( const XMLFile& obj ) ; + ~XMLFile(); + + ByteString* GetGroupID(std::deque &groupid); + void Print( XMLNode *pCur = NULL, USHORT nLevel = 0 ); + virtual void SearchL10NElements( XMLParentNode *pCur, int pos = 0 ); + void Extract( XMLFile *pCur = NULL ); + void View(); +// void static Signal_handler(int signo);//void*,oslSignalInfo * pInfo); + void showType(XMLParentNode* node); + + XMLHashMap* GetStrings(){return XMLStrings;} + BOOL Write( ByteString &rFilename ); + BOOL Write( ofstream &rStream , XMLNode *pCur = NULL ); + + bool CheckExportStatus( XMLParentNode *pCur = NULL );// , int pos = 0 ); + + XMLFile& operator=(const XMLFile& obj); + + virtual USHORT GetNodeType(); + + /// returns file name + const String &GetName() { return sFileName; } + void SetName( const String &rFilename ) { sFileName = rFilename; } + void SetFullName( const String &rFullFilename ) { sFullName = rFullFilename; } + const std::vector getOrder(){ return order; } + +protected: + // writes a string as UTF8 with dos line ends to a given stream + void WriteString( ofstream &rStream, const String &sString ); + + // quotes the given text for writing to a file + void QuotHTML( String &rString ); + + void InsertL10NElement( XMLElement* pElement); + + // DATA + String sFileName; + String sFullName; + + const ByteString ID,OLDREF,XML_LANG; + + TagMap nodes_localize; + XMLHashMap* XMLStrings; + + std::vector order; +}; + +/// An Utility class for XML +/// See RFC 3066 / #i8252# for ISO codes +class XMLUtil{ + +public: + /// Quot the XML characters and replace \n \t + static void QuotHTML( String &rString ); + + /// UnQuot the XML characters and restore \n \t + static void UnQuotHTML ( String &rString ); + + /// Return the numeric iso language code + //USHORT GetLangByIsoLang( const ByteString &rIsoLang ); + + /// Return the alpha strings representation + ByteString GetIsoLangByIndex( USHORT nIndex ); + + static XMLUtil& Instance(); + ~XMLUtil(); + + void dump(); + +private: + /// Mapping iso alpha string code <-> iso numeric code + HashMap lMap; + + /// Mapping iso numeric code <-> iso alpha string code + ByteString isoArray[MAX_LANGUAGES]; + + static void UnQuotData( String &rString ); + static void UnQuotTags( String &rString ); + + XMLUtil(); + XMLUtil(const XMLUtil&); + +}; + + + +//------------------------------------------------------------------------- + +/** Hold information of an element node + */ +class XMLElement : public XMLParentNode +{ +private: + String sElementName; + XMLAttributeList *pAttributes; + ByteString project, + filename, + id, + sOldRef, + resourceType, + languageId; + int nPos; + +protected: + void Print(XMLNode *pCur, OUStringBuffer& buffer , bool rootelement); +public: + /// create a element node + XMLElement(){} + XMLElement( + const String &rName, // the element name + XMLParentNode *Parent // parent node of this element + ): XMLParentNode( Parent ), + sElementName( rName ), + pAttributes( NULL ), + project(""), + filename(""), + id(""), + sOldRef(""), + resourceType(""), + languageId(""), + nPos(0) + { + } + ~XMLElement(); + XMLElement(const XMLElement&); + + XMLElement& operator=(const XMLElement& obj); + /// returns node type XML_NODE_ELEMENT + virtual USHORT GetNodeType(); + + /// returns element name + const String &GetName() { return sElementName; } + + /// returns list of attributes of this element + XMLAttributeList *GetAttributeList() { return pAttributes; } + + /// adds a new attribute to this element, typically used by parser + void AddAttribute( const String &rAttribute, const String &rValue ); + + void ChangeLanguageTag( const String &rValue ); + // Return a ASCII String representation of this object + OString ToOString(); + + // Return a Unicode String representation of this object + OUString ToOUString(); + + bool Equals(OUString refStr); + + /// returns a attribute + XMLAttribute *GetAttribute( + const String &rName // the attribute name + ); + void SetProject ( ByteString prj ){ project = prj; } + void SetFileName ( ByteString fn ){ filename = fn; } + void SetId ( ByteString theId ){ id = theId; } + void SetResourceType ( ByteString rt ){ resourceType = rt; } + void SetLanguageId ( ByteString lid ){ languageId = lid; } + void SetPos ( int nPos_in ){ nPos = nPos_in; } + void SetOldRef ( ByteString sOldRef_in ){ sOldRef = sOldRef_in; } + + virtual int GetPos() { return nPos; } + ByteString GetProject() { return project; } + ByteString GetFileName() { return filename; } + ByteString GetId() { return id; } + ByteString GetOldref() { return sOldRef; } + ByteString GetResourceType(){ return resourceType; } + ByteString GetLanguageId() { return languageId; } + + +}; +//------------------------------------------------------------------------- + + +/** Holds character data + */ +class XMLData : public XMLChildNode +{ +private: + String sData; + bool isNewCreated; + +public: + /// create a data node + XMLData( + const String &rData, // the initial data + XMLParentNode *Parent // the parent node of this data, typically a element node + ) + : XMLChildNode( Parent ), sData( rData ) , isNewCreated ( false ){} + XMLData( + const String &rData, // the initial data + XMLParentNode *Parent, // the parent node of this data, typically a element node + bool newCreated + ) + : XMLChildNode( Parent ), sData( rData ) , isNewCreated ( newCreated ){} + + XMLData(const XMLData& obj); + + XMLData& operator=(const XMLData& obj); + virtual USHORT GetNodeType(); + + /// returns the data + const String &GetData() { return sData; } + + bool isNew() { return isNewCreated; } + /// adds new character data to the existing one + void AddData( + const String &rData // the new data + ); + + + +}; + +//------------------------------------------------------------------------- + +/** Holds comments + */ +class XMLComment : public XMLChildNode +{ +private: + String sComment; + +public: + /// create a comment node + XMLComment( + const String &rComment, // the comment + XMLParentNode *Parent // the parent node of this comemnt, typically a element node + ) + : XMLChildNode( Parent ), sComment( rComment ) {} + + virtual USHORT GetNodeType(); + + XMLComment( const XMLComment& obj ); + + XMLComment& operator=(const XMLComment& obj); + + /// returns the comment + const String &GetComment() { return sComment; } +}; + +//------------------------------------------------------------------------- + +/** Holds additional file content like those for which no handler exists + */ +class XMLDefault : public XMLChildNode +{ +private: + String sDefault; + +public: + /// create a comment node + XMLDefault( + const String &rDefault, // the comment + XMLParentNode *Parent // the parent node of this comemnt, typically a element node + ) + : XMLChildNode( Parent ), sDefault( rDefault ) {} + + XMLDefault(const XMLDefault& obj); + + XMLDefault& operator=(const XMLDefault& obj); + + /// returns node type XML_NODE_TYPE_COMMENT + virtual USHORT GetNodeType(); + + /// returns the comment + const String &GetDefault() { return sDefault; } +}; + +//------------------------------------------------------------------------- + +/** struct for error information, used by class SimpleXMLParser + */ +struct XMLError { + XML_Error eCode; // the error code + ULONG nLine; // error line number + ULONG nColumn; // error column number + String sMessage; // readable error message +}; + +//------------------------------------------------------------------------- + +/** validating xml parser, creates a document tree with xml nodes + */ + + +class SimpleXMLParser +{ +private: + XML_Parser aParser; + XMLError aErrorInformation; + + XMLFile *pXMLFile; + XMLParentNode *pCurNode; + XMLData *pCurData; + + + static void StartElementHandler( void *userData, const XML_Char *name, const XML_Char **atts ); + static void EndElementHandler( void *userData, const XML_Char *name ); + static void CharacterDataHandler( void *userData, const XML_Char *s, int len ); + static void CommentHandler( void *userData, const XML_Char *data ); + static void DefaultHandler( void *userData, const XML_Char *s, int len ); + + + void StartElement( const XML_Char *name, const XML_Char **atts ); + void EndElement( const XML_Char *name ); + void CharacterData( const XML_Char *s, int len ); + void Comment( const XML_Char *data ); + void Default( const XML_Char *s, int len ); + + +public: + /// creates a new parser + SimpleXMLParser(); + ~SimpleXMLParser(); + + /// parse a file, returns NULL on criticall errors + XMLFile *Execute( + const String &rFullFileName, + const String &rFileName, // the file name + XMLFile *pXMLFileIn // the XMLFile + ); + + /// parse a memory stream, returns NULL on criticall errors + XMLFile *Execute( + SvMemoryStream *pStream // the stream + ); + + /// returns an error struct + const XMLError &GetError() { return aErrorInformation; } +}; + +#endif diff --git a/l10ntools/inc/xmlutil.hxx b/l10ntools/inc/xmlutil.hxx new file mode 100644 index 000000000000..812f50b85c45 --- /dev/null +++ b/l10ntools/inc/xmlutil.hxx @@ -0,0 +1,9 @@ +#define ENGLISH_US 1 +#define ENGLISH_US_ISO "en-US" +#define ENGLISH_US_PROPERTY "en_US" +#define ENGLISH_US_INDEX 1 +#define GERMAN_DE 4 +#define GERMAN_DE_ISO "x-german" +#define GERMAN_DE_INDEX 3 +#define GERMAN_ISO2 "de-DE" + diff --git a/l10ntools/inc/xrmmerge.hxx b/l10ntools/inc/xrmmerge.hxx new file mode 100644 index 000000000000..47be1ea7a038 --- /dev/null +++ b/l10ntools/inc/xrmmerge.hxx @@ -0,0 +1,161 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: xrmmerge.hxx,v $ + * $Revision: 1.7 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// global includes +#include + +// +// XRMResParser +// + +class XRMResParser +{ +private: + ByteString sGID; + ByteString sLID; + + BOOL bError; + BOOL bText; + + bool sLocalized; + + ByteString sCurrentOpenTag; + ByteString sCurrentCloseTag; + ByteString sCurrentText; + std::vector aLanguages; + +protected: + ByteString GetAttribute( const ByteString &rToken, const ByteString &rAttribute ); + void Error( const ByteString &rError ); + + virtual void Output( const ByteString& rOutput )=0; + virtual void WorkOnText( + const ByteString &rOpenTag, + ByteString &rText + )=0; + virtual void EndOfText( + const ByteString &rOpenTag, + const ByteString &rCloseTag + )=0; + + ByteString GetGID() { return sGID; } + ByteString GetLID() { return sLID; } + + void ConvertStringToDBFormat( ByteString &rString ); + void ConvertStringToXMLFormat( ByteString &rString ); + +public: + XRMResParser(); + virtual ~XRMResParser(); + + int Execute( int nToken, char * pToken ); + + void SetError( BOOL bErr = TRUE ) { bError = bErr; } + BOOL GetError() { return bError; } +}; + +// +// class XRMResOutputParser +// + +class XRMResOutputParser : public XRMResParser +{ +private: + std::vector aLanguages; +protected: + SvFileStream *pOutputStream; +public: + XRMResOutputParser ( const ByteString &rOutputFile ); + virtual ~XRMResOutputParser(); +}; + +// +// XRMResExport +// + +class XRMResExport : public XRMResOutputParser +{ +private: + ResData *pResData; + ByteString sPrj; + ByteString sPath; + std::vector aLanguages; + +protected: + void WorkOnText( + const ByteString &rOpenTag, + ByteString &rText + ); + void EndOfText( + const ByteString &rOpenTag, + const ByteString &rCloseTag + ); + void Output( const ByteString& rOutput ); + +public: + XRMResExport( + const ByteString &rOutputFile, + const ByteString &rProject, + const ByteString &rFilePath + ); + virtual ~XRMResExport(); +}; + +// +// class XRMResMerge +// + +class XRMResMerge : public XRMResOutputParser +{ +private: + MergeDataFile *pMergeDataFile; + ByteString sFilename; + ResData *pResData; + std::vector aLanguages; + +protected: + void WorkOnText( + const ByteString &rOpenTag, + ByteString &rText + ); + void EndOfText( + const ByteString &rOpenTag, + const ByteString &rCloseTag + ); + void Output( const ByteString& rOutput ); +public: + XRMResMerge( + const ByteString &rMergeSource, + const ByteString &rOutputFile, + ByteString &rFilename + ); + virtual ~XRMResMerge(); +}; + diff --git a/l10ntools/java/l10nconv/build.xml b/l10ntools/java/l10nconv/build.xml new file mode 100755 index 000000000000..6902227e5122 --- /dev/null +++ b/l10ntools/java/l10nconv/build.xml @@ -0,0 +1,233 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <i>Copyright &#169; 2004 Sun Microsystems, Inc., 901 San Antonio Road, Palo Alto, CA 94303 USA</i> +

${docname}
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/l10ntools/java/l10nconv/converter.MF b/l10ntools/java/l10nconv/converter.MF new file mode 100755 index 000000000000..843d500b7548 --- /dev/null +++ b/l10ntools/java/l10nconv/converter.MF @@ -0,0 +1 @@ +Main-Class: com.sun.star.tooling.converter.Convert diff --git a/l10ntools/java/l10nconv/documentation/readmeConverter.sxw b/l10ntools/java/l10nconv/documentation/readmeConverter.sxw new file mode 100755 index 000000000000..f779e10acb2c Binary files /dev/null and b/l10ntools/java/l10nconv/documentation/readmeConverter.sxw differ diff --git a/l10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/DirtyTagWrapCheck.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/DirtyTagWrapCheck.java new file mode 100755 index 000000000000..d304c2544bff --- /dev/null +++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/DirtyTagWrapCheck.java @@ -0,0 +1,85 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: DirtyTagWrapCheck.java,v $ + * $Revision: 1.3 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +/* + * Created on 2005 + * by Christian Schmidt + */ +package com.sun.star.tooling.DirtyTags; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.IOException; + + + +public class DirtyTagWrapCheck { + static String line=""; + public static void main(String[] args) { + try { + File fi = new File("D:\\Testfiles\\KID_helpcontent.sdf");//Copy of + FileReader fr = new FileReader(fi); + BufferedReader br = new BufferedReader(fr); + + int readCounter=0; + int missCounter=0; + int lineErrorCounter=0; + while((line=br.readLine())!=null){ + readCounter++; + String [] split = line.split("\t"); + if(split.length<15){ + + lineErrorCounter++; + continue; + } + String string = split[10]; + String wrapped = DirtyTagWrapper.wrapString(string); + String unwrapped=DirtyTagWrapper.unwrapString(wrapped); + if(!string.equals(unwrapped)){ + + missCounter++; + System.out.println(""+readCounter+"\n"+string+"\n"+unwrapped+"\n"+wrapped+"\n"); + } + } + System.out.println("Fertig "+readCounter+" "+missCounter+" "+lineErrorCounter); + } catch (FileNotFoundException e) { + // + e.printStackTrace(); + } catch (IOException e) { + // + e.printStackTrace(); + } catch (DirtyTagWrapper.TagWrapperException e) { + System.out.println(e.getMessage()+"\n"+line+"\n"); + + } + + } +} diff --git a/l10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/DirtyTagWrapper.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/DirtyTagWrapper.java new file mode 100755 index 000000000000..49fc08b69d32 --- /dev/null +++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/DirtyTagWrapper.java @@ -0,0 +1,252 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: DirtyTagWrapper.java,v $ + * $Revision: 1.3 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +/* + * Created on 2005 + * by Christian Schmidt + */ +package com.sun.star.tooling.DirtyTags; + +import java.io.IOException; +import java.util.ArrayList; + +/** + * Solves the problem with translating strings from the + * Star-Office Help. This Strings contain XML snippets + * (that means parts of an xml dokument). I call them 'dirty' + * because the start of a tag (<) and the and of an tag (>) + * are quoted by a single backslash(\<.....\>). This is done + * because the text out of th tags should not contain '<' and '>' + * as Entity references (< or >) but as readable signs. + * This is for translation purposes. + * Because translators get mad while find out the really translatable + * parts between all the markup information, the XLIFF Specification + * allows to wrap parts of a String that should not be translated by + * special tags (, ). + * This Class has two static methods that do the wrapping and unwrapping + * NOTE: this won't work with not 'dirty' Strings. + * + * @author Christian Schmidt 2005 + * + */ +public class DirtyTagWrapper { + + private static boolean doWrap=true; + public static void setWrapping(boolean doWrap){ + DirtyTagWrapper.doWrap=doWrap; + } + + /** + * Unwraps the 'dirty' parts of a String from ept and bpt tags + * + * @param checkString The String to unwrap + * @return the unwrapped String + */ + public static String unwrapString(String checkString){ + //remove the ept and bpt tags + String[] splitted =checkString.split("(])*>)|()|(])*>)|()|(])*>)|()|(])*/>)"); + StringBuffer workBuffer= new StringBuffer(); + for(int i=0;i").replaceAll( ""","\"").replaceAll( "'","'"); + + //remove the nsub tags + splitted =string.split("(])*>)|()"); + StringBuffer returnBuffer= new StringBuffer(); + for(int i=0;i"); + + ArrayList tagString =new ArrayList(); + // put the while splitting lost parts to the end of the single strings + for(int j=0;j")){ + parts2[parts2.length-1]+="\\>"; + } + // split the leading text from the real tag string (<...>) + for(int j=0;j0&&parts2[j].indexOf("\\>")>0){ + //...then split it in two parts + // the leading text + tagString.add(parts2[j].substring(0,(parts2[j].indexOf("\\<")))); + // ...and the tag + tagString.add(parts2[j].substring(parts2[j].indexOf("\\<"))); + + }else{ + //no tag...must be text only + tagString.add(parts2[j]); + } + + } + ArrayList tagNames=new ArrayList(); + String item=""; + for(int i=0;i"); + if(start>=0&&end>0){ + boolean isStandalone=false; + if(item.endsWith("/\\>")){ + // this is a standalone tag + isStandalone=true; + } + item=item.substring(start,end); + + if(item.indexOf(" ")>0){ + item=item.substring(0,item.indexOf(" ")); + } + if(isStandalone){ + item=item+"/"; + } + tagNames.add(item); + }else{ + tagNames.add(""); + } + } + ArrayList tagType=new ArrayList(); + for(int i=0;i0){ + try{ + start=new TagPair(tagList); + returnBuffer.append(start.getWrapped()); + }catch(TagPair.TagPairConstructionException e){ + throw (new DirtyTagWrapper()).new TagWrapperException(e); + } + } + TagPair.resetCounter(); + return new String(returnBuffer); + } + /** + * @author Christian Schmidt 2005 + * + */ + public class TagWrapperException extends Exception { + + /** + * Create a new Instance of TagWrapperException + * + * + */ + public TagWrapperException() { + super(); + // + } + + /** + * Create a new Instance of TagWrapperException + * + * @param arg0 + */ + public TagWrapperException(String arg0) { + super(arg0); + // + } + + /** + * Create a new Instance of TagWrapperException + * + * @param arg0 + * @param arg1 + */ + public TagWrapperException(String arg0, Throwable arg1) { + super(arg0, arg1); + // + } + + /** + * Create a new Instance of TagWrapperException + * + * @param arg0 + */ + public TagWrapperException(Throwable arg0) { + super(arg0); + // + } + + } +} diff --git a/l10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/Tag.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/Tag.java new file mode 100755 index 000000000000..7495736ab68c --- /dev/null +++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/Tag.java @@ -0,0 +1,249 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: Tag.java,v $ + * $Revision: 1.3 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +/* + * Created on 2005 + * by Christian Schmidt + */ +package com.sun.star.tooling.DirtyTags; + +import java.io.IOException; +import java.util.Map; + +import com.sun.star.tooling.converter.ExtMap; + +/** + * @author Christian Schmidt 2005 + * + */ +public class Tag { + private static int indent=0; + Map tagNames; + private String tagType; + private String tagName; + private String tagString; + public static Tag EMPTYTAG=new Tag("","",""); + + /** + * Create a new Instance of Tag + * + * @param tagType + * @param tagName + * @param tagString + */ + public Tag(String tagType, String tagName, String tagString) { + + this.tagType=tagType; + this.tagName=tagName; + this.tagString=tagString; + + tagNames=new ExtMap(); + tagNames.put("link","name"); + tagNames.put("caption","xml-lang"); + tagNames.put("alt","xml-lang"); + } + + public String getWrappedTagString() throws IOException{ + if(this.canHaveTranslateableContent()){ + return this.wrapTagStringIntern(); + }else{ + return xmlString(this.tagString); + } + } + + private final String xmlString( final String string) throws java.io.IOException { + if (string == null) + return string; // "" + String str = string; + + for(int i=0;i'){ + str=str.substring(0, i)+">"+str.substring(i+1); + continue; + } + + if(str.charAt(i)=='"'){ + str=str.substring(0, i)+"""+str.substring(i+1); + continue; + } + + if(str.charAt(i)=='\''){ + str=str.substring(0, i)+"'"+str.substring(i+1); + continue; + } + } + + return str; + } + /** + * @return + */ + private boolean canHaveTranslateableContent() { + return (tagNames.containsKey(this.tagName)); + + } + + /** + * @throws IOException + * + */ + private String wrapTagStringIntern() throws IOException { + + + String[] split=this.tagString.split("="); + int length=split.length; + // no attribute found; + if (length==0) return xmlString(tagString); + else{ + int i=0; + + while(i")<0) split[i]=xmlString(split[i]); + i++; + String value; + attributeName=(attributeName.substring(attributeName.lastIndexOf(" ")).trim()); + if((value=translateableAttributeValue(this.tagName)).equals(attributeName)){ + int valueStart=0; + int valueEnd=0; + + // get the value to the found attribute name + // it must either be surrounded by '"'... + if((valueStart=split[i].indexOf('"'))>=0){ + valueEnd = split[i].lastIndexOf('"'); + //...or surrounded by "'" + }else if((valueStart=split[i].indexOf("'"))>=0){ + valueEnd = split[i].lastIndexOf("'"); + }else{ + // there seems to be an error, + // we found an '=' (we split there) but no '"' or ''' + // but although we don't check the syntax + // we just continue + continue; + } + //ok we found the border of a value that might be translated + //now we wrap it with the tags + + split[i]=xmlString(split[i].substring(0,valueStart+1))+""+xmlString(split[i].substring(valueStart+1,valueEnd))+""+xmlString(split[i].substring(valueEnd)); + + } + } + String wrappedString=""; + // we have the wrapped parts, now we put them together + int j=0; + for(j=0;j=0&&end>0){ + tagString=tagString.substring(start,end); + + if(tagString.indexOf(" ")>0){ + tagString=tagString.substring(0,tagString.indexOf(" ")); + } + return tagString; + }else{ + return ""; + } + } + private static String extractTagType(String tagName){ + if(tagName.equals("")){ + return "Text"; + }else if(tagName.startsWith("/")){ + return "EndTag"; + }else if(tagName.endsWith("/")){ + return "StartAndEndTag"; + }else { + return "StartTag"; + } + } + + /** + * @return Returns the tagName. + */ + public String getTagName() { + return this.tagName; + } + /** + * @return Returns the tagString. + */ + public String getTagString() { + return this.tagString; + } + /** + * @return Returns the tagType. + */ + public String getTagType() { + return this.tagType; + } + + +} diff --git a/l10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/TagPair.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/TagPair.java new file mode 100755 index 000000000000..7993fc9cf0a4 --- /dev/null +++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/TagPair.java @@ -0,0 +1,310 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: TagPair.java,v $ + * $Revision: 1.3 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +/* + * Created on 2005 + * by Christian Schmidt + */ +package com.sun.star.tooling.DirtyTags; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; + + +/** + * @author Christian Schmidt 2005 + * + */ +public class TagPair { + + + private Tag startTag=Tag.EMPTYTAG; + private Tag endTag=Tag.EMPTYTAG; + private String startingText=""; + private ArrayList enclosedTags=new ArrayList(); + private long id; + private static int ElementCounter=1; + private String endingText=""; + + /** + * @author Christian Schmidt 2005 + * + */ + public class TagPairConstructionException extends Exception { + + /** + * Create a new Instance of TagPairConstructionException + * + * @param string + */ + public TagPairConstructionException(String string) { + + } + + } + + /** + * Create a new Instance of TagPair + * + * + */ + public TagPair() { + + } + + + /** + * Create a new Instance of TagPair + * + * Find matching tags in tagList, create a TagPair of it, create + * tagPairs from the content in the tagPair and remove all used + * tags from tagList. The rest of the tagList starts after the + * endTag of this TagPair. + * + * @param tagList a List of the tags to check + * + * @throws TagPairConstructionException + */ + public TagPair(ArrayList tagList) throws TagPairConstructionException { + + if(tagList.size()==0){ + return; + } + ArrayList contentList=new ArrayList();; + Tag tag=(Tag)tagList.get(0); + tagList.remove(0); + + + if("Text".equals(tag.getTagType())){ + // is this Text the only content + // of this Tag ? + if(tagList.size()==0){ + //yes...then it is the starting Text of this TagPair + this.startingText=tag.getTagString(); + return; + }else{ + //no...the tag is normal content + contentList.add(tag); + } + this.startingText=tag.getTagString(); + + }else if("EndTag".equals(tag.getTagType())){ + //ERRor throw EXception + }else if("StartTag".equals(tag.getTagType())){ + // find the matching end tag + this.startTag=tag; + Iterator iter=tagList.iterator(); + + int equivalentTagCounter=0; + while(iter.hasNext()){ + //is this the end tag? + if((tag=(Tag)iter.next()).getTagName().equals('/'+this.startTag.getTagName())&&equivalentTagCounter==0){ + //found the corresponding end tag + + //this TagPair is complete + //so it needs an id + this.id=TagPair.ElementCounter++; + this.endTag=tag; + //...remove it from list + tagList.removeAll(contentList); + tagList.remove(tag); + break; + }else{ + // tag is not the end tag + // so it is between the start and the end tag + // and belongs to the content + // but first check if it has the same name as the current tag + if(tag.getTagName().equals(this.startTag.getTagName())){ + // if this is a start tag like the current start tag + // we count it to find out the matching end tag in nested tags + if(tag.getTagType().equals("StartTag")){ + equivalentTagCounter++; + } + } + if(tag.getTagName().equals("/"+this.startTag.getTagName())){ + if(tag.getTagType().equals("EndTag")){ + equivalentTagCounter--; + } + } + + contentList.add(tag); + } + } + //found the end tag ? + //no... + if (this.endTag.getTagType()==""){ + + throw new TagPairConstructionException("ERROR: Missing end tag ("+ + this.startTag.getTagString()+")."); + //...yes + }else{ + //We need to check whether the content is starting or ending with text + //...check starting with text + if(contentList.size()>=1&&((String)((Tag)contentList.get(0)).getTagType()).equals("Text")){ + //yes...store it as startingText + this.startingText=(String)((Tag)contentList.get(0)).getTagString(); + //remove it from list + contentList.remove(0); + } + // ...check ending with text + if(contentList.size()>=1&&((String)((Tag)contentList.get(contentList.size()-1)).getTagType()).equals("Text")){ + //yes...store it as endingText + this.endingText=(String)((Tag)contentList.get(contentList.size()-1)).getTagString(); + //remove it from list + contentList.remove(contentList.size()-1); + } + //create the list of tags enclosed by this tagPair + createEnclosedTags(contentList); + } + //if stand AloneTag create own TagObject...give ID...add to List + }else if("StartAndEndTag".equals(tag.getTagType())){ + this.startTag=tag; + this.endTag=new Tag("EndOfStandAlone","",""); + createEnclosedTags(contentList); + } + + } + + /** + * @param contentList + * @throws TagPairConstructionException + */ + private void createEnclosedTags(ArrayList contentList) throws TagPairConstructionException { + while(contentList.size()>0){ + //create the inner TagPairs + this.enclosedTags.add(new TagPair(contentList)); + } + + } + + public String toString(){ + StringBuffer outString= new StringBuffer(this.startTag.toString()); + TagPair help=new TagPair(); + Iterator iter=enclosedTags.iterator(); + outString.append(this.startingText); + while(iter.hasNext()){ + if((help=(TagPair)iter.next())==null){ + continue; + }else{ + outString.append(help.toString()); + } + } + outString.append(this.endingText); + outString.append(this.endTag.toString()); + return new String(outString); + } + + public String getWrapped() throws IOException{ + Iterator iter=enclosedTags.iterator(); + StringBuffer returnBuffer=new StringBuffer(); + + returnBuffer.append(wrap(this.startTag)+xmlString(this.startingText)); + while(iter.hasNext()){ + returnBuffer.append(((TagPair)iter.next()).getWrapped()); + } + returnBuffer.append(xmlString(this.endingText)+wrap(this.endTag)); + + + + return new String(returnBuffer); + } + + private String wrap(Tag tag) throws IOException{ + String string=""; + //can be a start tag + if(tag.getTagType().startsWith("Start")){ + return new String(""+tag.getWrappedTagString()+""); + //...or a end tag + }else if (tag.getTagType().startsWith("End")){ + //maybe the end tag of a Start and end tag +// if("EndOfStandAlone".equals(tag.getTagType())){ +// return new String(""); +// }else{ + string=tag.getWrappedTagString(); + return new String(""+string+""); +// } + + //...or text + }else{ + return xmlString(tag.getTagString()); + } + } + /** + * Replaces all characters that mustn't be in XLIFF PCdata + * + * @param string the string to check + * @return the checked string with all characters replaced + * @throws java.io.IOException + */ + private final String xmlString( final String string) throws java.io.IOException { + if (string == null) + return string; // "" + String str = string; + + for(int i=0;i'){ + str=str.substring(0, i)+">"+str.substring(i+1); + continue; + } + + if(str.charAt(i)=='"'){ + str=str.substring(0, i)+"""+str.substring(i+1); + continue; + } + + if(str.charAt(i)=='\''){ + str=str.substring(0, i)+"'"+str.substring(i+1); + continue; + } + } + + return str; + } + + /** + * + */ + public static void resetCounter() { + TagPair.ElementCounter=1; + + } + + +} diff --git a/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/Convert.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/Convert.java new file mode 100755 index 000000000000..5b1fb6c62b61 --- /dev/null +++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/Convert.java @@ -0,0 +1,553 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: Convert.java,v $ + * $Revision: 1.4 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +/* + * the main Class + * + * Command Line arguments are reviewed + * and a Converter is constructed + */ +package com.sun.star.tooling.converter; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.util.Calendar; + +import com.sun.star.tooling.DirtyTags.DirtyTagWrapper; + +/** + * The main class of the converter tool + * + * The converter tool is command line based. + * Its classes allow the converting between the + * file formats sdf, gsi and xliff. + * + * Those file formats are used in localization + * of Star-Office and Open-Office. + * + * Information about the whole localization process can be found in + * http://ded-1.germany.sun.com/webcontent/guidelines/pdf/L10NSO8.pdf + * + * @author Christian Schmidt 2005 + * + */ +public class Convert { + + private static Calendar cal; + + private static final String EMPTY = ""; + + /** + * The name of the file containing the debug information + * that where found while converting (every output goes here too) + */ + private static String dbgName = EMPTY; + + /** + * the character that separates the extension from the file name + */ + private static final char extensionSeperator = '.'; + + /** + * the log File + */ + private static File log; + + /** + * the name of the log file + */ + private static String logString = EMPTY; + + /** + * indicates whether existing sources should be overwritten + * without asking + */ + private static boolean overwrite = false; + + /** + * A second Source File needed for GSI Merging + */ + private static File secondSource; + + //private static final char pathSeperator = '\\'; + + /** + * The language that should be the source language + * that means the language to translate from + */ + private static String sourceLanguage = "en-US"; + + /** + * the name of the source file + */ + private static String sourceName = EMPTY; + + /** + * the type of the source file (sdf,xliff,...) + */ + private static String sourceType = EMPTY; + + /** + * The time when converting started + */ + private static String startTime = EMPTY; + /** + * The language that should be the target language + * that means the language to translate to + */ + private static String TargetLanguage = EMPTY; + + /** + * the name of the target file + */ + private static String targetName = EMPTY; + + /** + * the type of the target file (sdf,xliff,...) + */ + private static String targetType = EMPTY; + + /** + * Store the current version ID and number of this tool + */ + final static String version = " Prod.20050710:1255 "; + + /** + * The name of the (original) sdf file used as second source for gsi->sdf merging + */ + private static String secondSourceName=EMPTY; + /** + * Indicate whether strings in xliff files should + * be wrapped with ept/bpt or sub tags to enable translation tools + * to synchronize source language string with there translation + * + * @see http://ded-1.germany.sun.com/webcontent/guidelines/pdf/L10NSO8.pdf + */ + private static boolean doWrap=true; + + + + public static void main(String[] args) throws IOException, Exception { + try{ + + //go, parse and check the command line parameters + ParameterChecker.checkClParameters(args); + ParameterChecker.createContentOfClParameters(); + //Initialize the tagWrapper + DirtyTagWrapper.setWrapping(doWrap); + //create an instance of converter + Converter conv = new Converter(sourceType, sourceName, sourceLanguage, + targetType, targetName, TargetLanguage,secondSourceName, overwrite); + // get aktual time + cal = Calendar.getInstance(); + startTime = cal.getTime().toString(); + //show infos + printPreamble(); + //do the job + conv.convert(); + + showStatistic(); + + //close log, debug... + OutputHandler.closeAll(); + + } catch(Exception e){ + System.out.print("An EXCEPTION occured, please check your commad line settings \n"+e.getMessage()); + System.exit(-1); + }catch(Throwable t){ + System.out.print("A FATAL ERROR occured, please check your commad line settings \n"+t.getMessage()); + System.exit(-1); + } + + } + + /** + * show the command line help + */ + private static void printHelp() { + + final String ls = System.getProperty("line.separator"); + System.out + .println( + + "File Converting Tool 'converter' Version " + + Convert.version + + ls + + "Converts SDF files to wellformed XLIFF or GSI files and vice versa" + ls + + ls + + "Use: " + ls + + "convert [-h]|[SourcePath [TargetPath] [-T Type] [[-S Type [secondSourcePath]] " + ls + + " [-s LanguageID] [-t LanguageID] [-l [LogPath]] [-o]]" + ls + + ls + + "-h show this help." + ls + + "SourcePath path of the file to convert." + ls + + "secondSourcePath path of the SDF file to merge to (GSI -> SDF only!)." + ls + + "TargetPath path where to store the result." + ls + + "LogPath path of the log file" + ls + + "-T Type the type of the target file (xliff,sdf,gsi)" + ls + + "-S Type the type of the source file (xliff,sdf,gsi)" + ls + + "-s LanguageID the ISO language code of the source language (de, fr...)." + ls + + " Default is 'en-US' " + ls + + "-t LanguageID the language code of the target language (de, fr...)." + ls + + " Default is first found Language other than source language." + ls + + "-l [LogPath] write a log file, you can name the file." + ls + + "-o overwrite existing files without asking." + ls + + "-nw disable the wrapping with ept/bpt tags." + ls + + ls + + "The created files were stored in the SourceFile Path if nothing else is given. " + ls + + "The extension is '.xliff','.sdf' depending on the source file and '.log' " + ls + + "for the logfile." + ls); + } + + /** + * show the parameters the converter starts with + * + * @throws IOException + */ + final private static void printPreamble() throws IOException { + OutputHandler.out(EMPTY); + OutputHandler.out("Source File is: " + sourceName); + OutputHandler.out("Target File is: " + targetName); + if (OutputHandler.doLog) { + OutputHandler.out("Log File is: " + logString); + } else { + OutputHandler.out("Log File is: disabled"); + } + + OutputHandler.out(EMPTY); + + } + + /** + * show some statistic data + * + * @throws IOException + */ + final private static void showStatistic() throws IOException { + OutputHandler.dbg(EMPTY); + OutputHandler + .out((targetType.equalsIgnoreCase("xliff") ? "TransUnits written: " + : "Lines written : ") + + Converter.getLineCounter()); + OutputHandler.dbg(EMPTY); + OutputHandler.out("Started at : " + Convert.startTime); + Convert.cal = Calendar.getInstance(); + OutputHandler.out("Finished at : " + Convert.cal.getTime()); + OutputHandler.dbg(EMPTY); + + } + + /** + * Get the extensiion of a file name + * (sdf,xliff,gsi) + * + * @param sourceString the file name + * @return the extension + */ + static protected String extractExtension(String sourceString) { + String ext = sourceString.substring(sourceString + .lastIndexOf(Convert.extensionSeperator) + 1); + return ext; + } + +// static protected String extractFileName(String sourceString) { +// String sName = EMPTY; +// sName = (sourceString.substring(sourceString +// .lastIndexOf(File.separator) + 1, sourceString +// .lastIndexOf(Convert.extensionSeperator))); +// +// return sName; +// } +// +// static protected String extractPath(String sourceString) { +// String sPath = sourceString.substring(0, sourceString +// .lastIndexOf(File.separator) + 1); +// return sPath; +// } + + /** + * + */ + public Convert() { + } + + /** + * + * Verify a parameter array and create content useable by the programm + * from the switches and attributes set at command line + * + * @author Christian Schmidt 2005 + */ + private static class ParameterChecker { + + /** + * Holds the path of the source file + */ + private static String filePath; + /** + * Holds the name of the source file + */ + private static String fileName; + + /** + * Create a new Instance of ParameterChecker + * + * + */ + public ParameterChecker(){}; + /** + * Checks the command line parameters + * + * @param args the parameters to check and to parse + * @throws IOException + */ + private static void checkClParameters(String[] args) throws IOException { + try { + //show help if no attrributes... + if (args.length == 0) { + printHelp(); + System.exit(-1); + } + //...or attribute is -h + if (args[0].equals("-h")) { + printHelp(); + System.exit(0); + } + if (args[0].equals("-ver")) { + System.out.println("File Converting Tool Version "+version); + System.exit(0); + } + //source file Location and path is always first attribute + sourceName = new String(args[0]); + + File source = new File(sourceName); + //break if there is no source to convert + if (!source.exists()) + throw new IOException("ERROR:Can not find Source File '" + + sourceName + "'. Aborting..."); + + // String name=source.getName(); + // String parent=source.getParent(); + // String path=source.getPath(); + + filePath = (source.getParent()==null)?"":source.getParent()+File.separator; //extractPath(sourceName); + fileName = source.getName().substring(0,source.getName().lastIndexOf(extensionSeperator)); + + for (int i = 1; i < args.length; i++) { + + + if ("-s".equals(args[i])) { + if (args.length > i + 1) { + sourceLanguage = args[++i]; + + } else { + throw new ConverterException( + "missing argument for -s source language"); + } + continue; + } + + if ("-S".equals(args[i])) { + if (args.length > i + 1) { + sourceType = args[++i]; + if (args.length > i +1 &&!args[i+1].startsWith("-")) { + secondSourceName = args[++i]; + } + + } else { + throw new ConverterException( + "missing argument for -S source type"); + } + continue; + } + + if ("-T".equals(args[i])) { + if (args.length > i + 1) { + targetType = args[++i]; + + + } else { + throw new ConverterException( + "missing argument for -T target type"); + } + continue; + } + + if ("-l".equals(args[i])) { + OutputHandler.doLog = true; + if (args.length > i + 1 + && (!args[i + 1].startsWith("-"))) { + logString = args[++i]; + } else { + logString = EMPTY; + } + continue; + } + + if ("-o".equals(args[i])) { + overwrite = true; + continue; + } + + if ("-nw".equals(args[i])) { + doWrap = false; + continue; + } + + if ("-h".equals(args[i])) { + printHelp(); + System.exit(0); + } + + if ("-dbg".equals(args[i])) { + OutputHandler.doDebug = true; + continue; + } + + if ("-t".equals(args[i])) { + if (args.length > i + 1) { + TargetLanguage = args[++i]; + } else { + throw new ConverterException( + "missing argument for -t target language"); + } + continue; + } + + if (i == 1 && !args[i].startsWith("-")) { //target file + // found + targetName = args[i]; + continue; + } + //if we come here we + //can not match the Attribute + throw new ConverterException("unknown Attribute: " + + args[i]); + + + }//end for + } catch (ConverterException e) { + OutputHandler.out("ERROR: "+e.getMessage()); + System.exit(-1); + } catch (Throwable t){ + System.out.print("An Error occured while parsing the command line,\n please check your commad line settings.\n "+t.getMessage()); + System.exit(-1); + } + + }//end checkClParameters + + /** + * Creates the appropriate content of what ever data + * we found in the command line + * + * @throws IOException + */ + private static void createContentOfClParameters() throws IOException { + + try { + if (OutputHandler.doDebug) { + // if the -dbg switch is set, we + // create + // a file that gets all information + // produced by this tool + + OutputHandler.dbgFile = new BufferedWriter(new FileWriter( + new File(new String(filePath + fileName + ".dbg")))); + } + + if (OutputHandler.doLog) {// create a logfile? + //given at command line? + if (EMPTY.equals(logString) || logString == null) { + logString = new String(filePath + fileName + ".log"); + } + log = FileMaker.newFile(logString, overwrite); + OutputHandler.logFile = (new BufferedWriter(new FileWriter( + log))); + } + + if (EMPTY.equals(sourceType) || sourceType == null) { + // not given at command line? + if (!(EMPTY.equals(sourceName) || sourceName == null)) { + sourceType = extractExtension(sourceName); + } else { + throw new ConverterException("Source type is missing"); + } + } + + if(sourceType.equalsIgnoreCase("gsi")){ + + if(EMPTY.equals(Convert.secondSourceName)){ + Convert.secondSourceName=filePath+fileName+".sdf"; + } + //secondSource=new File(Convert.secondSourceName); + + } + + if (EMPTY.equals(sourceName)) { + sourceName = filePath + fileName + "." + sourceType; + } + //no target type given at command line? + if (EMPTY.equals(targetType) || targetType == null) { + if (!(EMPTY.equals(targetName) || targetName == null)) { + targetType = extractExtension(targetName); + } else { + throw new ConverterException("Target type is missing"); + + } + } + //no target File specified at command line + if (EMPTY.equals(targetName) || targetName == null) { + targetName = filePath + fileName + "." + targetType; + if (targetName.equals(Convert.secondSourceName)){ + OutputHandler.out("ERROR: \nSource '"+Convert.secondSourceName+"' and \nTarget'"+targetName+"' are the same"); + System.exit(0); + }else if (targetName.equals(Convert.sourceName)){ + OutputHandler.out("ERROR: \nSource '"+Convert.sourceName+"' and \nTarget'"+targetName+"' are the same"); + System.exit(0); + } + }else if (targetName.equals(Convert.secondSourceName)){ + OutputHandler.out("ERROR: \nSource '"+Convert.secondSourceName+"' and \nTarget'"+targetName+"' are the same"); + System.exit(0); + }else if (targetName.equals(Convert.sourceName)){ + OutputHandler.out("ERROR: \nSource '"+Convert.sourceName+"' and \nTarget'"+targetName+"' are the same"); + System.exit(0); + } + + + } catch (ConverterException e) { + OutputHandler.out(e.getMessage()); + } + + } + + } + +} \ No newline at end of file diff --git a/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/Converter.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/Converter.java new file mode 100755 index 000000000000..7ec09bcb411a --- /dev/null +++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/Converter.java @@ -0,0 +1,523 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: Converter.java,v $ + * $Revision: 1.4 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +/* + * Converter.java + * + * create Source and Target + * for converting + * TODO maybe a factory would be good here + */ + +package com.sun.star.tooling.converter; + +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; + +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; + +import org.xml.sax.EntityResolver; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; +import org.xml.sax.XMLReader; +import org.xml.sax.helpers.DefaultHandler; + +/** + * + * This class handles the creating of the source to read from, + * the target to write to and the appropriate DataHandler + * + * @author Christian Schmidt 2005 + */ +public final class Converter { + + /** + * the used charset f.e. UTF-8 + */ + private final static String CHARSET = new String("UTF-8"); + + private static final String EMPTY = new String(""); + + /** + * The DataHandler use to connect reader and writer + */ + private static DataHandler handler; + + /** + * Counting the lines written by a writer + */ + private static int lineCounter; + + /** + * The target to write to + */ + private static DataWriter theTargetWriter; + + + /** + * Overwrite existing files + */ + private boolean overwrite = false; + /** + * The source to read from + */ + private Source reader; + /** + * The name of the source file + */ + private String sourceString; + /** + * the Type of the Source file(SDF,GSI,XLIFF) + */ + private String sourceType; + /** + * The name of the target fille + */ + private String targetString; + /** + * the Type of the Target file(SDF,GSI,XLIFF) + */ + private String targetType; + /** + * The writer that handles the output + */ + private Target writer; + + /** + * The sourceLanguage + */ + String sourceLanguage = "en-US"; + + /** + * The targetLanguage + */ + String targetLanguage = ""; + + /** + * The name of the second source, needed for GSI to SDF merge + */ + private String secondSourceString=EMPTY; + + + /** + * Get the line counter + * @return Returns the lineCounter. + */ + public static int getLineCounter() { + return lineCounter; + } + + /** + * increment the lineCounter + */ + final static void countLine() { + lineCounter++; + } + + /** + * Creates a new instance of Converter + * + * @param sourceType the type of the sourceFile + * @param sourceString the name of the sourceFile + * @param SourceLanguage the ISO Id of the sourceLanguage + * @param targetType the type of the targetFile + * @param targetString the name of the targetFile + * @param TargetLanguage the ISO Id of the targetLanguage + * @param secondSourceString the name of the second sourceFile (GSI merge only) + * @param overwrite indicates whether overwrite existing files + * @throws IOException + * @throws Exception + */ + public Converter(String sourceType, String sourceString, + String SourceLanguage, String targetType, String targetString, + String TargetLanguage,String secondSourceString, boolean overwrite) throws IOException, + Exception { + + this.sourceType = sourceType; + this.sourceString = sourceString; + this.sourceLanguage = SourceLanguage; + this.targetType = targetType; + this.targetString = targetString; + this.targetLanguage = TargetLanguage; + this.secondSourceString=secondSourceString; + this.overwrite = overwrite; + + handler = new DataHandler(); + + if ("sdf".equalsIgnoreCase(sourceType)) { + reader = new SDFSource(); + } else if ("xliff".equalsIgnoreCase(sourceType)||"dbxliff".equalsIgnoreCase(sourceType)) { + reader = new XLIFFSource(); + } else if ("gsi".equalsIgnoreCase(sourceType)) { + reader = new GSISource(); + } else { + throw new ConverterException("Unknown Source File Type: '"+sourceType+"'"); + } + + if ("sdf".equalsIgnoreCase(targetType)) { + writer = new SDFTarget(); + } else if ("xliff".equalsIgnoreCase(targetType)) { + writer = new XLIFFTarget(); + } else if ("gsi".equalsIgnoreCase(targetType)) { + writer = new GSITarget(); + } else { + throw new ConverterException("Unknown Target File Type: '"+targetType+"'"); + } + + } + + /** + * Do the converting from the source file format to the target file format + * + * @throws IOException + */ + public final void convert() throws IOException { + + try { + + reader.convertTo(writer); + + //TODO this belongs in the Target Class + theTargetWriter.flush(); + theTargetWriter.close(); + } catch (Exception e) { + OutputHandler.out(e.getMessage()); + } + + } + + + /** + * + * Encapsulate the reading from an GSI file + * + * @author Christian Schmidt 2005 + * + */ + private class GSISource implements Source { + DataReader theSourceReader; + /** + * Create a new Instance of GSISource + * + * @throws IOException + * @throws Exception + */ + public GSISource() throws IOException { + + theSourceReader = new GSIandSDFMerger(new File(sourceString),new File(secondSourceString), sourceLanguage, + targetLanguage, CHARSET); + } + + public void convertTo(Target t) { + + try { + theTargetWriter = t.getWriter(); + while (handler.fillDataFrom(theSourceReader)) { + + theTargetWriter.getDatafrom(handler); + theTargetWriter.writeData(); + } + } catch (IOException e) { + OutputHandler.out(e.getMessage()); + + } catch (Exception e) { + e.printStackTrace(); + } + + } + + } + /** + * + * Encapsulate to write to a GSI file + * + * @author Christian Schmidt 2005 + * + */ + private class GSITarget implements Target { + + File target; + + /** + * Create a new Instance of GSITarget + * + * @throws FileNotFoundException + * @throws IOException + */ + public GSITarget() throws FileNotFoundException, IOException { + + target = FileMaker.newFile(targetString, overwrite); + theTargetWriter = new GSIWriter(new BufferedOutputStream( + new FileOutputStream(target)), CHARSET); + } + + public DataWriter getWriter() { + + return theTargetWriter; + } + + } + /** + * + * Encapsulate the reading from an SDF file + * + * @author Christian Schmidt 2005 + * + */ + private final class SDFSource implements Source { + + DataReader Source; + + /** + * Create a new Instance of SDFSource + * @throws IOException + * @throws Exception + */ + public SDFSource() throws IOException, Exception { + + Source = new SDFReader(new File(sourceString), sourceLanguage, + targetLanguage, CHARSET); + } + + public void convertTo(Target t) { + try { + theTargetWriter = t.getWriter(); + while (handler.fillDataFrom(Source)) { + + theTargetWriter.getDatafrom(handler); + theTargetWriter.writeData(); + } + + } catch (IOException e) { + OutputHandler.out(e.getMessage()); + + } catch (Exception e) { + e.printStackTrace(); + } + + } + + } + /** + * Encapsulate writing to a SDF file + * + * @author Christian Schmidt 2005 + * + */ + private class SDFTarget implements Target { + + /** + * Create a new Instance of SDFTarget + * + * @throws IOException + */ + public SDFTarget() throws IOException { + File target = FileMaker.newFile(targetString, overwrite); + theTargetWriter = new SDFWriter(new BufferedOutputStream( + new FileOutputStream(target)), CHARSET); + } + + /* (non-Javadoc) + * @see com.sun.star.tooling.converter.Converter.Target#getWriter() + */ + public DataWriter getWriter() { + + return theTargetWriter; + } + + } + + /** + * The interface for all convertable sources + * + * @author Christian Schmidt 2005 + * + */ + private interface Source { + + DataReader Source=null; + /** + * Convert this. to the designated target + * @param target the target of the converting + * @throws IOException + */ + abstract void convertTo(Target target) throws IOException; + } + + /** + * The interface for all creatable targets + * + * @author Christian Schmidt 2005 + * + */ + private interface Target { + /** + * The writer to use + */ + public OutputStream writer = null; + + /** + * Get the writer + * this target uses to write the + * data in the correct format. + * + * @return the used DataWriter + */ + abstract DataWriter getWriter(); + + } + /** + * Encapsulate the reading from an XLIFF file + * + * @author Christian Schmidt 2005 + * + */ + private class XLIFFSource implements Source { + File source; + + /** + * Create a new Instance of XLIFFSource + * + * + */ + public XLIFFSource() { + + source = new File(sourceString); + } + + public void convertTo(Target t) throws IOException { + try { + System.setProperty("entityExpansionLimit", "1000000"); + boolean laden = source.canRead(); + if (laden) { + DefaultHandler contentHandler=null; + if("dbxliff".equalsIgnoreCase(sourceType)){ + contentHandler = new XLIFFReader(handler, t + .getWriter(),false); + }else{ + contentHandler = new XLIFFReader(handler, t + .getWriter()); + } + SAXParserFactory factory = SAXParserFactory.newInstance(); + factory.setNamespaceAware( true ); + factory.setValidating( true ); + + SAXParser parser=factory.newSAXParser(); + XMLReader xliffreader=parser.getXMLReader(); + + + +// XMLReader xliffreader = XMLReaderFactory +// .createXMLReader("org.apache.crimson.parser.XMLReaderImpl"); + xliffreader.setErrorHandler(contentHandler); + xliffreader.setContentHandler(contentHandler); + /* one possibility to resolve an extern entity (DTD) */ + EntityResolver res = new Resolver(); + xliffreader.setEntityResolver(res); + /* + * a second possibility to resolve an extern entity (DTD) + * + * xliffreader.setFeature("xml.org/sax/features/validation",true); + * xliffreader.setEntityResolver(new EntityResolver() { + * public InputSource resolveEntity(java.lang.String + * publicId, java.lang.String systemId) throws SAXException, + * java.io.IOException { if (publicId.equals("-//XLIFF//DTD + * XLIFF//EN")) // this deactivates the open office DTD + * return new InputSource(new ByteArrayInputStream( " " .getBytes())); else + * return null; } }); + * + */ + + xliffreader.parse(sourceString); + + } else { + System.out.println("Datei existiert nicht"); + } + + } catch (SAXParseException e) { + try { + theTargetWriter.flush(); + } catch (IOException e1) { + + e1.printStackTrace(); + } + OutputHandler.out("PARSE ERROR Zeile " + e.getLineNumber() + + ", " + e.getMessage()); + + }catch (SAXException e){ + try { + theTargetWriter.flush(); + } catch (IOException e1) { + + e1.printStackTrace(); + } + OutputHandler.out("PARSE EXCEPTION " + e.getMessage()); + } catch (ParserConfigurationException e) { + OutputHandler.out("PARSER Configuration failed\n " + e.getMessage()); + } + } + + } + /** + * Encapsulate writing to a XLIFF file + * + * @author Christian Schmidt 2005 + * + */ + private class XLIFFTarget implements Target { + File target; + + /** + * Create a new Instance of XLIFFTarget + * + * @throws FileNotFoundException + * @throws IOException + */ + public XLIFFTarget() throws FileNotFoundException, IOException { + target = FileMaker.newFile(targetString, overwrite); + theTargetWriter = new XLIFFWriter(new BufferedOutputStream( + new FileOutputStream(target)), CHARSET); + + } + + public DataWriter getWriter() { + + return theTargetWriter; + } + } + + +} \ No newline at end of file diff --git a/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/ConverterException.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/ConverterException.java new file mode 100755 index 000000000000..07a3708d4366 --- /dev/null +++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/ConverterException.java @@ -0,0 +1,79 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: ConverterException.java,v $ + * $Revision: 1.3 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +/* + * a simple exception + * just to seperate + * it from other + * exceptions + */ +package com.sun.star.tooling.converter; + +/** + * @author Christian Schmidt + * + * Thrown if an error occurs during converting from one file format to another + * that does not belong to an other exception + */ +public class ConverterException extends Exception { + + /** + * + */ + public ConverterException() { + super(); + + } + + /** + * @param arg0 + */ + public ConverterException(String arg0) { + super(arg0); + + } + + /** + * @param arg0 + */ + public ConverterException(Throwable arg0) { + super(arg0); + + } + + /** + * @param arg0 + * @param arg1 + */ + public ConverterException(String arg0, Throwable arg1) { + super(arg0, arg1); + + } + +} \ No newline at end of file diff --git a/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/DataHandler.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/DataHandler.java new file mode 100755 index 000000000000..e8b4136f185a --- /dev/null +++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/DataHandler.java @@ -0,0 +1,149 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: DataHandler.java,v $ + * $Revision: 1.3 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +/* + * DataHandler.java + * + * take the data from the reader + * and put it to the Writer + * + */ + +package com.sun.star.tooling.converter; + +import java.util.*; + +/** + * Handle the Data to get it from the Source + * readable to the Target + * + * @author Christian Schmidt + */ +public class DataHandler { + + /** + * An arrays that holds the names that will be + * keys for the HashMap containing the data + * + */ + private final String[] dataNames = { "BlockNr", "Project", + "SourceFile", "Dummy", "ResType", "GID", "LID", "HID", "Platform", + "Width", "SourceLanguageID", "SourceText", "SourceHText", + "SourceQText", "SourceTitle", "TargetLanguageID", "TargetText", + "TargetHText", "TargetQText", "TargetTitle", "TimeStamp" }; + + private static final String EMPTY = new String(""); + + /** + * The HashMap containing the data + */ + private final Map data = new ExtMap(dataNames, null); + + /** Creates a new instance of DataHandler */ + public DataHandler() { + } + + /** + * fill the data from the desired source + * + * @param source where to get the data from + * @return true if data is read and false if null is read + * @throws IOException + * @throws ConverterException + */ + public boolean fillDataFrom(DataReader source) throws java.io.IOException, + ConverterException { + + Map line = null; + + line = source.getData(); + if (line == null){ + + return false; + }else{ + + this.data.putAll(line); + return true; + } + + + } + + /** + * fill this data with the inData + * + * @param inData the data to handle by this handler + */ + public void fillDataWith(Map inData) { + data.putAll(inData); + } + +// public void transfer(DataWriter target, DataReader source) { +// +// source.setHandler(this); +// +// } + + /** + * The designated output is filled with the content of this handler + * + * @param output an array of Maps [0] should hold the source language data [1] the target language data + * @throws java.io.IOException + */ + public void putDataTo(Map[] output) throws java.io.IOException { + String aKey = EMPTY; + for (int j = 0; j < output.length; j++) { + Set keys = output[j].keySet(); + Iterator iter = keys.iterator(); + while (iter.hasNext()) { + aKey = (String) iter.next(); + output[j].put(aKey, data.get(aKey)); + } + } + + } + /** + * The designated output is filled with the content of this handler + * + * @param output a Map that should hold the source language data and the target language data + * @throws java.io.IOException + */ + public void putDataTo(Map output) throws java.io.IOException { + String aKey = EMPTY; + + Set keys = output.keySet(); + Iterator iter = keys.iterator(); + while (iter.hasNext()) { + aKey = (String) iter.next(); + output.put(aKey, data.get(aKey)); + } + + } + +} \ No newline at end of file diff --git a/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/DataReader.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/DataReader.java new file mode 100755 index 000000000000..59de7ca7e1f4 --- /dev/null +++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/DataReader.java @@ -0,0 +1,79 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: DataReader.java,v $ + * $Revision: 1.3 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +package com.sun.star.tooling.converter; + +import java.io.*; +import java.util.*; + +/** + * Gets Line counting from LineNumberReader all Converter Reader classes inherit + * from this. + * The abstract parent class of all converter reader classes + * + * @author Christian Schmidt + */ +abstract public class DataReader extends LineNumberReader { + + /** + * Creates a new instance of DataReader + * + * @param isr + * InputStreamReader used as Source for this class + */ + public DataReader(InputStreamReader isr) { + super(isr); + } + + /** + + * @throws java.io.IOException + * @throws ConverterException + * + * TODO this should no longer use an array as return type better a Map + * + */ + /** + * The next block of the SDF file is reviewed and the Line including the + * source language and the Line including the target Language are given back + * in an array + * + * + * @return A Map including the source language + * and the target Language content are given back + * + * @throws java.io.IOException + * @throws ConverterException + */ + public Map getData() throws java.io.IOException, ConverterException { + return null; + } + + +} \ No newline at end of file diff --git a/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/DataWriter.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/DataWriter.java new file mode 100755 index 000000000000..c5d6765e3840 --- /dev/null +++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/DataWriter.java @@ -0,0 +1,91 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: DataWriter.java,v $ + * $Revision: 1.3 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +/* + * DataWriter.java + * + * parent of all XXXWriter classes used by + * Converter + */ + +package com.sun.star.tooling.converter; + +import java.io.BufferedOutputStream; +import java.io.IOException; +import java.io.OutputStreamWriter; + +/** + * The abstract parent class of all converter writer classes + * + * @author Christian Schmidt + */ +abstract public class DataWriter extends OutputStreamWriter { + protected final String seperator = new String("|"); + + /** + * the char sequence used as line seperator + */ + protected final String lineEnd = java.lang.System.getProperty( + "line.seperator", "\n"); + + /** Creates a new instance of DataWriter */ + /** + * @param bos the buffered output stream holding the data + * @param encoding the encoding to use for read from bos + * @throws java.io.UnsupportedEncodingException + */ + public DataWriter(BufferedOutputStream bos, String encoding) + throws java.io.UnsupportedEncodingException { + super(bos, encoding); + } + +// abstract protected void writeData(Map[] data) throws java.io.IOException; + + /** + * get the data that should be written from the DataHandler + * + * @param handler the DataHandler having the data + * @throws java.io.IOException + */ + abstract protected void getDataFrom(DataHandler handler) + throws java.io.IOException; + + /** + * write the Data + * + * @throws java.io.IOException + */ + abstract protected void writeData() throws java.io.IOException; + + /** + * @param handler + * @throws IOException + */ + abstract protected void getDatafrom(DataHandler handler) throws IOException; +} \ No newline at end of file diff --git a/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/ExtMap.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/ExtMap.java new file mode 100755 index 000000000000..b05767e93ae3 --- /dev/null +++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/ExtMap.java @@ -0,0 +1,97 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: ExtMap.java,v $ + * $Revision: 1.3 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +/* + * A special HashMap, + * can be constructed of + * two Arrays + */ +package com.sun.star.tooling.converter; + +import java.util.HashMap; +import java.util.Map; + +/** + * @author Christian Schmidt + * + * Create a Hash Map from two Arrays + * + */ +public class ExtMap extends HashMap { + + /** + * + */ + public ExtMap() { + super(); + + } + + /** + * @see java.util.HashMap + * @param arg0 + */ + public ExtMap(int arg0) { + super(arg0); + + } + + /** + * @param arg0 + * @param arg1 + */ + public ExtMap(int arg0, float arg1) { + super(arg0, arg1); + + } + + /** + * @param arg0 + */ + public ExtMap(Map arg0) { + super(arg0); + + } + + // create a new Map from two string arrays + public ExtMap(String[] names, String[] content) { + super(names.length); + if (content == null) + content = new String[names.length]; + for (int i = 0; i < names.length; i++) { + if (i >= content.length) { + break; + } else { + this.put(names[i], content[i]); + } + } + + } + +} \ No newline at end of file diff --git a/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/FileMaker.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/FileMaker.java new file mode 100755 index 000000000000..a21b8daa7b1d --- /dev/null +++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/FileMaker.java @@ -0,0 +1,87 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: FileMaker.java,v $ + * $Revision: 1.3 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +/* + * creates new files + * checks if they exist or + * can be overwritten + * + */ +package com.sun.star.tooling.converter; + +import java.io.File; +import java.io.IOException; + +/** + * Creates new files only if the file does not yet exist + * or overwriting is allowed + * + * @author Christian Schmidt 2005 + * + */ +public final class FileMaker { + + /** + * Create a new file if overwriting is not alowed + * ask if existing files should be overwritten + * + * @param fileName the files name to overwrite + * @param overwrite indicates wether the file can be overwritten + * @return the File created from the fileName + * @throws IOException + */ + public final static File newFile(String fileName, boolean overwrite) + throws IOException { + File file = new File(fileName); + if (file.exists()) { + if (!overwrite) { + char c = 0; + + System.out.print("Warning: File " + fileName + + " already exist.\n" + "Overwrite (y/n) ? :"); + byte[] waste = new byte[10]; + System.in.read(waste); + c = (char) waste[0]; + if (c == 'y') { + OutputHandler.out("...overwriting " + fileName); + } else { + OutputHandler.out( + "\nPlease set '-o' switch at command line to overwrite.\n\nProgramm Aborted."); + System.exit(-1); + } + } else { + OutputHandler.out("...overwriting " + fileName); + } + } else { + OutputHandler.out("...creating new target file " + fileName); + } + return file; + } + +} \ No newline at end of file diff --git a/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/GSIReader.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/GSIReader.java new file mode 100755 index 000000000000..adb6e358a74c --- /dev/null +++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/GSIReader.java @@ -0,0 +1,250 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: GSIReader.java,v $ + * $Revision: 1.4 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +/* + * Created on 2005 + * by Christian Schmidt + */ +package com.sun.star.tooling.converter; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.HashMap; +import java.util.Map; + +import com.sun.star.tooling.languageResolver.LanguageResolver; +import com.sun.star.tooling.languageResolver.LanguageResolver.LanguageResolvingException; + +/** + * @author Christian Schmidt 2005 + * + */ +public class GSIReader extends DataReader { + /** + * A Map holding an empty GSIBlock + */ + private Map EmptyGSIBlock; + + /** + * @see LanguageResolver + */ + LanguageResolver languageResolver; + + /** + * The source language identifier + */ + protected String sourceLanguage; + + /** + * The target language identifier + */ + protected String targetLanguage; + + /** + * The number of the last block + */ + private String oldBlockNr; + + /** + * A buffer holding one GSILine + */ + private Map GSILineBuffer; + + /** + * Indicates whether to use the buffered line + */ + private boolean useBuffer = false; + + private static final String EMPTY = new String(""); + + /** + * An empty Map to fill with language depending data + */ + private ExtMap EmptyLanguageMap; + + /** + * Indicates whether the first block is read + */ + private boolean isFirst = true; + + private int lineCounter; + + private int blockCounter; + /** + * Indicates whether the last line is read + */ + private boolean lastLineFound = false; + + /** + * Create a new Instance of GSIReader + * + * @param source + * the file to read from + * @param sourceLanguage + * the sourceLanguage (must not be empty) + * @param targetLanguage + * the targetLanguage + * @param charset + * the charset used to read source + * @throws java.io.IOException + * @throws Exception + */ + public GSIReader(File source, String sourceLanguage, String targetLanguage, + String charset) throws java.io.IOException { + super(new InputStreamReader(new FileInputStream(source), charset)); + this.languageResolver = new LanguageResolver(); + this.sourceLanguage = sourceLanguage; + this.targetLanguage = targetLanguage; + + EmptyLanguageMap = new ExtMap(new String[0], new String[0]); + + } + + /** + * Read the next GSIBlock and return the data + * + * @return A Map containing the data of the read GSIBlock the keys for the language depending data are the language id (numeric) the + * single language are acessible with the keys "BlockNr", "resType", "languageNr", "status","content". + * + * @throws IOException + */ + public Map getGSIData() throws IOException { + String help; + Map helpmap; + Map GSIBlock = new HashMap(); + GSIBlock.put(sourceLanguage, EmptyLanguageMap.clone()); + GSIBlock.put(targetLanguage, EmptyLanguageMap.clone()); + String line = EMPTY; + String[] splitLine; + Map GSILine; + String[] GSINames = { "BlockNr", "resType", "languageNr", "status", + "content" }; + + while (useBuffer || (line = readLine()) != null) { + + + + if (useBuffer) { + GSILine = GSILineBuffer; + GSIBlock.put(sourceLanguage, EmptyLanguageMap.clone()); + GSIBlock.put(targetLanguage, EmptyLanguageMap.clone()); + GSIBlock.put("BlockNr", GSILine.get("BlockNr")); + useBuffer = false; + } else { + this.lineCounter++; + if ((splitLine = split(line)) == null) { + continue; + } + GSILine = new ExtMap(GSINames, splitLine); + if (isFirst) { + GSIBlock.put("BlockNr", GSILine.get("BlockNr")); + oldBlockNr = (String) GSILine.get("BlockNr"); + isFirst = false; + } + } + if (oldBlockNr == null) { + oldBlockNr = (String) GSILine.get("BlockNr"); + } + if (!oldBlockNr.equals((String) GSILine.get("BlockNr"))) { + GSILineBuffer = GSILine; + oldBlockNr = (String) GSILine.get("BlockNr"); + useBuffer = true; + break; + } + String lang; + try { + // Is there the source language in this line? + if ((lang = languageResolver.getISOfromNr((String) GSILine + .get("languageNr"))).equals(this.sourceLanguage)) { + // ok..store it as Source String under the depending + // ressource type + + ((Map) GSIBlock.get(sourceLanguage)).put("Source" + + ResTypeResolver.getInternKey((String) GSILine + .get("resType")), GSILine.get("content")); + // ..maybe the target language? + } else { + if (targetLanguage.equals(EMPTY)) { + // if no target language is given at command line + targetLanguage = lang; + GSIBlock.put(targetLanguage, EmptyLanguageMap.clone()); + } + if (lang.equals(this.targetLanguage)) { + + // ok..store it as target String under the depending + // ressource type + ((Map) GSIBlock.get(targetLanguage)).put("Target" + + ResTypeResolver.getInternKey((String) GSILine + .get("resType")), GSILine + .get("content")); + } + } + } catch (LanguageResolvingException e) { + OutputHandler.out("Can not resolve the language "+e.getMessage()); + } + + } + if (line == null) { + if (lastLineFound){ + OutputHandler.out("\n\n"); + OutputHandler.out("GSI Blocks : " + this.blockCounter); + OutputHandler.out("GSI Lines : " + this.lineCounter); + + return null; + }else{ + lastLineFound = true; + this.blockCounter++; + return GSIBlock; + } + } else { + this.blockCounter++; + return GSIBlock; + } + + } + + /** + * Split a GSILine to single fields + * + * @param line + * The line to split + * @return An array containing the contents of the columns in the given line + */ + private String[] split(String line) { + String[] splitLine = (line.substring(0, line.length() - 1)) + .split("\\(\\$\\$\\)"); + if (splitLine.length != 5) + return null; + else + return splitLine; + } + +} diff --git a/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/GSIWriter.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/GSIWriter.java new file mode 100755 index 000000000000..085e26475e09 --- /dev/null +++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/GSIWriter.java @@ -0,0 +1,246 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: GSIWriter.java,v $ + * $Revision: 1.3 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package com.sun.star.tooling.converter; +import java.io.*; +import java.util.Map; + +import com.sun.star.tooling.languageResolver.LanguageResolver; +import com.sun.star.tooling.languageResolver.LanguageResolver.LanguageResolvingException; +/** + * + * @author cs156069 + */ +public class GSIWriter extends DataWriter { + /** + * The seperator used to seperate GSI columns + */ + final String seperator=new String("($$)"); + + /** + * Holding the keys used by a map holding the content of an GSI Line contianing the source language + */ + final static String[] sourceLineNames= {"Project","SourceFile","Dummy","ResType","GID","LID","HID","Platform","Width","SourceLanguageID","SourceText","SourceHText","SourceQText","SourceTitle","TimeStamp"}; + /** + * Holding the keys used by a map holding the content of an GSI Line contianing the target language + */ + final static String[] targetLineNames= {"Project","SourceFile","Dummy","ResType","GID","LID","HID","Platform","Width","TargetLanguageID","TargetText","TargetHText","TargetQText","TargetTitle","TimeStamp"}; + /** + * Holding the keys used by a map holding the content of an GSI Line contianing the source and the target language + */ + final static String[] outLineNames= {"BlockNr","Project","SourceFile","Dummy","ResType","GID","LID","HID","Platform","Width","SourceLanguageID","SourceText","SourceHText","SourceQText","SourceTitle","TargetLanguageID","TargetText","TargetHText","TargetQText","TargetTitle","TimeStamp"}; + + /** + * A map holding the content of an GSI Line contianing the source language + */ + private ExtMap sourceLine=new ExtMap(sourceLineNames,null); + /** + * A map holding the content of an GSI Line contianing the target language + */ + private ExtMap targetLine=new ExtMap(targetLineNames,null); + /** + * A map holding the content of an GSI Line contianing the source and the target language + */ + private ExtMap outData=new ExtMap(outLineNames, null); + + private static final String EMPTY = new String(""); + /** + * The sourceLanguage to use + */ + private String sourceLanguage; + /** + * The sourceLanguage to use + */ + private String targetLanguage; + + /** + * GSILines have a special Line End + */ + private final static String lineEnd="!"+'\r'+'\n'; + //private boolean SourceIsFirst=false; + + /** + * The blockNr of the current line + */ + private String blockNr; + + + + + /** + * Create a new Instance of GSIWriter + * + * @param bos the Buffered Output Stream to write to + * @param charset the used charset + * @throws java.io.UnsupportedEncodingException + */ + public GSIWriter(BufferedOutputStream bos,String charset) throws java.io.UnsupportedEncodingException { + super(bos,charset); + + + + } + + /* (non-Javadoc) + * @see com.sun.star.tooling.converter.DataWriter#writeData() + */ + public final void writeData() throws java.io.IOException { + + StringBuffer buffer=new StringBuffer(""); + if(this.sourceLanguage==null&&this.targetLanguage==null){ + LanguageResolver lang =new LanguageResolver(); + try { + this.sourceLanguage=lang.getNrFromISO((String)outData.get("SourceLanguageID")); + this.targetLanguage=lang.getNrFromISO((String)outData.get("TargetLanguageID")); + } catch (LanguageResolvingException e) { + + OutputHandler.out(e.getMessage()); + System.exit(0); + } + } + + + this.blockNr=(String)outData.get("BlockNr"); + // get the values of the found fields + //create the gsi lines + // + //at first the source language line + buffer.append(getSourceLine("Text")); + buffer.append(getSourceLine("HText")); + buffer.append(getSourceLine("QText")); + buffer.append(getSourceLine("Title")); + + //now the target language line + // put them together for output + buffer.append(getTargetLine("Text")); + buffer.append(getTargetLine("HText")); + buffer.append(getTargetLine("QText")); + buffer.append(getTargetLine("Title")); + //ok...put all to disk; + this.write(buffer.toString()); + + } + + /** + * Create a line containing the source string from the data + * @param resType + * @return The StringBuffer containing the line + */ + private StringBuffer getSourceLine(String resType){ + StringBuffer buffer =new StringBuffer(200); + String resString = "Source"+resType; + + String help; + if(EMPTY.equals((String)outData.get(resString))||" ".equals(outData.get(resString))) return new StringBuffer(EMPTY); + else { + // put them together for output + buffer.append(this.blockNr); + // seperate the fields with ($$) + buffer.append(this.seperator); + buffer.append(ResTypeResolver.getExternKey(resType)); + // seperate the fields with ($$) + buffer.append(this.seperator); + buffer.append(this.sourceLanguage); + // seperate the fields with ($$) + buffer.append(this.seperator); + buffer.append("int"); + // seperate the fields with ($$) + buffer.append(this.seperator); + buffer.append(outData.get(resString)); + + // this line is full + // so close it with '! cr lf' + buffer.append(GSIWriter.lineEnd); + Converter.countLine(); + return buffer; + } + + } + /** + * Create a line containing the target string from the data + * @param resType + * @return The StringBuffer containing the line + */ + private StringBuffer getTargetLine(String resType){ + StringBuffer buffer =new StringBuffer(200); + String resString = "Target"+resType; + + if(EMPTY.equals((String)outData.get(resString))||" ".equals(outData.get(resString))) return new StringBuffer(EMPTY); + else { + // put them together for output + buffer.append(this.blockNr); + // seperate the fields with ($$) + buffer.append(this.seperator); + buffer.append(ResTypeResolver.getExternKey(resType)); + // seperate the fields with ($$) + buffer.append(this.seperator); + buffer.append(this.targetLanguage); + // seperate the fields with ($$) + buffer.append(this.seperator); + buffer.append("ext"); + // seperate the fields with ($$) + buffer.append(this.seperator); + buffer.append(outData.get(resString)); + + // this line is full + // so close it with '! cr lf' + buffer.append(GSIWriter.lineEnd); + Converter.countLine(); + return buffer; + } + + } + + + /* (non-Javadoc) + * @see com.sun.star.tooling.converter.DataWriter#writeData(java.util.Map[]) + */ + protected void writeData(Map[] data) throws IOException { + // TODO redesign DataHandler in the way that this is not nessesary any more + + } + + /* (non-Javadoc) + * @see com.sun.star.tooling.converter.DataWriter#getDataFrom(com.sun.star.tooling.converter.DataHandler) + */ + protected void getDataFrom(DataHandler handler) throws IOException { + + handler.putDataTo(this.outData); + } + + /* (non-Javadoc) + * @see com.sun.star.tooling.converter.DataWriter#getDatafrom(com.sun.star.tooling.converter.DataHandler) + */ + protected void getDatafrom(DataHandler handler) throws IOException { + + handler.putDataTo(this.outData); + + } +} diff --git a/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/GSIandSDFMerger.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/GSIandSDFMerger.java new file mode 100755 index 000000000000..ff0348f97d3d --- /dev/null +++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/GSIandSDFMerger.java @@ -0,0 +1,167 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: GSIandSDFMerger.java,v $ + * $Revision: 1.3 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +/* + * Created on 2005 + * by Christian Schmidt + */ +package com.sun.star.tooling.converter; + +import java.io.File; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; + +/** + * Merge GSIFiles back to to the original (!) SDFFile + * + * + * @author Christian Schmidt 2005 + * + */ +public class GSIandSDFMerger extends SDFReader { + + int lineCounter=0; + + GSIReader gsiReader; + + private Map temp=new HashMap(); + private int j; + private boolean skip=true; + Map gsiBlock=null; + Map sdfBlock=null; + + private boolean dontLoadGSI=false; + + private int count; + /** + * Merge the GSIFile back to the original(!) SDFFile + * + * @param source the file to read from + * @param sourceLanguage the source language in the source file + * @param targetLanguage the target language in the source file + * @param charset the charset of the files + * @throws java.io.IOException + * @throws Exception + */ + public GSIandSDFMerger(File source, File secondSource,String sourceLanguage, + String targetLanguage, String charset) throws IOException { + // merging GSI and SDF requieres two Sources + //this. is the SDF source + super(secondSource, sourceLanguage, targetLanguage, charset); + //create the GSI Source + + gsiReader=new GSIReader(source,sourceLanguage,targetLanguage,charset); + + } + + /* (non-Javadoc) + * @see com.sun.star.tooling.converter.DataReader#getData() + */ + public Map getData()throws java.io.IOException{ + do{ + skip=false; + this.temp=matchGSI(); + }while(skip); + if(temp==null){ + OutputHandler.out("Blocks merged : "+this.lineCounter); + } + return temp; + + } + + /** + * Read each block of the GSIFile and check whether there is a matching + * block in the SDFFile. Match depends on the BlockNr and BlockId. + * + * @return A Map that contains the source language content + * and the target language content. + * @throws IOException + * @throws ConverterException + */ + public Map matchGSI() throws IOException{ + + + try { + //System.out.println("Start..."); + + if (dontLoadGSI||(gsiBlock=gsiReader.getGSIData())!=null){ + dontLoadGSI=false; + //check if we must update this block + //if so its BlockNr is in the gsi file + if((sdfBlock = super.getData())!=null){ + + if(((String)sdfBlock.get("BlockNr")).equals((String)gsiBlock.get("BlockNr"))){ + + gsiBlock.remove(EMPTY); + //if the target language string is empty this may be caused by an error in the source sdf File + //I don't want to overwrite a possibly correct translation with an empty string + // so remove the target part from the gsiBlock + Map mp=(Map)gsiBlock.get(gsiReader.targetLanguage); + if (mp.size()!=0&&!((String)mp.get("TargetText")).equals("")){ + + // target language part in this gsiBlock +// if(((String)mp.get("TargetText")).equals("")){ +// gsiBlock.remove(targetLanguage); +// } + // count the merged blocks + lineCounter++; + Map helpMap = (Map)gsiBlock.get(super.targetLanguage);//"ja" + sdfBlock.putAll(helpMap); + skip=false; + }else{ + //no target language part in this gsiBlock + skip=true; +// +// return null; + } + }else{ +// skip=true; +// +// // we cant match this gsi block to the current sdf block + // try matching the next sdf block with this gsi line + dontLoadGSI=true; + } + } + return sdfBlock; + } + + } catch (IOException e) { + + e.printStackTrace(); + } + return null; + } + + + + + + +} diff --git a/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/LineErrorException.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/LineErrorException.java new file mode 100755 index 000000000000..6a11360cc472 --- /dev/null +++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/LineErrorException.java @@ -0,0 +1,81 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: LineErrorException.java,v $ + * $Revision: 1.3 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +/* + * Exception for errors in + * SDFLines + */ +package com.sun.star.tooling.converter; + + +/** + * This Exeption is thrown if a DataReader finds an error in a read Line + * f. e. wrong column number + * + * @author Christian Schmidt 2005 + * + */ +public class LineErrorException extends Exception { + + public int tokenCount; + /** + * + */ + public LineErrorException() { + super(); + + } + + /** + * @param arg0 + */ + public LineErrorException(String arg0) { + super(arg0); + + } + + /** + * @param arg0 + */ + public LineErrorException(Throwable arg0) { + super(arg0); + + } + + /** + * @param arg0 + * @param arg1 + */ + public LineErrorException(String arg0, Throwable arg1) { + super(arg0, arg1); + + } + + +} \ No newline at end of file diff --git a/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/OutputHandler.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/OutputHandler.java new file mode 100755 index 000000000000..997c05a70b4f --- /dev/null +++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/OutputHandler.java @@ -0,0 +1,228 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: OutputHandler.java,v $ + * $Revision: 1.4 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +/* + * Creates logfile and file for debug information + * + */ +package com.sun.star.tooling.converter; + +import java.io.BufferedWriter; +import java.io.IOException; + +/** + * Handle the whole output during converting process except the converted files. + * Write output to logfiles and to screen depending on switches given + * at command line. + * @author Christian Schmidt 2005 + * + */ +public class OutputHandler { + + private static final String EMPTY = ""; + + /** + * The logfile to write + */ + public static BufferedWriter logFile; + + /** + * Indicates whether excisting files should be overwritten + */ + public static boolean doLog = false; + + /** + * Indicate whether the debug information should be written + */ + public static boolean doDebug = false; + + /** + * The File to write the debug information to + */ + public static BufferedWriter dbgFile; + + /** + * Write the data to screen and if the switches were set to + * logfile and debugfile + * + * @param out the String to write + */ + final static void out(String out) { + try { + if (doDebug) + OutputHandler.dbg(out); + + if (!doLog || logFile == null) { + System.out.println(out); + } else { + System.out.println(out); + if (EMPTY.equals(out)) { + OutputHandler.log(EMPTY); + } else { + OutputHandler.log(out); + } + } + } catch (IOException e) { + + OutputHandler.log(e.toString()); + } + } + + /** + * make a dot on the screen to show the user that it is going on + */ + final static void printDot() { + System.out.print("."); + + } + + /** + * write the data to log file and if the switch is set + * to the debug file + * + * @param out the String to write + */ + final static void log(String out) { + try { + if(out==null) return; + if (doDebug) + + OutputHandler.dbg(out); + + if (doLog) { + if (!EMPTY.equals(out)) { + logFile.write(out); + } + logFile.newLine(); + logFile.flush(); + } + } catch (IOException e) { + + System.out.println(e.getMessage()); + } + } + + /** + * write the string to the debug file + * + * @param out the String to write + * @throws IOException + */ + final static void dbg(String out) throws IOException { + if(out==null) return; + if (doDebug) { + if (!EMPTY.equals(out)) { + dbgFile.write(out); + + } + dbgFile.newLine(); + dbgFile.flush(); + } + } + + /** + * Set a new value to indicate whether a debug file should be written or not + * + * @param doDebug + * The debug value to set. + */ + private static void setDebug(boolean doDebug) { + OutputHandler.doDebug = doDebug; + } + + // /** + // * @return Returns the doDebug. + // */ + // private static boolean isDebug() { + // return doDebug; + // } + + /** + * Set the debug file to write to. + * + * @param dbgFile + * The debug File to use. + */ + private static void setDbgFile(BufferedWriter dbgFile) { + OutputHandler.dbgFile = dbgFile; + } + + /** + * @return Returns the debug File. + */ + private static BufferedWriter getDbgFile() { + return dbgFile; + } + + /** + * @param doLog + * The log value to set. + */ + private static void setLog(boolean doLog) { + OutputHandler.doLog = doLog; + } + + /** + * @return Returns the log value. + */ + private static boolean isLog() { + return doLog; + } + + /** + * @param logFile + * The logFile to set. + */ + private static void setLogFile(BufferedWriter logFile) { + OutputHandler.logFile = logFile; + } + + /** + * @return Returns the logFile. + */ + private static BufferedWriter getLogFile() { + return logFile; + } + + /** + * @throws IOException + * close log and dbg + */ + public static void closeAll() throws IOException { + if (OutputHandler.logFile != null) { + OutputHandler.logFile.flush(); + OutputHandler.logFile.close(); + } + if (OutputHandler.dbgFile != null) { + OutputHandler.dbgFile.flush(); + OutputHandler.dbgFile.close(); + } + } + +} \ No newline at end of file diff --git a/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/ResTypeResolver.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/ResTypeResolver.java new file mode 100755 index 000000000000..f53fe0101275 --- /dev/null +++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/ResTypeResolver.java @@ -0,0 +1,71 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: ResTypeResolver.java,v $ + * $Revision: 1.3 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +/* + * Created on 2005 + * by Christian Schmidt + */ +package com.sun.star.tooling.converter; + +import java.util.Map; + +/** + * Helps resolving restype descriptors used outside the tool to + * restype descriptors used by this tool + * + * @author Christian Schmidt 2005 + * + */ +public class ResTypeResolver { + final static String[] inFields={"Text","QText","HText","Title"}; + final static String[] outFields={"res","res-quickhelp","res-help","res-title"}; + final static Map internKeys=new ExtMap(inFields,outFields); + final static Map externKeys=new ExtMap(outFields,inFields); + + /** + * Get the intern key depending to the given extern key + * + * @param externKey the externKey {"res","res-quickhelp","res-help","title"} + * @return the depending intern key + */ + public static String getInternKey(String externKey){ + return (String)externKeys.get(externKey); + } + + /** + * Get the extern key to the given intern key + * + * @param internKey the internal key + * @return the external key + */ + public static String getExternKey(String internKey){ + return (String)internKeys.get(internKey); + } + +} diff --git a/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/Resolver.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/Resolver.java new file mode 100755 index 000000000000..29a9ee2e528a --- /dev/null +++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/Resolver.java @@ -0,0 +1,98 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: Resolver.java,v $ + * $Revision: 1.4 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +/* + * Created on 27.01.2005 + * + */ +package com.sun.star.tooling.converter; + +import java.io.IOException; +import java.io.InputStream; + +import org.xml.sax.EntityResolver; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; + +/** + * Resolve external entities by provide the + * XLIFF DTD stored in the jar file + */ +public class Resolver implements EntityResolver { + + /** + * Resolver constructor. + */ + public Resolver() { + } + + /** + * Allow the application to resolve external entities. + * + * The Parser will call this method before opening any external entity + * except the top-level document entity (including the external DTD subset, + * external entities referenced within the DTD, and external entities + * referenced within the document element): the application may request that + * the parser resolve the entity itself, that it use an alternative URI, or + * that it use an entirely different input source. + */ + + /* (non-Javadoc) + * @see org.xml.sax.EntityResolver#resolveEntity(java.lang.String, java.lang.String) + */ + + public InputSource resolveEntity(String publicId, String systemId) + throws SAXException, IOException { + + if ((publicId != null) && (publicId.equals("-//XLIFF//DTD XLIFF//EN"))) { + systemId = "dtd:///xliff.dtd"; + } + if (systemId != null) { + if (systemId.startsWith("dtd://")) { + String dtd = "com/sun/star/tooling/converter/dtd" + + systemId.substring(6); + ClassLoader cl = this.getClass().getClassLoader(); + InputStream in = cl.getResourceAsStream(dtd); + InputSource ins = new InputSource(in); + ins.setSystemId(systemId); + return ins; + } /* + * else if ( systemId.startsWith("jar:") ) { try { URL url=new + * URL(systemId); JarURLConnection jarConn = + * (JarURLConnection)url.openConnection(); InputSource ins=new + * InputSource(jarConn.getInputStream()); + * ins.setSystemId(systemId); return ins; } + * catch(MalformedURLException me){ throw new SAXException(me); + * Incorrect URL format used } } + */ + } + return null; + } + +} \ No newline at end of file diff --git a/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/SDFReader.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/SDFReader.java new file mode 100755 index 000000000000..4c0c234778ec --- /dev/null +++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/SDFReader.java @@ -0,0 +1,635 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: SDFReader.java,v $ + * $Revision: 1.4 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +/* + * SDFReader.java + * + * + */ + +package com.sun.star.tooling.converter; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.text.DecimalFormat; +import java.util.*; + +/** + * + * SDFReader is a FileReader that knows about + * the content of SDFFiles + * + * A SDFBlock is read of the given file. A SDFBlock + * consists of all SDFLines that are traanslations of the + * same String and the SDFLine containing the source string + * itself. SDFFile lines are read and checked whether they + * have the allowed column count and don't contain illeagal + * characters (like most unprintable characters below 0x00df). + * If the given source language is not found in the first + * block of SDFLines a ConverterException is thrown at runtime. + * If the given target language is "" (that means not given) + * the first language that is not the given source language + * is taken for target language. The found values are returned in HashMaps that + * use the following keys: + *
+ * "BlockNr" originally coming from reading the sdf file, contains 'block nr in sdf file'+'-'+'hash value of the sdf id fields'.
+ * "Project" first column in sdf file format.
+ * "SourceFile" second column in sdf file format.
+ * "Dummy" third column in sdf file format.
+ * "ResType" 4. column in sdf file format.
+ * "GID" 5. column in sdf file format.
+ * "LID" 6. column in sdf file format.
+ * "HID" 7. column in sdf file format.
+ * "Platform" 8. column in sdf file format.
+ * "Width", 9. column in sdf file format.
+ * "SourceLanguageID" 10. column in sdf file format(in the line with the source language).
+ * "SourceText" 11. column in sdf file format(in the line with the source language).
+ * "SourceHText" 12. column in sdf file format(in the line with the source language).
+ * "SourceQText" 13. column in sdf file format(in the line with the source language).
+ * "SourceTitle" 14. column in sdf file format(in the line with the source language).
+ * "TargetLanguageID" 10. column in sdf file format (in the line with the target language).
+ * "TargetText" 11. column in sdf file format (in the line with the target language).
+ * "TargetHText" 12. column in sdf file format (in the line with the target language).
+ * "TargetQText" 13. column in sdf file format (in the line with the target language).
+ * "TargetTitle", 14. column in sdf file format (in the line with the target language).
+ * "TimeStamp" 15. column in sdf file format.
+ * + * @author Christian Schmidt 2005 + * + */ + +public class SDFReader extends DataReader { + + /** + * an array of the SDF files column names + */ + final static String[] fieldnames = { "Project", "SourceFile", "Dummy", + "ResType", "GID", "LID", "HID", "Platform", "Width", "LanguageID", + "Text", "HText", "QText", "Title", "TimeStamp" }; + + /** + * an array of the SDF files column names if the source language is in + */ + final static String[] sourceLineNames = { "Project", "SourceFile", "Dummy", + "ResType", "GID", "LID", "HID", "Platform", "Width", + "SourceLanguageID", "SourceText", "SourceHText", "SourceQText", + "SourceTitle", "TimeStamp" }; + + /** + * an array of the SDF files column names if the target language is in + */ + final static String[] targetLineNames = { "Project", "SourceFile", "Dummy", + "ResType", "GID", "LID", "HID", "Platform", "Width", + "TargetLanguageID", "TargetText", "TargetHText", "TargetQText", + "TargetTitle", "TimeStamp" }; + + final static String EMPTY = new String(""); + + private int dotCount = 0; + + /** + * a Map containing an SDF line with source language + */ + private Map sourceMap; + + /** + * a Map containing an SDF line with target language + */ + private Map targetMap; + + /** + * a Map containing an SDF + */ + private Map SDFMap; + + /** + * a Map Array containing one SDF source language line and one SDF target + * language line + */ + private Map[] data = { sourceMap, targetMap }; + + /** + * The Id of the current SDFBlock + */ + private String CurrentBlockId; + + /** + * The SDF file to read from + */ + private File sourceFile; + + /** + * The language in the source file that should be handelt as source language + */ + protected String sourceLanguage; + + /** + * The language in the source file that should be handelt as target language + */ + protected String targetLanguage; + + /** + * A counter holding the number of blocks just read + * from this file + */ + private long blockNr = 0;// If we use Integer, more then numbers greater than 128k would be signed + + /** + * A counter holding the number of skipped lines that means + * lines that can not be worked with because they contain an error + */ + private int skippedLines = 0; + + /** + * This switch is set for indicating that all source file lines + * are read and no lines remain buffered. Finding this like 'true' + * means the source file is finished + */ + private boolean endIt = false; + + /** + * Indicates whether the targetLanguage is found in this source file so far + */ + private boolean foundTarget = false; + /** + * Indicates whether the sourceLanguage is found in this source file so far + */ + private boolean foundSource = false; + + /** + * Counts how many lines were skipped because the language is + * neither sourceLanguage nor targetLanguage + */ + private int langMiss; + + /** + * Indicates whether there is a line in the read buffer or not + */ + private boolean useBuffer = false; + + /** + * A buffer for SDFLines + */ + private String lineBuffer; + + /** + * The buffer for the already splitted SDFLines + */ + private String[] splittedLineBuffer; + + /** + * Counts how many Blocks were skipped + * f.e. because no sourceLanguage is found + * in it + */ + private int skippedBlocks; + + /** + * Counts the blocks without targetLanguage + */ + private int targetLangMiss; + + /** + * Counts the blocks without sourceLanguage + */ + private int sourceLangMiss; + + /** + * Counts the lines where no targetLanguage line was found + * and so empty lines were created + */ + private int targetLangCreate; + + + DecimalFormat blockNrFormatter = new DecimalFormat("000000"); + + /** + * The hashcode of the current block + */ + private int CurrentBlockHash; + + private boolean skip; + + /** + * Create a new Instance of SDFREader + * + * @param source the file to read from + * @param sourceLanguage the sourceLanguage (must not be empty) + * @param targetLanguage the targetLanguage + * @param charset the charset used to read source + * @throws java.io.IOException + * @throws Exception + */ + public SDFReader(File source, String sourceLanguage, String targetLanguage, + String charset) throws java.io.IOException { + super(new InputStreamReader(new FileInputStream(source), charset)); + sourceFile = source; + this.sourceLanguage = sourceLanguage; + this.targetLanguage = targetLanguage; + String line; + String[] splitLine; + //read first line to get the first + //SDF block id + mark(16000); + if ((line = readLine()) != null) { + if ((splitLine = split(line)) != null){ + this.CurrentBlockId = getSDFBlockId(splitLine); + this.CurrentBlockHash=this.CurrentBlockId.hashCode(); + //found the first + this.blockNr++; + } + this.splittedLineBuffer = splitLine; + } + reset(); + + } + + /* (non-Javadoc) + * @see com.sun.star.tooling.converter.DataReader#getData() + */ + public Map getData()throws IOException { + + Map map=new HashMap(); +// do { + this.skip=false; + Map[] help=readBlock(); + if(help==null||help[1]==null||help[0]==null){ + return null; +// }else if (help[1].get("TargetLanguageID")==null||help[0].get("SourceLanguageID")==null) { +// OutputHandler.log("Missing Language Id in block "+blockNr+"\nthe block is skipped." ); +// this.skippedBlocks++; +// this.skip=true; + }else{ + map.putAll(help[1]); + map.putAll(help[0]); + + } +// }while(this.skip=true); + return map; + } + + + /** + * Read a Block from the sdf file and return + * @return a Map[] where [0] holds the source and [1] the target language data. + * + * @throws java.io.IOException + */ + public Map[] readBlock() throws java.io.IOException { + String line = EMPTY; + String blockId = EMPTY; + String[] splittedLine = null; + data[0]=new ExtMap(); + data[1]=new ExtMap(); + String help; + String c = null; + //read next line or use buffered line + while (useBuffer || (line = readLine()) != null) { //works because '||' is shortcut + + try { + // buffer used? + if (useBuffer) { + line = this.lineBuffer; + splittedLine = this.splittedLineBuffer; + this.SDFMap = new ExtMap(SDFReader.fieldnames, splittedLine); + + try { + checkLanguage(splittedLine); + } catch (ConverterException e) { + throw e; + }finally{ + + useBuffer = false; + } + } else { + //...are there wrong characters? + if ((check(line)).length() < line.length()) { + throw new LineErrorException(getLineNumber() + + " : Line contains wrong character " + //+ Integer.toHexString(Integer.parseInt(c)) + + " \n" + line); + } + //...is the number of columns ok? + if ((splittedLine = split(line)) == null) { + + throw new LineErrorException(super.getLineNumber() + + " : Line has wrong column number \n" + line); + //continue; + } else { + // TODO makeDot is better in Data Handler + makeDot(); + // ...is this line in a new SDF block ? + if ((blockId = getSDFBlockId(splittedLine)) + .equals(CurrentBlockId)) { + + this.SDFMap = new ExtMap(SDFReader.fieldnames, + splittedLine); + //what language is in it ? + checkLanguage(splittedLine); + + } else { + + /* + * we found the next block , but do we have the + * target text? + */ + + if (!foundTarget) { + createTargetLine(); + } + + blockNr++; + splittedLineBuffer = splittedLine;//read one line + // too much so + // buffer it + lineBuffer = line; + useBuffer = true;//reset(); + + this.CurrentBlockId = blockId; + this.CurrentBlockHash=this.CurrentBlockId.hashCode(); + + /* ...and what about the source text ? */ + if (!foundSource) { + + OutputHandler + .log("Error in Line:" + + getLineNumber() + + "Source Language is missing maybe " + + "previous block has an error.\nBlock " + + (blockNr - 1) + + " is skipped. before line: \n" + + line); + + foundTarget = false;//no target without source + skippedBlocks++; + skippedLines++; + sourceLangMiss++; + continue;// skip output of this block if no + // source language is found + + } + + break; + + } + } + + } + + } catch (LineErrorException e) { + + OutputHandler.log(e.getMessage()); + this.skippedLines++; + } catch (ConverterException e) { + OutputHandler.log(e.getMessage()); + } + + } + // did we read the whole stuff? + if (null != line) { + // no + foundSource = false; + foundTarget = false; + + return this.data; + + } else { + // ok , its the end but is everything written now? + if (!endIt) { + // there is something to write + // but next time we can end it + endIt = true; + if(!foundTarget){ + createTargetLine(); + } + // write + return this.data;//last lines + } else { + + showStat(); + return null; + } + } + // }catch(ConverterException e) { + // Converter.log(e.getMessage()); + // return null; + // } + } + + /** + * + */ + private void createTargetLine() { + targetLangMiss++; + // if not, create one ... + data[1] = new ExtMap(SDFReader.targetLineNames, + splittedLineBuffer); + data[1].put("TargetLanguageID", + this.targetLanguage); + if ((String) data[1].get("TargetText") != EMPTY) + data[1].put("TargetText", EMPTY); + if ((String) data[1].get("TargetHText") != EMPTY) + data[1].put("TargetHText", EMPTY); + if ((String) data[1].get("TargetQText") != EMPTY) + data[1].put("TargetQText", EMPTY); + if ((String) data[1].get("TargetTitle") != EMPTY) + data[1].put("TargetTitle", EMPTY); + this.data[1].put("BlockNr", blockNrFormatter.format(blockNr)+'-'+Integer.toString(this.CurrentBlockHash)); + targetLangCreate++; + } + + /** + * Show the statistic information got while + * reading the file + * + * @throws IOException + */ + private void showStat() throws IOException { + OutputHandler.out(EMPTY);OutputHandler.out(EMPTY); + // OutputHandler.out("Hashes: " + (theHashes.size()) + " "); + OutputHandler.out("Blocks found: " + blockNr + " "); + OutputHandler.out(EMPTY); + OutputHandler.out("Lines read: " + (getLineNumber()) + " "); + OutputHandler + .dbg("Lines created " + (targetLangCreate) + " "); + OutputHandler.dbg(" -------"); + OutputHandler.dbg("Lines total: " + + (getLineNumber() + targetLangCreate) + " "); + OutputHandler.dbg("Lines skipped: " + skippedLines + " "); + + OutputHandler.dbg("Source Language misses: " + sourceLangMiss + " "); + OutputHandler.dbg("Target Language misses: " + targetLangMiss + " "); + OutputHandler.dbg("Blocks found: " + blockNr + " "); + OutputHandler.dbg("Blocks skipped: " + skippedBlocks + " "); + if ((sourceLangMiss + skippedBlocks + skippedLines) > 0) + OutputHandler.out("\n---! Errors found !--- view Logfile.\n\n" + + "To enable logfile use -l option at command line.\n" + + "For help type 'convert -h {Enter}'.\n"); + } + + /** + * Check the current line whether the source language + * or target language is in it + * + * @throws ConverterException if a not needed language or no target language is found + * in this block + * @throws IOException + * + */ + final private void checkLanguage(String[] splittedLine) + throws ConverterException, IOException { + String langID = (String) SDFMap.get("LanguageID"); + + //maybe the source language is in this line + if (!foundSource && this.sourceLanguage.equals(langID)) { +// found the next source language line + this.data[0] = new ExtMap(SDFReader.sourceLineNames, splittedLine); + +// this.data[0].put("BlockNr", Integer.toHexString(blockNr)); +// this.data[0].put("BlockHash", Integer.toHexString(this.CurrentBlockHash)); + this.data[0].put("BlockNr", blockNrFormatter.format(blockNr)+'-'+Integer.toHexString(this.CurrentBlockHash)); +// this.data[0].put("BlockHash", blockHashFormatter.format(this.CurrentBlockHash)); + foundSource = true; + return; + + } else { + // or the target language is in this line + if (!foundTarget) { + //no target language is given at command line + if (this.targetLanguage.equals(EMPTY)) { + //try if we can use the current lines language for target + // language + if (!langID.equals(this.sourceLanguage)) { + //yes , we can use this lines laanguage as target + this.targetLanguage = langID; + + //source and target language both are known: show it + OutputHandler.out("Source Language is: " + + this.sourceLanguage + " "); + OutputHandler.out("Target Language is: " + + this.targetLanguage + " "); + OutputHandler.out(EMPTY); + System.out.println("Start"); + + } else { + throw new ConverterException("(" + getLineNumber() + + ") No target language found: " + + this.targetLanguage); + } + } + if (this.targetLanguage.equals(langID)) { + this.data[1] = new ExtMap(SDFReader.targetLineNames, + splittedLine);// found the next target language line + this.data[1].put("BlockNr", blockNrFormatter.format(blockNr)+'-'+Integer.toHexString(this.CurrentBlockHash)); + foundTarget = true; + + return; + } + }//end !foundTarget + } + //if we go here we dont need the found language... + throw new ConverterException("found not needed language '" + + this.SDFMap.get("LanguageID") + "' in Line: " + + getLineNumber()); + + } + + /** + * Make a dot on the screen to show the user that it is going on + */ + private void makeDot() { + int count = 0; + if ((count = (int) super.getLineNumber() / 1000) > this.dotCount) { + this.dotCount = count; + OutputHandler.printDot(); + } + + } + + /** + * split the SDFLine in its columns + * + * @param line the current SDFLine + * @return the splitted SDFLine as array of String + * or null if an error occours + * @throws IOException + */ + private String[] split(String line) throws IOException { + check(line); + String[] splitLine; + if ((splitLine = line.split("\t")).length == 15) + return splitLine; + else + //an error occured + return null; + } + + /** + * create a block Id from a splitted SDFLine + * the blockId consists of the column one to eight of an SDF File + * + * @param splitLine the line to create a block id from + * @return the blockId as String + */ + private String getSDFBlockId(String[] splitLine) { + StringBuffer BlockId = new StringBuffer(""); + for (int i = 0; i < 8; i++) { + BlockId.append(splitLine[i]); + } + return BlockId.toString(); + } + +// public final boolean canRead() { +// return this.sourceFile.canRead(); +// } + + /** + * Check if there are not allowed characters in this line + * + * @param line the SDFLine to check + * @return if everything, ok the original + * else the wrong character as String + * + * @throws java.io.IOException + */ + private String check(String line) throws java.io.IOException { + char c = ' '; + for (int i = 0; i < line.length(); i++) { + c = line.charAt(i); + if (c < 30 && c != 9) { + return (new Character(c)).toString(); + } + + } + return line; + + } +} \ No newline at end of file diff --git a/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/SDFWriter.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/SDFWriter.java new file mode 100755 index 000000000000..98eb8c856e6a --- /dev/null +++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/SDFWriter.java @@ -0,0 +1,175 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: SDFWriter.java,v $ + * $Revision: 1.4 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +/* + * SDFWriter.java + * + * + */ + +package com.sun.star.tooling.converter; +import java.io.*; +import java.util.Map; + +/** + * Write data to a SDFFile + * + * @author Christian Schmidt 2005 + * + */ +public class SDFWriter extends DataWriter { + /** + * the seperator the seperate columns + */ + final String seperator=new String("\t"); + /** + * an array of the SDF files column names if the source language is in + */ + final static String[] sourceLineNames= {"Project","SourceFile","Dummy","ResType","GID","LID","HID","Platform","Width","SourceLanguageID","SourceText","SourceHText","SourceQText","SourceTitle","TimeStamp"}; + /** + * an array of the SDF files column names if the target language is in + */ + final static String[] targetLineNames= {"Project","SourceFile","Dummy","ResType","GID","LID","HID","Platform","Width","TargetLanguageID","TargetText","TargetHText","TargetQText","TargetTitle","TimeStamp"}; + /** + * an array of the SDF files column names if the source and the target language is in + */ + final static String[] outLineNames= {"BlockNr","Project","SourceFile","Dummy","ResType","GID","LID","HID","Platform","Width","SourceLanguageID","SourceText","SourceHText","SourceQText","SourceTitle","TargetLanguageID","TargetText","TargetHText","TargetQText","TargetTitle","TimeStamp"}; + + /** + * A Map holding the source language line content + */ + private ExtMap sourceLine=new ExtMap(sourceLineNames,null); + /** + * A Map holding the target language line content + */ + private ExtMap targetLine=new ExtMap(targetLineNames,null); + /** + * A Map holding the whole content for output + */ + private ExtMap outData=new ExtMap(outLineNames, null); +// private ExtMap SDFLine; +// private InputStreamReader isr; + /** + * The language to translate from + */ + private String sourceLanguage; + /** + * The language to translate to + */ + private String targetLanguage; + +// private boolean SourceIsFirst=false; + + + + + /** + * Create a new Instance of SDFWriter + * + * @param bos BufferedWriter to write to + * @param charset the charset to use to write + * @throws java.io.UnsupportedEncodingException + */ + public SDFWriter(BufferedOutputStream bos,String charset) throws java.io.UnsupportedEncodingException { + super(bos,charset); + + } + + /* (non-Javadoc) + * @see com.sun.star.tooling.converter.DataWriter#writeData() + */ + public final void writeData() throws java.io.IOException { + + StringBuffer buffer=new StringBuffer(""); + + // get the values of the found fields + //create the two sdf lines + + //at first the source language line + for(int i=0;i + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +/* + * XLIFFReader.java + * + * + */ +package com.sun.star.tooling.converter; + +import java.io.IOException; +import java.util.Hashtable; +import java.util.Map; + +import com.sun.star.tooling.languageResolver.LanguageResolver; + +import org.xml.sax.Attributes; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; +import org.xml.sax.helpers.AttributesImpl; +import org.xml.sax.helpers.DefaultHandler; + + +/** + * Parse the given file and extract the content needed. + *
+ * This Reader understands the parts of the + * xliff spezification used to translate + * the strings in Star-Office and Open-Office. + *
+ * The given file is parsed and the content is stored in a HashMap with those keys: + *
+ * "BlockNr" originally coming from reading the sdf file, contains 'block nr in sdf file'+'-'+'hash value of the sdf id fields'.
+ * "Project" first column in sdf file format.
+ * "SourceFile" second column in sdf file format.
+ * "Dummy" third column in sdf file format.
+ * "ResType" 4. column in sdf file format.
+ * "GID" 5. column in sdf file format.
+ * "LID" 6. column in sdf file format.
+ * "HID" 7. column in sdf file format.
+ * "Platform" 8. column in sdf file format.
+ * "Width", 9. column in sdf file format.
+ * "SourceLanguageID" 10. column in sdf file format(in the line with the source language).
+ * "SourceText" 11. column in sdf file format(in the line with the source language).
+ * "SourceHText" 12. column in sdf file format(in the line with the source language).
+ * "SourceQText" 13. column in sdf file format(in the line with the source language).
+ * "SourceTitle" 14. column in sdf file format(in the line with the source language).
+ * "TargetLanguageID" 10. column in sdf file format (in the line with the target language).
+ * "TargetText" 11. column in sdf file format (in the line with the target language).
+ * "TargetHText" 12. column in sdf file format (in the line with the target language).
+ * "TargetQText" 13. column in sdf file format (in the line with the target language).
+ * "TargetTitle", 14. column in sdf file format (in the line with the target language).
+ * "TimeStamp" 15. column in sdf file format.
+ * @ + * @author Christian Schmidt 2005 + * + */ +public class XLIFFReader extends DefaultHandler { + + /** + * A String array holding the keys used by the HashMap holding the Data + */ + private final String[] dataNames = { "BlockNr", "Project", + "SourceFile", "Dummy", "ResType", "GID", "LID", "HID", "Platform", + "Width", "SourceLanguageID", "SourceText", "SourceHText", + "SourceQText", "SourceTitle", "TargetLanguageID", "TargetText", + "TargetHText", "TargetQText", "TargetTitle", "TimeStamp" }; + + /** + * Used to index in the data array + */ + static int index = 0; + + /** + * The Map that holds the data returned by this class + */ + private Map moveData = new ExtMap(); + + /** + * A Map that holds yet incomplete data + * until all depending transunits are found + */ + private Hashtable DataStore = new Hashtable(); + + /** + * An Elements name + */ + private String name = new String(""); + + /** + *List of Attributes used by an Element + */ + private Attributes attrs; + +// private String tagElement = new String(""); + + /** + * Indicates whether the next found content string should be printed + */ + private boolean printThis = false; + /** + * Indicates whether the next found content string should be stored + */ + private boolean storeIt = false; + + /** + * data holds the information created while parsing + * + */ + private String[] data = new String[26]; + + /** + * The handler used by this class + */ + private final DataHandler handler; + /** + * The target used by this class + */ + private final DataWriter target; + +// private boolean searchForText = false; + + /** + * counts how many dots are made + */ + private int dotCount; + + /** + * Counts how many Trans Units are read + */ + private int transUnitCounter; + + /** + * used source Language + */ + private String sourceLanguage; + + /** + * used target language + */ + private String targetLanguage; + + /** + * indicates whether this is the first Transunit + */ + private boolean isFirst = true; + + private static final String EMPTY = new String(""); + + /** + * the last index in data where something is written + */ + private int oldindex; + +// private boolean isBptEptTag; + +// private String innerString; +// +// private String key; + + /** + * Index for the BlockNr in the data array + */ + private static final int BLOCKNR_IDX = 0; + /** + * Index for the Project in the data array + */ + private static final int PROJECT_IDX = 1; + /** + * Index for the Sourcefile name in the data array + */ + private static final int SOURCEFILE_IDX = 2; + /** + * Index for the 'dummy' in the data array + */ + private static final int DUMMY_IDX = 3; + /** + * Index for the Group Id in the data array + */ + private static final int GID_IDX = 4; + /** + * Index for the Local Id in the data array + */ + private static final int LID_IDX = 5; + /** + * Index for the Help Id in the data array + */ + private static final int HID_IDX = 6; + /** + * Index for the Platform in the data array + */ + private static final int PLATFORM_IDX = 7; + /** + * Index for the 'Width' in the data array + */ + private static final int WIDTH_IDX = 8; + /** + * Index for the Sourcelanguage Id in the data array + */ + private static final int SOURCE_LANGUAGE_ID_IDX = 10; + /** + * Index for the Source Text in the data array + */ + private static final int SOURCE_TEXT_IDX = 11; + /** + * Index for the Source Helptext in the data array + */ + private static final int SOURCE_HELPTEXT_IDX = 12; + /** + * Index for the Source Quickhelp Text in the data array + */ + private static final int SOURCE_QUICK_HELPTEXT_IDX = 13; + /** + * Index for the Source Titletext in the data array + */ + private static final int SOURCE_TITLETEXT_IDX = 14; + /** + * Index for the Timestamp in the data array + */ + private static final int TIMESTAMP_IDX = 15; + /** + * Index for the res type in the data array + */ + private static final int RESTYPE_IDX = 16; + /** + * Index for the Target Language Id in the data array + */ + private static final int TARGET_LANGUAGE_ID_IDX = 20; + /** + * Index for the Target Text in the data array + */ + private static final int TARGET_TEXT_IDX = 21; + /** + * Index for the Target Helptext in the data array + */ + private static final int TARGET_HELP_TEXT_IDX = 22; + /** + * Index for the Target Quickhelp Text in the data array + */ + private static final int TARGET_QUICKHELP_TEXT_IDX = 23; + /** + * Index for the Target Titletext in the data array + */ + private static final int TARGET_TITLE_TEXT_IDX = 24; + /** + * Index for the Found Parts Counter in the data array + */ + private static final int FOUND_PARTS_COUNTER_IDX = 18; + + /** + * used to find the matching ISO or RFC3066 language code + */ + LanguageResolver languageResolver; + + private boolean doBlockCompleteCheck=true; + + + + /** + * Create a new Instance of XLIFFReader + * + * @param handler the DataHandler to use + * @param target the target used + * @throws IOException + */ + public XLIFFReader(DataHandler handler, DataWriter target) throws IOException { + this.languageResolver = new LanguageResolver(); + this.handler = handler; + this.target = target; + } + + /** + * Create a new Instance of XLIFFReader + * + * @param handler the DataHandler to use + * @param target the target used + * @param doBlockCompleteCheck indicates whether every single transunit should be returned or the whole block data is to be collected + * + * @throws IOException + */ + public XLIFFReader(DataHandler handler, DataWriter target,boolean doBlockCompleteCheck) throws IOException { + this(handler, target); + this.languageResolver = new LanguageResolver(); + this.doBlockCompleteCheck=doBlockCompleteCheck; + + } + + /** + * delete and initialize the data content + */ + public void initData() { + for (int i = BLOCKNR_IDX; i < SOURCE_LANGUAGE_ID_IDX; i++) { + data[i] = ""; + } + for (int i = SOURCE_TEXT_IDX; i < TIMESTAMP_IDX; i++) { // skip Time Stamp + data[i] = ""; + } + for (int i = RESTYPE_IDX; i < TARGET_LANGUAGE_ID_IDX; i++) { // skip Source language ID + data[i] = ""; + } + for (int i = TARGET_TEXT_IDX; i < 26; i++) {// skip Target language ID, + data[i] = ""; + } + + data[DUMMY_IDX] = "0";//dummy + data[FOUND_PARTS_COUNTER_IDX] = "1";//parts found + + } + + /** (non-Javadoc) + * @see org.xml.sax.ContentHandler#startDocument() + */ + public void startDocument() { + initData(); + //System.out.print("Start"); + + } + + /** (non-Javadoc) + * @see org.xml.sax.ContentHandler#endDocument() + */ + public void endDocument() { + + try { + showStatistic(); + } catch (IOException e) { + + OutputHandler.log(e.getMessage()); + + } + } + + /** (non-Javadoc) + * @throws SAXException + * @see org.xml.sax.ContentHandler#startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes) + */ + public void startElement(String namespaceURI, String sName, String qName, + Attributes attrs) throws SAXException { + this.name = new String(qName); + this.attrs = new AttributesImpl(attrs); + String resType; + + String attributeName = new String(""); + String attribute = new String(""); + String tagElement = new String(""); + int i; + + if (qName.equals("bpt")||qName.equals("ept")||qName.equals("sub")||qName.equals("ex")) { + //ignore bpt, ept, ex and sub tags + // content of the tags will be stored + + storeIt=true; + return; + + } + if (qName.equals("target")) { + if ((resType = data[RESTYPE_IDX]) == null) { + + } else { + if ("res".equals(resType)) { + index = TARGET_TEXT_IDX; + + storeIt = true; + return; + } + // if("res-Help".equals(resType)){ + // index=TARGET_HELP_TEXT_IDX; + // storeIt=true; + // return; + // } + if ("res-QuickHelp".equals(resType)) { + index = TARGET_QUICKHELP_TEXT_IDX; + + storeIt = true; + return; + } + if ("res-Title".equals(resType)) { + index = TARGET_TITLE_TEXT_IDX; + + storeIt = true; + return; + } + } + + } + if (qName.equals("source")) { + if ((resType = data[RESTYPE_IDX]) == null) { + //throw new SAXException("Ressource type not found"); + } else { + if ("res".equals(resType)) { + index = SOURCE_TEXT_IDX; + + storeIt = true; + return; + } + // if("res-Help".equals(resType)){ + // index=SOURCEHELPTEXT_IDX; + // storeIt=true; + // return; + // } + if ("res-QuickHelp".equals(resType)) { + index = SOURCE_QUICK_HELPTEXT_IDX; + storeIt = true; + return; + } + if ("res-Title".equals(resType)) { + index = SOURCE_TITLETEXT_IDX; + storeIt = true; + return; + } + } + } + + if (qName.equals("file")) { + data[TIMESTAMP_IDX] = attrs.getValue("date"); + //data[17]=(attrs.getValue("original")); + try{ + data[SOURCE_LANGUAGE_ID_IDX] = (languageResolver.getISOFromRFC((String)attrs.getValue("source-language"))); + if(languageResolver.getISOFromRFC((String)attrs.getValue("target-language"))!=null){ + data[TARGET_LANGUAGE_ID_IDX] = (languageResolver.getISOFromRFC((String)attrs.getValue("target-language"))); + } + }catch(Exception e){ + OutputHandler.log(e.getMessage()); + } + return; + } + if (qName.equals("trans-unit")) { + String id = attrs.getValue("id"); + if ((DataStore.get(id)) != null) { + //TODO arraycopy might not be nessessary + System.arraycopy((String[]) DataStore.get(id), 0, data, 0, + data.length); + int help = (new Integer(data[FOUND_PARTS_COUNTER_IDX])).intValue(); //found one more part + help++; // refresh the actual found parts + data[FOUND_PARTS_COUNTER_IDX] = (new Integer(help)).toString(); // belonging to this information + + DataStore.remove(attrs.getValue("id")); // TODO this can be deleted? + } else { + + data[BLOCKNR_IDX] = (attrs.getValue("id")); // a new part + } + data[RESTYPE_IDX] = (attrs.getValue("restype")); + + return; + } + + if (qName.equals("context")) { + + String value = attrs.getValue("context-type"); + + if ("SourceHelpText".equals(value)) { + index = SOURCE_HELPTEXT_IDX; + storeIt = true; + return; + }else if ("TargetHelpText".equals(value)) { + index = TARGET_HELP_TEXT_IDX; + storeIt = true; + return; + }else if ("DBType".equals(value)) { + //index=SOURCEFILE_IDX; + //storeIt=true; + return; + }else if ("Project".equals(value)) { + index = PROJECT_IDX; + storeIt = true; + return; + }else if ("Filename".equals(value)) { + index = SOURCEFILE_IDX; + storeIt = true; + return; + }else if ("Type".equals(value)) { + index = RESTYPE_IDX; + storeIt = true; + return; + }else if ("GID".equals(value)) { + index = GID_IDX; + storeIt = true; + return; + }else if ("LID".equals(value)) { + index = LID_IDX; + storeIt = true; + return; + }else if ("HID".equals(value)) { + index = HID_IDX; + storeIt = true; + return; + }else if ("Platform".equals(value)) { + index = PLATFORM_IDX; + storeIt = true; + return; + }else if ("Width".equals(value)) { + index = WIDTH_IDX; + storeIt = true; + return; + } + + } + + } + + /** (non-Javadoc) + * @see org.xml.sax.ContentHandler#endElement(java.lang.String, java.lang.String, java.lang.String) + */ + public void endElement(String namespaceURI, String sName, String qName) + throws SAXException { + //we ignore bpt and ept tags + if(!(qName.equals("bpt")||qName.equals("ept")||qName.equals("sub")||qName.equals("ex"))){ + storeIt = false; + } + if (qName.equals("trans-unit")) { + showData(); + } + + } + + /** (non-Javadoc) + * @see org.xml.sax.ContentHandler#characters(char[], int, int) + */ + public void characters(char[] ch, int start, int length) { + + // checkContent(); + String str2 = new String(ch, start, length); + + if (storeIt) { + + String str = new String(ch, start, length); + if (index == oldindex) { + data[index] += str; + } else { + data[index] = str; + } + + } + oldindex = index; + + } + + /** (non-Javadoc) + * @see org.xml.sax.ErrorHandler#error(org.xml.sax.SAXParseException) + */ + public void error(SAXParseException e) throws SAXParseException { + + OutputHandler.log(e.getMessage()); + } + + /** (non-Javadoc) + * @see org.xml.sax.ErrorHandler#fatalError(org.xml.sax.SAXParseException) + */ + public void fatalError(SAXParseException e) throws SAXParseException { + + OutputHandler.log("PARSE ERROR in line " + e.getLineNumber() + ", " + + e.getMessage() ); + + } + + /** (non-Javadoc) + * @see org.xml.sax.ErrorHandler#warning(org.xml.sax.SAXParseException) + */ + public void warning(SAXParseException e) throws SAXParseException { + //throw e; + OutputHandler.log(e.getMessage()); + } + + /** + * Put the Data to the DataHandler + * tell the Writer to write it + * + * @throws SAXException + */ + public void showData() throws SAXException { + transUnitCounter++; + makeDot(); + if (isComplete()) { + + try { + moveData(); + if (isFirst == true) { + this.sourceLanguage = (String) this.moveData + .get("SourceLanguageID"); + this.targetLanguage = (String) this.moveData + .get("TargetLanguageID"); + OutputHandler.out(EMPTY); + OutputHandler.out("Source Language is: " + + this.sourceLanguage); + OutputHandler.out("Target Language is: " + + this.targetLanguage); + OutputHandler.out(EMPTY); + OutputHandler.out("Start"); + OutputHandler.out(EMPTY); + isFirst = false; + } + target.getDataFrom(handler); + target.writeData(); + + } catch (java.io.IOException e) { + throw new SAXException(e); + } + + } else { + DataStore.put(data[BLOCKNR_IDX], data.clone()); + initData(); + + } + initData(); + } + + + /** + * put the data in an Map in the format that + * DataHandler can handle it + */ + final public void moveData() { + + moveData.put("BlockNr", data[BLOCKNR_IDX]); + + moveData.put("Project", data[PROJECT_IDX]); + + moveData.put("SourceFile", data[SOURCEFILE_IDX]); + + moveData.put("Dummy", "0"); + + moveData.put("ResType", data[RESTYPE_IDX]); + + moveData.put("GID", data[GID_IDX]); + + moveData.put("LID", data[LID_IDX]); + + moveData.put("HID", data[HID_IDX]); + + moveData.put("Platform", data[PLATFORM_IDX]); + + if (EMPTY.equals(data[WIDTH_IDX])) + data[WIDTH_IDX] = "0"; + moveData.put("Width", data[WIDTH_IDX]); + + moveData.put("SourceLanguageID", data[SOURCE_LANGUAGE_ID_IDX]); + + moveData.put("SourceText", data[SOURCE_TEXT_IDX]); + + moveData.put("SourceHText", data[SOURCE_HELPTEXT_IDX]); + + moveData.put("SourceQText", data[SOURCE_QUICK_HELPTEXT_IDX]); + + moveData.put("SourceTitle", data[SOURCE_TITLETEXT_IDX]); + + moveData.put("TargetLanguageID", data[TARGET_LANGUAGE_ID_IDX]); + + moveData.put("TargetText", data[TARGET_TEXT_IDX]); + + moveData.put("TargetHText", data[TARGET_HELP_TEXT_IDX]); + + moveData.put("TargetQText", data[TARGET_QUICKHELP_TEXT_IDX]); + + moveData.put("TargetTitle", data[TARGET_TITLE_TEXT_IDX]); + + moveData.put("TimeStamp", data[TIMESTAMP_IDX]); + + //and give it to the data handler + this.handler.fillDataWith(moveData); + } + + /** + * complete means all depending parts have been found esp. all res types + * that belong to the same SDF Line + * + * @return true if the data is complete + * + */ + final public boolean isComplete() { + + if(!doBlockCompleteCheck){ + return true; + } + + String sParts; + if (data[FOUND_PARTS_COUNTER_IDX] == EMPTY) + data[FOUND_PARTS_COUNTER_IDX] = "1"; //this is the first part + + String sFoundParts = data[FOUND_PARTS_COUNTER_IDX]; + //create the new 'id' + sParts = data[BLOCKNR_IDX].substring(data[BLOCKNR_IDX].lastIndexOf(":") + 1); + + if (sFoundParts.equals(sParts)) { + return true; + } + return false; + } + + // TODO this belongs in OutputHandler + /** + * show the user that it is going + * on by printing dots on the screen + * + */ + private void makeDot() { + int count = 0; + if ((count = (int) this.transUnitCounter / 1000) > this.dotCount) { + this.dotCount = count; + OutputHandler.printDot(); + } + } + + /** + * show the statistic data found while parse this file + * + * @throws IOException + */ + final void showStatistic() throws IOException { + OutputHandler.out(EMPTY); + OutputHandler.out("TransUnits found: " + this.transUnitCounter); + // every data in DataStore is + // skipped 'cause its not complete + // TODO count really every transunit not only the data (might consist of + // more than one + OutputHandler.dbg("TransUnits skip : " + this.DataStore.size()); + //Converter.out(EMPTY); + } +} + diff --git a/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/XLIFFWriter.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/XLIFFWriter.java new file mode 100755 index 000000000000..42eef42884c1 --- /dev/null +++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/XLIFFWriter.java @@ -0,0 +1,535 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: XLIFFWriter.java,v $ + * $Revision: 1.4 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +/* + * + /* + * XLIFFWriter.java + * + * + */ + +package com.sun.star.tooling.converter; + +import java.io.*; +import java.util.*; + +import com.sun.star.tooling.DirtyTags.DirtyTagWrapper; +import com.sun.star.tooling.languageResolver.LanguageResolver; +import com.sun.star.tooling.languageResolver.LanguageResolver.LanguageResolvingException; + +/** + * Write the Data to a wellformed XLIFF File + * + * @author Christian Schmidt + */ +public class XLIFFWriter extends DataWriter { + + /** + * An array holding the keys of the HashMap containing the source language string + */ + private final static String[] sourceLineNames = { "Project", "SourceFile", + "Dummy", "ResType", "GID", "LID", "HID", "Platform", "Width", + "SourceLanguageID", "SourceText", "SourceHText", "SourceQText", + "SourceTitle", "TimeStamp" }; + /** + * An array holding the keys of the HashMap containing the target language string + */ + private final static String[] targetLineNames = { "Project", "SourceFile", + "Dummy", "ResType", "GID", "LID", "HID", "Platform", "Width", + "TargetLanguageID", "TargetText", "TargetHText", "TargetQText", + "TargetTitle", "TimeStamp" }; + /** + * An array holding the keys of the HashMap containing the source and target language string + */ + private final static String[] outLineNames = { "BlockNr", "Project", + "SourceFile", "Dummy", "ResType", "GID", "LID", "HID", "Platform", + "Width", "SourceLanguageID", "SourceText", "SourceHText", + "SourceQText", "SourceTitle", "TargetLanguageID", "TargetText", + "TargetHText", "TargetQText", "TargetTitle", "TimeStamp" }; + /** + * An Map holding the source and target content + */ + private final Map data = new ExtMap(outLineNames, null); + + + /** + * Indicates if this is the first Transunit to write + */ + boolean isFirst = true; + + LanguageResolver languageResolver; + + + /** + * Create a new Instance of XLIFFWriter + * + * @param bos the Buffered Output Stream to write to + * @param charset the charset to use + * @throws IOException + */ + public XLIFFWriter(BufferedOutputStream bos, String charset) + throws IOException { + super(bos, charset); + this.languageResolver =new LanguageResolver(); + + + } + + /* (non-Javadoc) + * @see com.sun.star.tooling.converter.DataWriter#getDatafrom(com.sun.star.tooling.converter.DataHandler) + */ + public void getDatafrom(DataHandler handler) throws java.io.IOException { + handler.putDataTo(this.data); + } + + /** + * check if the item is an empty String + * + * @param item the string to check + * @return true if it is not empty, false if it is empty + */ + private final boolean isUsed(String item) { + if (!"".equals(item)) + return true; + return false; + } + + /** + * Replaces all characters that mustn't be in XLIFF PCdata + * + * @param string the string to check + * @return the checked string with all characters replaced + * @throws java.io.IOException + */ + private final String xmlString( final String string) throws java.io.IOException { + if (string == null) + return string; // "" + String str = string; +// str = str.replaceAll("&", "&"); +// str = str.replaceAll("<", "<"); +// str = str.replaceAll(">", ">"); +// str = str.replaceAll("\"", """); +// str = str.replaceAll("'", "'"); + for(int i=0;i'){ + str=str.substring(0, i)+">"+str.substring(i+1); + continue; + } + + if(str.charAt(i)=='"'){ + str=str.substring(0, i)+"""+str.substring(i+1); + continue; + } + + if(str.charAt(i)=='\''){ + str=str.substring(0, i)+"'"+str.substring(i+1); + continue; + } + } + + return str; + } + + /* (non-Javadoc) + * @see java.io.Writer#close() + */ + public void close() throws IOException { + this.writeTrailer(); + + super.close(); + } + + /* (non-Javadoc) + * @see com.sun.star.tooling.converter.DataWriter#writeData() + */ + public void writeData() throws IOException { + if (isFirst) { + + writeHeader(); + isFirst = false; + } + try{ + writeTransUnit(); + }catch(DirtyTagWrapper.TagWrapperException e){ + + } + } + + /** + * Write the XLIFFFiles header + * + * @throws IOException + */ + private void writeHeader() throws IOException { + + this.write(getHeader()); + } + + /** + * Write the XLIFFFiles Trailer + * + * @throws IOException + */ + private void writeTrailer() throws IOException { + this.write(getTrailer()); + } + + /** + * Write the next TransUnit + * + * @throws IOException + */ + private void writeTransUnit() throws IOException, DirtyTagWrapper.TagWrapperException { + try{ + StringBuffer writeBuffer = new StringBuffer(1000); + + StringBuffer allLinesEnd = new StringBuffer(200); + String sRessource = ""; + int parts = 0; + if (data == null) { + OutputHandler.out("error");// TBD Exception + } + + if (!(this.data.get("SourceText").equals("") || this.data.get( + "SourceText").equals(" "))) { + parts++; + } + // if(!(this.data.get("SourceHText").equals("")||this.data.get("SourceHText").equals(" + // "))){ + // parts++; + // } + if (!(this.data.get("SourceQText").equals("") || this.data.get( + "SourceQText").equals(" "))) { + parts++; + } + if (!(this.data.get("SourceTitle").equals("") || this.data.get( + "SourceTitle").equals(" "))) { + parts++; + } + if (!(this.data.get("SourceText").equals("") || this.data.get( + "SourceText").equals(" "))) { + sRessource = "res"; // normal TEXT source + + allLinesEnd + .append("\t\t\t\t\n"); + + if (isUsed((String) this.data.get("ResType"))) + allLinesEnd + .append("\t\t\t\t\t" + + xmlString((String) this.data.get("ResType")) + + "\n"); + if (isUsed((String) this.data.get("Project"))) + allLinesEnd + .append("\t\t\t\t\t" + + xmlString((String) this.data.get("Project")) + + "\n"); + if (isUsed((String) this.data.get("SourceFile"))) + allLinesEnd + .append("\t\t\t\t\t" + + xmlString((String) this.data + .get("SourceFile")) + "\n"); + if (isUsed((String) this.data.get("SourceHText"))) + allLinesEnd + .append("\t\t\t\t\t" + + xmlString((String) this.data + .get("SourceHText")) + "\n"); + if (isUsed((String) this.data.get("TargetHText"))) + allLinesEnd + .append("\t\t\t\t\t" + + xmlString((String) this.data + .get("TargetHText")) + "\n"); + if (isUsed((String) this.data.get("ResType"))) + allLinesEnd.append("\t\t\t\t\t" + + xmlString((String) this.data.get("ResType")) + + "\n"); + if (isUsed((String) this.data.get("GID"))) + allLinesEnd.append("\t\t\t\t\t" + + xmlString((String) this.data.get("GID")) + + "\n"); + if (isUsed((String) this.data.get("LID"))) + allLinesEnd.append("\t\t\t\t\t" + + xmlString((String) this.data.get("LID")) + + "\n"); + if (isUsed((String) this.data.get("HID"))) + allLinesEnd.append("\t\t\t\t\t" + + xmlString((String) this.data.get("HID")) + + "\n"); + if (isUsed((String) this.data.get("Platform"))) + allLinesEnd + .append("\t\t\t\t\t" + + xmlString((String) this.data.get("Platform")) + + "\n"); + if (isUsed((String) this.data.get("Width"))) + allLinesEnd.append("\t\t\t\t\t" + + xmlString((String) this.data.get("Width")) + + "\n"); + allLinesEnd.append("\t\t\t\t\n" + + "\t\t\t\n"); + + writeBuffer.append("\t\t\t\n"); + if (isUsed((String) this.data.get("SourceText"))) + writeBuffer.append("\t\t\t\t" + + DirtyTagWrapper.wrapString((String) this.data.get("SourceText")) + + "\n"); + + if (isUsed((String) this.data.get("TargetText"))) + writeBuffer + .append("\t\t\t\t" + +DirtyTagWrapper.wrapString((String) this.data + .get("TargetText")) + "\n"); + writeBuffer.append(allLinesEnd); + Converter.countLine(); + + } + // if(!(this.data.get("SourceHText").equals("")||this.data.get("SourceHText").equals(" + // "))){ + // sRessource="res-Help"; //Source is Help + // //sLineNumber=String.valueOf(iLineNumber);// + // writeBuffer.append("\t\t\n");//always translate + // if(isUsed((String)this.data.get("SourceHText"))) + // writeBuffer.append("\t\t\t"+xmlString((String)this.data.get("SourceHText"))+"\n"); + // if(isUsed((String)this.data.get("TargetHText"))) + // writeBuffer.append("\t\t\t"+xmlString((String)this.data.get("TargetHText"))+"\n"); + // writeBuffer.append(allLinesEnd); + // Converter.countLine(); + // } + + if (!(this.data.get("SourceQText").equals("") || this.data.get( + "SourceQText").equals(" "))) { + sRessource = "res-QuickHelp"; // Source is OuickHelp + // sLineNumber=String.valueOf(iLineNumber);// + writeBuffer.append("\t\t\t\n");// always translate + if (isUsed((String) this.data.get("SourceQText"))) + writeBuffer.append("\t\t\t\t" + + DirtyTagWrapper.wrapString((String) this.data.get("SourceQText")) + + "\n"); + if (isUsed((String) this.data.get("TargetQText"))) + writeBuffer + .append("\t\t\t\t" + + DirtyTagWrapper.wrapString((String) this.data + .get("TargetQText")) + "\n"); + writeBuffer.append(allLinesEnd); + Converter.countLine(); + } + + if (!(this.data.get("SourceTitle").equals("") || this.data.get( + "SourceTitle").equals(" "))) { + sRessource = "res-Title"; // Source is Title + + writeBuffer.append("\t\t\t\n");// always translate + if (isUsed((String) this.data.get("SourceTitle"))) + writeBuffer.append("\t\t\t\t" + + DirtyTagWrapper.wrapString((String) this.data.get("SourceTitle")) + + "\n"); + if (isUsed((String) this.data.get("TargetTitle"))) + writeBuffer + .append("\t\t\t\t" + + DirtyTagWrapper.wrapString((String) this.data + .get("TargetTitle")) + "\n"); + writeBuffer.append(allLinesEnd); + Converter.countLine(); + } + this.write(writeBuffer.toString()); + }catch(Exception e){ + OutputHandler.log(e.getMessage()); + } + } + + /** + * Create the XLIFFFiles Header + * + * @return the header as string + * @throws java.io.UnsupportedEncodingException + */ + private String getHeader() throws java.io.UnsupportedEncodingException { + return new String( + (getProcessingInstructionTag() + getDTDLine() + + openVersionLine() + openFileLine() + getHeaderTag() + openBodyTag()) + .getBytes(), "UTF8"); + + } + + /** + * Create the XLIFFFiles Trailer + * + * @return the trailer as string + */ + private String getTrailer() { + return closeBodyTag() + closeFileLine() + closeVersionLine(); + } + + /** + * Create the Processing Instruction Tag used by this XLIFFFile + * @return the Processing Instruction Tag used by this XLIFFFile + */ + private String getProcessingInstructionTag() { + String sPITagStart = ""; + return sPITagStart + sPIName + sPIVersion + sPIEncoding + + /* sPIStandalone+ */sPITagEnd + '\n'; + } + + /** + * Create the line holding the DTD referenced by this XLIFFFile + * @return a string holding the DTD referenced by this XLIFFFile + */ + private String getDTDLine() { + String sDTDTagStart = "";// http://www.oasis-open.org/committees/xliff/documents/ + String sDTSTagEnd = ">"; + return sDTDTagStart + sDTDType + sDTDSource + '\n'; + } + + /** + * Create the beginning of the line holding the version of this XIFFFile + * + * @return a string with the beginning of the line holding the version of this XIFFFile + */ + private String openVersionLine() { + return "\n"; + } + /** + * Create the ending of the line holding the version of this XIFFFile + * + * @return a string with the ending of the line holding the version of this XIFFFile + */ + private String closeVersionLine() { + return ""; + } + /** + * Create the beginning of the line holding the file tag of this XIFFFile + * + * @return a string with the beginning of the file tag of this XIFFFile + */ + private String openFileLine() { + + String FileTagStart = "\t"; + } + /** + * Create a String containing the header tag + * @return the String containing the header tag + */ + private String getHeaderTag() { + return "
\n"; + } + /** + * Create the begining of the line holding the body tag of this XIFFFile + * + * @return a string with the begining of the body tag of this XIFFFile + */ + private String openBodyTag() { + return "\t\t\n"; + } + /** + * Create the ending of the line holding the body tag of this XIFFFile + * + * @return a string with the ending of the body tag of this XIFFFile + */ + private String closeBodyTag() { + return "\t\t"; + } + + /* + * (non-Javadoc) + * + * @see com.sun.star.tooling.converter.DataWriter#writeData(java.util.Map[]) + */ + protected void writeData(Map[] data) throws IOException { + // TODO Auto-generated method stub + + } + + /* + * (non-Javadoc) + * + * @see com.sun.star.tooling.converter.DataWriter#getDataFrom(com.sun.star.tooling.converter.DataHandler) + */ + protected void getDataFrom(DataHandler handler) { } + +} diff --git a/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/dtd/xliff.dtd b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/dtd/xliff.dtd new file mode 100755 index 000000000000..91262ec28204 --- /dev/null +++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/dtd/xliff.dtd @@ -0,0 +1,391 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/l10ntools/java/l10nconv/java/com/sun/star/tooling/languageResolver/LanguageResolver.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/languageResolver/LanguageResolver.java new file mode 100755 index 000000000000..62ff008156ab --- /dev/null +++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/languageResolver/LanguageResolver.java @@ -0,0 +1,201 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: LanguageResolver.java,v $ + * $Revision: 1.3 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +/* + * Created on 2005 + * by Christian Schmidt + */ +package com.sun.star.tooling.languageResolver; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.ListIterator; + +/** + * Translate language codes into another format + * between ISO, RFC3066 and numeric + * + * @author Christian Schmidt 2005 + * + */ +public class LanguageResolver { + private final static int ISO =2; + private final static int LANGID =0; + private final static int LANGNAME =1; + private final static int RFC3066 =3; + + ArrayList languages=new ArrayList(); + +// public static void main(String[] args){ +// try { +// LanguageResolver lr=new LanguageResolver(); +// } catch (IOException e) { +// // +// e.printStackTrace(); +// } +// } + + /** + * Create a new Instance of LanguageResolver + * + * @throws IOException + */ + public LanguageResolver() throws IOException{ + String lang = "com/sun/star/tooling/languageResolver/lang.map"; + ClassLoader cl = this.getClass().getClassLoader(); + InputStream in = cl.getResourceAsStream(lang); + BufferedReader languageTable= new BufferedReader(new InputStreamReader(in)); + + String line; + + while((line=(languageTable.readLine()))!=null){ + languages.add(line.split(",")); + } + } + /** + * Get the numeric value of the given ISO Language Code + * + * @param isoCode the ISO Language Code to find + * @return numeric value of the given isoCode + * @throws LanguageResolvingException if the Language ISO Code is not known + */ + public String getNrFromISO(String isoCode) throws LanguageResolvingException{ + if("".equals(isoCode)) return ""; + ListIterator iter=languages.listIterator(); + String[] line=new String[5]; + while(isoCode!="" && iter.hasNext()){ + line=(String[]) iter.next(); + if(line[ISO].equals(isoCode)) return line[LANGID]; + } + throw new LanguageResolvingException("Can not find ISO Code: "+isoCode ); + + } + + /** + * Get the ISO Language Code corresponding with the given Language ID + * + * @param ID the numeric language id to find + * @return the ISO Language Code corresponding with the given Language ID + * @throws LanguageResolvingException if the Language ID is not known + */ + public String getISOfromNr(String ID) throws LanguageResolvingException{ + if("".equals(ID)) return ""; + ListIterator iter=languages.listIterator(); + String[] line=new String[5]; + while(iter.hasNext()){ + line=(String[]) iter.next(); + if(line[LANGID].equals(ID)) return line[ISO]; + } + throw new LanguageResolvingException("Can not find Language Id: "+ID ); + } + + /** + * Get the RFC3066 value of the given ISO Language Code + * + * @param isoCode the ISO Language Code to find + * @return RFC3066 value of the given isoCode + * @throws LanguageResolvingException if the Language ISO Code is not known + */ + public String getRFCFromISO(String isoCode) throws LanguageResolvingException{ + if("".equals(isoCode)) return ""; + ListIterator iter=languages.listIterator(); + String[] line=new String[5]; + while(iter.hasNext()){ + line=(String[]) iter.next(); + if(line[ISO].equals(isoCode)) return line[RFC3066]; + } + throw new LanguageResolvingException("Can not find ISO Code: "+isoCode ); + } + + /** + * Get the ISO Language Code corresponding with the given RFC3066 code + * + * @param RFC RFC3066 language id to find + * @return the ISO Language Code corresponding with the given RFC3066 code + * @throws LanguageResolvingException if the RFC3066 code is not known + */ + public String getISOFromRFC(String RFC) throws LanguageResolvingException{ + if("".equals(RFC)) return ""; + ListIterator iter=languages.listIterator(); + String[] line=new String[5]; + while(iter.hasNext()){ + line=(String[]) iter.next(); + if(line[RFC3066].equals(RFC)) return line[ISO]; + } + throw new LanguageResolvingException("Can not find Language Id: "+RFC ); + } + + + /** + * This Exception is thrown if a Language Identfier is unknown + * + * @author Christian Schmidt 2005 + * + */ + public class LanguageResolvingException extends Exception { + + /** + * + */ + public LanguageResolvingException() { + super(); + // + } + + /** + * @param arg0 + */ + public LanguageResolvingException(String arg0) { + super(arg0); + // + } + + /** + * @param arg0 + * @param arg1 + */ + public LanguageResolvingException(String arg0, Throwable arg1) { + super(arg0, arg1); + // + } + + /** + * @param arg0 + */ + public LanguageResolvingException(Throwable arg0) { + super(arg0); + // + } + + } + +} diff --git a/l10ntools/java/l10nconv/java/com/sun/star/tooling/languageResolver/lang.map b/l10ntools/java/l10nconv/java/com/sun/star/tooling/languageResolver/lang.map new file mode 100755 index 000000000000..a43e8f5e0218 --- /dev/null +++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/languageResolver/lang.map @@ -0,0 +1,41 @@ +1,English,en-US,en-US,1033 +3,Portuguese,pt,pt-PT,2070 +30,Greek,el,el-GR,1032 +33,French,fr,fr-FR,1036 +35,Finnish,fi,fi-FI,1035 +39,Italian,it,it-IT,1040 +43,Slowak,sk,sk-SK,1051 +46,Swedish,sv,sv-SE,1053 +48,Polish,pl,pl-PL,1045 +55,Portuguese (Brasil),pt-BR,pt-BR,2070 +82,Korean,ko,ko-KR,1042 +88,Chinese (traditional),zh-TW,zh-TW,1028 +96,Arabic,ar,,1025 +97,Hebrew,he,he-IL,1037 +7,Russian,ru,ru-RU,1049 +31,Dutch,nl,nl-NL,1043 +34,Spanish,es,es-ES,1034 +36,Hungarian,hu,hu-HU,1038 +42,Czech,cs,cs-CZ,1029 +45,Danish,da,da-DK,1030 +47,Norwegian (Bokmal),nb,nb-NB,1044 +49,German,de,de-DE,1031 +81,Japanese,ja,ja-JP,1041 +86,Chinese (simple),zh-CN,zh-CN,2052 +90,Turkish,tr,tr-TR,1055 +37,Catalan,ca,, +66,Thai,th,th-TH, +91,Hindi,hi-IN,hi-IN, +77,Estonian,et,et, +50,Slovenian,sl,sl, +79,Norwegian Nynorsk,nn,nn-NN, +53,Welsh,cy,cy, +27,Afrikaans,af,af-ZA, +38,Galician,gl-ES,gl-ES, +58,Lithuanian,lt,lt-LT, +29,Tswana,tn,tn-TN, +76,Khmer ( Cambodia ),km,km, +26,Northern Sotho,ns,ns-ZA, +28,Zulu,zu,zu-ZA, +10,Basque,eu,eu-ES, +93,Kannada,kn,kn-KN, \ No newline at end of file diff --git a/l10ntools/java/l10nconv/makefile.mk b/l10ntools/java/l10nconv/makefile.mk new file mode 100755 index 000000000000..2be2eb391ced --- /dev/null +++ b/l10ntools/java/l10nconv/makefile.mk @@ -0,0 +1,39 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2008 by Sun Microsystems, Inc. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.3 $ +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=../.. +PRJNAME=l10ntools +TARGET=converter + +.INCLUDE : ant.mk + +ALLTAR : ANTBUILD + diff --git a/l10ntools/java/receditor/build.xml b/l10ntools/java/receditor/build.xml new file mode 100755 index 000000000000..34f02128f034 --- /dev/null +++ b/l10ntools/java/receditor/build.xml @@ -0,0 +1,173 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/l10ntools/java/receditor/java/transex3/controller/EditorController.java b/l10ntools/java/receditor/java/transex3/controller/EditorController.java new file mode 100644 index 000000000000..38462d665304 --- /dev/null +++ b/l10ntools/java/receditor/java/transex3/controller/EditorController.java @@ -0,0 +1,334 @@ +package transex3.controller; + +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.*; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStreamReader; +import java.lang.Runtime; +import java.util.*; + +import javax.swing.ListSelectionModel; +import javax.swing.WindowConstants; +import javax.swing.event.*; + +import transex3.model.*; + +import java.io.*; +import javax.swing.*; +//import transex3.model.*; +public class EditorController { + public final String[] RESTYPES = { ".src",".hrc",".xcu",".xrm",".xhp" }; + public final String RECFILE = ".recommand"; + // Editor View + static transex3.view.Editor aEditor = null; + // Editor Model + static Vector sdfstrings = new Vector(); + static HashMap hashedsdfstrings = new HashMap(); + int oldindex = 0; + //HashMap hashedfilenames = new HashMap(); + // Search for source Strings + public String fetchSourceStrings( String rootdir ){ + + //String outputfile = "h:\\workspace\\recommandEditor\\null2"; + File tempfile = null; + + try { + tempfile = File.createTempFile( "receditor" , "tmp" ); + } catch (IOException e1) { + // TODO Auto-generated catch block + System.err.println("Can not create temp file\n"); + e1.printStackTrace(); + } + + String outputfile = tempfile.getAbsolutePath(); + try + { + //System.out.println("localize_sl -QQ -skip_links -e -l en-US -f "+outputfile+" -d "+rootdir); + System.out.println("localize_sl -QQ -skip_links -e -l en-US -f "+outputfile ); + java.lang.Process aProc = Runtime.getRuntime().exec("localize_sl -QQ -skip_links -e -l en-US -f "+outputfile); + + //java.lang.Process aProc = Runtime.getRuntime().exec("localize_sl -QQ -e -l en-US -f "+outputfile+" -d "+rootdir); + BufferedReader aBR = new BufferedReader( new InputStreamReader( aProc.getInputStream() ) ); + String line = aBR.readLine(); + while( line != null && line.length() > 0 ){ + //System.out.print( line ); + line = aBR.readLine(); + } + + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return outputfile; + } + // Search for recommand files + public void findRecommandFiles( File rootdir , Vector list ){ + System.out.print("."); + System.out.flush(); + File[] aFileArray = rootdir.listFiles(); + if( aFileArray != null ){ + for( int cnt = 0; aFileArray.length > cnt ; cnt++ ){ + if( aFileArray[ cnt ].isDirectory() && !aFileArray[ cnt ].getAbsolutePath().endsWith(".lnk") ) + findRecommandFiles( aFileArray[ cnt ] , list); + else if( aFileArray[ cnt ].isFile() && isRecommandFile( aFileArray[ cnt ] ) ) + list.add( aFileArray[ cnt ]); + } + } + } + private boolean isResourceType( File aFile ){ + String filename = aFile.getName(); + boolean isResType = false; + for(int cnt = 0; cnt < RESTYPES.length ; cnt++){ + if( filename.endsWith( RESTYPES[ cnt ] ) ) + isResType = true; + } + return isResType; + } + private boolean isRecommandFile( File aFile ){ + return aFile.getName().endsWith( RECFILE ); + } + public void clearAllRows( JTable aTable ){ + for ( int n = 0; n < aTable.getRowCount() ; n++ ){ + aTable.setValueAt( null , n , 0 ); + aTable.setValueAt( null , n , 1 ); + aTable.setValueAt( null , n , 2 ); + aTable.setValueAt( null , n , 3 ); + aTable.setValueAt( null , n , 4 ); + } + } + // Add all data to view + void updateData(){ + JTable recTable =transex3.controller.EditorController.aEditor.getRectable(); + + SdfString aSdfString = (SdfString) sdfstrings.get( oldindex ); + Vector newStrings = new Vector(); + for ( int n = 1; n < recTable.getRowCount() ; n++ ){ + String lang = (String) recTable.getValueAt(n , 0 ); + String text = (String) recTable.getValueAt(n , 1 ); + String htext = (String) recTable.getValueAt(n , 2 ); + String qhtext = (String) recTable.getValueAt(n , 3 ); + String ttext = (String) recTable.getValueAt(n , 4 ); + if( lang != null && text != null ){ + //System.out.println("Data "+ lang + " " + text ); + SdfEntity aSdfEntity = new SdfEntity(); + aSdfEntity.setLangid( lang ); + aSdfEntity.setText( text ); + aSdfEntity.setHelptext( htext ); + aSdfEntity.setQuickhelptext( qhtext ); + aSdfEntity.setTitle( ttext ); + newStrings.add( aSdfEntity ); + aSdfString.setLanguageStrings( newStrings ); + } + } + } + + public void initView(){ + Object[][] sourceStringData = new Object[ sdfstrings.size() ][ 4 ]; + Object[][] firstData = new Object[100][5]; + // Set the files + Iterator aIter = sdfstrings.iterator(); + int counter = 0; + while( aIter.hasNext() ){ + SdfString aSdfString = (SdfString) aIter.next(); + sourceStringData[ counter ][ 0 ] = aSdfString.getSourceString().getProject()+"\\"+aSdfString.getSourceString().getSource_file(); + sourceStringData[ counter ][ 1 ] = aSdfString.getSourceString().getGid(); + sourceStringData[ counter ][ 2 ] = aSdfString.getSourceString().getLid(); + sourceStringData[ counter ][ 3 ] = aSdfString.getSourceString().getText(); + if( counter == 0 ){ + firstData[ 0 ][ 0 ] = "en-US"; + firstData[ 0 ][ 1 ] = aSdfString.getSourceString().getText(); + firstData[ 0 ][ 2 ] = aSdfString.getSourceString().getHelptext(); + firstData[ 0 ][ 3 ] = aSdfString.getSourceString().getQuickhelptext(); + firstData[ 0 ][ 4 ] = aSdfString.getSourceString().getTitle(); + aSdfString = (SdfString) sdfstrings.get( 0 ); + Vector values = aSdfString.getLanguageStrings(); + for( int n = 0; n < values.size() ; n++ ) + { + SdfEntity aEntity = (SdfEntity) values.get( n ); + firstData[ n+1 ][ 0 ] = aEntity.getLangid(); + firstData[ n+1 ][ 1 ] = aEntity.getText(); + firstData[ n+1 ][ 2 ] = aEntity.getHelptext(); + firstData[ n+1 ][ 3 ] = aEntity.getQuickhelptext(); + firstData[ n+1 ][ 4 ] = aEntity.getTitle(); + } + } + counter++; + } + // Set the source srtings + + + //aEditor = new transex3.view.Editor( sourceStringData , filedata.toArray() ); + aEditor = new transex3.view.Editor( sourceStringData , firstData ); + + aEditor.setBounds(100,100,800,900); + aEditor.setDefaultCloseOperation( WindowConstants.DISPOSE_ON_CLOSE ); + aEditor.setVisible(true); + aEditor.repaint(); + aEditor.addWindowListener( new WindowAdapter(){ + public void windowClosed(WindowEvent e ){ + System.exit( 0 ); + } + }); + + aEditor.getMiExit().addActionListener( new ActionListener(){ + public void actionPerformed( ActionEvent e ){ + System.exit( 0 ); + } + }); + + aEditor.getMiSave().addActionListener( new ActionListener(){ + public void actionPerformed( ActionEvent e ){ + Iterator aIter = sdfstrings.iterator(); + String lastFile=""; + while( aIter.hasNext() ) + { + SdfString aSdfString = (SdfString )aIter.next(); + if( aSdfString.getFileId().compareTo( lastFile ) != 0 ){ + //aSdfString.removeFile(); + } + aSdfString.writeString(); + lastFile = aSdfString.getFileId(); + } + } + }); + + //aEditor.getRectable().putClientProperty("terminateEditOnFocusLost", Boolean.TRUE); + aEditor.getRectable().addFocusListener( new FocusListener(){ + public void focusLost(FocusEvent e){ + //super.focusLost( e ); + //System.out.println("focus lost"); + JTable aTable = aEditor.getRectable(); + if( aTable.getSelectedRow() != -1 && aTable.getSelectedColumn() != -1 ) + aTable.getCellEditor( aTable.getSelectedRow(), aTable.getSelectedColumn() ).stopCellEditing(); + updateData(); + } + public void focusGained( FocusEvent e){ + //super.focusGained( e ); + //System.out.println("focus gained"); + } + }); + //setDefaultEditor(Object.class, new transex3.view.FocusCellEditor(new JTextField())); + + aEditor.getRectable().getModel().addTableModelListener( new TableModelListener() { + public void tableChanged( TableModelEvent e ){ + //System.out.println( e ); + }}); + + + aEditor.getRectable().getSelectionModel().addListSelectionListener( new ListSelectionListener(){ + public void valueChanged( ListSelectionEvent e ){ + JTable aTable = aEditor.getRectable(); + //if( aTable.getSelectedRow() != -1 && aTable.getSelectedColumn() != -1 ) + //aTable.getCellEditor( aTable.getSelectedRow(), aTable.getSelectedColumn() ).stopCellEditing(); + + updateData(); + } + }); + + aEditor.getTable().setSelectionMode( ListSelectionModel.SINGLE_SELECTION ); + aEditor.getTable().getSelectionModel().addListSelectionListener( new ListSelectionListener(){ + public void valueChanged( ListSelectionEvent e ){ + //System.out.println("Selected = " +e.getFirstIndex()+"\n"); + JTable table =transex3.controller.EditorController.aEditor.getTable(); + JTable recTable =transex3.controller.EditorController.aEditor.getRectable(); + SdfString aSdfString; + JTable aTable = aEditor.getRectable(); + if( aTable.getSelectedRow() != -1 && aTable.getSelectedColumn() != -1 ) + aTable.getCellEditor( aTable.getSelectedRow(), aTable.getSelectedColumn() ).stopCellEditing(); + + updateData(); + clearAllRows( recTable ); + + aSdfString = (SdfString) sdfstrings.get( table.getSelectedRow() ); + recTable.setValueAt( "en-US" , 0, 0 ); + recTable.setValueAt( aSdfString.getSourceString().getText() , 0, 1 ); + recTable.setValueAt( aSdfString.getSourceString().getHelptext() , 0, 2 ); + recTable.setValueAt( aSdfString.getSourceString().getQuickhelptext() , 0, 3 ); + recTable.setValueAt( aSdfString.getSourceString().getTitle() , 0, 4 ); + Vector values = aSdfString.getLanguageStrings(); + for( int n = 0; n < values.size() ; n++ ) + { + SdfEntity aEntity = (SdfEntity) values.get( n ); + recTable.setValueAt( aEntity.getLangid() , n+1 , 0 ); + recTable.setValueAt( aEntity.getText() , n+1 , 1 ); + recTable.setValueAt( aEntity.getHelptext() , n+1 , 2 ); + recTable.setValueAt( aEntity.getQuickhelptext() , n+1 , 3 ); + recTable.setValueAt( aEntity.getTitle() , n+1 , 4 ); + } + oldindex = table.getSelectedRow(); + } + }); + //System.out.println("initView successfully"); + } + public void initInitialStrings(){ + String rootdir = java.lang.System.getProperty("SOLARSRC"); + String sourcestringsfile = null; + Vector recList = new Vector(); + sourcestringsfile = fetchSourceStrings( rootdir ); + //findRecommandFiles( new File( rootdir ) , recList ); + readStrings( sourcestringsfile , recList ); + File sfile = new File ( sourcestringsfile ); + sfile.delete(); + initView(); + aEditor.repaint(); + } + // Connect recommand strings with source strings + public void readStrings( String sourcefiles , Vector recfiles ) { + BufferedReader aBR = null; + try { + //System.out.println("DBG: sourcefiles = " +sourcefiles); + aBR = new BufferedReader( new FileReader( sourcefiles ) ); + String current = aBR.readLine(); + SdfString aSdfString = null; + SdfEntity aSdfEntity = null; + while( current != null ){ + aSdfEntity = new SdfEntity(); + aSdfEntity.setProperties( current ); + aSdfString = new SdfString(); + aSdfString.addSourceString( aSdfEntity ); + hashedsdfstrings.put( aSdfString.getId() , aSdfString ); + //System.out.println("Put ID '"+aSdfString.getId()+"'"); + sdfstrings.add( aSdfString ); + current = aBR.readLine(); + + } + Iterator aIter=recfiles.iterator(); + File aFile; + BufferedReader aBR2 = null; + //System.out.println("Connecting strings"); + while( aIter.hasNext() ){ + aFile = (File) aIter.next(); + aBR2 = new BufferedReader( new FileReader( aFile ) ) ; + String current2 = aBR2.readLine(); + + while ( current2 != null ){ + SdfEntity aEntity = new SdfEntity(); + aEntity.setProperties( current2 ); + + if( hashedsdfstrings.containsKey( aEntity.getId() ) ) + { + aSdfString = (SdfString) hashedsdfstrings.get( aEntity.getId() ); + aSdfString.addLanguageString( aEntity ); + } + else + { + System.out.println("DBG: Can't find source string '"+aEntity.getId()+"'" ); + } + current2 = aBR2.readLine(); + } + } + } catch (FileNotFoundException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch ( IOException e){ + e.printStackTrace(); + } + + } +} diff --git a/l10ntools/java/receditor/java/transex3/controller/Main.java b/l10ntools/java/receditor/java/transex3/controller/Main.java new file mode 100644 index 000000000000..e8dd06ce9f85 --- /dev/null +++ b/l10ntools/java/receditor/java/transex3/controller/Main.java @@ -0,0 +1,10 @@ +package transex3.controller; + +public class Main { + + public static void main( String args[] ){ + EditorController aEditor = new EditorController(); + aEditor.initInitialStrings(); + } +} + diff --git a/l10ntools/java/receditor/java/transex3/model/ResourceFile.java b/l10ntools/java/receditor/java/transex3/model/ResourceFile.java new file mode 100644 index 000000000000..51fabb3a4b7a --- /dev/null +++ b/l10ntools/java/receditor/java/transex3/model/ResourceFile.java @@ -0,0 +1,77 @@ +package transex3.model; + +import java.util.*; + +public class ResourceFile { + Vector sdfStrings = new Vector(); + HashMap sdfHashMap = new HashMap(); + String filepathid = null; + String modulename = null; + String filename = null; + + + public String getModuleName(){ + return modulename; + } + public String getFilePath(){ + return filepathid; + } + public String getFileName(){ + return filename; + } +/* public List readSoureStrings( java.io.File aSdfFile ){ + List sdfList=null; + return sdfList; + };*/ + public void addString( SdfString aSdfstring ){ + sdfStrings.add( aSdfstring ); + sdfHashMap.put( aSdfstring.getFileId() , aSdfstring ); + if( filepathid == null ) + filepathid = aSdfstring.getFilePath(); + if( modulename == null ) + modulename = aSdfstring.getModuleName(); + if( filename == null ) + filename = aSdfstring.getFileName(); + } + + + public void ParseString( String aSourceString ){ + //sourceString = new SdfEntity(); + SdfEntity aSdfEntity = new SdfEntity(); + aSdfEntity.setProperties( aSourceString ); + SdfString sdfstring = null; + if( sdfHashMap.containsKey( aSdfEntity.getFileId() ) ){ + sdfstring = (SdfString) sdfHashMap.get( aSdfEntity.getFileId() ); + } + else + { + sdfstring = new SdfString(); + addString( sdfstring ); + } + sdfstring.addLanguageString( aSdfEntity ); + + + } + /*public void ParseSdfFile( java.util.Vector aSdfList ){ + ListIterator aLI = aSdfList.listIterator(); + String current; + String[] splitted; + SdfEntity aSdfEntity; + SdfString aSdfString = new SdfString(); + while( aLI.hasNext() ){ + aSdfEntity = new SdfEntity(); + aSdfEntity.setProperties( (String) aLI.next() ); + SdfString aString; + + if( sdfHashMap.containsKey( aSdfEntity.getFileId() ) ) + aString = (SdfString) sdfHashMap.get( aSdfEntity.getFileId() ); + else + { + aString = new SdfString(); + addString( aString ); + } + aString.addLanguageString( aSdfEntity ); + } + + }*/ +} diff --git a/l10ntools/java/receditor/java/transex3/model/SdfEntity.java b/l10ntools/java/receditor/java/transex3/model/SdfEntity.java new file mode 100644 index 000000000000..4b293421fd28 --- /dev/null +++ b/l10ntools/java/receditor/java/transex3/model/SdfEntity.java @@ -0,0 +1,211 @@ +package transex3.model; + +public class SdfEntity { + private String project; + private String source_file; + private String dummy1; + private String resource_type; + private String gid; + private String lid; + private String helpid; + private String platform; + private String dummy2; + private String langid; + private String text; + private String helptext; + private String quickhelptext; + private String title; + private String date; + + public static int PROJECT_POS = 0; + public static int SOURCE_FILE_POS = 1; + public static int DUMMY1_POS = 2; + public static int RESOURCE_TYPE_POS = 3; + public static int GID_POS = 4; + public static int LID_POS = 5; + public static int HELPID_POS = 6; + public static int PLATFORM_POS = 7; + public static int DUMMY2_POS = 8; + public static int LANGID_POS = 9; + public static int TEXT_POS = 10; + public static int HELPTEXT_POS = 11; + public static int QUICKHELPTEXT_POS = 12; + public static int TITLE_POS = 13; + public static int DATE_POS = 14; + + public SdfEntity(){} + public SdfEntity(String project, String source_file, String dummy1, String resource_type, String gid, String lid, String helpid, String platform, String dummy2, String langid, String text, String helptext, String quickhelptext, String title , String date) { + super(); + this.project = project; + this.source_file = source_file; + this.dummy1 = dummy1; + this.resource_type = resource_type; + this.gid = gid; + this.lid = lid; + this.helpid = helpid; + this.platform = platform; + this.dummy2 = dummy2; + this.langid = langid; + this.text = text; + this.helptext = helptext; + this.quickhelptext = quickhelptext; + this.title = title; + this.date = date; + } + + public void setProperties( String line ){ + + String[] splitted = line.split("\t"); + + setProject( splitted[ SdfEntity.PROJECT_POS ] ); + setSource_file( splitted[ SdfEntity.SOURCE_FILE_POS ] ); + setDummy1( splitted[ SdfEntity.DUMMY1_POS ] ); + setResource_type( splitted[ SdfEntity.RESOURCE_TYPE_POS ] ); + setGid( splitted[ SdfEntity.GID_POS ] ); + setLid( splitted[ SdfEntity.LID_POS ] ); + setHelpid( splitted[ SdfEntity.HELPID_POS ] ); + setPlatform( splitted[ SdfEntity.PLATFORM_POS ] ); + setDummy2( splitted[ SdfEntity.DUMMY2_POS ] ); + setLangid( splitted[ SdfEntity.LANGID_POS ] ); + setText( splitted[ SdfEntity.TEXT_POS ] ); + setHelptext( splitted[ SdfEntity.HELPTEXT_POS ] ); + setQuickhelptext( splitted[ SdfEntity.QUICKHELPTEXT_POS ] ); + setTitle( splitted[ SdfEntity.TITLE_POS ] ); + setDate( splitted[ SdfEntity.DATE_POS ] ); + } + + public String getFileId(){ + return project+"\\"+source_file; + } + public String getResourcePath(){ + return source_file.substring(0 , source_file.lastIndexOf( "\\" )-1 ); + } + public String toString(){ + return project+"\t"+source_file+"\t"+dummy1+"\t"+resource_type+"\t"+gid+"\t" + +lid+"\t"+helpid+"\t"+platform+"\t"+dummy2+"\t"+langid+"\t" + +text+"\t"+helptext+"\t"+quickhelptext+"\t"+title+"\t"+date; + } + public String getId(){ + return project+gid+lid+source_file+resource_type+platform+helpid; + } + + public String getDummy1() { + return dummy1; + } + + public void setDummy1(String dummy1) { + this.dummy1 = dummy1; + } + + public String getPlatform() { + return platform; + } + + public void setPlatform(String platform) { + this.platform = platform; + } + + public String getDummy2() { + return dummy2; + } + + public void setDummy2(String dummy2) { + this.dummy2 = dummy2; + } + + public String getGid() { + return gid; + } + + public void setGid(String gid) { + this.gid = gid; + } + + public String getHelpid() { + return helpid; + } + + public void setHelpid(String helpid) { + this.helpid = helpid; + } + + public String getHelptext() { + return helptext; + } + + public void setHelptext(String helptext) { + this.helptext = helptext; + } + + public String getLangid() { + return langid; + } + + public void setLangid(String langid) { + this.langid = langid; + } + + public String getLid() { + return lid; + } + + public void setLid(String lid) { + this.lid = lid; + } + + public String getProject() { + return project; + } + + public void setProject(String project) { + this.project = project; + } + + public String getQuickhelptext() { + return quickhelptext; + } + + public void setQuickhelptext(String quickhelptext) { + this.quickhelptext = quickhelptext; + } + + public String getResource_type() { + return resource_type; + } + + public void setResource_type(String resource_type) { + this.resource_type = resource_type; + } + + public String getSource_file() { + return source_file; + } + + public void setSource_file(String source_file) { + this.source_file = source_file; + } + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + public String getDate() { + return date; + } + public void setDate(String date) { + this.date = date; + } + + +} diff --git a/l10ntools/java/receditor/java/transex3/model/SdfString.java b/l10ntools/java/receditor/java/transex3/model/SdfString.java new file mode 100644 index 000000000000..7419aeb5578b --- /dev/null +++ b/l10ntools/java/receditor/java/transex3/model/SdfString.java @@ -0,0 +1,192 @@ +package transex3.model; +import java.util.*; +import java.io.*; +public class SdfString { + private SdfEntity sourceString = null; + //private java.util.HashMap languageStrings = new HashMap(); + private Vector languageList = new Vector(); + private String id = null; + private String fileid = null; + private String filename = null; + private String modulename = null; + private String filepath = null; + + /*public HashMap getLanguageStrings() { + return languageStrings; + }*/ + public Vector getLanguageStrings() { + return languageList; + } + + public void setLanguageStrings(Vector languageStrings) { + this.languageList = languageStrings; + } + + public void addSourceString( SdfEntity aSdfEntity ) + { + if( id == null ) + id = aSdfEntity.getId(); + if ( fileid == null ) + fileid = aSdfEntity.getFileId(); + if( modulename == null ) + modulename = aSdfEntity.getProject(); + if( filename == null ) + filename = aSdfEntity.getSource_file(); + if( filepath == null ) + filepath = aSdfEntity.getResourcePath(); + setSourceString( aSdfEntity ); + } + public void addLanguageString( SdfEntity aSdfEntity ){ + if( !aSdfEntity.getLangid().equals( "en-US" ) ) + { + if( id == null ) + id = aSdfEntity.getId(); + if ( fileid == null ) + fileid = aSdfEntity.getFileId(); + if( modulename == null ) + modulename = aSdfEntity.getProject(); + if( filename == null ) + filename = aSdfEntity.getSource_file(); + if( filepath == null ) + filepath = aSdfEntity.getResourcePath(); + + //if( aSdfEntity.getLangid().equals( "en-US" ) ) + //{ + // setSourceString( aSdfEntity ); + //} + //else + //{ + //languageStrings.put( aSdfEntity.getLangid() , aSdfEntity ); + languageList.add( aSdfEntity ); + //} + id = aSdfEntity.getId(); + } + } + + public SdfEntity getSourceString() { + return sourceString; + } + + public void setSourceString(SdfEntity sourceString) { + this.sourceString = sourceString; + id = sourceString.getId(); + } + public String getFilePath(){ + return filepath; + } + public String getId(){ + //return id; + return sourceString.getId(); + } + public String getFileId(){ + return fileid; + } + + public String getFileName() { + return filename; + } + + public void setFileName(String filename) { + this.filename = filename; + } + + public String getModuleName() { + return modulename; + } + + public void setModuleName(String modulename) { + this.modulename = modulename; + } + /* + public String getRealFileName(){ + //String srcroot = "U:\\cws01\\l10ncleanup\\SRC680\\src.m213";//java.lang.System.getProperty( "SOLARSRC"); + //String isWindows = "4nt";//java.lang.System.getProperty( "USE_SHELL"); + String srcroot = java.lang.System.getProperty( "SOLARSRC" ); + String isWindows = java.lang.System.getProperty( "USE_SHELL" ); + + //System.out.println("srcroot="+srcroot+" isWindows="+isWindows ); + //if( true ) return; + //String relpath = sourceString.getFileId().substring( sourceString.getFileId().lastIndexOf("\\") + // , sourceString.getFileId().length() ); + String filename; + if( isWindows != null && isWindows.compareTo( "4nt") == 0 ) + { + filename = srcroot + "\\" + //sourceString.getProject() + "\\" + + sourceString.getFileId() +".recommand"; + } + else + { + String filepart = sourceString.getFileId(); + filepart = filepart.replaceAll( "\\\\" , "/" ); + filename = srcroot + "/" + //sourceString.getProject() + "//" + + filepart +".recommand"; + } + return filename; + }*/ + public String getRealFileName(){ + String filepart = sourceString.getFileId(); + filepart = filepart.replaceAll( "\\\\" , "_" ); + String filename = "/so/ws/merge/In/" + java.lang.System.getProperty( "WORK_STAMP" ) + "/" + filepart + ".sdf"; + return filename; + } + public void removeFile(){ + String filename = getRealFileName(); + File aFile = new File( filename ); + if( aFile.exists() ){ + if( ! aFile.delete() ) + { + System.out.println("Can't delete File "+filename+"\nWrong access rights?\n"); + } + } + } + public void writeString(){ + String filename = getRealFileName(); + try { + if( languageList.size() > 0 ) + { + System.out.print("\nWrite to "+filename ); + BufferedWriter aBW = new BufferedWriter( new FileWriter( filename , true) ); + aBW.write( sourceString + "\n" ); + Iterator aIter = languageList.iterator(); + while( aIter.hasNext() ){ + SdfEntity aEntity = (SdfEntity)aIter.next(); + aBW.write( sourceString.getProject()+"\t" ); + aBW.write( sourceString.getSource_file()+"\t" ); + aBW.write( sourceString.getDummy1()+"\t" ); + aBW.write( sourceString.getResource_type()+"\t" ); + aBW.write( sourceString.getGid()+"\t" ); + aBW.write( sourceString.getLid()+"\t" ); + aBW.write( sourceString.getHelpid()+"\t" ); + aBW.write( sourceString.getPlatform()+"\t" ); + aBW.write( sourceString.getDummy2()+"\t" ); + if( aEntity.getLangid() == null ) + aBW.write( "\t" ); + else + aBW.write( aEntity.getLangid()+"\t" ); + if( aEntity.getText() == null ) + aBW.write( "\t" ); + else + aBW.write( aEntity.getText()+"\t" ); + if( aEntity.getHelptext() == null ) + aBW.write( "\t" ); + else + aBW.write( aEntity.getHelptext()+"\t" ); + if( aEntity.getQuickhelptext() == null ) + aBW.write( "\t" ); + else + aBW.write( aEntity.getQuickhelptext()+"\t" ); + if( aEntity.getTitle() == null ) + aBW.write( "\t" ); + else + aBW.write( aEntity.getTitle()+"\t" ); + aBW.write( "2002-02-02 02:02:02\n" ); + } + aBW.close(); + } + } catch (IOException e) { + // TODO Auto-generated catch block + //e.printStackTrace(); + System.out.println("\nERROR: Can't write to file '"+filename+"'\nPlease contact RE/Tooling!"); + } + } +} diff --git a/l10ntools/java/receditor/java/transex3/view/Editor.java b/l10ntools/java/receditor/java/transex3/view/Editor.java new file mode 100644 index 000000000000..f46a82a11a2b --- /dev/null +++ b/l10ntools/java/receditor/java/transex3/view/Editor.java @@ -0,0 +1,97 @@ +package transex3.view; +import javax.swing.*; +import java.awt.*; + +public class Editor extends JFrame{ + Object[] columnnames = { "File" , "GID" , "LID" , "String" }; + Object[] stringcolnames = { "Language", "Text", "Helptext" , "Quickhelptext","Title"}; + //Object[][] data = new Object[4][1];//{ { "a " }, { "v " }, { "v " } , { "a " } }; + JTable table = null; + JTable rectable = null; + JComboBox cBox = null; + JMenuBar menubar = null; + JMenu filemenu = null; + JMenuItem miNew = null; + JMenuItem miSave = null; + JMenuItem miExit = null; + //JButton button = null; + + public Editor( Object[][] tabledata , Object[][] firstdata ){ + table = new JTable( tabledata , columnnames ); + rectable = new SdfTable( firstdata , stringcolnames ); + menubar = new JMenuBar(); + filemenu = new JMenu("File"); + //miNew = new JMenuItem("New"); + miSave = new JMenuItem("Save"); + miExit = new JMenuItem("Exit"); + //button = new JButton("Edit"); + //filemenu.add( miNew ); + filemenu.add( miSave ); + filemenu.add( miExit ); + menubar.add( filemenu ); + + Container contentPane = getContentPane(); + //contentPane.add( new ControlPanel() , BorderLayout.NORTH ); + contentPane.add( menubar , BorderLayout.NORTH ); + //JPanel aPanel = new JPanel( new FlowLayout( FlowLayout.CENTER) ); + JPanel aPanel = new JPanel( new GridLayout( 2,1 ) ); + aPanel.add( new JScrollPane( table ) ); + aPanel.add( new JScrollPane( rectable ) ); + contentPane.add( aPanel , BorderLayout.CENTER ); + //contentPane.add( button , BorderLayout.SOUTH ); + //contentPane.add( new JScrollPane( table ), BorderLayout.CENTER ); + //contentPane.add( new JScrollPane( table ), BorderLayout.SOUTH ); + //contentPane.add( new JScrollPane( rectable ), BorderLayout.SOUTH ); + //contentPane.add( new JScrollPane( rectable ), BorderLayout.SOUTH ); + this.repaint(); + + } + + public JTable getRectable() { + return rectable; + } + + public void setRectable(JTable rectable) { + this.rectable = rectable; + } + + public JTable getTable() { + return table; + } + + public void setTable(JTable table) { + this.table = table; + } + + /*public JButton getButton() { + return button; + } + + public void setButton(JButton button) { + this.button = button; + }*/ + + public JMenuItem getMiExit() { + return miExit; + } + + public void setMiExit(JMenuItem miExit) { + this.miExit = miExit; + } + + public JMenuItem getMiSave() { + return miSave; + } + + public void setMiSave(JMenuItem miSave) { + this.miSave = miSave; + } + + /*public void setTableData(){ + + }*/ + +} + +//class ControlPanel extends JPanel{} + diff --git a/l10ntools/java/receditor/java/transex3/view/SdfTable.java b/l10ntools/java/receditor/java/transex3/view/SdfTable.java new file mode 100644 index 000000000000..f0cc7bd84a34 --- /dev/null +++ b/l10ntools/java/receditor/java/transex3/view/SdfTable.java @@ -0,0 +1,24 @@ +package transex3.view; + +import javax.swing.JTable; + +class SdfTable extends JTable{ + //private String tableId; + public SdfTable( Object[][] obj1 , Object[] obj2){ + super(obj1,obj2); + } + //@Override + public boolean isCellEditable(int row, int col) { + if( row == 0 && col == 0 || row == 0 && col == 1 || row == 0 && col == 2 || row == 0 && col == 3 || row == 0 && col == 4 ) + return false; + else + return true; + } + /*public String getTableId() { + return tableId; + } + public void setTableId(String tableId) { + this.tableId = tableId; + }*/ + +} \ No newline at end of file diff --git a/l10ntools/java/receditor/makefile.mk b/l10ntools/java/receditor/makefile.mk new file mode 100755 index 000000000000..dd3f84daccce --- /dev/null +++ b/l10ntools/java/receditor/makefile.mk @@ -0,0 +1,39 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2008 by Sun Microsystems, Inc. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.3 $ +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=../.. +PRJNAME=l10ntools +TARGET=receditor + +.INCLUDE : ant.mk + +ALLTAR : ANTBUILD + diff --git a/l10ntools/java/receditor/receditor.MF b/l10ntools/java/receditor/receditor.MF new file mode 100755 index 000000000000..dced97882df9 --- /dev/null +++ b/l10ntools/java/receditor/receditor.MF @@ -0,0 +1 @@ +Main-Class: transex3.controller.Main diff --git a/l10ntools/layout/README b/l10ntools/layout/README new file mode 100644 index 000000000000..1838e2a94ba0 --- /dev/null +++ b/l10ntools/layout/README @@ -0,0 +1,27 @@ +Tralay - Extract and translate strings in Layout xml files. + +Translatable strings in layout xml files are attributes that have name +which starts with an underscore, eg + + _title="Set Zoom" + _label="Whole Page" + +Here is how it works + + * Extract: generate out.sdf + ../unxlngx6.pro/bin/tralay -l en-US zoom.xml > out.sdf + + * Translate: do: + cat out.sdf > trans.sdf + sed 's/en-US\t/de\tde:/' out.sdf >> trans.sdf + + * Merge: translate + ../unxlngx6.pro/bin/tralay -m trans.sdf -l de zoom.xml > zoom-DE.xml + +Running + + dmake test + +does something similar. + + \ No newline at end of file diff --git a/l10ntools/layout/layoutparse.cxx b/l10ntools/layout/layoutparse.cxx new file mode 100644 index 000000000000..0f43c9a3053f --- /dev/null +++ b/l10ntools/layout/layoutparse.cxx @@ -0,0 +1,139 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: layoutparse.cxx,v $ + * + * $Revision: 1.3 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "layoutparse.hxx" + +#define STRING( str ) String( str, RTL_TEXTENCODING_UTF8 ) +#define BSTRING( str ) ByteString( str, RTL_TEXTENCODING_UTF8 ) + +LayoutXMLFile::LayoutXMLFile( bool mergeMode ) + : XMLFile() + , mMergeMode( mergeMode ) +{ +} + +void +LayoutXMLFile::SearchL10NElements( XMLParentNode* pCur, int ) +{ + if ( !pCur ) + pCur = this; + + /* Recurse int children, SearchL10NElements does not do that for us. */ + if ( XMLChildNodeList* lst = pCur->GetChildList() ) + for ( ULONG i = 0; i < lst->Count(); i++ ) + if ( lst->GetObject( i )->GetNodeType() == XML_NODE_TYPE_ELEMENT ) + HandleElement( ( XMLElement* )lst->GetObject( i ) ); + else if ( lst->GetObject( i )->GetNodeType() == XML_NODE_TYPE_COMMENT ) + lst->Remove( i-- ); +} + +std::vector +interestingAttributes( XMLAttributeList* lst ) +{ + std::vector interesting; + if ( lst ) + for ( ULONG i = 0; i < lst->Count(); i++ ) + if ( lst->GetObject( i )->Equals( STRING( "id" ) ) ) + interesting.insert( interesting.begin(), lst->GetObject( i ) ); + else if ( ! BSTRING( *lst->GetObject( i ) ).CompareTo( "_", 1 ) ) + interesting.push_back( lst->GetObject( i ) ); + return interesting; +} + +void +LayoutXMLFile::HandleElement( XMLElement* element ) +{ + std::vector interesting = interestingAttributes( element->GetAttributeList() ); + + if ( interesting.size() ) + { + std::vector::iterator i = interesting.begin(); + + ByteString id = BSTRING( (*i++)->GetValue() ); + + if ( mMergeMode ) + InsertL10NElement( id, element ); + else + for ( ; i != interesting.end(); ++i ) + { + ByteString attributeId = id; + ByteString value = BSTRING( ( *i )->GetValue() ); + XMLElement *e = new XMLElement( *element ); + e->RemoveAndDeleteAllChilds(); + /* Copy translatable text to CONTENT. */ + //new XMLData( STRING( ( *i )->GetValue() ), e, true ); + new XMLData( STRING( value ), e, true ); + attributeId += BSTRING ( **i ); + InsertL10NElement( attributeId, e ); + } + } + + SearchL10NElements( (XMLParentNode*) element ); +} + +void LayoutXMLFile::InsertL10NElement( ByteString const& id, XMLElement* element ) +{ + ByteString const language = "en-US"; + LangHashMap* languageMap = 0; + XMLHashMap::iterator pos = XMLStrings->find( id ); + if ( pos != XMLStrings->end() ) + { + languageMap = pos->second; + fprintf( stderr, "error:%s:duplicate translation found, id=%s\n", + id.GetBuffer(), BSTRING( sFileName ).GetBuffer() ); + exit( 1 ); + } + else + { + languageMap = new LangHashMap(); + XMLStrings->insert( XMLHashMap::value_type( id , languageMap ) ); + order.push_back( id ); + } + (*languageMap)[ language ] = element; +} + +BOOL LayoutXMLFile::Write( ByteString &aFilename ) +{ + + if ( aFilename.Len() ) + { + ofstream aFStream( aFilename.GetBuffer() , ios::out | ios::trunc ); + if ( !aFStream ) + fprintf( stderr, "ERROR: cannot open file:%s\n", aFilename.GetBuffer() ); + else + { + XMLFile::Write( aFStream ); + aFStream.close(); + return true; + } + } + return false; +} diff --git a/l10ntools/layout/layoutparse.hxx b/l10ntools/layout/layoutparse.hxx new file mode 100644 index 000000000000..b9cd8f6c18b2 --- /dev/null +++ b/l10ntools/layout/layoutparse.hxx @@ -0,0 +1,55 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: layoutparse.hxx,v $ + * + * $Revision: 1.3 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef LAYOUTPARSE_HXX +#define LAYOUTPARSE_HXX + +#include "xmlparse.hxx" + +class LayoutXMLFile : public XMLFile +{ + bool mMergeMode; + +public: + LayoutXMLFile( bool mergeMode ); + + void SearchL10NElements( XMLParentNode *pCur, int pos = 0 ); + BOOL Write( ByteString &aFilename ); + void HandleElement( XMLElement* element ); + void InsertL10NElement( ByteString const& id, XMLElement* element ); + + using XMLFile::InsertL10NElement; + using XMLFile::Write; +}; + +std::vector interestingAttributes( XMLAttributeList* lst ); + +#endif /* LAYOUTPARSE_HXX */ diff --git a/l10ntools/layout/loc.sdf b/l10ntools/layout/loc.sdf new file mode 100644 index 000000000000..023357adc420 --- /dev/null +++ b/l10ntools/layout/loc.sdf @@ -0,0 +1,24 @@ +transex3 layout\workben\zoom-1.xml 0 help FL_ZOOM 0 en-US Zoom factor 20080204 13:51:01 +transex3 layout\workben\zoom-1.xml 0 help BTN_WHOLE_PAGE 0 en-US Whole Page 20080204 13:51:01 +transex3 layout\workben\zoom-1.xml 0 help BTN_PAGE_WIDTH 0 en-US Page Width 20080204 13:51:01 +transex3 layout\workben\zoom-1.xml 0 help BTN_OPTIMAL 0 en-US Optimal 20080204 13:51:01 +transex3 layout\workben\zoom-1.xml 0 help BTN_200 0 en-US 200 % 20080204 13:51:01 +transex3 layout\workben\zoom-1.xml 0 help BTN_150 0 en-US 15~0 % 20080204 13:51:01 +transex3 layout\workben\zoom-1.xml 0 help BTN_100 0 en-US 100 % 20080204 13:51:01 +transex3 layout\workben\zoom-1.xml 0 help BTN_75 0 en-US 75 % 20080204 13:51:01 +transex3 layout\workben\zoom-1.xml 0 help BTN_50 0 en-US 50 % 20080204 13:51:01 +transex3 layout\workben\zoom-1.xml 0 help BTN_USER 0 en-US Variable 20080204 13:51:01 +transex3 layout\workben\zoom-1.xml 0 help FL_ZOOM 0 de deZoom factor 20080204 13:51:01 +transex3 layout\workben\zoom-1.xml 0 help BTN_WHOLE_PAGE 0 de deWhole Page 20080204 13:51:01 +transex3 layout\workben\zoom-1.xml 0 help BTN_PAGE_WIDTH 0 de dePage Width 20080204 13:51:01 +transex3 layout\workben\zoom-1.xml 0 help BTN_OPTIMAL 0 de deOptimal 20080204 13:51:01 +transex3 layout\workben\zoom-1.xml 0 help BTN_200 0 de de200 % 20080204 13:51:01 +transex3 layout\workben\zoom-1.xml 0 help BTN_150 0 de de15~0 % 20080204 13:51:01 +transex3 layout\workben\zoom-1.xml 0 help BTN_100 0 de de100 % 20080204 13:51:01 +transex3 layout\workben\zoom-1.xml 0 help BTN_75 0 de de75 % 20080204 13:51:01 +transex3 layout\workben\zoom-1.xml 0 help BTN_50 0 de de50 % 20080204 13:51:01 +transex3 layout\workben\zoom-1.xml 0 help BTN_USER 0 de deVariable 20080204 13:51:01 +transex3 layout\workben\zoom-1.xml 0 help FL_ZOOM 0 en-US Zoom factor 20080204 13:51:01 +transex3 layout\workben\zoom-1.xml 0 help BTN_WHOLE_PAGE 0 en-US Whole Page 20080204 13:51:01 +transex3 layout\workben\zoom-1.xml 0 help FL_ZOOM 0 de de3:Zoom factor 20080204 13:51:01 +transex3 layout\workben\zoom-1.xml 0 help BTN_WHOLE_PAGE 0 de de3:Whole Page 20080204 13:51:01 diff --git a/l10ntools/layout/makefile.mk b/l10ntools/layout/makefile.mk new file mode 100644 index 000000000000..63dbeae6d9e9 --- /dev/null +++ b/l10ntools/layout/makefile.mk @@ -0,0 +1,81 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2008 by Sun Microsystems, Inc. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.3 $ +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=.. + +INCPRE=$(MISC) + +PRJNAME=l10ntools +TARGET=tralay +#TARGETTYPE=GUI +TARGETTYPE=CUI +LIBTARGET=no + +# --- Settings ----------------------------------------------------- + +ENABLE_EXCEPTIONS=TRUE + +.INCLUDE : settings.mk + +.IF "$(SYSTEM_EXPAT)" == "YES" +CFLAGS+=-DSYSTEM_EXPAT +.ENDIF + +# --- Files -------------------------------------------------------- + +APP1TARGET=$(TARGET) + +OBJFILES =\ + $(OBJ)/export2.obj\ + $(OBJ)/helpmerge.obj\ + $(OBJ)/layoutparse.obj\ + $(OBJ)/merge.obj\ + $(OBJ)/tralay.obj\ + $(OBJ)/xmlparse.obj + +APP1OBJS = $(OBJFILES) + +APP1STDLIBS =\ + $(TOOLSLIB)\ + $(EXPATASCII3RDLIB)\ + $(VOSLIB)\ + $(CPPULIB) \ + $(SALLIB) + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk + +test .PHONY: + ../$(INPATH)/bin/tralay -l en-US -o out.sdf zoom.xml + cat out.sdf > trans.sdf + sed 's/en-US\t/de\tde:/' out.sdf >> trans.sdf + ../$(INPATH)/bin/tralay -m trans.sdf -l de -o zoom-DE.xml zoom.xml diff --git a/l10ntools/layout/tralay.cxx b/l10ntools/layout/tralay.cxx new file mode 100644 index 000000000000..13a7fdb0c5d9 --- /dev/null +++ b/l10ntools/layout/tralay.cxx @@ -0,0 +1,403 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: tralay.cxx,v $ + * + * $Revision: 1.4 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include +#include + +#include + +#include "export.hxx" +#include "layoutparse.hxx" +#include "helpmerge.hxx" +#include "xmlparse.hxx" + +// Convert a rtl::OUString to a byte string. +#define OUSTRING_CSTR( str ) \ + rtl::OUStringToOString( str, RTL_TEXTENCODING_UTF8 ).getStr() + +#define STRING( str ) String( str, RTL_TEXTENCODING_UTF8 ) +#define BSTRING( str ) ByteString( str, RTL_TEXTENCODING_UTF8 ) + +using ::rtl::OUString; + +using namespace ::osl; +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; + + +class TranslateLayout : public Application +{ + ByteString mGid1; + ByteString mLanguage; + ByteString mLocalize; + ByteString mOutput; + ByteString mProject; + ByteString mRoot; + bool mMergeMode; + std::vector< ByteString > mLanguages; + std::list< ByteString > mFiles; + +public: + TranslateLayout(); + virtual ~TranslateLayout(); + ByteString GetCommandLineParam( int i ); + ByteString GetOptionArgument( int const i ); + void ExceptionalMain(); + void Main(); + void Merge(); + void MergeLanguage( ByteString const& language ); + void ParseCommandLine(); + void CreateSDF(); + + using Application::GetCommandLineParam; +}; + +static void usage() +{ + fprintf( stderr, "Usage: tralay [OPTION]... XML-FILE\n" ); + fprintf( stderr, "\nOptions:\n" ); + fprintf( stderr, " -h,--help show this help\n" ); + fprintf( stderr, " -l,--language=LANG process this language\n" ); + fprintf( stderr, " -m,--merge=DATABASE.SDF translation database\n" ); + fprintf( stderr, "\nExamples:\n" ); + fprintf( stderr, " tralay -l en-US -o localize.sdf zoom.xml # Extract\n" ); + fprintf( stderr, " tralay -m localize.sdf -l de -l nl -o out zoom.xml # Merge/translate\n" ); + exit( 2 ); +} + +static ByteString ConvertSystemPath( const ByteString& rPath ) +{ + if( rPath.CompareTo( ".", 1 ) == 0 ) + { + OUString sPath( rPath.GetBuffer(), rPath.Len(), RTL_TEXTENCODING_UTF8 ); + + ::rtl::OUString curDirPth, sURL; + osl_getProcessWorkingDir( &curDirPth.pData ); + + ::osl::FileBase::getAbsoluteFileURL( curDirPth, sPath, sURL ); + ::osl::FileBase::getSystemPathFromFileURL( sURL, sPath ); + + return ByteString( rtl::OUStringToOString( sPath, RTL_TEXTENCODING_UTF8 ) ); + } + else + { + return rPath; + } +} + +ByteString TranslateLayout::GetCommandLineParam( int i ) +{ + return ByteString( OUSTRING_CSTR( Application::GetCommandLineParam( sal::static_int_cast< USHORT >( i ) ) ) ); +} + +ByteString TranslateLayout::GetOptionArgument( int const i ) +{ + if ( i >= GetCommandLineParamCount() ) + usage(); + ByteString arg = GetCommandLineParam( i ); + if ( !arg.CompareTo( "-", 1 ) ) + { + fprintf( stderr, "Option needs an argument: %s, found: %s\n", + GetCommandLineParam( i - 1 ).GetBuffer(), + arg.GetBuffer() ); + usage(); + } + return arg; + } + +void TranslateLayout::ParseCommandLine() +{ + for ( int i = 0; i < GetCommandLineParamCount(); i++ ) + { + ByteString aParam = GetCommandLineParam( i ); + if ( aParam.Equals( "-h" ) || aParam.Equals( "--help" ) ) + usage(); + else if ( aParam.Equals( "-l" ) || aParam.Equals( "--language" ) ) + mLanguages.push_back ( GetOptionArgument( ++i ) ); + else if ( aParam.Equals( "-m" ) || aParam.Equals( "--merge" ) ) + { + mMergeMode = true; + mLocalize = GetOptionArgument( ++i ); + } + else if ( aParam.Equals( "-o" ) || aParam.Equals( "--output" ) ) + mOutput = ConvertSystemPath( GetOptionArgument( ++i ) ); + else if ( !aParam.CompareTo( "-", 1 ) ) + { + fprintf( stderr, "error: No such option: %s\n", aParam.GetBuffer() ); + usage(); + } + else + mFiles.push_back( ConvertSystemPath( aParam ) ); + } + if ( !mFiles.size() ) + { + fprintf( stderr, "error: No XML-FILE found\n" ); + usage(); + } +} + +static XMLAttribute* +findAttribute( XMLAttributeList* lst, String const& name ) +{ + for ( ULONG i = 0; i < lst->Count(); i++ ) + if ( lst->GetObject( i )->Equals( name ) ) + return lst->GetObject( i ); + return 0; +} + +static XMLAttribute* +translateAttribute( XMLAttributeList* lst, + String const& name, String const& translation ) +{ + if ( XMLAttribute* a = findAttribute( lst, name ) ) + return lst->Replace ( new XMLAttribute( name.Copy( 1 ), translation ), a ); + return 0; +} + +static void +translateElement( XMLElement* element, ByteString const& lang, + ResData* resData, MergeDataFile& mergeData ) +{ + XMLAttributeList* attributes = element->GetAttributeList(); + std::vector interesting( interestingAttributes( attributes ) ); + + + if( !interesting.empty() ) + { + std::vector::iterator i( interesting.begin() ); + ByteString id = BSTRING( (*i++)->GetValue() ); + for ( ; i != interesting.end(); ++i ) + { + ByteString attributeId = id; + attributeId += BSTRING ( **i ); + resData->sGId = attributeId; + resData->sId = element->GetOldref(); + + if ( PFormEntrys* entry = mergeData.GetPFormEntrys( resData ) ) + { + ByteString translation; + entry->GetText( translation, STRING_TYP_TEXT, lang, true ); + // ByteString original = removeContent( element ); + if ( !translation.Len() ) +#if 0 + translation = original; +#else + translation = BSTRING( ( *i )->GetValue() ); +#endif + delete translateAttribute( attributes, **i , STRING( translation ) ); + } + } + } +} + +static bool is_dir( ByteString const& name ) +{ + DirectoryItem aItem; + OUString sFileURL( name.GetBuffer(), name.Len(), RTL_TEXTENCODING_UTF8 ); + FileBase::getFileURLFromSystemPath( sFileURL, sFileURL ); + if( DirectoryItem::get( sFileURL, aItem ) == FileBase::E_None ) + { + FileStatus aStatus(FileStatusMask_Type); + if( aItem.getFileStatus( aStatus ) == FileBase::E_None ) + { + if( aStatus.getFileType() == FileStatus::Directory ) + return true; + } + } + return false; +} + +static void make_directory( ByteString const& name ) +{ + OUString sFileURL( name.GetBuffer(), name.Len(), RTL_TEXTENCODING_UTF8 ); + FileBase::getFileURLFromSystemPath( sFileURL, sFileURL ); + Directory::create( sFileURL ); +} + +static void insertMarker( XMLParentNode *p, ByteString const& file ) +{ + if ( XMLChildNodeList* lst = p->GetChildList() ) + if ( lst->Count() ) + { + ULONG i = 1; + // Skip newline, if possible. + if ( lst->Count() > 1 + && lst->GetObject( 2 )->GetNodeType() == XML_NODE_TYPE_DEFAULT ) + i++; + OUString marker = OUString::createFromAscii( "\n NOTE: This file has been generated automagically by transex3/layout/tralay,\n from source template: " ) + + STRING( file ) + + OUString::createFromAscii( ".\n Do not edit, changes will be lost.\n" ); + lst->Insert( new XMLComment( marker, 0 ), i ); + } +} + +void TranslateLayout::MergeLanguage( ByteString const& language ) +{ + ByteString xmlFile = mFiles.front(); + + MergeDataFile mergeData( mLocalize, xmlFile, + FALSE, RTL_TEXTENCODING_MS_1252 ); + + DirEntry aFile( xmlFile ); + SimpleXMLParser aParser; + LayoutXMLFile* layoutXml = new LayoutXMLFile( mMergeMode ); + if ( !aParser.Execute( aFile.GetFull() , STRING( xmlFile ), layoutXml ) ) + { + fprintf(stderr, "error: parsing: %s\n", xmlFile.GetBuffer() ); + return; + } + + layoutXml->Extract(); + insertMarker( layoutXml, xmlFile ); + + ResData resData( "", "", "" ); + resData.sResTyp = mProject; /* mGid1 ?? */ + resData.sFilename = xmlFile; + + XMLHashMap* xmlStrings = layoutXml->GetStrings(); + for ( XMLHashMap::iterator i = xmlStrings->begin(); i != xmlStrings->end(); + ++i ) + { + if ( LangHashMap* languageMap = i->second ) + if ( XMLElement* element = ( *languageMap )[ "en-US" ] ) + translateElement( element, language, &resData, mergeData ); + } + +#ifndef WNT + ByteString outFile = "/dev/stdout"; +#else + ByteString outFile = "\\\\.\\CON"; +#endif + if ( mOutput.Len() ) + { + outFile = mOutput; + if ( is_dir( outFile ) ) + { + ByteString outDir = mOutput; + outDir.Append( "/" ).Append( language ); + if ( !is_dir( outDir ) ) + make_directory( outDir ); + outFile = outDir; + outFile.Append( "/" ).Append( xmlFile ); + } + } + layoutXml->Write( outFile ); + delete layoutXml; +} + +void TranslateLayout::Merge() +{ + if ( mLanguages.size() ) + for ( std::vector::iterator i = mLanguages.begin(); + i != mLanguages.end(); ++i) + MergeLanguage( *i ); + else + MergeLanguage( mLanguage ); +} + +void TranslateLayout::CreateSDF() +{ + ByteString xmlFile = mFiles.front(); +#ifndef WNT + ByteString sdf = "/dev/stdout"; +#else + ByteString sdf = "\\\\.\\CON"; +#endif + if ( mOutput.Len() ) + sdf = mOutput; + Export::SetLanguages( mLanguages ); + HelpParser::CreateSDF( sdf, mProject, mRoot, xmlFile, + new LayoutXMLFile( mMergeMode ), mGid1 ); +} + +void TranslateLayout::ExceptionalMain() +{ + ParseCommandLine(); + if ( mLanguages.size() ) + mLanguage = mLanguages.front(); + if ( mMergeMode ) + Merge(); + else + CreateSDF(); +} + +void TranslateLayout::Main() +{ + try + { + ExceptionalMain(); + } + catch ( xml::sax::SAXException& rExc ) + { + OString aStr( OUStringToOString( rExc.Message, + RTL_TEXTENCODING_ASCII_US ) ); + uno::Exception exc; + if (rExc.WrappedException >>= exc) + { + aStr += OString( " >>> " ); + aStr += OUStringToOString( exc.Message, RTL_TEXTENCODING_ASCII_US ); + } + fprintf( stderr, "error: parsing: '%s'\n", aStr.getStr() ); + OSL_ENSURE( 0, aStr.getStr() ); + } + catch ( uno::Exception& rExc ) + { + OString aStr( OUStringToOString( rExc.Message, + RTL_TEXTENCODING_ASCII_US ) ); + fprintf( stderr, "error: UNO: '%s'\n", aStr.getStr() ); + OSL_ENSURE( 0, aStr.getStr() ); + } +} + +TranslateLayout::TranslateLayout() + : Application() + , mGid1( "layout" ) + , mLanguage( "en-US" ) + , mLocalize( "localize.sdf" ) + , mOutput() + , mProject( "layout" ) + , mRoot() + , mMergeMode( false ) + , mLanguages() + , mFiles() +{ +} + +TranslateLayout::~TranslateLayout() +{ +} + +SAL_IMPLEMENT_MAIN() +{ + TranslateLayout t; + t.Main(); + return 0; +} diff --git a/l10ntools/layout/zoom.xml b/l10ntools/layout/zoom.xml new file mode 100644 index 000000000000..0fb3d27343ff --- /dev/null +++ b/l10ntools/layout/zoom.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/l10ntools/prj/build.lst b/l10ntools/prj/build.lst new file mode 100644 index 000000000000..ff961c096cbd --- /dev/null +++ b/l10ntools/prj/build.lst @@ -0,0 +1,10 @@ +tr l10ntools : tools LIBXSLT:libxslt BERKELEYDB:berkeleydb LUCENE:lucene NULL +tr l10ntools usr1 - all tr_mkout NULL +tr l10ntools\inc nmake - all tr_inc NULL +tr l10ntools\source nmake - all tr_src tr_inc NULL +tr l10ntools\layout nmake - all rt_layout tr_src tr_inc NULL +#tr l10ntools\java\l10nconv nmake - all tr_conv NULL +#tr l10ntools\java\receditor nmake - all tr_rece NULL +tr l10ntools\source\help nmake - all tr_bla_help NULL +tr l10ntools\source\filter\utils nmake - all tr_bla_utils NULL +tr l10ntools\source\filter\merge nmake - all tr_bla_merge tr_bla_utils NULL diff --git a/l10ntools/prj/d.lst b/l10ntools/prj/d.lst new file mode 100644 index 000000000000..f75c16b43764 --- /dev/null +++ b/l10ntools/prj/d.lst @@ -0,0 +1,61 @@ +mkdir: %_DEST%\inc%_EXT%\l10ntools +mkdir: %_DEST%\bin%_EXT% +mkdir: %_DEST%\bin%_EXT%\help +mkdir: %_DEST%\bin%_EXT%\help\com +mkdir: %_DEST%\bin%_EXT%\help\com\sun +mkdir: %_DEST%\bin%_EXT%\help\com\sun\star +mkdir: %_DEST%\bin%_EXT%\help\com\sun\star\help + +..\%__SRC%\bin\cfgex.exe %_DEST%\bin%_EXT%\cfgex.exe +..\%__SRC%\bin\cfgex %_DEST%\bin%_EXT%\cfgex +..\%__SRC%\bin\transex3.exe %_DEST%\bin%_EXT%\transex3.exe +..\%__SRC%\bin\transex3 %_DEST%\bin%_EXT%\transex3 +..\%__SRC%\bin\lngex.exe %_DEST%\bin%_EXT%\lngex.exe +..\%__SRC%\bin\lngex %_DEST%\bin%_EXT%\lngex +..\%__SRC%\bin\localize_sl.exe %_DEST%\bin%_EXT%\localize_sl.exe +..\%__SRC%\bin\localize_sl %_DEST%\bin%_EXT%\localize_sl +..\%__SRC%\bin\xrmex.exe %_DEST%\bin%_EXT%\xrmex.exe +..\%__SRC%\bin\xrmex %_DEST%\bin%_EXT%\xrmex +..\%__SRC%\bin\gsicheck.exe %_DEST%\bin%_EXT%\gsicheck.exe +..\%__SRC%\bin\gsicheck %_DEST%\bin%_EXT%\gsicheck +..\%__SRC%\bin\helpex.exe %_DEST%\bin%_EXT%\helpex.exe +..\%__SRC%\bin\helpex %_DEST%\bin%_EXT%\helpex +..\%__SRC%\bin\ulfex.exe %_DEST%\bin%_EXT%\ulfex.exe +..\%__SRC%\bin\ulfex %_DEST%\bin%_EXT%\ulfex +..\%__SRC%\bin\txtconv.exe %_DEST%\bin%_EXT%\txtconv.exe +..\%__SRC%\bin\txtconv %_DEST%\bin%_EXT%\txtconv +..\%__SRC%\bin\tralay.exe %_DEST%\bin%_EXT%\tralay.exe +..\%__SRC%\bin\tralay %_DEST%\bin%_EXT%\tralay +..\%__SRC%\bin\ulfconv %_DEST%\bin%_EXT%\ulfconv +..\%__SRC%\class\FCFGMerge.jar %_DEST%\bin%_EXT%\FCFGMerge.jar +..\%__SRC%\class\HelpIndexerTool.jar %_DEST%\bin%_EXT%\HelpIndexerTool.jar +..\%__SRC%\bin\HelpLinker %_DEST%\bin%_EXT%\HelpLinker +..\%__SRC%\bin\HelpCompiler %_DEST%\bin%_EXT%\HelpCompiler +..\%__SRC%\bin\HelpCompiler.exe %_DEST%\bin%_EXT%\HelpCompiler.exe +..\%__SRC%\bin\HelpLinker.exe %_DEST%\bin%_EXT%\HelpLinker.exe +..\%__SRC%\bin\HelpLinker* %_DEST%\bin%_EXT% + +..\%__SRC%\class\converter\converter.jar %_DEST%\bin%_EXT%\converter.jar +..\%__SRC%\doc\converter_javadoc.zip %_DEST%\bin%_EXT%\converter_javadoc.zip + +..\%__SRC%\class\receditor\receditor.jar %_DEST%\bin%_EXT%\receditor.jar + +..\scripts\localize.pl %_DEST%\bin%_EXT%\localize.pl +..\scripts\localize_old.pl %_DEST%\bin%_EXT%\localize_old.pl +..\scripts\localize %_DEST%\bin%_EXT%\localize +..\scripts\fast_merge.pl %_DEST%\bin%_EXT%\fast_merge.pl +..\scripts\keyidGen.pl %_DEST%\bin%_EXT%\keyidGen.pl + +..\inc\export.hxx %_DEST%\inc%_EXT%\l10ntools\export.hxx +..\inc\l10ntools\directory.hxx %_DEST%\inc%_EXT%\l10ntools\directory.hxx +..\inc\l10ntools\file.hxx %_DEST%\inc%_EXT%\l10ntools\file.hxx +..\inc\l10ntools\vosapp.hxx %_DEST%\inc%_EXT%\l10ntools\vosapp.hxx + +..\inc\utf8conv.hxx %_DEST%\inc%_EXT%\l10ntools\utf8conv.hxx +..\%__SRC%\lib\transex.lib %_DEST%\lib%_EXT%\transex.lib +..\%__SRC%\lib\libtransex.a %_DEST%\lib%_EXT%\libtransex.a + +..\source\help\compilehelp.hxx %_DEST%\inc%_EXT%\l10ntools\compilehelp.hxx +#..\source\help\helplinkerdllapi.h %_DEST%\inc%_EXT%\l10ntools\helplinkerdllapi.h +..\%__SRC%\lib\* %_DEST%\lib%_EXT%\* +..\%__SRC%\class\com\sun\star\help\* %_DEST%\bin%_EXT%\help\com\sun\star\help\* diff --git a/l10ntools/scripts/fast_merge.pl b/l10ntools/scripts/fast_merge.pl new file mode 100644 index 000000000000..7321a9a42911 --- /dev/null +++ b/l10ntools/scripts/fast_merge.pl @@ -0,0 +1,348 @@ +: +eval 'exec perl -wS $0 ${1+"$@"}' + if 0; +#************************************************************************* +# +# OpenOffice.org - a multi-platform office productivity suite +# +# $RCSfile: fast_merge.pl,v $ +# +# $Revision: 1.1.2.2 $ +# +# last change: $Author: ihi $ $Date: 2007/07/20 10:37:53 $ +# +# The Contents of this file are made available subject to +# the terms of GNU Lesser General Public License Version 2.1. +# +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2005 by Sun Microsystems, Inc. +# 901 San Antonio Road, Palo Alto, CA 94303, USA +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software Foundation. +# +# This library 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 for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +#************************************************************************* + +use strict; +use Class::Struct; +use Getopt::Long; +use File::Temp; +use File::Path; + +my @files; +my @file_names; +my $module_name = ''; +my @current; +my @buffer; +my $last_file; +my $last_path; +my $last_localize_file; +my $first_run = "1"; +my $sdf_filename; +my $merge_dir; +my $WIN; +my $state = "none"; + +if ( defined $ENV{USE_SHELL} && $ENV{USE_SHELL} eq '4nt' ) { $WIN = 'TRUE'; } +else { $WIN = ''; } + +$SIG{INT} = 'inthandler'; +$SIG{QUIT} = 'quithandler'; + +struct ( sdf_obj => +{ + module => '$', + file => '$', + dir => '$', + FILEHANDLE => '$', + line => '$', + endoffile => '$' +} +); + +parse_options(); +my $lock_file = $merge_dir."/lock.mk"; +$lock_file =~ s/\//\\/g , if ( $WIN ) ; +acquire_lock(); +read_sdf_file_names(); +init(); +my $reference; +my $path ; +my $localize_file; +while( hasLines() ) +{ + @current = (); + foreach ( @files ) + { + push @current , $_; + } + + $reference = getNextIdentifier( ); + + @current = (); + foreach ( @files ) + { + if( $_->module eq $reference->module && $_->dir eq $reference->dir ) + { + push @current , $_ ; + } + } + write_lines(); +} +if( $#current+1 ne 0 ) +{ + ( $path , $localize_file ) = make_paths(); + add_to_buffer(); + write_buffer( $path , $localize_file ); +} +release_lock(); +exit( 0 ); + +########################################################################################## +sub acquire_lock +{ + if( -e $lock_file ){ + $state = "blocked"; + print "WARNING: Lock file '$lock_file' 'found, waiting ....\n"; + my $cnt = 0; + sleep 10 , while( -e $lock_file && $cnt++ < 180 ); + exit( 0 ); + }else + { + $state = "locked"; + print "Writing lock file '$lock_file'\n"; + open FILE, ">$lock_file" or die "Can't create lock file '$lock_file'"; + print FILE "L10N_LOCK=YES" ; + close ( FILE ); + } +} +sub release_lock +{ + print "Deleting lock file '$lock_file'\n"; + unlink $lock_file, if( -e $lock_file ); + $state = "none"; +} +sub inthandler +{ + release_lock() , if( $state eq "locked" ); + exit( -1 ); +} +sub quithandler +{ + release_lock() , if( $state eq "locked" ); + exit( 0 ); +} + +sub init +{ + foreach my $file ( @file_names ) + { + my $obj = new sdf_obj; + open my $FILEHANDLE , "<$file" or die "Can't open file '$file'"; + $obj->FILEHANDLE ( $FILEHANDLE ) ; + getNextSdfObj( $obj ); + push @files, $obj ; + print "Open file '$file'\n"; + } +} + +# get the next module/file +sub getNextIdentifier +{ + my @sorted = sort { + return $a->module.$a->dir cmp $b->module.$b->dir; + } @current ; + return shift @sorted; +} + +# update the obj with the next line +sub getNextSdfObj +{ + my $obj = shift; + my $line = readline ( $obj->FILEHANDLE ); + if ( $line eq undef ) + { + $obj->endoffile( "true" ); + } + else + { + $line =~ /^(([^\t]*)\t([^\t]*)[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t*)/o ; + if( defined $1 && defined $2 && defined $3 ) + { + $obj->line ( $1 ); + $obj->module( $2 ); + $obj->file ( $3 ); + $obj->dir ( getDir( $3 ) ); + } + else + { + $obj->line ( "" ); + $obj->module( "" ); + $obj->file ( "" ); + $obj->dir ( "" ); + } + } + return $obj; +} +sub getNextSdfObjModule +{ + my $obj = shift; + while( !$obj->endoffile ) + { + my $line = readline ( $obj->FILEHANDLE ); + if ( $line eq undef ) + { + $obj->endoffile( "true" ); + } + else + { + $line =~ /^(([^\t]*)\t([^\t]*).*)/o ; + if( defined $1 && defined $2 && defined $3 ) + { + $obj->line ( $1 ); + $obj->module( $2 ); + $obj->file ( $3 ); + $obj->dir ( getDir( $3 ) ); + } + else + { + $obj->line ( "" ); + $obj->module( "" ); + $obj->file ( "" ); + $obj->dir ( "" ); + } + return $obj , if( $obj->module eq $module_name ) + } + } + #return $obj; +} +sub getDir +{ + my $path = shift ; + $path =~ s/\//\\/g; + my @tmp_path = split /\\/ , $path; + pop @tmp_path; + $path = join '\\' , @tmp_path; + return $path; +} + +sub hasLines +{ + my $hasLines = ""; + my @tmpfiles; + foreach ( @files ) + { + push @tmpfiles , $_, if( !$_->endoffile ); + } + @files = @tmpfiles; + return $#files+1; +} + +sub make_paths +{ + my $localizeFile = $merge_dir."\\".$current[ 0 ]->module."\\".$current[ 0 ]->file; + my $path = getDir( $localizeFile ); + if ( !$WIN ) { $path =~ s/\\/\//g; } + + $localizeFile = $path."\\localize.sdf"; + if ( !$WIN ) { $localizeFile =~ s/\\/\//g; } + + return ( $path , $localizeFile ); +} +sub write_lines +{ + if( $first_run ){ + add_to_buffer(); + my( $path , $localize_file ) = make_paths(); + $last_path = $path; + $last_localize_file = $localize_file; + mkpath $path; + write_buffer( $path , $localize_file ); + $first_run = ''; + } + else + { + return , if ( $#current+1 eq 0 ); + my( $path , $localize_file ) = make_paths(); + if( $path eq $last_path ) + { + add_to_buffer(); + } + else + { + mkpath $path; + write_buffer( $last_path , $last_localize_file ); + add_to_buffer(); + $last_path = $path; + $last_localize_file = $localize_file; + } + } +} +sub add_to_buffer +{ + my $plainline; + my $afile; + my $amodule; + foreach my $elem ( @current ) + { + do { + $amodule=$elem->module; + $afile=$elem->file; + $plainline=$elem->line; + push @buffer, $plainline; + getNextSdfObj( $elem ); + } while ( !$elem->endoffile && $amodule eq $elem->module && $afile eq $elem->file ); + } +} +sub write_buffer +{ + my $path = shift; + my $localize_file = shift; + my $cnt = $#buffer+1; + print "Write to $path $cnt lines\n"; + open FILE , ">>$localize_file" or die "Can't open file '$localize_file'\n"; + foreach ( @buffer ) + { + print FILE $_."\n"; + } + @buffer = (); +} +sub parse_options +{ + my $success = GetOptions( 'sdf_files=s' => \$sdf_filename , 'merge_dir=s' => \$merge_dir ); #, 'module=s' => \$module_name ); + if( ! ( $sdf_filename && $merge_dir && $success ) ) + { + usage(); + exit( -1 ); + } +} + +sub usage +{ + print "Usage: fast_merge -sdf_files -merge_dir \n" ; +} + +sub read_sdf_file_names +{ + open FILE , "<$sdf_filename" or die "Can't open file '$sdf_filename'\n"; + while ( ) + { + push @file_names , split " " , $_ ; + } + close ( FILE ); +} + + diff --git a/l10ntools/scripts/keyidGen.pl b/l10ntools/scripts/keyidGen.pl new file mode 100644 index 000000000000..acb5137e3f7c --- /dev/null +++ b/l10ntools/scripts/keyidGen.pl @@ -0,0 +1,189 @@ +: +eval 'exec perl -S $0 ${1+"$@"}' + if 0; +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2008 by Sun Microsystems, Inc. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# $RCSfile: keyidGen.pl,v $ +# +# $Revision: 1.3 $ +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* +# +# add keyids to sdf file +# + +use Compress::Zlib(); + +print "\nkeyidGen version 1.0 \n\n"; + +my ( $infile,$outfile,$dbimport ); +get_options(); + +print_help() if ( !defined $infile || $help ); +exit 1 if ( !defined $infile ); +if ( ! defined $outfile ) +{ + $outfile = $infile; + $outfile =~ s/\.sdf$//i; + $outfile .= "_KeyID.sdf"; +} + +$collisions = 0; +%hashcodes = (); +$count = 0; +print "writing to $outfile\n"; +open INFILE,"<$infile" || die "could not open $infile $! $^E\n"; +open OUTFILE,">$outfile" || die "could not open $outfile $! $^E\n"; + +while ( ) +{ + $line = $_; + chomp $line; + $hash = 0; + if ( $line =~ /^([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)$/ ) + { + $string="$1 $2 $4 $5 $6 $7 $8"; + $hashp = makeID( $string ); + + if ( defined ($hashcodes{ $hashp } ) ) + { + $collisions ++ unless $hashcodes{ $hashp } eq $string; + } + $hashcodes{ $hashp } = $string; + $count++; + if ( $dbimport ) + { + my ( $pre, $post, $old ); + $pre = "$1\t$2\t"; + $post = "\t$4\t$5\t$6\t$7\t$8\t$9\t$10\t$11\t$12\t$13\t$14\t$15\n"; + $old = $3; + $old =~ s/;{0,1}keyid:......;{0,1}//; + $old =~ s/^0$//; + if ( $old ne "" ) { $old .= ";"; } + print OUTFILE "$pre${old}keyid:$hashp$post"; + } + else + { + print OUTFILE "$1\t$2\t$3\t$4\t$5\t$6\t$7\t$8\t$9\t$10\t".makekidstr($hashp,$11)."\t".makekidstr($hashp,$12)."\t$13\t".makekidstr($hashp,$14)."\t$15\n"; + } + } +} +print "$count entries\n"; +print "$collisions collisions\n"; + +close INFILE; +close OUTFILE; + +sub makeID +{ + my ( $String ) = shift; + my ( $hash ); + # hardcoded to prevent windows installer to choke on bad directoryname :-(( + if ( $String eq "scp2 source\\ooo\\directory_ooo.ulf LngText STR_DIR_KAPITEL " ) + { + return "keyid1"; + } + + $hash = Compress::Zlib::crc32( $String, undef ); + return makenumber( $hash ); +} + +sub makenumber +{ + $h = shift; + # 1 2 3 4 + # 1234567890123456789012345678901234567890 + $symbols="0123456789abcdefghijklmnopqrstuvwxyz+-<=>"; + $order = length($symbols); + $result = ""; + while ( length( $result ) < 6 ) + { + $result .= substr( $symbols, ($h % $order), 1 ); + $h = int( $h / $order ); + } + die "makenumber failed because number is too big (this cannot be so this is a strange error)" if $h > 0; + + return reverse $result; +} + + +sub makekidstr +{ + $kid = shift; + $str = shift; + + if ( $str ne "" ) + { + # special handling for strings starting with font descriptions like {&Tahoma8} (win system integration) + if ( $str =~ s/^(\{\&[^\}]+\})// ) + { + return "$1$kid‖$str"; + } + else + { + return "$kid‖$str"; + } + } + else + { + return ""; + } +# return "default"; +} + +sub print_help +{ + print "\n\n"; + print "keyidGen 0.5 for sdf files\n"; + print "--------------------------\n"; + print "Usage:\n"; + print "keyidGen [] [-dbimport]\n"; + print " add keyids to the entries and write them to a file with\n"; + print " _KeyID added to the name\n"; + print " -dbimport Add KeyID to a new column instead of to the strings.\n"; + print " This is needed to import the IDs into tha database.\n"; + print "\n\n"; +} + + +sub get_options { + my ($arg,$has_infile); + + while ($arg = shift @ARGV) { + $arg =~ /^-dbimport$/ and $dbimport = 1 and next; + $arg =~ /^-help$/ and $help = 1 and next; #show help + + if ( !$has_infile ) + { + $infile = $arg; + $has_infile = 1; + } + else + { + $outfile = $arg; + } + } +} diff --git a/l10ntools/scripts/localize.pl b/l10ntools/scripts/localize.pl new file mode 100755 index 000000000000..0f6a19effc38 --- /dev/null +++ b/l10ntools/scripts/localize.pl @@ -0,0 +1,1201 @@ +: +eval 'exec perl -wS $0 ${1+"$@"}' + if 0; + + +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2008 by Sun Microsystems, Inc. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# $RCSfile: localize.pl,v $ +# +# $Revision: 1.18.6.2 $ +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +use strict; +use Getopt::Long; +use IO::Handle; +use File::Find; +use File::Temp; +use File::Path; +use File::Copy; +use File::Glob qw(:glob csh_glob); +use Cwd; + +my $CVS_BINARY = "/usr/bin/cvs"; +# ver 1.1 +# +#### module lookup +#use lib ("$ENV{SOLARENV}/bin/modules", "$ENV{COMMON_ENV_TOOLS}/modules"); + +#### module lookup +# OOo conform +my @lib_dirs; +BEGIN { + if ( !defined($ENV{SOLARENV}) ) { + die "No environment found (environment variable SOLARENV is undefined)"; + } + push(@lib_dirs, "$ENV{SOLARENV}/bin/modules"); + push(@lib_dirs, "$ENV{COMMON_ENV_TOOLS}/modules") if defined($ENV{COMMON_ENV_TOOLS}); +} +use lib (@lib_dirs); + +#### globals #### +my $sdffile = ''; +my $no_sort = ''; +my $create_dirs = ''; +my $multi_localize_files = ''; +my $module_to_merge = ''; +my $sort_sdf_before = ''; +my $outputfile = ''; +my $no_gsicheck = ''; +my $mode = ''; +my $bVerbose = "0"; +my $srcpath = ''; +my $WIN; +my $languages; +#my %sl_modules; # Contains all modules where en-US and de is source language +my $use_default_date = '0'; +my $force_ooo_module = '0'; +my %is_ooo_module; +my %is_so_module; +my $DELIMITER; + + # ( leftpart ) ( rightpart ) + # prj file dummy type gid lid helpid pform width lang text helptext qhelptext title timestamp +my $sdf_regex = "((([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*))\t([^\t]*)\t(([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t)([^\t]*))"; +my $file_types = "(src|hrc|xcs|xcu|lng|ulf|xrm|xhp|xcd|xgf|xxl|xrb)"; +# Always use this date to prevent cvs conflicts +my $default_date = "2002-02-02 02:02:02"; +my @sdfparticles; + +#### main #### +parse_options(); +check_modules_scm(); + +if ( defined $ENV{USE_SHELL} && $ENV{USE_SHELL} eq '4nt' ) { + $WIN = 'TRUE'; + $DELIMITER = "\\"; +} + else { + $WIN = ''; + $DELIMITER = "/"; +} + +my $binpath = ''; +if( defined $ENV{UPDMINOREXT} ) +{ + $binpath = $ENV{SOLARVER}.$DELIMITER.$ENV{INPATH}.$DELIMITER."bin".$ENV{UPDMINOREXT}.$DELIMITER ; +} +else +{ + $binpath = $ENV{SOLARVER}.$DELIMITER.$ENV{INPATH}.$DELIMITER."bin".$DELIMITER ; +} + +#%sl_modules = fetch_sourcelanguage_dirlist(); + + +if ( $mode eq "merge" ) { + if ( ! $no_gsicheck ){ + merge_gsicheck(); + } + splitfile( $sdffile ); + if ( ! $no_gsicheck ){ + unlink $sdffile; # remove temp file! + } +} +elsif( $mode eq "extract" ) { + collectfiles( $outputfile ); +} +else { + usage(); +} + +exit(0); + +######################################################### +sub splitfile{ + + my $lastFile = ''; + my $currentFile = ''; + my $cur_sdffile = ''; + my $last_sdffile = ''; + my $delim; + my $badDelim; + my $start = 'TRUE'; + my %index = (); + my %block; + + STDOUT->autoflush( 1 ); + + #print STDOUT "Open File $sdffile\n"; + open MYFILE , "< $sdffile" + or die "Can't open '$sdffile'\n"; + +# my %lang_hash; + my %string_hash_ooo; + my %string_hash_so; + my %so_modules; + $so_modules{ "extras_full" } = "TRUE"; + + while( ){ + if( /$sdf_regex/ ){ + my $line = defined $_ ? $_ : ''; + my $prj = defined $3 ? $3 : ''; + my $file = defined $4 ? $4 : ''; + my $type = defined $6 ? $6 : ''; + my $gid = defined $7 ? $7 : ''; + my $lid = defined $8 ? $8 : ''; + my $lang = defined $12 ? $12 : ''; + my $plattform = defined $10 ? $10 : ''; + my $helpid = defined $9 ? $9 : ''; + next if( $prj eq "binfilter" ); # Don't merge strings into binfilter module + chomp( $line ); + + if( is_openoffice_module( $prj ) ) + { + $string_hash_ooo { $lang }{ "$prj\t$file\t$type\t$gid\t$lid\t$helpid\t$plattform\t$lang" } = $line; + } + else + { + $string_hash_so{ $lang }{ "$prj\t$file\t$type\t$gid\t$lid\t$helpid\t$plattform\t$lang" } = $line; + } + } + } + close( MYFILE ); + + if( !defined $ENV{SRC_ROOT} ){ + print "Error, no SRC_ROOT in env found.\n"; + exit( -1 ); + } + my $src_root = $ENV{SRC_ROOT}; + #print $WIN eq "TRUE" ? $src_root."\\l10n_so\n" : $src_root."/l10n_so\n"; + my $so_l10n_path = $WIN eq "TRUE" ? $src_root."\\l10n_so\\source" : $src_root."/l10n_so/source"; + my $ooo_l10n_path = $WIN eq "TRUE" ? $src_root."\\l10n\\source" : $src_root."/l10n/source"; + + #print "$so_l10n_path\n"; + #print "$ooo_l10n_path\n"; + + write_sdf( \%string_hash_so , $so_l10n_path ); + write_sdf( \%string_hash_ooo , $ooo_l10n_path ); + +} +sub check_modules_scm +{ + #my @ooo_modules; + #my @so_modules; + my $src_path = $ENV{ SRC_ROOT } ; + my $last_dir = getcwd(); + chdir $src_path ; + my @modules = <*/.svn/entries>; + + foreach my $module ( @modules ) + { + #print "$module \n"; + if( open ( FILE , "<$module" ) ) + { + while( ) + { + + my @path = split ( "/" , $module ) ; + + if( /svn.services.openoffice.org/ ) + { + my $mod = $path[ 0 ]; + #push @ooo_modules , $mod; + $is_ooo_module{ $mod } = "true"; + # print "$module -> ooo "; + } + elsif ( /jumbo2.germany.sun.com/ ) + { + my $mod = $path[ 0 ]; + #push @so_modules , $mod; + # print "$module -> so "; + #$so_lookup_hash{ $mod } = "true"; + } + #else + #{ + # print "ERROR: Is $module a SO or OOo module? Can not parese the $module/.svn/entries file ... please check mwsfinnish/merge/splitsdf.pl line 280\n"; + # exit -1; + #} + } + } + } + chdir $last_dir ; + #print "OOO\n"; + #print @ooo_modules; + #print "\nSO\n"; + #print @so_modules; +} + + +#sub parse +#{ +# my $command = "$CVS_BINARY -d:pserver:anoncvs\@anoncvs.services.openoffice.org:/cvs co -c"; +# my $output = `$command`; +# my $rc = $? << 8; +# if ( $output eq "" || $rc < 0 ){ +# print STDERR "ERROR: Can not fetch cvs alias list, please login to the cvs server and press at the password prompt just return\ncvs -d:pserver:anoncvs\@anoncvs.services.openoffice.org:/cvs login\n"; +# exit ( -1 ); +# } +# my @list = split /\n/ , $output ; +# foreach my $string( @list ) +# { +# +# # print "Found '$1'\n" , if( $string =~ /^(\w*)/ && $1 ne "" ); +# +# $is_ooo_module{ $1 } = "TRUE", if( $string =~ /^(\w*)/ && $1 ne "" ); +# } +# # foreach my $key( keys( %is_ooo_module ) ) +# #{ +# # print "$key\n"; +# #} +#} +sub is_openoffice_module +{ + my $module = shift; + return "TRUE", if ( $force_ooo_module || defined $is_ooo_module{ $module } ); + return ""; +} + +sub write_sdf +{ + my $string_hash = shift; + my $l10n_file = shift; + + foreach my $lang( keys( %{ $string_hash } ) ) + { + my @sdf_file; + + # mkdir!!!! + my $current_l10n_file = $WIN eq "TRUE" ? $l10n_file."\\$lang\\localize.sdf" : $l10n_file."/$lang/localize.sdf"; + print "Writing '$current_l10n_file'\n"; + if( open DESTFILE , "< $current_l10n_file" ){ + + while(){ + if( /$sdf_regex/ ){ + my $line = defined $_ ? $_ : ''; + my $prj = defined $3 ? $3 : ''; + my $file = defined $4 ? $4 : ''; + my $type = defined $6 ? $6 : ''; + my $gid = defined $7 ? $7 : ''; + my $lid = defined $8 ? $8 : ''; + my $lang = defined $12 ? $12 : ''; + my $plattform = defined $10 ? $10 : ''; + my $helpid = defined $9 ? $9 : ''; + + chomp( $line ); + if ( defined $string_hash->{ $lang }{ "$prj\t$file\t$type\t$gid\t$lid\t$helpid\t$plattform\t$lang" } ) + { + # Changed String! + push @sdf_file , $string_hash->{ $lang }{ "$prj\t$file\t$type\t$gid\t$lid\t$helpid\t$plattform\t$lang" } ; + $string_hash->{ $lang }{ "$prj\t$file\t$type\t$gid\t$lid\t$helpid\t$plattform\t$lang" } = undef; + } + else + { + # No new string + push @sdf_file , $line; + } + } + } + } + close( DESTFILE ); + #Now just append the enw strings + #FIXME!!! Implement insertion in the correct order + foreach my $key ( keys ( %{ $string_hash->{ $lang } } ) ) + { + push @sdf_file , $string_hash->{ $lang }{ $key } , if ( defined $string_hash->{ $lang }{ $key } ); + #print "WARNING: Not defined = ".$string_hash->{ $lang }{ $key }."\n", if( ! defined $string_hash->{ $lang }{ $key } ); + } + + # Write the new file + my ( $TMPFILE , $tmpfile ) = File::Temp::tempfile(); + if( open DESTFILE , "+> $tmpfile " ){ + print DESTFILE get_license_header(); + foreach my $string( @sdf_file ){ + print DESTFILE "$string\n"; + } + close ( DESTFILE ); + if( move( $current_l10n_file , $current_l10n_file.".backup" ) ){ + if( copy( $tmpfile , $current_l10n_file ) ){ + unlink $l10n_file.".backup"; + } else { print STDERR "Can't open/create '$l10n_file', original file is renamed to $l10n_file.backup\n"; } + } else { print STDERR "Can't open/create '$l10n_file'\n"; } + }else{ + print STDERR "WARNING: Can't open/create '$l10n_file'\n"; + } + unlink $tmpfile; + } +} + +######################################################### + +sub get_license_header{ + return +"#\n". +"# #### ### # # ### ##### ##### #### ##### ##### \n". +"# # # # # ## # # # # # # # # # \n". +"# # # # # # # # # # # ### # # # # \n". +"# # # # # # ## # # # # # # # # \n". +"# #### ### # # ### # ##### #### ##### # \n". +"#\n". +"# DO NOT EDIT! This file will be overwritten by localisation process\n". +"#\n". +"#*************************************************************************\n". +"#\n". +"# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n". +"# \n". +"# Copyright 2008 by Sun Microsystems, Inc.\n". +"#\n". +"# OpenOffice.org - a multi-platform office productivity suite\n". +"#\n". +"# \$RCSfile:". +"localize.pl,v \$\n". +"#\n". +"# \$Revision: ". +"1.17.4.1 \$\n". +"#\n". +"# This file is part of OpenOffice.org.\n". +"#\n". +"# OpenOffice.org is free software: you can redistribute it and/or modify\n". +"# it under the terms of the GNU Lesser General Public License version 3\n". +"# only, as published by the Free Software Foundation.\n". +"#\n". +"# OpenOffice.org is distributed in the hope that it will be useful,\n". +"# but WITHOUT ANY WARRANTY; without even the implied warranty of\n". +"# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n". +"# GNU Lesser General Public License version 3 for more details\n". +"# (a copy is included in the LICENSE file that accompanied this code).\n". +"#\n". +"# You should have received a copy of the GNU Lesser General Public License\n". +"# version 3 along with OpenOffice.org. If not, see\n". +"# \n". +"# for a copy of the LGPLv3 License.\n". +"#\n". +"#*************************************************************************\n"; +} +######## Check input sdf file and use only the correct part +sub merge_gsicheck{ + my $command = ''; + my ( $TMPHANDLE , $tmpfile ) = File::Temp::tempfile(); + close ( $TMPHANDLE ); + + if( $ENV{WRAPCMD} ){ + $command = "$ENV{WRAPCMD} gsicheck"; + }else{ + $command = "gsicheck"; + } + my $errfile = $sdffile.".err"; + $command .= " -k -c -wcf $tmpfile -wef $errfile -l \"\" $sdffile"; + #my $rc = system( $command ); + my $output = `$command`; + my $rc = $? << 8; + if ( $output ne "" ){ + print STDOUT "### gsicheck ###\n"; + print STDOUT "### The file $errfile have been written containing the errors in your sdf file. Those lines will not be merged: ###\n\n"; + print STDOUT "$output\n"; + print STDOUT "################\n"; + + }else{ + # Remove the 0 Byte file + unlink $errfile; + } + $sdffile = $tmpfile; +} +######################################################### +# find search function +sub wanted +{ + my $file = $File::Find::name; + if( -f $file && $file =~ /.*localize.sdf$/ && !( $file =~ /.*\.svn.*/ ) ) { + push @sdfparticles , $file; + if( $bVerbose eq "1" ) { print STDOUT "$file\n"; } + else { print "."; } + } +} + +sub add_paths +{ + my $langhash_ref = shift; + my $root_dir = $ENV{ SRC_ROOT }; + my $ooo_l10n_dir = "$root_dir"."$DELIMITER"."l10n"."$DELIMITER"."source"; + my $so_l10n_dir = "$root_dir"."$DELIMITER"."l10n_so"."$DELIMITER"."source"; + + if( -e $ooo_l10n_dir ) + { + foreach my $lang ( keys( %{ $langhash_ref } ) ) + { + my $loc_file = "$ooo_l10n_dir"."$DELIMITER"."$lang"."$DELIMITER"."localize.sdf"; + if( -e $loc_file ) + { + push @sdfparticles , "$ooo_l10n_dir"."$DELIMITER"."$lang"."$DELIMITER"."localize.sdf"; + } + else { print "WARNING: $loc_file not found ....\n"; } + } + } + else { die "ERROR: Can not find directory $ooo_l10n_dir!!!" } + if( -e $so_l10n_dir ) + { + foreach my $lang ( keys( %{ $langhash_ref } ) ) + { + my $loc_file = "$so_l10n_dir"."$DELIMITER"."$lang"."$DELIMITER"."localize.sdf"; + if( -e $loc_file ) + { + push @sdfparticles , "$ooo_l10n_dir"."$DELIMITER"."$lang"."$DELIMITER"."localize.sdf"; + } + else { #print "WARNING: $loc_file not found ....\n"; + } + } + + } +} +sub collectfiles{ + print STDOUT "### Localize\n"; + my $localizehash_ref; + my ( $bAll , $bUseLocalize, $langhash_ref , $bHasSourceLanguage , $bFakeEnglish ) = parseLanguages(); + + # Enable autoflush on STDOUT + # $| = 1; + STDOUT->autoflush( 1 ); + + ### Search sdf particles + #print STDOUT "### Searching sdf particles\n"; + my $working_path = getcwd(); + #chdir $srcpath; + #find ( { wanted => \&wanted , follow => 1 }, getcwd() ); + #chdir $working_path; + add_paths( $langhash_ref ); + #my $nFound = $#sdfparticles +1; + #print "\n $nFound files found !\n"; + + my ( $LOCALIZEPARTICLE , $localizeSDF ) = File::Temp::tempfile(); + close( $LOCALIZEPARTICLE ); + + my ( $ALLPARTICLES_MERGED , $particleSDF_merged ) = File::Temp::tempfile(); + close( $ALLPARTICLES_MERGED ); + my ( $LOCALIZE_LOG , $my_localize_log ) = File::Temp::tempfile(); + close( $LOCALIZE_LOG ); + + ## Get the localize en-US extract + if( $bAll || $bUseLocalize ){ + print "### Fetching source language strings\n"; + my $command = ""; + my $args = ""; + + if( $ENV{WRAPCMD} ){ + $command = $ENV{WRAPCMD}.$binpath."localize_sl"; + }else{ + $command = $binpath."localize_sl"; + } + print $command; + # -e + # if ( -x $command ){ + if( $command ){ + if( !$bVerbose ){ $args .= " -QQ "; } + $args .= " -e -f $localizeSDF -l "; + my $bFlag=""; + if( $bAll ) {$args .= " en-US";} + else{ + my @list; + foreach my $isokey ( keys( %{ $langhash_ref } ) ){ + push @list , $isokey; + if( $langhash_ref->{ $isokey } ne "" ){ + push @list , $langhash_ref->{ $isokey }; + } + } + remove_duplicates( \@list ); + foreach my $isokey ( @list ){ + switch :{ + ( $isokey=~ /^en-US$/i ) + && do{ + if( $bFlag eq "TRUE" ){ $args .= ",en-US"; } + else { + $args .= "en-US"; $bFlag = "TRUE"; + } + }; + + } #switch + } #foreach + } # if + } # if +# if ( !$bVerbose ){ +# if ( $WIN eq "TRUE" ) { $args .= " > $my_localize_log"; } +# else { $args .= " >& $my_localize_log"; } +# } + if ( $bVerbose ) { print STDOUT $command.$args."\n"; } + + my $rc = system( $command.$args ); + + if( $rc < 0 ){ print STDERR "ERROR: localize rc = $rc\n"; exit( -1 ); } + ( $localizehash_ref ) = read_file( $localizeSDF , $langhash_ref ); + + } + ## Get sdf particles +#***************** + open ALLPARTICLES_MERGED , "+>> $particleSDF_merged" + or die "Can't open $particleSDF_merged"; + + ## Fill fackback hash + my( $fallbackhashhash_ref ) = fetch_fallback( \@sdfparticles , $localizeSDF , $langhash_ref ); + my %block; + my $cur_fallback; + if( !$bAll) { + foreach my $cur_lang ( keys( %{ $langhash_ref } ) ){ + #print STDOUT "DBG: G1 cur_lang=$cur_lang\n"; + $cur_fallback = $langhash_ref->{ $cur_lang }; + if( $cur_fallback ne "" ){ + # Insert fallback strings + #print STDOUT "DBG: Renaming $cur_fallback to $cur_lang in fallbackhash\n"; + rename_language( $fallbackhashhash_ref , $cur_fallback , $cur_lang ); + } + foreach my $currentfile ( @sdfparticles ){ + if ( open MYFILE , "< $currentfile" ) { + while(){ + if( /$sdf_regex/ ){ + my $line = defined $_ ? $_ : ''; + my $prj = defined $3 ? $3 : ''; + my $file = defined $4 ? $4 : ''; + my $type = defined $6 ? $6 : ''; + my $gid = defined $7 ? $7 : ''; + my $lid = defined $8 ? $8 : ''; + my $lang = defined $12 ? $12 : ''; + my $plattform = defined $10 ? $10 : ''; + my $helpid = defined $9 ? $9 : ''; + + chomp( $line ); + + if ( $lang eq $cur_lang ){ + # Overwrite fallback strings with collected strings + #if( ( !has_two_sourcelanguages( $cur_lang) && $cur_lang eq "de" ) || $cur_lang ne "en-US" ){ + $fallbackhashhash_ref->{ $cur_lang }{ $prj.$gid.$lid.$file.$type.$plattform.$helpid } = $line ; + #} + + } + } + } + }else { print STDERR "WARNING: Can't open file $currentfile"; } + } + + foreach my $line ( keys( %{$fallbackhashhash_ref->{ $cur_lang } } )) { + if( #$cur_lang ne "de" && + $cur_lang ne "en-US" ){ + print ALLPARTICLES_MERGED ( $fallbackhashhash_ref->{ $cur_lang }{ $line }, "\n" ); + } + } + } + } else { + foreach my $currentfile ( @sdfparticles ){ + if ( open MYFILE , "< $currentfile" ) { + while( ){ + print ALLPARTICLES_MERGED ( $_, "\n" ); # recheck de / en-US ! + } + } + else { print STDERR "WARNING: Can't open file $currentfile"; } + } + } + close ALLPARTICLES_MERGED; +#*************** + + # Hash of array + my %output; + my @order; + + ## Join both + if( $outputfile ){ + if( open DESTFILE , "+> $outputfile" ){ + if( !open LOCALIZEPARTICLE , "< $localizeSDF" ) { print STDERR "ERROR: Can't open file $localizeSDF\n"; } + if( !open ALLPARTICLES_MERGED , "< $particleSDF_merged" ) { print STDERR "ERROR: Can't open file $particleSDF_merged\n"; } + + # Insert localize + my $extract_date=""; + while ( ){ + if( /$sdf_regex/ ){ + my $leftpart = defined $2 ? $2 : ''; + my $lang = defined $12 ? $12 : ''; + my $rightpart = defined $13 ? $13 : ''; + my $timestamp = defined $18 ? $18 : ''; + + my $prj = defined $3 ? $3 : ''; + my $file = defined $4 ? $4 : ''; + my $type = defined $6 ? $6 : ''; + my $gid = defined $7 ? $7 : ''; + my $lid = defined $8 ? $8 : ''; + #my $lang = defined $12 ? $12 : ''; + my $plattform = defined $10 ? $10 : ''; + my $helpid = defined $9 ? $9 : ''; + + + if( $use_default_date ) + { + $extract_date = "$default_date\n" ; + } + elsif( $extract_date eq "" ) { + $extract_date = $timestamp ; + $extract_date =~ tr/\r\n//d; + $extract_date .= "\n"; + } + + if( $bAll ){ print DESTFILE $leftpart."\t".$lang."\t".$rightpart.$extract_date ; } + else { + foreach my $sLang ( keys( %{ $langhash_ref } ) ){ + if( $sLang=~ /all/i ) { + push @{ $output{ $prj.$gid.$lid.$file.$type.$plattform.$helpid } } , $leftpart."\t".$lang."\t".$rightpart.$extract_date ; + #print DESTFILE $leftpart."\t".$lang."\t".$rightpart.$extract_date; + } + #if( $sLang eq "de" && $lang eq "de" ) { + # push @{ $output{ $prj.$gid.$lid.$file.$type.$plattform.$helpid } } , $leftpart."\t".$lang."\t".$rightpart.$extract_date ; + #print DESTFILE $leftpart."\t".$lang."\t".$rightpart.$extract_date; + #} + if( $sLang eq "en-US" && $lang eq "en-US" ) { + push @order , $prj.$gid.$lid.$file.$type.$plattform.$helpid; + if( !$bFakeEnglish ){ push @{ $output{ $prj.$gid.$lid.$file.$type.$plattform.$helpid } } , $leftpart."\t".$lang."\t".$rightpart.$extract_date ; } + #print DESTFILE $leftpart."\t".$lang."\t".$rightpart.$extract_date; + } + + } + } + } + } + # Insert particles + while ( ){ + if( /$sdf_regex/ ){ + my $leftpart = defined $2 ? $2 : ''; + my $prj = defined $3 ? $3 : ''; + my $lang = defined $12 ? $12 : ''; + my $rightpart = defined $13 ? $13 : ''; + my $timestamp = defined $18 ? $18 : ''; + + #my $prj = defined $3 ? $3 : ''; + my $file = defined $4 ? $4 : ''; + my $type = defined $6 ? $6 : ''; + my $gid = defined $7 ? $7 : ''; + my $lid = defined $8 ? $8 : ''; + #my $lang = defined $12 ? $12 : ''; + my $plattform = defined $10 ? $10 : ''; + my $helpid = defined $9 ? $9 : ''; + + + if( $use_default_date ) + { + $extract_date = "$default_date\n" ; + } + elsif( $extract_date eq "" ) + { + $extract_date = $timestamp; + } + + if( ! ( $prj =~ /binfilter/i ) ) { + push @{ $output{ $prj.$gid.$lid.$file.$type.$plattform.$helpid } } , $leftpart."\t".$lang."\t".$rightpart.$extract_date ; + #print DESTFILE $leftpart."\t".$lang."\t".$rightpart.$extract_date ; + } + } + } + + # Write! + foreach my $curkey ( @order ){ + foreach my $curlist ( $output{ $curkey } ){ + foreach my $line ( @{$curlist} ){ + print DESTFILE $line; + } + } + } + + }else { print STDERR "Can't open $outputfile";} + } + close DESTFILE; + close LOCALIZEPARTICLE; + close ALLPARTICLES_MERGED; + + #print STDOUT "DBG: \$localizeSDF $localizeSDF \$particleSDF_merged $particleSDF_merged\n"; + unlink $localizeSDF , $particleSDF_merged , $my_localize_log; + + #sort_outfile( $outputfile ); + #remove_obsolete( $outputfile ) , if $bHasSourceLanguage ne ""; + } + +######################################################### +sub remove_obsolete{ + my $outfile = shift; + my @lines; + my $enusleftpart; + my @good_lines; + + print STDOUT "### Removing obsolete strings\n"; + + # Kick out all strings without en-US reference + if ( open ( SORTEDFILE , "< $outfile" ) ){ + while( ){ + if( /$sdf_regex/ ){ + my $line = defined $_ ? $_ : ''; + my $language = defined $12 ? $12 : ''; + my $prj = defined $3 ? $3 : ''; + my $file = defined $4 ? $4 : ''; + my $type = defined $6 ? $6 : ''; + my $gid = defined $7 ? $7 : ''; + my $lid = defined $8 ? $8 : ''; + my $plattform = defined $10 ? $10 : ''; + my $helpid = defined $9 ? $9 : ''; + + my $leftpart = $prj.$gid.$lid.$file.$type.$plattform.$helpid; + + if( $language eq "en-US" ){ # source string found, 1. entry + $enusleftpart = $leftpart; + push @good_lines , $line; + }else{ + if( !defined $enusleftpart or !defined $leftpart ){ + print STDERR "BADLINE: $line\n"; + print STDERR "\$enusleftpart = $enusleftpart\n"; + print STDERR "\$leftpart = $leftpart\n"; + } + if( $enusleftpart eq $leftpart ){ # matching language + push @good_lines , $line; + } + #else{ + # print STDERR "OUT: \$enusleftpart=$enusleftpart \$leftpart=$leftpart \$line=$line\n"; + #} + } + } + } + close SORTEDFILE; + } else { print STDERR "ERROR: Can't open file $outfile\n";} + + # Write file + if ( open ( SORTEDFILE , "> $outfile" ) ){ + foreach my $newline ( @good_lines ) { + print SORTEDFILE $newline; + } + close SORTEDFILE; + } else { print STDERR "ERROR: Can't open file $outfile\n";} + +} +######################################################### +sub sort_outfile{ + my $outfile = shift; + print STDOUT "### Sorting ... $outfile ..."; + my @lines; + my @sorted_lines; + + + #if ( open ( SORTEDFILE , "< $outputfile" ) ){ + if ( open ( SORTEDFILE , "< $outfile" ) ){ + my $line; + while ( ){ + $line = $_; + if( $line =~ /^[^\#]/ ){ + push @lines , $line; + } + } + close SORTEDFILE; + @sorted_lines = sort { + my $xa_lang = ""; + my $xa_left_part = ""; + my $xa_right_part = ""; + my $xa_timestamp = ""; + my $xb_lang = ""; + my $xb_left_part = ""; + my $xb_right_part = ""; + my $xb_timestamp = ""; + my $xa = ""; + my $xb = ""; + my @alist; + my @blist; + + if( $a=~ /$sdf_regex/ ){ + $xa_left_part = defined $2 ? $2 : ''; + $xa_lang = defined $12 ? $12 : ''; + $xa_right_part = defined $13 ? $13 : ''; + $xa_left_part = remove_last_column( $xa_left_part ); + + } + if( $b=~ /$sdf_regex/ ){ + $xb_left_part = defined $2 ? $2 : ''; + $xb_lang = defined $12 ? $12 : ''; + $xb_right_part = defined $13 ? $13 : ''; + $xb_left_part = remove_last_column( $xb_left_part ); + + + } + if( ( $xa_left_part cmp $xb_left_part ) == 0 ){ # Left part equal + if( ( $xa_lang cmp $xb_lang ) == 0 ){ # Lang equal + return ( $xa_right_part cmp $xb_right_part ); # Right part compare + } + elsif( $xa_lang eq "en-US" ) { return -1; } # en-US wins + elsif( $xb_lang eq "en-US" ) { return 1; } # en-US wins + else { return $xa_lang cmp $xb_lang; } # lang compare + } + else { + return $xa_left_part cmp $xb_left_part; # Left part compare + } + } @lines; + + if ( open ( SORTEDFILE , "> $outfile" ) ){ + print SORTEDFILE get_license_header(); + foreach my $newline ( @sorted_lines ) { + print SORTEDFILE $newline; + #print STDOUT $newline; + } + } + close SORTEDFILE; + } else { print STDERR "WARNING: Can't open file $outfile\n";} + print "done\n"; + +} +######################################################### +sub remove_last_column{ + my $string = shift; + my @alist = split ( "\t" , $string ); + pop @alist; + return join( "\t" , @alist ); +} + +######################################################### +sub rename_language{ + my $fallbackhashhash_ref = shift; + my $cur_fallback = shift; + my $cur_lang = shift; + my $line; + + foreach my $key( keys ( %{ $fallbackhashhash_ref->{ $cur_fallback } } ) ){ + $line = $fallbackhashhash_ref->{ $cur_fallback }{ $key }; + if( $line =~ /$sdf_regex/ ){ + my $leftpart = defined $2 ? $2 : ''; + my $lang = defined $12 ? $12 : ''; + my $rightpart = defined $13 ? $13 : ''; + + $fallbackhashhash_ref->{ $cur_lang }{ $key } = $leftpart."\t".$cur_lang."\t".$rightpart; + } + } +} + +############################################################ +sub remove_duplicates{ + my $list_ref = shift; + my %tmphash; + foreach my $key ( @{ $list_ref } ){ $tmphash{ $key } = '' ; } + @{$list_ref} = keys( %tmphash ); +} + +############################################################## +sub fetch_fallback{ + my $sdfparticleslist_ref = shift; + my $localizeSDF = shift; + my $langhash_ref = shift; + my %fallbackhashhash; + my $cur_lang; + my @langlist; + + foreach my $key ( keys ( %{ $langhash_ref } ) ){ + $cur_lang = $langhash_ref->{ $key }; + if ( $cur_lang ne "" ) { + push @langlist , $cur_lang; + } + } + remove_duplicates( \@langlist ); + foreach $cur_lang ( @langlist ){ + if( $cur_lang eq "en-US" ){ + read_fallbacks_from_source( $localizeSDF , $cur_lang , \%fallbackhashhash ); + } + } + + # remove de / en-US + my @tmplist; + foreach $cur_lang( @langlist ){ + if( $cur_lang ne "en-US" ){ + push @tmplist , $cur_lang; + + } + } + @langlist = @tmplist; + if ( $#langlist +1 ){ + read_fallbacks_from_particles( $sdfparticleslist_ref , \@langlist , \%fallbackhashhash ); + + } + return (\%fallbackhashhash); +} + +######################################################### +sub write_file{ + + my $localizeFile = shift; + my $index_ref = shift; + + if( open DESTFILE , "+> $localizeFile" ){ + foreach my $key( %{ $index_ref } ){ + print DESTFILE ($index_ref->{ $key }, "\n" ); + } + close DESTFILE; + }else { + print STDERR "Can't open/create '$localizeFile'"; + } +} + +######################################################### +sub read_file{ + + my $sdffile = shift; + my $langhash_ref = shift; + my %block = (); + + open MYFILE , "< $sdffile" + or die "Can't open '$sdffile'\n"; + while( ){ + if( /$sdf_regex/ ){ + my $line = defined $_ ? $_ : ''; + my $prj = defined $3 ? $3 : ''; + my $file = defined $4 ? $4 : ''; + my $type = defined $6 ? $6 : ''; + my $gid = defined $7 ? $7 : ''; + my $lid = defined $8 ? $8 : ''; + my $plattform = defined $10 ? $10 : ''; + my $lang = defined $12 ? $12 : ''; + my $helpid = defined $9 ? $9 : ''; + + foreach my $isolang ( keys ( %{ $langhash_ref } ) ){ + if( $isolang=~ /$lang/i || $isolang=~ /all/i ) { $block{$prj.$gid.$lid.$file.$type.$plattform.$helpid } = $line ; } + } + } + } + return (\%block); +} + +######################################################### +sub read_fallbacks_from_particles{ + + my $sdfparticleslist_ref = shift; + my $isolanglist_ref = shift; + my $fallbackhashhash_ref = shift; + my $block_ref; + foreach my $currentfile ( @{ $sdfparticleslist_ref } ){ + if ( open MYFILE , "< $currentfile" ) { + while(){ + if( /$sdf_regex/ ){ + my $line = defined $_ ? $_ : ''; + my $prj = defined $3 ? $3 : ''; + my $file = defined $4 ? $4 : ''; + my $type = defined $6 ? $6 : ''; + my $gid = defined $7 ? $7 : ''; + my $lid = defined $8 ? $8 : ''; + my $lang = defined $12 ? $12 : ''; + my $plattform = defined $10 ? $10 : ''; + my $helpid = defined $9 ? $9 : ''; + + chomp( $line ); + + foreach my $isolang ( @{$isolanglist_ref} ){ + if( $isolang=~ /$lang/i ) { + $fallbackhashhash_ref->{ $isolang }{ $prj.$gid.$lid.$file.$type.$plattform.$helpid } = $line ; + } + } + } + } + }else { print STDERR "WARNING: Can't open file $currentfile"; } + } +} + +######################################################### +sub read_fallbacks_from_source{ + + my $sdffile = shift; + my $isolang = shift; + my $fallbackhashhash_ref = shift; + my $block_ref; + # read fallback for single file + open MYFILE , "< $sdffile" + or die "Can't open '$sdffile'\n"; + + while( ){ + if( /$sdf_regex/ ){ + my $line = defined $_ ? $_ : ''; + my $prj = defined $3 ? $3 : ''; + my $file = defined $4 ? $4 : ''; + my $type = defined $6 ? $6 : ''; + my $gid = defined $7 ? $7 : ''; + my $lid = defined $8 ? $8 : ''; + my $helpid = defined $9 ? $9 : ''; + my $lang = defined $12 ? $12 : ''; + my $plattform = defined $10 ? $10 : ''; + + chomp( $line ); + if( $isolang=~ /$lang/i ) { $fallbackhashhash_ref->{ $isolang }{ $prj.$gid.$lid.$file.$type.$plattform.$helpid } = $line ; + } + } + } +} + +######################################################### +sub parseLanguages{ + + my $bAll; + my $bUseLocalize; + my $bHasSourceLanguage=""; + my $bFakeEnglish=""; + my %langhash; + my $iso=""; + my $fallback=""; + + #### -l all + if( $languages=~ /all/ ){ + $bAll = "TRUE"; + $bHasSourceLanguage = "TRUE"; + } + ### -l fr=de,de + elsif( $languages=~ /.*,.*/ ){ + my @tmpstr = split "," , $languages; + for my $lang ( @tmpstr ){ + if( $lang=~ /([a-zA-Z]{2,3}(-[a-zA-Z\-]*)*)(=([a-zA-Z]{2,3}(-[a-zA-Z\-]*)*))?/ ){ + $iso = $1; + $fallback = $4; + + if( ( $iso && $iso=~ /(en-US)/i ) || ( $fallback && $fallback=~ /(en-US)/i ) ) { + $bUseLocalize = "TRUE"; + } + if( ( $iso && $iso=~ /(en-US)/i ) ) { + $bHasSourceLanguage = "TRUE"; + } + if( $fallback ) { $langhash{ $iso } = $fallback; } + else { $langhash{ $iso } = ""; } + } + } + } + ### -l de + else{ + if( $languages=~ /([a-zA-Z]{2,3}(-[a-zA-Z\-]*)*)(=([a-zA-Z]{2,3}(-[a-zA-Z\-]*)*))?/ ){ + $iso = $1; + $fallback = $4; + + if( ( $iso && $iso=~ /(en-US)/i ) || ( $fallback && $fallback=~ /(en-US)/i ) ) { + $bUseLocalize = "TRUE"; + + } + if( ( $iso && $iso=~ /(en-US)/i ) ) { + $bHasSourceLanguage = "TRUE"; + } + + if( $fallback ) { $langhash{ $iso } = $fallback; } + else { $langhash{ $iso } = ""; } + } + } + # HACK en-US always needed! + if( !$bHasSourceLanguage ){ + #$bHasSourceLanguage = "TRUE"; + $bUseLocalize = "TRUE"; + $bFakeEnglish = "TRUE"; + $langhash{ "en-US" } = ""; + } + return ( $bAll , $bUseLocalize , \%langhash , $bHasSourceLanguage, $bFakeEnglish); +} + +######################################################### +sub parse_options{ + + my $help; + my $merge; + my $extract; + my $success = GetOptions('f=s' => \$sdffile , 'l=s' => \$languages , 's=s' => \$srcpath , 'h' => \$help , 'v' => \$bVerbose , + 'm' => \$merge , 'e' => \$extract , 'x' => \$no_sort , 'd' => \$use_default_date , 'c' => \$create_dirs , + 'n' => \$no_gsicheck , 'o' => \$force_ooo_module ); + $outputfile = $sdffile; + + #print STDOUT "DBG: lang = $languages\n"; + if( !$srcpath ){ + $srcpath = "$ENV{SRC_ROOT}"; + if( !$srcpath ){ + print STDERR "No path to the source root found!\n\n"; + usage(); + exit(1); + } + } + if( $help ){ + usage(); + exit(0); + } + if( !$success || $#ARGV > 1 || ( !$sdffile ) ){ + usage(); + exit(1); + } + if( $merge && $sdffile && ! ( -r $sdffile)){ + print STDERR "Can't open file '$sdffile'\n"; + exit(1); + } + if( !( $languages=~ /[a-zA-Z]{2,3}(-[a-zA-Z\-]*)*(=[a-zA-Z]{2,3}(-[a-zA-Z\-]*)*)?(,[a-zA-Z]{2,3}(-[a-zA-Z\-]*)*(=[a-zA-Z]{2,3}(-[a-zA-Z\-]*)*)?)*/ ) ){ + print STDERR "Please check the -l iso code\n"; + exit(1); + } + if( ( !$merge && !$extract ) || ( $merge && $extract ) ){ usage();exit( -1 );} + if( $extract ){ $mode = "extract"; } + else { $mode = "merge"; } +} +#my $multi_localize_files = ''; h +#my $module_to_merge = ''; i +#my $sort_sdf_before = ''; g + +######################################################### +sub usage{ + + print STDERR "Usage: localize.pl\n"; + print STDERR "Split or collect SDF files\n"; + print STDERR " merge: -m -f -l l1[=f1][,l2[=f2]][...] [ -s ] [ -c ]\n"; + print STDERR " extract: -e -f -l [ -s ] [-d]\n"; + print STDERR "Options:\n"; + print STDERR " -h help\n"; + print STDERR " -m Merge mode\n"; + print STDERR " -e Extract mode\n"; + print STDERR " -f To split a big SDF file into particles\n"; + print STDERR " To collect and join all particles to one big file\n"; + print STDERR " -s Path to the modules, if no \$SRC_ROOT is set\n"; + print STDERR " -l ( all | | =fallback ) comma seperated languages\n"; + print STDERR " -d Use default date in extracted sdf file\n"; + print STDERR " -c Create needed directories\n"; + print STDERR " -g Sort sdf file before mergeing\n"; + print STDERR " -h File with localize.sdf's\n!"; + print STDERR " -n No gsicheck\n"; + print STDERR " -i Module to merge\n"; + print STDERR " -o force using ooo localization from the l10n module instead of l10n_so; \n"; + print STDERR " useful if the type can't be detected by the .svn tags; \n"; + print STDERR " -v Verbose\n"; + print STDERR "\nExample:\n"; + print STDERR "\nlocalize -e -l en-US,pt-BR=en-US -f my.sdf\n( Extract en-US and pt-BR with en-US fallback )\n"; + print STDERR "\nlocalize -m -l cs -f my.sdf\n( Merge cs translation into the sourcecode ) \n"; +} + +# my $line = defined $_ ? $_ : ''; +# my $leftpart = defined $2 ? $2 : ''; +# my $prj = defined $3 ? $3 : ''; +# my $file = defined $4 ? $4 : ''; +# my $dummy = defined $5 ? $5 : ''; +# my $type = defined $6 ? $6 : ''; +# my $gid = defined $7 ? $7 : ''; +# my $lid = defined $8 ? $8 : ''; +# my $helpid = defined $9 ? $9 : ''; +# my $plattform = defined $10 ? $10 : ''; +# my $width = defined $11 ? $11 : ''; +# my $lang = defined $12 ? $12 : ''; +# my $rightpart = defined $13 ? $13 : ''; +# my $text = defined $14 ? $14 : ''; +# my $helptext = defined $15 ? $15 : ''; +# my $quickhelptext = defined $16 ? $16 : ''; +# my $title = defined $17 ? $17 : ''; +# my $timestamp = defined $18 ? $18 : ''; + diff --git a/l10ntools/scripts/localize_old.pl b/l10ntools/scripts/localize_old.pl new file mode 100755 index 000000000000..151399d22002 --- /dev/null +++ b/l10ntools/scripts/localize_old.pl @@ -0,0 +1,1130 @@ +: +eval 'exec perl -wS $0 ${1+"$@"}' + if 0; + + +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2008 by Sun Microsystems, Inc. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# $RCSfile: localize.pl,v $ +# +# $Revision: 1.18 $ +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +use strict; +use Getopt::Long; +use IO::Handle; +use File::Find; +use File::Temp; +use File::Copy; +use File::Glob qw(:glob csh_glob); +use Cwd; + +# ver 1.1 +# +#### module lookup +#use lib ("$ENV{SOLARENV}/bin/modules", "$ENV{COMMON_ENV_TOOLS}/modules"); + +#### module lookup +# OOo conform +my @lib_dirs; +BEGIN { + if ( !defined($ENV{SOLARENV}) ) { + die "No environment found (environment variable SOLARENV is undefined)"; + } + push(@lib_dirs, "$ENV{SOLARENV}/bin/modules"); + push(@lib_dirs, "$ENV{COMMON_ENV_TOOLS}/modules") if defined($ENV{COMMON_ENV_TOOLS}); +} +use lib (@lib_dirs); + +#### globals #### +my $sdffile = ''; +my $no_sort = ''; +my $outputfile = ''; +my $mode = ''; +my $bVerbose="0"; +my $srcpath = ''; +my $WIN; +my $languages; +#my %sl_modules; # Contains all modules where en-US and de is source language +my $use_default_date = '0'; + + # ( leftpart ) ( rightpart ) + # prj file dummy type gid lid helpid pform width lang text helptext qhelptext title timestamp +my $sdf_regex = "((([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*))\t([^\t]*)\t(([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t)([^\t]*))"; +my $file_types = "(src|hrc|xcs|xcu|lng|ulf|xrm|xhp|xcd|xgf|xxl|xrb)"; +# Always use this date to prevent cvs conflicts +my $default_date = "2002-02-02 02:02:02"; + +#### main #### +parse_options(); + +if ( defined $ENV{USE_SHELL} && $ENV{USE_SHELL} eq '4nt' ) { + $WIN = 'TRUE'; +} + else { + $WIN = ''; +} + +#%sl_modules = fetch_sourcelanguage_dirlist(); + + +if ( $mode eq "merge" ) { + merge_gsicheck(); + splitfile( $sdffile ); + unlink $sdffile; # remove temp file! +} +elsif( $mode eq "extract" ) { + collectfiles( $outputfile ); +} +else { + usage(); +} + +exit(0); + +######################################################### +sub splitfile{ + + my $lastFile = ''; + my $currentFile = ''; + my $cur_sdffile = ''; + my $last_sdffile = ''; + my $delim; + my $badDelim; + my $start = 'TRUE'; + my %index = (); + my %block; + + STDOUT->autoflush( 1 ); + + #print STDOUT "Open File $sdffile\n"; + open MYFILE , "< $sdffile" + or die "Can't open '$sdffile'\n"; + + while( ){ + if( /$sdf_regex/ ){ + my $line = defined $_ ? $_ : ''; + my $prj = defined $3 ? $3 : ''; + my $file = defined $4 ? $4 : ''; + my $type = defined $6 ? $6 : ''; + my $gid = defined $7 ? $7 : ''; + my $lid = defined $8 ? $8 : ''; + my $lang = defined $12 ? $12 : ''; + my $plattform = defined $10 ? $10 : ''; + my $helpid = defined $9 ? $9 : ''; + + next if( $prj eq "binfilter" ); # Don't merge strings into binfilter module + chomp( $line ); + $currentFile = $srcpath . '\\' . $prj . '\\' . $file; + if ( $WIN ) { $currentFile =~ s/\//\\/g; } + else { $currentFile =~ s/\\/\//g; } + + $cur_sdffile = $currentFile; + #if( $cur_sdffile =~ /\.$file_types[\s]*$/ ){ + if( $WIN ) { $cur_sdffile =~ s/\\[^\\]*\.$file_types[\s]*$/\\localize.sdf/; } + else { $cur_sdffile =~ s/\/[^\/]*\.$file_types[\s]*$/\/localize.sdf/; } + #} + + # Set default date + if( $line =~ /(.*)\t[^\t\$]*$/ ){ + $line = $1."\t".$default_date; + } + + if( $start ){ + $start=''; + $lastFile = $currentFile; # ? + $last_sdffile = $cur_sdffile; + } + + if( $lang eq "en-US" ){} + elsif( $cur_sdffile eq $last_sdffile ) + { + $block{ "$prj\t$file\t$type\t$gid\t$lid\t$helpid\t$plattform\t$lang" } = $line ; + } + else + { + writesdf( $lastFile , \%block ); + $lastFile = $currentFile; #? + $last_sdffile = $cur_sdffile; + %block = (); + #if( ! $lang eq "en-US" ) { + $block{ "$prj\t$file\t$type\t$gid\t$lid\t$helpid\t$plattform\t$lang" } = $line ; + #} + + } + } #else { print STDOUT "splitfile REGEX kaputt\n";} + + } + writesdf( $lastFile , \%block ); + %block = (); + close( MYFILE ); + +} +######################################################### + +#sub fetch_sourcelanguage_dirlist +#{ +# +# my $working_path = getcwd(); +# my %sl_dirlist; +# +# chdir $srcpath; +# my @all_dirs = csh_glob( "*" ); +# +# foreach my $file ( @all_dirs ) +# { +# if( -d $file ) +# { +# my $module = $file; +# $file .= "/prj/l10n"; +# $file =~ s/\//\\/ , if( $WIN ) ; +# +# if( -f $file ) # Test file /prj/l10n +# { +# $sl_dirlist{ $module } = 1; +# if( $bVerbose eq "1" ) { print STDOUT "$module: de and en-US source language detected\n"; } +# } +# } +# } +# +# chdir $working_path; +# +# return %sl_dirlist; +#} + +#sub has_two_sourcelanguages +#{ +# my $module = shift; +# return defined $sl_modules{ $module } ; +#} +sub writesdf{ + + my $lastFile = shift; + my $blockhash_ref = shift; + my $localizeFile = $lastFile; + my %index=(); + + if( $localizeFile =~ /\.$file_types[\s]*$/ ){ + if( $WIN ) { $localizeFile =~ s/\\[^\\]*\.$file_types[\s]*$/\\localize.sdf/; } + else { $localizeFile =~ s/\/[^\/]*\.$file_types[\s]*$/\/localize.sdf/; } + }else { + print STDERR "Strange filetype found '$localizeFile'\n"; + return; + } + if( open DESTFILE , "< $localizeFile" ){ + + #or die "Can't open/create '\$localizeFile'"; + + #### Build hash + while(){ + if( /$sdf_regex/ ){ + my $line = defined $_ ? $_ : ''; + my $prj = defined $3 ? $3 : ''; + my $file = defined $4 ? $4 : ''; + my $type = defined $6 ? $6 : ''; + my $gid = defined $7 ? $7 : ''; + my $lid = defined $8 ? $8 : ''; + my $lang = defined $12 ? $12 : ''; + my $plattform = defined $10 ? $10 : ''; + my $helpid = defined $9 ? $9 : ''; + + chomp( $line ); + $index{ "$prj\t$file\t$type\t$gid\t$lid\t$helpid\t$plattform\t$lang" } = $line ; + + } #else { print STDOUT "writesdf REGEX kaputt $_\n";} + + } + close( DESTFILE ); + } + #### Copy new strings + my @mykeys = keys( %{ $blockhash_ref } ); + my $isDirty = "FALSE"; + foreach my $key( @mykeys ){ + if( ! defined $index{ $key } ){ + # Add new entry + $index{ $key } = $blockhash_ref->{ $key} ; + $isDirty = "TRUE"; + }elsif( $index{ $key } ne $blockhash_ref->{ $key } ){ + # Overwrite old entry + $index{ $key } = $blockhash_ref->{ $key }; + $isDirty = "TRUE"; + }else { + } + } + + #### Write file + + if( !$bVerbose ){ print STDOUT "."; } + if( $isDirty eq "TRUE" ){ + if( $bVerbose ){ print STDOUT "$localizeFile\n"; } + if( open DESTFILE , "+> $localizeFile" ){ + print DESTFILE get_license_header(); + @mykeys = sort keys( %index ); + foreach my $key( @mykeys ){ + print DESTFILE ( $index{ $key } , "\n" ); + } + close DESTFILE; + }else { + print STDOUT "WARNING: File $localizeFile is not writable , try to merge ...\n"; + my ( $TMPFILE , $tmpfile ) = File::Temp::tempfile(); + if( open DESTFILE , "+> $tmpfile " ){ + @mykeys = keys( %index ); + foreach my $key( @mykeys ){ + print DESTFILE ( $index{ $key } , "\n" ); + } + close DESTFILE; + if( move( $localizeFile , $localizeFile.".backup" ) ){ + if( copy( $tmpfile , $localizeFile ) ){ + unlink $localizeFile.".backup"; + } else { print STDERR "Can't open/create '$localizeFile', original file is renamed to $localizeFile.backup\n"; } + } else { print STDERR "Can't open/create '$localizeFile'\n"; } + }else{ + print STDERR "WARNING: Can't open/create '$localizeFile'\n"; + } + unlink $tmpfile; + } + } +# if( $no_sort eq '' ){ +# sort_outfile( $localizeFile ); +# } +} + +sub get_license_header{ + return +"#\n". +"# #### ### # # ### ##### ##### #### ##### ##### \n". +"# # # # # ## # # # # # # # # # \n". +"# # # # # # # # # # # ### # # # # \n". +"# # # # # # ## # # # # # # # # \n". +"# #### ### # # ### # ##### #### ##### # \n". +"#\n". +"# DO NOT EDIT! This file will be overwritten by localisation process\n". +"#\n". +"#*************************************************************************\n". +"#\n". +"# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n". +"# \n". +"# Copyright 2008 by Sun Microsystems, Inc.\n". +"#\n". +"# OpenOffice.org - a multi-platform office productivity suite\n". +"#\n". +"# \$RCSfile:". +"localize.pl,v \$\n". +"#\n". +"# \$Revision: ". +"1.17.4.1 \$\n". +"#\n". +"# This file is part of OpenOffice.org.\n". +"#\n". +"# OpenOffice.org is free software: you can redistribute it and/or modify\n". +"# it under the terms of the GNU Lesser General Public License version 3\n". +"# only, as published by the Free Software Foundation.\n". +"#\n". +"# OpenOffice.org is distributed in the hope that it will be useful,\n". +"# but WITHOUT ANY WARRANTY; without even the implied warranty of\n". +"# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n". +"# GNU Lesser General Public License version 3 for more details\n". +"# (a copy is included in the LICENSE file that accompanied this code).\n". +"#\n". +"# You should have received a copy of the GNU Lesser General Public License\n". +"# version 3 along with OpenOffice.org. If not, see\n". +"# \n". +"# for a copy of the LGPLv3 License.\n". +"#\n". +"#*************************************************************************\n"; +} +######## Check input sdf file and use only the correct part +sub merge_gsicheck{ + my $command = ''; + my ( $TMPHANDLE , $tmpfile ) = File::Temp::tempfile(); + my ( $TMPHANDLE2 , $tmpfile2 ) = File::Temp::tempfile(); + close ( $TMPHANDLE ); + close ( $TMPHANDLE2 ); + + unlink $tmpfile2; + my $output2 = `cat $sdffile | sort > $tmpfile2`; + my $rc2 = $? << 8; + if( $rc2 ne 0 ){ + printf("ERROR: Failed -> cat $sdffile | sort > $tmpfile2\n$output2\n"); + exit( -1 ); + } + +# if( $ENV{WRAPCMD} ){ +# $command = "$ENV{WRAPCMD} gsicheck"; +# }else{ +# $command = "gsicheck"; +# } +# my $errfile = $tmpfile.".err"; +# $command .= " -k -c -wcf $tmpfile -wef $errfile -l \"\" $tmpfile2"; +# my $output = `$command`; +# my $rc = $? << 8; +# if ( $output ne "" ){ +# print STDOUT "### gsicheck ###\n"; +# print STDOUT "### The file $errfile have been written containing the errors in your sdf file. Those lines will not be merged: ###\n\n"; +# print STDOUT "$output\n"; +# print STDOUT "################\n"; +# +# }else{ +# # Remove the 0 Byte file +# unlink $errfile; +# } + $sdffile = $tmpfile2; +# unlink $tmpfile2; +} +######################################################### +sub collectfiles{ + print STDOUT "### Localize\n"; + my @sdfparticles; + my $localizehash_ref; + my ( $bAll , $bUseLocalize, $langhash_ref , $bHasSourceLanguage , $bFakeEnglish ) = parseLanguages(); + + # Enable autoflush on STDOUT + # $| = 1; + STDOUT->autoflush( 1 ); + + ### Search sdf particles + print STDOUT "### Searching sdf particles\n"; + my $working_path = getcwd(); + chdir $srcpath; + find sub { + my $file = $File::Find::name; + if( -f && $file =~ /.*localize.sdf$/ ) { + push @sdfparticles , $file; + if( $bVerbose eq "1" ) { print STDOUT "$file\n"; } + else { print "."; } + + } + } , getcwd() ;#"."; #$srcpath; + chdir $working_path; + + my $nFound = $#sdfparticles +1; + print "\n $nFound files found !\n"; + + my ( $LOCALIZEPARTICLE , $localizeSDF ) = File::Temp::tempfile(); + close( $LOCALIZEPARTICLE ); + + my ( $ALLPARTICLES_MERGED , $particleSDF_merged ) = File::Temp::tempfile(); + close( $ALLPARTICLES_MERGED ); + my ( $LOCALIZE_LOG , $my_localize_log ) = File::Temp::tempfile(); + close( $LOCALIZE_LOG ); + + ## Get the localize de,en-US extract + if( $bAll || $bUseLocalize ){ + print "### Fetching source language strings\n"; + my $command = ""; + my $args = ""; + + if( $ENV{WRAPCMD} ){ + $command = "$ENV{WRAPCMD} localize_sl"; + }else{ + $command = "localize_sl"; + } + + # -e + # if ( -x $command ){ + if( $command ){ + if( !$bVerbose ){ $args .= " -QQ -skip_links "; } + $args .= " -e -f $localizeSDF -l "; + my $bFlag=""; + if( $bAll ) {$args .= " en-US";} + else{ + my @list; + foreach my $isokey ( keys( %{ $langhash_ref } ) ){ + push @list , $isokey; + if( $langhash_ref->{ $isokey } ne "" ){ + push @list , $langhash_ref->{ $isokey }; + } + } + remove_duplicates( \@list ); + foreach my $isokey ( @list ){ + switch :{ + #( $isokey=~ /^de$/i ) + # && do{ + # if( $bFlag eq "TRUE" ){ $args .= ",de"; } + # else { + # $args .= "de"; $bFlag = "TRUE"; + # } + # }; + ( $isokey=~ /^en-US$/i ) + && do{ + if( $bFlag eq "TRUE" ){ $args .= ",en-US"; } + else { + $args .= "en-US"; $bFlag = "TRUE"; + } + }; + + } #switch + } #foreach + } # if + } # if +# if ( !$bVerbose ){ +# if ( $WIN eq "TRUE" ) { $args .= " > $my_localize_log"; } +# else { $args .= " >& $my_localize_log"; } +# } + if ( $bVerbose ) { print STDOUT $command.$args."\n"; } + + my $rc = system( $command.$args ); + + #my $output = `$command.$args`; + #my $rc = $? << 8; + + if( $rc < 0 ){ print STDERR "ERROR: localize rc = $rc\n"; exit( -1 ); } + ( $localizehash_ref ) = read_file( $localizeSDF , $langhash_ref ); + + } + ## Get sdf particles + open ALLPARTICLES_MERGED , "+>> $particleSDF_merged" + or die "Can't open $particleSDF_merged"; + + ## Fill fackback hash + my( $fallbackhashhash_ref ) = fetch_fallback( \@sdfparticles , $localizeSDF , $langhash_ref ); +# my( $fallbackhashhash_ref ) = fetch_fallback( \@sdfparticles , $localizeSDF , $langhash_ref ); + my %block; + my $cur_fallback; + if( !$bAll) { + foreach my $cur_lang ( keys( %{ $langhash_ref } ) ){ + #print STDOUT "DBG: G1 cur_lang=$cur_lang\n"; + $cur_fallback = $langhash_ref->{ $cur_lang }; + if( $cur_fallback ne "" ){ + # Insert fallback strings + #print STDOUT "DBG: Renaming $cur_fallback to $cur_lang in fallbackhash\n"; + rename_language( $fallbackhashhash_ref , $cur_fallback , $cur_lang ); + } + foreach my $currentfile ( @sdfparticles ){ + if ( open MYFILE , "< $currentfile" ) { + while(){ + if( /$sdf_regex/ ){ + my $line = defined $_ ? $_ : ''; + my $prj = defined $3 ? $3 : ''; + my $file = defined $4 ? $4 : ''; + my $type = defined $6 ? $6 : ''; + my $gid = defined $7 ? $7 : ''; + my $lid = defined $8 ? $8 : ''; + my $lang = defined $12 ? $12 : ''; + my $plattform = defined $10 ? $10 : ''; + my $helpid = defined $9 ? $9 : ''; + + chomp( $line ); + + if ( $lang eq $cur_lang ){ + # Overwrite fallback strings with collected strings + #if( ( !has_two_sourcelanguages( $cur_lang) && $cur_lang eq "de" ) || $cur_lang ne "en-US" ){ + $fallbackhashhash_ref->{ $cur_lang }{ $prj.$gid.$lid.$file.$type.$plattform.$helpid } = $line ; + #} + + } + } + } + }else { print STDERR "WARNING: Can't open file $currentfile"; } + } + + foreach my $line ( keys( %{$fallbackhashhash_ref->{ $cur_lang } } )) { + if( #$cur_lang ne "de" && + $cur_lang ne "en-US" ){ + print ALLPARTICLES_MERGED ( $fallbackhashhash_ref->{ $cur_lang }{ $line }, "\n" ); + } + } + } + } else { + foreach my $currentfile ( @sdfparticles ){ + if ( open MYFILE , "< $currentfile" ) { + while( ){ + print ALLPARTICLES_MERGED ( $_, "\n" ); # recheck de / en-US ! + } + } + else { print STDERR "WARNING: Can't open file $currentfile"; } + } + } + close ALLPARTICLES_MERGED; + + + # Hash of array + my %output; + my @order; + + ## Join both + if( $outputfile ){ + if( open DESTFILE , "+> $outputfile" ){ + if( !open LOCALIZEPARTICLE , "< $localizeSDF" ) { print STDERR "ERROR: Can't open file $localizeSDF\n"; } + if( !open ALLPARTICLES_MERGED , "< $particleSDF_merged" ) { print STDERR "ERROR: Can't open file $particleSDF_merged\n"; } + + # Insert localize + my $extract_date=""; + while ( ){ + if( /$sdf_regex/ ){ + my $leftpart = defined $2 ? $2 : ''; + my $lang = defined $12 ? $12 : ''; + my $rightpart = defined $13 ? $13 : ''; + my $timestamp = defined $18 ? $18 : ''; + + my $prj = defined $3 ? $3 : ''; + my $file = defined $4 ? $4 : ''; + my $type = defined $6 ? $6 : ''; + my $gid = defined $7 ? $7 : ''; + my $lid = defined $8 ? $8 : ''; + #my $lang = defined $12 ? $12 : ''; + my $plattform = defined $10 ? $10 : ''; + my $helpid = defined $9 ? $9 : ''; + + + if( $use_default_date ) + { + $extract_date = "$default_date\n" ; + } + elsif( $extract_date eq "" ) { + $extract_date = $timestamp ; + $extract_date =~ tr/\r\n//d; + $extract_date .= "\n"; + } + + if( $bAll ){ print DESTFILE $leftpart."\t".$lang."\t".$rightpart.$extract_date ; } + else { + foreach my $sLang ( keys( %{ $langhash_ref } ) ){ + if( $sLang=~ /all/i ) { + push @{ $output{ $prj.$gid.$lid.$file.$type.$plattform.$helpid } } , $leftpart."\t".$lang."\t".$rightpart.$extract_date ; + #print DESTFILE $leftpart."\t".$lang."\t".$rightpart.$extract_date; + } + #if( $sLang eq "de" && $lang eq "de" ) { + # push @{ $output{ $prj.$gid.$lid.$file.$type.$plattform.$helpid } } , $leftpart."\t".$lang."\t".$rightpart.$extract_date ; + #print DESTFILE $leftpart."\t".$lang."\t".$rightpart.$extract_date; + #} + if( $sLang eq "en-US" && $lang eq "en-US" ) { + push @order , $prj.$gid.$lid.$file.$type.$plattform.$helpid; + if( !$bFakeEnglish ){ push @{ $output{ $prj.$gid.$lid.$file.$type.$plattform.$helpid } } , $leftpart."\t".$lang."\t".$rightpart.$extract_date ; } + #print DESTFILE $leftpart."\t".$lang."\t".$rightpart.$extract_date; + } + + } + } + } + } + # Insert particles + while ( ){ + if( /$sdf_regex/ ){ + my $leftpart = defined $2 ? $2 : ''; + my $prj = defined $3 ? $3 : ''; + my $lang = defined $12 ? $12 : ''; + my $rightpart = defined $13 ? $13 : ''; + my $timestamp = defined $18 ? $18 : ''; + + #my $prj = defined $3 ? $3 : ''; + my $file = defined $4 ? $4 : ''; + my $type = defined $6 ? $6 : ''; + my $gid = defined $7 ? $7 : ''; + my $lid = defined $8 ? $8 : ''; + #my $lang = defined $12 ? $12 : ''; + my $plattform = defined $10 ? $10 : ''; + my $helpid = defined $9 ? $9 : ''; + + + if( $use_default_date ) + { + $extract_date = "$default_date\n" ; + } + elsif( $extract_date eq "" ) + { + $extract_date = $timestamp; + } + + if( ! ( $prj =~ /binfilter/i ) ) { + push @{ $output{ $prj.$gid.$lid.$file.$type.$plattform.$helpid } } , $leftpart."\t".$lang."\t".$rightpart.$extract_date ; + #print DESTFILE $leftpart."\t".$lang."\t".$rightpart.$extract_date ; + } + } + } + + # Write! + foreach my $curkey ( @order ){ + foreach my $curlist ( $output{ $curkey } ){ + foreach my $line ( @{$curlist} ){ + print DESTFILE $line; + } + } + } + + }else { print STDERR "Can't open $outputfile";} + } + close DESTFILE; + close LOCALIZEPARTICLE; + close ALLPARTICLES_MERGED; + + #print STDOUT "DBG: \$localizeSDF $localizeSDF \$particleSDF_merged $particleSDF_merged\n"; + unlink $localizeSDF , $particleSDF_merged , $my_localize_log; + + #sort_outfile( $outputfile ); + #remove_obsolete( $outputfile ) , if $bHasSourceLanguage ne ""; + } + +######################################################### +sub remove_obsolete{ + my $outfile = shift; + my @lines; + my $enusleftpart; + my @good_lines; + + print STDOUT "### Removing obsolete strings\n"; + + # Kick out all strings without en-US reference + if ( open ( SORTEDFILE , "< $outfile" ) ){ + while( ){ + if( /$sdf_regex/ ){ + my $line = defined $_ ? $_ : ''; + my $language = defined $12 ? $12 : ''; + my $prj = defined $3 ? $3 : ''; + my $file = defined $4 ? $4 : ''; + my $type = defined $6 ? $6 : ''; + my $gid = defined $7 ? $7 : ''; + my $lid = defined $8 ? $8 : ''; + my $plattform = defined $10 ? $10 : ''; + my $helpid = defined $9 ? $9 : ''; + + my $leftpart = $prj.$gid.$lid.$file.$type.$plattform.$helpid; + + if( $language eq "en-US" ){ # source string found, 1. entry + $enusleftpart = $leftpart; + push @good_lines , $line; + }else{ + if( !defined $enusleftpart or !defined $leftpart ){ + print STDERR "BADLINE: $line\n"; + print STDERR "\$enusleftpart = $enusleftpart\n"; + print STDERR "\$leftpart = $leftpart\n"; + } + if( $enusleftpart eq $leftpart ){ # matching language + push @good_lines , $line; + } + #else{ + # print STDERR "OUT: \$enusleftpart=$enusleftpart \$leftpart=$leftpart \$line=$line\n"; + #} + } + } + } + close SORTEDFILE; + } else { print STDERR "ERROR: Can't open file $outfile\n";} + + # Write file + if ( open ( SORTEDFILE , "> $outfile" ) ){ + foreach my $newline ( @good_lines ) { + print SORTEDFILE $newline; + } + close SORTEDFILE; + } else { print STDERR "ERROR: Can't open file $outfile\n";} + +} +######################################################### +sub sort_outfile{ + my $outfile = shift; + print STDOUT "### Sorting ... $outfile ..."; + my @lines; + my @sorted_lines; + + + #if ( open ( SORTEDFILE , "< $outputfile" ) ){ + if ( open ( SORTEDFILE , "< $outfile" ) ){ + my $line; + while ( ){ + $line = $_; + if( $line =~ /^[^\#]/ ){ + push @lines , $line; + } + } + close SORTEDFILE; + @sorted_lines = sort { + my $xa_lang = ""; + my $xa_left_part = ""; + my $xa_right_part = ""; + my $xa_timestamp = ""; + my $xb_lang = ""; + my $xb_left_part = ""; + my $xb_right_part = ""; + my $xb_timestamp = ""; + my $xa = ""; + my $xb = ""; + my @alist; + my @blist; + + if( $a=~ /$sdf_regex/ ){ + $xa_left_part = defined $2 ? $2 : ''; + $xa_lang = defined $12 ? $12 : ''; + $xa_right_part = defined $13 ? $13 : ''; + $xa_left_part = remove_last_column( $xa_left_part ); + + } + if( $b=~ /$sdf_regex/ ){ + $xb_left_part = defined $2 ? $2 : ''; + $xb_lang = defined $12 ? $12 : ''; + $xb_right_part = defined $13 ? $13 : ''; + $xb_left_part = remove_last_column( $xb_left_part ); + + + } + if( ( $xa_left_part cmp $xb_left_part ) == 0 ){ # Left part equal + if( ( $xa_lang cmp $xb_lang ) == 0 ){ # Lang equal + return ( $xa_right_part cmp $xb_right_part ); # Right part compare + } + elsif( $xa_lang eq "en-US" ) { return -1; } # en-US wins + elsif( $xb_lang eq "en-US" ) { return 1; } # en-US wins + else { return $xa_lang cmp $xb_lang; } # lang compare + } + else { + return $xa_left_part cmp $xb_left_part; # Left part compare + } + } @lines; + + if ( open ( SORTEDFILE , "> $outfile" ) ){ + print SORTEDFILE get_license_header(); + foreach my $newline ( @sorted_lines ) { + print SORTEDFILE $newline; + #print STDOUT $newline; + } + } + close SORTEDFILE; + } else { print STDERR "WARNING: Can't open file $outfile\n";} + print "done\n"; + +} +######################################################### +sub remove_last_column{ + my $string = shift; + my @alist = split ( "\t" , $string ); + pop @alist; + return join( "\t" , @alist ); +} + +######################################################### +sub rename_language{ + my $fallbackhashhash_ref = shift; + my $cur_fallback = shift; + my $cur_lang = shift; + my $line; + + foreach my $key( keys ( %{ $fallbackhashhash_ref->{ $cur_fallback } } ) ){ + $line = $fallbackhashhash_ref->{ $cur_fallback }{ $key }; + if( $line =~ /$sdf_regex/ ){ + my $leftpart = defined $2 ? $2 : ''; + my $lang = defined $12 ? $12 : ''; + my $rightpart = defined $13 ? $13 : ''; + + $fallbackhashhash_ref->{ $cur_lang }{ $key } = $leftpart."\t".$cur_lang."\t".$rightpart; + } + } +} + +############################################################ +sub remove_duplicates{ + my $list_ref = shift; + my %tmphash; + foreach my $key ( @{ $list_ref } ){ $tmphash{ $key } = '' ; } + @{$list_ref} = keys( %tmphash ); +} + +############################################################## +sub fetch_fallback{ + my $sdfparticleslist_ref = shift; + my $localizeSDF = shift; + my $langhash_ref = shift; + my %fallbackhashhash; + my $cur_lang; + my @langlist; + + foreach my $key ( keys ( %{ $langhash_ref } ) ){ + $cur_lang = $langhash_ref->{ $key }; + if ( $cur_lang ne "" ) { + push @langlist , $cur_lang; + } + } + remove_duplicates( \@langlist ); + foreach $cur_lang ( @langlist ){ + if( $cur_lang eq "en-US" ){ + read_fallbacks_from_source( $localizeSDF , $cur_lang , \%fallbackhashhash ); + } + } + + # remove de / en-US + my @tmplist; + foreach $cur_lang( @langlist ){ + if( $cur_lang ne "en-US" ){ + push @tmplist , $cur_lang; + + } + } + @langlist = @tmplist; + if ( $#langlist +1 ){ + read_fallbacks_from_particles( $sdfparticleslist_ref , \@langlist , \%fallbackhashhash ); + + } + return (\%fallbackhashhash); +} + +######################################################### +sub write_file{ + + my $localizeFile = shift; + my $index_ref = shift; + + if( open DESTFILE , "+> $localizeFile" ){ + foreach my $key( %{ $index_ref } ){ + print DESTFILE ($index_ref->{ $key }, "\n" ); + } + close DESTFILE; + }else { + print STDERR "Can't open/create '$localizeFile'"; + } +} + +######################################################### +sub read_file{ + + my $sdffile = shift; + my $langhash_ref = shift; + my %block = (); + + open MYFILE , "< $sdffile" + or die "Can't open '$sdffile'\n"; + while( ){ + if( /$sdf_regex/ ){ + my $line = defined $_ ? $_ : ''; + my $prj = defined $3 ? $3 : ''; + my $file = defined $4 ? $4 : ''; + my $type = defined $6 ? $6 : ''; + my $gid = defined $7 ? $7 : ''; + my $lid = defined $8 ? $8 : ''; + my $plattform = defined $10 ? $10 : ''; + my $lang = defined $12 ? $12 : ''; + my $helpid = defined $9 ? $9 : ''; + + foreach my $isolang ( keys ( %{ $langhash_ref } ) ){ + if( $isolang=~ /$lang/i || $isolang=~ /all/i ) { $block{$prj.$gid.$lid.$file.$type.$plattform.$helpid } = $line ; } + } + } + } + return (\%block); +} + +######################################################### +sub read_fallbacks_from_particles{ + + my $sdfparticleslist_ref = shift; + my $isolanglist_ref = shift; + my $fallbackhashhash_ref = shift; + my $block_ref; + foreach my $currentfile ( @{ $sdfparticleslist_ref } ){ + if ( open MYFILE , "< $currentfile" ) { + while(){ + if( /$sdf_regex/ ){ + my $line = defined $_ ? $_ : ''; + my $prj = defined $3 ? $3 : ''; + my $file = defined $4 ? $4 : ''; + my $type = defined $6 ? $6 : ''; + my $gid = defined $7 ? $7 : ''; + my $lid = defined $8 ? $8 : ''; + my $lang = defined $12 ? $12 : ''; + my $plattform = defined $10 ? $10 : ''; + my $helpid = defined $9 ? $9 : ''; + + chomp( $line ); + + foreach my $isolang ( @{$isolanglist_ref} ){ + if( $isolang=~ /$lang/i ) { + $fallbackhashhash_ref->{ $isolang }{ $prj.$gid.$lid.$file.$type.$plattform.$helpid } = $line ; + } + } + } + } + }else { print STDERR "WARNING: Can't open file $currentfile"; } + } +} + +######################################################### +sub read_fallbacks_from_source{ + + my $sdffile = shift; + my $isolang = shift; + my $fallbackhashhash_ref = shift; + my $block_ref; + # read fallback for single file + open MYFILE , "< $sdffile" + or die "Can't open '$sdffile'\n"; + + while( ){ + if( /$sdf_regex/ ){ + my $line = defined $_ ? $_ : ''; + my $prj = defined $3 ? $3 : ''; + my $file = defined $4 ? $4 : ''; + my $type = defined $6 ? $6 : ''; + my $gid = defined $7 ? $7 : ''; + my $lid = defined $8 ? $8 : ''; + my $helpid = defined $9 ? $9 : ''; + my $lang = defined $12 ? $12 : ''; + my $plattform = defined $10 ? $10 : ''; + + chomp( $line ); + if( $isolang=~ /$lang/i ) { $fallbackhashhash_ref->{ $isolang }{ $prj.$gid.$lid.$file.$type.$plattform.$helpid } = $line ; + } + } + } +} + +######################################################### +sub parseLanguages{ + + my $bAll; + my $bUseLocalize; + my $bHasSourceLanguage=""; + my $bFakeEnglish=""; + my %langhash; + my $iso=""; + my $fallback=""; + + #### -l all + if( $languages=~ /all/ ){ + $bAll = "TRUE"; + $bHasSourceLanguage = "TRUE"; + } + ### -l fr=de,de + elsif( $languages=~ /.*,.*/ ){ + my @tmpstr = split "," , $languages; + for my $lang ( @tmpstr ){ + if( $lang=~ /([a-zA-Z]{2,3}(-[a-zA-Z\-]*)*)(=([a-zA-Z]{2,3}(-[a-zA-Z\-]*)*))?/ ){ + $iso = $1; + $fallback = $4; + + if( ( $iso && $iso=~ /(en-US)/i ) || ( $fallback && $fallback=~ /(en-US)/i ) ) { + $bUseLocalize = "TRUE"; + } + if( ( $iso && $iso=~ /(en-US)/i ) ) { + $bHasSourceLanguage = "TRUE"; + } + if( $fallback ) { $langhash{ $iso } = $fallback; } + else { $langhash{ $iso } = ""; } + } + } + } + ### -l de + else{ + if( $languages=~ /([a-zA-Z]{2,3}(-[a-zA-Z\-]*)*)(=([a-zA-Z]{2,3}(-[a-zA-Z\-]*)*))?/ ){ + $iso = $1; + $fallback = $4; + + if( ( $iso && $iso=~ /(en-US)/i ) || ( $fallback && $fallback=~ /(en-US)/i ) ) { + $bUseLocalize = "TRUE"; + + } + if( ( $iso && $iso=~ /(en-US)/i ) ) { + $bHasSourceLanguage = "TRUE"; + } + + if( $fallback ) { $langhash{ $iso } = $fallback; } + else { $langhash{ $iso } = ""; } + } + } + # HACK en-US always needed! + if( !$bHasSourceLanguage ){ + #$bHasSourceLanguage = "TRUE"; + $bUseLocalize = "TRUE"; + $bFakeEnglish = "TRUE"; + $langhash{ "en-US" } = ""; + } + return ( $bAll , $bUseLocalize , \%langhash , $bHasSourceLanguage, $bFakeEnglish); +} + +######################################################### +sub parse_options{ + + my $help; + my $merge; + my $extract; + my $success = GetOptions('f=s' => \$sdffile , 'l=s' => \$languages , 's=s' => \$srcpath , 'h' => \$help , 'v' => \$bVerbose , + 'm' => \$merge , 'e' => \$extract , 'x' => \$no_sort , 'd' => \$use_default_date ); + $outputfile = $sdffile; + + #print STDOUT "DBG: lang = $languages\n"; + if( !$srcpath ){ + #$srcpath = "$ENV{SRC_ROOT}"; + if( !$srcpath ){ + print STDERR "No path to the source root found!\n\n"; + usage(); + exit(1); + } + } + if( $help || !$success || $#ARGV > 1 || ( !$sdffile ) ){ + usage(); + exit(1); + } + if( $merge && $sdffile && ! ( -r $sdffile)){ + print STDERR "Can't open file '$sdffile'\n"; + exit(1); + } + if( !( $languages=~ /[a-zA-Z]{2,3}(-[a-zA-Z\-]*)*(=[a-zA-Z]{2,3}(-[a-zA-Z\-]*)*)?(,[a-zA-Z]{2,3}(-[a-zA-Z\-]*)*(=[a-zA-Z]{2,3}(-[a-zA-Z\-]*)*)?)*/ ) ){ + print STDERR "Please check the -l iso code\n"; + exit(1); + } + if( ( !$merge && !$extract ) || ( $merge && $extract ) ){ usage();exit( -1 );} + if( $extract ){ $mode = "extract"; } + else { $mode = "merge"; } +} + +######################################################### +sub usage{ + + print STDERR "Usage: localize.pl\n"; + print STDERR "Split or collect SDF files\n"; + print STDERR " merge: -m -f -l l1[=f1][,l2[=f2]][...] [ -s ]\n"; + print STDERR " extract: -e -f -l [ -s ] [-d]\n"; + print STDERR "Options:\n"; + print STDERR " -h help\n"; + print STDERR " -m Merge mode\n"; + print STDERR " -e Extract mode\n"; + print STDERR " -f To split a big SDF file into particles\n"; + print STDERR " To collect and join all particles to one big file\n"; + print STDERR " -s Path to the modules, if no \$SRC_ROOT is set\n"; + print STDERR " -l ( all | | =fallback ) comma seperated languages\n"; + print STDERR " -d Use default date in extracted sdf file\n"; + print STDERR " -v Verbose\n"; + print STDERR "\nExample:\n"; + print STDERR "\nlocalize -e -l en-US,pt-BR=en-US -f my.sdf\n( Extract en-US and pt-BR with en-US fallback )\n"; + print STDERR "\nlocalize -m -l cs -f my.sdf\n( Merge cs translation into the sourcecode ) \n"; +} + +# my $line = defined $_ ? $_ : ''; +# my $leftpart = defined $2 ? $2 : ''; +# my $prj = defined $3 ? $3 : ''; +# my $file = defined $4 ? $4 : ''; +# my $dummy = defined $5 ? $5 : ''; +# my $type = defined $6 ? $6 : ''; +# my $gid = defined $7 ? $7 : ''; +# my $lid = defined $8 ? $8 : ''; +# my $helpid = defined $9 ? $9 : ''; +# my $plattform = defined $10 ? $10 : ''; +# my $width = defined $11 ? $11 : ''; +# my $lang = defined $12 ? $12 : ''; +# my $rightpart = defined $13 ? $13 : ''; +# my $text = defined $14 ? $14 : ''; +# my $helptext = defined $15 ? $15 : ''; +# my $quickhelptext = defined $16 ? $16 : ''; +# my $title = defined $17 ? $17 : ''; +# my $timestamp = defined $18 ? $18 : ''; + diff --git a/l10ntools/source/cfg_yy_wrapper.c b/l10ntools/source/cfg_yy_wrapper.c new file mode 100644 index 000000000000..ac678d17f399 --- /dev/null +++ b/l10ntools/source/cfg_yy_wrapper.c @@ -0,0 +1,2 @@ +// Helper to suppress warnings in lex generated c code, see #i57362# +#include "cfg_yy.c" diff --git a/l10ntools/source/cfglex.l b/l10ntools/source/cfglex.l new file mode 100644 index 000000000000..dd2d9a45ab59 --- /dev/null +++ b/l10ntools/source/cfglex.l @@ -0,0 +1,232 @@ +%{ +/* + * lexer for parsing cfg source files + * + */ + + +/* enlarge token buffer to tokenize whole strings */ +#undef YYLMAX +#define YYLMAX 64000 + +/* to enable debug output define LEXDEBUG */ +#define LEXDEBUG 1 +#ifdef LEXDEBUG +#define OUTPUT fprintf +#else +#define OUTPUT(Par1,Par2); +#endif + +/* table of possible token ids */ +#include "tokens.h" +#include +#include + +#if defined __GNUC__ +#pragma GCC system_header +#elif defined __SINPRO_CC +#pragma disable_warn +#elif defined _MSC_VER +#pragma warning(push, 1) +#endif + +/* external functions (C++ code, declared as extren "C" */ +extern int WorkOnTokenSet( int, char* ); +extern int InitCfgExport( char * , char *); +extern int EndCfgExport(); +extern int GetError(); +extern int SetError(); +extern char *GetOutputFile( int argc, char* argv[]); +extern FILE *GetCfgFile(); +extern int isQuiet(); +extern void removeTempFile(); +extern char* getFilename(); +/* forwards */ +void YYWarning(); + +int bText=0; +%} + +%p 24000 +%e 1200 +%n 500 + +%% + +\<[^\>]*"xml:lang="\""x-no-translate"\"[^\<]*\/\> { + bText = 0; + WorkOnTokenSet( CFG_TOKEN_NO_TRANSLATE, yytext ); +} + +\<.*\/\> { + bText = 0; + WorkOnTokenSet( ANYTOKEN, yytext ); +} + +\<[^\>]*"xml:lang="\".*\"[^\<]*\> { + bText = 1; + WorkOnTokenSet( CFG_TEXT_START, yytext ); +} + + +\<[^\/\!][^\>]*\> { + bText = 0; + WorkOnTokenSet( CFG_TAG, yytext ); +} + +"]*\> { + bText = 0; + WorkOnTokenSet( CFG_TAG, yytext ); +} + + +\<\!\-\- { + char c1 = 0, c2 = 0, c3 = input(); + char pChar[2]; + pChar[1] = 0x00; + pChar[0] = c3; + + WorkOnTokenSet( COMMEND, yytext ); + WorkOnTokenSet( COMMEND, pChar ); + + for(;;) { + if ( c3 == EOF ) + break; + if ( c1 == '-' && c2 == '-' && c3 == '>' ) + break; + c1 = c2; + c2 = c3; + c3 = input(); + pChar[0] = c3; + WorkOnTokenSet( COMMEND, pChar ); + } +} + +\<\/[^\>]*\> { + bText = 0; + WorkOnTokenSet( CFG_CLOSETAG, yytext ); +} + +\<[^\>\!]*\> { + bText = 0; + if ( yytext[ 1 ] == '!' && yytext[ 2 ] == '-' && yytext[ 3 ] == '-' ) + WorkOnTokenSet( COMMEND, yytext ); + else + WorkOnTokenSet( CFG_UNKNOWNTAG, yytext ); +} + +.|\n { + if ( bText == 1 ) + WorkOnTokenSet( CFG_TEXTCHAR, yytext ); + else + WorkOnTokenSet( UNKNOWNCHAR, yytext ); +} + + +%% + +/*****************************************************************************/ +int yywrap(void) +/*****************************************************************************/ +{ + return 1; +} + +/*****************************************************************************/ +void YYWarning( char *s ) +/*****************************************************************************/ +{ + /* write warning to stderr */ + fprintf( stderr, + "Warning: \"%s\" in line %d: \"%s\"\n", s, yylineno, yytext ); +} + +/*****************************************************************************/ +#ifdef GCC +void yyerror ( char *s, ... ) +#else +void yyerror ( char *s ) +#endif +/*****************************************************************************/ +{ + /* write error to stderr */ + fprintf( stderr, + "Error: \"%s\" in line %d: \"%s\"\n", s, yylineno, yytext ); + SetError(); +} + +/*****************************************************************************/ +int +#ifdef WNT +_cdecl +#endif +main( int argc, char* argv[]) +/*****************************************************************************/ +{ + /* error level */ + int nRetValue = 0; + char *pOutput; + FILE *pFile; + + pOutput = GetOutputFile( argc, argv ); + if( !isQuiet() ){ + fprintf( stdout, "\nCfgEx 0.9 Copyright 2000 Sun Microsystems, Inc. All Rights Reserved.\n" ); + fprintf( stdout, "======================================================================\n" ); + } + + if ( !pOutput ) { + fprintf( stdout, "Syntax: CFGEX[-p Prj][-r PrjRoot]-i FileIn [-o FileOut][-m DataBase][-e][-b][-u][-f][-d DoneFile][-g[:dtd] ][-L l1,l2,...]\n" ); + fprintf( stdout, " Prj: Project\n" ); + fprintf( stdout, " PrjRoot: Path to project root (..\\.. etc.)\n" ); + fprintf( stdout, " FileIn: Source files (*.src)\n" ); + fprintf( stdout, " FileOut: Destination file (*.*)\n" ); + fprintf( stdout, " DataBase: Mergedata (*.sdf)\n" ); + fprintf( stdout, " -QQ: quiet output\n" ); + fprintf( stdout, " -e: Disable writing errorlog\n" ); + fprintf( stdout, " -b: Break when Token \"HelpText\" found in source\n" ); + fprintf( stdout, " -u: [english] and [german] are allowed, Id is Taken from DataBase \n" ); + fprintf( stdout, " -f: force extraction and merge even if only one language is existent\n" ); + fprintf( stdout, " -g[:dtd]: enables generation of properties (dtds if :dtd is set) - in this case FileOut is the output path\n" ); + fprintf( stdout, " -d: enables generation of *.don if work is done\n" ); + fprintf( stdout, " -L: Restrict the handled languages. l1,l2,... are elements of (de,en-US...)\n" ); + fprintf( stdout, " A fallback language can be defined like this: l1=f1.\n" ); + fprintf( stdout, " f1, f2,... are also elements of (de,en-US...)\n" ); + fprintf( stdout, " Example: -L de,es=en-US\n" ); + fprintf( stdout, " Restriction to de and es, en-US will be fallback for es\n" ); + return 1; + } + + pFile = GetCfgFile(); + InitCfgExport( pOutput , getFilename() ); + if ( !pFile ) + return 1; + + yyin = pFile; + + /* create global instance of class CfgExport */ + //InitCfgExport( pOutput ); + + /* start parser */ + yylex(); + + /* get error info. and end export */ + nRetValue = GetError(); + EndCfgExport(); + + if( !isQuiet() ){ + fprintf( stdout, "\n===================================\n\n" ); + } + + removeTempFile(); +/* return error level */ + return nRetValue; +} + +/*""]*"-->" { + bText = 0; + WorkOnTokenSet( COMMEND, yytext ); +}*/ +/*" { + bText = 0; + WorkOnTokenSet( CFG_TAG, yytext ); +}*/ diff --git a/l10ntools/source/cfgmerge.cxx b/l10ntools/source/cfgmerge.cxx new file mode 100644 index 000000000000..5d85a4835843 --- /dev/null +++ b/l10ntools/source/cfgmerge.cxx @@ -0,0 +1,886 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: cfgmerge.cxx,v $ + * $Revision: 1.46 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_l10ntools.hxx" +#include +#include +#include + +// local includes +#include "export.hxx" +#include "cfgmerge.hxx" +#include "tokens.h" +#include "utf8conv.hxx" + +extern "C" { int yyerror( char * ); } +extern "C" { int YYWarning( char * ); } + +// defines to parse command line +#define STATE_NON 0x0001 +#define STATE_INPUT 0x0002 +#define STATE_OUTPUT 0x0003 +#define STATE_PRJ 0x0004 +#define STATE_ROOT 0x0005 +#define STATE_MERGESRC 0x0006 +#define STATE_ERRORLOG 0x0007 +#define STATE_UTF8 0x0008 +#define STATE_LANGUAGES 0X0009 +#define STATE_ISOCODE99 0x000A +#define STATE_FORCE 0x000B + +// set of global variables +BOOL bEnableExport; +BOOL bMergeMode; +BOOL bErrorLog; +BOOL bForce; +BOOL bUTF8; +bool bQuiet; +ByteString sPrj; +ByteString sPrjRoot; +ByteString sInputFileName; +ByteString sActFileName; +ByteString sFullEntry; +ByteString sOutputFile; +ByteString sMergeSrc; +String sUsedTempFile; + +CfgParser *pParser; + +extern "C" { +// the whole interface to lexer is in this extern "C" section + +/*****************************************************************************/ +extern char *GetOutputFile( int argc, char* argv[]) +/*****************************************************************************/ +{ + bEnableExport = FALSE; + bMergeMode = FALSE; + bErrorLog = TRUE; + bForce = FALSE; + bUTF8 = TRUE; + bQuiet = false; + sPrj = ""; + sPrjRoot = ""; + sInputFileName = ""; + sActFileName = ""; + + USHORT nState = STATE_NON; + BOOL bInput = FALSE; + + // parse command line + for( int i = 1; i < argc; i++ ) { + ByteString sSwitch( argv[ i ] ); + sSwitch.ToUpperAscii(); + + if ( sSwitch == "-I" ) { + nState = STATE_INPUT; // next token specifies source file + } + else if ( sSwitch == "-O" ) { + nState = STATE_OUTPUT; // next token specifies the dest file + } + else if ( sSwitch == "-P" ) { + nState = STATE_PRJ; // next token specifies the cur. project + } + else if ( sSwitch == "-R" ) { + nState = STATE_ROOT; // next token specifies path to project root + } + else if ( sSwitch == "-M" ) { + nState = STATE_MERGESRC; // next token specifies the merge database + } + else if ( sSwitch == "-E" ) { + nState = STATE_ERRORLOG; + bErrorLog = FALSE; + } + else if ( sSwitch == "-UTF8" ) { + nState = STATE_UTF8; + bUTF8 = TRUE; + } + else if ( sSwitch == "-NOUTF8" ) { + nState = STATE_UTF8; + bUTF8 = FALSE; + } + else if ( sSwitch == "-F" ) { + nState = STATE_FORCE; + bForce = TRUE; + } + else if ( sSwitch == "-QQ" ) { + bQuiet = true; + } + else if ( sSwitch == "-L" ) { + nState = STATE_LANGUAGES; + } + else if ( sSwitch.ToUpperAscii() == "-ISO99" ) { + nState = STATE_ISOCODE99; + } + else { + switch ( nState ) { + case STATE_NON: { + return NULL; // no valid command line + } + case STATE_INPUT: { + sInputFileName = argv[ i ]; + bInput = TRUE; // source file found + } + break; + case STATE_OUTPUT: { + sOutputFile = argv[ i ]; // the dest. file + } + break; + case STATE_PRJ: { + sPrj = ByteString( argv[ i ]); +// sPrj.ToLowerAscii(); // the project + } + break; + case STATE_ROOT: { + sPrjRoot = ByteString( argv[ i ]); // path to project root + } + break; + case STATE_MERGESRC: { + sMergeSrc = ByteString( argv[ i ]); + bMergeMode = TRUE; // activate merge mode, cause merge database found + } + break; + case STATE_LANGUAGES: { + Export::sLanguages = ByteString( argv[ i ]); + } + break; + } + } + } + + if ( bInput ) { + // command line is valid + bEnableExport = TRUE; + char *pReturn = new char[ sOutputFile.Len() + 1 ]; + strcpy( pReturn, sOutputFile.GetBuffer()); // #100211# - checked + return pReturn; + } + + // command line is not valid + return NULL; +} +int isQuiet(){ + if( bQuiet ) return 1; + else return 0; +} +/*****************************************************************************/ +int InitCfgExport( char *pOutput , char* pFilename ) +/*****************************************************************************/ +{ + // instanciate Export + ByteString sOutput( pOutput ); + ByteString sFilename( pFilename ); + Export::InitLanguages(); + + if ( bMergeMode ) + pParser = new CfgMerge( sMergeSrc, sOutputFile, sFilename ); + else if ( sOutputFile.Len()) + pParser = new CfgExport( sOutputFile, sPrj, sActFileName ); + + return 1; +} + +/*****************************************************************************/ +int EndCfgExport() +/*****************************************************************************/ +{ + delete pParser; + + return 1; +} + +void removeTempFile(){ + if( !sUsedTempFile.EqualsIgnoreCaseAscii( "" ) ){ + DirEntry aTempFile( sUsedTempFile ); + aTempFile.Kill(); + } +} +extern const char* getFilename() +{ + return sInputFileName.GetBuffer(); +} +/*****************************************************************************/ +extern FILE *GetCfgFile() +/*****************************************************************************/ +{ + FILE *pFile = 0; + // look for valid filename + if ( sInputFileName.Len()) { + if( Export::fileHasUTF8ByteOrderMarker( sInputFileName ) ){ + DirEntry aTempFile = Export::GetTempFile(); + DirEntry aSourceFile( String( sInputFileName , RTL_TEXTENCODING_ASCII_US ) ); + aSourceFile.CopyTo( aTempFile , FSYS_ACTION_COPYFILE ); + String sTempFile = aTempFile.GetFull(); + Export::RemoveUTF8ByteOrderMarkerFromFile( ByteString( sTempFile , RTL_TEXTENCODING_ASCII_US ) ); + pFile = fopen( ByteString( sTempFile , RTL_TEXTENCODING_ASCII_US ).GetBuffer(), "r" ); + sUsedTempFile = sTempFile; + }else{ + // able to open file? + pFile = fopen( sInputFileName.GetBuffer(), "r" ); + sUsedTempFile = String::CreateFromAscii(""); + } + if ( !pFile ){ + fprintf( stderr, "Error: Could not open file %s\n", + sInputFileName.GetBuffer()); + exit( 13 ); + } + else { + // this is a valid file which can be opened, so + // create path to project root + DirEntry aEntry( String( sInputFileName, RTL_TEXTENCODING_ASCII_US )); + aEntry.ToAbs(); + sFullEntry= ByteString( aEntry.GetFull(), RTL_TEXTENCODING_ASCII_US ); + aEntry += DirEntry( String( "..", RTL_TEXTENCODING_ASCII_US )); + aEntry += DirEntry( sPrjRoot ); + ByteString sPrjEntry( aEntry.GetFull(), RTL_TEXTENCODING_ASCII_US ); + + // create file name, beginnig with project root + // (e.g.: source\ui\src\menue.src) +// printf("sFullEntry = %s\n",sFullEntry.GetBuffer()); + sActFileName = sFullEntry.Copy( sPrjEntry.Len() + 1 ); +// printf("sActFileName = %s\n",sActFileName.GetBuffer()); + if( !bQuiet ) + fprintf( stdout, "\nProcessing File %s ...\n", sInputFileName.GetBuffer()); + + sActFileName.SearchAndReplaceAll( "/", "\\" ); + + return pFile; + } + } + // this means the file could not be opened + return NULL; +} + +/*****************************************************************************/ +int WorkOnTokenSet( int nTyp, char *pTokenText ) +/*****************************************************************************/ +{ + pParser->Execute( nTyp, pTokenText ); + + return 1; +} + + +/*****************************************************************************/ +int SetError() +/*****************************************************************************/ +{ + return 1; +} + +/*****************************************************************************/ +int GetError() +/*****************************************************************************/ +{ + return 0; +} +} + +// +// class CfgStackData +// + +CfgStackData* CfgStack::Push( const ByteString &rTag, const ByteString &rId ) +{ + CfgStackData *pD = new CfgStackData( rTag, rId ); + Insert( pD, LIST_APPEND ); + return pD; +} + +// +// class CfgStack +// + +/*****************************************************************************/ +CfgStack::~CfgStack() +/*****************************************************************************/ +{ + for ( ULONG i = 0; i < Count(); i++ ) + delete GetObject( i ); +} + +/*****************************************************************************/ +ByteString CfgStack::GetAccessPath( ULONG nPos ) +/*****************************************************************************/ +{ + if ( nPos == LIST_APPEND ) + nPos = Count() - 1; + + ByteString sReturn; + for ( ULONG i = 0; i <= nPos; i++ ) { + if ( i ) + sReturn += "."; + sReturn += GetStackData( i )->GetIdentifier(); + } + + return sReturn; +} + +/*****************************************************************************/ +CfgStackData *CfgStack::GetStackData( ULONG nPos ) +/*****************************************************************************/ +{ + if ( nPos == LIST_APPEND ) + nPos = Count() - 1; + + return GetObject( nPos ); +} + +// +// class CfgParser +// + +/*****************************************************************************/ +CfgParser::CfgParser() +/*****************************************************************************/ + : pStackData( NULL ), + bLocalize( FALSE ) +{ +} + +/*****************************************************************************/ +CfgParser::~CfgParser() +/*****************************************************************************/ +{ +} + + +/*****************************************************************************/ +BOOL CfgParser::IsTokenClosed( const ByteString &rToken ) +/*****************************************************************************/ +{ + return rToken.GetChar( rToken.Len() - 2 ) == '/'; +} + +/*****************************************************************************/ +void CfgParser::AddText( + ByteString &rText, + const ByteString &rIsoLang, + const ByteString &rResTyp +) +/*****************************************************************************/ +{ + USHORT nTextLen = 0; + while ( rText.Len() != nTextLen ) { + nTextLen = rText.Len(); + rText.SearchAndReplaceAll( "\n", " " ); + rText.SearchAndReplaceAll( "\r", " " ); + rText.SearchAndReplaceAll( "\t", " " ); + rText.SearchAndReplaceAll( " ", " " ); + } + pStackData->sResTyp = rResTyp; + WorkOnText( rText, rIsoLang ); + + pStackData->sText[ rIsoLang ] = rText; +} + + +/*****************************************************************************/ +void CfgParser::WorkOnRessourceEnd() +/*****************************************************************************/ +{ +} + +/*****************************************************************************/ +int CfgParser::ExecuteAnalyzedToken( int nToken, char *pToken ) +/*****************************************************************************/ +{ + ByteString sToken( pToken ); + + if ( sToken == " " || sToken == "\t" ) + sLastWhitespace += sToken; + + ByteString sTokenName; + ByteString sTokenId; + + BOOL bOutput = TRUE; + + switch ( nToken ) { + case CFG_TOKEN_PACKAGE: + case CFG_TOKEN_COMPONENT: + case CFG_TOKEN_TEMPLATE: + case CFG_TOKEN_CONFIGNAME: + case CFG_TOKEN_OORNAME: + case CFG_TOKEN_OORVALUE: + case CFG_TAG: + case ANYTOKEN: + case CFG_TEXT_START: + { + sTokenName = sToken.GetToken( 1, '<' ).GetToken( 0, '>' ).GetToken( 0, ' ' ); + + if ( !IsTokenClosed( sToken )) { + ByteString sSearch; + switch ( nToken ) { + case CFG_TOKEN_PACKAGE: + sSearch = "package-id="; + break; + case CFG_TOKEN_COMPONENT: + sSearch = "component-id="; + break; + case CFG_TOKEN_TEMPLATE: + sSearch = "template-id="; + break; + case CFG_TOKEN_CONFIGNAME: + sSearch = "cfg:name="; + break; + case CFG_TOKEN_OORNAME: + sSearch = "oor:name="; + bLocalize = TRUE; + break; + case CFG_TOKEN_OORVALUE: + sSearch = "oor:value="; + break; + case CFG_TEXT_START: { + if ( sCurrentResTyp != sTokenName ) { + WorkOnRessourceEnd(); + ByteString sCur; + for( unsigned int n = 0; n < aLanguages.size(); n++ ){ + sCur = aLanguages[ n ]; + pStackData->sText[ sCur ] = ByteString(""); + } + } + sCurrentResTyp = sTokenName; + + ByteString sTemp = sToken.Copy( sToken.Search( "xml:lang=" )); + sCurrentIsoLang = sTemp.GetToken( 1, '\"' ).GetToken( 0, '\"' ); + + if ( sCurrentIsoLang == NO_TRANSLATE_ISO ) + bLocalize = FALSE; + + pStackData->sTextTag = sToken; + + sCurrentText = ""; + } + break; + } + if ( sSearch.Len()) { + ByteString sTemp = sToken.Copy( sToken.Search( sSearch )); + sTokenId = sTemp.GetToken( 1, '\"' ).GetToken( 0, '\"' ); + } + pStackData = aStack.Push( sTokenName, sTokenId ); + + if ( sSearch == "cfg:name=" ) { + ByteString sTemp( sToken ); + sTemp.ToUpperAscii(); + bLocalize = (( sTemp.Search( "CFG:TYPE=\"STRING\"" ) != STRING_NOTFOUND ) && + ( sTemp.Search( "CFG:LOCALIZED=\"TRUE\"" ) != STRING_NOTFOUND )); + } + } + else if ( sTokenName == "label" ) { + if ( sCurrentResTyp != sTokenName ) { + WorkOnRessourceEnd(); + ByteString sCur; + for( unsigned int n = 0; n < aLanguages.size(); n++ ){ + sCur = aLanguages[ n ]; + pStackData->sText[ sCur ] = ByteString(""); + } + } + sCurrentResTyp = sTokenName; + } + } + break; + case CFG_CLOSETAG: + sTokenName = sToken.GetToken( 1, '/' ).GetToken( 0, '>' ).GetToken( 0, ' ' ); + if ( aStack.GetStackData() && ( aStack.GetStackData()->GetTagType() == sTokenName )) { + if ( ! sCurrentText.Len()) + WorkOnRessourceEnd(); + aStack.Pop(); + pStackData = aStack.GetStackData(); + } + else { + ByteString sError( "Missplaced close tag: " ); + ByteString sInFile(" in file "); + sError += sToken; + sError += sInFile; + sError += sFullEntry; + Error( sError ); + exit ( 13 ); + } + break; + + case CFG_TEXTCHAR: + sCurrentText += sToken; + bOutput = FALSE; + break; + + case CFG_TOKEN_NO_TRANSLATE: + bLocalize = FALSE; + break; + } + + if ( sCurrentText.Len() && nToken != CFG_TEXTCHAR ) { + AddText( sCurrentText, sCurrentIsoLang, sCurrentResTyp ); + Output( sCurrentText ); + sCurrentText = ""; + pStackData->sEndTextTag = sToken; + } + + if ( bOutput ) + Output( sToken ); + + if ( sToken != " " && sToken != "\t" ) + sLastWhitespace = ""; + + return 1; +} + +/*****************************************************************************/ +void CfgExport::Output( const ByteString& rOutput ) +/*****************************************************************************/ +{ + // Dummy operation to suppress warnings caused by poor class design + ByteString a( rOutput ); +} + +/*****************************************************************************/ +int CfgParser::Execute( int nToken, char * pToken ) +/*****************************************************************************/ +{ + ByteString sToken( pToken ); + + switch ( nToken ) { + case CFG_TAG: + if ( sToken.Search( "package-id=" ) != STRING_NOTFOUND ) + return ExecuteAnalyzedToken( CFG_TOKEN_PACKAGE, pToken ); + else if ( sToken.Search( "component-id=" ) != STRING_NOTFOUND ) + return ExecuteAnalyzedToken( CFG_TOKEN_COMPONENT, pToken ); + else if ( sToken.Search( "template-id=" ) != STRING_NOTFOUND ) + return ExecuteAnalyzedToken( CFG_TOKEN_TEMPLATE, pToken ); + else if ( sToken.Search( "cfg:name=" ) != STRING_NOTFOUND ) + return ExecuteAnalyzedToken( CFG_TOKEN_OORNAME, pToken ); + else if ( sToken.Search( "oor:name=" ) != STRING_NOTFOUND ) + return ExecuteAnalyzedToken( CFG_TOKEN_OORNAME, pToken ); + else if ( sToken.Search( "oor:value=" ) != STRING_NOTFOUND ) + return ExecuteAnalyzedToken( CFG_TOKEN_OORVALUE, pToken ); + break; + } + return ExecuteAnalyzedToken( nToken, pToken ); +} + + +/*****************************************************************************/ +void CfgParser::Error( const ByteString &rError ) +/*****************************************************************************/ +{ +// ByteString sError( rError ); +// sError.Append("Error: In file "); +// sError.Append( sActFileName ); + yyerror(( char * ) rError.GetBuffer()); +} + + +// +// class CfgOutputParser +// + +/*****************************************************************************/ +CfgOutputParser::CfgOutputParser( const ByteString &rOutputFile ) +/*****************************************************************************/ +{ + pOutputStream = + new SvFileStream( + String( rOutputFile, RTL_TEXTENCODING_ASCII_US ), + STREAM_STD_WRITE | STREAM_TRUNC + ); + pOutputStream->SetStreamCharSet( RTL_TEXTENCODING_UTF8 ); + + if ( !pOutputStream->IsOpen()) { + ByteString sError( "ERROR: Unable to open output file: " ); + sError += rOutputFile; + Error( sError ); + delete pOutputStream; + pOutputStream = NULL; + exit( 13 ); + } +} + +/*****************************************************************************/ +CfgOutputParser::~CfgOutputParser() +/*****************************************************************************/ +{ + if ( pOutputStream ) { + pOutputStream->Close(); + delete pOutputStream; + } +} + +// +// class CfgExport +// + +/*****************************************************************************/ +CfgExport::CfgExport( + const ByteString &rOutputFile, + const ByteString &rProject, + const ByteString &rFilePath +) +/*****************************************************************************/ + : CfgOutputParser( rOutputFile ), + sPrj( rProject ), + sPath( rFilePath ) +{ + Export::InitLanguages( false ); + aLanguages = Export::GetLanguages(); +} + +/*****************************************************************************/ +CfgExport::~CfgExport() +/*****************************************************************************/ +{ +} + +/*****************************************************************************/ +void CfgExport::WorkOnRessourceEnd() +/*****************************************************************************/ +{ + if ( pOutputStream && bLocalize ) { + if (( pStackData->sText[ ByteString("en-US") ].Len() + ) || + ( bForce && + ( pStackData->sText[ ByteString("de") ].Len() || + pStackData->sText[ ByteString("en-US") ].Len() ))) + { + ByteString sFallback = pStackData->sText[ ByteString("en-US") ]; + + //if ( pStackData->sText[ ByteString("en-US") ].Len()) + // sFallback = pStackData->sText[ ByteString("en-US") ]; + + ByteString sLocalId = pStackData->sIdentifier; + ByteString sGroupId; + if ( aStack.Count() == 1 ) { + sGroupId = sLocalId; + sLocalId = ""; + } + else { + sGroupId = aStack.GetAccessPath( aStack.Count() - 2 ); + } + + ByteString sTimeStamp( Export::GetTimeStamp()); + + ByteString sCur; + for( unsigned int n = 0; n < aLanguages.size(); n++ ){ + sCur = aLanguages[ n ]; + + ByteString sText = pStackData->sText[ sCur ]; + if ( !sText.Len()) + sText = sFallback; + + Export::UnquotHTML( sText ); + + ByteString sOutput( sPrj ); sOutput += "\t"; + sOutput += sPath; + sOutput += "\t0\t"; + sOutput += pStackData->sResTyp; sOutput += "\t"; + sOutput += sGroupId; sOutput += "\t"; + sOutput += sLocalId; sOutput += "\t\t\t0\t"; + sOutput += sCur; + sOutput += "\t"; + + sOutput += sText; sOutput += "\t\t\t\t"; + sOutput += sTimeStamp; + + //if( !sCur.EqualsIgnoreCaseAscii("de") ||( sCur.EqualsIgnoreCaseAscii("de") && !Export::isMergingGermanAllowed( sPrj ) ) ) + pOutputStream->WriteLine( sOutput ); + } + } + } +} + +/*****************************************************************************/ +void CfgExport::WorkOnText( + ByteString &rText, + const ByteString &rIsoLang +) +/*****************************************************************************/ +{ + if( rIsoLang.Len() ) Export::UnquotHTML( rText ); +} + + +// +// class CfgMerge +// + +/*****************************************************************************/ +CfgMerge::CfgMerge( + const ByteString &rMergeSource, const ByteString &rOutputFile, + ByteString &rFilename ) +/*****************************************************************************/ + : CfgOutputParser( rOutputFile ), + pMergeDataFile( NULL ), + pResData( NULL ), + bGerman( FALSE ), + sFilename( rFilename ), + bEnglish( FALSE ) +{ + if ( rMergeSource.Len()){ + pMergeDataFile = new MergeDataFile( + rMergeSource, sInputFileName , bErrorLog, RTL_TEXTENCODING_MS_1252, true ); + if( Export::sLanguages.EqualsIgnoreCaseAscii("ALL") ){ + Export::SetLanguages( pMergeDataFile->GetLanguages() ); + aLanguages = pMergeDataFile->GetLanguages(); + } + else aLanguages = Export::GetLanguages(); + }else + aLanguages = Export::GetLanguages(); +} + +/*****************************************************************************/ +CfgMerge::~CfgMerge() +/*****************************************************************************/ +{ + delete pMergeDataFile; + delete pResData; +} + +/*****************************************************************************/ +void CfgMerge::WorkOnText( + ByteString &rText, + const ByteString& nLangIndex +) +/*****************************************************************************/ +{ + + if ( pMergeDataFile && bLocalize ) { + if ( !pResData ) { + ByteString sLocalId = pStackData->sIdentifier; + ByteString sGroupId; + if ( aStack.Count() == 1 ) { + sGroupId = sLocalId; + sLocalId = ""; + } + else { + sGroupId = aStack.GetAccessPath( aStack.Count() - 2 ); + } + + ByteString sPlatform( "" ); + + pResData = new ResData( sPlatform, sGroupId , sFilename ); + pResData->sId = sLocalId; + pResData->sResTyp = pStackData->sResTyp; + } + + //if ( nLangIndex.EqualsIgnoreCaseAscii("de") ) + // bGerman = TRUE; + if (( nLangIndex.EqualsIgnoreCaseAscii("en-US") )) + bEnglish = TRUE; + + PFormEntrys *pEntrys = pMergeDataFile->GetPFormEntrysCaseSensitive( pResData ); + if ( pEntrys ) { + ByteString sContent; + pEntrys->GetText( sContent, STRING_TYP_TEXT, nLangIndex ); + + if ( Export::isAllowed( nLangIndex ) && + ( sContent != "-" ) && ( sContent.Len())) + { +#ifdef MERGE_SOURCE_LANGUAGES + if( nLangIndex.EqualsIgnoreCaseAscii("de") || nLangIndex.EqualsIgnoreCaseAscii("en-US") ) + rText = sContent; +#endif + Export::QuotHTML( rText ); + } + } + } +} + +/*****************************************************************************/ +void CfgMerge::Output( const ByteString& rOutput ) +/*****************************************************************************/ +{ + if ( pOutputStream ) + pOutputStream->Write( rOutput.GetBuffer(), rOutput.Len()); +} + +ULONG CfgStack::Push( CfgStackData *pStackData ) +{ + Insert( pStackData, LIST_APPEND ); + return Count() - 1; +} + +/*****************************************************************************/ +void CfgMerge::WorkOnRessourceEnd() +/*****************************************************************************/ +{ + + if ( pMergeDataFile && pResData && bLocalize && (( bEnglish ) || bForce )) { + PFormEntrys *pEntrys = pMergeDataFile->GetPFormEntrysCaseSensitive( pResData ); + if ( pEntrys ) { + ByteString sCur; + + for( unsigned int n = 0; n < aLanguages.size(); n++ ){ + sCur = aLanguages[ n ]; + + ByteString sContent; + pEntrys->GetText( sContent, STRING_TYP_TEXT, sCur , TRUE ); + if ( + // (!sCur.EqualsIgnoreCaseAscii("de") ) && + ( !sCur.EqualsIgnoreCaseAscii("en-US") ) && + + ( sContent != "-" ) && ( sContent.Len())) + { + + ByteString sText = sContent; + Export::QuotHTML( sText ); + + ByteString sAdditionalLine( "\t" ); + + ByteString sTextTag = pStackData->sTextTag; + ByteString sTemp = sTextTag.Copy( sTextTag.Search( "xml:lang=" )); + + ByteString sSearch = sTemp.GetToken( 0, '\"' ); + sSearch += "\""; + sSearch += sTemp.GetToken( 1, '\"' ); + sSearch += "\""; + + ByteString sReplace = sTemp.GetToken( 0, '\"' ); + sReplace += "\""; + sReplace += sCur; + sReplace += "\""; + + sTextTag.SearchAndReplace( sSearch, sReplace ); + + sAdditionalLine += sTextTag; + sAdditionalLine += sText; + sAdditionalLine += pStackData->sEndTextTag; + + sAdditionalLine += "\n"; + sAdditionalLine += sLastWhitespace; + + Output( sAdditionalLine ); + } + } + } + } + delete pResData; + pResData = NULL; + bGerman = FALSE; + bEnglish = FALSE; +} diff --git a/l10ntools/source/directory.cxx b/l10ntools/source/directory.cxx new file mode 100644 index 000000000000..21d0a5878d66 --- /dev/null +++ b/l10ntools/source/directory.cxx @@ -0,0 +1,276 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: directory.cxx,v $ + * $Revision: 1.6 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_l10ntools.hxx" +#include +#include "tools/string.hxx" +#include +#include +#include + +namespace transex +{ + +Directory::Directory( const rtl::OUString sFullpath ) : bSkipLinks( false ) +{ + sFullName = sFullpath; +} + +Directory::Directory( const rtl::OUString sFullPath , const rtl::OUString sEntry ) : bSkipLinks( false ) +{ + sFullName = sFullPath; + sDirectoryName = sEntry; +} + + +Directory::Directory( const ByteString sFullPath ) : bSkipLinks( false ) +{ + sDirectoryName = rtl::OUString( sFullPath.GetBuffer() , RTL_TEXTENCODING_UTF8 , sFullPath.Len() ); +} + +bool Directory::lessDir ( const Directory& rKey1, const Directory& rKey2 ) +{ + rtl::OUString sName1( ( static_cast< Directory >( rKey1 ) ).getDirectoryName() ); + rtl::OUString sName2( ( static_cast< Directory >( rKey2 ) ).getDirectoryName() ); + + return sName1.compareTo( sName2 ) < 0 ; +} + + +void Directory::dump() +{ + + for( std::vector< transex::File >::iterator iter = aFileVec.begin() ; iter != aFileVec.end() ; ++iter ) + { + std::cout << "FILE " << rtl::OUStringToOString( (*iter).getFullName().getStr() , RTL_TEXTENCODING_UTF8 , (*iter).getFullName().getLength() ).getStr() << "\n"; + } + + for( std::vector< transex::Directory >::iterator iter = aDirVec.begin() ; iter != aDirVec.end() ; ++iter ) + { + std::cout << "DIR " << rtl::OUStringToOString( (*iter).getFullName().getStr() , RTL_TEXTENCODING_UTF8 , (*iter).getFullName().getLength() ).getStr() << "\n"; + } + +} + +void Directory::scanSubDir( int nLevels ) +{ + readDirectory( sFullName ); + dump(); + if( nLevels > 0 ) { + for( std::vector< transex::Directory >::iterator iter = aDirVec.begin() ; iter != aDirVec.end() || nLevels > 0 ; ++iter , nLevels-- ) + { + ( *iter ).scanSubDir(); + } + } +} + +void Directory::setSkipLinks( bool is_skipped ) +{ + bSkipLinks = is_skipped; +} + +void Directory::readDirectory() +{ + readDirectory( sFullName ); +} + +#ifdef WNT +#include +#include +#include + +void Directory::readDirectory ( const rtl::OUString& sFullpath ) +{ + BOOL fFinished; + HANDLE hList; + TCHAR szDir[MAX_PATH+1]; + TCHAR szSubDir[MAX_PATH+1]; + WIN32_FIND_DATA FileData; + + rtl::OString sFullpathext = rtl::OUStringToOString( sFullpath , RTL_TEXTENCODING_UTF8 , sFullpath.getLength() ); + const char *dirname = sFullpathext.getStr(); + + // Get the proper directory path + sprintf(szDir, "%s\\*", dirname); + + // Get the first file + hList = FindFirstFile(szDir, &FileData); + if (hList == INVALID_HANDLE_VALUE) + { + //FindClose(hList); + //printf("No files found %s\n", szDir ); return; + } + else + { + fFinished = FALSE; + while (!fFinished) + { + + sprintf(szSubDir, "%s\\%s", dirname, FileData.cFileName); + rtl::OString myfile( FileData.cFileName ); + rtl::OString mydir( szSubDir ); + + if (FileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) + { + if ( (strcmp(FileData.cFileName, ".") != 0 ) && + (strcmp(FileData.cFileName, "..") != 0 ) ) + { + //sprintf(szSubDir, "%s\\%s", dirname, FileData.cFileName); + transex::Directory aDir( rtl::OStringToOUString( mydir , RTL_TEXTENCODING_UTF8 , mydir.getLength() ), + rtl::OStringToOUString( myfile , RTL_TEXTENCODING_UTF8 , myfile.getLength() ) ); + aDirVec.push_back( aDir ); + } + } + else + { + transex::File aFile( rtl::OStringToOUString( mydir , RTL_TEXTENCODING_UTF8 , mydir.getLength() ), + rtl::OStringToOUString( myfile , RTL_TEXTENCODING_UTF8 , myfile.getLength() ) ); + aFileVec.push_back( aFile ); + } + if (!FindNextFile(hList, &FileData)) + { + if (GetLastError() == ERROR_NO_MORE_FILES) + { + fFinished = TRUE; + } + } + } + } + + FindClose(hList); + + ::std::sort( aFileVec.begin() , aFileVec.end() , File::lessFile ); + ::std::sort( aDirVec.begin() , aDirVec.end() , Directory::lessDir ); +} + +#else + +class dirholder +{ +private: + DIR *mpDir; +public: + dirholder(DIR *pDir) : mpDir(pDir) {} + int close() { int nRet = mpDir ? closedir(mpDir) : 0; mpDir = NULL; return nRet; } + ~dirholder() { close(); } +}; + +void Directory::readDirectory( const rtl::OUString& sFullpath ) +{ + struct stat statbuf; + struct stat statbuf2; + struct dirent *dirp; + DIR *dir; + //int ret; + //char *ptr; + + if( sFullpath.getLength() < 1 ) return; + + rtl::OString sFullpathext = rtl::OUStringToOString( sFullpath , RTL_TEXTENCODING_UTF8 , sFullpath.getLength() ).getStr(); + //printf("%s\n",sFullpathext.getStr()); + const char* path = sFullpathext.getStr(); + + // stat + if( stat( path , &statbuf ) < 0 ){ printf("warning: Can not stat %s" , path ); return; }// error } + + if( S_ISDIR(statbuf.st_mode ) == 0 ) { return; }// error } return; // not dir + + if( (dir = opendir( path ) ) == NULL ) {printf("readerror 2 in %s \n",path); return; } // error } return; // error + dirholder aHolder(dir); + + sFullpathext += rtl::OString( "/" ); + + const rtl::OString sDot ( "." ) ; + const rtl::OString sDDot( ".." ); + + if ( chdir( path ) == -1 ) { printf("chdir error in %s \n",path); return; } // error + + while( ( dirp = readdir( dir ) ) != NULL ) + { + rtl::OString sEntryName( dirp->d_name ); + + if( sEntryName.equals( sDot ) || sEntryName.equals( sDDot ) ) + continue; + + // add dir entry + rtl::OString sEntity = sFullpathext; + sEntity += sEntryName; + + // stat new entry + if( lstat( sEntity.getStr() , &statbuf2 ) < 0 ) + { + printf("error on entry %s\n" , sEntity.getStr() ) ; // error + continue; + } + + // add file / dir to vector + switch( statbuf2.st_mode & S_IFMT ) + { + case S_IFREG: + { + rtl::OString sFile = sFullpathext; + sFile += sEntryName ; + transex::File aFile( rtl::OStringToOUString( sEntity , RTL_TEXTENCODING_UTF8 , sEntity.getLength() ) , + rtl::OStringToOUString( sEntryName , RTL_TEXTENCODING_UTF8 , sEntryName.getLength() ) + ); + + aFileVec.push_back( aFile ) ; + break; + } + case S_IFLNK: + { + if( bSkipLinks ) break; + } + case S_IFDIR: + { + rtl::OString sDir = sFullpathext; + sDir += sEntryName ; + + transex::Directory aDir( + rtl::OStringToOUString( sEntity , RTL_TEXTENCODING_UTF8 , sEntity.getLength() ) , + rtl::OStringToOUString( sEntryName , RTL_TEXTENCODING_UTF8 , sEntryName.getLength() ) + ) ; + aDirVec.push_back( aDir ) ; + break; + } + } + } + if ( chdir( ".." ) == -1 ) { printf("chdir error in .. \n"); return; } // error + if( aHolder.close() < 0 ) return ; // error + + std::sort( aFileVec.begin() , aFileVec.end() , File::lessFile ); + std::sort( aDirVec.begin() , aDirVec.end() , Directory::lessDir ); + +} + +#endif +} diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx new file mode 100644 index 000000000000..72826d7bf1f2 --- /dev/null +++ b/l10ntools/source/export.cxx @@ -0,0 +1,2660 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: export.cxx,v $ + * $Revision: 1.57 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_l10ntools.hxx" +#include +#include +#include +#include "export.hxx" +#include "tokens.h" +#include "utf8conv.hxx" +#include + +extern "C" { int yyerror( char * ); } +extern "C" { int YYWarning( char * ); } + +Export *pExport = 0L; + +// defines to parse command line +#define STATE_NON 0x0001 +#define STATE_INPUT 0x0002 +#define STATE_OUTPUT 0x0003 +#define STATE_PRJ 0x0004 +#define STATE_ROOT 0x0005 +#define STATE_MERGESRC 0x0006 +#define STATE_ERRORLOG 0x0007 +#define STATE_BREAKHELP 0x0008 +#define STATE_UNMERGE 0x0009 +#define STATE_UTF8 0x000A +#define STATE_LANGUAGES 0X000B + +// set of global variables +DECLARE_LIST( FileList, ByteString * ) +FileList aInputFileList; +BOOL bEnableExport; +BOOL bMergeMode; +BOOL bErrorLog; +BOOL bBreakWhenHelpText; +BOOL bUnmerge; +BOOL bUTF8; +bool bQuiet; +ByteString sPrj; +ByteString sPrjRoot; +ByteString sActFileName; +ByteString sOutputFile; +ByteString sMergeSrc; +ByteString sTempFile; +ByteString sFile; +MergeDataFile *pMergeDataFile; +FILE *pTempFile; + + +ByteString sStrBuffer; +bool bMarcro = false; + +extern "C" { +// the whole interface to lexer is in this extern "C" section + + +/*****************************************************************************/ +extern char *GetOutputFile( int argc, char* argv[]) +/*****************************************************************************/ +{ + bEnableExport = FALSE; + bMergeMode = FALSE; + bErrorLog = TRUE; + bBreakWhenHelpText = FALSE; + bUnmerge = FALSE; + bUTF8 = TRUE; + sPrj = ""; + sPrjRoot = ""; + sActFileName = ""; + Export::sLanguages = ""; + Export::sForcedLanguages = ""; + sTempFile = ""; + pTempFile = NULL; + bQuiet = false; + USHORT nState = STATE_NON; + BOOL bInput = FALSE; + + // parse command line + for( int i = 1; i < argc; i++ ) { + ByteString sSwitch( argv[ i ] ); + + if (sSwitch == "-i" || sSwitch == "-I" ) { + nState = STATE_INPUT; // next tokens specifies source files + } + else if (sSwitch == "-o" || sSwitch == "-O" ) { + nState = STATE_OUTPUT; // next token specifies the dest file + } + else if (sSwitch == "-p" || sSwitch == "-P" ) { + nState = STATE_PRJ; // next token specifies the cur. project + } + else if (sSwitch == "-qq" || sSwitch == "-QQ" ) { + bQuiet = true; + } + + else if (sSwitch == "-r" || sSwitch == "-R" ) { + nState = STATE_ROOT; // next token specifies path to project root + } + else if (sSwitch == "-m" || sSwitch == "-M" ) { + nState = STATE_MERGESRC; // next token specifies the merge database + } + else if (sSwitch == "-e" || sSwitch == "-E" ) { + nState = STATE_ERRORLOG; + bErrorLog = FALSE; + } + else if (sSwitch == "-b" || sSwitch == "-B" ) { + nState = STATE_BREAKHELP; + bBreakWhenHelpText = TRUE; + } + else if (sSwitch == "-u" || sSwitch == "-U" ) { + nState = STATE_UNMERGE; + bUnmerge = TRUE; + bMergeMode = TRUE; + } + else if ( sSwitch.ToUpperAscii() == "-UTF8" ) { + nState = STATE_UTF8; + bUTF8 = TRUE; + } + else if ( sSwitch.ToUpperAscii() == "-NOUTF8" ) { + nState = STATE_UTF8; + bUTF8 = FALSE; + } + else if ( sSwitch == "-l" || sSwitch == "-L" ) { + nState = STATE_LANGUAGES; + } + else { + switch ( nState ) { + case STATE_NON: { + return NULL; // no valid command line + } + case STATE_INPUT: { + aInputFileList.Insert( new ByteString( argv[ i ]), LIST_APPEND ); + bInput = TRUE; // min. one source file found + } + break; + case STATE_OUTPUT: { + sOutputFile = ByteString( argv[ i ]); // the dest. file + } + break; + case STATE_PRJ: { + sPrj = ByteString( argv[ i ]); + } + break; + case STATE_ROOT: { + sPrjRoot = ByteString( argv[ i ]); // path to project root + } + break; + case STATE_MERGESRC: { + sMergeSrc = ByteString( argv[ i ]); + bMergeMode = TRUE; // activate merge mode, cause merge database found + } + break; + case STATE_LANGUAGES: { + Export::sLanguages = ByteString( argv[ i ]); + } + break; + } + } + } + if( bUnmerge ) sMergeSrc = ByteString(); + if ( bInput ) { + // command line is valid + bEnableExport = TRUE; + char *pReturn = new char[ sOutputFile.Len() + 1 ]; + strcpy( pReturn, sOutputFile.GetBuffer()); // #100211# - checked + return pReturn; + } + + // command line is not valid + return NULL; +} +/*****************************************************************************/ +int isQuiet(){ +/*****************************************************************************/ + if( bQuiet ) return 1; + else return 0; +} +/*****************************************************************************/ +int InitExport( char *pOutput , char* pFilename ) +/*****************************************************************************/ +{ + // instanciate Export + ByteString sOutput( pOutput ); + ByteString sFilename( pFilename ); + + if ( bMergeMode && !bUnmerge ) { + // merge mode enabled, so read database + pExport = new Export(sOutput, bEnableExport, sPrj, sPrjRoot, sMergeSrc , sFilename ); + } + else + // no merge mode, only export + pExport = new Export( sOutput, bEnableExport, sPrj, sPrjRoot , sFilename ); + return 1; +} + +/*****************************************************************************/ +int EndExport() +/*****************************************************************************/ +{ + delete pExport; + return 1; +} + +extern const char* getFilename() +{ + return (*(aInputFileList.GetObject( 0 ))).GetBuffer(); +} +/*****************************************************************************/ +extern FILE *GetNextFile() +/*****************************************************************************/ +{ + // look for next valid filename in input file list + if ( sTempFile.Len()) { + fclose( pTempFile ); + String sTemp( sTempFile, RTL_TEXTENCODING_ASCII_US ); + DirEntry aTemp( sTemp ); + aTemp.Kill(); + } + + while ( aInputFileList.Count()) { + ByteString sFileName( *(aInputFileList.GetObject( 0 ))); + + ByteString sOrigFile( sFileName ); + + sFileName = Export::GetNativeFile( sFileName ); + delete aInputFileList.GetObject(( ULONG ) 0 ); + aInputFileList.Remove(( ULONG ) 0 ); + + if ( sFileName == "" ) { + fprintf( stderr, "ERROR: Could not precompile File %s\n", + sOrigFile.GetBuffer()); + return GetNextFile(); + } + + sTempFile = sFileName; + Export::RemoveUTF8ByteOrderMarkerFromFile( sFileName ); + + // able to open file? + FILE *pFile = fopen( sFileName.GetBuffer(), "r" ); + if ( !pFile ) + fprintf( stderr, "Error: Could not open File %s\n", + sFileName.GetBuffer()); + else { + pTempFile = pFile; + + // this is a valid file which can be opened, so + // create path to project root + DirEntry aEntry( String( sOrigFile, RTL_TEXTENCODING_ASCII_US )); + aEntry.ToAbs(); + ByteString sFullEntry( aEntry.GetFull(), RTL_TEXTENCODING_ASCII_US ); + aEntry += DirEntry( String( "..", RTL_TEXTENCODING_ASCII_US )); + aEntry += DirEntry( sPrjRoot ); + ByteString sPrjEntry( aEntry.GetFull(), RTL_TEXTENCODING_ASCII_US ); + + // create file name, beginnig with project root + // (e.g.: source\ui\src\menue.src) + sActFileName = sFullEntry.Copy( sPrjEntry.Len() + 1 ); + + if( !bQuiet ) fprintf( stdout, "\nProcessing File %s ...\n", sOrigFile.GetBuffer()); + + sActFileName.SearchAndReplaceAll( "/", "\\" ); + sFile = sActFileName; + + if ( pExport ) { + // create instance of class export + pExport->Init(); + } + // return the valid file handle + return pFile; + } + } + // this means the file could not be opened + return NULL; +} + +int Parse( int nTyp, const char *pTokenText ){ + pExport->Execute( nTyp , pTokenText ); + return 1; +} +void Close(){ + pExport->pParseQueue->Close(); +} +/*****************************************************************************/ +int WorkOnTokenSet( int nTyp, char *pTokenText ) +/*****************************************************************************/ +{ + + pExport->pParseQueue->Push( QueueEntry( nTyp , ByteString( pTokenText ) ) ); + return 1; +} + +} // extern + +extern "C" { +/*****************************************************************************/ +int SetError() +/*****************************************************************************/ +{ + // set error at global instance of class Export + pExport->SetError(); + return 1; +} +} + +extern "C" { +/*****************************************************************************/ +int GetError() +/*****************************************************************************/ +{ + // get error at global instance of class Export + if ( pExport->GetError()) + return 1; + return FALSE; +} +} + +// +// class ResData +// + +void ResData::Dump(){ + printf("**************\nResData\n"); + printf("sPForm = %s , sResTyp = %s , sId = %s , sGId = %s , sHelpId = %s\n",sPForm.GetBuffer() + ,sResTyp.GetBuffer(),sId.GetBuffer(),sGId.GetBuffer(),sHelpId.GetBuffer()); + + ByteString a("*pStringList"); + ByteString b("*pUIEntries"); + ByteString c("*pFilterList"); + ByteString d("*pItemList"); + ByteString e("*pPairedList"); + ByteString f("sText"); + + Export::DumpMap( f , sText ); + + if( pStringList ) Export::DumpExportList( a , *pStringList ); + if( pUIEntries ) Export::DumpExportList( b , *pUIEntries ); + if( pFilterList ) Export::DumpExportList( c , *pFilterList ); + if( pItemList ) Export::DumpExportList( d , *pItemList ); + if( pPairedList ) Export::DumpExportList( e , *pPairedList ); + printf("\n"); +} + +void ResData::addFallbackData( ByteString& sId_in , const ByteString& sText_in ){ + //printf(" ResData::addFallbackData ( sId = %s , sText = %s )\n", sId_in.GetBuffer() , sText_in.GetBuffer() ); + aFallbackData[ sId_in ] = sText_in; +} +bool ResData::getFallbackData( ByteString& sId_in , ByteString& sText_inout ){ + sText_inout = aFallbackData[ sId_in ]; + //printf("ResData::getFallbackData( sId = %s , return sText = %s \n" , sId_in.GetBuffer(), sText_inout.GetBuffer()); + return sText_inout.Len() > 0; +} + +void ResData::addMergedLanguage( ByteString& sLang ){ + aMergedLanguages[ sLang ]=ByteString("1"); +} +bool ResData::isMerged( ByteString& sLang ){ + return aMergedLanguages[ sLang ].Equals("1"); +} + +/*****************************************************************************/ +BOOL ResData::SetId( const ByteString &rId, USHORT nLevel ) +/*****************************************************************************/ +{ + if ( nLevel > nIdLevel ) + { + nIdLevel = nLevel; + sId = rId; + + if ( bChild && bChildWithText ) { + ByteString sError( "ResId after child definition" ); + yyerror( sError.GetBufferAccess()); + sError.ReleaseBufferAccess(); + SetError(); + } + + if ( sId.Len() > 255 ) { + ByteString sWarning( "LocalId > 255 chars, truncating..." ); + YYWarning( sWarning.GetBufferAccess()); + sWarning.ReleaseBufferAccess(); + sId.Erase( 255 ); + sId.EraseTrailingChars( ' ' ); + sId.EraseTrailingChars( '\t' ); + } + + return TRUE; + } + + return FALSE; +} + +// +// class Export +// + +/*****************************************************************************/ +Export::Export( const ByteString &rOutput, BOOL bWrite, + const ByteString &rPrj, const ByteString &rPrjRoot , const ByteString& rFile ) +/*****************************************************************************/ + : + pWordTransformer( NULL ), + aCharSet( RTL_TEXTENCODING_MS_1252 ), + bDefine( FALSE ), + bNextMustBeDefineEOL( FALSE ), + nLevel( 0 ), + nList( LIST_NON ), + nListIndex( 0 ), + nListLevel( 0 ), + bSkipFile( false ), + sProject( sPrj ), + sRoot( sPrjRoot ), + bEnableExport( bWrite ), + bMergeMode( bUnmerge ), + bError( FALSE ), + bReadOver( FALSE ), + bDontWriteOutput( FALSE ), + sFilename( rFile ) +{ + pParseQueue = new ParserQueue( *this ); + (void) rPrj; + (void) rPrjRoot; + (void) rFile; + + if( !isInitialized ) InitLanguages(); + // used when export is enabled + + // open output stream + if ( bEnableExport ) { + aOutput.Open( String( rOutput, RTL_TEXTENCODING_ASCII_US ), STREAM_STD_WRITE | STREAM_TRUNC ); + if( !aOutput.IsOpen() ) { + printf("ERROR : Can't open file %s\n",rOutput.GetBuffer()); + exit ( -1 ); + } + aOutput.SetStreamCharSet( RTL_TEXTENCODING_UTF8 ); + + aOutput.SetLineDelimiter( LINEEND_CRLF ); + } +} + +/*****************************************************************************/ +Export::Export( const ByteString &rOutput, BOOL bWrite, + const ByteString &rPrj, const ByteString &rPrjRoot, + const ByteString &rMergeSource , const ByteString& rFile ) +/*****************************************************************************/ + : + pWordTransformer( NULL ), + aCharSet( RTL_TEXTENCODING_MS_1252 ), + bDefine( FALSE ), + bNextMustBeDefineEOL( FALSE ), + nLevel( 0 ), + nList( LIST_NON ), + nListIndex( 0 ), + nListLevel( 0 ), + bSkipFile( false ), + sProject( sPrj ), + sRoot( sPrjRoot ), + bEnableExport( bWrite ), + bMergeMode( TRUE ), + sMergeSrc( rMergeSource ), + bError( FALSE ), + bReadOver( FALSE ), + bDontWriteOutput( FALSE ), + sFilename( rFile ) +{ + (void) rPrj; + (void) rPrjRoot; + (void) rFile; + pParseQueue = new ParserQueue( *this ); + if( !isInitialized ) InitLanguages( bMergeMode ); + // used when merge is enabled + + // open output stream + if ( bEnableExport ) { + aOutput.Open( String( rOutput, RTL_TEXTENCODING_ASCII_US ), STREAM_STD_WRITE | STREAM_TRUNC ); + aOutput.SetStreamCharSet( RTL_TEXTENCODING_UTF8 ); + aOutput.SetLineDelimiter( LINEEND_CRLF ); + } + +} + +/*****************************************************************************/ +void Export::Init() +/*****************************************************************************/ +{ + // resets the internal status, used before parseing another file + sActPForm = ""; + bDefine = FALSE; + bNextMustBeDefineEOL = FALSE; + nLevel = 0; + nList = LIST_NON; + nListLang = ByteString( String::CreateFromAscii(""),RTL_TEXTENCODING_ASCII_US ); + nListIndex = 0; + while ( aResStack.Count()) { + delete aResStack.GetObject(( ULONG ) 0 ); + aResStack.Remove(( ULONG ) 0 ); + } +} + +/*****************************************************************************/ +Export::~Export() +/*****************************************************************************/ +{ + if( pParseQueue ) + delete pParseQueue; + // close output stream + if ( bEnableExport ) + aOutput.Close(); + while ( aResStack.Count()) { + delete aResStack.GetObject(( ULONG ) 0 ); + aResStack.Remove(( ULONG ) 0 ); + } + + if ( bMergeMode && !bUnmerge ) { + if ( !pMergeDataFile ) + pMergeDataFile = new MergeDataFile( sMergeSrc,sFile , bErrorLog, aCharSet);//, bUTF8 ); + + //pMergeDataFile->WriteErrorLog( sActFileName ); + delete pMergeDataFile; + } +} + +/*****************************************************************************/ +int Export::Execute( int nToken, const char * pToken ) +/*****************************************************************************/ +{ + + ByteString sToken( pToken ); + ByteString sOrig( sToken ); +/* printf("+---------------\n"); + printf("sToken = %s\n",sToken.GetBuffer()); + printf("nToken = %d\n",nToken); + printf("+---------------\n"); */ + BOOL bWriteToMerged = bMergeMode; + + if ( nToken == CONDITION ) { + ByteString sTestToken( pToken ); + sTestToken.EraseAllChars( '\t' ); + sTestToken.EraseAllChars( ' ' ); + if (( !bReadOver ) && ( sTestToken.Search( "#ifndef__RSC_PARSER" ) == 0 )) + bReadOver = TRUE; + else if (( bReadOver ) && ( sTestToken.Search( "#endif" ) == 0 )) + bReadOver = FALSE; + } + if ((( nToken < FILTER_LEVEL ) || ( bReadOver )) && + (!(( bNextMustBeDefineEOL ) && ( sOrig == "\n" )))) { + // this tokens are not mandatory for parsing, so ignore them ... + if ( bMergeMode ) + WriteToMerged( sOrig , false ); // ... ore whrite them directly to dest. + return 0; + } + + ResData *pResData = NULL; + if ( nLevel ) { + // res. exists at cur. level + pResData = aResStack.GetObject( nLevel-1 ); + } + else if (( nToken != RESSOURCE ) && + ( nToken != RESSOURCEEXPR ) && + ( nToken != SMALRESSOURCE ) && + ( nToken != LEVELUP ) && + ( nToken != NORMDEFINE ) && + ( nToken != RSCDEFINE ) && + ( nToken != CONDITION ) && + ( nToken != PRAGMA )) + { + // no res. exists at cur. level so return + if ( bMergeMode ) + WriteToMerged( sOrig , false ); + return 0; + } + // #define NO_LOCALIZE_EXPORT + if( bSkipFile ){ + if ( bMergeMode ) { + WriteToMerged( sOrig , false ); + } + return 1; + } + + + if ( bDefine ) { + if (( nToken != EMPTYLINE ) && ( nToken != LEVELDOWN ) && ( nToken != LEVELUP )) { + // cur. res. defined in macro + if ( bNextMustBeDefineEOL ) { + if ( nToken != RSCDEFINELEND ) { + // end of macro found, so destroy res. + bDefine = FALSE; + if ( bMergeMode ) { + /*if ( bDontWriteOutput && bUnmerge ) { + bDontWriteOutput = FALSE; + bNextMustBeDefineEOL = FALSE; + bDefine = TRUE; + }*/ + MergeRest( pResData ); + } + bNextMustBeDefineEOL = FALSE; + Execute( LEVELDOWN, "" ); + } + else { + // next line also in macro definition + bNextMustBeDefineEOL = FALSE; + if ( bMergeMode ) + WriteToMerged( sOrig , false ); + return 1; + } + } + else if (( nToken != LISTASSIGNMENT ) && ( nToken != UIENTRIES )){ + // cur. line has macro line end + ByteString sTmpLine( sToken ); + sTmpLine.EraseAllChars( '\t' ); sTmpLine.EraseAllChars( ' ' ); + #if 0 + // impossible, unsigned is never negative + if( sTmpLine.Len() < 0 ){ + if ( sTmpLine.GetChar(( USHORT )( sTmpLine.Len() - 1 )) != '\\' ) + bNextMustBeDefineEOL = TRUE; + } + #endif + } + } + } + + BOOL bExecuteDown = FALSE; + if ( nToken != LEVELDOWN ) { + USHORT nOpen = 0; + USHORT nClose = 0; + BOOL bReadOver1 = FALSE; + USHORT i = 0; + for ( i = 0; i < sToken.Len(); i++ ) { + if ( sToken.GetChar( i ) == '\"' ) + bReadOver1 = !bReadOver1; + if ( !bReadOver1 && ( sToken.GetChar( i ) == '{' )) + nOpen++; + } + + bReadOver1 = FALSE; + for ( i = 0; i < sToken.Len(); i++ ) { + if ( sToken.GetChar( i ) == '\"' ) + bReadOver1 = !bReadOver1; + if ( !bReadOver1 && ( sToken.GetChar( i ) == '}' )) + nClose++; + } + + if ( nOpen < nClose ) + bExecuteDown = TRUE; + } + switch ( nToken ) { + + case NORMDEFINE: + //printf("sToken = '%s'",sToken.GetBuffer()); + while( sToken.SearchAndReplace( "\r", " " ) != STRING_NOTFOUND ) {}; + while( sToken.SearchAndReplace( "\t", " " ) != STRING_NOTFOUND ) {}; + while( sToken.SearchAndReplace( " ", " " ) != STRING_NOTFOUND ) {}; + if( sToken.EqualsIgnoreCaseAscii( "#define NO_LOCALIZE_EXPORT" ) ){ + bSkipFile = true; + return 0; + } + if ( bMergeMode ) + WriteToMerged( sOrig , false ); + + return 0; + + + case RSCDEFINE: + bDefine = TRUE; // res. defined in macro + + case RESSOURCE: + case RESSOURCEEXPR: { + bDontWriteOutput = FALSE; + if ( nToken != RSCDEFINE ) + bNextMustBeDefineEOL = FALSE; + // this is the beginning of a new res. + nLevel++; + if ( nLevel > 1 ) { + aResStack.GetObject( nLevel - 2 )->bChild = TRUE; + } + + // create new instance for this res. and fill mandatory fields + + pResData = new ResData( sActPForm, FullId() , sFilename ); + aResStack.Insert( pResData, LIST_APPEND ); + ByteString sBackup( sToken ); + sToken.EraseAllChars( '\n' ); + sToken.EraseAllChars( '\r' ); + sToken.EraseAllChars( '{' ); + while( sToken.SearchAndReplace( "\t", " " ) != STRING_NOTFOUND ) {}; + sToken.EraseTrailingChars( ' ' ); + ByteString sT = sToken.GetToken( 0, ' ' ); + pResData->sResTyp = sT.ToLowerAscii(); + ByteString sId( sToken.Copy( pResData->sResTyp.Len() + 1 )); + ByteString sCondition; + if ( sId.Search( "#" ) != STRING_NOTFOUND ) { + // between ResTyp, Id and paranthes is a precomp. condition + sCondition = "#"; + sCondition += sId.GetToken( 1, '#' ); + sId = sId.GetToken( 0, '#' ); + } + sId = sId.GetToken( 0, '/' ); + CleanValue( sId ); + sId = sId.EraseAllChars( '\t' ); + pResData->SetId( sId, ID_LEVEL_IDENTIFIER ); + if ( sCondition.Len()) { + ByteString sEmpty( "" ); + Execute( CONDITION, sEmpty.GetBufferAccess()); // execute the + // precomp. + // condition + sEmpty.ReleaseBufferAccess(); + } + } + break; + case SMALRESSOURCE: { + bDontWriteOutput = FALSE; + // this is the beginning of a new res. + bNextMustBeDefineEOL = FALSE; + nLevel++; + if ( nLevel > 1 ) { + aResStack.GetObject( nLevel - 2 )->bChild = TRUE; + } + + // create new instance for this res. and fill mandatory fields + + pResData = new ResData( sActPForm, FullId() , sFilename ); + aResStack.Insert( pResData, LIST_APPEND ); + sToken.EraseAllChars( '\n' ); + sToken.EraseAllChars( '\r' ); + sToken.EraseAllChars( '{' ); + sToken.EraseAllChars( '\t' ); + sToken.EraseAllChars( ' ' ); + sToken.EraseAllChars( '\\' ); + pResData->sResTyp = sToken.ToLowerAscii(); + } + break; + case LEVELUP: { + // push + if ( nList ) + nListLevel++; + if ( nList ) + break; + + bDontWriteOutput = FALSE; + ByteString sLowerTyp; + if ( pResData ) + sLowerTyp = "unknown"; + nLevel++; + if ( nLevel > 1 ) { + aResStack.GetObject( nLevel - 2 )->bChild = TRUE; + } + + ResData *pNewData = new ResData( sActPForm, FullId() , sFilename ); + pNewData->sResTyp = sLowerTyp; + aResStack.Insert( pNewData, LIST_APPEND ); + } + break; + case LEVELDOWN: { + // pop + if ( !nList ) { + bDontWriteOutput = FALSE; + if ( nLevel ) { + if ( bDefine && (nLevel == 1 )) { + bDefine = FALSE; + bNextMustBeDefineEOL = FALSE; + } + WriteData( pResData ); + delete aResStack.GetObject( nLevel - 1 ); + aResStack.Remove( nLevel - 1 ); + nLevel--; + } + } + else { + if ( bDefine ) + bNextMustBeDefineEOL = TRUE; + if ( !nListLevel ) { + if ( bMergeMode ) + MergeRest( pResData, MERGE_MODE_LIST ); + nList = LIST_NON; + } + else + nListLevel--; + } + } + break; + case ASSIGNMENT: { + bDontWriteOutput = FALSE; + // interpret different types of assignement + ByteString sKey = sToken.GetToken( 0, '=' ); + sKey.EraseAllChars( ' ' ); + sKey.EraseAllChars( '\t' ); + ByteString sValue = sToken.GetToken( 1, '=' ); + CleanValue( sValue ); + if ( sKey.ToUpperAscii() == "IDENTIFIER" ) { + ByteString sId( sValue.EraseAllChars( '\t' )); + pResData->SetId( sId.EraseAllChars( ' ' ), ID_LEVEL_IDENTIFIER ); + } + else if ( sKey == "HELPID" ) { + pResData->sHelpId = sValue; + } + else if ( sKey == "STRINGLIST" ) { + //if ( bUnmerge ){ + // ( sOrig.SearchAndReplace( "=", "[ de ] =" )); + //} + + pResData->bList = TRUE; + nList = LIST_STRING; + //ByteString sLang("en-US" , RTL_TEXTENCODING_ASCII_US ); + nListLang = SOURCE_LANGUAGE; + nListIndex = 0; + nListLevel = 0; + } + else if ( sKey == "FILTERLIST" ) { + //if ( bUnmerge ){ + // ( sOrig.SearchAndReplace( "=", "[ de ] =" )); + //} + pResData->bList = TRUE; + nList = LIST_FILTER; + //ByteString sLang("en-US" , RTL_TEXTENCODING_ASCII_US ); + nListLang = SOURCE_LANGUAGE; + nListIndex = 0; + nListLevel = 0; + } + else if ( sKey == "UIENTRIES" ) { + //if ( bUnmerge ){ + // ( sOrig.SearchAndReplace( "=", "[ de ] =" ));} + pResData->bList = TRUE; + nList = LIST_UIENTRIES; + //ByteString sLang("en-US" , RTL_TEXTENCODING_ASCII_US ); + nListLang = SOURCE_LANGUAGE; + nListIndex = 0; + nListLevel = 0; + } + if (( sToken.Search( "{" ) != STRING_NOTFOUND ) && + ( sToken.GetTokenCount( '{' ) > sToken.GetTokenCount( '}' ))) + { + //WorkOnTokenSet( LEVELUP, pTkn ); + Parse( LEVELUP, "" ); + } + //if ( bUnmerge && ( nListLang.EqualsIgnoreCaseAscii("de") || nListLang.EqualsIgnoreCaseAscii("en-US") ) && ListExists( pResData, nList )) + // bDontWriteOutput = TRUE; + } + break; + case UIENTRIES: + case LISTASSIGNMENT: { + bDontWriteOutput = FALSE; + ByteString sTmpToken( sToken); + sTmpToken.EraseAllChars(' '); + USHORT nPos = 0; + //nPos = sTmpToken.ToLowerAscii().Search("[de]="); + nPos = sTmpToken.ToLowerAscii().Search("[en-us]="); + if( nPos != STRING_NOTFOUND ) { + //if ( bUnmerge ){ + // ( sOrig.SearchAndReplace( "=", "[ de ] =" )); + //} + ByteString sKey = sTmpToken.Copy( 0 , nPos ); + sKey.EraseAllChars( ' ' ); + sKey.EraseAllChars( '\t' ); + ByteString sValue = sToken.GetToken( 1, '=' ); + CleanValue( sValue ); + if ( sKey.ToUpperAscii() == "STRINGLIST" ) { + pResData->bList = TRUE; + nList = LIST_STRING; + //ByteString sLang("en-US" , RTL_TEXTENCODING_ASCII_US ); + nListLang = SOURCE_LANGUAGE; + nListIndex = 0; + nListLevel = 0; + } + else if ( sKey == "FILTERLIST" ) { + pResData->bList = TRUE; + nList = LIST_FILTER; + //ByteString sLang("en-US" , RTL_TEXTENCODING_ASCII_US ); + nListLang = SOURCE_LANGUAGE; + nListIndex = 0; + nListLevel = 0; + } + // PairedList + else if ( sKey == "PAIREDLIST" ) { + pResData->bList = TRUE; + nList = LIST_PAIRED; + //ByteString sLang("en-US" , RTL_TEXTENCODING_ASCII_US ); + nListLang = SOURCE_LANGUAGE; + nListIndex = 0; + nListLevel = 0; + } + + else if ( sKey == "ITEMLIST" ) { + pResData->bList = TRUE; + nList = LIST_ITEM; + //ByteString sLang("en-US" , RTL_TEXTENCODING_ASCII_US ); + nListLang = SOURCE_LANGUAGE; + nListIndex = 0; + nListLevel = 0; + } + else if ( sKey == "UIENTRIES" ) { + pResData->bList = TRUE; + nList = LIST_UIENTRIES; + //ByteString sLang("en-US" , RTL_TEXTENCODING_ASCII_US ); + nListLang = SOURCE_LANGUAGE; + nListIndex = 0; + nListLevel = 0; + } + /*if ( bUnmerge && ( nListLang.EqualsIgnoreCaseAscii( "de" ) + || nListLang.EqualsIgnoreCaseAscii("en-US" ) ) + && ListExists( pResData, nList )) + bDontWriteOutput = TRUE;*/ + } + else { + // new res. is a String- or FilterList + ByteString sKey = sToken.GetToken( 0, '[' ); + sKey.EraseAllChars( ' ' ); + sKey.EraseAllChars( '\t' ); + if ( sKey.ToUpperAscii() == "STRINGLIST" ) + nList = LIST_STRING; + else if ( sKey == "FILTERLIST" ) + nList = LIST_FILTER; + else if ( sKey == "PAIREDLIST" ) + nList = LIST_PAIRED; // abcd + else if ( sKey == "ITEMLIST" ) + nList = LIST_ITEM; + else if ( sKey == "UIENTRIES" ) + nList = LIST_UIENTRIES; + if ( nList ) { + ByteString sLang=sToken.GetToken( 1, '[' ).GetToken( 0, ']' ); + CleanValue( sLang ); + nListLang = sLang; + /*if (( bUnmerge ) && ( !nListLang.EqualsIgnoreCaseAscii("de")) && ( !nListLang.EqualsIgnoreCaseAscii("en-US"))) + bDontWriteOutput = TRUE;*/ + nListIndex = 0; + nListLevel = 0; + /*if ( bUnmerge && nListLang.EqualsIgnoreCaseAscii("de") && ListExists( pResData, nList ) ) + bDontWriteOutput = TRUE;*/ + } + } + } + break; + case TEXT: + case _LISTTEXT: + case LISTTEXT: { + // this is an entry for a String- or FilterList + if ( nList ) { + SetChildWithText(); + ByteString sEntry( sToken.GetToken( 1, '\"' )); + if ( sToken.GetTokenCount( '\"' ) > 3 ) + sEntry += "\""; + if ( sEntry == "\\\"" ) + sEntry = "\""; + //sEntry = sEntry.Convert( aCharSet, RTL_TEXTENCODING_MS_1252 ); + //sEntry = sEntry.Convert( RTL_TEXTENCODING_MS_1252, RTL_TEXTENCODING_UTF8 ); + InsertListEntry( sEntry, sOrig ); + if ( bMergeMode && ( sEntry != "\"" )) { + PrepareTextToMerge( sOrig, nList, nListLang, pResData ); + } + } + } + break; + case LONGTEXTLINE: + case TEXTLINE: + bDontWriteOutput = FALSE; + if ( nLevel ) { + CutComment( sToken ); + + // this is a text line!!! + ByteString sKey = sToken.GetToken( 0, '=' ).GetToken( 0, '[' ); + sKey.EraseAllChars( ' ' ); + sKey.EraseAllChars( '\t' ); + ByteString sText( GetText( sToken, nToken )); + if ( !bMergeMode ) + sText = sText.Convert( aCharSet, RTL_TEXTENCODING_MS_1252 ); + ByteString sLang; + if ( sToken.GetToken( 0, '=' ).Search( "[" ) != STRING_NOTFOUND ) { + sLang = sToken.GetToken( 0, '=' ).GetToken( 1, '[' ).GetToken( 0, ']' ); + CleanValue( sLang ); + } + ByteString nLangIndex = sLang; + ByteString sOrigKey = sKey; + if ( sText.Len() && sLang.Len() ) { + if (( sKey.ToUpperAscii() == "TEXT" ) || + ( sKey == "MESSAGE" ) || + ( sKey == "CUSTOMUNITTEXT" ) || + ( sKey == "SLOTNAME" ) || + ( sKey == "UINAME" )) + { + //if ( bUnmerge && sToken.GetToken( 0, '=' ).Search( "[" ) == STRING_NOTFOUND ) + // ( sOrig.SearchAndReplace( "=", "[ de ] =" )); + + SetChildWithText(); + //if ( nLangIndex.EqualsIgnoreCaseAscii("en-US") ) + if ( Export::isSourceLanguage( nLangIndex ) ) + pResData->SetId( sText, ID_LEVEL_TEXT ); + + pResData->bText = TRUE; + pResData->sTextTyp = sOrigKey; + if ( bMergeMode ) { + PrepareTextToMerge( sOrig, STRING_TYP_TEXT, nLangIndex, pResData ); + //if ( bUnmerge ) + // pResData->sText[ nLangIndex ] = sText; + } + else { + if ( pResData->sText[ nLangIndex ].Len()) { + ByteString sError( "Language " ); + sError += nLangIndex; + sError += " defined twice"; + } + pResData->sText[ nLangIndex ] = sText; + } + } + else if ( sKey == "HELPTEXT" ) { + //if ( bUnmerge && sToken.GetToken( 0, '=' ).Search( "[" ) == STRING_NOTFOUND ){ + // ( sOrig.SearchAndReplace( "=", "[ de ] =" )); + // } + SetChildWithText(); + pResData->bHelpText = TRUE; + if ( bBreakWhenHelpText ) { + ByteString sError( "\"HelpText\" found in source\n" ); + YYWarning( sError.GetBufferAccess()); + sError.ReleaseBufferAccess(); + SetError(); + } + if ( bMergeMode ) + PrepareTextToMerge( sOrig, STRING_TYP_HELPTEXT, nLangIndex, pResData ); + //if ( bUnmerge ) + // pResData->sHelpText[ nLangIndex ] = sText; + else { + if ( pResData->sHelpText[ nLangIndex ].Len()) { + ByteString sError( "Language " ); + sError += nLangIndex; + sError += " defined twice"; + } + pResData->sHelpText[ nLangIndex ] = sText; + } + } + else if ( sKey == "QUICKHELPTEXT" ) { + //if ( bUnmerge && sToken.GetToken( 0, '=' ).Search( "[" ) == STRING_NOTFOUND ){ + // ( sOrig.SearchAndReplace( "=", "[ de ] =" )); + // } + SetChildWithText(); + pResData->bQuickHelpText = TRUE; + if ( bMergeMode ) + PrepareTextToMerge( sOrig, STRING_TYP_QUICKHELPTEXT, nLangIndex, pResData ); + //if ( bUnmerge ) + // pResData->sQuickHelpText[ nLangIndex ] = sText; + else { + if ( pResData->sQuickHelpText[ nLangIndex ].Len()) { + ByteString sError( "Language " ); + sError += nLangIndex; + sError += " defined twice"; + } + pResData->sQuickHelpText[ nLangIndex ] = sText; + } + } + else if ( sKey == "TITLE" ) { + //if ( bUnmerge && sToken.GetToken( 0, '=' ).Search( "[" ) == STRING_NOTFOUND ){ + // ( sOrig.SearchAndReplace( "=", "[ de ] =" )); + // } + SetChildWithText(); + pResData->bTitle = TRUE; + if ( bMergeMode ) + PrepareTextToMerge( sOrig, STRING_TYP_TITLE, nLangIndex, pResData ); + //if ( bUnmerge ) + // pResData->sTitle[ nLangIndex ] = sText; + else { + if ( pResData->sTitle[ nLangIndex ].Len()) { + ByteString sError( "Language " ); + sError += nLangIndex; + sError += " defined twice"; + } + pResData->sTitle[ nLangIndex ] = sText; + } + } + else if ( sKey == "ACCESSPATH" ) { + pResData->SetId( sText, ID_LEVEL_ACCESSPATH ); + } + else if ( sKey == "FIELDNAME" ) { + pResData->SetId( sText, ID_LEVEL_FIELDNAME ); + } + } + } + break; + case NEWTEXTINRES: { + bDontWriteOutput = TRUE; + // this means something like // ### Achtung : Neuer Text ... + /*ByteString sLang( "GERMAN" ); + ByteString sText = sToken.GetToken( 2, ':' ).GetToken( 0, '*' ); + CleanValue( sText ); + if ( sText.Len()) + pResData->sText[ sLang ] = sText;*/ + } + break; + case APPFONTMAPPING: { + bDontWriteOutput = FALSE; + // this is a AppfontMapping, so look if its a definition + // of field size + ByteString sKey = sToken.GetToken( 0, '=' ); + sKey.EraseAllChars( ' ' ); + sKey.EraseAllChars( '\t' ); + ByteString sMapping = sToken.GetToken( 1, '=' ); + sMapping = sMapping.GetToken( 1, '(' ); + sMapping = sMapping.GetToken( 0, ')' ); + sMapping.EraseAllChars( ' ' ); + sMapping.EraseAllChars( '\t' ); + if ( sKey.ToUpperAscii() == "SIZE" ) { + pResData->nWidth = ( USHORT ) sMapping.GetToken( 0, ',' ).ToInt64(); + } + else if ( sKey == "POSSIZE" ) { + pResData->nWidth = ( USHORT ) sMapping.GetToken( 2, ',' ).ToInt64(); + } + } + break; + case RSCDEFINELEND: + bDontWriteOutput = FALSE; + break; + case CONDITION: { + bDontWriteOutput = FALSE; + while( sToken.SearchAndReplace( "\r", " " ) != STRING_NOTFOUND ) {}; + while( sToken.SearchAndReplace( "\t", " " ) != STRING_NOTFOUND ) {}; + while( sToken.SearchAndReplace( " ", " " ) != STRING_NOTFOUND ) {}; + ByteString sCondition = sToken.GetToken( 0, ' ' ); + if ( sCondition == "#ifndef" ) { + sActPForm = "!defined "; + sActPForm += sToken.GetToken( 1, ' ' ); + } + else if ( sCondition == "#ifdef" ) { + sActPForm = "defined "; + sActPForm += sToken.GetToken( 1, ' ' ); + } + else if ( sCondition == "#if" ) { + sActPForm = sToken.Copy( 4 ); + while ( sActPForm.SearchAndReplace( "||", "\\or" ) != STRING_NOTFOUND ) {}; + } + else if ( sCondition == "#elif" ) { + sActPForm = sToken.Copy( 6 ); + while ( sActPForm.SearchAndReplace( "||", "\\or" ) != STRING_NOTFOUND ) {}; + } + else if ( sCondition == "#else" ) { + sActPForm = sCondition; + } + else if ( sCondition == "#endif" ) { + sActPForm = ""; + } + else break; + if ( nLevel ) { + WriteData( pResData, TRUE ); + pResData->sPForm = sActPForm; + } + } + break; + case EMPTYLINE : { + bDontWriteOutput = FALSE; + if ( bDefine ) { + bNextMustBeDefineEOL = FALSE; + bDefine = FALSE; + while ( nLevel ) + Parse( LEVELDOWN, "" ); + //WorkOnTokenSet( LEVELDOWN, pTkn ); + } + } + break; + case PRAGMA : { + bDontWriteOutput = FALSE; + while( sToken.SearchAndReplace( "\t", " " ) != STRING_NOTFOUND ) {}; + while( sToken.SearchAndReplace( " ", " " ) != STRING_NOTFOUND ) {}; + sToken.EraseLeadingChars( ' ' ); + sToken.EraseTrailingChars( ' ' ); + + ByteString sCharset = sToken.GetToken( 1, ' ' ); + ByteString sSet = sToken.GetToken( 2, ' ' ); + if (( sCharset.ToUpperAscii() == "CHARSET_IBMPC" ) || + ( sCharset == "RTL_TEXTENCODING_IBM_850" ) || + (( sCharset == "CHARSET" ) && ( sSet.ToUpperAscii() == "IBMPC" ))) + { + aCharSet = RTL_TEXTENCODING_IBM_850; + } + else if (( sCharset == "CHARSET_ANSI" ) || + ( sCharset == "RTL_TEXTENCODING_MS_1252" ) || + (( sCharset == "CHARSET" ) && ( sSet.ToUpperAscii() == "ANSI" ))) + { + aCharSet = RTL_TEXTENCODING_MS_1252; + } + } + break; + case TEXTREFID : { + bDontWriteOutput = TRUE; + /*ByteString sK = sToken.GetToken( 0, '=' ); + ByteString sKey = sK.EraseAllChars( '\t' ).EraseAllChars( ' ' ); + ByteString sT = sToken.GetToken( 1, '=' ).GetToken( 0, ';' ); + USHORT nRefId = ( USHORT ) sT.EraseAllChars( '\t' ).EraseAllChars( ' ' ).ToInt32(); + if (( sKey.ToUpperAscii() == "TEXT" ) || + ( sKey == "MESSAGE" ) || + ( sKey == "CUSTOMUNITTEXT" ) || + ( sKey == "SLOTNAME" ) || + ( sKey == "UINAME" )) + pResData->nTextRefId = nRefId; + else if ( sKey == "HELPTEXT" ) + pResData->nHelpTextRefId = nRefId; + else if ( sKey == "QUICKHELPTEXT" ) + pResData->nQuickHelpTextRefId = nRefId; + else if ( sKey == "TITLE" ) + pResData->nTitleRefId = nRefId;*/ + } + } + if ( bWriteToMerged ) { + // the current token must be written to dest. without merging + + if( bDefine && sOrig.Len() > 2 ){ + for( USHORT n = 0 ; n < sOrig.Len() ; n++ ){ + if( sOrig.GetChar( n ) == '\n' && sOrig.GetChar( n-1 ) != '\\'){ + sOrig.Insert('\\' , n++ ); + } + } + } + WriteToMerged( sOrig , false); + } + + if ( bExecuteDown ) { + Parse( LEVELDOWN, "" ); + //WorkOnTokenSet( LEVELDOWN, pTkn ); + } + + return 1; +} + +/*****************************************************************************/ +void Export::CutComment( ByteString &rText ) +/*****************************************************************************/ +{ + if ( rText.Search( "//" ) != STRING_NOTFOUND ) { + ByteString sWork( rText ); + sWork.SearchAndReplaceAll( "\\\"", "XX" ); + USHORT i = 0; + BOOL bInner = FALSE; + + while ( i < sWork.Len() - 1 ) { + if ( sWork.GetChar( i ) == '\"' ) + bInner = !bInner; + else if + (( sWork.GetChar( i ) == '/' ) && + ( !bInner ) && + ( sWork.GetChar( i + 1 ) == '/' )) + { + rText.Erase( i ); + return; + } + i++; + } + } +} + +void Export::UnmergeUTF8( ByteString& sOrig ){ + USHORT nPos1 = sOrig.Search('\"'); + USHORT nPos2 = sOrig.SearchBackward('\"'); + if( nPos1 > 0 && nPos2 > 0 && nPos1 < nPos2){ + ByteString sPart = sOrig.Copy(nPos1+1 , nPos2-1); + ByteString sPartUTF8 = sPart; + sPartUTF8.Convert( RTL_TEXTENCODING_MS_1252 , RTL_TEXTENCODING_UTF8 ); + sOrig.SearchAndReplace( sPart , sPartUTF8 ); + } +} + +/*****************************************************************************/ +BOOL Export::ListExists( ResData *pResData, USHORT nLst ) +/*****************************************************************************/ +{ + switch ( nLst ) { + case LIST_STRING: return pResData->pStringList != NULL; + case LIST_FILTER: return pResData->pFilterList != NULL; + case LIST_ITEM: return pResData->pItemList != NULL; + case LIST_PAIRED: return pResData->pPairedList != NULL; + case LIST_UIENTRIES: return pResData->pUIEntries != NULL; + } + return FALSE; +} + +/*****************************************************************************/ +BOOL Export::WriteData( ResData *pResData, BOOL bCreateNew ) +/*****************************************************************************/ +{ + if ( bMergeMode ) { + MergeRest( pResData ); + return TRUE; + } + + if ( bUnmerge ) + return TRUE; + +/* ByteStringHashMap::iterator pos3 = pResData->sText.begin(); + ByteStringHashMap::iterator end3 = pResData->sText.end(); + for(;pos3!=end3;++pos3){ + + printf("[%s]=%s\n", pos3->first.GetBuffer(), pos3->second.GetBuffer() ); + }*/ + // mandatory to export: en-US + + if (( //pResData->sText[ ByteString("de") ].Len() && + ( pResData->sText[ SOURCE_LANGUAGE ].Len())) + || + ( //pResData->sHelpText[ ByteString("de") ].Len() && + ( pResData->sHelpText[ SOURCE_LANGUAGE ].Len())) + || + ( //pResData->sQuickHelpText[ ByteString("de") ].Len() && + ( pResData->sQuickHelpText[ SOURCE_LANGUAGE ].Len())) + || + ( //pResData->sTitle[ ByteString("de") ].Len() && + ( pResData->sTitle[ SOURCE_LANGUAGE ].Len()))) + + { + FillInFallbacks( pResData ); + + ByteString sGID = pResData->sGId; + ByteString sLID; + if ( !sGID.Len()) + sGID = pResData->sId; + else + sLID = pResData->sId; + + ByteString sXText; + ByteString sXHText; + ByteString sXQHText; + ByteString sXTitle; + + ByteString sTimeStamp( Export::GetTimeStamp()); + ByteString sCur; + + for( unsigned int n = 0; n < aLanguages.size(); n++ ){ + sCur = aLanguages[ n ]; + if ( !sCur.EqualsIgnoreCaseAscii("x-comment") ){ + if ( pResData->sText[ sCur ].Len()) + sXText = pResData->sText[ sCur ]; + else { + sXText = pResData->sText[ SOURCE_LANGUAGE ]; + /*if ( !sXText.Len()) + sXText = pResData->sText[ ByteString("en") ]; + if ( !sXText.Len()) + sXText = pResData->sText[ ByteString("de") ];*/ + } + + if ( pResData->sHelpText[ sCur ].Len()) + sXHText = pResData->sHelpText[ sCur ]; + else { + sXHText = pResData->sHelpText[ SOURCE_LANGUAGE ]; + /*if ( !sXHText.Len()) + sXHText = pResData->sHelpText[ ByteString("en") ]; + if ( !sXText.Len()) + sXHText = pResData->sHelpText[ ByteString("de") ];*/ + } + + if ( pResData->sQuickHelpText[ sCur ].Len()) + sXQHText = pResData->sQuickHelpText[ sCur ]; + else { + sXQHText = pResData->sQuickHelpText[ SOURCE_LANGUAGE ]; + /*if ( !sXQHText.Len()) + sXQHText = pResData->sQuickHelpText[ ByteString("en") ]; + if ( !sXQHText.Len()) + sXQHText = pResData->sQuickHelpText[ ByteString("de") ];*/ + } + + if ( pResData->sTitle[ sCur ].Len()) + sXTitle = pResData->sTitle[ sCur ]; + else { + sXTitle = pResData->sTitle[ SOURCE_LANGUAGE ]; + /*if ( !sXTitle.Len()) + sXTitle = pResData->sTitle[ ByteString("en") ]; + if ( !sXTitle.Len()) + sXTitle = pResData->sTitle[ ByteString("de") ];*/ + } + + if ( !sXText.Len()) + sXText = "-"; + + if ( !sXHText.Len()) { + /*if ( pResData->sHelpText[ ByteString("de") ].Len()) + sXHText = pResData->sHelpText[ ByteString("de") ];*/ + if ( pResData->sHelpText[ SOURCE_LANGUAGE ].Len()) + sXHText = pResData->sHelpText[ SOURCE_LANGUAGE ]; + /*else if ( pResData->sHelpText[ ByteString("en") ].Len()) + sXHText = pResData->sHelpText[ ByteString("en") ];*/ + } + } + else + sXText = pResData->sText[ sCur ]; + + if ( bEnableExport ) { + ByteString sOutput( sProject ); sOutput += "\t"; + if ( sRoot.Len()) + sOutput += sActFileName; + sOutput += "\t0\t"; + sOutput += pResData->sResTyp; sOutput += "\t"; + sOutput += sGID; sOutput += "\t"; + sOutput += sLID; sOutput += "\t"; + sOutput += pResData->sHelpId; sOutput += "\t"; + sOutput += pResData->sPForm; sOutput += "\t"; + sOutput += ByteString::CreateFromInt64( pResData->nWidth ); sOutput += "\t"; + sOutput += sCur; sOutput += "\t"; + + + sOutput += sXText; sOutput += "\t"; + sOutput += sXHText; sOutput += "\t"; + sOutput += sXQHText; sOutput+= "\t"; + sOutput += sXTitle; sOutput += "\t"; + sOutput += sTimeStamp; + + // if( !sCur.EqualsIgnoreCaseAscii("de") ||( sCur.EqualsIgnoreCaseAscii("de") && !Export::isMergingGermanAllowed( sProject ) ) ) + aOutput.WriteLine( sOutput ); + } + + if ( bCreateNew ) { + pResData->sText[ sCur ] = ""; + pResData->sHelpText[ sCur ] = ""; + pResData->sQuickHelpText[ sCur ]= ""; + pResData->sTitle[ sCur ] = ""; + } + } + } + FillInFallbacks( pResData ); + if ( pResData->pStringList ) { + ByteString sList( "stringlist" ); + WriteExportList( pResData, pResData->pStringList, sList, bCreateNew ); + if ( bCreateNew ) + pResData->pStringList = 0; + } + if ( pResData->pFilterList ) { + ByteString sList( "filterlist" ); + WriteExportList( pResData, pResData->pFilterList, sList, bCreateNew ); + if ( bCreateNew ) + pResData->pFilterList = 0; + } + if ( pResData->pItemList ) { + ByteString sList( "itemlist" ); + WriteExportList( pResData, pResData->pItemList, sList, bCreateNew ); + if ( bCreateNew ) + pResData->pItemList = 0; + } + if ( pResData->pPairedList ) { + ByteString sList( "pairedlist" ); + WriteExportList( pResData, pResData->pPairedList, sList, bCreateNew ); + if ( bCreateNew ) + pResData->pItemList = 0; + } + if ( pResData->pUIEntries ) { + ByteString sList( "uientries" ); + WriteExportList( pResData, pResData->pUIEntries, sList, bCreateNew ); + if ( bCreateNew ) + pResData->pUIEntries = 0; + } + return TRUE; +} +ByteString Export::GetPairedListID( const ByteString& sText ){ +// < "STRING" ; IDENTIFIER ; > ; + ByteString sIdent = sText.GetToken( 1, ';' ); + sIdent.ToUpperAscii(); + while( sIdent.SearchAndReplace( "\t", " " ) != STRING_NOTFOUND ) {}; + sIdent.EraseTrailingChars( ' ' ); + sIdent.EraseLeadingChars( ' ' ); + return sIdent; +} +ByteString Export::GetPairedListString( const ByteString& sText ){ +// < "STRING" ; IDENTIFIER ; > ; + ByteString sString = sText.GetToken( 0, ';' ); + while( sString.SearchAndReplace( "\t", " " ) != STRING_NOTFOUND ) {}; + sString.EraseTrailingChars( ' ' ); + ByteString s1 = sString.Copy( sString.Search( '\"' )+1 ); + sString = s1.Copy( 0 , s1.SearchBackward( '\"' ) ); + sString.EraseTrailingChars( ' ' ); + sString.EraseLeadingChars( ' ' ); + return sString; +} +ByteString Export::StripList( const ByteString& sText ){ + ByteString s1 = sText.Copy( sText.Search( '\"' ) + 1 ); + return s1.Copy( 0 , s1.SearchBackward( '\"' ) ); +} + +/*****************************************************************************/ +BOOL Export::WriteExportList( ResData *pResData, ExportList *pExportList, + const ByteString &rTyp, BOOL bCreateNew ) +/*****************************************************************************/ +{ + ByteString sGID = pResData->sGId; + if ( !sGID.Len()) + sGID = pResData->sId; + else { + sGID += "."; + sGID += pResData->sId; + sGID.EraseTrailingChars( '.' ); + } + + ByteString sTimeStamp( Export::GetTimeStamp()); + ByteString sCur; + for ( ULONG i = 0; pExportList != NULL && i < pExportList->Count(); i++ ) { + ExportListEntry *pEntry = pExportList->GetObject( i ); + // mandatory for export: german and eng. and/or enus + //ByteString a("Export::WriteExportList::pEntry"); + //Export::DumpMap( a, *pEntry ); + + ByteString sLID( ByteString::CreateFromInt64( i + 1 )); + for( unsigned int n = 0; n < aLanguages.size(); n++ ){ + sCur = aLanguages[ n ]; + if ( //1 ) + //(*pEntry)[ ByteString("de") ].Len() && + (*pEntry)[ SOURCE_LANGUAGE ].Len() ) + //|| + // (*pEntry)[ ByteString("en") ].Len())) + { + if ( bEnableExport ) + { + ByteString sText((*pEntry)[ SOURCE_LANGUAGE ] ); + + // Strip PairList Line String + if( rTyp.EqualsIgnoreCaseAscii("pairedlist") ){ + sLID = GetPairedListID( sText ); + if ((*pEntry)[ sCur ].Len()) + sText = (*pEntry)[ sCur ]; + sText = GetPairedListString( sText ); + } + else{ + //if ((*pEntry)[ sCur ].Len()){ + // if( sCur.EqualsIgnoreCaseAscii("de") ){ + // sText = StripList( (*pEntry)[ sCur ] ); + // } + // else + sText = StripList( (*pEntry)[ sCur ] ); + if( sText == "\\\"" ) + sText = "\""; + //} + } + + ByteString sOutput( sProject ); sOutput += "\t"; + if ( sRoot.Len()) + sOutput += sActFileName; + sOutput += "\t0\t"; + sOutput += rTyp; sOutput += "\t"; + sOutput += sGID; sOutput += "\t"; + sOutput += sLID; sOutput += "\t\t"; + sOutput += pResData->sPForm; sOutput += "\t0\t"; + sOutput += sCur; sOutput += "\t"; + + sOutput += sText; sOutput += "\t\t\t\t"; + sOutput += sTimeStamp; + + //if( !sCur.EqualsIgnoreCaseAscii("de") ||( sCur.EqualsIgnoreCaseAscii("de") && !Export::isMergingGermanAllowed( sProject ) ) ) + aOutput.WriteLine( sOutput ); + + } + } + } + if ( bCreateNew ) + delete [] pEntry; + } + if ( bCreateNew ) + delete pExportList; + + return TRUE; +} + +/*****************************************************************************/ +ByteString Export::FullId() +/*****************************************************************************/ +{ + ByteString sFull; + if ( nLevel > 1 ) { + sFull = aResStack.GetObject( 0 )->sId; + for ( USHORT i = 1; i < nLevel - 1; i++ ) { + ByteString sToAdd = aResStack.GetObject( i )->sId; + if ( sToAdd.Len()) { + sFull += "."; + sFull += sToAdd; + } + } + } + if ( sFull.Len() > 255 ) { + ByteString sError( "GroupId > 255 chars" ); + printf("GroupID = %s\n",sFull.GetBuffer()); + yyerror( sError.GetBufferAccess()); + sError.ReleaseBufferAccess(); + } + + return sFull; +} + +/*****************************************************************************/ +void Export::InsertListEntry( const ByteString &rText, const ByteString &rLine ) +/*****************************************************************************/ +{ + ResData *pResData = aResStack.GetObject( nLevel-1 ); + + ExportList *pList = NULL; + if ( nList == LIST_STRING ) { + pList = pResData->pStringList; + if ( !pList ) { + pResData->pStringList = new ExportList(); + pList = pResData->pStringList; + nListIndex = 0; + } + } + else if ( nList == LIST_FILTER ) { + pList = pResData->pFilterList; + if ( !pList ) { + pResData->pFilterList = new ExportList(); + pList = pResData->pFilterList; + nListIndex = 0; + } + } + else if ( nList == LIST_ITEM ) { + pList = pResData->pItemList; + if ( !pList ) { + pResData->pItemList = new ExportList(); + pList = pResData->pItemList; + nListIndex = 0; + } + } + else if ( nList == LIST_PAIRED ) { + pList = pResData->pPairedList; + if ( !pList ) { + pResData->pPairedList = new ExportList(); + pList = pResData->pPairedList; + nListIndex = 0; + } + } + else if ( nList == LIST_UIENTRIES ) { + pList = pResData->pUIEntries; + if ( !pList ) { + pResData->pUIEntries = new ExportList(); + pList = pResData->pUIEntries; + nListIndex = 0; + } + } + else + return; + + if ( nListIndex + 1 > pList->Count()) { + ExportListEntry *pNew = new ExportListEntry(); + (*pNew)[ LIST_REFID ] = ByteString::CreateFromInt32( REFID_NONE ); + pList->Insert( pNew, LIST_APPEND ); + } + ExportListEntry *pCurEntry = pList->GetObject( nListIndex ); + + // For paired list use the line to set proper lid + if( nList == LIST_PAIRED ){ + (*pCurEntry)[ nListLang ] = rLine; + }else + (*pCurEntry)[ nListLang ] = rText; + + // Remember en-US fallback string, so each list has the same amount of elements + //if ( nListLang.EqualsIgnoreCaseAscii("en-US") ) { + if ( Export::isSourceLanguage( nListLang ) ) { + if( nList == LIST_PAIRED ){ + const ByteString sPlist("pairedlist"); + ByteString sKey = MergeDataFile::CreateKey( sPlist , pResData->sId , GetPairedListID( rLine ) , sFilename ); + pResData->addFallbackData( sKey , rText ); + } + // new fallback + else{ + const ByteString sPlist("list"); + ByteString a( pResData->sGId ); + a.Append( "." ); + a.Append( pResData->sId ); + sal_Int64 x = nListIndex+1; + ByteString b( ByteString::CreateFromInt64( x ) ); + ByteString sKey = MergeDataFile::CreateKey( sPlist , a , b , sFilename ); + pResData->addFallbackData( sKey , rText ); + } + // new fallback + } + + //if ( nListLang.EqualsIgnoreCaseAscii("en-US") ) { + if ( Export::isSourceLanguage( nListLang ) ) { + if( nList == LIST_PAIRED ){ + (*pCurEntry)[ SOURCE_LANGUAGE ] = rLine; + } + else + (*pCurEntry)[ SOURCE_LANGUAGE ] = rLine; + + pList->NewSourceLanguageListEntry(); + } + + //printf("Export::InsertListEntry ResData.id = %s ResData.ListData = %s\n",pResData->sId.GetBuffer() ,(*pCurEntry)[ nListLang ].GetBuffer()); + nListIndex++; +} + +/*****************************************************************************/ +void Export::CleanValue( ByteString &rValue ) +/*****************************************************************************/ +{ + while ( rValue.Len()) { + if (( rValue.GetChar( 0 ) == ' ' ) || ( rValue.GetChar( 0 ) == '\t' )) + rValue = rValue.Copy( 1 ); + else + break; + } + + if ( rValue.Len()) { + for ( USHORT i = rValue.Len() - 1; i > 0; i-- ) { + if (( rValue.GetChar( i ) == ' ' ) || ( rValue.GetChar( i ) == '\t' ) || + ( rValue.GetChar( i ) == '\n' ) || ( rValue.GetChar( i ) == ';' ) || + ( rValue.GetChar( i ) == '{' ) || ( rValue.GetChar( i ) == '\\' ) || + ( rValue.GetChar( i ) == '\r' )) + rValue.Erase( i ); + else + break; + } + } +} + + +/*****************************************************************************/ +ByteString Export::GetText( const ByteString &rSource, int nToken ) +/*****************************************************************************/ +#define TXT_STATE_NON 0x000 +#define TXT_STATE_TEXT 0x001 +#define TXT_STATE_MACRO 0x002 +{ + ByteString sReturn; + switch ( nToken ) { + case TEXTLINE: + case LONGTEXTLINE: { + ByteString sTmp( rSource.Copy( rSource.Search( "=" ))); + CleanValue( sTmp ); + sTmp.EraseAllChars( '\n' ); + sTmp.EraseAllChars( '\r' ); + + while ( sTmp.SearchAndReplace( "\\\\\"", "-=<[BSlashBSlashHKom]>=-\"" ) + != STRING_NOTFOUND ) {}; + while ( sTmp.SearchAndReplace( "\\\"", "-=<[Hochkomma]>=-" ) + != STRING_NOTFOUND ) {}; + while ( sTmp.SearchAndReplace( "\\", "-=<[0x7F]>=-" ) + != STRING_NOTFOUND ) {}; + while ( sTmp.SearchAndReplace( "\\0x7F", "-=<[0x7F]>=-" ) + != STRING_NOTFOUND ) {}; + + USHORT nStart = 0; + USHORT nState = TXT_STATE_MACRO; + + nState = TXT_STATE_TEXT; + nStart = 1; + + + for ( USHORT i = nStart; i < sTmp.GetTokenCount( '\"' ); i++ ) { + ByteString sToken = sTmp.GetToken( i, '\"' ); + if ( sToken.Len()) { + if ( nState == TXT_STATE_TEXT ) { + sReturn += sToken; + nState = TXT_STATE_MACRO; + } + else { + while( sToken.SearchAndReplace( "\t", " " ) != + STRING_NOTFOUND ) {}; + while( sToken.SearchAndReplace( " ", " " ) != + STRING_NOTFOUND ) {}; + sToken.EraseLeadingChars( ' ' ); + sToken.EraseTrailingChars( ' ' ); + if ( sToken.Len()) { + sReturn += "\\\" "; + sReturn += sToken; + sReturn += " \\\""; + } + nState = TXT_STATE_TEXT; + } + } + } + + while ( sReturn.SearchAndReplace( "-=<[0x7F]>=-", "" ) + != STRING_NOTFOUND ) {}; + while ( sReturn.SearchAndReplace( "-=<[Hochkomma]>=-", "\"" ) + != STRING_NOTFOUND ) {}; + while ( sReturn.SearchAndReplace( "-=<[BSlashBSlashHKom]>=-", "\\\\" ) + != STRING_NOTFOUND ) {}; + + + while ( sReturn.SearchAndReplace( "\\\\", "-=<[BSlashBSlash]>=-" ) + != STRING_NOTFOUND ) {}; + while ( sReturn.SearchAndReplace( "-=<[BSlashBSlash]>=-", "\\" ) + != STRING_NOTFOUND ) {}; + + } + break; + } + return sReturn; +} + +/*****************************************************************************/ +void Export::WriteToMerged( const ByteString &rText , bool bSDFContent ) +/*****************************************************************************/ +{ + static ByteString SLASH ('\\'); + static ByteString RETURN ('\n'); + //printf("%s\n",rText.GetBuffer() ); + + #if 0 + // statement has no effect + if( pParseQueue->bMflag && !bSDFContent ) pParseQueue->bMflag; + #endif + + if ( !bDontWriteOutput || !bUnmerge ) { + ByteString sText( rText ); + while ( sText.SearchAndReplace( " \n", "\n" ) != STRING_NOTFOUND ) {}; + if( pParseQueue->bNextIsM && bSDFContent && sText.Len() > 2 ){ + for( USHORT n = 0 ; n < sText.Len() ; n++ ){ + if( sText.GetChar( n ) == '\n' && sText.GetChar( n-1 ) != '\\'){ + sText.Insert('\\' , n++ ); + + } + } + } + else if( pParseQueue->bLastWasM && sText.Len() > 2 ){ + for( USHORT n = 0 ; n < sText.Len() ; n++ ){ + if( sText.GetChar( n ) == '\n' && sText.GetChar( n-1 ) != '\\'){ + sText.Insert('\\' , n++ ); + } + if( sText.GetChar( n ) == '\n' )pParseQueue->bMflag=true; + } + } + else if( pParseQueue->bCurrentIsM && bSDFContent && sText.Len() > 2 ){ + for( USHORT n = 0 ; n < sText.Len() ; n++ ){ + if( sText.GetChar( n ) == '\n' && sText.GetChar( n-1 ) != '\\'){ + sText.Insert('\\' , n++ ); + pParseQueue->bMflag=true; + } + } + } + else if( pParseQueue->bMflag ){ + for( USHORT n = 1 ; n < sText.Len() ; n++ ){ + if( sText.GetChar( n ) == '\n' && sText.GetChar( n-1 ) != '\\'){ + sText.Insert('\\' , n++ ); + } + } + } + for ( USHORT i = 0; i < sText.Len(); i++ ) { + if ( sText.GetChar( i ) != '\n' ){ + aOutput.Write( ByteString( sText.GetChar( i )).GetBuffer(), 1 ); + + } + else{ + aOutput.WriteLine( ByteString()); + } + + } + } +} + +/*****************************************************************************/ +void Export::ConvertMergeContent( ByteString &rText ) +/*****************************************************************************/ +{ + BOOL bNoOpen = ( rText.Search( "\\\"" ) != 0 ); + ByteString sClose( rText.Copy( rText.Len() - 2 )); + BOOL bNoClose = ( sClose != "\\\"" ); + ByteString sNew; + for ( USHORT i = 0; i < rText.Len(); i++ ) { + ByteString sChar( rText.GetChar( i )); + if ( sChar == "\\" ) { + if (( i + 1 ) < rText.Len()) { + ByteString sNext( rText.GetChar( i + 1 )); + if ( sNext == "\"" ) { + sChar = "\""; + i++; + } + else if ( sNext == "n" ) { + sChar = "\\n"; + i++; + } + else if ( sNext == "t" ) { + sChar = "\\t"; + i++; + } + else if ( sNext == "\'" ) { + sChar = "\\\'"; + i++; + } + else + sChar = "\\\\"; + } + else { + sChar = "\\\\"; + } + } + else if ( sChar == "\"" ) { + sChar = "\\\""; + } + else if ( sChar == "" ) { + sChar = "\\0x7F"; + } + sNew += sChar; + } + + rText = sNew; + + if ( bNoOpen ) { + ByteString sTmp( rText ); + rText = "\""; + rText += sTmp; + } + if ( bNoClose ) + rText += "\""; +} + +/*****************************************************************************/ +BOOL Export::PrepareTextToMerge( ByteString &rText, USHORT nTyp, + ByteString &nLangIndex, ResData *pResData ) +/*****************************************************************************/ +{ + // position to merge in: + USHORT nStart = 0; + USHORT nEnd = 0; + ByteString sOldId = pResData->sId; + ByteString sOldGId = pResData->sGId; + ByteString sOldTyp = pResData->sResTyp; + + ByteString sOrigText( rText ); + + switch ( nTyp ) { + case LIST_STRING : + case LIST_UIENTRIES : + case LIST_FILTER : + case LIST_PAIRED: + case LIST_ITEM : + { + if ( bUnmerge ) + return TRUE; + + ExportList *pList = NULL; + switch ( nTyp ) { + case LIST_STRING : { + pResData->sResTyp = "stringlist"; + pList = pResData->pStringList; + } + break; + case LIST_UIENTRIES : { + pResData->sResTyp = "uientries"; + pList = pResData->pUIEntries; + } + break; + case LIST_FILTER : { + pResData->sResTyp = "filterlist"; + pList = pResData->pFilterList; + } + break; + case LIST_ITEM : { + pResData->sResTyp = "itemlist"; + pList = pResData->pItemList; + } + break; + case LIST_PAIRED : { + pResData->sResTyp = "pairedlist"; + pList = pResData->pPairedList; + } + break; + + } + if ( pList ) { + ExportListEntry *pCurEntry = pList->GetObject( nListIndex - 1 ); + if ( pCurEntry ) { + //printf("%s\n",Export::DumpMap( "pCurEntry", *pCurEntry ).GetBuffer() ); + //ByteString a("pCurEntry"); + //Export::DumpMap( a , *pCurEntry ); + rText = (*pCurEntry)[ SOURCE_LANGUAGE ]; + if( nTyp == LIST_PAIRED ){ + pResData->addMergedLanguage( nLangIndex ); + } + } + } + + nStart = rText.Search( "\"" ); + if ( nStart == STRING_NOTFOUND ) { + rText = sOrigText; + return FALSE; + } + + BOOL bFound = FALSE; + for ( nEnd = nStart + 1; nEnd < rText.Len() && !bFound; nEnd++ ) { + if ( rText.GetChar( nEnd ) == '\"' ) + bFound = TRUE; + } + if ( !bFound ) { + rText = sOrigText; + return FALSE; + } + + nEnd --; + sLastListLine = rText; + if (( sLastListLine.Search( ">" ) != STRING_NOTFOUND ) && + ( sLastListLine.Search( "<" ) == STRING_NOTFOUND )) + { + ByteString sTmp = sLastListLine; + sLastListLine = "<"; + sLastListLine += sTmp; + } + if ( pResData->sResTyp.EqualsIgnoreCaseAscii( "pairedlist" ) ){ + pResData->sId = GetPairedListID( sLastListLine ); + } + else pResData->sId = ByteString::CreateFromInt32( nListIndex ); + + if ( pResData->sGId.Len()) + pResData->sGId += "."; + pResData->sGId += sOldId; + nTyp = STRING_TYP_TEXT; + } + break; + case STRING_TYP_TEXT : + case STRING_TYP_HELPTEXT : + case STRING_TYP_QUICKHELPTEXT : + case STRING_TYP_TITLE : + { + /*if ( bUnmerge ) { + if (( nLangIndex != ByteString("de") ) && + ( nLangIndex != ByteString("en-US") )) + { + bDontWriteOutput = TRUE; + } + return TRUE; + }*/ + + nStart = rText.Search( "=" ); + if ( nStart == STRING_NOTFOUND ) { + rText = sOrigText; + return FALSE; + } + + nStart++; + BOOL bFound = FALSE; + while(( nStart < rText.Len()) && !bFound ) { + if (( rText.GetChar( nStart ) != ' ' ) && ( rText.GetChar( nStart ) != '\t' )) + bFound = TRUE; + else + nStart ++; + } + + // no start position found + if ( !bFound ) { + rText = sOrigText; + return FALSE; + } + + // position to end mergeing in + nEnd = rText.Len() - 1; + bFound = FALSE; + + while (( nEnd > nStart ) && !bFound ) { + if (( rText.GetChar( nEnd ) != ' ' ) && ( rText.GetChar( nEnd ) != '\t' ) && + ( rText.GetChar( nEnd ) != '\n' ) && ( rText.GetChar( nEnd ) != ';' ) && + ( rText.GetChar( nEnd ) != '{' ) && ( rText.GetChar( nEnd ) != '\\' )) + { + bFound = TRUE; + } + else + nEnd --; + } + } + break; + } + + // search for merge data + if ( !pMergeDataFile ){ + pMergeDataFile = new MergeDataFile( sMergeSrc, sFile , bErrorLog, aCharSet);//, bUTF8 ); + + // Init Languages + ByteString sTmp = Export::sLanguages; + if( sTmp.ToUpperAscii().Equals("ALL") ) + SetLanguages( pMergeDataFile->GetLanguages() ); + else if( !isInitialized )InitLanguages(); + + } +// printf("*************DUMPING****************\n"); +// printf("%s\n",pMergeDataFile->Dump().GetBuffer()); +// printf("*************DUMPING****************\n"); + +// printf("Dumping ResData\n"); +// pResData->Dump(); + PFormEntrys *pEntrys = pMergeDataFile->GetPFormEntrys( pResData ); + //printf("Dumping pEntrys\n"); + //if( pEntrys ) pEntrys->Dump(); + pResData->sId = sOldId; + pResData->sGId = sOldGId; + pResData->sResTyp = sOldTyp; + + if ( !pEntrys ) { + rText = sOrigText; + return FALSE; // no data found + } + + ByteString sContent; + pEntrys->GetText( sContent, nTyp, nLangIndex ); + //if ( !sContent.Len() && ( ! nLangIndex.EqualsIgnoreCaseAscii("en-US") )) { + if ( !sContent.Len() && ( ! Export::isSourceLanguage( nLangIndex ) )) { + rText = sOrigText; + return FALSE; // no data found + } + + //if ( nLangIndex.EqualsIgnoreCaseAscii("en-US") ) { + if ( Export::isSourceLanguage( nLangIndex ) ) { + return FALSE; + } + + ByteString sPostFix( rText.Copy( ++nEnd )); + rText.Erase( nStart ); + + //ConvertMergeContent( sContent, nTyp ); + ConvertMergeContent( sContent ); + + + + //printf("Merged %s\n",nLangIndex.GetBuffer()); + // merge new res. in text line + rText += sContent; + rText += sPostFix; + + return TRUE; +} + +/*****************************************************************************/ +void Export::MergeRest( ResData *pResData, USHORT nMode ) +/*****************************************************************************/ +{ + //if ( bUnmerge ) { return;} + + //pResData->Dump(); + + if ( !pMergeDataFile ){ + pMergeDataFile = new MergeDataFile( sMergeSrc, sFile ,bErrorLog, aCharSet);//, bUTF8 ); + + // Init Languages + ByteString sTmp = Export::sLanguages; + if( sTmp.ToUpperAscii().Equals("ALL") ) + SetLanguages( pMergeDataFile->GetLanguages() ); + else if( !isInitialized )InitLanguages(); + + } + switch ( nMode ) { + case MERGE_MODE_NORMAL : { + PFormEntrys *pEntry = pMergeDataFile->GetPFormEntrys( pResData ); + + bool bWriteNoSlash = false; + if ( pEntry && pResData->bText ) { + + BOOL bAddSemikolon = FALSE; + BOOL bFirst = TRUE; + ByteString sCur; + ByteString sTmp = Export::sLanguages; + + for( unsigned int n = 0; n < aLanguages.size(); n++ ){ + sCur = aLanguages[ n ]; + + ByteString sText; + BOOL bText = pEntry->GetText( sText, STRING_TYP_TEXT, sCur , TRUE ); + if ( bText && sText.Len() && sText != "-" ) { + ByteString sOutput; + if ( bNextMustBeDefineEOL) { + if ( bFirst ) + sOutput += "\t\\\n"; + else + sOutput += ";\t\\\n"; + } + bFirst=FALSE; + sOutput += "\t"; + sOutput += pResData->sTextTyp; + //if ( !sCur.EqualsIgnoreCaseAscii("en-US")) { + if ( ! Export::isSourceLanguage( sCur ) ) { + sOutput += "[ "; + sOutput += sCur; + sOutput += " ] "; + } + sOutput += "= "; + ConvertMergeContent( sText ); + sOutput += sText; + + if ( bDefine && bWriteNoSlash ) + sOutput += ";\n"; + + if ( bDefine ) + sOutput += ";\\\n"; + else if ( !bNextMustBeDefineEOL ) + sOutput += ";\n"; + else + bAddSemikolon = TRUE; + for ( USHORT j = 1; j < nLevel; j++ ) + sOutput += "\t"; + WriteToMerged( sOutput , true ); + } + } + + + if ( bAddSemikolon ) { + ByteString sOutput( ";" ); + WriteToMerged( sOutput , false ); + } + } + + if ( pEntry && pResData->bQuickHelpText ) { + BOOL bAddSemikolon = FALSE; + BOOL bFirst = TRUE; + ByteString sCur; + + for( unsigned int n = 0; n < aLanguages.size(); n++ ){ + sCur = aLanguages[ n ]; + + ByteString sText; + BOOL bText = pEntry->GetText( sText, STRING_TYP_QUICKHELPTEXT, sCur, TRUE ); + if ( bText && sText.Len() && sText != "-" ) { + ByteString sOutput; + if ( bNextMustBeDefineEOL) { + if ( bFirst ) + sOutput += "\t\\\n"; + else + sOutput += ";\t\\\n"; + } + bFirst=FALSE; + sOutput += "\t"; + sOutput += "QuickHelpText"; + //if ( !sCur.EqualsIgnoreCaseAscii("en-US") ) { + if ( ! Export::isSourceLanguage( sCur ) ) { + sOutput += "[ "; + sOutput += sCur; + sOutput += " ] "; + } + sOutput += "= "; + ConvertMergeContent( sText ); + sOutput += sText; + if ( bDefine ) + sOutput += ";\\\n"; + else if ( !bNextMustBeDefineEOL ) + sOutput += ";\n"; + else + bAddSemikolon = TRUE; + for ( USHORT j = 1; j < nLevel; j++ ) + sOutput += "\t"; + WriteToMerged( sOutput ,true ); + } + } + if ( bAddSemikolon ) { + ByteString sOutput( ";" ); + WriteToMerged( sOutput , false ); + } + } + + if ( pEntry && pResData->bTitle ) { + BOOL bAddSemikolon = FALSE; + BOOL bFirst = TRUE; + ByteString sCur; + + for( unsigned int n = 0; n < aLanguages.size(); n++ ){ + sCur = aLanguages[ n ]; + + ByteString sText; + BOOL bText = pEntry->GetText( sText, STRING_TYP_TITLE, sCur, TRUE ); + if ( bText && sText.Len() && sText != "-" ) { + ByteString sOutput; + if ( bNextMustBeDefineEOL) { + if ( bFirst ) + sOutput += "\t\\\n"; + else + sOutput += ";\t\\\n"; + } + bFirst=FALSE; + sOutput += "\t"; + sOutput += "Title"; + //if ( !sCur.EqualsIgnoreCaseAscii("en-US") ) { + if ( ! Export::isSourceLanguage( sCur ) ) { + sOutput += "[ "; + sOutput += sCur; + sOutput += " ] "; + } + sOutput += "= "; + ConvertMergeContent( sText ); + sOutput += sText; + if ( bDefine ) + sOutput += ";\\\n"; + else if ( !bNextMustBeDefineEOL ) + sOutput += ";\n"; + else + bAddSemikolon = TRUE; + for ( USHORT j = 1; j < nLevel; j++ ) + sOutput += "\t"; + WriteToMerged( sOutput ,true ); + } + } + if ( bAddSemikolon ) { + ByteString sOutput( ";" ); + WriteToMerged( sOutput ,false); + } + } + // Merge Lists + + if ( pResData->bList ) { + //printf("Dumping ResData\n"); + //pResData->Dump(); + + bool bPairedList = false; + ByteString sOldId = pResData->sId; + ByteString sOldGId = pResData->sGId; + ByteString sOldTyp = pResData->sResTyp; + if ( pResData->sGId.Len()) + pResData->sGId += "."; + pResData->sGId += sOldId; + ByteString sSpace; + for ( USHORT i = 1; i < nLevel-1; i++ ) + sSpace += "\t"; + for ( USHORT nT = LIST_STRING; nT <= LIST_UIENTRIES; nT++ ) { + ExportList *pList = NULL; + switch ( nT ) { + case LIST_STRING : pResData->sResTyp = "stringlist"; pList = pResData->pStringList; bPairedList = false; break; + case LIST_FILTER : pResData->sResTyp = "filterlist"; pList = pResData->pFilterList; bPairedList = false; break; + case LIST_UIENTRIES : pResData->sResTyp = "uientries"; pList = pResData->pUIEntries;bPairedList = false; break; + case LIST_ITEM : pResData->sResTyp = "itemlist"; pList = pResData->pItemList; bPairedList = false; break; + case LIST_PAIRED : pResData->sResTyp = "pairedlist"; pList = pResData->pPairedList; bPairedList = true; break; + } + ByteString sCur; + for( unsigned int n = 0; n < aLanguages.size(); n++ ){ + sCur = aLanguages[ n ]; + USHORT nIdx = 1; + + // Set matching pairedlist identifier + if( bPairedList && pResData->pPairedList && ( nIdx == 1 ) ){ + ExportListEntry* pListE = ( ExportListEntry* ) pResData->pPairedList->GetObject( nIdx-1 ); + pResData->sId = GetPairedListID ( (*pListE)[ SOURCE_LANGUAGE ] ); + } + else + pResData->sId = ByteString("1"); + + PFormEntrys *pEntrys; + ULONG nLIndex = 0; + ULONG nMaxIndex = 0; + if ( pList ) + nMaxIndex = pList->GetSourceLanguageListEntryCount(); + pEntrys = pMergeDataFile->GetPFormEntrys( pResData ); + while( pEntrys && ( nLIndex < nMaxIndex )) { + //printf("Lang %s, List Index %d\n",sCur.GetBuffer(),(int)nLIndex); + ByteString sText; + BOOL bText; + bText = pEntrys->GetText( sText, STRING_TYP_TEXT, sCur, TRUE ); + if( !bText ) + bText = pEntrys->GetText( sText , STRING_TYP_TEXT, SOURCE_LANGUAGE , FALSE ); + + // Use fallback, if data is missing in sdf file + //if( !bText && pResData->sResTyp.Equals( "pairedlist" ) ){ + if( !bText && bPairedList ){ + if( pResData->isMerged( sCur ) ) break; + const ByteString sPlist("pairedlist"); + ByteString sKey = MergeDataFile::CreateKey( sPlist , pResData->sGId , pResData->sId , sFilename ); + bText = pResData->getFallbackData( sKey , sText ); + }else if ( !bText ){// new fallback + if( pResData->isMerged( sCur ) ) break; + const ByteString sPlist("list"); + ByteString sKey = MergeDataFile::CreateKey( sPlist , pResData->sGId , pResData->sId , sFilename ); + bText = pResData->getFallbackData( sKey , sText ); + } // new fallback + + if ( bText && sText.Len()) { + //if( pEntrys ) pEntrys->Dump(); + if ( nIdx == 1 ) { + ByteString sHead; + if ( bNextMustBeDefineEOL ) + sHead = "\\\n\t"; + sHead += sSpace; + switch ( nT ) { + case LIST_STRING : sHead += "StringList "; break; + case LIST_FILTER : sHead += "FilterList "; break; + case LIST_ITEM : sHead += "ItemList "; break; + case LIST_PAIRED : sHead += "PairedList "; break; + case LIST_UIENTRIES : sHead += "UIEntries "; break; + } + sHead += "[ "; + sHead += sCur; + sHead += " ] "; + //} + if ( bDefine || bNextMustBeDefineEOL ) { + sHead += "= \\\n"; + sHead += sSpace; + sHead += "\t{\\\n\t"; + } + else { + sHead += "= \n"; + sHead += sSpace; + sHead += "\t{\n\t"; + } + WriteToMerged( sHead , true); + } + ByteString sLine; + if ( pList && pList->GetObject( nLIndex )) + sLine = ( *pList->GetObject( nLIndex ))[ SOURCE_LANGUAGE ]; + if ( !sLine.Len()) + sLine = sLastListLine; + + if ( sLastListLine.Search( "<" ) != STRING_NOTFOUND ) { + if (( nT != LIST_UIENTRIES ) && + (( sLine.Search( "{" ) == STRING_NOTFOUND ) || + ( sLine.Search( "{" ) >= sLine.Search( "\"" ))) && + (( sLine.Search( "<" ) == STRING_NOTFOUND ) || + ( sLine.Search( "<" ) >= sLine.Search( "\"" )))) + { + sLine.SearchAndReplace( "\"", "< \"" ); + } + } + + USHORT nStart, nEnd; + nStart = sLine.Search( "\"" ); + + ByteString sPostFix; + if( !bPairedList ){ + nEnd = sLine.SearchBackward( '\"' ); + sPostFix = ByteString( sLine.Copy( ++nEnd )); + sLine.Erase( nStart ); + } + + + ConvertMergeContent( sText ); + + // merge new res. in text line + if( bPairedList ){ + sLine = MergePairedList( sLine , sText ); + } + else{ + sLine += sText; + sLine += sPostFix; + } + + ByteString sText1( "\t" ); + sText1 += sLine; + if ( bDefine || bNextMustBeDefineEOL ) + sText1 += " ;\\\n"; + else + sText1 += " ;\n"; + sText1 += sSpace; + sText1 += "\t"; + //printf("Writing '%s'\n",sText1.GetBuffer()); + WriteToMerged( sText1 ,true ); + + // Set matching pairedlist identifier + if ( bPairedList ){ + nIdx++; + ExportListEntry* pListE = ( ExportListEntry* ) pResData->pPairedList->GetObject( ( nIdx ) -1 ); + if( pListE ){ + pResData->sId = GetPairedListID ( (*pListE)[ SOURCE_LANGUAGE ] ); + } + } + else + pResData->sId = ByteString::CreateFromInt32( ++nIdx ); + } + else + break; + nLIndex ++; + PFormEntrys *oldEntry = pEntrys; + pEntrys = pMergeDataFile->GetPFormEntrys( pResData ); // <--- game over + if( !pEntrys ) + pEntrys = oldEntry; + } + if ( nIdx > 1 ) { + ByteString sFooter( sSpace.Copy( 1 )); + if ( bNextMustBeDefineEOL ) + sFooter += "};"; + else if ( !bDefine ) + sFooter += "};\n\t"; + else + sFooter += "\n\n"; + WriteToMerged( sFooter ,true ); + } + } + } + + pResData->sId = sOldId; + pResData->sGId = sOldGId; + pResData->sResTyp = sOldTyp; + } + } + break; + case MERGE_MODE_LIST : { + ExportList *pList = NULL; + switch ( nList ) { + // PairedList + case LIST_STRING : pList = pResData->pStringList; break; + case LIST_FILTER : pList = pResData->pFilterList; break; + case LIST_UIENTRIES : pList = pResData->pUIEntries; break; + case LIST_ITEM : pList = pResData->pItemList; break; + case LIST_PAIRED : pList = pResData->pPairedList; break; + + } + + nListIndex++; + ULONG nMaxIndex = 0; + if ( pList ) + nMaxIndex = pList->GetSourceLanguageListEntryCount(); + ByteString sLine; + if ( pList && pList->GetObject( nListIndex )) + sLine = ( *pList->GetObject( nListIndex ))[ SOURCE_LANGUAGE ]; + if ( !sLine.Len()) + sLine = sLastListLine; + + if ( sLastListLine.Search( "<" ) != STRING_NOTFOUND ) { + if (( nList != LIST_UIENTRIES ) && + (( sLine.Search( "{" ) == STRING_NOTFOUND ) || + ( sLine.Search( "{" ) >= sLine.Search( "\"" ))) && + (( sLine.Search( "<" ) == STRING_NOTFOUND ) || + ( sLine.Search( "<" ) >= sLine.Search( "\"" )))) + { + sLine.SearchAndReplace( "\"", "< \"" ); + } + } + + while( PrepareTextToMerge( sLine, nList, nListLang, pResData ) && ( nListIndex <= nMaxIndex )) { + ByteString sText( "\t" ); + sText += sLine; + sText += " ;"; + sText += "\n"; + for ( USHORT i = 0; i < nLevel; i++ ) + sText += "\t"; + WriteToMerged( sText ,false ); + nListIndex++; + if ( pList && pList->GetObject( nListIndex )) + sLine = ( *pList->GetObject( nListIndex ))[ SOURCE_LANGUAGE ]; + if ( !sLine.Len()) + sLine = sLastListLine; + sLine += " ;"; + } + } + break; + } + pParseQueue->bMflag = false; +} + +ByteString Export::MergePairedList( ByteString& sLine , ByteString& sText ){ +// < "xy" ; IDENTIFIER ; > + ByteString sPre = sLine.Copy( 0 , sLine.Search('\"') ); + ByteString sPost = sLine.Copy( sLine.SearchBackward('\"') + 1 , sLine.Len() ); + sPre.Append( sText ); + sPre.Append( sPost ); + return sPre; +} + +/*****************************************************************************/ +void Export::SetChildWithText() +/*****************************************************************************/ +{ + if ( aResStack.Count() > 1 ) { + for ( ULONG i = 0; i < aResStack.Count() - 1; i++ ) { + aResStack.GetObject( i )->bChildWithText = TRUE; + } + } +} + +void ParserQueue::Push( const QueueEntry& aEntry ){ +// printf("nTyp = %d ",aEntry.nTyp); + USHORT nLen = aEntry.sLine.Len(); + + if( !bStart ){ + aQueueCur->push( aEntry ); + if( nLen > 1 && aEntry.sLine.GetChar( nLen-1 ) == '\n' ) + bStart = true; + else if ( aEntry.nTyp != IGNOREDTOKENS ){ + if( nLen > 1 && ( aEntry.sLine.GetChar( nLen-1 ) == '\\') ){ + // Next is Macro + bCurrentIsM = true; + }else{ + // Next is no Macro + bCurrentIsM = false; + } + } + } + else{ + aQueueNext->push( aEntry ); + if( nLen > 1 && aEntry.sLine.GetChar( nLen-1 ) != '\n' ){ + if( nLen > 1 && ( aEntry.sLine.GetChar( nLen-1 ) == '\\') ){ + // Next is Macro + bNextIsM = true; + } + else{ + // Next is no Macro + bNextIsM = false; + } + }else if( nLen > 2 && aEntry.sLine.GetChar( nLen-1 ) == '\n' ){ + if( aEntry.nTyp != IGNOREDTOKENS ){ + if( nLen > 2 && ( aEntry.sLine.GetChar( nLen-2 ) == '\\') ){ + // Next is Macro + bNextIsM = true; + } + else{ + // Next is no Macro + bNextIsM = false; + } + } + // Pop current + Pop( *aQueueCur ); + bLastWasM = bCurrentIsM; + // next -> current + bCurrentIsM = bNextIsM; + aQref = aQueueCur; + aQueueCur = aQueueNext; + aQueueNext = aQref; + + } + + else{ + // Pop current + Pop( *aQueueCur ); + bLastWasM = bCurrentIsM; + // next -> current + bCurrentIsM = bNextIsM; + aQref = aQueueCur; + aQueueCur = aQueueNext; + aQueueNext = aQref; + } + } +} + +void ParserQueue::Close(){ + // Pop current + Pop( *aQueueCur ); + // next -> current + bLastWasM = bCurrentIsM; + bCurrentIsM = bNextIsM; + aQref = aQueueCur; + aQueueCur = aQueueNext; + aQueueNext = aQref; + bNextIsM = false; + Pop( *aQueueNext ); +}; +void ParserQueue::Pop( std::queue& aQueue ){ + while( !aQueue.empty() ){ + QueueEntry aEntry = aQueue.front(); + aQueue.pop(); + aExport.Execute( aEntry.nTyp , (char*) aEntry.sLine.GetBuffer() ); + } +} +ParserQueue::ParserQueue( Export& aExportObj ) + : + bCurrentIsM( false ), + bNextIsM( false ) , + bLastWasM( false ), + bMflag( false ) , + aExport( aExportObj ) , + bStart( false ) , + bStartNext( false ) +{ + aQueueNext = new std::queue; + aQueueCur = new std::queue; +} + + +ParserQueue::~ParserQueue(){ + if( aQueueNext ) delete aQueueNext; + if( aQueueCur ) delete aQueueCur; +} diff --git a/l10ntools/source/export2.cxx b/l10ntools/source/export2.cxx new file mode 100644 index 000000000000..d0a37c7c9f3d --- /dev/null +++ b/l10ntools/source/export2.cxx @@ -0,0 +1,741 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: export2.cxx,v $ + * $Revision: 1.43 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_l10ntools.hxx" +#include "export.hxx" +#include "utf8conv.hxx" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace std; +// +// class ResData(); +// + +/*****************************************************************************/ +ResData::~ResData() +/*****************************************************************************/ +{ + if ( pStringList ) { + // delete existing res. of type StringList + for ( ULONG i = 0; i < pStringList->Count(); i++ ) { + ExportListEntry* test = pStringList->GetObject( i ); + if( test != NULL ) delete test; + } + delete pStringList; + } + if ( pFilterList ) { + // delete existing res. of type FilterList + for ( ULONG i = 0; i < pFilterList->Count(); i++ ) { + ExportListEntry* test = pFilterList->GetObject( i ); + delete test; + } + delete pFilterList; + } + if ( pItemList ) { + // delete existing res. of type ItemList + for ( ULONG i = 0; i < pItemList->Count(); i++ ) { + ExportListEntry* test = pItemList->GetObject( i ); + delete test; + } + delete pItemList; + } + if ( pUIEntries ) { + // delete existing res. of type UIEntries + for ( ULONG i = 0; i < pUIEntries->Count(); i++ ) { + ExportListEntry* test = pUIEntries->GetObject( i ); + delete test; + } + delete pUIEntries; + } +} + +// +// class Export +// + +/*****************************************************************************/ +ByteString Export::sLanguages; +ByteString Export::sForcedLanguages; +//ByteString Export::sIsoCode99; +/*****************************************************************************/ + +void Export::DumpExportList( ByteString& sListName , ExportList& aList ){ + printf( "%s\n", sListName.GetBuffer() ); + ByteString l(""); + ExportListEntry* aEntry; + for( unsigned int x = 0; x < aList.Count() ; x++ ){ + aEntry = (ExportListEntry*) aList.GetObject( x ); + Export::DumpMap( l , *aEntry ); + } + printf("\n"); +} +ByteString Export::DumpMap( ByteString& sMapName , ByteStringHashMap& aMap ){ + ByteStringHashMap::const_iterator idbg; + ByteString sReturn; + + if( sMapName.Len() ) + printf("MapName %s\n", sMapName.GetBuffer()); + if( aMap.size() < 1 ) return ByteString(); + for( idbg = aMap.begin() ; idbg != aMap.end(); ++idbg ){ + ByteString a( idbg->first ); + ByteString b( idbg->second ); + printf("[%s]= %s",a.GetBuffer(),b.GetBuffer()); + printf("\n"); + } + printf("\n"); + return sReturn; +} +/*****************************************************************************/ +void Export::SetLanguages( std::vector val ){ +/*****************************************************************************/ + aLanguages = val; + isInitialized = true; +} +/*****************************************************************************/ +std::vector Export::GetLanguages(){ +/*****************************************************************************/ + return aLanguages; +} +/*****************************************************************************/ +std::vector Export::GetForcedLanguages(){ +/*****************************************************************************/ + return aForcedLanguages; +} +std::vector Export::aLanguages = std::vector(); +std::vector Export::aForcedLanguages = std::vector(); + + +/*****************************************************************************/ +void Export::QuotHTMLXRM( ByteString &rString ) +/*****************************************************************************/ +{ + ByteString sReturn; + //BOOL bBreak = FALSE; + for ( USHORT i = 0; i < rString.Len(); i++ ) { + ByteString sTemp = rString.Copy( i ); + if ( sTemp.Search( ""; + i++; + } + } + + if ( i < rString.Len()) { + switch ( rString.GetChar( i )) { + case '<': + if( i+2 < rString.Len() && + (rString.GetChar( i+1 ) == 'b' || rString.GetChar( i+1 ) == 'B') && + rString.GetChar( i+2 ) == '>' ) + { + sReturn +=""; + i += 2; + } + else if( i+3 < rString.Len() && + rString.GetChar( i+1 ) == '/' && + (rString.GetChar( i+2 ) == 'b' || rString.GetChar( i+2 ) == 'B') && + rString.GetChar( i+3 ) == '>' ) + { + sReturn +=""; + i += 3; + } + else + sReturn += "<"; + break; + + case '>': + sReturn += ">"; + break; + + case '\"': + sReturn += """; + break; + + case '\'': + sReturn += "'"; + break; + + case '&': + if ((( i + 4 ) < rString.Len()) && + ( rString.Copy( i, 5 ) == "&" )) + sReturn += rString.GetChar( i ); + else + sReturn += "&"; + break; + + default: + sReturn += rString.GetChar( i ); + break; + } + } + } + rString = sReturn; +} +/*****************************************************************************/ +void Export::QuotHTML( ByteString &rString ) +/*****************************************************************************/ +{ + ByteString sReturn; + for ( USHORT i = 0; i < rString.Len(); i++ ) { + ByteString sTemp = rString.Copy( i ); + if ( sTemp.Search( ""; + i++; + } + } + if ( i < rString.Len()) { + switch ( rString.GetChar( i )) { + case '<': + sReturn += "<"; + break; + + case '>': + sReturn += ">"; + break; + + case '\"': + sReturn += """; + break; + + case '\'': + sReturn += "'"; + break; + + case '&': + if ((( i + 4 ) < rString.Len()) && + ( rString.Copy( i, 5 ) == "&" )) + sReturn += rString.GetChar( i ); + else + sReturn += "&"; + break; + + default: + sReturn += rString.GetChar( i ); + break; + } + } + } + rString = sReturn; +} + +void Export::RemoveUTF8ByteOrderMarker( ByteString &rString ){ + if( hasUTF8ByteOrderMarker( rString ) ) + rString.Erase( 0 , 3 ); +} + +bool Export::hasUTF8ByteOrderMarker( const ByteString &rString ){ + // Byte order marker signature + + const unsigned char c1 = 0xEF; + const unsigned char c2 = 0xBB; + const unsigned char c3 = 0xBF; + + const char bom[ 3 ] = { c1 , c2 , c3 }; + + return rString.Len() >= 3 && + rString.GetChar( 0 ) == bom[ 0 ] && + rString.GetChar( 1 ) == bom[ 1 ] && + rString.GetChar( 2 ) == bom[ 2 ] ; +} +bool Export::fileHasUTF8ByteOrderMarker( const ByteString &rString ){ + SvFileStream aFileIn( String( rString , RTL_TEXTENCODING_ASCII_US ) , STREAM_READ ); + ByteString sLine; + if( !aFileIn.IsEof() ) { + aFileIn.ReadLine( sLine ); + if( aFileIn.IsOpen() ) aFileIn.Close(); + return hasUTF8ByteOrderMarker( sLine ); + } + if( aFileIn.IsOpen() ) aFileIn.Close(); + return false; +} +void Export::RemoveUTF8ByteOrderMarkerFromFile( const ByteString &rFilename ){ + SvFileStream aFileIn( String( rFilename , RTL_TEXTENCODING_ASCII_US ) , STREAM_READ ); + ByteString sLine; + if( !aFileIn.IsEof() ) { + aFileIn.ReadLine( sLine ); + // Test header + if( hasUTF8ByteOrderMarker( sLine ) ){ + //cout << "UTF8 Header found!\n"; + DirEntry aTempFile = Export::GetTempFile(); + ByteString sTempFile = ByteString( aTempFile.GetFull() , RTL_TEXTENCODING_ASCII_US ); + SvFileStream aNewFile( String( sTempFile , RTL_TEXTENCODING_ASCII_US ) , STREAM_WRITE ); + // Remove header + RemoveUTF8ByteOrderMarker( sLine ); + //cout << "Copy stripped stuff to " << sTempFile.GetBuffer() << endl; + aNewFile.WriteLine( sLine ); + // Copy the rest + while( !aFileIn.IsEof() ){ + aFileIn.ReadLine( sLine ); + aNewFile.WriteLine( sLine ); + } + if( aFileIn.IsOpen() ) aFileIn.Close(); + if( aNewFile.IsOpen() ) aNewFile.Close(); + DirEntry aEntry( rFilename.GetBuffer() ); + //cout << "Removing file " << rFilename.GetBuffer() << "\n"; + aEntry.Kill(); + //cout << "Renaming file " << sTempFile.GetBuffer() << " to " << rFilename.GetBuffer() << "\n"; + DirEntry( sTempFile ).MoveTo( DirEntry( rFilename.GetBuffer() ) ); + } + } + if( aFileIn.IsOpen() ) aFileIn.Close(); +} + +// Merge it into source code! +//bool Export::isMergingGermanAllowed( const ByteString& rPrj ){ +// (void) rPrj; +// return true; +/* static ByteStringBoolHashMap aHash; + + if( aHash.find( rPrj ) != aHash.end() ){ + return aHash[ rPrj ]; + } + + ByteString sFile = Export::GetEnv( "SRC_ROOT" ) ; + sFile.Append("/"); + sFile.Append( rPrj ); + sFile.Append("/prj/l10n"); +#if defined(WNT) || defined(OS2) + sFile.SearchAndReplaceAll('/','\\'); +#endif + DirEntry aFlagfile( sFile ); + + aHash[ rPrj ] = !aFlagfile.Exists(); + return aHash[ rPrj ];*/ +//} +bool Export::CopyFile( const ByteString& source , const ByteString& dest ) +{ +// cout << "CopyFile( " << source.GetBuffer() << " , " << dest.GetBuffer() << " )\n"; + const int BUFFERSIZE = 8192; + char buf[ BUFFERSIZE ]; + + FILE* IN_FILE = fopen( source.GetBuffer() , "r" ); + FILE* OUT_FILE = fopen( dest.GetBuffer() , "w" ); + + if( IN_FILE == NULL ) + { + cerr << "Export::CopyFile WARNING: Could not open " << source.GetBuffer() << "\n"; + return false; + } + if( OUT_FILE == NULL ) + { + cerr << "Export::CopyFile WARNING: Could not open/create " << dest.GetBuffer() << " for writing\n"; + return false; + } + + while( fgets( buf , BUFFERSIZE , IN_FILE ) != NULL ) + { + if( fputs( buf , OUT_FILE ) == EOF ) + { + cerr << "Export::CopyFile WARNING: Write problems " << source.GetBuffer() << "\n"; + fclose( IN_FILE ); + fclose( OUT_FILE ); + return false; + } + } + if( ferror( IN_FILE ) ) + { + cerr << "Export::CopyFile WARNING: Read problems " << dest.GetBuffer() << "\n"; + fclose( IN_FILE ); + fclose( OUT_FILE ); + return false; + } + fclose ( IN_FILE ); + fclose ( OUT_FILE ); + + return true; +} + +/*****************************************************************************/ +void Export::UnquotHTML( ByteString &rString ) +/*****************************************************************************/ +{ + ByteString sReturn; + while ( rString.Len()) { + if ( rString.Copy( 0, 5 ) == "&" ) { + sReturn += "&"; + rString.Erase( 0, 5 ); + } + else if ( rString.Copy( 0, 4 ) == "<" ) { + sReturn += "<"; + rString.Erase( 0, 4 ); + } + else if ( rString.Copy( 0, 4 ) == ">" ) { + sReturn += ">"; + rString.Erase( 0, 4 ); + } + else if ( rString.Copy( 0, 6 ) == """ ) { + sReturn += "\""; + rString.Erase( 0, 6 ); + } + else if ( rString.Copy( 0, 6 ) == "'" ) { + sReturn += "\'"; + rString.Erase( 0, 6 ); + } + else { + sReturn += rString.GetChar( 0 ); + rString.Erase( 0, 1 ); + } + } + rString = sReturn; +} +bool Export::isSourceLanguage( const ByteString &sLanguage ) +{ + return !isAllowed( sLanguage ); +} +bool Export::isAllowed( const ByteString &sLanguage ){ + return ! ( sLanguage.EqualsIgnoreCaseAscii("en-US") ); +} +/*****************************************************************************/ +bool Export::LanguageAllowed( const ByteString &nLanguage ) +/*****************************************************************************/ +{ + return std::find( aLanguages.begin() , aLanguages.end() , nLanguage ) != aLanguages.end(); +} + +bool Export::isInitialized = false; + +/*****************************************************************************/ +void Export::InitLanguages( bool bMergeMode ){ +/*****************************************************************************/ + if( !isInitialized ){ + ByteString sTmp; + ByteStringBoolHashMap aEnvLangs; + for ( USHORT x = 0; x < sLanguages.GetTokenCount( ',' ); x++ ){ + sTmp = sLanguages.GetToken( x, ',' ).GetToken( 0, '=' ); + sTmp.EraseLeadingAndTrailingChars(); + if( bMergeMode && !isAllowed( sTmp ) ){} + else if( !( (sTmp.GetChar(0)=='x' || sTmp.GetChar(0)=='X') && sTmp.GetChar(1)=='-' ) ){ + aLanguages.push_back( sTmp ); + } + } + InitForcedLanguages( bMergeMode ); + isInitialized = true; + } +} +/*****************************************************************************/ +void Export::InitForcedLanguages( bool bMergeMode ){ +/*****************************************************************************/ + ByteString sTmp; + ByteStringBoolHashMap aEnvLangs; + for ( USHORT x = 0; x < sForcedLanguages.GetTokenCount( ',' ); x++ ){ + sTmp = sForcedLanguages.GetToken( x, ',' ).GetToken( 0, '=' ); + sTmp.EraseLeadingAndTrailingChars(); + if( bMergeMode && isAllowed( sTmp ) ){} + else if( !( (sTmp.GetChar(0)=='x' || sTmp.GetChar(0)=='X') && sTmp.GetChar(1)=='-' ) ) + aForcedLanguages.push_back( sTmp ); + } +} + +/*****************************************************************************/ +ByteString Export::GetFallbackLanguage( const ByteString nLanguage ) +/*****************************************************************************/ +{ + ByteString sFallback=nLanguage; + GetIsoFallback( sFallback ); + return sFallback; +} + +void Export::replaceEncoding( ByteString& rString ) +{ +// ™ -> \u2122 + + for( xub_StrLen idx = 0; idx <= rString.Len()-8 ; idx++ ) + { + if( rString.GetChar( idx ) == '&' && + rString.GetChar( idx+1 ) == '#' && + rString.GetChar( idx+2 ) == 'x' && + rString.GetChar( idx+7 ) == ';' ) + { + ByteString sTmp = rString.Copy( 0 , idx ); + sTmp.Append( "\\u" ); + sTmp.Append( rString.GetChar( idx+3 ) ); + sTmp.Append( rString.GetChar( idx+4 ) ); + sTmp.Append( rString.GetChar( idx+5 ) ); + sTmp.Append( rString.GetChar( idx+6 ) ); + sTmp.Append( rString.Copy( idx+8 , rString.Len() ) ); + rString = sTmp; + } + } +} + +/*****************************************************************************/ +void Export::FillInFallbacks( ResData *pResData ) +/*****************************************************************************/ +{ + ByteString sCur; + for( unsigned int n = 0; n < aLanguages.size(); n++ ){ + sCur = aLanguages[ n ]; + if( isAllowed( sCur ) ){ + ByteString nFallbackIndex = GetFallbackLanguage( sCur ); + if( nFallbackIndex.Len() ){ + if ( !pResData->sText[ sCur ].Len()) + pResData->sText[ sCur ] = + pResData->sText[ nFallbackIndex ]; + + if ( !pResData->sHelpText[ sCur ].Len()) + pResData->sHelpText[ sCur ] = + pResData->sHelpText[ nFallbackIndex ]; + + if ( !pResData->sQuickHelpText[ sCur ].Len()) + pResData->sQuickHelpText[ sCur ] = + pResData->sQuickHelpText[ nFallbackIndex ]; + + if ( !pResData->sTitle[ sCur ].Len()) + pResData->sTitle[ sCur ] = + pResData->sTitle[ nFallbackIndex ]; + + if ( pResData->pStringList ) + FillInListFallbacks( + pResData->pStringList, sCur, nFallbackIndex ); + + if ( pResData->pPairedList ) + FillInListFallbacks( + pResData->pPairedList, sCur, nFallbackIndex ); + + if ( pResData->pFilterList ) + FillInListFallbacks( + pResData->pFilterList, sCur, nFallbackIndex ); + + if ( pResData->pItemList ) + FillInListFallbacks( + pResData->pItemList, sCur, nFallbackIndex ); + + if ( pResData->pUIEntries ) + FillInListFallbacks( + pResData->pUIEntries, sCur, nFallbackIndex ); + } + } + } +} + +/*****************************************************************************/ +void Export::FillInListFallbacks( + ExportList *pList, const ByteString &nSource, const ByteString &nFallback ) +/*****************************************************************************/ +{ + + for ( ULONG i = 0; i < pList->Count(); i++ ) { + ExportListEntry *pEntry = pList->GetObject( i ); + if ( !( *pEntry )[ nSource ].Len()){ + ( *pEntry )[ nSource ] = ( *pEntry )[ nFallback ]; + ByteString x = ( *pEntry )[ nSource ]; + ByteString y = ( *pEntry )[ nFallback ]; + } + } +} + +/*****************************************************************************/ +ByteString Export::GetTimeStamp() +/*****************************************************************************/ +{ +// return "xx.xx.xx"; + char buf[20]; + Time aTime; + + snprintf(buf, sizeof(buf), "%8d %02d:%02d:%02d", int(Date().GetDate()), + int(aTime.GetHour()), int(aTime.GetMin()), int(aTime.GetSec())); + return ByteString(buf); +} + +/*****************************************************************************/ +BOOL Export::ConvertLineEnds( + ByteString sSource, ByteString sDestination ) +/*****************************************************************************/ +{ + String sSourceFile( sSource, RTL_TEXTENCODING_ASCII_US ); + String sDestinationFile( sDestination, RTL_TEXTENCODING_ASCII_US ); + + SvFileStream aSource( sSourceFile, STREAM_READ ); + if ( !aSource.IsOpen()) + return FALSE; + SvFileStream aDestination( sDestinationFile, STREAM_STD_WRITE | STREAM_TRUNC ); + if ( !aDestination.IsOpen()) { + aSource.Close(); + return FALSE; + } + + ByteString sLine; + + while ( !aSource.IsEof()) { + aSource.ReadLine( sLine ); + if ( !aSource.IsEof()) { + sLine.EraseAllChars( '\r' ); + aDestination.WriteLine( sLine ); + } + else + aDestination.WriteByteString( sLine ); + } + + aSource.Close(); + aDestination.Close(); + + return TRUE; +} + +/*****************************************************************************/ +ByteString Export::GetNativeFile( ByteString sSource ) +/*****************************************************************************/ +{ + DirEntry aTemp( GetTempFile()); + ByteString sReturn( aTemp.GetFull(), RTL_TEXTENCODING_ASCII_US ); + + for ( USHORT i = 0; i < 10; i++ ) + if ( ConvertLineEnds( sSource, sReturn )) + return sReturn; + + return ""; +} + +const char* Export::GetEnv( const char *pVar ) +{ + char *pRet = getenv( pVar ); + if ( !pRet ) + pRet = 0; + return pRet; +} + + +int Export::getCurrentDirectory( rtl::OUString& base_fqurl_out, rtl::OUString& base_out ) +{ + DirEntry aDir("."); + aDir.ToAbs(); + base_out = rtl::OUString( aDir.GetFull() ); + return osl::File::getFileURLFromSystemPath( base_out , base_fqurl_out ); +} + +void Export::getCurrentDir( string& dir ) +{ + char buffer[64000]; + if( getcwd( buffer , sizeof( buffer ) ) == 0 ){ + cerr << "Error: getcwd failed!\n"; + exit( -1 ); + } + dir = string( buffer ); +} + + +// Stolen from sal/osl/unx/tempfile.c + +#define RAND_NAME_LENGTH 6 + +void Export::getRandomName( const ByteString& sPrefix , ByteString& sRandStr , const ByteString& sPostfix ) +{ + static const char LETTERS[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"; + static const int COUNT_OF_LETTERS = sizeof(LETTERS)/sizeof(LETTERS[0]) - 1; + sRandStr.Append( sPrefix ); + + static sal_uInt64 value; + char buffer[RAND_NAME_LENGTH]; + + TimeValue tv; + sal_uInt64 v; + int i; + + osl_getSystemTime( &tv ); + oslProcessInfo proInfo; + osl_getProcessInfo( 0 , osl_Process_IDENTIFIER , &proInfo ); + + value += ((sal_uInt64) ( tv.Nanosec / 1000 ) << 16) ^ ( tv.Nanosec / 1000 ) ^ proInfo.Ident; + + v = value; + + for (i = 0; i < RAND_NAME_LENGTH; i++) + { + buffer[i] = LETTERS[v % COUNT_OF_LETTERS]; + v /= COUNT_OF_LETTERS; + } + + sRandStr.Append( buffer , RAND_NAME_LENGTH ); + sRandStr.Append( sPostfix ); +} + +void Export::getRandomName( ByteString& sRandStr ) +{ + const ByteString sEmpty; + getRandomName( sEmpty , sRandStr , sEmpty ); +} + +/*****************************************************************************/ +DirEntry Export::GetTempFile() +/*****************************************************************************/ +{ +#if defined(WNT) || defined(OS2) + String sTempDir( Export::GetEnv( "TEMP" ), RTL_TEXTENCODING_ASCII_US ); +#else + String sTempDir( String::CreateFromAscii( "/tmp" )); +#endif + rtl::OUString* sTempFilename = new rtl::OUString(); + + // Create a temp file + int nRC = osl::FileBase::createTempFile( 0 , 0 , sTempFilename ); + if( nRC ) printf(" osl::FileBase::createTempFile RC = %d",nRC); + + String strTmp( *sTempFilename ); + + INetURLObject::DecodeMechanism eMechanism = INetURLObject::DECODE_TO_IURI; + String sDecodedStr = INetURLObject::decode( strTmp , '%' , eMechanism ); + ByteString sTmp( sDecodedStr , RTL_TEXTENCODING_UTF8 ); + +#if defined(WNT) || defined(OS2) + sTmp.SearchAndReplace("file:///",""); + sTmp.SearchAndReplaceAll('/','\\'); +#else + // Set file permission to 644 + const sal_uInt64 nPerm = osl_File_Attribute_OwnRead | osl_File_Attribute_OwnWrite | + osl_File_Attribute_GrpRead | osl_File_Attribute_OthRead ; + + nRC = osl::File::setAttributes( *sTempFilename , nPerm ); + if( nRC ) printf(" osl::File::setAttributes RC = %d",nRC); + + sTmp.SearchAndReplace("file://",""); +#endif + DirEntry aDirEntry( sTmp ); + delete sTempFilename; + return aDirEntry; +} diff --git a/l10ntools/source/file.cxx b/l10ntools/source/file.cxx new file mode 100644 index 000000000000..43ce4c757d54 --- /dev/null +++ b/l10ntools/source/file.cxx @@ -0,0 +1,58 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: file.cxx,v $ + * $Revision: 1.6 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_l10ntools.hxx" +#include + +namespace transex +{ + +File::File( const rtl::OUString sFile ) +{ + sFileName = sFile; +} + +File::File( const rtl::OUString sFullPath , const rtl::OUString sFile ) +{ + sFileName = sFile; + sFullName = sFullPath; +} + +bool File::lessFile ( const File& rKey1, const File& rKey2 ) +{ + rtl::OUString sName1( ( static_cast< File >( rKey1 ) ).getFileName() ); + rtl::OUString sName2( ( static_cast< File >( rKey2 ) ).getFileName() ); + + return sName1.compareTo( sName2 ) < 0 ; +} + +} diff --git a/l10ntools/source/filter/merge/FCFGMerge.cfg b/l10ntools/source/filter/merge/FCFGMerge.cfg new file mode 100644 index 000000000000..46fcccafe7e4 --- /dev/null +++ b/l10ntools/source/filter/merge/FCFGMerge.cfg @@ -0,0 +1,125 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2008 by Sun Microsystems, Inc. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# $RCSfile: FCFGMerge.cfg,v $ +# +# $Revision: 1.5 $ +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +#************************************************ +# Specify the verbose mode of this tool. +# 1 = show errors only +# 2 = show errors/warnings (default) +# 3 = show errors/warnings and some generic infos +# 4 = show anything (including detailed infos) +# +# [OPTIONAL] +#************************************************ + +loglevel = 2 + +#************************************************ +# This extension is used for all XML files. It doesnt +# matter if its used for reading fragments or writing +# XML packages. +# Must be given without any additional signes like "." +# or "*."! +# +# [REQUIRED] +#************************************************ + +extension_xcu=xcu + +#************************************************ +# This extension is used for all Package files. It doesnt +# matter if its used for reading such files or writing +# it. +# Must be given without any additional signes like "." +# or "*."! +# +# [REQUIRED] +#************************************************ + +extension_pkg=pkg + +#************************************************ +# These values are used to generate a correct XML +# header. +# Note: The property "xmlpackage" must be specified +# via command line. There exists more then one +# possible value. +# +# [REQUIRED] +#************************************************ + +xmlversion = 1.0 +xmlencoding = UTF-8 +xmlpath = org.openoffice.TypeDetection +#xmlpackage = + +#************************************************ +# These values are used to name the configuration +# sets inside the generated XCM file for different +# item groups like e.g. types, filters etcpp. +# +# [REQUIRED] +#************************************************ + +setname_types = Types +setname_filters = Filters +setname_frameloaders = FrameLoaders +setname_contenthandlers = ContentHandlers + +subdir_types = types +subdir_filters = filters +subdir_frameloaders = frameloaders +subdir_contenthandlers = contenthandlers + +#************************************************ +# This delimiter is used to split every +# item list of the package configuration files +# (which are temp. created by the make proccess) +# into its tokens. +# +# [REQUIRED] +#************************************************ +delimiter=, + +#************************************************ +# Enable/disable removing of leading/trailing withespaces +# during splitting stringlists. +# +# [REQUIRED] +#************************************************ +trim=true + +#************************************************ +# Enable/disable removing of leading/trailing "-signs +# during splitting stringlists. +# +# [REQUIRED] +#************************************************ +decode=false diff --git a/l10ntools/source/filter/merge/FCFGMerge.java b/l10ntools/source/filter/merge/FCFGMerge.java new file mode 100644 index 000000000000..7fbfa8a0c986 --- /dev/null +++ b/l10ntools/source/filter/merge/FCFGMerge.java @@ -0,0 +1,131 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: FCFGMerge.java,v $ + * $Revision: 1.5 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package com.sun.star.filter.config.tools.merge; + +//_______________________________________________ + +import java.lang.*; +import java.util.*; +import java.io.*; +import com.sun.star.filter.config.tools.utils.*; + +//_______________________________________________ + +/** + * Its a simple command line tool, which can merge different XML fragments + * together. Such fragments must exist as files on disk, will be moved into + * one file together on disk. + * + * + */ +public class FCFGMerge +{ + //___________________________________________ + // const + + private static final java.lang.String CFGFILE = "com/sun/star/filter/config/tools/merge/FCFGMerge.cfg"; + private static final java.lang.String PROP_LOGLEVEL = "loglevel"; + + //___________________________________________ + // main + + public static void main(java.lang.String[] sCmdLine) + { + FCFGMerge.printCopyright(); + + // create log object in default mode "WARNINGS" + // If a command line parameter indicates another + // level - change it! + Logger aLog = new Logger(); + + try + { + // merge config file and overwrite properties + // via command line + ConfigHelper aCfg = null; + aCfg = new ConfigHelper(CFGFILE, sCmdLine); + + // update log level + int nLogLevel = aCfg.getInt(PROP_LOGLEVEL, Logger.LEVEL_WARNINGS); + aLog = new Logger(nLogLevel); + + // help requested? + if (aCfg.isHelp()) + { + FCFGMerge.printHelp(); + System.exit(-1); + } + + // create new merge object and start operation + Merger aMerger = new Merger(aCfg, aLog); + aMerger.merge(); + } + catch(java.lang.Throwable ex) + { + aLog.setException(ex); + System.exit(-1); + } + + System.exit(0); + } + + //___________________________________________ + + /** prints out a copyright message on stdout. + */ + private static void printCopyright() + { + java.lang.StringBuffer sOut = new java.lang.StringBuffer(256); + sOut.append("FCFGMerge\n"); + sOut.append("Copyright: 2003 by Sun Microsystems, Inc.\n"); + sOut.append("All Rights Reserved.\n"); + System.out.println(sOut.toString()); + } + + //___________________________________________ + + /** prints out a help message on stdout. + */ + private static void printHelp() + { + java.lang.StringBuffer sOut = new java.lang.StringBuffer(256); + sOut.append("____________________________________________________________\n"); + sOut.append("usage: FCFGMerge cfg=\n" ); + sOut.append("parameters:\n" ); + sOut.append("\tcfg=\n" ); + sOut.append("\t\tmust point to a system file, which contains\n" ); + sOut.append("\t\tall neccessary configuration data for the merge process.\n"); + sOut.append("\n\tFurther cou can specify every parameter allowed in the\n" ); + sOut.append("\n\tconfig file as command line parameter too, to overwrite\n" ); + sOut.append("\n\tthe value from the file.\n" ); + System.out.println(sOut.toString()); + } +} diff --git a/l10ntools/source/filter/merge/Manifest.mf b/l10ntools/source/filter/merge/Manifest.mf new file mode 100644 index 000000000000..1337eaf4d39a --- /dev/null +++ b/l10ntools/source/filter/merge/Manifest.mf @@ -0,0 +1 @@ +Main-Class: com.sun.star.filter.config.tools.merge.FCFGMerge diff --git a/l10ntools/source/filter/merge/Merger.java b/l10ntools/source/filter/merge/Merger.java new file mode 100644 index 000000000000..0bf11fc42fbf --- /dev/null +++ b/l10ntools/source/filter/merge/Merger.java @@ -0,0 +1,364 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: Merger.java,v $ + * $Revision: 1.8 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +package com.sun.star.filter.config.tools.merge; + +//_______________________________________________ + +import java.lang.*; +import java.util.*; +import java.io.*; +import com.sun.star.filter.config.tools.utils.*; + +//_______________________________________________ + +/** can merge different xml fragments together. + * + * + */ +public class Merger +{ + //___________________________________________ + // const + + private static final java.lang.String PROP_XMLVERSION = "xmlversion" ; // <= global cfg file + private static final java.lang.String PROP_XMLENCODING = "xmlencoding" ; // <= global cfg file + private static final java.lang.String PROP_XMLPATH = "xmlpath" ; // <= global cfg file + private static final java.lang.String PROP_XMLPACKAGE = "xmlpackage" ; // <= global cfg file + + private static final java.lang.String PROP_SETNAME_TYPES = "setname_types" ; // <= global cfg file + private static final java.lang.String PROP_SETNAME_FILTERS = "setname_filters" ; // <= global cfg file + private static final java.lang.String PROP_SETNAME_LOADERS = "setname_frameloaders" ; // <= global cfg file + private static final java.lang.String PROP_SETNAME_HANDLERS = "setname_contenthandlers" ; // <= global cfg file + + private static final java.lang.String PROP_SUBDIR_TYPES = "subdir_types" ; // <= global cfg file + private static final java.lang.String PROP_SUBDIR_FILTERS = "subdir_filters" ; // <= global cfg file + private static final java.lang.String PROP_SUBDIR_LOADERS = "subdir_frameloaders" ; // <= global cfg file + private static final java.lang.String PROP_SUBDIR_HANDLERS = "subdir_contenthandlers" ; // <= global cfg file + + private static final java.lang.String PROP_EXTENSION_XCU = "extension_xcu" ; // <= global cfg file + private static final java.lang.String PROP_EXTENSION_PKG = "extension_pkg" ; // <= global cfg file + + private static final java.lang.String PROP_DELIMITER = "delimiter" ; // <= global cfg file + private static final java.lang.String PROP_TRIM = "trim" ; // <= global cfg file + private static final java.lang.String PROP_DECODE = "decode" ; // <= global cfg file + + private static final java.lang.String PROP_FRAGMENTSDIR = "fragmentsdir" ; // <= cmdline + private static final java.lang.String PROP_TEMPDIR = "tempdir" ; // <= cmdline + private static final java.lang.String PROP_OUTDIR = "outdir" ; // <= cmdline + private static final java.lang.String PROP_PKG = "pkg" ; // <= cmdline + private static final java.lang.String PROP_DEBUG = "debug" ; // <= cmdline + + private static final java.lang.String PROP_TCFG = "tcfg" ; // <= cmdline + private static final java.lang.String PROP_FCFG = "fcfg" ; // <= cmdline + private static final java.lang.String PROP_LCFG = "lcfg" ; // <= cmdline + private static final java.lang.String PROP_CCFG = "ccfg" ; // <= cmdline + private static final java.lang.String PROP_LANGUAGEPACK = "languagepack" ; // <= cmdline + + private static final java.lang.String PROP_ITEMS = "items" ; // <= pkg cfg files! + + //___________________________________________ + // member + + //------------------------------------------- + /** TODO */ + private ConfigHelper m_aCfg; + + //------------------------------------------- + /** TODO */ + private Logger m_aLog; + + //------------------------------------------- + /** TODO */ + private java.io.File m_aFragmentsDir; + + //------------------------------------------- + /** TODO */ + private java.io.File m_aTempDir; + + //------------------------------------------- + /** TODO */ + private java.io.File m_aOutDir; + + //------------------------------------------- + /** TODO */ + private java.util.Vector m_lTypes; + private java.util.Vector m_lFilters; + private java.util.Vector m_lLoaders; + private java.util.Vector m_lHandlers; + + //___________________________________________ + // interface + + //------------------------------------------- + /** initialize a new instance of this class and + * try to get all needed resources from the config module. + * + * @param aCfg + * provides access to all values of the global + * config file and to the command line. + * + * @param aLog + * can be used to print out log informations. + */ + public Merger(ConfigHelper aCfg, + Logger aLog) + throws java.lang.Exception + { + m_aCfg = aCfg; + m_aLog = aLog; + + m_aFragmentsDir = new java.io.File(m_aCfg.getString(PROP_FRAGMENTSDIR)); + m_aTempDir = new java.io.File(m_aCfg.getString(PROP_TEMPDIR )); +// m_aOutDir = new java.io.File(m_aCfg.getString(PROP_OUTDIR )); + + java.lang.String sDelimiter = m_aCfg.getString(PROP_DELIMITER); + boolean bTrim = m_aCfg.getBoolean(PROP_TRIM); + boolean bDecode = m_aCfg.getBoolean(PROP_DECODE); + + try + { + ConfigHelper aFcfg = new ConfigHelper(m_aCfg.getString(PROP_TCFG), null); + m_lTypes = aFcfg.getStringList(PROP_ITEMS, sDelimiter, bTrim, bDecode); + } + catch(java.util.NoSuchElementException ex1) + { + m_lTypes = new java.util.Vector(); + //m_aLog.setWarning("Fragment list of types is missing. Parameter \"items\" seems to be invalid."); + } + + try + { + ConfigHelper aFcfg = new ConfigHelper(m_aCfg.getString(PROP_FCFG), null); + m_lFilters = aFcfg.getStringList(PROP_ITEMS, sDelimiter, bTrim, bDecode); + } + catch(java.util.NoSuchElementException ex1) + { + m_lFilters = new java.util.Vector(); + //m_aLog.setWarning("Fragment list of filters is missing. Parameter \"items\" seems to be invalid."); + } + + try + { + ConfigHelper aFcfg = new ConfigHelper(m_aCfg.getString(PROP_LCFG), null); + m_lLoaders = aFcfg.getStringList(PROP_ITEMS, sDelimiter, bTrim, bDecode); + } + catch(java.util.NoSuchElementException ex1) + { + m_lLoaders = new java.util.Vector(); + //m_aLog.setWarning("Fragment list of frame loader objects is missing. Parameter \"items\" seems to be invalid."); + } + + try + { + ConfigHelper aFcfg = new ConfigHelper(m_aCfg.getString(PROP_CCFG), null); + m_lHandlers = aFcfg.getStringList(PROP_ITEMS, sDelimiter, bTrim, bDecode); + } + catch(java.util.NoSuchElementException ex1) + { + m_lHandlers = new java.util.Vector(); + //m_aLog.setWarning("Fragment list of content handler objects is missing. Parameter \"items\" seems to be invalid."); + } + } + + //------------------------------------------- + /** TODO */ + public synchronized void merge() + throws java.lang.Exception + { + java.lang.StringBuffer sBuffer = new java.lang.StringBuffer(1000000); + java.lang.String sPackage = m_aCfg.getString(PROP_PKG); + + m_aLog.setGlobalInfo("create package \""+sPackage+"\" ..."); + m_aLog.setDetailedInfo("generate package header ... "); + + sBuffer.append( + XMLHelper.generateHeader( + m_aCfg.getString (PROP_XMLVERSION ), + m_aCfg.getString (PROP_XMLENCODING ), + m_aCfg.getString (PROP_XMLPATH ), + m_aCfg.getString (PROP_XMLPACKAGE ), + m_aCfg.getBoolean(PROP_LANGUAGEPACK, false))); + + // counts all transfered fragments + // Can be used later to decide, if a generated package file + // contains "nothing"! + int nItemCount = 0; + + for (int i=0; i<4; ++i) + { + java.lang.String sSetName = null; + java.lang.String sSubDir = null; + java.util.Vector lFragments = null; + + try + { + switch(i) + { + case 0: // types + { + m_aLog.setDetailedInfo("generate set for types ... "); + sSetName = m_aCfg.getString(PROP_SETNAME_TYPES); + sSubDir = m_aCfg.getString(PROP_SUBDIR_TYPES ); + lFragments = m_lTypes; + } + break; + + case 1: // filters + { + m_aLog.setDetailedInfo("generate set for filter ... "); + sSetName = m_aCfg.getString(PROP_SETNAME_FILTERS); + sSubDir = m_aCfg.getString(PROP_SUBDIR_FILTERS ); + lFragments = m_lFilters; + } + break; + + case 2: // loaders + { + m_aLog.setDetailedInfo("generate set for frame loader ... "); + sSetName = m_aCfg.getString(PROP_SETNAME_LOADERS); + sSubDir = m_aCfg.getString(PROP_SUBDIR_LOADERS ); + lFragments = m_lLoaders; + } + break; + + case 3: // handlers + { + m_aLog.setDetailedInfo("generate set for content handler ... "); + sSetName = m_aCfg.getString(PROP_SETNAME_HANDLERS); + sSubDir = m_aCfg.getString(PROP_SUBDIR_HANDLERS ); + lFragments = m_lHandlers; + } + break; + } + + nItemCount += lFragments.size(); + + getFragments( + new java.io.File(m_aFragmentsDir, sSubDir), + sSetName, + lFragments, + 1, + sBuffer); + } + catch(java.util.NoSuchElementException exIgnore) + { continue; } + } + + m_aLog.setDetailedInfo("generate package footer ... "); + sBuffer.append(XMLHelper.generateFooter()); + + // Attention! + // If the package seem to be empty, it make no sense to generate a corresponding + // xml file. We should suppress writing of this file on disk completly ... + if (nItemCount < 1) + { + m_aLog.setWarning("Package is empty and will not result into a xml file on disk!? Please check configuration file."); + return; + } + m_aLog.setGlobalInfo("package contains "+nItemCount+" items"); + + java.io.File aPackage = new File(sPackage); + m_aLog.setGlobalInfo("write temp package \""+aPackage.getPath()); // TODO encoding must be readed from the configuration + FileHelper.writeEncodedBufferToFile(aPackage, "UTF-8", false, sBuffer); // check for success is done inside this method! + } + + //------------------------------------------- + /** TODO */ + private void getFragments(java.io.File aDir , + java.lang.String sSetName , + java.util.Vector lFragments , + int nPrettyTabs, + java.lang.StringBuffer sBuffer ) + throws java.lang.Exception + { + if (lFragments.size()<1) + { + m_aLog.setWarning("List of fragments is empty!? Will be ignored ..."); + return; + } + + java.util.Enumeration pFragments = lFragments.elements(); + java.lang.String sExtXcu = m_aCfg.getString(PROP_EXTENSION_XCU); + + for (int tabs=0; tabs\n"); + ++nPrettyTabs; + + // special mode for generating language packs. + // In such case we must live with some missing fragment files. + // Reason behind; Not all filters are realy localized. + // But we dont use a different fragment list. We try to locate + // any fragment file in its language-pack version ... + boolean bHandleLanguagePacks = m_aCfg.getBoolean(PROP_LANGUAGEPACK, false); + boolean bDebug = m_aCfg.getBoolean(PROP_DEBUG , false); + java.lang.String sEncoding = "UTF-8"; + if (bDebug) + sEncoding = "UTF-8Special"; + + while(pFragments.hasMoreElements()) + { + java.lang.String sFragment = (java.lang.String)pFragments.nextElement(); + java.io.File aFragment = new java.io.File(aDir, sFragment+"."+sExtXcu); + + // handle simple files only and check for existence! + if (!aFragment.exists()) + { + if (bHandleLanguagePacks) + { + m_aLog.setWarning("language fragment \""+aFragment.getPath()+"\" does not exist. Will be ignored."); + continue; + } + else + throw new java.io.IOException("fragment \""+aFragment.getPath()+"\" does not exists."); + } + + if (!aFragment.isFile()) + { + m_aLog.setWarning("fragment \""+aFragment.getPath()+"\" seem to be not a valid file."); + continue; + } + + // copy file content of original fragment + // Note: A FileNotFoundException will be thrown automaticly by the + // used reader objects. Let it break this method too. Our calli is interested + // on such errors :-) + m_aLog.setDetailedInfo("merge fragment \""+aFragment.getPath()+"\" ..."); + FileHelper.readEncodedBufferFromFile(aFragment, sEncoding, sBuffer); + + sBuffer.append("\n"); + } + + --nPrettyTabs; + for (int tabs=0; tabs\n"); + } +} diff --git a/l10ntools/source/filter/merge/makefile.mk b/l10ntools/source/filter/merge/makefile.mk new file mode 100644 index 000000000000..510ec3202bb4 --- /dev/null +++ b/l10ntools/source/filter/merge/makefile.mk @@ -0,0 +1,96 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2008 by Sun Microsystems, Inc. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.9.102.1 $ +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ = ..$/..$/.. +TARGET = FCFGMerge +PRJNAME = l10ntools +PACKAGE = com$/sun$/star$/filter$/config$/tools$/merge + +# --- Settings ----------------------------------------------------- + +.INCLUDE: settings.mk + +#----- compile .java files ----------------------------------------- +#.IF "$(L10N_framework)"=="" + +OWNCOPY = \ + $(MISC)$/$(TARGET)_copied.done + +#JARFILES = \ +# ridl.jar \ +# unoil.jar \ +# jurt.jar \ +# juh.jar \ +# java_uno.jar + +CFGFILES = \ + FCFGMerge.cfg + +JAVACLASSFILES = \ + $(CLASSDIR)$/$(PACKAGE)$/Merger.class \ + $(CLASSDIR)$/$(PACKAGE)$/FCFGMerge.class + +CUSTOMMANIFESTFILE = \ + Manifest.mf + +MAXLINELENGTH = 100000 + +#----- make a jar from compiled files ------------------------------ + +JARCLASSDIRS = \ + com$/sun$/star$/filter$/config$/tools$/utils \ + com$/sun$/star$/filter$/config$/tools$/merge + +JARTARGET = $(TARGET).jar + +JARCOMPRESS = TRUE + +# --- targets ----------------------------------------------------- + +.INCLUDE : target.mk + +.IF "$(SOLAR_JAVA)" != "" || "$(GUI)"=="OS2" +ALLTAR : $(OWNCOPY) + +.IF "$(JARTARGETN)" != "" +$(JARTARGETN) : $(OWNCOPY) +.ENDIF + +$(OWNCOPY) : $(CFGFILES) + -$(MKDIRHIER) $(CLASSDIR)$/$(PACKAGE) + $(COPY) $? $(CLASSDIR)$/$(PACKAGE) && $(TOUCH) $@ + +.ENDIF # "$(SOLAR_JAVA)" != "" + +#.ELSE +#pseudo: + +#.ENDIF diff --git a/l10ntools/source/filter/utils/AnalyzeStartupLog.java b/l10ntools/source/filter/utils/AnalyzeStartupLog.java new file mode 100644 index 000000000000..498528850697 --- /dev/null +++ b/l10ntools/source/filter/utils/AnalyzeStartupLog.java @@ -0,0 +1,328 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: AnalyzeStartupLog.java,v $ + * $Revision: 1.4 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package com.sun.star.filter.config.tools.utils; + +//_______________________________________________ +// imports +import java.util.*; +import java.lang.*; + +//_______________________________________________ +// implementation +public class AnalyzeStartupLog +{ + private class OperationTime + { + /** name the measured operation. */ + public java.lang.String sOperation; + + /** contains the time value, when this operation was started. */ + public long nStartTime; + + /** contains the time value, when this operation was finished. */ + public long nEndTime; + + /** text inside log file, which identifies the start time value. */ + public java.lang.String sStartMsg; + + /** text inside log file, which identifies the end time value. */ + public java.lang.String sEndMsg; + } + + //_________________________________ + // main + + public static void main(java.lang.String[] lCmdLine) + { + int nExit = 0; + try + { + // analyze command line + ConfigHelper aCmdLine = new ConfigHelper("", lCmdLine); + java.lang.String sLogDir = aCmdLine.getString("logdir" ); + java.lang.String sDataFile = aCmdLine.getString("datafile"); + + if (sLogDir == null || sDataFile == null) + { + System.err.println("AnalyzeStartupLog lodir= datafile="); + System.err.println("E.g.: AnalyzeStartupLog lodir=c:\\temp\\logs datafile=c:\\temp\\data.csv"); + System.exit(--nExit); + } + + // get list of all log files + boolean bRecursive = true; + java.util.Vector lLogs = FileHelper.getSystemFilesFromDir(new java.io.File(sLogDir), bRecursive); + if (lLogs == null || lLogs.isEmpty()) + { + System.err.println("log dir is empty"); + System.exit(--nExit); + } + + // analyze it + java.lang.StringBuffer sOut = new java.lang.StringBuffer(1000); + sOut.append("log;t_cfg_start;t_cfg_end;t_fwk_start;t_fwk_end;t_sfx_start;t_sfx_end;t_types_start;t_types_end;t_filters_start;t_filters_end;"); + sOut.append("t_filters_swriter_start;t_filters_swriter_end;t_filters_sweb_start;t_filters_sweb_end;t_filters_sglobal_start;t_filters_sglobal_end;t_filters_scalc_start;t_filters_scalc_end;t_filters_sdraw_start;t_filters_sdraw_end;t_filters_simpress_start;t_filters_simpress_end;t_filters_schart_start;t_filters_schart_end;t_filters_smath_start;t_filters_smath_end;"); + sOut.append("t_others_start;t_others_end;d_cfg;d_fwk;d_sfx;d_types;d_filters;d_others;d_complete\n"); + + java.util.Enumeration aIt = lLogs.elements(); + while (aIt.hasMoreElements()) + { + java.io.File aLog = (java.io.File)aIt.nextElement(); + java.io.FileReader aReader = new java.io.FileReader(aLog); + java.io.BufferedReader aBuffer = new java.io.BufferedReader(aReader); + + long t_cfg_start = 0; + long t_cfg_end = 0; + + long t_fwk_start = 0; + long t_fwk_end = 0; + + long t_sfx_start = 0; + long t_sfx_end = 0; + + long t_types_start = 0; + long t_types_end = 0; + + long t_filters_start = 0; + long t_filters_end = 0; + + long t_filters_swriter_start = 0; + long t_filters_swriter_end = 0; + + long t_filters_sweb_start = 0; + long t_filters_sweb_end = 0; + + long t_filters_sglobal_start = 0; + long t_filters_sglobal_end = 0; + + long t_filters_scalc_start = 0; + long t_filters_scalc_end = 0; + + long t_filters_sdraw_start = 0; + long t_filters_sdraw_end = 0; + + long t_filters_simpress_start = 0; + long t_filters_simpress_end = 0; + + long t_filters_schart_start = 0; + long t_filters_schart_end = 0; + + long t_filters_smath_start = 0; + long t_filters_smath_end = 0; + + long t_others_start = 0; + long t_others_end = 0; + + while (true) + { + java.lang.String sLine = aBuffer.readLine(); + if (sLine == null) + break; + + if (sLine.endsWith("| framework (as96863) ::FilterCache::FilterCache : { creation ConfigItem [file=standard, version=6, mode=3]")) + t_cfg_start = new java.lang.Long(sLine.substring(0, 6)).longValue(); + else + if (sLine.endsWith("| framework (as96863) ::FilterCache::FilterCache : } creation ConfigItem")) + t_cfg_end = new java.lang.Long(sLine.substring(0, 6)).longValue(); + else + if (sLine.endsWith("| framework (as96863) ::FilterCache::FilterCache : { reading TypeDetection.xml")) + t_fwk_start = new java.lang.Long(sLine.substring(0, 6)).longValue(); + else + if (sLine.endsWith("| framework (as96863) ::FilterCache::FilterCache : } reading TypeDetection.xml")) + t_fwk_end = new java.lang.Long(sLine.substring(0, 6)).longValue(); + else + if (sLine.endsWith("{ framework (as96863) ::FilterCFGAccess::impl_loadTypes")) + t_types_start = new java.lang.Long(sLine.substring(0, 6)).longValue(); + else + if (sLine.endsWith("} framework (as96863) ::FilterCFGAccess::impl_loadTypes")) + t_types_end = new java.lang.Long(sLine.substring(0, 6)).longValue(); + else + if (sLine.endsWith("{ framework (as96863) ::FilterCFGAccess::impl_loadFilters")) + t_filters_start = new java.lang.Long(sLine.substring(0, 6)).longValue(); + else + if (sLine.endsWith("} framework (as96863) ::FilterCFGAccess::impl_loadFilters")) + t_filters_end = new java.lang.Long(sLine.substring(0, 6)).longValue(); + else + if (sLine.endsWith("{ reading FilterGroup [swriter]")) + t_filters_swriter_start = new java.lang.Long(sLine.substring(0, 6)).longValue(); + else + if (sLine.endsWith("} reading FilterGroup [swriter]")) + t_filters_swriter_end = new java.lang.Long(sLine.substring(0, 6)).longValue(); + else + if (sLine.endsWith("{ reading FilterGroup [sweb]")) + t_filters_sweb_start = new java.lang.Long(sLine.substring(0, 6)).longValue(); + else + if (sLine.endsWith("} reading FilterGroup [sweb]")) + t_filters_sweb_end = new java.lang.Long(sLine.substring(0, 6)).longValue(); + else + if (sLine.endsWith("{ reading FilterGroup [sglobal]")) + t_filters_sglobal_start = new java.lang.Long(sLine.substring(0, 6)).longValue(); + else + if (sLine.endsWith("} reading FilterGroup [sglobal]")) + t_filters_sglobal_end = new java.lang.Long(sLine.substring(0, 6)).longValue(); + else + if (sLine.endsWith("{ reading FilterGroup [scalc]")) + t_filters_scalc_start = new java.lang.Long(sLine.substring(0, 6)).longValue(); + else + if (sLine.endsWith("} reading FilterGroup [scalc]")) + t_filters_scalc_end = new java.lang.Long(sLine.substring(0, 6)).longValue(); + else + if (sLine.endsWith("{ reading FilterGroup [sdraw]")) + t_filters_sdraw_start = new java.lang.Long(sLine.substring(0, 6)).longValue(); + else + if (sLine.endsWith("} reading FilterGroup [sdraw]")) + t_filters_sdraw_end = new java.lang.Long(sLine.substring(0, 6)).longValue(); + else + if (sLine.endsWith("{ reading FilterGroup [simpress]")) + t_filters_simpress_start = new java.lang.Long(sLine.substring(0, 6)).longValue(); + else + if (sLine.endsWith("} reading FilterGroup [simpress]")) + t_filters_simpress_end = new java.lang.Long(sLine.substring(0, 6)).longValue(); + else + if (sLine.endsWith("{ reading FilterGroup [schart]")) + t_filters_schart_start = new java.lang.Long(sLine.substring(0, 6)).longValue(); + else + if (sLine.endsWith("} reading FilterGroup [schart]")) + t_filters_schart_end = new java.lang.Long(sLine.substring(0, 6)).longValue(); + else + if (sLine.endsWith("{ reading FilterGroup [smath]")) + t_filters_smath_start = new java.lang.Long(sLine.substring(0, 6)).longValue(); + else + if (sLine.endsWith("} reading FilterGroup [smath]")) + t_filters_smath_end = new java.lang.Long(sLine.substring(0, 6)).longValue(); + else + if (sLine.endsWith("{ framework (as96863) ::FilterCFGAccess::impl_loadDetectors")) + t_others_start = new java.lang.Long(sLine.substring(0, 6)).longValue(); + else + if (sLine.endsWith("} framework (as96863) ::FilterCFGAccess::impl_loadContentHandlers")) + t_others_end = new java.lang.Long(sLine.substring(0, 6)).longValue(); + else + if (sLine.endsWith("} framework (as96863) ::FilterCache::FilterCache")) + t_sfx_start = new java.lang.Long(sLine.substring(0, 6)).longValue(); + else + if (sLine.endsWith("} desktop (lo119109) OfficeWrapper::OfficeWrapper")) + t_sfx_end = new java.lang.Long(sLine.substring(0, 6)).longValue(); + } + + sOut.append(aLog.getName() ); + sOut.append(";" ); + sOut.append(t_cfg_start ); + sOut.append(";" ); + sOut.append(t_cfg_end ); + sOut.append(";" ); + sOut.append(t_fwk_start ); + sOut.append(";" ); + sOut.append(t_fwk_end ); + sOut.append(";" ); + sOut.append(t_sfx_start ); + sOut.append(";" ); + sOut.append(t_sfx_end ); + sOut.append(";" ); + sOut.append(t_types_start ); + sOut.append(";" ); + sOut.append(t_types_end ); + sOut.append(";" ); + sOut.append(t_filters_start ); + sOut.append(";" ); + sOut.append(t_filters_end ); + sOut.append(";" ); + + sOut.append(t_filters_swriter_start ); + sOut.append(";" ); + sOut.append(t_filters_swriter_end ); + sOut.append(";" ); + sOut.append(t_filters_sweb_start ); + sOut.append(";" ); + sOut.append(t_filters_sweb_end ); + sOut.append(";" ); + sOut.append(t_filters_sglobal_start ); + sOut.append(";" ); + sOut.append(t_filters_sglobal_end ); + sOut.append(";" ); + sOut.append(t_filters_scalc_start ); + sOut.append(";" ); + sOut.append(t_filters_scalc_end ); + sOut.append(";" ); + sOut.append(t_filters_sdraw_start ); + sOut.append(";" ); + sOut.append(t_filters_sdraw_end ); + sOut.append(";" ); + sOut.append(t_filters_simpress_start ); + sOut.append(";" ); + sOut.append(t_filters_simpress_end ); + sOut.append(";" ); + sOut.append(t_filters_schart_start ); + sOut.append(";" ); + sOut.append(t_filters_schart_end ); + sOut.append(";" ); + sOut.append(t_filters_smath_start ); + sOut.append(";" ); + sOut.append(t_filters_smath_end ); + sOut.append(";" ); + + sOut.append(t_others_start ); + sOut.append(";" ); + sOut.append(t_others_end ); + sOut.append(";" ); + sOut.append(t_cfg_end -t_cfg_start ); + sOut.append(";" ); + sOut.append(t_fwk_end -t_fwk_start ); + sOut.append(";" ); + sOut.append(t_sfx_end -t_sfx_start ); + sOut.append(";" ); + sOut.append(t_types_end -t_types_start ); + sOut.append(";" ); + sOut.append(t_filters_end-t_filters_start); + sOut.append(";" ); + sOut.append(t_others_end -t_others_start ); + sOut.append(";" ); + sOut.append(t_others_end -t_cfg_start ); + sOut.append("\n" ); + + aBuffer.close(); + } + + java.io.FileWriter aCSV = new java.io.FileWriter(sDataFile); + java.lang.String sData = sOut.toString(); + aCSV.write(sData, 0, sData.length()); + aCSV.flush(); + aCSV.close(); + } + catch(java.lang.Throwable exAny) + { + System.err.println(exAny.getMessage()); + exAny.printStackTrace(); + System.exit(--nExit); + } + + System.exit(0); + } +} diff --git a/l10ntools/source/filter/utils/Cache.java b/l10ntools/source/filter/utils/Cache.java new file mode 100644 index 000000000000..94c26008ed13 --- /dev/null +++ b/l10ntools/source/filter/utils/Cache.java @@ -0,0 +1,2449 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: Cache.java,v $ + * $Revision: 1.7 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +package com.sun.star.filter.config.tools.utils; + +//_______________________________________________ + +import java.lang.*; +import java.util.*; +import java.io.*; + +//_______________________________________________ + +/** + * It implements a container for all possible entries which are part of the type + * and filter mechanism of an office - means all items of the configuration file + * "TypeDetection". How these entries will be readed or written can be switch + * in different modes. That would make it possible to edit an xml directly or + * to contact a running office instance. + * + * + */ +public class Cache +{ + //___________________________________________ + // public const + + /** identifies a file type item of this cache. */ + public static final int E_TYPE = 0; + + /** identifies a filter item of this cache. */ + public static final int E_FILTER = 1; + + /** identifies a detect service item of this cache. */ + public static final int E_DETECTSERVICE = 2; + + /** identifies a frame loader item of this cache. */ + public static final int E_FRAMELOADER = 3; + + /** identifies a content handler item of this cache. */ + public static final int E_CONTENTHANDLER = 4; + + /** indicates an unsupported xml format => error! */ + public static final int FORMAT_UNSUPPORTED = -1; + + /** identify the configuration format of an office 6.0. + * The own formated data string is used. */ + public static final int FORMAT_60 = 0; + + /** identify the configuration format of an office 6.y. + * Properties are realy xml tags again. */ + public static final int FORMAT_6Y = 1; + + /** identify the configuration format which is used inside + * this tooling project. */ + public static final int FORMAT_INTERNAL = 2; + + /** right value for a command line parameter to define a 6.0 version. */ + public static final java.lang.String CMDVAL_FORMAT_60 = "6.0"; + + /** right value for a command line parameter to define a 6.Y version. */ + public static final java.lang.String CMDVAL_FORMAT_6Y = "6.Y"; + + /** right value for a command line parameter to define an internal xml version! */ + public static final java.lang.String CMDVAL_FORMAT_INTERNAL = "internal"; + + // general + public static final java.lang.String PROPNAME_DATA = "Data"; + public static final java.lang.String PROPNAME_NAME = "Name"; + public static final java.lang.String PROPNAME_UINAME = "UIName"; + public static final java.lang.String PROPNAME_UINAMES = "UINames"; + + // type 6.0 ... + public static final java.lang.String PROPNAME_MEDIATYPE = "MediaType"; + public static final java.lang.String PROPNAME_PREFERRED = "Preferred"; + public static final java.lang.String PROPNAME_CLIPBOARDFORMAT = "ClipboardFormat"; + public static final java.lang.String PROPNAME_DOCUMENTICONID = "DocumentIconID"; + public static final java.lang.String PROPNAME_URLPATTERN = "URLPattern"; + public static final java.lang.String PROPNAME_EXTENSIONS = "Extensions"; + // ... +6.y + public static final java.lang.String PROPNAME_UIORDER = "UIOrder"; + public static final java.lang.String PROPNAME_PREFERREDFILTER = "PreferredFilter"; + public static final java.lang.String PROPNAME_DETECTSERVICE = "DetectService"; + public static final java.lang.String PROPNAME_FRAMELOADER = "FrameLoader"; + public static final java.lang.String PROPNAME_CONTENTHANDLER = "ContentHandler"; + + // filter + public static final java.lang.String PROPNAME_DOCUMENTSERVICE = "DocumentService"; + public static final java.lang.String PROPNAME_FILEFORMATVERSION = "FileFormatVersion"; + public static final java.lang.String PROPNAME_FILTERSERVICE = "FilterService"; + public static final java.lang.String PROPNAME_FLAGS = "Flags"; + public static final java.lang.String PROPNAME_ORDER = "Order"; // -6.y + public static final java.lang.String PROPNAME_TEMPLATENAME = "TemplateName"; + public static final java.lang.String PROPNAME_TYPE = "Type"; + public static final java.lang.String PROPNAME_UICOMPONENT = "UIComponent"; + public static final java.lang.String PROPNAME_USERDATA = "UserData"; + + // frame loader / detect services / content handler + public static final java.lang.String PROPNAME_TYPES = "Types"; + + //___________________________________________ + // private const + + private static final java.lang.String FILTERSERVICE_NATIVEWARPPER = "com.sun.star.filter.NativeFilterWrapper"; + private static final java.lang.String GENERIC_DETECTSERVICE = "com.sun.star.comp.office.FrameLoader"; + + /** its the name of the cfg set, which contains all types. */ + private static final java.lang.String CFGNODE_TYPES = "Types"; + + /** its the name of the cfg set, which contains all filters. */ + private static final java.lang.String CFGNODE_FILTERS = "Filters"; + + /** its the name of the cfg set, which contains all detect services. */ + private static final java.lang.String CFGNODE_DETECTSERVICES = "DetectServices"; + + /** its the name of the cfg set, which contains all frame loaders. */ + private static final java.lang.String CFGNODE_FRAMELOADERS = "FrameLoaders"; + + /** its the name of the cfg set, which contains all content handlers. */ + private static final java.lang.String CFGNODE_CONTENTHANDLERS = "ContentHandlers"; + + // names for filter flags + private static final java.lang.String FLAGNAME_3RDPARTYFILTER = "3RDPARTYFILTER"; + private static final java.lang.String FLAGNAME_ALIEN = "ALIEN"; + private static final java.lang.String FLAGNAME_ASYNCHRON = "ASYNCHRON"; + private static final java.lang.String FLAGNAME_BROWSERPREFERRED = "BROWSERPREFERRED"; + private static final java.lang.String FLAGNAME_CONSULTSERVICE = "CONSULTSERVICE"; + private static final java.lang.String FLAGNAME_DEFAULT = "DEFAULT"; + private static final java.lang.String FLAGNAME_EXPORT = "EXPORT"; + private static final java.lang.String FLAGNAME_IMPORT = "IMPORT"; + private static final java.lang.String FLAGNAME_INTERNAL = "INTERNAL"; + private static final java.lang.String FLAGNAME_NOTINCHOOSER = "NOTINCHOOSER"; + private static final java.lang.String FLAGNAME_NOTINFILEDIALOG = "NOTINFILEDIALOG"; + private static final java.lang.String FLAGNAME_NOTINSTALLED = "NOTINSTALLED"; + private static final java.lang.String FLAGNAME_OWN = "OWN"; + private static final java.lang.String FLAGNAME_PACKED = "PACKED"; + private static final java.lang.String FLAGNAME_PREFERRED = "PREFERRED"; + private static final java.lang.String FLAGNAME_READONLY = "READONLY"; + private static final java.lang.String FLAGNAME_SILENTEXPORT = "SILENTEXPORT"; + private static final java.lang.String FLAGNAME_TEMPLATE = "TEMPLATE"; + private static final java.lang.String FLAGNAME_TEMPLATEPATH = "TEMPLATEPATH"; + private static final java.lang.String FLAGNAME_USESOPTIONS = "USESOPTIONS"; + + private static final java.lang.String FLAGNAME_COMBINED = "COMBINED"; + private static final java.lang.String FLAGNAME_SUPPORTSSELECTION= "SUPPORTSSELECTION"; + + // values for filter flags + private static final int FLAGVAL_3RDPARTYFILTER = 0x00080000; // 524288 + private static final int FLAGVAL_ALIEN = 0x00000040; // 64 + private static final int FLAGVAL_ALL = 0xffffffff; // 4294967295 + private static final int FLAGVAL_ASYNCHRON = 0x00004000; // 16384 + private static final int FLAGVAL_BROWSERPREFERRED = 0x00400000; // 4194304 + private static final int FLAGVAL_CONSULTSERVICE = 0x00040000; // 262144 + private static final int FLAGVAL_DEFAULT = 0x00000100; // 256 + private static final int FLAGVAL_EXPORT = 0x00000002; // 2 + private static final int FLAGVAL_IMPORT = 0x00000001; // 1 + private static final int FLAGVAL_INTERNAL = 0x00000008; // 8 + private static final int FLAGVAL_NOTINCHOOSER = 0x00002000; // 8192 + private static final int FLAGVAL_NOTINFILEDIALOG = 0x00001000; // 4096 + private static final int FLAGVAL_NOTINSTALLED = 0x00020000; // 131072 + private static final int FLAGVAL_OWN = 0x00000020; // 32 + private static final int FLAGVAL_PACKED = 0x00100000; // 1048576 + private static final int FLAGVAL_PREFERRED = 0x10000000; // 268435456 + private static final int FLAGVAL_READONLY = 0x00010000; // 65536 + private static final int FLAGVAL_SILENTEXPORT = 0x00200000; // 2097152 + private static final int FLAGVAL_TEMPLATE = 0x00000004; // 4 + private static final int FLAGVAL_TEMPLATEPATH = 0x00000010; // 16 + private static final int FLAGVAL_USESOPTIONS = 0x00000080; // 128 + + private static final int FLAGVAL_COMBINED = 0x00800000; // ... + private static final int FLAGVAL_SUPPORTSSELECTION = 0x00000400; // 1024 + + //___________________________________________ + // member + + /** list of all located types. + * Format: [string,HashMap] + */ + private java.util.HashMap m_lTypes; + + /** list of all located filters. + * Format: [string,HashMap] + */ + private java.util.HashMap m_lFilters; + + /** list of all located detect services. + * Format: [string,HashMap] + */ + private java.util.HashMap m_lDetectServices; + + /** list of all located frame loader. + * Format: [string,HashMap] + */ + private java.util.HashMap m_lFrameLoaders; + + /** list of all located content handler. + * Format: [string,HashMap] + */ + private java.util.HashMap m_lContentHandlers; + + /** contains all analyzed relations between + * filters and types. The key is an internal + * type name (can be used as reference into the + * list m_lTypes) and the value is a Vector of all + * internal filter names, which are registered for + * this type. + * Format: [string, Vector] + */ + private java.util.HashMap m_lFilterToTypeRegistrations; + + private int m_nDoubleRegisteredFilters; + private int m_nTypesForFilters; + private int m_nTypesForDetectServices; + private int m_nTypesForFrameLoaders; + private int m_nTypesForContentHandlers; + + /** can be used to log different informations. */ + private Logger m_aDebug; + + //___________________________________________ + // interface + + /** standard ctor. + * + * Initialize an empty cache instance. You have to use + * on of the fromXXX() methods to fill it from different + * sources with content. + */ + public Cache(Logger aDebug) + { + reset(); + m_aDebug = aDebug; + } + + //___________________________________________ + + /** free memory and set default values on all members. + */ + public synchronized void reset() + { + m_lTypes = new java.util.HashMap(); + m_lFilters = new java.util.HashMap(); + m_lFrameLoaders = new java.util.HashMap(); + m_lDetectServices = new java.util.HashMap(); + m_lContentHandlers = new java.util.HashMap(); + m_lFilterToTypeRegistrations = new java.util.HashMap(); + m_aDebug = new Logger(); + m_nDoubleRegisteredFilters = 0; + m_nTypesForFilters = 0; + m_nTypesForDetectServices = 0; + m_nTypesForFrameLoaders = 0; + m_nTypesForContentHandlers = 0; + } + + //___________________________________________ + + /** converts a string representation of an xml format + * to its int value, which must be used at some interface + * methods of this cache. + * + * If the given string does not match to any well known format, + * the return value will be FORMAT_UNSUPPORTED. The calli have to + * check that. Otherwhise a called interface method at this cache + * instance will be rejected by an exception! + * + * @param sFormat + * the string representation + * Must be one of our public const values from type CMDVAL_FORMAT_xxx. + * + * @return [int] + * the int representation. + * Will be one of our public const values from type FORMAT_xxx. + */ + public static int mapFormatString2Format(java.lang.String sFormat) + { + int nFormat = FORMAT_UNSUPPORTED; + if (sFormat.equalsIgnoreCase(CMDVAL_FORMAT_60)) + nFormat = FORMAT_60; + else + if (sFormat.equalsIgnoreCase(CMDVAL_FORMAT_6Y)) + nFormat = FORMAT_6Y; + else + if (sFormat.equalsIgnoreCase(CMDVAL_FORMAT_INTERNAL)) + nFormat = FORMAT_INTERNAL; + return nFormat; + } + + //___________________________________________ + + /** return some statistic values. + * + * Such values can be: - count of container items, + * - ... + * + * @return [java.lang.String] + * a formated string, which contains al statistic data. + */ + public synchronized java.lang.String getStatistics() + { + java.lang.StringBuffer sBuffer = new java.lang.StringBuffer(256); + + sBuffer.append("types = "+m_lTypes.size() +"\n"); + sBuffer.append("filters = "+m_lFilters.size() +"\n"); + sBuffer.append("detect services = "+m_lDetectServices.size() +"\n"); + sBuffer.append("frame loaders = "+m_lFrameLoaders.size() +"\n"); + sBuffer.append("content handler = "+m_lContentHandlers.size() +"\n"); + sBuffer.append("double registered filters = "+m_nDoubleRegisteredFilters+"\n"); + sBuffer.append("types used by filters = "+m_nTypesForFilters +"\n"); + sBuffer.append("types used by detect services = "+m_nTypesForDetectServices +"\n"); + sBuffer.append("types used by frame loaders = "+m_nTypesForFrameLoaders +"\n"); + sBuffer.append("types used by content handlers = "+m_nTypesForContentHandlers+"\n"); + + return sBuffer.toString(); + } + + //___________________________________________ + + /** reset this cache and fill it with new values using the given XML file. + * + * @param aXML + * must be a system file of a suitable XML file, which + * include all neccessary type/filter items. + * + * @param nFormat + * identifies the format of the specified xml file, + * which must be interpreted. + */ + public synchronized void fromXML(java.io.File aXML , + int nFormat) + throws java.lang.Exception + { + // clear this cache + reset(); + + // parse it + javax.xml.parsers.DocumentBuilderFactory aFactory = javax.xml.parsers.DocumentBuilderFactory.newInstance(); + /* Attention: + * This call is important. It force right handling of entities during parsing and(!) + * writing. It let all possible signs for entities or it's quoted representations + * untouched. So this class don't change the original signs of the original file. + * Means: + *
    + *
  • (') => (')
  • + *
  • (") => (")
  • + *
  • (>) => (>)
  • + *
  • (<) => (<)
  • + *
  • (>) => (>)
  • + *
  • (&) => (&)
  • + *
  • ...
  • + *
+ */ + + System.out.println("TODO: must be adapted to java 1.3 :-("); + System.exit(-1); +//TODO_JAVA aFactory.setExpandEntityReferences(false); + + javax.xml.parsers.DocumentBuilder aBuilder = aFactory.newDocumentBuilder(); + org.w3c.dom.Document aDOM = aBuilder.parse(aXML); + org.w3c.dom.Element aRoot = aDOM.getDocumentElement(); + + // step over all sets + java.util.Vector lSetNodes = XMLHelper.extractChildNodesByTagName(aRoot, XMLHelper.XMLTAG_NODE); + java.util.Enumeration it1 = lSetNodes.elements(); + while (it1.hasMoreElements()) + { + // try to find out, which set should be read + org.w3c.dom.Node aSetNode = (org.w3c.dom.Node)it1.nextElement(); + java.lang.String sSetName = XMLHelper.extractNodeAttribByName(aSetNode, XMLHelper.XMLATTRIB_OOR_NAME); + if (sSetName == null) + throw new java.io.IOException("unsupported format: could not extract set name on node ...\n"+aSetNode); + + // map some generic interfaces to the right members! + int eType = -1 ; + java.util.HashMap rMap = null; + + if (sSetName.equals(CFGNODE_TYPES)) + { + eType = E_TYPE; + rMap = m_lTypes; + } + else + if (sSetName.equals(CFGNODE_FILTERS)) + { + eType = E_FILTER; + rMap = m_lFilters; + } + else + if (sSetName.equals(CFGNODE_FRAMELOADERS)) + { + eType = E_FRAMELOADER; + rMap = m_lFrameLoaders; + } + else + if (sSetName.equals(CFGNODE_DETECTSERVICES)) + { + eType = E_DETECTSERVICE; + rMap = m_lDetectServices; + } + else + if (sSetName.equals(CFGNODE_CONTENTHANDLERS)) + { + eType = E_CONTENTHANDLER; + rMap = m_lContentHandlers; + } + else + throw new java.io.IOException("unsupported format: unknown set name [\""+sSetName+"\"] detected on node ...\n"+aSetNode); + + // load all set entries + java.util.Vector lChildNodes = XMLHelper.extractChildNodesByTagName(aSetNode, XMLHelper.XMLTAG_NODE); + java.util.Enumeration it2 = lChildNodes.elements(); + while (it2.hasMoreElements()) + { + org.w3c.dom.Node aChildNode = (org.w3c.dom.Node)it2.nextElement(); + java.lang.String sChildName = XMLHelper.extractNodeAttribByName(aChildNode, XMLHelper.XMLATTRIB_OOR_NAME); + if (sChildName == null) + throw new java.io.IOException("unsupported format: could not extract child node name on node ...\n"+aChildNode); + java.util.HashMap aPropSet = null; + + // Note: Our internal format is different from the source format! + java.util.HashMap aTempSet = XMLHelper.convertNodeToPropSet(aChildNode); + switch(eType) + { + case E_TYPE : + { + aPropSet = Cache.convertTypePropsToInternal(aTempSet, nFormat); + m_aDebug.setDetailedInfo("type [\""+sChildName+"\"] converted to internal format"); + } + break; + + case E_FILTER : + { + aPropSet = Cache.convertFilterPropsToInternal(aTempSet, nFormat); + m_aDebug.setDetailedInfo("filter [\""+sChildName+"\"] converted to internal format"); + } + break; + + case E_DETECTSERVICE : + { + aPropSet = Cache.convertDetectServicePropsToInternal(aTempSet, nFormat); + m_aDebug.setDetailedInfo("detect service [\""+sChildName+"\"] converted to internal format"); + } + break; + + case E_FRAMELOADER : + { + aPropSet = Cache.convertFrameLoaderPropsToInternal(aTempSet, nFormat); + m_aDebug.setDetailedInfo("frame loader [\""+sChildName+"\"] converted to internal format"); + } + break; + + case E_CONTENTHANDLER : + { + aPropSet = Cache.convertContentHandlerPropsToInternal(aTempSet, nFormat); + m_aDebug.setDetailedInfo("content handler [\""+sChildName+"\"] converted to internal format"); + } + break; + } + m_aDebug.setDetailedInfo("props = "+aTempSet); + rMap.put(sChildName, aPropSet); + } + } + } + + //___________________________________________ + + /** create some hml views of the current content of this cache. + * + * The given directory is used to create different html files + * there. Every of them show another aspect of this cache. + * E.g.: - all type/filter properties + * - relation ships between types/filters/loaders etc. + * + * @param aDirectory + * points to a system directory, which + * can be used completely(!) to generate + * the results there. + * + * @param nFormat + * specify in which context the cache items should be + * interpreted. + */ + public synchronized void toHTML(java.io.File aDirectory, + int nFormat , + java.lang.String sEncoding ) + throws java.lang.Exception + { + if (nFormat != FORMAT_6Y) + throw new java.lang.Exception("HTML views are supported for the new 6.y format only yet."); + + java.lang.StringBuffer sRelationView = new java.lang.StringBuffer(1000); + sRelationView.append("
Relation View
"); + sRelationView.append(""); + sRelationView.append(""); + + java.util.Iterator aIt = m_lTypes.keySet().iterator(); + while (aIt.hasNext()) + { + java.lang.String sType = (java.lang.String)aIt.next(); + java.util.HashMap aType = (java.util.HashMap)m_lTypes.get(sType); + + sRelationView.append(""); + sRelationView.append(""); + + java.lang.String sVal = (java.lang.String)aType.get(PROPNAME_DETECTSERVICE); + if (sVal == null || sVal.length()<1) + sRelationView.append(""); + else + sRelationView.append(""); + + sVal = (java.lang.String)aType.get(PROPNAME_PREFERREDFILTER); + if (sVal == null || sVal.length()<1) + sRelationView.append(""); + else + sRelationView.append(""); + + sVal = (java.lang.String)aType.get(PROPNAME_FRAMELOADER); + if (sVal == null || sVal.length()<1) + sRelationView.append(""); + else + sRelationView.append(""); + + sVal = (java.lang.String)aType.get(PROPNAME_CONTENTHANDLER); + if (sVal == null || sVal.length()<1) + sRelationView.append(""); + else + sRelationView.append(""); + + sRelationView.append(""); + } + + sRelationView.append("
typedetect servicepreferred filterframe loadercontent handler
"+sType+" - "+sVal+" - "+sVal+" - "+sVal+" - "+sVal+"
"); + sRelationView.append(""); + + FileHelper.writeEncodedBufferToFile(new java.io.File(aDirectory, "relation_view.html"), sEncoding, false, sRelationView); + + java.util.HashMap lFilters2TypeRegistration = new java.util.HashMap(); + aIt = m_lFilters.keySet().iterator(); + while (aIt.hasNext()) + { + java.lang.String sFilter = (java.lang.String)aIt.next(); + java.util.HashMap aFilter = (java.util.HashMap)m_lFilters.get(sFilter); + java.lang.String sType = (java.lang.String)aFilter.get(PROPNAME_TYPE); + + java.util.Vector lFilters = (java.util.Vector)lFilters2TypeRegistration.get(sType); + if (lFilters == null) + lFilters = new java.util.Vector(); + lFilters.add(sFilter); + lFilters2TypeRegistration.put(sType, lFilters); + } + + java.lang.StringBuffer sType2FiltersView = new java.lang.StringBuffer(1000); + sType2FiltersView.append("
Type2Filters View
"); + sType2FiltersView.append(""); + sType2FiltersView.append(""); + + aIt = lFilters2TypeRegistration.keySet().iterator(); + while (aIt.hasNext()) + { + java.lang.String sType = (java.lang.String)aIt.next(); + java.util.Vector lFilters = (java.util.Vector)lFilters2TypeRegistration.get(sType); + + sType2FiltersView.append(""); + } + + sType2FiltersView.append("
typefilters
"+sType+""); + java.util.Enumeration aEn = lFilters.elements(); + while(aEn.hasMoreElements()) + sType2FiltersView.append(aEn.nextElement()+"
"); + sType2FiltersView.append("
"); + sType2FiltersView.append(""); + + FileHelper.writeEncodedBufferToFile(new java.io.File(aDirectory, "type2filters_view.html"), sEncoding, false, sType2FiltersView); + } + + //___________________________________________ + + /** converts all items of this cache to its xml representation + * and write it to the given file. + * + * @param aXML + * the target file for output. + * + * @param nFormat + * the requested xml format. + * see const values FORMAT_xxx too. + * + * @param sEncoding + * specify the file encoding for the generated xml file. + * + * @throws [java.lang.Exception] + * if something fail during convertion. + */ + public synchronized void toXML(java.io.File aXML , + int nFormat , + java.lang.String sEncoding) + throws java.lang.Exception + { + java.lang.StringBuffer sXML = new java.lang.StringBuffer(500000); + + for (int i=0; i<5; ++i) + { + // define right sub container + java.lang.String sSetName = null; + java.util.HashMap rMap = null; + int eType = -1; + + switch(i) + { + case 0 : + { + sSetName = CFGNODE_TYPES; + rMap = m_lTypes; + eType = E_TYPE; + } + break; + + case 1 : + { + sSetName = CFGNODE_FILTERS; + rMap = m_lFilters; + eType = E_FILTER; + } + break; + + case 2 : + { + sSetName = CFGNODE_DETECTSERVICES; + rMap = m_lDetectServices; + eType = E_DETECTSERVICE; + } + break; + + case 3 : + { + sSetName = CFGNODE_FRAMELOADERS; + rMap = m_lFrameLoaders; + eType = E_FRAMELOADER; + } + break; + + case 4 : + { + sSetName = CFGNODE_CONTENTHANDLERS; + rMap = m_lContentHandlers; + eType = E_CONTENTHANDLER; + } + break; + } + + // generate set + sXML.append("\n"); + java.util.Iterator it = rMap.keySet().iterator(); + while(it.hasNext()) + { + java.lang.String sItem = (java.lang.String)it.next(); + sXML.append("\n"); + sXML.append(getItemAsXML(eType, sItem, nFormat)); + sXML.append("\n"); + } + sXML.append("\n"); + } + + java.io.FileOutputStream aStream = new java.io.FileOutputStream(aXML.getAbsolutePath(), false); + java.io.OutputStreamWriter aWriter = new java.io.OutputStreamWriter(aStream, sEncoding); + java.lang.String sOut = sXML.toString(); + aWriter.write(sOut, 0, sOut.length()); + aWriter.flush(); + aWriter.close(); + } + + //___________________________________________ + + /** converts a type property set from internal format + * to an external one. + * + * @param aMap + * points to the item, which should be converted. + * + * @param nFormat + * specify the requested output format. + * + * @return [java.util.HashMap] + * contains the properties in the requested format. + * + * @throws [java.lang.Exception + * if something fail during convertion. + */ + private static java.util.HashMap convertTypePropsToExternal(java.util.HashMap aMap , + int nFormat) + throws java.lang.Exception + { + java.util.HashMap aResultMap = new java.util.HashMap(); + // copy Name property ... if it exists! + if (aMap.containsKey(PROPNAME_NAME)) + aResultMap.put(PROPNAME_NAME, aMap.get(PROPNAME_NAME)); + switch(nFormat) + { + //----------------------------------- + case FORMAT_60 : + { + // copy UIName property unchanged + aResultMap.put(PROPNAME_UINAME, aMap.get(PROPNAME_UINAME)); + + // ignore properties "UIOrder", "PreferredFilter", "DetectService" + // They are not supported for 6.0 types. + + // pack all other properties to one "Data" string value + java.lang.StringBuffer sData = new java.lang.StringBuffer(256); + + sData.append(aMap.get(PROPNAME_PREFERRED)); + sData.append(","); + sData.append(aMap.get(PROPNAME_MEDIATYPE)); + sData.append(","); + sData.append(aMap.get(PROPNAME_CLIPBOARDFORMAT)); + sData.append(","); + + java.util.Vector lList = (java.util.Vector)aMap.get(PROPNAME_URLPATTERN); + int c = lList.size(); + int i = 0; + for (i=0; i aExpandedMap["UIName"] + * aMap["Data" ] => aExpandedMap["Preferred" ], aExpandedMap["MediaType"] etc. ... + * + * @param aMap + * points to the item, which should be converted. + + * @param nFormat + * specify the external format. + * + * @return [java.util.HashMap] + * The new map in internal format. + */ + private static java.util.HashMap convertTypePropsToInternal(java.util.HashMap aMap , + int nFormat) + throws java.lang.Exception + { + java.util.HashMap aResultMap = new java.util.HashMap(); + // copy Name property ... if it exists! + if (aMap.containsKey(PROPNAME_NAME)) + aResultMap.put(PROPNAME_NAME, aMap.get(PROPNAME_NAME)); + switch(nFormat) + { + //----------------------------------- + case FORMAT_60 : + { + // copy UIName property unchanged! + aResultMap.put(PROPNAME_UINAME, aMap.get(PROPNAME_UINAME)); + + // generate new property "UIOrder" + // Its the moved property "Order" of filters for versions >= 6.y! + aResultMap.put(PROPNAME_UIORDER, new java.lang.Integer(0)); + + // generate new property "PreferredFilter" + // Its a the moved filter flag "Preferred" for versions >= 6.y! + aResultMap.put(PROPNAME_PREFERREDFILTER, new java.lang.String()); + + // generate new property "DetectService" + // Every type know its detector diretcly from now. No search + // will be neccessary any longer. + aResultMap.put(PROPNAME_DETECTSERVICE, new java.lang.String()); + + // analyze the Data property of the original map + // and copy its results (means all expanded properties) + // to the result map. + java.lang.String sDataVal = (java.lang.String)aMap.get(PROPNAME_DATA); + java.util.Vector lTokens = Cache.splitTokenString(sDataVal, ","); + + int t = 0; + java.util.Enumeration it = lTokens.elements(); + while (it.hasMoreElements()) + { + java.lang.String sToken = (java.lang.String)it.nextElement(); + switch(t) + { + case 0 : + aResultMap.put(PROPNAME_PREFERRED, new java.lang.Boolean(sToken)); + break; + case 1 : + aResultMap.put(PROPNAME_MEDIATYPE, sToken); + break; + case 2 : + { + /*HACK ersetze %20 mit " " ...*/ + int ni = sToken.indexOf("%20"); + if (ni!=-1) + { + java.lang.String sPatch = sToken.substring(0,ni) + " " + sToken.substring(ni+3); + sToken = sPatch; + } + aResultMap.put(PROPNAME_CLIPBOARDFORMAT, sToken); + } + break; + case 3 : + aResultMap.put(PROPNAME_URLPATTERN, Cache.splitTokenString(sToken, ";")); + break; + case 4 : + aResultMap.put(PROPNAME_EXTENSIONS, Cache.splitTokenString(sToken, ";")); + break; + case 5 : + aResultMap.put(PROPNAME_DOCUMENTICONID, new java.lang.Integer(sToken)); + break; + default : + throw new java.lang.Exception("unsupported format for data value of a type \""+aMap.get(PROPNAME_NAME)+"\" detected."); + } + ++t; + } + } + break; + + //----------------------------------- + case FORMAT_6Y : + { + // copy all supported properties directly + aResultMap.put(PROPNAME_PREFERRED , aMap.get(PROPNAME_PREFERRED )); + aResultMap.put(PROPNAME_MEDIATYPE , aMap.get(PROPNAME_MEDIATYPE )); + aResultMap.put(PROPNAME_CLIPBOARDFORMAT, aMap.get(PROPNAME_CLIPBOARDFORMAT)); + aResultMap.put(PROPNAME_URLPATTERN , aMap.get(PROPNAME_URLPATTERN )); + aResultMap.put(PROPNAME_EXTENSIONS , aMap.get(PROPNAME_EXTENSIONS )); + aResultMap.put(PROPNAME_DOCUMENTICONID , aMap.get(PROPNAME_DOCUMENTICONID )); + aResultMap.put(PROPNAME_UINAME , aMap.get(PROPNAME_UINAME )); + aResultMap.put(PROPNAME_UIORDER , aMap.get(PROPNAME_UIORDER )); + aResultMap.put(PROPNAME_PREFERREDFILTER, aMap.get(PROPNAME_PREFERREDFILTER)); + aResultMap.put(PROPNAME_DETECTSERVICE , aMap.get(PROPNAME_DETECTSERVICE )); + } + break; + + //----------------------------------- + default : + throw new java.lang.Exception("unknown format"); + } + + return aResultMap; + } + + //___________________________________________ + + /** converts a filter property set (using an external format) to + * our internal cache format. + * + * Especialy the data format string will be expanded + * to its real properties. + * + * Schema: + * aMap["UIName"] => aExpandedMap["UIName"] + * aMap["Data" ] => aExpandedMap["Order" ], aExpandedMap["Flags"] etc. ... + * + * @param aMap + * points to the item, which should be converted. + * + * @param nFormat + * specify the external format. + * + * @return [java.util.HashMap] + * The new map in internal format. + */ + private static java.util.HashMap convertFilterPropsToInternal(java.util.HashMap aMap , + int nFormat) + throws java.lang.Exception + { + java.util.HashMap aResultMap = new java.util.HashMap(); + // copy Name property ... if it exists! + if (aMap.containsKey(PROPNAME_NAME)) + aResultMap.put(PROPNAME_NAME, aMap.get(PROPNAME_NAME)); + switch(nFormat) + { + //----------------------------------- + case FORMAT_60 : + { + // copy UIName property + aResultMap.put(PROPNAME_UINAME, aMap.get(PROPNAME_UINAME)); + + // analyze the Data property of the original map + // and copy its results (means all expanded properties) + // to the result map. + java.lang.String sDataVal = (java.lang.String)aMap.get(PROPNAME_DATA); + java.util.Vector lTokens = Cache.splitTokenString(sDataVal, ","); + + int t = 0; + java.util.Enumeration it = lTokens.elements(); + while (it.hasMoreElements()) + { + java.lang.String sToken = (java.lang.String)it.nextElement(); + switch(t) + { + case 0 : + aResultMap.put(PROPNAME_ORDER, new java.lang.Integer(sToken)); + break; + case 1 : + aResultMap.put(PROPNAME_TYPE, sToken); + break; + case 2 : + aResultMap.put(PROPNAME_DOCUMENTSERVICE, sToken); + break; + case 3 : + aResultMap.put(PROPNAME_FILTERSERVICE, sToken); + break; + case 4 : + aResultMap.put(PROPNAME_FLAGS, new java.lang.Integer(sToken)); + break; + case 5 : + aResultMap.put(PROPNAME_USERDATA, Cache.splitTokenString(sToken, ";")); + break; + case 6 : + aResultMap.put(PROPNAME_FILEFORMATVERSION, new java.lang.Integer(sToken)); + break; + case 7 : + aResultMap.put(PROPNAME_TEMPLATENAME, sToken); + break; + case 8 : + aResultMap.put(PROPNAME_UICOMPONENT, sToken); + break; + default : + throw new java.lang.Exception("unsupported format for data value of a filter detected."); + } + ++t; + } + + // its an optional property :-) + if (!aResultMap.containsKey(PROPNAME_TEMPLATENAME)) + aResultMap.put(PROPNAME_TEMPLATENAME, new java.lang.String("")); + + // its an optional property :-) + if (!aResultMap.containsKey(PROPNAME_UICOMPONENT)) + aResultMap.put(PROPNAME_UICOMPONENT, new java.lang.String("")); + } + break; + + //----------------------------------- + case FORMAT_6Y : + { + // "Order" does not exist for 6.y versions! Use default. + aResultMap.put(PROPNAME_ORDER, new java.lang.Integer(0)); + + // "UIName" property does not exist for 6.y versions! use default. + /* TODO make it configurable :-) */ + aResultMap.put(PROPNAME_UINAME, aMap.get(PROPNAME_UINAME)); + //aResultMap.put(PROPNAME_UINAME, new java.util.HashMap()); + + // "Flags" must be converted from names to its values + java.util.Vector lFlags = (java.util.Vector)aMap.get(PROPNAME_FLAGS); + java.lang.Integer nFlags = Cache.convertFilterFlagNames2Values(lFlags); + aResultMap.put(PROPNAME_FLAGS, nFlags); + + // copy all direct supported properties + aResultMap.put(PROPNAME_TYPE , aMap.get(PROPNAME_TYPE )); + aResultMap.put(PROPNAME_DOCUMENTSERVICE , aMap.get(PROPNAME_DOCUMENTSERVICE )); + aResultMap.put(PROPNAME_FILTERSERVICE , aMap.get(PROPNAME_ORDER )); + aResultMap.put(PROPNAME_USERDATA , aMap.get(PROPNAME_USERDATA )); + aResultMap.put(PROPNAME_FILEFORMATVERSION, aMap.get(PROPNAME_FILEFORMATVERSION)); + aResultMap.put(PROPNAME_TEMPLATENAME , aMap.get(PROPNAME_TEMPLATENAME )); + aResultMap.put(PROPNAME_UICOMPONENT , aMap.get(PROPNAME_UICOMPONENT )); + } + break; + + //----------------------------------- + default : + throw new java.lang.Exception("unknown format"); + } + + return aResultMap; + } + + private static java.util.HashMap convertDetectServicePropsToInternal(java.util.HashMap aMap , + int nFormat) + throws java.lang.Exception + { + /*FIXME*/ + java.util.HashMap aResultMap = aMap; + return aResultMap; + } + + private static java.util.HashMap convertFrameLoaderPropsToInternal(java.util.HashMap aMap , + int nFormat) + throws java.lang.Exception + { + /*FIXME*/ + java.util.HashMap aResultMap = aMap; + return aResultMap; + } + + private static java.util.HashMap convertContentHandlerPropsToInternal(java.util.HashMap aMap , + int nFormat) + throws java.lang.Exception + { + /*FIXME*/ + java.util.HashMap aResultMap = aMap; + return aResultMap; + } + + //___________________________________________ + + /** converts filter flag names to its int representation. + * + * @param lFlags + * a list of flag names. + * + * @return [java.lang.Integer] + * an integer field of all set flags. + * + * @throws [java.lang.Exception] + * for unsupported flags or empty flag fields! + */ + private static java.lang.Integer convertFilterFlagNames2Values(java.util.Vector lFlags) + throws java.lang.Exception + { + int nFlags = 0; + java.util.Enumeration it = lFlags.elements(); + while(it.hasMoreElements()) + { + java.lang.String sFlagName = (java.lang.String)it.nextElement(); + + if (sFlagName.equals(FLAGNAME_3RDPARTYFILTER)) + nFlags |= FLAGVAL_3RDPARTYFILTER; + else + if (sFlagName.equals(FLAGNAME_ALIEN)) + nFlags |= FLAGVAL_ALIEN; + else + if (sFlagName.equals(FLAGNAME_ASYNCHRON)) + nFlags |= FLAGVAL_ASYNCHRON; + else + if (sFlagName.equals(FLAGNAME_BROWSERPREFERRED)) + nFlags |= FLAGVAL_BROWSERPREFERRED; + else + if (sFlagName.equals(FLAGNAME_CONSULTSERVICE)) + nFlags |= FLAGVAL_CONSULTSERVICE; + else + if (sFlagName.equals(FLAGNAME_DEFAULT)) + nFlags |= FLAGVAL_DEFAULT; + else + if (sFlagName.equals(FLAGNAME_EXPORT)) + nFlags |= FLAGVAL_EXPORT; + else + if (sFlagName.equals(FLAGNAME_IMPORT)) + nFlags |= FLAGVAL_IMPORT; + else + if (sFlagName.equals(FLAGNAME_INTERNAL)) + nFlags |= FLAGVAL_INTERNAL; + else + if (sFlagName.equals(FLAGNAME_NOTINCHOOSER)) + nFlags |= FLAGVAL_NOTINCHOOSER; + else + if (sFlagName.equals(FLAGNAME_NOTINFILEDIALOG)) + nFlags |= FLAGVAL_NOTINFILEDIALOG; + else + if (sFlagName.equals(FLAGNAME_NOTINSTALLED)) + nFlags |= FLAGVAL_NOTINSTALLED; + else + if (sFlagName.equals(FLAGNAME_OWN)) + nFlags |= FLAGVAL_OWN; + else + if (sFlagName.equals(FLAGNAME_PACKED)) + nFlags |= FLAGVAL_PACKED; + else + if (sFlagName.equals(FLAGNAME_PREFERRED)) + nFlags |= FLAGVAL_PREFERRED; + else + if (sFlagName.equals(FLAGNAME_READONLY)) + nFlags |= FLAGVAL_READONLY; + else + if (sFlagName.equals(FLAGNAME_SILENTEXPORT)) + nFlags |= FLAGVAL_SILENTEXPORT; + else + if (sFlagName.equals(FLAGNAME_TEMPLATE)) + nFlags |= FLAGVAL_TEMPLATE; + else + if (sFlagName.equals(FLAGNAME_TEMPLATEPATH)) + nFlags |= FLAGVAL_TEMPLATEPATH; + else + if (sFlagName.equals(FLAGNAME_USESOPTIONS)) + nFlags |= FLAGVAL_USESOPTIONS; + else + if (sFlagName.equals(FLAGNAME_COMBINED)) + nFlags |= FLAGVAL_COMBINED; + else + throw new java.lang.Exception("unsupported filter flag detected: \""+sFlagName+"\""); + } + + if (nFlags == 0) + throw new java.lang.Exception("no filter flags?"); + + return new java.lang.Integer(nFlags); + } + + //___________________________________________ + + /** converts filter flag values to its string representation. + * + * @param nFlags + * the flag field as int value. + * + * @return [java.util.Vector] + * a list of flag names. + * + * @throws [java.lang.Exception] + * for unsupported flags or empty flag fields! + */ + private static java.util.Vector convertFilterFlagValues2Names(java.lang.Integer nFlags) + throws java.lang.Exception + { + java.util.Vector lFlags = new java.util.Vector(); + int field = nFlags.intValue(); + + if (field == 0) + throw new java.lang.Exception("no filter flags?"); + + if((field & FLAGVAL_IMPORT) == FLAGVAL_IMPORT) + lFlags.add(FLAGNAME_IMPORT); + + if((field & FLAGVAL_EXPORT) == FLAGVAL_EXPORT) + lFlags.add(FLAGNAME_EXPORT); + + if((field & FLAGVAL_TEMPLATE) == FLAGVAL_TEMPLATE) + lFlags.add(FLAGNAME_TEMPLATE); + + if((field & FLAGVAL_INTERNAL) == FLAGVAL_INTERNAL) + lFlags.add(FLAGNAME_INTERNAL); + + if((field & FLAGVAL_TEMPLATEPATH) == FLAGVAL_TEMPLATEPATH) + lFlags.add(FLAGNAME_TEMPLATEPATH); + + if((field & FLAGVAL_OWN) == FLAGVAL_OWN) + lFlags.add(FLAGNAME_OWN); + + if((field & FLAGVAL_ALIEN) == FLAGVAL_ALIEN) + lFlags.add(FLAGNAME_ALIEN); + + if((field & FLAGVAL_USESOPTIONS) == FLAGVAL_USESOPTIONS) + lFlags.add(FLAGNAME_USESOPTIONS); + + if((field & FLAGVAL_DEFAULT) == FLAGVAL_DEFAULT) + lFlags.add(FLAGNAME_DEFAULT); + + if((field & FLAGVAL_NOTINFILEDIALOG) == FLAGVAL_NOTINFILEDIALOG) + lFlags.add(FLAGNAME_NOTINFILEDIALOG); + + if((field & FLAGVAL_NOTINCHOOSER) == FLAGVAL_NOTINCHOOSER) + lFlags.add(FLAGNAME_NOTINCHOOSER); + + if((field & FLAGVAL_ASYNCHRON) == FLAGVAL_ASYNCHRON) + lFlags.add(FLAGNAME_ASYNCHRON); + + if((field & FLAGVAL_READONLY) == FLAGVAL_READONLY) + lFlags.add(FLAGNAME_READONLY); + + if((field & FLAGVAL_NOTINSTALLED) == FLAGVAL_NOTINSTALLED) + lFlags.add(FLAGNAME_NOTINSTALLED); + + if((field & FLAGVAL_CONSULTSERVICE) == FLAGVAL_CONSULTSERVICE) + lFlags.add(FLAGNAME_CONSULTSERVICE); + + if((field & FLAGVAL_3RDPARTYFILTER) == FLAGVAL_3RDPARTYFILTER) + lFlags.add(FLAGNAME_3RDPARTYFILTER); + + if((field & FLAGVAL_PACKED) == FLAGVAL_PACKED) + lFlags.add(FLAGNAME_PACKED); + + if((field & FLAGVAL_SILENTEXPORT) == FLAGVAL_SILENTEXPORT) + lFlags.add(FLAGNAME_SILENTEXPORT); + + if((field & FLAGVAL_BROWSERPREFERRED) == FLAGVAL_BROWSERPREFERRED) + lFlags.add(FLAGNAME_BROWSERPREFERRED); + + if((field & FLAGVAL_PREFERRED) == FLAGVAL_PREFERRED) + lFlags.add(FLAGNAME_PREFERRED); + + if((field & FLAGVAL_COMBINED) == FLAGVAL_COMBINED) + lFlags.add(FLAGNAME_COMBINED); + + if((field & FLAGVAL_COMBINED) == FLAGVAL_SUPPORTSSELECTION) + lFlags.add(FLAGNAME_SUPPORTSSELECTION); + + return lFlags; + } + + //___________________________________________ + + /** return a reference to one of our member + * lists for types/filters etc ... + * + * @param eItemType + * specify, which item map is required. + * + * @return [java.util.HashMap] + * a reference(!) to the right member. + * + * @throws [java.lang.Exception] + * if the specified map does not exist. + */ + private java.util.HashMap getItemMap(int eItemType) + throws java.lang.Exception + { + java.util.HashMap rMap = null; + switch(eItemType) + { + case E_TYPE : + rMap = m_lTypes; + break; + + case E_FILTER : + rMap = m_lFilters; + break; + + case E_DETECTSERVICE : + rMap = m_lDetectServices; + break; + + case E_FRAMELOADER : + rMap = m_lFrameLoaders; + break; + + case E_CONTENTHANDLER : + rMap = m_lContentHandlers; + break; + + default: + throw new java.lang.Exception("Invalid item map specified."); + } + return rMap; + } + + //___________________________________________ + + /** return the count of items inside a sub container + * of this cache. + * + * @param eItemType + * specify, which item map is required. + * + * @throws [java.lang.Exception] + * if the specified map does not exist. + */ + public synchronized int getItemCount(int eItemType) + throws java.lang.Exception + { + java.util.HashMap rMap = getItemMap(eItemType); + return rMap.size(); + } + + //___________________________________________ + + /** get a list of all item names of the specified + * sub container. + * + * @param eItemType + * specify, which item map is required. + * + * @throws [java.lang.Exception] + * if the specified map does not exist. + */ + public synchronized java.util.Vector getItemNames(int eItemType) + throws java.lang.Exception + { + java.util.Vector lNames = new java.util.Vector(); + java.util.HashMap rMap = getItemMap(eItemType); + java.util.Iterator it = rMap.keySet().iterator(); + while(it.hasNext()) + lNames.add(it.next()); + return lNames; + } + + //___________________________________________ + + /** get a list of all item names of the specified + * sub coontainer, where items match to given property set. + * + * Note: The given property set must exist at all + * returned items as minimum and every checked property + * value must be equals! Using of reg expressions or + * similar mechanism will not be supported here. + * + * @param eItemType + * specify, which item map is required. + * + * @param aPropSet + * the set of properties, which must + * exist at the returned item as minimum. + * + * @throws [java.lang.Exception] + * if the specified map does not exist. + */ + public synchronized java.util.Vector getMatchedItemNames(int eItemType, + java.util.HashMap aPropSet ) + throws java.lang.Exception + { + java.util.Vector lNames = new java.util.Vector(); + java.util.HashMap rMap = getItemMap(eItemType); + java.util.Iterator it = rMap.keySet().iterator(); + while(it.hasNext()) + { + java.lang.String sItemName = (java.lang.String)it.next(); + java.util.HashMap rItemProps = (java.util.HashMap)rMap.get(sItemName); + + boolean bMatch = Cache.matchPropSet(rItemProps, aPropSet); + if (bMatch) + lNames.add(sItemName); + else + { + java.lang.StringBuffer sBuffer = new java.lang.StringBuffer(1000); + sBuffer.append("entry ["+eItemType+"] \""+sItemName+"\" does not match.\n"); + sBuffer.append("\torg items = {"+rItemProps+"}\n"); + sBuffer.append("\treq items = {"+aPropSet+"}\n"); + + m_aDebug.setDetailedInfo(sBuffer.toString()); + } + } + return lNames; + } + + //___________________________________________ + + /** check if two property sets are equals in its + * shared properties. + * + * Note: Only set properties of the match set will be searched + * inside the original set. And its values must be equals. + * Using of reg expressions or similar mechanism will not + * be supported here. + * + * @param rOrgProps + * the original property set, which should be checked. + * + * @param rMatchProps + * contains the properties, which must be searched + * inside rOrgProps. + * + * @return TRUE if all properties of rMatchProps could be located + * inside rOrgProps. + */ + private static boolean matchPropSet(java.util.HashMap rOrgProps , + java.util.HashMap rMatchProps) + { + java.util.Iterator it = rMatchProps.keySet().iterator(); + while(it.hasNext()) + { + java.lang.String sMatchName = (java.lang.String)it.next(); + java.lang.Object aMatchValue = rMatchProps.get(sMatchName); + + if ( + (!rOrgProps.containsKey(sMatchName) ) || + (!rOrgProps.get(sMatchName).equals(aMatchValue)) + ) + { + return false; + } + } + return true; + } + + //___________________________________________ + + /** return a property set for the queried container item. + * + * @param eItemType + * specify, which item map is required. + * + * @param sItemName + * must be a valid item name of the specified item map. + * + * @return [java.util.HashMap] + * the property set of the queried item. + * Always different from null! + * + * @throws [java.lang.Exception] + * if the specified item does not exists or + * seems to be invalid in general (means null!). + */ + public synchronized java.util.HashMap getItem(int eItemType, + java.lang.String sItemName) + throws java.lang.Exception + { + java.util.HashMap rMap = getItemMap(eItemType); + java.util.HashMap rItem = (java.util.HashMap)rMap.get(sItemName); + if (rItem == null) + throw new java.lang.Exception("Queried item \""+sItemName+"\" does not exist inside this cache."); + return rItem; + } + + //___________________________________________ + + /** return a requested item in XML format. + * + * @param eItemType + * identify the right sub set of this cache + * inside which the requested item should exist. + * e.g. E_TYPE, E_FILTER, ... + * + * @param sItemName + * the name of the request item + * + * @param nXMLFormat + * means the format of the generated xml source. + * + * @return [java.lang.String] + * a xml formated string, which contains all properties + * for this container item. + */ + public synchronized java.lang.String getItemAsXML(int eItemType , + java.lang.String sItemName , + int nXMLFormat) + throws java.lang.Exception + { + // Note: Our internal format must be converted to the target format! + java.util.HashMap rItem = getItem(eItemType, sItemName); + java.util.HashMap rFormatedItem = null; + switch(eItemType) + { + case E_TYPE : + { + rFormatedItem = Cache.convertTypePropsToExternal(rItem, nXMLFormat); + m_aDebug.setGlobalInfo("type to external \""+sItemName+"\""); + } + break; + + case E_FILTER : + { + rFormatedItem = Cache.convertFilterPropsToExternal(rItem, nXMLFormat); + m_aDebug.setGlobalInfo("filter to external \""+sItemName+"\""); + } + break; + + case E_DETECTSERVICE : + { + rFormatedItem = Cache.convertDetectServicePropsToExternal(rItem, nXMLFormat); + m_aDebug.setGlobalInfo("detect service to external \""+sItemName+"\""); + } + break; + + case E_FRAMELOADER : + { + rFormatedItem = Cache.convertFrameLoaderPropsToExternal(rItem, nXMLFormat); + m_aDebug.setGlobalInfo("frame loader to external \""+sItemName+"\""); + } + break; + + case E_CONTENTHANDLER : + { + rFormatedItem = Cache.convertContentHandlerPropsToExternal(rItem, nXMLFormat); + m_aDebug.setGlobalInfo("content handler to external \""+sItemName+"\""); + } + break; + } + + java.lang.StringBuffer sXML = new java.lang.StringBuffer(1000); + int nPrettyTabs = 1; + for (int t=0; t\n"); + sXML.append(XMLHelper.convertPropSetToXML(rFormatedItem, nPrettyTabs+1)); + for (int t=0; t\n"); + + return sXML.toString(); + } + + //___________________________________________ + + /** split the given string (using the specified delimiter) + * and return alist of found string tokens. + * + * Note: Against the normal behaviour of the StringTokenizer class + * this method returns empty tokens too. + * E.g: "0,,1" will return "0" - "" - "1" + * + * @param sTokenString + * the string value, which should be analyzed. + * + * @param sDelim + * the delimiter, which will be used to differe between tokens. + * + * @return [java.util.Vector] + * a list of string tokens. Can be empty - but not null! + */ + private static java.util.Vector splitTokenString(java.lang.String sTokenString, + java.lang.String sDelim ) + { + java.util.Vector lTokens = new java.util.Vector(); + java.util.StringTokenizer aTokenizer = new java.util.StringTokenizer(sTokenString, sDelim, true); + boolean bLastWasDelim = false; + + while (aTokenizer.hasMoreTokens()) + { + java.lang.String sToken = aTokenizer.nextToken(); + if (sToken.equals(sDelim)) + { + if (bLastWasDelim) + { + // last token was a delimiter - new one too + // => an empty token must be placed between these + // two delimiters! Add this empty value to the return list. + lTokens.add(""); + } + else + { + // last token was not a delimiter - new one is such delim + // => ignore this delimiter - but save the information, that + // it occured + bLastWasDelim = true; + } + } + else + { + // new token is no delim + // => Add it to the return list. + lTokens.add(sToken); + // Dont forget to reset this information - so next loop + // will do the right things! + bLastWasDelim = false; + } + } + + return lTokens; + } + + //___________________________________________ + + /** + */ + public synchronized void analyze() + { + m_nDoubleRegisteredFilters = 0; + m_nTypesForFilters = 0; + m_nTypesForDetectServices = 0; + m_nTypesForFrameLoaders = 0; + m_nTypesForContentHandlers = 0; + + // create table of types and all registered filters for such types + // By the way: count all double registrations, where a filter + // uses the same type then another filter. + m_lFilterToTypeRegistrations = new java.util.HashMap(); + java.util.Iterator aIt1 = m_lFilters.keySet().iterator(); + while (aIt1.hasNext()) + { + java.lang.String sFilter = (java.lang.String)aIt1.next(); + java.util.HashMap aFilter = (java.util.HashMap)m_lFilters.get(sFilter); + java.lang.String sType = (java.lang.String)aFilter.get(PROPNAME_TYPE); + + java.util.Vector lFilters = (java.util.Vector)m_lFilterToTypeRegistrations.get(sType); + if (lFilters == null) + lFilters = new java.util.Vector(); + else + ++m_nDoubleRegisteredFilters; + lFilters.add(sFilter); + m_lFilterToTypeRegistrations.put(sType, lFilters); + } + + // count, how many types are used by filters, frame loaders or content handlers + aIt1 = m_lTypes.keySet().iterator(); + while (aIt1.hasNext()) + { + java.lang.String sType = (java.lang.String)aIt1.next(); + + java.util.Iterator aIt2 = m_lFilters.keySet().iterator(); + while (aIt2.hasNext()) + { + java.lang.String sItem = (java.lang.String)aIt2.next(); + java.util.HashMap aItem = (java.util.HashMap)m_lFilters.get(sItem); + java.lang.String sTypeReg = (java.lang.String)aItem.get(PROPNAME_TYPE); + + if (sTypeReg.equals(sType)) + { + ++m_nTypesForFilters; + break; + } + } + + aIt2 = m_lDetectServices.keySet().iterator(); + while (aIt2.hasNext()) + { + java.lang.String sItem = (java.lang.String)aIt2.next(); + java.util.HashMap aItem = (java.util.HashMap)m_lDetectServices.get(sItem); + java.util.Vector lTypeReg = (java.util.Vector)aItem.get(PROPNAME_TYPES); + + if (lTypeReg.contains(sType)) + { + ++m_nTypesForDetectServices; + break; + } + } + + aIt2 = m_lFrameLoaders.keySet().iterator(); + while (aIt2.hasNext()) + { + java.lang.String sItem = (java.lang.String)aIt2.next(); + java.util.HashMap aItem = (java.util.HashMap)m_lFrameLoaders.get(sItem); + java.util.Vector lTypeReg = (java.util.Vector)aItem.get(PROPNAME_TYPES); + + if (lTypeReg.contains(sType)) + { + ++m_nTypesForFrameLoaders; + break; + } + } + + aIt2 = m_lContentHandlers.keySet().iterator(); + while (aIt2.hasNext()) + { + java.lang.String sItem = (java.lang.String)aIt2.next(); + java.util.HashMap aItem = (java.util.HashMap)m_lContentHandlers.get(sItem); + java.util.Vector lTypeReg = (java.util.Vector)aItem.get(PROPNAME_TYPES); + + if (lTypeReg.contains(sType)) + { + ++m_nTypesForContentHandlers; + break; + } + } + } + } + + //___________________________________________ + + /** validate all cache entries. + * + * It checks if all made registrations are valid; + * try to repair some simple problems; + * create missing informations on demand ... + * + * @param nFormat + * specify, which configuration format + * must be checked. + * + * @throws [java.lang.Exception] + * if an unrecoverable problem occure. + */ + public synchronized void validate(int nFormat) + throws java.lang.Exception + { + validateTypes(nFormat); + validateFilters(nFormat); + } + + //___________________________________________ + + /** validate all type entries of this cache. + * + * @param nFormat + * specify, which configuration format + * must be checked. + * + * @throws [java.lang.Exception] + * if an unrecoverable problem occure. + */ + private void validateTypes(int nFormat) + throws java.lang.Exception + { + java.util.Iterator aIt1 = m_lTypes.keySet().iterator(); + while(aIt1.hasNext()) + { + java.lang.String sType = (java.lang.String)aIt1.next(); + java.util.HashMap aType = (java.util.HashMap)m_lTypes.get(sType); + if (aType == null) + throw new java.lang.Exception("type ["+sType+"] dos not exist realy?!"); + + if ( + (!aType.containsKey(PROPNAME_MEDIATYPE )) || + (!aType.containsKey(PROPNAME_PREFERRED )) || + (!aType.containsKey(PROPNAME_CLIPBOARDFORMAT)) || + (!aType.containsKey(PROPNAME_DOCUMENTICONID )) || + (!aType.containsKey(PROPNAME_URLPATTERN )) || + (!aType.containsKey(PROPNAME_EXTENSIONS )) || + (!aType.containsKey(PROPNAME_UINAME )) + ) + { + throw new java.lang.Exception("Type \""+sType+"\" does not contain all neccessary properties for a 6.0/6.Y format."); + } + + if ( + (((java.util.Vector)aType.get(PROPNAME_EXTENSIONS)).isEmpty()) && + (((java.util.Vector)aType.get(PROPNAME_URLPATTERN)).isEmpty()) + ) + { + throw new java.lang.Exception("Type \""+sType+"\" does not contain any extension nor an url pattern."); + } + + if (((java.util.HashMap)aType.get(PROPNAME_UINAME)).isEmpty()) + throw new java.lang.Exception("Type \""+sType+"\" is not localized."); + + if (nFormat == FORMAT_6Y) + { + if ( + (!aType.containsKey(PROPNAME_UIORDER )) || + (!aType.containsKey(PROPNAME_PREFERREDFILTER)) || + (!aType.containsKey(PROPNAME_DETECTSERVICE )) + ) + { + throw new java.lang.Exception("Type \""+sType+"\" does not contain all neccessary properties for a 6.Y format."); + } + + if (((java.lang.Integer)aType.get(PROPNAME_UIORDER)).intValue() < 0) + throw new java.lang.Exception("Type \""+sType+"\" has invalid value for prop UIOrder."); + + if (((java.lang.String)aType.get(PROPNAME_DETECTSERVICE)).length() < 1) + m_aDebug.setWarning("Type \""+sType+"\" has no detect service registered."); + + java.lang.String sPreferredReg = (java.lang.String)aType.get(PROPNAME_PREFERREDFILTER); + if ( + (sPreferredReg == null) || + (sPreferredReg.length() < 1 ) + ) + { + m_aDebug.setWarning("Type \""+sType+"\" has no preferred filter ..."); + /*FIXME + * OK - not every type has a filter registered .. but the + * a frame loader MUST(!) exist! Check it. + */ + } + else + { + if (!m_lFilters.containsKey(sPreferredReg)) + throw new java.lang.Exception("Type \""+sType+"\" has no valid preferred filter registration [\""+sPreferredReg+"\"]."); + } + } + } + } + + //___________________________________________ + + /** validate all filter entries of this cache. + * + * @param nFormat + * specify, which configuration format + * must be checked. + * + * @throws [java.lang.Exception] + * if an unrecoverable problem occure. + */ + public synchronized void validateFilters(int nFormat) + throws java.lang.Exception + { + java.util.Iterator aIt1 = m_lFilters.keySet().iterator(); + while(aIt1.hasNext()) + { + java.lang.String sFilter = (java.lang.String)aIt1.next(); + java.util.HashMap aFilter = (java.util.HashMap)m_lFilters.get(sFilter); + if (aFilter == null) + throw new java.lang.Exception("filter ["+sFilter+"] dos not exist realy?!"); + + if ( + (!aFilter.containsKey(PROPNAME_DOCUMENTSERVICE )) || + (!aFilter.containsKey(PROPNAME_FILEFORMATVERSION)) || + (!aFilter.containsKey(PROPNAME_FILTERSERVICE )) || + (!aFilter.containsKey(PROPNAME_FLAGS )) || + (!aFilter.containsKey(PROPNAME_TEMPLATENAME )) || + (!aFilter.containsKey(PROPNAME_TYPE )) || + (!aFilter.containsKey(PROPNAME_UICOMPONENT )) || + (!aFilter.containsKey(PROPNAME_USERDATA )) + ) + { + throw new java.lang.Exception("Filter \""+sFilter+"\" does not contain all neccessary properties for a 6.0/6.Y format."); + } + + if (((java.lang.Integer)aFilter.get(PROPNAME_FLAGS)).intValue() < 1) + throw new java.lang.Exception("Filter \""+sFilter+"\" does not have a valid flag field."); + + if (!m_lTypes.containsKey(aFilter.get(PROPNAME_TYPE))) + throw new java.lang.Exception("Filter \""+sFilter+"\" is not registered for a well known type."); + + if (nFormat == FORMAT_60) + { + if ( + (!aFilter.containsKey(PROPNAME_ORDER )) || + (!aFilter.containsKey(PROPNAME_UINAME)) + ) + { + throw new java.lang.Exception("Filter \""+sFilter+"\" does not contain all neccessary properties for a 6.0 format."); + } + + if (((java.lang.Integer)aFilter.get(PROPNAME_ORDER)).intValue() < 0) + throw new java.lang.Exception("Filter \""+sFilter+"\" does not have a valid Order value."); + + if (((java.util.HashMap)aFilter.get(PROPNAME_UINAME)).isEmpty()) + throw new java.lang.Exception("Filter \""+sFilter+"\" is not localized."); + } +/*TODO + depends from the configuration item "remove_filter_flag_preferred" ... + + if (nFormat == FORMAT_6Y) + { + int flags = ((java.lang.Integer)aFilter.get(PROPNAME_FLAGS)).intValue(); + if ((flags & FLAGVAL_PREFERRED) == FLAGVAL_PREFERRED) + throw new java.lang.Exception("Filter \""+sFilter+"\" has superflous Preferred flag set. Please remove this flag. ["+flags+"]"); + } +*/ + } + } + + /*TODO + * - remove graphic filters! + * - move detect services to types + */ + + public synchronized void transform60to6Y(boolean bCreateCombineFilterFlag , + boolean bRemoveFilterFlagBrowserPreferred, + boolean bRemoveFilterFlagPreferred , + boolean bRemoveFilterFlag3rdparty , + boolean bRemoveFilterUINames , + boolean bRemoveGraphicFilters , + boolean bSetDefaultDetector ) + throws java.lang.Exception + { + // remove some superflous cache entries ... + // everything related to "load macros" + // Macros should be dispatched instead of loaded! + if (m_lTypes.containsKey("macro")) + { + m_lTypes.remove("macro"); + m_aDebug.setDetailedInfo("superflous type \"macro\" was removed"); + } + if (m_lFrameLoaders.containsKey("com.sun.star.comp.sfx2.SfxMacroLoader")) + { + m_lFrameLoaders.remove("com.sun.star.comp.sfx2.SfxMacroLoader"); + m_aDebug.setDetailedInfo("superflous frame loader \"com.sun.star.comp.sfx2.SfxMacroLoader\" was removed"); + } + + // step over all filters and check her properties and references + java.util.Vector lPreferredFilters = new java.util.Vector(); + java.util.Vector lNoRealFilters = new java.util.Vector(); + java.util.Iterator aIt1 = m_lFilters.keySet().iterator(); + while(aIt1.hasNext()) + { + java.lang.String sFilter = (java.lang.String)aIt1.next(); + java.util.HashMap aFilter = (java.util.HashMap)m_lFilters.get(sFilter); + + // remove the "graphic helper filters" used by draw and impress + // They dont have any valid document service name set and cant be handled + // by our generic FrameLoader! + // They must be moved to her own configuration ... + + if ( + (bRemoveGraphicFilters ) && + (((java.lang.String)aFilter.get(PROPNAME_DOCUMENTSERVICE)).length() < 1) + ) + { + lNoRealFilters.add(sFilter); + continue; + } + + java.lang.String sTypeReg = (java.lang.String)aFilter.get(PROPNAME_TYPE); + java.util.HashMap aType = (java.util.HashMap)m_lTypes.get(sTypeReg); + + // move UINames of filters to types + java.util.HashMap lFilterUINames = (java.util.HashMap)aFilter.get(PROPNAME_UINAME); + java.util.HashMap lTypeUINames = (java.util.HashMap)aType.get(PROPNAME_UINAME); + java.util.HashMap lPatchUINames = new java.util.HashMap(); + + java.util.Iterator pUINames = lTypeUINames.keySet().iterator(); + while(pUINames.hasNext()) + { + java.lang.String sLocale = (java.lang.String)pUINames.next(); + java.lang.String sValue = (java.lang.String)lTypeUINames.get(sLocale); + lPatchUINames.put(sLocale, sValue); + } + + pUINames = lFilterUINames.keySet().iterator(); + while(pUINames.hasNext()) + { + java.lang.String sLocale = (java.lang.String)pUINames.next(); + java.lang.String sValue = (java.lang.String)lFilterUINames.get(sLocale); + lPatchUINames.put(sFilter+":"+sLocale, sValue); + } + aType.put(PROPNAME_UINAME, lPatchUINames); + + // set generic filter service wrapper for our own native filters! + // By the way: The format types of such filters can be detected by our + // generic detector too. + if ( + (bSetDefaultDetector ) && + (((java.lang.String)aFilter.get(PROPNAME_FILTERSERVICE)).length() < 1) + ) + { + /*ME_THINKING aFilter.put(PROPNAME_FILTERSERVICE, FILTERSERVICE_NATIVEWARPPER);*/ + aType.put(PROPNAME_DETECTSERVICE, GENERIC_DETECTSERVICE); + } + + // move the preferred filter information to any type + // Set the filter name to the type for which the filter is registered. + // If this type already have a set PreferredFilter value, check if the current filter + // has the preferred flag set. If not ignore it - otherwhise overwrite the + // current information at the type. But look for multiple preferred filter relations ... + // means: look if more the one filter has set the preferred flag for the same type! + + /* Attention! + * + * Dont remove the preferred flag from any filter! ... not here. + * Otherwhise next loop can't detect ambigous preferred registrations! + * Add filter to a temp. list, which can be used later to remove the preferred + * flag ... + */ + + int flags1 = ((java.lang.Integer)aFilter.get(PROPNAME_FLAGS)).intValue(); + java.lang.String sDocSrv = (java.lang.String)aFilter.get(PROPNAME_DOCUMENTSERVICE); + if (sDocSrv.length()>0)// without a doc service its not a real filter - its a graphic filter! + { + boolean preferred1 = ((flags1 & FLAGVAL_PREFERRED) == FLAGVAL_PREFERRED); + if (preferred1) + lPreferredFilters.add(aFilter); + + java.lang.String sAlreadyRegisteredFilter = (java.lang.String)aType.get(PROPNAME_PREFERREDFILTER); + // no registration => set this filter as "any possible one"! + if (sAlreadyRegisteredFilter.length() < 1) + aType.put(PROPNAME_PREFERREDFILTER, sFilter); + else + { + java.util.HashMap aAlreadyRegisteredFilter = (java.util.HashMap)m_lFilters.get(sAlreadyRegisteredFilter); + int flags2 = ((java.lang.Integer)aAlreadyRegisteredFilter.get(PROPNAME_FLAGS)).intValue(); + boolean preferred2 = ((flags2 & FLAGVAL_PREFERRED) == FLAGVAL_PREFERRED); + + // two preferred filters for the same type! => error + if (preferred1 && preferred2) + { + java.lang.StringBuffer sMsg = new java.lang.StringBuffer(256); + sMsg.append("More the one preferred filter detected for the same type.\n"); + sMsg.append("\ttype = \""+sTypeReg+"\"\n"); + sMsg.append("\tfilter[1] = \""+sAlreadyRegisteredFilter+"\"\n"); + sMsg.append("\tfilter[2] = \""+sFilter+"\"\n"); + throw new java.lang.Exception(sMsg.toString()); + } + else + // overwrite the "any possible" filter with a real preferred one + if (preferred1 && !preferred2) + aType.put(PROPNAME_PREFERREDFILTER, sFilter); + } + } + + // create the new combined filter flag if required + if (bCreateCombineFilterFlag) + { + if ( + ((flags1 & FLAGVAL_IMPORT) == FLAGVAL_IMPORT) && + ((flags1 & FLAGVAL_EXPORT) == FLAGVAL_EXPORT) + ) + { + flags1 |= FLAGVAL_COMBINED; + flags1 &= ~FLAGVAL_IMPORT ; + flags1 &= ~FLAGVAL_EXPORT ; + aFilter.put(PROPNAME_FLAGS, new java.lang.Integer(flags1)); + } + } + + // remove some obsolete filter flags + if (bRemoveFilterFlagBrowserPreferred) + { + flags1 &= ~FLAGVAL_BROWSERPREFERRED; + aFilter.put(PROPNAME_FLAGS, new java.lang.Integer(flags1)); + } + + if (bRemoveFilterFlag3rdparty) + { + flags1 &= ~FLAGVAL_3RDPARTYFILTER; + aFilter.put(PROPNAME_FLAGS, new java.lang.Integer(flags1)); + } + + // if its a filter with an UI order ... + // move this information to the registered type. + // Note: Because more then one filter can be registered for the same type. + // Handle it as an error ... till we find a better transformation! + java.lang.Integer nOrder = (java.lang.Integer)aFilter.get(PROPNAME_ORDER); + java.lang.Integer nUIOrder = (java.lang.Integer)aType.get(PROPNAME_UIORDER); + int order = nOrder.intValue(); + int uiorder = nUIOrder.intValue(); + + if (order > 0) + { + if ( + (uiorder < 1 ) || + (uiorder > order) + ) + { + aType.put(PROPNAME_UIORDER, nOrder); + m_aDebug.setDetailedInfo("moved order value "+nOrder+" from filter \""+sFilter+"\" to type \""+sTypeReg+"\""); + } + else + m_aDebug.setDetailedInfo("ignore order value [order="+nOrder+",uiorder="+nUIOrder+"] for filter \""+sFilter+"\" and type \""+sTypeReg+"\""); + } + } + + // NOW ... remove the preferred flags from every filter, which it has set. + java.util.Enumeration aIt2 = null; + if (bRemoveFilterFlagPreferred) + { + aIt2 = lPreferredFilters.elements(); + while (aIt2.hasMoreElements()) + { + java.util.HashMap aFilter = (java.util.HashMap)aIt2.nextElement(); + int flags = ((java.lang.Integer)aFilter.get(PROPNAME_FLAGS)).intValue(); + flags &= ~FLAGVAL_PREFERRED; + aFilter.put(PROPNAME_FLAGS, new java.lang.Integer(flags)); + } + } + + // NOW ... remove all "no real filters" like the graphich helper filters of + // draw and impress! + aIt2 = lNoRealFilters.elements(); + while (aIt2.hasMoreElements()) + m_lFilters.remove(aIt2.nextElement()); + + // step over all detect services and move this information directly to + // the corresponding types + // Overwrite possibel default registrations with a real existing one! + aIt1 = m_lDetectServices.keySet().iterator(); + while(aIt1.hasNext()) + { + java.lang.String sDetector = (java.lang.String)aIt1.next(); + java.util.HashMap aDetector = (java.util.HashMap)m_lDetectServices.get(sDetector); + java.util.Vector lTypeReg = (java.util.Vector)aDetector.get(PROPNAME_TYPES); + aIt2 = lTypeReg.elements(); + while(aIt2.hasMoreElements()) + { + java.lang.String sTypeReg = (java.lang.String)aIt2.nextElement(); + java.util.HashMap aType = (java.util.HashMap)m_lTypes.get(sTypeReg); + + if (aType == null) + { + m_aDebug.setWarning("Detector \""+sDetector+"\" seem to be registered for unknown type \""+sTypeReg+"\""); + continue; + } + + java.lang.Object aAlreadyRegisteredDetector = aType.get(PROPNAME_DETECTSERVICE); + if (aAlreadyRegisteredDetector != null && ((java.lang.String)aAlreadyRegisteredDetector).length() > 0) + { + java.lang.StringBuffer sMsg = new java.lang.StringBuffer(256); + sMsg.append("type \""+sTypeReg+"\" has ambigous registrations of a detect service\n"); + sMsg.append("\tdetect service[1] = \""+(java.lang.String)aAlreadyRegisteredDetector+"\"\n"); + sMsg.append("\tdetect service[2] = \""+sDetector+"\"\n"); + m_aDebug.setWarning(sMsg.toString()); + } + aType.put(PROPNAME_DETECTSERVICE, sDetector); + m_aDebug.setGlobalInfo("move detector \""+sDetector+"\" to type \""+sTypeReg+"\""); + } + } + + // because all detect service was registered as type properties directly ... + // remove all detect service objects of this cache! + m_lDetectServices.clear(); + + // step over all frame loader and move this information directly to + // the corresponding types + // Overwrite possibel default registrations with a real existing one! + aIt1 = m_lFrameLoaders.keySet().iterator(); + while(aIt1.hasNext()) + { + java.lang.String sLoader = (java.lang.String)aIt1.next(); + java.util.HashMap aLoader = (java.util.HashMap)m_lFrameLoaders.get(sLoader); + java.util.Vector lTypeReg = (java.util.Vector)aLoader.get(PROPNAME_TYPES); + aIt2 = lTypeReg.elements(); + while(aIt2.hasMoreElements()) + { + java.lang.String sTypeReg = (java.lang.String)aIt2.nextElement(); + java.util.HashMap aType = (java.util.HashMap)m_lTypes.get(sTypeReg); + java.lang.String sAlreadyRegisteredLoader = (java.lang.String)aType.get(PROPNAME_FRAMELOADER); + if (sAlreadyRegisteredLoader != null && sAlreadyRegisteredLoader.length() > 0) + { + java.lang.StringBuffer sMsg = new java.lang.StringBuffer(256); + sMsg.append("type \""+sTypeReg+"\" has ambigous registrations of a frame loader\n"); + sMsg.append("\tframe loader[1] = \""+sAlreadyRegisteredLoader+"\"\n"); + sMsg.append("\tframe loader[2] = \""+sLoader+"\"\n"); + m_aDebug.setWarning(sMsg.toString()); + } + aType.put(PROPNAME_FRAMELOADER, sLoader); + System.out.println("move loader \""+sLoader+"\" to type \""+sTypeReg+"\""); + } + } + + m_lFrameLoaders.clear(); + + // step over all content handler and move this information directly to + // the corresponding types + // Overwrite possibel default registrations with a real existing one! + aIt1 = m_lContentHandlers.keySet().iterator(); + while(aIt1.hasNext()) + { + java.lang.String sHandler = (java.lang.String)aIt1.next(); + java.util.HashMap aHandler = (java.util.HashMap)m_lContentHandlers.get(sHandler); + java.util.Vector lTypeReg = (java.util.Vector)aHandler.get(PROPNAME_TYPES); + aIt2 = lTypeReg.elements(); + while(aIt2.hasMoreElements()) + { + java.lang.String sTypeReg = (java.lang.String)aIt2.nextElement(); + java.util.HashMap aType = (java.util.HashMap)m_lTypes.get(sTypeReg); + java.lang.String sAlreadyRegisteredHandler = (java.lang.String)aType.get(PROPNAME_CONTENTHANDLER); + if (sAlreadyRegisteredHandler != null && sAlreadyRegisteredHandler.length() > 0) + { + java.lang.StringBuffer sMsg = new java.lang.StringBuffer(256); + sMsg.append("type \""+sTypeReg+"\" has ambigous registrations of a content handler\n"); + sMsg.append("\tcontent handler[1] = \""+sAlreadyRegisteredHandler+"\"\n"); + sMsg.append("\tcontent handler[2] = \""+sHandler+"\"\n"); + m_aDebug.setWarning(sMsg.toString()); + } + aType.put(PROPNAME_CONTENTHANDLER, sHandler); + System.out.println("move handler \""+sHandler+"\" to type \""+sTypeReg+"\""); + } + } + + m_lContentHandlers.clear(); + +/* + int c = m_lTypes.size(); + java.lang.String[] lT1 = new java.lang.String[c]; + java.lang.String[] lT2 = new java.lang.String[c]; + long nUPS = 0; + + int i = 0; + aIt1 = m_lTypes.keySet().iterator(); + while(aIt1.hasNext()) + { + lT1[i] = (java.lang.String)aIt1.next(); + lT2[i] = lT1[i]; + ++i; + } + + for (int i1=0; i1 search from left to right + int len = lCommandLineArgs[arg].length(); + int pos = lCommandLineArgs[arg].indexOf('='); + if (pos != -1) + { + java.lang.String sArg = lCommandLineArgs[arg].substring(0,pos); + java.lang.String sValue = lCommandLineArgs[arg].substring(pos+1); + setProperty(sArg, sValue); + continue; + } + + // is it a boolean argument? + // Note: Because "--" and "-" will be interpreted as the same + // we search from right to left! + pos = lCommandLineArgs[arg].lastIndexOf('-'); + if (pos == -1) + pos = lCommandLineArgs[arg].lastIndexOf('/'); + if (pos != -1) + { + java.lang.String sArg = lCommandLineArgs[arg].substring(pos+1); + setProperty(sArg, java.lang.String.valueOf(true)); + continue; + } + + // There is an unknown format used by this argument ... + throw new MalformedCommandLineException("Invalid command line detected. The argument \""+lCommandLineArgs[arg]+"\" use an unsupported format."); + } + } + + //------------------------------------------- + /** indicates if the given command line includes + * a help request. + * + * @return True if there was an explicit help request. + */ + public synchronized boolean isHelp() + { + return ( + (containsKey("help")) || + (containsKey("?") ) || + (containsKey("h") ) + ); + } + + //------------------------------------------- + /** indicates if the gioven command line was empty. + * + * @return True if there was an empty command line. + */ + public synchronized boolean isEmpty() + { + return m_bEmpty; + } + + //------------------------------------------- + /** returns the value of sProp as boolean value. + * + * @param sProp + * the name of the parameter. + * + * @return The boolean value of the requested property. + * + * @throw [NoSuchElementException] + * if the requested property does not exists. + */ + public synchronized boolean getBoolean(java.lang.String sProp) + throws java.util.NoSuchElementException + { + java.lang.String sValue = getProperty(sProp); + if (sValue == null) + throw new java.util.NoSuchElementException("The requested config value \""+sProp+"\" does not exists!"); + return new java.lang.Boolean(sValue).booleanValue(); + } + + public synchronized boolean getBoolean(java.lang.String sProp , + boolean bDefault) + { + java.lang.String sDefault = java.lang.String.valueOf(bDefault); + java.lang.String sValue = getProperty(sProp, sDefault); + return new java.lang.Boolean(sValue).booleanValue(); + } + + //------------------------------------------- + /** returns the value of sProp as int value. + * + * @param sProp + * the name of the parameter. + * + * @return The int value of the requested property. + * + * @throw [NoSuchElementException] + * if the requested property does not exists. + */ + public synchronized int getInt(java.lang.String sProp) + throws java.util.NoSuchElementException + { + java.lang.String sValue = getProperty(sProp); + if (sValue == null) + throw new java.util.NoSuchElementException("The requested config value \""+sProp+"\" does not exists!"); + return new java.lang.Integer(sValue).intValue(); + } + + public synchronized int getInt(java.lang.String sProp , + int nDefault) + { + java.lang.String sDefault = java.lang.String.valueOf(nDefault); + java.lang.String sValue = getProperty(sProp, sDefault); + return new java.lang.Integer(sValue).intValue(); + } + + //------------------------------------------- + /** returns the value of sProp as string value. + * + * @param sProp + * the name of the parameter. + * + * @return The string value of the requested property. + * + * @throw [NoSuchElementException] + * if the requested property does not exists. + */ + public synchronized java.lang.String getString(java.lang.String sProp) + throws java.util.NoSuchElementException + { + java.lang.String sValue = getProperty(sProp); + if (sValue == null) + throw new java.util.NoSuchElementException("The requested config value \""+sProp+"\" does not exists!"); + return sValue; + } + + //------------------------------------------- + /** returns the value of sProp as string list value! + * + * @descr The delimiter must be well known and + * it must be clear if trailing/leading + * whitespaces must be ignored or not. + * + * @param sProp + * the name of the parameter. + * + * @param sDelim + * the delimiter, which must be used to split + * the config string value into an array. + * + * @param bTrim + * if its set to true, trailing and leading whitespace + * characters will be ommited. + * + * @param bDecode + * if its set to TRUE all liste items will be + * interpreted as "" and converted to ! + * + * @return The string list value of the requested property. + * + * @throw [NoSuchElementException] + * if the requested property does not exists. + */ + public synchronized java.util.Vector getStringList(java.lang.String sProp , + java.lang.String sDelimiter, + boolean bTrim , + boolean bDecode ) + throws java.util.NoSuchElementException + { + java.lang.String sValue = getProperty(sProp); + if (sValue == null) + throw new java.util.NoSuchElementException("The requested config value \""+sProp+"\" does not exists!"); + + java.util.Vector lValue = new java.util.Vector(); + try + { + java.util.StringTokenizer lTokens = new java.util.StringTokenizer(sValue, sDelimiter); + while(lTokens.hasMoreTokens()) + { + java.lang.String sToken = lTokens.nextToken(); + // remove trailing/leading whitespaces + if (bTrim) + sToken = sToken.trim(); + // remove "" + if ( + (bDecode ) && + (sToken.indexOf("\"") == 0 ) && + (sToken.lastIndexOf("\"") == sToken.length()-1) + ) + { + sToken = sToken.substring(1, sToken.length()-1); + } + lValue.add(sToken); + } + } + catch(java.lang.Throwable ex) + { lValue.clear(); } + + return lValue; + } +} diff --git a/l10ntools/source/filter/utils/FileHelper.java b/l10ntools/source/filter/utils/FileHelper.java new file mode 100644 index 000000000000..71f51cf36bf6 --- /dev/null +++ b/l10ntools/source/filter/utils/FileHelper.java @@ -0,0 +1,766 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: FileHelper.java,v $ + * $Revision: 1.13 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package com.sun.star.filter.config.tools.utils; + +// __________ Imports __________ + +import java.io.*; +import java.lang.*; +import java.net.*; +import java.util.*; + +// __________ Implementation __________ + +/** + * It collects some static helper functons to handle file system specific problems. + * Sometimes it's neccessary to convert URL from/to system pathes; + * or from string notation to structural versions (e.g. com.sun.star.util.URL). + * And sometimes java had another notation then the office it has. + * Further it provides functionality to work easiear with the java.io.File class of java. + * + * + */ +public class FileHelper +{ + // ____________________ + + /** + * Because the office need URLs for loading/saving documents + * we must convert used system pathes. + * And java use another notation for file URLs ... correct it. + * + * @param aSystemPath + * represent the file in system notation + * + * @return [String] + * a file url which represent the given system path + */ + public static java.lang.String getFileURLFromSystemPath(java.io.File aSystemPath) + { + System.out.println("TODO: must be adapted to java 1.3 :-("); + System.exit(-1); +/*TODO_JAVA + try + { + sFileURL = aSystemPath.toURI().toURL().toString(); + } + catch( MalformedURLException exWrong ) + { + sFileURL = null; + } +*/ + java.lang.String sFileURL = null; + + // problem of java: file URL's are coded with 1 slash instead of 2 or 3 ones! + // => correct this problem first, otherwise office can't use these URL's + if( + (sFileURL != null ) && + (sFileURL.startsWith("file:/") == true ) && + (sFileURL.startsWith("file://") == false) + ) + { + java.lang.StringBuffer sWorkBuffer = new java.lang.StringBuffer(sFileURL); + sWorkBuffer.insert(6,"//"); + sFileURL = sWorkBuffer.toString(); + } + + return sFileURL; + } + + // ____________________ + + /** + * The same as getFileURLFromSystemPath() before but uses string parameter instead + * of a java.io.File type. It exist to supress converting of neccessary parameters in the + * outside code. But of course getFileURLFromSystemPath(File) will be a little bit faster + * then this method ... + * + * @param sSystemPath + * represent the file in system notation + * + * @return [String] + * a file url which represent the given system path + */ + public static java.lang.String getFileURLFromSystemPath(java.lang.String sSystemPath) + { + return getFileURLFromSystemPath(new java.io.File(sSystemPath)); + } + + // ____________________ + + /** + * Does the same as getFileURLFromSystemPath() before ... but uses + * the given protocol string (e.g."http://") insted of "file:///". + * + * @param aSystemPath + * represent the file in system notation + * + * @param aBasePath + * define the base path of the aSystemPath value, + * which must be replaced with the value of "sServerPath". + * + * @param sServerURL + * Will be used to replace sBasePath. + * + * @example + * System Path = "d:\test\file.txt" + * Base Path = "d:\test" + * Server Path = "http://alaska:8000" + * => "http://alaska:8000/file.txt" + * + * @return [String] + * an url which represent the given system path + * and uses the given protocol + */ + public static java.lang.String getURLWithProtocolFromSystemPath(java.io.File aSystemPath, + java.io.File aBasePath , + java.lang.String sServerURL ) + { + System.out.println("TODO: must be adapted to java 1.3 :-("); + System.exit(-1); + + java.lang.String sFileURL = FileHelper.getFileURLFromSystemPath(aSystemPath); + java.lang.String sBaseURL = FileHelper.getFileURLFromSystemPath(aBasePath ); + + // cut last '/'! + if (sBaseURL.lastIndexOf('/')==(sBaseURL.length()-1)) + sBaseURL = sBaseURL.substring(0,sBaseURL.length()-1); + + // cut last '/'! + if (sServerURL.lastIndexOf('/')==(sServerURL.length()-1)) + sServerURL = sServerURL.substring(0,sServerURL.length()-1); + +//TODO_JAVA java.lang.String sURL = sFileURL.replaceFirst(sBaseURL,sServerURL); + java.lang.String sURL = null; + return sURL; + } + + // ____________________ + + /** + * The same as getURLWithProtocolFromSystemPath() before but uses string parameter instead + * of a java.io.File types. It exist to supress converting of neccessary parameters in the + * outside code. But of course getURLWithProtocolFromSystemPath(File,File,String) will be + * a little bit faster then this method ... + * + * @param sSystemPath + * represent the file in system notation + * + * @param sBasePath + * define the base path of the aSystemPath value, + * which must be replaced with the value of "sServerPath". + * + * @param sServerPath + * Will be used to replace sBasePath. + * + * @example + * System Path = "d:\test\file.txt" + * Base Path = "d:\test" + * Server Path = "http://alaska:8000" + * => "http://alaska:8000/file.txt" + * + * @return [String] + * an url which represent the given system path + * and uses the given protocol + */ + public static java.lang.String getURLWithProtocolFromSystemPath(java.lang.String sSystemPath, + java.lang.String sBasePath , + java.lang.String sServerPath) + { + return getURLWithProtocolFromSystemPath(new java.io.File(sSystemPath), new java.io.File(sBasePath), sServerPath); + } + + //_________________________________ + + /** + * Return a list of all available files of a directory. + * We filter sub directories. All other files + * are returned. So they can be used for further purposes. + * One parameter define the start directory, + * another one enable/disable recursive search into sub directories. + * + * @param aRoot + * the start directory, which should be analyzed. + * + * @param bRecursive + * enable/disable search in sub directories. + * + * @return [Vector] + * a filtered list of java java.io.File objects of all available files + * of the start dir (and may of its sub directories). + */ + public static java.util.Vector getSystemFilesFromDir(java.io.File aRoot , + boolean bRecursive) + { + java.io.File[] lAllFiles = aRoot.listFiles(); + if (lAllFiles == null) + return null; + + int c = lAllFiles.length; + java.util.Vector lFilteredFiles = new java.util.Vector(c); + for (int i=0; i=48 && c<=57 // 0-9 + && + c>=97 && c<=122 // a-z + && + c>=65 && c<=90 // A-Z + ) + { + sNewName.append(c); + } + else + { + sNewName.append("_"); + } + } + + return sNewName.toString(); + } + + //___________________________________________ + + /** it removes all child nodes of a file system directory. + * + * @param aDirectory + * points to the directory, which should be made empty. + * + * @param bFilesOnly + * force deletion of files only. If its set to TRUE, + * no subdirectory will be removed. + * + * @throw [java.io.IOException] + * if some of the child nodes couldn't be removed. + */ + public static void makeDirectoryEmpty(java.io.File aDirectory, + boolean bFilesOnly) + throws java.io.IOException + { + if (!aDirectory.isDirectory()) + throw new java.io.FileNotFoundException("\""+aDirectory.toString()+"\" is not a directory."); + + java.io.File[] lChilds = aDirectory.listFiles(); + for (int f=0; f0) + sBuffer.append(aEncodedBuffer, 0, nReadCount); + + aEncodedReader.close(); + } + + //___________________________________________ + private static void logEncodingData(java.lang.StringBuffer sLog , + int nUTF8 , + int nByteOrg1 , + int nByteOrg2 , + int nByteOrg3 , + int nByteOrg4 , + int nByte1 , + int nByte2 , + int nByte3 , + int nByte4 , + int nEncodingType) + { + sLog.append("["+nEncodingType+"]\t"); + sLog.append((int)nUTF8+"\t="); + sLog.append("\t"+nByteOrg1+"/"+nByte1); + sLog.append("\t"+nByteOrg2+"/"+nByte2); + sLog.append("\t"+nByteOrg3+"/"+nByte3); + sLog.append("\t"+nByteOrg4+"/"+nByte4); + sLog.append("\n"); + } + + //___________________________________________ + private static char impl_convertBytesToChar(int nByte1, int nByte2, int nByte3, int nByte4) + { + return (char)((nByte1*0x40000)+(nByte2*0x1000)+(nByte3*0x40)+nByte4); + } + + //___________________________________________ + private static int impl_readAndCheckNextByte(byte[] aBuffer , + int nBufPos , + int nBufLength , + int nMinRange , + int nMaxRange ) + throws java.lang.Exception + { + if (nBufPos>=nBufLength) + throw new java.lang.Exception("impl_readAndCheckNextByte()\nEnd of buffer reached."); + + int nByte = aBuffer[nBufPos] & 0xFF; + if ( + (nByte < nMinRange) || + (nByte > nMaxRange) + ) + { + throw new java.lang.Exception("impl_readAndCheckNextByte()\nByte does not fit the specified range."); + } + + return nByte; + } + + //___________________________________________ + public static void readAndCheckUTF8File(java.io.File aFile , + java.lang.StringBuffer sBuffer) + throws java.io.IOException + { + java.io.FileInputStream aByteStream = new java.io.FileInputStream(aFile.getAbsolutePath()); + byte[] aBuffer = new byte[4096]; + int nReadCount = 0; + int nByteOrg_1 = 0; + int nByteOrg_2 = 0; + int nByteOrg_3 = 0; + int nByteOrg_4 = 0; + int nByte_1 = 0; + int nByte_2 = 0; + int nByte_3 = 0; + int nByte_4 = 0; + char nUTF8 = 0; + int i = 0; + int nEncodingType = 0; + java.lang.StringBuffer sLog = new java.lang.StringBuffer(); + + try + { + + while((nReadCount=aByteStream.read(aBuffer))>0) + { + i=0; + while (i= 0x00) && + (nByteOrg_1 <= 0x7F) + ) + { + nEncodingType = 1; + nUTF8 = (char)nByte_1; + } + // ------------------------------------------------------------ + // 02 + // 1 byte: 110xxxxx + // 2 byte: 101xxxxx + // ------------------------------------------------------------ + else + if ( + (nByteOrg_1 >= 0xC2) && + (nByteOrg_1 <= 0xDF) + ) + { + nEncodingType = 2; + nByteOrg_2 = FileHelper.impl_readAndCheckNextByte(aBuffer, i++, nReadCount, 0x80, 0xBF); + nByte_1 = nByteOrg_1-0xC2; + nByte_2 = nByteOrg_2-0x80; + nUTF8 = FileHelper.impl_convertBytesToChar(0,0,nByte_1, nByte_2); + } + // ------------------------------------------------------------ + // 03 + // 1 byte: 11100000 + // 2 byte: 101xxxxx + // 3 byte: 10xxxxxx + // ------------------------------------------------------------ + else + if (nByteOrg_1 == 0xE0) + { + nEncodingType = 3; + nByteOrg_2 = FileHelper.impl_readAndCheckNextByte(aBuffer, i++, nReadCount, 0xA0, 0xBF); + nByteOrg_3 = FileHelper.impl_readAndCheckNextByte(aBuffer, i++, nReadCount, 0x80, 0xBF); + nByte_2 = nByteOrg_2-0xA0; + nByte_3 = nByteOrg_3-0x80; + nUTF8 = FileHelper.impl_convertBytesToChar(0,0,nByte_2, nByte_3); + } + // ------------------------------------------------------------ + // 04 + // 1 byte: 111xxxxx + // 2 byte: 10xxxxxx + // 3 byte: 10xxxxxx + // ------------------------------------------------------------ + else + if ( + (nByteOrg_1 >= 0xE1) && + (nByteOrg_1 <= 0xEC) + ) + { + nEncodingType = 4; + nByteOrg_2 = FileHelper.impl_readAndCheckNextByte(aBuffer, i++, nReadCount, 0x80, 0xBF); + nByteOrg_3 = FileHelper.impl_readAndCheckNextByte(aBuffer, i++, nReadCount, 0x80, 0xBF); + nByte_1 = nByteOrg_1-0xE1; + nByte_2 = nByteOrg_2-0x80; + nByte_3 = nByteOrg_3-0x80; + nUTF8 = FileHelper.impl_convertBytesToChar(0,nByte_1, nByte_2, nByte_3); + } + // ------------------------------------------------------------ + // 05 + // 1 byte: 11101101 + // 2 byte: 10xxxxxx + // 3 byte: 10xxxxxx + // ------------------------------------------------------------ + else + if (nByteOrg_1 == 0xED) + { + nEncodingType = 5; + nByteOrg_2 = FileHelper.impl_readAndCheckNextByte(aBuffer, i++, nReadCount, 0x80, 0x9F); + nByteOrg_3 = FileHelper.impl_readAndCheckNextByte(aBuffer, i++, nReadCount, 0x80, 0xBF); + nByte_2 = nByteOrg_2-0x80; + nByte_3 = nByteOrg_3-0x80; + nUTF8 = FileHelper.impl_convertBytesToChar(0,0, nByte_2, nByte_3); + } + // ------------------------------------------------------------ + // 06 + // 1 byte: 1110111x + // 2 byte: 10xxxxxx + // 3 byte: 10xxxxxx + // ------------------------------------------------------------ + else + if ( + (nByteOrg_1 >= 0xEE) && + (nByteOrg_1 <= 0xEF) + ) + { + nEncodingType = 6; + nByteOrg_2 = FileHelper.impl_readAndCheckNextByte(aBuffer, i++, nReadCount, 0x80, 0xBF); + nByteOrg_3 = FileHelper.impl_readAndCheckNextByte(aBuffer, i++, nReadCount, 0x80, 0xBF); + nByte_1 = nByteOrg_1-0xEE; + nByte_2 = nByteOrg_2-0x80; + nByte_3 = nByteOrg_3-0x80; + nUTF8 = FileHelper.impl_convertBytesToChar(0,nByte_1, nByte_2, nByte_3); + } + // ------------------------------------------------------------ + // 07 + // 1 byte: 11110000 + // 2 byte: 1001xxxx + // 3 byte: 10xxxxxx + // 4 byte: 10xxxxxx + // ------------------------------------------------------------ + else + if (nByteOrg_1 == 0xF0) + { + nEncodingType = 7; + nByteOrg_2 = FileHelper.impl_readAndCheckNextByte(aBuffer, i++, nReadCount, 0x90, 0xBF); + nByteOrg_3 = FileHelper.impl_readAndCheckNextByte(aBuffer, i++, nReadCount, 0x80, 0xBF); + nByteOrg_4 = FileHelper.impl_readAndCheckNextByte(aBuffer, i++, nReadCount, 0x80, 0xBF); + nByte_2 = nByteOrg_2-0x90; + nByte_3 = nByteOrg_3-0x80; + nByte_4 = nByteOrg_4-0x80; + nUTF8 = FileHelper.impl_convertBytesToChar(0, nByte_2, nByte_3, nByte_4); + } + // ------------------------------------------------------------ + // 08 + // 1 byte: 111100xx + // 2 byte: 10xxxxxx + // 3 byte: 10xxxxxx + // 3 byte: 10xxxxxx + // ------------------------------------------------------------ + else + if ( + (nByteOrg_1 >= 0xF1) && + (nByteOrg_1 <= 0xF3) + ) + { + nEncodingType = 8; + nByteOrg_2 = FileHelper.impl_readAndCheckNextByte(aBuffer, i++, nReadCount, 0x80, 0xBF); + nByteOrg_3 = FileHelper.impl_readAndCheckNextByte(aBuffer, i++, nReadCount, 0x80, 0xBF); + nByteOrg_4 = FileHelper.impl_readAndCheckNextByte(aBuffer, i++, nReadCount, 0x80, 0xBF); + nByte_1 = nByteOrg_1-0xF1; + nByte_2 = nByteOrg_2-0x80; + nByte_3 = nByteOrg_3-0x80; + nByte_4 = nByteOrg_4-0x80; + nUTF8 = FileHelper.impl_convertBytesToChar(nByte_1, nByte_2, nByte_3, nByte_4); + } + // ------------------------------------------------------------ + // 09 + // 1 byte: 11110100 + // 2 byte: 10xxxxxx + // 3 byte: 10xxxxxx + // 4 byte: 10xxxxxx + // ------------------------------------------------------------ + else + if (nByteOrg_1 == 0xF0) + { + nEncodingType = 9; + nByteOrg_2 = FileHelper.impl_readAndCheckNextByte(aBuffer, i++, nReadCount, 0x80, 0xBF); + nByteOrg_3 = FileHelper.impl_readAndCheckNextByte(aBuffer, i++, nReadCount, 0x80, 0xBF); + nByteOrg_4 = FileHelper.impl_readAndCheckNextByte(aBuffer, i++, nReadCount, 0x80, 0xBF); + nByte_2 = nByteOrg_2-0x80; + nByte_3 = nByteOrg_3-0x80; + nByte_4 = nByteOrg_4-0x80; + nUTF8 = FileHelper.impl_convertBytesToChar(0, nByte_2, nByte_3, nByte_4); + } + // wrong encoding ? + else + { + throw new java.lang.Exception("Non well formed UTF-8 encoding."); + } + + sBuffer.append(nUTF8); + // -> DEBUG ! + FileHelper.logEncodingData(sLog, nUTF8, nByteOrg_1, nByteOrg_2, nByteOrg_3, nByteOrg_4, nByte_1, nByte_2, nByte_3, nByte_4, nEncodingType); + // <- DEBUG ! + } + } + + } + catch(java.lang.Throwable ex) + { + // -> DEBUG ! + FileHelper.logEncodingData(sLog, nUTF8, nByteOrg_1, nByteOrg_2, nByteOrg_3, nByteOrg_4, nByte_1, nByte_2, nByte_3, nByte_4, nEncodingType); + + java.io.File aDir = new java.io.File(aFile.getParent()); + java.lang.String sDump = aFile.getName(); + java.io.File aDump = FileHelper.createUniqueFile(aDir, sDump, "dump"); + FileHelper.writeEncodedBufferToFile(aDump, "UTF-8", false, sLog); + // <- DEBUG ! + + java.lang.String sMsg = "File '"+aFile.getPath()+"' is not encoded right as UTF-8."; + throw new java.io.IOException(sMsg); + } + + aByteStream.close(); + } + + //___________________________________________ + + /** writes the given string buffer into the specified file + * using the specified encoding. + * + * Further it can be set, if the file should be expanded + * or replaced by this new string buffer. + * + * @param aFile + * must point to a system file. It can already exist! + * e.g.: "c:\temp\test.txt" + * "/tmp/test.txt" + * + * @param sEncoding + * will be used to encode the string content inside the file. + * e.g.: "UTF8" + * + * @param bAppend + * specify if an already existing file will be + * expanded or replaced. + * + * @param sBuffer + * the new string content for this file. + */ + public static void writeEncodedBufferToFile(java.io.File aFile , + java.lang.String sEncoding, + boolean bAppend , + java.lang.StringBuffer sBuffer ) + throws java.io.IOException + { + java.io.FileOutputStream aByteStream = new java.io.FileOutputStream(aFile.getAbsolutePath(), bAppend); + java.io.OutputStreamWriter aEncodedWriter = new java.io.OutputStreamWriter(aByteStream, sEncoding); + + java.lang.String sTemp = sBuffer.toString(); + aEncodedWriter.write(sTemp, 0, sTemp.length()); + + aEncodedWriter.flush(); + aEncodedWriter.close(); + + if (!aFile.exists()) + throw new java.io.IOException("File \""+aFile.getAbsolutePath()+"\" not written correctly."); + } +} diff --git a/l10ntools/source/filter/utils/Logger.java b/l10ntools/source/filter/utils/Logger.java new file mode 100644 index 000000000000..7657eba5f426 --- /dev/null +++ b/l10ntools/source/filter/utils/Logger.java @@ -0,0 +1,177 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: Logger.java,v $ + * $Revision: 1.8 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package com.sun.star.filter.config.tools.utils; + +//_______________________________________________ +// imports + +import java.lang.*; +import java.util.*; + +//_______________________________________________ +// definition + +/** can be used to print out some debug messages + * and group it into warnings/errors or info statements. + * + * + */ +public class Logger +{ + //___________________________________________ + // const + + /** only error message will be shown. */ + public static final int LEVEL_ERRORS = 1; + + /** only errors and warnings will be shown. */ + public static final int LEVEL_WARNINGS = 2; + + /** enable errors/warnings and some global info + * message. */ + public static final int LEVEL_GLOBALINFOS = 3; + + /** enable anything! */ + public static final int LEVEL_DETAILEDINFOS = 4; + + //___________________________________________ + // member + + /** enable/disable different output level. + * e.g. warnings/errors/infos */ + private int m_nLevel; + + //___________________________________________ + // ctor + + /** initialize new debug object with the specified + * debug level. + * + * @param nLevel + * the new debug level. + * See const values LEVEL_xxx too. + */ + public Logger(int nLevel) + { + m_nLevel = nLevel; + } + + //___________________________________________ + // interface + + /** initialize new debug object with a default + * debug level. + */ + public Logger() + { + m_nLevel = LEVEL_DETAILEDINFOS; + } + + //___________________________________________ + // interface + + /** prints out an exception ... if the right level is set. + * + * @param ex + * the exception object + */ + public synchronized void setException(java.lang.Throwable ex) + { + if (m_nLevel >= LEVEL_ERRORS) + { + System.err.println("Exception:\n"); + ex.printStackTrace(); + } + } + + //___________________________________________ + // interface + + /** prints out an error ... if the right level is set. + * + * @param sError + * the error message. + */ + public synchronized void setError(java.lang.String sError) + { + if (m_nLevel >= LEVEL_ERRORS) + System.err.println("Error :\t\""+sError+"\""); + } + + //___________________________________________ + // interface + + /** prints out a warning ... if the right level is set. + * + * @param sWarning + * the warning message. + */ + public synchronized void setWarning(java.lang.String sWarning) + { + if (m_nLevel >= LEVEL_WARNINGS) + System.err.println("Warning :\t\""+sWarning+"\""); + } + + //___________________________________________ + // interface + + /** prints out a global info message ... if the right level is set. + * + * Global infos should be used to describe a complex operation. + * E.g.: loading of a document. + * But not for every sub operation like e.g. analyzing lines + * during loading the document! + * + * @param sInfo + * the info message. + */ + public synchronized void setGlobalInfo(java.lang.String sInfo) + { + if (m_nLevel >= LEVEL_GLOBALINFOS) + System.out.println("Info :\t\""+sInfo+"\""); + } + + //___________________________________________ + // interface + + /** prints out a mode detailed info message ... if the right level is set. + * + * Such detailed message are e.g. "analyze line [n] of file ...". + * + * @param sInfo + * the info message. + */ + public synchronized void setDetailedInfo(java.lang.String sInfo) + { + if (m_nLevel >= LEVEL_DETAILEDINFOS) + System.out.println("Detail :\t\""+sInfo+"\""); + } +} diff --git a/l10ntools/source/filter/utils/MalformedCommandLineException.java b/l10ntools/source/filter/utils/MalformedCommandLineException.java new file mode 100644 index 000000000000..e073dcb9adcc --- /dev/null +++ b/l10ntools/source/filter/utils/MalformedCommandLineException.java @@ -0,0 +1,50 @@ +/*_*********************************************************************** + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: MalformedCommandLineException.java,v $ + * $Revision: 1.4 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + **********************************************************************_*/ + +package com.sun.star.filter.config.tools.utils; + +//_______________________________________________ +// imports + +import java.lang.*; + +//___________________________________________ +// types + +/** indicates a malformed command line. + * + * E.g. it must be thrown if the command line contains one item more then once, + * or use unsupported format. + */ +public class MalformedCommandLineException extends java.lang.Exception +{ + public MalformedCommandLineException() {} + public MalformedCommandLineException(java.lang.String sMsg) { super(sMsg); } +} diff --git a/l10ntools/source/filter/utils/XMLHelper.java b/l10ntools/source/filter/utils/XMLHelper.java new file mode 100644 index 000000000000..0f912cac8e25 --- /dev/null +++ b/l10ntools/source/filter/utils/XMLHelper.java @@ -0,0 +1,825 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: XMLHelper.java,v $ + * $Revision: 1.7 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package com.sun.star.filter.config.tools.utils; + +//_______________________________________________ + +import java.lang.*; +import java.util.*; +import java.io.*; + +//_______________________________________________ + +/** + * It provides some constant values and some static helper routines + * which are neccessary to work with a xml file - especialy + * the filter configuration. + * + * + */ +public class XMLHelper +{ + //___________________________________________ + // public const + + /** its a possible value of the xml attribute "oor:type" and identify an integer type. */ + public static final java.lang.String XMLTYPE_INTEGER = "xs:int"; + + /** its a possible value of the xml attribute "oor:type" and identify an boolean type. */ + public static final java.lang.String XMLTYPE_BOOLEAN = "xs:boolean"; + + /** its a possible value of the xml attribute "oor:type" and identify an string type. */ + public static final java.lang.String XMLTYPE_STRING = "xs:string"; + + /** its a possible value of the xml attribute "oor:type" and identify an string list type. */ + public static final java.lang.String XMLTYPE_STRINGLIST = "oor:string-list"; + + /** its a xml attribute, which specify a property name. */ + public static final java.lang.String XMLATTRIB_OOR_NAME = "oor:name"; + + /** its a xml attribute, which specify a property type. */ + public static final java.lang.String XMLATTRIB_OOR_TYPE = "oor:type"; + + /** its a xml attribute, which specify a list separator. */ + public static final java.lang.String XMLATTRIB_OOR_SEPARATOR = "oor:separator"; + + /** its a xml attribute, which specify a localized value. */ + public static final java.lang.String XMLATTRIB_OOR_LOCALIZED = "oor:localized"; + + /** its a xml attribute, which specify a merge operation for cfg layering. */ + public static final java.lang.String XMLATTRIB_OOR_OP = "oor:op"; + + /** can be used as value for XMLATTRIB_OOR_OP. */ + public static final java.lang.String XMLATTRIB_OP_REPLACE = "replace"; + + /** its a xml attribute, which specify a locale value. */ + public static final java.lang.String XMLATTRIB_XML_LANG = "xml:lang"; + + /** its the tag name of a entry. */ + public static final java.lang.String XMLTAG_VALUE = "value"; + + /** its the tag name of a entry. */ + public static final java.lang.String XMLTAG_PROP = "prop"; + + /** its the tag name of a entry. */ + public static final java.lang.String XMLTAG_NODE = "node"; + + //___________________________________________ + // private const + + /** a static list of all possible separators, which can be used for configuration type string-list. */ + private static final java.lang.String[] DELIMS = {" ", ",", ";", ".", ":", "-", "_", "#", "'", "+", "*", "~", "=", "?"}; + + /** index of the default separator inside list DELIMS. + * Its neccessary to know such default separator; because it can + * be supressed as xml attribute of the corresponding value tag. */ + private static final int DEFAULT_SEPARATOR = 0; + + //___________________________________________ + + /** analyze the structures of the given XML node and + * return a property set of all found sub nodes. + * + * Such properties are organized as [name, value] pairs. + * The type of a xml node will be detected automaticly. + * Following types are supported: + * xs:int => java.lang.Integer + * xs:bool => java.lang.Boolean + * xs:string => java.lang.String + * oor:string-list => java.util.LinkedList[java.lang.String] + * oor:set => java.util.Vector[java.lang.Object] + * oor:localized => java.util.HashMap[java.lang.Object] + * + * @param aNode + * points directly to the xml node, where we should analyze + * the children nodes. + * + * @return [java.util.HashMap] + * contains every node name as key and its string(!) as value. + */ + public static java.util.HashMap convertNodeToPropSet(org.w3c.dom.Node aNode) + throws java.lang.Exception + { + java.util.HashMap aPropSet = new java.util.HashMap(); + + // get all child nodes, which seems to be properties + java.util.Vector lChildNodes = XMLHelper.extractChildNodesByTagName(aNode, XMLTAG_PROP); + java.util.Enumeration en1 = lChildNodes.elements(); + while(en1.hasMoreElements()) + { + org.w3c.dom.Node aChildNode = (org.w3c.dom.Node)en1.nextElement(); + + // read its name + java.lang.String sChildName = XMLHelper.extractNodeAttribByName(aChildNode, XMLATTRIB_OOR_NAME); + if (sChildName == null) + throw new java.io.IOException("unsupported format: could not extract child node name"); + + // read its type info + java.lang.String sChildType = XMLHelper.extractNodeAttribByName(aChildNode, XMLATTRIB_OOR_TYPE); + if (sChildType == null) + { + /** Special patch: + * If an xml tag has no type information set ... we can restore it + * by analyzing the already readed tag name :-) + * Not very nice - but it can help to read stripped xml files too. */ + sChildType = XMLHelper.getTypeForTag(sChildName); + if (sChildType == null) + throw new java.io.IOException("unsupported format: could not extract child node type"); + } + + // read its value(s?) + java.util.Vector lChildValues = XMLHelper.extractChildNodesByTagName(aChildNode, XMLTAG_VALUE); + java.util.Enumeration en2 = lChildValues.elements(); + int nValue = 0; + java.lang.Object aValue = null; + while(en2.hasMoreElements()) + { + org.w3c.dom.Node aValueNode = (org.w3c.dom.Node)en2.nextElement(); + java.lang.String sChildLocale = XMLHelper.extractNodeAttribByName(aValueNode, XMLATTRIB_XML_LANG); + boolean bLocalized = (sChildLocale != null); + + ++nValue; + + if (sChildType.equals(XMLTYPE_INTEGER)) + { + if (!bLocalized && nValue > 1) + throw new java.io.IOException("unsupported format: more then one value for non localized but atomic type detected"); + java.lang.String sData = ((org.w3c.dom.CharacterData)aValueNode.getFirstChild()).getData(); + aValue = new java.lang.Integer(sData); + } + else + if (sChildType.equals(XMLTYPE_BOOLEAN)) + { + if (!bLocalized && nValue > 1) + throw new java.io.IOException("unsupported format: more then one value for non localized but atomic type detected"); + java.lang.String sData = ((org.w3c.dom.CharacterData)aValueNode.getFirstChild()).getData(); + aValue = new java.lang.Boolean(sData); + } + else + if (sChildType.equals(XMLTYPE_STRING)) + { + if (!bLocalized && nValue > 1) + throw new java.io.IOException("unsupported format: more then one value for non localized but atomic type detected"); + + java.lang.String sData = ((org.w3c.dom.CharacterData)aValueNode.getFirstChild()).getData(); + + java.util.HashMap lLocalized = null; + if (bLocalized) + { + if (aValue == null) + aValue = new java.util.HashMap(); + lLocalized = (java.util.HashMap)aValue; + lLocalized.put(sChildLocale, sData); + } + else + aValue = sData; + } + else + if (sChildType.equals(XMLTYPE_STRINGLIST)) + { + if (!bLocalized && nValue > 1) + throw new java.io.IOException("unsupported format: more then one value for non localized but atomic type detected"); + + java.lang.String sSeparator = XMLHelper.extractNodeAttribByName(aChildNode, XMLATTRIB_OOR_SEPARATOR); + if (sSeparator == null) + sSeparator = " "; + + java.lang.String sData = ((org.w3c.dom.CharacterData)aValueNode.getFirstChild()).getData(); + sData = sData.replace('\t', ' '); + sData = sData.replace('\n', ' '); + java.util.StringTokenizer aTokenizer = new java.util.StringTokenizer(sData, sSeparator); + java.util.Vector lList = new java.util.Vector(); + while(aTokenizer.hasMoreTokens()) + { + java.lang.String sToken = (java.lang.String)aTokenizer.nextToken(); + sToken.trim(); + if (sToken.length() < 1) + continue; + lList.add(sToken); + } + aValue = lList; + } + + aPropSet.put(sChildName, aValue); + } + } + + return aPropSet; + } + + //___________________________________________ + + private static java.lang.String getTypeForTag(java.lang.String sTag) + { + java.lang.String sType = null; + + if ( + (sTag.equals(Cache.PROPNAME_DATA )) || + (sTag.equals(Cache.PROPNAME_NAME )) || + (sTag.equals(Cache.PROPNAME_UINAME )) || + (sTag.equals(Cache.PROPNAME_MEDIATYPE )) || + (sTag.equals(Cache.PROPNAME_CLIPBOARDFORMAT )) || + (sTag.equals(Cache.PROPNAME_PREFERREDFILTER )) || + (sTag.equals(Cache.PROPNAME_DETECTSERVICE )) || + (sTag.equals(Cache.PROPNAME_FRAMELOADER )) || + (sTag.equals(Cache.PROPNAME_CONTENTHANDLER )) || + (sTag.equals(Cache.PROPNAME_DOCUMENTSERVICE )) || + (sTag.equals(Cache.PROPNAME_FILTERSERVICE )) || + (sTag.equals(Cache.PROPNAME_TEMPLATENAME )) || + (sTag.equals(Cache.PROPNAME_TYPE )) || + (sTag.equals(Cache.PROPNAME_UICOMPONENT )) + ) + sType = XMLTYPE_STRING; + else + if ( + (sTag.equals(Cache.PROPNAME_PREFERRED )) || + (sTag.equals("Installed" )) + ) + sType = XMLTYPE_BOOLEAN; + else + if ( + (sTag.equals(Cache.PROPNAME_UIORDER )) || + (sTag.equals(Cache.PROPNAME_DOCUMENTICONID )) || + (sTag.equals(Cache.PROPNAME_FILEFORMATVERSION)) + ) + sType = XMLTYPE_INTEGER; + else + if ( + (sTag.equals(Cache.PROPNAME_URLPATTERN )) || + (sTag.equals(Cache.PROPNAME_EXTENSIONS )) || + (sTag.equals(Cache.PROPNAME_USERDATA )) || + (sTag.equals(Cache.PROPNAME_FLAGS )) || + (sTag.equals(Cache.PROPNAME_TYPES )) + ) + sType = XMLTYPE_STRINGLIST; + + if (sType == null) + System.err.println("getTypeForTag("+sTag+") = "+sType); + + return sType; + } + + //___________________________________________ + + /** return a xml representation of the given property set. + * + * @param aPropSet + * a set of pairs, which should be translated to xml + * + * @return [java.lang.String] + * the xml string representation. + * + * @throws [java.lang.Exception] + * if anything during convertion fill fail. + */ + public static java.lang.String convertPropSetToXML(java.util.HashMap aPropSet , + int nPrettyTabs) + throws java.lang.Exception + { + java.lang.StringBuffer sXML = new java.lang.StringBuffer(256); + + java.util.Iterator it1 = aPropSet.keySet().iterator(); + while(it1.hasNext()) + { + java.lang.String sProp = (java.lang.String)it1.next(); + java.lang.Object aVal = aPropSet.get(sProp); + + sProp = encodeHTMLSigns(sProp); + + // is it a simple type? + if ( + (aVal instanceof java.lang.Integer) || + (aVal instanceof java.lang.Boolean) || + (aVal instanceof java.lang.String ) + ) + { + sXML.append(XMLHelper.convertSimpleObjectToXML(sProp, aVal, nPrettyTabs)); + continue; + } + + // no! + // is it a list value? + if (aVal instanceof java.util.Vector) + { + java.util.Vector lVal = (java.util.Vector)aVal; + sXML.append(XMLHelper.convertListToXML(sProp, lVal, nPrettyTabs)); + continue; + } + + // its a localized value? + if (aVal instanceof java.util.HashMap) + { + java.util.HashMap lVal = (java.util.HashMap)aVal; + sXML.append(XMLHelper.convertLocalizedValueToXML(sProp, lVal, nPrettyTabs)); + continue; + } + + // unknown type! + java.lang.StringBuffer sMsg = new java.lang.StringBuffer(256); + sMsg.append("unsupported object type detected."); + sMsg.append("\ttype ? : \""+sProp+"\" = "+aVal); + sMsg.append("\tprop set: \""+aPropSet ); + throw new java.lang.Exception(sMsg.toString()); + } + + return sXML.toString(); + } + + public static java.lang.String encodeHTMLSigns(java.lang.String sValue) + { + java.lang.StringBuffer sSource = new java.lang.StringBuffer(sValue); + java.lang.StringBuffer sDestination = new java.lang.StringBuffer(1000 ); + + for (int i=0; i \""+sReturn+"\""); + + return sReturn; + } + + //___________________________________________ + + /** return a xml representation of an atomic property. + * + * Atomic property types are e.g. Integer, Boolean, String. + * + * @param sName + * the name of the property. + + * @param aValue + * the value of the property. + * + * @param nPrettyTabs + * count of tab signs for pretty format the xml code :-) + * + * @return [java.lang.String] + * the xml string representation. + * + * @throws [java.lang.Exception] + * if anything during convertion fill fail. + */ + private static java.lang.String convertSimpleObjectToXML(java.lang.String sName , + java.lang.Object aValue , + int nPrettyTabs) + throws java.lang.Exception + { + java.lang.StringBuffer sXML = new java.lang.StringBuffer(256); + for (int t=0; t"); + sXML.append(""+aValue.toString()+""); + sXML.append("\n"); + } + else + if (aValue instanceof java.lang.Boolean) + { + sXML.append(""); + sXML.append(""+aValue.toString()+""); + sXML.append("\n"); + } + else + if (aValue instanceof java.lang.String) + { + sXML.append("\n"); + else + { + sXML.append(">"+sValue+""); + sXML.append("\n"); + } + } + else + { + System.err.println("name = "+sName); + System.err.println("value = "+aValue); + // ! can be used outside to detect - that it was not a simple type :-) + throw new java.lang.Exception("not an atomic type."); + } + + return sXML.toString(); + } + + //___________________________________________ + + /** return a xml representation of a string-list property. + * + * @param sName + * the name of the property. + + * @param aValue + * the value of the property. + * + * @param nPrettyTabs + * count of tab signs for pretty format the xml code :-) + * + * @return [java.lang.String] + * the xml string representation. + * + * @throws [java.lang.Exception] + * if anything during convertion fill fail. + */ + private static java.lang.String convertListToXML(java.lang.String sName , + java.util.Vector aValue , + int nPrettyTabs) + throws java.lang.Exception + { + java.lang.StringBuffer sXML = new java.lang.StringBuffer(256); + + for (int t=0; t\n"); + return sXML.toString(); + } + + // step over all list items and add it to a string buffer + // Every item will be separated by a default separator "\n" first. + // Because "\n" is not a valid separator at all and can`t occure inside + // our list items. During we step over all items, we check if our current separator + // (we use a list of possible ones!) clash with an item. + // If it clash - we step to the next possible separator. + // If our list of possible separator values runs out of range we throw + // an exception :-) Its better then generating of wrong values + // If we found a valid seperator - we use it to replace our "\n" place holder + // at the end of the following loop ... + + int d = 0; + java.lang.StringBuffer sValBuff = new java.lang.StringBuffer(256); + for (int i=0; i= DELIMS.length) + throw new java.lang.Exception("No valid separator found for a string list item."); + if (sValue.length() < 1 && DELIMS[d].equals(" ")) + { + ++d; + continue; + } + if (sValue.indexOf(DELIMS[d]) != -1) + { + ++d; + continue; + } + break; + } + } + + // replace default separator with right one + System.out.println("TODO: must be adapted to java 1.3 :-("); + System.exit(-1); +//TODO_JAVA java.lang.String sListVal = sValBuff.toString().replaceAll("\n", DELIMS[d]); + java.lang.String sListVal = null; + + sXML.append(""); + if (d == DEFAULT_SEPARATOR) + sXML.append(""); + else + sXML.append(""); + sXML.append(sListVal); + sXML.append(""); + sXML.append("\n"); + + return sXML.toString(); + } + + //___________________________________________ + + /** return a xml representation of a localized property. + * + * @param sName + * the name of the property. + + * @param aValue + * the value of the property. + * + * @param nPrettyTabs + * count of tab signs for pretty format the xml code :-) + * + * @return [java.lang.String] + * the xml string representation. + * + * @throws [java.lang.Exception] + * if anything during convertion fill fail. + */ + private static java.lang.String convertLocalizedValueToXML(java.lang.String sName , + java.util.HashMap aValue , + int nPrettyTabs) + throws java.lang.Exception + { + java.lang.StringBuffer sXML = new java.lang.StringBuffer(256); + + int c = aValue.size(); + if (c < 1) + throw new java.lang.Exception("Cant detect type of localized values. Because the given list is empty."); + + for (int t=0; t\n"); + java.util.Iterator it = aValue.keySet().iterator(); +// boolean bTypeKnown = false; + while(it.hasNext()) + { + java.lang.String sLocale = (java.lang.String)it.next(); + java.lang.Object aLocalizedValue = aValue.get(sLocale); +/* + if (!bTypeKnown) + { + bTypeKnown = true; + if (aLocalizedValue instanceof java.lang.Integer) + sXML.append(" "+XMLATTRIB_OOR_TYPE+"=\""+XMLTYPE_INTEGER+"\">\n"); + else + if (aLocalizedValue instanceof java.lang.Boolean) + sXML.append(" "+XMLATTRIB_OOR_TYPE+"=\""+XMLTYPE_BOOLEAN+"\">\n"); + else + if (aLocalizedValue instanceof java.lang.String) + sXML.append(" "+XMLATTRIB_OOR_TYPE+"=\""+XMLTYPE_STRING+"\">\n"); + else + throw new java.lang.Exception("Unsupported type for localized value detected."); + } +*/ + java.lang.String sLocValue = aLocalizedValue.toString(); + java.lang.String sValue = encodeHTMLSigns(sLocValue); + + for (int t=0; t"+sValue+"\n"); + } + --nPrettyTabs; + for (int t=0; t\n"); + + return sXML.toString(); + } + + //___________________________________________ + + /** returns the value of an attribute of the given node. + * + * If the given node represent an lement node, may it supports some attributes. + * Then this method search for an attribute with the specified name and return it's value. + * If nothing could be found ... or the given node isn't a suitable node ... it returns null. + * + * @param aNode + * the node, which should be analyzed. + * + * @param sAttrib + * name of the attribute, which should be searched. + * + * @return The value of the specified attribute if it could be found at the given node. + * Can be null if node doesn't support attributes or the searched one does not exist there. + */ + public static java.lang.String extractNodeAttribByName(org.w3c.dom.Node aNode , + java.lang.String sAttrib) + throws java.lang.Exception + { + // We can get valid attributes for element nodes only! + if (aNode.getNodeType() != org.w3c.dom.Node.ELEMENT_NODE) + { +// System.err.println("not an element node"); + return null; + } + + // may it supports attributes in general ... but doesn't have anyone realy. + org.w3c.dom.NamedNodeMap lAttribs = aNode.getAttributes(); + if (lAttribs==null) + { +// System.err.println("no attributes at all"); + return null; + } + + // step over the attribute list and search for the requested one + for (int i=0; i\n"); + sHeader.append("\n"); + } + else + { + sHeader.append("\n\n"); + sHeader.append("\n"); + } + + return sHeader.toString(); + } + + public static java.lang.String generateFooter() + { + return "\n"; + } +} diff --git a/l10ntools/source/filter/utils/makefile.mk b/l10ntools/source/filter/utils/makefile.mk new file mode 100644 index 000000000000..4025c54b2c38 --- /dev/null +++ b/l10ntools/source/filter/utils/makefile.mk @@ -0,0 +1,57 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2008 by Sun Microsystems, Inc. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.9.98.2 $ +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ = ..$/..$/.. +TARGET = FCFGUtils +PRJNAME = l10ntools +PACKAGE = com$/sun$/star$/filter$/config$/tools$/utils + +# --- Settings ----------------------------------------------------- + +.INCLUDE: settings.mk + +#----- compile .java files ----------------------------------------- + + +JAVACLASSFILES = \ + $(CLASSDIR)$/$(PACKAGE)$/AnalyzeStartupLog.class \ + $(CLASSDIR)$/$(PACKAGE)$/ConfigHelper.class \ + $(CLASSDIR)$/$(PACKAGE)$/Logger.class \ + $(CLASSDIR)$/$(PACKAGE)$/FileHelper.class \ + $(CLASSDIR)$/$(PACKAGE)$/MalformedCommandLineException.class \ + $(CLASSDIR)$/$(PACKAGE)$/Cache.class \ + $(CLASSDIR)$/$(PACKAGE)$/XMLHelper.class + +MAXLINELENGTH = 100000 + +# --- targets ----------------------------------------------------- + +.INCLUDE : target.mk diff --git a/l10ntools/source/gsicheck.cxx b/l10ntools/source/gsicheck.cxx new file mode 100644 index 000000000000..aa3b8157952d --- /dev/null +++ b/l10ntools/source/gsicheck.cxx @@ -0,0 +1,1177 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: gsicheck.cxx,v $ + * $Revision: 1.29 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_l10ntools.hxx" +#include +#include +#include +#include + +// local includes +#include "tagtest.hxx" +#include "gsicheck.hxx" + +#define MAX_GID_LID_LEN 250 + +/*****************************************************************************/ +void PrintMessage( ByteString aType, ByteString aMsg, ByteString aPrefix, + ByteString aContext, BOOL bPrintContext, ULONG nLine, ByteString aUniqueId = ByteString() ) +/*****************************************************************************/ +{ + fprintf( stdout, "%s %s, Line %lu", aType.GetBuffer(), aPrefix.GetBuffer(), nLine ); + if ( aUniqueId.Len() ) + fprintf( stdout, ", UniqueID %s", aUniqueId.GetBuffer() ); + fprintf( stdout, ": %s", aMsg.GetBuffer() ); + + if ( bPrintContext ) + fprintf( stdout, " \"%s\"", aContext.GetBuffer() ); + fprintf( stdout, "\n" ); +} + +/*****************************************************************************/ +void PrintError( ByteString aMsg, ByteString aPrefix, + ByteString aContext, BOOL bPrintContext, ULONG nLine, ByteString aUniqueId = ByteString() ) +/*****************************************************************************/ +{ + PrintMessage( "Error:", aMsg, aPrefix, aContext, bPrintContext, nLine, aUniqueId ); +} + +BOOL LanguageOK( ByteString aLang ) +{ + if ( !aLang.Len() ) + return FALSE; + + if ( aLang.IsNumericAscii() ) + return TRUE; + + if ( aLang.GetTokenCount( '-' ) == 1 ) + return aLang.IsAlphaAscii() && aLang.IsLowerAscii(); + else if ( aLang.GetTokenCount( '-' ) == 2 ) + { + ByteString aTok0( aLang.GetToken( 0, '-' ) ); + ByteString aTok1( aLang.GetToken( 1, '-' ) ); + return aTok0.Len() && aTok0.IsAlphaAscii() && aTok0.IsLowerAscii() + && aTok1.Len() && aTok1.IsAlphaAscii() && aTok1.IsUpperAscii() + && !aTok1.EqualsIgnoreCaseAscii( aTok0 ); + } + + return FALSE; +} + + +// +// class LazySvFileStream +// + + +class LazySvFileStream : public SvFileStream +{ + +private: + String aFileName; + BOOL bOpened; + StreamMode eOpenMode; + +public: + LazySvFileStream() + : aFileName() + , bOpened( FALSE ) + , eOpenMode( 0 ) + {}; + + void SetOpenParams( const String& rFileName, StreamMode eOpenModeP ) + { + aFileName = rFileName; + eOpenMode = eOpenModeP; + }; + + void LazyOpen(); +}; + +void LazySvFileStream::LazyOpen() +{ + if ( !bOpened ) + { + Open( aFileName, eOpenMode ); + if ( !IsOpen()) + { + fprintf( stderr, "\nERROR: Could not open Output-File %s!\n\n", ByteString( aFileName, RTL_TEXTENCODING_ASCII_US ).GetBuffer() ); + exit ( 4 ); + } + bOpened = TRUE; + } +} + + +// +// class GSILine +// + +/*****************************************************************************/ +GSILine::GSILine( const ByteString &rLine, ULONG nLine ) +/*****************************************************************************/ + : ByteString( rLine ) + , nLineNumber( nLine ) + , bOK( TRUE ) + , bFixed ( FALSE ) +{ + if ( rLine.GetTokenCount( '\t' ) == 15 ) + { + aFormat = FORMAT_SDF; + aUniqId = rLine.GetToken( 0, '\t' ); + aUniqId.Append("/").Append( rLine.GetToken( 1, '\t' ) ).Append("/").Append( rLine.GetToken( 3, '\t' ) ).Append("/").Append( rLine.GetToken( 4, '\t' ) ).Append("/").Append( rLine.GetToken( 5, '\t' ) ).Append("/").Append( rLine.GetToken( 6, '\t' ) ).Append("/").Append( rLine.GetToken( 7, '\t' ) ); + aLineType = ""; + aLangId = rLine.GetToken( 9, '\t' ); + aText = rLine.GetToken( 10, '\t' ); + aQuickHelpText = rLine.GetToken( 12, '\t' ); + aTitle = rLine.GetToken( 13, '\t' ); + + // do some more format checks here + if ( !rLine.GetToken( 8, '\t' ).IsNumericAscii() ) + { + PrintError( "The length field does not contain a number!", "Line format", rLine.GetToken( 8, '\t' ), TRUE, GetLineNumber(), GetUniqId() ); + NotOK(); + } + if ( !LanguageOK( aLangId ) ) + { + PrintError( "The Language is invalid!", "Line format", aLangId, TRUE, GetLineNumber(), GetUniqId() ); + NotOK(); + } + // limit GID and LID to MAX_GID_LID_LEN chars each for database conformity, see #137575# + if ( rLine.GetToken( 4, '\t' ).Len() > MAX_GID_LID_LEN || rLine.GetToken( 5, '\t' ).Len() > MAX_GID_LID_LEN ) + { + PrintError( ByteString("GID and LID may only be ").Append( ByteString::CreateFromInt32(MAX_GID_LID_LEN) ).Append( " chars long each!" ), "Line format", aLangId, TRUE, GetLineNumber(), GetUniqId() ); + NotOK(); + } + } + else // allow tabs in gsi files + { + aFormat = FORMAT_GSI; + ByteString sTmp( rLine ); + USHORT nPos = sTmp.Search( "($$)" ); + USHORT nStart = 0; + if ( nPos != STRING_NOTFOUND ) + { + aUniqId = sTmp.Copy( nStart, nPos - nStart ); + nStart = nPos + 4; // + length of the delemiter + nPos = sTmp.Search( "($$)", nStart ); + } + if ( nPos != STRING_NOTFOUND ) + { + aLineType = sTmp.Copy( nStart, nPos - nStart ); + nStart = nPos + 4; // + length of the delemiter + nPos = sTmp.Search( "($$)", nStart ); + aUniqId.Append( "/" ); + aUniqId.Append( aLineType ); + } + if ( nPos != STRING_NOTFOUND ) + { + aLangId = sTmp.Copy( nStart, nPos - nStart ); + nStart = nPos + 4; // + length of the delemiter + nPos = sTmp.Search( "($$)", nStart ); + } + if ( nPos != STRING_NOTFOUND ) + { +// ByteString aStatus = sTmp.Copy( nStart, nPos - nStart ); // ext int ... + nStart = nPos + 4; // + length of the delemiter + } + if ( nPos != STRING_NOTFOUND ) + aText = sTmp.Copy( nStart ); + else + aFormat = FORMAT_UNKNOWN; + } + + if ( FORMAT_UNKNOWN == GetLineFormat() ) + NotOK(); +} + +/*****************************************************************************/ +void GSILine::NotOK() +/*****************************************************************************/ +{ + bOK = FALSE; +} + +/*****************************************************************************/ +void GSILine::ReassembleLine() +/*****************************************************************************/ +{ + ByteString aReassemble; + if ( GetLineFormat() == FORMAT_SDF ) + { + USHORT i; + for ( i = 0 ; i < 10 ; i++ ) + { + aReassemble.Append( GetToken( i, '\t' ) ); + aReassemble.Append( "\t" ); + } + aReassemble.Append( aText ); + aReassemble.Append( "\t" ); + aReassemble.Append( GetToken( 11, '\t' ) ); // should be empty but there are some places in sc. Not reflected to sources!! + aReassemble.Append( "\t" ); + aReassemble.Append( aQuickHelpText ); + aReassemble.Append( "\t" ); + aReassemble.Append( aTitle ); + for ( i = 14 ; i < 15 ; i++ ) + { + aReassemble.Append( "\t" ); + aReassemble.Append( GetToken( i, '\t' ) ); + } + *(ByteString*)this = aReassemble; + } + else if ( GetLineFormat() == FORMAT_GSI ) + { + USHORT nPos = Search( "($$)" ); + USHORT nStart = 0; + if ( nPos != STRING_NOTFOUND ) + { + nStart = nPos + 4; // + length of the delemiter + nPos = Search( "($$)", nStart ); + } + if ( nPos != STRING_NOTFOUND ) + { + nStart = nPos + 4; // + length of the delemiter + nPos = Search( "($$)", nStart ); + } + if ( nPos != STRING_NOTFOUND ) + { + nStart = nPos + 4; // + length of the delemiter + nPos = Search( "($$)", nStart ); + } + if ( nPos != STRING_NOTFOUND ) + { + nStart = nPos + 4; // + length of the delemiter + } + if ( nPos != STRING_NOTFOUND ) + { + aReassemble = Copy( 0, nStart ); + aReassemble += aText; + *(ByteString*)this = aReassemble; + } + else + PrintError( "Cannot reassemble GSI line (internal Error).", "Line format", "", FALSE, GetLineNumber(), GetUniqId() ); + } + else + PrintError( "Cannot reassemble line of unknown type (internal Error).", "Line format", "", FALSE, GetLineNumber(), GetUniqId() ); +} + +// +// class GSIBlock +// +/*****************************************************************************/ +GSIBlock::GSIBlock( BOOL PbPrintContext, BOOL bSource, BOOL bTrans, BOOL bRef, BOOL bAllowKID, BOOL bAllowSusp ) +/*****************************************************************************/ + : pSourceLine( NULL ) + , pReferenceLine( NULL ) + , bPrintContext( PbPrintContext ) + , bCheckSourceLang( bSource ) + , bCheckTranslationLang( bTrans ) + , bReference( bRef ) + , bAllowKeyIDs( bAllowKID ) + , bAllowSuspicious( bAllowSusp ) + , bHasBlockError( FALSE ) +{ +} + +/*****************************************************************************/ +GSIBlock::~GSIBlock() +/*****************************************************************************/ +{ + delete pSourceLine; + delete pReferenceLine; + + for ( ULONG i = 0; i < Count(); i++ ) + delete ( GetObject( i )); +} + +/*****************************************************************************/ +void GSIBlock::InsertLine( GSILine* pLine, ByteString aSourceLang) +/*****************************************************************************/ +{ + if ( pLine->GetLanguageId().Equals( aSourceLang ) ) + { + if ( pSourceLine ) + { + PrintError( "Source Language entry double. Treating as Translation.", "File format", "", pLine->GetLineNumber(), pLine->GetUniqId() ); + bHasBlockError = TRUE; + pSourceLine->NotOK(); + pLine->NotOK(); + } + else + { + pSourceLine = pLine; + return; + } + } + ULONG nPos = 0; + + if ( aSourceLang.Len() ) // only check blockstructure if source lang is given + { + while ( nPos < Count() ) + { + if ( GetObject( nPos )->GetLanguageId().Equals( pLine->GetLanguageId() ) ) + { + PrintError( "Translation Language entry double. Checking both.", "File format", "", pLine->GetLineNumber(), pLine->GetUniqId() ); + bHasBlockError = TRUE; + GetObject( nPos )->NotOK(); + pLine->NotOK(); + } + nPos++; + } + } + Insert( pLine, LIST_APPEND ); +} + +/*****************************************************************************/ +void GSIBlock::SetReferenceLine( GSILine* pLine ) +/*****************************************************************************/ +{ + pReferenceLine = pLine; +} + +/*****************************************************************************/ +void GSIBlock::PrintMessage( ByteString aType, ByteString aMsg, ByteString aPrefix, + ByteString aContext, ULONG nLine, ByteString aUniqueId ) +/*****************************************************************************/ +{ + ::PrintMessage( aType, aMsg, aPrefix, aContext, bPrintContext, nLine, aUniqueId ); +} + +/*****************************************************************************/ +void GSIBlock::PrintError( ByteString aMsg, ByteString aPrefix, + ByteString aContext, ULONG nLine, ByteString aUniqueId ) +/*****************************************************************************/ +{ + PrintMessage( "Error:", aMsg, aPrefix, aContext, nLine, aUniqueId ); +} + +/*****************************************************************************/ +void GSIBlock::PrintList( ParserMessageList *pList, ByteString aPrefix, + GSILine *pLine ) +/*****************************************************************************/ +{ + ULONG i; + for ( i = 0 ; i < pList->Count() ; i++ ) + { + ParserMessage *pMsg = pList->GetObject( i ); + ByteString aContext; + if ( bPrintContext ) + { + if ( pMsg->GetTagBegin() == STRING_NOTFOUND ) + aContext = pLine->GetText().Copy( 0, 300 ); + else + aContext = pLine->Copy( pMsg->GetTagBegin()-150, 300 ); + aContext.EraseTrailingChars(' '); + aContext.EraseLeadingChars(' '); + } + + PrintMessage( pMsg->Prefix(), pMsg->GetErrorText(), aPrefix, aContext, pLine->GetLineNumber(), pLine->GetUniqId() ); + } +} + +/*****************************************************************************/ +BOOL GSIBlock::IsUTF8( const ByteString &aTestee, BOOL bFixTags, USHORT &nErrorPos, ByteString &aErrorMsg, BOOL &bHasBeenFixed, ByteString &aFixed ) const +/*****************************************************************************/ +{ + String aUTF8Tester( aTestee, RTL_TEXTENCODING_UTF8 ); + if ( STRING_MATCH != (nErrorPos = ByteString( aUTF8Tester, RTL_TEXTENCODING_UTF8 ).Match( aTestee )) ) + { + aUTF8Tester = String( aTestee.GetBuffer(), nErrorPos, RTL_TEXTENCODING_UTF8 ); + nErrorPos = aUTF8Tester.Len(); + aErrorMsg = ByteString( "UTF8 Encoding seems to be broken" ); + return FALSE; + } + + nErrorPos = aUTF8Tester.SearchChar( String::CreateFromAscii( "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0b\x0c\x0e\x0f" + "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x7f" ).GetBuffer() ); + if ( nErrorPos != STRING_NOTFOUND ) + { + aErrorMsg = ByteString( "String contains illegal character" ); + return FALSE; + } + + if ( bFixTags ) + { + bHasBeenFixed = FALSE; + aFixed.Erase(); + } + + if ( !bAllowKeyIDs ) + { + BOOL bIsKeyID = FALSE; + BOOL bNewId = FALSE; + ByteString aID( aTestee ); + USHORT nAfterID = 0; + + if ( aTestee.Equals( "{&", 0, 2 ) ) + { // check for strings from instset_native like "{&Tahoma8}335795.Installation Wiza ..." + USHORT nTagEnd = aTestee.Search( '}' ); + if ( nTagEnd != STRING_NOTFOUND ) + { + if ( bFixTags ) + aFixed = aTestee.Copy( 0, nTagEnd+1 ); + nErrorPos = nTagEnd+1; + aID = aTestee.Copy( nTagEnd+1 ); + nAfterID = nTagEnd+1; + } + } + + ByteString aDelimiter( (String)String( sal_Unicode(0x2016) ), RTL_TEXTENCODING_UTF8 ); + + if ( aID.Equals( aDelimiter, 6, aDelimiter.Len() ) ) + { // New KeyId 6 Letters, digits and spechial chars followed by delimiter + bNewId = TRUE; + nErrorPos = 1; + aID = aID.Copy( 0, 6 ); + nAfterID += 6; + nAfterID = nAfterID + aDelimiter.Len(); + } + else if ( ( aID.GetChar(6) == '*' ) && aID.Equals( aDelimiter, 7, aDelimiter.Len() ) ) + { // New KeyId 6 Letters, digits and spechial chars followed by '*delimiter' to indicate translation in progress + bNewId = TRUE; + nErrorPos = 1; + aID = aID.Copy( 0, 6 ); + nAfterID += 7; + nAfterID = nAfterID + aDelimiter.Len(); + } + else if ( aID.GetTokenCount( '.' ) > 1 ) + { // test for old KeyIDs 5 to 6 digits followed by a dot '44373.' + bNewId = FALSE; + nErrorPos = 1; + aID = aID.GetToken( 0, '.' ); + nAfterID = nAfterID + aID.Len(); + } + else + { + aID.Erase(); + } + + if ( bNewId ) + { + if ( aID.Len() == 6 ) + { + bIsKeyID = TRUE; + ByteString aDigits("0123456789abcdefghijklmnopqrstuvwxyz+-<=>"); + for ( USHORT i=0 ; i < aID.Len() ;i++ ) + { + if ( aDigits.Search( aID.GetChar(i) ) == STRING_NOTFOUND ) + bIsKeyID = FALSE; + } + } + } + else + { + if ( aID.Len() > 0 && aID.GetChar(aID.Len()-1) == '*' ) + aID.Erase( aID.Len()-1 ); + + if ( aID.IsNumericAscii() && aID.Len() >= 5 ) + bIsKeyID = TRUE; + } + + if ( bIsKeyID ) + { + aErrorMsg = ByteString( "String contains KeyID" ); + if ( bFixTags ) + { + aFixed += aTestee.Copy( nAfterID ); + bHasBeenFixed = TRUE; + aErrorMsg = ByteString( "FIXED String containing KeyID" ); + } + else + aErrorMsg = ByteString( "String contains KeyID" ); + return FALSE; + } + } + + return TRUE; +} + +/*****************************************************************************/ +BOOL GSIBlock::TestUTF8( GSILine* pTestee, BOOL bFixTags ) +/*****************************************************************************/ +{ + USHORT nErrorPos = 0; + ByteString aErrorMsg; + BOOL bError = FALSE; + ByteString aFixed; + BOOL bHasBeenFixed = FALSE; + if ( !IsUTF8( pTestee->GetText(), bFixTags, nErrorPos, aErrorMsg, bHasBeenFixed, aFixed ) ) + { + ByteString aContext( pTestee->GetText().Copy( nErrorPos, 20 ) ); + PrintError( aErrorMsg.Append(" in Text at Position " ).Append( ByteString::CreateFromInt32( nErrorPos ) ), "Text format", aContext, pTestee->GetLineNumber(), pTestee->GetUniqId() ); + bError = TRUE; + if ( bHasBeenFixed ) + { + pTestee->SetText( aFixed ); + pTestee->SetFixed(); + } + } + if ( !IsUTF8( pTestee->GetQuickHelpText(), bFixTags, nErrorPos, aErrorMsg, bHasBeenFixed, aFixed ) ) + { + ByteString aContext( pTestee->GetQuickHelpText().Copy( nErrorPos, 20 ) ); + PrintError( aErrorMsg.Append(" in QuickHelpText at Position " ).Append( ByteString::CreateFromInt32( nErrorPos ) ), "Text format", aContext, pTestee->GetLineNumber(), pTestee->GetUniqId() ); + bError = TRUE; + if ( bHasBeenFixed ) + { + pTestee->SetQuickHelpText( aFixed ); + pTestee->SetFixed(); + } + } + if ( !IsUTF8( pTestee->GetTitle(), bFixTags, nErrorPos, aErrorMsg, bHasBeenFixed, aFixed ) ) + { + ByteString aContext( pTestee->GetTitle().Copy( nErrorPos, 20 ) ); + PrintError( aErrorMsg.Append(" in Title at Position " ).Append( ByteString::CreateFromInt32( nErrorPos ) ), "Text format", aContext, pTestee->GetLineNumber(), pTestee->GetUniqId() ); + bError = TRUE; + if ( bHasBeenFixed ) + { + pTestee->SetTitle( aFixed ); + pTestee->SetFixed(); + } + } + if ( bError ) + pTestee->NotOK(); + return !bError; +} + + +/*****************************************************************************/ +BOOL GSIBlock::HasSuspiciousChars( GSILine* pTestee, GSILine* pSource ) +/*****************************************************************************/ +{ + USHORT nPos = 0; + if ( !bAllowSuspicious && ( nPos = pTestee->GetText().Search("??")) != STRING_NOTFOUND ) + if ( pSource->GetText().Search("??") == STRING_NOTFOUND ) + { + String aUTF8Tester = String( pTestee->GetText(), 0, nPos, RTL_TEXTENCODING_UTF8 ); + USHORT nErrorPos = aUTF8Tester.Len(); + ByteString aContext( pTestee->GetText().Copy( nPos, 20 ) ); + PrintError( ByteString("Found double questionmark in translation only. Looks like an encoding problem at Position " ).Append( ByteString::CreateFromInt32( nErrorPos ) ), "Text format", aContext, pTestee->GetLineNumber(), pTestee->GetUniqId() ); + pTestee->NotOK(); + return TRUE; + } + + return FALSE; +} + + +/*****************************************************************************/ +BOOL GSIBlock::CheckSyntax( ULONG nLine, BOOL bRequireSourceLine, BOOL bFixTags ) +/*****************************************************************************/ +{ + static LingTest aTester; + BOOL bHasError = FALSE; + + if ( !pSourceLine ) + { + if ( bRequireSourceLine ) + { + PrintError( "No source language entry defined!", "File format", "", nLine ); + bHasBlockError = TRUE; + } + } + else + { + aTester.CheckReference( pSourceLine ); + if ( pSourceLine->HasMessages() ) + { + PrintList( pSourceLine->GetMessageList(), "ReferenceString", pSourceLine ); + pSourceLine->NotOK(); + bHasError = TRUE; + } + } + if ( bReference ) + { + if ( !pReferenceLine ) + { + GSILine *pSource; + if ( pSourceLine ) + pSource = pSourceLine; + else + pSource = GetObject( 0 ); // get some other line + if ( pSource ) + PrintError( "No reference line found. Entry is new in source file", "File format", "", pSource->GetLineNumber(), pSource->GetUniqId() ); + else + PrintError( "No reference line found. Entry is new in source file", "File format", "", nLine ); + bHasBlockError = TRUE; + } + else + { + if ( pSourceLine && !pSourceLine->Equals( *pReferenceLine ) ) + { + xub_StrLen nPos = pSourceLine->Match( *pReferenceLine ); + ByteString aContext( pReferenceLine->Copy( nPos - 5, 15) ); + aContext.Append( "\" --> \"" ).Append( pSourceLine->Copy( nPos - 5, 15) ); + PrintError( "Source Language Entry has changed.", "File format", aContext, pSourceLine->GetLineNumber(), pSourceLine->GetUniqId() ); + pSourceLine->NotOK(); + bHasError = TRUE; + } + } + } + + if ( pSourceLine ) + bHasError |= !TestUTF8( pSourceLine, bFixTags ); + + ULONG i; + for ( i = 0; i < Count(); i++ ) + { + aTester.CheckTestee( GetObject( i ), pSourceLine != NULL, bFixTags ); + if ( GetObject( i )->HasMessages() || aTester.HasCompareWarnings() ) + { + if ( GetObject( i )->HasMessages() || aTester.GetCompareWarnings().HasErrors() ) + GetObject( i )->NotOK(); + bHasError = TRUE; + PrintList( GetObject( i )->GetMessageList(), "Translation", GetObject( i ) ); + PrintList( &(aTester.GetCompareWarnings()), "Translation Tag Missmatch", GetObject( i ) ); + } + bHasError |= !TestUTF8( GetObject( i ), bFixTags ); + if ( pSourceLine ) + bHasError |= HasSuspiciousChars( GetObject( i ), pSourceLine ); + } + + return bHasError || bHasBlockError; +} + +void GSIBlock::WriteError( LazySvFileStream &aErrOut, BOOL bRequireSourceLine ) +{ + if ( pSourceLine && pSourceLine->IsOK() && bCheckSourceLang && !bHasBlockError ) + return; + + BOOL bHasError = FALSE; + BOOL bCopyAll = ( !pSourceLine && bRequireSourceLine ) || ( pSourceLine && !pSourceLine->IsOK() && !bCheckTranslationLang ) || bHasBlockError; + ULONG i; + for ( i = 0; i < Count(); i++ ) + { + if ( !GetObject( i )->IsOK() || bCopyAll ) + { + bHasError = TRUE; + aErrOut.LazyOpen(); + aErrOut.WriteLine( *GetObject( i ) ); + } + } + + if ( pSourceLine && ( bHasError || !pSourceLine->IsOK() ) && !( !bHasError && bCheckTranslationLang ) ) + { + aErrOut.LazyOpen(); + aErrOut.WriteLine( *pSourceLine ); + } +} + +void GSIBlock::WriteCorrect( LazySvFileStream &aOkOut, BOOL bRequireSourceLine ) +{ + if ( ( !pSourceLine && bRequireSourceLine ) || ( pSourceLine && !pSourceLine->IsOK() && !bCheckTranslationLang ) ) + return; + + BOOL bHasOK = FALSE; + ULONG i; + for ( i = 0; i < Count(); i++ ) + { + if ( ( GetObject( i )->IsOK() || bCheckSourceLang ) && !bHasBlockError ) + { + bHasOK = TRUE; + aOkOut.LazyOpen(); + aOkOut.WriteLine( *GetObject( i ) ); + } + } + + if ( ( pSourceLine && pSourceLine->IsOK() && ( Count() || !bCheckTranslationLang ) ) || ( bHasOK && bCheckTranslationLang ) ) + { + aOkOut.LazyOpen(); + aOkOut.WriteLine( *pSourceLine ); + } +} + +void GSIBlock::WriteFixed( LazySvFileStream &aFixOut, BOOL /*bRequireSourceLine*/ ) +{ + if ( pSourceLine && !pSourceLine->IsFixed() && bCheckSourceLang ) + return; + + BOOL bHasFixes = FALSE; + ULONG i; + for ( i = 0; i < Count(); i++ ) + { + if ( GetObject( i )->IsFixed() ) + { + bHasFixes = TRUE; + aFixOut.LazyOpen(); + aFixOut.WriteLine( *GetObject( i ) ); + } + } + + if ( pSourceLine && ( bHasFixes || pSourceLine->IsFixed() ) ) + { + aFixOut.LazyOpen(); + aFixOut.WriteLine( *pSourceLine ); + } +} + + +/*****************************************************************************/ +/*****************************************************************************/ +/*****************************************************************************/ +/*****************************************************************************/ +/*****************************************************************************/ +/*****************************************************************************/ +/*****************************************************************************/ + +/*****************************************************************************/ +void Help() +/*****************************************************************************/ +{ + fprintf( stdout, "\n" ); + fprintf( stdout, "gsicheck Version 1.9.0 (c)1999 - 2006 by SUN Microsystems\n" ); + fprintf( stdout, "=========================================================\n" ); + fprintf( stdout, "\n" ); + fprintf( stdout, "gsicheck checks the syntax of tags in GSI-Files and SDF-Files\n" ); + fprintf( stdout, " checks for inconsistencies and malicious UTF8 encoding\n" ); + fprintf( stdout, " checks tags in Online Help\n" ); + fprintf( stdout, " checks for *new* KeyIDs and relax GID/LID length to %s\n", ByteString::CreateFromInt32(MAX_GID_LID_LEN).GetBuffer() ); + fprintf( stdout, "\n" ); + fprintf( stdout, "Syntax: gsicheck [ -c ] [-f] [ -we ] [ -wef ErrorFilename ] [ -wc ]\n" ); + fprintf( stdout, " [ -wcf CorrectFilename ] [ -s | -t ] [ -l LanguageID ]\n" ); + fprintf( stdout, " [ -r ReferenceFile ] filename\n" ); + fprintf( stdout, "\n" ); + fprintf( stdout, "-c Add context to error message (Print the line containing the error)\n" ); + fprintf( stdout, "-f try to fix errors. See also -wf -wff \n" ); + fprintf( stdout, "-wf Write File containing all fixed parts\n" ); + fprintf( stdout, "-wff Same as above but give own filename\n" ); + fprintf( stdout, "-we Write File containing all errors\n" ); + fprintf( stdout, "-wef Same as above but give own filename\n" ); + fprintf( stdout, "-wc Write File containing all correct parts\n" ); + fprintf( stdout, "-wcf Same as above but give own filename\n" ); + fprintf( stdout, "-s Check only source language. Should be used before handing out to vendor.\n" ); + fprintf( stdout, "-t Check only Translation language(s). Should be used before merging.\n" ); + fprintf( stdout, "-k Allow KeyIDs to be present in strings\n" ); + fprintf( stdout, "-e disable encoding checks. E.g.: double questionmark \'??\' which may be the\n" ); + fprintf( stdout, " result of false conversions\n" ); + fprintf( stdout, "-l ISO Languagecode or numerical 2 digits Identifier of the source language.\n" ); + fprintf( stdout, " Default is en-US. Use \"\" (empty string) or 'none'\n" ); + fprintf( stdout, " to disable source language dependent checks\n" ); + fprintf( stdout, "-r Reference filename to check that source language entries\n" ); + fprintf( stdout, " have not been changed\n" ); + fprintf( stdout, "\n" ); +} + +/*****************************************************************************/ +#if defined(UNX) || defined(OS2) +int main( int argc, char *argv[] ) +#else +int _cdecl main( int argc, char *argv[] ) +#endif +/*****************************************************************************/ +{ + + BOOL bError = FALSE; + BOOL bPrintContext = FALSE; + BOOL bCheckSourceLang = FALSE; + BOOL bCheckTranslationLang = FALSE; + BOOL bWriteError = FALSE; + BOOL bWriteCorrect = FALSE; + BOOL bWriteFixed = FALSE; + BOOL bFixTags = FALSE; + BOOL bAllowKID = FALSE; + BOOL bAllowSuspicious = FALSE; + String aErrorFilename; + String aCorrectFilename; + String aFixedFilename; + BOOL bFileHasError = FALSE; + ByteString aSourceLang( "en-US" ); // English is default + ByteString aFilename; + ByteString aReferenceFilename; + BOOL bReferenceFile = FALSE; + for ( USHORT i = 1 ; i < argc ; i++ ) + { + if ( *argv[ i ] == '-' ) + { + switch (*(argv[ i ]+1)) + { + case 'c':bPrintContext = TRUE; + break; + case 'w': + { + if ( (*(argv[ i ]+2)) == 'e' ) + { + if ( (*(argv[ i ]+3)) == 'f' ) + if ( (i+1) < argc ) + { + aErrorFilename = String( argv[ i+1 ], RTL_TEXTENCODING_ASCII_US ); + bWriteError = TRUE; + i++; + } + else + { + fprintf( stderr, "\nERROR: Switch %s requires parameter!\n\n", argv[ i ] ); + bError = TRUE; + } + else + bWriteError = TRUE; + } + else if ( (*(argv[ i ]+2)) == 'c' ) + if ( (*(argv[ i ]+3)) == 'f' ) + if ( (i+1) < argc ) + { + aCorrectFilename = String( argv[ i+1 ], RTL_TEXTENCODING_ASCII_US ); + bWriteCorrect = TRUE; + i++; + } + else + { + fprintf( stderr, "\nERROR: Switch %s requires parameter!\n\n", argv[ i ] ); + bError = TRUE; + } + else + bWriteCorrect = TRUE; + else if ( (*(argv[ i ]+2)) == 'f' ) + if ( (*(argv[ i ]+3)) == 'f' ) + if ( (i+1) < argc ) + { + aFixedFilename = String( argv[ i+1 ], RTL_TEXTENCODING_ASCII_US ); + bWriteFixed = TRUE; + bFixTags = TRUE; + i++; + } + else + { + fprintf( stderr, "\nERROR: Switch %s requires parameter!\n\n", argv[ i ] ); + bError = TRUE; + } + else + { + bWriteFixed = TRUE; + bFixTags = TRUE; + } + else + { + fprintf( stderr, "\nERROR: Unknown Switch %s!\n\n", argv[ i ] ); + bError = TRUE; + } + } + break; + case 's':bCheckSourceLang = TRUE; + break; + case 't':bCheckTranslationLang = TRUE; + break; + case 'l': + { + if ( (i+1) < argc ) + { + aSourceLang = ByteString( argv[ i+1 ] ); + if ( aSourceLang.EqualsIgnoreCaseAscii( "none" ) ) + aSourceLang.Erase(); + i++; + } + else + { + fprintf( stderr, "\nERROR: Switch %s requires parameter!\n\n", argv[ i ] ); + bError = TRUE; + } + } + break; + case 'r': + { + if ( (i+1) < argc ) + { + aReferenceFilename = argv[ i+1 ]; + bReferenceFile = TRUE; + i++; + } + else + { + fprintf( stderr, "\nERROR: Switch %s requires parameter!\n\n", argv[ i ] ); + bError = TRUE; + } + } + break; + case 'f': + { + bFixTags = TRUE; + } + break; + case 'k': + { + bAllowKID = TRUE; + } + break; + case 'e': + { + bAllowSuspicious = TRUE; + } + break; + default: + fprintf( stderr, "\nERROR: Unknown Switch %s!\n\n", argv[ i ] ); + bError = TRUE; + } + } + else + { + if ( !aFilename.Len()) + aFilename = ByteString( argv[ i ] ); + else + { + fprintf( stderr, "\nERROR: Only one filename may be specified!\n\n"); + bError = TRUE; + } + } + } + + + if ( !aFilename.Len() || bError ) + { + Help(); + exit ( 0 ); + } + + if ( aSourceLang.Len() && !LanguageOK( aSourceLang ) ) + { + fprintf( stderr, "\nERROR: The Language '%s' is invalid!\n\n", aSourceLang.GetBuffer() ); + Help(); + exit ( 1 ); + } + + if ( bCheckSourceLang && bCheckTranslationLang ) + { + fprintf( stderr, "\nERROR: The Options -s and -t are mutually exclusive.\nUse only one of them.\n\n" ); + Help(); + exit ( 1 ); + } + + + + DirEntry aSource = DirEntry( String( aFilename, RTL_TEXTENCODING_ASCII_US )); + if ( !aSource.Exists()) { + fprintf( stderr, "\nERROR: GSI-File %s not found!\n\n", aFilename.GetBuffer() ); + exit ( 2 ); + } + + SvFileStream aGSI( String( aFilename, RTL_TEXTENCODING_ASCII_US ), STREAM_STD_READ ); + if ( !aGSI.IsOpen()) { + fprintf( stderr, "\nERROR: Could not open GSI-File %s!\n\n", aFilename.GetBuffer() ); + exit ( 3 ); + } + + SvFileStream aReferenceGSI; + if ( bReferenceFile ) + { + DirEntry aReferenceSource = DirEntry( String( aReferenceFilename, RTL_TEXTENCODING_ASCII_US )); + if ( !aReferenceSource.Exists()) { + fprintf( stderr, "\nERROR: GSI-File %s not found!\n\n", aFilename.GetBuffer() ); + exit ( 2 ); + } + + aReferenceGSI.Open( String( aReferenceFilename, RTL_TEXTENCODING_ASCII_US ), STREAM_STD_READ ); + if ( !aReferenceGSI.IsOpen()) { + fprintf( stderr, "\nERROR: Could not open Input-File %s!\n\n", aFilename.GetBuffer() ); + exit ( 3 ); + } + } + + LazySvFileStream aOkOut; + String aBaseName = aSource.GetBase(); + if ( bWriteCorrect ) + { + if ( !aCorrectFilename.Len() ) + { + String sTmpBase( aBaseName ); + sTmpBase += String( "_ok", RTL_TEXTENCODING_ASCII_US ); + aSource.SetBase( sTmpBase ); + aCorrectFilename = aSource.GetFull(); + } + aOkOut.SetOpenParams( aCorrectFilename , STREAM_STD_WRITE | STREAM_TRUNC ); + } + + LazySvFileStream aErrOut; + if ( bWriteError ) + { + if ( !aErrorFilename.Len() ) + { + String sTmpBase( aBaseName ); + sTmpBase += String( "_err", RTL_TEXTENCODING_ASCII_US ); + aSource.SetBase( sTmpBase ); + aErrorFilename = aSource.GetFull(); + } + aErrOut.SetOpenParams( aErrorFilename , STREAM_STD_WRITE | STREAM_TRUNC ); + } + + LazySvFileStream aFixOut; + if ( bWriteFixed ) + { + if ( !aFixedFilename.Len() ) + { + String sTmpBase( aBaseName ); + sTmpBase += String( "_fix", RTL_TEXTENCODING_ASCII_US ); + aSource.SetBase( sTmpBase ); + aFixedFilename = aSource.GetFull(); + } + aFixOut.SetOpenParams( aFixedFilename , STREAM_STD_WRITE | STREAM_TRUNC ); + } + + + ByteString sReferenceLine; + GSILine* pReferenceLine = NULL; + ByteString aOldReferenceId("No Valid ID"); // just set to something which can never be an ID + ULONG nReferenceLine = 0; + + ByteString sGSILine; + GSILine* pGSILine = NULL; + ByteString aOldId("No Valid ID"); // just set to something which can never be an ID + GSIBlock *pBlock = NULL; + ULONG nLine = 0; + + while ( !aGSI.IsEof() ) + { + aGSI.ReadLine( sGSILine ); + nLine++; + pGSILine = new GSILine( sGSILine, nLine ); + BOOL bDelete = TRUE; + + + if ( pGSILine->Len() ) + { + if ( FORMAT_UNKNOWN == pGSILine->GetLineFormat() ) + { + PrintError( "Format of line is unknown. Ignoring!", "Line format", pGSILine->Copy( 0,40 ), bPrintContext, pGSILine->GetLineNumber() ); + pGSILine->NotOK(); + if ( bWriteError ) + { + bFileHasError = TRUE; + aErrOut.LazyOpen(); + aErrOut.WriteLine( *pGSILine ); + } + } + else if ( pGSILine->GetLineType().EqualsIgnoreCaseAscii("res-comment") ) + { // ignore comment lines, but write them to Correct Items File + if ( bWriteCorrect ) + { + aOkOut.LazyOpen(); + aOkOut.WriteLine( *pGSILine ); + } + } + else + { + ByteString aId = pGSILine->GetUniqId(); + if ( aId != aOldId ) + { + if ( pBlock ) + { + bFileHasError |= pBlock->CheckSyntax( nLine, aSourceLang.Len() != 0, bFixTags ); + + if ( bWriteError ) + pBlock->WriteError( aErrOut, aSourceLang.Len() != 0 ); + if ( bWriteCorrect ) + pBlock->WriteCorrect( aOkOut, aSourceLang.Len() != 0 ); + if ( bWriteFixed ) + pBlock->WriteFixed( aFixOut, aSourceLang.Len() != 0 ); + + delete pBlock; + } + pBlock = new GSIBlock( bPrintContext, bCheckSourceLang, bCheckTranslationLang, bReferenceFile, bAllowKID, bAllowSuspicious ); + + aOldId = aId; + + + // find corresponding line in reference file + if ( bReferenceFile ) + { + BOOL bContinueSearching = TRUE; + while ( ( !aReferenceGSI.IsEof() || pReferenceLine ) && bContinueSearching ) + { + if ( !pReferenceLine ) + { + aReferenceGSI.ReadLine( sReferenceLine ); + nReferenceLine++; + pReferenceLine = new GSILine( sReferenceLine, nReferenceLine ); + } + if ( pReferenceLine->GetLineFormat() != FORMAT_UNKNOWN ) + { + if ( pReferenceLine->GetUniqId() == aId && pReferenceLine->GetLanguageId().Equals( aSourceLang ) ) + { + pBlock->SetReferenceLine( pReferenceLine ); + pReferenceLine = NULL; + } + else if ( pReferenceLine->GetUniqId() > aId ) + { +// if ( pGSILine->GetLanguageId() == aSourceLang ) +// PrintError( "No reference line found. Entry is new in source file", "File format", "", bPrintContext, pGSILine->GetLineNumber(), aId ); + bContinueSearching = FALSE; + } + else + { + if ( pReferenceLine->GetUniqId() < aId && pReferenceLine->GetLanguageId().Equals( aSourceLang ) ) + PrintError( "No Entry in source file found. Entry has been removed from source file", "File format", "", bPrintContext, pGSILine->GetLineNumber(), pReferenceLine->GetUniqId() ); + delete pReferenceLine; + pReferenceLine = NULL; + } + } + else + { + delete pReferenceLine; + pReferenceLine = NULL; + } + + } + } + + } + + pBlock->InsertLine( pGSILine, aSourceLang ); + bDelete = FALSE; + } + } + if ( bDelete ) + delete pGSILine; + + } + if ( pBlock ) + { + bFileHasError |= pBlock->CheckSyntax( nLine, aSourceLang.Len() != 0, bFixTags ); + + if ( bWriteError ) + pBlock->WriteError( aErrOut, aSourceLang.Len() != 0 ); + if ( bWriteCorrect ) + pBlock->WriteCorrect( aOkOut, aSourceLang.Len() != 0 ); + if ( bWriteFixed ) + pBlock->WriteFixed( aFixOut, aSourceLang.Len() != 0 ); + + delete pBlock; + } + aGSI.Close(); + + if ( bWriteError ) + aErrOut.Close(); + if ( bWriteCorrect ) + aOkOut.Close(); + if ( bWriteFixed ) + aFixOut.Close(); + + if ( bFileHasError ) + return 55; + else + return 0; +} diff --git a/l10ntools/source/gsiconv.cxx b/l10ntools/source/gsiconv.cxx new file mode 100644 index 000000000000..e127e55482da --- /dev/null +++ b/l10ntools/source/gsiconv.cxx @@ -0,0 +1,372 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: gsiconv.cxx,v $ + * $Revision: 1.8 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_l10ntools.hxx" +#include +#include +#include + +// local includes +#include "utf8conv.hxx" + +#define GSI_FILE_UNKNOWN 0x0000 +#define GSI_FILE_OLDSTYLE 0x0001 +#define GSI_FILE_L10NFRAMEWORK 0x0002 + +/*****************************************************************************/ +USHORT GetGSIFileType( SvStream &rStream ) +/*****************************************************************************/ +{ + USHORT nFileType = GSI_FILE_UNKNOWN; + + ULONG nPos( rStream.Tell()); + rStream.Seek( STREAM_SEEK_TO_BEGIN ); + + ByteString sLine; + while( !rStream.IsEof() && !sLine.Len()) + rStream.ReadLine( sLine ); + + if( sLine.Len()) { + if( sLine.Search( "($$)" ) != STRING_NOTFOUND ) + nFileType = GSI_FILE_OLDSTYLE; + else + nFileType = GSI_FILE_L10NFRAMEWORK; + } + + rStream.Seek( nPos ); + + return nFileType; +} + +/*****************************************************************************/ +ByteString GetGSILineId( const ByteString &rLine, USHORT nFileType ) +/*****************************************************************************/ +{ + ByteString sId; + switch ( nFileType ) { + case GSI_FILE_OLDSTYLE: + sId = rLine; + sId.SearchAndReplaceAll( "($$)", "\t" ); + sId = sId.GetToken( 0, '\t' ); + break; + + case GSI_FILE_L10NFRAMEWORK: + sId = rLine.GetToken( 0, '\t' ); + sId += "\t"; + sId += rLine.GetToken( 1, '\t' ); + sId += "\t"; + sId += rLine.GetToken( 4, '\t' ); + sId += "\t"; + sId += rLine.GetToken( 5, '\t' ); + break; + } + return sId; +} + +/*****************************************************************************/ +ByteString GetGSILineLangId( const ByteString &rLine, USHORT nFileType ) +/*****************************************************************************/ +{ + ByteString sLangId; + switch ( nFileType ) { + case GSI_FILE_OLDSTYLE: + sLangId = rLine; + sLangId.SearchAndReplaceAll( "($$)", "\t" ); + sLangId = sLangId.GetToken( 2, '\t' ); + break; + + case GSI_FILE_L10NFRAMEWORK: + sLangId = rLine.GetToken( 9, '\t' ); + break; + } + return sLangId; +} + +/*****************************************************************************/ +void ConvertGSILine( BOOL bToUTF8, ByteString &rLine, + rtl_TextEncoding nEncoding, USHORT nFileType ) +/*****************************************************************************/ +{ + switch ( nFileType ) { + case GSI_FILE_OLDSTYLE: + if ( bToUTF8 ) + rLine = UTF8Converter::ConvertToUTF8( rLine, nEncoding ); + else + rLine = UTF8Converter::ConvertFromUTF8( rLine, nEncoding ); + break; + + case GSI_FILE_L10NFRAMEWORK: { + ByteString sConverted; + for ( USHORT i = 0; i < rLine.GetTokenCount( '\t' ); i++ ) { + ByteString sToken = rLine.GetToken( i, '\t' ); + if (( i > 9 ) && ( i < 14 )) { + if( bToUTF8 ) + sToken = UTF8Converter::ConvertToUTF8( sToken, nEncoding ); + else + sToken = UTF8Converter::ConvertFromUTF8( sToken, nEncoding ); + } + if ( i ) + sConverted += "\t"; + sConverted += sToken; + } + rLine = sConverted; + } + break; + } +} + +/*****************************************************************************/ +void Help() +/*****************************************************************************/ +{ + fprintf( stdout, "\n" ); + fprintf( stdout, "gsiconv (c)1999 by StarOffice Entwicklungs GmbH\n" ); + fprintf( stdout, "===============================================\n" ); + fprintf( stdout, "\n" ); + fprintf( stdout, "gsiconv converts strings in GSI-Files (Gutschmitt Interface) from or to UTF-8\n" ); + fprintf( stdout, "\n" ); + fprintf( stdout, "Syntax: gsiconv (-t|-f langid charset)|(-p n) filename\n" ); + fprintf( stdout, "Switches: -t => conversion from charset to UTF-8\n" ); + fprintf( stdout, " -f => conversion from UTF-8 to charset\n" ); + fprintf( stdout, " -p n => creates several files with ca. n lines\n" ); + fprintf( stdout, "\n" ); + fprintf( stdout, "Allowed charsets:\n" ); + fprintf( stdout, " MS_932 => Japanese\n" ); + fprintf( stdout, " MS_936 => Chinese Simplified\n" ); + fprintf( stdout, " MS_949 => Korean\n" ); + fprintf( stdout, " MS_950 => Chinese Traditional\n" ); + fprintf( stdout, " MS_1250 => East Europe\n" ); + fprintf( stdout, " MS_1251 => Cyrillic\n" ); + fprintf( stdout, " MS_1252 => West Europe\n" ); + fprintf( stdout, " MS_1253 => Greek\n" ); + fprintf( stdout, " MS_1254 => Turkish\n" ); + fprintf( stdout, " MS_1255 => Hebrew\n" ); + fprintf( stdout, " MS_1256 => Arabic\n" ); + fprintf( stdout, "\n" ); + fprintf( stdout, "Allowed langids:\n" ); + fprintf( stdout, " 1 => ENGLISH_US\n" ); + fprintf( stdout, " 3 => PORTUGUESE \n" ); + fprintf( stdout, " 4 => GERMAN_DE (new german style)\n" ); + fprintf( stdout, " 7 => RUSSIAN\n" ); + fprintf( stdout, " 30 => GREEK\n" ); + fprintf( stdout, " 31 => DUTCH\n" ); + fprintf( stdout, " 33 => FRENCH\n" ); + fprintf( stdout, " 34 => SPANISH\n" ); + fprintf( stdout, " 35 => FINNISH\n" ); + fprintf( stdout, " 36 => HUNGARIAN\n" ); + fprintf( stdout, " 39 => ITALIAN\n" ); + fprintf( stdout, " 42 => CZECH\n" ); + fprintf( stdout, " 44 => ENGLISH (UK)\n" ); + fprintf( stdout, " 45 => DANISH\n" ); + fprintf( stdout, " 46 => SWEDISH\n" ); + fprintf( stdout, " 47 => NORWEGIAN\n" ); + fprintf( stdout, " 49 => GERMAN (old german style)\n" ); + fprintf( stdout, " 55 => PORTUGUESE_BRAZILIAN\n" ); + fprintf( stdout, " 81 => JAPANESE\n" ); + fprintf( stdout, " 82 => KOREAN\n" ); + fprintf( stdout, " 86 => CHINESE_SIMPLIFIED\n" ); + fprintf( stdout, " 88 => CHINESE_TRADITIONAL\n" ); + fprintf( stdout, " 90 => TURKISH\n" ); + fprintf( stdout, " 96 => ARABIC\n" ); + fprintf( stdout, " 97 => HEBREW\n" ); + fprintf( stdout, "\n" ); +} + +/*****************************************************************************/ +#if defined(UNX) || defined(OS2) +int main( int argc, char *argv[] ) +#else +int _cdecl main( int argc, char *argv[] ) +#endif +/*****************************************************************************/ +{ + if (( argc != 5 ) && ( argc != 4 )) { + Help(); + exit ( 0 ); + } + + if ( argc == 4 ) { + if ( ByteString( argv[ 1 ] ) == "-p" ) { + + DirEntry aSource = DirEntry( String( argv[ 3 ], RTL_TEXTENCODING_ASCII_US )); + if ( !aSource.Exists()) { + fprintf( stderr, "\nERROR: GSI-File %s not found!\n\n", ByteString( argv[ 3 ] ).GetBuffer()); + exit ( 2 ); + } + + DirEntry aOutput( aSource ); + + String sBase = aOutput.GetBase(); + String sExt = aOutput.GetExtension(); + + String sGSI( argv[ 3 ], RTL_TEXTENCODING_ASCII_US ); + SvFileStream aGSI( sGSI, STREAM_STD_READ ); + if ( !aGSI.IsOpen()) { + fprintf( stderr, "\nERROR: Could not open GSI-File %s!\n\n", ByteString( argv[ 3 ] ).GetBuffer()); + exit ( 3 ); + } + + USHORT nFileType( GetGSIFileType( aGSI )); + + ULONG nMaxLines = (ULONG) ByteString( argv[ 2 ] ).ToInt64(); + if ( !nMaxLines ) { + fprintf( stderr, "\nERROR: Linecount must be at least 1!\n\n" ); + exit ( 3 ); + } + + ByteString sGSILine; + ByteString sOldId; + ULONG nLine = 0; + ULONG nOutputFile = 1; + + String sOutput( sBase ); + sOutput += String( "_", RTL_TEXTENCODING_ASCII_US ); + sOutput += String::CreateFromInt64( nOutputFile ); + if ( sExt.Len()) { + sOutput += String( ".", RTL_TEXTENCODING_ASCII_US ); + sOutput += sExt; + } + nOutputFile ++; + + aOutput.SetName( sOutput ); + SvFileStream aOutputStream( aOutput.GetFull(), STREAM_STD_WRITE | STREAM_TRUNC ); + + while ( !aGSI.IsEof()) { + + aGSI.ReadLine( sGSILine ); + ByteString sId( GetGSILineId( sGSILine, nFileType )); + + nLine++; + + if (( nLine >= nMaxLines ) && ( sId != sOldId )) { + aOutputStream.Close(); + + ByteString sText( aOutput.GetFull(), gsl_getSystemTextEncoding()); + sText += " with "; + sText += ByteString::CreateFromInt64( nLine ); + sText += " lines written."; + + fprintf( stdout, "%s\n", sText.GetBuffer()); + String sOutput1( sBase ); + sOutput1 += String( "_", RTL_TEXTENCODING_ASCII_US ); + sOutput1 += String::CreateFromInt64( nOutputFile ); + if ( sExt.Len()) { + sOutput1 += String( ".", RTL_TEXTENCODING_ASCII_US ); + sOutput1 += sExt; + } + nOutputFile ++; + + aOutput.SetName( sOutput1 ); + + aOutputStream.Open( aOutput.GetFull(), STREAM_STD_WRITE | STREAM_TRUNC ); + nLine = 0; + } + + aOutputStream.WriteLine( sGSILine ); + + sOldId = sId; + } + + aGSI.Close(); + aOutputStream.Close(); + + ByteString sText( aOutput.GetFull(), RTL_TEXTENCODING_ASCII_US ); + sText += " with "; + sText += ByteString::CreateFromInt64( nLine ); + sText += " lines written."; + } + else { + Help(); + exit( 1 ); + } + } + else { + if ( ByteString( argv[ 1 ] ) == "-t" || ByteString( argv[ 1 ] ) == "-f" ) { + rtl_TextEncoding nEncoding; + + ByteString sCurLangId( argv[ 2 ] ); + + ByteString sCharset( argv[ 3 ] ); + sCharset.ToUpperAscii(); + + if ( sCharset == "MS_932" ) nEncoding = RTL_TEXTENCODING_MS_932; + else if ( sCharset == "MS_936" ) nEncoding = RTL_TEXTENCODING_MS_936; + else if ( sCharset == "MS_949" ) nEncoding = RTL_TEXTENCODING_MS_949; + else if ( sCharset == "MS_950" ) nEncoding = RTL_TEXTENCODING_MS_950; + else if ( sCharset == "MS_1250" ) nEncoding = RTL_TEXTENCODING_MS_1250; + else if ( sCharset == "MS_1251" ) nEncoding = RTL_TEXTENCODING_MS_1251; + else if ( sCharset == "MS_1252" ) nEncoding = RTL_TEXTENCODING_MS_1252; + else if ( sCharset == "MS_1253" ) nEncoding = RTL_TEXTENCODING_MS_1253; + else if ( sCharset == "MS_1254" ) nEncoding = RTL_TEXTENCODING_MS_1254; + else if ( sCharset == "MS_1255" ) nEncoding = RTL_TEXTENCODING_MS_1255; + else if ( sCharset == "MS_1256" ) nEncoding = RTL_TEXTENCODING_MS_1256; + else if ( sCharset == "MS_1257" ) nEncoding = RTL_TEXTENCODING_MS_1257; + else if ( sCharset == "UTF8" ) nEncoding = RTL_TEXTENCODING_UTF8; + + else { + Help(); + exit ( 1 ); + } + + DirEntry aSource = DirEntry( String( argv[ 4 ], RTL_TEXTENCODING_ASCII_US )); + if ( !aSource.Exists()) { + fprintf( stderr, "\nERROR: GSI-File %s not found!\n\n", ByteString( argv[ 3 ] ).GetBuffer()); + exit ( 2 ); + } + + String sGSI( argv[ 4 ], RTL_TEXTENCODING_ASCII_US ); + SvFileStream aGSI( sGSI, STREAM_STD_READ ); + if ( !aGSI.IsOpen()) { + fprintf( stderr, "\nERROR: Could not open GSI-File %s!\n\n", ByteString( argv[ 3 ] ).GetBuffer()); + exit ( 3 ); + } + USHORT nFileType( GetGSIFileType( aGSI )); + + ByteString sGSILine; + while ( !aGSI.IsEof()) { + + aGSI.ReadLine( sGSILine ); + ByteString sLangId( GetGSILineLangId( sGSILine, nFileType )); + if ( sLangId == sCurLangId ) + ConvertGSILine(( ByteString( argv[ 1 ] ) == "-t" ), sGSILine, nEncoding, nFileType ); + + fprintf( stdout, "%s\n", sGSILine.GetBuffer()); + } + + aGSI.Close(); + } + else { + Help(); + exit( 1 ); + } + } + return 0; +} diff --git a/l10ntools/source/help/HelpCompiler.cxx b/l10ntools/source/help/HelpCompiler.cxx new file mode 100644 index 000000000000..5001d0907972 --- /dev/null +++ b/l10ntools/source/help/HelpCompiler.cxx @@ -0,0 +1,593 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: HelpCompiler.cxx,v $ + * $Revision: 1.9 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + + +#include "HelpCompiler.hxx" +#include +#include +#include +#include +#include +#include +#include +#ifdef __MINGW32__ +#include +#include +#endif +#include + +static void impl_sleep( sal_uInt32 nSec ) +{ + TimeValue aTime; + aTime.Seconds = nSec; + aTime.Nanosec = 0; + + osl::Thread::wait( aTime ); +} + +HelpCompiler::HelpCompiler(StreamTable &in_streamTable, const fs::path &in_inputFile, + const fs::path &in_src, const fs::path &in_resEmbStylesheet, + const std::string &in_module, const std::string &in_lang, bool in_bExtensionMode) + : streamTable(in_streamTable), inputFile(in_inputFile), + src(in_src), module(in_module), lang(in_lang), resEmbStylesheet(in_resEmbStylesheet), + bExtensionMode( in_bExtensionMode ) +{ + xmlKeepBlanksDefaultValue = 0; +} + +xmlDocPtr HelpCompiler::getSourceDocument(const fs::path &filePath) +{ + static const char *params[4 + 1]; + static xsltStylesheetPtr cur = NULL; + + xmlDocPtr res; + if( bExtensionMode ) + { + res = xmlParseFile(filePath.native_file_string().c_str()); + if( !res ){ + impl_sleep( 3 ); + res = xmlParseFile(filePath.native_file_string().c_str()); + } + } + else + { + if (!cur) + { + static std::string fsroot('\'' + src.toUTF8() + '\''); + static std::string esclang('\'' + lang + '\''); + + xmlSubstituteEntitiesDefault(1); + xmlLoadExtDtdDefaultValue = 1; + cur = xsltParseStylesheetFile((const xmlChar *)resEmbStylesheet.native_file_string().c_str()); + + int nbparams = 0; + params[nbparams++] = "Language"; + params[nbparams++] = esclang.c_str(); + params[nbparams++] = "fsroot"; + params[nbparams++] = fsroot.c_str(); + params[nbparams] = NULL; + } + xmlDocPtr doc = xmlParseFile(filePath.native_file_string().c_str()); + if( !doc ) + { + impl_sleep( 3 ); + doc = xmlParseFile(filePath.native_file_string().c_str()); + } + + //???res = xmlParseFile(filePath.native_file_string().c_str()); + + res = xsltApplyStylesheet(cur, doc, params); + xmlFreeDoc(doc); + } + return res; +} + +HashSet HelpCompiler::switchFind(xmlDocPtr doc) +{ + HashSet hs; + xmlChar *xpath = (xmlChar*)"//switchinline"; + + xmlXPathContextPtr context = xmlXPathNewContext(doc); + xmlXPathObjectPtr result = xmlXPathEvalExpression(xpath, context); + xmlXPathFreeContext(context); + if (result) + { + xmlNodeSetPtr nodeset = result->nodesetval; + for (int i = 0; i < nodeset->nodeNr; i++) + { + xmlNodePtr el = nodeset->nodeTab[i]; + xmlChar *select = xmlGetProp(el, (xmlChar*)"select"); + if (select) + { + if (!strcmp((const char*)select, "appl")) + { + xmlNodePtr n1 = el->xmlChildrenNode; + while (n1) + { + if ((!xmlStrcmp(n1->name, (const xmlChar*)"caseinline"))) + { + xmlChar *appl = xmlGetProp(n1, (xmlChar*)"select"); + hs.push_back(std::string((const char*)appl)); + xmlFree(appl); + } + else if ((!xmlStrcmp(n1->name, (const xmlChar*)"defaultinline"))) + hs.push_back(std::string("DEFAULT")); + n1 = n1->next; + } + } + xmlFree(select); + } + } + xmlXPathFreeObject(result); + } + hs.push_back(std::string("DEFAULT")); + return hs; +} + +// returns a node representing the whole stuff compiled for the current +// application. +xmlNodePtr HelpCompiler::clone(xmlNodePtr node, const std::string& appl) +{ + xmlNodePtr parent = xmlCopyNode(node, 2); + xmlNodePtr n = node->xmlChildrenNode; + while (n != NULL) + { + bool isappl = false; + if ( (!strcmp((const char*)n->name, "switchinline")) || + (!strcmp((const char*)n->name, "switch")) ) + { + xmlChar *select = xmlGetProp(n, (xmlChar*)"select"); + if (select) + { + if (!strcmp((const char*)select, "appl")) + isappl = true; + xmlFree(select); + } + } + if (isappl) + { + xmlNodePtr caseNode = n->xmlChildrenNode; + if (appl == "DEFAULT") + { + while (caseNode) + { + if (!strcmp((const char*)caseNode->name, "defaultinline")) + { + xmlNodePtr cnl = caseNode->xmlChildrenNode; + while (cnl) + { + xmlAddChild(parent, clone(cnl, appl)); + cnl = cnl->next; + } + break; + } + caseNode = caseNode->next; + } + } + else + { + while (caseNode) + { + isappl=false; + if (!strcmp((const char*)caseNode->name, "caseinline")) + { + xmlChar *select = xmlGetProp(n, (xmlChar*)"select"); + if (select) + { + if (!strcmp((const char*)select, appl.c_str())) + isappl = true; + xmlFree(select); + } + if (isappl) + { + xmlNodePtr cnl = caseNode->xmlChildrenNode; + while (cnl) + { + xmlAddChild(parent, clone(cnl, appl)); + cnl = cnl->next; + } + break; + } + + } + caseNode = caseNode->next; + } + } + + } + else + xmlAddChild(parent, clone(n, appl)); + + n = n->next; + } + return parent; +} + +class myparser +{ +public: + std::string documentId; + std::string fileName; + std::string title; + HashSet *hidlist; + Hashtable *keywords; + Stringtable *helptexts; +private: + HashSet extendedHelpText; +public: + myparser(const std::string &indocumentId, const std::string &infileName, + const std::string &intitle) : documentId(indocumentId), fileName(infileName), + title(intitle) + { + hidlist = new HashSet; + keywords = new Hashtable; + helptexts = new Stringtable; + } + void traverse( xmlNodePtr parentNode ); +private: + std::string dump(xmlNodePtr node); +}; + +std::string myparser::dump(xmlNodePtr node) +{ + std::string app; + if (node->xmlChildrenNode) + { + xmlNodePtr list = node->xmlChildrenNode; + while (list) + { + app += dump(list); + list = list->next; + } + } + if (xmlNodeIsText(node)) + { + xmlChar *pContent = xmlNodeGetContent(node); + app += std::string((const char*)pContent); + xmlFree(pContent); + // std::cout << app << std::endl; + } + return app; +} + +void trim(std::string& str) +{ + std::string::size_type pos = str.find_last_not_of(' '); + if(pos != std::string::npos) + { + str.erase(pos + 1); + pos = str.find_first_not_of(' '); + if(pos != std::string::npos) + str.erase(0, pos); + } + else + str.erase(str.begin(), str.end()); +} + +void myparser::traverse( xmlNodePtr parentNode ) +{ + // traverse all nodes that belong to the parent + xmlNodePtr test ; + for (test = parentNode->xmlChildrenNode; test; test = test->next) + { + if (fileName.empty() && !strcmp((const char*)test->name, "filename")) + { + xmlNodePtr node = test->xmlChildrenNode; + if (xmlNodeIsText(node)) + { + xmlChar *pContent = xmlNodeGetContent(node); + fileName = std::string((const char*)pContent); + xmlFree(pContent); + } + } + else if (title.empty() && !strcmp((const char*)test->name, "title")) + { + title = dump(test); + if (title.empty()) + title = ""; + } + else if (!strcmp((const char*)test->name, "bookmark")) + { + xmlChar *branchxml = xmlGetProp(test, (const xmlChar*)"branch"); + xmlChar *idxml = xmlGetProp(test, (const xmlChar*)"id"); + std::string branch((const char*)branchxml); + std::string anchor((const char*)idxml); + xmlFree (branchxml); + xmlFree (idxml); + + std::string hid; + + if (branch.find("hid") == 0) + { + size_t index = branch.find('/'); + if (index != std::string::npos) + { + hid = branch.substr(1 + index); + // one shall serve as a documentId + if (documentId.empty()) + documentId = hid; + extendedHelpText.push_back(hid); + std::string foo = anchor.empty() ? hid : hid + "#" + anchor; + HCDBG(std::cerr << "hid pushback" << foo << std::endl); + hidlist->push_back( anchor.empty() ? hid : hid + "#" + anchor); + } + else + continue; + } + else if (branch.compare("index") == 0) + { + LinkedList ll; + + for (xmlNodePtr nd = test->xmlChildrenNode; nd; nd = nd->next) + { + if (strcmp((const char*)nd->name, "bookmark_value")) + continue; + + std::string embedded; + xmlChar *embeddedxml = xmlGetProp(nd, (const xmlChar*)"embedded"); + if (embeddedxml) + { + embedded = std::string((const char*)embeddedxml); + xmlFree (embeddedxml); + std::transform (embedded.begin(), embedded.end(), + embedded.begin(), tolower); + } + + bool isEmbedded = !embedded.empty() && embedded.compare("true") == 0; + if (isEmbedded) + continue; + + std::string keyword = dump(nd); + size_t keywordSem = keyword.find(';'); + if (keywordSem != std::string::npos) + { + std::string tmppre = + keyword.substr(0,keywordSem); + trim(tmppre); + std::string tmppos = + keyword.substr(1+keywordSem); + trim(tmppos); + keyword = tmppre + ";" + tmppos; + } + ll.push_back(keyword); + } + if (!ll.empty()) + (*keywords)[anchor] = ll; + } + else if (branch.compare("contents") == 0) + { + // currently not used + } + } + else if (!strcmp((const char*)test->name, "ahelp")) + { + std::string text = dump(test); + trim(text); + std::string name; + + HashSet::const_iterator aEnd = extendedHelpText.end(); + for (HashSet::const_iterator iter = extendedHelpText.begin(); iter != aEnd; + ++iter) + { + name = *iter; + (*helptexts)[name] = text; + } + extendedHelpText.clear(); + } + + // traverse children + traverse(test); + } +} + +bool HelpCompiler::compile( void ) throw( HelpProcessingException ) +{ + // we now have the jaroutputstream, which will contain the document. + // now determine the document as a dom tree in variable docResolved + + xmlDocPtr docResolvedOrg = getSourceDocument(inputFile); + + // now add path to the document + // resolve the dom + if (!docResolvedOrg) + { + impl_sleep( 3 ); + docResolvedOrg = getSourceDocument(inputFile); + if( !docResolvedOrg ) + { + std::stringstream aStrStream; + aStrStream << "ERROR: file not existing: " << inputFile.native_file_string().c_str() << std::endl; + throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); + } + } + + // now find all applications for which one has to compile + std::string documentId; + std::string fileName; + std::string title; + // returns all applications for which one has to compile + HashSet applications = switchFind(docResolvedOrg); + + HashSet::const_iterator aEnd = applications.end(); + for (HashSet::const_iterator aI = applications.begin(); aI != aEnd; ++aI) + { + std::string appl = *aI; + std::string modulename = appl; + if (modulename[0] == 'S') + { + modulename = modulename.substr(1); + std::transform(modulename.begin(), modulename.end(), modulename.begin(), tolower); + } + if (modulename != "DEFAULT" && modulename != module) + continue; + + // returns a clone of the document with swich-cases resolved + xmlNodePtr docResolved = clone(xmlDocGetRootElement(docResolvedOrg), appl); + myparser aparser(documentId, fileName, title); + aparser.traverse(docResolved); + + documentId = aparser.documentId; + fileName = aparser.fileName; + title = aparser.title; + + HCDBG(std::cerr << documentId << " : " << fileName << " : " << title << std::endl); + + xmlDocPtr docResolvedDoc = xmlCopyDoc(docResolvedOrg, false); + xmlDocSetRootElement(docResolvedDoc, docResolved); + + if (modulename == "DEFAULT") + { + streamTable.dropdefault(); + streamTable.default_doc = docResolvedDoc; + streamTable.default_hidlist = aparser.hidlist; + streamTable.default_helptexts = aparser.helptexts; + streamTable.default_keywords = aparser.keywords; + } + else if (modulename == module) + { + streamTable.dropappl(); + streamTable.appl_doc = docResolvedDoc; + streamTable.appl_hidlist = aparser.hidlist; + streamTable.appl_helptexts = aparser.helptexts; + streamTable.appl_keywords = aparser.keywords; + } + else + { + std::stringstream aStrStream; + aStrStream << "ERROR: Found unexpected module name \"" << modulename + << "\" in file" << src.native_file_string().c_str() << std::endl; + throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); + } + + } // end iteration over all applications + + streamTable.document_id = documentId; + streamTable.document_path = fileName; + streamTable.document_title = title; + std::string actMod = module; + if ( !bExtensionMode && !fileName.empty()) + { + if (fileName.find("/text/") == 0) + { + int len = strlen("/text/"); + actMod = fileName.substr(len); + actMod = actMod.substr(0, actMod.find('/')); + } + } + streamTable.document_module = actMod; + + xmlFreeDoc(docResolvedOrg); + return true; +} + +namespace fs +{ + rtl_TextEncoding getThreadTextEncoding( void ) + { + static bool bNeedsInit = true; + static rtl_TextEncoding nThreadTextEncoding; + if( bNeedsInit ) + { + bNeedsInit = false; + nThreadTextEncoding = osl_getThreadTextEncoding(); + } + return nThreadTextEncoding; + } + + void create_directory(const fs::path indexDirName) + { + HCDBG( + std::cerr << "creating " << + rtl::OUStringToOString(indexDirName.data, RTL_TEXTENCODING_UTF8).getStr() + << std::endl + ); + osl::Directory::createPath(indexDirName.data); + } + + void rename(const fs::path &src, const fs::path &dest) + { + osl::File::move(src.data, dest.data); + } + + void copy(const fs::path &src, const fs::path &dest) + { + osl::File::copy(src.data, dest.data); + } + + bool exists(const fs::path &in) + { + osl::File tmp(in.data); + return (tmp.open(osl_File_OpenFlag_Read) == osl::FileBase::E_None); + } + + void remove(const fs::path &in) + { + osl::File::remove(in.data); + } + + void removeRecursive(rtl::OUString const& _suDirURL) + { + { + osl::Directory aDir(_suDirURL); + aDir.open(); + if (aDir.isOpen()) + { + osl::DirectoryItem aItem; + osl::FileStatus aStatus(osl_FileStatus_Mask_FileName | osl_FileStatus_Mask_Attributes); + while (aDir.getNextItem(aItem) == ::osl::FileBase::E_None) + { + if (osl::FileBase::E_None == aItem.getFileStatus(aStatus) && + aStatus.isValid(osl_FileStatus_Mask_FileName | osl_FileStatus_Mask_Attributes)) + { + rtl::OUString suFilename = aStatus.getFileName(); + rtl::OUString suFullFileURL; + suFullFileURL += _suDirURL; + suFullFileURL += rtl::OUString::createFromAscii("/"); + suFullFileURL += suFilename; + + if (aStatus.getFileType() == osl::FileStatus::Directory) + removeRecursive(suFullFileURL); + else + osl::File::remove(suFullFileURL); + } + } + aDir.close(); + } + } + osl::Directory::remove(_suDirURL); + } + + void remove_all(const fs::path &in) + { + removeRecursive(in.data); + } +} + +/* vi:set tabstop=4 shiftwidth=4 expandtab: */ diff --git a/l10ntools/source/help/HelpCompiler.hxx b/l10ntools/source/help/HelpCompiler.hxx new file mode 100644 index 000000000000..7ffb096bd635 --- /dev/null +++ b/l10ntools/source/help/HelpCompiler.hxx @@ -0,0 +1,320 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: HelpCompiler.hxx,v $ + * $Revision: 1.8 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef HELPCOMPILER_HXX +#define HELPCOMPILER_HXX + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef SYSTEM_DB +#include +#else +#include +#endif + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#define EMULATEORIGINAL 1 + +#ifdef CMCDEBUG + #define HCDBG(foo) do { if (1) foo; } while(0) +#else + #define HCDBG(foo) do { if (0) foo; } while(0) +#endif + +namespace fs +{ + rtl_TextEncoding getThreadTextEncoding( void ); + + enum convert { native }; + class path + { + public: + ::rtl::OUString data; + public: + path() {} + path(const path &rOther) : data(rOther.data) {} + path(const std::string &in, convert) + { + rtl::OUString sWorkingDir; + osl_getProcessWorkingDir(&sWorkingDir.pData); + + rtl::OString tmp(in.c_str()); + rtl::OUString ustrSystemPath(rtl::OStringToOUString(tmp, getThreadTextEncoding())); + osl::File::getFileURLFromSystemPath(ustrSystemPath, data); + osl::File::getAbsoluteFileURL(sWorkingDir, data, data); + } + path(const std::string &FileURL) + { + rtl::OString tmp(FileURL.c_str()); + data = rtl::OStringToOUString(tmp, getThreadTextEncoding()); + } + std::string native_file_string() const + { + ::rtl::OUString ustrSystemPath; + osl::File::getSystemPathFromFileURL(data, ustrSystemPath); + rtl::OString tmp(rtl::OUStringToOString(ustrSystemPath, getThreadTextEncoding())); + HCDBG(std::cerr << "native_file_string is " << tmp.getStr() << std::endl); + return std::string(tmp.getStr()); + } + std::string native_directory_string() const { return native_file_string(); } + std::string toUTF8() const + { + rtl::OString tmp(rtl::OUStringToOString(data, RTL_TEXTENCODING_UTF8)); + return std::string(tmp.getStr()); + } + bool empty() const { return data.getLength() == 0; } + path operator/(const std::string &in) const + { + path ret(*this); + HCDBG(std::cerr << "orig was " << + rtl::OUStringToOString(ret.data, RTL_TEXTENCODING_UTF8).getStr() << std::endl); + rtl::OString tmp(in.c_str()); + rtl::OUString ustrSystemPath(rtl::OStringToOUString(tmp, getThreadTextEncoding())); + ret.data += rtl::OUString(sal_Unicode('/')); + ret.data += ustrSystemPath; + HCDBG(std::cerr << "final is " << + rtl::OUStringToOString(ret.data, RTL_TEXTENCODING_UTF8).getStr() << std::endl); + return ret; + } + void append(const char *in) + { + rtl::OString tmp(in); + rtl::OUString ustrSystemPath(rtl::OStringToOUString(tmp, getThreadTextEncoding())); + data = data + ustrSystemPath; + } + void append(const std::string &in) { append(in.c_str()); } + }; + + void create_directory(const fs::path indexDirName); + void rename(const fs::path &src, const fs::path &dest); + void copy(const fs::path &src, const fs::path &dest); + bool exists(const fs::path &in); + void remove_all(const fs::path &in); + void remove(const fs::path &in); +} + +struct joaat_hash +{ + size_t operator()(const std::string &str) const + { + size_t hash = 0; + const char *key = str.data(); + for (size_t i = 0; i < str.size(); i++) + { + hash += key[i]; + hash += (hash << 10); + hash ^= (hash >> 6); + } + hash += (hash << 3); + hash ^= (hash >> 11); + hash += (hash << 15); + return hash; + } +}; + +#define get16bits(d) ((((sal_uInt32)(((const sal_uInt8 *)(d))[1])) << 8)\ + +(sal_uInt32)(((const sal_uInt8 *)(d))[0]) ) + +struct SuperFastHash +{ + size_t operator()(const std::string &str) const + { + const char * data = str.data(); + int len = str.size(); + size_t hash = len, tmp; + if (len <= 0 || data == NULL) return 0; + + int rem = len & 3; + len >>= 2; + + /* Main loop */ + for (;len > 0; len--) + { + hash += get16bits (data); + tmp = (get16bits (data+2) << 11) ^ hash; + hash = (hash << 16) ^ tmp; + data += 2*sizeof (sal_uInt16); + hash += hash >> 11; + } + + /* Handle end cases */ + switch (rem) + { + case 3: hash += get16bits (data); + hash ^= hash << 16; + hash ^= data[sizeof (sal_uInt16)] << 18; + hash += hash >> 11; + break; + case 2: hash += get16bits (data); + hash ^= hash << 11; + hash += hash >> 17; + break; + case 1: hash += *data; + hash ^= hash << 10; + hash += hash >> 1; + } + + /* Force "avalanching" of final 127 bits */ + hash ^= hash << 3; + hash += hash >> 5; + hash ^= hash << 4; + hash += hash >> 17; + hash ^= hash << 25; + hash += hash >> 6; + + return hash; + } +}; + +#define pref_hash joaat_hash + +typedef std::hash_map Stringtable; +typedef std::list LinkedList; +typedef std::vector HashSet; + +typedef std::hash_map Hashtable; + +class StreamTable +{ +public: + std::string document_id; + std::string document_path; + std::string document_module; + std::string document_title; + + HashSet *appl_hidlist; + Hashtable *appl_keywords; + Stringtable *appl_helptexts; + xmlDocPtr appl_doc; + + HashSet *default_hidlist; + Hashtable *default_keywords; + Stringtable *default_helptexts; + xmlDocPtr default_doc; + + StreamTable() : + appl_hidlist(NULL), appl_keywords(NULL), appl_helptexts(NULL), appl_doc(NULL), + default_hidlist(NULL), default_keywords(NULL), default_helptexts(NULL), default_doc(NULL) + {} + void dropdefault() + { + delete default_hidlist; + delete default_keywords; + delete default_helptexts; + if (default_doc) xmlFreeDoc(default_doc); + } + void dropappl() + { + delete appl_hidlist; + delete appl_keywords; + delete appl_helptexts; + if (appl_doc) xmlFreeDoc(appl_doc); + } + ~StreamTable() + { + dropappl(); + dropdefault(); + } +}; + +struct HelpProcessingException +{ + HelpProcessingErrorClass m_eErrorClass; + std::string m_aErrorMsg; + std::string m_aXMLParsingFile; + int m_nXMLParsingLine; + + HelpProcessingException( HelpProcessingErrorClass eErrorClass, const std::string& aErrorMsg ) + : m_eErrorClass( eErrorClass ) + , m_aErrorMsg( aErrorMsg ) + {} + HelpProcessingException( const std::string& aErrorMsg, const std::string& aXMLParsingFile, int nXMLParsingLine ) + : m_eErrorClass( HELPPROCESSING_XMLPARSING_ERROR ) + , m_aErrorMsg( aErrorMsg ) + , m_aXMLParsingFile( aXMLParsingFile ) + , m_nXMLParsingLine( nXMLParsingLine ) + {} +}; + +class HelpCompiler +{ +public: + HelpCompiler(StreamTable &streamTable, + const fs::path &in_inputFile, + const fs::path &in_src, + const fs::path &in_resEmbStylesheet, + const std::string &in_module, + const std::string &in_lang, + bool in_bExtensionMode); + bool compile( void ) throw (HelpProcessingException); + void addEntryToJarFile(const std::string &prefix, + const std::string &entryName, const std::string &bytesToAdd); + void addEntryToJarFile(const std::string &prefix, + const std::string &entryName, const HashSet &bytesToAdd); + void addEntryToJarFile(const std::string &prefix, + const std::string &entryName, const Stringtable &bytesToAdd); + void addEntryToJarFile(const std::string &prefix, + const std::string &entryName, const Hashtable &bytesToAdd); +private: + xmlDocPtr getSourceDocument(const fs::path &filePath); + HashSet switchFind(xmlDocPtr doc); + xmlNodePtr clone(xmlNodePtr node, const std::string& appl); + StreamTable &streamTable; + const fs::path inputFile, src; + const std::string module, lang; + const fs::path resEmbStylesheet; + bool bExtensionMode; +}; + +#endif + +/* vi:set tabstop=4 shiftwidth=4 expandtab: */ diff --git a/l10ntools/source/help/HelpFileDocument.java b/l10ntools/source/help/HelpFileDocument.java new file mode 100644 index 000000000000..2212db27f251 --- /dev/null +++ b/l10ntools/source/help/HelpFileDocument.java @@ -0,0 +1,89 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: HelpFileDocument.java,v $ + * $Revision: 1.2 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package com.sun.star.help; + +import java.io.File; +import java.io.Reader; +import java.io.FileInputStream; +import java.io.InputStreamReader; +//import java.io.FileReader; +import java.io.StringReader; + +import org.apache.lucene.document.Document; +import org.apache.lucene.document.Field; + +/** Lucene Document for help files */ +public class HelpFileDocument +{ + /** Creates reader for UTF-8 files + */ + private static Reader getReaderForFile( File aFile ) + throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException { + Reader aReader; + if( aFile != null ) { + FileInputStream fis = new FileInputStream( aFile ); + aReader = new InputStreamReader( fis, "UTF-8" ); + } + else { + aReader = new StringReader( "" ); + } + return aReader; + } + + /** Makes a document for a File. + */ + public static Document Document( String aModule, File aCaptionFile, File aContentFile ) + throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException { + Document doc = new Document(); + + // Add the path of the file as a field named "path". Use a field that is + // indexed (i.e. searchable), but don't tokenize the field into words. + File aFile = aCaptionFile != null ? aCaptionFile : aContentFile; + if( aFile != null ) + { + String aPath = "#HLP#" + aModule + "/" + aFile.getName(); + doc.add(new Field("path", aPath, Field.Store.YES, Field.Index.UN_TOKENIZED)); + } + + // Add the caption of the file to a field named "caption". Specify a Reader, + // so that the text of the file is tokenized and indexed, but not stored. + doc.add( new Field( "caption", getReaderForFile( aCaptionFile ) ) ); + + // Add the contents of the file to a field named "content". Specify a Reader, + // so that the text of the file is tokenized and indexed, but not stored. + doc.add( new Field( "content", getReaderForFile( aContentFile ) ) ); + + // return the document + return doc; + } + + private HelpFileDocument() {} +} diff --git a/l10ntools/source/help/HelpIndexerTool.java b/l10ntools/source/help/HelpIndexerTool.java new file mode 100644 index 000000000000..6bf22d1ac344 --- /dev/null +++ b/l10ntools/source/help/HelpIndexerTool.java @@ -0,0 +1,372 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: HelpIndexer.java,v $ + * $Revision: 1.21 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +package com.sun.star.help; + +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; +import java.util.zip.CRC32; +import org.apache.lucene.analysis.standard.StandardAnalyzer; +import org.apache.lucene.analysis.cjk.CJKAnalyzer; +import org.apache.lucene.analysis.Analyzer; +import org.apache.lucene.index.IndexWriter; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.util.Date; + +public class HelpIndexerTool +{ + public HelpIndexerTool() + { + } + + + /** + * @param args the command line arguments + */ + public static void main( String[] args ) + { + boolean bExtensionMode = false; + mainImpl( args, bExtensionMode ); + } + + public static void mainImpl( String[] args, boolean bExtensionMode ) + { + String aDirToZipStr = ""; + String aSrcDirStr = ""; + String aLanguageStr = ""; + String aModule = ""; + String aTargetZipFileStr = ""; + String aCfsName = ""; + + // Scan arguments + boolean bLang = false; + boolean bMod = false; + boolean bZipDir = false; + boolean bSrcDir = false; + boolean bOutput = false; + boolean bCfsName = false; + + int nArgCount = args.length; + for( int i = 0 ; i < nArgCount ; i++ ) + { + if( "-lang".equals(args[i]) ) + { + if( i + 1 < nArgCount ) + { + aLanguageStr = args[i + 1]; + bLang = true; + } + i++; + } + else if( "-mod".equals(args[i]) ) + { + if( i + 1 < nArgCount ) + { + aModule = args[i + 1]; + bMod = true; + } + i++; + } + else if( "-zipdir".equals(args[i]) ) + { + if( i + 1 < nArgCount ) + { + aDirToZipStr = args[i + 1]; + bZipDir = true; + } + i++; + } + else if( "-srcdir".equals(args[i]) ) + { + if( i + 1 < nArgCount ) + { + aSrcDirStr = args[i + 1]; + bSrcDir = true; + } + i++; + } + else if( "-o".equals(args[i]) ) + { + if( i + 1 < nArgCount ) + { + aTargetZipFileStr = args[i + 1]; + bOutput = true; + } + i++; + } + else if( "-checkcfsname".equals(args[i]) ) + { + if( i + 1 < nArgCount ) + { + aCfsName = args[i + 1] + ".cfs"; + bCfsName = true; + } + i++; + } + } + + if( !bLang || !bMod || !bZipDir || (!bOutput && !bExtensionMode) ) + { + if( bExtensionMode ) + return; + + System.out.println("Usage: HelpIndexer -lang ISOLangCode -mod HelpModule -zipdir TempZipDir -o OutputZipFile"); + System.exit( -1 ); + } + + String aIndexDirName = aModule + ".idxl"; + File aIndexDir = new File( aDirToZipStr + File.separator + aIndexDirName ); + if( !bSrcDir ) + aSrcDirStr = aDirToZipStr; + File aCaptionFilesDir = new File( aSrcDirStr + File.separator + "caption" ); + File aContentFilesDir = new File( aSrcDirStr + File.separator + "content" ); + + try + { + Date start = new Date(); + Analyzer analyzer = aLanguageStr.equals("ja") ? (Analyzer)new CJKAnalyzer() : (Analyzer)new StandardAnalyzer(); + IndexWriter writer = new IndexWriter( aIndexDir, analyzer, true ); + if( !bExtensionMode ) + System.out.println( "Lucene: Indexing to directory '" + aIndexDir + "'..." ); + int nRet = indexDocs( writer, aModule, bExtensionMode, aCaptionFilesDir, aContentFilesDir ); + if( nRet != -1 ) + { + if( !bExtensionMode ) + { + System.out.println(); + System.out.println( "Optimizing ..." ); + } + writer.optimize(); + } + writer.close(); + + boolean bCfsFileOk = true; + if( bCfsName && !bExtensionMode && nRet != -1 ) + { + String aCompleteCfsFileName = aDirToZipStr + File.separator + aIndexDirName + File.separator + aCfsName; + File aCfsFile = new File( aCompleteCfsFileName ); + bCfsFileOk = aCfsFile.exists(); + System.out.println( "Checking cfs file " + aCfsName+ ": " + (bCfsFileOk ? "Found" : "Not found") ); + } + + if( bExtensionMode ) + { + if( !bSrcDir ) + { + deleteRecursively( aCaptionFilesDir ); + deleteRecursively( aContentFilesDir ); + } + } + else + { + if( nRet == -1 ) + deleteRecursively( aIndexDir ); + + if( bCfsFileOk ) + System.out.println( "Zipping ..." ); + File aDirToZipFile = new File( aDirToZipStr ); + createZipFile( aDirToZipFile, aTargetZipFileStr ); + deleteRecursively( aDirToZipFile ); + } + + if( !bCfsFileOk ) + { + System.out.println( "cfs file check failed, terminating..." ); + System.exit( -1 ); + } + + Date end = new Date(); + if( !bExtensionMode ) + System.out.println(end.getTime() - start.getTime() + " total milliseconds"); + } + catch (IOException e) + { + if( bExtensionMode ) + return; + + System.out.println(" caught a " + e.getClass() + + "\n with message: " + e.getMessage()); + System.exit( -1 ); + } + } + + private static int indexDocs(IndexWriter writer, String aModule, boolean bExtensionMode, + File aCaptionFilesDir, File aContentFilesDir) throws IOException + { + if( !aCaptionFilesDir.canRead() || !aCaptionFilesDir.isDirectory() ) + { + if( !bExtensionMode ) + System.out.println( "Not found: " + aCaptionFilesDir ); + return -1; + } + if( !aContentFilesDir.canRead() || !aContentFilesDir.isDirectory() ) + { + if( !bExtensionMode ) + System.out.println( "Not found: " + aContentFilesDir ); + return -1; + } + + String[] aCaptionFiles = aCaptionFilesDir.list(); + List aCaptionFilesList = Arrays.asList( aCaptionFiles ); + HashSet aCaptionFilesHashSet = new HashSet( aCaptionFilesList ); + + String[] aContentFiles = aContentFilesDir.list(); + List aContentFilesList = Arrays.asList( aContentFiles ); + HashSet aContentFilesHashSet = new HashSet( aContentFilesList ); + + // Loop over caption files and find corresponding content file + if( !bExtensionMode ) + System.out.println( "Indexing, adding files" ); + int nCaptionFilesLen = aCaptionFiles.length; + for( int i = 0 ; i < nCaptionFilesLen ; i++ ) + { + String aCaptionFileStr = aCaptionFiles[i]; + File aCaptionFile = new File( aCaptionFilesDir, aCaptionFileStr ); + File aContentFile = null; + if( aContentFilesHashSet.contains( aCaptionFileStr ) ) + aContentFile = new File( aContentFilesDir, aCaptionFileStr ); + + if( !bExtensionMode ) + System.out.print( "." ); + writer.addDocument( HelpFileDocument.Document( aModule, aCaptionFile, aContentFile ) ); + } + + // Loop over content files to find remaining files not mapped to caption files + int nContentFilesLen = aContentFiles.length; + for( int i = 0 ; i < nContentFilesLen ; i++ ) + { + String aContentFileStr = aContentFiles[i]; + if( !aCaptionFilesHashSet.contains( aContentFileStr ) ) + { + // Not already handled in caption files loop + File aCaptionFile = null; + File aContentFile = new File( aContentFilesDir, aContentFileStr ); + if( !bExtensionMode ) + System.out.print( "." ); + writer.addDocument( HelpFileDocument.Document( aModule, aCaptionFile, aContentFile ) ); + } + } + return 0; + } + + public static void createZipFile( File aDirToZip, String aTargetZipFileStr ) + throws FileNotFoundException, IOException + { + FileOutputStream fos = new FileOutputStream( aTargetZipFileStr ); + ZipOutputStream zos = new ZipOutputStream( fos ); + + File[] aChildrenFiles = aDirToZip.listFiles(); + int nFileCount = aChildrenFiles.length; + for( int i = 0 ; i < nFileCount ; i++ ) + addToZipRecursively( zos, aChildrenFiles[i], null ); + + zos.close(); + } + + public static void addToZipRecursively( ZipOutputStream zos, File aFile, String aBasePath ) + throws FileNotFoundException, IOException + { + if( aFile.isDirectory() ) + { + String aDirName = aFile.getName(); + if( aDirName.equalsIgnoreCase( "caption" ) || aDirName.equalsIgnoreCase( "content" ) ) + return; + + File[] aChildrenFiles = aFile.listFiles(); + String aNewBasePath = ""; + if( aBasePath != null ) + aNewBasePath += aBasePath + File.separator; + aNewBasePath += aDirName; + + int nFileCount = aChildrenFiles.length; + for( int i = 0 ; i < nFileCount ; i++ ) + addToZipRecursively( zos, aChildrenFiles[i], aNewBasePath ); + + return; + } + + // No directory + // read contents of file we are going to put in the zip + int fileLength = (int) aFile.length(); + FileInputStream fis = new FileInputStream( aFile ); + byte[] wholeFile = new byte[fileLength]; + int bytesRead = fis.read( wholeFile, 0, fileLength ); + fis.close(); + + String aFileName = aFile.getName(); + String aEntryName = ""; + if( aBasePath != null ) + aEntryName += aBasePath + "/"; + aEntryName += aFileName; + ZipEntry aZipEntry = new ZipEntry( aEntryName ); + aZipEntry.setTime( aFile.lastModified() ); + aZipEntry.setSize( fileLength ); + + int nMethod = ( aFileName.toLowerCase().endsWith( ".jar" ) ) + ? ZipEntry.STORED : ZipEntry.DEFLATED; + aZipEntry.setMethod( nMethod ); + + CRC32 tempCRC = new CRC32(); + tempCRC.update( wholeFile, 0, wholeFile.length ); + aZipEntry.setCrc( tempCRC.getValue() ); + + // write the contents into the zip element + zos.putNextEntry( aZipEntry ); + zos.write( wholeFile, 0, fileLength ); + zos.closeEntry(); + } + + static public boolean deleteRecursively( File aFile ) + { + if( aFile.isDirectory() ) + { + File[] aChildrenFiles = aFile.listFiles(); + int nFileCount = aChildrenFiles.length; + for( int i = 0 ; i < nFileCount ; i++ ) + { + File aChildrenFile = aChildrenFiles[i]; + boolean bSuccess = deleteRecursively( aChildrenFile ); + if( !bSuccess ) + return false; + } + } + + return aFile.delete(); + } +} + diff --git a/l10ntools/source/help/HelpLinker.cxx b/l10ntools/source/help/HelpLinker.cxx new file mode 100644 index 000000000000..7dfe4ee4a2a2 --- /dev/null +++ b/l10ntools/source/help/HelpLinker.cxx @@ -0,0 +1,1173 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: HelpLinker.cxx,v $ + * $Revision: 1.16 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "HelpCompiler.hxx" + +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#define DBHELP_ONLY + + +class IndexerPreProcessor +{ +private: + std::string m_aModuleName; + fs::path m_fsIndexBaseDir; + fs::path m_fsCaptionFilesDirName; + fs::path m_fsContentFilesDirName; + + xsltStylesheetPtr m_xsltStylesheetPtrCaption; + xsltStylesheetPtr m_xsltStylesheetPtrContent; + +public: + IndexerPreProcessor( const std::string& aModuleName, const fs::path& fsIndexBaseDir, + const fs::path& idxCaptionStylesheet, const fs::path& idxContentStylesheet ); + ~IndexerPreProcessor(); + + void processDocument( xmlDocPtr doc, const std::string& EncodedDocPath ); +}; + +IndexerPreProcessor::IndexerPreProcessor + ( const std::string& aModuleName, const fs::path& fsIndexBaseDir, + const fs::path& idxCaptionStylesheet, const fs::path& idxContentStylesheet ) + : m_aModuleName( aModuleName ) + , m_fsIndexBaseDir( fsIndexBaseDir ) +{ + m_fsCaptionFilesDirName = fsIndexBaseDir / "caption"; + fs::create_directory( m_fsCaptionFilesDirName ); + + m_fsContentFilesDirName = fsIndexBaseDir / "content"; + fs::create_directory( m_fsContentFilesDirName ); + + m_xsltStylesheetPtrCaption = xsltParseStylesheetFile + ((const xmlChar *)idxCaptionStylesheet.native_file_string().c_str()); + m_xsltStylesheetPtrContent = xsltParseStylesheetFile + ((const xmlChar *)idxContentStylesheet.native_file_string().c_str()); +} + +IndexerPreProcessor::~IndexerPreProcessor() +{ + if( m_xsltStylesheetPtrCaption ) + xsltFreeStylesheet( m_xsltStylesheetPtrCaption ); + if( m_xsltStylesheetPtrContent ) + xsltFreeStylesheet( m_xsltStylesheetPtrContent ); +} + + +std::string getEncodedPath( const std::string& Path ) +{ + rtl::OString aOStr_Path( Path.c_str() ); + rtl::OUString aOUStr_Path( rtl::OStringToOUString + ( aOStr_Path, fs::getThreadTextEncoding() ) ); + rtl::OUString aPathURL; + osl::File::getFileURLFromSystemPath( aOUStr_Path, aPathURL ); + rtl::OString aOStr_PathURL( rtl::OUStringToOString + ( aPathURL, fs::getThreadTextEncoding() ) ); + std::string aStdStr_PathURL( aOStr_PathURL.getStr() ); + return aStdStr_PathURL; +} + +void IndexerPreProcessor::processDocument + ( xmlDocPtr doc, const std::string &EncodedDocPath ) +{ + std::string aStdStr_EncodedDocPathURL = getEncodedPath( EncodedDocPath ); + + if( m_xsltStylesheetPtrCaption ) + { + xmlDocPtr resCaption = xsltApplyStylesheet( m_xsltStylesheetPtrCaption, doc, NULL ); + xmlNodePtr pResNodeCaption = resCaption->xmlChildrenNode; + if( pResNodeCaption ) + { + 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" ); + if( pFile_docURL ) + { + fprintf( pFile_docURL, "%s\n", pResNodeCaption->content ); + fclose( pFile_docURL ); + } + } + xmlFreeDoc(resCaption); + } + + if( m_xsltStylesheetPtrContent ) + { + xmlDocPtr resContent = xsltApplyStylesheet( m_xsltStylesheetPtrContent, doc, NULL ); + xmlNodePtr pResNodeContent = resContent->xmlChildrenNode; + 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" ); + if( pFile_docURL ) + { + fprintf( pFile_docURL, "%s\n", pResNodeContent->content ); + fclose( pFile_docURL ); + } + } + xmlFreeDoc(resContent); + } +} + +struct Data +{ + std::vector _idList; + typedef std::vector::const_iterator cIter; + + void append(const std::string &id) + { + _idList.push_back(id); + } + + std::string getString() const + { + std::string ret; + cIter aEnd = _idList.end(); + for (cIter aIter = _idList.begin(); aIter != aEnd; ++aIter) + ret += *aIter + ";"; + return ret; + } +}; + +void writeKeyValue_DBHelp( FILE* pFile, const std::string& aKeyStr, const std::string& aValueStr ) +{ + if( pFile == NULL ) + return; + char cLF = 10; + unsigned int nKeyLen = aKeyStr.length(); + unsigned int nValueLen = aValueStr.length(); + fprintf( pFile, "%x ", nKeyLen ); + if( nKeyLen > 0 ) + { + if (fwrite( aKeyStr.c_str(), 1, nKeyLen, pFile ) != nKeyLen) + fprintf(stderr, "fwrite to db failed\n"); + } + if (fprintf( pFile, " %x ", nValueLen ) < 0) + fprintf(stderr, "fwrite to db failed\n"); + if( nValueLen > 0 ) + { + if (fwrite( aValueStr.c_str(), 1, nValueLen, pFile ) != nValueLen) + fprintf(stderr, "fwrite to db failed\n"); + } + if (fprintf( pFile, "%c", cLF ) < 0) + fprintf(stderr, "fwrite to db failed\n"); +} + +class HelpKeyword +{ +private: + typedef std::hash_map DataHashtable; + DataHashtable _hash; + +public: + void insert(const std::string &key, const std::string &id) + { + Data &data = _hash[key]; + data.append(id); + } + + void dump(DB* table) + { + DataHashtable::const_iterator aEnd = _hash.end(); + for (DataHashtable::const_iterator aIter = _hash.begin(); aIter != aEnd; ++aIter) + { + const std::string &keystr = aIter->first; + DBT key; + memset(&key, 0, sizeof(key)); + key.data = const_cast(keystr.c_str()); + key.size = keystr.length(); + + const Data &data = aIter->second; + std::string str = data.getString(); + DBT value; + memset(&value, 0, sizeof(value)); + value.data = const_cast(str.c_str()); + value.size = str.length(); + + table->put(table, NULL, &key, &value, 0); + } + } + + void dump_DBHelp( const std::string& rFileName ) + { + FILE* pFile = fopen( rFileName.c_str(), "wb" ); + if( pFile == NULL ) + return; + + DataHashtable::const_iterator aEnd = _hash.end(); + for (DataHashtable::const_iterator aIter = _hash.begin(); aIter != aEnd; ++aIter) + writeKeyValue_DBHelp( pFile, aIter->first, aIter->second.getString() ); + + fclose( pFile ); + } +}; + +class HelpLinker +{ +public: + void main(std::vector &args, + std::string* pExtensionPath = NULL, const rtl::OUString* pOfficeHelpPath = NULL ) + throw( HelpProcessingException ); + + HelpLinker() + : init(true) + , m_pIndexerPreProcessor(NULL) + {} + ~HelpLinker() + { delete m_pIndexerPreProcessor; } + +private: + int locCount, totCount; + Stringtable additionalFiles; + HashSet helpFiles; + fs::path sourceRoot; + fs::path embeddStylesheet; + fs::path idxCaptionStylesheet; + fs::path idxContentStylesheet; + fs::path zipdir; + fs::path outputFile; + std::string module; + std::string lang; + std::string hid; + std::string extensionPath; + bool bExtensionMode; + fs::path indexDirName; + Stringtable hidlistTranslation; + fs::path indexDirParentName; + bool init; + IndexerPreProcessor* m_pIndexerPreProcessor; + void initIndexerPreProcessor(); + void link() throw( HelpProcessingException ); + void addBookmark( DB* dbBase, FILE* pFile_DBHelp, std::string thishid, + const std::string& fileB, const std::string& anchorB, + const std::string& jarfileB, const std::string& titleB ); +#if 0 + /** + * @param outputFile + * @param module + * @param lang + * @param hid + * @param helpFiles + * @param additionalFiles + */ + + private HelpURLStreamHandlerFactory urlHandler = null; +#endif +}; + +namespace URLEncoder +{ + static std::string encode(const std::string &rIn) + { + const char *good = "!$&'()*+,-.=@_"; + static const char hex[17] = "0123456789ABCDEF"; + + std::string result; + for (size_t i=0; i < rIn.length(); ++i) + { + unsigned char c = rIn[i]; + if (isalnum (c) || strchr (good, c)) + result += c; + else { + result += '%'; + result += hex[c >> 4]; + result += hex[c & 0xf]; + } + } + return result; + } +} + +void HelpLinker::addBookmark( DB* dbBase, FILE* pFile_DBHelp, std::string thishid, + const std::string& fileB, const std::string& anchorB, + const std::string& jarfileB, const std::string& titleB) +{ + HCDBG(std::cerr << "HelpLinker::addBookmark " << thishid << " " << + fileB << " " << anchorB << " " << jarfileB << " " << titleB << std::endl); + + std::string temp = thishid; + std::transform (temp.begin(), temp.end(), temp.begin(), toupper); + std::replace(temp.begin(), temp.end(), ':', '_'); + const std::string& translatedHid = hidlistTranslation[temp]; + if (!translatedHid.empty()) + thishid = translatedHid; + + thishid = URLEncoder::encode(thishid); + + DBT key; + memset(&key, 0, sizeof(key)); + key.data = const_cast(thishid.c_str()); + key.size = thishid.length(); + + int fileLen = fileB.length(); + if (!anchorB.empty()) + fileLen += (1 + anchorB.length()); + int dataLen = 1 + fileLen + 1 + jarfileB.length() + 1 + titleB.length(); + + std::vector dataB(dataLen); + size_t i = 0; + dataB[i++] = static_cast(fileLen); + for (size_t j = 0; j < fileB.length(); ++j) + dataB[i++] = fileB[j]; + if (!anchorB.empty()) + { + dataB[i++] = '#'; + for (size_t j = 0; j < anchorB.length(); ++j) + dataB[i++] = anchorB[j]; + } + dataB[i++] = static_cast(jarfileB.length()); + for (size_t j = 0; j < jarfileB.length(); ++j) + dataB[i++] = jarfileB[j]; + + dataB[i++] = static_cast(titleB.length()); + for (size_t j = 0; j < titleB.length(); ++j) + dataB[i++] = titleB[j]; + + DBT data; + memset(&data, 0, sizeof(data)); + data.data = &dataB[0]; + data.size = dataB.size(); + + if( dbBase != NULL ) + dbBase->put(dbBase, NULL, &key, &data, 0); + + if( pFile_DBHelp != NULL ) + { + std::string aValueStr( dataB.begin(), dataB.end() ); + writeKeyValue_DBHelp( pFile_DBHelp, thishid, aValueStr ); + } +} + +void HelpLinker::initIndexerPreProcessor() +{ + if( m_pIndexerPreProcessor ) + delete m_pIndexerPreProcessor; + std::string mod = module; + std::transform (mod.begin(), mod.end(), mod.begin(), tolower); + m_pIndexerPreProcessor = new IndexerPreProcessor( mod, indexDirParentName, + idxCaptionStylesheet, idxContentStylesheet ); +} + +/** +* +*/ +void HelpLinker::link() throw( HelpProcessingException ) +{ + bool bIndexForExtension = true; + + if( bExtensionMode ) + { + indexDirParentName = sourceRoot; + } + else + { + indexDirParentName = zipdir; + fs::create_directory(indexDirParentName); + } + +#ifdef CMC_DEBUG + std::cerr << "will not delete tmpdir of " << indexDirParentName.native_file_string().c_str() << std::endl; +#endif + + std::string mod = module; + std::transform (mod.begin(), mod.end(), mod.begin(), tolower); + + // do the work here + // continue with introduction of the overall process thing into the + // here all hzip files will be worked on + std::string appl = mod; + if (appl[0] == 's') + appl = appl.substr(1); + + bool bUse_ = true; +#ifdef DBHELP_ONLY + if( !bExtensionMode ) + bUse_ = false; +#endif + + DB* helpText(0); +#ifndef DBHELP_ONLY + fs::path helpTextFileName(indexDirParentName / (mod + ".ht")); + db_create(&helpText,0,0); + helpText->open(helpText, NULL, helpTextFileName.native_file_string().c_str(), NULL, DB_BTREE, + DB_CREATE | DB_TRUNCATE, 0644); +#endif + + fs::path helpTextFileName_DBHelp(indexDirParentName / (mod + (bUse_ ? ".ht_" : ".ht"))); + FILE* pFileHelpText_DBHelp = fopen + ( helpTextFileName_DBHelp.native_file_string().c_str(), "wb" ); + + DB* dbBase(0); +#ifndef DBHELP_ONLY + fs::path dbBaseFileName(indexDirParentName / (mod + ".db")); + db_create(&dbBase,0,0); + dbBase->open(dbBase, NULL, dbBaseFileName.native_file_string().c_str(), NULL, DB_BTREE, + DB_CREATE | DB_TRUNCATE, 0644); +#endif + + fs::path dbBaseFileName_DBHelp(indexDirParentName / (mod + (bUse_ ? ".db_" : ".db"))); + FILE* pFileDbBase_DBHelp = fopen + ( dbBaseFileName_DBHelp.native_file_string().c_str(), "wb" ); + +#ifndef DBHELP_ONLY + DB* keyWord(0); + fs::path keyWordFileName(indexDirParentName / (mod + ".key")); + db_create(&keyWord,0,0); + keyWord->open(keyWord, NULL, keyWordFileName.native_file_string().c_str(), NULL, DB_BTREE, + DB_CREATE | DB_TRUNCATE, 0644); +#endif + + fs::path keyWordFileName_DBHelp(indexDirParentName / (mod + (bUse_ ? ".key_" : ".key"))); + + HelpKeyword helpKeyword; + + // catch HelpProcessingException to avoid locking data bases + try + { + + std::ifstream fileReader(hid.c_str()); + while (fileReader) + { + std::string key; + fileReader >> key; + std::transform (key.begin(), key.end(), key.begin(), toupper); + std::replace(key.begin(), key.end(), ':', '_'); + std::string data; + fileReader >> data; + if (!key.empty() && !data.empty()) + hidlistTranslation[key] = data; + } + fileReader.close(); + + // lastly, initialize the indexBuilder + if ( (!bExtensionMode || bIndexForExtension) && !helpFiles.empty()) + initIndexerPreProcessor(); + + if( !bExtensionMode ) + { +#ifndef OS2 // YD @TODO@ crashes libc runtime :-( + std::cout << "Making " << outputFile.native_file_string() << + " from " << helpFiles.size() << " input files" << std::endl; +#endif + } + + // here we start our loop over the hzip files. + HashSet::iterator end = helpFiles.end(); + for (HashSet::iterator iter = helpFiles.begin(); iter != end; ++iter) + { + if( !bExtensionMode ) + { + std::cout << "."; + std::cout.flush(); + } + + // process one file + // streamTable contains the streams in the hzip file + StreamTable streamTable; + const std::string &xhpFileName = *iter; + + if (!bExtensionMode && xhpFileName.rfind(".xhp") != xhpFileName.length()-4) + { + // only work on .xhp - files + std::cerr << + "ERROR: input list entry '" + << xhpFileName + << "' has the wrong extension (only files with extension .xhp " + << "are accepted)"; + continue; + } + + fs::path langsourceRoot(sourceRoot); + fs::path xhpFile; + + if( bExtensionMode ) + { + // langsourceRoot == sourceRoot for extensions + std::string xhpFileNameComplete( extensionPath ); + xhpFileNameComplete.append( '/' + xhpFileName ); + xhpFile = fs::path( xhpFileNameComplete ); + } + else + { + langsourceRoot.append('/' + lang + '/'); + xhpFile = fs::path(xhpFileName, fs::native); + } + + HelpCompiler hc( streamTable, xhpFile, langsourceRoot, + embeddStylesheet, module, lang, bExtensionMode ); + + HCDBG(std::cerr << "before compile of " << xhpFileName << std::endl); + bool success = hc.compile(); + HCDBG(std::cerr << "after compile of " << xhpFileName << std::endl); + + if (!success && !bExtensionMode) + { + std::stringstream aStrStream; + aStrStream << + "\nERROR: compiling help particle '" + << xhpFileName + << "' for language '" + << lang + << "' failed!"; + throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); + } + + const std::string documentBaseId = streamTable.document_id; + std::string documentPath = streamTable.document_path; + if (documentPath.find("/") == 0) + documentPath = documentPath.substr(1); + + std::string documentJarfile = streamTable.document_module + ".jar"; + + std::string documentTitle = streamTable.document_title; + if (documentTitle.empty()) + documentTitle = ""; + +#if 0 + std::cout << "for " << xhpFileName << " documentBaseId is " << documentBaseId << "\n"; + std::cout << "for " << xhpFileName << " documentPath is " << documentPath << "\n"; + std::cout << "for " << xhpFileName << " documentJarfile is " << documentJarfile << "\n"; + std::cout << "for " << xhpFileName << " documentPath is " << documentTitle << "\n"; +#endif + + const std::string& fileB = documentPath; + const std::string& jarfileB = documentJarfile; + std::string& titleB = documentTitle; + + // add once this as its own id. + addBookmark(dbBase, pFileDbBase_DBHelp, documentPath, fileB, std::string(), jarfileB, titleB); + + // first the database *.db + // ByteArrayInputStream bais = null; + // ObjectInputStream ois = null; + + const HashSet *hidlist = streamTable.appl_hidlist; + if (!hidlist) + hidlist = streamTable.default_hidlist; + if (hidlist && !hidlist->empty()) + { + // now iterate over all elements of the hidlist + HashSet::const_iterator aEnd = hidlist->end(); + for (HashSet::const_iterator hidListIter = hidlist->begin(); + hidListIter != aEnd; ++hidListIter) + { + std::string thishid = *hidListIter; + + std::string anchorB; + size_t index = thishid.rfind('#'); + if (index != std::string::npos) + { + anchorB = thishid.substr(1 + index); + thishid = thishid.substr(0, index); + } + addBookmark(dbBase, pFileDbBase_DBHelp, thishid, fileB, anchorB, jarfileB, titleB); + } + } + + // now the keywords + const Hashtable *anchorToLL = streamTable.appl_keywords; + if (!anchorToLL) + anchorToLL = streamTable.default_keywords; + if (anchorToLL && !anchorToLL->empty()) + { + std::string fakedHid = URLEncoder::encode(documentPath); + Hashtable::const_iterator aEnd = anchorToLL->end(); + for (Hashtable::const_iterator enumer = anchorToLL->begin(); + enumer != aEnd; ++enumer) + { + const std::string &anchor = enumer->first; + addBookmark(dbBase, pFileDbBase_DBHelp, documentPath, fileB, + anchor, jarfileB, titleB); + std::string totalId = fakedHid + "#" + anchor; + // std::cerr << hzipFileName << std::endl; + const LinkedList& ll = enumer->second; + LinkedList::const_iterator aOtherEnd = ll.end(); + for (LinkedList::const_iterator llIter = ll.begin(); + llIter != aOtherEnd; ++llIter) + { + helpKeyword.insert(*llIter, totalId); + } + } + + } + + // and last the helptexts + const Stringtable *helpTextHash = streamTable.appl_helptexts; + if (!helpTextHash) + helpTextHash = streamTable.default_helptexts; + if (helpTextHash && !helpTextHash->empty()) + { + Stringtable::const_iterator aEnd = helpTextHash->end(); + for (Stringtable::const_iterator helpTextIter = helpTextHash->begin(); + helpTextIter != aEnd; ++helpTextIter) + { + std::string helpTextId = helpTextIter->first; + const std::string& helpTextText = helpTextIter->second; + + std::string temp = helpTextId; + std::transform (temp.begin(), temp.end(), temp.begin(), toupper); + std::replace(temp.begin(), temp.end(), ':', '_'); + + const std::string& tHid = hidlistTranslation[temp]; + if (!tHid.empty()) + helpTextId = tHid; + helpTextId = URLEncoder::encode(helpTextId); + + DBT keyDbt; + memset(&keyDbt, 0, sizeof(keyDbt)); + keyDbt.data = const_cast(helpTextId.c_str()); + keyDbt.size = helpTextId.length(); + + DBT textDbt; + memset(&textDbt, 0, sizeof(textDbt)); + textDbt.data = const_cast(helpTextText.c_str()); + textDbt.size = helpTextText.length(); + + if( helpText != NULL ) + helpText->put(helpText, NULL, &keyDbt, &textDbt, 0); + + if( pFileHelpText_DBHelp != NULL ) + writeKeyValue_DBHelp( pFileHelpText_DBHelp, helpTextId, helpTextText ); + } + } + + //IndexerPreProcessor + if( !bExtensionMode || bIndexForExtension ) + { + // now the indexing + xmlDocPtr document = streamTable.appl_doc; + if (!document) + document = streamTable.default_doc; + if (document) + { + std::string temp = module; + std::transform (temp.begin(), temp.end(), temp.begin(), tolower); + m_pIndexerPreProcessor->processDocument(document, URLEncoder::encode(documentPath) ); + } + } + + } // while loop over hzip files ending + if( !bExtensionMode ) + std::cout << std::endl; + + } // try + catch( HelpProcessingException& ) + { + // catch HelpProcessingException to avoid locking data bases +#ifndef DBHELP_ONLY + helpText->close(helpText, 0); + dbBase->close(dbBase, 0); + keyWord->close(keyWord, 0); +#endif + if( pFileHelpText_DBHelp != NULL ) + fclose( pFileHelpText_DBHelp ); + if( pFileDbBase_DBHelp != NULL ) + fclose( pFileDbBase_DBHelp ); + throw; + } + +#ifndef DBHELP_ONLY + helpText->close(helpText, 0); + dbBase->close(dbBase, 0); + helpKeyword.dump(keyWord); + keyWord->close(keyWord, 0); +#endif + if( pFileHelpText_DBHelp != NULL ) + fclose( pFileHelpText_DBHelp ); + if( pFileDbBase_DBHelp != NULL ) + fclose( pFileDbBase_DBHelp ); + + helpKeyword.dump_DBHelp( keyWordFileName_DBHelp.native_file_string() ); + + if( !bExtensionMode ) + { + // New index + Stringtable::iterator aEnd = additionalFiles.end(); + for (Stringtable::iterator enumer = additionalFiles.begin(); enumer != aEnd; + ++enumer) + { + const std::string &additionalFileName = enumer->second; + const std::string &additionalFileKey = enumer->first; + + fs::path fsAdditionalFileName( additionalFileName, fs::native ); + std::string aNativeStr = fsAdditionalFileName.native_file_string(); + const char* pStr = aNativeStr.c_str(); + std::cerr << pStr; + + fs::path fsTargetName( indexDirParentName / additionalFileKey ); + + fs::copy( fsAdditionalFileName, fsTargetName ); + } + } + +/* + ///////////////////////////////////////////////////////////////////////// + /// remove temprary directory for index creation + ///////////////////////////////////////////////////////////////////////// +#ifndef CMC_DEBUG + if( !bExtensionMode ) + fs::remove_all( indexDirParentName ); +#endif +*/ +} + + +void HelpLinker::main( std::vector &args, + std::string* pExtensionPath, const rtl::OUString* pOfficeHelpPath ) + throw( HelpProcessingException ) +{ + rtl::OUString aOfficeHelpPath; + + bExtensionMode = false; + if( pExtensionPath && pExtensionPath->length() > 0 && pOfficeHelpPath ) + { + helpFiles.clear(); + bExtensionMode = true; + extensionPath = *pExtensionPath; + sourceRoot = fs::path(extensionPath); + + aOfficeHelpPath = *pOfficeHelpPath; + } + if (args.size() > 0 && args[0][0] == '@') + { + std::vector stringList; + std::string strBuf; + std::ifstream fileReader(args[0].substr(1).c_str()); + + while (fileReader) + { + std::string token; + fileReader >> token; + if (!token.empty()) + stringList.push_back(token); + } + fileReader.close(); + + args = stringList; + } + + size_t i = 0; + + while (i < args.size()) + { + if (args[i].compare("-src") == 0) + { + ++i; + if (i >= args.size()) + { + std::stringstream aStrStream; + aStrStream << "sourceroot missing" << std::endl; + throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); + } + + if( !bExtensionMode ) + sourceRoot = fs::path(args[i], fs::native); + } + else if (args[i].compare("-sty") == 0) + { + ++i; + if (i >= args.size()) + { + std::stringstream aStrStream; + aStrStream << "embeddingStylesheet missing" << std::endl; + throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); + } + + embeddStylesheet = fs::path(args[i], fs::native); + } + else if (args[i].compare("-zipdir") == 0) + { + ++i; + if (i >= args.size()) + { + std::stringstream aStrStream; + aStrStream << "idxtemp missing" << std::endl; + throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); + } + + zipdir = fs::path(args[i], fs::native); + } + else if (args[i].compare("-idxcaption") == 0) + { + ++i; + if (i >= args.size()) + { + std::stringstream aStrStream; + aStrStream << "idxcaption stylesheet missing" << std::endl; + throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); + } + + idxCaptionStylesheet = fs::path(args[i], fs::native); + } + else if (args[i].compare("-idxcontent") == 0) + { + ++i; + if (i >= args.size()) + { + std::stringstream aStrStream; + aStrStream << "idxcontent stylesheet missing" << std::endl; + throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); + } + + idxContentStylesheet = fs::path(args[i], fs::native); + } + else if (args[i].compare("-o") == 0) + { + ++i; + if (i >= args.size()) + { + std::stringstream aStrStream; + aStrStream << "outputfilename missing" << std::endl; + throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); + } + + outputFile = fs::path(args[i], fs::native); + } + else if (args[i].compare("-mod") == 0) + { + ++i; + if (i >= args.size()) + { + std::stringstream aStrStream; + aStrStream << "module name missing" << std::endl; + throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); + } + + module = args[i]; + } + else if (args[i].compare("-lang") == 0) + { + ++i; + if (i >= args.size()) + { + std::stringstream aStrStream; + aStrStream << "language name missing" << std::endl; + throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); + } + + lang = args[i]; + } + else if (args[i].compare("-hid") == 0) + { + ++i; + if (i >= args.size()) + { + std::stringstream aStrStream; + aStrStream << "hid list missing" << std::endl; + throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); + } + + hid = args[i]; + } + else if (args[i].compare("-add") == 0) + { + std::string addFile, addFileUnderPath; + ++i; + if (i >= args.size()) + { + std::stringstream aStrStream; + aStrStream << "pathname missing" << std::endl; + throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); + } + + addFileUnderPath = args[i]; + ++i; + if (i >= args.size()) + { + std::stringstream aStrStream; + aStrStream << "pathname missing" << std::endl; + throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); + } + addFile = args[i]; + if (!addFileUnderPath.empty() && !addFile.empty()) + additionalFiles[addFileUnderPath] = addFile; + } + else + helpFiles.push_back(args[i]); + ++i; + } + + if (!bExtensionMode && zipdir.empty()) + { + std::stringstream aStrStream; + aStrStream << "no index dir given" << std::endl; + throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); + } + if (!bExtensionMode && idxCaptionStylesheet.empty()) + { + std::stringstream aStrStream; + aStrStream << "no index caption stylesheet given" << std::endl; + throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); + } + else if ( bExtensionMode ) + { + rtl::OUString aIdxCaptionPathFileURL( aOfficeHelpPath ); + aIdxCaptionPathFileURL += rtl::OUString::createFromAscii( "/idxcaption.xsl" ); + + rtl::OString aOStr_IdxCaptionPathFileURL( rtl::OUStringToOString + ( aIdxCaptionPathFileURL, fs::getThreadTextEncoding() ) ); + std::string aStdStr_IdxCaptionPathFileURL( aOStr_IdxCaptionPathFileURL.getStr() ); + + idxCaptionStylesheet = fs::path( aStdStr_IdxCaptionPathFileURL ); + } + if (!bExtensionMode && idxContentStylesheet.empty()) + { + std::stringstream aStrStream; + aStrStream << "no index content stylesheet given" << std::endl; + throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); + } + else if ( bExtensionMode ) + { + rtl::OUString aIdxContentPathFileURL( aOfficeHelpPath ); + aIdxContentPathFileURL += rtl::OUString::createFromAscii( "/idxcontent.xsl" ); + + rtl::OString aOStr_IdxContentPathFileURL( rtl::OUStringToOString + ( aIdxContentPathFileURL, fs::getThreadTextEncoding() ) ); + std::string aStdStr_IdxContentPathFileURL( aOStr_IdxContentPathFileURL.getStr() ); + + idxContentStylesheet = fs::path( aStdStr_IdxContentPathFileURL ); + } + if (!bExtensionMode && embeddStylesheet.empty()) + { + std::stringstream aStrStream; + aStrStream << "no embedding resolving file given" << std::endl; + throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); + } + if (sourceRoot.empty()) + { + std::stringstream aStrStream; + aStrStream << "no sourceroot given" << std::endl; + throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); + } + if (!bExtensionMode && outputFile.empty()) + { + std::stringstream aStrStream; + aStrStream << "no output file given" << std::endl; + throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); + } + if (module.empty()) + { + std::stringstream aStrStream; + aStrStream << "module missing" << std::endl; + throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); + } + if (!bExtensionMode && lang.empty()) + { + std::stringstream aStrStream; + aStrStream << "language missing" << std::endl; + throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); + } + if (!bExtensionMode && hid.empty()) + { + std::stringstream aStrStream; + aStrStream << "hid list missing" << std::endl; + throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); + } + + link(); +} + +int main(int argc, char**argv) +{ + sal_uInt32 starttime = osl_getGlobalTimer(); + std::vector args; + for (int i = 1; i < argc; ++i) + args.push_back(std::string(argv[i])); + try + { + HelpLinker* pHelpLinker = new HelpLinker(); + pHelpLinker->main( args ); + delete pHelpLinker; + } + catch( const HelpProcessingException& e ) + { + std::cerr << e.m_aErrorMsg; + exit(1); + } + sal_uInt32 endtime = osl_getGlobalTimer(); +#ifndef OS2 // YD @TODO@ crashes libc runtime :-( + std::cout << "time taken was " << (endtime-starttime)/1000.0 << " seconds" << std::endl; +#endif + return 0; +} + +// Variable to set an exception in "C" StructuredXMLErrorFunction +static const HelpProcessingException* GpXMLParsingException = NULL; + +extern "C" void StructuredXMLErrorFunction(void *userData, xmlErrorPtr error) +{ + (void)userData; + (void)error; + + std::string aErrorMsg = error->message; + std::string aXMLParsingFile; + if( error->file != NULL ) + aXMLParsingFile = error->file; + int nXMLParsingLine = error->line; + HelpProcessingException* pException = new HelpProcessingException( aErrorMsg, aXMLParsingFile, nXMLParsingLine ); + GpXMLParsingException = pException; + + // Reset error handler + xmlSetStructuredErrorFunc( NULL, NULL ); +} + +HelpProcessingErrorInfo& HelpProcessingErrorInfo::operator=( const struct HelpProcessingException& e ) +{ + m_eErrorClass = e.m_eErrorClass; + rtl::OString tmpErrorMsg( e.m_aErrorMsg.c_str() ); + m_aErrorMsg = rtl::OStringToOUString( tmpErrorMsg, fs::getThreadTextEncoding() ); + rtl::OString tmpXMLParsingFile( e.m_aXMLParsingFile.c_str() ); + m_aXMLParsingFile = rtl::OStringToOUString( tmpXMLParsingFile, fs::getThreadTextEncoding() ); + m_nXMLParsingLine = e.m_nXMLParsingLine; + return *this; +} + + +// Returns true in case of success, false in case of error +HELPLINKER_DLLPUBLIC bool compileExtensionHelp +( + const rtl::OUString& aOfficeHelpPath, + const rtl::OUString& aExtensionName, + const rtl::OUString& aExtensionLanguageRoot, + sal_Int32 nXhpFileCount, const rtl::OUString* pXhpFiles, + HelpProcessingErrorInfo& o_rHelpProcessingErrorInfo +) +{ + bool bSuccess = true; + + sal_Int32 argc = nXhpFileCount + 3; + const char** argv = new const char*[argc]; + argv[0] = ""; + argv[1] = "-mod"; + rtl::OString aOExtensionName = rtl::OUStringToOString( aExtensionName, fs::getThreadTextEncoding() ); + argv[2] = aOExtensionName.getStr(); + + for( sal_Int32 iXhp = 0 ; iXhp < nXhpFileCount ; ++iXhp ) + { + rtl::OUString aXhpFile = pXhpFiles[iXhp]; + + rtl::OString aOXhpFile = rtl::OUStringToOString( aXhpFile, fs::getThreadTextEncoding() ); + char* pArgStr = new char[aOXhpFile.getLength() + 1]; + strcpy( pArgStr, aOXhpFile.getStr() ); + argv[iXhp + 3] = pArgStr; + } + + std::vector args; + for( sal_Int32 i = 1; i < argc; ++i ) + args.push_back(std::string( argv[i]) ); + + for( sal_Int32 iXhp = 0 ; iXhp < nXhpFileCount ; ++iXhp ) + delete argv[iXhp + 3]; + delete[] argv; + + rtl::OString aOExtensionLanguageRoot = rtl::OUStringToOString( aExtensionLanguageRoot, fs::getThreadTextEncoding() ); + const char* pExtensionPath = aOExtensionLanguageRoot.getStr(); + std::string aStdStrExtensionPath = pExtensionPath; + + // Set error handler + xmlSetStructuredErrorFunc( NULL, (xmlStructuredErrorFunc)StructuredXMLErrorFunction ); + try + { + HelpLinker* pHelpLinker = new HelpLinker(); + pHelpLinker->main( args, &aStdStrExtensionPath, &aOfficeHelpPath ); + delete pHelpLinker; + } + catch( const HelpProcessingException& e ) + { + if( GpXMLParsingException != NULL ) + { + o_rHelpProcessingErrorInfo = *GpXMLParsingException; + delete GpXMLParsingException; + GpXMLParsingException = NULL; + } + else + { + o_rHelpProcessingErrorInfo = e; + } + bSuccess = false; + } + // Reset error handler + xmlSetStructuredErrorFunc( NULL, NULL ); + + // i83624: Tree files + ::rtl::OUString aTreeFileURL = aExtensionLanguageRoot; + aTreeFileURL += rtl::OUString::createFromAscii( "/help.tree" ); + osl::DirectoryItem aTreeFileItem; + osl::FileBase::RC rcGet = osl::DirectoryItem::get( aTreeFileURL, aTreeFileItem ); + osl::FileStatus aFileStatus( FileStatusMask_FileSize ); + if( rcGet == osl::FileBase::E_None && + aTreeFileItem.getFileStatus( aFileStatus ) == osl::FileBase::E_None && + aFileStatus.isValid( FileStatusMask_FileSize ) ) + { + sal_uInt64 ret, len = aFileStatus.getFileSize(); + char* s = new char[ int(len) ]; // the buffer to hold the installed files + osl::File aFile( aTreeFileURL ); + aFile.open( OpenFlag_Read ); + aFile.read( s, len, ret ); + aFile.close(); + + XML_Parser parser = XML_ParserCreate( 0 ); + int parsed = XML_Parse( parser, s, int( len ), true ); + + if( parsed == 0 ) + { + XML_Error nError = XML_GetErrorCode( parser ); + o_rHelpProcessingErrorInfo.m_eErrorClass = HELPPROCESSING_XMLPARSING_ERROR; + o_rHelpProcessingErrorInfo.m_aErrorMsg = rtl::OUString::createFromAscii( XML_ErrorString( nError ) );; + o_rHelpProcessingErrorInfo.m_aXMLParsingFile = aTreeFileURL; + // CRAHSES!!! o_rHelpProcessingErrorInfo.m_nXMLParsingLine = XML_GetCurrentLineNumber( parser ); + bSuccess = false; + } + + XML_ParserFree( parser ); + delete[] s; + } + + return bSuccess; +} + +// vnd.sun.star.help://swriter/52821?Language=en-US&System=UNIX +/* vi:set tabstop=4 shiftwidth=4 expandtab: */ + diff --git a/l10ntools/source/help/compilehelp.hxx b/l10ntools/source/help/compilehelp.hxx new file mode 100644 index 000000000000..d123d628be27 --- /dev/null +++ b/l10ntools/source/help/compilehelp.hxx @@ -0,0 +1,81 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: compilehelp.hxx,v $ + * $Revision: 1.3 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef COMPILE_HXX +#define COMPILE_HXX + +#include "sal/types.h" + +#if defined(HELPLINKER_DLLIMPLEMENTATION) +#define HELPLINKER_DLLPUBLIC SAL_DLLPUBLIC_EXPORT +#else +#define HELPLINKER_DLLPUBLIC SAL_DLLPUBLIC_IMPORT +#endif +#define HELPLINKER_DLLPRIVATE SAL_DLLPRIVATE + + +//#include +#include + +enum HelpProcessingErrorClass +{ + HELPPROCESSING_NO_ERROR, + HELPPROCESSING_GENERAL_ERROR, // Missing files, options etc. + HELPPROCESSING_INTERNAL_ERROR, // Unexpected problems + HELPPROCESSING_XMLPARSING_ERROR // Errors thrown by libxml +}; + +struct HelpProcessingErrorInfo +{ + HelpProcessingErrorClass m_eErrorClass; + rtl::OUString m_aErrorMsg; + rtl::OUString m_aXMLParsingFile; + sal_Int32 m_nXMLParsingLine; + + HelpProcessingErrorInfo( void ) + : m_eErrorClass( HELPPROCESSING_NO_ERROR ) + , m_nXMLParsingLine( -1 ) + {} + + HelpProcessingErrorInfo& operator=( const struct HelpProcessingException& e ); +}; + + +// Returns true in case of success, false in case of error +HELPLINKER_DLLPUBLIC bool compileExtensionHelp +( + const rtl::OUString& aOfficeHelpPath, + const rtl::OUString& aExtensionName, + const rtl::OUString& aExtensionLanguageRoot, + sal_Int32 nXhpFileCount, const rtl::OUString* pXhpFiles, + HelpProcessingErrorInfo& o_rHelpProcessingErrorInfo +); + +#endif diff --git a/l10ntools/source/help/helplinker.pmk b/l10ntools/source/help/helplinker.pmk new file mode 100644 index 000000000000..569c5f4dbdee --- /dev/null +++ b/l10ntools/source/help/helplinker.pmk @@ -0,0 +1,35 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2008 by Sun Microsystems, Inc. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# $RCSfile: helplinker.pmk,v $ +# +# $Revision: 1.4 $ +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +# define HELPLINKER_DLLIMPLEMENTATION (see @ inc/xmlhelp/helplinkerdllapi.h) +CDEFS += -DHELPLINKER_DLLIMPLEMENTATION + +VISIBILITY_HIDDEN=TRUE diff --git a/l10ntools/source/help/makefile.mk b/l10ntools/source/help/makefile.mk new file mode 100644 index 000000000000..57164004af8b --- /dev/null +++ b/l10ntools/source/help/makefile.mk @@ -0,0 +1,120 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2008 by Sun Microsystems, Inc. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.38 $ +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ = ..$/.. +PRJNAME = l10ntools +TARGET = HelpLinker +LIBBASENAME = helplinker +PACKAGE = com$/sun$/star$/help +TARGETTYPE=CUI + +# --- Settings ----------------------------------------------------- + +.INCLUDE : settings.mk +.INCLUDE : helplinker.pmk + +.IF "$(SYSTEM_LIBXSLT)" == "YES" +CFLAGS+= $(LIBXSLT_CFLAGS) +.ELSE +LIBXSLTINCDIR=external$/libxslt +CFLAGS+= -I$(SOLARINCDIR)$/$(LIBXSLTINCDIR) +.ENDIF + +.IF "$(SYSTEM_DB)" == "YES" +CFLAGS+=-DSYSTEM_DB -I$(DB_INCLUDES) +.ENDIF + +.IF "$(SYSTEM_EXPAT)" == "YES" +CFLAGS+=-DSYSTEM_EXPAT +.ENDIF + +OBJFILES=\ + $(OBJ)$/HelpLinker.obj \ + $(OBJ)$/HelpCompiler.obj +SLOFILES=\ + $(SLO)$/HelpLinker.obj \ + $(SLO)$/HelpCompiler.obj + +EXCEPTIONSFILES=\ + $(OBJ)$/HelpLinker.obj \ + $(OBJ)$/HelpCompiler.obj \ + $(SLO)$/HelpLinker.obj \ + $(SLO)$/HelpCompiler.obj +.IF "$(OS)" == "MACOSX" && "$(CPU)" == "P" && "$(COM)" == "GCC" +# There appears to be a GCC 4.0.1 optimization error causing _file:good() to +# report true right before the call to writeOut at HelpLinker.cxx:1.12 l. 954 +# but out.good() to report false right at the start of writeOut at +# HelpLinker.cxx:1.12 l. 537: +NOOPTFILES=\ + $(OBJ)$/HelpLinker.obj \ + $(SLO)$/HelpLinker.obj +.ENDIF + +APP1TARGET= $(TARGET) +APP1OBJS=\ + $(OBJ)$/HelpLinker.obj \ + $(OBJ)$/HelpCompiler.obj + +APP1STDLIBS+=$(SALLIB) $(BERKELEYLIB) $(XSLTLIB) $(EXPATASCII3RDLIB) + +SHL1TARGET =$(LIBBASENAME)$(DLLPOSTFIX) +SHL1LIBS= $(SLB)$/$(TARGET).lib +SHL1IMPLIB =i$(LIBBASENAME) +SHL1DEF =$(MISC)$/$(SHL1TARGET).def +SHL1STDLIBS =$(SALLIB) $(BERKELEYLIB) $(XSLTLIB) $(EXPATASCII3RDLIB) +SHL1USE_EXPORTS =ordinal + +DEF1NAME =$(SHL1TARGET) +DEFLIB1NAME =$(TARGET) + +JAVAFILES = \ + HelpIndexerTool.java \ + HelpFileDocument.java + + +JAVACLASSFILES = \ + $(CLASSDIR)$/$(PACKAGE)$/HelpIndexerTool.class \ + $(CLASSDIR)$/$(PACKAGE)$/HelpFileDocument.class + +.IF "$(SYSTEM_LUCENE)" == "YES" +CLASSPATH!:=$(CLASSPATH)$(PATH_SEPERATOR)$(LUCENE_CORE_JAR)$(PATH_SEPERATOR)$(LUCENE_ANALYZERS_JAR) +.ELSE +JARFILES += lucene-core-2.3.jar lucene-analyzers-2.3.jar +.ENDIF +JAVAFILES = $(subst,$(CLASSDIR)$/$(PACKAGE)$/, $(subst,.class,.java $(JAVACLASSFILES))) + +JARCLASSDIRS = $(PACKAGE)/* +JARTARGET = HelpIndexerTool.jar +JARCOMPRESS = TRUE + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk diff --git a/l10ntools/source/helpex.cxx b/l10ntools/source/helpex.cxx new file mode 100644 index 000000000000..8f0b6c1d218f --- /dev/null +++ b/l10ntools/source/helpex.cxx @@ -0,0 +1,299 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: helpex.cxx,v $ + * $Revision: 1.14 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_l10ntools.hxx" +#include +#include + +// local includes +#include "helpmerge.hxx" + +// defines to parse command line +#define STATE_NON 0x0001 +#define STATE_INPUT 0x0002 +#define STATE_OUTPUT 0x0003 +#define STATE_PRJ 0x0004 +#define STATE_ROOT 0x0005 +#define STATE_SDFFILE 0x0006 +#define STATE_ERRORLOG 0x0007 +#define STATE_BREAKHELP 0x0008 +#define STATE_UNMERGE 0x0009 +#define STATE_UTF8 0x000A +#define STATE_LANGUAGES 0x000B +#define STATE_FORCE_LANGUAGES 0x000C +#define STATE_OUTPUTX 0xfe +#define STATE_OUTPUTY 0xff + +// set of global variables +ByteString sInputFile; +BOOL bEnableExport; +BOOL bMergeMode; +BOOL bErrorLog; +BOOL bUTF8; +ByteString sPrj; +ByteString sPrjRoot; +ByteString sOutputFile; +ByteString sOutputFileX; +ByteString sOutputFileY; +ByteString sSDFFile; +bool bQuiet; + +/*****************************************************************************/ +BOOL ParseCommandLine( int argc, char* argv[]) +/*****************************************************************************/ +{ + bEnableExport = FALSE; + bMergeMode = FALSE; + bErrorLog = TRUE; + bUTF8 = TRUE; + sPrj = ""; + sPrjRoot = ""; + bQuiet = false; + Export::sLanguages = ""; + Export::sForcedLanguages = ""; + + USHORT nState = STATE_NON; + BOOL bInput = FALSE; + + // parse command line + for( int i = 1; i < argc; i++ ) { + if ( ByteString( argv[ i ]).ToUpperAscii() == "-I" ) { + nState = STATE_INPUT; // next tokens specifies source files + } + else if ( ByteString( argv[ i ]).ToUpperAscii() == "-O" ) { + nState = STATE_OUTPUT; // next token specifies the dest file + } + else if ( ByteString( argv[ i ]).ToUpperAscii() == "-X" ) { + nState = STATE_OUTPUTX; // next token specifies the dest file + } + else if ( ByteString( argv[ i ]).ToUpperAscii() == "-Y" ) { + nState = STATE_OUTPUTY; // next token specifies the dest file + } + else if ( ByteString( argv[ i ]).ToUpperAscii() == "-P" ) { + nState = STATE_PRJ; // next token specifies the cur. project + } + else if ( ByteString( argv[ i ]).ToUpperAscii() == "-LF" ) { + nState = STATE_FORCE_LANGUAGES; + } + + else if ( ByteString( argv[ i ]).ToUpperAscii() == "-R" ) { + nState = STATE_ROOT; // next token specifies path to project root + } + else if ( ByteString( argv[ i ]).ToUpperAscii() == "-M" ) { + nState = STATE_SDFFILE; // next token specifies the merge database + } + else if ( ByteString( argv[ i ]).ToUpperAscii() == "-E" ) { + nState = STATE_ERRORLOG; + bErrorLog = FALSE; + } + else if ( ByteString( argv[ i ] ).ToUpperAscii() == "-QQ" ) { + bQuiet = true; + } + else if ( ByteString( argv[ i ]).ToUpperAscii() == "-UTF8" ) { + nState = STATE_UTF8; + bUTF8 = TRUE; + } + else if ( ByteString( argv[ i ]).ToUpperAscii() == "-NOUTF8" ) { + nState = STATE_UTF8; + bUTF8 = FALSE; + } + else if ( ByteString( argv[ i ]).ToUpperAscii() == "-L" ) { + nState = STATE_LANGUAGES; + } + else { + switch ( nState ) { + case STATE_NON: { + return FALSE; // no valid command line + } + //break; + case STATE_INPUT: { + sInputFile = argv[ i ]; + bInput = TRUE; // source file found + } + break; + case STATE_OUTPUT: { + sOutputFile = argv[ i ]; // the dest. file + } + break; + case STATE_OUTPUTX: { + sOutputFileX = argv[ i ]; // the dest. file + } + break; + case STATE_OUTPUTY: { + sOutputFileY = argv[ i ]; // the dest. file + } + break; + case STATE_PRJ: { + sPrj = argv[ i ]; +// sPrj.ToLowerAscii(); // the project + } + break; + case STATE_ROOT: { + sPrjRoot = argv[ i ]; // path to project root + } + break; + case STATE_SDFFILE: { + sSDFFile = argv[ i ]; + bMergeMode = TRUE; // activate merge mode, cause merge database found + } + break; + case STATE_LANGUAGES: { + Export::sLanguages = argv[ i ]; + } + case STATE_FORCE_LANGUAGES:{ + Export::sForcedLanguages = argv[ i ]; + } + break; + } + } + } + + if ( bInput ) { + // command line is valid + bEnableExport = TRUE; + return TRUE; + } + + // command line is not valid + return FALSE; +} + + +/*****************************************************************************/ +void Help() +/*****************************************************************************/ +{ + fprintf( stdout, "Syntax: HELPEX[-p Prj][-r PrjRoot]-i FileIn ( -o FileOut | -x path -y relfile )[-m DataBase][-e][-b][-u][-L l1,l2,...][-QQ] -LF l1,l2 \n" ); + fprintf( stdout, " Prj: Project\n" ); + fprintf( stdout, " PrjRoot: Path to project root (..\\.. etc.)\n" ); + fprintf( stdout, " FileIn: Source file (*.lng)\n" ); + fprintf( stdout, " FileOut: Destination file (*.*)\n" ); + fprintf( stdout, " DataBase: Mergedata (*.sdf)\n" ); + fprintf( stdout, " -QQ: quiet output\n" ); + fprintf( stdout, " -L: Restrict the handled languages. l1,l2,... are elements of (en-US,fr,de...)\n" ); + fprintf( stdout, " A fallback language can be defined like this: l1=f1.\n" ); + fprintf( stdout, " f1, f2,... are also elements of (en-US,fr,de...)\n" ); + fprintf( stdout, " Example: -L fr=en-US\n" ); + fprintf( stdout, " Restriction to fr, en-US will be fallback for fr\n" ); + fprintf( stdout, " -LF: Force the creation of that languages\n" ); + +} + +/*****************************************************************************/ +#ifndef TESTDRIVER + +#if defined(UNX) || defined(OS2) +int main( int argc, char *argv[] ) +#else +int _cdecl main( int argc, char *argv[] ) +#endif +/*****************************************************************************/ +{ + + if ( !ParseCommandLine( argc, argv )) { + Help(); + return 1; + } + //sal_uInt32 startfull = Export::startMessure(); + + bool hasInputList = sInputFile.GetBuffer()[0]=='@'; +// printf("x = %s , y = %s , o = %s\n", sOutputFileX.GetBuffer(), sOutputFileY.GetBuffer() , sOutputFile.GetBuffer() ); + bool hasNoError = true; + + if ( sOutputFile.Len() ){ // Merge single file ? + //printf("DBG: Inputfile = %s\n",sInputFile.GetBuffer()); + HelpParser aParser( sInputFile, bUTF8 , false ); + + if ( bMergeMode ) + { + + //sal_uInt64 startreadloc = Export::startMessure(); + MergeDataFile aMergeDataFile( sSDFFile, sInputFile , FALSE, RTL_TEXTENCODING_MS_1252 ); + //MergeDataFile aMergeDataFile( sSDFFile, sInputFile , FALSE, RTL_TEXTENCODING_MS_1252, false ); + //Export::stopMessure( ByteString("read localize.sdf") , startreadloc ); + + hasNoError = aParser.Merge( sSDFFile, sOutputFile , Export::sLanguages , aMergeDataFile ); + } + else + hasNoError = aParser.CreateSDF( sOutputFile, sPrj, sPrjRoot, sInputFile, new XMLFile( '0' ), "help" ); + }else if ( sOutputFileX.Len() && sOutputFileY.Len() && hasInputList ) { // Merge multiple files ? + if ( bMergeMode ){ + + ifstream aFStream( sInputFile.Copy( 1 , sInputFile.Len() ).GetBuffer() , ios::in ); + + if( !aFStream ){ + cerr << "ERROR: - helpex - Can't open the file " << sInputFile.Copy( 1 , sInputFile.Len() ).GetBuffer() << "\n"; + exit(-1); + } + + vector filelist; + rtl::OStringBuffer filename; + sal_Char aChar; + while( aFStream.get( aChar ) ) + { + if( aChar == ' ' || aChar == '\n') + filelist.push_back( ByteString( filename.makeStringAndClear().getStr() ) ); + else + filename.append( aChar ); + } + if( filename.getLength() > 0 ) + filelist.push_back( ByteString ( filename.makeStringAndClear().getStr() ) ); + + aFStream.close(); + ByteString sHelpFile(""); // dummy + //MergeDataFile aMergeDataFile( sSDFFile, sHelpFile , FALSE, RTL_TEXTENCODING_MS_1252, false ); + MergeDataFile aMergeDataFile( sSDFFile, sHelpFile , FALSE, RTL_TEXTENCODING_MS_1252 ); + + //aMergeDataFile.Dump(); + std::vector aLanguages; + HelpParser::parse_languages( aLanguages , aMergeDataFile ); + + bool bCreateDir = true; + for( vector::iterator pos = filelist.begin() ; pos != filelist.end() ; ++pos ) + { + sHelpFile = *pos; + cout << ".";cout.flush(); + + HelpParser aParser( sHelpFile , bUTF8 , true ); + hasNoError = aParser.Merge( sSDFFile , sOutputFileX , sOutputFileY , true , aLanguages , aMergeDataFile , bCreateDir ); + bCreateDir = false; + } + } + } else + cerr << "helpex ERROR: Wrong input parameters!\n"; + + //Export::stopMessure( ByteString("full cycle") , startfull ); + if( hasNoError ) + return 0; + else + return 1; +} +#endif diff --git a/l10ntools/source/helpmerge.cxx b/l10ntools/source/helpmerge.cxx new file mode 100644 index 000000000000..84d73e94f312 --- /dev/null +++ b/l10ntools/source/helpmerge.cxx @@ -0,0 +1,730 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: helpmerge.cxx,v $ + * $Revision: 1.24 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_l10ntools.hxx" +#include +#include +// local includes +#include +#include +#include "helpmerge.hxx" +#include "utf8conv.hxx" +#include +#include +#include +#include +#include +#include +#include "rtl/strbuf.hxx" +#ifdef WNT +#include +//#include +#include "tools/prewin.h" +#include +#include "tools/postwin.h" +#endif + +/*****************************************************************************/ +void HelpParser::FillInFallbacks( LangHashMap& rElem_out, ByteString sLangIdx_in ){ +/*****************************************************************************/ + static const ByteString ENGLISH_LANGUAGECODE( "en-US" ); + static const ByteString GERMAN_LANGUAGECODE ( "de" ); + ByteString sCur; + XMLElement* pTmp = NULL; + XMLElement* pTmp2 = NULL; + + sCur = sLangIdx_in; + ByteString sFallback( sCur ); + GetIsoFallback( sFallback ); + if( (rElem_out.find( sFallback ) != rElem_out.end()) && rElem_out[ sFallback ] != NULL ){ + pTmp2 = rElem_out[ sFallback ]; + pTmp = new XMLElement( *pTmp2 ) ; // Copy + pTmp->SetPos( pTmp2->GetPos()+1 ); + pTmp->ChangeLanguageTag( String( sLangIdx_in , RTL_TEXTENCODING_ASCII_US) ); + rElem_out[ sLangIdx_in ] = pTmp; + pTmp2 = NULL; + } + else if( (rElem_out.find( ENGLISH_LANGUAGECODE ) != rElem_out.end()) && rElem_out[ ENGLISH_LANGUAGECODE ] != NULL ){// No English + pTmp2 = rElem_out[ ENGLISH_LANGUAGECODE ]; + pTmp = new XMLElement( *pTmp2 ) ; // Copy + pTmp->SetPos( pTmp2->GetPos()+1 ); + pTmp->ChangeLanguageTag( String( sLangIdx_in , RTL_TEXTENCODING_ASCII_US) ); + rElem_out[ sCur ] = pTmp; + pTmp2 = NULL; + } + else if( (rElem_out.find( GERMAN_LANGUAGECODE ) != rElem_out.end() ) && rElem_out[ GERMAN_LANGUAGECODE ] != NULL ){// No English + pTmp2 = rElem_out[ GERMAN_LANGUAGECODE ]; + pTmp = new XMLElement( *pTmp2 ); // Copy + pTmp->SetPos( pTmp2->GetPos()+1 ); + pTmp->ChangeLanguageTag( String( sLangIdx_in , RTL_TEXTENCODING_ASCII_US ) ); + rElem_out[ sCur ] = pTmp; + pTmp2 = NULL; + }else{ + fprintf(stdout,"ERROR: No Fallback found for language %s:\n",sCur.GetBuffer()); + rElem_out[ sCur ]=new XMLElement(); // Use dummy element + } +} + +/*****************************************************************************/ +void HelpParser::Dump(XMLHashMap* rElem_in) { +/*****************************************************************************/ + for(XMLHashMap::iterator pos = rElem_in->begin();pos != rElem_in->end(); ++pos){ + Dump(pos->second,pos->first); + } +} +/*****************************************************************************/ +void HelpParser::Dump(LangHashMap* rElem_in,const ByteString sKey_in) { +/*****************************************************************************/ + ByteString x; + OString y; + fprintf(stdout,"+------------%s-----------+\n",sKey_in.GetBuffer() ); + for(LangHashMap::iterator posn=rElem_in->begin();posn!=rElem_in->end();++posn){ + x=posn->first; + y=posn->second->ToOString(); + fprintf(stdout,"key=%s value=%s\n",x.GetBuffer(),y.getStr()); + } + fprintf(stdout,"+--------------------------+\n"); +} + +HelpParser::HelpParser( const ByteString &rHelpFile, bool rUTF8 , bool rHasInputList ) + : sHelpFile( rHelpFile ), + bUTF8 ( rUTF8 ), + bHasInputList( rHasInputList ) + {}; + +/*****************************************************************************/ +bool HelpParser::CreateSDF( +/*****************************************************************************/ + const ByteString &rSDFFile_in, const ByteString &rPrj_in,const ByteString &rRoot_in, + const ByteString &sHelpFile, XMLFile *pXmlFile, const ByteString &rGsi1){ + // GSI File constants + static const String GSI_SEQUENCE1( String::CreateFromAscii("\t0\t") ); + static const String GSI_SEQUENCE2( String::CreateFromAscii("\t\t\t0\t") ); + static const String GSI_TAB ( String::CreateFromAscii("\t") ); + static const String GSI_SEQUENCE4( String::CreateFromAscii("\t\t\t\t") ); + static const String ret ( String::CreateFromAscii("\n") ); + static const String ret_char ( String::CreateFromAscii("") ); + static const String tab ( String::CreateFromAscii("\t") ); + static const String tab_char ( String::CreateFromAscii("") ); + + SimpleXMLParser aParser; + String sUsedTempFile; + String sXmlFile; + + if( Export::fileHasUTF8ByteOrderMarker( sHelpFile ) ){ + DirEntry aTempFile = Export::GetTempFile(); + DirEntry aSourceFile( String( sHelpFile , RTL_TEXTENCODING_ASCII_US ) ); + aSourceFile.CopyTo( aTempFile , FSYS_ACTION_COPYFILE ); + String sTempFile = aTempFile.GetFull(); + Export::RemoveUTF8ByteOrderMarkerFromFile( ByteString( sTempFile , RTL_TEXTENCODING_ASCII_US ) ); + sUsedTempFile = sTempFile; + sXmlFile = sTempFile; + }else{ + sUsedTempFile = String::CreateFromAscii(""); + sXmlFile = String( sHelpFile , RTL_TEXTENCODING_ASCII_US ); + } + +// ByteString fullFilePath; + //DirEntry aFile( sXmlFile ); + //makeAbsolutePath( sHelpFile , rRoot_in); + ByteString fullFilePath = rPrj_in; + fullFilePath.Append( "\\" ); + fullFilePath.Append( makeAbsolutePath( sHelpFile , rRoot_in ) ); + fullFilePath.SearchAndReplaceAll( "\\", "/" ); + + String strFullPath( fullFilePath.GetBuffer() , RTL_TEXTENCODING_ASCII_US ); + + //printf( "%s\n", fullFilePath.GetBuffer() ); + std::auto_ptr file ( aParser.Execute( strFullPath , sXmlFile, pXmlFile ) ); + + if(file.get() == NULL){ + printf("%s\n",ByteString(aParser.GetError().sMessage,RTL_TEXTENCODING_ASCII_US).GetBuffer()); + exit(-1); + //return false; + } + file->Extract(); + if( !file->CheckExportStatus() ){ + return true; + } + SvFileStream aSDFStream( String( rSDFFile_in, RTL_TEXTENCODING_ASCII_US ), + STREAM_STD_WRITE | STREAM_TRUNC ); + + if ( !aSDFStream.IsOpen()) { + fprintf(stdout,"Can't open file %s\n",rSDFFile_in.GetBuffer()); + return false; + } + + ByteString sActFileName = makeAbsolutePath( sHelpFile , rRoot_in ); + +/* DirEntry aEntry( String( sHelpFile, RTL_TEXTENCODING_ASCII_US )); + aEntry.ToAbs(); + String sFullEntry = aEntry.GetFull(); + aEntry += DirEntry( String( "..", RTL_TEXTENCODING_ASCII_US )); + aEntry += DirEntry( rRoot_in ); + ByteString sPrjEntry( aEntry.GetFull(), gsl_getSystemTextEncoding()); + ByteString sActFileName( + sFullEntry.Copy( sPrjEntry.Len() + 1 ), gsl_getSystemTextEncoding()); + + sActFileName.SearchAndReplaceAll( "/", "\\" ); +*/ + XMLHashMap* aXMLStrHM = file->GetStrings(); + LangHashMap* pElem; + XMLElement* pXMLElement = NULL; + + //Dump(aXMLStrHM); + + ByteString sTimeStamp( Export::GetTimeStamp() ); + OUString sOUTimeStamp( sTimeStamp.GetBuffer() , sTimeStamp.Len() , RTL_TEXTENCODING_ASCII_US ); + + OUStringBuffer sBuffer; + const OUString sOUPrj( rPrj_in.GetBuffer() , rPrj_in.Len() , RTL_TEXTENCODING_ASCII_US ); + const OUString sOUActFileName(sActFileName.GetBuffer() , sActFileName.Len() , RTL_TEXTENCODING_ASCII_US ); + const OUString sOUGsi1( rGsi1.GetBuffer() , rGsi1.Len() , RTL_TEXTENCODING_ASCII_US ); + + Export::InitLanguages( false ); + std::vector aLanguages = Export::GetLanguages(); + + std::vector order = file->getOrder(); + std::vector::iterator pos; + XMLHashMap::iterator posm; + + for( pos = order.begin(); pos != order.end() ; ++pos ) + { + posm = aXMLStrHM->find( *pos ); + pElem = posm->second; + ByteString sCur; + + for( unsigned int n = 0; n < aLanguages.size(); n++ ) + { + sCur = aLanguages[ n ]; + if(pElem->find( sCur )==pElem->end()) + { + FillInFallbacks( *pElem , sCur ); + } + pXMLElement = (*pElem)[ sCur ]; + + if( pXMLElement != NULL ) + { + OUString data = pXMLElement->ToOUString(); + String sTmp = String(data.getStr()); + sTmp.SearchAndReplaceAll(ret,ret_char); // Remove \n + sTmp.SearchAndReplaceAll(tab,tab_char); // Remove \t + + data = OUString( sTmp ); + sBuffer.append( sOUPrj ); + sBuffer.append( GSI_TAB ); //"\t"; + if ( rRoot_in.Len()) + sBuffer.append( sOUActFileName ); + sBuffer.append( GSI_SEQUENCE1 ); //"\t0\t"; + sBuffer.append( sOUGsi1 ); //"help"; + sBuffer.append( GSI_TAB ); //"\t"; + ByteString sID = posm->first; // ID + sBuffer.append( OUString( sID.GetBuffer() , sID.Len() , RTL_TEXTENCODING_UTF8 ) ); + sBuffer.append( GSI_TAB ); //"\t"; + ByteString sOldRef = pXMLElement->GetOldref(); // oldref + sBuffer.append( OUString(sOldRef.GetBuffer() , sOldRef.Len() , RTL_TEXTENCODING_UTF8 ) ); + sBuffer.append( GSI_SEQUENCE2 ); //"\t\t\t0\t"; + sBuffer.append( OUString( sCur.GetBuffer() , sCur.Len() , RTL_TEXTENCODING_UTF8 ) ); + sBuffer.append( GSI_TAB ); //"\t"; + sBuffer.append( data ); + sBuffer.append( GSI_SEQUENCE4 ); //"\t\t\t\t"; + sBuffer.append( sOUTimeStamp ); + ByteString sOut( sBuffer.makeStringAndClear().getStr() , RTL_TEXTENCODING_UTF8 ); + //if( !sCur.EqualsIgnoreCaseAscii("de") ||( sCur.EqualsIgnoreCaseAscii("de") && !Export::isMergingGermanAllowed( rPrj_in ) ) ) + //{ + if( data.getLength() > 0 ) aSDFStream.WriteLine( sOut ); + //} + pXMLElement=NULL; + }else fprintf(stdout,"\nDBG: NullPointer in HelpParser::CreateSDF , Language %s\n",sCur.GetBuffer() ); + } + + } + //Dump(aXMLStrHM); + aSDFStream.Close(); + + if( !sUsedTempFile.EqualsIgnoreCaseAscii( "" ) ){ + DirEntry aTempFile( sUsedTempFile ); + aTempFile.Kill(); + } + return TRUE; +} + +ByteString HelpParser::makeAbsolutePath( const ByteString& sHelpFile , const ByteString& rRoot_in ) +{ + DirEntry aEntry( String( sHelpFile, RTL_TEXTENCODING_ASCII_US )); + aEntry.ToAbs(); + String sFullEntry = aEntry.GetFull(); + aEntry += DirEntry( String( "..", RTL_TEXTENCODING_ASCII_US )); + aEntry += DirEntry( rRoot_in ); + ByteString sPrjEntry( aEntry.GetFull(), gsl_getSystemTextEncoding()); + ByteString sActFileName( + sFullEntry.Copy( sPrjEntry.Len() + 1 ), gsl_getSystemTextEncoding()); + + sActFileName.SearchAndReplaceAll( "/", "\\" ); + return sActFileName; +} +bool HelpParser::Merge( const ByteString &rSDFFile, const ByteString &rDestinationFile , + ByteString& sLanguage , MergeDataFile& aMergeDataFile ) +{ + + (void) rSDFFile; + bool hasNoError = true; + + SimpleXMLParser aParser; + + String sUsedTempFile; + String sXmlFile; + + if( Export::fileHasUTF8ByteOrderMarker( sHelpFile ) ){ + DirEntry aTempFile = Export::GetTempFile(); + DirEntry aSourceFile( String( sHelpFile , RTL_TEXTENCODING_ASCII_US ) ); + aSourceFile.CopyTo( aTempFile , FSYS_ACTION_COPYFILE ); + String sTempFile = aTempFile.GetFull(); + Export::RemoveUTF8ByteOrderMarkerFromFile( ByteString( sTempFile , RTL_TEXTENCODING_ASCII_US ) ); + sUsedTempFile = sTempFile; + sXmlFile = sTempFile; + }else{ + sUsedTempFile = String::CreateFromAscii(""); + sXmlFile = String( sHelpFile , RTL_TEXTENCODING_ASCII_US ); + } + + OUString sOUHelpFile( sXmlFile ); + String fullFilePath; + DirEntry aFile( sXmlFile ); + + XMLFile* xmlfile = ( aParser.Execute( aFile.GetFull() , sOUHelpFile, new XMLFile( '0' ) ) ); + printf("Dest file %s\n",rDestinationFile.GetBuffer()); + hasNoError = MergeSingleFile( xmlfile , aMergeDataFile , sLanguage , rDestinationFile ); + delete xmlfile; + if( !sUsedTempFile.EqualsIgnoreCaseAscii( "" ) ){ + DirEntry aTempFile( sUsedTempFile ); + aTempFile.Kill(); + } + return hasNoError; +} + +bool ByteStringEqual( const ByteString& rKey1, const ByteString& rKey2 ) { + return rKey1.CompareTo( rKey2 )==COMPARE_EQUAL; +}; +bool ByteStringLess( const ByteString& rKey1, const ByteString& rKey2 ) { + return rKey1.CompareTo( rKey2 )==COMPARE_LESS; +} + +void HelpParser::parse_languages( std::vector& aLanguages , MergeDataFile& aMergeDataFile ){ + std::vector aTmp; + + const ByteString DE ("de"); + const ByteString ENUS ("en-US"); + static const ByteString ALL( "ALL" ); + + Export::InitLanguages( false ); + + if( Export::sLanguages.EqualsIgnoreCaseAscii( ALL ) ) + { + aLanguages = aMergeDataFile.GetLanguages(); + aLanguages.push_back( DE ); + aLanguages.push_back( ENUS ); + + if( !Export::sForcedLanguages.Equals("") ) + { + std::vector aFL = Export::GetForcedLanguages(); + std::copy( aFL.begin() , + aFL.end() , + back_inserter( aLanguages ) + ); + std::sort( aLanguages.begin() , aLanguages.end() , ByteStringLess ); + std::vector::iterator unique_iter = std::unique( aLanguages.begin() , aLanguages.end() , ByteStringEqual ); + std::copy( aLanguages.begin() , unique_iter , back_inserter( aTmp ) ); + aLanguages = aTmp; + } + } + else{ + aLanguages = Export::GetLanguages(); + } + +} + +bool HelpParser::Merge( + const ByteString &rSDFFile, const ByteString &rPathX , const ByteString &rPathY , bool bISO , + const std::vector& aLanguages , MergeDataFile& aMergeDataFile , bool bCreateDir ) +{ + + + (void) rSDFFile ; + bool hasNoError = true; + SimpleXMLParser aParser; + String sUsedTempFile; + String sXmlFile; + + if( Export::fileHasUTF8ByteOrderMarker( sHelpFile ) ) + { + DirEntry aTempFile = Export::GetTempFile(); + DirEntry aSourceFile( String( sHelpFile , RTL_TEXTENCODING_ASCII_US ) ); + aSourceFile.CopyTo( aTempFile , FSYS_ACTION_COPYFILE ); + String sTempFile = aTempFile.GetFull(); + Export::RemoveUTF8ByteOrderMarkerFromFile( ByteString( sTempFile , RTL_TEXTENCODING_ASCII_US ) ); + sUsedTempFile = sTempFile; + sXmlFile = sTempFile; + } + else + { + sUsedTempFile = String::CreateFromAscii(""); + sXmlFile = String( sHelpFile , RTL_TEXTENCODING_ASCII_US ); + } + + + OUString sOUHelpFile( sXmlFile ); + String fullFilePath; + DirEntry aFile( sXmlFile ); + + XMLFile* xmlfile = ( aParser.Execute( aFile.GetFull() , sOUHelpFile, new XMLFile( '0' ) ) ); + xmlfile->Extract(); + + if( xmlfile == NULL) + { + printf("%s\n",ByteString(aParser.GetError().sMessage,RTL_TEXTENCODING_UTF8).GetBuffer()); + exit(-1); + //return false; + } + + + ByteString sCur; + for( unsigned int n = 0; n < aLanguages.size(); n++ ){ + sCur = aLanguages[ n ]; + + ByteString sFilepath; + if( bISO ) sFilepath = GetOutpath( rPathX , sCur , rPathY ); + else sFilepath = rPathX; + if( bCreateDir ) MakeDir( sFilepath ); + + XMLFile* file = new XMLFile( *xmlfile ); + sFilepath.Append( sHelpFile ); + hasNoError = MergeSingleFile( file , aMergeDataFile , sCur , sFilepath ); + delete file; + + if( !hasNoError ) return false; // Stop on error + } + + if( !sUsedTempFile.EqualsIgnoreCaseAscii( "" ) ) + { + DirEntry aTempFile( sUsedTempFile ); + aTempFile.Kill(); + } + delete xmlfile; + return hasNoError; +} + +bool HelpParser::MergeSingleFile( XMLFile* file , MergeDataFile& aMergeDataFile , const ByteString& sLanguage , + ByteString sPath ) +{ + file->Extract(); + + XMLHashMap* aXMLStrHM = file->GetStrings(); + LangHashMap* aLangHM; + static ResData pResData( "","",""); + pResData.sResTyp = "help"; + + ByteString sTmp = Export::sLanguages; + + sTmp.EraseLeadingAndTrailingChars(); + + for(XMLHashMap::iterator pos=aXMLStrHM->begin();pos!=aXMLStrHM->end();++pos) // Merge every l10n related string + { + + aLangHM = pos->second; + //printf("*********************DUMPING HASHMAP***************************************"); + //Dump( aXMLStrHM ); + //printf("DBG: sHelpFile = %s\n",sHelpFile.GetBuffer() ); + + pResData.sGId = pos->first; + pResData.sFilename = sHelpFile; + + ProcessHelp( aLangHM , sLanguage, &pResData , aMergeDataFile ); + } + + + // Init temp and target file + ByteString sTempFile; + ByteString sTargetFile( sPath ); + ByteString sTempFileCopy; + + static const ByteString INPATH = Export::GetEnv( "INPATH" ); + Export::getRandomName( sPath , sTempFile , INPATH ); + Export::getRandomName( sPath , sTempFileCopy , INPATH ); + // Write in the temp file + bool hasNoError = file->Write ( sTempFile ); + if( !hasNoError ) + { + cerr << "ERROR: file->Write failed\n"; + return false; + } + + DirEntry aTmp( sTempFile ); + DirEntry aTmp2( sTempFileCopy ); + DirEntry aTar( sTargetFile ); + + if( !Export::CopyFile( sTempFile , sTempFileCopy ) ) + { +#if defined(UNX) || defined(OS2) + sleep( 3 ); +#else + Sleep( 3 ); +#endif + if( !Export::CopyFile( sTempFile , sTempFileCopy ) ) + { + cerr << "ERROR: Can not copy file from " << sTempFile.GetBuffer() << " to " << sTempFileCopy.GetBuffer() << "\n"; + return false; + } + } + //remove( sTargetFile.GetBuffer() ); + + FileStat aFSTest( aTar ); + if( aFSTest.GetSize() < 1 ) + { + remove( sTargetFile.GetBuffer() ); + } + int rc; +#if defined(UNX) || defined(OS2) + rc = rename( sTempFile.GetBuffer() , sTargetFile.GetBuffer() ); +#else + rc = MoveFileEx( sTempFile.GetBuffer() , sTargetFile.GetBuffer(), MOVEFILE_REPLACE_EXISTING ); +#endif + FileStat aFS( aTar ); + + //cout << "mv " << sTempFile.GetBuffer() << " " << sTargetFile.GetBuffer() << "\n"; + //cout << "rc -> " << rc << " filesize -> " << aFS.GetSize() << "\n"; +// Windows rename returns -1 if the file already exits +//#ifdef UNX + if( rc < 0 || aFS.GetSize() < 1 ) +//#else +// if( aFS.GetSize() < 1 ) +//#endif + { +#if defined(UNX) || defined(OS2) + sleep( 3 ); +#else + Sleep( 3 ); +#endif + aFSTest.Update( aTar ); + if( aFSTest.GetSize() < 1 ) + { + remove( sTargetFile.GetBuffer() ); + } +#if defined(UNX) || defined(OS2) + rc = rename( sTempFileCopy.GetBuffer() , sTargetFile.GetBuffer() ); +#else + rc = MoveFileEx( sTempFileCopy.GetBuffer() , sTargetFile.GetBuffer() , MOVEFILE_REPLACE_EXISTING ); +#endif + aFS.Update( aTar ); + + //cout << "mv2 " << sTempFileCopy.GetBuffer() << " " << sTargetFile.GetBuffer() << "\n"; + //cout << "rc -> " << rc << " filesize -> " << aFS.GetSize() << "\n"; + +// Windows rename returns -1 if the file already exits +//#ifdef WNT +// if( aFS.GetSize() < 1 ) +//#else + if( rc < 0 || aFS.GetSize() < 1 ) +//#endif + { + cerr << "ERROR: helpex Can't rename file " << sTempFileCopy.GetBuffer() << " to " << sTargetFile.GetBuffer() << " rename rc=" << rc << " filesize=" << aFS.GetSize() << "\n"; + aTmp.Kill(); + aTmp2.Kill(); + if( aFS.GetSize() < 1 ) + aTar.Kill(); + return false; + } + } + aTmp.Kill(); + aTmp2.Kill(); + + return true; +} + +ByteString HelpParser::GetOutpath( const ByteString& rPathX , const ByteString& sCur , const ByteString& rPathY ){ + ByteString testpath = rPathX; + static const ByteString sDelimiter( DirEntry::GetAccessDelimiter(), RTL_TEXTENCODING_ASCII_US ); + testpath.EraseTrailingChars( '/' ); + testpath.EraseTrailingChars( '\\' ); + testpath += sDelimiter; + testpath += sCur; + testpath += sDelimiter; + ByteString sRelativePath( rPathY ); + sRelativePath.EraseLeadingChars( '/' ); + sRelativePath.EraseLeadingChars( '\\' ); + testpath += sRelativePath; + testpath += sDelimiter; + return testpath; +} +void HelpParser::MakeDir( const ByteString& sPath ){ + ByteString sTPath( sPath ); + ByteString sDelimiter( DirEntry::GetAccessDelimiter(), RTL_TEXTENCODING_ASCII_US ); + sTPath.SearchAndReplaceAll( sDelimiter , '/' ); + USHORT cnt = sTPath.GetTokenCount( '/' ); + ByteString sCreateDir; + for( USHORT i = 0 ; i < cnt ; i++ ) + { + sCreateDir += sTPath.GetToken( i , '/' ); + sCreateDir += sDelimiter; +#ifdef WNT + _mkdir( sCreateDir.GetBuffer() ); +#else + mkdir( sCreateDir.GetBuffer() , S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH ); +#endif + } +} + + +/* ProcessHelp Methode: search for en-US entry and replace it with the current language*/ +void HelpParser::ProcessHelp( LangHashMap* aLangHM , const ByteString& sCur , ResData *pResData , MergeDataFile& aMergeDataFile ){ + + XMLElement* pXMLElement = NULL; + PFormEntrys *pEntrys = NULL; + XMLData *data = NULL; + XMLParentNode *parent = NULL; + + String sNewdata; + ByteString sLId; + ByteString sGId; + + pEntrys = NULL; + +#ifdef MERGE_SOURCE_LANGUAGES + if( true ){ // Merge en-US! +#else + if( !sCur.EqualsIgnoreCaseAscii("en-US") ){ +#endif + pXMLElement = (*aLangHM)[ "en-US" ]; + if( pXMLElement == NULL ) + { + printf("Error: Can't find en-US entry\n"); + } + if( pXMLElement != NULL ) + { + parent = pXMLElement->GetParent(); + sLId = pXMLElement->GetOldref(); + pResData->sId = sLId; + + pEntrys = aMergeDataFile.GetPFormEntrys( pResData ); + if( pEntrys != NULL) + { + ByteString sNewText; + pEntrys->GetText( sNewText, STRING_TYP_TEXT, sCur , true ); + sNewdata = String( sNewText , RTL_TEXTENCODING_UTF8 ); + if ( sNewdata.Len()) + { + if( pXMLElement != NULL ) + { + data = new XMLData( sNewdata , NULL , true ); // Add new one + pXMLElement->RemoveAndDeleteAllChilds(); + pXMLElement->AddChild( data ); + aLangHM->erase( sCur ); + } + } + }else if( pResData == NULL ){fprintf(stdout,"Can't find GID=%s LID=%s TYP=%s\n",pResData->sGId.GetBuffer(),pResData->sId.GetBuffer(),pResData->sResTyp.GetBuffer());} + pXMLElement->ChangeLanguageTag( String( sCur , RTL_TEXTENCODING_ASCII_US) ); + } + + } +} +/* Process() Method merges */ +void HelpParser::Process( LangHashMap* aLangHM , const ByteString& sCur , ResData *pResData , MergeDataFile& aMergeDataFile ){ + + XMLElement* pXMLElement = NULL; + PFormEntrys *pEntrys = NULL; + XMLData *data = NULL; + XMLParentNode *parent = NULL; + XMLDefault *xmldefault = NULL; + + short curLang = 0; + String sNewdata; + bool isFallback = false; + ByteString sLId; + ByteString sGId; + + pEntrys = NULL; + +#ifdef MERGE_SOURCE_LANGUAGES + if( true ){ // Merge en-US! +#else + if( !sCur.EqualsIgnoreCaseAscii("en-US") ){ +#endif + pXMLElement = (*aLangHM)[ sCur ]; + if( pXMLElement == NULL ) + { + FillInFallbacks( *aLangHM , sCur ); + pXMLElement = ( *aLangHM )[ sCur ]; + isFallback = true; + } + if( pXMLElement != NULL ) + { + parent = pXMLElement->GetParent(); + sLId = pXMLElement->GetOldref(); + pResData->sId = sLId; + + pEntrys = aMergeDataFile.GetPFormEntrys( pResData ); + if( pEntrys != NULL) + { + ByteString sNewText; + pEntrys->GetText( sNewText, STRING_TYP_TEXT, sCur , true ); + sNewdata = String( sNewText , RTL_TEXTENCODING_UTF8 ); + if ( sNewdata.Len()) + { + printf("Entries found\n"); + if( pXMLElement != NULL ) + { + data = new XMLData( sNewdata , NULL , true ); // Add new one + if( pXMLElement->ToOUString().compareTo( OUString(data->GetData()) ) != 0 ) + { + pXMLElement->RemoveAndDeleteAllChilds(); + pXMLElement->AddChild( data ); + } + if( isFallback ) + { + xmldefault = new XMLDefault( String::CreateFromAscii("\n") , NULL ); + int pos = parent->GetPosition( pXMLElement->GetId() ); + if( pos != -1 ){ + parent->AddChild(xmldefault , pos+1 ); + parent->AddChild(pXMLElement , pos+2 ); + } + else fprintf(stdout,"ERROR: Can't find reference Element of id %s language %d\n",pXMLElement->GetId().GetBuffer(),curLang); + } + + aLangHM->erase( sCur ); + } + } + delete pResData; + }else if( pResData == NULL ){fprintf(stdout,"Can't find GID=%s LID=%s TYP=%s\n",pResData->sGId.GetBuffer(),pResData->sId.GetBuffer(),pResData->sResTyp.GetBuffer());} + } + + } +} + diff --git a/l10ntools/source/inireader.cxx b/l10ntools/source/inireader.cxx new file mode 100644 index 000000000000..1ff34fad8e95 --- /dev/null +++ b/l10ntools/source/inireader.cxx @@ -0,0 +1,132 @@ +#include +#include +#include +#include +#include +#include "inireader.hxx" + +using namespace std; +namespace transex3 +{ + +bool INIreader::read( INImap& myMap , string& filename ) +{ + ifstream aFStream( filename.c_str() ); + if( aFStream && aFStream.is_open()) + { + string line; + string section; + string param_key; + string param_value; + stringmap* myvalues = 0; + + while( std::getline( aFStream , line ) ) + { + trim( line ); + if( line.empty() ){ + } + else if( is_section( line , section ) ) + { + //cerr << "[" << section << "]\n"; + myvalues = new stringmap(); + myMap[ section ] = myvalues ; + } + else if ( is_parameter( line , param_key , param_value ) ) + { + //cerr << "" << param_key << " = " << param_value << "\n"; + if( myvalues ) + { + (*myvalues)[ param_key ] = param_value ; + } + else + { + cerr << "ERROR: The INI file " << filename << " appears to be broken ... parameters without a section?!?\n"; + if( aFStream.is_open() ) aFStream.close(); + return false; + } + } + } + + if( aFStream.is_open() ) + aFStream.close(); + + return true; + } + else + { + cerr << "ERROR: Can't open file '" << filename << "'\n"; + } + return false; +} + +bool INIreader::is_section( string& line , string& section_str ) +{ + // Error in regex ? + check_status( section_status ); + UnicodeString target( line.c_str() , line.length() ); + + section_match->reset( target ); + check_status( section_status ); + + if( section_match->find() ) + { + check_status( section_status ); + UnicodeString result( section_match->group( 1 , section_status) ); + check_status( section_status ); + toStlString( result , section_str ); + + return true; + } + return false; +} + +bool INIreader::is_parameter( string& line , string& parameter_key , string& parameter_value ) +{ + // Error in regex ? + check_status( parameter_status ); + UnicodeString target( line.c_str() , line.length() ); + + parameter_match->reset( target ); + check_status( parameter_status ); + + if( parameter_match->find() ) + { + check_status( parameter_status ); + + UnicodeString result1( parameter_match->group( 1 , parameter_status) ); + check_status( parameter_status ); + toStlString( result1 , parameter_key ); + UnicodeString result2( parameter_match->group( 2 , parameter_status) ); + check_status( parameter_status ); + toStlString( result2 , parameter_value ); + + return true; + } + return false; +} + +void INIreader::check_status( UErrorCode status ) +{ + if( U_FAILURE( status) ) + { + cerr << "Error in or while using regex: " << u_errorName( status ) << "\n"; + exit(-1); + } +} + +void INIreader::toStlString( const UnicodeString& str , string& stl_str) +{ + // convert to string + char* buffer = new char[ str.length()*3 ]; + str.extract( 0 , str.length() , buffer ); + stl_str = string( buffer ); + delete[] buffer; +} + +void INIreader::trim( string& str ) +{ + string str1 = str.substr( 0 , str.find_last_not_of(' ') + 1 ); + str = str1.empty() ? str1 : str1.substr( str1.find_first_not_of(' ') ); +} + +} diff --git a/l10ntools/source/lngex.cxx b/l10ntools/source/lngex.cxx new file mode 100644 index 000000000000..67ee34cbdaab --- /dev/null +++ b/l10ntools/source/lngex.cxx @@ -0,0 +1,226 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: lngex.cxx,v $ + * $Revision: 1.18 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_l10ntools.hxx" +#include + +// local includes +#include "lngmerge.hxx" + +// defines to parse command line +#define STATE_NON 0x0001 +#define STATE_INPUT 0x0002 +#define STATE_OUTPUT 0x0003 +#define STATE_PRJ 0x0004 +#define STATE_ROOT 0x0005 +#define STATE_MERGESRC 0x0006 +#define STATE_ERRORLOG 0x0007 +#define STATE_BREAKHELP 0x0008 +#define STATE_UNMERGE 0x0009 +#define STATE_UTF8 0x000A +#define STATE_ULF 0x000B +#define STATE_LANGUAGES 0x000C + +// set of global variables +ByteString sInputFile; +BOOL bEnableExport; +BOOL bMergeMode; +BOOL bErrorLog; +BOOL bUTF8; +BOOL bULF; // ULF = Unicode Language File +bool bQuiet; +ByteString sPrj; +ByteString sPrjRoot; +ByteString sOutputFile; +ByteString sMergeSrc; + +/*****************************************************************************/ +BOOL ParseCommandLine( int argc, char* argv[]) +/*****************************************************************************/ +{ + bEnableExport = FALSE; + bMergeMode = FALSE; + bErrorLog = TRUE; + bUTF8 = TRUE; + bULF = FALSE; + bQuiet = false; + sPrj = ""; + sPrjRoot = ""; + Export::sLanguages = ""; + + USHORT nState = STATE_NON; + BOOL bInput = FALSE; + + // parse command line + for( int i = 1; i < argc; i++ ) { + ByteString sSwitch( argv[ i ] ); + sSwitch.ToUpperAscii(); + if ( sSwitch == "-I" ) { + nState = STATE_INPUT; // next tokens specifies source files + } + else if ( sSwitch == "-O" ) { + nState = STATE_OUTPUT; // next token specifies the dest file + } + else if ( sSwitch == "-P" ) { + nState = STATE_PRJ; // next token specifies the cur. project + } + else if ( sSwitch == "-R" ) { + nState = STATE_ROOT; // next token specifies path to project root + } + else if ( sSwitch == "-QQ" ) { + bQuiet = true; + } + else if ( sSwitch == "-M" ) { + nState = STATE_MERGESRC; // next token specifies the merge database + } + else if ( sSwitch == "-E" ) { + nState = STATE_ERRORLOG; + bErrorLog = FALSE; + } + else if ( sSwitch == "-UTF8" ) { + nState = STATE_UTF8; + bUTF8 = TRUE; + } +/* else if ( sSwitch == "-NOUTF8" ) { + nState = STATE_UTF8; + bUTF8 = FALSE; + }*/ +/* else if ( sSwitch == "-ULF" ) { + nState = STATE_ULF; + bULF = TRUE; + }*/ + else if ( sSwitch == "-L" ) { + nState = STATE_LANGUAGES; + } + else { + switch ( nState ) { + case STATE_NON: { + return FALSE; // no valid command line + } + //break; + case STATE_INPUT: { + sInputFile = argv[ i ]; + bInput = TRUE; // source file found + } + break; + case STATE_OUTPUT: { + sOutputFile = argv[ i ]; // the dest. file + } + break; + case STATE_PRJ: { + sPrj = argv[ i ]; +// sPrj.ToLowerAscii(); // the project + } + break; + case STATE_ROOT: { + sPrjRoot = argv[ i ]; // path to project root + } + break; + case STATE_MERGESRC: { + sMergeSrc = argv[ i ]; + bMergeMode = TRUE; // activate merge mode, cause merge database found + } + break; + case STATE_LANGUAGES: { + Export::sLanguages = argv[ i ]; + } + break; + } + } + } + + if ( bInput ) { + // command line is valid + bULF = TRUE; + bEnableExport = TRUE; + return TRUE; + } + + // command line is not valid + return FALSE; +} + + +/*****************************************************************************/ +void Help() +/*****************************************************************************/ +{ + //fprintf( stdout, "Syntax:ULFEX[-p Prj][-r PrjRoot]-i FileIn -o FileOut[-m DataBase][-e][-b][-u][-NOUTF8][-ULF][-L l1,l2,...]\n" ); + fprintf( stdout, "Syntax:ULFEX[-p Prj][-r PrjRoot]-i FileIn -o FileOut[-m DataBase][-L l1,l2,...]\n" ); + fprintf( stdout, " Prj: Project\n" ); + fprintf( stdout, " PrjRoot: Path to project root (..\\.. etc.)\n" ); + fprintf( stdout, " FileIn: Source file (*.lng)\n" ); + fprintf( stdout, " FileOut: Destination file (*.*)\n" ); + fprintf( stdout, " DataBase: Mergedata (*.sdf)\n" ); + fprintf( stdout, " -QQ: quite output\n" ); + //fprintf( stdout, " -NOUTF8: disable UTF8 as language independent encoding\n" ); + //fprintf( stdout, " -ULF: enables Unicode Language File format, leads to UTF8 encoded version of lng files" ); + fprintf( stdout, " -L: Restrict the handled languages. l1,l2,... are elements of (de,en-US...)\n" ); + fprintf( stdout, " A fallback language can be defined like this: l1=f1.\n" ); + fprintf( stdout, " f1, f2,... are also elements of (de,en-US...)\n" ); + fprintf( stdout, " Example: -L de,es=en-US\n" ); + fprintf( stdout, " Restriction to de and es, en-US will be fallback for es\n" ); +} + +/*****************************************************************************/ +#if defined(UNX) || defined(OS2) +int main( int argc, char *argv[] ) +#else +int _cdecl main( int argc, char *argv[] ) +#endif +/*****************************************************************************/ +{ + if ( !ParseCommandLine( argc, argv )) { + Help(); + return 1; + } + if( !bQuiet ){ + fprintf( stdout, "\nUlfEx 1 Copyright 2000 Sun Microsystems, Inc. All Rights Reserved.\n" ); + fprintf( stdout, "====================================================================\n" ); + fprintf( stdout, "\nProcessing File %s ...\n", sInputFile.GetBuffer()); + }else + { + fprintf(stdout, "."); + fflush( stdout ); + } + + if ( sOutputFile.Len()) { + LngParser aParser( sInputFile, bUTF8, bULF , bQuiet ); + if ( bMergeMode ) + aParser.Merge( sMergeSrc, sOutputFile , sPrj ); + else + aParser.CreateSDF( sOutputFile, sPrj, sPrjRoot ); + } + + if( !bQuiet ) fprintf( stdout, "\n=================================================\n\n" ); + + return 0; +} diff --git a/l10ntools/source/lngmerge.cxx b/l10ntools/source/lngmerge.cxx new file mode 100644 index 000000000000..fcad498128c2 --- /dev/null +++ b/l10ntools/source/lngmerge.cxx @@ -0,0 +1,360 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: lngmerge.cxx,v $ + * $Revision: 1.29 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_l10ntools.hxx" +#include + +// local includes +#include "lngmerge.hxx" +#include "utf8conv.hxx" +#include +using namespace std; +// +// class LngParser +// +/*****************************************************************************/ +LngParser::LngParser( const ByteString &rLngFile, BOOL bUTF8, BOOL bULFFormat , bool bQuiet_in ) +/*****************************************************************************/ + : + nError( LNG_OK ), + pLines( NULL ), + sSource( rLngFile ), + bDBIsUTF8( bUTF8 ), + bULF( bULFFormat ), + bQuiet( bQuiet_in ) +{ + pLines = new LngLineList( 100, 100 ); + DirEntry aEntry( String( sSource, RTL_TEXTENCODING_ASCII_US )); + if ( aEntry.Exists()) { + SvFileStream aStream( String( sSource, RTL_TEXTENCODING_ASCII_US ), STREAM_STD_READ ); + if ( aStream.IsOpen()) { + ByteString sLine; + bool bFirstLine = true; + while ( !aStream.IsEof()) { + aStream.ReadLine( sLine ); + + if( bFirstLine ){ // Always remove UTF8 BOM from the first line + Export::RemoveUTF8ByteOrderMarker( sLine ); + bFirstLine = false; + } + + pLines->Insert( new ByteString( sLine ), LIST_APPEND ); + } + } + else + nError = LNG_COULD_NOT_OPEN; + } + else + nError = LNG_FILE_NOTFOUND; +} + +/*****************************************************************************/ +LngParser::~LngParser() +/*****************************************************************************/ +{ + for ( ULONG i = 0; i < pLines->Count(); i++ ) + delete pLines->GetObject( i ); + delete pLines; +} + +/*****************************************************************************/ +void LngParser::FillInFallbacks( ByteStringHashMap Text ) +/*****************************************************************************/ +{ + ByteString sCur; + for( unsigned int n = 0; n < aLanguages.size(); n++ ){ + sCur = aLanguages[ n ]; + + if( Export::isAllowed( sCur ) ){ + ByteString sFallbackLang = Export::GetFallbackLanguage( sCur ); + if( sFallbackLang.Len() ){ + Text[ sCur ] = Text[ sFallbackLang ]; + } + } + } +} + +/*****************************************************************************/ +BOOL LngParser::CreateSDF( + const ByteString &rSDFFile, const ByteString &rPrj, + const ByteString &rRoot ) +/*****************************************************************************/ +{ + + Export::InitLanguages( false ); + aLanguages = Export::GetLanguages(); + SvFileStream aSDFStream( String( rSDFFile, RTL_TEXTENCODING_ASCII_US ), + STREAM_STD_WRITE | STREAM_TRUNC ); + if ( !aSDFStream.IsOpen()) { + nError = SDF_COULD_NOT_OPEN; + } + aSDFStream.SetStreamCharSet( RTL_TEXTENCODING_UTF8 ); + nError = SDF_OK; + DirEntry aEntry( String( sSource, RTL_TEXTENCODING_ASCII_US )); + aEntry.ToAbs(); + String sFullEntry = aEntry.GetFull(); + aEntry += DirEntry( String( "..", RTL_TEXTENCODING_ASCII_US )); + aEntry += DirEntry( rRoot ); + ByteString sPrjEntry( aEntry.GetFull(), gsl_getSystemTextEncoding()); + ByteString sActFileName( + sFullEntry.Copy( sPrjEntry.Len() + 1 ), gsl_getSystemTextEncoding()); + sActFileName.SearchAndReplaceAll( "/", "\\" ); + + ULONG nPos = 0; + BOOL bStart = true; + ByteString sGroup; + ByteStringHashMap Text; + ByteString sID; + ByteString sLine; + + while( nPos < pLines->Count() ){ + sLine = *pLines->GetObject( nPos++ ); + while( nPos < pLines->Count() && !isNextGroup( sGroup , sLine ) ){ + ReadLine( sLine , Text ); + sID = sGroup; + sLine = *pLines->GetObject( nPos++ ); + }; + if( bStart ){ + bStart = false; + sID = sGroup; + } + else { + + WriteSDF( aSDFStream , Text , rPrj , rRoot , sActFileName , sID ); + } + } + aSDFStream.Close(); + return true; +} + + void LngParser::WriteSDF( SvFileStream &aSDFStream , ByteStringHashMap &rText_inout , + const ByteString &rPrj , const ByteString &rRoot , + const ByteString &sActFileName , const ByteString &sID ) + { + + BOOL bExport = true; + if ( bExport ) { + ByteString sTimeStamp( Export::GetTimeStamp()); + ByteString sCur; + FillInFallbacks( rText_inout ); + for( unsigned int n = 0; n < aLanguages.size(); n++ ){ + sCur = aLanguages[ n ]; + ByteString sAct = rText_inout[ sCur ]; + if ( !sAct.Len() && sCur.Len() ) + sAct = rText_inout[ ByteString("en-US") ]; + + ByteString sOutput( rPrj ); sOutput += "\t"; + if ( rRoot.Len()) + sOutput += sActFileName; + sOutput += "\t0\t"; + sOutput += "LngText\t"; + sOutput += sID; sOutput += "\t\t\t\t0\t"; + sOutput += sCur; sOutput += "\t"; + sOutput += sAct; sOutput += "\t\t\t\t"; + sOutput += sTimeStamp; + //if( !sCur.EqualsIgnoreCaseAscii("de") ||( sCur.EqualsIgnoreCaseAscii("de") && !Export::isMergingGermanAllowed( rPrj ) ) ) + aSDFStream.WriteLine( sOutput ); + } + } + } + bool LngParser::isNextGroup( ByteString &sGroup_out , ByteString &sLine_in ){ + sLine_in.EraseLeadingChars( ' ' ); + sLine_in.EraseTrailingChars( ' ' ); + if (( sLine_in.GetChar( 0 ) == '[' ) && + ( sLine_in.GetChar( sLine_in.Len() - 1 ) == ']' )){ + sGroup_out = sLine_in.GetToken( 1, '[' ).GetToken( 0, ']' ); + sGroup_out.EraseLeadingChars( ' ' ); + sGroup_out.EraseTrailingChars( ' ' ); + return true; + } + return false; + } + void LngParser::ReadLine( const ByteString &sLine_in , ByteStringHashMap &rText_inout){ + //printf("sLine -> '%s'\n",sLine_in.GetBuffer()); + ByteString sLang = sLine_in.GetToken( 0, '=' ); + sLang.EraseLeadingChars( ' ' ); + sLang.EraseTrailingChars( ' ' ); + ByteString sText = sLine_in.GetToken( 1, '\"' ).GetToken( 0, '\"' ); + if( sLang.Len() ) + rText_inout[ sLang ] = sText; + } + +/*****************************************************************************/ +BOOL LngParser::Merge( + const ByteString &rSDFFile, const ByteString &rDestinationFile , const ByteString& rPrj ) +/*****************************************************************************/ +{ + (void) rPrj; + Export::InitLanguages( true ); + SvFileStream aDestination( + String( rDestinationFile, RTL_TEXTENCODING_ASCII_US ), + STREAM_STD_WRITE | STREAM_TRUNC ); + if ( !aDestination.IsOpen()) { + nError = LNG_COULD_NOT_OPEN; + } + nError = LNG_OK; +// MergeDataFile( const ByteString &rFileName, const ByteString& rFile , BOOL bErrLog, CharSet aCharSet, BOOL bUTF8 ); + + MergeDataFile aMergeDataFile( rSDFFile, sSource , FALSE, RTL_TEXTENCODING_MS_1252);//, bDBIsUTF8 ); + ByteString sTmp( Export::sLanguages ); + if( sTmp.ToUpperAscii().Equals("ALL") ) + Export::SetLanguages( aMergeDataFile.GetLanguages() ); + aLanguages = Export::GetLanguages(); + + ULONG nPos = 0; + BOOL bGroup = FALSE; + ByteString sGroup; + + // seek to next group + while ( nPos < pLines->Count() && !bGroup ) { + ByteString sLine( *pLines->GetObject( nPos )); + sLine.EraseLeadingChars( ' ' ); + sLine.EraseTrailingChars( ' ' ); + if (( sLine.GetChar( 0 ) == '[' ) && + ( sLine.GetChar( sLine.Len() - 1 ) == ']' )) + { + sGroup = sLine.GetToken( 1, '[' ).GetToken( 0, ']' ); + sGroup.EraseLeadingChars( ' ' ); + sGroup.EraseTrailingChars( ' ' ); + bGroup = TRUE; + } + nPos ++; + } + + while ( nPos < pLines->Count()) { + ByteStringHashMap Text; + ByteString sID( sGroup ); + ULONG nLastLangPos = 0; + + ResData *pResData = new ResData( "", sID , sSource ); + pResData->sResTyp = "LngText"; + PFormEntrys *pEntrys = aMergeDataFile.GetPFormEntrys( pResData ); + // read languages + bGroup = FALSE; + + ByteString sLanguagesDone; + + while ( nPos < pLines->Count() && !bGroup ) { + ByteString sLine( *pLines->GetObject( nPos )); + sLine.EraseLeadingChars( ' ' ); + sLine.EraseTrailingChars( ' ' ); + if (( sLine.GetChar( 0 ) == '[' ) && + ( sLine.GetChar( sLine.Len() - 1 ) == ']' )) + { + sGroup = sLine.GetToken( 1, '[' ).GetToken( 0, ']' ); + sGroup.EraseLeadingChars( ' ' ); + sGroup.EraseTrailingChars( ' ' ); + bGroup = TRUE; + nPos ++; + sLanguagesDone = ""; + } + else if ( sLine.GetTokenCount( '=' ) > 1 ) { + ByteString sLang = sLine.GetToken( 0, '=' ); + sLang.EraseLeadingChars( ' ' ); + sLang.EraseTrailingChars( ' ' ); + + ByteString sSearch( ";" ); + sSearch += sLang; + sSearch += ";"; + + if (( sLanguagesDone.Search( sSearch ) != STRING_NOTFOUND )) { + pLines->Remove( nPos ); + } + if( bULF && pEntrys ) + { + // this is a valid text line + ByteString sText = sLine.GetToken( 1, '\"' ).GetToken( 0, '\"' ); + if( sLang.Len() ){ + ByteString sNewText; + pEntrys->GetText( sNewText, STRING_TYP_TEXT, sLang, TRUE ); + + if ( sNewText.Len()) { + ByteString *pLine = pLines->GetObject( nPos ); + + ByteString sText1( sLang ); + sText1 += " = \""; + sText1 += sNewText; + sText1 += "\""; + *pLine = sText1; + //} + Text[ sLang ] = sNewText; + } + } + nLastLangPos = nPos; + nPos ++; + sLanguagesDone += sSearch; + } + else { + nLastLangPos = nPos; + nPos ++; + sLanguagesDone += sSearch; + } + } + else + nPos++; + } + ByteString sCur; + if ( nLastLangPos ) { + for( unsigned int n = 0; n < aLanguages.size(); n++ ){ + sCur = aLanguages[ n ]; + if( //( !sCur.EqualsIgnoreCaseAscii("de") || + //( sCur.EqualsIgnoreCaseAscii("de") && Export::isMergingGermanAllowed( rPrj ) ) ) + !sCur.EqualsIgnoreCaseAscii("en-US") && !Text[ sCur ].Len() && pEntrys ){ + + ByteString sNewText; + pEntrys->GetText( sNewText, STRING_TYP_TEXT, sCur, TRUE ); + if (( sNewText.Len()) && + !(( sCur.Equals("x-comment") ) && ( sNewText == "-" ))) + { + ByteString sLine; + sLine += sCur; + sLine += " = \""; + sLine += sNewText; + sLine += "\""; + + nLastLangPos++; + nPos++; + + pLines->Insert( new ByteString( sLine ), nLastLangPos ); + } + } + } + } + + delete pResData; + } + + for ( ULONG i = 0; i < pLines->Count(); i++ ) + aDestination.WriteLine( *pLines->GetObject( i )); + + aDestination.Close(); + return TRUE; +} diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx new file mode 100644 index 000000000000..b617fdb4cf1e --- /dev/null +++ b/l10ntools/source/localize.cxx @@ -0,0 +1,986 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: localize.cxx,v $ + * $Revision: 1.50 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_l10ntools.hxx" + +#include "srciter.hxx" +#include "export.hxx" +#include "treeconfig.hxx" +#include +#include +#include +#include +#include "tools/errcode.hxx" +#include "tools/fsys.hxx" + +#ifndef L10NTOOLS_FILE_HXX +#define L10NTOOLS_FILE_HXX +#include +#endif + +namespace transex3 +{ + +// +// SourceTreeLocalizer +// + +const char *ExeTable[][5] = { + { "src", "transex3", " -UTF8 -e", "negative", "noiso" }, + { "hrc", "transex3", " -UTF8 -e", "positive", "noiso" }, + //{ "src", "transex3", "-UTF8 -e", "negative", "noiso" }, + //{ "hrc", "transex3", "-UTF8 -e", "positive", "noiso" }, + + //{ "lng", "lngex", "-UTF8 -e", "negative", "noiso" }, + { "ulf", "ulfex", " -e", "negative", "noiso" }, + { "xrb", "xmlex", "-UTF8 -e", "negative", "iso" }, + { "xxl", "xmlex", "-UTF8 -e", "negative", "iso" }, + { "xgf", "xmlex", "-UTF8 -e -t:xgf", "negative", "iso" }, + { "xcd", "cfgex", "-UTF8 -e", "negative", "iso" }, + { "xcu", "cfgex", "-UTF8 -e", "negative", "iso" }, + { "xcs", "cfgex", "-UTF8 -e -f", "negative", "iso" }, + { "xrm", "xrmex", "-UTF8 -e", "negative", "iso" }, + { "xhp", "helpex", " -e", "negative", "noiso" }, + { "NULL", "NULL", "NULL", "NULL", "NULL" } +}; + +const char *NegativeList[] = { + "officecfg/data/org.openoffice.Office.Labels.xcd", + "officecfg/data/org/openoffice/Office/Labels.xcd", + "officecfg/data/org/openoffice/Office/SFX.xcd", + "officecfg/data/org/openoffice/Office/Accelerators.xcu", + "hidother.src", + "NULL" +}; + +const char *PositiveList[] = { + "svx/inc/globlmn_tmpl.hrc", + "sw/source/ui/inc/swmn_tmpl.hrc", + "sw/source/ui/inc/swacc_tmpl.hrc", + "sw/source/ui/inc/toolbox_tmpl.hrc", + "offmgr/inc/offmenu_tmpl.hrc", + "offmgr/source/offapp/intro/intro_tmpl.hrc", + "dbaccess/source/ui/inc/toolbox_tmpl.hrc", + "svx/source/intro/intro_tmpl.hrc", + "dbaccess/source/ui/dlg/AutoControls_tmpl.hrc", + "svx/source/unodialogs/textconversiondlgs/chinese_direction_tmpl.hrc", + "chart2/source/controller/dialogs/res_DataLabel_tmpl.hrc", + "chart2/source/controller/dialogs/res_LegendPosition_tmpl.hrc", + "chart2/source/controller/dialogs/res_Statistic_tmpl.hrc", + "chart2/source/controller/dialogs/res_Titlesx_tmpl.hrc", + "chart2/source/controller/dialogs/res_SecondaryAxisCheckBoxes_tmpl.hrc", + "chart2/source/controller/menu/MenuItems_tmpl.hrc", + "chart2/source/controller/dialogs/res_ErrorBar_tmpl.hrc", + "chart2/source/controller/dialogs/res_Trendline_tmpl.hrc", + "svx.link/inc/globlmn_tmpl.hrc", + "sw.link/source/ui/inc/swmn_tmpl.hrc", + "sw.link/source/ui/inc/swacc_tmpl.hrc", + "sw.link/source/ui/inc/toolbox_tmpl.hrc", + "offmgr.link/inc/offmenu_tmpl.hrc", + "offmgr.link/source/offapp/intro/intro_tmpl.hrc", + "dbaccess.link/source/ui/inc/toolbox_tmpl.hrc", + "svx.link/source/intro/intro_tmpl.hrc", + "dbaccess.link/source/ui/dlg/AutoControls_tmpl.hrc", + "svx.link/source/unodialogs/textconversiondlgs/chinese_direction_tmpl.hrc", + "chart2.link/source/controller/dialogs/res_DataLabel_tmpl.hrc", + "chart2.link/source/controller/dialogs/res_LegendPosition_tmpl.hrc", + "chart2.link/source/controller/dialogs/res_Statistic_tmpl.hrc", + "chart2.link/source/controller/dialogs/res_Titlesx_tmpl.hrc", + "chart2.link/source/controller/dialogs/res_SecondaryAxisCheckBoxes_tmpl.hrc", + "chart2.link/source/controller/menu/MenuItems_tmpl.hrc", + "chart2.link/source/controller/dialogs/res_ErrorBar_tmpl.hrc", + "chart2.link/source/controller/dialogs/res_Trendline_tmpl.hrc", + "NULL" +}; + + +const char PRJ_DIR_NAME[] = "prj"; +const char DLIST_NAME[] = "d.lst"; + +#define LOCALIZE_NONE 0x0000 +#define LOCALIZE_EXTRACT 0x0001 +#define LOCALIZE_MERGE 0x0002 + +class SourceTreeLocalizer : public SourceTreeIterator +{ +private: + SvFileStream aSDF; + USHORT nMode; + + ByteString sLanguageRestriction; + + ByteString sOutputFile; + bool bQuiet2; + + int nFileCnt; + + const ByteString GetProjectName( BOOL bAbs = FALSE ); + const ByteString GetProjectRootRel(); + + + BOOL CheckNegativeList( const ByteString &rFileName ); + BOOL CheckPositiveList( const ByteString &rFileName ); + + void WorkOnFile( + const ByteString &rFileName, + const ByteString &rExecutable, + const ByteString &rParameter + ); + + void WorkOnFileType( + const ByteString &rDirectory, + const ByteString &rExtension, + const ByteString &rExecutable, + const ByteString &rParameter, + const ByteString &rCollectMode + ); + void WorkOnDirectory( const ByteString &rDirectory ); + BOOL ExecuteMerge(); + BOOL MergeSingleFile( + const ByteString &rPrj, + const ByteString &rFile, + const ByteString &rSDFFile + ); + +public: + SourceTreeLocalizer( const ByteString &rRoot, const ByteString &rVersion , bool bLocal , bool bQuiet2_in , bool skip_links ); + ~SourceTreeLocalizer(); + + ByteString getSourceLanguages( ByteString sLanguageRestriction , ByteString sCommand ); + + void SetLanguageRestriction( const ByteString& rRestrictions ) + { sLanguageRestriction = rRestrictions; } + int getFileCnt(); + BOOL Extract( const ByteString &rDestinationFile ); + BOOL Merge( const ByteString &rSourceFile , const ByteString &rOutput ); + int GetFileCnt(); + virtual void OnExecuteDirectory( const rtl::OUString &rDirectory ); +}; + +/*****************************************************************************/ +SourceTreeLocalizer::SourceTreeLocalizer( + const ByteString &rRoot, const ByteString &rVersion, bool bLocal_in , bool bQuiet2_in , bool skip_links ) +/*****************************************************************************/ + : SourceTreeIterator( rRoot, rVersion , bLocal_in ), + nMode( LOCALIZE_NONE ), + bQuiet2( bQuiet2_in ), + nFileCnt( 0 ) +{ + bSkipLinks = skip_links ; +} + +/*****************************************************************************/ +SourceTreeLocalizer::~SourceTreeLocalizer() +/*****************************************************************************/ +{ +} + +/*****************************************************************************/ +const ByteString SourceTreeLocalizer::GetProjectName( BOOL bAbs ) +/*****************************************************************************/ +{ + BOOL bFound = FALSE; + DirEntry aCur; + aCur.ToAbs(); + + for ( ; ! bFound && aCur.Level() > 1; aCur.CutName() ) + { + DirEntry aTest = aCur + DirEntry(PRJ_DIR_NAME) + DirEntry(DLIST_NAME); + if ( aTest.Exists() ) + { + if ( bAbs ) + return ByteString( aCur.GetFull(), RTL_TEXTENCODING_ASCII_US ); + else + return ByteString( aCur.GetName(), RTL_TEXTENCODING_ASCII_US ); + } + } + + return ""; +} +/*****************************************************************************/ +int SourceTreeLocalizer::GetFileCnt(){ +/*****************************************************************************/ + return nFileCnt; +} + +/*****************************************************************************/ +const ByteString SourceTreeLocalizer::GetProjectRootRel() +/*****************************************************************************/ +{ + ByteString sProjectRoot( GetProjectName( TRUE )); + DirEntry aCur; + aCur.ToAbs(); + ByteString sCur( aCur.GetFull(), RTL_TEXTENCODING_ASCII_US ); + + if( sCur.SearchAndReplace( sProjectRoot, "" ) == STRING_NOTFOUND ) + return ""; + + ByteString sDelimiter( + DirEntry::GetAccessDelimiter(), RTL_TEXTENCODING_ASCII_US ); + + sCur.SearchAndReplaceAll( sDelimiter, "/" ); + sCur.EraseLeadingChars( '/' ); + ULONG nCount = sCur.GetTokenCount( '/' ); + + ByteString sProjectRootRel; + for ( ULONG i = 0; i < nCount; i++ ) { + if ( sProjectRootRel.Len()) + sProjectRootRel += sDelimiter; + sProjectRootRel += ".."; + } + if ( sProjectRootRel.Len()) + return sProjectRootRel; + + return "."; +} + +bool skipProject( ByteString sPrj ) +{ + static const ByteString READLICENSE( "readlicense" ); + return sPrj.EqualsIgnoreCaseAscii( READLICENSE ); +} + +/*****************************************************************************/ +void SourceTreeLocalizer::WorkOnFile( + const ByteString &rFileName, const ByteString &rExecutable, + const ByteString &rParameter ) +/*****************************************************************************/ +{ + String sFull( rFileName, RTL_TEXTENCODING_ASCII_US ); + DirEntry aEntry( sFull ); + ByteString sFileName( aEntry.GetName(), RTL_TEXTENCODING_ASCII_US ); + + // set current working directory + DirEntry aPath( aEntry.GetPath()); + DirEntry aOldCWD; + aPath.SetCWD(); + + ByteString sPrj( GetProjectName()); + if ( sPrj.Len() && !skipProject( sPrj ) ) + { + ByteString sRoot( GetProjectRootRel()); + + DirEntry aTemp( Export::GetTempFile()); + ByteString sTempFile( aTemp.GetFull(), RTL_TEXTENCODING_ASCII_US ); + + ByteString sDel; +#if defined(WNT) || defined(OS2) + sDel=ByteString("\\"); +#else + sDel=ByteString("/"); +#endif + ByteString sPath1( Export::GetEnv("SOLARVER") ); + ByteString sPath2( Export::GetEnv("INPATH") ); + ByteString sPath3( "bin" ); + ByteString sPath4( Export::GetEnv("UPDMINOREXT") ); + ByteString sExecutable( sPath1 ); + sExecutable += sDel ; + sExecutable += sPath2 ; + sExecutable += sDel; + sExecutable += sPath3 ; + sExecutable += sPath4 ; + sExecutable += sDel ; + sExecutable += rExecutable ; + + + ByteString sCommand( sExecutable ); + sCommand += " "; + sCommand += rParameter; + sCommand += " -p "; + sCommand += sPrj; + sCommand += " -r "; + sCommand += sRoot; + sCommand += " -i "; + sCommand += sFileName; + sCommand += " -o "; + sCommand += sTempFile; + if ( sLanguageRestriction.Len()) { + sCommand += " -l "; + sCommand += getSourceLanguages( sLanguageRestriction , sCommand ); + } + + if( bQuiet2 ){ + sCommand +=" -QQ "; + } + //printf("DBG: %s\n",sCommand.GetBuffer()); + if (system(sCommand.GetBuffer()) == -1) + fprintf(stderr, "%s failed\n", sCommand.GetBuffer()); + nFileCnt++; + printf("."); + fflush( stdout ); + + SvFileStream aSDFIn( aTemp.GetFull(), STREAM_READ ); + ByteString sLine; + while ( aSDFIn.IsOpen() && !aSDFIn.IsEof()) { + aSDFIn.ReadLine( sLine ); + if ( sLine.Len()) { + aSDF.WriteLine( sLine ); + } + } + aSDFIn.Close(); + + aTemp.Kill(); + + } + // reset current working directory + aOldCWD.SetCWD(); +} + +ByteString SourceTreeLocalizer::getSourceLanguages( ByteString sLanguageRestriction_inout , ByteString sCommand ) +{ + // Source languages in helpcontent2 and macromigration en-US only! + if( sCommand.Search("helpex") != STRING_NOTFOUND ) { + sLanguageRestriction_inout.Assign( ByteString("en-US") ); + } + else if( sCommand.Search("xmlex") != STRING_NOTFOUND ){ + sLanguageRestriction_inout.Assign( ByteString("en-US") ); + } + return sLanguageRestriction_inout; +} + +/*****************************************************************************/ +BOOL SourceTreeLocalizer::CheckNegativeList( const ByteString &rFileName ) +/*****************************************************************************/ +{ + ULONG nIndex = 0; + BOOL bReturn = TRUE; + + ByteString sDelimiter( + DirEntry::GetAccessDelimiter(), RTL_TEXTENCODING_ASCII_US ); + + ByteString sFileName( rFileName ); + sFileName.ToLowerAscii(); + + ByteString sNegative( NegativeList[ nIndex ] ); + while( !sNegative.Equals( "NULL" ) && bReturn ) { + sNegative.SearchAndReplaceAll( "\\", sDelimiter ); + sNegative.SearchAndReplaceAll( "/", sDelimiter ); + sNegative.ToLowerAscii(); + + if( sFileName.Search( sNegative ) == sFileName.Len() - sNegative.Len()) + bReturn = FALSE; + + nIndex++; + sNegative = NegativeList[ nIndex ]; + } + + return bReturn; +} + +/*****************************************************************************/ +BOOL SourceTreeLocalizer::CheckPositiveList( const ByteString &rFileName ) +/*****************************************************************************/ +{ + ULONG nIndex = 0; + BOOL bReturn = FALSE; + + ByteString sDelimiter( + DirEntry::GetAccessDelimiter(), RTL_TEXTENCODING_ASCII_US ); + + ByteString sFileName( rFileName ); + sFileName.ToLowerAscii(); + + ByteString sNegative( PositiveList[ nIndex ] ); + while( !sNegative.Equals( "NULL" ) && !bReturn ) { + sNegative.SearchAndReplaceAll( "\\", sDelimiter ); + sNegative.SearchAndReplaceAll( "/", sDelimiter ); + sNegative.ToLowerAscii(); + + if( sFileName.Search( sNegative ) == sFileName.Len() - sNegative.Len()) + bReturn = TRUE; + + nIndex++; + sNegative = PositiveList[ nIndex ]; + } + + return bReturn; +} + +/*****************************************************************************/ +void SourceTreeLocalizer::WorkOnFileType( + const ByteString &rDirectory, const ByteString &rExtension, + const ByteString &rExecutable, const ByteString &rParameter, + const ByteString &rCollectMode +) +/*****************************************************************************/ +{ + String sWild( rDirectory, RTL_TEXTENCODING_ASCII_US ); + sWild += DirEntry::GetAccessDelimiter(); + sWild += String::CreateFromAscii( "*." ); + sWild += String( rExtension, RTL_TEXTENCODING_ASCII_US ); + + DirEntry aEntry( sWild ); + Dir aDir( sWild, FSYS_KIND_FILE ); + + for ( USHORT i = 0; i < aDir.Count(); i++ ) { + DirEntry aFile( aDir[ i ] ); + ByteString sFile( aFile.GetFull(), RTL_TEXTENCODING_ASCII_US ); + + BOOL bAllowed = TRUE; + + if ( rCollectMode.Equals( "negative" )) + bAllowed = CheckNegativeList( sFile ); + else if ( rCollectMode.Equals( "positive" )) + bAllowed = CheckPositiveList( sFile ); + + if ( bAllowed ) + WorkOnFile( sFile, rExecutable, rParameter ); + } +} + +/*****************************************************************************/ +void SourceTreeLocalizer::WorkOnDirectory( const ByteString &rDirectory ) +/*****************************************************************************/ +{ + //printf("Working on Directory %s\n",rDirectory.GetBuffer()); + ULONG nIndex = 0; + ByteString sExtension( ExeTable[ nIndex ][ 0 ] ); + ByteString sExecutable( ExeTable[ nIndex ][ 1 ] ); + ByteString sParameter( ExeTable[ nIndex ][ 2 ] ); + ByteString sCollectMode( ExeTable[ nIndex ][ 3 ] ); + + while( !sExtension.Equals( "NULL" )) { + WorkOnFileType( + rDirectory, + sExtension, + sExecutable, + sParameter, + sCollectMode + ); + + nIndex++; + + sExtension = ExeTable[ nIndex ][ 0 ]; + sExecutable = ExeTable[ nIndex ][ 1 ]; + sParameter = ExeTable[ nIndex ][ 2 ]; + sCollectMode = ExeTable[ nIndex ][ 3 ]; + } +} + +void SourceTreeLocalizer::OnExecuteDirectory( const rtl::OUString &aDirectory ) +{ + ByteString rDirectory( rtl::OUStringToOString( aDirectory , RTL_TEXTENCODING_UTF8 , aDirectory.getLength() ) ) ; + if ( nMode == LOCALIZE_NONE ){ + if( !bQuiet2 ) fprintf( stdout, "%s\n", rDirectory.GetBuffer()); + } + else + WorkOnDirectory( rDirectory ); +} + +/*****************************************************************************/ +BOOL SourceTreeLocalizer::Extract( const ByteString &rDestinationFile ) +/*****************************************************************************/ +{ + nMode = LOCALIZE_EXTRACT; + + aSDF.Open( String( rDestinationFile , RTL_TEXTENCODING_ASCII_US ) , STREAM_STD_WRITE ); + aSDF.SetLineDelimiter( LINEEND_CRLF ); + + BOOL bReturn = aSDF.IsOpen(); + if ( bReturn ) { + aSDF.Seek( STREAM_SEEK_TO_END ); + bReturn = StartExecute(); + aSDF.Close(); + } + else{ + printf("ERROR: Can't create file %s\n", rDestinationFile.GetBuffer() ); + } + nMode = LOCALIZE_NONE; + aSDF.Close(); + return bReturn; +} + +/*****************************************************************************/ +BOOL SourceTreeLocalizer::MergeSingleFile( + const ByteString &rPrj, + const ByteString &rFile, + const ByteString &rSDFFile +) +/*****************************************************************************/ +{ + //printf("MergeSingleFile(%s,%s,%s)",rPrj.GetBuffer(),rFile.GetBuffer(),rSDFFile.GetBuffer()); + if ( !rFile.Len()) + return TRUE; + + ByteString sRoot( Export::GetEnv( "SRC_ROOT" )); + DirEntry aEntry( String( sRoot, RTL_TEXTENCODING_ASCII_US )); + aEntry += DirEntry( String( rPrj, RTL_TEXTENCODING_ASCII_US )); + + ByteString sDelimiter( + DirEntry::GetAccessDelimiter(), RTL_TEXTENCODING_ASCII_US ); + + ByteString sCur( rFile ); + sCur.SearchAndReplaceAll( "\\", sDelimiter ); + sCur.SearchAndReplaceAll( "/", sDelimiter ); + + aEntry += DirEntry( String( sCur, RTL_TEXTENCODING_ASCII_US )); + ByteString sFile( aEntry.GetFull(), RTL_TEXTENCODING_ASCII_US ); + + ByteString sBCur( aEntry.GetFull(), RTL_TEXTENCODING_ASCII_US ); + if( !bQuiet2 ) fprintf( stdout, "##### %s #####\n", sBCur.GetBuffer()); + + ULONG nIndex = 0; + ByteString sExtension( aEntry.GetExtension(), RTL_TEXTENCODING_ASCII_US ); + ByteString sCandidate( ExeTable[ nIndex ][ 0 ] ); + + while( !sCandidate.Equals ("NULL") && !sCandidate.Equals(sExtension) ) + sCandidate = ExeTable[ ++nIndex ][ 0 ]; + + if ( !sCandidate.Equals( "NULL" ) ) { + if( !aEntry.Exists()) { + DirEntryKind theDir=FSYS_KIND_FILE; + Dir myDir( aEntry.GetPath(), theDir); + DirEntry current; + BOOL found=FALSE; + for( USHORT x=0; x < myDir.Count() && !found;){ + current=myDir[x++]; + StringCompare result=current.GetName().CompareIgnoreCaseToAscii( aEntry.GetName() ); + if( result==COMPARE_EQUAL ){ + fprintf(stderr,"WARNING: %s not found\n", ByteString(aEntry.GetFull(),RTL_TEXTENCODING_ASCII_US).GetBuffer() ); + fprintf(stderr,"but use %s instead \n" , ByteString(current.GetFull(), RTL_TEXTENCODING_ASCII_US).GetBuffer() ); + aEntry=current; + found=TRUE; + } + } + if(!found) return TRUE; + + } + + DirEntry aOut( Export::GetTempFile() ); + ByteString sOutput; + if( sOutputFile.Len() == 0 ) + sOutput = ByteString ( aOut.GetFull(), RTL_TEXTENCODING_ASCII_US ); + else + sOutput = sOutputFile; + ByteString sCommand( ExeTable[ nIndex ][ 1 ] ); + sCommand += " -i "; + sCommand += ByteString( aEntry.GetName(), RTL_TEXTENCODING_ASCII_US ); + sCommand += " -m "; + sCommand += rSDFFile; + sCommand += " -o "; + sCommand += sOutput; + sCommand += " "; + sCommand += ByteString( ExeTable[ nIndex ][ 2 ] ); + if ( sLanguageRestriction.Len()) { + sCommand += " -l "; + sCommand += sLanguageRestriction; + } + if( bQuiet2 ){ + sCommand +=" -QQ "; + } + + DirEntry aPath( aEntry.GetPath()); + DirEntry aOldCWD; + aPath.SetCWD(); + + if (system(sCommand.GetBuffer()) == -1) + fprintf(stderr, "%s failed\n", sCommand.GetBuffer()); + nFileCnt++; + printf("."); + //if( bQuiet2 ){ printf("."); } + SvFileStream aInStream( aOut.GetFull(), STREAM_READ ); + if ( !aInStream.IsOpen()) { + fprintf( stderr, + "ERROR: Unable to open file %s for reading!\n", + sOutput.GetBuffer()); + } + else { + FileStat::SetReadOnlyFlag( aEntry, FALSE ); + String myStr2(aEntry.GetFull()); + String aTemp22 = String::CreateFromAscii("_tmp"); + myStr2.Append(aTemp22); + + ByteString test(myStr2,RTL_TEXTENCODING_ASCII_US); + SvFileStream aOutStream( myStr2, STREAM_STD_WRITE | STREAM_TRUNC ); + if ( !aOutStream.IsOpen()) { + ByteString test2(myStr2,RTL_TEXTENCODING_ASCII_US); + fprintf( stderr,"ERROR: Unable to open file %s for modification!\n", test2.GetBuffer()); + aInStream.Close(); + } + + else { + ByteString sLine; + aOutStream.SetLineDelimiter( LINEEND_LF ); + + aInStream.ReadLine( sLine ); + while ( !aInStream.IsEof()) { + aOutStream.WriteLine( sLine ); + aInStream.ReadLine( sLine ); + } + aInStream.Close(); + aOutStream.Close(); + + + DirEntry myTempFile(ByteString(myStr2,RTL_TEXTENCODING_ASCII_US)); // xxx_tmp -> + DirEntry myFile(ByteString(aEntry.GetFull(),RTL_TEXTENCODING_ASCII_US));// xxx + + DirEntry oldFile(ByteString(aEntry.GetFull(),RTL_TEXTENCODING_ASCII_US)); + + if(oldFile.Kill()==ERRCODE_NONE){ + if(myTempFile.MoveTo(myFile)!=ERRCODE_NONE){ + fprintf( stderr, "ERROR: Can't rename file %s\n",ByteString(myStr2,RTL_TEXTENCODING_ASCII_US).GetBuffer()); + } + } + else{ + fprintf( stderr, "ERROR: Can't remove file %s\n",ByteString(aEntry.GetFull(),RTL_TEXTENCODING_ASCII_US).GetBuffer()); + } + } // else + + aOldCWD.SetCWD(); + aOut.Kill(); + } // else + } + return TRUE; +} +/*****************************************************************************/ +BOOL SourceTreeLocalizer::ExecuteMerge( ) +/*****************************************************************************/ +{ + DirEntry aEntry( Export::GetTempFile()); + BOOL bReturn = TRUE; + bool bMerged = false; + + ByteString sFileName; + ByteString sCurFile; + ByteString sLine; + ByteString sFileKey; + + SvFileStream aFile; + + ByteString sOutputFileName = sOutputFile; + ByteString sInpath("."); + sInpath += Export::GetEnv("INPATH"); + ByteString sBlank(""); + + sOutputFileName.SearchAndReplaceAll( sInpath , sBlank ); + + String sDel = DirEntry::GetAccessDelimiter(); + ByteString sBDel( sDel.GetBuffer() , sDel.Len() , RTL_TEXTENCODING_UTF8 ); + if( bLocal ){ + xub_StrLen nPos = sOutputFileName.SearchBackward( sBDel.GetChar(0) ); + sOutputFileName = sOutputFileName.Copy( nPos+1 , sOutputFileName.Len()-nPos-1 ); + } + ByteStringBoolHashMap aFileHM; + // Read all possible files + while ( !aSDF.IsEof()) { + aSDF.ReadLine( sLine ); + sFileName = sLine.GetToken( 0, '\t' ); + sFileName += "#"; + sFileName += sLine.GetToken( 1, '\t' ); + aFileHM[sFileName]=true; + } + + for( ByteStringBoolHashMap::iterator iter = aFileHM.begin(); iter != aFileHM.end(); ++iter ){ + sFileKey = iter->first; + aSDF.Seek( 0 ); + aFile.Open( aEntry.GetFull(), STREAM_STD_WRITE |STREAM_TRUNC ); + + while ( !aSDF.IsEof()) { + aSDF.ReadLine( sLine ); + sFileName = sLine.GetToken( 0, '\t' ); + sFileName += "#"; + sFileName += sLine.GetToken( 1, '\t' ); + if( sFileName.Len() && ( sFileName.CompareTo(sFileKey) == COMPARE_EQUAL ) ){ + if ( aFile.IsOpen() && sLine.Len()) + aFile.WriteLine( sLine ); + } + } + if ( aFile.IsOpen()) + aFile.Close(); + + ByteString sPrj( sFileKey.GetToken( 0, '#' )); + ByteString sFile( sFileKey.GetToken( 1, '#' )); + ByteString sSDFFile( aFile.GetFileName(), RTL_TEXTENCODING_ASCII_US ); + + //printf("localize test sPrj = %s , sFile = %s , sSDFFile = %s sOutputFileName = %s\n",sPrj.GetBuffer(), sFile.GetBuffer() , sSDFFile.GetBuffer() , sOutputFileName.GetBuffer() ); + + // Test + bLocal = true; + // Test + + if( bLocal ){ + USHORT nPos = sFile.SearchBackward( '\\' ); + ByteString sTmp = sFile.Copy( nPos+1 , sFile.Len()-nPos-1 ); + //printf("'%s'='%s'\n",sTmp.GetBuffer(), sOutputFileName.GetBuffer()); + if( sTmp.CompareTo(sOutputFileName) == COMPARE_EQUAL ){ + bMerged = true; + if ( !MergeSingleFile( sPrj, sFile, sSDFFile )) + bReturn = FALSE; + }else{ + bMerged = true; + //printf("MergeSingleFile('%s','%s','%s')\n",sPrj.GetBuffer(),sFile.GetBuffer(),sSDFFile.GetBuffer()); + if ( !MergeSingleFile( sPrj, sFile, sSDFFile )) + bReturn = FALSE; + } + } + } + aEntry.Kill(); + // If Outputfile not included in the SDF file copy it without merge + + if( bLocal && !bMerged ){ + DirEntry aSourceFile( sOutputFileName.GetBuffer() ); + FSysError aErr = aSourceFile.CopyTo( DirEntry ( sOutputFile.GetBuffer() ) , FSYS_ACTION_COPYFILE ); + if( aErr != FSYS_ERR_OK ){ + printf("ERROR: Can't copy file '%s' to '%s' %d\n",sOutputFileName.GetBuffer(),sOutputFile.GetBuffer(),sal::static_int_cast(aErr)); + } + } + return bReturn; + +} + +/*****************************************************************************/ +BOOL SourceTreeLocalizer::Merge( const ByteString &rSourceFile , const ByteString &rOutput ) +/*****************************************************************************/ +{ + sOutputFile = rOutput; + nMode = LOCALIZE_MERGE; + aSDF.Open( String( rSourceFile, RTL_TEXTENCODING_ASCII_US ), + STREAM_STD_READ ); + + BOOL bReturn = aSDF.IsOpen(); + if ( bReturn ) { + bReturn = ExecuteMerge(); +// aSDF.Close(); + } + aSDF.Close(); + nMode = LOCALIZE_NONE; + return bReturn; +} + +} +using namespace transex3; + +#define STATE_NONE 0x0000 +#define STATE_EXPORT 0x0001 +#define STATE_MERGE 0x0002 +#define STATE_ISOCODE 0x0003 +#define STATE_LANGUAGES 0x0004 +#define STATE_FILENAME 0x0005 +#define STATE_OUTPUT 0x0006 + +/*****************************************************************************/ +void Help() +/*****************************************************************************/ +{ + fprintf( stdout, + "localize (c)2001 by Sun Microsystems\n" + "====================================\n" ); + fprintf( stdout, + "As part of the L10N framework, localize extracts and merges translations\n" + "out of and into the whole source tree.\n\n" + "Syntax: localize -e -l en-US -f FileName [-QQ]\n" + "Parameter:\n" + "\t-e: Extract mode\n" + "\tFileName: Output file when extract mode, input file when merge mode\n" + "\tl1...ln: supported languages (\"all\" for all languages).\n" + "\tQQ: quiet output)" + ); + + fprintf( stdout, + "Valid language codes for l1...ln and f1...fn are:\n" ); + fprintf( stdout, + "\nExample 1:\n" + "==========\n" + "localize -e -l en-US -f MyFile\n\n" + "All strings will be extracted for language de and language en-US.\n" + ); +} + +/*****************************************************************************/ +int Error() +/*****************************************************************************/ +{ + Help(); + return 1; +} + +/*****************************************************************************/ +BOOL CheckLanguages( ByteString &rLanguages ) +/*****************************************************************************/ +{ + ByteString sTmp( rLanguages ); + return true; +} + +/*****************************************************************************/ +#if defined(UNX) || defined(OS2) +int main( int argc, char *argv[] ) +#else +int _cdecl main( int argc, char *argv[] ) +#endif +/*****************************************************************************/ +{ + String sTempBase( String::CreateFromAscii( "loc" )); + DirEntry::SetTempNameBase( sTempBase ); + USHORT nState = STATE_NONE; + + BOOL bExport = FALSE; + BOOL bMerge = FALSE; + bool bQuiet = false; + bool bQuiet2 = false; + bool bSkipLinks = false; + + ByteString sLanguages; + ByteString sFileName; + ByteString sOutput; + + bQuiet2 = true; + bExport = TRUE; + + for( int i = 1; i < argc; i++ ) { + ByteString sSwitch( argv[ i ] ); + sSwitch.ToUpperAscii(); + + if ( sSwitch.Equals( "-E" )) { + nState = STATE_EXPORT; + if ( bMerge ) + return Error(); + bExport = TRUE; + } + else if( sSwitch.Equals( "-Q" )) { + bQuiet = true; + } + else if ( sSwitch.Equals( "-I" ) ) + nState = STATE_ISOCODE; + else if ( sSwitch.Equals( "-L" ) ) + nState = STATE_LANGUAGES; + else if ( sSwitch.Equals( "-F" ) ) + nState = STATE_FILENAME; + else if ( sSwitch.Equals( "-QQ" )) + bQuiet2 = true; + else if ( ByteString( argv[ i ]).ToUpperAscii().Equals( "-O" ) ) + nState = STATE_OUTPUT; + else { + switch ( nState ) { + case STATE_NONE: + return Error(); + case STATE_OUTPUT: + if ( sOutput.Len()) + return Error(); + sOutput = ByteString( argv[ i ] ); + nState = STATE_NONE; + break; + case STATE_LANGUAGES: + if ( sLanguages.Len()) + return Error(); + sLanguages = ByteString( argv[ i ] ); + nState = STATE_NONE; + break; + case STATE_FILENAME: + if ( sFileName.Len()) + return Error(); + sFileName = ByteString( argv[ i ] ); + nState = STATE_NONE; + break; + default: + return Error(); + } + } + } + if ( !bMerge && !bExport ) { + Help(); + return 1; + } + + ByteString sSolarVer( Export::GetEnv( "WORK_STAMP" )); + ByteString sVersion( Export::GetEnv( "WORK_STAMP" )); + + if ( !sSolarVer.Len() || !sVersion.Len()) { + fprintf( stderr, "ERROR: No environment set!\n" ); + return 1; + } + + if ( !CheckLanguages( sLanguages )) + return 2; + + if ( !sFileName.Len()) { + fprintf( stderr, "ERROR: No filename given\n" ); + return 3; + } + + DirEntry aEntry( String( sFileName , RTL_TEXTENCODING_ASCII_US )); + aEntry.ToAbs(); + String sFullEntry = aEntry.GetFull(); + ByteString sFileABS( aEntry.GetFull(), gsl_getSystemTextEncoding()); + //printf("B %s\nA %s\n",rDestinationFile.GetBuffer(), sFile.GetBuffer()); + sFileName = sFileABS; + + Treeconfig treeconfig; + vector repos; + bool hasPwd = treeconfig.getActiveRepositories( repos ); + if( hasPwd ) cout << "Found special path!\n"; + + string minor_ext; + bool has_minor_ext; + + if( Export::GetEnv("UPDMINOREXT") != NULL ) + { + minor_ext = string( Export::GetEnv("UPDMINOREXT") ); + has_minor_ext = minor_ext.size(); + } + else + has_minor_ext = false; + + // localize through all repositories + for( vector::iterator iter = repos.begin(); iter != repos.end() ; ++iter ) + { + string curRepository; + if( has_minor_ext ) + curRepository = string( Export::GetEnv("SOURCE_ROOT_DIR") ) + "/" + *iter + minor_ext; + else + curRepository = string( Export::GetEnv("SOURCE_ROOT_DIR") ) + "/" + *iter; + cout << "Localizing repository " << curRepository << "\n"; + SourceTreeLocalizer aIter( ByteString( curRepository.c_str() ) , sVersion , (sOutput.Len() > 0) , bQuiet2 , bSkipLinks ); + aIter.SetLanguageRestriction( sLanguages ); + if ( bExport ){ + if( bQuiet2 ){ /*printf("");*/fflush( stdout );} + aIter.Extract( sFileName ); + if( bQuiet2 ){ printf("\n %d files found!\n",aIter.GetFileCnt());} + } + } + if( hasPwd ) + { + string pwd; + Export::getCurrentDir( pwd ); + cout << "Localizing repository " << pwd << "\n"; + SourceTreeLocalizer aIter( ByteString( pwd.c_str() ) , sVersion , (sOutput.Len() > 0) , bQuiet2 , bSkipLinks ); + aIter.SetLanguageRestriction( sLanguages ); + if ( bExport ){ + if( bQuiet2 ){ /*printf("");*/fflush( stdout );} + aIter.Extract( sFileName ); + if( bQuiet2 ){ printf("\n %d files found!\n",aIter.GetFileCnt());} + } + + } + + return 0; +} + diff --git a/l10ntools/source/makefile.mk b/l10ntools/source/makefile.mk new file mode 100644 index 000000000000..fe4ecc919179 --- /dev/null +++ b/l10ntools/source/makefile.mk @@ -0,0 +1,210 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2008 by Sun Microsystems, Inc. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.46 $ +# +# 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 +# +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=.. + +INCPRE=$(MISC) + +PRJNAME=l10ntools +TARGET=transex +TARGETTYPE=CUI +LIBTARGET=no +# --- Settings ----------------------------------------------------- +ENABLE_EXCEPTIONS=TRUE + +.INCLUDE : settings.mk +CDEFS+= -DYY_NEVER_INTERACTIVE=1 +#CDEFS+= -pg + +.IF "$(SYSTEM_EXPAT)" == "YES" +CFLAGS+=-DSYSTEM_EXPAT +.ENDIF + + +# --- Files -------------------------------------------------------- + +OBJFILES= \ + $(OBJ)$/export.obj \ + $(OBJ)$/export2.obj \ + $(OBJ)$/merge.obj \ + $(OBJ)$/srciter.obj \ + $(OBJ)$/utf8conv.obj \ + $(OBJ)$/xmlparse.obj \ + $(OBJ)$/helpmerge.obj \ + $(OBJ)$/helpex.obj \ + $(OBJ)$/file.obj \ + $(OBJ)$/directory.obj + + +LIB1TARGET= $(LB)$/$(TARGET).lib +LIB1ARCHIV= $(LB)$/libtransex.a +#LIB1FILES= $(LB)$/transex3.lib +LIB1OBJFILES= $(OBJ)$/export.obj \ + $(OBJ)$/export2.obj \ + $(OBJ)$/merge.obj \ + $(OBJ)$/srciter.obj \ + $(OBJ)$/file.obj \ + $(OBJ)$/directory.obj \ + $(OBJ)$/utf8conv.obj + + +APP1VERSIONMAP=exports.map + +# extractor and merger for *.src and *.hrc +APP1TARGET= transex3 +#APP1OBJS= $(OBJ)$/src_yy.obj +APP1OBJS= $(OBJ)$/src_yy_wrapper.obj + +APP1STDLIBS+= \ + $(TOOLSLIB) \ + $(VOSLIB) \ + $(SALLIB) + +.IF "$(OS)"=="MACOSX" +# static libs at end for OS X +.ENDIF + +APP1LIBS+= $(LB)$/$(TARGET).lib +APP1DEPN= $(OBJ)$/src_yy_wrapper.obj $(LB)$/$(TARGET).lib + +APP2TARGET= helpex +APP2OBJS= $(OBJ)$/helpmerge.obj $(OBJ)$/xmlparse.obj $(OBJ)$/export2.obj $(OBJ)$/utf8conv.obj $(OBJ)$/merge.obj $(OBJ)$/helpex.obj +APP2RPATH= NONE + +.IF "$(OS)"!="MACOSX" +.ENDIF + +APP2STDLIBS+=$(SALLIB) $(EXPATASCII3RDLIB) $(TOOLSLIB) $(VOSLIB) + +.IF "$(OS)"=="MACOSX" +# static libs at end for OS X +.ENDIF + +# extractor and merger for *.lng and *.lng +APP3TARGET= ulfex +APP3OBJS= $(OBJ)$/lngmerge.obj $(OBJ)$/merge.obj $(OBJ)$/export2.obj $(OBJ)$/lngex.obj $(OBJ)$/utf8conv.obj +APP3RPATH= NONE + +.IF "$(OS)"!="MACOSX" +#APP3STDLIBS+= $(BTSTRPLIB) +.ENDIF +APP3STDLIBS+= \ + $(TOOLSLIB) \ + $(VOSLIB) \ + $(SALLIB) +.IF "$(OS)"=="MACOSX" +# static libs at end for OS X +.ENDIF + +# encoding converter for *.gsi +APP4TARGET= gsiconv +APP4OBJS= $(OBJ)$/utf8conv.obj $(OBJ)$/gsiconv.obj +APP4STDLIBS+= \ + $(TOOLSLIB) \ + $(VOSLIB) \ + $(SALLIB) + +# tag checker for *.gsi +APP5TARGET= gsicheck +APP5OBJS= $(OBJ)$/gsicheck.obj $(OBJ)$/tagtest.obj +APP5STDLIBS+= \ + $(TOOLSLIB) \ + $(VOSLIB) \ + $(SALLIB) + +# extractor and merger for *.cfg +APP6TARGET= cfgex +APP6OBJS= $(OBJ)$/cfgmerge.obj $(OBJ)$/cfg_yy_wrapper.obj $(OBJ)$/merge.obj $(OBJ)$/export2.obj $(OBJ)$/utf8conv.obj + +.IF "$(OS)"!="MACOSX" +#APP6STDLIBS+= $(BTSTRPLIB) +.ENDIF + +APP6STDLIBS+= \ + $(TOOLSLIB) \ + $(VOSLIB) \ + $(SALLIB) + +.IF "$(OS)"=="MACOSX" +# static libs at end for OS X +.ENDIF + +# extractor and merger for *.xrm +APP7TARGET= xrmex +APP7OBJS= $(OBJ)$/xrmmerge.obj $(OBJ)$/xrm_yy_wrapper.obj $(OBJ)$/merge.obj $(OBJ)$/export2.obj $(OBJ)$/utf8conv.obj +APP7RPATH= NONE + +.IF "$(OS)"!="MACOSX" +.ENDIF + +APP7STDLIBS+= \ + $(TOOLSLIB) \ + $(VOSLIB) \ + $(SALLIB) + +.IF "$(OS)"=="MACOSX" +# static libs at end for OS X +.ENDIF + +# +#APP8TARGET= treeconfig +#APP8OBJS= $(OBJ)$/treeconfig.obj $(OBJ)$/inireader.obj $(OBJ)$/export2.obj +#APP8STDLIBS=$(TOOLSLIB) $(SALLIB) $(VOSLIB) $(ICUINLIB) $(STLPORT) + +# localizer for l10n framework +APP9TARGET= localize_sl +EXCEPTIONSFILES= \ + $(OBJ)$/localize.obj +APP9OBJS= $(OBJ)$/localize.obj $(OBJ)$/utf8conv.obj $(OBJ)$/srciter.obj $(OBJ)$/export2.obj $(OBJ)$/file.obj $(OBJ)$/directory.obj $(OBJ)$/treeconfig.obj $(OBJ)$/inireader.obj + +APP9STDLIBS+= \ + $(TOOLSLIB) \ + $(VOSLIB) \ + $(ICUINLIB) \ + $(ICUUCLIB) \ + $(STLPORTLIB) \ + $(SALLIB) + +DEPOBJFILES=$(APP1OBJS) $(APP2OBJS) $(APP3OBJS) $(APP4OBJS) $(APP5OBJS) $(APP6OBJS) $(APP7OBJS) $(APP8OBJS) $(APP9OBJS) + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk + +$(MISC)$/%_yy.c : %lex.l + flex -l -w -8 -o$@ $< + +# Helper to suppress warnings in lex generated c code, see #i57362# + +$(OBJ)$/src_yy_wrapper.obj: $(MISC)$/src_yy.c +$(OBJ)$/cfg_yy_wrapper.obj: $(MISC)$/cfg_yy.c +$(OBJ)$/xrm_yy_wrapper.obj: $(MISC)$/xrm_yy.c + diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx new file mode 100644 index 000000000000..42f539065651 --- /dev/null +++ b/l10ntools/source/merge.cxx @@ -0,0 +1,445 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: merge.cxx,v $ + * $Revision: 1.27.36.3 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_l10ntools.hxx" +#include +#include +#include "export.hxx" +#include "utf8conv.hxx" +#include + +using namespace std; + +extern void ConvertHalfwitdhToFullwidth( String& rString ); + +// +// class PFormEntrys +// + +ByteString PFormEntrys::Dump(){ + ByteString sRet( "PFormEntrys\n" ); + //sRet.Append( Export::DumpMap( ByteString("sText") , sText ) ); + //sRet.Append("\n"); + ByteString a("sText"); + if ( sText.size() ) Export::DumpMap( a , sText ); + return sRet; +} + +/*****************************************************************************/ +BOOL PFormEntrys::GetText( ByteString &rReturn, + USHORT nTyp, const ByteString &nLangIndex, BOOL bDel ) +/*****************************************************************************/ +{ + + /*printf("DBG: PFormEntrys::GetText(nId=%s)\n",nLangIndex.GetBuffer() ); + + // DEBUG****************** + ByteStringHashMap::const_iterator idbg; + std::cout << "HASHKEYS : \n"; + for( idbg = sText.begin() ; idbg != sText.end(); ++idbg ) + std::cout << (idbg->first).GetBuffer() << "\n"; + std::cout << "\n\n"; + std::cout << "String sText[ nLangIndex ] = " << sText[ nLangIndex ].GetBuffer() << "\n"; + // DEBUG****************** +*/ + + BOOL bReturn=TRUE; + switch ( nTyp ) { + case STRING_TYP_TEXT : + rReturn = sText[ nLangIndex ]; + if ( bDel ) + sText[ nLangIndex ] = ""; + bReturn = bTextFirst[ nLangIndex ]; + bTextFirst[ nLangIndex ] = FALSE; + break; + case STRING_TYP_HELPTEXT : + rReturn = sHelpText; + break; + case STRING_TYP_QUICKHELPTEXT : + rReturn = sQuickHelpText[ nLangIndex ]; + if ( bDel ) + sQuickHelpText[ nLangIndex ] = ""; + bReturn = bQuickHelpTextFirst[ nLangIndex ]; + bQuickHelpTextFirst[ nLangIndex ] = FALSE; + break; + case STRING_TYP_TITLE : + rReturn = sTitle[ nLangIndex ]; + if ( bDel ) + sTitle[ nLangIndex ] = ""; + bReturn = bTitleFirst[ nLangIndex ]; + bTitleFirst[ nLangIndex ] = FALSE; + break; + } + //printf("Returning '%s'\n",rReturn.GetBuffer()); + return bReturn; +} + + +// +// class MergeData +// + +/*****************************************************************************/ +MergeData::~MergeData() +/*****************************************************************************/ +{ +} + +/*****************************************************************************/ +PFormEntrys* MergeData::GetPFormEntrys( ResData *pResData ) +/*****************************************************************************/ +{ + + (void) pResData; // FIXME + if( aMap.find( ByteString("HACK") ) != aMap.end() ){ + return aMap[ ByteString("HACK") ]; + } + else{ + return 0; + } +} + +void MergeData::Insert( const ByteString& rPFO , PFormEntrys* pfEntrys ){ + (void) rPFO; // FIXME + aMap.insert( PFormEntrysHashMap::value_type( ByteString("HACK") , pfEntrys ) ); + +} +ByteString MergeData::Dump(){ + ByteString sRet( "MergeData\n" ); + + printf("MergeData sTyp = %s , sGid = %s , sLid =%s , sFilename = %s\n",sTyp.GetBuffer(),sGID.GetBuffer(),sLID.GetBuffer(), sFilename.GetBuffer() ); + + PFormEntrysHashMap::const_iterator idbg; + for( idbg = aMap.begin() ; idbg != aMap.end(); ++idbg ){ + printf("aMap[ %s ] = " ,idbg->first.GetBuffer()); + ( (PFormEntrys*)(idbg->second) )->Dump(); + printf("\n") ; + } + printf("\n") ; + return sRet; +} + +PFormEntrys* MergeData::GetPFObject( const ByteString& rPFO ){ + if( aMap.find( ByteString("HACK") ) != aMap.end() ){ + return aMap[ rPFO ]; + } + else{ + return 0; + } +} + + +/*****************************************************************************/ +PFormEntrys *MergeData::InsertEntry( const ByteString &rPForm ) +/*****************************************************************************/ +{ + PFormEntrys* pFEntrys = new PFormEntrys( rPForm ); + aMap.insert( PFormEntrysHashMap::value_type( rPForm , pFEntrys ) ); + return pFEntrys; +} + +/*****************************************************************************/ +BOOL MergeData::operator==( ResData *pData ) +/*****************************************************************************/ +{ + ByteString sResTyp_upper( pData->sResTyp ); + sResTyp_upper.ToUpperAscii(); + ByteString sTyp_upper( sTyp ); + sTyp_upper.ToUpperAscii(); + + return (( pData->sId == sLID ) && + ( pData->sGId == sGID ) && + ( sResTyp_upper == sTyp_upper ) + ); +} + +// +// class MergeDataFile +// + +#define FFORMAT_UNKNOWN 0x0000 +#define FFORMAT_NEW 0x0001 +#define FFORMAT_OLD 0x0002 + +/*****************************************************************************/ +MergeDataFile::MergeDataFile( const ByteString &rFileName, const ByteString& sFile ,BOOL bErrLog, +// CharSet aCharSet, BOOL bUTF8 , bool bCaseSensitive ) + CharSet aCharSet, bool bCaseSensitive ) + +/*****************************************************************************/ + : bErrorLog( bErrLog ) +{ + + SvFileStream aInputStream( String( rFileName, RTL_TEXTENCODING_ASCII_US ), STREAM_STD_READ ); + aInputStream.SetStreamCharSet( aCharSet ); + ByteString sLine; +// printf("\nReading localize.sdf ...\n"); + ByteString sTYP; + ByteString sGID; + ByteString sLID; + ByteString sPFO; + ByteString nLANG; + ByteString sTEXT; + ByteString sQHTEXT; + ByteString sTITLE; + ByteString sHACK("HACK"); + + const ByteString sEmpty(""); + + if( !aInputStream.IsOpen() ) { + printf("Warning : Can't open %s\n", rFileName.GetBuffer()); + //exit( -1 ); + return; + } + while ( !aInputStream.IsEof()) { + xub_StrLen nToks; + aInputStream.ReadLine( sLine ); + sLine = sLine.Convert( RTL_TEXTENCODING_MS_1252, aCharSet ); + + nToks = sLine.GetTokenCount( '\t' ); + if ( nToks == 15 ) { + // Skip all wrong filenames + ByteString filename = sLine.GetToken( 1 , '\t' ); + filename = filename.Copy( filename.SearchCharBackward( "\\" )+1 , filename.Len() ); + + if( sFile.Equals( sEmpty ) || ( !sFile.Equals( sEmpty ) && filename.Equals( sFile ) ) ) + { + xub_StrLen rIdx = 0; + sTYP = sLine.GetToken( 3, '\t', rIdx ); + sGID = sLine.GetToken( 0, '\t', rIdx ); // 4 + sLID = sLine.GetToken( 0, '\t', rIdx ); // 5 + sPFO = sLine.GetToken( 1, '\t', rIdx ); // 7 + sPFO = sHACK; + nLANG = sLine.GetToken( 1, '\t', rIdx ); // 9 + sTEXT = sLine.GetToken( 0, '\t', rIdx ); // 10 + + sQHTEXT = sLine.GetToken( 1, '\t', rIdx ); // 12 + sTITLE = sLine.GetToken( 0, '\t', rIdx ); // 13 + + nLANG.EraseLeadingAndTrailingChars(); + +#ifdef MERGE_SOURCE_LANGUAGES + if( true ){ +#else + if ( !nLANG.EqualsIgnoreCaseAscii("en-US") ){ +#endif + ByteStringHashMap::const_iterator lit; + lit = aLanguageMap.find (nLANG); + ByteString aLANG; + if (lit == aLanguageMap.end()) { + aLANG = nLANG; + aLanguageMap.insert( ByteStringHashMap::value_type( aLANG, aLANG ) ); + // Remember read languages for -l all switch + aLanguageList.push_back( nLANG ); + } else + aLANG = lit->first; + + InsertEntry( sTYP, sGID, sLID, sPFO, aLANG, sTEXT, sQHTEXT, sTITLE , filename , bCaseSensitive ); + } + } + } + else if ( nToks == 10 ) { + printf("ERROR: File format is obsolete and no longer supported!\n"); + } + } + aInputStream.Close(); +} +/*****************************************************************************/ +MergeDataFile::~MergeDataFile() +/*****************************************************************************/ +{ +} + +/*****************************************************************************/ +//void MergeDataFile::WriteErrorLog( const ByteString &rFileName ) +/*****************************************************************************/ +//{ +// DEAD +//} + +ByteString MergeDataFile::Dump(){ + ByteString sRet( "MergeDataFile\n" ); + + //sRet.Append( Export::DumpMap( "aLanguageSet" , aLanguageSet ) ); + //sRet.Append( Export::DumpMap( "aLanguageList" , aLanguageList ) ); + printf("MergeDataFile\n"); + MergeDataHashMap::const_iterator idbg; + for( idbg = aMap.begin() ; idbg != aMap.end(); ++idbg ){ + /*sRet.Append( "aMap[" ); + sRet.Append( idbg->first ); + sRet.Append( "]= " ); + sRet.Append( ((MergeData*) (idbg->second))->Dump() ); + sRet.Append("\n");*/ + + printf("aMap[ %s ] = ",idbg->first.GetBuffer()); + ((MergeData*) (idbg->second))->Dump(); + printf("\n"); + } + printf("\n"); + //sRet.Append("\n"); + return sRet; +} + +/*****************************************************************************/ +void MergeDataFile::WriteError( const ByteString &rLine ) +/*****************************************************************************/ +{ + if ( bErrorLog ) { + if ( !aErrLog.IsOpen()) + aErrLog.Open( String( sErrorLog, RTL_TEXTENCODING_ASCII_US ), STREAM_STD_WRITE | STREAM_TRUNC ); + aErrLog.WriteLine( rLine ); + } + else + fprintf( stderr, "%s\n", rLine.GetBuffer()); +} +std::vector MergeDataFile::GetLanguages(){ + return aLanguageList; +} + +/*****************************************************************************/ +MergeData *MergeDataFile::GetMergeData( ResData *pResData , bool bCaseSensitive ) +/*****************************************************************************/ +{ + ByteString sOldG = pResData->sGId; + ByteString sOldL = pResData->sId; + ByteString sGID = pResData->sGId; + ByteString sLID; + if ( !sGID.Len()) + sGID = pResData->sId; + else + sLID = pResData->sId; + pResData->sGId = sGID; + pResData->sId = sLID; + + ByteString sKey = CreateKey( pResData->sResTyp , pResData->sGId , pResData->sId , pResData->sFilename , bCaseSensitive ); + + //printf("DBG: Searching [%s]\n",sKey.GetBuffer()); + if( aMap.find( sKey ) != aMap.end() ){ + pResData->sGId = sOldG; + pResData->sId = sOldL; + //printf("DBG: Found[%s]\n",sKey.GetBuffer()); + return aMap[ sKey ]; + } + pResData->sGId = sOldG; + pResData->sId = sOldL; + //printf("DBG: Found[%s]\n",sKey.GetBuffer()); + return NULL; +} + + +/*****************************************************************************/ +PFormEntrys *MergeDataFile::GetPFormEntrys( ResData *pResData ) +/*****************************************************************************/ +{ + // search for requested PFormEntrys + MergeData *pData = GetMergeData( pResData ); + if ( pData ) + return pData->GetPFormEntrys( pResData ); + return NULL; +} + +/*****************************************************************************/ +PFormEntrys *MergeDataFile::GetPFormEntrysCaseSensitive( ResData *pResData ) +/*****************************************************************************/ +{ + // search for requested PFormEntrys + MergeData *pData = GetMergeData( pResData , true ); + if ( pData ) + return pData->GetPFormEntrys( pResData ); + return NULL; +} +/*****************************************************************************/ +void MergeDataFile::InsertEntry( + const ByteString &rTYP, const ByteString &rGID, + const ByteString &rLID, const ByteString &rPFO, + const ByteString &nLANG, const ByteString &rTEXT, + const ByteString &rQHTEXT, const ByteString &rTITLE , + const ByteString &rInFilename , bool bCaseSensitive + ) +/*****************************************************************************/ +{ + MergeData *pData; + BOOL bFound = FALSE; + + // uniquify the filename to save memory. + ByteStringHashMap::const_iterator fit = aFilenames.find (rInFilename); + ByteString aFilename; + if (fit == aFilenames.end()) { + aFilename = rInFilename; + aFilenames.insert (ByteStringHashMap::value_type (aFilename, aFilename)); + } else + aFilename = fit->first; + + // search for MergeData + + ByteString sKey = CreateKey( rTYP , rGID , rLID , aFilename , bCaseSensitive ); + MergeDataHashMap::const_iterator mit; + mit = aMap.find( sKey ); + if( mit != aMap.end() ){ + pData = mit->second; + }else{ + pData = new MergeData( rTYP, rGID, rLID, aFilename ); + aMap.insert( MergeDataHashMap::value_type( sKey, pData ) ); + } + + bFound = FALSE; + PFormEntrys *pFEntrys = 0; + + // search for PFormEntrys + + pFEntrys = pData->GetPFObject( rPFO ); + if( !pFEntrys ){ + // create new PFormEntrys, cause no one exists with current properties + pFEntrys = new PFormEntrys( rPFO ); + pData->Insert( rPFO , pFEntrys ); + } + + // finaly insert the cur string + + pFEntrys->InsertEntry( nLANG , rTEXT, rQHTEXT, rTITLE ); + + //printf("DBG: MergeDataFile::Insert[]=( sKey=%s,nLang=%s,rTEXT=%s)\n",sKey2.GetBuffer(),nLANG.GetBuffer(),rTEXT.GetBuffer()); +} +ByteString MergeDataFile::CreateKey( const ByteString& rTYP , const ByteString& rGID , const ByteString& rLID , const ByteString& rFilename , bool bCaseSensitive ){ + + ByteString sKey( rTYP ); + sKey.Append( '-' ); + sKey.Append( rGID ); + sKey.Append( '-' ); + sKey.Append( rLID ); + sKey.Append( '-' ); + sKey.Append( rFilename ); + + if( bCaseSensitive ) return sKey; // officecfg case sensitive identifier + else return sKey.ToUpperAscii(); +} + + diff --git a/l10ntools/source/src_yy_wrapper.c b/l10ntools/source/src_yy_wrapper.c new file mode 100644 index 000000000000..d326b9a94e86 --- /dev/null +++ b/l10ntools/source/src_yy_wrapper.c @@ -0,0 +1,2 @@ +// Helper to suppress warnings in lex generated c code, see #i57362# +#include "src_yy.c" diff --git a/l10ntools/source/srciter.cxx b/l10ntools/source/srciter.cxx new file mode 100644 index 000000000000..cf04de4bf3fa --- /dev/null +++ b/l10ntools/source/srciter.cxx @@ -0,0 +1,141 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: srciter.cxx,v $ + * $Revision: 1.14 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_l10ntools.hxx" + +#include "srciter.hxx" +#include +#include + +// +// class SourceTreeIterator +// + +/*****************************************************************************/ +SourceTreeIterator::SourceTreeIterator( + const ByteString &rRootDirectory, const ByteString &rVersion , bool bLocal_in ) +/*****************************************************************************/ + : bInExecute( FALSE ) , bLocal( bLocal_in ) +{ + (void) rVersion ; + + if(!bLocal){ + rtl::OUString sRootDirectory( rRootDirectory.GetBuffer() , rRootDirectory.Len() , RTL_TEXTENCODING_UTF8 ); + aRootDirectory = transex::Directory( sRootDirectory ); + } +} + +/*****************************************************************************/ +SourceTreeIterator::~SourceTreeIterator() +/*****************************************************************************/ +{ +} + +/*****************************************************************************/ +void SourceTreeIterator::ExecuteDirectory( transex::Directory& aDirectory ) +/*****************************************************************************/ +{ + if ( bInExecute ) { + rtl::OUString sDirName = aDirectory.getDirectoryName(); + + static rtl::OUString WCARD1 ( rtl::OUString::createFromAscii( "unxlng" ) ); + static rtl::OUString WCARD2 ( rtl::OUString::createFromAscii( "unxsol" ) ); + static rtl::OUString WCARD3 ( rtl::OUString::createFromAscii( "wntmsc" ) ); + static rtl::OUString WCARD4 ( rtl::OUString::createFromAscii( "common" ) ); + static rtl::OUString WCARD5 ( rtl::OUString::createFromAscii( "unxmac" ) ); + static rtl::OUString WCARD6 ( rtl::OUString::createFromAscii( "unxubt" ) ); + static rtl::OUString WCARD7 ( rtl::OUString::createFromAscii( ".svn" ) ); + + + if( sDirName.indexOf( WCARD1 , 0 ) > -1 || + sDirName.indexOf( WCARD2 , 0 ) > -1 || + sDirName.indexOf( WCARD3 , 0 ) > -1 || + sDirName.indexOf( WCARD4 , 0 ) > -1 || + sDirName.indexOf( WCARD5 , 0 ) > -1 || + sDirName.indexOf( WCARD6 , 0 ) > -1 || + sDirName.indexOf( WCARD7 , 0 ) > -1 + ) return; + //printf("**** %s \n", OUStringToOString( sDirName , RTL_TEXTENCODING_UTF8 , sDirName.getLength() ).getStr() ); + + rtl::OUString sDirNameTmp = aDirectory.getFullName(); + ByteString sDirNameTmpB( rtl::OUStringToOString( sDirNameTmp , RTL_TEXTENCODING_UTF8 , sDirName.getLength() ).getStr() ); + +#ifdef WNT + sDirNameTmpB.Append( ByteString("\\no_localization") ); +#else + sDirNameTmpB.Append( ByteString("/no_localization") ); +#endif + //printf("**** %s \n", OUStringToOString( sDirNameTmp , RTL_TEXTENCODING_UTF8 , sDirName.getLength() ).getStr() ); + + DirEntry aDE( sDirNameTmpB.GetBuffer() ); + if( aDE.Exists() ) + { + //printf("#### no_localization file found ... skipping"); + return; + } + + aDirectory.setSkipLinks( bSkipLinks ); + aDirectory.readDirectory(); + OnExecuteDirectory( aDirectory.getFullName() ); + if ( aDirectory.getSubDirectories().size() ) + for ( ULONG i=0;i < aDirectory.getSubDirectories().size();i++ ) + ExecuteDirectory( aDirectory.getSubDirectories()[ i ] ); + } +} + +/*****************************************************************************/ +BOOL SourceTreeIterator::StartExecute() +/*****************************************************************************/ +{ + + bInExecute = TRUE; // FIXME + ExecuteDirectory( aRootDirectory ); + + if ( bInExecute ) { // FIXME + bInExecute = FALSE; + return TRUE; + } + return FALSE; +} + +/*****************************************************************************/ +void SourceTreeIterator::EndExecute() +/*****************************************************************************/ +{ + bInExecute = FALSE; +} + +/*****************************************************************************/ +void SourceTreeIterator::OnExecuteDirectory( const rtl::OUString &rDirectory ) +/*****************************************************************************/ +{ + fprintf( stdout, "%s\n", rtl::OUStringToOString( rDirectory, RTL_TEXTENCODING_UTF8, rDirectory.getLength() ).getStr() ); +} diff --git a/l10ntools/source/srclex.l b/l10ntools/source/srclex.l new file mode 100644 index 000000000000..fef251e47224 --- /dev/null +++ b/l10ntools/source/srclex.l @@ -0,0 +1,308 @@ + +%{ +/* + * lexer for parsing ressource source files (*.src) + * + */ + + +/* enlarge token buffer to tokenize whole strings */ +#undef YYLMAX +#define YYLMAX 64000 + +/* to enable debug output define LEXDEBUG */ +#define LEXDEBUG 1 +#ifdef LEXDEBUG +#define OUTPUT fprintf +#else +#define OUTPUT(Par1,Par2); +#endif + +/* table of possible token ids */ +#include "tokens.h" +#include +#include + +#if defined __GNUC__ +#pragma GCC system_header +#elif defined __SINPRO_CC +#pragma disable_warn +#elif defined _MSC_VER +#pragma warning(push, 1) +#endif + +/* external functions (C++ code, declared as extren "C" */ +extern int WorkOnTokenSet( int, char* ); +extern int InitExport( char * , char * ); +extern int Parse( int nTyp, char *pTokenText ); +extern int EndExport(); +extern int SetError(); +extern int GetError(); +extern char *GetOutputFile( int argc, char* argv[]); +extern FILE *GetNextFile(); +extern int isQuiet(); +extern void Close(); +extern char* getFilename(); + +/* forwards */ +void YYWarning(); +%} + +%p 24000 +%e 1200 +%n 500 + +%% + +^[\t ]*"#pragma".* { + WorkOnTokenSet( PRAGMA, yytext ); +} + +^[ \t]*\n { + WorkOnTokenSet( EMPTYLINE, yytext ); +} + +[\t ]+ | +^[\t ]*"#include".* | +^[\t ]*"#undef".* | +"//".* | +";" | +"<" | +">" | +\n { + WorkOnTokenSet( IGNOREDTOKENS, yytext ); +} +"/*" { + char c1 = 0, c2 = input(); + char pChar[2]; + pChar[1] = 0x00; + pChar[0] = c2; + + WorkOnTokenSet( COMMEND, yytext ); + WorkOnTokenSet( COMMEND, pChar ); + for(;;) { + if ( c2 == EOF ) + break; + if ( c1 == '*' && c2 == '/' ) + break; + c1 = c2; + c2 = input(); + pChar[0] = c2; + WorkOnTokenSet( COMMEND, pChar ); + } +} + +^[\t ]*"#ifndef".+$ | +^[\t ]*"#ifdef".+$ | +^[\t ]*"#if".+$ | +^[\t ]*"#elif".*$ | +^[\t ]*"#else".*$ | +^[\t ]*"#endif".*$ { + WorkOnTokenSet( CONDITION, yytext ); +} + +[a-zA-Z]+[\t ]+[^={\n]+[\t ] { +/* defined Res */ + WorkOnTokenSet( DEFINEDRES, yytext ); +} + +[a-zA-Z]+[ \t]+[^={;\n]+\n[ \t]*"#".*\n[ \t]*"{" | +[a-zA-Z]+[ \t]+[^={;\n]+\n?([ \t]*"//".*\n)*[ \t]*"{" { +/* RESSOURCE // String TTT_XX ... */ + WorkOnTokenSet( RESSOURCE, yytext ); +} + +^[\t ]*[a-zA-Z_]+[\t ]*"\\"?[\t ]*\n?[ \t]*"{"[\t ]*"\\"? { +/* SMALRESSOURCE // String ... */ + WorkOnTokenSet( SMALRESSOURCE, yytext ); +} + +[\t ]*[a-zA-Z0-9_]+[ \t]*("["[ \t]*[a-zA-Z0-9_\-]+[ \t]*"]"[ \t]*)?=[ \t]*L?\".*\".*\n? { +/* TEXTLINE // TextTyp = "A Text" */ + WorkOnTokenSet( TEXTLINE, yytext ); +} + +[\t ]*[a-zA-Z0-9_]+[ \t]*("["[ \t]*[a-zA-Z0-9_\-]+[ \t]*"]"[ \t]*)?(\n[ \t]*)?=([ \t]*\n)?(([a-zA-Z0-9_]+)|(\".*\")|([ \t\n]*))*\".*\"(([a-zA-Z0-9_]+)|(\".*\")|([ \t\n]*))*; { +/* LONGTEXTLINE // TextTyp = "A Text" HHH_XXX "A Text" ZZZ_TTT ... */ + WorkOnTokenSet( LONGTEXTLINE, yytext ); +} + +\".*\" { +/* TEXT // "A Text" */ + WorkOnTokenSet( TEXT, yytext ); +} + +"{"[ \t]*\\? { +/* LEVELUP */ + WorkOnTokenSet( LEVELUP, yytext ); +} + +"}"[ \t]*;([ \t]*\\)? { +/* LEVELDOWN */ + WorkOnTokenSet( LEVELDOWN, yytext ); +} + +[a-zA-Z0-9_]+[ \t]*"="[ \t]*"MAP_APPFONT"[ \t]*"(".+")".* { +/* APPFONTMAPPING Typ = MAP_APPFONT( ... ) */ + WorkOnTokenSet( APPFONTMAPPING, yytext ); +} + +[ \t]*[a-zA-Z0-9_]+[ \t]*=[ \t]*[0123456789]{1,5}[ \t]*";"?\\? { +/* TEXTREFID // TextTyp = 12345 */ + WorkOnTokenSet( TEXTREFID, yytext ); +} + +[a-zA-Z0-9_]+[ \t]*"="[\t ]*([ \t]*"//".*\n)*.* | +[a-zA-Z0-9_]+[ \t]*"=".* { +/* ASSIGNMENT Typ = ... */ + WorkOnTokenSet( ASSIGNMENT, yytext ); +} + + + +[a-zA-Z0-9_]+[ \t]*("["[ \t]*[a-zA-Z0-9_\-]+[ \t]*"]"[ \t]*)?"="[ \t]*(\\[ \t]*)?\n?[ \t]*"{"[ \t]*(\\[ \t]*)?\n?[ \t]*"<" { +/* LISTASSIGNMENT Typ [ ... ] = ... */ + WorkOnTokenSet( LISTASSIGNMENT, yytext ); +} + +"StringList"+[ \t]*("["[ \t]*[a-zA-Z0-9_\-]+[ \t]*"]"[ \t]*)?"="[ \t]*(\\[ \t]*)?\n?[ \t]*"{"[ \t]*(\\[ \t]*)?\n?[ \t]* { +/* LISTASSIGNMENT Typ [ ... ] = ... */ + WorkOnTokenSet( LISTASSIGNMENT, yytext ); +} + +"UIEntries"[ \t]*("["[ \t]*[a-zA-Z0-9_\-]+[ \t]*"]"[ \t]*)?"="[ \t]*(\\[ \t]*)?\n?[ \t]*"{" { +/* UIENTRIES */ + WorkOnTokenSet( UIENTRIES, yytext ); +} + +"<"?[ \t]*L?\".*\".*">" { +/* LISTTEXT */ + WorkOnTokenSet( LISTTEXT, yytext ); +} + +[ \t]*"#define"[ \t]+[a-zA-Z0-9_]+.*"\\" { +/* RSCDEFINE #define ... */ + WorkOnTokenSet( RSCDEFINE, yytext ); +} + +[ \t]*"#define"[ \t]+[a-zA-Z0-9_]+.+ { +/* #define ... */ + WorkOnTokenSet( NORMDEFINE, yytext ); +} + +"\\" { +/* RSCDEFINELEND */ + WorkOnTokenSet( RSCDEFINELEND, yytext ); +} + +[a-zA-Z0-9_]+[ \t]*; { +/* allowed other tokens like "49 ;" or "SFX_... ;" */ + WorkOnTokenSet( ANYTOKEN, yytext ); +} + +. { + WorkOnTokenSet( UNKNOWNCHAR, yytext ); +/* YYWarning( "Unknown Char" ); */ +} + +"{"?[ \t]*\".*\"[ \t]*";"[ \t]*"}" { +/* _LISTTEXT */ + WorkOnTokenSet( _LISTTEXT, yytext ); +} + +%% + +/*****************************************************************************/ +int yywrap(void) +/*****************************************************************************/ +{ + FILE *pFile; + pFile = GetNextFile(); + if ( pFile ) { + yyin = pFile; + yylineno = 0; + return 0; + } + + /* end of input reached */ + return 1; +} + +/*****************************************************************************/ +void YYWarning( char *s ) +/*****************************************************************************/ +{ + /* write warning to stderr */ + fprintf( stderr, "Warning: \"%s\" in line %d: \"%s\"\n", s, yylineno, yytext ); +} + +/*****************************************************************************/ +void yyerror( char *s ) +/*****************************************************************************/ +{ + /* write error to stderr */ + fprintf( stderr, "Error: \"%s\" in line %d: \"%s\"\n", s, yylineno, yytext ); + SetError(); +} + +/*****************************************************************************/ +int +#ifdef WNT +_cdecl +#endif +main( int argc, char* argv[]) +/*****************************************************************************/ +{ + /* error level */ + int nRetValue = 0; + char *pOutput; + FILE *pFile; + + pOutput = GetOutputFile( argc, argv ); + if( !isQuiet() ){ + fprintf( stdout, "\nTransEx 3.1 Copyright 2000 Sun Microsystems, Inc. All Rights Reserved.\n" ); + fprintf( stdout, "========================================================================\n" ); + } + + if ( !pOutput ) { + fprintf( stdout, "Syntax:TRANSEX[-p Prj][-r PrjRoot]-i FileIn...[-o FileOut][-m DataBase][-e][-b][-u][-L l1,l2,...]\n" ); + fprintf( stdout, " Prj: Project\n" ); + fprintf( stdout, " PrjRoot: Path to project root (..\\.. etc.)\n" ); + fprintf( stdout, " FileIn: Source files (*.src)\n" ); + fprintf( stdout, " FileOut: Destination file (*.*)\n" ); + fprintf( stdout, " DataBase: Mergedata (*.sdf)\n" ); + fprintf( stdout, " -QQ: quiet output\n" ); + fprintf( stdout, " -e: Disable writing errorlog\n" ); + fprintf( stdout, " -b: Break when Token \"HelpText\" found in source\n" ); + fprintf( stdout, " -u: [english] and [german] are allowed, Id is Taken from DataBase \n" ); + fprintf( stdout, " -NOUTF8: disable UTF8 as language independent encoding\n" ); + fprintf( stdout, " -L: Restrict the handled languages. l1,l2,... are elements of (de,en-US...)\n" ); + fprintf( stdout, " A fallback language can be defined like this: l1=f1.\n" ); + fprintf( stdout, " f1, f2,... are also elements of (de,en-US...)\n" ); + fprintf( stdout, " Example: -L de,es=en-US\n" ); + fprintf( stdout, " Restriction to de and es, en-US will be fallback for es\n" ); + return 1; + } + + InitExport( pOutput , getFilename() ); + pFile = GetNextFile(); + if ( !pFile ) + return 1; + + yyin = pFile; + + /* create global instance of class Export */ + + /* start parser */ + yylex(); + Close(); + + /* get error info. and end export */ + nRetValue = GetError(); + EndExport(); + + if( !isQuiet() ) fprintf( stdout, "\n===================================\n\n" ); + + /* return error level */ + return nRetValue; +} diff --git a/l10ntools/source/tagtest.cxx b/l10ntools/source/tagtest.cxx new file mode 100644 index 000000000000..7896915ede0c --- /dev/null +++ b/l10ntools/source/tagtest.cxx @@ -0,0 +1,1577 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: tagtest.cxx,v $ + * $Revision: 1.20 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_l10ntools.hxx" +#include +#include "tagtest.hxx" + +#if OSL_DEBUG_LEVEL > 1 +#include +#endif + +#include "gsicheck.hxx" + +#define HAS_FLAG( nFlags, nFlag ) ( ( nFlags & nFlag ) != 0 ) +#define SET_FLAG( nFlags, nFlag ) ( nFlags |= nFlag ) +#define RESET_FLAG( nFlags, nFlag ) ( nFlags &= ~nFlag ) // ~ = Bitweises NOT + + + +TokenInfo::TokenInfo( TokenId pnId, USHORT nP, String paStr, ParserMessageList &rErrorList ) +: bClosed(FALSE) +, bCloseTag(FALSE) +, bIsBroken(FALSE) +, bHasBeenFixed(FALSE) +, bDone(FALSE) +, aTokenString( paStr ) +, nId( pnId ) +, nPos(nP) +{ + if ( nId == TAG_COMMONSTART || nId == TAG_COMMONEND ) + SplitTag( rErrorList ); +} + +enum tagcheck { TC_START, TC_HAS_TAG_NAME, TC_HAS_PROP_NAME_EQ, TC_HAS_PROP_NAME_EQ_SP, TC_HAS_PROP_NAME_SP, TC_INSIDE_STRING, TC_PROP_FINISHED, TC_CLOSED, TC_CLOSED_SPACE, TC_CLOSETAG, TC_CLOSETAG_HAS_TAG_NAME, TC_FINISHED, TC_ERROR }; + +/* + \< link href = \"text\" name = \"C\" \> +START ' ' -> HAS_TAG_NAME +START '/' -> CLOSED +START '/' -> CLOSETAG - no Portion (starting with /) +START '>' -> FINISHED +HAS_TAG_NAME '=' -> HAS_PROP_NAME_EQ +HAS_TAG_NAME ' ' -> HAS_PROP_NAME_SP +HAS_TAG_NAME '/' -> CLOSED +HAS_TAG_NAME '>' -> FINISHED +HAS_PROP_NAME_SP '=' -> HAS_PROP_NAME_EQ +HAS_PROP_NAME_EQ ' ' -> HAS_PROP_NAME_EQ_SP +HAS_PROP_NAME_EQ '"' -> INSIDE_STRING +HAS_PROP_NAME_EQ_SP '"' -> INSIDE_STRING +INSIDE_STRING ' ' -> INSIDE_STRING +INSIDE_STRING '=' -> INSIDE_STRING +INSIDE_STRING '>' -> INSIDE_STRING +INSIDE_STRING '"' -> PROP_FINISHED +PROP_FINISHED ' ' -> HAS_TAG_NAME +PROP_FINISHED '/' -> CLOSED +PROP_FINISHED '>' -> FINISHED +CLOSED ' ' -> CLOSED_SPACE +CLOSED '>' -> FINISHED +CLOSED_SPACE '>' -> FINISHED + +CLOSETAG ' ' -> CLOSETAG_HAS_TAG_NAME +CLOSETAG '>' -> FINISHED +CLOSETAG_HAS_TAG_NAME '>' -> FINISHED + +*/ +void TokenInfo::SplitTag( ParserMessageList &rErrorList ) +{ + USHORT nLastPos = 2; // skip initial \< + USHORT nCheckPos = nLastPos; + String aDelims( String::CreateFromAscii( " \\=>/" ) ); + String aPortion; + String aValue; // store the value of a property + ByteString aName; // store the name of a property/tag + BOOL bCheckName = FALSE; + BOOL bCheckEmpty = FALSE; + sal_Unicode cDelim; + tagcheck aState = TC_START; + + // skip blanks + while ( nLastPos < aTokenString.Len() && aTokenString.GetChar( nLastPos ) == ' ') + nLastPos++; + + nCheckPos = aTokenString.SearchChar( aDelims.GetBuffer(), nLastPos ); + while ( nCheckPos != STRING_NOTFOUND && !( aState == TC_FINISHED || aState == TC_ERROR ) ) + { + aPortion = aTokenString.Copy( nLastPos, nCheckPos-nLastPos ); + + if ( aTokenString.GetChar( nCheckPos ) == '\\' ) + nCheckPos++; + + cDelim = aTokenString.GetChar( nCheckPos ); + nCheckPos++; + + switch ( aState ) + { +// START ' ' -> HAS_TAG_NAME +// START '/' -> CLOSED +// START '>' -> FINISHED + case TC_START: + aTagName = aPortion; + switch ( cDelim ) + { + case ' ': aState = TC_HAS_TAG_NAME; + bCheckName = TRUE; + break; + case '/': + { + if ( aPortion.Len() == 0 ) + { + aState = TC_CLOSETAG; + } + else + { + aState = TC_CLOSED; + bCheckName = TRUE; + } + } + break; + case '>': aState = TC_FINISHED; + bCheckName = TRUE; + break; + default: aState = TC_ERROR; + } + break; + +// HAS_TAG_NAME '=' -> HAS_PROP_NAME_EQ +// HAS_TAG_NAME ' ' -> HAS_PROP_NAME_SP +// HAS_TAG_NAME '/' -> CLOSED +// HAS_TAG_NAME '>' -> FINISHED + case TC_HAS_TAG_NAME: + switch ( cDelim ) + { + case '=': aState = TC_HAS_PROP_NAME_EQ; + bCheckName = TRUE; + break; + case ' ': aState = TC_HAS_PROP_NAME_SP; + bCheckName = TRUE; + break; + case '/': aState = TC_CLOSED; + bCheckEmpty = TRUE; + break; + case '>': aState = TC_FINISHED; + bCheckEmpty = TRUE; + break; + default: aState = TC_ERROR; + } + break; + +// HAS_PROP_NAME_SP '=' -> HAS_PROP_NAME_EQ + case TC_HAS_PROP_NAME_SP: + switch ( cDelim ) + { + case '=': aState = TC_HAS_PROP_NAME_EQ; + bCheckEmpty = TRUE; + break; + default: aState = TC_ERROR; + } + break; + +// HAS_PROP_NAME_EQ ' ' -> HAS_PROP_NAME_EQ_SP +// HAS_PROP_NAME_EQ '"' -> INSIDE_STRING + case TC_HAS_PROP_NAME_EQ: + switch ( cDelim ) + { + case ' ': aState = TC_HAS_PROP_NAME_EQ_SP; + bCheckEmpty = TRUE; + break; + case '\"': aState = TC_INSIDE_STRING; + bCheckEmpty = TRUE; + aValue.Erase(); + break; + default: aState = TC_ERROR; + } + break; + +// HAS_PROP_NAME_EQ_SP '"' -> INSIDE_STRING + case TC_HAS_PROP_NAME_EQ_SP: + switch ( cDelim ) + { + case '\"': aState = TC_INSIDE_STRING; + bCheckEmpty = TRUE; + aValue.Erase(); + break; + default: aState = TC_ERROR; + } + break; + +// INSIDE_STRING * -> INSIDE_STRING +// INSIDE_STRING '"' -> PROP_FINISHED + case TC_INSIDE_STRING: + switch ( cDelim ) + { + case '\"': + { + aState = TC_PROP_FINISHED; + aValue += aPortion; + if ( aProperties.find( aName ) == aProperties.end() ) + { + if ( !IsPropertyValueValid( aName, aValue ) ) + { + rErrorList.AddError( 25, ByteString("Property '").Append(aName).Append("' has invalid value '").Append(ByteString( aValue, RTL_TEXTENCODING_UTF8 )).Append("' "), *this ); + bIsBroken = TRUE; + } + aProperties[ aName ] = aValue; + } + else + { + rErrorList.AddError( 25, ByteString("Property '").Append(aName).Append("' defined twice "), *this ); + bIsBroken = TRUE; + } + } + break; + default: + { + aState = TC_INSIDE_STRING; + aValue += aPortion; + aValue += cDelim; + } + } + break; + +// PROP_FINISHED ' ' -> HAS_TAG_NAME +// PROP_FINISHED '/' -> CLOSED +// PROP_FINISHED '>' -> FINISHED + case TC_PROP_FINISHED: + switch ( cDelim ) + { + case ' ': aState = TC_HAS_TAG_NAME; + bCheckEmpty = TRUE; + break; + case '/': aState = TC_CLOSED; + bCheckEmpty = TRUE; + break; + case '>': aState = TC_FINISHED; + bCheckEmpty = TRUE; + break; + default: aState = TC_ERROR; + } + break; + +// CLOSED ' ' -> CLOSED_SPACE +// CLOSED '>' -> FINISHED + case TC_CLOSED: + switch ( cDelim ) + { + case ' ': aState = TC_CLOSED_SPACE; + bCheckEmpty = TRUE; + bClosed = TRUE; + break; + case '>': aState = TC_FINISHED; + bCheckEmpty = TRUE; + break; + default: aState = TC_ERROR; + } + break; + +// CLOSED_SPACE '>' -> FINISHED + case TC_CLOSED_SPACE: + switch ( cDelim ) + { + case '>': aState = TC_FINISHED; + bCheckEmpty = TRUE; + break; + default: aState = TC_ERROR; + } + break; + +// CLOSETAG ' ' -> CLOSETAG_HAS_TAG_NAME +// CLOSETAG '>' -> FINISHED + case TC_CLOSETAG: + bCloseTag = TRUE; + switch ( cDelim ) + { + case ' ': aState = TC_CLOSETAG_HAS_TAG_NAME; + aTagName = aPortion; + bCheckName = TRUE; + break; + case '>': aState = TC_FINISHED; + aTagName = aPortion; + bCheckName = TRUE; + break; + default: aState = TC_ERROR; + } + break; + +// CLOSETAG_HAS_TAG_NAME '>' -> FINISHED + case TC_CLOSETAG_HAS_TAG_NAME: + switch ( cDelim ) + { + case '>': aState = TC_FINISHED; + bCheckEmpty = TRUE; + break; + default: aState = TC_ERROR; + } + break; + + + default: rErrorList.AddError( 99, "Internal error Parsing Tag ", *this ); + bIsBroken = TRUE; + + } + + if ( bCheckName ) + { + if ( aPortion.Len() == 0 ) + { + rErrorList.AddError( 25, "Tag/Property name missing ", *this ); + bIsBroken = TRUE; + } + else + { + aName = ByteString( aPortion, RTL_TEXTENCODING_UTF8 ); + // "a-zA-Z_-.0-9" + xub_StrLen nCount; + BOOL bBroken = FALSE; + const sal_Char* aBuf = aName.GetBuffer(); + for ( nCount = 0 ; !bBroken && nCount < aName.Len() ; nCount++ ) + { + bBroken = ! ( ( aBuf[nCount] >= 'a' && aBuf[nCount] <= 'z' ) + ||( aBuf[nCount] >= 'A' && aBuf[nCount] <= 'Z' ) + ||( aBuf[nCount] >= '0' && aBuf[nCount] <= '9' ) + ||( aBuf[nCount] == '_' ) + ||( aBuf[nCount] == '-' ) + ||( aBuf[nCount] == '.' ) + ); + } + + if ( bBroken ) + { + rErrorList.AddError( 25, "Found illegal character in Tag/Property name ", *this ); + bIsBroken = TRUE; + } + } + + bCheckName = FALSE; + } + + if ( bCheckEmpty ) + { + if ( aPortion.Len() ) + { + rErrorList.AddError( 25, ByteString("Found displaced characters '").Append(ByteString( aPortion, RTL_TEXTENCODING_UTF8 )).Append("' in Tag "), *this ); + bIsBroken = TRUE; + } + bCheckEmpty = FALSE; + } + + + nLastPos = nCheckPos; + + // skip further blanks + if ( cDelim == ' ' && aState != TC_INSIDE_STRING ) + while ( nLastPos < aTokenString.Len() && aTokenString.GetChar( nLastPos ) == ' ') + nLastPos++; + + nCheckPos = aTokenString.SearchChar( aDelims.GetBuffer(), nLastPos ); + } + if ( aState != TC_FINISHED ) + { + rErrorList.AddError( 25, "Parsing error in Tag ", *this ); + bIsBroken = TRUE; + } +} + +BOOL TokenInfo::IsPropertyRelevant( const ByteString &aName, const String &aValue ) const +{ + if ( aTagName.EqualsAscii( "alt" ) && aName.Equals( "xml-lang" ) ) + return FALSE; + if ( aTagName.EqualsAscii( "ahelp" ) && aName.Equals( "visibility" ) && aValue.EqualsAscii("visible") ) + return FALSE; + if ( aTagName.EqualsAscii( "image" ) && (aName.Equals( "width" ) || aName.Equals( "height" )) ) + return FALSE; + + return TRUE; +} + +BOOL TokenInfo::IsPropertyValueValid( const ByteString &aName, const String &aValue ) const +{ +/* removed due to i56740 + if ( aTagName.EqualsAscii( "switchinline" ) && aName.Equals( "select" ) ) + { + return aValue.EqualsAscii("sys") || + aValue.EqualsAscii("appl") || + aValue.EqualsAscii("distrib"); + } */ + if ( aTagName.EqualsAscii( "caseinline" ) && aName.Equals( "select" ) ) + { + return /*!aValue.EqualsAscii("OS2") && removed due to i56740 */ + !aValue.EqualsAscii(""); + } + + // we don't know any better so we assume it to be OK + return TRUE; +} + +BOOL TokenInfo::IsPropertyInvariant( const ByteString &aName, const String &aValue ) const +{ + if ( aTagName.EqualsAscii( "link" ) && aName.Equals( "name" ) ) + return FALSE; + if ( aTagName.EqualsAscii( "link" ) && aName.Equals( "href" ) ) + { // check for external reference + if ( aValue.Copy( 0, 5 ).EqualsIgnoreCaseAscii( "http:" ) + || aValue.Copy( 0, 6 ).EqualsIgnoreCaseAscii( "https:" ) + || aValue.Copy( 0, 4 ).EqualsIgnoreCaseAscii( "ftp:" ) ) + return FALSE; + else + return TRUE; + } + return TRUE; +} + +BOOL TokenInfo::IsPropertyFixable( const ByteString &aName ) const +{ + // name everything that is allowed to be fixed automatically here + if ( (aTagName.EqualsAscii( "ahelp" ) && aName.Equals( "hid" )) + || (aTagName.EqualsAscii( "link" ) && aName.Equals( "href" )) + || (aTagName.EqualsAscii( "alt" ) && aName.Equals( "id" )) + || (aTagName.EqualsAscii( "variable" ) && aName.Equals( "id" )) + || (aTagName.EqualsAscii( "image" ) && aName.Equals( "src" )) + || (aTagName.EqualsAscii( "image" ) && aName.Equals( "id" ) )) + return TRUE; + return FALSE; +} + +BOOL TokenInfo::MatchesTranslation( TokenInfo& rInfo, BOOL bGenErrors, ParserMessageList &rErrorList, BOOL bFixTags ) const +{ + // check if tags are equal + // check if all existing properties are in the translation as well and + // wether they have a matching content (the same in most cases) + + if ( nId != rInfo.nId ) + return FALSE; + + if ( !aTagName.Equals( rInfo.aTagName ) ) + return FALSE; + + // If one of the tags has formating errors already it does make no sense to check here, so return right away + if ( bGenErrors && ( bIsBroken || rInfo.bIsBroken ) ) + return TRUE; + + StringHashMap::const_iterator iProp; + for( iProp = aProperties.begin() ; iProp != aProperties.end(); ++iProp ) + { + if ( rInfo.aProperties.find( iProp->first ) != rInfo.aProperties.end() ) + { + if ( IsPropertyRelevant( iProp->first, iProp->second ) || IsPropertyRelevant( iProp->first, rInfo.aProperties.find( iProp->first )->second ) ) + { + if ( IsPropertyInvariant( iProp->first, iProp->second ) ) + { + if ( !rInfo.aProperties.find( iProp->first )->second.Equals( iProp->second ) ) + { + if ( bGenErrors ) + { + if ( bFixTags && IsPropertyFixable( iProp->first ) ) + { + rInfo.aProperties.find( iProp->first )->second = iProp->second; + rInfo.SetHasBeenFixed(); + rErrorList.AddWarning( 25, ByteString("Property '").Append(iProp->first).Append("': FIXED different value in Translation "), *this ); + } + else + rErrorList.AddError( 25, ByteString("Property '").Append(iProp->first).Append("': value different in Translation "), *this ); + } + else return FALSE; + } + } + } + } + else + { + if ( IsPropertyRelevant( iProp->first, iProp->second ) ) + { + if ( bGenErrors ) + rErrorList.AddError( 25, ByteString("Property '").Append(iProp->first).Append("' missing in Translation "), *this ); + else return FALSE; + } + } + } + for( iProp = rInfo.aProperties.begin() ; iProp != rInfo.aProperties.end(); ++iProp ) + { + if ( aProperties.find( iProp->first ) == aProperties.end() ) + { + if ( IsPropertyRelevant( iProp->first, iProp->second ) ) + { + if ( bGenErrors ) + rErrorList.AddError( 25, ByteString("Extra Property '").Append(iProp->first).Append("' in Translation "), rInfo ); + else return FALSE; + } + } + } + + // if we reach here eather + // the tags match completely or + // the tags match but not the properties and we generated errors for that + return TRUE; +} + +String TokenInfo::GetTagName() const +{ + return aTagName; +} + +String TokenInfo::MakeTag() const +{ + String aRet; + aRet.AppendAscii("\\<"); + if ( bCloseTag ) + aRet.AppendAscii("/"); + aRet.Append( GetTagName() ); + StringHashMap::const_iterator iProp; + + for( iProp = aProperties.begin() ; iProp != aProperties.end(); ++iProp ) + { + aRet.AppendAscii(" "); + aRet.Append( String( iProp->first, RTL_TEXTENCODING_UTF8 ) ); + aRet.AppendAscii("=\\\""); + aRet.Append( iProp->second ); + aRet.AppendAscii("\\\""); + } + if ( bClosed ) + aRet.AppendAscii("/"); + aRet.AppendAscii("\\>"); + return aRet; +} + + +void ParserMessageList::AddError( USHORT nErrorNr, ByteString aErrorText, const TokenInfo &rTag ) +{ + Insert( new ParserError( nErrorNr, aErrorText, rTag ), LIST_APPEND ); +} + +void ParserMessageList::AddWarning( USHORT nErrorNr, ByteString aErrorText, const TokenInfo &rTag ) +{ + Insert( new ParserWarning( nErrorNr, aErrorText, rTag ), LIST_APPEND ); +} + +BOOL ParserMessageList::HasErrors() +{ + USHORT i; + for ( i=0 ; i < Count() ; i++ ) + if ( GetObject( i )->IsError() ) + return TRUE; + return FALSE; +} + +struct Tag +{ + String GetName() const { return String::CreateFromAscii( pName ); }; + const char* pName; + TokenId nTag; +}; + + +static const Tag aKnownTags[] = +{ +/* commenting oldstyle tags +// { "<#GROUP_FORMAT>", TAG_GROUP_FORMAT }, + { "<#BOLD>", TAG_BOLDON }, + { "<#/BOLD>", TAG_BOLDOFF }, + { "<#ITALIC>", TAG_ITALICON }, + { "<#/ITALIC>", TAG_ITALICOFF }, + { "<#UNDER>", TAG_UNDERLINEON }, + { "<#/UNDER>", TAG_UNDERLINEOFF }, + +// { "<#GROUP_NOTALLOWED>", TAG_GROUP_NOTALLOWED }, + { "<#HELPID>", TAG_HELPID }, + { "<#MODIFY>", TAG_MODIFY }, + { "<#REFNR>", TAG_REFNR }, + +// { "<#GROUP_STRUCTURE>", TAG_GROUP_STRUCTURE }, + { "<#NAME>", TAG_NAME }, + { "<#HREF>", TAG_HREF }, + { "<#AVIS>", TAG_AVIS }, + { "<#AHID>", TAG_AHID }, + { "<#AEND>", TAG_AEND }, + + { "<#TITEL>", TAG_TITEL }, + { "<#KEY>", TAG_KEY }, + { "<#INDEX>", TAG_INDEX }, + + { "<#REFSTART>", TAG_REFSTART }, + + { "<#GRAPHIC>", TAG_GRAPHIC }, + { "<#NEXTVERSION>", TAG_NEXTVERSION }, + + // { "<#GROUP_SYSSWITCH>", TAG_GROUP_SYSSWITCH }, + { "<#WIN>", TAG_WIN }, + { "<#UNIX>", TAG_UNIX }, + { "<#MAC>", TAG_MAC }, + { "<#OS2>", TAG_OS2 }, + +// { "<#GROUP_PROGSWITCH>", TAG_GROUP_PROGSWITCH }, + { "<#WRITER>", TAG_WRITER }, + { "<#CALC>", TAG_CALC }, + { "<#DRAW>", TAG_DRAW }, + { "<#IMPRESS>", TAG_IMPRESS }, + { "<#SCHEDULE>", TAG_SCHEDULE }, + { "<#IMAGE>", TAG_IMAGE }, + { "<#MATH>", TAG_MATH }, + { "<#CHART>", TAG_CHART }, + { "<#OFFICE>", TAG_OFFICE }, + */ +// { "<#TAG_GROUP_META>", TAG_GROUP_META }, + { "$[officefullname]", TAG_OFFICEFULLNAME }, + { "$[officename]", TAG_OFFICENAME }, + { "$[officepath]", TAG_OFFICEPATH }, + { "$[officeversion]", TAG_OFFICEVERSION }, + { "$[portalname]", TAG_PORTALNAME }, + { "$[portalfullname]", TAG_PORTALFULLNAME }, + { "$[portalpath]", TAG_PORTALPATH }, + { "$[portalversion]", TAG_PORTALVERSION }, + { "$[portalshortname]", TAG_PORTALSHORTNAME }, +/* commenting oldstyle tags +// { "<#TAG_GROUP_SINGLE>", TAG_GROUP_SINGLE }, + { "<#REFINSERT>", TAG_REFINSERT }, + +// { "<#GROUP_MULTI>", TAG_GROUP_MULTI }, + { "<#END>", TAG_END }, + { "<#ELSE>", TAG_ELSE }, + { "<#VERSIONEND>", TAG_VERSIONEND }, + { "<#ENDGRAPHIC>", TAG_ENDGRAPHIC },*/ + { "", TAG_COMMONSTART }, + { "", TAG_COMMONEND }, + + { "", TAG_NOMORETAGS }, + { "", TAG_UNKNOWN_TAG }, +}; + + +SimpleParser::SimpleParser() +: nPos( 0 ) +, aNextTag( TAG_NOMORETAGS, TOK_INVALIDPOS ) +{ +} + +void SimpleParser::Parse( String PaSource ) +{ + aSource = PaSource; + nPos = 0; + aLastToken.Erase(); + aNextTag = TokenInfo( TAG_NOMORETAGS, TOK_INVALIDPOS ); + aTokenList.Clear(); +}; + +TokenInfo SimpleParser::GetNextToken( ParserMessageList &rErrorList ) +{ + TokenInfo aResult; + USHORT nTokenStartPos = 0; + if ( aNextTag.nId != TAG_NOMORETAGS ) + { + aResult = aNextTag; + aNextTag = TokenInfo( TAG_NOMORETAGS, TOK_INVALIDPOS ); + } + else + { + aLastToken = GetNextTokenString( rErrorList, nTokenStartPos ); + if ( aLastToken.Len() == 0 ) + return TokenInfo( TAG_NOMORETAGS, TOK_INVALIDPOS ); + + // do we have a \< ... \> style tag? + if ( aLastToken.Copy(0,2).EqualsAscii( "\\<" ) ) + { + // check for paired \" \" + bool bEven = true; + USHORT nQuotePos = 0; + USHORT nQuotedQuotesPos = aLastToken.SearchAscii( "\\\"" ); + USHORT nQuotedBackPos = aLastToken.SearchAscii( "\\\\" ); // this is only to kick out quoted backslashes + while ( nQuotedQuotesPos != STRING_NOTFOUND ) + { + if ( nQuotedBackPos <= nQuotedQuotesPos ) + nQuotePos = nQuotedBackPos+2; + else + { + nQuotePos = nQuotedQuotesPos+2; + bEven = !bEven; + } + nQuotedQuotesPos = aLastToken.SearchAscii( "\\\"", nQuotePos ); + nQuotedBackPos = aLastToken.SearchAscii( "\\\\", nQuotePos ); // this is only to kick out quoted backslashes + } + if ( !bEven ) + { + rErrorList.AddError( 24, "Missing quotes ( \\\" ) in Tag", TokenInfo( TAG_UNKNOWN_TAG, nTokenStartPos, aLastToken ) ); + } + + // check if we have an end-tag or a start-tag + USHORT nNonBlankStartPos,nNonBlankEndPos; + nNonBlankStartPos = 2; + while ( aLastToken.GetChar(nNonBlankStartPos) == ' ' ) + nNonBlankStartPos++; + if ( aLastToken.GetChar(nNonBlankStartPos) == '/' ) + aResult = TokenInfo( TAG_COMMONEND, nTokenStartPos, aLastToken, rErrorList ); + else + { + aResult = TokenInfo( TAG_COMMONSTART, nTokenStartPos, aLastToken, rErrorList ); + nNonBlankEndPos = aLastToken.Len() -3; + while ( aLastToken.GetChar(nNonBlankEndPos) == ' ' ) + nNonBlankEndPos--; + if ( aLastToken.GetChar( nNonBlankEndPos ) == '/' ) + aNextTag = TokenInfo( TAG_COMMONEND, nTokenStartPos, String::CreateFromAscii("\\"), rErrorList ); + } + } + else + { + USHORT i = 0; + while ( aKnownTags[i].nTag != TAG_UNKNOWN_TAG && + aLastToken != aKnownTags[i].GetName() ) + i++; + aResult = TokenInfo( aKnownTags[i].nTag, nTokenStartPos ); + } + } + + if ( aResult.nId == TAG_UNKNOWN_TAG ) + aResult = TokenInfo( TAG_UNKNOWN_TAG, nTokenStartPos, aLastToken ); + aTokenList.Insert( aResult, LIST_APPEND ); + return aResult; +} + +String SimpleParser::GetNextTokenString( ParserMessageList &rErrorList, USHORT &rTagStartPos ) +{ +// USHORT nStyle1StartPos = aSource.SearchAscii( "<#", nPos ); + USHORT nStyle2StartPos = aSource.SearchAscii( "$[", nPos ); + USHORT nStyle3StartPos = aSource.SearchAscii( "\\<", nPos ); + USHORT nStyle4StartPos = aSource.SearchAscii( "\\\\", nPos ); // this is only to kick out quoted backslashes + + rTagStartPos = 0; + +/* removing since a \<... is not likely + // check if the tag starts with a letter to avoid things like <> <= ... > + while ( STRING_NOTFOUND != nStyle3StartPos && !( aSource.Copy( nStyle3StartPos+2, 1 ).IsAlphaAscii() || aSource.GetChar( nStyle3StartPos+2 ) == '/' ) ) + nStyle3StartPos = aSource.SearchAscii( "\\<", nStyle3StartPos+1 ); +*/ + if ( STRING_NOTFOUND == nStyle2StartPos && STRING_NOTFOUND == nStyle3StartPos ) + return String(); // no more tokens + + if ( nStyle4StartPos < nStyle2StartPos && nStyle4StartPos <= nStyle3StartPos ) // <= to make sure \\ is always handled first + { // Skip quoted Backslash + nPos = nStyle4StartPos +2; + return GetNextTokenString( rErrorList, rTagStartPos ); + } + +/* if ( nStyle1StartPos < nStyle2StartPos && nStyle1StartPos <= nStyle3StartPos ) // <= to make sure our spechial tags are recognized before all others + { // test for <# ... > style tokens + USHORT nEndPos = aSource.SearchAscii( ">", nStyle1StartPos ); + if ( nEndPos == STRING_NOTFOUND ) + { // Token is incomplete. Skip start and search for better ones + nPos = nStyle1StartPos +2; + return GetNextTokenString( rErrorList, rTagStartPos ); + } + nPos = nEndPos; + rTagStartPos = nStyle1StartPos; + return aSource.Copy( nStyle1StartPos, nEndPos-nStyle1StartPos +1 ).ToUpperAscii(); + } + else*/ if ( nStyle2StartPos < nStyle3StartPos ) + { // test for $[ ... ] style tokens + USHORT nEndPos = aSource.SearchAscii( "]", nStyle2StartPos); + if ( nEndPos == STRING_NOTFOUND ) + { // Token is incomplete. Skip start and search for better ones + nPos = nStyle2StartPos +2; + return GetNextTokenString( rErrorList, rTagStartPos ); + } + nPos = nEndPos; + rTagStartPos = nStyle2StartPos; + return aSource.Copy( nStyle2StartPos, nEndPos-nStyle2StartPos +1 ); + } + else + { // test for \< ... \> style tokens + USHORT nEndPos = aSource.SearchAscii( "\\>", nStyle3StartPos); + USHORT nQuotedBackPos = aSource.SearchAscii( "\\\\", nStyle3StartPos ); // this is only to kick out quoted backslashes + while ( nQuotedBackPos <= nEndPos && nQuotedBackPos != STRING_NOTFOUND ) + { + nEndPos = aSource.SearchAscii( "\\>", nQuotedBackPos +2); + nQuotedBackPos = aSource.SearchAscii( "\\\\", nQuotedBackPos +2 ); // this is only to kick out quoted backslashes + } + if ( nEndPos == STRING_NOTFOUND ) + { // Token is incomplete. Skip start and search for better ones + nPos = nStyle3StartPos +2; + ByteString sTmp( "Tag Start '\\<' without Tag End '\\>': " ); + rErrorList.AddError( 24, "Tag Start '\\<' without Tag End '\\>'", TokenInfo( TAG_UNKNOWN_TAG, nStyle3StartPos, aSource.Copy( nStyle3StartPos-10, 20 ) ) ); + return GetNextTokenString( rErrorList, rTagStartPos ); + } + // check for paired quoted " --> \"sometext\" + + nPos = nEndPos; + rTagStartPos = nStyle3StartPos; + return aSource.Copy( nStyle3StartPos, nEndPos-nStyle3StartPos +2 ); + } +} + +String SimpleParser::GetLexem( TokenInfo const &aToken ) +{ + if ( aToken.aTokenString.Len() ) + return aToken.aTokenString; + else + { + USHORT i = 0; + while ( aKnownTags[i].nTag != TAG_UNKNOWN_TAG && + aKnownTags[i].nTag != aToken.nId ) + i++; + + return aKnownTags[i].GetName(); + } +} + +TokenParser::TokenParser() +: pErrorList( NULL ) +{} + +void TokenParser::Parse( const String &aCode, ParserMessageList* pList ) +{ + pErrorList = pList; + + //Scanner initialisieren + aParser.Parse( aCode ); + + //erstes Symbol holen + aTag = aParser.GetNextToken( *pErrorList ); + + nPfCaseOptions = 0; + nAppCaseOptions = 0; + bPfCaseActive = FALSE; + bAppCaseActive = FALSE; + + nActiveRefTypes = 0; + + //Ausfuehren der Start-Produktion + Paragraph(); + + //Es wurde nicht die ganze Kette abgearbeitet, bisher ist aber + //kein Fehler aufgetreten + //=> es wurde ein einleitendes Tag vergessen + if ( aTag.nId != TAG_NOMORETAGS ) + { + switch ( aTag.nId ) + { + case TAG_END: + { + ParseError( 3, "Extra Tag <#END>. Switch or <#HREF> expected.", aTag ); + } + break; + case TAG_BOLDOFF: + { + ParseError( 4, "<#BOLD> expected before <#/BOLD>.", aTag ); + } + break; + case TAG_ITALICOFF: + { + ParseError( 5, "<#ITALIC> expected before <#/ITALIC>.", aTag ); + } + break; + case TAG_UNDERLINEOFF: + { + ParseError( 17, "<#UNDER> expected before <#/UNDER>.", aTag ); + } + break; +/* case TAG_MISSPARENTHESIS: + { + ParseError( 14, "missing closing parenthesis '>'", aTag ); + } + break;*/ + case TAG_AEND: + { + ParseError( 5, "Extra Tag <#AEND>. <#AVIS> or <#AHID> expected.", aTag ); + } + break; + case TAG_ELSE: + { + ParseError( 16, "Application-tag or platform-tag expected before <#ELSE>.", aTag ); + } + break; + case TAG_UNKNOWN_TAG: + { + ParseError( 6, "unknown Tag", aTag ); + } + break; + default: + { + ParseError( 6, "unexpected Tag", aTag ); + } + } + } + pErrorList = NULL; +} + +void TokenParser::Paragraph() +{ + switch ( aTag.nId ) + { + case TAG_GRAPHIC: + case TAG_NEXTVERSION: + { + TagRef(); + Paragraph(); + } + break; + case TAG_AVIS: + case TAG_AHID: + { + TagRef(); + Paragraph(); + } + break; + case TAG_HELPID: + { + SimpleTag(); + Paragraph(); + } + break; + case TAG_OFFICEFULLNAME: + case TAG_OFFICENAME: + case TAG_OFFICEPATH: + case TAG_OFFICEVERSION: + case TAG_PORTALNAME: + case TAG_PORTALFULLNAME: + case TAG_PORTALPATH: + case TAG_PORTALVERSION: + case TAG_PORTALSHORTNAME: + { + SimpleTag(); + Paragraph(); + } + break; + case TAG_REFINSERT: + { + SimpleTag(); + Paragraph(); + } + break; + case TAG_BOLDON: + case TAG_ITALICON: + case TAG_UNDERLINEON: + case TAG_COMMONSTART: + { + TagPair(); + Paragraph(); + } + break; + case TAG_HREF: + case TAG_NAME: + case TAG_KEY: + case TAG_INDEX: + case TAG_TITEL: + case TAG_REFSTART: + { + TagRef(); + Paragraph(); + } + break; + case TAG_OS2: + case TAG_WIN: + case TAG_UNIX: + case TAG_MAC: //... + { + if ( ! bPfCaseActive ) + { + //PfCases duerfen nicht verschachtelt sein: + bPfCaseActive = TRUE; + PfCase(); + + //So jetzt kann wieder ein PfCase kommen: + bPfCaseActive = FALSE; + Paragraph(); + } + } + break; + case TAG_WRITER: + case TAG_CALC: + case TAG_DRAW: + case TAG_IMPRESS: + case TAG_SCHEDULE: + case TAG_IMAGE: + case TAG_MATH: + case TAG_CHART: + case TAG_OFFICE: + { + if ( !bAppCaseActive ) + { + //AppCases duerfen nicht verschachtelt sein: + bAppCaseActive = TRUE; + AppCase(); + + //jetzt koennen wieder AppCases kommen: + bAppCaseActive = FALSE; + Paragraph(); + } + } + break; + + //Case TAG_BOLDOFF, TAG_ITALICOFF, TAG_BUNDERLINE, TAG_END + //nichts tun wg. epsilon-Prod. + } +} + +void TokenParser::PfCase() +{ + + //Produktion: + //PfCase -> PfCaseBegin Paragraph (PfCase | PfCaseEnd) + + PfCaseBegin(); + + //Jetzt ist eine PfCase-Produktion aktiv: + Paragraph(); + switch ( aTag.nId ) + { + case TAG_ELSE: + case TAG_END: + { + CaseEnd(); + } + break; + case TAG_OS2: + case TAG_WIN: + case TAG_UNIX: + case TAG_MAC: //First (PfBegin) + { + PfCase(); + } + break; + default: + ParseError( 8, "<#ELSE> or <#END> or platform-tag expected.", aTag ); + } + //Die gemerkten Tags wieder loeschen fuer naechstes PfCase: + nPfCaseOptions = 0; +} + +void TokenParser::PfCaseBegin() +{ + switch ( aTag.nId ) + { + case TAG_OS2: + case TAG_WIN: + case TAG_UNIX: + case TAG_MAC: + { + //Token darf noch nicht vorgekommen sein im + //aktuellen Plattform-Case: + if ( !HAS_FLAG( nPfCaseOptions, TAG_NOGROUP( aTag.nId ) ) ) + { + SET_FLAG( nPfCaseOptions, TAG_NOGROUP( aTag.nId ) ); + match( aTag, aTag ); + } + else { + ParseError( 9, "Tag defined twice in the same platform-case", aTag ); + } + } + } +} + +void TokenParser::AppCase() +{ + + //Produktion: + //AppCase -> AppCaseBegin Paragraph (AppCase | AppCaseEnd) + + + AppCaseBegin(); + + Paragraph(); + + switch ( aTag.nId ) + { + case TAG_ELSE: + case TAG_END: + { + CaseEnd(); + } + break; + case TAG_WRITER: + case TAG_DRAW: + case TAG_CALC: + case TAG_IMAGE: + case TAG_MATH: + case TAG_CHART: + case TAG_OFFICE: + case TAG_IMPRESS: + case TAG_SCHEDULE: //First (AppBegin) + { + AppCase(); + } + break; + default: + ParseError( 1, "<#ELSE> or <#END> or application-case-tag expected.", aTag ); + } + + //Die gemerkten Tags wieder loeschen fuer naechstes AppCase: + nAppCaseOptions = 0; +} + +void TokenParser::AppCaseBegin() +{ + switch ( aTag.nId ) + { + case TAG_WRITER: + case TAG_DRAW: + case TAG_CALC: + case TAG_IMAGE: + case TAG_MATH: + case TAG_CHART: + case TAG_OFFICE: + case TAG_IMPRESS: + case TAG_SCHEDULE: + { + //Token darf noch nicht vorgekommen sein im + //aktuellen Plattform-Case: + if ( !HAS_FLAG( nAppCaseOptions, TAG_NOGROUP( aTag.nId ) ) ) + { + SET_FLAG( nAppCaseOptions, TAG_NOGROUP( aTag.nId ) ); + match( aTag, aTag ); + } + else { + ParseError( 13, "Tag defined twice in the same application-case.", aTag ); + } + } + } +} + +void TokenParser::CaseEnd() +{ + //Produktion: + //CaseEnd -> <#ELSE> Paragraph <#END> | <#END> + + switch ( aTag.nId ) + { + case TAG_ELSE: + { + match( aTag, TAG_ELSE ); + Paragraph(); + match( aTag, TAG_END ); + } + break; + case TAG_END: + { + match( aTag, TAG_END ); + } + break; + default: + ParseError( 2, "<#ELSE> or <#END> expected.", aTag ); + } +} + +void TokenParser::SimpleTag() +{ + + switch ( aTag.nId ) + { + case TAG_HELPID: + { + match( aTag, TAG_HELPID ); + } + break; + case TAG_OFFICEFULLNAME: + case TAG_OFFICENAME: + case TAG_OFFICEPATH: + case TAG_OFFICEVERSION: + case TAG_PORTALNAME: + case TAG_PORTALFULLNAME: + case TAG_PORTALPATH: + case TAG_PORTALVERSION: + case TAG_PORTALSHORTNAME: + + case TAG_REFINSERT: + { + match( aTag, aTag ); + } + break; + default: + ParseError( 15, "[<#SimpleTag>] expected.", aTag ); + } +} + +void TokenParser::TagPair() +{ + switch ( aTag.nId ) + { + case TAG_BOLDON: + { + match( aTag, TAG_BOLDON ); + Paragraph(); + match( aTag, TAG_BOLDOFF ); + } + break; + case TAG_ITALICON: + { + match( aTag, TAG_ITALICON ); + Paragraph(); + match( aTag, TAG_ITALICOFF ); + } + break; + case TAG_UNDERLINEON: + { + match( aTag, TAG_UNDERLINEON ); + Paragraph(); + match( aTag, TAG_UNDERLINEOFF ); + } + break; + case TAG_COMMONSTART: + { + //remember tag so we can give the original tag in case of an error + TokenInfo aEndTag( aTag ); + aEndTag.nId = TAG_COMMONEND; + match( aTag, TAG_COMMONSTART ); + Paragraph(); + match( aTag, aEndTag ); + } + break; + default: + ParseError( 10, "<#BOLD>, <#ITALIC>, <#UNDER> expected.", aTag ); + } +} + + +void TokenParser::TagRef() +{ + switch ( aTag.nId ) + { + case TAG_GRAPHIC: + case TAG_NEXTVERSION: + { + if ( !HAS_FLAG( nActiveRefTypes, TAG_NOGROUP( aTag.nId ) ) ) + { + TokenId aThisToken = aTag.nId; + SET_FLAG( nActiveRefTypes, TAG_NOGROUP( aThisToken ) ); + match( aTag, aTag ); + Paragraph(); + if ( aThisToken == TAG_GRAPHIC ) + match( aTag, TAG_ENDGRAPHIC ); + else + match( aTag, TAG_VERSIONEND ); + // don't reset since alowed only once per paragraph + // RESET_FLAG( nActiveRefTypes, TAG_NOGROUP( aThisToken ) ); + } + else + { + ParseError( 11, "Tags <#GRAPHIC>,<#NEXTVERSION> allowed only once per paragraph at", aTag ); + } + } + break; + case TAG_AVIS: + case TAG_AHID: + { + if ( !HAS_FLAG( nActiveRefTypes, TAG_NOGROUP( aTag.nId ) ) ) + { + TokenId aThisToken = aTag.nId; + SET_FLAG( nActiveRefTypes, TAG_NOGROUP( aThisToken ) ); + match( aTag, aTag ); + Paragraph(); + match( aTag, TAG_AEND ); + RESET_FLAG( nActiveRefTypes, TAG_NOGROUP( aThisToken ) ); + } + else + { + ParseError( 11, "Nested <#AHID>,<#AVIS> not allowed.", aTag ); + } + } + break; + case TAG_HREF: + case TAG_NAME: + { + + } + // NOBREAK + case TAG_KEY: + case TAG_INDEX: + case TAG_TITEL: + case TAG_REFSTART: + { + if ( !HAS_FLAG( nActiveRefTypes, TAG_NOGROUP( aTag.nId ) ) ) + { + TokenId aThisToken = aTag.nId; + match( aTag, aTag ); + if ( aThisToken != TAG_NAME ) + { // TAG_NAME has no TAG_END + SET_FLAG( nActiveRefTypes, TAG_NOGROUP( aThisToken ) ); + Paragraph(); + match( aTag, TAG_END ); + RESET_FLAG( nActiveRefTypes, TAG_NOGROUP( aThisToken ) ); + } + } + else + { + ParseError( 11, "Nested <#HREF>,<#NAME> or <#KEY> not allowed.", aTag ); + } + } + break; + default: + ParseError( 12, "<#HREF>,<#NAME> or <#KEY> expected.", aTag ); + } +} + +BOOL TokenParser::match( const TokenInfo &aCurrentToken, const TokenId &aExpectedToken ) +{ + return match( aCurrentToken, TokenInfo( aExpectedToken, TOK_INVALIDPOS ) ); +} + +BOOL TokenParser::match( const TokenInfo &aCurrentToken, const TokenInfo &rExpectedToken ) +{ + TokenInfo aExpectedToken( rExpectedToken ); + if ( aCurrentToken.nId == aExpectedToken.nId ) + { + if ( ( aCurrentToken.nId == TAG_COMMONEND + && aCurrentToken.GetTagName().Equals( aExpectedToken.GetTagName() ) ) + || aCurrentToken.nId != TAG_COMMONEND ) + { + aTag = aParser.GetNextToken( *pErrorList ); + return TRUE; + } + } + + if ( aExpectedToken.nId == TAG_COMMONEND ) + { + aExpectedToken.aTokenString.Insert( String::CreateFromAscii( "Close tag for " ), 0 ); + } + + ByteString sTmp( "Expected Symbol" ); + if ( aCurrentToken.nId == TAG_NOMORETAGS ) + { + ParseError( 7, sTmp, aExpectedToken ); + } + else + { + sTmp += ": "; + sTmp += ByteString( aParser.GetLexem( aExpectedToken ), RTL_TEXTENCODING_UTF8 ); + sTmp += " near "; + ParseError( 7, sTmp, aCurrentToken ); + } + return FALSE; +} + +void TokenParser::ParseError( USHORT nErrNr, ByteString aErrMsg, const TokenInfo &rTag ) +{ + pErrorList->AddError( nErrNr, aErrMsg, rTag); + + // Das Fehlerhafte Tag ueberspringen + aTag = aParser.GetNextToken( *pErrorList ); +} + + +ParserMessage::ParserMessage( USHORT PnErrorNr, ByteString PaErrorText, const TokenInfo &rTag ) + : nErrorNr( PnErrorNr ) + , aErrorText( PaErrorText ) + , nTagBegin( 0 ) + , nTagLength( 0 ) +{ + String aLexem( SimpleParser::GetLexem( rTag ) ); + aErrorText.Append(": "); + aErrorText += ByteString( aLexem, RTL_TEXTENCODING_UTF8 ); + if ( rTag.nId == TAG_NOMORETAGS ) + aErrorText.Append(" at end of line "); + else if ( rTag.nPos != TOK_INVALIDPOS ) + { + aErrorText.Append(" at Position "); + aErrorText.Append( ByteString::CreateFromInt32( rTag.nPos ) ); + } + nTagBegin = rTag.nPos; + nTagLength = aLexem.Len(); +} + +ParserError::ParserError( USHORT ErrorNr, ByteString ErrorText, const TokenInfo &rTag ) +: ParserMessage( ErrorNr, ErrorText, rTag ) +{} + +ParserWarning::ParserWarning( USHORT ErrorNr, ByteString ErrorText, const TokenInfo &rTag ) +: ParserMessage( ErrorNr, ErrorText, rTag ) +{} + +BOOL LingTest::IsTagMandatory( TokenInfo const &aToken, TokenId &aMetaTokens ) +{ + TokenId aTokenId = aToken.nId; + TokenId aTokenGroup = TAG_GROUP( aTokenId ); + if ( TAG_GROUP_PROGSWITCH == aTokenGroup + || TAG_REFINSERT == aTokenId + || TAG_REFSTART == aTokenId + || TAG_NAME == aTokenId + || TAG_HREF == aTokenId + || TAG_AVIS == aTokenId + || TAG_AHID == aTokenId + || TAG_GRAPHIC == aTokenId + || TAG_NEXTVERSION == aTokenId + || ( TAG_GROUP_META == aTokenGroup && (aMetaTokens & aTokenId) == aTokenId ) ) + { + if ( TAG_GROUP_META == aTokenGroup ) + aMetaTokens |= aTokenId; + return TRUE; + } + else if ( TAG_COMMONSTART == aTokenId + || TAG_COMMONEND == aTokenId ) + { + String aTagName = aToken.GetTagName(); + return !(aTagName.EqualsIgnoreCaseAscii( "comment" ) + || aTagName.EqualsIgnoreCaseAscii( "bookmark_value" ) + || aTagName.EqualsIgnoreCaseAscii( "emph" ) + || aTagName.EqualsIgnoreCaseAscii( "item" ) + || aTagName.EqualsIgnoreCaseAscii( "br" ) ); + } + return FALSE; +} + +void LingTest::CheckTags( TokenList &aReference, TokenList &aTestee, BOOL bFixTags ) +{ + ULONG i=0,j=0; + // Clean old Warnings + while ( aCompareWarningList.Count() ) + { + delete aCompareWarningList.GetCurObject(); + aCompareWarningList.Remove(); + } + + /* in xml tags, do not require the following tags + comment + bookmark_value + emph + item + br + */ + + // filter uninteresting Tags + TokenId aMetaTokens = 0; + for ( i=0 ; i < aReference.Count() ; i++ ) + { + if ( !IsTagMandatory( aReference.GetObject( i ), aMetaTokens ) ) + aReference.GetObject( i ).SetDone(); + } + + aMetaTokens = 0; + for ( i=0 ; i < aTestee.Count() ; i++ ) + { + if ( !IsTagMandatory( aTestee.GetObject( i ), aMetaTokens ) ) + aTestee.GetObject( i ).SetDone(); + } + + // remove all matching tags + for ( i=0 ; i < aReference.Count() ; i++ ) + { + if ( aReference.GetObject( i ).IsDone() ) + continue; + + BOOL bTagFound = FALSE; + for ( j=0 ; j < aTestee.Count() && !bTagFound ; j++ ) + { + if ( aTestee.GetObject( j ).IsDone() ) + continue; + + if ( aReference.GetObject( i ).MatchesTranslation( aTestee.GetObject( j ), FALSE, aCompareWarningList ) ) + { + aReference.GetObject( i ).SetDone(); + aTestee.GetObject( j ).SetDone(); + bTagFound = TRUE; + } + } + } + + BOOL bCanFix = TRUE; + + if ( bFixTags ) + { + // we fix only if its a really simple case + USHORT nTagCount = 0; + for ( i=0 ; i < aReference.Count() ; i++ ) + if ( !aReference.GetObject( i ).IsDone() ) + nTagCount++; + if ( nTagCount > 1 ) + bCanFix = FALSE; + + nTagCount = 0; + for ( i=0 ; i < aTestee.Count() ; i++ ) + if ( !aTestee.GetObject( i ).IsDone() ) + nTagCount++; + if ( nTagCount > 1 ) + bCanFix = FALSE; + } + + // generate errors for tags that have differing attributes + for ( i=0 ; i < aReference.Count() ; i++ ) + { + if ( aReference.GetObject( i ).IsDone() ) + continue; + + BOOL bTagFound = FALSE; + for ( j=0 ; j < aTestee.Count() && !bTagFound ; j++ ) + { + if ( aTestee.GetObject( j ).IsDone() ) + continue; + + if ( aReference.GetObject( i ).MatchesTranslation( aTestee.GetObject( j ), TRUE, aCompareWarningList, bCanFix && bFixTags ) ) + { + aReference.GetObject( i ).SetDone(); + aTestee.GetObject( j ).SetDone(); + bTagFound = TRUE; + } + } + } + + // list remaining tags as errors + for ( i=0 ; i < aReference.Count() ; i++ ) + { + if ( aReference.GetObject( i ).IsDone() ) + continue; + + aCompareWarningList.AddError( 20, "Missing Tag in Translation", aReference.GetObject( i ) ); + } + for ( i=0 ; i < aTestee.Count() ; i++ ) + { + if ( aTestee.GetObject( i ).IsDone() ) + continue; + + aCompareWarningList.AddError( 21, "Extra Tag in Translation", aTestee.GetObject( i ) ); + } + + for ( i=0 ; i < aReference.Count() ; i++ ) + aReference.GetObject( i ).SetDone( FALSE ); + + for ( i=0 ; i < aTestee.Count() ; i++ ) + aTestee.GetObject( i ).SetDone( FALSE ); +} + +void LingTest::CheckReference( GSILine *aReference ) +{ + aReferenceParser.Parse( aReference->GetUText(), aReference->GetMessageList() ); +} + +void LingTest::CheckTestee( GSILine *aTestee, BOOL bHasSourceLine, BOOL bFixTags ) +{ + aFixedTestee = aTestee->GetUText(); + aTesteeParser.Parse( aFixedTestee, aTestee->GetMessageList() ); + + if ( bHasSourceLine ) + CheckTags( aReferenceParser.GetTokenList(), aTesteeParser.GetTokenList(), bFixTags ); + + if ( bFixTags ) + { + TokenList& aTesteeTokens = aTesteeParser.GetTokenList(); + BOOL bFixesDone = FALSE; + // count backwards to allow replacing from right to left + int i; + for ( i=aTesteeTokens.Count()-1 ; i>=0 ; i-- ) + { + if ( aTesteeTokens.GetObject( i ).HasBeenFixed() ) + { + bFixesDone = TRUE; + aFixedTestee.Replace( aTesteeTokens.GetObject( i ).nPos, aTesteeTokens.GetObject( i ).aTokenString.Len(), aTesteeTokens.GetObject( i ).MakeTag() ); + } + } + if ( bFixesDone ) + { + aTestee->SetUText( aFixedTestee ); + aTestee->SetFixed(); + } + } +} + diff --git a/l10ntools/source/treeconfig.cxx b/l10ntools/source/treeconfig.cxx new file mode 100644 index 000000000000..137492c39a50 --- /dev/null +++ b/l10ntools/source/treeconfig.cxx @@ -0,0 +1,128 @@ +#include +#include +#include +#include "treeconfig.hxx" +#include "export.hxx" +#ifdef WNT +#include +#include +#else +#include +#endif +#include +#include +#include +#include + +using namespace std; + +namespace transex3 +{ + +bool Treeconfig::parseConfig(){ + + string source_config_file = string( static_cast( Export::GetEnv("SOURCE_ROOT_DIR") ).GetBuffer() ); + if( source_config_file.empty() ) + { + cerr << "Error: no suitable environment set?!?"; + exit( -1 ); + } + source_config_file += string("/source_config"); + if( isConfigFilePresent() ) + { + inireader.read( map , source_config_file ); + return true; + } + else return false; +} + +// ALWAYS add all repositories from source_config file to the container active_repos +// if a config_file is present ALWAYS return false +// if you are in the root of a repository also add it to the container active_repos +// if you are far inside a repository /my/path/ooo/sw/source then don't add it to the container but return true +// if you are in some misc place like /tmp then return true +// => the application can decide what to do in case the function returns true thus how to handle pwd() path +bool Treeconfig::getActiveRepositories( vector& active_repos ){ + + bool isPresent = isConfigFilePresent(); + bool hasPath = false; + string pwd; + string guessedRepo; + Export::getCurrentDir( pwd ); + string source_root = Export::GetEnv( "SOURCE_ROOT_DIR" ); + string solarsrc = Export::GetEnv( "SOLARSRC" ); + string partial; + + // if we are inside of a repository root then active it otherwise let the app handle the return! + string::size_type pos = pwd.find_first_of( source_root ); + if( pos != string::npos && ( pos + source_root.length() +1 ) < pwd.length()){ // I am within SOURCE_ROOT_DIR + partial = pwd.substr( pos + source_root.length() +1 , pwd.length()); + string::size_type nextPart = partial.find_first_of( "/" ); + if( nextPart != string::npos ) + hasPath = true; + else + guessedRepo = partial; + } + else // I am NOT within SOURCE_ROOT_DIR + hasPath = true; + + if( isPresent ) + { + hasPath = false; // if config_file is present don't care about pwd + stringmap* repos = static_cast( map[ string("repositories") ] ); + if( repos != 0 ) + { + for( stringmap::iterator iter = repos->begin() ; iter != repos->end() ; ++iter ) + { + if( static_cast( iter->second ) == string( "active" ) ) + { + active_repos.push_back( iter->first ); + if( static_cast( iter->first ) == guessedRepo ) + { + guessedRepo.clear(); // don't add double in case it is present in config_file + } + } + } + } + else + { + cerr << "Error: source_config files doesn't contain a 'repositories' section ?!?"; + exit( -1 ); + } + } + if( !guessedRepo.empty() ){ + active_repos.push_back( guessedRepo ); // add myrepo + } + return hasPath; // are we deep inside of a source tree or outside of SOURCE_ROOT_DIR? +} + +void Treeconfig::getCurrentDir( string& dir ) +{ + char buffer[64000]; + if( getcwd( buffer , sizeof( buffer ) ) == 0 ){ + cerr << "Error: getcwd failed!\n"; + exit( -1 ); + } + dir = string( buffer ); +} + +bool Treeconfig::isConfigFilePresent() +{ + string config_file = Export::GetEnv( "SOURCE_ROOT_DIR" ); + config_file += "/source_config"; + + struct stat status; + if( stat( config_file.c_str() , &status ) < 0 ) + { + return false; + } +#ifdef WNT + return ( status.st_mode & _S_IFREG ) && ( _access( config_file.c_str() , 4 ) >= 0 ) ; +#else + return ( status.st_mode & S_IFREG ) && ( access( config_file.c_str() , R_OK ) >= 0 ) ; +#endif +} + + + +} diff --git a/l10ntools/source/utf8conv.cxx b/l10ntools/source/utf8conv.cxx new file mode 100644 index 000000000000..ee35eb56befd --- /dev/null +++ b/l10ntools/source/utf8conv.cxx @@ -0,0 +1,77 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: utf8conv.cxx,v $ + * $Revision: 1.4 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_l10ntools.hxx" +#include "utf8conv.hxx" + +// +// class UTF8Converter +// + +#define MAX_CONV_BUFFER_SIZE 0xFF00 + +#define TO_CVTFLAGS (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_MAPTOPRIVATE |\ + RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_DEFAULT |\ + RTL_TEXTTOUNICODE_FLAGS_INVALID_DEFAULT) + +#define FROM_CVTFLAGS (RTL_UNICODETOTEXT_FLAGS_UNDEFINED_DEFAULT |\ + RTL_UNICODETOTEXT_FLAGS_INVALID_DEFAULT |\ + RTL_UNICODETOTEXT_FLAGS_UNDEFINED_REPLACE |\ + RTL_UNICODETOTEXT_FLAGS_PRIVATE_MAPTO0) + +/*****************************************************************************/ +void UTF8Converter::Convert( ByteString &rBuffer, + rtl_TextEncoding nSourceENC, rtl_TextEncoding nDestENC ) +/*****************************************************************************/ +{ + String sTemp( rBuffer, nSourceENC ); + rBuffer = ByteString( sTemp, nDestENC ); +} + +/*****************************************************************************/ +ByteString UTF8Converter::ConvertToUTF8( + const ByteString &rASCII, rtl_TextEncoding nEncoding ) +/*****************************************************************************/ +{ + ByteString sReturn( rASCII ); + Convert( sReturn, nEncoding, RTL_TEXTENCODING_UTF8 ); + return sReturn; +} + +/*****************************************************************************/ +ByteString UTF8Converter::ConvertFromUTF8( + const ByteString &rUTF8, rtl_TextEncoding nEncoding ) +/*****************************************************************************/ +{ + ByteString sReturn( rUTF8 ); + Convert( sReturn, RTL_TEXTENCODING_UTF8, nEncoding ); + return sReturn; +} diff --git a/l10ntools/source/wrdtrans.cxx b/l10ntools/source/wrdtrans.cxx new file mode 100644 index 000000000000..c4a9d6ea5570 --- /dev/null +++ b/l10ntools/source/wrdtrans.cxx @@ -0,0 +1,248 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: wrdtrans.cxx,v $ + * $Revision: 1.7 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_l10ntools.hxx" + +/* +#include "wrdtrans.hxx" + + +// NOT FULLY DECLARED SERVICES +#include +#include + + +#include +#include "wtratree.hxx" + +#include +*/ +//************** Declaration WordTrans_ErrorList ******************// +/* +typedef NAMESPACE_STD(vector) Stl_ByteStringList; + +class WordTrans_ErrorList +{ + public: + // OPERATIONS + void AddError( + WordTransformer::E_Error + i_eType, + const char * i_sErrorDescription ); + void Clear(); /// Empties the list. + + // INQUIRY + USHORT NrOfErrors() const; + WordTransformer::E_Error + GetError( + USHORT i_nNr, /// [0 .. NrOfErrors()-1], other values return an empty error. + ByteString * o_pErrorText ) const; /// If o_pErrorText != 0, the String is filled with the description of the error. + private: + // DATA + Stl_ByteStringList aErrors; +}; + +*/ + +//************** Implementation WordTransformer ******************// + +/* +WordTransformer::WordTransformer() + : dpTransformer(0), + dpErrors(new WordTrans_ErrorList) +{ +} + +WordTransformer::~WordTransformer() +{ + if (dpTransformer != 0) + delete dpTransformer; + delete dpErrors; +} + +BOOL +WordTransformer::LoadWordlist( const ByteString & i_sWordlist_Filepath, + CharSet i_nWorkingCharSet, + CharSet i_nFileCharSet ) +{ + if (dpTransformer != 0) + return FALSE; + + SvFileStream aFile(String(i_sWordlist_Filepath,RTL_TEXTENCODING_ASCII_US),STREAM_STD_READ); + if (! aFile.IsOpen()) + return FALSE; + aFile.SetStreamCharSet( i_nFileCharSet ) ; +// aFile.SetTargetCharSet( i_nWorkingCharSet ); + + dpTransformer = new WordTransTree; + + ByteString sTrans; + while ( aFile.ReadLine(sTrans) ) + { + dpTransformer->AddWordPair(sTrans.GetToken(0,';'),sTrans.GetToken(1,';')); + } + + aFile.Close(); + return TRUE; +} + +USHORT +WordTransformer::Transform(ByteString & io_sText) +{ + // Initialization and precondition testing: + dpErrors->Clear(); + if (dpTransformer == 0) + { + dpErrors->AddError(ERROR_NO_WORDLIST,"Error: No wordlist was loaded."); + return dpErrors->NrOfErrors(); + } + else if (io_sText.Len() > 63 * 1024) + { + dpErrors->AddError(ERROR_OUTPUTSTRING_TOO_LONG,"Error: Inputstring was too long (bigger than 63 KB)."); + return dpErrors->NrOfErrors(); + } + else if (io_sText.Len() == 0) + { + return 0; + } + + // Transform: + dpTransformer->InitTransformation( + io_sText.GetBuffer(), + io_sText.Len() ); + + for ( ; !dpTransformer->TextEndReached(); ) + { + if (dpTransformer->TransformNextToken() != WordTransTree::OK) + { + CreateError(); + } + } + io_sText = dpTransformer->Output(); + return dpErrors->NrOfErrors(); +} + +USHORT +WordTransformer::NrOfErrors() const +{ + return dpErrors->NrOfErrors(); +} + +WordTransformer::E_Error +WordTransformer::GetError( USHORT i_nNr, + ByteString * o_pErrorText) const +{ + return dpErrors->GetError(i_nNr,o_pErrorText); +} + +void +WordTransformer::CreateError() +{ + ByteString sErr; + + switch (dpTransformer->CurResult()) + { + case WordTransTree::OK: + break; + case WordTransTree::HOTKEY_LOST: + sErr = ByteString("Error: By replacement of string "); + sErr += dpTransformer->CurReplacedString(); + sErr += " by "; + sErr += dpTransformer->CurReplacingString(); + sErr += "the hotkey at char '"; + sErr += dpTransformer->CurHotkey(); + sErr += "' was lost."; + dpErrors->AddError( ERROR_HOTKEY,sErr.GetBufferAccess()); + sErr.ReleaseBufferAccess(); + break; + case WordTransTree::OUTPUT_OVERFLOW: + dpErrors->AddError(ERROR_OUTPUTSTRING_TOO_LONG,"Error: Output buffer overflow."); + break; + default: + dpErrors->AddError(OTHER_ERROR,"Error: Unknown error."); + } +} +*/ +//************** Implementation WordTrans_ErrorList ******************// +/* +void +WordTrans_ErrorList::AddError( WordTransformer::E_Error i_eType, + const char * i_sErrorDescription ) +{ + ByteString sErrorType = "xxx"; + char * pErrorChars = sErrorType.GetBufferAccess(); + pErrorChars[0] = char(i_eType / 100 + '0'); + pErrorChars[1] = char( (i_eType % 100) / 10 + '0'); + pErrorChars[2] = char(i_eType % 10 + '0'); + sErrorType += i_sErrorDescription; + + aErrors.push_back(sErrorType); + sErrorType.ReleaseBufferAccess(); +} + +void +WordTrans_ErrorList::Clear() +{ + aErrors.erase(aErrors.begin(),aErrors.end()); +} + +USHORT +WordTrans_ErrorList::NrOfErrors() const +{ + return aErrors.size(); +} + +WordTransformer::E_Error +WordTrans_ErrorList::GetError( USHORT i_nNr, + ByteString * o_pErrorText ) const +{ + if ( i_nNr < aErrors.size() ) + { + const ByteString & rError = aErrors[i_nNr]; + const char * pErrorChars = rError.GetBuffer(); + + USHORT nError = USHORT( (pErrorChars[0] - '0') ) * 100 + + (pErrorChars[1] - '0') * 10 + + pErrorChars[2] - '0'; + + if (o_pErrorText != 0) + *o_pErrorText = pErrorChars+3; + + return WordTransformer::E_Error(nError); + } + else + { + if (o_pErrorText != 0) + *o_pErrorText = ""; + return WordTransformer::OK; + } +} +*/ diff --git a/l10ntools/source/wtranode.cxx b/l10ntools/source/wtranode.cxx new file mode 100644 index 000000000000..401c0b20fe1a --- /dev/null +++ b/l10ntools/source/wtranode.cxx @@ -0,0 +1,111 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: wtranode.cxx,v $ + * $Revision: 1.4 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_l10ntools.hxx" + + +#include "wtranode.hxx" + + +// NOT FULLY DECLARED SERVICES + + +const ByteString sEmptyString(""); + + +WTT_Node::WTT_Node( UINT8 i_nValue, + WTT_Node * i_pDefaultBranch, + WTT_Node * i_pDefaultBranchForAlphas ) + : nValue(i_nValue), + eType(token_to_keep), + sReplaceString(sEmptyString), + // aBranches, + bIsOnDeleting(char(0)) +{ + int i = 0; + for ( ; i < C_BR_ALPHABASE; i++ ) + { + aBranches[i] = i_pDefaultBranch; + } // end for + for ( ; i < C_NR_OF_BRANCHES; i++ ) + { + aBranches[i] = i_pDefaultBranchForAlphas; + } +} + +void +WTT_Node::SetBranch( UINT8 i_cBranch, + WTT_Node * i_pNode ) +{ + if (i_cBranch < C_NR_OF_BRANCHES) + { + aBranches[i_cBranch] = i_pNode; + } +} + +void +WTT_Node::SetAsTokenToReplace(const ByteString & i_sReplaceString) +{ + sReplaceString = i_sReplaceString; + eType = token_to_replace; +} + +WTT_Node::~WTT_Node() +{ + // Delete the tree hanging below this node: + + bIsOnDeleting = TRUE; // Avoid double deleting of multiple used nodes. + + for (int i = 0; i < C_NR_OF_BRANCHES; i++) + { + if (aBranches[i] != 0 ? ! aBranches[i]->IsOnDeleting() : FALSE) + { + delete aBranches[i]; + } + } // end for +} + + + + + + + + + + + + + + + + + diff --git a/l10ntools/source/wtratree.cxx b/l10ntools/source/wtratree.cxx new file mode 100644 index 000000000000..dbf02a6f22be --- /dev/null +++ b/l10ntools/source/wtratree.cxx @@ -0,0 +1,421 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: wtratree.cxx,v $ + * $Revision: 1.5 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_l10ntools.hxx" + + +#include "wtratree.hxx" + + + +/** @ATTENTION + For reasons of speed, class WordTransTree works with two simple + char arrays, sOutput and sInput, instead of secure containers or + streams. So be extremely careful, when changing this code!!! +**/ + + + +// NOT FULLY DECLARED SERVICES +#include +#include +#include +#include "wtranode.hxx" + + +const BRANCH_T BR_END = 0; +const BRANCH_T BR_NONALPHA = 1; +const BRANCH_T BR_HOTKEY = 2; +const BRANCH_T BR_BACKSLASH = 3; +const BRANCH_T BR_ALPHABASE = 4; /// @ATTENTION All branches not valid for words must be smaller than this value! +const BRANCH_T BR_AE = 30; +const BRANCH_T BR_OE = 31; +const BRANCH_T BR_UE = 32; +const BRANCH_T BR_SZ = 33; +const BRANCH_T BR_MAX = 34; /// @ATTENTION Must be updated always! + +const BRANCH_T BR_START = 0; + + + + + +WordTransTree::WordTransTree(CharSet i_nWorkingCharSet) + : sInput(0), + nInputLength(0), + pInputEnd(0), + sOutput(0), + nOutputMaxLength(0), + dpParsingTreeTop(0), + pUnknownAlpha(0), + // cChar2Branch + c_AE(u_char('\xC4')), c_OE(u_char('\xD6')), c_UE(u_char('\xDC')), + c_ae(u_char('\xE4')), c_oe(u_char('\xF6')), c_ue(u_char('\xFC')), + pInputCurTokenStart(0), + pInputPosition(0), + pOutputPosition(0), + pCurParseNode(0), + eCurResult(OK), + cCurHotkey(0), + cCurHotkeySign(u_char('~')) +{ + // Initialize parsing tree: + pUnknownAlpha = new WTT_Node(BR_ALPHABASE,0,0); // This will be deleted as part of the parsing tree. + for ( UINT8 i = BR_ALPHABASE; i < C_NR_OF_BRANCHES; i++) + { + pUnknownAlpha->SetBranch(i,pUnknownAlpha); + } // end for + + dpParsingTreeTop = new WTT_Node(BR_START,0,pUnknownAlpha); + + WTT_Node * dpNonAlpha = new WTT_Node(BR_NONALPHA,0,0); + + dpNonAlpha->SetBranch(BR_NONALPHA,dpNonAlpha); + dpParsingTreeTop->SetBranch(BR_NONALPHA,dpNonAlpha); + + WTT_Node * dpBackslash = new WTT_Node(BR_BACKSLASH,dpNonAlpha,dpNonAlpha); + dpBackslash->SetBranch(BR_END,0); + + dpParsingTreeTop->SetBranch(BR_BACKSLASH,dpBackslash); + dpNonAlpha->SetBranch(BR_BACKSLASH,dpBackslash); + + + // Initialize character set: + SetCharSet(i_nWorkingCharSet); + + if (C_BR_ALPHABASE != BR_ALPHABASE || C_NR_OF_BRANCHES != BR_MAX) + { + fprintf(stderr, "Assertion failed: file %s line %d.", __FILE__, __LINE__); + exit(1); + } +} + +void +WordTransTree::SetCharSet(CharSet i_nWorkingCharSet) +{ + ByteString sConvert("\xC4\xD6\xDC\xE4\xF6\xFC\xDF"); + const u_char * pConvert = (const u_char * ) ( sConvert.Convert(RTL_TEXTENCODING_MS_1252, i_nWorkingCharSet).GetBuffer() ); + + INT16 i = 0; + for ( ; i < C_NR_OF_POSSIBLE_CHARS; ++i ) + { + cChar2Branch[i] = BR_NONALPHA; + } // end for + for ( i = 'a'; i <= 'z'; ++i ) + { + cChar2Branch[i] = BR_ALPHABASE + i - 'a'; + } // end for + for ( i = 'A'; i <= 'Z'; ++i ) + { + cChar2Branch[i] = BR_ALPHABASE + i - 'A'; + } // end for + cChar2Branch[pConvert[0]] = BR_AE; + cChar2Branch[pConvert[1]] = BR_OE; + cChar2Branch[pConvert[2]] = BR_UE; + cChar2Branch[pConvert[3]] = BR_AE; + cChar2Branch[pConvert[4]] = BR_OE; + cChar2Branch[pConvert[5]] = BR_UE; + cChar2Branch[pConvert[6]] = BR_SZ; + + cChar2Branch[u_char('~')] = BR_HOTKEY; + cChar2Branch[u_char('&')] = BR_HOTKEY; + + + c_AE = pConvert[0]; + c_OE = pConvert[1]; + c_UE = pConvert[2]; + c_ae = pConvert[3]; + c_oe = pConvert[4]; + c_ue = pConvert[5]; +} + +WordTransTree::~WordTransTree() +{ + delete dpParsingTreeTop; + if (sOutput != 0) + delete [] sOutput; +} + +void +WordTransTree::AddWordPair( const ByteString & i_sOldString, + const ByteString & i_sReplaceString ) +{ + if (i_sOldString.Len() == 0) + return; + + pCurParseNode = dpParsingTreeTop; + WTT_Node * pBranch = 0; + char cBranch = 0; + + for ( constr pOld = i_sOldString.GetBuffer(); + *pOld != 0; + pOld++ ) + { + cBranch = CalculateBranch(*pOld); + pBranch = pCurParseNode->GetNextNode(cBranch); + if (pBranch == 0 || pBranch == pUnknownAlpha) + { + pBranch = new WTT_Node(cBranch,0,pUnknownAlpha); + pCurParseNode->SetBranch(cBranch,pBranch); + } + pCurParseNode = pBranch; + } // end for + pCurParseNode->SetAsTokenToReplace(i_sReplaceString); +} + +void +WordTransTree::InitTransformation( const char * i_sInput, + UINT32 i_nInputLength, + UINT32 i_nOutputMaxLength ) +{ + sInput = (const u_char *)i_sInput; + nInputLength = i_nInputLength; + pInputEnd = &sInput[i_nInputLength]; + + pInputCurTokenStart = sInput; + pInputPosition = sInput; + + if (nOutputMaxLength < i_nOutputMaxLength) + { + if (sOutput != 0) + delete [] sOutput; + sOutput = new unsigned char[i_nOutputMaxLength]; + nOutputMaxLength = i_nOutputMaxLength; + } + pOutputPosition = sOutput; +} + +/** pInputCurTokenStart and CurParseNode are updated just when + starting this function. After its end they must not be changed + till this functon is called again. + Outside this function pInputPositon and pOutputPosition are both + on the first not transformed char in their respective array. +**/ +WordTransTree::E_Result +WordTransTree::TransformNextToken() +{ + pInputCurTokenStart = pInputPosition; + pCurParseNode = dpParsingTreeTop; + cCurHotkey = 0; + eCurResult = OK; + + WTT_Node * pBranch = 0; + UINT8 cBranch = 0; + + for ( pCurParseNode = dpParsingTreeTop; + pInputPosition != pInputEnd; + ++pInputPosition ) + { + cBranch = CalculateBranch(*pInputPosition); + pBranch = pCurParseNode->GetNextNode( cBranch ); + if (pBranch != 0) + { + pCurParseNode = pBranch; + } + else + { + if (cBranch == BR_HOTKEY) // current letter is '~' or '&'. + { + // Logic of the following. There are 9 possible cases - + // A = alphabetic letter, NA = non alphabetic, TB = token begin, + // Eot = end of text: + // 1. A~A set hotkey to following letter, continue + // 2. A~NA token end + // 3. A~Eot token end + // 4. NA~A token end + // 5. NA~NA continue + // 6. A~Eof continue + // 7. TB~A set hotkey to following letter, continue + // 8. TB~NA continue + // 9. TB~Eot continue + + // bNext and Prev are true, if there are alphabetic letters: + BOOL bNext = pInputPosition + 1 != pInputEnd + ? CalculateBranch(pInputPosition[1]) >= BR_ALPHABASE + : FALSE; + BOOL bPrev = pCurParseNode->Value() >= BR_ALPHABASE; + + if ( bNext && (bPrev || pCurParseNode == dpParsingTreeTop) ) + { // case 1. and 7. + Handle_Hotkey(); + continue; + } + else if (!bPrev && !bNext) + { // case 5.,6.,8.,9. + continue; + } + + // Case 2.,3.,4. : + // so this should be handled as an end of a token. + } + if (pCurParseNode->TokenType() == WTT_Node::token_to_keep) + { + Handle_TokenToKeep(); + return eCurResult; + } + else + { + Handle_TokenToTransform(); + return eCurResult; + } // endif (pCurParseNode->TokenType() == WTT_Node::token_to_keep) + } // endif (pBranch == 0) else + } // end for + + // If here, the text end is reached + if (pCurParseNode->TokenType() == WTT_Node::token_to_keep) + { + Handle_TokenToKeep(); + return eCurResult; + } + else + { + Handle_TokenToTransform(); + return eCurResult; + } +} + +ByteString +WordTransTree::CurReplacingString() const +{ + return pCurParseNode->ReplaceString(); +} + +void +WordTransTree::Handle_Hotkey() +{ + if (cCurHotkey == 0) // Avoid to replace the first found hotkey by + // a later one - though this shouldn't happen anyway. + { + cCurHotkey = (pInputPosition+1) != pInputEnd ? pInputPosition[1] : 0; + cCurHotkeySign = *pInputPosition; + } +} + +void +WordTransTree::Handle_TokenToKeep() +{ + UINT32 nTokenLength = pInputPosition-pInputCurTokenStart; + + memcpy(pOutputPosition,pInputCurTokenStart,nTokenLength); + + pOutputPosition += nTokenLength; + *pOutputPosition = '\0'; +} + +void +WordTransTree::Handle_TokenToTransform() +{ + BOOL bHaveHotkey = CalculateBranch(cCurHotkey) >= BR_ALPHABASE; + const ByteString & rReplace = pCurParseNode->ReplaceString(); + + // Find position of hotkey in replace-string: + USHORT nHotkeyPos = bHaveHotkey + ? rReplace.Search(char(cCurHotkey)) + : STRING_NOTFOUND; + if (nHotkeyPos == STRING_NOTFOUND && bHaveHotkey) + { + if (cCurHotkey < 128) + { + if (islower(cCurHotkey)) + nHotkeyPos = rReplace.Search(toupper(char(cCurHotkey))); + else + nHotkeyPos = rReplace.Search(tolower(char(cCurHotkey))); + } + else // cCurHotkey >= 128 + { + if (cCurHotkey == c_ae) + nHotkeyPos = rReplace.Search(char(c_AE)); + else if (cCurHotkey == c_oe) + nHotkeyPos = rReplace.Search(char(c_OE)); + else if (cCurHotkey == c_ue) + nHotkeyPos = rReplace.Search(char(c_UE)); + else if (cCurHotkey == c_AE) + nHotkeyPos = rReplace.Search(char(c_ae)); + else if (cCurHotkey == c_OE) + nHotkeyPos = rReplace.Search(char(c_oe)); + else if (cCurHotkey == c_UE) + nHotkeyPos = rReplace.Search(char(c_ue)); + } // endif (cCurHotkey < 128) else + + if (nHotkeyPos == STRING_NOTFOUND) + { + eCurResult = HOTKEY_LOST; + bHaveHotkey = FALSE; + } + } // endif (nHotkeyPos == STRING_NOT_FOUND && bHaveHotkey) + + + UINT32 nOutputTokenLength = rReplace.Len() + (bHaveHotkey ? 1 : 0); + + if (bHaveHotkey) + { + memcpy( pOutputPosition, + pCurParseNode->ReplaceString().GetBuffer(), + nHotkeyPos ); + *(pOutputPosition + nHotkeyPos) = cCurHotkeySign; + memcpy( pOutputPosition + nHotkeyPos + 1, + pCurParseNode->ReplaceString().GetBuffer() + nHotkeyPos, + nOutputTokenLength - nHotkeyPos - 1); + } + else + { + memcpy( pOutputPosition, + pCurParseNode->ReplaceString().GetBuffer(), + nOutputTokenLength ); + } + + // Convert first letter into upper if necessary: + u_char cInStart = CalculateBranch(*pInputCurTokenStart) == BR_HOTKEY + ? pInputCurTokenStart[1] + : pInputCurTokenStart[0] ; + u_char * pOutStart = nHotkeyPos == 0 + ? pOutputPosition + 1 + : pOutputPosition ; + if (isupper(cInStart) || cInStart > 127) + { // Possibly cInStart is upper character: + if (isupper(cInStart) || cInStart == c_AE || cInStart == c_OE || cInStart == c_UE) + { // Surely cInStart is upper character: + u_char cOutStart = *pOutStart; + if (cOutStart < 128) + *pOutStart = toupper(cOutStart); + else if (cOutStart == c_ae) + *pOutStart = c_AE; + else if (cOutStart == c_oe) + *pOutStart = c_OE; + else if (cOutStart == c_ue) + *pOutStart = c_UE; + } + } // endif (isupper(cInStart) || cInStart > 127) + + pOutputPosition += nOutputTokenLength; + *pOutputPosition = '\0'; +} + diff --git a/l10ntools/source/xgfconv.cxx b/l10ntools/source/xgfconv.cxx new file mode 100644 index 000000000000..54b92fb3c1c2 --- /dev/null +++ b/l10ntools/source/xgfconv.cxx @@ -0,0 +1,66 @@ +#include + +#include "export.hxx" +#include "utf8conv.hxx" + +/*****************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_l10ntools.hxx" +#if defined(UNX) || defined(OS2) +int main( int argc, char *argv[] ) +#else +int _cdecl main( int argc, char *argv[] ) +#endif +/*****************************************************************************/ +{ + if ( argc != 3 ) { + fprintf( stderr, "xgfconv InputFile OutputFile\n" ); + return ( 5 ); + } + + ByteString sInput( argv[ 1 ] ); + ByteString sOutput( argv[ 2 ] ); + + SvFileStream aInput( String( sInput, RTL_TEXTENCODING_ASCII_US ), STREAM_STD_READ ); + if ( !aInput.IsOpen()) { + fprintf( stderr, "ERROR: Unable to open input file!\n" ); + return ( 5 ); + } + + SvFileStream aOutput( String( sOutput, RTL_TEXTENCODING_ASCII_US ), STREAM_STD_WRITE | STREAM_TRUNC ); + if ( !aOutput.IsOpen()) { + fprintf( stderr, "ERROR: Unable to open output file!\n" ); + aInput.Close(); + return ( 5 ); + } + + ByteString sLine; + BOOL bFirst = TRUE; + while ( !aInput.IsEof()) { + aInput.ReadLine( sLine ); + ByteString sLangId = sLine.GetToken( 0, '\t' ); + ByteString sFile = sLine.GetToken( 1, '\t' ); + ByteString sText = sLine.Copy( sLangId.Len() + sFile.Len() + 2 ); + + USHORT nLangId = sLangId.ToInt32(); + CharSet aCharSet = Export::GetCharSet( nLangId ); + if ( aCharSet != 0xFFFF && sText.Len()) { + sText = UTF8Converter::ConvertToUTF8( sText, aCharSet ); + ByteString sOutput = sFile; + sOutput += "\t"; + sOutput += sText; + if ( !bFirst ) { + ByteString sEmpty; + aOutput.WriteLine( sEmpty ); + } + else + bFirst = FALSE; + aOutput.Write( sOutput.GetBuffer(), sOutput.Len()); + } + } + aInput.Close(); + aOutput.Close(); + return ( 0 ); +} + diff --git a/l10ntools/source/xmlparse.cxx b/l10ntools/source/xmlparse.cxx new file mode 100644 index 000000000000..f75a0afe9792 --- /dev/null +++ b/l10ntools/source/xmlparse.cxx @@ -0,0 +1,1456 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: xmlparse.cxx,v $ + * $Revision: 1.24 $ + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_l10ntools.hxx" +#include /* std::iterator*/ + +#include +#include + +#include "xmlparse.hxx" +#include +#include +#include +#include +#ifdef __MINGW32__ +#include +#include +#endif +using namespace std; +using namespace osl; + +// +// class XMLChildNode +// + +/*****************************************************************************/ +XMLChildNode::XMLChildNode( XMLParentNode *pPar ) +/*****************************************************************************/ + : pParent( pPar ) +{ + if ( pParent ) + pParent->AddChild( this ); +} + + +/*****************************************************************************/ +XMLChildNode::XMLChildNode( const XMLChildNode& obj) +/*****************************************************************************/ +: XMLNode(obj), + pParent(obj.pParent){} + +/*****************************************************************************/ +XMLChildNode& XMLChildNode::operator=(const XMLChildNode& obj){ +/*****************************************************************************/ + if(this != &obj){ + pParent=obj.pParent; + } + return *this; +} +// +// class XMLParentNode +// + + +/*****************************************************************************/ +XMLParentNode::~XMLParentNode() +/*****************************************************************************/ +{ + if( pChildList ){ + RemoveAndDeleteAllChilds(); + delete pChildList; + pChildList = NULL; + } + pChildList = NULL; +} +/*****************************************************************************/ +XMLParentNode::XMLParentNode( const XMLParentNode& obj) +/*****************************************************************************/ +: XMLChildNode( obj ) +{ + if( obj.pChildList ){ + pChildList=new XMLChildNodeList(); + XMLChildNode* pNode = NULL; + for ( ULONG i = 0; i < obj.pChildList->Count(); i++ ){ + pNode = obj.pChildList->GetObject( i ); + if( pNode != NULL){ + switch(pNode->GetNodeType()){ + case XML_NODE_TYPE_ELEMENT: + AddChild( new XMLElement( *static_cast(pNode) ) ); break; + case XML_NODE_TYPE_DATA: + AddChild( new XMLData ( *static_cast (pNode) ) ); break; + case XML_NODE_TYPE_COMMENT: + AddChild( new XMLComment( *static_cast(pNode) ) ); break; + case XML_NODE_TYPE_DEFAULT: + AddChild( new XMLDefault( *static_cast(pNode) ) ); break; + default: fprintf(stdout,"XMLParentNode::XMLParentNode( const XMLParentNode& obj) strange obj"); + } + } + } + }else pChildList = NULL; +} +/*****************************************************************************/ +XMLParentNode& XMLParentNode::operator=(const XMLParentNode& obj){ +/*****************************************************************************/ + if(this!=&obj){ + XMLChildNode::operator=(obj); + if( pChildList ){ + RemoveAndDeleteAllChilds(); + delete pChildList; + pChildList = NULL; + } + if( obj.pChildList ){ + pChildList=new XMLChildNodeList(); + for ( ULONG i = 0; i < obj.pChildList->Count(); i++ ) + AddChild( obj.pChildList->GetObject( i ) ); + }else pChildList = NULL; + + } + return *this; +} +/*****************************************************************************/ +void XMLParentNode::AddChild( XMLChildNode *pChild ) +/*****************************************************************************/ +{ + if ( !pChildList ) + pChildList = new XMLChildNodeList(); + pChildList->Insert( pChild, LIST_APPEND ); +} + +/*****************************************************************************/ +void XMLParentNode::AddChild( XMLChildNode *pChild , int pos ) +/*****************************************************************************/ +{ + if ( !pChildList ) + pChildList = new XMLChildNodeList(); + pChildList->Insert( pChild, pos ); +} + +/*****************************************************************************/ +int XMLParentNode::GetPosition( ByteString id ){ +/*****************************************************************************/ + XMLElement* a; + + static const ByteString sEnusStr = ByteString(String::CreateFromAscii(ENGLISH_US_ISO).ToLowerAscii() , RTL_TEXTENCODING_ASCII_US ).ToLowerAscii(); + static const ByteString sDeStr = ByteString(String::CreateFromAscii(GERMAN_ISO2).ToLowerAscii() , RTL_TEXTENCODING_ASCII_US ).ToLowerAscii(); + + if ( pChildList ){ + for ( ULONG i = 0; i < pChildList->Count(); i++ ) { + XMLChildNode *pChild = pChildList->GetObject( i ); + if ( pChild->GetNodeType() == XML_NODE_TYPE_ELEMENT ){ + a = static_cast(pChild); + ByteString elemid( a->GetId() ); + elemid.ToLowerAscii(); + if ( elemid.Equals( id.ToLowerAscii() ) ){ + ByteString elemLID( a->GetLanguageId() ); + elemLID.ToLowerAscii(); + if( elemLID.Equals( sEnusStr) ) { + return i; + } + else if( elemLID.Equals( sDeStr) ) { + return i; + } + } + } + } + } + return -1; +} + +/*****************************************************************************/ +int XMLParentNode::RemoveChild( XMLElement *pRefElement ) +/*****************************************************************************/ +{ + XMLElement* a; + if ( pChildList ){ + for ( ULONG i = 0; i < pChildList->Count(); i++ ) { + XMLChildNode *pChild = pChildList->GetObject( i ); + if ( pChild->GetNodeType() == XML_NODE_TYPE_ELEMENT ){ + a = static_cast(pChild); + ByteString elemid( a->GetId() ); + elemid.ToLowerAscii(); + ByteString elemLID( a->GetLanguageId() ); + elemLID.ToLowerAscii(); + ByteString pRefLID( pRefElement->GetLanguageId() ); + pRefLID.ToLowerAscii(); + if ( elemid.Equals(pRefElement->GetId()) + && elemLID.Equals( pRefLID ) ) + { + if( pRefElement->ToOString().compareTo( a->ToOString() )==0 ){ + pChildList->Remove( i ); + delete a; // Test + return i; + } + } + } + + } + } + return -1; +} + +/*****************************************************************************/ +void XMLParentNode::RemoveAndDeleteAllChilds(){ +/*****************************************************************************/ + if ( pChildList ) { + for ( ULONG i = 0; i < pChildList->Count(); i++ ) + delete pChildList->GetObject( i ); + pChildList->Clear(); + } +} + +/*****************************************************************************/ +XMLElement *XMLParentNode::GetChildElement( XMLElement *pRefElement ) +/*****************************************************************************/ +{ + for ( ULONG i = 0; i < pChildList->Count(); i++ ) { + XMLChildNode *pChild = pChildList->GetObject( i ); + if ( pChild->GetNodeType() == XML_NODE_TYPE_ELEMENT ) + if ((( XMLElement * ) pChild )->GetName() == + pRefElement->GetName()) + { + XMLAttributeList *pList = pRefElement->GetAttributeList(); + if ( !pList ) + return ( XMLElement * ) pChild; + + BOOL bMatch = FALSE; + for ( ULONG j = 0; j < pList->Count() && bMatch; j++ ) { + XMLAttribute *pAttribute = pList->GetObject( j ); + XMLAttribute *pCandidate = + (( XMLElement * ) pChild )->GetAttribute( + *pAttribute ); + if ( !pCandidate || !pAttribute->IsEqual( *pCandidate )) + bMatch = FALSE; + } + if ( bMatch ) + return ( XMLElement * ) pChild; + } + } + return NULL; +} + +// +// class XMLFile +// + +/*****************************************************************************/ +USHORT XMLFile::GetNodeType() +/*****************************************************************************/ +{ + return XML_NODE_TYPE_FILE; +} + +/*****************************************************************************/ +BOOL XMLFile::Write( ByteString &aFilename ) +/*****************************************************************************/ +{ + + if ( aFilename.Len()) { + // retry harder if there is a NFS problem, + for( int x = 1 ; x < 3 ; x++ ){ // this looks strange...yes! + ofstream aFStream( aFilename.GetBuffer() , ios::out | ios::trunc ); + + if( !aFStream ) // From time to time the stream can not be opened the first time on NFS volumes, + { // I wasn't able to track this down. I think this is an NFS issue ..... + //cerr << "ERROR: - helpex - Can't write to tempfile " << aFilename.GetBuffer() << " No#" << x << "\n"; + TimeValue aTime; + aTime.Seconds = 3; + aTime.Nanosec = 0; + + osl::Thread::wait( aTime ); + } + else + { + // write out + Write( aFStream ); + aFStream.close(); + + // check! + DirEntry aTarget( aFilename ); + FileStat aFileStat( aTarget ); + + if( aFileStat.GetSize() < 1 ) + { + //retry + //cerr << "WARNING: - helpex - Can't create file " << aFilename.GetBuffer() << " No#" << x << "\n"; + aTarget.Kill(); + } + else + { + //everything ok! + return true; + } + } + } + cerr << "ERROR: - helpex - Can't create file " << aFilename.GetBuffer() << "\nPossible reason: Disk full ? Mounted NFS volume broken ? Wrong permissions ?\n"; + exit( -1 ); + } + cerr << "ERROR: - helpex - Empty file name\n"; + exit( -1 ); +} + + + +void XMLFile::WriteString( ofstream &rStream, const String &sString ) +{ + ByteString sText( sString, RTL_TEXTENCODING_UTF8 ); + rStream << sText.GetBuffer(); +} + + +BOOL XMLFile::Write( ofstream &rStream , XMLNode *pCur ) +{ + XMLUtil& xmlutil = XMLUtil::Instance(); + (void) xmlutil; + + if ( !pCur ) + Write( rStream, this ); + else { + switch( pCur->GetNodeType()) { + case XML_NODE_TYPE_FILE: { + if( GetChildList()) + for ( ULONG i = 0; i < GetChildList()->Count(); i++ ) + Write( rStream, GetChildList()->GetObject( i )); + } + break; + case XML_NODE_TYPE_ELEMENT: { + XMLElement *pElement = ( XMLElement * ) pCur; + rStream << "<"; + WriteString( rStream, pElement->GetName()); + if ( pElement->GetAttributeList()) + for ( ULONG j = 0; j < pElement->GetAttributeList()->Count(); j++ ) { + rStream << " "; + String sData(*pElement->GetAttributeList()->GetObject( j )); + xmlutil.QuotHTML( sData ); + WriteString( rStream , sData ); + rStream << "=\""; + sData=pElement->GetAttributeList()->GetObject( j )->GetValue(); + xmlutil.QuotHTML( sData ); + WriteString( rStream , sData ); + rStream << "\""; + } + if ( !pElement->GetChildList()) + rStream << "/>"; + else { + rStream << ">"; + for ( ULONG k = 0; k < pElement->GetChildList()->Count(); k++ ) + Write( rStream, pElement->GetChildList()->GetObject( k )); + rStream << "GetName()); + rStream << ">"; + } + } + break; + case XML_NODE_TYPE_DATA: { + XMLData *pData = ( XMLData * ) pCur; + String sData( pData->GetData()); + xmlutil.QuotHTML( sData ); + WriteString( rStream, sData ); + } + break; + case XML_NODE_TYPE_COMMENT: { + XMLComment *pComment = ( XMLComment * ) pCur; + rStream << ""; + } + break; + case XML_NODE_TYPE_DEFAULT: { + XMLDefault *pDefault = ( XMLDefault * ) pCur; + WriteString( rStream, pDefault->GetDefault()); + } + break; + } + } + return TRUE; +} + + +void XMLFile::Print( XMLNode *pCur, USHORT nLevel ) +{ + + if ( !pCur ) + Print( this ); + else { + switch( pCur->GetNodeType()) { + case XML_NODE_TYPE_FILE: { + if( GetChildList()) + for ( ULONG i = 0; i < GetChildList()->Count(); i++ ) + Print( GetChildList()->GetObject( i )); + } + break; + case XML_NODE_TYPE_ELEMENT: { + XMLElement *pElement = ( XMLElement * ) pCur; + + fprintf( stdout, "<%s", ByteString( pElement->GetName(), RTL_TEXTENCODING_UTF8 ).GetBuffer()); + if ( pElement->GetAttributeList()) + for ( ULONG j = 0; j < pElement->GetAttributeList()->Count(); j++ ){ + ByteString aAttrName( *pElement->GetAttributeList()->GetObject( j ), RTL_TEXTENCODING_UTF8 ); + if( !aAttrName.EqualsIgnoreCaseAscii( XML_LANG ) ) { + fprintf( stdout, " %s=\"%s\"", + aAttrName.GetBuffer(), + ByteString( pElement->GetAttributeList()->GetObject( j )->GetValue(), + RTL_TEXTENCODING_UTF8 ).GetBuffer()); + } + } + if ( !pElement->GetChildList()) + fprintf( stdout, "/>" ); + else { + fprintf( stdout, ">" ); + for ( ULONG k = 0; k < pElement->GetChildList()->Count(); k++ ) + Print( pElement->GetChildList()->GetObject( k ), nLevel + 1 ); + fprintf( stdout, "", ByteString( pElement->GetName(), RTL_TEXTENCODING_UTF8 ).GetBuffer()); + } + } + break; + case XML_NODE_TYPE_DATA: { + XMLData *pData = ( XMLData * ) pCur; + String sData = pData->GetData(); + fprintf( stdout, "%s", ByteString( sData, RTL_TEXTENCODING_UTF8 ).GetBuffer()); + } + break; + case XML_NODE_TYPE_COMMENT: { + XMLComment *pComment = ( XMLComment * ) pCur; + fprintf( stdout, "", ByteString( pComment->GetComment(), RTL_TEXTENCODING_UTF8 ).GetBuffer()); + } + break; + case XML_NODE_TYPE_DEFAULT: { + XMLDefault *pDefault = ( XMLDefault * ) pCur; + fprintf( stdout, "%s", ByteString( pDefault->GetDefault(), RTL_TEXTENCODING_UTF8 ).GetBuffer()); + } + break; + } + } +} +XMLFile::~XMLFile() +{ + if( XMLStrings != NULL ){ + XMLHashMap::iterator pos = XMLStrings->begin(); + for( ; pos != XMLStrings->end() ; ++pos ){ + delete pos->second; // Check and delete content also ? + } + delete XMLStrings; + XMLStrings = NULL; + } +} +/*****************************************************************************/ +XMLFile::XMLFile( const String &rFileName ) // the file name, empty if created from memory stream +/*****************************************************************************/ + : XMLParentNode( NULL ), + sFileName ( rFileName ), + ID ( "id" ), + OLDREF ( "oldref" ), + XML_LANG ( "xml-lang" ), + XMLStrings ( NULL ) + +{ +// nodes_localize.insert( TagMap::value_type(ByteString(String::CreateFromAscii("bookmark_value"),RTL_TEXTENCODING_ASCII_US) , TRUE) ); + nodes_localize.insert( TagMap::value_type(ByteString(String::CreateFromAscii("bookmark"),RTL_TEXTENCODING_ASCII_US) , TRUE) ); + nodes_localize.insert( TagMap::value_type(ByteString(String::CreateFromAscii("variable"),RTL_TEXTENCODING_ASCII_US) , TRUE) ); + nodes_localize.insert( TagMap::value_type(ByteString(String::CreateFromAscii("paragraph"),RTL_TEXTENCODING_ASCII_US) , TRUE) ); + nodes_localize.insert( TagMap::value_type(ByteString(String::CreateFromAscii("alt"),RTL_TEXTENCODING_ASCII_US) , TRUE) ); + nodes_localize.insert( TagMap::value_type(ByteString(String::CreateFromAscii("caption"),RTL_TEXTENCODING_ASCII_US) , TRUE) ); + nodes_localize.insert( TagMap::value_type(ByteString(String::CreateFromAscii("title"),RTL_TEXTENCODING_ASCII_US) , TRUE) ); + nodes_localize.insert( TagMap::value_type(ByteString(String::CreateFromAscii("link"),RTL_TEXTENCODING_ASCII_US) , TRUE) ); +} +/*****************************************************************************/ +void XMLFile::Extract( XMLFile *pCur ) +/*****************************************************************************/ +{ + if( XMLStrings != NULL ) delete XMLStrings; // Elements ? + + XMLStrings = new XMLHashMap(); + if ( !pCur ) + SearchL10NElements( this ); + else { + if( pCur->GetNodeType()==XML_NODE_TYPE_FILE) { + SearchL10NElements(pCur); + } + } +} + +/*****************************************************************************/ +void XMLFile::View(){ +/*****************************************************************************/ + XMLElement* cur; + for(XMLHashMap::iterator pos=XMLStrings->begin(); pos!=XMLStrings->end();++pos){ + fprintf(stdout,"\nid=%s\n",(pos->first).GetBuffer()); + LangHashMap* elem=pos->second; + for(LangHashMap::iterator pos2=elem->begin(); pos2!=elem->end();++pos2){ + fprintf( stdout,"\nlanguage=%s\n",(pos2->first).GetBuffer() ); + cur=pos2->second; + fprintf(stdout,"\n%s\n",((XMLElement*)cur)->ToOString().getStr()); + + } + } +} + +/*****************************************************************************/ +void XMLFile::InsertL10NElement( XMLElement* pElement ){ +/*****************************************************************************/ + ByteString tmpStr,id,oldref,language(""); + LangHashMap* elem; + + if( pElement->GetAttributeList() != NULL ){ + for ( ULONG j = 0; j < pElement->GetAttributeList()->Count(); j++ ){ + tmpStr=ByteString( *pElement->GetAttributeList()->GetObject( j ),RTL_TEXTENCODING_UTF8 ); + if( tmpStr.CompareTo(ID)==COMPARE_EQUAL ){ // Get the "id" Attribute + id = ByteString( pElement->GetAttributeList()->GetObject( j )->GetValue(),RTL_TEXTENCODING_UTF8 ); + } + if( tmpStr.CompareTo( XML_LANG ) == COMPARE_EQUAL ){ // Get the "xml-lang" Attribute + language = ByteString( pElement->GetAttributeList()->GetObject( j )->GetValue(),RTL_TEXTENCODING_UTF8 ); + } + + } + }else{ + fprintf(stdout,"XMLFile::InsertL10NElement: No AttributeList found"); + fprintf(stdout,"++++++++++++++++++++++++++++++++++++++++++++++++++"); + Print( pElement , 0 ); + fprintf(stdout,"++++++++++++++++++++++++++++++++++++++++++++++++++"); + } + + XMLHashMap::iterator pos = XMLStrings->find( id ); + if( pos == XMLStrings->end() ){ // No instanze , create new one + elem = new LangHashMap(); + (*elem)[ language ]=pElement; + XMLStrings->insert( XMLHashMap::value_type( id , elem ) ); + order.push_back( id ); + }else{ // Already there + elem=pos->second; + if ( (*elem)[ language ] ) + { + fprintf(stdout,"Error: Duplicated entry. ID = %s LANG = %s in File %s\n", id.GetBuffer(), language.GetBuffer(), ByteString( sFullName,RTL_TEXTENCODING_ASCII_US ).GetBuffer() ); + exit( -1 ); + } + (*elem)[ language ]=pElement; + } +} +/*****************************************************************************/ +void XMLFile::showType(XMLParentNode* node){ +/*****************************************************************************/ + switch (node->GetNodeType()){ + case XML_NODE_TYPE_ELEMENT: fprintf(stdout,"ELEMENT\n") ;break; + case XML_NODE_TYPE_FILE: fprintf(stdout,"FILE\n") ;break; + case XML_NODE_TYPE_COMMENT: fprintf(stdout,"COMMENT\n") ;break; + case XML_NODE_TYPE_DATA: fprintf(stdout,"DATA\n") ;break; + case XML_NODE_TYPE_DEFAULT: fprintf(stdout,"DEFAULT\n") ;break; + default: break; + } +} +XMLFile::XMLFile() +/*****************************************************************************/ + : XMLParentNode( NULL ), + ID ( "id" ), + OLDREF ( "oldref" ), + XML_LANG ( "xml-lang" ), + XMLStrings ( NULL ){}; + + +XMLFile::XMLFile( const XMLFile& obj ) +/*****************************************************************************/ + : XMLParentNode( obj ), + sFileName ( obj.sFileName ), + ID ( "id" ), + OLDREF ( "oldref" ), + XML_LANG ( "xml-lang" ), + XMLStrings ( NULL ) +{ + if( this!=&obj ) + { + nodes_localize =obj.nodes_localize; + order =obj.order; + + } +} +/*****************************************************************************/ +XMLFile& XMLFile::operator=(const XMLFile& obj){ +/*****************************************************************************/ + if( this!=&obj ){ + + XMLParentNode::operator=(obj); + + nodes_localize =obj.nodes_localize; + order =obj.order; + + if( XMLStrings ) delete XMLStrings; + + if( obj.XMLStrings ) + { + XMLStrings = new XMLHashMap(); + for( XMLHashMap::iterator pos = obj.XMLStrings->begin() ; pos != obj.XMLStrings->end() ; ++pos ) + { + LangHashMap* elem=pos->second; + LangHashMap* newelem = new LangHashMap(); + for(LangHashMap::iterator pos2=elem->begin(); pos2!=elem->end();++pos2){ + (*newelem)[ pos2->first ] = new XMLElement( *pos2->second ); + printf("*"); + } + (*XMLStrings)[ pos->first ] = newelem; + } + } + } + printf("done!\n"); + return *this; +} + + +/*****************************************************************************/ +void XMLFile::SearchL10NElements( XMLParentNode *pCur , int pos) +/*****************************************************************************/ +{ + static const ByteString LOCALIZE("localize"); + static const ByteString THEID("id"); + bool bInsert = true; + if ( !pCur ) + SearchL10NElements( this ); + else { + switch( pCur->GetNodeType()) { + case XML_NODE_TYPE_FILE: { + XMLParentNode* pElement; + if( GetChildList()){ + for ( ULONG i = 0; i < GetChildList()->Count(); i++ ){ + pElement = (XMLParentNode*) GetChildList()->GetObject( i ); + if( pElement->GetNodeType() == XML_NODE_TYPE_ELEMENT ) SearchL10NElements( pElement , i); + } + } + } + break; + case XML_NODE_TYPE_ELEMENT: { + XMLElement *pElement = ( XMLElement * ) pCur; + ByteString sName(pElement->GetName(),RTL_TEXTENCODING_ASCII_US); + ByteString language,tmpStrVal,oldref; + if ( pElement->GetAttributeList()){ + for ( ULONG j = 0 , cnt = pElement->GetAttributeList()->Count(); j < cnt && bInsert; j++ ){ + const ByteString tmpStr( *pElement->GetAttributeList()->GetObject( j ),RTL_TEXTENCODING_UTF8 ); + if( tmpStr.CompareTo(THEID)==COMPARE_EQUAL ){ // Get the "id" Attribute + tmpStrVal=ByteString( pElement->GetAttributeList()->GetObject( j )->GetValue(),RTL_TEXTENCODING_UTF8 ); + //printf("Checking id = %s\n",tmpStrVal.GetBuffer() ); + } + if( tmpStr.CompareTo(LOCALIZE)==COMPARE_EQUAL ){ // Get the "localize" Attribute + bInsert=false; + } + if( tmpStr.CompareTo(XML_LANG)==COMPARE_EQUAL ){ // Get the "xml-lang" Attribute + language=ByteString( pElement->GetAttributeList()->GetObject( j )->GetValue(),RTL_TEXTENCODING_UTF8 ); + } + if( tmpStr.CompareTo(OLDREF)==COMPARE_EQUAL ){ // Get the "oldref" Attribute + oldref=ByteString( pElement->GetAttributeList()->GetObject( j )->GetValue(),RTL_TEXTENCODING_UTF8 ); + } + } + pElement->SetLanguageId ( language ); + pElement->SetId ( tmpStrVal.GetBuffer() ); + pElement->SetOldRef ( oldref ); + pElement->SetPos( pos ); + } + + if ( bInsert && ( nodes_localize.find( sName.ToLowerAscii() ) != nodes_localize.end() ) ) + InsertL10NElement(pElement); + else if ( bInsert && pElement->GetChildList() ){ + for ( ULONG k = 0; k < pElement->GetChildList()->Count(); k++ ) + SearchL10NElements( (XMLParentNode*) pElement->GetChildList()->GetObject( k ) , k); + } + } + break; + case XML_NODE_TYPE_DATA: { + } + break; + case XML_NODE_TYPE_COMMENT: { + } + break; + case XML_NODE_TYPE_DEFAULT: { + } + break; + } + } +} + +/*****************************************************************************/ +bool XMLFile::CheckExportStatus( XMLParentNode *pCur ) +/*****************************************************************************/ +{ + static bool bStatusExport = true; + const ByteString LOCALIZE("localize"); + const ByteString STATUS("status"); + const ByteString PUBLISH("PUBLISH"); + const ByteString DEPRECATED("DEPRECATED"); + + const ByteString TOPIC("topic"); + bool bInsert = true; + if ( !pCur ) + CheckExportStatus( this ); + else { + switch( pCur->GetNodeType()) { + case XML_NODE_TYPE_FILE: { + XMLParentNode* pElement; + if( GetChildList()){ + for ( ULONG i = 0; i < GetChildList()->Count(); i++ ){ + pElement = (XMLParentNode*) GetChildList()->GetObject( i ); + if( pElement->GetNodeType() == XML_NODE_TYPE_ELEMENT ) CheckExportStatus( pElement );//, i); + } + } + } + break; + case XML_NODE_TYPE_ELEMENT: { + XMLElement *pElement = ( XMLElement * ) pCur; + ByteString sName(pElement->GetName(),RTL_TEXTENCODING_ASCII_US); + if( sName.EqualsIgnoreCaseAscii( TOPIC ) ){ + if ( pElement->GetAttributeList()){ + for ( ULONG j = 0 , cnt = pElement->GetAttributeList()->Count(); j < cnt && bInsert; j++ ){ + const ByteString tmpStr( *pElement->GetAttributeList()->GetObject( j ),RTL_TEXTENCODING_UTF8 ); + if( tmpStr.EqualsIgnoreCaseAscii( STATUS ) ){ + ByteString tmpStrVal=ByteString( pElement->GetAttributeList()->GetObject( j )->GetValue(),RTL_TEXTENCODING_UTF8 ); + if( !tmpStrVal.EqualsIgnoreCaseAscii( PUBLISH ) && + !tmpStrVal.EqualsIgnoreCaseAscii( DEPRECATED )){ + bStatusExport = false; + } + } + + } + } + } + else if ( pElement->GetChildList() ){ + for ( ULONG k = 0; k < pElement->GetChildList()->Count(); k++ ) + CheckExportStatus( (XMLParentNode*) pElement->GetChildList()->GetObject( k ) );//, k); + } + } + break; + } + } + return bStatusExport; +} + +/*****************************************************************************/ +USHORT XMLElement::GetNodeType() +/*****************************************************************************/ +{ + return XML_NODE_TYPE_ELEMENT; +} + +/*****************************************************************************/ +XMLElement::XMLElement(const XMLElement& obj) +/*****************************************************************************/ + : + XMLParentNode ( obj ), + sElementName ( obj.sElementName ), + pAttributes ( NULL ), + project ( obj.project ), + filename ( obj.filename ), + id ( obj.id ), + sOldRef ( obj.sOldRef ), + resourceType ( obj.resourceType ), + languageId ( obj.languageId ), + nPos ( obj.nPos ) + +{ + if ( obj.pAttributes ){ + pAttributes = new XMLAttributeList(); + for ( ULONG i = 0; i < obj.pAttributes->Count(); i++ ) + AddAttribute( *obj.pAttributes->GetObject( i ) , obj.pAttributes->GetObject( i )->GetValue() ); + } +} + +/*****************************************************************************/ +XMLElement& XMLElement::operator=(const XMLElement& obj){ +/*****************************************************************************/ + if( this!=&obj ){ + XMLParentNode::operator=(obj); + sElementName =obj.sElementName; + project =obj.project; + filename =obj.filename; + id =obj.id; + sOldRef =obj.sOldRef; + resourceType =obj.resourceType; + languageId =obj.languageId; + nPos =obj.nPos; + + if ( pAttributes ){ + for ( ULONG i = 0; i < pAttributes->Count(); i++ ) + delete pAttributes->GetObject( i ); + delete pAttributes; + } + if ( obj.pAttributes ){ + pAttributes =new XMLAttributeList(); + for ( ULONG i = 0; i < obj.pAttributes->Count(); i++ ) + AddAttribute( *obj.pAttributes->GetObject( i ) , obj.pAttributes->GetObject( i )->GetValue() ); + } + } + return *this; +} + +/*****************************************************************************/ +void XMLElement::AddAttribute( const String &rAttribute, const String &rValue ) +/*****************************************************************************/ +{ + if ( !pAttributes ) + pAttributes = new XMLAttributeList(); + pAttributes->Insert( new XMLAttribute( rAttribute, rValue ), LIST_APPEND ); +} + +/*****************************************************************************/ +void XMLElement::ChangeLanguageTag( const String &rValue ){ +/*****************************************************************************/ + static const String rName = String::CreateFromAscii("xml-lang"); + SetLanguageId( ByteString(rValue,RTL_TEXTENCODING_UTF8) ); + if ( pAttributes ){ + for ( ULONG i = 0; i < pAttributes->Count(); i++ ){ + if ( *pAttributes->GetObject( i ) == rName ){ + pAttributes->GetObject( i )->setValue(rValue); + } + } + } + XMLChildNode* pNode = NULL; + XMLElement* pElem = NULL; + XMLChildNodeList* pCList = GetChildList(); + + if( pCList != NULL ){ + for ( ULONG i = 0; i < pCList->Count(); i++ ){ + pNode = pCList->GetObject( i ); + if( pNode != NULL && pNode->GetNodeType() == XML_NODE_TYPE_ELEMENT ){ + pElem = static_cast< XMLElement* >(pNode); + pElem->ChangeLanguageTag( rValue ); + pElem->SetLanguageId( ByteString(rValue,RTL_TEXTENCODING_UTF8) ); + pElem = NULL; + pNode = NULL; + } + } + pCList = NULL; + } +} +/*****************************************************************************/ +XMLAttribute *XMLElement::GetAttribute( const String &rName ) +/*****************************************************************************/ +{ + if ( pAttributes ) + for ( ULONG i = 0; i < pAttributes->Count(); i++ ) + if ( *pAttributes->GetObject( i ) == rName ) + return pAttributes->GetObject( i ); + + return NULL; +} + +/*****************************************************************************/ +XMLElement::~XMLElement() +/*****************************************************************************/ +{ + if ( pAttributes ) { + for ( ULONG i = 0; i < pAttributes->Count(); i++ ) + delete pAttributes->GetObject( i ); + + delete pAttributes; + pAttributes = NULL; + } +} +/*****************************************************************************/ +bool XMLElement::Equals(OUString refStr){ +/*****************************************************************************/ + return refStr.equals( ToOUString() ); +} + +/*****************************************************************************/ +OString XMLElement::ToOString(){ +/*****************************************************************************/ + OUString ouEmpty; + + OUStringBuffer* buffer = new OUStringBuffer(); + Print( this, *buffer , true ); + + OString result( (sal_Unicode* )buffer->getStr(), buffer->getLength() , RTL_TEXTENCODING_UTF8 ); + delete buffer; + return result; +} +/*****************************************************************************/ +OUString XMLElement::ToOUString(){ +/*****************************************************************************/ + OUStringBuffer* buffer = new OUStringBuffer(); + Print(this,*buffer,true); + OUString result=buffer->makeStringAndClear(); + String xy(result.getStr()); + result=OUString(xy); + delete buffer; + return result; +} +/*****************************************************************************/ +void XMLElement::Print(XMLNode *pCur, OUStringBuffer& buffer , bool rootelement ){ +/*****************************************************************************/ + //YD FIXME somewhere COMMENT is defined as 4! + static const String _COMMENT = String::CreateFromAscii("comment"); + static const OUString XML_LANG ( OUString::createFromAscii("xml-lang") ); + + if(pCur!=NULL){ + if(rootelement){ + XMLElement *pElement = ( XMLElement * ) pCur; + if ( pElement->GetAttributeList()){ + if ( pElement->GetChildList()){ + XMLChildNode* tmp=NULL; + for ( ULONG k = 0; k < pElement->GetChildList()->Count(); k++ ){ + tmp=pElement->GetChildList()->GetObject( k ); + Print( tmp, buffer , false); + } + } + } + } + else{ + + switch( pCur->GetNodeType()) { + case XML_NODE_TYPE_ELEMENT: { + XMLElement *pElement = ( XMLElement * ) pCur; + + if( !pElement->GetName().EqualsIgnoreCaseAscii( _COMMENT ) ){ + buffer.append( OUString::createFromAscii("\\<") ); + buffer.append( pElement->GetName() ); + if ( pElement->GetAttributeList()){ + for ( ULONG j = 0; j < pElement->GetAttributeList()->Count(); j++ ){ + + OUString aAttrName( *pElement->GetAttributeList()->GetObject( j ) ); + if( !aAttrName.equalsIgnoreAsciiCase( XML_LANG ) ) { + buffer.append( OUString::createFromAscii(" ") ); + buffer.append( aAttrName ); + buffer.append( OUString::createFromAscii("=") ); + buffer.append( OUString::createFromAscii("\\\"") ); + buffer.append( pElement->GetAttributeList()->GetObject( j )->GetValue() ); + buffer.append( OUString::createFromAscii("\\\"") ); + } + } + } + if ( !pElement->GetChildList()) + buffer.append( OUString::createFromAscii("/\\>") ); + else { + buffer.append( OUString::createFromAscii("\\>") ); + XMLChildNode* tmp=NULL; + for ( ULONG k = 0; k < pElement->GetChildList()->Count(); k++ ){ + tmp=pElement->GetChildList()->GetObject( k ); + Print( tmp, buffer , false); + } + buffer.append( OUString::createFromAscii("\\GetName() ); + buffer.append( OUString::createFromAscii("\\>") ); + } + } + } + break; + case XML_NODE_TYPE_DATA: { + XMLData *pData = ( XMLData * ) pCur; + String sData = pData->GetData(); + buffer.append( sData ); + } + break; + case XML_NODE_TYPE_COMMENT: { + XMLComment *pComment = ( XMLComment * ) pCur; + buffer.append( OUString::createFromAscii("") ); + } + break; + case XML_NODE_TYPE_DEFAULT: { + XMLDefault *pDefault = ( XMLDefault * ) pCur; + buffer.append( pDefault->GetDefault() ); + } + break; + } + } + }else { + fprintf(stdout,"\n#+------Error: NULL Pointer in XMLELement::Print------+#\n"); + return; + } +} + + +// +// class XMLData +// +/*****************************************************************************/ +XMLData::XMLData(const XMLData& obj) +/*****************************************************************************/ + : XMLChildNode( obj ), + sData( obj.sData ) , + isNewCreated ( obj.isNewCreated ){} + +/*****************************************************************************/ +XMLData& XMLData::operator=(const XMLData& obj){ +/*****************************************************************************/ + if( this!=&obj ){ + XMLChildNode::operator=( obj ); + sData = obj.sData; + isNewCreated = obj.isNewCreated; + } + return *this; +} +/*****************************************************************************/ +void XMLData::AddData( const String &rData) { +/*****************************************************************************/ + sData += rData; +} + +/*****************************************************************************/ +USHORT XMLData::GetNodeType() +/*****************************************************************************/ +{ + return XML_NODE_TYPE_DATA; +} + +// +// class XMLComment +// + +/*****************************************************************************/ +USHORT XMLComment::GetNodeType() +/*****************************************************************************/ +{ + return XML_NODE_TYPE_COMMENT; +} +/*****************************************************************************/ +XMLComment::XMLComment(const XMLComment& obj) +/*****************************************************************************/ + : XMLChildNode( obj ), + sComment( obj.sComment ){} + +/*****************************************************************************/ +XMLComment& XMLComment::operator=(const XMLComment& obj){ +/*****************************************************************************/ + if( this!=&obj ){ + XMLChildNode::operator=( obj ); + sComment = obj.sComment; + } + return *this; +} + +// +// class XMLDefault +// + +/*****************************************************************************/ +USHORT XMLDefault::GetNodeType() +/*****************************************************************************/ +{ + return XML_NODE_TYPE_DEFAULT; +} +/*****************************************************************************/ +XMLDefault::XMLDefault(const XMLDefault& obj) +/*****************************************************************************/ + : XMLChildNode( obj ), + sDefault( obj.sDefault){} + +/*****************************************************************************/ +XMLDefault& XMLDefault::operator=(const XMLDefault& obj){ +/*****************************************************************************/ + if( this!=&obj ){ + XMLChildNode::operator=( obj ); + sDefault = obj.sDefault; + } + return *this; +} + + +// +// class SimpleXMLParser +// + +#define XML_CHAR_TO_OUSTRING(x) OStringToOUString(OString(x), RTL_TEXTENCODING_UTF8) +#define XML_CHAR_N_TO_OUSTRING(x,n) OStringToOUString(OString(x,n), RTL_TEXTENCODING_UTF8 ) + + +/*****************************************************************************/ +SimpleXMLParser::SimpleXMLParser() +/*****************************************************************************/ + : pXMLFile( NULL ) +{ + aParser = XML_ParserCreate( NULL ); + XML_SetUserData( aParser, this ); + XML_SetElementHandler( aParser, (XML_StartElementHandler) StartElementHandler, (XML_EndElementHandler) EndElementHandler ); + XML_SetCharacterDataHandler( aParser, (XML_CharacterDataHandler) CharacterDataHandler ); + XML_SetCommentHandler( aParser, (XML_CommentHandler) CommentHandler ); + XML_SetDefaultHandler( aParser, (XML_DefaultHandler) DefaultHandler ); +} + +/*****************************************************************************/ +SimpleXMLParser::~SimpleXMLParser() +/*****************************************************************************/ +{ + XML_ParserFree( aParser ); +} + +/*****************************************************************************/ +void SimpleXMLParser::StartElementHandler( + void *userData, const XML_Char *name, const XML_Char **atts ) +/*****************************************************************************/ +{ + (( SimpleXMLParser * ) userData )->StartElement( name, atts ); +} + + +/*****************************************************************************/ +void SimpleXMLParser::EndElementHandler( + void *userData, const XML_Char *name ) +/*****************************************************************************/ +{ + (( SimpleXMLParser * ) userData )->EndElement( name ); +} + +/*****************************************************************************/ +void SimpleXMLParser::CharacterDataHandler( + void *userData, const XML_Char *s, int len ) +/*****************************************************************************/ +{ + (( SimpleXMLParser * ) userData )->CharacterData( s, len ); +} + +/*****************************************************************************/ +void SimpleXMLParser::CommentHandler( + void *userData, const XML_Char *data ) +/*****************************************************************************/ +{ + (( SimpleXMLParser * ) userData )->Comment( data ); +} + +/*****************************************************************************/ +void SimpleXMLParser::DefaultHandler( + void *userData, const XML_Char *s, int len ) +/*****************************************************************************/ +{ + (( SimpleXMLParser * ) userData )->Default( s, len ); +} + +/*****************************************************************************/ +void SimpleXMLParser::StartElement( + const XML_Char *name, const XML_Char **atts ) +/*****************************************************************************/ +{ + String sElementName = String( XML_CHAR_TO_OUSTRING( name )); + XMLElement *pElement = new XMLElement( sElementName, ( XMLParentNode * ) pCurNode ); + pCurNode = pElement; + pCurData = NULL; + + int i = 0; + while( atts[i] ) { + pElement->AddAttribute( + String( XML_CHAR_TO_OUSTRING( atts[ i ] )), + String( XML_CHAR_TO_OUSTRING( atts[ i + 1 ] ))); + i += 2; + } +} + +/*****************************************************************************/ +void SimpleXMLParser::EndElement( const XML_Char *name ) +/*****************************************************************************/ +{ + // This variable is not used at all, but the the sax C interface can't be changed + // To prevent warnings this dummy assignment is used + // +++ + (void) name; + + pCurNode = pCurNode->GetParent(); + pCurData = NULL; +} + +/*****************************************************************************/ +void SimpleXMLParser::CharacterData( + const XML_Char *s, int len ) +/*****************************************************************************/ +{ + if ( !pCurData ){ + String x=String( XML_CHAR_N_TO_OUSTRING( s, len )); + XMLUtil::UnQuotHTML(x); + pCurData = new XMLData( x , pCurNode ); + }else{ + String x=String( XML_CHAR_N_TO_OUSTRING( s, len )); + XMLUtil::UnQuotHTML(x); + pCurData->AddData( x ); + + } +} + +/*****************************************************************************/ +void SimpleXMLParser::Comment( + const XML_Char *data ) +/*****************************************************************************/ +{ + pCurData = NULL; + new XMLComment( String( XML_CHAR_TO_OUSTRING( data )), pCurNode ); +} + +/*****************************************************************************/ +void SimpleXMLParser::Default( + const XML_Char *s, int len ) +/*****************************************************************************/ +{ + pCurData = NULL; + new XMLDefault( + String( XML_CHAR_N_TO_OUSTRING( s, len )), pCurNode ); +} + +/*****************************************************************************/ +XMLFile *SimpleXMLParser::Execute( const String &rFullFileName , const String &rFileName, XMLFile* pXMLFileIn ) +/*****************************************************************************/ +{ +// printf("DBG: SimpleXMLParser::Execute( %s )", ByteString( rFileName , RTL_TEXTENCODING_ASCII_US ).GetBuffer() ); + aErrorInformation.eCode = XML_ERROR_NONE; + aErrorInformation.nLine = 0; + aErrorInformation.nColumn = 0; + aErrorInformation.sMessage = String::CreateFromAscii( "ERROR: Unable to open file " ); + aErrorInformation.sMessage += rFileName; + + SvFileStream aStream( rFileName, STREAM_STD_READ ); + + if ( !aStream.IsOpen()) + return NULL; + + SvMemoryStream aMemStream; + aStream >> aMemStream; + aMemStream.Seek( 0 ); + + aStream.Close(); + + pXMLFile = pXMLFileIn; + pXMLFile->SetName( rFileName ); + pXMLFile->SetFullName( rFullFileName ); + + return Execute( &aMemStream ); +} + +/*****************************************************************************/ +XMLFile *SimpleXMLParser::Execute( SvMemoryStream *pStream ) +/*****************************************************************************/ +{ + if ( !pXMLFile ) + pXMLFile = new XMLFile( String()); + + pCurNode = pXMLFile; + pCurData = NULL; + + ULONG nPos = pStream->Tell(); + pStream->Seek( STREAM_SEEK_TO_END ); + + aErrorInformation.eCode = XML_ERROR_NONE; + aErrorInformation.nLine = 0; + aErrorInformation.nColumn = 0; + if ( pXMLFile->GetName().Len()) { + aErrorInformation.sMessage = String::CreateFromAscii( "File " ); + aErrorInformation.sMessage += pXMLFile->GetName(); + aErrorInformation.sMessage += String::CreateFromAscii( " parsed succesfully" ); + } + else + aErrorInformation.sMessage = String::CreateFromAscii( "XML-File parsed successfully" ); + + if ( !XML_Parse( + aParser, ( char * ) pStream->GetData() + nPos, pStream->Tell() - nPos, TRUE )) + { + aErrorInformation.eCode = XML_GetErrorCode( aParser ); + aErrorInformation.nLine = XML_GetErrorLineNumber( aParser ); + aErrorInformation.nColumn = XML_GetErrorColumnNumber( aParser ); + + aErrorInformation.sMessage = String::CreateFromAscii( "ERROR: " ); + if ( pXMLFile->GetName().Len()) + aErrorInformation.sMessage += pXMLFile->GetName(); + else + aErrorInformation.sMessage += String::CreateFromAscii( "XML-File" ); + aErrorInformation.sMessage += String::CreateFromAscii( " (" ); + aErrorInformation.sMessage += String::CreateFromInt64( aErrorInformation.nLine ); + aErrorInformation.sMessage += String::CreateFromAscii( "," ); + aErrorInformation.sMessage += String::CreateFromInt64( aErrorInformation.nColumn ); + aErrorInformation.sMessage += String::CreateFromAscii( "): " ); + + switch( aErrorInformation.eCode ) { + case XML_ERROR_NO_MEMORY: aErrorInformation.sMessage += String::CreateFromAscii( "No memory" ); break; + case XML_ERROR_SYNTAX: aErrorInformation.sMessage += String::CreateFromAscii( "Syntax" ); break; + case XML_ERROR_NO_ELEMENTS: aErrorInformation.sMessage += String::CreateFromAscii( "No elements" ); break; + case XML_ERROR_INVALID_TOKEN: aErrorInformation.sMessage += String::CreateFromAscii( "Invalid token" ); break; + case XML_ERROR_UNCLOSED_TOKEN: aErrorInformation.sMessage += String::CreateFromAscii( "Unclosed token" ); break; + case XML_ERROR_PARTIAL_CHAR: aErrorInformation.sMessage += String::CreateFromAscii( "Partial char" ); break; + case XML_ERROR_TAG_MISMATCH: aErrorInformation.sMessage += String::CreateFromAscii( "Tag mismatch" ); break; + case XML_ERROR_DUPLICATE_ATTRIBUTE: aErrorInformation.sMessage += String::CreateFromAscii( "Dublicat attribute" ); break; + case XML_ERROR_JUNK_AFTER_DOC_ELEMENT: aErrorInformation.sMessage += String::CreateFromAscii( "Junk after doc element" ); break; + case XML_ERROR_PARAM_ENTITY_REF: aErrorInformation.sMessage += String::CreateFromAscii( "Param entity ref" ); break; + case XML_ERROR_UNDEFINED_ENTITY: aErrorInformation.sMessage += String::CreateFromAscii( "Undefined entity" ); break; + case XML_ERROR_RECURSIVE_ENTITY_REF: aErrorInformation.sMessage += String::CreateFromAscii( "Recursive entity ref" ); break; + case XML_ERROR_ASYNC_ENTITY: aErrorInformation.sMessage += String::CreateFromAscii( "Async_entity" ); break; + case XML_ERROR_BAD_CHAR_REF: aErrorInformation.sMessage += String::CreateFromAscii( "Bad char ref" ); break; + case XML_ERROR_BINARY_ENTITY_REF: aErrorInformation.sMessage += String::CreateFromAscii( "Binary entity" ); break; + case XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF: aErrorInformation.sMessage += String::CreateFromAscii( "Attribute external entity ref" ); break; + case XML_ERROR_MISPLACED_XML_PI: aErrorInformation.sMessage += String::CreateFromAscii( "Misplaced xml pi" ); break; + case XML_ERROR_UNKNOWN_ENCODING: aErrorInformation.sMessage += String::CreateFromAscii( "Unknown encoding" ); break; + case XML_ERROR_INCORRECT_ENCODING: aErrorInformation.sMessage += String::CreateFromAscii( "Incorrect encoding" ); break; + case XML_ERROR_UNCLOSED_CDATA_SECTION: aErrorInformation.sMessage += String::CreateFromAscii( "Unclosed cdata section" ); break; + case XML_ERROR_EXTERNAL_ENTITY_HANDLING: aErrorInformation.sMessage += String::CreateFromAscii( "External entity handling" ); break; + case XML_ERROR_NOT_STANDALONE: aErrorInformation.sMessage += String::CreateFromAscii( "Not standalone" ); break; + case XML_ERROR_NONE: break; + default: + break; + + } + delete pXMLFile; + pXMLFile = NULL; + } + pStream->Seek( nPos ); + + return pXMLFile; +} + +/*****************************************************************************/ +void XMLUtil::QuotHTML( String &rString ) +/*****************************************************************************/ +{ + OUStringBuffer sReturn; + static const String LT(String::CreateFromAscii("<")); + static const String QLT(String::CreateFromAscii("<")); + static const String GT(String::CreateFromAscii(">")); + static const String QGT(String::CreateFromAscii(">")); + static const String QUOT(String::CreateFromAscii("\\")); + static const String QQUOT(String::CreateFromAscii(""")); + static const String APOS(String::CreateFromAscii("\"")); + static const String QAPOS(String::CreateFromAscii("'")); + static const String AMP(String::CreateFromAscii("&")); + static const String QAMP(String::CreateFromAscii("&")); + static const String SLASH(String::CreateFromAscii("\\")); + + for ( USHORT i = 0; i < rString.Len(); i++) { + if ( i < rString.Len()) { + switch ( rString.GetChar( i )) { + case '\\': if( i+1 <= rString.Len() ){ + switch( rString.GetChar( i+1 ) ){ + case '<': sReturn.append( LT );i++;break; + case '>': sReturn.append( GT );i++;break; + case '\\': sReturn.append( QUOT );i++;break; + case '\"': sReturn.append( APOS );i++;break; + //case '\'': sReturn += "\'";i++;break; + //case '&' : sRetrun += "&";i++;break; + default: sReturn.append( SLASH );break; + + } + } + break; + + case '<': + sReturn.append( QLT ); + break; + + case '>': + sReturn.append( QGT ); + break; + + case '\"': + sReturn.append( QQUOT ); + break; + +/* case '\'': + sReturn += "'"; + break; +*/ + case '&': + if ( + ( ( i + 4 ) < rString.Len()) && + ( String( rString.Copy( i, 5 ) ).Equals( QAMP ) ) + ) + sReturn.append( rString.GetChar( i ) ); + else + sReturn.append( QAMP ); + break; + + default: + sReturn.append( rString.GetChar( i ) ); + break; + } + } + } + rString = String( sReturn.makeStringAndClear() ); +} + +void XMLUtil::UnQuotHTML( String &rString ){ + UnQuotData( rString ); +} + +void XMLUtil::UnQuotData( String &rString_in ){ + ByteString sReturn; + ByteString sString( rString_in , RTL_TEXTENCODING_UTF8 ); + while ( sString.Len()) { + if ( sString.Copy( 0, 1 ) == "\\" ) { + sReturn += "\\\\"; + sString.Erase( 0, 1 ); + } + else if ( sString.Copy( 0, 5 ) == "&" ) { + sReturn += "&"; + sString.Erase( 0, 5 ); + } + else if ( sString.Copy( 0, 4 ) == "<" ) { + sReturn += "<"; + sString.Erase( 0, 4 ); + } + else if ( sString.Copy( 0, 4 ) == ">" ) { + sReturn += ">"; + sString.Erase( 0, 4 ); + } + else if ( sString.Copy( 0, 6 ) == """ ) { + sReturn += "\""; + sString.Erase( 0, 6 ); + } + else if ( sString.Copy( 0, 6 ) == "'" ) { + sReturn += "\'"; + sString.Erase( 0, 6 ); + } + else { + sReturn += sString.GetChar( 0 ); + sString.Erase( 0, 1 ); + } + } + rString_in = String(sReturn , RTL_TEXTENCODING_UTF8 ); + + +} + +XMLUtil::XMLUtil(){ +} + + +/*****************************************************************************/ +void XMLUtil::dump(){ +/*****************************************************************************/ + int cnt=1; + printf("size=%lu\n",static_cast(lMap.size())); + for(HashMap::iterator pos = lMap.begin(); pos != lMap.end() ; ++pos){ + fprintf(stdout,"key=%s , value=%d , no=%d\n",pos->first.GetBuffer(),pos->second,cnt++); + } +} +/*****************************************************************************/ +XMLUtil& XMLUtil::Instance(){ +/*****************************************************************************/ + static XMLUtil instance; + return instance; +} +/*****************************************************************************/ +XMLUtil::~XMLUtil(){} +/*****************************************************************************/ +/*****************************************************************************/ +ByteString XMLUtil::GetIsoLangByIndex( USHORT nIndex ) +/*****************************************************************************/ +{ + if(nIndex > 0 && MAX_LANGUAGES >= nIndex ) + return isoArray[nIndex]; + return ""; +} + diff --git a/l10ntools/source/xrm_yy_wrapper.c b/l10ntools/source/xrm_yy_wrapper.c new file mode 100644 index 000000000000..6a304d0d09dc --- /dev/null +++ b/l10ntools/source/xrm_yy_wrapper.c @@ -0,0 +1,2 @@ +// Helper to suppress warnings in lex generated c code, see #i57362# +#include "xrm_yy.c" diff --git a/l10ntools/source/xrmlex.l b/l10ntools/source/xrmlex.l new file mode 100644 index 000000000000..efc8bf1f7d91 --- /dev/null +++ b/l10ntools/source/xrmlex.l @@ -0,0 +1,228 @@ +%{ +/* + * lexer for parsing xml-property source files (*.xml) + * + */ + + +/* enlarge token buffer to tokenize whole strings */ +#undef YYLMAX +#define YYLMAX 64000 + +/* to enable debug output define LEXDEBUG */ +#define LEXDEBUG 1 +#ifdef LEXDEBUG +#define OUTPUT fprintf +#else +#define OUTPUT(Par1,Par2); +#endif + +/* table of possible token ids */ +#include "tokens.h" +#include +#include + +#if defined __GNUC__ +#pragma GCC system_header +#elif defined __SINPRO_CC +#pragma disable_warn +#elif defined _MSC_VER +#pragma warning(push, 1) +#endif + +/* external functions (C++ code, declared as extren "C" */ +extern int WorkOnTokenSet( int, char* ); +extern int Argument( char * ); +extern int InitXrmExport( char * , char * ); +extern int EndXrmExport(); +extern int GetError(); +extern int SetError(); +extern char *GetOutputFile( int argc, char* argv[]); +extern FILE *GetXrmFile(); +extern int isQuiet(); +extern void removeTempFile(); +extern char* getFilename(); + +/* forwards */ +void YYWarning(); + +int bText=0; +%} + +%p 24000 +%e 1200 +%n 500 + +%% + +"]*\> { + WorkOnTokenSet( XRM_README_START, yytext ); +} + +"" { + WorkOnTokenSet( XRM_README_END, yytext ); +} + +"]*\> { + WorkOnTokenSet( XRM_README_START, yytext ); +} + +"" { + WorkOnTokenSet( XRM_README_END, yytext ); +} + +"]*\> { + WorkOnTokenSet( XRM_SECTION_START, yytext ); +} + +"" { + WorkOnTokenSet( XRM_SECTION_END, yytext ); +} + +"]*\> { + WorkOnTokenSet( XRM_PARAGRAPH_START, yytext ); +} + +"" { + WorkOnTokenSet( XRM_PARAGRAPH_END, yytext ); +} + +"]*\> { + WorkOnTokenSet( XRM_TEXT_START, yytext ); +} + +"" { + WorkOnTokenSet( XRM_TEXT_END, yytext ); +} + +"]*\> { + WorkOnTokenSet( XRM_LIST_START, yytext ); +} + +"" { + WorkOnTokenSet( XRM_LIST_END, yytext ); +} + +" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <i>Copyright &#169; 2004 Sun Microsystems, Inc., 901 San Antonio Road, Palo Alto, CA 94303 USA</i> -
${docname}
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- diff --git a/transex3/java/l10nconv/converter.MF b/transex3/java/l10nconv/converter.MF deleted file mode 100755 index 843d500b7548..000000000000 --- a/transex3/java/l10nconv/converter.MF +++ /dev/null @@ -1 +0,0 @@ -Main-Class: com.sun.star.tooling.converter.Convert diff --git a/transex3/java/l10nconv/documentation/readmeConverter.sxw b/transex3/java/l10nconv/documentation/readmeConverter.sxw deleted file mode 100755 index f779e10acb2c..000000000000 Binary files a/transex3/java/l10nconv/documentation/readmeConverter.sxw and /dev/null differ diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/DirtyTags/DirtyTagWrapCheck.java b/transex3/java/l10nconv/java/com/sun/star/tooling/DirtyTags/DirtyTagWrapCheck.java deleted file mode 100755 index d304c2544bff..000000000000 --- a/transex3/java/l10nconv/java/com/sun/star/tooling/DirtyTags/DirtyTagWrapCheck.java +++ /dev/null @@ -1,85 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: DirtyTagWrapCheck.java,v $ - * $Revision: 1.3 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -/* - * Created on 2005 - * by Christian Schmidt - */ -package com.sun.star.tooling.DirtyTags; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileReader; -import java.io.IOException; - - - -public class DirtyTagWrapCheck { - static String line=""; - public static void main(String[] args) { - try { - File fi = new File("D:\\Testfiles\\KID_helpcontent.sdf");//Copy of - FileReader fr = new FileReader(fi); - BufferedReader br = new BufferedReader(fr); - - int readCounter=0; - int missCounter=0; - int lineErrorCounter=0; - while((line=br.readLine())!=null){ - readCounter++; - String [] split = line.split("\t"); - if(split.length<15){ - - lineErrorCounter++; - continue; - } - String string = split[10]; - String wrapped = DirtyTagWrapper.wrapString(string); - String unwrapped=DirtyTagWrapper.unwrapString(wrapped); - if(!string.equals(unwrapped)){ - - missCounter++; - System.out.println(""+readCounter+"\n"+string+"\n"+unwrapped+"\n"+wrapped+"\n"); - } - } - System.out.println("Fertig "+readCounter+" "+missCounter+" "+lineErrorCounter); - } catch (FileNotFoundException e) { - // - e.printStackTrace(); - } catch (IOException e) { - // - e.printStackTrace(); - } catch (DirtyTagWrapper.TagWrapperException e) { - System.out.println(e.getMessage()+"\n"+line+"\n"); - - } - - } -} diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/DirtyTags/DirtyTagWrapper.java b/transex3/java/l10nconv/java/com/sun/star/tooling/DirtyTags/DirtyTagWrapper.java deleted file mode 100755 index 49fc08b69d32..000000000000 --- a/transex3/java/l10nconv/java/com/sun/star/tooling/DirtyTags/DirtyTagWrapper.java +++ /dev/null @@ -1,252 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: DirtyTagWrapper.java,v $ - * $Revision: 1.3 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -/* - * Created on 2005 - * by Christian Schmidt - */ -package com.sun.star.tooling.DirtyTags; - -import java.io.IOException; -import java.util.ArrayList; - -/** - * Solves the problem with translating strings from the - * Star-Office Help. This Strings contain XML snippets - * (that means parts of an xml dokument). I call them 'dirty' - * because the start of a tag (<) and the and of an tag (>) - * are quoted by a single backslash(\<.....\>). This is done - * because the text out of th tags should not contain '<' and '>' - * as Entity references (< or >) but as readable signs. - * This is for translation purposes. - * Because translators get mad while find out the really translatable - * parts between all the markup information, the XLIFF Specification - * allows to wrap parts of a String that should not be translated by - * special tags (, ). - * This Class has two static methods that do the wrapping and unwrapping - * NOTE: this won't work with not 'dirty' Strings. - * - * @author Christian Schmidt 2005 - * - */ -public class DirtyTagWrapper { - - private static boolean doWrap=true; - public static void setWrapping(boolean doWrap){ - DirtyTagWrapper.doWrap=doWrap; - } - - /** - * Unwraps the 'dirty' parts of a String from ept and bpt tags - * - * @param checkString The String to unwrap - * @return the unwrapped String - */ - public static String unwrapString(String checkString){ - //remove the ept and bpt tags - String[] splitted =checkString.split("(])*>)|()|(])*>)|()|(])*>)|()|(])*/>)"); - StringBuffer workBuffer= new StringBuffer(); - for(int i=0;i").replaceAll( ""","\"").replaceAll( "'","'"); - - //remove the nsub tags - splitted =string.split("(])*>)|()"); - StringBuffer returnBuffer= new StringBuffer(); - for(int i=0;i"); - - ArrayList tagString =new ArrayList(); - // put the while splitting lost parts to the end of the single strings - for(int j=0;j")){ - parts2[parts2.length-1]+="\\>"; - } - // split the leading text from the real tag string (<...>) - for(int j=0;j0&&parts2[j].indexOf("\\>")>0){ - //...then split it in two parts - // the leading text - tagString.add(parts2[j].substring(0,(parts2[j].indexOf("\\<")))); - // ...and the tag - tagString.add(parts2[j].substring(parts2[j].indexOf("\\<"))); - - }else{ - //no tag...must be text only - tagString.add(parts2[j]); - } - - } - ArrayList tagNames=new ArrayList(); - String item=""; - for(int i=0;i"); - if(start>=0&&end>0){ - boolean isStandalone=false; - if(item.endsWith("/\\>")){ - // this is a standalone tag - isStandalone=true; - } - item=item.substring(start,end); - - if(item.indexOf(" ")>0){ - item=item.substring(0,item.indexOf(" ")); - } - if(isStandalone){ - item=item+"/"; - } - tagNames.add(item); - }else{ - tagNames.add(""); - } - } - ArrayList tagType=new ArrayList(); - for(int i=0;i0){ - try{ - start=new TagPair(tagList); - returnBuffer.append(start.getWrapped()); - }catch(TagPair.TagPairConstructionException e){ - throw (new DirtyTagWrapper()).new TagWrapperException(e); - } - } - TagPair.resetCounter(); - return new String(returnBuffer); - } - /** - * @author Christian Schmidt 2005 - * - */ - public class TagWrapperException extends Exception { - - /** - * Create a new Instance of TagWrapperException - * - * - */ - public TagWrapperException() { - super(); - // - } - - /** - * Create a new Instance of TagWrapperException - * - * @param arg0 - */ - public TagWrapperException(String arg0) { - super(arg0); - // - } - - /** - * Create a new Instance of TagWrapperException - * - * @param arg0 - * @param arg1 - */ - public TagWrapperException(String arg0, Throwable arg1) { - super(arg0, arg1); - // - } - - /** - * Create a new Instance of TagWrapperException - * - * @param arg0 - */ - public TagWrapperException(Throwable arg0) { - super(arg0); - // - } - - } -} diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/DirtyTags/Tag.java b/transex3/java/l10nconv/java/com/sun/star/tooling/DirtyTags/Tag.java deleted file mode 100755 index 7495736ab68c..000000000000 --- a/transex3/java/l10nconv/java/com/sun/star/tooling/DirtyTags/Tag.java +++ /dev/null @@ -1,249 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: Tag.java,v $ - * $Revision: 1.3 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -/* - * Created on 2005 - * by Christian Schmidt - */ -package com.sun.star.tooling.DirtyTags; - -import java.io.IOException; -import java.util.Map; - -import com.sun.star.tooling.converter.ExtMap; - -/** - * @author Christian Schmidt 2005 - * - */ -public class Tag { - private static int indent=0; - Map tagNames; - private String tagType; - private String tagName; - private String tagString; - public static Tag EMPTYTAG=new Tag("","",""); - - /** - * Create a new Instance of Tag - * - * @param tagType - * @param tagName - * @param tagString - */ - public Tag(String tagType, String tagName, String tagString) { - - this.tagType=tagType; - this.tagName=tagName; - this.tagString=tagString; - - tagNames=new ExtMap(); - tagNames.put("link","name"); - tagNames.put("caption","xml-lang"); - tagNames.put("alt","xml-lang"); - } - - public String getWrappedTagString() throws IOException{ - if(this.canHaveTranslateableContent()){ - return this.wrapTagStringIntern(); - }else{ - return xmlString(this.tagString); - } - } - - private final String xmlString( final String string) throws java.io.IOException { - if (string == null) - return string; // "" - String str = string; - - for(int i=0;i'){ - str=str.substring(0, i)+">"+str.substring(i+1); - continue; - } - - if(str.charAt(i)=='"'){ - str=str.substring(0, i)+"""+str.substring(i+1); - continue; - } - - if(str.charAt(i)=='\''){ - str=str.substring(0, i)+"'"+str.substring(i+1); - continue; - } - } - - return str; - } - /** - * @return - */ - private boolean canHaveTranslateableContent() { - return (tagNames.containsKey(this.tagName)); - - } - - /** - * @throws IOException - * - */ - private String wrapTagStringIntern() throws IOException { - - - String[] split=this.tagString.split("="); - int length=split.length; - // no attribute found; - if (length==0) return xmlString(tagString); - else{ - int i=0; - - while(i")<0) split[i]=xmlString(split[i]); - i++; - String value; - attributeName=(attributeName.substring(attributeName.lastIndexOf(" ")).trim()); - if((value=translateableAttributeValue(this.tagName)).equals(attributeName)){ - int valueStart=0; - int valueEnd=0; - - // get the value to the found attribute name - // it must either be surrounded by '"'... - if((valueStart=split[i].indexOf('"'))>=0){ - valueEnd = split[i].lastIndexOf('"'); - //...or surrounded by "'" - }else if((valueStart=split[i].indexOf("'"))>=0){ - valueEnd = split[i].lastIndexOf("'"); - }else{ - // there seems to be an error, - // we found an '=' (we split there) but no '"' or ''' - // but although we don't check the syntax - // we just continue - continue; - } - //ok we found the border of a value that might be translated - //now we wrap it with the tags - - split[i]=xmlString(split[i].substring(0,valueStart+1))+""+xmlString(split[i].substring(valueStart+1,valueEnd))+""+xmlString(split[i].substring(valueEnd)); - - } - } - String wrappedString=""; - // we have the wrapped parts, now we put them together - int j=0; - for(j=0;j=0&&end>0){ - tagString=tagString.substring(start,end); - - if(tagString.indexOf(" ")>0){ - tagString=tagString.substring(0,tagString.indexOf(" ")); - } - return tagString; - }else{ - return ""; - } - } - private static String extractTagType(String tagName){ - if(tagName.equals("")){ - return "Text"; - }else if(tagName.startsWith("/")){ - return "EndTag"; - }else if(tagName.endsWith("/")){ - return "StartAndEndTag"; - }else { - return "StartTag"; - } - } - - /** - * @return Returns the tagName. - */ - public String getTagName() { - return this.tagName; - } - /** - * @return Returns the tagString. - */ - public String getTagString() { - return this.tagString; - } - /** - * @return Returns the tagType. - */ - public String getTagType() { - return this.tagType; - } - - -} diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/DirtyTags/TagPair.java b/transex3/java/l10nconv/java/com/sun/star/tooling/DirtyTags/TagPair.java deleted file mode 100755 index 7993fc9cf0a4..000000000000 --- a/transex3/java/l10nconv/java/com/sun/star/tooling/DirtyTags/TagPair.java +++ /dev/null @@ -1,310 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: TagPair.java,v $ - * $Revision: 1.3 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -/* - * Created on 2005 - * by Christian Schmidt - */ -package com.sun.star.tooling.DirtyTags; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; - - -/** - * @author Christian Schmidt 2005 - * - */ -public class TagPair { - - - private Tag startTag=Tag.EMPTYTAG; - private Tag endTag=Tag.EMPTYTAG; - private String startingText=""; - private ArrayList enclosedTags=new ArrayList(); - private long id; - private static int ElementCounter=1; - private String endingText=""; - - /** - * @author Christian Schmidt 2005 - * - */ - public class TagPairConstructionException extends Exception { - - /** - * Create a new Instance of TagPairConstructionException - * - * @param string - */ - public TagPairConstructionException(String string) { - - } - - } - - /** - * Create a new Instance of TagPair - * - * - */ - public TagPair() { - - } - - - /** - * Create a new Instance of TagPair - * - * Find matching tags in tagList, create a TagPair of it, create - * tagPairs from the content in the tagPair and remove all used - * tags from tagList. The rest of the tagList starts after the - * endTag of this TagPair. - * - * @param tagList a List of the tags to check - * - * @throws TagPairConstructionException - */ - public TagPair(ArrayList tagList) throws TagPairConstructionException { - - if(tagList.size()==0){ - return; - } - ArrayList contentList=new ArrayList();; - Tag tag=(Tag)tagList.get(0); - tagList.remove(0); - - - if("Text".equals(tag.getTagType())){ - // is this Text the only content - // of this Tag ? - if(tagList.size()==0){ - //yes...then it is the starting Text of this TagPair - this.startingText=tag.getTagString(); - return; - }else{ - //no...the tag is normal content - contentList.add(tag); - } - this.startingText=tag.getTagString(); - - }else if("EndTag".equals(tag.getTagType())){ - //ERRor throw EXception - }else if("StartTag".equals(tag.getTagType())){ - // find the matching end tag - this.startTag=tag; - Iterator iter=tagList.iterator(); - - int equivalentTagCounter=0; - while(iter.hasNext()){ - //is this the end tag? - if((tag=(Tag)iter.next()).getTagName().equals('/'+this.startTag.getTagName())&&equivalentTagCounter==0){ - //found the corresponding end tag - - //this TagPair is complete - //so it needs an id - this.id=TagPair.ElementCounter++; - this.endTag=tag; - //...remove it from list - tagList.removeAll(contentList); - tagList.remove(tag); - break; - }else{ - // tag is not the end tag - // so it is between the start and the end tag - // and belongs to the content - // but first check if it has the same name as the current tag - if(tag.getTagName().equals(this.startTag.getTagName())){ - // if this is a start tag like the current start tag - // we count it to find out the matching end tag in nested tags - if(tag.getTagType().equals("StartTag")){ - equivalentTagCounter++; - } - } - if(tag.getTagName().equals("/"+this.startTag.getTagName())){ - if(tag.getTagType().equals("EndTag")){ - equivalentTagCounter--; - } - } - - contentList.add(tag); - } - } - //found the end tag ? - //no... - if (this.endTag.getTagType()==""){ - - throw new TagPairConstructionException("ERROR: Missing end tag ("+ - this.startTag.getTagString()+")."); - //...yes - }else{ - //We need to check whether the content is starting or ending with text - //...check starting with text - if(contentList.size()>=1&&((String)((Tag)contentList.get(0)).getTagType()).equals("Text")){ - //yes...store it as startingText - this.startingText=(String)((Tag)contentList.get(0)).getTagString(); - //remove it from list - contentList.remove(0); - } - // ...check ending with text - if(contentList.size()>=1&&((String)((Tag)contentList.get(contentList.size()-1)).getTagType()).equals("Text")){ - //yes...store it as endingText - this.endingText=(String)((Tag)contentList.get(contentList.size()-1)).getTagString(); - //remove it from list - contentList.remove(contentList.size()-1); - } - //create the list of tags enclosed by this tagPair - createEnclosedTags(contentList); - } - //if stand AloneTag create own TagObject...give ID...add to List - }else if("StartAndEndTag".equals(tag.getTagType())){ - this.startTag=tag; - this.endTag=new Tag("EndOfStandAlone","",""); - createEnclosedTags(contentList); - } - - } - - /** - * @param contentList - * @throws TagPairConstructionException - */ - private void createEnclosedTags(ArrayList contentList) throws TagPairConstructionException { - while(contentList.size()>0){ - //create the inner TagPairs - this.enclosedTags.add(new TagPair(contentList)); - } - - } - - public String toString(){ - StringBuffer outString= new StringBuffer(this.startTag.toString()); - TagPair help=new TagPair(); - Iterator iter=enclosedTags.iterator(); - outString.append(this.startingText); - while(iter.hasNext()){ - if((help=(TagPair)iter.next())==null){ - continue; - }else{ - outString.append(help.toString()); - } - } - outString.append(this.endingText); - outString.append(this.endTag.toString()); - return new String(outString); - } - - public String getWrapped() throws IOException{ - Iterator iter=enclosedTags.iterator(); - StringBuffer returnBuffer=new StringBuffer(); - - returnBuffer.append(wrap(this.startTag)+xmlString(this.startingText)); - while(iter.hasNext()){ - returnBuffer.append(((TagPair)iter.next()).getWrapped()); - } - returnBuffer.append(xmlString(this.endingText)+wrap(this.endTag)); - - - - return new String(returnBuffer); - } - - private String wrap(Tag tag) throws IOException{ - String string=""; - //can be a start tag - if(tag.getTagType().startsWith("Start")){ - return new String(""+tag.getWrappedTagString()+""); - //...or a end tag - }else if (tag.getTagType().startsWith("End")){ - //maybe the end tag of a Start and end tag -// if("EndOfStandAlone".equals(tag.getTagType())){ -// return new String(""); -// }else{ - string=tag.getWrappedTagString(); - return new String(""+string+""); -// } - - //...or text - }else{ - return xmlString(tag.getTagString()); - } - } - /** - * Replaces all characters that mustn't be in XLIFF PCdata - * - * @param string the string to check - * @return the checked string with all characters replaced - * @throws java.io.IOException - */ - private final String xmlString( final String string) throws java.io.IOException { - if (string == null) - return string; // "" - String str = string; - - for(int i=0;i'){ - str=str.substring(0, i)+">"+str.substring(i+1); - continue; - } - - if(str.charAt(i)=='"'){ - str=str.substring(0, i)+"""+str.substring(i+1); - continue; - } - - if(str.charAt(i)=='\''){ - str=str.substring(0, i)+"'"+str.substring(i+1); - continue; - } - } - - return str; - } - - /** - * - */ - public static void resetCounter() { - TagPair.ElementCounter=1; - - } - - -} diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/Convert.java b/transex3/java/l10nconv/java/com/sun/star/tooling/converter/Convert.java deleted file mode 100755 index 5b1fb6c62b61..000000000000 --- a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/Convert.java +++ /dev/null @@ -1,553 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: Convert.java,v $ - * $Revision: 1.4 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -/* - * the main Class - * - * Command Line arguments are reviewed - * and a Converter is constructed - */ -package com.sun.star.tooling.converter; - -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.util.Calendar; - -import com.sun.star.tooling.DirtyTags.DirtyTagWrapper; - -/** - * The main class of the converter tool - * - * The converter tool is command line based. - * Its classes allow the converting between the - * file formats sdf, gsi and xliff. - * - * Those file formats are used in localization - * of Star-Office and Open-Office. - * - * Information about the whole localization process can be found in - * http://ded-1.germany.sun.com/webcontent/guidelines/pdf/L10NSO8.pdf - * - * @author Christian Schmidt 2005 - * - */ -public class Convert { - - private static Calendar cal; - - private static final String EMPTY = ""; - - /** - * The name of the file containing the debug information - * that where found while converting (every output goes here too) - */ - private static String dbgName = EMPTY; - - /** - * the character that separates the extension from the file name - */ - private static final char extensionSeperator = '.'; - - /** - * the log File - */ - private static File log; - - /** - * the name of the log file - */ - private static String logString = EMPTY; - - /** - * indicates whether existing sources should be overwritten - * without asking - */ - private static boolean overwrite = false; - - /** - * A second Source File needed for GSI Merging - */ - private static File secondSource; - - //private static final char pathSeperator = '\\'; - - /** - * The language that should be the source language - * that means the language to translate from - */ - private static String sourceLanguage = "en-US"; - - /** - * the name of the source file - */ - private static String sourceName = EMPTY; - - /** - * the type of the source file (sdf,xliff,...) - */ - private static String sourceType = EMPTY; - - /** - * The time when converting started - */ - private static String startTime = EMPTY; - /** - * The language that should be the target language - * that means the language to translate to - */ - private static String TargetLanguage = EMPTY; - - /** - * the name of the target file - */ - private static String targetName = EMPTY; - - /** - * the type of the target file (sdf,xliff,...) - */ - private static String targetType = EMPTY; - - /** - * Store the current version ID and number of this tool - */ - final static String version = " Prod.20050710:1255 "; - - /** - * The name of the (original) sdf file used as second source for gsi->sdf merging - */ - private static String secondSourceName=EMPTY; - /** - * Indicate whether strings in xliff files should - * be wrapped with ept/bpt or sub tags to enable translation tools - * to synchronize source language string with there translation - * - * @see http://ded-1.germany.sun.com/webcontent/guidelines/pdf/L10NSO8.pdf - */ - private static boolean doWrap=true; - - - - public static void main(String[] args) throws IOException, Exception { - try{ - - //go, parse and check the command line parameters - ParameterChecker.checkClParameters(args); - ParameterChecker.createContentOfClParameters(); - //Initialize the tagWrapper - DirtyTagWrapper.setWrapping(doWrap); - //create an instance of converter - Converter conv = new Converter(sourceType, sourceName, sourceLanguage, - targetType, targetName, TargetLanguage,secondSourceName, overwrite); - // get aktual time - cal = Calendar.getInstance(); - startTime = cal.getTime().toString(); - //show infos - printPreamble(); - //do the job - conv.convert(); - - showStatistic(); - - //close log, debug... - OutputHandler.closeAll(); - - } catch(Exception e){ - System.out.print("An EXCEPTION occured, please check your commad line settings \n"+e.getMessage()); - System.exit(-1); - }catch(Throwable t){ - System.out.print("A FATAL ERROR occured, please check your commad line settings \n"+t.getMessage()); - System.exit(-1); - } - - } - - /** - * show the command line help - */ - private static void printHelp() { - - final String ls = System.getProperty("line.separator"); - System.out - .println( - - "File Converting Tool 'converter' Version " - + Convert.version - + ls - + "Converts SDF files to wellformed XLIFF or GSI files and vice versa" + ls - + ls - + "Use: " + ls - + "convert [-h]|[SourcePath [TargetPath] [-T Type] [[-S Type [secondSourcePath]] " + ls - + " [-s LanguageID] [-t LanguageID] [-l [LogPath]] [-o]]" + ls - + ls - + "-h show this help." + ls - + "SourcePath path of the file to convert." + ls - + "secondSourcePath path of the SDF file to merge to (GSI -> SDF only!)." + ls - + "TargetPath path where to store the result." + ls - + "LogPath path of the log file" + ls - + "-T Type the type of the target file (xliff,sdf,gsi)" + ls - + "-S Type the type of the source file (xliff,sdf,gsi)" + ls - + "-s LanguageID the ISO language code of the source language (de, fr...)." + ls - + " Default is 'en-US' " + ls - + "-t LanguageID the language code of the target language (de, fr...)." + ls - + " Default is first found Language other than source language." + ls - + "-l [LogPath] write a log file, you can name the file." + ls - + "-o overwrite existing files without asking." + ls - + "-nw disable the wrapping with ept/bpt tags." + ls - + ls - + "The created files were stored in the SourceFile Path if nothing else is given. " + ls - + "The extension is '.xliff','.sdf' depending on the source file and '.log' " + ls - + "for the logfile." + ls); - } - - /** - * show the parameters the converter starts with - * - * @throws IOException - */ - final private static void printPreamble() throws IOException { - OutputHandler.out(EMPTY); - OutputHandler.out("Source File is: " + sourceName); - OutputHandler.out("Target File is: " + targetName); - if (OutputHandler.doLog) { - OutputHandler.out("Log File is: " + logString); - } else { - OutputHandler.out("Log File is: disabled"); - } - - OutputHandler.out(EMPTY); - - } - - /** - * show some statistic data - * - * @throws IOException - */ - final private static void showStatistic() throws IOException { - OutputHandler.dbg(EMPTY); - OutputHandler - .out((targetType.equalsIgnoreCase("xliff") ? "TransUnits written: " - : "Lines written : ") - + Converter.getLineCounter()); - OutputHandler.dbg(EMPTY); - OutputHandler.out("Started at : " + Convert.startTime); - Convert.cal = Calendar.getInstance(); - OutputHandler.out("Finished at : " + Convert.cal.getTime()); - OutputHandler.dbg(EMPTY); - - } - - /** - * Get the extensiion of a file name - * (sdf,xliff,gsi) - * - * @param sourceString the file name - * @return the extension - */ - static protected String extractExtension(String sourceString) { - String ext = sourceString.substring(sourceString - .lastIndexOf(Convert.extensionSeperator) + 1); - return ext; - } - -// static protected String extractFileName(String sourceString) { -// String sName = EMPTY; -// sName = (sourceString.substring(sourceString -// .lastIndexOf(File.separator) + 1, sourceString -// .lastIndexOf(Convert.extensionSeperator))); -// -// return sName; -// } -// -// static protected String extractPath(String sourceString) { -// String sPath = sourceString.substring(0, sourceString -// .lastIndexOf(File.separator) + 1); -// return sPath; -// } - - /** - * - */ - public Convert() { - } - - /** - * - * Verify a parameter array and create content useable by the programm - * from the switches and attributes set at command line - * - * @author Christian Schmidt 2005 - */ - private static class ParameterChecker { - - /** - * Holds the path of the source file - */ - private static String filePath; - /** - * Holds the name of the source file - */ - private static String fileName; - - /** - * Create a new Instance of ParameterChecker - * - * - */ - public ParameterChecker(){}; - /** - * Checks the command line parameters - * - * @param args the parameters to check and to parse - * @throws IOException - */ - private static void checkClParameters(String[] args) throws IOException { - try { - //show help if no attrributes... - if (args.length == 0) { - printHelp(); - System.exit(-1); - } - //...or attribute is -h - if (args[0].equals("-h")) { - printHelp(); - System.exit(0); - } - if (args[0].equals("-ver")) { - System.out.println("File Converting Tool Version "+version); - System.exit(0); - } - //source file Location and path is always first attribute - sourceName = new String(args[0]); - - File source = new File(sourceName); - //break if there is no source to convert - if (!source.exists()) - throw new IOException("ERROR:Can not find Source File '" - + sourceName + "'. Aborting..."); - - // String name=source.getName(); - // String parent=source.getParent(); - // String path=source.getPath(); - - filePath = (source.getParent()==null)?"":source.getParent()+File.separator; //extractPath(sourceName); - fileName = source.getName().substring(0,source.getName().lastIndexOf(extensionSeperator)); - - for (int i = 1; i < args.length; i++) { - - - if ("-s".equals(args[i])) { - if (args.length > i + 1) { - sourceLanguage = args[++i]; - - } else { - throw new ConverterException( - "missing argument for -s source language"); - } - continue; - } - - if ("-S".equals(args[i])) { - if (args.length > i + 1) { - sourceType = args[++i]; - if (args.length > i +1 &&!args[i+1].startsWith("-")) { - secondSourceName = args[++i]; - } - - } else { - throw new ConverterException( - "missing argument for -S source type"); - } - continue; - } - - if ("-T".equals(args[i])) { - if (args.length > i + 1) { - targetType = args[++i]; - - - } else { - throw new ConverterException( - "missing argument for -T target type"); - } - continue; - } - - if ("-l".equals(args[i])) { - OutputHandler.doLog = true; - if (args.length > i + 1 - && (!args[i + 1].startsWith("-"))) { - logString = args[++i]; - } else { - logString = EMPTY; - } - continue; - } - - if ("-o".equals(args[i])) { - overwrite = true; - continue; - } - - if ("-nw".equals(args[i])) { - doWrap = false; - continue; - } - - if ("-h".equals(args[i])) { - printHelp(); - System.exit(0); - } - - if ("-dbg".equals(args[i])) { - OutputHandler.doDebug = true; - continue; - } - - if ("-t".equals(args[i])) { - if (args.length > i + 1) { - TargetLanguage = args[++i]; - } else { - throw new ConverterException( - "missing argument for -t target language"); - } - continue; - } - - if (i == 1 && !args[i].startsWith("-")) { //target file - // found - targetName = args[i]; - continue; - } - //if we come here we - //can not match the Attribute - throw new ConverterException("unknown Attribute: " - + args[i]); - - - }//end for - } catch (ConverterException e) { - OutputHandler.out("ERROR: "+e.getMessage()); - System.exit(-1); - } catch (Throwable t){ - System.out.print("An Error occured while parsing the command line,\n please check your commad line settings.\n "+t.getMessage()); - System.exit(-1); - } - - }//end checkClParameters - - /** - * Creates the appropriate content of what ever data - * we found in the command line - * - * @throws IOException - */ - private static void createContentOfClParameters() throws IOException { - - try { - if (OutputHandler.doDebug) { - // if the -dbg switch is set, we - // create - // a file that gets all information - // produced by this tool - - OutputHandler.dbgFile = new BufferedWriter(new FileWriter( - new File(new String(filePath + fileName + ".dbg")))); - } - - if (OutputHandler.doLog) {// create a logfile? - //given at command line? - if (EMPTY.equals(logString) || logString == null) { - logString = new String(filePath + fileName + ".log"); - } - log = FileMaker.newFile(logString, overwrite); - OutputHandler.logFile = (new BufferedWriter(new FileWriter( - log))); - } - - if (EMPTY.equals(sourceType) || sourceType == null) { - // not given at command line? - if (!(EMPTY.equals(sourceName) || sourceName == null)) { - sourceType = extractExtension(sourceName); - } else { - throw new ConverterException("Source type is missing"); - } - } - - if(sourceType.equalsIgnoreCase("gsi")){ - - if(EMPTY.equals(Convert.secondSourceName)){ - Convert.secondSourceName=filePath+fileName+".sdf"; - } - //secondSource=new File(Convert.secondSourceName); - - } - - if (EMPTY.equals(sourceName)) { - sourceName = filePath + fileName + "." + sourceType; - } - //no target type given at command line? - if (EMPTY.equals(targetType) || targetType == null) { - if (!(EMPTY.equals(targetName) || targetName == null)) { - targetType = extractExtension(targetName); - } else { - throw new ConverterException("Target type is missing"); - - } - } - //no target File specified at command line - if (EMPTY.equals(targetName) || targetName == null) { - targetName = filePath + fileName + "." + targetType; - if (targetName.equals(Convert.secondSourceName)){ - OutputHandler.out("ERROR: \nSource '"+Convert.secondSourceName+"' and \nTarget'"+targetName+"' are the same"); - System.exit(0); - }else if (targetName.equals(Convert.sourceName)){ - OutputHandler.out("ERROR: \nSource '"+Convert.sourceName+"' and \nTarget'"+targetName+"' are the same"); - System.exit(0); - } - }else if (targetName.equals(Convert.secondSourceName)){ - OutputHandler.out("ERROR: \nSource '"+Convert.secondSourceName+"' and \nTarget'"+targetName+"' are the same"); - System.exit(0); - }else if (targetName.equals(Convert.sourceName)){ - OutputHandler.out("ERROR: \nSource '"+Convert.sourceName+"' and \nTarget'"+targetName+"' are the same"); - System.exit(0); - } - - - } catch (ConverterException e) { - OutputHandler.out(e.getMessage()); - } - - } - - } - -} \ No newline at end of file diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/Converter.java b/transex3/java/l10nconv/java/com/sun/star/tooling/converter/Converter.java deleted file mode 100755 index 7ec09bcb411a..000000000000 --- a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/Converter.java +++ /dev/null @@ -1,523 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: Converter.java,v $ - * $Revision: 1.4 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -/* - * Converter.java - * - * create Source and Target - * for converting - * TODO maybe a factory would be good here - */ - -package com.sun.star.tooling.converter; - -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; - -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.parsers.SAXParser; -import javax.xml.parsers.SAXParserFactory; - -import org.xml.sax.EntityResolver; -import org.xml.sax.SAXException; -import org.xml.sax.SAXParseException; -import org.xml.sax.XMLReader; -import org.xml.sax.helpers.DefaultHandler; - -/** - * - * This class handles the creating of the source to read from, - * the target to write to and the appropriate DataHandler - * - * @author Christian Schmidt 2005 - */ -public final class Converter { - - /** - * the used charset f.e. UTF-8 - */ - private final static String CHARSET = new String("UTF-8"); - - private static final String EMPTY = new String(""); - - /** - * The DataHandler use to connect reader and writer - */ - private static DataHandler handler; - - /** - * Counting the lines written by a writer - */ - private static int lineCounter; - - /** - * The target to write to - */ - private static DataWriter theTargetWriter; - - - /** - * Overwrite existing files - */ - private boolean overwrite = false; - /** - * The source to read from - */ - private Source reader; - /** - * The name of the source file - */ - private String sourceString; - /** - * the Type of the Source file(SDF,GSI,XLIFF) - */ - private String sourceType; - /** - * The name of the target fille - */ - private String targetString; - /** - * the Type of the Target file(SDF,GSI,XLIFF) - */ - private String targetType; - /** - * The writer that handles the output - */ - private Target writer; - - /** - * The sourceLanguage - */ - String sourceLanguage = "en-US"; - - /** - * The targetLanguage - */ - String targetLanguage = ""; - - /** - * The name of the second source, needed for GSI to SDF merge - */ - private String secondSourceString=EMPTY; - - - /** - * Get the line counter - * @return Returns the lineCounter. - */ - public static int getLineCounter() { - return lineCounter; - } - - /** - * increment the lineCounter - */ - final static void countLine() { - lineCounter++; - } - - /** - * Creates a new instance of Converter - * - * @param sourceType the type of the sourceFile - * @param sourceString the name of the sourceFile - * @param SourceLanguage the ISO Id of the sourceLanguage - * @param targetType the type of the targetFile - * @param targetString the name of the targetFile - * @param TargetLanguage the ISO Id of the targetLanguage - * @param secondSourceString the name of the second sourceFile (GSI merge only) - * @param overwrite indicates whether overwrite existing files - * @throws IOException - * @throws Exception - */ - public Converter(String sourceType, String sourceString, - String SourceLanguage, String targetType, String targetString, - String TargetLanguage,String secondSourceString, boolean overwrite) throws IOException, - Exception { - - this.sourceType = sourceType; - this.sourceString = sourceString; - this.sourceLanguage = SourceLanguage; - this.targetType = targetType; - this.targetString = targetString; - this.targetLanguage = TargetLanguage; - this.secondSourceString=secondSourceString; - this.overwrite = overwrite; - - handler = new DataHandler(); - - if ("sdf".equalsIgnoreCase(sourceType)) { - reader = new SDFSource(); - } else if ("xliff".equalsIgnoreCase(sourceType)||"dbxliff".equalsIgnoreCase(sourceType)) { - reader = new XLIFFSource(); - } else if ("gsi".equalsIgnoreCase(sourceType)) { - reader = new GSISource(); - } else { - throw new ConverterException("Unknown Source File Type: '"+sourceType+"'"); - } - - if ("sdf".equalsIgnoreCase(targetType)) { - writer = new SDFTarget(); - } else if ("xliff".equalsIgnoreCase(targetType)) { - writer = new XLIFFTarget(); - } else if ("gsi".equalsIgnoreCase(targetType)) { - writer = new GSITarget(); - } else { - throw new ConverterException("Unknown Target File Type: '"+targetType+"'"); - } - - } - - /** - * Do the converting from the source file format to the target file format - * - * @throws IOException - */ - public final void convert() throws IOException { - - try { - - reader.convertTo(writer); - - //TODO this belongs in the Target Class - theTargetWriter.flush(); - theTargetWriter.close(); - } catch (Exception e) { - OutputHandler.out(e.getMessage()); - } - - } - - - /** - * - * Encapsulate the reading from an GSI file - * - * @author Christian Schmidt 2005 - * - */ - private class GSISource implements Source { - DataReader theSourceReader; - /** - * Create a new Instance of GSISource - * - * @throws IOException - * @throws Exception - */ - public GSISource() throws IOException { - - theSourceReader = new GSIandSDFMerger(new File(sourceString),new File(secondSourceString), sourceLanguage, - targetLanguage, CHARSET); - } - - public void convertTo(Target t) { - - try { - theTargetWriter = t.getWriter(); - while (handler.fillDataFrom(theSourceReader)) { - - theTargetWriter.getDatafrom(handler); - theTargetWriter.writeData(); - } - } catch (IOException e) { - OutputHandler.out(e.getMessage()); - - } catch (Exception e) { - e.printStackTrace(); - } - - } - - } - /** - * - * Encapsulate to write to a GSI file - * - * @author Christian Schmidt 2005 - * - */ - private class GSITarget implements Target { - - File target; - - /** - * Create a new Instance of GSITarget - * - * @throws FileNotFoundException - * @throws IOException - */ - public GSITarget() throws FileNotFoundException, IOException { - - target = FileMaker.newFile(targetString, overwrite); - theTargetWriter = new GSIWriter(new BufferedOutputStream( - new FileOutputStream(target)), CHARSET); - } - - public DataWriter getWriter() { - - return theTargetWriter; - } - - } - /** - * - * Encapsulate the reading from an SDF file - * - * @author Christian Schmidt 2005 - * - */ - private final class SDFSource implements Source { - - DataReader Source; - - /** - * Create a new Instance of SDFSource - * @throws IOException - * @throws Exception - */ - public SDFSource() throws IOException, Exception { - - Source = new SDFReader(new File(sourceString), sourceLanguage, - targetLanguage, CHARSET); - } - - public void convertTo(Target t) { - try { - theTargetWriter = t.getWriter(); - while (handler.fillDataFrom(Source)) { - - theTargetWriter.getDatafrom(handler); - theTargetWriter.writeData(); - } - - } catch (IOException e) { - OutputHandler.out(e.getMessage()); - - } catch (Exception e) { - e.printStackTrace(); - } - - } - - } - /** - * Encapsulate writing to a SDF file - * - * @author Christian Schmidt 2005 - * - */ - private class SDFTarget implements Target { - - /** - * Create a new Instance of SDFTarget - * - * @throws IOException - */ - public SDFTarget() throws IOException { - File target = FileMaker.newFile(targetString, overwrite); - theTargetWriter = new SDFWriter(new BufferedOutputStream( - new FileOutputStream(target)), CHARSET); - } - - /* (non-Javadoc) - * @see com.sun.star.tooling.converter.Converter.Target#getWriter() - */ - public DataWriter getWriter() { - - return theTargetWriter; - } - - } - - /** - * The interface for all convertable sources - * - * @author Christian Schmidt 2005 - * - */ - private interface Source { - - DataReader Source=null; - /** - * Convert this. to the designated target - * @param target the target of the converting - * @throws IOException - */ - abstract void convertTo(Target target) throws IOException; - } - - /** - * The interface for all creatable targets - * - * @author Christian Schmidt 2005 - * - */ - private interface Target { - /** - * The writer to use - */ - public OutputStream writer = null; - - /** - * Get the writer - * this target uses to write the - * data in the correct format. - * - * @return the used DataWriter - */ - abstract DataWriter getWriter(); - - } - /** - * Encapsulate the reading from an XLIFF file - * - * @author Christian Schmidt 2005 - * - */ - private class XLIFFSource implements Source { - File source; - - /** - * Create a new Instance of XLIFFSource - * - * - */ - public XLIFFSource() { - - source = new File(sourceString); - } - - public void convertTo(Target t) throws IOException { - try { - System.setProperty("entityExpansionLimit", "1000000"); - boolean laden = source.canRead(); - if (laden) { - DefaultHandler contentHandler=null; - if("dbxliff".equalsIgnoreCase(sourceType)){ - contentHandler = new XLIFFReader(handler, t - .getWriter(),false); - }else{ - contentHandler = new XLIFFReader(handler, t - .getWriter()); - } - SAXParserFactory factory = SAXParserFactory.newInstance(); - factory.setNamespaceAware( true ); - factory.setValidating( true ); - - SAXParser parser=factory.newSAXParser(); - XMLReader xliffreader=parser.getXMLReader(); - - - -// XMLReader xliffreader = XMLReaderFactory -// .createXMLReader("org.apache.crimson.parser.XMLReaderImpl"); - xliffreader.setErrorHandler(contentHandler); - xliffreader.setContentHandler(contentHandler); - /* one possibility to resolve an extern entity (DTD) */ - EntityResolver res = new Resolver(); - xliffreader.setEntityResolver(res); - /* - * a second possibility to resolve an extern entity (DTD) - * - * xliffreader.setFeature("xml.org/sax/features/validation",true); - * xliffreader.setEntityResolver(new EntityResolver() { - * public InputSource resolveEntity(java.lang.String - * publicId, java.lang.String systemId) throws SAXException, - * java.io.IOException { if (publicId.equals("-//XLIFF//DTD - * XLIFF//EN")) // this deactivates the open office DTD - * return new InputSource(new ByteArrayInputStream( " " .getBytes())); else - * return null; } }); - * - */ - - xliffreader.parse(sourceString); - - } else { - System.out.println("Datei existiert nicht"); - } - - } catch (SAXParseException e) { - try { - theTargetWriter.flush(); - } catch (IOException e1) { - - e1.printStackTrace(); - } - OutputHandler.out("PARSE ERROR Zeile " + e.getLineNumber() - + ", " + e.getMessage()); - - }catch (SAXException e){ - try { - theTargetWriter.flush(); - } catch (IOException e1) { - - e1.printStackTrace(); - } - OutputHandler.out("PARSE EXCEPTION " + e.getMessage()); - } catch (ParserConfigurationException e) { - OutputHandler.out("PARSER Configuration failed\n " + e.getMessage()); - } - } - - } - /** - * Encapsulate writing to a XLIFF file - * - * @author Christian Schmidt 2005 - * - */ - private class XLIFFTarget implements Target { - File target; - - /** - * Create a new Instance of XLIFFTarget - * - * @throws FileNotFoundException - * @throws IOException - */ - public XLIFFTarget() throws FileNotFoundException, IOException { - target = FileMaker.newFile(targetString, overwrite); - theTargetWriter = new XLIFFWriter(new BufferedOutputStream( - new FileOutputStream(target)), CHARSET); - - } - - public DataWriter getWriter() { - - return theTargetWriter; - } - } - - -} \ No newline at end of file diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/ConverterException.java b/transex3/java/l10nconv/java/com/sun/star/tooling/converter/ConverterException.java deleted file mode 100755 index 07a3708d4366..000000000000 --- a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/ConverterException.java +++ /dev/null @@ -1,79 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: ConverterException.java,v $ - * $Revision: 1.3 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -/* - * a simple exception - * just to seperate - * it from other - * exceptions - */ -package com.sun.star.tooling.converter; - -/** - * @author Christian Schmidt - * - * Thrown if an error occurs during converting from one file format to another - * that does not belong to an other exception - */ -public class ConverterException extends Exception { - - /** - * - */ - public ConverterException() { - super(); - - } - - /** - * @param arg0 - */ - public ConverterException(String arg0) { - super(arg0); - - } - - /** - * @param arg0 - */ - public ConverterException(Throwable arg0) { - super(arg0); - - } - - /** - * @param arg0 - * @param arg1 - */ - public ConverterException(String arg0, Throwable arg1) { - super(arg0, arg1); - - } - -} \ No newline at end of file diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/DataHandler.java b/transex3/java/l10nconv/java/com/sun/star/tooling/converter/DataHandler.java deleted file mode 100755 index e8b4136f185a..000000000000 --- a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/DataHandler.java +++ /dev/null @@ -1,149 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: DataHandler.java,v $ - * $Revision: 1.3 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -/* - * DataHandler.java - * - * take the data from the reader - * and put it to the Writer - * - */ - -package com.sun.star.tooling.converter; - -import java.util.*; - -/** - * Handle the Data to get it from the Source - * readable to the Target - * - * @author Christian Schmidt - */ -public class DataHandler { - - /** - * An arrays that holds the names that will be - * keys for the HashMap containing the data - * - */ - private final String[] dataNames = { "BlockNr", "Project", - "SourceFile", "Dummy", "ResType", "GID", "LID", "HID", "Platform", - "Width", "SourceLanguageID", "SourceText", "SourceHText", - "SourceQText", "SourceTitle", "TargetLanguageID", "TargetText", - "TargetHText", "TargetQText", "TargetTitle", "TimeStamp" }; - - private static final String EMPTY = new String(""); - - /** - * The HashMap containing the data - */ - private final Map data = new ExtMap(dataNames, null); - - /** Creates a new instance of DataHandler */ - public DataHandler() { - } - - /** - * fill the data from the desired source - * - * @param source where to get the data from - * @return true if data is read and false if null is read - * @throws IOException - * @throws ConverterException - */ - public boolean fillDataFrom(DataReader source) throws java.io.IOException, - ConverterException { - - Map line = null; - - line = source.getData(); - if (line == null){ - - return false; - }else{ - - this.data.putAll(line); - return true; - } - - - } - - /** - * fill this data with the inData - * - * @param inData the data to handle by this handler - */ - public void fillDataWith(Map inData) { - data.putAll(inData); - } - -// public void transfer(DataWriter target, DataReader source) { -// -// source.setHandler(this); -// -// } - - /** - * The designated output is filled with the content of this handler - * - * @param output an array of Maps [0] should hold the source language data [1] the target language data - * @throws java.io.IOException - */ - public void putDataTo(Map[] output) throws java.io.IOException { - String aKey = EMPTY; - for (int j = 0; j < output.length; j++) { - Set keys = output[j].keySet(); - Iterator iter = keys.iterator(); - while (iter.hasNext()) { - aKey = (String) iter.next(); - output[j].put(aKey, data.get(aKey)); - } - } - - } - /** - * The designated output is filled with the content of this handler - * - * @param output a Map that should hold the source language data and the target language data - * @throws java.io.IOException - */ - public void putDataTo(Map output) throws java.io.IOException { - String aKey = EMPTY; - - Set keys = output.keySet(); - Iterator iter = keys.iterator(); - while (iter.hasNext()) { - aKey = (String) iter.next(); - output.put(aKey, data.get(aKey)); - } - - } - -} \ No newline at end of file diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/DataReader.java b/transex3/java/l10nconv/java/com/sun/star/tooling/converter/DataReader.java deleted file mode 100755 index 59de7ca7e1f4..000000000000 --- a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/DataReader.java +++ /dev/null @@ -1,79 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: DataReader.java,v $ - * $Revision: 1.3 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.tooling.converter; - -import java.io.*; -import java.util.*; - -/** - * Gets Line counting from LineNumberReader all Converter Reader classes inherit - * from this. - * The abstract parent class of all converter reader classes - * - * @author Christian Schmidt - */ -abstract public class DataReader extends LineNumberReader { - - /** - * Creates a new instance of DataReader - * - * @param isr - * InputStreamReader used as Source for this class - */ - public DataReader(InputStreamReader isr) { - super(isr); - } - - /** - - * @throws java.io.IOException - * @throws ConverterException - * - * TODO this should no longer use an array as return type better a Map - * - */ - /** - * The next block of the SDF file is reviewed and the Line including the - * source language and the Line including the target Language are given back - * in an array - * - * - * @return A Map including the source language - * and the target Language content are given back - * - * @throws java.io.IOException - * @throws ConverterException - */ - public Map getData() throws java.io.IOException, ConverterException { - return null; - } - - -} \ No newline at end of file diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/DataWriter.java b/transex3/java/l10nconv/java/com/sun/star/tooling/converter/DataWriter.java deleted file mode 100755 index c5d6765e3840..000000000000 --- a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/DataWriter.java +++ /dev/null @@ -1,91 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: DataWriter.java,v $ - * $Revision: 1.3 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -/* - * DataWriter.java - * - * parent of all XXXWriter classes used by - * Converter - */ - -package com.sun.star.tooling.converter; - -import java.io.BufferedOutputStream; -import java.io.IOException; -import java.io.OutputStreamWriter; - -/** - * The abstract parent class of all converter writer classes - * - * @author Christian Schmidt - */ -abstract public class DataWriter extends OutputStreamWriter { - protected final String seperator = new String("|"); - - /** - * the char sequence used as line seperator - */ - protected final String lineEnd = java.lang.System.getProperty( - "line.seperator", "\n"); - - /** Creates a new instance of DataWriter */ - /** - * @param bos the buffered output stream holding the data - * @param encoding the encoding to use for read from bos - * @throws java.io.UnsupportedEncodingException - */ - public DataWriter(BufferedOutputStream bos, String encoding) - throws java.io.UnsupportedEncodingException { - super(bos, encoding); - } - -// abstract protected void writeData(Map[] data) throws java.io.IOException; - - /** - * get the data that should be written from the DataHandler - * - * @param handler the DataHandler having the data - * @throws java.io.IOException - */ - abstract protected void getDataFrom(DataHandler handler) - throws java.io.IOException; - - /** - * write the Data - * - * @throws java.io.IOException - */ - abstract protected void writeData() throws java.io.IOException; - - /** - * @param handler - * @throws IOException - */ - abstract protected void getDatafrom(DataHandler handler) throws IOException; -} \ No newline at end of file diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/ExtMap.java b/transex3/java/l10nconv/java/com/sun/star/tooling/converter/ExtMap.java deleted file mode 100755 index b05767e93ae3..000000000000 --- a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/ExtMap.java +++ /dev/null @@ -1,97 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: ExtMap.java,v $ - * $Revision: 1.3 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -/* - * A special HashMap, - * can be constructed of - * two Arrays - */ -package com.sun.star.tooling.converter; - -import java.util.HashMap; -import java.util.Map; - -/** - * @author Christian Schmidt - * - * Create a Hash Map from two Arrays - * - */ -public class ExtMap extends HashMap { - - /** - * - */ - public ExtMap() { - super(); - - } - - /** - * @see java.util.HashMap - * @param arg0 - */ - public ExtMap(int arg0) { - super(arg0); - - } - - /** - * @param arg0 - * @param arg1 - */ - public ExtMap(int arg0, float arg1) { - super(arg0, arg1); - - } - - /** - * @param arg0 - */ - public ExtMap(Map arg0) { - super(arg0); - - } - - // create a new Map from two string arrays - public ExtMap(String[] names, String[] content) { - super(names.length); - if (content == null) - content = new String[names.length]; - for (int i = 0; i < names.length; i++) { - if (i >= content.length) { - break; - } else { - this.put(names[i], content[i]); - } - } - - } - -} \ No newline at end of file diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/FileMaker.java b/transex3/java/l10nconv/java/com/sun/star/tooling/converter/FileMaker.java deleted file mode 100755 index a21b8daa7b1d..000000000000 --- a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/FileMaker.java +++ /dev/null @@ -1,87 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: FileMaker.java,v $ - * $Revision: 1.3 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -/* - * creates new files - * checks if they exist or - * can be overwritten - * - */ -package com.sun.star.tooling.converter; - -import java.io.File; -import java.io.IOException; - -/** - * Creates new files only if the file does not yet exist - * or overwriting is allowed - * - * @author Christian Schmidt 2005 - * - */ -public final class FileMaker { - - /** - * Create a new file if overwriting is not alowed - * ask if existing files should be overwritten - * - * @param fileName the files name to overwrite - * @param overwrite indicates wether the file can be overwritten - * @return the File created from the fileName - * @throws IOException - */ - public final static File newFile(String fileName, boolean overwrite) - throws IOException { - File file = new File(fileName); - if (file.exists()) { - if (!overwrite) { - char c = 0; - - System.out.print("Warning: File " + fileName - + " already exist.\n" + "Overwrite (y/n) ? :"); - byte[] waste = new byte[10]; - System.in.read(waste); - c = (char) waste[0]; - if (c == 'y') { - OutputHandler.out("...overwriting " + fileName); - } else { - OutputHandler.out( - "\nPlease set '-o' switch at command line to overwrite.\n\nProgramm Aborted."); - System.exit(-1); - } - } else { - OutputHandler.out("...overwriting " + fileName); - } - } else { - OutputHandler.out("...creating new target file " + fileName); - } - return file; - } - -} \ No newline at end of file diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/GSIReader.java b/transex3/java/l10nconv/java/com/sun/star/tooling/converter/GSIReader.java deleted file mode 100755 index adb6e358a74c..000000000000 --- a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/GSIReader.java +++ /dev/null @@ -1,250 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: GSIReader.java,v $ - * $Revision: 1.4 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -/* - * Created on 2005 - * by Christian Schmidt - */ -package com.sun.star.tooling.converter; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStreamReader; -import java.util.HashMap; -import java.util.Map; - -import com.sun.star.tooling.languageResolver.LanguageResolver; -import com.sun.star.tooling.languageResolver.LanguageResolver.LanguageResolvingException; - -/** - * @author Christian Schmidt 2005 - * - */ -public class GSIReader extends DataReader { - /** - * A Map holding an empty GSIBlock - */ - private Map EmptyGSIBlock; - - /** - * @see LanguageResolver - */ - LanguageResolver languageResolver; - - /** - * The source language identifier - */ - protected String sourceLanguage; - - /** - * The target language identifier - */ - protected String targetLanguage; - - /** - * The number of the last block - */ - private String oldBlockNr; - - /** - * A buffer holding one GSILine - */ - private Map GSILineBuffer; - - /** - * Indicates whether to use the buffered line - */ - private boolean useBuffer = false; - - private static final String EMPTY = new String(""); - - /** - * An empty Map to fill with language depending data - */ - private ExtMap EmptyLanguageMap; - - /** - * Indicates whether the first block is read - */ - private boolean isFirst = true; - - private int lineCounter; - - private int blockCounter; - /** - * Indicates whether the last line is read - */ - private boolean lastLineFound = false; - - /** - * Create a new Instance of GSIReader - * - * @param source - * the file to read from - * @param sourceLanguage - * the sourceLanguage (must not be empty) - * @param targetLanguage - * the targetLanguage - * @param charset - * the charset used to read source - * @throws java.io.IOException - * @throws Exception - */ - public GSIReader(File source, String sourceLanguage, String targetLanguage, - String charset) throws java.io.IOException { - super(new InputStreamReader(new FileInputStream(source), charset)); - this.languageResolver = new LanguageResolver(); - this.sourceLanguage = sourceLanguage; - this.targetLanguage = targetLanguage; - - EmptyLanguageMap = new ExtMap(new String[0], new String[0]); - - } - - /** - * Read the next GSIBlock and return the data - * - * @return A Map containing the data of the read GSIBlock the keys for the language depending data are the language id (numeric) the - * single language are acessible with the keys "BlockNr", "resType", "languageNr", "status","content". - * - * @throws IOException - */ - public Map getGSIData() throws IOException { - String help; - Map helpmap; - Map GSIBlock = new HashMap(); - GSIBlock.put(sourceLanguage, EmptyLanguageMap.clone()); - GSIBlock.put(targetLanguage, EmptyLanguageMap.clone()); - String line = EMPTY; - String[] splitLine; - Map GSILine; - String[] GSINames = { "BlockNr", "resType", "languageNr", "status", - "content" }; - - while (useBuffer || (line = readLine()) != null) { - - - - if (useBuffer) { - GSILine = GSILineBuffer; - GSIBlock.put(sourceLanguage, EmptyLanguageMap.clone()); - GSIBlock.put(targetLanguage, EmptyLanguageMap.clone()); - GSIBlock.put("BlockNr", GSILine.get("BlockNr")); - useBuffer = false; - } else { - this.lineCounter++; - if ((splitLine = split(line)) == null) { - continue; - } - GSILine = new ExtMap(GSINames, splitLine); - if (isFirst) { - GSIBlock.put("BlockNr", GSILine.get("BlockNr")); - oldBlockNr = (String) GSILine.get("BlockNr"); - isFirst = false; - } - } - if (oldBlockNr == null) { - oldBlockNr = (String) GSILine.get("BlockNr"); - } - if (!oldBlockNr.equals((String) GSILine.get("BlockNr"))) { - GSILineBuffer = GSILine; - oldBlockNr = (String) GSILine.get("BlockNr"); - useBuffer = true; - break; - } - String lang; - try { - // Is there the source language in this line? - if ((lang = languageResolver.getISOfromNr((String) GSILine - .get("languageNr"))).equals(this.sourceLanguage)) { - // ok..store it as Source String under the depending - // ressource type - - ((Map) GSIBlock.get(sourceLanguage)).put("Source" - + ResTypeResolver.getInternKey((String) GSILine - .get("resType")), GSILine.get("content")); - // ..maybe the target language? - } else { - if (targetLanguage.equals(EMPTY)) { - // if no target language is given at command line - targetLanguage = lang; - GSIBlock.put(targetLanguage, EmptyLanguageMap.clone()); - } - if (lang.equals(this.targetLanguage)) { - - // ok..store it as target String under the depending - // ressource type - ((Map) GSIBlock.get(targetLanguage)).put("Target" - + ResTypeResolver.getInternKey((String) GSILine - .get("resType")), GSILine - .get("content")); - } - } - } catch (LanguageResolvingException e) { - OutputHandler.out("Can not resolve the language "+e.getMessage()); - } - - } - if (line == null) { - if (lastLineFound){ - OutputHandler.out("\n\n"); - OutputHandler.out("GSI Blocks : " + this.blockCounter); - OutputHandler.out("GSI Lines : " + this.lineCounter); - - return null; - }else{ - lastLineFound = true; - this.blockCounter++; - return GSIBlock; - } - } else { - this.blockCounter++; - return GSIBlock; - } - - } - - /** - * Split a GSILine to single fields - * - * @param line - * The line to split - * @return An array containing the contents of the columns in the given line - */ - private String[] split(String line) { - String[] splitLine = (line.substring(0, line.length() - 1)) - .split("\\(\\$\\$\\)"); - if (splitLine.length != 5) - return null; - else - return splitLine; - } - -} diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/GSIWriter.java b/transex3/java/l10nconv/java/com/sun/star/tooling/converter/GSIWriter.java deleted file mode 100755 index 085e26475e09..000000000000 --- a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/GSIWriter.java +++ /dev/null @@ -1,246 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: GSIWriter.java,v $ - * $Revision: 1.3 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -package com.sun.star.tooling.converter; -import java.io.*; -import java.util.Map; - -import com.sun.star.tooling.languageResolver.LanguageResolver; -import com.sun.star.tooling.languageResolver.LanguageResolver.LanguageResolvingException; -/** - * - * @author cs156069 - */ -public class GSIWriter extends DataWriter { - /** - * The seperator used to seperate GSI columns - */ - final String seperator=new String("($$)"); - - /** - * Holding the keys used by a map holding the content of an GSI Line contianing the source language - */ - final static String[] sourceLineNames= {"Project","SourceFile","Dummy","ResType","GID","LID","HID","Platform","Width","SourceLanguageID","SourceText","SourceHText","SourceQText","SourceTitle","TimeStamp"}; - /** - * Holding the keys used by a map holding the content of an GSI Line contianing the target language - */ - final static String[] targetLineNames= {"Project","SourceFile","Dummy","ResType","GID","LID","HID","Platform","Width","TargetLanguageID","TargetText","TargetHText","TargetQText","TargetTitle","TimeStamp"}; - /** - * Holding the keys used by a map holding the content of an GSI Line contianing the source and the target language - */ - final static String[] outLineNames= {"BlockNr","Project","SourceFile","Dummy","ResType","GID","LID","HID","Platform","Width","SourceLanguageID","SourceText","SourceHText","SourceQText","SourceTitle","TargetLanguageID","TargetText","TargetHText","TargetQText","TargetTitle","TimeStamp"}; - - /** - * A map holding the content of an GSI Line contianing the source language - */ - private ExtMap sourceLine=new ExtMap(sourceLineNames,null); - /** - * A map holding the content of an GSI Line contianing the target language - */ - private ExtMap targetLine=new ExtMap(targetLineNames,null); - /** - * A map holding the content of an GSI Line contianing the source and the target language - */ - private ExtMap outData=new ExtMap(outLineNames, null); - - private static final String EMPTY = new String(""); - /** - * The sourceLanguage to use - */ - private String sourceLanguage; - /** - * The sourceLanguage to use - */ - private String targetLanguage; - - /** - * GSILines have a special Line End - */ - private final static String lineEnd="!"+'\r'+'\n'; - //private boolean SourceIsFirst=false; - - /** - * The blockNr of the current line - */ - private String blockNr; - - - - - /** - * Create a new Instance of GSIWriter - * - * @param bos the Buffered Output Stream to write to - * @param charset the used charset - * @throws java.io.UnsupportedEncodingException - */ - public GSIWriter(BufferedOutputStream bos,String charset) throws java.io.UnsupportedEncodingException { - super(bos,charset); - - - - } - - /* (non-Javadoc) - * @see com.sun.star.tooling.converter.DataWriter#writeData() - */ - public final void writeData() throws java.io.IOException { - - StringBuffer buffer=new StringBuffer(""); - if(this.sourceLanguage==null&&this.targetLanguage==null){ - LanguageResolver lang =new LanguageResolver(); - try { - this.sourceLanguage=lang.getNrFromISO((String)outData.get("SourceLanguageID")); - this.targetLanguage=lang.getNrFromISO((String)outData.get("TargetLanguageID")); - } catch (LanguageResolvingException e) { - - OutputHandler.out(e.getMessage()); - System.exit(0); - } - } - - - this.blockNr=(String)outData.get("BlockNr"); - // get the values of the found fields - //create the gsi lines - // - //at first the source language line - buffer.append(getSourceLine("Text")); - buffer.append(getSourceLine("HText")); - buffer.append(getSourceLine("QText")); - buffer.append(getSourceLine("Title")); - - //now the target language line - // put them together for output - buffer.append(getTargetLine("Text")); - buffer.append(getTargetLine("HText")); - buffer.append(getTargetLine("QText")); - buffer.append(getTargetLine("Title")); - //ok...put all to disk; - this.write(buffer.toString()); - - } - - /** - * Create a line containing the source string from the data - * @param resType - * @return The StringBuffer containing the line - */ - private StringBuffer getSourceLine(String resType){ - StringBuffer buffer =new StringBuffer(200); - String resString = "Source"+resType; - - String help; - if(EMPTY.equals((String)outData.get(resString))||" ".equals(outData.get(resString))) return new StringBuffer(EMPTY); - else { - // put them together for output - buffer.append(this.blockNr); - // seperate the fields with ($$) - buffer.append(this.seperator); - buffer.append(ResTypeResolver.getExternKey(resType)); - // seperate the fields with ($$) - buffer.append(this.seperator); - buffer.append(this.sourceLanguage); - // seperate the fields with ($$) - buffer.append(this.seperator); - buffer.append("int"); - // seperate the fields with ($$) - buffer.append(this.seperator); - buffer.append(outData.get(resString)); - - // this line is full - // so close it with '! cr lf' - buffer.append(GSIWriter.lineEnd); - Converter.countLine(); - return buffer; - } - - } - /** - * Create a line containing the target string from the data - * @param resType - * @return The StringBuffer containing the line - */ - private StringBuffer getTargetLine(String resType){ - StringBuffer buffer =new StringBuffer(200); - String resString = "Target"+resType; - - if(EMPTY.equals((String)outData.get(resString))||" ".equals(outData.get(resString))) return new StringBuffer(EMPTY); - else { - // put them together for output - buffer.append(this.blockNr); - // seperate the fields with ($$) - buffer.append(this.seperator); - buffer.append(ResTypeResolver.getExternKey(resType)); - // seperate the fields with ($$) - buffer.append(this.seperator); - buffer.append(this.targetLanguage); - // seperate the fields with ($$) - buffer.append(this.seperator); - buffer.append("ext"); - // seperate the fields with ($$) - buffer.append(this.seperator); - buffer.append(outData.get(resString)); - - // this line is full - // so close it with '! cr lf' - buffer.append(GSIWriter.lineEnd); - Converter.countLine(); - return buffer; - } - - } - - - /* (non-Javadoc) - * @see com.sun.star.tooling.converter.DataWriter#writeData(java.util.Map[]) - */ - protected void writeData(Map[] data) throws IOException { - // TODO redesign DataHandler in the way that this is not nessesary any more - - } - - /* (non-Javadoc) - * @see com.sun.star.tooling.converter.DataWriter#getDataFrom(com.sun.star.tooling.converter.DataHandler) - */ - protected void getDataFrom(DataHandler handler) throws IOException { - - handler.putDataTo(this.outData); - } - - /* (non-Javadoc) - * @see com.sun.star.tooling.converter.DataWriter#getDatafrom(com.sun.star.tooling.converter.DataHandler) - */ - protected void getDatafrom(DataHandler handler) throws IOException { - - handler.putDataTo(this.outData); - - } -} diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/GSIandSDFMerger.java b/transex3/java/l10nconv/java/com/sun/star/tooling/converter/GSIandSDFMerger.java deleted file mode 100755 index ff0348f97d3d..000000000000 --- a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/GSIandSDFMerger.java +++ /dev/null @@ -1,167 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: GSIandSDFMerger.java,v $ - * $Revision: 1.3 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -/* - * Created on 2005 - * by Christian Schmidt - */ -package com.sun.star.tooling.converter; - -import java.io.File; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -/** - * Merge GSIFiles back to to the original (!) SDFFile - * - * - * @author Christian Schmidt 2005 - * - */ -public class GSIandSDFMerger extends SDFReader { - - int lineCounter=0; - - GSIReader gsiReader; - - private Map temp=new HashMap(); - private int j; - private boolean skip=true; - Map gsiBlock=null; - Map sdfBlock=null; - - private boolean dontLoadGSI=false; - - private int count; - /** - * Merge the GSIFile back to the original(!) SDFFile - * - * @param source the file to read from - * @param sourceLanguage the source language in the source file - * @param targetLanguage the target language in the source file - * @param charset the charset of the files - * @throws java.io.IOException - * @throws Exception - */ - public GSIandSDFMerger(File source, File secondSource,String sourceLanguage, - String targetLanguage, String charset) throws IOException { - // merging GSI and SDF requieres two Sources - //this. is the SDF source - super(secondSource, sourceLanguage, targetLanguage, charset); - //create the GSI Source - - gsiReader=new GSIReader(source,sourceLanguage,targetLanguage,charset); - - } - - /* (non-Javadoc) - * @see com.sun.star.tooling.converter.DataReader#getData() - */ - public Map getData()throws java.io.IOException{ - do{ - skip=false; - this.temp=matchGSI(); - }while(skip); - if(temp==null){ - OutputHandler.out("Blocks merged : "+this.lineCounter); - } - return temp; - - } - - /** - * Read each block of the GSIFile and check whether there is a matching - * block in the SDFFile. Match depends on the BlockNr and BlockId. - * - * @return A Map that contains the source language content - * and the target language content. - * @throws IOException - * @throws ConverterException - */ - public Map matchGSI() throws IOException{ - - - try { - //System.out.println("Start..."); - - if (dontLoadGSI||(gsiBlock=gsiReader.getGSIData())!=null){ - dontLoadGSI=false; - //check if we must update this block - //if so its BlockNr is in the gsi file - if((sdfBlock = super.getData())!=null){ - - if(((String)sdfBlock.get("BlockNr")).equals((String)gsiBlock.get("BlockNr"))){ - - gsiBlock.remove(EMPTY); - //if the target language string is empty this may be caused by an error in the source sdf File - //I don't want to overwrite a possibly correct translation with an empty string - // so remove the target part from the gsiBlock - Map mp=(Map)gsiBlock.get(gsiReader.targetLanguage); - if (mp.size()!=0&&!((String)mp.get("TargetText")).equals("")){ - - // target language part in this gsiBlock -// if(((String)mp.get("TargetText")).equals("")){ -// gsiBlock.remove(targetLanguage); -// } - // count the merged blocks - lineCounter++; - Map helpMap = (Map)gsiBlock.get(super.targetLanguage);//"ja" - sdfBlock.putAll(helpMap); - skip=false; - }else{ - //no target language part in this gsiBlock - skip=true; -// -// return null; - } - }else{ -// skip=true; -// -// // we cant match this gsi block to the current sdf block - // try matching the next sdf block with this gsi line - dontLoadGSI=true; - } - } - return sdfBlock; - } - - } catch (IOException e) { - - e.printStackTrace(); - } - return null; - } - - - - - - -} diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/LineErrorException.java b/transex3/java/l10nconv/java/com/sun/star/tooling/converter/LineErrorException.java deleted file mode 100755 index 6a11360cc472..000000000000 --- a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/LineErrorException.java +++ /dev/null @@ -1,81 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: LineErrorException.java,v $ - * $Revision: 1.3 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -/* - * Exception for errors in - * SDFLines - */ -package com.sun.star.tooling.converter; - - -/** - * This Exeption is thrown if a DataReader finds an error in a read Line - * f. e. wrong column number - * - * @author Christian Schmidt 2005 - * - */ -public class LineErrorException extends Exception { - - public int tokenCount; - /** - * - */ - public LineErrorException() { - super(); - - } - - /** - * @param arg0 - */ - public LineErrorException(String arg0) { - super(arg0); - - } - - /** - * @param arg0 - */ - public LineErrorException(Throwable arg0) { - super(arg0); - - } - - /** - * @param arg0 - * @param arg1 - */ - public LineErrorException(String arg0, Throwable arg1) { - super(arg0, arg1); - - } - - -} \ No newline at end of file diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/OutputHandler.java b/transex3/java/l10nconv/java/com/sun/star/tooling/converter/OutputHandler.java deleted file mode 100755 index 997c05a70b4f..000000000000 --- a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/OutputHandler.java +++ /dev/null @@ -1,228 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: OutputHandler.java,v $ - * $Revision: 1.4 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -/* - * Creates logfile and file for debug information - * - */ -package com.sun.star.tooling.converter; - -import java.io.BufferedWriter; -import java.io.IOException; - -/** - * Handle the whole output during converting process except the converted files. - * Write output to logfiles and to screen depending on switches given - * at command line. - * @author Christian Schmidt 2005 - * - */ -public class OutputHandler { - - private static final String EMPTY = ""; - - /** - * The logfile to write - */ - public static BufferedWriter logFile; - - /** - * Indicates whether excisting files should be overwritten - */ - public static boolean doLog = false; - - /** - * Indicate whether the debug information should be written - */ - public static boolean doDebug = false; - - /** - * The File to write the debug information to - */ - public static BufferedWriter dbgFile; - - /** - * Write the data to screen and if the switches were set to - * logfile and debugfile - * - * @param out the String to write - */ - final static void out(String out) { - try { - if (doDebug) - OutputHandler.dbg(out); - - if (!doLog || logFile == null) { - System.out.println(out); - } else { - System.out.println(out); - if (EMPTY.equals(out)) { - OutputHandler.log(EMPTY); - } else { - OutputHandler.log(out); - } - } - } catch (IOException e) { - - OutputHandler.log(e.toString()); - } - } - - /** - * make a dot on the screen to show the user that it is going on - */ - final static void printDot() { - System.out.print("."); - - } - - /** - * write the data to log file and if the switch is set - * to the debug file - * - * @param out the String to write - */ - final static void log(String out) { - try { - if(out==null) return; - if (doDebug) - - OutputHandler.dbg(out); - - if (doLog) { - if (!EMPTY.equals(out)) { - logFile.write(out); - } - logFile.newLine(); - logFile.flush(); - } - } catch (IOException e) { - - System.out.println(e.getMessage()); - } - } - - /** - * write the string to the debug file - * - * @param out the String to write - * @throws IOException - */ - final static void dbg(String out) throws IOException { - if(out==null) return; - if (doDebug) { - if (!EMPTY.equals(out)) { - dbgFile.write(out); - - } - dbgFile.newLine(); - dbgFile.flush(); - } - } - - /** - * Set a new value to indicate whether a debug file should be written or not - * - * @param doDebug - * The debug value to set. - */ - private static void setDebug(boolean doDebug) { - OutputHandler.doDebug = doDebug; - } - - // /** - // * @return Returns the doDebug. - // */ - // private static boolean isDebug() { - // return doDebug; - // } - - /** - * Set the debug file to write to. - * - * @param dbgFile - * The debug File to use. - */ - private static void setDbgFile(BufferedWriter dbgFile) { - OutputHandler.dbgFile = dbgFile; - } - - /** - * @return Returns the debug File. - */ - private static BufferedWriter getDbgFile() { - return dbgFile; - } - - /** - * @param doLog - * The log value to set. - */ - private static void setLog(boolean doLog) { - OutputHandler.doLog = doLog; - } - - /** - * @return Returns the log value. - */ - private static boolean isLog() { - return doLog; - } - - /** - * @param logFile - * The logFile to set. - */ - private static void setLogFile(BufferedWriter logFile) { - OutputHandler.logFile = logFile; - } - - /** - * @return Returns the logFile. - */ - private static BufferedWriter getLogFile() { - return logFile; - } - - /** - * @throws IOException - * close log and dbg - */ - public static void closeAll() throws IOException { - if (OutputHandler.logFile != null) { - OutputHandler.logFile.flush(); - OutputHandler.logFile.close(); - } - if (OutputHandler.dbgFile != null) { - OutputHandler.dbgFile.flush(); - OutputHandler.dbgFile.close(); - } - } - -} \ No newline at end of file diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/ResTypeResolver.java b/transex3/java/l10nconv/java/com/sun/star/tooling/converter/ResTypeResolver.java deleted file mode 100755 index f53fe0101275..000000000000 --- a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/ResTypeResolver.java +++ /dev/null @@ -1,71 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: ResTypeResolver.java,v $ - * $Revision: 1.3 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -/* - * Created on 2005 - * by Christian Schmidt - */ -package com.sun.star.tooling.converter; - -import java.util.Map; - -/** - * Helps resolving restype descriptors used outside the tool to - * restype descriptors used by this tool - * - * @author Christian Schmidt 2005 - * - */ -public class ResTypeResolver { - final static String[] inFields={"Text","QText","HText","Title"}; - final static String[] outFields={"res","res-quickhelp","res-help","res-title"}; - final static Map internKeys=new ExtMap(inFields,outFields); - final static Map externKeys=new ExtMap(outFields,inFields); - - /** - * Get the intern key depending to the given extern key - * - * @param externKey the externKey {"res","res-quickhelp","res-help","title"} - * @return the depending intern key - */ - public static String getInternKey(String externKey){ - return (String)externKeys.get(externKey); - } - - /** - * Get the extern key to the given intern key - * - * @param internKey the internal key - * @return the external key - */ - public static String getExternKey(String internKey){ - return (String)internKeys.get(internKey); - } - -} diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/Resolver.java b/transex3/java/l10nconv/java/com/sun/star/tooling/converter/Resolver.java deleted file mode 100755 index 29a9ee2e528a..000000000000 --- a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/Resolver.java +++ /dev/null @@ -1,98 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: Resolver.java,v $ - * $Revision: 1.4 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -/* - * Created on 27.01.2005 - * - */ -package com.sun.star.tooling.converter; - -import java.io.IOException; -import java.io.InputStream; - -import org.xml.sax.EntityResolver; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; - -/** - * Resolve external entities by provide the - * XLIFF DTD stored in the jar file - */ -public class Resolver implements EntityResolver { - - /** - * Resolver constructor. - */ - public Resolver() { - } - - /** - * Allow the application to resolve external entities. - * - * The Parser will call this method before opening any external entity - * except the top-level document entity (including the external DTD subset, - * external entities referenced within the DTD, and external entities - * referenced within the document element): the application may request that - * the parser resolve the entity itself, that it use an alternative URI, or - * that it use an entirely different input source. - */ - - /* (non-Javadoc) - * @see org.xml.sax.EntityResolver#resolveEntity(java.lang.String, java.lang.String) - */ - - public InputSource resolveEntity(String publicId, String systemId) - throws SAXException, IOException { - - if ((publicId != null) && (publicId.equals("-//XLIFF//DTD XLIFF//EN"))) { - systemId = "dtd:///xliff.dtd"; - } - if (systemId != null) { - if (systemId.startsWith("dtd://")) { - String dtd = "com/sun/star/tooling/converter/dtd" - + systemId.substring(6); - ClassLoader cl = this.getClass().getClassLoader(); - InputStream in = cl.getResourceAsStream(dtd); - InputSource ins = new InputSource(in); - ins.setSystemId(systemId); - return ins; - } /* - * else if ( systemId.startsWith("jar:") ) { try { URL url=new - * URL(systemId); JarURLConnection jarConn = - * (JarURLConnection)url.openConnection(); InputSource ins=new - * InputSource(jarConn.getInputStream()); - * ins.setSystemId(systemId); return ins; } - * catch(MalformedURLException me){ throw new SAXException(me); - * Incorrect URL format used } } - */ - } - return null; - } - -} \ No newline at end of file diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/SDFReader.java b/transex3/java/l10nconv/java/com/sun/star/tooling/converter/SDFReader.java deleted file mode 100755 index 4c0c234778ec..000000000000 --- a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/SDFReader.java +++ /dev/null @@ -1,635 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: SDFReader.java,v $ - * $Revision: 1.4 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -/* - * SDFReader.java - * - * - */ - -package com.sun.star.tooling.converter; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStreamReader; -import java.text.DecimalFormat; -import java.util.*; - -/** - * - * SDFReader is a FileReader that knows about - * the content of SDFFiles - * - * A SDFBlock is read of the given file. A SDFBlock - * consists of all SDFLines that are traanslations of the - * same String and the SDFLine containing the source string - * itself. SDFFile lines are read and checked whether they - * have the allowed column count and don't contain illeagal - * characters (like most unprintable characters below 0x00df). - * If the given source language is not found in the first - * block of SDFLines a ConverterException is thrown at runtime. - * If the given target language is "" (that means not given) - * the first language that is not the given source language - * is taken for target language. The found values are returned in HashMaps that - * use the following keys: - *
- * "BlockNr" originally coming from reading the sdf file, contains 'block nr in sdf file'+'-'+'hash value of the sdf id fields'.
- * "Project" first column in sdf file format.
- * "SourceFile" second column in sdf file format.
- * "Dummy" third column in sdf file format.
- * "ResType" 4. column in sdf file format.
- * "GID" 5. column in sdf file format.
- * "LID" 6. column in sdf file format.
- * "HID" 7. column in sdf file format.
- * "Platform" 8. column in sdf file format.
- * "Width", 9. column in sdf file format.
- * "SourceLanguageID" 10. column in sdf file format(in the line with the source language).
- * "SourceText" 11. column in sdf file format(in the line with the source language).
- * "SourceHText" 12. column in sdf file format(in the line with the source language).
- * "SourceQText" 13. column in sdf file format(in the line with the source language).
- * "SourceTitle" 14. column in sdf file format(in the line with the source language).
- * "TargetLanguageID" 10. column in sdf file format (in the line with the target language).
- * "TargetText" 11. column in sdf file format (in the line with the target language).
- * "TargetHText" 12. column in sdf file format (in the line with the target language).
- * "TargetQText" 13. column in sdf file format (in the line with the target language).
- * "TargetTitle", 14. column in sdf file format (in the line with the target language).
- * "TimeStamp" 15. column in sdf file format.
- * - * @author Christian Schmidt 2005 - * - */ - -public class SDFReader extends DataReader { - - /** - * an array of the SDF files column names - */ - final static String[] fieldnames = { "Project", "SourceFile", "Dummy", - "ResType", "GID", "LID", "HID", "Platform", "Width", "LanguageID", - "Text", "HText", "QText", "Title", "TimeStamp" }; - - /** - * an array of the SDF files column names if the source language is in - */ - final static String[] sourceLineNames = { "Project", "SourceFile", "Dummy", - "ResType", "GID", "LID", "HID", "Platform", "Width", - "SourceLanguageID", "SourceText", "SourceHText", "SourceQText", - "SourceTitle", "TimeStamp" }; - - /** - * an array of the SDF files column names if the target language is in - */ - final static String[] targetLineNames = { "Project", "SourceFile", "Dummy", - "ResType", "GID", "LID", "HID", "Platform", "Width", - "TargetLanguageID", "TargetText", "TargetHText", "TargetQText", - "TargetTitle", "TimeStamp" }; - - final static String EMPTY = new String(""); - - private int dotCount = 0; - - /** - * a Map containing an SDF line with source language - */ - private Map sourceMap; - - /** - * a Map containing an SDF line with target language - */ - private Map targetMap; - - /** - * a Map containing an SDF - */ - private Map SDFMap; - - /** - * a Map Array containing one SDF source language line and one SDF target - * language line - */ - private Map[] data = { sourceMap, targetMap }; - - /** - * The Id of the current SDFBlock - */ - private String CurrentBlockId; - - /** - * The SDF file to read from - */ - private File sourceFile; - - /** - * The language in the source file that should be handelt as source language - */ - protected String sourceLanguage; - - /** - * The language in the source file that should be handelt as target language - */ - protected String targetLanguage; - - /** - * A counter holding the number of blocks just read - * from this file - */ - private long blockNr = 0;// If we use Integer, more then numbers greater than 128k would be signed - - /** - * A counter holding the number of skipped lines that means - * lines that can not be worked with because they contain an error - */ - private int skippedLines = 0; - - /** - * This switch is set for indicating that all source file lines - * are read and no lines remain buffered. Finding this like 'true' - * means the source file is finished - */ - private boolean endIt = false; - - /** - * Indicates whether the targetLanguage is found in this source file so far - */ - private boolean foundTarget = false; - /** - * Indicates whether the sourceLanguage is found in this source file so far - */ - private boolean foundSource = false; - - /** - * Counts how many lines were skipped because the language is - * neither sourceLanguage nor targetLanguage - */ - private int langMiss; - - /** - * Indicates whether there is a line in the read buffer or not - */ - private boolean useBuffer = false; - - /** - * A buffer for SDFLines - */ - private String lineBuffer; - - /** - * The buffer for the already splitted SDFLines - */ - private String[] splittedLineBuffer; - - /** - * Counts how many Blocks were skipped - * f.e. because no sourceLanguage is found - * in it - */ - private int skippedBlocks; - - /** - * Counts the blocks without targetLanguage - */ - private int targetLangMiss; - - /** - * Counts the blocks without sourceLanguage - */ - private int sourceLangMiss; - - /** - * Counts the lines where no targetLanguage line was found - * and so empty lines were created - */ - private int targetLangCreate; - - - DecimalFormat blockNrFormatter = new DecimalFormat("000000"); - - /** - * The hashcode of the current block - */ - private int CurrentBlockHash; - - private boolean skip; - - /** - * Create a new Instance of SDFREader - * - * @param source the file to read from - * @param sourceLanguage the sourceLanguage (must not be empty) - * @param targetLanguage the targetLanguage - * @param charset the charset used to read source - * @throws java.io.IOException - * @throws Exception - */ - public SDFReader(File source, String sourceLanguage, String targetLanguage, - String charset) throws java.io.IOException { - super(new InputStreamReader(new FileInputStream(source), charset)); - sourceFile = source; - this.sourceLanguage = sourceLanguage; - this.targetLanguage = targetLanguage; - String line; - String[] splitLine; - //read first line to get the first - //SDF block id - mark(16000); - if ((line = readLine()) != null) { - if ((splitLine = split(line)) != null){ - this.CurrentBlockId = getSDFBlockId(splitLine); - this.CurrentBlockHash=this.CurrentBlockId.hashCode(); - //found the first - this.blockNr++; - } - this.splittedLineBuffer = splitLine; - } - reset(); - - } - - /* (non-Javadoc) - * @see com.sun.star.tooling.converter.DataReader#getData() - */ - public Map getData()throws IOException { - - Map map=new HashMap(); -// do { - this.skip=false; - Map[] help=readBlock(); - if(help==null||help[1]==null||help[0]==null){ - return null; -// }else if (help[1].get("TargetLanguageID")==null||help[0].get("SourceLanguageID")==null) { -// OutputHandler.log("Missing Language Id in block "+blockNr+"\nthe block is skipped." ); -// this.skippedBlocks++; -// this.skip=true; - }else{ - map.putAll(help[1]); - map.putAll(help[0]); - - } -// }while(this.skip=true); - return map; - } - - - /** - * Read a Block from the sdf file and return - * @return a Map[] where [0] holds the source and [1] the target language data. - * - * @throws java.io.IOException - */ - public Map[] readBlock() throws java.io.IOException { - String line = EMPTY; - String blockId = EMPTY; - String[] splittedLine = null; - data[0]=new ExtMap(); - data[1]=new ExtMap(); - String help; - String c = null; - //read next line or use buffered line - while (useBuffer || (line = readLine()) != null) { //works because '||' is shortcut - - try { - // buffer used? - if (useBuffer) { - line = this.lineBuffer; - splittedLine = this.splittedLineBuffer; - this.SDFMap = new ExtMap(SDFReader.fieldnames, splittedLine); - - try { - checkLanguage(splittedLine); - } catch (ConverterException e) { - throw e; - }finally{ - - useBuffer = false; - } - } else { - //...are there wrong characters? - if ((check(line)).length() < line.length()) { - throw new LineErrorException(getLineNumber() - + " : Line contains wrong character " - //+ Integer.toHexString(Integer.parseInt(c)) - + " \n" + line); - } - //...is the number of columns ok? - if ((splittedLine = split(line)) == null) { - - throw new LineErrorException(super.getLineNumber() - + " : Line has wrong column number \n" + line); - //continue; - } else { - // TODO makeDot is better in Data Handler - makeDot(); - // ...is this line in a new SDF block ? - if ((blockId = getSDFBlockId(splittedLine)) - .equals(CurrentBlockId)) { - - this.SDFMap = new ExtMap(SDFReader.fieldnames, - splittedLine); - //what language is in it ? - checkLanguage(splittedLine); - - } else { - - /* - * we found the next block , but do we have the - * target text? - */ - - if (!foundTarget) { - createTargetLine(); - } - - blockNr++; - splittedLineBuffer = splittedLine;//read one line - // too much so - // buffer it - lineBuffer = line; - useBuffer = true;//reset(); - - this.CurrentBlockId = blockId; - this.CurrentBlockHash=this.CurrentBlockId.hashCode(); - - /* ...and what about the source text ? */ - if (!foundSource) { - - OutputHandler - .log("Error in Line:" - + getLineNumber() - + "Source Language is missing maybe " - + "previous block has an error.\nBlock " - + (blockNr - 1) - + " is skipped. before line: \n" - + line); - - foundTarget = false;//no target without source - skippedBlocks++; - skippedLines++; - sourceLangMiss++; - continue;// skip output of this block if no - // source language is found - - } - - break; - - } - } - - } - - } catch (LineErrorException e) { - - OutputHandler.log(e.getMessage()); - this.skippedLines++; - } catch (ConverterException e) { - OutputHandler.log(e.getMessage()); - } - - } - // did we read the whole stuff? - if (null != line) { - // no - foundSource = false; - foundTarget = false; - - return this.data; - - } else { - // ok , its the end but is everything written now? - if (!endIt) { - // there is something to write - // but next time we can end it - endIt = true; - if(!foundTarget){ - createTargetLine(); - } - // write - return this.data;//last lines - } else { - - showStat(); - return null; - } - } - // }catch(ConverterException e) { - // Converter.log(e.getMessage()); - // return null; - // } - } - - /** - * - */ - private void createTargetLine() { - targetLangMiss++; - // if not, create one ... - data[1] = new ExtMap(SDFReader.targetLineNames, - splittedLineBuffer); - data[1].put("TargetLanguageID", - this.targetLanguage); - if ((String) data[1].get("TargetText") != EMPTY) - data[1].put("TargetText", EMPTY); - if ((String) data[1].get("TargetHText") != EMPTY) - data[1].put("TargetHText", EMPTY); - if ((String) data[1].get("TargetQText") != EMPTY) - data[1].put("TargetQText", EMPTY); - if ((String) data[1].get("TargetTitle") != EMPTY) - data[1].put("TargetTitle", EMPTY); - this.data[1].put("BlockNr", blockNrFormatter.format(blockNr)+'-'+Integer.toString(this.CurrentBlockHash)); - targetLangCreate++; - } - - /** - * Show the statistic information got while - * reading the file - * - * @throws IOException - */ - private void showStat() throws IOException { - OutputHandler.out(EMPTY);OutputHandler.out(EMPTY); - // OutputHandler.out("Hashes: " + (theHashes.size()) + " "); - OutputHandler.out("Blocks found: " + blockNr + " "); - OutputHandler.out(EMPTY); - OutputHandler.out("Lines read: " + (getLineNumber()) + " "); - OutputHandler - .dbg("Lines created " + (targetLangCreate) + " "); - OutputHandler.dbg(" -------"); - OutputHandler.dbg("Lines total: " - + (getLineNumber() + targetLangCreate) + " "); - OutputHandler.dbg("Lines skipped: " + skippedLines + " "); - - OutputHandler.dbg("Source Language misses: " + sourceLangMiss + " "); - OutputHandler.dbg("Target Language misses: " + targetLangMiss + " "); - OutputHandler.dbg("Blocks found: " + blockNr + " "); - OutputHandler.dbg("Blocks skipped: " + skippedBlocks + " "); - if ((sourceLangMiss + skippedBlocks + skippedLines) > 0) - OutputHandler.out("\n---! Errors found !--- view Logfile.\n\n" - + "To enable logfile use -l option at command line.\n" - + "For help type 'convert -h {Enter}'.\n"); - } - - /** - * Check the current line whether the source language - * or target language is in it - * - * @throws ConverterException if a not needed language or no target language is found - * in this block - * @throws IOException - * - */ - final private void checkLanguage(String[] splittedLine) - throws ConverterException, IOException { - String langID = (String) SDFMap.get("LanguageID"); - - //maybe the source language is in this line - if (!foundSource && this.sourceLanguage.equals(langID)) { -// found the next source language line - this.data[0] = new ExtMap(SDFReader.sourceLineNames, splittedLine); - -// this.data[0].put("BlockNr", Integer.toHexString(blockNr)); -// this.data[0].put("BlockHash", Integer.toHexString(this.CurrentBlockHash)); - this.data[0].put("BlockNr", blockNrFormatter.format(blockNr)+'-'+Integer.toHexString(this.CurrentBlockHash)); -// this.data[0].put("BlockHash", blockHashFormatter.format(this.CurrentBlockHash)); - foundSource = true; - return; - - } else { - // or the target language is in this line - if (!foundTarget) { - //no target language is given at command line - if (this.targetLanguage.equals(EMPTY)) { - //try if we can use the current lines language for target - // language - if (!langID.equals(this.sourceLanguage)) { - //yes , we can use this lines laanguage as target - this.targetLanguage = langID; - - //source and target language both are known: show it - OutputHandler.out("Source Language is: " - + this.sourceLanguage + " "); - OutputHandler.out("Target Language is: " - + this.targetLanguage + " "); - OutputHandler.out(EMPTY); - System.out.println("Start"); - - } else { - throw new ConverterException("(" + getLineNumber() - + ") No target language found: " - + this.targetLanguage); - } - } - if (this.targetLanguage.equals(langID)) { - this.data[1] = new ExtMap(SDFReader.targetLineNames, - splittedLine);// found the next target language line - this.data[1].put("BlockNr", blockNrFormatter.format(blockNr)+'-'+Integer.toHexString(this.CurrentBlockHash)); - foundTarget = true; - - return; - } - }//end !foundTarget - } - //if we go here we dont need the found language... - throw new ConverterException("found not needed language '" - + this.SDFMap.get("LanguageID") + "' in Line: " - + getLineNumber()); - - } - - /** - * Make a dot on the screen to show the user that it is going on - */ - private void makeDot() { - int count = 0; - if ((count = (int) super.getLineNumber() / 1000) > this.dotCount) { - this.dotCount = count; - OutputHandler.printDot(); - } - - } - - /** - * split the SDFLine in its columns - * - * @param line the current SDFLine - * @return the splitted SDFLine as array of String - * or null if an error occours - * @throws IOException - */ - private String[] split(String line) throws IOException { - check(line); - String[] splitLine; - if ((splitLine = line.split("\t")).length == 15) - return splitLine; - else - //an error occured - return null; - } - - /** - * create a block Id from a splitted SDFLine - * the blockId consists of the column one to eight of an SDF File - * - * @param splitLine the line to create a block id from - * @return the blockId as String - */ - private String getSDFBlockId(String[] splitLine) { - StringBuffer BlockId = new StringBuffer(""); - for (int i = 0; i < 8; i++) { - BlockId.append(splitLine[i]); - } - return BlockId.toString(); - } - -// public final boolean canRead() { -// return this.sourceFile.canRead(); -// } - - /** - * Check if there are not allowed characters in this line - * - * @param line the SDFLine to check - * @return if everything, ok the original - * else the wrong character as String - * - * @throws java.io.IOException - */ - private String check(String line) throws java.io.IOException { - char c = ' '; - for (int i = 0; i < line.length(); i++) { - c = line.charAt(i); - if (c < 30 && c != 9) { - return (new Character(c)).toString(); - } - - } - return line; - - } -} \ No newline at end of file diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/SDFWriter.java b/transex3/java/l10nconv/java/com/sun/star/tooling/converter/SDFWriter.java deleted file mode 100755 index 98eb8c856e6a..000000000000 --- a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/SDFWriter.java +++ /dev/null @@ -1,175 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: SDFWriter.java,v $ - * $Revision: 1.4 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -/* - * SDFWriter.java - * - * - */ - -package com.sun.star.tooling.converter; -import java.io.*; -import java.util.Map; - -/** - * Write data to a SDFFile - * - * @author Christian Schmidt 2005 - * - */ -public class SDFWriter extends DataWriter { - /** - * the seperator the seperate columns - */ - final String seperator=new String("\t"); - /** - * an array of the SDF files column names if the source language is in - */ - final static String[] sourceLineNames= {"Project","SourceFile","Dummy","ResType","GID","LID","HID","Platform","Width","SourceLanguageID","SourceText","SourceHText","SourceQText","SourceTitle","TimeStamp"}; - /** - * an array of the SDF files column names if the target language is in - */ - final static String[] targetLineNames= {"Project","SourceFile","Dummy","ResType","GID","LID","HID","Platform","Width","TargetLanguageID","TargetText","TargetHText","TargetQText","TargetTitle","TimeStamp"}; - /** - * an array of the SDF files column names if the source and the target language is in - */ - final static String[] outLineNames= {"BlockNr","Project","SourceFile","Dummy","ResType","GID","LID","HID","Platform","Width","SourceLanguageID","SourceText","SourceHText","SourceQText","SourceTitle","TargetLanguageID","TargetText","TargetHText","TargetQText","TargetTitle","TimeStamp"}; - - /** - * A Map holding the source language line content - */ - private ExtMap sourceLine=new ExtMap(sourceLineNames,null); - /** - * A Map holding the target language line content - */ - private ExtMap targetLine=new ExtMap(targetLineNames,null); - /** - * A Map holding the whole content for output - */ - private ExtMap outData=new ExtMap(outLineNames, null); -// private ExtMap SDFLine; -// private InputStreamReader isr; - /** - * The language to translate from - */ - private String sourceLanguage; - /** - * The language to translate to - */ - private String targetLanguage; - -// private boolean SourceIsFirst=false; - - - - - /** - * Create a new Instance of SDFWriter - * - * @param bos BufferedWriter to write to - * @param charset the charset to use to write - * @throws java.io.UnsupportedEncodingException - */ - public SDFWriter(BufferedOutputStream bos,String charset) throws java.io.UnsupportedEncodingException { - super(bos,charset); - - } - - /* (non-Javadoc) - * @see com.sun.star.tooling.converter.DataWriter#writeData() - */ - public final void writeData() throws java.io.IOException { - - StringBuffer buffer=new StringBuffer(""); - - // get the values of the found fields - //create the two sdf lines - - //at first the source language line - for(int i=0;i - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -/* - * XLIFFReader.java - * - * - */ -package com.sun.star.tooling.converter; - -import java.io.IOException; -import java.util.Hashtable; -import java.util.Map; - -import com.sun.star.tooling.languageResolver.LanguageResolver; - -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; -import org.xml.sax.SAXParseException; -import org.xml.sax.helpers.AttributesImpl; -import org.xml.sax.helpers.DefaultHandler; - - -/** - * Parse the given file and extract the content needed. - *
- * This Reader understands the parts of the - * xliff spezification used to translate - * the strings in Star-Office and Open-Office. - *
- * The given file is parsed and the content is stored in a HashMap with those keys: - *
- * "BlockNr" originally coming from reading the sdf file, contains 'block nr in sdf file'+'-'+'hash value of the sdf id fields'.
- * "Project" first column in sdf file format.
- * "SourceFile" second column in sdf file format.
- * "Dummy" third column in sdf file format.
- * "ResType" 4. column in sdf file format.
- * "GID" 5. column in sdf file format.
- * "LID" 6. column in sdf file format.
- * "HID" 7. column in sdf file format.
- * "Platform" 8. column in sdf file format.
- * "Width", 9. column in sdf file format.
- * "SourceLanguageID" 10. column in sdf file format(in the line with the source language).
- * "SourceText" 11. column in sdf file format(in the line with the source language).
- * "SourceHText" 12. column in sdf file format(in the line with the source language).
- * "SourceQText" 13. column in sdf file format(in the line with the source language).
- * "SourceTitle" 14. column in sdf file format(in the line with the source language).
- * "TargetLanguageID" 10. column in sdf file format (in the line with the target language).
- * "TargetText" 11. column in sdf file format (in the line with the target language).
- * "TargetHText" 12. column in sdf file format (in the line with the target language).
- * "TargetQText" 13. column in sdf file format (in the line with the target language).
- * "TargetTitle", 14. column in sdf file format (in the line with the target language).
- * "TimeStamp" 15. column in sdf file format.
- * @ - * @author Christian Schmidt 2005 - * - */ -public class XLIFFReader extends DefaultHandler { - - /** - * A String array holding the keys used by the HashMap holding the Data - */ - private final String[] dataNames = { "BlockNr", "Project", - "SourceFile", "Dummy", "ResType", "GID", "LID", "HID", "Platform", - "Width", "SourceLanguageID", "SourceText", "SourceHText", - "SourceQText", "SourceTitle", "TargetLanguageID", "TargetText", - "TargetHText", "TargetQText", "TargetTitle", "TimeStamp" }; - - /** - * Used to index in the data array - */ - static int index = 0; - - /** - * The Map that holds the data returned by this class - */ - private Map moveData = new ExtMap(); - - /** - * A Map that holds yet incomplete data - * until all depending transunits are found - */ - private Hashtable DataStore = new Hashtable(); - - /** - * An Elements name - */ - private String name = new String(""); - - /** - *List of Attributes used by an Element - */ - private Attributes attrs; - -// private String tagElement = new String(""); - - /** - * Indicates whether the next found content string should be printed - */ - private boolean printThis = false; - /** - * Indicates whether the next found content string should be stored - */ - private boolean storeIt = false; - - /** - * data holds the information created while parsing - * - */ - private String[] data = new String[26]; - - /** - * The handler used by this class - */ - private final DataHandler handler; - /** - * The target used by this class - */ - private final DataWriter target; - -// private boolean searchForText = false; - - /** - * counts how many dots are made - */ - private int dotCount; - - /** - * Counts how many Trans Units are read - */ - private int transUnitCounter; - - /** - * used source Language - */ - private String sourceLanguage; - - /** - * used target language - */ - private String targetLanguage; - - /** - * indicates whether this is the first Transunit - */ - private boolean isFirst = true; - - private static final String EMPTY = new String(""); - - /** - * the last index in data where something is written - */ - private int oldindex; - -// private boolean isBptEptTag; - -// private String innerString; -// -// private String key; - - /** - * Index for the BlockNr in the data array - */ - private static final int BLOCKNR_IDX = 0; - /** - * Index for the Project in the data array - */ - private static final int PROJECT_IDX = 1; - /** - * Index for the Sourcefile name in the data array - */ - private static final int SOURCEFILE_IDX = 2; - /** - * Index for the 'dummy' in the data array - */ - private static final int DUMMY_IDX = 3; - /** - * Index for the Group Id in the data array - */ - private static final int GID_IDX = 4; - /** - * Index for the Local Id in the data array - */ - private static final int LID_IDX = 5; - /** - * Index for the Help Id in the data array - */ - private static final int HID_IDX = 6; - /** - * Index for the Platform in the data array - */ - private static final int PLATFORM_IDX = 7; - /** - * Index for the 'Width' in the data array - */ - private static final int WIDTH_IDX = 8; - /** - * Index for the Sourcelanguage Id in the data array - */ - private static final int SOURCE_LANGUAGE_ID_IDX = 10; - /** - * Index for the Source Text in the data array - */ - private static final int SOURCE_TEXT_IDX = 11; - /** - * Index for the Source Helptext in the data array - */ - private static final int SOURCE_HELPTEXT_IDX = 12; - /** - * Index for the Source Quickhelp Text in the data array - */ - private static final int SOURCE_QUICK_HELPTEXT_IDX = 13; - /** - * Index for the Source Titletext in the data array - */ - private static final int SOURCE_TITLETEXT_IDX = 14; - /** - * Index for the Timestamp in the data array - */ - private static final int TIMESTAMP_IDX = 15; - /** - * Index for the res type in the data array - */ - private static final int RESTYPE_IDX = 16; - /** - * Index for the Target Language Id in the data array - */ - private static final int TARGET_LANGUAGE_ID_IDX = 20; - /** - * Index for the Target Text in the data array - */ - private static final int TARGET_TEXT_IDX = 21; - /** - * Index for the Target Helptext in the data array - */ - private static final int TARGET_HELP_TEXT_IDX = 22; - /** - * Index for the Target Quickhelp Text in the data array - */ - private static final int TARGET_QUICKHELP_TEXT_IDX = 23; - /** - * Index for the Target Titletext in the data array - */ - private static final int TARGET_TITLE_TEXT_IDX = 24; - /** - * Index for the Found Parts Counter in the data array - */ - private static final int FOUND_PARTS_COUNTER_IDX = 18; - - /** - * used to find the matching ISO or RFC3066 language code - */ - LanguageResolver languageResolver; - - private boolean doBlockCompleteCheck=true; - - - - /** - * Create a new Instance of XLIFFReader - * - * @param handler the DataHandler to use - * @param target the target used - * @throws IOException - */ - public XLIFFReader(DataHandler handler, DataWriter target) throws IOException { - this.languageResolver = new LanguageResolver(); - this.handler = handler; - this.target = target; - } - - /** - * Create a new Instance of XLIFFReader - * - * @param handler the DataHandler to use - * @param target the target used - * @param doBlockCompleteCheck indicates whether every single transunit should be returned or the whole block data is to be collected - * - * @throws IOException - */ - public XLIFFReader(DataHandler handler, DataWriter target,boolean doBlockCompleteCheck) throws IOException { - this(handler, target); - this.languageResolver = new LanguageResolver(); - this.doBlockCompleteCheck=doBlockCompleteCheck; - - } - - /** - * delete and initialize the data content - */ - public void initData() { - for (int i = BLOCKNR_IDX; i < SOURCE_LANGUAGE_ID_IDX; i++) { - data[i] = ""; - } - for (int i = SOURCE_TEXT_IDX; i < TIMESTAMP_IDX; i++) { // skip Time Stamp - data[i] = ""; - } - for (int i = RESTYPE_IDX; i < TARGET_LANGUAGE_ID_IDX; i++) { // skip Source language ID - data[i] = ""; - } - for (int i = TARGET_TEXT_IDX; i < 26; i++) {// skip Target language ID, - data[i] = ""; - } - - data[DUMMY_IDX] = "0";//dummy - data[FOUND_PARTS_COUNTER_IDX] = "1";//parts found - - } - - /** (non-Javadoc) - * @see org.xml.sax.ContentHandler#startDocument() - */ - public void startDocument() { - initData(); - //System.out.print("Start"); - - } - - /** (non-Javadoc) - * @see org.xml.sax.ContentHandler#endDocument() - */ - public void endDocument() { - - try { - showStatistic(); - } catch (IOException e) { - - OutputHandler.log(e.getMessage()); - - } - } - - /** (non-Javadoc) - * @throws SAXException - * @see org.xml.sax.ContentHandler#startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes) - */ - public void startElement(String namespaceURI, String sName, String qName, - Attributes attrs) throws SAXException { - this.name = new String(qName); - this.attrs = new AttributesImpl(attrs); - String resType; - - String attributeName = new String(""); - String attribute = new String(""); - String tagElement = new String(""); - int i; - - if (qName.equals("bpt")||qName.equals("ept")||qName.equals("sub")||qName.equals("ex")) { - //ignore bpt, ept, ex and sub tags - // content of the tags will be stored - - storeIt=true; - return; - - } - if (qName.equals("target")) { - if ((resType = data[RESTYPE_IDX]) == null) { - - } else { - if ("res".equals(resType)) { - index = TARGET_TEXT_IDX; - - storeIt = true; - return; - } - // if("res-Help".equals(resType)){ - // index=TARGET_HELP_TEXT_IDX; - // storeIt=true; - // return; - // } - if ("res-QuickHelp".equals(resType)) { - index = TARGET_QUICKHELP_TEXT_IDX; - - storeIt = true; - return; - } - if ("res-Title".equals(resType)) { - index = TARGET_TITLE_TEXT_IDX; - - storeIt = true; - return; - } - } - - } - if (qName.equals("source")) { - if ((resType = data[RESTYPE_IDX]) == null) { - //throw new SAXException("Ressource type not found"); - } else { - if ("res".equals(resType)) { - index = SOURCE_TEXT_IDX; - - storeIt = true; - return; - } - // if("res-Help".equals(resType)){ - // index=SOURCEHELPTEXT_IDX; - // storeIt=true; - // return; - // } - if ("res-QuickHelp".equals(resType)) { - index = SOURCE_QUICK_HELPTEXT_IDX; - storeIt = true; - return; - } - if ("res-Title".equals(resType)) { - index = SOURCE_TITLETEXT_IDX; - storeIt = true; - return; - } - } - } - - if (qName.equals("file")) { - data[TIMESTAMP_IDX] = attrs.getValue("date"); - //data[17]=(attrs.getValue("original")); - try{ - data[SOURCE_LANGUAGE_ID_IDX] = (languageResolver.getISOFromRFC((String)attrs.getValue("source-language"))); - if(languageResolver.getISOFromRFC((String)attrs.getValue("target-language"))!=null){ - data[TARGET_LANGUAGE_ID_IDX] = (languageResolver.getISOFromRFC((String)attrs.getValue("target-language"))); - } - }catch(Exception e){ - OutputHandler.log(e.getMessage()); - } - return; - } - if (qName.equals("trans-unit")) { - String id = attrs.getValue("id"); - if ((DataStore.get(id)) != null) { - //TODO arraycopy might not be nessessary - System.arraycopy((String[]) DataStore.get(id), 0, data, 0, - data.length); - int help = (new Integer(data[FOUND_PARTS_COUNTER_IDX])).intValue(); //found one more part - help++; // refresh the actual found parts - data[FOUND_PARTS_COUNTER_IDX] = (new Integer(help)).toString(); // belonging to this information - - DataStore.remove(attrs.getValue("id")); // TODO this can be deleted? - } else { - - data[BLOCKNR_IDX] = (attrs.getValue("id")); // a new part - } - data[RESTYPE_IDX] = (attrs.getValue("restype")); - - return; - } - - if (qName.equals("context")) { - - String value = attrs.getValue("context-type"); - - if ("SourceHelpText".equals(value)) { - index = SOURCE_HELPTEXT_IDX; - storeIt = true; - return; - }else if ("TargetHelpText".equals(value)) { - index = TARGET_HELP_TEXT_IDX; - storeIt = true; - return; - }else if ("DBType".equals(value)) { - //index=SOURCEFILE_IDX; - //storeIt=true; - return; - }else if ("Project".equals(value)) { - index = PROJECT_IDX; - storeIt = true; - return; - }else if ("Filename".equals(value)) { - index = SOURCEFILE_IDX; - storeIt = true; - return; - }else if ("Type".equals(value)) { - index = RESTYPE_IDX; - storeIt = true; - return; - }else if ("GID".equals(value)) { - index = GID_IDX; - storeIt = true; - return; - }else if ("LID".equals(value)) { - index = LID_IDX; - storeIt = true; - return; - }else if ("HID".equals(value)) { - index = HID_IDX; - storeIt = true; - return; - }else if ("Platform".equals(value)) { - index = PLATFORM_IDX; - storeIt = true; - return; - }else if ("Width".equals(value)) { - index = WIDTH_IDX; - storeIt = true; - return; - } - - } - - } - - /** (non-Javadoc) - * @see org.xml.sax.ContentHandler#endElement(java.lang.String, java.lang.String, java.lang.String) - */ - public void endElement(String namespaceURI, String sName, String qName) - throws SAXException { - //we ignore bpt and ept tags - if(!(qName.equals("bpt")||qName.equals("ept")||qName.equals("sub")||qName.equals("ex"))){ - storeIt = false; - } - if (qName.equals("trans-unit")) { - showData(); - } - - } - - /** (non-Javadoc) - * @see org.xml.sax.ContentHandler#characters(char[], int, int) - */ - public void characters(char[] ch, int start, int length) { - - // checkContent(); - String str2 = new String(ch, start, length); - - if (storeIt) { - - String str = new String(ch, start, length); - if (index == oldindex) { - data[index] += str; - } else { - data[index] = str; - } - - } - oldindex = index; - - } - - /** (non-Javadoc) - * @see org.xml.sax.ErrorHandler#error(org.xml.sax.SAXParseException) - */ - public void error(SAXParseException e) throws SAXParseException { - - OutputHandler.log(e.getMessage()); - } - - /** (non-Javadoc) - * @see org.xml.sax.ErrorHandler#fatalError(org.xml.sax.SAXParseException) - */ - public void fatalError(SAXParseException e) throws SAXParseException { - - OutputHandler.log("PARSE ERROR in line " + e.getLineNumber() + ", " - + e.getMessage() ); - - } - - /** (non-Javadoc) - * @see org.xml.sax.ErrorHandler#warning(org.xml.sax.SAXParseException) - */ - public void warning(SAXParseException e) throws SAXParseException { - //throw e; - OutputHandler.log(e.getMessage()); - } - - /** - * Put the Data to the DataHandler - * tell the Writer to write it - * - * @throws SAXException - */ - public void showData() throws SAXException { - transUnitCounter++; - makeDot(); - if (isComplete()) { - - try { - moveData(); - if (isFirst == true) { - this.sourceLanguage = (String) this.moveData - .get("SourceLanguageID"); - this.targetLanguage = (String) this.moveData - .get("TargetLanguageID"); - OutputHandler.out(EMPTY); - OutputHandler.out("Source Language is: " - + this.sourceLanguage); - OutputHandler.out("Target Language is: " - + this.targetLanguage); - OutputHandler.out(EMPTY); - OutputHandler.out("Start"); - OutputHandler.out(EMPTY); - isFirst = false; - } - target.getDataFrom(handler); - target.writeData(); - - } catch (java.io.IOException e) { - throw new SAXException(e); - } - - } else { - DataStore.put(data[BLOCKNR_IDX], data.clone()); - initData(); - - } - initData(); - } - - - /** - * put the data in an Map in the format that - * DataHandler can handle it - */ - final public void moveData() { - - moveData.put("BlockNr", data[BLOCKNR_IDX]); - - moveData.put("Project", data[PROJECT_IDX]); - - moveData.put("SourceFile", data[SOURCEFILE_IDX]); - - moveData.put("Dummy", "0"); - - moveData.put("ResType", data[RESTYPE_IDX]); - - moveData.put("GID", data[GID_IDX]); - - moveData.put("LID", data[LID_IDX]); - - moveData.put("HID", data[HID_IDX]); - - moveData.put("Platform", data[PLATFORM_IDX]); - - if (EMPTY.equals(data[WIDTH_IDX])) - data[WIDTH_IDX] = "0"; - moveData.put("Width", data[WIDTH_IDX]); - - moveData.put("SourceLanguageID", data[SOURCE_LANGUAGE_ID_IDX]); - - moveData.put("SourceText", data[SOURCE_TEXT_IDX]); - - moveData.put("SourceHText", data[SOURCE_HELPTEXT_IDX]); - - moveData.put("SourceQText", data[SOURCE_QUICK_HELPTEXT_IDX]); - - moveData.put("SourceTitle", data[SOURCE_TITLETEXT_IDX]); - - moveData.put("TargetLanguageID", data[TARGET_LANGUAGE_ID_IDX]); - - moveData.put("TargetText", data[TARGET_TEXT_IDX]); - - moveData.put("TargetHText", data[TARGET_HELP_TEXT_IDX]); - - moveData.put("TargetQText", data[TARGET_QUICKHELP_TEXT_IDX]); - - moveData.put("TargetTitle", data[TARGET_TITLE_TEXT_IDX]); - - moveData.put("TimeStamp", data[TIMESTAMP_IDX]); - - //and give it to the data handler - this.handler.fillDataWith(moveData); - } - - /** - * complete means all depending parts have been found esp. all res types - * that belong to the same SDF Line - * - * @return true if the data is complete - * - */ - final public boolean isComplete() { - - if(!doBlockCompleteCheck){ - return true; - } - - String sParts; - if (data[FOUND_PARTS_COUNTER_IDX] == EMPTY) - data[FOUND_PARTS_COUNTER_IDX] = "1"; //this is the first part - - String sFoundParts = data[FOUND_PARTS_COUNTER_IDX]; - //create the new 'id' - sParts = data[BLOCKNR_IDX].substring(data[BLOCKNR_IDX].lastIndexOf(":") + 1); - - if (sFoundParts.equals(sParts)) { - return true; - } - return false; - } - - // TODO this belongs in OutputHandler - /** - * show the user that it is going - * on by printing dots on the screen - * - */ - private void makeDot() { - int count = 0; - if ((count = (int) this.transUnitCounter / 1000) > this.dotCount) { - this.dotCount = count; - OutputHandler.printDot(); - } - } - - /** - * show the statistic data found while parse this file - * - * @throws IOException - */ - final void showStatistic() throws IOException { - OutputHandler.out(EMPTY); - OutputHandler.out("TransUnits found: " + this.transUnitCounter); - // every data in DataStore is - // skipped 'cause its not complete - // TODO count really every transunit not only the data (might consist of - // more than one - OutputHandler.dbg("TransUnits skip : " + this.DataStore.size()); - //Converter.out(EMPTY); - } -} - diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/XLIFFWriter.java b/transex3/java/l10nconv/java/com/sun/star/tooling/converter/XLIFFWriter.java deleted file mode 100755 index 42eef42884c1..000000000000 --- a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/XLIFFWriter.java +++ /dev/null @@ -1,535 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: XLIFFWriter.java,v $ - * $Revision: 1.4 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -/* - * - /* - * XLIFFWriter.java - * - * - */ - -package com.sun.star.tooling.converter; - -import java.io.*; -import java.util.*; - -import com.sun.star.tooling.DirtyTags.DirtyTagWrapper; -import com.sun.star.tooling.languageResolver.LanguageResolver; -import com.sun.star.tooling.languageResolver.LanguageResolver.LanguageResolvingException; - -/** - * Write the Data to a wellformed XLIFF File - * - * @author Christian Schmidt - */ -public class XLIFFWriter extends DataWriter { - - /** - * An array holding the keys of the HashMap containing the source language string - */ - private final static String[] sourceLineNames = { "Project", "SourceFile", - "Dummy", "ResType", "GID", "LID", "HID", "Platform", "Width", - "SourceLanguageID", "SourceText", "SourceHText", "SourceQText", - "SourceTitle", "TimeStamp" }; - /** - * An array holding the keys of the HashMap containing the target language string - */ - private final static String[] targetLineNames = { "Project", "SourceFile", - "Dummy", "ResType", "GID", "LID", "HID", "Platform", "Width", - "TargetLanguageID", "TargetText", "TargetHText", "TargetQText", - "TargetTitle", "TimeStamp" }; - /** - * An array holding the keys of the HashMap containing the source and target language string - */ - private final static String[] outLineNames = { "BlockNr", "Project", - "SourceFile", "Dummy", "ResType", "GID", "LID", "HID", "Platform", - "Width", "SourceLanguageID", "SourceText", "SourceHText", - "SourceQText", "SourceTitle", "TargetLanguageID", "TargetText", - "TargetHText", "TargetQText", "TargetTitle", "TimeStamp" }; - /** - * An Map holding the source and target content - */ - private final Map data = new ExtMap(outLineNames, null); - - - /** - * Indicates if this is the first Transunit to write - */ - boolean isFirst = true; - - LanguageResolver languageResolver; - - - /** - * Create a new Instance of XLIFFWriter - * - * @param bos the Buffered Output Stream to write to - * @param charset the charset to use - * @throws IOException - */ - public XLIFFWriter(BufferedOutputStream bos, String charset) - throws IOException { - super(bos, charset); - this.languageResolver =new LanguageResolver(); - - - } - - /* (non-Javadoc) - * @see com.sun.star.tooling.converter.DataWriter#getDatafrom(com.sun.star.tooling.converter.DataHandler) - */ - public void getDatafrom(DataHandler handler) throws java.io.IOException { - handler.putDataTo(this.data); - } - - /** - * check if the item is an empty String - * - * @param item the string to check - * @return true if it is not empty, false if it is empty - */ - private final boolean isUsed(String item) { - if (!"".equals(item)) - return true; - return false; - } - - /** - * Replaces all characters that mustn't be in XLIFF PCdata - * - * @param string the string to check - * @return the checked string with all characters replaced - * @throws java.io.IOException - */ - private final String xmlString( final String string) throws java.io.IOException { - if (string == null) - return string; // "" - String str = string; -// str = str.replaceAll("&", "&"); -// str = str.replaceAll("<", "<"); -// str = str.replaceAll(">", ">"); -// str = str.replaceAll("\"", """); -// str = str.replaceAll("'", "'"); - for(int i=0;i'){ - str=str.substring(0, i)+">"+str.substring(i+1); - continue; - } - - if(str.charAt(i)=='"'){ - str=str.substring(0, i)+"""+str.substring(i+1); - continue; - } - - if(str.charAt(i)=='\''){ - str=str.substring(0, i)+"'"+str.substring(i+1); - continue; - } - } - - return str; - } - - /* (non-Javadoc) - * @see java.io.Writer#close() - */ - public void close() throws IOException { - this.writeTrailer(); - - super.close(); - } - - /* (non-Javadoc) - * @see com.sun.star.tooling.converter.DataWriter#writeData() - */ - public void writeData() throws IOException { - if (isFirst) { - - writeHeader(); - isFirst = false; - } - try{ - writeTransUnit(); - }catch(DirtyTagWrapper.TagWrapperException e){ - - } - } - - /** - * Write the XLIFFFiles header - * - * @throws IOException - */ - private void writeHeader() throws IOException { - - this.write(getHeader()); - } - - /** - * Write the XLIFFFiles Trailer - * - * @throws IOException - */ - private void writeTrailer() throws IOException { - this.write(getTrailer()); - } - - /** - * Write the next TransUnit - * - * @throws IOException - */ - private void writeTransUnit() throws IOException, DirtyTagWrapper.TagWrapperException { - try{ - StringBuffer writeBuffer = new StringBuffer(1000); - - StringBuffer allLinesEnd = new StringBuffer(200); - String sRessource = ""; - int parts = 0; - if (data == null) { - OutputHandler.out("error");// TBD Exception - } - - if (!(this.data.get("SourceText").equals("") || this.data.get( - "SourceText").equals(" "))) { - parts++; - } - // if(!(this.data.get("SourceHText").equals("")||this.data.get("SourceHText").equals(" - // "))){ - // parts++; - // } - if (!(this.data.get("SourceQText").equals("") || this.data.get( - "SourceQText").equals(" "))) { - parts++; - } - if (!(this.data.get("SourceTitle").equals("") || this.data.get( - "SourceTitle").equals(" "))) { - parts++; - } - if (!(this.data.get("SourceText").equals("") || this.data.get( - "SourceText").equals(" "))) { - sRessource = "res"; // normal TEXT source - - allLinesEnd - .append("\t\t\t\t\n"); - - if (isUsed((String) this.data.get("ResType"))) - allLinesEnd - .append("\t\t\t\t\t" - + xmlString((String) this.data.get("ResType")) - + "\n"); - if (isUsed((String) this.data.get("Project"))) - allLinesEnd - .append("\t\t\t\t\t" - + xmlString((String) this.data.get("Project")) - + "\n"); - if (isUsed((String) this.data.get("SourceFile"))) - allLinesEnd - .append("\t\t\t\t\t" - + xmlString((String) this.data - .get("SourceFile")) + "\n"); - if (isUsed((String) this.data.get("SourceHText"))) - allLinesEnd - .append("\t\t\t\t\t" - + xmlString((String) this.data - .get("SourceHText")) + "\n"); - if (isUsed((String) this.data.get("TargetHText"))) - allLinesEnd - .append("\t\t\t\t\t" - + xmlString((String) this.data - .get("TargetHText")) + "\n"); - if (isUsed((String) this.data.get("ResType"))) - allLinesEnd.append("\t\t\t\t\t" - + xmlString((String) this.data.get("ResType")) - + "\n"); - if (isUsed((String) this.data.get("GID"))) - allLinesEnd.append("\t\t\t\t\t" - + xmlString((String) this.data.get("GID")) - + "\n"); - if (isUsed((String) this.data.get("LID"))) - allLinesEnd.append("\t\t\t\t\t" - + xmlString((String) this.data.get("LID")) - + "\n"); - if (isUsed((String) this.data.get("HID"))) - allLinesEnd.append("\t\t\t\t\t" - + xmlString((String) this.data.get("HID")) - + "\n"); - if (isUsed((String) this.data.get("Platform"))) - allLinesEnd - .append("\t\t\t\t\t" - + xmlString((String) this.data.get("Platform")) - + "\n"); - if (isUsed((String) this.data.get("Width"))) - allLinesEnd.append("\t\t\t\t\t" - + xmlString((String) this.data.get("Width")) - + "\n"); - allLinesEnd.append("\t\t\t\t\n" - + "\t\t\t\n"); - - writeBuffer.append("\t\t\t\n"); - if (isUsed((String) this.data.get("SourceText"))) - writeBuffer.append("\t\t\t\t" - + DirtyTagWrapper.wrapString((String) this.data.get("SourceText")) - + "\n"); - - if (isUsed((String) this.data.get("TargetText"))) - writeBuffer - .append("\t\t\t\t" - +DirtyTagWrapper.wrapString((String) this.data - .get("TargetText")) + "\n"); - writeBuffer.append(allLinesEnd); - Converter.countLine(); - - } - // if(!(this.data.get("SourceHText").equals("")||this.data.get("SourceHText").equals(" - // "))){ - // sRessource="res-Help"; //Source is Help - // //sLineNumber=String.valueOf(iLineNumber);// - // writeBuffer.append("\t\t\n");//always translate - // if(isUsed((String)this.data.get("SourceHText"))) - // writeBuffer.append("\t\t\t"+xmlString((String)this.data.get("SourceHText"))+"\n"); - // if(isUsed((String)this.data.get("TargetHText"))) - // writeBuffer.append("\t\t\t"+xmlString((String)this.data.get("TargetHText"))+"\n"); - // writeBuffer.append(allLinesEnd); - // Converter.countLine(); - // } - - if (!(this.data.get("SourceQText").equals("") || this.data.get( - "SourceQText").equals(" "))) { - sRessource = "res-QuickHelp"; // Source is OuickHelp - // sLineNumber=String.valueOf(iLineNumber);// - writeBuffer.append("\t\t\t\n");// always translate - if (isUsed((String) this.data.get("SourceQText"))) - writeBuffer.append("\t\t\t\t" - + DirtyTagWrapper.wrapString((String) this.data.get("SourceQText")) - + "\n"); - if (isUsed((String) this.data.get("TargetQText"))) - writeBuffer - .append("\t\t\t\t" - + DirtyTagWrapper.wrapString((String) this.data - .get("TargetQText")) + "\n"); - writeBuffer.append(allLinesEnd); - Converter.countLine(); - } - - if (!(this.data.get("SourceTitle").equals("") || this.data.get( - "SourceTitle").equals(" "))) { - sRessource = "res-Title"; // Source is Title - - writeBuffer.append("\t\t\t\n");// always translate - if (isUsed((String) this.data.get("SourceTitle"))) - writeBuffer.append("\t\t\t\t" - + DirtyTagWrapper.wrapString((String) this.data.get("SourceTitle")) - + "\n"); - if (isUsed((String) this.data.get("TargetTitle"))) - writeBuffer - .append("\t\t\t\t" - + DirtyTagWrapper.wrapString((String) this.data - .get("TargetTitle")) + "\n"); - writeBuffer.append(allLinesEnd); - Converter.countLine(); - } - this.write(writeBuffer.toString()); - }catch(Exception e){ - OutputHandler.log(e.getMessage()); - } - } - - /** - * Create the XLIFFFiles Header - * - * @return the header as string - * @throws java.io.UnsupportedEncodingException - */ - private String getHeader() throws java.io.UnsupportedEncodingException { - return new String( - (getProcessingInstructionTag() + getDTDLine() - + openVersionLine() + openFileLine() + getHeaderTag() + openBodyTag()) - .getBytes(), "UTF8"); - - } - - /** - * Create the XLIFFFiles Trailer - * - * @return the trailer as string - */ - private String getTrailer() { - return closeBodyTag() + closeFileLine() + closeVersionLine(); - } - - /** - * Create the Processing Instruction Tag used by this XLIFFFile - * @return the Processing Instruction Tag used by this XLIFFFile - */ - private String getProcessingInstructionTag() { - String sPITagStart = ""; - return sPITagStart + sPIName + sPIVersion + sPIEncoding - + /* sPIStandalone+ */sPITagEnd + '\n'; - } - - /** - * Create the line holding the DTD referenced by this XLIFFFile - * @return a string holding the DTD referenced by this XLIFFFile - */ - private String getDTDLine() { - String sDTDTagStart = "";// http://www.oasis-open.org/committees/xliff/documents/ - String sDTSTagEnd = ">"; - return sDTDTagStart + sDTDType + sDTDSource + '\n'; - } - - /** - * Create the beginning of the line holding the version of this XIFFFile - * - * @return a string with the beginning of the line holding the version of this XIFFFile - */ - private String openVersionLine() { - return "\n"; - } - /** - * Create the ending of the line holding the version of this XIFFFile - * - * @return a string with the ending of the line holding the version of this XIFFFile - */ - private String closeVersionLine() { - return ""; - } - /** - * Create the beginning of the line holding the file tag of this XIFFFile - * - * @return a string with the beginning of the file tag of this XIFFFile - */ - private String openFileLine() { - - String FileTagStart = "\t"; - } - /** - * Create a String containing the header tag - * @return the String containing the header tag - */ - private String getHeaderTag() { - return "
\n"; - } - /** - * Create the begining of the line holding the body tag of this XIFFFile - * - * @return a string with the begining of the body tag of this XIFFFile - */ - private String openBodyTag() { - return "\t\t\n"; - } - /** - * Create the ending of the line holding the body tag of this XIFFFile - * - * @return a string with the ending of the body tag of this XIFFFile - */ - private String closeBodyTag() { - return "\t\t"; - } - - /* - * (non-Javadoc) - * - * @see com.sun.star.tooling.converter.DataWriter#writeData(java.util.Map[]) - */ - protected void writeData(Map[] data) throws IOException { - // TODO Auto-generated method stub - - } - - /* - * (non-Javadoc) - * - * @see com.sun.star.tooling.converter.DataWriter#getDataFrom(com.sun.star.tooling.converter.DataHandler) - */ - protected void getDataFrom(DataHandler handler) { } - -} diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/dtd/xliff.dtd b/transex3/java/l10nconv/java/com/sun/star/tooling/converter/dtd/xliff.dtd deleted file mode 100755 index 91262ec28204..000000000000 --- a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/dtd/xliff.dtd +++ /dev/null @@ -1,391 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/languageResolver/LanguageResolver.java b/transex3/java/l10nconv/java/com/sun/star/tooling/languageResolver/LanguageResolver.java deleted file mode 100755 index 62ff008156ab..000000000000 --- a/transex3/java/l10nconv/java/com/sun/star/tooling/languageResolver/LanguageResolver.java +++ /dev/null @@ -1,201 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: LanguageResolver.java,v $ - * $Revision: 1.3 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -/* - * Created on 2005 - * by Christian Schmidt - */ -package com.sun.star.tooling.languageResolver; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.util.ArrayList; -import java.util.ListIterator; - -/** - * Translate language codes into another format - * between ISO, RFC3066 and numeric - * - * @author Christian Schmidt 2005 - * - */ -public class LanguageResolver { - private final static int ISO =2; - private final static int LANGID =0; - private final static int LANGNAME =1; - private final static int RFC3066 =3; - - ArrayList languages=new ArrayList(); - -// public static void main(String[] args){ -// try { -// LanguageResolver lr=new LanguageResolver(); -// } catch (IOException e) { -// // -// e.printStackTrace(); -// } -// } - - /** - * Create a new Instance of LanguageResolver - * - * @throws IOException - */ - public LanguageResolver() throws IOException{ - String lang = "com/sun/star/tooling/languageResolver/lang.map"; - ClassLoader cl = this.getClass().getClassLoader(); - InputStream in = cl.getResourceAsStream(lang); - BufferedReader languageTable= new BufferedReader(new InputStreamReader(in)); - - String line; - - while((line=(languageTable.readLine()))!=null){ - languages.add(line.split(",")); - } - } - /** - * Get the numeric value of the given ISO Language Code - * - * @param isoCode the ISO Language Code to find - * @return numeric value of the given isoCode - * @throws LanguageResolvingException if the Language ISO Code is not known - */ - public String getNrFromISO(String isoCode) throws LanguageResolvingException{ - if("".equals(isoCode)) return ""; - ListIterator iter=languages.listIterator(); - String[] line=new String[5]; - while(isoCode!="" && iter.hasNext()){ - line=(String[]) iter.next(); - if(line[ISO].equals(isoCode)) return line[LANGID]; - } - throw new LanguageResolvingException("Can not find ISO Code: "+isoCode ); - - } - - /** - * Get the ISO Language Code corresponding with the given Language ID - * - * @param ID the numeric language id to find - * @return the ISO Language Code corresponding with the given Language ID - * @throws LanguageResolvingException if the Language ID is not known - */ - public String getISOfromNr(String ID) throws LanguageResolvingException{ - if("".equals(ID)) return ""; - ListIterator iter=languages.listIterator(); - String[] line=new String[5]; - while(iter.hasNext()){ - line=(String[]) iter.next(); - if(line[LANGID].equals(ID)) return line[ISO]; - } - throw new LanguageResolvingException("Can not find Language Id: "+ID ); - } - - /** - * Get the RFC3066 value of the given ISO Language Code - * - * @param isoCode the ISO Language Code to find - * @return RFC3066 value of the given isoCode - * @throws LanguageResolvingException if the Language ISO Code is not known - */ - public String getRFCFromISO(String isoCode) throws LanguageResolvingException{ - if("".equals(isoCode)) return ""; - ListIterator iter=languages.listIterator(); - String[] line=new String[5]; - while(iter.hasNext()){ - line=(String[]) iter.next(); - if(line[ISO].equals(isoCode)) return line[RFC3066]; - } - throw new LanguageResolvingException("Can not find ISO Code: "+isoCode ); - } - - /** - * Get the ISO Language Code corresponding with the given RFC3066 code - * - * @param RFC RFC3066 language id to find - * @return the ISO Language Code corresponding with the given RFC3066 code - * @throws LanguageResolvingException if the RFC3066 code is not known - */ - public String getISOFromRFC(String RFC) throws LanguageResolvingException{ - if("".equals(RFC)) return ""; - ListIterator iter=languages.listIterator(); - String[] line=new String[5]; - while(iter.hasNext()){ - line=(String[]) iter.next(); - if(line[RFC3066].equals(RFC)) return line[ISO]; - } - throw new LanguageResolvingException("Can not find Language Id: "+RFC ); - } - - - /** - * This Exception is thrown if a Language Identfier is unknown - * - * @author Christian Schmidt 2005 - * - */ - public class LanguageResolvingException extends Exception { - - /** - * - */ - public LanguageResolvingException() { - super(); - // - } - - /** - * @param arg0 - */ - public LanguageResolvingException(String arg0) { - super(arg0); - // - } - - /** - * @param arg0 - * @param arg1 - */ - public LanguageResolvingException(String arg0, Throwable arg1) { - super(arg0, arg1); - // - } - - /** - * @param arg0 - */ - public LanguageResolvingException(Throwable arg0) { - super(arg0); - // - } - - } - -} diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/languageResolver/lang.map b/transex3/java/l10nconv/java/com/sun/star/tooling/languageResolver/lang.map deleted file mode 100755 index a43e8f5e0218..000000000000 --- a/transex3/java/l10nconv/java/com/sun/star/tooling/languageResolver/lang.map +++ /dev/null @@ -1,41 +0,0 @@ -1,English,en-US,en-US,1033 -3,Portuguese,pt,pt-PT,2070 -30,Greek,el,el-GR,1032 -33,French,fr,fr-FR,1036 -35,Finnish,fi,fi-FI,1035 -39,Italian,it,it-IT,1040 -43,Slowak,sk,sk-SK,1051 -46,Swedish,sv,sv-SE,1053 -48,Polish,pl,pl-PL,1045 -55,Portuguese (Brasil),pt-BR,pt-BR,2070 -82,Korean,ko,ko-KR,1042 -88,Chinese (traditional),zh-TW,zh-TW,1028 -96,Arabic,ar,,1025 -97,Hebrew,he,he-IL,1037 -7,Russian,ru,ru-RU,1049 -31,Dutch,nl,nl-NL,1043 -34,Spanish,es,es-ES,1034 -36,Hungarian,hu,hu-HU,1038 -42,Czech,cs,cs-CZ,1029 -45,Danish,da,da-DK,1030 -47,Norwegian (Bokmal),nb,nb-NB,1044 -49,German,de,de-DE,1031 -81,Japanese,ja,ja-JP,1041 -86,Chinese (simple),zh-CN,zh-CN,2052 -90,Turkish,tr,tr-TR,1055 -37,Catalan,ca,, -66,Thai,th,th-TH, -91,Hindi,hi-IN,hi-IN, -77,Estonian,et,et, -50,Slovenian,sl,sl, -79,Norwegian Nynorsk,nn,nn-NN, -53,Welsh,cy,cy, -27,Afrikaans,af,af-ZA, -38,Galician,gl-ES,gl-ES, -58,Lithuanian,lt,lt-LT, -29,Tswana,tn,tn-TN, -76,Khmer ( Cambodia ),km,km, -26,Northern Sotho,ns,ns-ZA, -28,Zulu,zu,zu-ZA, -10,Basque,eu,eu-ES, -93,Kannada,kn,kn-KN, \ No newline at end of file diff --git a/transex3/java/l10nconv/makefile.mk b/transex3/java/l10nconv/makefile.mk deleted file mode 100755 index feb869778e80..000000000000 --- a/transex3/java/l10nconv/makefile.mk +++ /dev/null @@ -1,39 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.3 $ -# -# 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 -# -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=../.. -PRJNAME=transex3 -TARGET=converter - -.INCLUDE : ant.mk - -ALLTAR : ANTBUILD - diff --git a/transex3/java/receditor/build.xml b/transex3/java/receditor/build.xml deleted file mode 100755 index 34f02128f034..000000000000 --- a/transex3/java/receditor/build.xml +++ /dev/null @@ -1,173 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/transex3/java/receditor/java/transex3/controller/EditorController.java b/transex3/java/receditor/java/transex3/controller/EditorController.java deleted file mode 100644 index 38462d665304..000000000000 --- a/transex3/java/receditor/java/transex3/controller/EditorController.java +++ /dev/null @@ -1,334 +0,0 @@ -package transex3.controller; - -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.*; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.io.BufferedReader; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStreamReader; -import java.lang.Runtime; -import java.util.*; - -import javax.swing.ListSelectionModel; -import javax.swing.WindowConstants; -import javax.swing.event.*; - -import transex3.model.*; - -import java.io.*; -import javax.swing.*; -//import transex3.model.*; -public class EditorController { - public final String[] RESTYPES = { ".src",".hrc",".xcu",".xrm",".xhp" }; - public final String RECFILE = ".recommand"; - // Editor View - static transex3.view.Editor aEditor = null; - // Editor Model - static Vector sdfstrings = new Vector(); - static HashMap hashedsdfstrings = new HashMap(); - int oldindex = 0; - //HashMap hashedfilenames = new HashMap(); - // Search for source Strings - public String fetchSourceStrings( String rootdir ){ - - //String outputfile = "h:\\workspace\\recommandEditor\\null2"; - File tempfile = null; - - try { - tempfile = File.createTempFile( "receditor" , "tmp" ); - } catch (IOException e1) { - // TODO Auto-generated catch block - System.err.println("Can not create temp file\n"); - e1.printStackTrace(); - } - - String outputfile = tempfile.getAbsolutePath(); - try - { - //System.out.println("localize_sl -QQ -skip_links -e -l en-US -f "+outputfile+" -d "+rootdir); - System.out.println("localize_sl -QQ -skip_links -e -l en-US -f "+outputfile ); - java.lang.Process aProc = Runtime.getRuntime().exec("localize_sl -QQ -skip_links -e -l en-US -f "+outputfile); - - //java.lang.Process aProc = Runtime.getRuntime().exec("localize_sl -QQ -e -l en-US -f "+outputfile+" -d "+rootdir); - BufferedReader aBR = new BufferedReader( new InputStreamReader( aProc.getInputStream() ) ); - String line = aBR.readLine(); - while( line != null && line.length() > 0 ){ - //System.out.print( line ); - line = aBR.readLine(); - } - - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return outputfile; - } - // Search for recommand files - public void findRecommandFiles( File rootdir , Vector list ){ - System.out.print("."); - System.out.flush(); - File[] aFileArray = rootdir.listFiles(); - if( aFileArray != null ){ - for( int cnt = 0; aFileArray.length > cnt ; cnt++ ){ - if( aFileArray[ cnt ].isDirectory() && !aFileArray[ cnt ].getAbsolutePath().endsWith(".lnk") ) - findRecommandFiles( aFileArray[ cnt ] , list); - else if( aFileArray[ cnt ].isFile() && isRecommandFile( aFileArray[ cnt ] ) ) - list.add( aFileArray[ cnt ]); - } - } - } - private boolean isResourceType( File aFile ){ - String filename = aFile.getName(); - boolean isResType = false; - for(int cnt = 0; cnt < RESTYPES.length ; cnt++){ - if( filename.endsWith( RESTYPES[ cnt ] ) ) - isResType = true; - } - return isResType; - } - private boolean isRecommandFile( File aFile ){ - return aFile.getName().endsWith( RECFILE ); - } - public void clearAllRows( JTable aTable ){ - for ( int n = 0; n < aTable.getRowCount() ; n++ ){ - aTable.setValueAt( null , n , 0 ); - aTable.setValueAt( null , n , 1 ); - aTable.setValueAt( null , n , 2 ); - aTable.setValueAt( null , n , 3 ); - aTable.setValueAt( null , n , 4 ); - } - } - // Add all data to view - void updateData(){ - JTable recTable =transex3.controller.EditorController.aEditor.getRectable(); - - SdfString aSdfString = (SdfString) sdfstrings.get( oldindex ); - Vector newStrings = new Vector(); - for ( int n = 1; n < recTable.getRowCount() ; n++ ){ - String lang = (String) recTable.getValueAt(n , 0 ); - String text = (String) recTable.getValueAt(n , 1 ); - String htext = (String) recTable.getValueAt(n , 2 ); - String qhtext = (String) recTable.getValueAt(n , 3 ); - String ttext = (String) recTable.getValueAt(n , 4 ); - if( lang != null && text != null ){ - //System.out.println("Data "+ lang + " " + text ); - SdfEntity aSdfEntity = new SdfEntity(); - aSdfEntity.setLangid( lang ); - aSdfEntity.setText( text ); - aSdfEntity.setHelptext( htext ); - aSdfEntity.setQuickhelptext( qhtext ); - aSdfEntity.setTitle( ttext ); - newStrings.add( aSdfEntity ); - aSdfString.setLanguageStrings( newStrings ); - } - } - } - - public void initView(){ - Object[][] sourceStringData = new Object[ sdfstrings.size() ][ 4 ]; - Object[][] firstData = new Object[100][5]; - // Set the files - Iterator aIter = sdfstrings.iterator(); - int counter = 0; - while( aIter.hasNext() ){ - SdfString aSdfString = (SdfString) aIter.next(); - sourceStringData[ counter ][ 0 ] = aSdfString.getSourceString().getProject()+"\\"+aSdfString.getSourceString().getSource_file(); - sourceStringData[ counter ][ 1 ] = aSdfString.getSourceString().getGid(); - sourceStringData[ counter ][ 2 ] = aSdfString.getSourceString().getLid(); - sourceStringData[ counter ][ 3 ] = aSdfString.getSourceString().getText(); - if( counter == 0 ){ - firstData[ 0 ][ 0 ] = "en-US"; - firstData[ 0 ][ 1 ] = aSdfString.getSourceString().getText(); - firstData[ 0 ][ 2 ] = aSdfString.getSourceString().getHelptext(); - firstData[ 0 ][ 3 ] = aSdfString.getSourceString().getQuickhelptext(); - firstData[ 0 ][ 4 ] = aSdfString.getSourceString().getTitle(); - aSdfString = (SdfString) sdfstrings.get( 0 ); - Vector values = aSdfString.getLanguageStrings(); - for( int n = 0; n < values.size() ; n++ ) - { - SdfEntity aEntity = (SdfEntity) values.get( n ); - firstData[ n+1 ][ 0 ] = aEntity.getLangid(); - firstData[ n+1 ][ 1 ] = aEntity.getText(); - firstData[ n+1 ][ 2 ] = aEntity.getHelptext(); - firstData[ n+1 ][ 3 ] = aEntity.getQuickhelptext(); - firstData[ n+1 ][ 4 ] = aEntity.getTitle(); - } - } - counter++; - } - // Set the source srtings - - - //aEditor = new transex3.view.Editor( sourceStringData , filedata.toArray() ); - aEditor = new transex3.view.Editor( sourceStringData , firstData ); - - aEditor.setBounds(100,100,800,900); - aEditor.setDefaultCloseOperation( WindowConstants.DISPOSE_ON_CLOSE ); - aEditor.setVisible(true); - aEditor.repaint(); - aEditor.addWindowListener( new WindowAdapter(){ - public void windowClosed(WindowEvent e ){ - System.exit( 0 ); - } - }); - - aEditor.getMiExit().addActionListener( new ActionListener(){ - public void actionPerformed( ActionEvent e ){ - System.exit( 0 ); - } - }); - - aEditor.getMiSave().addActionListener( new ActionListener(){ - public void actionPerformed( ActionEvent e ){ - Iterator aIter = sdfstrings.iterator(); - String lastFile=""; - while( aIter.hasNext() ) - { - SdfString aSdfString = (SdfString )aIter.next(); - if( aSdfString.getFileId().compareTo( lastFile ) != 0 ){ - //aSdfString.removeFile(); - } - aSdfString.writeString(); - lastFile = aSdfString.getFileId(); - } - } - }); - - //aEditor.getRectable().putClientProperty("terminateEditOnFocusLost", Boolean.TRUE); - aEditor.getRectable().addFocusListener( new FocusListener(){ - public void focusLost(FocusEvent e){ - //super.focusLost( e ); - //System.out.println("focus lost"); - JTable aTable = aEditor.getRectable(); - if( aTable.getSelectedRow() != -1 && aTable.getSelectedColumn() != -1 ) - aTable.getCellEditor( aTable.getSelectedRow(), aTable.getSelectedColumn() ).stopCellEditing(); - updateData(); - } - public void focusGained( FocusEvent e){ - //super.focusGained( e ); - //System.out.println("focus gained"); - } - }); - //setDefaultEditor(Object.class, new transex3.view.FocusCellEditor(new JTextField())); - - aEditor.getRectable().getModel().addTableModelListener( new TableModelListener() { - public void tableChanged( TableModelEvent e ){ - //System.out.println( e ); - }}); - - - aEditor.getRectable().getSelectionModel().addListSelectionListener( new ListSelectionListener(){ - public void valueChanged( ListSelectionEvent e ){ - JTable aTable = aEditor.getRectable(); - //if( aTable.getSelectedRow() != -1 && aTable.getSelectedColumn() != -1 ) - //aTable.getCellEditor( aTable.getSelectedRow(), aTable.getSelectedColumn() ).stopCellEditing(); - - updateData(); - } - }); - - aEditor.getTable().setSelectionMode( ListSelectionModel.SINGLE_SELECTION ); - aEditor.getTable().getSelectionModel().addListSelectionListener( new ListSelectionListener(){ - public void valueChanged( ListSelectionEvent e ){ - //System.out.println("Selected = " +e.getFirstIndex()+"\n"); - JTable table =transex3.controller.EditorController.aEditor.getTable(); - JTable recTable =transex3.controller.EditorController.aEditor.getRectable(); - SdfString aSdfString; - JTable aTable = aEditor.getRectable(); - if( aTable.getSelectedRow() != -1 && aTable.getSelectedColumn() != -1 ) - aTable.getCellEditor( aTable.getSelectedRow(), aTable.getSelectedColumn() ).stopCellEditing(); - - updateData(); - clearAllRows( recTable ); - - aSdfString = (SdfString) sdfstrings.get( table.getSelectedRow() ); - recTable.setValueAt( "en-US" , 0, 0 ); - recTable.setValueAt( aSdfString.getSourceString().getText() , 0, 1 ); - recTable.setValueAt( aSdfString.getSourceString().getHelptext() , 0, 2 ); - recTable.setValueAt( aSdfString.getSourceString().getQuickhelptext() , 0, 3 ); - recTable.setValueAt( aSdfString.getSourceString().getTitle() , 0, 4 ); - Vector values = aSdfString.getLanguageStrings(); - for( int n = 0; n < values.size() ; n++ ) - { - SdfEntity aEntity = (SdfEntity) values.get( n ); - recTable.setValueAt( aEntity.getLangid() , n+1 , 0 ); - recTable.setValueAt( aEntity.getText() , n+1 , 1 ); - recTable.setValueAt( aEntity.getHelptext() , n+1 , 2 ); - recTable.setValueAt( aEntity.getQuickhelptext() , n+1 , 3 ); - recTable.setValueAt( aEntity.getTitle() , n+1 , 4 ); - } - oldindex = table.getSelectedRow(); - } - }); - //System.out.println("initView successfully"); - } - public void initInitialStrings(){ - String rootdir = java.lang.System.getProperty("SOLARSRC"); - String sourcestringsfile = null; - Vector recList = new Vector(); - sourcestringsfile = fetchSourceStrings( rootdir ); - //findRecommandFiles( new File( rootdir ) , recList ); - readStrings( sourcestringsfile , recList ); - File sfile = new File ( sourcestringsfile ); - sfile.delete(); - initView(); - aEditor.repaint(); - } - // Connect recommand strings with source strings - public void readStrings( String sourcefiles , Vector recfiles ) { - BufferedReader aBR = null; - try { - //System.out.println("DBG: sourcefiles = " +sourcefiles); - aBR = new BufferedReader( new FileReader( sourcefiles ) ); - String current = aBR.readLine(); - SdfString aSdfString = null; - SdfEntity aSdfEntity = null; - while( current != null ){ - aSdfEntity = new SdfEntity(); - aSdfEntity.setProperties( current ); - aSdfString = new SdfString(); - aSdfString.addSourceString( aSdfEntity ); - hashedsdfstrings.put( aSdfString.getId() , aSdfString ); - //System.out.println("Put ID '"+aSdfString.getId()+"'"); - sdfstrings.add( aSdfString ); - current = aBR.readLine(); - - } - Iterator aIter=recfiles.iterator(); - File aFile; - BufferedReader aBR2 = null; - //System.out.println("Connecting strings"); - while( aIter.hasNext() ){ - aFile = (File) aIter.next(); - aBR2 = new BufferedReader( new FileReader( aFile ) ) ; - String current2 = aBR2.readLine(); - - while ( current2 != null ){ - SdfEntity aEntity = new SdfEntity(); - aEntity.setProperties( current2 ); - - if( hashedsdfstrings.containsKey( aEntity.getId() ) ) - { - aSdfString = (SdfString) hashedsdfstrings.get( aEntity.getId() ); - aSdfString.addLanguageString( aEntity ); - } - else - { - System.out.println("DBG: Can't find source string '"+aEntity.getId()+"'" ); - } - current2 = aBR2.readLine(); - } - } - } catch (FileNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch ( IOException e){ - e.printStackTrace(); - } - - } -} diff --git a/transex3/java/receditor/java/transex3/controller/Main.java b/transex3/java/receditor/java/transex3/controller/Main.java deleted file mode 100644 index e8dd06ce9f85..000000000000 --- a/transex3/java/receditor/java/transex3/controller/Main.java +++ /dev/null @@ -1,10 +0,0 @@ -package transex3.controller; - -public class Main { - - public static void main( String args[] ){ - EditorController aEditor = new EditorController(); - aEditor.initInitialStrings(); - } -} - diff --git a/transex3/java/receditor/java/transex3/model/ResourceFile.java b/transex3/java/receditor/java/transex3/model/ResourceFile.java deleted file mode 100644 index 51fabb3a4b7a..000000000000 --- a/transex3/java/receditor/java/transex3/model/ResourceFile.java +++ /dev/null @@ -1,77 +0,0 @@ -package transex3.model; - -import java.util.*; - -public class ResourceFile { - Vector sdfStrings = new Vector(); - HashMap sdfHashMap = new HashMap(); - String filepathid = null; - String modulename = null; - String filename = null; - - - public String getModuleName(){ - return modulename; - } - public String getFilePath(){ - return filepathid; - } - public String getFileName(){ - return filename; - } -/* public List readSoureStrings( java.io.File aSdfFile ){ - List sdfList=null; - return sdfList; - };*/ - public void addString( SdfString aSdfstring ){ - sdfStrings.add( aSdfstring ); - sdfHashMap.put( aSdfstring.getFileId() , aSdfstring ); - if( filepathid == null ) - filepathid = aSdfstring.getFilePath(); - if( modulename == null ) - modulename = aSdfstring.getModuleName(); - if( filename == null ) - filename = aSdfstring.getFileName(); - } - - - public void ParseString( String aSourceString ){ - //sourceString = new SdfEntity(); - SdfEntity aSdfEntity = new SdfEntity(); - aSdfEntity.setProperties( aSourceString ); - SdfString sdfstring = null; - if( sdfHashMap.containsKey( aSdfEntity.getFileId() ) ){ - sdfstring = (SdfString) sdfHashMap.get( aSdfEntity.getFileId() ); - } - else - { - sdfstring = new SdfString(); - addString( sdfstring ); - } - sdfstring.addLanguageString( aSdfEntity ); - - - } - /*public void ParseSdfFile( java.util.Vector aSdfList ){ - ListIterator aLI = aSdfList.listIterator(); - String current; - String[] splitted; - SdfEntity aSdfEntity; - SdfString aSdfString = new SdfString(); - while( aLI.hasNext() ){ - aSdfEntity = new SdfEntity(); - aSdfEntity.setProperties( (String) aLI.next() ); - SdfString aString; - - if( sdfHashMap.containsKey( aSdfEntity.getFileId() ) ) - aString = (SdfString) sdfHashMap.get( aSdfEntity.getFileId() ); - else - { - aString = new SdfString(); - addString( aString ); - } - aString.addLanguageString( aSdfEntity ); - } - - }*/ -} diff --git a/transex3/java/receditor/java/transex3/model/SdfEntity.java b/transex3/java/receditor/java/transex3/model/SdfEntity.java deleted file mode 100644 index 4b293421fd28..000000000000 --- a/transex3/java/receditor/java/transex3/model/SdfEntity.java +++ /dev/null @@ -1,211 +0,0 @@ -package transex3.model; - -public class SdfEntity { - private String project; - private String source_file; - private String dummy1; - private String resource_type; - private String gid; - private String lid; - private String helpid; - private String platform; - private String dummy2; - private String langid; - private String text; - private String helptext; - private String quickhelptext; - private String title; - private String date; - - public static int PROJECT_POS = 0; - public static int SOURCE_FILE_POS = 1; - public static int DUMMY1_POS = 2; - public static int RESOURCE_TYPE_POS = 3; - public static int GID_POS = 4; - public static int LID_POS = 5; - public static int HELPID_POS = 6; - public static int PLATFORM_POS = 7; - public static int DUMMY2_POS = 8; - public static int LANGID_POS = 9; - public static int TEXT_POS = 10; - public static int HELPTEXT_POS = 11; - public static int QUICKHELPTEXT_POS = 12; - public static int TITLE_POS = 13; - public static int DATE_POS = 14; - - public SdfEntity(){} - public SdfEntity(String project, String source_file, String dummy1, String resource_type, String gid, String lid, String helpid, String platform, String dummy2, String langid, String text, String helptext, String quickhelptext, String title , String date) { - super(); - this.project = project; - this.source_file = source_file; - this.dummy1 = dummy1; - this.resource_type = resource_type; - this.gid = gid; - this.lid = lid; - this.helpid = helpid; - this.platform = platform; - this.dummy2 = dummy2; - this.langid = langid; - this.text = text; - this.helptext = helptext; - this.quickhelptext = quickhelptext; - this.title = title; - this.date = date; - } - - public void setProperties( String line ){ - - String[] splitted = line.split("\t"); - - setProject( splitted[ SdfEntity.PROJECT_POS ] ); - setSource_file( splitted[ SdfEntity.SOURCE_FILE_POS ] ); - setDummy1( splitted[ SdfEntity.DUMMY1_POS ] ); - setResource_type( splitted[ SdfEntity.RESOURCE_TYPE_POS ] ); - setGid( splitted[ SdfEntity.GID_POS ] ); - setLid( splitted[ SdfEntity.LID_POS ] ); - setHelpid( splitted[ SdfEntity.HELPID_POS ] ); - setPlatform( splitted[ SdfEntity.PLATFORM_POS ] ); - setDummy2( splitted[ SdfEntity.DUMMY2_POS ] ); - setLangid( splitted[ SdfEntity.LANGID_POS ] ); - setText( splitted[ SdfEntity.TEXT_POS ] ); - setHelptext( splitted[ SdfEntity.HELPTEXT_POS ] ); - setQuickhelptext( splitted[ SdfEntity.QUICKHELPTEXT_POS ] ); - setTitle( splitted[ SdfEntity.TITLE_POS ] ); - setDate( splitted[ SdfEntity.DATE_POS ] ); - } - - public String getFileId(){ - return project+"\\"+source_file; - } - public String getResourcePath(){ - return source_file.substring(0 , source_file.lastIndexOf( "\\" )-1 ); - } - public String toString(){ - return project+"\t"+source_file+"\t"+dummy1+"\t"+resource_type+"\t"+gid+"\t" - +lid+"\t"+helpid+"\t"+platform+"\t"+dummy2+"\t"+langid+"\t" - +text+"\t"+helptext+"\t"+quickhelptext+"\t"+title+"\t"+date; - } - public String getId(){ - return project+gid+lid+source_file+resource_type+platform+helpid; - } - - public String getDummy1() { - return dummy1; - } - - public void setDummy1(String dummy1) { - this.dummy1 = dummy1; - } - - public String getPlatform() { - return platform; - } - - public void setPlatform(String platform) { - this.platform = platform; - } - - public String getDummy2() { - return dummy2; - } - - public void setDummy2(String dummy2) { - this.dummy2 = dummy2; - } - - public String getGid() { - return gid; - } - - public void setGid(String gid) { - this.gid = gid; - } - - public String getHelpid() { - return helpid; - } - - public void setHelpid(String helpid) { - this.helpid = helpid; - } - - public String getHelptext() { - return helptext; - } - - public void setHelptext(String helptext) { - this.helptext = helptext; - } - - public String getLangid() { - return langid; - } - - public void setLangid(String langid) { - this.langid = langid; - } - - public String getLid() { - return lid; - } - - public void setLid(String lid) { - this.lid = lid; - } - - public String getProject() { - return project; - } - - public void setProject(String project) { - this.project = project; - } - - public String getQuickhelptext() { - return quickhelptext; - } - - public void setQuickhelptext(String quickhelptext) { - this.quickhelptext = quickhelptext; - } - - public String getResource_type() { - return resource_type; - } - - public void setResource_type(String resource_type) { - this.resource_type = resource_type; - } - - public String getSource_file() { - return source_file; - } - - public void setSource_file(String source_file) { - this.source_file = source_file; - } - - public String getText() { - return text; - } - - public void setText(String text) { - this.text = text; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - public String getDate() { - return date; - } - public void setDate(String date) { - this.date = date; - } - - -} diff --git a/transex3/java/receditor/java/transex3/model/SdfString.java b/transex3/java/receditor/java/transex3/model/SdfString.java deleted file mode 100644 index 7419aeb5578b..000000000000 --- a/transex3/java/receditor/java/transex3/model/SdfString.java +++ /dev/null @@ -1,192 +0,0 @@ -package transex3.model; -import java.util.*; -import java.io.*; -public class SdfString { - private SdfEntity sourceString = null; - //private java.util.HashMap languageStrings = new HashMap(); - private Vector languageList = new Vector(); - private String id = null; - private String fileid = null; - private String filename = null; - private String modulename = null; - private String filepath = null; - - /*public HashMap getLanguageStrings() { - return languageStrings; - }*/ - public Vector getLanguageStrings() { - return languageList; - } - - public void setLanguageStrings(Vector languageStrings) { - this.languageList = languageStrings; - } - - public void addSourceString( SdfEntity aSdfEntity ) - { - if( id == null ) - id = aSdfEntity.getId(); - if ( fileid == null ) - fileid = aSdfEntity.getFileId(); - if( modulename == null ) - modulename = aSdfEntity.getProject(); - if( filename == null ) - filename = aSdfEntity.getSource_file(); - if( filepath == null ) - filepath = aSdfEntity.getResourcePath(); - setSourceString( aSdfEntity ); - } - public void addLanguageString( SdfEntity aSdfEntity ){ - if( !aSdfEntity.getLangid().equals( "en-US" ) ) - { - if( id == null ) - id = aSdfEntity.getId(); - if ( fileid == null ) - fileid = aSdfEntity.getFileId(); - if( modulename == null ) - modulename = aSdfEntity.getProject(); - if( filename == null ) - filename = aSdfEntity.getSource_file(); - if( filepath == null ) - filepath = aSdfEntity.getResourcePath(); - - //if( aSdfEntity.getLangid().equals( "en-US" ) ) - //{ - // setSourceString( aSdfEntity ); - //} - //else - //{ - //languageStrings.put( aSdfEntity.getLangid() , aSdfEntity ); - languageList.add( aSdfEntity ); - //} - id = aSdfEntity.getId(); - } - } - - public SdfEntity getSourceString() { - return sourceString; - } - - public void setSourceString(SdfEntity sourceString) { - this.sourceString = sourceString; - id = sourceString.getId(); - } - public String getFilePath(){ - return filepath; - } - public String getId(){ - //return id; - return sourceString.getId(); - } - public String getFileId(){ - return fileid; - } - - public String getFileName() { - return filename; - } - - public void setFileName(String filename) { - this.filename = filename; - } - - public String getModuleName() { - return modulename; - } - - public void setModuleName(String modulename) { - this.modulename = modulename; - } - /* - public String getRealFileName(){ - //String srcroot = "U:\\cws01\\l10ncleanup\\SRC680\\src.m213";//java.lang.System.getProperty( "SOLARSRC"); - //String isWindows = "4nt";//java.lang.System.getProperty( "USE_SHELL"); - String srcroot = java.lang.System.getProperty( "SOLARSRC" ); - String isWindows = java.lang.System.getProperty( "USE_SHELL" ); - - //System.out.println("srcroot="+srcroot+" isWindows="+isWindows ); - //if( true ) return; - //String relpath = sourceString.getFileId().substring( sourceString.getFileId().lastIndexOf("\\") - // , sourceString.getFileId().length() ); - String filename; - if( isWindows != null && isWindows.compareTo( "4nt") == 0 ) - { - filename = srcroot + "\\" + //sourceString.getProject() + "\\" + - sourceString.getFileId() +".recommand"; - } - else - { - String filepart = sourceString.getFileId(); - filepart = filepart.replaceAll( "\\\\" , "/" ); - filename = srcroot + "/" + //sourceString.getProject() + "//" + - filepart +".recommand"; - } - return filename; - }*/ - public String getRealFileName(){ - String filepart = sourceString.getFileId(); - filepart = filepart.replaceAll( "\\\\" , "_" ); - String filename = "/so/ws/merge/In/" + java.lang.System.getProperty( "WORK_STAMP" ) + "/" + filepart + ".sdf"; - return filename; - } - public void removeFile(){ - String filename = getRealFileName(); - File aFile = new File( filename ); - if( aFile.exists() ){ - if( ! aFile.delete() ) - { - System.out.println("Can't delete File "+filename+"\nWrong access rights?\n"); - } - } - } - public void writeString(){ - String filename = getRealFileName(); - try { - if( languageList.size() > 0 ) - { - System.out.print("\nWrite to "+filename ); - BufferedWriter aBW = new BufferedWriter( new FileWriter( filename , true) ); - aBW.write( sourceString + "\n" ); - Iterator aIter = languageList.iterator(); - while( aIter.hasNext() ){ - SdfEntity aEntity = (SdfEntity)aIter.next(); - aBW.write( sourceString.getProject()+"\t" ); - aBW.write( sourceString.getSource_file()+"\t" ); - aBW.write( sourceString.getDummy1()+"\t" ); - aBW.write( sourceString.getResource_type()+"\t" ); - aBW.write( sourceString.getGid()+"\t" ); - aBW.write( sourceString.getLid()+"\t" ); - aBW.write( sourceString.getHelpid()+"\t" ); - aBW.write( sourceString.getPlatform()+"\t" ); - aBW.write( sourceString.getDummy2()+"\t" ); - if( aEntity.getLangid() == null ) - aBW.write( "\t" ); - else - aBW.write( aEntity.getLangid()+"\t" ); - if( aEntity.getText() == null ) - aBW.write( "\t" ); - else - aBW.write( aEntity.getText()+"\t" ); - if( aEntity.getHelptext() == null ) - aBW.write( "\t" ); - else - aBW.write( aEntity.getHelptext()+"\t" ); - if( aEntity.getQuickhelptext() == null ) - aBW.write( "\t" ); - else - aBW.write( aEntity.getQuickhelptext()+"\t" ); - if( aEntity.getTitle() == null ) - aBW.write( "\t" ); - else - aBW.write( aEntity.getTitle()+"\t" ); - aBW.write( "2002-02-02 02:02:02\n" ); - } - aBW.close(); - } - } catch (IOException e) { - // TODO Auto-generated catch block - //e.printStackTrace(); - System.out.println("\nERROR: Can't write to file '"+filename+"'\nPlease contact RE/Tooling!"); - } - } -} diff --git a/transex3/java/receditor/java/transex3/view/Editor.java b/transex3/java/receditor/java/transex3/view/Editor.java deleted file mode 100644 index f46a82a11a2b..000000000000 --- a/transex3/java/receditor/java/transex3/view/Editor.java +++ /dev/null @@ -1,97 +0,0 @@ -package transex3.view; -import javax.swing.*; -import java.awt.*; - -public class Editor extends JFrame{ - Object[] columnnames = { "File" , "GID" , "LID" , "String" }; - Object[] stringcolnames = { "Language", "Text", "Helptext" , "Quickhelptext","Title"}; - //Object[][] data = new Object[4][1];//{ { "a " }, { "v " }, { "v " } , { "a " } }; - JTable table = null; - JTable rectable = null; - JComboBox cBox = null; - JMenuBar menubar = null; - JMenu filemenu = null; - JMenuItem miNew = null; - JMenuItem miSave = null; - JMenuItem miExit = null; - //JButton button = null; - - public Editor( Object[][] tabledata , Object[][] firstdata ){ - table = new JTable( tabledata , columnnames ); - rectable = new SdfTable( firstdata , stringcolnames ); - menubar = new JMenuBar(); - filemenu = new JMenu("File"); - //miNew = new JMenuItem("New"); - miSave = new JMenuItem("Save"); - miExit = new JMenuItem("Exit"); - //button = new JButton("Edit"); - //filemenu.add( miNew ); - filemenu.add( miSave ); - filemenu.add( miExit ); - menubar.add( filemenu ); - - Container contentPane = getContentPane(); - //contentPane.add( new ControlPanel() , BorderLayout.NORTH ); - contentPane.add( menubar , BorderLayout.NORTH ); - //JPanel aPanel = new JPanel( new FlowLayout( FlowLayout.CENTER) ); - JPanel aPanel = new JPanel( new GridLayout( 2,1 ) ); - aPanel.add( new JScrollPane( table ) ); - aPanel.add( new JScrollPane( rectable ) ); - contentPane.add( aPanel , BorderLayout.CENTER ); - //contentPane.add( button , BorderLayout.SOUTH ); - //contentPane.add( new JScrollPane( table ), BorderLayout.CENTER ); - //contentPane.add( new JScrollPane( table ), BorderLayout.SOUTH ); - //contentPane.add( new JScrollPane( rectable ), BorderLayout.SOUTH ); - //contentPane.add( new JScrollPane( rectable ), BorderLayout.SOUTH ); - this.repaint(); - - } - - public JTable getRectable() { - return rectable; - } - - public void setRectable(JTable rectable) { - this.rectable = rectable; - } - - public JTable getTable() { - return table; - } - - public void setTable(JTable table) { - this.table = table; - } - - /*public JButton getButton() { - return button; - } - - public void setButton(JButton button) { - this.button = button; - }*/ - - public JMenuItem getMiExit() { - return miExit; - } - - public void setMiExit(JMenuItem miExit) { - this.miExit = miExit; - } - - public JMenuItem getMiSave() { - return miSave; - } - - public void setMiSave(JMenuItem miSave) { - this.miSave = miSave; - } - - /*public void setTableData(){ - - }*/ - -} - -//class ControlPanel extends JPanel{} - diff --git a/transex3/java/receditor/java/transex3/view/SdfTable.java b/transex3/java/receditor/java/transex3/view/SdfTable.java deleted file mode 100644 index f0cc7bd84a34..000000000000 --- a/transex3/java/receditor/java/transex3/view/SdfTable.java +++ /dev/null @@ -1,24 +0,0 @@ -package transex3.view; - -import javax.swing.JTable; - -class SdfTable extends JTable{ - //private String tableId; - public SdfTable( Object[][] obj1 , Object[] obj2){ - super(obj1,obj2); - } - //@Override - public boolean isCellEditable(int row, int col) { - if( row == 0 && col == 0 || row == 0 && col == 1 || row == 0 && col == 2 || row == 0 && col == 3 || row == 0 && col == 4 ) - return false; - else - return true; - } - /*public String getTableId() { - return tableId; - } - public void setTableId(String tableId) { - this.tableId = tableId; - }*/ - -} \ No newline at end of file diff --git a/transex3/java/receditor/makefile.mk b/transex3/java/receditor/makefile.mk deleted file mode 100755 index e5e3921eea6b..000000000000 --- a/transex3/java/receditor/makefile.mk +++ /dev/null @@ -1,39 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.3 $ -# -# 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 -# -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=../.. -PRJNAME=transex3 -TARGET=receditor - -.INCLUDE : ant.mk - -ALLTAR : ANTBUILD - diff --git a/transex3/java/receditor/receditor.MF b/transex3/java/receditor/receditor.MF deleted file mode 100755 index dced97882df9..000000000000 --- a/transex3/java/receditor/receditor.MF +++ /dev/null @@ -1 +0,0 @@ -Main-Class: transex3.controller.Main diff --git a/transex3/layout/README b/transex3/layout/README deleted file mode 100644 index 1838e2a94ba0..000000000000 --- a/transex3/layout/README +++ /dev/null @@ -1,27 +0,0 @@ -Tralay - Extract and translate strings in Layout xml files. - -Translatable strings in layout xml files are attributes that have name -which starts with an underscore, eg - - _title="Set Zoom" - _label="Whole Page" - -Here is how it works - - * Extract: generate out.sdf - ../unxlngx6.pro/bin/tralay -l en-US zoom.xml > out.sdf - - * Translate: do: - cat out.sdf > trans.sdf - sed 's/en-US\t/de\tde:/' out.sdf >> trans.sdf - - * Merge: translate - ../unxlngx6.pro/bin/tralay -m trans.sdf -l de zoom.xml > zoom-DE.xml - -Running - - dmake test - -does something similar. - - \ No newline at end of file diff --git a/transex3/layout/layoutparse.cxx b/transex3/layout/layoutparse.cxx deleted file mode 100644 index 0f43c9a3053f..000000000000 --- a/transex3/layout/layoutparse.cxx +++ /dev/null @@ -1,139 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: layoutparse.cxx,v $ - * - * $Revision: 1.3 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "layoutparse.hxx" - -#define STRING( str ) String( str, RTL_TEXTENCODING_UTF8 ) -#define BSTRING( str ) ByteString( str, RTL_TEXTENCODING_UTF8 ) - -LayoutXMLFile::LayoutXMLFile( bool mergeMode ) - : XMLFile() - , mMergeMode( mergeMode ) -{ -} - -void -LayoutXMLFile::SearchL10NElements( XMLParentNode* pCur, int ) -{ - if ( !pCur ) - pCur = this; - - /* Recurse int children, SearchL10NElements does not do that for us. */ - if ( XMLChildNodeList* lst = pCur->GetChildList() ) - for ( ULONG i = 0; i < lst->Count(); i++ ) - if ( lst->GetObject( i )->GetNodeType() == XML_NODE_TYPE_ELEMENT ) - HandleElement( ( XMLElement* )lst->GetObject( i ) ); - else if ( lst->GetObject( i )->GetNodeType() == XML_NODE_TYPE_COMMENT ) - lst->Remove( i-- ); -} - -std::vector -interestingAttributes( XMLAttributeList* lst ) -{ - std::vector interesting; - if ( lst ) - for ( ULONG i = 0; i < lst->Count(); i++ ) - if ( lst->GetObject( i )->Equals( STRING( "id" ) ) ) - interesting.insert( interesting.begin(), lst->GetObject( i ) ); - else if ( ! BSTRING( *lst->GetObject( i ) ).CompareTo( "_", 1 ) ) - interesting.push_back( lst->GetObject( i ) ); - return interesting; -} - -void -LayoutXMLFile::HandleElement( XMLElement* element ) -{ - std::vector interesting = interestingAttributes( element->GetAttributeList() ); - - if ( interesting.size() ) - { - std::vector::iterator i = interesting.begin(); - - ByteString id = BSTRING( (*i++)->GetValue() ); - - if ( mMergeMode ) - InsertL10NElement( id, element ); - else - for ( ; i != interesting.end(); ++i ) - { - ByteString attributeId = id; - ByteString value = BSTRING( ( *i )->GetValue() ); - XMLElement *e = new XMLElement( *element ); - e->RemoveAndDeleteAllChilds(); - /* Copy translatable text to CONTENT. */ - //new XMLData( STRING( ( *i )->GetValue() ), e, true ); - new XMLData( STRING( value ), e, true ); - attributeId += BSTRING ( **i ); - InsertL10NElement( attributeId, e ); - } - } - - SearchL10NElements( (XMLParentNode*) element ); -} - -void LayoutXMLFile::InsertL10NElement( ByteString const& id, XMLElement* element ) -{ - ByteString const language = "en-US"; - LangHashMap* languageMap = 0; - XMLHashMap::iterator pos = XMLStrings->find( id ); - if ( pos != XMLStrings->end() ) - { - languageMap = pos->second; - fprintf( stderr, "error:%s:duplicate translation found, id=%s\n", - id.GetBuffer(), BSTRING( sFileName ).GetBuffer() ); - exit( 1 ); - } - else - { - languageMap = new LangHashMap(); - XMLStrings->insert( XMLHashMap::value_type( id , languageMap ) ); - order.push_back( id ); - } - (*languageMap)[ language ] = element; -} - -BOOL LayoutXMLFile::Write( ByteString &aFilename ) -{ - - if ( aFilename.Len() ) - { - ofstream aFStream( aFilename.GetBuffer() , ios::out | ios::trunc ); - if ( !aFStream ) - fprintf( stderr, "ERROR: cannot open file:%s\n", aFilename.GetBuffer() ); - else - { - XMLFile::Write( aFStream ); - aFStream.close(); - return true; - } - } - return false; -} diff --git a/transex3/layout/layoutparse.hxx b/transex3/layout/layoutparse.hxx deleted file mode 100644 index b9cd8f6c18b2..000000000000 --- a/transex3/layout/layoutparse.hxx +++ /dev/null @@ -1,55 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: layoutparse.hxx,v $ - * - * $Revision: 1.3 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef LAYOUTPARSE_HXX -#define LAYOUTPARSE_HXX - -#include "xmlparse.hxx" - -class LayoutXMLFile : public XMLFile -{ - bool mMergeMode; - -public: - LayoutXMLFile( bool mergeMode ); - - void SearchL10NElements( XMLParentNode *pCur, int pos = 0 ); - BOOL Write( ByteString &aFilename ); - void HandleElement( XMLElement* element ); - void InsertL10NElement( ByteString const& id, XMLElement* element ); - - using XMLFile::InsertL10NElement; - using XMLFile::Write; -}; - -std::vector interestingAttributes( XMLAttributeList* lst ); - -#endif /* LAYOUTPARSE_HXX */ diff --git a/transex3/layout/loc.sdf b/transex3/layout/loc.sdf deleted file mode 100644 index 023357adc420..000000000000 --- a/transex3/layout/loc.sdf +++ /dev/null @@ -1,24 +0,0 @@ -transex3 layout\workben\zoom-1.xml 0 help FL_ZOOM 0 en-US Zoom factor 20080204 13:51:01 -transex3 layout\workben\zoom-1.xml 0 help BTN_WHOLE_PAGE 0 en-US Whole Page 20080204 13:51:01 -transex3 layout\workben\zoom-1.xml 0 help BTN_PAGE_WIDTH 0 en-US Page Width 20080204 13:51:01 -transex3 layout\workben\zoom-1.xml 0 help BTN_OPTIMAL 0 en-US Optimal 20080204 13:51:01 -transex3 layout\workben\zoom-1.xml 0 help BTN_200 0 en-US 200 % 20080204 13:51:01 -transex3 layout\workben\zoom-1.xml 0 help BTN_150 0 en-US 15~0 % 20080204 13:51:01 -transex3 layout\workben\zoom-1.xml 0 help BTN_100 0 en-US 100 % 20080204 13:51:01 -transex3 layout\workben\zoom-1.xml 0 help BTN_75 0 en-US 75 % 20080204 13:51:01 -transex3 layout\workben\zoom-1.xml 0 help BTN_50 0 en-US 50 % 20080204 13:51:01 -transex3 layout\workben\zoom-1.xml 0 help BTN_USER 0 en-US Variable 20080204 13:51:01 -transex3 layout\workben\zoom-1.xml 0 help FL_ZOOM 0 de deZoom factor 20080204 13:51:01 -transex3 layout\workben\zoom-1.xml 0 help BTN_WHOLE_PAGE 0 de deWhole Page 20080204 13:51:01 -transex3 layout\workben\zoom-1.xml 0 help BTN_PAGE_WIDTH 0 de dePage Width 20080204 13:51:01 -transex3 layout\workben\zoom-1.xml 0 help BTN_OPTIMAL 0 de deOptimal 20080204 13:51:01 -transex3 layout\workben\zoom-1.xml 0 help BTN_200 0 de de200 % 20080204 13:51:01 -transex3 layout\workben\zoom-1.xml 0 help BTN_150 0 de de15~0 % 20080204 13:51:01 -transex3 layout\workben\zoom-1.xml 0 help BTN_100 0 de de100 % 20080204 13:51:01 -transex3 layout\workben\zoom-1.xml 0 help BTN_75 0 de de75 % 20080204 13:51:01 -transex3 layout\workben\zoom-1.xml 0 help BTN_50 0 de de50 % 20080204 13:51:01 -transex3 layout\workben\zoom-1.xml 0 help BTN_USER 0 de deVariable 20080204 13:51:01 -transex3 layout\workben\zoom-1.xml 0 help FL_ZOOM 0 en-US Zoom factor 20080204 13:51:01 -transex3 layout\workben\zoom-1.xml 0 help BTN_WHOLE_PAGE 0 en-US Whole Page 20080204 13:51:01 -transex3 layout\workben\zoom-1.xml 0 help FL_ZOOM 0 de de3:Zoom factor 20080204 13:51:01 -transex3 layout\workben\zoom-1.xml 0 help BTN_WHOLE_PAGE 0 de de3:Whole Page 20080204 13:51:01 diff --git a/transex3/layout/makefile.mk b/transex3/layout/makefile.mk deleted file mode 100644 index 9864b46242b2..000000000000 --- a/transex3/layout/makefile.mk +++ /dev/null @@ -1,81 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.3 $ -# -# 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 -# -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=.. - -INCPRE=$(MISC) - -PRJNAME=transex3 -TARGET=tralay -#TARGETTYPE=GUI -TARGETTYPE=CUI -LIBTARGET=no - -# --- Settings ----------------------------------------------------- - -ENABLE_EXCEPTIONS=TRUE - -.INCLUDE : settings.mk - -.IF "$(SYSTEM_EXPAT)" == "YES" -CFLAGS+=-DSYSTEM_EXPAT -.ENDIF - -# --- Files -------------------------------------------------------- - -APP1TARGET=$(TARGET) - -OBJFILES =\ - $(OBJ)/export2.obj\ - $(OBJ)/helpmerge.obj\ - $(OBJ)/layoutparse.obj\ - $(OBJ)/merge.obj\ - $(OBJ)/tralay.obj\ - $(OBJ)/xmlparse.obj - -APP1OBJS = $(OBJFILES) - -APP1STDLIBS =\ - $(TOOLSLIB)\ - $(EXPATASCII3RDLIB)\ - $(VOSLIB)\ - $(CPPULIB) \ - $(SALLIB) - -# --- Targets ------------------------------------------------------ - -.INCLUDE : target.mk - -test .PHONY: - ../$(INPATH)/bin/tralay -l en-US -o out.sdf zoom.xml - cat out.sdf > trans.sdf - sed 's/en-US\t/de\tde:/' out.sdf >> trans.sdf - ../$(INPATH)/bin/tralay -m trans.sdf -l de -o zoom-DE.xml zoom.xml diff --git a/transex3/layout/tralay.cxx b/transex3/layout/tralay.cxx deleted file mode 100644 index 740981674c50..000000000000 --- a/transex3/layout/tralay.cxx +++ /dev/null @@ -1,403 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: tralay.cxx,v $ - * - * $Revision: 1.4 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include -#include - -#include - -#include "export.hxx" -#include "layoutparse.hxx" -#include "helpmerge.hxx" -#include "xmlparse.hxx" - -// Convert a rtl::OUString to a byte string. -#define OUSTRING_CSTR( str ) \ - rtl::OUStringToOString( str, RTL_TEXTENCODING_UTF8 ).getStr() - -#define STRING( str ) String( str, RTL_TEXTENCODING_UTF8 ) -#define BSTRING( str ) ByteString( str, RTL_TEXTENCODING_UTF8 ) - -using ::rtl::OUString; - -using namespace ::osl; -using namespace ::com::sun::star; -using namespace ::com::sun::star::uno; - - -class TranslateLayout : public Application -{ - ByteString mGid1; - ByteString mLanguage; - ByteString mLocalize; - ByteString mOutput; - ByteString mProject; - ByteString mRoot; - bool mMergeMode; - std::vector< ByteString > mLanguages; - std::list< ByteString > mFiles; - -public: - TranslateLayout(); - virtual ~TranslateLayout(); - ByteString GetCommandLineParam( int i ); - ByteString GetOptionArgument( int const i ); - void ExceptionalMain(); - void Main(); - void Merge(); - void MergeLanguage( ByteString const& language ); - void ParseCommandLine(); - void CreateSDF(); - - using Application::GetCommandLineParam; -}; - -static void usage() -{ - fprintf( stderr, "Usage: tralay [OPTION]... XML-FILE\n" ); - fprintf( stderr, "\nOptions:\n" ); - fprintf( stderr, " -h,--help show this help\n" ); - fprintf( stderr, " -l,--language=LANG process this language\n" ); - fprintf( stderr, " -m,--merge=DATABASE.SDF translation database\n" ); - fprintf( stderr, "\nExamples:\n" ); - fprintf( stderr, " tralay -l en-US -o localize.sdf zoom.xml # Extract\n" ); - fprintf( stderr, " tralay -m localize.sdf -l de -l nl -o out zoom.xml # Merge/translate\n" ); - exit( 2 ); -} - -static ByteString ConvertSystemPath( const ByteString& rPath ) -{ - if( rPath.CompareTo( ".", 1 ) == 0 ) - { - OUString sPath( rPath.GetBuffer(), rPath.Len(), RTL_TEXTENCODING_UTF8 ); - - ::rtl::OUString curDirPth, sURL; - osl_getProcessWorkingDir( &curDirPth.pData ); - - ::osl::FileBase::getAbsoluteFileURL( curDirPth, sPath, sURL ); - ::osl::FileBase::getSystemPathFromFileURL( sURL, sPath ); - - return ByteString( rtl::OUStringToOString( sPath, RTL_TEXTENCODING_UTF8 ) ); - } - else - { - return rPath; - } -} - -ByteString TranslateLayout::GetCommandLineParam( int i ) -{ - return ByteString( OUSTRING_CSTR( Application::GetCommandLineParam( sal::static_int_cast< USHORT >( i ) ) ) ); -} - -ByteString TranslateLayout::GetOptionArgument( int const i ) -{ - if ( i >= GetCommandLineParamCount() ) - usage(); - ByteString arg = GetCommandLineParam( i ); - if ( !arg.CompareTo( "-", 1 ) ) - { - fprintf( stderr, "Option needs an argument: %s, found: %s\n", - GetCommandLineParam( i - 1 ).GetBuffer(), - arg.GetBuffer() ); - usage(); - } - return arg; - } - -void TranslateLayout::ParseCommandLine() -{ - for ( int i = 0; i < GetCommandLineParamCount(); i++ ) - { - ByteString aParam = GetCommandLineParam( i ); - if ( aParam.Equals( "-h" ) || aParam.Equals( "--help" ) ) - usage(); - else if ( aParam.Equals( "-l" ) || aParam.Equals( "--language" ) ) - mLanguages.push_back ( GetOptionArgument( ++i ) ); - else if ( aParam.Equals( "-m" ) || aParam.Equals( "--merge" ) ) - { - mMergeMode = true; - mLocalize = GetOptionArgument( ++i ); - } - else if ( aParam.Equals( "-o" ) || aParam.Equals( "--output" ) ) - mOutput = ConvertSystemPath( GetOptionArgument( ++i ) ); - else if ( !aParam.CompareTo( "-", 1 ) ) - { - fprintf( stderr, "error: No such option: %s\n", aParam.GetBuffer() ); - usage(); - } - else - mFiles.push_back( ConvertSystemPath( aParam ) ); - } - if ( !mFiles.size() ) - { - fprintf( stderr, "error: No XML-FILE found\n" ); - usage(); - } -} - -static XMLAttribute* -findAttribute( XMLAttributeList* lst, String const& name ) -{ - for ( ULONG i = 0; i < lst->Count(); i++ ) - if ( lst->GetObject( i )->Equals( name ) ) - return lst->GetObject( i ); - return 0; -} - -static XMLAttribute* -translateAttribute( XMLAttributeList* lst, - String const& name, String const& translation ) -{ - if ( XMLAttribute* a = findAttribute( lst, name ) ) - return lst->Replace ( new XMLAttribute( name.Copy( 1 ), translation ), a ); - return 0; -} - -static void -translateElement( XMLElement* element, ByteString const& lang, - ResData* resData, MergeDataFile& mergeData ) -{ - XMLAttributeList* attributes = element->GetAttributeList(); - std::vector interesting( interestingAttributes( attributes ) ); - - - if( !interesting.empty() ) - { - std::vector::iterator i( interesting.begin() ); - ByteString id = BSTRING( (*i++)->GetValue() ); - for ( ; i != interesting.end(); ++i ) - { - ByteString attributeId = id; - attributeId += BSTRING ( **i ); - resData->sGId = attributeId; - resData->sId = element->GetOldref(); - - if ( PFormEntrys* entry = mergeData.GetPFormEntrys( resData ) ) - { - ByteString translation; - entry->GetText( translation, STRING_TYP_TEXT, lang, true ); - // ByteString original = removeContent( element ); - if ( !translation.Len() ) -#if 0 - translation = original; -#else - translation = BSTRING( ( *i )->GetValue() ); -#endif - delete translateAttribute( attributes, **i , STRING( translation ) ); - } - } - } -} - -static bool is_dir( ByteString const& name ) -{ - DirectoryItem aItem; - OUString sFileURL( name.GetBuffer(), name.Len(), RTL_TEXTENCODING_UTF8 ); - FileBase::getFileURLFromSystemPath( sFileURL, sFileURL ); - if( DirectoryItem::get( sFileURL, aItem ) == FileBase::E_None ) - { - FileStatus aStatus(FileStatusMask_Type); - if( aItem.getFileStatus( aStatus ) == FileBase::E_None ) - { - if( aStatus.getFileType() == FileStatus::Directory ) - return true; - } - } - return false; -} - -static void make_directory( ByteString const& name ) -{ - OUString sFileURL( name.GetBuffer(), name.Len(), RTL_TEXTENCODING_UTF8 ); - FileBase::getFileURLFromSystemPath( sFileURL, sFileURL ); - Directory::create( sFileURL ); -} - -static void insertMarker( XMLParentNode *p, ByteString const& file ) -{ - if ( XMLChildNodeList* lst = p->GetChildList() ) - if ( lst->Count() ) - { - ULONG i = 1; - // Skip newline, if possible. - if ( lst->Count() > 1 - && lst->GetObject( 2 )->GetNodeType() == XML_NODE_TYPE_DEFAULT ) - i++; - OUString marker = OUString::createFromAscii( "\n NOTE: This file has been generated automagically by transex3/layout/tralay,\n from source template: " ) - + STRING( file ) - + OUString::createFromAscii( ".\n Do not edit, changes will be lost.\n" ); - lst->Insert( new XMLComment( marker, 0 ), i ); - } -} - -void TranslateLayout::MergeLanguage( ByteString const& language ) -{ - ByteString xmlFile = mFiles.front(); - - MergeDataFile mergeData( mLocalize, xmlFile, - FALSE, RTL_TEXTENCODING_MS_1252 ); - - DirEntry aFile( xmlFile ); - SimpleXMLParser aParser; - LayoutXMLFile* layoutXml = new LayoutXMLFile( mMergeMode ); - if ( !aParser.Execute( aFile.GetFull() , STRING( xmlFile ), layoutXml ) ) - { - fprintf(stderr, "error: parsing: %s\n", xmlFile.GetBuffer() ); - return; - } - - layoutXml->Extract(); - insertMarker( layoutXml, xmlFile ); - - ResData resData( "", "", "" ); - resData.sResTyp = mProject; /* mGid1 ?? */ - resData.sFilename = xmlFile; - - XMLHashMap* xmlStrings = layoutXml->GetStrings(); - for ( XMLHashMap::iterator i = xmlStrings->begin(); i != xmlStrings->end(); - ++i ) - { - if ( LangHashMap* languageMap = i->second ) - if ( XMLElement* element = ( *languageMap )[ "en-US" ] ) - translateElement( element, language, &resData, mergeData ); - } - -#ifndef WNT - ByteString outFile = "/dev/stdout"; -#else - ByteString outFile = "\\\\.\\CON"; -#endif - if ( mOutput.Len() ) - { - outFile = mOutput; - if ( is_dir( outFile ) ) - { - ByteString outDir = mOutput; - outDir.Append( "/" ).Append( language ); - if ( !is_dir( outDir ) ) - make_directory( outDir ); - outFile = outDir; - outFile.Append( "/" ).Append( xmlFile ); - } - } - layoutXml->Write( outFile ); - delete layoutXml; -} - -void TranslateLayout::Merge() -{ - if ( mLanguages.size() ) - for ( std::vector::iterator i = mLanguages.begin(); - i != mLanguages.end(); ++i) - MergeLanguage( *i ); - else - MergeLanguage( mLanguage ); -} - -void TranslateLayout::CreateSDF() -{ - ByteString xmlFile = mFiles.front(); -#ifndef WNT - ByteString sdf = "/dev/stdout"; -#else - ByteString sdf = "\\\\.\\CON"; -#endif - if ( mOutput.Len() ) - sdf = mOutput; - Export::SetLanguages( mLanguages ); - HelpParser::CreateSDF( sdf, mProject, mRoot, xmlFile, - new LayoutXMLFile( mMergeMode ), mGid1 ); -} - -void TranslateLayout::ExceptionalMain() -{ - ParseCommandLine(); - if ( mLanguages.size() ) - mLanguage = mLanguages.front(); - if ( mMergeMode ) - Merge(); - else - CreateSDF(); -} - -void TranslateLayout::Main() -{ - try - { - ExceptionalMain(); - } - catch ( xml::sax::SAXException& rExc ) - { - OString aStr( OUStringToOString( rExc.Message, - RTL_TEXTENCODING_ASCII_US ) ); - uno::Exception exc; - if (rExc.WrappedException >>= exc) - { - aStr += OString( " >>> " ); - aStr += OUStringToOString( exc.Message, RTL_TEXTENCODING_ASCII_US ); - } - fprintf( stderr, "error: parsing: '%s'\n", aStr.getStr() ); - OSL_ENSURE( 0, aStr.getStr() ); - } - catch ( uno::Exception& rExc ) - { - OString aStr( OUStringToOString( rExc.Message, - RTL_TEXTENCODING_ASCII_US ) ); - fprintf( stderr, "error: UNO: '%s'\n", aStr.getStr() ); - OSL_ENSURE( 0, aStr.getStr() ); - } -} - -TranslateLayout::TranslateLayout() - : Application() - , mGid1( "layout" ) - , mLanguage( "en-US" ) - , mLocalize( "localize.sdf" ) - , mOutput() - , mProject( "layout" ) - , mRoot() - , mMergeMode( false ) - , mLanguages() - , mFiles() -{ -} - -TranslateLayout::~TranslateLayout() -{ -} - -SAL_IMPLEMENT_MAIN() -{ - TranslateLayout t; - t.Main(); - return 0; -} diff --git a/transex3/layout/zoom.xml b/transex3/layout/zoom.xml deleted file mode 100644 index 0fb3d27343ff..000000000000 --- a/transex3/layout/zoom.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/transex3/prj/build.lst b/transex3/prj/build.lst deleted file mode 100644 index 685686192daf..000000000000 --- a/transex3/prj/build.lst +++ /dev/null @@ -1,10 +0,0 @@ -tr transex3 : tools LIBXSLT:libxslt BERKELEYDB:berkeleydb LUCENE:lucene NULL -tr transex3 usr1 - all tr_mkout NULL -tr transex3\inc nmake - all tr_inc NULL -tr transex3\source nmake - all tr_src tr_inc NULL -tr transex3\layout nmake - all rt_layout tr_src tr_inc NULL -tr transex3\java\l10nconv nmake - all tr_conv NULL -tr transex3\java\receditor nmake - all tr_rece NULL -tr transex3\source\help nmake - all tr_bla_help NULL -tr transex3\source\filter\utils nmake - all tr_bla_utils NULL -tr transex3\source\filter\merge nmake - all tr_bla_merge tr_bla_utils NULL diff --git a/transex3/prj/d.lst b/transex3/prj/d.lst deleted file mode 100644 index a469837275ed..000000000000 --- a/transex3/prj/d.lst +++ /dev/null @@ -1,61 +0,0 @@ -mkdir: %_DEST%\inc%_EXT%\transex3 -mkdir: %_DEST%\bin%_EXT% -mkdir: %_DEST%\bin%_EXT%\help -mkdir: %_DEST%\bin%_EXT%\help\com -mkdir: %_DEST%\bin%_EXT%\help\com\sun -mkdir: %_DEST%\bin%_EXT%\help\com\sun\star -mkdir: %_DEST%\bin%_EXT%\help\com\sun\star\help - -..\%__SRC%\bin\cfgex.exe %_DEST%\bin%_EXT%\cfgex.exe -..\%__SRC%\bin\cfgex %_DEST%\bin%_EXT%\cfgex -..\%__SRC%\bin\transex3.exe %_DEST%\bin%_EXT%\transex3.exe -..\%__SRC%\bin\transex3 %_DEST%\bin%_EXT%\transex3 -..\%__SRC%\bin\lngex.exe %_DEST%\bin%_EXT%\lngex.exe -..\%__SRC%\bin\lngex %_DEST%\bin%_EXT%\lngex -..\%__SRC%\bin\localize_sl.exe %_DEST%\bin%_EXT%\localize_sl.exe -..\%__SRC%\bin\localize_sl %_DEST%\bin%_EXT%\localize_sl -..\%__SRC%\bin\xrmex.exe %_DEST%\bin%_EXT%\xrmex.exe -..\%__SRC%\bin\xrmex %_DEST%\bin%_EXT%\xrmex -..\%__SRC%\bin\gsicheck.exe %_DEST%\bin%_EXT%\gsicheck.exe -..\%__SRC%\bin\gsicheck %_DEST%\bin%_EXT%\gsicheck -..\%__SRC%\bin\helpex.exe %_DEST%\bin%_EXT%\helpex.exe -..\%__SRC%\bin\helpex %_DEST%\bin%_EXT%\helpex -..\%__SRC%\bin\ulfex.exe %_DEST%\bin%_EXT%\ulfex.exe -..\%__SRC%\bin\ulfex %_DEST%\bin%_EXT%\ulfex -..\%__SRC%\bin\txtconv.exe %_DEST%\bin%_EXT%\txtconv.exe -..\%__SRC%\bin\txtconv %_DEST%\bin%_EXT%\txtconv -..\%__SRC%\bin\tralay.exe %_DEST%\bin%_EXT%\tralay.exe -..\%__SRC%\bin\tralay %_DEST%\bin%_EXT%\tralay -..\%__SRC%\bin\ulfconv %_DEST%\bin%_EXT%\ulfconv -..\%__SRC%\class\FCFGMerge.jar %_DEST%\bin%_EXT%\FCFGMerge.jar -..\%__SRC%\class\HelpIndexerTool.jar %_DEST%\bin%_EXT%\HelpIndexerTool.jar -..\%__SRC%\bin\HelpLinker %_DEST%\bin%_EXT%\HelpLinker -..\%__SRC%\bin\HelpCompiler %_DEST%\bin%_EXT%\HelpCompiler -..\%__SRC%\bin\HelpCompiler.exe %_DEST%\bin%_EXT%\HelpCompiler.exe -..\%__SRC%\bin\HelpLinker.exe %_DEST%\bin%_EXT%\HelpLinker.exe -..\%__SRC%\bin\HelpLinker* %_DEST%\bin%_EXT% - -..\%__SRC%\class\converter\converter.jar %_DEST%\bin%_EXT%\converter.jar -..\%__SRC%\doc\converter_javadoc.zip %_DEST%\bin%_EXT%\converter_javadoc.zip - -..\%__SRC%\class\receditor\receditor.jar %_DEST%\bin%_EXT%\receditor.jar - -..\scripts\localize.pl %_DEST%\bin%_EXT%\localize.pl -..\scripts\localize_old.pl %_DEST%\bin%_EXT%\localize_old.pl -..\scripts\localize %_DEST%\bin%_EXT%\localize -..\scripts\fast_merge.pl %_DEST%\bin%_EXT%\fast_merge.pl -..\scripts\keyidGen.pl %_DEST%\bin%_EXT%\keyidGen.pl - -..\inc\export.hxx %_DEST%\inc%_EXT%\transex3\export.hxx -..\inc\transex3\directory.hxx %_DEST%\inc%_EXT%\transex3\directory.hxx -..\inc\transex3\file.hxx %_DEST%\inc%_EXT%\transex3\file.hxx -..\inc\transex3\vosapp.hxx %_DEST%\inc%_EXT%\transex3\vosapp.hxx - -..\inc\utf8conv.hxx %_DEST%\inc%_EXT%\transex3\utf8conv.hxx -..\%__SRC%\lib\transex.lib %_DEST%\lib%_EXT%\transex.lib -..\%__SRC%\lib\libtransex.a %_DEST%\lib%_EXT%\libtransex.a - -..\source\help\compilehelp.hxx %_DEST%\inc%_EXT%\transex3\compilehelp.hxx -#..\source\help\helplinkerdllapi.h %_DEST%\inc%_EXT%\transex3\helplinkerdllapi.h -..\%__SRC%\lib\* %_DEST%\lib%_EXT%\* -..\%__SRC%\class\com\sun\star\help\* %_DEST%\bin%_EXT%\help\com\sun\star\help\* diff --git a/transex3/scripts/fast_merge.pl b/transex3/scripts/fast_merge.pl deleted file mode 100644 index 7321a9a42911..000000000000 --- a/transex3/scripts/fast_merge.pl +++ /dev/null @@ -1,348 +0,0 @@ -: -eval 'exec perl -wS $0 ${1+"$@"}' - if 0; -#************************************************************************* -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: fast_merge.pl,v $ -# -# $Revision: 1.1.2.2 $ -# -# last change: $Author: ihi $ $Date: 2007/07/20 10:37:53 $ -# -# The Contents of this file are made available subject to -# the terms of GNU Lesser General Public License Version 2.1. -# -# -# GNU Lesser General Public License Version 2.1 -# ============================================= -# Copyright 2005 by Sun Microsystems, Inc. -# 901 San Antonio Road, Palo Alto, CA 94303, USA -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License version 2.1, as published by the Free Software Foundation. -# -# This library 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 for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, -# MA 02111-1307 USA -# -#************************************************************************* - -use strict; -use Class::Struct; -use Getopt::Long; -use File::Temp; -use File::Path; - -my @files; -my @file_names; -my $module_name = ''; -my @current; -my @buffer; -my $last_file; -my $last_path; -my $last_localize_file; -my $first_run = "1"; -my $sdf_filename; -my $merge_dir; -my $WIN; -my $state = "none"; - -if ( defined $ENV{USE_SHELL} && $ENV{USE_SHELL} eq '4nt' ) { $WIN = 'TRUE'; } -else { $WIN = ''; } - -$SIG{INT} = 'inthandler'; -$SIG{QUIT} = 'quithandler'; - -struct ( sdf_obj => -{ - module => '$', - file => '$', - dir => '$', - FILEHANDLE => '$', - line => '$', - endoffile => '$' -} -); - -parse_options(); -my $lock_file = $merge_dir."/lock.mk"; -$lock_file =~ s/\//\\/g , if ( $WIN ) ; -acquire_lock(); -read_sdf_file_names(); -init(); -my $reference; -my $path ; -my $localize_file; -while( hasLines() ) -{ - @current = (); - foreach ( @files ) - { - push @current , $_; - } - - $reference = getNextIdentifier( ); - - @current = (); - foreach ( @files ) - { - if( $_->module eq $reference->module && $_->dir eq $reference->dir ) - { - push @current , $_ ; - } - } - write_lines(); -} -if( $#current+1 ne 0 ) -{ - ( $path , $localize_file ) = make_paths(); - add_to_buffer(); - write_buffer( $path , $localize_file ); -} -release_lock(); -exit( 0 ); - -########################################################################################## -sub acquire_lock -{ - if( -e $lock_file ){ - $state = "blocked"; - print "WARNING: Lock file '$lock_file' 'found, waiting ....\n"; - my $cnt = 0; - sleep 10 , while( -e $lock_file && $cnt++ < 180 ); - exit( 0 ); - }else - { - $state = "locked"; - print "Writing lock file '$lock_file'\n"; - open FILE, ">$lock_file" or die "Can't create lock file '$lock_file'"; - print FILE "L10N_LOCK=YES" ; - close ( FILE ); - } -} -sub release_lock -{ - print "Deleting lock file '$lock_file'\n"; - unlink $lock_file, if( -e $lock_file ); - $state = "none"; -} -sub inthandler -{ - release_lock() , if( $state eq "locked" ); - exit( -1 ); -} -sub quithandler -{ - release_lock() , if( $state eq "locked" ); - exit( 0 ); -} - -sub init -{ - foreach my $file ( @file_names ) - { - my $obj = new sdf_obj; - open my $FILEHANDLE , "<$file" or die "Can't open file '$file'"; - $obj->FILEHANDLE ( $FILEHANDLE ) ; - getNextSdfObj( $obj ); - push @files, $obj ; - print "Open file '$file'\n"; - } -} - -# get the next module/file -sub getNextIdentifier -{ - my @sorted = sort { - return $a->module.$a->dir cmp $b->module.$b->dir; - } @current ; - return shift @sorted; -} - -# update the obj with the next line -sub getNextSdfObj -{ - my $obj = shift; - my $line = readline ( $obj->FILEHANDLE ); - if ( $line eq undef ) - { - $obj->endoffile( "true" ); - } - else - { - $line =~ /^(([^\t]*)\t([^\t]*)[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t[^\t]*\t*)/o ; - if( defined $1 && defined $2 && defined $3 ) - { - $obj->line ( $1 ); - $obj->module( $2 ); - $obj->file ( $3 ); - $obj->dir ( getDir( $3 ) ); - } - else - { - $obj->line ( "" ); - $obj->module( "" ); - $obj->file ( "" ); - $obj->dir ( "" ); - } - } - return $obj; -} -sub getNextSdfObjModule -{ - my $obj = shift; - while( !$obj->endoffile ) - { - my $line = readline ( $obj->FILEHANDLE ); - if ( $line eq undef ) - { - $obj->endoffile( "true" ); - } - else - { - $line =~ /^(([^\t]*)\t([^\t]*).*)/o ; - if( defined $1 && defined $2 && defined $3 ) - { - $obj->line ( $1 ); - $obj->module( $2 ); - $obj->file ( $3 ); - $obj->dir ( getDir( $3 ) ); - } - else - { - $obj->line ( "" ); - $obj->module( "" ); - $obj->file ( "" ); - $obj->dir ( "" ); - } - return $obj , if( $obj->module eq $module_name ) - } - } - #return $obj; -} -sub getDir -{ - my $path = shift ; - $path =~ s/\//\\/g; - my @tmp_path = split /\\/ , $path; - pop @tmp_path; - $path = join '\\' , @tmp_path; - return $path; -} - -sub hasLines -{ - my $hasLines = ""; - my @tmpfiles; - foreach ( @files ) - { - push @tmpfiles , $_, if( !$_->endoffile ); - } - @files = @tmpfiles; - return $#files+1; -} - -sub make_paths -{ - my $localizeFile = $merge_dir."\\".$current[ 0 ]->module."\\".$current[ 0 ]->file; - my $path = getDir( $localizeFile ); - if ( !$WIN ) { $path =~ s/\\/\//g; } - - $localizeFile = $path."\\localize.sdf"; - if ( !$WIN ) { $localizeFile =~ s/\\/\//g; } - - return ( $path , $localizeFile ); -} -sub write_lines -{ - if( $first_run ){ - add_to_buffer(); - my( $path , $localize_file ) = make_paths(); - $last_path = $path; - $last_localize_file = $localize_file; - mkpath $path; - write_buffer( $path , $localize_file ); - $first_run = ''; - } - else - { - return , if ( $#current+1 eq 0 ); - my( $path , $localize_file ) = make_paths(); - if( $path eq $last_path ) - { - add_to_buffer(); - } - else - { - mkpath $path; - write_buffer( $last_path , $last_localize_file ); - add_to_buffer(); - $last_path = $path; - $last_localize_file = $localize_file; - } - } -} -sub add_to_buffer -{ - my $plainline; - my $afile; - my $amodule; - foreach my $elem ( @current ) - { - do { - $amodule=$elem->module; - $afile=$elem->file; - $plainline=$elem->line; - push @buffer, $plainline; - getNextSdfObj( $elem ); - } while ( !$elem->endoffile && $amodule eq $elem->module && $afile eq $elem->file ); - } -} -sub write_buffer -{ - my $path = shift; - my $localize_file = shift; - my $cnt = $#buffer+1; - print "Write to $path $cnt lines\n"; - open FILE , ">>$localize_file" or die "Can't open file '$localize_file'\n"; - foreach ( @buffer ) - { - print FILE $_."\n"; - } - @buffer = (); -} -sub parse_options -{ - my $success = GetOptions( 'sdf_files=s' => \$sdf_filename , 'merge_dir=s' => \$merge_dir ); #, 'module=s' => \$module_name ); - if( ! ( $sdf_filename && $merge_dir && $success ) ) - { - usage(); - exit( -1 ); - } -} - -sub usage -{ - print "Usage: fast_merge -sdf_files -merge_dir \n" ; -} - -sub read_sdf_file_names -{ - open FILE , "<$sdf_filename" or die "Can't open file '$sdf_filename'\n"; - while ( ) - { - push @file_names , split " " , $_ ; - } - close ( FILE ); -} - - diff --git a/transex3/scripts/keyidGen.pl b/transex3/scripts/keyidGen.pl deleted file mode 100644 index acb5137e3f7c..000000000000 --- a/transex3/scripts/keyidGen.pl +++ /dev/null @@ -1,189 +0,0 @@ -: -eval 'exec perl -S $0 ${1+"$@"}' - if 0; -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: keyidGen.pl,v $ -# -# $Revision: 1.3 $ -# -# 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 -# -# for a copy of the LGPLv3 License. -# -#************************************************************************* -# -# add keyids to sdf file -# - -use Compress::Zlib(); - -print "\nkeyidGen version 1.0 \n\n"; - -my ( $infile,$outfile,$dbimport ); -get_options(); - -print_help() if ( !defined $infile || $help ); -exit 1 if ( !defined $infile ); -if ( ! defined $outfile ) -{ - $outfile = $infile; - $outfile =~ s/\.sdf$//i; - $outfile .= "_KeyID.sdf"; -} - -$collisions = 0; -%hashcodes = (); -$count = 0; -print "writing to $outfile\n"; -open INFILE,"<$infile" || die "could not open $infile $! $^E\n"; -open OUTFILE,">$outfile" || die "could not open $outfile $! $^E\n"; - -while ( ) -{ - $line = $_; - chomp $line; - $hash = 0; - if ( $line =~ /^([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)$/ ) - { - $string="$1 $2 $4 $5 $6 $7 $8"; - $hashp = makeID( $string ); - - if ( defined ($hashcodes{ $hashp } ) ) - { - $collisions ++ unless $hashcodes{ $hashp } eq $string; - } - $hashcodes{ $hashp } = $string; - $count++; - if ( $dbimport ) - { - my ( $pre, $post, $old ); - $pre = "$1\t$2\t"; - $post = "\t$4\t$5\t$6\t$7\t$8\t$9\t$10\t$11\t$12\t$13\t$14\t$15\n"; - $old = $3; - $old =~ s/;{0,1}keyid:......;{0,1}//; - $old =~ s/^0$//; - if ( $old ne "" ) { $old .= ";"; } - print OUTFILE "$pre${old}keyid:$hashp$post"; - } - else - { - print OUTFILE "$1\t$2\t$3\t$4\t$5\t$6\t$7\t$8\t$9\t$10\t".makekidstr($hashp,$11)."\t".makekidstr($hashp,$12)."\t$13\t".makekidstr($hashp,$14)."\t$15\n"; - } - } -} -print "$count entries\n"; -print "$collisions collisions\n"; - -close INFILE; -close OUTFILE; - -sub makeID -{ - my ( $String ) = shift; - my ( $hash ); - # hardcoded to prevent windows installer to choke on bad directoryname :-(( - if ( $String eq "scp2 source\\ooo\\directory_ooo.ulf LngText STR_DIR_KAPITEL " ) - { - return "keyid1"; - } - - $hash = Compress::Zlib::crc32( $String, undef ); - return makenumber( $hash ); -} - -sub makenumber -{ - $h = shift; - # 1 2 3 4 - # 1234567890123456789012345678901234567890 - $symbols="0123456789abcdefghijklmnopqrstuvwxyz+-<=>"; - $order = length($symbols); - $result = ""; - while ( length( $result ) < 6 ) - { - $result .= substr( $symbols, ($h % $order), 1 ); - $h = int( $h / $order ); - } - die "makenumber failed because number is too big (this cannot be so this is a strange error)" if $h > 0; - - return reverse $result; -} - - -sub makekidstr -{ - $kid = shift; - $str = shift; - - if ( $str ne "" ) - { - # special handling for strings starting with font descriptions like {&Tahoma8} (win system integration) - if ( $str =~ s/^(\{\&[^\}]+\})// ) - { - return "$1$kid‖$str"; - } - else - { - return "$kid‖$str"; - } - } - else - { - return ""; - } -# return "default"; -} - -sub print_help -{ - print "\n\n"; - print "keyidGen 0.5 for sdf files\n"; - print "--------------------------\n"; - print "Usage:\n"; - print "keyidGen [] [-dbimport]\n"; - print " add keyids to the entries and write them to a file with\n"; - print " _KeyID added to the name\n"; - print " -dbimport Add KeyID to a new column instead of to the strings.\n"; - print " This is needed to import the IDs into tha database.\n"; - print "\n\n"; -} - - -sub get_options { - my ($arg,$has_infile); - - while ($arg = shift @ARGV) { - $arg =~ /^-dbimport$/ and $dbimport = 1 and next; - $arg =~ /^-help$/ and $help = 1 and next; #show help - - if ( !$has_infile ) - { - $infile = $arg; - $has_infile = 1; - } - else - { - $outfile = $arg; - } - } -} diff --git a/transex3/scripts/localize.pl b/transex3/scripts/localize.pl deleted file mode 100755 index 0f6a19effc38..000000000000 --- a/transex3/scripts/localize.pl +++ /dev/null @@ -1,1201 +0,0 @@ -: -eval 'exec perl -wS $0 ${1+"$@"}' - if 0; - - -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: localize.pl,v $ -# -# $Revision: 1.18.6.2 $ -# -# 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 -# -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -use strict; -use Getopt::Long; -use IO::Handle; -use File::Find; -use File::Temp; -use File::Path; -use File::Copy; -use File::Glob qw(:glob csh_glob); -use Cwd; - -my $CVS_BINARY = "/usr/bin/cvs"; -# ver 1.1 -# -#### module lookup -#use lib ("$ENV{SOLARENV}/bin/modules", "$ENV{COMMON_ENV_TOOLS}/modules"); - -#### module lookup -# OOo conform -my @lib_dirs; -BEGIN { - if ( !defined($ENV{SOLARENV}) ) { - die "No environment found (environment variable SOLARENV is undefined)"; - } - push(@lib_dirs, "$ENV{SOLARENV}/bin/modules"); - push(@lib_dirs, "$ENV{COMMON_ENV_TOOLS}/modules") if defined($ENV{COMMON_ENV_TOOLS}); -} -use lib (@lib_dirs); - -#### globals #### -my $sdffile = ''; -my $no_sort = ''; -my $create_dirs = ''; -my $multi_localize_files = ''; -my $module_to_merge = ''; -my $sort_sdf_before = ''; -my $outputfile = ''; -my $no_gsicheck = ''; -my $mode = ''; -my $bVerbose = "0"; -my $srcpath = ''; -my $WIN; -my $languages; -#my %sl_modules; # Contains all modules where en-US and de is source language -my $use_default_date = '0'; -my $force_ooo_module = '0'; -my %is_ooo_module; -my %is_so_module; -my $DELIMITER; - - # ( leftpart ) ( rightpart ) - # prj file dummy type gid lid helpid pform width lang text helptext qhelptext title timestamp -my $sdf_regex = "((([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*))\t([^\t]*)\t(([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t)([^\t]*))"; -my $file_types = "(src|hrc|xcs|xcu|lng|ulf|xrm|xhp|xcd|xgf|xxl|xrb)"; -# Always use this date to prevent cvs conflicts -my $default_date = "2002-02-02 02:02:02"; -my @sdfparticles; - -#### main #### -parse_options(); -check_modules_scm(); - -if ( defined $ENV{USE_SHELL} && $ENV{USE_SHELL} eq '4nt' ) { - $WIN = 'TRUE'; - $DELIMITER = "\\"; -} - else { - $WIN = ''; - $DELIMITER = "/"; -} - -my $binpath = ''; -if( defined $ENV{UPDMINOREXT} ) -{ - $binpath = $ENV{SOLARVER}.$DELIMITER.$ENV{INPATH}.$DELIMITER."bin".$ENV{UPDMINOREXT}.$DELIMITER ; -} -else -{ - $binpath = $ENV{SOLARVER}.$DELIMITER.$ENV{INPATH}.$DELIMITER."bin".$DELIMITER ; -} - -#%sl_modules = fetch_sourcelanguage_dirlist(); - - -if ( $mode eq "merge" ) { - if ( ! $no_gsicheck ){ - merge_gsicheck(); - } - splitfile( $sdffile ); - if ( ! $no_gsicheck ){ - unlink $sdffile; # remove temp file! - } -} -elsif( $mode eq "extract" ) { - collectfiles( $outputfile ); -} -else { - usage(); -} - -exit(0); - -######################################################### -sub splitfile{ - - my $lastFile = ''; - my $currentFile = ''; - my $cur_sdffile = ''; - my $last_sdffile = ''; - my $delim; - my $badDelim; - my $start = 'TRUE'; - my %index = (); - my %block; - - STDOUT->autoflush( 1 ); - - #print STDOUT "Open File $sdffile\n"; - open MYFILE , "< $sdffile" - or die "Can't open '$sdffile'\n"; - -# my %lang_hash; - my %string_hash_ooo; - my %string_hash_so; - my %so_modules; - $so_modules{ "extras_full" } = "TRUE"; - - while( ){ - if( /$sdf_regex/ ){ - my $line = defined $_ ? $_ : ''; - my $prj = defined $3 ? $3 : ''; - my $file = defined $4 ? $4 : ''; - my $type = defined $6 ? $6 : ''; - my $gid = defined $7 ? $7 : ''; - my $lid = defined $8 ? $8 : ''; - my $lang = defined $12 ? $12 : ''; - my $plattform = defined $10 ? $10 : ''; - my $helpid = defined $9 ? $9 : ''; - next if( $prj eq "binfilter" ); # Don't merge strings into binfilter module - chomp( $line ); - - if( is_openoffice_module( $prj ) ) - { - $string_hash_ooo { $lang }{ "$prj\t$file\t$type\t$gid\t$lid\t$helpid\t$plattform\t$lang" } = $line; - } - else - { - $string_hash_so{ $lang }{ "$prj\t$file\t$type\t$gid\t$lid\t$helpid\t$plattform\t$lang" } = $line; - } - } - } - close( MYFILE ); - - if( !defined $ENV{SRC_ROOT} ){ - print "Error, no SRC_ROOT in env found.\n"; - exit( -1 ); - } - my $src_root = $ENV{SRC_ROOT}; - #print $WIN eq "TRUE" ? $src_root."\\l10n_so\n" : $src_root."/l10n_so\n"; - my $so_l10n_path = $WIN eq "TRUE" ? $src_root."\\l10n_so\\source" : $src_root."/l10n_so/source"; - my $ooo_l10n_path = $WIN eq "TRUE" ? $src_root."\\l10n\\source" : $src_root."/l10n/source"; - - #print "$so_l10n_path\n"; - #print "$ooo_l10n_path\n"; - - write_sdf( \%string_hash_so , $so_l10n_path ); - write_sdf( \%string_hash_ooo , $ooo_l10n_path ); - -} -sub check_modules_scm -{ - #my @ooo_modules; - #my @so_modules; - my $src_path = $ENV{ SRC_ROOT } ; - my $last_dir = getcwd(); - chdir $src_path ; - my @modules = <*/.svn/entries>; - - foreach my $module ( @modules ) - { - #print "$module \n"; - if( open ( FILE , "<$module" ) ) - { - while( ) - { - - my @path = split ( "/" , $module ) ; - - if( /svn.services.openoffice.org/ ) - { - my $mod = $path[ 0 ]; - #push @ooo_modules , $mod; - $is_ooo_module{ $mod } = "true"; - # print "$module -> ooo "; - } - elsif ( /jumbo2.germany.sun.com/ ) - { - my $mod = $path[ 0 ]; - #push @so_modules , $mod; - # print "$module -> so "; - #$so_lookup_hash{ $mod } = "true"; - } - #else - #{ - # print "ERROR: Is $module a SO or OOo module? Can not parese the $module/.svn/entries file ... please check mwsfinnish/merge/splitsdf.pl line 280\n"; - # exit -1; - #} - } - } - } - chdir $last_dir ; - #print "OOO\n"; - #print @ooo_modules; - #print "\nSO\n"; - #print @so_modules; -} - - -#sub parse -#{ -# my $command = "$CVS_BINARY -d:pserver:anoncvs\@anoncvs.services.openoffice.org:/cvs co -c"; -# my $output = `$command`; -# my $rc = $? << 8; -# if ( $output eq "" || $rc < 0 ){ -# print STDERR "ERROR: Can not fetch cvs alias list, please login to the cvs server and press at the password prompt just return\ncvs -d:pserver:anoncvs\@anoncvs.services.openoffice.org:/cvs login\n"; -# exit ( -1 ); -# } -# my @list = split /\n/ , $output ; -# foreach my $string( @list ) -# { -# -# # print "Found '$1'\n" , if( $string =~ /^(\w*)/ && $1 ne "" ); -# -# $is_ooo_module{ $1 } = "TRUE", if( $string =~ /^(\w*)/ && $1 ne "" ); -# } -# # foreach my $key( keys( %is_ooo_module ) ) -# #{ -# # print "$key\n"; -# #} -#} -sub is_openoffice_module -{ - my $module = shift; - return "TRUE", if ( $force_ooo_module || defined $is_ooo_module{ $module } ); - return ""; -} - -sub write_sdf -{ - my $string_hash = shift; - my $l10n_file = shift; - - foreach my $lang( keys( %{ $string_hash } ) ) - { - my @sdf_file; - - # mkdir!!!! - my $current_l10n_file = $WIN eq "TRUE" ? $l10n_file."\\$lang\\localize.sdf" : $l10n_file."/$lang/localize.sdf"; - print "Writing '$current_l10n_file'\n"; - if( open DESTFILE , "< $current_l10n_file" ){ - - while(){ - if( /$sdf_regex/ ){ - my $line = defined $_ ? $_ : ''; - my $prj = defined $3 ? $3 : ''; - my $file = defined $4 ? $4 : ''; - my $type = defined $6 ? $6 : ''; - my $gid = defined $7 ? $7 : ''; - my $lid = defined $8 ? $8 : ''; - my $lang = defined $12 ? $12 : ''; - my $plattform = defined $10 ? $10 : ''; - my $helpid = defined $9 ? $9 : ''; - - chomp( $line ); - if ( defined $string_hash->{ $lang }{ "$prj\t$file\t$type\t$gid\t$lid\t$helpid\t$plattform\t$lang" } ) - { - # Changed String! - push @sdf_file , $string_hash->{ $lang }{ "$prj\t$file\t$type\t$gid\t$lid\t$helpid\t$plattform\t$lang" } ; - $string_hash->{ $lang }{ "$prj\t$file\t$type\t$gid\t$lid\t$helpid\t$plattform\t$lang" } = undef; - } - else - { - # No new string - push @sdf_file , $line; - } - } - } - } - close( DESTFILE ); - #Now just append the enw strings - #FIXME!!! Implement insertion in the correct order - foreach my $key ( keys ( %{ $string_hash->{ $lang } } ) ) - { - push @sdf_file , $string_hash->{ $lang }{ $key } , if ( defined $string_hash->{ $lang }{ $key } ); - #print "WARNING: Not defined = ".$string_hash->{ $lang }{ $key }."\n", if( ! defined $string_hash->{ $lang }{ $key } ); - } - - # Write the new file - my ( $TMPFILE , $tmpfile ) = File::Temp::tempfile(); - if( open DESTFILE , "+> $tmpfile " ){ - print DESTFILE get_license_header(); - foreach my $string( @sdf_file ){ - print DESTFILE "$string\n"; - } - close ( DESTFILE ); - if( move( $current_l10n_file , $current_l10n_file.".backup" ) ){ - if( copy( $tmpfile , $current_l10n_file ) ){ - unlink $l10n_file.".backup"; - } else { print STDERR "Can't open/create '$l10n_file', original file is renamed to $l10n_file.backup\n"; } - } else { print STDERR "Can't open/create '$l10n_file'\n"; } - }else{ - print STDERR "WARNING: Can't open/create '$l10n_file'\n"; - } - unlink $tmpfile; - } -} - -######################################################### - -sub get_license_header{ - return -"#\n". -"# #### ### # # ### ##### ##### #### ##### ##### \n". -"# # # # # ## # # # # # # # # # \n". -"# # # # # # # # # # # ### # # # # \n". -"# # # # # # ## # # # # # # # # \n". -"# #### ### # # ### # ##### #### ##### # \n". -"#\n". -"# DO NOT EDIT! This file will be overwritten by localisation process\n". -"#\n". -"#*************************************************************************\n". -"#\n". -"# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n". -"# \n". -"# Copyright 2008 by Sun Microsystems, Inc.\n". -"#\n". -"# OpenOffice.org - a multi-platform office productivity suite\n". -"#\n". -"# \$RCSfile:". -"localize.pl,v \$\n". -"#\n". -"# \$Revision: ". -"1.17.4.1 \$\n". -"#\n". -"# This file is part of OpenOffice.org.\n". -"#\n". -"# OpenOffice.org is free software: you can redistribute it and/or modify\n". -"# it under the terms of the GNU Lesser General Public License version 3\n". -"# only, as published by the Free Software Foundation.\n". -"#\n". -"# OpenOffice.org is distributed in the hope that it will be useful,\n". -"# but WITHOUT ANY WARRANTY; without even the implied warranty of\n". -"# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n". -"# GNU Lesser General Public License version 3 for more details\n". -"# (a copy is included in the LICENSE file that accompanied this code).\n". -"#\n". -"# You should have received a copy of the GNU Lesser General Public License\n". -"# version 3 along with OpenOffice.org. If not, see\n". -"# \n". -"# for a copy of the LGPLv3 License.\n". -"#\n". -"#*************************************************************************\n"; -} -######## Check input sdf file and use only the correct part -sub merge_gsicheck{ - my $command = ''; - my ( $TMPHANDLE , $tmpfile ) = File::Temp::tempfile(); - close ( $TMPHANDLE ); - - if( $ENV{WRAPCMD} ){ - $command = "$ENV{WRAPCMD} gsicheck"; - }else{ - $command = "gsicheck"; - } - my $errfile = $sdffile.".err"; - $command .= " -k -c -wcf $tmpfile -wef $errfile -l \"\" $sdffile"; - #my $rc = system( $command ); - my $output = `$command`; - my $rc = $? << 8; - if ( $output ne "" ){ - print STDOUT "### gsicheck ###\n"; - print STDOUT "### The file $errfile have been written containing the errors in your sdf file. Those lines will not be merged: ###\n\n"; - print STDOUT "$output\n"; - print STDOUT "################\n"; - - }else{ - # Remove the 0 Byte file - unlink $errfile; - } - $sdffile = $tmpfile; -} -######################################################### -# find search function -sub wanted -{ - my $file = $File::Find::name; - if( -f $file && $file =~ /.*localize.sdf$/ && !( $file =~ /.*\.svn.*/ ) ) { - push @sdfparticles , $file; - if( $bVerbose eq "1" ) { print STDOUT "$file\n"; } - else { print "."; } - } -} - -sub add_paths -{ - my $langhash_ref = shift; - my $root_dir = $ENV{ SRC_ROOT }; - my $ooo_l10n_dir = "$root_dir"."$DELIMITER"."l10n"."$DELIMITER"."source"; - my $so_l10n_dir = "$root_dir"."$DELIMITER"."l10n_so"."$DELIMITER"."source"; - - if( -e $ooo_l10n_dir ) - { - foreach my $lang ( keys( %{ $langhash_ref } ) ) - { - my $loc_file = "$ooo_l10n_dir"."$DELIMITER"."$lang"."$DELIMITER"."localize.sdf"; - if( -e $loc_file ) - { - push @sdfparticles , "$ooo_l10n_dir"."$DELIMITER"."$lang"."$DELIMITER"."localize.sdf"; - } - else { print "WARNING: $loc_file not found ....\n"; } - } - } - else { die "ERROR: Can not find directory $ooo_l10n_dir!!!" } - if( -e $so_l10n_dir ) - { - foreach my $lang ( keys( %{ $langhash_ref } ) ) - { - my $loc_file = "$so_l10n_dir"."$DELIMITER"."$lang"."$DELIMITER"."localize.sdf"; - if( -e $loc_file ) - { - push @sdfparticles , "$ooo_l10n_dir"."$DELIMITER"."$lang"."$DELIMITER"."localize.sdf"; - } - else { #print "WARNING: $loc_file not found ....\n"; - } - } - - } -} -sub collectfiles{ - print STDOUT "### Localize\n"; - my $localizehash_ref; - my ( $bAll , $bUseLocalize, $langhash_ref , $bHasSourceLanguage , $bFakeEnglish ) = parseLanguages(); - - # Enable autoflush on STDOUT - # $| = 1; - STDOUT->autoflush( 1 ); - - ### Search sdf particles - #print STDOUT "### Searching sdf particles\n"; - my $working_path = getcwd(); - #chdir $srcpath; - #find ( { wanted => \&wanted , follow => 1 }, getcwd() ); - #chdir $working_path; - add_paths( $langhash_ref ); - #my $nFound = $#sdfparticles +1; - #print "\n $nFound files found !\n"; - - my ( $LOCALIZEPARTICLE , $localizeSDF ) = File::Temp::tempfile(); - close( $LOCALIZEPARTICLE ); - - my ( $ALLPARTICLES_MERGED , $particleSDF_merged ) = File::Temp::tempfile(); - close( $ALLPARTICLES_MERGED ); - my ( $LOCALIZE_LOG , $my_localize_log ) = File::Temp::tempfile(); - close( $LOCALIZE_LOG ); - - ## Get the localize en-US extract - if( $bAll || $bUseLocalize ){ - print "### Fetching source language strings\n"; - my $command = ""; - my $args = ""; - - if( $ENV{WRAPCMD} ){ - $command = $ENV{WRAPCMD}.$binpath."localize_sl"; - }else{ - $command = $binpath."localize_sl"; - } - print $command; - # -e - # if ( -x $command ){ - if( $command ){ - if( !$bVerbose ){ $args .= " -QQ "; } - $args .= " -e -f $localizeSDF -l "; - my $bFlag=""; - if( $bAll ) {$args .= " en-US";} - else{ - my @list; - foreach my $isokey ( keys( %{ $langhash_ref } ) ){ - push @list , $isokey; - if( $langhash_ref->{ $isokey } ne "" ){ - push @list , $langhash_ref->{ $isokey }; - } - } - remove_duplicates( \@list ); - foreach my $isokey ( @list ){ - switch :{ - ( $isokey=~ /^en-US$/i ) - && do{ - if( $bFlag eq "TRUE" ){ $args .= ",en-US"; } - else { - $args .= "en-US"; $bFlag = "TRUE"; - } - }; - - } #switch - } #foreach - } # if - } # if -# if ( !$bVerbose ){ -# if ( $WIN eq "TRUE" ) { $args .= " > $my_localize_log"; } -# else { $args .= " >& $my_localize_log"; } -# } - if ( $bVerbose ) { print STDOUT $command.$args."\n"; } - - my $rc = system( $command.$args ); - - if( $rc < 0 ){ print STDERR "ERROR: localize rc = $rc\n"; exit( -1 ); } - ( $localizehash_ref ) = read_file( $localizeSDF , $langhash_ref ); - - } - ## Get sdf particles -#***************** - open ALLPARTICLES_MERGED , "+>> $particleSDF_merged" - or die "Can't open $particleSDF_merged"; - - ## Fill fackback hash - my( $fallbackhashhash_ref ) = fetch_fallback( \@sdfparticles , $localizeSDF , $langhash_ref ); - my %block; - my $cur_fallback; - if( !$bAll) { - foreach my $cur_lang ( keys( %{ $langhash_ref } ) ){ - #print STDOUT "DBG: G1 cur_lang=$cur_lang\n"; - $cur_fallback = $langhash_ref->{ $cur_lang }; - if( $cur_fallback ne "" ){ - # Insert fallback strings - #print STDOUT "DBG: Renaming $cur_fallback to $cur_lang in fallbackhash\n"; - rename_language( $fallbackhashhash_ref , $cur_fallback , $cur_lang ); - } - foreach my $currentfile ( @sdfparticles ){ - if ( open MYFILE , "< $currentfile" ) { - while(){ - if( /$sdf_regex/ ){ - my $line = defined $_ ? $_ : ''; - my $prj = defined $3 ? $3 : ''; - my $file = defined $4 ? $4 : ''; - my $type = defined $6 ? $6 : ''; - my $gid = defined $7 ? $7 : ''; - my $lid = defined $8 ? $8 : ''; - my $lang = defined $12 ? $12 : ''; - my $plattform = defined $10 ? $10 : ''; - my $helpid = defined $9 ? $9 : ''; - - chomp( $line ); - - if ( $lang eq $cur_lang ){ - # Overwrite fallback strings with collected strings - #if( ( !has_two_sourcelanguages( $cur_lang) && $cur_lang eq "de" ) || $cur_lang ne "en-US" ){ - $fallbackhashhash_ref->{ $cur_lang }{ $prj.$gid.$lid.$file.$type.$plattform.$helpid } = $line ; - #} - - } - } - } - }else { print STDERR "WARNING: Can't open file $currentfile"; } - } - - foreach my $line ( keys( %{$fallbackhashhash_ref->{ $cur_lang } } )) { - if( #$cur_lang ne "de" && - $cur_lang ne "en-US" ){ - print ALLPARTICLES_MERGED ( $fallbackhashhash_ref->{ $cur_lang }{ $line }, "\n" ); - } - } - } - } else { - foreach my $currentfile ( @sdfparticles ){ - if ( open MYFILE , "< $currentfile" ) { - while( ){ - print ALLPARTICLES_MERGED ( $_, "\n" ); # recheck de / en-US ! - } - } - else { print STDERR "WARNING: Can't open file $currentfile"; } - } - } - close ALLPARTICLES_MERGED; -#*************** - - # Hash of array - my %output; - my @order; - - ## Join both - if( $outputfile ){ - if( open DESTFILE , "+> $outputfile" ){ - if( !open LOCALIZEPARTICLE , "< $localizeSDF" ) { print STDERR "ERROR: Can't open file $localizeSDF\n"; } - if( !open ALLPARTICLES_MERGED , "< $particleSDF_merged" ) { print STDERR "ERROR: Can't open file $particleSDF_merged\n"; } - - # Insert localize - my $extract_date=""; - while ( ){ - if( /$sdf_regex/ ){ - my $leftpart = defined $2 ? $2 : ''; - my $lang = defined $12 ? $12 : ''; - my $rightpart = defined $13 ? $13 : ''; - my $timestamp = defined $18 ? $18 : ''; - - my $prj = defined $3 ? $3 : ''; - my $file = defined $4 ? $4 : ''; - my $type = defined $6 ? $6 : ''; - my $gid = defined $7 ? $7 : ''; - my $lid = defined $8 ? $8 : ''; - #my $lang = defined $12 ? $12 : ''; - my $plattform = defined $10 ? $10 : ''; - my $helpid = defined $9 ? $9 : ''; - - - if( $use_default_date ) - { - $extract_date = "$default_date\n" ; - } - elsif( $extract_date eq "" ) { - $extract_date = $timestamp ; - $extract_date =~ tr/\r\n//d; - $extract_date .= "\n"; - } - - if( $bAll ){ print DESTFILE $leftpart."\t".$lang."\t".$rightpart.$extract_date ; } - else { - foreach my $sLang ( keys( %{ $langhash_ref } ) ){ - if( $sLang=~ /all/i ) { - push @{ $output{ $prj.$gid.$lid.$file.$type.$plattform.$helpid } } , $leftpart."\t".$lang."\t".$rightpart.$extract_date ; - #print DESTFILE $leftpart."\t".$lang."\t".$rightpart.$extract_date; - } - #if( $sLang eq "de" && $lang eq "de" ) { - # push @{ $output{ $prj.$gid.$lid.$file.$type.$plattform.$helpid } } , $leftpart."\t".$lang."\t".$rightpart.$extract_date ; - #print DESTFILE $leftpart."\t".$lang."\t".$rightpart.$extract_date; - #} - if( $sLang eq "en-US" && $lang eq "en-US" ) { - push @order , $prj.$gid.$lid.$file.$type.$plattform.$helpid; - if( !$bFakeEnglish ){ push @{ $output{ $prj.$gid.$lid.$file.$type.$plattform.$helpid } } , $leftpart."\t".$lang."\t".$rightpart.$extract_date ; } - #print DESTFILE $leftpart."\t".$lang."\t".$rightpart.$extract_date; - } - - } - } - } - } - # Insert particles - while ( ){ - if( /$sdf_regex/ ){ - my $leftpart = defined $2 ? $2 : ''; - my $prj = defined $3 ? $3 : ''; - my $lang = defined $12 ? $12 : ''; - my $rightpart = defined $13 ? $13 : ''; - my $timestamp = defined $18 ? $18 : ''; - - #my $prj = defined $3 ? $3 : ''; - my $file = defined $4 ? $4 : ''; - my $type = defined $6 ? $6 : ''; - my $gid = defined $7 ? $7 : ''; - my $lid = defined $8 ? $8 : ''; - #my $lang = defined $12 ? $12 : ''; - my $plattform = defined $10 ? $10 : ''; - my $helpid = defined $9 ? $9 : ''; - - - if( $use_default_date ) - { - $extract_date = "$default_date\n" ; - } - elsif( $extract_date eq "" ) - { - $extract_date = $timestamp; - } - - if( ! ( $prj =~ /binfilter/i ) ) { - push @{ $output{ $prj.$gid.$lid.$file.$type.$plattform.$helpid } } , $leftpart."\t".$lang."\t".$rightpart.$extract_date ; - #print DESTFILE $leftpart."\t".$lang."\t".$rightpart.$extract_date ; - } - } - } - - # Write! - foreach my $curkey ( @order ){ - foreach my $curlist ( $output{ $curkey } ){ - foreach my $line ( @{$curlist} ){ - print DESTFILE $line; - } - } - } - - }else { print STDERR "Can't open $outputfile";} - } - close DESTFILE; - close LOCALIZEPARTICLE; - close ALLPARTICLES_MERGED; - - #print STDOUT "DBG: \$localizeSDF $localizeSDF \$particleSDF_merged $particleSDF_merged\n"; - unlink $localizeSDF , $particleSDF_merged , $my_localize_log; - - #sort_outfile( $outputfile ); - #remove_obsolete( $outputfile ) , if $bHasSourceLanguage ne ""; - } - -######################################################### -sub remove_obsolete{ - my $outfile = shift; - my @lines; - my $enusleftpart; - my @good_lines; - - print STDOUT "### Removing obsolete strings\n"; - - # Kick out all strings without en-US reference - if ( open ( SORTEDFILE , "< $outfile" ) ){ - while( ){ - if( /$sdf_regex/ ){ - my $line = defined $_ ? $_ : ''; - my $language = defined $12 ? $12 : ''; - my $prj = defined $3 ? $3 : ''; - my $file = defined $4 ? $4 : ''; - my $type = defined $6 ? $6 : ''; - my $gid = defined $7 ? $7 : ''; - my $lid = defined $8 ? $8 : ''; - my $plattform = defined $10 ? $10 : ''; - my $helpid = defined $9 ? $9 : ''; - - my $leftpart = $prj.$gid.$lid.$file.$type.$plattform.$helpid; - - if( $language eq "en-US" ){ # source string found, 1. entry - $enusleftpart = $leftpart; - push @good_lines , $line; - }else{ - if( !defined $enusleftpart or !defined $leftpart ){ - print STDERR "BADLINE: $line\n"; - print STDERR "\$enusleftpart = $enusleftpart\n"; - print STDERR "\$leftpart = $leftpart\n"; - } - if( $enusleftpart eq $leftpart ){ # matching language - push @good_lines , $line; - } - #else{ - # print STDERR "OUT: \$enusleftpart=$enusleftpart \$leftpart=$leftpart \$line=$line\n"; - #} - } - } - } - close SORTEDFILE; - } else { print STDERR "ERROR: Can't open file $outfile\n";} - - # Write file - if ( open ( SORTEDFILE , "> $outfile" ) ){ - foreach my $newline ( @good_lines ) { - print SORTEDFILE $newline; - } - close SORTEDFILE; - } else { print STDERR "ERROR: Can't open file $outfile\n";} - -} -######################################################### -sub sort_outfile{ - my $outfile = shift; - print STDOUT "### Sorting ... $outfile ..."; - my @lines; - my @sorted_lines; - - - #if ( open ( SORTEDFILE , "< $outputfile" ) ){ - if ( open ( SORTEDFILE , "< $outfile" ) ){ - my $line; - while ( ){ - $line = $_; - if( $line =~ /^[^\#]/ ){ - push @lines , $line; - } - } - close SORTEDFILE; - @sorted_lines = sort { - my $xa_lang = ""; - my $xa_left_part = ""; - my $xa_right_part = ""; - my $xa_timestamp = ""; - my $xb_lang = ""; - my $xb_left_part = ""; - my $xb_right_part = ""; - my $xb_timestamp = ""; - my $xa = ""; - my $xb = ""; - my @alist; - my @blist; - - if( $a=~ /$sdf_regex/ ){ - $xa_left_part = defined $2 ? $2 : ''; - $xa_lang = defined $12 ? $12 : ''; - $xa_right_part = defined $13 ? $13 : ''; - $xa_left_part = remove_last_column( $xa_left_part ); - - } - if( $b=~ /$sdf_regex/ ){ - $xb_left_part = defined $2 ? $2 : ''; - $xb_lang = defined $12 ? $12 : ''; - $xb_right_part = defined $13 ? $13 : ''; - $xb_left_part = remove_last_column( $xb_left_part ); - - - } - if( ( $xa_left_part cmp $xb_left_part ) == 0 ){ # Left part equal - if( ( $xa_lang cmp $xb_lang ) == 0 ){ # Lang equal - return ( $xa_right_part cmp $xb_right_part ); # Right part compare - } - elsif( $xa_lang eq "en-US" ) { return -1; } # en-US wins - elsif( $xb_lang eq "en-US" ) { return 1; } # en-US wins - else { return $xa_lang cmp $xb_lang; } # lang compare - } - else { - return $xa_left_part cmp $xb_left_part; # Left part compare - } - } @lines; - - if ( open ( SORTEDFILE , "> $outfile" ) ){ - print SORTEDFILE get_license_header(); - foreach my $newline ( @sorted_lines ) { - print SORTEDFILE $newline; - #print STDOUT $newline; - } - } - close SORTEDFILE; - } else { print STDERR "WARNING: Can't open file $outfile\n";} - print "done\n"; - -} -######################################################### -sub remove_last_column{ - my $string = shift; - my @alist = split ( "\t" , $string ); - pop @alist; - return join( "\t" , @alist ); -} - -######################################################### -sub rename_language{ - my $fallbackhashhash_ref = shift; - my $cur_fallback = shift; - my $cur_lang = shift; - my $line; - - foreach my $key( keys ( %{ $fallbackhashhash_ref->{ $cur_fallback } } ) ){ - $line = $fallbackhashhash_ref->{ $cur_fallback }{ $key }; - if( $line =~ /$sdf_regex/ ){ - my $leftpart = defined $2 ? $2 : ''; - my $lang = defined $12 ? $12 : ''; - my $rightpart = defined $13 ? $13 : ''; - - $fallbackhashhash_ref->{ $cur_lang }{ $key } = $leftpart."\t".$cur_lang."\t".$rightpart; - } - } -} - -############################################################ -sub remove_duplicates{ - my $list_ref = shift; - my %tmphash; - foreach my $key ( @{ $list_ref } ){ $tmphash{ $key } = '' ; } - @{$list_ref} = keys( %tmphash ); -} - -############################################################## -sub fetch_fallback{ - my $sdfparticleslist_ref = shift; - my $localizeSDF = shift; - my $langhash_ref = shift; - my %fallbackhashhash; - my $cur_lang; - my @langlist; - - foreach my $key ( keys ( %{ $langhash_ref } ) ){ - $cur_lang = $langhash_ref->{ $key }; - if ( $cur_lang ne "" ) { - push @langlist , $cur_lang; - } - } - remove_duplicates( \@langlist ); - foreach $cur_lang ( @langlist ){ - if( $cur_lang eq "en-US" ){ - read_fallbacks_from_source( $localizeSDF , $cur_lang , \%fallbackhashhash ); - } - } - - # remove de / en-US - my @tmplist; - foreach $cur_lang( @langlist ){ - if( $cur_lang ne "en-US" ){ - push @tmplist , $cur_lang; - - } - } - @langlist = @tmplist; - if ( $#langlist +1 ){ - read_fallbacks_from_particles( $sdfparticleslist_ref , \@langlist , \%fallbackhashhash ); - - } - return (\%fallbackhashhash); -} - -######################################################### -sub write_file{ - - my $localizeFile = shift; - my $index_ref = shift; - - if( open DESTFILE , "+> $localizeFile" ){ - foreach my $key( %{ $index_ref } ){ - print DESTFILE ($index_ref->{ $key }, "\n" ); - } - close DESTFILE; - }else { - print STDERR "Can't open/create '$localizeFile'"; - } -} - -######################################################### -sub read_file{ - - my $sdffile = shift; - my $langhash_ref = shift; - my %block = (); - - open MYFILE , "< $sdffile" - or die "Can't open '$sdffile'\n"; - while( ){ - if( /$sdf_regex/ ){ - my $line = defined $_ ? $_ : ''; - my $prj = defined $3 ? $3 : ''; - my $file = defined $4 ? $4 : ''; - my $type = defined $6 ? $6 : ''; - my $gid = defined $7 ? $7 : ''; - my $lid = defined $8 ? $8 : ''; - my $plattform = defined $10 ? $10 : ''; - my $lang = defined $12 ? $12 : ''; - my $helpid = defined $9 ? $9 : ''; - - foreach my $isolang ( keys ( %{ $langhash_ref } ) ){ - if( $isolang=~ /$lang/i || $isolang=~ /all/i ) { $block{$prj.$gid.$lid.$file.$type.$plattform.$helpid } = $line ; } - } - } - } - return (\%block); -} - -######################################################### -sub read_fallbacks_from_particles{ - - my $sdfparticleslist_ref = shift; - my $isolanglist_ref = shift; - my $fallbackhashhash_ref = shift; - my $block_ref; - foreach my $currentfile ( @{ $sdfparticleslist_ref } ){ - if ( open MYFILE , "< $currentfile" ) { - while(){ - if( /$sdf_regex/ ){ - my $line = defined $_ ? $_ : ''; - my $prj = defined $3 ? $3 : ''; - my $file = defined $4 ? $4 : ''; - my $type = defined $6 ? $6 : ''; - my $gid = defined $7 ? $7 : ''; - my $lid = defined $8 ? $8 : ''; - my $lang = defined $12 ? $12 : ''; - my $plattform = defined $10 ? $10 : ''; - my $helpid = defined $9 ? $9 : ''; - - chomp( $line ); - - foreach my $isolang ( @{$isolanglist_ref} ){ - if( $isolang=~ /$lang/i ) { - $fallbackhashhash_ref->{ $isolang }{ $prj.$gid.$lid.$file.$type.$plattform.$helpid } = $line ; - } - } - } - } - }else { print STDERR "WARNING: Can't open file $currentfile"; } - } -} - -######################################################### -sub read_fallbacks_from_source{ - - my $sdffile = shift; - my $isolang = shift; - my $fallbackhashhash_ref = shift; - my $block_ref; - # read fallback for single file - open MYFILE , "< $sdffile" - or die "Can't open '$sdffile'\n"; - - while( ){ - if( /$sdf_regex/ ){ - my $line = defined $_ ? $_ : ''; - my $prj = defined $3 ? $3 : ''; - my $file = defined $4 ? $4 : ''; - my $type = defined $6 ? $6 : ''; - my $gid = defined $7 ? $7 : ''; - my $lid = defined $8 ? $8 : ''; - my $helpid = defined $9 ? $9 : ''; - my $lang = defined $12 ? $12 : ''; - my $plattform = defined $10 ? $10 : ''; - - chomp( $line ); - if( $isolang=~ /$lang/i ) { $fallbackhashhash_ref->{ $isolang }{ $prj.$gid.$lid.$file.$type.$plattform.$helpid } = $line ; - } - } - } -} - -######################################################### -sub parseLanguages{ - - my $bAll; - my $bUseLocalize; - my $bHasSourceLanguage=""; - my $bFakeEnglish=""; - my %langhash; - my $iso=""; - my $fallback=""; - - #### -l all - if( $languages=~ /all/ ){ - $bAll = "TRUE"; - $bHasSourceLanguage = "TRUE"; - } - ### -l fr=de,de - elsif( $languages=~ /.*,.*/ ){ - my @tmpstr = split "," , $languages; - for my $lang ( @tmpstr ){ - if( $lang=~ /([a-zA-Z]{2,3}(-[a-zA-Z\-]*)*)(=([a-zA-Z]{2,3}(-[a-zA-Z\-]*)*))?/ ){ - $iso = $1; - $fallback = $4; - - if( ( $iso && $iso=~ /(en-US)/i ) || ( $fallback && $fallback=~ /(en-US)/i ) ) { - $bUseLocalize = "TRUE"; - } - if( ( $iso && $iso=~ /(en-US)/i ) ) { - $bHasSourceLanguage = "TRUE"; - } - if( $fallback ) { $langhash{ $iso } = $fallback; } - else { $langhash{ $iso } = ""; } - } - } - } - ### -l de - else{ - if( $languages=~ /([a-zA-Z]{2,3}(-[a-zA-Z\-]*)*)(=([a-zA-Z]{2,3}(-[a-zA-Z\-]*)*))?/ ){ - $iso = $1; - $fallback = $4; - - if( ( $iso && $iso=~ /(en-US)/i ) || ( $fallback && $fallback=~ /(en-US)/i ) ) { - $bUseLocalize = "TRUE"; - - } - if( ( $iso && $iso=~ /(en-US)/i ) ) { - $bHasSourceLanguage = "TRUE"; - } - - if( $fallback ) { $langhash{ $iso } = $fallback; } - else { $langhash{ $iso } = ""; } - } - } - # HACK en-US always needed! - if( !$bHasSourceLanguage ){ - #$bHasSourceLanguage = "TRUE"; - $bUseLocalize = "TRUE"; - $bFakeEnglish = "TRUE"; - $langhash{ "en-US" } = ""; - } - return ( $bAll , $bUseLocalize , \%langhash , $bHasSourceLanguage, $bFakeEnglish); -} - -######################################################### -sub parse_options{ - - my $help; - my $merge; - my $extract; - my $success = GetOptions('f=s' => \$sdffile , 'l=s' => \$languages , 's=s' => \$srcpath , 'h' => \$help , 'v' => \$bVerbose , - 'm' => \$merge , 'e' => \$extract , 'x' => \$no_sort , 'd' => \$use_default_date , 'c' => \$create_dirs , - 'n' => \$no_gsicheck , 'o' => \$force_ooo_module ); - $outputfile = $sdffile; - - #print STDOUT "DBG: lang = $languages\n"; - if( !$srcpath ){ - $srcpath = "$ENV{SRC_ROOT}"; - if( !$srcpath ){ - print STDERR "No path to the source root found!\n\n"; - usage(); - exit(1); - } - } - if( $help ){ - usage(); - exit(0); - } - if( !$success || $#ARGV > 1 || ( !$sdffile ) ){ - usage(); - exit(1); - } - if( $merge && $sdffile && ! ( -r $sdffile)){ - print STDERR "Can't open file '$sdffile'\n"; - exit(1); - } - if( !( $languages=~ /[a-zA-Z]{2,3}(-[a-zA-Z\-]*)*(=[a-zA-Z]{2,3}(-[a-zA-Z\-]*)*)?(,[a-zA-Z]{2,3}(-[a-zA-Z\-]*)*(=[a-zA-Z]{2,3}(-[a-zA-Z\-]*)*)?)*/ ) ){ - print STDERR "Please check the -l iso code\n"; - exit(1); - } - if( ( !$merge && !$extract ) || ( $merge && $extract ) ){ usage();exit( -1 );} - if( $extract ){ $mode = "extract"; } - else { $mode = "merge"; } -} -#my $multi_localize_files = ''; h -#my $module_to_merge = ''; i -#my $sort_sdf_before = ''; g - -######################################################### -sub usage{ - - print STDERR "Usage: localize.pl\n"; - print STDERR "Split or collect SDF files\n"; - print STDERR " merge: -m -f -l l1[=f1][,l2[=f2]][...] [ -s ] [ -c ]\n"; - print STDERR " extract: -e -f -l [ -s ] [-d]\n"; - print STDERR "Options:\n"; - print STDERR " -h help\n"; - print STDERR " -m Merge mode\n"; - print STDERR " -e Extract mode\n"; - print STDERR " -f To split a big SDF file into particles\n"; - print STDERR " To collect and join all particles to one big file\n"; - print STDERR " -s Path to the modules, if no \$SRC_ROOT is set\n"; - print STDERR " -l ( all | | =fallback ) comma seperated languages\n"; - print STDERR " -d Use default date in extracted sdf file\n"; - print STDERR " -c Create needed directories\n"; - print STDERR " -g Sort sdf file before mergeing\n"; - print STDERR " -h File with localize.sdf's\n!"; - print STDERR " -n No gsicheck\n"; - print STDERR " -i Module to merge\n"; - print STDERR " -o force using ooo localization from the l10n module instead of l10n_so; \n"; - print STDERR " useful if the type can't be detected by the .svn tags; \n"; - print STDERR " -v Verbose\n"; - print STDERR "\nExample:\n"; - print STDERR "\nlocalize -e -l en-US,pt-BR=en-US -f my.sdf\n( Extract en-US and pt-BR with en-US fallback )\n"; - print STDERR "\nlocalize -m -l cs -f my.sdf\n( Merge cs translation into the sourcecode ) \n"; -} - -# my $line = defined $_ ? $_ : ''; -# my $leftpart = defined $2 ? $2 : ''; -# my $prj = defined $3 ? $3 : ''; -# my $file = defined $4 ? $4 : ''; -# my $dummy = defined $5 ? $5 : ''; -# my $type = defined $6 ? $6 : ''; -# my $gid = defined $7 ? $7 : ''; -# my $lid = defined $8 ? $8 : ''; -# my $helpid = defined $9 ? $9 : ''; -# my $plattform = defined $10 ? $10 : ''; -# my $width = defined $11 ? $11 : ''; -# my $lang = defined $12 ? $12 : ''; -# my $rightpart = defined $13 ? $13 : ''; -# my $text = defined $14 ? $14 : ''; -# my $helptext = defined $15 ? $15 : ''; -# my $quickhelptext = defined $16 ? $16 : ''; -# my $title = defined $17 ? $17 : ''; -# my $timestamp = defined $18 ? $18 : ''; - diff --git a/transex3/scripts/localize_old.pl b/transex3/scripts/localize_old.pl deleted file mode 100755 index 151399d22002..000000000000 --- a/transex3/scripts/localize_old.pl +++ /dev/null @@ -1,1130 +0,0 @@ -: -eval 'exec perl -wS $0 ${1+"$@"}' - if 0; - - -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: localize.pl,v $ -# -# $Revision: 1.18 $ -# -# 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 -# -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -use strict; -use Getopt::Long; -use IO::Handle; -use File::Find; -use File::Temp; -use File::Copy; -use File::Glob qw(:glob csh_glob); -use Cwd; - -# ver 1.1 -# -#### module lookup -#use lib ("$ENV{SOLARENV}/bin/modules", "$ENV{COMMON_ENV_TOOLS}/modules"); - -#### module lookup -# OOo conform -my @lib_dirs; -BEGIN { - if ( !defined($ENV{SOLARENV}) ) { - die "No environment found (environment variable SOLARENV is undefined)"; - } - push(@lib_dirs, "$ENV{SOLARENV}/bin/modules"); - push(@lib_dirs, "$ENV{COMMON_ENV_TOOLS}/modules") if defined($ENV{COMMON_ENV_TOOLS}); -} -use lib (@lib_dirs); - -#### globals #### -my $sdffile = ''; -my $no_sort = ''; -my $outputfile = ''; -my $mode = ''; -my $bVerbose="0"; -my $srcpath = ''; -my $WIN; -my $languages; -#my %sl_modules; # Contains all modules where en-US and de is source language -my $use_default_date = '0'; - - # ( leftpart ) ( rightpart ) - # prj file dummy type gid lid helpid pform width lang text helptext qhelptext title timestamp -my $sdf_regex = "((([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*))\t([^\t]*)\t(([^\t]*)\t([^\t]*)\t([^\t]*)\t([^\t]*)\t)([^\t]*))"; -my $file_types = "(src|hrc|xcs|xcu|lng|ulf|xrm|xhp|xcd|xgf|xxl|xrb)"; -# Always use this date to prevent cvs conflicts -my $default_date = "2002-02-02 02:02:02"; - -#### main #### -parse_options(); - -if ( defined $ENV{USE_SHELL} && $ENV{USE_SHELL} eq '4nt' ) { - $WIN = 'TRUE'; -} - else { - $WIN = ''; -} - -#%sl_modules = fetch_sourcelanguage_dirlist(); - - -if ( $mode eq "merge" ) { - merge_gsicheck(); - splitfile( $sdffile ); - unlink $sdffile; # remove temp file! -} -elsif( $mode eq "extract" ) { - collectfiles( $outputfile ); -} -else { - usage(); -} - -exit(0); - -######################################################### -sub splitfile{ - - my $lastFile = ''; - my $currentFile = ''; - my $cur_sdffile = ''; - my $last_sdffile = ''; - my $delim; - my $badDelim; - my $start = 'TRUE'; - my %index = (); - my %block; - - STDOUT->autoflush( 1 ); - - #print STDOUT "Open File $sdffile\n"; - open MYFILE , "< $sdffile" - or die "Can't open '$sdffile'\n"; - - while( ){ - if( /$sdf_regex/ ){ - my $line = defined $_ ? $_ : ''; - my $prj = defined $3 ? $3 : ''; - my $file = defined $4 ? $4 : ''; - my $type = defined $6 ? $6 : ''; - my $gid = defined $7 ? $7 : ''; - my $lid = defined $8 ? $8 : ''; - my $lang = defined $12 ? $12 : ''; - my $plattform = defined $10 ? $10 : ''; - my $helpid = defined $9 ? $9 : ''; - - next if( $prj eq "binfilter" ); # Don't merge strings into binfilter module - chomp( $line ); - $currentFile = $srcpath . '\\' . $prj . '\\' . $file; - if ( $WIN ) { $currentFile =~ s/\//\\/g; } - else { $currentFile =~ s/\\/\//g; } - - $cur_sdffile = $currentFile; - #if( $cur_sdffile =~ /\.$file_types[\s]*$/ ){ - if( $WIN ) { $cur_sdffile =~ s/\\[^\\]*\.$file_types[\s]*$/\\localize.sdf/; } - else { $cur_sdffile =~ s/\/[^\/]*\.$file_types[\s]*$/\/localize.sdf/; } - #} - - # Set default date - if( $line =~ /(.*)\t[^\t\$]*$/ ){ - $line = $1."\t".$default_date; - } - - if( $start ){ - $start=''; - $lastFile = $currentFile; # ? - $last_sdffile = $cur_sdffile; - } - - if( $lang eq "en-US" ){} - elsif( $cur_sdffile eq $last_sdffile ) - { - $block{ "$prj\t$file\t$type\t$gid\t$lid\t$helpid\t$plattform\t$lang" } = $line ; - } - else - { - writesdf( $lastFile , \%block ); - $lastFile = $currentFile; #? - $last_sdffile = $cur_sdffile; - %block = (); - #if( ! $lang eq "en-US" ) { - $block{ "$prj\t$file\t$type\t$gid\t$lid\t$helpid\t$plattform\t$lang" } = $line ; - #} - - } - } #else { print STDOUT "splitfile REGEX kaputt\n";} - - } - writesdf( $lastFile , \%block ); - %block = (); - close( MYFILE ); - -} -######################################################### - -#sub fetch_sourcelanguage_dirlist -#{ -# -# my $working_path = getcwd(); -# my %sl_dirlist; -# -# chdir $srcpath; -# my @all_dirs = csh_glob( "*" ); -# -# foreach my $file ( @all_dirs ) -# { -# if( -d $file ) -# { -# my $module = $file; -# $file .= "/prj/l10n"; -# $file =~ s/\//\\/ , if( $WIN ) ; -# -# if( -f $file ) # Test file /prj/l10n -# { -# $sl_dirlist{ $module } = 1; -# if( $bVerbose eq "1" ) { print STDOUT "$module: de and en-US source language detected\n"; } -# } -# } -# } -# -# chdir $working_path; -# -# return %sl_dirlist; -#} - -#sub has_two_sourcelanguages -#{ -# my $module = shift; -# return defined $sl_modules{ $module } ; -#} -sub writesdf{ - - my $lastFile = shift; - my $blockhash_ref = shift; - my $localizeFile = $lastFile; - my %index=(); - - if( $localizeFile =~ /\.$file_types[\s]*$/ ){ - if( $WIN ) { $localizeFile =~ s/\\[^\\]*\.$file_types[\s]*$/\\localize.sdf/; } - else { $localizeFile =~ s/\/[^\/]*\.$file_types[\s]*$/\/localize.sdf/; } - }else { - print STDERR "Strange filetype found '$localizeFile'\n"; - return; - } - if( open DESTFILE , "< $localizeFile" ){ - - #or die "Can't open/create '\$localizeFile'"; - - #### Build hash - while(){ - if( /$sdf_regex/ ){ - my $line = defined $_ ? $_ : ''; - my $prj = defined $3 ? $3 : ''; - my $file = defined $4 ? $4 : ''; - my $type = defined $6 ? $6 : ''; - my $gid = defined $7 ? $7 : ''; - my $lid = defined $8 ? $8 : ''; - my $lang = defined $12 ? $12 : ''; - my $plattform = defined $10 ? $10 : ''; - my $helpid = defined $9 ? $9 : ''; - - chomp( $line ); - $index{ "$prj\t$file\t$type\t$gid\t$lid\t$helpid\t$plattform\t$lang" } = $line ; - - } #else { print STDOUT "writesdf REGEX kaputt $_\n";} - - } - close( DESTFILE ); - } - #### Copy new strings - my @mykeys = keys( %{ $blockhash_ref } ); - my $isDirty = "FALSE"; - foreach my $key( @mykeys ){ - if( ! defined $index{ $key } ){ - # Add new entry - $index{ $key } = $blockhash_ref->{ $key} ; - $isDirty = "TRUE"; - }elsif( $index{ $key } ne $blockhash_ref->{ $key } ){ - # Overwrite old entry - $index{ $key } = $blockhash_ref->{ $key }; - $isDirty = "TRUE"; - }else { - } - } - - #### Write file - - if( !$bVerbose ){ print STDOUT "."; } - if( $isDirty eq "TRUE" ){ - if( $bVerbose ){ print STDOUT "$localizeFile\n"; } - if( open DESTFILE , "+> $localizeFile" ){ - print DESTFILE get_license_header(); - @mykeys = sort keys( %index ); - foreach my $key( @mykeys ){ - print DESTFILE ( $index{ $key } , "\n" ); - } - close DESTFILE; - }else { - print STDOUT "WARNING: File $localizeFile is not writable , try to merge ...\n"; - my ( $TMPFILE , $tmpfile ) = File::Temp::tempfile(); - if( open DESTFILE , "+> $tmpfile " ){ - @mykeys = keys( %index ); - foreach my $key( @mykeys ){ - print DESTFILE ( $index{ $key } , "\n" ); - } - close DESTFILE; - if( move( $localizeFile , $localizeFile.".backup" ) ){ - if( copy( $tmpfile , $localizeFile ) ){ - unlink $localizeFile.".backup"; - } else { print STDERR "Can't open/create '$localizeFile', original file is renamed to $localizeFile.backup\n"; } - } else { print STDERR "Can't open/create '$localizeFile'\n"; } - }else{ - print STDERR "WARNING: Can't open/create '$localizeFile'\n"; - } - unlink $tmpfile; - } - } -# if( $no_sort eq '' ){ -# sort_outfile( $localizeFile ); -# } -} - -sub get_license_header{ - return -"#\n". -"# #### ### # # ### ##### ##### #### ##### ##### \n". -"# # # # # ## # # # # # # # # # \n". -"# # # # # # # # # # # ### # # # # \n". -"# # # # # # ## # # # # # # # # \n". -"# #### ### # # ### # ##### #### ##### # \n". -"#\n". -"# DO NOT EDIT! This file will be overwritten by localisation process\n". -"#\n". -"#*************************************************************************\n". -"#\n". -"# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n". -"# \n". -"# Copyright 2008 by Sun Microsystems, Inc.\n". -"#\n". -"# OpenOffice.org - a multi-platform office productivity suite\n". -"#\n". -"# \$RCSfile:". -"localize.pl,v \$\n". -"#\n". -"# \$Revision: ". -"1.17.4.1 \$\n". -"#\n". -"# This file is part of OpenOffice.org.\n". -"#\n". -"# OpenOffice.org is free software: you can redistribute it and/or modify\n". -"# it under the terms of the GNU Lesser General Public License version 3\n". -"# only, as published by the Free Software Foundation.\n". -"#\n". -"# OpenOffice.org is distributed in the hope that it will be useful,\n". -"# but WITHOUT ANY WARRANTY; without even the implied warranty of\n". -"# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n". -"# GNU Lesser General Public License version 3 for more details\n". -"# (a copy is included in the LICENSE file that accompanied this code).\n". -"#\n". -"# You should have received a copy of the GNU Lesser General Public License\n". -"# version 3 along with OpenOffice.org. If not, see\n". -"# \n". -"# for a copy of the LGPLv3 License.\n". -"#\n". -"#*************************************************************************\n"; -} -######## Check input sdf file and use only the correct part -sub merge_gsicheck{ - my $command = ''; - my ( $TMPHANDLE , $tmpfile ) = File::Temp::tempfile(); - my ( $TMPHANDLE2 , $tmpfile2 ) = File::Temp::tempfile(); - close ( $TMPHANDLE ); - close ( $TMPHANDLE2 ); - - unlink $tmpfile2; - my $output2 = `cat $sdffile | sort > $tmpfile2`; - my $rc2 = $? << 8; - if( $rc2 ne 0 ){ - printf("ERROR: Failed -> cat $sdffile | sort > $tmpfile2\n$output2\n"); - exit( -1 ); - } - -# if( $ENV{WRAPCMD} ){ -# $command = "$ENV{WRAPCMD} gsicheck"; -# }else{ -# $command = "gsicheck"; -# } -# my $errfile = $tmpfile.".err"; -# $command .= " -k -c -wcf $tmpfile -wef $errfile -l \"\" $tmpfile2"; -# my $output = `$command`; -# my $rc = $? << 8; -# if ( $output ne "" ){ -# print STDOUT "### gsicheck ###\n"; -# print STDOUT "### The file $errfile have been written containing the errors in your sdf file. Those lines will not be merged: ###\n\n"; -# print STDOUT "$output\n"; -# print STDOUT "################\n"; -# -# }else{ -# # Remove the 0 Byte file -# unlink $errfile; -# } - $sdffile = $tmpfile2; -# unlink $tmpfile2; -} -######################################################### -sub collectfiles{ - print STDOUT "### Localize\n"; - my @sdfparticles; - my $localizehash_ref; - my ( $bAll , $bUseLocalize, $langhash_ref , $bHasSourceLanguage , $bFakeEnglish ) = parseLanguages(); - - # Enable autoflush on STDOUT - # $| = 1; - STDOUT->autoflush( 1 ); - - ### Search sdf particles - print STDOUT "### Searching sdf particles\n"; - my $working_path = getcwd(); - chdir $srcpath; - find sub { - my $file = $File::Find::name; - if( -f && $file =~ /.*localize.sdf$/ ) { - push @sdfparticles , $file; - if( $bVerbose eq "1" ) { print STDOUT "$file\n"; } - else { print "."; } - - } - } , getcwd() ;#"."; #$srcpath; - chdir $working_path; - - my $nFound = $#sdfparticles +1; - print "\n $nFound files found !\n"; - - my ( $LOCALIZEPARTICLE , $localizeSDF ) = File::Temp::tempfile(); - close( $LOCALIZEPARTICLE ); - - my ( $ALLPARTICLES_MERGED , $particleSDF_merged ) = File::Temp::tempfile(); - close( $ALLPARTICLES_MERGED ); - my ( $LOCALIZE_LOG , $my_localize_log ) = File::Temp::tempfile(); - close( $LOCALIZE_LOG ); - - ## Get the localize de,en-US extract - if( $bAll || $bUseLocalize ){ - print "### Fetching source language strings\n"; - my $command = ""; - my $args = ""; - - if( $ENV{WRAPCMD} ){ - $command = "$ENV{WRAPCMD} localize_sl"; - }else{ - $command = "localize_sl"; - } - - # -e - # if ( -x $command ){ - if( $command ){ - if( !$bVerbose ){ $args .= " -QQ -skip_links "; } - $args .= " -e -f $localizeSDF -l "; - my $bFlag=""; - if( $bAll ) {$args .= " en-US";} - else{ - my @list; - foreach my $isokey ( keys( %{ $langhash_ref } ) ){ - push @list , $isokey; - if( $langhash_ref->{ $isokey } ne "" ){ - push @list , $langhash_ref->{ $isokey }; - } - } - remove_duplicates( \@list ); - foreach my $isokey ( @list ){ - switch :{ - #( $isokey=~ /^de$/i ) - # && do{ - # if( $bFlag eq "TRUE" ){ $args .= ",de"; } - # else { - # $args .= "de"; $bFlag = "TRUE"; - # } - # }; - ( $isokey=~ /^en-US$/i ) - && do{ - if( $bFlag eq "TRUE" ){ $args .= ",en-US"; } - else { - $args .= "en-US"; $bFlag = "TRUE"; - } - }; - - } #switch - } #foreach - } # if - } # if -# if ( !$bVerbose ){ -# if ( $WIN eq "TRUE" ) { $args .= " > $my_localize_log"; } -# else { $args .= " >& $my_localize_log"; } -# } - if ( $bVerbose ) { print STDOUT $command.$args."\n"; } - - my $rc = system( $command.$args ); - - #my $output = `$command.$args`; - #my $rc = $? << 8; - - if( $rc < 0 ){ print STDERR "ERROR: localize rc = $rc\n"; exit( -1 ); } - ( $localizehash_ref ) = read_file( $localizeSDF , $langhash_ref ); - - } - ## Get sdf particles - open ALLPARTICLES_MERGED , "+>> $particleSDF_merged" - or die "Can't open $particleSDF_merged"; - - ## Fill fackback hash - my( $fallbackhashhash_ref ) = fetch_fallback( \@sdfparticles , $localizeSDF , $langhash_ref ); -# my( $fallbackhashhash_ref ) = fetch_fallback( \@sdfparticles , $localizeSDF , $langhash_ref ); - my %block; - my $cur_fallback; - if( !$bAll) { - foreach my $cur_lang ( keys( %{ $langhash_ref } ) ){ - #print STDOUT "DBG: G1 cur_lang=$cur_lang\n"; - $cur_fallback = $langhash_ref->{ $cur_lang }; - if( $cur_fallback ne "" ){ - # Insert fallback strings - #print STDOUT "DBG: Renaming $cur_fallback to $cur_lang in fallbackhash\n"; - rename_language( $fallbackhashhash_ref , $cur_fallback , $cur_lang ); - } - foreach my $currentfile ( @sdfparticles ){ - if ( open MYFILE , "< $currentfile" ) { - while(){ - if( /$sdf_regex/ ){ - my $line = defined $_ ? $_ : ''; - my $prj = defined $3 ? $3 : ''; - my $file = defined $4 ? $4 : ''; - my $type = defined $6 ? $6 : ''; - my $gid = defined $7 ? $7 : ''; - my $lid = defined $8 ? $8 : ''; - my $lang = defined $12 ? $12 : ''; - my $plattform = defined $10 ? $10 : ''; - my $helpid = defined $9 ? $9 : ''; - - chomp( $line ); - - if ( $lang eq $cur_lang ){ - # Overwrite fallback strings with collected strings - #if( ( !has_two_sourcelanguages( $cur_lang) && $cur_lang eq "de" ) || $cur_lang ne "en-US" ){ - $fallbackhashhash_ref->{ $cur_lang }{ $prj.$gid.$lid.$file.$type.$plattform.$helpid } = $line ; - #} - - } - } - } - }else { print STDERR "WARNING: Can't open file $currentfile"; } - } - - foreach my $line ( keys( %{$fallbackhashhash_ref->{ $cur_lang } } )) { - if( #$cur_lang ne "de" && - $cur_lang ne "en-US" ){ - print ALLPARTICLES_MERGED ( $fallbackhashhash_ref->{ $cur_lang }{ $line }, "\n" ); - } - } - } - } else { - foreach my $currentfile ( @sdfparticles ){ - if ( open MYFILE , "< $currentfile" ) { - while( ){ - print ALLPARTICLES_MERGED ( $_, "\n" ); # recheck de / en-US ! - } - } - else { print STDERR "WARNING: Can't open file $currentfile"; } - } - } - close ALLPARTICLES_MERGED; - - - # Hash of array - my %output; - my @order; - - ## Join both - if( $outputfile ){ - if( open DESTFILE , "+> $outputfile" ){ - if( !open LOCALIZEPARTICLE , "< $localizeSDF" ) { print STDERR "ERROR: Can't open file $localizeSDF\n"; } - if( !open ALLPARTICLES_MERGED , "< $particleSDF_merged" ) { print STDERR "ERROR: Can't open file $particleSDF_merged\n"; } - - # Insert localize - my $extract_date=""; - while ( ){ - if( /$sdf_regex/ ){ - my $leftpart = defined $2 ? $2 : ''; - my $lang = defined $12 ? $12 : ''; - my $rightpart = defined $13 ? $13 : ''; - my $timestamp = defined $18 ? $18 : ''; - - my $prj = defined $3 ? $3 : ''; - my $file = defined $4 ? $4 : ''; - my $type = defined $6 ? $6 : ''; - my $gid = defined $7 ? $7 : ''; - my $lid = defined $8 ? $8 : ''; - #my $lang = defined $12 ? $12 : ''; - my $plattform = defined $10 ? $10 : ''; - my $helpid = defined $9 ? $9 : ''; - - - if( $use_default_date ) - { - $extract_date = "$default_date\n" ; - } - elsif( $extract_date eq "" ) { - $extract_date = $timestamp ; - $extract_date =~ tr/\r\n//d; - $extract_date .= "\n"; - } - - if( $bAll ){ print DESTFILE $leftpart."\t".$lang."\t".$rightpart.$extract_date ; } - else { - foreach my $sLang ( keys( %{ $langhash_ref } ) ){ - if( $sLang=~ /all/i ) { - push @{ $output{ $prj.$gid.$lid.$file.$type.$plattform.$helpid } } , $leftpart."\t".$lang."\t".$rightpart.$extract_date ; - #print DESTFILE $leftpart."\t".$lang."\t".$rightpart.$extract_date; - } - #if( $sLang eq "de" && $lang eq "de" ) { - # push @{ $output{ $prj.$gid.$lid.$file.$type.$plattform.$helpid } } , $leftpart."\t".$lang."\t".$rightpart.$extract_date ; - #print DESTFILE $leftpart."\t".$lang."\t".$rightpart.$extract_date; - #} - if( $sLang eq "en-US" && $lang eq "en-US" ) { - push @order , $prj.$gid.$lid.$file.$type.$plattform.$helpid; - if( !$bFakeEnglish ){ push @{ $output{ $prj.$gid.$lid.$file.$type.$plattform.$helpid } } , $leftpart."\t".$lang."\t".$rightpart.$extract_date ; } - #print DESTFILE $leftpart."\t".$lang."\t".$rightpart.$extract_date; - } - - } - } - } - } - # Insert particles - while ( ){ - if( /$sdf_regex/ ){ - my $leftpart = defined $2 ? $2 : ''; - my $prj = defined $3 ? $3 : ''; - my $lang = defined $12 ? $12 : ''; - my $rightpart = defined $13 ? $13 : ''; - my $timestamp = defined $18 ? $18 : ''; - - #my $prj = defined $3 ? $3 : ''; - my $file = defined $4 ? $4 : ''; - my $type = defined $6 ? $6 : ''; - my $gid = defined $7 ? $7 : ''; - my $lid = defined $8 ? $8 : ''; - #my $lang = defined $12 ? $12 : ''; - my $plattform = defined $10 ? $10 : ''; - my $helpid = defined $9 ? $9 : ''; - - - if( $use_default_date ) - { - $extract_date = "$default_date\n" ; - } - elsif( $extract_date eq "" ) - { - $extract_date = $timestamp; - } - - if( ! ( $prj =~ /binfilter/i ) ) { - push @{ $output{ $prj.$gid.$lid.$file.$type.$plattform.$helpid } } , $leftpart."\t".$lang."\t".$rightpart.$extract_date ; - #print DESTFILE $leftpart."\t".$lang."\t".$rightpart.$extract_date ; - } - } - } - - # Write! - foreach my $curkey ( @order ){ - foreach my $curlist ( $output{ $curkey } ){ - foreach my $line ( @{$curlist} ){ - print DESTFILE $line; - } - } - } - - }else { print STDERR "Can't open $outputfile";} - } - close DESTFILE; - close LOCALIZEPARTICLE; - close ALLPARTICLES_MERGED; - - #print STDOUT "DBG: \$localizeSDF $localizeSDF \$particleSDF_merged $particleSDF_merged\n"; - unlink $localizeSDF , $particleSDF_merged , $my_localize_log; - - #sort_outfile( $outputfile ); - #remove_obsolete( $outputfile ) , if $bHasSourceLanguage ne ""; - } - -######################################################### -sub remove_obsolete{ - my $outfile = shift; - my @lines; - my $enusleftpart; - my @good_lines; - - print STDOUT "### Removing obsolete strings\n"; - - # Kick out all strings without en-US reference - if ( open ( SORTEDFILE , "< $outfile" ) ){ - while( ){ - if( /$sdf_regex/ ){ - my $line = defined $_ ? $_ : ''; - my $language = defined $12 ? $12 : ''; - my $prj = defined $3 ? $3 : ''; - my $file = defined $4 ? $4 : ''; - my $type = defined $6 ? $6 : ''; - my $gid = defined $7 ? $7 : ''; - my $lid = defined $8 ? $8 : ''; - my $plattform = defined $10 ? $10 : ''; - my $helpid = defined $9 ? $9 : ''; - - my $leftpart = $prj.$gid.$lid.$file.$type.$plattform.$helpid; - - if( $language eq "en-US" ){ # source string found, 1. entry - $enusleftpart = $leftpart; - push @good_lines , $line; - }else{ - if( !defined $enusleftpart or !defined $leftpart ){ - print STDERR "BADLINE: $line\n"; - print STDERR "\$enusleftpart = $enusleftpart\n"; - print STDERR "\$leftpart = $leftpart\n"; - } - if( $enusleftpart eq $leftpart ){ # matching language - push @good_lines , $line; - } - #else{ - # print STDERR "OUT: \$enusleftpart=$enusleftpart \$leftpart=$leftpart \$line=$line\n"; - #} - } - } - } - close SORTEDFILE; - } else { print STDERR "ERROR: Can't open file $outfile\n";} - - # Write file - if ( open ( SORTEDFILE , "> $outfile" ) ){ - foreach my $newline ( @good_lines ) { - print SORTEDFILE $newline; - } - close SORTEDFILE; - } else { print STDERR "ERROR: Can't open file $outfile\n";} - -} -######################################################### -sub sort_outfile{ - my $outfile = shift; - print STDOUT "### Sorting ... $outfile ..."; - my @lines; - my @sorted_lines; - - - #if ( open ( SORTEDFILE , "< $outputfile" ) ){ - if ( open ( SORTEDFILE , "< $outfile" ) ){ - my $line; - while ( ){ - $line = $_; - if( $line =~ /^[^\#]/ ){ - push @lines , $line; - } - } - close SORTEDFILE; - @sorted_lines = sort { - my $xa_lang = ""; - my $xa_left_part = ""; - my $xa_right_part = ""; - my $xa_timestamp = ""; - my $xb_lang = ""; - my $xb_left_part = ""; - my $xb_right_part = ""; - my $xb_timestamp = ""; - my $xa = ""; - my $xb = ""; - my @alist; - my @blist; - - if( $a=~ /$sdf_regex/ ){ - $xa_left_part = defined $2 ? $2 : ''; - $xa_lang = defined $12 ? $12 : ''; - $xa_right_part = defined $13 ? $13 : ''; - $xa_left_part = remove_last_column( $xa_left_part ); - - } - if( $b=~ /$sdf_regex/ ){ - $xb_left_part = defined $2 ? $2 : ''; - $xb_lang = defined $12 ? $12 : ''; - $xb_right_part = defined $13 ? $13 : ''; - $xb_left_part = remove_last_column( $xb_left_part ); - - - } - if( ( $xa_left_part cmp $xb_left_part ) == 0 ){ # Left part equal - if( ( $xa_lang cmp $xb_lang ) == 0 ){ # Lang equal - return ( $xa_right_part cmp $xb_right_part ); # Right part compare - } - elsif( $xa_lang eq "en-US" ) { return -1; } # en-US wins - elsif( $xb_lang eq "en-US" ) { return 1; } # en-US wins - else { return $xa_lang cmp $xb_lang; } # lang compare - } - else { - return $xa_left_part cmp $xb_left_part; # Left part compare - } - } @lines; - - if ( open ( SORTEDFILE , "> $outfile" ) ){ - print SORTEDFILE get_license_header(); - foreach my $newline ( @sorted_lines ) { - print SORTEDFILE $newline; - #print STDOUT $newline; - } - } - close SORTEDFILE; - } else { print STDERR "WARNING: Can't open file $outfile\n";} - print "done\n"; - -} -######################################################### -sub remove_last_column{ - my $string = shift; - my @alist = split ( "\t" , $string ); - pop @alist; - return join( "\t" , @alist ); -} - -######################################################### -sub rename_language{ - my $fallbackhashhash_ref = shift; - my $cur_fallback = shift; - my $cur_lang = shift; - my $line; - - foreach my $key( keys ( %{ $fallbackhashhash_ref->{ $cur_fallback } } ) ){ - $line = $fallbackhashhash_ref->{ $cur_fallback }{ $key }; - if( $line =~ /$sdf_regex/ ){ - my $leftpart = defined $2 ? $2 : ''; - my $lang = defined $12 ? $12 : ''; - my $rightpart = defined $13 ? $13 : ''; - - $fallbackhashhash_ref->{ $cur_lang }{ $key } = $leftpart."\t".$cur_lang."\t".$rightpart; - } - } -} - -############################################################ -sub remove_duplicates{ - my $list_ref = shift; - my %tmphash; - foreach my $key ( @{ $list_ref } ){ $tmphash{ $key } = '' ; } - @{$list_ref} = keys( %tmphash ); -} - -############################################################## -sub fetch_fallback{ - my $sdfparticleslist_ref = shift; - my $localizeSDF = shift; - my $langhash_ref = shift; - my %fallbackhashhash; - my $cur_lang; - my @langlist; - - foreach my $key ( keys ( %{ $langhash_ref } ) ){ - $cur_lang = $langhash_ref->{ $key }; - if ( $cur_lang ne "" ) { - push @langlist , $cur_lang; - } - } - remove_duplicates( \@langlist ); - foreach $cur_lang ( @langlist ){ - if( $cur_lang eq "en-US" ){ - read_fallbacks_from_source( $localizeSDF , $cur_lang , \%fallbackhashhash ); - } - } - - # remove de / en-US - my @tmplist; - foreach $cur_lang( @langlist ){ - if( $cur_lang ne "en-US" ){ - push @tmplist , $cur_lang; - - } - } - @langlist = @tmplist; - if ( $#langlist +1 ){ - read_fallbacks_from_particles( $sdfparticleslist_ref , \@langlist , \%fallbackhashhash ); - - } - return (\%fallbackhashhash); -} - -######################################################### -sub write_file{ - - my $localizeFile = shift; - my $index_ref = shift; - - if( open DESTFILE , "+> $localizeFile" ){ - foreach my $key( %{ $index_ref } ){ - print DESTFILE ($index_ref->{ $key }, "\n" ); - } - close DESTFILE; - }else { - print STDERR "Can't open/create '$localizeFile'"; - } -} - -######################################################### -sub read_file{ - - my $sdffile = shift; - my $langhash_ref = shift; - my %block = (); - - open MYFILE , "< $sdffile" - or die "Can't open '$sdffile'\n"; - while( ){ - if( /$sdf_regex/ ){ - my $line = defined $_ ? $_ : ''; - my $prj = defined $3 ? $3 : ''; - my $file = defined $4 ? $4 : ''; - my $type = defined $6 ? $6 : ''; - my $gid = defined $7 ? $7 : ''; - my $lid = defined $8 ? $8 : ''; - my $plattform = defined $10 ? $10 : ''; - my $lang = defined $12 ? $12 : ''; - my $helpid = defined $9 ? $9 : ''; - - foreach my $isolang ( keys ( %{ $langhash_ref } ) ){ - if( $isolang=~ /$lang/i || $isolang=~ /all/i ) { $block{$prj.$gid.$lid.$file.$type.$plattform.$helpid } = $line ; } - } - } - } - return (\%block); -} - -######################################################### -sub read_fallbacks_from_particles{ - - my $sdfparticleslist_ref = shift; - my $isolanglist_ref = shift; - my $fallbackhashhash_ref = shift; - my $block_ref; - foreach my $currentfile ( @{ $sdfparticleslist_ref } ){ - if ( open MYFILE , "< $currentfile" ) { - while(){ - if( /$sdf_regex/ ){ - my $line = defined $_ ? $_ : ''; - my $prj = defined $3 ? $3 : ''; - my $file = defined $4 ? $4 : ''; - my $type = defined $6 ? $6 : ''; - my $gid = defined $7 ? $7 : ''; - my $lid = defined $8 ? $8 : ''; - my $lang = defined $12 ? $12 : ''; - my $plattform = defined $10 ? $10 : ''; - my $helpid = defined $9 ? $9 : ''; - - chomp( $line ); - - foreach my $isolang ( @{$isolanglist_ref} ){ - if( $isolang=~ /$lang/i ) { - $fallbackhashhash_ref->{ $isolang }{ $prj.$gid.$lid.$file.$type.$plattform.$helpid } = $line ; - } - } - } - } - }else { print STDERR "WARNING: Can't open file $currentfile"; } - } -} - -######################################################### -sub read_fallbacks_from_source{ - - my $sdffile = shift; - my $isolang = shift; - my $fallbackhashhash_ref = shift; - my $block_ref; - # read fallback for single file - open MYFILE , "< $sdffile" - or die "Can't open '$sdffile'\n"; - - while( ){ - if( /$sdf_regex/ ){ - my $line = defined $_ ? $_ : ''; - my $prj = defined $3 ? $3 : ''; - my $file = defined $4 ? $4 : ''; - my $type = defined $6 ? $6 : ''; - my $gid = defined $7 ? $7 : ''; - my $lid = defined $8 ? $8 : ''; - my $helpid = defined $9 ? $9 : ''; - my $lang = defined $12 ? $12 : ''; - my $plattform = defined $10 ? $10 : ''; - - chomp( $line ); - if( $isolang=~ /$lang/i ) { $fallbackhashhash_ref->{ $isolang }{ $prj.$gid.$lid.$file.$type.$plattform.$helpid } = $line ; - } - } - } -} - -######################################################### -sub parseLanguages{ - - my $bAll; - my $bUseLocalize; - my $bHasSourceLanguage=""; - my $bFakeEnglish=""; - my %langhash; - my $iso=""; - my $fallback=""; - - #### -l all - if( $languages=~ /all/ ){ - $bAll = "TRUE"; - $bHasSourceLanguage = "TRUE"; - } - ### -l fr=de,de - elsif( $languages=~ /.*,.*/ ){ - my @tmpstr = split "," , $languages; - for my $lang ( @tmpstr ){ - if( $lang=~ /([a-zA-Z]{2,3}(-[a-zA-Z\-]*)*)(=([a-zA-Z]{2,3}(-[a-zA-Z\-]*)*))?/ ){ - $iso = $1; - $fallback = $4; - - if( ( $iso && $iso=~ /(en-US)/i ) || ( $fallback && $fallback=~ /(en-US)/i ) ) { - $bUseLocalize = "TRUE"; - } - if( ( $iso && $iso=~ /(en-US)/i ) ) { - $bHasSourceLanguage = "TRUE"; - } - if( $fallback ) { $langhash{ $iso } = $fallback; } - else { $langhash{ $iso } = ""; } - } - } - } - ### -l de - else{ - if( $languages=~ /([a-zA-Z]{2,3}(-[a-zA-Z\-]*)*)(=([a-zA-Z]{2,3}(-[a-zA-Z\-]*)*))?/ ){ - $iso = $1; - $fallback = $4; - - if( ( $iso && $iso=~ /(en-US)/i ) || ( $fallback && $fallback=~ /(en-US)/i ) ) { - $bUseLocalize = "TRUE"; - - } - if( ( $iso && $iso=~ /(en-US)/i ) ) { - $bHasSourceLanguage = "TRUE"; - } - - if( $fallback ) { $langhash{ $iso } = $fallback; } - else { $langhash{ $iso } = ""; } - } - } - # HACK en-US always needed! - if( !$bHasSourceLanguage ){ - #$bHasSourceLanguage = "TRUE"; - $bUseLocalize = "TRUE"; - $bFakeEnglish = "TRUE"; - $langhash{ "en-US" } = ""; - } - return ( $bAll , $bUseLocalize , \%langhash , $bHasSourceLanguage, $bFakeEnglish); -} - -######################################################### -sub parse_options{ - - my $help; - my $merge; - my $extract; - my $success = GetOptions('f=s' => \$sdffile , 'l=s' => \$languages , 's=s' => \$srcpath , 'h' => \$help , 'v' => \$bVerbose , - 'm' => \$merge , 'e' => \$extract , 'x' => \$no_sort , 'd' => \$use_default_date ); - $outputfile = $sdffile; - - #print STDOUT "DBG: lang = $languages\n"; - if( !$srcpath ){ - #$srcpath = "$ENV{SRC_ROOT}"; - if( !$srcpath ){ - print STDERR "No path to the source root found!\n\n"; - usage(); - exit(1); - } - } - if( $help || !$success || $#ARGV > 1 || ( !$sdffile ) ){ - usage(); - exit(1); - } - if( $merge && $sdffile && ! ( -r $sdffile)){ - print STDERR "Can't open file '$sdffile'\n"; - exit(1); - } - if( !( $languages=~ /[a-zA-Z]{2,3}(-[a-zA-Z\-]*)*(=[a-zA-Z]{2,3}(-[a-zA-Z\-]*)*)?(,[a-zA-Z]{2,3}(-[a-zA-Z\-]*)*(=[a-zA-Z]{2,3}(-[a-zA-Z\-]*)*)?)*/ ) ){ - print STDERR "Please check the -l iso code\n"; - exit(1); - } - if( ( !$merge && !$extract ) || ( $merge && $extract ) ){ usage();exit( -1 );} - if( $extract ){ $mode = "extract"; } - else { $mode = "merge"; } -} - -######################################################### -sub usage{ - - print STDERR "Usage: localize.pl\n"; - print STDERR "Split or collect SDF files\n"; - print STDERR " merge: -m -f -l l1[=f1][,l2[=f2]][...] [ -s ]\n"; - print STDERR " extract: -e -f -l [ -s ] [-d]\n"; - print STDERR "Options:\n"; - print STDERR " -h help\n"; - print STDERR " -m Merge mode\n"; - print STDERR " -e Extract mode\n"; - print STDERR " -f To split a big SDF file into particles\n"; - print STDERR " To collect and join all particles to one big file\n"; - print STDERR " -s Path to the modules, if no \$SRC_ROOT is set\n"; - print STDERR " -l ( all | | =fallback ) comma seperated languages\n"; - print STDERR " -d Use default date in extracted sdf file\n"; - print STDERR " -v Verbose\n"; - print STDERR "\nExample:\n"; - print STDERR "\nlocalize -e -l en-US,pt-BR=en-US -f my.sdf\n( Extract en-US and pt-BR with en-US fallback )\n"; - print STDERR "\nlocalize -m -l cs -f my.sdf\n( Merge cs translation into the sourcecode ) \n"; -} - -# my $line = defined $_ ? $_ : ''; -# my $leftpart = defined $2 ? $2 : ''; -# my $prj = defined $3 ? $3 : ''; -# my $file = defined $4 ? $4 : ''; -# my $dummy = defined $5 ? $5 : ''; -# my $type = defined $6 ? $6 : ''; -# my $gid = defined $7 ? $7 : ''; -# my $lid = defined $8 ? $8 : ''; -# my $helpid = defined $9 ? $9 : ''; -# my $plattform = defined $10 ? $10 : ''; -# my $width = defined $11 ? $11 : ''; -# my $lang = defined $12 ? $12 : ''; -# my $rightpart = defined $13 ? $13 : ''; -# my $text = defined $14 ? $14 : ''; -# my $helptext = defined $15 ? $15 : ''; -# my $quickhelptext = defined $16 ? $16 : ''; -# my $title = defined $17 ? $17 : ''; -# my $timestamp = defined $18 ? $18 : ''; - diff --git a/transex3/source/cfg_yy_wrapper.c b/transex3/source/cfg_yy_wrapper.c deleted file mode 100644 index ac678d17f399..000000000000 --- a/transex3/source/cfg_yy_wrapper.c +++ /dev/null @@ -1,2 +0,0 @@ -// Helper to suppress warnings in lex generated c code, see #i57362# -#include "cfg_yy.c" diff --git a/transex3/source/cfglex.l b/transex3/source/cfglex.l deleted file mode 100644 index dd2d9a45ab59..000000000000 --- a/transex3/source/cfglex.l +++ /dev/null @@ -1,232 +0,0 @@ -%{ -/* - * lexer for parsing cfg source files - * - */ - - -/* enlarge token buffer to tokenize whole strings */ -#undef YYLMAX -#define YYLMAX 64000 - -/* to enable debug output define LEXDEBUG */ -#define LEXDEBUG 1 -#ifdef LEXDEBUG -#define OUTPUT fprintf -#else -#define OUTPUT(Par1,Par2); -#endif - -/* table of possible token ids */ -#include "tokens.h" -#include -#include - -#if defined __GNUC__ -#pragma GCC system_header -#elif defined __SINPRO_CC -#pragma disable_warn -#elif defined _MSC_VER -#pragma warning(push, 1) -#endif - -/* external functions (C++ code, declared as extren "C" */ -extern int WorkOnTokenSet( int, char* ); -extern int InitCfgExport( char * , char *); -extern int EndCfgExport(); -extern int GetError(); -extern int SetError(); -extern char *GetOutputFile( int argc, char* argv[]); -extern FILE *GetCfgFile(); -extern int isQuiet(); -extern void removeTempFile(); -extern char* getFilename(); -/* forwards */ -void YYWarning(); - -int bText=0; -%} - -%p 24000 -%e 1200 -%n 500 - -%% - -\<[^\>]*"xml:lang="\""x-no-translate"\"[^\<]*\/\> { - bText = 0; - WorkOnTokenSet( CFG_TOKEN_NO_TRANSLATE, yytext ); -} - -\<.*\/\> { - bText = 0; - WorkOnTokenSet( ANYTOKEN, yytext ); -} - -\<[^\>]*"xml:lang="\".*\"[^\<]*\> { - bText = 1; - WorkOnTokenSet( CFG_TEXT_START, yytext ); -} - - -\<[^\/\!][^\>]*\> { - bText = 0; - WorkOnTokenSet( CFG_TAG, yytext ); -} - -"]*\> { - bText = 0; - WorkOnTokenSet( CFG_TAG, yytext ); -} - - -\<\!\-\- { - char c1 = 0, c2 = 0, c3 = input(); - char pChar[2]; - pChar[1] = 0x00; - pChar[0] = c3; - - WorkOnTokenSet( COMMEND, yytext ); - WorkOnTokenSet( COMMEND, pChar ); - - for(;;) { - if ( c3 == EOF ) - break; - if ( c1 == '-' && c2 == '-' && c3 == '>' ) - break; - c1 = c2; - c2 = c3; - c3 = input(); - pChar[0] = c3; - WorkOnTokenSet( COMMEND, pChar ); - } -} - -\<\/[^\>]*\> { - bText = 0; - WorkOnTokenSet( CFG_CLOSETAG, yytext ); -} - -\<[^\>\!]*\> { - bText = 0; - if ( yytext[ 1 ] == '!' && yytext[ 2 ] == '-' && yytext[ 3 ] == '-' ) - WorkOnTokenSet( COMMEND, yytext ); - else - WorkOnTokenSet( CFG_UNKNOWNTAG, yytext ); -} - -.|\n { - if ( bText == 1 ) - WorkOnTokenSet( CFG_TEXTCHAR, yytext ); - else - WorkOnTokenSet( UNKNOWNCHAR, yytext ); -} - - -%% - -/*****************************************************************************/ -int yywrap(void) -/*****************************************************************************/ -{ - return 1; -} - -/*****************************************************************************/ -void YYWarning( char *s ) -/*****************************************************************************/ -{ - /* write warning to stderr */ - fprintf( stderr, - "Warning: \"%s\" in line %d: \"%s\"\n", s, yylineno, yytext ); -} - -/*****************************************************************************/ -#ifdef GCC -void yyerror ( char *s, ... ) -#else -void yyerror ( char *s ) -#endif -/*****************************************************************************/ -{ - /* write error to stderr */ - fprintf( stderr, - "Error: \"%s\" in line %d: \"%s\"\n", s, yylineno, yytext ); - SetError(); -} - -/*****************************************************************************/ -int -#ifdef WNT -_cdecl -#endif -main( int argc, char* argv[]) -/*****************************************************************************/ -{ - /* error level */ - int nRetValue = 0; - char *pOutput; - FILE *pFile; - - pOutput = GetOutputFile( argc, argv ); - if( !isQuiet() ){ - fprintf( stdout, "\nCfgEx 0.9 Copyright 2000 Sun Microsystems, Inc. All Rights Reserved.\n" ); - fprintf( stdout, "======================================================================\n" ); - } - - if ( !pOutput ) { - fprintf( stdout, "Syntax: CFGEX[-p Prj][-r PrjRoot]-i FileIn [-o FileOut][-m DataBase][-e][-b][-u][-f][-d DoneFile][-g[:dtd] ][-L l1,l2,...]\n" ); - fprintf( stdout, " Prj: Project\n" ); - fprintf( stdout, " PrjRoot: Path to project root (..\\.. etc.)\n" ); - fprintf( stdout, " FileIn: Source files (*.src)\n" ); - fprintf( stdout, " FileOut: Destination file (*.*)\n" ); - fprintf( stdout, " DataBase: Mergedata (*.sdf)\n" ); - fprintf( stdout, " -QQ: quiet output\n" ); - fprintf( stdout, " -e: Disable writing errorlog\n" ); - fprintf( stdout, " -b: Break when Token \"HelpText\" found in source\n" ); - fprintf( stdout, " -u: [english] and [german] are allowed, Id is Taken from DataBase \n" ); - fprintf( stdout, " -f: force extraction and merge even if only one language is existent\n" ); - fprintf( stdout, " -g[:dtd]: enables generation of properties (dtds if :dtd is set) - in this case FileOut is the output path\n" ); - fprintf( stdout, " -d: enables generation of *.don if work is done\n" ); - fprintf( stdout, " -L: Restrict the handled languages. l1,l2,... are elements of (de,en-US...)\n" ); - fprintf( stdout, " A fallback language can be defined like this: l1=f1.\n" ); - fprintf( stdout, " f1, f2,... are also elements of (de,en-US...)\n" ); - fprintf( stdout, " Example: -L de,es=en-US\n" ); - fprintf( stdout, " Restriction to de and es, en-US will be fallback for es\n" ); - return 1; - } - - pFile = GetCfgFile(); - InitCfgExport( pOutput , getFilename() ); - if ( !pFile ) - return 1; - - yyin = pFile; - - /* create global instance of class CfgExport */ - //InitCfgExport( pOutput ); - - /* start parser */ - yylex(); - - /* get error info. and end export */ - nRetValue = GetError(); - EndCfgExport(); - - if( !isQuiet() ){ - fprintf( stdout, "\n===================================\n\n" ); - } - - removeTempFile(); -/* return error level */ - return nRetValue; -} - -/*""]*"-->" { - bText = 0; - WorkOnTokenSet( COMMEND, yytext ); -}*/ -/*" { - bText = 0; - WorkOnTokenSet( CFG_TAG, yytext ); -}*/ diff --git a/transex3/source/cfgmerge.cxx b/transex3/source/cfgmerge.cxx deleted file mode 100644 index 0607c9e9bb06..000000000000 --- a/transex3/source/cfgmerge.cxx +++ /dev/null @@ -1,886 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: cfgmerge.cxx,v $ - * $Revision: 1.46 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_transex3.hxx" -#include -#include -#include - -// local includes -#include "export.hxx" -#include "cfgmerge.hxx" -#include "tokens.h" -#include "utf8conv.hxx" - -extern "C" { int yyerror( char * ); } -extern "C" { int YYWarning( char * ); } - -// defines to parse command line -#define STATE_NON 0x0001 -#define STATE_INPUT 0x0002 -#define STATE_OUTPUT 0x0003 -#define STATE_PRJ 0x0004 -#define STATE_ROOT 0x0005 -#define STATE_MERGESRC 0x0006 -#define STATE_ERRORLOG 0x0007 -#define STATE_UTF8 0x0008 -#define STATE_LANGUAGES 0X0009 -#define STATE_ISOCODE99 0x000A -#define STATE_FORCE 0x000B - -// set of global variables -BOOL bEnableExport; -BOOL bMergeMode; -BOOL bErrorLog; -BOOL bForce; -BOOL bUTF8; -bool bQuiet; -ByteString sPrj; -ByteString sPrjRoot; -ByteString sInputFileName; -ByteString sActFileName; -ByteString sFullEntry; -ByteString sOutputFile; -ByteString sMergeSrc; -String sUsedTempFile; - -CfgParser *pParser; - -extern "C" { -// the whole interface to lexer is in this extern "C" section - -/*****************************************************************************/ -extern char *GetOutputFile( int argc, char* argv[]) -/*****************************************************************************/ -{ - bEnableExport = FALSE; - bMergeMode = FALSE; - bErrorLog = TRUE; - bForce = FALSE; - bUTF8 = TRUE; - bQuiet = false; - sPrj = ""; - sPrjRoot = ""; - sInputFileName = ""; - sActFileName = ""; - - USHORT nState = STATE_NON; - BOOL bInput = FALSE; - - // parse command line - for( int i = 1; i < argc; i++ ) { - ByteString sSwitch( argv[ i ] ); - sSwitch.ToUpperAscii(); - - if ( sSwitch == "-I" ) { - nState = STATE_INPUT; // next token specifies source file - } - else if ( sSwitch == "-O" ) { - nState = STATE_OUTPUT; // next token specifies the dest file - } - else if ( sSwitch == "-P" ) { - nState = STATE_PRJ; // next token specifies the cur. project - } - else if ( sSwitch == "-R" ) { - nState = STATE_ROOT; // next token specifies path to project root - } - else if ( sSwitch == "-M" ) { - nState = STATE_MERGESRC; // next token specifies the merge database - } - else if ( sSwitch == "-E" ) { - nState = STATE_ERRORLOG; - bErrorLog = FALSE; - } - else if ( sSwitch == "-UTF8" ) { - nState = STATE_UTF8; - bUTF8 = TRUE; - } - else if ( sSwitch == "-NOUTF8" ) { - nState = STATE_UTF8; - bUTF8 = FALSE; - } - else if ( sSwitch == "-F" ) { - nState = STATE_FORCE; - bForce = TRUE; - } - else if ( sSwitch == "-QQ" ) { - bQuiet = true; - } - else if ( sSwitch == "-L" ) { - nState = STATE_LANGUAGES; - } - else if ( sSwitch.ToUpperAscii() == "-ISO99" ) { - nState = STATE_ISOCODE99; - } - else { - switch ( nState ) { - case STATE_NON: { - return NULL; // no valid command line - } - case STATE_INPUT: { - sInputFileName = argv[ i ]; - bInput = TRUE; // source file found - } - break; - case STATE_OUTPUT: { - sOutputFile = argv[ i ]; // the dest. file - } - break; - case STATE_PRJ: { - sPrj = ByteString( argv[ i ]); -// sPrj.ToLowerAscii(); // the project - } - break; - case STATE_ROOT: { - sPrjRoot = ByteString( argv[ i ]); // path to project root - } - break; - case STATE_MERGESRC: { - sMergeSrc = ByteString( argv[ i ]); - bMergeMode = TRUE; // activate merge mode, cause merge database found - } - break; - case STATE_LANGUAGES: { - Export::sLanguages = ByteString( argv[ i ]); - } - break; - } - } - } - - if ( bInput ) { - // command line is valid - bEnableExport = TRUE; - char *pReturn = new char[ sOutputFile.Len() + 1 ]; - strcpy( pReturn, sOutputFile.GetBuffer()); // #100211# - checked - return pReturn; - } - - // command line is not valid - return NULL; -} -int isQuiet(){ - if( bQuiet ) return 1; - else return 0; -} -/*****************************************************************************/ -int InitCfgExport( char *pOutput , char* pFilename ) -/*****************************************************************************/ -{ - // instanciate Export - ByteString sOutput( pOutput ); - ByteString sFilename( pFilename ); - Export::InitLanguages(); - - if ( bMergeMode ) - pParser = new CfgMerge( sMergeSrc, sOutputFile, sFilename ); - else if ( sOutputFile.Len()) - pParser = new CfgExport( sOutputFile, sPrj, sActFileName ); - - return 1; -} - -/*****************************************************************************/ -int EndCfgExport() -/*****************************************************************************/ -{ - delete pParser; - - return 1; -} - -void removeTempFile(){ - if( !sUsedTempFile.EqualsIgnoreCaseAscii( "" ) ){ - DirEntry aTempFile( sUsedTempFile ); - aTempFile.Kill(); - } -} -extern const char* getFilename() -{ - return sInputFileName.GetBuffer(); -} -/*****************************************************************************/ -extern FILE *GetCfgFile() -/*****************************************************************************/ -{ - FILE *pFile = 0; - // look for valid filename - if ( sInputFileName.Len()) { - if( Export::fileHasUTF8ByteOrderMarker( sInputFileName ) ){ - DirEntry aTempFile = Export::GetTempFile(); - DirEntry aSourceFile( String( sInputFileName , RTL_TEXTENCODING_ASCII_US ) ); - aSourceFile.CopyTo( aTempFile , FSYS_ACTION_COPYFILE ); - String sTempFile = aTempFile.GetFull(); - Export::RemoveUTF8ByteOrderMarkerFromFile( ByteString( sTempFile , RTL_TEXTENCODING_ASCII_US ) ); - pFile = fopen( ByteString( sTempFile , RTL_TEXTENCODING_ASCII_US ).GetBuffer(), "r" ); - sUsedTempFile = sTempFile; - }else{ - // able to open file? - pFile = fopen( sInputFileName.GetBuffer(), "r" ); - sUsedTempFile = String::CreateFromAscii(""); - } - if ( !pFile ){ - fprintf( stderr, "Error: Could not open file %s\n", - sInputFileName.GetBuffer()); - exit( 13 ); - } - else { - // this is a valid file which can be opened, so - // create path to project root - DirEntry aEntry( String( sInputFileName, RTL_TEXTENCODING_ASCII_US )); - aEntry.ToAbs(); - sFullEntry= ByteString( aEntry.GetFull(), RTL_TEXTENCODING_ASCII_US ); - aEntry += DirEntry( String( "..", RTL_TEXTENCODING_ASCII_US )); - aEntry += DirEntry( sPrjRoot ); - ByteString sPrjEntry( aEntry.GetFull(), RTL_TEXTENCODING_ASCII_US ); - - // create file name, beginnig with project root - // (e.g.: source\ui\src\menue.src) -// printf("sFullEntry = %s\n",sFullEntry.GetBuffer()); - sActFileName = sFullEntry.Copy( sPrjEntry.Len() + 1 ); -// printf("sActFileName = %s\n",sActFileName.GetBuffer()); - if( !bQuiet ) - fprintf( stdout, "\nProcessing File %s ...\n", sInputFileName.GetBuffer()); - - sActFileName.SearchAndReplaceAll( "/", "\\" ); - - return pFile; - } - } - // this means the file could not be opened - return NULL; -} - -/*****************************************************************************/ -int WorkOnTokenSet( int nTyp, char *pTokenText ) -/*****************************************************************************/ -{ - pParser->Execute( nTyp, pTokenText ); - - return 1; -} - - -/*****************************************************************************/ -int SetError() -/*****************************************************************************/ -{ - return 1; -} - -/*****************************************************************************/ -int GetError() -/*****************************************************************************/ -{ - return 0; -} -} - -// -// class CfgStackData -// - -CfgStackData* CfgStack::Push( const ByteString &rTag, const ByteString &rId ) -{ - CfgStackData *pD = new CfgStackData( rTag, rId ); - Insert( pD, LIST_APPEND ); - return pD; -} - -// -// class CfgStack -// - -/*****************************************************************************/ -CfgStack::~CfgStack() -/*****************************************************************************/ -{ - for ( ULONG i = 0; i < Count(); i++ ) - delete GetObject( i ); -} - -/*****************************************************************************/ -ByteString CfgStack::GetAccessPath( ULONG nPos ) -/*****************************************************************************/ -{ - if ( nPos == LIST_APPEND ) - nPos = Count() - 1; - - ByteString sReturn; - for ( ULONG i = 0; i <= nPos; i++ ) { - if ( i ) - sReturn += "."; - sReturn += GetStackData( i )->GetIdentifier(); - } - - return sReturn; -} - -/*****************************************************************************/ -CfgStackData *CfgStack::GetStackData( ULONG nPos ) -/*****************************************************************************/ -{ - if ( nPos == LIST_APPEND ) - nPos = Count() - 1; - - return GetObject( nPos ); -} - -// -// class CfgParser -// - -/*****************************************************************************/ -CfgParser::CfgParser() -/*****************************************************************************/ - : pStackData( NULL ), - bLocalize( FALSE ) -{ -} - -/*****************************************************************************/ -CfgParser::~CfgParser() -/*****************************************************************************/ -{ -} - - -/*****************************************************************************/ -BOOL CfgParser::IsTokenClosed( const ByteString &rToken ) -/*****************************************************************************/ -{ - return rToken.GetChar( rToken.Len() - 2 ) == '/'; -} - -/*****************************************************************************/ -void CfgParser::AddText( - ByteString &rText, - const ByteString &rIsoLang, - const ByteString &rResTyp -) -/*****************************************************************************/ -{ - USHORT nTextLen = 0; - while ( rText.Len() != nTextLen ) { - nTextLen = rText.Len(); - rText.SearchAndReplaceAll( "\n", " " ); - rText.SearchAndReplaceAll( "\r", " " ); - rText.SearchAndReplaceAll( "\t", " " ); - rText.SearchAndReplaceAll( " ", " " ); - } - pStackData->sResTyp = rResTyp; - WorkOnText( rText, rIsoLang ); - - pStackData->sText[ rIsoLang ] = rText; -} - - -/*****************************************************************************/ -void CfgParser::WorkOnRessourceEnd() -/*****************************************************************************/ -{ -} - -/*****************************************************************************/ -int CfgParser::ExecuteAnalyzedToken( int nToken, char *pToken ) -/*****************************************************************************/ -{ - ByteString sToken( pToken ); - - if ( sToken == " " || sToken == "\t" ) - sLastWhitespace += sToken; - - ByteString sTokenName; - ByteString sTokenId; - - BOOL bOutput = TRUE; - - switch ( nToken ) { - case CFG_TOKEN_PACKAGE: - case CFG_TOKEN_COMPONENT: - case CFG_TOKEN_TEMPLATE: - case CFG_TOKEN_CONFIGNAME: - case CFG_TOKEN_OORNAME: - case CFG_TOKEN_OORVALUE: - case CFG_TAG: - case ANYTOKEN: - case CFG_TEXT_START: - { - sTokenName = sToken.GetToken( 1, '<' ).GetToken( 0, '>' ).GetToken( 0, ' ' ); - - if ( !IsTokenClosed( sToken )) { - ByteString sSearch; - switch ( nToken ) { - case CFG_TOKEN_PACKAGE: - sSearch = "package-id="; - break; - case CFG_TOKEN_COMPONENT: - sSearch = "component-id="; - break; - case CFG_TOKEN_TEMPLATE: - sSearch = "template-id="; - break; - case CFG_TOKEN_CONFIGNAME: - sSearch = "cfg:name="; - break; - case CFG_TOKEN_OORNAME: - sSearch = "oor:name="; - bLocalize = TRUE; - break; - case CFG_TOKEN_OORVALUE: - sSearch = "oor:value="; - break; - case CFG_TEXT_START: { - if ( sCurrentResTyp != sTokenName ) { - WorkOnRessourceEnd(); - ByteString sCur; - for( unsigned int n = 0; n < aLanguages.size(); n++ ){ - sCur = aLanguages[ n ]; - pStackData->sText[ sCur ] = ByteString(""); - } - } - sCurrentResTyp = sTokenName; - - ByteString sTemp = sToken.Copy( sToken.Search( "xml:lang=" )); - sCurrentIsoLang = sTemp.GetToken( 1, '\"' ).GetToken( 0, '\"' ); - - if ( sCurrentIsoLang == NO_TRANSLATE_ISO ) - bLocalize = FALSE; - - pStackData->sTextTag = sToken; - - sCurrentText = ""; - } - break; - } - if ( sSearch.Len()) { - ByteString sTemp = sToken.Copy( sToken.Search( sSearch )); - sTokenId = sTemp.GetToken( 1, '\"' ).GetToken( 0, '\"' ); - } - pStackData = aStack.Push( sTokenName, sTokenId ); - - if ( sSearch == "cfg:name=" ) { - ByteString sTemp( sToken ); - sTemp.ToUpperAscii(); - bLocalize = (( sTemp.Search( "CFG:TYPE=\"STRING\"" ) != STRING_NOTFOUND ) && - ( sTemp.Search( "CFG:LOCALIZED=\"TRUE\"" ) != STRING_NOTFOUND )); - } - } - else if ( sTokenName == "label" ) { - if ( sCurrentResTyp != sTokenName ) { - WorkOnRessourceEnd(); - ByteString sCur; - for( unsigned int n = 0; n < aLanguages.size(); n++ ){ - sCur = aLanguages[ n ]; - pStackData->sText[ sCur ] = ByteString(""); - } - } - sCurrentResTyp = sTokenName; - } - } - break; - case CFG_CLOSETAG: - sTokenName = sToken.GetToken( 1, '/' ).GetToken( 0, '>' ).GetToken( 0, ' ' ); - if ( aStack.GetStackData() && ( aStack.GetStackData()->GetTagType() == sTokenName )) { - if ( ! sCurrentText.Len()) - WorkOnRessourceEnd(); - aStack.Pop(); - pStackData = aStack.GetStackData(); - } - else { - ByteString sError( "Missplaced close tag: " ); - ByteString sInFile(" in file "); - sError += sToken; - sError += sInFile; - sError += sFullEntry; - Error( sError ); - exit ( 13 ); - } - break; - - case CFG_TEXTCHAR: - sCurrentText += sToken; - bOutput = FALSE; - break; - - case CFG_TOKEN_NO_TRANSLATE: - bLocalize = FALSE; - break; - } - - if ( sCurrentText.Len() && nToken != CFG_TEXTCHAR ) { - AddText( sCurrentText, sCurrentIsoLang, sCurrentResTyp ); - Output( sCurrentText ); - sCurrentText = ""; - pStackData->sEndTextTag = sToken; - } - - if ( bOutput ) - Output( sToken ); - - if ( sToken != " " && sToken != "\t" ) - sLastWhitespace = ""; - - return 1; -} - -/*****************************************************************************/ -void CfgExport::Output( const ByteString& rOutput ) -/*****************************************************************************/ -{ - // Dummy operation to suppress warnings caused by poor class design - ByteString a( rOutput ); -} - -/*****************************************************************************/ -int CfgParser::Execute( int nToken, char * pToken ) -/*****************************************************************************/ -{ - ByteString sToken( pToken ); - - switch ( nToken ) { - case CFG_TAG: - if ( sToken.Search( "package-id=" ) != STRING_NOTFOUND ) - return ExecuteAnalyzedToken( CFG_TOKEN_PACKAGE, pToken ); - else if ( sToken.Search( "component-id=" ) != STRING_NOTFOUND ) - return ExecuteAnalyzedToken( CFG_TOKEN_COMPONENT, pToken ); - else if ( sToken.Search( "template-id=" ) != STRING_NOTFOUND ) - return ExecuteAnalyzedToken( CFG_TOKEN_TEMPLATE, pToken ); - else if ( sToken.Search( "cfg:name=" ) != STRING_NOTFOUND ) - return ExecuteAnalyzedToken( CFG_TOKEN_OORNAME, pToken ); - else if ( sToken.Search( "oor:name=" ) != STRING_NOTFOUND ) - return ExecuteAnalyzedToken( CFG_TOKEN_OORNAME, pToken ); - else if ( sToken.Search( "oor:value=" ) != STRING_NOTFOUND ) - return ExecuteAnalyzedToken( CFG_TOKEN_OORVALUE, pToken ); - break; - } - return ExecuteAnalyzedToken( nToken, pToken ); -} - - -/*****************************************************************************/ -void CfgParser::Error( const ByteString &rError ) -/*****************************************************************************/ -{ -// ByteString sError( rError ); -// sError.Append("Error: In file "); -// sError.Append( sActFileName ); - yyerror(( char * ) rError.GetBuffer()); -} - - -// -// class CfgOutputParser -// - -/*****************************************************************************/ -CfgOutputParser::CfgOutputParser( const ByteString &rOutputFile ) -/*****************************************************************************/ -{ - pOutputStream = - new SvFileStream( - String( rOutputFile, RTL_TEXTENCODING_ASCII_US ), - STREAM_STD_WRITE | STREAM_TRUNC - ); - pOutputStream->SetStreamCharSet( RTL_TEXTENCODING_UTF8 ); - - if ( !pOutputStream->IsOpen()) { - ByteString sError( "ERROR: Unable to open output file: " ); - sError += rOutputFile; - Error( sError ); - delete pOutputStream; - pOutputStream = NULL; - exit( 13 ); - } -} - -/*****************************************************************************/ -CfgOutputParser::~CfgOutputParser() -/*****************************************************************************/ -{ - if ( pOutputStream ) { - pOutputStream->Close(); - delete pOutputStream; - } -} - -// -// class CfgExport -// - -/*****************************************************************************/ -CfgExport::CfgExport( - const ByteString &rOutputFile, - const ByteString &rProject, - const ByteString &rFilePath -) -/*****************************************************************************/ - : CfgOutputParser( rOutputFile ), - sPrj( rProject ), - sPath( rFilePath ) -{ - Export::InitLanguages( false ); - aLanguages = Export::GetLanguages(); -} - -/*****************************************************************************/ -CfgExport::~CfgExport() -/*****************************************************************************/ -{ -} - -/*****************************************************************************/ -void CfgExport::WorkOnRessourceEnd() -/*****************************************************************************/ -{ - if ( pOutputStream && bLocalize ) { - if (( pStackData->sText[ ByteString("en-US") ].Len() - ) || - ( bForce && - ( pStackData->sText[ ByteString("de") ].Len() || - pStackData->sText[ ByteString("en-US") ].Len() ))) - { - ByteString sFallback = pStackData->sText[ ByteString("en-US") ]; - - //if ( pStackData->sText[ ByteString("en-US") ].Len()) - // sFallback = pStackData->sText[ ByteString("en-US") ]; - - ByteString sLocalId = pStackData->sIdentifier; - ByteString sGroupId; - if ( aStack.Count() == 1 ) { - sGroupId = sLocalId; - sLocalId = ""; - } - else { - sGroupId = aStack.GetAccessPath( aStack.Count() - 2 ); - } - - ByteString sTimeStamp( Export::GetTimeStamp()); - - ByteString sCur; - for( unsigned int n = 0; n < aLanguages.size(); n++ ){ - sCur = aLanguages[ n ]; - - ByteString sText = pStackData->sText[ sCur ]; - if ( !sText.Len()) - sText = sFallback; - - Export::UnquotHTML( sText ); - - ByteString sOutput( sPrj ); sOutput += "\t"; - sOutput += sPath; - sOutput += "\t0\t"; - sOutput += pStackData->sResTyp; sOutput += "\t"; - sOutput += sGroupId; sOutput += "\t"; - sOutput += sLocalId; sOutput += "\t\t\t0\t"; - sOutput += sCur; - sOutput += "\t"; - - sOutput += sText; sOutput += "\t\t\t\t"; - sOutput += sTimeStamp; - - //if( !sCur.EqualsIgnoreCaseAscii("de") ||( sCur.EqualsIgnoreCaseAscii("de") && !Export::isMergingGermanAllowed( sPrj ) ) ) - pOutputStream->WriteLine( sOutput ); - } - } - } -} - -/*****************************************************************************/ -void CfgExport::WorkOnText( - ByteString &rText, - const ByteString &rIsoLang -) -/*****************************************************************************/ -{ - if( rIsoLang.Len() ) Export::UnquotHTML( rText ); -} - - -// -// class CfgMerge -// - -/*****************************************************************************/ -CfgMerge::CfgMerge( - const ByteString &rMergeSource, const ByteString &rOutputFile, - ByteString &rFilename ) -/*****************************************************************************/ - : CfgOutputParser( rOutputFile ), - pMergeDataFile( NULL ), - pResData( NULL ), - bGerman( FALSE ), - sFilename( rFilename ), - bEnglish( FALSE ) -{ - if ( rMergeSource.Len()){ - pMergeDataFile = new MergeDataFile( - rMergeSource, sInputFileName , bErrorLog, RTL_TEXTENCODING_MS_1252, true ); - if( Export::sLanguages.EqualsIgnoreCaseAscii("ALL") ){ - Export::SetLanguages( pMergeDataFile->GetLanguages() ); - aLanguages = pMergeDataFile->GetLanguages(); - } - else aLanguages = Export::GetLanguages(); - }else - aLanguages = Export::GetLanguages(); -} - -/*****************************************************************************/ -CfgMerge::~CfgMerge() -/*****************************************************************************/ -{ - delete pMergeDataFile; - delete pResData; -} - -/*****************************************************************************/ -void CfgMerge::WorkOnText( - ByteString &rText, - const ByteString& nLangIndex -) -/*****************************************************************************/ -{ - - if ( pMergeDataFile && bLocalize ) { - if ( !pResData ) { - ByteString sLocalId = pStackData->sIdentifier; - ByteString sGroupId; - if ( aStack.Count() == 1 ) { - sGroupId = sLocalId; - sLocalId = ""; - } - else { - sGroupId = aStack.GetAccessPath( aStack.Count() - 2 ); - } - - ByteString sPlatform( "" ); - - pResData = new ResData( sPlatform, sGroupId , sFilename ); - pResData->sId = sLocalId; - pResData->sResTyp = pStackData->sResTyp; - } - - //if ( nLangIndex.EqualsIgnoreCaseAscii("de") ) - // bGerman = TRUE; - if (( nLangIndex.EqualsIgnoreCaseAscii("en-US") )) - bEnglish = TRUE; - - PFormEntrys *pEntrys = pMergeDataFile->GetPFormEntrysCaseSensitive( pResData ); - if ( pEntrys ) { - ByteString sContent; - pEntrys->GetText( sContent, STRING_TYP_TEXT, nLangIndex ); - - if ( Export::isAllowed( nLangIndex ) && - ( sContent != "-" ) && ( sContent.Len())) - { -#ifdef MERGE_SOURCE_LANGUAGES - if( nLangIndex.EqualsIgnoreCaseAscii("de") || nLangIndex.EqualsIgnoreCaseAscii("en-US") ) - rText = sContent; -#endif - Export::QuotHTML( rText ); - } - } - } -} - -/*****************************************************************************/ -void CfgMerge::Output( const ByteString& rOutput ) -/*****************************************************************************/ -{ - if ( pOutputStream ) - pOutputStream->Write( rOutput.GetBuffer(), rOutput.Len()); -} - -ULONG CfgStack::Push( CfgStackData *pStackData ) -{ - Insert( pStackData, LIST_APPEND ); - return Count() - 1; -} - -/*****************************************************************************/ -void CfgMerge::WorkOnRessourceEnd() -/*****************************************************************************/ -{ - - if ( pMergeDataFile && pResData && bLocalize && (( bEnglish ) || bForce )) { - PFormEntrys *pEntrys = pMergeDataFile->GetPFormEntrysCaseSensitive( pResData ); - if ( pEntrys ) { - ByteString sCur; - - for( unsigned int n = 0; n < aLanguages.size(); n++ ){ - sCur = aLanguages[ n ]; - - ByteString sContent; - pEntrys->GetText( sContent, STRING_TYP_TEXT, sCur , TRUE ); - if ( - // (!sCur.EqualsIgnoreCaseAscii("de") ) && - ( !sCur.EqualsIgnoreCaseAscii("en-US") ) && - - ( sContent != "-" ) && ( sContent.Len())) - { - - ByteString sText = sContent; - Export::QuotHTML( sText ); - - ByteString sAdditionalLine( "\t" ); - - ByteString sTextTag = pStackData->sTextTag; - ByteString sTemp = sTextTag.Copy( sTextTag.Search( "xml:lang=" )); - - ByteString sSearch = sTemp.GetToken( 0, '\"' ); - sSearch += "\""; - sSearch += sTemp.GetToken( 1, '\"' ); - sSearch += "\""; - - ByteString sReplace = sTemp.GetToken( 0, '\"' ); - sReplace += "\""; - sReplace += sCur; - sReplace += "\""; - - sTextTag.SearchAndReplace( sSearch, sReplace ); - - sAdditionalLine += sTextTag; - sAdditionalLine += sText; - sAdditionalLine += pStackData->sEndTextTag; - - sAdditionalLine += "\n"; - sAdditionalLine += sLastWhitespace; - - Output( sAdditionalLine ); - } - } - } - } - delete pResData; - pResData = NULL; - bGerman = FALSE; - bEnglish = FALSE; -} diff --git a/transex3/source/directory.cxx b/transex3/source/directory.cxx deleted file mode 100644 index ed0fe27d22c2..000000000000 --- a/transex3/source/directory.cxx +++ /dev/null @@ -1,276 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: directory.cxx,v $ - * $Revision: 1.6 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_transex3.hxx" -#include -#include "tools/string.hxx" -#include -#include -#include - -namespace transex -{ - -Directory::Directory( const rtl::OUString sFullpath ) : bSkipLinks( false ) -{ - sFullName = sFullpath; -} - -Directory::Directory( const rtl::OUString sFullPath , const rtl::OUString sEntry ) : bSkipLinks( false ) -{ - sFullName = sFullPath; - sDirectoryName = sEntry; -} - - -Directory::Directory( const ByteString sFullPath ) : bSkipLinks( false ) -{ - sDirectoryName = rtl::OUString( sFullPath.GetBuffer() , RTL_TEXTENCODING_UTF8 , sFullPath.Len() ); -} - -bool Directory::lessDir ( const Directory& rKey1, const Directory& rKey2 ) -{ - rtl::OUString sName1( ( static_cast< Directory >( rKey1 ) ).getDirectoryName() ); - rtl::OUString sName2( ( static_cast< Directory >( rKey2 ) ).getDirectoryName() ); - - return sName1.compareTo( sName2 ) < 0 ; -} - - -void Directory::dump() -{ - - for( std::vector< transex::File >::iterator iter = aFileVec.begin() ; iter != aFileVec.end() ; ++iter ) - { - std::cout << "FILE " << rtl::OUStringToOString( (*iter).getFullName().getStr() , RTL_TEXTENCODING_UTF8 , (*iter).getFullName().getLength() ).getStr() << "\n"; - } - - for( std::vector< transex::Directory >::iterator iter = aDirVec.begin() ; iter != aDirVec.end() ; ++iter ) - { - std::cout << "DIR " << rtl::OUStringToOString( (*iter).getFullName().getStr() , RTL_TEXTENCODING_UTF8 , (*iter).getFullName().getLength() ).getStr() << "\n"; - } - -} - -void Directory::scanSubDir( int nLevels ) -{ - readDirectory( sFullName ); - dump(); - if( nLevels > 0 ) { - for( std::vector< transex::Directory >::iterator iter = aDirVec.begin() ; iter != aDirVec.end() || nLevels > 0 ; ++iter , nLevels-- ) - { - ( *iter ).scanSubDir(); - } - } -} - -void Directory::setSkipLinks( bool is_skipped ) -{ - bSkipLinks = is_skipped; -} - -void Directory::readDirectory() -{ - readDirectory( sFullName ); -} - -#ifdef WNT -#include -#include -#include - -void Directory::readDirectory ( const rtl::OUString& sFullpath ) -{ - BOOL fFinished; - HANDLE hList; - TCHAR szDir[MAX_PATH+1]; - TCHAR szSubDir[MAX_PATH+1]; - WIN32_FIND_DATA FileData; - - rtl::OString sFullpathext = rtl::OUStringToOString( sFullpath , RTL_TEXTENCODING_UTF8 , sFullpath.getLength() ); - const char *dirname = sFullpathext.getStr(); - - // Get the proper directory path - sprintf(szDir, "%s\\*", dirname); - - // Get the first file - hList = FindFirstFile(szDir, &FileData); - if (hList == INVALID_HANDLE_VALUE) - { - //FindClose(hList); - //printf("No files found %s\n", szDir ); return; - } - else - { - fFinished = FALSE; - while (!fFinished) - { - - sprintf(szSubDir, "%s\\%s", dirname, FileData.cFileName); - rtl::OString myfile( FileData.cFileName ); - rtl::OString mydir( szSubDir ); - - if (FileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) - { - if ( (strcmp(FileData.cFileName, ".") != 0 ) && - (strcmp(FileData.cFileName, "..") != 0 ) ) - { - //sprintf(szSubDir, "%s\\%s", dirname, FileData.cFileName); - transex::Directory aDir( rtl::OStringToOUString( mydir , RTL_TEXTENCODING_UTF8 , mydir.getLength() ), - rtl::OStringToOUString( myfile , RTL_TEXTENCODING_UTF8 , myfile.getLength() ) ); - aDirVec.push_back( aDir ); - } - } - else - { - transex::File aFile( rtl::OStringToOUString( mydir , RTL_TEXTENCODING_UTF8 , mydir.getLength() ), - rtl::OStringToOUString( myfile , RTL_TEXTENCODING_UTF8 , myfile.getLength() ) ); - aFileVec.push_back( aFile ); - } - if (!FindNextFile(hList, &FileData)) - { - if (GetLastError() == ERROR_NO_MORE_FILES) - { - fFinished = TRUE; - } - } - } - } - - FindClose(hList); - - ::std::sort( aFileVec.begin() , aFileVec.end() , File::lessFile ); - ::std::sort( aDirVec.begin() , aDirVec.end() , Directory::lessDir ); -} - -#else - -class dirholder -{ -private: - DIR *mpDir; -public: - dirholder(DIR *pDir) : mpDir(pDir) {} - int close() { int nRet = mpDir ? closedir(mpDir) : 0; mpDir = NULL; return nRet; } - ~dirholder() { close(); } -}; - -void Directory::readDirectory( const rtl::OUString& sFullpath ) -{ - struct stat statbuf; - struct stat statbuf2; - struct dirent *dirp; - DIR *dir; - //int ret; - //char *ptr; - - if( sFullpath.getLength() < 1 ) return; - - rtl::OString sFullpathext = rtl::OUStringToOString( sFullpath , RTL_TEXTENCODING_UTF8 , sFullpath.getLength() ).getStr(); - //printf("%s\n",sFullpathext.getStr()); - const char* path = sFullpathext.getStr(); - - // stat - if( stat( path , &statbuf ) < 0 ){ printf("warning: Can not stat %s" , path ); return; }// error } - - if( S_ISDIR(statbuf.st_mode ) == 0 ) { return; }// error } return; // not dir - - if( (dir = opendir( path ) ) == NULL ) {printf("readerror 2 in %s \n",path); return; } // error } return; // error - dirholder aHolder(dir); - - sFullpathext += rtl::OString( "/" ); - - const rtl::OString sDot ( "." ) ; - const rtl::OString sDDot( ".." ); - - if ( chdir( path ) == -1 ) { printf("chdir error in %s \n",path); return; } // error - - while( ( dirp = readdir( dir ) ) != NULL ) - { - rtl::OString sEntryName( dirp->d_name ); - - if( sEntryName.equals( sDot ) || sEntryName.equals( sDDot ) ) - continue; - - // add dir entry - rtl::OString sEntity = sFullpathext; - sEntity += sEntryName; - - // stat new entry - if( lstat( sEntity.getStr() , &statbuf2 ) < 0 ) - { - printf("error on entry %s\n" , sEntity.getStr() ) ; // error - continue; - } - - // add file / dir to vector - switch( statbuf2.st_mode & S_IFMT ) - { - case S_IFREG: - { - rtl::OString sFile = sFullpathext; - sFile += sEntryName ; - transex::File aFile( rtl::OStringToOUString( sEntity , RTL_TEXTENCODING_UTF8 , sEntity.getLength() ) , - rtl::OStringToOUString( sEntryName , RTL_TEXTENCODING_UTF8 , sEntryName.getLength() ) - ); - - aFileVec.push_back( aFile ) ; - break; - } - case S_IFLNK: - { - if( bSkipLinks ) break; - } - case S_IFDIR: - { - rtl::OString sDir = sFullpathext; - sDir += sEntryName ; - - transex::Directory aDir( - rtl::OStringToOUString( sEntity , RTL_TEXTENCODING_UTF8 , sEntity.getLength() ) , - rtl::OStringToOUString( sEntryName , RTL_TEXTENCODING_UTF8 , sEntryName.getLength() ) - ) ; - aDirVec.push_back( aDir ) ; - break; - } - } - } - if ( chdir( ".." ) == -1 ) { printf("chdir error in .. \n"); return; } // error - if( aHolder.close() < 0 ) return ; // error - - std::sort( aFileVec.begin() , aFileVec.end() , File::lessFile ); - std::sort( aDirVec.begin() , aDirVec.end() , Directory::lessDir ); - -} - -#endif -} diff --git a/transex3/source/export.cxx b/transex3/source/export.cxx deleted file mode 100644 index 5294d902d2ee..000000000000 --- a/transex3/source/export.cxx +++ /dev/null @@ -1,2660 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: export.cxx,v $ - * $Revision: 1.57 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_transex3.hxx" -#include -#include -#include -#include "export.hxx" -#include "tokens.h" -#include "utf8conv.hxx" -#include - -extern "C" { int yyerror( char * ); } -extern "C" { int YYWarning( char * ); } - -Export *pExport = 0L; - -// defines to parse command line -#define STATE_NON 0x0001 -#define STATE_INPUT 0x0002 -#define STATE_OUTPUT 0x0003 -#define STATE_PRJ 0x0004 -#define STATE_ROOT 0x0005 -#define STATE_MERGESRC 0x0006 -#define STATE_ERRORLOG 0x0007 -#define STATE_BREAKHELP 0x0008 -#define STATE_UNMERGE 0x0009 -#define STATE_UTF8 0x000A -#define STATE_LANGUAGES 0X000B - -// set of global variables -DECLARE_LIST( FileList, ByteString * ) -FileList aInputFileList; -BOOL bEnableExport; -BOOL bMergeMode; -BOOL bErrorLog; -BOOL bBreakWhenHelpText; -BOOL bUnmerge; -BOOL bUTF8; -bool bQuiet; -ByteString sPrj; -ByteString sPrjRoot; -ByteString sActFileName; -ByteString sOutputFile; -ByteString sMergeSrc; -ByteString sTempFile; -ByteString sFile; -MergeDataFile *pMergeDataFile; -FILE *pTempFile; - - -ByteString sStrBuffer; -bool bMarcro = false; - -extern "C" { -// the whole interface to lexer is in this extern "C" section - - -/*****************************************************************************/ -extern char *GetOutputFile( int argc, char* argv[]) -/*****************************************************************************/ -{ - bEnableExport = FALSE; - bMergeMode = FALSE; - bErrorLog = TRUE; - bBreakWhenHelpText = FALSE; - bUnmerge = FALSE; - bUTF8 = TRUE; - sPrj = ""; - sPrjRoot = ""; - sActFileName = ""; - Export::sLanguages = ""; - Export::sForcedLanguages = ""; - sTempFile = ""; - pTempFile = NULL; - bQuiet = false; - USHORT nState = STATE_NON; - BOOL bInput = FALSE; - - // parse command line - for( int i = 1; i < argc; i++ ) { - ByteString sSwitch( argv[ i ] ); - - if (sSwitch == "-i" || sSwitch == "-I" ) { - nState = STATE_INPUT; // next tokens specifies source files - } - else if (sSwitch == "-o" || sSwitch == "-O" ) { - nState = STATE_OUTPUT; // next token specifies the dest file - } - else if (sSwitch == "-p" || sSwitch == "-P" ) { - nState = STATE_PRJ; // next token specifies the cur. project - } - else if (sSwitch == "-qq" || sSwitch == "-QQ" ) { - bQuiet = true; - } - - else if (sSwitch == "-r" || sSwitch == "-R" ) { - nState = STATE_ROOT; // next token specifies path to project root - } - else if (sSwitch == "-m" || sSwitch == "-M" ) { - nState = STATE_MERGESRC; // next token specifies the merge database - } - else if (sSwitch == "-e" || sSwitch == "-E" ) { - nState = STATE_ERRORLOG; - bErrorLog = FALSE; - } - else if (sSwitch == "-b" || sSwitch == "-B" ) { - nState = STATE_BREAKHELP; - bBreakWhenHelpText = TRUE; - } - else if (sSwitch == "-u" || sSwitch == "-U" ) { - nState = STATE_UNMERGE; - bUnmerge = TRUE; - bMergeMode = TRUE; - } - else if ( sSwitch.ToUpperAscii() == "-UTF8" ) { - nState = STATE_UTF8; - bUTF8 = TRUE; - } - else if ( sSwitch.ToUpperAscii() == "-NOUTF8" ) { - nState = STATE_UTF8; - bUTF8 = FALSE; - } - else if ( sSwitch == "-l" || sSwitch == "-L" ) { - nState = STATE_LANGUAGES; - } - else { - switch ( nState ) { - case STATE_NON: { - return NULL; // no valid command line - } - case STATE_INPUT: { - aInputFileList.Insert( new ByteString( argv[ i ]), LIST_APPEND ); - bInput = TRUE; // min. one source file found - } - break; - case STATE_OUTPUT: { - sOutputFile = ByteString( argv[ i ]); // the dest. file - } - break; - case STATE_PRJ: { - sPrj = ByteString( argv[ i ]); - } - break; - case STATE_ROOT: { - sPrjRoot = ByteString( argv[ i ]); // path to project root - } - break; - case STATE_MERGESRC: { - sMergeSrc = ByteString( argv[ i ]); - bMergeMode = TRUE; // activate merge mode, cause merge database found - } - break; - case STATE_LANGUAGES: { - Export::sLanguages = ByteString( argv[ i ]); - } - break; - } - } - } - if( bUnmerge ) sMergeSrc = ByteString(); - if ( bInput ) { - // command line is valid - bEnableExport = TRUE; - char *pReturn = new char[ sOutputFile.Len() + 1 ]; - strcpy( pReturn, sOutputFile.GetBuffer()); // #100211# - checked - return pReturn; - } - - // command line is not valid - return NULL; -} -/*****************************************************************************/ -int isQuiet(){ -/*****************************************************************************/ - if( bQuiet ) return 1; - else return 0; -} -/*****************************************************************************/ -int InitExport( char *pOutput , char* pFilename ) -/*****************************************************************************/ -{ - // instanciate Export - ByteString sOutput( pOutput ); - ByteString sFilename( pFilename ); - - if ( bMergeMode && !bUnmerge ) { - // merge mode enabled, so read database - pExport = new Export(sOutput, bEnableExport, sPrj, sPrjRoot, sMergeSrc , sFilename ); - } - else - // no merge mode, only export - pExport = new Export( sOutput, bEnableExport, sPrj, sPrjRoot , sFilename ); - return 1; -} - -/*****************************************************************************/ -int EndExport() -/*****************************************************************************/ -{ - delete pExport; - return 1; -} - -extern const char* getFilename() -{ - return (*(aInputFileList.GetObject( 0 ))).GetBuffer(); -} -/*****************************************************************************/ -extern FILE *GetNextFile() -/*****************************************************************************/ -{ - // look for next valid filename in input file list - if ( sTempFile.Len()) { - fclose( pTempFile ); - String sTemp( sTempFile, RTL_TEXTENCODING_ASCII_US ); - DirEntry aTemp( sTemp ); - aTemp.Kill(); - } - - while ( aInputFileList.Count()) { - ByteString sFileName( *(aInputFileList.GetObject( 0 ))); - - ByteString sOrigFile( sFileName ); - - sFileName = Export::GetNativeFile( sFileName ); - delete aInputFileList.GetObject(( ULONG ) 0 ); - aInputFileList.Remove(( ULONG ) 0 ); - - if ( sFileName == "" ) { - fprintf( stderr, "ERROR: Could not precompile File %s\n", - sOrigFile.GetBuffer()); - return GetNextFile(); - } - - sTempFile = sFileName; - Export::RemoveUTF8ByteOrderMarkerFromFile( sFileName ); - - // able to open file? - FILE *pFile = fopen( sFileName.GetBuffer(), "r" ); - if ( !pFile ) - fprintf( stderr, "Error: Could not open File %s\n", - sFileName.GetBuffer()); - else { - pTempFile = pFile; - - // this is a valid file which can be opened, so - // create path to project root - DirEntry aEntry( String( sOrigFile, RTL_TEXTENCODING_ASCII_US )); - aEntry.ToAbs(); - ByteString sFullEntry( aEntry.GetFull(), RTL_TEXTENCODING_ASCII_US ); - aEntry += DirEntry( String( "..", RTL_TEXTENCODING_ASCII_US )); - aEntry += DirEntry( sPrjRoot ); - ByteString sPrjEntry( aEntry.GetFull(), RTL_TEXTENCODING_ASCII_US ); - - // create file name, beginnig with project root - // (e.g.: source\ui\src\menue.src) - sActFileName = sFullEntry.Copy( sPrjEntry.Len() + 1 ); - - if( !bQuiet ) fprintf( stdout, "\nProcessing File %s ...\n", sOrigFile.GetBuffer()); - - sActFileName.SearchAndReplaceAll( "/", "\\" ); - sFile = sActFileName; - - if ( pExport ) { - // create instance of class export - pExport->Init(); - } - // return the valid file handle - return pFile; - } - } - // this means the file could not be opened - return NULL; -} - -int Parse( int nTyp, const char *pTokenText ){ - pExport->Execute( nTyp , pTokenText ); - return 1; -} -void Close(){ - pExport->pParseQueue->Close(); -} -/*****************************************************************************/ -int WorkOnTokenSet( int nTyp, char *pTokenText ) -/*****************************************************************************/ -{ - - pExport->pParseQueue->Push( QueueEntry( nTyp , ByteString( pTokenText ) ) ); - return 1; -} - -} // extern - -extern "C" { -/*****************************************************************************/ -int SetError() -/*****************************************************************************/ -{ - // set error at global instance of class Export - pExport->SetError(); - return 1; -} -} - -extern "C" { -/*****************************************************************************/ -int GetError() -/*****************************************************************************/ -{ - // get error at global instance of class Export - if ( pExport->GetError()) - return 1; - return FALSE; -} -} - -// -// class ResData -// - -void ResData::Dump(){ - printf("**************\nResData\n"); - printf("sPForm = %s , sResTyp = %s , sId = %s , sGId = %s , sHelpId = %s\n",sPForm.GetBuffer() - ,sResTyp.GetBuffer(),sId.GetBuffer(),sGId.GetBuffer(),sHelpId.GetBuffer()); - - ByteString a("*pStringList"); - ByteString b("*pUIEntries"); - ByteString c("*pFilterList"); - ByteString d("*pItemList"); - ByteString e("*pPairedList"); - ByteString f("sText"); - - Export::DumpMap( f , sText ); - - if( pStringList ) Export::DumpExportList( a , *pStringList ); - if( pUIEntries ) Export::DumpExportList( b , *pUIEntries ); - if( pFilterList ) Export::DumpExportList( c , *pFilterList ); - if( pItemList ) Export::DumpExportList( d , *pItemList ); - if( pPairedList ) Export::DumpExportList( e , *pPairedList ); - printf("\n"); -} - -void ResData::addFallbackData( ByteString& sId_in , const ByteString& sText_in ){ - //printf(" ResData::addFallbackData ( sId = %s , sText = %s )\n", sId_in.GetBuffer() , sText_in.GetBuffer() ); - aFallbackData[ sId_in ] = sText_in; -} -bool ResData::getFallbackData( ByteString& sId_in , ByteString& sText_inout ){ - sText_inout = aFallbackData[ sId_in ]; - //printf("ResData::getFallbackData( sId = %s , return sText = %s \n" , sId_in.GetBuffer(), sText_inout.GetBuffer()); - return sText_inout.Len() > 0; -} - -void ResData::addMergedLanguage( ByteString& sLang ){ - aMergedLanguages[ sLang ]=ByteString("1"); -} -bool ResData::isMerged( ByteString& sLang ){ - return aMergedLanguages[ sLang ].Equals("1"); -} - -/*****************************************************************************/ -BOOL ResData::SetId( const ByteString &rId, USHORT nLevel ) -/*****************************************************************************/ -{ - if ( nLevel > nIdLevel ) - { - nIdLevel = nLevel; - sId = rId; - - if ( bChild && bChildWithText ) { - ByteString sError( "ResId after child definition" ); - yyerror( sError.GetBufferAccess()); - sError.ReleaseBufferAccess(); - SetError(); - } - - if ( sId.Len() > 255 ) { - ByteString sWarning( "LocalId > 255 chars, truncating..." ); - YYWarning( sWarning.GetBufferAccess()); - sWarning.ReleaseBufferAccess(); - sId.Erase( 255 ); - sId.EraseTrailingChars( ' ' ); - sId.EraseTrailingChars( '\t' ); - } - - return TRUE; - } - - return FALSE; -} - -// -// class Export -// - -/*****************************************************************************/ -Export::Export( const ByteString &rOutput, BOOL bWrite, - const ByteString &rPrj, const ByteString &rPrjRoot , const ByteString& rFile ) -/*****************************************************************************/ - : - pWordTransformer( NULL ), - aCharSet( RTL_TEXTENCODING_MS_1252 ), - bDefine( FALSE ), - bNextMustBeDefineEOL( FALSE ), - nLevel( 0 ), - nList( LIST_NON ), - nListIndex( 0 ), - nListLevel( 0 ), - bSkipFile( false ), - sProject( sPrj ), - sRoot( sPrjRoot ), - bEnableExport( bWrite ), - bMergeMode( bUnmerge ), - bError( FALSE ), - bReadOver( FALSE ), - bDontWriteOutput( FALSE ), - sFilename( rFile ) -{ - pParseQueue = new ParserQueue( *this ); - (void) rPrj; - (void) rPrjRoot; - (void) rFile; - - if( !isInitialized ) InitLanguages(); - // used when export is enabled - - // open output stream - if ( bEnableExport ) { - aOutput.Open( String( rOutput, RTL_TEXTENCODING_ASCII_US ), STREAM_STD_WRITE | STREAM_TRUNC ); - if( !aOutput.IsOpen() ) { - printf("ERROR : Can't open file %s\n",rOutput.GetBuffer()); - exit ( -1 ); - } - aOutput.SetStreamCharSet( RTL_TEXTENCODING_UTF8 ); - - aOutput.SetLineDelimiter( LINEEND_CRLF ); - } -} - -/*****************************************************************************/ -Export::Export( const ByteString &rOutput, BOOL bWrite, - const ByteString &rPrj, const ByteString &rPrjRoot, - const ByteString &rMergeSource , const ByteString& rFile ) -/*****************************************************************************/ - : - pWordTransformer( NULL ), - aCharSet( RTL_TEXTENCODING_MS_1252 ), - bDefine( FALSE ), - bNextMustBeDefineEOL( FALSE ), - nLevel( 0 ), - nList( LIST_NON ), - nListIndex( 0 ), - nListLevel( 0 ), - bSkipFile( false ), - sProject( sPrj ), - sRoot( sPrjRoot ), - bEnableExport( bWrite ), - bMergeMode( TRUE ), - sMergeSrc( rMergeSource ), - bError( FALSE ), - bReadOver( FALSE ), - bDontWriteOutput( FALSE ), - sFilename( rFile ) -{ - (void) rPrj; - (void) rPrjRoot; - (void) rFile; - pParseQueue = new ParserQueue( *this ); - if( !isInitialized ) InitLanguages( bMergeMode ); - // used when merge is enabled - - // open output stream - if ( bEnableExport ) { - aOutput.Open( String( rOutput, RTL_TEXTENCODING_ASCII_US ), STREAM_STD_WRITE | STREAM_TRUNC ); - aOutput.SetStreamCharSet( RTL_TEXTENCODING_UTF8 ); - aOutput.SetLineDelimiter( LINEEND_CRLF ); - } - -} - -/*****************************************************************************/ -void Export::Init() -/*****************************************************************************/ -{ - // resets the internal status, used before parseing another file - sActPForm = ""; - bDefine = FALSE; - bNextMustBeDefineEOL = FALSE; - nLevel = 0; - nList = LIST_NON; - nListLang = ByteString( String::CreateFromAscii(""),RTL_TEXTENCODING_ASCII_US ); - nListIndex = 0; - while ( aResStack.Count()) { - delete aResStack.GetObject(( ULONG ) 0 ); - aResStack.Remove(( ULONG ) 0 ); - } -} - -/*****************************************************************************/ -Export::~Export() -/*****************************************************************************/ -{ - if( pParseQueue ) - delete pParseQueue; - // close output stream - if ( bEnableExport ) - aOutput.Close(); - while ( aResStack.Count()) { - delete aResStack.GetObject(( ULONG ) 0 ); - aResStack.Remove(( ULONG ) 0 ); - } - - if ( bMergeMode && !bUnmerge ) { - if ( !pMergeDataFile ) - pMergeDataFile = new MergeDataFile( sMergeSrc,sFile , bErrorLog, aCharSet);//, bUTF8 ); - - //pMergeDataFile->WriteErrorLog( sActFileName ); - delete pMergeDataFile; - } -} - -/*****************************************************************************/ -int Export::Execute( int nToken, const char * pToken ) -/*****************************************************************************/ -{ - - ByteString sToken( pToken ); - ByteString sOrig( sToken ); -/* printf("+---------------\n"); - printf("sToken = %s\n",sToken.GetBuffer()); - printf("nToken = %d\n",nToken); - printf("+---------------\n"); */ - BOOL bWriteToMerged = bMergeMode; - - if ( nToken == CONDITION ) { - ByteString sTestToken( pToken ); - sTestToken.EraseAllChars( '\t' ); - sTestToken.EraseAllChars( ' ' ); - if (( !bReadOver ) && ( sTestToken.Search( "#ifndef__RSC_PARSER" ) == 0 )) - bReadOver = TRUE; - else if (( bReadOver ) && ( sTestToken.Search( "#endif" ) == 0 )) - bReadOver = FALSE; - } - if ((( nToken < FILTER_LEVEL ) || ( bReadOver )) && - (!(( bNextMustBeDefineEOL ) && ( sOrig == "\n" )))) { - // this tokens are not mandatory for parsing, so ignore them ... - if ( bMergeMode ) - WriteToMerged( sOrig , false ); // ... ore whrite them directly to dest. - return 0; - } - - ResData *pResData = NULL; - if ( nLevel ) { - // res. exists at cur. level - pResData = aResStack.GetObject( nLevel-1 ); - } - else if (( nToken != RESSOURCE ) && - ( nToken != RESSOURCEEXPR ) && - ( nToken != SMALRESSOURCE ) && - ( nToken != LEVELUP ) && - ( nToken != NORMDEFINE ) && - ( nToken != RSCDEFINE ) && - ( nToken != CONDITION ) && - ( nToken != PRAGMA )) - { - // no res. exists at cur. level so return - if ( bMergeMode ) - WriteToMerged( sOrig , false ); - return 0; - } - // #define NO_LOCALIZE_EXPORT - if( bSkipFile ){ - if ( bMergeMode ) { - WriteToMerged( sOrig , false ); - } - return 1; - } - - - if ( bDefine ) { - if (( nToken != EMPTYLINE ) && ( nToken != LEVELDOWN ) && ( nToken != LEVELUP )) { - // cur. res. defined in macro - if ( bNextMustBeDefineEOL ) { - if ( nToken != RSCDEFINELEND ) { - // end of macro found, so destroy res. - bDefine = FALSE; - if ( bMergeMode ) { - /*if ( bDontWriteOutput && bUnmerge ) { - bDontWriteOutput = FALSE; - bNextMustBeDefineEOL = FALSE; - bDefine = TRUE; - }*/ - MergeRest( pResData ); - } - bNextMustBeDefineEOL = FALSE; - Execute( LEVELDOWN, "" ); - } - else { - // next line also in macro definition - bNextMustBeDefineEOL = FALSE; - if ( bMergeMode ) - WriteToMerged( sOrig , false ); - return 1; - } - } - else if (( nToken != LISTASSIGNMENT ) && ( nToken != UIENTRIES )){ - // cur. line has macro line end - ByteString sTmpLine( sToken ); - sTmpLine.EraseAllChars( '\t' ); sTmpLine.EraseAllChars( ' ' ); - #if 0 - // impossible, unsigned is never negative - if( sTmpLine.Len() < 0 ){ - if ( sTmpLine.GetChar(( USHORT )( sTmpLine.Len() - 1 )) != '\\' ) - bNextMustBeDefineEOL = TRUE; - } - #endif - } - } - } - - BOOL bExecuteDown = FALSE; - if ( nToken != LEVELDOWN ) { - USHORT nOpen = 0; - USHORT nClose = 0; - BOOL bReadOver1 = FALSE; - USHORT i = 0; - for ( i = 0; i < sToken.Len(); i++ ) { - if ( sToken.GetChar( i ) == '\"' ) - bReadOver1 = !bReadOver1; - if ( !bReadOver1 && ( sToken.GetChar( i ) == '{' )) - nOpen++; - } - - bReadOver1 = FALSE; - for ( i = 0; i < sToken.Len(); i++ ) { - if ( sToken.GetChar( i ) == '\"' ) - bReadOver1 = !bReadOver1; - if ( !bReadOver1 && ( sToken.GetChar( i ) == '}' )) - nClose++; - } - - if ( nOpen < nClose ) - bExecuteDown = TRUE; - } - switch ( nToken ) { - - case NORMDEFINE: - //printf("sToken = '%s'",sToken.GetBuffer()); - while( sToken.SearchAndReplace( "\r", " " ) != STRING_NOTFOUND ) {}; - while( sToken.SearchAndReplace( "\t", " " ) != STRING_NOTFOUND ) {}; - while( sToken.SearchAndReplace( " ", " " ) != STRING_NOTFOUND ) {}; - if( sToken.EqualsIgnoreCaseAscii( "#define NO_LOCALIZE_EXPORT" ) ){ - bSkipFile = true; - return 0; - } - if ( bMergeMode ) - WriteToMerged( sOrig , false ); - - return 0; - - - case RSCDEFINE: - bDefine = TRUE; // res. defined in macro - - case RESSOURCE: - case RESSOURCEEXPR: { - bDontWriteOutput = FALSE; - if ( nToken != RSCDEFINE ) - bNextMustBeDefineEOL = FALSE; - // this is the beginning of a new res. - nLevel++; - if ( nLevel > 1 ) { - aResStack.GetObject( nLevel - 2 )->bChild = TRUE; - } - - // create new instance for this res. and fill mandatory fields - - pResData = new ResData( sActPForm, FullId() , sFilename ); - aResStack.Insert( pResData, LIST_APPEND ); - ByteString sBackup( sToken ); - sToken.EraseAllChars( '\n' ); - sToken.EraseAllChars( '\r' ); - sToken.EraseAllChars( '{' ); - while( sToken.SearchAndReplace( "\t", " " ) != STRING_NOTFOUND ) {}; - sToken.EraseTrailingChars( ' ' ); - ByteString sT = sToken.GetToken( 0, ' ' ); - pResData->sResTyp = sT.ToLowerAscii(); - ByteString sId( sToken.Copy( pResData->sResTyp.Len() + 1 )); - ByteString sCondition; - if ( sId.Search( "#" ) != STRING_NOTFOUND ) { - // between ResTyp, Id and paranthes is a precomp. condition - sCondition = "#"; - sCondition += sId.GetToken( 1, '#' ); - sId = sId.GetToken( 0, '#' ); - } - sId = sId.GetToken( 0, '/' ); - CleanValue( sId ); - sId = sId.EraseAllChars( '\t' ); - pResData->SetId( sId, ID_LEVEL_IDENTIFIER ); - if ( sCondition.Len()) { - ByteString sEmpty( "" ); - Execute( CONDITION, sEmpty.GetBufferAccess()); // execute the - // precomp. - // condition - sEmpty.ReleaseBufferAccess(); - } - } - break; - case SMALRESSOURCE: { - bDontWriteOutput = FALSE; - // this is the beginning of a new res. - bNextMustBeDefineEOL = FALSE; - nLevel++; - if ( nLevel > 1 ) { - aResStack.GetObject( nLevel - 2 )->bChild = TRUE; - } - - // create new instance for this res. and fill mandatory fields - - pResData = new ResData( sActPForm, FullId() , sFilename ); - aResStack.Insert( pResData, LIST_APPEND ); - sToken.EraseAllChars( '\n' ); - sToken.EraseAllChars( '\r' ); - sToken.EraseAllChars( '{' ); - sToken.EraseAllChars( '\t' ); - sToken.EraseAllChars( ' ' ); - sToken.EraseAllChars( '\\' ); - pResData->sResTyp = sToken.ToLowerAscii(); - } - break; - case LEVELUP: { - // push - if ( nList ) - nListLevel++; - if ( nList ) - break; - - bDontWriteOutput = FALSE; - ByteString sLowerTyp; - if ( pResData ) - sLowerTyp = "unknown"; - nLevel++; - if ( nLevel > 1 ) { - aResStack.GetObject( nLevel - 2 )->bChild = TRUE; - } - - ResData *pNewData = new ResData( sActPForm, FullId() , sFilename ); - pNewData->sResTyp = sLowerTyp; - aResStack.Insert( pNewData, LIST_APPEND ); - } - break; - case LEVELDOWN: { - // pop - if ( !nList ) { - bDontWriteOutput = FALSE; - if ( nLevel ) { - if ( bDefine && (nLevel == 1 )) { - bDefine = FALSE; - bNextMustBeDefineEOL = FALSE; - } - WriteData( pResData ); - delete aResStack.GetObject( nLevel - 1 ); - aResStack.Remove( nLevel - 1 ); - nLevel--; - } - } - else { - if ( bDefine ) - bNextMustBeDefineEOL = TRUE; - if ( !nListLevel ) { - if ( bMergeMode ) - MergeRest( pResData, MERGE_MODE_LIST ); - nList = LIST_NON; - } - else - nListLevel--; - } - } - break; - case ASSIGNMENT: { - bDontWriteOutput = FALSE; - // interpret different types of assignement - ByteString sKey = sToken.GetToken( 0, '=' ); - sKey.EraseAllChars( ' ' ); - sKey.EraseAllChars( '\t' ); - ByteString sValue = sToken.GetToken( 1, '=' ); - CleanValue( sValue ); - if ( sKey.ToUpperAscii() == "IDENTIFIER" ) { - ByteString sId( sValue.EraseAllChars( '\t' )); - pResData->SetId( sId.EraseAllChars( ' ' ), ID_LEVEL_IDENTIFIER ); - } - else if ( sKey == "HELPID" ) { - pResData->sHelpId = sValue; - } - else if ( sKey == "STRINGLIST" ) { - //if ( bUnmerge ){ - // ( sOrig.SearchAndReplace( "=", "[ de ] =" )); - //} - - pResData->bList = TRUE; - nList = LIST_STRING; - //ByteString sLang("en-US" , RTL_TEXTENCODING_ASCII_US ); - nListLang = SOURCE_LANGUAGE; - nListIndex = 0; - nListLevel = 0; - } - else if ( sKey == "FILTERLIST" ) { - //if ( bUnmerge ){ - // ( sOrig.SearchAndReplace( "=", "[ de ] =" )); - //} - pResData->bList = TRUE; - nList = LIST_FILTER; - //ByteString sLang("en-US" , RTL_TEXTENCODING_ASCII_US ); - nListLang = SOURCE_LANGUAGE; - nListIndex = 0; - nListLevel = 0; - } - else if ( sKey == "UIENTRIES" ) { - //if ( bUnmerge ){ - // ( sOrig.SearchAndReplace( "=", "[ de ] =" ));} - pResData->bList = TRUE; - nList = LIST_UIENTRIES; - //ByteString sLang("en-US" , RTL_TEXTENCODING_ASCII_US ); - nListLang = SOURCE_LANGUAGE; - nListIndex = 0; - nListLevel = 0; - } - if (( sToken.Search( "{" ) != STRING_NOTFOUND ) && - ( sToken.GetTokenCount( '{' ) > sToken.GetTokenCount( '}' ))) - { - //WorkOnTokenSet( LEVELUP, pTkn ); - Parse( LEVELUP, "" ); - } - //if ( bUnmerge && ( nListLang.EqualsIgnoreCaseAscii("de") || nListLang.EqualsIgnoreCaseAscii("en-US") ) && ListExists( pResData, nList )) - // bDontWriteOutput = TRUE; - } - break; - case UIENTRIES: - case LISTASSIGNMENT: { - bDontWriteOutput = FALSE; - ByteString sTmpToken( sToken); - sTmpToken.EraseAllChars(' '); - USHORT nPos = 0; - //nPos = sTmpToken.ToLowerAscii().Search("[de]="); - nPos = sTmpToken.ToLowerAscii().Search("[en-us]="); - if( nPos != STRING_NOTFOUND ) { - //if ( bUnmerge ){ - // ( sOrig.SearchAndReplace( "=", "[ de ] =" )); - //} - ByteString sKey = sTmpToken.Copy( 0 , nPos ); - sKey.EraseAllChars( ' ' ); - sKey.EraseAllChars( '\t' ); - ByteString sValue = sToken.GetToken( 1, '=' ); - CleanValue( sValue ); - if ( sKey.ToUpperAscii() == "STRINGLIST" ) { - pResData->bList = TRUE; - nList = LIST_STRING; - //ByteString sLang("en-US" , RTL_TEXTENCODING_ASCII_US ); - nListLang = SOURCE_LANGUAGE; - nListIndex = 0; - nListLevel = 0; - } - else if ( sKey == "FILTERLIST" ) { - pResData->bList = TRUE; - nList = LIST_FILTER; - //ByteString sLang("en-US" , RTL_TEXTENCODING_ASCII_US ); - nListLang = SOURCE_LANGUAGE; - nListIndex = 0; - nListLevel = 0; - } - // PairedList - else if ( sKey == "PAIREDLIST" ) { - pResData->bList = TRUE; - nList = LIST_PAIRED; - //ByteString sLang("en-US" , RTL_TEXTENCODING_ASCII_US ); - nListLang = SOURCE_LANGUAGE; - nListIndex = 0; - nListLevel = 0; - } - - else if ( sKey == "ITEMLIST" ) { - pResData->bList = TRUE; - nList = LIST_ITEM; - //ByteString sLang("en-US" , RTL_TEXTENCODING_ASCII_US ); - nListLang = SOURCE_LANGUAGE; - nListIndex = 0; - nListLevel = 0; - } - else if ( sKey == "UIENTRIES" ) { - pResData->bList = TRUE; - nList = LIST_UIENTRIES; - //ByteString sLang("en-US" , RTL_TEXTENCODING_ASCII_US ); - nListLang = SOURCE_LANGUAGE; - nListIndex = 0; - nListLevel = 0; - } - /*if ( bUnmerge && ( nListLang.EqualsIgnoreCaseAscii( "de" ) - || nListLang.EqualsIgnoreCaseAscii("en-US" ) ) - && ListExists( pResData, nList )) - bDontWriteOutput = TRUE;*/ - } - else { - // new res. is a String- or FilterList - ByteString sKey = sToken.GetToken( 0, '[' ); - sKey.EraseAllChars( ' ' ); - sKey.EraseAllChars( '\t' ); - if ( sKey.ToUpperAscii() == "STRINGLIST" ) - nList = LIST_STRING; - else if ( sKey == "FILTERLIST" ) - nList = LIST_FILTER; - else if ( sKey == "PAIREDLIST" ) - nList = LIST_PAIRED; // abcd - else if ( sKey == "ITEMLIST" ) - nList = LIST_ITEM; - else if ( sKey == "UIENTRIES" ) - nList = LIST_UIENTRIES; - if ( nList ) { - ByteString sLang=sToken.GetToken( 1, '[' ).GetToken( 0, ']' ); - CleanValue( sLang ); - nListLang = sLang; - /*if (( bUnmerge ) && ( !nListLang.EqualsIgnoreCaseAscii("de")) && ( !nListLang.EqualsIgnoreCaseAscii("en-US"))) - bDontWriteOutput = TRUE;*/ - nListIndex = 0; - nListLevel = 0; - /*if ( bUnmerge && nListLang.EqualsIgnoreCaseAscii("de") && ListExists( pResData, nList ) ) - bDontWriteOutput = TRUE;*/ - } - } - } - break; - case TEXT: - case _LISTTEXT: - case LISTTEXT: { - // this is an entry for a String- or FilterList - if ( nList ) { - SetChildWithText(); - ByteString sEntry( sToken.GetToken( 1, '\"' )); - if ( sToken.GetTokenCount( '\"' ) > 3 ) - sEntry += "\""; - if ( sEntry == "\\\"" ) - sEntry = "\""; - //sEntry = sEntry.Convert( aCharSet, RTL_TEXTENCODING_MS_1252 ); - //sEntry = sEntry.Convert( RTL_TEXTENCODING_MS_1252, RTL_TEXTENCODING_UTF8 ); - InsertListEntry( sEntry, sOrig ); - if ( bMergeMode && ( sEntry != "\"" )) { - PrepareTextToMerge( sOrig, nList, nListLang, pResData ); - } - } - } - break; - case LONGTEXTLINE: - case TEXTLINE: - bDontWriteOutput = FALSE; - if ( nLevel ) { - CutComment( sToken ); - - // this is a text line!!! - ByteString sKey = sToken.GetToken( 0, '=' ).GetToken( 0, '[' ); - sKey.EraseAllChars( ' ' ); - sKey.EraseAllChars( '\t' ); - ByteString sText( GetText( sToken, nToken )); - if ( !bMergeMode ) - sText = sText.Convert( aCharSet, RTL_TEXTENCODING_MS_1252 ); - ByteString sLang; - if ( sToken.GetToken( 0, '=' ).Search( "[" ) != STRING_NOTFOUND ) { - sLang = sToken.GetToken( 0, '=' ).GetToken( 1, '[' ).GetToken( 0, ']' ); - CleanValue( sLang ); - } - ByteString nLangIndex = sLang; - ByteString sOrigKey = sKey; - if ( sText.Len() && sLang.Len() ) { - if (( sKey.ToUpperAscii() == "TEXT" ) || - ( sKey == "MESSAGE" ) || - ( sKey == "CUSTOMUNITTEXT" ) || - ( sKey == "SLOTNAME" ) || - ( sKey == "UINAME" )) - { - //if ( bUnmerge && sToken.GetToken( 0, '=' ).Search( "[" ) == STRING_NOTFOUND ) - // ( sOrig.SearchAndReplace( "=", "[ de ] =" )); - - SetChildWithText(); - //if ( nLangIndex.EqualsIgnoreCaseAscii("en-US") ) - if ( Export::isSourceLanguage( nLangIndex ) ) - pResData->SetId( sText, ID_LEVEL_TEXT ); - - pResData->bText = TRUE; - pResData->sTextTyp = sOrigKey; - if ( bMergeMode ) { - PrepareTextToMerge( sOrig, STRING_TYP_TEXT, nLangIndex, pResData ); - //if ( bUnmerge ) - // pResData->sText[ nLangIndex ] = sText; - } - else { - if ( pResData->sText[ nLangIndex ].Len()) { - ByteString sError( "Language " ); - sError += nLangIndex; - sError += " defined twice"; - } - pResData->sText[ nLangIndex ] = sText; - } - } - else if ( sKey == "HELPTEXT" ) { - //if ( bUnmerge && sToken.GetToken( 0, '=' ).Search( "[" ) == STRING_NOTFOUND ){ - // ( sOrig.SearchAndReplace( "=", "[ de ] =" )); - // } - SetChildWithText(); - pResData->bHelpText = TRUE; - if ( bBreakWhenHelpText ) { - ByteString sError( "\"HelpText\" found in source\n" ); - YYWarning( sError.GetBufferAccess()); - sError.ReleaseBufferAccess(); - SetError(); - } - if ( bMergeMode ) - PrepareTextToMerge( sOrig, STRING_TYP_HELPTEXT, nLangIndex, pResData ); - //if ( bUnmerge ) - // pResData->sHelpText[ nLangIndex ] = sText; - else { - if ( pResData->sHelpText[ nLangIndex ].Len()) { - ByteString sError( "Language " ); - sError += nLangIndex; - sError += " defined twice"; - } - pResData->sHelpText[ nLangIndex ] = sText; - } - } - else if ( sKey == "QUICKHELPTEXT" ) { - //if ( bUnmerge && sToken.GetToken( 0, '=' ).Search( "[" ) == STRING_NOTFOUND ){ - // ( sOrig.SearchAndReplace( "=", "[ de ] =" )); - // } - SetChildWithText(); - pResData->bQuickHelpText = TRUE; - if ( bMergeMode ) - PrepareTextToMerge( sOrig, STRING_TYP_QUICKHELPTEXT, nLangIndex, pResData ); - //if ( bUnmerge ) - // pResData->sQuickHelpText[ nLangIndex ] = sText; - else { - if ( pResData->sQuickHelpText[ nLangIndex ].Len()) { - ByteString sError( "Language " ); - sError += nLangIndex; - sError += " defined twice"; - } - pResData->sQuickHelpText[ nLangIndex ] = sText; - } - } - else if ( sKey == "TITLE" ) { - //if ( bUnmerge && sToken.GetToken( 0, '=' ).Search( "[" ) == STRING_NOTFOUND ){ - // ( sOrig.SearchAndReplace( "=", "[ de ] =" )); - // } - SetChildWithText(); - pResData->bTitle = TRUE; - if ( bMergeMode ) - PrepareTextToMerge( sOrig, STRING_TYP_TITLE, nLangIndex, pResData ); - //if ( bUnmerge ) - // pResData->sTitle[ nLangIndex ] = sText; - else { - if ( pResData->sTitle[ nLangIndex ].Len()) { - ByteString sError( "Language " ); - sError += nLangIndex; - sError += " defined twice"; - } - pResData->sTitle[ nLangIndex ] = sText; - } - } - else if ( sKey == "ACCESSPATH" ) { - pResData->SetId( sText, ID_LEVEL_ACCESSPATH ); - } - else if ( sKey == "FIELDNAME" ) { - pResData->SetId( sText, ID_LEVEL_FIELDNAME ); - } - } - } - break; - case NEWTEXTINRES: { - bDontWriteOutput = TRUE; - // this means something like // ### Achtung : Neuer Text ... - /*ByteString sLang( "GERMAN" ); - ByteString sText = sToken.GetToken( 2, ':' ).GetToken( 0, '*' ); - CleanValue( sText ); - if ( sText.Len()) - pResData->sText[ sLang ] = sText;*/ - } - break; - case APPFONTMAPPING: { - bDontWriteOutput = FALSE; - // this is a AppfontMapping, so look if its a definition - // of field size - ByteString sKey = sToken.GetToken( 0, '=' ); - sKey.EraseAllChars( ' ' ); - sKey.EraseAllChars( '\t' ); - ByteString sMapping = sToken.GetToken( 1, '=' ); - sMapping = sMapping.GetToken( 1, '(' ); - sMapping = sMapping.GetToken( 0, ')' ); - sMapping.EraseAllChars( ' ' ); - sMapping.EraseAllChars( '\t' ); - if ( sKey.ToUpperAscii() == "SIZE" ) { - pResData->nWidth = ( USHORT ) sMapping.GetToken( 0, ',' ).ToInt64(); - } - else if ( sKey == "POSSIZE" ) { - pResData->nWidth = ( USHORT ) sMapping.GetToken( 2, ',' ).ToInt64(); - } - } - break; - case RSCDEFINELEND: - bDontWriteOutput = FALSE; - break; - case CONDITION: { - bDontWriteOutput = FALSE; - while( sToken.SearchAndReplace( "\r", " " ) != STRING_NOTFOUND ) {}; - while( sToken.SearchAndReplace( "\t", " " ) != STRING_NOTFOUND ) {}; - while( sToken.SearchAndReplace( " ", " " ) != STRING_NOTFOUND ) {}; - ByteString sCondition = sToken.GetToken( 0, ' ' ); - if ( sCondition == "#ifndef" ) { - sActPForm = "!defined "; - sActPForm += sToken.GetToken( 1, ' ' ); - } - else if ( sCondition == "#ifdef" ) { - sActPForm = "defined "; - sActPForm += sToken.GetToken( 1, ' ' ); - } - else if ( sCondition == "#if" ) { - sActPForm = sToken.Copy( 4 ); - while ( sActPForm.SearchAndReplace( "||", "\\or" ) != STRING_NOTFOUND ) {}; - } - else if ( sCondition == "#elif" ) { - sActPForm = sToken.Copy( 6 ); - while ( sActPForm.SearchAndReplace( "||", "\\or" ) != STRING_NOTFOUND ) {}; - } - else if ( sCondition == "#else" ) { - sActPForm = sCondition; - } - else if ( sCondition == "#endif" ) { - sActPForm = ""; - } - else break; - if ( nLevel ) { - WriteData( pResData, TRUE ); - pResData->sPForm = sActPForm; - } - } - break; - case EMPTYLINE : { - bDontWriteOutput = FALSE; - if ( bDefine ) { - bNextMustBeDefineEOL = FALSE; - bDefine = FALSE; - while ( nLevel ) - Parse( LEVELDOWN, "" ); - //WorkOnTokenSet( LEVELDOWN, pTkn ); - } - } - break; - case PRAGMA : { - bDontWriteOutput = FALSE; - while( sToken.SearchAndReplace( "\t", " " ) != STRING_NOTFOUND ) {}; - while( sToken.SearchAndReplace( " ", " " ) != STRING_NOTFOUND ) {}; - sToken.EraseLeadingChars( ' ' ); - sToken.EraseTrailingChars( ' ' ); - - ByteString sCharset = sToken.GetToken( 1, ' ' ); - ByteString sSet = sToken.GetToken( 2, ' ' ); - if (( sCharset.ToUpperAscii() == "CHARSET_IBMPC" ) || - ( sCharset == "RTL_TEXTENCODING_IBM_850" ) || - (( sCharset == "CHARSET" ) && ( sSet.ToUpperAscii() == "IBMPC" ))) - { - aCharSet = RTL_TEXTENCODING_IBM_850; - } - else if (( sCharset == "CHARSET_ANSI" ) || - ( sCharset == "RTL_TEXTENCODING_MS_1252" ) || - (( sCharset == "CHARSET" ) && ( sSet.ToUpperAscii() == "ANSI" ))) - { - aCharSet = RTL_TEXTENCODING_MS_1252; - } - } - break; - case TEXTREFID : { - bDontWriteOutput = TRUE; - /*ByteString sK = sToken.GetToken( 0, '=' ); - ByteString sKey = sK.EraseAllChars( '\t' ).EraseAllChars( ' ' ); - ByteString sT = sToken.GetToken( 1, '=' ).GetToken( 0, ';' ); - USHORT nRefId = ( USHORT ) sT.EraseAllChars( '\t' ).EraseAllChars( ' ' ).ToInt32(); - if (( sKey.ToUpperAscii() == "TEXT" ) || - ( sKey == "MESSAGE" ) || - ( sKey == "CUSTOMUNITTEXT" ) || - ( sKey == "SLOTNAME" ) || - ( sKey == "UINAME" )) - pResData->nTextRefId = nRefId; - else if ( sKey == "HELPTEXT" ) - pResData->nHelpTextRefId = nRefId; - else if ( sKey == "QUICKHELPTEXT" ) - pResData->nQuickHelpTextRefId = nRefId; - else if ( sKey == "TITLE" ) - pResData->nTitleRefId = nRefId;*/ - } - } - if ( bWriteToMerged ) { - // the current token must be written to dest. without merging - - if( bDefine && sOrig.Len() > 2 ){ - for( USHORT n = 0 ; n < sOrig.Len() ; n++ ){ - if( sOrig.GetChar( n ) == '\n' && sOrig.GetChar( n-1 ) != '\\'){ - sOrig.Insert('\\' , n++ ); - } - } - } - WriteToMerged( sOrig , false); - } - - if ( bExecuteDown ) { - Parse( LEVELDOWN, "" ); - //WorkOnTokenSet( LEVELDOWN, pTkn ); - } - - return 1; -} - -/*****************************************************************************/ -void Export::CutComment( ByteString &rText ) -/*****************************************************************************/ -{ - if ( rText.Search( "//" ) != STRING_NOTFOUND ) { - ByteString sWork( rText ); - sWork.SearchAndReplaceAll( "\\\"", "XX" ); - USHORT i = 0; - BOOL bInner = FALSE; - - while ( i < sWork.Len() - 1 ) { - if ( sWork.GetChar( i ) == '\"' ) - bInner = !bInner; - else if - (( sWork.GetChar( i ) == '/' ) && - ( !bInner ) && - ( sWork.GetChar( i + 1 ) == '/' )) - { - rText.Erase( i ); - return; - } - i++; - } - } -} - -void Export::UnmergeUTF8( ByteString& sOrig ){ - USHORT nPos1 = sOrig.Search('\"'); - USHORT nPos2 = sOrig.SearchBackward('\"'); - if( nPos1 > 0 && nPos2 > 0 && nPos1 < nPos2){ - ByteString sPart = sOrig.Copy(nPos1+1 , nPos2-1); - ByteString sPartUTF8 = sPart; - sPartUTF8.Convert( RTL_TEXTENCODING_MS_1252 , RTL_TEXTENCODING_UTF8 ); - sOrig.SearchAndReplace( sPart , sPartUTF8 ); - } -} - -/*****************************************************************************/ -BOOL Export::ListExists( ResData *pResData, USHORT nLst ) -/*****************************************************************************/ -{ - switch ( nLst ) { - case LIST_STRING: return pResData->pStringList != NULL; - case LIST_FILTER: return pResData->pFilterList != NULL; - case LIST_ITEM: return pResData->pItemList != NULL; - case LIST_PAIRED: return pResData->pPairedList != NULL; - case LIST_UIENTRIES: return pResData->pUIEntries != NULL; - } - return FALSE; -} - -/*****************************************************************************/ -BOOL Export::WriteData( ResData *pResData, BOOL bCreateNew ) -/*****************************************************************************/ -{ - if ( bMergeMode ) { - MergeRest( pResData ); - return TRUE; - } - - if ( bUnmerge ) - return TRUE; - -/* ByteStringHashMap::iterator pos3 = pResData->sText.begin(); - ByteStringHashMap::iterator end3 = pResData->sText.end(); - for(;pos3!=end3;++pos3){ - - printf("[%s]=%s\n", pos3->first.GetBuffer(), pos3->second.GetBuffer() ); - }*/ - // mandatory to export: en-US - - if (( //pResData->sText[ ByteString("de") ].Len() && - ( pResData->sText[ SOURCE_LANGUAGE ].Len())) - || - ( //pResData->sHelpText[ ByteString("de") ].Len() && - ( pResData->sHelpText[ SOURCE_LANGUAGE ].Len())) - || - ( //pResData->sQuickHelpText[ ByteString("de") ].Len() && - ( pResData->sQuickHelpText[ SOURCE_LANGUAGE ].Len())) - || - ( //pResData->sTitle[ ByteString("de") ].Len() && - ( pResData->sTitle[ SOURCE_LANGUAGE ].Len()))) - - { - FillInFallbacks( pResData ); - - ByteString sGID = pResData->sGId; - ByteString sLID; - if ( !sGID.Len()) - sGID = pResData->sId; - else - sLID = pResData->sId; - - ByteString sXText; - ByteString sXHText; - ByteString sXQHText; - ByteString sXTitle; - - ByteString sTimeStamp( Export::GetTimeStamp()); - ByteString sCur; - - for( unsigned int n = 0; n < aLanguages.size(); n++ ){ - sCur = aLanguages[ n ]; - if ( !sCur.EqualsIgnoreCaseAscii("x-comment") ){ - if ( pResData->sText[ sCur ].Len()) - sXText = pResData->sText[ sCur ]; - else { - sXText = pResData->sText[ SOURCE_LANGUAGE ]; - /*if ( !sXText.Len()) - sXText = pResData->sText[ ByteString("en") ]; - if ( !sXText.Len()) - sXText = pResData->sText[ ByteString("de") ];*/ - } - - if ( pResData->sHelpText[ sCur ].Len()) - sXHText = pResData->sHelpText[ sCur ]; - else { - sXHText = pResData->sHelpText[ SOURCE_LANGUAGE ]; - /*if ( !sXHText.Len()) - sXHText = pResData->sHelpText[ ByteString("en") ]; - if ( !sXText.Len()) - sXHText = pResData->sHelpText[ ByteString("de") ];*/ - } - - if ( pResData->sQuickHelpText[ sCur ].Len()) - sXQHText = pResData->sQuickHelpText[ sCur ]; - else { - sXQHText = pResData->sQuickHelpText[ SOURCE_LANGUAGE ]; - /*if ( !sXQHText.Len()) - sXQHText = pResData->sQuickHelpText[ ByteString("en") ]; - if ( !sXQHText.Len()) - sXQHText = pResData->sQuickHelpText[ ByteString("de") ];*/ - } - - if ( pResData->sTitle[ sCur ].Len()) - sXTitle = pResData->sTitle[ sCur ]; - else { - sXTitle = pResData->sTitle[ SOURCE_LANGUAGE ]; - /*if ( !sXTitle.Len()) - sXTitle = pResData->sTitle[ ByteString("en") ]; - if ( !sXTitle.Len()) - sXTitle = pResData->sTitle[ ByteString("de") ];*/ - } - - if ( !sXText.Len()) - sXText = "-"; - - if ( !sXHText.Len()) { - /*if ( pResData->sHelpText[ ByteString("de") ].Len()) - sXHText = pResData->sHelpText[ ByteString("de") ];*/ - if ( pResData->sHelpText[ SOURCE_LANGUAGE ].Len()) - sXHText = pResData->sHelpText[ SOURCE_LANGUAGE ]; - /*else if ( pResData->sHelpText[ ByteString("en") ].Len()) - sXHText = pResData->sHelpText[ ByteString("en") ];*/ - } - } - else - sXText = pResData->sText[ sCur ]; - - if ( bEnableExport ) { - ByteString sOutput( sProject ); sOutput += "\t"; - if ( sRoot.Len()) - sOutput += sActFileName; - sOutput += "\t0\t"; - sOutput += pResData->sResTyp; sOutput += "\t"; - sOutput += sGID; sOutput += "\t"; - sOutput += sLID; sOutput += "\t"; - sOutput += pResData->sHelpId; sOutput += "\t"; - sOutput += pResData->sPForm; sOutput += "\t"; - sOutput += ByteString::CreateFromInt64( pResData->nWidth ); sOutput += "\t"; - sOutput += sCur; sOutput += "\t"; - - - sOutput += sXText; sOutput += "\t"; - sOutput += sXHText; sOutput += "\t"; - sOutput += sXQHText; sOutput+= "\t"; - sOutput += sXTitle; sOutput += "\t"; - sOutput += sTimeStamp; - - // if( !sCur.EqualsIgnoreCaseAscii("de") ||( sCur.EqualsIgnoreCaseAscii("de") && !Export::isMergingGermanAllowed( sProject ) ) ) - aOutput.WriteLine( sOutput ); - } - - if ( bCreateNew ) { - pResData->sText[ sCur ] = ""; - pResData->sHelpText[ sCur ] = ""; - pResData->sQuickHelpText[ sCur ]= ""; - pResData->sTitle[ sCur ] = ""; - } - } - } - FillInFallbacks( pResData ); - if ( pResData->pStringList ) { - ByteString sList( "stringlist" ); - WriteExportList( pResData, pResData->pStringList, sList, bCreateNew ); - if ( bCreateNew ) - pResData->pStringList = 0; - } - if ( pResData->pFilterList ) { - ByteString sList( "filterlist" ); - WriteExportList( pResData, pResData->pFilterList, sList, bCreateNew ); - if ( bCreateNew ) - pResData->pFilterList = 0; - } - if ( pResData->pItemList ) { - ByteString sList( "itemlist" ); - WriteExportList( pResData, pResData->pItemList, sList, bCreateNew ); - if ( bCreateNew ) - pResData->pItemList = 0; - } - if ( pResData->pPairedList ) { - ByteString sList( "pairedlist" ); - WriteExportList( pResData, pResData->pPairedList, sList, bCreateNew ); - if ( bCreateNew ) - pResData->pItemList = 0; - } - if ( pResData->pUIEntries ) { - ByteString sList( "uientries" ); - WriteExportList( pResData, pResData->pUIEntries, sList, bCreateNew ); - if ( bCreateNew ) - pResData->pUIEntries = 0; - } - return TRUE; -} -ByteString Export::GetPairedListID( const ByteString& sText ){ -// < "STRING" ; IDENTIFIER ; > ; - ByteString sIdent = sText.GetToken( 1, ';' ); - sIdent.ToUpperAscii(); - while( sIdent.SearchAndReplace( "\t", " " ) != STRING_NOTFOUND ) {}; - sIdent.EraseTrailingChars( ' ' ); - sIdent.EraseLeadingChars( ' ' ); - return sIdent; -} -ByteString Export::GetPairedListString( const ByteString& sText ){ -// < "STRING" ; IDENTIFIER ; > ; - ByteString sString = sText.GetToken( 0, ';' ); - while( sString.SearchAndReplace( "\t", " " ) != STRING_NOTFOUND ) {}; - sString.EraseTrailingChars( ' ' ); - ByteString s1 = sString.Copy( sString.Search( '\"' )+1 ); - sString = s1.Copy( 0 , s1.SearchBackward( '\"' ) ); - sString.EraseTrailingChars( ' ' ); - sString.EraseLeadingChars( ' ' ); - return sString; -} -ByteString Export::StripList( const ByteString& sText ){ - ByteString s1 = sText.Copy( sText.Search( '\"' ) + 1 ); - return s1.Copy( 0 , s1.SearchBackward( '\"' ) ); -} - -/*****************************************************************************/ -BOOL Export::WriteExportList( ResData *pResData, ExportList *pExportList, - const ByteString &rTyp, BOOL bCreateNew ) -/*****************************************************************************/ -{ - ByteString sGID = pResData->sGId; - if ( !sGID.Len()) - sGID = pResData->sId; - else { - sGID += "."; - sGID += pResData->sId; - sGID.EraseTrailingChars( '.' ); - } - - ByteString sTimeStamp( Export::GetTimeStamp()); - ByteString sCur; - for ( ULONG i = 0; pExportList != NULL && i < pExportList->Count(); i++ ) { - ExportListEntry *pEntry = pExportList->GetObject( i ); - // mandatory for export: german and eng. and/or enus - //ByteString a("Export::WriteExportList::pEntry"); - //Export::DumpMap( a, *pEntry ); - - ByteString sLID( ByteString::CreateFromInt64( i + 1 )); - for( unsigned int n = 0; n < aLanguages.size(); n++ ){ - sCur = aLanguages[ n ]; - if ( //1 ) - //(*pEntry)[ ByteString("de") ].Len() && - (*pEntry)[ SOURCE_LANGUAGE ].Len() ) - //|| - // (*pEntry)[ ByteString("en") ].Len())) - { - if ( bEnableExport ) - { - ByteString sText((*pEntry)[ SOURCE_LANGUAGE ] ); - - // Strip PairList Line String - if( rTyp.EqualsIgnoreCaseAscii("pairedlist") ){ - sLID = GetPairedListID( sText ); - if ((*pEntry)[ sCur ].Len()) - sText = (*pEntry)[ sCur ]; - sText = GetPairedListString( sText ); - } - else{ - //if ((*pEntry)[ sCur ].Len()){ - // if( sCur.EqualsIgnoreCaseAscii("de") ){ - // sText = StripList( (*pEntry)[ sCur ] ); - // } - // else - sText = StripList( (*pEntry)[ sCur ] ); - if( sText == "\\\"" ) - sText = "\""; - //} - } - - ByteString sOutput( sProject ); sOutput += "\t"; - if ( sRoot.Len()) - sOutput += sActFileName; - sOutput += "\t0\t"; - sOutput += rTyp; sOutput += "\t"; - sOutput += sGID; sOutput += "\t"; - sOutput += sLID; sOutput += "\t\t"; - sOutput += pResData->sPForm; sOutput += "\t0\t"; - sOutput += sCur; sOutput += "\t"; - - sOutput += sText; sOutput += "\t\t\t\t"; - sOutput += sTimeStamp; - - //if( !sCur.EqualsIgnoreCaseAscii("de") ||( sCur.EqualsIgnoreCaseAscii("de") && !Export::isMergingGermanAllowed( sProject ) ) ) - aOutput.WriteLine( sOutput ); - - } - } - } - if ( bCreateNew ) - delete [] pEntry; - } - if ( bCreateNew ) - delete pExportList; - - return TRUE; -} - -/*****************************************************************************/ -ByteString Export::FullId() -/*****************************************************************************/ -{ - ByteString sFull; - if ( nLevel > 1 ) { - sFull = aResStack.GetObject( 0 )->sId; - for ( USHORT i = 1; i < nLevel - 1; i++ ) { - ByteString sToAdd = aResStack.GetObject( i )->sId; - if ( sToAdd.Len()) { - sFull += "."; - sFull += sToAdd; - } - } - } - if ( sFull.Len() > 255 ) { - ByteString sError( "GroupId > 255 chars" ); - printf("GroupID = %s\n",sFull.GetBuffer()); - yyerror( sError.GetBufferAccess()); - sError.ReleaseBufferAccess(); - } - - return sFull; -} - -/*****************************************************************************/ -void Export::InsertListEntry( const ByteString &rText, const ByteString &rLine ) -/*****************************************************************************/ -{ - ResData *pResData = aResStack.GetObject( nLevel-1 ); - - ExportList *pList = NULL; - if ( nList == LIST_STRING ) { - pList = pResData->pStringList; - if ( !pList ) { - pResData->pStringList = new ExportList(); - pList = pResData->pStringList; - nListIndex = 0; - } - } - else if ( nList == LIST_FILTER ) { - pList = pResData->pFilterList; - if ( !pList ) { - pResData->pFilterList = new ExportList(); - pList = pResData->pFilterList; - nListIndex = 0; - } - } - else if ( nList == LIST_ITEM ) { - pList = pResData->pItemList; - if ( !pList ) { - pResData->pItemList = new ExportList(); - pList = pResData->pItemList; - nListIndex = 0; - } - } - else if ( nList == LIST_PAIRED ) { - pList = pResData->pPairedList; - if ( !pList ) { - pResData->pPairedList = new ExportList(); - pList = pResData->pPairedList; - nListIndex = 0; - } - } - else if ( nList == LIST_UIENTRIES ) { - pList = pResData->pUIEntries; - if ( !pList ) { - pResData->pUIEntries = new ExportList(); - pList = pResData->pUIEntries; - nListIndex = 0; - } - } - else - return; - - if ( nListIndex + 1 > pList->Count()) { - ExportListEntry *pNew = new ExportListEntry(); - (*pNew)[ LIST_REFID ] = ByteString::CreateFromInt32( REFID_NONE ); - pList->Insert( pNew, LIST_APPEND ); - } - ExportListEntry *pCurEntry = pList->GetObject( nListIndex ); - - // For paired list use the line to set proper lid - if( nList == LIST_PAIRED ){ - (*pCurEntry)[ nListLang ] = rLine; - }else - (*pCurEntry)[ nListLang ] = rText; - - // Remember en-US fallback string, so each list has the same amount of elements - //if ( nListLang.EqualsIgnoreCaseAscii("en-US") ) { - if ( Export::isSourceLanguage( nListLang ) ) { - if( nList == LIST_PAIRED ){ - const ByteString sPlist("pairedlist"); - ByteString sKey = MergeDataFile::CreateKey( sPlist , pResData->sId , GetPairedListID( rLine ) , sFilename ); - pResData->addFallbackData( sKey , rText ); - } - // new fallback - else{ - const ByteString sPlist("list"); - ByteString a( pResData->sGId ); - a.Append( "." ); - a.Append( pResData->sId ); - sal_Int64 x = nListIndex+1; - ByteString b( ByteString::CreateFromInt64( x ) ); - ByteString sKey = MergeDataFile::CreateKey( sPlist , a , b , sFilename ); - pResData->addFallbackData( sKey , rText ); - } - // new fallback - } - - //if ( nListLang.EqualsIgnoreCaseAscii("en-US") ) { - if ( Export::isSourceLanguage( nListLang ) ) { - if( nList == LIST_PAIRED ){ - (*pCurEntry)[ SOURCE_LANGUAGE ] = rLine; - } - else - (*pCurEntry)[ SOURCE_LANGUAGE ] = rLine; - - pList->NewSourceLanguageListEntry(); - } - - //printf("Export::InsertListEntry ResData.id = %s ResData.ListData = %s\n",pResData->sId.GetBuffer() ,(*pCurEntry)[ nListLang ].GetBuffer()); - nListIndex++; -} - -/*****************************************************************************/ -void Export::CleanValue( ByteString &rValue ) -/*****************************************************************************/ -{ - while ( rValue.Len()) { - if (( rValue.GetChar( 0 ) == ' ' ) || ( rValue.GetChar( 0 ) == '\t' )) - rValue = rValue.Copy( 1 ); - else - break; - } - - if ( rValue.Len()) { - for ( USHORT i = rValue.Len() - 1; i > 0; i-- ) { - if (( rValue.GetChar( i ) == ' ' ) || ( rValue.GetChar( i ) == '\t' ) || - ( rValue.GetChar( i ) == '\n' ) || ( rValue.GetChar( i ) == ';' ) || - ( rValue.GetChar( i ) == '{' ) || ( rValue.GetChar( i ) == '\\' ) || - ( rValue.GetChar( i ) == '\r' )) - rValue.Erase( i ); - else - break; - } - } -} - - -/*****************************************************************************/ -ByteString Export::GetText( const ByteString &rSource, int nToken ) -/*****************************************************************************/ -#define TXT_STATE_NON 0x000 -#define TXT_STATE_TEXT 0x001 -#define TXT_STATE_MACRO 0x002 -{ - ByteString sReturn; - switch ( nToken ) { - case TEXTLINE: - case LONGTEXTLINE: { - ByteString sTmp( rSource.Copy( rSource.Search( "=" ))); - CleanValue( sTmp ); - sTmp.EraseAllChars( '\n' ); - sTmp.EraseAllChars( '\r' ); - - while ( sTmp.SearchAndReplace( "\\\\\"", "-=<[BSlashBSlashHKom]>=-\"" ) - != STRING_NOTFOUND ) {}; - while ( sTmp.SearchAndReplace( "\\\"", "-=<[Hochkomma]>=-" ) - != STRING_NOTFOUND ) {}; - while ( sTmp.SearchAndReplace( "\\", "-=<[0x7F]>=-" ) - != STRING_NOTFOUND ) {}; - while ( sTmp.SearchAndReplace( "\\0x7F", "-=<[0x7F]>=-" ) - != STRING_NOTFOUND ) {}; - - USHORT nStart = 0; - USHORT nState = TXT_STATE_MACRO; - - nState = TXT_STATE_TEXT; - nStart = 1; - - - for ( USHORT i = nStart; i < sTmp.GetTokenCount( '\"' ); i++ ) { - ByteString sToken = sTmp.GetToken( i, '\"' ); - if ( sToken.Len()) { - if ( nState == TXT_STATE_TEXT ) { - sReturn += sToken; - nState = TXT_STATE_MACRO; - } - else { - while( sToken.SearchAndReplace( "\t", " " ) != - STRING_NOTFOUND ) {}; - while( sToken.SearchAndReplace( " ", " " ) != - STRING_NOTFOUND ) {}; - sToken.EraseLeadingChars( ' ' ); - sToken.EraseTrailingChars( ' ' ); - if ( sToken.Len()) { - sReturn += "\\\" "; - sReturn += sToken; - sReturn += " \\\""; - } - nState = TXT_STATE_TEXT; - } - } - } - - while ( sReturn.SearchAndReplace( "-=<[0x7F]>=-", "" ) - != STRING_NOTFOUND ) {}; - while ( sReturn.SearchAndReplace( "-=<[Hochkomma]>=-", "\"" ) - != STRING_NOTFOUND ) {}; - while ( sReturn.SearchAndReplace( "-=<[BSlashBSlashHKom]>=-", "\\\\" ) - != STRING_NOTFOUND ) {}; - - - while ( sReturn.SearchAndReplace( "\\\\", "-=<[BSlashBSlash]>=-" ) - != STRING_NOTFOUND ) {}; - while ( sReturn.SearchAndReplace( "-=<[BSlashBSlash]>=-", "\\" ) - != STRING_NOTFOUND ) {}; - - } - break; - } - return sReturn; -} - -/*****************************************************************************/ -void Export::WriteToMerged( const ByteString &rText , bool bSDFContent ) -/*****************************************************************************/ -{ - static ByteString SLASH ('\\'); - static ByteString RETURN ('\n'); - //printf("%s\n",rText.GetBuffer() ); - - #if 0 - // statement has no effect - if( pParseQueue->bMflag && !bSDFContent ) pParseQueue->bMflag; - #endif - - if ( !bDontWriteOutput || !bUnmerge ) { - ByteString sText( rText ); - while ( sText.SearchAndReplace( " \n", "\n" ) != STRING_NOTFOUND ) {}; - if( pParseQueue->bNextIsM && bSDFContent && sText.Len() > 2 ){ - for( USHORT n = 0 ; n < sText.Len() ; n++ ){ - if( sText.GetChar( n ) == '\n' && sText.GetChar( n-1 ) != '\\'){ - sText.Insert('\\' , n++ ); - - } - } - } - else if( pParseQueue->bLastWasM && sText.Len() > 2 ){ - for( USHORT n = 0 ; n < sText.Len() ; n++ ){ - if( sText.GetChar( n ) == '\n' && sText.GetChar( n-1 ) != '\\'){ - sText.Insert('\\' , n++ ); - } - if( sText.GetChar( n ) == '\n' )pParseQueue->bMflag=true; - } - } - else if( pParseQueue->bCurrentIsM && bSDFContent && sText.Len() > 2 ){ - for( USHORT n = 0 ; n < sText.Len() ; n++ ){ - if( sText.GetChar( n ) == '\n' && sText.GetChar( n-1 ) != '\\'){ - sText.Insert('\\' , n++ ); - pParseQueue->bMflag=true; - } - } - } - else if( pParseQueue->bMflag ){ - for( USHORT n = 1 ; n < sText.Len() ; n++ ){ - if( sText.GetChar( n ) == '\n' && sText.GetChar( n-1 ) != '\\'){ - sText.Insert('\\' , n++ ); - } - } - } - for ( USHORT i = 0; i < sText.Len(); i++ ) { - if ( sText.GetChar( i ) != '\n' ){ - aOutput.Write( ByteString( sText.GetChar( i )).GetBuffer(), 1 ); - - } - else{ - aOutput.WriteLine( ByteString()); - } - - } - } -} - -/*****************************************************************************/ -void Export::ConvertMergeContent( ByteString &rText ) -/*****************************************************************************/ -{ - BOOL bNoOpen = ( rText.Search( "\\\"" ) != 0 ); - ByteString sClose( rText.Copy( rText.Len() - 2 )); - BOOL bNoClose = ( sClose != "\\\"" ); - ByteString sNew; - for ( USHORT i = 0; i < rText.Len(); i++ ) { - ByteString sChar( rText.GetChar( i )); - if ( sChar == "\\" ) { - if (( i + 1 ) < rText.Len()) { - ByteString sNext( rText.GetChar( i + 1 )); - if ( sNext == "\"" ) { - sChar = "\""; - i++; - } - else if ( sNext == "n" ) { - sChar = "\\n"; - i++; - } - else if ( sNext == "t" ) { - sChar = "\\t"; - i++; - } - else if ( sNext == "\'" ) { - sChar = "\\\'"; - i++; - } - else - sChar = "\\\\"; - } - else { - sChar = "\\\\"; - } - } - else if ( sChar == "\"" ) { - sChar = "\\\""; - } - else if ( sChar == "" ) { - sChar = "\\0x7F"; - } - sNew += sChar; - } - - rText = sNew; - - if ( bNoOpen ) { - ByteString sTmp( rText ); - rText = "\""; - rText += sTmp; - } - if ( bNoClose ) - rText += "\""; -} - -/*****************************************************************************/ -BOOL Export::PrepareTextToMerge( ByteString &rText, USHORT nTyp, - ByteString &nLangIndex, ResData *pResData ) -/*****************************************************************************/ -{ - // position to merge in: - USHORT nStart = 0; - USHORT nEnd = 0; - ByteString sOldId = pResData->sId; - ByteString sOldGId = pResData->sGId; - ByteString sOldTyp = pResData->sResTyp; - - ByteString sOrigText( rText ); - - switch ( nTyp ) { - case LIST_STRING : - case LIST_UIENTRIES : - case LIST_FILTER : - case LIST_PAIRED: - case LIST_ITEM : - { - if ( bUnmerge ) - return TRUE; - - ExportList *pList = NULL; - switch ( nTyp ) { - case LIST_STRING : { - pResData->sResTyp = "stringlist"; - pList = pResData->pStringList; - } - break; - case LIST_UIENTRIES : { - pResData->sResTyp = "uientries"; - pList = pResData->pUIEntries; - } - break; - case LIST_FILTER : { - pResData->sResTyp = "filterlist"; - pList = pResData->pFilterList; - } - break; - case LIST_ITEM : { - pResData->sResTyp = "itemlist"; - pList = pResData->pItemList; - } - break; - case LIST_PAIRED : { - pResData->sResTyp = "pairedlist"; - pList = pResData->pPairedList; - } - break; - - } - if ( pList ) { - ExportListEntry *pCurEntry = pList->GetObject( nListIndex - 1 ); - if ( pCurEntry ) { - //printf("%s\n",Export::DumpMap( "pCurEntry", *pCurEntry ).GetBuffer() ); - //ByteString a("pCurEntry"); - //Export::DumpMap( a , *pCurEntry ); - rText = (*pCurEntry)[ SOURCE_LANGUAGE ]; - if( nTyp == LIST_PAIRED ){ - pResData->addMergedLanguage( nLangIndex ); - } - } - } - - nStart = rText.Search( "\"" ); - if ( nStart == STRING_NOTFOUND ) { - rText = sOrigText; - return FALSE; - } - - BOOL bFound = FALSE; - for ( nEnd = nStart + 1; nEnd < rText.Len() && !bFound; nEnd++ ) { - if ( rText.GetChar( nEnd ) == '\"' ) - bFound = TRUE; - } - if ( !bFound ) { - rText = sOrigText; - return FALSE; - } - - nEnd --; - sLastListLine = rText; - if (( sLastListLine.Search( ">" ) != STRING_NOTFOUND ) && - ( sLastListLine.Search( "<" ) == STRING_NOTFOUND )) - { - ByteString sTmp = sLastListLine; - sLastListLine = "<"; - sLastListLine += sTmp; - } - if ( pResData->sResTyp.EqualsIgnoreCaseAscii( "pairedlist" ) ){ - pResData->sId = GetPairedListID( sLastListLine ); - } - else pResData->sId = ByteString::CreateFromInt32( nListIndex ); - - if ( pResData->sGId.Len()) - pResData->sGId += "."; - pResData->sGId += sOldId; - nTyp = STRING_TYP_TEXT; - } - break; - case STRING_TYP_TEXT : - case STRING_TYP_HELPTEXT : - case STRING_TYP_QUICKHELPTEXT : - case STRING_TYP_TITLE : - { - /*if ( bUnmerge ) { - if (( nLangIndex != ByteString("de") ) && - ( nLangIndex != ByteString("en-US") )) - { - bDontWriteOutput = TRUE; - } - return TRUE; - }*/ - - nStart = rText.Search( "=" ); - if ( nStart == STRING_NOTFOUND ) { - rText = sOrigText; - return FALSE; - } - - nStart++; - BOOL bFound = FALSE; - while(( nStart < rText.Len()) && !bFound ) { - if (( rText.GetChar( nStart ) != ' ' ) && ( rText.GetChar( nStart ) != '\t' )) - bFound = TRUE; - else - nStart ++; - } - - // no start position found - if ( !bFound ) { - rText = sOrigText; - return FALSE; - } - - // position to end mergeing in - nEnd = rText.Len() - 1; - bFound = FALSE; - - while (( nEnd > nStart ) && !bFound ) { - if (( rText.GetChar( nEnd ) != ' ' ) && ( rText.GetChar( nEnd ) != '\t' ) && - ( rText.GetChar( nEnd ) != '\n' ) && ( rText.GetChar( nEnd ) != ';' ) && - ( rText.GetChar( nEnd ) != '{' ) && ( rText.GetChar( nEnd ) != '\\' )) - { - bFound = TRUE; - } - else - nEnd --; - } - } - break; - } - - // search for merge data - if ( !pMergeDataFile ){ - pMergeDataFile = new MergeDataFile( sMergeSrc, sFile , bErrorLog, aCharSet);//, bUTF8 ); - - // Init Languages - ByteString sTmp = Export::sLanguages; - if( sTmp.ToUpperAscii().Equals("ALL") ) - SetLanguages( pMergeDataFile->GetLanguages() ); - else if( !isInitialized )InitLanguages(); - - } -// printf("*************DUMPING****************\n"); -// printf("%s\n",pMergeDataFile->Dump().GetBuffer()); -// printf("*************DUMPING****************\n"); - -// printf("Dumping ResData\n"); -// pResData->Dump(); - PFormEntrys *pEntrys = pMergeDataFile->GetPFormEntrys( pResData ); - //printf("Dumping pEntrys\n"); - //if( pEntrys ) pEntrys->Dump(); - pResData->sId = sOldId; - pResData->sGId = sOldGId; - pResData->sResTyp = sOldTyp; - - if ( !pEntrys ) { - rText = sOrigText; - return FALSE; // no data found - } - - ByteString sContent; - pEntrys->GetText( sContent, nTyp, nLangIndex ); - //if ( !sContent.Len() && ( ! nLangIndex.EqualsIgnoreCaseAscii("en-US") )) { - if ( !sContent.Len() && ( ! Export::isSourceLanguage( nLangIndex ) )) { - rText = sOrigText; - return FALSE; // no data found - } - - //if ( nLangIndex.EqualsIgnoreCaseAscii("en-US") ) { - if ( Export::isSourceLanguage( nLangIndex ) ) { - return FALSE; - } - - ByteString sPostFix( rText.Copy( ++nEnd )); - rText.Erase( nStart ); - - //ConvertMergeContent( sContent, nTyp ); - ConvertMergeContent( sContent ); - - - - //printf("Merged %s\n",nLangIndex.GetBuffer()); - // merge new res. in text line - rText += sContent; - rText += sPostFix; - - return TRUE; -} - -/*****************************************************************************/ -void Export::MergeRest( ResData *pResData, USHORT nMode ) -/*****************************************************************************/ -{ - //if ( bUnmerge ) { return;} - - //pResData->Dump(); - - if ( !pMergeDataFile ){ - pMergeDataFile = new MergeDataFile( sMergeSrc, sFile ,bErrorLog, aCharSet);//, bUTF8 ); - - // Init Languages - ByteString sTmp = Export::sLanguages; - if( sTmp.ToUpperAscii().Equals("ALL") ) - SetLanguages( pMergeDataFile->GetLanguages() ); - else if( !isInitialized )InitLanguages(); - - } - switch ( nMode ) { - case MERGE_MODE_NORMAL : { - PFormEntrys *pEntry = pMergeDataFile->GetPFormEntrys( pResData ); - - bool bWriteNoSlash = false; - if ( pEntry && pResData->bText ) { - - BOOL bAddSemikolon = FALSE; - BOOL bFirst = TRUE; - ByteString sCur; - ByteString sTmp = Export::sLanguages; - - for( unsigned int n = 0; n < aLanguages.size(); n++ ){ - sCur = aLanguages[ n ]; - - ByteString sText; - BOOL bText = pEntry->GetText( sText, STRING_TYP_TEXT, sCur , TRUE ); - if ( bText && sText.Len() && sText != "-" ) { - ByteString sOutput; - if ( bNextMustBeDefineEOL) { - if ( bFirst ) - sOutput += "\t\\\n"; - else - sOutput += ";\t\\\n"; - } - bFirst=FALSE; - sOutput += "\t"; - sOutput += pResData->sTextTyp; - //if ( !sCur.EqualsIgnoreCaseAscii("en-US")) { - if ( ! Export::isSourceLanguage( sCur ) ) { - sOutput += "[ "; - sOutput += sCur; - sOutput += " ] "; - } - sOutput += "= "; - ConvertMergeContent( sText ); - sOutput += sText; - - if ( bDefine && bWriteNoSlash ) - sOutput += ";\n"; - - if ( bDefine ) - sOutput += ";\\\n"; - else if ( !bNextMustBeDefineEOL ) - sOutput += ";\n"; - else - bAddSemikolon = TRUE; - for ( USHORT j = 1; j < nLevel; j++ ) - sOutput += "\t"; - WriteToMerged( sOutput , true ); - } - } - - - if ( bAddSemikolon ) { - ByteString sOutput( ";" ); - WriteToMerged( sOutput , false ); - } - } - - if ( pEntry && pResData->bQuickHelpText ) { - BOOL bAddSemikolon = FALSE; - BOOL bFirst = TRUE; - ByteString sCur; - - for( unsigned int n = 0; n < aLanguages.size(); n++ ){ - sCur = aLanguages[ n ]; - - ByteString sText; - BOOL bText = pEntry->GetText( sText, STRING_TYP_QUICKHELPTEXT, sCur, TRUE ); - if ( bText && sText.Len() && sText != "-" ) { - ByteString sOutput; - if ( bNextMustBeDefineEOL) { - if ( bFirst ) - sOutput += "\t\\\n"; - else - sOutput += ";\t\\\n"; - } - bFirst=FALSE; - sOutput += "\t"; - sOutput += "QuickHelpText"; - //if ( !sCur.EqualsIgnoreCaseAscii("en-US") ) { - if ( ! Export::isSourceLanguage( sCur ) ) { - sOutput += "[ "; - sOutput += sCur; - sOutput += " ] "; - } - sOutput += "= "; - ConvertMergeContent( sText ); - sOutput += sText; - if ( bDefine ) - sOutput += ";\\\n"; - else if ( !bNextMustBeDefineEOL ) - sOutput += ";\n"; - else - bAddSemikolon = TRUE; - for ( USHORT j = 1; j < nLevel; j++ ) - sOutput += "\t"; - WriteToMerged( sOutput ,true ); - } - } - if ( bAddSemikolon ) { - ByteString sOutput( ";" ); - WriteToMerged( sOutput , false ); - } - } - - if ( pEntry && pResData->bTitle ) { - BOOL bAddSemikolon = FALSE; - BOOL bFirst = TRUE; - ByteString sCur; - - for( unsigned int n = 0; n < aLanguages.size(); n++ ){ - sCur = aLanguages[ n ]; - - ByteString sText; - BOOL bText = pEntry->GetText( sText, STRING_TYP_TITLE, sCur, TRUE ); - if ( bText && sText.Len() && sText != "-" ) { - ByteString sOutput; - if ( bNextMustBeDefineEOL) { - if ( bFirst ) - sOutput += "\t\\\n"; - else - sOutput += ";\t\\\n"; - } - bFirst=FALSE; - sOutput += "\t"; - sOutput += "Title"; - //if ( !sCur.EqualsIgnoreCaseAscii("en-US") ) { - if ( ! Export::isSourceLanguage( sCur ) ) { - sOutput += "[ "; - sOutput += sCur; - sOutput += " ] "; - } - sOutput += "= "; - ConvertMergeContent( sText ); - sOutput += sText; - if ( bDefine ) - sOutput += ";\\\n"; - else if ( !bNextMustBeDefineEOL ) - sOutput += ";\n"; - else - bAddSemikolon = TRUE; - for ( USHORT j = 1; j < nLevel; j++ ) - sOutput += "\t"; - WriteToMerged( sOutput ,true ); - } - } - if ( bAddSemikolon ) { - ByteString sOutput( ";" ); - WriteToMerged( sOutput ,false); - } - } - // Merge Lists - - if ( pResData->bList ) { - //printf("Dumping ResData\n"); - //pResData->Dump(); - - bool bPairedList = false; - ByteString sOldId = pResData->sId; - ByteString sOldGId = pResData->sGId; - ByteString sOldTyp = pResData->sResTyp; - if ( pResData->sGId.Len()) - pResData->sGId += "."; - pResData->sGId += sOldId; - ByteString sSpace; - for ( USHORT i = 1; i < nLevel-1; i++ ) - sSpace += "\t"; - for ( USHORT nT = LIST_STRING; nT <= LIST_UIENTRIES; nT++ ) { - ExportList *pList = NULL; - switch ( nT ) { - case LIST_STRING : pResData->sResTyp = "stringlist"; pList = pResData->pStringList; bPairedList = false; break; - case LIST_FILTER : pResData->sResTyp = "filterlist"; pList = pResData->pFilterList; bPairedList = false; break; - case LIST_UIENTRIES : pResData->sResTyp = "uientries"; pList = pResData->pUIEntries;bPairedList = false; break; - case LIST_ITEM : pResData->sResTyp = "itemlist"; pList = pResData->pItemList; bPairedList = false; break; - case LIST_PAIRED : pResData->sResTyp = "pairedlist"; pList = pResData->pPairedList; bPairedList = true; break; - } - ByteString sCur; - for( unsigned int n = 0; n < aLanguages.size(); n++ ){ - sCur = aLanguages[ n ]; - USHORT nIdx = 1; - - // Set matching pairedlist identifier - if( bPairedList && pResData->pPairedList && ( nIdx == 1 ) ){ - ExportListEntry* pListE = ( ExportListEntry* ) pResData->pPairedList->GetObject( nIdx-1 ); - pResData->sId = GetPairedListID ( (*pListE)[ SOURCE_LANGUAGE ] ); - } - else - pResData->sId = ByteString("1"); - - PFormEntrys *pEntrys; - ULONG nLIndex = 0; - ULONG nMaxIndex = 0; - if ( pList ) - nMaxIndex = pList->GetSourceLanguageListEntryCount(); - pEntrys = pMergeDataFile->GetPFormEntrys( pResData ); - while( pEntrys && ( nLIndex < nMaxIndex )) { - //printf("Lang %s, List Index %d\n",sCur.GetBuffer(),(int)nLIndex); - ByteString sText; - BOOL bText; - bText = pEntrys->GetText( sText, STRING_TYP_TEXT, sCur, TRUE ); - if( !bText ) - bText = pEntrys->GetText( sText , STRING_TYP_TEXT, SOURCE_LANGUAGE , FALSE ); - - // Use fallback, if data is missing in sdf file - //if( !bText && pResData->sResTyp.Equals( "pairedlist" ) ){ - if( !bText && bPairedList ){ - if( pResData->isMerged( sCur ) ) break; - const ByteString sPlist("pairedlist"); - ByteString sKey = MergeDataFile::CreateKey( sPlist , pResData->sGId , pResData->sId , sFilename ); - bText = pResData->getFallbackData( sKey , sText ); - }else if ( !bText ){// new fallback - if( pResData->isMerged( sCur ) ) break; - const ByteString sPlist("list"); - ByteString sKey = MergeDataFile::CreateKey( sPlist , pResData->sGId , pResData->sId , sFilename ); - bText = pResData->getFallbackData( sKey , sText ); - } // new fallback - - if ( bText && sText.Len()) { - //if( pEntrys ) pEntrys->Dump(); - if ( nIdx == 1 ) { - ByteString sHead; - if ( bNextMustBeDefineEOL ) - sHead = "\\\n\t"; - sHead += sSpace; - switch ( nT ) { - case LIST_STRING : sHead += "StringList "; break; - case LIST_FILTER : sHead += "FilterList "; break; - case LIST_ITEM : sHead += "ItemList "; break; - case LIST_PAIRED : sHead += "PairedList "; break; - case LIST_UIENTRIES : sHead += "UIEntries "; break; - } - sHead += "[ "; - sHead += sCur; - sHead += " ] "; - //} - if ( bDefine || bNextMustBeDefineEOL ) { - sHead += "= \\\n"; - sHead += sSpace; - sHead += "\t{\\\n\t"; - } - else { - sHead += "= \n"; - sHead += sSpace; - sHead += "\t{\n\t"; - } - WriteToMerged( sHead , true); - } - ByteString sLine; - if ( pList && pList->GetObject( nLIndex )) - sLine = ( *pList->GetObject( nLIndex ))[ SOURCE_LANGUAGE ]; - if ( !sLine.Len()) - sLine = sLastListLine; - - if ( sLastListLine.Search( "<" ) != STRING_NOTFOUND ) { - if (( nT != LIST_UIENTRIES ) && - (( sLine.Search( "{" ) == STRING_NOTFOUND ) || - ( sLine.Search( "{" ) >= sLine.Search( "\"" ))) && - (( sLine.Search( "<" ) == STRING_NOTFOUND ) || - ( sLine.Search( "<" ) >= sLine.Search( "\"" )))) - { - sLine.SearchAndReplace( "\"", "< \"" ); - } - } - - USHORT nStart, nEnd; - nStart = sLine.Search( "\"" ); - - ByteString sPostFix; - if( !bPairedList ){ - nEnd = sLine.SearchBackward( '\"' ); - sPostFix = ByteString( sLine.Copy( ++nEnd )); - sLine.Erase( nStart ); - } - - - ConvertMergeContent( sText ); - - // merge new res. in text line - if( bPairedList ){ - sLine = MergePairedList( sLine , sText ); - } - else{ - sLine += sText; - sLine += sPostFix; - } - - ByteString sText1( "\t" ); - sText1 += sLine; - if ( bDefine || bNextMustBeDefineEOL ) - sText1 += " ;\\\n"; - else - sText1 += " ;\n"; - sText1 += sSpace; - sText1 += "\t"; - //printf("Writing '%s'\n",sText1.GetBuffer()); - WriteToMerged( sText1 ,true ); - - // Set matching pairedlist identifier - if ( bPairedList ){ - nIdx++; - ExportListEntry* pListE = ( ExportListEntry* ) pResData->pPairedList->GetObject( ( nIdx ) -1 ); - if( pListE ){ - pResData->sId = GetPairedListID ( (*pListE)[ SOURCE_LANGUAGE ] ); - } - } - else - pResData->sId = ByteString::CreateFromInt32( ++nIdx ); - } - else - break; - nLIndex ++; - PFormEntrys *oldEntry = pEntrys; - pEntrys = pMergeDataFile->GetPFormEntrys( pResData ); // <--- game over - if( !pEntrys ) - pEntrys = oldEntry; - } - if ( nIdx > 1 ) { - ByteString sFooter( sSpace.Copy( 1 )); - if ( bNextMustBeDefineEOL ) - sFooter += "};"; - else if ( !bDefine ) - sFooter += "};\n\t"; - else - sFooter += "\n\n"; - WriteToMerged( sFooter ,true ); - } - } - } - - pResData->sId = sOldId; - pResData->sGId = sOldGId; - pResData->sResTyp = sOldTyp; - } - } - break; - case MERGE_MODE_LIST : { - ExportList *pList = NULL; - switch ( nList ) { - // PairedList - case LIST_STRING : pList = pResData->pStringList; break; - case LIST_FILTER : pList = pResData->pFilterList; break; - case LIST_UIENTRIES : pList = pResData->pUIEntries; break; - case LIST_ITEM : pList = pResData->pItemList; break; - case LIST_PAIRED : pList = pResData->pPairedList; break; - - } - - nListIndex++; - ULONG nMaxIndex = 0; - if ( pList ) - nMaxIndex = pList->GetSourceLanguageListEntryCount(); - ByteString sLine; - if ( pList && pList->GetObject( nListIndex )) - sLine = ( *pList->GetObject( nListIndex ))[ SOURCE_LANGUAGE ]; - if ( !sLine.Len()) - sLine = sLastListLine; - - if ( sLastListLine.Search( "<" ) != STRING_NOTFOUND ) { - if (( nList != LIST_UIENTRIES ) && - (( sLine.Search( "{" ) == STRING_NOTFOUND ) || - ( sLine.Search( "{" ) >= sLine.Search( "\"" ))) && - (( sLine.Search( "<" ) == STRING_NOTFOUND ) || - ( sLine.Search( "<" ) >= sLine.Search( "\"" )))) - { - sLine.SearchAndReplace( "\"", "< \"" ); - } - } - - while( PrepareTextToMerge( sLine, nList, nListLang, pResData ) && ( nListIndex <= nMaxIndex )) { - ByteString sText( "\t" ); - sText += sLine; - sText += " ;"; - sText += "\n"; - for ( USHORT i = 0; i < nLevel; i++ ) - sText += "\t"; - WriteToMerged( sText ,false ); - nListIndex++; - if ( pList && pList->GetObject( nListIndex )) - sLine = ( *pList->GetObject( nListIndex ))[ SOURCE_LANGUAGE ]; - if ( !sLine.Len()) - sLine = sLastListLine; - sLine += " ;"; - } - } - break; - } - pParseQueue->bMflag = false; -} - -ByteString Export::MergePairedList( ByteString& sLine , ByteString& sText ){ -// < "xy" ; IDENTIFIER ; > - ByteString sPre = sLine.Copy( 0 , sLine.Search('\"') ); - ByteString sPost = sLine.Copy( sLine.SearchBackward('\"') + 1 , sLine.Len() ); - sPre.Append( sText ); - sPre.Append( sPost ); - return sPre; -} - -/*****************************************************************************/ -void Export::SetChildWithText() -/*****************************************************************************/ -{ - if ( aResStack.Count() > 1 ) { - for ( ULONG i = 0; i < aResStack.Count() - 1; i++ ) { - aResStack.GetObject( i )->bChildWithText = TRUE; - } - } -} - -void ParserQueue::Push( const QueueEntry& aEntry ){ -// printf("nTyp = %d ",aEntry.nTyp); - USHORT nLen = aEntry.sLine.Len(); - - if( !bStart ){ - aQueueCur->push( aEntry ); - if( nLen > 1 && aEntry.sLine.GetChar( nLen-1 ) == '\n' ) - bStart = true; - else if ( aEntry.nTyp != IGNOREDTOKENS ){ - if( nLen > 1 && ( aEntry.sLine.GetChar( nLen-1 ) == '\\') ){ - // Next is Macro - bCurrentIsM = true; - }else{ - // Next is no Macro - bCurrentIsM = false; - } - } - } - else{ - aQueueNext->push( aEntry ); - if( nLen > 1 && aEntry.sLine.GetChar( nLen-1 ) != '\n' ){ - if( nLen > 1 && ( aEntry.sLine.GetChar( nLen-1 ) == '\\') ){ - // Next is Macro - bNextIsM = true; - } - else{ - // Next is no Macro - bNextIsM = false; - } - }else if( nLen > 2 && aEntry.sLine.GetChar( nLen-1 ) == '\n' ){ - if( aEntry.nTyp != IGNOREDTOKENS ){ - if( nLen > 2 && ( aEntry.sLine.GetChar( nLen-2 ) == '\\') ){ - // Next is Macro - bNextIsM = true; - } - else{ - // Next is no Macro - bNextIsM = false; - } - } - // Pop current - Pop( *aQueueCur ); - bLastWasM = bCurrentIsM; - // next -> current - bCurrentIsM = bNextIsM; - aQref = aQueueCur; - aQueueCur = aQueueNext; - aQueueNext = aQref; - - } - - else{ - // Pop current - Pop( *aQueueCur ); - bLastWasM = bCurrentIsM; - // next -> current - bCurrentIsM = bNextIsM; - aQref = aQueueCur; - aQueueCur = aQueueNext; - aQueueNext = aQref; - } - } -} - -void ParserQueue::Close(){ - // Pop current - Pop( *aQueueCur ); - // next -> current - bLastWasM = bCurrentIsM; - bCurrentIsM = bNextIsM; - aQref = aQueueCur; - aQueueCur = aQueueNext; - aQueueNext = aQref; - bNextIsM = false; - Pop( *aQueueNext ); -}; -void ParserQueue::Pop( std::queue& aQueue ){ - while( !aQueue.empty() ){ - QueueEntry aEntry = aQueue.front(); - aQueue.pop(); - aExport.Execute( aEntry.nTyp , (char*) aEntry.sLine.GetBuffer() ); - } -} -ParserQueue::ParserQueue( Export& aExportObj ) - : - bCurrentIsM( false ), - bNextIsM( false ) , - bLastWasM( false ), - bMflag( false ) , - aExport( aExportObj ) , - bStart( false ) , - bStartNext( false ) -{ - aQueueNext = new std::queue; - aQueueCur = new std::queue; -} - - -ParserQueue::~ParserQueue(){ - if( aQueueNext ) delete aQueueNext; - if( aQueueCur ) delete aQueueCur; -} diff --git a/transex3/source/export2.cxx b/transex3/source/export2.cxx deleted file mode 100644 index 7815e80e033f..000000000000 --- a/transex3/source/export2.cxx +++ /dev/null @@ -1,741 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: export2.cxx,v $ - * $Revision: 1.43 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_transex3.hxx" -#include "export.hxx" -#include "utf8conv.hxx" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std; -// -// class ResData(); -// - -/*****************************************************************************/ -ResData::~ResData() -/*****************************************************************************/ -{ - if ( pStringList ) { - // delete existing res. of type StringList - for ( ULONG i = 0; i < pStringList->Count(); i++ ) { - ExportListEntry* test = pStringList->GetObject( i ); - if( test != NULL ) delete test; - } - delete pStringList; - } - if ( pFilterList ) { - // delete existing res. of type FilterList - for ( ULONG i = 0; i < pFilterList->Count(); i++ ) { - ExportListEntry* test = pFilterList->GetObject( i ); - delete test; - } - delete pFilterList; - } - if ( pItemList ) { - // delete existing res. of type ItemList - for ( ULONG i = 0; i < pItemList->Count(); i++ ) { - ExportListEntry* test = pItemList->GetObject( i ); - delete test; - } - delete pItemList; - } - if ( pUIEntries ) { - // delete existing res. of type UIEntries - for ( ULONG i = 0; i < pUIEntries->Count(); i++ ) { - ExportListEntry* test = pUIEntries->GetObject( i ); - delete test; - } - delete pUIEntries; - } -} - -// -// class Export -// - -/*****************************************************************************/ -ByteString Export::sLanguages; -ByteString Export::sForcedLanguages; -//ByteString Export::sIsoCode99; -/*****************************************************************************/ - -void Export::DumpExportList( ByteString& sListName , ExportList& aList ){ - printf( "%s\n", sListName.GetBuffer() ); - ByteString l(""); - ExportListEntry* aEntry; - for( unsigned int x = 0; x < aList.Count() ; x++ ){ - aEntry = (ExportListEntry*) aList.GetObject( x ); - Export::DumpMap( l , *aEntry ); - } - printf("\n"); -} -ByteString Export::DumpMap( ByteString& sMapName , ByteStringHashMap& aMap ){ - ByteStringHashMap::const_iterator idbg; - ByteString sReturn; - - if( sMapName.Len() ) - printf("MapName %s\n", sMapName.GetBuffer()); - if( aMap.size() < 1 ) return ByteString(); - for( idbg = aMap.begin() ; idbg != aMap.end(); ++idbg ){ - ByteString a( idbg->first ); - ByteString b( idbg->second ); - printf("[%s]= %s",a.GetBuffer(),b.GetBuffer()); - printf("\n"); - } - printf("\n"); - return sReturn; -} -/*****************************************************************************/ -void Export::SetLanguages( std::vector val ){ -/*****************************************************************************/ - aLanguages = val; - isInitialized = true; -} -/*****************************************************************************/ -std::vector Export::GetLanguages(){ -/*****************************************************************************/ - return aLanguages; -} -/*****************************************************************************/ -std::vector Export::GetForcedLanguages(){ -/*****************************************************************************/ - return aForcedLanguages; -} -std::vector Export::aLanguages = std::vector(); -std::vector Export::aForcedLanguages = std::vector(); - - -/*****************************************************************************/ -void Export::QuotHTMLXRM( ByteString &rString ) -/*****************************************************************************/ -{ - ByteString sReturn; - //BOOL bBreak = FALSE; - for ( USHORT i = 0; i < rString.Len(); i++ ) { - ByteString sTemp = rString.Copy( i ); - if ( sTemp.Search( ""; - i++; - } - } - - if ( i < rString.Len()) { - switch ( rString.GetChar( i )) { - case '<': - if( i+2 < rString.Len() && - (rString.GetChar( i+1 ) == 'b' || rString.GetChar( i+1 ) == 'B') && - rString.GetChar( i+2 ) == '>' ) - { - sReturn +=""; - i += 2; - } - else if( i+3 < rString.Len() && - rString.GetChar( i+1 ) == '/' && - (rString.GetChar( i+2 ) == 'b' || rString.GetChar( i+2 ) == 'B') && - rString.GetChar( i+3 ) == '>' ) - { - sReturn +=""; - i += 3; - } - else - sReturn += "<"; - break; - - case '>': - sReturn += ">"; - break; - - case '\"': - sReturn += """; - break; - - case '\'': - sReturn += "'"; - break; - - case '&': - if ((( i + 4 ) < rString.Len()) && - ( rString.Copy( i, 5 ) == "&" )) - sReturn += rString.GetChar( i ); - else - sReturn += "&"; - break; - - default: - sReturn += rString.GetChar( i ); - break; - } - } - } - rString = sReturn; -} -/*****************************************************************************/ -void Export::QuotHTML( ByteString &rString ) -/*****************************************************************************/ -{ - ByteString sReturn; - for ( USHORT i = 0; i < rString.Len(); i++ ) { - ByteString sTemp = rString.Copy( i ); - if ( sTemp.Search( ""; - i++; - } - } - if ( i < rString.Len()) { - switch ( rString.GetChar( i )) { - case '<': - sReturn += "<"; - break; - - case '>': - sReturn += ">"; - break; - - case '\"': - sReturn += """; - break; - - case '\'': - sReturn += "'"; - break; - - case '&': - if ((( i + 4 ) < rString.Len()) && - ( rString.Copy( i, 5 ) == "&" )) - sReturn += rString.GetChar( i ); - else - sReturn += "&"; - break; - - default: - sReturn += rString.GetChar( i ); - break; - } - } - } - rString = sReturn; -} - -void Export::RemoveUTF8ByteOrderMarker( ByteString &rString ){ - if( hasUTF8ByteOrderMarker( rString ) ) - rString.Erase( 0 , 3 ); -} - -bool Export::hasUTF8ByteOrderMarker( const ByteString &rString ){ - // Byte order marker signature - - const unsigned char c1 = 0xEF; - const unsigned char c2 = 0xBB; - const unsigned char c3 = 0xBF; - - const char bom[ 3 ] = { c1 , c2 , c3 }; - - return rString.Len() >= 3 && - rString.GetChar( 0 ) == bom[ 0 ] && - rString.GetChar( 1 ) == bom[ 1 ] && - rString.GetChar( 2 ) == bom[ 2 ] ; -} -bool Export::fileHasUTF8ByteOrderMarker( const ByteString &rString ){ - SvFileStream aFileIn( String( rString , RTL_TEXTENCODING_ASCII_US ) , STREAM_READ ); - ByteString sLine; - if( !aFileIn.IsEof() ) { - aFileIn.ReadLine( sLine ); - if( aFileIn.IsOpen() ) aFileIn.Close(); - return hasUTF8ByteOrderMarker( sLine ); - } - if( aFileIn.IsOpen() ) aFileIn.Close(); - return false; -} -void Export::RemoveUTF8ByteOrderMarkerFromFile( const ByteString &rFilename ){ - SvFileStream aFileIn( String( rFilename , RTL_TEXTENCODING_ASCII_US ) , STREAM_READ ); - ByteString sLine; - if( !aFileIn.IsEof() ) { - aFileIn.ReadLine( sLine ); - // Test header - if( hasUTF8ByteOrderMarker( sLine ) ){ - //cout << "UTF8 Header found!\n"; - DirEntry aTempFile = Export::GetTempFile(); - ByteString sTempFile = ByteString( aTempFile.GetFull() , RTL_TEXTENCODING_ASCII_US ); - SvFileStream aNewFile( String( sTempFile , RTL_TEXTENCODING_ASCII_US ) , STREAM_WRITE ); - // Remove header - RemoveUTF8ByteOrderMarker( sLine ); - //cout << "Copy stripped stuff to " << sTempFile.GetBuffer() << endl; - aNewFile.WriteLine( sLine ); - // Copy the rest - while( !aFileIn.IsEof() ){ - aFileIn.ReadLine( sLine ); - aNewFile.WriteLine( sLine ); - } - if( aFileIn.IsOpen() ) aFileIn.Close(); - if( aNewFile.IsOpen() ) aNewFile.Close(); - DirEntry aEntry( rFilename.GetBuffer() ); - //cout << "Removing file " << rFilename.GetBuffer() << "\n"; - aEntry.Kill(); - //cout << "Renaming file " << sTempFile.GetBuffer() << " to " << rFilename.GetBuffer() << "\n"; - DirEntry( sTempFile ).MoveTo( DirEntry( rFilename.GetBuffer() ) ); - } - } - if( aFileIn.IsOpen() ) aFileIn.Close(); -} - -// Merge it into source code! -//bool Export::isMergingGermanAllowed( const ByteString& rPrj ){ -// (void) rPrj; -// return true; -/* static ByteStringBoolHashMap aHash; - - if( aHash.find( rPrj ) != aHash.end() ){ - return aHash[ rPrj ]; - } - - ByteString sFile = Export::GetEnv( "SRC_ROOT" ) ; - sFile.Append("/"); - sFile.Append( rPrj ); - sFile.Append("/prj/l10n"); -#if defined(WNT) || defined(OS2) - sFile.SearchAndReplaceAll('/','\\'); -#endif - DirEntry aFlagfile( sFile ); - - aHash[ rPrj ] = !aFlagfile.Exists(); - return aHash[ rPrj ];*/ -//} -bool Export::CopyFile( const ByteString& source , const ByteString& dest ) -{ -// cout << "CopyFile( " << source.GetBuffer() << " , " << dest.GetBuffer() << " )\n"; - const int BUFFERSIZE = 8192; - char buf[ BUFFERSIZE ]; - - FILE* IN_FILE = fopen( source.GetBuffer() , "r" ); - FILE* OUT_FILE = fopen( dest.GetBuffer() , "w" ); - - if( IN_FILE == NULL ) - { - cerr << "Export::CopyFile WARNING: Could not open " << source.GetBuffer() << "\n"; - return false; - } - if( OUT_FILE == NULL ) - { - cerr << "Export::CopyFile WARNING: Could not open/create " << dest.GetBuffer() << " for writing\n"; - return false; - } - - while( fgets( buf , BUFFERSIZE , IN_FILE ) != NULL ) - { - if( fputs( buf , OUT_FILE ) == EOF ) - { - cerr << "Export::CopyFile WARNING: Write problems " << source.GetBuffer() << "\n"; - fclose( IN_FILE ); - fclose( OUT_FILE ); - return false; - } - } - if( ferror( IN_FILE ) ) - { - cerr << "Export::CopyFile WARNING: Read problems " << dest.GetBuffer() << "\n"; - fclose( IN_FILE ); - fclose( OUT_FILE ); - return false; - } - fclose ( IN_FILE ); - fclose ( OUT_FILE ); - - return true; -} - -/*****************************************************************************/ -void Export::UnquotHTML( ByteString &rString ) -/*****************************************************************************/ -{ - ByteString sReturn; - while ( rString.Len()) { - if ( rString.Copy( 0, 5 ) == "&" ) { - sReturn += "&"; - rString.Erase( 0, 5 ); - } - else if ( rString.Copy( 0, 4 ) == "<" ) { - sReturn += "<"; - rString.Erase( 0, 4 ); - } - else if ( rString.Copy( 0, 4 ) == ">" ) { - sReturn += ">"; - rString.Erase( 0, 4 ); - } - else if ( rString.Copy( 0, 6 ) == """ ) { - sReturn += "\""; - rString.Erase( 0, 6 ); - } - else if ( rString.Copy( 0, 6 ) == "'" ) { - sReturn += "\'"; - rString.Erase( 0, 6 ); - } - else { - sReturn += rString.GetChar( 0 ); - rString.Erase( 0, 1 ); - } - } - rString = sReturn; -} -bool Export::isSourceLanguage( const ByteString &sLanguage ) -{ - return !isAllowed( sLanguage ); -} -bool Export::isAllowed( const ByteString &sLanguage ){ - return ! ( sLanguage.EqualsIgnoreCaseAscii("en-US") ); -} -/*****************************************************************************/ -bool Export::LanguageAllowed( const ByteString &nLanguage ) -/*****************************************************************************/ -{ - return std::find( aLanguages.begin() , aLanguages.end() , nLanguage ) != aLanguages.end(); -} - -bool Export::isInitialized = false; - -/*****************************************************************************/ -void Export::InitLanguages( bool bMergeMode ){ -/*****************************************************************************/ - if( !isInitialized ){ - ByteString sTmp; - ByteStringBoolHashMap aEnvLangs; - for ( USHORT x = 0; x < sLanguages.GetTokenCount( ',' ); x++ ){ - sTmp = sLanguages.GetToken( x, ',' ).GetToken( 0, '=' ); - sTmp.EraseLeadingAndTrailingChars(); - if( bMergeMode && !isAllowed( sTmp ) ){} - else if( !( (sTmp.GetChar(0)=='x' || sTmp.GetChar(0)=='X') && sTmp.GetChar(1)=='-' ) ){ - aLanguages.push_back( sTmp ); - } - } - InitForcedLanguages( bMergeMode ); - isInitialized = true; - } -} -/*****************************************************************************/ -void Export::InitForcedLanguages( bool bMergeMode ){ -/*****************************************************************************/ - ByteString sTmp; - ByteStringBoolHashMap aEnvLangs; - for ( USHORT x = 0; x < sForcedLanguages.GetTokenCount( ',' ); x++ ){ - sTmp = sForcedLanguages.GetToken( x, ',' ).GetToken( 0, '=' ); - sTmp.EraseLeadingAndTrailingChars(); - if( bMergeMode && isAllowed( sTmp ) ){} - else if( !( (sTmp.GetChar(0)=='x' || sTmp.GetChar(0)=='X') && sTmp.GetChar(1)=='-' ) ) - aForcedLanguages.push_back( sTmp ); - } -} - -/*****************************************************************************/ -ByteString Export::GetFallbackLanguage( const ByteString nLanguage ) -/*****************************************************************************/ -{ - ByteString sFallback=nLanguage; - GetIsoFallback( sFallback ); - return sFallback; -} - -void Export::replaceEncoding( ByteString& rString ) -{ -// ™ -> \u2122 - - for( xub_StrLen idx = 0; idx <= rString.Len()-8 ; idx++ ) - { - if( rString.GetChar( idx ) == '&' && - rString.GetChar( idx+1 ) == '#' && - rString.GetChar( idx+2 ) == 'x' && - rString.GetChar( idx+7 ) == ';' ) - { - ByteString sTmp = rString.Copy( 0 , idx ); - sTmp.Append( "\\u" ); - sTmp.Append( rString.GetChar( idx+3 ) ); - sTmp.Append( rString.GetChar( idx+4 ) ); - sTmp.Append( rString.GetChar( idx+5 ) ); - sTmp.Append( rString.GetChar( idx+6 ) ); - sTmp.Append( rString.Copy( idx+8 , rString.Len() ) ); - rString = sTmp; - } - } -} - -/*****************************************************************************/ -void Export::FillInFallbacks( ResData *pResData ) -/*****************************************************************************/ -{ - ByteString sCur; - for( unsigned int n = 0; n < aLanguages.size(); n++ ){ - sCur = aLanguages[ n ]; - if( isAllowed( sCur ) ){ - ByteString nFallbackIndex = GetFallbackLanguage( sCur ); - if( nFallbackIndex.Len() ){ - if ( !pResData->sText[ sCur ].Len()) - pResData->sText[ sCur ] = - pResData->sText[ nFallbackIndex ]; - - if ( !pResData->sHelpText[ sCur ].Len()) - pResData->sHelpText[ sCur ] = - pResData->sHelpText[ nFallbackIndex ]; - - if ( !pResData->sQuickHelpText[ sCur ].Len()) - pResData->sQuickHelpText[ sCur ] = - pResData->sQuickHelpText[ nFallbackIndex ]; - - if ( !pResData->sTitle[ sCur ].Len()) - pResData->sTitle[ sCur ] = - pResData->sTitle[ nFallbackIndex ]; - - if ( pResData->pStringList ) - FillInListFallbacks( - pResData->pStringList, sCur, nFallbackIndex ); - - if ( pResData->pPairedList ) - FillInListFallbacks( - pResData->pPairedList, sCur, nFallbackIndex ); - - if ( pResData->pFilterList ) - FillInListFallbacks( - pResData->pFilterList, sCur, nFallbackIndex ); - - if ( pResData->pItemList ) - FillInListFallbacks( - pResData->pItemList, sCur, nFallbackIndex ); - - if ( pResData->pUIEntries ) - FillInListFallbacks( - pResData->pUIEntries, sCur, nFallbackIndex ); - } - } - } -} - -/*****************************************************************************/ -void Export::FillInListFallbacks( - ExportList *pList, const ByteString &nSource, const ByteString &nFallback ) -/*****************************************************************************/ -{ - - for ( ULONG i = 0; i < pList->Count(); i++ ) { - ExportListEntry *pEntry = pList->GetObject( i ); - if ( !( *pEntry )[ nSource ].Len()){ - ( *pEntry )[ nSource ] = ( *pEntry )[ nFallback ]; - ByteString x = ( *pEntry )[ nSource ]; - ByteString y = ( *pEntry )[ nFallback ]; - } - } -} - -/*****************************************************************************/ -ByteString Export::GetTimeStamp() -/*****************************************************************************/ -{ -// return "xx.xx.xx"; - char buf[20]; - Time aTime; - - snprintf(buf, sizeof(buf), "%8d %02d:%02d:%02d", int(Date().GetDate()), - int(aTime.GetHour()), int(aTime.GetMin()), int(aTime.GetSec())); - return ByteString(buf); -} - -/*****************************************************************************/ -BOOL Export::ConvertLineEnds( - ByteString sSource, ByteString sDestination ) -/*****************************************************************************/ -{ - String sSourceFile( sSource, RTL_TEXTENCODING_ASCII_US ); - String sDestinationFile( sDestination, RTL_TEXTENCODING_ASCII_US ); - - SvFileStream aSource( sSourceFile, STREAM_READ ); - if ( !aSource.IsOpen()) - return FALSE; - SvFileStream aDestination( sDestinationFile, STREAM_STD_WRITE | STREAM_TRUNC ); - if ( !aDestination.IsOpen()) { - aSource.Close(); - return FALSE; - } - - ByteString sLine; - - while ( !aSource.IsEof()) { - aSource.ReadLine( sLine ); - if ( !aSource.IsEof()) { - sLine.EraseAllChars( '\r' ); - aDestination.WriteLine( sLine ); - } - else - aDestination.WriteByteString( sLine ); - } - - aSource.Close(); - aDestination.Close(); - - return TRUE; -} - -/*****************************************************************************/ -ByteString Export::GetNativeFile( ByteString sSource ) -/*****************************************************************************/ -{ - DirEntry aTemp( GetTempFile()); - ByteString sReturn( aTemp.GetFull(), RTL_TEXTENCODING_ASCII_US ); - - for ( USHORT i = 0; i < 10; i++ ) - if ( ConvertLineEnds( sSource, sReturn )) - return sReturn; - - return ""; -} - -const char* Export::GetEnv( const char *pVar ) -{ - char *pRet = getenv( pVar ); - if ( !pRet ) - pRet = 0; - return pRet; -} - - -int Export::getCurrentDirectory( rtl::OUString& base_fqurl_out, rtl::OUString& base_out ) -{ - DirEntry aDir("."); - aDir.ToAbs(); - base_out = rtl::OUString( aDir.GetFull() ); - return osl::File::getFileURLFromSystemPath( base_out , base_fqurl_out ); -} - -void Export::getCurrentDir( string& dir ) -{ - char buffer[64000]; - if( getcwd( buffer , sizeof( buffer ) ) == 0 ){ - cerr << "Error: getcwd failed!\n"; - exit( -1 ); - } - dir = string( buffer ); -} - - -// Stolen from sal/osl/unx/tempfile.c - -#define RAND_NAME_LENGTH 6 - -void Export::getRandomName( const ByteString& sPrefix , ByteString& sRandStr , const ByteString& sPostfix ) -{ - static const char LETTERS[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"; - static const int COUNT_OF_LETTERS = sizeof(LETTERS)/sizeof(LETTERS[0]) - 1; - sRandStr.Append( sPrefix ); - - static sal_uInt64 value; - char buffer[RAND_NAME_LENGTH]; - - TimeValue tv; - sal_uInt64 v; - int i; - - osl_getSystemTime( &tv ); - oslProcessInfo proInfo; - osl_getProcessInfo( 0 , osl_Process_IDENTIFIER , &proInfo ); - - value += ((sal_uInt64) ( tv.Nanosec / 1000 ) << 16) ^ ( tv.Nanosec / 1000 ) ^ proInfo.Ident; - - v = value; - - for (i = 0; i < RAND_NAME_LENGTH; i++) - { - buffer[i] = LETTERS[v % COUNT_OF_LETTERS]; - v /= COUNT_OF_LETTERS; - } - - sRandStr.Append( buffer , RAND_NAME_LENGTH ); - sRandStr.Append( sPostfix ); -} - -void Export::getRandomName( ByteString& sRandStr ) -{ - const ByteString sEmpty; - getRandomName( sEmpty , sRandStr , sEmpty ); -} - -/*****************************************************************************/ -DirEntry Export::GetTempFile() -/*****************************************************************************/ -{ -#if defined(WNT) || defined(OS2) - String sTempDir( Export::GetEnv( "TEMP" ), RTL_TEXTENCODING_ASCII_US ); -#else - String sTempDir( String::CreateFromAscii( "/tmp" )); -#endif - rtl::OUString* sTempFilename = new rtl::OUString(); - - // Create a temp file - int nRC = osl::FileBase::createTempFile( 0 , 0 , sTempFilename ); - if( nRC ) printf(" osl::FileBase::createTempFile RC = %d",nRC); - - String strTmp( *sTempFilename ); - - INetURLObject::DecodeMechanism eMechanism = INetURLObject::DECODE_TO_IURI; - String sDecodedStr = INetURLObject::decode( strTmp , '%' , eMechanism ); - ByteString sTmp( sDecodedStr , RTL_TEXTENCODING_UTF8 ); - -#if defined(WNT) || defined(OS2) - sTmp.SearchAndReplace("file:///",""); - sTmp.SearchAndReplaceAll('/','\\'); -#else - // Set file permission to 644 - const sal_uInt64 nPerm = osl_File_Attribute_OwnRead | osl_File_Attribute_OwnWrite | - osl_File_Attribute_GrpRead | osl_File_Attribute_OthRead ; - - nRC = osl::File::setAttributes( *sTempFilename , nPerm ); - if( nRC ) printf(" osl::File::setAttributes RC = %d",nRC); - - sTmp.SearchAndReplace("file://",""); -#endif - DirEntry aDirEntry( sTmp ); - delete sTempFilename; - return aDirEntry; -} diff --git a/transex3/source/file.cxx b/transex3/source/file.cxx deleted file mode 100644 index 4ea9ca55d574..000000000000 --- a/transex3/source/file.cxx +++ /dev/null @@ -1,58 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: file.cxx,v $ - * $Revision: 1.6 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_transex3.hxx" -#include - -namespace transex -{ - -File::File( const rtl::OUString sFile ) -{ - sFileName = sFile; -} - -File::File( const rtl::OUString sFullPath , const rtl::OUString sFile ) -{ - sFileName = sFile; - sFullName = sFullPath; -} - -bool File::lessFile ( const File& rKey1, const File& rKey2 ) -{ - rtl::OUString sName1( ( static_cast< File >( rKey1 ) ).getFileName() ); - rtl::OUString sName2( ( static_cast< File >( rKey2 ) ).getFileName() ); - - return sName1.compareTo( sName2 ) < 0 ; -} - -} diff --git a/transex3/source/filter/merge/FCFGMerge.cfg b/transex3/source/filter/merge/FCFGMerge.cfg deleted file mode 100644 index 46fcccafe7e4..000000000000 --- a/transex3/source/filter/merge/FCFGMerge.cfg +++ /dev/null @@ -1,125 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: FCFGMerge.cfg,v $ -# -# $Revision: 1.5 $ -# -# 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 -# -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -#************************************************ -# Specify the verbose mode of this tool. -# 1 = show errors only -# 2 = show errors/warnings (default) -# 3 = show errors/warnings and some generic infos -# 4 = show anything (including detailed infos) -# -# [OPTIONAL] -#************************************************ - -loglevel = 2 - -#************************************************ -# This extension is used for all XML files. It doesnt -# matter if its used for reading fragments or writing -# XML packages. -# Must be given without any additional signes like "." -# or "*."! -# -# [REQUIRED] -#************************************************ - -extension_xcu=xcu - -#************************************************ -# This extension is used for all Package files. It doesnt -# matter if its used for reading such files or writing -# it. -# Must be given without any additional signes like "." -# or "*."! -# -# [REQUIRED] -#************************************************ - -extension_pkg=pkg - -#************************************************ -# These values are used to generate a correct XML -# header. -# Note: The property "xmlpackage" must be specified -# via command line. There exists more then one -# possible value. -# -# [REQUIRED] -#************************************************ - -xmlversion = 1.0 -xmlencoding = UTF-8 -xmlpath = org.openoffice.TypeDetection -#xmlpackage = - -#************************************************ -# These values are used to name the configuration -# sets inside the generated XCM file for different -# item groups like e.g. types, filters etcpp. -# -# [REQUIRED] -#************************************************ - -setname_types = Types -setname_filters = Filters -setname_frameloaders = FrameLoaders -setname_contenthandlers = ContentHandlers - -subdir_types = types -subdir_filters = filters -subdir_frameloaders = frameloaders -subdir_contenthandlers = contenthandlers - -#************************************************ -# This delimiter is used to split every -# item list of the package configuration files -# (which are temp. created by the make proccess) -# into its tokens. -# -# [REQUIRED] -#************************************************ -delimiter=, - -#************************************************ -# Enable/disable removing of leading/trailing withespaces -# during splitting stringlists. -# -# [REQUIRED] -#************************************************ -trim=true - -#************************************************ -# Enable/disable removing of leading/trailing "-signs -# during splitting stringlists. -# -# [REQUIRED] -#************************************************ -decode=false diff --git a/transex3/source/filter/merge/FCFGMerge.java b/transex3/source/filter/merge/FCFGMerge.java deleted file mode 100644 index 7fbfa8a0c986..000000000000 --- a/transex3/source/filter/merge/FCFGMerge.java +++ /dev/null @@ -1,131 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: FCFGMerge.java,v $ - * $Revision: 1.5 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -package com.sun.star.filter.config.tools.merge; - -//_______________________________________________ - -import java.lang.*; -import java.util.*; -import java.io.*; -import com.sun.star.filter.config.tools.utils.*; - -//_______________________________________________ - -/** - * Its a simple command line tool, which can merge different XML fragments - * together. Such fragments must exist as files on disk, will be moved into - * one file together on disk. - * - * - */ -public class FCFGMerge -{ - //___________________________________________ - // const - - private static final java.lang.String CFGFILE = "com/sun/star/filter/config/tools/merge/FCFGMerge.cfg"; - private static final java.lang.String PROP_LOGLEVEL = "loglevel"; - - //___________________________________________ - // main - - public static void main(java.lang.String[] sCmdLine) - { - FCFGMerge.printCopyright(); - - // create log object in default mode "WARNINGS" - // If a command line parameter indicates another - // level - change it! - Logger aLog = new Logger(); - - try - { - // merge config file and overwrite properties - // via command line - ConfigHelper aCfg = null; - aCfg = new ConfigHelper(CFGFILE, sCmdLine); - - // update log level - int nLogLevel = aCfg.getInt(PROP_LOGLEVEL, Logger.LEVEL_WARNINGS); - aLog = new Logger(nLogLevel); - - // help requested? - if (aCfg.isHelp()) - { - FCFGMerge.printHelp(); - System.exit(-1); - } - - // create new merge object and start operation - Merger aMerger = new Merger(aCfg, aLog); - aMerger.merge(); - } - catch(java.lang.Throwable ex) - { - aLog.setException(ex); - System.exit(-1); - } - - System.exit(0); - } - - //___________________________________________ - - /** prints out a copyright message on stdout. - */ - private static void printCopyright() - { - java.lang.StringBuffer sOut = new java.lang.StringBuffer(256); - sOut.append("FCFGMerge\n"); - sOut.append("Copyright: 2003 by Sun Microsystems, Inc.\n"); - sOut.append("All Rights Reserved.\n"); - System.out.println(sOut.toString()); - } - - //___________________________________________ - - /** prints out a help message on stdout. - */ - private static void printHelp() - { - java.lang.StringBuffer sOut = new java.lang.StringBuffer(256); - sOut.append("____________________________________________________________\n"); - sOut.append("usage: FCFGMerge cfg=\n" ); - sOut.append("parameters:\n" ); - sOut.append("\tcfg=\n" ); - sOut.append("\t\tmust point to a system file, which contains\n" ); - sOut.append("\t\tall neccessary configuration data for the merge process.\n"); - sOut.append("\n\tFurther cou can specify every parameter allowed in the\n" ); - sOut.append("\n\tconfig file as command line parameter too, to overwrite\n" ); - sOut.append("\n\tthe value from the file.\n" ); - System.out.println(sOut.toString()); - } -} diff --git a/transex3/source/filter/merge/Manifest.mf b/transex3/source/filter/merge/Manifest.mf deleted file mode 100644 index 1337eaf4d39a..000000000000 --- a/transex3/source/filter/merge/Manifest.mf +++ /dev/null @@ -1 +0,0 @@ -Main-Class: com.sun.star.filter.config.tools.merge.FCFGMerge diff --git a/transex3/source/filter/merge/Merger.java b/transex3/source/filter/merge/Merger.java deleted file mode 100644 index 0bf11fc42fbf..000000000000 --- a/transex3/source/filter/merge/Merger.java +++ /dev/null @@ -1,364 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: Merger.java,v $ - * $Revision: 1.8 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.filter.config.tools.merge; - -//_______________________________________________ - -import java.lang.*; -import java.util.*; -import java.io.*; -import com.sun.star.filter.config.tools.utils.*; - -//_______________________________________________ - -/** can merge different xml fragments together. - * - * - */ -public class Merger -{ - //___________________________________________ - // const - - private static final java.lang.String PROP_XMLVERSION = "xmlversion" ; // <= global cfg file - private static final java.lang.String PROP_XMLENCODING = "xmlencoding" ; // <= global cfg file - private static final java.lang.String PROP_XMLPATH = "xmlpath" ; // <= global cfg file - private static final java.lang.String PROP_XMLPACKAGE = "xmlpackage" ; // <= global cfg file - - private static final java.lang.String PROP_SETNAME_TYPES = "setname_types" ; // <= global cfg file - private static final java.lang.String PROP_SETNAME_FILTERS = "setname_filters" ; // <= global cfg file - private static final java.lang.String PROP_SETNAME_LOADERS = "setname_frameloaders" ; // <= global cfg file - private static final java.lang.String PROP_SETNAME_HANDLERS = "setname_contenthandlers" ; // <= global cfg file - - private static final java.lang.String PROP_SUBDIR_TYPES = "subdir_types" ; // <= global cfg file - private static final java.lang.String PROP_SUBDIR_FILTERS = "subdir_filters" ; // <= global cfg file - private static final java.lang.String PROP_SUBDIR_LOADERS = "subdir_frameloaders" ; // <= global cfg file - private static final java.lang.String PROP_SUBDIR_HANDLERS = "subdir_contenthandlers" ; // <= global cfg file - - private static final java.lang.String PROP_EXTENSION_XCU = "extension_xcu" ; // <= global cfg file - private static final java.lang.String PROP_EXTENSION_PKG = "extension_pkg" ; // <= global cfg file - - private static final java.lang.String PROP_DELIMITER = "delimiter" ; // <= global cfg file - private static final java.lang.String PROP_TRIM = "trim" ; // <= global cfg file - private static final java.lang.String PROP_DECODE = "decode" ; // <= global cfg file - - private static final java.lang.String PROP_FRAGMENTSDIR = "fragmentsdir" ; // <= cmdline - private static final java.lang.String PROP_TEMPDIR = "tempdir" ; // <= cmdline - private static final java.lang.String PROP_OUTDIR = "outdir" ; // <= cmdline - private static final java.lang.String PROP_PKG = "pkg" ; // <= cmdline - private static final java.lang.String PROP_DEBUG = "debug" ; // <= cmdline - - private static final java.lang.String PROP_TCFG = "tcfg" ; // <= cmdline - private static final java.lang.String PROP_FCFG = "fcfg" ; // <= cmdline - private static final java.lang.String PROP_LCFG = "lcfg" ; // <= cmdline - private static final java.lang.String PROP_CCFG = "ccfg" ; // <= cmdline - private static final java.lang.String PROP_LANGUAGEPACK = "languagepack" ; // <= cmdline - - private static final java.lang.String PROP_ITEMS = "items" ; // <= pkg cfg files! - - //___________________________________________ - // member - - //------------------------------------------- - /** TODO */ - private ConfigHelper m_aCfg; - - //------------------------------------------- - /** TODO */ - private Logger m_aLog; - - //------------------------------------------- - /** TODO */ - private java.io.File m_aFragmentsDir; - - //------------------------------------------- - /** TODO */ - private java.io.File m_aTempDir; - - //------------------------------------------- - /** TODO */ - private java.io.File m_aOutDir; - - //------------------------------------------- - /** TODO */ - private java.util.Vector m_lTypes; - private java.util.Vector m_lFilters; - private java.util.Vector m_lLoaders; - private java.util.Vector m_lHandlers; - - //___________________________________________ - // interface - - //------------------------------------------- - /** initialize a new instance of this class and - * try to get all needed resources from the config module. - * - * @param aCfg - * provides access to all values of the global - * config file and to the command line. - * - * @param aLog - * can be used to print out log informations. - */ - public Merger(ConfigHelper aCfg, - Logger aLog) - throws java.lang.Exception - { - m_aCfg = aCfg; - m_aLog = aLog; - - m_aFragmentsDir = new java.io.File(m_aCfg.getString(PROP_FRAGMENTSDIR)); - m_aTempDir = new java.io.File(m_aCfg.getString(PROP_TEMPDIR )); -// m_aOutDir = new java.io.File(m_aCfg.getString(PROP_OUTDIR )); - - java.lang.String sDelimiter = m_aCfg.getString(PROP_DELIMITER); - boolean bTrim = m_aCfg.getBoolean(PROP_TRIM); - boolean bDecode = m_aCfg.getBoolean(PROP_DECODE); - - try - { - ConfigHelper aFcfg = new ConfigHelper(m_aCfg.getString(PROP_TCFG), null); - m_lTypes = aFcfg.getStringList(PROP_ITEMS, sDelimiter, bTrim, bDecode); - } - catch(java.util.NoSuchElementException ex1) - { - m_lTypes = new java.util.Vector(); - //m_aLog.setWarning("Fragment list of types is missing. Parameter \"items\" seems to be invalid."); - } - - try - { - ConfigHelper aFcfg = new ConfigHelper(m_aCfg.getString(PROP_FCFG), null); - m_lFilters = aFcfg.getStringList(PROP_ITEMS, sDelimiter, bTrim, bDecode); - } - catch(java.util.NoSuchElementException ex1) - { - m_lFilters = new java.util.Vector(); - //m_aLog.setWarning("Fragment list of filters is missing. Parameter \"items\" seems to be invalid."); - } - - try - { - ConfigHelper aFcfg = new ConfigHelper(m_aCfg.getString(PROP_LCFG), null); - m_lLoaders = aFcfg.getStringList(PROP_ITEMS, sDelimiter, bTrim, bDecode); - } - catch(java.util.NoSuchElementException ex1) - { - m_lLoaders = new java.util.Vector(); - //m_aLog.setWarning("Fragment list of frame loader objects is missing. Parameter \"items\" seems to be invalid."); - } - - try - { - ConfigHelper aFcfg = new ConfigHelper(m_aCfg.getString(PROP_CCFG), null); - m_lHandlers = aFcfg.getStringList(PROP_ITEMS, sDelimiter, bTrim, bDecode); - } - catch(java.util.NoSuchElementException ex1) - { - m_lHandlers = new java.util.Vector(); - //m_aLog.setWarning("Fragment list of content handler objects is missing. Parameter \"items\" seems to be invalid."); - } - } - - //------------------------------------------- - /** TODO */ - public synchronized void merge() - throws java.lang.Exception - { - java.lang.StringBuffer sBuffer = new java.lang.StringBuffer(1000000); - java.lang.String sPackage = m_aCfg.getString(PROP_PKG); - - m_aLog.setGlobalInfo("create package \""+sPackage+"\" ..."); - m_aLog.setDetailedInfo("generate package header ... "); - - sBuffer.append( - XMLHelper.generateHeader( - m_aCfg.getString (PROP_XMLVERSION ), - m_aCfg.getString (PROP_XMLENCODING ), - m_aCfg.getString (PROP_XMLPATH ), - m_aCfg.getString (PROP_XMLPACKAGE ), - m_aCfg.getBoolean(PROP_LANGUAGEPACK, false))); - - // counts all transfered fragments - // Can be used later to decide, if a generated package file - // contains "nothing"! - int nItemCount = 0; - - for (int i=0; i<4; ++i) - { - java.lang.String sSetName = null; - java.lang.String sSubDir = null; - java.util.Vector lFragments = null; - - try - { - switch(i) - { - case 0: // types - { - m_aLog.setDetailedInfo("generate set for types ... "); - sSetName = m_aCfg.getString(PROP_SETNAME_TYPES); - sSubDir = m_aCfg.getString(PROP_SUBDIR_TYPES ); - lFragments = m_lTypes; - } - break; - - case 1: // filters - { - m_aLog.setDetailedInfo("generate set for filter ... "); - sSetName = m_aCfg.getString(PROP_SETNAME_FILTERS); - sSubDir = m_aCfg.getString(PROP_SUBDIR_FILTERS ); - lFragments = m_lFilters; - } - break; - - case 2: // loaders - { - m_aLog.setDetailedInfo("generate set for frame loader ... "); - sSetName = m_aCfg.getString(PROP_SETNAME_LOADERS); - sSubDir = m_aCfg.getString(PROP_SUBDIR_LOADERS ); - lFragments = m_lLoaders; - } - break; - - case 3: // handlers - { - m_aLog.setDetailedInfo("generate set for content handler ... "); - sSetName = m_aCfg.getString(PROP_SETNAME_HANDLERS); - sSubDir = m_aCfg.getString(PROP_SUBDIR_HANDLERS ); - lFragments = m_lHandlers; - } - break; - } - - nItemCount += lFragments.size(); - - getFragments( - new java.io.File(m_aFragmentsDir, sSubDir), - sSetName, - lFragments, - 1, - sBuffer); - } - catch(java.util.NoSuchElementException exIgnore) - { continue; } - } - - m_aLog.setDetailedInfo("generate package footer ... "); - sBuffer.append(XMLHelper.generateFooter()); - - // Attention! - // If the package seem to be empty, it make no sense to generate a corresponding - // xml file. We should suppress writing of this file on disk completly ... - if (nItemCount < 1) - { - m_aLog.setWarning("Package is empty and will not result into a xml file on disk!? Please check configuration file."); - return; - } - m_aLog.setGlobalInfo("package contains "+nItemCount+" items"); - - java.io.File aPackage = new File(sPackage); - m_aLog.setGlobalInfo("write temp package \""+aPackage.getPath()); // TODO encoding must be readed from the configuration - FileHelper.writeEncodedBufferToFile(aPackage, "UTF-8", false, sBuffer); // check for success is done inside this method! - } - - //------------------------------------------- - /** TODO */ - private void getFragments(java.io.File aDir , - java.lang.String sSetName , - java.util.Vector lFragments , - int nPrettyTabs, - java.lang.StringBuffer sBuffer ) - throws java.lang.Exception - { - if (lFragments.size()<1) - { - m_aLog.setWarning("List of fragments is empty!? Will be ignored ..."); - return; - } - - java.util.Enumeration pFragments = lFragments.elements(); - java.lang.String sExtXcu = m_aCfg.getString(PROP_EXTENSION_XCU); - - for (int tabs=0; tabs\n"); - ++nPrettyTabs; - - // special mode for generating language packs. - // In such case we must live with some missing fragment files. - // Reason behind; Not all filters are realy localized. - // But we dont use a different fragment list. We try to locate - // any fragment file in its language-pack version ... - boolean bHandleLanguagePacks = m_aCfg.getBoolean(PROP_LANGUAGEPACK, false); - boolean bDebug = m_aCfg.getBoolean(PROP_DEBUG , false); - java.lang.String sEncoding = "UTF-8"; - if (bDebug) - sEncoding = "UTF-8Special"; - - while(pFragments.hasMoreElements()) - { - java.lang.String sFragment = (java.lang.String)pFragments.nextElement(); - java.io.File aFragment = new java.io.File(aDir, sFragment+"."+sExtXcu); - - // handle simple files only and check for existence! - if (!aFragment.exists()) - { - if (bHandleLanguagePacks) - { - m_aLog.setWarning("language fragment \""+aFragment.getPath()+"\" does not exist. Will be ignored."); - continue; - } - else - throw new java.io.IOException("fragment \""+aFragment.getPath()+"\" does not exists."); - } - - if (!aFragment.isFile()) - { - m_aLog.setWarning("fragment \""+aFragment.getPath()+"\" seem to be not a valid file."); - continue; - } - - // copy file content of original fragment - // Note: A FileNotFoundException will be thrown automaticly by the - // used reader objects. Let it break this method too. Our calli is interested - // on such errors :-) - m_aLog.setDetailedInfo("merge fragment \""+aFragment.getPath()+"\" ..."); - FileHelper.readEncodedBufferFromFile(aFragment, sEncoding, sBuffer); - - sBuffer.append("\n"); - } - - --nPrettyTabs; - for (int tabs=0; tabs\n"); - } -} diff --git a/transex3/source/filter/merge/makefile.mk b/transex3/source/filter/merge/makefile.mk deleted file mode 100644 index bf768be851d8..000000000000 --- a/transex3/source/filter/merge/makefile.mk +++ /dev/null @@ -1,96 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.9.102.1 $ -# -# 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 -# -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ = ..$/..$/.. -TARGET = FCFGMerge -PRJNAME = filter -PACKAGE = com$/sun$/star$/filter$/config$/tools$/merge - -# --- Settings ----------------------------------------------------- - -.INCLUDE: settings.mk - -#----- compile .java files ----------------------------------------- -#.IF "$(L10N_framework)"=="" - -OWNCOPY = \ - $(MISC)$/$(TARGET)_copied.done - -#JARFILES = \ -# ridl.jar \ -# unoil.jar \ -# jurt.jar \ -# juh.jar \ -# java_uno.jar - -CFGFILES = \ - FCFGMerge.cfg - -JAVACLASSFILES = \ - $(CLASSDIR)$/$(PACKAGE)$/Merger.class \ - $(CLASSDIR)$/$(PACKAGE)$/FCFGMerge.class - -CUSTOMMANIFESTFILE = \ - Manifest.mf - -MAXLINELENGTH = 100000 - -#----- make a jar from compiled files ------------------------------ - -JARCLASSDIRS = \ - com$/sun$/star$/filter$/config$/tools$/utils \ - com$/sun$/star$/filter$/config$/tools$/merge - -JARTARGET = $(TARGET).jar - -JARCOMPRESS = TRUE - -# --- targets ----------------------------------------------------- - -.INCLUDE : target.mk - -.IF "$(SOLAR_JAVA)" != "" || "$(GUI)"=="OS2" -ALLTAR : $(OWNCOPY) - -.IF "$(JARTARGETN)" != "" -$(JARTARGETN) : $(OWNCOPY) -.ENDIF - -$(OWNCOPY) : $(CFGFILES) - -$(MKDIRHIER) $(CLASSDIR)$/$(PACKAGE) - $(COPY) $? $(CLASSDIR)$/$(PACKAGE) && $(TOUCH) $@ - -.ENDIF # "$(SOLAR_JAVA)" != "" - -#.ELSE -#pseudo: - -#.ENDIF diff --git a/transex3/source/filter/utils/AnalyzeStartupLog.java b/transex3/source/filter/utils/AnalyzeStartupLog.java deleted file mode 100644 index 498528850697..000000000000 --- a/transex3/source/filter/utils/AnalyzeStartupLog.java +++ /dev/null @@ -1,328 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: AnalyzeStartupLog.java,v $ - * $Revision: 1.4 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -package com.sun.star.filter.config.tools.utils; - -//_______________________________________________ -// imports -import java.util.*; -import java.lang.*; - -//_______________________________________________ -// implementation -public class AnalyzeStartupLog -{ - private class OperationTime - { - /** name the measured operation. */ - public java.lang.String sOperation; - - /** contains the time value, when this operation was started. */ - public long nStartTime; - - /** contains the time value, when this operation was finished. */ - public long nEndTime; - - /** text inside log file, which identifies the start time value. */ - public java.lang.String sStartMsg; - - /** text inside log file, which identifies the end time value. */ - public java.lang.String sEndMsg; - } - - //_________________________________ - // main - - public static void main(java.lang.String[] lCmdLine) - { - int nExit = 0; - try - { - // analyze command line - ConfigHelper aCmdLine = new ConfigHelper("", lCmdLine); - java.lang.String sLogDir = aCmdLine.getString("logdir" ); - java.lang.String sDataFile = aCmdLine.getString("datafile"); - - if (sLogDir == null || sDataFile == null) - { - System.err.println("AnalyzeStartupLog lodir= datafile="); - System.err.println("E.g.: AnalyzeStartupLog lodir=c:\\temp\\logs datafile=c:\\temp\\data.csv"); - System.exit(--nExit); - } - - // get list of all log files - boolean bRecursive = true; - java.util.Vector lLogs = FileHelper.getSystemFilesFromDir(new java.io.File(sLogDir), bRecursive); - if (lLogs == null || lLogs.isEmpty()) - { - System.err.println("log dir is empty"); - System.exit(--nExit); - } - - // analyze it - java.lang.StringBuffer sOut = new java.lang.StringBuffer(1000); - sOut.append("log;t_cfg_start;t_cfg_end;t_fwk_start;t_fwk_end;t_sfx_start;t_sfx_end;t_types_start;t_types_end;t_filters_start;t_filters_end;"); - sOut.append("t_filters_swriter_start;t_filters_swriter_end;t_filters_sweb_start;t_filters_sweb_end;t_filters_sglobal_start;t_filters_sglobal_end;t_filters_scalc_start;t_filters_scalc_end;t_filters_sdraw_start;t_filters_sdraw_end;t_filters_simpress_start;t_filters_simpress_end;t_filters_schart_start;t_filters_schart_end;t_filters_smath_start;t_filters_smath_end;"); - sOut.append("t_others_start;t_others_end;d_cfg;d_fwk;d_sfx;d_types;d_filters;d_others;d_complete\n"); - - java.util.Enumeration aIt = lLogs.elements(); - while (aIt.hasMoreElements()) - { - java.io.File aLog = (java.io.File)aIt.nextElement(); - java.io.FileReader aReader = new java.io.FileReader(aLog); - java.io.BufferedReader aBuffer = new java.io.BufferedReader(aReader); - - long t_cfg_start = 0; - long t_cfg_end = 0; - - long t_fwk_start = 0; - long t_fwk_end = 0; - - long t_sfx_start = 0; - long t_sfx_end = 0; - - long t_types_start = 0; - long t_types_end = 0; - - long t_filters_start = 0; - long t_filters_end = 0; - - long t_filters_swriter_start = 0; - long t_filters_swriter_end = 0; - - long t_filters_sweb_start = 0; - long t_filters_sweb_end = 0; - - long t_filters_sglobal_start = 0; - long t_filters_sglobal_end = 0; - - long t_filters_scalc_start = 0; - long t_filters_scalc_end = 0; - - long t_filters_sdraw_start = 0; - long t_filters_sdraw_end = 0; - - long t_filters_simpress_start = 0; - long t_filters_simpress_end = 0; - - long t_filters_schart_start = 0; - long t_filters_schart_end = 0; - - long t_filters_smath_start = 0; - long t_filters_smath_end = 0; - - long t_others_start = 0; - long t_others_end = 0; - - while (true) - { - java.lang.String sLine = aBuffer.readLine(); - if (sLine == null) - break; - - if (sLine.endsWith("| framework (as96863) ::FilterCache::FilterCache : { creation ConfigItem [file=standard, version=6, mode=3]")) - t_cfg_start = new java.lang.Long(sLine.substring(0, 6)).longValue(); - else - if (sLine.endsWith("| framework (as96863) ::FilterCache::FilterCache : } creation ConfigItem")) - t_cfg_end = new java.lang.Long(sLine.substring(0, 6)).longValue(); - else - if (sLine.endsWith("| framework (as96863) ::FilterCache::FilterCache : { reading TypeDetection.xml")) - t_fwk_start = new java.lang.Long(sLine.substring(0, 6)).longValue(); - else - if (sLine.endsWith("| framework (as96863) ::FilterCache::FilterCache : } reading TypeDetection.xml")) - t_fwk_end = new java.lang.Long(sLine.substring(0, 6)).longValue(); - else - if (sLine.endsWith("{ framework (as96863) ::FilterCFGAccess::impl_loadTypes")) - t_types_start = new java.lang.Long(sLine.substring(0, 6)).longValue(); - else - if (sLine.endsWith("} framework (as96863) ::FilterCFGAccess::impl_loadTypes")) - t_types_end = new java.lang.Long(sLine.substring(0, 6)).longValue(); - else - if (sLine.endsWith("{ framework (as96863) ::FilterCFGAccess::impl_loadFilters")) - t_filters_start = new java.lang.Long(sLine.substring(0, 6)).longValue(); - else - if (sLine.endsWith("} framework (as96863) ::FilterCFGAccess::impl_loadFilters")) - t_filters_end = new java.lang.Long(sLine.substring(0, 6)).longValue(); - else - if (sLine.endsWith("{ reading FilterGroup [swriter]")) - t_filters_swriter_start = new java.lang.Long(sLine.substring(0, 6)).longValue(); - else - if (sLine.endsWith("} reading FilterGroup [swriter]")) - t_filters_swriter_end = new java.lang.Long(sLine.substring(0, 6)).longValue(); - else - if (sLine.endsWith("{ reading FilterGroup [sweb]")) - t_filters_sweb_start = new java.lang.Long(sLine.substring(0, 6)).longValue(); - else - if (sLine.endsWith("} reading FilterGroup [sweb]")) - t_filters_sweb_end = new java.lang.Long(sLine.substring(0, 6)).longValue(); - else - if (sLine.endsWith("{ reading FilterGroup [sglobal]")) - t_filters_sglobal_start = new java.lang.Long(sLine.substring(0, 6)).longValue(); - else - if (sLine.endsWith("} reading FilterGroup [sglobal]")) - t_filters_sglobal_end = new java.lang.Long(sLine.substring(0, 6)).longValue(); - else - if (sLine.endsWith("{ reading FilterGroup [scalc]")) - t_filters_scalc_start = new java.lang.Long(sLine.substring(0, 6)).longValue(); - else - if (sLine.endsWith("} reading FilterGroup [scalc]")) - t_filters_scalc_end = new java.lang.Long(sLine.substring(0, 6)).longValue(); - else - if (sLine.endsWith("{ reading FilterGroup [sdraw]")) - t_filters_sdraw_start = new java.lang.Long(sLine.substring(0, 6)).longValue(); - else - if (sLine.endsWith("} reading FilterGroup [sdraw]")) - t_filters_sdraw_end = new java.lang.Long(sLine.substring(0, 6)).longValue(); - else - if (sLine.endsWith("{ reading FilterGroup [simpress]")) - t_filters_simpress_start = new java.lang.Long(sLine.substring(0, 6)).longValue(); - else - if (sLine.endsWith("} reading FilterGroup [simpress]")) - t_filters_simpress_end = new java.lang.Long(sLine.substring(0, 6)).longValue(); - else - if (sLine.endsWith("{ reading FilterGroup [schart]")) - t_filters_schart_start = new java.lang.Long(sLine.substring(0, 6)).longValue(); - else - if (sLine.endsWith("} reading FilterGroup [schart]")) - t_filters_schart_end = new java.lang.Long(sLine.substring(0, 6)).longValue(); - else - if (sLine.endsWith("{ reading FilterGroup [smath]")) - t_filters_smath_start = new java.lang.Long(sLine.substring(0, 6)).longValue(); - else - if (sLine.endsWith("} reading FilterGroup [smath]")) - t_filters_smath_end = new java.lang.Long(sLine.substring(0, 6)).longValue(); - else - if (sLine.endsWith("{ framework (as96863) ::FilterCFGAccess::impl_loadDetectors")) - t_others_start = new java.lang.Long(sLine.substring(0, 6)).longValue(); - else - if (sLine.endsWith("} framework (as96863) ::FilterCFGAccess::impl_loadContentHandlers")) - t_others_end = new java.lang.Long(sLine.substring(0, 6)).longValue(); - else - if (sLine.endsWith("} framework (as96863) ::FilterCache::FilterCache")) - t_sfx_start = new java.lang.Long(sLine.substring(0, 6)).longValue(); - else - if (sLine.endsWith("} desktop (lo119109) OfficeWrapper::OfficeWrapper")) - t_sfx_end = new java.lang.Long(sLine.substring(0, 6)).longValue(); - } - - sOut.append(aLog.getName() ); - sOut.append(";" ); - sOut.append(t_cfg_start ); - sOut.append(";" ); - sOut.append(t_cfg_end ); - sOut.append(";" ); - sOut.append(t_fwk_start ); - sOut.append(";" ); - sOut.append(t_fwk_end ); - sOut.append(";" ); - sOut.append(t_sfx_start ); - sOut.append(";" ); - sOut.append(t_sfx_end ); - sOut.append(";" ); - sOut.append(t_types_start ); - sOut.append(";" ); - sOut.append(t_types_end ); - sOut.append(";" ); - sOut.append(t_filters_start ); - sOut.append(";" ); - sOut.append(t_filters_end ); - sOut.append(";" ); - - sOut.append(t_filters_swriter_start ); - sOut.append(";" ); - sOut.append(t_filters_swriter_end ); - sOut.append(";" ); - sOut.append(t_filters_sweb_start ); - sOut.append(";" ); - sOut.append(t_filters_sweb_end ); - sOut.append(";" ); - sOut.append(t_filters_sglobal_start ); - sOut.append(";" ); - sOut.append(t_filters_sglobal_end ); - sOut.append(";" ); - sOut.append(t_filters_scalc_start ); - sOut.append(";" ); - sOut.append(t_filters_scalc_end ); - sOut.append(";" ); - sOut.append(t_filters_sdraw_start ); - sOut.append(";" ); - sOut.append(t_filters_sdraw_end ); - sOut.append(";" ); - sOut.append(t_filters_simpress_start ); - sOut.append(";" ); - sOut.append(t_filters_simpress_end ); - sOut.append(";" ); - sOut.append(t_filters_schart_start ); - sOut.append(";" ); - sOut.append(t_filters_schart_end ); - sOut.append(";" ); - sOut.append(t_filters_smath_start ); - sOut.append(";" ); - sOut.append(t_filters_smath_end ); - sOut.append(";" ); - - sOut.append(t_others_start ); - sOut.append(";" ); - sOut.append(t_others_end ); - sOut.append(";" ); - sOut.append(t_cfg_end -t_cfg_start ); - sOut.append(";" ); - sOut.append(t_fwk_end -t_fwk_start ); - sOut.append(";" ); - sOut.append(t_sfx_end -t_sfx_start ); - sOut.append(";" ); - sOut.append(t_types_end -t_types_start ); - sOut.append(";" ); - sOut.append(t_filters_end-t_filters_start); - sOut.append(";" ); - sOut.append(t_others_end -t_others_start ); - sOut.append(";" ); - sOut.append(t_others_end -t_cfg_start ); - sOut.append("\n" ); - - aBuffer.close(); - } - - java.io.FileWriter aCSV = new java.io.FileWriter(sDataFile); - java.lang.String sData = sOut.toString(); - aCSV.write(sData, 0, sData.length()); - aCSV.flush(); - aCSV.close(); - } - catch(java.lang.Throwable exAny) - { - System.err.println(exAny.getMessage()); - exAny.printStackTrace(); - System.exit(--nExit); - } - - System.exit(0); - } -} diff --git a/transex3/source/filter/utils/Cache.java b/transex3/source/filter/utils/Cache.java deleted file mode 100644 index 94c26008ed13..000000000000 --- a/transex3/source/filter/utils/Cache.java +++ /dev/null @@ -1,2449 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: Cache.java,v $ - * $Revision: 1.7 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -package com.sun.star.filter.config.tools.utils; - -//_______________________________________________ - -import java.lang.*; -import java.util.*; -import java.io.*; - -//_______________________________________________ - -/** - * It implements a container for all possible entries which are part of the type - * and filter mechanism of an office - means all items of the configuration file - * "TypeDetection". How these entries will be readed or written can be switch - * in different modes. That would make it possible to edit an xml directly or - * to contact a running office instance. - * - * - */ -public class Cache -{ - //___________________________________________ - // public const - - /** identifies a file type item of this cache. */ - public static final int E_TYPE = 0; - - /** identifies a filter item of this cache. */ - public static final int E_FILTER = 1; - - /** identifies a detect service item of this cache. */ - public static final int E_DETECTSERVICE = 2; - - /** identifies a frame loader item of this cache. */ - public static final int E_FRAMELOADER = 3; - - /** identifies a content handler item of this cache. */ - public static final int E_CONTENTHANDLER = 4; - - /** indicates an unsupported xml format => error! */ - public static final int FORMAT_UNSUPPORTED = -1; - - /** identify the configuration format of an office 6.0. - * The own formated data string is used. */ - public static final int FORMAT_60 = 0; - - /** identify the configuration format of an office 6.y. - * Properties are realy xml tags again. */ - public static final int FORMAT_6Y = 1; - - /** identify the configuration format which is used inside - * this tooling project. */ - public static final int FORMAT_INTERNAL = 2; - - /** right value for a command line parameter to define a 6.0 version. */ - public static final java.lang.String CMDVAL_FORMAT_60 = "6.0"; - - /** right value for a command line parameter to define a 6.Y version. */ - public static final java.lang.String CMDVAL_FORMAT_6Y = "6.Y"; - - /** right value for a command line parameter to define an internal xml version! */ - public static final java.lang.String CMDVAL_FORMAT_INTERNAL = "internal"; - - // general - public static final java.lang.String PROPNAME_DATA = "Data"; - public static final java.lang.String PROPNAME_NAME = "Name"; - public static final java.lang.String PROPNAME_UINAME = "UIName"; - public static final java.lang.String PROPNAME_UINAMES = "UINames"; - - // type 6.0 ... - public static final java.lang.String PROPNAME_MEDIATYPE = "MediaType"; - public static final java.lang.String PROPNAME_PREFERRED = "Preferred"; - public static final java.lang.String PROPNAME_CLIPBOARDFORMAT = "ClipboardFormat"; - public static final java.lang.String PROPNAME_DOCUMENTICONID = "DocumentIconID"; - public static final java.lang.String PROPNAME_URLPATTERN = "URLPattern"; - public static final java.lang.String PROPNAME_EXTENSIONS = "Extensions"; - // ... +6.y - public static final java.lang.String PROPNAME_UIORDER = "UIOrder"; - public static final java.lang.String PROPNAME_PREFERREDFILTER = "PreferredFilter"; - public static final java.lang.String PROPNAME_DETECTSERVICE = "DetectService"; - public static final java.lang.String PROPNAME_FRAMELOADER = "FrameLoader"; - public static final java.lang.String PROPNAME_CONTENTHANDLER = "ContentHandler"; - - // filter - public static final java.lang.String PROPNAME_DOCUMENTSERVICE = "DocumentService"; - public static final java.lang.String PROPNAME_FILEFORMATVERSION = "FileFormatVersion"; - public static final java.lang.String PROPNAME_FILTERSERVICE = "FilterService"; - public static final java.lang.String PROPNAME_FLAGS = "Flags"; - public static final java.lang.String PROPNAME_ORDER = "Order"; // -6.y - public static final java.lang.String PROPNAME_TEMPLATENAME = "TemplateName"; - public static final java.lang.String PROPNAME_TYPE = "Type"; - public static final java.lang.String PROPNAME_UICOMPONENT = "UIComponent"; - public static final java.lang.String PROPNAME_USERDATA = "UserData"; - - // frame loader / detect services / content handler - public static final java.lang.String PROPNAME_TYPES = "Types"; - - //___________________________________________ - // private const - - private static final java.lang.String FILTERSERVICE_NATIVEWARPPER = "com.sun.star.filter.NativeFilterWrapper"; - private static final java.lang.String GENERIC_DETECTSERVICE = "com.sun.star.comp.office.FrameLoader"; - - /** its the name of the cfg set, which contains all types. */ - private static final java.lang.String CFGNODE_TYPES = "Types"; - - /** its the name of the cfg set, which contains all filters. */ - private static final java.lang.String CFGNODE_FILTERS = "Filters"; - - /** its the name of the cfg set, which contains all detect services. */ - private static final java.lang.String CFGNODE_DETECTSERVICES = "DetectServices"; - - /** its the name of the cfg set, which contains all frame loaders. */ - private static final java.lang.String CFGNODE_FRAMELOADERS = "FrameLoaders"; - - /** its the name of the cfg set, which contains all content handlers. */ - private static final java.lang.String CFGNODE_CONTENTHANDLERS = "ContentHandlers"; - - // names for filter flags - private static final java.lang.String FLAGNAME_3RDPARTYFILTER = "3RDPARTYFILTER"; - private static final java.lang.String FLAGNAME_ALIEN = "ALIEN"; - private static final java.lang.String FLAGNAME_ASYNCHRON = "ASYNCHRON"; - private static final java.lang.String FLAGNAME_BROWSERPREFERRED = "BROWSERPREFERRED"; - private static final java.lang.String FLAGNAME_CONSULTSERVICE = "CONSULTSERVICE"; - private static final java.lang.String FLAGNAME_DEFAULT = "DEFAULT"; - private static final java.lang.String FLAGNAME_EXPORT = "EXPORT"; - private static final java.lang.String FLAGNAME_IMPORT = "IMPORT"; - private static final java.lang.String FLAGNAME_INTERNAL = "INTERNAL"; - private static final java.lang.String FLAGNAME_NOTINCHOOSER = "NOTINCHOOSER"; - private static final java.lang.String FLAGNAME_NOTINFILEDIALOG = "NOTINFILEDIALOG"; - private static final java.lang.String FLAGNAME_NOTINSTALLED = "NOTINSTALLED"; - private static final java.lang.String FLAGNAME_OWN = "OWN"; - private static final java.lang.String FLAGNAME_PACKED = "PACKED"; - private static final java.lang.String FLAGNAME_PREFERRED = "PREFERRED"; - private static final java.lang.String FLAGNAME_READONLY = "READONLY"; - private static final java.lang.String FLAGNAME_SILENTEXPORT = "SILENTEXPORT"; - private static final java.lang.String FLAGNAME_TEMPLATE = "TEMPLATE"; - private static final java.lang.String FLAGNAME_TEMPLATEPATH = "TEMPLATEPATH"; - private static final java.lang.String FLAGNAME_USESOPTIONS = "USESOPTIONS"; - - private static final java.lang.String FLAGNAME_COMBINED = "COMBINED"; - private static final java.lang.String FLAGNAME_SUPPORTSSELECTION= "SUPPORTSSELECTION"; - - // values for filter flags - private static final int FLAGVAL_3RDPARTYFILTER = 0x00080000; // 524288 - private static final int FLAGVAL_ALIEN = 0x00000040; // 64 - private static final int FLAGVAL_ALL = 0xffffffff; // 4294967295 - private static final int FLAGVAL_ASYNCHRON = 0x00004000; // 16384 - private static final int FLAGVAL_BROWSERPREFERRED = 0x00400000; // 4194304 - private static final int FLAGVAL_CONSULTSERVICE = 0x00040000; // 262144 - private static final int FLAGVAL_DEFAULT = 0x00000100; // 256 - private static final int FLAGVAL_EXPORT = 0x00000002; // 2 - private static final int FLAGVAL_IMPORT = 0x00000001; // 1 - private static final int FLAGVAL_INTERNAL = 0x00000008; // 8 - private static final int FLAGVAL_NOTINCHOOSER = 0x00002000; // 8192 - private static final int FLAGVAL_NOTINFILEDIALOG = 0x00001000; // 4096 - private static final int FLAGVAL_NOTINSTALLED = 0x00020000; // 131072 - private static final int FLAGVAL_OWN = 0x00000020; // 32 - private static final int FLAGVAL_PACKED = 0x00100000; // 1048576 - private static final int FLAGVAL_PREFERRED = 0x10000000; // 268435456 - private static final int FLAGVAL_READONLY = 0x00010000; // 65536 - private static final int FLAGVAL_SILENTEXPORT = 0x00200000; // 2097152 - private static final int FLAGVAL_TEMPLATE = 0x00000004; // 4 - private static final int FLAGVAL_TEMPLATEPATH = 0x00000010; // 16 - private static final int FLAGVAL_USESOPTIONS = 0x00000080; // 128 - - private static final int FLAGVAL_COMBINED = 0x00800000; // ... - private static final int FLAGVAL_SUPPORTSSELECTION = 0x00000400; // 1024 - - //___________________________________________ - // member - - /** list of all located types. - * Format: [string,HashMap] - */ - private java.util.HashMap m_lTypes; - - /** list of all located filters. - * Format: [string,HashMap] - */ - private java.util.HashMap m_lFilters; - - /** list of all located detect services. - * Format: [string,HashMap] - */ - private java.util.HashMap m_lDetectServices; - - /** list of all located frame loader. - * Format: [string,HashMap] - */ - private java.util.HashMap m_lFrameLoaders; - - /** list of all located content handler. - * Format: [string,HashMap] - */ - private java.util.HashMap m_lContentHandlers; - - /** contains all analyzed relations between - * filters and types. The key is an internal - * type name (can be used as reference into the - * list m_lTypes) and the value is a Vector of all - * internal filter names, which are registered for - * this type. - * Format: [string, Vector] - */ - private java.util.HashMap m_lFilterToTypeRegistrations; - - private int m_nDoubleRegisteredFilters; - private int m_nTypesForFilters; - private int m_nTypesForDetectServices; - private int m_nTypesForFrameLoaders; - private int m_nTypesForContentHandlers; - - /** can be used to log different informations. */ - private Logger m_aDebug; - - //___________________________________________ - // interface - - /** standard ctor. - * - * Initialize an empty cache instance. You have to use - * on of the fromXXX() methods to fill it from different - * sources with content. - */ - public Cache(Logger aDebug) - { - reset(); - m_aDebug = aDebug; - } - - //___________________________________________ - - /** free memory and set default values on all members. - */ - public synchronized void reset() - { - m_lTypes = new java.util.HashMap(); - m_lFilters = new java.util.HashMap(); - m_lFrameLoaders = new java.util.HashMap(); - m_lDetectServices = new java.util.HashMap(); - m_lContentHandlers = new java.util.HashMap(); - m_lFilterToTypeRegistrations = new java.util.HashMap(); - m_aDebug = new Logger(); - m_nDoubleRegisteredFilters = 0; - m_nTypesForFilters = 0; - m_nTypesForDetectServices = 0; - m_nTypesForFrameLoaders = 0; - m_nTypesForContentHandlers = 0; - } - - //___________________________________________ - - /** converts a string representation of an xml format - * to its int value, which must be used at some interface - * methods of this cache. - * - * If the given string does not match to any well known format, - * the return value will be FORMAT_UNSUPPORTED. The calli have to - * check that. Otherwhise a called interface method at this cache - * instance will be rejected by an exception! - * - * @param sFormat - * the string representation - * Must be one of our public const values from type CMDVAL_FORMAT_xxx. - * - * @return [int] - * the int representation. - * Will be one of our public const values from type FORMAT_xxx. - */ - public static int mapFormatString2Format(java.lang.String sFormat) - { - int nFormat = FORMAT_UNSUPPORTED; - if (sFormat.equalsIgnoreCase(CMDVAL_FORMAT_60)) - nFormat = FORMAT_60; - else - if (sFormat.equalsIgnoreCase(CMDVAL_FORMAT_6Y)) - nFormat = FORMAT_6Y; - else - if (sFormat.equalsIgnoreCase(CMDVAL_FORMAT_INTERNAL)) - nFormat = FORMAT_INTERNAL; - return nFormat; - } - - //___________________________________________ - - /** return some statistic values. - * - * Such values can be: - count of container items, - * - ... - * - * @return [java.lang.String] - * a formated string, which contains al statistic data. - */ - public synchronized java.lang.String getStatistics() - { - java.lang.StringBuffer sBuffer = new java.lang.StringBuffer(256); - - sBuffer.append("types = "+m_lTypes.size() +"\n"); - sBuffer.append("filters = "+m_lFilters.size() +"\n"); - sBuffer.append("detect services = "+m_lDetectServices.size() +"\n"); - sBuffer.append("frame loaders = "+m_lFrameLoaders.size() +"\n"); - sBuffer.append("content handler = "+m_lContentHandlers.size() +"\n"); - sBuffer.append("double registered filters = "+m_nDoubleRegisteredFilters+"\n"); - sBuffer.append("types used by filters = "+m_nTypesForFilters +"\n"); - sBuffer.append("types used by detect services = "+m_nTypesForDetectServices +"\n"); - sBuffer.append("types used by frame loaders = "+m_nTypesForFrameLoaders +"\n"); - sBuffer.append("types used by content handlers = "+m_nTypesForContentHandlers+"\n"); - - return sBuffer.toString(); - } - - //___________________________________________ - - /** reset this cache and fill it with new values using the given XML file. - * - * @param aXML - * must be a system file of a suitable XML file, which - * include all neccessary type/filter items. - * - * @param nFormat - * identifies the format of the specified xml file, - * which must be interpreted. - */ - public synchronized void fromXML(java.io.File aXML , - int nFormat) - throws java.lang.Exception - { - // clear this cache - reset(); - - // parse it - javax.xml.parsers.DocumentBuilderFactory aFactory = javax.xml.parsers.DocumentBuilderFactory.newInstance(); - /* Attention: - * This call is important. It force right handling of entities during parsing and(!) - * writing. It let all possible signs for entities or it's quoted representations - * untouched. So this class don't change the original signs of the original file. - * Means: - *
    - *
  • (') => (')
  • - *
  • (") => (")
  • - *
  • (>) => (>)
  • - *
  • (<) => (<)
  • - *
  • (>) => (>)
  • - *
  • (&) => (&)
  • - *
  • ...
  • - *
- */ - - System.out.println("TODO: must be adapted to java 1.3 :-("); - System.exit(-1); -//TODO_JAVA aFactory.setExpandEntityReferences(false); - - javax.xml.parsers.DocumentBuilder aBuilder = aFactory.newDocumentBuilder(); - org.w3c.dom.Document aDOM = aBuilder.parse(aXML); - org.w3c.dom.Element aRoot = aDOM.getDocumentElement(); - - // step over all sets - java.util.Vector lSetNodes = XMLHelper.extractChildNodesByTagName(aRoot, XMLHelper.XMLTAG_NODE); - java.util.Enumeration it1 = lSetNodes.elements(); - while (it1.hasMoreElements()) - { - // try to find out, which set should be read - org.w3c.dom.Node aSetNode = (org.w3c.dom.Node)it1.nextElement(); - java.lang.String sSetName = XMLHelper.extractNodeAttribByName(aSetNode, XMLHelper.XMLATTRIB_OOR_NAME); - if (sSetName == null) - throw new java.io.IOException("unsupported format: could not extract set name on node ...\n"+aSetNode); - - // map some generic interfaces to the right members! - int eType = -1 ; - java.util.HashMap rMap = null; - - if (sSetName.equals(CFGNODE_TYPES)) - { - eType = E_TYPE; - rMap = m_lTypes; - } - else - if (sSetName.equals(CFGNODE_FILTERS)) - { - eType = E_FILTER; - rMap = m_lFilters; - } - else - if (sSetName.equals(CFGNODE_FRAMELOADERS)) - { - eType = E_FRAMELOADER; - rMap = m_lFrameLoaders; - } - else - if (sSetName.equals(CFGNODE_DETECTSERVICES)) - { - eType = E_DETECTSERVICE; - rMap = m_lDetectServices; - } - else - if (sSetName.equals(CFGNODE_CONTENTHANDLERS)) - { - eType = E_CONTENTHANDLER; - rMap = m_lContentHandlers; - } - else - throw new java.io.IOException("unsupported format: unknown set name [\""+sSetName+"\"] detected on node ...\n"+aSetNode); - - // load all set entries - java.util.Vector lChildNodes = XMLHelper.extractChildNodesByTagName(aSetNode, XMLHelper.XMLTAG_NODE); - java.util.Enumeration it2 = lChildNodes.elements(); - while (it2.hasMoreElements()) - { - org.w3c.dom.Node aChildNode = (org.w3c.dom.Node)it2.nextElement(); - java.lang.String sChildName = XMLHelper.extractNodeAttribByName(aChildNode, XMLHelper.XMLATTRIB_OOR_NAME); - if (sChildName == null) - throw new java.io.IOException("unsupported format: could not extract child node name on node ...\n"+aChildNode); - java.util.HashMap aPropSet = null; - - // Note: Our internal format is different from the source format! - java.util.HashMap aTempSet = XMLHelper.convertNodeToPropSet(aChildNode); - switch(eType) - { - case E_TYPE : - { - aPropSet = Cache.convertTypePropsToInternal(aTempSet, nFormat); - m_aDebug.setDetailedInfo("type [\""+sChildName+"\"] converted to internal format"); - } - break; - - case E_FILTER : - { - aPropSet = Cache.convertFilterPropsToInternal(aTempSet, nFormat); - m_aDebug.setDetailedInfo("filter [\""+sChildName+"\"] converted to internal format"); - } - break; - - case E_DETECTSERVICE : - { - aPropSet = Cache.convertDetectServicePropsToInternal(aTempSet, nFormat); - m_aDebug.setDetailedInfo("detect service [\""+sChildName+"\"] converted to internal format"); - } - break; - - case E_FRAMELOADER : - { - aPropSet = Cache.convertFrameLoaderPropsToInternal(aTempSet, nFormat); - m_aDebug.setDetailedInfo("frame loader [\""+sChildName+"\"] converted to internal format"); - } - break; - - case E_CONTENTHANDLER : - { - aPropSet = Cache.convertContentHandlerPropsToInternal(aTempSet, nFormat); - m_aDebug.setDetailedInfo("content handler [\""+sChildName+"\"] converted to internal format"); - } - break; - } - m_aDebug.setDetailedInfo("props = "+aTempSet); - rMap.put(sChildName, aPropSet); - } - } - } - - //___________________________________________ - - /** create some hml views of the current content of this cache. - * - * The given directory is used to create different html files - * there. Every of them show another aspect of this cache. - * E.g.: - all type/filter properties - * - relation ships between types/filters/loaders etc. - * - * @param aDirectory - * points to a system directory, which - * can be used completely(!) to generate - * the results there. - * - * @param nFormat - * specify in which context the cache items should be - * interpreted. - */ - public synchronized void toHTML(java.io.File aDirectory, - int nFormat , - java.lang.String sEncoding ) - throws java.lang.Exception - { - if (nFormat != FORMAT_6Y) - throw new java.lang.Exception("HTML views are supported for the new 6.y format only yet."); - - java.lang.StringBuffer sRelationView = new java.lang.StringBuffer(1000); - sRelationView.append("
Relation View
"); - sRelationView.append(""); - sRelationView.append(""); - - java.util.Iterator aIt = m_lTypes.keySet().iterator(); - while (aIt.hasNext()) - { - java.lang.String sType = (java.lang.String)aIt.next(); - java.util.HashMap aType = (java.util.HashMap)m_lTypes.get(sType); - - sRelationView.append(""); - sRelationView.append(""); - - java.lang.String sVal = (java.lang.String)aType.get(PROPNAME_DETECTSERVICE); - if (sVal == null || sVal.length()<1) - sRelationView.append(""); - else - sRelationView.append(""); - - sVal = (java.lang.String)aType.get(PROPNAME_PREFERREDFILTER); - if (sVal == null || sVal.length()<1) - sRelationView.append(""); - else - sRelationView.append(""); - - sVal = (java.lang.String)aType.get(PROPNAME_FRAMELOADER); - if (sVal == null || sVal.length()<1) - sRelationView.append(""); - else - sRelationView.append(""); - - sVal = (java.lang.String)aType.get(PROPNAME_CONTENTHANDLER); - if (sVal == null || sVal.length()<1) - sRelationView.append(""); - else - sRelationView.append(""); - - sRelationView.append(""); - } - - sRelationView.append("
typedetect servicepreferred filterframe loadercontent handler
"+sType+" - "+sVal+" - "+sVal+" - "+sVal+" - "+sVal+"
"); - sRelationView.append(""); - - FileHelper.writeEncodedBufferToFile(new java.io.File(aDirectory, "relation_view.html"), sEncoding, false, sRelationView); - - java.util.HashMap lFilters2TypeRegistration = new java.util.HashMap(); - aIt = m_lFilters.keySet().iterator(); - while (aIt.hasNext()) - { - java.lang.String sFilter = (java.lang.String)aIt.next(); - java.util.HashMap aFilter = (java.util.HashMap)m_lFilters.get(sFilter); - java.lang.String sType = (java.lang.String)aFilter.get(PROPNAME_TYPE); - - java.util.Vector lFilters = (java.util.Vector)lFilters2TypeRegistration.get(sType); - if (lFilters == null) - lFilters = new java.util.Vector(); - lFilters.add(sFilter); - lFilters2TypeRegistration.put(sType, lFilters); - } - - java.lang.StringBuffer sType2FiltersView = new java.lang.StringBuffer(1000); - sType2FiltersView.append("
Type2Filters View
"); - sType2FiltersView.append(""); - sType2FiltersView.append(""); - - aIt = lFilters2TypeRegistration.keySet().iterator(); - while (aIt.hasNext()) - { - java.lang.String sType = (java.lang.String)aIt.next(); - java.util.Vector lFilters = (java.util.Vector)lFilters2TypeRegistration.get(sType); - - sType2FiltersView.append(""); - } - - sType2FiltersView.append("
typefilters
"+sType+""); - java.util.Enumeration aEn = lFilters.elements(); - while(aEn.hasMoreElements()) - sType2FiltersView.append(aEn.nextElement()+"
"); - sType2FiltersView.append("
"); - sType2FiltersView.append(""); - - FileHelper.writeEncodedBufferToFile(new java.io.File(aDirectory, "type2filters_view.html"), sEncoding, false, sType2FiltersView); - } - - //___________________________________________ - - /** converts all items of this cache to its xml representation - * and write it to the given file. - * - * @param aXML - * the target file for output. - * - * @param nFormat - * the requested xml format. - * see const values FORMAT_xxx too. - * - * @param sEncoding - * specify the file encoding for the generated xml file. - * - * @throws [java.lang.Exception] - * if something fail during convertion. - */ - public synchronized void toXML(java.io.File aXML , - int nFormat , - java.lang.String sEncoding) - throws java.lang.Exception - { - java.lang.StringBuffer sXML = new java.lang.StringBuffer(500000); - - for (int i=0; i<5; ++i) - { - // define right sub container - java.lang.String sSetName = null; - java.util.HashMap rMap = null; - int eType = -1; - - switch(i) - { - case 0 : - { - sSetName = CFGNODE_TYPES; - rMap = m_lTypes; - eType = E_TYPE; - } - break; - - case 1 : - { - sSetName = CFGNODE_FILTERS; - rMap = m_lFilters; - eType = E_FILTER; - } - break; - - case 2 : - { - sSetName = CFGNODE_DETECTSERVICES; - rMap = m_lDetectServices; - eType = E_DETECTSERVICE; - } - break; - - case 3 : - { - sSetName = CFGNODE_FRAMELOADERS; - rMap = m_lFrameLoaders; - eType = E_FRAMELOADER; - } - break; - - case 4 : - { - sSetName = CFGNODE_CONTENTHANDLERS; - rMap = m_lContentHandlers; - eType = E_CONTENTHANDLER; - } - break; - } - - // generate set - sXML.append("\n"); - java.util.Iterator it = rMap.keySet().iterator(); - while(it.hasNext()) - { - java.lang.String sItem = (java.lang.String)it.next(); - sXML.append("\n"); - sXML.append(getItemAsXML(eType, sItem, nFormat)); - sXML.append("\n"); - } - sXML.append("\n"); - } - - java.io.FileOutputStream aStream = new java.io.FileOutputStream(aXML.getAbsolutePath(), false); - java.io.OutputStreamWriter aWriter = new java.io.OutputStreamWriter(aStream, sEncoding); - java.lang.String sOut = sXML.toString(); - aWriter.write(sOut, 0, sOut.length()); - aWriter.flush(); - aWriter.close(); - } - - //___________________________________________ - - /** converts a type property set from internal format - * to an external one. - * - * @param aMap - * points to the item, which should be converted. - * - * @param nFormat - * specify the requested output format. - * - * @return [java.util.HashMap] - * contains the properties in the requested format. - * - * @throws [java.lang.Exception - * if something fail during convertion. - */ - private static java.util.HashMap convertTypePropsToExternal(java.util.HashMap aMap , - int nFormat) - throws java.lang.Exception - { - java.util.HashMap aResultMap = new java.util.HashMap(); - // copy Name property ... if it exists! - if (aMap.containsKey(PROPNAME_NAME)) - aResultMap.put(PROPNAME_NAME, aMap.get(PROPNAME_NAME)); - switch(nFormat) - { - //----------------------------------- - case FORMAT_60 : - { - // copy UIName property unchanged - aResultMap.put(PROPNAME_UINAME, aMap.get(PROPNAME_UINAME)); - - // ignore properties "UIOrder", "PreferredFilter", "DetectService" - // They are not supported for 6.0 types. - - // pack all other properties to one "Data" string value - java.lang.StringBuffer sData = new java.lang.StringBuffer(256); - - sData.append(aMap.get(PROPNAME_PREFERRED)); - sData.append(","); - sData.append(aMap.get(PROPNAME_MEDIATYPE)); - sData.append(","); - sData.append(aMap.get(PROPNAME_CLIPBOARDFORMAT)); - sData.append(","); - - java.util.Vector lList = (java.util.Vector)aMap.get(PROPNAME_URLPATTERN); - int c = lList.size(); - int i = 0; - for (i=0; i aExpandedMap["UIName"] - * aMap["Data" ] => aExpandedMap["Preferred" ], aExpandedMap["MediaType"] etc. ... - * - * @param aMap - * points to the item, which should be converted. - - * @param nFormat - * specify the external format. - * - * @return [java.util.HashMap] - * The new map in internal format. - */ - private static java.util.HashMap convertTypePropsToInternal(java.util.HashMap aMap , - int nFormat) - throws java.lang.Exception - { - java.util.HashMap aResultMap = new java.util.HashMap(); - // copy Name property ... if it exists! - if (aMap.containsKey(PROPNAME_NAME)) - aResultMap.put(PROPNAME_NAME, aMap.get(PROPNAME_NAME)); - switch(nFormat) - { - //----------------------------------- - case FORMAT_60 : - { - // copy UIName property unchanged! - aResultMap.put(PROPNAME_UINAME, aMap.get(PROPNAME_UINAME)); - - // generate new property "UIOrder" - // Its the moved property "Order" of filters for versions >= 6.y! - aResultMap.put(PROPNAME_UIORDER, new java.lang.Integer(0)); - - // generate new property "PreferredFilter" - // Its a the moved filter flag "Preferred" for versions >= 6.y! - aResultMap.put(PROPNAME_PREFERREDFILTER, new java.lang.String()); - - // generate new property "DetectService" - // Every type know its detector diretcly from now. No search - // will be neccessary any longer. - aResultMap.put(PROPNAME_DETECTSERVICE, new java.lang.String()); - - // analyze the Data property of the original map - // and copy its results (means all expanded properties) - // to the result map. - java.lang.String sDataVal = (java.lang.String)aMap.get(PROPNAME_DATA); - java.util.Vector lTokens = Cache.splitTokenString(sDataVal, ","); - - int t = 0; - java.util.Enumeration it = lTokens.elements(); - while (it.hasMoreElements()) - { - java.lang.String sToken = (java.lang.String)it.nextElement(); - switch(t) - { - case 0 : - aResultMap.put(PROPNAME_PREFERRED, new java.lang.Boolean(sToken)); - break; - case 1 : - aResultMap.put(PROPNAME_MEDIATYPE, sToken); - break; - case 2 : - { - /*HACK ersetze %20 mit " " ...*/ - int ni = sToken.indexOf("%20"); - if (ni!=-1) - { - java.lang.String sPatch = sToken.substring(0,ni) + " " + sToken.substring(ni+3); - sToken = sPatch; - } - aResultMap.put(PROPNAME_CLIPBOARDFORMAT, sToken); - } - break; - case 3 : - aResultMap.put(PROPNAME_URLPATTERN, Cache.splitTokenString(sToken, ";")); - break; - case 4 : - aResultMap.put(PROPNAME_EXTENSIONS, Cache.splitTokenString(sToken, ";")); - break; - case 5 : - aResultMap.put(PROPNAME_DOCUMENTICONID, new java.lang.Integer(sToken)); - break; - default : - throw new java.lang.Exception("unsupported format for data value of a type \""+aMap.get(PROPNAME_NAME)+"\" detected."); - } - ++t; - } - } - break; - - //----------------------------------- - case FORMAT_6Y : - { - // copy all supported properties directly - aResultMap.put(PROPNAME_PREFERRED , aMap.get(PROPNAME_PREFERRED )); - aResultMap.put(PROPNAME_MEDIATYPE , aMap.get(PROPNAME_MEDIATYPE )); - aResultMap.put(PROPNAME_CLIPBOARDFORMAT, aMap.get(PROPNAME_CLIPBOARDFORMAT)); - aResultMap.put(PROPNAME_URLPATTERN , aMap.get(PROPNAME_URLPATTERN )); - aResultMap.put(PROPNAME_EXTENSIONS , aMap.get(PROPNAME_EXTENSIONS )); - aResultMap.put(PROPNAME_DOCUMENTICONID , aMap.get(PROPNAME_DOCUMENTICONID )); - aResultMap.put(PROPNAME_UINAME , aMap.get(PROPNAME_UINAME )); - aResultMap.put(PROPNAME_UIORDER , aMap.get(PROPNAME_UIORDER )); - aResultMap.put(PROPNAME_PREFERREDFILTER, aMap.get(PROPNAME_PREFERREDFILTER)); - aResultMap.put(PROPNAME_DETECTSERVICE , aMap.get(PROPNAME_DETECTSERVICE )); - } - break; - - //----------------------------------- - default : - throw new java.lang.Exception("unknown format"); - } - - return aResultMap; - } - - //___________________________________________ - - /** converts a filter property set (using an external format) to - * our internal cache format. - * - * Especialy the data format string will be expanded - * to its real properties. - * - * Schema: - * aMap["UIName"] => aExpandedMap["UIName"] - * aMap["Data" ] => aExpandedMap["Order" ], aExpandedMap["Flags"] etc. ... - * - * @param aMap - * points to the item, which should be converted. - * - * @param nFormat - * specify the external format. - * - * @return [java.util.HashMap] - * The new map in internal format. - */ - private static java.util.HashMap convertFilterPropsToInternal(java.util.HashMap aMap , - int nFormat) - throws java.lang.Exception - { - java.util.HashMap aResultMap = new java.util.HashMap(); - // copy Name property ... if it exists! - if (aMap.containsKey(PROPNAME_NAME)) - aResultMap.put(PROPNAME_NAME, aMap.get(PROPNAME_NAME)); - switch(nFormat) - { - //----------------------------------- - case FORMAT_60 : - { - // copy UIName property - aResultMap.put(PROPNAME_UINAME, aMap.get(PROPNAME_UINAME)); - - // analyze the Data property of the original map - // and copy its results (means all expanded properties) - // to the result map. - java.lang.String sDataVal = (java.lang.String)aMap.get(PROPNAME_DATA); - java.util.Vector lTokens = Cache.splitTokenString(sDataVal, ","); - - int t = 0; - java.util.Enumeration it = lTokens.elements(); - while (it.hasMoreElements()) - { - java.lang.String sToken = (java.lang.String)it.nextElement(); - switch(t) - { - case 0 : - aResultMap.put(PROPNAME_ORDER, new java.lang.Integer(sToken)); - break; - case 1 : - aResultMap.put(PROPNAME_TYPE, sToken); - break; - case 2 : - aResultMap.put(PROPNAME_DOCUMENTSERVICE, sToken); - break; - case 3 : - aResultMap.put(PROPNAME_FILTERSERVICE, sToken); - break; - case 4 : - aResultMap.put(PROPNAME_FLAGS, new java.lang.Integer(sToken)); - break; - case 5 : - aResultMap.put(PROPNAME_USERDATA, Cache.splitTokenString(sToken, ";")); - break; - case 6 : - aResultMap.put(PROPNAME_FILEFORMATVERSION, new java.lang.Integer(sToken)); - break; - case 7 : - aResultMap.put(PROPNAME_TEMPLATENAME, sToken); - break; - case 8 : - aResultMap.put(PROPNAME_UICOMPONENT, sToken); - break; - default : - throw new java.lang.Exception("unsupported format for data value of a filter detected."); - } - ++t; - } - - // its an optional property :-) - if (!aResultMap.containsKey(PROPNAME_TEMPLATENAME)) - aResultMap.put(PROPNAME_TEMPLATENAME, new java.lang.String("")); - - // its an optional property :-) - if (!aResultMap.containsKey(PROPNAME_UICOMPONENT)) - aResultMap.put(PROPNAME_UICOMPONENT, new java.lang.String("")); - } - break; - - //----------------------------------- - case FORMAT_6Y : - { - // "Order" does not exist for 6.y versions! Use default. - aResultMap.put(PROPNAME_ORDER, new java.lang.Integer(0)); - - // "UIName" property does not exist for 6.y versions! use default. - /* TODO make it configurable :-) */ - aResultMap.put(PROPNAME_UINAME, aMap.get(PROPNAME_UINAME)); - //aResultMap.put(PROPNAME_UINAME, new java.util.HashMap()); - - // "Flags" must be converted from names to its values - java.util.Vector lFlags = (java.util.Vector)aMap.get(PROPNAME_FLAGS); - java.lang.Integer nFlags = Cache.convertFilterFlagNames2Values(lFlags); - aResultMap.put(PROPNAME_FLAGS, nFlags); - - // copy all direct supported properties - aResultMap.put(PROPNAME_TYPE , aMap.get(PROPNAME_TYPE )); - aResultMap.put(PROPNAME_DOCUMENTSERVICE , aMap.get(PROPNAME_DOCUMENTSERVICE )); - aResultMap.put(PROPNAME_FILTERSERVICE , aMap.get(PROPNAME_ORDER )); - aResultMap.put(PROPNAME_USERDATA , aMap.get(PROPNAME_USERDATA )); - aResultMap.put(PROPNAME_FILEFORMATVERSION, aMap.get(PROPNAME_FILEFORMATVERSION)); - aResultMap.put(PROPNAME_TEMPLATENAME , aMap.get(PROPNAME_TEMPLATENAME )); - aResultMap.put(PROPNAME_UICOMPONENT , aMap.get(PROPNAME_UICOMPONENT )); - } - break; - - //----------------------------------- - default : - throw new java.lang.Exception("unknown format"); - } - - return aResultMap; - } - - private static java.util.HashMap convertDetectServicePropsToInternal(java.util.HashMap aMap , - int nFormat) - throws java.lang.Exception - { - /*FIXME*/ - java.util.HashMap aResultMap = aMap; - return aResultMap; - } - - private static java.util.HashMap convertFrameLoaderPropsToInternal(java.util.HashMap aMap , - int nFormat) - throws java.lang.Exception - { - /*FIXME*/ - java.util.HashMap aResultMap = aMap; - return aResultMap; - } - - private static java.util.HashMap convertContentHandlerPropsToInternal(java.util.HashMap aMap , - int nFormat) - throws java.lang.Exception - { - /*FIXME*/ - java.util.HashMap aResultMap = aMap; - return aResultMap; - } - - //___________________________________________ - - /** converts filter flag names to its int representation. - * - * @param lFlags - * a list of flag names. - * - * @return [java.lang.Integer] - * an integer field of all set flags. - * - * @throws [java.lang.Exception] - * for unsupported flags or empty flag fields! - */ - private static java.lang.Integer convertFilterFlagNames2Values(java.util.Vector lFlags) - throws java.lang.Exception - { - int nFlags = 0; - java.util.Enumeration it = lFlags.elements(); - while(it.hasMoreElements()) - { - java.lang.String sFlagName = (java.lang.String)it.nextElement(); - - if (sFlagName.equals(FLAGNAME_3RDPARTYFILTER)) - nFlags |= FLAGVAL_3RDPARTYFILTER; - else - if (sFlagName.equals(FLAGNAME_ALIEN)) - nFlags |= FLAGVAL_ALIEN; - else - if (sFlagName.equals(FLAGNAME_ASYNCHRON)) - nFlags |= FLAGVAL_ASYNCHRON; - else - if (sFlagName.equals(FLAGNAME_BROWSERPREFERRED)) - nFlags |= FLAGVAL_BROWSERPREFERRED; - else - if (sFlagName.equals(FLAGNAME_CONSULTSERVICE)) - nFlags |= FLAGVAL_CONSULTSERVICE; - else - if (sFlagName.equals(FLAGNAME_DEFAULT)) - nFlags |= FLAGVAL_DEFAULT; - else - if (sFlagName.equals(FLAGNAME_EXPORT)) - nFlags |= FLAGVAL_EXPORT; - else - if (sFlagName.equals(FLAGNAME_IMPORT)) - nFlags |= FLAGVAL_IMPORT; - else - if (sFlagName.equals(FLAGNAME_INTERNAL)) - nFlags |= FLAGVAL_INTERNAL; - else - if (sFlagName.equals(FLAGNAME_NOTINCHOOSER)) - nFlags |= FLAGVAL_NOTINCHOOSER; - else - if (sFlagName.equals(FLAGNAME_NOTINFILEDIALOG)) - nFlags |= FLAGVAL_NOTINFILEDIALOG; - else - if (sFlagName.equals(FLAGNAME_NOTINSTALLED)) - nFlags |= FLAGVAL_NOTINSTALLED; - else - if (sFlagName.equals(FLAGNAME_OWN)) - nFlags |= FLAGVAL_OWN; - else - if (sFlagName.equals(FLAGNAME_PACKED)) - nFlags |= FLAGVAL_PACKED; - else - if (sFlagName.equals(FLAGNAME_PREFERRED)) - nFlags |= FLAGVAL_PREFERRED; - else - if (sFlagName.equals(FLAGNAME_READONLY)) - nFlags |= FLAGVAL_READONLY; - else - if (sFlagName.equals(FLAGNAME_SILENTEXPORT)) - nFlags |= FLAGVAL_SILENTEXPORT; - else - if (sFlagName.equals(FLAGNAME_TEMPLATE)) - nFlags |= FLAGVAL_TEMPLATE; - else - if (sFlagName.equals(FLAGNAME_TEMPLATEPATH)) - nFlags |= FLAGVAL_TEMPLATEPATH; - else - if (sFlagName.equals(FLAGNAME_USESOPTIONS)) - nFlags |= FLAGVAL_USESOPTIONS; - else - if (sFlagName.equals(FLAGNAME_COMBINED)) - nFlags |= FLAGVAL_COMBINED; - else - throw new java.lang.Exception("unsupported filter flag detected: \""+sFlagName+"\""); - } - - if (nFlags == 0) - throw new java.lang.Exception("no filter flags?"); - - return new java.lang.Integer(nFlags); - } - - //___________________________________________ - - /** converts filter flag values to its string representation. - * - * @param nFlags - * the flag field as int value. - * - * @return [java.util.Vector] - * a list of flag names. - * - * @throws [java.lang.Exception] - * for unsupported flags or empty flag fields! - */ - private static java.util.Vector convertFilterFlagValues2Names(java.lang.Integer nFlags) - throws java.lang.Exception - { - java.util.Vector lFlags = new java.util.Vector(); - int field = nFlags.intValue(); - - if (field == 0) - throw new java.lang.Exception("no filter flags?"); - - if((field & FLAGVAL_IMPORT) == FLAGVAL_IMPORT) - lFlags.add(FLAGNAME_IMPORT); - - if((field & FLAGVAL_EXPORT) == FLAGVAL_EXPORT) - lFlags.add(FLAGNAME_EXPORT); - - if((field & FLAGVAL_TEMPLATE) == FLAGVAL_TEMPLATE) - lFlags.add(FLAGNAME_TEMPLATE); - - if((field & FLAGVAL_INTERNAL) == FLAGVAL_INTERNAL) - lFlags.add(FLAGNAME_INTERNAL); - - if((field & FLAGVAL_TEMPLATEPATH) == FLAGVAL_TEMPLATEPATH) - lFlags.add(FLAGNAME_TEMPLATEPATH); - - if((field & FLAGVAL_OWN) == FLAGVAL_OWN) - lFlags.add(FLAGNAME_OWN); - - if((field & FLAGVAL_ALIEN) == FLAGVAL_ALIEN) - lFlags.add(FLAGNAME_ALIEN); - - if((field & FLAGVAL_USESOPTIONS) == FLAGVAL_USESOPTIONS) - lFlags.add(FLAGNAME_USESOPTIONS); - - if((field & FLAGVAL_DEFAULT) == FLAGVAL_DEFAULT) - lFlags.add(FLAGNAME_DEFAULT); - - if((field & FLAGVAL_NOTINFILEDIALOG) == FLAGVAL_NOTINFILEDIALOG) - lFlags.add(FLAGNAME_NOTINFILEDIALOG); - - if((field & FLAGVAL_NOTINCHOOSER) == FLAGVAL_NOTINCHOOSER) - lFlags.add(FLAGNAME_NOTINCHOOSER); - - if((field & FLAGVAL_ASYNCHRON) == FLAGVAL_ASYNCHRON) - lFlags.add(FLAGNAME_ASYNCHRON); - - if((field & FLAGVAL_READONLY) == FLAGVAL_READONLY) - lFlags.add(FLAGNAME_READONLY); - - if((field & FLAGVAL_NOTINSTALLED) == FLAGVAL_NOTINSTALLED) - lFlags.add(FLAGNAME_NOTINSTALLED); - - if((field & FLAGVAL_CONSULTSERVICE) == FLAGVAL_CONSULTSERVICE) - lFlags.add(FLAGNAME_CONSULTSERVICE); - - if((field & FLAGVAL_3RDPARTYFILTER) == FLAGVAL_3RDPARTYFILTER) - lFlags.add(FLAGNAME_3RDPARTYFILTER); - - if((field & FLAGVAL_PACKED) == FLAGVAL_PACKED) - lFlags.add(FLAGNAME_PACKED); - - if((field & FLAGVAL_SILENTEXPORT) == FLAGVAL_SILENTEXPORT) - lFlags.add(FLAGNAME_SILENTEXPORT); - - if((field & FLAGVAL_BROWSERPREFERRED) == FLAGVAL_BROWSERPREFERRED) - lFlags.add(FLAGNAME_BROWSERPREFERRED); - - if((field & FLAGVAL_PREFERRED) == FLAGVAL_PREFERRED) - lFlags.add(FLAGNAME_PREFERRED); - - if((field & FLAGVAL_COMBINED) == FLAGVAL_COMBINED) - lFlags.add(FLAGNAME_COMBINED); - - if((field & FLAGVAL_COMBINED) == FLAGVAL_SUPPORTSSELECTION) - lFlags.add(FLAGNAME_SUPPORTSSELECTION); - - return lFlags; - } - - //___________________________________________ - - /** return a reference to one of our member - * lists for types/filters etc ... - * - * @param eItemType - * specify, which item map is required. - * - * @return [java.util.HashMap] - * a reference(!) to the right member. - * - * @throws [java.lang.Exception] - * if the specified map does not exist. - */ - private java.util.HashMap getItemMap(int eItemType) - throws java.lang.Exception - { - java.util.HashMap rMap = null; - switch(eItemType) - { - case E_TYPE : - rMap = m_lTypes; - break; - - case E_FILTER : - rMap = m_lFilters; - break; - - case E_DETECTSERVICE : - rMap = m_lDetectServices; - break; - - case E_FRAMELOADER : - rMap = m_lFrameLoaders; - break; - - case E_CONTENTHANDLER : - rMap = m_lContentHandlers; - break; - - default: - throw new java.lang.Exception("Invalid item map specified."); - } - return rMap; - } - - //___________________________________________ - - /** return the count of items inside a sub container - * of this cache. - * - * @param eItemType - * specify, which item map is required. - * - * @throws [java.lang.Exception] - * if the specified map does not exist. - */ - public synchronized int getItemCount(int eItemType) - throws java.lang.Exception - { - java.util.HashMap rMap = getItemMap(eItemType); - return rMap.size(); - } - - //___________________________________________ - - /** get a list of all item names of the specified - * sub container. - * - * @param eItemType - * specify, which item map is required. - * - * @throws [java.lang.Exception] - * if the specified map does not exist. - */ - public synchronized java.util.Vector getItemNames(int eItemType) - throws java.lang.Exception - { - java.util.Vector lNames = new java.util.Vector(); - java.util.HashMap rMap = getItemMap(eItemType); - java.util.Iterator it = rMap.keySet().iterator(); - while(it.hasNext()) - lNames.add(it.next()); - return lNames; - } - - //___________________________________________ - - /** get a list of all item names of the specified - * sub coontainer, where items match to given property set. - * - * Note: The given property set must exist at all - * returned items as minimum and every checked property - * value must be equals! Using of reg expressions or - * similar mechanism will not be supported here. - * - * @param eItemType - * specify, which item map is required. - * - * @param aPropSet - * the set of properties, which must - * exist at the returned item as minimum. - * - * @throws [java.lang.Exception] - * if the specified map does not exist. - */ - public synchronized java.util.Vector getMatchedItemNames(int eItemType, - java.util.HashMap aPropSet ) - throws java.lang.Exception - { - java.util.Vector lNames = new java.util.Vector(); - java.util.HashMap rMap = getItemMap(eItemType); - java.util.Iterator it = rMap.keySet().iterator(); - while(it.hasNext()) - { - java.lang.String sItemName = (java.lang.String)it.next(); - java.util.HashMap rItemProps = (java.util.HashMap)rMap.get(sItemName); - - boolean bMatch = Cache.matchPropSet(rItemProps, aPropSet); - if (bMatch) - lNames.add(sItemName); - else - { - java.lang.StringBuffer sBuffer = new java.lang.StringBuffer(1000); - sBuffer.append("entry ["+eItemType+"] \""+sItemName+"\" does not match.\n"); - sBuffer.append("\torg items = {"+rItemProps+"}\n"); - sBuffer.append("\treq items = {"+aPropSet+"}\n"); - - m_aDebug.setDetailedInfo(sBuffer.toString()); - } - } - return lNames; - } - - //___________________________________________ - - /** check if two property sets are equals in its - * shared properties. - * - * Note: Only set properties of the match set will be searched - * inside the original set. And its values must be equals. - * Using of reg expressions or similar mechanism will not - * be supported here. - * - * @param rOrgProps - * the original property set, which should be checked. - * - * @param rMatchProps - * contains the properties, which must be searched - * inside rOrgProps. - * - * @return TRUE if all properties of rMatchProps could be located - * inside rOrgProps. - */ - private static boolean matchPropSet(java.util.HashMap rOrgProps , - java.util.HashMap rMatchProps) - { - java.util.Iterator it = rMatchProps.keySet().iterator(); - while(it.hasNext()) - { - java.lang.String sMatchName = (java.lang.String)it.next(); - java.lang.Object aMatchValue = rMatchProps.get(sMatchName); - - if ( - (!rOrgProps.containsKey(sMatchName) ) || - (!rOrgProps.get(sMatchName).equals(aMatchValue)) - ) - { - return false; - } - } - return true; - } - - //___________________________________________ - - /** return a property set for the queried container item. - * - * @param eItemType - * specify, which item map is required. - * - * @param sItemName - * must be a valid item name of the specified item map. - * - * @return [java.util.HashMap] - * the property set of the queried item. - * Always different from null! - * - * @throws [java.lang.Exception] - * if the specified item does not exists or - * seems to be invalid in general (means null!). - */ - public synchronized java.util.HashMap getItem(int eItemType, - java.lang.String sItemName) - throws java.lang.Exception - { - java.util.HashMap rMap = getItemMap(eItemType); - java.util.HashMap rItem = (java.util.HashMap)rMap.get(sItemName); - if (rItem == null) - throw new java.lang.Exception("Queried item \""+sItemName+"\" does not exist inside this cache."); - return rItem; - } - - //___________________________________________ - - /** return a requested item in XML format. - * - * @param eItemType - * identify the right sub set of this cache - * inside which the requested item should exist. - * e.g. E_TYPE, E_FILTER, ... - * - * @param sItemName - * the name of the request item - * - * @param nXMLFormat - * means the format of the generated xml source. - * - * @return [java.lang.String] - * a xml formated string, which contains all properties - * for this container item. - */ - public synchronized java.lang.String getItemAsXML(int eItemType , - java.lang.String sItemName , - int nXMLFormat) - throws java.lang.Exception - { - // Note: Our internal format must be converted to the target format! - java.util.HashMap rItem = getItem(eItemType, sItemName); - java.util.HashMap rFormatedItem = null; - switch(eItemType) - { - case E_TYPE : - { - rFormatedItem = Cache.convertTypePropsToExternal(rItem, nXMLFormat); - m_aDebug.setGlobalInfo("type to external \""+sItemName+"\""); - } - break; - - case E_FILTER : - { - rFormatedItem = Cache.convertFilterPropsToExternal(rItem, nXMLFormat); - m_aDebug.setGlobalInfo("filter to external \""+sItemName+"\""); - } - break; - - case E_DETECTSERVICE : - { - rFormatedItem = Cache.convertDetectServicePropsToExternal(rItem, nXMLFormat); - m_aDebug.setGlobalInfo("detect service to external \""+sItemName+"\""); - } - break; - - case E_FRAMELOADER : - { - rFormatedItem = Cache.convertFrameLoaderPropsToExternal(rItem, nXMLFormat); - m_aDebug.setGlobalInfo("frame loader to external \""+sItemName+"\""); - } - break; - - case E_CONTENTHANDLER : - { - rFormatedItem = Cache.convertContentHandlerPropsToExternal(rItem, nXMLFormat); - m_aDebug.setGlobalInfo("content handler to external \""+sItemName+"\""); - } - break; - } - - java.lang.StringBuffer sXML = new java.lang.StringBuffer(1000); - int nPrettyTabs = 1; - for (int t=0; t\n"); - sXML.append(XMLHelper.convertPropSetToXML(rFormatedItem, nPrettyTabs+1)); - for (int t=0; t\n"); - - return sXML.toString(); - } - - //___________________________________________ - - /** split the given string (using the specified delimiter) - * and return alist of found string tokens. - * - * Note: Against the normal behaviour of the StringTokenizer class - * this method returns empty tokens too. - * E.g: "0,,1" will return "0" - "" - "1" - * - * @param sTokenString - * the string value, which should be analyzed. - * - * @param sDelim - * the delimiter, which will be used to differe between tokens. - * - * @return [java.util.Vector] - * a list of string tokens. Can be empty - but not null! - */ - private static java.util.Vector splitTokenString(java.lang.String sTokenString, - java.lang.String sDelim ) - { - java.util.Vector lTokens = new java.util.Vector(); - java.util.StringTokenizer aTokenizer = new java.util.StringTokenizer(sTokenString, sDelim, true); - boolean bLastWasDelim = false; - - while (aTokenizer.hasMoreTokens()) - { - java.lang.String sToken = aTokenizer.nextToken(); - if (sToken.equals(sDelim)) - { - if (bLastWasDelim) - { - // last token was a delimiter - new one too - // => an empty token must be placed between these - // two delimiters! Add this empty value to the return list. - lTokens.add(""); - } - else - { - // last token was not a delimiter - new one is such delim - // => ignore this delimiter - but save the information, that - // it occured - bLastWasDelim = true; - } - } - else - { - // new token is no delim - // => Add it to the return list. - lTokens.add(sToken); - // Dont forget to reset this information - so next loop - // will do the right things! - bLastWasDelim = false; - } - } - - return lTokens; - } - - //___________________________________________ - - /** - */ - public synchronized void analyze() - { - m_nDoubleRegisteredFilters = 0; - m_nTypesForFilters = 0; - m_nTypesForDetectServices = 0; - m_nTypesForFrameLoaders = 0; - m_nTypesForContentHandlers = 0; - - // create table of types and all registered filters for such types - // By the way: count all double registrations, where a filter - // uses the same type then another filter. - m_lFilterToTypeRegistrations = new java.util.HashMap(); - java.util.Iterator aIt1 = m_lFilters.keySet().iterator(); - while (aIt1.hasNext()) - { - java.lang.String sFilter = (java.lang.String)aIt1.next(); - java.util.HashMap aFilter = (java.util.HashMap)m_lFilters.get(sFilter); - java.lang.String sType = (java.lang.String)aFilter.get(PROPNAME_TYPE); - - java.util.Vector lFilters = (java.util.Vector)m_lFilterToTypeRegistrations.get(sType); - if (lFilters == null) - lFilters = new java.util.Vector(); - else - ++m_nDoubleRegisteredFilters; - lFilters.add(sFilter); - m_lFilterToTypeRegistrations.put(sType, lFilters); - } - - // count, how many types are used by filters, frame loaders or content handlers - aIt1 = m_lTypes.keySet().iterator(); - while (aIt1.hasNext()) - { - java.lang.String sType = (java.lang.String)aIt1.next(); - - java.util.Iterator aIt2 = m_lFilters.keySet().iterator(); - while (aIt2.hasNext()) - { - java.lang.String sItem = (java.lang.String)aIt2.next(); - java.util.HashMap aItem = (java.util.HashMap)m_lFilters.get(sItem); - java.lang.String sTypeReg = (java.lang.String)aItem.get(PROPNAME_TYPE); - - if (sTypeReg.equals(sType)) - { - ++m_nTypesForFilters; - break; - } - } - - aIt2 = m_lDetectServices.keySet().iterator(); - while (aIt2.hasNext()) - { - java.lang.String sItem = (java.lang.String)aIt2.next(); - java.util.HashMap aItem = (java.util.HashMap)m_lDetectServices.get(sItem); - java.util.Vector lTypeReg = (java.util.Vector)aItem.get(PROPNAME_TYPES); - - if (lTypeReg.contains(sType)) - { - ++m_nTypesForDetectServices; - break; - } - } - - aIt2 = m_lFrameLoaders.keySet().iterator(); - while (aIt2.hasNext()) - { - java.lang.String sItem = (java.lang.String)aIt2.next(); - java.util.HashMap aItem = (java.util.HashMap)m_lFrameLoaders.get(sItem); - java.util.Vector lTypeReg = (java.util.Vector)aItem.get(PROPNAME_TYPES); - - if (lTypeReg.contains(sType)) - { - ++m_nTypesForFrameLoaders; - break; - } - } - - aIt2 = m_lContentHandlers.keySet().iterator(); - while (aIt2.hasNext()) - { - java.lang.String sItem = (java.lang.String)aIt2.next(); - java.util.HashMap aItem = (java.util.HashMap)m_lContentHandlers.get(sItem); - java.util.Vector lTypeReg = (java.util.Vector)aItem.get(PROPNAME_TYPES); - - if (lTypeReg.contains(sType)) - { - ++m_nTypesForContentHandlers; - break; - } - } - } - } - - //___________________________________________ - - /** validate all cache entries. - * - * It checks if all made registrations are valid; - * try to repair some simple problems; - * create missing informations on demand ... - * - * @param nFormat - * specify, which configuration format - * must be checked. - * - * @throws [java.lang.Exception] - * if an unrecoverable problem occure. - */ - public synchronized void validate(int nFormat) - throws java.lang.Exception - { - validateTypes(nFormat); - validateFilters(nFormat); - } - - //___________________________________________ - - /** validate all type entries of this cache. - * - * @param nFormat - * specify, which configuration format - * must be checked. - * - * @throws [java.lang.Exception] - * if an unrecoverable problem occure. - */ - private void validateTypes(int nFormat) - throws java.lang.Exception - { - java.util.Iterator aIt1 = m_lTypes.keySet().iterator(); - while(aIt1.hasNext()) - { - java.lang.String sType = (java.lang.String)aIt1.next(); - java.util.HashMap aType = (java.util.HashMap)m_lTypes.get(sType); - if (aType == null) - throw new java.lang.Exception("type ["+sType+"] dos not exist realy?!"); - - if ( - (!aType.containsKey(PROPNAME_MEDIATYPE )) || - (!aType.containsKey(PROPNAME_PREFERRED )) || - (!aType.containsKey(PROPNAME_CLIPBOARDFORMAT)) || - (!aType.containsKey(PROPNAME_DOCUMENTICONID )) || - (!aType.containsKey(PROPNAME_URLPATTERN )) || - (!aType.containsKey(PROPNAME_EXTENSIONS )) || - (!aType.containsKey(PROPNAME_UINAME )) - ) - { - throw new java.lang.Exception("Type \""+sType+"\" does not contain all neccessary properties for a 6.0/6.Y format."); - } - - if ( - (((java.util.Vector)aType.get(PROPNAME_EXTENSIONS)).isEmpty()) && - (((java.util.Vector)aType.get(PROPNAME_URLPATTERN)).isEmpty()) - ) - { - throw new java.lang.Exception("Type \""+sType+"\" does not contain any extension nor an url pattern."); - } - - if (((java.util.HashMap)aType.get(PROPNAME_UINAME)).isEmpty()) - throw new java.lang.Exception("Type \""+sType+"\" is not localized."); - - if (nFormat == FORMAT_6Y) - { - if ( - (!aType.containsKey(PROPNAME_UIORDER )) || - (!aType.containsKey(PROPNAME_PREFERREDFILTER)) || - (!aType.containsKey(PROPNAME_DETECTSERVICE )) - ) - { - throw new java.lang.Exception("Type \""+sType+"\" does not contain all neccessary properties for a 6.Y format."); - } - - if (((java.lang.Integer)aType.get(PROPNAME_UIORDER)).intValue() < 0) - throw new java.lang.Exception("Type \""+sType+"\" has invalid value for prop UIOrder."); - - if (((java.lang.String)aType.get(PROPNAME_DETECTSERVICE)).length() < 1) - m_aDebug.setWarning("Type \""+sType+"\" has no detect service registered."); - - java.lang.String sPreferredReg = (java.lang.String)aType.get(PROPNAME_PREFERREDFILTER); - if ( - (sPreferredReg == null) || - (sPreferredReg.length() < 1 ) - ) - { - m_aDebug.setWarning("Type \""+sType+"\" has no preferred filter ..."); - /*FIXME - * OK - not every type has a filter registered .. but the - * a frame loader MUST(!) exist! Check it. - */ - } - else - { - if (!m_lFilters.containsKey(sPreferredReg)) - throw new java.lang.Exception("Type \""+sType+"\" has no valid preferred filter registration [\""+sPreferredReg+"\"]."); - } - } - } - } - - //___________________________________________ - - /** validate all filter entries of this cache. - * - * @param nFormat - * specify, which configuration format - * must be checked. - * - * @throws [java.lang.Exception] - * if an unrecoverable problem occure. - */ - public synchronized void validateFilters(int nFormat) - throws java.lang.Exception - { - java.util.Iterator aIt1 = m_lFilters.keySet().iterator(); - while(aIt1.hasNext()) - { - java.lang.String sFilter = (java.lang.String)aIt1.next(); - java.util.HashMap aFilter = (java.util.HashMap)m_lFilters.get(sFilter); - if (aFilter == null) - throw new java.lang.Exception("filter ["+sFilter+"] dos not exist realy?!"); - - if ( - (!aFilter.containsKey(PROPNAME_DOCUMENTSERVICE )) || - (!aFilter.containsKey(PROPNAME_FILEFORMATVERSION)) || - (!aFilter.containsKey(PROPNAME_FILTERSERVICE )) || - (!aFilter.containsKey(PROPNAME_FLAGS )) || - (!aFilter.containsKey(PROPNAME_TEMPLATENAME )) || - (!aFilter.containsKey(PROPNAME_TYPE )) || - (!aFilter.containsKey(PROPNAME_UICOMPONENT )) || - (!aFilter.containsKey(PROPNAME_USERDATA )) - ) - { - throw new java.lang.Exception("Filter \""+sFilter+"\" does not contain all neccessary properties for a 6.0/6.Y format."); - } - - if (((java.lang.Integer)aFilter.get(PROPNAME_FLAGS)).intValue() < 1) - throw new java.lang.Exception("Filter \""+sFilter+"\" does not have a valid flag field."); - - if (!m_lTypes.containsKey(aFilter.get(PROPNAME_TYPE))) - throw new java.lang.Exception("Filter \""+sFilter+"\" is not registered for a well known type."); - - if (nFormat == FORMAT_60) - { - if ( - (!aFilter.containsKey(PROPNAME_ORDER )) || - (!aFilter.containsKey(PROPNAME_UINAME)) - ) - { - throw new java.lang.Exception("Filter \""+sFilter+"\" does not contain all neccessary properties for a 6.0 format."); - } - - if (((java.lang.Integer)aFilter.get(PROPNAME_ORDER)).intValue() < 0) - throw new java.lang.Exception("Filter \""+sFilter+"\" does not have a valid Order value."); - - if (((java.util.HashMap)aFilter.get(PROPNAME_UINAME)).isEmpty()) - throw new java.lang.Exception("Filter \""+sFilter+"\" is not localized."); - } -/*TODO - depends from the configuration item "remove_filter_flag_preferred" ... - - if (nFormat == FORMAT_6Y) - { - int flags = ((java.lang.Integer)aFilter.get(PROPNAME_FLAGS)).intValue(); - if ((flags & FLAGVAL_PREFERRED) == FLAGVAL_PREFERRED) - throw new java.lang.Exception("Filter \""+sFilter+"\" has superflous Preferred flag set. Please remove this flag. ["+flags+"]"); - } -*/ - } - } - - /*TODO - * - remove graphic filters! - * - move detect services to types - */ - - public synchronized void transform60to6Y(boolean bCreateCombineFilterFlag , - boolean bRemoveFilterFlagBrowserPreferred, - boolean bRemoveFilterFlagPreferred , - boolean bRemoveFilterFlag3rdparty , - boolean bRemoveFilterUINames , - boolean bRemoveGraphicFilters , - boolean bSetDefaultDetector ) - throws java.lang.Exception - { - // remove some superflous cache entries ... - // everything related to "load macros" - // Macros should be dispatched instead of loaded! - if (m_lTypes.containsKey("macro")) - { - m_lTypes.remove("macro"); - m_aDebug.setDetailedInfo("superflous type \"macro\" was removed"); - } - if (m_lFrameLoaders.containsKey("com.sun.star.comp.sfx2.SfxMacroLoader")) - { - m_lFrameLoaders.remove("com.sun.star.comp.sfx2.SfxMacroLoader"); - m_aDebug.setDetailedInfo("superflous frame loader \"com.sun.star.comp.sfx2.SfxMacroLoader\" was removed"); - } - - // step over all filters and check her properties and references - java.util.Vector lPreferredFilters = new java.util.Vector(); - java.util.Vector lNoRealFilters = new java.util.Vector(); - java.util.Iterator aIt1 = m_lFilters.keySet().iterator(); - while(aIt1.hasNext()) - { - java.lang.String sFilter = (java.lang.String)aIt1.next(); - java.util.HashMap aFilter = (java.util.HashMap)m_lFilters.get(sFilter); - - // remove the "graphic helper filters" used by draw and impress - // They dont have any valid document service name set and cant be handled - // by our generic FrameLoader! - // They must be moved to her own configuration ... - - if ( - (bRemoveGraphicFilters ) && - (((java.lang.String)aFilter.get(PROPNAME_DOCUMENTSERVICE)).length() < 1) - ) - { - lNoRealFilters.add(sFilter); - continue; - } - - java.lang.String sTypeReg = (java.lang.String)aFilter.get(PROPNAME_TYPE); - java.util.HashMap aType = (java.util.HashMap)m_lTypes.get(sTypeReg); - - // move UINames of filters to types - java.util.HashMap lFilterUINames = (java.util.HashMap)aFilter.get(PROPNAME_UINAME); - java.util.HashMap lTypeUINames = (java.util.HashMap)aType.get(PROPNAME_UINAME); - java.util.HashMap lPatchUINames = new java.util.HashMap(); - - java.util.Iterator pUINames = lTypeUINames.keySet().iterator(); - while(pUINames.hasNext()) - { - java.lang.String sLocale = (java.lang.String)pUINames.next(); - java.lang.String sValue = (java.lang.String)lTypeUINames.get(sLocale); - lPatchUINames.put(sLocale, sValue); - } - - pUINames = lFilterUINames.keySet().iterator(); - while(pUINames.hasNext()) - { - java.lang.String sLocale = (java.lang.String)pUINames.next(); - java.lang.String sValue = (java.lang.String)lFilterUINames.get(sLocale); - lPatchUINames.put(sFilter+":"+sLocale, sValue); - } - aType.put(PROPNAME_UINAME, lPatchUINames); - - // set generic filter service wrapper for our own native filters! - // By the way: The format types of such filters can be detected by our - // generic detector too. - if ( - (bSetDefaultDetector ) && - (((java.lang.String)aFilter.get(PROPNAME_FILTERSERVICE)).length() < 1) - ) - { - /*ME_THINKING aFilter.put(PROPNAME_FILTERSERVICE, FILTERSERVICE_NATIVEWARPPER);*/ - aType.put(PROPNAME_DETECTSERVICE, GENERIC_DETECTSERVICE); - } - - // move the preferred filter information to any type - // Set the filter name to the type for which the filter is registered. - // If this type already have a set PreferredFilter value, check if the current filter - // has the preferred flag set. If not ignore it - otherwhise overwrite the - // current information at the type. But look for multiple preferred filter relations ... - // means: look if more the one filter has set the preferred flag for the same type! - - /* Attention! - * - * Dont remove the preferred flag from any filter! ... not here. - * Otherwhise next loop can't detect ambigous preferred registrations! - * Add filter to a temp. list, which can be used later to remove the preferred - * flag ... - */ - - int flags1 = ((java.lang.Integer)aFilter.get(PROPNAME_FLAGS)).intValue(); - java.lang.String sDocSrv = (java.lang.String)aFilter.get(PROPNAME_DOCUMENTSERVICE); - if (sDocSrv.length()>0)// without a doc service its not a real filter - its a graphic filter! - { - boolean preferred1 = ((flags1 & FLAGVAL_PREFERRED) == FLAGVAL_PREFERRED); - if (preferred1) - lPreferredFilters.add(aFilter); - - java.lang.String sAlreadyRegisteredFilter = (java.lang.String)aType.get(PROPNAME_PREFERREDFILTER); - // no registration => set this filter as "any possible one"! - if (sAlreadyRegisteredFilter.length() < 1) - aType.put(PROPNAME_PREFERREDFILTER, sFilter); - else - { - java.util.HashMap aAlreadyRegisteredFilter = (java.util.HashMap)m_lFilters.get(sAlreadyRegisteredFilter); - int flags2 = ((java.lang.Integer)aAlreadyRegisteredFilter.get(PROPNAME_FLAGS)).intValue(); - boolean preferred2 = ((flags2 & FLAGVAL_PREFERRED) == FLAGVAL_PREFERRED); - - // two preferred filters for the same type! => error - if (preferred1 && preferred2) - { - java.lang.StringBuffer sMsg = new java.lang.StringBuffer(256); - sMsg.append("More the one preferred filter detected for the same type.\n"); - sMsg.append("\ttype = \""+sTypeReg+"\"\n"); - sMsg.append("\tfilter[1] = \""+sAlreadyRegisteredFilter+"\"\n"); - sMsg.append("\tfilter[2] = \""+sFilter+"\"\n"); - throw new java.lang.Exception(sMsg.toString()); - } - else - // overwrite the "any possible" filter with a real preferred one - if (preferred1 && !preferred2) - aType.put(PROPNAME_PREFERREDFILTER, sFilter); - } - } - - // create the new combined filter flag if required - if (bCreateCombineFilterFlag) - { - if ( - ((flags1 & FLAGVAL_IMPORT) == FLAGVAL_IMPORT) && - ((flags1 & FLAGVAL_EXPORT) == FLAGVAL_EXPORT) - ) - { - flags1 |= FLAGVAL_COMBINED; - flags1 &= ~FLAGVAL_IMPORT ; - flags1 &= ~FLAGVAL_EXPORT ; - aFilter.put(PROPNAME_FLAGS, new java.lang.Integer(flags1)); - } - } - - // remove some obsolete filter flags - if (bRemoveFilterFlagBrowserPreferred) - { - flags1 &= ~FLAGVAL_BROWSERPREFERRED; - aFilter.put(PROPNAME_FLAGS, new java.lang.Integer(flags1)); - } - - if (bRemoveFilterFlag3rdparty) - { - flags1 &= ~FLAGVAL_3RDPARTYFILTER; - aFilter.put(PROPNAME_FLAGS, new java.lang.Integer(flags1)); - } - - // if its a filter with an UI order ... - // move this information to the registered type. - // Note: Because more then one filter can be registered for the same type. - // Handle it as an error ... till we find a better transformation! - java.lang.Integer nOrder = (java.lang.Integer)aFilter.get(PROPNAME_ORDER); - java.lang.Integer nUIOrder = (java.lang.Integer)aType.get(PROPNAME_UIORDER); - int order = nOrder.intValue(); - int uiorder = nUIOrder.intValue(); - - if (order > 0) - { - if ( - (uiorder < 1 ) || - (uiorder > order) - ) - { - aType.put(PROPNAME_UIORDER, nOrder); - m_aDebug.setDetailedInfo("moved order value "+nOrder+" from filter \""+sFilter+"\" to type \""+sTypeReg+"\""); - } - else - m_aDebug.setDetailedInfo("ignore order value [order="+nOrder+",uiorder="+nUIOrder+"] for filter \""+sFilter+"\" and type \""+sTypeReg+"\""); - } - } - - // NOW ... remove the preferred flags from every filter, which it has set. - java.util.Enumeration aIt2 = null; - if (bRemoveFilterFlagPreferred) - { - aIt2 = lPreferredFilters.elements(); - while (aIt2.hasMoreElements()) - { - java.util.HashMap aFilter = (java.util.HashMap)aIt2.nextElement(); - int flags = ((java.lang.Integer)aFilter.get(PROPNAME_FLAGS)).intValue(); - flags &= ~FLAGVAL_PREFERRED; - aFilter.put(PROPNAME_FLAGS, new java.lang.Integer(flags)); - } - } - - // NOW ... remove all "no real filters" like the graphich helper filters of - // draw and impress! - aIt2 = lNoRealFilters.elements(); - while (aIt2.hasMoreElements()) - m_lFilters.remove(aIt2.nextElement()); - - // step over all detect services and move this information directly to - // the corresponding types - // Overwrite possibel default registrations with a real existing one! - aIt1 = m_lDetectServices.keySet().iterator(); - while(aIt1.hasNext()) - { - java.lang.String sDetector = (java.lang.String)aIt1.next(); - java.util.HashMap aDetector = (java.util.HashMap)m_lDetectServices.get(sDetector); - java.util.Vector lTypeReg = (java.util.Vector)aDetector.get(PROPNAME_TYPES); - aIt2 = lTypeReg.elements(); - while(aIt2.hasMoreElements()) - { - java.lang.String sTypeReg = (java.lang.String)aIt2.nextElement(); - java.util.HashMap aType = (java.util.HashMap)m_lTypes.get(sTypeReg); - - if (aType == null) - { - m_aDebug.setWarning("Detector \""+sDetector+"\" seem to be registered for unknown type \""+sTypeReg+"\""); - continue; - } - - java.lang.Object aAlreadyRegisteredDetector = aType.get(PROPNAME_DETECTSERVICE); - if (aAlreadyRegisteredDetector != null && ((java.lang.String)aAlreadyRegisteredDetector).length() > 0) - { - java.lang.StringBuffer sMsg = new java.lang.StringBuffer(256); - sMsg.append("type \""+sTypeReg+"\" has ambigous registrations of a detect service\n"); - sMsg.append("\tdetect service[1] = \""+(java.lang.String)aAlreadyRegisteredDetector+"\"\n"); - sMsg.append("\tdetect service[2] = \""+sDetector+"\"\n"); - m_aDebug.setWarning(sMsg.toString()); - } - aType.put(PROPNAME_DETECTSERVICE, sDetector); - m_aDebug.setGlobalInfo("move detector \""+sDetector+"\" to type \""+sTypeReg+"\""); - } - } - - // because all detect service was registered as type properties directly ... - // remove all detect service objects of this cache! - m_lDetectServices.clear(); - - // step over all frame loader and move this information directly to - // the corresponding types - // Overwrite possibel default registrations with a real existing one! - aIt1 = m_lFrameLoaders.keySet().iterator(); - while(aIt1.hasNext()) - { - java.lang.String sLoader = (java.lang.String)aIt1.next(); - java.util.HashMap aLoader = (java.util.HashMap)m_lFrameLoaders.get(sLoader); - java.util.Vector lTypeReg = (java.util.Vector)aLoader.get(PROPNAME_TYPES); - aIt2 = lTypeReg.elements(); - while(aIt2.hasMoreElements()) - { - java.lang.String sTypeReg = (java.lang.String)aIt2.nextElement(); - java.util.HashMap aType = (java.util.HashMap)m_lTypes.get(sTypeReg); - java.lang.String sAlreadyRegisteredLoader = (java.lang.String)aType.get(PROPNAME_FRAMELOADER); - if (sAlreadyRegisteredLoader != null && sAlreadyRegisteredLoader.length() > 0) - { - java.lang.StringBuffer sMsg = new java.lang.StringBuffer(256); - sMsg.append("type \""+sTypeReg+"\" has ambigous registrations of a frame loader\n"); - sMsg.append("\tframe loader[1] = \""+sAlreadyRegisteredLoader+"\"\n"); - sMsg.append("\tframe loader[2] = \""+sLoader+"\"\n"); - m_aDebug.setWarning(sMsg.toString()); - } - aType.put(PROPNAME_FRAMELOADER, sLoader); - System.out.println("move loader \""+sLoader+"\" to type \""+sTypeReg+"\""); - } - } - - m_lFrameLoaders.clear(); - - // step over all content handler and move this information directly to - // the corresponding types - // Overwrite possibel default registrations with a real existing one! - aIt1 = m_lContentHandlers.keySet().iterator(); - while(aIt1.hasNext()) - { - java.lang.String sHandler = (java.lang.String)aIt1.next(); - java.util.HashMap aHandler = (java.util.HashMap)m_lContentHandlers.get(sHandler); - java.util.Vector lTypeReg = (java.util.Vector)aHandler.get(PROPNAME_TYPES); - aIt2 = lTypeReg.elements(); - while(aIt2.hasMoreElements()) - { - java.lang.String sTypeReg = (java.lang.String)aIt2.nextElement(); - java.util.HashMap aType = (java.util.HashMap)m_lTypes.get(sTypeReg); - java.lang.String sAlreadyRegisteredHandler = (java.lang.String)aType.get(PROPNAME_CONTENTHANDLER); - if (sAlreadyRegisteredHandler != null && sAlreadyRegisteredHandler.length() > 0) - { - java.lang.StringBuffer sMsg = new java.lang.StringBuffer(256); - sMsg.append("type \""+sTypeReg+"\" has ambigous registrations of a content handler\n"); - sMsg.append("\tcontent handler[1] = \""+sAlreadyRegisteredHandler+"\"\n"); - sMsg.append("\tcontent handler[2] = \""+sHandler+"\"\n"); - m_aDebug.setWarning(sMsg.toString()); - } - aType.put(PROPNAME_CONTENTHANDLER, sHandler); - System.out.println("move handler \""+sHandler+"\" to type \""+sTypeReg+"\""); - } - } - - m_lContentHandlers.clear(); - -/* - int c = m_lTypes.size(); - java.lang.String[] lT1 = new java.lang.String[c]; - java.lang.String[] lT2 = new java.lang.String[c]; - long nUPS = 0; - - int i = 0; - aIt1 = m_lTypes.keySet().iterator(); - while(aIt1.hasNext()) - { - lT1[i] = (java.lang.String)aIt1.next(); - lT2[i] = lT1[i]; - ++i; - } - - for (int i1=0; i1 search from left to right - int len = lCommandLineArgs[arg].length(); - int pos = lCommandLineArgs[arg].indexOf('='); - if (pos != -1) - { - java.lang.String sArg = lCommandLineArgs[arg].substring(0,pos); - java.lang.String sValue = lCommandLineArgs[arg].substring(pos+1); - setProperty(sArg, sValue); - continue; - } - - // is it a boolean argument? - // Note: Because "--" and "-" will be interpreted as the same - // we search from right to left! - pos = lCommandLineArgs[arg].lastIndexOf('-'); - if (pos == -1) - pos = lCommandLineArgs[arg].lastIndexOf('/'); - if (pos != -1) - { - java.lang.String sArg = lCommandLineArgs[arg].substring(pos+1); - setProperty(sArg, java.lang.String.valueOf(true)); - continue; - } - - // There is an unknown format used by this argument ... - throw new MalformedCommandLineException("Invalid command line detected. The argument \""+lCommandLineArgs[arg]+"\" use an unsupported format."); - } - } - - //------------------------------------------- - /** indicates if the given command line includes - * a help request. - * - * @return True if there was an explicit help request. - */ - public synchronized boolean isHelp() - { - return ( - (containsKey("help")) || - (containsKey("?") ) || - (containsKey("h") ) - ); - } - - //------------------------------------------- - /** indicates if the gioven command line was empty. - * - * @return True if there was an empty command line. - */ - public synchronized boolean isEmpty() - { - return m_bEmpty; - } - - //------------------------------------------- - /** returns the value of sProp as boolean value. - * - * @param sProp - * the name of the parameter. - * - * @return The boolean value of the requested property. - * - * @throw [NoSuchElementException] - * if the requested property does not exists. - */ - public synchronized boolean getBoolean(java.lang.String sProp) - throws java.util.NoSuchElementException - { - java.lang.String sValue = getProperty(sProp); - if (sValue == null) - throw new java.util.NoSuchElementException("The requested config value \""+sProp+"\" does not exists!"); - return new java.lang.Boolean(sValue).booleanValue(); - } - - public synchronized boolean getBoolean(java.lang.String sProp , - boolean bDefault) - { - java.lang.String sDefault = java.lang.String.valueOf(bDefault); - java.lang.String sValue = getProperty(sProp, sDefault); - return new java.lang.Boolean(sValue).booleanValue(); - } - - //------------------------------------------- - /** returns the value of sProp as int value. - * - * @param sProp - * the name of the parameter. - * - * @return The int value of the requested property. - * - * @throw [NoSuchElementException] - * if the requested property does not exists. - */ - public synchronized int getInt(java.lang.String sProp) - throws java.util.NoSuchElementException - { - java.lang.String sValue = getProperty(sProp); - if (sValue == null) - throw new java.util.NoSuchElementException("The requested config value \""+sProp+"\" does not exists!"); - return new java.lang.Integer(sValue).intValue(); - } - - public synchronized int getInt(java.lang.String sProp , - int nDefault) - { - java.lang.String sDefault = java.lang.String.valueOf(nDefault); - java.lang.String sValue = getProperty(sProp, sDefault); - return new java.lang.Integer(sValue).intValue(); - } - - //------------------------------------------- - /** returns the value of sProp as string value. - * - * @param sProp - * the name of the parameter. - * - * @return The string value of the requested property. - * - * @throw [NoSuchElementException] - * if the requested property does not exists. - */ - public synchronized java.lang.String getString(java.lang.String sProp) - throws java.util.NoSuchElementException - { - java.lang.String sValue = getProperty(sProp); - if (sValue == null) - throw new java.util.NoSuchElementException("The requested config value \""+sProp+"\" does not exists!"); - return sValue; - } - - //------------------------------------------- - /** returns the value of sProp as string list value! - * - * @descr The delimiter must be well known and - * it must be clear if trailing/leading - * whitespaces must be ignored or not. - * - * @param sProp - * the name of the parameter. - * - * @param sDelim - * the delimiter, which must be used to split - * the config string value into an array. - * - * @param bTrim - * if its set to true, trailing and leading whitespace - * characters will be ommited. - * - * @param bDecode - * if its set to TRUE all liste items will be - * interpreted as "" and converted to ! - * - * @return The string list value of the requested property. - * - * @throw [NoSuchElementException] - * if the requested property does not exists. - */ - public synchronized java.util.Vector getStringList(java.lang.String sProp , - java.lang.String sDelimiter, - boolean bTrim , - boolean bDecode ) - throws java.util.NoSuchElementException - { - java.lang.String sValue = getProperty(sProp); - if (sValue == null) - throw new java.util.NoSuchElementException("The requested config value \""+sProp+"\" does not exists!"); - - java.util.Vector lValue = new java.util.Vector(); - try - { - java.util.StringTokenizer lTokens = new java.util.StringTokenizer(sValue, sDelimiter); - while(lTokens.hasMoreTokens()) - { - java.lang.String sToken = lTokens.nextToken(); - // remove trailing/leading whitespaces - if (bTrim) - sToken = sToken.trim(); - // remove "" - if ( - (bDecode ) && - (sToken.indexOf("\"") == 0 ) && - (sToken.lastIndexOf("\"") == sToken.length()-1) - ) - { - sToken = sToken.substring(1, sToken.length()-1); - } - lValue.add(sToken); - } - } - catch(java.lang.Throwable ex) - { lValue.clear(); } - - return lValue; - } -} diff --git a/transex3/source/filter/utils/FileHelper.java b/transex3/source/filter/utils/FileHelper.java deleted file mode 100644 index 71f51cf36bf6..000000000000 --- a/transex3/source/filter/utils/FileHelper.java +++ /dev/null @@ -1,766 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: FileHelper.java,v $ - * $Revision: 1.13 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -package com.sun.star.filter.config.tools.utils; - -// __________ Imports __________ - -import java.io.*; -import java.lang.*; -import java.net.*; -import java.util.*; - -// __________ Implementation __________ - -/** - * It collects some static helper functons to handle file system specific problems. - * Sometimes it's neccessary to convert URL from/to system pathes; - * or from string notation to structural versions (e.g. com.sun.star.util.URL). - * And sometimes java had another notation then the office it has. - * Further it provides functionality to work easiear with the java.io.File class of java. - * - * - */ -public class FileHelper -{ - // ____________________ - - /** - * Because the office need URLs for loading/saving documents - * we must convert used system pathes. - * And java use another notation for file URLs ... correct it. - * - * @param aSystemPath - * represent the file in system notation - * - * @return [String] - * a file url which represent the given system path - */ - public static java.lang.String getFileURLFromSystemPath(java.io.File aSystemPath) - { - System.out.println("TODO: must be adapted to java 1.3 :-("); - System.exit(-1); -/*TODO_JAVA - try - { - sFileURL = aSystemPath.toURI().toURL().toString(); - } - catch( MalformedURLException exWrong ) - { - sFileURL = null; - } -*/ - java.lang.String sFileURL = null; - - // problem of java: file URL's are coded with 1 slash instead of 2 or 3 ones! - // => correct this problem first, otherwise office can't use these URL's - if( - (sFileURL != null ) && - (sFileURL.startsWith("file:/") == true ) && - (sFileURL.startsWith("file://") == false) - ) - { - java.lang.StringBuffer sWorkBuffer = new java.lang.StringBuffer(sFileURL); - sWorkBuffer.insert(6,"//"); - sFileURL = sWorkBuffer.toString(); - } - - return sFileURL; - } - - // ____________________ - - /** - * The same as getFileURLFromSystemPath() before but uses string parameter instead - * of a java.io.File type. It exist to supress converting of neccessary parameters in the - * outside code. But of course getFileURLFromSystemPath(File) will be a little bit faster - * then this method ... - * - * @param sSystemPath - * represent the file in system notation - * - * @return [String] - * a file url which represent the given system path - */ - public static java.lang.String getFileURLFromSystemPath(java.lang.String sSystemPath) - { - return getFileURLFromSystemPath(new java.io.File(sSystemPath)); - } - - // ____________________ - - /** - * Does the same as getFileURLFromSystemPath() before ... but uses - * the given protocol string (e.g."http://") insted of "file:///". - * - * @param aSystemPath - * represent the file in system notation - * - * @param aBasePath - * define the base path of the aSystemPath value, - * which must be replaced with the value of "sServerPath". - * - * @param sServerURL - * Will be used to replace sBasePath. - * - * @example - * System Path = "d:\test\file.txt" - * Base Path = "d:\test" - * Server Path = "http://alaska:8000" - * => "http://alaska:8000/file.txt" - * - * @return [String] - * an url which represent the given system path - * and uses the given protocol - */ - public static java.lang.String getURLWithProtocolFromSystemPath(java.io.File aSystemPath, - java.io.File aBasePath , - java.lang.String sServerURL ) - { - System.out.println("TODO: must be adapted to java 1.3 :-("); - System.exit(-1); - - java.lang.String sFileURL = FileHelper.getFileURLFromSystemPath(aSystemPath); - java.lang.String sBaseURL = FileHelper.getFileURLFromSystemPath(aBasePath ); - - // cut last '/'! - if (sBaseURL.lastIndexOf('/')==(sBaseURL.length()-1)) - sBaseURL = sBaseURL.substring(0,sBaseURL.length()-1); - - // cut last '/'! - if (sServerURL.lastIndexOf('/')==(sServerURL.length()-1)) - sServerURL = sServerURL.substring(0,sServerURL.length()-1); - -//TODO_JAVA java.lang.String sURL = sFileURL.replaceFirst(sBaseURL,sServerURL); - java.lang.String sURL = null; - return sURL; - } - - // ____________________ - - /** - * The same as getURLWithProtocolFromSystemPath() before but uses string parameter instead - * of a java.io.File types. It exist to supress converting of neccessary parameters in the - * outside code. But of course getURLWithProtocolFromSystemPath(File,File,String) will be - * a little bit faster then this method ... - * - * @param sSystemPath - * represent the file in system notation - * - * @param sBasePath - * define the base path of the aSystemPath value, - * which must be replaced with the value of "sServerPath". - * - * @param sServerPath - * Will be used to replace sBasePath. - * - * @example - * System Path = "d:\test\file.txt" - * Base Path = "d:\test" - * Server Path = "http://alaska:8000" - * => "http://alaska:8000/file.txt" - * - * @return [String] - * an url which represent the given system path - * and uses the given protocol - */ - public static java.lang.String getURLWithProtocolFromSystemPath(java.lang.String sSystemPath, - java.lang.String sBasePath , - java.lang.String sServerPath) - { - return getURLWithProtocolFromSystemPath(new java.io.File(sSystemPath), new java.io.File(sBasePath), sServerPath); - } - - //_________________________________ - - /** - * Return a list of all available files of a directory. - * We filter sub directories. All other files - * are returned. So they can be used for further purposes. - * One parameter define the start directory, - * another one enable/disable recursive search into sub directories. - * - * @param aRoot - * the start directory, which should be analyzed. - * - * @param bRecursive - * enable/disable search in sub directories. - * - * @return [Vector] - * a filtered list of java java.io.File objects of all available files - * of the start dir (and may of its sub directories). - */ - public static java.util.Vector getSystemFilesFromDir(java.io.File aRoot , - boolean bRecursive) - { - java.io.File[] lAllFiles = aRoot.listFiles(); - if (lAllFiles == null) - return null; - - int c = lAllFiles.length; - java.util.Vector lFilteredFiles = new java.util.Vector(c); - for (int i=0; i=48 && c<=57 // 0-9 - && - c>=97 && c<=122 // a-z - && - c>=65 && c<=90 // A-Z - ) - { - sNewName.append(c); - } - else - { - sNewName.append("_"); - } - } - - return sNewName.toString(); - } - - //___________________________________________ - - /** it removes all child nodes of a file system directory. - * - * @param aDirectory - * points to the directory, which should be made empty. - * - * @param bFilesOnly - * force deletion of files only. If its set to TRUE, - * no subdirectory will be removed. - * - * @throw [java.io.IOException] - * if some of the child nodes couldn't be removed. - */ - public static void makeDirectoryEmpty(java.io.File aDirectory, - boolean bFilesOnly) - throws java.io.IOException - { - if (!aDirectory.isDirectory()) - throw new java.io.FileNotFoundException("\""+aDirectory.toString()+"\" is not a directory."); - - java.io.File[] lChilds = aDirectory.listFiles(); - for (int f=0; f0) - sBuffer.append(aEncodedBuffer, 0, nReadCount); - - aEncodedReader.close(); - } - - //___________________________________________ - private static void logEncodingData(java.lang.StringBuffer sLog , - int nUTF8 , - int nByteOrg1 , - int nByteOrg2 , - int nByteOrg3 , - int nByteOrg4 , - int nByte1 , - int nByte2 , - int nByte3 , - int nByte4 , - int nEncodingType) - { - sLog.append("["+nEncodingType+"]\t"); - sLog.append((int)nUTF8+"\t="); - sLog.append("\t"+nByteOrg1+"/"+nByte1); - sLog.append("\t"+nByteOrg2+"/"+nByte2); - sLog.append("\t"+nByteOrg3+"/"+nByte3); - sLog.append("\t"+nByteOrg4+"/"+nByte4); - sLog.append("\n"); - } - - //___________________________________________ - private static char impl_convertBytesToChar(int nByte1, int nByte2, int nByte3, int nByte4) - { - return (char)((nByte1*0x40000)+(nByte2*0x1000)+(nByte3*0x40)+nByte4); - } - - //___________________________________________ - private static int impl_readAndCheckNextByte(byte[] aBuffer , - int nBufPos , - int nBufLength , - int nMinRange , - int nMaxRange ) - throws java.lang.Exception - { - if (nBufPos>=nBufLength) - throw new java.lang.Exception("impl_readAndCheckNextByte()\nEnd of buffer reached."); - - int nByte = aBuffer[nBufPos] & 0xFF; - if ( - (nByte < nMinRange) || - (nByte > nMaxRange) - ) - { - throw new java.lang.Exception("impl_readAndCheckNextByte()\nByte does not fit the specified range."); - } - - return nByte; - } - - //___________________________________________ - public static void readAndCheckUTF8File(java.io.File aFile , - java.lang.StringBuffer sBuffer) - throws java.io.IOException - { - java.io.FileInputStream aByteStream = new java.io.FileInputStream(aFile.getAbsolutePath()); - byte[] aBuffer = new byte[4096]; - int nReadCount = 0; - int nByteOrg_1 = 0; - int nByteOrg_2 = 0; - int nByteOrg_3 = 0; - int nByteOrg_4 = 0; - int nByte_1 = 0; - int nByte_2 = 0; - int nByte_3 = 0; - int nByte_4 = 0; - char nUTF8 = 0; - int i = 0; - int nEncodingType = 0; - java.lang.StringBuffer sLog = new java.lang.StringBuffer(); - - try - { - - while((nReadCount=aByteStream.read(aBuffer))>0) - { - i=0; - while (i= 0x00) && - (nByteOrg_1 <= 0x7F) - ) - { - nEncodingType = 1; - nUTF8 = (char)nByte_1; - } - // ------------------------------------------------------------ - // 02 - // 1 byte: 110xxxxx - // 2 byte: 101xxxxx - // ------------------------------------------------------------ - else - if ( - (nByteOrg_1 >= 0xC2) && - (nByteOrg_1 <= 0xDF) - ) - { - nEncodingType = 2; - nByteOrg_2 = FileHelper.impl_readAndCheckNextByte(aBuffer, i++, nReadCount, 0x80, 0xBF); - nByte_1 = nByteOrg_1-0xC2; - nByte_2 = nByteOrg_2-0x80; - nUTF8 = FileHelper.impl_convertBytesToChar(0,0,nByte_1, nByte_2); - } - // ------------------------------------------------------------ - // 03 - // 1 byte: 11100000 - // 2 byte: 101xxxxx - // 3 byte: 10xxxxxx - // ------------------------------------------------------------ - else - if (nByteOrg_1 == 0xE0) - { - nEncodingType = 3; - nByteOrg_2 = FileHelper.impl_readAndCheckNextByte(aBuffer, i++, nReadCount, 0xA0, 0xBF); - nByteOrg_3 = FileHelper.impl_readAndCheckNextByte(aBuffer, i++, nReadCount, 0x80, 0xBF); - nByte_2 = nByteOrg_2-0xA0; - nByte_3 = nByteOrg_3-0x80; - nUTF8 = FileHelper.impl_convertBytesToChar(0,0,nByte_2, nByte_3); - } - // ------------------------------------------------------------ - // 04 - // 1 byte: 111xxxxx - // 2 byte: 10xxxxxx - // 3 byte: 10xxxxxx - // ------------------------------------------------------------ - else - if ( - (nByteOrg_1 >= 0xE1) && - (nByteOrg_1 <= 0xEC) - ) - { - nEncodingType = 4; - nByteOrg_2 = FileHelper.impl_readAndCheckNextByte(aBuffer, i++, nReadCount, 0x80, 0xBF); - nByteOrg_3 = FileHelper.impl_readAndCheckNextByte(aBuffer, i++, nReadCount, 0x80, 0xBF); - nByte_1 = nByteOrg_1-0xE1; - nByte_2 = nByteOrg_2-0x80; - nByte_3 = nByteOrg_3-0x80; - nUTF8 = FileHelper.impl_convertBytesToChar(0,nByte_1, nByte_2, nByte_3); - } - // ------------------------------------------------------------ - // 05 - // 1 byte: 11101101 - // 2 byte: 10xxxxxx - // 3 byte: 10xxxxxx - // ------------------------------------------------------------ - else - if (nByteOrg_1 == 0xED) - { - nEncodingType = 5; - nByteOrg_2 = FileHelper.impl_readAndCheckNextByte(aBuffer, i++, nReadCount, 0x80, 0x9F); - nByteOrg_3 = FileHelper.impl_readAndCheckNextByte(aBuffer, i++, nReadCount, 0x80, 0xBF); - nByte_2 = nByteOrg_2-0x80; - nByte_3 = nByteOrg_3-0x80; - nUTF8 = FileHelper.impl_convertBytesToChar(0,0, nByte_2, nByte_3); - } - // ------------------------------------------------------------ - // 06 - // 1 byte: 1110111x - // 2 byte: 10xxxxxx - // 3 byte: 10xxxxxx - // ------------------------------------------------------------ - else - if ( - (nByteOrg_1 >= 0xEE) && - (nByteOrg_1 <= 0xEF) - ) - { - nEncodingType = 6; - nByteOrg_2 = FileHelper.impl_readAndCheckNextByte(aBuffer, i++, nReadCount, 0x80, 0xBF); - nByteOrg_3 = FileHelper.impl_readAndCheckNextByte(aBuffer, i++, nReadCount, 0x80, 0xBF); - nByte_1 = nByteOrg_1-0xEE; - nByte_2 = nByteOrg_2-0x80; - nByte_3 = nByteOrg_3-0x80; - nUTF8 = FileHelper.impl_convertBytesToChar(0,nByte_1, nByte_2, nByte_3); - } - // ------------------------------------------------------------ - // 07 - // 1 byte: 11110000 - // 2 byte: 1001xxxx - // 3 byte: 10xxxxxx - // 4 byte: 10xxxxxx - // ------------------------------------------------------------ - else - if (nByteOrg_1 == 0xF0) - { - nEncodingType = 7; - nByteOrg_2 = FileHelper.impl_readAndCheckNextByte(aBuffer, i++, nReadCount, 0x90, 0xBF); - nByteOrg_3 = FileHelper.impl_readAndCheckNextByte(aBuffer, i++, nReadCount, 0x80, 0xBF); - nByteOrg_4 = FileHelper.impl_readAndCheckNextByte(aBuffer, i++, nReadCount, 0x80, 0xBF); - nByte_2 = nByteOrg_2-0x90; - nByte_3 = nByteOrg_3-0x80; - nByte_4 = nByteOrg_4-0x80; - nUTF8 = FileHelper.impl_convertBytesToChar(0, nByte_2, nByte_3, nByte_4); - } - // ------------------------------------------------------------ - // 08 - // 1 byte: 111100xx - // 2 byte: 10xxxxxx - // 3 byte: 10xxxxxx - // 3 byte: 10xxxxxx - // ------------------------------------------------------------ - else - if ( - (nByteOrg_1 >= 0xF1) && - (nByteOrg_1 <= 0xF3) - ) - { - nEncodingType = 8; - nByteOrg_2 = FileHelper.impl_readAndCheckNextByte(aBuffer, i++, nReadCount, 0x80, 0xBF); - nByteOrg_3 = FileHelper.impl_readAndCheckNextByte(aBuffer, i++, nReadCount, 0x80, 0xBF); - nByteOrg_4 = FileHelper.impl_readAndCheckNextByte(aBuffer, i++, nReadCount, 0x80, 0xBF); - nByte_1 = nByteOrg_1-0xF1; - nByte_2 = nByteOrg_2-0x80; - nByte_3 = nByteOrg_3-0x80; - nByte_4 = nByteOrg_4-0x80; - nUTF8 = FileHelper.impl_convertBytesToChar(nByte_1, nByte_2, nByte_3, nByte_4); - } - // ------------------------------------------------------------ - // 09 - // 1 byte: 11110100 - // 2 byte: 10xxxxxx - // 3 byte: 10xxxxxx - // 4 byte: 10xxxxxx - // ------------------------------------------------------------ - else - if (nByteOrg_1 == 0xF0) - { - nEncodingType = 9; - nByteOrg_2 = FileHelper.impl_readAndCheckNextByte(aBuffer, i++, nReadCount, 0x80, 0xBF); - nByteOrg_3 = FileHelper.impl_readAndCheckNextByte(aBuffer, i++, nReadCount, 0x80, 0xBF); - nByteOrg_4 = FileHelper.impl_readAndCheckNextByte(aBuffer, i++, nReadCount, 0x80, 0xBF); - nByte_2 = nByteOrg_2-0x80; - nByte_3 = nByteOrg_3-0x80; - nByte_4 = nByteOrg_4-0x80; - nUTF8 = FileHelper.impl_convertBytesToChar(0, nByte_2, nByte_3, nByte_4); - } - // wrong encoding ? - else - { - throw new java.lang.Exception("Non well formed UTF-8 encoding."); - } - - sBuffer.append(nUTF8); - // -> DEBUG ! - FileHelper.logEncodingData(sLog, nUTF8, nByteOrg_1, nByteOrg_2, nByteOrg_3, nByteOrg_4, nByte_1, nByte_2, nByte_3, nByte_4, nEncodingType); - // <- DEBUG ! - } - } - - } - catch(java.lang.Throwable ex) - { - // -> DEBUG ! - FileHelper.logEncodingData(sLog, nUTF8, nByteOrg_1, nByteOrg_2, nByteOrg_3, nByteOrg_4, nByte_1, nByte_2, nByte_3, nByte_4, nEncodingType); - - java.io.File aDir = new java.io.File(aFile.getParent()); - java.lang.String sDump = aFile.getName(); - java.io.File aDump = FileHelper.createUniqueFile(aDir, sDump, "dump"); - FileHelper.writeEncodedBufferToFile(aDump, "UTF-8", false, sLog); - // <- DEBUG ! - - java.lang.String sMsg = "File '"+aFile.getPath()+"' is not encoded right as UTF-8."; - throw new java.io.IOException(sMsg); - } - - aByteStream.close(); - } - - //___________________________________________ - - /** writes the given string buffer into the specified file - * using the specified encoding. - * - * Further it can be set, if the file should be expanded - * or replaced by this new string buffer. - * - * @param aFile - * must point to a system file. It can already exist! - * e.g.: "c:\temp\test.txt" - * "/tmp/test.txt" - * - * @param sEncoding - * will be used to encode the string content inside the file. - * e.g.: "UTF8" - * - * @param bAppend - * specify if an already existing file will be - * expanded or replaced. - * - * @param sBuffer - * the new string content for this file. - */ - public static void writeEncodedBufferToFile(java.io.File aFile , - java.lang.String sEncoding, - boolean bAppend , - java.lang.StringBuffer sBuffer ) - throws java.io.IOException - { - java.io.FileOutputStream aByteStream = new java.io.FileOutputStream(aFile.getAbsolutePath(), bAppend); - java.io.OutputStreamWriter aEncodedWriter = new java.io.OutputStreamWriter(aByteStream, sEncoding); - - java.lang.String sTemp = sBuffer.toString(); - aEncodedWriter.write(sTemp, 0, sTemp.length()); - - aEncodedWriter.flush(); - aEncodedWriter.close(); - - if (!aFile.exists()) - throw new java.io.IOException("File \""+aFile.getAbsolutePath()+"\" not written correctly."); - } -} diff --git a/transex3/source/filter/utils/Logger.java b/transex3/source/filter/utils/Logger.java deleted file mode 100644 index 7657eba5f426..000000000000 --- a/transex3/source/filter/utils/Logger.java +++ /dev/null @@ -1,177 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: Logger.java,v $ - * $Revision: 1.8 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -package com.sun.star.filter.config.tools.utils; - -//_______________________________________________ -// imports - -import java.lang.*; -import java.util.*; - -//_______________________________________________ -// definition - -/** can be used to print out some debug messages - * and group it into warnings/errors or info statements. - * - * - */ -public class Logger -{ - //___________________________________________ - // const - - /** only error message will be shown. */ - public static final int LEVEL_ERRORS = 1; - - /** only errors and warnings will be shown. */ - public static final int LEVEL_WARNINGS = 2; - - /** enable errors/warnings and some global info - * message. */ - public static final int LEVEL_GLOBALINFOS = 3; - - /** enable anything! */ - public static final int LEVEL_DETAILEDINFOS = 4; - - //___________________________________________ - // member - - /** enable/disable different output level. - * e.g. warnings/errors/infos */ - private int m_nLevel; - - //___________________________________________ - // ctor - - /** initialize new debug object with the specified - * debug level. - * - * @param nLevel - * the new debug level. - * See const values LEVEL_xxx too. - */ - public Logger(int nLevel) - { - m_nLevel = nLevel; - } - - //___________________________________________ - // interface - - /** initialize new debug object with a default - * debug level. - */ - public Logger() - { - m_nLevel = LEVEL_DETAILEDINFOS; - } - - //___________________________________________ - // interface - - /** prints out an exception ... if the right level is set. - * - * @param ex - * the exception object - */ - public synchronized void setException(java.lang.Throwable ex) - { - if (m_nLevel >= LEVEL_ERRORS) - { - System.err.println("Exception:\n"); - ex.printStackTrace(); - } - } - - //___________________________________________ - // interface - - /** prints out an error ... if the right level is set. - * - * @param sError - * the error message. - */ - public synchronized void setError(java.lang.String sError) - { - if (m_nLevel >= LEVEL_ERRORS) - System.err.println("Error :\t\""+sError+"\""); - } - - //___________________________________________ - // interface - - /** prints out a warning ... if the right level is set. - * - * @param sWarning - * the warning message. - */ - public synchronized void setWarning(java.lang.String sWarning) - { - if (m_nLevel >= LEVEL_WARNINGS) - System.err.println("Warning :\t\""+sWarning+"\""); - } - - //___________________________________________ - // interface - - /** prints out a global info message ... if the right level is set. - * - * Global infos should be used to describe a complex operation. - * E.g.: loading of a document. - * But not for every sub operation like e.g. analyzing lines - * during loading the document! - * - * @param sInfo - * the info message. - */ - public synchronized void setGlobalInfo(java.lang.String sInfo) - { - if (m_nLevel >= LEVEL_GLOBALINFOS) - System.out.println("Info :\t\""+sInfo+"\""); - } - - //___________________________________________ - // interface - - /** prints out a mode detailed info message ... if the right level is set. - * - * Such detailed message are e.g. "analyze line [n] of file ...". - * - * @param sInfo - * the info message. - */ - public synchronized void setDetailedInfo(java.lang.String sInfo) - { - if (m_nLevel >= LEVEL_DETAILEDINFOS) - System.out.println("Detail :\t\""+sInfo+"\""); - } -} diff --git a/transex3/source/filter/utils/MalformedCommandLineException.java b/transex3/source/filter/utils/MalformedCommandLineException.java deleted file mode 100644 index e073dcb9adcc..000000000000 --- a/transex3/source/filter/utils/MalformedCommandLineException.java +++ /dev/null @@ -1,50 +0,0 @@ -/*_*********************************************************************** - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: MalformedCommandLineException.java,v $ - * $Revision: 1.4 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - **********************************************************************_*/ - -package com.sun.star.filter.config.tools.utils; - -//_______________________________________________ -// imports - -import java.lang.*; - -//___________________________________________ -// types - -/** indicates a malformed command line. - * - * E.g. it must be thrown if the command line contains one item more then once, - * or use unsupported format. - */ -public class MalformedCommandLineException extends java.lang.Exception -{ - public MalformedCommandLineException() {} - public MalformedCommandLineException(java.lang.String sMsg) { super(sMsg); } -} diff --git a/transex3/source/filter/utils/XMLHelper.java b/transex3/source/filter/utils/XMLHelper.java deleted file mode 100644 index 0f912cac8e25..000000000000 --- a/transex3/source/filter/utils/XMLHelper.java +++ /dev/null @@ -1,825 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: XMLHelper.java,v $ - * $Revision: 1.7 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -package com.sun.star.filter.config.tools.utils; - -//_______________________________________________ - -import java.lang.*; -import java.util.*; -import java.io.*; - -//_______________________________________________ - -/** - * It provides some constant values and some static helper routines - * which are neccessary to work with a xml file - especialy - * the filter configuration. - * - * - */ -public class XMLHelper -{ - //___________________________________________ - // public const - - /** its a possible value of the xml attribute "oor:type" and identify an integer type. */ - public static final java.lang.String XMLTYPE_INTEGER = "xs:int"; - - /** its a possible value of the xml attribute "oor:type" and identify an boolean type. */ - public static final java.lang.String XMLTYPE_BOOLEAN = "xs:boolean"; - - /** its a possible value of the xml attribute "oor:type" and identify an string type. */ - public static final java.lang.String XMLTYPE_STRING = "xs:string"; - - /** its a possible value of the xml attribute "oor:type" and identify an string list type. */ - public static final java.lang.String XMLTYPE_STRINGLIST = "oor:string-list"; - - /** its a xml attribute, which specify a property name. */ - public static final java.lang.String XMLATTRIB_OOR_NAME = "oor:name"; - - /** its a xml attribute, which specify a property type. */ - public static final java.lang.String XMLATTRIB_OOR_TYPE = "oor:type"; - - /** its a xml attribute, which specify a list separator. */ - public static final java.lang.String XMLATTRIB_OOR_SEPARATOR = "oor:separator"; - - /** its a xml attribute, which specify a localized value. */ - public static final java.lang.String XMLATTRIB_OOR_LOCALIZED = "oor:localized"; - - /** its a xml attribute, which specify a merge operation for cfg layering. */ - public static final java.lang.String XMLATTRIB_OOR_OP = "oor:op"; - - /** can be used as value for XMLATTRIB_OOR_OP. */ - public static final java.lang.String XMLATTRIB_OP_REPLACE = "replace"; - - /** its a xml attribute, which specify a locale value. */ - public static final java.lang.String XMLATTRIB_XML_LANG = "xml:lang"; - - /** its the tag name of a entry. */ - public static final java.lang.String XMLTAG_VALUE = "value"; - - /** its the tag name of a entry. */ - public static final java.lang.String XMLTAG_PROP = "prop"; - - /** its the tag name of a entry. */ - public static final java.lang.String XMLTAG_NODE = "node"; - - //___________________________________________ - // private const - - /** a static list of all possible separators, which can be used for configuration type string-list. */ - private static final java.lang.String[] DELIMS = {" ", ",", ";", ".", ":", "-", "_", "#", "'", "+", "*", "~", "=", "?"}; - - /** index of the default separator inside list DELIMS. - * Its neccessary to know such default separator; because it can - * be supressed as xml attribute of the corresponding value tag. */ - private static final int DEFAULT_SEPARATOR = 0; - - //___________________________________________ - - /** analyze the structures of the given XML node and - * return a property set of all found sub nodes. - * - * Such properties are organized as [name, value] pairs. - * The type of a xml node will be detected automaticly. - * Following types are supported: - * xs:int => java.lang.Integer - * xs:bool => java.lang.Boolean - * xs:string => java.lang.String - * oor:string-list => java.util.LinkedList[java.lang.String] - * oor:set => java.util.Vector[java.lang.Object] - * oor:localized => java.util.HashMap[java.lang.Object] - * - * @param aNode - * points directly to the xml node, where we should analyze - * the children nodes. - * - * @return [java.util.HashMap] - * contains every node name as key and its string(!) as value. - */ - public static java.util.HashMap convertNodeToPropSet(org.w3c.dom.Node aNode) - throws java.lang.Exception - { - java.util.HashMap aPropSet = new java.util.HashMap(); - - // get all child nodes, which seems to be properties - java.util.Vector lChildNodes = XMLHelper.extractChildNodesByTagName(aNode, XMLTAG_PROP); - java.util.Enumeration en1 = lChildNodes.elements(); - while(en1.hasMoreElements()) - { - org.w3c.dom.Node aChildNode = (org.w3c.dom.Node)en1.nextElement(); - - // read its name - java.lang.String sChildName = XMLHelper.extractNodeAttribByName(aChildNode, XMLATTRIB_OOR_NAME); - if (sChildName == null) - throw new java.io.IOException("unsupported format: could not extract child node name"); - - // read its type info - java.lang.String sChildType = XMLHelper.extractNodeAttribByName(aChildNode, XMLATTRIB_OOR_TYPE); - if (sChildType == null) - { - /** Special patch: - * If an xml tag has no type information set ... we can restore it - * by analyzing the already readed tag name :-) - * Not very nice - but it can help to read stripped xml files too. */ - sChildType = XMLHelper.getTypeForTag(sChildName); - if (sChildType == null) - throw new java.io.IOException("unsupported format: could not extract child node type"); - } - - // read its value(s?) - java.util.Vector lChildValues = XMLHelper.extractChildNodesByTagName(aChildNode, XMLTAG_VALUE); - java.util.Enumeration en2 = lChildValues.elements(); - int nValue = 0; - java.lang.Object aValue = null; - while(en2.hasMoreElements()) - { - org.w3c.dom.Node aValueNode = (org.w3c.dom.Node)en2.nextElement(); - java.lang.String sChildLocale = XMLHelper.extractNodeAttribByName(aValueNode, XMLATTRIB_XML_LANG); - boolean bLocalized = (sChildLocale != null); - - ++nValue; - - if (sChildType.equals(XMLTYPE_INTEGER)) - { - if (!bLocalized && nValue > 1) - throw new java.io.IOException("unsupported format: more then one value for non localized but atomic type detected"); - java.lang.String sData = ((org.w3c.dom.CharacterData)aValueNode.getFirstChild()).getData(); - aValue = new java.lang.Integer(sData); - } - else - if (sChildType.equals(XMLTYPE_BOOLEAN)) - { - if (!bLocalized && nValue > 1) - throw new java.io.IOException("unsupported format: more then one value for non localized but atomic type detected"); - java.lang.String sData = ((org.w3c.dom.CharacterData)aValueNode.getFirstChild()).getData(); - aValue = new java.lang.Boolean(sData); - } - else - if (sChildType.equals(XMLTYPE_STRING)) - { - if (!bLocalized && nValue > 1) - throw new java.io.IOException("unsupported format: more then one value for non localized but atomic type detected"); - - java.lang.String sData = ((org.w3c.dom.CharacterData)aValueNode.getFirstChild()).getData(); - - java.util.HashMap lLocalized = null; - if (bLocalized) - { - if (aValue == null) - aValue = new java.util.HashMap(); - lLocalized = (java.util.HashMap)aValue; - lLocalized.put(sChildLocale, sData); - } - else - aValue = sData; - } - else - if (sChildType.equals(XMLTYPE_STRINGLIST)) - { - if (!bLocalized && nValue > 1) - throw new java.io.IOException("unsupported format: more then one value for non localized but atomic type detected"); - - java.lang.String sSeparator = XMLHelper.extractNodeAttribByName(aChildNode, XMLATTRIB_OOR_SEPARATOR); - if (sSeparator == null) - sSeparator = " "; - - java.lang.String sData = ((org.w3c.dom.CharacterData)aValueNode.getFirstChild()).getData(); - sData = sData.replace('\t', ' '); - sData = sData.replace('\n', ' '); - java.util.StringTokenizer aTokenizer = new java.util.StringTokenizer(sData, sSeparator); - java.util.Vector lList = new java.util.Vector(); - while(aTokenizer.hasMoreTokens()) - { - java.lang.String sToken = (java.lang.String)aTokenizer.nextToken(); - sToken.trim(); - if (sToken.length() < 1) - continue; - lList.add(sToken); - } - aValue = lList; - } - - aPropSet.put(sChildName, aValue); - } - } - - return aPropSet; - } - - //___________________________________________ - - private static java.lang.String getTypeForTag(java.lang.String sTag) - { - java.lang.String sType = null; - - if ( - (sTag.equals(Cache.PROPNAME_DATA )) || - (sTag.equals(Cache.PROPNAME_NAME )) || - (sTag.equals(Cache.PROPNAME_UINAME )) || - (sTag.equals(Cache.PROPNAME_MEDIATYPE )) || - (sTag.equals(Cache.PROPNAME_CLIPBOARDFORMAT )) || - (sTag.equals(Cache.PROPNAME_PREFERREDFILTER )) || - (sTag.equals(Cache.PROPNAME_DETECTSERVICE )) || - (sTag.equals(Cache.PROPNAME_FRAMELOADER )) || - (sTag.equals(Cache.PROPNAME_CONTENTHANDLER )) || - (sTag.equals(Cache.PROPNAME_DOCUMENTSERVICE )) || - (sTag.equals(Cache.PROPNAME_FILTERSERVICE )) || - (sTag.equals(Cache.PROPNAME_TEMPLATENAME )) || - (sTag.equals(Cache.PROPNAME_TYPE )) || - (sTag.equals(Cache.PROPNAME_UICOMPONENT )) - ) - sType = XMLTYPE_STRING; - else - if ( - (sTag.equals(Cache.PROPNAME_PREFERRED )) || - (sTag.equals("Installed" )) - ) - sType = XMLTYPE_BOOLEAN; - else - if ( - (sTag.equals(Cache.PROPNAME_UIORDER )) || - (sTag.equals(Cache.PROPNAME_DOCUMENTICONID )) || - (sTag.equals(Cache.PROPNAME_FILEFORMATVERSION)) - ) - sType = XMLTYPE_INTEGER; - else - if ( - (sTag.equals(Cache.PROPNAME_URLPATTERN )) || - (sTag.equals(Cache.PROPNAME_EXTENSIONS )) || - (sTag.equals(Cache.PROPNAME_USERDATA )) || - (sTag.equals(Cache.PROPNAME_FLAGS )) || - (sTag.equals(Cache.PROPNAME_TYPES )) - ) - sType = XMLTYPE_STRINGLIST; - - if (sType == null) - System.err.println("getTypeForTag("+sTag+") = "+sType); - - return sType; - } - - //___________________________________________ - - /** return a xml representation of the given property set. - * - * @param aPropSet - * a set of pairs, which should be translated to xml - * - * @return [java.lang.String] - * the xml string representation. - * - * @throws [java.lang.Exception] - * if anything during convertion fill fail. - */ - public static java.lang.String convertPropSetToXML(java.util.HashMap aPropSet , - int nPrettyTabs) - throws java.lang.Exception - { - java.lang.StringBuffer sXML = new java.lang.StringBuffer(256); - - java.util.Iterator it1 = aPropSet.keySet().iterator(); - while(it1.hasNext()) - { - java.lang.String sProp = (java.lang.String)it1.next(); - java.lang.Object aVal = aPropSet.get(sProp); - - sProp = encodeHTMLSigns(sProp); - - // is it a simple type? - if ( - (aVal instanceof java.lang.Integer) || - (aVal instanceof java.lang.Boolean) || - (aVal instanceof java.lang.String ) - ) - { - sXML.append(XMLHelper.convertSimpleObjectToXML(sProp, aVal, nPrettyTabs)); - continue; - } - - // no! - // is it a list value? - if (aVal instanceof java.util.Vector) - { - java.util.Vector lVal = (java.util.Vector)aVal; - sXML.append(XMLHelper.convertListToXML(sProp, lVal, nPrettyTabs)); - continue; - } - - // its a localized value? - if (aVal instanceof java.util.HashMap) - { - java.util.HashMap lVal = (java.util.HashMap)aVal; - sXML.append(XMLHelper.convertLocalizedValueToXML(sProp, lVal, nPrettyTabs)); - continue; - } - - // unknown type! - java.lang.StringBuffer sMsg = new java.lang.StringBuffer(256); - sMsg.append("unsupported object type detected."); - sMsg.append("\ttype ? : \""+sProp+"\" = "+aVal); - sMsg.append("\tprop set: \""+aPropSet ); - throw new java.lang.Exception(sMsg.toString()); - } - - return sXML.toString(); - } - - public static java.lang.String encodeHTMLSigns(java.lang.String sValue) - { - java.lang.StringBuffer sSource = new java.lang.StringBuffer(sValue); - java.lang.StringBuffer sDestination = new java.lang.StringBuffer(1000 ); - - for (int i=0; i \""+sReturn+"\""); - - return sReturn; - } - - //___________________________________________ - - /** return a xml representation of an atomic property. - * - * Atomic property types are e.g. Integer, Boolean, String. - * - * @param sName - * the name of the property. - - * @param aValue - * the value of the property. - * - * @param nPrettyTabs - * count of tab signs for pretty format the xml code :-) - * - * @return [java.lang.String] - * the xml string representation. - * - * @throws [java.lang.Exception] - * if anything during convertion fill fail. - */ - private static java.lang.String convertSimpleObjectToXML(java.lang.String sName , - java.lang.Object aValue , - int nPrettyTabs) - throws java.lang.Exception - { - java.lang.StringBuffer sXML = new java.lang.StringBuffer(256); - for (int t=0; t"); - sXML.append(""+aValue.toString()+""); - sXML.append("\n"); - } - else - if (aValue instanceof java.lang.Boolean) - { - sXML.append(""); - sXML.append(""+aValue.toString()+""); - sXML.append("\n"); - } - else - if (aValue instanceof java.lang.String) - { - sXML.append("\n"); - else - { - sXML.append(">"+sValue+""); - sXML.append("\n"); - } - } - else - { - System.err.println("name = "+sName); - System.err.println("value = "+aValue); - // ! can be used outside to detect - that it was not a simple type :-) - throw new java.lang.Exception("not an atomic type."); - } - - return sXML.toString(); - } - - //___________________________________________ - - /** return a xml representation of a string-list property. - * - * @param sName - * the name of the property. - - * @param aValue - * the value of the property. - * - * @param nPrettyTabs - * count of tab signs for pretty format the xml code :-) - * - * @return [java.lang.String] - * the xml string representation. - * - * @throws [java.lang.Exception] - * if anything during convertion fill fail. - */ - private static java.lang.String convertListToXML(java.lang.String sName , - java.util.Vector aValue , - int nPrettyTabs) - throws java.lang.Exception - { - java.lang.StringBuffer sXML = new java.lang.StringBuffer(256); - - for (int t=0; t\n"); - return sXML.toString(); - } - - // step over all list items and add it to a string buffer - // Every item will be separated by a default separator "\n" first. - // Because "\n" is not a valid separator at all and can`t occure inside - // our list items. During we step over all items, we check if our current separator - // (we use a list of possible ones!) clash with an item. - // If it clash - we step to the next possible separator. - // If our list of possible separator values runs out of range we throw - // an exception :-) Its better then generating of wrong values - // If we found a valid seperator - we use it to replace our "\n" place holder - // at the end of the following loop ... - - int d = 0; - java.lang.StringBuffer sValBuff = new java.lang.StringBuffer(256); - for (int i=0; i= DELIMS.length) - throw new java.lang.Exception("No valid separator found for a string list item."); - if (sValue.length() < 1 && DELIMS[d].equals(" ")) - { - ++d; - continue; - } - if (sValue.indexOf(DELIMS[d]) != -1) - { - ++d; - continue; - } - break; - } - } - - // replace default separator with right one - System.out.println("TODO: must be adapted to java 1.3 :-("); - System.exit(-1); -//TODO_JAVA java.lang.String sListVal = sValBuff.toString().replaceAll("\n", DELIMS[d]); - java.lang.String sListVal = null; - - sXML.append(""); - if (d == DEFAULT_SEPARATOR) - sXML.append(""); - else - sXML.append(""); - sXML.append(sListVal); - sXML.append(""); - sXML.append("\n"); - - return sXML.toString(); - } - - //___________________________________________ - - /** return a xml representation of a localized property. - * - * @param sName - * the name of the property. - - * @param aValue - * the value of the property. - * - * @param nPrettyTabs - * count of tab signs for pretty format the xml code :-) - * - * @return [java.lang.String] - * the xml string representation. - * - * @throws [java.lang.Exception] - * if anything during convertion fill fail. - */ - private static java.lang.String convertLocalizedValueToXML(java.lang.String sName , - java.util.HashMap aValue , - int nPrettyTabs) - throws java.lang.Exception - { - java.lang.StringBuffer sXML = new java.lang.StringBuffer(256); - - int c = aValue.size(); - if (c < 1) - throw new java.lang.Exception("Cant detect type of localized values. Because the given list is empty."); - - for (int t=0; t\n"); - java.util.Iterator it = aValue.keySet().iterator(); -// boolean bTypeKnown = false; - while(it.hasNext()) - { - java.lang.String sLocale = (java.lang.String)it.next(); - java.lang.Object aLocalizedValue = aValue.get(sLocale); -/* - if (!bTypeKnown) - { - bTypeKnown = true; - if (aLocalizedValue instanceof java.lang.Integer) - sXML.append(" "+XMLATTRIB_OOR_TYPE+"=\""+XMLTYPE_INTEGER+"\">\n"); - else - if (aLocalizedValue instanceof java.lang.Boolean) - sXML.append(" "+XMLATTRIB_OOR_TYPE+"=\""+XMLTYPE_BOOLEAN+"\">\n"); - else - if (aLocalizedValue instanceof java.lang.String) - sXML.append(" "+XMLATTRIB_OOR_TYPE+"=\""+XMLTYPE_STRING+"\">\n"); - else - throw new java.lang.Exception("Unsupported type for localized value detected."); - } -*/ - java.lang.String sLocValue = aLocalizedValue.toString(); - java.lang.String sValue = encodeHTMLSigns(sLocValue); - - for (int t=0; t"+sValue+"\n"); - } - --nPrettyTabs; - for (int t=0; t\n"); - - return sXML.toString(); - } - - //___________________________________________ - - /** returns the value of an attribute of the given node. - * - * If the given node represent an lement node, may it supports some attributes. - * Then this method search for an attribute with the specified name and return it's value. - * If nothing could be found ... or the given node isn't a suitable node ... it returns null. - * - * @param aNode - * the node, which should be analyzed. - * - * @param sAttrib - * name of the attribute, which should be searched. - * - * @return The value of the specified attribute if it could be found at the given node. - * Can be null if node doesn't support attributes or the searched one does not exist there. - */ - public static java.lang.String extractNodeAttribByName(org.w3c.dom.Node aNode , - java.lang.String sAttrib) - throws java.lang.Exception - { - // We can get valid attributes for element nodes only! - if (aNode.getNodeType() != org.w3c.dom.Node.ELEMENT_NODE) - { -// System.err.println("not an element node"); - return null; - } - - // may it supports attributes in general ... but doesn't have anyone realy. - org.w3c.dom.NamedNodeMap lAttribs = aNode.getAttributes(); - if (lAttribs==null) - { -// System.err.println("no attributes at all"); - return null; - } - - // step over the attribute list and search for the requested one - for (int i=0; i\n"); - sHeader.append("\n"); - } - else - { - sHeader.append("\n\n"); - sHeader.append("\n"); - } - - return sHeader.toString(); - } - - public static java.lang.String generateFooter() - { - return "\n"; - } -} diff --git a/transex3/source/filter/utils/makefile.mk b/transex3/source/filter/utils/makefile.mk deleted file mode 100644 index d41d8ba9a825..000000000000 --- a/transex3/source/filter/utils/makefile.mk +++ /dev/null @@ -1,57 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.9.98.2 $ -# -# 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 -# -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ = ..$/..$/.. -TARGET = FCFGUtils -PRJNAME = filter -PACKAGE = com$/sun$/star$/filter$/config$/tools$/utils - -# --- Settings ----------------------------------------------------- - -.INCLUDE: settings.mk - -#----- compile .java files ----------------------------------------- - - -JAVACLASSFILES = \ - $(CLASSDIR)$/$(PACKAGE)$/AnalyzeStartupLog.class \ - $(CLASSDIR)$/$(PACKAGE)$/ConfigHelper.class \ - $(CLASSDIR)$/$(PACKAGE)$/Logger.class \ - $(CLASSDIR)$/$(PACKAGE)$/FileHelper.class \ - $(CLASSDIR)$/$(PACKAGE)$/MalformedCommandLineException.class \ - $(CLASSDIR)$/$(PACKAGE)$/Cache.class \ - $(CLASSDIR)$/$(PACKAGE)$/XMLHelper.class - -MAXLINELENGTH = 100000 - -# --- targets ----------------------------------------------------- - -.INCLUDE : target.mk diff --git a/transex3/source/gsicheck.cxx b/transex3/source/gsicheck.cxx deleted file mode 100644 index 99183602f951..000000000000 --- a/transex3/source/gsicheck.cxx +++ /dev/null @@ -1,1177 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: gsicheck.cxx,v $ - * $Revision: 1.29 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_transex3.hxx" -#include -#include -#include -#include - -// local includes -#include "tagtest.hxx" -#include "gsicheck.hxx" - -#define MAX_GID_LID_LEN 250 - -/*****************************************************************************/ -void PrintMessage( ByteString aType, ByteString aMsg, ByteString aPrefix, - ByteString aContext, BOOL bPrintContext, ULONG nLine, ByteString aUniqueId = ByteString() ) -/*****************************************************************************/ -{ - fprintf( stdout, "%s %s, Line %lu", aType.GetBuffer(), aPrefix.GetBuffer(), nLine ); - if ( aUniqueId.Len() ) - fprintf( stdout, ", UniqueID %s", aUniqueId.GetBuffer() ); - fprintf( stdout, ": %s", aMsg.GetBuffer() ); - - if ( bPrintContext ) - fprintf( stdout, " \"%s\"", aContext.GetBuffer() ); - fprintf( stdout, "\n" ); -} - -/*****************************************************************************/ -void PrintError( ByteString aMsg, ByteString aPrefix, - ByteString aContext, BOOL bPrintContext, ULONG nLine, ByteString aUniqueId = ByteString() ) -/*****************************************************************************/ -{ - PrintMessage( "Error:", aMsg, aPrefix, aContext, bPrintContext, nLine, aUniqueId ); -} - -BOOL LanguageOK( ByteString aLang ) -{ - if ( !aLang.Len() ) - return FALSE; - - if ( aLang.IsNumericAscii() ) - return TRUE; - - if ( aLang.GetTokenCount( '-' ) == 1 ) - return aLang.IsAlphaAscii() && aLang.IsLowerAscii(); - else if ( aLang.GetTokenCount( '-' ) == 2 ) - { - ByteString aTok0( aLang.GetToken( 0, '-' ) ); - ByteString aTok1( aLang.GetToken( 1, '-' ) ); - return aTok0.Len() && aTok0.IsAlphaAscii() && aTok0.IsLowerAscii() - && aTok1.Len() && aTok1.IsAlphaAscii() && aTok1.IsUpperAscii() - && !aTok1.EqualsIgnoreCaseAscii( aTok0 ); - } - - return FALSE; -} - - -// -// class LazySvFileStream -// - - -class LazySvFileStream : public SvFileStream -{ - -private: - String aFileName; - BOOL bOpened; - StreamMode eOpenMode; - -public: - LazySvFileStream() - : aFileName() - , bOpened( FALSE ) - , eOpenMode( 0 ) - {}; - - void SetOpenParams( const String& rFileName, StreamMode eOpenModeP ) - { - aFileName = rFileName; - eOpenMode = eOpenModeP; - }; - - void LazyOpen(); -}; - -void LazySvFileStream::LazyOpen() -{ - if ( !bOpened ) - { - Open( aFileName, eOpenMode ); - if ( !IsOpen()) - { - fprintf( stderr, "\nERROR: Could not open Output-File %s!\n\n", ByteString( aFileName, RTL_TEXTENCODING_ASCII_US ).GetBuffer() ); - exit ( 4 ); - } - bOpened = TRUE; - } -} - - -// -// class GSILine -// - -/*****************************************************************************/ -GSILine::GSILine( const ByteString &rLine, ULONG nLine ) -/*****************************************************************************/ - : ByteString( rLine ) - , nLineNumber( nLine ) - , bOK( TRUE ) - , bFixed ( FALSE ) -{ - if ( rLine.GetTokenCount( '\t' ) == 15 ) - { - aFormat = FORMAT_SDF; - aUniqId = rLine.GetToken( 0, '\t' ); - aUniqId.Append("/").Append( rLine.GetToken( 1, '\t' ) ).Append("/").Append( rLine.GetToken( 3, '\t' ) ).Append("/").Append( rLine.GetToken( 4, '\t' ) ).Append("/").Append( rLine.GetToken( 5, '\t' ) ).Append("/").Append( rLine.GetToken( 6, '\t' ) ).Append("/").Append( rLine.GetToken( 7, '\t' ) ); - aLineType = ""; - aLangId = rLine.GetToken( 9, '\t' ); - aText = rLine.GetToken( 10, '\t' ); - aQuickHelpText = rLine.GetToken( 12, '\t' ); - aTitle = rLine.GetToken( 13, '\t' ); - - // do some more format checks here - if ( !rLine.GetToken( 8, '\t' ).IsNumericAscii() ) - { - PrintError( "The length field does not contain a number!", "Line format", rLine.GetToken( 8, '\t' ), TRUE, GetLineNumber(), GetUniqId() ); - NotOK(); - } - if ( !LanguageOK( aLangId ) ) - { - PrintError( "The Language is invalid!", "Line format", aLangId, TRUE, GetLineNumber(), GetUniqId() ); - NotOK(); - } - // limit GID and LID to MAX_GID_LID_LEN chars each for database conformity, see #137575# - if ( rLine.GetToken( 4, '\t' ).Len() > MAX_GID_LID_LEN || rLine.GetToken( 5, '\t' ).Len() > MAX_GID_LID_LEN ) - { - PrintError( ByteString("GID and LID may only be ").Append( ByteString::CreateFromInt32(MAX_GID_LID_LEN) ).Append( " chars long each!" ), "Line format", aLangId, TRUE, GetLineNumber(), GetUniqId() ); - NotOK(); - } - } - else // allow tabs in gsi files - { - aFormat = FORMAT_GSI; - ByteString sTmp( rLine ); - USHORT nPos = sTmp.Search( "($$)" ); - USHORT nStart = 0; - if ( nPos != STRING_NOTFOUND ) - { - aUniqId = sTmp.Copy( nStart, nPos - nStart ); - nStart = nPos + 4; // + length of the delemiter - nPos = sTmp.Search( "($$)", nStart ); - } - if ( nPos != STRING_NOTFOUND ) - { - aLineType = sTmp.Copy( nStart, nPos - nStart ); - nStart = nPos + 4; // + length of the delemiter - nPos = sTmp.Search( "($$)", nStart ); - aUniqId.Append( "/" ); - aUniqId.Append( aLineType ); - } - if ( nPos != STRING_NOTFOUND ) - { - aLangId = sTmp.Copy( nStart, nPos - nStart ); - nStart = nPos + 4; // + length of the delemiter - nPos = sTmp.Search( "($$)", nStart ); - } - if ( nPos != STRING_NOTFOUND ) - { -// ByteString aStatus = sTmp.Copy( nStart, nPos - nStart ); // ext int ... - nStart = nPos + 4; // + length of the delemiter - } - if ( nPos != STRING_NOTFOUND ) - aText = sTmp.Copy( nStart ); - else - aFormat = FORMAT_UNKNOWN; - } - - if ( FORMAT_UNKNOWN == GetLineFormat() ) - NotOK(); -} - -/*****************************************************************************/ -void GSILine::NotOK() -/*****************************************************************************/ -{ - bOK = FALSE; -} - -/*****************************************************************************/ -void GSILine::ReassembleLine() -/*****************************************************************************/ -{ - ByteString aReassemble; - if ( GetLineFormat() == FORMAT_SDF ) - { - USHORT i; - for ( i = 0 ; i < 10 ; i++ ) - { - aReassemble.Append( GetToken( i, '\t' ) ); - aReassemble.Append( "\t" ); - } - aReassemble.Append( aText ); - aReassemble.Append( "\t" ); - aReassemble.Append( GetToken( 11, '\t' ) ); // should be empty but there are some places in sc. Not reflected to sources!! - aReassemble.Append( "\t" ); - aReassemble.Append( aQuickHelpText ); - aReassemble.Append( "\t" ); - aReassemble.Append( aTitle ); - for ( i = 14 ; i < 15 ; i++ ) - { - aReassemble.Append( "\t" ); - aReassemble.Append( GetToken( i, '\t' ) ); - } - *(ByteString*)this = aReassemble; - } - else if ( GetLineFormat() == FORMAT_GSI ) - { - USHORT nPos = Search( "($$)" ); - USHORT nStart = 0; - if ( nPos != STRING_NOTFOUND ) - { - nStart = nPos + 4; // + length of the delemiter - nPos = Search( "($$)", nStart ); - } - if ( nPos != STRING_NOTFOUND ) - { - nStart = nPos + 4; // + length of the delemiter - nPos = Search( "($$)", nStart ); - } - if ( nPos != STRING_NOTFOUND ) - { - nStart = nPos + 4; // + length of the delemiter - nPos = Search( "($$)", nStart ); - } - if ( nPos != STRING_NOTFOUND ) - { - nStart = nPos + 4; // + length of the delemiter - } - if ( nPos != STRING_NOTFOUND ) - { - aReassemble = Copy( 0, nStart ); - aReassemble += aText; - *(ByteString*)this = aReassemble; - } - else - PrintError( "Cannot reassemble GSI line (internal Error).", "Line format", "", FALSE, GetLineNumber(), GetUniqId() ); - } - else - PrintError( "Cannot reassemble line of unknown type (internal Error).", "Line format", "", FALSE, GetLineNumber(), GetUniqId() ); -} - -// -// class GSIBlock -// -/*****************************************************************************/ -GSIBlock::GSIBlock( BOOL PbPrintContext, BOOL bSource, BOOL bTrans, BOOL bRef, BOOL bAllowKID, BOOL bAllowSusp ) -/*****************************************************************************/ - : pSourceLine( NULL ) - , pReferenceLine( NULL ) - , bPrintContext( PbPrintContext ) - , bCheckSourceLang( bSource ) - , bCheckTranslationLang( bTrans ) - , bReference( bRef ) - , bAllowKeyIDs( bAllowKID ) - , bAllowSuspicious( bAllowSusp ) - , bHasBlockError( FALSE ) -{ -} - -/*****************************************************************************/ -GSIBlock::~GSIBlock() -/*****************************************************************************/ -{ - delete pSourceLine; - delete pReferenceLine; - - for ( ULONG i = 0; i < Count(); i++ ) - delete ( GetObject( i )); -} - -/*****************************************************************************/ -void GSIBlock::InsertLine( GSILine* pLine, ByteString aSourceLang) -/*****************************************************************************/ -{ - if ( pLine->GetLanguageId().Equals( aSourceLang ) ) - { - if ( pSourceLine ) - { - PrintError( "Source Language entry double. Treating as Translation.", "File format", "", pLine->GetLineNumber(), pLine->GetUniqId() ); - bHasBlockError = TRUE; - pSourceLine->NotOK(); - pLine->NotOK(); - } - else - { - pSourceLine = pLine; - return; - } - } - ULONG nPos = 0; - - if ( aSourceLang.Len() ) // only check blockstructure if source lang is given - { - while ( nPos < Count() ) - { - if ( GetObject( nPos )->GetLanguageId().Equals( pLine->GetLanguageId() ) ) - { - PrintError( "Translation Language entry double. Checking both.", "File format", "", pLine->GetLineNumber(), pLine->GetUniqId() ); - bHasBlockError = TRUE; - GetObject( nPos )->NotOK(); - pLine->NotOK(); - } - nPos++; - } - } - Insert( pLine, LIST_APPEND ); -} - -/*****************************************************************************/ -void GSIBlock::SetReferenceLine( GSILine* pLine ) -/*****************************************************************************/ -{ - pReferenceLine = pLine; -} - -/*****************************************************************************/ -void GSIBlock::PrintMessage( ByteString aType, ByteString aMsg, ByteString aPrefix, - ByteString aContext, ULONG nLine, ByteString aUniqueId ) -/*****************************************************************************/ -{ - ::PrintMessage( aType, aMsg, aPrefix, aContext, bPrintContext, nLine, aUniqueId ); -} - -/*****************************************************************************/ -void GSIBlock::PrintError( ByteString aMsg, ByteString aPrefix, - ByteString aContext, ULONG nLine, ByteString aUniqueId ) -/*****************************************************************************/ -{ - PrintMessage( "Error:", aMsg, aPrefix, aContext, nLine, aUniqueId ); -} - -/*****************************************************************************/ -void GSIBlock::PrintList( ParserMessageList *pList, ByteString aPrefix, - GSILine *pLine ) -/*****************************************************************************/ -{ - ULONG i; - for ( i = 0 ; i < pList->Count() ; i++ ) - { - ParserMessage *pMsg = pList->GetObject( i ); - ByteString aContext; - if ( bPrintContext ) - { - if ( pMsg->GetTagBegin() == STRING_NOTFOUND ) - aContext = pLine->GetText().Copy( 0, 300 ); - else - aContext = pLine->Copy( pMsg->GetTagBegin()-150, 300 ); - aContext.EraseTrailingChars(' '); - aContext.EraseLeadingChars(' '); - } - - PrintMessage( pMsg->Prefix(), pMsg->GetErrorText(), aPrefix, aContext, pLine->GetLineNumber(), pLine->GetUniqId() ); - } -} - -/*****************************************************************************/ -BOOL GSIBlock::IsUTF8( const ByteString &aTestee, BOOL bFixTags, USHORT &nErrorPos, ByteString &aErrorMsg, BOOL &bHasBeenFixed, ByteString &aFixed ) const -/*****************************************************************************/ -{ - String aUTF8Tester( aTestee, RTL_TEXTENCODING_UTF8 ); - if ( STRING_MATCH != (nErrorPos = ByteString( aUTF8Tester, RTL_TEXTENCODING_UTF8 ).Match( aTestee )) ) - { - aUTF8Tester = String( aTestee.GetBuffer(), nErrorPos, RTL_TEXTENCODING_UTF8 ); - nErrorPos = aUTF8Tester.Len(); - aErrorMsg = ByteString( "UTF8 Encoding seems to be broken" ); - return FALSE; - } - - nErrorPos = aUTF8Tester.SearchChar( String::CreateFromAscii( "\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0b\x0c\x0e\x0f" - "\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x7f" ).GetBuffer() ); - if ( nErrorPos != STRING_NOTFOUND ) - { - aErrorMsg = ByteString( "String contains illegal character" ); - return FALSE; - } - - if ( bFixTags ) - { - bHasBeenFixed = FALSE; - aFixed.Erase(); - } - - if ( !bAllowKeyIDs ) - { - BOOL bIsKeyID = FALSE; - BOOL bNewId = FALSE; - ByteString aID( aTestee ); - USHORT nAfterID = 0; - - if ( aTestee.Equals( "{&", 0, 2 ) ) - { // check for strings from instset_native like "{&Tahoma8}335795.Installation Wiza ..." - USHORT nTagEnd = aTestee.Search( '}' ); - if ( nTagEnd != STRING_NOTFOUND ) - { - if ( bFixTags ) - aFixed = aTestee.Copy( 0, nTagEnd+1 ); - nErrorPos = nTagEnd+1; - aID = aTestee.Copy( nTagEnd+1 ); - nAfterID = nTagEnd+1; - } - } - - ByteString aDelimiter( (String)String( sal_Unicode(0x2016) ), RTL_TEXTENCODING_UTF8 ); - - if ( aID.Equals( aDelimiter, 6, aDelimiter.Len() ) ) - { // New KeyId 6 Letters, digits and spechial chars followed by delimiter - bNewId = TRUE; - nErrorPos = 1; - aID = aID.Copy( 0, 6 ); - nAfterID += 6; - nAfterID = nAfterID + aDelimiter.Len(); - } - else if ( ( aID.GetChar(6) == '*' ) && aID.Equals( aDelimiter, 7, aDelimiter.Len() ) ) - { // New KeyId 6 Letters, digits and spechial chars followed by '*delimiter' to indicate translation in progress - bNewId = TRUE; - nErrorPos = 1; - aID = aID.Copy( 0, 6 ); - nAfterID += 7; - nAfterID = nAfterID + aDelimiter.Len(); - } - else if ( aID.GetTokenCount( '.' ) > 1 ) - { // test for old KeyIDs 5 to 6 digits followed by a dot '44373.' - bNewId = FALSE; - nErrorPos = 1; - aID = aID.GetToken( 0, '.' ); - nAfterID = nAfterID + aID.Len(); - } - else - { - aID.Erase(); - } - - if ( bNewId ) - { - if ( aID.Len() == 6 ) - { - bIsKeyID = TRUE; - ByteString aDigits("0123456789abcdefghijklmnopqrstuvwxyz+-<=>"); - for ( USHORT i=0 ; i < aID.Len() ;i++ ) - { - if ( aDigits.Search( aID.GetChar(i) ) == STRING_NOTFOUND ) - bIsKeyID = FALSE; - } - } - } - else - { - if ( aID.Len() > 0 && aID.GetChar(aID.Len()-1) == '*' ) - aID.Erase( aID.Len()-1 ); - - if ( aID.IsNumericAscii() && aID.Len() >= 5 ) - bIsKeyID = TRUE; - } - - if ( bIsKeyID ) - { - aErrorMsg = ByteString( "String contains KeyID" ); - if ( bFixTags ) - { - aFixed += aTestee.Copy( nAfterID ); - bHasBeenFixed = TRUE; - aErrorMsg = ByteString( "FIXED String containing KeyID" ); - } - else - aErrorMsg = ByteString( "String contains KeyID" ); - return FALSE; - } - } - - return TRUE; -} - -/*****************************************************************************/ -BOOL GSIBlock::TestUTF8( GSILine* pTestee, BOOL bFixTags ) -/*****************************************************************************/ -{ - USHORT nErrorPos = 0; - ByteString aErrorMsg; - BOOL bError = FALSE; - ByteString aFixed; - BOOL bHasBeenFixed = FALSE; - if ( !IsUTF8( pTestee->GetText(), bFixTags, nErrorPos, aErrorMsg, bHasBeenFixed, aFixed ) ) - { - ByteString aContext( pTestee->GetText().Copy( nErrorPos, 20 ) ); - PrintError( aErrorMsg.Append(" in Text at Position " ).Append( ByteString::CreateFromInt32( nErrorPos ) ), "Text format", aContext, pTestee->GetLineNumber(), pTestee->GetUniqId() ); - bError = TRUE; - if ( bHasBeenFixed ) - { - pTestee->SetText( aFixed ); - pTestee->SetFixed(); - } - } - if ( !IsUTF8( pTestee->GetQuickHelpText(), bFixTags, nErrorPos, aErrorMsg, bHasBeenFixed, aFixed ) ) - { - ByteString aContext( pTestee->GetQuickHelpText().Copy( nErrorPos, 20 ) ); - PrintError( aErrorMsg.Append(" in QuickHelpText at Position " ).Append( ByteString::CreateFromInt32( nErrorPos ) ), "Text format", aContext, pTestee->GetLineNumber(), pTestee->GetUniqId() ); - bError = TRUE; - if ( bHasBeenFixed ) - { - pTestee->SetQuickHelpText( aFixed ); - pTestee->SetFixed(); - } - } - if ( !IsUTF8( pTestee->GetTitle(), bFixTags, nErrorPos, aErrorMsg, bHasBeenFixed, aFixed ) ) - { - ByteString aContext( pTestee->GetTitle().Copy( nErrorPos, 20 ) ); - PrintError( aErrorMsg.Append(" in Title at Position " ).Append( ByteString::CreateFromInt32( nErrorPos ) ), "Text format", aContext, pTestee->GetLineNumber(), pTestee->GetUniqId() ); - bError = TRUE; - if ( bHasBeenFixed ) - { - pTestee->SetTitle( aFixed ); - pTestee->SetFixed(); - } - } - if ( bError ) - pTestee->NotOK(); - return !bError; -} - - -/*****************************************************************************/ -BOOL GSIBlock::HasSuspiciousChars( GSILine* pTestee, GSILine* pSource ) -/*****************************************************************************/ -{ - USHORT nPos = 0; - if ( !bAllowSuspicious && ( nPos = pTestee->GetText().Search("??")) != STRING_NOTFOUND ) - if ( pSource->GetText().Search("??") == STRING_NOTFOUND ) - { - String aUTF8Tester = String( pTestee->GetText(), 0, nPos, RTL_TEXTENCODING_UTF8 ); - USHORT nErrorPos = aUTF8Tester.Len(); - ByteString aContext( pTestee->GetText().Copy( nPos, 20 ) ); - PrintError( ByteString("Found double questionmark in translation only. Looks like an encoding problem at Position " ).Append( ByteString::CreateFromInt32( nErrorPos ) ), "Text format", aContext, pTestee->GetLineNumber(), pTestee->GetUniqId() ); - pTestee->NotOK(); - return TRUE; - } - - return FALSE; -} - - -/*****************************************************************************/ -BOOL GSIBlock::CheckSyntax( ULONG nLine, BOOL bRequireSourceLine, BOOL bFixTags ) -/*****************************************************************************/ -{ - static LingTest aTester; - BOOL bHasError = FALSE; - - if ( !pSourceLine ) - { - if ( bRequireSourceLine ) - { - PrintError( "No source language entry defined!", "File format", "", nLine ); - bHasBlockError = TRUE; - } - } - else - { - aTester.CheckReference( pSourceLine ); - if ( pSourceLine->HasMessages() ) - { - PrintList( pSourceLine->GetMessageList(), "ReferenceString", pSourceLine ); - pSourceLine->NotOK(); - bHasError = TRUE; - } - } - if ( bReference ) - { - if ( !pReferenceLine ) - { - GSILine *pSource; - if ( pSourceLine ) - pSource = pSourceLine; - else - pSource = GetObject( 0 ); // get some other line - if ( pSource ) - PrintError( "No reference line found. Entry is new in source file", "File format", "", pSource->GetLineNumber(), pSource->GetUniqId() ); - else - PrintError( "No reference line found. Entry is new in source file", "File format", "", nLine ); - bHasBlockError = TRUE; - } - else - { - if ( pSourceLine && !pSourceLine->Equals( *pReferenceLine ) ) - { - xub_StrLen nPos = pSourceLine->Match( *pReferenceLine ); - ByteString aContext( pReferenceLine->Copy( nPos - 5, 15) ); - aContext.Append( "\" --> \"" ).Append( pSourceLine->Copy( nPos - 5, 15) ); - PrintError( "Source Language Entry has changed.", "File format", aContext, pSourceLine->GetLineNumber(), pSourceLine->GetUniqId() ); - pSourceLine->NotOK(); - bHasError = TRUE; - } - } - } - - if ( pSourceLine ) - bHasError |= !TestUTF8( pSourceLine, bFixTags ); - - ULONG i; - for ( i = 0; i < Count(); i++ ) - { - aTester.CheckTestee( GetObject( i ), pSourceLine != NULL, bFixTags ); - if ( GetObject( i )->HasMessages() || aTester.HasCompareWarnings() ) - { - if ( GetObject( i )->HasMessages() || aTester.GetCompareWarnings().HasErrors() ) - GetObject( i )->NotOK(); - bHasError = TRUE; - PrintList( GetObject( i )->GetMessageList(), "Translation", GetObject( i ) ); - PrintList( &(aTester.GetCompareWarnings()), "Translation Tag Missmatch", GetObject( i ) ); - } - bHasError |= !TestUTF8( GetObject( i ), bFixTags ); - if ( pSourceLine ) - bHasError |= HasSuspiciousChars( GetObject( i ), pSourceLine ); - } - - return bHasError || bHasBlockError; -} - -void GSIBlock::WriteError( LazySvFileStream &aErrOut, BOOL bRequireSourceLine ) -{ - if ( pSourceLine && pSourceLine->IsOK() && bCheckSourceLang && !bHasBlockError ) - return; - - BOOL bHasError = FALSE; - BOOL bCopyAll = ( !pSourceLine && bRequireSourceLine ) || ( pSourceLine && !pSourceLine->IsOK() && !bCheckTranslationLang ) || bHasBlockError; - ULONG i; - for ( i = 0; i < Count(); i++ ) - { - if ( !GetObject( i )->IsOK() || bCopyAll ) - { - bHasError = TRUE; - aErrOut.LazyOpen(); - aErrOut.WriteLine( *GetObject( i ) ); - } - } - - if ( pSourceLine && ( bHasError || !pSourceLine->IsOK() ) && !( !bHasError && bCheckTranslationLang ) ) - { - aErrOut.LazyOpen(); - aErrOut.WriteLine( *pSourceLine ); - } -} - -void GSIBlock::WriteCorrect( LazySvFileStream &aOkOut, BOOL bRequireSourceLine ) -{ - if ( ( !pSourceLine && bRequireSourceLine ) || ( pSourceLine && !pSourceLine->IsOK() && !bCheckTranslationLang ) ) - return; - - BOOL bHasOK = FALSE; - ULONG i; - for ( i = 0; i < Count(); i++ ) - { - if ( ( GetObject( i )->IsOK() || bCheckSourceLang ) && !bHasBlockError ) - { - bHasOK = TRUE; - aOkOut.LazyOpen(); - aOkOut.WriteLine( *GetObject( i ) ); - } - } - - if ( ( pSourceLine && pSourceLine->IsOK() && ( Count() || !bCheckTranslationLang ) ) || ( bHasOK && bCheckTranslationLang ) ) - { - aOkOut.LazyOpen(); - aOkOut.WriteLine( *pSourceLine ); - } -} - -void GSIBlock::WriteFixed( LazySvFileStream &aFixOut, BOOL /*bRequireSourceLine*/ ) -{ - if ( pSourceLine && !pSourceLine->IsFixed() && bCheckSourceLang ) - return; - - BOOL bHasFixes = FALSE; - ULONG i; - for ( i = 0; i < Count(); i++ ) - { - if ( GetObject( i )->IsFixed() ) - { - bHasFixes = TRUE; - aFixOut.LazyOpen(); - aFixOut.WriteLine( *GetObject( i ) ); - } - } - - if ( pSourceLine && ( bHasFixes || pSourceLine->IsFixed() ) ) - { - aFixOut.LazyOpen(); - aFixOut.WriteLine( *pSourceLine ); - } -} - - -/*****************************************************************************/ -/*****************************************************************************/ -/*****************************************************************************/ -/*****************************************************************************/ -/*****************************************************************************/ -/*****************************************************************************/ -/*****************************************************************************/ - -/*****************************************************************************/ -void Help() -/*****************************************************************************/ -{ - fprintf( stdout, "\n" ); - fprintf( stdout, "gsicheck Version 1.9.0 (c)1999 - 2006 by SUN Microsystems\n" ); - fprintf( stdout, "=========================================================\n" ); - fprintf( stdout, "\n" ); - fprintf( stdout, "gsicheck checks the syntax of tags in GSI-Files and SDF-Files\n" ); - fprintf( stdout, " checks for inconsistencies and malicious UTF8 encoding\n" ); - fprintf( stdout, " checks tags in Online Help\n" ); - fprintf( stdout, " checks for *new* KeyIDs and relax GID/LID length to %s\n", ByteString::CreateFromInt32(MAX_GID_LID_LEN).GetBuffer() ); - fprintf( stdout, "\n" ); - fprintf( stdout, "Syntax: gsicheck [ -c ] [-f] [ -we ] [ -wef ErrorFilename ] [ -wc ]\n" ); - fprintf( stdout, " [ -wcf CorrectFilename ] [ -s | -t ] [ -l LanguageID ]\n" ); - fprintf( stdout, " [ -r ReferenceFile ] filename\n" ); - fprintf( stdout, "\n" ); - fprintf( stdout, "-c Add context to error message (Print the line containing the error)\n" ); - fprintf( stdout, "-f try to fix errors. See also -wf -wff \n" ); - fprintf( stdout, "-wf Write File containing all fixed parts\n" ); - fprintf( stdout, "-wff Same as above but give own filename\n" ); - fprintf( stdout, "-we Write File containing all errors\n" ); - fprintf( stdout, "-wef Same as above but give own filename\n" ); - fprintf( stdout, "-wc Write File containing all correct parts\n" ); - fprintf( stdout, "-wcf Same as above but give own filename\n" ); - fprintf( stdout, "-s Check only source language. Should be used before handing out to vendor.\n" ); - fprintf( stdout, "-t Check only Translation language(s). Should be used before merging.\n" ); - fprintf( stdout, "-k Allow KeyIDs to be present in strings\n" ); - fprintf( stdout, "-e disable encoding checks. E.g.: double questionmark \'??\' which may be the\n" ); - fprintf( stdout, " result of false conversions\n" ); - fprintf( stdout, "-l ISO Languagecode or numerical 2 digits Identifier of the source language.\n" ); - fprintf( stdout, " Default is en-US. Use \"\" (empty string) or 'none'\n" ); - fprintf( stdout, " to disable source language dependent checks\n" ); - fprintf( stdout, "-r Reference filename to check that source language entries\n" ); - fprintf( stdout, " have not been changed\n" ); - fprintf( stdout, "\n" ); -} - -/*****************************************************************************/ -#if defined(UNX) || defined(OS2) -int main( int argc, char *argv[] ) -#else -int _cdecl main( int argc, char *argv[] ) -#endif -/*****************************************************************************/ -{ - - BOOL bError = FALSE; - BOOL bPrintContext = FALSE; - BOOL bCheckSourceLang = FALSE; - BOOL bCheckTranslationLang = FALSE; - BOOL bWriteError = FALSE; - BOOL bWriteCorrect = FALSE; - BOOL bWriteFixed = FALSE; - BOOL bFixTags = FALSE; - BOOL bAllowKID = FALSE; - BOOL bAllowSuspicious = FALSE; - String aErrorFilename; - String aCorrectFilename; - String aFixedFilename; - BOOL bFileHasError = FALSE; - ByteString aSourceLang( "en-US" ); // English is default - ByteString aFilename; - ByteString aReferenceFilename; - BOOL bReferenceFile = FALSE; - for ( USHORT i = 1 ; i < argc ; i++ ) - { - if ( *argv[ i ] == '-' ) - { - switch (*(argv[ i ]+1)) - { - case 'c':bPrintContext = TRUE; - break; - case 'w': - { - if ( (*(argv[ i ]+2)) == 'e' ) - { - if ( (*(argv[ i ]+3)) == 'f' ) - if ( (i+1) < argc ) - { - aErrorFilename = String( argv[ i+1 ], RTL_TEXTENCODING_ASCII_US ); - bWriteError = TRUE; - i++; - } - else - { - fprintf( stderr, "\nERROR: Switch %s requires parameter!\n\n", argv[ i ] ); - bError = TRUE; - } - else - bWriteError = TRUE; - } - else if ( (*(argv[ i ]+2)) == 'c' ) - if ( (*(argv[ i ]+3)) == 'f' ) - if ( (i+1) < argc ) - { - aCorrectFilename = String( argv[ i+1 ], RTL_TEXTENCODING_ASCII_US ); - bWriteCorrect = TRUE; - i++; - } - else - { - fprintf( stderr, "\nERROR: Switch %s requires parameter!\n\n", argv[ i ] ); - bError = TRUE; - } - else - bWriteCorrect = TRUE; - else if ( (*(argv[ i ]+2)) == 'f' ) - if ( (*(argv[ i ]+3)) == 'f' ) - if ( (i+1) < argc ) - { - aFixedFilename = String( argv[ i+1 ], RTL_TEXTENCODING_ASCII_US ); - bWriteFixed = TRUE; - bFixTags = TRUE; - i++; - } - else - { - fprintf( stderr, "\nERROR: Switch %s requires parameter!\n\n", argv[ i ] ); - bError = TRUE; - } - else - { - bWriteFixed = TRUE; - bFixTags = TRUE; - } - else - { - fprintf( stderr, "\nERROR: Unknown Switch %s!\n\n", argv[ i ] ); - bError = TRUE; - } - } - break; - case 's':bCheckSourceLang = TRUE; - break; - case 't':bCheckTranslationLang = TRUE; - break; - case 'l': - { - if ( (i+1) < argc ) - { - aSourceLang = ByteString( argv[ i+1 ] ); - if ( aSourceLang.EqualsIgnoreCaseAscii( "none" ) ) - aSourceLang.Erase(); - i++; - } - else - { - fprintf( stderr, "\nERROR: Switch %s requires parameter!\n\n", argv[ i ] ); - bError = TRUE; - } - } - break; - case 'r': - { - if ( (i+1) < argc ) - { - aReferenceFilename = argv[ i+1 ]; - bReferenceFile = TRUE; - i++; - } - else - { - fprintf( stderr, "\nERROR: Switch %s requires parameter!\n\n", argv[ i ] ); - bError = TRUE; - } - } - break; - case 'f': - { - bFixTags = TRUE; - } - break; - case 'k': - { - bAllowKID = TRUE; - } - break; - case 'e': - { - bAllowSuspicious = TRUE; - } - break; - default: - fprintf( stderr, "\nERROR: Unknown Switch %s!\n\n", argv[ i ] ); - bError = TRUE; - } - } - else - { - if ( !aFilename.Len()) - aFilename = ByteString( argv[ i ] ); - else - { - fprintf( stderr, "\nERROR: Only one filename may be specified!\n\n"); - bError = TRUE; - } - } - } - - - if ( !aFilename.Len() || bError ) - { - Help(); - exit ( 0 ); - } - - if ( aSourceLang.Len() && !LanguageOK( aSourceLang ) ) - { - fprintf( stderr, "\nERROR: The Language '%s' is invalid!\n\n", aSourceLang.GetBuffer() ); - Help(); - exit ( 1 ); - } - - if ( bCheckSourceLang && bCheckTranslationLang ) - { - fprintf( stderr, "\nERROR: The Options -s and -t are mutually exclusive.\nUse only one of them.\n\n" ); - Help(); - exit ( 1 ); - } - - - - DirEntry aSource = DirEntry( String( aFilename, RTL_TEXTENCODING_ASCII_US )); - if ( !aSource.Exists()) { - fprintf( stderr, "\nERROR: GSI-File %s not found!\n\n", aFilename.GetBuffer() ); - exit ( 2 ); - } - - SvFileStream aGSI( String( aFilename, RTL_TEXTENCODING_ASCII_US ), STREAM_STD_READ ); - if ( !aGSI.IsOpen()) { - fprintf( stderr, "\nERROR: Could not open GSI-File %s!\n\n", aFilename.GetBuffer() ); - exit ( 3 ); - } - - SvFileStream aReferenceGSI; - if ( bReferenceFile ) - { - DirEntry aReferenceSource = DirEntry( String( aReferenceFilename, RTL_TEXTENCODING_ASCII_US )); - if ( !aReferenceSource.Exists()) { - fprintf( stderr, "\nERROR: GSI-File %s not found!\n\n", aFilename.GetBuffer() ); - exit ( 2 ); - } - - aReferenceGSI.Open( String( aReferenceFilename, RTL_TEXTENCODING_ASCII_US ), STREAM_STD_READ ); - if ( !aReferenceGSI.IsOpen()) { - fprintf( stderr, "\nERROR: Could not open Input-File %s!\n\n", aFilename.GetBuffer() ); - exit ( 3 ); - } - } - - LazySvFileStream aOkOut; - String aBaseName = aSource.GetBase(); - if ( bWriteCorrect ) - { - if ( !aCorrectFilename.Len() ) - { - String sTmpBase( aBaseName ); - sTmpBase += String( "_ok", RTL_TEXTENCODING_ASCII_US ); - aSource.SetBase( sTmpBase ); - aCorrectFilename = aSource.GetFull(); - } - aOkOut.SetOpenParams( aCorrectFilename , STREAM_STD_WRITE | STREAM_TRUNC ); - } - - LazySvFileStream aErrOut; - if ( bWriteError ) - { - if ( !aErrorFilename.Len() ) - { - String sTmpBase( aBaseName ); - sTmpBase += String( "_err", RTL_TEXTENCODING_ASCII_US ); - aSource.SetBase( sTmpBase ); - aErrorFilename = aSource.GetFull(); - } - aErrOut.SetOpenParams( aErrorFilename , STREAM_STD_WRITE | STREAM_TRUNC ); - } - - LazySvFileStream aFixOut; - if ( bWriteFixed ) - { - if ( !aFixedFilename.Len() ) - { - String sTmpBase( aBaseName ); - sTmpBase += String( "_fix", RTL_TEXTENCODING_ASCII_US ); - aSource.SetBase( sTmpBase ); - aFixedFilename = aSource.GetFull(); - } - aFixOut.SetOpenParams( aFixedFilename , STREAM_STD_WRITE | STREAM_TRUNC ); - } - - - ByteString sReferenceLine; - GSILine* pReferenceLine = NULL; - ByteString aOldReferenceId("No Valid ID"); // just set to something which can never be an ID - ULONG nReferenceLine = 0; - - ByteString sGSILine; - GSILine* pGSILine = NULL; - ByteString aOldId("No Valid ID"); // just set to something which can never be an ID - GSIBlock *pBlock = NULL; - ULONG nLine = 0; - - while ( !aGSI.IsEof() ) - { - aGSI.ReadLine( sGSILine ); - nLine++; - pGSILine = new GSILine( sGSILine, nLine ); - BOOL bDelete = TRUE; - - - if ( pGSILine->Len() ) - { - if ( FORMAT_UNKNOWN == pGSILine->GetLineFormat() ) - { - PrintError( "Format of line is unknown. Ignoring!", "Line format", pGSILine->Copy( 0,40 ), bPrintContext, pGSILine->GetLineNumber() ); - pGSILine->NotOK(); - if ( bWriteError ) - { - bFileHasError = TRUE; - aErrOut.LazyOpen(); - aErrOut.WriteLine( *pGSILine ); - } - } - else if ( pGSILine->GetLineType().EqualsIgnoreCaseAscii("res-comment") ) - { // ignore comment lines, but write them to Correct Items File - if ( bWriteCorrect ) - { - aOkOut.LazyOpen(); - aOkOut.WriteLine( *pGSILine ); - } - } - else - { - ByteString aId = pGSILine->GetUniqId(); - if ( aId != aOldId ) - { - if ( pBlock ) - { - bFileHasError |= pBlock->CheckSyntax( nLine, aSourceLang.Len() != 0, bFixTags ); - - if ( bWriteError ) - pBlock->WriteError( aErrOut, aSourceLang.Len() != 0 ); - if ( bWriteCorrect ) - pBlock->WriteCorrect( aOkOut, aSourceLang.Len() != 0 ); - if ( bWriteFixed ) - pBlock->WriteFixed( aFixOut, aSourceLang.Len() != 0 ); - - delete pBlock; - } - pBlock = new GSIBlock( bPrintContext, bCheckSourceLang, bCheckTranslationLang, bReferenceFile, bAllowKID, bAllowSuspicious ); - - aOldId = aId; - - - // find corresponding line in reference file - if ( bReferenceFile ) - { - BOOL bContinueSearching = TRUE; - while ( ( !aReferenceGSI.IsEof() || pReferenceLine ) && bContinueSearching ) - { - if ( !pReferenceLine ) - { - aReferenceGSI.ReadLine( sReferenceLine ); - nReferenceLine++; - pReferenceLine = new GSILine( sReferenceLine, nReferenceLine ); - } - if ( pReferenceLine->GetLineFormat() != FORMAT_UNKNOWN ) - { - if ( pReferenceLine->GetUniqId() == aId && pReferenceLine->GetLanguageId().Equals( aSourceLang ) ) - { - pBlock->SetReferenceLine( pReferenceLine ); - pReferenceLine = NULL; - } - else if ( pReferenceLine->GetUniqId() > aId ) - { -// if ( pGSILine->GetLanguageId() == aSourceLang ) -// PrintError( "No reference line found. Entry is new in source file", "File format", "", bPrintContext, pGSILine->GetLineNumber(), aId ); - bContinueSearching = FALSE; - } - else - { - if ( pReferenceLine->GetUniqId() < aId && pReferenceLine->GetLanguageId().Equals( aSourceLang ) ) - PrintError( "No Entry in source file found. Entry has been removed from source file", "File format", "", bPrintContext, pGSILine->GetLineNumber(), pReferenceLine->GetUniqId() ); - delete pReferenceLine; - pReferenceLine = NULL; - } - } - else - { - delete pReferenceLine; - pReferenceLine = NULL; - } - - } - } - - } - - pBlock->InsertLine( pGSILine, aSourceLang ); - bDelete = FALSE; - } - } - if ( bDelete ) - delete pGSILine; - - } - if ( pBlock ) - { - bFileHasError |= pBlock->CheckSyntax( nLine, aSourceLang.Len() != 0, bFixTags ); - - if ( bWriteError ) - pBlock->WriteError( aErrOut, aSourceLang.Len() != 0 ); - if ( bWriteCorrect ) - pBlock->WriteCorrect( aOkOut, aSourceLang.Len() != 0 ); - if ( bWriteFixed ) - pBlock->WriteFixed( aFixOut, aSourceLang.Len() != 0 ); - - delete pBlock; - } - aGSI.Close(); - - if ( bWriteError ) - aErrOut.Close(); - if ( bWriteCorrect ) - aOkOut.Close(); - if ( bWriteFixed ) - aFixOut.Close(); - - if ( bFileHasError ) - return 55; - else - return 0; -} diff --git a/transex3/source/gsiconv.cxx b/transex3/source/gsiconv.cxx deleted file mode 100644 index f6dea76ebb51..000000000000 --- a/transex3/source/gsiconv.cxx +++ /dev/null @@ -1,372 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: gsiconv.cxx,v $ - * $Revision: 1.8 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_transex3.hxx" -#include -#include -#include - -// local includes -#include "utf8conv.hxx" - -#define GSI_FILE_UNKNOWN 0x0000 -#define GSI_FILE_OLDSTYLE 0x0001 -#define GSI_FILE_L10NFRAMEWORK 0x0002 - -/*****************************************************************************/ -USHORT GetGSIFileType( SvStream &rStream ) -/*****************************************************************************/ -{ - USHORT nFileType = GSI_FILE_UNKNOWN; - - ULONG nPos( rStream.Tell()); - rStream.Seek( STREAM_SEEK_TO_BEGIN ); - - ByteString sLine; - while( !rStream.IsEof() && !sLine.Len()) - rStream.ReadLine( sLine ); - - if( sLine.Len()) { - if( sLine.Search( "($$)" ) != STRING_NOTFOUND ) - nFileType = GSI_FILE_OLDSTYLE; - else - nFileType = GSI_FILE_L10NFRAMEWORK; - } - - rStream.Seek( nPos ); - - return nFileType; -} - -/*****************************************************************************/ -ByteString GetGSILineId( const ByteString &rLine, USHORT nFileType ) -/*****************************************************************************/ -{ - ByteString sId; - switch ( nFileType ) { - case GSI_FILE_OLDSTYLE: - sId = rLine; - sId.SearchAndReplaceAll( "($$)", "\t" ); - sId = sId.GetToken( 0, '\t' ); - break; - - case GSI_FILE_L10NFRAMEWORK: - sId = rLine.GetToken( 0, '\t' ); - sId += "\t"; - sId += rLine.GetToken( 1, '\t' ); - sId += "\t"; - sId += rLine.GetToken( 4, '\t' ); - sId += "\t"; - sId += rLine.GetToken( 5, '\t' ); - break; - } - return sId; -} - -/*****************************************************************************/ -ByteString GetGSILineLangId( const ByteString &rLine, USHORT nFileType ) -/*****************************************************************************/ -{ - ByteString sLangId; - switch ( nFileType ) { - case GSI_FILE_OLDSTYLE: - sLangId = rLine; - sLangId.SearchAndReplaceAll( "($$)", "\t" ); - sLangId = sLangId.GetToken( 2, '\t' ); - break; - - case GSI_FILE_L10NFRAMEWORK: - sLangId = rLine.GetToken( 9, '\t' ); - break; - } - return sLangId; -} - -/*****************************************************************************/ -void ConvertGSILine( BOOL bToUTF8, ByteString &rLine, - rtl_TextEncoding nEncoding, USHORT nFileType ) -/*****************************************************************************/ -{ - switch ( nFileType ) { - case GSI_FILE_OLDSTYLE: - if ( bToUTF8 ) - rLine = UTF8Converter::ConvertToUTF8( rLine, nEncoding ); - else - rLine = UTF8Converter::ConvertFromUTF8( rLine, nEncoding ); - break; - - case GSI_FILE_L10NFRAMEWORK: { - ByteString sConverted; - for ( USHORT i = 0; i < rLine.GetTokenCount( '\t' ); i++ ) { - ByteString sToken = rLine.GetToken( i, '\t' ); - if (( i > 9 ) && ( i < 14 )) { - if( bToUTF8 ) - sToken = UTF8Converter::ConvertToUTF8( sToken, nEncoding ); - else - sToken = UTF8Converter::ConvertFromUTF8( sToken, nEncoding ); - } - if ( i ) - sConverted += "\t"; - sConverted += sToken; - } - rLine = sConverted; - } - break; - } -} - -/*****************************************************************************/ -void Help() -/*****************************************************************************/ -{ - fprintf( stdout, "\n" ); - fprintf( stdout, "gsiconv (c)1999 by StarOffice Entwicklungs GmbH\n" ); - fprintf( stdout, "===============================================\n" ); - fprintf( stdout, "\n" ); - fprintf( stdout, "gsiconv converts strings in GSI-Files (Gutschmitt Interface) from or to UTF-8\n" ); - fprintf( stdout, "\n" ); - fprintf( stdout, "Syntax: gsiconv (-t|-f langid charset)|(-p n) filename\n" ); - fprintf( stdout, "Switches: -t => conversion from charset to UTF-8\n" ); - fprintf( stdout, " -f => conversion from UTF-8 to charset\n" ); - fprintf( stdout, " -p n => creates several files with ca. n lines\n" ); - fprintf( stdout, "\n" ); - fprintf( stdout, "Allowed charsets:\n" ); - fprintf( stdout, " MS_932 => Japanese\n" ); - fprintf( stdout, " MS_936 => Chinese Simplified\n" ); - fprintf( stdout, " MS_949 => Korean\n" ); - fprintf( stdout, " MS_950 => Chinese Traditional\n" ); - fprintf( stdout, " MS_1250 => East Europe\n" ); - fprintf( stdout, " MS_1251 => Cyrillic\n" ); - fprintf( stdout, " MS_1252 => West Europe\n" ); - fprintf( stdout, " MS_1253 => Greek\n" ); - fprintf( stdout, " MS_1254 => Turkish\n" ); - fprintf( stdout, " MS_1255 => Hebrew\n" ); - fprintf( stdout, " MS_1256 => Arabic\n" ); - fprintf( stdout, "\n" ); - fprintf( stdout, "Allowed langids:\n" ); - fprintf( stdout, " 1 => ENGLISH_US\n" ); - fprintf( stdout, " 3 => PORTUGUESE \n" ); - fprintf( stdout, " 4 => GERMAN_DE (new german style)\n" ); - fprintf( stdout, " 7 => RUSSIAN\n" ); - fprintf( stdout, " 30 => GREEK\n" ); - fprintf( stdout, " 31 => DUTCH\n" ); - fprintf( stdout, " 33 => FRENCH\n" ); - fprintf( stdout, " 34 => SPANISH\n" ); - fprintf( stdout, " 35 => FINNISH\n" ); - fprintf( stdout, " 36 => HUNGARIAN\n" ); - fprintf( stdout, " 39 => ITALIAN\n" ); - fprintf( stdout, " 42 => CZECH\n" ); - fprintf( stdout, " 44 => ENGLISH (UK)\n" ); - fprintf( stdout, " 45 => DANISH\n" ); - fprintf( stdout, " 46 => SWEDISH\n" ); - fprintf( stdout, " 47 => NORWEGIAN\n" ); - fprintf( stdout, " 49 => GERMAN (old german style)\n" ); - fprintf( stdout, " 55 => PORTUGUESE_BRAZILIAN\n" ); - fprintf( stdout, " 81 => JAPANESE\n" ); - fprintf( stdout, " 82 => KOREAN\n" ); - fprintf( stdout, " 86 => CHINESE_SIMPLIFIED\n" ); - fprintf( stdout, " 88 => CHINESE_TRADITIONAL\n" ); - fprintf( stdout, " 90 => TURKISH\n" ); - fprintf( stdout, " 96 => ARABIC\n" ); - fprintf( stdout, " 97 => HEBREW\n" ); - fprintf( stdout, "\n" ); -} - -/*****************************************************************************/ -#if defined(UNX) || defined(OS2) -int main( int argc, char *argv[] ) -#else -int _cdecl main( int argc, char *argv[] ) -#endif -/*****************************************************************************/ -{ - if (( argc != 5 ) && ( argc != 4 )) { - Help(); - exit ( 0 ); - } - - if ( argc == 4 ) { - if ( ByteString( argv[ 1 ] ) == "-p" ) { - - DirEntry aSource = DirEntry( String( argv[ 3 ], RTL_TEXTENCODING_ASCII_US )); - if ( !aSource.Exists()) { - fprintf( stderr, "\nERROR: GSI-File %s not found!\n\n", ByteString( argv[ 3 ] ).GetBuffer()); - exit ( 2 ); - } - - DirEntry aOutput( aSource ); - - String sBase = aOutput.GetBase(); - String sExt = aOutput.GetExtension(); - - String sGSI( argv[ 3 ], RTL_TEXTENCODING_ASCII_US ); - SvFileStream aGSI( sGSI, STREAM_STD_READ ); - if ( !aGSI.IsOpen()) { - fprintf( stderr, "\nERROR: Could not open GSI-File %s!\n\n", ByteString( argv[ 3 ] ).GetBuffer()); - exit ( 3 ); - } - - USHORT nFileType( GetGSIFileType( aGSI )); - - ULONG nMaxLines = (ULONG) ByteString( argv[ 2 ] ).ToInt64(); - if ( !nMaxLines ) { - fprintf( stderr, "\nERROR: Linecount must be at least 1!\n\n" ); - exit ( 3 ); - } - - ByteString sGSILine; - ByteString sOldId; - ULONG nLine = 0; - ULONG nOutputFile = 1; - - String sOutput( sBase ); - sOutput += String( "_", RTL_TEXTENCODING_ASCII_US ); - sOutput += String::CreateFromInt64( nOutputFile ); - if ( sExt.Len()) { - sOutput += String( ".", RTL_TEXTENCODING_ASCII_US ); - sOutput += sExt; - } - nOutputFile ++; - - aOutput.SetName( sOutput ); - SvFileStream aOutputStream( aOutput.GetFull(), STREAM_STD_WRITE | STREAM_TRUNC ); - - while ( !aGSI.IsEof()) { - - aGSI.ReadLine( sGSILine ); - ByteString sId( GetGSILineId( sGSILine, nFileType )); - - nLine++; - - if (( nLine >= nMaxLines ) && ( sId != sOldId )) { - aOutputStream.Close(); - - ByteString sText( aOutput.GetFull(), gsl_getSystemTextEncoding()); - sText += " with "; - sText += ByteString::CreateFromInt64( nLine ); - sText += " lines written."; - - fprintf( stdout, "%s\n", sText.GetBuffer()); - String sOutput1( sBase ); - sOutput1 += String( "_", RTL_TEXTENCODING_ASCII_US ); - sOutput1 += String::CreateFromInt64( nOutputFile ); - if ( sExt.Len()) { - sOutput1 += String( ".", RTL_TEXTENCODING_ASCII_US ); - sOutput1 += sExt; - } - nOutputFile ++; - - aOutput.SetName( sOutput1 ); - - aOutputStream.Open( aOutput.GetFull(), STREAM_STD_WRITE | STREAM_TRUNC ); - nLine = 0; - } - - aOutputStream.WriteLine( sGSILine ); - - sOldId = sId; - } - - aGSI.Close(); - aOutputStream.Close(); - - ByteString sText( aOutput.GetFull(), RTL_TEXTENCODING_ASCII_US ); - sText += " with "; - sText += ByteString::CreateFromInt64( nLine ); - sText += " lines written."; - } - else { - Help(); - exit( 1 ); - } - } - else { - if ( ByteString( argv[ 1 ] ) == "-t" || ByteString( argv[ 1 ] ) == "-f" ) { - rtl_TextEncoding nEncoding; - - ByteString sCurLangId( argv[ 2 ] ); - - ByteString sCharset( argv[ 3 ] ); - sCharset.ToUpperAscii(); - - if ( sCharset == "MS_932" ) nEncoding = RTL_TEXTENCODING_MS_932; - else if ( sCharset == "MS_936" ) nEncoding = RTL_TEXTENCODING_MS_936; - else if ( sCharset == "MS_949" ) nEncoding = RTL_TEXTENCODING_MS_949; - else if ( sCharset == "MS_950" ) nEncoding = RTL_TEXTENCODING_MS_950; - else if ( sCharset == "MS_1250" ) nEncoding = RTL_TEXTENCODING_MS_1250; - else if ( sCharset == "MS_1251" ) nEncoding = RTL_TEXTENCODING_MS_1251; - else if ( sCharset == "MS_1252" ) nEncoding = RTL_TEXTENCODING_MS_1252; - else if ( sCharset == "MS_1253" ) nEncoding = RTL_TEXTENCODING_MS_1253; - else if ( sCharset == "MS_1254" ) nEncoding = RTL_TEXTENCODING_MS_1254; - else if ( sCharset == "MS_1255" ) nEncoding = RTL_TEXTENCODING_MS_1255; - else if ( sCharset == "MS_1256" ) nEncoding = RTL_TEXTENCODING_MS_1256; - else if ( sCharset == "MS_1257" ) nEncoding = RTL_TEXTENCODING_MS_1257; - else if ( sCharset == "UTF8" ) nEncoding = RTL_TEXTENCODING_UTF8; - - else { - Help(); - exit ( 1 ); - } - - DirEntry aSource = DirEntry( String( argv[ 4 ], RTL_TEXTENCODING_ASCII_US )); - if ( !aSource.Exists()) { - fprintf( stderr, "\nERROR: GSI-File %s not found!\n\n", ByteString( argv[ 3 ] ).GetBuffer()); - exit ( 2 ); - } - - String sGSI( argv[ 4 ], RTL_TEXTENCODING_ASCII_US ); - SvFileStream aGSI( sGSI, STREAM_STD_READ ); - if ( !aGSI.IsOpen()) { - fprintf( stderr, "\nERROR: Could not open GSI-File %s!\n\n", ByteString( argv[ 3 ] ).GetBuffer()); - exit ( 3 ); - } - USHORT nFileType( GetGSIFileType( aGSI )); - - ByteString sGSILine; - while ( !aGSI.IsEof()) { - - aGSI.ReadLine( sGSILine ); - ByteString sLangId( GetGSILineLangId( sGSILine, nFileType )); - if ( sLangId == sCurLangId ) - ConvertGSILine(( ByteString( argv[ 1 ] ) == "-t" ), sGSILine, nEncoding, nFileType ); - - fprintf( stdout, "%s\n", sGSILine.GetBuffer()); - } - - aGSI.Close(); - } - else { - Help(); - exit( 1 ); - } - } - return 0; -} diff --git a/transex3/source/help/HelpCompiler.cxx b/transex3/source/help/HelpCompiler.cxx deleted file mode 100644 index 5001d0907972..000000000000 --- a/transex3/source/help/HelpCompiler.cxx +++ /dev/null @@ -1,593 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: HelpCompiler.cxx,v $ - * $Revision: 1.9 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -#include "HelpCompiler.hxx" -#include -#include -#include -#include -#include -#include -#include -#ifdef __MINGW32__ -#include -#include -#endif -#include - -static void impl_sleep( sal_uInt32 nSec ) -{ - TimeValue aTime; - aTime.Seconds = nSec; - aTime.Nanosec = 0; - - osl::Thread::wait( aTime ); -} - -HelpCompiler::HelpCompiler(StreamTable &in_streamTable, const fs::path &in_inputFile, - const fs::path &in_src, const fs::path &in_resEmbStylesheet, - const std::string &in_module, const std::string &in_lang, bool in_bExtensionMode) - : streamTable(in_streamTable), inputFile(in_inputFile), - src(in_src), module(in_module), lang(in_lang), resEmbStylesheet(in_resEmbStylesheet), - bExtensionMode( in_bExtensionMode ) -{ - xmlKeepBlanksDefaultValue = 0; -} - -xmlDocPtr HelpCompiler::getSourceDocument(const fs::path &filePath) -{ - static const char *params[4 + 1]; - static xsltStylesheetPtr cur = NULL; - - xmlDocPtr res; - if( bExtensionMode ) - { - res = xmlParseFile(filePath.native_file_string().c_str()); - if( !res ){ - impl_sleep( 3 ); - res = xmlParseFile(filePath.native_file_string().c_str()); - } - } - else - { - if (!cur) - { - static std::string fsroot('\'' + src.toUTF8() + '\''); - static std::string esclang('\'' + lang + '\''); - - xmlSubstituteEntitiesDefault(1); - xmlLoadExtDtdDefaultValue = 1; - cur = xsltParseStylesheetFile((const xmlChar *)resEmbStylesheet.native_file_string().c_str()); - - int nbparams = 0; - params[nbparams++] = "Language"; - params[nbparams++] = esclang.c_str(); - params[nbparams++] = "fsroot"; - params[nbparams++] = fsroot.c_str(); - params[nbparams] = NULL; - } - xmlDocPtr doc = xmlParseFile(filePath.native_file_string().c_str()); - if( !doc ) - { - impl_sleep( 3 ); - doc = xmlParseFile(filePath.native_file_string().c_str()); - } - - //???res = xmlParseFile(filePath.native_file_string().c_str()); - - res = xsltApplyStylesheet(cur, doc, params); - xmlFreeDoc(doc); - } - return res; -} - -HashSet HelpCompiler::switchFind(xmlDocPtr doc) -{ - HashSet hs; - xmlChar *xpath = (xmlChar*)"//switchinline"; - - xmlXPathContextPtr context = xmlXPathNewContext(doc); - xmlXPathObjectPtr result = xmlXPathEvalExpression(xpath, context); - xmlXPathFreeContext(context); - if (result) - { - xmlNodeSetPtr nodeset = result->nodesetval; - for (int i = 0; i < nodeset->nodeNr; i++) - { - xmlNodePtr el = nodeset->nodeTab[i]; - xmlChar *select = xmlGetProp(el, (xmlChar*)"select"); - if (select) - { - if (!strcmp((const char*)select, "appl")) - { - xmlNodePtr n1 = el->xmlChildrenNode; - while (n1) - { - if ((!xmlStrcmp(n1->name, (const xmlChar*)"caseinline"))) - { - xmlChar *appl = xmlGetProp(n1, (xmlChar*)"select"); - hs.push_back(std::string((const char*)appl)); - xmlFree(appl); - } - else if ((!xmlStrcmp(n1->name, (const xmlChar*)"defaultinline"))) - hs.push_back(std::string("DEFAULT")); - n1 = n1->next; - } - } - xmlFree(select); - } - } - xmlXPathFreeObject(result); - } - hs.push_back(std::string("DEFAULT")); - return hs; -} - -// returns a node representing the whole stuff compiled for the current -// application. -xmlNodePtr HelpCompiler::clone(xmlNodePtr node, const std::string& appl) -{ - xmlNodePtr parent = xmlCopyNode(node, 2); - xmlNodePtr n = node->xmlChildrenNode; - while (n != NULL) - { - bool isappl = false; - if ( (!strcmp((const char*)n->name, "switchinline")) || - (!strcmp((const char*)n->name, "switch")) ) - { - xmlChar *select = xmlGetProp(n, (xmlChar*)"select"); - if (select) - { - if (!strcmp((const char*)select, "appl")) - isappl = true; - xmlFree(select); - } - } - if (isappl) - { - xmlNodePtr caseNode = n->xmlChildrenNode; - if (appl == "DEFAULT") - { - while (caseNode) - { - if (!strcmp((const char*)caseNode->name, "defaultinline")) - { - xmlNodePtr cnl = caseNode->xmlChildrenNode; - while (cnl) - { - xmlAddChild(parent, clone(cnl, appl)); - cnl = cnl->next; - } - break; - } - caseNode = caseNode->next; - } - } - else - { - while (caseNode) - { - isappl=false; - if (!strcmp((const char*)caseNode->name, "caseinline")) - { - xmlChar *select = xmlGetProp(n, (xmlChar*)"select"); - if (select) - { - if (!strcmp((const char*)select, appl.c_str())) - isappl = true; - xmlFree(select); - } - if (isappl) - { - xmlNodePtr cnl = caseNode->xmlChildrenNode; - while (cnl) - { - xmlAddChild(parent, clone(cnl, appl)); - cnl = cnl->next; - } - break; - } - - } - caseNode = caseNode->next; - } - } - - } - else - xmlAddChild(parent, clone(n, appl)); - - n = n->next; - } - return parent; -} - -class myparser -{ -public: - std::string documentId; - std::string fileName; - std::string title; - HashSet *hidlist; - Hashtable *keywords; - Stringtable *helptexts; -private: - HashSet extendedHelpText; -public: - myparser(const std::string &indocumentId, const std::string &infileName, - const std::string &intitle) : documentId(indocumentId), fileName(infileName), - title(intitle) - { - hidlist = new HashSet; - keywords = new Hashtable; - helptexts = new Stringtable; - } - void traverse( xmlNodePtr parentNode ); -private: - std::string dump(xmlNodePtr node); -}; - -std::string myparser::dump(xmlNodePtr node) -{ - std::string app; - if (node->xmlChildrenNode) - { - xmlNodePtr list = node->xmlChildrenNode; - while (list) - { - app += dump(list); - list = list->next; - } - } - if (xmlNodeIsText(node)) - { - xmlChar *pContent = xmlNodeGetContent(node); - app += std::string((const char*)pContent); - xmlFree(pContent); - // std::cout << app << std::endl; - } - return app; -} - -void trim(std::string& str) -{ - std::string::size_type pos = str.find_last_not_of(' '); - if(pos != std::string::npos) - { - str.erase(pos + 1); - pos = str.find_first_not_of(' '); - if(pos != std::string::npos) - str.erase(0, pos); - } - else - str.erase(str.begin(), str.end()); -} - -void myparser::traverse( xmlNodePtr parentNode ) -{ - // traverse all nodes that belong to the parent - xmlNodePtr test ; - for (test = parentNode->xmlChildrenNode; test; test = test->next) - { - if (fileName.empty() && !strcmp((const char*)test->name, "filename")) - { - xmlNodePtr node = test->xmlChildrenNode; - if (xmlNodeIsText(node)) - { - xmlChar *pContent = xmlNodeGetContent(node); - fileName = std::string((const char*)pContent); - xmlFree(pContent); - } - } - else if (title.empty() && !strcmp((const char*)test->name, "title")) - { - title = dump(test); - if (title.empty()) - title = ""; - } - else if (!strcmp((const char*)test->name, "bookmark")) - { - xmlChar *branchxml = xmlGetProp(test, (const xmlChar*)"branch"); - xmlChar *idxml = xmlGetProp(test, (const xmlChar*)"id"); - std::string branch((const char*)branchxml); - std::string anchor((const char*)idxml); - xmlFree (branchxml); - xmlFree (idxml); - - std::string hid; - - if (branch.find("hid") == 0) - { - size_t index = branch.find('/'); - if (index != std::string::npos) - { - hid = branch.substr(1 + index); - // one shall serve as a documentId - if (documentId.empty()) - documentId = hid; - extendedHelpText.push_back(hid); - std::string foo = anchor.empty() ? hid : hid + "#" + anchor; - HCDBG(std::cerr << "hid pushback" << foo << std::endl); - hidlist->push_back( anchor.empty() ? hid : hid + "#" + anchor); - } - else - continue; - } - else if (branch.compare("index") == 0) - { - LinkedList ll; - - for (xmlNodePtr nd = test->xmlChildrenNode; nd; nd = nd->next) - { - if (strcmp((const char*)nd->name, "bookmark_value")) - continue; - - std::string embedded; - xmlChar *embeddedxml = xmlGetProp(nd, (const xmlChar*)"embedded"); - if (embeddedxml) - { - embedded = std::string((const char*)embeddedxml); - xmlFree (embeddedxml); - std::transform (embedded.begin(), embedded.end(), - embedded.begin(), tolower); - } - - bool isEmbedded = !embedded.empty() && embedded.compare("true") == 0; - if (isEmbedded) - continue; - - std::string keyword = dump(nd); - size_t keywordSem = keyword.find(';'); - if (keywordSem != std::string::npos) - { - std::string tmppre = - keyword.substr(0,keywordSem); - trim(tmppre); - std::string tmppos = - keyword.substr(1+keywordSem); - trim(tmppos); - keyword = tmppre + ";" + tmppos; - } - ll.push_back(keyword); - } - if (!ll.empty()) - (*keywords)[anchor] = ll; - } - else if (branch.compare("contents") == 0) - { - // currently not used - } - } - else if (!strcmp((const char*)test->name, "ahelp")) - { - std::string text = dump(test); - trim(text); - std::string name; - - HashSet::const_iterator aEnd = extendedHelpText.end(); - for (HashSet::const_iterator iter = extendedHelpText.begin(); iter != aEnd; - ++iter) - { - name = *iter; - (*helptexts)[name] = text; - } - extendedHelpText.clear(); - } - - // traverse children - traverse(test); - } -} - -bool HelpCompiler::compile( void ) throw( HelpProcessingException ) -{ - // we now have the jaroutputstream, which will contain the document. - // now determine the document as a dom tree in variable docResolved - - xmlDocPtr docResolvedOrg = getSourceDocument(inputFile); - - // now add path to the document - // resolve the dom - if (!docResolvedOrg) - { - impl_sleep( 3 ); - docResolvedOrg = getSourceDocument(inputFile); - if( !docResolvedOrg ) - { - std::stringstream aStrStream; - aStrStream << "ERROR: file not existing: " << inputFile.native_file_string().c_str() << std::endl; - throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); - } - } - - // now find all applications for which one has to compile - std::string documentId; - std::string fileName; - std::string title; - // returns all applications for which one has to compile - HashSet applications = switchFind(docResolvedOrg); - - HashSet::const_iterator aEnd = applications.end(); - for (HashSet::const_iterator aI = applications.begin(); aI != aEnd; ++aI) - { - std::string appl = *aI; - std::string modulename = appl; - if (modulename[0] == 'S') - { - modulename = modulename.substr(1); - std::transform(modulename.begin(), modulename.end(), modulename.begin(), tolower); - } - if (modulename != "DEFAULT" && modulename != module) - continue; - - // returns a clone of the document with swich-cases resolved - xmlNodePtr docResolved = clone(xmlDocGetRootElement(docResolvedOrg), appl); - myparser aparser(documentId, fileName, title); - aparser.traverse(docResolved); - - documentId = aparser.documentId; - fileName = aparser.fileName; - title = aparser.title; - - HCDBG(std::cerr << documentId << " : " << fileName << " : " << title << std::endl); - - xmlDocPtr docResolvedDoc = xmlCopyDoc(docResolvedOrg, false); - xmlDocSetRootElement(docResolvedDoc, docResolved); - - if (modulename == "DEFAULT") - { - streamTable.dropdefault(); - streamTable.default_doc = docResolvedDoc; - streamTable.default_hidlist = aparser.hidlist; - streamTable.default_helptexts = aparser.helptexts; - streamTable.default_keywords = aparser.keywords; - } - else if (modulename == module) - { - streamTable.dropappl(); - streamTable.appl_doc = docResolvedDoc; - streamTable.appl_hidlist = aparser.hidlist; - streamTable.appl_helptexts = aparser.helptexts; - streamTable.appl_keywords = aparser.keywords; - } - else - { - std::stringstream aStrStream; - aStrStream << "ERROR: Found unexpected module name \"" << modulename - << "\" in file" << src.native_file_string().c_str() << std::endl; - throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); - } - - } // end iteration over all applications - - streamTable.document_id = documentId; - streamTable.document_path = fileName; - streamTable.document_title = title; - std::string actMod = module; - if ( !bExtensionMode && !fileName.empty()) - { - if (fileName.find("/text/") == 0) - { - int len = strlen("/text/"); - actMod = fileName.substr(len); - actMod = actMod.substr(0, actMod.find('/')); - } - } - streamTable.document_module = actMod; - - xmlFreeDoc(docResolvedOrg); - return true; -} - -namespace fs -{ - rtl_TextEncoding getThreadTextEncoding( void ) - { - static bool bNeedsInit = true; - static rtl_TextEncoding nThreadTextEncoding; - if( bNeedsInit ) - { - bNeedsInit = false; - nThreadTextEncoding = osl_getThreadTextEncoding(); - } - return nThreadTextEncoding; - } - - void create_directory(const fs::path indexDirName) - { - HCDBG( - std::cerr << "creating " << - rtl::OUStringToOString(indexDirName.data, RTL_TEXTENCODING_UTF8).getStr() - << std::endl - ); - osl::Directory::createPath(indexDirName.data); - } - - void rename(const fs::path &src, const fs::path &dest) - { - osl::File::move(src.data, dest.data); - } - - void copy(const fs::path &src, const fs::path &dest) - { - osl::File::copy(src.data, dest.data); - } - - bool exists(const fs::path &in) - { - osl::File tmp(in.data); - return (tmp.open(osl_File_OpenFlag_Read) == osl::FileBase::E_None); - } - - void remove(const fs::path &in) - { - osl::File::remove(in.data); - } - - void removeRecursive(rtl::OUString const& _suDirURL) - { - { - osl::Directory aDir(_suDirURL); - aDir.open(); - if (aDir.isOpen()) - { - osl::DirectoryItem aItem; - osl::FileStatus aStatus(osl_FileStatus_Mask_FileName | osl_FileStatus_Mask_Attributes); - while (aDir.getNextItem(aItem) == ::osl::FileBase::E_None) - { - if (osl::FileBase::E_None == aItem.getFileStatus(aStatus) && - aStatus.isValid(osl_FileStatus_Mask_FileName | osl_FileStatus_Mask_Attributes)) - { - rtl::OUString suFilename = aStatus.getFileName(); - rtl::OUString suFullFileURL; - suFullFileURL += _suDirURL; - suFullFileURL += rtl::OUString::createFromAscii("/"); - suFullFileURL += suFilename; - - if (aStatus.getFileType() == osl::FileStatus::Directory) - removeRecursive(suFullFileURL); - else - osl::File::remove(suFullFileURL); - } - } - aDir.close(); - } - } - osl::Directory::remove(_suDirURL); - } - - void remove_all(const fs::path &in) - { - removeRecursive(in.data); - } -} - -/* vi:set tabstop=4 shiftwidth=4 expandtab: */ diff --git a/transex3/source/help/HelpCompiler.hxx b/transex3/source/help/HelpCompiler.hxx deleted file mode 100644 index 7ffb096bd635..000000000000 --- a/transex3/source/help/HelpCompiler.hxx +++ /dev/null @@ -1,320 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: HelpCompiler.hxx,v $ - * $Revision: 1.8 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef HELPCOMPILER_HXX -#define HELPCOMPILER_HXX - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef SYSTEM_DB -#include -#else -#include -#endif - -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include - -#define EMULATEORIGINAL 1 - -#ifdef CMCDEBUG - #define HCDBG(foo) do { if (1) foo; } while(0) -#else - #define HCDBG(foo) do { if (0) foo; } while(0) -#endif - -namespace fs -{ - rtl_TextEncoding getThreadTextEncoding( void ); - - enum convert { native }; - class path - { - public: - ::rtl::OUString data; - public: - path() {} - path(const path &rOther) : data(rOther.data) {} - path(const std::string &in, convert) - { - rtl::OUString sWorkingDir; - osl_getProcessWorkingDir(&sWorkingDir.pData); - - rtl::OString tmp(in.c_str()); - rtl::OUString ustrSystemPath(rtl::OStringToOUString(tmp, getThreadTextEncoding())); - osl::File::getFileURLFromSystemPath(ustrSystemPath, data); - osl::File::getAbsoluteFileURL(sWorkingDir, data, data); - } - path(const std::string &FileURL) - { - rtl::OString tmp(FileURL.c_str()); - data = rtl::OStringToOUString(tmp, getThreadTextEncoding()); - } - std::string native_file_string() const - { - ::rtl::OUString ustrSystemPath; - osl::File::getSystemPathFromFileURL(data, ustrSystemPath); - rtl::OString tmp(rtl::OUStringToOString(ustrSystemPath, getThreadTextEncoding())); - HCDBG(std::cerr << "native_file_string is " << tmp.getStr() << std::endl); - return std::string(tmp.getStr()); - } - std::string native_directory_string() const { return native_file_string(); } - std::string toUTF8() const - { - rtl::OString tmp(rtl::OUStringToOString(data, RTL_TEXTENCODING_UTF8)); - return std::string(tmp.getStr()); - } - bool empty() const { return data.getLength() == 0; } - path operator/(const std::string &in) const - { - path ret(*this); - HCDBG(std::cerr << "orig was " << - rtl::OUStringToOString(ret.data, RTL_TEXTENCODING_UTF8).getStr() << std::endl); - rtl::OString tmp(in.c_str()); - rtl::OUString ustrSystemPath(rtl::OStringToOUString(tmp, getThreadTextEncoding())); - ret.data += rtl::OUString(sal_Unicode('/')); - ret.data += ustrSystemPath; - HCDBG(std::cerr << "final is " << - rtl::OUStringToOString(ret.data, RTL_TEXTENCODING_UTF8).getStr() << std::endl); - return ret; - } - void append(const char *in) - { - rtl::OString tmp(in); - rtl::OUString ustrSystemPath(rtl::OStringToOUString(tmp, getThreadTextEncoding())); - data = data + ustrSystemPath; - } - void append(const std::string &in) { append(in.c_str()); } - }; - - void create_directory(const fs::path indexDirName); - void rename(const fs::path &src, const fs::path &dest); - void copy(const fs::path &src, const fs::path &dest); - bool exists(const fs::path &in); - void remove_all(const fs::path &in); - void remove(const fs::path &in); -} - -struct joaat_hash -{ - size_t operator()(const std::string &str) const - { - size_t hash = 0; - const char *key = str.data(); - for (size_t i = 0; i < str.size(); i++) - { - hash += key[i]; - hash += (hash << 10); - hash ^= (hash >> 6); - } - hash += (hash << 3); - hash ^= (hash >> 11); - hash += (hash << 15); - return hash; - } -}; - -#define get16bits(d) ((((sal_uInt32)(((const sal_uInt8 *)(d))[1])) << 8)\ - +(sal_uInt32)(((const sal_uInt8 *)(d))[0]) ) - -struct SuperFastHash -{ - size_t operator()(const std::string &str) const - { - const char * data = str.data(); - int len = str.size(); - size_t hash = len, tmp; - if (len <= 0 || data == NULL) return 0; - - int rem = len & 3; - len >>= 2; - - /* Main loop */ - for (;len > 0; len--) - { - hash += get16bits (data); - tmp = (get16bits (data+2) << 11) ^ hash; - hash = (hash << 16) ^ tmp; - data += 2*sizeof (sal_uInt16); - hash += hash >> 11; - } - - /* Handle end cases */ - switch (rem) - { - case 3: hash += get16bits (data); - hash ^= hash << 16; - hash ^= data[sizeof (sal_uInt16)] << 18; - hash += hash >> 11; - break; - case 2: hash += get16bits (data); - hash ^= hash << 11; - hash += hash >> 17; - break; - case 1: hash += *data; - hash ^= hash << 10; - hash += hash >> 1; - } - - /* Force "avalanching" of final 127 bits */ - hash ^= hash << 3; - hash += hash >> 5; - hash ^= hash << 4; - hash += hash >> 17; - hash ^= hash << 25; - hash += hash >> 6; - - return hash; - } -}; - -#define pref_hash joaat_hash - -typedef std::hash_map Stringtable; -typedef std::list LinkedList; -typedef std::vector HashSet; - -typedef std::hash_map Hashtable; - -class StreamTable -{ -public: - std::string document_id; - std::string document_path; - std::string document_module; - std::string document_title; - - HashSet *appl_hidlist; - Hashtable *appl_keywords; - Stringtable *appl_helptexts; - xmlDocPtr appl_doc; - - HashSet *default_hidlist; - Hashtable *default_keywords; - Stringtable *default_helptexts; - xmlDocPtr default_doc; - - StreamTable() : - appl_hidlist(NULL), appl_keywords(NULL), appl_helptexts(NULL), appl_doc(NULL), - default_hidlist(NULL), default_keywords(NULL), default_helptexts(NULL), default_doc(NULL) - {} - void dropdefault() - { - delete default_hidlist; - delete default_keywords; - delete default_helptexts; - if (default_doc) xmlFreeDoc(default_doc); - } - void dropappl() - { - delete appl_hidlist; - delete appl_keywords; - delete appl_helptexts; - if (appl_doc) xmlFreeDoc(appl_doc); - } - ~StreamTable() - { - dropappl(); - dropdefault(); - } -}; - -struct HelpProcessingException -{ - HelpProcessingErrorClass m_eErrorClass; - std::string m_aErrorMsg; - std::string m_aXMLParsingFile; - int m_nXMLParsingLine; - - HelpProcessingException( HelpProcessingErrorClass eErrorClass, const std::string& aErrorMsg ) - : m_eErrorClass( eErrorClass ) - , m_aErrorMsg( aErrorMsg ) - {} - HelpProcessingException( const std::string& aErrorMsg, const std::string& aXMLParsingFile, int nXMLParsingLine ) - : m_eErrorClass( HELPPROCESSING_XMLPARSING_ERROR ) - , m_aErrorMsg( aErrorMsg ) - , m_aXMLParsingFile( aXMLParsingFile ) - , m_nXMLParsingLine( nXMLParsingLine ) - {} -}; - -class HelpCompiler -{ -public: - HelpCompiler(StreamTable &streamTable, - const fs::path &in_inputFile, - const fs::path &in_src, - const fs::path &in_resEmbStylesheet, - const std::string &in_module, - const std::string &in_lang, - bool in_bExtensionMode); - bool compile( void ) throw (HelpProcessingException); - void addEntryToJarFile(const std::string &prefix, - const std::string &entryName, const std::string &bytesToAdd); - void addEntryToJarFile(const std::string &prefix, - const std::string &entryName, const HashSet &bytesToAdd); - void addEntryToJarFile(const std::string &prefix, - const std::string &entryName, const Stringtable &bytesToAdd); - void addEntryToJarFile(const std::string &prefix, - const std::string &entryName, const Hashtable &bytesToAdd); -private: - xmlDocPtr getSourceDocument(const fs::path &filePath); - HashSet switchFind(xmlDocPtr doc); - xmlNodePtr clone(xmlNodePtr node, const std::string& appl); - StreamTable &streamTable; - const fs::path inputFile, src; - const std::string module, lang; - const fs::path resEmbStylesheet; - bool bExtensionMode; -}; - -#endif - -/* vi:set tabstop=4 shiftwidth=4 expandtab: */ diff --git a/transex3/source/help/HelpFileDocument.java b/transex3/source/help/HelpFileDocument.java deleted file mode 100644 index 2212db27f251..000000000000 --- a/transex3/source/help/HelpFileDocument.java +++ /dev/null @@ -1,89 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: HelpFileDocument.java,v $ - * $Revision: 1.2 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -package com.sun.star.help; - -import java.io.File; -import java.io.Reader; -import java.io.FileInputStream; -import java.io.InputStreamReader; -//import java.io.FileReader; -import java.io.StringReader; - -import org.apache.lucene.document.Document; -import org.apache.lucene.document.Field; - -/** Lucene Document for help files */ -public class HelpFileDocument -{ - /** Creates reader for UTF-8 files - */ - private static Reader getReaderForFile( File aFile ) - throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException { - Reader aReader; - if( aFile != null ) { - FileInputStream fis = new FileInputStream( aFile ); - aReader = new InputStreamReader( fis, "UTF-8" ); - } - else { - aReader = new StringReader( "" ); - } - return aReader; - } - - /** Makes a document for a File. - */ - public static Document Document( String aModule, File aCaptionFile, File aContentFile ) - throws java.io.FileNotFoundException, java.io.UnsupportedEncodingException { - Document doc = new Document(); - - // Add the path of the file as a field named "path". Use a field that is - // indexed (i.e. searchable), but don't tokenize the field into words. - File aFile = aCaptionFile != null ? aCaptionFile : aContentFile; - if( aFile != null ) - { - String aPath = "#HLP#" + aModule + "/" + aFile.getName(); - doc.add(new Field("path", aPath, Field.Store.YES, Field.Index.UN_TOKENIZED)); - } - - // Add the caption of the file to a field named "caption". Specify a Reader, - // so that the text of the file is tokenized and indexed, but not stored. - doc.add( new Field( "caption", getReaderForFile( aCaptionFile ) ) ); - - // Add the contents of the file to a field named "content". Specify a Reader, - // so that the text of the file is tokenized and indexed, but not stored. - doc.add( new Field( "content", getReaderForFile( aContentFile ) ) ); - - // return the document - return doc; - } - - private HelpFileDocument() {} -} diff --git a/transex3/source/help/HelpIndexerTool.java b/transex3/source/help/HelpIndexerTool.java deleted file mode 100644 index 6bf22d1ac344..000000000000 --- a/transex3/source/help/HelpIndexerTool.java +++ /dev/null @@ -1,372 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: HelpIndexer.java,v $ - * $Revision: 1.21 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -package com.sun.star.help; - -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.util.Arrays; -import java.util.HashSet; -import java.util.List; -import java.util.zip.ZipEntry; -import java.util.zip.ZipOutputStream; -import java.util.zip.CRC32; -import org.apache.lucene.analysis.standard.StandardAnalyzer; -import org.apache.lucene.analysis.cjk.CJKAnalyzer; -import org.apache.lucene.analysis.Analyzer; -import org.apache.lucene.index.IndexWriter; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.util.Date; - -public class HelpIndexerTool -{ - public HelpIndexerTool() - { - } - - - /** - * @param args the command line arguments - */ - public static void main( String[] args ) - { - boolean bExtensionMode = false; - mainImpl( args, bExtensionMode ); - } - - public static void mainImpl( String[] args, boolean bExtensionMode ) - { - String aDirToZipStr = ""; - String aSrcDirStr = ""; - String aLanguageStr = ""; - String aModule = ""; - String aTargetZipFileStr = ""; - String aCfsName = ""; - - // Scan arguments - boolean bLang = false; - boolean bMod = false; - boolean bZipDir = false; - boolean bSrcDir = false; - boolean bOutput = false; - boolean bCfsName = false; - - int nArgCount = args.length; - for( int i = 0 ; i < nArgCount ; i++ ) - { - if( "-lang".equals(args[i]) ) - { - if( i + 1 < nArgCount ) - { - aLanguageStr = args[i + 1]; - bLang = true; - } - i++; - } - else if( "-mod".equals(args[i]) ) - { - if( i + 1 < nArgCount ) - { - aModule = args[i + 1]; - bMod = true; - } - i++; - } - else if( "-zipdir".equals(args[i]) ) - { - if( i + 1 < nArgCount ) - { - aDirToZipStr = args[i + 1]; - bZipDir = true; - } - i++; - } - else if( "-srcdir".equals(args[i]) ) - { - if( i + 1 < nArgCount ) - { - aSrcDirStr = args[i + 1]; - bSrcDir = true; - } - i++; - } - else if( "-o".equals(args[i]) ) - { - if( i + 1 < nArgCount ) - { - aTargetZipFileStr = args[i + 1]; - bOutput = true; - } - i++; - } - else if( "-checkcfsname".equals(args[i]) ) - { - if( i + 1 < nArgCount ) - { - aCfsName = args[i + 1] + ".cfs"; - bCfsName = true; - } - i++; - } - } - - if( !bLang || !bMod || !bZipDir || (!bOutput && !bExtensionMode) ) - { - if( bExtensionMode ) - return; - - System.out.println("Usage: HelpIndexer -lang ISOLangCode -mod HelpModule -zipdir TempZipDir -o OutputZipFile"); - System.exit( -1 ); - } - - String aIndexDirName = aModule + ".idxl"; - File aIndexDir = new File( aDirToZipStr + File.separator + aIndexDirName ); - if( !bSrcDir ) - aSrcDirStr = aDirToZipStr; - File aCaptionFilesDir = new File( aSrcDirStr + File.separator + "caption" ); - File aContentFilesDir = new File( aSrcDirStr + File.separator + "content" ); - - try - { - Date start = new Date(); - Analyzer analyzer = aLanguageStr.equals("ja") ? (Analyzer)new CJKAnalyzer() : (Analyzer)new StandardAnalyzer(); - IndexWriter writer = new IndexWriter( aIndexDir, analyzer, true ); - if( !bExtensionMode ) - System.out.println( "Lucene: Indexing to directory '" + aIndexDir + "'..." ); - int nRet = indexDocs( writer, aModule, bExtensionMode, aCaptionFilesDir, aContentFilesDir ); - if( nRet != -1 ) - { - if( !bExtensionMode ) - { - System.out.println(); - System.out.println( "Optimizing ..." ); - } - writer.optimize(); - } - writer.close(); - - boolean bCfsFileOk = true; - if( bCfsName && !bExtensionMode && nRet != -1 ) - { - String aCompleteCfsFileName = aDirToZipStr + File.separator + aIndexDirName + File.separator + aCfsName; - File aCfsFile = new File( aCompleteCfsFileName ); - bCfsFileOk = aCfsFile.exists(); - System.out.println( "Checking cfs file " + aCfsName+ ": " + (bCfsFileOk ? "Found" : "Not found") ); - } - - if( bExtensionMode ) - { - if( !bSrcDir ) - { - deleteRecursively( aCaptionFilesDir ); - deleteRecursively( aContentFilesDir ); - } - } - else - { - if( nRet == -1 ) - deleteRecursively( aIndexDir ); - - if( bCfsFileOk ) - System.out.println( "Zipping ..." ); - File aDirToZipFile = new File( aDirToZipStr ); - createZipFile( aDirToZipFile, aTargetZipFileStr ); - deleteRecursively( aDirToZipFile ); - } - - if( !bCfsFileOk ) - { - System.out.println( "cfs file check failed, terminating..." ); - System.exit( -1 ); - } - - Date end = new Date(); - if( !bExtensionMode ) - System.out.println(end.getTime() - start.getTime() + " total milliseconds"); - } - catch (IOException e) - { - if( bExtensionMode ) - return; - - System.out.println(" caught a " + e.getClass() + - "\n with message: " + e.getMessage()); - System.exit( -1 ); - } - } - - private static int indexDocs(IndexWriter writer, String aModule, boolean bExtensionMode, - File aCaptionFilesDir, File aContentFilesDir) throws IOException - { - if( !aCaptionFilesDir.canRead() || !aCaptionFilesDir.isDirectory() ) - { - if( !bExtensionMode ) - System.out.println( "Not found: " + aCaptionFilesDir ); - return -1; - } - if( !aContentFilesDir.canRead() || !aContentFilesDir.isDirectory() ) - { - if( !bExtensionMode ) - System.out.println( "Not found: " + aContentFilesDir ); - return -1; - } - - String[] aCaptionFiles = aCaptionFilesDir.list(); - List aCaptionFilesList = Arrays.asList( aCaptionFiles ); - HashSet aCaptionFilesHashSet = new HashSet( aCaptionFilesList ); - - String[] aContentFiles = aContentFilesDir.list(); - List aContentFilesList = Arrays.asList( aContentFiles ); - HashSet aContentFilesHashSet = new HashSet( aContentFilesList ); - - // Loop over caption files and find corresponding content file - if( !bExtensionMode ) - System.out.println( "Indexing, adding files" ); - int nCaptionFilesLen = aCaptionFiles.length; - for( int i = 0 ; i < nCaptionFilesLen ; i++ ) - { - String aCaptionFileStr = aCaptionFiles[i]; - File aCaptionFile = new File( aCaptionFilesDir, aCaptionFileStr ); - File aContentFile = null; - if( aContentFilesHashSet.contains( aCaptionFileStr ) ) - aContentFile = new File( aContentFilesDir, aCaptionFileStr ); - - if( !bExtensionMode ) - System.out.print( "." ); - writer.addDocument( HelpFileDocument.Document( aModule, aCaptionFile, aContentFile ) ); - } - - // Loop over content files to find remaining files not mapped to caption files - int nContentFilesLen = aContentFiles.length; - for( int i = 0 ; i < nContentFilesLen ; i++ ) - { - String aContentFileStr = aContentFiles[i]; - if( !aCaptionFilesHashSet.contains( aContentFileStr ) ) - { - // Not already handled in caption files loop - File aCaptionFile = null; - File aContentFile = new File( aContentFilesDir, aContentFileStr ); - if( !bExtensionMode ) - System.out.print( "." ); - writer.addDocument( HelpFileDocument.Document( aModule, aCaptionFile, aContentFile ) ); - } - } - return 0; - } - - public static void createZipFile( File aDirToZip, String aTargetZipFileStr ) - throws FileNotFoundException, IOException - { - FileOutputStream fos = new FileOutputStream( aTargetZipFileStr ); - ZipOutputStream zos = new ZipOutputStream( fos ); - - File[] aChildrenFiles = aDirToZip.listFiles(); - int nFileCount = aChildrenFiles.length; - for( int i = 0 ; i < nFileCount ; i++ ) - addToZipRecursively( zos, aChildrenFiles[i], null ); - - zos.close(); - } - - public static void addToZipRecursively( ZipOutputStream zos, File aFile, String aBasePath ) - throws FileNotFoundException, IOException - { - if( aFile.isDirectory() ) - { - String aDirName = aFile.getName(); - if( aDirName.equalsIgnoreCase( "caption" ) || aDirName.equalsIgnoreCase( "content" ) ) - return; - - File[] aChildrenFiles = aFile.listFiles(); - String aNewBasePath = ""; - if( aBasePath != null ) - aNewBasePath += aBasePath + File.separator; - aNewBasePath += aDirName; - - int nFileCount = aChildrenFiles.length; - for( int i = 0 ; i < nFileCount ; i++ ) - addToZipRecursively( zos, aChildrenFiles[i], aNewBasePath ); - - return; - } - - // No directory - // read contents of file we are going to put in the zip - int fileLength = (int) aFile.length(); - FileInputStream fis = new FileInputStream( aFile ); - byte[] wholeFile = new byte[fileLength]; - int bytesRead = fis.read( wholeFile, 0, fileLength ); - fis.close(); - - String aFileName = aFile.getName(); - String aEntryName = ""; - if( aBasePath != null ) - aEntryName += aBasePath + "/"; - aEntryName += aFileName; - ZipEntry aZipEntry = new ZipEntry( aEntryName ); - aZipEntry.setTime( aFile.lastModified() ); - aZipEntry.setSize( fileLength ); - - int nMethod = ( aFileName.toLowerCase().endsWith( ".jar" ) ) - ? ZipEntry.STORED : ZipEntry.DEFLATED; - aZipEntry.setMethod( nMethod ); - - CRC32 tempCRC = new CRC32(); - tempCRC.update( wholeFile, 0, wholeFile.length ); - aZipEntry.setCrc( tempCRC.getValue() ); - - // write the contents into the zip element - zos.putNextEntry( aZipEntry ); - zos.write( wholeFile, 0, fileLength ); - zos.closeEntry(); - } - - static public boolean deleteRecursively( File aFile ) - { - if( aFile.isDirectory() ) - { - File[] aChildrenFiles = aFile.listFiles(); - int nFileCount = aChildrenFiles.length; - for( int i = 0 ; i < nFileCount ; i++ ) - { - File aChildrenFile = aChildrenFiles[i]; - boolean bSuccess = deleteRecursively( aChildrenFile ); - if( !bSuccess ) - return false; - } - } - - return aFile.delete(); - } -} - diff --git a/transex3/source/help/HelpLinker.cxx b/transex3/source/help/HelpLinker.cxx deleted file mode 100644 index 7dfe4ee4a2a2..000000000000 --- a/transex3/source/help/HelpLinker.cxx +++ /dev/null @@ -1,1173 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: HelpLinker.cxx,v $ - * $Revision: 1.16 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#include "HelpCompiler.hxx" - -#include - -#include -#include - -#include -#include -#include -#include -#include - -#include -#include -#include - -#include - -#define DBHELP_ONLY - - -class IndexerPreProcessor -{ -private: - std::string m_aModuleName; - fs::path m_fsIndexBaseDir; - fs::path m_fsCaptionFilesDirName; - fs::path m_fsContentFilesDirName; - - xsltStylesheetPtr m_xsltStylesheetPtrCaption; - xsltStylesheetPtr m_xsltStylesheetPtrContent; - -public: - IndexerPreProcessor( const std::string& aModuleName, const fs::path& fsIndexBaseDir, - const fs::path& idxCaptionStylesheet, const fs::path& idxContentStylesheet ); - ~IndexerPreProcessor(); - - void processDocument( xmlDocPtr doc, const std::string& EncodedDocPath ); -}; - -IndexerPreProcessor::IndexerPreProcessor - ( const std::string& aModuleName, const fs::path& fsIndexBaseDir, - const fs::path& idxCaptionStylesheet, const fs::path& idxContentStylesheet ) - : m_aModuleName( aModuleName ) - , m_fsIndexBaseDir( fsIndexBaseDir ) -{ - m_fsCaptionFilesDirName = fsIndexBaseDir / "caption"; - fs::create_directory( m_fsCaptionFilesDirName ); - - m_fsContentFilesDirName = fsIndexBaseDir / "content"; - fs::create_directory( m_fsContentFilesDirName ); - - m_xsltStylesheetPtrCaption = xsltParseStylesheetFile - ((const xmlChar *)idxCaptionStylesheet.native_file_string().c_str()); - m_xsltStylesheetPtrContent = xsltParseStylesheetFile - ((const xmlChar *)idxContentStylesheet.native_file_string().c_str()); -} - -IndexerPreProcessor::~IndexerPreProcessor() -{ - if( m_xsltStylesheetPtrCaption ) - xsltFreeStylesheet( m_xsltStylesheetPtrCaption ); - if( m_xsltStylesheetPtrContent ) - xsltFreeStylesheet( m_xsltStylesheetPtrContent ); -} - - -std::string getEncodedPath( const std::string& Path ) -{ - rtl::OString aOStr_Path( Path.c_str() ); - rtl::OUString aOUStr_Path( rtl::OStringToOUString - ( aOStr_Path, fs::getThreadTextEncoding() ) ); - rtl::OUString aPathURL; - osl::File::getFileURLFromSystemPath( aOUStr_Path, aPathURL ); - rtl::OString aOStr_PathURL( rtl::OUStringToOString - ( aPathURL, fs::getThreadTextEncoding() ) ); - std::string aStdStr_PathURL( aOStr_PathURL.getStr() ); - return aStdStr_PathURL; -} - -void IndexerPreProcessor::processDocument - ( xmlDocPtr doc, const std::string &EncodedDocPath ) -{ - std::string aStdStr_EncodedDocPathURL = getEncodedPath( EncodedDocPath ); - - if( m_xsltStylesheetPtrCaption ) - { - xmlDocPtr resCaption = xsltApplyStylesheet( m_xsltStylesheetPtrCaption, doc, NULL ); - xmlNodePtr pResNodeCaption = resCaption->xmlChildrenNode; - if( pResNodeCaption ) - { - 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" ); - if( pFile_docURL ) - { - fprintf( pFile_docURL, "%s\n", pResNodeCaption->content ); - fclose( pFile_docURL ); - } - } - xmlFreeDoc(resCaption); - } - - if( m_xsltStylesheetPtrContent ) - { - xmlDocPtr resContent = xsltApplyStylesheet( m_xsltStylesheetPtrContent, doc, NULL ); - xmlNodePtr pResNodeContent = resContent->xmlChildrenNode; - 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" ); - if( pFile_docURL ) - { - fprintf( pFile_docURL, "%s\n", pResNodeContent->content ); - fclose( pFile_docURL ); - } - } - xmlFreeDoc(resContent); - } -} - -struct Data -{ - std::vector _idList; - typedef std::vector::const_iterator cIter; - - void append(const std::string &id) - { - _idList.push_back(id); - } - - std::string getString() const - { - std::string ret; - cIter aEnd = _idList.end(); - for (cIter aIter = _idList.begin(); aIter != aEnd; ++aIter) - ret += *aIter + ";"; - return ret; - } -}; - -void writeKeyValue_DBHelp( FILE* pFile, const std::string& aKeyStr, const std::string& aValueStr ) -{ - if( pFile == NULL ) - return; - char cLF = 10; - unsigned int nKeyLen = aKeyStr.length(); - unsigned int nValueLen = aValueStr.length(); - fprintf( pFile, "%x ", nKeyLen ); - if( nKeyLen > 0 ) - { - if (fwrite( aKeyStr.c_str(), 1, nKeyLen, pFile ) != nKeyLen) - fprintf(stderr, "fwrite to db failed\n"); - } - if (fprintf( pFile, " %x ", nValueLen ) < 0) - fprintf(stderr, "fwrite to db failed\n"); - if( nValueLen > 0 ) - { - if (fwrite( aValueStr.c_str(), 1, nValueLen, pFile ) != nValueLen) - fprintf(stderr, "fwrite to db failed\n"); - } - if (fprintf( pFile, "%c", cLF ) < 0) - fprintf(stderr, "fwrite to db failed\n"); -} - -class HelpKeyword -{ -private: - typedef std::hash_map DataHashtable; - DataHashtable _hash; - -public: - void insert(const std::string &key, const std::string &id) - { - Data &data = _hash[key]; - data.append(id); - } - - void dump(DB* table) - { - DataHashtable::const_iterator aEnd = _hash.end(); - for (DataHashtable::const_iterator aIter = _hash.begin(); aIter != aEnd; ++aIter) - { - const std::string &keystr = aIter->first; - DBT key; - memset(&key, 0, sizeof(key)); - key.data = const_cast(keystr.c_str()); - key.size = keystr.length(); - - const Data &data = aIter->second; - std::string str = data.getString(); - DBT value; - memset(&value, 0, sizeof(value)); - value.data = const_cast(str.c_str()); - value.size = str.length(); - - table->put(table, NULL, &key, &value, 0); - } - } - - void dump_DBHelp( const std::string& rFileName ) - { - FILE* pFile = fopen( rFileName.c_str(), "wb" ); - if( pFile == NULL ) - return; - - DataHashtable::const_iterator aEnd = _hash.end(); - for (DataHashtable::const_iterator aIter = _hash.begin(); aIter != aEnd; ++aIter) - writeKeyValue_DBHelp( pFile, aIter->first, aIter->second.getString() ); - - fclose( pFile ); - } -}; - -class HelpLinker -{ -public: - void main(std::vector &args, - std::string* pExtensionPath = NULL, const rtl::OUString* pOfficeHelpPath = NULL ) - throw( HelpProcessingException ); - - HelpLinker() - : init(true) - , m_pIndexerPreProcessor(NULL) - {} - ~HelpLinker() - { delete m_pIndexerPreProcessor; } - -private: - int locCount, totCount; - Stringtable additionalFiles; - HashSet helpFiles; - fs::path sourceRoot; - fs::path embeddStylesheet; - fs::path idxCaptionStylesheet; - fs::path idxContentStylesheet; - fs::path zipdir; - fs::path outputFile; - std::string module; - std::string lang; - std::string hid; - std::string extensionPath; - bool bExtensionMode; - fs::path indexDirName; - Stringtable hidlistTranslation; - fs::path indexDirParentName; - bool init; - IndexerPreProcessor* m_pIndexerPreProcessor; - void initIndexerPreProcessor(); - void link() throw( HelpProcessingException ); - void addBookmark( DB* dbBase, FILE* pFile_DBHelp, std::string thishid, - const std::string& fileB, const std::string& anchorB, - const std::string& jarfileB, const std::string& titleB ); -#if 0 - /** - * @param outputFile - * @param module - * @param lang - * @param hid - * @param helpFiles - * @param additionalFiles - */ - - private HelpURLStreamHandlerFactory urlHandler = null; -#endif -}; - -namespace URLEncoder -{ - static std::string encode(const std::string &rIn) - { - const char *good = "!$&'()*+,-.=@_"; - static const char hex[17] = "0123456789ABCDEF"; - - std::string result; - for (size_t i=0; i < rIn.length(); ++i) - { - unsigned char c = rIn[i]; - if (isalnum (c) || strchr (good, c)) - result += c; - else { - result += '%'; - result += hex[c >> 4]; - result += hex[c & 0xf]; - } - } - return result; - } -} - -void HelpLinker::addBookmark( DB* dbBase, FILE* pFile_DBHelp, std::string thishid, - const std::string& fileB, const std::string& anchorB, - const std::string& jarfileB, const std::string& titleB) -{ - HCDBG(std::cerr << "HelpLinker::addBookmark " << thishid << " " << - fileB << " " << anchorB << " " << jarfileB << " " << titleB << std::endl); - - std::string temp = thishid; - std::transform (temp.begin(), temp.end(), temp.begin(), toupper); - std::replace(temp.begin(), temp.end(), ':', '_'); - const std::string& translatedHid = hidlistTranslation[temp]; - if (!translatedHid.empty()) - thishid = translatedHid; - - thishid = URLEncoder::encode(thishid); - - DBT key; - memset(&key, 0, sizeof(key)); - key.data = const_cast(thishid.c_str()); - key.size = thishid.length(); - - int fileLen = fileB.length(); - if (!anchorB.empty()) - fileLen += (1 + anchorB.length()); - int dataLen = 1 + fileLen + 1 + jarfileB.length() + 1 + titleB.length(); - - std::vector dataB(dataLen); - size_t i = 0; - dataB[i++] = static_cast(fileLen); - for (size_t j = 0; j < fileB.length(); ++j) - dataB[i++] = fileB[j]; - if (!anchorB.empty()) - { - dataB[i++] = '#'; - for (size_t j = 0; j < anchorB.length(); ++j) - dataB[i++] = anchorB[j]; - } - dataB[i++] = static_cast(jarfileB.length()); - for (size_t j = 0; j < jarfileB.length(); ++j) - dataB[i++] = jarfileB[j]; - - dataB[i++] = static_cast(titleB.length()); - for (size_t j = 0; j < titleB.length(); ++j) - dataB[i++] = titleB[j]; - - DBT data; - memset(&data, 0, sizeof(data)); - data.data = &dataB[0]; - data.size = dataB.size(); - - if( dbBase != NULL ) - dbBase->put(dbBase, NULL, &key, &data, 0); - - if( pFile_DBHelp != NULL ) - { - std::string aValueStr( dataB.begin(), dataB.end() ); - writeKeyValue_DBHelp( pFile_DBHelp, thishid, aValueStr ); - } -} - -void HelpLinker::initIndexerPreProcessor() -{ - if( m_pIndexerPreProcessor ) - delete m_pIndexerPreProcessor; - std::string mod = module; - std::transform (mod.begin(), mod.end(), mod.begin(), tolower); - m_pIndexerPreProcessor = new IndexerPreProcessor( mod, indexDirParentName, - idxCaptionStylesheet, idxContentStylesheet ); -} - -/** -* -*/ -void HelpLinker::link() throw( HelpProcessingException ) -{ - bool bIndexForExtension = true; - - if( bExtensionMode ) - { - indexDirParentName = sourceRoot; - } - else - { - indexDirParentName = zipdir; - fs::create_directory(indexDirParentName); - } - -#ifdef CMC_DEBUG - std::cerr << "will not delete tmpdir of " << indexDirParentName.native_file_string().c_str() << std::endl; -#endif - - std::string mod = module; - std::transform (mod.begin(), mod.end(), mod.begin(), tolower); - - // do the work here - // continue with introduction of the overall process thing into the - // here all hzip files will be worked on - std::string appl = mod; - if (appl[0] == 's') - appl = appl.substr(1); - - bool bUse_ = true; -#ifdef DBHELP_ONLY - if( !bExtensionMode ) - bUse_ = false; -#endif - - DB* helpText(0); -#ifndef DBHELP_ONLY - fs::path helpTextFileName(indexDirParentName / (mod + ".ht")); - db_create(&helpText,0,0); - helpText->open(helpText, NULL, helpTextFileName.native_file_string().c_str(), NULL, DB_BTREE, - DB_CREATE | DB_TRUNCATE, 0644); -#endif - - fs::path helpTextFileName_DBHelp(indexDirParentName / (mod + (bUse_ ? ".ht_" : ".ht"))); - FILE* pFileHelpText_DBHelp = fopen - ( helpTextFileName_DBHelp.native_file_string().c_str(), "wb" ); - - DB* dbBase(0); -#ifndef DBHELP_ONLY - fs::path dbBaseFileName(indexDirParentName / (mod + ".db")); - db_create(&dbBase,0,0); - dbBase->open(dbBase, NULL, dbBaseFileName.native_file_string().c_str(), NULL, DB_BTREE, - DB_CREATE | DB_TRUNCATE, 0644); -#endif - - fs::path dbBaseFileName_DBHelp(indexDirParentName / (mod + (bUse_ ? ".db_" : ".db"))); - FILE* pFileDbBase_DBHelp = fopen - ( dbBaseFileName_DBHelp.native_file_string().c_str(), "wb" ); - -#ifndef DBHELP_ONLY - DB* keyWord(0); - fs::path keyWordFileName(indexDirParentName / (mod + ".key")); - db_create(&keyWord,0,0); - keyWord->open(keyWord, NULL, keyWordFileName.native_file_string().c_str(), NULL, DB_BTREE, - DB_CREATE | DB_TRUNCATE, 0644); -#endif - - fs::path keyWordFileName_DBHelp(indexDirParentName / (mod + (bUse_ ? ".key_" : ".key"))); - - HelpKeyword helpKeyword; - - // catch HelpProcessingException to avoid locking data bases - try - { - - std::ifstream fileReader(hid.c_str()); - while (fileReader) - { - std::string key; - fileReader >> key; - std::transform (key.begin(), key.end(), key.begin(), toupper); - std::replace(key.begin(), key.end(), ':', '_'); - std::string data; - fileReader >> data; - if (!key.empty() && !data.empty()) - hidlistTranslation[key] = data; - } - fileReader.close(); - - // lastly, initialize the indexBuilder - if ( (!bExtensionMode || bIndexForExtension) && !helpFiles.empty()) - initIndexerPreProcessor(); - - if( !bExtensionMode ) - { -#ifndef OS2 // YD @TODO@ crashes libc runtime :-( - std::cout << "Making " << outputFile.native_file_string() << - " from " << helpFiles.size() << " input files" << std::endl; -#endif - } - - // here we start our loop over the hzip files. - HashSet::iterator end = helpFiles.end(); - for (HashSet::iterator iter = helpFiles.begin(); iter != end; ++iter) - { - if( !bExtensionMode ) - { - std::cout << "."; - std::cout.flush(); - } - - // process one file - // streamTable contains the streams in the hzip file - StreamTable streamTable; - const std::string &xhpFileName = *iter; - - if (!bExtensionMode && xhpFileName.rfind(".xhp") != xhpFileName.length()-4) - { - // only work on .xhp - files - std::cerr << - "ERROR: input list entry '" - << xhpFileName - << "' has the wrong extension (only files with extension .xhp " - << "are accepted)"; - continue; - } - - fs::path langsourceRoot(sourceRoot); - fs::path xhpFile; - - if( bExtensionMode ) - { - // langsourceRoot == sourceRoot for extensions - std::string xhpFileNameComplete( extensionPath ); - xhpFileNameComplete.append( '/' + xhpFileName ); - xhpFile = fs::path( xhpFileNameComplete ); - } - else - { - langsourceRoot.append('/' + lang + '/'); - xhpFile = fs::path(xhpFileName, fs::native); - } - - HelpCompiler hc( streamTable, xhpFile, langsourceRoot, - embeddStylesheet, module, lang, bExtensionMode ); - - HCDBG(std::cerr << "before compile of " << xhpFileName << std::endl); - bool success = hc.compile(); - HCDBG(std::cerr << "after compile of " << xhpFileName << std::endl); - - if (!success && !bExtensionMode) - { - std::stringstream aStrStream; - aStrStream << - "\nERROR: compiling help particle '" - << xhpFileName - << "' for language '" - << lang - << "' failed!"; - throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); - } - - const std::string documentBaseId = streamTable.document_id; - std::string documentPath = streamTable.document_path; - if (documentPath.find("/") == 0) - documentPath = documentPath.substr(1); - - std::string documentJarfile = streamTable.document_module + ".jar"; - - std::string documentTitle = streamTable.document_title; - if (documentTitle.empty()) - documentTitle = ""; - -#if 0 - std::cout << "for " << xhpFileName << " documentBaseId is " << documentBaseId << "\n"; - std::cout << "for " << xhpFileName << " documentPath is " << documentPath << "\n"; - std::cout << "for " << xhpFileName << " documentJarfile is " << documentJarfile << "\n"; - std::cout << "for " << xhpFileName << " documentPath is " << documentTitle << "\n"; -#endif - - const std::string& fileB = documentPath; - const std::string& jarfileB = documentJarfile; - std::string& titleB = documentTitle; - - // add once this as its own id. - addBookmark(dbBase, pFileDbBase_DBHelp, documentPath, fileB, std::string(), jarfileB, titleB); - - // first the database *.db - // ByteArrayInputStream bais = null; - // ObjectInputStream ois = null; - - const HashSet *hidlist = streamTable.appl_hidlist; - if (!hidlist) - hidlist = streamTable.default_hidlist; - if (hidlist && !hidlist->empty()) - { - // now iterate over all elements of the hidlist - HashSet::const_iterator aEnd = hidlist->end(); - for (HashSet::const_iterator hidListIter = hidlist->begin(); - hidListIter != aEnd; ++hidListIter) - { - std::string thishid = *hidListIter; - - std::string anchorB; - size_t index = thishid.rfind('#'); - if (index != std::string::npos) - { - anchorB = thishid.substr(1 + index); - thishid = thishid.substr(0, index); - } - addBookmark(dbBase, pFileDbBase_DBHelp, thishid, fileB, anchorB, jarfileB, titleB); - } - } - - // now the keywords - const Hashtable *anchorToLL = streamTable.appl_keywords; - if (!anchorToLL) - anchorToLL = streamTable.default_keywords; - if (anchorToLL && !anchorToLL->empty()) - { - std::string fakedHid = URLEncoder::encode(documentPath); - Hashtable::const_iterator aEnd = anchorToLL->end(); - for (Hashtable::const_iterator enumer = anchorToLL->begin(); - enumer != aEnd; ++enumer) - { - const std::string &anchor = enumer->first; - addBookmark(dbBase, pFileDbBase_DBHelp, documentPath, fileB, - anchor, jarfileB, titleB); - std::string totalId = fakedHid + "#" + anchor; - // std::cerr << hzipFileName << std::endl; - const LinkedList& ll = enumer->second; - LinkedList::const_iterator aOtherEnd = ll.end(); - for (LinkedList::const_iterator llIter = ll.begin(); - llIter != aOtherEnd; ++llIter) - { - helpKeyword.insert(*llIter, totalId); - } - } - - } - - // and last the helptexts - const Stringtable *helpTextHash = streamTable.appl_helptexts; - if (!helpTextHash) - helpTextHash = streamTable.default_helptexts; - if (helpTextHash && !helpTextHash->empty()) - { - Stringtable::const_iterator aEnd = helpTextHash->end(); - for (Stringtable::const_iterator helpTextIter = helpTextHash->begin(); - helpTextIter != aEnd; ++helpTextIter) - { - std::string helpTextId = helpTextIter->first; - const std::string& helpTextText = helpTextIter->second; - - std::string temp = helpTextId; - std::transform (temp.begin(), temp.end(), temp.begin(), toupper); - std::replace(temp.begin(), temp.end(), ':', '_'); - - const std::string& tHid = hidlistTranslation[temp]; - if (!tHid.empty()) - helpTextId = tHid; - helpTextId = URLEncoder::encode(helpTextId); - - DBT keyDbt; - memset(&keyDbt, 0, sizeof(keyDbt)); - keyDbt.data = const_cast(helpTextId.c_str()); - keyDbt.size = helpTextId.length(); - - DBT textDbt; - memset(&textDbt, 0, sizeof(textDbt)); - textDbt.data = const_cast(helpTextText.c_str()); - textDbt.size = helpTextText.length(); - - if( helpText != NULL ) - helpText->put(helpText, NULL, &keyDbt, &textDbt, 0); - - if( pFileHelpText_DBHelp != NULL ) - writeKeyValue_DBHelp( pFileHelpText_DBHelp, helpTextId, helpTextText ); - } - } - - //IndexerPreProcessor - if( !bExtensionMode || bIndexForExtension ) - { - // now the indexing - xmlDocPtr document = streamTable.appl_doc; - if (!document) - document = streamTable.default_doc; - if (document) - { - std::string temp = module; - std::transform (temp.begin(), temp.end(), temp.begin(), tolower); - m_pIndexerPreProcessor->processDocument(document, URLEncoder::encode(documentPath) ); - } - } - - } // while loop over hzip files ending - if( !bExtensionMode ) - std::cout << std::endl; - - } // try - catch( HelpProcessingException& ) - { - // catch HelpProcessingException to avoid locking data bases -#ifndef DBHELP_ONLY - helpText->close(helpText, 0); - dbBase->close(dbBase, 0); - keyWord->close(keyWord, 0); -#endif - if( pFileHelpText_DBHelp != NULL ) - fclose( pFileHelpText_DBHelp ); - if( pFileDbBase_DBHelp != NULL ) - fclose( pFileDbBase_DBHelp ); - throw; - } - -#ifndef DBHELP_ONLY - helpText->close(helpText, 0); - dbBase->close(dbBase, 0); - helpKeyword.dump(keyWord); - keyWord->close(keyWord, 0); -#endif - if( pFileHelpText_DBHelp != NULL ) - fclose( pFileHelpText_DBHelp ); - if( pFileDbBase_DBHelp != NULL ) - fclose( pFileDbBase_DBHelp ); - - helpKeyword.dump_DBHelp( keyWordFileName_DBHelp.native_file_string() ); - - if( !bExtensionMode ) - { - // New index - Stringtable::iterator aEnd = additionalFiles.end(); - for (Stringtable::iterator enumer = additionalFiles.begin(); enumer != aEnd; - ++enumer) - { - const std::string &additionalFileName = enumer->second; - const std::string &additionalFileKey = enumer->first; - - fs::path fsAdditionalFileName( additionalFileName, fs::native ); - std::string aNativeStr = fsAdditionalFileName.native_file_string(); - const char* pStr = aNativeStr.c_str(); - std::cerr << pStr; - - fs::path fsTargetName( indexDirParentName / additionalFileKey ); - - fs::copy( fsAdditionalFileName, fsTargetName ); - } - } - -/* - ///////////////////////////////////////////////////////////////////////// - /// remove temprary directory for index creation - ///////////////////////////////////////////////////////////////////////// -#ifndef CMC_DEBUG - if( !bExtensionMode ) - fs::remove_all( indexDirParentName ); -#endif -*/ -} - - -void HelpLinker::main( std::vector &args, - std::string* pExtensionPath, const rtl::OUString* pOfficeHelpPath ) - throw( HelpProcessingException ) -{ - rtl::OUString aOfficeHelpPath; - - bExtensionMode = false; - if( pExtensionPath && pExtensionPath->length() > 0 && pOfficeHelpPath ) - { - helpFiles.clear(); - bExtensionMode = true; - extensionPath = *pExtensionPath; - sourceRoot = fs::path(extensionPath); - - aOfficeHelpPath = *pOfficeHelpPath; - } - if (args.size() > 0 && args[0][0] == '@') - { - std::vector stringList; - std::string strBuf; - std::ifstream fileReader(args[0].substr(1).c_str()); - - while (fileReader) - { - std::string token; - fileReader >> token; - if (!token.empty()) - stringList.push_back(token); - } - fileReader.close(); - - args = stringList; - } - - size_t i = 0; - - while (i < args.size()) - { - if (args[i].compare("-src") == 0) - { - ++i; - if (i >= args.size()) - { - std::stringstream aStrStream; - aStrStream << "sourceroot missing" << std::endl; - throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); - } - - if( !bExtensionMode ) - sourceRoot = fs::path(args[i], fs::native); - } - else if (args[i].compare("-sty") == 0) - { - ++i; - if (i >= args.size()) - { - std::stringstream aStrStream; - aStrStream << "embeddingStylesheet missing" << std::endl; - throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); - } - - embeddStylesheet = fs::path(args[i], fs::native); - } - else if (args[i].compare("-zipdir") == 0) - { - ++i; - if (i >= args.size()) - { - std::stringstream aStrStream; - aStrStream << "idxtemp missing" << std::endl; - throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); - } - - zipdir = fs::path(args[i], fs::native); - } - else if (args[i].compare("-idxcaption") == 0) - { - ++i; - if (i >= args.size()) - { - std::stringstream aStrStream; - aStrStream << "idxcaption stylesheet missing" << std::endl; - throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); - } - - idxCaptionStylesheet = fs::path(args[i], fs::native); - } - else if (args[i].compare("-idxcontent") == 0) - { - ++i; - if (i >= args.size()) - { - std::stringstream aStrStream; - aStrStream << "idxcontent stylesheet missing" << std::endl; - throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); - } - - idxContentStylesheet = fs::path(args[i], fs::native); - } - else if (args[i].compare("-o") == 0) - { - ++i; - if (i >= args.size()) - { - std::stringstream aStrStream; - aStrStream << "outputfilename missing" << std::endl; - throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); - } - - outputFile = fs::path(args[i], fs::native); - } - else if (args[i].compare("-mod") == 0) - { - ++i; - if (i >= args.size()) - { - std::stringstream aStrStream; - aStrStream << "module name missing" << std::endl; - throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); - } - - module = args[i]; - } - else if (args[i].compare("-lang") == 0) - { - ++i; - if (i >= args.size()) - { - std::stringstream aStrStream; - aStrStream << "language name missing" << std::endl; - throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); - } - - lang = args[i]; - } - else if (args[i].compare("-hid") == 0) - { - ++i; - if (i >= args.size()) - { - std::stringstream aStrStream; - aStrStream << "hid list missing" << std::endl; - throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); - } - - hid = args[i]; - } - else if (args[i].compare("-add") == 0) - { - std::string addFile, addFileUnderPath; - ++i; - if (i >= args.size()) - { - std::stringstream aStrStream; - aStrStream << "pathname missing" << std::endl; - throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); - } - - addFileUnderPath = args[i]; - ++i; - if (i >= args.size()) - { - std::stringstream aStrStream; - aStrStream << "pathname missing" << std::endl; - throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); - } - addFile = args[i]; - if (!addFileUnderPath.empty() && !addFile.empty()) - additionalFiles[addFileUnderPath] = addFile; - } - else - helpFiles.push_back(args[i]); - ++i; - } - - if (!bExtensionMode && zipdir.empty()) - { - std::stringstream aStrStream; - aStrStream << "no index dir given" << std::endl; - throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); - } - if (!bExtensionMode && idxCaptionStylesheet.empty()) - { - std::stringstream aStrStream; - aStrStream << "no index caption stylesheet given" << std::endl; - throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); - } - else if ( bExtensionMode ) - { - rtl::OUString aIdxCaptionPathFileURL( aOfficeHelpPath ); - aIdxCaptionPathFileURL += rtl::OUString::createFromAscii( "/idxcaption.xsl" ); - - rtl::OString aOStr_IdxCaptionPathFileURL( rtl::OUStringToOString - ( aIdxCaptionPathFileURL, fs::getThreadTextEncoding() ) ); - std::string aStdStr_IdxCaptionPathFileURL( aOStr_IdxCaptionPathFileURL.getStr() ); - - idxCaptionStylesheet = fs::path( aStdStr_IdxCaptionPathFileURL ); - } - if (!bExtensionMode && idxContentStylesheet.empty()) - { - std::stringstream aStrStream; - aStrStream << "no index content stylesheet given" << std::endl; - throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); - } - else if ( bExtensionMode ) - { - rtl::OUString aIdxContentPathFileURL( aOfficeHelpPath ); - aIdxContentPathFileURL += rtl::OUString::createFromAscii( "/idxcontent.xsl" ); - - rtl::OString aOStr_IdxContentPathFileURL( rtl::OUStringToOString - ( aIdxContentPathFileURL, fs::getThreadTextEncoding() ) ); - std::string aStdStr_IdxContentPathFileURL( aOStr_IdxContentPathFileURL.getStr() ); - - idxContentStylesheet = fs::path( aStdStr_IdxContentPathFileURL ); - } - if (!bExtensionMode && embeddStylesheet.empty()) - { - std::stringstream aStrStream; - aStrStream << "no embedding resolving file given" << std::endl; - throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); - } - if (sourceRoot.empty()) - { - std::stringstream aStrStream; - aStrStream << "no sourceroot given" << std::endl; - throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); - } - if (!bExtensionMode && outputFile.empty()) - { - std::stringstream aStrStream; - aStrStream << "no output file given" << std::endl; - throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); - } - if (module.empty()) - { - std::stringstream aStrStream; - aStrStream << "module missing" << std::endl; - throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); - } - if (!bExtensionMode && lang.empty()) - { - std::stringstream aStrStream; - aStrStream << "language missing" << std::endl; - throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); - } - if (!bExtensionMode && hid.empty()) - { - std::stringstream aStrStream; - aStrStream << "hid list missing" << std::endl; - throw HelpProcessingException( HELPPROCESSING_GENERAL_ERROR, aStrStream.str() ); - } - - link(); -} - -int main(int argc, char**argv) -{ - sal_uInt32 starttime = osl_getGlobalTimer(); - std::vector args; - for (int i = 1; i < argc; ++i) - args.push_back(std::string(argv[i])); - try - { - HelpLinker* pHelpLinker = new HelpLinker(); - pHelpLinker->main( args ); - delete pHelpLinker; - } - catch( const HelpProcessingException& e ) - { - std::cerr << e.m_aErrorMsg; - exit(1); - } - sal_uInt32 endtime = osl_getGlobalTimer(); -#ifndef OS2 // YD @TODO@ crashes libc runtime :-( - std::cout << "time taken was " << (endtime-starttime)/1000.0 << " seconds" << std::endl; -#endif - return 0; -} - -// Variable to set an exception in "C" StructuredXMLErrorFunction -static const HelpProcessingException* GpXMLParsingException = NULL; - -extern "C" void StructuredXMLErrorFunction(void *userData, xmlErrorPtr error) -{ - (void)userData; - (void)error; - - std::string aErrorMsg = error->message; - std::string aXMLParsingFile; - if( error->file != NULL ) - aXMLParsingFile = error->file; - int nXMLParsingLine = error->line; - HelpProcessingException* pException = new HelpProcessingException( aErrorMsg, aXMLParsingFile, nXMLParsingLine ); - GpXMLParsingException = pException; - - // Reset error handler - xmlSetStructuredErrorFunc( NULL, NULL ); -} - -HelpProcessingErrorInfo& HelpProcessingErrorInfo::operator=( const struct HelpProcessingException& e ) -{ - m_eErrorClass = e.m_eErrorClass; - rtl::OString tmpErrorMsg( e.m_aErrorMsg.c_str() ); - m_aErrorMsg = rtl::OStringToOUString( tmpErrorMsg, fs::getThreadTextEncoding() ); - rtl::OString tmpXMLParsingFile( e.m_aXMLParsingFile.c_str() ); - m_aXMLParsingFile = rtl::OStringToOUString( tmpXMLParsingFile, fs::getThreadTextEncoding() ); - m_nXMLParsingLine = e.m_nXMLParsingLine; - return *this; -} - - -// Returns true in case of success, false in case of error -HELPLINKER_DLLPUBLIC bool compileExtensionHelp -( - const rtl::OUString& aOfficeHelpPath, - const rtl::OUString& aExtensionName, - const rtl::OUString& aExtensionLanguageRoot, - sal_Int32 nXhpFileCount, const rtl::OUString* pXhpFiles, - HelpProcessingErrorInfo& o_rHelpProcessingErrorInfo -) -{ - bool bSuccess = true; - - sal_Int32 argc = nXhpFileCount + 3; - const char** argv = new const char*[argc]; - argv[0] = ""; - argv[1] = "-mod"; - rtl::OString aOExtensionName = rtl::OUStringToOString( aExtensionName, fs::getThreadTextEncoding() ); - argv[2] = aOExtensionName.getStr(); - - for( sal_Int32 iXhp = 0 ; iXhp < nXhpFileCount ; ++iXhp ) - { - rtl::OUString aXhpFile = pXhpFiles[iXhp]; - - rtl::OString aOXhpFile = rtl::OUStringToOString( aXhpFile, fs::getThreadTextEncoding() ); - char* pArgStr = new char[aOXhpFile.getLength() + 1]; - strcpy( pArgStr, aOXhpFile.getStr() ); - argv[iXhp + 3] = pArgStr; - } - - std::vector args; - for( sal_Int32 i = 1; i < argc; ++i ) - args.push_back(std::string( argv[i]) ); - - for( sal_Int32 iXhp = 0 ; iXhp < nXhpFileCount ; ++iXhp ) - delete argv[iXhp + 3]; - delete[] argv; - - rtl::OString aOExtensionLanguageRoot = rtl::OUStringToOString( aExtensionLanguageRoot, fs::getThreadTextEncoding() ); - const char* pExtensionPath = aOExtensionLanguageRoot.getStr(); - std::string aStdStrExtensionPath = pExtensionPath; - - // Set error handler - xmlSetStructuredErrorFunc( NULL, (xmlStructuredErrorFunc)StructuredXMLErrorFunction ); - try - { - HelpLinker* pHelpLinker = new HelpLinker(); - pHelpLinker->main( args, &aStdStrExtensionPath, &aOfficeHelpPath ); - delete pHelpLinker; - } - catch( const HelpProcessingException& e ) - { - if( GpXMLParsingException != NULL ) - { - o_rHelpProcessingErrorInfo = *GpXMLParsingException; - delete GpXMLParsingException; - GpXMLParsingException = NULL; - } - else - { - o_rHelpProcessingErrorInfo = e; - } - bSuccess = false; - } - // Reset error handler - xmlSetStructuredErrorFunc( NULL, NULL ); - - // i83624: Tree files - ::rtl::OUString aTreeFileURL = aExtensionLanguageRoot; - aTreeFileURL += rtl::OUString::createFromAscii( "/help.tree" ); - osl::DirectoryItem aTreeFileItem; - osl::FileBase::RC rcGet = osl::DirectoryItem::get( aTreeFileURL, aTreeFileItem ); - osl::FileStatus aFileStatus( FileStatusMask_FileSize ); - if( rcGet == osl::FileBase::E_None && - aTreeFileItem.getFileStatus( aFileStatus ) == osl::FileBase::E_None && - aFileStatus.isValid( FileStatusMask_FileSize ) ) - { - sal_uInt64 ret, len = aFileStatus.getFileSize(); - char* s = new char[ int(len) ]; // the buffer to hold the installed files - osl::File aFile( aTreeFileURL ); - aFile.open( OpenFlag_Read ); - aFile.read( s, len, ret ); - aFile.close(); - - XML_Parser parser = XML_ParserCreate( 0 ); - int parsed = XML_Parse( parser, s, int( len ), true ); - - if( parsed == 0 ) - { - XML_Error nError = XML_GetErrorCode( parser ); - o_rHelpProcessingErrorInfo.m_eErrorClass = HELPPROCESSING_XMLPARSING_ERROR; - o_rHelpProcessingErrorInfo.m_aErrorMsg = rtl::OUString::createFromAscii( XML_ErrorString( nError ) );; - o_rHelpProcessingErrorInfo.m_aXMLParsingFile = aTreeFileURL; - // CRAHSES!!! o_rHelpProcessingErrorInfo.m_nXMLParsingLine = XML_GetCurrentLineNumber( parser ); - bSuccess = false; - } - - XML_ParserFree( parser ); - delete[] s; - } - - return bSuccess; -} - -// vnd.sun.star.help://swriter/52821?Language=en-US&System=UNIX -/* vi:set tabstop=4 shiftwidth=4 expandtab: */ - diff --git a/transex3/source/help/compilehelp.hxx b/transex3/source/help/compilehelp.hxx deleted file mode 100644 index d123d628be27..000000000000 --- a/transex3/source/help/compilehelp.hxx +++ /dev/null @@ -1,81 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: compilehelp.hxx,v $ - * $Revision: 1.3 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef COMPILE_HXX -#define COMPILE_HXX - -#include "sal/types.h" - -#if defined(HELPLINKER_DLLIMPLEMENTATION) -#define HELPLINKER_DLLPUBLIC SAL_DLLPUBLIC_EXPORT -#else -#define HELPLINKER_DLLPUBLIC SAL_DLLPUBLIC_IMPORT -#endif -#define HELPLINKER_DLLPRIVATE SAL_DLLPRIVATE - - -//#include -#include - -enum HelpProcessingErrorClass -{ - HELPPROCESSING_NO_ERROR, - HELPPROCESSING_GENERAL_ERROR, // Missing files, options etc. - HELPPROCESSING_INTERNAL_ERROR, // Unexpected problems - HELPPROCESSING_XMLPARSING_ERROR // Errors thrown by libxml -}; - -struct HelpProcessingErrorInfo -{ - HelpProcessingErrorClass m_eErrorClass; - rtl::OUString m_aErrorMsg; - rtl::OUString m_aXMLParsingFile; - sal_Int32 m_nXMLParsingLine; - - HelpProcessingErrorInfo( void ) - : m_eErrorClass( HELPPROCESSING_NO_ERROR ) - , m_nXMLParsingLine( -1 ) - {} - - HelpProcessingErrorInfo& operator=( const struct HelpProcessingException& e ); -}; - - -// Returns true in case of success, false in case of error -HELPLINKER_DLLPUBLIC bool compileExtensionHelp -( - const rtl::OUString& aOfficeHelpPath, - const rtl::OUString& aExtensionName, - const rtl::OUString& aExtensionLanguageRoot, - sal_Int32 nXhpFileCount, const rtl::OUString* pXhpFiles, - HelpProcessingErrorInfo& o_rHelpProcessingErrorInfo -); - -#endif diff --git a/transex3/source/help/helplinker.pmk b/transex3/source/help/helplinker.pmk deleted file mode 100644 index 569c5f4dbdee..000000000000 --- a/transex3/source/help/helplinker.pmk +++ /dev/null @@ -1,35 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: helplinker.pmk,v $ -# -# $Revision: 1.4 $ -# -# 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 -# -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -# define HELPLINKER_DLLIMPLEMENTATION (see @ inc/xmlhelp/helplinkerdllapi.h) -CDEFS += -DHELPLINKER_DLLIMPLEMENTATION - -VISIBILITY_HIDDEN=TRUE diff --git a/transex3/source/help/makefile.mk b/transex3/source/help/makefile.mk deleted file mode 100644 index 6fc823a1b59a..000000000000 --- a/transex3/source/help/makefile.mk +++ /dev/null @@ -1,120 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.38 $ -# -# 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 -# -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ = ..$/.. -PRJNAME = xmlhelp -TARGET = HelpLinker -LIBBASENAME = helplinker -PACKAGE = com$/sun$/star$/help -TARGETTYPE=CUI - -# --- Settings ----------------------------------------------------- - -.INCLUDE : settings.mk -.INCLUDE : helplinker.pmk - -.IF "$(SYSTEM_LIBXSLT)" == "YES" -CFLAGS+= $(LIBXSLT_CFLAGS) -.ELSE -LIBXSLTINCDIR=external$/libxslt -CFLAGS+= -I$(SOLARINCDIR)$/$(LIBXSLTINCDIR) -.ENDIF - -.IF "$(SYSTEM_DB)" == "YES" -CFLAGS+=-DSYSTEM_DB -I$(DB_INCLUDES) -.ENDIF - -.IF "$(SYSTEM_EXPAT)" == "YES" -CFLAGS+=-DSYSTEM_EXPAT -.ENDIF - -OBJFILES=\ - $(OBJ)$/HelpLinker.obj \ - $(OBJ)$/HelpCompiler.obj -SLOFILES=\ - $(SLO)$/HelpLinker.obj \ - $(SLO)$/HelpCompiler.obj - -EXCEPTIONSFILES=\ - $(OBJ)$/HelpLinker.obj \ - $(OBJ)$/HelpCompiler.obj \ - $(SLO)$/HelpLinker.obj \ - $(SLO)$/HelpCompiler.obj -.IF "$(OS)" == "MACOSX" && "$(CPU)" == "P" && "$(COM)" == "GCC" -# There appears to be a GCC 4.0.1 optimization error causing _file:good() to -# report true right before the call to writeOut at HelpLinker.cxx:1.12 l. 954 -# but out.good() to report false right at the start of writeOut at -# HelpLinker.cxx:1.12 l. 537: -NOOPTFILES=\ - $(OBJ)$/HelpLinker.obj \ - $(SLO)$/HelpLinker.obj -.ENDIF - -APP1TARGET= $(TARGET) -APP1OBJS=\ - $(OBJ)$/HelpLinker.obj \ - $(OBJ)$/HelpCompiler.obj - -APP1STDLIBS+=$(SALLIB) $(BERKELEYLIB) $(XSLTLIB) $(EXPATASCII3RDLIB) - -SHL1TARGET =$(LIBBASENAME)$(DLLPOSTFIX) -SHL1LIBS= $(SLB)$/$(TARGET).lib -SHL1IMPLIB =i$(LIBBASENAME) -SHL1DEF =$(MISC)$/$(SHL1TARGET).def -SHL1STDLIBS =$(SALLIB) $(BERKELEYLIB) $(XSLTLIB) $(EXPATASCII3RDLIB) -SHL1USE_EXPORTS =ordinal - -DEF1NAME =$(SHL1TARGET) -DEFLIB1NAME =$(TARGET) - -JAVAFILES = \ - HelpIndexerTool.java \ - HelpFileDocument.java - - -JAVACLASSFILES = \ - $(CLASSDIR)$/$(PACKAGE)$/HelpIndexerTool.class \ - $(CLASSDIR)$/$(PACKAGE)$/HelpFileDocument.class - -.IF "$(SYSTEM_LUCENE)" == "YES" -CLASSPATH!:=$(CLASSPATH)$(PATH_SEPERATOR)$(LUCENE_CORE_JAR)$(PATH_SEPERATOR)$(LUCENE_ANALYZERS_JAR) -.ELSE -JARFILES += lucene-core-2.3.jar lucene-analyzers-2.3.jar -.ENDIF -JAVAFILES = $(subst,$(CLASSDIR)$/$(PACKAGE)$/, $(subst,.class,.java $(JAVACLASSFILES))) - -JARCLASSDIRS = $(PACKAGE)/* -JARTARGET = HelpIndexerTool.jar -JARCOMPRESS = TRUE - -# --- Targets ------------------------------------------------------ - -.INCLUDE : target.mk diff --git a/transex3/source/helpex.cxx b/transex3/source/helpex.cxx deleted file mode 100644 index f4a1589b530e..000000000000 --- a/transex3/source/helpex.cxx +++ /dev/null @@ -1,299 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: helpex.cxx,v $ - * $Revision: 1.14 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_transex3.hxx" -#include -#include - -// local includes -#include "helpmerge.hxx" - -// defines to parse command line -#define STATE_NON 0x0001 -#define STATE_INPUT 0x0002 -#define STATE_OUTPUT 0x0003 -#define STATE_PRJ 0x0004 -#define STATE_ROOT 0x0005 -#define STATE_SDFFILE 0x0006 -#define STATE_ERRORLOG 0x0007 -#define STATE_BREAKHELP 0x0008 -#define STATE_UNMERGE 0x0009 -#define STATE_UTF8 0x000A -#define STATE_LANGUAGES 0x000B -#define STATE_FORCE_LANGUAGES 0x000C -#define STATE_OUTPUTX 0xfe -#define STATE_OUTPUTY 0xff - -// set of global variables -ByteString sInputFile; -BOOL bEnableExport; -BOOL bMergeMode; -BOOL bErrorLog; -BOOL bUTF8; -ByteString sPrj; -ByteString sPrjRoot; -ByteString sOutputFile; -ByteString sOutputFileX; -ByteString sOutputFileY; -ByteString sSDFFile; -bool bQuiet; - -/*****************************************************************************/ -BOOL ParseCommandLine( int argc, char* argv[]) -/*****************************************************************************/ -{ - bEnableExport = FALSE; - bMergeMode = FALSE; - bErrorLog = TRUE; - bUTF8 = TRUE; - sPrj = ""; - sPrjRoot = ""; - bQuiet = false; - Export::sLanguages = ""; - Export::sForcedLanguages = ""; - - USHORT nState = STATE_NON; - BOOL bInput = FALSE; - - // parse command line - for( int i = 1; i < argc; i++ ) { - if ( ByteString( argv[ i ]).ToUpperAscii() == "-I" ) { - nState = STATE_INPUT; // next tokens specifies source files - } - else if ( ByteString( argv[ i ]).ToUpperAscii() == "-O" ) { - nState = STATE_OUTPUT; // next token specifies the dest file - } - else if ( ByteString( argv[ i ]).ToUpperAscii() == "-X" ) { - nState = STATE_OUTPUTX; // next token specifies the dest file - } - else if ( ByteString( argv[ i ]).ToUpperAscii() == "-Y" ) { - nState = STATE_OUTPUTY; // next token specifies the dest file - } - else if ( ByteString( argv[ i ]).ToUpperAscii() == "-P" ) { - nState = STATE_PRJ; // next token specifies the cur. project - } - else if ( ByteString( argv[ i ]).ToUpperAscii() == "-LF" ) { - nState = STATE_FORCE_LANGUAGES; - } - - else if ( ByteString( argv[ i ]).ToUpperAscii() == "-R" ) { - nState = STATE_ROOT; // next token specifies path to project root - } - else if ( ByteString( argv[ i ]).ToUpperAscii() == "-M" ) { - nState = STATE_SDFFILE; // next token specifies the merge database - } - else if ( ByteString( argv[ i ]).ToUpperAscii() == "-E" ) { - nState = STATE_ERRORLOG; - bErrorLog = FALSE; - } - else if ( ByteString( argv[ i ] ).ToUpperAscii() == "-QQ" ) { - bQuiet = true; - } - else if ( ByteString( argv[ i ]).ToUpperAscii() == "-UTF8" ) { - nState = STATE_UTF8; - bUTF8 = TRUE; - } - else if ( ByteString( argv[ i ]).ToUpperAscii() == "-NOUTF8" ) { - nState = STATE_UTF8; - bUTF8 = FALSE; - } - else if ( ByteString( argv[ i ]).ToUpperAscii() == "-L" ) { - nState = STATE_LANGUAGES; - } - else { - switch ( nState ) { - case STATE_NON: { - return FALSE; // no valid command line - } - //break; - case STATE_INPUT: { - sInputFile = argv[ i ]; - bInput = TRUE; // source file found - } - break; - case STATE_OUTPUT: { - sOutputFile = argv[ i ]; // the dest. file - } - break; - case STATE_OUTPUTX: { - sOutputFileX = argv[ i ]; // the dest. file - } - break; - case STATE_OUTPUTY: { - sOutputFileY = argv[ i ]; // the dest. file - } - break; - case STATE_PRJ: { - sPrj = argv[ i ]; -// sPrj.ToLowerAscii(); // the project - } - break; - case STATE_ROOT: { - sPrjRoot = argv[ i ]; // path to project root - } - break; - case STATE_SDFFILE: { - sSDFFile = argv[ i ]; - bMergeMode = TRUE; // activate merge mode, cause merge database found - } - break; - case STATE_LANGUAGES: { - Export::sLanguages = argv[ i ]; - } - case STATE_FORCE_LANGUAGES:{ - Export::sForcedLanguages = argv[ i ]; - } - break; - } - } - } - - if ( bInput ) { - // command line is valid - bEnableExport = TRUE; - return TRUE; - } - - // command line is not valid - return FALSE; -} - - -/*****************************************************************************/ -void Help() -/*****************************************************************************/ -{ - fprintf( stdout, "Syntax: HELPEX[-p Prj][-r PrjRoot]-i FileIn ( -o FileOut | -x path -y relfile )[-m DataBase][-e][-b][-u][-L l1,l2,...][-QQ] -LF l1,l2 \n" ); - fprintf( stdout, " Prj: Project\n" ); - fprintf( stdout, " PrjRoot: Path to project root (..\\.. etc.)\n" ); - fprintf( stdout, " FileIn: Source file (*.lng)\n" ); - fprintf( stdout, " FileOut: Destination file (*.*)\n" ); - fprintf( stdout, " DataBase: Mergedata (*.sdf)\n" ); - fprintf( stdout, " -QQ: quiet output\n" ); - fprintf( stdout, " -L: Restrict the handled languages. l1,l2,... are elements of (en-US,fr,de...)\n" ); - fprintf( stdout, " A fallback language can be defined like this: l1=f1.\n" ); - fprintf( stdout, " f1, f2,... are also elements of (en-US,fr,de...)\n" ); - fprintf( stdout, " Example: -L fr=en-US\n" ); - fprintf( stdout, " Restriction to fr, en-US will be fallback for fr\n" ); - fprintf( stdout, " -LF: Force the creation of that languages\n" ); - -} - -/*****************************************************************************/ -#ifndef TESTDRIVER - -#if defined(UNX) || defined(OS2) -int main( int argc, char *argv[] ) -#else -int _cdecl main( int argc, char *argv[] ) -#endif -/*****************************************************************************/ -{ - - if ( !ParseCommandLine( argc, argv )) { - Help(); - return 1; - } - //sal_uInt32 startfull = Export::startMessure(); - - bool hasInputList = sInputFile.GetBuffer()[0]=='@'; -// printf("x = %s , y = %s , o = %s\n", sOutputFileX.GetBuffer(), sOutputFileY.GetBuffer() , sOutputFile.GetBuffer() ); - bool hasNoError = true; - - if ( sOutputFile.Len() ){ // Merge single file ? - //printf("DBG: Inputfile = %s\n",sInputFile.GetBuffer()); - HelpParser aParser( sInputFile, bUTF8 , false ); - - if ( bMergeMode ) - { - - //sal_uInt64 startreadloc = Export::startMessure(); - MergeDataFile aMergeDataFile( sSDFFile, sInputFile , FALSE, RTL_TEXTENCODING_MS_1252 ); - //MergeDataFile aMergeDataFile( sSDFFile, sInputFile , FALSE, RTL_TEXTENCODING_MS_1252, false ); - //Export::stopMessure( ByteString("read localize.sdf") , startreadloc ); - - hasNoError = aParser.Merge( sSDFFile, sOutputFile , Export::sLanguages , aMergeDataFile ); - } - else - hasNoError = aParser.CreateSDF( sOutputFile, sPrj, sPrjRoot, sInputFile, new XMLFile( '0' ), "help" ); - }else if ( sOutputFileX.Len() && sOutputFileY.Len() && hasInputList ) { // Merge multiple files ? - if ( bMergeMode ){ - - ifstream aFStream( sInputFile.Copy( 1 , sInputFile.Len() ).GetBuffer() , ios::in ); - - if( !aFStream ){ - cerr << "ERROR: - helpex - Can't open the file " << sInputFile.Copy( 1 , sInputFile.Len() ).GetBuffer() << "\n"; - exit(-1); - } - - vector filelist; - rtl::OStringBuffer filename; - sal_Char aChar; - while( aFStream.get( aChar ) ) - { - if( aChar == ' ' || aChar == '\n') - filelist.push_back( ByteString( filename.makeStringAndClear().getStr() ) ); - else - filename.append( aChar ); - } - if( filename.getLength() > 0 ) - filelist.push_back( ByteString ( filename.makeStringAndClear().getStr() ) ); - - aFStream.close(); - ByteString sHelpFile(""); // dummy - //MergeDataFile aMergeDataFile( sSDFFile, sHelpFile , FALSE, RTL_TEXTENCODING_MS_1252, false ); - MergeDataFile aMergeDataFile( sSDFFile, sHelpFile , FALSE, RTL_TEXTENCODING_MS_1252 ); - - //aMergeDataFile.Dump(); - std::vector aLanguages; - HelpParser::parse_languages( aLanguages , aMergeDataFile ); - - bool bCreateDir = true; - for( vector::iterator pos = filelist.begin() ; pos != filelist.end() ; ++pos ) - { - sHelpFile = *pos; - cout << ".";cout.flush(); - - HelpParser aParser( sHelpFile , bUTF8 , true ); - hasNoError = aParser.Merge( sSDFFile , sOutputFileX , sOutputFileY , true , aLanguages , aMergeDataFile , bCreateDir ); - bCreateDir = false; - } - } - } else - cerr << "helpex ERROR: Wrong input parameters!\n"; - - //Export::stopMessure( ByteString("full cycle") , startfull ); - if( hasNoError ) - return 0; - else - return 1; -} -#endif diff --git a/transex3/source/helpmerge.cxx b/transex3/source/helpmerge.cxx deleted file mode 100644 index 8aafc692f14c..000000000000 --- a/transex3/source/helpmerge.cxx +++ /dev/null @@ -1,730 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: helpmerge.cxx,v $ - * $Revision: 1.24 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_transex3.hxx" -#include -#include -// local includes -#include -#include -#include "helpmerge.hxx" -#include "utf8conv.hxx" -#include -#include -#include -#include -#include -#include -#include "rtl/strbuf.hxx" -#ifdef WNT -#include -//#include -#include "tools/prewin.h" -#include -#include "tools/postwin.h" -#endif - -/*****************************************************************************/ -void HelpParser::FillInFallbacks( LangHashMap& rElem_out, ByteString sLangIdx_in ){ -/*****************************************************************************/ - static const ByteString ENGLISH_LANGUAGECODE( "en-US" ); - static const ByteString GERMAN_LANGUAGECODE ( "de" ); - ByteString sCur; - XMLElement* pTmp = NULL; - XMLElement* pTmp2 = NULL; - - sCur = sLangIdx_in; - ByteString sFallback( sCur ); - GetIsoFallback( sFallback ); - if( (rElem_out.find( sFallback ) != rElem_out.end()) && rElem_out[ sFallback ] != NULL ){ - pTmp2 = rElem_out[ sFallback ]; - pTmp = new XMLElement( *pTmp2 ) ; // Copy - pTmp->SetPos( pTmp2->GetPos()+1 ); - pTmp->ChangeLanguageTag( String( sLangIdx_in , RTL_TEXTENCODING_ASCII_US) ); - rElem_out[ sLangIdx_in ] = pTmp; - pTmp2 = NULL; - } - else if( (rElem_out.find( ENGLISH_LANGUAGECODE ) != rElem_out.end()) && rElem_out[ ENGLISH_LANGUAGECODE ] != NULL ){// No English - pTmp2 = rElem_out[ ENGLISH_LANGUAGECODE ]; - pTmp = new XMLElement( *pTmp2 ) ; // Copy - pTmp->SetPos( pTmp2->GetPos()+1 ); - pTmp->ChangeLanguageTag( String( sLangIdx_in , RTL_TEXTENCODING_ASCII_US) ); - rElem_out[ sCur ] = pTmp; - pTmp2 = NULL; - } - else if( (rElem_out.find( GERMAN_LANGUAGECODE ) != rElem_out.end() ) && rElem_out[ GERMAN_LANGUAGECODE ] != NULL ){// No English - pTmp2 = rElem_out[ GERMAN_LANGUAGECODE ]; - pTmp = new XMLElement( *pTmp2 ); // Copy - pTmp->SetPos( pTmp2->GetPos()+1 ); - pTmp->ChangeLanguageTag( String( sLangIdx_in , RTL_TEXTENCODING_ASCII_US ) ); - rElem_out[ sCur ] = pTmp; - pTmp2 = NULL; - }else{ - fprintf(stdout,"ERROR: No Fallback found for language %s:\n",sCur.GetBuffer()); - rElem_out[ sCur ]=new XMLElement(); // Use dummy element - } -} - -/*****************************************************************************/ -void HelpParser::Dump(XMLHashMap* rElem_in) { -/*****************************************************************************/ - for(XMLHashMap::iterator pos = rElem_in->begin();pos != rElem_in->end(); ++pos){ - Dump(pos->second,pos->first); - } -} -/*****************************************************************************/ -void HelpParser::Dump(LangHashMap* rElem_in,const ByteString sKey_in) { -/*****************************************************************************/ - ByteString x; - OString y; - fprintf(stdout,"+------------%s-----------+\n",sKey_in.GetBuffer() ); - for(LangHashMap::iterator posn=rElem_in->begin();posn!=rElem_in->end();++posn){ - x=posn->first; - y=posn->second->ToOString(); - fprintf(stdout,"key=%s value=%s\n",x.GetBuffer(),y.getStr()); - } - fprintf(stdout,"+--------------------------+\n"); -} - -HelpParser::HelpParser( const ByteString &rHelpFile, bool rUTF8 , bool rHasInputList ) - : sHelpFile( rHelpFile ), - bUTF8 ( rUTF8 ), - bHasInputList( rHasInputList ) - {}; - -/*****************************************************************************/ -bool HelpParser::CreateSDF( -/*****************************************************************************/ - const ByteString &rSDFFile_in, const ByteString &rPrj_in,const ByteString &rRoot_in, - const ByteString &sHelpFile, XMLFile *pXmlFile, const ByteString &rGsi1){ - // GSI File constants - static const String GSI_SEQUENCE1( String::CreateFromAscii("\t0\t") ); - static const String GSI_SEQUENCE2( String::CreateFromAscii("\t\t\t0\t") ); - static const String GSI_TAB ( String::CreateFromAscii("\t") ); - static const String GSI_SEQUENCE4( String::CreateFromAscii("\t\t\t\t") ); - static const String ret ( String::CreateFromAscii("\n") ); - static const String ret_char ( String::CreateFromAscii("") ); - static const String tab ( String::CreateFromAscii("\t") ); - static const String tab_char ( String::CreateFromAscii("") ); - - SimpleXMLParser aParser; - String sUsedTempFile; - String sXmlFile; - - if( Export::fileHasUTF8ByteOrderMarker( sHelpFile ) ){ - DirEntry aTempFile = Export::GetTempFile(); - DirEntry aSourceFile( String( sHelpFile , RTL_TEXTENCODING_ASCII_US ) ); - aSourceFile.CopyTo( aTempFile , FSYS_ACTION_COPYFILE ); - String sTempFile = aTempFile.GetFull(); - Export::RemoveUTF8ByteOrderMarkerFromFile( ByteString( sTempFile , RTL_TEXTENCODING_ASCII_US ) ); - sUsedTempFile = sTempFile; - sXmlFile = sTempFile; - }else{ - sUsedTempFile = String::CreateFromAscii(""); - sXmlFile = String( sHelpFile , RTL_TEXTENCODING_ASCII_US ); - } - -// ByteString fullFilePath; - //DirEntry aFile( sXmlFile ); - //makeAbsolutePath( sHelpFile , rRoot_in); - ByteString fullFilePath = rPrj_in; - fullFilePath.Append( "\\" ); - fullFilePath.Append( makeAbsolutePath( sHelpFile , rRoot_in ) ); - fullFilePath.SearchAndReplaceAll( "\\", "/" ); - - String strFullPath( fullFilePath.GetBuffer() , RTL_TEXTENCODING_ASCII_US ); - - //printf( "%s\n", fullFilePath.GetBuffer() ); - std::auto_ptr file ( aParser.Execute( strFullPath , sXmlFile, pXmlFile ) ); - - if(file.get() == NULL){ - printf("%s\n",ByteString(aParser.GetError().sMessage,RTL_TEXTENCODING_ASCII_US).GetBuffer()); - exit(-1); - //return false; - } - file->Extract(); - if( !file->CheckExportStatus() ){ - return true; - } - SvFileStream aSDFStream( String( rSDFFile_in, RTL_TEXTENCODING_ASCII_US ), - STREAM_STD_WRITE | STREAM_TRUNC ); - - if ( !aSDFStream.IsOpen()) { - fprintf(stdout,"Can't open file %s\n",rSDFFile_in.GetBuffer()); - return false; - } - - ByteString sActFileName = makeAbsolutePath( sHelpFile , rRoot_in ); - -/* DirEntry aEntry( String( sHelpFile, RTL_TEXTENCODING_ASCII_US )); - aEntry.ToAbs(); - String sFullEntry = aEntry.GetFull(); - aEntry += DirEntry( String( "..", RTL_TEXTENCODING_ASCII_US )); - aEntry += DirEntry( rRoot_in ); - ByteString sPrjEntry( aEntry.GetFull(), gsl_getSystemTextEncoding()); - ByteString sActFileName( - sFullEntry.Copy( sPrjEntry.Len() + 1 ), gsl_getSystemTextEncoding()); - - sActFileName.SearchAndReplaceAll( "/", "\\" ); -*/ - XMLHashMap* aXMLStrHM = file->GetStrings(); - LangHashMap* pElem; - XMLElement* pXMLElement = NULL; - - //Dump(aXMLStrHM); - - ByteString sTimeStamp( Export::GetTimeStamp() ); - OUString sOUTimeStamp( sTimeStamp.GetBuffer() , sTimeStamp.Len() , RTL_TEXTENCODING_ASCII_US ); - - OUStringBuffer sBuffer; - const OUString sOUPrj( rPrj_in.GetBuffer() , rPrj_in.Len() , RTL_TEXTENCODING_ASCII_US ); - const OUString sOUActFileName(sActFileName.GetBuffer() , sActFileName.Len() , RTL_TEXTENCODING_ASCII_US ); - const OUString sOUGsi1( rGsi1.GetBuffer() , rGsi1.Len() , RTL_TEXTENCODING_ASCII_US ); - - Export::InitLanguages( false ); - std::vector aLanguages = Export::GetLanguages(); - - std::vector order = file->getOrder(); - std::vector::iterator pos; - XMLHashMap::iterator posm; - - for( pos = order.begin(); pos != order.end() ; ++pos ) - { - posm = aXMLStrHM->find( *pos ); - pElem = posm->second; - ByteString sCur; - - for( unsigned int n = 0; n < aLanguages.size(); n++ ) - { - sCur = aLanguages[ n ]; - if(pElem->find( sCur )==pElem->end()) - { - FillInFallbacks( *pElem , sCur ); - } - pXMLElement = (*pElem)[ sCur ]; - - if( pXMLElement != NULL ) - { - OUString data = pXMLElement->ToOUString(); - String sTmp = String(data.getStr()); - sTmp.SearchAndReplaceAll(ret,ret_char); // Remove \n - sTmp.SearchAndReplaceAll(tab,tab_char); // Remove \t - - data = OUString( sTmp ); - sBuffer.append( sOUPrj ); - sBuffer.append( GSI_TAB ); //"\t"; - if ( rRoot_in.Len()) - sBuffer.append( sOUActFileName ); - sBuffer.append( GSI_SEQUENCE1 ); //"\t0\t"; - sBuffer.append( sOUGsi1 ); //"help"; - sBuffer.append( GSI_TAB ); //"\t"; - ByteString sID = posm->first; // ID - sBuffer.append( OUString( sID.GetBuffer() , sID.Len() , RTL_TEXTENCODING_UTF8 ) ); - sBuffer.append( GSI_TAB ); //"\t"; - ByteString sOldRef = pXMLElement->GetOldref(); // oldref - sBuffer.append( OUString(sOldRef.GetBuffer() , sOldRef.Len() , RTL_TEXTENCODING_UTF8 ) ); - sBuffer.append( GSI_SEQUENCE2 ); //"\t\t\t0\t"; - sBuffer.append( OUString( sCur.GetBuffer() , sCur.Len() , RTL_TEXTENCODING_UTF8 ) ); - sBuffer.append( GSI_TAB ); //"\t"; - sBuffer.append( data ); - sBuffer.append( GSI_SEQUENCE4 ); //"\t\t\t\t"; - sBuffer.append( sOUTimeStamp ); - ByteString sOut( sBuffer.makeStringAndClear().getStr() , RTL_TEXTENCODING_UTF8 ); - //if( !sCur.EqualsIgnoreCaseAscii("de") ||( sCur.EqualsIgnoreCaseAscii("de") && !Export::isMergingGermanAllowed( rPrj_in ) ) ) - //{ - if( data.getLength() > 0 ) aSDFStream.WriteLine( sOut ); - //} - pXMLElement=NULL; - }else fprintf(stdout,"\nDBG: NullPointer in HelpParser::CreateSDF , Language %s\n",sCur.GetBuffer() ); - } - - } - //Dump(aXMLStrHM); - aSDFStream.Close(); - - if( !sUsedTempFile.EqualsIgnoreCaseAscii( "" ) ){ - DirEntry aTempFile( sUsedTempFile ); - aTempFile.Kill(); - } - return TRUE; -} - -ByteString HelpParser::makeAbsolutePath( const ByteString& sHelpFile , const ByteString& rRoot_in ) -{ - DirEntry aEntry( String( sHelpFile, RTL_TEXTENCODING_ASCII_US )); - aEntry.ToAbs(); - String sFullEntry = aEntry.GetFull(); - aEntry += DirEntry( String( "..", RTL_TEXTENCODING_ASCII_US )); - aEntry += DirEntry( rRoot_in ); - ByteString sPrjEntry( aEntry.GetFull(), gsl_getSystemTextEncoding()); - ByteString sActFileName( - sFullEntry.Copy( sPrjEntry.Len() + 1 ), gsl_getSystemTextEncoding()); - - sActFileName.SearchAndReplaceAll( "/", "\\" ); - return sActFileName; -} -bool HelpParser::Merge( const ByteString &rSDFFile, const ByteString &rDestinationFile , - ByteString& sLanguage , MergeDataFile& aMergeDataFile ) -{ - - (void) rSDFFile; - bool hasNoError = true; - - SimpleXMLParser aParser; - - String sUsedTempFile; - String sXmlFile; - - if( Export::fileHasUTF8ByteOrderMarker( sHelpFile ) ){ - DirEntry aTempFile = Export::GetTempFile(); - DirEntry aSourceFile( String( sHelpFile , RTL_TEXTENCODING_ASCII_US ) ); - aSourceFile.CopyTo( aTempFile , FSYS_ACTION_COPYFILE ); - String sTempFile = aTempFile.GetFull(); - Export::RemoveUTF8ByteOrderMarkerFromFile( ByteString( sTempFile , RTL_TEXTENCODING_ASCII_US ) ); - sUsedTempFile = sTempFile; - sXmlFile = sTempFile; - }else{ - sUsedTempFile = String::CreateFromAscii(""); - sXmlFile = String( sHelpFile , RTL_TEXTENCODING_ASCII_US ); - } - - OUString sOUHelpFile( sXmlFile ); - String fullFilePath; - DirEntry aFile( sXmlFile ); - - XMLFile* xmlfile = ( aParser.Execute( aFile.GetFull() , sOUHelpFile, new XMLFile( '0' ) ) ); - printf("Dest file %s\n",rDestinationFile.GetBuffer()); - hasNoError = MergeSingleFile( xmlfile , aMergeDataFile , sLanguage , rDestinationFile ); - delete xmlfile; - if( !sUsedTempFile.EqualsIgnoreCaseAscii( "" ) ){ - DirEntry aTempFile( sUsedTempFile ); - aTempFile.Kill(); - } - return hasNoError; -} - -bool ByteStringEqual( const ByteString& rKey1, const ByteString& rKey2 ) { - return rKey1.CompareTo( rKey2 )==COMPARE_EQUAL; -}; -bool ByteStringLess( const ByteString& rKey1, const ByteString& rKey2 ) { - return rKey1.CompareTo( rKey2 )==COMPARE_LESS; -} - -void HelpParser::parse_languages( std::vector& aLanguages , MergeDataFile& aMergeDataFile ){ - std::vector aTmp; - - const ByteString DE ("de"); - const ByteString ENUS ("en-US"); - static const ByteString ALL( "ALL" ); - - Export::InitLanguages( false ); - - if( Export::sLanguages.EqualsIgnoreCaseAscii( ALL ) ) - { - aLanguages = aMergeDataFile.GetLanguages(); - aLanguages.push_back( DE ); - aLanguages.push_back( ENUS ); - - if( !Export::sForcedLanguages.Equals("") ) - { - std::vector aFL = Export::GetForcedLanguages(); - std::copy( aFL.begin() , - aFL.end() , - back_inserter( aLanguages ) - ); - std::sort( aLanguages.begin() , aLanguages.end() , ByteStringLess ); - std::vector::iterator unique_iter = std::unique( aLanguages.begin() , aLanguages.end() , ByteStringEqual ); - std::copy( aLanguages.begin() , unique_iter , back_inserter( aTmp ) ); - aLanguages = aTmp; - } - } - else{ - aLanguages = Export::GetLanguages(); - } - -} - -bool HelpParser::Merge( - const ByteString &rSDFFile, const ByteString &rPathX , const ByteString &rPathY , bool bISO , - const std::vector& aLanguages , MergeDataFile& aMergeDataFile , bool bCreateDir ) -{ - - - (void) rSDFFile ; - bool hasNoError = true; - SimpleXMLParser aParser; - String sUsedTempFile; - String sXmlFile; - - if( Export::fileHasUTF8ByteOrderMarker( sHelpFile ) ) - { - DirEntry aTempFile = Export::GetTempFile(); - DirEntry aSourceFile( String( sHelpFile , RTL_TEXTENCODING_ASCII_US ) ); - aSourceFile.CopyTo( aTempFile , FSYS_ACTION_COPYFILE ); - String sTempFile = aTempFile.GetFull(); - Export::RemoveUTF8ByteOrderMarkerFromFile( ByteString( sTempFile , RTL_TEXTENCODING_ASCII_US ) ); - sUsedTempFile = sTempFile; - sXmlFile = sTempFile; - } - else - { - sUsedTempFile = String::CreateFromAscii(""); - sXmlFile = String( sHelpFile , RTL_TEXTENCODING_ASCII_US ); - } - - - OUString sOUHelpFile( sXmlFile ); - String fullFilePath; - DirEntry aFile( sXmlFile ); - - XMLFile* xmlfile = ( aParser.Execute( aFile.GetFull() , sOUHelpFile, new XMLFile( '0' ) ) ); - xmlfile->Extract(); - - if( xmlfile == NULL) - { - printf("%s\n",ByteString(aParser.GetError().sMessage,RTL_TEXTENCODING_UTF8).GetBuffer()); - exit(-1); - //return false; - } - - - ByteString sCur; - for( unsigned int n = 0; n < aLanguages.size(); n++ ){ - sCur = aLanguages[ n ]; - - ByteString sFilepath; - if( bISO ) sFilepath = GetOutpath( rPathX , sCur , rPathY ); - else sFilepath = rPathX; - if( bCreateDir ) MakeDir( sFilepath ); - - XMLFile* file = new XMLFile( *xmlfile ); - sFilepath.Append( sHelpFile ); - hasNoError = MergeSingleFile( file , aMergeDataFile , sCur , sFilepath ); - delete file; - - if( !hasNoError ) return false; // Stop on error - } - - if( !sUsedTempFile.EqualsIgnoreCaseAscii( "" ) ) - { - DirEntry aTempFile( sUsedTempFile ); - aTempFile.Kill(); - } - delete xmlfile; - return hasNoError; -} - -bool HelpParser::MergeSingleFile( XMLFile* file , MergeDataFile& aMergeDataFile , const ByteString& sLanguage , - ByteString sPath ) -{ - file->Extract(); - - XMLHashMap* aXMLStrHM = file->GetStrings(); - LangHashMap* aLangHM; - static ResData pResData( "","",""); - pResData.sResTyp = "help"; - - ByteString sTmp = Export::sLanguages; - - sTmp.EraseLeadingAndTrailingChars(); - - for(XMLHashMap::iterator pos=aXMLStrHM->begin();pos!=aXMLStrHM->end();++pos) // Merge every l10n related string - { - - aLangHM = pos->second; - //printf("*********************DUMPING HASHMAP***************************************"); - //Dump( aXMLStrHM ); - //printf("DBG: sHelpFile = %s\n",sHelpFile.GetBuffer() ); - - pResData.sGId = pos->first; - pResData.sFilename = sHelpFile; - - ProcessHelp( aLangHM , sLanguage, &pResData , aMergeDataFile ); - } - - - // Init temp and target file - ByteString sTempFile; - ByteString sTargetFile( sPath ); - ByteString sTempFileCopy; - - static const ByteString INPATH = Export::GetEnv( "INPATH" ); - Export::getRandomName( sPath , sTempFile , INPATH ); - Export::getRandomName( sPath , sTempFileCopy , INPATH ); - // Write in the temp file - bool hasNoError = file->Write ( sTempFile ); - if( !hasNoError ) - { - cerr << "ERROR: file->Write failed\n"; - return false; - } - - DirEntry aTmp( sTempFile ); - DirEntry aTmp2( sTempFileCopy ); - DirEntry aTar( sTargetFile ); - - if( !Export::CopyFile( sTempFile , sTempFileCopy ) ) - { -#if defined(UNX) || defined(OS2) - sleep( 3 ); -#else - Sleep( 3 ); -#endif - if( !Export::CopyFile( sTempFile , sTempFileCopy ) ) - { - cerr << "ERROR: Can not copy file from " << sTempFile.GetBuffer() << " to " << sTempFileCopy.GetBuffer() << "\n"; - return false; - } - } - //remove( sTargetFile.GetBuffer() ); - - FileStat aFSTest( aTar ); - if( aFSTest.GetSize() < 1 ) - { - remove( sTargetFile.GetBuffer() ); - } - int rc; -#if defined(UNX) || defined(OS2) - rc = rename( sTempFile.GetBuffer() , sTargetFile.GetBuffer() ); -#else - rc = MoveFileEx( sTempFile.GetBuffer() , sTargetFile.GetBuffer(), MOVEFILE_REPLACE_EXISTING ); -#endif - FileStat aFS( aTar ); - - //cout << "mv " << sTempFile.GetBuffer() << " " << sTargetFile.GetBuffer() << "\n"; - //cout << "rc -> " << rc << " filesize -> " << aFS.GetSize() << "\n"; -// Windows rename returns -1 if the file already exits -//#ifdef UNX - if( rc < 0 || aFS.GetSize() < 1 ) -//#else -// if( aFS.GetSize() < 1 ) -//#endif - { -#if defined(UNX) || defined(OS2) - sleep( 3 ); -#else - Sleep( 3 ); -#endif - aFSTest.Update( aTar ); - if( aFSTest.GetSize() < 1 ) - { - remove( sTargetFile.GetBuffer() ); - } -#if defined(UNX) || defined(OS2) - rc = rename( sTempFileCopy.GetBuffer() , sTargetFile.GetBuffer() ); -#else - rc = MoveFileEx( sTempFileCopy.GetBuffer() , sTargetFile.GetBuffer() , MOVEFILE_REPLACE_EXISTING ); -#endif - aFS.Update( aTar ); - - //cout << "mv2 " << sTempFileCopy.GetBuffer() << " " << sTargetFile.GetBuffer() << "\n"; - //cout << "rc -> " << rc << " filesize -> " << aFS.GetSize() << "\n"; - -// Windows rename returns -1 if the file already exits -//#ifdef WNT -// if( aFS.GetSize() < 1 ) -//#else - if( rc < 0 || aFS.GetSize() < 1 ) -//#endif - { - cerr << "ERROR: helpex Can't rename file " << sTempFileCopy.GetBuffer() << " to " << sTargetFile.GetBuffer() << " rename rc=" << rc << " filesize=" << aFS.GetSize() << "\n"; - aTmp.Kill(); - aTmp2.Kill(); - if( aFS.GetSize() < 1 ) - aTar.Kill(); - return false; - } - } - aTmp.Kill(); - aTmp2.Kill(); - - return true; -} - -ByteString HelpParser::GetOutpath( const ByteString& rPathX , const ByteString& sCur , const ByteString& rPathY ){ - ByteString testpath = rPathX; - static const ByteString sDelimiter( DirEntry::GetAccessDelimiter(), RTL_TEXTENCODING_ASCII_US ); - testpath.EraseTrailingChars( '/' ); - testpath.EraseTrailingChars( '\\' ); - testpath += sDelimiter; - testpath += sCur; - testpath += sDelimiter; - ByteString sRelativePath( rPathY ); - sRelativePath.EraseLeadingChars( '/' ); - sRelativePath.EraseLeadingChars( '\\' ); - testpath += sRelativePath; - testpath += sDelimiter; - return testpath; -} -void HelpParser::MakeDir( const ByteString& sPath ){ - ByteString sTPath( sPath ); - ByteString sDelimiter( DirEntry::GetAccessDelimiter(), RTL_TEXTENCODING_ASCII_US ); - sTPath.SearchAndReplaceAll( sDelimiter , '/' ); - USHORT cnt = sTPath.GetTokenCount( '/' ); - ByteString sCreateDir; - for( USHORT i = 0 ; i < cnt ; i++ ) - { - sCreateDir += sTPath.GetToken( i , '/' ); - sCreateDir += sDelimiter; -#ifdef WNT - _mkdir( sCreateDir.GetBuffer() ); -#else - mkdir( sCreateDir.GetBuffer() , S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH ); -#endif - } -} - - -/* ProcessHelp Methode: search for en-US entry and replace it with the current language*/ -void HelpParser::ProcessHelp( LangHashMap* aLangHM , const ByteString& sCur , ResData *pResData , MergeDataFile& aMergeDataFile ){ - - XMLElement* pXMLElement = NULL; - PFormEntrys *pEntrys = NULL; - XMLData *data = NULL; - XMLParentNode *parent = NULL; - - String sNewdata; - ByteString sLId; - ByteString sGId; - - pEntrys = NULL; - -#ifdef MERGE_SOURCE_LANGUAGES - if( true ){ // Merge en-US! -#else - if( !sCur.EqualsIgnoreCaseAscii("en-US") ){ -#endif - pXMLElement = (*aLangHM)[ "en-US" ]; - if( pXMLElement == NULL ) - { - printf("Error: Can't find en-US entry\n"); - } - if( pXMLElement != NULL ) - { - parent = pXMLElement->GetParent(); - sLId = pXMLElement->GetOldref(); - pResData->sId = sLId; - - pEntrys = aMergeDataFile.GetPFormEntrys( pResData ); - if( pEntrys != NULL) - { - ByteString sNewText; - pEntrys->GetText( sNewText, STRING_TYP_TEXT, sCur , true ); - sNewdata = String( sNewText , RTL_TEXTENCODING_UTF8 ); - if ( sNewdata.Len()) - { - if( pXMLElement != NULL ) - { - data = new XMLData( sNewdata , NULL , true ); // Add new one - pXMLElement->RemoveAndDeleteAllChilds(); - pXMLElement->AddChild( data ); - aLangHM->erase( sCur ); - } - } - }else if( pResData == NULL ){fprintf(stdout,"Can't find GID=%s LID=%s TYP=%s\n",pResData->sGId.GetBuffer(),pResData->sId.GetBuffer(),pResData->sResTyp.GetBuffer());} - pXMLElement->ChangeLanguageTag( String( sCur , RTL_TEXTENCODING_ASCII_US) ); - } - - } -} -/* Process() Method merges */ -void HelpParser::Process( LangHashMap* aLangHM , const ByteString& sCur , ResData *pResData , MergeDataFile& aMergeDataFile ){ - - XMLElement* pXMLElement = NULL; - PFormEntrys *pEntrys = NULL; - XMLData *data = NULL; - XMLParentNode *parent = NULL; - XMLDefault *xmldefault = NULL; - - short curLang = 0; - String sNewdata; - bool isFallback = false; - ByteString sLId; - ByteString sGId; - - pEntrys = NULL; - -#ifdef MERGE_SOURCE_LANGUAGES - if( true ){ // Merge en-US! -#else - if( !sCur.EqualsIgnoreCaseAscii("en-US") ){ -#endif - pXMLElement = (*aLangHM)[ sCur ]; - if( pXMLElement == NULL ) - { - FillInFallbacks( *aLangHM , sCur ); - pXMLElement = ( *aLangHM )[ sCur ]; - isFallback = true; - } - if( pXMLElement != NULL ) - { - parent = pXMLElement->GetParent(); - sLId = pXMLElement->GetOldref(); - pResData->sId = sLId; - - pEntrys = aMergeDataFile.GetPFormEntrys( pResData ); - if( pEntrys != NULL) - { - ByteString sNewText; - pEntrys->GetText( sNewText, STRING_TYP_TEXT, sCur , true ); - sNewdata = String( sNewText , RTL_TEXTENCODING_UTF8 ); - if ( sNewdata.Len()) - { - printf("Entries found\n"); - if( pXMLElement != NULL ) - { - data = new XMLData( sNewdata , NULL , true ); // Add new one - if( pXMLElement->ToOUString().compareTo( OUString(data->GetData()) ) != 0 ) - { - pXMLElement->RemoveAndDeleteAllChilds(); - pXMLElement->AddChild( data ); - } - if( isFallback ) - { - xmldefault = new XMLDefault( String::CreateFromAscii("\n") , NULL ); - int pos = parent->GetPosition( pXMLElement->GetId() ); - if( pos != -1 ){ - parent->AddChild(xmldefault , pos+1 ); - parent->AddChild(pXMLElement , pos+2 ); - } - else fprintf(stdout,"ERROR: Can't find reference Element of id %s language %d\n",pXMLElement->GetId().GetBuffer(),curLang); - } - - aLangHM->erase( sCur ); - } - } - delete pResData; - }else if( pResData == NULL ){fprintf(stdout,"Can't find GID=%s LID=%s TYP=%s\n",pResData->sGId.GetBuffer(),pResData->sId.GetBuffer(),pResData->sResTyp.GetBuffer());} - } - - } -} - diff --git a/transex3/source/inireader.cxx b/transex3/source/inireader.cxx deleted file mode 100644 index 1ff34fad8e95..000000000000 --- a/transex3/source/inireader.cxx +++ /dev/null @@ -1,132 +0,0 @@ -#include -#include -#include -#include -#include -#include "inireader.hxx" - -using namespace std; -namespace transex3 -{ - -bool INIreader::read( INImap& myMap , string& filename ) -{ - ifstream aFStream( filename.c_str() ); - if( aFStream && aFStream.is_open()) - { - string line; - string section; - string param_key; - string param_value; - stringmap* myvalues = 0; - - while( std::getline( aFStream , line ) ) - { - trim( line ); - if( line.empty() ){ - } - else if( is_section( line , section ) ) - { - //cerr << "[" << section << "]\n"; - myvalues = new stringmap(); - myMap[ section ] = myvalues ; - } - else if ( is_parameter( line , param_key , param_value ) ) - { - //cerr << "" << param_key << " = " << param_value << "\n"; - if( myvalues ) - { - (*myvalues)[ param_key ] = param_value ; - } - else - { - cerr << "ERROR: The INI file " << filename << " appears to be broken ... parameters without a section?!?\n"; - if( aFStream.is_open() ) aFStream.close(); - return false; - } - } - } - - if( aFStream.is_open() ) - aFStream.close(); - - return true; - } - else - { - cerr << "ERROR: Can't open file '" << filename << "'\n"; - } - return false; -} - -bool INIreader::is_section( string& line , string& section_str ) -{ - // Error in regex ? - check_status( section_status ); - UnicodeString target( line.c_str() , line.length() ); - - section_match->reset( target ); - check_status( section_status ); - - if( section_match->find() ) - { - check_status( section_status ); - UnicodeString result( section_match->group( 1 , section_status) ); - check_status( section_status ); - toStlString( result , section_str ); - - return true; - } - return false; -} - -bool INIreader::is_parameter( string& line , string& parameter_key , string& parameter_value ) -{ - // Error in regex ? - check_status( parameter_status ); - UnicodeString target( line.c_str() , line.length() ); - - parameter_match->reset( target ); - check_status( parameter_status ); - - if( parameter_match->find() ) - { - check_status( parameter_status ); - - UnicodeString result1( parameter_match->group( 1 , parameter_status) ); - check_status( parameter_status ); - toStlString( result1 , parameter_key ); - UnicodeString result2( parameter_match->group( 2 , parameter_status) ); - check_status( parameter_status ); - toStlString( result2 , parameter_value ); - - return true; - } - return false; -} - -void INIreader::check_status( UErrorCode status ) -{ - if( U_FAILURE( status) ) - { - cerr << "Error in or while using regex: " << u_errorName( status ) << "\n"; - exit(-1); - } -} - -void INIreader::toStlString( const UnicodeString& str , string& stl_str) -{ - // convert to string - char* buffer = new char[ str.length()*3 ]; - str.extract( 0 , str.length() , buffer ); - stl_str = string( buffer ); - delete[] buffer; -} - -void INIreader::trim( string& str ) -{ - string str1 = str.substr( 0 , str.find_last_not_of(' ') + 1 ); - str = str1.empty() ? str1 : str1.substr( str1.find_first_not_of(' ') ); -} - -} diff --git a/transex3/source/lngex.cxx b/transex3/source/lngex.cxx deleted file mode 100644 index 53c97de6e045..000000000000 --- a/transex3/source/lngex.cxx +++ /dev/null @@ -1,226 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: lngex.cxx,v $ - * $Revision: 1.18 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_transex3.hxx" -#include - -// local includes -#include "lngmerge.hxx" - -// defines to parse command line -#define STATE_NON 0x0001 -#define STATE_INPUT 0x0002 -#define STATE_OUTPUT 0x0003 -#define STATE_PRJ 0x0004 -#define STATE_ROOT 0x0005 -#define STATE_MERGESRC 0x0006 -#define STATE_ERRORLOG 0x0007 -#define STATE_BREAKHELP 0x0008 -#define STATE_UNMERGE 0x0009 -#define STATE_UTF8 0x000A -#define STATE_ULF 0x000B -#define STATE_LANGUAGES 0x000C - -// set of global variables -ByteString sInputFile; -BOOL bEnableExport; -BOOL bMergeMode; -BOOL bErrorLog; -BOOL bUTF8; -BOOL bULF; // ULF = Unicode Language File -bool bQuiet; -ByteString sPrj; -ByteString sPrjRoot; -ByteString sOutputFile; -ByteString sMergeSrc; - -/*****************************************************************************/ -BOOL ParseCommandLine( int argc, char* argv[]) -/*****************************************************************************/ -{ - bEnableExport = FALSE; - bMergeMode = FALSE; - bErrorLog = TRUE; - bUTF8 = TRUE; - bULF = FALSE; - bQuiet = false; - sPrj = ""; - sPrjRoot = ""; - Export::sLanguages = ""; - - USHORT nState = STATE_NON; - BOOL bInput = FALSE; - - // parse command line - for( int i = 1; i < argc; i++ ) { - ByteString sSwitch( argv[ i ] ); - sSwitch.ToUpperAscii(); - if ( sSwitch == "-I" ) { - nState = STATE_INPUT; // next tokens specifies source files - } - else if ( sSwitch == "-O" ) { - nState = STATE_OUTPUT; // next token specifies the dest file - } - else if ( sSwitch == "-P" ) { - nState = STATE_PRJ; // next token specifies the cur. project - } - else if ( sSwitch == "-R" ) { - nState = STATE_ROOT; // next token specifies path to project root - } - else if ( sSwitch == "-QQ" ) { - bQuiet = true; - } - else if ( sSwitch == "-M" ) { - nState = STATE_MERGESRC; // next token specifies the merge database - } - else if ( sSwitch == "-E" ) { - nState = STATE_ERRORLOG; - bErrorLog = FALSE; - } - else if ( sSwitch == "-UTF8" ) { - nState = STATE_UTF8; - bUTF8 = TRUE; - } -/* else if ( sSwitch == "-NOUTF8" ) { - nState = STATE_UTF8; - bUTF8 = FALSE; - }*/ -/* else if ( sSwitch == "-ULF" ) { - nState = STATE_ULF; - bULF = TRUE; - }*/ - else if ( sSwitch == "-L" ) { - nState = STATE_LANGUAGES; - } - else { - switch ( nState ) { - case STATE_NON: { - return FALSE; // no valid command line - } - //break; - case STATE_INPUT: { - sInputFile = argv[ i ]; - bInput = TRUE; // source file found - } - break; - case STATE_OUTPUT: { - sOutputFile = argv[ i ]; // the dest. file - } - break; - case STATE_PRJ: { - sPrj = argv[ i ]; -// sPrj.ToLowerAscii(); // the project - } - break; - case STATE_ROOT: { - sPrjRoot = argv[ i ]; // path to project root - } - break; - case STATE_MERGESRC: { - sMergeSrc = argv[ i ]; - bMergeMode = TRUE; // activate merge mode, cause merge database found - } - break; - case STATE_LANGUAGES: { - Export::sLanguages = argv[ i ]; - } - break; - } - } - } - - if ( bInput ) { - // command line is valid - bULF = TRUE; - bEnableExport = TRUE; - return TRUE; - } - - // command line is not valid - return FALSE; -} - - -/*****************************************************************************/ -void Help() -/*****************************************************************************/ -{ - //fprintf( stdout, "Syntax:ULFEX[-p Prj][-r PrjRoot]-i FileIn -o FileOut[-m DataBase][-e][-b][-u][-NOUTF8][-ULF][-L l1,l2,...]\n" ); - fprintf( stdout, "Syntax:ULFEX[-p Prj][-r PrjRoot]-i FileIn -o FileOut[-m DataBase][-L l1,l2,...]\n" ); - fprintf( stdout, " Prj: Project\n" ); - fprintf( stdout, " PrjRoot: Path to project root (..\\.. etc.)\n" ); - fprintf( stdout, " FileIn: Source file (*.lng)\n" ); - fprintf( stdout, " FileOut: Destination file (*.*)\n" ); - fprintf( stdout, " DataBase: Mergedata (*.sdf)\n" ); - fprintf( stdout, " -QQ: quite output\n" ); - //fprintf( stdout, " -NOUTF8: disable UTF8 as language independent encoding\n" ); - //fprintf( stdout, " -ULF: enables Unicode Language File format, leads to UTF8 encoded version of lng files" ); - fprintf( stdout, " -L: Restrict the handled languages. l1,l2,... are elements of (de,en-US...)\n" ); - fprintf( stdout, " A fallback language can be defined like this: l1=f1.\n" ); - fprintf( stdout, " f1, f2,... are also elements of (de,en-US...)\n" ); - fprintf( stdout, " Example: -L de,es=en-US\n" ); - fprintf( stdout, " Restriction to de and es, en-US will be fallback for es\n" ); -} - -/*****************************************************************************/ -#if defined(UNX) || defined(OS2) -int main( int argc, char *argv[] ) -#else -int _cdecl main( int argc, char *argv[] ) -#endif -/*****************************************************************************/ -{ - if ( !ParseCommandLine( argc, argv )) { - Help(); - return 1; - } - if( !bQuiet ){ - fprintf( stdout, "\nUlfEx 1 Copyright 2000 Sun Microsystems, Inc. All Rights Reserved.\n" ); - fprintf( stdout, "====================================================================\n" ); - fprintf( stdout, "\nProcessing File %s ...\n", sInputFile.GetBuffer()); - }else - { - fprintf(stdout, "."); - fflush( stdout ); - } - - if ( sOutputFile.Len()) { - LngParser aParser( sInputFile, bUTF8, bULF , bQuiet ); - if ( bMergeMode ) - aParser.Merge( sMergeSrc, sOutputFile , sPrj ); - else - aParser.CreateSDF( sOutputFile, sPrj, sPrjRoot ); - } - - if( !bQuiet ) fprintf( stdout, "\n=================================================\n\n" ); - - return 0; -} diff --git a/transex3/source/lngmerge.cxx b/transex3/source/lngmerge.cxx deleted file mode 100644 index e55fdc83ce37..000000000000 --- a/transex3/source/lngmerge.cxx +++ /dev/null @@ -1,360 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: lngmerge.cxx,v $ - * $Revision: 1.29 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_transex3.hxx" -#include - -// local includes -#include "lngmerge.hxx" -#include "utf8conv.hxx" -#include -using namespace std; -// -// class LngParser -// -/*****************************************************************************/ -LngParser::LngParser( const ByteString &rLngFile, BOOL bUTF8, BOOL bULFFormat , bool bQuiet_in ) -/*****************************************************************************/ - : - nError( LNG_OK ), - pLines( NULL ), - sSource( rLngFile ), - bDBIsUTF8( bUTF8 ), - bULF( bULFFormat ), - bQuiet( bQuiet_in ) -{ - pLines = new LngLineList( 100, 100 ); - DirEntry aEntry( String( sSource, RTL_TEXTENCODING_ASCII_US )); - if ( aEntry.Exists()) { - SvFileStream aStream( String( sSource, RTL_TEXTENCODING_ASCII_US ), STREAM_STD_READ ); - if ( aStream.IsOpen()) { - ByteString sLine; - bool bFirstLine = true; - while ( !aStream.IsEof()) { - aStream.ReadLine( sLine ); - - if( bFirstLine ){ // Always remove UTF8 BOM from the first line - Export::RemoveUTF8ByteOrderMarker( sLine ); - bFirstLine = false; - } - - pLines->Insert( new ByteString( sLine ), LIST_APPEND ); - } - } - else - nError = LNG_COULD_NOT_OPEN; - } - else - nError = LNG_FILE_NOTFOUND; -} - -/*****************************************************************************/ -LngParser::~LngParser() -/*****************************************************************************/ -{ - for ( ULONG i = 0; i < pLines->Count(); i++ ) - delete pLines->GetObject( i ); - delete pLines; -} - -/*****************************************************************************/ -void LngParser::FillInFallbacks( ByteStringHashMap Text ) -/*****************************************************************************/ -{ - ByteString sCur; - for( unsigned int n = 0; n < aLanguages.size(); n++ ){ - sCur = aLanguages[ n ]; - - if( Export::isAllowed( sCur ) ){ - ByteString sFallbackLang = Export::GetFallbackLanguage( sCur ); - if( sFallbackLang.Len() ){ - Text[ sCur ] = Text[ sFallbackLang ]; - } - } - } -} - -/*****************************************************************************/ -BOOL LngParser::CreateSDF( - const ByteString &rSDFFile, const ByteString &rPrj, - const ByteString &rRoot ) -/*****************************************************************************/ -{ - - Export::InitLanguages( false ); - aLanguages = Export::GetLanguages(); - SvFileStream aSDFStream( String( rSDFFile, RTL_TEXTENCODING_ASCII_US ), - STREAM_STD_WRITE | STREAM_TRUNC ); - if ( !aSDFStream.IsOpen()) { - nError = SDF_COULD_NOT_OPEN; - } - aSDFStream.SetStreamCharSet( RTL_TEXTENCODING_UTF8 ); - nError = SDF_OK; - DirEntry aEntry( String( sSource, RTL_TEXTENCODING_ASCII_US )); - aEntry.ToAbs(); - String sFullEntry = aEntry.GetFull(); - aEntry += DirEntry( String( "..", RTL_TEXTENCODING_ASCII_US )); - aEntry += DirEntry( rRoot ); - ByteString sPrjEntry( aEntry.GetFull(), gsl_getSystemTextEncoding()); - ByteString sActFileName( - sFullEntry.Copy( sPrjEntry.Len() + 1 ), gsl_getSystemTextEncoding()); - sActFileName.SearchAndReplaceAll( "/", "\\" ); - - ULONG nPos = 0; - BOOL bStart = true; - ByteString sGroup; - ByteStringHashMap Text; - ByteString sID; - ByteString sLine; - - while( nPos < pLines->Count() ){ - sLine = *pLines->GetObject( nPos++ ); - while( nPos < pLines->Count() && !isNextGroup( sGroup , sLine ) ){ - ReadLine( sLine , Text ); - sID = sGroup; - sLine = *pLines->GetObject( nPos++ ); - }; - if( bStart ){ - bStart = false; - sID = sGroup; - } - else { - - WriteSDF( aSDFStream , Text , rPrj , rRoot , sActFileName , sID ); - } - } - aSDFStream.Close(); - return true; -} - - void LngParser::WriteSDF( SvFileStream &aSDFStream , ByteStringHashMap &rText_inout , - const ByteString &rPrj , const ByteString &rRoot , - const ByteString &sActFileName , const ByteString &sID ) - { - - BOOL bExport = true; - if ( bExport ) { - ByteString sTimeStamp( Export::GetTimeStamp()); - ByteString sCur; - FillInFallbacks( rText_inout ); - for( unsigned int n = 0; n < aLanguages.size(); n++ ){ - sCur = aLanguages[ n ]; - ByteString sAct = rText_inout[ sCur ]; - if ( !sAct.Len() && sCur.Len() ) - sAct = rText_inout[ ByteString("en-US") ]; - - ByteString sOutput( rPrj ); sOutput += "\t"; - if ( rRoot.Len()) - sOutput += sActFileName; - sOutput += "\t0\t"; - sOutput += "LngText\t"; - sOutput += sID; sOutput += "\t\t\t\t0\t"; - sOutput += sCur; sOutput += "\t"; - sOutput += sAct; sOutput += "\t\t\t\t"; - sOutput += sTimeStamp; - //if( !sCur.EqualsIgnoreCaseAscii("de") ||( sCur.EqualsIgnoreCaseAscii("de") && !Export::isMergingGermanAllowed( rPrj ) ) ) - aSDFStream.WriteLine( sOutput ); - } - } - } - bool LngParser::isNextGroup( ByteString &sGroup_out , ByteString &sLine_in ){ - sLine_in.EraseLeadingChars( ' ' ); - sLine_in.EraseTrailingChars( ' ' ); - if (( sLine_in.GetChar( 0 ) == '[' ) && - ( sLine_in.GetChar( sLine_in.Len() - 1 ) == ']' )){ - sGroup_out = sLine_in.GetToken( 1, '[' ).GetToken( 0, ']' ); - sGroup_out.EraseLeadingChars( ' ' ); - sGroup_out.EraseTrailingChars( ' ' ); - return true; - } - return false; - } - void LngParser::ReadLine( const ByteString &sLine_in , ByteStringHashMap &rText_inout){ - //printf("sLine -> '%s'\n",sLine_in.GetBuffer()); - ByteString sLang = sLine_in.GetToken( 0, '=' ); - sLang.EraseLeadingChars( ' ' ); - sLang.EraseTrailingChars( ' ' ); - ByteString sText = sLine_in.GetToken( 1, '\"' ).GetToken( 0, '\"' ); - if( sLang.Len() ) - rText_inout[ sLang ] = sText; - } - -/*****************************************************************************/ -BOOL LngParser::Merge( - const ByteString &rSDFFile, const ByteString &rDestinationFile , const ByteString& rPrj ) -/*****************************************************************************/ -{ - (void) rPrj; - Export::InitLanguages( true ); - SvFileStream aDestination( - String( rDestinationFile, RTL_TEXTENCODING_ASCII_US ), - STREAM_STD_WRITE | STREAM_TRUNC ); - if ( !aDestination.IsOpen()) { - nError = LNG_COULD_NOT_OPEN; - } - nError = LNG_OK; -// MergeDataFile( const ByteString &rFileName, const ByteString& rFile , BOOL bErrLog, CharSet aCharSet, BOOL bUTF8 ); - - MergeDataFile aMergeDataFile( rSDFFile, sSource , FALSE, RTL_TEXTENCODING_MS_1252);//, bDBIsUTF8 ); - ByteString sTmp( Export::sLanguages ); - if( sTmp.ToUpperAscii().Equals("ALL") ) - Export::SetLanguages( aMergeDataFile.GetLanguages() ); - aLanguages = Export::GetLanguages(); - - ULONG nPos = 0; - BOOL bGroup = FALSE; - ByteString sGroup; - - // seek to next group - while ( nPos < pLines->Count() && !bGroup ) { - ByteString sLine( *pLines->GetObject( nPos )); - sLine.EraseLeadingChars( ' ' ); - sLine.EraseTrailingChars( ' ' ); - if (( sLine.GetChar( 0 ) == '[' ) && - ( sLine.GetChar( sLine.Len() - 1 ) == ']' )) - { - sGroup = sLine.GetToken( 1, '[' ).GetToken( 0, ']' ); - sGroup.EraseLeadingChars( ' ' ); - sGroup.EraseTrailingChars( ' ' ); - bGroup = TRUE; - } - nPos ++; - } - - while ( nPos < pLines->Count()) { - ByteStringHashMap Text; - ByteString sID( sGroup ); - ULONG nLastLangPos = 0; - - ResData *pResData = new ResData( "", sID , sSource ); - pResData->sResTyp = "LngText"; - PFormEntrys *pEntrys = aMergeDataFile.GetPFormEntrys( pResData ); - // read languages - bGroup = FALSE; - - ByteString sLanguagesDone; - - while ( nPos < pLines->Count() && !bGroup ) { - ByteString sLine( *pLines->GetObject( nPos )); - sLine.EraseLeadingChars( ' ' ); - sLine.EraseTrailingChars( ' ' ); - if (( sLine.GetChar( 0 ) == '[' ) && - ( sLine.GetChar( sLine.Len() - 1 ) == ']' )) - { - sGroup = sLine.GetToken( 1, '[' ).GetToken( 0, ']' ); - sGroup.EraseLeadingChars( ' ' ); - sGroup.EraseTrailingChars( ' ' ); - bGroup = TRUE; - nPos ++; - sLanguagesDone = ""; - } - else if ( sLine.GetTokenCount( '=' ) > 1 ) { - ByteString sLang = sLine.GetToken( 0, '=' ); - sLang.EraseLeadingChars( ' ' ); - sLang.EraseTrailingChars( ' ' ); - - ByteString sSearch( ";" ); - sSearch += sLang; - sSearch += ";"; - - if (( sLanguagesDone.Search( sSearch ) != STRING_NOTFOUND )) { - pLines->Remove( nPos ); - } - if( bULF && pEntrys ) - { - // this is a valid text line - ByteString sText = sLine.GetToken( 1, '\"' ).GetToken( 0, '\"' ); - if( sLang.Len() ){ - ByteString sNewText; - pEntrys->GetText( sNewText, STRING_TYP_TEXT, sLang, TRUE ); - - if ( sNewText.Len()) { - ByteString *pLine = pLines->GetObject( nPos ); - - ByteString sText1( sLang ); - sText1 += " = \""; - sText1 += sNewText; - sText1 += "\""; - *pLine = sText1; - //} - Text[ sLang ] = sNewText; - } - } - nLastLangPos = nPos; - nPos ++; - sLanguagesDone += sSearch; - } - else { - nLastLangPos = nPos; - nPos ++; - sLanguagesDone += sSearch; - } - } - else - nPos++; - } - ByteString sCur; - if ( nLastLangPos ) { - for( unsigned int n = 0; n < aLanguages.size(); n++ ){ - sCur = aLanguages[ n ]; - if( //( !sCur.EqualsIgnoreCaseAscii("de") || - //( sCur.EqualsIgnoreCaseAscii("de") && Export::isMergingGermanAllowed( rPrj ) ) ) - !sCur.EqualsIgnoreCaseAscii("en-US") && !Text[ sCur ].Len() && pEntrys ){ - - ByteString sNewText; - pEntrys->GetText( sNewText, STRING_TYP_TEXT, sCur, TRUE ); - if (( sNewText.Len()) && - !(( sCur.Equals("x-comment") ) && ( sNewText == "-" ))) - { - ByteString sLine; - sLine += sCur; - sLine += " = \""; - sLine += sNewText; - sLine += "\""; - - nLastLangPos++; - nPos++; - - pLines->Insert( new ByteString( sLine ), nLastLangPos ); - } - } - } - } - - delete pResData; - } - - for ( ULONG i = 0; i < pLines->Count(); i++ ) - aDestination.WriteLine( *pLines->GetObject( i )); - - aDestination.Close(); - return TRUE; -} diff --git a/transex3/source/localize.cxx b/transex3/source/localize.cxx deleted file mode 100644 index e23165ee657c..000000000000 --- a/transex3/source/localize.cxx +++ /dev/null @@ -1,986 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: localize.cxx,v $ - * $Revision: 1.50 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_transex3.hxx" - -#include "srciter.hxx" -#include "export.hxx" -#include "treeconfig.hxx" -#include -#include -#include -#include -#include "tools/errcode.hxx" -#include "tools/fsys.hxx" - -#ifndef TRANSEX_FILE_HXX -#define TRANSEX_FILE_HXX -#include -#endif - -namespace transex3 -{ - -// -// SourceTreeLocalizer -// - -const char *ExeTable[][5] = { - { "src", "transex3", " -UTF8 -e", "negative", "noiso" }, - { "hrc", "transex3", " -UTF8 -e", "positive", "noiso" }, - //{ "src", "transex3", "-UTF8 -e", "negative", "noiso" }, - //{ "hrc", "transex3", "-UTF8 -e", "positive", "noiso" }, - - //{ "lng", "lngex", "-UTF8 -e", "negative", "noiso" }, - { "ulf", "ulfex", " -e", "negative", "noiso" }, - { "xrb", "xmlex", "-UTF8 -e", "negative", "iso" }, - { "xxl", "xmlex", "-UTF8 -e", "negative", "iso" }, - { "xgf", "xmlex", "-UTF8 -e -t:xgf", "negative", "iso" }, - { "xcd", "cfgex", "-UTF8 -e", "negative", "iso" }, - { "xcu", "cfgex", "-UTF8 -e", "negative", "iso" }, - { "xcs", "cfgex", "-UTF8 -e -f", "negative", "iso" }, - { "xrm", "xrmex", "-UTF8 -e", "negative", "iso" }, - { "xhp", "helpex", " -e", "negative", "noiso" }, - { "NULL", "NULL", "NULL", "NULL", "NULL" } -}; - -const char *NegativeList[] = { - "officecfg/data/org.openoffice.Office.Labels.xcd", - "officecfg/data/org/openoffice/Office/Labels.xcd", - "officecfg/data/org/openoffice/Office/SFX.xcd", - "officecfg/data/org/openoffice/Office/Accelerators.xcu", - "hidother.src", - "NULL" -}; - -const char *PositiveList[] = { - "svx/inc/globlmn_tmpl.hrc", - "sw/source/ui/inc/swmn_tmpl.hrc", - "sw/source/ui/inc/swacc_tmpl.hrc", - "sw/source/ui/inc/toolbox_tmpl.hrc", - "offmgr/inc/offmenu_tmpl.hrc", - "offmgr/source/offapp/intro/intro_tmpl.hrc", - "dbaccess/source/ui/inc/toolbox_tmpl.hrc", - "svx/source/intro/intro_tmpl.hrc", - "dbaccess/source/ui/dlg/AutoControls_tmpl.hrc", - "svx/source/unodialogs/textconversiondlgs/chinese_direction_tmpl.hrc", - "chart2/source/controller/dialogs/res_DataLabel_tmpl.hrc", - "chart2/source/controller/dialogs/res_LegendPosition_tmpl.hrc", - "chart2/source/controller/dialogs/res_Statistic_tmpl.hrc", - "chart2/source/controller/dialogs/res_Titlesx_tmpl.hrc", - "chart2/source/controller/dialogs/res_SecondaryAxisCheckBoxes_tmpl.hrc", - "chart2/source/controller/menu/MenuItems_tmpl.hrc", - "chart2/source/controller/dialogs/res_ErrorBar_tmpl.hrc", - "chart2/source/controller/dialogs/res_Trendline_tmpl.hrc", - "svx.link/inc/globlmn_tmpl.hrc", - "sw.link/source/ui/inc/swmn_tmpl.hrc", - "sw.link/source/ui/inc/swacc_tmpl.hrc", - "sw.link/source/ui/inc/toolbox_tmpl.hrc", - "offmgr.link/inc/offmenu_tmpl.hrc", - "offmgr.link/source/offapp/intro/intro_tmpl.hrc", - "dbaccess.link/source/ui/inc/toolbox_tmpl.hrc", - "svx.link/source/intro/intro_tmpl.hrc", - "dbaccess.link/source/ui/dlg/AutoControls_tmpl.hrc", - "svx.link/source/unodialogs/textconversiondlgs/chinese_direction_tmpl.hrc", - "chart2.link/source/controller/dialogs/res_DataLabel_tmpl.hrc", - "chart2.link/source/controller/dialogs/res_LegendPosition_tmpl.hrc", - "chart2.link/source/controller/dialogs/res_Statistic_tmpl.hrc", - "chart2.link/source/controller/dialogs/res_Titlesx_tmpl.hrc", - "chart2.link/source/controller/dialogs/res_SecondaryAxisCheckBoxes_tmpl.hrc", - "chart2.link/source/controller/menu/MenuItems_tmpl.hrc", - "chart2.link/source/controller/dialogs/res_ErrorBar_tmpl.hrc", - "chart2.link/source/controller/dialogs/res_Trendline_tmpl.hrc", - "NULL" -}; - - -const char PRJ_DIR_NAME[] = "prj"; -const char DLIST_NAME[] = "d.lst"; - -#define LOCALIZE_NONE 0x0000 -#define LOCALIZE_EXTRACT 0x0001 -#define LOCALIZE_MERGE 0x0002 - -class SourceTreeLocalizer : public SourceTreeIterator -{ -private: - SvFileStream aSDF; - USHORT nMode; - - ByteString sLanguageRestriction; - - ByteString sOutputFile; - bool bQuiet2; - - int nFileCnt; - - const ByteString GetProjectName( BOOL bAbs = FALSE ); - const ByteString GetProjectRootRel(); - - - BOOL CheckNegativeList( const ByteString &rFileName ); - BOOL CheckPositiveList( const ByteString &rFileName ); - - void WorkOnFile( - const ByteString &rFileName, - const ByteString &rExecutable, - const ByteString &rParameter - ); - - void WorkOnFileType( - const ByteString &rDirectory, - const ByteString &rExtension, - const ByteString &rExecutable, - const ByteString &rParameter, - const ByteString &rCollectMode - ); - void WorkOnDirectory( const ByteString &rDirectory ); - BOOL ExecuteMerge(); - BOOL MergeSingleFile( - const ByteString &rPrj, - const ByteString &rFile, - const ByteString &rSDFFile - ); - -public: - SourceTreeLocalizer( const ByteString &rRoot, const ByteString &rVersion , bool bLocal , bool bQuiet2_in , bool skip_links ); - ~SourceTreeLocalizer(); - - ByteString getSourceLanguages( ByteString sLanguageRestriction , ByteString sCommand ); - - void SetLanguageRestriction( const ByteString& rRestrictions ) - { sLanguageRestriction = rRestrictions; } - int getFileCnt(); - BOOL Extract( const ByteString &rDestinationFile ); - BOOL Merge( const ByteString &rSourceFile , const ByteString &rOutput ); - int GetFileCnt(); - virtual void OnExecuteDirectory( const rtl::OUString &rDirectory ); -}; - -/*****************************************************************************/ -SourceTreeLocalizer::SourceTreeLocalizer( - const ByteString &rRoot, const ByteString &rVersion, bool bLocal_in , bool bQuiet2_in , bool skip_links ) -/*****************************************************************************/ - : SourceTreeIterator( rRoot, rVersion , bLocal_in ), - nMode( LOCALIZE_NONE ), - bQuiet2( bQuiet2_in ), - nFileCnt( 0 ) -{ - bSkipLinks = skip_links ; -} - -/*****************************************************************************/ -SourceTreeLocalizer::~SourceTreeLocalizer() -/*****************************************************************************/ -{ -} - -/*****************************************************************************/ -const ByteString SourceTreeLocalizer::GetProjectName( BOOL bAbs ) -/*****************************************************************************/ -{ - BOOL bFound = FALSE; - DirEntry aCur; - aCur.ToAbs(); - - for ( ; ! bFound && aCur.Level() > 1; aCur.CutName() ) - { - DirEntry aTest = aCur + DirEntry(PRJ_DIR_NAME) + DirEntry(DLIST_NAME); - if ( aTest.Exists() ) - { - if ( bAbs ) - return ByteString( aCur.GetFull(), RTL_TEXTENCODING_ASCII_US ); - else - return ByteString( aCur.GetName(), RTL_TEXTENCODING_ASCII_US ); - } - } - - return ""; -} -/*****************************************************************************/ -int SourceTreeLocalizer::GetFileCnt(){ -/*****************************************************************************/ - return nFileCnt; -} - -/*****************************************************************************/ -const ByteString SourceTreeLocalizer::GetProjectRootRel() -/*****************************************************************************/ -{ - ByteString sProjectRoot( GetProjectName( TRUE )); - DirEntry aCur; - aCur.ToAbs(); - ByteString sCur( aCur.GetFull(), RTL_TEXTENCODING_ASCII_US ); - - if( sCur.SearchAndReplace( sProjectRoot, "" ) == STRING_NOTFOUND ) - return ""; - - ByteString sDelimiter( - DirEntry::GetAccessDelimiter(), RTL_TEXTENCODING_ASCII_US ); - - sCur.SearchAndReplaceAll( sDelimiter, "/" ); - sCur.EraseLeadingChars( '/' ); - ULONG nCount = sCur.GetTokenCount( '/' ); - - ByteString sProjectRootRel; - for ( ULONG i = 0; i < nCount; i++ ) { - if ( sProjectRootRel.Len()) - sProjectRootRel += sDelimiter; - sProjectRootRel += ".."; - } - if ( sProjectRootRel.Len()) - return sProjectRootRel; - - return "."; -} - -bool skipProject( ByteString sPrj ) -{ - static const ByteString READLICENSE( "readlicense" ); - return sPrj.EqualsIgnoreCaseAscii( READLICENSE ); -} - -/*****************************************************************************/ -void SourceTreeLocalizer::WorkOnFile( - const ByteString &rFileName, const ByteString &rExecutable, - const ByteString &rParameter ) -/*****************************************************************************/ -{ - String sFull( rFileName, RTL_TEXTENCODING_ASCII_US ); - DirEntry aEntry( sFull ); - ByteString sFileName( aEntry.GetName(), RTL_TEXTENCODING_ASCII_US ); - - // set current working directory - DirEntry aPath( aEntry.GetPath()); - DirEntry aOldCWD; - aPath.SetCWD(); - - ByteString sPrj( GetProjectName()); - if ( sPrj.Len() && !skipProject( sPrj ) ) - { - ByteString sRoot( GetProjectRootRel()); - - DirEntry aTemp( Export::GetTempFile()); - ByteString sTempFile( aTemp.GetFull(), RTL_TEXTENCODING_ASCII_US ); - - ByteString sDel; -#if defined(WNT) || defined(OS2) - sDel=ByteString("\\"); -#else - sDel=ByteString("/"); -#endif - ByteString sPath1( Export::GetEnv("SOLARVER") ); - ByteString sPath2( Export::GetEnv("INPATH") ); - ByteString sPath3( "bin" ); - ByteString sPath4( Export::GetEnv("UPDMINOREXT") ); - ByteString sExecutable( sPath1 ); - sExecutable += sDel ; - sExecutable += sPath2 ; - sExecutable += sDel; - sExecutable += sPath3 ; - sExecutable += sPath4 ; - sExecutable += sDel ; - sExecutable += rExecutable ; - - - ByteString sCommand( sExecutable ); - sCommand += " "; - sCommand += rParameter; - sCommand += " -p "; - sCommand += sPrj; - sCommand += " -r "; - sCommand += sRoot; - sCommand += " -i "; - sCommand += sFileName; - sCommand += " -o "; - sCommand += sTempFile; - if ( sLanguageRestriction.Len()) { - sCommand += " -l "; - sCommand += getSourceLanguages( sLanguageRestriction , sCommand ); - } - - if( bQuiet2 ){ - sCommand +=" -QQ "; - } - //printf("DBG: %s\n",sCommand.GetBuffer()); - if (system(sCommand.GetBuffer()) == -1) - fprintf(stderr, "%s failed\n", sCommand.GetBuffer()); - nFileCnt++; - printf("."); - fflush( stdout ); - - SvFileStream aSDFIn( aTemp.GetFull(), STREAM_READ ); - ByteString sLine; - while ( aSDFIn.IsOpen() && !aSDFIn.IsEof()) { - aSDFIn.ReadLine( sLine ); - if ( sLine.Len()) { - aSDF.WriteLine( sLine ); - } - } - aSDFIn.Close(); - - aTemp.Kill(); - - } - // reset current working directory - aOldCWD.SetCWD(); -} - -ByteString SourceTreeLocalizer::getSourceLanguages( ByteString sLanguageRestriction_inout , ByteString sCommand ) -{ - // Source languages in helpcontent2 and macromigration en-US only! - if( sCommand.Search("helpex") != STRING_NOTFOUND ) { - sLanguageRestriction_inout.Assign( ByteString("en-US") ); - } - else if( sCommand.Search("xmlex") != STRING_NOTFOUND ){ - sLanguageRestriction_inout.Assign( ByteString("en-US") ); - } - return sLanguageRestriction_inout; -} - -/*****************************************************************************/ -BOOL SourceTreeLocalizer::CheckNegativeList( const ByteString &rFileName ) -/*****************************************************************************/ -{ - ULONG nIndex = 0; - BOOL bReturn = TRUE; - - ByteString sDelimiter( - DirEntry::GetAccessDelimiter(), RTL_TEXTENCODING_ASCII_US ); - - ByteString sFileName( rFileName ); - sFileName.ToLowerAscii(); - - ByteString sNegative( NegativeList[ nIndex ] ); - while( !sNegative.Equals( "NULL" ) && bReturn ) { - sNegative.SearchAndReplaceAll( "\\", sDelimiter ); - sNegative.SearchAndReplaceAll( "/", sDelimiter ); - sNegative.ToLowerAscii(); - - if( sFileName.Search( sNegative ) == sFileName.Len() - sNegative.Len()) - bReturn = FALSE; - - nIndex++; - sNegative = NegativeList[ nIndex ]; - } - - return bReturn; -} - -/*****************************************************************************/ -BOOL SourceTreeLocalizer::CheckPositiveList( const ByteString &rFileName ) -/*****************************************************************************/ -{ - ULONG nIndex = 0; - BOOL bReturn = FALSE; - - ByteString sDelimiter( - DirEntry::GetAccessDelimiter(), RTL_TEXTENCODING_ASCII_US ); - - ByteString sFileName( rFileName ); - sFileName.ToLowerAscii(); - - ByteString sNegative( PositiveList[ nIndex ] ); - while( !sNegative.Equals( "NULL" ) && !bReturn ) { - sNegative.SearchAndReplaceAll( "\\", sDelimiter ); - sNegative.SearchAndReplaceAll( "/", sDelimiter ); - sNegative.ToLowerAscii(); - - if( sFileName.Search( sNegative ) == sFileName.Len() - sNegative.Len()) - bReturn = TRUE; - - nIndex++; - sNegative = PositiveList[ nIndex ]; - } - - return bReturn; -} - -/*****************************************************************************/ -void SourceTreeLocalizer::WorkOnFileType( - const ByteString &rDirectory, const ByteString &rExtension, - const ByteString &rExecutable, const ByteString &rParameter, - const ByteString &rCollectMode -) -/*****************************************************************************/ -{ - String sWild( rDirectory, RTL_TEXTENCODING_ASCII_US ); - sWild += DirEntry::GetAccessDelimiter(); - sWild += String::CreateFromAscii( "*." ); - sWild += String( rExtension, RTL_TEXTENCODING_ASCII_US ); - - DirEntry aEntry( sWild ); - Dir aDir( sWild, FSYS_KIND_FILE ); - - for ( USHORT i = 0; i < aDir.Count(); i++ ) { - DirEntry aFile( aDir[ i ] ); - ByteString sFile( aFile.GetFull(), RTL_TEXTENCODING_ASCII_US ); - - BOOL bAllowed = TRUE; - - if ( rCollectMode.Equals( "negative" )) - bAllowed = CheckNegativeList( sFile ); - else if ( rCollectMode.Equals( "positive" )) - bAllowed = CheckPositiveList( sFile ); - - if ( bAllowed ) - WorkOnFile( sFile, rExecutable, rParameter ); - } -} - -/*****************************************************************************/ -void SourceTreeLocalizer::WorkOnDirectory( const ByteString &rDirectory ) -/*****************************************************************************/ -{ - //printf("Working on Directory %s\n",rDirectory.GetBuffer()); - ULONG nIndex = 0; - ByteString sExtension( ExeTable[ nIndex ][ 0 ] ); - ByteString sExecutable( ExeTable[ nIndex ][ 1 ] ); - ByteString sParameter( ExeTable[ nIndex ][ 2 ] ); - ByteString sCollectMode( ExeTable[ nIndex ][ 3 ] ); - - while( !sExtension.Equals( "NULL" )) { - WorkOnFileType( - rDirectory, - sExtension, - sExecutable, - sParameter, - sCollectMode - ); - - nIndex++; - - sExtension = ExeTable[ nIndex ][ 0 ]; - sExecutable = ExeTable[ nIndex ][ 1 ]; - sParameter = ExeTable[ nIndex ][ 2 ]; - sCollectMode = ExeTable[ nIndex ][ 3 ]; - } -} - -void SourceTreeLocalizer::OnExecuteDirectory( const rtl::OUString &aDirectory ) -{ - ByteString rDirectory( rtl::OUStringToOString( aDirectory , RTL_TEXTENCODING_UTF8 , aDirectory.getLength() ) ) ; - if ( nMode == LOCALIZE_NONE ){ - if( !bQuiet2 ) fprintf( stdout, "%s\n", rDirectory.GetBuffer()); - } - else - WorkOnDirectory( rDirectory ); -} - -/*****************************************************************************/ -BOOL SourceTreeLocalizer::Extract( const ByteString &rDestinationFile ) -/*****************************************************************************/ -{ - nMode = LOCALIZE_EXTRACT; - - aSDF.Open( String( rDestinationFile , RTL_TEXTENCODING_ASCII_US ) , STREAM_STD_WRITE ); - aSDF.SetLineDelimiter( LINEEND_CRLF ); - - BOOL bReturn = aSDF.IsOpen(); - if ( bReturn ) { - aSDF.Seek( STREAM_SEEK_TO_END ); - bReturn = StartExecute(); - aSDF.Close(); - } - else{ - printf("ERROR: Can't create file %s\n", rDestinationFile.GetBuffer() ); - } - nMode = LOCALIZE_NONE; - aSDF.Close(); - return bReturn; -} - -/*****************************************************************************/ -BOOL SourceTreeLocalizer::MergeSingleFile( - const ByteString &rPrj, - const ByteString &rFile, - const ByteString &rSDFFile -) -/*****************************************************************************/ -{ - //printf("MergeSingleFile(%s,%s,%s)",rPrj.GetBuffer(),rFile.GetBuffer(),rSDFFile.GetBuffer()); - if ( !rFile.Len()) - return TRUE; - - ByteString sRoot( Export::GetEnv( "SRC_ROOT" )); - DirEntry aEntry( String( sRoot, RTL_TEXTENCODING_ASCII_US )); - aEntry += DirEntry( String( rPrj, RTL_TEXTENCODING_ASCII_US )); - - ByteString sDelimiter( - DirEntry::GetAccessDelimiter(), RTL_TEXTENCODING_ASCII_US ); - - ByteString sCur( rFile ); - sCur.SearchAndReplaceAll( "\\", sDelimiter ); - sCur.SearchAndReplaceAll( "/", sDelimiter ); - - aEntry += DirEntry( String( sCur, RTL_TEXTENCODING_ASCII_US )); - ByteString sFile( aEntry.GetFull(), RTL_TEXTENCODING_ASCII_US ); - - ByteString sBCur( aEntry.GetFull(), RTL_TEXTENCODING_ASCII_US ); - if( !bQuiet2 ) fprintf( stdout, "##### %s #####\n", sBCur.GetBuffer()); - - ULONG nIndex = 0; - ByteString sExtension( aEntry.GetExtension(), RTL_TEXTENCODING_ASCII_US ); - ByteString sCandidate( ExeTable[ nIndex ][ 0 ] ); - - while( !sCandidate.Equals ("NULL") && !sCandidate.Equals(sExtension) ) - sCandidate = ExeTable[ ++nIndex ][ 0 ]; - - if ( !sCandidate.Equals( "NULL" ) ) { - if( !aEntry.Exists()) { - DirEntryKind theDir=FSYS_KIND_FILE; - Dir myDir( aEntry.GetPath(), theDir); - DirEntry current; - BOOL found=FALSE; - for( USHORT x=0; x < myDir.Count() && !found;){ - current=myDir[x++]; - StringCompare result=current.GetName().CompareIgnoreCaseToAscii( aEntry.GetName() ); - if( result==COMPARE_EQUAL ){ - fprintf(stderr,"WARNING: %s not found\n", ByteString(aEntry.GetFull(),RTL_TEXTENCODING_ASCII_US).GetBuffer() ); - fprintf(stderr,"but use %s instead \n" , ByteString(current.GetFull(), RTL_TEXTENCODING_ASCII_US).GetBuffer() ); - aEntry=current; - found=TRUE; - } - } - if(!found) return TRUE; - - } - - DirEntry aOut( Export::GetTempFile() ); - ByteString sOutput; - if( sOutputFile.Len() == 0 ) - sOutput = ByteString ( aOut.GetFull(), RTL_TEXTENCODING_ASCII_US ); - else - sOutput = sOutputFile; - ByteString sCommand( ExeTable[ nIndex ][ 1 ] ); - sCommand += " -i "; - sCommand += ByteString( aEntry.GetName(), RTL_TEXTENCODING_ASCII_US ); - sCommand += " -m "; - sCommand += rSDFFile; - sCommand += " -o "; - sCommand += sOutput; - sCommand += " "; - sCommand += ByteString( ExeTable[ nIndex ][ 2 ] ); - if ( sLanguageRestriction.Len()) { - sCommand += " -l "; - sCommand += sLanguageRestriction; - } - if( bQuiet2 ){ - sCommand +=" -QQ "; - } - - DirEntry aPath( aEntry.GetPath()); - DirEntry aOldCWD; - aPath.SetCWD(); - - if (system(sCommand.GetBuffer()) == -1) - fprintf(stderr, "%s failed\n", sCommand.GetBuffer()); - nFileCnt++; - printf("."); - //if( bQuiet2 ){ printf("."); } - SvFileStream aInStream( aOut.GetFull(), STREAM_READ ); - if ( !aInStream.IsOpen()) { - fprintf( stderr, - "ERROR: Unable to open file %s for reading!\n", - sOutput.GetBuffer()); - } - else { - FileStat::SetReadOnlyFlag( aEntry, FALSE ); - String myStr2(aEntry.GetFull()); - String aTemp22 = String::CreateFromAscii("_tmp"); - myStr2.Append(aTemp22); - - ByteString test(myStr2,RTL_TEXTENCODING_ASCII_US); - SvFileStream aOutStream( myStr2, STREAM_STD_WRITE | STREAM_TRUNC ); - if ( !aOutStream.IsOpen()) { - ByteString test2(myStr2,RTL_TEXTENCODING_ASCII_US); - fprintf( stderr,"ERROR: Unable to open file %s for modification!\n", test2.GetBuffer()); - aInStream.Close(); - } - - else { - ByteString sLine; - aOutStream.SetLineDelimiter( LINEEND_LF ); - - aInStream.ReadLine( sLine ); - while ( !aInStream.IsEof()) { - aOutStream.WriteLine( sLine ); - aInStream.ReadLine( sLine ); - } - aInStream.Close(); - aOutStream.Close(); - - - DirEntry myTempFile(ByteString(myStr2,RTL_TEXTENCODING_ASCII_US)); // xxx_tmp -> - DirEntry myFile(ByteString(aEntry.GetFull(),RTL_TEXTENCODING_ASCII_US));// xxx - - DirEntry oldFile(ByteString(aEntry.GetFull(),RTL_TEXTENCODING_ASCII_US)); - - if(oldFile.Kill()==ERRCODE_NONE){ - if(myTempFile.MoveTo(myFile)!=ERRCODE_NONE){ - fprintf( stderr, "ERROR: Can't rename file %s\n",ByteString(myStr2,RTL_TEXTENCODING_ASCII_US).GetBuffer()); - } - } - else{ - fprintf( stderr, "ERROR: Can't remove file %s\n",ByteString(aEntry.GetFull(),RTL_TEXTENCODING_ASCII_US).GetBuffer()); - } - } // else - - aOldCWD.SetCWD(); - aOut.Kill(); - } // else - } - return TRUE; -} -/*****************************************************************************/ -BOOL SourceTreeLocalizer::ExecuteMerge( ) -/*****************************************************************************/ -{ - DirEntry aEntry( Export::GetTempFile()); - BOOL bReturn = TRUE; - bool bMerged = false; - - ByteString sFileName; - ByteString sCurFile; - ByteString sLine; - ByteString sFileKey; - - SvFileStream aFile; - - ByteString sOutputFileName = sOutputFile; - ByteString sInpath("."); - sInpath += Export::GetEnv("INPATH"); - ByteString sBlank(""); - - sOutputFileName.SearchAndReplaceAll( sInpath , sBlank ); - - String sDel = DirEntry::GetAccessDelimiter(); - ByteString sBDel( sDel.GetBuffer() , sDel.Len() , RTL_TEXTENCODING_UTF8 ); - if( bLocal ){ - xub_StrLen nPos = sOutputFileName.SearchBackward( sBDel.GetChar(0) ); - sOutputFileName = sOutputFileName.Copy( nPos+1 , sOutputFileName.Len()-nPos-1 ); - } - ByteStringBoolHashMap aFileHM; - // Read all possible files - while ( !aSDF.IsEof()) { - aSDF.ReadLine( sLine ); - sFileName = sLine.GetToken( 0, '\t' ); - sFileName += "#"; - sFileName += sLine.GetToken( 1, '\t' ); - aFileHM[sFileName]=true; - } - - for( ByteStringBoolHashMap::iterator iter = aFileHM.begin(); iter != aFileHM.end(); ++iter ){ - sFileKey = iter->first; - aSDF.Seek( 0 ); - aFile.Open( aEntry.GetFull(), STREAM_STD_WRITE |STREAM_TRUNC ); - - while ( !aSDF.IsEof()) { - aSDF.ReadLine( sLine ); - sFileName = sLine.GetToken( 0, '\t' ); - sFileName += "#"; - sFileName += sLine.GetToken( 1, '\t' ); - if( sFileName.Len() && ( sFileName.CompareTo(sFileKey) == COMPARE_EQUAL ) ){ - if ( aFile.IsOpen() && sLine.Len()) - aFile.WriteLine( sLine ); - } - } - if ( aFile.IsOpen()) - aFile.Close(); - - ByteString sPrj( sFileKey.GetToken( 0, '#' )); - ByteString sFile( sFileKey.GetToken( 1, '#' )); - ByteString sSDFFile( aFile.GetFileName(), RTL_TEXTENCODING_ASCII_US ); - - //printf("localize test sPrj = %s , sFile = %s , sSDFFile = %s sOutputFileName = %s\n",sPrj.GetBuffer(), sFile.GetBuffer() , sSDFFile.GetBuffer() , sOutputFileName.GetBuffer() ); - - // Test - bLocal = true; - // Test - - if( bLocal ){ - USHORT nPos = sFile.SearchBackward( '\\' ); - ByteString sTmp = sFile.Copy( nPos+1 , sFile.Len()-nPos-1 ); - //printf("'%s'='%s'\n",sTmp.GetBuffer(), sOutputFileName.GetBuffer()); - if( sTmp.CompareTo(sOutputFileName) == COMPARE_EQUAL ){ - bMerged = true; - if ( !MergeSingleFile( sPrj, sFile, sSDFFile )) - bReturn = FALSE; - }else{ - bMerged = true; - //printf("MergeSingleFile('%s','%s','%s')\n",sPrj.GetBuffer(),sFile.GetBuffer(),sSDFFile.GetBuffer()); - if ( !MergeSingleFile( sPrj, sFile, sSDFFile )) - bReturn = FALSE; - } - } - } - aEntry.Kill(); - // If Outputfile not included in the SDF file copy it without merge - - if( bLocal && !bMerged ){ - DirEntry aSourceFile( sOutputFileName.GetBuffer() ); - FSysError aErr = aSourceFile.CopyTo( DirEntry ( sOutputFile.GetBuffer() ) , FSYS_ACTION_COPYFILE ); - if( aErr != FSYS_ERR_OK ){ - printf("ERROR: Can't copy file '%s' to '%s' %d\n",sOutputFileName.GetBuffer(),sOutputFile.GetBuffer(),sal::static_int_cast(aErr)); - } - } - return bReturn; - -} - -/*****************************************************************************/ -BOOL SourceTreeLocalizer::Merge( const ByteString &rSourceFile , const ByteString &rOutput ) -/*****************************************************************************/ -{ - sOutputFile = rOutput; - nMode = LOCALIZE_MERGE; - aSDF.Open( String( rSourceFile, RTL_TEXTENCODING_ASCII_US ), - STREAM_STD_READ ); - - BOOL bReturn = aSDF.IsOpen(); - if ( bReturn ) { - bReturn = ExecuteMerge(); -// aSDF.Close(); - } - aSDF.Close(); - nMode = LOCALIZE_NONE; - return bReturn; -} - -} -using namespace transex3; - -#define STATE_NONE 0x0000 -#define STATE_EXPORT 0x0001 -#define STATE_MERGE 0x0002 -#define STATE_ISOCODE 0x0003 -#define STATE_LANGUAGES 0x0004 -#define STATE_FILENAME 0x0005 -#define STATE_OUTPUT 0x0006 - -/*****************************************************************************/ -void Help() -/*****************************************************************************/ -{ - fprintf( stdout, - "localize (c)2001 by Sun Microsystems\n" - "====================================\n" ); - fprintf( stdout, - "As part of the L10N framework, localize extracts and merges translations\n" - "out of and into the whole source tree.\n\n" - "Syntax: localize -e -l en-US -f FileName [-QQ]\n" - "Parameter:\n" - "\t-e: Extract mode\n" - "\tFileName: Output file when extract mode, input file when merge mode\n" - "\tl1...ln: supported languages (\"all\" for all languages).\n" - "\tQQ: quiet output)" - ); - - fprintf( stdout, - "Valid language codes for l1...ln and f1...fn are:\n" ); - fprintf( stdout, - "\nExample 1:\n" - "==========\n" - "localize -e -l en-US -f MyFile\n\n" - "All strings will be extracted for language de and language en-US.\n" - ); -} - -/*****************************************************************************/ -int Error() -/*****************************************************************************/ -{ - Help(); - return 1; -} - -/*****************************************************************************/ -BOOL CheckLanguages( ByteString &rLanguages ) -/*****************************************************************************/ -{ - ByteString sTmp( rLanguages ); - return true; -} - -/*****************************************************************************/ -#if defined(UNX) || defined(OS2) -int main( int argc, char *argv[] ) -#else -int _cdecl main( int argc, char *argv[] ) -#endif -/*****************************************************************************/ -{ - String sTempBase( String::CreateFromAscii( "loc" )); - DirEntry::SetTempNameBase( sTempBase ); - USHORT nState = STATE_NONE; - - BOOL bExport = FALSE; - BOOL bMerge = FALSE; - bool bQuiet = false; - bool bQuiet2 = false; - bool bSkipLinks = false; - - ByteString sLanguages; - ByteString sFileName; - ByteString sOutput; - - bQuiet2 = true; - bExport = TRUE; - - for( int i = 1; i < argc; i++ ) { - ByteString sSwitch( argv[ i ] ); - sSwitch.ToUpperAscii(); - - if ( sSwitch.Equals( "-E" )) { - nState = STATE_EXPORT; - if ( bMerge ) - return Error(); - bExport = TRUE; - } - else if( sSwitch.Equals( "-Q" )) { - bQuiet = true; - } - else if ( sSwitch.Equals( "-I" ) ) - nState = STATE_ISOCODE; - else if ( sSwitch.Equals( "-L" ) ) - nState = STATE_LANGUAGES; - else if ( sSwitch.Equals( "-F" ) ) - nState = STATE_FILENAME; - else if ( sSwitch.Equals( "-QQ" )) - bQuiet2 = true; - else if ( ByteString( argv[ i ]).ToUpperAscii().Equals( "-O" ) ) - nState = STATE_OUTPUT; - else { - switch ( nState ) { - case STATE_NONE: - return Error(); - case STATE_OUTPUT: - if ( sOutput.Len()) - return Error(); - sOutput = ByteString( argv[ i ] ); - nState = STATE_NONE; - break; - case STATE_LANGUAGES: - if ( sLanguages.Len()) - return Error(); - sLanguages = ByteString( argv[ i ] ); - nState = STATE_NONE; - break; - case STATE_FILENAME: - if ( sFileName.Len()) - return Error(); - sFileName = ByteString( argv[ i ] ); - nState = STATE_NONE; - break; - default: - return Error(); - } - } - } - if ( !bMerge && !bExport ) { - Help(); - return 1; - } - - ByteString sSolarVer( Export::GetEnv( "WORK_STAMP" )); - ByteString sVersion( Export::GetEnv( "WORK_STAMP" )); - - if ( !sSolarVer.Len() || !sVersion.Len()) { - fprintf( stderr, "ERROR: No environment set!\n" ); - return 1; - } - - if ( !CheckLanguages( sLanguages )) - return 2; - - if ( !sFileName.Len()) { - fprintf( stderr, "ERROR: No filename given\n" ); - return 3; - } - - DirEntry aEntry( String( sFileName , RTL_TEXTENCODING_ASCII_US )); - aEntry.ToAbs(); - String sFullEntry = aEntry.GetFull(); - ByteString sFileABS( aEntry.GetFull(), gsl_getSystemTextEncoding()); - //printf("B %s\nA %s\n",rDestinationFile.GetBuffer(), sFile.GetBuffer()); - sFileName = sFileABS; - - Treeconfig treeconfig; - vector repos; - bool hasPwd = treeconfig.getActiveRepositories( repos ); - if( hasPwd ) cout << "Found special path!\n"; - - string minor_ext; - bool has_minor_ext; - - if( Export::GetEnv("UPDMINOREXT") != NULL ) - { - minor_ext = string( Export::GetEnv("UPDMINOREXT") ); - has_minor_ext = minor_ext.size(); - } - else - has_minor_ext = false; - - // localize through all repositories - for( vector::iterator iter = repos.begin(); iter != repos.end() ; ++iter ) - { - string curRepository; - if( has_minor_ext ) - curRepository = string( Export::GetEnv("SOURCE_ROOT_DIR") ) + "/" + *iter + minor_ext; - else - curRepository = string( Export::GetEnv("SOURCE_ROOT_DIR") ) + "/" + *iter; - cout << "Localizing repository " << curRepository << "\n"; - SourceTreeLocalizer aIter( ByteString( curRepository.c_str() ) , sVersion , (sOutput.Len() > 0) , bQuiet2 , bSkipLinks ); - aIter.SetLanguageRestriction( sLanguages ); - if ( bExport ){ - if( bQuiet2 ){ /*printf("");*/fflush( stdout );} - aIter.Extract( sFileName ); - if( bQuiet2 ){ printf("\n %d files found!\n",aIter.GetFileCnt());} - } - } - if( hasPwd ) - { - string pwd; - Export::getCurrentDir( pwd ); - cout << "Localizing repository " << pwd << "\n"; - SourceTreeLocalizer aIter( ByteString( pwd.c_str() ) , sVersion , (sOutput.Len() > 0) , bQuiet2 , bSkipLinks ); - aIter.SetLanguageRestriction( sLanguages ); - if ( bExport ){ - if( bQuiet2 ){ /*printf("");*/fflush( stdout );} - aIter.Extract( sFileName ); - if( bQuiet2 ){ printf("\n %d files found!\n",aIter.GetFileCnt());} - } - - } - - return 0; -} - diff --git a/transex3/source/makefile.mk b/transex3/source/makefile.mk deleted file mode 100644 index a557b210aad0..000000000000 --- a/transex3/source/makefile.mk +++ /dev/null @@ -1,210 +0,0 @@ -#************************************************************************* -# -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite -# -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.46 $ -# -# 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 -# -# for a copy of the LGPLv3 License. -# -#************************************************************************* - -PRJ=.. - -INCPRE=$(MISC) - -PRJNAME=transex3 -TARGET=transex -TARGETTYPE=CUI -LIBTARGET=no -# --- Settings ----------------------------------------------------- -ENABLE_EXCEPTIONS=TRUE - -.INCLUDE : settings.mk -CDEFS+= -DYY_NEVER_INTERACTIVE=1 -#CDEFS+= -pg - -.IF "$(SYSTEM_EXPAT)" == "YES" -CFLAGS+=-DSYSTEM_EXPAT -.ENDIF - - -# --- Files -------------------------------------------------------- - -OBJFILES= \ - $(OBJ)$/export.obj \ - $(OBJ)$/export2.obj \ - $(OBJ)$/merge.obj \ - $(OBJ)$/srciter.obj \ - $(OBJ)$/utf8conv.obj \ - $(OBJ)$/xmlparse.obj \ - $(OBJ)$/helpmerge.obj \ - $(OBJ)$/helpex.obj \ - $(OBJ)$/file.obj \ - $(OBJ)$/directory.obj - - -LIB1TARGET= $(LB)$/$(TARGET).lib -LIB1ARCHIV= $(LB)$/libtransex.a -#LIB1FILES= $(LB)$/transex3.lib -LIB1OBJFILES= $(OBJ)$/export.obj \ - $(OBJ)$/export2.obj \ - $(OBJ)$/merge.obj \ - $(OBJ)$/srciter.obj \ - $(OBJ)$/file.obj \ - $(OBJ)$/directory.obj \ - $(OBJ)$/utf8conv.obj - - -APP1VERSIONMAP=exports.map - -# extractor and merger for *.src and *.hrc -APP1TARGET= transex3 -#APP1OBJS= $(OBJ)$/src_yy.obj -APP1OBJS= $(OBJ)$/src_yy_wrapper.obj - -APP1STDLIBS+= \ - $(TOOLSLIB) \ - $(VOSLIB) \ - $(SALLIB) - -.IF "$(OS)"=="MACOSX" -# static libs at end for OS X -.ENDIF - -APP1LIBS+= $(LB)$/$(TARGET).lib -APP1DEPN= $(OBJ)$/src_yy_wrapper.obj $(LB)$/$(TARGET).lib - -APP2TARGET= helpex -APP2OBJS= $(OBJ)$/helpmerge.obj $(OBJ)$/xmlparse.obj $(OBJ)$/export2.obj $(OBJ)$/utf8conv.obj $(OBJ)$/merge.obj $(OBJ)$/helpex.obj -APP2RPATH= NONE - -.IF "$(OS)"!="MACOSX" -.ENDIF - -APP2STDLIBS+=$(SALLIB) $(EXPATASCII3RDLIB) $(TOOLSLIB) $(VOSLIB) - -.IF "$(OS)"=="MACOSX" -# static libs at end for OS X -.ENDIF - -# extractor and merger for *.lng and *.lng -APP3TARGET= ulfex -APP3OBJS= $(OBJ)$/lngmerge.obj $(OBJ)$/merge.obj $(OBJ)$/export2.obj $(OBJ)$/lngex.obj $(OBJ)$/utf8conv.obj -APP3RPATH= NONE - -.IF "$(OS)"!="MACOSX" -#APP3STDLIBS+= $(BTSTRPLIB) -.ENDIF -APP3STDLIBS+= \ - $(TOOLSLIB) \ - $(VOSLIB) \ - $(SALLIB) -.IF "$(OS)"=="MACOSX" -# static libs at end for OS X -.ENDIF - -# encoding converter for *.gsi -APP4TARGET= gsiconv -APP4OBJS= $(OBJ)$/utf8conv.obj $(OBJ)$/gsiconv.obj -APP4STDLIBS+= \ - $(TOOLSLIB) \ - $(VOSLIB) \ - $(SALLIB) - -# tag checker for *.gsi -APP5TARGET= gsicheck -APP5OBJS= $(OBJ)$/gsicheck.obj $(OBJ)$/tagtest.obj -APP5STDLIBS+= \ - $(TOOLSLIB) \ - $(VOSLIB) \ - $(SALLIB) - -# extractor and merger for *.cfg -APP6TARGET= cfgex -APP6OBJS= $(OBJ)$/cfgmerge.obj $(OBJ)$/cfg_yy_wrapper.obj $(OBJ)$/merge.obj $(OBJ)$/export2.obj $(OBJ)$/utf8conv.obj - -.IF "$(OS)"!="MACOSX" -#APP6STDLIBS+= $(BTSTRPLIB) -.ENDIF - -APP6STDLIBS+= \ - $(TOOLSLIB) \ - $(VOSLIB) \ - $(SALLIB) - -.IF "$(OS)"=="MACOSX" -# static libs at end for OS X -.ENDIF - -# extractor and merger for *.xrm -APP7TARGET= xrmex -APP7OBJS= $(OBJ)$/xrmmerge.obj $(OBJ)$/xrm_yy_wrapper.obj $(OBJ)$/merge.obj $(OBJ)$/export2.obj $(OBJ)$/utf8conv.obj -APP7RPATH= NONE - -.IF "$(OS)"!="MACOSX" -.ENDIF - -APP7STDLIBS+= \ - $(TOOLSLIB) \ - $(VOSLIB) \ - $(SALLIB) - -.IF "$(OS)"=="MACOSX" -# static libs at end for OS X -.ENDIF - -# -#APP8TARGET= treeconfig -#APP8OBJS= $(OBJ)$/treeconfig.obj $(OBJ)$/inireader.obj $(OBJ)$/export2.obj -#APP8STDLIBS=$(TOOLSLIB) $(SALLIB) $(VOSLIB) $(ICUINLIB) $(STLPORT) - -# localizer for l10n framework -APP9TARGET= localize_sl -EXCEPTIONSFILES= \ - $(OBJ)$/localize.obj -APP9OBJS= $(OBJ)$/localize.obj $(OBJ)$/utf8conv.obj $(OBJ)$/srciter.obj $(OBJ)$/export2.obj $(OBJ)$/file.obj $(OBJ)$/directory.obj $(OBJ)$/treeconfig.obj $(OBJ)$/inireader.obj - -APP9STDLIBS+= \ - $(TOOLSLIB) \ - $(VOSLIB) \ - $(ICUINLIB) \ - $(ICUUCLIB) \ - $(STLPORTLIB) \ - $(SALLIB) - -DEPOBJFILES=$(APP1OBJS) $(APP2OBJS) $(APP3OBJS) $(APP4OBJS) $(APP5OBJS) $(APP6OBJS) $(APP7OBJS) $(APP8OBJS) $(APP9OBJS) - -# --- Targets ------------------------------------------------------ - -.INCLUDE : target.mk - -$(MISC)$/%_yy.c : %lex.l - flex -l -w -8 -o$@ $< - -# Helper to suppress warnings in lex generated c code, see #i57362# - -$(OBJ)$/src_yy_wrapper.obj: $(MISC)$/src_yy.c -$(OBJ)$/cfg_yy_wrapper.obj: $(MISC)$/cfg_yy.c -$(OBJ)$/xrm_yy_wrapper.obj: $(MISC)$/xrm_yy.c - diff --git a/transex3/source/merge.cxx b/transex3/source/merge.cxx deleted file mode 100644 index ee0f6f459655..000000000000 --- a/transex3/source/merge.cxx +++ /dev/null @@ -1,445 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: merge.cxx,v $ - * $Revision: 1.27.36.3 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_transex3.hxx" -#include -#include -#include "export.hxx" -#include "utf8conv.hxx" -#include - -using namespace std; - -extern void ConvertHalfwitdhToFullwidth( String& rString ); - -// -// class PFormEntrys -// - -ByteString PFormEntrys::Dump(){ - ByteString sRet( "PFormEntrys\n" ); - //sRet.Append( Export::DumpMap( ByteString("sText") , sText ) ); - //sRet.Append("\n"); - ByteString a("sText"); - if ( sText.size() ) Export::DumpMap( a , sText ); - return sRet; -} - -/*****************************************************************************/ -BOOL PFormEntrys::GetText( ByteString &rReturn, - USHORT nTyp, const ByteString &nLangIndex, BOOL bDel ) -/*****************************************************************************/ -{ - - /*printf("DBG: PFormEntrys::GetText(nId=%s)\n",nLangIndex.GetBuffer() ); - - // DEBUG****************** - ByteStringHashMap::const_iterator idbg; - std::cout << "HASHKEYS : \n"; - for( idbg = sText.begin() ; idbg != sText.end(); ++idbg ) - std::cout << (idbg->first).GetBuffer() << "\n"; - std::cout << "\n\n"; - std::cout << "String sText[ nLangIndex ] = " << sText[ nLangIndex ].GetBuffer() << "\n"; - // DEBUG****************** -*/ - - BOOL bReturn=TRUE; - switch ( nTyp ) { - case STRING_TYP_TEXT : - rReturn = sText[ nLangIndex ]; - if ( bDel ) - sText[ nLangIndex ] = ""; - bReturn = bTextFirst[ nLangIndex ]; - bTextFirst[ nLangIndex ] = FALSE; - break; - case STRING_TYP_HELPTEXT : - rReturn = sHelpText; - break; - case STRING_TYP_QUICKHELPTEXT : - rReturn = sQuickHelpText[ nLangIndex ]; - if ( bDel ) - sQuickHelpText[ nLangIndex ] = ""; - bReturn = bQuickHelpTextFirst[ nLangIndex ]; - bQuickHelpTextFirst[ nLangIndex ] = FALSE; - break; - case STRING_TYP_TITLE : - rReturn = sTitle[ nLangIndex ]; - if ( bDel ) - sTitle[ nLangIndex ] = ""; - bReturn = bTitleFirst[ nLangIndex ]; - bTitleFirst[ nLangIndex ] = FALSE; - break; - } - //printf("Returning '%s'\n",rReturn.GetBuffer()); - return bReturn; -} - - -// -// class MergeData -// - -/*****************************************************************************/ -MergeData::~MergeData() -/*****************************************************************************/ -{ -} - -/*****************************************************************************/ -PFormEntrys* MergeData::GetPFormEntrys( ResData *pResData ) -/*****************************************************************************/ -{ - - (void) pResData; // FIXME - if( aMap.find( ByteString("HACK") ) != aMap.end() ){ - return aMap[ ByteString("HACK") ]; - } - else{ - return 0; - } -} - -void MergeData::Insert( const ByteString& rPFO , PFormEntrys* pfEntrys ){ - (void) rPFO; // FIXME - aMap.insert( PFormEntrysHashMap::value_type( ByteString("HACK") , pfEntrys ) ); - -} -ByteString MergeData::Dump(){ - ByteString sRet( "MergeData\n" ); - - printf("MergeData sTyp = %s , sGid = %s , sLid =%s , sFilename = %s\n",sTyp.GetBuffer(),sGID.GetBuffer(),sLID.GetBuffer(), sFilename.GetBuffer() ); - - PFormEntrysHashMap::const_iterator idbg; - for( idbg = aMap.begin() ; idbg != aMap.end(); ++idbg ){ - printf("aMap[ %s ] = " ,idbg->first.GetBuffer()); - ( (PFormEntrys*)(idbg->second) )->Dump(); - printf("\n") ; - } - printf("\n") ; - return sRet; -} - -PFormEntrys* MergeData::GetPFObject( const ByteString& rPFO ){ - if( aMap.find( ByteString("HACK") ) != aMap.end() ){ - return aMap[ rPFO ]; - } - else{ - return 0; - } -} - - -/*****************************************************************************/ -PFormEntrys *MergeData::InsertEntry( const ByteString &rPForm ) -/*****************************************************************************/ -{ - PFormEntrys* pFEntrys = new PFormEntrys( rPForm ); - aMap.insert( PFormEntrysHashMap::value_type( rPForm , pFEntrys ) ); - return pFEntrys; -} - -/*****************************************************************************/ -BOOL MergeData::operator==( ResData *pData ) -/*****************************************************************************/ -{ - ByteString sResTyp_upper( pData->sResTyp ); - sResTyp_upper.ToUpperAscii(); - ByteString sTyp_upper( sTyp ); - sTyp_upper.ToUpperAscii(); - - return (( pData->sId == sLID ) && - ( pData->sGId == sGID ) && - ( sResTyp_upper == sTyp_upper ) - ); -} - -// -// class MergeDataFile -// - -#define FFORMAT_UNKNOWN 0x0000 -#define FFORMAT_NEW 0x0001 -#define FFORMAT_OLD 0x0002 - -/*****************************************************************************/ -MergeDataFile::MergeDataFile( const ByteString &rFileName, const ByteString& sFile ,BOOL bErrLog, -// CharSet aCharSet, BOOL bUTF8 , bool bCaseSensitive ) - CharSet aCharSet, bool bCaseSensitive ) - -/*****************************************************************************/ - : bErrorLog( bErrLog ) -{ - - SvFileStream aInputStream( String( rFileName, RTL_TEXTENCODING_ASCII_US ), STREAM_STD_READ ); - aInputStream.SetStreamCharSet( aCharSet ); - ByteString sLine; -// printf("\nReading localize.sdf ...\n"); - ByteString sTYP; - ByteString sGID; - ByteString sLID; - ByteString sPFO; - ByteString nLANG; - ByteString sTEXT; - ByteString sQHTEXT; - ByteString sTITLE; - ByteString sHACK("HACK"); - - const ByteString sEmpty(""); - - if( !aInputStream.IsOpen() ) { - printf("Warning : Can't open %s\n", rFileName.GetBuffer()); - //exit( -1 ); - return; - } - while ( !aInputStream.IsEof()) { - xub_StrLen nToks; - aInputStream.ReadLine( sLine ); - sLine = sLine.Convert( RTL_TEXTENCODING_MS_1252, aCharSet ); - - nToks = sLine.GetTokenCount( '\t' ); - if ( nToks == 15 ) { - // Skip all wrong filenames - ByteString filename = sLine.GetToken( 1 , '\t' ); - filename = filename.Copy( filename.SearchCharBackward( "\\" )+1 , filename.Len() ); - - if( sFile.Equals( sEmpty ) || ( !sFile.Equals( sEmpty ) && filename.Equals( sFile ) ) ) - { - xub_StrLen rIdx = 0; - sTYP = sLine.GetToken( 3, '\t', rIdx ); - sGID = sLine.GetToken( 0, '\t', rIdx ); // 4 - sLID = sLine.GetToken( 0, '\t', rIdx ); // 5 - sPFO = sLine.GetToken( 1, '\t', rIdx ); // 7 - sPFO = sHACK; - nLANG = sLine.GetToken( 1, '\t', rIdx ); // 9 - sTEXT = sLine.GetToken( 0, '\t', rIdx ); // 10 - - sQHTEXT = sLine.GetToken( 1, '\t', rIdx ); // 12 - sTITLE = sLine.GetToken( 0, '\t', rIdx ); // 13 - - nLANG.EraseLeadingAndTrailingChars(); - -#ifdef MERGE_SOURCE_LANGUAGES - if( true ){ -#else - if ( !nLANG.EqualsIgnoreCaseAscii("en-US") ){ -#endif - ByteStringHashMap::const_iterator lit; - lit = aLanguageMap.find (nLANG); - ByteString aLANG; - if (lit == aLanguageMap.end()) { - aLANG = nLANG; - aLanguageMap.insert( ByteStringHashMap::value_type( aLANG, aLANG ) ); - // Remember read languages for -l all switch - aLanguageList.push_back( nLANG ); - } else - aLANG = lit->first; - - InsertEntry( sTYP, sGID, sLID, sPFO, aLANG, sTEXT, sQHTEXT, sTITLE , filename , bCaseSensitive ); - } - } - } - else if ( nToks == 10 ) { - printf("ERROR: File format is obsolete and no longer supported!\n"); - } - } - aInputStream.Close(); -} -/*****************************************************************************/ -MergeDataFile::~MergeDataFile() -/*****************************************************************************/ -{ -} - -/*****************************************************************************/ -//void MergeDataFile::WriteErrorLog( const ByteString &rFileName ) -/*****************************************************************************/ -//{ -// DEAD -//} - -ByteString MergeDataFile::Dump(){ - ByteString sRet( "MergeDataFile\n" ); - - //sRet.Append( Export::DumpMap( "aLanguageSet" , aLanguageSet ) ); - //sRet.Append( Export::DumpMap( "aLanguageList" , aLanguageList ) ); - printf("MergeDataFile\n"); - MergeDataHashMap::const_iterator idbg; - for( idbg = aMap.begin() ; idbg != aMap.end(); ++idbg ){ - /*sRet.Append( "aMap[" ); - sRet.Append( idbg->first ); - sRet.Append( "]= " ); - sRet.Append( ((MergeData*) (idbg->second))->Dump() ); - sRet.Append("\n");*/ - - printf("aMap[ %s ] = ",idbg->first.GetBuffer()); - ((MergeData*) (idbg->second))->Dump(); - printf("\n"); - } - printf("\n"); - //sRet.Append("\n"); - return sRet; -} - -/*****************************************************************************/ -void MergeDataFile::WriteError( const ByteString &rLine ) -/*****************************************************************************/ -{ - if ( bErrorLog ) { - if ( !aErrLog.IsOpen()) - aErrLog.Open( String( sErrorLog, RTL_TEXTENCODING_ASCII_US ), STREAM_STD_WRITE | STREAM_TRUNC ); - aErrLog.WriteLine( rLine ); - } - else - fprintf( stderr, "%s\n", rLine.GetBuffer()); -} -std::vector MergeDataFile::GetLanguages(){ - return aLanguageList; -} - -/*****************************************************************************/ -MergeData *MergeDataFile::GetMergeData( ResData *pResData , bool bCaseSensitive ) -/*****************************************************************************/ -{ - ByteString sOldG = pResData->sGId; - ByteString sOldL = pResData->sId; - ByteString sGID = pResData->sGId; - ByteString sLID; - if ( !sGID.Len()) - sGID = pResData->sId; - else - sLID = pResData->sId; - pResData->sGId = sGID; - pResData->sId = sLID; - - ByteString sKey = CreateKey( pResData->sResTyp , pResData->sGId , pResData->sId , pResData->sFilename , bCaseSensitive ); - - //printf("DBG: Searching [%s]\n",sKey.GetBuffer()); - if( aMap.find( sKey ) != aMap.end() ){ - pResData->sGId = sOldG; - pResData->sId = sOldL; - //printf("DBG: Found[%s]\n",sKey.GetBuffer()); - return aMap[ sKey ]; - } - pResData->sGId = sOldG; - pResData->sId = sOldL; - //printf("DBG: Found[%s]\n",sKey.GetBuffer()); - return NULL; -} - - -/*****************************************************************************/ -PFormEntrys *MergeDataFile::GetPFormEntrys( ResData *pResData ) -/*****************************************************************************/ -{ - // search for requested PFormEntrys - MergeData *pData = GetMergeData( pResData ); - if ( pData ) - return pData->GetPFormEntrys( pResData ); - return NULL; -} - -/*****************************************************************************/ -PFormEntrys *MergeDataFile::GetPFormEntrysCaseSensitive( ResData *pResData ) -/*****************************************************************************/ -{ - // search for requested PFormEntrys - MergeData *pData = GetMergeData( pResData , true ); - if ( pData ) - return pData->GetPFormEntrys( pResData ); - return NULL; -} -/*****************************************************************************/ -void MergeDataFile::InsertEntry( - const ByteString &rTYP, const ByteString &rGID, - const ByteString &rLID, const ByteString &rPFO, - const ByteString &nLANG, const ByteString &rTEXT, - const ByteString &rQHTEXT, const ByteString &rTITLE , - const ByteString &rInFilename , bool bCaseSensitive - ) -/*****************************************************************************/ -{ - MergeData *pData; - BOOL bFound = FALSE; - - // uniquify the filename to save memory. - ByteStringHashMap::const_iterator fit = aFilenames.find (rInFilename); - ByteString aFilename; - if (fit == aFilenames.end()) { - aFilename = rInFilename; - aFilenames.insert (ByteStringHashMap::value_type (aFilename, aFilename)); - } else - aFilename = fit->first; - - // search for MergeData - - ByteString sKey = CreateKey( rTYP , rGID , rLID , aFilename , bCaseSensitive ); - MergeDataHashMap::const_iterator mit; - mit = aMap.find( sKey ); - if( mit != aMap.end() ){ - pData = mit->second; - }else{ - pData = new MergeData( rTYP, rGID, rLID, aFilename ); - aMap.insert( MergeDataHashMap::value_type( sKey, pData ) ); - } - - bFound = FALSE; - PFormEntrys *pFEntrys = 0; - - // search for PFormEntrys - - pFEntrys = pData->GetPFObject( rPFO ); - if( !pFEntrys ){ - // create new PFormEntrys, cause no one exists with current properties - pFEntrys = new PFormEntrys( rPFO ); - pData->Insert( rPFO , pFEntrys ); - } - - // finaly insert the cur string - - pFEntrys->InsertEntry( nLANG , rTEXT, rQHTEXT, rTITLE ); - - //printf("DBG: MergeDataFile::Insert[]=( sKey=%s,nLang=%s,rTEXT=%s)\n",sKey2.GetBuffer(),nLANG.GetBuffer(),rTEXT.GetBuffer()); -} -ByteString MergeDataFile::CreateKey( const ByteString& rTYP , const ByteString& rGID , const ByteString& rLID , const ByteString& rFilename , bool bCaseSensitive ){ - - ByteString sKey( rTYP ); - sKey.Append( '-' ); - sKey.Append( rGID ); - sKey.Append( '-' ); - sKey.Append( rLID ); - sKey.Append( '-' ); - sKey.Append( rFilename ); - - if( bCaseSensitive ) return sKey; // officecfg case sensitive identifier - else return sKey.ToUpperAscii(); -} - - diff --git a/transex3/source/src_yy_wrapper.c b/transex3/source/src_yy_wrapper.c deleted file mode 100644 index d326b9a94e86..000000000000 --- a/transex3/source/src_yy_wrapper.c +++ /dev/null @@ -1,2 +0,0 @@ -// Helper to suppress warnings in lex generated c code, see #i57362# -#include "src_yy.c" diff --git a/transex3/source/srciter.cxx b/transex3/source/srciter.cxx deleted file mode 100644 index d2cbb2352570..000000000000 --- a/transex3/source/srciter.cxx +++ /dev/null @@ -1,141 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: srciter.cxx,v $ - * $Revision: 1.14 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_transex3.hxx" - -#include "srciter.hxx" -#include -#include - -// -// class SourceTreeIterator -// - -/*****************************************************************************/ -SourceTreeIterator::SourceTreeIterator( - const ByteString &rRootDirectory, const ByteString &rVersion , bool bLocal_in ) -/*****************************************************************************/ - : bInExecute( FALSE ) , bLocal( bLocal_in ) -{ - (void) rVersion ; - - if(!bLocal){ - rtl::OUString sRootDirectory( rRootDirectory.GetBuffer() , rRootDirectory.Len() , RTL_TEXTENCODING_UTF8 ); - aRootDirectory = transex::Directory( sRootDirectory ); - } -} - -/*****************************************************************************/ -SourceTreeIterator::~SourceTreeIterator() -/*****************************************************************************/ -{ -} - -/*****************************************************************************/ -void SourceTreeIterator::ExecuteDirectory( transex::Directory& aDirectory ) -/*****************************************************************************/ -{ - if ( bInExecute ) { - rtl::OUString sDirName = aDirectory.getDirectoryName(); - - static rtl::OUString WCARD1 ( rtl::OUString::createFromAscii( "unxlng" ) ); - static rtl::OUString WCARD2 ( rtl::OUString::createFromAscii( "unxsol" ) ); - static rtl::OUString WCARD3 ( rtl::OUString::createFromAscii( "wntmsc" ) ); - static rtl::OUString WCARD4 ( rtl::OUString::createFromAscii( "common" ) ); - static rtl::OUString WCARD5 ( rtl::OUString::createFromAscii( "unxmac" ) ); - static rtl::OUString WCARD6 ( rtl::OUString::createFromAscii( "unxubt" ) ); - static rtl::OUString WCARD7 ( rtl::OUString::createFromAscii( ".svn" ) ); - - - if( sDirName.indexOf( WCARD1 , 0 ) > -1 || - sDirName.indexOf( WCARD2 , 0 ) > -1 || - sDirName.indexOf( WCARD3 , 0 ) > -1 || - sDirName.indexOf( WCARD4 , 0 ) > -1 || - sDirName.indexOf( WCARD5 , 0 ) > -1 || - sDirName.indexOf( WCARD6 , 0 ) > -1 || - sDirName.indexOf( WCARD7 , 0 ) > -1 - ) return; - //printf("**** %s \n", OUStringToOString( sDirName , RTL_TEXTENCODING_UTF8 , sDirName.getLength() ).getStr() ); - - rtl::OUString sDirNameTmp = aDirectory.getFullName(); - ByteString sDirNameTmpB( rtl::OUStringToOString( sDirNameTmp , RTL_TEXTENCODING_UTF8 , sDirName.getLength() ).getStr() ); - -#ifdef WNT - sDirNameTmpB.Append( ByteString("\\no_localization") ); -#else - sDirNameTmpB.Append( ByteString("/no_localization") ); -#endif - //printf("**** %s \n", OUStringToOString( sDirNameTmp , RTL_TEXTENCODING_UTF8 , sDirName.getLength() ).getStr() ); - - DirEntry aDE( sDirNameTmpB.GetBuffer() ); - if( aDE.Exists() ) - { - //printf("#### no_localization file found ... skipping"); - return; - } - - aDirectory.setSkipLinks( bSkipLinks ); - aDirectory.readDirectory(); - OnExecuteDirectory( aDirectory.getFullName() ); - if ( aDirectory.getSubDirectories().size() ) - for ( ULONG i=0;i < aDirectory.getSubDirectories().size();i++ ) - ExecuteDirectory( aDirectory.getSubDirectories()[ i ] ); - } -} - -/*****************************************************************************/ -BOOL SourceTreeIterator::StartExecute() -/*****************************************************************************/ -{ - - bInExecute = TRUE; // FIXME - ExecuteDirectory( aRootDirectory ); - - if ( bInExecute ) { // FIXME - bInExecute = FALSE; - return TRUE; - } - return FALSE; -} - -/*****************************************************************************/ -void SourceTreeIterator::EndExecute() -/*****************************************************************************/ -{ - bInExecute = FALSE; -} - -/*****************************************************************************/ -void SourceTreeIterator::OnExecuteDirectory( const rtl::OUString &rDirectory ) -/*****************************************************************************/ -{ - fprintf( stdout, "%s\n", rtl::OUStringToOString( rDirectory, RTL_TEXTENCODING_UTF8, rDirectory.getLength() ).getStr() ); -} diff --git a/transex3/source/srclex.l b/transex3/source/srclex.l deleted file mode 100644 index fef251e47224..000000000000 --- a/transex3/source/srclex.l +++ /dev/null @@ -1,308 +0,0 @@ - -%{ -/* - * lexer for parsing ressource source files (*.src) - * - */ - - -/* enlarge token buffer to tokenize whole strings */ -#undef YYLMAX -#define YYLMAX 64000 - -/* to enable debug output define LEXDEBUG */ -#define LEXDEBUG 1 -#ifdef LEXDEBUG -#define OUTPUT fprintf -#else -#define OUTPUT(Par1,Par2); -#endif - -/* table of possible token ids */ -#include "tokens.h" -#include -#include - -#if defined __GNUC__ -#pragma GCC system_header -#elif defined __SINPRO_CC -#pragma disable_warn -#elif defined _MSC_VER -#pragma warning(push, 1) -#endif - -/* external functions (C++ code, declared as extren "C" */ -extern int WorkOnTokenSet( int, char* ); -extern int InitExport( char * , char * ); -extern int Parse( int nTyp, char *pTokenText ); -extern int EndExport(); -extern int SetError(); -extern int GetError(); -extern char *GetOutputFile( int argc, char* argv[]); -extern FILE *GetNextFile(); -extern int isQuiet(); -extern void Close(); -extern char* getFilename(); - -/* forwards */ -void YYWarning(); -%} - -%p 24000 -%e 1200 -%n 500 - -%% - -^[\t ]*"#pragma".* { - WorkOnTokenSet( PRAGMA, yytext ); -} - -^[ \t]*\n { - WorkOnTokenSet( EMPTYLINE, yytext ); -} - -[\t ]+ | -^[\t ]*"#include".* | -^[\t ]*"#undef".* | -"//".* | -";" | -"<" | -">" | -\n { - WorkOnTokenSet( IGNOREDTOKENS, yytext ); -} -"/*" { - char c1 = 0, c2 = input(); - char pChar[2]; - pChar[1] = 0x00; - pChar[0] = c2; - - WorkOnTokenSet( COMMEND, yytext ); - WorkOnTokenSet( COMMEND, pChar ); - for(;;) { - if ( c2 == EOF ) - break; - if ( c1 == '*' && c2 == '/' ) - break; - c1 = c2; - c2 = input(); - pChar[0] = c2; - WorkOnTokenSet( COMMEND, pChar ); - } -} - -^[\t ]*"#ifndef".+$ | -^[\t ]*"#ifdef".+$ | -^[\t ]*"#if".+$ | -^[\t ]*"#elif".*$ | -^[\t ]*"#else".*$ | -^[\t ]*"#endif".*$ { - WorkOnTokenSet( CONDITION, yytext ); -} - -[a-zA-Z]+[\t ]+[^={\n]+[\t ] { -/* defined Res */ - WorkOnTokenSet( DEFINEDRES, yytext ); -} - -[a-zA-Z]+[ \t]+[^={;\n]+\n[ \t]*"#".*\n[ \t]*"{" | -[a-zA-Z]+[ \t]+[^={;\n]+\n?([ \t]*"//".*\n)*[ \t]*"{" { -/* RESSOURCE // String TTT_XX ... */ - WorkOnTokenSet( RESSOURCE, yytext ); -} - -^[\t ]*[a-zA-Z_]+[\t ]*"\\"?[\t ]*\n?[ \t]*"{"[\t ]*"\\"? { -/* SMALRESSOURCE // String ... */ - WorkOnTokenSet( SMALRESSOURCE, yytext ); -} - -[\t ]*[a-zA-Z0-9_]+[ \t]*("["[ \t]*[a-zA-Z0-9_\-]+[ \t]*"]"[ \t]*)?=[ \t]*L?\".*\".*\n? { -/* TEXTLINE // TextTyp = "A Text" */ - WorkOnTokenSet( TEXTLINE, yytext ); -} - -[\t ]*[a-zA-Z0-9_]+[ \t]*("["[ \t]*[a-zA-Z0-9_\-]+[ \t]*"]"[ \t]*)?(\n[ \t]*)?=([ \t]*\n)?(([a-zA-Z0-9_]+)|(\".*\")|([ \t\n]*))*\".*\"(([a-zA-Z0-9_]+)|(\".*\")|([ \t\n]*))*; { -/* LONGTEXTLINE // TextTyp = "A Text" HHH_XXX "A Text" ZZZ_TTT ... */ - WorkOnTokenSet( LONGTEXTLINE, yytext ); -} - -\".*\" { -/* TEXT // "A Text" */ - WorkOnTokenSet( TEXT, yytext ); -} - -"{"[ \t]*\\? { -/* LEVELUP */ - WorkOnTokenSet( LEVELUP, yytext ); -} - -"}"[ \t]*;([ \t]*\\)? { -/* LEVELDOWN */ - WorkOnTokenSet( LEVELDOWN, yytext ); -} - -[a-zA-Z0-9_]+[ \t]*"="[ \t]*"MAP_APPFONT"[ \t]*"(".+")".* { -/* APPFONTMAPPING Typ = MAP_APPFONT( ... ) */ - WorkOnTokenSet( APPFONTMAPPING, yytext ); -} - -[ \t]*[a-zA-Z0-9_]+[ \t]*=[ \t]*[0123456789]{1,5}[ \t]*";"?\\? { -/* TEXTREFID // TextTyp = 12345 */ - WorkOnTokenSet( TEXTREFID, yytext ); -} - -[a-zA-Z0-9_]+[ \t]*"="[\t ]*([ \t]*"//".*\n)*.* | -[a-zA-Z0-9_]+[ \t]*"=".* { -/* ASSIGNMENT Typ = ... */ - WorkOnTokenSet( ASSIGNMENT, yytext ); -} - - - -[a-zA-Z0-9_]+[ \t]*("["[ \t]*[a-zA-Z0-9_\-]+[ \t]*"]"[ \t]*)?"="[ \t]*(\\[ \t]*)?\n?[ \t]*"{"[ \t]*(\\[ \t]*)?\n?[ \t]*"<" { -/* LISTASSIGNMENT Typ [ ... ] = ... */ - WorkOnTokenSet( LISTASSIGNMENT, yytext ); -} - -"StringList"+[ \t]*("["[ \t]*[a-zA-Z0-9_\-]+[ \t]*"]"[ \t]*)?"="[ \t]*(\\[ \t]*)?\n?[ \t]*"{"[ \t]*(\\[ \t]*)?\n?[ \t]* { -/* LISTASSIGNMENT Typ [ ... ] = ... */ - WorkOnTokenSet( LISTASSIGNMENT, yytext ); -} - -"UIEntries"[ \t]*("["[ \t]*[a-zA-Z0-9_\-]+[ \t]*"]"[ \t]*)?"="[ \t]*(\\[ \t]*)?\n?[ \t]*"{" { -/* UIENTRIES */ - WorkOnTokenSet( UIENTRIES, yytext ); -} - -"<"?[ \t]*L?\".*\".*">" { -/* LISTTEXT */ - WorkOnTokenSet( LISTTEXT, yytext ); -} - -[ \t]*"#define"[ \t]+[a-zA-Z0-9_]+.*"\\" { -/* RSCDEFINE #define ... */ - WorkOnTokenSet( RSCDEFINE, yytext ); -} - -[ \t]*"#define"[ \t]+[a-zA-Z0-9_]+.+ { -/* #define ... */ - WorkOnTokenSet( NORMDEFINE, yytext ); -} - -"\\" { -/* RSCDEFINELEND */ - WorkOnTokenSet( RSCDEFINELEND, yytext ); -} - -[a-zA-Z0-9_]+[ \t]*; { -/* allowed other tokens like "49 ;" or "SFX_... ;" */ - WorkOnTokenSet( ANYTOKEN, yytext ); -} - -. { - WorkOnTokenSet( UNKNOWNCHAR, yytext ); -/* YYWarning( "Unknown Char" ); */ -} - -"{"?[ \t]*\".*\"[ \t]*";"[ \t]*"}" { -/* _LISTTEXT */ - WorkOnTokenSet( _LISTTEXT, yytext ); -} - -%% - -/*****************************************************************************/ -int yywrap(void) -/*****************************************************************************/ -{ - FILE *pFile; - pFile = GetNextFile(); - if ( pFile ) { - yyin = pFile; - yylineno = 0; - return 0; - } - - /* end of input reached */ - return 1; -} - -/*****************************************************************************/ -void YYWarning( char *s ) -/*****************************************************************************/ -{ - /* write warning to stderr */ - fprintf( stderr, "Warning: \"%s\" in line %d: \"%s\"\n", s, yylineno, yytext ); -} - -/*****************************************************************************/ -void yyerror( char *s ) -/*****************************************************************************/ -{ - /* write error to stderr */ - fprintf( stderr, "Error: \"%s\" in line %d: \"%s\"\n", s, yylineno, yytext ); - SetError(); -} - -/*****************************************************************************/ -int -#ifdef WNT -_cdecl -#endif -main( int argc, char* argv[]) -/*****************************************************************************/ -{ - /* error level */ - int nRetValue = 0; - char *pOutput; - FILE *pFile; - - pOutput = GetOutputFile( argc, argv ); - if( !isQuiet() ){ - fprintf( stdout, "\nTransEx 3.1 Copyright 2000 Sun Microsystems, Inc. All Rights Reserved.\n" ); - fprintf( stdout, "========================================================================\n" ); - } - - if ( !pOutput ) { - fprintf( stdout, "Syntax:TRANSEX[-p Prj][-r PrjRoot]-i FileIn...[-o FileOut][-m DataBase][-e][-b][-u][-L l1,l2,...]\n" ); - fprintf( stdout, " Prj: Project\n" ); - fprintf( stdout, " PrjRoot: Path to project root (..\\.. etc.)\n" ); - fprintf( stdout, " FileIn: Source files (*.src)\n" ); - fprintf( stdout, " FileOut: Destination file (*.*)\n" ); - fprintf( stdout, " DataBase: Mergedata (*.sdf)\n" ); - fprintf( stdout, " -QQ: quiet output\n" ); - fprintf( stdout, " -e: Disable writing errorlog\n" ); - fprintf( stdout, " -b: Break when Token \"HelpText\" found in source\n" ); - fprintf( stdout, " -u: [english] and [german] are allowed, Id is Taken from DataBase \n" ); - fprintf( stdout, " -NOUTF8: disable UTF8 as language independent encoding\n" ); - fprintf( stdout, " -L: Restrict the handled languages. l1,l2,... are elements of (de,en-US...)\n" ); - fprintf( stdout, " A fallback language can be defined like this: l1=f1.\n" ); - fprintf( stdout, " f1, f2,... are also elements of (de,en-US...)\n" ); - fprintf( stdout, " Example: -L de,es=en-US\n" ); - fprintf( stdout, " Restriction to de and es, en-US will be fallback for es\n" ); - return 1; - } - - InitExport( pOutput , getFilename() ); - pFile = GetNextFile(); - if ( !pFile ) - return 1; - - yyin = pFile; - - /* create global instance of class Export */ - - /* start parser */ - yylex(); - Close(); - - /* get error info. and end export */ - nRetValue = GetError(); - EndExport(); - - if( !isQuiet() ) fprintf( stdout, "\n===================================\n\n" ); - - /* return error level */ - return nRetValue; -} diff --git a/transex3/source/tagtest.cxx b/transex3/source/tagtest.cxx deleted file mode 100644 index 89c1ecf15488..000000000000 --- a/transex3/source/tagtest.cxx +++ /dev/null @@ -1,1577 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: tagtest.cxx,v $ - * $Revision: 1.20 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_transex3.hxx" -#include -#include "tagtest.hxx" - -#if OSL_DEBUG_LEVEL > 1 -#include -#endif - -#include "gsicheck.hxx" - -#define HAS_FLAG( nFlags, nFlag ) ( ( nFlags & nFlag ) != 0 ) -#define SET_FLAG( nFlags, nFlag ) ( nFlags |= nFlag ) -#define RESET_FLAG( nFlags, nFlag ) ( nFlags &= ~nFlag ) // ~ = Bitweises NOT - - - -TokenInfo::TokenInfo( TokenId pnId, USHORT nP, String paStr, ParserMessageList &rErrorList ) -: bClosed(FALSE) -, bCloseTag(FALSE) -, bIsBroken(FALSE) -, bHasBeenFixed(FALSE) -, bDone(FALSE) -, aTokenString( paStr ) -, nId( pnId ) -, nPos(nP) -{ - if ( nId == TAG_COMMONSTART || nId == TAG_COMMONEND ) - SplitTag( rErrorList ); -} - -enum tagcheck { TC_START, TC_HAS_TAG_NAME, TC_HAS_PROP_NAME_EQ, TC_HAS_PROP_NAME_EQ_SP, TC_HAS_PROP_NAME_SP, TC_INSIDE_STRING, TC_PROP_FINISHED, TC_CLOSED, TC_CLOSED_SPACE, TC_CLOSETAG, TC_CLOSETAG_HAS_TAG_NAME, TC_FINISHED, TC_ERROR }; - -/* - \< link href = \"text\" name = \"C\" \> -START ' ' -> HAS_TAG_NAME -START '/' -> CLOSED -START '/' -> CLOSETAG - no Portion (starting with /) -START '>' -> FINISHED -HAS_TAG_NAME '=' -> HAS_PROP_NAME_EQ -HAS_TAG_NAME ' ' -> HAS_PROP_NAME_SP -HAS_TAG_NAME '/' -> CLOSED -HAS_TAG_NAME '>' -> FINISHED -HAS_PROP_NAME_SP '=' -> HAS_PROP_NAME_EQ -HAS_PROP_NAME_EQ ' ' -> HAS_PROP_NAME_EQ_SP -HAS_PROP_NAME_EQ '"' -> INSIDE_STRING -HAS_PROP_NAME_EQ_SP '"' -> INSIDE_STRING -INSIDE_STRING ' ' -> INSIDE_STRING -INSIDE_STRING '=' -> INSIDE_STRING -INSIDE_STRING '>' -> INSIDE_STRING -INSIDE_STRING '"' -> PROP_FINISHED -PROP_FINISHED ' ' -> HAS_TAG_NAME -PROP_FINISHED '/' -> CLOSED -PROP_FINISHED '>' -> FINISHED -CLOSED ' ' -> CLOSED_SPACE -CLOSED '>' -> FINISHED -CLOSED_SPACE '>' -> FINISHED - -CLOSETAG ' ' -> CLOSETAG_HAS_TAG_NAME -CLOSETAG '>' -> FINISHED -CLOSETAG_HAS_TAG_NAME '>' -> FINISHED - -*/ -void TokenInfo::SplitTag( ParserMessageList &rErrorList ) -{ - USHORT nLastPos = 2; // skip initial \< - USHORT nCheckPos = nLastPos; - String aDelims( String::CreateFromAscii( " \\=>/" ) ); - String aPortion; - String aValue; // store the value of a property - ByteString aName; // store the name of a property/tag - BOOL bCheckName = FALSE; - BOOL bCheckEmpty = FALSE; - sal_Unicode cDelim; - tagcheck aState = TC_START; - - // skip blanks - while ( nLastPos < aTokenString.Len() && aTokenString.GetChar( nLastPos ) == ' ') - nLastPos++; - - nCheckPos = aTokenString.SearchChar( aDelims.GetBuffer(), nLastPos ); - while ( nCheckPos != STRING_NOTFOUND && !( aState == TC_FINISHED || aState == TC_ERROR ) ) - { - aPortion = aTokenString.Copy( nLastPos, nCheckPos-nLastPos ); - - if ( aTokenString.GetChar( nCheckPos ) == '\\' ) - nCheckPos++; - - cDelim = aTokenString.GetChar( nCheckPos ); - nCheckPos++; - - switch ( aState ) - { -// START ' ' -> HAS_TAG_NAME -// START '/' -> CLOSED -// START '>' -> FINISHED - case TC_START: - aTagName = aPortion; - switch ( cDelim ) - { - case ' ': aState = TC_HAS_TAG_NAME; - bCheckName = TRUE; - break; - case '/': - { - if ( aPortion.Len() == 0 ) - { - aState = TC_CLOSETAG; - } - else - { - aState = TC_CLOSED; - bCheckName = TRUE; - } - } - break; - case '>': aState = TC_FINISHED; - bCheckName = TRUE; - break; - default: aState = TC_ERROR; - } - break; - -// HAS_TAG_NAME '=' -> HAS_PROP_NAME_EQ -// HAS_TAG_NAME ' ' -> HAS_PROP_NAME_SP -// HAS_TAG_NAME '/' -> CLOSED -// HAS_TAG_NAME '>' -> FINISHED - case TC_HAS_TAG_NAME: - switch ( cDelim ) - { - case '=': aState = TC_HAS_PROP_NAME_EQ; - bCheckName = TRUE; - break; - case ' ': aState = TC_HAS_PROP_NAME_SP; - bCheckName = TRUE; - break; - case '/': aState = TC_CLOSED; - bCheckEmpty = TRUE; - break; - case '>': aState = TC_FINISHED; - bCheckEmpty = TRUE; - break; - default: aState = TC_ERROR; - } - break; - -// HAS_PROP_NAME_SP '=' -> HAS_PROP_NAME_EQ - case TC_HAS_PROP_NAME_SP: - switch ( cDelim ) - { - case '=': aState = TC_HAS_PROP_NAME_EQ; - bCheckEmpty = TRUE; - break; - default: aState = TC_ERROR; - } - break; - -// HAS_PROP_NAME_EQ ' ' -> HAS_PROP_NAME_EQ_SP -// HAS_PROP_NAME_EQ '"' -> INSIDE_STRING - case TC_HAS_PROP_NAME_EQ: - switch ( cDelim ) - { - case ' ': aState = TC_HAS_PROP_NAME_EQ_SP; - bCheckEmpty = TRUE; - break; - case '\"': aState = TC_INSIDE_STRING; - bCheckEmpty = TRUE; - aValue.Erase(); - break; - default: aState = TC_ERROR; - } - break; - -// HAS_PROP_NAME_EQ_SP '"' -> INSIDE_STRING - case TC_HAS_PROP_NAME_EQ_SP: - switch ( cDelim ) - { - case '\"': aState = TC_INSIDE_STRING; - bCheckEmpty = TRUE; - aValue.Erase(); - break; - default: aState = TC_ERROR; - } - break; - -// INSIDE_STRING * -> INSIDE_STRING -// INSIDE_STRING '"' -> PROP_FINISHED - case TC_INSIDE_STRING: - switch ( cDelim ) - { - case '\"': - { - aState = TC_PROP_FINISHED; - aValue += aPortion; - if ( aProperties.find( aName ) == aProperties.end() ) - { - if ( !IsPropertyValueValid( aName, aValue ) ) - { - rErrorList.AddError( 25, ByteString("Property '").Append(aName).Append("' has invalid value '").Append(ByteString( aValue, RTL_TEXTENCODING_UTF8 )).Append("' "), *this ); - bIsBroken = TRUE; - } - aProperties[ aName ] = aValue; - } - else - { - rErrorList.AddError( 25, ByteString("Property '").Append(aName).Append("' defined twice "), *this ); - bIsBroken = TRUE; - } - } - break; - default: - { - aState = TC_INSIDE_STRING; - aValue += aPortion; - aValue += cDelim; - } - } - break; - -// PROP_FINISHED ' ' -> HAS_TAG_NAME -// PROP_FINISHED '/' -> CLOSED -// PROP_FINISHED '>' -> FINISHED - case TC_PROP_FINISHED: - switch ( cDelim ) - { - case ' ': aState = TC_HAS_TAG_NAME; - bCheckEmpty = TRUE; - break; - case '/': aState = TC_CLOSED; - bCheckEmpty = TRUE; - break; - case '>': aState = TC_FINISHED; - bCheckEmpty = TRUE; - break; - default: aState = TC_ERROR; - } - break; - -// CLOSED ' ' -> CLOSED_SPACE -// CLOSED '>' -> FINISHED - case TC_CLOSED: - switch ( cDelim ) - { - case ' ': aState = TC_CLOSED_SPACE; - bCheckEmpty = TRUE; - bClosed = TRUE; - break; - case '>': aState = TC_FINISHED; - bCheckEmpty = TRUE; - break; - default: aState = TC_ERROR; - } - break; - -// CLOSED_SPACE '>' -> FINISHED - case TC_CLOSED_SPACE: - switch ( cDelim ) - { - case '>': aState = TC_FINISHED; - bCheckEmpty = TRUE; - break; - default: aState = TC_ERROR; - } - break; - -// CLOSETAG ' ' -> CLOSETAG_HAS_TAG_NAME -// CLOSETAG '>' -> FINISHED - case TC_CLOSETAG: - bCloseTag = TRUE; - switch ( cDelim ) - { - case ' ': aState = TC_CLOSETAG_HAS_TAG_NAME; - aTagName = aPortion; - bCheckName = TRUE; - break; - case '>': aState = TC_FINISHED; - aTagName = aPortion; - bCheckName = TRUE; - break; - default: aState = TC_ERROR; - } - break; - -// CLOSETAG_HAS_TAG_NAME '>' -> FINISHED - case TC_CLOSETAG_HAS_TAG_NAME: - switch ( cDelim ) - { - case '>': aState = TC_FINISHED; - bCheckEmpty = TRUE; - break; - default: aState = TC_ERROR; - } - break; - - - default: rErrorList.AddError( 99, "Internal error Parsing Tag ", *this ); - bIsBroken = TRUE; - - } - - if ( bCheckName ) - { - if ( aPortion.Len() == 0 ) - { - rErrorList.AddError( 25, "Tag/Property name missing ", *this ); - bIsBroken = TRUE; - } - else - { - aName = ByteString( aPortion, RTL_TEXTENCODING_UTF8 ); - // "a-zA-Z_-.0-9" - xub_StrLen nCount; - BOOL bBroken = FALSE; - const sal_Char* aBuf = aName.GetBuffer(); - for ( nCount = 0 ; !bBroken && nCount < aName.Len() ; nCount++ ) - { - bBroken = ! ( ( aBuf[nCount] >= 'a' && aBuf[nCount] <= 'z' ) - ||( aBuf[nCount] >= 'A' && aBuf[nCount] <= 'Z' ) - ||( aBuf[nCount] >= '0' && aBuf[nCount] <= '9' ) - ||( aBuf[nCount] == '_' ) - ||( aBuf[nCount] == '-' ) - ||( aBuf[nCount] == '.' ) - ); - } - - if ( bBroken ) - { - rErrorList.AddError( 25, "Found illegal character in Tag/Property name ", *this ); - bIsBroken = TRUE; - } - } - - bCheckName = FALSE; - } - - if ( bCheckEmpty ) - { - if ( aPortion.Len() ) - { - rErrorList.AddError( 25, ByteString("Found displaced characters '").Append(ByteString( aPortion, RTL_TEXTENCODING_UTF8 )).Append("' in Tag "), *this ); - bIsBroken = TRUE; - } - bCheckEmpty = FALSE; - } - - - nLastPos = nCheckPos; - - // skip further blanks - if ( cDelim == ' ' && aState != TC_INSIDE_STRING ) - while ( nLastPos < aTokenString.Len() && aTokenString.GetChar( nLastPos ) == ' ') - nLastPos++; - - nCheckPos = aTokenString.SearchChar( aDelims.GetBuffer(), nLastPos ); - } - if ( aState != TC_FINISHED ) - { - rErrorList.AddError( 25, "Parsing error in Tag ", *this ); - bIsBroken = TRUE; - } -} - -BOOL TokenInfo::IsPropertyRelevant( const ByteString &aName, const String &aValue ) const -{ - if ( aTagName.EqualsAscii( "alt" ) && aName.Equals( "xml-lang" ) ) - return FALSE; - if ( aTagName.EqualsAscii( "ahelp" ) && aName.Equals( "visibility" ) && aValue.EqualsAscii("visible") ) - return FALSE; - if ( aTagName.EqualsAscii( "image" ) && (aName.Equals( "width" ) || aName.Equals( "height" )) ) - return FALSE; - - return TRUE; -} - -BOOL TokenInfo::IsPropertyValueValid( const ByteString &aName, const String &aValue ) const -{ -/* removed due to i56740 - if ( aTagName.EqualsAscii( "switchinline" ) && aName.Equals( "select" ) ) - { - return aValue.EqualsAscii("sys") || - aValue.EqualsAscii("appl") || - aValue.EqualsAscii("distrib"); - } */ - if ( aTagName.EqualsAscii( "caseinline" ) && aName.Equals( "select" ) ) - { - return /*!aValue.EqualsAscii("OS2") && removed due to i56740 */ - !aValue.EqualsAscii(""); - } - - // we don't know any better so we assume it to be OK - return TRUE; -} - -BOOL TokenInfo::IsPropertyInvariant( const ByteString &aName, const String &aValue ) const -{ - if ( aTagName.EqualsAscii( "link" ) && aName.Equals( "name" ) ) - return FALSE; - if ( aTagName.EqualsAscii( "link" ) && aName.Equals( "href" ) ) - { // check for external reference - if ( aValue.Copy( 0, 5 ).EqualsIgnoreCaseAscii( "http:" ) - || aValue.Copy( 0, 6 ).EqualsIgnoreCaseAscii( "https:" ) - || aValue.Copy( 0, 4 ).EqualsIgnoreCaseAscii( "ftp:" ) ) - return FALSE; - else - return TRUE; - } - return TRUE; -} - -BOOL TokenInfo::IsPropertyFixable( const ByteString &aName ) const -{ - // name everything that is allowed to be fixed automatically here - if ( (aTagName.EqualsAscii( "ahelp" ) && aName.Equals( "hid" )) - || (aTagName.EqualsAscii( "link" ) && aName.Equals( "href" )) - || (aTagName.EqualsAscii( "alt" ) && aName.Equals( "id" )) - || (aTagName.EqualsAscii( "variable" ) && aName.Equals( "id" )) - || (aTagName.EqualsAscii( "image" ) && aName.Equals( "src" )) - || (aTagName.EqualsAscii( "image" ) && aName.Equals( "id" ) )) - return TRUE; - return FALSE; -} - -BOOL TokenInfo::MatchesTranslation( TokenInfo& rInfo, BOOL bGenErrors, ParserMessageList &rErrorList, BOOL bFixTags ) const -{ - // check if tags are equal - // check if all existing properties are in the translation as well and - // wether they have a matching content (the same in most cases) - - if ( nId != rInfo.nId ) - return FALSE; - - if ( !aTagName.Equals( rInfo.aTagName ) ) - return FALSE; - - // If one of the tags has formating errors already it does make no sense to check here, so return right away - if ( bGenErrors && ( bIsBroken || rInfo.bIsBroken ) ) - return TRUE; - - StringHashMap::const_iterator iProp; - for( iProp = aProperties.begin() ; iProp != aProperties.end(); ++iProp ) - { - if ( rInfo.aProperties.find( iProp->first ) != rInfo.aProperties.end() ) - { - if ( IsPropertyRelevant( iProp->first, iProp->second ) || IsPropertyRelevant( iProp->first, rInfo.aProperties.find( iProp->first )->second ) ) - { - if ( IsPropertyInvariant( iProp->first, iProp->second ) ) - { - if ( !rInfo.aProperties.find( iProp->first )->second.Equals( iProp->second ) ) - { - if ( bGenErrors ) - { - if ( bFixTags && IsPropertyFixable( iProp->first ) ) - { - rInfo.aProperties.find( iProp->first )->second = iProp->second; - rInfo.SetHasBeenFixed(); - rErrorList.AddWarning( 25, ByteString("Property '").Append(iProp->first).Append("': FIXED different value in Translation "), *this ); - } - else - rErrorList.AddError( 25, ByteString("Property '").Append(iProp->first).Append("': value different in Translation "), *this ); - } - else return FALSE; - } - } - } - } - else - { - if ( IsPropertyRelevant( iProp->first, iProp->second ) ) - { - if ( bGenErrors ) - rErrorList.AddError( 25, ByteString("Property '").Append(iProp->first).Append("' missing in Translation "), *this ); - else return FALSE; - } - } - } - for( iProp = rInfo.aProperties.begin() ; iProp != rInfo.aProperties.end(); ++iProp ) - { - if ( aProperties.find( iProp->first ) == aProperties.end() ) - { - if ( IsPropertyRelevant( iProp->first, iProp->second ) ) - { - if ( bGenErrors ) - rErrorList.AddError( 25, ByteString("Extra Property '").Append(iProp->first).Append("' in Translation "), rInfo ); - else return FALSE; - } - } - } - - // if we reach here eather - // the tags match completely or - // the tags match but not the properties and we generated errors for that - return TRUE; -} - -String TokenInfo::GetTagName() const -{ - return aTagName; -} - -String TokenInfo::MakeTag() const -{ - String aRet; - aRet.AppendAscii("\\<"); - if ( bCloseTag ) - aRet.AppendAscii("/"); - aRet.Append( GetTagName() ); - StringHashMap::const_iterator iProp; - - for( iProp = aProperties.begin() ; iProp != aProperties.end(); ++iProp ) - { - aRet.AppendAscii(" "); - aRet.Append( String( iProp->first, RTL_TEXTENCODING_UTF8 ) ); - aRet.AppendAscii("=\\\""); - aRet.Append( iProp->second ); - aRet.AppendAscii("\\\""); - } - if ( bClosed ) - aRet.AppendAscii("/"); - aRet.AppendAscii("\\>"); - return aRet; -} - - -void ParserMessageList::AddError( USHORT nErrorNr, ByteString aErrorText, const TokenInfo &rTag ) -{ - Insert( new ParserError( nErrorNr, aErrorText, rTag ), LIST_APPEND ); -} - -void ParserMessageList::AddWarning( USHORT nErrorNr, ByteString aErrorText, const TokenInfo &rTag ) -{ - Insert( new ParserWarning( nErrorNr, aErrorText, rTag ), LIST_APPEND ); -} - -BOOL ParserMessageList::HasErrors() -{ - USHORT i; - for ( i=0 ; i < Count() ; i++ ) - if ( GetObject( i )->IsError() ) - return TRUE; - return FALSE; -} - -struct Tag -{ - String GetName() const { return String::CreateFromAscii( pName ); }; - const char* pName; - TokenId nTag; -}; - - -static const Tag aKnownTags[] = -{ -/* commenting oldstyle tags -// { "<#GROUP_FORMAT>", TAG_GROUP_FORMAT }, - { "<#BOLD>", TAG_BOLDON }, - { "<#/BOLD>", TAG_BOLDOFF }, - { "<#ITALIC>", TAG_ITALICON }, - { "<#/ITALIC>", TAG_ITALICOFF }, - { "<#UNDER>", TAG_UNDERLINEON }, - { "<#/UNDER>", TAG_UNDERLINEOFF }, - -// { "<#GROUP_NOTALLOWED>", TAG_GROUP_NOTALLOWED }, - { "<#HELPID>", TAG_HELPID }, - { "<#MODIFY>", TAG_MODIFY }, - { "<#REFNR>", TAG_REFNR }, - -// { "<#GROUP_STRUCTURE>", TAG_GROUP_STRUCTURE }, - { "<#NAME>", TAG_NAME }, - { "<#HREF>", TAG_HREF }, - { "<#AVIS>", TAG_AVIS }, - { "<#AHID>", TAG_AHID }, - { "<#AEND>", TAG_AEND }, - - { "<#TITEL>", TAG_TITEL }, - { "<#KEY>", TAG_KEY }, - { "<#INDEX>", TAG_INDEX }, - - { "<#REFSTART>", TAG_REFSTART }, - - { "<#GRAPHIC>", TAG_GRAPHIC }, - { "<#NEXTVERSION>", TAG_NEXTVERSION }, - - // { "<#GROUP_SYSSWITCH>", TAG_GROUP_SYSSWITCH }, - { "<#WIN>", TAG_WIN }, - { "<#UNIX>", TAG_UNIX }, - { "<#MAC>", TAG_MAC }, - { "<#OS2>", TAG_OS2 }, - -// { "<#GROUP_PROGSWITCH>", TAG_GROUP_PROGSWITCH }, - { "<#WRITER>", TAG_WRITER }, - { "<#CALC>", TAG_CALC }, - { "<#DRAW>", TAG_DRAW }, - { "<#IMPRESS>", TAG_IMPRESS }, - { "<#SCHEDULE>", TAG_SCHEDULE }, - { "<#IMAGE>", TAG_IMAGE }, - { "<#MATH>", TAG_MATH }, - { "<#CHART>", TAG_CHART }, - { "<#OFFICE>", TAG_OFFICE }, - */ -// { "<#TAG_GROUP_META>", TAG_GROUP_META }, - { "$[officefullname]", TAG_OFFICEFULLNAME }, - { "$[officename]", TAG_OFFICENAME }, - { "$[officepath]", TAG_OFFICEPATH }, - { "$[officeversion]", TAG_OFFICEVERSION }, - { "$[portalname]", TAG_PORTALNAME }, - { "$[portalfullname]", TAG_PORTALFULLNAME }, - { "$[portalpath]", TAG_PORTALPATH }, - { "$[portalversion]", TAG_PORTALVERSION }, - { "$[portalshortname]", TAG_PORTALSHORTNAME }, -/* commenting oldstyle tags -// { "<#TAG_GROUP_SINGLE>", TAG_GROUP_SINGLE }, - { "<#REFINSERT>", TAG_REFINSERT }, - -// { "<#GROUP_MULTI>", TAG_GROUP_MULTI }, - { "<#END>", TAG_END }, - { "<#ELSE>", TAG_ELSE }, - { "<#VERSIONEND>", TAG_VERSIONEND }, - { "<#ENDGRAPHIC>", TAG_ENDGRAPHIC },*/ - { "", TAG_COMMONSTART }, - { "", TAG_COMMONEND }, - - { "", TAG_NOMORETAGS }, - { "", TAG_UNKNOWN_TAG }, -}; - - -SimpleParser::SimpleParser() -: nPos( 0 ) -, aNextTag( TAG_NOMORETAGS, TOK_INVALIDPOS ) -{ -} - -void SimpleParser::Parse( String PaSource ) -{ - aSource = PaSource; - nPos = 0; - aLastToken.Erase(); - aNextTag = TokenInfo( TAG_NOMORETAGS, TOK_INVALIDPOS ); - aTokenList.Clear(); -}; - -TokenInfo SimpleParser::GetNextToken( ParserMessageList &rErrorList ) -{ - TokenInfo aResult; - USHORT nTokenStartPos = 0; - if ( aNextTag.nId != TAG_NOMORETAGS ) - { - aResult = aNextTag; - aNextTag = TokenInfo( TAG_NOMORETAGS, TOK_INVALIDPOS ); - } - else - { - aLastToken = GetNextTokenString( rErrorList, nTokenStartPos ); - if ( aLastToken.Len() == 0 ) - return TokenInfo( TAG_NOMORETAGS, TOK_INVALIDPOS ); - - // do we have a \< ... \> style tag? - if ( aLastToken.Copy(0,2).EqualsAscii( "\\<" ) ) - { - // check for paired \" \" - bool bEven = true; - USHORT nQuotePos = 0; - USHORT nQuotedQuotesPos = aLastToken.SearchAscii( "\\\"" ); - USHORT nQuotedBackPos = aLastToken.SearchAscii( "\\\\" ); // this is only to kick out quoted backslashes - while ( nQuotedQuotesPos != STRING_NOTFOUND ) - { - if ( nQuotedBackPos <= nQuotedQuotesPos ) - nQuotePos = nQuotedBackPos+2; - else - { - nQuotePos = nQuotedQuotesPos+2; - bEven = !bEven; - } - nQuotedQuotesPos = aLastToken.SearchAscii( "\\\"", nQuotePos ); - nQuotedBackPos = aLastToken.SearchAscii( "\\\\", nQuotePos ); // this is only to kick out quoted backslashes - } - if ( !bEven ) - { - rErrorList.AddError( 24, "Missing quotes ( \\\" ) in Tag", TokenInfo( TAG_UNKNOWN_TAG, nTokenStartPos, aLastToken ) ); - } - - // check if we have an end-tag or a start-tag - USHORT nNonBlankStartPos,nNonBlankEndPos; - nNonBlankStartPos = 2; - while ( aLastToken.GetChar(nNonBlankStartPos) == ' ' ) - nNonBlankStartPos++; - if ( aLastToken.GetChar(nNonBlankStartPos) == '/' ) - aResult = TokenInfo( TAG_COMMONEND, nTokenStartPos, aLastToken, rErrorList ); - else - { - aResult = TokenInfo( TAG_COMMONSTART, nTokenStartPos, aLastToken, rErrorList ); - nNonBlankEndPos = aLastToken.Len() -3; - while ( aLastToken.GetChar(nNonBlankEndPos) == ' ' ) - nNonBlankEndPos--; - if ( aLastToken.GetChar( nNonBlankEndPos ) == '/' ) - aNextTag = TokenInfo( TAG_COMMONEND, nTokenStartPos, String::CreateFromAscii("\\"), rErrorList ); - } - } - else - { - USHORT i = 0; - while ( aKnownTags[i].nTag != TAG_UNKNOWN_TAG && - aLastToken != aKnownTags[i].GetName() ) - i++; - aResult = TokenInfo( aKnownTags[i].nTag, nTokenStartPos ); - } - } - - if ( aResult.nId == TAG_UNKNOWN_TAG ) - aResult = TokenInfo( TAG_UNKNOWN_TAG, nTokenStartPos, aLastToken ); - aTokenList.Insert( aResult, LIST_APPEND ); - return aResult; -} - -String SimpleParser::GetNextTokenString( ParserMessageList &rErrorList, USHORT &rTagStartPos ) -{ -// USHORT nStyle1StartPos = aSource.SearchAscii( "<#", nPos ); - USHORT nStyle2StartPos = aSource.SearchAscii( "$[", nPos ); - USHORT nStyle3StartPos = aSource.SearchAscii( "\\<", nPos ); - USHORT nStyle4StartPos = aSource.SearchAscii( "\\\\", nPos ); // this is only to kick out quoted backslashes - - rTagStartPos = 0; - -/* removing since a \<... is not likely - // check if the tag starts with a letter to avoid things like <> <= ... > - while ( STRING_NOTFOUND != nStyle3StartPos && !( aSource.Copy( nStyle3StartPos+2, 1 ).IsAlphaAscii() || aSource.GetChar( nStyle3StartPos+2 ) == '/' ) ) - nStyle3StartPos = aSource.SearchAscii( "\\<", nStyle3StartPos+1 ); -*/ - if ( STRING_NOTFOUND == nStyle2StartPos && STRING_NOTFOUND == nStyle3StartPos ) - return String(); // no more tokens - - if ( nStyle4StartPos < nStyle2StartPos && nStyle4StartPos <= nStyle3StartPos ) // <= to make sure \\ is always handled first - { // Skip quoted Backslash - nPos = nStyle4StartPos +2; - return GetNextTokenString( rErrorList, rTagStartPos ); - } - -/* if ( nStyle1StartPos < nStyle2StartPos && nStyle1StartPos <= nStyle3StartPos ) // <= to make sure our spechial tags are recognized before all others - { // test for <# ... > style tokens - USHORT nEndPos = aSource.SearchAscii( ">", nStyle1StartPos ); - if ( nEndPos == STRING_NOTFOUND ) - { // Token is incomplete. Skip start and search for better ones - nPos = nStyle1StartPos +2; - return GetNextTokenString( rErrorList, rTagStartPos ); - } - nPos = nEndPos; - rTagStartPos = nStyle1StartPos; - return aSource.Copy( nStyle1StartPos, nEndPos-nStyle1StartPos +1 ).ToUpperAscii(); - } - else*/ if ( nStyle2StartPos < nStyle3StartPos ) - { // test for $[ ... ] style tokens - USHORT nEndPos = aSource.SearchAscii( "]", nStyle2StartPos); - if ( nEndPos == STRING_NOTFOUND ) - { // Token is incomplete. Skip start and search for better ones - nPos = nStyle2StartPos +2; - return GetNextTokenString( rErrorList, rTagStartPos ); - } - nPos = nEndPos; - rTagStartPos = nStyle2StartPos; - return aSource.Copy( nStyle2StartPos, nEndPos-nStyle2StartPos +1 ); - } - else - { // test for \< ... \> style tokens - USHORT nEndPos = aSource.SearchAscii( "\\>", nStyle3StartPos); - USHORT nQuotedBackPos = aSource.SearchAscii( "\\\\", nStyle3StartPos ); // this is only to kick out quoted backslashes - while ( nQuotedBackPos <= nEndPos && nQuotedBackPos != STRING_NOTFOUND ) - { - nEndPos = aSource.SearchAscii( "\\>", nQuotedBackPos +2); - nQuotedBackPos = aSource.SearchAscii( "\\\\", nQuotedBackPos +2 ); // this is only to kick out quoted backslashes - } - if ( nEndPos == STRING_NOTFOUND ) - { // Token is incomplete. Skip start and search for better ones - nPos = nStyle3StartPos +2; - ByteString sTmp( "Tag Start '\\<' without Tag End '\\>': " ); - rErrorList.AddError( 24, "Tag Start '\\<' without Tag End '\\>'", TokenInfo( TAG_UNKNOWN_TAG, nStyle3StartPos, aSource.Copy( nStyle3StartPos-10, 20 ) ) ); - return GetNextTokenString( rErrorList, rTagStartPos ); - } - // check for paired quoted " --> \"sometext\" - - nPos = nEndPos; - rTagStartPos = nStyle3StartPos; - return aSource.Copy( nStyle3StartPos, nEndPos-nStyle3StartPos +2 ); - } -} - -String SimpleParser::GetLexem( TokenInfo const &aToken ) -{ - if ( aToken.aTokenString.Len() ) - return aToken.aTokenString; - else - { - USHORT i = 0; - while ( aKnownTags[i].nTag != TAG_UNKNOWN_TAG && - aKnownTags[i].nTag != aToken.nId ) - i++; - - return aKnownTags[i].GetName(); - } -} - -TokenParser::TokenParser() -: pErrorList( NULL ) -{} - -void TokenParser::Parse( const String &aCode, ParserMessageList* pList ) -{ - pErrorList = pList; - - //Scanner initialisieren - aParser.Parse( aCode ); - - //erstes Symbol holen - aTag = aParser.GetNextToken( *pErrorList ); - - nPfCaseOptions = 0; - nAppCaseOptions = 0; - bPfCaseActive = FALSE; - bAppCaseActive = FALSE; - - nActiveRefTypes = 0; - - //Ausfuehren der Start-Produktion - Paragraph(); - - //Es wurde nicht die ganze Kette abgearbeitet, bisher ist aber - //kein Fehler aufgetreten - //=> es wurde ein einleitendes Tag vergessen - if ( aTag.nId != TAG_NOMORETAGS ) - { - switch ( aTag.nId ) - { - case TAG_END: - { - ParseError( 3, "Extra Tag <#END>. Switch or <#HREF> expected.", aTag ); - } - break; - case TAG_BOLDOFF: - { - ParseError( 4, "<#BOLD> expected before <#/BOLD>.", aTag ); - } - break; - case TAG_ITALICOFF: - { - ParseError( 5, "<#ITALIC> expected before <#/ITALIC>.", aTag ); - } - break; - case TAG_UNDERLINEOFF: - { - ParseError( 17, "<#UNDER> expected before <#/UNDER>.", aTag ); - } - break; -/* case TAG_MISSPARENTHESIS: - { - ParseError( 14, "missing closing parenthesis '>'", aTag ); - } - break;*/ - case TAG_AEND: - { - ParseError( 5, "Extra Tag <#AEND>. <#AVIS> or <#AHID> expected.", aTag ); - } - break; - case TAG_ELSE: - { - ParseError( 16, "Application-tag or platform-tag expected before <#ELSE>.", aTag ); - } - break; - case TAG_UNKNOWN_TAG: - { - ParseError( 6, "unknown Tag", aTag ); - } - break; - default: - { - ParseError( 6, "unexpected Tag", aTag ); - } - } - } - pErrorList = NULL; -} - -void TokenParser::Paragraph() -{ - switch ( aTag.nId ) - { - case TAG_GRAPHIC: - case TAG_NEXTVERSION: - { - TagRef(); - Paragraph(); - } - break; - case TAG_AVIS: - case TAG_AHID: - { - TagRef(); - Paragraph(); - } - break; - case TAG_HELPID: - { - SimpleTag(); - Paragraph(); - } - break; - case TAG_OFFICEFULLNAME: - case TAG_OFFICENAME: - case TAG_OFFICEPATH: - case TAG_OFFICEVERSION: - case TAG_PORTALNAME: - case TAG_PORTALFULLNAME: - case TAG_PORTALPATH: - case TAG_PORTALVERSION: - case TAG_PORTALSHORTNAME: - { - SimpleTag(); - Paragraph(); - } - break; - case TAG_REFINSERT: - { - SimpleTag(); - Paragraph(); - } - break; - case TAG_BOLDON: - case TAG_ITALICON: - case TAG_UNDERLINEON: - case TAG_COMMONSTART: - { - TagPair(); - Paragraph(); - } - break; - case TAG_HREF: - case TAG_NAME: - case TAG_KEY: - case TAG_INDEX: - case TAG_TITEL: - case TAG_REFSTART: - { - TagRef(); - Paragraph(); - } - break; - case TAG_OS2: - case TAG_WIN: - case TAG_UNIX: - case TAG_MAC: //... - { - if ( ! bPfCaseActive ) - { - //PfCases duerfen nicht verschachtelt sein: - bPfCaseActive = TRUE; - PfCase(); - - //So jetzt kann wieder ein PfCase kommen: - bPfCaseActive = FALSE; - Paragraph(); - } - } - break; - case TAG_WRITER: - case TAG_CALC: - case TAG_DRAW: - case TAG_IMPRESS: - case TAG_SCHEDULE: - case TAG_IMAGE: - case TAG_MATH: - case TAG_CHART: - case TAG_OFFICE: - { - if ( !bAppCaseActive ) - { - //AppCases duerfen nicht verschachtelt sein: - bAppCaseActive = TRUE; - AppCase(); - - //jetzt koennen wieder AppCases kommen: - bAppCaseActive = FALSE; - Paragraph(); - } - } - break; - - //Case TAG_BOLDOFF, TAG_ITALICOFF, TAG_BUNDERLINE, TAG_END - //nichts tun wg. epsilon-Prod. - } -} - -void TokenParser::PfCase() -{ - - //Produktion: - //PfCase -> PfCaseBegin Paragraph (PfCase | PfCaseEnd) - - PfCaseBegin(); - - //Jetzt ist eine PfCase-Produktion aktiv: - Paragraph(); - switch ( aTag.nId ) - { - case TAG_ELSE: - case TAG_END: - { - CaseEnd(); - } - break; - case TAG_OS2: - case TAG_WIN: - case TAG_UNIX: - case TAG_MAC: //First (PfBegin) - { - PfCase(); - } - break; - default: - ParseError( 8, "<#ELSE> or <#END> or platform-tag expected.", aTag ); - } - //Die gemerkten Tags wieder loeschen fuer naechstes PfCase: - nPfCaseOptions = 0; -} - -void TokenParser::PfCaseBegin() -{ - switch ( aTag.nId ) - { - case TAG_OS2: - case TAG_WIN: - case TAG_UNIX: - case TAG_MAC: - { - //Token darf noch nicht vorgekommen sein im - //aktuellen Plattform-Case: - if ( !HAS_FLAG( nPfCaseOptions, TAG_NOGROUP( aTag.nId ) ) ) - { - SET_FLAG( nPfCaseOptions, TAG_NOGROUP( aTag.nId ) ); - match( aTag, aTag ); - } - else { - ParseError( 9, "Tag defined twice in the same platform-case", aTag ); - } - } - } -} - -void TokenParser::AppCase() -{ - - //Produktion: - //AppCase -> AppCaseBegin Paragraph (AppCase | AppCaseEnd) - - - AppCaseBegin(); - - Paragraph(); - - switch ( aTag.nId ) - { - case TAG_ELSE: - case TAG_END: - { - CaseEnd(); - } - break; - case TAG_WRITER: - case TAG_DRAW: - case TAG_CALC: - case TAG_IMAGE: - case TAG_MATH: - case TAG_CHART: - case TAG_OFFICE: - case TAG_IMPRESS: - case TAG_SCHEDULE: //First (AppBegin) - { - AppCase(); - } - break; - default: - ParseError( 1, "<#ELSE> or <#END> or application-case-tag expected.", aTag ); - } - - //Die gemerkten Tags wieder loeschen fuer naechstes AppCase: - nAppCaseOptions = 0; -} - -void TokenParser::AppCaseBegin() -{ - switch ( aTag.nId ) - { - case TAG_WRITER: - case TAG_DRAW: - case TAG_CALC: - case TAG_IMAGE: - case TAG_MATH: - case TAG_CHART: - case TAG_OFFICE: - case TAG_IMPRESS: - case TAG_SCHEDULE: - { - //Token darf noch nicht vorgekommen sein im - //aktuellen Plattform-Case: - if ( !HAS_FLAG( nAppCaseOptions, TAG_NOGROUP( aTag.nId ) ) ) - { - SET_FLAG( nAppCaseOptions, TAG_NOGROUP( aTag.nId ) ); - match( aTag, aTag ); - } - else { - ParseError( 13, "Tag defined twice in the same application-case.", aTag ); - } - } - } -} - -void TokenParser::CaseEnd() -{ - //Produktion: - //CaseEnd -> <#ELSE> Paragraph <#END> | <#END> - - switch ( aTag.nId ) - { - case TAG_ELSE: - { - match( aTag, TAG_ELSE ); - Paragraph(); - match( aTag, TAG_END ); - } - break; - case TAG_END: - { - match( aTag, TAG_END ); - } - break; - default: - ParseError( 2, "<#ELSE> or <#END> expected.", aTag ); - } -} - -void TokenParser::SimpleTag() -{ - - switch ( aTag.nId ) - { - case TAG_HELPID: - { - match( aTag, TAG_HELPID ); - } - break; - case TAG_OFFICEFULLNAME: - case TAG_OFFICENAME: - case TAG_OFFICEPATH: - case TAG_OFFICEVERSION: - case TAG_PORTALNAME: - case TAG_PORTALFULLNAME: - case TAG_PORTALPATH: - case TAG_PORTALVERSION: - case TAG_PORTALSHORTNAME: - - case TAG_REFINSERT: - { - match( aTag, aTag ); - } - break; - default: - ParseError( 15, "[<#SimpleTag>] expected.", aTag ); - } -} - -void TokenParser::TagPair() -{ - switch ( aTag.nId ) - { - case TAG_BOLDON: - { - match( aTag, TAG_BOLDON ); - Paragraph(); - match( aTag, TAG_BOLDOFF ); - } - break; - case TAG_ITALICON: - { - match( aTag, TAG_ITALICON ); - Paragraph(); - match( aTag, TAG_ITALICOFF ); - } - break; - case TAG_UNDERLINEON: - { - match( aTag, TAG_UNDERLINEON ); - Paragraph(); - match( aTag, TAG_UNDERLINEOFF ); - } - break; - case TAG_COMMONSTART: - { - //remember tag so we can give the original tag in case of an error - TokenInfo aEndTag( aTag ); - aEndTag.nId = TAG_COMMONEND; - match( aTag, TAG_COMMONSTART ); - Paragraph(); - match( aTag, aEndTag ); - } - break; - default: - ParseError( 10, "<#BOLD>, <#ITALIC>, <#UNDER> expected.", aTag ); - } -} - - -void TokenParser::TagRef() -{ - switch ( aTag.nId ) - { - case TAG_GRAPHIC: - case TAG_NEXTVERSION: - { - if ( !HAS_FLAG( nActiveRefTypes, TAG_NOGROUP( aTag.nId ) ) ) - { - TokenId aThisToken = aTag.nId; - SET_FLAG( nActiveRefTypes, TAG_NOGROUP( aThisToken ) ); - match( aTag, aTag ); - Paragraph(); - if ( aThisToken == TAG_GRAPHIC ) - match( aTag, TAG_ENDGRAPHIC ); - else - match( aTag, TAG_VERSIONEND ); - // don't reset since alowed only once per paragraph - // RESET_FLAG( nActiveRefTypes, TAG_NOGROUP( aThisToken ) ); - } - else - { - ParseError( 11, "Tags <#GRAPHIC>,<#NEXTVERSION> allowed only once per paragraph at", aTag ); - } - } - break; - case TAG_AVIS: - case TAG_AHID: - { - if ( !HAS_FLAG( nActiveRefTypes, TAG_NOGROUP( aTag.nId ) ) ) - { - TokenId aThisToken = aTag.nId; - SET_FLAG( nActiveRefTypes, TAG_NOGROUP( aThisToken ) ); - match( aTag, aTag ); - Paragraph(); - match( aTag, TAG_AEND ); - RESET_FLAG( nActiveRefTypes, TAG_NOGROUP( aThisToken ) ); - } - else - { - ParseError( 11, "Nested <#AHID>,<#AVIS> not allowed.", aTag ); - } - } - break; - case TAG_HREF: - case TAG_NAME: - { - - } - // NOBREAK - case TAG_KEY: - case TAG_INDEX: - case TAG_TITEL: - case TAG_REFSTART: - { - if ( !HAS_FLAG( nActiveRefTypes, TAG_NOGROUP( aTag.nId ) ) ) - { - TokenId aThisToken = aTag.nId; - match( aTag, aTag ); - if ( aThisToken != TAG_NAME ) - { // TAG_NAME has no TAG_END - SET_FLAG( nActiveRefTypes, TAG_NOGROUP( aThisToken ) ); - Paragraph(); - match( aTag, TAG_END ); - RESET_FLAG( nActiveRefTypes, TAG_NOGROUP( aThisToken ) ); - } - } - else - { - ParseError( 11, "Nested <#HREF>,<#NAME> or <#KEY> not allowed.", aTag ); - } - } - break; - default: - ParseError( 12, "<#HREF>,<#NAME> or <#KEY> expected.", aTag ); - } -} - -BOOL TokenParser::match( const TokenInfo &aCurrentToken, const TokenId &aExpectedToken ) -{ - return match( aCurrentToken, TokenInfo( aExpectedToken, TOK_INVALIDPOS ) ); -} - -BOOL TokenParser::match( const TokenInfo &aCurrentToken, const TokenInfo &rExpectedToken ) -{ - TokenInfo aExpectedToken( rExpectedToken ); - if ( aCurrentToken.nId == aExpectedToken.nId ) - { - if ( ( aCurrentToken.nId == TAG_COMMONEND - && aCurrentToken.GetTagName().Equals( aExpectedToken.GetTagName() ) ) - || aCurrentToken.nId != TAG_COMMONEND ) - { - aTag = aParser.GetNextToken( *pErrorList ); - return TRUE; - } - } - - if ( aExpectedToken.nId == TAG_COMMONEND ) - { - aExpectedToken.aTokenString.Insert( String::CreateFromAscii( "Close tag for " ), 0 ); - } - - ByteString sTmp( "Expected Symbol" ); - if ( aCurrentToken.nId == TAG_NOMORETAGS ) - { - ParseError( 7, sTmp, aExpectedToken ); - } - else - { - sTmp += ": "; - sTmp += ByteString( aParser.GetLexem( aExpectedToken ), RTL_TEXTENCODING_UTF8 ); - sTmp += " near "; - ParseError( 7, sTmp, aCurrentToken ); - } - return FALSE; -} - -void TokenParser::ParseError( USHORT nErrNr, ByteString aErrMsg, const TokenInfo &rTag ) -{ - pErrorList->AddError( nErrNr, aErrMsg, rTag); - - // Das Fehlerhafte Tag ueberspringen - aTag = aParser.GetNextToken( *pErrorList ); -} - - -ParserMessage::ParserMessage( USHORT PnErrorNr, ByteString PaErrorText, const TokenInfo &rTag ) - : nErrorNr( PnErrorNr ) - , aErrorText( PaErrorText ) - , nTagBegin( 0 ) - , nTagLength( 0 ) -{ - String aLexem( SimpleParser::GetLexem( rTag ) ); - aErrorText.Append(": "); - aErrorText += ByteString( aLexem, RTL_TEXTENCODING_UTF8 ); - if ( rTag.nId == TAG_NOMORETAGS ) - aErrorText.Append(" at end of line "); - else if ( rTag.nPos != TOK_INVALIDPOS ) - { - aErrorText.Append(" at Position "); - aErrorText.Append( ByteString::CreateFromInt32( rTag.nPos ) ); - } - nTagBegin = rTag.nPos; - nTagLength = aLexem.Len(); -} - -ParserError::ParserError( USHORT ErrorNr, ByteString ErrorText, const TokenInfo &rTag ) -: ParserMessage( ErrorNr, ErrorText, rTag ) -{} - -ParserWarning::ParserWarning( USHORT ErrorNr, ByteString ErrorText, const TokenInfo &rTag ) -: ParserMessage( ErrorNr, ErrorText, rTag ) -{} - -BOOL LingTest::IsTagMandatory( TokenInfo const &aToken, TokenId &aMetaTokens ) -{ - TokenId aTokenId = aToken.nId; - TokenId aTokenGroup = TAG_GROUP( aTokenId ); - if ( TAG_GROUP_PROGSWITCH == aTokenGroup - || TAG_REFINSERT == aTokenId - || TAG_REFSTART == aTokenId - || TAG_NAME == aTokenId - || TAG_HREF == aTokenId - || TAG_AVIS == aTokenId - || TAG_AHID == aTokenId - || TAG_GRAPHIC == aTokenId - || TAG_NEXTVERSION == aTokenId - || ( TAG_GROUP_META == aTokenGroup && (aMetaTokens & aTokenId) == aTokenId ) ) - { - if ( TAG_GROUP_META == aTokenGroup ) - aMetaTokens |= aTokenId; - return TRUE; - } - else if ( TAG_COMMONSTART == aTokenId - || TAG_COMMONEND == aTokenId ) - { - String aTagName = aToken.GetTagName(); - return !(aTagName.EqualsIgnoreCaseAscii( "comment" ) - || aTagName.EqualsIgnoreCaseAscii( "bookmark_value" ) - || aTagName.EqualsIgnoreCaseAscii( "emph" ) - || aTagName.EqualsIgnoreCaseAscii( "item" ) - || aTagName.EqualsIgnoreCaseAscii( "br" ) ); - } - return FALSE; -} - -void LingTest::CheckTags( TokenList &aReference, TokenList &aTestee, BOOL bFixTags ) -{ - ULONG i=0,j=0; - // Clean old Warnings - while ( aCompareWarningList.Count() ) - { - delete aCompareWarningList.GetCurObject(); - aCompareWarningList.Remove(); - } - - /* in xml tags, do not require the following tags - comment - bookmark_value - emph - item - br - */ - - // filter uninteresting Tags - TokenId aMetaTokens = 0; - for ( i=0 ; i < aReference.Count() ; i++ ) - { - if ( !IsTagMandatory( aReference.GetObject( i ), aMetaTokens ) ) - aReference.GetObject( i ).SetDone(); - } - - aMetaTokens = 0; - for ( i=0 ; i < aTestee.Count() ; i++ ) - { - if ( !IsTagMandatory( aTestee.GetObject( i ), aMetaTokens ) ) - aTestee.GetObject( i ).SetDone(); - } - - // remove all matching tags - for ( i=0 ; i < aReference.Count() ; i++ ) - { - if ( aReference.GetObject( i ).IsDone() ) - continue; - - BOOL bTagFound = FALSE; - for ( j=0 ; j < aTestee.Count() && !bTagFound ; j++ ) - { - if ( aTestee.GetObject( j ).IsDone() ) - continue; - - if ( aReference.GetObject( i ).MatchesTranslation( aTestee.GetObject( j ), FALSE, aCompareWarningList ) ) - { - aReference.GetObject( i ).SetDone(); - aTestee.GetObject( j ).SetDone(); - bTagFound = TRUE; - } - } - } - - BOOL bCanFix = TRUE; - - if ( bFixTags ) - { - // we fix only if its a really simple case - USHORT nTagCount = 0; - for ( i=0 ; i < aReference.Count() ; i++ ) - if ( !aReference.GetObject( i ).IsDone() ) - nTagCount++; - if ( nTagCount > 1 ) - bCanFix = FALSE; - - nTagCount = 0; - for ( i=0 ; i < aTestee.Count() ; i++ ) - if ( !aTestee.GetObject( i ).IsDone() ) - nTagCount++; - if ( nTagCount > 1 ) - bCanFix = FALSE; - } - - // generate errors for tags that have differing attributes - for ( i=0 ; i < aReference.Count() ; i++ ) - { - if ( aReference.GetObject( i ).IsDone() ) - continue; - - BOOL bTagFound = FALSE; - for ( j=0 ; j < aTestee.Count() && !bTagFound ; j++ ) - { - if ( aTestee.GetObject( j ).IsDone() ) - continue; - - if ( aReference.GetObject( i ).MatchesTranslation( aTestee.GetObject( j ), TRUE, aCompareWarningList, bCanFix && bFixTags ) ) - { - aReference.GetObject( i ).SetDone(); - aTestee.GetObject( j ).SetDone(); - bTagFound = TRUE; - } - } - } - - // list remaining tags as errors - for ( i=0 ; i < aReference.Count() ; i++ ) - { - if ( aReference.GetObject( i ).IsDone() ) - continue; - - aCompareWarningList.AddError( 20, "Missing Tag in Translation", aReference.GetObject( i ) ); - } - for ( i=0 ; i < aTestee.Count() ; i++ ) - { - if ( aTestee.GetObject( i ).IsDone() ) - continue; - - aCompareWarningList.AddError( 21, "Extra Tag in Translation", aTestee.GetObject( i ) ); - } - - for ( i=0 ; i < aReference.Count() ; i++ ) - aReference.GetObject( i ).SetDone( FALSE ); - - for ( i=0 ; i < aTestee.Count() ; i++ ) - aTestee.GetObject( i ).SetDone( FALSE ); -} - -void LingTest::CheckReference( GSILine *aReference ) -{ - aReferenceParser.Parse( aReference->GetUText(), aReference->GetMessageList() ); -} - -void LingTest::CheckTestee( GSILine *aTestee, BOOL bHasSourceLine, BOOL bFixTags ) -{ - aFixedTestee = aTestee->GetUText(); - aTesteeParser.Parse( aFixedTestee, aTestee->GetMessageList() ); - - if ( bHasSourceLine ) - CheckTags( aReferenceParser.GetTokenList(), aTesteeParser.GetTokenList(), bFixTags ); - - if ( bFixTags ) - { - TokenList& aTesteeTokens = aTesteeParser.GetTokenList(); - BOOL bFixesDone = FALSE; - // count backwards to allow replacing from right to left - int i; - for ( i=aTesteeTokens.Count()-1 ; i>=0 ; i-- ) - { - if ( aTesteeTokens.GetObject( i ).HasBeenFixed() ) - { - bFixesDone = TRUE; - aFixedTestee.Replace( aTesteeTokens.GetObject( i ).nPos, aTesteeTokens.GetObject( i ).aTokenString.Len(), aTesteeTokens.GetObject( i ).MakeTag() ); - } - } - if ( bFixesDone ) - { - aTestee->SetUText( aFixedTestee ); - aTestee->SetFixed(); - } - } -} - diff --git a/transex3/source/treeconfig.cxx b/transex3/source/treeconfig.cxx deleted file mode 100644 index 137492c39a50..000000000000 --- a/transex3/source/treeconfig.cxx +++ /dev/null @@ -1,128 +0,0 @@ -#include -#include -#include -#include "treeconfig.hxx" -#include "export.hxx" -#ifdef WNT -#include -#include -#else -#include -#endif -#include -#include -#include -#include - -using namespace std; - -namespace transex3 -{ - -bool Treeconfig::parseConfig(){ - - string source_config_file = string( static_cast( Export::GetEnv("SOURCE_ROOT_DIR") ).GetBuffer() ); - if( source_config_file.empty() ) - { - cerr << "Error: no suitable environment set?!?"; - exit( -1 ); - } - source_config_file += string("/source_config"); - if( isConfigFilePresent() ) - { - inireader.read( map , source_config_file ); - return true; - } - else return false; -} - -// ALWAYS add all repositories from source_config file to the container active_repos -// if a config_file is present ALWAYS return false -// if you are in the root of a repository also add it to the container active_repos -// if you are far inside a repository /my/path/ooo/sw/source then don't add it to the container but return true -// if you are in some misc place like /tmp then return true -// => the application can decide what to do in case the function returns true thus how to handle pwd() path -bool Treeconfig::getActiveRepositories( vector& active_repos ){ - - bool isPresent = isConfigFilePresent(); - bool hasPath = false; - string pwd; - string guessedRepo; - Export::getCurrentDir( pwd ); - string source_root = Export::GetEnv( "SOURCE_ROOT_DIR" ); - string solarsrc = Export::GetEnv( "SOLARSRC" ); - string partial; - - // if we are inside of a repository root then active it otherwise let the app handle the return! - string::size_type pos = pwd.find_first_of( source_root ); - if( pos != string::npos && ( pos + source_root.length() +1 ) < pwd.length()){ // I am within SOURCE_ROOT_DIR - partial = pwd.substr( pos + source_root.length() +1 , pwd.length()); - string::size_type nextPart = partial.find_first_of( "/" ); - if( nextPart != string::npos ) - hasPath = true; - else - guessedRepo = partial; - } - else // I am NOT within SOURCE_ROOT_DIR - hasPath = true; - - if( isPresent ) - { - hasPath = false; // if config_file is present don't care about pwd - stringmap* repos = static_cast( map[ string("repositories") ] ); - if( repos != 0 ) - { - for( stringmap::iterator iter = repos->begin() ; iter != repos->end() ; ++iter ) - { - if( static_cast( iter->second ) == string( "active" ) ) - { - active_repos.push_back( iter->first ); - if( static_cast( iter->first ) == guessedRepo ) - { - guessedRepo.clear(); // don't add double in case it is present in config_file - } - } - } - } - else - { - cerr << "Error: source_config files doesn't contain a 'repositories' section ?!?"; - exit( -1 ); - } - } - if( !guessedRepo.empty() ){ - active_repos.push_back( guessedRepo ); // add myrepo - } - return hasPath; // are we deep inside of a source tree or outside of SOURCE_ROOT_DIR? -} - -void Treeconfig::getCurrentDir( string& dir ) -{ - char buffer[64000]; - if( getcwd( buffer , sizeof( buffer ) ) == 0 ){ - cerr << "Error: getcwd failed!\n"; - exit( -1 ); - } - dir = string( buffer ); -} - -bool Treeconfig::isConfigFilePresent() -{ - string config_file = Export::GetEnv( "SOURCE_ROOT_DIR" ); - config_file += "/source_config"; - - struct stat status; - if( stat( config_file.c_str() , &status ) < 0 ) - { - return false; - } -#ifdef WNT - return ( status.st_mode & _S_IFREG ) && ( _access( config_file.c_str() , 4 ) >= 0 ) ; -#else - return ( status.st_mode & S_IFREG ) && ( access( config_file.c_str() , R_OK ) >= 0 ) ; -#endif -} - - - -} diff --git a/transex3/source/utf8conv.cxx b/transex3/source/utf8conv.cxx deleted file mode 100644 index 8fc61f9bb5cc..000000000000 --- a/transex3/source/utf8conv.cxx +++ /dev/null @@ -1,77 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: utf8conv.cxx,v $ - * $Revision: 1.4 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_transex3.hxx" -#include "utf8conv.hxx" - -// -// class UTF8Converter -// - -#define MAX_CONV_BUFFER_SIZE 0xFF00 - -#define TO_CVTFLAGS (RTL_TEXTTOUNICODE_FLAGS_UNDEFINED_MAPTOPRIVATE |\ - RTL_TEXTTOUNICODE_FLAGS_MBUNDEFINED_DEFAULT |\ - RTL_TEXTTOUNICODE_FLAGS_INVALID_DEFAULT) - -#define FROM_CVTFLAGS (RTL_UNICODETOTEXT_FLAGS_UNDEFINED_DEFAULT |\ - RTL_UNICODETOTEXT_FLAGS_INVALID_DEFAULT |\ - RTL_UNICODETOTEXT_FLAGS_UNDEFINED_REPLACE |\ - RTL_UNICODETOTEXT_FLAGS_PRIVATE_MAPTO0) - -/*****************************************************************************/ -void UTF8Converter::Convert( ByteString &rBuffer, - rtl_TextEncoding nSourceENC, rtl_TextEncoding nDestENC ) -/*****************************************************************************/ -{ - String sTemp( rBuffer, nSourceENC ); - rBuffer = ByteString( sTemp, nDestENC ); -} - -/*****************************************************************************/ -ByteString UTF8Converter::ConvertToUTF8( - const ByteString &rASCII, rtl_TextEncoding nEncoding ) -/*****************************************************************************/ -{ - ByteString sReturn( rASCII ); - Convert( sReturn, nEncoding, RTL_TEXTENCODING_UTF8 ); - return sReturn; -} - -/*****************************************************************************/ -ByteString UTF8Converter::ConvertFromUTF8( - const ByteString &rUTF8, rtl_TextEncoding nEncoding ) -/*****************************************************************************/ -{ - ByteString sReturn( rUTF8 ); - Convert( sReturn, RTL_TEXTENCODING_UTF8, nEncoding ); - return sReturn; -} diff --git a/transex3/source/wrdtrans.cxx b/transex3/source/wrdtrans.cxx deleted file mode 100644 index 71866cd0e618..000000000000 --- a/transex3/source/wrdtrans.cxx +++ /dev/null @@ -1,248 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: wrdtrans.cxx,v $ - * $Revision: 1.7 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_transex3.hxx" - -/* -#include "wrdtrans.hxx" - - -// NOT FULLY DECLARED SERVICES -#include -#include - - -#include -#include "wtratree.hxx" - -#include -*/ -//************** Declaration WordTrans_ErrorList ******************// -/* -typedef NAMESPACE_STD(vector) Stl_ByteStringList; - -class WordTrans_ErrorList -{ - public: - // OPERATIONS - void AddError( - WordTransformer::E_Error - i_eType, - const char * i_sErrorDescription ); - void Clear(); /// Empties the list. - - // INQUIRY - USHORT NrOfErrors() const; - WordTransformer::E_Error - GetError( - USHORT i_nNr, /// [0 .. NrOfErrors()-1], other values return an empty error. - ByteString * o_pErrorText ) const; /// If o_pErrorText != 0, the String is filled with the description of the error. - private: - // DATA - Stl_ByteStringList aErrors; -}; - -*/ - -//************** Implementation WordTransformer ******************// - -/* -WordTransformer::WordTransformer() - : dpTransformer(0), - dpErrors(new WordTrans_ErrorList) -{ -} - -WordTransformer::~WordTransformer() -{ - if (dpTransformer != 0) - delete dpTransformer; - delete dpErrors; -} - -BOOL -WordTransformer::LoadWordlist( const ByteString & i_sWordlist_Filepath, - CharSet i_nWorkingCharSet, - CharSet i_nFileCharSet ) -{ - if (dpTransformer != 0) - return FALSE; - - SvFileStream aFile(String(i_sWordlist_Filepath,RTL_TEXTENCODING_ASCII_US),STREAM_STD_READ); - if (! aFile.IsOpen()) - return FALSE; - aFile.SetStreamCharSet( i_nFileCharSet ) ; -// aFile.SetTargetCharSet( i_nWorkingCharSet ); - - dpTransformer = new WordTransTree; - - ByteString sTrans; - while ( aFile.ReadLine(sTrans) ) - { - dpTransformer->AddWordPair(sTrans.GetToken(0,';'),sTrans.GetToken(1,';')); - } - - aFile.Close(); - return TRUE; -} - -USHORT -WordTransformer::Transform(ByteString & io_sText) -{ - // Initialization and precondition testing: - dpErrors->Clear(); - if (dpTransformer == 0) - { - dpErrors->AddError(ERROR_NO_WORDLIST,"Error: No wordlist was loaded."); - return dpErrors->NrOfErrors(); - } - else if (io_sText.Len() > 63 * 1024) - { - dpErrors->AddError(ERROR_OUTPUTSTRING_TOO_LONG,"Error: Inputstring was too long (bigger than 63 KB)."); - return dpErrors->NrOfErrors(); - } - else if (io_sText.Len() == 0) - { - return 0; - } - - // Transform: - dpTransformer->InitTransformation( - io_sText.GetBuffer(), - io_sText.Len() ); - - for ( ; !dpTransformer->TextEndReached(); ) - { - if (dpTransformer->TransformNextToken() != WordTransTree::OK) - { - CreateError(); - } - } - io_sText = dpTransformer->Output(); - return dpErrors->NrOfErrors(); -} - -USHORT -WordTransformer::NrOfErrors() const -{ - return dpErrors->NrOfErrors(); -} - -WordTransformer::E_Error -WordTransformer::GetError( USHORT i_nNr, - ByteString * o_pErrorText) const -{ - return dpErrors->GetError(i_nNr,o_pErrorText); -} - -void -WordTransformer::CreateError() -{ - ByteString sErr; - - switch (dpTransformer->CurResult()) - { - case WordTransTree::OK: - break; - case WordTransTree::HOTKEY_LOST: - sErr = ByteString("Error: By replacement of string "); - sErr += dpTransformer->CurReplacedString(); - sErr += " by "; - sErr += dpTransformer->CurReplacingString(); - sErr += "the hotkey at char '"; - sErr += dpTransformer->CurHotkey(); - sErr += "' was lost."; - dpErrors->AddError( ERROR_HOTKEY,sErr.GetBufferAccess()); - sErr.ReleaseBufferAccess(); - break; - case WordTransTree::OUTPUT_OVERFLOW: - dpErrors->AddError(ERROR_OUTPUTSTRING_TOO_LONG,"Error: Output buffer overflow."); - break; - default: - dpErrors->AddError(OTHER_ERROR,"Error: Unknown error."); - } -} -*/ -//************** Implementation WordTrans_ErrorList ******************// -/* -void -WordTrans_ErrorList::AddError( WordTransformer::E_Error i_eType, - const char * i_sErrorDescription ) -{ - ByteString sErrorType = "xxx"; - char * pErrorChars = sErrorType.GetBufferAccess(); - pErrorChars[0] = char(i_eType / 100 + '0'); - pErrorChars[1] = char( (i_eType % 100) / 10 + '0'); - pErrorChars[2] = char(i_eType % 10 + '0'); - sErrorType += i_sErrorDescription; - - aErrors.push_back(sErrorType); - sErrorType.ReleaseBufferAccess(); -} - -void -WordTrans_ErrorList::Clear() -{ - aErrors.erase(aErrors.begin(),aErrors.end()); -} - -USHORT -WordTrans_ErrorList::NrOfErrors() const -{ - return aErrors.size(); -} - -WordTransformer::E_Error -WordTrans_ErrorList::GetError( USHORT i_nNr, - ByteString * o_pErrorText ) const -{ - if ( i_nNr < aErrors.size() ) - { - const ByteString & rError = aErrors[i_nNr]; - const char * pErrorChars = rError.GetBuffer(); - - USHORT nError = USHORT( (pErrorChars[0] - '0') ) * 100 - + (pErrorChars[1] - '0') * 10 - + pErrorChars[2] - '0'; - - if (o_pErrorText != 0) - *o_pErrorText = pErrorChars+3; - - return WordTransformer::E_Error(nError); - } - else - { - if (o_pErrorText != 0) - *o_pErrorText = ""; - return WordTransformer::OK; - } -} -*/ diff --git a/transex3/source/wtranode.cxx b/transex3/source/wtranode.cxx deleted file mode 100644 index 0383ffa7feac..000000000000 --- a/transex3/source/wtranode.cxx +++ /dev/null @@ -1,111 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: wtranode.cxx,v $ - * $Revision: 1.4 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_transex3.hxx" - - -#include "wtranode.hxx" - - -// NOT FULLY DECLARED SERVICES - - -const ByteString sEmptyString(""); - - -WTT_Node::WTT_Node( UINT8 i_nValue, - WTT_Node * i_pDefaultBranch, - WTT_Node * i_pDefaultBranchForAlphas ) - : nValue(i_nValue), - eType(token_to_keep), - sReplaceString(sEmptyString), - // aBranches, - bIsOnDeleting(char(0)) -{ - int i = 0; - for ( ; i < C_BR_ALPHABASE; i++ ) - { - aBranches[i] = i_pDefaultBranch; - } // end for - for ( ; i < C_NR_OF_BRANCHES; i++ ) - { - aBranches[i] = i_pDefaultBranchForAlphas; - } -} - -void -WTT_Node::SetBranch( UINT8 i_cBranch, - WTT_Node * i_pNode ) -{ - if (i_cBranch < C_NR_OF_BRANCHES) - { - aBranches[i_cBranch] = i_pNode; - } -} - -void -WTT_Node::SetAsTokenToReplace(const ByteString & i_sReplaceString) -{ - sReplaceString = i_sReplaceString; - eType = token_to_replace; -} - -WTT_Node::~WTT_Node() -{ - // Delete the tree hanging below this node: - - bIsOnDeleting = TRUE; // Avoid double deleting of multiple used nodes. - - for (int i = 0; i < C_NR_OF_BRANCHES; i++) - { - if (aBranches[i] != 0 ? ! aBranches[i]->IsOnDeleting() : FALSE) - { - delete aBranches[i]; - } - } // end for -} - - - - - - - - - - - - - - - - - diff --git a/transex3/source/wtratree.cxx b/transex3/source/wtratree.cxx deleted file mode 100644 index fea67215ba51..000000000000 --- a/transex3/source/wtratree.cxx +++ /dev/null @@ -1,421 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: wtratree.cxx,v $ - * $Revision: 1.5 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_transex3.hxx" - - -#include "wtratree.hxx" - - - -/** @ATTENTION - For reasons of speed, class WordTransTree works with two simple - char arrays, sOutput and sInput, instead of secure containers or - streams. So be extremely careful, when changing this code!!! -**/ - - - -// NOT FULLY DECLARED SERVICES -#include -#include -#include -#include "wtranode.hxx" - - -const BRANCH_T BR_END = 0; -const BRANCH_T BR_NONALPHA = 1; -const BRANCH_T BR_HOTKEY = 2; -const BRANCH_T BR_BACKSLASH = 3; -const BRANCH_T BR_ALPHABASE = 4; /// @ATTENTION All branches not valid for words must be smaller than this value! -const BRANCH_T BR_AE = 30; -const BRANCH_T BR_OE = 31; -const BRANCH_T BR_UE = 32; -const BRANCH_T BR_SZ = 33; -const BRANCH_T BR_MAX = 34; /// @ATTENTION Must be updated always! - -const BRANCH_T BR_START = 0; - - - - - -WordTransTree::WordTransTree(CharSet i_nWorkingCharSet) - : sInput(0), - nInputLength(0), - pInputEnd(0), - sOutput(0), - nOutputMaxLength(0), - dpParsingTreeTop(0), - pUnknownAlpha(0), - // cChar2Branch - c_AE(u_char('\xC4')), c_OE(u_char('\xD6')), c_UE(u_char('\xDC')), - c_ae(u_char('\xE4')), c_oe(u_char('\xF6')), c_ue(u_char('\xFC')), - pInputCurTokenStart(0), - pInputPosition(0), - pOutputPosition(0), - pCurParseNode(0), - eCurResult(OK), - cCurHotkey(0), - cCurHotkeySign(u_char('~')) -{ - // Initialize parsing tree: - pUnknownAlpha = new WTT_Node(BR_ALPHABASE,0,0); // This will be deleted as part of the parsing tree. - for ( UINT8 i = BR_ALPHABASE; i < C_NR_OF_BRANCHES; i++) - { - pUnknownAlpha->SetBranch(i,pUnknownAlpha); - } // end for - - dpParsingTreeTop = new WTT_Node(BR_START,0,pUnknownAlpha); - - WTT_Node * dpNonAlpha = new WTT_Node(BR_NONALPHA,0,0); - - dpNonAlpha->SetBranch(BR_NONALPHA,dpNonAlpha); - dpParsingTreeTop->SetBranch(BR_NONALPHA,dpNonAlpha); - - WTT_Node * dpBackslash = new WTT_Node(BR_BACKSLASH,dpNonAlpha,dpNonAlpha); - dpBackslash->SetBranch(BR_END,0); - - dpParsingTreeTop->SetBranch(BR_BACKSLASH,dpBackslash); - dpNonAlpha->SetBranch(BR_BACKSLASH,dpBackslash); - - - // Initialize character set: - SetCharSet(i_nWorkingCharSet); - - if (C_BR_ALPHABASE != BR_ALPHABASE || C_NR_OF_BRANCHES != BR_MAX) - { - fprintf(stderr, "Assertion failed: file %s line %d.", __FILE__, __LINE__); - exit(1); - } -} - -void -WordTransTree::SetCharSet(CharSet i_nWorkingCharSet) -{ - ByteString sConvert("\xC4\xD6\xDC\xE4\xF6\xFC\xDF"); - const u_char * pConvert = (const u_char * ) ( sConvert.Convert(RTL_TEXTENCODING_MS_1252, i_nWorkingCharSet).GetBuffer() ); - - INT16 i = 0; - for ( ; i < C_NR_OF_POSSIBLE_CHARS; ++i ) - { - cChar2Branch[i] = BR_NONALPHA; - } // end for - for ( i = 'a'; i <= 'z'; ++i ) - { - cChar2Branch[i] = BR_ALPHABASE + i - 'a'; - } // end for - for ( i = 'A'; i <= 'Z'; ++i ) - { - cChar2Branch[i] = BR_ALPHABASE + i - 'A'; - } // end for - cChar2Branch[pConvert[0]] = BR_AE; - cChar2Branch[pConvert[1]] = BR_OE; - cChar2Branch[pConvert[2]] = BR_UE; - cChar2Branch[pConvert[3]] = BR_AE; - cChar2Branch[pConvert[4]] = BR_OE; - cChar2Branch[pConvert[5]] = BR_UE; - cChar2Branch[pConvert[6]] = BR_SZ; - - cChar2Branch[u_char('~')] = BR_HOTKEY; - cChar2Branch[u_char('&')] = BR_HOTKEY; - - - c_AE = pConvert[0]; - c_OE = pConvert[1]; - c_UE = pConvert[2]; - c_ae = pConvert[3]; - c_oe = pConvert[4]; - c_ue = pConvert[5]; -} - -WordTransTree::~WordTransTree() -{ - delete dpParsingTreeTop; - if (sOutput != 0) - delete [] sOutput; -} - -void -WordTransTree::AddWordPair( const ByteString & i_sOldString, - const ByteString & i_sReplaceString ) -{ - if (i_sOldString.Len() == 0) - return; - - pCurParseNode = dpParsingTreeTop; - WTT_Node * pBranch = 0; - char cBranch = 0; - - for ( constr pOld = i_sOldString.GetBuffer(); - *pOld != 0; - pOld++ ) - { - cBranch = CalculateBranch(*pOld); - pBranch = pCurParseNode->GetNextNode(cBranch); - if (pBranch == 0 || pBranch == pUnknownAlpha) - { - pBranch = new WTT_Node(cBranch,0,pUnknownAlpha); - pCurParseNode->SetBranch(cBranch,pBranch); - } - pCurParseNode = pBranch; - } // end for - pCurParseNode->SetAsTokenToReplace(i_sReplaceString); -} - -void -WordTransTree::InitTransformation( const char * i_sInput, - UINT32 i_nInputLength, - UINT32 i_nOutputMaxLength ) -{ - sInput = (const u_char *)i_sInput; - nInputLength = i_nInputLength; - pInputEnd = &sInput[i_nInputLength]; - - pInputCurTokenStart = sInput; - pInputPosition = sInput; - - if (nOutputMaxLength < i_nOutputMaxLength) - { - if (sOutput != 0) - delete [] sOutput; - sOutput = new unsigned char[i_nOutputMaxLength]; - nOutputMaxLength = i_nOutputMaxLength; - } - pOutputPosition = sOutput; -} - -/** pInputCurTokenStart and CurParseNode are updated just when - starting this function. After its end they must not be changed - till this functon is called again. - Outside this function pInputPositon and pOutputPosition are both - on the first not transformed char in their respective array. -**/ -WordTransTree::E_Result -WordTransTree::TransformNextToken() -{ - pInputCurTokenStart = pInputPosition; - pCurParseNode = dpParsingTreeTop; - cCurHotkey = 0; - eCurResult = OK; - - WTT_Node * pBranch = 0; - UINT8 cBranch = 0; - - for ( pCurParseNode = dpParsingTreeTop; - pInputPosition != pInputEnd; - ++pInputPosition ) - { - cBranch = CalculateBranch(*pInputPosition); - pBranch = pCurParseNode->GetNextNode( cBranch ); - if (pBranch != 0) - { - pCurParseNode = pBranch; - } - else - { - if (cBranch == BR_HOTKEY) // current letter is '~' or '&'. - { - // Logic of the following. There are 9 possible cases - - // A = alphabetic letter, NA = non alphabetic, TB = token begin, - // Eot = end of text: - // 1. A~A set hotkey to following letter, continue - // 2. A~NA token end - // 3. A~Eot token end - // 4. NA~A token end - // 5. NA~NA continue - // 6. A~Eof continue - // 7. TB~A set hotkey to following letter, continue - // 8. TB~NA continue - // 9. TB~Eot continue - - // bNext and Prev are true, if there are alphabetic letters: - BOOL bNext = pInputPosition + 1 != pInputEnd - ? CalculateBranch(pInputPosition[1]) >= BR_ALPHABASE - : FALSE; - BOOL bPrev = pCurParseNode->Value() >= BR_ALPHABASE; - - if ( bNext && (bPrev || pCurParseNode == dpParsingTreeTop) ) - { // case 1. and 7. - Handle_Hotkey(); - continue; - } - else if (!bPrev && !bNext) - { // case 5.,6.,8.,9. - continue; - } - - // Case 2.,3.,4. : - // so this should be handled as an end of a token. - } - if (pCurParseNode->TokenType() == WTT_Node::token_to_keep) - { - Handle_TokenToKeep(); - return eCurResult; - } - else - { - Handle_TokenToTransform(); - return eCurResult; - } // endif (pCurParseNode->TokenType() == WTT_Node::token_to_keep) - } // endif (pBranch == 0) else - } // end for - - // If here, the text end is reached - if (pCurParseNode->TokenType() == WTT_Node::token_to_keep) - { - Handle_TokenToKeep(); - return eCurResult; - } - else - { - Handle_TokenToTransform(); - return eCurResult; - } -} - -ByteString -WordTransTree::CurReplacingString() const -{ - return pCurParseNode->ReplaceString(); -} - -void -WordTransTree::Handle_Hotkey() -{ - if (cCurHotkey == 0) // Avoid to replace the first found hotkey by - // a later one - though this shouldn't happen anyway. - { - cCurHotkey = (pInputPosition+1) != pInputEnd ? pInputPosition[1] : 0; - cCurHotkeySign = *pInputPosition; - } -} - -void -WordTransTree::Handle_TokenToKeep() -{ - UINT32 nTokenLength = pInputPosition-pInputCurTokenStart; - - memcpy(pOutputPosition,pInputCurTokenStart,nTokenLength); - - pOutputPosition += nTokenLength; - *pOutputPosition = '\0'; -} - -void -WordTransTree::Handle_TokenToTransform() -{ - BOOL bHaveHotkey = CalculateBranch(cCurHotkey) >= BR_ALPHABASE; - const ByteString & rReplace = pCurParseNode->ReplaceString(); - - // Find position of hotkey in replace-string: - USHORT nHotkeyPos = bHaveHotkey - ? rReplace.Search(char(cCurHotkey)) - : STRING_NOTFOUND; - if (nHotkeyPos == STRING_NOTFOUND && bHaveHotkey) - { - if (cCurHotkey < 128) - { - if (islower(cCurHotkey)) - nHotkeyPos = rReplace.Search(toupper(char(cCurHotkey))); - else - nHotkeyPos = rReplace.Search(tolower(char(cCurHotkey))); - } - else // cCurHotkey >= 128 - { - if (cCurHotkey == c_ae) - nHotkeyPos = rReplace.Search(char(c_AE)); - else if (cCurHotkey == c_oe) - nHotkeyPos = rReplace.Search(char(c_OE)); - else if (cCurHotkey == c_ue) - nHotkeyPos = rReplace.Search(char(c_UE)); - else if (cCurHotkey == c_AE) - nHotkeyPos = rReplace.Search(char(c_ae)); - else if (cCurHotkey == c_OE) - nHotkeyPos = rReplace.Search(char(c_oe)); - else if (cCurHotkey == c_UE) - nHotkeyPos = rReplace.Search(char(c_ue)); - } // endif (cCurHotkey < 128) else - - if (nHotkeyPos == STRING_NOTFOUND) - { - eCurResult = HOTKEY_LOST; - bHaveHotkey = FALSE; - } - } // endif (nHotkeyPos == STRING_NOT_FOUND && bHaveHotkey) - - - UINT32 nOutputTokenLength = rReplace.Len() + (bHaveHotkey ? 1 : 0); - - if (bHaveHotkey) - { - memcpy( pOutputPosition, - pCurParseNode->ReplaceString().GetBuffer(), - nHotkeyPos ); - *(pOutputPosition + nHotkeyPos) = cCurHotkeySign; - memcpy( pOutputPosition + nHotkeyPos + 1, - pCurParseNode->ReplaceString().GetBuffer() + nHotkeyPos, - nOutputTokenLength - nHotkeyPos - 1); - } - else - { - memcpy( pOutputPosition, - pCurParseNode->ReplaceString().GetBuffer(), - nOutputTokenLength ); - } - - // Convert first letter into upper if necessary: - u_char cInStart = CalculateBranch(*pInputCurTokenStart) == BR_HOTKEY - ? pInputCurTokenStart[1] - : pInputCurTokenStart[0] ; - u_char * pOutStart = nHotkeyPos == 0 - ? pOutputPosition + 1 - : pOutputPosition ; - if (isupper(cInStart) || cInStart > 127) - { // Possibly cInStart is upper character: - if (isupper(cInStart) || cInStart == c_AE || cInStart == c_OE || cInStart == c_UE) - { // Surely cInStart is upper character: - u_char cOutStart = *pOutStart; - if (cOutStart < 128) - *pOutStart = toupper(cOutStart); - else if (cOutStart == c_ae) - *pOutStart = c_AE; - else if (cOutStart == c_oe) - *pOutStart = c_OE; - else if (cOutStart == c_ue) - *pOutStart = c_UE; - } - } // endif (isupper(cInStart) || cInStart > 127) - - pOutputPosition += nOutputTokenLength; - *pOutputPosition = '\0'; -} - diff --git a/transex3/source/xgfconv.cxx b/transex3/source/xgfconv.cxx deleted file mode 100644 index 76ea1a2906a8..000000000000 --- a/transex3/source/xgfconv.cxx +++ /dev/null @@ -1,66 +0,0 @@ -#include - -#include "export.hxx" -#include "utf8conv.hxx" - -/*****************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_transex3.hxx" -#if defined(UNX) || defined(OS2) -int main( int argc, char *argv[] ) -#else -int _cdecl main( int argc, char *argv[] ) -#endif -/*****************************************************************************/ -{ - if ( argc != 3 ) { - fprintf( stderr, "xgfconv InputFile OutputFile\n" ); - return ( 5 ); - } - - ByteString sInput( argv[ 1 ] ); - ByteString sOutput( argv[ 2 ] ); - - SvFileStream aInput( String( sInput, RTL_TEXTENCODING_ASCII_US ), STREAM_STD_READ ); - if ( !aInput.IsOpen()) { - fprintf( stderr, "ERROR: Unable to open input file!\n" ); - return ( 5 ); - } - - SvFileStream aOutput( String( sOutput, RTL_TEXTENCODING_ASCII_US ), STREAM_STD_WRITE | STREAM_TRUNC ); - if ( !aOutput.IsOpen()) { - fprintf( stderr, "ERROR: Unable to open output file!\n" ); - aInput.Close(); - return ( 5 ); - } - - ByteString sLine; - BOOL bFirst = TRUE; - while ( !aInput.IsEof()) { - aInput.ReadLine( sLine ); - ByteString sLangId = sLine.GetToken( 0, '\t' ); - ByteString sFile = sLine.GetToken( 1, '\t' ); - ByteString sText = sLine.Copy( sLangId.Len() + sFile.Len() + 2 ); - - USHORT nLangId = sLangId.ToInt32(); - CharSet aCharSet = Export::GetCharSet( nLangId ); - if ( aCharSet != 0xFFFF && sText.Len()) { - sText = UTF8Converter::ConvertToUTF8( sText, aCharSet ); - ByteString sOutput = sFile; - sOutput += "\t"; - sOutput += sText; - if ( !bFirst ) { - ByteString sEmpty; - aOutput.WriteLine( sEmpty ); - } - else - bFirst = FALSE; - aOutput.Write( sOutput.GetBuffer(), sOutput.Len()); - } - } - aInput.Close(); - aOutput.Close(); - return ( 0 ); -} - diff --git a/transex3/source/xmlparse.cxx b/transex3/source/xmlparse.cxx deleted file mode 100644 index 921f1d329f67..000000000000 --- a/transex3/source/xmlparse.cxx +++ /dev/null @@ -1,1456 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: xmlparse.cxx,v $ - * $Revision: 1.24 $ - * - * 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_transex3.hxx" -#include /* std::iterator*/ - -#include -#include - -#include "xmlparse.hxx" -#include -#include -#include -#include -#ifdef __MINGW32__ -#include -#include -#endif -using namespace std; -using namespace osl; - -// -// class XMLChildNode -// - -/*****************************************************************************/ -XMLChildNode::XMLChildNode( XMLParentNode *pPar ) -/*****************************************************************************/ - : pParent( pPar ) -{ - if ( pParent ) - pParent->AddChild( this ); -} - - -/*****************************************************************************/ -XMLChildNode::XMLChildNode( const XMLChildNode& obj) -/*****************************************************************************/ -: XMLNode(obj), - pParent(obj.pParent){} - -/*****************************************************************************/ -XMLChildNode& XMLChildNode::operator=(const XMLChildNode& obj){ -/*****************************************************************************/ - if(this != &obj){ - pParent=obj.pParent; - } - return *this; -} -// -// class XMLParentNode -// - - -/*****************************************************************************/ -XMLParentNode::~XMLParentNode() -/*****************************************************************************/ -{ - if( pChildList ){ - RemoveAndDeleteAllChilds(); - delete pChildList; - pChildList = NULL; - } - pChildList = NULL; -} -/*****************************************************************************/ -XMLParentNode::XMLParentNode( const XMLParentNode& obj) -/*****************************************************************************/ -: XMLChildNode( obj ) -{ - if( obj.pChildList ){ - pChildList=new XMLChildNodeList(); - XMLChildNode* pNode = NULL; - for ( ULONG i = 0; i < obj.pChildList->Count(); i++ ){ - pNode = obj.pChildList->GetObject( i ); - if( pNode != NULL){ - switch(pNode->GetNodeType()){ - case XML_NODE_TYPE_ELEMENT: - AddChild( new XMLElement( *static_cast(pNode) ) ); break; - case XML_NODE_TYPE_DATA: - AddChild( new XMLData ( *static_cast (pNode) ) ); break; - case XML_NODE_TYPE_COMMENT: - AddChild( new XMLComment( *static_cast(pNode) ) ); break; - case XML_NODE_TYPE_DEFAULT: - AddChild( new XMLDefault( *static_cast(pNode) ) ); break; - default: fprintf(stdout,"XMLParentNode::XMLParentNode( const XMLParentNode& obj) strange obj"); - } - } - } - }else pChildList = NULL; -} -/*****************************************************************************/ -XMLParentNode& XMLParentNode::operator=(const XMLParentNode& obj){ -/*****************************************************************************/ - if(this!=&obj){ - XMLChildNode::operator=(obj); - if( pChildList ){ - RemoveAndDeleteAllChilds(); - delete pChildList; - pChildList = NULL; - } - if( obj.pChildList ){ - pChildList=new XMLChildNodeList(); - for ( ULONG i = 0; i < obj.pChildList->Count(); i++ ) - AddChild( obj.pChildList->GetObject( i ) ); - }else pChildList = NULL; - - } - return *this; -} -/*****************************************************************************/ -void XMLParentNode::AddChild( XMLChildNode *pChild ) -/*****************************************************************************/ -{ - if ( !pChildList ) - pChildList = new XMLChildNodeList(); - pChildList->Insert( pChild, LIST_APPEND ); -} - -/*****************************************************************************/ -void XMLParentNode::AddChild( XMLChildNode *pChild , int pos ) -/*****************************************************************************/ -{ - if ( !pChildList ) - pChildList = new XMLChildNodeList(); - pChildList->Insert( pChild, pos ); -} - -/*****************************************************************************/ -int XMLParentNode::GetPosition( ByteString id ){ -/*****************************************************************************/ - XMLElement* a; - - static const ByteString sEnusStr = ByteString(String::CreateFromAscii(ENGLISH_US_ISO).ToLowerAscii() , RTL_TEXTENCODING_ASCII_US ).ToLowerAscii(); - static const ByteString sDeStr = ByteString(String::CreateFromAscii(GERMAN_ISO2).ToLowerAscii() , RTL_TEXTENCODING_ASCII_US ).ToLowerAscii(); - - if ( pChildList ){ - for ( ULONG i = 0; i < pChildList->Count(); i++ ) { - XMLChildNode *pChild = pChildList->GetObject( i ); - if ( pChild->GetNodeType() == XML_NODE_TYPE_ELEMENT ){ - a = static_cast(pChild); - ByteString elemid( a->GetId() ); - elemid.ToLowerAscii(); - if ( elemid.Equals( id.ToLowerAscii() ) ){ - ByteString elemLID( a->GetLanguageId() ); - elemLID.ToLowerAscii(); - if( elemLID.Equals( sEnusStr) ) { - return i; - } - else if( elemLID.Equals( sDeStr) ) { - return i; - } - } - } - } - } - return -1; -} - -/*****************************************************************************/ -int XMLParentNode::RemoveChild( XMLElement *pRefElement ) -/*****************************************************************************/ -{ - XMLElement* a; - if ( pChildList ){ - for ( ULONG i = 0; i < pChildList->Count(); i++ ) { - XMLChildNode *pChild = pChildList->GetObject( i ); - if ( pChild->GetNodeType() == XML_NODE_TYPE_ELEMENT ){ - a = static_cast(pChild); - ByteString elemid( a->GetId() ); - elemid.ToLowerAscii(); - ByteString elemLID( a->GetLanguageId() ); - elemLID.ToLowerAscii(); - ByteString pRefLID( pRefElement->GetLanguageId() ); - pRefLID.ToLowerAscii(); - if ( elemid.Equals(pRefElement->GetId()) - && elemLID.Equals( pRefLID ) ) - { - if( pRefElement->ToOString().compareTo( a->ToOString() )==0 ){ - pChildList->Remove( i ); - delete a; // Test - return i; - } - } - } - - } - } - return -1; -} - -/*****************************************************************************/ -void XMLParentNode::RemoveAndDeleteAllChilds(){ -/*****************************************************************************/ - if ( pChildList ) { - for ( ULONG i = 0; i < pChildList->Count(); i++ ) - delete pChildList->GetObject( i ); - pChildList->Clear(); - } -} - -/*****************************************************************************/ -XMLElement *XMLParentNode::GetChildElement( XMLElement *pRefElement ) -/*****************************************************************************/ -{ - for ( ULONG i = 0; i < pChildList->Count(); i++ ) { - XMLChildNode *pChild = pChildList->GetObject( i ); - if ( pChild->GetNodeType() == XML_NODE_TYPE_ELEMENT ) - if ((( XMLElement * ) pChild )->GetName() == - pRefElement->GetName()) - { - XMLAttributeList *pList = pRefElement->GetAttributeList(); - if ( !pList ) - return ( XMLElement * ) pChild; - - BOOL bMatch = FALSE; - for ( ULONG j = 0; j < pList->Count() && bMatch; j++ ) { - XMLAttribute *pAttribute = pList->GetObject( j ); - XMLAttribute *pCandidate = - (( XMLElement * ) pChild )->GetAttribute( - *pAttribute ); - if ( !pCandidate || !pAttribute->IsEqual( *pCandidate )) - bMatch = FALSE; - } - if ( bMatch ) - return ( XMLElement * ) pChild; - } - } - return NULL; -} - -// -// class XMLFile -// - -/*****************************************************************************/ -USHORT XMLFile::GetNodeType() -/*****************************************************************************/ -{ - return XML_NODE_TYPE_FILE; -} - -/*****************************************************************************/ -BOOL XMLFile::Write( ByteString &aFilename ) -/*****************************************************************************/ -{ - - if ( aFilename.Len()) { - // retry harder if there is a NFS problem, - for( int x = 1 ; x < 3 ; x++ ){ // this looks strange...yes! - ofstream aFStream( aFilename.GetBuffer() , ios::out | ios::trunc ); - - if( !aFStream ) // From time to time the stream can not be opened the first time on NFS volumes, - { // I wasn't able to track this down. I think this is an NFS issue ..... - //cerr << "ERROR: - helpex - Can't write to tempfile " << aFilename.GetBuffer() << " No#" << x << "\n"; - TimeValue aTime; - aTime.Seconds = 3; - aTime.Nanosec = 0; - - osl::Thread::wait( aTime ); - } - else - { - // write out - Write( aFStream ); - aFStream.close(); - - // check! - DirEntry aTarget( aFilename ); - FileStat aFileStat( aTarget ); - - if( aFileStat.GetSize() < 1 ) - { - //retry - //cerr << "WARNING: - helpex - Can't create file " << aFilename.GetBuffer() << " No#" << x << "\n"; - aTarget.Kill(); - } - else - { - //everything ok! - return true; - } - } - } - cerr << "ERROR: - helpex - Can't create file " << aFilename.GetBuffer() << "\nPossible reason: Disk full ? Mounted NFS volume broken ? Wrong permissions ?\n"; - exit( -1 ); - } - cerr << "ERROR: - helpex - Empty file name\n"; - exit( -1 ); -} - - - -void XMLFile::WriteString( ofstream &rStream, const String &sString ) -{ - ByteString sText( sString, RTL_TEXTENCODING_UTF8 ); - rStream << sText.GetBuffer(); -} - - -BOOL XMLFile::Write( ofstream &rStream , XMLNode *pCur ) -{ - XMLUtil& xmlutil = XMLUtil::Instance(); - (void) xmlutil; - - if ( !pCur ) - Write( rStream, this ); - else { - switch( pCur->GetNodeType()) { - case XML_NODE_TYPE_FILE: { - if( GetChildList()) - for ( ULONG i = 0; i < GetChildList()->Count(); i++ ) - Write( rStream, GetChildList()->GetObject( i )); - } - break; - case XML_NODE_TYPE_ELEMENT: { - XMLElement *pElement = ( XMLElement * ) pCur; - rStream << "<"; - WriteString( rStream, pElement->GetName()); - if ( pElement->GetAttributeList()) - for ( ULONG j = 0; j < pElement->GetAttributeList()->Count(); j++ ) { - rStream << " "; - String sData(*pElement->GetAttributeList()->GetObject( j )); - xmlutil.QuotHTML( sData ); - WriteString( rStream , sData ); - rStream << "=\""; - sData=pElement->GetAttributeList()->GetObject( j )->GetValue(); - xmlutil.QuotHTML( sData ); - WriteString( rStream , sData ); - rStream << "\""; - } - if ( !pElement->GetChildList()) - rStream << "/>"; - else { - rStream << ">"; - for ( ULONG k = 0; k < pElement->GetChildList()->Count(); k++ ) - Write( rStream, pElement->GetChildList()->GetObject( k )); - rStream << "GetName()); - rStream << ">"; - } - } - break; - case XML_NODE_TYPE_DATA: { - XMLData *pData = ( XMLData * ) pCur; - String sData( pData->GetData()); - xmlutil.QuotHTML( sData ); - WriteString( rStream, sData ); - } - break; - case XML_NODE_TYPE_COMMENT: { - XMLComment *pComment = ( XMLComment * ) pCur; - rStream << ""; - } - break; - case XML_NODE_TYPE_DEFAULT: { - XMLDefault *pDefault = ( XMLDefault * ) pCur; - WriteString( rStream, pDefault->GetDefault()); - } - break; - } - } - return TRUE; -} - - -void XMLFile::Print( XMLNode *pCur, USHORT nLevel ) -{ - - if ( !pCur ) - Print( this ); - else { - switch( pCur->GetNodeType()) { - case XML_NODE_TYPE_FILE: { - if( GetChildList()) - for ( ULONG i = 0; i < GetChildList()->Count(); i++ ) - Print( GetChildList()->GetObject( i )); - } - break; - case XML_NODE_TYPE_ELEMENT: { - XMLElement *pElement = ( XMLElement * ) pCur; - - fprintf( stdout, "<%s", ByteString( pElement->GetName(), RTL_TEXTENCODING_UTF8 ).GetBuffer()); - if ( pElement->GetAttributeList()) - for ( ULONG j = 0; j < pElement->GetAttributeList()->Count(); j++ ){ - ByteString aAttrName( *pElement->GetAttributeList()->GetObject( j ), RTL_TEXTENCODING_UTF8 ); - if( !aAttrName.EqualsIgnoreCaseAscii( XML_LANG ) ) { - fprintf( stdout, " %s=\"%s\"", - aAttrName.GetBuffer(), - ByteString( pElement->GetAttributeList()->GetObject( j )->GetValue(), - RTL_TEXTENCODING_UTF8 ).GetBuffer()); - } - } - if ( !pElement->GetChildList()) - fprintf( stdout, "/>" ); - else { - fprintf( stdout, ">" ); - for ( ULONG k = 0; k < pElement->GetChildList()->Count(); k++ ) - Print( pElement->GetChildList()->GetObject( k ), nLevel + 1 ); - fprintf( stdout, "", ByteString( pElement->GetName(), RTL_TEXTENCODING_UTF8 ).GetBuffer()); - } - } - break; - case XML_NODE_TYPE_DATA: { - XMLData *pData = ( XMLData * ) pCur; - String sData = pData->GetData(); - fprintf( stdout, "%s", ByteString( sData, RTL_TEXTENCODING_UTF8 ).GetBuffer()); - } - break; - case XML_NODE_TYPE_COMMENT: { - XMLComment *pComment = ( XMLComment * ) pCur; - fprintf( stdout, "", ByteString( pComment->GetComment(), RTL_TEXTENCODING_UTF8 ).GetBuffer()); - } - break; - case XML_NODE_TYPE_DEFAULT: { - XMLDefault *pDefault = ( XMLDefault * ) pCur; - fprintf( stdout, "%s", ByteString( pDefault->GetDefault(), RTL_TEXTENCODING_UTF8 ).GetBuffer()); - } - break; - } - } -} -XMLFile::~XMLFile() -{ - if( XMLStrings != NULL ){ - XMLHashMap::iterator pos = XMLStrings->begin(); - for( ; pos != XMLStrings->end() ; ++pos ){ - delete pos->second; // Check and delete content also ? - } - delete XMLStrings; - XMLStrings = NULL; - } -} -/*****************************************************************************/ -XMLFile::XMLFile( const String &rFileName ) // the file name, empty if created from memory stream -/*****************************************************************************/ - : XMLParentNode( NULL ), - sFileName ( rFileName ), - ID ( "id" ), - OLDREF ( "oldref" ), - XML_LANG ( "xml-lang" ), - XMLStrings ( NULL ) - -{ -// nodes_localize.insert( TagMap::value_type(ByteString(String::CreateFromAscii("bookmark_value"),RTL_TEXTENCODING_ASCII_US) , TRUE) ); - nodes_localize.insert( TagMap::value_type(ByteString(String::CreateFromAscii("bookmark"),RTL_TEXTENCODING_ASCII_US) , TRUE) ); - nodes_localize.insert( TagMap::value_type(ByteString(String::CreateFromAscii("variable"),RTL_TEXTENCODING_ASCII_US) , TRUE) ); - nodes_localize.insert( TagMap::value_type(ByteString(String::CreateFromAscii("paragraph"),RTL_TEXTENCODING_ASCII_US) , TRUE) ); - nodes_localize.insert( TagMap::value_type(ByteString(String::CreateFromAscii("alt"),RTL_TEXTENCODING_ASCII_US) , TRUE) ); - nodes_localize.insert( TagMap::value_type(ByteString(String::CreateFromAscii("caption"),RTL_TEXTENCODING_ASCII_US) , TRUE) ); - nodes_localize.insert( TagMap::value_type(ByteString(String::CreateFromAscii("title"),RTL_TEXTENCODING_ASCII_US) , TRUE) ); - nodes_localize.insert( TagMap::value_type(ByteString(String::CreateFromAscii("link"),RTL_TEXTENCODING_ASCII_US) , TRUE) ); -} -/*****************************************************************************/ -void XMLFile::Extract( XMLFile *pCur ) -/*****************************************************************************/ -{ - if( XMLStrings != NULL ) delete XMLStrings; // Elements ? - - XMLStrings = new XMLHashMap(); - if ( !pCur ) - SearchL10NElements( this ); - else { - if( pCur->GetNodeType()==XML_NODE_TYPE_FILE) { - SearchL10NElements(pCur); - } - } -} - -/*****************************************************************************/ -void XMLFile::View(){ -/*****************************************************************************/ - XMLElement* cur; - for(XMLHashMap::iterator pos=XMLStrings->begin(); pos!=XMLStrings->end();++pos){ - fprintf(stdout,"\nid=%s\n",(pos->first).GetBuffer()); - LangHashMap* elem=pos->second; - for(LangHashMap::iterator pos2=elem->begin(); pos2!=elem->end();++pos2){ - fprintf( stdout,"\nlanguage=%s\n",(pos2->first).GetBuffer() ); - cur=pos2->second; - fprintf(stdout,"\n%s\n",((XMLElement*)cur)->ToOString().getStr()); - - } - } -} - -/*****************************************************************************/ -void XMLFile::InsertL10NElement( XMLElement* pElement ){ -/*****************************************************************************/ - ByteString tmpStr,id,oldref,language(""); - LangHashMap* elem; - - if( pElement->GetAttributeList() != NULL ){ - for ( ULONG j = 0; j < pElement->GetAttributeList()->Count(); j++ ){ - tmpStr=ByteString( *pElement->GetAttributeList()->GetObject( j ),RTL_TEXTENCODING_UTF8 ); - if( tmpStr.CompareTo(ID)==COMPARE_EQUAL ){ // Get the "id" Attribute - id = ByteString( pElement->GetAttributeList()->GetObject( j )->GetValue(),RTL_TEXTENCODING_UTF8 ); - } - if( tmpStr.CompareTo( XML_LANG ) == COMPARE_EQUAL ){ // Get the "xml-lang" Attribute - language = ByteString( pElement->GetAttributeList()->GetObject( j )->GetValue(),RTL_TEXTENCODING_UTF8 ); - } - - } - }else{ - fprintf(stdout,"XMLFile::InsertL10NElement: No AttributeList found"); - fprintf(stdout,"++++++++++++++++++++++++++++++++++++++++++++++++++"); - Print( pElement , 0 ); - fprintf(stdout,"++++++++++++++++++++++++++++++++++++++++++++++++++"); - } - - XMLHashMap::iterator pos = XMLStrings->find( id ); - if( pos == XMLStrings->end() ){ // No instanze , create new one - elem = new LangHashMap(); - (*elem)[ language ]=pElement; - XMLStrings->insert( XMLHashMap::value_type( id , elem ) ); - order.push_back( id ); - }else{ // Already there - elem=pos->second; - if ( (*elem)[ language ] ) - { - fprintf(stdout,"Error: Duplicated entry. ID = %s LANG = %s in File %s\n", id.GetBuffer(), language.GetBuffer(), ByteString( sFullName,RTL_TEXTENCODING_ASCII_US ).GetBuffer() ); - exit( -1 ); - } - (*elem)[ language ]=pElement; - } -} -/*****************************************************************************/ -void XMLFile::showType(XMLParentNode* node){ -/*****************************************************************************/ - switch (node->GetNodeType()){ - case XML_NODE_TYPE_ELEMENT: fprintf(stdout,"ELEMENT\n") ;break; - case XML_NODE_TYPE_FILE: fprintf(stdout,"FILE\n") ;break; - case XML_NODE_TYPE_COMMENT: fprintf(stdout,"COMMENT\n") ;break; - case XML_NODE_TYPE_DATA: fprintf(stdout,"DATA\n") ;break; - case XML_NODE_TYPE_DEFAULT: fprintf(stdout,"DEFAULT\n") ;break; - default: break; - } -} -XMLFile::XMLFile() -/*****************************************************************************/ - : XMLParentNode( NULL ), - ID ( "id" ), - OLDREF ( "oldref" ), - XML_LANG ( "xml-lang" ), - XMLStrings ( NULL ){}; - - -XMLFile::XMLFile( const XMLFile& obj ) -/*****************************************************************************/ - : XMLParentNode( obj ), - sFileName ( obj.sFileName ), - ID ( "id" ), - OLDREF ( "oldref" ), - XML_LANG ( "xml-lang" ), - XMLStrings ( NULL ) -{ - if( this!=&obj ) - { - nodes_localize =obj.nodes_localize; - order =obj.order; - - } -} -/*****************************************************************************/ -XMLFile& XMLFile::operator=(const XMLFile& obj){ -/*****************************************************************************/ - if( this!=&obj ){ - - XMLParentNode::operator=(obj); - - nodes_localize =obj.nodes_localize; - order =obj.order; - - if( XMLStrings ) delete XMLStrings; - - if( obj.XMLStrings ) - { - XMLStrings = new XMLHashMap(); - for( XMLHashMap::iterator pos = obj.XMLStrings->begin() ; pos != obj.XMLStrings->end() ; ++pos ) - { - LangHashMap* elem=pos->second; - LangHashMap* newelem = new LangHashMap(); - for(LangHashMap::iterator pos2=elem->begin(); pos2!=elem->end();++pos2){ - (*newelem)[ pos2->first ] = new XMLElement( *pos2->second ); - printf("*"); - } - (*XMLStrings)[ pos->first ] = newelem; - } - } - } - printf("done!\n"); - return *this; -} - - -/*****************************************************************************/ -void XMLFile::SearchL10NElements( XMLParentNode *pCur , int pos) -/*****************************************************************************/ -{ - static const ByteString LOCALIZE("localize"); - static const ByteString THEID("id"); - bool bInsert = true; - if ( !pCur ) - SearchL10NElements( this ); - else { - switch( pCur->GetNodeType()) { - case XML_NODE_TYPE_FILE: { - XMLParentNode* pElement; - if( GetChildList()){ - for ( ULONG i = 0; i < GetChildList()->Count(); i++ ){ - pElement = (XMLParentNode*) GetChildList()->GetObject( i ); - if( pElement->GetNodeType() == XML_NODE_TYPE_ELEMENT ) SearchL10NElements( pElement , i); - } - } - } - break; - case XML_NODE_TYPE_ELEMENT: { - XMLElement *pElement = ( XMLElement * ) pCur; - ByteString sName(pElement->GetName(),RTL_TEXTENCODING_ASCII_US); - ByteString language,tmpStrVal,oldref; - if ( pElement->GetAttributeList()){ - for ( ULONG j = 0 , cnt = pElement->GetAttributeList()->Count(); j < cnt && bInsert; j++ ){ - const ByteString tmpStr( *pElement->GetAttributeList()->GetObject( j ),RTL_TEXTENCODING_UTF8 ); - if( tmpStr.CompareTo(THEID)==COMPARE_EQUAL ){ // Get the "id" Attribute - tmpStrVal=ByteString( pElement->GetAttributeList()->GetObject( j )->GetValue(),RTL_TEXTENCODING_UTF8 ); - //printf("Checking id = %s\n",tmpStrVal.GetBuffer() ); - } - if( tmpStr.CompareTo(LOCALIZE)==COMPARE_EQUAL ){ // Get the "localize" Attribute - bInsert=false; - } - if( tmpStr.CompareTo(XML_LANG)==COMPARE_EQUAL ){ // Get the "xml-lang" Attribute - language=ByteString( pElement->GetAttributeList()->GetObject( j )->GetValue(),RTL_TEXTENCODING_UTF8 ); - } - if( tmpStr.CompareTo(OLDREF)==COMPARE_EQUAL ){ // Get the "oldref" Attribute - oldref=ByteString( pElement->GetAttributeList()->GetObject( j )->GetValue(),RTL_TEXTENCODING_UTF8 ); - } - } - pElement->SetLanguageId ( language ); - pElement->SetId ( tmpStrVal.GetBuffer() ); - pElement->SetOldRef ( oldref ); - pElement->SetPos( pos ); - } - - if ( bInsert && ( nodes_localize.find( sName.ToLowerAscii() ) != nodes_localize.end() ) ) - InsertL10NElement(pElement); - else if ( bInsert && pElement->GetChildList() ){ - for ( ULONG k = 0; k < pElement->GetChildList()->Count(); k++ ) - SearchL10NElements( (XMLParentNode*) pElement->GetChildList()->GetObject( k ) , k); - } - } - break; - case XML_NODE_TYPE_DATA: { - } - break; - case XML_NODE_TYPE_COMMENT: { - } - break; - case XML_NODE_TYPE_DEFAULT: { - } - break; - } - } -} - -/*****************************************************************************/ -bool XMLFile::CheckExportStatus( XMLParentNode *pCur ) -/*****************************************************************************/ -{ - static bool bStatusExport = true; - const ByteString LOCALIZE("localize"); - const ByteString STATUS("status"); - const ByteString PUBLISH("PUBLISH"); - const ByteString DEPRECATED("DEPRECATED"); - - const ByteString TOPIC("topic"); - bool bInsert = true; - if ( !pCur ) - CheckExportStatus( this ); - else { - switch( pCur->GetNodeType()) { - case XML_NODE_TYPE_FILE: { - XMLParentNode* pElement; - if( GetChildList()){ - for ( ULONG i = 0; i < GetChildList()->Count(); i++ ){ - pElement = (XMLParentNode*) GetChildList()->GetObject( i ); - if( pElement->GetNodeType() == XML_NODE_TYPE_ELEMENT ) CheckExportStatus( pElement );//, i); - } - } - } - break; - case XML_NODE_TYPE_ELEMENT: { - XMLElement *pElement = ( XMLElement * ) pCur; - ByteString sName(pElement->GetName(),RTL_TEXTENCODING_ASCII_US); - if( sName.EqualsIgnoreCaseAscii( TOPIC ) ){ - if ( pElement->GetAttributeList()){ - for ( ULONG j = 0 , cnt = pElement->GetAttributeList()->Count(); j < cnt && bInsert; j++ ){ - const ByteString tmpStr( *pElement->GetAttributeList()->GetObject( j ),RTL_TEXTENCODING_UTF8 ); - if( tmpStr.EqualsIgnoreCaseAscii( STATUS ) ){ - ByteString tmpStrVal=ByteString( pElement->GetAttributeList()->GetObject( j )->GetValue(),RTL_TEXTENCODING_UTF8 ); - if( !tmpStrVal.EqualsIgnoreCaseAscii( PUBLISH ) && - !tmpStrVal.EqualsIgnoreCaseAscii( DEPRECATED )){ - bStatusExport = false; - } - } - - } - } - } - else if ( pElement->GetChildList() ){ - for ( ULONG k = 0; k < pElement->GetChildList()->Count(); k++ ) - CheckExportStatus( (XMLParentNode*) pElement->GetChildList()->GetObject( k ) );//, k); - } - } - break; - } - } - return bStatusExport; -} - -/*****************************************************************************/ -USHORT XMLElement::GetNodeType() -/*****************************************************************************/ -{ - return XML_NODE_TYPE_ELEMENT; -} - -/*****************************************************************************/ -XMLElement::XMLElement(const XMLElement& obj) -/*****************************************************************************/ - : - XMLParentNode ( obj ), - sElementName ( obj.sElementName ), - pAttributes ( NULL ), - project ( obj.project ), - filename ( obj.filename ), - id ( obj.id ), - sOldRef ( obj.sOldRef ), - resourceType ( obj.resourceType ), - languageId ( obj.languageId ), - nPos ( obj.nPos ) - -{ - if ( obj.pAttributes ){ - pAttributes = new XMLAttributeList(); - for ( ULONG i = 0; i < obj.pAttributes->Count(); i++ ) - AddAttribute( *obj.pAttributes->GetObject( i ) , obj.pAttributes->GetObject( i )->GetValue() ); - } -} - -/*****************************************************************************/ -XMLElement& XMLElement::operator=(const XMLElement& obj){ -/*****************************************************************************/ - if( this!=&obj ){ - XMLParentNode::operator=(obj); - sElementName =obj.sElementName; - project =obj.project; - filename =obj.filename; - id =obj.id; - sOldRef =obj.sOldRef; - resourceType =obj.resourceType; - languageId =obj.languageId; - nPos =obj.nPos; - - if ( pAttributes ){ - for ( ULONG i = 0; i < pAttributes->Count(); i++ ) - delete pAttributes->GetObject( i ); - delete pAttributes; - } - if ( obj.pAttributes ){ - pAttributes =new XMLAttributeList(); - for ( ULONG i = 0; i < obj.pAttributes->Count(); i++ ) - AddAttribute( *obj.pAttributes->GetObject( i ) , obj.pAttributes->GetObject( i )->GetValue() ); - } - } - return *this; -} - -/*****************************************************************************/ -void XMLElement::AddAttribute( const String &rAttribute, const String &rValue ) -/*****************************************************************************/ -{ - if ( !pAttributes ) - pAttributes = new XMLAttributeList(); - pAttributes->Insert( new XMLAttribute( rAttribute, rValue ), LIST_APPEND ); -} - -/*****************************************************************************/ -void XMLElement::ChangeLanguageTag( const String &rValue ){ -/*****************************************************************************/ - static const String rName = String::CreateFromAscii("xml-lang"); - SetLanguageId( ByteString(rValue,RTL_TEXTENCODING_UTF8) ); - if ( pAttributes ){ - for ( ULONG i = 0; i < pAttributes->Count(); i++ ){ - if ( *pAttributes->GetObject( i ) == rName ){ - pAttributes->GetObject( i )->setValue(rValue); - } - } - } - XMLChildNode* pNode = NULL; - XMLElement* pElem = NULL; - XMLChildNodeList* pCList = GetChildList(); - - if( pCList != NULL ){ - for ( ULONG i = 0; i < pCList->Count(); i++ ){ - pNode = pCList->GetObject( i ); - if( pNode != NULL && pNode->GetNodeType() == XML_NODE_TYPE_ELEMENT ){ - pElem = static_cast< XMLElement* >(pNode); - pElem->ChangeLanguageTag( rValue ); - pElem->SetLanguageId( ByteString(rValue,RTL_TEXTENCODING_UTF8) ); - pElem = NULL; - pNode = NULL; - } - } - pCList = NULL; - } -} -/*****************************************************************************/ -XMLAttribute *XMLElement::GetAttribute( const String &rName ) -/*****************************************************************************/ -{ - if ( pAttributes ) - for ( ULONG i = 0; i < pAttributes->Count(); i++ ) - if ( *pAttributes->GetObject( i ) == rName ) - return pAttributes->GetObject( i ); - - return NULL; -} - -/*****************************************************************************/ -XMLElement::~XMLElement() -/*****************************************************************************/ -{ - if ( pAttributes ) { - for ( ULONG i = 0; i < pAttributes->Count(); i++ ) - delete pAttributes->GetObject( i ); - - delete pAttributes; - pAttributes = NULL; - } -} -/*****************************************************************************/ -bool XMLElement::Equals(OUString refStr){ -/*****************************************************************************/ - return refStr.equals( ToOUString() ); -} - -/*****************************************************************************/ -OString XMLElement::ToOString(){ -/*****************************************************************************/ - OUString ouEmpty; - - OUStringBuffer* buffer = new OUStringBuffer(); - Print( this, *buffer , true ); - - OString result( (sal_Unicode* )buffer->getStr(), buffer->getLength() , RTL_TEXTENCODING_UTF8 ); - delete buffer; - return result; -} -/*****************************************************************************/ -OUString XMLElement::ToOUString(){ -/*****************************************************************************/ - OUStringBuffer* buffer = new OUStringBuffer(); - Print(this,*buffer,true); - OUString result=buffer->makeStringAndClear(); - String xy(result.getStr()); - result=OUString(xy); - delete buffer; - return result; -} -/*****************************************************************************/ -void XMLElement::Print(XMLNode *pCur, OUStringBuffer& buffer , bool rootelement ){ -/*****************************************************************************/ - //YD FIXME somewhere COMMENT is defined as 4! - static const String _COMMENT = String::CreateFromAscii("comment"); - static const OUString XML_LANG ( OUString::createFromAscii("xml-lang") ); - - if(pCur!=NULL){ - if(rootelement){ - XMLElement *pElement = ( XMLElement * ) pCur; - if ( pElement->GetAttributeList()){ - if ( pElement->GetChildList()){ - XMLChildNode* tmp=NULL; - for ( ULONG k = 0; k < pElement->GetChildList()->Count(); k++ ){ - tmp=pElement->GetChildList()->GetObject( k ); - Print( tmp, buffer , false); - } - } - } - } - else{ - - switch( pCur->GetNodeType()) { - case XML_NODE_TYPE_ELEMENT: { - XMLElement *pElement = ( XMLElement * ) pCur; - - if( !pElement->GetName().EqualsIgnoreCaseAscii( _COMMENT ) ){ - buffer.append( OUString::createFromAscii("\\<") ); - buffer.append( pElement->GetName() ); - if ( pElement->GetAttributeList()){ - for ( ULONG j = 0; j < pElement->GetAttributeList()->Count(); j++ ){ - - OUString aAttrName( *pElement->GetAttributeList()->GetObject( j ) ); - if( !aAttrName.equalsIgnoreAsciiCase( XML_LANG ) ) { - buffer.append( OUString::createFromAscii(" ") ); - buffer.append( aAttrName ); - buffer.append( OUString::createFromAscii("=") ); - buffer.append( OUString::createFromAscii("\\\"") ); - buffer.append( pElement->GetAttributeList()->GetObject( j )->GetValue() ); - buffer.append( OUString::createFromAscii("\\\"") ); - } - } - } - if ( !pElement->GetChildList()) - buffer.append( OUString::createFromAscii("/\\>") ); - else { - buffer.append( OUString::createFromAscii("\\>") ); - XMLChildNode* tmp=NULL; - for ( ULONG k = 0; k < pElement->GetChildList()->Count(); k++ ){ - tmp=pElement->GetChildList()->GetObject( k ); - Print( tmp, buffer , false); - } - buffer.append( OUString::createFromAscii("\\GetName() ); - buffer.append( OUString::createFromAscii("\\>") ); - } - } - } - break; - case XML_NODE_TYPE_DATA: { - XMLData *pData = ( XMLData * ) pCur; - String sData = pData->GetData(); - buffer.append( sData ); - } - break; - case XML_NODE_TYPE_COMMENT: { - XMLComment *pComment = ( XMLComment * ) pCur; - buffer.append( OUString::createFromAscii("") ); - } - break; - case XML_NODE_TYPE_DEFAULT: { - XMLDefault *pDefault = ( XMLDefault * ) pCur; - buffer.append( pDefault->GetDefault() ); - } - break; - } - } - }else { - fprintf(stdout,"\n#+------Error: NULL Pointer in XMLELement::Print------+#\n"); - return; - } -} - - -// -// class XMLData -// -/*****************************************************************************/ -XMLData::XMLData(const XMLData& obj) -/*****************************************************************************/ - : XMLChildNode( obj ), - sData( obj.sData ) , - isNewCreated ( obj.isNewCreated ){} - -/*****************************************************************************/ -XMLData& XMLData::operator=(const XMLData& obj){ -/*****************************************************************************/ - if( this!=&obj ){ - XMLChildNode::operator=( obj ); - sData = obj.sData; - isNewCreated = obj.isNewCreated; - } - return *this; -} -/*****************************************************************************/ -void XMLData::AddData( const String &rData) { -/*****************************************************************************/ - sData += rData; -} - -/*****************************************************************************/ -USHORT XMLData::GetNodeType() -/*****************************************************************************/ -{ - return XML_NODE_TYPE_DATA; -} - -// -// class XMLComment -// - -/*****************************************************************************/ -USHORT XMLComment::GetNodeType() -/*****************************************************************************/ -{ - return XML_NODE_TYPE_COMMENT; -} -/*****************************************************************************/ -XMLComment::XMLComment(const XMLComment& obj) -/*****************************************************************************/ - : XMLChildNode( obj ), - sComment( obj.sComment ){} - -/*****************************************************************************/ -XMLComment& XMLComment::operator=(const XMLComment& obj){ -/*****************************************************************************/ - if( this!=&obj ){ - XMLChildNode::operator=( obj ); - sComment = obj.sComment; - } - return *this; -} - -// -// class XMLDefault -// - -/*****************************************************************************/ -USHORT XMLDefault::GetNodeType() -/*****************************************************************************/ -{ - return XML_NODE_TYPE_DEFAULT; -} -/*****************************************************************************/ -XMLDefault::XMLDefault(const XMLDefault& obj) -/*****************************************************************************/ - : XMLChildNode( obj ), - sDefault( obj.sDefault){} - -/*****************************************************************************/ -XMLDefault& XMLDefault::operator=(const XMLDefault& obj){ -/*****************************************************************************/ - if( this!=&obj ){ - XMLChildNode::operator=( obj ); - sDefault = obj.sDefault; - } - return *this; -} - - -// -// class SimpleXMLParser -// - -#define XML_CHAR_TO_OUSTRING(x) OStringToOUString(OString(x), RTL_TEXTENCODING_UTF8) -#define XML_CHAR_N_TO_OUSTRING(x,n) OStringToOUString(OString(x,n), RTL_TEXTENCODING_UTF8 ) - - -/*****************************************************************************/ -SimpleXMLParser::SimpleXMLParser() -/*****************************************************************************/ - : pXMLFile( NULL ) -{ - aParser = XML_ParserCreate( NULL ); - XML_SetUserData( aParser, this ); - XML_SetElementHandler( aParser, (XML_StartElementHandler) StartElementHandler, (XML_EndElementHandler) EndElementHandler ); - XML_SetCharacterDataHandler( aParser, (XML_CharacterDataHandler) CharacterDataHandler ); - XML_SetCommentHandler( aParser, (XML_CommentHandler) CommentHandler ); - XML_SetDefaultHandler( aParser, (XML_DefaultHandler) DefaultHandler ); -} - -/*****************************************************************************/ -SimpleXMLParser::~SimpleXMLParser() -/*****************************************************************************/ -{ - XML_ParserFree( aParser ); -} - -/*****************************************************************************/ -void SimpleXMLParser::StartElementHandler( - void *userData, const XML_Char *name, const XML_Char **atts ) -/*****************************************************************************/ -{ - (( SimpleXMLParser * ) userData )->StartElement( name, atts ); -} - - -/*****************************************************************************/ -void SimpleXMLParser::EndElementHandler( - void *userData, const XML_Char *name ) -/*****************************************************************************/ -{ - (( SimpleXMLParser * ) userData )->EndElement( name ); -} - -/*****************************************************************************/ -void SimpleXMLParser::CharacterDataHandler( - void *userData, const XML_Char *s, int len ) -/*****************************************************************************/ -{ - (( SimpleXMLParser * ) userData )->CharacterData( s, len ); -} - -/*****************************************************************************/ -void SimpleXMLParser::CommentHandler( - void *userData, const XML_Char *data ) -/*****************************************************************************/ -{ - (( SimpleXMLParser * ) userData )->Comment( data ); -} - -/*****************************************************************************/ -void SimpleXMLParser::DefaultHandler( - void *userData, const XML_Char *s, int len ) -/*****************************************************************************/ -{ - (( SimpleXMLParser * ) userData )->Default( s, len ); -} - -/*****************************************************************************/ -void SimpleXMLParser::StartElement( - const XML_Char *name, const XML_Char **atts ) -/*****************************************************************************/ -{ - String sElementName = String( XML_CHAR_TO_OUSTRING( name )); - XMLElement *pElement = new XMLElement( sElementName, ( XMLParentNode * ) pCurNode ); - pCurNode = pElement; - pCurData = NULL; - - int i = 0; - while( atts[i] ) { - pElement->AddAttribute( - String( XML_CHAR_TO_OUSTRING( atts[ i ] )), - String( XML_CHAR_TO_OUSTRING( atts[ i + 1 ] ))); - i += 2; - } -} - -/*****************************************************************************/ -void SimpleXMLParser::EndElement( const XML_Char *name ) -/*****************************************************************************/ -{ - // This variable is not used at all, but the the sax C interface can't be changed - // To prevent warnings this dummy assignment is used - // +++ - (void) name; - - pCurNode = pCurNode->GetParent(); - pCurData = NULL; -} - -/*****************************************************************************/ -void SimpleXMLParser::CharacterData( - const XML_Char *s, int len ) -/*****************************************************************************/ -{ - if ( !pCurData ){ - String x=String( XML_CHAR_N_TO_OUSTRING( s, len )); - XMLUtil::UnQuotHTML(x); - pCurData = new XMLData( x , pCurNode ); - }else{ - String x=String( XML_CHAR_N_TO_OUSTRING( s, len )); - XMLUtil::UnQuotHTML(x); - pCurData->AddData( x ); - - } -} - -/*****************************************************************************/ -void SimpleXMLParser::Comment( - const XML_Char *data ) -/*****************************************************************************/ -{ - pCurData = NULL; - new XMLComment( String( XML_CHAR_TO_OUSTRING( data )), pCurNode ); -} - -/*****************************************************************************/ -void SimpleXMLParser::Default( - const XML_Char *s, int len ) -/*****************************************************************************/ -{ - pCurData = NULL; - new XMLDefault( - String( XML_CHAR_N_TO_OUSTRING( s, len )), pCurNode ); -} - -/*****************************************************************************/ -XMLFile *SimpleXMLParser::Execute( const String &rFullFileName , const String &rFileName, XMLFile* pXMLFileIn ) -/*****************************************************************************/ -{ -// printf("DBG: SimpleXMLParser::Execute( %s )", ByteString( rFileName , RTL_TEXTENCODING_ASCII_US ).GetBuffer() ); - aErrorInformation.eCode = XML_ERROR_NONE; - aErrorInformation.nLine = 0; - aErrorInformation.nColumn = 0; - aErrorInformation.sMessage = String::CreateFromAscii( "ERROR: Unable to open file " ); - aErrorInformation.sMessage += rFileName; - - SvFileStream aStream( rFileName, STREAM_STD_READ ); - - if ( !aStream.IsOpen()) - return NULL; - - SvMemoryStream aMemStream; - aStream >> aMemStream; - aMemStream.Seek( 0 ); - - aStream.Close(); - - pXMLFile = pXMLFileIn; - pXMLFile->SetName( rFileName ); - pXMLFile->SetFullName( rFullFileName ); - - return Execute( &aMemStream ); -} - -/*****************************************************************************/ -XMLFile *SimpleXMLParser::Execute( SvMemoryStream *pStream ) -/*****************************************************************************/ -{ - if ( !pXMLFile ) - pXMLFile = new XMLFile( String()); - - pCurNode = pXMLFile; - pCurData = NULL; - - ULONG nPos = pStream->Tell(); - pStream->Seek( STREAM_SEEK_TO_END ); - - aErrorInformation.eCode = XML_ERROR_NONE; - aErrorInformation.nLine = 0; - aErrorInformation.nColumn = 0; - if ( pXMLFile->GetName().Len()) { - aErrorInformation.sMessage = String::CreateFromAscii( "File " ); - aErrorInformation.sMessage += pXMLFile->GetName(); - aErrorInformation.sMessage += String::CreateFromAscii( " parsed succesfully" ); - } - else - aErrorInformation.sMessage = String::CreateFromAscii( "XML-File parsed successfully" ); - - if ( !XML_Parse( - aParser, ( char * ) pStream->GetData() + nPos, pStream->Tell() - nPos, TRUE )) - { - aErrorInformation.eCode = XML_GetErrorCode( aParser ); - aErrorInformation.nLine = XML_GetErrorLineNumber( aParser ); - aErrorInformation.nColumn = XML_GetErrorColumnNumber( aParser ); - - aErrorInformation.sMessage = String::CreateFromAscii( "ERROR: " ); - if ( pXMLFile->GetName().Len()) - aErrorInformation.sMessage += pXMLFile->GetName(); - else - aErrorInformation.sMessage += String::CreateFromAscii( "XML-File" ); - aErrorInformation.sMessage += String::CreateFromAscii( " (" ); - aErrorInformation.sMessage += String::CreateFromInt64( aErrorInformation.nLine ); - aErrorInformation.sMessage += String::CreateFromAscii( "," ); - aErrorInformation.sMessage += String::CreateFromInt64( aErrorInformation.nColumn ); - aErrorInformation.sMessage += String::CreateFromAscii( "): " ); - - switch( aErrorInformation.eCode ) { - case XML_ERROR_NO_MEMORY: aErrorInformation.sMessage += String::CreateFromAscii( "No memory" ); break; - case XML_ERROR_SYNTAX: aErrorInformation.sMessage += String::CreateFromAscii( "Syntax" ); break; - case XML_ERROR_NO_ELEMENTS: aErrorInformation.sMessage += String::CreateFromAscii( "No elements" ); break; - case XML_ERROR_INVALID_TOKEN: aErrorInformation.sMessage += String::CreateFromAscii( "Invalid token" ); break; - case XML_ERROR_UNCLOSED_TOKEN: aErrorInformation.sMessage += String::CreateFromAscii( "Unclosed token" ); break; - case XML_ERROR_PARTIAL_CHAR: aErrorInformation.sMessage += String::CreateFromAscii( "Partial char" ); break; - case XML_ERROR_TAG_MISMATCH: aErrorInformation.sMessage += String::CreateFromAscii( "Tag mismatch" ); break; - case XML_ERROR_DUPLICATE_ATTRIBUTE: aErrorInformation.sMessage += String::CreateFromAscii( "Dublicat attribute" ); break; - case XML_ERROR_JUNK_AFTER_DOC_ELEMENT: aErrorInformation.sMessage += String::CreateFromAscii( "Junk after doc element" ); break; - case XML_ERROR_PARAM_ENTITY_REF: aErrorInformation.sMessage += String::CreateFromAscii( "Param entity ref" ); break; - case XML_ERROR_UNDEFINED_ENTITY: aErrorInformation.sMessage += String::CreateFromAscii( "Undefined entity" ); break; - case XML_ERROR_RECURSIVE_ENTITY_REF: aErrorInformation.sMessage += String::CreateFromAscii( "Recursive entity ref" ); break; - case XML_ERROR_ASYNC_ENTITY: aErrorInformation.sMessage += String::CreateFromAscii( "Async_entity" ); break; - case XML_ERROR_BAD_CHAR_REF: aErrorInformation.sMessage += String::CreateFromAscii( "Bad char ref" ); break; - case XML_ERROR_BINARY_ENTITY_REF: aErrorInformation.sMessage += String::CreateFromAscii( "Binary entity" ); break; - case XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF: aErrorInformation.sMessage += String::CreateFromAscii( "Attribute external entity ref" ); break; - case XML_ERROR_MISPLACED_XML_PI: aErrorInformation.sMessage += String::CreateFromAscii( "Misplaced xml pi" ); break; - case XML_ERROR_UNKNOWN_ENCODING: aErrorInformation.sMessage += String::CreateFromAscii( "Unknown encoding" ); break; - case XML_ERROR_INCORRECT_ENCODING: aErrorInformation.sMessage += String::CreateFromAscii( "Incorrect encoding" ); break; - case XML_ERROR_UNCLOSED_CDATA_SECTION: aErrorInformation.sMessage += String::CreateFromAscii( "Unclosed cdata section" ); break; - case XML_ERROR_EXTERNAL_ENTITY_HANDLING: aErrorInformation.sMessage += String::CreateFromAscii( "External entity handling" ); break; - case XML_ERROR_NOT_STANDALONE: aErrorInformation.sMessage += String::CreateFromAscii( "Not standalone" ); break; - case XML_ERROR_NONE: break; - default: - break; - - } - delete pXMLFile; - pXMLFile = NULL; - } - pStream->Seek( nPos ); - - return pXMLFile; -} - -/*****************************************************************************/ -void XMLUtil::QuotHTML( String &rString ) -/*****************************************************************************/ -{ - OUStringBuffer sReturn; - static const String LT(String::CreateFromAscii("<")); - static const String QLT(String::CreateFromAscii("<")); - static const String GT(String::CreateFromAscii(">")); - static const String QGT(String::CreateFromAscii(">")); - static const String QUOT(String::CreateFromAscii("\\")); - static const String QQUOT(String::CreateFromAscii(""")); - static const String APOS(String::CreateFromAscii("\"")); - static const String QAPOS(String::CreateFromAscii("'")); - static const String AMP(String::CreateFromAscii("&")); - static const String QAMP(String::CreateFromAscii("&")); - static const String SLASH(String::CreateFromAscii("\\")); - - for ( USHORT i = 0; i < rString.Len(); i++) { - if ( i < rString.Len()) { - switch ( rString.GetChar( i )) { - case '\\': if( i+1 <= rString.Len() ){ - switch( rString.GetChar( i+1 ) ){ - case '<': sReturn.append( LT );i++;break; - case '>': sReturn.append( GT );i++;break; - case '\\': sReturn.append( QUOT );i++;break; - case '\"': sReturn.append( APOS );i++;break; - //case '\'': sReturn += "\'";i++;break; - //case '&' : sRetrun += "&";i++;break; - default: sReturn.append( SLASH );break; - - } - } - break; - - case '<': - sReturn.append( QLT ); - break; - - case '>': - sReturn.append( QGT ); - break; - - case '\"': - sReturn.append( QQUOT ); - break; - -/* case '\'': - sReturn += "'"; - break; -*/ - case '&': - if ( - ( ( i + 4 ) < rString.Len()) && - ( String( rString.Copy( i, 5 ) ).Equals( QAMP ) ) - ) - sReturn.append( rString.GetChar( i ) ); - else - sReturn.append( QAMP ); - break; - - default: - sReturn.append( rString.GetChar( i ) ); - break; - } - } - } - rString = String( sReturn.makeStringAndClear() ); -} - -void XMLUtil::UnQuotHTML( String &rString ){ - UnQuotData( rString ); -} - -void XMLUtil::UnQuotData( String &rString_in ){ - ByteString sReturn; - ByteString sString( rString_in , RTL_TEXTENCODING_UTF8 ); - while ( sString.Len()) { - if ( sString.Copy( 0, 1 ) == "\\" ) { - sReturn += "\\\\"; - sString.Erase( 0, 1 ); - } - else if ( sString.Copy( 0, 5 ) == "&" ) { - sReturn += "&"; - sString.Erase( 0, 5 ); - } - else if ( sString.Copy( 0, 4 ) == "<" ) { - sReturn += "<"; - sString.Erase( 0, 4 ); - } - else if ( sString.Copy( 0, 4 ) == ">" ) { - sReturn += ">"; - sString.Erase( 0, 4 ); - } - else if ( sString.Copy( 0, 6 ) == """ ) { - sReturn += "\""; - sString.Erase( 0, 6 ); - } - else if ( sString.Copy( 0, 6 ) == "'" ) { - sReturn += "\'"; - sString.Erase( 0, 6 ); - } - else { - sReturn += sString.GetChar( 0 ); - sString.Erase( 0, 1 ); - } - } - rString_in = String(sReturn , RTL_TEXTENCODING_UTF8 ); - - -} - -XMLUtil::XMLUtil(){ -} - - -/*****************************************************************************/ -void XMLUtil::dump(){ -/*****************************************************************************/ - int cnt=1; - printf("size=%lu\n",static_cast(lMap.size())); - for(HashMap::iterator pos = lMap.begin(); pos != lMap.end() ; ++pos){ - fprintf(stdout,"key=%s , value=%d , no=%d\n",pos->first.GetBuffer(),pos->second,cnt++); - } -} -/*****************************************************************************/ -XMLUtil& XMLUtil::Instance(){ -/*****************************************************************************/ - static XMLUtil instance; - return instance; -} -/*****************************************************************************/ -XMLUtil::~XMLUtil(){} -/*****************************************************************************/ -/*****************************************************************************/ -ByteString XMLUtil::GetIsoLangByIndex( USHORT nIndex ) -/*****************************************************************************/ -{ - if(nIndex > 0 && MAX_LANGUAGES >= nIndex ) - return isoArray[nIndex]; - return ""; -} - diff --git a/transex3/source/xrm_yy_wrapper.c b/transex3/source/xrm_yy_wrapper.c deleted file mode 100644 index 6a304d0d09dc..000000000000 --- a/transex3/source/xrm_yy_wrapper.c +++ /dev/null @@ -1,2 +0,0 @@ -// Helper to suppress warnings in lex generated c code, see #i57362# -#include "xrm_yy.c" diff --git a/transex3/source/xrmlex.l b/transex3/source/xrmlex.l deleted file mode 100644 index efc8bf1f7d91..000000000000 --- a/transex3/source/xrmlex.l +++ /dev/null @@ -1,228 +0,0 @@ -%{ -/* - * lexer for parsing xml-property source files (*.xml) - * - */ - - -/* enlarge token buffer to tokenize whole strings */ -#undef YYLMAX -#define YYLMAX 64000 - -/* to enable debug output define LEXDEBUG */ -#define LEXDEBUG 1 -#ifdef LEXDEBUG -#define OUTPUT fprintf -#else -#define OUTPUT(Par1,Par2); -#endif - -/* table of possible token ids */ -#include "tokens.h" -#include -#include - -#if defined __GNUC__ -#pragma GCC system_header -#elif defined __SINPRO_CC -#pragma disable_warn -#elif defined _MSC_VER -#pragma warning(push, 1) -#endif - -/* external functions (C++ code, declared as extren "C" */ -extern int WorkOnTokenSet( int, char* ); -extern int Argument( char * ); -extern int InitXrmExport( char * , char * ); -extern int EndXrmExport(); -extern int GetError(); -extern int SetError(); -extern char *GetOutputFile( int argc, char* argv[]); -extern FILE *GetXrmFile(); -extern int isQuiet(); -extern void removeTempFile(); -extern char* getFilename(); - -/* forwards */ -void YYWarning(); - -int bText=0; -%} - -%p 24000 -%e 1200 -%n 500 - -%% - -"]*\> { - WorkOnTokenSet( XRM_README_START, yytext ); -} - -"" { - WorkOnTokenSet( XRM_README_END, yytext ); -} - -"]*\> { - WorkOnTokenSet( XRM_README_START, yytext ); -} - -"" { - WorkOnTokenSet( XRM_README_END, yytext ); -} - -"]*\> { - WorkOnTokenSet( XRM_SECTION_START, yytext ); -} - -"" { - WorkOnTokenSet( XRM_SECTION_END, yytext ); -} - -"]*\> { - WorkOnTokenSet( XRM_PARAGRAPH_START, yytext ); -} - -"" { - WorkOnTokenSet( XRM_PARAGRAPH_END, yytext ); -} - -"]*\> { - WorkOnTokenSet( XRM_TEXT_START, yytext ); -} - -"" { - WorkOnTokenSet( XRM_TEXT_END, yytext ); -} - -"]*\> { - WorkOnTokenSet( XRM_LIST_START, yytext ); -} - -"" { - WorkOnTokenSet( XRM_LIST_END, yytext ); -} - -"